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

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: Merged with 1333f97b9a0e3805f991578ef83b0ec4553ecf33 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
« no previous file with comments | « pkg/front_end/lib/src/fasta/loader.dart ('k') | pkg/front_end/lib/src/fasta/source/outline_builder.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 ee46b5b1861fc5f6a2959a4f6625f3efa2aa8cce..c43900e5dc1e0f3db8a4dafeb97af217b0efb0ea 100644
--- a/pkg/front_end/lib/src/fasta/source/diet_listener.dart
+++ b/pkg/front_end/lib/src/fasta/source/diet_listener.dart
@@ -45,7 +45,7 @@ class DietListener extends StackListener {
final CoreTypes coreTypes;
- final bool isDartLibrary;
+ final bool enableNative;
final TypeInferenceEngine typeInferenceEngine;
@@ -63,7 +63,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++) {
@@ -487,7 +487,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;
}
@@ -496,7 +496,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);
}
« no previous file with comments | « pkg/front_end/lib/src/fasta/loader.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