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

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

Issue 10870066: Support unary - operator. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge
Patch Set: Fix unparser to handle that negate is no longer a keyword. Created 8 years, 3 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 Keyword BREAK = const Keyword("break"); 9 static const Keyword BREAK = const Keyword("break");
10 static const Keyword CASE = const Keyword("case"); 10 static const Keyword CASE = const Keyword("case");
(...skipping 30 matching lines...) Expand all
41 static const Keyword AS = const Keyword("as", info: AS_INFO, isPseudo: true); 41 static const Keyword AS = const Keyword("as", info: AS_INFO, isPseudo: true);
42 static const Keyword ASSERT = const Keyword("assert", isPseudo: true); 42 static const Keyword ASSERT = const Keyword("assert", isPseudo: true);
43 static const Keyword EXTERNAL = const Keyword("external", isPseudo: true); 43 static const Keyword EXTERNAL = const Keyword("external", isPseudo: true);
44 static const Keyword FACTORY = const Keyword("factory", isPseudo: true); 44 static const Keyword FACTORY = const Keyword("factory", isPseudo: true);
45 static const Keyword GET = const Keyword("get", isPseudo: true); 45 static const Keyword GET = const Keyword("get", isPseudo: true);
46 static const Keyword IMPLEMENTS = const Keyword("implements", isPseudo: true); 46 static const Keyword IMPLEMENTS = const Keyword("implements", isPseudo: true);
47 static const Keyword IMPORT = const Keyword("import", isPseudo: true); 47 static const Keyword IMPORT = const Keyword("import", isPseudo: true);
48 static const Keyword INTERFACE = const Keyword("interface", isPseudo: true); 48 static const Keyword INTERFACE = const Keyword("interface", isPseudo: true);
49 static const Keyword LIBRARY = const Keyword("library", isPseudo: true); 49 static const Keyword LIBRARY = const Keyword("library", isPseudo: true);
50 static const Keyword NATIVE = const Keyword("native", isPseudo: true); 50 static const Keyword NATIVE = const Keyword("native", isPseudo: true);
51 static const Keyword NEGATE = const Keyword("negate", isPseudo: true);
52 static const Keyword OPERATOR = const Keyword("operator", isPseudo: true); 51 static const Keyword OPERATOR = const Keyword("operator", isPseudo: true);
53 static const Keyword ON = const Keyword("on", isPseudo: true); 52 static const Keyword ON = const Keyword("on", isPseudo: true);
54 static const Keyword SET = const Keyword("set", isPseudo: true); 53 static const Keyword SET = const Keyword("set", isPseudo: true);
55 static const Keyword SOURCE = const Keyword("source", isPseudo: true); 54 static const Keyword SOURCE = const Keyword("source", isPseudo: true);
56 static const Keyword STATIC = const Keyword("static", isPseudo: true); 55 static const Keyword STATIC = const Keyword("static", isPseudo: true);
57 static const Keyword TYPEDEF = const Keyword("typedef", isPseudo: true); 56 static const Keyword TYPEDEF = const Keyword("typedef", isPseudo: true);
58 57
59 static const List<Keyword> values = const <Keyword> [ 58 static const List<Keyword> values = const <Keyword> [
60 AS, 59 AS,
61 BREAK, 60 BREAK,
(...skipping 28 matching lines...) Expand all
90 CLASS, 89 CLASS,
91 EXTENDS, 90 EXTENDS,
92 EXTERNAL, 91 EXTERNAL,
93 FACTORY, 92 FACTORY,
94 GET, 93 GET,
95 IMPLEMENTS, 94 IMPLEMENTS,
96 IMPORT, 95 IMPORT,
97 INTERFACE, 96 INTERFACE,
98 LIBRARY, 97 LIBRARY,
99 NATIVE, 98 NATIVE,
100 NEGATE,
101 OPERATOR, 99 OPERATOR,
102 ON, 100 ON,
103 SET, 101 SET,
104 SOURCE, 102 SOURCE,
105 STATIC, 103 STATIC,
106 TYPEDEF ]; 104 TYPEDEF ];
107 105
108 final String syntax; 106 final String syntax;
109 final bool isPseudo; 107 final bool isPseudo;
110 final PrecedenceInfo info; 108 final PrecedenceInfo info;
(...skipping 146 matching lines...) Expand 10 before | Expand all | Expand 10 after
257 final Keyword keyword; 255 final Keyword keyword;
258 256
259 LeafKeywordState(String syntax) : keyword = Keyword.keywords[syntax]; 257 LeafKeywordState(String syntax) : keyword = Keyword.keywords[syntax];
260 258
261 bool isLeaf() => true; 259 bool isLeaf() => true;
262 260
263 KeywordState next(int c) => null; 261 KeywordState next(int c) => null;
264 262
265 String toString() => keyword.syntax; 263 String toString() => keyword.syntax;
266 } 264 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698