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

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

Issue 10857013: Support for new catch syntax in dart2js (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge
Patch Set: Rebased Created 8 years, 4 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 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
43 static final Keyword EXTERNAL = const Keyword("external", isPseudo: true); 43 static final Keyword EXTERNAL = const Keyword("external", isPseudo: true);
44 static final Keyword FACTORY = const Keyword("factory", isPseudo: true); 44 static final Keyword FACTORY = const Keyword("factory", isPseudo: true);
45 static final Keyword GET = const Keyword("get", isPseudo: true); 45 static final Keyword GET = const Keyword("get", isPseudo: true);
46 static final Keyword IMPLEMENTS = const Keyword("implements", isPseudo: true); 46 static final Keyword IMPLEMENTS = const Keyword("implements", isPseudo: true);
47 static final Keyword IMPORT = const Keyword("import", isPseudo: true); 47 static final Keyword IMPORT = const Keyword("import", isPseudo: true);
48 static final Keyword INTERFACE = const Keyword("interface", isPseudo: true); 48 static final Keyword INTERFACE = const Keyword("interface", isPseudo: true);
49 static final Keyword LIBRARY = const Keyword("library", isPseudo: true); 49 static final Keyword LIBRARY = const Keyword("library", isPseudo: true);
50 static final Keyword NATIVE = const Keyword("native", isPseudo: true); 50 static final Keyword NATIVE = const Keyword("native", isPseudo: true);
51 static final Keyword NEGATE = const Keyword("negate", isPseudo: true); 51 static final Keyword NEGATE = const Keyword("negate", isPseudo: true);
52 static final Keyword OPERATOR = const Keyword("operator", isPseudo: true); 52 static final Keyword OPERATOR = const Keyword("operator", isPseudo: true);
53 static final Keyword ON = const Keyword("on", isPseudo: true);
53 static final Keyword SET = const Keyword("set", isPseudo: true); 54 static final Keyword SET = const Keyword("set", isPseudo: true);
54 static final Keyword SOURCE = const Keyword("source", isPseudo: true); 55 static final Keyword SOURCE = const Keyword("source", isPseudo: true);
55 static final Keyword STATIC = const Keyword("static", isPseudo: true); 56 static final Keyword STATIC = const Keyword("static", isPseudo: true);
56 static final Keyword TYPEDEF = const Keyword("typedef", isPseudo: true); 57 static final Keyword TYPEDEF = const Keyword("typedef", isPseudo: true);
57 58
58 static final List<Keyword> values = const <Keyword> [ 59 static final List<Keyword> values = const <Keyword> [
59 AS, 60 AS,
60 BREAK, 61 BREAK,
61 CASE, 62 CASE,
62 CATCH, 63 CATCH,
(...skipping 28 matching lines...) Expand all
91 EXTERNAL, 92 EXTERNAL,
92 FACTORY, 93 FACTORY,
93 GET, 94 GET,
94 IMPLEMENTS, 95 IMPLEMENTS,
95 IMPORT, 96 IMPORT,
96 INTERFACE, 97 INTERFACE,
97 LIBRARY, 98 LIBRARY,
98 NATIVE, 99 NATIVE,
99 NEGATE, 100 NEGATE,
100 OPERATOR, 101 OPERATOR,
102 ON,
101 SET, 103 SET,
102 SOURCE, 104 SOURCE,
103 STATIC, 105 STATIC,
104 TYPEDEF ]; 106 TYPEDEF ];
105 107
106 final String syntax; 108 final String syntax;
107 final bool isPseudo; 109 final bool isPseudo;
108 final PrecedenceInfo info; 110 final PrecedenceInfo info;
109 111
110 static Map<String, Keyword> _keywords; 112 static Map<String, Keyword> _keywords;
(...skipping 144 matching lines...) Expand 10 before | Expand all | Expand 10 after
255 final Keyword keyword; 257 final Keyword keyword;
256 258
257 LeafKeywordState(String syntax) : keyword = Keyword.keywords[syntax]; 259 LeafKeywordState(String syntax) : keyword = Keyword.keywords[syntax];
258 260
259 bool isLeaf() => true; 261 bool isLeaf() => true;
260 262
261 KeywordState next(int c) => null; 263 KeywordState next(int c) => null;
262 264
263 String toString() => keyword.syntax; 265 String toString() => keyword.syntax;
264 } 266 }
OLDNEW
« no previous file with comments | « dart/lib/compiler/implementation/resolver.dart ('k') | dart/lib/compiler/implementation/scanner/listener.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698