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

Unified Diff: pkg/analysis_server/tool/spec/codegen_matchers.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_matchers.dart
diff --git a/pkg/analysis_server/tool/spec/codegen_matchers.dart b/pkg/analysis_server/tool/spec/codegen_matchers.dart
index 5786493a63f3fcc1c9e1f65699ed93f306f5b882..be2f847e398d60cf8799bab47f3047a16cdc2244 100644
--- a/pkg/analysis_server/tool/spec/codegen_matchers.dart
+++ b/pkg/analysis_server/tool/spec/codegen_matchers.dart
@@ -9,25 +9,19 @@ library codegen.matchers;
import 'dart:convert';
+import 'package:analyzer/src/codegen/tools.dart';
+
import 'api.dart';
-import 'codegen_tools.dart';
import 'from_html.dart';
import 'implied_types.dart';
import 'to_html.dart';
-final GeneratedFile target =
- new GeneratedFile('../../test/integration/protocol_matchers.dart', () {
- CodegenMatchersVisitor visitor = new CodegenMatchersVisitor(readApi());
+final GeneratedFile target = new GeneratedFile(
+ 'test/integration/protocol_matchers.dart', (String pkgPath) {
+ CodegenMatchersVisitor visitor = new CodegenMatchersVisitor(readApi(pkgPath));
return visitor.collectCode(visitor.visitApi);
});
-/**
- * Translate spec_input.html into protocol_matchers.dart.
- */
-main() {
- target.generate();
-}
-
class CodegenMatchersVisitor extends HierarchicalApiVisitor with CodeGenerator {
/**
* Visitor used to produce doc comments.
« no previous file with comments | « pkg/analysis_server/tool/spec/codegen_java_types.dart ('k') | pkg/analysis_server/tool/spec/codegen_tools.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698