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

Side by Side Diff: pkg/compiler/lib/src/parser/diet_parser_task.dart

Issue 1859543002: Revert "Introduces `ParserOptions`." (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: Created 4 years, 8 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) 2015, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2015, 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 library dart2js.parser.diet.task; 5 library dart2js.parser.diet.task;
6 6
7 import '../common.dart'; 7 import '../common.dart';
8 import '../common/tasks.dart' show 8 import '../common/tasks.dart' show
9 CompilerTask; 9 CompilerTask;
10 import '../compiler.dart' show 10 import '../compiler.dart' show
11 Compiler; 11 Compiler;
12 import '../elements/elements.dart' show 12 import '../elements/elements.dart' show
13 CompilationUnitElement; 13 CompilationUnitElement;
14 import '../tokens/token.dart' show 14 import '../tokens/token.dart' show
15 Token; 15 Token;
16 16
17 import 'listener.dart' show 17 import 'listener.dart' show
18 ParserError; 18 ParserError;
19 import 'element_listener.dart' show 19 import 'element_listener.dart' show
20 ElementListener, 20 ElementListener,
21 ScannerOptions; 21 ScannerOptions;
22 import '../options.dart' show
23 ParserOptions;
24 import 'partial_parser.dart' show 22 import 'partial_parser.dart' show
25 PartialParser; 23 PartialParser;
26 24
27 class DietParserTask extends CompilerTask { 25 class DietParserTask extends CompilerTask {
28 final ParserOptions _parserOptions; 26 final bool _enableConditionalDirectives;
29 27
30 DietParserTask(Compiler compiler, this._parserOptions) : super(compiler); 28 DietParserTask(Compiler compiler, {bool enableConditionalDirectives})
29 : this._enableConditionalDirectives = enableConditionalDirectives,
30 super(compiler);
31 31
32 final String name = 'Diet Parser'; 32 final String name = 'Diet Parser';
33 33
34 dietParse(CompilationUnitElement compilationUnit, Token tokens) { 34 dietParse(CompilationUnitElement compilationUnit, Token tokens) {
35 measure(() { 35 measure(() {
36 Function idGenerator = compiler.getNextFreeClassId; 36 Function idGenerator = compiler.getNextFreeClassId;
37 ScannerOptions scannerOptions = 37 ScannerOptions scannerOptions = new ScannerOptions(
38 new ScannerOptions.from(compiler, compilationUnit.library); 38 canUseNative: compiler.backend.canLibraryUseNative(
39 compilationUnit.library));
39 ElementListener listener = new ElementListener( 40 ElementListener listener = new ElementListener(
40 scannerOptions, compiler.reporter, compilationUnit, idGenerator); 41 scannerOptions, compiler.reporter, compilationUnit, idGenerator);
41 PartialParser parser = new PartialParser(listener, _parserOptions); 42 PartialParser parser = new PartialParser(
43 listener, enableConditionalDirectives: _enableConditionalDirectives);
42 try { 44 try {
43 parser.parseUnit(tokens); 45 parser.parseUnit(tokens);
44 } on ParserError catch(_) { 46 } on ParserError catch(_) {
45 assert(invariant(compilationUnit, compiler.compilationFailed)); 47 assert(invariant(compilationUnit, compiler.compilationFailed));
46 } 48 }
47 }); 49 });
48 } 50 }
49 } 51 }
OLDNEW
« no previous file with comments | « pkg/compiler/lib/src/parser/class_element_parser.dart ('k') | pkg/compiler/lib/src/parser/element_listener.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698