Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(52)

Side by Side Diff: lib/compiler/implementation/scanner/keyword.dart

Issue 11113009: Land Alexander's change that turns assert into a keyword. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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("assert"),
10 const Keyword("break"), 11 const Keyword("break"),
11 const Keyword("case"), 12 const Keyword("case"),
12 const Keyword("catch"), 13 const Keyword("catch"),
13 const Keyword("class"), 14 const Keyword("class"),
14 const Keyword("const"), 15 const Keyword("const"),
15 const Keyword("continue"), 16 const Keyword("continue"),
16 const Keyword("default"), 17 const Keyword("default"),
17 const Keyword("do"), 18 const Keyword("do"),
18 const Keyword("else"), 19 const Keyword("else"),
19 const Keyword("extends"), 20 const Keyword("extends"),
(...skipping 15 matching lines...) Expand all
35 const Keyword("var"), 36 const Keyword("var"),
36 const Keyword("void"), 37 const Keyword("void"),
37 const Keyword("while"), 38 const Keyword("while"),
38 39
39 // TODO(ahe): Don't think this is a reserved word. 40 // TODO(ahe): Don't think this is a reserved word.
40 // See: http://dartbug.com/5579 41 // See: http://dartbug.com/5579
41 const Keyword("is", info: IS_INFO), 42 const Keyword("is", info: IS_INFO),
42 43
43 const Keyword("abstract", isBuiltIn: true), 44 const Keyword("abstract", isBuiltIn: true),
44 const Keyword("as", info: AS_INFO, isBuiltIn: true), 45 const Keyword("as", info: AS_INFO, isBuiltIn: true),
45 const Keyword("assert", isBuiltIn: true),
46 const Keyword("dynamic", isBuiltIn: true), 46 const Keyword("dynamic", isBuiltIn: true),
47 const Keyword("export", isBuiltIn: true), 47 const Keyword("export", isBuiltIn: true),
48 const Keyword("external", isBuiltIn: true), 48 const Keyword("external", isBuiltIn: true),
49 const Keyword("factory", isBuiltIn: true), 49 const Keyword("factory", isBuiltIn: true),
50 const Keyword("get", isBuiltIn: true), 50 const Keyword("get", isBuiltIn: true),
51 const Keyword("implements", isBuiltIn: true), 51 const Keyword("implements", isBuiltIn: true),
52 const Keyword("import", isBuiltIn: true), 52 const Keyword("import", isBuiltIn: true),
53 const Keyword("interface", isBuiltIn: true), 53 const Keyword("interface", isBuiltIn: true),
54 const Keyword("library", isBuiltIn: true), 54 const Keyword("library", isBuiltIn: true),
55 const Keyword("operator", isBuiltIn: true), 55 const Keyword("operator", isBuiltIn: true),
(...skipping 166 matching lines...) Expand 10 before | Expand all | Expand 10 after
222 final Keyword keyword; 222 final Keyword keyword;
223 223
224 LeafKeywordState(String syntax) : keyword = Keyword.keywords[syntax]; 224 LeafKeywordState(String syntax) : keyword = Keyword.keywords[syntax];
225 225
226 bool isLeaf() => true; 226 bool isLeaf() => true;
227 227
228 KeywordState next(int c) => null; 228 KeywordState next(int c) => null;
229 229
230 String toString() => keyword.syntax; 230 String toString() => keyword.syntax;
231 } 231 }
OLDNEW
« no previous file with comments | « lib/compiler/implementation/resolver.dart ('k') | lib/compiler/implementation/scanner/listener.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698