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

Unified Diff: vm/token.h

Issue 9462003: Changes to shrink the token stream representation from two words to one word. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/runtime/
Patch Set: Created 8 years, 10 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
« vm/scanner.cc ('K') | « vm/snapshot.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: vm/token.h
===================================================================
--- vm/token.h (revision 4579)
+++ vm/token.h (working copy)
@@ -218,6 +218,10 @@
return (Attributes(tok) & kPseudoKeyword) != 0;
}
+ static bool IsKeyword(Kind tok) {
+ return (Attributes(tok) & kKeyword) != 0;
+ }
+
static bool IsIdentifier(Kind tok) {
return (tok == kIDENT) || IsPseudoKeyword(tok);
}
@@ -253,6 +257,15 @@
(tok == kNEGATE);
}
+ static bool NeedsLiteralToken(Kind tok) {
+ ASSERT(tok < kNumTokens);
+ return ((tok == Token::kINTEGER) ||
+ (tok == Token::kSTRING) ||
+ (tok == Token::kINTERPOL_VAR) ||
+ (tok == Token::kERROR) ||
+ (tok == Token::kDOUBLE));
+ }
+
private:
static const char* name_[kNumTokens];
static const char* tok_str_[kNumTokens];
« vm/scanner.cc ('K') | « vm/snapshot.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698