Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1317)

Unified Diff: pkg/analysis_server/tool/spec/codegen_dart_protocol.dart

Issue 1431683002: Refactor analysis server code generation to re-use logic from analyzer. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 5 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: pkg/analysis_server/tool/spec/codegen_dart_protocol.dart
diff --git a/pkg/analysis_server/tool/spec/codegen_dart_protocol.dart b/pkg/analysis_server/tool/spec/codegen_dart_protocol.dart
index b77f4ef5ea1f7aca83b9e7ec117518959293e6a8..fc389a4762fd00aa0e984634a6145e336dbf281b 100644
--- a/pkg/analysis_server/tool/spec/codegen_dart_protocol.dart
+++ b/pkg/analysis_server/tool/spec/codegen_dart_protocol.dart
@@ -6,23 +6,16 @@ library codegen.protocol;
import 'dart:convert';
+import 'package:analyzer/src/codegen/tools.dart';
import 'package:html/dom.dart' as dom;
import 'api.dart';
import 'codegen_dart.dart';
-import 'codegen_tools.dart';
import 'from_html.dart';
import 'implied_types.dart';
import 'to_html.dart';
/**
- * Translate spec_input.html into protocol_matchers.dart.
- */
-main() {
- target.generate();
-}
-
-/**
* Special flags that need to be inserted into the declaration of the Element
* class.
*/
@@ -35,9 +28,9 @@ const Map<String, String> specialElementFlags = const {
'deprecated': '0x20'
};
-final GeneratedFile target =
- new GeneratedFile('../../lib/plugin/protocol/generated_protocol.dart', () {
- CodegenProtocolVisitor visitor = new CodegenProtocolVisitor(readApi());
+final GeneratedFile target = new GeneratedFile(
+ 'lib/plugin/protocol/generated_protocol.dart', (String pkgPath) {
+ CodegenProtocolVisitor visitor = new CodegenProtocolVisitor(readApi(pkgPath));
return visitor.collectCode(visitor.visitApi);
});
« no previous file with comments | « pkg/analysis_server/tool/spec/codegen_analysis_server.dart ('k') | pkg/analysis_server/tool/spec/codegen_inttest_methods.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698