mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-02-15 11:35:42 -06:00
Add createRegularExpressionLiteral and expose createStringLiteral
Fixes: #23992
This commit is contained in:
parent
6f9dc2f976
commit
fc3ba76ab7
@ -93,12 +93,18 @@ namespace ts {
|
||||
return node;
|
||||
}
|
||||
|
||||
function createStringLiteral(text: string): StringLiteral {
|
||||
export function createStringLiteral(text: string): StringLiteral {
|
||||
const node = <StringLiteral>createSynthesizedNode(SyntaxKind.StringLiteral);
|
||||
node.text = text;
|
||||
return node;
|
||||
}
|
||||
|
||||
export function createRegularExpressionLiteral(text: string): RegularExpressionLiteral {
|
||||
const node = <RegularExpressionLiteral>createSynthesizedNode(SyntaxKind.RegularExpressionLiteral);
|
||||
node.text = text;
|
||||
return node;
|
||||
}
|
||||
|
||||
function createLiteralFromNode(sourceNode: PropertyNameLiteral): StringLiteral {
|
||||
const node = createStringLiteral(getTextOfIdentifierOrLiteral(sourceNode));
|
||||
node.textSourceNode = sourceNode;
|
||||
|
||||
@ -3484,6 +3484,8 @@ declare namespace ts {
|
||||
function createLiteral(value: boolean): BooleanLiteral;
|
||||
function createLiteral(value: string | number | boolean): PrimaryExpression;
|
||||
function createNumericLiteral(value: string): NumericLiteral;
|
||||
function createStringLiteral(text: string): StringLiteral;
|
||||
function createRegularExpressionLiteral(text: string): RegularExpressionLiteral;
|
||||
function createIdentifier(text: string): Identifier;
|
||||
function updateIdentifier(node: Identifier): Identifier;
|
||||
/** Create a unique temporary variable. */
|
||||
|
||||
@ -3484,6 +3484,8 @@ declare namespace ts {
|
||||
function createLiteral(value: boolean): BooleanLiteral;
|
||||
function createLiteral(value: string | number | boolean): PrimaryExpression;
|
||||
function createNumericLiteral(value: string): NumericLiteral;
|
||||
function createStringLiteral(text: string): StringLiteral;
|
||||
function createRegularExpressionLiteral(text: string): RegularExpressionLiteral;
|
||||
function createIdentifier(text: string): Identifier;
|
||||
function updateIdentifier(node: Identifier): Identifier;
|
||||
/** Create a unique temporary variable. */
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user