| 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 989 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1000 while (IsDecimalDigit(c0_)) { | 1000 while (IsDecimalDigit(c0_)) { |
| 1001 value = 10 * value + (c0_ - '0'); | 1001 value = 10 * value + (c0_ - '0'); |
| 1002 | 1002 |
| 1003 uc32 first_char = c0_; | 1003 uc32 first_char = c0_; |
| 1004 Advance<false, false>(); | 1004 Advance<false, false>(); |
| 1005 AddLiteralChar(first_char); | 1005 AddLiteralChar(first_char); |
| 1006 } | 1006 } |
| 1007 | 1007 |
| 1008 if (next_.literal_chars->one_byte_literal().length() <= 10 && | 1008 if (next_.literal_chars->one_byte_literal().length() <= 10 && |
| 1009 value <= Smi::kMaxValue && c0_ != '.' && c0_ != 'e' && c0_ != 'E') { | 1009 value <= Smi::kMaxValue && c0_ != '.' && c0_ != 'e' && c0_ != 'E') { |
| 1010 smi_value_ = static_cast<int>(value); | 1010 next_.smi_value_ = static_cast<int>(value); |
| 1011 literal.Complete(); | 1011 literal.Complete(); |
| 1012 HandleLeadSurrogate(); | 1012 HandleLeadSurrogate(); |
| 1013 | 1013 |
| 1014 return Token::SMI; | 1014 return Token::SMI; |
| 1015 } | 1015 } |
| 1016 HandleLeadSurrogate(); | 1016 HandleLeadSurrogate(); |
| 1017 } | 1017 } |
| 1018 | 1018 |
| 1019 ScanDecimalDigits(); // optional | 1019 ScanDecimalDigits(); // optional |
| 1020 if (c0_ == '.') { | 1020 if (c0_ == '.') { |
| (...skipping 539 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1560 } | 1560 } |
| 1561 backing_store_.Add(static_cast<uint8_t>((one_byte_length >> 7) | 0x80u)); | 1561 backing_store_.Add(static_cast<uint8_t>((one_byte_length >> 7) | 0x80u)); |
| 1562 } | 1562 } |
| 1563 backing_store_.Add(static_cast<uint8_t>(one_byte_length & 0x7f)); | 1563 backing_store_.Add(static_cast<uint8_t>(one_byte_length & 0x7f)); |
| 1564 | 1564 |
| 1565 backing_store_.AddBlock(bytes); | 1565 backing_store_.AddBlock(bytes); |
| 1566 return backing_store_.EndSequence().start(); | 1566 return backing_store_.EndSequence().start(); |
| 1567 } | 1567 } |
| 1568 | 1568 |
| 1569 } } // namespace v8::internal | 1569 } } // namespace v8::internal |
| OLD | NEW |