mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-05-15 12:51:30 -05:00
save token in scanner after scaning hex literal
This commit is contained in:
@@ -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
|
||||
Reference in New Issue
Block a user