openapi-generator/bin/utils/dart-keywords/save-dart-keywords.dart
Nick Meinhold 11bcb661a1 Dart generate keywords (#4449)
* Add script to use Dart SDK to generate keywords

* Read generated keywords in dart generator
2019-11-12 00:11:43 +08:00

17 lines
473 B
Dart

import 'dart:io';
import 'package:analyzer/dart/ast/token.dart';
main() {
// save keywords to a text file
final txtFile = File(
'../../../modules/openapi-generator/src/main/resources/dart/dart-keywords.txt');
String txtString = '';
for (String keyword in Keyword.keywords.keys.toList()) {
txtString += keyword + '\n';
}
txtString =
txtString.substring(0, txtString.length - 1); // remove last newline
txtFile.writeAsStringSync(txtString);
}