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

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

Issue 11014010: Made assert 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 12 matching lines...) Expand all
32 const Keyword("this"), 33 const Keyword("this"),
33 const Keyword("throw"), 34 const Keyword("throw"),
34 const Keyword("true"), 35 const Keyword("true"),
35 const Keyword("try"), 36 const Keyword("try"),
36 const Keyword("var"), 37 const Keyword("var"),
37 const Keyword("void"), 38 const Keyword("void"),
38 const Keyword("while"), 39 const Keyword("while"),
39 40
40 const Keyword("abstract", isBuiltIn: true), 41 const Keyword("abstract", isBuiltIn: true),
41 const Keyword("as", info: AS_INFO, isBuiltIn: true), 42 const Keyword("as", info: AS_INFO, isBuiltIn: true),
42 const Keyword("assert", isBuiltIn: true),
43 const Keyword("external", isBuiltIn: true), 43 const Keyword("external", isBuiltIn: true),
44 const Keyword("factory", isBuiltIn: true), 44 const Keyword("factory", isBuiltIn: true),
45 const Keyword("get", isBuiltIn: true), 45 const Keyword("get", isBuiltIn: true),
46 const Keyword("implements", isBuiltIn: true), 46 const Keyword("implements", isBuiltIn: true),
47 const Keyword("interface", isBuiltIn: true), 47 const Keyword("interface", isBuiltIn: true),
48 const Keyword("operator", isBuiltIn: true), 48 const Keyword("operator", isBuiltIn: true),
49 const Keyword("set", isBuiltIn: true), 49 const Keyword("set", isBuiltIn: true),
50 const Keyword("static", isBuiltIn: true), 50 const Keyword("static", isBuiltIn: true),
51 const Keyword("typedef", isBuiltIn: true), 51 const Keyword("typedef", isBuiltIn: true),
52 52
(...skipping 162 matching lines...) Expand 10 before | Expand all | Expand 10 after
215 final Keyword keyword; 215 final Keyword keyword;
216 216
217 LeafKeywordState(String syntax) : keyword = Keyword.keywords[syntax]; 217 LeafKeywordState(String syntax) : keyword = Keyword.keywords[syntax];
218 218
219 bool isLeaf() => true; 219 bool isLeaf() => true;
220 220
221 KeywordState next(int c) => null; 221 KeywordState next(int c) => null;
222 222
223 String toString() => keyword.syntax; 223 String toString() => keyword.syntax;
224 } 224 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698