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

Unified Diff: pkg/front_end/lib/src/fasta/source/directive_listener.dart

Issue 2832353002: Add support for building patched_sdk and platform.dill for dart2js: (Closed)
Patch Set: fix .gn circularity by removing use of rebase_path Created 3 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/front_end/lib/src/fasta/source/directive_listener.dart
diff --git a/pkg/front_end/lib/src/fasta/source/directive_listener.dart b/pkg/front_end/lib/src/fasta/source/directive_listener.dart
index 278b44a02bb6977e887a4ca222d5a215591b163c..2adf931162d80de7e7e4b86f3420fb8a2e382937 100644
--- a/pkg/front_end/lib/src/fasta/source/directive_listener.dart
+++ b/pkg/front_end/lib/src/fasta/source/directive_listener.dart
@@ -7,7 +7,6 @@
library front_end.src.fasta.source.directive_listener;
import '../fasta_codes.dart' show FastaMessage, codeExpectedBlockToSkip;
-import '../parser/dart_vm_native.dart' show skipNativeClause;
import '../parser/listener.dart';
import '../quote.dart';
import '../scanner/token.dart';
@@ -20,9 +19,6 @@ import '../scanner/token.dart';
/// any top-level declaration, but we recommend to continue parsing the entire
/// file in order to gracefully handle input errors.
class DirectiveListener extends Listener {
- /// Whether we accept the native-syntax used by the VM patch files.
- final bool acceptsNativeClause;
-
/// Collects URIs that occur on any import directive.
final Set<String> imports = new Set<String>();
@@ -32,7 +28,7 @@ class DirectiveListener extends Listener {
/// Collects URIs that occur on any part directive.
final Set<String> parts = new Set<String>();
- DirectiveListener({this.acceptsNativeClause: false});
+ DirectiveListener();
/// Set when entering the context of a directive, null when the parser is not
/// looking at a directive.
@@ -79,10 +75,14 @@ class DirectiveListener extends Listener {
@override
Token handleUnrecoverableError(Token token, FastaMessage message) {
- if (acceptsNativeClause && message.code == codeExpectedBlockToSkip) {
- Token recover = skipNativeClause(token);
+ if (message.code == codeExpectedBlockToSkip) {
+ Token recover = handleNativeClause(token);
if (recover != null) return recover;
}
return super.handleUnrecoverableError(token, message);
}
+
+ /// Defines how native clauses are handled. By default, they are not handled
+ /// and an error is thrown;
+ Token handleNativeClause(Token token) => null;
}
« no previous file with comments | « pkg/front_end/lib/src/fasta/source/diet_listener.dart ('k') | pkg/front_end/lib/src/fasta/source/outline_builder.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698