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

Unified Diff: runtime/vm/token.h

Issue 10659005: Implement type cast in the VM. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 8 years, 6 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 9048)
+++ runtime/vm/token.h (working copy)
@@ -14,7 +14,7 @@
// 13 multiplicative * / ~/ %
// 12 additive + -
// 11 shift << >>
-// 10 relational >= > <= < is
+// 10 relational >= > <= < is as
// 9 equality == != === !==
// 8 bitwise and &
// 7 bitwise xor ^
@@ -106,8 +106,11 @@
TOK(kGTE, ">=", 10, kNoAttribute) \
\
/* Internal token for !(expr is Type) negative type test operator */ \
- TOK(kISNOT, "", 0, kNoAttribute) \
+ TOK(kISNOT, "", 10, kNoAttribute) \
\
+ /* Internal token for (expr as Type) type cast operator */ \
+ TOK(kAS, "", 10, kNoAttribute) \
+ \
TOK(kINDEX, "[]", 0, kNoAttribute) \
TOK(kASSIGN_INDEX, "[]=", 0, kNoAttribute) \
\
@@ -212,10 +215,14 @@
return kEQ <= tok && tok <= kNE_STRICT;
}
- static bool IsInstanceofOperator(Kind tok) {
+ static bool IsTypeTestOperator(Kind tok) {
return (tok == kIS) || (tok == kISNOT);
}
+ static bool IsTypeCastOperator(Kind tok) {
+ return tok == kAS;
+ }
+
static bool IsPseudoKeyword(Kind tok) {
return (Attributes(tok) & kPseudoKeyword) != 0;
}

Powered by Google App Engine
This is Rietveld 408576698