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

Side by Side Diff: pkg/analysis_server/tool/spec/codegen_protocol_constants.dart

Issue 3002293003: Convert GeneratedContent to async and use AnalysisDriver for tasks graph. (Closed)
Patch Set: Created 3 years, 3 months 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 unified diff | Download patch
OLDNEW
1 // Copyright (c) 2017, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2017, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 import 'package:analyzer/src/codegen/tools.dart'; 5 import 'package:analyzer/src/codegen/tools.dart';
6 import 'package:front_end/src/codegen/tools.dart'; 6 import 'package:front_end/src/codegen/tools.dart';
7 7
8 import 'api.dart'; 8 import 'api.dart';
9 import 'codegen_dart.dart'; 9 import 'codegen_dart.dart';
10 import 'from_html.dart'; 10 import 'from_html.dart';
11 11
12 final GeneratedFile target = 12 final GeneratedFile target = new GeneratedFile(
13 new GeneratedFile('lib/protocol/protocol_constants.dart', (String pkgPath) { 13 'lib/protocol/protocol_constants.dart', (String pkgPath) async {
14 CodegenVisitor visitor = new CodegenVisitor(readApi(pkgPath)); 14 CodegenVisitor visitor = new CodegenVisitor(readApi(pkgPath));
15 return visitor.collectCode(visitor.visitApi); 15 return visitor.collectCode(visitor.visitApi);
16 }); 16 });
17 17
18 /** 18 /**
19 * A visitor that produces Dart code defining constants associated with the API. 19 * A visitor that produces Dart code defining constants associated with the API.
20 */ 20 */
21 class CodegenVisitor extends DartCodegenVisitor with CodeGenerator { 21 class CodegenVisitor extends DartCodegenVisitor with CodeGenerator {
22 CodegenVisitor(Api api) : super(api) { 22 CodegenVisitor(Api api) : super(api) {
23 codeGeneratorSettings.commentLineLength = 79; 23 codeGeneratorSettings.commentLineLength = 79;
(...skipping 137 matching lines...) Expand 10 before | Expand all | Expand 10 after
161 int index = first.indexOf(regExp, start); 161 int index = first.indexOf(regExp, start);
162 while (index >= 0) { 162 while (index >= 0) {
163 components.add(first.substring(start - 1, index)); 163 components.add(first.substring(start - 1, index));
164 start = index + 1; 164 start = index + 1;
165 index = first.indexOf(regExp, start); 165 index = first.indexOf(regExp, start);
166 } 166 }
167 components.add(first.substring(start - 1)); 167 components.add(first.substring(start - 1));
168 return components; 168 return components;
169 } 169 }
170 } 170 }
OLDNEW
« no previous file with comments | « pkg/analysis_server/tool/spec/codegen_matchers.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