| 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 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 61 const Keyword("static", isBuiltIn: true), | 61 const Keyword("static", isBuiltIn: true), |
| 62 const Keyword("typedef", isBuiltIn: true), | 62 const Keyword("typedef", isBuiltIn: true), |
| 63 | 63 |
| 64 const Keyword("hide", isPseudo: true), | 64 const Keyword("hide", isPseudo: true), |
| 65 const Keyword("native", isPseudo: true), | 65 const Keyword("native", isPseudo: true), |
| 66 const Keyword("of", isPseudo: true), | 66 const Keyword("of", isPseudo: true), |
| 67 const Keyword("on", isPseudo: true), | 67 const Keyword("on", isPseudo: true), |
| 68 const Keyword("show", isPseudo: true), | 68 const Keyword("show", isPseudo: true), |
| 69 const Keyword("source", isPseudo: true) ]; | 69 const Keyword("source", isPseudo: true) ]; |
| 70 | 70 |
| 71 // TODO(aprelev@gmail.com): Remove deprecated Dynamic keyword support. | |
| 72 static const DYNAMIC_DEPRECATED = const Keyword("Dynamic", isBuiltIn: true); | |
| 73 | |
| 74 final String syntax; | 71 final String syntax; |
| 75 final bool isPseudo; | 72 final bool isPseudo; |
| 76 final bool isBuiltIn; | 73 final bool isBuiltIn; |
| 77 final PrecedenceInfo info; | 74 final PrecedenceInfo info; |
| 78 | 75 |
| 79 static Map<String, Keyword> _keywords; | 76 static Map<String, Keyword> _keywords; |
| 80 static Map<String, Keyword> get keywords { | 77 static Map<String, Keyword> get keywords { |
| 81 if (_keywords == null) { | 78 if (_keywords == null) { |
| 82 _keywords = computeKeywordMap(); | 79 _keywords = computeKeywordMap(); |
| 83 } | 80 } |
| (...skipping 141 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 225 */ | 222 */ |
| 226 class LeafKeywordState extends KeywordState { | 223 class LeafKeywordState extends KeywordState { |
| 227 LeafKeywordState(String syntax) : super(Keyword.keywords[syntax]); | 224 LeafKeywordState(String syntax) : super(Keyword.keywords[syntax]); |
| 228 | 225 |
| 229 bool isLeaf() => true; | 226 bool isLeaf() => true; |
| 230 | 227 |
| 231 KeywordState next(int c) => null; | 228 KeywordState next(int c) => null; |
| 232 | 229 |
| 233 String toString() => keyword.syntax; | 230 String toString() => keyword.syntax; |
| 234 } | 231 } |
| OLD | NEW |