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