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

Unified Diff: pkg/front_end/lib/src/fasta/scanner/token.dart

Issue 2750863002: Complain about built-in identifiers. (Closed)
Patch Set: Address comments. Created 3 years, 9 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/parser/parser.dart ('k') | tests/co19/co19-dart2js.status » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/front_end/lib/src/fasta/scanner/token.dart
diff --git a/pkg/front_end/lib/src/fasta/scanner/token.dart b/pkg/front_end/lib/src/fasta/scanner/token.dart
index bb7efd89bf71e1de9960e0bb0ffaac7969971493..0ff43857119f453627657725b236a51daacb0592 100644
--- a/pkg/front_end/lib/src/fasta/scanner/token.dart
+++ b/pkg/front_end/lib/src/fasta/scanner/token.dart
@@ -126,6 +126,8 @@ abstract class Token {
@override
bool get isOperator => info.isOperator;
+
+ bool get isBuiltInIdentifier => false;
}
/**
@@ -177,6 +179,12 @@ class KeywordToken extends Token {
bool isIdentifier() => keyword.isPseudo || keyword.isBuiltIn;
+ bool get isBuiltInIdentifier {
+ // TODO(ahe): Remove special case for "deferred" once dartbug.com/29069 is
+ // fixed.
+ return keyword.isBuiltIn || identical("deferred", lexeme);
+ }
+
String toString() => "KeywordToken($lexeme)";
}
« no previous file with comments | « pkg/front_end/lib/src/fasta/parser/parser.dart ('k') | tests/co19/co19-dart2js.status » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698