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 fe79e5f2387a8e57efc10e7f687ee8925765bd8d..65b1d9217e54a5a9c0ef66d28c572561fd0c053a 100644 |
--- a/pkg/front_end/lib/src/scanner/token.dart |
+++ b/pkg/front_end/lib/src/scanner/token.dart |
@@ -308,21 +308,47 @@ abstract class Keyword { |
*/ |
static final Map<String, Keyword> keywords = _createKeywordMap(); |
+ final fasta.PrecedenceInfo info; |
+ |
/** |
- * The name of the keyword type. |
+ * A flag indicating whether the keyword is "built-in" identifier. |
*/ |
- String get name; |
+ final bool isBuiltIn; |
+ |
+ /** |
+ * A flag indicating whether the keyword can be used as an identifier |
+ * in some situations. |
+ */ |
+ final bool isPseudo; |
/** |
* The lexeme for the keyword. |
*/ |
- String get syntax; |
+ final String syntax; |
+ |
+ /** |
+ * Initialize a newly created keyword. |
+ */ |
+ const Keyword(this.syntax, |
+ {this.isBuiltIn: false, |
+ this.isPseudo: false, |
+ this.info: fasta.KEYWORD_INFO}); |
+ |
+ /** |
+ * A flag indicating whether the keyword is "built-in" identifier. |
+ * This method exists for backward compatibility and will be removed. |
+ * Use [isBuiltIn] instead. |
+ */ |
+ @deprecated |
+ bool get isPseudoKeyword => isBuiltIn; // TODO (danrubel): remove this |
/** |
- * A flag indicating whether the keyword is a pseudo-keyword. Pseudo keywords |
- * can be used as identifiers. |
+ * The name of the keyword type. |
*/ |
- bool get isPseudoKeyword; |
+ String get name => syntax.toUpperCase(); |
+ |
+ @override |
+ String toString() => name; |
/** |
* Create a table mapping the lexemes of keywords to the corresponding keyword |