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

Unified Diff: pkg/compiler/lib/src/tokens/keyword.dart

Issue 1311783012: Split parser/listener.dart, parser/class_element_listener.dart and tokens/token.dart into smaller l… (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: Created 5 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: pkg/compiler/lib/src/tokens/keyword.dart
diff --git a/pkg/compiler/lib/src/tokens/keyword.dart b/pkg/compiler/lib/src/tokens/keyword.dart
index a59461d8b0b7bc1e05bcf899746fc5dd6d98aa37..ce1bc87c9900aaf197e06742b1856c3b53f2283e 100644
--- a/pkg/compiler/lib/src/tokens/keyword.dart
+++ b/pkg/compiler/lib/src/tokens/keyword.dart
@@ -4,14 +4,15 @@
library dart2js.tokens.keywords;
-import '../util/characters.dart' show
+import '../util/characters.dart' as Characters show
$a;
-import 'token.dart' show
+import 'precedence.dart' show
+ PrecedenceInfo;
+import 'precedence_constants.dart' as Precedence show
AS_INFO,
IS_INFO,
- KEYWORD_INFO,
- PrecedenceInfo;
+ KEYWORD_INFO;
/**
* A keyword in the Dart programming language.
@@ -53,10 +54,10 @@ class Keyword {
// TODO(ahe): Don't think this is a reserved word.
// See: http://dartbug.com/5579
- const Keyword("is", info: IS_INFO),
+ const Keyword("is", info: Precedence.IS_INFO),
const Keyword("abstract", isBuiltIn: true),
- const Keyword("as", info: AS_INFO, isBuiltIn: true),
+ const Keyword("as", info: Precedence.AS_INFO, isBuiltIn: true),
const Keyword("dynamic", isBuiltIn: true),
const Keyword("export", isBuiltIn: true),
const Keyword("external", isBuiltIn: true),
@@ -99,7 +100,7 @@ class Keyword {
const Keyword(this.syntax,
{this.isPseudo: false,
this.isBuiltIn: false,
- this.info: KEYWORD_INFO});
+ this.info: Precedence.KEYWORD_INFO});
static Map<String, Keyword> computeKeywordMap() {
Map<String, Keyword> result = new Map<String, Keyword>();
@@ -150,10 +151,10 @@ abstract class KeywordState {
int c = strings[i].codeUnitAt(start);
if (chunk != c) {
if (chunkStart != -1) {
- assert(result[chunk - $a] == null);
- result[chunk - $a] = computeKeywordStateTable(start + 1, strings,
- chunkStart,
- i - chunkStart);
+ assert(result[chunk - Characters.$a] == null);
+ result[chunk - Characters.$a] =
+ computeKeywordStateTable(
+ start + 1, strings, chunkStart, i - chunkStart);
}
chunkStart = i;
chunk = c;
@@ -161,8 +162,8 @@ abstract class KeywordState {
}
}
if (chunkStart != -1) {
- assert(result[chunk - $a] == null);
- result[chunk - $a] =
+ assert(result[chunk - Characters.$a] == null);
+ result[chunk - Characters.$a] =
computeKeywordStateTable(start + 1, strings, chunkStart,
offset + length - chunkStart);
} else {
@@ -186,7 +187,7 @@ class ArrayKeywordState extends KeywordState {
ArrayKeywordState(List<KeywordState> this.table, String syntax)
: super((syntax == null) ? null : Keyword.keywords[syntax]);
- KeywordState next(int c) => table[c - $a];
+ KeywordState next(int c) => table[c - Characters.$a];
String toString() {
StringBuffer sb = new StringBuffer();
@@ -199,7 +200,8 @@ class ArrayKeywordState extends KeywordState {
List<KeywordState> foo = table;
for (int i = 0; i < foo.length; i++) {
if (foo[i] != null) {
- sb.write("${new String.fromCharCodes([i + $a])}: ${foo[i]}; ");
+ sb.write("${new String.fromCharCodes([i + Characters.$a])}: "
+ "${foo[i]}; ");
}
}
sb.write("]");

Powered by Google App Engine
This is Rietveld 408576698