| OLD | NEW |
| 1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file |
| 2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
| 3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
| 4 | 4 |
| 5 /** | 5 /** |
| 6 * A keyword in the Dart programming language. | 6 * A keyword in the Dart programming language. |
| 7 */ | 7 */ |
| 8 class Keyword implements SourceString { | 8 class Keyword implements SourceString { |
| 9 static final Keyword BREAK = const Keyword("break"); | 9 static final Keyword BREAK = const Keyword("break"); |
| 10 static final Keyword CASE = const Keyword("case"); | 10 static final Keyword CASE = const Keyword("case"); |
| 11 static final Keyword CATCH = const Keyword("catch"); | 11 static final Keyword CATCH = const Keyword("catch"); |
| 12 static final Keyword CLASS = const Keyword("class"); |
| 12 static final Keyword CONST = const Keyword("const"); | 13 static final Keyword CONST = const Keyword("const"); |
| 13 static final Keyword CONTINUE = const Keyword("continue"); | 14 static final Keyword CONTINUE = const Keyword("continue"); |
| 14 static final Keyword DEFAULT = const Keyword("default"); | 15 static final Keyword DEFAULT = const Keyword("default"); |
| 15 static final Keyword DO = const Keyword("do"); | 16 static final Keyword DO = const Keyword("do"); |
| 16 static final Keyword ELSE = const Keyword("else"); | 17 static final Keyword ELSE = const Keyword("else"); |
| 18 static final Keyword EXTENDS = const Keyword("extends"); |
| 17 static final Keyword FALSE = const Keyword("false"); | 19 static final Keyword FALSE = const Keyword("false"); |
| 18 static final Keyword FINAL = const Keyword("final"); | 20 static final Keyword FINAL = const Keyword("final"); |
| 19 static final Keyword FINALLY = const Keyword("finally"); | 21 static final Keyword FINALLY = const Keyword("finally"); |
| 20 static final Keyword FOR = const Keyword("for"); | 22 static final Keyword FOR = const Keyword("for"); |
| 21 static final Keyword IF = const Keyword("if"); | 23 static final Keyword IF = const Keyword("if"); |
| 22 static final Keyword IN = const Keyword("in"); | 24 static final Keyword IN = const Keyword("in"); |
| 23 static final Keyword IS = const Keyword("is"); | 25 static final Keyword IS = const Keyword("is"); |
| 24 static final Keyword NEW = const Keyword("new"); | 26 static final Keyword NEW = const Keyword("new"); |
| 25 static final Keyword NULL = const Keyword("null"); | 27 static final Keyword NULL = const Keyword("null"); |
| 26 static final Keyword RETURN = const Keyword("return"); | 28 static final Keyword RETURN = const Keyword("return"); |
| 27 static final Keyword SUPER = const Keyword("super"); | 29 static final Keyword SUPER = const Keyword("super"); |
| 28 static final Keyword SWITCH = const Keyword("switch"); | 30 static final Keyword SWITCH = const Keyword("switch"); |
| 29 static final Keyword THIS = const Keyword("this"); | 31 static final Keyword THIS = const Keyword("this"); |
| 30 static final Keyword THROW = const Keyword("throw"); | 32 static final Keyword THROW = const Keyword("throw"); |
| 31 static final Keyword TRUE = const Keyword("true"); | 33 static final Keyword TRUE = const Keyword("true"); |
| 32 static final Keyword TRY = const Keyword("try"); | 34 static final Keyword TRY = const Keyword("try"); |
| 33 static final Keyword VAR = const Keyword("var"); | 35 static final Keyword VAR = const Keyword("var"); |
| 34 static final Keyword VOID = const Keyword("void"); | 36 static final Keyword VOID = const Keyword("void"); |
| 35 static final Keyword WHILE = const Keyword("while"); | 37 static final Keyword WHILE = const Keyword("while"); |
| 36 | 38 |
| 37 // Pseudo keywords: | 39 // Pseudo keywords: |
| 38 static final Keyword ABSTRACT = const Keyword("abstract", true); | 40 static final Keyword ABSTRACT = const Keyword("abstract", true); |
| 39 static final Keyword ASSERT = const Keyword("assert", true); | 41 static final Keyword ASSERT = const Keyword("assert", true); |
| 40 static final Keyword CLASS = const Keyword("class", true); | |
| 41 static final Keyword EXTENDS = const Keyword("extends", true); | |
| 42 static final Keyword FACTORY = const Keyword("factory", true); | 42 static final Keyword FACTORY = const Keyword("factory", true); |
| 43 static final Keyword GET = const Keyword("get", true); | 43 static final Keyword GET = const Keyword("get", true); |
| 44 static final Keyword IMPLEMENTS = const Keyword("implements", true); | 44 static final Keyword IMPLEMENTS = const Keyword("implements", true); |
| 45 static final Keyword IMPORT = const Keyword("import", true); | 45 static final Keyword IMPORT = const Keyword("import", true); |
| 46 static final Keyword INTERFACE = const Keyword("interface", true); | 46 static final Keyword INTERFACE = const Keyword("interface", true); |
| 47 static final Keyword LIBRARY = const Keyword("library", true); | 47 static final Keyword LIBRARY = const Keyword("library", true); |
| 48 static final Keyword NATIVE = const Keyword("native", true); | 48 static final Keyword NATIVE = const Keyword("native", true); |
| 49 static final Keyword NEGATE = const Keyword("negate", true); | 49 static final Keyword NEGATE = const Keyword("negate", true); |
| 50 static final Keyword OPERATOR = const Keyword("operator", true); | 50 static final Keyword OPERATOR = const Keyword("operator", true); |
| 51 static final Keyword SET = const Keyword("set", true); | 51 static final Keyword SET = const Keyword("set", true); |
| (...skipping 185 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 237 final Keyword keyword; | 237 final Keyword keyword; |
| 238 | 238 |
| 239 LeafKeywordState(String syntax) : keyword = Keyword.keywords[syntax]; | 239 LeafKeywordState(String syntax) : keyword = Keyword.keywords[syntax]; |
| 240 | 240 |
| 241 bool isLeaf() => true; | 241 bool isLeaf() => true; |
| 242 | 242 |
| 243 KeywordState next(int c) => null; | 243 KeywordState next(int c) => null; |
| 244 | 244 |
| 245 String toString() => keyword.syntax; | 245 String toString() => keyword.syntax; |
| 246 } | 246 } |
| OLD | NEW |