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

Unified Diff: runtime/vm/token.h

Issue 9107070: Proper handling of built-in identifiers (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: '' Created 8 years, 11 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 side-by-side diff with in-line comments
Download patch
Index: runtime/vm/token.h
===================================================================
--- runtime/vm/token.h (revision 3272)
+++ runtime/vm/token.h (working copy)
@@ -1,4 +1,4 @@
-// Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file
+// Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
@@ -136,7 +136,7 @@
// to update kFirstKeyword and kLastKeyword below.
#define DART_KEYWORD_LIST(KW) \
KW(kABSTRACT, "abstract", 0, kPseudoKeyword) /* == kFirstKeyword */ \
- KW(kASSERT, "assert", 0, kKeyword) \
+ KW(kASSERT, "assert", 0, kPseudoKeyword) \
KW(kBREAK, "break", 0, kKeyword) \
KW(kCASE, "case", 0, kKeyword) \
KW(kCATCH, "catch", 0, kKeyword) \
@@ -171,7 +171,7 @@
KW(kTHROW, "throw", 0, kKeyword) \
KW(kTRUE, "true", 0, kKeyword) \
KW(kTRY, "try", 0, kKeyword) \
- KW(kTYPEDEF, "typedef", 0, kKeyword) \
+ KW(kTYPEDEF, "typedef", 0, kPseudoKeyword) \
KW(kVAR, "var", 0, kKeyword) \
KW(kVOID, "void", 0, kKeyword) \
KW(kWHILE, "while", 0, kKeyword) /* == kLastKeyword */
@@ -217,6 +217,10 @@
return (Attributes(tok) & kPseudoKeyword) != 0;
}
+ static bool IsIdentifier(Kind tok) {
+ return (tok == kIDENT) || IsPseudoKeyword(tok);
+ }
+
static const char* Name(Kind tok) {
ASSERT(tok < kNumTokens);
return name_[tok];

Powered by Google App Engine
This is Rietveld 408576698