OLD | NEW |
---|---|
1 // Copyright 2011 the V8 project authors. All rights reserved. | 1 // Copyright 2011 the V8 project authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 // Features shared by parsing and pre-parsing scanners. | 5 // Features shared by parsing and pre-parsing scanners. |
6 | 6 |
7 #include <stdint.h> | 7 #include <stdint.h> |
8 | 8 |
9 #include <cmath> | 9 #include <cmath> |
10 | 10 |
(...skipping 581 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
592 token = Select('=', Token::ASSIGN_BIT_XOR, Token::BIT_XOR); | 592 token = Select('=', Token::ASSIGN_BIT_XOR, Token::BIT_XOR); |
593 break; | 593 break; |
594 | 594 |
595 case '.': | 595 case '.': |
596 // . Number | 596 // . Number |
597 Advance(); | 597 Advance(); |
598 if (IsDecimalDigit(c0_)) { | 598 if (IsDecimalDigit(c0_)) { |
599 token = ScanNumber(true); | 599 token = ScanNumber(true); |
600 } else { | 600 } else { |
601 token = Token::PERIOD; | 601 token = Token::PERIOD; |
602 if (c0_ == '.') { | |
arv (Not doing code reviews)
2015/01/30 05:28:13
With this we change the error message in the follo
marja
2015/01/30 08:33:31
Maybe that's a reason to at least check the harmon
| |
603 Advance(); | |
604 if (c0_ == '.') { | |
605 Advance(); | |
606 token = Token::ELLIPSIS; | |
607 } else { | |
608 PushBack('.'); | |
609 } | |
610 } | |
602 } | 611 } |
603 break; | 612 break; |
604 | 613 |
605 case ':': | 614 case ':': |
606 token = Select(Token::COLON); | 615 token = Select(Token::COLON); |
607 break; | 616 break; |
608 | 617 |
609 case ';': | 618 case ';': |
610 token = Select(Token::SEMICOLON); | 619 token = Select(Token::SEMICOLON); |
611 break; | 620 break; |
(...skipping 866 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1478 } | 1487 } |
1479 backing_store_.Add(static_cast<uint8_t>((one_byte_length >> 7) | 0x80u)); | 1488 backing_store_.Add(static_cast<uint8_t>((one_byte_length >> 7) | 0x80u)); |
1480 } | 1489 } |
1481 backing_store_.Add(static_cast<uint8_t>(one_byte_length & 0x7f)); | 1490 backing_store_.Add(static_cast<uint8_t>(one_byte_length & 0x7f)); |
1482 | 1491 |
1483 backing_store_.AddBlock(bytes); | 1492 backing_store_.AddBlock(bytes); |
1484 return backing_store_.EndSequence().start(); | 1493 return backing_store_.EndSequence().start(); |
1485 } | 1494 } |
1486 | 1495 |
1487 } } // namespace v8::internal | 1496 } } // namespace v8::internal |
OLD | NEW |