Index: pkg/compiler/lib/src/compiler.dart |
diff --git a/pkg/compiler/lib/src/compiler.dart b/pkg/compiler/lib/src/compiler.dart |
index 79ff968a7c1d4ee9ae130a7f73cbc0891db84664..aa7966667f84784e009c1b5e75f718a18231e210 100644 |
--- a/pkg/compiler/lib/src/compiler.dart |
+++ b/pkg/compiler/lib/src/compiler.dart |
@@ -93,6 +93,8 @@ import 'parser/diet_parser_task.dart' show |
DietParserTask; |
import 'parser/element_listener.dart' show |
ScannerOptions; |
+import 'parser/parser.dart' show |
+ ParserOptions; |
import 'parser/parser_task.dart' show |
ParserTask; |
import 'patch_parser.dart' show |
@@ -203,6 +205,9 @@ abstract class Compiler { |
final bool enableExperimentalMirrors; |
final bool enableAssertMessage; |
+ /// Bundle all parser related options. |
+ final ParserOptions _parserOptions; |
+ |
/** |
* The maximum size of a concrete type before it widens to dynamic during |
* concrete type inference. |
@@ -475,7 +480,9 @@ abstract class Compiler { |
this.hasIncrementalSupport = hasIncrementalSupport, |
cacheStrategy = new CacheStrategy(hasIncrementalSupport), |
this.userOutputProvider = outputProvider == null |
- ? const NullCompilerOutput() : outputProvider { |
+ ? const NullCompilerOutput() : outputProvider, |
+ this._parserOptions = new ParserOptions( |
+ enableConditionalDirectives: enableConditionalDirectives) { |
if (hasIncrementalSupport) { |
// TODO(ahe): This is too much. Any method from platform and package |
// libraries can be inlined. |
@@ -485,7 +492,7 @@ abstract class Compiler { |
// TODO(johnniwinther): Initialize core types in [initializeCoreClasses] and |
// make its field final. |
_reporter = new _CompilerDiagnosticReporter(this, diagnosticOptions); |
- _parsing = new _CompilerParsing(this); |
+ _parsing = new _CompilerParsing(this, _parserOptions); |
_resolution = new _CompilerResolution(this); |
_coreTypes = new _CompilerCoreTypes(_resolution); |
types = new Types(_resolution); |
@@ -518,12 +525,9 @@ abstract class Compiler { |
libraryLoader = new LibraryLoaderTask(this), |
serialization = new SerializationTask(this), |
scanner = new ScannerTask(this), |
- dietParser = new DietParserTask( |
- this, enableConditionalDirectives: enableConditionalDirectives), |
- parser = new ParserTask( |
- this, enableConditionalDirectives: enableConditionalDirectives), |
- patchParser = new PatchParserTask( |
- this, enableConditionalDirectives: enableConditionalDirectives), |
+ dietParser = new DietParserTask(this, _parserOptions), |
+ parser = new ParserTask(this, _parserOptions), |
+ patchParser = new PatchParserTask(this, _parserOptions), |
resolver = new ResolverTask(this, backend.constantCompilerTask), |
closureToClassMapper = new closureMapping.ClosureTask(this), |
checker = new TypeCheckerTask(this), |
@@ -2163,8 +2167,9 @@ class _CompilerResolution implements Resolution { |
// and [ScannerTask] here. |
class _CompilerParsing implements Parsing { |
final Compiler compiler; |
+ final ParserOptions parserOptions; |
- _CompilerParsing(this.compiler); |
+ _CompilerParsing(this.compiler, this.parserOptions); |
@override |
DiagnosticReporter get reporter => compiler.reporter; |