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

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

Issue 10540048: Implement 'as' operator. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: No entries in language.status, vm and dartc already implemented 'as'. Created 8 years, 6 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 final Keyword BREAK = const Keyword("break"); 9 static final Keyword BREAK = const Keyword("break");
10 static final Keyword CASE = const Keyword("case"); 10 static final Keyword CASE = const Keyword("case");
(...skipping 20 matching lines...) Expand all
31 static final Keyword THIS = const Keyword("this"); 31 static final Keyword THIS = const Keyword("this");
32 static final Keyword THROW = const Keyword("throw"); 32 static final Keyword THROW = const Keyword("throw");
33 static final Keyword TRUE = const Keyword("true"); 33 static final Keyword TRUE = const Keyword("true");
34 static final Keyword TRY = const Keyword("try"); 34 static final Keyword TRY = const Keyword("try");
35 static final Keyword VAR = const Keyword("var"); 35 static final Keyword VAR = const Keyword("var");
36 static final Keyword VOID = const Keyword("void"); 36 static final Keyword VOID = const Keyword("void");
37 static final Keyword WHILE = const Keyword("while"); 37 static final Keyword WHILE = const Keyword("while");
38 38
39 // Pseudo keywords: 39 // Pseudo keywords:
40 static final Keyword ABSTRACT = const Keyword("abstract", isPseudo: true); 40 static final Keyword ABSTRACT = const Keyword("abstract", isPseudo: true);
41 static final Keyword AS = const Keyword("as", info: AS_INFO, isPseudo: true);
41 static final Keyword ASSERT = const Keyword("assert", isPseudo: true); 42 static final Keyword ASSERT = const Keyword("assert", isPseudo: true);
42 static final Keyword FACTORY = const Keyword("factory", isPseudo: true); 43 static final Keyword FACTORY = const Keyword("factory", isPseudo: true);
43 static final Keyword GET = const Keyword("get", isPseudo: true); 44 static final Keyword GET = const Keyword("get", isPseudo: true);
44 static final Keyword IMPLEMENTS = const Keyword("implements", isPseudo: true); 45 static final Keyword IMPLEMENTS = const Keyword("implements", isPseudo: true);
45 static final Keyword IMPORT = const Keyword("import", isPseudo: true); 46 static final Keyword IMPORT = const Keyword("import", isPseudo: true);
46 static final Keyword INTERFACE = const Keyword("interface", isPseudo: true); 47 static final Keyword INTERFACE = const Keyword("interface", isPseudo: true);
47 static final Keyword LIBRARY = const Keyword("library", isPseudo: true); 48 static final Keyword LIBRARY = const Keyword("library", isPseudo: true);
48 static final Keyword NATIVE = const Keyword("native", isPseudo: true); 49 static final Keyword NATIVE = const Keyword("native", isPseudo: true);
49 static final Keyword NEGATE = const Keyword("negate", isPseudo: true); 50 static final Keyword NEGATE = const Keyword("negate", isPseudo: true);
50 static final Keyword OPERATOR = const Keyword("operator", isPseudo: true); 51 static final Keyword OPERATOR = const Keyword("operator", isPseudo: true);
51 static final Keyword SET = const Keyword("set", isPseudo: true); 52 static final Keyword SET = const Keyword("set", isPseudo: true);
52 static final Keyword SOURCE = const Keyword("source", isPseudo: true); 53 static final Keyword SOURCE = const Keyword("source", isPseudo: true);
53 static final Keyword STATIC = const Keyword("static", isPseudo: true); 54 static final Keyword STATIC = const Keyword("static", isPseudo: true);
54 static final Keyword TYPEDEF = const Keyword("typedef", isPseudo: true); 55 static final Keyword TYPEDEF = const Keyword("typedef", isPseudo: true);
55 56
56 static final List<Keyword> values = const <Keyword> [ 57 static final List<Keyword> values = const <Keyword> [
58 AS,
57 BREAK, 59 BREAK,
58 CASE, 60 CASE,
59 CATCH, 61 CATCH,
60 CONST, 62 CONST,
61 CONTINUE, 63 CONTINUE,
62 DEFAULT, 64 DEFAULT,
63 DO, 65 DO,
64 ELSE, 66 ELSE,
65 FALSE, 67 FALSE,
66 FINAL, 68 FINAL,
(...skipping 184 matching lines...) Expand 10 before | Expand all | Expand 10 after
251 final Keyword keyword; 253 final Keyword keyword;
252 254
253 LeafKeywordState(String syntax) : keyword = Keyword.keywords[syntax]; 255 LeafKeywordState(String syntax) : keyword = Keyword.keywords[syntax];
254 256
255 bool isLeaf() => true; 257 bool isLeaf() => true;
256 258
257 KeywordState next(int c) => null; 259 KeywordState next(int c) => null;
258 260
259 String toString() => keyword.syntax; 261 String toString() => keyword.syntax;
260 } 262 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698