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

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: Renamed Assert to assertHelper. Switched parser to use parseArguments. Added assert argument checki… 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 14 matching lines...) Expand all
34 const Keyword("this"), 35 const Keyword("this"),
35 const Keyword("throw"), 36 const Keyword("throw"),
36 const Keyword("true"), 37 const Keyword("true"),
37 const Keyword("try"), 38 const Keyword("try"),
38 const Keyword("var"), 39 const Keyword("var"),
39 const Keyword("void"), 40 const Keyword("void"),
40 const Keyword("while"), 41 const Keyword("while"),
41 42
42 const Keyword("abstract", isBuiltIn: true), 43 const Keyword("abstract", isBuiltIn: true),
43 const Keyword("as", info: AS_INFO, isBuiltIn: true), 44 const Keyword("as", info: AS_INFO, isBuiltIn: true),
44 const Keyword("assert", isBuiltIn: true),
45 const Keyword("dynamic", isBuiltIn: true), 45 const Keyword("dynamic", isBuiltIn: true),
46 const Keyword("external", isBuiltIn: true), 46 const Keyword("external", isBuiltIn: true),
47 const Keyword("factory", isBuiltIn: true), 47 const Keyword("factory", isBuiltIn: true),
48 const Keyword("get", isBuiltIn: true), 48 const Keyword("get", isBuiltIn: true),
49 const Keyword("implements", isBuiltIn: true), 49 const Keyword("implements", isBuiltIn: true),
50 const Keyword("interface", isBuiltIn: true), 50 const Keyword("interface", isBuiltIn: true),
51 const Keyword("operator", isBuiltIn: true), 51 const Keyword("operator", isBuiltIn: true),
52 const Keyword("set", isBuiltIn: true), 52 const Keyword("set", isBuiltIn: true),
53 const Keyword("static", isBuiltIn: true), 53 const Keyword("static", isBuiltIn: true),
54 const Keyword("typedef", isBuiltIn: true), 54 const Keyword("typedef", isBuiltIn: true),
(...skipping 166 matching lines...) Expand 10 before | Expand all | Expand 10 after
221 final Keyword keyword; 221 final Keyword keyword;
222 222
223 LeafKeywordState(String syntax) : keyword = Keyword.keywords[syntax]; 223 LeafKeywordState(String syntax) : keyword = Keyword.keywords[syntax];
224 224
225 bool isLeaf() => true; 225 bool isLeaf() => true;
226 226
227 KeywordState next(int c) => null; 227 KeywordState next(int c) => null;
228 228
229 String toString() => keyword.syntax; 229 String toString() => keyword.syntax;
230 } 230 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698