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

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

Issue 2895983002: Read SDK and patches from a JSON file. (Closed)
Patch Set: Created 3 years, 7 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/diet_listener.dart
diff --git a/pkg/front_end/lib/src/fasta/source/diet_listener.dart b/pkg/front_end/lib/src/fasta/source/diet_listener.dart
index 00414f30916bc232890dcbdaa9b4a161b261875d..b505def6b9c4c11cd031f483ed76981766b5c7e8 100644
--- a/pkg/front_end/lib/src/fasta/source/diet_listener.dart
+++ b/pkg/front_end/lib/src/fasta/source/diet_listener.dart
@@ -48,7 +48,7 @@ class DietListener extends StackListener {
final CoreTypes coreTypes;
- final bool isDartLibrary;
+ final bool enableNative;
final TypeInferenceEngine typeInferenceEngine;
@@ -66,7 +66,7 @@ class DietListener extends StackListener {
: library = library,
uri = library.fileUri,
memberScope = library.scope,
- isDartLibrary = library.uri.scheme == "dart";
+ enableNative = (library.uri.scheme == "dart" || library.isPatch);
void discard(int n) {
for (int i = 0; i < n; i++) {
@@ -500,7 +500,7 @@ class DietListener extends StackListener {
@override
Token handleUnrecoverableError(Token token, FastaMessage message) {
- if (isDartLibrary && message.code == codeExpectedBlockToSkip) {
+ if (enableNative && message.code == codeExpectedBlockToSkip) {
Token recover = library.loader.target.skipNativeClause(token);
if (recover != null) return recover;
}
@@ -509,7 +509,7 @@ class DietListener extends StackListener {
@override
Link<Token> handleMemberName(Link<Token> identifiers) {
- if (!isDartLibrary || identifiers.isEmpty) return identifiers;
+ if (!enableNative || identifiers.isEmpty) return identifiers;
return removeNativeClause(identifiers);
}

Powered by Google App Engine
This is Rietveld 408576698