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

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

Issue 10915083: Change assert implementation to not depend on a top-level function called 'assert'. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: 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 18 matching lines...) Expand all
29 static const Keyword SUPER = const Keyword("super"); 29 static const Keyword SUPER = const Keyword("super");
30 static const Keyword SWITCH = const Keyword("switch"); 30 static const Keyword SWITCH = const Keyword("switch");
31 static const Keyword THIS = const Keyword("this"); 31 static const Keyword THIS = const Keyword("this");
32 static const Keyword THROW = const Keyword("throw"); 32 static const Keyword THROW = const Keyword("throw");
33 static const Keyword TRUE = const Keyword("true"); 33 static const Keyword TRUE = const Keyword("true");
34 static const Keyword TRY = const Keyword("try"); 34 static const Keyword TRY = const Keyword("try");
35 static const Keyword VAR = const Keyword("var"); 35 static const Keyword VAR = const Keyword("var");
36 static const Keyword VOID = const Keyword("void"); 36 static const Keyword VOID = const Keyword("void");
37 static const Keyword WHILE = const Keyword("while"); 37 static const Keyword WHILE = const Keyword("while");
38 38
39 // Pseudo keywords: 39 // Built-in identifiers.
ahe 2012/09/05 11:09:54 Why is it necessary to change this file?
Lasse Reichstein Nielsen 2012/09/05 12:51:20 It isn't. I keep getting confused by this "pseudo
40 static const Keyword ABSTRACT = const Keyword("abstract", isPseudo: true); 40 static const Keyword ABSTRACT = const Keyword("abstract", isPseudo: true);
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 // And "Dynamic".
Johnni Winther 2012/09/05 09:07:05 Is there no const for Dynamic? Don't we need it?
ngeoffray 2012/09/05 10:37:10 What is this comment for?
Lasse Reichstein Nielsen 2012/09/05 12:51:20 Apparently not, to both questions. This was just a
Lasse Reichstein Nielsen 2012/09/05 12:51:20 Reminder that "Dynamic" is a built-in identifier,
43 static const Keyword EXTERNAL = const Keyword("external", isPseudo: true); 44 static const Keyword EXTERNAL = const Keyword("external", isPseudo: true);
44 static const Keyword FACTORY = const Keyword("factory", isPseudo: true); 45 static const Keyword FACTORY = const Keyword("factory", isPseudo: true);
45 static const Keyword GET = const Keyword("get", isPseudo: true); 46 static const Keyword GET = const Keyword("get", isPseudo: true);
46 static const Keyword IMPLEMENTS = const Keyword("implements", isPseudo: true); 47 static const Keyword IMPLEMENTS = const Keyword("implements", isPseudo: true);
48 static const Keyword OPERATOR = const Keyword("operator", isPseudo: true);
49 static const Keyword SET = const Keyword("set", isPseudo: true);
50 static const Keyword STATIC = const Keyword("static", isPseudo: true);
51 static const Keyword TYPEDEF = const Keyword("typedef", isPseudo: true);
52
53 // Pseudo keywords:
47 static const Keyword IMPORT = const Keyword("import", isPseudo: true); 54 static const Keyword IMPORT = const Keyword("import", isPseudo: true);
48 static const Keyword INTERFACE = const Keyword("interface", isPseudo: true); 55 static const Keyword INTERFACE = const Keyword("interface", isPseudo: true);
49 static const Keyword LIBRARY = const Keyword("library", isPseudo: true); 56 static const Keyword LIBRARY = const Keyword("library", isPseudo: true);
50 static const Keyword NATIVE = const Keyword("native", isPseudo: true); 57 static const Keyword NATIVE = const Keyword("native", isPseudo: true);
51 static const Keyword OPERATOR = const Keyword("operator", isPseudo: true);
52 static const Keyword ON = const Keyword("on", isPseudo: true); 58 static const Keyword ON = const Keyword("on", isPseudo: true);
53 static const Keyword SET = const Keyword("set", isPseudo: true);
54 static const Keyword SOURCE = const Keyword("source", isPseudo: true); 59 static const Keyword SOURCE = const Keyword("source", isPseudo: true);
55 static const Keyword STATIC = const Keyword("static", isPseudo: true);
56 static const Keyword TYPEDEF = const Keyword("typedef", isPseudo: true);
57 60
58 static const List<Keyword> values = const <Keyword> [ 61 static const List<Keyword> values = const <Keyword> [
59 AS, 62 AS,
60 BREAK, 63 BREAK,
61 CASE, 64 CASE,
62 CATCH, 65 CATCH,
63 CONST, 66 CONST,
64 CONTINUE, 67 CONTINUE,
65 DEFAULT, 68 DEFAULT,
66 DO, 69 DO,
(...skipping 188 matching lines...) Expand 10 before | Expand all | Expand 10 after
255 final Keyword keyword; 258 final Keyword keyword;
256 259
257 LeafKeywordState(String syntax) : keyword = Keyword.keywords[syntax]; 260 LeafKeywordState(String syntax) : keyword = Keyword.keywords[syntax];
258 261
259 bool isLeaf() => true; 262 bool isLeaf() => true;
260 263
261 KeywordState next(int c) => null; 264 KeywordState next(int c) => null;
262 265
263 String toString() => keyword.syntax; 266 String toString() => keyword.syntax;
264 } 267 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698