Chromium Code Reviews| Index: src/scanner-base.cc |
| diff --git a/src/scanner-base.cc b/src/scanner-base.cc |
| index 997fb312fc8e589ce64fa4a3601565dbe4a59ad5..1c8090ceae9213d9ae57b947ca899940305e9d17 100644 |
| --- a/src/scanner-base.cc |
| +++ b/src/scanner-base.cc |
| @@ -98,6 +98,7 @@ uc32 Scanner::ScanHexEscape(uc32 c, int length) { |
| // Octal escapes of the forms '\0xx' and '\xxx' are not a part of |
| // ECMA-262. Other JS VMs support them. |
| uc32 Scanner::ScanOctalEscape(uc32 c, int length) { |
| + octal_loc_.beg_pos = source_pos() - 1; // Already advanced |
|
Lasse Reichstein
2011/01/21 11:20:20
It seems like overkill to store both beg and end p
Martin Maly
2011/01/21 23:32:57
Done.
|
| uc32 x = c - '0'; |
| for (int i = 0; i < length; i++) { |
| int d = c0_ - '0'; |
| @@ -107,6 +108,7 @@ uc32 Scanner::ScanOctalEscape(uc32 c, int length) { |
| x = nx; |
| Advance(); |
| } |
| + octal_loc_.end_pos = source_pos(); |
| return x; |
| } |
| @@ -597,11 +599,17 @@ Token::Value JavaScriptScanner::ScanNumber(bool seen_period) { |
| // (possible) octal number |
| kind = OCTAL; |
| while (true) { |
| + // TODO(mmaly): Do we want to keep the auto-upgrade to decimal? |
|
Lasse Reichstein
2011/01/21 11:20:20
Alas, yes.
Unless it turns out that Safari has cha
Martin Maly
2011/01/21 23:32:57
Done.
|
| if (c0_ == '8' || c0_ == '9') { |
| kind = DECIMAL; |
| break; |
| } |
| - if (c0_ < '0' || '7' < c0_) break; |
| + if (c0_ < '0' || '7' < c0_) { |
| + // Octal literal finished. |
| + octal_loc_.beg_pos = next_.location.beg_pos; |
| + octal_loc_.end_pos = source_pos(); |
| + break; |
| + } |
| AddLiteralCharAdvance(); |
| } |
| } |