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

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

Issue 11015019: Handle "is" and "as" like other keywords. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge
Patch Set: Also a few co19 fixes in dart2js. 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
« no previous file with comments | « no previous file | dart/lib/compiler/implementation/scanner/token.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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("break"), 10 const Keyword("break"),
11 const Keyword("case"), 11 const Keyword("case"),
12 const Keyword("catch"), 12 const Keyword("catch"),
13 const Keyword("class"), 13 const Keyword("class"),
14 const Keyword("const"), 14 const Keyword("const"),
15 const Keyword("continue"), 15 const Keyword("continue"),
16 const Keyword("default"), 16 const Keyword("default"),
17 const Keyword("do"), 17 const Keyword("do"),
18 const Keyword("else"), 18 const Keyword("else"),
19 const Keyword("extends"), 19 const Keyword("extends"),
20 const Keyword("false"), 20 const Keyword("false"),
21 const Keyword("final"), 21 const Keyword("final"),
22 const Keyword("finally"), 22 const Keyword("finally"),
23 const Keyword("for"), 23 const Keyword("for"),
24 const Keyword("if"), 24 const Keyword("if"),
25 const Keyword("in"), 25 const Keyword("in"),
26 // TODO(ahe): Don't think this is a reserved word.
27 // See: http://dartbug.com/5579
26 const Keyword("is", info: IS_INFO), 28 const Keyword("is", info: IS_INFO),
27 const Keyword("new"), 29 const Keyword("new"),
28 const Keyword("null"), 30 const Keyword("null"),
29 const Keyword("return"), 31 const Keyword("return"),
30 const Keyword("super"), 32 const Keyword("super"),
31 const Keyword("switch"), 33 const Keyword("switch"),
32 const Keyword("this"), 34 const Keyword("this"),
33 const Keyword("throw"), 35 const Keyword("throw"),
34 const Keyword("true"), 36 const Keyword("true"),
35 const Keyword("try"), 37 const Keyword("try"),
(...skipping 179 matching lines...) Expand 10 before | Expand all | Expand 10 after
215 final Keyword keyword; 217 final Keyword keyword;
216 218
217 LeafKeywordState(String syntax) : keyword = Keyword.keywords[syntax]; 219 LeafKeywordState(String syntax) : keyword = Keyword.keywords[syntax];
218 220
219 bool isLeaf() => true; 221 bool isLeaf() => true;
220 222
221 KeywordState next(int c) => null; 223 KeywordState next(int c) => null;
222 224
223 String toString() => keyword.syntax; 225 String toString() => keyword.syntax;
224 } 226 }
OLDNEW
« no previous file with comments | « no previous file | dart/lib/compiler/implementation/scanner/token.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698