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 library fasta.scanner.keywords; | 5 library fasta.scanner.keywords; |
6 | 6 |
7 import 'characters.dart' show $a, $z, $A, $Z; | 7 import 'characters.dart' show $a, $z, $A, $Z; |
8 | 8 |
9 import 'precedence.dart' show PrecedenceInfo; | 9 import 'precedence.dart' show PrecedenceInfo; |
10 | 10 |
(...skipping 26 matching lines...) Expand all Loading... |
37 const Keyword("null"), | 37 const Keyword("null"), |
38 const Keyword("rethrow"), | 38 const Keyword("rethrow"), |
39 const Keyword("return"), | 39 const Keyword("return"), |
40 const Keyword("super"), | 40 const Keyword("super"), |
41 const Keyword("switch"), | 41 const Keyword("switch"), |
42 const Keyword("this"), | 42 const Keyword("this"), |
43 const Keyword("throw"), | 43 const Keyword("throw"), |
44 const Keyword("true"), | 44 const Keyword("true"), |
45 const Keyword("try"), | 45 const Keyword("try"), |
46 const Keyword("var"), | 46 const Keyword("var"), |
47 const Keyword("void"), | |
48 const Keyword("while"), | 47 const Keyword("while"), |
49 const Keyword("with"), | 48 const Keyword("with"), |
50 | 49 |
51 // TODO(ahe): Don't think this is a reserved word. | 50 // TODO(ahe): Don't think this is a reserved word. |
52 // See: http://dartbug.com/5579 | 51 // See: http://dartbug.com/5579 |
53 const Keyword("is", info: IS_INFO), | 52 const Keyword("is", info: IS_INFO), |
54 | 53 |
55 const Keyword("abstract", isBuiltIn: true), | 54 const Keyword("abstract", isBuiltIn: true), |
56 const Keyword("as", info: AS_INFO, isBuiltIn: true), | 55 const Keyword("as", info: AS_INFO, isBuiltIn: true), |
57 const Keyword("covariant", isBuiltIn: true), | 56 const Keyword("covariant", isBuiltIn: true), |
58 const Keyword("dynamic", isBuiltIn: true), | 57 const Keyword("dynamic", isBuiltIn: true), |
59 const Keyword("export", isBuiltIn: true), | 58 const Keyword("export", isBuiltIn: true), |
60 const Keyword("external", isBuiltIn: true), | 59 const Keyword("external", isBuiltIn: true), |
61 const Keyword("factory", isBuiltIn: true), | 60 const Keyword("factory", isBuiltIn: true), |
62 const Keyword("get", isBuiltIn: true), | 61 const Keyword("get", isBuiltIn: true), |
63 const Keyword("implements", isBuiltIn: true), | 62 const Keyword("implements", isBuiltIn: true), |
64 const Keyword("import", isBuiltIn: true), | 63 const Keyword("import", isBuiltIn: true), |
65 const Keyword("library", isBuiltIn: true), | 64 const Keyword("library", isBuiltIn: true), |
66 const Keyword("operator", isBuiltIn: true), | 65 const Keyword("operator", isBuiltIn: true), |
67 const Keyword("part", isBuiltIn: true), | 66 const Keyword("part", isBuiltIn: true), |
68 const Keyword("set", isBuiltIn: true), | 67 const Keyword("set", isBuiltIn: true), |
69 const Keyword("static", isBuiltIn: true), | 68 const Keyword("static", isBuiltIn: true), |
70 const Keyword("typedef", isBuiltIn: true), | 69 const Keyword("typedef", isBuiltIn: true), |
| 70 const Keyword("void", isBuiltIn: true), |
71 | 71 |
72 const Keyword("async", isPseudo: true), | 72 const Keyword("async", isPseudo: true), |
73 const Keyword("await", isPseudo: true), | 73 const Keyword("await", isPseudo: true), |
74 const Keyword("deferred", isPseudo: true), | 74 const Keyword("deferred", isPseudo: true), |
75 const Keyword("Function", isPseudo: true), | 75 const Keyword("Function", isPseudo: true), |
76 const Keyword("hide", isPseudo: true), | 76 const Keyword("hide", isPseudo: true), |
77 const Keyword("native", isPseudo: true), | 77 const Keyword("native", isPseudo: true), |
78 const Keyword("of", isPseudo: true), | 78 const Keyword("of", isPseudo: true), |
79 const Keyword("on", isPseudo: true), | 79 const Keyword("on", isPseudo: true), |
80 const Keyword("patch", isPseudo: true), | 80 const Keyword("patch", isPseudo: true), |
(...skipping 161 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
242 class LeafKeywordState implements KeywordState { | 242 class LeafKeywordState implements KeywordState { |
243 final Keyword keyword; | 243 final Keyword keyword; |
244 | 244 |
245 LeafKeywordState(String syntax) : keyword = Keyword.keywords[syntax]; | 245 LeafKeywordState(String syntax) : keyword = Keyword.keywords[syntax]; |
246 | 246 |
247 KeywordState next(int c) => null; | 247 KeywordState next(int c) => null; |
248 KeywordState nextCapital(int c) => null; | 248 KeywordState nextCapital(int c) => null; |
249 | 249 |
250 String toString() => keyword.syntax; | 250 String toString() => keyword.syntax; |
251 } | 251 } |
OLD | NEW |