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

Unified Diff: runtime/vm/scanner.cc

Issue 1180903002: null-aware operators in the VM (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: Add test for opt compiler Created 5 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/scanner.cc
diff --git a/runtime/vm/scanner.cc b/runtime/vm/scanner.cc
index f33d0b4b32538dbd55d1c4932fd54de4b2c77f6c..3e7f02834cf327eb420aa2982f5a791d3ce426d9 100644
--- a/runtime/vm/scanner.cc
+++ b/runtime/vm/scanner.cc
@@ -786,8 +786,16 @@ void Scanner::Scan() {
}
break;
- case '?':
+ case '?': // ? ?. ?? ??=
Recognize(Token::kCONDITIONAL);
+ if (c0_ == '.') {
+ Recognize(Token::kQM_PERIOD);
+ } else if (c0_ == '?') {
+ Recognize(Token::kIFNULL);
+ if (c0_ == '=') {
+ Recognize(Token::kASSIGN_COND);
+ }
+ }
break;
case ':':

Powered by Google App Engine
This is Rietveld 408576698