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

Unified Diff: dart/lib/compiler/implementation/scanner/token.dart

Issue 10917170: Improve handling of built-in identifiers. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 8 years, 3 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: dart/lib/compiler/implementation/scanner/token.dart
diff --git a/dart/lib/compiler/implementation/scanner/token.dart b/dart/lib/compiler/implementation/scanner/token.dart
index 86ef6d8cc4c934000910398f15f32eab037ecebf..6821a14f2e6c338e8bea8be201fac6fb148128cf 100644
--- a/dart/lib/compiler/implementation/scanner/token.dart
+++ b/dart/lib/compiler/implementation/scanner/token.dart
@@ -124,11 +124,7 @@ class Token {
*/
int get precedence => info.precedence;
- bool isIdentifier() {
- if (kind === IDENTIFIER_TOKEN) return true;
- if (kind === KEYWORD_TOKEN) return value.isPseudo;
- return false;
- }
+ bool isIdentifier() => kind === IDENTIFIER_TOKEN;
/**
* Returns a textual representation of this token to be used for debugging
@@ -159,6 +155,8 @@ class KeywordToken extends Token {
KeywordToken(Keyword value, int charOffset)
: this.value = value, super(value.info, charOffset);
+ bool isIdentifier() => value.isPseudo || value.isBuiltIn;
+
String toString() => value.syntax;
}

Powered by Google App Engine
This is Rietveld 408576698