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

Unified Diff: pkg/compiler/lib/src/patch_parser.dart

Issue 1864433004: Repeats and fixes the changes landed & reverted as CL 1789553003. (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: Updates to external dependents 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 side-by-side diff with in-line comments
Download patch
Index: pkg/compiler/lib/src/patch_parser.dart
diff --git a/pkg/compiler/lib/src/patch_parser.dart b/pkg/compiler/lib/src/patch_parser.dart
index fb2e437048ae709b5bf2282804e6453a7365ad99..977d8a901f62a22ec8a0a5f8bef0dc9e083b2eba 100644
--- a/pkg/compiler/lib/src/patch_parser.dart
+++ b/pkg/compiler/lib/src/patch_parser.dart
@@ -137,6 +137,8 @@ import 'js_backend/js_backend.dart' show
JavaScriptBackend;
import 'library_loader.dart' show
LibraryLoader;
+import 'options.dart' show
+ ParserOptions;
import 'parser/listener.dart' show
Listener,
ParserError;
@@ -159,11 +161,9 @@ import 'tokens/token.dart' show
class PatchParserTask extends CompilerTask {
final String name = "Patching Parser";
- final bool _enableConditionalDirectives;
+ final ParserOptions parserOptions;
- PatchParserTask(Compiler compiler, {bool enableConditionalDirectives})
- : this._enableConditionalDirectives = enableConditionalDirectives,
- super(compiler);
+ PatchParserTask(Compiler compiler, this.parserOptions) : super(compiler);
/**
* Scans a library patch file, applies the method patches and
@@ -198,9 +198,7 @@ class PatchParserTask extends CompilerTask {
compilationUnit,
idGenerator);
try {
- new PartialParser(patchListener,
- enableConditionalDirectives: _enableConditionalDirectives)
- .parseUnit(tokens);
+ new PartialParser(patchListener, parserOptions).parseUnit(tokens);
} on ParserError catch (e) {
// No need to recover from a parser error in platform libraries, user
// will never see this if the libraries are tested correctly.
@@ -217,8 +215,7 @@ class PatchParserTask extends CompilerTask {
measure(() => reporter.withCurrentElement(cls, () {
MemberListener listener = new PatchMemberListener(compiler, cls);
- Parser parser = new PatchClassElementParser(
- listener, enableConditionalDirectives: _enableConditionalDirectives);
+ Parser parser = new PatchClassElementParser(listener, parserOptions);
try {
Token token = parser.parseTopLevelDeclaration(cls.beginToken);
assert(identical(token, cls.endToken.next));
@@ -270,9 +267,8 @@ class PatchMemberListener extends MemberListener {
* declarations.
*/
class PatchClassElementParser extends PartialParser {
- PatchClassElementParser(Listener listener, {bool enableConditionalDirectives})
- : super(listener,
- enableConditionalDirectives: enableConditionalDirectives);
+ PatchClassElementParser(Listener listener, ParserOptions options)
+ : super(listener, options);
Token parseClassBody(Token token) => fullParseClassBody(token);
}
« no previous file with comments | « pkg/compiler/lib/src/parser/partial_parser.dart ('k') | pkg/dart2js_incremental/lib/dart2js_incremental.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698