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

Side by Side 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: Implement remainder of null-aware operators 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 unified diff | Download patch
OLDNEW
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2012, 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 #include "vm/scanner.h" 5 #include "vm/scanner.h"
6 6
7 #include "platform/assert.h" 7 #include "platform/assert.h"
8 #include "vm/dart.h" 8 #include "vm/dart.h"
9 #include "vm/flags.h" 9 #include "vm/flags.h"
10 #include "vm/object.h" 10 #include "vm/object.h"
(...skipping 768 matching lines...) Expand 10 before | Expand all | Expand 10 after
779 779
780 case '.': // . .. Number 780 case '.': // . .. Number
781 Recognize(Token::kPERIOD); 781 Recognize(Token::kPERIOD);
782 if (c0_ == '.') { 782 if (c0_ == '.') {
783 Recognize(Token::kCASCADE); 783 Recognize(Token::kCASCADE);
784 } else if (IsDecimalDigit(c0_)) { 784 } else if (IsDecimalDigit(c0_)) {
785 ScanNumber(true); 785 ScanNumber(true);
786 } 786 }
787 break; 787 break;
788 788
789 case '?': 789 case '?': // ? ?. ?? ??=
790 Recognize(Token::kCONDITIONAL); 790 Recognize(Token::kCONDITIONAL);
791 if (c0_ == '.') {
792 Recognize(Token::kQM_PERIOD);
793 } else if (c0_ == '?') {
794 Recognize(Token::kIFNULL);
795 if (c0_ == '=') {
796 Recognize(Token::kASSIGN_COND);
797 }
798 }
791 break; 799 break;
792 800
793 case ':': 801 case ':':
794 Recognize(Token::kCOLON); 802 Recognize(Token::kCOLON);
795 break; 803 break;
796 804
797 case ';': 805 case ';':
798 Recognize(Token::kSEMICOLON); 806 Recognize(Token::kSEMICOLON);
799 break; 807 break;
800 808
(...skipping 164 matching lines...) Expand 10 before | Expand all | Expand 10 after
965 keywords_[i].keyword_symbol = &Symbols::Keyword(token); 973 keywords_[i].keyword_symbol = &Symbols::Keyword(token);
966 974
967 int ch = keywords_[i].keyword_chars[0] - 'a'; 975 int ch = keywords_[i].keyword_chars[0] - 'a';
968 if (keywords_char_offset_[ch] == Token::kNumKeywords) { 976 if (keywords_char_offset_[ch] == Token::kNumKeywords) {
969 keywords_char_offset_[ch] = i; 977 keywords_char_offset_[ch] = i;
970 } 978 }
971 } 979 }
972 } 980 }
973 981
974 } // namespace dart 982 } // namespace dart
OLDNEW
« runtime/vm/parser.cc ('K') | « runtime/vm/parser.cc ('k') | tests/language/language.status » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698