function evaluateSimpleLiteral(node, typescript) {
    var _a;
    if (typescript.isStringLiteralLike(node))
        return { success: true, value: node.text };
    else if (isBooleanLiteral(node, typescript))
        return { success: true, value: node.kind === typescript.SyntaxKind.TrueKeyword };
    else if (typescript.isRegularExpressionLiteral(node))
        return { success: true, value: new Function(`return ${node.text}`)() };
    else if (typescript.isNumericLiteral(node))
        return { success: true, value: Number(node.text) };
    else if ((_a = typescript.isBigIntLiteral) === null || _a === void 0 ? void 0 : _a.call(typescript, node))
        return { success: true, value: BigInt(node.text) };
    else if (typescript.isIdentifier(node) && node.text === "Infinity")
        return { success: true, value: Infinity };
    else if (typescript.isIdentifier(node) && node.text === "NaN")
        return { success: true, value: NaN };
    else if (typescript.isIdentifier(node) && node.text === "null")
        return { success: true, value: null };
    else if (typescript.isIdentifier(node) && node.text === "undefined")
        return { success: true, value: undefined };
    else if (isNullLiteral(node, typescript))
        return { success: true, value: null };
    else
        return { success: false };
}
/**
 * This is a tiny function that avoids the costs of building up an evaluation environment
 * for the interpreter. If the node is a simple literal, it will return its' value.
 */
This is a tiny function that avoids the costs of building up an evaluation environment
for the interpreter. If the node is a simple literal, it will return its' value.
This is a tiny function that avoids the costs of building up an evaluation environment for the interpreter . If the node is a simple literal it will return its ' value .
function evaluateSimpleLiteral(node, typescript) {
    var _a;
    if (typescript.isStringLiteralLike(node))
        return { success: true, value: node.text };
    else if (isBooleanLiteral(node, typescript))
        return { success: true, value: node.kind === typescript.SyntaxKind.TrueKeyword };
    else if (typescript.isRegularExpressionLiteral(node))
        return { success: true, value: new Function(`return ${node.text}`)() };
    else if (typescript.isNumericLiteral(node))
        return { success: true, value: Number(node.text) };
    else if ((_a = typescript.isBigIntLiteral) === null || _a === void 0 ? void 0 : _a.call(typescript, node))
        return { success: true, value: BigInt(node.text) };
    else if (typescript.isIdentifier(node) && node.text === "Infinity")
        return { success: true, value: Infinity };
    else if (typescript.isIdentifier(node) && node.text === "NaN")
        return { success: true, value: NaN };
    else if (typescript.isIdentifier(node) && node.text === "null")
        return { success: true, value: null };
    else if (typescript.isIdentifier(node) && node.text === "undefined")
        return { success: true, value: undefined };
    else if (isNullLiteral(node, typescript))
        return { success: true, value: null };
    else
        return { success: false };
}
function evaluateSimpleLiteral ( node , typescript ) { var _a ; if ( typescript . isStringLiteralLike ( node ) ) return { success : true , value : node . text } ; else if ( isBooleanLiteral ( node , typescript ) ) return { success : true , value : node . kind === typescript . SyntaxKind . TrueKeyword } ; else if ( typescript . isRegularExpressionLiteral ( node ) ) return { success : true , value : new Function ( ` ${ node . text } ` ) ( ) } ; else if ( typescript . isNumericLiteral ( node ) ) return { success : true , value : Number ( node . text ) } ; else if ( ( _a = typescript . isBigIntLiteral ) === null || _a === void 0 ? void 0 : _a . call ( typescript , node ) ) return { success : true , value : BigInt ( node . text ) } ; else if ( typescript . isIdentifier ( node ) && node . text === "Infinity" ) return { success : true , value : Infinity } ; else if ( typescript . isIdentifier ( node ) && node . text === "NaN" ) return { success : true , value : NaN } ; else if ( typescript . isIdentifier ( node ) && node . text === "null" ) return { success : true , value : null } ; else if ( typescript . isIdentifier ( node ) && node . text === "undefined" ) return { success : true , value : undefined } ; else if ( isNullLiteral ( node , typescript ) ) return { success : true , value : null } ; else return { success : false } ; }
This is a tiny function that avoids the costs of building up an evaluation environment
 for the interpreter.
This is a tiny function that avoids the costs of building up an evaluation environment for the interpreter .