| OLD | NEW |
| 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/flags.h" | 8 #include "vm/flags.h" |
| 9 #include "vm/object.h" | 9 #include "vm/object.h" |
| 10 #include "vm/object_store.h" | 10 #include "vm/object_store.h" |
| (...skipping 613 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 624 } | 624 } |
| 625 switch (c0_) { | 625 switch (c0_) { |
| 626 case '\0': | 626 case '\0': |
| 627 current_token_.kind = Token::kEOS; | 627 current_token_.kind = Token::kEOS; |
| 628 break; | 628 break; |
| 629 | 629 |
| 630 case '+': // + ++ += | 630 case '+': // + ++ += |
| 631 ReadChar(); | 631 ReadChar(); |
| 632 current_token_.kind = | 632 current_token_.kind = |
| 633 IsNumberStart(c0_) ? Token::kTIGHTADD : Token::kADD; | 633 IsNumberStart(c0_) ? Token::kTIGHTADD : Token::kADD; |
| 634 if (c0_ == '+') { | 634 // Unary + is not allowed for hexadecimal integers, so treat the |
| 635 // + as a binary operator. |
| 636 if ((c0_ == '0') && |
| 637 ((LookaheadChar(1) == 'x') || (LookaheadChar(1) == 'X'))) { |
| 638 current_token_.kind = Token::kADD; |
| 639 } else if (c0_ == '+') { |
| 635 Recognize(Token::kINCR); | 640 Recognize(Token::kINCR); |
| 636 } else if (c0_ == '=') { | 641 } else if (c0_ == '=') { |
| 637 Recognize(Token::kASSIGN_ADD); | 642 Recognize(Token::kASSIGN_ADD); |
| 638 } | 643 } |
| 639 break; | 644 break; |
| 640 | 645 |
| 641 case '-': // - -- -= | 646 case '-': // - -- -= |
| 642 Recognize(Token::kSUB); | 647 Recognize(Token::kSUB); |
| 643 if (c0_ == '-') { | 648 if (c0_ == '-') { |
| 644 Recognize(Token::kDECR); | 649 Recognize(Token::kDECR); |
| (...skipping 275 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 920 "%c%"PRIxPTR, kPrivateKeySeparator, key_value); | 925 "%c%"PRIxPTR, kPrivateKeySeparator, key_value); |
| 921 const String& result = String::Handle(String::New(private_key)); | 926 const String& result = String::Handle(String::New(private_key)); |
| 922 return result.raw(); | 927 return result.raw(); |
| 923 } | 928 } |
| 924 | 929 |
| 925 | 930 |
| 926 void Scanner::InitOnce() { | 931 void Scanner::InitOnce() { |
| 927 } | 932 } |
| 928 | 933 |
| 929 } // namespace dart | 934 } // namespace dart |
| OLD | NEW |