| 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 const Keyword BREAK = const Keyword("break"); |
| 10 static final Keyword CASE = const Keyword("case"); | 10 static const Keyword CASE = const Keyword("case"); |
| 11 static final Keyword CATCH = const Keyword("catch"); | 11 static const Keyword CATCH = const Keyword("catch"); |
| 12 static final Keyword CLASS = const Keyword("class"); | 12 static const Keyword CLASS = const Keyword("class"); |
| 13 static final Keyword CONST = const Keyword("const"); | 13 static const Keyword CONST = const Keyword("const"); |
| 14 static final Keyword CONTINUE = const Keyword("continue"); | 14 static const Keyword CONTINUE = const Keyword("continue"); |
| 15 static final Keyword DEFAULT = const Keyword("default"); | 15 static const Keyword DEFAULT = const Keyword("default"); |
| 16 static final Keyword DO = const Keyword("do"); | 16 static const Keyword DO = const Keyword("do"); |
| 17 static final Keyword ELSE = const Keyword("else"); | 17 static const Keyword ELSE = const Keyword("else"); |
| 18 static final Keyword EXTENDS = const Keyword("extends"); | 18 static const Keyword EXTENDS = const Keyword("extends"); |
| 19 static final Keyword FALSE = const Keyword("false"); | 19 static const Keyword FALSE = const Keyword("false"); |
| 20 static final Keyword FINAL = const Keyword("final"); | 20 static const Keyword FINAL = const Keyword("final"); |
| 21 static final Keyword FINALLY = const Keyword("finally"); | 21 static const Keyword FINALLY = const Keyword("finally"); |
| 22 static final Keyword FOR = const Keyword("for"); | 22 static const Keyword FOR = const Keyword("for"); |
| 23 static final Keyword IF = const Keyword("if"); | 23 static const Keyword IF = const Keyword("if"); |
| 24 static final Keyword IN = const Keyword("in"); | 24 static const Keyword IN = const Keyword("in"); |
| 25 static final Keyword IS = const Keyword("is", info: IS_INFO); | 25 static const Keyword IS = const Keyword("is", info: IS_INFO); |
| 26 static final Keyword NEW = const Keyword("new"); | 26 static const Keyword NEW = const Keyword("new"); |
| 27 static final Keyword NULL = const Keyword("null"); | 27 static const Keyword NULL = const Keyword("null"); |
| 28 static final Keyword RETURN = const Keyword("return"); | 28 static const Keyword RETURN = const Keyword("return"); |
| 29 static final Keyword SUPER = const Keyword("super"); | 29 static const Keyword SUPER = const Keyword("super"); |
| 30 static final Keyword SWITCH = const Keyword("switch"); | 30 static const Keyword SWITCH = const Keyword("switch"); |
| 31 static final Keyword THIS = const Keyword("this"); | 31 static const Keyword THIS = const Keyword("this"); |
| 32 static final Keyword THROW = const Keyword("throw"); | 32 static const Keyword THROW = const Keyword("throw"); |
| 33 static final Keyword TRUE = const Keyword("true"); | 33 static const Keyword TRUE = const Keyword("true"); |
| 34 static final Keyword TRY = const Keyword("try"); | 34 static const Keyword TRY = const Keyword("try"); |
| 35 static final Keyword VAR = const Keyword("var"); | 35 static const Keyword VAR = const Keyword("var"); |
| 36 static final Keyword VOID = const Keyword("void"); | 36 static const Keyword VOID = const Keyword("void"); |
| 37 static final Keyword WHILE = const Keyword("while"); | 37 static const Keyword WHILE = const Keyword("while"); |
| 38 | 38 |
| 39 // Pseudo keywords: | 39 // Pseudo keywords: |
| 40 static final Keyword ABSTRACT = const Keyword("abstract", isPseudo: true); | 40 static const Keyword ABSTRACT = const Keyword("abstract", isPseudo: true); |
| 41 static final Keyword AS = const Keyword("as", info: AS_INFO, isPseudo: true); | 41 static const Keyword AS = const Keyword("as", info: AS_INFO, isPseudo: true); |
| 42 static final Keyword ASSERT = const Keyword("assert", isPseudo: true); | 42 static const Keyword ASSERT = const Keyword("assert", isPseudo: true); |
| 43 static final Keyword EXTERNAL = const Keyword("external", isPseudo: true); | 43 static const Keyword EXTERNAL = const Keyword("external", isPseudo: true); |
| 44 static final Keyword FACTORY = const Keyword("factory", isPseudo: true); | 44 static const Keyword FACTORY = const Keyword("factory", isPseudo: true); |
| 45 static final Keyword GET = const Keyword("get", isPseudo: true); | 45 static const Keyword GET = const Keyword("get", isPseudo: true); |
| 46 static final Keyword IMPLEMENTS = const Keyword("implements", isPseudo: true); | 46 static const Keyword IMPLEMENTS = const Keyword("implements", isPseudo: true); |
| 47 static final Keyword IMPORT = const Keyword("import", isPseudo: true); | 47 static const Keyword IMPORT = const Keyword("import", isPseudo: true); |
| 48 static final Keyword INTERFACE = const Keyword("interface", isPseudo: true); | 48 static const Keyword INTERFACE = const Keyword("interface", isPseudo: true); |
| 49 static final Keyword LIBRARY = const Keyword("library", isPseudo: true); | 49 static const Keyword LIBRARY = const Keyword("library", isPseudo: true); |
| 50 static final Keyword NATIVE = const Keyword("native", isPseudo: true); | 50 static const Keyword NATIVE = const Keyword("native", isPseudo: true); |
| 51 static final Keyword NEGATE = const Keyword("negate", isPseudo: true); | 51 static const Keyword NEGATE = const Keyword("negate", isPseudo: true); |
| 52 static final Keyword OPERATOR = const Keyword("operator", isPseudo: true); | 52 static const Keyword OPERATOR = const Keyword("operator", isPseudo: true); |
| 53 static final Keyword ON = const Keyword("on", isPseudo: true); | 53 static const Keyword ON = const Keyword("on", isPseudo: true); |
| 54 static final Keyword SET = const Keyword("set", isPseudo: true); | 54 static const Keyword SET = const Keyword("set", isPseudo: true); |
| 55 static final Keyword SOURCE = const Keyword("source", isPseudo: true); | 55 static const Keyword SOURCE = const Keyword("source", isPseudo: true); |
| 56 static final Keyword STATIC = const Keyword("static", isPseudo: true); | 56 static const Keyword STATIC = const Keyword("static", isPseudo: true); |
| 57 static final Keyword TYPEDEF = const Keyword("typedef", isPseudo: true); | 57 static const Keyword TYPEDEF = const Keyword("typedef", isPseudo: true); |
| 58 | 58 |
| 59 static final List<Keyword> values = const <Keyword> [ | 59 static const List<Keyword> values = const <Keyword> [ |
| 60 AS, | 60 AS, |
| 61 BREAK, | 61 BREAK, |
| 62 CASE, | 62 CASE, |
| 63 CATCH, | 63 CATCH, |
| 64 CONST, | 64 CONST, |
| 65 CONTINUE, | 65 CONTINUE, |
| 66 DEFAULT, | 66 DEFAULT, |
| 67 DO, | 67 DO, |
| 68 ELSE, | 68 ELSE, |
| 69 FALSE, | 69 FALSE, |
| (...skipping 187 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 257 final Keyword keyword; | 257 final Keyword keyword; |
| 258 | 258 |
| 259 LeafKeywordState(String syntax) : keyword = Keyword.keywords[syntax]; | 259 LeafKeywordState(String syntax) : keyword = Keyword.keywords[syntax]; |
| 260 | 260 |
| 261 bool isLeaf() => true; | 261 bool isLeaf() => true; |
| 262 | 262 |
| 263 KeywordState next(int c) => null; | 263 KeywordState next(int c) => null; |
| 264 | 264 |
| 265 String toString() => keyword.syntax; | 265 String toString() => keyword.syntax; |
| 266 } | 266 } |
| OLD | NEW |