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 part of scanner; | 5 part of scanner; |
6 | 6 |
7 /** | 7 /** |
8 * A keyword in the Dart programming language. | 8 * A keyword in the Dart programming language. |
9 */ | 9 */ |
10 class Keyword extends Iterable<int> implements SourceString { | 10 class Keyword extends Iterable<int> implements SourceString { |
(...skipping 20 matching lines...) Expand all Loading... |
31 const Keyword("return"), | 31 const Keyword("return"), |
32 const Keyword("super"), | 32 const Keyword("super"), |
33 const Keyword("switch"), | 33 const Keyword("switch"), |
34 const Keyword("this"), | 34 const Keyword("this"), |
35 const Keyword("throw"), | 35 const Keyword("throw"), |
36 const Keyword("true"), | 36 const Keyword("true"), |
37 const Keyword("try"), | 37 const Keyword("try"), |
38 const Keyword("var"), | 38 const Keyword("var"), |
39 const Keyword("void"), | 39 const Keyword("void"), |
40 const Keyword("while"), | 40 const Keyword("while"), |
| 41 const Keyword("with"), |
41 | 42 |
42 // TODO(ahe): Don't think this is a reserved word. | 43 // TODO(ahe): Don't think this is a reserved word. |
43 // See: http://dartbug.com/5579 | 44 // See: http://dartbug.com/5579 |
44 const Keyword("is", info: IS_INFO), | 45 const Keyword("is", info: IS_INFO), |
45 | 46 |
46 const Keyword("abstract", isBuiltIn: true), | 47 const Keyword("abstract", isBuiltIn: true), |
47 const Keyword("as", info: AS_INFO, isBuiltIn: true), | 48 const Keyword("as", info: AS_INFO, isBuiltIn: true), |
48 const Keyword("dynamic", isBuiltIn: true), | 49 const Keyword("dynamic", isBuiltIn: true), |
49 const Keyword("export", isBuiltIn: true), | 50 const Keyword("export", isBuiltIn: true), |
50 const Keyword("external", isBuiltIn: true), | 51 const Keyword("external", isBuiltIn: true), |
(...skipping 174 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
225 final Keyword keyword; | 226 final Keyword keyword; |
226 | 227 |
227 LeafKeywordState(String syntax) : keyword = Keyword.keywords[syntax]; | 228 LeafKeywordState(String syntax) : keyword = Keyword.keywords[syntax]; |
228 | 229 |
229 bool isLeaf() => true; | 230 bool isLeaf() => true; |
230 | 231 |
231 KeywordState next(int c) => null; | 232 KeywordState next(int c) => null; |
232 | 233 |
233 String toString() => keyword.syntax; | 234 String toString() => keyword.syntax; |
234 } | 235 } |
OLD | NEW |