| 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 const List<Keyword> values = const <Keyword> [ | 9 static const List<Keyword> values = const <Keyword> [ |
| 10 const Keyword("break"), | 10 const Keyword("break"), |
| 11 const Keyword("case"), | 11 const Keyword("case"), |
| 12 const Keyword("catch"), | 12 const Keyword("catch"), |
| 13 const Keyword("class"), | 13 const Keyword("class"), |
| 14 const Keyword("const"), | 14 const Keyword("const"), |
| 15 const Keyword("continue"), | 15 const Keyword("continue"), |
| 16 const Keyword("default"), | 16 const Keyword("default"), |
| 17 const Keyword("do"), | 17 const Keyword("do"), |
| 18 const Keyword("else"), | 18 const Keyword("else"), |
| 19 const Keyword("extends"), | 19 const Keyword("extends"), |
| 20 const Keyword("false"), | 20 const Keyword("false"), |
| 21 const Keyword("final"), | 21 const Keyword("final"), |
| 22 const Keyword("finally"), | 22 const Keyword("finally"), |
| 23 const Keyword("for"), | 23 const Keyword("for"), |
| 24 const Keyword("if"), | 24 const Keyword("if"), |
| 25 const Keyword("in"), | 25 const Keyword("in"), |
| 26 // TODO(ahe): Don't think this is a reserved word. |
| 27 // See: http://dartbug.com/5579 |
| 26 const Keyword("is", info: IS_INFO), | 28 const Keyword("is", info: IS_INFO), |
| 27 const Keyword("new"), | 29 const Keyword("new"), |
| 28 const Keyword("null"), | 30 const Keyword("null"), |
| 29 const Keyword("return"), | 31 const Keyword("return"), |
| 30 const Keyword("super"), | 32 const Keyword("super"), |
| 31 const Keyword("switch"), | 33 const Keyword("switch"), |
| 32 const Keyword("this"), | 34 const Keyword("this"), |
| 33 const Keyword("throw"), | 35 const Keyword("throw"), |
| 34 const Keyword("true"), | 36 const Keyword("true"), |
| 35 const Keyword("try"), | 37 const Keyword("try"), |
| (...skipping 179 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 215 final Keyword keyword; | 217 final Keyword keyword; |
| 216 | 218 |
| 217 LeafKeywordState(String syntax) : keyword = Keyword.keywords[syntax]; | 219 LeafKeywordState(String syntax) : keyword = Keyword.keywords[syntax]; |
| 218 | 220 |
| 219 bool isLeaf() => true; | 221 bool isLeaf() => true; |
| 220 | 222 |
| 221 KeywordState next(int c) => null; | 223 KeywordState next(int c) => null; |
| 222 | 224 |
| 223 String toString() => keyword.syntax; | 225 String toString() => keyword.syntax; |
| 224 } | 226 } |
| OLD | NEW |