mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-02-14 19:16:17 -06:00
save token in scanner after scaning hex literal
This commit is contained in:
parent
8b35beaa1c
commit
60417ff379
@ -931,12 +931,12 @@ module ts {
|
||||
value = 0;
|
||||
}
|
||||
tokenValue = "" + value;
|
||||
return SyntaxKind.NumericLiteral;
|
||||
return token = SyntaxKind.NumericLiteral;
|
||||
}
|
||||
// Try to parse as an octal
|
||||
if (pos + 1 < len && isOctalDigit(text.charCodeAt(pos + 1))) {
|
||||
tokenValue = "" + scanOctalDigits();
|
||||
return SyntaxKind.NumericLiteral;
|
||||
return token = SyntaxKind.NumericLiteral;
|
||||
}
|
||||
// This fall-through is a deviation from the EcmaScript grammar. The grammar says that a leading zero
|
||||
// can only be followed by an octal digit, a dot, or the end of the number literal. However, we are being
|
||||
|
||||
5
tests/cases/fourslash/formattingHexLiteral.ts
Normal file
5
tests/cases/fourslash/formattingHexLiteral.ts
Normal file
@ -0,0 +1,5 @@
|
||||
/// <reference path='fourslash.ts' />
|
||||
|
||||
////var x = 0x1,y;
|
||||
|
||||
format.document(); // should not crash
|
||||
Loading…
x
Reference in New Issue
Block a user