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

Unified Diff: pkg/analysis_server/tool/spec/from_html.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
« no previous file with comments | « pkg/analysis_server/tool/spec/codegen_tools.dart ('k') | pkg/analysis_server/tool/spec/generate_all.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/analysis_server/tool/spec/from_html.dart
diff --git a/pkg/analysis_server/tool/spec/from_html.dart b/pkg/analysis_server/tool/spec/from_html.dart
index 1ae94254308225ba589857c5b9dde1bb1efb66ac..db7c224aa78ceb0e0eeb14b786014a868c1dc607 100644
--- a/pkg/analysis_server/tool/spec/from_html.dart
+++ b/pkg/analysis_server/tool/spec/from_html.dart
@@ -9,11 +9,12 @@ library from.html;
import 'dart:io';
+import 'package:analyzer/src/codegen/html.dart';
import 'package:html/dom.dart' as dom;
import 'package:html/parser.dart' as parser;
+import 'package:path/path.dart';
import 'api.dart';
-import 'html_tools.dart';
const List<String> specialElements = const [
'domain',
@@ -287,10 +288,11 @@ List<TypeDecl> processContentsAsTypes(dom.Element html, String context) {
}
/**
- * Read the API description from the file 'spec_input.html'.
+ * Read the API description from the file 'spec_input.html'. [pkgPath] is the
+ * path to the current package.
*/
-Api readApi() {
- File htmlFile = new File('spec_input.html');
+Api readApi(String pkgPath) {
+ File htmlFile = new File(join(pkgPath, 'tool', 'spec', 'spec_input.html'));
String htmlContents = htmlFile.readAsStringSync();
dom.Document document = parser.parse(htmlContents);
dom.Element htmlElement = document.children
« no previous file with comments | « pkg/analysis_server/tool/spec/codegen_tools.dart ('k') | pkg/analysis_server/tool/spec/generate_all.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698