File tree Expand file tree Collapse file tree 4 files changed +27
-5
lines changed
tests/baselines/reference/api Expand file tree Collapse file tree 4 files changed +27
-5
lines changed Original file line number Diff line number Diff line change @@ -89,10 +89,10 @@ namespace ts {
89
89
return createLiteralFromNode ( value ) ;
90
90
}
91
91
92
- export function createNumericLiteral ( value : string ) : NumericLiteral {
92
+ export function createNumericLiteral ( value : string , numericLiteralFlags : TokenFlags = TokenFlags . None ) : NumericLiteral {
93
93
const node = < NumericLiteral > createSynthesizedNode ( SyntaxKind . NumericLiteral ) ;
94
94
node . text = value ;
95
- node . numericLiteralFlags = 0 ;
95
+ node . numericLiteralFlags = numericLiteralFlags ;
96
96
return node ;
97
97
}
98
98
Original file line number Diff line number Diff line change @@ -1648,20 +1648,26 @@ namespace ts {
1648
1648
kind : SyntaxKind . NoSubstitutionTemplateLiteral ;
1649
1649
}
1650
1650
1651
- /* @internal */
1652
1651
export const enum TokenFlags {
1653
1652
None = 0 ,
1653
+ /* @internal */
1654
1654
PrecedingLineBreak = 1 << 0 ,
1655
+ /* @internal */
1655
1656
PrecedingJSDocComment = 1 << 1 ,
1657
+ /* @internal */
1656
1658
Unterminated = 1 << 2 ,
1659
+ /* @internal */
1657
1660
ExtendedUnicodeEscape = 1 << 3 ,
1658
1661
Scientific = 1 << 4 , // e.g. `10e2`
1659
1662
Octal = 1 << 5 , // e.g. `0777`
1660
1663
HexSpecifier = 1 << 6 , // e.g. `0x00000000`
1661
1664
BinarySpecifier = 1 << 7 , // e.g. `0b0110010000000000`
1662
1665
OctalSpecifier = 1 << 8 , // e.g. `0o777`
1666
+ /* @internal */
1663
1667
ContainsSeparator = 1 << 9 , // e.g. `0b1100_0101`
1668
+ /* @internal */
1664
1669
BinaryOrOctalSpecifier = BinarySpecifier | OctalSpecifier ,
1670
+ /* @internal */
1665
1671
NumericLiteralFlags = Scientific | Octal | HexSpecifier | BinaryOrOctalSpecifier | ContainsSeparator
1666
1672
}
1667
1673
Original file line number Diff line number Diff line change @@ -997,6 +997,14 @@ declare namespace ts {
997
997
interface NoSubstitutionTemplateLiteral extends LiteralExpression {
998
998
kind : SyntaxKind . NoSubstitutionTemplateLiteral ;
999
999
}
1000
+ enum TokenFlags {
1001
+ None = 0 ,
1002
+ Scientific = 16 ,
1003
+ Octal = 32 ,
1004
+ HexSpecifier = 64 ,
1005
+ BinarySpecifier = 128 ,
1006
+ OctalSpecifier = 256
1007
+ }
1000
1008
interface NumericLiteral extends LiteralExpression {
1001
1009
kind : SyntaxKind . NumericLiteral ;
1002
1010
}
@@ -3670,7 +3678,7 @@ declare namespace ts {
3670
3678
function createLiteral ( value : number | PseudoBigInt ) : NumericLiteral ;
3671
3679
function createLiteral ( value : boolean ) : BooleanLiteral ;
3672
3680
function createLiteral ( value : string | number | PseudoBigInt | boolean ) : PrimaryExpression ;
3673
- function createNumericLiteral ( value : string ) : NumericLiteral ;
3681
+ function createNumericLiteral ( value : string , numericLiteralFlags ?: TokenFlags ) : NumericLiteral ;
3674
3682
function createBigIntLiteral ( value : string ) : BigIntLiteral ;
3675
3683
function createStringLiteral ( text : string ) : StringLiteral ;
3676
3684
function createRegularExpressionLiteral ( text : string ) : RegularExpressionLiteral ;
Original file line number Diff line number Diff line change @@ -997,6 +997,14 @@ declare namespace ts {
997
997
interface NoSubstitutionTemplateLiteral extends LiteralExpression {
998
998
kind : SyntaxKind . NoSubstitutionTemplateLiteral ;
999
999
}
1000
+ enum TokenFlags {
1001
+ None = 0 ,
1002
+ Scientific = 16 ,
1003
+ Octal = 32 ,
1004
+ HexSpecifier = 64 ,
1005
+ BinarySpecifier = 128 ,
1006
+ OctalSpecifier = 256
1007
+ }
1000
1008
interface NumericLiteral extends LiteralExpression {
1001
1009
kind : SyntaxKind . NumericLiteral ;
1002
1010
}
@@ -3670,7 +3678,7 @@ declare namespace ts {
3670
3678
function createLiteral ( value : number | PseudoBigInt ) : NumericLiteral ;
3671
3679
function createLiteral ( value : boolean ) : BooleanLiteral ;
3672
3680
function createLiteral ( value : string | number | PseudoBigInt | boolean ) : PrimaryExpression ;
3673
- function createNumericLiteral ( value : string ) : NumericLiteral ;
3681
+ function createNumericLiteral ( value : string , numericLiteralFlags ?: TokenFlags ) : NumericLiteral ;
3674
3682
function createBigIntLiteral ( value : string ) : BigIntLiteral ;
3675
3683
function createStringLiteral ( text : string ) : StringLiteral ;
3676
3684
function createRegularExpressionLiteral ( text : string ) : RegularExpressionLiteral ;
You can’t perform that action at this time.
0 commit comments