Index: pkg/front_end/lib/src/scanner/token.dart |
diff --git a/pkg/front_end/lib/src/scanner/token.dart b/pkg/front_end/lib/src/scanner/token.dart |
index ca3ea2b47d982f0e80fbc336c4c8349fe4cbfb53..aa2a041bb3f0bc26adbed0db4231af7178df6cda 100644 |
--- a/pkg/front_end/lib/src/scanner/token.dart |
+++ b/pkg/front_end/lib/src/scanner/token.dart |
@@ -372,6 +372,7 @@ class Keyword extends TokenType { |
/** |
* A flag indicating whether the keyword is "built-in" identifier. |
*/ |
+ @override |
final bool isBuiltIn; |
@override |
@@ -446,8 +447,6 @@ class KeywordToken extends SimpleToken { |
bool get isIdentifier => keyword.isPseudo || keyword.isBuiltIn; |
@override |
- // Changed return type from Keyword to Object because |
- // fasta considers pseudo-keywords to be keywords rather than identifiers |
Object value() => keyword; |
} |
@@ -606,7 +605,7 @@ class SimpleToken implements Token { |
String toString() => lexeme; |
@override |
- Object value() => type.lexeme; |
+ Object value() => lexeme; |
/** |
* Sets the `parent` property to `this` for the given [comment] and all the |
@@ -892,6 +891,17 @@ abstract class Token implements SyntacticEntity { |
Token setNextWithoutSettingPrevious(Token token); |
/** |
+ * Returns a textual representation of this token to be used for debugging |
+ * purposes. The resulting string might contain information about the |
+ * structure of the token, for example 'StringToken(foo)' for the identifier |
+ * token 'foo'. |
+ * |
+ * Use [lexeme] for the text actually parsed by the token. |
+ */ |
+ @override |
+ String toString(); |
+ |
+ /** |
* Return the value of this token. For keyword tokens, this is the keyword |
* associated with the token, for other tokens it is the lexeme associated |
* with the token. |
@@ -1530,6 +1540,11 @@ class TokenType { |
this == TokenType.STAR; |
/** |
+ * A flag indicating whether the keyword is a "built-in" identifier. |
+ */ |
+ bool get isBuiltIn => false; |
+ |
+ /** |
* Return `true` if this type of token represents an equality operator. |
*/ |
bool get isEqualityOperator => |