mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-05-20 05:17:43 -05:00
expose token flags and numeric flags (#29897)
* expose token flags and numeric flags * hide hide useless token flags
This commit is contained in:
committed by
Wesley Wigham
parent
ae836eb854
commit
592396d40a
@@ -89,10 +89,10 @@ namespace ts {
|
||||
return createLiteralFromNode(value);
|
||||
}
|
||||
|
||||
export function createNumericLiteral(value: string): NumericLiteral {
|
||||
export function createNumericLiteral(value: string, numericLiteralFlags: TokenFlags = TokenFlags.None): NumericLiteral {
|
||||
const node = <NumericLiteral>createSynthesizedNode(SyntaxKind.NumericLiteral);
|
||||
node.text = value;
|
||||
node.numericLiteralFlags = 0;
|
||||
node.numericLiteralFlags = numericLiteralFlags;
|
||||
return node;
|
||||
}
|
||||
|
||||
|
||||
@@ -1648,20 +1648,26 @@ namespace ts {
|
||||
kind: SyntaxKind.NoSubstitutionTemplateLiteral;
|
||||
}
|
||||
|
||||
/* @internal */
|
||||
export const enum TokenFlags {
|
||||
None = 0,
|
||||
/* @internal */
|
||||
PrecedingLineBreak = 1 << 0,
|
||||
/* @internal */
|
||||
PrecedingJSDocComment = 1 << 1,
|
||||
/* @internal */
|
||||
Unterminated = 1 << 2,
|
||||
/* @internal */
|
||||
ExtendedUnicodeEscape = 1 << 3,
|
||||
Scientific = 1 << 4, // e.g. `10e2`
|
||||
Octal = 1 << 5, // e.g. `0777`
|
||||
HexSpecifier = 1 << 6, // e.g. `0x00000000`
|
||||
BinarySpecifier = 1 << 7, // e.g. `0b0110010000000000`
|
||||
OctalSpecifier = 1 << 8, // e.g. `0o777`
|
||||
/* @internal */
|
||||
ContainsSeparator = 1 << 9, // e.g. `0b1100_0101`
|
||||
/* @internal */
|
||||
BinaryOrOctalSpecifier = BinarySpecifier | OctalSpecifier,
|
||||
/* @internal */
|
||||
NumericLiteralFlags = Scientific | Octal | HexSpecifier | BinaryOrOctalSpecifier | ContainsSeparator
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user