| 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 { | 10 class Keyword { |
| 11 static const List<Keyword> values = const <Keyword> [ | 11 static const List<Keyword> values = const <Keyword> [ |
| 12 const Keyword("assert"), | 12 const Keyword("assert"), |
| 13 const Keyword("break"), | 13 const Keyword("break"), |
| 14 const Keyword("case"), | 14 const Keyword("case"), |
| 15 const Keyword("catch"), | 15 const Keyword("catch"), |
| 16 const Keyword("class"), | 16 const Keyword("class"), |
| 17 const Keyword("const"), | 17 const Keyword("const"), |
| 18 const Keyword("continue"), | 18 const Keyword("continue"), |
| 19 const Keyword("default"), | 19 const Keyword("default"), |
| 20 const Keyword("do"), | 20 const Keyword("do"), |
| 21 const Keyword("else"), | 21 const Keyword("else"), |
| 22 const Keyword("enum"), |
| 22 const Keyword("extends"), | 23 const Keyword("extends"), |
| 23 const Keyword("false"), | 24 const Keyword("false"), |
| 24 const Keyword("final"), | 25 const Keyword("final"), |
| 25 const Keyword("finally"), | 26 const Keyword("finally"), |
| 26 const Keyword("for"), | 27 const Keyword("for"), |
| 27 const Keyword("if"), | 28 const Keyword("if"), |
| 28 const Keyword("in"), | 29 const Keyword("in"), |
| 29 const Keyword("new"), | 30 const Keyword("new"), |
| 30 const Keyword("null"), | 31 const Keyword("null"), |
| 31 const Keyword("rethrow"), | 32 const Keyword("rethrow"), |
| 32 const Keyword("return"), | 33 const Keyword("return"), |
| 33 const Keyword("super"), | 34 const Keyword("super"), |
| 34 const Keyword("switch"), | 35 const Keyword("switch"), |
| 35 const Keyword("this"), | 36 const Keyword("this"), |
| 36 const Keyword("throw"), | 37 const Keyword("throw"), |
| 37 const Keyword("true"), | 38 const Keyword("true"), |
| 38 const Keyword("try"), | 39 const Keyword("try"), |
| 39 const Keyword("var"), | 40 const Keyword("var"), |
| 40 const Keyword("void"), | 41 const Keyword("void"), |
| 41 const Keyword("while"), | 42 const Keyword("while"), |
| 42 const Keyword("with"), | 43 const Keyword("with"), |
| 43 | 44 |
| 44 // TODO(ahe): Don't think this is a reserved word. | 45 // TODO(ahe): Don't think this is a reserved word. |
| 45 // See: http://dartbug.com/5579 | 46 // See: http://dartbug.com/5579 |
| 46 const Keyword("is", info: IS_INFO), | 47 const Keyword("is", info: IS_INFO), |
| 47 | 48 |
| 48 const Keyword("abstract", isBuiltIn: true), | 49 const Keyword("abstract", isBuiltIn: true), |
| 49 const Keyword("as", info: AS_INFO, isBuiltIn: true), | 50 const Keyword("as", info: AS_INFO, isBuiltIn: true), |
| 50 const Keyword("dynamic", isBuiltIn: true), | 51 const Keyword("dynamic", isBuiltIn: true), |
| 51 const Keyword("enum", isBuiltIn: true), | |
| 52 const Keyword("export", isBuiltIn: true), | 52 const Keyword("export", isBuiltIn: true), |
| 53 const Keyword("external", isBuiltIn: true), | 53 const Keyword("external", isBuiltIn: true), |
| 54 const Keyword("factory", isBuiltIn: true), | 54 const Keyword("factory", isBuiltIn: true), |
| 55 const Keyword("get", isBuiltIn: true), | 55 const Keyword("get", isBuiltIn: true), |
| 56 const Keyword("implements", isBuiltIn: true), | 56 const Keyword("implements", isBuiltIn: true), |
| 57 const Keyword("import", isBuiltIn: true), | 57 const Keyword("import", isBuiltIn: true), |
| 58 const Keyword("library", isBuiltIn: true), | 58 const Keyword("library", isBuiltIn: true), |
| 59 const Keyword("operator", isBuiltIn: true), | 59 const Keyword("operator", isBuiltIn: true), |
| 60 const Keyword("part", isBuiltIn: true), | 60 const Keyword("part", isBuiltIn: true), |
| 61 const Keyword("set", isBuiltIn: true), | 61 const Keyword("set", isBuiltIn: true), |
| (...skipping 139 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 201 /** | 201 /** |
| 202 * A state that has no outgoing transitions. | 202 * A state that has no outgoing transitions. |
| 203 */ | 203 */ |
| 204 class LeafKeywordState extends KeywordState { | 204 class LeafKeywordState extends KeywordState { |
| 205 LeafKeywordState(String syntax) : super(Keyword.keywords[syntax]); | 205 LeafKeywordState(String syntax) : super(Keyword.keywords[syntax]); |
| 206 | 206 |
| 207 KeywordState next(int c) => null; | 207 KeywordState next(int c) => null; |
| 208 | 208 |
| 209 String toString() => keyword.syntax; | 209 String toString() => keyword.syntax; |
| 210 } | 210 } |
| OLD | NEW |