diff --git a/dist/chunk-4FDYB2TT.cjs.map b/dist/chunk-4FDYB2TT.cjs.map deleted file mode 100644 index 51d7ebc8..00000000 --- a/dist/chunk-4FDYB2TT.cjs.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["../node_modules/tsup/assets/cjs_shims.js","../src/tsUtils.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;;;ACAA;AAEA,SAAS,YAAuB,qBAAgD;AAEhF,IAAM,sBAAsB,oBAAI,IAAgB;AAAA,EAC5C,WAAW;AAAA,EAAqB,WAAW;AAAA,EAAmB,WAAW;AAAA,EAAa,WAAW;AAAA,EACjG,WAAW;AAAA,EAAa,WAAW;AAAA,EAAoB,WAAW;AAAA,EAAe,WAAW;AAAA,EAC5F,WAAW;AAAA,EAAe,WAAW;AAAA,EAAgB,WAAW;AAAA,EAAoB,WAAW;AAAA,EAC/F,WAAW;AAAA,EAAc,WAAW;AACxC,CAAC;AAED,SAAS,eAAe,MAAiC;AACrD,SAAO,SAAS,UAAa,oBAAoB,IAAI,KAAK,IAAI;AAClE;AAEA,SAAS,YAAY,MAAiC;AAClD,SAAO,SAAS,WAAc,KAAK,SAAS,WAAW,oBAAoB,KAAK,SAAS,WAAW;AACxG;AAEA,SAAS,oBAAoB,MAAiC;AAC1D,SAAO,SAAS,WAAc,KAAK,SAAS,WAAW,iBAAiB,KAAK,SAAS,WAAW;AACrG;AAGA,SAAS,aAAoC,MAAwB,UAA8D;AAC/H,SAAO,MAAM;AACT,UAAM,SAAS,SAAS,IAAI;AAC5B,QAAI,WAAW,QAAQ;AACnB,aAAO;AAAA,IACX;AACA,QAAI,QAAQ;AACR,aAAO;AAAA,IACX;AACA,WAAO,KAAK;AAAA,EAChB;AACA,SAAO;AACX;AAEA,SAAS,cAAc,MAAW,OAA2B;AACzD,QAAM,UAAU,KAAK,mBAAmB,CAAC,GAAG,KAAK,CAAC,MAAW,EAAE,UAAU,KAAK;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MAAM,MAAS;AACpH;AAEA,SAAS,uBAAuB,QAAkB;AAC9C,SAAO,QAAQ,kBAAkB,QAAQ;AAC7C;AAEA,SAAS,qBAAqB,WAAkC;AAC5D,SAAO,WAAW,aAAa,QAAQ;AAC3C;AAGA,SAAS,UAAU,MAA8B;AAC7C,SAAO,MAAM,cAAc,KAAK,MAAM,qBAAqB,IAAI,KAAK,SAAS,IAAI;AACrF;AAGA,SAAS,WAAW,MAAgB;AAChC,SAAO,MAAM,WAAW,SAAY,KAAK,UAAU,IAAI;AAC3D","sourcesContent":["// Shim globals in cjs bundle\n// There's a weird bug that esbuild will always inject importMetaUrl\n// if we export it as `const importMetaUrl = ... __filename ...`\n// But using a function will not cause this issue\n\nconst getImportMetaUrl = () =>\n typeof document === 'undefined'\n ? new URL('file:' + __filename).href\n : (document.currentScript && document.currentScript.src) ||\n new URL('main.js', document.baseURI).href\n\nexport const importMetaUrl = /* @__PURE__ */ getImportMetaUrl()\n","// TS6 compiler helpers that typescript/unstable (TS7) does not export, re-implemented over TS7 nodes\n// with the TS6 names and semantics so the printers keep their call sites.\nimport { SyntaxKind, NodeFlags, ModifierFlags, type Node, type NodeArray } from \"typescript/unstable/ast\";\n\nconst FUNCTION_LIKE_KINDS = new Set([\n SyntaxKind.FunctionDeclaration, SyntaxKind.MethodDeclaration, SyntaxKind.Constructor, SyntaxKind.GetAccessor,\n SyntaxKind.SetAccessor, SyntaxKind.FunctionExpression, SyntaxKind.ArrowFunction, SyntaxKind.MethodSignature,\n SyntaxKind.CallSignature, SyntaxKind.JSDocSignature, SyntaxKind.ConstructSignature, SyntaxKind.IndexSignature,\n SyntaxKind.FunctionType, SyntaxKind.ConstructorType,\n]);\n\nfunction isFunctionLike(node: Node | undefined): boolean {\n return node !== undefined && FUNCTION_LIKE_KINDS.has(node.kind);\n}\n\nfunction isClassLike(node: Node | undefined): boolean {\n return node !== undefined && (node.kind === SyntaxKind.ClassDeclaration || node.kind === SyntaxKind.ClassExpression);\n}\n\nfunction isStringLiteralLike(node: Node | undefined): boolean {\n return node !== undefined && (node.kind === SyntaxKind.StringLiteral || node.kind === SyntaxKind.NoSubstitutionTemplateLiteral);\n}\n\n// TS6 contract: callback returning true stops at that node, \"quit\" aborts with undefined\nfunction findAncestor(node: Node | undefined, callback: (element: Node) => boolean | \"quit\"): T | undefined {\n while (node) {\n const result = callback(node);\n if (result === \"quit\") {\n return undefined;\n }\n if (result) {\n return node as T;\n }\n node = node.parent;\n }\n return undefined;\n}\n\nfunction heritageTypes(node: any, token: SyntaxKind): Node[] {\n const clause = (node.heritageClauses ?? []).find((c: any) => c.token === token);\n return clause ? [...clause.types] : [];\n}\n\n// extends (first type only for classes) followed by implements, as in TS6\nfunction getAllSuperTypeNodes(node: Node): readonly Node[] {\n if (node.kind === SyntaxKind.InterfaceDeclaration) {\n return heritageTypes(node, SyntaxKind.ExtendsKeyword);\n }\n if (isClassLike(node)) {\n return [...heritageTypes(node, SyntaxKind.ExtendsKeyword).slice(0, 1), ...heritageTypes(node, SyntaxKind.ImplementsKeyword)];\n }\n return [];\n}\n\nfunction getCombinedNodeFlags(node: Node): NodeFlags {\n while (node.kind === SyntaxKind.BindingElement) {\n node = node.parent.parent;\n }\n let flags = node.flags;\n if (node.kind === SyntaxKind.VariableDeclaration) {\n node = node.parent;\n }\n if (node && node.kind === SyntaxKind.VariableDeclarationList) {\n flags |= node.flags;\n node = node.parent;\n }\n if (node && node.kind === SyntaxKind.VariableStatement) {\n flags |= node.flags;\n }\n return flags;\n}\n\nfunction canHaveModifiers(node: Node): boolean {\n return (node as any).modifiers !== undefined || FUNCTION_LIKE_KINDS.has(node.kind) || node.kind === SyntaxKind.Parameter\n || node.kind === SyntaxKind.PropertyDeclaration || node.kind === SyntaxKind.ClassDeclaration || node.kind === SyntaxKind.VariableStatement;\n}\n\nfunction getModifiers(node: Node): readonly Node[] | undefined {\n const modifiers: NodeArray | undefined = (node as any).modifiers;\n const filtered = modifiers?.filter((m) => m.kind !== SyntaxKind.Decorator);\n return filtered && filtered.length > 0 ? filtered : undefined;\n}\n\nexport {\n ModifierFlags,\n isFunctionLike,\n isClassLike,\n isStringLiteralLike,\n findAncestor,\n getAllSuperTypeNodes,\n getCombinedNodeFlags,\n canHaveModifiers,\n getModifiers,\n};\n\n// TS7 symbols/signatures carry NodeHandles and types carry ids; these return live nodes/types like TS6 fields did\nfunction symbolDeclarations(symbol: any): Node[] {\n return (symbol?.declarations ?? []).map((d: any) => d.resolve()).filter((d: Node | undefined) => d !== undefined);\n}\n\nfunction symbolValueDeclaration(symbol: any): any {\n return symbol?.valueDeclaration?.resolve();\n}\n\nfunction signatureDeclaration(signature: any): Node | undefined {\n return signature?.declaration?.resolve();\n}\n\n// TS6 `type.types` for unions/intersections, undefined otherwise\nfunction typeParts(type: any): any[] | undefined {\n return type?.isUnionType?.() || type?.isIntersectionType?.() ? type.getTypes() : undefined;\n}\n\n// TS6 `type.target` for type references, undefined otherwise\nfunction typeTarget(type: any): any {\n return type?.target !== undefined ? type.getTarget() : undefined;\n}\n\nexport { symbolDeclarations, symbolValueDeclaration, signatureDeclaration, typeParts, typeTarget };\n"]} \ No newline at end of file diff --git a/dist/chunk-4FDYB2TT.cjs b/dist/chunk-UBXMRIM6.cjs similarity index 97% rename from dist/chunk-4FDYB2TT.cjs rename to dist/chunk-UBXMRIM6.cjs index 83266f01..41089a9b 100644 --- a/dist/chunk-4FDYB2TT.cjs +++ b/dist/chunk-UBXMRIM6.cjs @@ -27,9 +27,9 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge mod )); -// node_modules/tsup/assets/cjs_shims.js +// ../../ts7perf-nm/cs-ast/node_modules/tsup/assets/cjs_shims.js var init_cjs_shims = __esm({ - "node_modules/tsup/assets/cjs_shims.js"() { + "../../ts7perf-nm/cs-ast/node_modules/tsup/assets/cjs_shims.js"() { } }); @@ -147,4 +147,4 @@ function typeTarget(type) { exports.__commonJS = __commonJS; exports.__toESM = __toESM; exports.init_cjs_shims = init_cjs_shims; exports.ModifierFlags = _ast.ModifierFlags; exports.isFunctionLike = isFunctionLike; exports.isClassLike = isClassLike; exports.isStringLiteralLike = isStringLiteralLike; exports.findAncestor = findAncestor; exports.getAllSuperTypeNodes = getAllSuperTypeNodes; exports.getCombinedNodeFlags = getCombinedNodeFlags; exports.canHaveModifiers = canHaveModifiers; exports.getModifiers = getModifiers; exports.symbolDeclarations = symbolDeclarations; exports.symbolValueDeclaration = symbolValueDeclaration; exports.signatureDeclaration = signatureDeclaration; exports.typeParts = typeParts; exports.typeTarget = typeTarget; -//# sourceMappingURL=chunk-4FDYB2TT.cjs.map \ No newline at end of file +//# sourceMappingURL=chunk-UBXMRIM6.cjs.map \ No newline at end of file diff --git a/dist/chunk-UBXMRIM6.cjs.map b/dist/chunk-UBXMRIM6.cjs.map new file mode 100644 index 00000000..9a747cae --- /dev/null +++ b/dist/chunk-UBXMRIM6.cjs.map @@ -0,0 +1 @@ +{"version":3,"sources":["../../../ts7perf-nm/cs-ast/node_modules/tsup/assets/cjs_shims.js","../src/tsUtils.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;;;ACAA;AAEA,SAAS,YAAuB,qBAAgD;AAEhF,IAAM,sBAAsB,oBAAI,IAAgB;AAAA,EAC5C,WAAW;AAAA,EAAqB,WAAW;AAAA,EAAmB,WAAW;AAAA,EAAa,WAAW;AAAA,EACjG,WAAW;AAAA,EAAa,WAAW;AAAA,EAAoB,WAAW;AAAA,EAAe,WAAW;AAAA,EAC5F,WAAW;AAAA,EAAe,WAAW;AAAA,EAAgB,WAAW;AAAA,EAAoB,WAAW;AAAA,EAC/F,WAAW;AAAA,EAAc,WAAW;AACxC,CAAC;AAED,SAAS,eAAe,MAAiC;AACrD,SAAO,SAAS,UAAa,oBAAoB,IAAI,KAAK,IAAI;AAClE;AAEA,SAAS,YAAY,MAAiC;AAClD,SAAO,SAAS,WAAc,KAAK,SAAS,WAAW,oBAAoB,KAAK,SA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,cAAc,UAAa,oBAAoB,IAAI,KAAK,IAAI,KAAK,KAAK,SAAS,WAAW,aACxG,KAAK,SAAS,WAAW,uBAAuB,KAAK,SAAS,WAAW,oBAAoB,KAAK,SAAS,WAAW;AACjI;AAEA,SAAS,aAAa,MAAyC;AAC3D,QAAM,YAA0C,KAAa;AAC7D,QAAM,WAAW,WAAW,OAAO,CAAC,MAAM,EAAE,SAAS,WAAW,SAAS;AACzE,SAAO,YAAY,SAAS,SAAS,IAAI,WAAW;AACxD;AAeA,SAAS,mBAAmB,QAAqB;AAC7C,UAAQ,QAAQ,gBAAgB,CAAC,GAAG,IAAI,CAAC,MAAW,EAAE,QAAQ,CAAC,EAAE,OAAO,CAAC,MAAwB,MAAM,MAAS;AACpH;AAEA,SAAS,uBAAuB,QAAkB;AAC9C,SAAO,QAAQ,kBAAkB,QAAQ;AAC7C;AAEA,SAAS,qBAAqB,WAAkC;AAC5D,SAAO,WAAW,aAAa,QAAQ;AAC3C;AAGA,SAAS,UAAU,MAA8B;AAC7C,SAAO,MAAM,cAAc,KAAK,MAAM,qBAAqB,IAAI,KAAK,SAAS,IAAI;AACrF;AAGA,SAAS,WAAW,MAAgB;AAChC,SAAO,MAAM,WAAW,SAAY,KAAK,UAAU,IAAI;AAC3D","sourcesContent":["// Shim globals in cjs bundle\n// There's a weird bug that esbuild will always inject importMetaUrl\n// if we export it as `const importMetaUrl = ... __filename ...`\n// But using a function will not cause this issue\n\nconst getImportMetaUrl = () =>\n typeof document === 'undefined'\n ? new URL('file:' + __filename).href\n : (document.currentScript && document.currentScript.src) ||\n new URL('main.js', document.baseURI).href\n\nexport const importMetaUrl = /* @__PURE__ */ getImportMetaUrl()\n","// TS6 compiler helpers that typescript/unstable (TS7) does not export, re-implemented over TS7 nodes\n// with the TS6 names and semantics so the printers keep their call sites.\nimport { SyntaxKind, NodeFlags, ModifierFlags, type Node, type NodeArray } from \"typescript/unstable/ast\";\n\nconst FUNCTION_LIKE_KINDS = new Set([\n SyntaxKind.FunctionDeclaration, SyntaxKind.MethodDeclaration, SyntaxKind.Constructor, SyntaxKind.GetAccessor,\n SyntaxKind.SetAccessor, SyntaxKind.FunctionExpression, SyntaxKind.ArrowFunction, SyntaxKind.MethodSignature,\n SyntaxKind.CallSignature, SyntaxKind.JSDocSignature, SyntaxKind.ConstructSignature, SyntaxKind.IndexSignature,\n SyntaxKind.FunctionType, SyntaxKind.ConstructorType,\n]);\n\nfunction isFunctionLike(node: Node | undefined): boolean {\n return node !== undefined && FUNCTION_LIKE_KINDS.has(node.kind);\n}\n\nfunction isClassLike(node: Node | undefined): boolean {\n return node !== undefined && (node.kind === SyntaxKind.ClassDeclaration || node.kind === SyntaxKind.ClassExpression);\n}\n\nfunction isStringLiteralLike(node: Node | undefined): boolean {\n return node !== undefined && (node.kind === SyntaxKind.StringLiteral || node.kind === SyntaxKind.NoSubstitutionTemplateLiteral);\n}\n\n// TS6 contract: callback returning true stops at that node, \"quit\" aborts with undefined\nfunction findAncestor(node: Node | undefined, callback: (element: Node) => boolean | \"quit\"): T | undefined {\n while (node) {\n const result = callback(node);\n if (result === \"quit\") {\n return undefined;\n }\n if (result) {\n return node as T;\n }\n node = node.parent;\n }\n return undefined;\n}\n\nfunction heritageTypes(node: any, token: SyntaxKind): Node[] {\n const clause = (node.heritageClauses ?? []).find((c: any) => c.token === token);\n return clause ? [...clause.types] : [];\n}\n\n// extends (first type only for classes) followed by implements, as in TS6\nfunction getAllSuperTypeNodes(node: Node): readonly Node[] {\n if (node.kind === SyntaxKind.InterfaceDeclaration) {\n return heritageTypes(node, SyntaxKind.ExtendsKeyword);\n }\n if (isClassLike(node)) {\n return [...heritageTypes(node, SyntaxKind.ExtendsKeyword).slice(0, 1), ...heritageTypes(node, SyntaxKind.ImplementsKeyword)];\n }\n return [];\n}\n\nfunction getCombinedNodeFlags(node: Node): NodeFlags {\n while (node.kind === SyntaxKind.BindingElement) {\n node = node.parent.parent;\n }\n let flags = node.flags;\n if (node.kind === SyntaxKind.VariableDeclaration) {\n node = node.parent;\n }\n if (node && node.kind === SyntaxKind.VariableDeclarationList) {\n flags |= node.flags;\n node = node.parent;\n }\n if (node && node.kind === SyntaxKind.VariableStatement) {\n flags |= node.flags;\n }\n return flags;\n}\n\nfunction canHaveModifiers(node: Node): boolean {\n return (node as any).modifiers !== undefined || FUNCTION_LIKE_KINDS.has(node.kind) || node.kind === SyntaxKind.Parameter\n || node.kind === SyntaxKind.PropertyDeclaration || node.kind === SyntaxKind.ClassDeclaration || node.kind === SyntaxKind.VariableStatement;\n}\n\nfunction getModifiers(node: Node): readonly Node[] | undefined {\n const modifiers: NodeArray | undefined = (node as any).modifiers;\n const filtered = modifiers?.filter((m) => m.kind !== SyntaxKind.Decorator);\n return filtered && filtered.length > 0 ? filtered : undefined;\n}\n\nexport {\n ModifierFlags,\n isFunctionLike,\n isClassLike,\n isStringLiteralLike,\n findAncestor,\n getAllSuperTypeNodes,\n getCombinedNodeFlags,\n canHaveModifiers,\n getModifiers,\n};\n\n// TS7 symbols/signatures carry NodeHandles and types carry ids; these return live nodes/types like TS6 fields did\nfunction symbolDeclarations(symbol: any): Node[] {\n return (symbol?.declarations ?? []).map((d: any) => d.resolve()).filter((d: Node | undefined) => d !== undefined);\n}\n\nfunction symbolValueDeclaration(symbol: any): any {\n return symbol?.valueDeclaration?.resolve();\n}\n\nfunction signatureDeclaration(signature: any): Node | undefined {\n return signature?.declaration?.resolve();\n}\n\n// TS6 `type.types` for unions/intersections, undefined otherwise\nfunction typeParts(type: any): any[] | undefined {\n return type?.isUnionType?.() || type?.isIntersectionType?.() ? type.getTypes() : undefined;\n}\n\n// TS6 `type.target` for type references, undefined otherwise\nfunction typeTarget(type: any): any {\n return type?.target !== undefined ? type.getTarget() : undefined;\n}\n\nexport { symbolDeclarations, symbolValueDeclaration, signatureDeclaration, typeParts, typeTarget };\n"]} \ No newline at end of file diff --git a/dist/chunk-VNDHHGGT.js.map b/dist/chunk-VNDHHGGT.js.map deleted file mode 100644 index d8c40987..00000000 --- a/dist/chunk-VNDHHGGT.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"sources":["../node_modules/tsup/assets/esm_shims.js","../src/tsUtils.ts"],"sourcesContent":["// Shim globals in esm bundle\nimport { fileURLToPath } from 'url'\nimport path from 'path'\n\nconst getFilename = () => fileURLToPath(import.meta.url)\nconst getDirname = () => path.dirname(getFilename())\n\nexport const __dirname = /* @__PURE__ */ getDirname()\nexport const __filename = /* @__PURE__ */ getFilename()\n","// TS6 compiler helpers that typescript/unstable (TS7) does not export, re-implemented over TS7 nodes\n// with the TS6 names and semantics so the printers keep their call sites.\nimport { SyntaxKind, NodeFlags, ModifierFlags, type Node, type NodeArray } from \"typescript/unstable/ast\";\n\nconst FUNCTION_LIKE_KINDS = new Set([\n SyntaxKind.FunctionDeclaration, SyntaxKind.MethodDeclaration, SyntaxKind.Constructor, SyntaxKind.GetAccessor,\n SyntaxKind.SetAccessor, SyntaxKind.FunctionExpression, SyntaxKind.ArrowFunction, SyntaxKind.MethodSignature,\n SyntaxKind.CallSignature, SyntaxKind.JSDocSignature, SyntaxKind.ConstructSignature, SyntaxKind.IndexSignature,\n SyntaxKind.FunctionType, SyntaxKind.ConstructorType,\n]);\n\nfunction isFunctionLike(node: Node | undefined): boolean {\n return node !== undefined && FUNCTION_LIKE_KINDS.has(node.kind);\n}\n\nfunction isClassLike(node: Node | undefined): boolean {\n return node !== undefined && (node.kind === SyntaxKind.ClassDeclaration || node.kind === SyntaxKind.ClassExpression);\n}\n\nfunction isStringLiteralLike(node: Node | undefined): boolean {\n return node !== undefined && (node.kind === SyntaxKind.StringLiteral || node.kind === SyntaxKind.NoSubstitutionTemplateLiteral);\n}\n\n// TS6 contract: callback returning true stops at that node, \"quit\" aborts with undefined\nfunction findAncestor(node: Node | undefined, callback: (element: Node) => boolean | \"quit\"): T | undefined {\n while (node) {\n const result = callback(node);\n if (result === \"quit\") {\n return undefined;\n }\n if (result) {\n return node as T;\n }\n node = node.parent;\n }\n return undefined;\n}\n\nfunction heritageTypes(node: any, token: SyntaxKind): Node[] {\n const clause = (node.heritageClauses ?? []).find((c: any) => c.token === token);\n return clause ? [...clause.types] : [];\n}\n\n// extends (first type only for classes) followed by implements, as in TS6\nfunction getAllSuperTypeNodes(node: Node): readonly Node[] {\n if (node.kind === SyntaxKind.InterfaceDeclaration) {\n return heritageTypes(node, SyntaxKind.ExtendsKeyword);\n }\n if (isClassLike(node)) {\n return [...heritageTypes(node, SyntaxKind.ExtendsKeyword).slice(0, 1), ...heritageTypes(node, SyntaxKind.ImplementsKeyword)];\n }\n return [];\n}\n\nfunction getCombinedNodeFlags(node: Node): NodeFlags {\n while (node.kind === SyntaxKind.BindingElement) {\n node = node.parent.parent;\n }\n let flags = node.flags;\n if (node.kind === SyntaxKind.VariableDeclaration) {\n node = node.parent;\n }\n if (node && node.kind === SyntaxKind.VariableDeclarationList) {\n flags |= node.flags;\n node = node.parent;\n }\n if (node && node.kind === SyntaxKind.VariableStatement) {\n flags |= node.flags;\n }\n return flags;\n}\n\nfunction canHaveModifiers(node: Node): boolean {\n return (node as any).modifiers !== undefined || FUNCTION_LIKE_KINDS.has(node.kind) || node.kind === SyntaxKind.Parameter\n || node.kind === SyntaxKind.PropertyDeclaration || node.kind === SyntaxKind.ClassDeclaration || node.kind === SyntaxKind.VariableStatement;\n}\n\nfunction getModifiers(node: Node): readonly Node[] | undefined {\n const modifiers: NodeArray | undefined = (node as any).modifiers;\n const filtered = modifiers?.filter((m) => m.kind !== SyntaxKind.Decorator);\n return filtered && filtered.length > 0 ? filtered : undefined;\n}\n\nexport {\n ModifierFlags,\n isFunctionLike,\n isClassLike,\n isStringLiteralLike,\n findAncestor,\n getAllSuperTypeNodes,\n getCombinedNodeFlags,\n canHaveModifiers,\n getModifiers,\n};\n\n// TS7 symbols/signatures carry NodeHandles and types carry ids; these return live nodes/types like TS6 fields did\nfunction symbolDeclarations(symbol: any): Node[] {\n return (symbol?.declarations ?? []).map((d: any) => d.resolve()).filter((d: Node | undefined) => d !== undefined);\n}\n\nfunction symbolValueDeclaration(symbol: any): any {\n return symbol?.valueDeclaration?.resolve();\n}\n\nfunction signatureDeclaration(signature: any): Node | undefined {\n return signature?.declaration?.resolve();\n}\n\n// TS6 `type.types` for unions/intersections, undefined otherwise\nfunction typeParts(type: any): any[] | undefined {\n return type?.isUnionType?.() || type?.isIntersectionType?.() ? type.getTypes() : undefined;\n}\n\n// TS6 `type.target` for type references, undefined otherwise\nfunction typeTarget(type: any): any {\n return type?.target !== undefined ? type.getTarget() : undefined;\n}\n\nexport { symbolDeclarations, symbolValueDeclaration, signatureDeclaration, typeParts, typeTarget };\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AACA,SAAS,qBAAqB;AAC9B,OAAO,UAAU;AAFjB,IAIM,aACA,YAEO;AAPb;AAAA;AAIA,IAAM,cAAc,MAAM,cAAc,YAAY,GAAG;AACvD,IAAM,aAAa,MAAM,KAAK,QAAQ,YAAY,CAAC;AAE5C,IAAM,YAA4B,2BAAW;AAAA;AAAA;;;ACPpD;AAEA,SAAS,YAAuB,qBAAgD;AAEhF,IAAM,sBAAsB,oBAAI,IAAgB;AAAA,EAC5C,WAAW;AAAA,EAAqB,WAAW;AAAA,EAAmB,WAAW;AAAA,EAAa,WAAW;AAAA,EACjG,WAAW;AAAA,EAAa,WAAW;AAAA,EAAoB,WAAW;AAAA,EAAe,WAAW;AAAA,EAC5F,WAAW;AAAA,EAAe,WAAW;AAAA,EAAgB,WAAW;AAAA,EAAoB,WAAW;AAAA,EAC/F,WAAW;AAAA,EAAc,WAAW;AACxC,CAAC;AAED,SAAS,eAAe,MAAiC;AACrD,SAAO,SAAS,UAAa,oBAAoB,IAAI,KAAK,IAAI;AAClE;AAEA,SAAS,YAAY,MAAiC;AAClD,SAAO,SAAS,WAAc,KAAK,SAAS,WAAW,oBAAoB,KAAK,SAAS,WAAW;AACxG;AAEA,SAAS,oBAAoB,MAAiC;AAC1D,SAAO,SAAS,WAAc,KAAK,SAAS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S,WAAW,uBAAuB,KAAK,SAAS,WAAW,oBAAoB,KAAK,SAAS,WAAW;AACjI;AAEA,SAAS,aAAa,MAAyC;AAC3D,QAAM,YAA0C,KAAa;AAC7D,QAAM,WAAW,WAAW,OAAO,CAAC,MAAM,EAAE,SAAS,WAAW,SAAS;AACzE,SAAO,YAAY,SAAS,SAAS,IAAI,WAAW;AACxD;AAeA,SAAS,mBAAmB,QAAqB;AAC7C,UAAQ,QAAQ,gBAAgB,CAAC,GAAG,IAAI,CAAC,MAAW,EAAE,QAAQ,CAAC,EAAE,OAAO,CAAC,MAAwB,MAAM,MAAS;AACpH;AAEA,SAAS,uBAAuB,QAAkB;AAC9C,SAAO,QAAQ,kBAAkB,QAAQ;AAC7C;AAEA,SAAS,qBAAqB,WAAkC;AAC5D,SAAO,WAAW,aAAa,QAAQ;AAC3C;AAGA,SAAS,UAAU,MAA8B;AAC7C,SAAO,MAAM,cAAc,KAAK,MAAM,qBAAqB,IAAI,KAAK,SAAS,IAAI;AACrF;AAGA,SAAS,WAAW,MAAgB;AAChC,SAAO,MAAM,WAAW,SAAY,KAAK,UAAU,IAAI;AAC3D;","names":[]} \ No newline at end of file diff --git a/dist/chunk-VNDHHGGT.js b/dist/chunk-WD722H3U.js similarity index 96% rename from dist/chunk-VNDHHGGT.js rename to dist/chunk-WD722H3U.js index 307ca4c3..637fe54c 100644 --- a/dist/chunk-VNDHHGGT.js +++ b/dist/chunk-WD722H3U.js @@ -27,12 +27,12 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge mod )); -// node_modules/tsup/assets/esm_shims.js +// ../../ts7perf-nm/cs-ast/node_modules/tsup/assets/esm_shims.js import { fileURLToPath } from "url"; import path from "path"; var getFilename, getDirname, __dirname; var init_esm_shims = __esm({ - "node_modules/tsup/assets/esm_shims.js"() { + "../../ts7perf-nm/cs-ast/node_modules/tsup/assets/esm_shims.js"() { getFilename = () => fileURLToPath(import.meta.url); getDirname = () => path.dirname(getFilename()); __dirname = /* @__PURE__ */ getDirname(); @@ -154,4 +154,4 @@ export { typeParts, typeTarget }; -//# sourceMappingURL=chunk-VNDHHGGT.js.map \ No newline at end of file +//# sourceMappingURL=chunk-WD722H3U.js.map \ No newline at end of file diff --git a/dist/chunk-WD722H3U.js.map b/dist/chunk-WD722H3U.js.map new file mode 100644 index 00000000..32911fa3 --- /dev/null +++ b/dist/chunk-WD722H3U.js.map @@ -0,0 +1 @@ +{"version":3,"sources":["../../../ts7perf-nm/cs-ast/node_modules/tsup/assets/esm_shims.js","../src/tsUtils.ts"],"sourcesContent":["// Shim globals in esm bundle\nimport { fileURLToPath } from 'url'\nimport path from 'path'\n\nconst getFilename = () => fileURLToPath(import.meta.url)\nconst getDirname = () => path.dirname(getFilename())\n\nexport const __dirname = /* @__PURE__ */ getDirname()\nexport const __filename = /* @__PURE__ */ getFilename()\n","// TS6 compiler helpers that typescript/unstable (TS7) does not export, re-implemented over TS7 nodes\n// with the TS6 names and semantics so the printers keep their call sites.\nimport { SyntaxKind, NodeFlags, ModifierFlags, type Node, type NodeArray } from \"typescript/unstable/ast\";\n\nconst FUNCTION_LIKE_KINDS = new Set([\n SyntaxKind.FunctionDeclaration, SyntaxKind.MethodDeclaration, SyntaxKind.Constructor, SyntaxKind.GetAccessor,\n SyntaxKind.SetAccessor, SyntaxKind.FunctionExpression, SyntaxKind.ArrowFunction, SyntaxKind.MethodSignature,\n SyntaxKind.CallSignature, SyntaxKind.JSDocSignature, SyntaxKind.ConstructSignature, SyntaxKind.IndexSignature,\n SyntaxKind.FunctionType, SyntaxKind.ConstructorType,\n]);\n\nfunction isFunctionLike(node: Node | undefined): boolean {\n return node !== undefined && FUNCTION_LIKE_KINDS.has(node.kind);\n}\n\nfunction isClassLike(node: Node | undefined): boolean {\n return node !== undefined && (node.kind === SyntaxKind.ClassDeclaration || node.kind === SyntaxKind.ClassExpression);\n}\n\nfunction isStringLiteralLike(node: Node | undefined): boolean {\n return node !== undefined && (node.kind === SyntaxKind.StringLiteral || node.kind === SyntaxKind.NoSubstitutionTemplateLiteral);\n}\n\n// TS6 contract: callback returning true stops at that node, \"quit\" aborts with undefined\nfunction findAncestor(node: Node | undefined, callback: (element: Node) => boolean | \"quit\"): T | undefined {\n while (node) {\n const result = callback(node);\n if (result === \"quit\") {\n return undefined;\n }\n if (result) {\n return node as T;\n }\n node = node.parent;\n }\n return undefined;\n}\n\nfunction heritageTypes(node: any, token: SyntaxKind): Node[] {\n const clause = (node.heritageClauses ?? []).find((c: any) => c.token === token);\n return clause ? [...clause.types] : [];\n}\n\n// extends (first type only for classes) followed by implements, as in TS6\nfunction getAllSuperTypeNodes(node: Node): readonly Node[] {\n if (node.kind === SyntaxKind.InterfaceDeclaration) {\n return heritageTypes(node, SyntaxKind.ExtendsKeyword);\n }\n if (isClassLike(node)) {\n return [...heritageTypes(node, SyntaxKind.ExtendsKeyword).slice(0, 1), ...heritageTypes(node, SyntaxKind.ImplementsKeyword)];\n }\n return [];\n}\n\nfunction getCombinedNodeFlags(node: Node): NodeFlags {\n while (node.kind === SyntaxKind.BindingElement) {\n node = node.parent.parent;\n }\n let flags = node.flags;\n if (node.kind === SyntaxKind.VariableDeclaration) {\n node = node.parent;\n }\n if (node && node.kind === SyntaxKind.VariableDeclarationList) {\n flags |= node.flags;\n node = node.parent;\n }\n if (node && node.kind === SyntaxKind.VariableStatement) {\n flags |= node.flags;\n }\n return flags;\n}\n\nfunction canHaveModifiers(node: Node): boolean {\n return (node as any).modifiers !== undefined || FUNCTION_LIKE_KINDS.has(node.kind) || node.kind === SyntaxKind.Parameter\n || node.kind === SyntaxKind.PropertyDeclaration || node.kind === SyntaxKind.ClassDeclaration || node.kind === SyntaxKind.VariableStatement;\n}\n\nfunction getModifiers(node: Node): readonly Node[] | undefined {\n const modifiers: NodeArray | undefined = (node as any).modifiers;\n const filtered = modifiers?.filter((m) => m.kind !== SyntaxKind.Decorator);\n return filtered && filtered.length > 0 ? filtered : undefined;\n}\n\nexport {\n ModifierFlags,\n isFunctionLike,\n isClassLike,\n isStringLiteralLike,\n findAncestor,\n getAllSuperTypeNodes,\n getCombinedNodeFlags,\n canHaveModifiers,\n getModifiers,\n};\n\n// TS7 symbols/signatures carry NodeHandles and types carry ids; these return live nodes/types like TS6 fields did\nfunction symbolDeclarations(symbol: any): Node[] {\n return (symbol?.declarations ?? []).map((d: any) => d.resolve()).filter((d: Node | undefined) => d !== undefined);\n}\n\nfunction symbolValueDeclaration(symbol: any): any {\n return symbol?.valueDeclaration?.resolve();\n}\n\nfunction signatureDeclaration(signature: any): Node | undefined {\n return signature?.declaration?.resolve();\n}\n\n// TS6 `type.types` for unions/intersections, undefined otherwise\nfunction typeParts(type: any): any[] | undefined {\n return type?.isUnionType?.() || type?.isIntersectionType?.() ? type.getTypes() : undefined;\n}\n\n// TS6 `type.target` for type references, undefined otherwise\nfunction typeTarget(type: any): any {\n return type?.target !== undefined ? type.getTarget() : undefined;\n}\n\nexport { symbolDeclarations, symbolValueDeclaration, signatureDeclaration, typeParts, typeTarget };\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AACA,SAAS,qBAAqB;AAC9B,OAAO,UAAU;AAFjB,IAIM,aACA,YAEO;AAPb;AAAA;AAIA,IAAM,cAAc,MAAM,cAAc,YAAY,GAAG;AACvD,IAAM,aAAa,MAAM,KAAK,QAAQ,YAAY,CAAC;AAE5C,IAAM,YAA4B,2BAAW;AAAA;AAAA;;;ACPpD;AAEA,SAAS,YAAuB,qBAAgD;AAEhF,IAAM,sBAAsB,oBAAI,IAAgB;AAAA,EAC5C,WAAW;AAAA,EAAqB,WAAW;AAAA,EAAmB,WAAW;AAAA,EAAa,WAAW;AAAA,EACjG,WAAW;AAAA,EAAa,WAAW;AAAA,EAAoB,WAAW;AAAA,EAAe,WAAW;AAAA,EAC5F,WAAW;AAAA,EAAe,WAAW;AAAA,EAAgB,WAAW;AAAA,EAAoB,WAAW;AAAA,EAC/F,WAAW;AAAA,EAAc,WAAW;AACxC,CAAC;AAED,SAAS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KAAK;AAAA,EAChB;AACA,MAAI,QAAQ,KAAK,SAAS,WAAW,mBAAmB;AACpD,aAAS,KAAK;AAAA,EAClB;AACA,SAAO;AACX;AAEA,SAAS,iBAAiB,MAAqB;AAC3C,SAAQ,KAAa,cAAc,UAAa,oBAAoB,IAAI,KAAK,IAAI,KAAK,KAAK,SAAS,WAAW,aACxG,KAAK,SAAS,WAAW,uBAAuB,KAAK,SAAS,WAAW,oBAAoB,KAAK,SAAS,WAAW;AACjI;AAEA,SAAS,aAAa,MAAyC;AAC3D,QAAM,YAA0C,KAAa;AAC7D,QAAM,WAAW,WAAW,OAAO,CAAC,MAAM,EAAE,SAAS,WAAW,SAAS;AACzE,SAAO,YAAY,SAAS,SAAS,IAAI,WAAW;AACxD;AAeA,SAAS,mBAAmB,QAAqB;AAC7C,UAAQ,QAAQ,gBAAgB,CAAC,GAAG,IAAI,CAAC,MAAW,EAAE,QAAQ,CAAC,EAAE,OAAO,CAAC,MAAwB,MAAM,MAAS;AACpH;AAEA,SAAS,uBAAuB,QAAkB;AAC9C,SAAO,QAAQ,kBAAkB,QAAQ;AAC7C;AAEA,SAAS,qBAAqB,WAAkC;AAC5D,SAAO,WAAW,aAAa,QAAQ;AAC3C;AAGA,SAAS,UAAU,MAA8B;AAC7C,SAAO,MAAM,cAAc,KAAK,MAAM,qBAAqB,IAAI,KAAK,SAAS,IAAI;AACrF;AAGA,SAAS,WAAW,MAAgB;AAChC,SAAO,MAAM,WAAW,SAAY,KAAK,UAAU,IAAI;AAC3D;","names":[]} \ No newline at end of file diff --git a/dist/csharpTranspiler.d.ts b/dist/csharpTranspiler.d.ts index 3795989b..a1da9fc7 100644 --- a/dist/csharpTranspiler.d.ts +++ b/dist/csharpTranspiler.d.ts @@ -290,4 +290,11 @@ export declare class CSharpTranspiler extends BaseTranspiler { printNewExpression(node: any, identation: any): string; printThrowStatement(node: any, identation: any): string; printPropertyAccessModifiers(node: any): string; + csharpHx4DeclaredReceiverReadable(node: any, expression: any): boolean; + csharpHx4IdentifierKeyRead(expression: any, argumentExpression: any): string | undefined; + csharpHx4IsPlainRead(node: any): boolean; + csharpHx4DeclaredKeyType(key: any): string | undefined; + csharpHx4GuardedNullableNegation(node: any, csharpType: string): boolean; + csharpHx4DeclaredLocalType(declaration: any): string | undefined; + csharpHx4NativeNegatedNullableLocal(node: any, leftSide: string): string | undefined; } diff --git a/dist/goTranspiler.d.ts b/dist/goTranspiler.d.ts index f7824819..3d832019 100644 --- a/dist/goTranspiler.d.ts +++ b/dist/goTranspiler.d.ts @@ -556,4 +556,43 @@ export declare class GoTranspiler extends BaseTranspiler { * Check if the last statement in a block is a conditional with returns in all branches */ blockEndsWithConditionalReturn(statements: NodeArray): boolean; + g01MapParamType(node: any): string | undefined; + g01ReadOk(receiver: any, access: any): string | undefined; + g01LiteralKey(key: any): boolean; + g01IsWriteValue(access: any): boolean; + g01MarketRow(node: any): boolean; + g01DerefConsumer(access: any): boolean; + goG02NonPointerAccessorSource(expr: any): boolean; + goG02LiteralDefault(node: any): boolean; + goHx4G06DerefLength(expression: any, printedText: string, lengthNode: any): string | undefined; + goHx4G06DerefIndexOf(node: any, name: any, parsedArg: any): string | undefined; + goLiteralUnionNarrowedStringDeref(node: any): boolean; + GO_G09_NUMERIC_FIELDS: { + [tsName: string]: string; + }; + goG09FieldKind(node: any): string | undefined; + goG09OperandKind(node: any, text: string): [string, boolean] | undefined; + printG09WideningComparison(left: any, right: any, leftText: string, rightText: string, op: any): string | undefined; +} +export interface GoTranspiler { + goNativeIntWideningArithmetic(node: any, leftType: string, rightType: string, leftText: string, rightText: string): { + goType: string; + text: string; + } | undefined; +} +export interface GoTranspiler { + goStringLiteralUnionType(type: any): boolean; +} +export interface GoTranspiler { + goConcatDerefableStringOperand(node: any): boolean; +} +export interface GoTranspiler { + x02CurrencyRow(node: any): boolean; +} +export interface GoTranspiler { + g11NativeParameterType(fn: any, param: any, index: number): string | undefined; + g11ParameterHasNullishDefault(body: any, param: any): boolean; +} +export interface GoTranspiler { + g13NumericParameterCandidates(param: any): string[]; } diff --git a/dist/javaTranspiler.d.ts b/dist/javaTranspiler.d.ts index d0c95bdc..61810735 100644 --- a/dist/javaTranspiler.d.ts +++ b/dist/javaTranspiler.d.ts @@ -373,4 +373,23 @@ export declare class JavaTranspiler extends BaseTranspiler { printForStatement(node: any, identation: any): string; printReturnStatement(node: any, identation: any): string; private allBranchesTerminate; + javaHx4MapPutIsNative(baseExpr: any, keys: any[]): boolean; + javaHx4PlainMapSource(container: any, value: any): boolean; + javaHx4DefaultIsPlain(value: any): boolean; + javaHx4NonSharedSource(value: any, depth: number): boolean; + javaHx4SourceVerdicts: WeakMap; + javaHx4InProgress: Set; + javaHx4NonSharedValue(value: any, depth: number): boolean; + javaJ02FieldMapReadText(receiver: any, key: any): string | undefined; + javaHx4J05IntegralModOperand(node: any): boolean; + printHx4J05ModComparison(left: any, right: any, op: any): string | undefined; + javaHx4J06NarrowedIndexOf(node: any, name: any, parsedArg: any): string; +} +export interface JavaTranspiler { + hx4J09BoxIdentifier(node: any, seen: Set, depth: number): boolean; + hx4J09BoxValue(node: any, seen: Set, depth: number): boolean; + hx4J09LiteralTupleElement(node: any, index: number): boolean; + hx4J09CatchCannotWrap(node: any): boolean; + hx4J09CoreArgument(type: string, printed: string, node: any): string | undefined; + hx4J09CcxtErrorClass(node: any): boolean; } diff --git a/dist/rustTranspiler.d.ts b/dist/rustTranspiler.d.ts index 78b460c2..324d7fb8 100644 --- a/dist/rustTranspiler.d.ts +++ b/dist/rustTranspiler.d.ts @@ -647,5 +647,261 @@ export declare class RustTranspiler extends BaseTranspiler { printContinueStatement(node: any, identation: any): string; printConstructorDeclaration(node: any, identation: any): string; printSpreadElement(node: any, identation: any): string; + /** Base-tier methods whose every return is a fresh tag-free object + * literal (no venue override, no hand-written stub replaces them). */ + private static readonly RUST_R01_PLAIN_DICT_BUILDERS; + /** Base-tier `[Dict, Dict]` tuple helpers that hand back their `request` argument (index 1). */ + private static readonly RUST_R01_REQUEST_TUPLE_HELPERS; + rustR01NativeDictInsert(baseExpr: any, keyNode: any, keyText: string, valueText: string): string | undefined; + /** A local (single binding in its function, no closure capture of a write) + * whose declaration and every write is a plain-dict source or nullish. A + * nullish value leaves a non-Dict, which `if let Value::Dict` no-ops on + * exactly like the helper's `_ => {}` arm. */ + rustR01LocalStaysPlain(ident: Identifier, depth?: number): boolean; + /** `const [ x, p ] = this.handleUntilOption (k, r, …)` with `r` itself a + * plain local: element 0 is `r` handed back, and `x` is never re-written. */ + private rustR01TupleBindingStaysPlain; + /** The shipped construction proof (literal-built local / handler tuple), read-only. */ + private rustR01ShippedPlain; + /** A use of the local: reads and element writes keep the box; a direct + * assignment must store a plain source; any other write shape rejects. */ + private rustR01UseKeepsPlain; + /** `[ x, … ] = this.handleUntilOption (k, x, …)` — element 0 is the request + * argument handed back (base-tier implementation, no override). */ + private rustR01RequestTupleWrite; + /** Element 0 of `this.m (…)` is a plain dict: `m` is the base-tier + * `handleUntilOption` (returns its `request` argument), or a method of the + * calling file (Rust calls it statically) whose every `return [ X, … ]` + * has X a plain literal / plain local, or a parameter whose argument here is. */ + private rustR01TupleHeadIsPlain; + /** A pass-through parameter: never assigned in the method body. */ + private rustR01ParamUnassigned; + /** A value that is a fresh plain dict, nullish, or the local itself. */ + rustR01PlainSource(node: Node, name: string): boolean; + /** The checker resolves the call to the base-tier implementation (a venue + * override could return anything). */ + private rustR01CalleeIsBase; + /** The class property declaration behind `this.` when its annotation proves a plain dict. */ + rustProvenDictThisField(node: Node): Declaration | undefined; + /** `this.[a]` whose declared field type's element type is itself a plain dict + * (`Dictionary>`). */ + rustProvenDictThisFieldElement(node: Node): boolean; + /** `this.[k]` with a proven-dict field and a proven string key place. */ + printNativeThisFieldDynamicMapAccess(receiverText: string, receiverNode: Node, keyNode: Node): string | undefined; + private rustVecLocalDecisions; + rustVecLocalIsTyped(declaration: any): boolean; + rustVecLocalIsTypedUncached(declaration: any): boolean; + rustVecPushShape(call: any, name: string): boolean; + rustVecValueUse(n: any, name: string): boolean; + rustVecIsFinalUse(n: any, name: string): boolean; + rustVecBoxingCallee(callee: any): boolean; + rustVecLocalDeclarationOf(node: any): any; + printRustVecPush(node: any, name: string | undefined, parsedArg: string | undefined): string | undefined; + transformIdentifier(node: any, identifier: any): string; + /** Source path of a node (forward slashes). */ + r05Path(node: Node): string; + /** Test sources keep the helpers: tests-pipeline post-passes match `in_op(` text. */ + r05IsTest(node: Node): boolean; + /** `k in X` with a non-literal key on a dict-shaped receiver: `in_op`'s Dict arm. + * The Arr arm is the only other `true` path; the dict proof excludes it. */ + r05InOp(key: any, obj: any): string | undefined; + /** `delete X[k]` on a receiver the native-insert proof admits (never a ws + * subscriptions snapshot, so `try_ws_subs_remove` is dead): `shift_remove`. */ + r05Delete(node: any): string | undefined; + /** `this.` with a declared plain-dict type that is no ws container: the + * hand-written base builds these maps itself and never tags them. */ + r05UntaggedField(node: any): boolean; + rustProvenDictThisFieldR05(node: any): boolean; + /** `Object.keys/values(X)` in REST-tier sources (`ts/src/.ts`): no ws client + * there, so X never carries the `__ws_subs_url`/`__ws_sub_ref` tags the helper filters. */ + r05Enum(node: any, parsedArg: string | undefined, kind: 'keys' | 'values'): string | undefined; + /** Printed receiver usable as a method receiver, else undefined. */ + rustNativeStringReceiver(node: any, receiverText: string, kind?: string): string | undefined; + /** Escaped text of a string-literal argument, else undefined. */ + rustNativeStringLiteralArg(node: any): string | undefined; + printNativeStringCase(node: any, receiverText: string, method: string): string | undefined; + printNativeStringAffixTest(node: any, receiverText: string, method: string): string | undefined; + printNativeStringSplit(node: any, receiverText: string): string | undefined; + printNativeStringReplace(node: any, receiverText: string): string | undefined; + printNativeStringPadStart(node: any, receiverText: string): string | undefined; + printNativeStringIndexOfString(node: any, receiverText: string): string | undefined; + printNativeStringJoin(node: any, receiverText: string): string | undefined; + rustOperandKind(node: any): string | undefined; + printRustNativeToString(node: any, name: string): string | undefined; + printRustNativeMathCall(node: any, op: string, parsedArg: string): string | undefined; + printRustNativeNegate(operand: any, operandText: string): string | undefined; + printRustNativeMod(left: any, right: any, leftText: string, rightText: string): string | undefined; + rustR09IsDefiniteInt(node: any): boolean; + rustR09NumericOperand(node: any): string | undefined; + rustR09LengthEquality(left: any, right: any, op: any): string | undefined; + rustR09NativeAddSubtract(op: any, left: any, right: any, leftType: any, rightType: any, leftText: string, rightText: string): string | undefined; + /** 'local' for an R01-proven plain-dict local, 'param' for a plain-kept dict parameter. */ + rustR10PlainReceiver(node: Node): 'local' | 'param' | undefined; + /** A literal-key read (`x['k']` / `x.k`) on a proven plain receiver. */ + rustR10LiteralReadOk(receiverNode: Node, keyText: string): boolean; + /** `x[k]` on a proven plain receiver with a `Value` key place (`string` or `any` typed). */ + rustR10DynamicRead(receiverText: string, receiverNode: Node, keyNode: Node): string | undefined; + r11VecUse(n: any): boolean; + r11LoopBetween(n: any): boolean; + r11VecReadShape(access: any): boolean; + printElementAccessExpressionExceptionIfAny(node: any): any; + r11ProvenListValue(node: any, depth?: number): boolean; + /** Base-tier bool readers whose Rust form returns `Value::Bool` or `Value::Null` + * (`safe_bool*` keep only `Value::Bool` or the default; the `check_option_bool` stub). */ + private static readonly RUST_R12_BOOL_READERS; + private static readonly RUST_R12_DICT_READERS; + /** A REST venue file (`ts/src/.ts`): no base / pro / prediction tier. */ + private static readonly RUST_R12_REST_FILE; + /** Extra plain-dict write sources (R01 write-history proof), REST venue files only: no + * runtime tagged handle (book, ws subscription, cache bucket) is reachable there. */ + private rustR12Visiting; + rustR12PlainSource(node: any, depth?: number): boolean; + /** `this.options`, a parameter, or a const local whose initializer reads no `this` field + * but `options` and no tagged container (`hashmap`, `subscriptions`, `futures`). */ + rustR12UnsharedDict(arg: any): boolean; + /** `this.m (…)` on a sync method of the calling file whose every `return` is a plain + * literal, a plain local, or `this.extend|omit|keysort (plain, …unshared)`. */ + rustR12PlainBuilder(call: any, depth: number): boolean; + rustR12PlainReturn(expr: any, depth: number): boolean; + /** The single bodied method declaration `this.m (…)` resolves to (implementation of an + * overload set), in the calling file or the base tier. */ + rustR12MethodImpl(call: any): any; + /** The expression's Rust value is always `Value::Bool(_)` or `Value::Null`. */ + rustR12BoolValue(expr: any, depth?: number): boolean; + /** A base `safeBool*` with a bool default, `checkOptionBool`, or a method (calling file or + * base tier) whose every `return` is such a value. */ + rustR12BoolCall(call: any, depth: number): boolean; + rustR12EveryReturn(call: any, depth: number, ok: (e: any) => boolean): boolean; + /** Element `index` of `this.m (…)`'s tuple is a bool value on every return path. */ + rustR12BoolTupleElement(expr: any, index: number, depth: number): boolean; + /** A local whose declaration and every write store a bool value. Locals the printer or + * ccxt's narrowBoolLocals may declare `bool` (bool-expression initializer) are left out. */ + rustR12BoolLocal(ident: any, depth: number): boolean; + /** `if (x)` on a local or `this.m (…)` proven a bool value: `x.as_bool() == Some(true)` + * is `is_true` on `Value::Bool`/`Value::Null`; bool slots only (leading-token boxing). */ + rustR12NativeTruthiness(node: any): string | undefined; + /** `x === true|false` with `x` proven a bool value: `is_equal` against a `Value::Bool` is + * the payload compare there (Null matches neither). */ + rustR12NativeBoolEquality(left: any, right: any, op: any): string | undefined; + rustR13ProvenStrSource(node: any): boolean; + rustR13ProvenStrIdentifier(node: any): boolean; + /** A destructuring / for-in-of target: a write the direct-assignment check cannot see. */ + rustR13WriteTarget(node: any): boolean; + /** `x` / `(x as string)` → the identifier under parens / `as`. */ + rustR13PeelCast(node: any): any; + /** Printed text of an operand that is always `Value::Str` / `Value::Null`, else undefined: + * a proven-`Str` local, a checker-`string` declared local/param (the R06 needle rule), or + * `"lit" + e` / `e + "lit"` (the `add` helper's string branch always yields `Value::Str`). */ + rustR13StrOperand(node: any, allowChecker: boolean): string | undefined; + printRustR13ProvenStrEquality(left: any, right: any, op: any): string | undefined; + /** Receiver text when the call's receiver is a proven-`Str` local (R06 covers checker strings). */ + rustR13Receiver(node: any, receiverText: string): string | undefined; + /** R06's checker-string receiver, when it prints as a bare name (it is read twice). */ + rustR13PlainReceiver(node: any, receiverText: string): string | undefined; + printRustR13Replace(node: any, receiverText: string): string | undefined; + printRustR13Split(node: any, receiverText: string): string | undefined; + printRustR13ToString(node: any, receiverText: string): string | undefined; + printRustR13Case(node: any, receiverText: string, method: string): string | undefined; + /** A bodiless overload signature whose class also holds the bodied implementation. */ + r14BaseOverload(declaration: any): boolean; + /** `x[a ± b]` on a checker-proven list, each operand a numeric literal, a `Value` loop + * counter or a `const n = y.length` local: the key prints as a `Value` number, so the + * list arm of `get_value` (Int index, else miss) is spelled natively. */ + r14ListArithIndex(receiverText: string, receiverNode: Node, keyNode: Node): string | undefined; + r14ValueNumberOperand(node: any): boolean; + r15VecJoinUse(access: any): boolean; + r15PrintVecJoin(node: any): string | undefined; + r15VecPropertyUse(n: any): boolean; + private rustR16InProgress; + private rustR16Assumed; + rustR16NumericKind(node: any, depth?: number): string | undefined; + rustR16Combine(kinds: (string | undefined)[]): string | undefined; + rustR16StructuralKind(inner: any, depth: number): string | undefined; + rustR16CallKind(call: any, depth: number): string | undefined; + rustR16IdentifierKind(ident: any, depth: number): string | undefined; + rustR16WrittenKind(declaration: any, depth: number): string | undefined; + rustR16HasWrites(declaration: any): boolean; + rustR16OrderedProven(op: any, left: any, right: any): boolean; + rustR16NativeArithmetic(op: any, left: any, right: any, leftText: string, rightText: string): string | undefined; + r17AlwaysStr(node: any): boolean; + r17ConcatOperandSafe(node: any, type: any): boolean; + r17ConcatIsAnchored(left: any, right: any, leftType: any, rightType: any): boolean; + /** R06 checker-string or R13 proven-`Str` receiver printed as a plain name / parenthesised. */ + r17Receiver(node: any, receiverText: string): string | undefined; + r17PrintTrim(node: any, receiverText: string): string | undefined; + r17PrintAffixTest(node: any, receiverText: string, method: string): string | undefined; + r17PrintReplace(node: any, receiverText: string): string | undefined; + /** `"lit" in x` where x is an R10-proven plain local / plain-kept Dict parameter. */ + r18LiteralInOp(key: any, obj: any): string | undefined; + /** `Object.keys/values(x)` in `ts/src/prediction/.ts` on an R10-proven plain local. */ + r18PredictionEnum(node: any, parsedArg: string | undefined, kind: 'keys' | 'values'): string | undefined; + /** Base-tier array readers whose result is the stored `Value::Arr` or the default argument. */ + private static readonly RUST_R18_LIST_READERS; + /** A source that is a `Value::Arr` or `Value::Null` (both helpers agree with `len()` / a no-op + * push there): `[...]`, nullish, a runtime `split`, base `toArray`, or a base `safeList*` + * read whose default is absent, nullish or `[...]`. */ + r18ArrSource(node: any, allowNull: boolean): boolean; + /** A local whose every write (declaration included) is an `r18ArrSource`, never captured by + * a closure: its `Value` is a plain `Value::Arr` (the runtime never tags an array). */ + r18ArrLocal(ident: any, allowNull: boolean): boolean; + /** `x.length` on an Arr-only local: `get_array_length`'s marker arms need a Dict. */ + r18ArrLength(node: any, receiver: string): string | undefined; + /** `x.push(v)` statement on an Arr-only local: `append_to_array`'s cache-push arm needs a Dict. */ + r18ArrPush(node: any, name: string | undefined, parsedArg: string | undefined): string | undefined; + r20BoolCallEquality(left: any, right: any, op: any): string | undefined; + /** `fn(...)` whose first `(` closes at the very end (string literals skipped). */ + r20Balanced(text: string): boolean; + r20NativeNumericAdd(op: any, left: any, right: any, leftText: string, rightText: string): string | undefined; + /** Base-tier (`ts/src/base/**`) `Object.keys/values(x)` on an R10-proven plain local. */ + r21BaseEnum(node: any, parsedArg: string | undefined, kind: 'keys' | 'values'): string | undefined; + private static readonly RUST_R21_PURE_STRING_METHODS; + /** `x['k'].m (…)` with `m` a non-mutating string method on a checker-`string` read: no + * ccxt pass rewrites that target (only `.push` / calls of the read itself). */ + r21PureStringMethodReceiver(node: any): boolean; + /** Locals whose Arr-only proof is in progress (a self-referencing write proves nothing new). */ + private r21ArrVisiting; + /** More always-`Value::Arr` sources for the R18 proof: base `arrayConcat` (Array on every + * arm), base `sortBy`/`sortBy2` of an Arr-only local (returns its input's variant), and a + * plain alias of a non-nullable Arr-only local (COW: the push never reaches the alias). */ + r21ArrSource(n: any): boolean; + r21ArrAlias(ident: any): boolean; + r22AssumedNumericSelf(inner: any): string | undefined; + private r22StrVisiting; + /** Always `Value::Str`: R17 shapes, a `+` chain with such an operand, or an always-Str local. */ + r22AlwaysStr(node: any): boolean; + /** A plain `Value` local, never captured by a closure, whose every write is always-Str (`x += e` + * keeps it), or Str|Null (R13 source / nullish) when the checker narrows this read to `string`. */ + r22AlwaysStrLocal(ident: any, allowNull?: boolean): boolean; + r22ConcatAnchor(node: any): boolean; + r22ConcatIsAnchored(left: any, right: any, leftType: any, rightType: any): boolean; + /** `Option<&str>` text of an operand that is always `Value::Str` / `Value::Null`, else undefined. */ + r22StrOrNullOperand(node: any): string | undefined; + r22StrOrderedComparison(node: any, op: any, left: any, right: any): string | undefined; + r23Tier(node: Node): 'rest' | 'base' | 'pro' | undefined; + r23PlainSourceTier(node: Node): boolean; + /** A copied/read dict argument outside REST: in pro only `this.options` or a proven plain + * local; in base also a parameter annotated with a plain-dict type (no `any` caller handle). */ + r23TierSourceOk(arg: any): boolean; + /** `this.extend (plain, …unshared)` / `this.omit|keysort (plain, …)` called directly + * (not only as a builder's return): the same fresh-copy proof as `rustR12PlainReturn`. */ + private r23CopyVisiting; + r23FreshCopy(node: any, depth: number): boolean; + r25LooseF64(binding: string): string; + r25PlainValueOperand(node: any): boolean; + r25NativeCoercingArithmetic(op: any, left: any, right: any, leftText: string, rightText: string): string | undefined; + r25NativeLooseOrderedComparison(node: any, op: any, left: any, right: any): string | undefined; + r25NativeStrOrNullConcat(left: any, right: any, leftText: string, rightText: string): string | undefined; + r25StrOrNull(node: any, depth: number): boolean; + /** Every dict `node` can evaluate to holds `key` as Str/Null or lacks it (a read of a missing key / non-dict is Null). */ + r25DictFieldStrOrNull(node: any, key: string, depth: number): boolean; + /** `this.m(..)` resolved to a same-file method with a body whose every return holds `key` as Str/Null. */ + r25MethodFieldStrOrNull(call: any, key: string, depth: number): boolean; + private static readonly R26_PARAMS_SLOT_ARG; + r26ParamsSlot(rhs: Node, selfName: string | undefined, depth: number): boolean; + r30LooseI64(expr: string): string; + r30SliceArm(variant: string, len: string, take: string, empty: string): string; + r30Slice(name: string, start: string, end: string): string; + r30IndexOf(name: string, needle: string): string; + r30Case(name: string, method: string): string; } export {}; diff --git a/dist/transpiler.cjs b/dist/transpiler.cjs index 9f10b9b8..49293dc8 100644 --- a/dist/transpiler.cjs +++ b/dist/transpiler.cjs @@ -11,34 +11,34 @@ -var _chunk4FDYB2TTcjs = require('./chunk-4FDYB2TT.cjs'); +var _chunkUBXMRIM6cjs = require('./chunk-UBXMRIM6.cjs'); // src/dirname.cjs -var require_dirname = _chunk4FDYB2TTcjs.__commonJS.call(void 0, { +var require_dirname = _chunkUBXMRIM6cjs.__commonJS.call(void 0, { "src/dirname.cjs"(exports, module) { - _chunk4FDYB2TTcjs.init_cjs_shims.call(void 0, ); + _chunkUBXMRIM6cjs.init_cjs_shims.call(void 0, ); module.exports = __dirname; } }); // src/transpiler.ts -_chunk4FDYB2TTcjs.init_cjs_shims.call(void 0, ); -var import_dirname = _chunk4FDYB2TTcjs.__toESM.call(void 0, require_dirname(), 1); +_chunkUBXMRIM6cjs.init_cjs_shims.call(void 0, ); +var import_dirname = _chunkUBXMRIM6cjs.__toESM.call(void 0, require_dirname(), 1); var _ast = require('typescript/unstable/ast'); var _sync = require('typescript/unstable/sync'); // src/pythonTranspiler.ts -_chunk4FDYB2TTcjs.init_cjs_shims.call(void 0, ); +_chunkUBXMRIM6cjs.init_cjs_shims.call(void 0, ); // src/baseTranspiler.ts -_chunk4FDYB2TTcjs.init_cjs_shims.call(void 0, ); +_chunkUBXMRIM6cjs.init_cjs_shims.call(void 0, ); var _is = require('typescript/unstable/ast/is'); var _factory = require('typescript/unstable/ast/factory'); // src/types.ts -_chunk4FDYB2TTcjs.init_cjs_shims.call(void 0, ); +_chunkUBXMRIM6cjs.init_cjs_shims.call(void 0, ); var TranspilationError = class extends Error { constructor(id, message, nodeText, start, end) { const parsedMessage = `Lang: ${id} Error: ${message} at ${start}:${end} node: "${nodeText}"`; @@ -48,7 +48,7 @@ var TranspilationError = class extends Error { }; // src/utils.ts -_chunk4FDYB2TTcjs.init_cjs_shims.call(void 0, ); +_chunkUBXMRIM6cjs.init_cjs_shims.call(void 0, ); function regexAll(text, array) { for (const i in array) { let regex = array[i][0]; @@ -63,7 +63,7 @@ function unCamelCase(s) { } // src/logger.ts -_chunk4FDYB2TTcjs.init_cjs_shims.call(void 0, ); +_chunkUBXMRIM6cjs.init_cjs_shims.call(void 0, ); var _colorette = require('colorette'); var Logger = class { // static createInstanceIfNeeded(): void { @@ -388,7 +388,7 @@ var BaseTranspiler = class { return type !== void 0 && this.getTypeFromRawType(type) === this.PROMISE_TYPE_KEYWORD; } isImplicitAsyncFunction(node) { - if (!this.implicitAsyncTranspiling || !_chunk4FDYB2TTcjs.isFunctionLike.call(void 0, node) || this.hasAsyncModifier(node)) { + if (!this.implicitAsyncTranspiling || !_chunkUBXMRIM6cjs.isFunctionLike.call(void 0, node) || this.hasAsyncModifier(node)) { return false; } const signature = this.getChecker().getSignatureFromDeclaration(node); @@ -409,7 +409,7 @@ var BaseTranspiler = class { return void 0; } let method = void 0; - let parentClass = _chunk4FDYB2TTcjs.getAllSuperTypeNodes.call(void 0, node.parent)[0]; + let parentClass = _chunkUBXMRIM6cjs.getAllSuperTypeNodes.call(void 0, node.parent)[0]; while (parentClass !== void 0) { const parentClassType = this.getChecker().getTypeAtLocation(parentClass); const parentClassDecl = _optionalChain([parentClassType, 'optionalAccess', _4 => _4.getSymbol, 'call', _5 => _5(), 'optionalAccess', _6 => _6.valueDeclaration, 'optionalAccess', _7 => _7.resolve, 'call', _8 => _8()]); @@ -426,7 +426,7 @@ var BaseTranspiler = class { } } }); - parentClass = _nullishCoalesce(_chunk4FDYB2TTcjs.getAllSuperTypeNodes.call(void 0, parentClassDecl)[0], () => ( void 0)); + parentClass = _nullishCoalesce(_chunkUBXMRIM6cjs.getAllSuperTypeNodes.call(void 0, parentClassDecl)[0], () => ( void 0)); } return method; } @@ -1390,7 +1390,7 @@ var BaseTranspiler = class { } wrapImplicitReturnAwait(node) { let exp = node.expression; - if (!exp || _is.isAwaitExpression.call(void 0, exp) || !this.isImplicitAsyncFunction(_chunk4FDYB2TTcjs.findAncestor.call(void 0, node, _chunk4FDYB2TTcjs.isFunctionLike)) || !this.isPromiseType(this.getChecker().getTypeAtLocation(exp))) { + if (!exp || _is.isAwaitExpression.call(void 0, exp) || !this.isImplicitAsyncFunction(_chunkUBXMRIM6cjs.findAncestor.call(void 0, node, _chunkUBXMRIM6cjs.isFunctionLike)) || !this.isPromiseType(this.getChecker().getTypeAtLocation(exp))) { return node; } if (_is.isConditionalExpression.call(void 0, exp) || _is.isBinaryExpression.call(void 0, exp)) { @@ -2211,7 +2211,7 @@ var PythonTranspiler = class extends BaseTranspiler { }; // src/phpTranspiler.ts -_chunk4FDYB2TTcjs.init_cjs_shims.call(void 0, ); +_chunkUBXMRIM6cjs.init_cjs_shims.call(void 0, ); @@ -2606,7 +2606,7 @@ var PhpTranspiler = class extends BaseTranspiler { }; // src/csharpTranspiler.ts -_chunk4FDYB2TTcjs.init_cjs_shims.call(void 0, ); +_chunkUBXMRIM6cjs.init_cjs_shims.call(void 0, ); @@ -3072,7 +3072,7 @@ var CSharpTranspiler = class extends BaseTranspiler { return _nullishCoalesce(cached, () => ( void 0)); } let method = void 0; - let parentClass = _chunk4FDYB2TTcjs.getAllSuperTypeNodes.call(void 0, node.parent)[0]; + let parentClass = _chunkUBXMRIM6cjs.getAllSuperTypeNodes.call(void 0, node.parent)[0]; while (parentClass !== void 0) { const parentClassDecl = _optionalChain([this, 'access', _65 => _65.getChecker, 'call', _66 => _66(), 'access', _67 => _67.getTypeAtLocation, 'call', _68 => _68(parentClass), 'optionalAccess', _69 => _69.getSymbol, 'call', _70 => _70(), 'optionalAccess', _71 => _71.valueDeclaration, 'optionalAccess', _72 => _72.resolve, 'call', _73 => _73()]); if (parentClassDecl === void 0) { @@ -3081,7 +3081,7 @@ var CSharpTranspiler = class extends BaseTranspiler { break; } method = _nullishCoalesce(this.csharpMethodsByName(parentClassDecl).get(node.name.text), () => ( method)); - parentClass = _nullishCoalesce(_chunk4FDYB2TTcjs.getAllSuperTypeNodes.call(void 0, parentClassDecl)[0], () => ( void 0)); + parentClass = _nullishCoalesce(_chunkUBXMRIM6cjs.getAllSuperTypeNodes.call(void 0, parentClassDecl)[0], () => ( void 0)); } this.csharpMethodOverrides.set(node, _nullishCoalesce(method, () => ( null))); return method; @@ -3247,6 +3247,10 @@ var CSharpTranspiler = class extends BaseTranspiler { if (listRead !== void 0) { return listRead; } + const keyRead = this.ELEMENT_ACCESS_WRAPPER_OPEN && !this.printElementAccessExpressionExceptionIfAny(node) ? this.csharpHx4IdentifierKeyRead(node.expression, node.argumentExpression) : void 0; + if (keyRead !== void 0) { + return keyRead; + } return super.printElementAccessExpression(node, identation); } csharpNativeElementAccess(node) { @@ -3383,8 +3387,7 @@ var CSharpTranspiler = class extends BaseTranspiler { if (csharpType === void 0) { return void 0; } - const func = this.csharpEnclosingFunction(node); - if (func === void 0 || this.csharpReceiverIsRewritten(func, expression)) { + if (!this.csharpHx4DeclaredReceiverReadable(node, expression)) { return void 0; } const receiver = this.printNode(expression, 0); @@ -3496,7 +3499,7 @@ var CSharpTranspiler = class extends BaseTranspiler { let node = counter; while (node.parent !== void 0) { const parent = node.parent; - if (_chunk4FDYB2TTcjs.isFunctionLike.call(void 0, parent)) { + if (_chunkUBXMRIM6cjs.isFunctionLike.call(void 0, parent)) { return void 0; } if (_is.isForStatement.call(void 0, parent) && this.csharpContains(parent.statement, counter) && this.csharpForBoundsCounter(parent, counter, receiver)) { @@ -3664,7 +3667,7 @@ var CSharpTranspiler = class extends BaseTranspiler { } const index = /* @__PURE__ */ new Map(); const collect = (n) => { - if (n !== func && _chunk4FDYB2TTcjs.isFunctionLike.call(void 0, n)) { + if (n !== func && _chunkUBXMRIM6cjs.isFunctionLike.call(void 0, n)) { return; } if (_is.isBinaryExpression.call(void 0, n) && n.operatorToken.kind === _ast.SyntaxKind.InKeyword) { @@ -4033,7 +4036,7 @@ var CSharpTranspiler = class extends BaseTranspiler { let node = read; while (_optionalChain([node, 'optionalAccess', _222 => _222.parent]) !== void 0) { const parent = node.parent; - if (_chunk4FDYB2TTcjs.isFunctionLike.call(void 0, parent)) { + if (_chunkUBXMRIM6cjs.isFunctionLike.call(void 0, parent)) { return false; } if (_is.isForStatement.call(void 0, parent) && this.csharpForBoundsIndex(parent, read, receiverSymbol, indexSymbol)) { @@ -5453,8 +5456,8 @@ var CSharpTranspiler = class extends BaseTranspiler { if (!_is.isMethodDeclaration.call(void 0, declaration) || this.csharpBooleanReturnType(declaration) !== "bool") { return false; } - const owner = _chunk4FDYB2TTcjs.findAncestor.call(void 0, declaration, _is.isClassLikeDeclaration); - if (owner === void 0 || owner !== _chunk4FDYB2TTcjs.findAncestor.call(void 0, node, _is.isClassLikeDeclaration)) { + const owner = _chunkUBXMRIM6cjs.findAncestor.call(void 0, declaration, _is.isClassLikeDeclaration); + if (owner === void 0 || owner !== _chunkUBXMRIM6cjs.findAncestor.call(void 0, node, _is.isClassLikeDeclaration)) { return false; } return _optionalChain([checker, 'access', _371 => _371.getSymbolAtLocation, 'call', _372 => _372(declaration.name), 'optionalAccess', _373 => _373.declarations, 'optionalAccess', _374 => _374.length]) === 1; @@ -5511,7 +5514,7 @@ var CSharpTranspiler = class extends BaseTranspiler { if (op === _ast.SyntaxKind.PlusPlusToken || op === _ast.SyntaxKind.MinusMinusToken) { return true; } - if (safeAccessor && op !== _ast.SyntaxKind.ExclamationToken && csharpType !== "int" && csharpType !== "Int64" && csharpType !== "double") { + if (safeAccessor && op !== _ast.SyntaxKind.ExclamationToken && csharpType !== "int" && csharpType !== "Int64" && csharpType !== "double" && !this.csharpHx4GuardedNullableNegation(parent, csharpType)) { return true; } } @@ -5892,7 +5895,7 @@ var CSharpTranspiler = class extends BaseTranspiler { if (node === void 0 || node.kind !== _ast.SyntaxKind.Parameter) { return super.printParameterType(node); } - const method = _chunk4FDYB2TTcjs.findAncestor.call(void 0, node, (n) => _is.isMethodDeclaration.call(void 0, n)); + const method = _chunkUBXMRIM6cjs.findAncestor.call(void 0, node, (n) => _is.isMethodDeclaration.call(void 0, n)); const name = method === void 0 || method.name === void 0 ? void 0 : method.name.getText().trim(); const row = name === void 0 ? void 0 : CSHARP_OVERRIDE_PARAM_TYPES[name]; const wanted = row === void 0 ? void 0 : row[method.parameters.indexOf(node)]; @@ -6046,7 +6049,7 @@ var CSharpTranspiler = class extends BaseTranspiler { // null-forgiving `!` on the box (CS8605 under TreatWarningsAsErrors otherwise) — which is // exactly the runtime NullReferenceException a `: boolean` method returning null deserves printReturnStatement(node, identation) { - const booleanType = this.csharpBooleanReturnType(_chunk4FDYB2TTcjs.findAncestor.call(void 0, node.parent, _chunk4FDYB2TTcjs.isFunctionLike)); + const booleanType = this.csharpBooleanReturnType(_chunkUBXMRIM6cjs.findAncestor.call(void 0, node.parent, _chunkUBXMRIM6cjs.isFunctionLike)); if (booleanType === void 0 || !node.expression) { return super.printReturnStatement(node, identation); } @@ -6648,7 +6651,7 @@ var CSharpTranspiler = class extends BaseTranspiler { if (operator === _ast.SyntaxKind.PlusToken) { return `prefixUnaryPlus(ref ${leftSide})`; } - const nativeNegation = this.csharpNativeNegatedLocal(operand, leftSide); + const nativeNegation = _nullishCoalesce(this.csharpNativeNegatedLocal(operand, leftSide), () => ( this.csharpHx4NativeNegatedNullableLocal(node, leftSide))); if (nativeNegation !== void 0) { return nativeNegation; } @@ -7075,6 +7078,111 @@ var CSharpTranspiler = class extends BaseTranspiler { // } // return res; // } + // hx4 C01: a declared C# collection keeps its static type across every write, and the + // null/ContainsKey/Count test reads the live value, so only an enclosing function is needed + csharpHx4DeclaredReceiverReadable(node, expression) { + return this.csharpEnclosingFunction(node) !== void 0 && _is.isIdentifier.call(void 0, expression); + } + // hx4 C11: `x[i]` / `m[k]` with an identifier key on a declared collection or a base dict field. + // The emission carries GetValue's own null/missing-key/past-the-end tests; a negative index + // throws in both. Key must be declared `int` (list) or `string`/`string?` (dictionary). + csharpHx4IdentifierKeyRead(expression, argumentExpression) { + if (!_is.isIdentifier.call(void 0, argumentExpression) || !this.csharpHx4IsPlainRead(argumentExpression.parent)) { + return void 0; + } + const fieldTypes = { "has": "Dictionary", "features": "Dictionary", "timeframes": "Dictionary", "options": "ConcurrentDictionary", "markets": "IDictionary", "urls": "object", "currencies": "object" }; + let receiver; + let csharpType; + if (_is.isPropertyAccessExpression.call(void 0, expression) && expression.expression.kind === _ast.SyntaxKind.ThisKeyword && _is.isIdentifier.call(void 0, expression.name) && Object.prototype.hasOwnProperty.call(fieldTypes, expression.name.text)) { + const field = this.printNode(expression, 0); + csharpType = fieldTypes[expression.name.text]; + receiver = csharpType === "object" ? `((IDictionary)${field})` : field; + const key = this.csharpHx4DeclaredKeyType(argumentExpression); + if (key !== "string" && key !== "string?") { + return void 0; + } + const printedKey2 = this.printNode(argumentExpression, 0); + return `(${field} != null && ${printedKey2} != null && ${receiver}.ContainsKey(${printedKey2}) ? ${receiver}[${printedKey2}] : null)`; + } + if (!_is.isIdentifier.call(void 0, expression) || CSHARP_MARKET_RECEIVER_NAMES.indexOf(expression.text) >= 0) { + return void 0; + } + csharpType = this.csharpDeclaredCollectionType(expression); + if (csharpType === void 0) { + const printed = typeof this.csharpPrintedLocalType === "function" ? this.csharpPrintedLocalType(expression) : void 0; + csharpType = CSHARP_NATIVE_COLLECTION_TYPES.indexOf(printed) >= 0 ? printed : void 0; + } + if (csharpType === void 0 || this.csharpEnclosingFunction(expression) === void 0) { + return void 0; + } + receiver = this.printNode(expression, 0); + const printedKey = this.printNode(argumentExpression, 0); + const keyType = this.csharpHx4DeclaredKeyType(argumentExpression); + if (csharpType.indexOf("Dictionary<") >= 0) { + if (keyType !== "string" && keyType !== "string?") { + return void 0; + } + return `(${receiver} != null && ${printedKey} != null && ${receiver}.ContainsKey(${printedKey}) ? ${receiver}[${printedKey}] : null)`; + } + if (keyType !== "int") { + return void 0; + } + return `(${receiver} != null && ${printedKey} < ${receiver}.Count ? ${receiver}[${printedKey}] : null)`; + } + // a read that is no write target: not the left of any assignment, not ++/--, not delete + csharpHx4IsPlainRead(node) { + const parent = _optionalChain([node, 'optionalAccess', _535 => _535.parent]); + if (_optionalChain([parent, 'optionalAccess', _536 => _536.kind]) === _ast.SyntaxKind.BinaryExpression && parent.left === node && this.csharpIsAssignmentOperator(parent.operatorToken.kind)) { + return false; + } + return !_is.isDeleteExpression.call(void 0, parent) && !_is.isPrefixUnaryExpression.call(void 0, parent) && !_is.isPostfixUnaryExpression.call(void 0, parent); + } + // the C# type the key identifier's emitted declaration carries: the printer's own table, then + // the build layer's declared-local hook (which retypes for-counters and string locals) + csharpHx4DeclaredKeyType(key) { + const typed = this.csharpTypedLocalType(key); + if (typed !== void 0) { + return typed; + } + const printed = typeof this.csharpPrintedLocalType === "function" ? this.csharpPrintedLocalType(key) : void 0; + if (printed !== void 0) { + return printed; + } + return typeof this.csharpLocalTypeOf === "function" ? this.csharpLocalTypeOf(key) : void 0; + } + // hx4 L44: `-x` on a local declared `double?` (a safeNumber read) inside a + // non-null guard on x (`if (x !== undefined)`, `x !== undefined && ...`, early exit). The guard + // proves the box is a number, so the local keeps its nullable scalar type and the negation is the + // helper's own in-place body `(x = -x)` (lifted: x is non-null here). Unguarded reads keep `object`. + csharpHx4GuardedNullableNegation(node, csharpType) { + if (csharpType !== "double?") { + return false; + } + if (!_is.isPrefixUnaryExpression.call(void 0, node) || node.operator !== _ast.SyntaxKind.MinusToken || !_is.isIdentifier.call(void 0, node.operand)) { + return false; + } + return this.csharpNullGuardAdmitsRead(node, node.operand); + } + // the C# type the local's printed declaration finally carries; an embedding build layer that + // retypes `object x = ...` after printing overrides this with its own (final) answer + csharpHx4DeclaredLocalType(declaration) { + return this.getCSharpLocalType(declaration); + } + csharpHx4NativeNegatedNullableLocal(node, leftSide) { + const operand = node.operand; + if (!_is.isIdentifier.call(void 0, operand)) { + return void 0; + } + const declaration = _optionalChain([this, 'access', _537 => _537.getChecker, 'call', _538 => _538(), 'access', _539 => _539.getSymbolAtLocation, 'call', _540 => _540(operand), 'optionalAccess', _541 => _541.valueDeclaration, 'optionalAccess', _542 => _542.resolve, 'call', _543 => _543()]); + if (!declaration || !_is.isVariableDeclaration.call(void 0, declaration) || _optionalChain([declaration, 'access', _544 => _544.parent, 'optionalAccess', _545 => _545.declarations, 'optionalAccess', _546 => _546.length]) !== 1) { + return void 0; + } + const declared = this.csharpHx4DeclaredLocalType(declaration); + if (!this.csharpHx4GuardedNullableNegation(node, declared)) { + return void 0; + } + return `(${leftSide} = -${leftSide})`; + } }; // src/transpiler.ts @@ -7082,7 +7190,7 @@ var _path = require('path'); var path2 = _interopRequireWildcard(_path); var pat var _fs = require('fs'); var fs2 = _interopRequireWildcard(_fs); var fs = _interopRequireWildcard(_fs); // src/goTranspiler.ts -_chunk4FDYB2TTcjs.init_cjs_shims.call(void 0, ); +_chunkUBXMRIM6cjs.init_cjs_shims.call(void 0, ); @@ -7812,6 +7920,13 @@ var GoTranspiler = class extends BaseTranspiler { // operand of a binary expression, -1 inside parentheses (never below 1), and // back to 1 for composite literal elements. this.goExprDepth = 1; + // hx4 G09 + // hand-written BaseExchange value fields (go/v4/exchange.go) read as `this.` + this.GO_G09_NUMERIC_FIELDS = { + "rateLimit": "float64", + "fetchHistoryCacheSize": "int", + "minFundingAddressLength": "int" + }; this.requiresParameterType = true; this.requiresReturnType = true; this.asyncTranspiling = false; @@ -7965,7 +8080,7 @@ var GoTranspiler = class extends BaseTranspiler { } printStruct(node, indentation) { const rows = []; - if (_optionalChain([node, 'optionalAccess', _535 => _535.heritageClauses, 'optionalAccess', _536 => _536.length]) > 0) { + if (_optionalChain([node, 'optionalAccess', _547 => _547.heritageClauses, 'optionalAccess', _548 => _548.length]) > 0) { const heritage = node.heritageClauses[0]; const heritageType = heritage.types[0]; let heritageEscapedText = heritageType.expression.text; @@ -8111,13 +8226,13 @@ func New${this.capitalize(this.className)}() *${this.className} { } }; try { - const parent = _optionalChain([node, 'optionalAccess', _537 => _537.parent]); + const parent = _optionalChain([node, 'optionalAccess', _549 => _549.parent]); if (parent && _is.isClassDeclaration.call(void 0, parent)) { - parent.members.forEach((member) => remember(_optionalChain([member, 'optionalAccess', _538 => _538.name, 'optionalAccess', _539 => _539.text]))); + parent.members.forEach((member) => remember(_optionalChain([member, 'optionalAccess', _550 => _550.name, 'optionalAccess', _551 => _551.text]))); } else if (parent && _is.isSourceFile.call(void 0, parent)) { parent.statements.forEach((statement) => { if (_is.isFunctionDeclaration.call(void 0, statement)) { - remember(_optionalChain([statement, 'optionalAccess', _540 => _540.name, 'optionalAccess', _541 => _541.text])); + remember(_optionalChain([statement, 'optionalAccess', _552 => _552.name, 'optionalAccess', _553 => _553.text])); } }); } @@ -8150,7 +8265,7 @@ func New${this.capitalize(this.className)}() *${this.className} { printAsyncTrampolineArgs(node) { const args = []; let hasOptionalParameter = false; - (_nullishCoalesce(_optionalChain([node, 'optionalAccess', _542 => _542.parameters]), () => ( []))).forEach((param) => { + (_nullishCoalesce(_optionalChain([node, 'optionalAccess', _554 => _554.parameters]), () => ( []))).forEach((param) => { if (param.initializer) { hasOptionalParameter = true; return; @@ -8221,7 +8336,7 @@ func New${this.capitalize(this.className)}() *${this.className} { if (symbol && symbol.flags & _sync.SymbolFlags.Alias) { symbol = this.getChecker().getAliasedSymbol(symbol); } - decls = _optionalChain([symbol, 'optionalAccess', _543 => _543.declarations, 'optionalAccess', _544 => _544.map, 'call', _545 => _545((d) => d.resolve())]); + decls = _optionalChain([symbol, 'optionalAccess', _555 => _555.declarations, 'optionalAccess', _556 => _556.map, 'call', _557 => _557((d) => d.resolve())]); } catch (e4) { return goName; } @@ -8235,7 +8350,7 @@ func New${this.capitalize(this.className)}() *${this.className} { if (this.asyncSuffixExemptPaths.length === 0) { return false; } - const fileName = String(_nullishCoalesce(_optionalChain([decl, 'access', _546 => _546.getSourceFile, 'call', _547 => _547(), 'optionalAccess', _548 => _548.fileName]), () => ( ""))).replace(/\\/g, "/"); + const fileName = String(_nullishCoalesce(_optionalChain([decl, 'access', _558 => _558.getSourceFile, 'call', _559 => _559(), 'optionalAccess', _560 => _560.fileName]), () => ( ""))).replace(/\\/g, "/"); return this.asyncSuffixExemptPaths.some((re) => re.test(fileName)); } printMethodDefinition(node, identation) { @@ -8343,7 +8458,7 @@ func New${this.capitalize(this.className)}() *${this.className} { if (this.goIsNativeSliceCall(initializer)) { return "string"; } - switch (_optionalChain([initializer, 'optionalAccess', _549 => _549.kind])) { + switch (_optionalChain([initializer, 'optionalAccess', _561 => _561.kind])) { case _ast.SyntaxKind.StringLiteral: case _ast.SyntaxKind.NoSubstitutionTemplateLiteral: return "string"; @@ -8366,14 +8481,14 @@ func New${this.capitalize(this.className)}() *${this.className} { if (op === _ast.SyntaxKind.EqualsEqualsToken || op === _ast.SyntaxKind.EqualsEqualsEqualsToken || op === _ast.SyntaxKind.ExclamationEqualsToken || op === _ast.SyntaxKind.ExclamationEqualsEqualsToken || ORDERED_COMPARISON_OPERATORS[op] !== void 0) { return "bool"; } - if (op === _ast.SyntaxKind.PlusToken && _optionalChain([this, 'access', _550 => _550.goNativeArithmetic, 'call', _551 => _551(initializer), 'optionalAccess', _552 => _552.goType]) === "string") { + if (op === _ast.SyntaxKind.PlusToken && _optionalChain([this, 'access', _562 => _562.goNativeArithmetic, 'call', _563 => _563(initializer), 'optionalAccess', _564 => _564.goType]) === "string") { return "string"; } break; } case _ast.SyntaxKind.CallExpression: { const property = initializer.expression; - if (_optionalChain([property, 'optionalAccess', _553 => _553.kind]) === _ast.SyntaxKind.PropertyAccessExpression && _optionalChain([property, 'access', _554 => _554.name, 'optionalAccess', _555 => _555.text]) === "toString" && _optionalChain([initializer, 'access', _556 => _556.arguments, 'optionalAccess', _557 => _557.length]) === 0 && (this.goOperandStaticType(property.expression, printedValue) === "string" || this.goDerefableStringOperand(property.expression))) { + if (_optionalChain([property, 'optionalAccess', _565 => _565.kind]) === _ast.SyntaxKind.PropertyAccessExpression && _optionalChain([property, 'access', _566 => _566.name, 'optionalAccess', _567 => _567.text]) === "toString" && _optionalChain([initializer, 'access', _568 => _568.arguments, 'optionalAccess', _569 => _569.length]) === 0 && (this.goOperandStaticType(property.expression, printedValue) === "string" || this.goDerefableStringOperand(property.expression))) { return "string"; } break; @@ -8408,11 +8523,11 @@ func New${this.capitalize(this.className)}() *${this.className} { } // the concrete Go type of a `var x T = ` local, undefined for `any` goLocalStaticType(node) { - const declaration = _optionalChain([this, 'access', _558 => _558.getChecker, 'call', _559 => _559(), 'access', _560 => _560.getSymbolAtLocation, 'call', _561 => _561(node), 'optionalAccess', _562 => _562.valueDeclaration, 'optionalAccess', _563 => _563.resolve, 'call', _564 => _564()]); - if (_optionalChain([declaration, 'optionalAccess', _565 => _565.kind]) !== _ast.SyntaxKind.VariableDeclaration || declaration.initializer === void 0) { + const declaration = _optionalChain([this, 'access', _570 => _570.getChecker, 'call', _571 => _571(), 'access', _572 => _572.getSymbolAtLocation, 'call', _573 => _573(node), 'optionalAccess', _574 => _574.valueDeclaration, 'optionalAccess', _575 => _575.resolve, 'call', _576 => _576()]); + if (_optionalChain([declaration, 'optionalAccess', _577 => _577.kind]) !== _ast.SyntaxKind.VariableDeclaration || declaration.initializer === void 0) { return void 0; } - if (_optionalChain([declaration, 'access', _566 => _566.parent, 'optionalAccess', _567 => _567.parent, 'optionalAccess', _568 => _568.kind]) !== _ast.SyntaxKind.FirstStatement) { + if (_optionalChain([declaration, 'access', _578 => _578.parent, 'optionalAccess', _579 => _579.parent, 'optionalAccess', _580 => _580.kind]) !== _ast.SyntaxKind.FirstStatement) { return void 0; } if (this.goLocalTypeResolution.has(declaration)) { @@ -8441,12 +8556,12 @@ func New${this.capitalize(this.className)}() *${this.className} { if (checker === void 0) { return void 0; } - const declaration = _optionalChain([checker, 'access', _569 => _569.getSymbolAtLocation, 'call', _570 => _570(node), 'optionalAccess', _571 => _571.valueDeclaration, 'optionalAccess', _572 => _572.resolve, 'call', _573 => _573()]); - if (_optionalChain([declaration, 'optionalAccess', _574 => _574.kind]) !== _ast.SyntaxKind.VariableDeclaration || declaration.initializer === void 0) { + const declaration = _optionalChain([checker, 'access', _581 => _581.getSymbolAtLocation, 'call', _582 => _582(node), 'optionalAccess', _583 => _583.valueDeclaration, 'optionalAccess', _584 => _584.resolve, 'call', _585 => _585()]); + if (_optionalChain([declaration, 'optionalAccess', _586 => _586.kind]) !== _ast.SyntaxKind.VariableDeclaration || declaration.initializer === void 0) { return void 0; } const declarationList = declaration.parent; - if (_optionalChain([declarationList, 'optionalAccess', _575 => _575.kind]) !== _ast.SyntaxKind.VariableDeclarationList || _optionalChain([declarationList, 'access', _576 => _576.parent, 'optionalAccess', _577 => _577.kind]) === _ast.SyntaxKind.FirstStatement) { + if (_optionalChain([declarationList, 'optionalAccess', _587 => _587.kind]) !== _ast.SyntaxKind.VariableDeclarationList || _optionalChain([declarationList, 'access', _588 => _588.parent, 'optionalAccess', _589 => _589.kind]) === _ast.SyntaxKind.FirstStatement) { return void 0; } const kind = this.goNumericLiteralKind(declaration.initializer); @@ -8471,8 +8586,8 @@ func New${this.capitalize(this.className)}() *${this.className} { if (checker === void 0) { return void 0; } - const declaration = _optionalChain([checker, 'access', _578 => _578.getSymbolAtLocation, 'call', _579 => _579(node), 'optionalAccess', _580 => _580.valueDeclaration, 'optionalAccess', _581 => _581.resolve, 'call', _582 => _582()]); - if (_optionalChain([declaration, 'optionalAccess', _583 => _583.kind]) !== _ast.SyntaxKind.Parameter) { + const declaration = _optionalChain([checker, 'access', _590 => _590.getSymbolAtLocation, 'call', _591 => _591(node), 'optionalAccess', _592 => _592.valueDeclaration, 'optionalAccess', _593 => _593.resolve, 'call', _594 => _594()]); + if (_optionalChain([declaration, 'optionalAccess', _595 => _595.kind]) !== _ast.SyntaxKind.Parameter) { return void 0; } const bound = this.goGetArgParameterType(declaration); @@ -8494,7 +8609,7 @@ func New${this.capitalize(this.className)}() *${this.className} { // where the checker narrowed it to a non-nilable string (a guard that always // exits, an `if (x !== undefined)` block). TypeScript `undefined` == Go nil here. goNilProvenStringDeref(node) { - if (_optionalChain([node, 'optionalAccess', _584 => _584.kind]) !== _ast.SyntaxKind.Identifier) { + if (_optionalChain([node, 'optionalAccess', _596 => _596.kind]) !== _ast.SyntaxKind.Identifier) { return false; } if (this.goDeclaredTypeOfIdentifier(node) !== "*string") { @@ -8511,16 +8626,16 @@ func New${this.capitalize(this.className)}() *${this.className} { // default: that Go method can only return a fresh non-nil pointer, so the local may // be deref'd even where the checker offers no narrowing. One write of any other goDefaultedSafeStringLocal(node) { - if (_optionalChain([node, 'optionalAccess', _585 => _585.kind]) !== _ast.SyntaxKind.Identifier) { + if (_optionalChain([node, 'optionalAccess', _597 => _597.kind]) !== _ast.SyntaxKind.Identifier) { return false; } let declaration; try { - declaration = _optionalChain([this, 'access', _586 => _586.getChecker, 'call', _587 => _587(), 'access', _588 => _588.getSymbolAtLocation, 'call', _589 => _589(node), 'optionalAccess', _590 => _590.valueDeclaration, 'optionalAccess', _591 => _591.resolve, 'call', _592 => _592()]); + declaration = _optionalChain([this, 'access', _598 => _598.getChecker, 'call', _599 => _599(), 'access', _600 => _600.getSymbolAtLocation, 'call', _601 => _601(node), 'optionalAccess', _602 => _602.valueDeclaration, 'optionalAccess', _603 => _603.resolve, 'call', _604 => _604()]); } catch (e) { return false; } - if (_optionalChain([declaration, 'optionalAccess', _593 => _593.kind]) !== _ast.SyntaxKind.VariableDeclaration || _optionalChain([declaration, 'access', _594 => _594.name, 'optionalAccess', _595 => _595.kind]) !== _ast.SyntaxKind.Identifier) { + if (_optionalChain([declaration, 'optionalAccess', _605 => _605.kind]) !== _ast.SyntaxKind.VariableDeclaration || _optionalChain([declaration, 'access', _606 => _606.name, 'optionalAccess', _607 => _607.kind]) !== _ast.SyntaxKind.Identifier) { return false; } if (this.goDeclaredTypeOfIdentifier(node) !== "*string") { @@ -8541,11 +8656,11 @@ func New${this.capitalize(this.className)}() *${this.className} { } if (n.kind === _ast.SyntaxKind.Identifier && n.text === name && n !== declaration.name) { const parent = n.parent; - if (_optionalChain([parent, 'optionalAccess', _596 => _596.kind]) === _ast.SyntaxKind.BinaryExpression && parent.left === n && GO_WRITE_OPERATOR_KINDS.indexOf(_optionalChain([parent, 'access', _597 => _597.operatorToken, 'optionalAccess', _598 => _598.kind])) >= 0) { + if (_optionalChain([parent, 'optionalAccess', _608 => _608.kind]) === _ast.SyntaxKind.BinaryExpression && parent.left === n && GO_WRITE_OPERATOR_KINDS.indexOf(_optionalChain([parent, 'access', _609 => _609.operatorToken, 'optionalAccess', _610 => _610.kind])) >= 0) { everyWriteDefaulted = parent.operatorToken.kind === _ast.SyntaxKind.EqualsToken && this.goDefaultedSafeStringCall(parent.right); return; } - if (_optionalChain([parent, 'optionalAccess', _599 => _599.kind]) === _ast.SyntaxKind.PrefixUnaryExpression || _optionalChain([parent, 'optionalAccess', _600 => _600.kind]) === _ast.SyntaxKind.PostfixUnaryExpression) { + if (_optionalChain([parent, 'optionalAccess', _611 => _611.kind]) === _ast.SyntaxKind.PrefixUnaryExpression || _optionalChain([parent, 'optionalAccess', _612 => _612.kind]) === _ast.SyntaxKind.PostfixUnaryExpression) { everyWriteDefaulted = false; return; } @@ -8559,19 +8674,19 @@ func New${this.capitalize(this.className)}() *${this.className} { // arguments for the default and whose default is a literal (never the absent case) goDefaultedSafeStringCall(node) { const call = node; - if (_optionalChain([call, 'optionalAccess', _601 => _601.kind]) !== _ast.SyntaxKind.CallExpression) { + if (_optionalChain([call, 'optionalAccess', _613 => _613.kind]) !== _ast.SyntaxKind.CallExpression) { return false; } const callee = call.expression; - if (_optionalChain([callee, 'optionalAccess', _602 => _602.kind]) !== _ast.SyntaxKind.PropertyAccessExpression || _optionalChain([callee, 'access', _603 => _603.expression, 'optionalAccess', _604 => _604.kind]) !== _ast.SyntaxKind.ThisKeyword) { + if (_optionalChain([callee, 'optionalAccess', _614 => _614.kind]) !== _ast.SyntaxKind.PropertyAccessExpression || _optionalChain([callee, 'access', _615 => _615.expression, 'optionalAccess', _616 => _616.kind]) !== _ast.SyntaxKind.ThisKeyword) { return false; } - const arity = GO_DEFAULTED_SAFE_STRING_ARITY[_optionalChain([callee, 'access', _605 => _605.name, 'optionalAccess', _606 => _606.text])]; - if (arity === void 0 || (_nullishCoalesce(_optionalChain([call, 'access', _607 => _607.arguments, 'optionalAccess', _608 => _608.length]), () => ( 0))) < arity) { + const arity = GO_DEFAULTED_SAFE_STRING_ARITY[_optionalChain([callee, 'access', _617 => _617.name, 'optionalAccess', _618 => _618.text])]; + if (arity === void 0 || (_nullishCoalesce(_optionalChain([call, 'access', _619 => _619.arguments, 'optionalAccess', _620 => _620.length]), () => ( 0))) < arity) { return false; } const last = call.arguments[call.arguments.length - 1]; - return GO_NON_NIL_DEFAULT_KINDS.indexOf(_optionalChain([last, 'optionalAccess', _609 => _609.kind])) >= 0; + return GO_NON_NIL_DEFAULT_KINDS.indexOf(_optionalChain([last, 'optionalAccess', _621 => _621.kind])) >= 0; } // a `*string` leaf the concat may deref: the checker narrowed it to a non-nilable // string at that use, a local whose every write is a defaulted SafeString-family @@ -8580,7 +8695,7 @@ func New${this.capitalize(this.className)}() *${this.className} { if (this.goNilProvenStringDeref(node)) { return true; } - if (_optionalChain([node, 'optionalAccess', _610 => _610.kind]) === _ast.SyntaxKind.Identifier) { + if (_optionalChain([node, 'optionalAccess', _622 => _622.kind]) === _ast.SyntaxKind.Identifier) { return this.goDefaultedSafeStringLocal(node); } return this.goDefaultedSafeStringCall(node); @@ -8589,7 +8704,7 @@ func New${this.capitalize(this.className)}() *${this.className} { // text for a proven string, or the deref goNativeBinaryText adds for a derefable // `*string` leaf. undefined keeps the helper call. goStringConcatOperandType(node, printedText) { - if (this.goDerefableStringOperand(node)) { + if (this.goConcatDerefableStringOperand(node)) { return "string"; } return this.goOperandStaticType(node, printedText) === "string" ? "string" : void 0; @@ -8607,7 +8722,7 @@ func New${this.capitalize(this.className)}() *${this.className} { // 'float64', or 'const-int' / 'const-float' (an untyped literal). undefined when // the printer cannot name it — a nilable/`any` operand keeps the helper call. goOperandStaticType(node, printedText) { - switch (_optionalChain([node, 'optionalAccess', _611 => _611.kind])) { + switch (_optionalChain([node, 'optionalAccess', _623 => _623.kind])) { case _ast.SyntaxKind.StringLiteral: case _ast.SyntaxKind.NoSubstitutionTemplateLiteral: return "string"; @@ -8636,20 +8751,20 @@ func New${this.capitalize(this.className)}() *${this.className} { // an untyped Go floating-point constant: the helper boxes it as float64 and the // compiler converts the operand to float64 the same way goConstFloatStaticType(node) { - const text = _optionalChain([node, 'optionalAccess', _612 => _612.text]); + const text = _optionalChain([node, 'optionalAccess', _624 => _624.text]); if (typeof text !== "string" || !/^[0-9][.eE]/.test(text)) { return void 0; } return Number.isFinite(Number(text.replaceAll("_", ""))) ? "const-float" : void 0; } isNonZeroIntegerLiteral(node) { - if (_optionalChain([node, 'optionalAccess', _613 => _613.kind]) === _ast.SyntaxKind.ParenthesizedExpression) { + if (_optionalChain([node, 'optionalAccess', _625 => _625.kind]) === _ast.SyntaxKind.ParenthesizedExpression) { return this.isNonZeroIntegerLiteral(node.expression); } - return _optionalChain([node, 'optionalAccess', _614 => _614.kind]) === _ast.SyntaxKind.NumericLiteral && /^[1-9][0-9]*$/.test(node.text); + return _optionalChain([node, 'optionalAccess', _626 => _626.kind]) === _ast.SyntaxKind.NumericLiteral && /^[1-9][0-9]*$/.test(node.text); } isNonZeroFloatLiteral(node) { - if (_optionalChain([node, 'optionalAccess', _615 => _615.kind]) === _ast.SyntaxKind.ParenthesizedExpression) { + if (_optionalChain([node, 'optionalAccess', _627 => _627.kind]) === _ast.SyntaxKind.ParenthesizedExpression) { return this.isNonZeroFloatLiteral(node.expression); } return this.goConstFloatStaticType(node) !== void 0 && Number(node.text.replaceAll("_", "")) !== 0; @@ -8658,13 +8773,13 @@ func New${this.capitalize(this.className)}() *${this.className} { // over literals in arbitrary precision, so it must fit `int` and stay exact for the helper's // float64 path — the bound the caller checks. goConstantIntValue(node) { - if (_optionalChain([node, 'optionalAccess', _616 => _616.kind]) === _ast.SyntaxKind.ParenthesizedExpression) { + if (_optionalChain([node, 'optionalAccess', _628 => _628.kind]) === _ast.SyntaxKind.ParenthesizedExpression) { return this.goConstantIntValue(node.expression); } - if (_optionalChain([node, 'optionalAccess', _617 => _617.kind]) === _ast.SyntaxKind.NumericLiteral) { + if (_optionalChain([node, 'optionalAccess', _629 => _629.kind]) === _ast.SyntaxKind.NumericLiteral) { return /^[0-9]+$/.test(node.text) ? Number(node.text) : void 0; } - if (_optionalChain([node, 'optionalAccess', _618 => _618.kind]) !== _ast.SyntaxKind.BinaryExpression) { + if (_optionalChain([node, 'optionalAccess', _630 => _630.kind]) !== _ast.SyntaxKind.BinaryExpression) { return void 0; } const left = this.goConstantIntValue(node.left); @@ -8693,21 +8808,21 @@ func New${this.capitalize(this.className)}() *${this.className} { let current = node; while (current !== void 0) { const parent = current.parent; - if (_optionalChain([parent, 'optionalAccess', _619 => _619.kind]) === _ast.SyntaxKind.ParenthesizedExpression && parent.expression === current) { + if (_optionalChain([parent, 'optionalAccess', _631 => _631.kind]) === _ast.SyntaxKind.ParenthesizedExpression && parent.expression === current) { current = parent; continue; } - if (_optionalChain([parent, 'optionalAccess', _620 => _620.kind]) === _ast.SyntaxKind.BinaryExpression && (parent.left === current || parent.right === current) && GO_ARITHMETIC_KINDS.indexOf(parent.operatorToken.kind) >= 0) { + if (_optionalChain([parent, 'optionalAccess', _632 => _632.kind]) === _ast.SyntaxKind.BinaryExpression && (parent.left === current || parent.right === current) && GO_ARITHMETIC_KINDS.indexOf(parent.operatorToken.kind) >= 0) { current = parent; continue; } break; } - const declaration = _optionalChain([current, 'optionalAccess', _621 => _621.parent]); - if (_optionalChain([declaration, 'optionalAccess', _622 => _622.kind]) !== _ast.SyntaxKind.VariableDeclaration || declaration.initializer !== current) { + const declaration = _optionalChain([current, 'optionalAccess', _633 => _633.parent]); + if (_optionalChain([declaration, 'optionalAccess', _634 => _634.kind]) !== _ast.SyntaxKind.VariableDeclaration || declaration.initializer !== current) { return false; } - return _optionalChain([declaration, 'access', _623 => _623.parent, 'optionalAccess', _624 => _624.parent, 'optionalAccess', _625 => _625.kind]) === _ast.SyntaxKind.FirstStatement; + return _optionalChain([declaration, 'access', _635 => _635.parent, 'optionalAccess', _636 => _636.parent, 'optionalAccess', _637 => _637.kind]) === _ast.SyntaxKind.FirstStatement; } // The bare Go operator must yield what the runtime helper returns (go/v4/exchange_helpers.go): // Add keeps int/int64, while Subtract/Multiply/Divide/Mod take an exact int64 path or a float64 @@ -8768,13 +8883,13 @@ func New${this.capitalize(this.className)}() *${this.className} { } // a literal-only `*` chain is itself an untyped Go constant, so an enclosing product folds too goConstantProductKind(node) { - if (_optionalChain([node, 'optionalAccess', _626 => _626.kind]) === _ast.SyntaxKind.ParenthesizedExpression) { + if (_optionalChain([node, 'optionalAccess', _638 => _638.kind]) === _ast.SyntaxKind.ParenthesizedExpression) { return this.goConstantProductKind(node.expression); } - if (_optionalChain([node, 'optionalAccess', _627 => _627.kind]) === _ast.SyntaxKind.NumericLiteral) { + if (_optionalChain([node, 'optionalAccess', _639 => _639.kind]) === _ast.SyntaxKind.NumericLiteral) { return /^[0-9]+$/.test(node.text) ? "const-int" : this.goConstFloatStaticType(node); } - if (_optionalChain([node, 'optionalAccess', _628 => _628.kind]) !== _ast.SyntaxKind.BinaryExpression || node.operatorToken.kind !== _ast.SyntaxKind.AsteriskToken) { + if (_optionalChain([node, 'optionalAccess', _640 => _640.kind]) !== _ast.SyntaxKind.BinaryExpression || node.operatorToken.kind !== _ast.SyntaxKind.AsteriskToken) { return void 0; } const left = this.goConstantProductKind(node.left); @@ -8800,7 +8915,7 @@ func New${this.capitalize(this.className)}() *${this.className} { // tighter parent operator; a whole helper call is already delimited goNativeOperandText(node, printedText) { const text = printedText.trim(); - if (_optionalChain([node, 'optionalAccess', _629 => _629.kind]) !== _ast.SyntaxKind.BinaryExpression || text.startsWith("(")) { + if (_optionalChain([node, 'optionalAccess', _641 => _641.kind]) !== _ast.SyntaxKind.BinaryExpression || text.startsWith("(")) { return text; } const open = text.indexOf("("); @@ -8812,7 +8927,7 @@ func New${this.capitalize(this.className)}() *${this.className} { // goNativeArithmetic's Go type for an operand (memoized within the enclosing binary print) goNativeArithmeticType(node) { const key = `type|${this.goBinaryContextKey()}`; - return this.goBinaryMemoized(node, key, () => _optionalChain([this, 'access', _630 => _630.goNativeArithmetic, 'call', _631 => _631(node), 'optionalAccess', _632 => _632.goType])); + return this.goBinaryMemoized(node, key, () => _optionalChain([this, 'access', _642 => _642.goNativeArithmetic, 'call', _643 => _643(node), 'optionalAccess', _644 => _644.goType])); } // `Add(a, b)` & co. become the Go operator when both printed operands already // hold a concrete Go type the helper would return unchanged; undefined keeps the @@ -8853,6 +8968,10 @@ func New${this.capitalize(this.className)}() *${this.className} { } return { "goType": "string", "text": this.goNativeBinaryText(node, "+", leftText, rightText) }; } + const widened = this.goNativeIntWideningArithmetic(node, leftType, rightType, leftText, rightText); + if (widened !== void 0) { + return widened; + } const goType = this.goNativeNumericResultType(op, leftType, rightType, node); if (goType === void 0) { return void 0; @@ -8878,13 +8997,13 @@ func New${this.capitalize(this.className)}() *${this.className} { } goInt64Operand(node, printedText) { const text = this.goUnwrapPrintedParens(printedText.trim()); - if (_optionalChain([node, 'optionalAccess', _633 => _633.kind]) === _ast.SyntaxKind.ParenthesizedExpression) { + if (_optionalChain([node, 'optionalAccess', _645 => _645.kind]) === _ast.SyntaxKind.ParenthesizedExpression) { return this.goInt64Operand(node.expression, text); } - if (_optionalChain([node, 'optionalAccess', _634 => _634.kind]) === _ast.SyntaxKind.NumericLiteral) { + if (_optionalChain([node, 'optionalAccess', _646 => _646.kind]) === _ast.SyntaxKind.NumericLiteral) { return /^[0-9]+$/.test(node.text) && Number(node.text) <= Number.MAX_SAFE_INTEGER ? { "pointer": false, text } : void 0; } - if (_optionalChain([node, 'optionalAccess', _635 => _635.kind]) === _ast.SyntaxKind.Identifier) { + if (_optionalChain([node, 'optionalAccess', _647 => _647.kind]) === _ast.SyntaxKind.Identifier) { if (this.goDeclaredTypeOfIdentifier(node) === "*int64" && this.goPointerNumberIsNonNil(node)) { return { "pointer": true, "text": "*" + text }; } @@ -8893,7 +9012,7 @@ func New${this.capitalize(this.className)}() *${this.className} { if (this.goDefaultedSafeIntegerCall(node)) { return { "pointer": true, "text": "*" + text }; } - if (_optionalChain([node, 'optionalAccess', _636 => _636.kind]) === _ast.SyntaxKind.CallExpression && this.goOperandStaticType(node, text) === "int64") { + if (_optionalChain([node, 'optionalAccess', _648 => _648.kind]) === _ast.SyntaxKind.CallExpression && this.goOperandStaticType(node, text) === "int64") { return { "pointer": false, text }; } return void 0; @@ -8913,10 +9032,10 @@ func New${this.capitalize(this.className)}() *${this.className} { } goInt64ProductOperand(node, printedText) { let inner = node; - while (_optionalChain([inner, 'optionalAccess', _637 => _637.kind]) === _ast.SyntaxKind.ParenthesizedExpression) { + while (_optionalChain([inner, 'optionalAccess', _649 => _649.kind]) === _ast.SyntaxKind.ParenthesizedExpression) { inner = inner.expression; } - if (_optionalChain([inner, 'optionalAccess', _638 => _638.kind]) === _ast.SyntaxKind.BinaryExpression && this.goNativeArithmeticType(inner) === "int64") { + if (_optionalChain([inner, 'optionalAccess', _650 => _650.kind]) === _ast.SyntaxKind.BinaryExpression && this.goNativeArithmeticType(inner) === "int64") { const text = printedText.trim(); return { "pointer": false, "text": text.startsWith("(") ? text : "(" + text + ")" }; } @@ -8924,12 +9043,12 @@ func New${this.capitalize(this.className)}() *${this.className} { } // this.safeInteger{,2,N} with an integer literal default: the Go method returns &default on every nil path goDefaultedSafeIntegerCall(node) { - if (_optionalChain([node, 'optionalAccess', _639 => _639.kind]) !== _ast.SyntaxKind.CallExpression || _optionalChain([node, 'access', _640 => _640.expression, 'optionalAccess', _641 => _641.kind]) !== _ast.SyntaxKind.PropertyAccessExpression || _optionalChain([node, 'access', _642 => _642.expression, 'access', _643 => _643.expression, 'optionalAccess', _644 => _644.kind]) !== _ast.SyntaxKind.ThisKeyword) { + if (_optionalChain([node, 'optionalAccess', _651 => _651.kind]) !== _ast.SyntaxKind.CallExpression || _optionalChain([node, 'access', _652 => _652.expression, 'optionalAccess', _653 => _653.kind]) !== _ast.SyntaxKind.PropertyAccessExpression || _optionalChain([node, 'access', _654 => _654.expression, 'access', _655 => _655.expression, 'optionalAccess', _656 => _656.kind]) !== _ast.SyntaxKind.ThisKeyword) { return false; } - const arity = { "safeInteger": 3, "safeInteger2": 4, "safeIntegerN": 3 }[_optionalChain([node, 'access', _645 => _645.expression, 'access', _646 => _646.name, 'optionalAccess', _647 => _647.text])]; - const last = _optionalChain([node, 'access', _648 => _648.arguments, 'optionalAccess', _649 => _649[arity - 1]]); - return arity !== void 0 && node.arguments.length === arity && _optionalChain([last, 'optionalAccess', _650 => _650.kind]) === _ast.SyntaxKind.NumericLiteral && /^[0-9]+$/.test(last.text); + const arity = { "safeInteger": 3, "safeInteger2": 4, "safeIntegerN": 3 }[_optionalChain([node, 'access', _657 => _657.expression, 'access', _658 => _658.name, 'optionalAccess', _659 => _659.text])]; + const last = _optionalChain([node, 'access', _660 => _660.arguments, 'optionalAccess', _661 => _661[arity - 1]]); + return arity !== void 0 && node.arguments.length === arity && _optionalChain([last, 'optionalAccess', _662 => _662.kind]) === _ast.SyntaxKind.NumericLiteral && /^[0-9]+$/.test(last.text); } // `x / N` on a non-nil `*int64` with a nonzero integer literal N, passed whole to Math.floor/ceil/round // or parseToInt: those read Divide's int64-when-integral box and the float64 quotient alike @@ -8964,23 +9083,23 @@ func New${this.capitalize(this.className)}() *${this.className} { goDivisionConsumerIgnoresBox(node) { let child = node; let parent = node.parent; - while (_optionalChain([parent, 'optionalAccess', _651 => _651.kind]) === _ast.SyntaxKind.ParenthesizedExpression) { + while (_optionalChain([parent, 'optionalAccess', _663 => _663.kind]) === _ast.SyntaxKind.ParenthesizedExpression) { child = parent; parent = parent.parent; } - if (_optionalChain([parent, 'optionalAccess', _652 => _652.kind]) !== _ast.SyntaxKind.CallExpression || _optionalChain([parent, 'access', _653 => _653.arguments, 'optionalAccess', _654 => _654.length]) !== 1 || parent.arguments[0] !== child) { + if (_optionalChain([parent, 'optionalAccess', _664 => _664.kind]) !== _ast.SyntaxKind.CallExpression || _optionalChain([parent, 'access', _665 => _665.arguments, 'optionalAccess', _666 => _666.length]) !== 1 || parent.arguments[0] !== child) { return false; } const callee = parent.expression; - if (_optionalChain([callee, 'optionalAccess', _655 => _655.kind]) !== _ast.SyntaxKind.PropertyAccessExpression) { + if (_optionalChain([callee, 'optionalAccess', _667 => _667.kind]) !== _ast.SyntaxKind.PropertyAccessExpression) { return false; } const owner = callee.expression; - const name = _optionalChain([callee, 'access', _656 => _656.name, 'optionalAccess', _657 => _657.text]); - if (_optionalChain([owner, 'optionalAccess', _658 => _658.kind]) === _ast.SyntaxKind.ThisKeyword) { + const name = _optionalChain([callee, 'access', _668 => _668.name, 'optionalAccess', _669 => _669.text]); + if (_optionalChain([owner, 'optionalAccess', _670 => _670.kind]) === _ast.SyntaxKind.ThisKeyword) { return name === "parseToInt"; } - return _optionalChain([owner, 'optionalAccess', _659 => _659.kind]) === _ast.SyntaxKind.Identifier && owner.text === "Math" && ["floor", "ceil", "round"].includes(name); + return _optionalChain([owner, 'optionalAccess', _671 => _671.kind]) === _ast.SyntaxKind.Identifier && owner.text === "Math" && ["floor", "ceil", "round"].includes(name); } // int / int is a float64 division as in JS: typed operands convert, and with two constants // the left one does (an untyped constant operand then converts implicitly) @@ -8998,9 +9117,9 @@ func New${this.capitalize(this.className)}() *${this.className} { // parentheses the printer wraps it in, which undo the one level the operand adds) goNativeBinaryText(node, symbol, leftText, rightText) { const operandText = (operand, printed) => { - const isBinary = _optionalChain([operand, 'optionalAccess', _660 => _660.kind]) === _ast.SyntaxKind.BinaryExpression; + const isBinary = _optionalChain([operand, 'optionalAccess', _672 => _672.kind]) === _ast.SyntaxKind.BinaryExpression; const text = isBinary ? this.goWithExprDepth(this.goExprDepth, () => this.printNode(operand, 0)) : printed; - const leaf = this.goDerefableStringOperand(operand) ? "*" + text.trim() : text; + const leaf = this.goConcatDerefableStringOperand(operand) ? "*" + text.trim() : text; return this.goNativeOperandText(operand, leaf); }; const left = operandText(node.left, leftText); @@ -9029,7 +9148,7 @@ func New${this.capitalize(this.className)}() *${this.className} { return `${leftText.trim()} ${isAdd ? "+=" : "-="} ${rightText.trim()}`; } goEnclosingFunction(node) { - let current = _optionalChain([node, 'optionalAccess', _661 => _661.parent]); + let current = _optionalChain([node, 'optionalAccess', _673 => _673.parent]); while (current) { switch (current.kind) { case _ast.SyntaxKind.MethodDeclaration: @@ -9054,7 +9173,7 @@ func New${this.capitalize(this.className)}() *${this.className} { } return this.hasNodeWhere(scope, (n) => { const isBinding = n.kind === _ast.SyntaxKind.Parameter || n.kind === _ast.SyntaxKind.VariableDeclaration; - if (isBinding && _optionalChain([n, 'access', _662 => _662.name, 'optionalAccess', _663 => _663.kind]) === _ast.SyntaxKind.Identifier) { + if (isBinding && _optionalChain([n, 'access', _674 => _674.name, 'optionalAccess', _675 => _675.kind]) === _ast.SyntaxKind.Identifier) { if (relevant.indexOf(n.name.text) >= 0) { return true; } @@ -9066,27 +9185,27 @@ func New${this.capitalize(this.className)}() *${this.className} { // scan accept: the printed `x = append(x, v)` is a statement, so a value position or // a multi-argument/spread call still needs the helper goIsNativeAppendShape(receiverNode, pushNode) { - if (_optionalChain([receiverNode, 'optionalAccess', _664 => _664.kind]) !== _ast.SyntaxKind.Identifier) { + if (_optionalChain([receiverNode, 'optionalAccess', _676 => _676.kind]) !== _ast.SyntaxKind.Identifier) { return false; } - if (_optionalChain([pushNode, 'optionalAccess', _665 => _665.parent, 'optionalAccess', _666 => _666.kind]) !== _ast.SyntaxKind.ExpressionStatement) { + if (_optionalChain([pushNode, 'optionalAccess', _677 => _677.parent, 'optionalAccess', _678 => _678.kind]) !== _ast.SyntaxKind.ExpressionStatement) { return false; } - if (pushNode.questionDotToken !== void 0 || _optionalChain([pushNode, 'access', _667 => _667.expression, 'optionalAccess', _668 => _668.questionDotToken]) !== void 0) { + if (pushNode.questionDotToken !== void 0 || _optionalChain([pushNode, 'access', _679 => _679.expression, 'optionalAccess', _680 => _680.questionDotToken]) !== void 0) { return false; } const access = pushNode.expression; - if (_optionalChain([access, 'optionalAccess', _669 => _669.kind]) !== _ast.SyntaxKind.PropertyAccessExpression || access.expression !== receiverNode || _optionalChain([access, 'access', _670 => _670.name, 'optionalAccess', _671 => _671.text]) !== "push") { + if (_optionalChain([access, 'optionalAccess', _681 => _681.kind]) !== _ast.SyntaxKind.PropertyAccessExpression || access.expression !== receiverNode || _optionalChain([access, 'access', _682 => _682.name, 'optionalAccess', _683 => _683.text]) !== "push") { return false; } const args = pushNode.arguments; - return _optionalChain([args, 'optionalAccess', _672 => _672.length]) === 1 && args[0].kind !== _ast.SyntaxKind.SpreadElement; + return _optionalChain([args, 'optionalAccess', _684 => _684.length]) === 1 && args[0].kind !== _ast.SyntaxKind.SpreadElement; } // `x.push(v)` on a local declared `[]any` prints `x = append(x, v)`; undefined keeps // AppendToArray(&x, v). An `any` box keeps the helper: `&x` is a *any there, while a declared // []any local would pass a *[]any the helper's parameter does not accept. goNativeAppendReceiver(pushNode) { - const receiver = _optionalChain([pushNode, 'optionalAccess', _673 => _673.expression, 'optionalAccess', _674 => _674.expression]); + const receiver = _optionalChain([pushNode, 'optionalAccess', _685 => _685.expression, 'optionalAccess', _686 => _686.expression]); if (!this.goIsNativeAppendShape(receiver, pushNode)) { return void 0; } @@ -9105,27 +9224,27 @@ func New${this.capitalize(this.className)}() *${this.className} { const safe = !this.hasNodeWhere(scope, (n) => { if (n.kind === _ast.SyntaxKind.Identifier && n.text === varName && n !== declaration.name) { const parent = n.parent; - if (_optionalChain([parent, 'optionalAccess', _675 => _675.kind]) === _ast.SyntaxKind.PropertyAccessExpression && parent.expression === n && _optionalChain([parent, 'access', _676 => _676.name, 'optionalAccess', _677 => _677.text]) === "push") { + if (_optionalChain([parent, 'optionalAccess', _687 => _687.kind]) === _ast.SyntaxKind.PropertyAccessExpression && parent.expression === n && _optionalChain([parent, 'access', _688 => _688.name, 'optionalAccess', _689 => _689.text]) === "push") { if (goType !== "[]any" || !this.goIsNativeAppendShape(n, parent.parent)) { return true; } } - if (_optionalChain([parent, 'optionalAccess', _678 => _678.kind]) === _ast.SyntaxKind.VariableDeclaration && parent.name === n) { + if (_optionalChain([parent, 'optionalAccess', _690 => _690.kind]) === _ast.SyntaxKind.VariableDeclaration && parent.name === n) { return; } - if (_optionalChain([parent, 'optionalAccess', _679 => _679.kind]) === _ast.SyntaxKind.PostfixUnaryExpression || _optionalChain([parent, 'optionalAccess', _680 => _680.kind]) === _ast.SyntaxKind.PrefixUnaryExpression) { + if (_optionalChain([parent, 'optionalAccess', _691 => _691.kind]) === _ast.SyntaxKind.PostfixUnaryExpression || _optionalChain([parent, 'optionalAccess', _692 => _692.kind]) === _ast.SyntaxKind.PrefixUnaryExpression) { const op = parent.operator; if (op === _ast.SyntaxKind.PlusPlusToken || op === _ast.SyntaxKind.MinusMinusToken) { return true; } } - if (_optionalChain([parent, 'optionalAccess', _681 => _681.kind]) === _ast.SyntaxKind.SpreadElement) { + if (_optionalChain([parent, 'optionalAccess', _693 => _693.kind]) === _ast.SyntaxKind.SpreadElement) { return true; } - if (_optionalChain([parent, 'optionalAccess', _682 => _682.kind]) === _ast.SyntaxKind.ArrayLiteralExpression && _optionalChain([parent, 'access', _683 => _683.parent, 'optionalAccess', _684 => _684.kind]) === _ast.SyntaxKind.BinaryExpression && parent.parent.left === parent && parent.parent.operatorToken.kind === _ast.SyntaxKind.EqualsToken && !(goType === "map[string]any" && this.goGetArgTupleWriteIsDict(declaration, parent.parent.right, parent.elements.indexOf(n)))) { + if (_optionalChain([parent, 'optionalAccess', _694 => _694.kind]) === _ast.SyntaxKind.ArrayLiteralExpression && _optionalChain([parent, 'access', _695 => _695.parent, 'optionalAccess', _696 => _696.kind]) === _ast.SyntaxKind.BinaryExpression && parent.parent.left === parent && parent.parent.operatorToken.kind === _ast.SyntaxKind.EqualsToken && !(goType === "map[string]any" && this.goGetArgTupleWriteIsDict(declaration, parent.parent.right, parent.elements.indexOf(n)))) { return true; } - if (_optionalChain([parent, 'optionalAccess', _685 => _685.kind]) === _ast.SyntaxKind.BinaryExpression && parent.left === n) { + if (_optionalChain([parent, 'optionalAccess', _697 => _697.kind]) === _ast.SyntaxKind.BinaryExpression && parent.left === n) { const op = parent.operatorToken.kind; if (op === _ast.SyntaxKind.EqualsToken) { if (goType === "string" && this.goSelfConcatWriteIsString(parent.right, varName)) { @@ -9148,10 +9267,10 @@ func New${this.capitalize(this.className)}() *${this.className} { // `x = <+ chain>` that reads x itself: only a whole chain prints native (a bare // derefable leaf would be assigned as the *string it is) goSelfConcatWriteIsString(node, varName) { - while (_optionalChain([node, 'optionalAccess', _686 => _686.kind]) === _ast.SyntaxKind.ParenthesizedExpression) { + while (_optionalChain([node, 'optionalAccess', _698 => _698.kind]) === _ast.SyntaxKind.ParenthesizedExpression) { node = node.expression; } - if (_optionalChain([node, 'optionalAccess', _687 => _687.kind]) !== _ast.SyntaxKind.BinaryExpression || node.operatorToken.kind !== _ast.SyntaxKind.PlusToken) { + if (_optionalChain([node, 'optionalAccess', _699 => _699.kind]) !== _ast.SyntaxKind.BinaryExpression || node.operatorToken.kind !== _ast.SyntaxKind.PlusToken) { return false; } const readsSelf = this.hasNodeWhere(node, (n) => n.kind === _ast.SyntaxKind.Identifier && n.text === varName); @@ -9161,13 +9280,13 @@ func New${this.capitalize(this.className)}() *${this.className} { // the local itself (a Go string by the typing being proven) or a proven non-nil Go string, // so the chain prints native and the local only ever holds a string goSelfConcatIsString(node, varName) { - while (_optionalChain([node, 'optionalAccess', _688 => _688.kind]) === _ast.SyntaxKind.ParenthesizedExpression) { + while (_optionalChain([node, 'optionalAccess', _700 => _700.kind]) === _ast.SyntaxKind.ParenthesizedExpression) { node = node.expression; } - if (_optionalChain([node, 'optionalAccess', _689 => _689.kind]) === _ast.SyntaxKind.Identifier && node.text === varName) { + if (_optionalChain([node, 'optionalAccess', _701 => _701.kind]) === _ast.SyntaxKind.Identifier && node.text === varName) { return true; } - if (_optionalChain([node, 'optionalAccess', _690 => _690.kind]) === _ast.SyntaxKind.BinaryExpression && node.operatorToken.kind === _ast.SyntaxKind.PlusToken) { + if (_optionalChain([node, 'optionalAccess', _702 => _702.kind]) === _ast.SyntaxKind.BinaryExpression && node.operatorToken.kind === _ast.SyntaxKind.PlusToken) { return this.goSelfConcatIsString(node.left, varName) && this.goSelfConcatIsString(node.right, varName); } if (this.hasNodeWhere(node, (n) => n.kind === _ast.SyntaxKind.Identifier && n.text === varName)) { @@ -9188,7 +9307,7 @@ func New${this.capitalize(this.className)}() *${this.className} { // 'wrap' (a Go string becomes SafeStringPtr(v), never nil), or undefined (not convertible). // Shared by goLocalIsSafeToType (admission) and goPointerWriteText (emission). goPointerWriteConversion(right, goType) { - while (_optionalChain([right, 'optionalAccess', _691 => _691.kind]) === _ast.SyntaxKind.ParenthesizedExpression) { + while (_optionalChain([right, 'optionalAccess', _703 => _703.kind]) === _ast.SyntaxKind.ParenthesizedExpression) { right = right.expression; } if (!["*string", "*int64", "*float64"].includes(goType) || right === void 0) { @@ -9205,11 +9324,11 @@ func New${this.capitalize(this.className)}() *${this.className} { // `x = "limit"` on a *string local prints `x = SafeStringPtr("limit")`; undefined otherwise goPointerWriteText(node, identation) { const { left, right } = node; - if (_optionalChain([left, 'optionalAccess', _692 => _692.kind]) !== _ast.SyntaxKind.Identifier) { + if (_optionalChain([left, 'optionalAccess', _704 => _704.kind]) !== _ast.SyntaxKind.Identifier) { return void 0; } - const decl = _optionalChain([this, 'access', _693 => _693.checkerOrUndefined, 'call', _694 => _694(), 'optionalAccess', _695 => _695.getSymbolAtLocation, 'call', _696 => _696(left), 'optionalAccess', _697 => _697.valueDeclaration, 'optionalAccess', _698 => _698.resolve, 'call', _699 => _699()]); - if (_optionalChain([decl, 'optionalAccess', _700 => _700.kind]) !== _ast.SyntaxKind.VariableDeclaration) { + const decl = _optionalChain([this, 'access', _705 => _705.checkerOrUndefined, 'call', _706 => _706(), 'optionalAccess', _707 => _707.getSymbolAtLocation, 'call', _708 => _708(left), 'optionalAccess', _709 => _709.valueDeclaration, 'optionalAccess', _710 => _710.resolve, 'call', _711 => _711()]); + if (_optionalChain([decl, 'optionalAccess', _712 => _712.kind]) !== _ast.SyntaxKind.VariableDeclaration) { return void 0; } const goType = this.goDeclaredTypeOfIdentifier(left); @@ -9227,20 +9346,20 @@ func New${this.capitalize(this.className)}() *${this.className} { } // shared by the dict/list rules: `this.(container, key[, ])` goSafeAccessorLocalArgs(initializer, accessor, fallbackKind, fallbackItems) { - if (_optionalChain([initializer, 'optionalAccess', _701 => _701.kind]) !== _ast.SyntaxKind.CallExpression) { + if (_optionalChain([initializer, 'optionalAccess', _713 => _713.kind]) !== _ast.SyntaxKind.CallExpression) { return void 0; } const callee = initializer.expression; - if (_optionalChain([callee, 'optionalAccess', _702 => _702.kind]) !== _ast.SyntaxKind.PropertyAccessExpression || _optionalChain([callee, 'access', _703 => _703.name, 'optionalAccess', _704 => _704.text]) !== accessor) { + if (_optionalChain([callee, 'optionalAccess', _714 => _714.kind]) !== _ast.SyntaxKind.PropertyAccessExpression || _optionalChain([callee, 'access', _715 => _715.name, 'optionalAccess', _716 => _716.text]) !== accessor) { return void 0; } - if (_optionalChain([callee, 'access', _705 => _705.expression, 'optionalAccess', _706 => _706.kind]) !== _ast.SyntaxKind.ThisKeyword) { + if (_optionalChain([callee, 'access', _717 => _717.expression, 'optionalAccess', _718 => _718.kind]) !== _ast.SyntaxKind.ThisKeyword) { return void 0; } const args = initializer.arguments; if (args.length === 3) { const fallback = args[2]; - if (_optionalChain([fallback, 'optionalAccess', _707 => _707.kind]) !== fallbackKind || fallback[fallbackItems].length !== 0) { + if (_optionalChain([fallback, 'optionalAccess', _719 => _719.kind]) !== fallbackKind || fallback[fallbackItems].length !== 0) { return void 0; } } else if (args.length !== 2) { @@ -9262,19 +9381,19 @@ func New${this.capitalize(this.className)}() *${this.className} { return false; } const grandparent = parent.parent; - if (_optionalChain([grandparent, 'optionalAccess', _708 => _708.kind]) === _ast.SyntaxKind.BinaryExpression && grandparent.left === parent) { + if (_optionalChain([grandparent, 'optionalAccess', _720 => _720.kind]) === _ast.SyntaxKind.BinaryExpression && grandparent.left === parent) { return false; } - if (_optionalChain([grandparent, 'optionalAccess', _709 => _709.kind]) === _ast.SyntaxKind.PostfixUnaryExpression || _optionalChain([grandparent, 'optionalAccess', _710 => _710.kind]) === _ast.SyntaxKind.PrefixUnaryExpression) { + if (_optionalChain([grandparent, 'optionalAccess', _721 => _721.kind]) === _ast.SyntaxKind.PostfixUnaryExpression || _optionalChain([grandparent, 'optionalAccess', _722 => _722.kind]) === _ast.SyntaxKind.PrefixUnaryExpression) { return false; } - if (_optionalChain([grandparent, 'optionalAccess', _711 => _711.kind]) === _ast.SyntaxKind.DeleteExpression) { + if (_optionalChain([grandparent, 'optionalAccess', _723 => _723.kind]) === _ast.SyntaxKind.DeleteExpression) { return false; } return true; } case _ast.SyntaxKind.BinaryExpression: { - return _optionalChain([parent, 'access', _712 => _712.operatorToken, 'optionalAccess', _713 => _713.kind]) === _ast.SyntaxKind.InKeyword && parent.right === node; + return _optionalChain([parent, 'access', _724 => _724.operatorToken, 'optionalAccess', _725 => _725.kind]) === _ast.SyntaxKind.InKeyword && parent.right === node; } case _ast.SyntaxKind.CallExpression: { if (parent.expression === node) { @@ -9299,10 +9418,10 @@ func New${this.capitalize(this.className)}() *${this.className} { // memoised, re-entrancy-guarded typing of a `var x T = …` declaration statement; a for-init // or any other shape prints `:=`, where the annotation would not appear goCachedLocalUnbox(cache, declaration, compute) { - if (_optionalChain([declaration, 'optionalAccess', _714 => _714.kind]) !== _ast.SyntaxKind.VariableDeclaration || _optionalChain([declaration, 'access', _715 => _715.name, 'optionalAccess', _716 => _716.kind]) !== _ast.SyntaxKind.Identifier) { + if (_optionalChain([declaration, 'optionalAccess', _726 => _726.kind]) !== _ast.SyntaxKind.VariableDeclaration || _optionalChain([declaration, 'access', _727 => _727.name, 'optionalAccess', _728 => _728.kind]) !== _ast.SyntaxKind.Identifier) { return void 0; } - if (_optionalChain([declaration, 'access', _717 => _717.parent, 'optionalAccess', _718 => _718.parent, 'optionalAccess', _719 => _719.kind]) !== _ast.SyntaxKind.FirstStatement) { + if (_optionalChain([declaration, 'access', _729 => _729.parent, 'optionalAccess', _730 => _730.parent, 'optionalAccess', _731 => _731.kind]) !== _ast.SyntaxKind.FirstStatement) { return void 0; } if (cache.has(declaration)) { @@ -9330,7 +9449,7 @@ func New${this.capitalize(this.className)}() *${this.className} { return void 0; } const unsafe = this.hasNodeWhere(scope, (n) => { - if ((n.kind === _ast.SyntaxKind.VariableDeclaration || n.kind === _ast.SyntaxKind.Parameter) && n !== declaration && _optionalChain([n, 'access', _720 => _720.name, 'optionalAccess', _721 => _721.kind]) === _ast.SyntaxKind.Identifier && n.name.text === sourceName) { + if ((n.kind === _ast.SyntaxKind.VariableDeclaration || n.kind === _ast.SyntaxKind.Parameter) && n !== declaration && _optionalChain([n, 'access', _732 => _732.name, 'optionalAccess', _733 => _733.kind]) === _ast.SyntaxKind.Identifier && n.name.text === sourceName) { return true; } if (n.kind !== _ast.SyntaxKind.Identifier || n.text !== sourceName || n === declaration.name) { @@ -9364,20 +9483,20 @@ func New${this.capitalize(this.className)}() *${this.className} { // the `MarketInterface` interface for `this.Market(...)` / `this.SafeMarket(...)` (the `Market` // alias is the same interface unioned with undefined). Read from the checker, never a printed name. goMarketCallReturnsDict(initializer) { - if (_optionalChain([initializer, 'optionalAccess', _722 => _722.kind]) !== _ast.SyntaxKind.CallExpression) { + if (_optionalChain([initializer, 'optionalAccess', _734 => _734.kind]) !== _ast.SyntaxKind.CallExpression) { return false; } const callee = initializer.expression; - if (_optionalChain([callee, 'optionalAccess', _723 => _723.kind]) !== _ast.SyntaxKind.PropertyAccessExpression) { + if (_optionalChain([callee, 'optionalAccess', _735 => _735.kind]) !== _ast.SyntaxKind.PropertyAccessExpression) { return false; } - const name = _optionalChain([callee, 'access', _724 => _724.name, 'optionalAccess', _725 => _725.text]); + const name = _optionalChain([callee, 'access', _736 => _736.name, 'optionalAccess', _737 => _737.text]); if (name === void 0) { return false; } const receiver = callee.expression; - const onThis = _optionalChain([receiver, 'optionalAccess', _726 => _726.kind]) === _ast.SyntaxKind.ThisKeyword; - const onDerived = _optionalChain([receiver, 'optionalAccess', _727 => _727.kind]) === _ast.SyntaxKind.PropertyAccessExpression && _optionalChain([receiver, 'access', _728 => _728.expression, 'optionalAccess', _729 => _729.kind]) === _ast.SyntaxKind.ThisKeyword && _optionalChain([receiver, 'access', _730 => _730.name, 'optionalAccess', _731 => _731.text]) === "DerivedExchange"; + const onThis = _optionalChain([receiver, 'optionalAccess', _738 => _738.kind]) === _ast.SyntaxKind.ThisKeyword; + const onDerived = _optionalChain([receiver, 'optionalAccess', _739 => _739.kind]) === _ast.SyntaxKind.PropertyAccessExpression && _optionalChain([receiver, 'access', _740 => _740.expression, 'optionalAccess', _741 => _741.kind]) === _ast.SyntaxKind.ThisKeyword && _optionalChain([receiver, 'access', _742 => _742.name, 'optionalAccess', _743 => _743.text]) === "DerivedExchange"; if (!onThis && !onDerived) { return false; } @@ -9390,7 +9509,7 @@ func New${this.capitalize(this.className)}() *${this.className} { return false; } const isMarketInterface = (t) => { - const names = [_optionalChain([t, 'optionalAccess', _732 => _732.getSymbol, 'call', _733 => _733(), 'optionalAccess', _734 => _734.name]), _optionalChain([t, 'optionalAccess', _735 => _735.getAliasSymbol, 'call', _736 => _736(), 'optionalAccess', _737 => _737.name])]; + const names = [_optionalChain([t, 'optionalAccess', _744 => _744.getSymbol, 'call', _745 => _745(), 'optionalAccess', _746 => _746.name]), _optionalChain([t, 'optionalAccess', _747 => _747.getAliasSymbol, 'call', _748 => _748(), 'optionalAccess', _749 => _749.name])]; return names.indexOf("MarketInterface") >= 0 || names.indexOf("CurrencyInterface") >= 0; }; if (isMarketInterface(type)) { @@ -9416,7 +9535,7 @@ func New${this.capitalize(this.className)}() *${this.className} { if (symbol === void 0) { return true; } - const valueDeclaration = _nullishCoalesce(_optionalChain([symbol, 'access', _738 => _738.valueDeclaration, 'optionalAccess', _739 => _739.resolve, 'call', _740 => _740()]), () => ( _optionalChain([symbol, 'access', _741 => _741.declarations, 'optionalAccess', _742 => _742.map, 'call', _743 => _743((d) => d.resolve()), 'optionalAccess', _744 => _744[0]]))); + const valueDeclaration = _nullishCoalesce(_optionalChain([symbol, 'access', _750 => _750.valueDeclaration, 'optionalAccess', _751 => _751.resolve, 'call', _752 => _752()]), () => ( _optionalChain([symbol, 'access', _753 => _753.declarations, 'optionalAccess', _754 => _754.map, 'call', _755 => _755((d) => d.resolve()), 'optionalAccess', _756 => _756[0]]))); return valueDeclaration === void 0 || valueDeclaration === declaration; } // one later use of the market local: the dictionary read shapes SafeDict proves (element read, @@ -9427,25 +9546,25 @@ func New${this.capitalize(this.className)}() *${this.className} { return true; } const parent = node.parent; - if (_optionalChain([parent, 'optionalAccess', _745 => _745.kind]) === _ast.SyntaxKind.ElementAccessExpression && parent.expression === node && this.goIsComparedOperand(parent)) { + if (_optionalChain([parent, 'optionalAccess', _757 => _757.kind]) === _ast.SyntaxKind.ElementAccessExpression && parent.expression === node && this.goIsComparedOperand(parent)) { return true; } if (!throwingAccessor) { return false; } - return _optionalChain([parent, 'optionalAccess', _746 => _746.kind]) === _ast.SyntaxKind.CallExpression && parent.expression !== node && parent.arguments.indexOf(node) >= 0; + return _optionalChain([parent, 'optionalAccess', _758 => _758.kind]) === _ast.SyntaxKind.CallExpression && parent.expression !== node && parent.arguments.indexOf(node) >= 0; } goMarketLocalUnboxUncached(declaration) { if (!this.goMarketCallReturnsDict(declaration.initializer)) { return void 0; } - const accessorName = _optionalChain([declaration, 'access', _747 => _747.initializer, 'access', _748 => _748.expression, 'optionalAccess', _749 => _749.name, 'optionalAccess', _750 => _750.text]); + const accessorName = _optionalChain([declaration, 'access', _759 => _759.initializer, 'access', _760 => _760.expression, 'optionalAccess', _761 => _761.name, 'optionalAccess', _762 => _762.text]); const throwingAccessor = accessorName === "market" || accessorName === "currency"; return this.goDeclaredLocalTypeIfSafe( declaration, GO_MARKET_LOCAL_TYPE, (n) => this.goMarketUseReadsTheValue(n, throwingAccessor), - (n) => _optionalChain([n, 'access', _751 => _751.parent, 'optionalAccess', _752 => _752.kind]) === _ast.SyntaxKind.PropertyAccessExpression && n.parent.name === n || !this.goIdentifierRefersToDeclaration(n, declaration) + (n) => _optionalChain([n, 'access', _763 => _763.parent, 'optionalAccess', _764 => _764.kind]) === _ast.SyntaxKind.PropertyAccessExpression && n.parent.name === n || !this.goIdentifierRefersToDeclaration(n, declaration) ); } // the initializer a typed market local is declared with: the same call, its boxed result @@ -9461,8 +9580,8 @@ func New${this.capitalize(this.className)}() *${this.className} { goDeclarationOfIdentifier(node) { try { const symbol = this.getChecker().getSymbolAtLocation(node); - const declaration = _nullishCoalesce(_optionalChain([symbol, 'optionalAccess', _753 => _753.valueDeclaration, 'optionalAccess', _754 => _754.resolve, 'call', _755 => _755()]), () => ( _optionalChain([symbol, 'optionalAccess', _756 => _756.declarations, 'optionalAccess', _757 => _757.map, 'call', _758 => _758((d) => d.resolve()), 'optionalAccess', _759 => _759[0]]))); - if (_optionalChain([declaration, 'optionalAccess', _760 => _760.kind]) === _ast.SyntaxKind.VariableDeclaration) { + const declaration = _nullishCoalesce(_optionalChain([symbol, 'optionalAccess', _765 => _765.valueDeclaration, 'optionalAccess', _766 => _766.resolve, 'call', _767 => _767()]), () => ( _optionalChain([symbol, 'optionalAccess', _768 => _768.declarations, 'optionalAccess', _769 => _769.map, 'call', _770 => _770((d) => d.resolve()), 'optionalAccess', _771 => _771[0]]))); + if (_optionalChain([declaration, 'optionalAccess', _772 => _772.kind]) === _ast.SyntaxKind.VariableDeclaration) { return declaration; } } catch (e) { @@ -9474,8 +9593,8 @@ func New${this.capitalize(this.className)}() *${this.className} { // the boxed local's read used to apply, and a parseMarket may have stored a `*bool`/`*string` // under the key. Only the operands the use scan admits this way are affected; every other goMarketComparisonElementRead(node) { - const base = _optionalChain([node, 'optionalAccess', _761 => _761.expression]); - if (_optionalChain([base, 'optionalAccess', _762 => _762.kind]) !== _ast.SyntaxKind.Identifier) { + const base = _optionalChain([node, 'optionalAccess', _773 => _773.expression]); + if (_optionalChain([base, 'optionalAccess', _774 => _774.kind]) !== _ast.SyntaxKind.Identifier) { return false; } const declaration = this.goDeclarationOfIdentifier(base); @@ -9488,11 +9607,11 @@ func New${this.capitalize(this.className)}() *${this.className} { goIsComparedOperand(node) { let operand = node; let above = node.parent; - while (_optionalChain([above, 'optionalAccess', _763 => _763.kind]) === _ast.SyntaxKind.ParenthesizedExpression) { + while (_optionalChain([above, 'optionalAccess', _775 => _775.kind]) === _ast.SyntaxKind.ParenthesizedExpression) { operand = above; above = above.parent; } - return _optionalChain([above, 'optionalAccess', _764 => _764.kind]) === _ast.SyntaxKind.BinaryExpression && (above.left === operand || above.right === operand) && GO_MARKET_READ_COMPARISON_OPERATORS.indexOf(_optionalChain([above, 'access', _765 => _765.operatorToken, 'optionalAccess', _766 => _766.kind])) >= 0; + return _optionalChain([above, 'optionalAccess', _776 => _776.kind]) === _ast.SyntaxKind.BinaryExpression && (above.left === operand || above.right === operand) && GO_MARKET_READ_COMPARISON_OPERATORS.indexOf(_optionalChain([above, 'access', _777 => _777.operatorToken, 'optionalAccess', _778 => _778.kind])) >= 0; } // the container/key argument nodes of a whole `this.SafeList(container, key)` call, or // undefined when the initializer is another shape. A third argument is only droppable when @@ -9513,10 +9632,10 @@ func New${this.capitalize(this.className)}() *${this.className} { if (parent.expression !== node) { return false; } - if (_optionalChain([parent, 'access', _767 => _767.name, 'optionalAccess', _768 => _768.text]) === "length") { + if (_optionalChain([parent, 'access', _779 => _779.name, 'optionalAccess', _780 => _780.text]) === "length") { return true; } - return _optionalChain([parent, 'access', _769 => _769.name, 'optionalAccess', _770 => _770.text]) === "push" && this.goIsNativeAppendShape(node, parent.parent); + return _optionalChain([parent, 'access', _781 => _781.name, 'optionalAccess', _782 => _782.text]) === "push" && this.goIsNativeAppendShape(node, parent.parent); } case _ast.SyntaxKind.ElementAccessExpression: { if (parent.expression !== node) { @@ -9563,7 +9682,7 @@ func New${this.capitalize(this.className)}() *${this.className} { if (goType === void 0) { return _nullishCoalesce(_nullishCoalesce(_nullishCoalesce(this.goSafeDictLocalUnbox(declaration), () => ( this.goSafeListLocalUnbox(declaration))), () => ( this.goMarketLocalUnbox(declaration))), () => ( "any")); } - const sourceName = _optionalChain([declaration, 'access', _771 => _771.name, 'optionalAccess', _772 => _772.text]); + const sourceName = _optionalChain([declaration, 'access', _783 => _783.name, 'optionalAccess', _784 => _784.text]); if (sourceName === void 0) { return "any"; } @@ -9592,7 +9711,7 @@ func New${this.capitalize(this.className)}() *${this.className} { } printVariableDeclarationList(node, identation) { const declaration = node.declarations[0]; - if (_optionalChain([declaration, 'optionalAccess', _773 => _773.name, 'access', _774 => _774.kind]) === _ast.SyntaxKind.ArrayBindingPattern) { + if (_optionalChain([declaration, 'optionalAccess', _785 => _785.name, 'access', _786 => _786.kind]) === _ast.SyntaxKind.ArrayBindingPattern) { const arrayBindingPattern = declaration.name; const arrayBindingPatternElements = arrayBindingPattern.elements; const parsedArrayBindingElements = arrayBindingPatternElements.map((e) => this.printNode(e.name, 0)); @@ -9602,7 +9721,7 @@ func New${this.capitalize(this.className)}() *${this.className} { arrayBindingStatement += parsedArrayBindingElements.map((e, index) => this.getIden(identation) + `${e} := GetValue(${syntheticName}, ${index})`).join("\n"); return arrayBindingStatement; } - if (_optionalChain([declaration, 'optionalAccess', _775 => _775.initializer, 'optionalAccess', _776 => _776.kind]) === _ast.SyntaxKind.AwaitExpression) { + if (_optionalChain([declaration, 'optionalAccess', _787 => _787.initializer, 'optionalAccess', _788 => _788.kind]) === _ast.SyntaxKind.AwaitExpression) { const parsedName = this.printNode(declaration.name, 0); const parsedInitializer = this.printNode(declaration.initializer, identation); const awaitUnbox = this.goAwaitReceiveUnbox(declaration.initializer, parsedInitializer); @@ -9619,7 +9738,7 @@ ${this.getIden(identation)}PanicOnError(${parsedName})`; if (parsedValue === this.UNDEFINED_TOKEN) { return this.getIden(identation) + "var " + this.printNode(declaration.name) + " any = " + parsedValue; } - if (_optionalChain([node, 'optionalAccess', _777 => _777.parent, 'optionalAccess', _778 => _778.kind]) === _ast.SyntaxKind.FirstStatement) { + if (_optionalChain([node, 'optionalAccess', _789 => _789.parent, 'optionalAccess', _790 => _790.kind]) === _ast.SyntaxKind.FirstStatement) { if (isNew) { return this.getIden(identation) + this.printNode(declaration.name) + " := " + parsedValue; } @@ -9870,7 +9989,7 @@ ${this.getIden(identation)}PanicOnError(${varName})`; const constructorBody = this.printFunctionBody(node, identation); let superCallParams = ""; let hasSuperCall = false; - _optionalChain([node, 'access', _779 => _779.body, 'optionalAccess', _780 => _780.statements, 'access', _781 => _781.forEach, 'call', _782 => _782((statement) => { + _optionalChain([node, 'access', _791 => _791.body, 'optionalAccess', _792 => _792.statements, 'access', _793 => _793.forEach, 'call', _794 => _794((statement) => { if (_is.isExpressionStatement.call(void 0, statement)) { const expression = statement.expression; if (_is.isCallExpression.call(void 0, expression)) { @@ -9891,9 +10010,9 @@ ${this.getIden(identation)}PanicOnError(${varName})`; } printDynamicCall(node, identation) { const elementAccess = node.expression; - if (_optionalChain([elementAccess, 'optionalAccess', _783 => _783.kind]) === _ast.SyntaxKind.ElementAccessExpression) { - const argumentDepth = this.goExprDepth + (_optionalChain([node, 'access', _784 => _784.arguments, 'optionalAccess', _785 => _785.length]) > 0 ? 1 : 0); - const parsedArg = _optionalChain([node, 'access', _786 => _786.arguments, 'optionalAccess', _787 => _787.length]) > 0 ? node.arguments.map((n) => this.goWithExprDepth(argumentDepth, () => this.printNode(n, identation).trimStart())).join(", ") : ""; + if (_optionalChain([elementAccess, 'optionalAccess', _795 => _795.kind]) === _ast.SyntaxKind.ElementAccessExpression) { + const argumentDepth = this.goExprDepth + (_optionalChain([node, 'access', _796 => _796.arguments, 'optionalAccess', _797 => _797.length]) > 0 ? 1 : 0); + const parsedArg = _optionalChain([node, 'access', _798 => _798.arguments, 'optionalAccess', _799 => _799.length]) > 0 ? node.arguments.map((n) => this.goWithExprDepth(argumentDepth, () => this.printNode(n, identation).trimStart())).join(", ") : ""; const propName = this.goWithExprDepth(argumentDepth, () => this.printNode(elementAccess.argumentExpression, 0)); const argsArray = `${parsedArg}`; const open = this.DYNAMIC_CALL_OPEN; @@ -9920,11 +10039,11 @@ ${this.getIden(identation)}PanicOnError(${varName})`; } printWrappedUnknownThisProperty(node, identation = 0) { const type = this.getChecker().getResolvedSignature(node); - if (_optionalChain([type, 'optionalAccess', _788 => _788.declaration, 'optionalAccess', _789 => _789.resolve, 'call', _790 => _790()]) === void 0) { - const argumentDepth = this.goExprDepth + (_optionalChain([node, 'access', _791 => _791.arguments, 'optionalAccess', _792 => _792.length]) > 0 ? 1 : 0); - let parsedArguments = _optionalChain([node, 'access', _793 => _793.arguments, 'optionalAccess', _794 => _794.map, 'call', _795 => _795((a) => this.goWithExprDepth(argumentDepth, () => this.printNode(a, identation).trimStart())), 'access', _796 => _796.join, 'call', _797 => _797(", ")]); + if (_optionalChain([type, 'optionalAccess', _800 => _800.declaration, 'optionalAccess', _801 => _801.resolve, 'call', _802 => _802()]) === void 0) { + const argumentDepth = this.goExprDepth + (_optionalChain([node, 'access', _803 => _803.arguments, 'optionalAccess', _804 => _804.length]) > 0 ? 1 : 0); + let parsedArguments = _optionalChain([node, 'access', _805 => _805.arguments, 'optionalAccess', _806 => _806.map, 'call', _807 => _807((a) => this.goWithExprDepth(argumentDepth, () => this.printNode(a, identation).trimStart())), 'access', _808 => _808.join, 'call', _809 => _809(", ")]); parsedArguments = parsedArguments || ""; - const propName = _optionalChain([node, 'access', _798 => _798.expression, 'optionalAccess', _799 => _799.name, 'access', _800 => _800.text]); + const propName = _optionalChain([node, 'access', _810 => _810.expression, 'optionalAccess', _811 => _811.name, 'access', _812 => _812.text]); const argsArray = `${parsedArguments}`; const open = this.DYNAMIC_CALL_OPEN; const statement = `${open}"${propName}", ${argsArray})`; @@ -9971,7 +10090,7 @@ ${this.getIden(identation)}PanicOnError(${varName})`; return `MathPow(${parsedArg1}, ${parsedArg2})`; } } - const leftSide = _optionalChain([node, 'access', _801 => _801.expression, 'optionalAccess', _802 => _802.expression]); + const leftSide = _optionalChain([node, 'access', _813 => _813.expression, 'optionalAccess', _814 => _814.expression]); const leftSideText = leftSide ? this.printNode(leftSide, 0) : void 0; if (leftSideText === this.THIS_TOKEN || leftSide.getFullText().indexOf("(this as any)") > -1) { const res = this.printWrappedUnknownThisProperty(node, identation); @@ -10082,7 +10201,7 @@ ${this.getIden(identation)}PanicOnError(${varName})`; } } if (ORDERED_COMPARISON_OPERATORS[op] !== void 0) { - const inlined = this.printInlineOrderedComparison(left, right, leftText, rightText, op); + const inlined = _nullishCoalesce(this.printInlineOrderedComparison(left, right, leftText, rightText, op), () => ( this.printG09WideningComparison(left, right, leftText, rightText, op))); if (inlined !== void 0) { return inlined; } @@ -10103,7 +10222,7 @@ ${this.getIden(identation)}PanicOnError(${varName})`; // when the type is any/unknown/a union of several families goScalarFamily(node) { const checker = this.checkerOrUndefined(); - if (_optionalChain([node, 'optionalAccess', _803 => _803.kind]) === _ast.SyntaxKind.Identifier && this.goDeclaredTypeOfIdentifier(node) === void 0 && this.goAnyLocalHoldsPointer(_optionalChain([checker, 'access', _804 => _804.getSymbolAtLocation, 'call', _805 => _805(node), 'optionalAccess', _806 => _806.valueDeclaration, 'optionalAccess', _807 => _807.resolve, 'call', _808 => _808()]))) { + if (_optionalChain([node, 'optionalAccess', _815 => _815.kind]) === _ast.SyntaxKind.Identifier && this.goDeclaredTypeOfIdentifier(node) === void 0 && this.goAnyLocalHoldsPointer(_optionalChain([checker, 'access', _816 => _816.getSymbolAtLocation, 'call', _817 => _817(node), 'optionalAccess', _818 => _818.valueDeclaration, 'optionalAccess', _819 => _819.resolve, 'call', _820 => _820()]))) { return void 0; } return checker === void 0 ? void 0 : this.goScalarFamilyOfType(checker.getTypeAtLocation(node)); @@ -10120,14 +10239,14 @@ ${this.getIden(identation)}PanicOnError(${varName})`; // object (`Strings`, `Market`, `NullableDict`, `object[]`, `object`): a Go map/slice, never a // pointer, so a nil test needs no helper. Locals may box a nil `*sync.Map`, which is not `== nil`. goObjectBoxParameter(node) { - if (_optionalChain([node, 'optionalAccess', _809 => _809.kind]) !== _ast.SyntaxKind.Identifier) { + if (_optionalChain([node, 'optionalAccess', _821 => _821.kind]) !== _ast.SyntaxKind.Identifier) { return false; } const checker = this.checkerOrUndefined(); if (checker === void 0) { return false; } - if (_optionalChain([checker, 'access', _810 => _810.getSymbolAtLocation, 'call', _811 => _811(node), 'optionalAccess', _812 => _812.valueDeclaration, 'optionalAccess', _813 => _813.resolve, 'call', _814 => _814(), 'optionalAccess', _815 => _815.kind]) !== _ast.SyntaxKind.Parameter) { + if (_optionalChain([checker, 'access', _822 => _822.getSymbolAtLocation, 'call', _823 => _823(node), 'optionalAccess', _824 => _824.valueDeclaration, 'optionalAccess', _825 => _825.resolve, 'call', _826 => _826(), 'optionalAccess', _827 => _827.kind]) !== _ast.SyntaxKind.Parameter) { return false; } return this.goTypeIsNilComparableObject(checker.getTypeAtLocation(node)); @@ -10158,8 +10277,8 @@ ${this.getIden(identation)}PanicOnError(${varName})`; if (type.getCallSignatures().length > 0 || type.getConstructSignatures().length > 0) { return false; } - const declaration = _nullishCoalesce(_optionalChain([type, 'access', _816 => _816.getSymbol, 'call', _817 => _817(), 'optionalAccess', _818 => _818.valueDeclaration, 'optionalAccess', _819 => _819.resolve, 'call', _820 => _820()]), () => ( _optionalChain([type, 'access', _821 => _821.getSymbol, 'call', _822 => _822(), 'optionalAccess', _823 => _823.declarations, 'optionalAccess', _824 => _824.map, 'call', _825 => _825((d) => d.resolve()), 'optionalAccess', _826 => _826[0]]))); - return _optionalChain([declaration, 'optionalAccess', _827 => _827.kind]) !== _ast.SyntaxKind.ClassDeclaration; + const declaration = _nullishCoalesce(_optionalChain([type, 'access', _828 => _828.getSymbol, 'call', _829 => _829(), 'optionalAccess', _830 => _830.valueDeclaration, 'optionalAccess', _831 => _831.resolve, 'call', _832 => _832()]), () => ( _optionalChain([type, 'access', _833 => _833.getSymbol, 'call', _834 => _834(), 'optionalAccess', _835 => _835.declarations, 'optionalAccess', _836 => _836.map, 'call', _837 => _837((d) => d.resolve()), 'optionalAccess', _838 => _838[0]]))); + return _optionalChain([declaration, 'optionalAccess', _839 => _839.kind]) !== _ast.SyntaxKind.ClassDeclaration; } // the callee name of a printed call, e.g. `this.SafeDict(x, 0, {})` → `this.SafeDict` goPrintedCallee(printedValue) { @@ -10178,9 +10297,9 @@ ${this.getIden(identation)}PanicOnError(${varName})`; // local the printer left `any`, or one of the helpers whose Go signature returns // `any`. A *T / scalar local or call is not a box and keeps its own rule. goIsAnyBoxExpression(node, printedText) { - if (_optionalChain([node, 'optionalAccess', _828 => _828.kind]) === _ast.SyntaxKind.Identifier) { + if (_optionalChain([node, 'optionalAccess', _840 => _840.kind]) === _ast.SyntaxKind.Identifier) { const decl = this.goAnyBoxLocalDeclaration(node); - const isBinding = _optionalChain([decl, 'optionalAccess', _829 => _829.kind]) === _ast.SyntaxKind.Parameter || _optionalChain([decl, 'optionalAccess', _830 => _830.kind]) === _ast.SyntaxKind.VariableDeclaration; + const isBinding = _optionalChain([decl, 'optionalAccess', _841 => _841.kind]) === _ast.SyntaxKind.Parameter || _optionalChain([decl, 'optionalAccess', _842 => _842.kind]) === _ast.SyntaxKind.VariableDeclaration; if (!isBinding) { return false; } @@ -10189,7 +10308,7 @@ ${this.getIden(identation)}PanicOnError(${varName})`; } return !this.goAnyLocalHoldsPointer(decl); } - if (_optionalChain([node, 'optionalAccess', _831 => _831.kind]) === _ast.SyntaxKind.CallExpression) { + if (_optionalChain([node, 'optionalAccess', _843 => _843.kind]) === _ast.SyntaxKind.CallExpression) { if (this.goTypeOfInitializer(node, printedText) !== void 0) { return false; } @@ -10201,7 +10320,7 @@ ${this.getIden(identation)}PanicOnError(${varName})`; // GetValue(container, key) helper call — an `any` box in both cases goBoxedElementRead(node, printedText) { node = this.goUnwrapParenthesizedNode(node); - if (_optionalChain([node, 'optionalAccess', _832 => _832.kind]) !== _ast.SyntaxKind.ElementAccessExpression) { + if (_optionalChain([node, 'optionalAccess', _844 => _844.kind]) !== _ast.SyntaxKind.ElementAccessExpression) { return false; } if (GO_ANY_BOX_CALLS.indexOf(this.goPrintedCallee(printedText)) >= 0) { @@ -10214,7 +10333,7 @@ ${this.getIden(identation)}PanicOnError(${varName})`; return this.goIndexableTypeOf(base, "") === "map[string]any"; } goAnyLocalHoldsPointer(decl) { - if (_optionalChain([decl, 'optionalAccess', _833 => _833.kind]) !== _ast.SyntaxKind.VariableDeclaration || _optionalChain([decl, 'access', _834 => _834.name, 'optionalAccess', _835 => _835.kind]) !== _ast.SyntaxKind.Identifier) { + if (_optionalChain([decl, 'optionalAccess', _845 => _845.kind]) !== _ast.SyntaxKind.VariableDeclaration || _optionalChain([decl, 'access', _846 => _846.name, 'optionalAccess', _847 => _847.kind]) !== _ast.SyntaxKind.Identifier) { return false; } if (this.goAnyLocalHoldsPointerCache.has(decl)) { @@ -10224,13 +10343,13 @@ ${this.getIden(identation)}PanicOnError(${varName})`; let settled = true; const isPointerInit = (expr) => { expr = this.goUnwrapParenthesizedNode(expr); - if (_optionalChain([expr, 'optionalAccess', _836 => _836.kind]) === _ast.SyntaxKind.ConditionalExpression) { + if (_optionalChain([expr, 'optionalAccess', _848 => _848.kind]) === _ast.SyntaxKind.ConditionalExpression) { return isPointerInit(expr.whenTrue) || isPointerInit(expr.whenFalse); } - if (_optionalChain([expr, 'optionalAccess', _837 => _837.kind]) === _ast.SyntaxKind.Identifier) { - const source = _optionalChain([this, 'access', _838 => _838.checkerOrUndefined, 'call', _839 => _839(), 'optionalAccess', _840 => _840.getSymbolAtLocation, 'call', _841 => _841(expr), 'optionalAccess', _842 => _842.valueDeclaration, 'optionalAccess', _843 => _843.resolve, 'call', _844 => _844()]); - if (_optionalChain([source, 'optionalAccess', _845 => _845.kind]) === _ast.SyntaxKind.Parameter) { - if (_optionalChain([this, 'access', _846 => _846.goGetArgTypeComputing, 'optionalAccess', _847 => _847.has, 'call', _848 => _848(source)])) { + if (_optionalChain([expr, 'optionalAccess', _849 => _849.kind]) === _ast.SyntaxKind.Identifier) { + const source = _optionalChain([this, 'access', _850 => _850.checkerOrUndefined, 'call', _851 => _851(), 'optionalAccess', _852 => _852.getSymbolAtLocation, 'call', _853 => _853(expr), 'optionalAccess', _854 => _854.valueDeclaration, 'optionalAccess', _855 => _855.resolve, 'call', _856 => _856()]); + if (_optionalChain([source, 'optionalAccess', _857 => _857.kind]) === _ast.SyntaxKind.Parameter) { + if (_optionalChain([this, 'access', _858 => _858.goGetArgTypeComputing, 'optionalAccess', _859 => _859.has, 'call', _860 => _860(source)])) { settled = false; return true; } @@ -10240,8 +10359,8 @@ ${this.getIden(identation)}PanicOnError(${varName})`; settled = settled && (source === decl || this.goAnyLocalHoldsPointerCache.has(source)); return inner; } - const callee = _optionalChain([expr, 'optionalAccess', _849 => _849.kind]) === _ast.SyntaxKind.CallExpression ? expr.expression : void 0; - if (_optionalChain([callee, 'optionalAccess', _850 => _850.kind]) !== _ast.SyntaxKind.PropertyAccessExpression || _optionalChain([callee, 'access', _851 => _851.expression, 'optionalAccess', _852 => _852.kind]) !== _ast.SyntaxKind.ThisKeyword) { + const callee = _optionalChain([expr, 'optionalAccess', _861 => _861.kind]) === _ast.SyntaxKind.CallExpression ? expr.expression : void 0; + if (_optionalChain([callee, 'optionalAccess', _862 => _862.kind]) !== _ast.SyntaxKind.PropertyAccessExpression || _optionalChain([callee, 'access', _863 => _863.expression, 'optionalAccess', _864 => _864.kind]) !== _ast.SyntaxKind.ThisKeyword) { return false; } const name = this.goAstCalleeName(expr); @@ -10256,7 +10375,7 @@ ${this.getIden(identation)}PanicOnError(${varName})`; if (holds) { return; } - if (n.kind === _ast.SyntaxKind.BinaryExpression && n.operatorToken.kind === _ast.SyntaxKind.EqualsToken && _optionalChain([n, 'access', _853 => _853.left, 'optionalAccess', _854 => _854.kind]) === _ast.SyntaxKind.Identifier && n.left.text === name && isPointerInit(n.right)) { + if (n.kind === _ast.SyntaxKind.BinaryExpression && n.operatorToken.kind === _ast.SyntaxKind.EqualsToken && _optionalChain([n, 'access', _865 => _865.left, 'optionalAccess', _866 => _866.kind]) === _ast.SyntaxKind.Identifier && n.left.text === name && isPointerInit(n.right)) { holds = true; return; } @@ -10277,13 +10396,13 @@ ${this.getIden(identation)}PanicOnError(${varName})`; // printer names Go functions (`this.parseJson` -> `this.ParseJson`). Printing the // callee would re-enter the equality classifier that asks this question. goAstCalleeName(call) { - const callee = _optionalChain([call, 'optionalAccess', _855 => _855.expression]); - if (_optionalChain([callee, 'optionalAccess', _856 => _856.kind]) === _ast.SyntaxKind.Identifier) { + const callee = _optionalChain([call, 'optionalAccess', _867 => _867.expression]); + if (_optionalChain([callee, 'optionalAccess', _868 => _868.kind]) === _ast.SyntaxKind.Identifier) { const name = callee.text; return typeof name === "string" && name.length > 0 ? name.charAt(0).toUpperCase() + name.substring(1) : void 0; } - if (_optionalChain([callee, 'optionalAccess', _857 => _857.kind]) === _ast.SyntaxKind.PropertyAccessExpression && _optionalChain([callee, 'access', _858 => _858.expression, 'optionalAccess', _859 => _859.kind]) === _ast.SyntaxKind.ThisKeyword) { - const name = _optionalChain([callee, 'access', _860 => _860.name, 'optionalAccess', _861 => _861.text]); + if (_optionalChain([callee, 'optionalAccess', _869 => _869.kind]) === _ast.SyntaxKind.PropertyAccessExpression && _optionalChain([callee, 'access', _870 => _870.expression, 'optionalAccess', _871 => _871.kind]) === _ast.SyntaxKind.ThisKeyword) { + const name = _optionalChain([callee, 'access', _872 => _872.name, 'optionalAccess', _873 => _873.text]); return typeof name === "string" && name.length > 0 ? "this." + name.charAt(0).toUpperCase() + name.substring(1) : void 0; } return void 0; @@ -10293,15 +10412,15 @@ ${this.getIden(identation)}PanicOnError(${varName})`; // `<-chan any` wrapper over callEndpointAsync (decoded JSON / "panic: " / nil) goAwaitedCallIsImplicitEndpoint(expression) { const call = this.goUnwrapParenthesizedNode(expression); - if (_optionalChain([call, 'optionalAccess', _862 => _862.kind]) !== _ast.SyntaxKind.CallExpression) { + if (_optionalChain([call, 'optionalAccess', _874 => _874.kind]) !== _ast.SyntaxKind.CallExpression) { return false; } const callee = call.expression; - if (_optionalChain([callee, 'optionalAccess', _863 => _863.kind]) !== _ast.SyntaxKind.PropertyAccessExpression || _optionalChain([callee, 'access', _864 => _864.expression, 'optionalAccess', _865 => _865.kind]) !== _ast.SyntaxKind.ThisKeyword) { + if (_optionalChain([callee, 'optionalAccess', _875 => _875.kind]) !== _ast.SyntaxKind.PropertyAccessExpression || _optionalChain([callee, 'access', _876 => _876.expression, 'optionalAccess', _877 => _877.kind]) !== _ast.SyntaxKind.ThisKeyword) { return false; } const nameNode = callee.name; - if (_optionalChain([nameNode, 'optionalAccess', _866 => _866.kind]) !== _ast.SyntaxKind.Identifier) { + if (_optionalChain([nameNode, 'optionalAccess', _878 => _878.kind]) !== _ast.SyntaxKind.Identifier) { return false; } const checker = this.checkerOrUndefined(); @@ -10309,11 +10428,11 @@ ${this.getIden(identation)}PanicOnError(${varName})`; return false; } const symbol = checker.getSymbolAtLocation(nameNode); - const declarations = _optionalChain([symbol, 'optionalAccess', _867 => _867.declarations, 'optionalAccess', _868 => _868.map, 'call', _869 => _869((d) => d.resolve())]); + const declarations = _optionalChain([symbol, 'optionalAccess', _879 => _879.declarations, 'optionalAccess', _880 => _880.map, 'call', _881 => _881((d) => d.resolve())]); if (!declarations || declarations.length === 0) { return false; } - return declarations.every((d) => d.kind === _ast.SyntaxKind.MethodSignature && d.body === void 0 && _optionalChain([d, 'access', _870 => _870.parent, 'optionalAccess', _871 => _871.kind]) === _ast.SyntaxKind.InterfaceDeclaration); + return declarations.every((d) => d.kind === _ast.SyntaxKind.MethodSignature && d.body === void 0 && _optionalChain([d, 'access', _882 => _882.parent, 'optionalAccess', _883 => _883.kind]) === _ast.SyntaxKind.InterfaceDeclaration); } // true when the printed value of this expression is never a *T whose nil // derefScalar folds to nil (nor a *sync.Map): null/undefined, an object/array @@ -10323,6 +10442,9 @@ ${this.getIden(identation)}PanicOnError(${varName})`; if (expr === void 0) { return true; } + if (this.goG02NonPointerAccessorSource(expr)) { + return true; + } switch (expr.kind) { case _ast.SyntaxKind.NullKeyword: return true; @@ -10344,7 +10466,7 @@ ${this.getIden(identation)}PanicOnError(${varName})`; return false; } goAnyLocalHoldsNonPointer(decl) { - if (_optionalChain([decl, 'optionalAccess', _872 => _872.kind]) !== _ast.SyntaxKind.VariableDeclaration || _optionalChain([decl, 'access', _873 => _873.name, 'optionalAccess', _874 => _874.kind]) !== _ast.SyntaxKind.Identifier) { + if (_optionalChain([decl, 'optionalAccess', _884 => _884.kind]) !== _ast.SyntaxKind.VariableDeclaration || _optionalChain([decl, 'access', _885 => _885.name, 'optionalAccess', _886 => _886.kind]) !== _ast.SyntaxKind.Identifier) { return false; } if (this.goAnyLocalHoldsNonPointerCache.has(decl)) { @@ -10361,7 +10483,7 @@ ${this.getIden(identation)}PanicOnError(${varName})`; if (!holds) { return; } - if (n.kind === _ast.SyntaxKind.BinaryExpression && _optionalChain([n, 'access', _875 => _875.operatorToken, 'optionalAccess', _876 => _876.kind]) === _ast.SyntaxKind.EqualsToken && this.goAssignmentWritesName(n.left, name) && !this.goIsNonPointerValueSource(n.right)) { + if (n.kind === _ast.SyntaxKind.BinaryExpression && _optionalChain([n, 'access', _887 => _887.operatorToken, 'optionalAccess', _888 => _888.kind]) === _ast.SyntaxKind.EqualsToken && this.goAssignmentWritesName(n.left, name) && !this.goIsNonPointerValueSource(n.right)) { holds = false; return; } @@ -10376,17 +10498,17 @@ ${this.getIden(identation)}PanicOnError(${varName})`; // true when this assignment target binds the named local: a plain identifier, or a // destructuring element (`[ a, b ] = …` prints GetValue(, i) writes) goAssignmentWritesName(left, name) { - if (_optionalChain([left, 'optionalAccess', _877 => _877.kind]) === _ast.SyntaxKind.Identifier) { + if (_optionalChain([left, 'optionalAccess', _889 => _889.kind]) === _ast.SyntaxKind.Identifier) { return left.text === name; } - if (_optionalChain([left, 'optionalAccess', _878 => _878.kind]) === _ast.SyntaxKind.ArrayLiteralExpression) { - return left.elements.some((e) => _optionalChain([e, 'optionalAccess', _879 => _879.kind]) === _ast.SyntaxKind.Identifier && e.text === name); + if (_optionalChain([left, 'optionalAccess', _890 => _890.kind]) === _ast.SyntaxKind.ArrayLiteralExpression) { + return left.elements.some((e) => _optionalChain([e, 'optionalAccess', _891 => _891.kind]) === _ast.SyntaxKind.Identifier && e.text === name); } return false; } // the variable declaration an identifier resolves to, when it is one goAnyBoxLocalDeclaration(node) { - if (_optionalChain([node, 'optionalAccess', _880 => _880.kind]) !== _ast.SyntaxKind.Identifier) { + if (_optionalChain([node, 'optionalAccess', _892 => _892.kind]) !== _ast.SyntaxKind.Identifier) { return void 0; } const checker = this.checkerOrUndefined(); @@ -10394,17 +10516,17 @@ ${this.getIden(identation)}PanicOnError(${varName})`; return void 0; } const symbol = checker.getSymbolAtLocation(node); - return _optionalChain([symbol, 'optionalAccess', _881 => _881.valueDeclaration, 'optionalAccess', _882 => _882.resolve, 'call', _883 => _883()]); + return _optionalChain([symbol, 'optionalAccess', _893 => _893.valueDeclaration, 'optionalAccess', _894 => _894.resolve, 'call', _895 => _895()]); } // true when this identifier is a parameter bound by `x := GetArg(optionalArgs, i, default)`: // GetArg runs derefScalar and folds a typed nil pointer (and nil []string/[]any) into the untyped // default, so the box holds a plain scalar or an untyped nil, never a nil *T. goGetArgBoundParameter(node) { const decl = this.goAnyBoxLocalDeclaration(node); - if (_optionalChain([decl, 'optionalAccess', _884 => _884.kind]) !== _ast.SyntaxKind.Parameter || decl.initializer === void 0) { + if (_optionalChain([decl, 'optionalAccess', _896 => _896.kind]) !== _ast.SyntaxKind.Parameter || decl.initializer === void 0) { return false; } - const owner = _optionalChain([decl, 'access', _885 => _885.parent, 'optionalAccess', _886 => _886.kind]); + const owner = _optionalChain([decl, 'access', _897 => _897.parent, 'optionalAccess', _898 => _898.kind]); if (owner !== _ast.SyntaxKind.MethodDeclaration && owner !== _ast.SyntaxKind.FunctionDeclaration && owner !== _ast.SyntaxKind.Constructor) { return false; } @@ -10413,7 +10535,7 @@ ${this.getIden(identation)}PanicOnError(${varName})`; // D2 for a GetArg-bound parameter: a later `x = …` write whose printed value is a typed // pointer puts a nil *T back in the box, where IsEqual(x, nil) is true but `x == nil` is not goParameterLaterWritesPointerBox(decl) { - const name = _optionalChain([decl, 'optionalAccess', _887 => _887.name, 'optionalAccess', _888 => _888.kind]) === _ast.SyntaxKind.Identifier ? decl.name.text : void 0; + const name = _optionalChain([decl, 'optionalAccess', _899 => _899.name, 'optionalAccess', _900 => _900.kind]) === _ast.SyntaxKind.Identifier ? decl.name.text : void 0; if (typeof name !== "string") { return true; } @@ -10426,7 +10548,7 @@ ${this.getIden(identation)}PanicOnError(${varName})`; if (pointerWrite) { return; } - if (n.kind === _ast.SyntaxKind.BinaryExpression && _optionalChain([n, 'access', _889 => _889.operatorToken, 'optionalAccess', _890 => _890.kind]) === _ast.SyntaxKind.EqualsToken && this.goAssignmentWritesName(n.left, name) && this.goWritePrintsPointerBox(n.right)) { + if (n.kind === _ast.SyntaxKind.BinaryExpression && _optionalChain([n, 'access', _901 => _901.operatorToken, 'optionalAccess', _902 => _902.kind]) === _ast.SyntaxKind.EqualsToken && this.goAssignmentWritesName(n.left, name) && this.goWritePrintsPointerBox(n.right)) { pointerWrite = true; return; } @@ -10458,8 +10580,8 @@ ${this.getIden(identation)}PanicOnError(${varName})`; const declared = this.goDeclaredTypeOfIdentifier(expr); return typeof declared === "string" && declared.startsWith("*"); } - if (expr.kind === _ast.SyntaxKind.PropertyAccessExpression && _optionalChain([expr, 'access', _891 => _891.expression, 'optionalAccess', _892 => _892.kind]) === _ast.SyntaxKind.ThisKeyword) { - const fieldType = GO_NILABLE_FIELDS_Typed["this." + _optionalChain([expr, 'access', _893 => _893.name, 'optionalAccess', _894 => _894.text])]; + if (expr.kind === _ast.SyntaxKind.PropertyAccessExpression && _optionalChain([expr, 'access', _903 => _903.expression, 'optionalAccess', _904 => _904.kind]) === _ast.SyntaxKind.ThisKeyword) { + const fieldType = GO_NILABLE_FIELDS_Typed["this." + _optionalChain([expr, 'access', _905 => _905.name, 'optionalAccess', _906 => _906.text])]; return typeof fieldType === "string" && GO_NIL_EQUIVALENT_POINTER_TYPES_Native.has(fieldType); } return false; @@ -10468,7 +10590,7 @@ ${this.getIden(identation)}PanicOnError(${varName})`; if (type === void 0) { return void 0; } - const alias = _optionalChain([type, 'access', _895 => _895.getAliasSymbol, 'call', _896 => _896(), 'optionalAccess', _897 => _897.escapedName]); + const alias = _optionalChain([type, 'access', _907 => _907.getAliasSymbol, 'call', _908 => _908(), 'optionalAccess', _909 => _909.escapedName]); if (!allowNil) { switch (alias) { case "Str": @@ -10514,7 +10636,7 @@ ${this.getIden(identation)}PanicOnError(${varName})`; return void 0; } goNativeParameterType(param) { - if (_optionalChain([param, 'optionalAccess', _898 => _898.kind]) !== _ast.SyntaxKind.Parameter) { + if (_optionalChain([param, 'optionalAccess', _910 => _910.kind]) !== _ast.SyntaxKind.Parameter) { return void 0; } if (this.goNativeParameterTypeCache.has(param)) { @@ -10529,11 +10651,11 @@ ${this.getIden(identation)}PanicOnError(${varName})`; if (param.initializer !== void 0 || param.dotDotDotToken !== void 0) { return void 0; } - if (_optionalChain([param, 'access', _899 => _899.name, 'optionalAccess', _900 => _900.kind]) !== _ast.SyntaxKind.Identifier) { + if (_optionalChain([param, 'access', _911 => _911.name, 'optionalAccess', _912 => _912.kind]) !== _ast.SyntaxKind.Identifier) { return void 0; } const fn = param.parent; - if (_optionalChain([fn, 'optionalAccess', _901 => _901.kind]) !== _ast.SyntaxKind.MethodDeclaration || fn.body === void 0 || _optionalChain([fn, 'access', _902 => _902.name, 'optionalAccess', _903 => _903.kind]) !== _ast.SyntaxKind.Identifier) { + if (_optionalChain([fn, 'optionalAccess', _913 => _913.kind]) !== _ast.SyntaxKind.MethodDeclaration || fn.body === void 0 || _optionalChain([fn, 'access', _914 => _914.name, 'optionalAccess', _915 => _915.kind]) !== _ast.SyntaxKind.Identifier) { return void 0; } const parseParam = fn.name.text.startsWith("parse"); @@ -10550,7 +10672,7 @@ ${this.getIden(identation)}PanicOnError(${varName})`; const index = fn.parameters.indexOf(param); if (!parseParam && !handlerParam) { const goType = this.goRequiredStringParameterType(param); - return goType !== void 0 && this.goHasTreeCallSite(fn) && this.goParameterCallSitesPassType(fn, index, goType) && this.goLocalIsSafeToType(fn.body, param, param.name.text, goType) && this.goParameterKeepsNilCompareNative(fn.body, param, goType) ? goType : void 0; + return goType !== void 0 && this.goHasTreeCallSite(fn) && this.goParameterCallSitesPassType(fn, index, goType) && this.goLocalIsSafeToType(fn.body, param, param.name.text, goType) && this.goParameterKeepsNilCompareNative(fn.body, param, goType) ? goType : this.g11NativeParameterType(fn, param, index); } if (this.isAsyncFunction(fn)) { return void 0; @@ -10560,7 +10682,7 @@ ${this.getIden(identation)}PanicOnError(${varName})`; return goType; } } - return void 0; + return handlerParam ? void 0 : this.g11NativeParameterType(fn, param, index); } goIsUnifiedStringParameter(methodName, index) { const indexes = Object.prototype.hasOwnProperty.call(this.unifiedStringParams, methodName) ? this.unifiedStringParams[methodName] : void 0; @@ -10570,7 +10692,7 @@ ${this.getIden(identation)}PanicOnError(${varName})`; // printer cannot prove a Go string goes through StringArg, which panics on any other value goUnifiedStringCallArgs(node, identation, flat = false) { const callee = node.expression; - const name = _optionalChain([callee, 'optionalAccess', _904 => _904.kind]) === _ast.SyntaxKind.PropertyAccessExpression ? _optionalChain([callee, 'access', _905 => _905.name, 'optionalAccess', _906 => _906.text]) : void 0; + const name = _optionalChain([callee, 'optionalAccess', _916 => _916.kind]) === _ast.SyntaxKind.PropertyAccessExpression ? _optionalChain([callee, 'access', _917 => _917.name, 'optionalAccess', _918 => _918.text]) : void 0; if (typeof name !== "string" || !Object.prototype.hasOwnProperty.call(this.unifiedStringParams, name)) { return void 0; } @@ -10590,7 +10712,7 @@ ${this.getIden(identation)}PanicOnError(${varName})`; // `string` for a parameter whose declared TS type is string (or a string-literal union) with no // undefined/null member; a nullable one stays boxed here (callers pass *string or nil) goRequiredStringParameterType(param) { - const type = _optionalChain([this, 'access', _907 => _907.checkerOrUndefined, 'call', _908 => _908(), 'optionalAccess', _909 => _909.getTypeAtLocation, 'call', _910 => _910(param)]); + const type = _optionalChain([this, 'access', _919 => _919.checkerOrUndefined, 'call', _920 => _920(), 'optionalAccess', _921 => _921.getTypeAtLocation, 'call', _922 => _922(param)]); if (type === void 0) { return void 0; } @@ -10618,11 +10740,11 @@ ${this.getIden(identation)}PanicOnError(${varName})`; symbol = void 0; } const binary = n.parent; - if (_optionalChain([symbol, 'optionalAccess', _911 => _911.valueDeclaration, 'optionalAccess', _912 => _912.resolve, 'call', _913 => _913()]) === param && _optionalChain([binary, 'optionalAccess', _914 => _914.kind]) === _ast.SyntaxKind.BinaryExpression && (binary.left === n || binary.right === n)) { - const op = _optionalChain([binary, 'access', _915 => _915.operatorToken, 'optionalAccess', _916 => _916.kind]); + if (_optionalChain([symbol, 'optionalAccess', _923 => _923.valueDeclaration, 'optionalAccess', _924 => _924.resolve, 'call', _925 => _925()]) === param && _optionalChain([binary, 'optionalAccess', _926 => _926.kind]) === _ast.SyntaxKind.BinaryExpression && (binary.left === n || binary.right === n)) { + const op = _optionalChain([binary, 'access', _927 => _927.operatorToken, 'optionalAccess', _928 => _928.kind]); if (op === _ast.SyntaxKind.EqualsEqualsToken || op === _ast.SyntaxKind.EqualsEqualsEqualsToken || op === _ast.SyntaxKind.ExclamationEqualsToken || op === _ast.SyntaxKind.ExclamationEqualsEqualsToken) { const other = binary.left === n ? binary.right : binary.left; - if (_optionalChain([other, 'optionalAccess', _917 => _917.kind]) === _ast.SyntaxKind.NullKeyword || _optionalChain([other, 'optionalAccess', _918 => _918.kind]) === _ast.SyntaxKind.Identifier && other.text === "undefined") { + if (_optionalChain([other, 'optionalAccess', _929 => _929.kind]) === _ast.SyntaxKind.NullKeyword || _optionalChain([other, 'optionalAccess', _930 => _930.kind]) === _ast.SyntaxKind.Identifier && other.text === "undefined") { keeps = false; return; } @@ -10660,7 +10782,7 @@ ${this.getIden(identation)}PanicOnError(${varName})`; // builds them from, `List` (= any[]) as its `[]any`; pro `handle*` frames (isHandler) goNativeParameterTypeCandidates(param, isHandler = false) { const checker = this.checkerOrUndefined(); - const type = _optionalChain([checker, 'optionalAccess', _919 => _919.getTypeAtLocation, 'call', _920 => _920(param)]); + const type = _optionalChain([checker, 'optionalAccess', _931 => _931.getTypeAtLocation, 'call', _932 => _932(param)]); if (type === void 0) { return []; } @@ -10708,7 +10830,7 @@ ${this.getIden(identation)}PanicOnError(${varName})`; for (const expr of _nullishCoalesce(clause.types, () => ( []))) { const checker = this.checkerOrUndefined(); const baseType = checker.getTypeAtLocation(expr); - if (_optionalChain([baseType, 'optionalAccess', _921 => _921.getProperty, 'optionalCall', _922 => _922(name)]) !== void 0) { + if (_optionalChain([baseType, 'optionalAccess', _933 => _933.getProperty, 'optionalCall', _934 => _934(name)]) !== void 0) { return true; } } @@ -10722,13 +10844,13 @@ ${this.getIden(identation)}PanicOnError(${varName})`; } const tree = this.goTsSrcTree(fn.getSourceFile()); const myClass = this.goEnclosingClassName(fn); - return (_nullishCoalesce(_optionalChain([tree, 'optionalAccess', _923 => _923.callIndex, 'access', _924 => _924.get, 'call', _925 => _925(name)]), () => ( []))).some((site) => this.goTsSrcFileDerivesFrom(tree, site.file, myClass)); + return (_nullishCoalesce(_optionalChain([tree, 'optionalAccess', _935 => _935.callIndex, 'access', _936 => _936.get, 'call', _937 => _937(name)]), () => ( []))).some((site) => this.goTsSrcFileDerivesFrom(tree, site.file, myClass)); } // every call site of `fn` in the whole tree must pass exactly `goType` at `index` goParameterCallSitesPassType(fn, index, goType) { const name = fn.name.text; for (const call of this.goSameFileCallsOf(fn, name)) { - const arg = _optionalChain([call, 'access', _926 => _926.arguments, 'optionalAccess', _927 => _927[index]]); + const arg = _optionalChain([call, 'access', _938 => _938.arguments, 'optionalAccess', _939 => _939[index]]); if (arg === void 0 || arg.kind === _ast.SyntaxKind.SpreadElement) { return false; } @@ -10764,7 +10886,7 @@ ${this.getIden(identation)}PanicOnError(${varName})`; } goEnclosingClassName(fn) { const cls = this.goEnclosingClass(fn); - return _optionalChain([cls, 'optionalAccess', _928 => _928.name, 'optionalAccess', _929 => _929.kind]) === _ast.SyntaxKind.Identifier ? cls.name.text : void 0; + return _optionalChain([cls, 'optionalAccess', _940 => _940.name, 'optionalAccess', _941 => _941.kind]) === _ast.SyntaxKind.Identifier ? cls.name.text : void 0; } // the printed Go type of a call-site argument, or undefined when the printer // cannot name it (then the call site does not prove anything) @@ -10783,7 +10905,7 @@ ${this.getIden(identation)}PanicOnError(${varName})`; const visit = (node) => { if (node.kind === _ast.SyntaxKind.CallExpression) { const callee = node.expression; - const calleeName = _optionalChain([callee, 'optionalAccess', _930 => _930.kind]) === _ast.SyntaxKind.PropertyAccessExpression ? _optionalChain([callee, 'access', _931 => _931.name, 'optionalAccess', _932 => _932.text]) : void 0; + const calleeName = _optionalChain([callee, 'optionalAccess', _942 => _942.kind]) === _ast.SyntaxKind.PropertyAccessExpression ? _optionalChain([callee, 'access', _943 => _943.name, 'optionalAccess', _944 => _944.text]) : void 0; if (typeof calleeName === "string") { const list = _nullishCoalesce(index.get(calleeName), () => ( [])); list.push(node); @@ -10800,7 +10922,7 @@ ${this.getIden(identation)}PanicOnError(${varName})`; for (const call of _nullishCoalesce(index.get(name), () => ( []))) { let declaration; try { - declaration = _optionalChain([checker, 'access', _933 => _933.getResolvedSignature, 'call', _934 => _934(call), 'optionalAccess', _935 => _935.declaration, 'optionalAccess', _936 => _936.resolve, 'call', _937 => _937()]); + declaration = _optionalChain([checker, 'access', _945 => _945.getResolvedSignature, 'call', _946 => _946(call), 'optionalAccess', _947 => _947.declaration, 'optionalAccess', _948 => _948.resolve, 'call', _949 => _949()]); } catch (e) { declaration = void 0; } @@ -10934,10 +11056,10 @@ ${this.getIden(identation)}PanicOnError(${varName})`; return false; } goDeclaredTypeOfIdentifier(node) { - if (_optionalChain([node, 'optionalAccess', _938 => _938.kind]) !== _ast.SyntaxKind.Identifier) { + if (_optionalChain([node, 'optionalAccess', _950 => _950.kind]) !== _ast.SyntaxKind.Identifier) { return void 0; } - const decl = _optionalChain([this, 'access', _939 => _939.checkerOrUndefined, 'call', _940 => _940(), 'optionalAccess', _941 => _941.getSymbolAtLocation, 'call', _942 => _942(node), 'optionalAccess', _943 => _943.valueDeclaration, 'optionalAccess', _944 => _944.resolve, 'call', _945 => _945()]); + const decl = _optionalChain([this, 'access', _951 => _951.checkerOrUndefined, 'call', _952 => _952(), 'optionalAccess', _953 => _953.getSymbolAtLocation, 'call', _954 => _954(node), 'optionalAccess', _955 => _955.valueDeclaration, 'optionalAccess', _956 => _956.resolve, 'call', _957 => _957()]); if (decl === void 0) { return void 0; } @@ -10948,7 +11070,7 @@ ${this.getIden(identation)}PanicOnError(${varName})`; } return this.goNativeParameterType(decl); } - if (decl.kind !== _ast.SyntaxKind.VariableDeclaration || decl.initializer === void 0 || _optionalChain([decl, 'access', _946 => _946.name, 'optionalAccess', _947 => _947.kind]) !== _ast.SyntaxKind.Identifier) { + if (decl.kind !== _ast.SyntaxKind.VariableDeclaration || decl.initializer === void 0 || _optionalChain([decl, 'access', _958 => _958.name, 'optionalAccess', _959 => _959.kind]) !== _ast.SyntaxKind.Identifier) { return void 0; } if (this.goDeclaredTypeCache.has(decl)) { @@ -10981,13 +11103,13 @@ ${this.getIden(identation)}PanicOnError(${varName})`; if (typeof declared === "string" && declared.startsWith("*")) { return declared; } - if (_optionalChain([node, 'optionalAccess', _948 => _948.kind]) === _ast.SyntaxKind.PropertyAccessExpression) { + if (_optionalChain([node, 'optionalAccess', _960 => _960.kind]) === _ast.SyntaxKind.PropertyAccessExpression) { const fieldType = GO_NILABLE_FIELDS_Typed[printedText]; if (typeof fieldType === "string" && GO_NIL_EQUIVALENT_POINTER_TYPES_Native.has(fieldType)) { return fieldType; } } - if (_optionalChain([node, 'optionalAccess', _949 => _949.kind]) === _ast.SyntaxKind.CallExpression) { + if (_optionalChain([node, 'optionalAccess', _961 => _961.kind]) === _ast.SyntaxKind.CallExpression) { const goType = this.goTypeOfInitializer(node, printedText); if (typeof goType === "string" && goType.startsWith("*")) { return goType; @@ -11004,7 +11126,7 @@ ${this.getIden(identation)}PanicOnError(${varName})`; if (declared === "map[string]any" || declared === "[]any") { return declared; } - if (_optionalChain([node, 'optionalAccess', _950 => _950.kind]) === _ast.SyntaxKind.CallExpression) { + if (_optionalChain([node, 'optionalAccess', _962 => _962.kind]) === _ast.SyntaxKind.CallExpression) { const known = this.goTypeOfInitializer(node, printedText); if (known === "map[string]any" || known === "[]any") { return known; @@ -11016,10 +11138,10 @@ ${this.getIden(identation)}PanicOnError(${varName})`; // shape. Generated structs embed BaseExchange, so `this.` is the only property access the // field table types — a local or parameter of the same name is a different declaration. goFieldContainerTypeNative(node) { - if (_optionalChain([node, 'optionalAccess', _951 => _951.kind]) !== _ast.SyntaxKind.PropertyAccessExpression || _optionalChain([node, 'access', _952 => _952.expression, 'optionalAccess', _953 => _953.kind]) !== _ast.SyntaxKind.ThisKeyword) { + if (_optionalChain([node, 'optionalAccess', _963 => _963.kind]) !== _ast.SyntaxKind.PropertyAccessExpression || _optionalChain([node, 'access', _964 => _964.expression, 'optionalAccess', _965 => _965.kind]) !== _ast.SyntaxKind.ThisKeyword) { return void 0; } - const name = _optionalChain([node, 'access', _954 => _954.name, 'optionalAccess', _955 => _955.text]); + const name = _optionalChain([node, 'access', _966 => _966.name, 'optionalAccess', _967 => _967.text]); if (typeof name !== "string") { return void 0; } @@ -11038,19 +11160,19 @@ ${this.getIden(identation)}PanicOnError(${varName})`; // literal initializer covers and nothing rebinds the local: the helper silently // ignores an out-of-range index, while Go panics on the assignment. goSliceIndexProvablyInRange(node, indexNode) { - if (_optionalChain([node, 'optionalAccess', _956 => _956.kind]) !== _ast.SyntaxKind.Identifier || _optionalChain([indexNode, 'optionalAccess', _957 => _957.kind]) !== _ast.SyntaxKind.NumericLiteral) { + if (_optionalChain([node, 'optionalAccess', _968 => _968.kind]) !== _ast.SyntaxKind.Identifier || _optionalChain([indexNode, 'optionalAccess', _969 => _969.kind]) !== _ast.SyntaxKind.NumericLiteral) { return false; } const index = Number(indexNode.text); if (!Number.isInteger(index) || index < 0) { return false; } - const decl = _optionalChain([this, 'access', _958 => _958.checkerOrUndefined, 'call', _959 => _959(), 'optionalAccess', _960 => _960.getSymbolAtLocation, 'call', _961 => _961(node), 'optionalAccess', _962 => _962.valueDeclaration, 'optionalAccess', _963 => _963.resolve, 'call', _964 => _964()]); - if (decl === void 0 || decl.kind !== _ast.SyntaxKind.VariableDeclaration || _optionalChain([decl, 'access', _965 => _965.name, 'optionalAccess', _966 => _966.kind]) !== _ast.SyntaxKind.Identifier) { + const decl = _optionalChain([this, 'access', _970 => _970.checkerOrUndefined, 'call', _971 => _971(), 'optionalAccess', _972 => _972.getSymbolAtLocation, 'call', _973 => _973(node), 'optionalAccess', _974 => _974.valueDeclaration, 'optionalAccess', _975 => _975.resolve, 'call', _976 => _976()]); + if (decl === void 0 || decl.kind !== _ast.SyntaxKind.VariableDeclaration || _optionalChain([decl, 'access', _977 => _977.name, 'optionalAccess', _978 => _978.kind]) !== _ast.SyntaxKind.Identifier) { return false; } const initializer = decl.initializer; - if (_optionalChain([initializer, 'optionalAccess', _967 => _967.kind]) !== _ast.SyntaxKind.ArrayLiteralExpression || initializer.elements.length <= index) { + if (_optionalChain([initializer, 'optionalAccess', _979 => _979.kind]) !== _ast.SyntaxKind.ArrayLiteralExpression || initializer.elements.length <= index) { return false; } return !this.goLocalIsRebound(this.goEnclosingFunction(decl), decl.name); @@ -11083,14 +11205,14 @@ ${this.getIden(identation)}PanicOnError(${varName})`; goRebindingTargetOf(identifier) { let node = identifier; let parent = node.parent; - while (_optionalChain([parent, 'optionalAccess', _968 => _968.kind]) === _ast.SyntaxKind.ArrayLiteralExpression) { + while (_optionalChain([parent, 'optionalAccess', _980 => _980.kind]) === _ast.SyntaxKind.ArrayLiteralExpression) { node = parent; parent = parent.parent; } - if (_optionalChain([parent, 'optionalAccess', _969 => _969.kind]) === _ast.SyntaxKind.ForOfStatement && parent.initializer === node) { + if (_optionalChain([parent, 'optionalAccess', _981 => _981.kind]) === _ast.SyntaxKind.ForOfStatement && parent.initializer === node) { return parent; } - if (_optionalChain([parent, 'optionalAccess', _970 => _970.kind]) === _ast.SyntaxKind.BinaryExpression && parent.left === node) { + if (_optionalChain([parent, 'optionalAccess', _982 => _982.kind]) === _ast.SyntaxKind.BinaryExpression && parent.left === node) { const op = parent.operatorToken.kind; if (op === _ast.SyntaxKind.EqualsToken || op >= _ast.SyntaxKind.FirstCompoundAssignment && op <= _ast.SyntaxKind.LastCompoundAssignment) { return parent; @@ -11131,36 +11253,36 @@ ${this.getIden(identation)}PanicOnError(${varName})`; // a `*string` local the enclosing control flow proves non-nil: the helper's deref // yields the same string key (a nil key would have made it a no-op) goIsNilGuardedStringPointerKey(keyNode) { - return _optionalChain([keyNode, 'optionalAccess', _971 => _971.kind]) === _ast.SyntaxKind.Identifier && this.goDeclaredTypeOfIdentifier(keyNode) === "*string" && this.goHasEnclosingNilGuard(keyNode); + return _optionalChain([keyNode, 'optionalAccess', _983 => _983.kind]) === _ast.SyntaxKind.Identifier && this.goDeclaredTypeOfIdentifier(keyNode) === "*string" && this.goHasEnclosingNilGuard(keyNode); } // a local bound once to an object literal, never read by a nested function and not handed // out (anything but `m[k]`) before this write: no other goroutine can hold the map yet goIsFreshUnsharedMapLocal(node, writeSite) { - if (_optionalChain([node, 'optionalAccess', _972 => _972.kind]) !== _ast.SyntaxKind.Identifier) { + if (_optionalChain([node, 'optionalAccess', _984 => _984.kind]) !== _ast.SyntaxKind.Identifier) { return false; } - const decl = _optionalChain([this, 'access', _973 => _973.checkerOrUndefined, 'call', _974 => _974(), 'optionalAccess', _975 => _975.getSymbolAtLocation, 'call', _976 => _976(node), 'optionalAccess', _977 => _977.valueDeclaration, 'optionalAccess', _978 => _978.resolve, 'call', _979 => _979()]); - if (_optionalChain([decl, 'optionalAccess', _980 => _980.kind]) !== _ast.SyntaxKind.VariableDeclaration || _optionalChain([decl, 'access', _981 => _981.name, 'optionalAccess', _982 => _982.kind]) !== _ast.SyntaxKind.Identifier || _optionalChain([decl, 'access', _983 => _983.initializer, 'optionalAccess', _984 => _984.kind]) !== _ast.SyntaxKind.ObjectLiteralExpression) { + const decl = _optionalChain([this, 'access', _985 => _985.checkerOrUndefined, 'call', _986 => _986(), 'optionalAccess', _987 => _987.getSymbolAtLocation, 'call', _988 => _988(node), 'optionalAccess', _989 => _989.valueDeclaration, 'optionalAccess', _990 => _990.resolve, 'call', _991 => _991()]); + if (_optionalChain([decl, 'optionalAccess', _992 => _992.kind]) !== _ast.SyntaxKind.VariableDeclaration || _optionalChain([decl, 'access', _993 => _993.name, 'optionalAccess', _994 => _994.kind]) !== _ast.SyntaxKind.Identifier || _optionalChain([decl, 'access', _995 => _995.initializer, 'optionalAccess', _996 => _996.kind]) !== _ast.SyntaxKind.ObjectLiteralExpression) { return false; } const scope = this.goEnclosingFunction(decl); if (scope === void 0 || scope.kind === _ast.SyntaxKind.SourceFile || this.goLocalIsRebound(scope, decl.name)) { return false; } - const symbol = _optionalChain([this, 'access', _985 => _985.checkerOrUndefined, 'call', _986 => _986(), 'optionalAccess', _987 => _987.getSymbolAtLocation, 'call', _988 => _988(decl.name)]); + const symbol = _optionalChain([this, 'access', _997 => _997.checkerOrUndefined, 'call', _998 => _998(), 'optionalAccess', _999 => _999.getSymbolAtLocation, 'call', _1000 => _1000(decl.name)]); let captured = false; const visit = (n, nested) => { if (captured) { return; } - if (n.kind === _ast.SyntaxKind.Identifier && n !== decl.name && n.text === decl.name.text && _optionalChain([this, 'access', _989 => _989.checkerOrUndefined, 'call', _990 => _990(), 'optionalAccess', _991 => _991.getSymbolAtLocation, 'call', _992 => _992(n)]) === symbol) { - const receiver = _optionalChain([n, 'access', _993 => _993.parent, 'optionalAccess', _994 => _994.kind]) === _ast.SyntaxKind.ElementAccessExpression && n.parent.expression === n; + if (n.kind === _ast.SyntaxKind.Identifier && n !== decl.name && n.text === decl.name.text && _optionalChain([this, 'access', _1001 => _1001.checkerOrUndefined, 'call', _1002 => _1002(), 'optionalAccess', _1003 => _1003.getSymbolAtLocation, 'call', _1004 => _1004(n)]) === symbol) { + const receiver = _optionalChain([n, 'access', _1005 => _1005.parent, 'optionalAccess', _1006 => _1006.kind]) === _ast.SyntaxKind.ElementAccessExpression && n.parent.expression === n; if (nested || !receiver && this.goUseMayPrecede(n, writeSite, scope)) { captured = true; } return; } - const inner = nested || _chunk4FDYB2TTcjs.isFunctionLike.call(void 0, n); + const inner = nested || _chunkUBXMRIM6cjs.isFunctionLike.call(void 0, n); n.forEachChild((c) => visit(c, inner)); }; scope.forEachChild((c) => visit(c, false)); @@ -11182,7 +11304,7 @@ ${this.getIden(identation)}PanicOnError(${varName})`; // leaves it unchanged; an `any` box or a pointer keeps the helper goIsNonPointerValue(valueNode) { const inner = this.goUnwrapParenthesizedNode(valueNode); - switch (_optionalChain([inner, 'optionalAccess', _995 => _995.kind])) { + switch (_optionalChain([inner, 'optionalAccess', _1007 => _1007.kind])) { case _ast.SyntaxKind.StringLiteral: case _ast.SyntaxKind.NoSubstitutionTemplateLiteral: case _ast.SyntaxKind.TrueKeyword: @@ -11202,8 +11324,8 @@ ${this.getIden(identation)}PanicOnError(${varName})`; // stays inside an `any` box — a native Go operation on an `any` box would not // compile, so every rule below falls back to its helper in that case. goPrintedTypeOfExpression(node, printedText) { - const inner = _optionalChain([node, 'optionalAccess', _996 => _996.kind]) === _ast.SyntaxKind.ParenthesizedExpression ? node.expression : node; - if (_optionalChain([inner, 'optionalAccess', _997 => _997.kind]) === _ast.SyntaxKind.Identifier) { + const inner = _optionalChain([node, 'optionalAccess', _1008 => _1008.kind]) === _ast.SyntaxKind.ParenthesizedExpression ? node.expression : node; + if (_optionalChain([inner, 'optionalAccess', _1009 => _1009.kind]) === _ast.SyntaxKind.Identifier) { return this.goDeclaredTypeOfIdentifier(inner); } return this.goTypeOfInitializer(inner, printedText); @@ -11238,10 +11360,10 @@ ${this.getIden(identation)}PanicOnError(${varName})`; // (build/go-local-types.js, CCXT_GO_INT_OPERAND_CALLEES) names `GetArrayLength(`/`GetLength(` an // `int` operand, so inlining `len` would declassify the chain's int64 local and `.(int64)` unbox. goLengthFeedsArithmeticClassifier(lengthNode) { - let current = _optionalChain([lengthNode, 'optionalAccess', _998 => _998.parent]); + let current = _optionalChain([lengthNode, 'optionalAccess', _1010 => _1010.parent]); for (let i = 0; i < 16 && current !== void 0; i++) { if (current.kind === _ast.SyntaxKind.BinaryExpression) { - const op = _optionalChain([current, 'access', _999 => _999.operatorToken, 'optionalAccess', _1000 => _1000.kind]); + const op = _optionalChain([current, 'access', _1011 => _1011.operatorToken, 'optionalAccess', _1012 => _1012.kind]); if (op === _ast.SyntaxKind.MinusToken || op === _ast.SyntaxKind.AsteriskToken || op === _ast.SyntaxKind.SlashToken || op === _ast.SyntaxKind.PercentToken) { return true; } @@ -11287,8 +11409,8 @@ ${this.getIden(level)}}()`; // signature returns it. A classifier-named box (`Subtract(...)`) cannot be carried by `return`. goTernaryArmType(node, printedText) { const text = this.goUnwrapPrintedParens(printedText); - const inner = _optionalChain([node, 'optionalAccess', _1001 => _1001.kind]) === _ast.SyntaxKind.ParenthesizedExpression ? node.expression : node; - switch (_optionalChain([inner, 'optionalAccess', _1002 => _1002.kind])) { + const inner = _optionalChain([node, 'optionalAccess', _1013 => _1013.kind]) === _ast.SyntaxKind.ParenthesizedExpression ? node.expression : node; + switch (_optionalChain([inner, 'optionalAccess', _1014 => _1014.kind])) { case _ast.SyntaxKind.StringLiteral: case _ast.SyntaxKind.NoSubstitutionTemplateLiteral: return "string"; @@ -11357,7 +11479,7 @@ ${this.getIden(level)}}()`; return void 0; } if (this.goPrintedTypeOfExpression(keyNode, keyText) !== "string") { - if (_optionalChain([keyNode, 'optionalAccess', _1003 => _1003.kind]) !== _ast.SyntaxKind.Identifier || this.goDeclaredTypeOfIdentifier(keyNode) !== "*string") { + if (_optionalChain([keyNode, 'optionalAccess', _1015 => _1015.kind]) !== _ast.SyntaxKind.Identifier || this.goDeclaredTypeOfIdentifier(keyNode) !== "*string") { return void 0; } const level2 = this.goStatementLevel; @@ -11396,13 +11518,13 @@ ${this.getIden(level)}}()`; return `-${printedText}`; } const parent = node.parent; - if (_optionalChain([parent, 'optionalAccess', _1004 => _1004.kind]) === _ast.SyntaxKind.CallExpression) { + if (_optionalChain([parent, 'optionalAccess', _1016 => _1016.kind]) === _ast.SyntaxKind.CallExpression) { const callee = this.printNode(parent.expression, 0); if (this.comparisonHelpers.indexOf(callee) >= 0) { return `-${printedText}`; } } - if (_optionalChain([parent, 'optionalAccess', _1005 => _1005.kind]) === _ast.SyntaxKind.BinaryExpression) { + if (_optionalChain([parent, 'optionalAccess', _1017 => _1017.kind]) === _ast.SyntaxKind.BinaryExpression) { const op = parent.operatorToken.kind; if (op === _ast.SyntaxKind.GreaterThanToken || op === _ast.SyntaxKind.GreaterThanEqualsToken || op === _ast.SyntaxKind.LessThanToken || op === _ast.SyntaxKind.LessThanEqualsToken) { return `-${printedText}`; @@ -11416,7 +11538,7 @@ ${this.getIden(level)}}()`; // matching `EvalTruthy` case exactly, including nil (a nil *T and a nil map are // both falsy) — so this is the same predicate, minus the interface round-trip. printInlineTruthy(node) { - if (_optionalChain([node, 'optionalAccess', _1006 => _1006.kind]) !== _ast.SyntaxKind.Identifier) { + if (_optionalChain([node, 'optionalAccess', _1018 => _1018.kind]) !== _ast.SyntaxKind.Identifier) { return void 0; } const goType = this.goDeclaredTypeOfIdentifier(node); @@ -11457,11 +11579,11 @@ ${this.getIden(level)}}()`; } let declaration; try { - declaration = _optionalChain([this, 'access', _1007 => _1007.getChecker, 'call', _1008 => _1008(), 'access', _1009 => _1009.getSymbolAtLocation, 'call', _1010 => _1010(node), 'optionalAccess', _1011 => _1011.valueDeclaration, 'optionalAccess', _1012 => _1012.resolve, 'call', _1013 => _1013()]); + declaration = _optionalChain([this, 'access', _1019 => _1019.getChecker, 'call', _1020 => _1020(), 'access', _1021 => _1021.getSymbolAtLocation, 'call', _1022 => _1022(node), 'optionalAccess', _1023 => _1023.valueDeclaration, 'optionalAccess', _1024 => _1024.resolve, 'call', _1025 => _1025()]); } catch (e) { return void 0; } - if (_optionalChain([declaration, 'optionalAccess', _1014 => _1014.kind]) !== _ast.SyntaxKind.VariableDeclaration && !this.goGetArgBoundParameter(node)) { + if (_optionalChain([declaration, 'optionalAccess', _1026 => _1026.kind]) !== _ast.SyntaxKind.VariableDeclaration && !this.goGetArgBoundParameter(node)) { return void 0; } const text = this.printNode(node, 0); @@ -11474,7 +11596,7 @@ ${this.getIden(level)}}()`; // nil for an absent flag and the flag otherwise — exactly the two states // `derefScalar` hands the helper — so the predicate is `x != nil && *x`. printInlineBoolPointerTruthy(node, printedText) { - if (_optionalChain([node, 'optionalAccess', _1015 => _1015.kind]) !== _ast.SyntaxKind.CallExpression) { + if (_optionalChain([node, 'optionalAccess', _1027 => _1027.kind]) !== _ast.SyntaxKind.CallExpression) { return void 0; } if (GO_PURE_BOOL_ACCESSORS.indexOf(this.goPrintedCallee(printedText)) < 0) { @@ -11488,23 +11610,23 @@ ${this.getIden(level)}}()`; // an argument the two halves of a pointer deref may read twice: a plain // identifier/literal read, or a `this.` read of the exchange instance goIsRepeatSafePointerArgument(node) { - while (_optionalChain([node, 'optionalAccess', _1016 => _1016.kind]) === _ast.SyntaxKind.ParenthesizedExpression) { + while (_optionalChain([node, 'optionalAccess', _1028 => _1028.kind]) === _ast.SyntaxKind.ParenthesizedExpression) { node = node.expression; } if (this.goIsReadOnlyCallArgument(node)) { return true; } - return _optionalChain([node, 'optionalAccess', _1017 => _1017.kind]) === _ast.SyntaxKind.PropertyAccessExpression && _optionalChain([node, 'access', _1018 => _1018.expression, 'optionalAccess', _1019 => _1019.kind]) === _ast.SyntaxKind.ThisKeyword && _optionalChain([node, 'access', _1020 => _1020.name, 'optionalAccess', _1021 => _1021.kind]) === _ast.SyntaxKind.Identifier; + return _optionalChain([node, 'optionalAccess', _1029 => _1029.kind]) === _ast.SyntaxKind.PropertyAccessExpression && _optionalChain([node, 'access', _1030 => _1030.expression, 'optionalAccess', _1031 => _1031.kind]) === _ast.SyntaxKind.ThisKeyword && _optionalChain([node, 'access', _1032 => _1032.name, 'optionalAccess', _1033 => _1033.kind]) === _ast.SyntaxKind.Identifier; } // the native Go text for a condition operand the printer can type, or undefined // when the operand has to go through the truthiness helper. `(x)` is decided on // its operand and keeps the source parentheses, so the surrounding operator still // parses exactly the same way. goNativeCondition(node) { - if (_optionalChain([node, 'optionalAccess', _1022 => _1022.kind]) === _ast.SyntaxKind.Identifier) { + if (_optionalChain([node, 'optionalAccess', _1034 => _1034.kind]) === _ast.SyntaxKind.Identifier) { return _nullishCoalesce(this.printInlineTruthy(node), () => ( this.printInlineBoolBoxTruthy(node))); } - if (_optionalChain([node, 'optionalAccess', _1023 => _1023.kind]) === _ast.SyntaxKind.ParenthesizedExpression) { + if (_optionalChain([node, 'optionalAccess', _1035 => _1035.kind]) === _ast.SyntaxKind.ParenthesizedExpression) { const inner = this.goNativeCondition(node.expression); if (inner === void 0) { return void 0; @@ -11519,7 +11641,7 @@ ${this.getIden(level)}}()`; if (this.goTypeOfInitializer(node, printed) === "bool") { return printed; } - if (_optionalChain([node, 'optionalAccess', _1024 => _1024.kind]) === _ast.SyntaxKind.CallExpression && (printed === "true" || printed === "false")) { + if (_optionalChain([node, 'optionalAccess', _1036 => _1036.kind]) === _ast.SyntaxKind.CallExpression && (printed === "true" || printed === "false")) { return printed; } if (GO_BOOL_FIELDS.has(printed)) { @@ -11559,8 +11681,8 @@ ${this.getIden(level)}}()`; // the expression a Go `if`/`for`/`switch` statement tests, the only positions // gofmt's controlClause() rewrites goIsControlClauseCondition(node) { - const parent = _optionalChain([node, 'optionalAccess', _1025 => _1025.parent]); - switch (_optionalChain([parent, 'optionalAccess', _1026 => _1026.kind])) { + const parent = _optionalChain([node, 'optionalAccess', _1037 => _1037.parent]); + switch (_optionalChain([parent, 'optionalAccess', _1038 => _1038.kind])) { case _ast.SyntaxKind.IfStatement: case _ast.SyntaxKind.WhileStatement: case _ast.SyntaxKind.SwitchStatement: @@ -11692,7 +11814,7 @@ ${this.getIden(level)}}()`; const memo = this.goBinaryMemo ??= /* @__PURE__ */ new Map(); try { let byKey = memo.get(node); - if (_optionalChain([byKey, 'optionalAccess', _1027 => _1027.has, 'call', _1028 => _1028(key)])) { + if (_optionalChain([byKey, 'optionalAccess', _1039 => _1039.has, 'call', _1040 => _1040(key)])) { const cached = byKey.get(key); return cached; } @@ -11721,7 +11843,7 @@ ${this.getIden(level)}}()`; this.className = "undefined"; return this.printSourceFileStatements(node, identation); } - if (_optionalChain([node, 'optionalAccess', _1029 => _1029.kind]) === _ast.SyntaxKind.BinaryExpression && GO_ARITHMETIC_KINDS.indexOf(node.operatorToken.kind) >= 0) { + if (_optionalChain([node, 'optionalAccess', _1041 => _1041.kind]) === _ast.SyntaxKind.BinaryExpression && GO_ARITHMETIC_KINDS.indexOf(node.operatorToken.kind) >= 0) { return this.goPrintBinaryMemoized(node, identation); } const isStatement2 = node !== void 0 && _is.isStatement.call(void 0, node) && node.kind !== _ast.SyntaxKind.Block; @@ -11749,8 +11871,8 @@ ${this.getIden(level)}}()`; if (native !== void 0) { return `${this.getIden(identation)}${this.goControlClauseParens(node, native)}`; } - const inNode = _optionalChain([node, 'optionalAccess', _1030 => _1030.kind]) === _ast.SyntaxKind.ParenthesizedExpression ? node.expression : node; - if (_optionalChain([inNode, 'optionalAccess', _1031 => _1031.kind]) === _ast.SyntaxKind.BinaryExpression && inNode.operatorToken.kind === _ast.SyntaxKind.InKeyword) { + const inNode = _optionalChain([node, 'optionalAccess', _1042 => _1042.kind]) === _ast.SyntaxKind.ParenthesizedExpression ? node.expression : node; + if (_optionalChain([inNode, 'optionalAccess', _1043 => _1043.kind]) === _ast.SyntaxKind.BinaryExpression && inNode.operatorToken.kind === _ast.SyntaxKind.InKeyword) { const inlined = this.printInlineInOp(inNode.right, inNode.left, this.printNode(inNode.right, 0), this.printNode(inNode.left, 0)); if (inlined !== void 0) { const text = inNode === node ? inlined : `(${inlined})`; @@ -11769,11 +11891,11 @@ ${this.getIden(level)}}()`; // (a literal, which adapts to the pointee) or an operand of the very same Go // type. Anything else — including any `any` operand — keeps IsEqual. goDerefComparableWith(ptrNode, ptrText, otherNode) { - const pointee = _optionalChain([this, 'access', _1032 => _1032.goPointerTypeOfExpression, 'call', _1033 => _1033(ptrNode, ptrText), 'optionalAccess', _1034 => _1034.substring, 'call', _1035 => _1035(1)]); + const pointee = _optionalChain([this, 'access', _1044 => _1044.goPointerTypeOfExpression, 'call', _1045 => _1045(ptrNode, ptrText), 'optionalAccess', _1046 => _1046.substring, 'call', _1047 => _1047(1)]); if (pointee === void 0) { return false; } - switch (_optionalChain([otherNode, 'optionalAccess', _1036 => _1036.kind])) { + switch (_optionalChain([otherNode, 'optionalAccess', _1048 => _1048.kind])) { case _ast.SyntaxKind.StringLiteral: case _ast.SyntaxKind.NoSubstitutionTemplateLiteral: return pointee === "string"; @@ -11790,16 +11912,16 @@ ${this.getIden(level)}}()`; // emitted with the printer's string quote token, so the comparison is a plain // Go string comparison goIsStringLiteralNode(node) { - return _optionalChain([node, 'optionalAccess', _1037 => _1037.kind]) === _ast.SyntaxKind.StringLiteral || _optionalChain([node, 'optionalAccess', _1038 => _1038.kind]) === _ast.SyntaxKind.NoSubstitutionTemplateLiteral; + return _optionalChain([node, 'optionalAccess', _1049 => _1049.kind]) === _ast.SyntaxKind.StringLiteral || _optionalChain([node, 'optionalAccess', _1050 => _1050.kind]) === _ast.SyntaxKind.NoSubstitutionTemplateLiteral; } // the deref arms print their operand twice, so it must read the same value both times: an // identifier is a plain read, and a string accessor call whose arguments are all // identifiers/literals re-reads them (no statement runs between the two evaluations). goDerefRepeatableOperand(node, printedText) { - if (_optionalChain([node, 'optionalAccess', _1039 => _1039.kind]) === _ast.SyntaxKind.Identifier) { + if (_optionalChain([node, 'optionalAccess', _1051 => _1051.kind]) === _ast.SyntaxKind.Identifier) { return true; } - if (_optionalChain([node, 'optionalAccess', _1040 => _1040.kind]) !== _ast.SyntaxKind.CallExpression) { + if (_optionalChain([node, 'optionalAccess', _1052 => _1052.kind]) !== _ast.SyntaxKind.CallExpression) { return false; } if (GO_PURE_STRING_ACCESSORS.indexOf(this.goPrintedCallee(printedText)) < 0) { @@ -11810,7 +11932,7 @@ ${this.getIden(level)}}()`; // an argument whose evaluation is a plain read: a value the printer already // holds, never a call that could observe or cause a change goIsReadOnlyCallArgument(node) { - switch (_optionalChain([this, 'access', _1041 => _1041.goUnwrapParenthesizedNode, 'call', _1042 => _1042(node), 'optionalAccess', _1043 => _1043.kind])) { + switch (_optionalChain([this, 'access', _1053 => _1053.goUnwrapParenthesizedNode, 'call', _1054 => _1054(node), 'optionalAccess', _1055 => _1055.kind])) { case _ast.SyntaxKind.Identifier: case _ast.SyntaxKind.StringLiteral: case _ast.SyntaxKind.NoSubstitutionTemplateLiteral: @@ -11829,7 +11951,7 @@ ${this.getIden(level)}}()`; if (this.goDeclaredTypeOfIdentifier(node) === "string") { return true; } - if (_optionalChain([node, 'optionalAccess', _1044 => _1044.kind]) !== _ast.SyntaxKind.Identifier) { + if (_optionalChain([node, 'optionalAccess', _1056 => _1056.kind]) !== _ast.SyntaxKind.Identifier) { return false; } const checker = this.checkerOrUndefined(); @@ -11837,8 +11959,8 @@ ${this.getIden(level)}}()`; return false; } const symbol = checker.getSymbolAtLocation(node); - const declaration = _optionalChain([symbol, 'optionalAccess', _1045 => _1045.valueDeclaration, 'optionalAccess', _1046 => _1046.resolve, 'call', _1047 => _1047()]); - if (_optionalChain([declaration, 'optionalAccess', _1048 => _1048.kind]) !== _ast.SyntaxKind.Parameter) { + const declaration = _optionalChain([symbol, 'optionalAccess', _1057 => _1057.valueDeclaration, 'optionalAccess', _1058 => _1058.resolve, 'call', _1059 => _1059()]); + if (_optionalChain([declaration, 'optionalAccess', _1060 => _1060.kind]) !== _ast.SyntaxKind.Parameter) { return false; } return this.printParameterType(declaration) === "string"; @@ -11921,7 +12043,7 @@ ${this.getIden(level)}}()`; return isEq ? `(${rightText} == nil)` : `(${rightText} != nil)`; } const isLiteral = (node) => { - switch (_optionalChain([node, 'optionalAccess', _1049 => _1049.kind])) { + switch (_optionalChain([node, 'optionalAccess', _1061 => _1061.kind])) { case _ast.SyntaxKind.StringLiteral: case _ast.SyntaxKind.NoSubstitutionTemplateLiteral: case _ast.SyntaxKind.TrueKeyword: @@ -11934,7 +12056,7 @@ ${this.getIden(level)}}()`; if (lBox && literalMatchesBox(lNilFam, right, rFam) || rBox && literalMatchesBox(rNilFam, left, lFam)) { return isEq ? `(${leftText} == ${rightText})` : `(${leftText} != ${rightText})`; } - const isBoolLiteral = (node) => _optionalChain([node, 'optionalAccess', _1050 => _1050.kind]) === _ast.SyntaxKind.TrueKeyword || _optionalChain([node, 'optionalAccess', _1051 => _1051.kind]) === _ast.SyntaxKind.FalseKeyword; + const isBoolLiteral = (node) => _optionalChain([node, 'optionalAccess', _1062 => _1062.kind]) === _ast.SyntaxKind.TrueKeyword || _optionalChain([node, 'optionalAccess', _1063 => _1063.kind]) === _ast.SyntaxKind.FalseKeyword; if (!lPtr && isBoolLiteral(right) && this.goScalarFamilyWithNil(left) === "bool" && this.goBoxedElementRead(left, leftText) || !rPtr && isBoolLiteral(left) && this.goScalarFamilyWithNil(right) === "bool" && this.goBoxedElementRead(right, rightText)) { return isEq ? `(${leftText} == ${rightText})` : `(${leftText} != ${rightText})`; } @@ -11989,12 +12111,12 @@ ${this.getIden(level)}}()`; return void 0; } const symbol = checker.getSymbolAtLocation(node); - const declaration = _optionalChain([symbol, 'optionalAccess', _1052 => _1052.valueDeclaration, 'optionalAccess', _1053 => _1053.resolve, 'call', _1054 => _1054()]); - if (_optionalChain([declaration, 'optionalAccess', _1055 => _1055.kind]) !== _ast.SyntaxKind.VariableDeclaration || declaration.initializer === void 0) { + const declaration = _optionalChain([symbol, 'optionalAccess', _1064 => _1064.valueDeclaration, 'optionalAccess', _1065 => _1065.resolve, 'call', _1066 => _1066()]); + if (_optionalChain([declaration, 'optionalAccess', _1067 => _1067.kind]) !== _ast.SyntaxKind.VariableDeclaration || declaration.initializer === void 0) { return void 0; } const declarationList = declaration.parent; - if (_optionalChain([declarationList, 'optionalAccess', _1056 => _1056.kind]) !== _ast.SyntaxKind.VariableDeclarationList || _optionalChain([declarationList, 'access', _1057 => _1057.parent, 'optionalAccess', _1058 => _1058.kind]) === _ast.SyntaxKind.FirstStatement) { + if (_optionalChain([declarationList, 'optionalAccess', _1068 => _1068.kind]) !== _ast.SyntaxKind.VariableDeclarationList || _optionalChain([declarationList, 'access', _1069 => _1069.parent, 'optionalAccess', _1070 => _1070.kind]) === _ast.SyntaxKind.FirstStatement) { return void 0; } return this.goNumericLiteralKind(declaration.initializer); @@ -12006,7 +12128,7 @@ ${this.getIden(level)}}()`; if (this.goIsSignedNumericLiteral(node)) { return this.goNumericLiteralKind(node.operand); } - const text = _optionalChain([node, 'optionalAccess', _1059 => _1059.text]); + const text = _optionalChain([node, 'optionalAccess', _1071 => _1071.text]); if (text === void 0) { return void 0; } @@ -12021,17 +12143,17 @@ ${this.getIden(level)}}()`; // `-1` / `+1.5` as written: a sign on a numeric literal, the only prefix-unary // shape that reaches a comparison as a constant rather than as OpNeg(...) goIsSignedNumericLiteral(node) { - if (_optionalChain([node, 'optionalAccess', _1060 => _1060.kind]) !== _ast.SyntaxKind.PrefixUnaryExpression) { + if (_optionalChain([node, 'optionalAccess', _1072 => _1072.kind]) !== _ast.SyntaxKind.PrefixUnaryExpression) { return false; } if (node.operator !== _ast.SyntaxKind.MinusToken && node.operator !== _ast.SyntaxKind.PlusToken) { return false; } - return _optionalChain([node, 'access', _1061 => _1061.operand, 'optionalAccess', _1062 => _1062.kind]) === _ast.SyntaxKind.NumericLiteral; + return _optionalChain([node, 'access', _1073 => _1073.operand, 'optionalAccess', _1074 => _1074.kind]) === _ast.SyntaxKind.NumericLiteral; } // a numeric constant operand: an integer/float literal, with an optional sign goIsNumericConstant(node) { - return _optionalChain([node, 'optionalAccess', _1063 => _1063.kind]) === _ast.SyntaxKind.NumericLiteral || this.goIsSignedNumericLiteral(node); + return _optionalChain([node, 'optionalAccess', _1075 => _1075.kind]) === _ast.SyntaxKind.NumericLiteral || this.goIsSignedNumericLiteral(node); } // the constant's value with its sign; NaN for anything but a numeric constant goNumericConstantValue(node) { @@ -12039,7 +12161,7 @@ ${this.getIden(level)}}()`; const value = Number(node.operand.text.replaceAll("_", "")); return node.operator === _ast.SyntaxKind.MinusToken ? -value : value; } - if (_optionalChain([node, 'optionalAccess', _1064 => _1064.kind]) !== _ast.SyntaxKind.NumericLiteral) { + if (_optionalChain([node, 'optionalAccess', _1076 => _1076.kind]) !== _ast.SyntaxKind.NumericLiteral) { return Number.NaN; } return Number(node.text.replaceAll("_", "")); @@ -12105,7 +12227,7 @@ ${this.getIden(level)}}()`; // the printer itself declared as that pointer qualifies: a call would be repeated by // the nil test, and an `any` box holds a value the printer cannot name. goOrderedComparisonPointerKind(node) { - if (_optionalChain([node, 'optionalAccess', _1065 => _1065.kind]) !== _ast.SyntaxKind.Identifier) { + if (_optionalChain([node, 'optionalAccess', _1077 => _1077.kind]) !== _ast.SyntaxKind.Identifier) { return void 0; } const declared = this.goDeclaredTypeOfIdentifier(node); @@ -12164,10 +12286,10 @@ ${this.getIden(level)}}()`; // `x !== undefined` / `x != null` on that identifier: the printer writes the Go // `x != nil` test for it, so an enclosing one proves the pointer present goIsNonNilTestOf(node, ident) { - if (_optionalChain([node, 'optionalAccess', _1066 => _1066.kind]) !== _ast.SyntaxKind.BinaryExpression) { + if (_optionalChain([node, 'optionalAccess', _1078 => _1078.kind]) !== _ast.SyntaxKind.BinaryExpression) { return false; } - const op = _optionalChain([node, 'access', _1067 => _1067.operatorToken, 'optionalAccess', _1068 => _1068.kind]); + const op = _optionalChain([node, 'access', _1079 => _1079.operatorToken, 'optionalAccess', _1080 => _1080.kind]); if (op !== _ast.SyntaxKind.ExclamationEqualsToken && op !== _ast.SyntaxKind.ExclamationEqualsEqualsToken) { return false; } @@ -12175,13 +12297,13 @@ ${this.getIden(level)}}()`; } // a null/undefined literal, or any expression the checker types as one goIsNilLiteral(node) { - if (_optionalChain([node, 'optionalAccess', _1069 => _1069.kind]) === _ast.SyntaxKind.NullKeyword || _optionalChain([node, 'optionalAccess', _1070 => _1070.kind]) === _ast.SyntaxKind.UndefinedKeyword) { + if (_optionalChain([node, 'optionalAccess', _1081 => _1081.kind]) === _ast.SyntaxKind.NullKeyword || _optionalChain([node, 'optionalAccess', _1082 => _1082.kind]) === _ast.SyntaxKind.UndefinedKeyword) { return true; } - return _optionalChain([node, 'optionalAccess', _1071 => _1071.kind]) === _ast.SyntaxKind.Identifier && this.goScalarFamily(node) === "nil"; + return _optionalChain([node, 'optionalAccess', _1083 => _1083.kind]) === _ast.SyntaxKind.Identifier && this.goScalarFamily(node) === "nil"; } goIsSameSymbol(a, b) { - if (_optionalChain([a, 'optionalAccess', _1072 => _1072.kind]) !== _ast.SyntaxKind.Identifier || _optionalChain([b, 'optionalAccess', _1073 => _1073.kind]) !== _ast.SyntaxKind.Identifier) { + if (_optionalChain([a, 'optionalAccess', _1084 => _1084.kind]) !== _ast.SyntaxKind.Identifier || _optionalChain([b, 'optionalAccess', _1085 => _1085.kind]) !== _ast.SyntaxKind.Identifier) { return false; } try { @@ -12200,12 +12322,12 @@ ${this.getIden(level)}}()`; if (checker === void 0) { return false; } - const declaration = _optionalChain([checker, 'access', _1074 => _1074.getSymbolAtLocation, 'call', _1075 => _1075(ident), 'optionalAccess', _1076 => _1076.valueDeclaration, 'optionalAccess', _1077 => _1077.resolve, 'call', _1078 => _1078()]); + const declaration = _optionalChain([checker, 'access', _1086 => _1086.getSymbolAtLocation, 'call', _1087 => _1087(ident), 'optionalAccess', _1088 => _1088.valueDeclaration, 'optionalAccess', _1089 => _1089.resolve, 'call', _1090 => _1090()]); if (this.goLocalIsRebound(this.goEnclosingFunction(_nullishCoalesce(declaration, () => ( ident))), ident)) { return false; } let child = ident; - let parent = _optionalChain([ident, 'optionalAccess', _1079 => _1079.parent]); + let parent = _optionalChain([ident, 'optionalAccess', _1091 => _1091.parent]); while (parent !== void 0) { const kind = parent.kind; if (kind === _ast.SyntaxKind.ParenthesizedExpression || kind === _ast.SyntaxKind.VariableStatement || kind === _ast.SyntaxKind.ExpressionStatement || kind === _ast.SyntaxKind.Block || kind === _ast.SyntaxKind.ReturnStatement || kind === _ast.SyntaxKind.ElementAccessExpression || kind === _ast.SyntaxKind.CallExpression || kind === _ast.SyntaxKind.PropertyAccessExpression || kind === _ast.SyntaxKind.ObjectLiteralExpression || kind === _ast.SyntaxKind.PropertyAssignment || kind === _ast.SyntaxKind.ArrayLiteralExpression || kind === _ast.SyntaxKind.AwaitExpression || kind === _ast.SyntaxKind.CaseClause || kind === _ast.SyntaxKind.SwitchStatement || kind === _ast.SyntaxKind.DoStatement || kind === _ast.SyntaxKind.LabeledStatement) { @@ -12214,7 +12336,7 @@ ${this.getIden(level)}}()`; continue; } if (kind === _ast.SyntaxKind.BinaryExpression) { - const op = _optionalChain([parent, 'access', _1080 => _1080.operatorToken, 'optionalAccess', _1081 => _1081.kind]); + const op = _optionalChain([parent, 'access', _1092 => _1092.operatorToken, 'optionalAccess', _1093 => _1093.kind]); if (op === _ast.SyntaxKind.AmpersandAmpersandToken && child === parent.right && this.goConditionProvesNonNil(parent.left, ident)) { return true; } @@ -12244,14 +12366,14 @@ ${this.getIden(level)}}()`; if (this.goIsNonNilTestOf(inner, ident)) { return true; } - if (inner.kind !== _ast.SyntaxKind.BinaryExpression || _optionalChain([inner, 'access', _1082 => _1082.operatorToken, 'optionalAccess', _1083 => _1083.kind]) !== _ast.SyntaxKind.AmpersandAmpersandToken) { + if (inner.kind !== _ast.SyntaxKind.BinaryExpression || _optionalChain([inner, 'access', _1094 => _1094.operatorToken, 'optionalAccess', _1095 => _1095.kind]) !== _ast.SyntaxKind.AmpersandAmpersandToken) { return false; } return this.goConditionProvesNonNil(inner.left, ident) || this.goConditionProvesNonNil(inner.right, ident); } goUnwrapParenthesizedNode(node) { let current = node; - while (_optionalChain([current, 'optionalAccess', _1084 => _1084.kind]) === _ast.SyntaxKind.ParenthesizedExpression) { + while (_optionalChain([current, 'optionalAccess', _1096 => _1096.kind]) === _ast.SyntaxKind.ParenthesizedExpression) { current = current.expression; } return current; @@ -12259,7 +12381,7 @@ ${this.getIden(level)}}()`; // an operand a short-circuit may skip without any observable difference: no calls, // no assignments, nothing the helper would have evaluated exactly once goIsPureComparisonOperand(node) { - switch (_optionalChain([node, 'optionalAccess', _1085 => _1085.kind])) { + switch (_optionalChain([node, 'optionalAccess', _1097 => _1097.kind])) { case _ast.SyntaxKind.Identifier: case _ast.SyntaxKind.NumericLiteral: case _ast.SyntaxKind.StringLiteral: @@ -12282,10 +12404,10 @@ ${this.getIden(level)}}()`; // gofmt keeps instead of doubling it. printParenthesizedExpression(node, identation) { const expression = node.expression; - if (_optionalChain([expression, 'optionalAccess', _1086 => _1086.kind]) === _ast.SyntaxKind.AsExpression) { + if (_optionalChain([expression, 'optionalAccess', _1098 => _1098.kind]) === _ast.SyntaxKind.AsExpression) { return this.getIden(identation) + this.printNode(expression, 0); } - if (_optionalChain([expression, 'optionalAccess', _1087 => _1087.kind]) === _ast.SyntaxKind.ArrowFunction) { + if (_optionalChain([expression, 'optionalAccess', _1099 => _1099.kind]) === _ast.SyntaxKind.ArrowFunction) { return ""; } const printed = this.goWithExprDepth(this.goExprDepth - 1, () => this.printNode(expression, 0)); @@ -12368,7 +12490,7 @@ ${this.getIden(level)}}()`; switch (rightSide) { case "length": const type = this.getChecker().getTypeAtLocation(expression); - rawExpression = _nullishCoalesce(this.printInlineArrayLength(expression, leftSide, node), () => ( (this.isStringType(type.flags) ? `GetLength(${leftSide})` : `${this.ARRAY_LENGTH_WRAPPER_OPEN}${leftSide}${this.ARRAY_LENGTH_WRAPPER_CLOSE}`))); + rawExpression = _nullishCoalesce(_nullishCoalesce(this.printInlineArrayLength(expression, leftSide, node), () => ( this.goHx4G06DerefLength(expression, leftSide, node))), () => ( (this.isStringType(type.flags) ? `GetLength(${leftSide})` : `${this.ARRAY_LENGTH_WRAPPER_OPEN}${leftSide}${this.ARRAY_LENGTH_WRAPPER_CLOSE}`))); break; case "push": rawExpression = `((IList)${leftSide}).Add`; @@ -12380,18 +12502,18 @@ ${this.getIden(level)}}()`; // for a nil default), or undefined to keep `any`; the retype needs goLocalIsSafeToType, // goParameterKeepsNilCompareNative and goGetArgConsumersAreSafe to agree. goGetArgLocalType(body, param, printedDefault) { - const method = _optionalChain([param, 'optionalAccess', _1088 => _1088.parent]); - const excluded = GO_GETARG_EXCLUDED_POSITIONS[_optionalChain([method, 'optionalAccess', _1089 => _1089.name, 'optionalAccess', _1090 => _1090.text])]; + const method = _optionalChain([param, 'optionalAccess', _1100 => _1100.parent]); + const excluded = GO_GETARG_EXCLUDED_POSITIONS[_optionalChain([method, 'optionalAccess', _1101 => _1101.name, 'optionalAccess', _1102 => _1102.text])]; if (excluded !== void 0 && excluded.includes(method.parameters.indexOf(param))) { return void 0; } - if (_optionalChain([param, 'optionalAccess', _1091 => _1091.type, 'optionalAccess', _1092 => _1092.kind]) === _ast.SyntaxKind.AnyKeyword && !this.goGetArgBaseParamIsUnannotated(param)) { + if (_optionalChain([param, 'optionalAccess', _1103 => _1103.type, 'optionalAccess', _1104 => _1104.kind]) === _ast.SyntaxKind.AnyKeyword && !this.goGetArgBaseParamIsUnannotated(param)) { return void 0; } const shape = (_nullishCoalesce(printedDefault, () => ( ""))).trim(); const byDefault = this.goGetArgTypeOfShape(shape); if (byDefault !== void 0) { - if (_optionalChain([param, 'optionalAccess', _1093 => _1093.type]) !== void 0 && param.type.kind !== _ast.SyntaxKind.AnyKeyword && !this.goGetArgDeclaredTypeCandidates(param).some((t) => t.replace(/^\*/, "") === byDefault)) { + if (_optionalChain([param, 'optionalAccess', _1105 => _1105.type]) !== void 0 && param.type.kind !== _ast.SyntaxKind.AnyKeyword && !this.goGetArgDeclaredTypeCandidates(param).some((t) => t.replace(/^\*/, "") === byDefault)) { return void 0; } return this.goGetArgLocalIsSafe(body, param, byDefault) ? byDefault : void 0; @@ -12409,21 +12531,21 @@ ${this.getIden(level)}}()`; // true when the method overrides a base method whose parameter at the same position has no // type annotation and a default of the same syntax kind (the base binds it through its twin) goGetArgBaseParamIsUnannotated(param) { - const method = _optionalChain([param, 'optionalAccess', _1094 => _1094.parent]); - const name = _optionalChain([method, 'optionalAccess', _1095 => _1095.name, 'optionalAccess', _1096 => _1096.text]); - const index = _nullishCoalesce(_optionalChain([method, 'optionalAccess', _1097 => _1097.parameters, 'optionalAccess', _1098 => _1098.indexOf, 'call', _1099 => _1099(param)]), () => ( -1)); - const cls = _optionalChain([method, 'optionalAccess', _1100 => _1100.parent]); + const method = _optionalChain([param, 'optionalAccess', _1106 => _1106.parent]); + const name = _optionalChain([method, 'optionalAccess', _1107 => _1107.name, 'optionalAccess', _1108 => _1108.text]); + const index = _nullishCoalesce(_optionalChain([method, 'optionalAccess', _1109 => _1109.parameters, 'optionalAccess', _1110 => _1110.indexOf, 'call', _1111 => _1111(param)]), () => ( -1)); + const cls = _optionalChain([method, 'optionalAccess', _1112 => _1112.parent]); const checker = this.checkerOrUndefined(); if (name === void 0 || index < 0 || checker === void 0 || param.initializer === void 0) { return false; } - for (const clause of _nullishCoalesce(_optionalChain([cls, 'optionalAccess', _1101 => _1101.heritageClauses]), () => ( []))) { + for (const clause of _nullishCoalesce(_optionalChain([cls, 'optionalAccess', _1113 => _1113.heritageClauses]), () => ( []))) { if (clause.token !== _ast.SyntaxKind.ExtendsKeyword) { continue; } for (const expr of _nullishCoalesce(clause.types, () => ( []))) { - const baseDecl = _optionalChain([checker, 'access', _1102 => _1102.getTypeAtLocation, 'call', _1103 => _1103(expr), 'optionalAccess', _1104 => _1104.getProperty, 'optionalCall', _1105 => _1105(name), 'optionalAccess', _1106 => _1106.valueDeclaration, 'optionalAccess', _1107 => _1107.resolve, 'call', _1108 => _1108()]); - const baseParam = _optionalChain([baseDecl, 'optionalAccess', _1109 => _1109.parameters, 'optionalAccess', _1110 => _1110[index]]); + const baseDecl = _optionalChain([checker, 'access', _1114 => _1114.getTypeAtLocation, 'call', _1115 => _1115(expr), 'optionalAccess', _1116 => _1116.getProperty, 'optionalCall', _1117 => _1117(name), 'optionalAccess', _1118 => _1118.valueDeclaration, 'optionalAccess', _1119 => _1119.resolve, 'call', _1120 => _1120()]); + const baseParam = _optionalChain([baseDecl, 'optionalAccess', _1121 => _1121.parameters, 'optionalAccess', _1122 => _1122[index]]); if (baseParam === void 0) { return false; } @@ -12436,10 +12558,10 @@ ${this.getIden(level)}}()`; // receiver of a helper that treats a nil map like an absent value (no IsDictionary/IsEqual) goGetArgNilMapUseOnlyReads(n) { const parent = n.parent; - if (_optionalChain([parent, 'optionalAccess', _1111 => _1111.kind]) === _ast.SyntaxKind.ElementAccessExpression || _optionalChain([parent, 'optionalAccess', _1112 => _1112.kind]) === _ast.SyntaxKind.BinaryExpression) { + if (_optionalChain([parent, 'optionalAccess', _1123 => _1123.kind]) === _ast.SyntaxKind.ElementAccessExpression || _optionalChain([parent, 'optionalAccess', _1124 => _1124.kind]) === _ast.SyntaxKind.BinaryExpression) { return this.goSafeDictUseReadsTheMap(n); } - if (_optionalChain([parent, 'optionalAccess', _1113 => _1113.kind]) !== _ast.SyntaxKind.CallExpression || parent.arguments.indexOf(n) !== 0) { + if (_optionalChain([parent, 'optionalAccess', _1125 => _1125.kind]) !== _ast.SyntaxKind.CallExpression || parent.arguments.indexOf(n) !== 0) { return false; } const callee = this.goPrintedCallee(this.printNode(parent, 0)); @@ -12449,18 +12571,18 @@ ${this.getIden(level)}}()`; // is nil, InArray finds nothing, and a defaulted Strings position's GetArg folds it to its default goGetArgNilStringSliceUseOnlyReads(n) { const parent = n.parent; - if (_optionalChain([parent, 'optionalAccess', _1114 => _1114.kind]) === _ast.SyntaxKind.PropertyAccessExpression && parent.expression === n) { - return _optionalChain([parent, 'access', _1115 => _1115.name, 'optionalAccess', _1116 => _1116.text]) === "length" && (_optionalChain([parent, 'access', _1117 => _1117.parent, 'optionalAccess', _1118 => _1118.kind]) !== _ast.SyntaxKind.CallExpression || parent.parent.expression !== parent) && !(_optionalChain([parent, 'access', _1119 => _1119.parent, 'optionalAccess', _1120 => _1120.kind]) === _ast.SyntaxKind.BinaryExpression && parent.parent.left === parent); + if (_optionalChain([parent, 'optionalAccess', _1126 => _1126.kind]) === _ast.SyntaxKind.PropertyAccessExpression && parent.expression === n) { + return _optionalChain([parent, 'access', _1127 => _1127.name, 'optionalAccess', _1128 => _1128.text]) === "length" && (_optionalChain([parent, 'access', _1129 => _1129.parent, 'optionalAccess', _1130 => _1130.kind]) !== _ast.SyntaxKind.CallExpression || parent.parent.expression !== parent) && !(_optionalChain([parent, 'access', _1131 => _1131.parent, 'optionalAccess', _1132 => _1132.kind]) === _ast.SyntaxKind.BinaryExpression && parent.parent.left === parent); } - if (_optionalChain([parent, 'optionalAccess', _1121 => _1121.kind]) === _ast.SyntaxKind.ElementAccessExpression) { + if (_optionalChain([parent, 'optionalAccess', _1133 => _1133.kind]) === _ast.SyntaxKind.ElementAccessExpression) { return this.goSafeDictUseReadsTheMap(n); } - if (_optionalChain([parent, 'optionalAccess', _1122 => _1122.kind]) !== _ast.SyntaxKind.CallExpression || parent.expression === n) { + if (_optionalChain([parent, 'optionalAccess', _1134 => _1134.kind]) !== _ast.SyntaxKind.CallExpression || parent.expression === n) { return false; } const argIndex = parent.arguments.indexOf(n); const callee = parent.expression; - if (_optionalChain([callee, 'optionalAccess', _1123 => _1123.kind]) === _ast.SyntaxKind.PropertyAccessExpression && _optionalChain([callee, 'access', _1124 => _1124.expression, 'optionalAccess', _1125 => _1125.kind]) === _ast.SyntaxKind.ThisKeyword && _optionalChain([callee, 'access', _1126 => _1126.name, 'optionalAccess', _1127 => _1127.text]) === "inArray" && argIndex === 1) { + if (_optionalChain([callee, 'optionalAccess', _1135 => _1135.kind]) === _ast.SyntaxKind.PropertyAccessExpression && _optionalChain([callee, 'access', _1136 => _1136.expression, 'optionalAccess', _1137 => _1137.kind]) === _ast.SyntaxKind.ThisKeyword && _optionalChain([callee, 'access', _1138 => _1138.name, 'optionalAccess', _1139 => _1139.text]) === "inArray" && argIndex === 1) { return true; } if (!this.goGetArgPositionIsDefaulted(callee, argIndex)) { @@ -12468,11 +12590,11 @@ ${this.getIden(level)}}()`; } let decl; try { - decl = _optionalChain([this, 'access', _1128 => _1128.getChecker, 'call', _1129 => _1129(), 'access', _1130 => _1130.getSymbolAtLocation, 'call', _1131 => _1131(callee), 'optionalAccess', _1132 => _1132.valueDeclaration, 'optionalAccess', _1133 => _1133.resolve, 'call', _1134 => _1134()]); + decl = _optionalChain([this, 'access', _1140 => _1140.getChecker, 'call', _1141 => _1141(), 'access', _1142 => _1142.getSymbolAtLocation, 'call', _1143 => _1143(callee), 'optionalAccess', _1144 => _1144.valueDeclaration, 'optionalAccess', _1145 => _1145.resolve, 'call', _1146 => _1146()]); } catch (e) { decl = void 0; } - const declared = String(_nullishCoalesce(_optionalChain([decl, 'optionalAccess', _1135 => _1135.parameters, 'optionalAccess', _1136 => _1136[argIndex], 'optionalAccess', _1137 => _1137.type, 'optionalAccess', _1138 => _1138.getText, 'call', _1139 => _1139()]), () => ( ""))).replace(/\s+/g, " "); + const declared = String(_nullishCoalesce(_optionalChain([decl, 'optionalAccess', _1147 => _1147.parameters, 'optionalAccess', _1148 => _1148[argIndex], 'optionalAccess', _1149 => _1149.type, 'optionalAccess', _1150 => _1150.getText, 'call', _1151 => _1151()]), () => ( ""))).replace(/\s+/g, " "); return declared === "Strings" || declared === "string[]"; } // the Go type the printed default names, or undefined when it names none @@ -12486,13 +12608,13 @@ ${this.getIden(level)}}()`; [/^(?:true|false)$/, "bool"], [/^(?:-?[0-9]|math\.)/, "int64"] ]; - return _optionalChain([shapes, 'access', _1140 => _1140.find, 'call', _1141 => _1141(([re]) => re.test(shape)), 'optionalAccess', _1142 => _1142[1]]); + return _optionalChain([shapes, 'access', _1152 => _1152.find, 'call', _1153 => _1153(([re]) => re.test(shape)), 'optionalAccess', _1154 => _1154[1]]); } // Go type candidates for a nil-defaulted parameter, in try order: the annotation text // (`Int` vs `Num` exist only there), then goNativeParameterTypeCandidates. goGetArgDeclaredTypeCandidates(param) { const out = []; - const declared = _optionalChain([param, 'optionalAccess', _1143 => _1143.type]) !== void 0 ? String(param.type.getText()).replace(/\s+/g, " ") : void 0; + const declared = _optionalChain([param, 'optionalAccess', _1155 => _1155.type]) !== void 0 ? String(param.type.getText()).replace(/\s+/g, " ") : void 0; const alias = _nullishCoalesce(this.CCXT_GO_GETARG_DECLARED_TYPES, () => ( {})); if (declared !== void 0 && alias[declared] !== void 0) { out.push(alias[declared]); @@ -12584,18 +12706,18 @@ ${this.getIden(level)}}()`; // the same name is not nil, so the copy never boxes a typed nil goGetArgArmIsNilGuarded(n, cond) { let test = cond.condition; - while (_optionalChain([test, 'optionalAccess', _1144 => _1144.kind]) === _ast.SyntaxKind.ParenthesizedExpression) { + while (_optionalChain([test, 'optionalAccess', _1156 => _1156.kind]) === _ast.SyntaxKind.ParenthesizedExpression) { test = test.expression; } - if (_optionalChain([test, 'optionalAccess', _1145 => _1145.kind]) !== _ast.SyntaxKind.BinaryExpression) { + if (_optionalChain([test, 'optionalAccess', _1157 => _1157.kind]) !== _ast.SyntaxKind.BinaryExpression) { return false; } - const isNil = (e) => _optionalChain([e, 'optionalAccess', _1146 => _1146.kind]) === _ast.SyntaxKind.NullKeyword || _optionalChain([e, 'optionalAccess', _1147 => _1147.kind]) === _ast.SyntaxKind.Identifier && e.text === "undefined"; - const sameName = (e) => _optionalChain([e, 'optionalAccess', _1148 => _1148.kind]) === _ast.SyntaxKind.Identifier && e.text === n.text; + const isNil = (e) => _optionalChain([e, 'optionalAccess', _1158 => _1158.kind]) === _ast.SyntaxKind.NullKeyword || _optionalChain([e, 'optionalAccess', _1159 => _1159.kind]) === _ast.SyntaxKind.Identifier && e.text === "undefined"; + const sameName = (e) => _optionalChain([e, 'optionalAccess', _1160 => _1160.kind]) === _ast.SyntaxKind.Identifier && e.text === n.text; if (!(sameName(test.left) && isNil(test.right) || sameName(test.right) && isNil(test.left))) { return false; } - const op = _optionalChain([test, 'access', _1149 => _1149.operatorToken, 'optionalAccess', _1150 => _1150.kind]); + const op = _optionalChain([test, 'access', _1161 => _1161.operatorToken, 'optionalAccess', _1162 => _1162.kind]); const eq = op === _ast.SyntaxKind.EqualsEqualsEqualsToken || op === _ast.SyntaxKind.EqualsEqualsToken; const ne = op === _ast.SyntaxKind.ExclamationEqualsEqualsToken || op === _ast.SyntaxKind.ExclamationEqualsToken; let arm = n; @@ -12608,11 +12730,11 @@ ${this.getIden(level)}}()`; // boxed, so it reads like that helper write rather than a value-family write goGetArgWriteIsNativeArithmetic(rhs) { let e = rhs; - while (_optionalChain([e, 'optionalAccess', _1151 => _1151.kind]) === _ast.SyntaxKind.ParenthesizedExpression) { + while (_optionalChain([e, 'optionalAccess', _1163 => _1163.kind]) === _ast.SyntaxKind.ParenthesizedExpression) { e = e.expression; } const ops = [_ast.SyntaxKind.PlusToken, _ast.SyntaxKind.MinusToken, _ast.SyntaxKind.AsteriskToken, _ast.SyntaxKind.SlashToken, _ast.SyntaxKind.PercentToken]; - if (_optionalChain([e, 'optionalAccess', _1152 => _1152.kind]) !== _ast.SyntaxKind.BinaryExpression || !ops.includes(_optionalChain([e, 'access', _1153 => _1153.operatorToken, 'optionalAccess', _1154 => _1154.kind]))) { + if (_optionalChain([e, 'optionalAccess', _1164 => _1164.kind]) !== _ast.SyntaxKind.BinaryExpression || !ops.includes(_optionalChain([e, 'access', _1165 => _1165.operatorToken, 'optionalAccess', _1166 => _1166.kind]))) { return false; } const goType = _nullishCoalesce(this.goNativeArithmeticType(e), () => ( this.goConstantProductKind(e))); @@ -12622,16 +12744,16 @@ ${this.getIden(level)}}()`; goGetArgCopyTarget(use, body) { const parent = use.parent; let target; - if (_optionalChain([parent, 'optionalAccess', _1155 => _1155.kind]) === _ast.SyntaxKind.VariableDeclaration && parent.initializer === use) { + if (_optionalChain([parent, 'optionalAccess', _1167 => _1167.kind]) === _ast.SyntaxKind.VariableDeclaration && parent.initializer === use) { target = parent; - } else if (_optionalChain([parent, 'optionalAccess', _1156 => _1156.kind]) === _ast.SyntaxKind.BinaryExpression && parent.right === use && _optionalChain([parent, 'access', _1157 => _1157.operatorToken, 'optionalAccess', _1158 => _1158.kind]) === _ast.SyntaxKind.EqualsToken && _optionalChain([parent, 'access', _1159 => _1159.left, 'optionalAccess', _1160 => _1160.kind]) === _ast.SyntaxKind.Identifier && _optionalChain([parent, 'access', _1161 => _1161.parent, 'optionalAccess', _1162 => _1162.kind]) === _ast.SyntaxKind.ExpressionStatement) { + } else if (_optionalChain([parent, 'optionalAccess', _1168 => _1168.kind]) === _ast.SyntaxKind.BinaryExpression && parent.right === use && _optionalChain([parent, 'access', _1169 => _1169.operatorToken, 'optionalAccess', _1170 => _1170.kind]) === _ast.SyntaxKind.EqualsToken && _optionalChain([parent, 'access', _1171 => _1171.left, 'optionalAccess', _1172 => _1172.kind]) === _ast.SyntaxKind.Identifier && _optionalChain([parent, 'access', _1173 => _1173.parent, 'optionalAccess', _1174 => _1174.kind]) === _ast.SyntaxKind.ExpressionStatement) { try { - target = _optionalChain([this, 'access', _1163 => _1163.getChecker, 'call', _1164 => _1164(), 'access', _1165 => _1165.getSymbolAtLocation, 'call', _1166 => _1166(parent.left), 'optionalAccess', _1167 => _1167.valueDeclaration, 'optionalAccess', _1168 => _1168.resolve, 'call', _1169 => _1169()]); + target = _optionalChain([this, 'access', _1175 => _1175.getChecker, 'call', _1176 => _1176(), 'access', _1177 => _1177.getSymbolAtLocation, 'call', _1178 => _1178(parent.left), 'optionalAccess', _1179 => _1179.valueDeclaration, 'optionalAccess', _1180 => _1180.resolve, 'call', _1181 => _1181()]); } catch (e) { target = void 0; } } - if (_optionalChain([target, 'optionalAccess', _1170 => _1170.kind]) !== _ast.SyntaxKind.VariableDeclaration || _optionalChain([target, 'access', _1171 => _1171.name, 'optionalAccess', _1172 => _1172.kind]) !== _ast.SyntaxKind.Identifier) { + if (_optionalChain([target, 'optionalAccess', _1182 => _1182.kind]) !== _ast.SyntaxKind.VariableDeclaration || _optionalChain([target, 'access', _1183 => _1183.name, 'optionalAccess', _1184 => _1184.kind]) !== _ast.SyntaxKind.Identifier) { return void 0; } let inBody = false; @@ -12643,7 +12765,7 @@ ${this.getIden(level)}}()`; if (valueWrite) { return; } - if (n.kind === _ast.SyntaxKind.BinaryExpression && _optionalChain([n, 'access', _1173 => _1173.operatorToken, 'optionalAccess', _1174 => _1174.kind]) === _ast.SyntaxKind.EqualsToken && _optionalChain([n, 'access', _1175 => _1175.left, 'optionalAccess', _1176 => _1176.kind]) === _ast.SyntaxKind.Identifier && n.left.text === target.name.text) { + if (n.kind === _ast.SyntaxKind.BinaryExpression && _optionalChain([n, 'access', _1185 => _1185.operatorToken, 'optionalAccess', _1186 => _1186.kind]) === _ast.SyntaxKind.EqualsToken && _optionalChain([n, 'access', _1187 => _1187.left, 'optionalAccess', _1188 => _1188.kind]) === _ast.SyntaxKind.Identifier && n.left.text === target.name.text) { valueWrite = this.goGetArgIsValueType(String(this.goTypeOfInitializer(n.right, this.printNode(n.right, 0)))) && !this.goGetArgWriteIsNativeArithmetic(n.right); } n.forEachChild(visit); @@ -12671,20 +12793,20 @@ ${this.getIden(level)}}()`; if (!safe) { return; } - if (_optionalChain([n, 'optionalAccess', _1177 => _1177.kind]) === _ast.SyntaxKind.Identifier && n.text === name) { + if (_optionalChain([n, 'optionalAccess', _1189 => _1189.kind]) === _ast.SyntaxKind.Identifier && n.text === name) { let symbol; try { symbol = this.getChecker().getSymbolAtLocation(n); } catch (e) { symbol = void 0; } - if (_optionalChain([symbol, 'optionalAccess', _1178 => _1178.valueDeclaration, 'optionalAccess', _1179 => _1179.resolve, 'call', _1180 => _1180()]) === param) { + if (_optionalChain([symbol, 'optionalAccess', _1190 => _1190.valueDeclaration, 'optionalAccess', _1191 => _1191.resolve, 'call', _1192 => _1192()]) === param) { const parent = n.parent; if (parent === param) { return; } if (nilable && goType === "map[string]any") { - const assigned = _optionalChain([parent, 'optionalAccess', _1181 => _1181.kind]) === _ast.SyntaxKind.BinaryExpression && parent.left === n && _optionalChain([parent, 'access', _1182 => _1182.operatorToken, 'optionalAccess', _1183 => _1183.kind]) === _ast.SyntaxKind.EqualsToken; + const assigned = _optionalChain([parent, 'optionalAccess', _1193 => _1193.kind]) === _ast.SyntaxKind.BinaryExpression && parent.left === n && _optionalChain([parent, 'access', _1194 => _1194.operatorToken, 'optionalAccess', _1195 => _1195.kind]) === _ast.SyntaxKind.EqualsToken; if (assigned || this.goGetArgNilMapUseOnlyReads(n)) { return; } @@ -12692,20 +12814,20 @@ ${this.getIden(level)}}()`; if (nilable && goType === "[]string" && this.goGetArgNilStringSliceUseOnlyReads(n)) { return; } - if (pointer && _optionalChain([parent, 'optionalAccess', _1184 => _1184.kind]) === _ast.SyntaxKind.BinaryExpression) { - const op = _optionalChain([parent, 'access', _1185 => _1185.operatorToken, 'optionalAccess', _1186 => _1186.kind]); + if (pointer && _optionalChain([parent, 'optionalAccess', _1196 => _1196.kind]) === _ast.SyntaxKind.BinaryExpression) { + const op = _optionalChain([parent, 'access', _1197 => _1197.operatorToken, 'optionalAccess', _1198 => _1198.kind]); if (parent.left === n && (op === _ast.SyntaxKind.EqualsToken || op === _ast.SyntaxKind.InKeyword)) { return; } const other = parent.left === n ? parent.right : parent.left; const equality = [_ast.SyntaxKind.EqualsEqualsEqualsToken, _ast.SyntaxKind.ExclamationEqualsEqualsToken].includes(op); - if (equality && (_optionalChain([other, 'optionalAccess', _1187 => _1187.kind]) === _ast.SyntaxKind.StringLiteral || _optionalChain([other, 'optionalAccess', _1188 => _1188.kind]) === _ast.SyntaxKind.NumericLiteral)) { + if (equality && (_optionalChain([other, 'optionalAccess', _1199 => _1199.kind]) === _ast.SyntaxKind.StringLiteral || _optionalChain([other, 'optionalAccess', _1200 => _1200.kind]) === _ast.SyntaxKind.NumericLiteral)) { return; } } let use = n; let guarded = false; - while (_optionalChain([use, 'access', _1189 => _1189.parent, 'optionalAccess', _1190 => _1190.kind]) === _ast.SyntaxKind.ParenthesizedExpression || _optionalChain([use, 'access', _1191 => _1191.parent, 'optionalAccess', _1192 => _1192.kind]) === _ast.SyntaxKind.ConditionalExpression && use.parent.condition !== use) { + while (_optionalChain([use, 'access', _1201 => _1201.parent, 'optionalAccess', _1202 => _1202.kind]) === _ast.SyntaxKind.ParenthesizedExpression || _optionalChain([use, 'access', _1203 => _1203.parent, 'optionalAccess', _1204 => _1204.kind]) === _ast.SyntaxKind.ConditionalExpression && use.parent.condition !== use) { if (use.parent.kind === _ast.SyntaxKind.ConditionalExpression) { guarded = guarded || this.goGetArgArmIsNilGuarded(n, use.parent); } @@ -12723,9 +12845,9 @@ ${this.getIden(level)}}()`; safe = pointer && this.goGetArgPointerStoredAsValue(use, param); return; } - if (_optionalChain([parent, 'optionalAccess', _1193 => _1193.kind]) === _ast.SyntaxKind.BinaryExpression) { + if (_optionalChain([parent, 'optionalAccess', _1205 => _1205.kind]) === _ast.SyntaxKind.BinaryExpression) { const other = parent.left === n ? parent.right : parent.left; - const isNullTest = _optionalChain([other, 'optionalAccess', _1194 => _1194.kind]) === _ast.SyntaxKind.NullKeyword || _optionalChain([other, 'optionalAccess', _1195 => _1195.kind]) === _ast.SyntaxKind.Identifier && other.text === "undefined"; + const isNullTest = _optionalChain([other, 'optionalAccess', _1206 => _1206.kind]) === _ast.SyntaxKind.NullKeyword || _optionalChain([other, 'optionalAccess', _1207 => _1207.kind]) === _ast.SyntaxKind.Identifier && other.text === "undefined"; if (isNullTest) { safe = pointer || !boxed; return; @@ -12733,12 +12855,12 @@ ${this.getIden(level)}}()`; return; } } - if (_optionalChain([parent, 'optionalAccess', _1196 => _1196.kind]) === _ast.SyntaxKind.CallExpression) { + if (_optionalChain([parent, 'optionalAccess', _1208 => _1208.kind]) === _ast.SyntaxKind.CallExpression) { const args = _nullishCoalesce(parent.arguments, () => ( [])); const argIndex = args.indexOf(n); const callee = parent.expression; - let calleeName = _optionalChain([callee, 'optionalAccess', _1197 => _1197.name]) !== void 0 ? callee.name.text : _optionalChain([callee, 'optionalAccess', _1198 => _1198.text]) !== void 0 ? callee.text : void 0; - if (_optionalChain([callee, 'optionalAccess', _1199 => _1199.expression, 'optionalAccess', _1200 => _1200.text]) === "Math" && (calleeName === "min" || calleeName === "max")) { + let calleeName = _optionalChain([callee, 'optionalAccess', _1209 => _1209.name]) !== void 0 ? callee.name.text : _optionalChain([callee, 'optionalAccess', _1210 => _1210.text]) !== void 0 ? callee.text : void 0; + if (_optionalChain([callee, 'optionalAccess', _1211 => _1211.expression, 'optionalAccess', _1212 => _1212.text]) === "Math" && (calleeName === "min" || calleeName === "max")) { calleeName = "math" + calleeName.charAt(0).toUpperCase() + calleeName.slice(1); } if (calleeName === void 0) { @@ -12752,7 +12874,7 @@ ${this.getIden(level)}}()`; } if (calleeName === "IsEqual" && nilable) { const other = argIndex === 0 ? args[1] : args[0]; - const otherIsNil = other === void 0 || _optionalChain([other, 'optionalAccess', _1201 => _1201.kind]) === _ast.SyntaxKind.NullKeyword || _optionalChain([other, 'optionalAccess', _1202 => _1202.kind]) === _ast.SyntaxKind.Identifier && other.text === "undefined"; + const otherIsNil = other === void 0 || _optionalChain([other, 'optionalAccess', _1213 => _1213.kind]) === _ast.SyntaxKind.NullKeyword || _optionalChain([other, 'optionalAccess', _1214 => _1214.kind]) === _ast.SyntaxKind.Identifier && other.text === "undefined"; if (otherIsNil) { safe = false; return; @@ -12769,7 +12891,7 @@ ${this.getIden(level)}}()`; safe = true; return; } - if (_optionalChain([parent, 'optionalAccess', _1203 => _1203.kind]) === _ast.SyntaxKind.ExpressionStatement) { + if (_optionalChain([parent, 'optionalAccess', _1215 => _1215.kind]) === _ast.SyntaxKind.ExpressionStatement) { safe = true; return; } @@ -12794,7 +12916,7 @@ ${this.getIden(level)}}()`; // derefScalar both operands at entry (checked on the printed text by the caller's diff) goGetArgPointerInHelperArithmetic(n) { const parent = n.parent; - if (_optionalChain([parent, 'optionalAccess', _1204 => _1204.kind]) !== _ast.SyntaxKind.BinaryExpression) { + if (_optionalChain([parent, 'optionalAccess', _1216 => _1216.kind]) !== _ast.SyntaxKind.BinaryExpression) { return false; } const ops = [ @@ -12807,7 +12929,7 @@ ${this.getIden(level)}}()`; _ast.SyntaxKind.GreaterThanEqualsToken, _ast.SyntaxKind.LessThanEqualsToken ]; - if (!ops.includes(_optionalChain([parent, 'access', _1205 => _1205.operatorToken, 'optionalAccess', _1206 => _1206.kind]))) { + if (!ops.includes(_optionalChain([parent, 'access', _1217 => _1217.operatorToken, 'optionalAccess', _1218 => _1218.kind]))) { return false; } const printed = this.printNode(parent, 0).trim(); @@ -12818,12 +12940,12 @@ ${this.getIden(level)}}()`; // dictionary to its caller, so it keeps the box goGetArgPointerStoredAsValue(n, param) { const parent = n.parent; - const stored = _optionalChain([parent, 'optionalAccess', _1207 => _1207.kind]) === _ast.SyntaxKind.BinaryExpression && parent.right === n && _optionalChain([parent, 'access', _1208 => _1208.operatorToken, 'optionalAccess', _1209 => _1209.kind]) === _ast.SyntaxKind.EqualsToken && _optionalChain([parent, 'access', _1210 => _1210.left, 'optionalAccess', _1211 => _1211.kind]) === _ast.SyntaxKind.ElementAccessExpression || _optionalChain([parent, 'optionalAccess', _1212 => _1212.kind]) === _ast.SyntaxKind.PropertyAssignment && parent.initializer === n; - let method = _optionalChain([param, 'optionalAccess', _1213 => _1213.parent]); - while (method !== void 0 && !_chunk4FDYB2TTcjs.isFunctionLike.call(void 0, method)) { + const stored = _optionalChain([parent, 'optionalAccess', _1219 => _1219.kind]) === _ast.SyntaxKind.BinaryExpression && parent.right === n && _optionalChain([parent, 'access', _1220 => _1220.operatorToken, 'optionalAccess', _1221 => _1221.kind]) === _ast.SyntaxKind.EqualsToken && _optionalChain([parent, 'access', _1222 => _1222.left, 'optionalAccess', _1223 => _1223.kind]) === _ast.SyntaxKind.ElementAccessExpression || _optionalChain([parent, 'optionalAccess', _1224 => _1224.kind]) === _ast.SyntaxKind.PropertyAssignment && parent.initializer === n; + let method = _optionalChain([param, 'optionalAccess', _1225 => _1225.parent]); + while (method !== void 0 && !_chunkUBXMRIM6cjs.isFunctionLike.call(void 0, method)) { method = method.parent; } - const methodName = String(_nullishCoalesce(_optionalChain([method, 'optionalAccess', _1214 => _1214.name, 'optionalAccess', _1215 => _1215.text]), () => ( ""))); + const methodName = String(_nullishCoalesce(_optionalChain([method, 'optionalAccess', _1226 => _1226.name, 'optionalAccess', _1227 => _1227.text]), () => ( ""))); return stored && !methodName.endsWith("Request"); } // element `index` of a tuple-typed call result is `Dict` (`[T, Dict]`); the Go tuple holds @@ -12833,49 +12955,49 @@ ${this.getIden(level)}}()`; if (checker === void 0 || index < 0) { return false; } - const expr = _optionalChain([right, 'optionalAccess', _1216 => _1216.kind]) === _ast.SyntaxKind.AwaitExpression ? right.expression : right; - if (_optionalChain([expr, 'optionalAccess', _1217 => _1217.kind]) !== _ast.SyntaxKind.CallExpression) { + const expr = _optionalChain([right, 'optionalAccess', _1228 => _1228.kind]) === _ast.SyntaxKind.AwaitExpression ? right.expression : right; + if (_optionalChain([expr, 'optionalAccess', _1229 => _1229.kind]) !== _ast.SyntaxKind.CallExpression) { return false; } const type = checker.getTypeAtLocation(expr); if (type === void 0 || !checker.isTupleType(type)) { return this.goParamsTupleHelperIndex(expr) === index; } - const element = _optionalChain([checker, 'access', _1218 => _1218.getTypeArguments, 'call', _1219 => _1219(type), 'optionalAccess', _1220 => _1220[index]]); + const element = _optionalChain([checker, 'access', _1230 => _1230.getTypeArguments, 'call', _1231 => _1231(type), 'optionalAccess', _1232 => _1232[index]]); return element !== void 0 && !(element.flags & (_sync.TypeFlags.Any | _sync.TypeFlags.Unknown)) && this.goParameterTypeIsDict(element); } // `this.handleXxx(…, params, …)` of a base helper typed `any[]` whose element holds the params // map it was given after omit/extend; only when that element is the same map-typed local goParamsTupleHelperIndex(call) { - const callee = _optionalChain([call, 'optionalAccess', _1221 => _1221.expression]); - if (_optionalChain([callee, 'optionalAccess', _1222 => _1222.kind]) !== _ast.SyntaxKind.PropertyAccessExpression || _optionalChain([callee, 'access', _1223 => _1223.expression, 'optionalAccess', _1224 => _1224.kind]) !== _ast.SyntaxKind.ThisKeyword) { + const callee = _optionalChain([call, 'optionalAccess', _1233 => _1233.expression]); + if (_optionalChain([callee, 'optionalAccess', _1234 => _1234.kind]) !== _ast.SyntaxKind.PropertyAccessExpression || _optionalChain([callee, 'access', _1235 => _1235.expression, 'optionalAccess', _1236 => _1236.kind]) !== _ast.SyntaxKind.ThisKeyword) { return -1; } - const index = GO_PARAMS_TUPLE_HELPERS[_optionalChain([callee, 'access', _1225 => _1225.name, 'optionalAccess', _1226 => _1226.text])]; + const index = GO_PARAMS_TUPLE_HELPERS[_optionalChain([callee, 'access', _1237 => _1237.name, 'optionalAccess', _1238 => _1238.text])]; if (index === void 0) { return -1; } - const target = _optionalChain([call, 'access', _1227 => _1227.parent, 'optionalAccess', _1228 => _1228.left, 'optionalAccess', _1229 => _1229.elements, 'optionalAccess', _1230 => _1230[index]]); - const passesTarget = _optionalChain([target, 'optionalAccess', _1231 => _1231.kind]) === _ast.SyntaxKind.Identifier && (_nullishCoalesce(call.arguments, () => ( []))).some((a) => a.kind === _ast.SyntaxKind.Identifier && a.text === target.text); + const target = _optionalChain([call, 'access', _1239 => _1239.parent, 'optionalAccess', _1240 => _1240.left, 'optionalAccess', _1241 => _1241.elements, 'optionalAccess', _1242 => _1242[index]]); + const passesTarget = _optionalChain([target, 'optionalAccess', _1243 => _1243.kind]) === _ast.SyntaxKind.Identifier && (_nullishCoalesce(call.arguments, () => ( []))).some((a) => a.kind === _ast.SyntaxKind.Identifier && a.text === target.text); return passesTarget ? index : -1; } // the safety check of a map-typed GetArg local: a Dict tuple element written into it is printed // through MapTyped once the local is bound as a map (no recursion into goGetArgLocalType) goGetArgTupleWriteIsDict(declaration, right, index) { - return _optionalChain([declaration, 'optionalAccess', _1232 => _1232.kind]) === _ast.SyntaxKind.Parameter && declaration.initializer !== void 0 && this.goTupleElementIsDict(right, index); + return _optionalChain([declaration, 'optionalAccess', _1244 => _1244.kind]) === _ast.SyntaxKind.Parameter && declaration.initializer !== void 0 && this.goTupleElementIsDict(right, index); } // `[x, params] = f()` writes a GetArg local bound as map[string]any: unbox the element goGetArgBindsDictElement(leftElement, right, index) { - if (_optionalChain([leftElement, 'optionalAccess', _1233 => _1233.kind]) !== _ast.SyntaxKind.Identifier || !this.goTupleElementIsDict(right, index)) { + if (_optionalChain([leftElement, 'optionalAccess', _1245 => _1245.kind]) !== _ast.SyntaxKind.Identifier || !this.goTupleElementIsDict(right, index)) { return false; } let decl; try { - decl = _optionalChain([this, 'access', _1234 => _1234.checkerOrUndefined, 'call', _1235 => _1235(), 'optionalAccess', _1236 => _1236.getSymbolAtLocation, 'call', _1237 => _1237(leftElement), 'optionalAccess', _1238 => _1238.valueDeclaration, 'optionalAccess', _1239 => _1239.resolve, 'call', _1240 => _1240()]); + decl = _optionalChain([this, 'access', _1246 => _1246.checkerOrUndefined, 'call', _1247 => _1247(), 'optionalAccess', _1248 => _1248.getSymbolAtLocation, 'call', _1249 => _1249(leftElement), 'optionalAccess', _1250 => _1250.valueDeclaration, 'optionalAccess', _1251 => _1251.resolve, 'call', _1252 => _1252()]); } catch (e) { decl = void 0; } - if (_optionalChain([decl, 'optionalAccess', _1241 => _1241.kind]) !== _ast.SyntaxKind.Parameter || decl.initializer === void 0 || _optionalChain([decl, 'access', _1242 => _1242.parent, 'optionalAccess', _1243 => _1243.body]) === void 0) { + if (_optionalChain([decl, 'optionalAccess', _1253 => _1253.kind]) !== _ast.SyntaxKind.Parameter || decl.initializer === void 0 || _optionalChain([decl, 'access', _1254 => _1254.parent, 'optionalAccess', _1255 => _1255.body]) === void 0) { return false; } return this.goGetArgParameterType(decl) === "map[string]any"; @@ -12883,7 +13005,7 @@ ${this.getIden(level)}}()`; // the Go type a defaulted parameter's GetArg twin binds (undefined: the `any` GetArg); the one // predicate shared by the binding line and every consumer's printing goGetArgParameterType(decl) { - if (_optionalChain([decl, 'optionalAccess', _1244 => _1244.kind]) !== _ast.SyntaxKind.Parameter || decl.initializer === void 0 || decl.dotDotDotToken !== void 0 || _optionalChain([decl, 'access', _1245 => _1245.name, 'optionalAccess', _1246 => _1246.kind]) !== _ast.SyntaxKind.Identifier || _optionalChain([decl, 'access', _1247 => _1247.parent, 'optionalAccess', _1248 => _1248.body]) === void 0 || ![_ast.SyntaxKind.MethodDeclaration, _ast.SyntaxKind.FunctionDeclaration].includes(decl.parent.kind)) { + if (_optionalChain([decl, 'optionalAccess', _1256 => _1256.kind]) !== _ast.SyntaxKind.Parameter || decl.initializer === void 0 || decl.dotDotDotToken !== void 0 || _optionalChain([decl, 'access', _1257 => _1257.name, 'optionalAccess', _1258 => _1258.kind]) !== _ast.SyntaxKind.Identifier || _optionalChain([decl, 'access', _1259 => _1259.parent, 'optionalAccess', _1260 => _1260.body]) === void 0 || ![_ast.SyntaxKind.MethodDeclaration, _ast.SyntaxKind.FunctionDeclaration].includes(decl.parent.kind)) { return void 0; } this.goGetArgTypeCache ??= /* @__PURE__ */ new WeakMap(); @@ -12908,13 +13030,13 @@ ${this.getIden(level)}}()`; } let decl; try { - decl = _optionalChain([this, 'access', _1249 => _1249.getChecker, 'call', _1250 => _1250(), 'access', _1251 => _1251.getSymbolAtLocation, 'call', _1252 => _1252(callee), 'optionalAccess', _1253 => _1253.valueDeclaration, 'optionalAccess', _1254 => _1254.resolve, 'call', _1255 => _1255()]); + decl = _optionalChain([this, 'access', _1261 => _1261.getChecker, 'call', _1262 => _1262(), 'access', _1263 => _1263.getSymbolAtLocation, 'call', _1264 => _1264(callee), 'optionalAccess', _1265 => _1265.valueDeclaration, 'optionalAccess', _1266 => _1266.resolve, 'call', _1267 => _1267()]); } catch (e) { decl = void 0; } const kinds = [_ast.SyntaxKind.MethodDeclaration, _ast.SyntaxKind.FunctionDeclaration]; - const param = decl !== void 0 && kinds.includes(decl.kind) ? _optionalChain([decl, 'access', _1256 => _1256.parameters, 'optionalAccess', _1257 => _1257[argIndex]]) : void 0; - return _optionalChain([param, 'optionalAccess', _1258 => _1258.initializer]) !== void 0 && param.dotDotDotToken === void 0; + const param = decl !== void 0 && kinds.includes(decl.kind) ? _optionalChain([decl, 'access', _1268 => _1268.parameters, 'optionalAccess', _1269 => _1269[argIndex]]) : void 0; + return _optionalChain([param, 'optionalAccess', _1270 => _1270.initializer]) !== void 0 && param.dotDotDotToken === void 0; } // the callee's own GetArg with a container default returns def for an untyped nil box but the // nil map for a nil map box (nil slices collapse to def), so only map shapes differ @@ -12928,10 +13050,10 @@ ${this.getIden(level)}}()`; } catch (e) { symbol = void 0; } - const decl = _optionalChain([symbol, 'optionalAccess', _1259 => _1259.valueDeclaration, 'optionalAccess', _1260 => _1260.resolve, 'call', _1261 => _1261()]); - const params = _nullishCoalesce(_optionalChain([decl, 'optionalAccess', _1262 => _1262.parameters]), () => ( [])); + const decl = _optionalChain([symbol, 'optionalAccess', _1271 => _1271.valueDeclaration, 'optionalAccess', _1272 => _1272.resolve, 'call', _1273 => _1273()]); + const params = _nullishCoalesce(_optionalChain([decl, 'optionalAccess', _1274 => _1274.parameters]), () => ( [])); const param = params[argIndex]; - const initializer = _optionalChain([param, 'optionalAccess', _1263 => _1263.initializer]); + const initializer = _optionalChain([param, 'optionalAccess', _1275 => _1275.initializer]); if (initializer === void 0) { return false; } @@ -13032,7 +13154,7 @@ ${this.getIden(level)}}()`; return `${line}${character}`; } printExpressionStatement(node, identation) { - if (_optionalChain([node, 'optionalAccess', _1264 => _1264.expression, 'optionalAccess', _1265 => _1265.kind]) === _ast.SyntaxKind.AsExpression) { + if (_optionalChain([node, 'optionalAccess', _1276 => _1276.expression, 'optionalAccess', _1277 => _1277.kind]) === _ast.SyntaxKind.AsExpression) { node = node.expression; } if (node.expression.kind !== _ast.SyntaxKind.AwaitExpression) { @@ -13079,10 +13201,10 @@ ${this.getIden(identation)}PanicOnError(${exprStm.trim()})`; let rightPart = exp ? " " + this.printNode(exp, identation) : ""; rightPart = rightPart.trim(); const returnStatement = this.getAsyncReturnStatement(node); - if (_optionalChain([node, 'optionalAccess', _1266 => _1266.expression, 'optionalAccess', _1267 => _1267.kind]) === _ast.SyntaxKind.AsExpression) { + if (_optionalChain([node, 'optionalAccess', _1278 => _1278.expression, 'optionalAccess', _1279 => _1279.kind]) === _ast.SyntaxKind.AsExpression) { node = node.expression; } - if (_optionalChain([node, 'optionalAccess', _1268 => _1268.expression, 'optionalAccess', _1269 => _1269.kind]) === _ast.SyntaxKind.AwaitExpression) { + if (_optionalChain([node, 'optionalAccess', _1280 => _1280.expression, 'optionalAccess', _1281 => _1281.kind]) === _ast.SyntaxKind.AwaitExpression) { const returnRandName = "retRes" + this.getLineBasedSuffix(node.expression); const printedExpr = rightPart; rightPart = rightPart ? rightPart + this.LINE_TERMINATOR : this.LINE_TERMINATOR; @@ -13110,7 +13232,7 @@ ${this.getIden(identation)}${returnStatement}`; printArrayLiteralExpression(node, identation = 0) { const elements = node.elements.map((e) => this.goWithExprDepth(1, () => this.printNode(e, identation)).trim()).join(", "); const first = node.elements[0]; - const arrayOpen = _optionalChain([first, 'optionalAccess', _1270 => _1270.kind]) === _ast.SyntaxKind.CallExpression && (this.getFunctionType(first) || true) ? "[]any{" : this.ARRAY_OPENING_TOKEN; + const arrayOpen = _optionalChain([first, 'optionalAccess', _1282 => _1282.kind]) === _ast.SyntaxKind.CallExpression && (this.getFunctionType(first) || true) ? "[]any{" : this.ARRAY_OPENING_TOKEN; return arrayOpen + elements + this.ARRAY_CLOSING_TOKEN; } printArgsForCallExpression(node, identation) { @@ -13139,8 +13261,8 @@ ${this.getIden(identation)}${returnStatement}`; } if (n.kind === _ast.SyntaxKind.Identifier && n.text === name && n !== nameNode) { const parent = n.parent; - const isDeclarationName = _optionalChain([parent, 'optionalAccess', _1271 => _1271.kind]) === _ast.SyntaxKind.VariableDeclaration && parent.name === n; - const isPropertyName = _optionalChain([parent, 'optionalAccess', _1272 => _1272.kind]) === _ast.SyntaxKind.PropertyAccessExpression && parent.name === n; + const isDeclarationName = _optionalChain([parent, 'optionalAccess', _1283 => _1283.kind]) === _ast.SyntaxKind.VariableDeclaration && parent.name === n; + const isPropertyName = _optionalChain([parent, 'optionalAccess', _1284 => _1284.kind]) === _ast.SyntaxKind.PropertyAccessExpression && parent.name === n; if (!isDeclarationName && !isPropertyName) { used = true; return; @@ -13160,8 +13282,8 @@ ${this.getIden(identation)}${returnStatement}`; return false; } const symbol = checker.getSymbolAtLocation(nameNode); - const declaration = _optionalChain([symbol, 'optionalAccess', _1273 => _1273.valueDeclaration, 'optionalAccess', _1274 => _1274.resolve, 'call', _1275 => _1275()]); - if (_optionalChain([declaration, 'optionalAccess', _1276 => _1276.kind]) !== _ast.SyntaxKind.VariableDeclaration || declaration.initializer === void 0) { + const declaration = _optionalChain([symbol, 'optionalAccess', _1285 => _1285.valueDeclaration, 'optionalAccess', _1286 => _1286.resolve, 'call', _1287 => _1287()]); + if (_optionalChain([declaration, 'optionalAccess', _1288 => _1288.kind]) !== _ast.SyntaxKind.VariableDeclaration || declaration.initializer === void 0) { return false; } if (this.goTypeOfInitializer(declaration.initializer, this.printNode(declaration.initializer, 0)) !== "[]any") { @@ -13179,7 +13301,7 @@ ${this.getIden(identation)}${returnStatement}`; } if (n.kind === _ast.SyntaxKind.Identifier && n.text === name && n !== declaration.name && n !== nameNode) { const parent = n.parent; - if (_optionalChain([parent, 'optionalAccess', _1277 => _1277.kind]) === _ast.SyntaxKind.VariableDeclaration && parent.name === n) { + if (_optionalChain([parent, 'optionalAccess', _1289 => _1289.kind]) === _ast.SyntaxKind.VariableDeclaration && parent.name === n) { return; } if (this.goRebindingTargetOf(n) !== void 0) { @@ -13198,8 +13320,8 @@ ${this.getIden(identation)}${returnStatement}`; if (typeof parsedArg !== "string" || parsedArg.includes("\n")) { return void 0; } - const argNode = _optionalChain([node, 'access', _1278 => _1278.arguments, 'optionalAccess', _1279 => _1279[0]]); - if (_optionalChain([argNode, 'optionalAccess', _1280 => _1280.kind]) !== _ast.SyntaxKind.Identifier) { + const argNode = _optionalChain([node, 'access', _1290 => _1290.arguments, 'optionalAccess', _1291 => _1291[0]]); + if (_optionalChain([argNode, 'optionalAccess', _1292 => _1292.kind]) !== _ast.SyntaxKind.Identifier) { return void 0; } const goType = this.goPrintedTypeOfExpression(argNode, parsedArg); @@ -13257,7 +13379,7 @@ ${this.getIden(level)}}()`; // emitted Go call has two or more arguments, which go/printer lays out one level // deeper (a native `a + b` argument then drops its blanks) goPrintCallArgument(argument, printedText) { - if (_optionalChain([argument, 'optionalAccess', _1281 => _1281.kind]) !== _ast.SyntaxKind.BinaryExpression || printedText === void 0) { + if (_optionalChain([argument, 'optionalAccess', _1293 => _1293.kind]) !== _ast.SyntaxKind.BinaryExpression || printedText === void 0) { return printedText; } return this.goWithExprDepth(this.goExprDepth + 1, () => this.printNode(argument, 0)).trimStart(); @@ -13265,12 +13387,12 @@ ${this.getIden(level)}}()`; printArrayPushCall(node, identation, name = void 0, parsedArg = void 0) { let returnValue = ""; let returnRandName = name; - parsedArg = this.goPrintCallArgument(_optionalChain([node, 'access', _1282 => _1282.arguments, 'optionalAccess', _1283 => _1283[0]]), parsedArg); + parsedArg = this.goPrintCallArgument(_optionalChain([node, 'access', _1294 => _1294.arguments, 'optionalAccess', _1295 => _1295[0]]), parsedArg); const nativeReceiver = this.goNativeAppendReceiver(node); if (nativeReceiver !== void 0) { return `${nativeReceiver} = append(${nativeReceiver}, ${parsedArg})`; } - if (_optionalChain([name, 'optionalAccess', _1284 => _1284.startsWith, 'call', _1285 => _1285("GetValue")]) || /[\])]$/.test(_nullishCoalesce(name, () => ( "")))) { + if (_optionalChain([name, 'optionalAccess', _1296 => _1296.startsWith, 'call', _1297 => _1297("GetValue")]) || /[\])]$/.test(_nullishCoalesce(name, () => ( "")))) { returnRandName = "retRes" + this.getLineBasedSuffix(node); returnValue = `${returnRandName} := ${name} ${this.getIden(identation)}`; @@ -13287,7 +13409,7 @@ ${this.getIden(identation)}`; if (this.goIsAnyBoxExpression(node, printedText)) { return void 0; } - if (_optionalChain([node, 'optionalAccess', _1286 => _1286.kind]) === _ast.SyntaxKind.Identifier) { + if (_optionalChain([node, 'optionalAccess', _1298 => _1298.kind]) === _ast.SyntaxKind.Identifier) { return this.goDeclaredTypeOfIdentifier(node); } if (GO_ANY_BOX_CALLS.indexOf(this.goPrintedCallee(printedText)) >= 0) { @@ -13299,7 +13421,7 @@ ${this.getIden(identation)}`; // after their TRANSPILED marker, ws cache tests after their first separator), which would cut off // the leading file-level import; they keep the helper until their writer adds the import itself. goFileKeepsFileLevelImports() { - const fileName = _nullishCoalesce(_optionalChain([this, 'access', _1287 => _1287.getSrc, 'call', _1288 => _1288(), 'optionalAccess', _1289 => _1289.fileName]), () => ( "")); + const fileName = _nullishCoalesce(_optionalChain([this, 'access', _1299 => _1299.getSrc, 'call', _1300 => _1300(), 'optionalAccess', _1301 => _1301.fileName]), () => ( "")); return !/(?:base\/Exchange(?:\.nooverloads\.\d+)?|base\/PredictionExchange|base\/test\.orderBook|base\/test\.cache)\.ts$/.test(fileName); } // `GetIndexOf(s, t)` is `strings.Index(s, t)` for a receiver declared `string` once `t` is a @@ -13315,8 +13437,8 @@ ${this.getIden(identation)}`; if (!this.goFileKeepsFileLevelImports()) { return void 0; } - const receiver = this.goUnwrapPrintedAssertions(_optionalChain([node, 'optionalAccess', _1290 => _1290.expression, 'optionalAccess', _1291 => _1291.expression])); - const target = this.goUnwrapPrintedAssertions(_optionalChain([node, 'optionalAccess', _1292 => _1292.arguments, 'optionalAccess', _1293 => _1293[0]])); + const receiver = this.goUnwrapPrintedAssertions(_optionalChain([node, 'optionalAccess', _1302 => _1302.expression, 'optionalAccess', _1303 => _1303.expression])); + const target = this.goUnwrapPrintedAssertions(_optionalChain([node, 'optionalAccess', _1304 => _1304.arguments, 'optionalAccess', _1305 => _1305[0]])); if (this.goIndexOfOperandType(target, parsedArg) !== "string") { return void 0; } @@ -13325,7 +13447,7 @@ ${this.getIden(identation)}`; this.goFileStdlibImports.add("strings"); return `strings.Index(${name}, ${parsedArg})`; } - if (receiverType === "*string" && _optionalChain([receiver, 'optionalAccess', _1294 => _1294.kind]) === _ast.SyntaxKind.Identifier) { + if (receiverType === "*string" && _optionalChain([receiver, 'optionalAccess', _1306 => _1306.kind]) === _ast.SyntaxKind.Identifier) { this.goFileStdlibImports.add("strings"); const level = this.goStatementLevel; const body = this.getIden(level + 1); @@ -13340,7 +13462,7 @@ ${this.getIden(level)}}()`; return void 0; } printIndexOfCall(node, identation, name = void 0, parsedArg = void 0) { - const native = this.goNativeIndexOf(node, name, parsedArg); + const native = _nullishCoalesce(this.goHx4G06DerefIndexOf(node, name, parsedArg), () => ( this.goNativeIndexOf(node, name, parsedArg))); if (native !== void 0) { return native; } @@ -13358,7 +13480,7 @@ ${this.getIden(level)}}()`; } if (this.goOperandStaticType(operand, texts[i]) === expected[i]) { result.push(texts[i]); - } else if (expected[i] === "string" && !texts[i].includes("\n") && this.goDerefableStringOperand(operand)) { + } else if (expected[i] === "string" && !texts[i].includes("\n") && (this.goDerefableStringOperand(operand) || this.goLiteralUnionNarrowedStringDeref(operand))) { result.push("*" + texts[i].trim()); } else { return void 0; @@ -13368,7 +13490,7 @@ ${this.getIden(level)}}()`; } // `(x as T)` and `(x)` print as `x`, so the operand's own Go type governs the printed receiver goUnwrapPrintedAssertions(node) { - while (_optionalChain([node, 'optionalAccess', _1295 => _1295.kind]) === _ast.SyntaxKind.AsExpression || _optionalChain([node, 'optionalAccess', _1296 => _1296.kind]) === _ast.SyntaxKind.ParenthesizedExpression) { + while (_optionalChain([node, 'optionalAccess', _1307 => _1307.kind]) === _ast.SyntaxKind.AsExpression || _optionalChain([node, 'optionalAccess', _1308 => _1308.kind]) === _ast.SyntaxKind.ParenthesizedExpression) { node = node.expression; } return node; @@ -13377,8 +13499,8 @@ ${this.getIden(level)}}()`; // every operand matches `expected` and the file's stdlib import can be placed (see // goStdlibImportIsPlaceable), else the helper call; an unprinted argument keeps the helper goNativeStringCallOr(node, texts, expected, nativeCall, helperCall, unwrapReceiver = false) { - const receiver = unwrapReceiver ? this.goUnwrapPrintedAssertions(_optionalChain([node, 'access', _1297 => _1297.expression, 'optionalAccess', _1298 => _1298.expression])) : _optionalChain([node, 'access', _1299 => _1299.expression, 'optionalAccess', _1300 => _1300.expression]); - const operands = [receiver, ...expected.slice(1).map((_, i) => _optionalChain([node, 'access', _1301 => _1301.arguments, 'optionalAccess', _1302 => _1302[i]]))]; + const receiver = unwrapReceiver ? this.goUnwrapPrintedAssertions(_optionalChain([node, 'access', _1309 => _1309.expression, 'optionalAccess', _1310 => _1310.expression])) : _optionalChain([node, 'access', _1311 => _1311.expression, 'optionalAccess', _1312 => _1312.expression]); + const operands = [receiver, ...expected.slice(1).map((_, i) => _optionalChain([node, 'access', _1313 => _1313.arguments, 'optionalAccess', _1314 => _1314[i]]))]; const ops = texts.slice(1).includes(void 0) ? void 0 : this.goNativeStringOperandTexts(operands, texts, expected); if (ops !== void 0 && this.goStdlibImportIsPlaceable()) { this.goFileStdlibImports.add("strings"); @@ -13439,11 +13561,11 @@ ${this.getIden(level)}}()`; // *string (derefScalar answers nil) or a float64 keeps the helper's runtime formatting. printToStringCall(node, identation, name = void 0) { if (name !== void 0 && name.indexOf("\n") < 0) { - const receiver = _optionalChain([node, 'optionalAccess', _1303 => _1303.expression, 'optionalAccess', _1304 => _1304.kind]) === _ast.SyntaxKind.PropertyAccessExpression ? node.expression.expression : void 0; + const receiver = _optionalChain([node, 'optionalAccess', _1315 => _1315.expression, 'optionalAccess', _1316 => _1316.kind]) === _ast.SyntaxKind.PropertyAccessExpression ? node.expression.expression : void 0; if (receiver !== void 0 && this.goOperandStaticType(receiver, name) === "string") { return name; } - if (receiver !== void 0 && this.goDerefableStringOperand(receiver)) { + if (receiver !== void 0 && (this.goDerefableStringOperand(receiver) || this.goLiteralUnionNarrowedStringDeref(receiver))) { return "*" + name.trim(); } if (receiver !== void 0 && this.goOperandStaticType(receiver, name) === "int64" && this.goStdlibImportIsPlaceable()) { @@ -13478,7 +13600,7 @@ ${this.getIden(level)}}()`; // negative bound counts from the end, a start-only call clamps its start to 0 and an // end past len is clamped to len, where Go's native slicing panics goSliceLiteralBound(node) { - if (_optionalChain([node, 'optionalAccess', _1305 => _1305.kind]) === _ast.SyntaxKind.NumericLiteral) { + if (_optionalChain([node, 'optionalAccess', _1317 => _1317.kind]) === _ast.SyntaxKind.NumericLiteral) { const text = node.text; if (!/^\d+$/.test(text)) { return void 0; @@ -13486,7 +13608,7 @@ ${this.getIden(level)}}()`; const value = Number(text); return value > 2147483647 ? void 0 : value; } - if (_optionalChain([node, 'optionalAccess', _1306 => _1306.kind]) === _ast.SyntaxKind.PrefixUnaryExpression && node.operator === _ast.SyntaxKind.MinusToken) { + if (_optionalChain([node, 'optionalAccess', _1318 => _1318.kind]) === _ast.SyntaxKind.PrefixUnaryExpression && node.operator === _ast.SyntaxKind.MinusToken) { const operand = this.goSliceLiteralBound(node.operand); return operand === void 0 ? void 0 : -operand; } @@ -13513,11 +13635,11 @@ ${this.getIden(level)}}()`; // `*string` a nil-guarded one, while anything else (an `any` box) keeps the helper. // A TS cast (`(id as string).slice(...)`) prints nothing, so it is transparent here. goSliceReceiverType(node) { - let receiverNode = _optionalChain([node, 'optionalAccess', _1307 => _1307.expression, 'optionalAccess', _1308 => _1308.expression]); - while (_optionalChain([receiverNode, 'optionalAccess', _1309 => _1309.kind]) === _ast.SyntaxKind.AsExpression || _optionalChain([receiverNode, 'optionalAccess', _1310 => _1310.kind]) === _ast.SyntaxKind.NonNullExpression || _optionalChain([receiverNode, 'optionalAccess', _1311 => _1311.kind]) === _ast.SyntaxKind.ParenthesizedExpression) { + let receiverNode = _optionalChain([node, 'optionalAccess', _1319 => _1319.expression, 'optionalAccess', _1320 => _1320.expression]); + while (_optionalChain([receiverNode, 'optionalAccess', _1321 => _1321.kind]) === _ast.SyntaxKind.AsExpression || _optionalChain([receiverNode, 'optionalAccess', _1322 => _1322.kind]) === _ast.SyntaxKind.NonNullExpression || _optionalChain([receiverNode, 'optionalAccess', _1323 => _1323.kind]) === _ast.SyntaxKind.ParenthesizedExpression) { receiverNode = receiverNode.expression; } - if (_optionalChain([receiverNode, 'optionalAccess', _1312 => _1312.kind]) !== _ast.SyntaxKind.Identifier) { + if (_optionalChain([receiverNode, 'optionalAccess', _1324 => _1324.kind]) !== _ast.SyntaxKind.Identifier) { return void 0; } const goType = this.goPrintedTypeOfExpression(receiverNode, ""); @@ -13526,7 +13648,7 @@ ${this.getIden(level)}}()`; // the integer-literal bounds of a `.slice(a, b)` call; undefined when a bound is an // expression, whose Go value is not provably a non-negative int the subscript could take goSliceLiteralBounds(node) { - const args = _nullishCoalesce(_optionalChain([node, 'optionalAccess', _1313 => _1313.arguments]), () => ( [])); + const args = _nullishCoalesce(_optionalChain([node, 'optionalAccess', _1325 => _1325.arguments]), () => ( [])); const start = this.goSliceLiteralBound(args[0]); if (start === void 0) { return void 0; @@ -13540,11 +13662,11 @@ ${this.getIden(level)}}()`; } // true when this `.slice(a, b)` call prints native Go slicing of a string value goIsNativeSliceCall(node) { - if (_optionalChain([node, 'optionalAccess', _1314 => _1314.kind]) !== _ast.SyntaxKind.CallExpression) { + if (_optionalChain([node, 'optionalAccess', _1326 => _1326.kind]) !== _ast.SyntaxKind.CallExpression) { return false; } const callee = node.expression; - if (_optionalChain([callee, 'optionalAccess', _1315 => _1315.kind]) !== _ast.SyntaxKind.PropertyAccessExpression || _optionalChain([callee, 'access', _1316 => _1316.name, 'optionalAccess', _1317 => _1317.text]) !== "slice") { + if (_optionalChain([callee, 'optionalAccess', _1327 => _1327.kind]) !== _ast.SyntaxKind.PropertyAccessExpression || _optionalChain([callee, 'access', _1328 => _1328.name, 'optionalAccess', _1329 => _1329.text]) !== "slice") { return false; } if (this.goSliceReceiverType(node) === void 0) { @@ -13584,8 +13706,8 @@ ${body}return ${subscript} ${this.getIden(level)}}()`; } printSliceCall(node, identation, name = void 0, parsedArg = void 0, parsedArg2 = void 0) { - parsedArg = this.goPrintCallArgument(_optionalChain([node, 'access', _1318 => _1318.arguments, 'optionalAccess', _1319 => _1319[0]]), parsedArg); - parsedArg2 = this.goPrintCallArgument(_optionalChain([node, 'access', _1320 => _1320.arguments, 'optionalAccess', _1321 => _1321[1]]), parsedArg2); + parsedArg = this.goPrintCallArgument(_optionalChain([node, 'access', _1330 => _1330.arguments, 'optionalAccess', _1331 => _1331[0]]), parsedArg); + parsedArg2 = this.goPrintCallArgument(_optionalChain([node, 'access', _1332 => _1332.arguments, 'optionalAccess', _1333 => _1333[1]]), parsedArg2); const nativeSlice = this.printInlineSlice(node, name); if (nativeSlice !== void 0) { return nativeSlice; @@ -13679,14 +13801,14 @@ ${this.getIden(level)}}()`; } if (node.expression.kind === _ast.SyntaxKind.NewExpression) { const expression = node.expression; - const argumentsExp = _nullishCoalesce(_optionalChain([expression, 'optionalAccess', _1322 => _1322.arguments]), () => ( [])); + const argumentsExp = _nullishCoalesce(_optionalChain([expression, 'optionalAccess', _1334 => _1334.arguments]), () => ( [])); const parsedArg = _nullishCoalesce(argumentsExp.map((n) => this.printNode(n, 0)).join(","), () => ( "")); const newExpression = this.printNode(expression.expression, 0); if (expression.expression.kind === _ast.SyntaxKind.Identifier) { const id = expression.expression; const symbol = this.getChecker().getSymbolAtLocation(expression.expression); if (symbol) { - const declarations = _nullishCoalesce(_optionalChain([this, 'access', _1323 => _1323.getChecker, 'call', _1324 => _1324(), 'access', _1325 => _1325.getDeclaredTypeOfSymbol, 'call', _1326 => _1326(symbol), 'access', _1327 => _1327.getSymbol, 'call', _1328 => _1328(), 'optionalAccess', _1329 => _1329.declarations, 'optionalAccess', _1330 => _1330.map, 'call', _1331 => _1331((d) => d.resolve())]), () => ( [])); + const declarations = _nullishCoalesce(_optionalChain([this, 'access', _1335 => _1335.getChecker, 'call', _1336 => _1336(), 'access', _1337 => _1337.getDeclaredTypeOfSymbol, 'call', _1338 => _1338(symbol), 'access', _1339 => _1339.getSymbol, 'call', _1340 => _1340(), 'optionalAccess', _1341 => _1341.declarations, 'optionalAccess', _1342 => _1342.map, 'call', _1343 => _1343((d) => d.resolve())]), () => ( [])); const isClassDeclaration5 = declarations.find((l) => l.kind === _ast.SyntaxKind.InterfaceDeclaration || l.kind === _ast.SyntaxKind.ClassDeclaration); if (isClassDeclaration5) { } else { @@ -13831,9 +13953,9 @@ ${this.getIden(identation)}return nil`; } return `AddElementToObject(${leftSide}, ${propName}, ${value})`; } - if (_optionalChain([right, 'optionalAccess', _1332 => _1332.kind]) === _ast.SyntaxKind.AwaitExpression || rightSide.startsWith("<-this.callInternal")) { + if (_optionalChain([right, 'optionalAccess', _1344 => _1344.kind]) === _ast.SyntaxKind.AwaitExpression || rightSide.startsWith("<-this.callInternal")) { const leftParsed = this.printNode(left, 0); - const awaited = _optionalChain([right, 'optionalAccess', _1333 => _1333.kind]) === _ast.SyntaxKind.AwaitExpression ? this.printNode(right, identation) : rightSide; + const awaited = _optionalChain([right, 'optionalAccess', _1345 => _1345.kind]) === _ast.SyntaxKind.AwaitExpression ? this.printNode(right, identation) : rightSide; return ` ${this.getIden(identation)}${leftParsed} = ${awaited} ${this.getIden(identation)}PanicOnError(${leftParsed})`; @@ -14002,7 +14124,7 @@ ${tryBodyBlock} return this.getIden(identation) + this.PrefixFixOperators[operator] + this.printNode(operand, 0); } printNewExpression(node, identation) { - let expression = _optionalChain([node, 'access', _1334 => _1334.expression, 'optionalAccess', _1335 => _1335.text]); + let expression = _optionalChain([node, 'access', _1346 => _1346.expression, 'optionalAccess', _1347 => _1347.text]); expression = expression ? expression : this.printNode(node.expression); if (node.arguments.length === 0) { return `New${this.capitalize(expression)}()`; @@ -14040,7 +14162,7 @@ ${tryBodyBlock} case _ast.SyntaxKind.CallExpression: return this.goTypeOfInitializer(node, printed); case _ast.SyntaxKind.Identifier: - return this.goDeclaredTypeOfIdentifier(node); + return _nullishCoalesce(this.goDeclaredTypeOfIdentifier(node), () => ( this.g01MapParamType(node))); } return void 0; } @@ -14093,7 +14215,7 @@ ${tryBodyBlock} // i.e. a nilable Go pointer. The native read needs GetValue's `*` deref and its nil // answer, neither of which an index expression expresses. goIsDerefStringKeyExpression(node) { - return _optionalChain([node, 'optionalAccess', _1336 => _1336.kind]) === _ast.SyntaxKind.Identifier && this.goDeclaredTypeOfIdentifier(node) === "*string"; + return _optionalChain([node, 'optionalAccess', _1348 => _1348.kind]) === _ast.SyntaxKind.Identifier && this.goDeclaredTypeOfIdentifier(node) === "*string"; } // the nil-guarded native read of a declared map with a `*string` key, reproducing GetValue's key // deref: a nil key reads nil, otherwise the map index (missing key is the `any` nil). gofmt keeps @@ -14111,20 +14233,20 @@ ${this.getIden(level)}}()`; // true for `this.` — the one property-access shape whose Go type the // printer itself cannot name (the fields live in the hand-written Go structs) isGoThisPropertyAccessExpression(node) { - return _optionalChain([node, 'optionalAccess', _1337 => _1337.kind]) === _ast.SyntaxKind.PropertyAccessExpression && _optionalChain([node, 'access', _1338 => _1338.expression, 'optionalAccess', _1339 => _1339.kind]) === _ast.SyntaxKind.ThisKeyword; + return _optionalChain([node, 'optionalAccess', _1349 => _1349.kind]) === _ast.SyntaxKind.PropertyAccessExpression && _optionalChain([node, 'access', _1350 => _1350.expression, 'optionalAccess', _1351 => _1351.kind]) === _ast.SyntaxKind.ThisKeyword; } // true when the element access is the target of an assignment: the binary // expression printer owns that shape (AddElementToObject / rewritten GetValue // chains), a native `x[k]` index there would drop the write isGoElementAccessAssignmentTarget(node) { const parent = node.parent; - return _optionalChain([parent, 'optionalAccess', _1340 => _1340.kind]) === _ast.SyntaxKind.BinaryExpression && parent.left === node && (parent.operatorToken.kind === _ast.SyntaxKind.EqualsToken || parent.operatorToken.kind === _ast.SyntaxKind.PlusEqualsToken); + return _optionalChain([parent, 'optionalAccess', _1352 => _1352.kind]) === _ast.SyntaxKind.BinaryExpression && parent.left === node && (parent.operatorToken.kind === _ast.SyntaxKind.EqualsToken || parent.operatorToken.kind === _ast.SyntaxKind.PlusEqualsToken); } // the key of a native list read: its printed Go type must be `int` for the guard's two // comparisons to compile, and the key expression is printed twice (the bounds test and the // index), so a call operand — evaluated twice — is rejected. Every other key keeps GetValue. goIntIndexExpression(node) { - switch (_optionalChain([node, 'optionalAccess', _1341 => _1341.kind])) { + switch (_optionalChain([node, 'optionalAccess', _1353 => _1353.kind])) { case _ast.SyntaxKind.NumericLiteral: { const text = `${_nullishCoalesce(node.text, () => ( ""))}`; return /^\d+$/.test(text); @@ -14136,7 +14258,7 @@ ${this.getIden(level)}}()`; case _ast.SyntaxKind.Identifier: return this.goIntOperandIdentifier(node); case _ast.SyntaxKind.BinaryExpression: { - const op = _optionalChain([node, 'access', _1342 => _1342.operatorToken, 'optionalAccess', _1343 => _1343.kind]); + const op = _optionalChain([node, 'access', _1354 => _1354.operatorToken, 'optionalAccess', _1355 => _1355.kind]); if (op === _ast.SyntaxKind.PlusToken || op === _ast.SyntaxKind.MinusToken || op === _ast.SyntaxKind.AsteriskToken || op === _ast.SyntaxKind.PercentToken) { return this.goIntIndexExpression(node.left) && this.goIntIndexExpression(node.right); } @@ -14156,13 +14278,13 @@ ${this.getIden(level)}}()`; return false; } const symbol = checker.getSymbolAtLocation(node); - const declaration = _optionalChain([symbol, 'optionalAccess', _1344 => _1344.valueDeclaration, 'optionalAccess', _1345 => _1345.resolve, 'call', _1346 => _1346()]); - if (_optionalChain([declaration, 'optionalAccess', _1347 => _1347.kind]) !== _ast.SyntaxKind.VariableDeclaration || declaration.initializer === void 0) { + const declaration = _optionalChain([symbol, 'optionalAccess', _1356 => _1356.valueDeclaration, 'optionalAccess', _1357 => _1357.resolve, 'call', _1358 => _1358()]); + if (_optionalChain([declaration, 'optionalAccess', _1359 => _1359.kind]) !== _ast.SyntaxKind.VariableDeclaration || declaration.initializer === void 0) { return false; } const list = declaration.parent; - const loop = _optionalChain([list, 'optionalAccess', _1348 => _1348.parent]); - if (_optionalChain([list, 'optionalAccess', _1349 => _1349.kind]) !== _ast.SyntaxKind.VariableDeclarationList || _optionalChain([list, 'access', _1350 => _1350.declarations, 'optionalAccess', _1351 => _1351.length]) !== 1 || _optionalChain([loop, 'optionalAccess', _1352 => _1352.kind]) !== _ast.SyntaxKind.ForStatement || loop.initializer !== list) { + const loop = _optionalChain([list, 'optionalAccess', _1360 => _1360.parent]); + if (_optionalChain([list, 'optionalAccess', _1361 => _1361.kind]) !== _ast.SyntaxKind.VariableDeclarationList || _optionalChain([list, 'access', _1362 => _1362.declarations, 'optionalAccess', _1363 => _1363.length]) !== 1 || _optionalChain([loop, 'optionalAccess', _1364 => _1364.kind]) !== _ast.SyntaxKind.ForStatement || loop.initializer !== list) { return false; } const text = `${_nullishCoalesce(declaration.initializer.text, () => ( ""))}`; @@ -14177,8 +14299,8 @@ ${this.getIden(level)}}()`; return false; } const symbol = checker.getSymbolAtLocation(node); - const declaration = _optionalChain([symbol, 'optionalAccess', _1353 => _1353.valueDeclaration, 'optionalAccess', _1354 => _1354.resolve, 'call', _1355 => _1355()]); - return _optionalChain([declaration, 'optionalAccess', _1356 => _1356.kind]) === _ast.SyntaxKind.VariableDeclaration && this.goSafeListLocalUnbox(declaration) === GO_SAFE_LIST_LOCAL_TYPE; + const declaration = _optionalChain([symbol, 'optionalAccess', _1365 => _1365.valueDeclaration, 'optionalAccess', _1366 => _1366.resolve, 'call', _1367 => _1367()]); + return _optionalChain([declaration, 'optionalAccess', _1368 => _1368.kind]) === _ast.SyntaxKind.VariableDeclaration && this.goSafeListLocalUnbox(declaration) === GO_SAFE_LIST_LOCAL_TYPE; } // true when the identifier's printed Go declaration is a `[]any` slice: the SafeList family // above, or any other local/param the declared-type table proved a slice (a slice literal, @@ -14237,7 +14359,7 @@ ${this.getIden(level)}}()`; keyStrs.forEach((k) => { acc = `${this.ELEMENT_ACCESS_WRAPPER_OPEN}${acc}, ${k}${this.ELEMENT_ACCESS_WRAPPER_CLOSE}`; }); - if (_optionalChain([baseExpr, 'optionalAccess', _1357 => _1357.kind]) === _ast.SyntaxKind.Identifier && this.goDeclaredListIdentifier(baseExpr)) { + if (_optionalChain([baseExpr, 'optionalAccess', _1369 => _1369.kind]) === _ast.SyntaxKind.Identifier && this.goDeclaredListIdentifier(baseExpr)) { const nativeRead = this.goNativeListElementRead(node, containerStr, keys[0], keyStrs[0]); if (nativeRead !== void 0) { return this.goElementAccessChain(nativeRead, keyStrs); @@ -14247,7 +14369,7 @@ ${this.getIden(level)}}()`; } isInsideVoidFunction(node) { for (let cur = node.parent; cur; cur = cur.parent) { - if (_chunk4FDYB2TTcjs.isFunctionLike.call(void 0, cur)) { + if (_chunkUBXMRIM6cjs.isFunctionLike.call(void 0, cur)) { return cur.type === void 0 || cur.type.kind === _ast.SyntaxKind.VoidKeyword; } } @@ -14290,10 +14412,420 @@ ${this.getIden(level)}}()`; const lastStatement = statements[statements.length - 1]; return (_is.isIfStatement.call(void 0, lastStatement) || _is.isTryStatement.call(void 0, lastStatement)) && this.hasReturnInBlock(lastStatement); } + // hx4 G01 + // a defaulted parameter bound through GetArgMap is a Go map[string]any; an element read of it + // indexes natively only where g01ReadOk proves the deref-free read answers what GetValue did + g01MapParamType(node) { + const checker = this.checkerOrUndefined(); + if (checker === void 0) { + return void 0; + } + let decl; + try { + decl = _optionalChain([checker, 'access', _1370 => _1370.getSymbolAtLocation, 'call', _1371 => _1371(node), 'optionalAccess', _1372 => _1372.valueDeclaration, 'optionalAccess', _1373 => _1373.resolve, 'call', _1374 => _1374()]); + } catch (e) { + return void 0; + } + if (_optionalChain([decl, 'optionalAccess', _1375 => _1375.kind]) !== _ast.SyntaxKind.Parameter || this.goGetArgParameterType(decl) !== "map[string]any") { + return void 0; + } + const access = node.parent; + if (_optionalChain([access, 'optionalAccess', _1376 => _1376.kind]) === _ast.SyntaxKind.ElementAccessExpression && access.expression === node && this.g01ReadOk(node, access) !== "map[string]any") { + return void 0; + } + return "map[string]any"; + } + // `receiver[k]` may replace GetValue(receiver, k) on a declared map[string]any: literal key, not a + // compared operand, not an element-write value (the ccxt write pass proves those from the helper + // spelling), and a market row or a consumer that derefScalars the value as GetValue did + g01ReadOk(receiver, access) { + if (this.goIsComparedOperand(access) || this.g01IsWriteValue(access) || !this.g01LiteralKey(access.argumentExpression)) { + return void 0; + } + return this.g01MarketRow(receiver) || this.x02CurrencyRow(receiver) || this.g01DerefConsumer(access) ? "map[string]any" : void 0; + } + // a string literal or a non-negative integer literal key + g01LiteralKey(key) { + return _optionalChain([key, 'optionalAccess', _1377 => _1377.kind]) === _ast.SyntaxKind.StringLiteral || _optionalChain([key, 'optionalAccess', _1378 => _1378.kind]) === _ast.SyntaxKind.NoSubstitutionTemplateLiteral || _optionalChain([key, 'optionalAccess', _1379 => _1379.kind]) === _ast.SyntaxKind.NumericLiteral && /^\d+$/.test(`${_nullishCoalesce(key.text, () => ( ""))}`); + } + // `y[k] = x["lit"]` + g01IsWriteValue(access) { + let operand = access; + while (_optionalChain([operand, 'access', _1380 => _1380.parent, 'optionalAccess', _1381 => _1381.kind]) === _ast.SyntaxKind.ParenthesizedExpression) { + operand = operand.parent; + } + const parent = operand.parent; + return _optionalChain([parent, 'optionalAccess', _1382 => _1382.kind]) === _ast.SyntaxKind.BinaryExpression && parent.right === operand && _optionalChain([parent, 'access', _1383 => _1383.operatorToken, 'optionalAccess', _1384 => _1384.kind]) === _ast.SyntaxKind.EqualsToken && _optionalChain([parent, 'access', _1385 => _1385.left, 'optionalAccess', _1386 => _1386.kind]) === _ast.SyntaxKind.ElementAccessExpression; + } + // a Market-typed local written only by `this.market (…)` (or undefined): that accessor returns + // MarketTyped rows, whose values derefScalar leaves unchanged. Currency rows can hold *string values. + g01MarketRow(node) { + let type; + try { + type = this.getChecker().getTypeAtLocation(node); + } catch (e) { + return false; + } + const names = [_optionalChain([type, 'optionalAccess', _1387 => _1387.aliasSymbol, 'optionalAccess', _1388 => _1388.name]), _optionalChain([type, 'optionalAccess', _1389 => _1389.symbol, 'optionalAccess', _1390 => _1390.name])]; + if (!names.some((n) => ["Market", "MarketInterface"].includes(n))) { + return false; + } + const declaration = this.goDeclarationOfIdentifier(node); + const scope = declaration === void 0 ? void 0 : this.goEnclosingFunction(declaration); + if (scope === void 0) { + return false; + } + const isRow = (v) => v === void 0 || v.kind === _ast.SyntaxKind.Identifier && v.text === "undefined" || v.kind === _ast.SyntaxKind.CallExpression && _optionalChain([v, 'access', _1391 => _1391.expression, 'optionalAccess', _1392 => _1392.kind]) === _ast.SyntaxKind.PropertyAccessExpression && _optionalChain([v, 'access', _1393 => _1393.expression, 'access', _1394 => _1394.expression, 'optionalAccess', _1395 => _1395.kind]) === _ast.SyntaxKind.ThisKeyword && _optionalChain([v, 'access', _1396 => _1396.expression, 'access', _1397 => _1397.name, 'optionalAccess', _1398 => _1398.text]) === "market"; + let ok = isRow(declaration.initializer); + const name = _optionalChain([declaration, 'access', _1399 => _1399.name, 'optionalAccess', _1400 => _1400.text]); + const visit = (n) => { + if (!ok) { + return; + } + if (n.kind === _ast.SyntaxKind.BinaryExpression && _optionalChain([n, 'access', _1401 => _1401.left, 'optionalAccess', _1402 => _1402.kind]) === _ast.SyntaxKind.Identifier && n.left.text === name && _optionalChain([n, 'access', _1403 => _1403.operatorToken, 'optionalAccess', _1404 => _1404.kind]) === _ast.SyntaxKind.EqualsToken && this.goIdentifierRefersToDeclaration(n.left, declaration)) { + ok = isRow(n.right); + } else if (n.kind === _ast.SyntaxKind.ArrayLiteralExpression && _optionalChain([n, 'access', _1405 => _1405.parent, 'optionalAccess', _1406 => _1406.kind]) === _ast.SyntaxKind.BinaryExpression && n.parent.left === n && n.elements.some((e) => e.kind === _ast.SyntaxKind.Identifier && e.text === name)) { + ok = false; + } + n.forEachChild(visit); + }; + scope.forEachChild(visit); + return ok; + } + // the read is the container of an enclosing element read, an operand of `in`, or an argument of a + // SafeValueN-backed accessor (or safeCurrencyCode): each derefScalars it, so GetValue's deref is redundant + g01DerefConsumer(access) { + let operand = access; + while (_optionalChain([operand, 'access', _1407 => _1407.parent, 'optionalAccess', _1408 => _1408.kind]) === _ast.SyntaxKind.ParenthesizedExpression) { + operand = operand.parent; + } + const parent = operand.parent; + if (_optionalChain([parent, 'optionalAccess', _1409 => _1409.kind]) === _ast.SyntaxKind.ElementAccessExpression && parent.expression === operand) { + return !this.isGoElementAccessAssignmentTarget(parent); + } + if (_optionalChain([parent, 'optionalAccess', _1410 => _1410.kind]) === _ast.SyntaxKind.BinaryExpression && _optionalChain([parent, 'access', _1411 => _1411.operatorToken, 'optionalAccess', _1412 => _1412.kind]) === _ast.SyntaxKind.InKeyword) { + return true; + } + const callee = _optionalChain([parent, 'optionalAccess', _1413 => _1413.expression]); + return _optionalChain([parent, 'optionalAccess', _1414 => _1414.kind]) === _ast.SyntaxKind.CallExpression && parent.arguments.indexOf(operand) >= 0 && _optionalChain([callee, 'optionalAccess', _1415 => _1415.kind]) === _ast.SyntaxKind.PropertyAccessExpression && _optionalChain([callee, 'access', _1416 => _1416.expression, 'optionalAccess', _1417 => _1417.kind]) === _ast.SyntaxKind.ThisKeyword && /^(?:safe(?:Value|String|StringLower|StringUpper|Integer|IntegerProduct|Float|Number|Bool|Timestamp|Dict|List)(?:2|N)?|safeCurrencyCode)$/.test(`${_nullishCoalesce(_optionalChain([callee, 'access', _1418 => _1418.name, 'optionalAccess', _1419 => _1419.text]), () => ( ""))}`); + } + // hx4 G02 + // base safeValue/safeValue2/safeValueN (SafeValueN derefScalars every hit and its default) and + // ws cache constructors (non-nil, outside the derefScalar set): never a nil pointer IsEqual folds + goG02NonPointerAccessorSource(expr) { + if (_optionalChain([expr, 'optionalAccess', _1420 => _1420.kind]) === _ast.SyntaxKind.ConditionalExpression) { + return this.goIsNonPointerValueSource(expr.whenTrue) && this.goIsNonPointerValueSource(expr.whenFalse); + } + if (_optionalChain([expr, 'optionalAccess', _1421 => _1421.kind]) === _ast.SyntaxKind.NewExpression) { + const name = _optionalChain([expr, 'access', _1422 => _1422.expression, 'optionalAccess', _1423 => _1423.kind]) === _ast.SyntaxKind.Identifier ? expr.expression.text : void 0; + return GO_G02_CACHE_CLASSES.indexOf(name) >= 0; + } + if (_optionalChain([expr, 'optionalAccess', _1424 => _1424.kind]) !== _ast.SyntaxKind.CallExpression) { + return false; + } + const callee = expr.expression; + if (_optionalChain([callee, 'optionalAccess', _1425 => _1425.kind]) !== _ast.SyntaxKind.PropertyAccessExpression || _optionalChain([callee, 'access', _1426 => _1426.expression, 'optionalAccess', _1427 => _1427.kind]) !== _ast.SyntaxKind.ThisKeyword || _optionalChain([callee, 'access', _1428 => _1428.name, 'optionalAccess', _1429 => _1429.kind]) !== _ast.SyntaxKind.Identifier) { + return false; + } + const keys = GO_G02_SAFE_VALUE_KEYS[callee.name.text]; + if (keys === void 0 || expr.arguments.length > keys + 1) { + return false; + } + if (expr.arguments.length === keys + 1 && !this.goG02LiteralDefault(expr.arguments[keys])) { + return false; + } + const checker = this.checkerOrUndefined(); + const declarations = _optionalChain([checker, 'optionalAccess', _1430 => _1430.getSymbolAtLocation, 'call', _1431 => _1431(callee.name), 'optionalAccess', _1432 => _1432.declarations, 'optionalAccess', _1433 => _1433.map, 'call', _1434 => _1434((d) => d.resolve())]); + if (!declarations || declarations.length === 0) { + return false; + } + return declarations.every((d) => /(^|\/)ts\/src\/base\/Exchange\.ts$/.test(String(_nullishCoalesce(_optionalChain([d, 'access', _1435 => _1435.getSourceFile, 'call', _1436 => _1436(), 'optionalAccess', _1437 => _1437.fileName]), () => ( ""))).replace(/\\/g, "/"))); + } + goG02LiteralDefault(node) { + node = this.goUnwrapParenthesizedNode(node); + switch (_optionalChain([node, 'optionalAccess', _1438 => _1438.kind])) { + case _ast.SyntaxKind.NullKeyword: + case _ast.SyntaxKind.StringLiteral: + case _ast.SyntaxKind.NoSubstitutionTemplateLiteral: + case _ast.SyntaxKind.NumericLiteral: + case _ast.SyntaxKind.TrueKeyword: + case _ast.SyntaxKind.FalseKeyword: + case _ast.SyntaxKind.ObjectLiteralExpression: + case _ast.SyntaxKind.ArrayLiteralExpression: + return true; + case _ast.SyntaxKind.Identifier: + return node.text === "undefined"; + } + return false; + } + // hx4 G06 + // a `*string` the checker narrows to string (or whose every write is a defaulted SafeString) + // is non-nil, so GetLength/GetArrayLength's deref + byte count is `len(*x)` + goHx4G06DerefLength(expression, printedText, lengthNode) { + if (_optionalChain([expression, 'optionalAccess', _1439 => _1439.kind]) !== _ast.SyntaxKind.Identifier || printedText !== expression.text) { + return void 0; + } + if (this.goLengthFeedsArithmeticClassifier(lengthNode) || !this.goDerefableStringOperand(expression)) { + return void 0; + } + return `len(*${printedText})`; + } + // GetIndexOf on two operands that are Go strings once a proven-non-nil `*string` is deref'd: + // both sides reach the helper's `case string` arm, which is strings.Index + goHx4G06DerefIndexOf(node, name, parsedArg) { + if (typeof name !== "string" || typeof parsedArg !== "string" || name.includes("\n") || parsedArg.includes("\n")) { + return void 0; + } + if (!this.goFileKeepsFileLevelImports() || !this.goStdlibImportIsPlaceable()) { + return void 0; + } + const operands = [this.goUnwrapPrintedAssertions(_optionalChain([node, 'optionalAccess', _1440 => _1440.expression, 'optionalAccess', _1441 => _1441.expression])), this.goUnwrapPrintedAssertions(_optionalChain([node, 'optionalAccess', _1442 => _1442.arguments, 'optionalAccess', _1443 => _1443[0]]))]; + const texts = [name, parsedArg]; + if (!operands.some((o) => this.goDerefableStringOperand(o))) { + return void 0; + } + const out = []; + for (let i = 0; i < 2; i++) { + const o = operands[i]; + if (_optionalChain([o, 'optionalAccess', _1444 => _1444.kind]) === _ast.SyntaxKind.Identifier && texts[i] === o.text && this.goDerefableStringOperand(o)) { + out.push("*" + texts[i]); + } else if (this.goIndexOfOperandType(o, texts[i]) === "string") { + out.push(texts[i]); + } else { + return void 0; + } + } + this.goFileStdlibImports.add("strings"); + return `strings.Index(${out[0]}, ${out[1]})`; + } + // hx4 G08 + // a `*string` local the checker narrowed to a union of string literals (`x === 'A' || x === 'B'`): + // every member is a string, so the Go pointer is non-nil at this read and may be dereferenced + goLiteralUnionNarrowedStringDeref(node) { + if (_optionalChain([node, 'optionalAccess', _1445 => _1445.kind]) !== _ast.SyntaxKind.Identifier || this.goDeclaredTypeOfIdentifier(node) !== "*string") { + return false; + } + const checker = this.checkerOrUndefined(); + const type = _optionalChain([checker, 'optionalAccess', _1446 => _1446.getTypeAtLocation, 'call', _1447 => _1447(node)]); + if (type === void 0 || (type.flags & _sync.TypeFlags.Union) === 0) { + return false; + } + const members = _nullishCoalesce(_optionalChain([type, 'access', _1448 => _1448.getTypes, 'optionalCall', _1449 => _1449()]), () => ( [])); + return members.length > 0 && members.every((member) => (member.flags & _sync.TypeFlags.StringLiteral) !== 0); + } + // `this.rateLimit` & co.: only when the checker resolves the property to the base + // `class Exchange` declaration (a venue redeclaring it prints its own field) + goG09FieldKind(node) { + node = this.goUnwrapParenthesizedNode(node); + if (_optionalChain([node, 'optionalAccess', _1450 => _1450.kind]) !== _ast.SyntaxKind.PropertyAccessExpression || _optionalChain([node, 'access', _1451 => _1451.expression, 'optionalAccess', _1452 => _1452.kind]) !== _ast.SyntaxKind.ThisKeyword) { + return void 0; + } + const kind = this.GO_G09_NUMERIC_FIELDS[_nullishCoalesce(_optionalChain([node, 'access', _1453 => _1453.name, 'optionalAccess', _1454 => _1454.escapedText]), () => ( _optionalChain([node, 'access', _1455 => _1455.name, 'optionalAccess', _1456 => _1456.text])))]; + if (kind === void 0) { + return void 0; + } + const checker = this.checkerOrUndefined(); + const declaration = _optionalChain([checker, 'optionalAccess', _1457 => _1457.getSymbolAtLocation, 'call', _1458 => _1458(node), 'optionalAccess', _1459 => _1459.valueDeclaration, 'optionalAccess', _1460 => _1460.resolve, 'call', _1461 => _1461()]); + if (_optionalChain([declaration, 'optionalAccess', _1462 => _1462.kind]) !== _ast.SyntaxKind.PropertyDeclaration || _optionalChain([declaration, 'access', _1463 => _1463.parent, 'optionalAccess', _1464 => _1464.kind]) !== _ast.SyntaxKind.ClassDeclaration) { + return void 0; + } + const className = _nullishCoalesce(_optionalChain([declaration, 'access', _1465 => _1465.parent, 'access', _1466 => _1466.name, 'optionalAccess', _1467 => _1467.escapedText]), () => ( _optionalChain([declaration, 'access', _1468 => _1468.parent, 'access', _1469 => _1469.name, 'optionalAccess', _1470 => _1470.text]))); + return className === "Exchange" ? kind : void 0; + } + // [kind, pointer] of one ordered-comparison operand, undefined when unprovable + goG09OperandKind(node, text) { + const pointee = this.goOrderedComparisonPointerKind(node); + if (pointee !== void 0) { + return [pointee, true]; + } + const field = this.goG09FieldKind(node); + if (field !== void 0) { + return [field, false]; + } + const kind = this.goOperandNumericKind(node, text); + return kind === void 0 ? void 0 : [kind, false]; + } + // Ordered comparisons the phase-1 rule refuses only because the two concrete kinds differ + // (int vs int64, int/int64 vs float64) or an operand is a typed base field. The helper + // converts the narrower side exactly like `int64(x)` / `float64(x)`; nil and NaN rules stay. + printG09WideningComparison(left, right, leftText, rightText, op) { + const operator = ORDERED_COMPARISON_OPERATORS[op]; + if (operator === void 0) { + return void 0; + } + if (this.goIsNumericConstant(left) && this.goIsNumericConstant(right)) { + return void 0; + } + const l = this.goG09OperandKind(left, leftText); + const r = this.goG09OperandKind(right, rightText); + if (l === void 0 || r === void 0) { + return void 0; + } + let kind = this.goComparisonKind(left, l[0], right, r[0]); + let lv = l[1] ? `*${leftText}` : leftText; + let rv = r[1] ? `*${rightText}` : rightText; + if (kind === void 0) { + if (this.goIsNumericConstant(left) || this.goIsNumericConstant(right)) { + return void 0; + } + kind = l[0] === "float64" || r[0] === "float64" ? "float64" : "int64"; + if (l[0] !== kind) { + lv = `${kind}(${lv})`; + } + if (r[0] !== kind) { + rv = `${kind}(${rv})`; + } + } + if (kind === "float64" && (operator === "<" || operator === "<=")) { + return void 0; + } + const leftNil = l[1] && !this.goHasEnclosingNilGuard(left); + const rightNil = r[1] && !this.goHasEnclosingNilGuard(right); + if (leftNil && !r[1] && !this.goIsPureComparisonOperand(right) || rightNil && !l[1] && !this.goIsPureComparisonOperand(left)) { + return void 0; + } + const greater = operator === ">" || operator === ">="; + const cmp = `${lv} ${operator} ${rv}`; + if (!leftNil && !rightNil) { + return `(${cmp})`; + } + if (leftNil && !rightNil) { + return greater ? `(${leftText} != nil && ${cmp})` : `(${leftText} == nil || ${cmp})`; + } + if (!leftNil && rightNil) { + return greater ? `(${rightText} == nil || ${cmp})` : `(${rightText} != nil && ${cmp})`; + } + if (operator === ">") { + return `(${leftText} != nil && (${rightText} == nil || ${cmp}))`; + } + if (operator === ">=") { + return `(${rightText} == nil || (${leftText} != nil && ${cmp}))`; + } + if (operator === "<") { + return `(${rightText} != nil && (${leftText} == nil || ${cmp}))`; + } + return `(${leftText} == nil || (${rightText} != nil && ${cmp}))`; + } +}; +var GO_G02_SAFE_VALUE_KEYS = { "safeValue": 2, "safeValue2": 3, "safeValueN": 2 }; +var GO_G02_CACHE_CLASSES = ["ArrayCache", "ArrayCacheByTimestamp", "ArrayCacheBySymbolById", "ArrayCacheBySymbolBySide"]; +GoTranspiler.prototype.goNativeIntWideningArithmetic = function(node, leftType, rightType, leftText, rightText) { + const op = node.operatorToken.kind; + const isMod = op === _ast.SyntaxKind.PercentToken && this.isNonZeroIntegerLiteral(node.right); + if (op !== _ast.SyntaxKind.MinusToken && op !== _ast.SyntaxKind.AsteriskToken && op !== _ast.SyntaxKind.PlusToken && !isMod) { + return void 0; + } + const mixed = leftType === "int64" && rightType === "int" || leftType === "int" && rightType === "int64"; + const intKinds = ["int", "const-int"]; + const declaredInt64 = op !== _ast.SyntaxKind.PlusToken && intKinds.includes(leftType) && intKinds.includes(rightType) && (leftType === "int" || rightType === "int") && this.goInsideTypedDeclarationInitializer(node); + if ((!mixed || isMod) && !declaredInt64) { + return void 0; + } + const operand = (operandNode, operandType, printed) => operandType === "int" ? "int64(" + this.goUnwrapPrintedParens(printed.trim()) + ")" : this.goNativeOperandText(operandNode, printed); + const left = operand(node.left, leftType, leftText); + const right = operand(node.right, rightType, rightText); + const symbol = this.SupportedKindNames[op]; + const separator = this.goBinarySeparator(symbol, right, node.left, node.right); + return { "goType": "int64", "text": left + separator + symbol + separator + right }; +}; +GoTranspiler.prototype.goStringLiteralUnionType = function(type) { + if (type === void 0 || (type.flags & _sync.TypeFlags.Union) === 0) { + return false; + } + const members = type.getTypes(); + return members.length > 0 && members.every((member) => (member.flags & _sync.TypeFlags.StringLike) !== 0); +}; +GoTranspiler.prototype.goConcatDerefableStringOperand = function(node) { + if (this.goDerefableStringOperand(node)) { + return true; + } + if (_optionalChain([node, 'optionalAccess', _1471 => _1471.kind]) !== _ast.SyntaxKind.Identifier || this.goDeclaredTypeOfIdentifier(node) !== "*string") { + return false; + } + const checker = this.checkerOrUndefined(); + return checker !== void 0 && this.goStringLiteralUnionType(checker.getTypeAtLocation(node)); +}; +GoTranspiler.prototype.x02CurrencyRow = function(node) { + let type; + try { + type = this.getChecker().getTypeAtLocation(node); + } catch (e) { + return false; + } + const named = (t) => [_optionalChain([t, 'optionalAccess', _1472 => _1472.getAliasSymbol, 'optionalCall', _1473 => _1473(), 'optionalAccess', _1474 => _1474.name]), _optionalChain([t, 'optionalAccess', _1475 => _1475.getSymbol, 'optionalCall', _1476 => _1476(), 'optionalAccess', _1477 => _1477.name])].some((n) => ["Currency", "CurrencyInterface"].includes(n)); + const members = typeof _optionalChain([type, 'optionalAccess', _1478 => _1478.isUnionType]) === "function" && type.isUnionType() ? type.getTypes() : [type]; + if (!named(type) && !members.some((t) => named(t))) { + return false; + } + const declaration = this.goDeclarationOfIdentifier(node); + const scope = declaration === void 0 ? void 0 : this.goEnclosingFunction(declaration); + if (scope === void 0) { + return false; + } + const isRow = (v) => v === void 0 || v.kind === _ast.SyntaxKind.Identifier && v.text === "undefined" || v.kind === _ast.SyntaxKind.CallExpression && _optionalChain([v, 'access', _1479 => _1479.expression, 'optionalAccess', _1480 => _1480.kind]) === _ast.SyntaxKind.PropertyAccessExpression && _optionalChain([v, 'access', _1481 => _1481.expression, 'access', _1482 => _1482.expression, 'optionalAccess', _1483 => _1483.kind]) === _ast.SyntaxKind.ThisKeyword && ["currency", "safeCurrency"].includes(_optionalChain([v, 'access', _1484 => _1484.expression, 'access', _1485 => _1485.name, 'optionalAccess', _1486 => _1486.text])); + let ok = isRow(declaration.initializer); + const name = _optionalChain([declaration, 'access', _1487 => _1487.name, 'optionalAccess', _1488 => _1488.text]); + const visit = (n) => { + if (!ok) { + return; + } + if (n.kind === _ast.SyntaxKind.BinaryExpression && _optionalChain([n, 'access', _1489 => _1489.left, 'optionalAccess', _1490 => _1490.kind]) === _ast.SyntaxKind.Identifier && n.left.text === name && _optionalChain([n, 'access', _1491 => _1491.operatorToken, 'optionalAccess', _1492 => _1492.kind]) === _ast.SyntaxKind.EqualsToken && this.goIdentifierRefersToDeclaration(n.left, declaration)) { + ok = isRow(n.right); + } else if (n.kind === _ast.SyntaxKind.ArrayLiteralExpression && _optionalChain([n, 'access', _1493 => _1493.parent, 'optionalAccess', _1494 => _1494.kind]) === _ast.SyntaxKind.BinaryExpression && n.parent.left === n && n.elements.some((e) => e.kind === _ast.SyntaxKind.Identifier && e.text === name)) { + ok = false; + } + n.forEachChild(visit); + }; + scope.forEachChild(visit); + return ok; +}; +GoTranspiler.prototype.g11NativeParameterType = function(fn, param, index) { + if (this.isAsyncFunction(fn) || !this.goHasTreeCallSite(fn)) { + return void 0; + } + const candidates = []; + const type = _optionalChain([this, 'access', _1495 => _1495.checkerOrUndefined, 'call', _1496 => _1496(), 'optionalAccess', _1497 => _1497.getTypeAtLocation, 'call', _1498 => _1498(param)]); + if (type !== void 0) { + const all = typeof type.isUnionType === "function" && type.isUnionType() ? type.getTypes() : [type]; + const parts = all.filter((p) => !(p.flags & (_sync.TypeFlags.Undefined | _sync.TypeFlags.Null))); + if (parts.length > 0 && parts.every((p) => (p.flags & (_sync.TypeFlags.String | _sync.TypeFlags.StringLiteral)) !== 0)) { + candidates.push("string"); + } + } + for (const goType of this.goNativeParameterTypeCandidates(param).concat(this.g13NumericParameterCandidates(param))) { + if (!candidates.includes(goType)) { + candidates.push(goType); + } + } + for (const goType of candidates) { + if (this.goParameterCallSitesPassType(fn, index, goType) && this.goLocalIsSafeToType(fn.body, param, param.name.text, goType) && (goType.startsWith("*") || this.goParameterKeepsNilCompareNative(fn.body, param, goType)) && (goType.startsWith("*") || !this.g11ParameterHasNullishDefault(fn.body, param))) { + return goType; + } + } + return void 0; +}; +GoTranspiler.prototype.g11ParameterHasNullishDefault = function(body, param) { + const name = param.name.text; + return this.hasNodeWhere(body, (n) => { + const parent = n.parent; + return n.kind === _ast.SyntaxKind.Identifier && n.text === name && _optionalChain([parent, 'optionalAccess', _1499 => _1499.kind]) === _ast.SyntaxKind.BinaryExpression && parent.left === n && (parent.operatorToken.kind === _ast.SyntaxKind.QuestionQuestionToken || parent.operatorToken.kind === _ast.SyntaxKind.QuestionQuestionEqualsToken); + }); +}; +GoTranspiler.prototype.g13NumericParameterCandidates = function(param) { + const declared = _optionalChain([param, 'optionalAccess', _1500 => _1500.type]) !== void 0 ? String(param.type.getText()).trim() : void 0; + switch (declared) { + case "Int": + return ["*int64"]; + case "Num": + return ["*float64"]; + case "number": + return ["int64", "float64"]; + } + return []; }; // src/javaTranspiler.ts -_chunk4FDYB2TTcjs.init_cjs_shims.call(void 0, ); +_chunkUBXMRIM6cjs.init_cjs_shims.call(void 0, ); @@ -14583,12 +15115,12 @@ function prefetchByFile(checker, name, kinds) { if (cache.has(node)) { return cache.get(node); } - const sf = _optionalChain([node, 'access', _1358 => _1358.getSourceFile, 'optionalCall', _1359 => _1359()]); + const sf = _optionalChain([node, 'access', _1501 => _1501.getSourceFile, 'optionalCall', _1502 => _1502()]); if (sf !== void 0 && !done.has(sf)) { done.add(sf); const nodes = []; const visit = (n) => { - if (kinds.has(n.kind) && !_optionalChain([original, 'access', _1360 => _1360.has, 'optionalCall', _1361 => _1361(n)])) { + if (kinds.has(n.kind) && !_optionalChain([original, 'access', _1503 => _1503.has, 'optionalCall', _1504 => _1504(n)])) { nodes.push(n); } n.forEachChild(visit); @@ -14621,12 +15153,12 @@ function prefetchResolvedSignatures(checker) { if (cache.has(node)) { return cache.get(node); } - const sf = _optionalChain([node, 'optionalAccess', _1362 => _1362.getSourceFile, 'optionalCall', _1363 => _1363()]); + const sf = _optionalChain([node, 'optionalAccess', _1505 => _1505.getSourceFile, 'optionalCall', _1506 => _1506()]); if (sf !== void 0 && !done.has(sf)) { done.add(sf); const calls = []; const visit = (n) => { - if (n.kind === _ast.SyntaxKind.CallExpression && !_optionalChain([original, 'access', _1364 => _1364.has, 'optionalCall', _1365 => _1365(n)])) { + if (n.kind === _ast.SyntaxKind.CallExpression && !_optionalChain([original, 'access', _1507 => _1507.has, 'optionalCall', _1508 => _1508(n)])) { calls.push(n); } n.forEachChild(visit); @@ -14738,6 +15270,8 @@ var JavaTranspiler = class extends BaseTranspiler { this.csModifiers = {}; // literals printed as `Helpers.newMap(k, v, ...)` (no anonymous class, so no capture rule) this.builderObjectLiterals = /* @__PURE__ */ new WeakSet(); + this.javaHx4SourceVerdicts = /* @__PURE__ */ new WeakMap(); + this.javaHx4InProgress = /* @__PURE__ */ new Set(); this.requiresParameterType = true; this.requiresReturnType = true; this.asyncTranspiling = true; @@ -14773,9 +15307,9 @@ var JavaTranspiler = class extends BaseTranspiler { let chain = this.overrideChainCache.get(classDeclaration); if (chain === void 0) { chain = []; - let parentClass = _chunk4FDYB2TTcjs.getAllSuperTypeNodes.call(void 0, classDeclaration)[0]; + let parentClass = _chunkUBXMRIM6cjs.getAllSuperTypeNodes.call(void 0, classDeclaration)[0]; while (parentClass !== void 0) { - const parentClassDecl = _optionalChain([this, 'access', _1366 => _1366.getChecker, 'call', _1367 => _1367(), 'access', _1368 => _1368.getTypeAtLocation, 'call', _1369 => _1369(parentClass), 'optionalAccess', _1370 => _1370.getSymbol, 'call', _1371 => _1371(), 'optionalAccess', _1372 => _1372.valueDeclaration, 'optionalAccess', _1373 => _1373.resolve, 'call', _1374 => _1374()]); + const parentClassDecl = _optionalChain([this, 'access', _1509 => _1509.getChecker, 'call', _1510 => _1510(), 'access', _1511 => _1511.getTypeAtLocation, 'call', _1512 => _1512(parentClass), 'optionalAccess', _1513 => _1513.getSymbol, 'call', _1514 => _1514(), 'optionalAccess', _1515 => _1515.valueDeclaration, 'optionalAccess', _1516 => _1516.resolve, 'call', _1517 => _1517()]); if (parentClassDecl === void 0) { chain = null; break; @@ -14787,7 +15321,7 @@ var JavaTranspiler = class extends BaseTranspiler { } } chain.push(byName); - parentClass = _nullishCoalesce(_chunk4FDYB2TTcjs.getAllSuperTypeNodes.call(void 0, parentClassDecl)[0], () => ( void 0)); + parentClass = _nullishCoalesce(_chunkUBXMRIM6cjs.getAllSuperTypeNodes.call(void 0, parentClassDecl)[0], () => ( void 0)); } this.overrideChainCache.set(classDeclaration, chain); } @@ -14809,7 +15343,7 @@ var JavaTranspiler = class extends BaseTranspiler { // Java type of a local whose printed declaration line it rewrote (`Long`/`Double`). // The arithmetic rule reads it for identifier operands only. countRequiredParameters(declaration) { - return (_nullishCoalesce(_optionalChain([declaration, 'optionalAccess', _1375 => _1375.parameters]), () => ( []))).filter((p) => p.initializer === void 0 && p.questionToken === void 0 && p.dotDotDotToken === void 0).length; + return (_nullishCoalesce(_optionalChain([declaration, 'optionalAccess', _1518 => _1518.parameters]), () => ( []))).filter((p) => p.initializer === void 0 && p.questionToken === void 0 && p.dotDotDotToken === void 0).length; } printArgsForCallExpression(node, identation) { const fullArity = this.javaFullArityCallArguments(_nullishCoalesce(node.arguments, () => ( [])), node, identation); @@ -14818,14 +15352,14 @@ var JavaTranspiler = class extends BaseTranspiler { } let args = _nullishCoalesce(node.arguments, () => ( [])); const callee = node.expression; - const isThisCall = _optionalChain([callee, 'optionalAccess', _1376 => _1376.kind]) === _ast.SyntaxKind.PropertyAccessExpression && _optionalChain([callee, 'access', _1377 => _1377.expression, 'optionalAccess', _1378 => _1378.kind]) === _ast.SyntaxKind.ThisKeyword; + const isThisCall = _optionalChain([callee, 'optionalAccess', _1519 => _1519.kind]) === _ast.SyntaxKind.PropertyAccessExpression && _optionalChain([callee, 'access', _1520 => _1520.expression, 'optionalAccess', _1521 => _1521.kind]) === _ast.SyntaxKind.ThisKeyword; if (isThisCall && args.length > 0) { const last = args[args.length - 1]; const isNullish = last.kind === _ast.SyntaxKind.NullKeyword || last.kind === _ast.SyntaxKind.Identifier && last.text === "undefined"; let inOptionalTail = false; if (isNullish) { const signature = this.getChecker().getResolvedSignature(node); - const declaration = _optionalChain([signature, 'optionalAccess', _1379 => _1379.declaration, 'optionalAccess', _1380 => _1380.resolve, 'call', _1381 => _1381()]); + const declaration = _optionalChain([signature, 'optionalAccess', _1522 => _1522.declaration, 'optionalAccess', _1523 => _1523.resolve, 'call', _1524 => _1524()]); if (declaration !== void 0) { inOptionalTail = args.length > this.countRequiredParameters(declaration); } @@ -14869,7 +15403,7 @@ var JavaTranspiler = class extends BaseTranspiler { } try { const symbol = this.getChecker().getSymbolAtLocation(declaration.name); - return _optionalChain([symbol, 'optionalAccess', _1382 => _1382.declarations, 'optionalAccess', _1383 => _1383.map, 'call', _1384 => _1384((d) => d.resolve()), 'access', _1385 => _1385.find, 'call', _1386 => _1386((d) => _is.isMethodDeclaration.call(void 0, d) && d.body !== void 0)]); + return _optionalChain([symbol, 'optionalAccess', _1525 => _1525.declarations, 'optionalAccess', _1526 => _1526.map, 'call', _1527 => _1527((d) => d.resolve()), 'access', _1528 => _1528.find, 'call', _1529 => _1529((d) => _is.isMethodDeclaration.call(void 0, d) && d.body !== void 0)]); } catch (e) { return void 0; } @@ -14887,23 +15421,23 @@ var JavaTranspiler = class extends BaseTranspiler { } if (JAVA_NATIVE_PARAMETER_BASE_FILES.test(fileName)) { const delimiter = file.text.indexOf(JAVA_TRANSPILE_DELIMITER); - return delimiter >= 0 && method.pos > delimiter || JAVA_HANDWRITTEN_FULL_ARITY.has(_optionalChain([method, 'access', _1387 => _1387.name, 'optionalAccess', _1388 => _1388.text])); + return delimiter >= 0 && method.pos > delimiter || JAVA_HANDWRITTEN_FULL_ARITY.has(_optionalChain([method, 'access', _1530 => _1530.name, 'optionalAccess', _1531 => _1531.text])); } return !JAVA_HANDWRITTEN_TIER_FILES.test(fileName); } javaHasOptionalParameter(method) { - return (_nullishCoalesce(_optionalChain([method, 'optionalAccess', _1389 => _1389.parameters]), () => ( []))).some((p) => p.initializer !== void 0 || p.questionToken !== void 0); + return (_nullishCoalesce(_optionalChain([method, 'optionalAccess', _1532 => _1532.parameters]), () => ( []))).some((p) => p.initializer !== void 0 || p.questionToken !== void 0); } // a call into a printed method with optional parameters passes every parameter: omitted or // `undefined` slots take the TS default, fixed slots keep the native checkcast javaFullArityCallArguments(args, node, identation) { const callee = node.expression; - if (_optionalChain([callee, 'optionalAccess', _1390 => _1390.kind]) !== _ast.SyntaxKind.PropertyAccessExpression || _optionalChain([callee, 'access', _1391 => _1391.expression, 'optionalAccess', _1392 => _1392.kind]) === _ast.SyntaxKind.SuperKeyword) { + if (_optionalChain([callee, 'optionalAccess', _1533 => _1533.kind]) !== _ast.SyntaxKind.PropertyAccessExpression || _optionalChain([callee, 'access', _1534 => _1534.expression, 'optionalAccess', _1535 => _1535.kind]) === _ast.SyntaxKind.SuperKeyword) { return void 0; } let method; try { - method = _nullishCoalesce(this.javaMethodImplementation(_optionalChain([this, 'access', _1393 => _1393.getChecker, 'call', _1394 => _1394(), 'access', _1395 => _1395.getResolvedSignature, 'call', _1396 => _1396(node), 'optionalAccess', _1397 => _1397.declaration, 'optionalAccess', _1398 => _1398.resolve, 'call', _1399 => _1399()])), () => ( this.javaAnyReceiverBaseMethod(callee))); + method = _nullishCoalesce(this.javaMethodImplementation(_optionalChain([this, 'access', _1536 => _1536.getChecker, 'call', _1537 => _1537(), 'access', _1538 => _1538.getResolvedSignature, 'call', _1539 => _1539(node), 'optionalAccess', _1540 => _1540.declaration, 'optionalAccess', _1541 => _1541.resolve, 'call', _1542 => _1542()])), () => ( this.javaAnyReceiverBaseMethod(callee))); } catch (e) { return void 0; } @@ -14916,8 +15450,8 @@ var JavaTranspiler = class extends BaseTranspiler { if ((type.flags & _sync.TypeFlags.Any) === 0) { return void 0; } - const methods = this.baseExchangeMethodsByName().get(_optionalChain([callee, 'access', _1400 => _1400.name, 'optionalAccess', _1401 => _1401.text])); - return _optionalChain([methods, 'optionalAccess', _1402 => _1402.length]) === 1 ? methods[0] : void 0; + const methods = this.baseExchangeMethodsByName().get(_optionalChain([callee, 'access', _1543 => _1543.name, 'optionalAccess', _1544 => _1544.text])); + return _optionalChain([methods, 'optionalAccess', _1545 => _1545.length]) === 1 ? methods[0] : void 0; } baseExchangeMethodsByName() { const program = this.getProgram(); @@ -14929,9 +15463,9 @@ var JavaTranspiler = class extends BaseTranspiler { const fileName = program.getSourceFileNames().find((f) => /(^|[\\/])ts[\\/]src[\\/]base[\\/]Exchange\.ts$/.test(f)); const file = fileName !== void 0 ? program.getSourceFile(fileName) : void 0; for (const className of ["BaseExchange", "Exchange"]) { - const cls = _optionalChain([file, 'optionalAccess', _1403 => _1403.statements, 'access', _1404 => _1404.find, 'call', _1405 => _1405((s) => _is.isClassDeclaration.call(void 0, s) && _optionalChain([s, 'access', _1406 => _1406.name, 'optionalAccess', _1407 => _1407.text]) === className)]); + const cls = _optionalChain([file, 'optionalAccess', _1546 => _1546.statements, 'access', _1547 => _1547.find, 'call', _1548 => _1548((s) => _is.isClassDeclaration.call(void 0, s) && _optionalChain([s, 'access', _1549 => _1549.name, 'optionalAccess', _1550 => _1550.text]) === className)]); const own = /* @__PURE__ */ new Map(); - for (const member of _nullishCoalesce(_optionalChain([cls, 'optionalAccess', _1408 => _1408.members]), () => ( []))) { + for (const member of _nullishCoalesce(_optionalChain([cls, 'optionalAccess', _1551 => _1551.members]), () => ( []))) { if (_is.isMethodDeclaration.call(void 0, member) && member.body !== void 0 && _is.isIdentifier.call(void 0, member.name)) { own.set(member.name.text, (_nullishCoalesce(own.get(member.name.text), () => ( []))).concat([member])); } @@ -14967,24 +15501,24 @@ var JavaTranspiler = class extends BaseTranspiler { }).join(", "); } javaIsUndefinedLiteral(node) { - return _optionalChain([node, 'optionalAccess', _1409 => _1409.kind]) === _ast.SyntaxKind.Identifier && node.text === "undefined"; + return _optionalChain([node, 'optionalAccess', _1552 => _1552.kind]) === _ast.SyntaxKind.Identifier && node.text === "undefined"; } // `this.spawn(this.m, a..)` / `this.delay(ms, this.m, a..)`: the ccxt post-pass turns the // reference into a lambda calling `this.m(a..)`, so those arguments take m's full arity javaScheduledCallArguments(args, node, identation) { const callee = node.expression; - if (_optionalChain([callee, 'optionalAccess', _1410 => _1410.kind]) !== _ast.SyntaxKind.PropertyAccessExpression || _optionalChain([callee, 'access', _1411 => _1411.expression, 'optionalAccess', _1412 => _1412.kind]) !== _ast.SyntaxKind.ThisKeyword) { + if (_optionalChain([callee, 'optionalAccess', _1553 => _1553.kind]) !== _ast.SyntaxKind.PropertyAccessExpression || _optionalChain([callee, 'access', _1554 => _1554.expression, 'optionalAccess', _1555 => _1555.kind]) !== _ast.SyntaxKind.ThisKeyword) { return void 0; } - const at = _optionalChain([callee, 'access', _1413 => _1413.name, 'optionalAccess', _1414 => _1414.text]) === "spawn" ? 0 : _optionalChain([callee, 'access', _1415 => _1415.name, 'optionalAccess', _1416 => _1416.text]) === "delay" ? 1 : -1; + const at = _optionalChain([callee, 'access', _1556 => _1556.name, 'optionalAccess', _1557 => _1557.text]) === "spawn" ? 0 : _optionalChain([callee, 'access', _1558 => _1558.name, 'optionalAccess', _1559 => _1559.text]) === "delay" ? 1 : -1; const reference = at >= 0 ? args[at] : void 0; - if (_optionalChain([reference, 'optionalAccess', _1417 => _1417.kind]) !== _ast.SyntaxKind.PropertyAccessExpression || _optionalChain([reference, 'access', _1418 => _1418.expression, 'optionalAccess', _1419 => _1419.kind]) !== _ast.SyntaxKind.ThisKeyword) { + if (_optionalChain([reference, 'optionalAccess', _1560 => _1560.kind]) !== _ast.SyntaxKind.PropertyAccessExpression || _optionalChain([reference, 'access', _1561 => _1561.expression, 'optionalAccess', _1562 => _1562.kind]) !== _ast.SyntaxKind.ThisKeyword) { return void 0; } let method; try { const symbol = this.getChecker().getSymbolAtLocation(reference.name); - method = this.javaMethodImplementation(_nullishCoalesce(_optionalChain([symbol, 'optionalAccess', _1420 => _1420.valueDeclaration, 'optionalAccess', _1421 => _1421.resolve, 'call', _1422 => _1422()]), () => ( _optionalChain([symbol, 'optionalAccess', _1423 => _1423.declarations, 'optionalAccess', _1424 => _1424[0], 'optionalAccess', _1425 => _1425.resolve, 'call', _1426 => _1426()])))); + method = this.javaMethodImplementation(_nullishCoalesce(_optionalChain([symbol, 'optionalAccess', _1563 => _1563.valueDeclaration, 'optionalAccess', _1564 => _1564.resolve, 'call', _1565 => _1565()]), () => ( _optionalChain([symbol, 'optionalAccess', _1566 => _1566.declarations, 'optionalAccess', _1567 => _1567[0], 'optionalAccess', _1568 => _1568.resolve, 'call', _1569 => _1569()])))); } catch (e) { return void 0; } @@ -14999,12 +15533,12 @@ var JavaTranspiler = class extends BaseTranspiler { // through `this`, which lands back in the overriding core (infinite recursion) javaSuperCoreCallArguments(args, node, identation) { const callee = node.expression; - if (_optionalChain([callee, 'optionalAccess', _1427 => _1427.kind]) !== _ast.SyntaxKind.PropertyAccessExpression || _optionalChain([callee, 'access', _1428 => _1428.expression, 'optionalAccess', _1429 => _1429.kind]) !== _ast.SyntaxKind.SuperKeyword) { + if (_optionalChain([callee, 'optionalAccess', _1570 => _1570.kind]) !== _ast.SyntaxKind.PropertyAccessExpression || _optionalChain([callee, 'access', _1571 => _1571.expression, 'optionalAccess', _1572 => _1572.kind]) !== _ast.SyntaxKind.SuperKeyword) { return void 0; } let declaration; try { - declaration = this.javaMethodImplementation(_optionalChain([this, 'access', _1430 => _1430.getChecker, 'call', _1431 => _1431(), 'access', _1432 => _1432.getResolvedSignature, 'call', _1433 => _1433(node), 'optionalAccess', _1434 => _1434.declaration, 'optionalAccess', _1435 => _1435.resolve, 'call', _1436 => _1436()])); + declaration = this.javaMethodImplementation(_optionalChain([this, 'access', _1573 => _1573.getChecker, 'call', _1574 => _1574(), 'access', _1575 => _1575.getResolvedSignature, 'call', _1576 => _1576(node), 'optionalAccess', _1577 => _1577.declaration, 'optionalAccess', _1578 => _1578.resolve, 'call', _1579 => _1579()])); } catch (e) { return void 0; } @@ -15023,12 +15557,12 @@ var JavaTranspiler = class extends BaseTranspiler { } // an argument that is a parameter of the enclosing method already printed with this type javaArgumentHasType(arg, type) { - if (_optionalChain([arg, 'optionalAccess', _1437 => _1437.kind]) !== _ast.SyntaxKind.Identifier) { + if (_optionalChain([arg, 'optionalAccess', _1580 => _1580.kind]) !== _ast.SyntaxKind.Identifier) { return false; } let declaration; try { - declaration = _optionalChain([this, 'access', _1438 => _1438.getChecker, 'call', _1439 => _1439(), 'access', _1440 => _1440.getSymbolAtLocation, 'call', _1441 => _1441(arg), 'optionalAccess', _1442 => _1442.valueDeclaration, 'optionalAccess', _1443 => _1443.resolve, 'call', _1444 => _1444()]); + declaration = _optionalChain([this, 'access', _1581 => _1581.getChecker, 'call', _1582 => _1582(), 'access', _1583 => _1583.getSymbolAtLocation, 'call', _1584 => _1584(arg), 'optionalAccess', _1585 => _1585.valueDeclaration, 'optionalAccess', _1586 => _1586.resolve, 'call', _1587 => _1587()]); } catch (e) { return false; } @@ -15066,7 +15600,7 @@ var JavaTranspiler = class extends BaseTranspiler { } // a value of any static type converted to a typed-core parameter, with the fronts' semantics javaConvertToCoreType(type, printed, node) { - if (_optionalChain([node, 'optionalAccess', _1445 => _1445.kind]) === _ast.SyntaxKind.NullKeyword || _optionalChain([node, 'optionalAccess', _1446 => _1446.kind]) === _ast.SyntaxKind.Identifier && node.text === "undefined") { + if (_optionalChain([node, 'optionalAccess', _1588 => _1588.kind]) === _ast.SyntaxKind.NullKeyword || _optionalChain([node, 'optionalAccess', _1589 => _1589.kind]) === _ast.SyntaxKind.Identifier && node.text === "undefined") { return `(${type}) null`; } if (type === "Object") { @@ -15150,7 +15684,7 @@ var JavaTranspiler = class extends BaseTranspiler { ); const forwarded = node.parameters.map((p, i) => i < ancestorNames.length ? this.javaErasure(ownTypes[i]) === this.javaErasure(ancestorTypes[i]) ? ancestorNames[i] : this.javaConvertToCoreType(ownTypes[i], ancestorNames[i], void 0) : this.javaCoreDefaultArgument(p, ownTypes[i])).join(", "); const call = `this.${name}(${forwarded})`; - const returnOf = (def) => _nullishCoalesce(_optionalChain([def, 'access', _1447 => _1447.match, 'call', _1448 => _1448(/(?:public|protected|private)\s+(?:static\s+)?(.+?)\s+\w+\s*\(/), 'optionalAccess', _1449 => _1449[1], 'optionalAccess', _1450 => _1450.trim, 'call', _1451 => _1451()]), () => ( "Object")); + const returnOf = (def) => _nullishCoalesce(_optionalChain([def, 'access', _1590 => _1590.match, 'call', _1591 => _1591(/(?:public|protected|private)\s+(?:static\s+)?(.+?)\s+\w+\s*\(/), 'optionalAccess', _1592 => _1592[1], 'optionalAccess', _1593 => _1593.trim, 'call', _1594 => _1594()]), () => ( "Object")); const returnType = returnOf(ancestorDef); const ownReturn = returnOf(this.printMethodDefinition(node, identation, () => "")); const body = returnType === "void" ? `${call};` : returnType === ownReturn ? `return ${call};` : `return (${returnType}) (Object) ${call};`; @@ -15161,21 +15695,21 @@ var JavaTranspiler = class extends BaseTranspiler { // referenced method's signature, not to spawn's `...args` - each one carries the checkcast javaSpawnCallParameterTypes(node) { const callee = node.expression; - if (_optionalChain([callee, 'optionalAccess', _1452 => _1452.kind]) !== _ast.SyntaxKind.PropertyAccessExpression || _optionalChain([callee, 'access', _1453 => _1453.expression, 'optionalAccess', _1454 => _1454.kind]) !== _ast.SyntaxKind.ThisKeyword || _optionalChain([callee, 'access', _1455 => _1455.name, 'optionalAccess', _1456 => _1456.text]) !== "spawn") { + if (_optionalChain([callee, 'optionalAccess', _1595 => _1595.kind]) !== _ast.SyntaxKind.PropertyAccessExpression || _optionalChain([callee, 'access', _1596 => _1596.expression, 'optionalAccess', _1597 => _1597.kind]) !== _ast.SyntaxKind.ThisKeyword || _optionalChain([callee, 'access', _1598 => _1598.name, 'optionalAccess', _1599 => _1599.text]) !== "spawn") { return void 0; } const reference = (_nullishCoalesce(node.arguments, () => ( [])))[0]; - if (_optionalChain([reference, 'optionalAccess', _1457 => _1457.kind]) !== _ast.SyntaxKind.PropertyAccessExpression || _optionalChain([reference, 'access', _1458 => _1458.expression, 'optionalAccess', _1459 => _1459.kind]) !== _ast.SyntaxKind.ThisKeyword || _optionalChain([reference, 'access', _1460 => _1460.name, 'optionalAccess', _1461 => _1461.text]) === void 0) { + if (_optionalChain([reference, 'optionalAccess', _1600 => _1600.kind]) !== _ast.SyntaxKind.PropertyAccessExpression || _optionalChain([reference, 'access', _1601 => _1601.expression, 'optionalAccess', _1602 => _1602.kind]) !== _ast.SyntaxKind.ThisKeyword || _optionalChain([reference, 'access', _1603 => _1603.name, 'optionalAccess', _1604 => _1604.text]) === void 0) { return void 0; } let declaration; try { const symbol = this.getChecker().getSymbolAtLocation(reference.name); - declaration = _nullishCoalesce(_optionalChain([symbol, 'optionalAccess', _1462 => _1462.valueDeclaration, 'optionalAccess', _1463 => _1463.resolve, 'call', _1464 => _1464()]), () => ( _optionalChain([symbol, 'optionalAccess', _1465 => _1465.declarations, 'optionalAccess', _1466 => _1466[0], 'optionalAccess', _1467 => _1467.resolve, 'call', _1468 => _1468()]))); + declaration = _nullishCoalesce(_optionalChain([symbol, 'optionalAccess', _1605 => _1605.valueDeclaration, 'optionalAccess', _1606 => _1606.resolve, 'call', _1607 => _1607()]), () => ( _optionalChain([symbol, 'optionalAccess', _1608 => _1608.declarations, 'optionalAccess', _1609 => _1609[0], 'optionalAccess', _1610 => _1610.resolve, 'call', _1611 => _1611()]))); } catch (e) { return void 0; } - const parameters = _optionalChain([declaration, 'optionalAccess', _1469 => _1469.parameters]); + const parameters = _optionalChain([declaration, 'optionalAccess', _1612 => _1612.parameters]); if (parameters === void 0) { return void 0; } @@ -15215,8 +15749,8 @@ var JavaTranspiler = class extends BaseTranspiler { if (checker === void 0) { return []; } - const declaration = _optionalChain([checker, 'access', _1470 => _1470.getResolvedSignature, 'call', _1471 => _1471(node), 'optionalAccess', _1472 => _1472.declaration, 'optionalAccess', _1473 => _1473.resolve, 'call', _1474 => _1474()]); - const parameters = _optionalChain([declaration, 'optionalAccess', _1475 => _1475.parameters]); + const declaration = _optionalChain([checker, 'access', _1613 => _1613.getResolvedSignature, 'call', _1614 => _1614(node), 'optionalAccess', _1615 => _1615.declaration, 'optionalAccess', _1616 => _1616.resolve, 'call', _1617 => _1617()]); + const parameters = _optionalChain([declaration, 'optionalAccess', _1618 => _1618.parameters]); if (parameters === void 0) { return []; } @@ -15330,19 +15864,19 @@ var JavaTranspiler = class extends BaseTranspiler { if (defaulted !== void 0) { return defaulted; } - const isInsideNewExpression = _optionalChain([node, 'optionalAccess', _1476 => _1476.parent, 'optionalAccess', _1477 => _1477.kind]) === _ast.SyntaxKind.NewExpression; - const isInsideCatch = _optionalChain([node, 'optionalAccess', _1478 => _1478.parent, 'optionalAccess', _1479 => _1479.kind]) === _ast.SyntaxKind.ThrowStatement; - const isLeftSide = _optionalChain([node, 'optionalAccess', _1480 => _1480.parent, 'optionalAccess', _1481 => _1481.name]) === node || _optionalChain([node, 'optionalAccess', _1482 => _1482.parent, 'optionalAccess', _1483 => _1483.left]) === node; - const isCallOrPropertyAccess = _optionalChain([node, 'optionalAccess', _1484 => _1484.parent, 'optionalAccess', _1485 => _1485.kind]) === _ast.SyntaxKind.PropertyAccessExpression || _optionalChain([node, 'optionalAccess', _1486 => _1486.parent, 'optionalAccess', _1487 => _1487.kind]) === _ast.SyntaxKind.ElementAccessExpression; + const isInsideNewExpression = _optionalChain([node, 'optionalAccess', _1619 => _1619.parent, 'optionalAccess', _1620 => _1620.kind]) === _ast.SyntaxKind.NewExpression; + const isInsideCatch = _optionalChain([node, 'optionalAccess', _1621 => _1621.parent, 'optionalAccess', _1622 => _1622.kind]) === _ast.SyntaxKind.ThrowStatement; + const isLeftSide = _optionalChain([node, 'optionalAccess', _1623 => _1623.parent, 'optionalAccess', _1624 => _1624.name]) === node || _optionalChain([node, 'optionalAccess', _1625 => _1625.parent, 'optionalAccess', _1626 => _1626.left]) === node; + const isCallOrPropertyAccess = _optionalChain([node, 'optionalAccess', _1627 => _1627.parent, 'optionalAccess', _1628 => _1628.kind]) === _ast.SyntaxKind.PropertyAccessExpression || _optionalChain([node, 'optionalAccess', _1629 => _1629.parent, 'optionalAccess', _1630 => _1630.kind]) === _ast.SyntaxKind.ElementAccessExpression; if (!isLeftSide && !isCallOrPropertyAccess && !isInsideCatch && !isInsideNewExpression) { const type = this.getChecker().getTypeAtLocation(node); - const typeSymbol = _optionalChain([type, 'optionalAccess', _1488 => _1488.getSymbol, 'optionalCall', _1489 => _1489()]); + const typeSymbol = _optionalChain([type, 'optionalAccess', _1631 => _1631.getSymbol, 'optionalCall', _1632 => _1632()]); if (typeSymbol !== void 0) { - const decl = (_nullishCoalesce(_optionalChain([typeSymbol, 'optionalAccess', _1490 => _1490.declarations]), () => ( []))).map((d) => d.resolve()); + const decl = (_nullishCoalesce(_optionalChain([typeSymbol, 'optionalAccess', _1633 => _1633.declarations]), () => ( []))).map((d) => d.resolve()); if (decl.length > 0 && decl[0].getSourceFile().fileName.indexOf("typescript") === -1) { const symbol = this.getChecker().getSymbolAtLocation(node); - const first = _optionalChain([symbol, 'optionalAccess', _1491 => _1491.declarations, 'access', _1492 => _1492[0], 'optionalAccess', _1493 => _1493.resolve, 'call', _1494 => _1494()]); - const isClassDeclaration5 = !!symbol && (first.kind === _ast.SyntaxKind.ClassDeclaration || first.kind === _ast.SyntaxKind.ImportSpecifier && _optionalChain([this, 'access', _1495 => _1495.getChecker, 'call', _1496 => _1496(), 'access', _1497 => _1497.getAliasedSymbol, 'call', _1498 => _1498(symbol), 'optionalAccess', _1499 => _1499.declarations, 'access', _1500 => _1500[0], 'optionalAccess', _1501 => _1501.resolve, 'call', _1502 => _1502(), 'optionalAccess', _1503 => _1503.kind]) === _ast.SyntaxKind.ClassDeclaration); + const first = _optionalChain([symbol, 'optionalAccess', _1634 => _1634.declarations, 'access', _1635 => _1635[0], 'optionalAccess', _1636 => _1636.resolve, 'call', _1637 => _1637()]); + const isClassDeclaration5 = !!symbol && (first.kind === _ast.SyntaxKind.ClassDeclaration || first.kind === _ast.SyntaxKind.ImportSpecifier && _optionalChain([this, 'access', _1638 => _1638.getChecker, 'call', _1639 => _1639(), 'access', _1640 => _1640.getAliasedSymbol, 'call', _1641 => _1641(symbol), 'optionalAccess', _1642 => _1642.declarations, 'access', _1643 => _1643[0], 'optionalAccess', _1644 => _1644.resolve, 'call', _1645 => _1645(), 'optionalAccess', _1646 => _1646.kind]) === _ast.SyntaxKind.ClassDeclaration); if (isClassDeclaration5) { return `${idValue}.class`; } @@ -15358,7 +15892,7 @@ var JavaTranspiler = class extends BaseTranspiler { const constructorBody = this.printFunctionBody(node, identation); let superCallParams = ""; let hasSuperCall = false; - _optionalChain([node, 'access', _1504 => _1504.body, 'optionalAccess', _1505 => _1505.statements, 'access', _1506 => _1506.forEach, 'call', _1507 => _1507((statement) => { + _optionalChain([node, 'access', _1647 => _1647.body, 'optionalAccess', _1648 => _1648.statements, 'access', _1649 => _1649.forEach, 'call', _1650 => _1650((statement) => { const expression = _is.isExpressionStatement.call(void 0, statement) ? statement.expression : void 0; if (expression && _is.isCallExpression.call(void 0, expression) && expression.expression.getText().trim() === "super") { hasSuperCall = true; @@ -15377,8 +15911,8 @@ var JavaTranspiler = class extends BaseTranspiler { } printDynamicCall(node, identation) { const elementAccess = node.expression; - if (_optionalChain([elementAccess, 'optionalAccess', _1508 => _1508.kind]) === _ast.SyntaxKind.ElementAccessExpression) { - const parsedArg = _nullishCoalesce(_optionalChain([node, 'access', _1509 => _1509.arguments, 'optionalAccess', _1510 => _1510.map, 'call', _1511 => _1511((n) => this.printNode(n, identation).trimStart()), 'access', _1512 => _1512.join, 'call', _1513 => _1513(", ")]), () => ( "")); + if (_optionalChain([elementAccess, 'optionalAccess', _1651 => _1651.kind]) === _ast.SyntaxKind.ElementAccessExpression) { + const parsedArg = _nullishCoalesce(_optionalChain([node, 'access', _1652 => _1652.arguments, 'optionalAccess', _1653 => _1653.map, 'call', _1654 => _1654((n) => this.printNode(n, identation).trimStart()), 'access', _1655 => _1655.join, 'call', _1656 => _1656(", ")]), () => ( "")); const target = this.printNode(elementAccess.expression, 0); const propName = this.printNode(elementAccess.argumentExpression, 0); return `${this.DYNAMIC_CALL_OPEN}${target}, ${propName}, new Object[] { ${parsedArg} })`; @@ -15405,9 +15939,9 @@ var JavaTranspiler = class extends BaseTranspiler { // } printWrappedUnknownThisProperty(node) { const type = this.getChecker().getResolvedSignature(node); - if (_optionalChain([type, 'optionalAccess', _1514 => _1514.declaration]) === void 0) { - const parsedArguments = _optionalChain([node, 'access', _1515 => _1515.arguments, 'optionalAccess', _1516 => _1516.map, 'call', _1517 => _1517((a) => this.printNode(a, 0)), 'access', _1518 => _1518.join, 'call', _1519 => _1519(", ")]) || ""; - const propName = _optionalChain([node, 'access', _1520 => _1520.expression, 'optionalAccess', _1521 => _1521.name, 'access', _1522 => _1522.text]); + if (_optionalChain([type, 'optionalAccess', _1657 => _1657.declaration]) === void 0) { + const parsedArguments = _optionalChain([node, 'access', _1658 => _1658.arguments, 'optionalAccess', _1659 => _1659.map, 'call', _1660 => _1660((a) => this.printNode(a, 0)), 'access', _1661 => _1661.join, 'call', _1662 => _1662(", ")]) || ""; + const propName = _optionalChain([node, 'access', _1663 => _1663.expression, 'optionalAccess', _1664 => _1664.name, 'access', _1665 => _1665.text]); return `${this.DYNAMIC_CALL_OPEN}this, "${propName}", new Object[] { ${parsedArguments} })`; } return void 0; @@ -15455,7 +15989,7 @@ var JavaTranspiler = class extends BaseTranspiler { return `Math.pow(Double.parseDouble(${this.javaStringBoxText(args[0], parsedArg1)}), Double.parseDouble(${this.javaStringBoxText(args[1], parsedArg2)}))`; } } - const leftSide = _optionalChain([node, 'access', _1523 => _1523.expression, 'optionalAccess', _1524 => _1524.expression]); + const leftSide = _optionalChain([node, 'access', _1666 => _1666.expression, 'optionalAccess', _1667 => _1667.expression]); const leftSideText = leftSide ? this.printNode(leftSide, 0) : void 0; if (leftSideText === this.THIS_TOKEN || leftSide.getFullText().indexOf("(this as any)") > -1) { const res = this.printWrappedUnknownThisProperty(node); @@ -15491,27 +16025,27 @@ var JavaTranspiler = class extends BaseTranspiler { return void 0; } getVarMethodIfAny(node) { - let current = _optionalChain([node, 'optionalAccess', _1525 => _1525.parent]); + let current = _optionalChain([node, 'optionalAccess', _1668 => _1668.parent]); while (current) { if (_is.isMethodDeclaration.call(void 0, current) || _is.isFunctionDeclaration.call(void 0, current)) { - return String(_nullishCoalesce(_optionalChain([current, 'access', _1526 => _1526.name, 'optionalAccess', _1527 => _1527.text]), () => ( ""))); + return String(_nullishCoalesce(_optionalChain([current, 'access', _1669 => _1669.name, 'optionalAccess', _1670 => _1670.text]), () => ( ""))); } current = current.parent; } return "outsideAnyMethod"; } getVarClassIfAny(node) { - let current = _optionalChain([node, 'optionalAccess', _1528 => _1528.parent]); + let current = _optionalChain([node, 'optionalAccess', _1671 => _1671.parent]); while (current) { if (_is.isClassDeclaration.call(void 0, current)) { - return String(_nullishCoalesce(_optionalChain([current, 'access', _1529 => _1529.name, 'optionalAccess', _1530 => _1530.text]), () => ( ""))); + return String(_nullishCoalesce(_optionalChain([current, 'access', _1672 => _1672.name, 'optionalAccess', _1673 => _1673.text]), () => ( ""))); } current = current.parent; } return ""; } getVarKey(node) { - const varName = _nullishCoalesce(_optionalChain([node, 'optionalAccess', _1531 => _1531.text]), () => ( _optionalChain([node, 'optionalAccess', _1532 => _1532.name, 'optionalAccess', _1533 => _1533.text]))); + const varName = _nullishCoalesce(_optionalChain([node, 'optionalAccess', _1674 => _1674.text]), () => ( _optionalChain([node, 'optionalAccess', _1675 => _1675.name, 'optionalAccess', _1676 => _1676.text]))); if (!varName) { return ""; } @@ -15532,7 +16066,7 @@ var JavaTranspiler = class extends BaseTranspiler { if (flags & _sync.TypeFlags.Boolean) { return "boolean"; } - const families = new Set((_nullishCoalesce(_optionalChain([type, 'access', _1534 => _1534.getTypes, 'optionalCall', _1535 => _1535()]), () => ( []))).map((t) => this.equalityOperandFamily(t))); + const families = new Set((_nullishCoalesce(_optionalChain([type, 'access', _1677 => _1677.getTypes, 'optionalCall', _1678 => _1678()]), () => ( []))).map((t) => this.equalityOperandFamily(t))); families.delete(void 0); families.delete("null"); return families.size === 1 ? families.values().next().value : void 0; @@ -15551,7 +16085,7 @@ var JavaTranspiler = class extends BaseTranspiler { // The null/undefined literal: its Java text is `null`, so Objects.equals(x, null) // is literally the identity test Helpers.isEqual performs on that operand. isNullishLiteral(node) { - return _optionalChain([node, 'optionalAccess', _1536 => _1536.kind]) === _ast.SyntaxKind.NullKeyword || _optionalChain([node, 'optionalAccess', _1537 => _1537.kind]) === _ast.SyntaxKind.Identifier && node.text === "undefined"; + return _optionalChain([node, 'optionalAccess', _1679 => _1679.kind]) === _ast.SyntaxKind.NullKeyword || _optionalChain([node, 'optionalAccess', _1680 => _1680.kind]) === _ast.SyntaxKind.Identifier && node.text === "undefined"; } // ---- numeric operand kinds (java-15) ---- // Helpers.isEqual compares numeric operands by value (integers via toLong, Double/Float via @@ -15575,7 +16109,7 @@ var JavaTranspiler = class extends BaseTranspiler { // (((String)x).length() / ((List)x).size(), see javaLengthKind). Every other // receiver prints Helpers.getArrayLength, whose value is not an int. javaNativeLengthKind(node) { - if (_optionalChain([node, 'optionalAccess', _1538 => _1538.kind]) !== _ast.SyntaxKind.PropertyAccessExpression || node.name.text !== "length") { + if (_optionalChain([node, 'optionalAccess', _1681 => _1681.kind]) !== _ast.SyntaxKind.PropertyAccessExpression || node.name.text !== "length") { return void 0; } return this.javaLengthKind(node.expression) !== void 0 ? "int" : void 0; @@ -15589,20 +16123,20 @@ var JavaTranspiler = class extends BaseTranspiler { } const checker = this.getChecker(); const symbol = checker.getSymbolAtLocation(node); - const declaration = _nullishCoalesce(_optionalChain([symbol, 'optionalAccess', _1539 => _1539.valueDeclaration, 'optionalAccess', _1540 => _1540.resolve, 'call', _1541 => _1541()]), () => ( _optionalChain([symbol, 'optionalAccess', _1542 => _1542.declarations, 'optionalAccess', _1543 => _1543[0], 'optionalAccess', _1544 => _1544.resolve, 'call', _1545 => _1545()]))); + const declaration = _nullishCoalesce(_optionalChain([symbol, 'optionalAccess', _1682 => _1682.valueDeclaration, 'optionalAccess', _1683 => _1683.resolve, 'call', _1684 => _1684()]), () => ( _optionalChain([symbol, 'optionalAccess', _1685 => _1685.declarations, 'optionalAccess', _1686 => _1686[0], 'optionalAccess', _1687 => _1687.resolve, 'call', _1688 => _1688()]))); if (!declaration || declaration.kind !== _ast.SyntaxKind.VariableDeclaration || !_is.isIdentifier.call(void 0, declaration.name)) { return false; } const list = declaration.parent; - const forStatement = _optionalChain([list, 'optionalAccess', _1546 => _1546.parent]); + const forStatement = _optionalChain([list, 'optionalAccess', _1689 => _1689.parent]); if (!list || !forStatement || forStatement.kind !== _ast.SyntaxKind.ForStatement || forStatement.initializer !== list) { return false; } - if (_optionalChain([list, 'access', _1547 => _1547.declarations, 'optionalAccess', _1548 => _1548.length]) !== 1 || this.javaIntegerLiteralKind(declaration.initializer) === void 0) { + if (_optionalChain([list, 'access', _1690 => _1690.declarations, 'optionalAccess', _1691 => _1691.length]) !== 1 || this.javaIntegerLiteralKind(declaration.initializer) === void 0) { return false; } const incrementor = forStatement.incrementor; - if (!incrementor || incrementor.kind !== _ast.SyntaxKind.PostfixUnaryExpression && incrementor.kind !== _ast.SyntaxKind.PrefixUnaryExpression || incrementor.operator !== _ast.SyntaxKind.PlusPlusToken && incrementor.operator !== _ast.SyntaxKind.MinusMinusToken || _optionalChain([incrementor, 'access', _1549 => _1549.operand, 'optionalAccess', _1550 => _1550.kind]) !== _ast.SyntaxKind.Identifier) { + if (!incrementor || incrementor.kind !== _ast.SyntaxKind.PostfixUnaryExpression && incrementor.kind !== _ast.SyntaxKind.PrefixUnaryExpression || incrementor.operator !== _ast.SyntaxKind.PlusPlusToken && incrementor.operator !== _ast.SyntaxKind.MinusMinusToken || _optionalChain([incrementor, 'access', _1692 => _1692.operand, 'optionalAccess', _1693 => _1693.kind]) !== _ast.SyntaxKind.Identifier) { return false; } const incrementorSymbol = checker.getSymbolAtLocation(incrementor.operand); @@ -15616,7 +16150,7 @@ var JavaTranspiler = class extends BaseTranspiler { return void 0; } const symbol = this.getChecker().getSymbolAtLocation(node); - const declaration = _nullishCoalesce(_optionalChain([symbol, 'optionalAccess', _1551 => _1551.valueDeclaration, 'optionalAccess', _1552 => _1552.resolve, 'call', _1553 => _1553()]), () => ( _optionalChain([symbol, 'optionalAccess', _1554 => _1554.declarations, 'optionalAccess', _1555 => _1555[0], 'optionalAccess', _1556 => _1556.resolve, 'call', _1557 => _1557()]))); + const declaration = _nullishCoalesce(_optionalChain([symbol, 'optionalAccess', _1694 => _1694.valueDeclaration, 'optionalAccess', _1695 => _1695.resolve, 'call', _1696 => _1696()]), () => ( _optionalChain([symbol, 'optionalAccess', _1697 => _1697.declarations, 'optionalAccess', _1698 => _1698[0], 'optionalAccess', _1699 => _1699.resolve, 'call', _1700 => _1700()]))); if (!declaration || declaration.kind !== _ast.SyntaxKind.VariableDeclaration || !_is.isIdentifier.call(void 0, declaration.name)) { return void 0; } @@ -15624,7 +16158,7 @@ var JavaTranspiler = class extends BaseTranspiler { if (kind === void 0) { return void 0; } - const isConst = (_optionalChain([declaration, 'access', _1558 => _1558.parent, 'optionalAccess', _1559 => _1559.flags]) & _ast.NodeFlags.Const) !== 0; + const isConst = (_optionalChain([declaration, 'access', _1701 => _1701.parent, 'optionalAccess', _1702 => _1702.flags]) & _ast.NodeFlags.Const) !== 0; if (!isConst && !this.javaWritesKeepNumberKind(declaration, symbol, kind)) { return void 0; } @@ -15681,9 +16215,9 @@ var JavaTranspiler = class extends BaseTranspiler { return found; } enclosingFunctionLike(node) { - let current = _optionalChain([node, 'optionalAccess', _1560 => _1560.parent]); + let current = _optionalChain([node, 'optionalAccess', _1703 => _1703.parent]); while (current) { - if (_chunk4FDYB2TTcjs.isFunctionLike.call(void 0, current)) { + if (_chunkUBXMRIM6cjs.isFunctionLike.call(void 0, current)) { return current; } current = current.parent; @@ -15731,8 +16265,8 @@ var JavaTranspiler = class extends BaseTranspiler { return void 0; } const checker = this.getChecker(); - const leftFamily = this.equalityOperandFamily(_optionalChain([checker, 'optionalAccess', _1561 => _1561.getTypeAtLocation, 'call', _1562 => _1562(node.left)])); - const rightFamily = this.equalityOperandFamily(_optionalChain([checker, 'optionalAccess', _1563 => _1563.getTypeAtLocation, 'call', _1564 => _1564(node.right)])); + const leftFamily = this.equalityOperandFamily(_optionalChain([checker, 'optionalAccess', _1704 => _1704.getTypeAtLocation, 'call', _1705 => _1705(node.left)])); + const rightFamily = this.equalityOperandFamily(_optionalChain([checker, 'optionalAccess', _1706 => _1706.getTypeAtLocation, 'call', _1707 => _1707(node.right)])); const leftProved = leftFamily !== void 0 && (leftFamily !== "null" || this.isNullishLiteral(node.left)); const rightProved = rightFamily !== void 0 && (rightFamily !== "null" || this.isNullishLiteral(node.right)); const equalCall = `${negated ? "!" : ""}java.util.Objects.equals(${leftText}, ${rightText})`; @@ -15781,7 +16315,7 @@ var JavaTranspiler = class extends BaseTranspiler { // `int`/`long`/`double` primitive), undefined when nothing was declared or the declared // type is not numeric javaDeclaredNumericFamily(expression) { - const type = _optionalChain([this, 'access', _1565 => _1565.javaDeclaredTypeOf, 'call', _1566 => _1566(expression), 'optionalAccess', _1567 => _1567.trim, 'call', _1568 => _1568()]); + const type = _optionalChain([this, 'access', _1708 => _1708.javaDeclaredTypeOf, 'call', _1709 => _1709(expression), 'optionalAccess', _1710 => _1710.trim, 'call', _1711 => _1711()]); return type !== void 0 && JAVA_DECLARED_NUMERIC_TYPES.has(type) ? type : void 0; } // `x[k] = v` prints the runtime helper by default. Helpers.addElementToObject @@ -15808,7 +16342,7 @@ var JavaTranspiler = class extends BaseTranspiler { return true; } const type = checker.getTypeAtLocation(value); - const parts = type.flags & _sync.TypeFlags.Union ? _nullishCoalesce(_optionalChain([type, 'access', _1569 => _1569.getTypes, 'optionalCall', _1570 => _1570()]), () => ( [])) : [type]; + const parts = type.flags & _sync.TypeFlags.Union ? _nullishCoalesce(_optionalChain([type, 'access', _1712 => _1712.getTypes, 'optionalCall', _1713 => _1713()]), () => ( [])) : [type]; const nullable = _sync.TypeFlags.Any | _sync.TypeFlags.Unknown | JAVA_NULLISH_TYPE_FLAGS | _sync.TypeFlags.TypeParameter; return parts.length === 0 || parts.some((t) => (t.flags & nullable) !== 0); } @@ -15829,7 +16363,7 @@ var JavaTranspiler = class extends BaseTranspiler { return false; } const symbol = checker.getSymbolAtLocation(container); - const declaration = _nullishCoalesce(_optionalChain([symbol, 'optionalAccess', _1571 => _1571.valueDeclaration, 'optionalAccess', _1572 => _1572.resolve, 'call', _1573 => _1573()]), () => ( _optionalChain([symbol, 'optionalAccess', _1574 => _1574.declarations, 'optionalAccess', _1575 => _1575[0], 'optionalAccess', _1576 => _1576.resolve, 'call', _1577 => _1577()]))); + const declaration = _nullishCoalesce(_optionalChain([symbol, 'optionalAccess', _1714 => _1714.valueDeclaration, 'optionalAccess', _1715 => _1715.resolve, 'call', _1716 => _1716()]), () => ( _optionalChain([symbol, 'optionalAccess', _1717 => _1717.declarations, 'optionalAccess', _1718 => _1718[0], 'optionalAccess', _1719 => _1719.resolve, 'call', _1720 => _1720()]))); if (!declaration || declaration.kind !== _ast.SyntaxKind.VariableDeclaration || !declaration.initializer) { return false; } @@ -15866,7 +16400,7 @@ var JavaTranspiler = class extends BaseTranspiler { return false; } const checker = this.checkerOrUndefined(); - const fileName = _optionalChain([checker, 'optionalAccess', _1578 => _1578.getResolvedSignature, 'call', _1579 => _1579(initializer), 'optionalAccess', _1580 => _1580.declaration, 'optionalAccess', _1581 => _1581.resolve, 'call', _1582 => _1582(), 'optionalAccess', _1583 => _1583.getSourceFile, 'optionalCall', _1584 => _1584(), 'optionalAccess', _1585 => _1585.fileName]); + const fileName = _optionalChain([checker, 'optionalAccess', _1721 => _1721.getResolvedSignature, 'call', _1722 => _1722(initializer), 'optionalAccess', _1723 => _1723.declaration, 'optionalAccess', _1724 => _1724.resolve, 'call', _1725 => _1725(), 'optionalAccess', _1726 => _1726.getSourceFile, 'optionalCall', _1727 => _1727(), 'optionalAccess', _1728 => _1728.fileName]); return typeof fileName === "string" && JAVA_FRESH_EXTEND_FILE.test(fileName); } // the bottom container of `x[k1][k2].. = v` when x is a declared Map / List and k1 is not a @@ -15903,7 +16437,7 @@ var JavaTranspiler = class extends BaseTranspiler { // itself; an assignment could replace the HashMap with a List or a class instance. javaLocalIsReassigned(node, admitsWrite) { let scope = node; - while (scope && !_chunk4FDYB2TTcjs.isFunctionLike.call(void 0, scope) && !_is.isSourceFile.call(void 0, scope)) { + while (scope && !_chunkUBXMRIM6cjs.isFunctionLike.call(void 0, scope) && !_is.isSourceFile.call(void 0, scope)) { scope = scope.parent; } if (!scope) { @@ -15951,7 +16485,7 @@ var JavaTranspiler = class extends BaseTranspiler { if (index < 0 || left.elements.some((e, i) => i !== index && this.javaPatternBindsSymbol(e, symbol))) { return false; } - const declaration = _optionalChain([checker, 'access', _1586 => _1586.getResolvedSignature, 'call', _1587 => _1587(call), 'optionalAccess', _1588 => _1588.declaration, 'optionalAccess', _1589 => _1589.resolve, 'call', _1590 => _1590()]); + const declaration = _optionalChain([checker, 'access', _1729 => _1729.getResolvedSignature, 'call', _1730 => _1730(call), 'optionalAccess', _1731 => _1731.declaration, 'optionalAccess', _1732 => _1732.resolve, 'call', _1733 => _1733()]); if (!declaration || !_is.isMethodDeclaration.call(void 0, declaration) || !declaration.body) { return false; } @@ -15964,7 +16498,7 @@ var JavaTranspiler = class extends BaseTranspiler { let returns = 0; let proven = true; const walk = (n) => { - if (!proven || n === void 0 || n !== declaration.body && _chunk4FDYB2TTcjs.isFunctionLike.call(void 0, n)) { + if (!proven || n === void 0 || n !== declaration.body && _chunkUBXMRIM6cjs.isFunctionLike.call(void 0, n)) { return; } if (_is.isReturnStatement.call(void 0, n)) { @@ -16026,7 +16560,7 @@ var JavaTranspiler = class extends BaseTranspiler { } catch (e) { return false; } - const declaration = _nullishCoalesce(_optionalChain([symbol, 'optionalAccess', _1591 => _1591.valueDeclaration, 'optionalAccess', _1592 => _1592.resolve, 'call', _1593 => _1593()]), () => ( _optionalChain([symbol, 'optionalAccess', _1594 => _1594.declarations, 'optionalAccess', _1595 => _1595[0], 'optionalAccess', _1596 => _1596.resolve, 'call', _1597 => _1597()]))); + const declaration = _nullishCoalesce(_optionalChain([symbol, 'optionalAccess', _1734 => _1734.valueDeclaration, 'optionalAccess', _1735 => _1735.resolve, 'call', _1736 => _1736()]), () => ( _optionalChain([symbol, 'optionalAccess', _1737 => _1737.declarations, 'optionalAccess', _1738 => _1738[0], 'optionalAccess', _1739 => _1739.resolve, 'call', _1740 => _1740()]))); if (!declaration || declaration.kind !== _ast.SyntaxKind.MethodDeclaration && declaration.kind !== _ast.SyntaxKind.FunctionDeclaration) { return false; } @@ -16043,7 +16577,7 @@ var JavaTranspiler = class extends BaseTranspiler { if (!plain || current === void 0) { return; } - if (_chunk4FDYB2TTcjs.isFunctionLike.call(void 0, current) && current !== declaration) { + if (_chunkUBXMRIM6cjs.isFunctionLike.call(void 0, current) && current !== declaration) { return; } if (_is.isReturnStatement.call(void 0, current)) { @@ -16075,14 +16609,14 @@ var JavaTranspiler = class extends BaseTranspiler { try { const checker = this.getChecker(); const signature = checker.getSignatureFromDeclaration(declaration); - const type = _optionalChain([signature, 'optionalAccess', _1598 => _1598.getReturnType, 'call', _1599 => _1599()]); + const type = _optionalChain([signature, 'optionalAccess', _1741 => _1741.getReturnType, 'call', _1742 => _1742()]); if (!type || (type.flags & _sync.TypeFlags.Object) === 0) { return false; } if (checker.isArrayType(type) || checker.isTupleType(type)) { return false; } - const declarations = (_nullishCoalesce(_optionalChain([type, 'access', _1600 => _1600.getSymbol, 'call', _1601 => _1601(), 'optionalAccess', _1602 => _1602.declarations]), () => ( []))).map((d) => d.resolve()); + const declarations = (_nullishCoalesce(_optionalChain([type, 'access', _1743 => _1743.getSymbol, 'call', _1744 => _1744(), 'optionalAccess', _1745 => _1745.declarations]), () => ( []))).map((d) => d.resolve()); if (declarations.some((d) => d.kind === _ast.SyntaxKind.ClassDeclaration)) { return false; } @@ -16109,7 +16643,7 @@ var JavaTranspiler = class extends BaseTranspiler { } const flags = type.flags; if (flags & _sync.TypeFlags.Union) { - const parts = _nullishCoalesce(_optionalChain([type, 'access', _1603 => _1603.getTypes, 'optionalCall', _1604 => _1604()]), () => ( [])); + const parts = _nullishCoalesce(_optionalChain([type, 'access', _1746 => _1746.getTypes, 'optionalCall', _1747 => _1747()]), () => ( [])); return parts.length > 0 && parts.every((t) => this.isDictionaryTsType(t, checker, depth + 1)); } if (!(flags & _sync.TypeFlags.Object)) { @@ -16148,7 +16682,7 @@ var JavaTranspiler = class extends BaseTranspiler { return false; } const symbol = this.getChecker().getSymbolAtLocation(node); - const declaration = _nullishCoalesce(_optionalChain([symbol, 'optionalAccess', _1605 => _1605.valueDeclaration, 'optionalAccess', _1606 => _1606.resolve, 'call', _1607 => _1607()]), () => ( _optionalChain([symbol, 'optionalAccess', _1608 => _1608.declarations, 'optionalAccess', _1609 => _1609[0], 'optionalAccess', _1610 => _1610.resolve, 'call', _1611 => _1611()]))); + const declaration = _nullishCoalesce(_optionalChain([symbol, 'optionalAccess', _1748 => _1748.valueDeclaration, 'optionalAccess', _1749 => _1749.resolve, 'call', _1750 => _1750()]), () => ( _optionalChain([symbol, 'optionalAccess', _1751 => _1751.declarations, 'optionalAccess', _1752 => _1752[0], 'optionalAccess', _1753 => _1753.resolve, 'call', _1754 => _1754()]))); if (!declaration) { return false; } @@ -16171,7 +16705,7 @@ var JavaTranspiler = class extends BaseTranspiler { if (checker.isArrayType(type) || checker.isTupleType(type)) { return true; } - return _optionalChain([type, 'access', _1612 => _1612.isTypeReference, 'optionalCall', _1613 => _1613()]) === true && _optionalChain([type, 'access', _1614 => _1614.getTarget, 'call', _1615 => _1615(), 'access', _1616 => _1616.getSymbol, 'call', _1617 => _1617(), 'optionalAccess', _1618 => _1618.escapedName]) === "ReadonlyArray"; + return _optionalChain([type, 'access', _1755 => _1755.isTypeReference, 'optionalCall', _1756 => _1756()]) === true && _optionalChain([type, 'access', _1757 => _1757.getTarget, 'call', _1758 => _1758(), 'access', _1759 => _1759.getSymbol, 'call', _1760 => _1760(), 'optionalAccess', _1761 => _1761.escapedName]) === "ReadonlyArray"; } // `.length` is a Java int for exactly these receivers; every other receiver keeps // Helpers.getArrayLength, whose result type is not proven @@ -16210,14 +16744,14 @@ var JavaTranspiler = class extends BaseTranspiler { if (!type || (type.flags & _sync.TypeFlags.Object) === 0) { return false; } - let current = _optionalChain([type, 'access', _1619 => _1619.isTypeReference, 'optionalCall', _1620 => _1620()]) ? type.getTarget() : type; + let current = _optionalChain([type, 'access', _1762 => _1762.isTypeReference, 'optionalCall', _1763 => _1763()]) ? type.getTarget() : type; for (let depth = 0; current && depth < 8; depth++) { - const name = _optionalChain([current, 'access', _1621 => _1621.getSymbol, 'optionalCall', _1622 => _1622(), 'optionalAccess', _1623 => _1623.escapedName]); + const name = _optionalChain([current, 'access', _1764 => _1764.getSymbol, 'optionalCall', _1765 => _1765(), 'optionalAccess', _1766 => _1766.escapedName]); if (name !== void 0 && JAVA_LIST_BACKED_TS_CLASSES.has(name)) { return true; } - const bases = _nullishCoalesce(_optionalChain([current, 'access', _1624 => _1624.getBaseTypes, 'optionalCall', _1625 => _1625()]), () => ( [])); - current = bases.length > 0 ? _optionalChain([bases, 'access', _1626 => _1626[0], 'access', _1627 => _1627.isTypeReference, 'optionalCall', _1628 => _1628()]) ? bases[0].getTarget() : bases[0] : void 0; + const bases = _nullishCoalesce(_optionalChain([current, 'access', _1767 => _1767.getBaseTypes, 'optionalCall', _1768 => _1768()]), () => ( [])); + current = bases.length > 0 ? _optionalChain([bases, 'access', _1769 => _1769[0], 'access', _1770 => _1770.isTypeReference, 'optionalCall', _1771 => _1771()]) ? bases[0].getTarget() : bases[0] : void 0; } return false; } @@ -16278,7 +16812,7 @@ var JavaTranspiler = class extends BaseTranspiler { return false; } const incrementor = forStatement.incrementor; - if (!incrementor || _optionalChain([incrementor, 'access', _1629 => _1629.operand, 'optionalAccess', _1630 => _1630.kind]) !== _ast.SyntaxKind.Identifier || incrementor.operand.text !== node.text) { + if (!incrementor || _optionalChain([incrementor, 'access', _1772 => _1772.operand, 'optionalAccess', _1773 => _1773.kind]) !== _ast.SyntaxKind.Identifier || incrementor.operand.text !== node.text) { return false; } return incrementor.kind === _ast.SyntaxKind.PostfixUnaryExpression || incrementor.kind === _ast.SyntaxKind.PrefixUnaryExpression; @@ -16320,7 +16854,7 @@ var JavaTranspiler = class extends BaseTranspiler { // a read of a `for (var i = ; ..; i++)` counter anywhere in the loop: javac types it // int and no box write reaches it; a capture rename (`finalI`) prints an Object copy instead javaPrintedIntCounter(node) { - return _optionalChain([node, 'optionalAccess', _1631 => _1631.kind]) === _ast.SyntaxKind.Identifier && this.javaIntForCounter(node) && this.javaIdentifierPrintsDeclaredName(node); + return _optionalChain([node, 'optionalAccess', _1774 => _1774.kind]) === _ast.SyntaxKind.Identifier && this.javaIntForCounter(node) && this.javaIdentifierPrintsDeclaredName(node); } // fractional / exponent literals print as Java double literals (printNumericLiteral) isJavaFloatLiteral(node) { @@ -16334,12 +16868,12 @@ var JavaTranspiler = class extends BaseTranspiler { // x.indexOf(a) / x.search(a) -> int; Math.round(x) -> long; Math.floor/ceil/pow -> double. javaPrintedCallKind(node) { const callee = node.expression; - if (_optionalChain([callee, 'optionalAccess', _1632 => _1632.kind]) !== _ast.SyntaxKind.PropertyAccessExpression) { + if (_optionalChain([callee, 'optionalAccess', _1775 => _1775.kind]) !== _ast.SyntaxKind.PropertyAccessExpression) { return void 0; } - const name = _optionalChain([callee, 'access', _1633 => _1633.name, 'optionalAccess', _1634 => _1634.text]); - const argCount = _nullishCoalesce(_optionalChain([node, 'access', _1635 => _1635.arguments, 'optionalAccess', _1636 => _1636.length]), () => ( 0)); - const onMath = _optionalChain([callee, 'access', _1637 => _1637.expression, 'optionalAccess', _1638 => _1638.kind]) === _ast.SyntaxKind.Identifier && callee.expression.text === "Math"; + const name = _optionalChain([callee, 'access', _1776 => _1776.name, 'optionalAccess', _1777 => _1777.text]); + const argCount = _nullishCoalesce(_optionalChain([node, 'access', _1778 => _1778.arguments, 'optionalAccess', _1779 => _1779.length]), () => ( 0)); + const onMath = _optionalChain([callee, 'access', _1780 => _1780.expression, 'optionalAccess', _1781 => _1781.kind]) === _ast.SyntaxKind.Identifier && callee.expression.text === "Math"; switch (name) { case "indexOf": case "search": @@ -16391,7 +16925,7 @@ var JavaTranspiler = class extends BaseTranspiler { if (type.getCallSignatures().length > 0) { return false; } - const declarations = (_nullishCoalesce(_optionalChain([type, 'access', _1639 => _1639.getSymbol, 'call', _1640 => _1640(), 'optionalAccess', _1641 => _1641.declarations]), () => ( []))).map((d) => d.resolve()); + const declarations = (_nullishCoalesce(_optionalChain([type, 'access', _1782 => _1782.getSymbol, 'call', _1783 => _1783(), 'optionalAccess', _1784 => _1784.declarations]), () => ( []))).map((d) => d.resolve()); return !declarations.some((declaration) => declaration.kind === _ast.SyntaxKind.ClassDeclaration || declaration.getSourceFile().fileName.indexOf("typescript") > -1); } // string keys (plain, literal or a union of literals) print as Java Strings @@ -16411,7 +16945,7 @@ var JavaTranspiler = class extends BaseTranspiler { // answers false for the nullish arm and the guarded emission keeps exactly that; every // non-map member (arrays, classes, scalars) keeps the helper isJavaNullableMapType(type) { - return this.isJavaNullishUnion(type, (member) => this.isJavaMapType(member)) && (_nullishCoalesce(_optionalChain([type, 'access', _1642 => _1642.getTypes, 'optionalCall', _1643 => _1643()]), () => ( []))).some((member) => (member.flags & (_sync.TypeFlags.Undefined | _sync.TypeFlags.Null)) === 0); + return this.isJavaNullishUnion(type, (member) => this.isJavaMapType(member)) && (_nullishCoalesce(_optionalChain([type, 'access', _1785 => _1785.getTypes, 'optionalCall', _1786 => _1786()]), () => ( []))).some((member) => (member.flags & (_sync.TypeFlags.Undefined | _sync.TypeFlags.Null)) === 0); } // the guarded emission reads the receiver twice, so it is only printed for an operand // that cannot run anything twice: a name or a `this.` field. Everything else (calls, @@ -16426,7 +16960,7 @@ var JavaTranspiler = class extends BaseTranspiler { if (_is.isParenthesizedExpression.call(void 0, node)) { return this.javaRepeatableOperand(node.expression); } - return _is.isPropertyAccessExpression.call(void 0, node) && _optionalChain([node, 'access', _1644 => _1644.expression, 'optionalAccess', _1645 => _1645.kind]) === _ast.SyntaxKind.ThisKeyword; + return _is.isPropertyAccessExpression.call(void 0, node) && _optionalChain([node, 'access', _1787 => _1787.expression, 'optionalAccess', _1788 => _1788.kind]) === _ast.SyntaxKind.ThisKeyword; } // The declared Java type of a local/parameter is known to the pass that rewrites the declaration // text (build/java-local-types.js), which records every name it typed here. With no consumer @@ -16436,7 +16970,7 @@ var JavaTranspiler = class extends BaseTranspiler { return void 0; } const declaration = this.javaDeclarationOfIdentifier(expression); - if (declaration === void 0 || expression.text !== _optionalChain([declaration, 'access', _1646 => _1646.name, 'optionalAccess', _1647 => _1647.text])) { + if (declaration === void 0 || expression.text !== _optionalChain([declaration, 'access', _1789 => _1789.name, 'optionalAccess', _1790 => _1790.text])) { return void 0; } return this.javaDeclaredTypeOfDeclaration(declaration); @@ -16483,12 +17017,12 @@ var JavaTranspiler = class extends BaseTranspiler { let override = this.getMethodOverride(method); if (override === void 0 && JAVA_NATIVE_PARAMETER_PREDICTION_FILES.test(node.getSourceFile().fileName) && method.name !== void 0) { const tier = this.exchangeTierMethods().get(method.name.getText().trim()); - if (tier !== void 0 && !this.javaParameterPrintsType(_optionalChain([tier, 'access', _1648 => _1648.parameters, 'optionalAccess', _1649 => _1649[index]]), type)) { + if (tier !== void 0 && !this.javaParameterPrintsType(_optionalChain([tier, 'access', _1791 => _1791.parameters, 'optionalAccess', _1792 => _1792[index]]), type)) { return void 0; } } while (override !== void 0) { - const baseParam = _optionalChain([override, 'access', _1650 => _1650.parameters, 'optionalAccess', _1651 => _1651[index]]); + const baseParam = _optionalChain([override, 'access', _1793 => _1793.parameters, 'optionalAccess', _1794 => _1794[index]]); if (!this.javaParameterPrintsType(baseParam, type)) { return void 0; } @@ -16509,9 +17043,9 @@ var JavaTranspiler = class extends BaseTranspiler { const fileName = program.getSourceFileNames().find((f) => JAVA_NATIVE_PARAMETER_BASE_FILES.test(f)); const file = fileName !== void 0 ? program.getSourceFile(fileName) : void 0; const collect = (node) => { - if (_is.isClassDeclaration.call(void 0, node) && _optionalChain([node, 'access', _1652 => _1652.name, 'optionalAccess', _1653 => _1653.text]) === "Exchange") { + if (_is.isClassDeclaration.call(void 0, node) && _optionalChain([node, 'access', _1795 => _1795.name, 'optionalAccess', _1796 => _1796.text]) === "Exchange") { for (const member of node.members) { - const key = _optionalChain([member, 'access', _1654 => _1654.name, 'optionalAccess', _1655 => _1655.getText, 'call', _1656 => _1656(), 'access', _1657 => _1657.trim, 'call', _1658 => _1658()]); + const key = _optionalChain([member, 'access', _1797 => _1797.name, 'optionalAccess', _1798 => _1798.getText, 'call', _1799 => _1799(), 'access', _1800 => _1800.trim, 'call', _1801 => _1801()]); if (_is.isMethodDeclaration.call(void 0, member) && key !== void 0 && !names.has(key)) { names.set(key, member); } @@ -16543,13 +17077,13 @@ var JavaTranspiler = class extends BaseTranspiler { // unannotated root declaration prints `Object`, so nothing is inherited and the whole javaInheritedParameterType(node) { const method = node.parent; - const index = _optionalChain([method, 'optionalAccess', _1659 => _1659.parameters, 'optionalAccess', _1660 => _1660.indexOf, 'call', _1661 => _1661(node)]); + const index = _optionalChain([method, 'optionalAccess', _1802 => _1802.parameters, 'optionalAccess', _1803 => _1803.indexOf, 'call', _1804 => _1804(node)]); if (method === void 0 || index === void 0 || index < 0) { return void 0; } let override = this.getMethodOverride(method); while (override !== void 0) { - const baseParam = _optionalChain([override, 'access', _1662 => _1662.parameters, 'optionalAccess', _1663 => _1663[index]]); + const baseParam = _optionalChain([override, 'access', _1805 => _1805.parameters, 'optionalAccess', _1806 => _1806[index]]); const type = baseParam === void 0 ? void 0 : this.javaNativeParameterTypeOf(baseParam); if (type !== void 0) { return type; @@ -16616,25 +17150,25 @@ var JavaTranspiler = class extends BaseTranspiler { return void 0; } const symbol = this.javaParameterAliasSymbol(node, type, checker); - const name = _optionalChain([symbol, 'optionalAccess', _1664 => _1664.name]); - const excluded = JAVA_NATIVE_PARAMETER_EXCLUDED_POSITIONS[_optionalChain([method, 'access', _1665 => _1665.name, 'optionalAccess', _1666 => _1666.text])]; + const name = _optionalChain([symbol, 'optionalAccess', _1807 => _1807.name]); + const excluded = JAVA_NATIVE_PARAMETER_EXCLUDED_POSITIONS[_optionalChain([method, 'access', _1808 => _1808.name, 'optionalAccess', _1809 => _1809.text])]; if (excluded !== void 0 && excluded.includes(method.parameters.indexOf(node))) { return void 0; } if (name === "Strings" || this.javaIsStringArrayType(checker, type)) { - const listName = JAVA_STRINGS_OPTIONAL_PARAMETER_NAMES.has(_optionalChain([node, 'access', _1667 => _1667.name, 'optionalAccess', _1668 => _1668.text])) && !JAVA_STRINGS_EXCLUDED_METHODS.has(_optionalChain([method, 'access', _1669 => _1669.name, 'optionalAccess', _1670 => _1670.text])); + const listName = JAVA_STRINGS_OPTIONAL_PARAMETER_NAMES.has(_optionalChain([node, 'access', _1810 => _1810.name, 'optionalAccess', _1811 => _1811.text])) && !JAVA_STRINGS_EXCLUDED_METHODS.has(_optionalChain([method, 'access', _1812 => _1812.name, 'optionalAccess', _1813 => _1813.text])); return listName ? JAVA_STRING_LIST_TYPE : void 0; } if (name === void 0 || JAVA_NATIVE_PARAMETER_TYPES_OPTIONAL[name] === void 0) { return void 0; } - const declaration = _optionalChain([symbol, 'optionalAccess', _1671 => _1671.declarations, 'optionalAccess', _1672 => _1672[0], 'optionalAccess', _1673 => _1673.resolve, 'call', _1674 => _1674()]); - const fileName = _optionalChain([declaration, 'optionalAccess', _1675 => _1675.getSourceFile, 'optionalCall', _1676 => _1676(), 'optionalAccess', _1677 => _1677.fileName]); + const declaration = _optionalChain([symbol, 'optionalAccess', _1814 => _1814.declarations, 'optionalAccess', _1815 => _1815[0], 'optionalAccess', _1816 => _1816.resolve, 'call', _1817 => _1817()]); + const fileName = _optionalChain([declaration, 'optionalAccess', _1818 => _1818.getSourceFile, 'optionalCall', _1819 => _1819(), 'optionalAccess', _1820 => _1820.fileName]); return JAVA_NATIVE_PARAMETER_SOURCE_FILES.test(_nullishCoalesce(fileName, () => ( ""))) ? JAVA_NATIVE_PARAMETER_TYPES_OPTIONAL[name] : void 0; } // a `string[]` annotation (optionally `| undefined`), the unaliased spelling of `Strings` javaIsStringArrayType(checker, type) { - const members = _optionalChain([type, 'access', _1678 => _1678.isUnionType, 'optionalCall', _1679 => _1679()]) ? type.getTypes() : [type]; + const members = _optionalChain([type, 'access', _1821 => _1821.isUnionType, 'optionalCall', _1822 => _1822()]) ? type.getTypes() : [type]; let arrays = 0; for (const member of members) { if (member.flags & (_sync.TypeFlags.Undefined | _sync.TypeFlags.Null)) { @@ -16643,7 +17177,7 @@ var JavaTranspiler = class extends BaseTranspiler { if (!checker.isArrayType(member)) { return false; } - const element = _optionalChain([checker, 'access', _1680 => _1680.getTypeArguments, 'call', _1681 => _1681(member), 'optionalAccess', _1682 => _1682[0]]); + const element = _optionalChain([checker, 'access', _1823 => _1823.getTypeArguments, 'call', _1824 => _1824(member), 'optionalAccess', _1825 => _1825[0]]); if (element === void 0 || !(element.flags & _sync.TypeFlags.String)) { return false; } @@ -16654,7 +17188,7 @@ var JavaTranspiler = class extends BaseTranspiler { // Java overrides are invariant: every ancestor declaration must match the parameter count, // the first default-valued index and this position's type, otherwise the position stays Object. javaOptionalParameterFamilyAgrees(method, override, index, type) { - const baseParams = _optionalChain([override, 'optionalAccess', _1683 => _1683.parameters]); + const baseParams = _optionalChain([override, 'optionalAccess', _1826 => _1826.parameters]); if (baseParams === void 0 || baseParams.length !== method.parameters.length) { return false; } @@ -16690,7 +17224,7 @@ var JavaTranspiler = class extends BaseTranspiler { } // a typed default-valued method parameter is written in place, so its writes convert to the declared type javaSplitParameterWriteType(node) { - if (_optionalChain([node, 'optionalAccess', _1684 => _1684.initializer]) === void 0 || !this.hasDefaultedTail(node.parent)) { + if (_optionalChain([node, 'optionalAccess', _1827 => _1827.initializer]) === void 0 || !this.hasDefaultedTail(node.parent)) { return void 0; } return this.javaOptionalParameterType(node); @@ -16698,7 +17232,7 @@ var JavaTranspiler = class extends BaseTranspiler { // the async body copy of a reassigned default-valued parameter keeps a `List` type; // its writes convert like the sync in-place ones (other types keep the `Object` copy) javaAsyncParameterLocalType(node) { - if (_optionalChain([node, 'optionalAccess', _1685 => _1685.initializer]) === void 0 || !this.hasDefaultedTail(node.parent) || !this.isAsyncFunction(node.parent)) { + if (_optionalChain([node, 'optionalAccess', _1828 => _1828.initializer]) === void 0 || !this.hasDefaultedTail(node.parent) || !this.isAsyncFunction(node.parent)) { return void 0; } const type = this.javaOptionalParameterType(node); @@ -16710,9 +17244,9 @@ var JavaTranspiler = class extends BaseTranspiler { // any write to the parameter in its method: assignment (plain or compound), a destructuring // target, `++`/`--`, a for-of/in binding javaParameterIsWritten(node) { - const method = _optionalChain([node, 'optionalAccess', _1686 => _1686.parent]); + const method = _optionalChain([node, 'optionalAccess', _1829 => _1829.parent]); const checker = this.checkerOrUndefined(); - if (_optionalChain([method, 'optionalAccess', _1687 => _1687.body]) === void 0 || checker === void 0) { + if (_optionalChain([method, 'optionalAccess', _1830 => _1830.body]) === void 0 || checker === void 0) { return true; } const symbol = checker.getSymbolAtLocation(node.name); @@ -16750,7 +17284,7 @@ var JavaTranspiler = class extends BaseTranspiler { // after `if (x === undefined) { return/throw/.. }`. Callers require an unwritten binding. javaNullGuardAdmitsRead(node) { const checker = this.checkerOrUndefined(); - const symbol = _optionalChain([checker, 'optionalAccess', _1688 => _1688.getSymbolAtLocation, 'call', _1689 => _1689(node)]); + const symbol = _optionalChain([checker, 'optionalAccess', _1831 => _1831.getSymbolAtLocation, 'call', _1832 => _1832(node)]); if (symbol === void 0) { return false; } @@ -16815,7 +17349,7 @@ var JavaTranspiler = class extends BaseTranspiler { const nullish = (n) => n.kind === _ast.SyntaxKind.NullKeyword || _is.isIdentifier.call(void 0, n) && n.text === "undefined"; const tested = nullish(test.right) ? test.left : nullish(test.left) ? test.right : void 0; const checker = this.checkerOrUndefined(); - return tested !== void 0 && _is.isIdentifier.call(void 0, tested) && _optionalChain([checker, 'optionalAccess', _1690 => _1690.getSymbolAtLocation, 'call', _1691 => _1691(tested)]) === symbol; + return tested !== void 0 && _is.isIdentifier.call(void 0, tested) && _optionalChain([checker, 'optionalAccess', _1833 => _1833.getSymbolAtLocation, 'call', _1834 => _1834(tested)]) === symbol; } javaStatementAlwaysExits(statement) { if (statement === void 0) { @@ -16841,14 +17375,14 @@ var JavaTranspiler = class extends BaseTranspiler { } javaParameterIsTypeofTested(node) { const method = node.parent; - const name = _optionalChain([node, 'access', _1692 => _1692.name, 'optionalAccess', _1693 => _1693.text]); + const name = _optionalChain([node, 'access', _1835 => _1835.name, 'optionalAccess', _1836 => _1836.text]); const visit = (n) => _is.isTypeOfExpression.call(void 0, n) && _is.isIdentifier.call(void 0, n.expression) && n.expression.text === name || n.forEachChild(visit) === true; - return _optionalChain([method, 'optionalAccess', _1694 => _1694.body]) !== void 0 && name !== void 0 && method.body.forEachChild(visit) === true; + return _optionalChain([method, 'optionalAccess', _1837 => _1837.body]) !== void 0 && name !== void 0 && method.body.forEachChild(visit) === true; } javaParameterIsCompoundAssigned(node) { const method = node.parent; - const name = _optionalChain([node, 'access', _1695 => _1695.name, 'optionalAccess', _1696 => _1696.text]); - if (_optionalChain([method, 'optionalAccess', _1697 => _1697.body]) === void 0 || name === void 0) { + const name = _optionalChain([node, 'access', _1838 => _1838.name, 'optionalAccess', _1839 => _1839.text]); + if (_optionalChain([method, 'optionalAccess', _1840 => _1840.body]) === void 0 || name === void 0) { return false; } let assigned = this.javaMethodAssignedNames.get(method); @@ -16876,7 +17410,7 @@ var JavaTranspiler = class extends BaseTranspiler { return void 0; } const declaration = this.javaDeclarationOfIdentifier(left); - if (declaration === void 0 || !_is.isParameterDeclaration.call(void 0, declaration) || left.text !== _optionalChain([declaration, 'access', _1698 => _1698.name, 'optionalAccess', _1699 => _1699.text])) { + if (declaration === void 0 || !_is.isParameterDeclaration.call(void 0, declaration) || left.text !== _optionalChain([declaration, 'access', _1841 => _1841.name, 'optionalAccess', _1842 => _1842.text])) { return void 0; } const native = _nullishCoalesce(this.javaNativeParameterType(declaration), () => ( this.javaSplitParameterWriteType(declaration))); @@ -16948,14 +17482,14 @@ var JavaTranspiler = class extends BaseTranspiler { if (method === void 0 || depth > 3 || method.body === void 0) { return false; } - const name = String(_optionalChain([method, 'access', _1700 => _1700.name, 'optionalAccess', _1701 => _1701.text])); + const name = String(_optionalChain([method, 'access', _1843 => _1843.name, 'optionalAccess', _1844 => _1844.text])); if (this.javaNativeReturnType(method) !== "Boolean" && !JAVA_THIS_BOOLEAN_METHODS.has(name)) { return false; } let returns = 0; let ok = true; const scan = (n) => { - if (!ok || n !== method && _chunk4FDYB2TTcjs.isFunctionLike.call(void 0, n)) { + if (!ok || n !== method && _chunkUBXMRIM6cjs.isFunctionLike.call(void 0, n)) { return; } if (_is.isReturnStatement.call(void 0, n)) { @@ -16969,7 +17503,7 @@ var JavaTranspiler = class extends BaseTranspiler { return ok && returns > 0; } javaPrintsNonNullBoolean(node, depth) { - switch (_optionalChain([node, 'optionalAccess', _1702 => _1702.kind])) { + switch (_optionalChain([node, 'optionalAccess', _1845 => _1845.kind])) { case _ast.SyntaxKind.TrueKeyword: case _ast.SyntaxKind.FalseKeyword: return true; @@ -16997,7 +17531,7 @@ var JavaTranspiler = class extends BaseTranspiler { } let declaration; try { - declaration = _optionalChain([this, 'access', _1703 => _1703.getChecker, 'call', _1704 => _1704(), 'access', _1705 => _1705.getResolvedSignature, 'call', _1706 => _1706(node), 'optionalAccess', _1707 => _1707.declaration, 'optionalAccess', _1708 => _1708.resolve, 'call', _1709 => _1709()]); + declaration = _optionalChain([this, 'access', _1846 => _1846.getChecker, 'call', _1847 => _1847(), 'access', _1848 => _1848.getResolvedSignature, 'call', _1849 => _1849(node), 'optionalAccess', _1850 => _1850.declaration, 'optionalAccess', _1851 => _1851.resolve, 'call', _1852 => _1852()]); } catch (e) { return false; } @@ -17019,10 +17553,10 @@ var JavaTranspiler = class extends BaseTranspiler { if (type === void 0) { return void 0; } - const aliasSymbol = _optionalChain([type, 'access', _1710 => _1710.getAliasSymbol, 'optionalCall', _1711 => _1711()]); + const aliasSymbol = _optionalChain([type, 'access', _1853 => _1853.getAliasSymbol, 'optionalCall', _1854 => _1854()]); if (aliasSymbol !== void 0) { const name = aliasSymbol.name; - const fileName = _optionalChain([aliasSymbol, 'access', _1712 => _1712.declarations, 'optionalAccess', _1713 => _1713[0], 'optionalAccess', _1714 => _1714.resolve, 'call', _1715 => _1715(), 'optionalAccess', _1716 => _1716.getSourceFile, 'optionalCall', _1717 => _1717(), 'optionalAccess', _1718 => _1718.fileName]); + const fileName = _optionalChain([aliasSymbol, 'access', _1855 => _1855.declarations, 'optionalAccess', _1856 => _1856[0], 'optionalAccess', _1857 => _1857.resolve, 'call', _1858 => _1858(), 'optionalAccess', _1859 => _1859.getSourceFile, 'optionalCall', _1860 => _1860(), 'optionalAccess', _1861 => _1861.fileName]); if (fileName !== void 0 && JAVA_NATIVE_PARAMETER_SOURCE_FILES.test(fileName) && (name === "Str" || name === "Bool")) { return name === "Str" ? "String" : "Boolean"; } @@ -17043,7 +17577,7 @@ var JavaTranspiler = class extends BaseTranspiler { if (n === void 0) { return; } - if (n !== method && _chunk4FDYB2TTcjs.isFunctionLike.call(void 0, n)) { + if (n !== method && _chunkUBXMRIM6cjs.isFunctionLike.call(void 0, n)) { return; } if (_is.isReturnStatement.call(void 0, n)) { @@ -17117,7 +17651,7 @@ var JavaTranspiler = class extends BaseTranspiler { } let declaration; try { - declaration = _optionalChain([this, 'access', _1719 => _1719.getChecker, 'call', _1720 => _1720(), 'access', _1721 => _1721.getResolvedSignature, 'call', _1722 => _1722(node), 'optionalAccess', _1723 => _1723.declaration, 'optionalAccess', _1724 => _1724.resolve, 'call', _1725 => _1725()]); + declaration = _optionalChain([this, 'access', _1862 => _1862.getChecker, 'call', _1863 => _1863(), 'access', _1864 => _1864.getResolvedSignature, 'call', _1865 => _1865(node), 'optionalAccess', _1866 => _1866.declaration, 'optionalAccess', _1867 => _1867.resolve, 'call', _1868 => _1868()]); } catch (e) { return void 0; } @@ -17142,20 +17676,20 @@ var JavaTranspiler = class extends BaseTranspiler { } let declaration; try { - declaration = _optionalChain([this, 'access', _1726 => _1726.getChecker, 'call', _1727 => _1727(), 'access', _1728 => _1728.getResolvedSignature, 'call', _1729 => _1729(node), 'optionalAccess', _1730 => _1730.declaration, 'optionalAccess', _1731 => _1731.resolve, 'call', _1732 => _1732()]); + declaration = _optionalChain([this, 'access', _1869 => _1869.getChecker, 'call', _1870 => _1870(), 'access', _1871 => _1871.getResolvedSignature, 'call', _1872 => _1872(node), 'optionalAccess', _1873 => _1873.declaration, 'optionalAccess', _1874 => _1874.resolve, 'call', _1875 => _1875()]); } catch (e) { return false; } if (declaration === void 0) { return false; } - const fileName = _optionalChain([declaration, 'access', _1733 => _1733.getSourceFile, 'optionalCall', _1734 => _1734(), 'optionalAccess', _1735 => _1735.fileName]); + const fileName = _optionalChain([declaration, 'access', _1876 => _1876.getSourceFile, 'optionalCall', _1877 => _1877(), 'optionalAccess', _1878 => _1878.fileName]); return fileName !== void 0 && JAVA_STRING_RETURN_BASE_FILES.test(fileName); } // the alias a parameter's annotation names; `OrderType` ('limit' | 'market' | string) reduces // to plain `string` and keeps no aliasSymbol, so read the annotation's type reference instead javaParameterAliasSymbol(node, type, checker) { - const symbol = _nullishCoalesce(_optionalChain([type, 'access', _1736 => _1736.getAliasSymbol, 'optionalCall', _1737 => _1737()]), () => ( _optionalChain([type, 'access', _1738 => _1738.getSymbol, 'optionalCall', _1739 => _1739()]))); + const symbol = _nullishCoalesce(_optionalChain([type, 'access', _1879 => _1879.getAliasSymbol, 'optionalCall', _1880 => _1880()]), () => ( _optionalChain([type, 'access', _1881 => _1881.getSymbol, 'optionalCall', _1882 => _1882()]))); if (symbol !== void 0 || node.type === void 0 || !_is.isTypeReferenceNode.call(void 0, node.type)) { return symbol; } @@ -17184,16 +17718,16 @@ var JavaTranspiler = class extends BaseTranspiler { return void 0; } const symbol = this.javaParameterAliasSymbol(node, type, checker); - const name = _optionalChain([symbol, 'optionalAccess', _1740 => _1740.name]); + const name = _optionalChain([symbol, 'optionalAccess', _1883 => _1883.name]); if (name === void 0 || JAVA_NATIVE_PARAMETER_TYPES[name] === void 0) { return void 0; } - const excluded = JAVA_NATIVE_PARAMETER_EXCLUDED_POSITIONS[_optionalChain([method, 'access', _1741 => _1741.name, 'optionalAccess', _1742 => _1742.text])]; + const excluded = JAVA_NATIVE_PARAMETER_EXCLUDED_POSITIONS[_optionalChain([method, 'access', _1884 => _1884.name, 'optionalAccess', _1885 => _1885.text])]; if (excluded !== void 0 && excluded.includes(method.parameters.indexOf(node))) { return void 0; } - const declaration = _optionalChain([symbol, 'optionalAccess', _1743 => _1743.declarations, 'optionalAccess', _1744 => _1744[0], 'optionalAccess', _1745 => _1745.resolve, 'call', _1746 => _1746()]); - const fileName = _optionalChain([declaration, 'optionalAccess', _1747 => _1747.getSourceFile, 'optionalCall', _1748 => _1748(), 'optionalAccess', _1749 => _1749.fileName]); + const declaration = _optionalChain([symbol, 'optionalAccess', _1886 => _1886.declarations, 'optionalAccess', _1887 => _1887[0], 'optionalAccess', _1888 => _1888.resolve, 'call', _1889 => _1889()]); + const fileName = _optionalChain([declaration, 'optionalAccess', _1890 => _1890.getSourceFile, 'optionalCall', _1891 => _1891(), 'optionalAccess', _1892 => _1892.fileName]); return JAVA_NATIVE_PARAMETER_SOURCE_FILES.test(_nullishCoalesce(fileName, () => ( ""))) ? JAVA_NATIVE_PARAMETER_TYPES[name] : void 0; } // `k` where the consumer declares k as a Java String: the helper's String branch (the @@ -17295,6 +17829,9 @@ var JavaTranspiler = class extends BaseTranspiler { if (keys.length === 1 && this.javaDeclaredMapReceiver(baseExpr) && (_is.isStringLiteralLikeNode.call(void 0, keys[0]) || this.javaDeclaredStringType(keys[0])) && this.javaPrintsNonNullValue(right)) { return `${prefixes}${acc}.put(${lastKey}, ${rhs})`; } + if (this.javaHx4MapPutIsNative(baseExpr, keys)) { + return `${prefixes}${acc}.put(${keyArg}, ${rhs})`; + } return `${prefixes}Helpers.addElementToObject(${acc}, ${lastKey}, ${rhs})`; } if (op === _ast.SyntaxKind.InKeyword) { @@ -17322,6 +17859,10 @@ var JavaTranspiler = class extends BaseTranspiler { } return `Helpers.inOp(${objText}, ${keyText})`; } + const hx4J05 = this.printHx4J05ModComparison(left, right, op); + if (hx4J05 !== void 0) { + return hx4J05; + } if (op === _ast.SyntaxKind.LessThanToken || op === _ast.SyntaxKind.GreaterThanToken || op === _ast.SyntaxKind.LessThanEqualsToken || op === _ast.SyntaxKind.GreaterThanEqualsToken) { const leftKind = this.javaPrimitiveOperandKind(left); const rightKind = this.javaPrimitiveOperandKind(right); @@ -17375,9 +17916,9 @@ var JavaTranspiler = class extends BaseTranspiler { if (type.getStringIndexType() !== void 0) { return true; } - const symbol = _nullishCoalesce(_optionalChain([type, 'access', _1750 => _1750.getAliasSymbol, 'optionalCall', _1751 => _1751()]), () => ( _optionalChain([type, 'access', _1752 => _1752.getSymbol, 'optionalCall', _1753 => _1753()]))); - const declaration = _optionalChain([symbol, 'optionalAccess', _1754 => _1754.declarations, 'optionalAccess', _1755 => _1755[0], 'optionalAccess', _1756 => _1756.resolve, 'call', _1757 => _1757()]); - const fileName = _optionalChain([declaration, 'optionalAccess', _1758 => _1758.getSourceFile, 'optionalCall', _1759 => _1759(), 'optionalAccess', _1760 => _1760.fileName]); + const symbol = _nullishCoalesce(_optionalChain([type, 'access', _1893 => _1893.getAliasSymbol, 'optionalCall', _1894 => _1894()]), () => ( _optionalChain([type, 'access', _1895 => _1895.getSymbol, 'optionalCall', _1896 => _1896()]))); + const declaration = _optionalChain([symbol, 'optionalAccess', _1897 => _1897.declarations, 'optionalAccess', _1898 => _1898[0], 'optionalAccess', _1899 => _1899.resolve, 'call', _1900 => _1900()]); + const fileName = _optionalChain([declaration, 'optionalAccess', _1901 => _1901.getSourceFile, 'optionalCall', _1902 => _1902(), 'optionalAccess', _1903 => _1903.fileName]); return fileName !== void 0 && /(^|\/)ts\/src\/base\/types\.ts$/.test(fileName); } // tuples are List in the Java port (types.TypedList). Only an index inside the @@ -17387,7 +17928,7 @@ var JavaTranspiler = class extends BaseTranspiler { return this.javaConcreteStructureType(type) && this.getChecker().isTupleType(type); } tupleRequiredElementCount(type) { - const flags = _nullishCoalesce(_nullishCoalesce((_optionalChain([type, 'optionalAccess', _1761 => _1761.isTypeReference, 'optionalCall', _1762 => _1762()]) ? type.getTarget().elementFlags : void 0), () => ( _optionalChain([type, 'optionalAccess', _1763 => _1763.elementFlags]))), () => ( [])); + const flags = _nullishCoalesce(_nullishCoalesce((_optionalChain([type, 'optionalAccess', _1904 => _1904.isTypeReference, 'optionalCall', _1905 => _1905()]) ? type.getTarget().elementFlags : void 0), () => ( _optionalChain([type, 'optionalAccess', _1906 => _1906.elementFlags]))), () => ( [])); let required = 0; for (const flag of flags) { if (flag !== _sync.ElementFlags.Optional && flag !== _sync.ElementFlags.Rest) { @@ -17435,13 +17976,13 @@ var JavaTranspiler = class extends BaseTranspiler { if (!_is.isIdentifier.call(void 0, node)) { return false; } - const declaration = _optionalChain([this, 'access', _1764 => _1764.getChecker, 'call', _1765 => _1765(), 'access', _1766 => _1766.getSymbolAtLocation, 'call', _1767 => _1767(node), 'optionalAccess', _1768 => _1768.valueDeclaration, 'optionalAccess', _1769 => _1769.resolve, 'call', _1770 => _1770()]); + const declaration = _optionalChain([this, 'access', _1907 => _1907.getChecker, 'call', _1908 => _1908(), 'access', _1909 => _1909.getSymbolAtLocation, 'call', _1910 => _1910(node), 'optionalAccess', _1911 => _1911.valueDeclaration, 'optionalAccess', _1912 => _1912.resolve, 'call', _1913 => _1913()]); const initializer = declaration !== void 0 && _is.isVariableDeclaration.call(void 0, declaration) ? declaration.initializer : void 0; if (initializer === void 0) { return false; } if (_is.isCallExpression.call(void 0, initializer) && _is.isPropertyAccessExpression.call(void 0, initializer.expression)) { - return _optionalChain([initializer, 'access', _1771 => _1771.expression, 'access', _1772 => _1772.name, 'optionalAccess', _1773 => _1773.text]) === "split"; + return _optionalChain([initializer, 'access', _1914 => _1914.expression, 'access', _1915 => _1915.name, 'optionalAccess', _1916 => _1916.text]) === "split"; } if (_is.isArrayLiteralExpression.call(void 0, initializer)) { return initializer.elements.length > 0 && initializer.elements.every((element) => element.kind === _ast.SyntaxKind.StringLiteral || element.kind === _ast.SyntaxKind.NoSubstitutionTemplateLiteral); @@ -17450,7 +17991,7 @@ var JavaTranspiler = class extends BaseTranspiler { } isLeftSideOfAssignment(node) { const parent = node.parent; - if (_optionalChain([parent, 'optionalAccess', _1774 => _1774.kind]) !== _ast.SyntaxKind.BinaryExpression || parent.left !== node) { + if (_optionalChain([parent, 'optionalAccess', _1917 => _1917.kind]) !== _ast.SyntaxKind.BinaryExpression || parent.left !== node) { return false; } return JAVA_ASSIGNMENT_OPERATOR_KINDS.has(parent.operatorToken.kind); @@ -17465,8 +18006,8 @@ var JavaTranspiler = class extends BaseTranspiler { return void 0; } const symbol = checker.getSymbolAtLocation(expression); - const declaration = _nullishCoalesce(_optionalChain([symbol, 'optionalAccess', _1775 => _1775.valueDeclaration, 'optionalAccess', _1776 => _1776.resolve, 'call', _1777 => _1777()]), () => ( _optionalChain([symbol, 'optionalAccess', _1778 => _1778.declarations, 'optionalAccess', _1779 => _1779[0], 'optionalAccess', _1780 => _1780.resolve, 'call', _1781 => _1781()]))); - const kind = _optionalChain([declaration, 'optionalAccess', _1782 => _1782.kind]); + const declaration = _nullishCoalesce(_optionalChain([symbol, 'optionalAccess', _1918 => _1918.valueDeclaration, 'optionalAccess', _1919 => _1919.resolve, 'call', _1920 => _1920()]), () => ( _optionalChain([symbol, 'optionalAccess', _1921 => _1921.declarations, 'optionalAccess', _1922 => _1922[0], 'optionalAccess', _1923 => _1923.resolve, 'call', _1924 => _1924()]))); + const kind = _optionalChain([declaration, 'optionalAccess', _1925 => _1925.kind]); return kind === _ast.SyntaxKind.VariableDeclaration || kind === _ast.SyntaxKind.Parameter ? declaration : void 0; } // `x["lit"]` where the consumer declares x as a Java map: the native read returns the @@ -17477,7 +18018,7 @@ var JavaTranspiler = class extends BaseTranspiler { if (declaration === void 0) { return false; } - if (expression.text !== _optionalChain([declaration, 'access', _1783 => _1783.name, 'optionalAccess', _1784 => _1784.text])) { + if (expression.text !== _optionalChain([declaration, 'access', _1926 => _1926.name, 'optionalAccess', _1927 => _1927.text])) { return false; } const type = this.javaDeclaredTypeOfDeclaration(declaration); @@ -17487,10 +18028,10 @@ var JavaTranspiler = class extends BaseTranspiler { // GetValue answers null for a null receiver or index outside [0, size) while List.get throws, so // the emission carries the same tests. `||` short-circuits over identifiers, so nothing runs twice. javaDeclaredListElementRead(node, isCounter) { - if (_optionalChain([node, 'access', _1785 => _1785.parent, 'optionalAccess', _1786 => _1786.kind]) === _ast.SyntaxKind.ExpressionStatement) { + if (_optionalChain([node, 'access', _1928 => _1928.parent, 'optionalAccess', _1929 => _1929.kind]) === _ast.SyntaxKind.ExpressionStatement) { return void 0; } - if (_optionalChain([node, 'access', _1787 => _1787.parent, 'optionalAccess', _1788 => _1788.kind]) === _ast.SyntaxKind.VariableDeclaration && node.parent.initializer === node && _optionalChain([node, 'access', _1789 => _1789.parent, 'access', _1790 => _1790.name, 'optionalAccess', _1791 => _1791.text]) === "client") { + if (_optionalChain([node, 'access', _1930 => _1930.parent, 'optionalAccess', _1931 => _1931.kind]) === _ast.SyntaxKind.VariableDeclaration && node.parent.initializer === node && _optionalChain([node, 'access', _1932 => _1932.parent, 'access', _1933 => _1933.name, 'optionalAccess', _1934 => _1934.text]) === "client") { return void 0; } const declared = this.javaDeclaredTypeOf(node.expression); @@ -17522,7 +18063,7 @@ var JavaTranspiler = class extends BaseTranspiler { // helper's Map branch is the map accessor behind its own tests — a null receiver, a // null key and a key that is not a String all answer null, and a String-keyed map's javaDeclaredMapElementRead(node) { - if (_optionalChain([node, 'access', _1792 => _1792.parent, 'optionalAccess', _1793 => _1793.kind]) === _ast.SyntaxKind.ExpressionStatement) { + if (_optionalChain([node, 'access', _1935 => _1935.parent, 'optionalAccess', _1936 => _1936.kind]) === _ast.SyntaxKind.ExpressionStatement) { return void 0; } if (this.printElementAccessExpressionExceptionIfAny(node) !== void 0 || this.isLeftSideOfAssignment(node)) { @@ -17553,7 +18094,7 @@ var JavaTranspiler = class extends BaseTranspiler { } const target = this.printNode(node.expression, 0); const keyText = this.printNode(key, 0); - if (_optionalChain([keyType, 'access', _1794 => _1794.getAliasSymbol, 'optionalCall', _1795 => _1795()]) === void 0 && keyType.flags === _sync.TypeFlags.String) { + if (_optionalChain([keyType, 'access', _1937 => _1937.getAliasSymbol, 'optionalCall', _1938 => _1938()]) === void 0 && keyType.flags === _sync.TypeFlags.String) { return `(${target} == null || ${keyText} == null ? null : ${target}.get(${keyText}))`; } return `(${target} == null || !(${keyText} instanceof String) ? null : ${target}.get(${keyText}))`; @@ -17565,19 +18106,19 @@ var JavaTranspiler = class extends BaseTranspiler { return false; } const declaration = this.javaDeclarationOfIdentifier(node); - return declaration !== void 0 && node.text === _optionalChain([declaration, 'access', _1796 => _1796.name, 'optionalAccess', _1797 => _1797.text]); + return declaration !== void 0 && node.text === _optionalChain([declaration, 'access', _1939 => _1939.name, 'optionalAccess', _1940 => _1940.text]); } // `this.[k]` on a hand-written base map field (JAVA_FIELD_TYPES): the helper's Map branch is // the native `get`. The helper answers null for a null receiver or key, so both stay guarded; the // receiver and key are side-effect free. An unguarded read has no parens so a checkcast binds it. javaFieldMapReadText(receiver, key) { - if (receiver === void 0 || receiver.kind !== _ast.SyntaxKind.PropertyAccessExpression || _optionalChain([receiver, 'access', _1798 => _1798.expression, 'optionalAccess', _1799 => _1799.kind]) !== _ast.SyntaxKind.ThisKeyword) { + if (receiver === void 0 || receiver.kind !== _ast.SyntaxKind.PropertyAccessExpression || _optionalChain([receiver, 'access', _1941 => _1941.expression, 'optionalAccess', _1942 => _1942.kind]) !== _ast.SyntaxKind.ThisKeyword) { return void 0; } - const name = _optionalChain([receiver, 'access', _1800 => _1800.name, 'optionalAccess', _1801 => _1801.text]); + const name = _optionalChain([receiver, 'access', _1943 => _1943.name, 'optionalAccess', _1944 => _1944.text]); const field = typeof name === "string" ? JAVA_FIELD_TYPES[name] : void 0; if (field === void 0 || field.map !== true) { - return void 0; + return this.javaJ02FieldMapReadText(receiver, key); } const keyText = this.printNode(key, 0); let keyGuarded = false; @@ -17686,7 +18227,7 @@ var JavaTranspiler = class extends BaseTranspiler { return void 0; } const type = checker.getTypeAtLocation(node); - if (type === void 0 || _optionalChain([type, 'access', _1802 => _1802.getAliasSymbol, 'optionalCall', _1803 => _1803()]) !== void 0) { + if (type === void 0 || _optionalChain([type, 'access', _1945 => _1945.getAliasSymbol, 'optionalCall', _1946 => _1946()]) !== void 0) { return void 0; } const flags = type.flags; @@ -17736,7 +18277,7 @@ var JavaTranspiler = class extends BaseTranspiler { // provable String)? Mirrors printInlineHelperArithmetic so callers can reason about // the printed text of a nested concat. javaNativeConcat(node) { - if (_optionalChain([node, 'optionalAccess', _1804 => _1804.operatorToken, 'optionalAccess', _1805 => _1805.kind]) !== _ast.SyntaxKind.PlusToken) { + if (_optionalChain([node, 'optionalAccess', _1947 => _1947.operatorToken, 'optionalAccess', _1948 => _1948.kind]) !== _ast.SyntaxKind.PlusToken) { return false; } if (this.javaScalarFamily(node.left) !== "string" || this.javaScalarFamily(node.right) !== "string") { @@ -17816,7 +18357,7 @@ var JavaTranspiler = class extends BaseTranspiler { if (t === void 0 || t.flags === 0) { return false; } - if (_optionalChain([t, 'access', _1806 => _1806.isUnionType, 'optionalCall', _1807 => _1807()])) { + if (_optionalChain([t, 'access', _1949 => _1949.isUnionType, 'optionalCall', _1950 => _1950()])) { return t.getTypes().every(notNumeric); } return (t.flags & ~notNumber) === 0; @@ -17827,14 +18368,14 @@ var JavaTranspiler = class extends BaseTranspiler { // undefined. The signature must resolve to the base tier or the Date.now lib signature of the // functions/time.ts mixin; a venue override prints its own (usually Object) signature. javaThisCallNumericKind(node) { - if (_optionalChain([node, 'optionalAccess', _1808 => _1808.kind]) !== _ast.SyntaxKind.CallExpression) { + if (_optionalChain([node, 'optionalAccess', _1951 => _1951.kind]) !== _ast.SyntaxKind.CallExpression) { return void 0; } const callee = node.expression; - if (_optionalChain([callee, 'optionalAccess', _1809 => _1809.kind]) !== _ast.SyntaxKind.PropertyAccessExpression || _optionalChain([callee, 'access', _1810 => _1810.expression, 'optionalAccess', _1811 => _1811.kind]) !== _ast.SyntaxKind.ThisKeyword) { + if (_optionalChain([callee, 'optionalAccess', _1952 => _1952.kind]) !== _ast.SyntaxKind.PropertyAccessExpression || _optionalChain([callee, 'access', _1953 => _1953.expression, 'optionalAccess', _1954 => _1954.kind]) !== _ast.SyntaxKind.ThisKeyword) { return void 0; } - const name = _optionalChain([callee, 'access', _1812 => _1812.name, 'optionalAccess', _1813 => _1813.text]); + const name = _optionalChain([callee, 'access', _1955 => _1955.name, 'optionalAccess', _1956 => _1956.text]); if (typeof name !== "string") { return void 0; } @@ -17843,8 +18384,8 @@ var JavaTranspiler = class extends BaseTranspiler { return void 0; } const checker = this.checkerOrUndefined(); - const declaration = _optionalChain([checker, 'access', _1814 => _1814.getResolvedSignature, 'call', _1815 => _1815(node), 'optionalAccess', _1816 => _1816.declaration, 'optionalAccess', _1817 => _1817.resolve, 'call', _1818 => _1818()]); - const fileName = _optionalChain([declaration, 'optionalAccess', _1819 => _1819.getSourceFile, 'optionalCall', _1820 => _1820(), 'access', _1821 => _1821.fileName]); + const declaration = _optionalChain([checker, 'access', _1957 => _1957.getResolvedSignature, 'call', _1958 => _1958(node), 'optionalAccess', _1959 => _1959.declaration, 'optionalAccess', _1960 => _1960.resolve, 'call', _1961 => _1961()]); + const fileName = _optionalChain([declaration, 'optionalAccess', _1962 => _1962.getSourceFile, 'optionalCall', _1963 => _1963(), 'access', _1964 => _1964.fileName]); if (typeof fileName !== "string") { return void 0; } @@ -17957,11 +18498,11 @@ var JavaTranspiler = class extends BaseTranspiler { if (checker === void 0) { return false; } - const declaration = _optionalChain([checker, 'access', _1822 => _1822.getSymbolAtLocation, 'call', _1823 => _1823(node), 'optionalAccess', _1824 => _1824.valueDeclaration, 'optionalAccess', _1825 => _1825.resolve, 'call', _1826 => _1826()]); + const declaration = _optionalChain([checker, 'access', _1965 => _1965.getSymbolAtLocation, 'call', _1966 => _1966(node), 'optionalAccess', _1967 => _1967.valueDeclaration, 'optionalAccess', _1968 => _1968.resolve, 'call', _1969 => _1969()]); if (declaration === void 0 || declaration.kind !== _ast.SyntaxKind.VariableDeclaration && !_is.isParameterDeclaration.call(void 0, declaration)) { return false; } - return String(node.text) === String(_optionalChain([declaration, 'access', _1827 => _1827.name, 'optionalAccess', _1828 => _1828.text])); + return String(node.text) === String(_optionalChain([declaration, 'access', _1970 => _1970.name, 'optionalAccess', _1971 => _1971.text])); } // the checker type is the plain non-nullable `number` (TypeFlags.Number/NumberLiteral, no // alias): `Int`/`Num`/`any` and unions hold undefined at runtime, which the helpers absorb @@ -17971,7 +18512,7 @@ var JavaTranspiler = class extends BaseTranspiler { return false; } const type = checker.getTypeAtLocation(node); - return type !== void 0 && _optionalChain([type, 'access', _1829 => _1829.getAliasSymbol, 'optionalCall', _1830 => _1830()]) === void 0 && (type.flags === _sync.TypeFlags.Number || type.flags === _sync.TypeFlags.NumberLiteral); + return type !== void 0 && _optionalChain([type, 'access', _1972 => _1972.getAliasSymbol, 'optionalCall', _1973 => _1973()]) === void 0 && (type.flags === _sync.TypeFlags.Number || type.flags === _sync.TypeFlags.NumberLiteral); } // the kind of the native arithmetic this rule prints for `+ - * /`, or undefined when // the node keeps the helper. Mirrors printInlineHelperArithmetic operand-for-operand @@ -17979,7 +18520,7 @@ var JavaTranspiler = class extends BaseTranspiler { // `allowDeclaredLocals=false` asks for a kind that does not rely on a retyped local // anywhere in the subtree (`+` never consumes one — java-13/14 own Add). javaNativeArithmeticKind(node, allowDeclaredLocals = true) { - const op = _optionalChain([node, 'optionalAccess', _1831 => _1831.operatorToken, 'optionalAccess', _1832 => _1832.kind]); + const op = _optionalChain([node, 'optionalAccess', _1974 => _1974.operatorToken, 'optionalAccess', _1975 => _1975.kind]); const isPlus = op === _ast.SyntaxKind.PlusToken; const isMinus = op === _ast.SyntaxKind.MinusToken; const isMultiply = op === _ast.SyntaxKind.AsteriskToken; @@ -18104,11 +18645,11 @@ var JavaTranspiler = class extends BaseTranspiler { return false; } const checker = this.checkerOrUndefined(); - const declaration = _optionalChain([checker, 'access', _1833 => _1833.getResolvedSignature, 'call', _1834 => _1834(node), 'optionalAccess', _1835 => _1835.declaration, 'optionalAccess', _1836 => _1836.resolve, 'call', _1837 => _1837()]); + const declaration = _optionalChain([checker, 'access', _1976 => _1976.getResolvedSignature, 'call', _1977 => _1977(node), 'optionalAccess', _1978 => _1978.declaration, 'optionalAccess', _1979 => _1979.resolve, 'call', _1980 => _1980()]); if (declaration === void 0) { return false; } - const fileName = _nullishCoalesce(_optionalChain([declaration, 'access', _1838 => _1838.getSourceFile, 'optionalCall', _1839 => _1839(), 'optionalAccess', _1840 => _1840.fileName]), () => ( "")); + const fileName = _nullishCoalesce(_optionalChain([declaration, 'access', _1981 => _1981.getSourceFile, 'optionalCall', _1982 => _1982(), 'optionalAccess', _1983 => _1983.fileName]), () => ( "")); return /(^|[\\/])ts[\\/]src[\\/]base[\\/]functions[\\/]time\.ts$/.test(fileName) || /(^|[\\/])lib\.[^\\/]*\.d\.ts$/.test(fileName); } // `this.parseTimeframe(..)`: the hand-written java BaseExchange declares `public int @@ -18120,33 +18661,33 @@ var JavaTranspiler = class extends BaseTranspiler { } let declaration; try { - declaration = _optionalChain([this, 'access', _1841 => _1841.getChecker, 'call', _1842 => _1842(), 'access', _1843 => _1843.getResolvedSignature, 'call', _1844 => _1844(node), 'optionalAccess', _1845 => _1845.declaration, 'optionalAccess', _1846 => _1846.resolve, 'call', _1847 => _1847()]); + declaration = _optionalChain([this, 'access', _1984 => _1984.getChecker, 'call', _1985 => _1985(), 'access', _1986 => _1986.getResolvedSignature, 'call', _1987 => _1987(node), 'optionalAccess', _1988 => _1988.declaration, 'optionalAccess', _1989 => _1989.resolve, 'call', _1990 => _1990()]); } catch (e) { declaration = void 0; } if (declaration === void 0) { return false; } - const fileName = _nullishCoalesce(_optionalChain([declaration, 'access', _1848 => _1848.getSourceFile, 'optionalCall', _1849 => _1849(), 'optionalAccess', _1850 => _1850.fileName]), () => ( "")); + const fileName = _nullishCoalesce(_optionalChain([declaration, 'access', _1991 => _1991.getSourceFile, 'optionalCall', _1992 => _1992(), 'optionalAccess', _1993 => _1993.fileName]), () => ( "")); return /(^|[\\/])ts[\\/]src[\\/]base[\\/]functions[\\/]misc\.ts$/.test(fileName); } // the method name of a `this.(...)` call, or undefined for any other node javaThisCallName(node) { - const callee = _optionalChain([node, 'optionalAccess', _1851 => _1851.kind]) === _ast.SyntaxKind.CallExpression ? node.expression : void 0; - if (_optionalChain([callee, 'optionalAccess', _1852 => _1852.kind]) !== _ast.SyntaxKind.PropertyAccessExpression || callee.expression.kind !== _ast.SyntaxKind.ThisKeyword) { + const callee = _optionalChain([node, 'optionalAccess', _1994 => _1994.kind]) === _ast.SyntaxKind.CallExpression ? node.expression : void 0; + if (_optionalChain([callee, 'optionalAccess', _1995 => _1995.kind]) !== _ast.SyntaxKind.PropertyAccessExpression || callee.expression.kind !== _ast.SyntaxKind.ThisKeyword) { return void 0; } - return _optionalChain([callee, 'access', _1853 => _1853.name, 'optionalAccess', _1854 => _1854.text]); + return _optionalChain([callee, 'access', _1996 => _1996.name, 'optionalAccess', _1997 => _1997.text]); } // `for (var i = ; ...; i++)`: printForStatement rewrites the emitted // `Object i = 0` initializer to `var i = 0`, so javac types the counter int. The // counter is widened explicitly by javaPrintWidenedOperand, and no `=`/compound javaIntForCounter(node) { - if (_optionalChain([node, 'optionalAccess', _1855 => _1855.kind]) !== _ast.SyntaxKind.Identifier) { + if (_optionalChain([node, 'optionalAccess', _1998 => _1998.kind]) !== _ast.SyntaxKind.Identifier) { return false; } const symbol = this.getChecker().getSymbolAtLocation(node); - const declaration = _optionalChain([symbol, 'optionalAccess', _1856 => _1856.valueDeclaration, 'optionalAccess', _1857 => _1857.resolve, 'call', _1858 => _1858()]); + const declaration = _optionalChain([symbol, 'optionalAccess', _1999 => _1999.valueDeclaration, 'optionalAccess', _2000 => _2000.resolve, 'call', _2001 => _2001()]); if (declaration === void 0 || !_is.isVariableDeclaration.call(void 0, declaration)) { return false; } @@ -18167,7 +18708,7 @@ var JavaTranspiler = class extends BaseTranspiler { // `++`/`--` keep the primitive int, any other operator would not javaCounterHasNoBoxWrite(node, symbol) { let scope = node.parent; - while (scope !== void 0 && !_chunk4FDYB2TTcjs.isFunctionLike.call(void 0, scope) && scope.kind !== _ast.SyntaxKind.SourceFile) { + while (scope !== void 0 && !_chunkUBXMRIM6cjs.isFunctionLike.call(void 0, scope) && scope.kind !== _ast.SyntaxKind.SourceFile) { scope = scope.parent; } if (scope === void 0) { @@ -18193,7 +18734,7 @@ var JavaTranspiler = class extends BaseTranspiler { // `x.length` on a String/List receiver prints `((String)x).length()` / // `((java.util.List)x).size()` — a Java int on every path printJavaLength takes javaLengthIntRead(node) { - if (_optionalChain([node, 'optionalAccess', _1859 => _1859.kind]) !== _ast.SyntaxKind.PropertyAccessExpression || _optionalChain([node, 'access', _1860 => _1860.name, 'optionalAccess', _1861 => _1861.text]) !== "length") { + if (_optionalChain([node, 'optionalAccess', _2002 => _2002.kind]) !== _ast.SyntaxKind.PropertyAccessExpression || _optionalChain([node, 'access', _2003 => _2003.name, 'optionalAccess', _2004 => _2004.text]) !== "length") { return false; } return this.javaLengthKind(node.expression) !== void 0; @@ -18290,7 +18831,7 @@ var JavaTranspiler = class extends BaseTranspiler { if (callee === void 0 || callee.kind !== _ast.SyntaxKind.PropertyAccessExpression) { return void 0; } - if (_optionalChain([callee, 'access', _1862 => _1862.name, 'optionalAccess', _1863 => _1863.text]) !== "split" || _optionalChain([node, 'access', _1864 => _1864.arguments, 'optionalAccess', _1865 => _1865.length]) !== 1) { + if (_optionalChain([callee, 'access', _2005 => _2005.name, 'optionalAccess', _2006 => _2006.text]) !== "split" || _optionalChain([node, 'access', _2007 => _2007.arguments, 'optionalAccess', _2008 => _2008.length]) !== 1) { return void 0; } const receiver = callee.expression; @@ -18327,7 +18868,7 @@ var JavaTranspiler = class extends BaseTranspiler { return false; } const symbol = this.getChecker().getSymbolAtLocation(node); - const declaration = _nullishCoalesce(_optionalChain([symbol, 'optionalAccess', _1866 => _1866.valueDeclaration, 'optionalAccess', _1867 => _1867.resolve, 'call', _1868 => _1868()]), () => ( _optionalChain([symbol, 'optionalAccess', _1869 => _1869.declarations, 'optionalAccess', _1870 => _1870[0], 'optionalAccess', _1871 => _1871.resolve, 'call', _1872 => _1872()]))); + const declaration = _nullishCoalesce(_optionalChain([symbol, 'optionalAccess', _2009 => _2009.valueDeclaration, 'optionalAccess', _2010 => _2010.resolve, 'call', _2011 => _2011()]), () => ( _optionalChain([symbol, 'optionalAccess', _2012 => _2012.declarations, 'optionalAccess', _2013 => _2013[0], 'optionalAccess', _2014 => _2014.resolve, 'call', _2015 => _2015()]))); if (!declaration || declaration.kind !== _ast.SyntaxKind.VariableDeclaration) { return false; } @@ -18335,12 +18876,12 @@ var JavaTranspiler = class extends BaseTranspiler { return false; } const list = declaration.parent; - const forStatement = _optionalChain([list, 'optionalAccess', _1873 => _1873.parent]); + const forStatement = _optionalChain([list, 'optionalAccess', _2016 => _2016.parent]); if (!forStatement || forStatement.kind !== _ast.SyntaxKind.ForStatement || forStatement.initializer !== list) { return false; } const incrementor = forStatement.incrementor; - if (!incrementor || _optionalChain([incrementor, 'access', _1874 => _1874.operand, 'optionalAccess', _1875 => _1875.kind]) !== _ast.SyntaxKind.Identifier || incrementor.operand.text !== node.text) { + if (!incrementor || _optionalChain([incrementor, 'access', _2017 => _2017.operand, 'optionalAccess', _2018 => _2018.kind]) !== _ast.SyntaxKind.Identifier || incrementor.operand.text !== node.text) { return false; } if (incrementor.kind !== _ast.SyntaxKind.PostfixUnaryExpression && incrementor.kind !== _ast.SyntaxKind.PrefixUnaryExpression) { @@ -18352,11 +18893,11 @@ var JavaTranspiler = class extends BaseTranspiler { if (!safe || !n || n === incrementor) { return; } - if (n.kind === _ast.SyntaxKind.BinaryExpression && JAVA_ASSIGNMENT_OPERATOR_KINDS.has(n.operatorToken.kind) && _optionalChain([n, 'access', _1876 => _1876.left, 'optionalAccess', _1877 => _1877.kind]) === _ast.SyntaxKind.Identifier && n.left.text === name) { + if (n.kind === _ast.SyntaxKind.BinaryExpression && JAVA_ASSIGNMENT_OPERATOR_KINDS.has(n.operatorToken.kind) && _optionalChain([n, 'access', _2019 => _2019.left, 'optionalAccess', _2020 => _2020.kind]) === _ast.SyntaxKind.Identifier && n.left.text === name) { safe = false; return; } - if ((n.kind === _ast.SyntaxKind.PostfixUnaryExpression || n.kind === _ast.SyntaxKind.PrefixUnaryExpression) && _optionalChain([n, 'access', _1878 => _1878.operand, 'optionalAccess', _1879 => _1879.kind]) === _ast.SyntaxKind.Identifier && n.operand.text === name) { + if ((n.kind === _ast.SyntaxKind.PostfixUnaryExpression || n.kind === _ast.SyntaxKind.PrefixUnaryExpression) && _optionalChain([n, 'access', _2021 => _2021.operand, 'optionalAccess', _2022 => _2022.kind]) === _ast.SyntaxKind.Identifier && n.operand.text === name) { return; } n.forEachChild(scan); @@ -18366,16 +18907,16 @@ var JavaTranspiler = class extends BaseTranspiler { return false; } let enclosing = forStatement.parent; - while (enclosing && !_chunk4FDYB2TTcjs.isFunctionLike.call(void 0, enclosing)) { + while (enclosing && !_chunkUBXMRIM6cjs.isFunctionLike.call(void 0, enclosing)) { enclosing = enclosing.parent; } if (enclosing) { const body = _nullishCoalesce(enclosing.body, () => ( enclosing)); const scanOuter = (n) => { - if (!safe || !n || n === forStatement || _chunk4FDYB2TTcjs.isFunctionLike.call(void 0, n)) { + if (!safe || !n || n === forStatement || _chunkUBXMRIM6cjs.isFunctionLike.call(void 0, n)) { return; } - if (n.kind === _ast.SyntaxKind.BinaryExpression && JAVA_ASSIGNMENT_OPERATOR_KINDS.has(n.operatorToken.kind) && _optionalChain([n, 'access', _1880 => _1880.left, 'optionalAccess', _1881 => _1881.kind]) === _ast.SyntaxKind.Identifier && n.left.text === name) { + if (n.kind === _ast.SyntaxKind.BinaryExpression && JAVA_ASSIGNMENT_OPERATOR_KINDS.has(n.operatorToken.kind) && _optionalChain([n, 'access', _2023 => _2023.left, 'optionalAccess', _2024 => _2024.kind]) === _ast.SyntaxKind.Identifier && n.left.text === name) { safe = false; return; } @@ -18511,7 +19052,7 @@ var JavaTranspiler = class extends BaseTranspiler { } // `parseInt(x)` / `parseFloat(x)` -> the native parse, or undefined to keep the helper printNativeScalarParse(node, callee) { - const args = _optionalChain([node, 'optionalAccess', _1882 => _1882.arguments]); + const args = _optionalChain([node, 'optionalAccess', _2025 => _2025.arguments]); if (args === void 0 || args.length !== 1 || !_is.isStringLiteral.call(void 0, args[0])) { return void 0; } @@ -18537,7 +19078,7 @@ var JavaTranspiler = class extends BaseTranspiler { // Helpers.padStart pads then answers the LAST `n` chars, so the native form keeps both halves: // String.format builds the pad from an empty `%s` and the >= arm reproduces the truncation. printNativePadStart(node, name) { - const args = _optionalChain([node, 'optionalAccess', _1883 => _1883.arguments]); + const args = _optionalChain([node, 'optionalAccess', _2026 => _2026.arguments]); if (args === void 0 || args.length !== 2 || name === void 0) { return void 0; } @@ -18547,7 +19088,7 @@ var JavaTranspiler = class extends BaseTranspiler { if (!_is.isStringLiteral.call(void 0, args[1]) || args[1].text.length === 0) { return void 0; } - const receiver = _optionalChain([node, 'access', _1884 => _1884.expression, 'optionalAccess', _1885 => _1885.expression]); + const receiver = _optionalChain([node, 'access', _2027 => _2027.expression, 'optionalAccess', _2028 => _2028.expression]); if (!this.sideEffectFreeReceiver(receiver)) { return void 0; } @@ -18572,7 +19113,7 @@ var JavaTranspiler = class extends BaseTranspiler { // declaration carries that type; every other use is scanned first (D2) as it changes resolution. javaUnwrapParentheses(node) { let current = node; - while (_optionalChain([current, 'optionalAccess', _1886 => _1886.kind]) === _ast.SyntaxKind.ParenthesizedExpression) { + while (_optionalChain([current, 'optionalAccess', _2029 => _2029.kind]) === _ast.SyntaxKind.ParenthesizedExpression) { current = current.expression; } return current; @@ -18582,7 +19123,7 @@ var JavaTranspiler = class extends BaseTranspiler { // Object box). Mirrors printInlineHelperArithmetic operand-for-operand. javaNativeArithmeticType(node) { const value = this.javaUnwrapParentheses(node); - if (_optionalChain([value, 'optionalAccess', _1887 => _1887.kind]) !== _ast.SyntaxKind.BinaryExpression) { + if (_optionalChain([value, 'optionalAccess', _2030 => _2030.kind]) !== _ast.SyntaxKind.BinaryExpression) { return void 0; } const op = value.operatorToken.kind; @@ -18598,7 +19139,7 @@ var JavaTranspiler = class extends BaseTranspiler { } // the enclosing function-like node: the D2 scan scope of a typed local javaEnclosingFunction(node) { - let current = _optionalChain([node, 'optionalAccess', _1888 => _1888.parent]); + let current = _optionalChain([node, 'optionalAccess', _2031 => _2031.parent]); while (current !== void 0) { const kind = current.kind; if (kind === _ast.SyntaxKind.MethodDeclaration || kind === _ast.SyntaxKind.FunctionDeclaration || kind === _ast.SyntaxKind.FunctionExpression || kind === _ast.SyntaxKind.ArrowFunction || kind === _ast.SyntaxKind.GetAccessor || kind === _ast.SyntaxKind.SetAccessor || kind === _ast.SyntaxKind.Constructor) { @@ -18626,7 +19167,7 @@ var JavaTranspiler = class extends BaseTranspiler { // the innermost block that scopes a declaration (Java locals live to the end of // their block; sibling blocks may reuse the name, nested ones may not) javaScopingBlock(node) { - let current = _optionalChain([node, 'optionalAccess', _1889 => _1889.parent]); + let current = _optionalChain([node, 'optionalAccess', _2032 => _2032.parent]); let last = void 0; while (current !== void 0) { if (current.kind === _ast.SyntaxKind.Block || current.kind === _ast.SyntaxKind.SourceFile) { @@ -18673,23 +19214,23 @@ var JavaTranspiler = class extends BaseTranspiler { return javaType === "String"; } if (parent.kind === _ast.SyntaxKind.AsExpression || parent.kind === _ast.SyntaxKind.TypeAssertionExpression) { - return javaType === "String" && _optionalChain([parent, 'access', _1890 => _1890.type, 'optionalAccess', _1891 => _1891.kind]) === _ast.SyntaxKind.StringKeyword; + return javaType === "String" && _optionalChain([parent, 'access', _2033 => _2033.type, 'optionalAccess', _2034 => _2034.kind]) === _ast.SyntaxKind.StringKeyword; } if (parent.kind === _ast.SyntaxKind.ConditionalExpression) { return javaType === "String"; } if (parent.kind === _ast.SyntaxKind.ElementAccessExpression && parent.expression === node) { const grand = parent.parent; - if (_optionalChain([grand, 'optionalAccess', _1892 => _1892.kind]) === _ast.SyntaxKind.DeleteExpression) { + if (_optionalChain([grand, 'optionalAccess', _2035 => _2035.kind]) === _ast.SyntaxKind.DeleteExpression) { return false; } - if (_optionalChain([grand, 'optionalAccess', _1893 => _1893.kind]) === _ast.SyntaxKind.BinaryExpression && grand.left === parent && JAVA_ASSIGNMENT_OPERATOR_KINDS.has(grand.operatorToken.kind)) { + if (_optionalChain([grand, 'optionalAccess', _2036 => _2036.kind]) === _ast.SyntaxKind.BinaryExpression && grand.left === parent && JAVA_ASSIGNMENT_OPERATOR_KINDS.has(grand.operatorToken.kind)) { return false; } } if (parent.kind === _ast.SyntaxKind.ArrayLiteralExpression) { const grand = parent.parent; - if (_optionalChain([grand, 'optionalAccess', _1894 => _1894.kind]) === _ast.SyntaxKind.BinaryExpression && grand.left === parent && JAVA_ASSIGNMENT_OPERATOR_KINDS.has(grand.operatorToken.kind)) { + if (_optionalChain([grand, 'optionalAccess', _2037 => _2037.kind]) === _ast.SyntaxKind.BinaryExpression && grand.left === parent && JAVA_ASSIGNMENT_OPERATOR_KINDS.has(grand.operatorToken.kind)) { return false; } } @@ -18801,8 +19342,8 @@ var JavaTranspiler = class extends BaseTranspiler { const symbolIdOf = (n) => { try { const checker = this.getChecker(); - const sym = _optionalChain([checker, 'optionalAccess', _1895 => _1895.getSymbolAtLocation, 'optionalCall', _1896 => _1896(n)]); - const decl = _nullishCoalesce(_optionalChain([sym, 'optionalAccess', _1897 => _1897.declarations, 'optionalAccess', _1898 => _1898[0], 'optionalAccess', _1899 => _1899.resolve, 'call', _1900 => _1900()]), () => ( _optionalChain([sym, 'optionalAccess', _1901 => _1901.valueDeclaration, 'optionalAccess', _1902 => _1902.resolve, 'call', _1903 => _1903()]))); + const sym = _optionalChain([checker, 'optionalAccess', _2038 => _2038.getSymbolAtLocation, 'optionalCall', _2039 => _2039(n)]); + const decl = _nullishCoalesce(_optionalChain([sym, 'optionalAccess', _2040 => _2040.declarations, 'optionalAccess', _2041 => _2041[0], 'optionalAccess', _2042 => _2042.resolve, 'call', _2043 => _2043()]), () => ( _optionalChain([sym, 'optionalAccess', _2044 => _2044.valueDeclaration, 'optionalAccess', _2045 => _2045.resolve, 'call', _2046 => _2046()]))); if (decl) return `s:${decl.pos}:${decl.end}`; } catch (e5) { @@ -18814,22 +19355,22 @@ var JavaTranspiler = class extends BaseTranspiler { if (!node) return; if (node.kind === _ast.SyntaxKind.BinaryExpression) { - if (_optionalChain([node, 'access', _1904 => _1904.left, 'optionalAccess', _1905 => _1905.kind]) === _ast.SyntaxKind.Identifier) { + if (_optionalChain([node, 'access', _2047 => _2047.left, 'optionalAccess', _2048 => _2048.kind]) === _ast.SyntaxKind.Identifier) { reassignedSyms.add(symbolIdOf(node.left)); - } else if (node.operatorToken.kind === _ast.SyntaxKind.EqualsToken && _optionalChain([node, 'access', _1906 => _1906.left, 'optionalAccess', _1907 => _1907.kind]) === _ast.SyntaxKind.ArrayLiteralExpression) { + } else if (node.operatorToken.kind === _ast.SyntaxKind.EqualsToken && _optionalChain([node, 'access', _2049 => _2049.left, 'optionalAccess', _2050 => _2050.kind]) === _ast.SyntaxKind.ArrayLiteralExpression) { for (const elem of _nullishCoalesce(node.left.elements, () => ( []))) { - if (_optionalChain([elem, 'optionalAccess', _1908 => _1908.kind]) === _ast.SyntaxKind.Identifier) { + if (_optionalChain([elem, 'optionalAccess', _2051 => _2051.kind]) === _ast.SyntaxKind.Identifier) { reassignedSyms.add(symbolIdOf(elem)); } } } } - if ((node.kind === _ast.SyntaxKind.PrefixUnaryExpression || node.kind === _ast.SyntaxKind.PostfixUnaryExpression) && this.isIncDecOperator(node.operator) && _optionalChain([node, 'access', _1909 => _1909.operand, 'optionalAccess', _1910 => _1910.kind]) === _ast.SyntaxKind.Identifier) { + if ((node.kind === _ast.SyntaxKind.PrefixUnaryExpression || node.kind === _ast.SyntaxKind.PostfixUnaryExpression) && this.isIncDecOperator(node.operator) && _optionalChain([node, 'access', _2052 => _2052.operand, 'optionalAccess', _2053 => _2053.kind]) === _ast.SyntaxKind.Identifier) { reassignedSyms.add(symbolIdOf(node.operand)); } if (node.kind === _ast.SyntaxKind.Identifier) { const name = node.text; - if (name && name !== "undefined" && !_optionalChain([name, 'access', _1911 => _1911.startsWith, 'optionalCall', _1912 => _1912("null")])) { + if (name && name !== "undefined" && !_optionalChain([name, 'access', _2054 => _2054.startsWith, 'optionalCall', _2055 => _2055("null")])) { if (this.ReassignedVars[this.getVarKey(node)]) { reassignedSyms.add(symbolIdOf(node)); } @@ -18847,7 +19388,7 @@ var JavaTranspiler = class extends BaseTranspiler { return; if (n.kind === _ast.SyntaxKind.Identifier) { const name = n.text; - if (name && name !== "undefined" && !_optionalChain([name, 'access', _1913 => _1913.startsWith, 'optionalCall', _1914 => _1914("null")])) { + if (name && name !== "undefined" && !_optionalChain([name, 'access', _2056 => _2056.startsWith, 'optionalCall', _2057 => _2057("null")])) { const sym = symbolIdOf(n); if (reassignedSyms.has(sym)) { events.push({ kind: "use", sym, name, node: n }); @@ -18871,8 +19412,8 @@ var JavaTranspiler = class extends BaseTranspiler { return; } if (n.kind === _ast.SyntaxKind.CallExpression) { - _optionalChain([n, 'access', _1915 => _1915.arguments, 'optionalAccess', _1916 => _1916.forEach, 'call', _1917 => _1917(visitExprInObjLit)]); - if (_optionalChain([n, 'access', _1918 => _1918.expression, 'optionalAccess', _1919 => _1919.kind]) === _ast.SyntaxKind.PropertyAccessExpression) { + _optionalChain([n, 'access', _2058 => _2058.arguments, 'optionalAccess', _2059 => _2059.forEach, 'call', _2060 => _2060(visitExprInObjLit)]); + if (_optionalChain([n, 'access', _2061 => _2061.expression, 'optionalAccess', _2062 => _2062.kind]) === _ast.SyntaxKind.PropertyAccessExpression) { visitExprInObjLit(n.expression.expression); } return; @@ -18883,7 +19424,7 @@ var JavaTranspiler = class extends BaseTranspiler { } if (n.kind === _ast.SyntaxKind.ElementAccessExpression) { let left = n.expression; - while (_optionalChain([left, 'optionalAccess', _1920 => _1920.kind]) === _ast.SyntaxKind.ElementAccessExpression) { + while (_optionalChain([left, 'optionalAccess', _2063 => _2063.kind]) === _ast.SyntaxKind.ElementAccessExpression) { left = left.expression; } visitExprInObjLit(left); @@ -18891,7 +19432,7 @@ var JavaTranspiler = class extends BaseTranspiler { return; } if (n.kind === _ast.SyntaxKind.ObjectLiteralExpression) { - _optionalChain([n, 'access', _1921 => _1921.properties, 'optionalAccess', _1922 => _1922.forEach, 'call', _1923 => _1923((p) => { + _optionalChain([n, 'access', _2064 => _2064.properties, 'optionalAccess', _2065 => _2065.forEach, 'call', _2066 => _2066((p) => { if (p.initializer) visitExprInObjLit(p.initializer); })]); @@ -18904,7 +19445,7 @@ var JavaTranspiler = class extends BaseTranspiler { return; if (node.kind === _ast.SyntaxKind.BinaryExpression && this.isAssignmentOperator(node.operatorToken.kind)) { walk(node.right); - if (_optionalChain([node, 'access', _1924 => _1924.left, 'optionalAccess', _1925 => _1925.kind]) === _ast.SyntaxKind.Identifier) { + if (_optionalChain([node, 'access', _2067 => _2067.left, 'optionalAccess', _2068 => _2068.kind]) === _ast.SyntaxKind.Identifier) { const sym = symbolIdOf(node.left); if (reassignedSyms.has(sym)) { events.push({ kind: "reassign", sym }); @@ -18914,7 +19455,7 @@ var JavaTranspiler = class extends BaseTranspiler { } return; } - if ((node.kind === _ast.SyntaxKind.PrefixUnaryExpression || node.kind === _ast.SyntaxKind.PostfixUnaryExpression) && this.isIncDecOperator(node.operator) && _optionalChain([node, 'access', _1926 => _1926.operand, 'optionalAccess', _1927 => _1927.kind]) === _ast.SyntaxKind.Identifier) { + if ((node.kind === _ast.SyntaxKind.PrefixUnaryExpression || node.kind === _ast.SyntaxKind.PostfixUnaryExpression) && this.isIncDecOperator(node.operator) && _optionalChain([node, 'access', _2069 => _2069.operand, 'optionalAccess', _2070 => _2070.kind]) === _ast.SyntaxKind.Identifier) { const sym = symbolIdOf(node.operand); if (reassignedSyms.has(sym)) { events.push({ kind: "reassign", sym }); @@ -18922,7 +19463,7 @@ var JavaTranspiler = class extends BaseTranspiler { return; } if (node.kind === _ast.SyntaxKind.ObjectLiteralExpression) { - _optionalChain([node, 'access', _1928 => _1928.properties, 'optionalAccess', _1929 => _1929.forEach, 'call', _1930 => _1930((prop) => { + _optionalChain([node, 'access', _2071 => _2071.properties, 'optionalAccess', _2072 => _2072.forEach, 'call', _2073 => _2073((prop) => { if (prop.initializer) { visitExprInObjLit(prop.initializer); walk(prop.initializer); @@ -18954,7 +19495,7 @@ var JavaTranspiler = class extends BaseTranspiler { } if (node.kind === _ast.SyntaxKind.TryStatement) { walkBlockAndBump(node.tryBlock); - walkBlockAndBump(_optionalChain([node, 'access', _1931 => _1931.catchClause, 'optionalAccess', _1932 => _1932.block])); + walkBlockAndBump(_optionalChain([node, 'access', _2074 => _2074.catchClause, 'optionalAccess', _2075 => _2075.block])); walkBlockAndBump(node.finallyBlock); return; } @@ -19044,10 +19585,10 @@ var JavaTranspiler = class extends BaseTranspiler { } printVariableDeclarationList(node, identation) { const declaration = node.declarations[0]; - if (this.removeVariableDeclarationForFunctionExpression && _optionalChain([declaration, 'optionalAccess', _1933 => _1933.initializer]) && _is.isFunctionExpression.call(void 0, declaration.initializer)) { + if (this.removeVariableDeclarationForFunctionExpression && _optionalChain([declaration, 'optionalAccess', _2076 => _2076.initializer]) && _is.isFunctionExpression.call(void 0, declaration.initializer)) { return this.printNode(declaration.initializer, identation).trimEnd(); } - if (_optionalChain([declaration, 'optionalAccess', _1934 => _1934.name, 'access', _1935 => _1935.kind]) === _ast.SyntaxKind.ArrayBindingPattern) { + if (_optionalChain([declaration, 'optionalAccess', _2077 => _2077.name, 'access', _2078 => _2078.kind]) === _ast.SyntaxKind.ArrayBindingPattern) { const arrayBindingPattern = declaration.name; const arrayBindingPatternElements = arrayBindingPattern.elements; const parsedArrayBindingElements = arrayBindingPatternElements.map( @@ -19063,7 +19604,7 @@ var JavaTranspiler = class extends BaseTranspiler { (e, index) => this.getIden(identation) + `var ${e} = ((java.util.List) ${syntheticName}).get(${index})` ).join(";\n"); } - const isNew = _optionalChain([declaration, 'optionalAccess', _1936 => _1936.initializer]) && declaration.initializer.kind === _ast.SyntaxKind.NewExpression; + const isNew = _optionalChain([declaration, 'optionalAccess', _2079 => _2079.initializer]) && declaration.initializer.kind === _ast.SyntaxKind.NewExpression; let varToken = isNew ? "var " : this.VAR_TOKEN + " "; if (!isNew) { const arithmeticType = this.javaArithmeticLocalType(declaration); @@ -19090,13 +19631,13 @@ var JavaTranspiler = class extends BaseTranspiler { return this.getIden(identation) + varToken + this.printNode(declaration.name) + " = " + parsedValue; } printThisKeyword(node, identation) { - let current = _optionalChain([node, 'optionalAccess', _1937 => _1937.parent]); + let current = _optionalChain([node, 'optionalAccess', _2080 => _2080.parent]); while (current) { if (current.kind === _ast.SyntaxKind.PropertyAssignment && !this.builderObjectLiterals.has(current.parent)) { const className = this.currentClassName; return `${this.capitalize(className)}.this`; } - current = _optionalChain([current, 'optionalAccess', _1938 => _1938.parent]); + current = _optionalChain([current, 'optionalAccess', _2081 => _2081.parent]); } return this.THIS_TOKEN; } @@ -19124,7 +19665,7 @@ var JavaTranspiler = class extends BaseTranspiler { if (_is.isArrayLiteralExpression.call(void 0, node) || _is.isObjectLiteralExpression.call(void 0, node) || _is.isStringLiteral.call(void 0, node) || _is.isBooleanLiteral.call(void 0, node) || _is.isNumericLiteral.call(void 0, node)) { return this.UNDEFINED_TOKEN; } - if (_optionalChain([node, 'optionalAccess', _1939 => _1939.text]) === "undefined" && _optionalChain([this, 'access', _1940 => _1940.getChecker, 'call', _1941 => _1941(), 'access', _1942 => _1942.getTypeAtLocation, 'call', _1943 => _1943(_optionalChain([node, 'optionalAccess', _1944 => _1944.parent])), 'optionalAccess', _1945 => _1945.flags]) === _sync.TypeFlags.Number) { + if (_optionalChain([node, 'optionalAccess', _2082 => _2082.text]) === "undefined" && _optionalChain([this, 'access', _2083 => _2083.getChecker, 'call', _2084 => _2084(), 'access', _2085 => _2085.getTypeAtLocation, 'call', _2086 => _2086(_optionalChain([node, 'optionalAccess', _2087 => _2087.parent])), 'optionalAccess', _2088 => _2088.flags]) === _sync.TypeFlags.Number) { return this.UNDEFINED_TOKEN; } return void 0; @@ -19147,7 +19688,7 @@ var JavaTranspiler = class extends BaseTranspiler { // Pure = evaluating the initializer has no effect and cannot throw, so // skipping it when the argument was supplied cannot change behavior. isPureInitializer(node) { - switch (_optionalChain([node, 'optionalAccess', _1946 => _1946.kind])) { + switch (_optionalChain([node, 'optionalAccess', _2089 => _2089.kind])) { case _ast.SyntaxKind.NullKeyword: case _ast.SyntaxKind.TrueKeyword: case _ast.SyntaxKind.FalseKeyword: @@ -19459,7 +20000,7 @@ var JavaTranspiler = class extends BaseTranspiler { } // one line per reassigned parameter of an async method (optional ones only in a split core) javaAsyncParamWrapperLines(node, identation, printLine) { - const parameters = _optionalChain([node, 'optionalAccess', _1947 => _1947.parameters]); + const parameters = _optionalChain([node, 'optionalAccess', _2090 => _2090.parameters]); const finalVarWrappers = []; if (parameters) { const isAsyncMethod = this.isAsyncFunction(node); @@ -19508,7 +20049,7 @@ var JavaTranspiler = class extends BaseTranspiler { return native === void 0 ? `Helpers.isArray(${parsedArg})` : native; } printNativeArrayIsArray(node, parsedArg) { - const operand = _optionalChain([node, 'optionalAccess', _1948 => _1948.arguments, 'optionalAccess', _1949 => _1949[0]]); + const operand = _optionalChain([node, 'optionalAccess', _2091 => _2091.arguments, 'optionalAccess', _2092 => _2092[0]]); if (operand === void 0 || parsedArg === void 0) { return void 0; } @@ -19541,7 +20082,7 @@ var JavaTranspiler = class extends BaseTranspiler { return kind === _ast.SyntaxKind.Identifier || kind === _ast.SyntaxKind.PropertyAccessExpression || kind === _ast.SyntaxKind.ElementAccessExpression || kind === _ast.SyntaxKind.CallExpression; } javaOperandType(operand) { - return _optionalChain([this, 'access', _1950 => _1950.checkerOrUndefined, 'call', _1951 => _1951(), 'optionalAccess', _1952 => _1952.getTypeAtLocation, 'call', _1953 => _1953(operand)]); + return _optionalChain([this, 'access', _2093 => _2093.checkerOrUndefined, 'call', _2094 => _2094(), 'optionalAccess', _2095 => _2095.getTypeAtLocation, 'call', _2096 => _2096(operand)]); } // literals and identifiers have nothing an array-literal wrapper could skip by dropping javaArrayLiteralDropsNothing(node, depth = 0) { @@ -19567,7 +20108,7 @@ var JavaTranspiler = class extends BaseTranspiler { } const flags = type.flags; if (flags & _sync.TypeFlags.Union) { - const parts = _nullishCoalesce(_optionalChain([type, 'access', _1954 => _1954.getTypes, 'optionalCall', _1955 => _1955()]), () => ( [])); + const parts = _nullishCoalesce(_optionalChain([type, 'access', _2097 => _2097.getTypes, 'optionalCall', _2098 => _2098()]), () => ( [])); return parts.length > 0 && parts.every((part) => this.javaTypeFlagsOnly(part, mask, depth + 1)); } return (flags & mask) !== 0; @@ -19579,7 +20120,7 @@ var JavaTranspiler = class extends BaseTranspiler { return _nullishCoalesce(this.printNativeObjectKeysCall(node), () => ( `Helpers.objectKeys(${parsedArg})`)); } printNativeObjectKeysCall(node) { - const argument = _optionalChain([node, 'optionalAccess', _1956 => _1956.arguments, 'optionalAccess', _1957 => _1957[0]]); + const argument = _optionalChain([node, 'optionalAccess', _2099 => _2099.arguments, 'optionalAccess', _2100 => _2100[0]]); if (argument === void 0 || _is.isPropertyAccessExpression.call(void 0, argument)) { return void 0; } @@ -19609,12 +20150,12 @@ var JavaTranspiler = class extends BaseTranspiler { // CompletableFuture.allOf waits for exactly those, so Helpers.promiseAll's reflective loop adds // nothing. Result used -> thenApply collecting values, only for `const` locals (no double runs). printNativePromiseAllCall(node) { - const awaitNode = _optionalChain([node, 'optionalAccess', _1958 => _1958.parent]); - if (_optionalChain([awaitNode, 'optionalAccess', _1959 => _1959.kind]) !== _ast.SyntaxKind.AwaitExpression) { + const awaitNode = _optionalChain([node, 'optionalAccess', _2101 => _2101.parent]); + if (_optionalChain([awaitNode, 'optionalAccess', _2102 => _2102.kind]) !== _ast.SyntaxKind.AwaitExpression) { return void 0; } - const listNode = _optionalChain([node, 'access', _1960 => _1960.arguments, 'optionalAccess', _1961 => _1961[0]]); - if (_optionalChain([listNode, 'optionalAccess', _1962 => _1962.kind]) !== _ast.SyntaxKind.ArrayLiteralExpression) { + const listNode = _optionalChain([node, 'access', _2103 => _2103.arguments, 'optionalAccess', _2104 => _2104[0]]); + if (_optionalChain([listNode, 'optionalAccess', _2105 => _2105.kind]) !== _ast.SyntaxKind.ArrayLiteralExpression) { return void 0; } const elements = listNode.elements; @@ -19628,7 +20169,7 @@ var JavaTranspiler = class extends BaseTranspiler { const futureCast = `((${this.PROMISE_TYPE_KEYWORD}) `; const casted = printed.map((element) => `${futureCast}${element})`); const allOf = `${this.PROMISE_TYPE_KEYWORD}.allOf(${casted.join(", ")})`; - if (_optionalChain([awaitNode, 'access', _1963 => _1963.parent, 'optionalAccess', _1964 => _1964.kind]) === _ast.SyntaxKind.ExpressionStatement) { + if (_optionalChain([awaitNode, 'access', _2106 => _2106.parent, 'optionalAccess', _2107 => _2107.kind]) === _ast.SyntaxKind.ExpressionStatement) { return allOf; } if (elements.length === 0 || !elements.every((element) => this.isConstBoundIdentifier(element)) || printed.indexOf("promiseAllValue") !== -1) { @@ -19644,20 +20185,20 @@ var JavaTranspiler = class extends BaseTranspiler { if (node.kind !== _ast.SyntaxKind.Identifier) { return false; } - const declaration = _optionalChain([this, 'access', _1965 => _1965.getChecker, 'call', _1966 => _1966(), 'access', _1967 => _1967.getSymbolAtLocation, 'call', _1968 => _1968(node), 'optionalAccess', _1969 => _1969.valueDeclaration, 'optionalAccess', _1970 => _1970.resolve, 'call', _1971 => _1971()]); - return _optionalChain([declaration, 'optionalAccess', _1972 => _1972.kind]) === _ast.SyntaxKind.VariableDeclaration && (_chunk4FDYB2TTcjs.getCombinedNodeFlags.call(void 0, declaration) & _ast.NodeFlags.Const) === _ast.NodeFlags.Const; + const declaration = _optionalChain([this, 'access', _2108 => _2108.getChecker, 'call', _2109 => _2109(), 'access', _2110 => _2110.getSymbolAtLocation, 'call', _2111 => _2111(node), 'optionalAccess', _2112 => _2112.valueDeclaration, 'optionalAccess', _2113 => _2113.resolve, 'call', _2114 => _2114()]); + return _optionalChain([declaration, 'optionalAccess', _2115 => _2115.kind]) === _ast.SyntaxKind.VariableDeclaration && (_chunkUBXMRIM6cjs.getCombinedNodeFlags.call(void 0, declaration) & _ast.NodeFlags.Const) === _ast.NodeFlags.Const; } printPromiseAllCall(node, identation, parsedArg = void 0) { return _nullishCoalesce(this.printNativePromiseAllCall(node), () => ( `Helpers.promiseAll(${parsedArg})`)); } printMathFloorCall(node, _identation, parsedArg = void 0) { - return `(Math.floor(Double.parseDouble(${this.javaStringBoxText(_optionalChain([node, 'optionalAccess', _1973 => _1973.arguments, 'optionalAccess', _1974 => _1974[0]]), parsedArg)})))`; + return `(Math.floor(Double.parseDouble(${this.javaStringBoxText(_optionalChain([node, 'optionalAccess', _2116 => _2116.arguments, 'optionalAccess', _2117 => _2117[0]]), parsedArg)})))`; } printMathRoundCall(node, _identation, parsedArg = void 0) { - return `Math.round(Double.parseDouble(${this.javaStringBoxText(_optionalChain([node, 'optionalAccess', _1975 => _1975.arguments, 'optionalAccess', _1976 => _1976[0]]), parsedArg)}))`; + return `Math.round(Double.parseDouble(${this.javaStringBoxText(_optionalChain([node, 'optionalAccess', _2118 => _2118.arguments, 'optionalAccess', _2119 => _2119[0]]), parsedArg)}))`; } printMathCeilCall(node, _identation, parsedArg = void 0) { - return `Math.ceil(Double.parseDouble(${this.javaStringBoxText(_optionalChain([node, 'optionalAccess', _1977 => _1977.arguments, 'optionalAccess', _1978 => _1978[0]]), parsedArg)}))`; + return `Math.ceil(Double.parseDouble(${this.javaStringBoxText(_optionalChain([node, 'optionalAccess', _2120 => _2120.arguments, 'optionalAccess', _2121 => _2121[0]]), parsedArg)}))`; } printNumberIsIntegerCall(_node, _identation, parsedArg = void 0) { return `((${parsedArg} instanceof Integer) || (${parsedArg} instanceof Long))`; @@ -19675,7 +20216,7 @@ var JavaTranspiler = class extends BaseTranspiler { if (node === void 0 || name === void 0 || parsedArg === void 0) { return void 0; } - const receiver = _optionalChain([node, 'optionalAccess', _1979 => _1979.expression, 'optionalAccess', _1980 => _1980.expression]); + const receiver = _optionalChain([node, 'optionalAccess', _2122 => _2122.expression, 'optionalAccess', _2123 => _2123.expression]); if (receiver === void 0) { return void 0; } @@ -19689,10 +20230,10 @@ var JavaTranspiler = class extends BaseTranspiler { if (this.isJavaListType(receiverType) && !this.isVarargsArrayReference(receiver)) { return `((java.util.List)${name}).indexOf(${parsedArg})`; } - if (_optionalChain([receiverType, 'access', _1981 => _1981.getAliasSymbol, 'optionalCall', _1982 => _1982()]) !== void 0 || !this.isStringType(receiverType.flags)) { + if (_optionalChain([receiverType, 'access', _2124 => _2124.getAliasSymbol, 'optionalCall', _2125 => _2125()]) !== void 0 || !this.isStringType(receiverType.flags)) { return void 0; } - const arg = _optionalChain([node, 'access', _1983 => _1983.arguments, 'optionalAccess', _1984 => _1984[0]]); + const arg = _optionalChain([node, 'access', _2126 => _2126.arguments, 'optionalAccess', _2127 => _2127[0]]); if (arg === void 0) { return void 0; } @@ -19705,13 +20246,13 @@ var JavaTranspiler = class extends BaseTranspiler { } catch (e) { return void 0; } - if (_optionalChain([argType, 'access', _1985 => _1985.getAliasSymbol, 'optionalCall', _1986 => _1986()]) === void 0 && this.isStringType(argType.flags) && (_is.isIdentifier.call(void 0, arg) || _is.isPropertyAccessExpression.call(void 0, arg))) { + if (_optionalChain([argType, 'access', _2128 => _2128.getAliasSymbol, 'optionalCall', _2129 => _2129()]) === void 0 && this.isStringType(argType.flags) && (_is.isIdentifier.call(void 0, arg) || _is.isPropertyAccessExpression.call(void 0, arg))) { return `((String)${name}).indexOf(((String)${parsedArg}))`; } return void 0; } printIndexOfCall(node, _identation, name = void 0, parsedArg = void 0) { - return _nullishCoalesce(this.javaNativeIndexOfCall(node, name, parsedArg), () => ( `${this.INDEXOF_WRAPPER_OPEN}${name}, ${parsedArg}${this.INDEXOF_WRAPPER_CLOSE}`)); + return _nullishCoalesce(_nullishCoalesce(this.javaNativeIndexOfCall(node, name, parsedArg), () => ( this.javaHx4J06NarrowedIndexOf(node, name, parsedArg))), () => ( `${this.INDEXOF_WRAPPER_OPEN}${name}, ${parsedArg}${this.INDEXOF_WRAPPER_CLOSE}`)); } printSearchCall(_node, _identation, name = void 0, parsedArg = void 0) { return `((String)${name}).indexOf(${parsedArg})`; @@ -19802,7 +20343,7 @@ var JavaTranspiler = class extends BaseTranspiler { // bound is an integer literal: Java throws where JS clamps, so only literal bounds can be clamped. // The null guard keeps null -> null and needs a side-effect-free receiver (read up to three times). nativeSliceCallIfProvable(node, name) { - const args = _nullishCoalesce(_optionalChain([node, 'optionalAccess', _1987 => _1987.arguments]), () => ( [])); + const args = _nullishCoalesce(_optionalChain([node, 'optionalAccess', _2130 => _2130.arguments]), () => ( [])); if (args.length < 1 || args.length > 2) { return void 0; } @@ -19815,7 +20356,7 @@ var JavaTranspiler = class extends BaseTranspiler { if (hasEnd && end === void 0) { return void 0; } - const receiverExpression = _is.isPropertyAccessExpression.call(void 0, _optionalChain([node, 'optionalAccess', _1988 => _1988.expression])) ? node.expression.expression : void 0; + const receiverExpression = _is.isPropertyAccessExpression.call(void 0, _optionalChain([node, 'optionalAccess', _2131 => _2131.expression])) ? node.expression.expression : void 0; if (!this.sideEffectFreeReceiver(receiverExpression)) { return void 0; } @@ -19846,9 +20387,9 @@ var JavaTranspiler = class extends BaseTranspiler { return `Helpers.replace((String)${name}, (String)${parsedArg}, (String)${parsedArg2})`; } printReplaceAllCall(node, identation, name = void 0, parsedArg = void 0, parsedArg2 = void 0) { - const pattern = this.stringLiteralArgument(_optionalChain([node, 'optionalAccess', _1989 => _1989.arguments, 'optionalAccess', _1990 => _1990[0]])); - const replacement = this.stringLiteralArgument(_optionalChain([node, 'optionalAccess', _1991 => _1991.arguments, 'optionalAccess', _1992 => _1992[1]])); - const receiver = this.sideEffectFreeReceiver(_optionalChain([node, 'optionalAccess', _1993 => _1993.expression])); + const pattern = this.stringLiteralArgument(_optionalChain([node, 'optionalAccess', _2132 => _2132.arguments, 'optionalAccess', _2133 => _2133[0]])); + const replacement = this.stringLiteralArgument(_optionalChain([node, 'optionalAccess', _2134 => _2134.arguments, 'optionalAccess', _2135 => _2135[1]])); + const receiver = this.sideEffectFreeReceiver(_optionalChain([node, 'optionalAccess', _2136 => _2136.expression])); if (pattern !== void 0 && replacement !== void 0 && receiver) { return `(${name} == null ? null : ((String)${name}).replace(${pattern}, ${replacement}))`; } @@ -19905,11 +20446,11 @@ var JavaTranspiler = class extends BaseTranspiler { // printer writes that initializer as `var`, so javac infers a primitive int and the // ++/-- increment keeps it one javaPrimitiveCounter(node) { - if (_optionalChain([node, 'optionalAccess', _1994 => _1994.kind]) !== _ast.SyntaxKind.Identifier) { + if (_optionalChain([node, 'optionalAccess', _2137 => _2137.kind]) !== _ast.SyntaxKind.Identifier) { return false; } const symbol = this.getChecker().getSymbolAtLocation(node); - const declaration = _nullishCoalesce(_optionalChain([symbol, 'optionalAccess', _1995 => _1995.valueDeclaration, 'optionalAccess', _1996 => _1996.resolve, 'call', _1997 => _1997()]), () => ( _optionalChain([symbol, 'optionalAccess', _1998 => _1998.declarations, 'optionalAccess', _1999 => _1999[0], 'optionalAccess', _2000 => _2000.resolve, 'call', _2001 => _2001()]))); + const declaration = _nullishCoalesce(_optionalChain([symbol, 'optionalAccess', _2138 => _2138.valueDeclaration, 'optionalAccess', _2139 => _2139.resolve, 'call', _2140 => _2140()]), () => ( _optionalChain([symbol, 'optionalAccess', _2141 => _2141.declarations, 'optionalAccess', _2142 => _2142[0], 'optionalAccess', _2143 => _2143.resolve, 'call', _2144 => _2144()]))); if (declaration === void 0 || !_is.isVariableDeclaration.call(void 0, declaration) || !_is.isIdentifier.call(void 0, declaration.name)) { return false; } @@ -19917,18 +20458,18 @@ var JavaTranspiler = class extends BaseTranspiler { return false; } const list = declaration.parent; - if (_optionalChain([list, 'optionalAccess', _2002 => _2002.kind]) !== _ast.SyntaxKind.VariableDeclarationList || list.declarations.length !== 1) { + if (_optionalChain([list, 'optionalAccess', _2145 => _2145.kind]) !== _ast.SyntaxKind.VariableDeclarationList || list.declarations.length !== 1) { return false; } const forStatement = list.parent; - if (_optionalChain([forStatement, 'optionalAccess', _2003 => _2003.kind]) !== _ast.SyntaxKind.ForStatement || forStatement.initializer !== list) { + if (_optionalChain([forStatement, 'optionalAccess', _2146 => _2146.kind]) !== _ast.SyntaxKind.ForStatement || forStatement.initializer !== list) { return false; } if (this.javaIntegerLiteralKind(declaration.initializer) === void 0) { return false; } const incrementor = forStatement.incrementor; - return _optionalChain([incrementor, 'optionalAccess', _2004 => _2004.kind]) === _ast.SyntaxKind.PostfixUnaryExpression && _optionalChain([incrementor, 'access', _2005 => _2005.operand, 'optionalAccess', _2006 => _2006.kind]) === _ast.SyntaxKind.Identifier && incrementor.operand.text === node.text; + return _optionalChain([incrementor, 'optionalAccess', _2147 => _2147.kind]) === _ast.SyntaxKind.PostfixUnaryExpression && _optionalChain([incrementor, 'access', _2148 => _2148.operand, 'optionalAccess', _2149 => _2149.kind]) === _ast.SyntaxKind.Identifier && incrementor.operand.text === node.text; } // `-x` prints as the plain Java operator when the operand is already primitive: a decimal literal, // a nested native `+ - * /`, a `for (var i = ` counter or a `.length` read. @@ -19992,8 +20533,8 @@ var JavaTranspiler = class extends BaseTranspiler { if (node.kind !== _ast.SyntaxKind.CallExpression || node.expression.kind !== _ast.SyntaxKind.PropertyAccessExpression || node.expression.expression.kind !== _ast.SyntaxKind.Identifier || node.expression.expression.text !== "Precise" || !JAVA_PRECISE_BOOLEAN_STATICS.has(node.expression.name.text)) { return false; } - const declaration = _optionalChain([this, 'access', _2007 => _2007.getChecker, 'call', _2008 => _2008(), 'access', _2009 => _2009.getResolvedSignature, 'call', _2010 => _2010(node), 'optionalAccess', _2011 => _2011.declaration, 'optionalAccess', _2012 => _2012.resolve, 'call', _2013 => _2013()]); - if (declaration === void 0 || declaration.kind !== _ast.SyntaxKind.MethodDeclaration || _optionalChain([declaration, 'access', _2014 => _2014.parent, 'optionalAccess', _2015 => _2015.kind]) !== _ast.SyntaxKind.ClassDeclaration || _optionalChain([declaration, 'access', _2016 => _2016.parent, 'access', _2017 => _2017.name, 'optionalAccess', _2018 => _2018.text]) !== "Precise" || !_optionalChain([declaration, 'access', _2019 => _2019.modifiers, 'optionalAccess', _2020 => _2020.some, 'call', _2021 => _2021((modifier) => modifier.kind === _ast.SyntaxKind.StaticKeyword)])) { + const declaration = _optionalChain([this, 'access', _2150 => _2150.getChecker, 'call', _2151 => _2151(), 'access', _2152 => _2152.getResolvedSignature, 'call', _2153 => _2153(node), 'optionalAccess', _2154 => _2154.declaration, 'optionalAccess', _2155 => _2155.resolve, 'call', _2156 => _2156()]); + if (declaration === void 0 || declaration.kind !== _ast.SyntaxKind.MethodDeclaration || _optionalChain([declaration, 'access', _2157 => _2157.parent, 'optionalAccess', _2158 => _2158.kind]) !== _ast.SyntaxKind.ClassDeclaration || _optionalChain([declaration, 'access', _2159 => _2159.parent, 'access', _2160 => _2160.name, 'optionalAccess', _2161 => _2161.text]) !== "Precise" || !_optionalChain([declaration, 'access', _2162 => _2162.modifiers, 'optionalAccess', _2163 => _2163.some, 'call', _2164 => _2164((modifier) => modifier.kind === _ast.SyntaxKind.StaticKeyword)])) { return false; } return (this.getChecker().getTypeAtLocation(node).flags & _sync.TypeFlags.Boolean) !== 0; @@ -20003,14 +20544,14 @@ var JavaTranspiler = class extends BaseTranspiler { // while a union whose every member is boolean/nullish is the nullable box. javaBooleanValueKind(node) { const type = this.getChecker().getTypeAtLocation(node); - const flags = _nullishCoalesce(_optionalChain([type, 'optionalAccess', _2022 => _2022.flags]), () => ( 0)); + const flags = _nullishCoalesce(_optionalChain([type, 'optionalAccess', _2165 => _2165.flags]), () => ( 0)); if (flags & _sync.TypeFlags.BooleanLike) { return "boolean"; } if ((flags & _sync.TypeFlags.Union) === 0) { return void 0; } - const members = _nullishCoalesce(_optionalChain([type, 'access', _2023 => _2023.getTypes, 'optionalCall', _2024 => _2024()]), () => ( [])); + const members = _nullishCoalesce(_optionalChain([type, 'access', _2166 => _2166.getTypes, 'optionalCall', _2167 => _2167()]), () => ( [])); const booleanishMembers = _sync.TypeFlags.BooleanLike | _sync.TypeFlags.Null | _sync.TypeFlags.Undefined | _sync.TypeFlags.Void; const allBooleanish = members.length > 0 && members.every((member) => ((_nullishCoalesce(member.flags, () => ( 0))) & booleanishMembers) !== 0); return allBooleanish ? "nullableBoolean" : void 0; @@ -20023,24 +20564,24 @@ var JavaTranspiler = class extends BaseTranspiler { return false; } const signature = checker.getResolvedSignature(node); - return _optionalChain([signature, 'optionalAccess', _2025 => _2025.declaration]) !== void 0; + return _optionalChain([signature, 'optionalAccess', _2168 => _2168.declaration]) !== void 0; } // the boolean the printed Java of a `this.(...)` call already carries, from the // hand-written base declarations in JAVA_THIS_BOOLEAN_METHODS / the box proof in // JAVA_THIS_BOOLEAN_BOX_METHODS. undefined: not a direct boolean call, keep the wrapper. javaCallBooleanKind(node) { - if (_optionalChain([node, 'optionalAccess', _2026 => _2026.kind]) !== _ast.SyntaxKind.CallExpression) { + if (_optionalChain([node, 'optionalAccess', _2169 => _2169.kind]) !== _ast.SyntaxKind.CallExpression) { return void 0; } const callee = node.expression; - if (_optionalChain([callee, 'optionalAccess', _2027 => _2027.kind]) !== _ast.SyntaxKind.PropertyAccessExpression || _optionalChain([callee, 'access', _2028 => _2028.expression, 'optionalAccess', _2029 => _2029.kind]) !== _ast.SyntaxKind.ThisKeyword) { + if (_optionalChain([callee, 'optionalAccess', _2170 => _2170.kind]) !== _ast.SyntaxKind.PropertyAccessExpression || _optionalChain([callee, 'access', _2171 => _2171.expression, 'optionalAccess', _2172 => _2172.kind]) !== _ast.SyntaxKind.ThisKeyword) { return void 0; } const kind = this.javaBooleanValueKind(node); if (kind === void 0 || !this.javaCalleeResolves(node)) { return void 0; } - const name = _optionalChain([callee, 'access', _2030 => _2030.name, 'optionalAccess', _2031 => _2031.text]); + const name = _optionalChain([callee, 'access', _2173 => _2173.name, 'optionalAccess', _2174 => _2174.text]); if (JAVA_THIS_BOOLEAN_METHODS.has(name)) { return kind === "boolean" ? "boolean" : void 0; } @@ -20048,9 +20589,9 @@ var JavaTranspiler = class extends BaseTranspiler { if (defaultArgumentIndex === void 0) { return void 0; } - const defaultArgument = _optionalChain([node, 'access', _2032 => _2032.arguments, 'optionalAccess', _2033 => _2033[defaultArgumentIndex]]); + const defaultArgument = _optionalChain([node, 'access', _2175 => _2175.arguments, 'optionalAccess', _2176 => _2176[defaultArgumentIndex]]); const defaultIsNullish = defaultArgument === void 0 || defaultArgument.kind === _ast.SyntaxKind.NullKeyword || defaultArgument.kind === _ast.SyntaxKind.Identifier && defaultArgument.text === "undefined"; - const defaultIsBoolean = defaultIsNullish || _optionalChain([defaultArgument, 'optionalAccess', _2034 => _2034.kind]) === _ast.SyntaxKind.TrueKeyword || _optionalChain([defaultArgument, 'optionalAccess', _2035 => _2035.kind]) === _ast.SyntaxKind.FalseKeyword; + const defaultIsBoolean = defaultIsNullish || _optionalChain([defaultArgument, 'optionalAccess', _2177 => _2177.kind]) === _ast.SyntaxKind.TrueKeyword || _optionalChain([defaultArgument, 'optionalAccess', _2178 => _2178.kind]) === _ast.SyntaxKind.FalseKeyword; return defaultIsBoolean ? "nullableBoolean" : void 0; } // the printer already emits these conditions as Java `boolean` (the comparison helpers, @@ -20075,7 +20616,7 @@ var JavaTranspiler = class extends BaseTranspiler { if (type === void 0) { return false; } - if (_optionalChain([type, 'access', _2036 => _2036.getAliasSymbol, 'optionalCall', _2037 => _2037()]) !== void 0) { + if (_optionalChain([type, 'access', _2179 => _2179.getAliasSymbol, 'optionalCall', _2180 => _2180()]) !== void 0) { return false; } const flags = _nullishCoalesce(type.flags, () => ( 0)); @@ -20085,7 +20626,7 @@ var JavaTranspiler = class extends BaseTranspiler { return (flags & (_sync.TypeFlags.Boolean | _sync.TypeFlags.BooleanLiteral)) !== 0; } javaTypeOfNode(node) { - return _optionalChain([this, 'access', _2038 => _2038.checkerOrUndefined, 'call', _2039 => _2039(), 'optionalAccess', _2040 => _2040.getTypeAtLocation, 'call', _2041 => _2041(node)]); + return _optionalChain([this, 'access', _2181 => _2181.checkerOrUndefined, 'call', _2182 => _2182(), 'optionalAccess', _2183 => _2183.getTypeAtLocation, 'call', _2184 => _2184(node)]); } // the DECLARED type of a declaration, not the narrowed type at a use site: TypeScript // narrows a `const ok: boolean = true` to the literal `true` and can even reach `never` @@ -20094,7 +20635,7 @@ var JavaTranspiler = class extends BaseTranspiler { if (decl === void 0) { return void 0; } - return _optionalChain([this, 'access', _2042 => _2042.checkerOrUndefined, 'call', _2043 => _2043(), 'optionalAccess', _2044 => _2044.getTypeAtLocation, 'call', _2045 => _2045(decl)]); + return _optionalChain([this, 'access', _2185 => _2185.checkerOrUndefined, 'call', _2186 => _2186(), 'optionalAccess', _2187 => _2187.getTypeAtLocation, 'call', _2188 => _2188(decl)]); } // the printed Java of this expression is a primitive `boolean` (or Boolean box): boolean literals, // `!`, logical / comparison / `in` operators, `Array.isArray(x)` (Helpers.isArray, `public static @@ -20130,14 +20671,14 @@ var JavaTranspiler = class extends BaseTranspiler { // the TS return type is a boolean family and every `return` in the resolved declaration prints a // Java boolean or a proven Boolean-or-null box. `depth` and `seen` bound the recursion. javaCallReturnsBooleanBox(node, seen, depth) { - if (_optionalChain([node, 'optionalAccess', _2046 => _2046.kind]) !== _ast.SyntaxKind.CallExpression || depth > 2) { + if (_optionalChain([node, 'optionalAccess', _2189 => _2189.kind]) !== _ast.SyntaxKind.CallExpression || depth > 2) { return false; } const checker = this.checkerOrUndefined(); if (checker === void 0) { return false; } - const declaration = _optionalChain([checker, 'access', _2047 => _2047.getResolvedSignature, 'call', _2048 => _2048(node), 'optionalAccess', _2049 => _2049.declaration, 'optionalAccess', _2050 => _2050.resolve, 'call', _2051 => _2051()]); + const declaration = _optionalChain([checker, 'access', _2190 => _2190.getResolvedSignature, 'call', _2191 => _2191(node), 'optionalAccess', _2192 => _2192.declaration, 'optionalAccess', _2193 => _2193.resolve, 'call', _2194 => _2194()]); if (declaration === void 0 || declaration.kind !== _ast.SyntaxKind.MethodDeclaration || declaration.body === void 0 || seen.has(declaration)) { return false; } @@ -20160,7 +20701,7 @@ var JavaTranspiler = class extends BaseTranspiler { if (!ok) { return; } - if (current !== declaration && _chunk4FDYB2TTcjs.isFunctionLike.call(void 0, current)) { + if (current !== declaration && _chunkUBXMRIM6cjs.isFunctionLike.call(void 0, current)) { return; } if (_is.isReturnStatement.call(void 0, current)) { @@ -20198,7 +20739,7 @@ var JavaTranspiler = class extends BaseTranspiler { // `s.startsWith(x)` / `s.endsWith(x)` on a checker-proven string receiver prints // `((String)s).startsWith(..)`, a primitive boolean (String.startsWith/endsWith) javaStringAffixCall(node) { - if (_optionalChain([node, 'optionalAccess', _2052 => _2052.kind]) !== _ast.SyntaxKind.CallExpression || (_nullishCoalesce(_optionalChain([node, 'access', _2053 => _2053.arguments, 'optionalAccess', _2054 => _2054.length]), () => ( 0))) !== 1) { + if (_optionalChain([node, 'optionalAccess', _2195 => _2195.kind]) !== _ast.SyntaxKind.CallExpression || (_nullishCoalesce(_optionalChain([node, 'access', _2196 => _2196.arguments, 'optionalAccess', _2197 => _2197.length]), () => ( 0))) !== 1) { return false; } const callee = node.expression; @@ -20220,7 +20761,7 @@ var JavaTranspiler = class extends BaseTranspiler { return false; } const callee = node.expression; - return _is.isPropertyAccessExpression.call(void 0, callee) && String(callee.name.text) === "isArray" && callee.expression.kind === _ast.SyntaxKind.Identifier && String(callee.expression.text) === "Array" && (_nullishCoalesce(_optionalChain([node, 'access', _2055 => _2055.arguments, 'optionalAccess', _2056 => _2056.length]), () => ( 0))) === 1; + return _is.isPropertyAccessExpression.call(void 0, callee) && String(callee.name.text) === "isArray" && callee.expression.kind === _ast.SyntaxKind.Identifier && String(callee.expression.text) === "Array" && (_nullishCoalesce(_optionalChain([node, 'access', _2198 => _2198.arguments, 'optionalAccess', _2199 => _2199.length]), () => ( 0))) === 1; } // `this.` read of a hand-written base field declared `boolean`, or undefined. The // TsChecker guard keeps a field the hand-written base declares Object (or String) out. @@ -20232,7 +20773,7 @@ var JavaTranspiler = class extends BaseTranspiler { if (!JAVA_BOOLEAN_BASE_FIELDS.has(printed)) { return void 0; } - const declaration = _optionalChain([this, 'access', _2057 => _2057.checkerOrUndefined, 'call', _2058 => _2058(), 'access', _2059 => _2059.getSymbolAtLocation, 'call', _2060 => _2060(node.name), 'optionalAccess', _2061 => _2061.valueDeclaration, 'optionalAccess', _2062 => _2062.resolve, 'call', _2063 => _2063()]); + const declaration = _optionalChain([this, 'access', _2200 => _2200.checkerOrUndefined, 'call', _2201 => _2201(), 'access', _2202 => _2202.getSymbolAtLocation, 'call', _2203 => _2203(node.name), 'optionalAccess', _2204 => _2204.valueDeclaration, 'optionalAccess', _2205 => _2205.resolve, 'call', _2206 => _2206()]); const type = _nullishCoalesce(this.javaTypeOfDeclaration(declaration), () => ( this.javaTypeOfNode(node))); return this.javaBooleanBoxType(type) ? printed : void 0; } @@ -20240,7 +20781,7 @@ var JavaTranspiler = class extends BaseTranspiler { // IS `Boolean.TRUE.equals(x)`. Proof: the TS type (`boolean`, never `any`/`undefined`-able) plus // the D2 write scan: every write in the enclosing function must print a Java boolean value. javaBooleanBoxIdentifier(node, seen) { - if (_optionalChain([node, 'optionalAccess', _2064 => _2064.kind]) !== _ast.SyntaxKind.Identifier || seen.has(node)) { + if (_optionalChain([node, 'optionalAccess', _2207 => _2207.kind]) !== _ast.SyntaxKind.Identifier || seen.has(node)) { return void 0; } const checker = this.checkerOrUndefined(); @@ -20248,7 +20789,7 @@ var JavaTranspiler = class extends BaseTranspiler { return void 0; } const symbol = checker.getSymbolAtLocation(node); - const decl = _optionalChain([symbol, 'optionalAccess', _2065 => _2065.valueDeclaration, 'optionalAccess', _2066 => _2066.resolve, 'call', _2067 => _2067()]); + const decl = _optionalChain([symbol, 'optionalAccess', _2208 => _2208.valueDeclaration, 'optionalAccess', _2209 => _2209.resolve, 'call', _2210 => _2210()]); if (decl === void 0) { return void 0; } @@ -20281,7 +20822,7 @@ var JavaTranspiler = class extends BaseTranspiler { // identifier write must pass `accepts`; `tuples` also checks `[ x, params ] = ...` destructures javaWritesAreBoxed(symbol, decl, next, accepts, tuples) { let fn = decl.parent; - while (fn !== void 0 && !_chunk4FDYB2TTcjs.isFunctionLike.call(void 0, fn)) { + while (fn !== void 0 && !_chunkUBXMRIM6cjs.isFunctionLike.call(void 0, fn)) { fn = fn.parent; } if (fn === void 0) { @@ -20327,7 +20868,7 @@ var JavaTranspiler = class extends BaseTranspiler { // primitive, so the identifier IS the condition; `Boolean` is the nullable box (isTrue = equals). javaDeclaredBooleanKind(node) { const declaration = this.javaDeclarationOfIdentifier(node); - if (declaration === void 0 || node.text !== _optionalChain([declaration, 'access', _2068 => _2068.name, 'optionalAccess', _2069 => _2069.text])) { + if (declaration === void 0 || node.text !== _optionalChain([declaration, 'access', _2211 => _2211.name, 'optionalAccess', _2212 => _2212.text])) { return void 0; } let declared; @@ -20342,7 +20883,7 @@ var JavaTranspiler = class extends BaseTranspiler { // equivalent union. Every member must be boolean or nullish - an `Int`/`Str`/`any` member can // hold a box the isTrue helper tests with its runtime truthiness, so the helper must stay. javaNullableBooleanDeclaration(declaration) { - if (_optionalChain([declaration, 'optionalAccess', _2070 => _2070.kind]) !== _ast.SyntaxKind.VariableDeclaration) { + if (_optionalChain([declaration, 'optionalAccess', _2213 => _2213.kind]) !== _ast.SyntaxKind.VariableDeclaration) { return false; } const type = this.javaTypeOfDeclaration(declaration); @@ -20359,12 +20900,12 @@ var JavaTranspiler = class extends BaseTranspiler { if ((flags & _sync.TypeFlags.Union) === 0) { return false; } - const members = _nullishCoalesce(_optionalChain([type, 'access', _2071 => _2071.getTypes, 'optionalCall', _2072 => _2072()]), () => ( [])); + const members = _nullishCoalesce(_optionalChain([type, 'access', _2214 => _2214.getTypes, 'optionalCall', _2215 => _2215()]), () => ( [])); if (members.length === 0) { return false; } - const booleanish = (member) => ((_nullishCoalesce(_optionalChain([member, 'optionalAccess', _2073 => _2073.flags]), () => ( 0))) & JAVA_NULLABLE_BOOLEAN_MEMBER_FLAGS) !== 0; - const hasBoolean = members.some((member) => ((_nullishCoalesce(_optionalChain([member, 'optionalAccess', _2074 => _2074.flags]), () => ( 0))) & (_sync.TypeFlags.Boolean | _sync.TypeFlags.BooleanLiteral)) !== 0); + const booleanish = (member) => ((_nullishCoalesce(_optionalChain([member, 'optionalAccess', _2216 => _2216.flags]), () => ( 0))) & JAVA_NULLABLE_BOOLEAN_MEMBER_FLAGS) !== 0; + const hasBoolean = members.some((member) => ((_nullishCoalesce(_optionalChain([member, 'optionalAccess', _2217 => _2217.flags]), () => ( 0))) & (_sync.TypeFlags.Boolean | _sync.TypeFlags.BooleanLiteral)) !== 0); return hasBoolean && members.every(booleanish); } // a value the nullable-boolean write scan accepts: a Java boolean value this printer proves, a @@ -20401,7 +20942,7 @@ var JavaTranspiler = class extends BaseTranspiler { // box: those accessors return a safeBool result, never the raw member when not a Boolean. The // handleOptionAndParams family returns the raw member and is deliberately not a box proof. javaBooleanBoxTupleElement(node, index) { - if (_optionalChain([node, 'optionalAccess', _2075 => _2075.kind]) !== _ast.SyntaxKind.CallExpression) { + if (_optionalChain([node, 'optionalAccess', _2218 => _2218.kind]) !== _ast.SyntaxKind.CallExpression) { return false; } const callee = node.expression; @@ -20412,8 +20953,8 @@ var JavaTranspiler = class extends BaseTranspiler { if (!JAVA_BOOLEAN_BOX_TUPLE_METHODS.has(name)) { return false; } - const declaration = _optionalChain([this, 'access', _2076 => _2076.getChecker, 'call', _2077 => _2077(), 'access', _2078 => _2078.getResolvedSignature, 'call', _2079 => _2079(node), 'optionalAccess', _2080 => _2080.declaration, 'optionalAccess', _2081 => _2081.resolve, 'call', _2082 => _2082()]); - if (_optionalChain([declaration, 'optionalAccess', _2083 => _2083.name, 'optionalAccess', _2084 => _2084.text]) !== name) { + const declaration = _optionalChain([this, 'access', _2219 => _2219.getChecker, 'call', _2220 => _2220(), 'access', _2221 => _2221.getResolvedSignature, 'call', _2222 => _2222(node), 'optionalAccess', _2223 => _2223.declaration, 'optionalAccess', _2224 => _2224.resolve, 'call', _2225 => _2225()]); + if (_optionalChain([declaration, 'optionalAccess', _2226 => _2226.name, 'optionalAccess', _2227 => _2227.text]) !== name) { return false; } return index === 0; @@ -20421,7 +20962,7 @@ var JavaTranspiler = class extends BaseTranspiler { // `const [ x, p ] = this.handle*Bool (...)` binds x to element 0, a Boolean-or-null box; any // later identifier or tuple write must also be a proven box (the D2 scan over the function) javaBooleanTupleBindingIdentifier(node, seen = /* @__PURE__ */ new Set()) { - if (_optionalChain([node, 'optionalAccess', _2085 => _2085.kind]) !== _ast.SyntaxKind.Identifier) { + if (_optionalChain([node, 'optionalAccess', _2228 => _2228.kind]) !== _ast.SyntaxKind.Identifier) { return void 0; } const checker = this.checkerOrUndefined(); @@ -20429,13 +20970,13 @@ var JavaTranspiler = class extends BaseTranspiler { return void 0; } const symbol = checker.getSymbolAtLocation(node); - const element = _optionalChain([symbol, 'optionalAccess', _2086 => _2086.valueDeclaration, 'optionalAccess', _2087 => _2087.resolve, 'call', _2088 => _2088()]); - if (element === void 0 || element.kind !== _ast.SyntaxKind.BindingElement || element.initializer !== void 0 || element.dotDotDotToken !== void 0 || _optionalChain([element, 'access', _2089 => _2089.name, 'optionalAccess', _2090 => _2090.text]) !== node.text || seen.has(element)) { + const element = _optionalChain([symbol, 'optionalAccess', _2229 => _2229.valueDeclaration, 'optionalAccess', _2230 => _2230.resolve, 'call', _2231 => _2231()]); + if (element === void 0 || element.kind !== _ast.SyntaxKind.BindingElement || element.initializer !== void 0 || element.dotDotDotToken !== void 0 || _optionalChain([element, 'access', _2232 => _2232.name, 'optionalAccess', _2233 => _2233.text]) !== node.text || seen.has(element)) { return void 0; } const pattern = element.parent; - const declaration = _optionalChain([pattern, 'optionalAccess', _2091 => _2091.parent]); - if (_optionalChain([pattern, 'optionalAccess', _2092 => _2092.kind]) !== _ast.SyntaxKind.ArrayBindingPattern || _optionalChain([declaration, 'optionalAccess', _2093 => _2093.kind]) !== _ast.SyntaxKind.VariableDeclaration || !this.javaBooleanBoxTupleElement(declaration.initializer, pattern.elements.indexOf(element))) { + const declaration = _optionalChain([pattern, 'optionalAccess', _2234 => _2234.parent]); + if (_optionalChain([pattern, 'optionalAccess', _2235 => _2235.kind]) !== _ast.SyntaxKind.ArrayBindingPattern || _optionalChain([declaration, 'optionalAccess', _2236 => _2236.kind]) !== _ast.SyntaxKind.VariableDeclaration || !this.javaBooleanBoxTupleElement(declaration.initializer, pattern.elements.indexOf(element))) { return void 0; } const next = new Set(seen); @@ -20458,7 +20999,7 @@ var JavaTranspiler = class extends BaseTranspiler { // proven Boolean-or-null box: `Boolean.TRUE.equals(x)` is exactly what the helper answers on // such a box (null and FALSE test false, TRUE tests true) javaNullableBooleanBoxIdentifier(node, seen = /* @__PURE__ */ new Set()) { - if (_optionalChain([node, 'optionalAccess', _2094 => _2094.kind]) !== _ast.SyntaxKind.Identifier) { + if (_optionalChain([node, 'optionalAccess', _2237 => _2237.kind]) !== _ast.SyntaxKind.Identifier) { return void 0; } const checker = this.checkerOrUndefined(); @@ -20466,8 +21007,8 @@ var JavaTranspiler = class extends BaseTranspiler { return void 0; } const symbol = checker.getSymbolAtLocation(node); - const declaration = _optionalChain([symbol, 'optionalAccess', _2095 => _2095.valueDeclaration, 'optionalAccess', _2096 => _2096.resolve, 'call', _2097 => _2097()]); - if (declaration === void 0 || _optionalChain([declaration, 'access', _2098 => _2098.name, 'optionalAccess', _2099 => _2099.text]) !== node.text) { + const declaration = _optionalChain([symbol, 'optionalAccess', _2238 => _2238.valueDeclaration, 'optionalAccess', _2239 => _2239.resolve, 'call', _2240 => _2240()]); + if (declaration === void 0 || _optionalChain([declaration, 'access', _2241 => _2241.name, 'optionalAccess', _2242 => _2242.text]) !== node.text) { return void 0; } if (seen.has(declaration)) { @@ -20558,7 +21099,7 @@ var JavaTranspiler = class extends BaseTranspiler { } if (node.expression.kind === _ast.SyntaxKind.NewExpression) { const expression = node.expression; - const argumentsExp = _nullishCoalesce(_optionalChain([expression, 'optionalAccess', _2100 => _2100.arguments]), () => ( [])); + const argumentsExp = _nullishCoalesce(_optionalChain([expression, 'optionalAccess', _2243 => _2243.arguments]), () => ( [])); const parsedArg = _nullishCoalesce(argumentsExp.map((n) => this.printNode(n, 0)).join(","), () => ( "")); const newExpression = this.printNode(expression.expression, 0); if (expression.expression.kind === _ast.SyntaxKind.Identifier) { @@ -20566,7 +21107,7 @@ var JavaTranspiler = class extends BaseTranspiler { const exceptionName = id.text === "Error" ? "RuntimeException" : id.text; const symbol = this.getChecker().getSymbolAtLocation(expression.expression); if (symbol) { - const declarations = (_nullishCoalesce(_optionalChain([this, 'access', _2101 => _2101.getChecker, 'call', _2102 => _2102(), 'access', _2103 => _2103.getDeclaredTypeOfSymbol, 'call', _2104 => _2104(symbol), 'access', _2105 => _2105.getSymbol, 'call', _2106 => _2106(), 'optionalAccess', _2107 => _2107.declarations]), () => ( []))).map((d) => d.resolve()); + const declarations = (_nullishCoalesce(_optionalChain([this, 'access', _2244 => _2244.getChecker, 'call', _2245 => _2245(), 'access', _2246 => _2246.getDeclaredTypeOfSymbol, 'call', _2247 => _2247(symbol), 'access', _2248 => _2248.getSymbol, 'call', _2249 => _2249(), 'optionalAccess', _2250 => _2250.declarations]), () => ( []))).map((d) => d.resolve()); const isClassDeclaration5 = declarations.find( (l) => l.kind === _ast.SyntaxKind.InterfaceDeclaration || l.kind === _ast.SyntaxKind.ClassDeclaration ); @@ -20697,18 +21238,530 @@ var JavaTranspiler = class extends BaseTranspiler { } return false; } -}; - -// src/rustTranspiler.ts -_chunk4FDYB2TTcjs.init_cjs_shims.call(void 0, ); - - - -var parserConfig6 = { - "ELSEIF_TOKEN": "else if", - "OBJECT_OPENING": "{", - "OBJECT_CLOSING": "}", - "ARRAY_OPENING_TOKEN": "Value::from(vec![", + // hx4 J01: `m[k] = v` on a local the printer declared `Map` whose every write is a + // provably non-concurrent map (fresh literal/extend/omit, or a base safeDict* of non-field data): + // the helper's map branch is then `m.put(k, v)` (null value included; its CHM removal never applies) + javaHx4MapPutIsNative(baseExpr, keys) { + if (keys.length !== 1 || baseExpr === void 0 || !_is.isIdentifier.call(void 0, baseExpr) || !this.javaDeclaredMapReceiver(baseExpr)) { + return false; + } + const key = keys[0]; + if (!_is.isStringLiteralLikeNode.call(void 0, key) && !this.javaDeclaredStringType(key) && !this.isJavaStringType(this.getChecker().getTypeAtLocation(key))) { + return false; + } + const declaration = this.javaDeclarationOfIdentifier(baseExpr); + if (declaration === void 0 || declaration.kind !== _ast.SyntaxKind.VariableDeclaration || !declaration.initializer) { + return false; + } + const admits = (rhs) => this.javaHx4PlainMapSource(baseExpr, rhs); + return admits(declaration.initializer) && !this.javaLocalIsReassigned(baseExpr, admits); + } + javaHx4PlainMapSource(container, value) { + const node = this.unwrapPrintTransparentExpression(value); + if (node === void 0) { + return false; + } + if (this.javaFreshHashMapValue(container, node)) { + return true; + } + if (!_is.isCallExpression.call(void 0, node) || !_is.isPropertyAccessExpression.call(void 0, node.expression) || node.expression.expression.kind !== _ast.SyntaxKind.ThisKeyword) { + return false; + } + const name = node.expression.name.text; + const fileName = _optionalChain([this, 'access', _2251 => _2251.checkerOrUndefined, 'call', _2252 => _2252(), 'optionalAccess', _2253 => _2253.getResolvedSignature, 'call', _2254 => _2254(node), 'optionalAccess', _2255 => _2255.declaration, 'optionalAccess', _2256 => _2256.resolve, 'call', _2257 => _2257(), 'optionalAccess', _2258 => _2258.getSourceFile, 'optionalCall', _2259 => _2259(), 'optionalAccess', _2260 => _2260.fileName]); + if (typeof fileName !== "string" || !JAVA_FRESH_EXTEND_FILE.test(fileName)) { + return false; + } + if (name === "extend" || name === "deepExtend" || name === "omit") { + return true; + } + if (name === "safeDict" || name === "safeDict2" || name === "safeDictN") { + return node.arguments.length > 0 && this.javaHx4NonSharedSource(node.arguments[0], 0) && (node.arguments.length < (name === "safeDict2" ? 4 : 3) || this.javaHx4DefaultIsPlain(node.arguments[node.arguments.length - 1])); + } + return false; + } + javaHx4DefaultIsPlain(value) { + const node = this.unwrapPrintTransparentExpression(value); + return node !== void 0 && (_is.isObjectLiteralExpression.call(void 0, node) || node.kind === _ast.SyntaxKind.UndefinedKeyword || _is.isIdentifier.call(void 0, node) && node.text === "undefined" || node.kind === _ast.SyntaxKind.NullKeyword); + } + // data that can not hold one of the runtime's ConcurrentHashMaps (this. top level, ws client + // futures/subscriptions/rejections and their entries): a local/param/element chain not rooted at them + javaHx4NonSharedSource(value, depth) { + const node = this.unwrapPrintTransparentExpression(value); + if (node === void 0 || depth > 40) { + return false; + } + if (_is.isElementAccessExpression.call(void 0, node)) { + return this.javaHx4NonSharedSource(node.expression, depth + 1); + } + if (!_is.isIdentifier.call(void 0, node)) { + return false; + } + const declaration = this.javaDeclarationOfIdentifier(node); + if (declaration === void 0) { + return false; + } + if (declaration.kind === _ast.SyntaxKind.Parameter) { + const type = this.getChecker().getTypeAtLocation(node); + const text = (_nullishCoalesce(_optionalChain([type, 'optionalAccess', _2261 => _2261.getSymbol, 'optionalCall', _2262 => _2262(), 'optionalAccess', _2263 => _2263.escapedName]), () => ( ""))) + ""; + return !/Client/.test(text) && !/^(client|subscriptions|futures|rejections)$/.test(node.text); + } + const known = this.javaHx4SourceVerdicts.get(declaration); + if (known !== void 0) { + return known; + } + this.javaHx4SourceVerdicts.set(declaration, true); + this.javaHx4InProgress.add(declaration); + const writes = declaration.initializer ? [declaration.initializer] : []; + const verdict = !this.javaLocalIsReassigned(node, (rhs) => { + writes.push(rhs); + return true; + }) && writes.every((w) => this.javaHx4NonSharedValue(w, depth + 1)); + this.javaHx4InProgress.delete(declaration); + if (verdict && this.javaHx4InProgress.size > 0) { + this.javaHx4SourceVerdicts.delete(declaration); + } else { + this.javaHx4SourceVerdicts.set(declaration, verdict); + } + return verdict; + } + // a value expression that never reads a field map or a ws client's maps + javaHx4NonSharedValue(value, depth) { + let shared = false; + const walk = (n) => { + if (shared || n === void 0) { + return; + } + if (_is.isPropertyAccessExpression.call(void 0, n)) { + const called = n.parent !== void 0 && _is.isCallExpression.call(void 0, n.parent) && n.parent.expression === n; + if (!called && (n.expression.kind === _ast.SyntaxKind.ThisKeyword || /^(subscriptions|futures|rejections|hashmap)$/.test(n.name.text)) || called && n.name.text === "createSafeDictionary") { + shared = true; + return; + } + } + if (n.kind === _ast.SyntaxKind.ThisKeyword && !(n.parent !== void 0 && _is.isPropertyAccessExpression.call(void 0, n.parent))) { + shared = true; + return; + } + if (_is.isIdentifier.call(void 0, n) && n !== value && !(n.parent !== void 0 && _is.isPropertyAccessExpression.call(void 0, n.parent) && n.parent.name === n)) { + const declaration = this.javaDeclarationOfIdentifier(n); + if (declaration !== void 0 && !this.javaHx4NonSharedSource(n, depth + 1)) { + shared = true; + return; + } + } + n.forEachChild(walk); + }; + walk(value); + return !shared; + } + // hx4 J02: `this.[k]` on the J02 base map fields. ConcurrentHashMap.get(null) throws + // where the helper answers null, so a non-literal key is always null-tested; the receiver can + // be null too. Key and receiver print twice, so both must be side-effect free. + javaJ02FieldMapReadText(receiver, key) { + const name = _optionalChain([receiver, 'optionalAccess', _2264 => _2264.name, 'optionalAccess', _2265 => _2265.text]); + if (typeof name !== "string" || !Object.prototype.hasOwnProperty.call(JAVA_J02_MAP_FIELDS, name)) { + return void 0; + } + const literal = _is.isStringLiteralLikeNode.call(void 0, key); + if (!literal && !this.javaRepeatableOperand(key)) { + return void 0; + } + const target = this.printNode(receiver, 0); + const keyText = this.printNode(key, 0); + const keyGuard = literal ? "" : `${keyText} == null || `; + return `(${keyGuard}${target} == null ? null : ((java.util.Map)${target}).get(${keyText}))`; + } + // hx4 J05 + // `(a % N) M` (N a non-zero integer literal, a an int/long operand, M an int literal): the + // native mod prints a finite integral double |v| < |N|, where isEqual (IsInteger -> toLong) and + // isGreaterThan (toDouble) both reduce to the plain double comparison against M. + javaHx4J05IntegralModOperand(node) { + while (node !== void 0 && node.kind === _ast.SyntaxKind.ParenthesizedExpression) { + node = node.expression; + } + if (node === void 0 || !_is.isBinaryExpression.call(void 0, node) || node.operatorToken.kind !== _ast.SyntaxKind.PercentToken) { + return false; + } + if (this.javaScalarFamily(node.left) !== "number" || this.javaScalarFamily(node.right) !== "number") { + return false; + } + const leftKind = this.javaProvableNumericKind(node.left); + if (leftKind !== "int" && leftKind !== "long" && !this.javaProvableCounterInt(node.left)) { + return false; + } + const divisor = node.right; + if (this.javaIntegerLiteralKind(divisor) !== "int" || Number(divisor.text) === 0) { + return false; + } + return true; + } + printHx4J05ModComparison(left, right, op) { + const javaOps = { + [_ast.SyntaxKind.EqualsEqualsToken]: "==", + [_ast.SyntaxKind.EqualsEqualsEqualsToken]: "==", + [_ast.SyntaxKind.ExclamationEqualsToken]: "!=", + [_ast.SyntaxKind.ExclamationEqualsEqualsToken]: "!=", + [_ast.SyntaxKind.LessThanToken]: "<", + [_ast.SyntaxKind.LessThanEqualsToken]: "<=", + [_ast.SyntaxKind.GreaterThanToken]: ">", + [_ast.SyntaxKind.GreaterThanEqualsToken]: ">=" + }; + const javaOp = javaOps[op]; + if (javaOp === void 0) { + return void 0; + } + const modLeft = this.javaHx4J05IntegralModOperand(left); + const modRight = !modLeft && this.javaHx4J05IntegralModOperand(right); + if (!modLeft && !modRight) { + return void 0; + } + if (this.javaEqualityLiteralKind(modLeft ? right : left) !== "int") { + return void 0; + } + const leftText = this.printNode(left, 0); + const rightText = this.printNode(right, 0); + if (!/^\(+double\) /.test(modLeft ? leftText : rightText)) { + return void 0; + } + return `(${leftText} ${javaOp} ${rightText})`; + } + // hx4 J06 + // `x.indexOf(t)` where a string/Str-declared x is narrowed to a union of string literals + // (`===` tests): x is a non-null String, so String.indexOf is the helper's String arm + javaHx4J06NarrowedIndexOf(node, name, parsedArg) { + const receiver = _optionalChain([node, 'optionalAccess', _2266 => _2266.expression, 'optionalAccess', _2267 => _2267.expression]); + const arg = _optionalChain([node, 'optionalAccess', _2268 => _2268.arguments, 'optionalAccess', _2269 => _2269[0]]); + if (receiver === void 0 || arg === void 0 || name === void 0 || parsedArg === void 0 || !_is.isIdentifier.call(void 0, receiver) || this.isVarargsArrayReference(receiver)) { + return void 0; + } + let receiverType; + try { + receiverType = this.getChecker().getTypeAtLocation(receiver); + } catch (e) { + return void 0; + } + if (receiverType === void 0 || (receiverType.flags & _sync.TypeFlags.Union) === 0 || !receiverType.getTypes().every((member) => this.isStringType(member.flags))) { + return void 0; + } + const symbol = this.getChecker().getSymbolAtLocation(receiver); + const declaration = _nullishCoalesce(_optionalChain([symbol, 'optionalAccess', _2270 => _2270.valueDeclaration, 'optionalAccess', _2271 => _2271.resolve, 'optionalCall', _2272 => _2272()]), () => ( _optionalChain([symbol, 'optionalAccess', _2273 => _2273.valueDeclaration]))); + let declared; + try { + declared = _optionalChain([declaration, 'optionalAccess', _2274 => _2274.name]) === void 0 ? void 0 : this.getChecker().getTypeAtLocation(declaration.name); + } catch (e) { + declared = void 0; + } + const declaredMembers = declared === void 0 ? [] : (declared.flags & _sync.TypeFlags.Union) !== 0 ? declared.getTypes() : [declared]; + if (!declaredMembers.some((member) => member.flags === _sync.TypeFlags.String)) { + return void 0; + } + if (this.javaProvableString(arg)) { + return `((String)${name}).indexOf(${parsedArg})`; + } + return void 0; + } +}; +var JAVA_J02_MAP_FIELDS = { + "tickers": true, + "bidsasks": true, + "trades": true, + "fees": true, + "urls": true, + "markets_by_id": true +}; +var HX4_J09_SYNC_BASE_CALLS = /* @__PURE__ */ new Set([ + "safeString", + "safeString2", + "safeStringN", + "safeValue", + "safeDict", + "safeInteger", + "json", + "throwExactlyMatchedException", + "throwBroadlyMatchedException" +]); +JavaTranspiler.prototype.hx4J09CcxtErrorClass = function(node) { + const checker = this.checkerOrUndefined(); + let symbol; + try { + symbol = _optionalChain([checker, 'optionalAccess', _2275 => _2275.getSymbolAtLocation, 'call', _2276 => _2276(node)]); + if (symbol !== void 0 && symbol.flags & _sync.SymbolFlags.Alias) { + symbol = checker.getAliasedSymbol(symbol); + } + } catch (e) { + return false; + } + const declaration = _optionalChain([symbol, 'optionalAccess', _2277 => _2277.declarations, 'optionalAccess', _2278 => _2278[0], 'optionalAccess', _2279 => _2279.resolve, 'call', _2280 => _2280()]); + return _optionalChain([declaration, 'optionalAccess', _2281 => _2281.kind]) === _ast.SyntaxKind.ClassDeclaration && /(^|[\\/])ts[\\/]src[\\/]base[\\/]errors\.ts$/.test(_nullishCoalesce(_optionalChain([declaration, 'access', _2282 => _2282.getSourceFile, 'optionalCall', _2283 => _2283(), 'optionalAccess', _2284 => _2284.fileName]), () => ( ""))); +}; +JavaTranspiler.prototype.hx4J09BoxIdentifier = function(node, seen, depth) { + const checker = this.checkerOrUndefined(); + if (checker === void 0 || _optionalChain([node, 'optionalAccess', _2285 => _2285.kind]) !== _ast.SyntaxKind.Identifier || depth > 6) { + return false; + } + const symbol = checker.getSymbolAtLocation(node); + const decl = _optionalChain([symbol, 'optionalAccess', _2286 => _2286.valueDeclaration, 'optionalAccess', _2287 => _2287.resolve, 'call', _2288 => _2288()]); + if (decl === void 0 || _optionalChain([decl, 'access', _2289 => _2289.name, 'optionalAccess', _2290 => _2290.text]) !== node.text) { + return false; + } + if (seen.has(decl)) { + return true; + } + const next = new Set(seen); + next.add(decl); + const accepts = (value) => this.hx4J09BoxValue(value, next, depth + 1); + if (decl.kind === _ast.SyntaxKind.BindingElement) { + const pattern = decl.parent; + const declaration = _optionalChain([pattern, 'optionalAccess', _2291 => _2291.parent]); + if (decl.initializer !== void 0 || decl.dotDotDotToken !== void 0 || _optionalChain([pattern, 'optionalAccess', _2292 => _2292.kind]) !== _ast.SyntaxKind.ArrayBindingPattern || _optionalChain([declaration, 'optionalAccess', _2293 => _2293.kind]) !== _ast.SyntaxKind.VariableDeclaration) { + return false; + } + const index = pattern.elements.indexOf(decl); + if (!this.javaBooleanBoxTupleElement(declaration.initializer, index) && !this.hx4J09LiteralTupleElement(declaration.initializer, index)) { + return false; + } + return this.javaWritesAreBoxed(symbol, { initializer: void 0, parent: declaration }, next, accepts, true); + } + if (decl.kind !== _ast.SyntaxKind.VariableDeclaration) { + return false; + } + let type; + try { + type = this.javaTypeOfDeclaration(decl); + } catch (e) { + return false; + } + if (!this.javaBooleanBoxType(type) && !this.javaNullableBooleanDeclaration(decl)) { + return false; + } + return this.javaWritesAreBoxed(symbol, decl, next, accepts, true); +}; +JavaTranspiler.prototype.hx4J09BoxValue = function(node, seen, depth) { + if (node === void 0) { + return false; + } + if (node.kind === _ast.SyntaxKind.ParenthesizedExpression || node.kind === _ast.SyntaxKind.AsExpression || node.kind === _ast.SyntaxKind.NonNullExpression) { + return this.hx4J09BoxValue(node.expression, seen, depth); + } + if (node.kind === _ast.SyntaxKind.NullKeyword || node.kind === _ast.SyntaxKind.Identifier && node.text === "undefined") { + return true; + } + if (node.kind === _ast.SyntaxKind.ConditionalExpression) { + return this.hx4J09BoxValue(node.whenTrue, seen, depth) && this.hx4J09BoxValue(node.whenFalse, seen, depth); + } + if (node.kind === _ast.SyntaxKind.Identifier) { + return this.hx4J09BoxIdentifier(node, seen, depth); + } + if (this.javaPrintsBooleanValue(node, /* @__PURE__ */ new Set())) { + return true; + } + if (node.kind !== _ast.SyntaxKind.CallExpression) { + return false; + } + if (this.javaCallBooleanKind(node) !== void 0) { + return true; + } + const callee = node.expression; + if (!_is.isPropertyAccessExpression.call(void 0, callee) || callee.expression.kind !== _ast.SyntaxKind.ThisKeyword) { + return false; + } + const at = JAVA_THIS_BOOLEAN_BOX_METHODS[String(callee.name.text)]; + if (at === void 0 || this.javaBooleanValueKind(node) === void 0 || !this.javaCalleeResolves(node)) { + return false; + } + const declaration = _optionalChain([this, 'access', _2294 => _2294.getChecker, 'call', _2295 => _2295(), 'access', _2296 => _2296.getResolvedSignature, 'call', _2297 => _2297(node), 'optionalAccess', _2298 => _2298.declaration, 'optionalAccess', _2299 => _2299.resolve, 'call', _2300 => _2300()]); + if (_optionalChain([declaration, 'optionalAccess', _2301 => _2301.name, 'optionalAccess', _2302 => _2302.text]) !== callee.name.text || !JAVA_THIS_RETURN_TYPES_BASE_FILE.test(_nullishCoalesce(_optionalChain([declaration, 'access', _2303 => _2303.getSourceFile, 'optionalCall', _2304 => _2304(), 'optionalAccess', _2305 => _2305.fileName]), () => ( "")))) { + return false; + } + const fallback = _optionalChain([node, 'access', _2306 => _2306.arguments, 'optionalAccess', _2307 => _2307[at]]); + return fallback !== void 0 && this.hx4J09BoxValue(fallback, seen, depth); +}; +JavaTranspiler.prototype.hx4J09LiteralTupleElement = function(node, index) { + if (_optionalChain([node, 'optionalAccess', _2308 => _2308.kind]) !== _ast.SyntaxKind.CallExpression || index < 0) { + return false; + } + const callee = node.expression; + if (!_is.isPropertyAccessExpression.call(void 0, callee) || callee.expression.kind !== _ast.SyntaxKind.ThisKeyword) { + return false; + } + let declaration; + try { + declaration = _optionalChain([this, 'access', _2309 => _2309.getChecker, 'call', _2310 => _2310(), 'access', _2311 => _2311.getResolvedSignature, 'call', _2312 => _2312(node), 'optionalAccess', _2313 => _2313.declaration, 'optionalAccess', _2314 => _2314.resolve, 'call', _2315 => _2315()]); + } catch (e) { + return false; + } + if (_optionalChain([declaration, 'optionalAccess', _2316 => _2316.kind]) !== _ast.SyntaxKind.MethodDeclaration || declaration.body === void 0 || _optionalChain([declaration, 'access', _2317 => _2317.name, 'optionalAccess', _2318 => _2318.text]) !== callee.name.text || !JAVA_THIS_RETURN_TYPES_BASE_FILE.test(_nullishCoalesce(_optionalChain([declaration, 'access', _2319 => _2319.getSourceFile, 'optionalCall', _2320 => _2320(), 'optionalAccess', _2321 => _2321.fileName]), () => ( "")))) { + return false; + } + let returns = 0; + let ok = true; + const scan = (current) => { + if (!ok || current !== declaration && _chunkUBXMRIM6cjs.isFunctionLike.call(void 0, current)) { + return; + } + if (_is.isReturnStatement.call(void 0, current)) { + returns++; + const value = current.expression; + if (value === void 0 || !_is.isArrayLiteralExpression.call(void 0, value) || !this.javaPrintsBooleanValue(value.elements[index], /* @__PURE__ */ new Set())) { + ok = false; + return; + } + } + current.forEachChild(scan); + }; + scan(declaration.body); + return ok && returns > 0; +}; +JavaTranspiler.prototype.hx4J09CatchCannotWrap = function(node) { + if (_optionalChain([node, 'optionalAccess', _2322 => _2322.kind]) !== _ast.SyntaxKind.Identifier) { + return false; + } + const checker = this.checkerOrUndefined(); + const decl = _optionalChain([checker, 'optionalAccess', _2323 => _2323.getSymbolAtLocation, 'call', _2324 => _2324(node), 'optionalAccess', _2325 => _2325.valueDeclaration, 'optionalAccess', _2326 => _2326.resolve, 'call', _2327 => _2327()]); + const clause = _optionalChain([decl, 'optionalAccess', _2328 => _2328.parent]); + const tryStatement = _optionalChain([clause, 'optionalAccess', _2329 => _2329.parent]); + if (_optionalChain([decl, 'optionalAccess', _2330 => _2330.kind]) !== _ast.SyntaxKind.VariableDeclaration || _optionalChain([clause, 'optionalAccess', _2331 => _2331.kind]) !== _ast.SyntaxKind.CatchClause || _optionalChain([tryStatement, 'optionalAccess', _2332 => _2332.kind]) !== _ast.SyntaxKind.TryStatement || tryStatement.catchClause !== clause) { + return false; + } + let ok = true; + const scan = (current) => { + if (!ok) { + return; + } + if (_chunkUBXMRIM6cjs.isFunctionLike.call(void 0, current) || current.kind === _ast.SyntaxKind.AwaitExpression || current.kind === _ast.SyntaxKind.TryStatement) { + ok = false; + return; + } + if (current.kind === _ast.SyntaxKind.CallExpression) { + const callee = current.expression; + if (!_is.isPropertyAccessExpression.call(void 0, callee) || callee.expression.kind !== _ast.SyntaxKind.ThisKeyword || !HX4_J09_SYNC_BASE_CALLS.has(String(callee.name.text))) { + ok = false; + return; + } + const declaration = _optionalChain([checker, 'access', _2333 => _2333.getResolvedSignature, 'call', _2334 => _2334(current), 'optionalAccess', _2335 => _2335.declaration, 'optionalAccess', _2336 => _2336.resolve, 'call', _2337 => _2337()]); + if (declaration === void 0 || !JAVA_THIS_RETURN_TYPES_BASE_FILE.test(_nullishCoalesce(_optionalChain([declaration, 'access', _2338 => _2338.getSourceFile, 'optionalCall', _2339 => _2339(), 'optionalAccess', _2340 => _2340.fileName]), () => ( "")))) { + ok = false; + return; + } + } + current.forEachChild(scan); + }; + scan(tryStatement.tryBlock); + return ok; +}; +JavaTranspiler.prototype.hx4J09CoreArgument = function(type, printed, node) { + if (node === void 0 || !_is.isIdentifier.call(void 0, node) || printed !== node.text || type !== "Long" && type !== "String") { + return void 0; + } + const declaration = this.javaDeclarationOfIdentifier(node); + if (declaration === void 0 || !_is.isVariableDeclaration.call(void 0, declaration) || _optionalChain([declaration, 'access', _2341 => _2341.name, 'optionalAccess', _2342 => _2342.text]) !== node.text || (_chunkUBXMRIM6cjs.getCombinedNodeFlags.call(void 0, declaration) & _ast.NodeFlags.Const) === 0) { + return void 0; + } + const initializer = declaration.initializer; + if (initializer !== void 0 && _is.isIdentifier.call(void 0, initializer) && initializer.text === "undefined") { + return `(${type}) null`; + } + if (type === "Long" && initializer !== void 0 && _is.isPropertyAccessExpression.call(void 0, initializer) && initializer.name.text === "length" && this.javaDeclaredTypeOf(node) === "Integer") { + return `((long) ${printed})`; + } + return void 0; +}; +{ + const proto = JavaTranspiler.prototype; + const printCondition = proto.printCondition; + proto.printCondition = function(node, identation) { + const printed = printCondition.call(this, node, identation); + let inner = node; + while (_optionalChain([inner, 'optionalAccess', _2343 => _2343.kind]) === _ast.SyntaxKind.ParenthesizedExpression) { + inner = inner.expression; + } + if (_optionalChain([inner, 'optionalAccess', _2344 => _2344.kind]) === _ast.SyntaxKind.Identifier && printed.trimStart().startsWith(this.FALSY_WRAPPER_OPEN) && this.hx4J09BoxIdentifier(inner, /* @__PURE__ */ new Set(), 0)) { + return this.getIden(identation) + `Boolean.TRUE.equals(${this.printNode(inner, 0)})`; + } + return printed; + }; + const printInstanceOfExpression = proto.printInstanceOfExpression; + proto.printInstanceOfExpression = function(node, identation) { + if (_optionalChain([node, 'access', _2345 => _2345.right, 'optionalAccess', _2346 => _2346.kind]) === _ast.SyntaxKind.Identifier && this.hx4J09CcxtErrorClass(node.right) && this.hx4J09CatchCannotWrap(node.left)) { + return this.getIden(identation) + `(${this.printNode(node.left, 0)} instanceof ${node.right.text})`; + } + return printInstanceOfExpression.call(this, node, identation); + }; + const javaConvertToCoreType = proto.javaConvertToCoreType; + proto.javaConvertToCoreType = function(type, printed, node) { + return _nullishCoalesce(this.hx4J09CoreArgument(type, printed, node), () => ( javaConvertToCoreType.call(this, type, printed, node))); + }; +} +{ + const proto = JavaTranspiler.prototype; + const printNativeEquality = proto.printNativeEqualityIfProvable; + proto.printNativeEqualityIfProvable = function(node, leftText, rightText) { + const op = _optionalChain([node, 'optionalAccess', _2347 => _2347.operatorToken, 'optionalAccess', _2348 => _2348.kind]); + const negated = op === _ast.SyntaxKind.ExclamationEqualsToken || op === _ast.SyntaxKind.ExclamationEqualsEqualsToken; + if (negated || op === _ast.SyntaxKind.EqualsEqualsToken || op === _ast.SyntaxKind.EqualsEqualsEqualsToken) { + const left = this.javaDeclaredNumericFamily(node.left); + const right = this.javaDeclaredNumericFamily(node.right); + const isBool = (n) => String(_nullishCoalesce(this.javaDeclaredTypeOf(n), () => ( ""))).trim() === "Boolean"; + if (isBool(node.left) || isBool(node.right)) { + return `${negated ? "!" : ""}java.util.Objects.equals(${leftText}, ${rightText})`; + } + if (JAVA_BOXED_NUMERIC_TYPES.has(left) && JAVA_BOXED_NUMERIC_TYPES.has(right)) { + let equal; + if (left === right && left !== "Double") { + equal = `java.util.Objects.equals(${leftText}, ${rightText})`; + } else { + const unbox = left === "Double" || right === "Double" ? "doubleValue" : "longValue"; + equal = `(${leftText} == null ? ${rightText} == null : (${rightText} != null && ${leftText}.${unbox}() == ${rightText}.${unbox}()))`; + } + return negated ? `!${equal}` : equal; + } + } + return printNativeEquality.call(this, node, leftText, rightText); + }; +} +var JAVA_J16_IMPLICIT_API_FILE = /(^|[\\/])ts[\\/]src[\\/]abstract[\\/][a-z0-9_]+\.ts$/; +{ + const proto = JavaTranspiler.prototype; + const nonSharedValue = proto.javaHx4NonSharedValue; + proto.javaHx4NonSharedValue = function(value, depth) { + return this.javaJ16ImplicitApiResponse(value) || nonSharedValue.call(this, value, depth); + }; + proto.javaJ16ImplicitApiResponse = function(value) { + let node = this.unwrapPrintTransparentExpression(value); + if (_optionalChain([node, 'optionalAccess', _2349 => _2349.kind]) !== _ast.SyntaxKind.AwaitExpression) { + return false; + } + node = this.unwrapPrintTransparentExpression(node.expression); + if (node === void 0 || !_is.isCallExpression.call(void 0, node) || !_is.isPropertyAccessExpression.call(void 0, node.expression) || node.expression.expression.kind !== _ast.SyntaxKind.ThisKeyword) { + return false; + } + let declaration; + try { + declaration = _optionalChain([this, 'access', _2350 => _2350.checkerOrUndefined, 'call', _2351 => _2351(), 'optionalAccess', _2352 => _2352.getResolvedSignature, 'call', _2353 => _2353(node), 'optionalAccess', _2354 => _2354.declaration, 'optionalAccess', _2355 => _2355.resolve, 'call', _2356 => _2356()]); + } catch (e) { + return false; + } + const fileName = _optionalChain([declaration, 'optionalAccess', _2357 => _2357.getSourceFile, 'optionalCall', _2358 => _2358(), 'optionalAccess', _2359 => _2359.fileName]); + if (typeof fileName !== "string" || !JAVA_J16_IMPLICIT_API_FILE.test(fileName) || !declaration.body) { + return false; + } + const statements = _nullishCoalesce(declaration.body.statements, () => ( [])); + const ret = statements.length === 1 && _is.isReturnStatement.call(void 0, statements[0]) ? statements[0].expression : void 0; + return ret !== void 0 && _is.isCallExpression.call(void 0, ret) && _is.isPropertyAccessExpression.call(void 0, ret.expression) && ret.expression.expression.kind === _ast.SyntaxKind.ThisKeyword && ret.expression.name.text === "request"; + }; +} + +// src/rustTranspiler.ts +_chunkUBXMRIM6cjs.init_cjs_shims.call(void 0, ); + + + +var parserConfig6 = { + "ELSEIF_TOKEN": "else if", + "OBJECT_OPENING": "{", + "OBJECT_CLOSING": "}", + "ARRAY_OPENING_TOKEN": "Value::from(vec![", "ARRAY_CLOSING_TOKEN": "])", "PROPERTY_ASSIGNMENT_TOKEN": ":", "VAR_TOKEN": "let mut", @@ -20846,7 +21899,7 @@ function rustScopeNameTable(index) { for (let i = 0; i < nodes.length; i++) { const n = nodes[i]; const kind = n.kind; - if (RUST_NAME_BINDER_KINDS.has(kind) && _optionalChain([n, 'access', _2108 => _2108.name, 'optionalAccess', _2109 => _2109.kind]) === _ast.SyntaxKind.Identifier) + if (RUST_NAME_BINDER_KINDS.has(kind) && _optionalChain([n, 'access', _2360 => _2360.name, 'optionalAccess', _2361 => _2361.kind]) === _ast.SyntaxKind.Identifier) add(n.name.text, i); if (kind === _ast.SyntaxKind.Identifier) add(n.text, i); @@ -20870,6 +21923,24 @@ var _RustTranspiler = class _RustTranspiler extends BaseTranspiler { * `-> Option`; undefined otherwise (no proof → keep the box). */ // call node -> resolved signature's declaration (null: none); a handle resolve per call is JS-heavy this.rustCallDeclarations = /* @__PURE__ */ new WeakMap(); + // hx4 R04 — `const x = []` locals declared `Vec` when every use is a statement + // `x.push(v)` (native push), `x.length`, `return x` or an argument inside a `return` + // (boxed once as `Value::from(x)`). Anything else keeps the `Value` box and `append_to_array`. + this.rustVecLocalDecisions = /* @__PURE__ */ new WeakMap(); + /** Extra plain-dict write sources (R01 write-history proof), REST venue files only: no + * runtime tagged handle (book, ws subscription, cache bucket) is reachable there. */ + this.rustR12Visiting = /* @__PURE__ */ new Set(); + // hx4 R16 — numeric operand kinds beyond the checker: 'definite' = always Int/Float (never Null), + // 'number' = Int/Float/Null. Covers `this.sum` of numbers, numeric same-file method returns, + // locals whose every write is numeric, and flow-narrowed (guarded non-undefined) number identifiers. + this.rustR16InProgress = /* @__PURE__ */ new Set(); + this.rustR16Assumed = /* @__PURE__ */ new Set(); + /** Locals whose Arr-only proof is in progress (a self-referencing write proves nothing new). */ + this.r21ArrVisiting = /* @__PURE__ */ new Set(); + this.r22StrVisiting = /* @__PURE__ */ new Map(); + /** `this.extend (plain, …unshared)` / `this.omit|keysort (plain, …)` called directly + * (not only as a builder's return): the same fresh-copy proof as `rustR12PlainReturn`. */ + this.r23CopyVisiting = /* @__PURE__ */ new Set(); this.requiresParameterType = true; this.requiresReturnType = false; this.asyncTranspiling = true; @@ -20907,8 +21978,8 @@ var _RustTranspiler = class _RustTranspiler extends BaseTranspiler { } /** One bulk getTypeAtLocation for the class's nodes of those kinds, seeding the checker memo. */ rustPrefetchClassTypes(node) { - const getType = _optionalChain([this, 'access', _2110 => _2110.checkerOrUndefined, 'call', _2111 => _2111(), 'optionalAccess', _2112 => _2112.getTypeAtLocation]); - if (_optionalChain([getType, 'optionalAccess', _2113 => _2113.seed]) === void 0 || getType.original === void 0) + const getType = _optionalChain([this, 'access', _2362 => _2362.checkerOrUndefined, 'call', _2363 => _2363(), 'optionalAccess', _2364 => _2364.getTypeAtLocation]); + if (_optionalChain([getType, 'optionalAccess', _2365 => _2365.seed]) === void 0 || getType.original === void 0) return; const kinds = _RustTranspiler.RUST_PREFETCH_TYPE_KINDS; const nodes = []; @@ -21026,7 +22097,7 @@ var _RustTranspiler = class _RustTranspiler extends BaseTranspiler { return "boolean"; if (flags & _sync.TypeFlags.Union) { let kind = void 0; - for (const member of _nullishCoalesce(_chunk4FDYB2TTcjs.typeParts.call(void 0, type), () => ( []))) { + for (const member of _nullishCoalesce(_chunkUBXMRIM6cjs.typeParts.call(void 0, type), () => ( []))) { if (member.flags & (_sync.TypeFlags.Undefined | _sync.TypeFlags.Null)) { continue; } @@ -21047,7 +22118,7 @@ var _RustTranspiler = class _RustTranspiler extends BaseTranspiler { if (type === void 0) return false; if (type.flags & _sync.TypeFlags.Union) { - const members = _nullishCoalesce(_chunk4FDYB2TTcjs.typeParts.call(void 0, type), () => ( [])); + const members = _nullishCoalesce(_chunkUBXMRIM6cjs.typeParts.call(void 0, type), () => ( [])); return members.length > 0 && members.every((member) => this.isBooleanValueType(member)); } return (type.flags & (_sync.TypeFlags.Boolean | _sync.TypeFlags.BooleanLiteral)) !== 0; @@ -21057,7 +22128,7 @@ var _RustTranspiler = class _RustTranspiler extends BaseTranspiler { isBooleanOrUndefinedType(type) { if (type === void 0) return false; - const members = type.flags & _sync.TypeFlags.Union ? _nullishCoalesce(_chunk4FDYB2TTcjs.typeParts.call(void 0, type), () => ( [])) : [type]; + const members = type.flags & _sync.TypeFlags.Union ? _nullishCoalesce(_chunkUBXMRIM6cjs.typeParts.call(void 0, type), () => ( [])) : [type]; if (members.length === 0) return false; const onlyBooleanOrEmpty = members.every((member) => this.isBooleanValueType(member) || (member.flags & (_sync.TypeFlags.Undefined | _sync.TypeFlags.Void | _sync.TypeFlags.Null)) !== 0); @@ -21107,7 +22178,7 @@ var _RustTranspiler = class _RustTranspiler extends BaseTranspiler { return true; } const declaration = current.parent; - if (declaration === void 0 || !_is.isVariableDeclaration.call(void 0, declaration) || declaration.initializer !== current || _optionalChain([declaration, 'access', _2114 => _2114.name, 'optionalAccess', _2115 => _2115.kind]) !== _ast.SyntaxKind.Identifier) { + if (declaration === void 0 || !_is.isVariableDeclaration.call(void 0, declaration) || declaration.initializer !== current || _optionalChain([declaration, 'access', _2366 => _2366.name, 'optionalAccess', _2367 => _2367.kind]) !== _ast.SyntaxKind.Identifier) { return false; } return this.rustNodeIsBoolExpression(declaration.initializer) && this.rustTypeIsBoolean(declaration.initializer) && this.rustLocalUsesAcceptBool(declaration, String(declaration.name.text)); @@ -21208,10 +22279,10 @@ var _RustTranspiler = class _RustTranspiler extends BaseTranspiler { if (node.kind !== _ast.SyntaxKind.Identifier) return false; const symbol = this.getChecker().getSymbolAtLocation(node); - const declarations = _chunk4FDYB2TTcjs.symbolDeclarations.call(void 0, symbol); + const declarations = _chunkUBXMRIM6cjs.symbolDeclarations.call(void 0, symbol); if (declarations.length === 0) return false; - return declarations.every((declaration) => _is.isParameterDeclaration.call(void 0, declaration) || _is.isVariableDeclaration.call(void 0, declaration) && _optionalChain([declaration, 'access', _2116 => _2116.initializer, 'optionalAccess', _2117 => _2117.kind]) !== _ast.SyntaxKind.NewExpression); + return declarations.every((declaration) => _is.isParameterDeclaration.call(void 0, declaration) || _is.isVariableDeclaration.call(void 0, declaration) && _optionalChain([declaration, 'access', _2368 => _2368.initializer, 'optionalAccess', _2369 => _2369.kind]) !== _ast.SyntaxKind.NewExpression); } // Can the checked type only hold a Bool, Null/undefined or a non-numeric // string? Then `x.as_bool() == Some(b)` answers exactly what is_equal(x, b) @@ -21220,7 +22291,7 @@ var _RustTranspiler = class _RustTranspiler extends BaseTranspiler { if (type === void 0) return false; if (type.flags & _sync.TypeFlags.Union) { - const members = _nullishCoalesce(_chunk4FDYB2TTcjs.typeParts.call(void 0, type), () => ( [])); + const members = _nullishCoalesce(_chunkUBXMRIM6cjs.typeParts.call(void 0, type), () => ( [])); return members.length > 0 && members.every((member) => this.rustBooleanComparableType(member)); } if (type.flags & (_sync.TypeFlags.Boolean | _sync.TypeFlags.BooleanLiteral)) @@ -21234,6 +22305,18 @@ var _RustTranspiler = class _RustTranspiler extends BaseTranspiler { // Native `==`/`!=` on the unwrapped payload when the checker proves the // Value variants line up; undefined keeps the is_equal() helper. printNativeEqualityComparison(left, right, op) { + const r09 = this.rustR09LengthEquality(left, right, op); + if (r09 !== void 0) + return r09; + const r12 = this.rustR12NativeBoolEquality(left, right, op); + if (r12 !== void 0) + return r12; + const r13 = this.printRustR13ProvenStrEquality(left, right, op); + if (r13 !== void 0) + return r13; + const r20 = this.r20BoolCallEquality(left, right, op); + if (r20 !== void 0) + return r20; const operator = op === _ast.SyntaxKind.EqualsEqualsToken || op === _ast.SyntaxKind.EqualsEqualsEqualsToken ? "==" : "!="; const leftLiteral = this.literalKindOfNode(left); const rightLiteral = this.literalKindOfNode(right); @@ -21291,7 +22374,7 @@ var _RustTranspiler = class _RustTranspiler extends BaseTranspiler { // is exactly what the runtime helper computes; only then is the helper // call dropped, anything unproven keeps the helper. typeOfNodeIfAny(node) { - return _optionalChain([this, 'access', _2118 => _2118.checkerOrUndefined, 'call', _2119 => _2119(), 'optionalAccess', _2120 => _2120.getTypeAtLocation, 'call', _2121 => _2121(node)]); + return _optionalChain([this, 'access', _2370 => _2370.checkerOrUndefined, 'call', _2371 => _2371(), 'optionalAccess', _2372 => _2372.getTypeAtLocation, 'call', _2373 => _2373(node)]); } // Arrays/tuples/strings: `.length` is exactly what `Value::len()` returns. // Other shapes (Dict) keep the helper — ArrayCache / OrderBookSide markers @@ -21300,7 +22383,7 @@ var _RustTranspiler = class _RustTranspiler extends BaseTranspiler { if (type === void 0) return false; if (type.flags & _sync.TypeFlags.Union) { - const parts = _nullishCoalesce(_chunk4FDYB2TTcjs.typeParts.call(void 0, type), () => ( [])); + const parts = _nullishCoalesce(_chunkUBXMRIM6cjs.typeParts.call(void 0, type), () => ( [])); return parts.length > 0 && parts.every((part) => this.isValueLengthType(part)); } return (type.flags & (_sync.TypeFlags.Undefined | _sync.TypeFlags.Null | _sync.TypeFlags.Void)) !== 0 || this.getChecker().isArrayType(type) || this.getChecker().isTupleType(type) || this.isStringType(type.flags); @@ -21309,7 +22392,9 @@ var _RustTranspiler = class _RustTranspiler extends BaseTranspiler { const receiver = _nullishCoalesce(leftExpr, () => ( this.printNode(node.expression, 0))); if (!this.rustIsOrderBookSide(node.expression) && this.isValueLengthType(this.typeOfNodeIfAny(node.expression))) return `Value::Int(${receiver}.len() as i64)`; - return `get_array_length(&${receiver})`; + if (this.r11ProvenListValue(node.expression)) + return `${receiver}.as_array().map_or(Value::Int(0), |__a| Value::Int(__a.len() as i64))`; + return _nullishCoalesce(this.r18ArrLength(node, receiver), () => ( `get_array_length(&${receiver})`)); } /** `orderbook['bids']` / `orderbook.asks` on an `OrderBook`-typed receiver, or a * local initialised from one. The WS runtime keeps those sides as marker dicts @@ -21334,7 +22419,7 @@ var _RustTranspiler = class _RustTranspiler extends BaseTranspiler { } if (receiver === void 0 || key !== "bids" && key !== "asks") return false; - const symbol = _optionalChain([this, 'access', _2122 => _2122.typeOfNodeIfAny, 'call', _2123 => _2123(receiver), 'optionalAccess', _2124 => _2124.getSymbol, 'optionalCall', _2125 => _2125()]); + const symbol = _optionalChain([this, 'access', _2374 => _2374.typeOfNodeIfAny, 'call', _2375 => _2375(receiver), 'optionalAccess', _2376 => _2376.getSymbol, 'optionalCall', _2377 => _2377()]); return symbol !== void 0 && /^(Indexed|Counted)?OrderBook$/.test(symbol.name); } // Native string search / slicing: `x.indexOf(y)` and `x.slice(a, b)` on a checker-proven @@ -21362,7 +22447,7 @@ var _RustTranspiler = class _RustTranspiler extends BaseTranspiler { // `x.indexOf("lit")` on a proven string receiver: `str::find` is exactly // the helper's `Value::Str` arm (byte index, `-1` when absent). printNativeStringIndexOf(node, receiverText) { - if (node === void 0 || !_is.isCallExpression.call(void 0, node) || !_is.isPropertyAccessExpression.call(void 0, node.expression) || _optionalChain([node, 'access', _2126 => _2126.arguments, 'optionalAccess', _2127 => _2127.length]) !== 1) { + if (node === void 0 || !_is.isCallExpression.call(void 0, node) || !_is.isPropertyAccessExpression.call(void 0, node.expression) || _optionalChain([node, 'access', _2378 => _2378.arguments, 'optionalAccess', _2379 => _2379.length]) !== 1) { return void 0; } if (this.primitiveKindOfType(this.typeOfNodeIfAny(node.expression.expression)) !== "string") @@ -21406,7 +22491,7 @@ var _RustTranspiler = class _RustTranspiler extends BaseTranspiler { // every one of them as `Value`. Imports, classes and function names print // as Rust items rather than as values, so they keep the helper. isDeclaredValueIdentifier(node) { - const declarations = _chunk4FDYB2TTcjs.symbolDeclarations.call(void 0, this.getChecker().getSymbolAtLocation(node)); + const declarations = _chunkUBXMRIM6cjs.symbolDeclarations.call(void 0, this.getChecker().getSymbolAtLocation(node)); return declarations.length > 0 && declarations.every((d) => _is.isVariableDeclaration.call(void 0, d) || _is.isParameterDeclaration.call(void 0, d) || _is.isBindingElement.call(void 0, d)); } // A declared `Value` place: a local/param identifier, or a field/element @@ -21445,7 +22530,7 @@ var _RustTranspiler = class _RustTranspiler extends BaseTranspiler { if (type === void 0) return false; if (type.flags & _sync.TypeFlags.Union) { - const parts = _nullishCoalesce(_chunk4FDYB2TTcjs.typeParts.call(void 0, type), () => ( [])); + const parts = _nullishCoalesce(_chunkUBXMRIM6cjs.typeParts.call(void 0, type), () => ( [])); const valueParts = parts.filter((part) => !this.rustTypeIsNullish(part)); return parts.length > valueParts.length && valueParts.length > 0 && valueParts.every((part) => this.isDictShapedType(part)); } @@ -21530,7 +22615,7 @@ var _RustTranspiler = class _RustTranspiler extends BaseTranspiler { const plain = this.rustInsertIdentifierReceiver(expr); return plain === void 0 ? void 0 : { text: expr.text, isField: false, plain, nameNode: expr }; } - if (_is.isPropertyAccessExpression.call(void 0, expr) && expr.expression.kind === _ast.SyntaxKind.ThisKeyword && _optionalChain([expr, 'access', _2128 => _2128.name, 'optionalAccess', _2129 => _2129.kind]) === _ast.SyntaxKind.Identifier) { + if (_is.isPropertyAccessExpression.call(void 0, expr) && expr.expression.kind === _ast.SyntaxKind.ThisKeyword && _optionalChain([expr, 'access', _2380 => _2380.name, 'optionalAccess', _2381 => _2381.kind]) === _ast.SyntaxKind.Identifier) { return { text: `self.${expr.name.text}`, isField: true, @@ -21639,7 +22724,7 @@ var _RustTranspiler = class _RustTranspiler extends BaseTranspiler { * family; each returns its own request/params dict arguments. */ rustHandlerTupleCall(node) { const callee = node !== void 0 && _is.isCallExpression.call(void 0, node) ? node.expression : void 0; - return callee !== void 0 && _is.isPropertyAccessExpression.call(void 0, callee) && callee.expression.kind === _ast.SyntaxKind.ThisKeyword && _optionalChain([callee, 'access', _2130 => _2130.name, 'optionalAccess', _2131 => _2131.kind]) === _ast.SyntaxKind.Identifier && /^handle[A-Z]/.test(callee.name.text); + return callee !== void 0 && _is.isPropertyAccessExpression.call(void 0, callee) && callee.expression.kind === _ast.SyntaxKind.ThisKeyword && _optionalChain([callee, 'access', _2382 => _2382.name, 'optionalAccess', _2383 => _2383.kind]) === _ast.SyntaxKind.Identifier && /^handle[A-Z]/.test(callee.name.text); } /** A `null`/`undefined` write leaves the receiver a non-dict, which the * emitted `if let Value::Dict` no-ops exactly like the helper. */ @@ -21657,7 +22742,7 @@ var _RustTranspiler = class _RustTranspiler extends BaseTranspiler { if (checker === void 0) { return void 0; } - const declarations = _chunk4FDYB2TTcjs.symbolDeclarations.call(void 0, checker.getSymbolAtLocation(ident)); + const declarations = _chunkUBXMRIM6cjs.symbolDeclarations.call(void 0, checker.getSymbolAtLocation(ident)); const declaration = declarations.length === 1 ? declarations[0] : void 0; return declaration !== void 0 && (_is.isVariableDeclaration.call(void 0, declaration) || _is.isParameterDeclaration.call(void 0, declaration)) ? declaration : void 0; } @@ -21668,14 +22753,14 @@ var _RustTranspiler = class _RustTranspiler extends BaseTranspiler { if (type === void 0) return false; if (type.flags & _sync.TypeFlags.Union) { - const parts = _nullishCoalesce(_chunk4FDYB2TTcjs.typeParts.call(void 0, type), () => ( [])); + const parts = _nullishCoalesce(_chunkUBXMRIM6cjs.typeParts.call(void 0, type), () => ( [])); return parts.length > 0 && parts.every((part) => this.rustWriteDictShape(part)); } if (type.flags & (_sync.TypeFlags.Undefined | _sync.TypeFlags.Void)) { return true; } const checker = this.getChecker(); - if (!(type.flags & _sync.TypeFlags.Object) || checker.isArrayType(type) || checker.isTupleType(type) || checker.isArrayLikeType(type) || (_nullishCoalesce(_chunk4FDYB2TTcjs.typeTarget.call(void 0, type), () => ( type))).objectFlags & _sync.ObjectFlags.Class) { + if (!(type.flags & _sync.TypeFlags.Object) || checker.isArrayType(type) || checker.isTupleType(type) || checker.isArrayLikeType(type) || (_nullishCoalesce(_chunkUBXMRIM6cjs.typeTarget.call(void 0, type), () => ( type))).objectFlags & _sync.ObjectFlags.Class) { return false; } return type.getCallSignatures().length === 0 && type.getConstructSignatures().length === 0; @@ -21701,7 +22786,7 @@ var _RustTranspiler = class _RustTranspiler extends BaseTranspiler { const name = ident.text; const initializer = declaration.initializer; const scope = this.rustEnclosingFunction(declaration); - if (initializer === void 0 || _is.isElementAccessExpression.call(void 0, initializer) || _optionalChain([declaration, 'access', _2132 => _2132.name, 'optionalAccess', _2133 => _2133.kind]) !== _ast.SyntaxKind.Identifier || scope === void 0) { + if (initializer === void 0 || _is.isElementAccessExpression.call(void 0, initializer) || _optionalChain([declaration, 'access', _2384 => _2384.name, 'optionalAccess', _2385 => _2385.kind]) !== _ast.SyntaxKind.Identifier || scope === void 0) { return false; } let safe = this.rustWriteDictShape(this.typeOfNodeIfAny(ident)) && this.rustWriteDictShape(this.typeOfNodeIfAny(initializer)); @@ -21730,7 +22815,7 @@ var _RustTranspiler = class _RustTranspiler extends BaseTranspiler { } let safe = true; this.rustWalkScope(scope, (n) => { - if (_is.isBinaryExpression.call(void 0, n) && n.operatorToken.kind === _ast.SyntaxKind.EqualsToken && _is.isPropertyAccessExpression.call(void 0, n.left) && n.left.expression.kind === _ast.SyntaxKind.ThisKeyword && _optionalChain([n, 'access', _2134 => _2134.left, 'access', _2135 => _2135.name, 'optionalAccess', _2136 => _2136.text]) === fieldName && !this.rustWriteDictShape(this.typeOfNodeIfAny(n.right))) { + if (_is.isBinaryExpression.call(void 0, n) && n.operatorToken.kind === _ast.SyntaxKind.EqualsToken && _is.isPropertyAccessExpression.call(void 0, n.left) && n.left.expression.kind === _ast.SyntaxKind.ThisKeyword && _optionalChain([n, 'access', _2386 => _2386.left, 'access', _2387 => _2387.name, 'optionalAccess', _2388 => _2388.text]) === fieldName && !this.rustWriteDictShape(this.typeOfNodeIfAny(n.right))) { safe = false; return RUST_WALK_STOP; } @@ -21741,7 +22826,7 @@ var _RustTranspiler = class _RustTranspiler extends BaseTranspiler { // a `Market`-style alias — the proof B-25's native reads use) whose every // write in the body keeps that shape: an object literal with no runtime tag rustParamStaysPlainDict(declaration) { - if (declaration.type === void 0 || _optionalChain([declaration, 'access', _2137 => _2137.name, 'optionalAccess', _2138 => _2138.kind]) !== _ast.SyntaxKind.Identifier) { + if (declaration.type === void 0 || _optionalChain([declaration, 'access', _2389 => _2389.name, 'optionalAccess', _2390 => _2390.kind]) !== _ast.SyntaxKind.Identifier) { return false; } const type = this.getCheckedTypeOf(declaration.type); @@ -21893,8 +22978,8 @@ var _RustTranspiler = class _RustTranspiler extends BaseTranspiler { const rightKind = this.rustNumericOperandKind(right); const ordered = op === _ast.SyntaxKind.LessThanToken || op === _ast.SyntaxKind.GreaterThanToken; const proven = leftKind === "definite" || rightKind === "definite" || (ordered ? leftKind !== void 0 || rightKind !== void 0 : leftKind === "number" && rightKind === "number"); - if (!proven) { - return void 0; + if (!proven && !this.rustR16OrderedProven(op, left, right)) { + return _nullishCoalesce(this.r22StrOrderedComparison(node, op, left, right), () => ( this.r25NativeLooseOrderedComparison(node, op, left, right))); } return this.printNativeNumericComparison(node, operator, this.printNode(left, 0), this.printNode(right, 0)); } @@ -21910,8 +22995,8 @@ var _RustTranspiler = class _RustTranspiler extends BaseTranspiler { if (!type) { return false; } - if (type.flags === _sync.TypeFlags.Union && Array.isArray(_chunk4FDYB2TTcjs.typeParts.call(void 0, type))) { - return _chunk4FDYB2TTcjs.typeParts.call(void 0, type).length > 0 && _chunk4FDYB2TTcjs.typeParts.call(void 0, type).every((member) => this.rustTypeFlagsAll(member, flags)); + if (type.flags === _sync.TypeFlags.Union && Array.isArray(_chunkUBXMRIM6cjs.typeParts.call(void 0, type))) { + return _chunkUBXMRIM6cjs.typeParts.call(void 0, type).length > 0 && _chunkUBXMRIM6cjs.typeParts.call(void 0, type).every((member) => this.rustTypeFlagsAll(member, flags)); } return flags.has(type.flags); } @@ -21937,6 +23022,8 @@ var _RustTranspiler = class _RustTranspiler extends BaseTranspiler { return native === void 0 ? void 0 : `${leftText} = ${native}`; } printNativeArithmetic(op, left, right, leftText, rightText) { + if (op === _ast.SyntaxKind.PercentToken) + return _nullishCoalesce(this.printRustNativeMod(left, right, leftText, rightText), () => ( this.rustR16NativeArithmetic(op, left, right, leftText, rightText))); if (op !== _ast.SyntaxKind.PlusToken && op !== _ast.SyntaxKind.MinusToken && op !== _ast.SyntaxKind.AsteriskToken && op !== _ast.SyntaxKind.SlashToken) { return void 0; } @@ -21948,11 +23035,20 @@ var _RustTranspiler = class _RustTranspiler extends BaseTranspiler { } catch (e) { return void 0; } - if (op === _ast.SyntaxKind.PlusToken && this.isNativeStringConcatPair(leftType, rightType)) { + const r09 = this.rustR09NativeAddSubtract(op, left, right, leftType, rightType, leftText, rightText); + if (r09 !== void 0) + return r09; + const r16 = this.rustR16NativeArithmetic(op, left, right, leftText, rightText); + if (r16 !== void 0) + return r16; + const r20 = this.r20NativeNumericAdd(op, left, right, leftText, rightText); + if (r20 !== void 0) + return r20; + if (op === _ast.SyntaxKind.PlusToken && (this.isNativeStringConcatPair(leftType, rightType) || this.r17ConcatIsAnchored(left, right, leftType, rightType) || this.r22ConcatIsAnchored(left, right, leftType, rightType))) { return this.printNativeStringConcat(leftText, rightText); } if (!this.isNumberLikeType(leftType) || !this.isNumberLikeType(rightType)) { - return void 0; + return this.r25NativeCoercingArithmetic(op, left, right, leftText, rightText); } return this.printNativeNumeric(op, leftText, rightText); } @@ -21994,7 +23090,7 @@ var _RustTranspiler = class _RustTranspiler extends BaseTranspiler { for (const key of keyStrs.slice(0, -1)) acc = `get_value_mut(${acc}, &${key})`; const rhs = this.printNode(right, 0); - const nativeInsert = keyStrs.length === 1 ? this.printNativeDictInsert(baseExpr, keys[0], keyStrs[0], rhs) : void 0; + const nativeInsert = keyStrs.length === 1 ? _nullishCoalesce(this.printNativeDictInsert(baseExpr, keys[0], keyStrs[0], rhs), () => ( this.rustR01NativeDictInsert(baseExpr, keys[0], keyStrs[0], rhs))) : void 0; return _nullishCoalesce(nativeInsert, () => ( `add_element_to_object(${acc}, &${keyStrs[keyStrs.length - 1]}, ${rhs})`)); } if (left.kind === _ast.SyntaxKind.TypeOfExpression) { @@ -22012,7 +23108,7 @@ var _RustTranspiler = class _RustTranspiler extends BaseTranspiler { } if (op === _ast.SyntaxKind.InKeyword) { const shadow = this.rustParamShadowOf(right); - return _nullishCoalesce(_nullishCoalesce((shadow !== void 0 ? this.printShadowInOperator(shadow, left) : void 0), () => ( this.printNativeInOperator(left, right))), () => ( `Value::Bool(in_op(&${this.printNode(right, 0)}, &${this.printNode(left, 0)}))`)); + return _nullishCoalesce(_nullishCoalesce(_nullishCoalesce(_nullishCoalesce((shadow !== void 0 ? this.printShadowInOperator(shadow, left) : void 0), () => ( this.printNativeInOperator(left, right))), () => ( this.r18LiteralInOp(left, right))), () => ( this.r05InOp(left, right))), () => ( `Value::Bool(in_op(&${this.printNode(right, 0)}, &${this.printNode(left, 0)}))`)); } if ((op === _ast.SyntaxKind.PlusEqualsToken || op === _ast.SyntaxKind.MinusEqualsToken) && left.kind !== _ast.SyntaxKind.ElementAccessExpression) { const isPlus = op === _ast.SyntaxKind.PlusEqualsToken; @@ -22048,7 +23144,7 @@ var _RustTranspiler = class _RustTranspiler extends BaseTranspiler { } // `str.padStart(len, pad)` / `str.padEnd(len, pad)` → runtime helpers `(&Value, &Value, &Value)`. printPadStartCall(node, identation, name, parsedArg, parsedArg2) { - return `pad_start(${this.ensureRef(name)}, ${this.ensureRef(parsedArg)}, ${this.ensureRef(parsedArg2)})`; + return _nullishCoalesce(this.printNativeStringPadStart(node, name), () => ( `pad_start(${this.ensureRef(name)}, ${this.ensureRef(parsedArg)}, ${this.ensureRef(parsedArg2)})`)); } printPadEndCall(node, identation, name, parsedArg, parsedArg2) { return `pad_end(${this.ensureRef(name)}, ${this.ensureRef(parsedArg)}, ${this.ensureRef(parsedArg2)})`; @@ -22056,7 +23152,7 @@ var _RustTranspiler = class _RustTranspiler extends BaseTranspiler { printVariableDeclarationList(node, identation) { const declaration = node.declarations[0]; const indent = this.getIden(identation); - if (_optionalChain([declaration, 'optionalAccess', _2139 => _2139.name, 'access', _2140 => _2140.kind]) === _ast.SyntaxKind.ArrayBindingPattern) { + if (_optionalChain([declaration, 'optionalAccess', _2391 => _2391.name, 'access', _2392 => _2392.kind]) === _ast.SyntaxKind.ArrayBindingPattern) { const parsedElements = declaration.name.elements.map((e) => this.printNode(e.name, 0)); const syntheticName = parsedElements.join("") + "Variable"; const head = `${indent}let mut ${syntheticName} = ${this.printNode(declaration.initializer, 0)}; @@ -22073,6 +23169,8 @@ var _RustTranspiler = class _RustTranspiler extends BaseTranspiler { if (declaration.initializer.kind === _ast.SyntaxKind.NewExpression) { return `${indent}let mut ${varName} = ${parsedValue}`; } + if (node.declarations.length === 1 && this.rustVecLocalIsTyped(declaration)) + return `${indent}let mut ${varName}: Vec = Vec::new()`; const boolValue = this.getRustBoolLocalInitializer(declaration, parsedValue); if (boolValue !== void 0) { return `${indent}let mut ${varName}: bool = ${boolValue}`; @@ -22087,11 +23185,11 @@ var _RustTranspiler = class _RustTranspiler extends BaseTranspiler { // Call to a hand-written `-> bool` fn: the checker must agree the TS call // is boolean-typed and the callee must be in the verified table above. rustCallPrintsBool(node) { - if (_optionalChain([node, 'optionalAccess', _2141 => _2141.kind]) !== _ast.SyntaxKind.CallExpression) { + if (_optionalChain([node, 'optionalAccess', _2393 => _2393.kind]) !== _ast.SyntaxKind.CallExpression) { return false; } const callee = node.expression; - const name = _optionalChain([callee, 'optionalAccess', _2142 => _2142.kind]) === _ast.SyntaxKind.Identifier ? callee.text : _optionalChain([callee, 'optionalAccess', _2143 => _2143.kind]) === _ast.SyntaxKind.PropertyAccessExpression ? _optionalChain([callee, 'access', _2144 => _2144.name, 'optionalAccess', _2145 => _2145.text]) : void 0; + const name = _optionalChain([callee, 'optionalAccess', _2394 => _2394.kind]) === _ast.SyntaxKind.Identifier ? callee.text : _optionalChain([callee, 'optionalAccess', _2395 => _2395.kind]) === _ast.SyntaxKind.PropertyAccessExpression ? _optionalChain([callee, 'access', _2396 => _2396.name, 'optionalAccess', _2397 => _2397.text]) : void 0; return name !== void 0 && _RustTranspiler.RUST_BOOL_RESULT_CALLEES.has(name) && this.rustTypeIsBoolean(node); } // Index just past the `"..."` literal opening at `i` (escapes skipped). @@ -22160,7 +23258,7 @@ var _RustTranspiler = class _RustTranspiler extends BaseTranspiler { // Source shapes the printer turns into a bool: comparisons, `&&`/`||` // (each operand is is_true-wrapped), `!`, `in`, `instanceof`, true/false. rustNodeIsBoolExpression(node) { - switch (_optionalChain([node, 'optionalAccess', _2146 => _2146.kind])) { + switch (_optionalChain([node, 'optionalAccess', _2398 => _2398.kind])) { case _ast.SyntaxKind.TrueKeyword: case _ast.SyntaxKind.FalseKeyword: return true; @@ -22188,7 +23286,7 @@ var _RustTranspiler = class _RustTranspiler extends BaseTranspiler { return checker !== void 0 && this.isStringLikeType(checker.getTypeAtLocation(node)); } rustEnclosingFunction(node) { - for (let current = _optionalChain([node, 'optionalAccess', _2147 => _2147.parent]); current; current = current.parent) { + for (let current = _optionalChain([node, 'optionalAccess', _2399 => _2399.parent]); current; current = current.parent) { switch (current.kind) { case _ast.SyntaxKind.MethodDeclaration: case _ast.SyntaxKind.FunctionDeclaration: @@ -22202,7 +23300,7 @@ var _RustTranspiler = class _RustTranspiler extends BaseTranspiler { return void 0; } rustBindsName(node, name) { - switch (_optionalChain([node, 'optionalAccess', _2148 => _2148.kind])) { + switch (_optionalChain([node, 'optionalAccess', _2400 => _2400.kind])) { case _ast.SyntaxKind.VariableDeclaration: case _ast.SyntaxKind.Parameter: case _ast.SyntaxKind.FunctionDeclaration: @@ -22210,7 +23308,7 @@ var _RustTranspiler = class _RustTranspiler extends BaseTranspiler { case _ast.SyntaxKind.PropertyDeclaration: case _ast.SyntaxKind.FunctionExpression: case _ast.SyntaxKind.ArrowFunction: - return _optionalChain([node, 'access', _2149 => _2149.name, 'optionalAccess', _2150 => _2150.kind]) === _ast.SyntaxKind.Identifier && node.name.text === name; + return _optionalChain([node, 'access', _2401 => _2401.name, 'optionalAccess', _2402 => _2402.kind]) === _ast.SyntaxKind.Identifier && node.name.text === name; } return false; } @@ -22274,7 +23372,7 @@ var _RustTranspiler = class _RustTranspiler extends BaseTranspiler { // method) is the same payload without the unwrap. rustSafeStringLocalInitializer(declaration) { const initializer = declaration.initializer; - if (_optionalChain([declaration, 'access', _2151 => _2151.name, 'optionalAccess', _2152 => _2152.kind]) !== _ast.SyntaxKind.Identifier || _optionalChain([initializer, 'optionalAccess', _2153 => _2153.kind]) !== _ast.SyntaxKind.CallExpression) { + if (_optionalChain([declaration, 'access', _2403 => _2403.name, 'optionalAccess', _2404 => _2404.kind]) !== _ast.SyntaxKind.Identifier || _optionalChain([initializer, 'optionalAccess', _2405 => _2405.kind]) !== _ast.SyntaxKind.CallExpression) { return false; } if (this.rustNativeStrCalleeKind(initializer) === "str") { @@ -22282,16 +23380,16 @@ var _RustTranspiler = class _RustTranspiler extends BaseTranspiler { } const callee = initializer.expression; const helpers = _RustTranspiler.RUST_STRING_LOCAL_HELPERS; - if (_optionalChain([callee, 'optionalAccess', _2154 => _2154.kind]) === _ast.SyntaxKind.PropertyAccessExpression) { - return _optionalChain([callee, 'access', _2155 => _2155.expression, 'optionalAccess', _2156 => _2156.kind]) === _ast.SyntaxKind.ThisKeyword && helpers.has(callee.name.text); + if (_optionalChain([callee, 'optionalAccess', _2406 => _2406.kind]) === _ast.SyntaxKind.PropertyAccessExpression) { + return _optionalChain([callee, 'access', _2407 => _2407.expression, 'optionalAccess', _2408 => _2408.kind]) === _ast.SyntaxKind.ThisKeyword && helpers.has(callee.name.text); } - return _optionalChain([callee, 'optionalAccess', _2157 => _2157.kind]) === _ast.SyntaxKind.Identifier && helpers.has(callee.text); + return _optionalChain([callee, 'optionalAccess', _2409 => _2409.kind]) === _ast.SyntaxKind.Identifier && helpers.has(callee.text); } // The two uses that compile against an `Option` local and print // natively: `x ==/!= null|undefined` and `x ==/!= "lit"`. rustStringLocalUseIsNative(node) { const parent = node.parent; - if (_optionalChain([parent, 'optionalAccess', _2158 => _2158.kind]) !== _ast.SyntaxKind.BinaryExpression) { + if (_optionalChain([parent, 'optionalAccess', _2410 => _2410.kind]) !== _ast.SyntaxKind.BinaryExpression) { return false; } const op = parent.operatorToken.kind; @@ -22333,7 +23431,7 @@ var _RustTranspiler = class _RustTranspiler extends BaseTranspiler { // `x.foo` / `{ foo: 1 }` — a property name is not a use of the local. rustIdentifierIsPropertyName(node) { const parent = node.parent; - switch (_optionalChain([parent, 'optionalAccess', _2159 => _2159.kind])) { + switch (_optionalChain([parent, 'optionalAccess', _2411 => _2411.kind])) { case _ast.SyntaxKind.PropertyAccessExpression: case _ast.SyntaxKind.PropertyAssignment: case _ast.SyntaxKind.PropertySignature: @@ -22344,18 +23442,18 @@ var _RustTranspiler = class _RustTranspiler extends BaseTranspiler { } // Is this identifier occurrence bound to a typed string local? rustStringLocalIdentifierIsTyped(node) { - const checker = _optionalChain([node, 'optionalAccess', _2160 => _2160.kind]) === _ast.SyntaxKind.Identifier ? this.checkerOrUndefined() : void 0; + const checker = _optionalChain([node, 'optionalAccess', _2412 => _2412.kind]) === _ast.SyntaxKind.Identifier ? this.checkerOrUndefined() : void 0; if (checker === void 0) { return false; } const symbol = checker.getSymbolAtLocation(node); - const declaration = _nullishCoalesce(_chunk4FDYB2TTcjs.symbolValueDeclaration.call(void 0, symbol), () => ( _chunk4FDYB2TTcjs.symbolDeclarations.call(void 0, symbol)[0])); - return _optionalChain([declaration, 'optionalAccess', _2161 => _2161.kind]) === _ast.SyntaxKind.VariableDeclaration && this.rustSafeStringLocalIsTyped(declaration); + const declaration = _nullishCoalesce(_chunkUBXMRIM6cjs.symbolValueDeclaration.call(void 0, symbol), () => ( _chunkUBXMRIM6cjs.symbolDeclarations.call(void 0, symbol)[0])); + return _optionalChain([declaration, 'optionalAccess', _2413 => _2413.kind]) === _ast.SyntaxKind.VariableDeclaration && this.rustSafeStringLocalIsTyped(declaration); } // `let x = ` → the printed bool expression, or undefined. getRustBoolLocalInitializer(declaration, printedValue) { const initializer = declaration.initializer; - if (initializer === void 0 || _optionalChain([declaration, 'access', _2162 => _2162.name, 'optionalAccess', _2163 => _2163.kind]) !== _ast.SyntaxKind.Identifier) { + if (initializer === void 0 || _optionalChain([declaration, 'access', _2414 => _2414.name, 'optionalAccess', _2415 => _2415.kind]) !== _ast.SyntaxKind.Identifier) { return void 0; } const inner = this.stripOuterParens(printedValue); @@ -22389,10 +23487,10 @@ var _RustTranspiler = class _RustTranspiler extends BaseTranspiler { return _nullishCoalesce(cached, () => ( void 0)); } const chain = []; - let parentClass = _chunk4FDYB2TTcjs.getAllSuperTypeNodes.call(void 0, classDecl)[0]; + let parentClass = _chunkUBXMRIM6cjs.getAllSuperTypeNodes.call(void 0, classDecl)[0]; let ok = true; while (parentClass !== void 0) { - const parentClassDecl = _optionalChain([this, 'access', _2164 => _2164.getChecker, 'call', _2165 => _2165(), 'access', _2166 => _2166.getTypeAtLocation, 'call', _2167 => _2167(parentClass), 'optionalAccess', _2168 => _2168.getSymbol, 'call', _2169 => _2169(), 'optionalAccess', _2170 => _2170.valueDeclaration, 'optionalAccess', _2171 => _2171.resolve, 'call', _2172 => _2172()]); + const parentClassDecl = _optionalChain([this, 'access', _2416 => _2416.getChecker, 'call', _2417 => _2417(), 'access', _2418 => _2418.getTypeAtLocation, 'call', _2419 => _2419(parentClass), 'optionalAccess', _2420 => _2420.getSymbol, 'call', _2421 => _2421(), 'optionalAccess', _2422 => _2422.valueDeclaration, 'optionalAccess', _2423 => _2423.resolve, 'call', _2424 => _2424()]); if (parentClassDecl === void 0) { ok = false; break; @@ -22404,7 +23502,7 @@ var _RustTranspiler = class _RustTranspiler extends BaseTranspiler { } } chain.push(byName); - parentClass = _nullishCoalesce(_chunk4FDYB2TTcjs.getAllSuperTypeNodes.call(void 0, parentClassDecl)[0], () => ( void 0)); + parentClass = _nullishCoalesce(_chunkUBXMRIM6cjs.getAllSuperTypeNodes.call(void 0, parentClassDecl)[0], () => ( void 0)); } this.rustClassAncestorTables.set(classDecl, ok ? chain : null); return ok ? chain : void 0; @@ -22447,13 +23545,13 @@ var _RustTranspiler = class _RustTranspiler extends BaseTranspiler { * statement is one of them (so Rust sees no `()`-valued tail the * `-> Value` post-passes would have patched with `Value::Null`). */ rustStrReturnPathsConvert(body) { - const last = _optionalChain([body, 'optionalAccess', _2173 => _2173.statements, 'access', _2174 => _2174[body.statements.length - 1]]); + const last = _optionalChain([body, 'optionalAccess', _2425 => _2425.statements, 'access', _2426 => _2426[body.statements.length - 1]]); if (last === void 0 || !_is.isReturnStatement.call(void 0, last)) { return false; } let ok = true; const visit = (n) => { - if (!ok || n !== body && _chunk4FDYB2TTcjs.isFunctionLike.call(void 0, n)) { + if (!ok || n !== body && _chunkUBXMRIM6cjs.isFunctionLike.call(void 0, n)) { return; } if (_is.isReturnStatement.call(void 0, n) && !this.rustStrReturnValueConverts(n.expression)) { @@ -22502,13 +23600,13 @@ var _RustTranspiler = class _RustTranspiler extends BaseTranspiler { let declaration = this.rustCallDeclarations.get(node); if (declaration === void 0) { try { - declaration = _nullishCoalesce(_chunk4FDYB2TTcjs.signatureDeclaration.call(void 0, this.getChecker().getResolvedSignature(node)), () => ( null)); + declaration = _nullishCoalesce(_chunkUBXMRIM6cjs.signatureDeclaration.call(void 0, this.getChecker().getResolvedSignature(node)), () => ( null)); } catch (e) { return void 0; } this.rustCallDeclarations.set(node, declaration); } - return _optionalChain([declaration, 'optionalAccess', _2175 => _2175.kind]) === _ast.SyntaxKind.MethodDeclaration ? this.rustNativeStrReturnKind(declaration) : void 0; + return _optionalChain([declaration, 'optionalAccess', _2427 => _2427.kind]) === _ast.SyntaxKind.MethodDeclaration ? this.rustNativeStrReturnKind(declaration) : void 0; } /** `Option` → `Value` (exact inverse of the return conversion). */ rustNativeStrValueBox(text) { @@ -22531,7 +23629,7 @@ var _RustTranspiler = class _RustTranspiler extends BaseTranspiler { return false; } if (_is.isReturnStatement.call(void 0, parent) && parent.expression === current) { - return this.rustNativeStrReturnKind(_chunk4FDYB2TTcjs.findAncestor.call(void 0, parent.parent, _chunk4FDYB2TTcjs.isFunctionLike)) !== "str"; + return this.rustNativeStrReturnKind(_chunkUBXMRIM6cjs.findAncestor.call(void 0, parent.parent, _chunkUBXMRIM6cjs.isFunctionLike)) !== "str"; } return true; } @@ -22544,7 +23642,7 @@ var _RustTranspiler = class _RustTranspiler extends BaseTranspiler { * source file, keyed by local name in declaration order. */ rustDeclaredDictLocals() { const src = this.getSrc(); - if (_optionalChain([this, 'access', _2176 => _2176.declaredDictLocalsCache, 'optionalAccess', _2177 => _2177.src]) !== src) { + if (_optionalChain([this, 'access', _2428 => _2428.declaredDictLocalsCache, 'optionalAccess', _2429 => _2429.src]) !== src) { let table; try { table = this.collectRustDeclaredDictLocals(src); @@ -22560,7 +23658,7 @@ var _RustTranspiler = class _RustTranspiler extends BaseTranspiler { * Accepts the receiver node of the helper call (identifier, `x['k']` chain, * `this.x` chain) or the declaration itself. */ rustDeclaredLocalTypeResolver(node) { - return _optionalChain([this, 'access', _2178 => _2178.rustDeclaredLocalEntry, 'call', _2179 => _2179(node), 'optionalAccess', _2180 => _2180.kind]); + return _optionalChain([this, 'access', _2430 => _2430.rustDeclaredLocalEntry, 'call', _2431 => _2431(node), 'optionalAccess', _2432 => _2432.kind]); } /** The table entry a use site resolves to (the declaration whose binding the * use refers to, proven), or undefined. */ @@ -22611,7 +23709,7 @@ var _RustTranspiler = class _RustTranspiler extends BaseTranspiler { /** Binding symbol of an identifier, or undefined when the checker cannot * answer (ByContent probes without a class context, for instance). */ rustSymbolOf(node) { - return _optionalChain([this, 'access', _2181 => _2181.checkerOrUndefined, 'call', _2182 => _2182(), 'optionalAccess', _2183 => _2183.getSymbolAtLocation, 'call', _2184 => _2184(node)]); + return _optionalChain([this, 'access', _2433 => _2433.checkerOrUndefined, 'call', _2434 => _2434(), 'optionalAccess', _2435 => _2435.getSymbolAtLocation, 'call', _2436 => _2436(node)]); } /** True when this identifier is a use of the given declaration's binding. * Without a checker answer the callers stay conservative (reject). */ @@ -22899,11 +23997,11 @@ ${classMethods} this.rustProHandlerShadowParam = shadowPlan.param; const statements = node.body.statements.map((s) => this.printNode(s, identation + 2)).join("\n"); this.rustProHandlerShadowParam = savedShadowParam; - const body = blockOpen + optionalInits + shadows + (_nullishCoalesce(_optionalChain([shadowPlan, 'optionalAccess', _2185 => _2185.lines]), () => ( ""))) + statements + blockClose; + const body = blockOpen + optionalInits + shadows + (_nullishCoalesce(_optionalChain([shadowPlan, 'optionalAccess', _2437 => _2437.lines]), () => ( ""))) + statements + blockClose; return this.printNodeCommentsIfAny(node, identation, methodDef + body); } printFunctionDefinition(node, identation) { - const name = _nullishCoalesce(_optionalChain([node, 'access', _2186 => _2186.name, 'optionalAccess', _2187 => _2187.text]), () => ( "")); + const name = _nullishCoalesce(_optionalChain([node, 'access', _2438 => _2438.name, 'optionalAccess', _2439 => _2439.text]), () => ( "")); const params = node.parameters; const parsedArgs = params.map((p) => `${this.printNode(p.name, 0)}: Value`).join(", "); const returnType = this.printRustFunctionType(node); @@ -22983,7 +24081,7 @@ ${classMethods} // A string literal prints as the bare `"lit"` (`&str` — no String // allocation); a checker-proven string drops the redundant `Value::Str` box. printErrorConstructorArg(name, index, node, identation) { - const kind = _optionalChain([_RustTranspiler, 'access', _2188 => _2188.RUST_ERROR_CONSTRUCTOR_ARGS, 'access', _2189 => _2189[name], 'optionalAccess', _2190 => _2190[index]]); + const kind = _optionalChain([_RustTranspiler, 'access', _2440 => _2440.RUST_ERROR_CONSTRUCTOR_ARGS, 'access', _2441 => _2441[name], 'optionalAccess', _2442 => _2442[index]]); if (kind === void 0) { return this.printNode(node, identation); } @@ -23003,7 +24101,7 @@ ${classMethods} return this.toSnakeCaseName(className); } printNewExpression(node, identation) { - let expression = _optionalChain([node, 'access', _2191 => _2191.expression, 'optionalAccess', _2192 => _2192.text]); + let expression = _optionalChain([node, 'access', _2443 => _2443.expression, 'optionalAccess', _2444 => _2444.text]); expression = expression ? expression : this.printNode(node.expression); if (expression === "Error") { const args2 = node.arguments.map((a) => this.printNode(a, identation)).join(", "); @@ -23046,19 +24144,19 @@ ${classMethods} return String(text).replace(/\\/g, "\\\\").replace(/"/g, '\\"').replace(/\n/g, "\\n").replace(/\r/g, "\\r").replace(/\t/g, "\\t"); } getCheckedTypeOf(node) { - return _optionalChain([this, 'access', _2193 => _2193.checkerOrUndefined, 'call', _2194 => _2194(), 'optionalAccess', _2195 => _2195.getTypeAtLocation, 'call', _2196 => _2196(node)]); + return _optionalChain([this, 'access', _2445 => _2445.checkerOrUndefined, 'call', _2446 => _2446(), 'optionalAccess', _2447 => _2447.getTypeAtLocation, 'call', _2448 => _2448(node)]); } typeSymbolOf(type) { if (type === void 0 || type === null) return void 0; - return _nullishCoalesce(_optionalChain([type, 'optionalAccess', _2197 => _2197.getSymbol, 'call', _2198 => _2198()]), () => ( _optionalChain([type, 'optionalAccess', _2199 => _2199.getAliasSymbol, 'call', _2200 => _2200()]))); + return _nullishCoalesce(_optionalChain([type, 'optionalAccess', _2449 => _2449.getSymbol, 'call', _2450 => _2450()]), () => ( _optionalChain([type, 'optionalAccess', _2451 => _2451.getAliasSymbol, 'call', _2452 => _2452()]))); } /** Types declared outside ts/src (Date, Response, Array, Promise, …) are never * backed by a plain `Value` map in the rust port. */ isLibDeclaredType(type) { - const declarations = _chunk4FDYB2TTcjs.symbolDeclarations.call(void 0, this.typeSymbolOf(type)); + const declarations = _chunkUBXMRIM6cjs.symbolDeclarations.call(void 0, this.typeSymbolOf(type)); return declarations.some((d) => { - const file = _nullishCoalesce(_optionalChain([d, 'optionalAccess', _2201 => _2201.getSourceFile, 'optionalCall', _2202 => _2202(), 'optionalAccess', _2203 => _2203.fileName]), () => ( "")); + const file = _nullishCoalesce(_optionalChain([d, 'optionalAccess', _2453 => _2453.getSourceFile, 'optionalCall', _2454 => _2454(), 'optionalAccess', _2455 => _2455.fileName]), () => ( "")); return /[\\/]lib\.[^\\/]*\.d\.ts$/.test(file) || /[\\/]node_modules[\\/]typescript[\\/]/.test(file); }); } @@ -23066,12 +24164,12 @@ ${classMethods} if (type === void 0) return false; if (type.flags & (_sync.TypeFlags.Union | _sync.TypeFlags.Intersection)) { - return (_nullishCoalesce(_chunk4FDYB2TTcjs.typeParts.call(void 0, type), () => ( []))).some((member) => this.isClassInstanceType(member)); + return (_nullishCoalesce(_chunkUBXMRIM6cjs.typeParts.call(void 0, type), () => ( []))).some((member) => this.isClassInstanceType(member)); } const symbol = _nullishCoalesce(this.typeSymbolOf(type), () => ( type.getAliasSymbol())); - if (_optionalChain([symbol, 'optionalAccess', _2204 => _2204.flags]) & _sync.SymbolFlags.Class) + if (_optionalChain([symbol, 'optionalAccess', _2456 => _2456.flags]) & _sync.SymbolFlags.Class) return true; - const declarations = _chunk4FDYB2TTcjs.symbolDeclarations.call(void 0, symbol); + const declarations = _chunkUBXMRIM6cjs.symbolDeclarations.call(void 0, symbol); return declarations.some((d) => _is.isClassDeclaration.call(void 0, d) || _is.isClassExpression.call(void 0, d)); } hasCallableShape(type) { @@ -23081,13 +24179,13 @@ ${classMethods} isProvenListType(type) { if (!(type.flags & _sync.TypeFlags.Object)) return false; - const objectFlags = (_nullishCoalesce(type.objectFlags, () => ( 0))) | (_nullishCoalesce(_optionalChain([_chunk4FDYB2TTcjs.typeTarget.call(void 0, type), 'optionalAccess', _2205 => _2205.objectFlags]), () => ( 0))); + const objectFlags = (_nullishCoalesce(type.objectFlags, () => ( 0))) | (_nullishCoalesce(_optionalChain([_chunkUBXMRIM6cjs.typeTarget.call(void 0, type), 'optionalAccess', _2457 => _2457.objectFlags]), () => ( 0))); if (objectFlags & _sync.ObjectFlags.Tuple) return true; - const name = _optionalChain([this, 'access', _2206 => _2206.typeSymbolOf, 'call', _2207 => _2207(type), 'optionalAccess', _2208 => _2208.name]); + const name = _optionalChain([this, 'access', _2458 => _2458.typeSymbolOf, 'call', _2459 => _2459(type), 'optionalAccess', _2460 => _2460.name]); if (name === "Array" || name === "ReadonlyArray") return true; - const targetName = _optionalChain([this, 'access', _2209 => _2209.typeSymbolOf, 'call', _2210 => _2210(_chunk4FDYB2TTcjs.typeTarget.call(void 0, type)), 'optionalAccess', _2211 => _2211.name]); + const targetName = _optionalChain([this, 'access', _2461 => _2461.typeSymbolOf, 'call', _2462 => _2462(_chunkUBXMRIM6cjs.typeTarget.call(void 0, type)), 'optionalAccess', _2463 => _2463.name]); return targetName === "Array" || targetName === "ReadonlyArray"; } /** True only for object types the rust port represents as `Value::Dict` @@ -23096,7 +24194,7 @@ ${classMethods} if (type === void 0) return false; if (type.flags & _sync.TypeFlags.Union) { - const parts = _nullishCoalesce(_chunk4FDYB2TTcjs.typeParts.call(void 0, type), () => ( [])); + const parts = _nullishCoalesce(_chunkUBXMRIM6cjs.typeParts.call(void 0, type), () => ( [])); const nullish = parts.filter((p) => this.rustTypeIsNullish(p)); const valueParts = parts.filter((p) => !this.rustTypeIsNullish(p)); return nullish.length > 0 && valueParts.length > 0 && valueParts.every((p) => this.isProvenMapType(p)); @@ -23164,7 +24262,7 @@ ${classMethods} if (!_is.isPropertyAccessExpression.call(void 0, node.expression)) return void 0; try { - return _chunk4FDYB2TTcjs.signatureDeclaration.call(void 0, this.getChecker().getResolvedSignature(node)); + return _chunkUBXMRIM6cjs.signatureDeclaration.call(void 0, this.getChecker().getResolvedSignature(node)); } catch (e) { return void 0; } @@ -23185,7 +24283,7 @@ ${classMethods} const visit = (node) => { if (!all) return; - if (node !== body && _chunk4FDYB2TTcjs.isFunctionLike.call(void 0, node)) + if (node !== body && _chunkUBXMRIM6cjs.isFunctionLike.call(void 0, node)) return; if (_is.isReturnStatement.call(void 0, node)) { returns++; @@ -23224,10 +24322,10 @@ ${classMethods} return void 0; return this.printNativeListIndex(receiverText, index); } - const dictRead = this.printNativeDynamicMapAccess(receiverText, receiverNode, keyNode); + const dictRead = _nullishCoalesce(_nullishCoalesce(this.printNativeDynamicMapAccess(receiverText, receiverNode, keyNode), () => ( this.printNativeThisFieldDynamicMapAccess(receiverText, receiverNode, keyNode))), () => ( this.rustR10DynamicRead(receiverText, receiverNode, keyNode))); if (dictRead !== void 0) return dictRead; - return this.printNativeDynamicListIndex(receiverText, receiverNode, keyNode); + return _nullishCoalesce(this.printNativeDynamicListIndex(receiverText, receiverNode, keyNode), () => ( this.r14ListArithIndex(receiverText, receiverNode, keyNode))); } /** `get_value(&X, &i)` for a checker-proven list `X` and a dynamic integer * index local `i`: the runtime's own array branch, spelled natively. @@ -23260,7 +24358,7 @@ ${classMethods} let statement = declaration; while (statement !== void 0 && !_is.isStatement.call(void 0, statement)) statement = statement.parent; - const siblings = _nullishCoalesce(_optionalChain([statement, 'optionalAccess', _2212 => _2212.parent, 'optionalAccess', _2213 => _2213.statements]), () => ( [])); + const siblings = _nullishCoalesce(_optionalChain([statement, 'optionalAccess', _2464 => _2464.parent, 'optionalAccess', _2465 => _2465.statements]), () => ( [])); const at = siblings.indexOf(statement); if (at < 0 || at + 1 >= siblings.length) return false; @@ -23325,7 +24423,7 @@ ${classMethods} const type = this.getCheckedTypeOf(node); if (type === void 0) return false; - const parts = type.flags & _sync.TypeFlags.Union ? _nullishCoalesce(_chunk4FDYB2TTcjs.typeParts.call(void 0, type), () => ( [])) : [type]; + const parts = type.flags & _sync.TypeFlags.Union ? _nullishCoalesce(_chunkUBXMRIM6cjs.typeParts.call(void 0, type), () => ( [])) : [type]; let strings = 0; for (const part of parts) { if (part.flags & (_sync.TypeFlags.String | _sync.TypeFlags.StringLiteral)) { @@ -23454,7 +24552,7 @@ ${classMethods} const emitted = this.rustParamShadowEmittedSet(); let scope = current.parent; while (scope !== void 0) { - if (_chunk4FDYB2TTcjs.isFunctionLike.call(void 0, scope)) { + if (_chunkUBXMRIM6cjs.isFunctionLike.call(void 0, scope)) { const entry = emitted.has(scope) ? this.rustParamShadowTable(scope).get(name) : void 0; if (entry !== void 0 && entry.declaration === declaration) return entry; @@ -23467,7 +24565,7 @@ ${classMethods} rustFunctionDeclaresName(fn, name) { let found = false; this.rustWalkScope(fn, (node) => { - if (_chunk4FDYB2TTcjs.isFunctionLike.call(void 0, node)) + if (_chunkUBXMRIM6cjs.isFunctionLike.call(void 0, node)) return RUST_WALK_SKIP; if ((_is.isVariableDeclaration.call(void 0, node) || _is.isParameterDeclaration.call(void 0, node)) && _is.isIdentifier.call(void 0, node.name) && node.name.text === name) { found = true; @@ -23511,17 +24609,17 @@ ${classMethods} return false; if (!(type.flags & _sync.TypeFlags.Object)) return false; - const objectFlags = (_nullishCoalesce(type.objectFlags, () => ( 0))) | (_nullishCoalesce(_optionalChain([_chunk4FDYB2TTcjs.typeTarget.call(void 0, type), 'optionalAccess', _2214 => _2214.objectFlags]), () => ( 0))); + const objectFlags = (_nullishCoalesce(type.objectFlags, () => ( 0))) | (_nullishCoalesce(_optionalChain([_chunkUBXMRIM6cjs.typeTarget.call(void 0, type), 'optionalAccess', _2466 => _2466.objectFlags]), () => ( 0))); if (objectFlags & _sync.ObjectFlags.Tuple) return false; if (this.hasCallableShape(type)) return false; if (this.isClassInstanceType(type)) return false; - const name = _optionalChain([this, 'access', _2215 => _2215.typeSymbolOf, 'call', _2216 => _2216(type), 'optionalAccess', _2217 => _2217.name]); + const name = _optionalChain([this, 'access', _2467 => _2467.typeSymbolOf, 'call', _2468 => _2468(type), 'optionalAccess', _2469 => _2469.name]); if (name === "Array" || name === "ReadonlyArray") return true; - const targetName = _optionalChain([this, 'access', _2218 => _2218.typeSymbolOf, 'call', _2219 => _2219(_chunk4FDYB2TTcjs.typeTarget.call(void 0, type)), 'optionalAccess', _2220 => _2220.name]); + const targetName = _optionalChain([this, 'access', _2470 => _2470.typeSymbolOf, 'call', _2471 => _2471(_chunkUBXMRIM6cjs.typeTarget.call(void 0, type)), 'optionalAccess', _2472 => _2472.name]); return targetName === "Array" || targetName === "ReadonlyArray"; } /** Every reference to the parameter must be a printable read, and at least @@ -23752,7 +24850,7 @@ ${classMethods} this.rustWalkScope(scope, (n) => { if (_is.isCallExpression.call(void 0, n) && n.arguments.length > 0 && _is.isIdentifier.call(void 0, n.arguments[0]) && n.arguments[0].text === name) { const callee = n.expression; - written = merging.includes(_is.isPropertyAccessExpression.call(void 0, callee) ? String(_nullishCoalesce(_optionalChain([callee, 'access', _2221 => _2221.name, 'optionalAccess', _2222 => _2222.text]), () => ( ""))) : _is.isIdentifier.call(void 0, callee) ? String(_nullishCoalesce(callee.text, () => ( ""))) : ""); + written = merging.includes(_is.isPropertyAccessExpression.call(void 0, callee) ? String(_nullishCoalesce(_optionalChain([callee, 'access', _2473 => _2473.name, 'optionalAccess', _2474 => _2474.text]), () => ( ""))) : _is.isIdentifier.call(void 0, callee) ? String(_nullishCoalesce(callee.text, () => ( ""))) : ""); if (written) return RUST_WALK_STOP; } @@ -23803,7 +24901,7 @@ ${ind}let ${view}: &${map} = &${arc}; return void 0; if (callee.expression.kind !== _ast.SyntaxKind.ThisKeyword) return void 0; - const kind = _RustTranspiler.PRO_HANDLER_SHADOW_SAFE_READS[String(_nullishCoalesce(_optionalChain([callee, 'access', _2223 => _2223.name, 'optionalAccess', _2224 => _2224.text]), () => ( "")))]; + const kind = _RustTranspiler.PRO_HANDLER_SHADOW_SAFE_READS[String(_nullishCoalesce(_optionalChain([callee, 'access', _2475 => _2475.name, 'optionalAccess', _2476 => _2476.text]), () => ( "")))]; if (kind === void 0) return void 0; const args = _nullishCoalesce(node.arguments, () => ( [])); @@ -23868,7 +24966,7 @@ ${ind}let ${view}: &${map} = &${arc}; return void 0; } printNativeMapAccess(receiverText, receiverNode, keyText) { - if (!this.isProvenMapExpression(receiverNode)) { + if (!this.isProvenMapExpression(receiverNode) && !this.rustR10LiteralReadOk(receiverNode, keyText)) { if (!this.rustIsDeclaredDictLocal(receiverNode)) return void 0; if (_RustTranspiler.RUST_DICT_LOCAL_UNSAFE_KEYS.has(keyText)) @@ -23884,7 +24982,7 @@ ${ind}let ${view}: &${map} = &${arc}; return void 0; try { const symbol = this.getChecker().getSymbolAtLocation(node); - return _chunk4FDYB2TTcjs.symbolValueDeclaration.call(void 0, symbol); + return _chunkUBXMRIM6cjs.symbolValueDeclaration.call(void 0, symbol); } catch (e) { return void 0; } @@ -23929,7 +25027,7 @@ ${ind}let ${view}: &${map} = &${arc}; /** D2: the proof holds only while nothing re-assigns the local. */ rustLocalIsReassigned(declaration, name) { let scope = declaration; - while (scope !== void 0 && !_chunk4FDYB2TTcjs.isFunctionLike.call(void 0, scope) && !_is.isSourceFile.call(void 0, scope)) + while (scope !== void 0 && !_chunkUBXMRIM6cjs.isFunctionLike.call(void 0, scope) && !_is.isSourceFile.call(void 0, scope)) scope = scope.parent; if (scope === void 0) return true; @@ -23945,7 +25043,7 @@ ${ind}let ${view}: &${map} = &${arc}; const declaration = this.rustDeclarationOfIdentifier(node); if (declaration === void 0) return false; - const name = _optionalChain([declaration, 'access', _2225 => _2225.name, 'optionalAccess', _2226 => _2226.text]); + const name = _optionalChain([declaration, 'access', _2477 => _2477.name, 'optionalAccess', _2478 => _2478.text]); if (typeof name !== "string") return false; if (_is.isParameterDeclaration.call(void 0, declaration)) { @@ -23967,7 +25065,7 @@ ${ind}let ${view}: &${map} = &${arc}; if (type2 === void 0) return false; const symbol = this.typeSymbolOf(type2); - const declarations = _chunk4FDYB2TTcjs.symbolDeclarations.call(void 0, symbol); + const declarations = _chunkUBXMRIM6cjs.symbolDeclarations.call(void 0, symbol); return declarations.some((d) => { if (!_is.isClassDeclaration.call(void 0, d) || d.name === void 0 || d.name.text !== "Client") return false; @@ -23978,7 +25076,7 @@ ${ind}let ${view}: &${map} = &${arc}; const type = this.getCheckedTypeOf(declaration.name); if (named(type)) return true; - return (_nullishCoalesce(_chunk4FDYB2TTcjs.typeParts.call(void 0, type), () => ( []))).some((member) => named(member)); + return (_nullishCoalesce(_chunkUBXMRIM6cjs.typeParts.call(void 0, type), () => ( []))).some((member) => named(member)); } /** Constant string argument of `parseInt`/`parseFloat` folded the way rust's * `str::parse` would; undefined when the fold is not obviously exact. */ @@ -24050,11 +25148,11 @@ ${ind}let ${view}: &${map} = &${arc}; * emitted where no such hoist is needed. */ isNativeAccessPositionSafe(node) { const parent = node.parent; - if (parent && (_is.isPropertyAccessExpression.call(void 0, parent) || _is.isCallExpression.call(void 0, parent)) && parent.expression === node) + if (parent && (_is.isPropertyAccessExpression.call(void 0, parent) || _is.isCallExpression.call(void 0, parent)) && parent.expression === node && !this.r21PureStringMethodReceiver(node)) return false; const root = this.rootPlaceText(node); for (let current = node.parent; current; current = current.parent) { - if (_is.isStatement.call(void 0, current) || _is.isSourceFile.call(void 0, current) || _chunk4FDYB2TTcjs.isFunctionLike.call(void 0, current)) + if (_is.isStatement.call(void 0, current) || _is.isSourceFile.call(void 0, current) || _chunkUBXMRIM6cjs.isFunctionLike.call(void 0, current)) break; if (_is.isBinaryExpression.call(void 0, current) && this.isNodeInsideNode(node, current.right)) { const op = current.operatorToken.kind; @@ -24195,6 +25293,9 @@ ${idn}}`; const nativeTruthiness = this.printNativeTruthiness(node); if (nativeTruthiness !== void 0) return idn + nativeTruthiness; + const r12Truthiness = this.rustR12NativeTruthiness(node); + if (r12Truthiness !== void 0) + return idn + r12Truthiness; const nativeCondition = this.printNativeParenthesizedCondition(node); if (nativeCondition !== void 0 && this.rustConditionBoolSlot(node)) return idn + nativeCondition; @@ -24311,9 +25412,9 @@ ${idn}}`; const ifBody = this.printBlock(node.thenStatement, identation, elseStatement !== void 0); const head = node.parent.kind === _ast.SyntaxKind.IfStatement ? "else if " : `${this.getIden(identation)}if `; let ifComplete = `${head}${this.printCondition(node.expression, 0)}${ifBody}`; - if (_optionalChain([elseStatement, 'optionalAccess', _2227 => _2227.kind]) === _ast.SyntaxKind.Block) { + if (_optionalChain([elseStatement, 'optionalAccess', _2479 => _2479.kind]) === _ast.SyntaxKind.Block) { ifComplete += ` else${this.printBlock(elseStatement, identation)}`; - } else if (_optionalChain([elseStatement, 'optionalAccess', _2228 => _2228.kind]) === _ast.SyntaxKind.IfStatement) { + } else if (_optionalChain([elseStatement, 'optionalAccess', _2480 => _2480.kind]) === _ast.SyntaxKind.IfStatement) { ifComplete += " " + this.printIfStatement(elseStatement, identation); } return this.printNodeCommentsIfAny(node, identation, ifComplete); @@ -24345,7 +25446,7 @@ ${idn}}`; if (operator !== _ast.SyntaxKind.MinusToken) return idn + this.PrefixFixOperators[operator] + this.printNode(operand, 0); const operandText = this.printNode(operand, 0); - return idn + (_nullishCoalesce(this.foldNegateLiteral(operandText), () => ( `negate(&${operandText})`))); + return idn + (_nullishCoalesce(_nullishCoalesce(this.foldNegateLiteral(operandText), () => ( this.printRustNativeNegate(operand, operandText))), () => ( `negate(&${operandText})`))); } printObjectLiteralExpression(node, identation) { const escapeKey = (s) => String(s).replace(/\\/g, "\\\\").replace(/"/g, '\\"').replace(/\n/g, "\\n").replace(/\r/g, "\\r").replace(/\t/g, "\\t"); @@ -24369,7 +25470,7 @@ ${this.getIden(identation)}})`; return `Value::from(vec![${node.elements.map((e) => this.printNode(e, 0)).join(", ")}])`; } printDeleteExpression(node, identation) { - return `remove(&mut ${this.printNode(node.expression.expression, 0)}, &${this.printNode(node.expression.argumentExpression, 0)})`; + return _nullishCoalesce(this.r05Delete(node), () => ( `remove(&mut ${this.printNode(node.expression.expression, 0)}, &${this.printNode(node.expression.argumentExpression, 0)})`)); } printInstanceOfExpression(node, identation) { return `${this.getIden(identation)}is_instance(&${this.printNode(node.left, 0)}, &${this.printNode(node.right, 0)})`; @@ -24413,13 +25514,13 @@ ${this.getIden(identation)}})`; } // Built-in method call overrides printArrayIsArrayCall(node, identation, parsedArg = void 0) { - return `Value::Bool(${_nullishCoalesce(this.nativeValuePredicateText("array", _optionalChain([node, 'optionalAccess', _2229 => _2229.arguments, 'optionalAccess', _2230 => _2230[0]]), parsedArg), () => ( `is_array(&${parsedArg})`))})`; + return `Value::Bool(${_nullishCoalesce(this.nativeValuePredicateText("array", _optionalChain([node, 'optionalAccess', _2481 => _2481.arguments, 'optionalAccess', _2482 => _2482[0]]), parsedArg), () => ( `is_array(&${parsedArg})`))})`; } printObjectKeysCall(node, identation, parsedArg = void 0) { - return `object_keys(&${parsedArg})`; + return _nullishCoalesce(_nullishCoalesce(_nullishCoalesce(this.r05Enum(node, parsedArg, "keys"), () => ( this.r18PredictionEnum(node, parsedArg, "keys"))), () => ( this.r21BaseEnum(node, parsedArg, "keys"))), () => ( `object_keys(&${parsedArg})`)); } printObjectValuesCall(node, identation, parsedArg = void 0) { - return `object_values(&${parsedArg})`; + return _nullishCoalesce(_nullishCoalesce(_nullishCoalesce(this.r05Enum(node, parsedArg, "values"), () => ( this.r18PredictionEnum(node, parsedArg, "values"))), () => ( this.r21BaseEnum(node, parsedArg, "values"))), () => ( `object_values(&${parsedArg})`)); } printJsonParseCall(node, identation, parsedArg = void 0) { return `json_parse(&${parsedArg})`; @@ -24428,7 +25529,7 @@ ${this.getIden(identation)}})`; return `json_stringify(&${parsedArg})`; } printMathFloorCall(node, identation, parsedArg = void 0) { - return `math_floor(&${parsedArg})`; + return _nullishCoalesce(this.printRustNativeMathCall(node, "floor", parsedArg), () => ( `math_floor(&${parsedArg})`)); } // No `.await` here: `printAwaitExpression` appends it for `await Promise.all(...)`. printPromiseAllCall(node, identation, parsedArg = void 0) { @@ -24439,37 +25540,43 @@ ${this.getIden(identation)}})`; return `${this.printNode(node.expression, identation)}.await`; } printMathRoundCall(node, identation, parsedArg = void 0) { - return `math_round(&${parsedArg})`; + return _nullishCoalesce(this.printRustNativeMathCall(node, "round", parsedArg), () => ( `math_round(&${parsedArg})`)); } printMathCeilCall(node, identation, parsedArg = void 0) { - return `math_ceil(&${parsedArg})`; + return _nullishCoalesce(this.printRustNativeMathCall(node, "ceil", parsedArg), () => ( `math_ceil(&${parsedArg})`)); } printNumberIsIntegerCall(node, identation, parsedArg = void 0) { return `is_integer(&${parsedArg})`; } printArrayPushCall(node, identation, name = void 0, parsedArg = void 0) { - return `append_to_array(&mut ${name}, ${parsedArg})`; + return _nullishCoalesce(_nullishCoalesce(this.printRustVecPush(node, name, parsedArg), () => ( this.r18ArrPush(node, name, parsedArg))), () => ( `append_to_array(&mut ${name}, ${parsedArg})`)); } printIncludesCall(node, identation, name = void 0, parsedArg = void 0) { return `Value::Bool(contains(&${name}, &${parsedArg}))`; } printIndexOfCall(node, identation, name = void 0, parsedArg = void 0) { - return _nullishCoalesce(this.printNativeStringIndexOf(node, name), () => ( `get_index_of(&${name}, &${parsedArg})`)); + return _nullishCoalesce(_nullishCoalesce(this.printNativeStringIndexOf(node, name), () => ( this.printNativeStringIndexOfString(node, name))), () => ( this.r30IndexOf(name, parsedArg))); } printStartsWithCall(node, identation, name = void 0, parsedArg = void 0) { + const native = _nullishCoalesce(this.printNativeStringAffixTest(node, name, "starts_with"), () => ( this.r17PrintAffixTest(node, name, "starts_with"))); + if (native !== void 0) + return `Value::Bool(${native})`; return `Value::Bool(starts_with(&${name}, &${parsedArg}))`; } printEndsWithCall(node, identation, name = void 0, parsedArg = void 0) { + const native = _nullishCoalesce(this.printNativeStringAffixTest(node, name, "ends_with"), () => ( this.r17PrintAffixTest(node, name, "ends_with"))); + if (native !== void 0) + return `Value::Bool(${native})`; return `Value::Bool(ends_with(&${name}, &${parsedArg}))`; } printTrimCall(node, identation, name = void 0) { - return `trim(&${name})`; + return _nullishCoalesce(this.r17PrintTrim(node, name), () => ( `trim(&${name})`)); } printJoinCall(node, identation, name = void 0, parsedArg = void 0) { - return `join(&${name}, &${parsedArg})`; + return _nullishCoalesce(_nullishCoalesce(this.r15PrintVecJoin(node), () => ( this.printNativeStringJoin(node, name))), () => ( `join(&${name}, &${parsedArg})`)); } printSplitCall(node, identation, name = void 0, parsedArg = void 0) { - return `split(&${name}, &${parsedArg})`; + return _nullishCoalesce(_nullishCoalesce(this.printNativeStringSplit(node, name), () => ( this.printRustR13Split(node, name))), () => ( `split(&${name}, &${parsedArg})`)); } printConcatCall(node, identation, name = void 0, parsedArg = void 0) { return `concat(${name}.clone(), ${parsedArg}.clone())`; @@ -24478,13 +25585,13 @@ ${this.getIden(identation)}})`; return `to_fixed(&${name}, &${parsedArg})`; } printToStringCall(node, identation, name = void 0) { - return `to_string_val(&${name})`; + return _nullishCoalesce(_nullishCoalesce(this.printRustNativeToString(node, name), () => ( this.printRustR13ToString(node, name))), () => ( `to_string_val(&${name})`)); } printToUpperCaseCall(node, identation, name = void 0) { - return `to_upper(&${name})`; + return _nullishCoalesce(_nullishCoalesce(this.printNativeStringCase(node, name, "to_uppercase"), () => ( this.printRustR13Case(node, name, "to_uppercase"))), () => ( this.r30Case(name, "to_uppercase"))); } printToLowerCaseCall(node, identation, name = void 0) { - return `to_lower(&${name})`; + return _nullishCoalesce(_nullishCoalesce(this.printNativeStringCase(node, name, "to_lowercase"), () => ( this.printRustR13Case(node, name, "to_lowercase"))), () => ( this.r30Case(name, "to_lowercase"))); } printShiftCall(node, identation, name = void 0) { return `shift(${name}.clone())`; @@ -24496,13 +25603,13 @@ ${this.getIden(identation)}})`; return `pop(${name}.clone())`; } printSliceCall(node, identation, name = void 0, parsedArg = void 0, parsedArg2 = void 0) { - return _nullishCoalesce(this.printNativeStringSlice(node, name), () => ( `slice(&${name}, &${parsedArg}, &${_nullishCoalesce(parsedArg2, () => ( "Value::Null"))})`)); + return _nullishCoalesce(this.printNativeStringSlice(node, name), () => ( this.r30Slice(name, parsedArg, _nullishCoalesce(parsedArg2, () => ( "Value::Null"))))); } printReplaceCall(node, identation, name = void 0, parsedArg = void 0, parsedArg2 = void 0) { - return `replace_str(&${name}, &${parsedArg}, &${parsedArg2})`; + return _nullishCoalesce(_nullishCoalesce(_nullishCoalesce(this.printNativeStringReplace(node, name), () => ( this.printRustR13Replace(node, name))), () => ( this.r17PrintReplace(node, name))), () => ( `replace_str(&${name}, &${parsedArg}, &${parsedArg2})`)); } printReplaceAllCall(node, identation, name = void 0, parsedArg = void 0, parsedArg2 = void 0) { - return `replace_all_str(&${name}, &${parsedArg}, &${parsedArg2})`; + return _nullishCoalesce(_nullishCoalesce(_nullishCoalesce(this.printNativeStringReplace(node, name), () => ( this.printRustR13Replace(node, name))), () => ( this.r17PrintReplace(node, name))), () => ( `replace_all_str(&${name}, &${parsedArg}, &${parsedArg2})`)); } // `{}` (Display) renders an ExchangeError as `[Kind] message`; `{:?}` would dump the struct fields. printThrowStatement(node, identation) { @@ -24510,7 +25617,7 @@ ${this.getIden(identation)}})`; } printTryStatement(node, identation) { const body = (block) => block.statements.map((s) => this.printNode(s, identation + 1)).join("\n"); - const rawName = _optionalChain([node, 'access', _2231 => _2231.catchClause, 'optionalAccess', _2232 => _2232.variableDeclaration, 'optionalAccess', _2233 => _2233.name, 'optionalAccess', _2234 => _2234.text]); + const rawName = _optionalChain([node, 'access', _2483 => _2483.catchClause, 'optionalAccess', _2484 => _2484.variableDeclaration, 'optionalAccess', _2485 => _2485.name, 'optionalAccess', _2486 => _2486.text]); const iden = this.getIden(identation); const errorName = rawName ? `_${rawName}` : "_e"; return `${iden}let _try_result = std::panic::catch_unwind(std::panic::AssertUnwindSafe(|| { @@ -24525,7 +25632,7 @@ ${iden}}`; const idn = this.getIden(identation); if (!exp) return `${idn}return;`; - const fn = _chunk4FDYB2TTcjs.findAncestor.call(void 0, node.parent, _chunk4FDYB2TTcjs.isFunctionLike); + const fn = _chunkUBXMRIM6cjs.findAncestor.call(void 0, node.parent, _chunkUBXMRIM6cjs.isFunctionLike); if (this.rustNativeStrReturnKind(fn) === "str" && this.rustStrReturnValueConverts(exp)) { if (this.literalKindOfNode(this.unwrapParensNode(exp)) === "null") return `${idn}return None;`; @@ -24546,25 +25653,2171 @@ ${iden}}`; printSpreadElement(node, identation) { return `${this.getIden(identation)}${this.printNode(node.expression, 0)}`; } -}; -// node kinds the printer types that the core per-file prefetch leaves to single round trips -_RustTranspiler.RUST_PREFETCH_TYPE_KINDS = /* @__PURE__ */ new Set([ - _ast.SyntaxKind.FalseKeyword, - _ast.SyntaxKind.TrueKeyword, - _ast.SyntaxKind.ParenthesizedExpression, - _ast.SyntaxKind.AwaitExpression, - _ast.SyntaxKind.PrefixUnaryExpression, - _ast.SyntaxKind.BooleanKeyword, - _ast.SyntaxKind.ObjectKeyword, - _ast.SyntaxKind.UnionType, - _ast.SyntaxKind.ConditionalExpression, - _ast.SyntaxKind.AsExpression -]); -// ── native equality emission ──────────────────────────────────────────── -// When the checker proves both operands hold the same primitive payload -// (string / number / boolean, or one side is a matching literal) the -// unwrapped payloads are compared with `==`/`!=` instead of is_equal(). -// Operators whose printed form is a bare Rust `bool` (not a Value). + rustR01NativeDictInsert(baseExpr, keyNode, keyText, valueText) { + if (!_is.isIdentifier.call(void 0, baseExpr) || !this.rustR01LocalStaysPlain(baseExpr)) { + return void 0; + } + const receiver = { text: String(baseExpr.text), isField: false, plain: true, nameNode: baseExpr }; + const keyArg = this.rustNativeInsertKeyArg(receiver, keyNode, keyText); + if (keyArg === void 0) { + return void 0; + } + const name = receiver.text; + const value = this.rustPrintedBoolArg(valueText) ? `Value::Bool(${valueText})` : valueText.trim(); + const insert = (val) => `if let Value::Dict(__d) = &mut ${name} { std::sync::Arc::make_mut(__d).insert(${keyArg}, ${val}); }`; + if (new RegExp(`\\b${name}\\b`).test(value)) { + return `{ let __be_tmp = ${value}; ${insert("__be_tmp")} }`; + } + if (/^[a-zA-Z_][a-zA-Z0-9_]*$/.test(value) && value !== "self" && value !== "true" && value !== "false") { + return insert(`${value}.clone()`); + } + return insert(value); + } + /** A local (single binding in its function, no closure capture of a write) + * whose declaration and every write is a plain-dict source or nullish. A + * nullish value leaves a non-Dict, which `if let Value::Dict` no-ops on + * exactly like the helper's `_ => {}` arm. */ + rustR01LocalStaysPlain(ident, depth = 0) { + const checker = this.checkerOrUndefined(); + const declarations = checker === void 0 ? [] : _chunkUBXMRIM6cjs.symbolDeclarations.call(void 0, checker.getSymbolAtLocation(ident)); + const declaration = declarations.length === 1 ? declarations[0] : void 0; + if (declaration === void 0 || depth > 4) { + return false; + } + if (declaration.kind === _ast.SyntaxKind.BindingElement) { + return this.rustR01TupleBindingStaysPlain(ident, declaration, depth); + } + if (!_is.isVariableDeclaration.call(void 0, declaration) || _optionalChain([declaration, 'access', _2487 => _2487.name, 'optionalAccess', _2488 => _2488.kind]) !== _ast.SyntaxKind.Identifier) { + return false; + } + const scope = this.rustEnclosingFunction(declaration); + if (scope === void 0 || _is.isSourceFile.call(void 0, scope) || this.rustEnclosingFunction(ident) !== scope) { + return false; + } + const name = String(ident.text); + const symbol = this.rustSymbolOf(declaration.name); + if (symbol === void 0) { + return false; + } + if (declaration.initializer !== void 0 && !this.rustR01PlainSource(declaration.initializer, name)) { + return false; + } + let plain = true; + for (const node of this.rustScopeNameNodes(scope, name)) { + if (node === declaration) + continue; + if (this.rustBindsName(node, name)) { + if (this.rustSymbolOf(node.name) === void 0) { + plain = false; + break; + } + continue; + } + if (node.kind !== _ast.SyntaxKind.Identifier || node === declaration.name || this.rustSymbolOf(node) !== symbol) + continue; + if (this.rustEnclosingFunction(node) !== scope) { + plain = false; + break; + } + if (!this.rustR01UseKeepsPlain(node, name)) { + plain = false; + break; + } + } + return plain; + } + /** `const [ x, p ] = this.handleUntilOption (k, r, …)` with `r` itself a + * plain local: element 0 is `r` handed back, and `x` is never re-written. */ + rustR01TupleBindingStaysPlain(ident, element, depth) { + const pattern = element.parent; + const declaration = _optionalChain([pattern, 'optionalAccess', _2489 => _2489.parent]); + if (_optionalChain([pattern, 'optionalAccess', _2490 => _2490.kind]) !== _ast.SyntaxKind.ArrayBindingPattern || declaration === void 0 || !_is.isVariableDeclaration.call(void 0, declaration) || ![0, 1].includes(pattern.elements.indexOf(element)) || _optionalChain([element, 'access', _2491 => _2491.name, 'optionalAccess', _2492 => _2492.kind]) !== _ast.SyntaxKind.Identifier || element.initializer !== void 0 || element.dotDotDotToken !== void 0) { + return false; + } + if (pattern.elements.indexOf(element) === 1 ? !this.r26ParamsSlot(declaration.initializer, void 0, depth) : !this.rustR01TupleHeadIsPlain(declaration.initializer, void 0, depth)) { + return false; + } + const scope = this.rustEnclosingFunction(declaration); + const name = String(ident.text); + const symbol = this.rustSymbolOf(element.name); + if (scope === void 0 || symbol === void 0 || this.rustEnclosingFunction(ident) !== scope) { + return false; + } + for (const node of this.rustScopeNameNodes(scope, name)) { + if (node.kind !== _ast.SyntaxKind.Identifier || node === element.name || this.rustSymbolOf(node) !== symbol) + continue; + if (this.rustEnclosingFunction(node) !== scope || !this.rustR01UseKeepsPlain(node, name)) + return false; + } + return true; + } + /** The shipped construction proof (literal-built local / handler tuple), read-only. */ + rustR01ShippedPlain(ident) { + const declaration = this.rustSingleLocalDeclaration(ident); + return declaration !== void 0 && _is.isVariableDeclaration.call(void 0, declaration) && this.rustInsertReceiverBuildsPlainDict(declaration); + } + /** A use of the local: reads and element writes keep the box; a direct + * assignment must store a plain source; any other write shape rejects. */ + rustR01UseKeepsPlain(node, name) { + let target = node; + while (target.parent !== void 0 && (_is.isParenthesizedExpression.call(void 0, target.parent) || _is.isNonNullExpression.call(void 0, target.parent) || _is.isAsExpression.call(void 0, target.parent))) { + target = target.parent; + } + const parent = target.parent; + if (parent === void 0) + return true; + if (_is.isBinaryExpression.call(void 0, parent) && parent.left === target && rustIsAssignmentOperator(parent.operatorToken.kind)) { + return parent.operatorToken.kind === _ast.SyntaxKind.EqualsToken && this.rustR01PlainSource(parent.right, name); + } + if (parent.kind === _ast.SyntaxKind.ArrayLiteralExpression) { + const assign = parent.parent; + if (assign !== void 0 && _is.isBinaryExpression.call(void 0, assign) && assign.left === parent) { + return this.rustR01RequestTupleWrite(assign.right, parent.elements.indexOf(target), name); + } + } + if ((parent.kind === _ast.SyntaxKind.PropertyAssignment || parent.kind === _ast.SyntaxKind.ShorthandPropertyAssignment) && !(parent.kind === _ast.SyntaxKind.PropertyAssignment && parent.initializer !== target)) { + let literal = parent.parent; + while (_optionalChain([literal, 'optionalAccess', _2493 => _2493.parent]) !== void 0 && (_is.isParenthesizedExpression.call(void 0, literal.parent) || _is.isAsExpression.call(void 0, literal.parent))) + literal = literal.parent; + if (_optionalChain([literal, 'optionalAccess', _2494 => _2494.parent]) === void 0 || _is.isVariableDeclaration.call(void 0, literal.parent)) + return false; + } + if (parent.kind === _ast.SyntaxKind.PrefixUnaryExpression || parent.kind === _ast.SyntaxKind.PostfixUnaryExpression || parent.kind === _ast.SyntaxKind.DeleteExpression || (_is.isForOfStatement.call(void 0, parent) || _is.isForInStatement.call(void 0, parent)) && parent.initializer === target) { + return false; + } + return true; + } + /** `[ x, … ] = this.handleUntilOption (k, x, …)` — element 0 is the request + * argument handed back (base-tier implementation, no override). */ + rustR01RequestTupleWrite(rhs, index, name) { + return index === 1 ? this.r26ParamsSlot(rhs, name, 0) : index === 0 && this.rustR01TupleHeadIsPlain(rhs, name, 0); + } + /** Element 0 of `this.m (…)` is a plain dict: `m` is the base-tier + * `handleUntilOption` (returns its `request` argument), or a method of the + * calling file (Rust calls it statically) whose every `return [ X, … ]` + * has X a plain literal / plain local, or a parameter whose argument here is. */ + rustR01TupleHeadIsPlain(rhs, selfName, depth) { + const call = this.rustStripWrappers(rhs); + if (depth > 4 || call === void 0 || !_is.isCallExpression.call(void 0, call) || !_is.isPropertyAccessExpression.call(void 0, call.expression) || call.expression.expression.kind !== _ast.SyntaxKind.ThisKeyword) { + return false; + } + const argPlain = (index) => { + const arg = this.rustStripWrappers(call.arguments[index]); + return arg !== void 0 && (this.rustPlainDictLiteral(arg) || _is.isIdentifier.call(void 0, arg) && (String(arg.text) === selfName || this.rustR01LocalStaysPlain(arg, depth + 1) || this.rustR01ShippedPlain(arg))); + }; + if (_RustTranspiler.RUST_R01_REQUEST_TUPLE_HELPERS.has(String(call.expression.name.text))) { + return this.rustR01CalleeIsBase(call) && argPlain(1); + } + let declaration; + try { + declaration = _chunkUBXMRIM6cjs.signatureDeclaration.call(void 0, this.getChecker().getResolvedSignature(call)); + } catch (e) { + return false; + } + if (_optionalChain([declaration, 'optionalAccess', _2495 => _2495.kind]) !== _ast.SyntaxKind.MethodDeclaration || declaration.body === void 0 || declaration.getSourceFile() !== call.getSourceFile()) { + return false; + } + let plain = true; + let returns = 0; + this.rustWalkScope(declaration.body, (n) => { + if (_is.isArrowFunction.call(void 0, n) || n.kind === _ast.SyntaxKind.FunctionExpression) + return RUST_WALK_SKIP; + if (!_is.isReturnStatement.call(void 0, n)) + return; + returns++; + const tuple = this.rustStripWrappers(n.expression); + const head = _optionalChain([tuple, 'optionalAccess', _2496 => _2496.kind]) === _ast.SyntaxKind.ArrayLiteralExpression ? this.rustStripWrappers(tuple.elements[0]) : void 0; + const param = head !== void 0 && _is.isIdentifier.call(void 0, head) ? declaration.parameters.findIndex((p) => _optionalChain([p, 'access', _2497 => _2497.name, 'optionalAccess', _2498 => _2498.kind]) === _ast.SyntaxKind.Identifier && String(p.name.text) === String(head.text)) : -1; + const ok = head !== void 0 && (this.rustPlainDictLiteral(head) || (param >= 0 ? this.rustSymbolOf(head) === this.rustSymbolOf(declaration.parameters[param].name) && argPlain(param) && this.rustR01ParamUnassigned(declaration, String(head.text)) : _is.isIdentifier.call(void 0, head) && this.rustR01LocalStaysPlain(head, depth + 1))); + if (!ok) { + plain = false; + return RUST_WALK_STOP; + } + }); + return plain && returns > 0; + } + /** A pass-through parameter: never assigned in the method body. */ + rustR01ParamUnassigned(method, name) { + let kept = true; + this.rustWalkScope(method.body, (n) => { + if (_is.isBinaryExpression.call(void 0, n) && rustIsAssignmentOperator(n.operatorToken.kind) && _is.isIdentifier.call(void 0, n.left) && String(n.left.text) === name) { + kept = false; + return RUST_WALK_STOP; + } + }); + return kept; + } + /** A value that is a fresh plain dict, nullish, or the local itself. */ + rustR01PlainSource(node, name) { + const stripped = this.rustStripWrappers(node); + if (stripped === void 0) + return false; + if (this.rustPlainDictLiteral(stripped) || this.rustTypeIsUndefinedish(stripped) || _is.isIdentifier.call(void 0, stripped) && String(stripped.text) === name) { + return true; + } + if (_is.isConditionalExpression.call(void 0, stripped)) { + return this.rustR01PlainSource(stripped.whenTrue, name) && this.rustR01PlainSource(stripped.whenFalse, name); + } + if (_is.isCallExpression.call(void 0, stripped) && _is.isPropertyAccessExpression.call(void 0, stripped.expression) && stripped.expression.expression.kind === _ast.SyntaxKind.ThisKeyword && _RustTranspiler.RUST_R01_PLAIN_DICT_BUILDERS.has(String(stripped.expression.name.text))) { + return this.rustR01CalleeIsBase(stripped); + } + if (this.rustR12PlainSource(stripped)) + return true; + if (_is.isCallExpression.call(void 0, stripped) && _is.isPropertyAccessExpression.call(void 0, stripped.expression) && stripped.expression.expression.kind === _ast.SyntaxKind.ThisKeyword && stripped.arguments.length > 0 && this.rustR01CalleeIsBase(stripped)) { + const callee = String(stripped.expression.name.text); + const first = this.rustStripWrappers(stripped.arguments[0]); + if (callee === "omit" || callee === "keysort") { + return first !== void 0 && _is.isIdentifier.call(void 0, first) && String(first.text) === name; + } + if (callee === "extend") { + return stripped.arguments.every((a) => this.rustR01PlainSource(a, name)); + } + } + return false; + } + /** The checker resolves the call to the base-tier implementation (a venue + * override could return anything). */ + rustR01CalleeIsBase(call) { + let declaration; + try { + declaration = _chunkUBXMRIM6cjs.signatureDeclaration.call(void 0, this.getChecker().getResolvedSignature(call)); + } catch (e) { + return false; + } + return declaration !== void 0 && (declaration.body !== void 0 || this.r14BaseOverload(declaration)) && _RustTranspiler.RUST_BASE_TIER_FILE.test(String(declaration.getSourceFile().fileName).replace(/\\/g, "/")); + } + // hx4 R02 + // `this.[k]`: a class property whose declared type proves a plain dict is a + // container struct field (never a book/cache/side/client/live marker dict), so + // `get_value`'s marker routes cannot fire and the read is `m.get(k)`. + /** The class property declaration behind `this.` when its annotation proves a plain dict. */ + rustProvenDictThisField(node) { + if (!_is.isPropertyAccessExpression.call(void 0, node) || node.expression.kind !== _ast.SyntaxKind.ThisKeyword) + return void 0; + let declaration; + try { + declaration = _chunkUBXMRIM6cjs.symbolValueDeclaration.call(void 0, this.getChecker().getSymbolAtLocation(node.name)); + } catch (e) { + return void 0; + } + if (declaration === void 0 || declaration.kind !== _ast.SyntaxKind.PropertyDeclaration || declaration.type === void 0) + return void 0; + const type = this.getCheckedTypeOf(declaration.type); + return type !== void 0 && this.isProvenMapType(type) ? declaration : void 0; + } + /** `this.[a]` whose declared field type's element type is itself a plain dict + * (`Dictionary>`). */ + rustProvenDictThisFieldElement(node) { + if (!_is.isElementAccessExpression.call(void 0, node)) + return false; + const field = this.rustProvenDictThisField(node.expression); + if (field === void 0) + return false; + const fieldType = this.getCheckedTypeOf(field.type); + const parts = fieldType.flags & _sync.TypeFlags.Union ? (_nullishCoalesce(_chunkUBXMRIM6cjs.typeParts.call(void 0, fieldType), () => ( []))).filter((p) => !this.rustTypeIsNullish(p)) : [fieldType]; + return parts.length === 1 && this.isProvenMapType(this.getChecker().getIndexTypeOfType(parts[0], _sync.IndexKind.String)); + } + /** `this.[k]` with a proven-dict field and a proven string key place. */ + printNativeThisFieldDynamicMapAccess(receiverText, receiverNode, keyNode) { + if (this.rustProvenDictThisField(receiverNode) === void 0 && !this.rustProvenDictThisFieldElement(receiverNode)) + return void 0; + if (!this.rustKeyIsProvenString(keyNode)) + return void 0; + const keyText = this.printNode(keyNode, 0).trim(); + if (!/^[A-Za-z_][A-Za-z0-9_]*$/.test(keyText)) + return void 0; + return `${receiverText}.as_map().and_then(|__m| ${keyText}.as_str().and_then(|__k| __m.get(__k))).cloned().unwrap_or(Value::Null)`; + } + rustVecLocalIsTyped(declaration) { + if (_optionalChain([declaration, 'optionalAccess', _2499 => _2499.kind]) !== _ast.SyntaxKind.VariableDeclaration) + return false; + let decision = this.rustVecLocalDecisions.get(declaration); + if (decision === void 0) { + this.rustVecLocalDecisions.set(declaration, false); + decision = this.rustVecLocalIsTypedUncached(declaration); + this.rustVecLocalDecisions.set(declaration, decision); + } + return decision; + } + rustVecLocalIsTypedUncached(declaration) { + const init = declaration.initializer; + if (_optionalChain([declaration, 'access', _2500 => _2500.name, 'optionalAccess', _2501 => _2501.kind]) !== _ast.SyntaxKind.Identifier || init === void 0 || !_is.isArrayLiteralExpression.call(void 0, init) || init.elements.length !== 0) + return false; + const checker = this.checkerOrUndefined(); + const type = _optionalChain([checker, 'optionalAccess', _2502 => _2502.getTypeAtLocation, 'call', _2503 => _2503(declaration.name)]); + if (type === void 0 || !checker.isArrayType(type)) + return false; + const name = String(declaration.name.text); + const fn = this.rustEnclosingFunction(declaration); + if (fn === void 0 || _is.isSourceFile.call(void 0, fn)) + return false; + const source = _optionalChain([declaration, 'access', _2504 => _2504.getSourceFile, 'optionalCall', _2505 => _2505(), 'optionalAccess', _2506 => _2506.fileName]); + if (typeof source === "string" && /\/test\//.test(source)) + return false; + let pushes = 0; + const safe = this.rustLocalUsesAll(declaration, name, false, (n) => { + const parent = n.parent; + if (_is.isPropertyAccessExpression.call(void 0, parent) && parent.name === n || _optionalChain([parent, 'optionalAccess', _2507 => _2507.kind]) === _ast.SyntaxKind.PropertyAssignment && parent.name === n) + return true; + if (this.rustEnclosingFunction(n) !== fn) + return false; + if (_is.isPropertyAccessExpression.call(void 0, parent) && parent.expression === n) { + const member = String(parent.name.text); + if (member === "length") { + const up = parent.parent; + return !(_is.isBinaryExpression.call(void 0, up) && up.left === parent && rustIsAssignmentOperator(up.operatorToken.kind)) && _optionalChain([up, 'optionalAccess', _2508 => _2508.kind]) !== _ast.SyntaxKind.PrefixUnaryExpression && _optionalChain([up, 'optionalAccess', _2509 => _2509.kind]) !== _ast.SyntaxKind.PostfixUnaryExpression; + } + if (member === "push" && this.rustVecPushShape(parent.parent, name)) { + pushes++; + return true; + } + return this.r15VecJoinUse(parent); + } + return this.rustVecValueUse(n, name) || this.r11VecUse(n) || this.r15VecPropertyUse(n); + }); + return safe && pushes > 0; + } + // `x.push(v);` as a whole statement, one non-spread argument not naming `x`. + rustVecPushShape(call, name) { + if (!_is.isCallExpression.call(void 0, call) || call.arguments.length !== 1 || _optionalChain([call, 'access', _2510 => _2510.parent, 'optionalAccess', _2511 => _2511.kind]) !== _ast.SyntaxKind.ExpressionStatement) + return false; + const arg = call.arguments[0]; + if (arg.kind === _ast.SyntaxKind.SpreadElement) + return false; + let mentions = false; + const visit = (m) => { + if (mentions) + return; + if (m.kind === _ast.SyntaxKind.Identifier && m.text === name) { + mentions = true; + return; + } + _optionalChain([m, 'access', _2512 => _2512.forEachChild, 'optionalCall', _2513 => _2513(visit)]); + }; + visit(arg); + return !mentions; + } + // `return x` / `return f(.., x, ..)` with `x` named once in the statement: a boxing move. + // Elsewhere a boxing argument / object-literal value must be the local's last use outside any loop. + rustVecValueUse(n, name) { + const parent = n.parent; + if (_is.isReturnStatement.call(void 0, parent)) + return true; + const isArg = _is.isCallExpression.call(void 0, parent) && parent.arguments.some((a) => a === n) && this.rustVecBoxingCallee(parent.expression); + const isProp = _optionalChain([parent, 'optionalAccess', _2514 => _2514.kind]) === _ast.SyntaxKind.PropertyAssignment && parent.initializer === n; + if (!isArg && !isProp) + return false; + let statement = parent; + while (statement !== void 0 && !_is.isStatement.call(void 0, statement)) + statement = statement.parent; + if (statement === void 0) + return false; + if (!_is.isReturnStatement.call(void 0, statement) && !this.rustVecIsFinalUse(n, name)) + return false; + let count = 0; + const visit = (m) => { + if (m.kind === _ast.SyntaxKind.Identifier && m.text === name) + count++; + _optionalChain([m, 'access', _2515 => _2515.forEachChild, 'optionalCall', _2516 => _2516(visit)]); + }; + visit(statement); + return count === 1; + } + rustVecIsFinalUse(n, name) { + const fn = this.rustEnclosingFunction(n); + for (let current = n.parent; current !== void 0 && current !== fn; current = current.parent) { + switch (current.kind) { + case _ast.SyntaxKind.ForStatement: + case _ast.SyntaxKind.ForInStatement: + case _ast.SyntaxKind.ForOfStatement: + case _ast.SyntaxKind.WhileStatement: + case _ast.SyntaxKind.DoStatement: + return false; + } + } + const end = _nullishCoalesce(_optionalChain([n, 'access', _2517 => _2517.getEnd, 'optionalCall', _2518 => _2518()]), () => ( n.end)); + return !this.rustScopeNameNodes(fn, name).some((m) => m.kind === _ast.SyntaxKind.Identifier && m !== n && (_nullishCoalesce(_optionalChain([m, 'access', _2519 => _2519.getStart, 'optionalCall', _2520 => _2520()]), () => ( m.pos))) >= end && !this.rustIdentifierIsPropertyName(m)); + } + // `this.m(..)` / `super.m(..)` / `Promise.all(..)`: every argument prints through printNode as a `Value`. + rustVecBoxingCallee(callee) { + if (!_is.isPropertyAccessExpression.call(void 0, callee)) + return false; + const receiver = callee.expression; + if (receiver.kind === _ast.SyntaxKind.ThisKeyword || receiver.kind === _ast.SyntaxKind.SuperKeyword) + return true; + return receiver.kind === _ast.SyntaxKind.Identifier && receiver.text === "Promise" && String(callee.name.text) === "all"; + } + rustVecLocalDeclarationOf(node) { + if (_optionalChain([node, 'optionalAccess', _2521 => _2521.kind]) !== _ast.SyntaxKind.Identifier) + return void 0; + const checker = this.checkerOrUndefined(); + const symbol = _optionalChain([checker, 'optionalAccess', _2522 => _2522.getSymbolAtLocation, 'call', _2523 => _2523(node)]); + const declaration = _nullishCoalesce(_chunkUBXMRIM6cjs.symbolValueDeclaration.call(void 0, symbol), () => ( _chunkUBXMRIM6cjs.symbolDeclarations.call(void 0, symbol)[0])); + return declaration !== void 0 && declaration.name !== node && this.rustVecLocalIsTyped(declaration) ? declaration : void 0; + } + printRustVecPush(node, name, parsedArg) { + const receiver = _optionalChain([node, 'optionalAccess', _2524 => _2524.expression, 'optionalAccess', _2525 => _2525.expression]); + if (name === void 0 || parsedArg === void 0 || this.rustVecLocalDeclarationOf(receiver) === void 0) + return void 0; + const arg = parsedArg.trim(); + const value = /^[a-zA-Z_][a-zA-Z0-9_]*$/.test(arg) && arg !== "self" && arg !== "true" && arg !== "false" ? `${arg}.clone()` : arg; + return `${name}.push(${value})`; + } + transformIdentifier(node, identifier) { + const text = super.transformIdentifier(node, identifier); + const parent = _optionalChain([node, 'optionalAccess', _2526 => _2526.parent]); + if (parent === void 0 || !(_is.isReturnStatement.call(void 0, parent) || _is.isCallExpression.call(void 0, parent) && parent.arguments.some((a) => a === node) && this.rustVecBoxingCallee(parent.expression) || parent.kind === _ast.SyntaxKind.PropertyAssignment && parent.initializer === node)) + return text; + if (this.rustVecLocalDeclarationOf(node) === void 0) + return text; + return this.rustVecValueUse(node, String(node.text)) ? `Value::from(${text})` : `Value::from(${text}.clone())`; + } + // hx4 R05 — native IndexMap ops for `k in X`, `delete X[k]`, `Object.keys/values(X)`. + /** Source path of a node (forward slashes). */ + r05Path(node) { + const src = _optionalChain([node, 'optionalAccess', _2527 => _2527.getSourceFile, 'optionalCall', _2528 => _2528()]); + return typeof _optionalChain([src, 'optionalAccess', _2529 => _2529.fileName]) === "string" ? src.fileName.replace(/\\/g, "/") : ""; + } + /** Test sources keep the helpers: tests-pipeline post-passes match `in_op(` text. */ + r05IsTest(node) { + return /\/test\//.test(this.r05Path(node)); + } + /** `k in X` with a non-literal key on a dict-shaped receiver: `in_op`'s Dict arm. + * The Arr arm is the only other `true` path; the dict proof excludes it. */ + r05InOp(key, obj) { + const recv = this.rustStripWrappers(obj); + if (this.r05IsTest(obj) || !this.isShallowValueReceiver(recv) || this.rustParamShadowOf(recv) !== void 0 || _is.isPropertyAccessExpression.call(void 0, recv) && _RustTranspiler.RUST_TAGGED_CONTAINER_FIELDS.has(String(recv.name.text)) || !this.isDictShapedType(this.typeOfNodeIfAny(obj))) { + return void 0; + } + const objExpr = this.printNode(obj, 0).trim(); + const keyExpr = this.printNode(key, 0).trim(); + if (!/^[A-Za-z_][A-Za-z0-9_]*$/.test(keyExpr) || keyExpr === "self") { + return void 0; + } + return `Value::Bool(matches!((&${objExpr}, &${keyExpr}), (Value::Dict(__d), Value::Str(__k)) if __d.contains_key(__k.as_ref())))`; + } + /** `delete X[k]` on a receiver the native-insert proof admits (never a ws + * subscriptions snapshot, so `try_ws_subs_remove` is dead): `shift_remove`. */ + r05Delete(node) { + const target = _optionalChain([node, 'optionalAccess', _2530 => _2530.expression]); + if (target === void 0 || !_is.isElementAccessExpression.call(void 0, target) || this.r05IsTest(node)) { + return void 0; + } + const base = target.expression; + const receiver = this.rustNativeInsertReceiver(base); + const restTier = /\/ts\/src\/[^/]+\.ts$/.test(this.r05Path(node)); + if (receiver !== void 0 && !receiver.isField && !restTier && receiver.plain !== true) { + return void 0; + } + if (receiver === void 0 || this.rustParamShadowOf(base) !== void 0 || !this.rustReceiverStaysDict(base, receiver) || receiver.isField && _RustTranspiler.RUST_TAGGED_CONTAINER_FIELDS.has(String(receiver.nameNode.text)) || !receiver.isField && this.rustLocalInitReadsTaggedContainer(base)) { + return void 0; + } + const recv = this.printNode(base, 0).trim(); + const keyNode = target.argumentExpression; + const literal = _is.isStringLiteral.call(void 0, keyNode) ? this.rustStringLiteralOf(this.printNode(keyNode, 0).trim()) : void 0; + if (literal !== void 0) { + return `if let Value::Dict(__d) = &mut ${recv} { std::sync::Arc::make_mut(__d).shift_remove(${literal}); }`; + } + const keyExpr = this.printNode(keyNode, 0).trim(); + if (!/^[A-Za-z_][A-Za-z0-9_]*$/.test(keyExpr) || keyExpr === "self" || keyExpr === recv) { + return void 0; + } + return `if let (Value::Dict(__d), Value::Str(__k)) = (&mut ${recv}, &${keyExpr}) { std::sync::Arc::make_mut(__d).shift_remove(__k.as_ref()); }`; + } + /** `this.` with a declared plain-dict type that is no ws container: the + * hand-written base builds these maps itself and never tags them. */ + r05UntaggedField(node) { + return _is.isPropertyAccessExpression.call(void 0, node) && node.expression.kind === _ast.SyntaxKind.ThisKeyword && !_RustTranspiler.RUST_TAGGED_CONTAINER_FIELDS.has(String(node.name.text)) && !_RustTranspiler.RUST_TAGGED_HANDLE_FIELDS.has(String(node.name.text)) && this.rustProvenDictThisFieldR05(node); + } + rustProvenDictThisFieldR05(node) { + let declaration; + try { + declaration = _chunkUBXMRIM6cjs.symbolValueDeclaration.call(void 0, this.getChecker().getSymbolAtLocation(node.name)); + } catch (e) { + return false; + } + if (declaration === void 0 || declaration.kind !== _ast.SyntaxKind.PropertyDeclaration || declaration.type === void 0) + return false; + const type = this.getCheckedTypeOf(declaration.type); + return type !== void 0 && this.isProvenMapType(type); + } + /** `Object.keys/values(X)` in REST-tier sources (`ts/src/.ts`): no ws client + * there, so X never carries the `__ws_subs_url`/`__ws_sub_ref` tags the helper filters. */ + r05Enum(node, parsedArg, kind) { + const arg = this.rustStripWrappers(_optionalChain([node, 'optionalAccess', _2531 => _2531.arguments, 'optionalAccess', _2532 => _2532[0]])); + if (arg === void 0 || parsedArg === void 0 || !(/\/ts\/src\/[^/]+\.ts$/.test(this.r05Path(node)) || this.r05UntaggedField(arg)) || !(_is.isIdentifier.call(void 0, arg) || _is.isPropertyAccessExpression.call(void 0, arg) || _is.isElementAccessExpression.call(void 0, arg) || _is.isCallExpression.call(void 0, arg)) || this.rustParamShadowOf(arg) !== void 0) { + return void 0; + } + const type = this.typeOfNodeIfAny(arg); + const parts = type === void 0 ? [] : type.flags & _sync.TypeFlags.Union ? _nullishCoalesce(_chunkUBXMRIM6cjs.typeParts.call(void 0, type), () => ( [])) : [type]; + if (parts.some((p) => this.getChecker().isArrayType(p) || this.getChecker().isTupleType(p) || (p.flags & (_sync.TypeFlags.StringLike | _sync.TypeFlags.NumberLike | _sync.TypeFlags.BooleanLike | _sync.TypeFlags.BigIntLike)) !== 0)) { + return void 0; + } + const text = parsedArg.trim(); + const recv = /^[A-Za-z_][A-Za-z0-9_.]*$/.test(text) ? text : `(${text})`; + const body = kind === "keys" ? "__m.keys().map(|__k| Value::Str(__k.clone().into())).collect()" : "__m.values().cloned().collect()"; + return `Value::Array(${recv}.as_map().map(|__m| ${body}).unwrap_or_default())`; + } + // hx4 R06: string methods on a checker-proven string receiver print native `str` code. The + // receiver is a `Value`; `as_str()` reaches the payload and its `None` arm is the helper's + // non-`Str` branch (Null / false / empty array / -1). Literal operands only, unless noted. + /** Printed receiver usable as a method receiver, else undefined. */ + rustNativeStringReceiver(node, receiverText, kind = "string") { + if (node === void 0 || !_is.isCallExpression.call(void 0, node) || !_is.isPropertyAccessExpression.call(void 0, node.expression)) + return void 0; + if (typeof receiverText !== "string" || receiverText.includes("\n") || receiverText.trim().startsWith("&")) + return void 0; + const receiver = node.expression.expression; + if (receiver.kind === _ast.SyntaxKind.ThisKeyword || receiver.kind === _ast.SyntaxKind.SuperKeyword) + return void 0; + if (kind === "string" && this.primitiveKindOfType(this.typeOfNodeIfAny(receiver)) !== "string") + return void 0; + if (_is.isIdentifier.call(void 0, receiver) && this.rustStringLocalIdentifierIsTyped(receiver)) + return void 0; + const text = receiverText.trim(); + return /^[A-Za-z_][A-Za-z0-9_]*(\.[A-Za-z_][A-Za-z0-9_]*)*$/.test(text) ? text : `(${text})`; + } + /** Escaped text of a string-literal argument, else undefined. */ + rustNativeStringLiteralArg(node) { + if (node === void 0 || !_is.isStringLiteral.call(void 0, node) && !_is.isNoSubstitutionTemplateLiteral.call(void 0, node)) + return void 0; + if (node.text in this.StringLiteralReplacements) + return void 0; + return this.escapeRustStringLiteral(node.text); + } + // `x.toUpperCase()` / `x.toLowerCase()`: the helper's `Value::Str` arm, Null otherwise. + printNativeStringCase(node, receiverText, method) { + const receiver = this.rustNativeStringReceiver(node, receiverText); + if (receiver === void 0 || (_nullishCoalesce(_optionalChain([node, 'access', _2533 => _2533.arguments, 'optionalAccess', _2534 => _2534.length]), () => ( 0))) !== 0) + return void 0; + return `${receiver}.as_str().map(|__s| Value::Str(__s.${method}().into())).unwrap_or(Value::Null)`; + } + // `x.startsWith("lit")` / `x.endsWith("lit")` → a bool (false for a non-`Str` receiver). + printNativeStringAffixTest(node, receiverText, method) { + const receiver = this.rustNativeStringReceiver(node, receiverText); + if (receiver === void 0 || _optionalChain([node, 'access', _2535 => _2535.arguments, 'optionalAccess', _2536 => _2536.length]) !== 1) + return void 0; + const literal = this.rustNativeStringLiteralArg(node.arguments[0]); + if (literal === void 0) + return void 0; + return `${receiver}.as_str().is_some_and(|__s| __s.${method}("${literal}"))`; + } + // `x.split("lit")`: an array of the parts, the empty array for a non-`Str` receiver. + printNativeStringSplit(node, receiverText) { + const receiver = this.rustNativeStringReceiver(node, receiverText); + if (receiver === void 0 || _optionalChain([node, 'access', _2537 => _2537.arguments, 'optionalAccess', _2538 => _2538.length]) !== 1) + return void 0; + const literal = this.rustNativeStringLiteralArg(node.arguments[0]); + if (literal === void 0) + return void 0; + return `Value::Array(${receiver}.as_str().map(|__s| __s.split("${literal}").map(|__p| Value::Str(__p.to_string().into())).collect()).unwrap_or_default())`; + } + // `x.replace("a", "b")`: the helper replaces every occurrence (`str::replace`), else the receiver. + printNativeStringReplace(node, receiverText) { + const receiver = this.rustNativeStringReceiver(node, receiverText); + if (receiver === void 0 || _optionalChain([node, 'access', _2539 => _2539.arguments, 'optionalAccess', _2540 => _2540.length]) !== 2) + return void 0; + const from = this.rustNativeStringLiteralArg(node.arguments[0]); + const to = this.rustNativeStringLiteralArg(node.arguments[1]); + if (from === void 0 || to === void 0) + return void 0; + return `${receiver}.as_str().map(|__s| Value::Str(__s.replace("${from}", "${to}").into())).unwrap_or_else(|| ${receiver}.clone())`; + } + // `x.padStart(N, "c")` with a one-char alphanumeric pad: `format!` width counts chars and never + // truncates, which is the helper's arm for a one-char pad. + printNativeStringPadStart(node, receiverText) { + const receiver = this.rustNativeStringReceiver(node, receiverText); + if (receiver === void 0 || _optionalChain([node, 'access', _2541 => _2541.arguments, 'optionalAccess', _2542 => _2542.length]) !== 2) + return void 0; + const width = this.rustSliceLiteralBound(node.arguments[0]); + const pad = node.arguments[1]; + if (width === void 0 || width < 0 || width > 4096) + return void 0; + if (!_is.isStringLiteral.call(void 0, pad) && !_is.isNoSubstitutionTemplateLiteral.call(void 0, pad) || !/^[A-Za-z0-9 ]$/.test(pad.text)) + return void 0; + return `${receiver}.as_str().map(|__s| Value::Str(format!("{:${pad.text}>${width}}", __s).into())).unwrap_or(Value::Null)`; + } + // `x.indexOf(y)` with a proven-string needle: `-1` when either side is not a `Str` (byte index). + printNativeStringIndexOfString(node, receiverText) { + const receiver = this.rustNativeStringReceiver(node, receiverText); + if (receiver === void 0 || _optionalChain([node, 'access', _2543 => _2543.arguments, 'optionalAccess', _2544 => _2544.length]) !== 1) + return void 0; + const needle = node.arguments[0]; + if (!_is.isIdentifier.call(void 0, needle) || this.primitiveKindOfType(this.typeOfNodeIfAny(needle)) !== "string") + return void 0; + if (!this.isDeclaredValueIdentifier(needle) || this.rustStringLocalIdentifierIsTyped(needle)) + return void 0; + const needleText = this.printNode(needle, 0).trim(); + if (!/^[A-Za-z_][A-Za-z0-9_]*$/.test(needleText)) + return void 0; + return `Value::Int(${receiver}.as_str().zip(${needleText}.as_str()).and_then(|(__s, __n)| __s.find(__n)).map(|__i| __i as i64).unwrap_or(-1))`; + } + // `xs.join("lit")` on a `string[]`: `Display` renders `Str`/`Null` like the helper does. + printNativeStringJoin(node, receiverText) { + const receiver = this.rustNativeStringReceiver(node, receiverText, "array"); + if (receiver === void 0 || _optionalChain([node, 'access', _2545 => _2545.arguments, 'optionalAccess', _2546 => _2546.length]) !== 1) + return void 0; + const literal = this.rustNativeStringLiteralArg(node.arguments[0]); + if (literal === void 0) + return void 0; + const checker = this.checkerOrUndefined(); + const type = this.typeOfNodeIfAny(node.expression.expression); + if (checker === void 0 || type === void 0 || !checker.isArrayType(type)) + return void 0; + const element = _optionalChain([checker, 'access', _2547 => _2547.getTypeArguments, 'optionalCall', _2548 => _2548(type), 'optionalAccess', _2549 => _2549[0]]); + if (this.primitiveKindOfType(element) !== "string") + return void 0; + return `Value::Str(${receiver}.as_array().map(|__a| __a.iter().map(|__v| __v.to_string()).collect::>().join("${literal}")).unwrap_or_default().into())`; + } + // hx4 R07 — numeric/string helpers on checker-proven `number` / `string` operands (nullish members + // allowed: the helper's Null arm is reproduced). Each native form answers exactly what the helper + // answers for Int/Float/Str/Null boxes; any other operand type keeps the helper. + rustOperandKind(node) { + try { + if (node === void 0 || !this.printsValueExpression(node)) + return void 0; + return this.primitiveKindOfType(this.typeOfNodeIfAny(node)); + } catch (e) { + return void 0; + } + } + // `x.toString()` on a number/string: `to_string_val` is `stringify_simple`, i.e. `Display`. + // Typed `Option` receivers have no `Display`, so they keep the helper. + printRustNativeToString(node, name) { + const receiver = _optionalChain([node, 'optionalAccess', _2550 => _2550.expression, 'optionalAccess', _2551 => _2551.expression]); + const kind = this.rustOperandKind(receiver); + if (kind !== "number" && kind !== "string") + return void 0; + const inner = this.unwrapParensNode(receiver); + if (inner !== void 0 && (this.rustStringLocalIdentifierIsTyped(inner) || this.rustNativeStrCalleeKind(inner) === "str")) + return void 0; + return `Value::Str(format!("{}", ${name}).into())`; + } + // `Math.floor|round|ceil(n)`: the helper answers `Float(op(x))` for a numeric box, `Null` otherwise. + printRustNativeMathCall(node, op, parsedArg) { + if (this.rustOperandKind(_optionalChain([node, 'optionalAccess', _2552 => _2552.arguments, 'optionalAccess', _2553 => _2553[0]])) !== "number") + return void 0; + return `(${parsedArg}).as_f64().map(|__x| Value::Float(__x.${op}())).unwrap_or(Value::Null)`; + } + // `-n`: Int/Float flip sign in place, a Null box stays Null (helper's fallthrough). + printRustNativeNegate(operand, operandText) { + if (this.rustOperandKind(operand) !== "number" && this.rustR16NumericKind(operand) === void 0) + return void 0; + return `(match &(${operandText}) { Value::Int(x) => Value::Int(-x), Value::Float(x) => Value::Float(-x), _ => Value::Null })`; + } + // `a % b` on numbers: Int pair stays Int, any Float widens; a zero divisor or Null answers Null. + printRustNativeMod(left, right, leftText, rightText) { + if (this.rustOperandKind(left) !== "number" || this.rustOperandKind(right) !== "number") + return void 0; + return `(match (&(${leftText}), &(${rightText})) { (Value::Int(x), Value::Int(y)) if *y != 0 => Value::Int(x % y), (Value::Int(x), Value::Float(y)) if *y != 0.0 => Value::Float(*x as f64 % *y), (Value::Float(x), Value::Int(y)) if *y != 0 => Value::Float(*x % *y as f64), (Value::Float(x), Value::Float(y)) if *y != 0.0 => Value::Float(x % y), _ => Value::Null })`; + } + // hx4 R09 — `.length` always prints `Value::Int` (`get_array_length` / `Value::Int(len)`), so a + // `.length` read, or a `const` local initialised from one, is a never-null Int whatever its receiver. + rustR09IsDefiniteInt(node) { + const inner = this.rustStripWrappers(node); + if (inner === void 0) + return false; + if (_is.isPropertyAccessExpression.call(void 0, inner)) + return String(inner.name.text) === "length"; + if (!_is.isIdentifier.call(void 0, inner)) + return false; + const declaration = this.rustSingleLocalDeclaration(inner); + if (declaration === void 0 || !_is.isVariableDeclaration.call(void 0, declaration) || _optionalChain([declaration, 'access', _2554 => _2554.name, 'optionalAccess', _2555 => _2555.kind]) !== _ast.SyntaxKind.Identifier) + return false; + if ((_optionalChain([declaration, 'access', _2556 => _2556.parent, 'optionalAccess', _2557 => _2557.flags]) & _ast.NodeFlags.Const) === 0) + return false; + const init = this.rustStripWrappers(declaration.initializer); + return init !== void 0 && _is.isPropertyAccessExpression.call(void 0, init) && String(init.name.text) === "length"; + } + // Int-only (definite) or checker-proven number (Int/Float/Null) operand that prints a `Value`. + rustR09NumericOperand(node) { + if (this.rustR09IsDefiniteInt(node)) + return "definite"; + return this.rustOperandKind(node) === "number" ? "number" : void 0; + } + // `a === b` with a definite Int side against a number literal, a number or another definite Int: + // is_equal compares Int/Float payloads as f64 and Null only equals Null, which `as_f64()` mirrors. + rustR09LengthEquality(left, right, op) { + if (!this.rustR09IsDefiniteInt(left) && !this.rustR09IsDefiniteInt(right)) + return void 0; + const operator = op === _ast.SyntaxKind.EqualsEqualsToken || op === _ast.SyntaxKind.EqualsEqualsEqualsToken ? "==" : "!="; + const [definite, other] = this.rustR09IsDefiniteInt(left) ? [left, right] : [right, left]; + if (!this.printsValueExpression(definite)) + return void 0; + const otherInner = this.rustStripWrappers(other); + if (otherInner !== void 0 && otherInner.kind === _ast.SyntaxKind.NumericLiteral) { + const text = this.numericLiteralF64Text(otherInner); + if (text === void 0) + return void 0; + return `${this.printNode(definite, 0)}.as_f64() ${operator} Some(${text})`; + } + if (this.rustR09NumericOperand(other) === void 0) + return void 0; + return `${this.printNode(left, 0)}.as_f64() ${operator} ${this.printNode(right, 0)}.as_f64()`; + } + // `a + b` / `a - b` with a definite Int operand and a numeric one: the helper's Int/Float dispatch. + // `s + n` / `n + s` with s a non-null string and n numeric: the helper's string branch, i.e. + // `stringify_simple` of each side, which equals `Display` for Str/Int/Float/Null. + rustR09NativeAddSubtract(op, left, right, leftType, rightType, leftText, rightText) { + if (op !== _ast.SyntaxKind.PlusToken && op !== _ast.SyntaxKind.MinusToken) + return void 0; + const leftNumeric = this.rustR09NumericOperand(left); + const rightNumeric = this.rustR09NumericOperand(right); + if (leftNumeric === "definite" && rightNumeric !== void 0 || rightNumeric === "definite" && leftNumeric !== void 0) { + return this.printNativeNumeric(op, leftText, rightText); + } + if (op !== _ast.SyntaxKind.PlusToken) + return void 0; + const stringSide = this.isStringLikeType(leftType) && rightNumeric !== void 0 ? left : this.isStringLikeType(rightType) && leftNumeric !== void 0 ? right : void 0; + if (stringSide === void 0 || !this.printsValueExpression(stringSide)) + return void 0; + const inner = this.unwrapParensNode(stringSide); + if (inner !== void 0 && (this.rustStringLocalIdentifierIsTyped(inner) || this.rustNativeStrCalleeKind(inner) === "str")) + return void 0; + return this.printNativeStringConcat(leftText, rightText); + } + // hx4 R10 — native reads on receivers the R01 plain-dict proof admits (tag-free literal / + // `account ()` / `omit` / `extend` / tuple element 0 locals) and on `Dict`-annotated parameters + // whose writes keep them plain: no marker route of `get_value` can fire on such a receiver. + /** 'local' for an R01-proven plain-dict local, 'param' for a plain-kept dict parameter. */ + rustR10PlainReceiver(node) { + if (node === void 0 || !_is.isIdentifier.call(void 0, node) || this.rustParamShadowOf(node) !== void 0) + return void 0; + const declaration = this.rustSingleLocalDeclaration(node); + if (declaration !== void 0 && _is.isParameterDeclaration.call(void 0, declaration)) { + if (declaration.type === void 0 || declaration.dotDotDotToken !== void 0) + return void 0; + const type = this.getCheckedTypeOf(declaration.type); + if (type === void 0 || !this.isProvenMapType(type)) + return void 0; + return this.rustParamStaysPlainDict(declaration) ? "param" : void 0; + } + try { + return this.rustR01LocalStaysPlain(node) || this.rustR01ShippedPlain(node) ? "local" : void 0; + } catch (e) { + return void 0; + } + } + /** A literal-key read (`x['k']` / `x.k`) on a proven plain receiver. */ + rustR10LiteralReadOk(receiverNode, keyText) { + const kind = this.rustR10PlainReceiver(receiverNode); + if (kind === void 0 || keyText === "") + return false; + if (kind === "param" && _RustTranspiler.RUST_DICT_LOCAL_UNSAFE_KEYS.has(keyText)) + return false; + const read = receiverNode.parent; + return read === void 0 || !this.isWriteBackBindRead(read); + } + /** `x[k]` on a proven plain receiver with a `Value` key place (`string` or `any` typed). */ + rustR10DynamicRead(receiverText, receiverNode, keyNode) { + const kind = this.rustR10PlainReceiver(receiverNode); + if (kind === void 0) + return void 0; + const key = this.rustSkipWrappers(keyNode); + if (key === void 0 || !_is.isIdentifier.call(void 0, key) || this.rustStringLocalIdentifierIsTyped(key)) + return void 0; + const type = this.getCheckedTypeOf(key); + if (type === void 0 || !(type.flags & _sync.TypeFlags.Any || this.rustKeyIsProvenString(key))) + return void 0; + const read = this.rustElementReadOfKey(keyNode); + if (read !== void 0 && this.isWriteBackBindRead(read)) + return void 0; + const keyText = this.printNode(keyNode, 0).trim(); + if (!/^[A-Za-z_][A-Za-z0-9_]*$/.test(keyText)) + return void 0; + if (kind === "param" && this.rustNodeIsKeyUnsafePlace(keyText)) + return void 0; + return `${receiverText}.as_map().and_then(|__m| ${keyText}.as_str().and_then(|__k| __m.get(__k))).cloned().unwrap_or(Value::Null)`; + } + // hx4 R11 — typed `Vec` locals also admit an argument of a non-`&mut self` `this.m(..)` + // call that is not the final use (boxed as `Value::from(x.clone())`, the clone the post-pass + // gave the boxed local) and a plain `x[i]` read with a number index (native `Vec::get`). + r11VecUse(n) { + const parent = n.parent; + if (_is.isCallExpression.call(void 0, parent) && parent.arguments.some((a) => a === n)) { + const callee = parent.expression; + if (!_is.isPropertyAccessExpression.call(void 0, callee)) + return false; + const kind = callee.expression.kind; + if (kind !== _ast.SyntaxKind.ThisKeyword && kind !== _ast.SyntaxKind.SuperKeyword) + return false; + if (_RustTranspiler.MUT_SELF_METHODS.has(this.toSnakeCaseName(String(callee.name.text)))) + return false; + let mentions = 0; + const visit = (m) => { + if (m.kind === _ast.SyntaxKind.Identifier && m.text === n.text) + mentions++; + _optionalChain([m, 'access', _2558 => _2558.forEachChild, 'optionalCall', _2559 => _2559(visit)]); + }; + parent.arguments.forEach(visit); + if (mentions !== 1) + return false; + return this.rustVecValueUse(n, String(n.text)) || !this.r11LoopBetween(n); + } + return _is.isElementAccessExpression.call(void 0, parent) && parent.expression === n && this.r11VecReadShape(parent); + } + // A loop around the use that does not also hold the declaration: a per-iteration Vec clone + // would cost O(n) where the boxed local only bumped its Arc. + r11LoopBetween(n) { + const declaration = _nullishCoalesce(this.rustVecLocalDeclarationOf(n), () => ( this.rustSingleLocalDeclaration(n))); + const fn = this.rustEnclosingFunction(n); + for (let current = n.parent; current !== void 0 && current !== fn; current = current.parent) { + if (declaration !== void 0 && this.isNodeInsideNode(declaration, current)) + return false; + switch (current.kind) { + case _ast.SyntaxKind.ForStatement: + case _ast.SyntaxKind.ForInStatement: + case _ast.SyntaxKind.ForOfStatement: + case _ast.SyntaxKind.WhileStatement: + case _ast.SyntaxKind.DoStatement: + return true; + } + } + return false; + } + // `x[k]` as a plain value read: not a write/delete/++ target, not a chain or call receiver, + // not a bind the next statement mutates (ccxt's write-back keys on `get_value` text). + r11VecReadShape(access) { + const up = access.parent; + if (up === void 0 || _is.isDeleteExpression.call(void 0, up) || up.kind === _ast.SyntaxKind.PrefixUnaryExpression || up.kind === _ast.SyntaxKind.PostfixUnaryExpression) + return false; + if (_is.isBinaryExpression.call(void 0, up) && up.left === access && rustIsAssignmentOperator(up.operatorToken.kind)) + return false; + if ((_is.isPropertyAccessExpression.call(void 0, up) || _is.isElementAccessExpression.call(void 0, up) || _is.isCallExpression.call(void 0, up)) && up.expression === access) + return false; + if (this.isWriteBackBindRead(access)) + return false; + const key = this.rustStripWrappers(access.argumentExpression); + if (key === void 0) + return false; + if (_is.isNumericLiteral.call(void 0, key)) + return Number.isInteger(Number(key.text)) && Number(key.text) >= 0; + return this.isRustValueIndexKey(key); + } + printElementAccessExpressionExceptionIfAny(node) { + const receiver = _optionalChain([node, 'optionalAccess', _2560 => _2560.expression]); + if (_optionalChain([receiver, 'optionalAccess', _2561 => _2561.kind]) !== _ast.SyntaxKind.Identifier || this.rustVecLocalDeclarationOf(receiver) === void 0 || !this.r11VecReadShape(node)) + return super.printElementAccessExpressionExceptionIfAny(node); + const name = this.printNode(receiver, 0).trim(); + const key = this.rustStripWrappers(node.argumentExpression); + const index = _is.isNumericLiteral.call(void 0, key) ? String(Number(key.text)) : `(${this.printNode(node.argumentExpression, 0).trim()}).as_i64().map_or(usize::MAX, |__n| __n as usize)`; + return `${name}.get(${index}).cloned().unwrap_or(Value::Null)`; + } + // An expression that always holds a `Value::Arr`: a runtime-split / array-literal-returning call, + // or a never-reassigned local initialised from one (through `const y = x` aliases). + r11ProvenListValue(node, depth = 0) { + const inner = this.rustStripWrappers(node); + if (inner === void 0 || depth > 4 || this.rustIsOrderBookSide(inner)) + return false; + if (_is.isCallExpression.call(void 0, inner)) + return this.rustCallReturnsProvenList(inner); + if (!_is.isIdentifier.call(void 0, inner)) + return false; + const declaration = this.rustSingleLocalDeclaration(inner); + if (declaration === void 0 || !_is.isVariableDeclaration.call(void 0, declaration) || declaration.initializer === void 0 || !_is.isIdentifier.call(void 0, declaration.name)) + return false; + if (this.rustLocalIsReassigned(declaration, String(declaration.name.text))) + return false; + return this.r11ProvenListValue(declaration.initializer, depth + 1); + } + rustR12PlainSource(node, depth = 0) { + if (depth > 4 || !_is.isCallExpression.call(void 0, node) || !_is.isPropertyAccessExpression.call(void 0, node.expression) || node.expression.expression.kind !== _ast.SyntaxKind.ThisKeyword || !this.r23PlainSourceTier(node)) { + return false; + } + const callee = String(node.expression.name.text); + const defaultIndex = _RustTranspiler.RUST_R12_DICT_READERS[callee]; + if (defaultIndex !== void 0) { + const fallback = this.rustStripWrappers(node.arguments[defaultIndex]); + return this.rustR01CalleeIsBase(node) && node.arguments.length <= defaultIndex + 1 && (fallback === void 0 || this.rustPlainDictLiteral(fallback) || this.rustTypeIsUndefinedish(fallback)) && this.rustR12UnsharedDict(node.arguments[0]) && this.r23TierSourceOk(node.arguments[0]); + } + if (this.r23FreshCopy(node, depth)) + return true; + return this.rustR12PlainBuilder(node, depth); + } + /** `this.options`, a parameter, or a const local whose initializer reads no `this` field + * but `options` and no tagged container (`hashmap`, `subscriptions`, `futures`). */ + rustR12UnsharedDict(arg) { + const node = this.rustStripWrappers(arg); + if (node === void 0) + return false; + if (_is.isPropertyAccessExpression.call(void 0, node) && node.expression.kind === _ast.SyntaxKind.ThisKeyword) { + return String(node.name.text) === "options"; + } + if (!_is.isIdentifier.call(void 0, node)) + return false; + const declaration = this.rustSingleLocalDeclaration(node); + if (declaration === void 0) + return false; + if (_is.isParameterDeclaration.call(void 0, declaration)) + return true; + if (!_is.isVariableDeclaration.call(void 0, declaration) || (_optionalChain([declaration, 'access', _2562 => _2562.parent, 'optionalAccess', _2563 => _2563.flags]) & _ast.NodeFlags.Const) === 0 || declaration.initializer === void 0) + return false; + let clean = true; + const visit = (n) => { + if (!clean) + return; + if (_is.isPropertyAccessExpression.call(void 0, n)) { + const field = String(n.name.text); + const isCallee = _is.isCallExpression.call(void 0, n.parent) && n.parent.expression === n; + if (_RustTranspiler.RUST_TAGGED_CONTAINER_FIELDS.has(field) || n.expression.kind === _ast.SyntaxKind.ThisKeyword && !isCallee && field !== "options") { + clean = false; + return; + } + } + n.forEachChild(visit); + }; + visit(declaration.initializer); + return clean; + } + /** `this.m (…)` on a sync method of the calling file whose every `return` is a plain + * literal, a plain local, or `this.extend|omit|keysort (plain, …unshared)`. */ + rustR12PlainBuilder(call, depth) { + const method = this.rustR12MethodImpl(call); + if (method === void 0 || method.getSourceFile() !== call.getSourceFile() || (_nullishCoalesce(method.modifiers, () => ( []))).some((m) => m.kind === _ast.SyntaxKind.AsyncKeyword)) { + return false; + } + if (this.rustR12Visiting.has(method)) + return false; + this.rustR12Visiting.add(method); + let plain = true; + let returns = 0; + try { + this.rustWalkScope(method.body, (n) => { + if (_is.isArrowFunction.call(void 0, n) || n.kind === _ast.SyntaxKind.FunctionExpression) + return RUST_WALK_SKIP; + if (!_is.isReturnStatement.call(void 0, n)) + return; + returns++; + if (!this.rustR12PlainReturn(n.expression, depth)) { + plain = false; + return RUST_WALK_STOP; + } + }); + } finally { + this.rustR12Visiting.delete(method); + } + return plain && returns > 0; + } + rustR12PlainReturn(expr, depth) { + const node = this.rustStripWrappers(expr); + if (node === void 0) + return false; + const plainHead = (head) => { + const h = this.rustStripWrappers(head); + return h !== void 0 && (this.rustPlainDictLiteral(h) || _is.isIdentifier.call(void 0, h) && this.rustR01LocalStaysPlain(h, depth + 1) || this.rustR12PlainSource(h, depth + 1)); + }; + if (plainHead(node)) + return true; + if (!_is.isCallExpression.call(void 0, node) || !_is.isPropertyAccessExpression.call(void 0, node.expression) || node.expression.expression.kind !== _ast.SyntaxKind.ThisKeyword || node.arguments.length === 0 || !this.rustR01CalleeIsBase(node)) { + return false; + } + const callee = String(node.expression.name.text); + if (callee === "omit" || callee === "keysort") + return plainHead(node.arguments[0]); + return callee === "extend" && plainHead(node.arguments[0]) && node.arguments.slice(1).every((a) => plainHead(a) || this.rustR12UnsharedDict(a) && this.r23TierSourceOk(a)); + } + /** The single bodied method declaration `this.m (…)` resolves to (implementation of an + * overload set), in the calling file or the base tier. */ + rustR12MethodImpl(call) { + const checker = this.checkerOrUndefined(); + const callee = _optionalChain([call, 'optionalAccess', _2564 => _2564.expression]); + if (checker === void 0 || !_is.isPropertyAccessExpression.call(void 0, callee) || callee.expression.kind !== _ast.SyntaxKind.ThisKeyword) { + return void 0; + } + let declarations; + try { + declarations = _chunkUBXMRIM6cjs.symbolDeclarations.call(void 0, checker.getSymbolAtLocation(callee.name)).filter((d) => d.kind === _ast.SyntaxKind.MethodDeclaration && d.body !== void 0); + } catch (e) { + return void 0; + } + const callerFile = String(call.getSourceFile().fileName).replace(/\\/g, "/"); + if (declarations.length !== 1 || _RustTranspiler.RUST_BASE_TIER_FILE.test(callerFile)) + return void 0; + const file = String(declarations[0].getSourceFile().fileName).replace(/\\/g, "/"); + return declarations[0].getSourceFile() === call.getSourceFile() || _RustTranspiler.RUST_BASE_TIER_FILE.test(file) ? declarations[0] : void 0; + } + /** The expression's Rust value is always `Value::Bool(_)` or `Value::Null`. */ + rustR12BoolValue(expr, depth = 0) { + let node = this.rustStripWrappers(expr); + while (node !== void 0 && node.kind === _ast.SyntaxKind.AwaitExpression) + node = this.rustStripWrappers(node.expression); + if (node === void 0 || depth > 5) + return false; + switch (node.kind) { + case _ast.SyntaxKind.TrueKeyword: + case _ast.SyntaxKind.FalseKeyword: + case _ast.SyntaxKind.NullKeyword: + return true; + case _ast.SyntaxKind.Identifier: + return node.text === "undefined" || this.rustR12BoolLocal(node, depth + 1); + case _ast.SyntaxKind.PrefixUnaryExpression: + return node.operator === _ast.SyntaxKind.ExclamationToken; + case _ast.SyntaxKind.BinaryExpression: { + const op = node.operatorToken.kind; + return _RustTranspiler.COMPARISON_OPS.has(op) || this.isLogicalOp(op); + } + case _ast.SyntaxKind.ConditionalExpression: + return this.rustR12BoolValue(node.whenTrue, depth + 1) && this.rustR12BoolValue(node.whenFalse, depth + 1); + case _ast.SyntaxKind.CallExpression: + return this.rustR12BoolCall(node, depth); + } + return false; + } + /** A base `safeBool*` with a bool default, `checkOptionBool`, or a method (calling file or + * base tier) whose every `return` is such a value. */ + rustR12BoolCall(call, depth) { + if (!_is.isPropertyAccessExpression.call(void 0, call.expression) || call.expression.expression.kind !== _ast.SyntaxKind.ThisKeyword) + return false; + const reader = _RustTranspiler.RUST_R12_BOOL_READERS[String(call.expression.name.text)]; + if (reader !== void 0) { + if (!this.rustR01CalleeIsBase(call)) + return false; + return reader < 0 || call.arguments.length <= reader || call.arguments.length === reader + 1 && this.rustR12BoolValue(call.arguments[reader], depth + 1); + } + let sawBool = false; + return this.rustR12EveryReturn(call, depth, (e) => { + const nullish = this.rustTypeIsUndefinedish(_nullishCoalesce(this.rustStripWrappers(e), () => ( e))); + sawBool = sawBool || !nullish; + return nullish || this.rustR12BoolValue(e, depth + 1); + }) && sawBool; + } + rustR12EveryReturn(call, depth, ok) { + const method = this.rustR12MethodImpl(call); + if (method === void 0 || this.rustR12Visiting.has(method)) + return false; + this.rustR12Visiting.add(method); + let proven = true; + let returns = 0; + try { + this.rustWalkScope(method.body, (n) => { + if (_is.isArrowFunction.call(void 0, n) || n.kind === _ast.SyntaxKind.FunctionExpression) + return RUST_WALK_SKIP; + if (!_is.isReturnStatement.call(void 0, n)) + return; + returns++; + if (n.expression === void 0 || !ok(n.expression)) { + proven = false; + return RUST_WALK_STOP; + } + }); + } finally { + this.rustR12Visiting.delete(method); + } + return proven && returns > 0; + } + /** Element `index` of `this.m (…)`'s tuple is a bool value on every return path. */ + rustR12BoolTupleElement(expr, index, depth) { + let call = this.rustStripWrappers(expr); + while (call !== void 0 && call.kind === _ast.SyntaxKind.AwaitExpression) + call = this.rustStripWrappers(call.expression); + if (call === void 0 || !_is.isCallExpression.call(void 0, call) || depth > 5) + return false; + return this.rustR12EveryReturn(call, depth, (e) => { + const tuple = this.rustStripWrappers(e); + if (_optionalChain([tuple, 'optionalAccess', _2565 => _2565.kind]) === _ast.SyntaxKind.ArrayLiteralExpression) { + const element = tuple.elements[index]; + return element !== void 0 && element.kind !== _ast.SyntaxKind.SpreadElement && this.rustR12BoolValue(element, depth + 1); + } + return this.rustR12BoolTupleElement(tuple, index, depth + 1); + }); + } + /** A local whose declaration and every write store a bool value. Locals the printer or + * ccxt's narrowBoolLocals may declare `bool` (bool-expression initializer) are left out. */ + rustR12BoolLocal(ident, depth) { + const checker = this.checkerOrUndefined(); + if (depth > 5) + return false; + const declarations = checker === void 0 ? [] : _chunkUBXMRIM6cjs.symbolDeclarations.call(void 0, checker.getSymbolAtLocation(ident)); + const declaration = declarations.length === 1 ? declarations[0] : void 0; + if (declaration === void 0) + return false; + let nameNode; + let variable; + if (declaration.kind === _ast.SyntaxKind.BindingElement) { + const pattern = declaration.parent; + variable = _optionalChain([pattern, 'optionalAccess', _2566 => _2566.parent]); + if (_optionalChain([pattern, 'optionalAccess', _2567 => _2567.kind]) !== _ast.SyntaxKind.ArrayBindingPattern || variable === void 0 || !_is.isVariableDeclaration.call(void 0, variable) || declaration.initializer !== void 0 || declaration.dotDotDotToken !== void 0 || _optionalChain([declaration, 'access', _2568 => _2568.name, 'optionalAccess', _2569 => _2569.kind]) !== _ast.SyntaxKind.Identifier || !this.rustR12BoolTupleElement(variable.initializer, pattern.elements.indexOf(declaration), depth)) { + return false; + } + nameNode = declaration.name; + } else if (_is.isVariableDeclaration.call(void 0, declaration) && _optionalChain([declaration, 'access', _2570 => _2570.name, 'optionalAccess', _2571 => _2571.kind]) === _ast.SyntaxKind.Identifier) { + const init = this.rustStripWrappers(declaration.initializer); + if (init !== void 0 && (this.rustNodeIsBoolExpression(init) || !(this.rustTypeIsUndefinedish(init) || _is.isIdentifier.call(void 0, init) && init.text === "undefined" || this.rustR12BoolValue(init, depth)))) { + return false; + } + variable = declaration; + nameNode = declaration.name; + } else { + return false; + } + const scope = this.rustEnclosingFunction(variable); + const symbol = this.rustSymbolOf(nameNode); + const name = String(nameNode.text); + if (scope === void 0 || _is.isSourceFile.call(void 0, scope) || symbol === void 0) + return false; + for (const node of this.rustScopeNameNodes(scope, name)) { + if (node.kind !== _ast.SyntaxKind.Identifier || node === nameNode || this.rustSymbolOf(node) !== symbol) + continue; + if (this.rustEnclosingFunction(node) !== scope) + return false; + let target = node; + while (target.parent !== void 0 && (_is.isParenthesizedExpression.call(void 0, target.parent) || _is.isNonNullExpression.call(void 0, target.parent) || _is.isAsExpression.call(void 0, target.parent))) + target = target.parent; + const parent = target.parent; + if (_is.isBinaryExpression.call(void 0, parent) && parent.left === target && rustIsAssignmentOperator(parent.operatorToken.kind)) { + if (parent.operatorToken.kind !== _ast.SyntaxKind.EqualsToken || this.rustNodeIsBoolExpression(this.rustStripWrappers(parent.right)) || !this.rustR12BoolValue(parent.right, depth)) + return false; + } else if (_optionalChain([parent, 'optionalAccess', _2572 => _2572.kind]) === _ast.SyntaxKind.ArrayLiteralExpression) { + const assign = parent.parent; + if (assign !== void 0 && _is.isBinaryExpression.call(void 0, assign) && assign.left === parent && !this.rustR12BoolTupleElement(assign.right, parent.elements.indexOf(target), depth)) + return false; + } else if (_optionalChain([parent, 'optionalAccess', _2573 => _2573.kind]) === _ast.SyntaxKind.PrefixUnaryExpression && parent.operator !== _ast.SyntaxKind.ExclamationToken || _optionalChain([parent, 'optionalAccess', _2574 => _2574.kind]) === _ast.SyntaxKind.PostfixUnaryExpression || _optionalChain([parent, 'optionalAccess', _2575 => _2575.kind]) === _ast.SyntaxKind.DeleteExpression || (_is.isForOfStatement.call(void 0, parent) || _is.isForInStatement.call(void 0, parent)) && parent.initializer === target) { + return false; + } + } + return true; + } + /** `if (x)` on a local or `this.m (…)` proven a bool value: `x.as_bool() == Some(true)` + * is `is_true` on `Value::Bool`/`Value::Null`; bool slots only (leading-token boxing). */ + rustR12NativeTruthiness(node) { + const inner = this.unwrapParens(node); + if (inner === void 0 || !_is.isIdentifier.call(void 0, inner) && !_is.isCallExpression.call(void 0, inner) || !this.printsValueExpression(inner) || !this.isBareBoolEmissionSafe(node) || _is.isCallExpression.call(void 0, inner) && this.rustCallPrintsBool(inner) || !this.rustR12BoolValue(inner)) { + return void 0; + } + const text = `${this.printNode(inner, 0)}.as_bool() == Some(true)`; + let current = node; + while (current.parent !== void 0 && _is.isParenthesizedExpression.call(void 0, current.parent)) + current = current.parent; + const negated = _optionalChain([current, 'access', _2576 => _2576.parent, 'optionalAccess', _2577 => _2577.kind]) === _ast.SyntaxKind.PrefixUnaryExpression && current.parent.operator === _ast.SyntaxKind.ExclamationToken; + return negated ? `(${text})` : text; + } + /** `x === true|false` with `x` proven a bool value: `is_equal` against a `Value::Bool` is + * the payload compare there (Null matches neither). */ + rustR12NativeBoolEquality(left, right, op) { + const leftLiteral = left.kind === _ast.SyntaxKind.TrueKeyword || left.kind === _ast.SyntaxKind.FalseKeyword; + const rightLiteral = right.kind === _ast.SyntaxKind.TrueKeyword || right.kind === _ast.SyntaxKind.FalseKeyword; + if (leftLiteral === rightLiteral) + return void 0; + const [literal, other] = leftLiteral ? [left, right] : [right, left]; + const inner = this.unwrapParens(other); + if (inner === void 0 || !_is.isIdentifier.call(void 0, inner) && !_is.isCallExpression.call(void 0, inner) || !this.printsValueExpression(inner) || _is.isCallExpression.call(void 0, inner) && this.rustCallPrintsBool(inner) || !this.rustR12BoolValue(inner)) { + return void 0; + } + const operator = op === _ast.SyntaxKind.EqualsEqualsToken || op === _ast.SyntaxKind.EqualsEqualsEqualsToken ? "==" : "!="; + return `${this.printNode(inner, 0)}.as_bool() ${operator} Some(${literal.kind === _ast.SyntaxKind.TrueKeyword ? "true" : "false"})`; + } + // hx4 R13 — proven-`Str` operands: a `this.safeString*` call (no default or a string-literal + // default) or a native-`Str` callee re-boxed into `Value`, or a `const`/never-reassigned local + // initialized from one, can only hold `Value::Str` / `Value::Null`, whatever its TS type says. + rustR13ProvenStrSource(node) { + const inner = this.unwrapParensNode(node); + if (inner === void 0 || !_is.isCallExpression.call(void 0, inner)) + return false; + if (this.rustNativeStrCalleeKind(inner) === "str") + return true; + const callee = inner.expression; + if (!_is.isPropertyAccessExpression.call(void 0, callee) || callee.expression.kind !== _ast.SyntaxKind.ThisKeyword) + return false; + const name = callee.name.text; + if (!_RustTranspiler.RUST_STRING_LOCAL_HELPERS.has(name)) + return false; + const arity = /N$/.test(name) || !/2$/.test(name) ? 2 : 3; + const args = _nullishCoalesce(inner.arguments, () => ( [])); + if (args.length === arity) + return true; + return args.length === arity + 1 && (_is.isStringLiteral.call(void 0, args[arity]) || _is.isNoSubstitutionTemplateLiteral.call(void 0, args[arity])); + } + rustR13ProvenStrIdentifier(node) { + if (node === void 0 || !_is.isIdentifier.call(void 0, node) || this.rustStringLocalIdentifierIsTyped(node)) + return false; + const checker = this.checkerOrUndefined(); + const declarations = checker === void 0 ? [] : _chunkUBXMRIM6cjs.symbolDeclarations.call(void 0, checker.getSymbolAtLocation(node)); + if (declarations.length !== 1 || !_is.isVariableDeclaration.call(void 0, declarations[0])) + return false; + const declaration = declarations[0]; + if (_optionalChain([declaration, 'access', _2578 => _2578.name, 'optionalAccess', _2579 => _2579.kind]) !== _ast.SyntaxKind.Identifier || !this.rustR13ProvenStrSource(declaration.initializer)) + return false; + return this.rustLocalUsesAll(declaration, declaration.name.text, true, (n) => { + if (this.rustR13WriteTarget(n)) + return false; + const parent = n.parent; + if (_optionalChain([parent, 'optionalAccess', _2580 => _2580.kind]) !== _ast.SyntaxKind.BinaryExpression || parent.left !== n) + return !(_optionalChain([parent, 'optionalAccess', _2581 => _2581.kind]) === _ast.SyntaxKind.PrefixUnaryExpression || _optionalChain([parent, 'optionalAccess', _2582 => _2582.kind]) === _ast.SyntaxKind.PostfixUnaryExpression) || parent.operator === _ast.SyntaxKind.ExclamationToken; + const op = parent.operatorToken.kind; + if (op < _ast.SyntaxKind.FirstAssignment || op > _ast.SyntaxKind.LastAssignment) + return true; + return op === _ast.SyntaxKind.EqualsToken && this.rustR13ProvenStrSource(parent.right); + }); + } + /** A destructuring / for-in-of target: a write the direct-assignment check cannot see. */ + rustR13WriteTarget(node) { + let current = node; + let parent = node.parent; + while (parent !== void 0 && (_is.isArrayLiteralExpression.call(void 0, parent) || _is.isObjectLiteralExpression.call(void 0, parent) || _is.isParenthesizedExpression.call(void 0, parent) || parent.kind === _ast.SyntaxKind.PropertyAssignment || parent.kind === _ast.SyntaxKind.ShorthandPropertyAssignment || parent.kind === _ast.SyntaxKind.SpreadElement)) { + current = parent; + parent = parent.parent; + } + if ((_is.isForOfStatement.call(void 0, parent) || _is.isForInStatement.call(void 0, parent)) && parent.initializer === current) + return true; + return current !== node && _is.isBinaryExpression.call(void 0, parent) && parent.left === current && parent.operatorToken.kind === _ast.SyntaxKind.EqualsToken; + } + /** `x` / `(x as string)` → the identifier under parens / `as`. */ + rustR13PeelCast(node) { + let current = node; + while (current !== void 0 && (_is.isParenthesizedExpression.call(void 0, current) || _is.isAsExpression.call(void 0, current))) + current = current.expression; + return current; + } + /** Printed text of an operand that is always `Value::Str` / `Value::Null`, else undefined: + * a proven-`Str` local, a checker-`string` declared local/param (the R06 needle rule), or + * `"lit" + e` / `e + "lit"` (the `add` helper's string branch always yields `Value::Str`). */ + rustR13StrOperand(node, allowChecker) { + const inner = this.rustR13PeelCast(node); + if (inner === void 0) + return void 0; + if (_is.isIdentifier.call(void 0, inner)) { + if (this.rustStringLocalIdentifierIsTyped(inner)) + return void 0; + const proven = this.rustR13ProvenStrIdentifier(inner); + const checked = allowChecker && this.isDeclaredValueIdentifier(inner) && this.primitiveKindOfType(this.typeOfNodeIfAny(inner)) === "string"; + if (!proven && !checked) + return void 0; + const text = this.printNode(inner, 0).trim(); + return /^[A-Za-z_][A-Za-z0-9_]*$/.test(text) ? text : void 0; + } + if (allowChecker && _is.isBinaryExpression.call(void 0, inner) && inner.operatorToken.kind === _ast.SyntaxKind.PlusToken && (_is.isStringLiteral.call(void 0, inner.left) || _is.isStringLiteral.call(void 0, inner.right))) { + const text = this.printNode(inner, 0).trim(); + return text.includes("\n") ? void 0 : `(${text})`; + } + return void 0; + } + // `a === b` with both sides proven `Str`/`Null`: `is_equal` is exactly the derived `PartialEq` + // there (Null==Null, Str by content, Str vs Null false — its f64 fallback needs a number). + printRustR13ProvenStrEquality(left, right, op) { + if (!this.rustR13ProvenStrIdentifier(this.unwrapParensNode(left)) || !this.rustR13ProvenStrIdentifier(this.unwrapParensNode(right))) + return void 0; + const operator = op === _ast.SyntaxKind.EqualsEqualsToken || op === _ast.SyntaxKind.EqualsEqualsEqualsToken ? "==" : "!="; + return `${this.printNode(left, 0)} ${operator} ${this.printNode(right, 0)}`; + } + /** Receiver text when the call's receiver is a proven-`Str` local (R06 covers checker strings). */ + rustR13Receiver(node, receiverText) { + if (node === void 0 || !_is.isCallExpression.call(void 0, node) || !_is.isPropertyAccessExpression.call(void 0, node.expression)) + return void 0; + const receiver = this.rustR13PeelCast(node.expression.expression); + if (!this.rustR13ProvenStrIdentifier(receiver)) + return void 0; + const text = (_nullishCoalesce(receiverText, () => ( ""))).trim(); + return /^[A-Za-z_][A-Za-z0-9_]*$/.test(text) ? text : void 0; + } + /** R06's checker-string receiver, when it prints as a bare name (it is read twice). */ + rustR13PlainReceiver(node, receiverText) { + const receiver = this.rustNativeStringReceiver(node, receiverText); + return receiver !== void 0 && /^[A-Za-z_][A-Za-z0-9_]*$/.test(receiver) ? receiver : void 0; + } + // `s.replace(p, "lit")`: the helper replaces every occurrence when all three are `Str`, else + // returns the receiver; `p` is a proven/checker string operand. + printRustR13Replace(node, receiverText) { + if (_optionalChain([node, 'optionalAccess', _2583 => _2583.arguments, 'optionalAccess', _2584 => _2584.length]) !== 2) + return void 0; + const receiver = _nullishCoalesce(this.rustR13Receiver(node, receiverText), () => ( this.rustR13PlainReceiver(node, receiverText))); + const to = this.rustNativeStringLiteralArg(node.arguments[1]); + if (receiver === void 0 || to === void 0 || this.rustNativeStringLiteralArg(node.arguments[0]) !== void 0) + return void 0; + const from = this.rustR13StrOperand(node.arguments[0], true); + if (from === void 0) + return void 0; + return `${receiver}.as_str().zip(${from}.as_str()).map(|(__s, __p)| Value::Str(__s.replace(__p, "${to}").into())).unwrap_or_else(|| ${receiver}.clone())`; + } + // `s.split(d)` with a proven/checker string delimiter: the parts, `[]` unless both are `Str`. + printRustR13Split(node, receiverText) { + if (_optionalChain([node, 'optionalAccess', _2585 => _2585.arguments, 'optionalAccess', _2586 => _2586.length]) !== 1 || this.rustNativeStringLiteralArg(node.arguments[0]) !== void 0) + return void 0; + const receiver = _nullishCoalesce(this.rustR13Receiver(node, receiverText), () => ( this.rustR13PlainReceiver(node, receiverText))); + const delim = receiver === void 0 ? void 0 : this.rustR13StrOperand(node.arguments[0], true); + if (delim === void 0) + return void 0; + return `Value::Array(${receiver}.as_str().zip(${delim}.as_str()).map(|(__s, __d)| __s.split(__d).map(|__p| Value::Str(__p.to_string().into())).collect()).unwrap_or_default())`; + } + // `x.toString()` on a proven-`Str` local: `stringify_simple` of `Str`/`Null` is `Display`. + printRustR13ToString(node, receiverText) { + const receiver = this.rustR13Receiver(node, receiverText); + return receiver === void 0 || (_nullishCoalesce(_optionalChain([node, 'access', _2587 => _2587.arguments, 'optionalAccess', _2588 => _2588.length]), () => ( 0))) !== 0 ? void 0 : `Value::Str(format!("{}", ${receiver}).into())`; + } + // `x.toUpperCase()` / `x.toLowerCase()` on a proven-`Str` local (any TS type). + printRustR13Case(node, receiverText, method) { + const receiver = this.rustR13Receiver(node, receiverText); + return receiver === void 0 || (_nullishCoalesce(_optionalChain([node, 'access', _2589 => _2589.arguments, 'optionalAccess', _2590 => _2590.length]), () => ( 0))) !== 0 ? void 0 : `${receiver}.as_str().map(|__s| Value::Str(__s.${method}().into())).unwrap_or(Value::Null)`; + } + // hx4 R14 — the R12 plain-dict proof reaches overloaded base readers (`safeDict` declares + // bodiless overload signatures; the implementation in the same class is what runs). + /** A bodiless overload signature whose class also holds the bodied implementation. */ + r14BaseOverload(declaration) { + if (_optionalChain([declaration, 'optionalAccess', _2591 => _2591.kind]) !== _ast.SyntaxKind.MethodDeclaration || declaration.body !== void 0 || !_is.isIdentifier.call(void 0, declaration.name)) + return false; + const name = String(declaration.name.text); + return (_nullishCoalesce(_optionalChain([declaration, 'access', _2592 => _2592.parent, 'optionalAccess', _2593 => _2593.members]), () => ( []))).some((m) => m.kind === _ast.SyntaxKind.MethodDeclaration && m.body !== void 0 && _is.isIdentifier.call(void 0, m.name) && String(m.name.text) === name); + } + /** `x[a ± b]` on a checker-proven list, each operand a numeric literal, a `Value` loop + * counter or a `const n = y.length` local: the key prints as a `Value` number, so the + * list arm of `get_value` (Int index, else miss) is spelled natively. */ + r14ListArithIndex(receiverText, receiverNode, keyNode) { + const key = this.rustSkipWrappers(keyNode); + if (!this.isProvenListExpression(receiverNode) || key === void 0 || !_is.isBinaryExpression.call(void 0, key) || key.operatorToken.kind !== _ast.SyntaxKind.MinusToken && key.operatorToken.kind !== _ast.SyntaxKind.PlusToken || !this.r14ValueNumberOperand(key.left) || !this.r14ValueNumberOperand(key.right)) + return void 0; + if (this.isWriteBackBindRead(keyNode.parent)) + return void 0; + const keyText = this.printNode(keyNode, 0).trim(); + if (!keyText || keyText.startsWith("&")) + return void 0; + return `${receiverText}.as_array().and_then(|__arr| match &(${keyText}) { Value::Int(__n) if *__n >= 0 => __arr.get(*__n as usize), _ => None }).cloned().unwrap_or(Value::Null)`; + } + r14ValueNumberOperand(node) { + const operand = this.rustSkipWrappers(node); + if (operand === void 0) + return false; + if (_is.isNumericLiteral.call(void 0, operand)) + return Number.isInteger(Number(operand.text)); + if (!_is.isIdentifier.call(void 0, operand)) + return false; + if (this.isRustValueIndexKey(operand)) + return true; + if (this.rustParamShadowOf(operand) !== void 0 || this.rustStringLocalIdentifierIsTyped(operand)) + return false; + const declaration = this.rustDeclarationOfIdentifier(operand); + if (declaration === void 0 || !_is.isVariableDeclaration.call(void 0, declaration) || (_optionalChain([declaration, 'access', _2594 => _2594.parent, 'optionalAccess', _2595 => _2595.flags]) & _ast.NodeFlags.Const) === 0) + return false; + const init = this.rustSkipWrappers(declaration.initializer); + return init !== void 0 && _is.isPropertyAccessExpression.call(void 0, init) && String(init.name.text) === "length"; + } + // hx4 R15 — `Vec` locals also admit `x.join("lit")` on a `string[]` (native join of the + // elements' Display text, as the helper's `stringify_simple` prints `Str`/`Null`) and an + // object-literal property value no push follows (boxed `Value::from(x.clone())`). + r15VecJoinUse(access) { + const call = access.parent; + if (!_is.isCallExpression.call(void 0, call) || call.expression !== access || String(access.name.text) !== "join" || call.arguments.length !== 1) + return false; + if (this.rustNativeStringLiteralArg(call.arguments[0]) === void 0) + return false; + const checker = this.checkerOrUndefined(); + const type = _optionalChain([checker, 'optionalAccess', _2596 => _2596.getTypeAtLocation, 'call', _2597 => _2597(access.expression)]); + if (type === void 0 || !checker.isArrayType(type)) + return false; + return this.primitiveKindOfType(_optionalChain([checker, 'access', _2598 => _2598.getTypeArguments, 'optionalCall', _2599 => _2599(type), 'optionalAccess', _2600 => _2600[0]])) === "string"; + } + r15PrintVecJoin(node) { + const access = _optionalChain([node, 'optionalAccess', _2601 => _2601.expression]); + if (!_is.isPropertyAccessExpression.call(void 0, access) || !_is.isIdentifier.call(void 0, access.expression) || this.rustVecLocalDeclarationOf(access.expression) === void 0 || !this.r15VecJoinUse(access)) + return void 0; + const literal = this.rustNativeStringLiteralArg(node.arguments[0]); + const name = this.printNode(access.expression, 0).trim(); + return `Value::Str(${name}.iter().map(|__v| __v.to_string()).collect::>().join("${literal}").into())`; + } + // `{ 'k': x }` with `x` named once in the statement, outside any loop the declaration is not in, + // and no `x.push` after it: the clone is the array's final contents, as the aliased box was. + r15VecPropertyUse(n) { + const parent = n.parent; + if (_optionalChain([parent, 'optionalAccess', _2602 => _2602.kind]) !== _ast.SyntaxKind.PropertyAssignment || parent.initializer !== n || this.r11LoopBetween(n)) + return false; + const name = String(n.text); + let statement = parent; + while (statement !== void 0 && !_is.isStatement.call(void 0, statement)) + statement = statement.parent; + if (statement === void 0) + return false; + let count = 0; + const visit = (m) => { + if (m.kind === _ast.SyntaxKind.Identifier && m.text === name) + count++; + _optionalChain([m, 'access', _2603 => _2603.forEachChild, 'optionalCall', _2604 => _2604(visit)]); + }; + visit(statement); + if (count !== 1) + return false; + const fn = this.rustEnclosingFunction(n); + const end = _nullishCoalesce(_optionalChain([n, 'access', _2605 => _2605.getEnd, 'optionalCall', _2606 => _2606()]), () => ( n.end)); + return !this.rustScopeNameNodes(fn, name).some((m) => m.kind === _ast.SyntaxKind.Identifier && m !== n && (_nullishCoalesce(_optionalChain([m, 'access', _2607 => _2607.getStart, 'optionalCall', _2608 => _2608()]), () => ( m.pos))) >= end && _is.isPropertyAccessExpression.call(void 0, m.parent) && m.parent.expression === m && String(m.parent.name.text) === "push"); + } + rustR16NumericKind(node, depth = 0) { + const inner = this.rustStripWrappers(node); + if (inner === void 0 || depth > 8) + return void 0; + if (this.rustR16InProgress.has(inner)) + return this.r22AssumedNumericSelf(inner); + this.rustR16InProgress.add(inner); + try { + const structural = this.rustR16StructuralKind(inner, depth); + if (structural === "definite") + return "definite"; + if (structural === "number") + return "number"; + return this.rustOperandKind(inner) === "number" ? "number" : void 0; + } catch (e) { + return void 0; + } finally { + this.rustR16InProgress.delete(inner); + } + } + rustR16Combine(kinds) { + if (kinds.length === 0 || kinds.some((k) => k === void 0)) + return void 0; + return kinds.every((k) => k === "definite") ? "definite" : "number"; + } + rustR16StructuralKind(inner, depth) { + if (inner.kind === _ast.SyntaxKind.NumericLiteral) + return "definite"; + if (_is.isPrefixUnaryExpression.call(void 0, inner) && inner.operator === _ast.SyntaxKind.MinusToken && inner.operand.kind === _ast.SyntaxKind.NumericLiteral) + return "definite"; + if (this.rustR09IsDefiniteInt(inner)) + return "definite"; + if (_is.isCallExpression.call(void 0, inner) && this.callExpressionName(inner) === "indexOf") + return "definite"; + if (_is.isBinaryExpression.call(void 0, inner)) { + const op = inner.operatorToken.kind; + if (op !== _ast.SyntaxKind.PlusToken && op !== _ast.SyntaxKind.MinusToken && op !== _ast.SyntaxKind.AsteriskToken && op !== _ast.SyntaxKind.SlashToken && op !== _ast.SyntaxKind.PercentToken) + return void 0; + const both = this.rustR16Combine([this.rustR16NumericKind(inner.left, depth + 1), this.rustR16NumericKind(inner.right, depth + 1)]); + return both === "definite" && (op === _ast.SyntaxKind.SlashToken || op === _ast.SyntaxKind.PercentToken) ? "number" : both; + } + if (_is.isCallExpression.call(void 0, inner)) + return this.rustR16CallKind(inner, depth); + if (_is.isIdentifier.call(void 0, inner)) + return this.rustR16IdentifierKind(inner, depth); + return void 0; + } + rustR16CallKind(call, depth) { + const callee = call.expression; + if (!_is.isPropertyAccessExpression.call(void 0, callee) || callee.expression.kind !== _ast.SyntaxKind.ThisKeyword) + return void 0; + if (String(callee.name.text) === "sum") { + return this.rustR16Combine(call.arguments.map((a) => this.rustR16NumericKind(a, depth + 1))); + } + let declaration; + try { + declaration = _chunkUBXMRIM6cjs.signatureDeclaration.call(void 0, this.getChecker().getResolvedSignature(call)); + } catch (e) { + return void 0; + } + if (_optionalChain([declaration, 'optionalAccess', _2609 => _2609.kind]) !== _ast.SyntaxKind.MethodDeclaration || declaration.body === void 0 || declaration.getSourceFile() !== call.getSourceFile()) + return void 0; + const kinds = []; + const visit = (n) => { + if (n !== declaration && _chunkUBXMRIM6cjs.isFunctionLike.call(void 0, n)) + return; + if (_is.isReturnStatement.call(void 0, n)) + kinds.push(n.expression === void 0 ? void 0 : this.rustR16NumericKind(n.expression, depth + 1)); + _optionalChain([n, 'access', _2610 => _2610.forEachChild, 'optionalCall', _2611 => _2611(visit)]); + }; + declaration.body.forEachChild(visit); + return this.rustR16Combine(kinds) === void 0 ? void 0 : "number"; + } + rustR16IdentifierKind(ident, depth) { + if (this.rustParamShadowOf(ident) !== void 0 || !this.printsValueExpression(ident)) + return void 0; + const declaration = this.rustSingleLocalDeclaration(ident); + if (declaration === void 0 || _optionalChain([declaration, 'access', _2612 => _2612.name, 'optionalAccess', _2613 => _2613.kind]) !== _ast.SyntaxKind.Identifier) + return void 0; + const here = this.typeOfNodeIfAny(ident); + const declared = this.typeOfNodeIfAny(declaration.name); + if (here !== void 0 && declared !== void 0 && (here.flags === _sync.TypeFlags.Number || here.flags === _sync.TypeFlags.NumberLiteral) && declared.flags & _sync.TypeFlags.Union && (_nullishCoalesce(_chunkUBXMRIM6cjs.typeParts.call(void 0, declared), () => ( []))).some((t) => t.flags & (_sync.TypeFlags.Undefined | _sync.TypeFlags.Null)) && !this.rustR16HasWrites(declaration)) { + return "definite"; + } + if (!_is.isVariableDeclaration.call(void 0, declaration) || declaration.initializer === void 0 || declaration.type !== void 0) + return void 0; + if (this.rustR16Assumed.has(declaration)) + return "number"; + this.rustR16Assumed.add(declaration); + try { + return this.rustR16WrittenKind(declaration, depth); + } finally { + this.rustR16Assumed.delete(declaration); + } + } + rustR16WrittenKind(declaration, depth) { + const kinds = [this.rustR16NumericKind(declaration.initializer, depth + 1)]; + const fn = this.rustEnclosingFunction(declaration); + if (fn === void 0) + return void 0; + const name = String(declaration.name.text); + for (const m of this.rustScopeNameNodes(fn, name)) { + if (m.kind !== _ast.SyntaxKind.Identifier || m === declaration.name) + continue; + const parent = m.parent; + if (_is.isBinaryExpression.call(void 0, parent) && parent.left === m && rustIsAssignmentOperator(parent.operatorToken.kind)) { + const op = parent.operatorToken.kind; + const right = this.rustR16NumericKind(parent.right, depth + 1); + if (op === _ast.SyntaxKind.EqualsToken || op === _ast.SyntaxKind.PlusEqualsToken || op === _ast.SyntaxKind.MinusEqualsToken || op === _ast.SyntaxKind.AsteriskEqualsToken) + kinds.push(right); + else if (op === _ast.SyntaxKind.SlashEqualsToken || op === _ast.SyntaxKind.PercentEqualsToken) + kinds.push(right === void 0 ? void 0 : "number"); + else + kinds.push(void 0); + } else if ((_optionalChain([parent, 'optionalAccess', _2614 => _2614.kind]) === _ast.SyntaxKind.PrefixUnaryExpression || _optionalChain([parent, 'optionalAccess', _2615 => _2615.kind]) === _ast.SyntaxKind.PostfixUnaryExpression) && (parent.operator === _ast.SyntaxKind.PlusPlusToken || parent.operator === _ast.SyntaxKind.MinusMinusToken)) { + continue; + } else if (parent !== void 0 && (_is.isArrayLiteralExpression.call(void 0, parent) && _is.isBinaryExpression.call(void 0, parent.parent) && parent.parent.left === parent || (_is.isForOfStatement.call(void 0, parent) || _is.isForInStatement.call(void 0, parent)) && parent.initializer === m)) { + kinds.push(void 0); + } + } + return this.rustR16Combine(kinds); + } + // No assignment / `++` / `--` names the binding: only control-flow guards narrow it. + rustR16HasWrites(declaration) { + const fn = _is.isParameterDeclaration.call(void 0, declaration) ? declaration.parent : this.rustEnclosingFunction(declaration); + if (fn === void 0) + return true; + return this.rustScopeNameNodes(fn, String(declaration.name.text)).some((m) => { + const parent = m.parent; + if (m.kind !== _ast.SyntaxKind.Identifier || m === declaration.name) + return false; + return _is.isBinaryExpression.call(void 0, parent) && parent.left === m && rustIsAssignmentOperator(parent.operatorToken.kind) || _optionalChain([parent, 'optionalAccess', _2616 => _2616.kind]) === _ast.SyntaxKind.PrefixUnaryExpression && (parent.operator === _ast.SyntaxKind.PlusPlusToken || parent.operator === _ast.SyntaxKind.MinusMinusToken) || _optionalChain([parent, 'optionalAccess', _2617 => _2617.kind]) === _ast.SyntaxKind.PostfixUnaryExpression; + }); + } + // Both sides Int/Float/Null: `<`/`>` are f64 compares with Null false; `<=`/`>=` also OR in + // `is_equal` (Null == Null), so they need one never-null side. + rustR16OrderedProven(op, left, right) { + const l = this.rustR16NumericKind(left); + const r = this.rustR16NumericKind(right); + if (l === void 0 || r === void 0) + return false; + return op === _ast.SyntaxKind.LessThanToken || op === _ast.SyntaxKind.GreaterThanToken || l === "definite" || r === "definite"; + } + // `a - b` / `a * b` / `a / b` / `a % b` on operands proven Int/Float/Null: the helper's dispatch. + rustR16NativeArithmetic(op, left, right, leftText, rightText) { + if (op !== _ast.SyntaxKind.MinusToken && op !== _ast.SyntaxKind.AsteriskToken && op !== _ast.SyntaxKind.SlashToken && op !== _ast.SyntaxKind.PercentToken) + return void 0; + if (!this.printsValueExpression(this.rustStripWrappers(left)) || !this.printsValueExpression(this.rustStripWrappers(right))) + return void 0; + if (this.rustR16NumericKind(left) === void 0 || this.rustR16NumericKind(right) === void 0) + return void 0; + if (op !== _ast.SyntaxKind.PercentToken) + return this.printNativeNumeric(op, leftText, rightText); + return `(match (&(${leftText}), &(${rightText})) { (Value::Int(x), Value::Int(y)) if *y != 0 => Value::Int(x % y), (Value::Int(x), Value::Float(y)) if *y != 0.0 => Value::Float(*x as f64 % *y), (Value::Float(x), Value::Int(y)) if *y != 0 => Value::Float(*x % *y as f64), (Value::Float(x), Value::Float(y)) if *y != 0.0 => Value::Float(x % y), _ => Value::Null })`; + } + // hx4 R17 — string helpers on proven-`Str` operands. `add(a, b)` with one side always a + // `Value::Str` takes the helper's `string_concat` arm, which is `Display` for every box but a + // Precise dict (only `new Precise` locals, typed `Precise`), so the other side may be any non-Precise box. + r17AlwaysStr(node) { + const inner = this.unwrapParensNode(node); + if (inner === void 0) + return false; + if (_is.isStringLiteral.call(void 0, inner) || _is.isNoSubstitutionTemplateLiteral.call(void 0, inner)) + return true; + if (_is.isBinaryExpression.call(void 0, inner) && inner.operatorToken.kind === _ast.SyntaxKind.PlusToken) + return this.r17AlwaysStr(inner.left) || this.r17AlwaysStr(inner.right); + return _is.isCallExpression.call(void 0, inner) && _is.isPropertyAccessExpression.call(void 0, inner.expression) && inner.expression.name.text === "toString" && (_nullishCoalesce(_optionalChain([inner, 'access', _2618 => _2618.arguments, 'optionalAccess', _2619 => _2619.length]), () => ( 0))) === 0 && this.printsValueExpression(inner.expression.expression); + } + r17ConcatOperandSafe(node, type) { + if (this.r17AlwaysStr(node)) + return true; + const inner = this.unwrapParensNode(node); + if (!this.printsValueExpression(inner) || this.rustNativeStrCalleeKind(inner) === "str") + return false; + if (_is.isIdentifier.call(void 0, inner) && (this.rustStringLocalIdentifierIsTyped(inner) || this.rustVecLocalDeclarationOf(inner) !== void 0)) + return false; + const parts = type === void 0 ? [] : type.flags & _sync.TypeFlags.Union ? _nullishCoalesce(_chunkUBXMRIM6cjs.typeParts.call(void 0, type), () => ( [])) : [type]; + return parts.length > 0 && parts.every((t) => String(_nullishCoalesce(_nullishCoalesce(_optionalChain([t, 'optionalAccess', _2620 => _2620.symbol, 'optionalAccess', _2621 => _2621.escapedName]), () => ( _optionalChain([t, 'optionalAccess', _2622 => _2622.symbol, 'optionalAccess', _2623 => _2623.name]))), () => ( ""))) !== "Precise"); + } + r17ConcatIsAnchored(left, right, leftType, rightType) { + return this.r17AlwaysStr(left) && this.r17ConcatOperandSafe(right, rightType) || this.r17AlwaysStr(right) && this.r17ConcatOperandSafe(left, leftType); + } + /** R06 checker-string or R13 proven-`Str` receiver printed as a plain name / parenthesised. */ + r17Receiver(node, receiverText) { + return _nullishCoalesce(this.rustNativeStringReceiver(node, receiverText), () => ( this.rustR13Receiver(node, receiverText))); + } + // `x.trim()`: the helper's `Str` arm is `str::trim`, Null otherwise. + r17PrintTrim(node, receiverText) { + const receiver = this.r17Receiver(node, receiverText); + if (receiver === void 0 || (_nullishCoalesce(_optionalChain([node, 'access', _2624 => _2624.arguments, 'optionalAccess', _2625 => _2625.length]), () => ( 0))) !== 0) + return void 0; + return `${receiver}.as_str().map(|__s| Value::Str(__s.trim().to_string().into())).unwrap_or(Value::Null)`; + } + // `x.startsWith(p)` / `x.endsWith(p)` with a proven/checker string operand: false unless both are `Str`. + r17PrintAffixTest(node, receiverText, method) { + if (_optionalChain([node, 'optionalAccess', _2626 => _2626.arguments, 'optionalAccess', _2627 => _2627.length]) !== 1) + return void 0; + const receiver = this.r17Receiver(node, receiverText); + const arg = receiver === void 0 ? void 0 : this.rustR13StrOperand(node.arguments[0], true); + if (arg === void 0) + return void 0; + return `${receiver}.as_str().zip(${arg}.as_str()).is_some_and(|(__s, __p)| __s.${method}(__p))`; + } + // `x.replace(p, r)` / `x.replaceAll(p, r)`: both helpers replace every occurrence when all three + // are `Str`, else return the receiver; `p`/`r` are literals or proven/checker string operands. + r17PrintReplace(node, receiverText) { + if (_optionalChain([node, 'optionalAccess', _2628 => _2628.arguments, 'optionalAccess', _2629 => _2629.length]) !== 2) + return void 0; + const receiver = this.r17Receiver(node, receiverText); + if (receiver === void 0 || !/^[A-Za-z_][A-Za-z0-9_.]*$/.test(receiver)) + return void 0; + const operand = (arg) => { + const literal = this.rustNativeStringLiteralArg(arg); + return literal !== void 0 ? `Value::Str("${literal}".into())` : this.rustR13StrOperand(arg, true); + }; + const from = operand(node.arguments[0]); + const to = operand(node.arguments[1]); + if (from === void 0 || to === void 0) + return void 0; + return `match (${receiver}.as_str(), ${from}.as_str(), ${to}.as_str()) { (Some(__s), Some(__p), Some(__r)) => Value::Str(__s.replace(__p, __r).into()), _ => ${receiver}.clone() }`; + } + // hx4 R18 — collection helpers on locals whose runtime shape is proven: `"k" in x` on an R10 + // plain-dict receiver, `Object.keys/values` on one in prediction sources, and `.length` / + // `.push` on a `Value::Arr`-only local (never a book/cache marker the helpers route). + /** `"lit" in x` where x is an R10-proven plain local / plain-kept Dict parameter. */ + r18LiteralInOp(key, obj) { + if (!_is.isStringLiteral.call(void 0, key) || this.r05IsTest(key)) + return void 0; + const recv = this.rustStripWrappers(obj); + if (recv === void 0 || !_is.isIdentifier.call(void 0, recv) || this.rustR10PlainReceiver(recv) === void 0) + return void 0; + const keyLiteral = this.rustStringLiteralOf(this.printStringLiteral(key)); + if (keyLiteral === void 0) + return void 0; + return `Value::Bool(matches!(&${this.printNode(recv, 0).trim()}, Value::Dict(__d) if __d.contains_key(${keyLiteral})))`; + } + /** `Object.keys/values(x)` in `ts/src/prediction/.ts` on an R10-proven plain local. */ + r18PredictionEnum(node, parsedArg, kind) { + const arg = this.rustStripWrappers(_optionalChain([node, 'optionalAccess', _2630 => _2630.arguments, 'optionalAccess', _2631 => _2631[0]])); + if (arg === void 0 || parsedArg === void 0 || !_is.isIdentifier.call(void 0, arg) || !/\/ts\/src\/prediction\/[^/]+\.ts$/.test(this.r05Path(node)) || this.rustR10PlainReceiver(arg) !== "local") + return void 0; + const body = kind === "keys" ? "__m.keys().map(|__k| Value::Str(__k.clone().into())).collect()" : "__m.values().cloned().collect()"; + return `Value::Array(${parsedArg.trim()}.as_map().map(|__m| ${body}).unwrap_or_default())`; + } + /** A source that is a `Value::Arr` or `Value::Null` (both helpers agree with `len()` / a no-op + * push there): `[...]`, nullish, a runtime `split`, base `toArray`, or a base `safeList*` + * read whose default is absent, nullish or `[...]`. */ + r18ArrSource(node, allowNull) { + const n = this.rustStripWrappers(node); + if (n === void 0) + return false; + if (this.r21ArrSource(n)) + return true; + if (_is.isArrayLiteralExpression.call(void 0, n)) + return !n.elements.some((e) => e.kind === _ast.SyntaxKind.SpreadElement); + if (n.kind === _ast.SyntaxKind.NullKeyword || _is.isIdentifier.call(void 0, n) && String(n.text) === "undefined") + return allowNull; + if (this.rustCallPrintsRuntimeSplit(n)) + return true; + if (!_is.isCallExpression.call(void 0, n) || !_is.isPropertyAccessExpression.call(void 0, n.expression) || n.expression.expression.kind !== _ast.SyntaxKind.ThisKeyword) + return false; + const callee = String(n.expression.name.text); + if (callee === "toArray") + return n.arguments.length === 1 && this.rustR01CalleeIsBase(n); + const index = _RustTranspiler.RUST_R18_LIST_READERS[callee]; + if (index === void 0 || n.arguments.length > index + 1) + return false; + const fallback = this.rustStripWrappers(n.arguments[index]); + const arrDefault = fallback !== void 0 && _is.isArrayLiteralExpression.call(void 0, fallback); + return (arrDefault || allowNull && (fallback === void 0 || fallback.kind === _ast.SyntaxKind.NullKeyword || _is.isIdentifier.call(void 0, fallback) && String(fallback.text) === "undefined")) && this.rustR01CalleeIsBase(n); + } + /** A local whose every write (declaration included) is an `r18ArrSource`, never captured by + * a closure: its `Value` is a plain `Value::Arr` (the runtime never tags an array). */ + r18ArrLocal(ident, allowNull) { + if (ident === void 0 || !_is.isIdentifier.call(void 0, ident) || this.rustParamShadowOf(ident) !== void 0 || this.r05IsTest(ident)) + return false; + const declaration = this.rustSingleLocalDeclaration(ident); + if (declaration === void 0 || !_is.isVariableDeclaration.call(void 0, declaration) || !_is.isIdentifier.call(void 0, declaration.name) || !this.r18ArrSource(declaration.initializer, allowNull)) + return false; + const scope = this.rustEnclosingFunction(declaration); + if (scope === void 0 || _is.isSourceFile.call(void 0, scope) || this.rustEnclosingFunction(ident) !== scope) + return false; + const name = String(declaration.name.text); + const symbol = this.rustSymbolOf(declaration.name); + if (symbol === void 0) + return false; + for (const n of this.rustScopeNameNodes(scope, name)) { + if (n.kind !== _ast.SyntaxKind.Identifier || n === declaration.name || this.rustSymbolOf(n) !== symbol) + continue; + if (this.rustEnclosingFunction(n) !== scope) + return false; + let target = n; + while (target.parent !== void 0 && (_is.isParenthesizedExpression.call(void 0, target.parent) || _is.isNonNullExpression.call(void 0, target.parent) || _is.isAsExpression.call(void 0, target.parent))) + target = target.parent; + const parent = target.parent; + if (parent === void 0) + continue; + if (parent.kind === _ast.SyntaxKind.ShorthandPropertyAssignment || parent.kind === _ast.SyntaxKind.PropertyAssignment && parent.initializer === target) + return false; + if (_is.isBinaryExpression.call(void 0, parent) && parent.left === target && rustIsAssignmentOperator(parent.operatorToken.kind)) { + if (parent.operatorToken.kind !== _ast.SyntaxKind.EqualsToken || !this.r18ArrSource(parent.right, allowNull)) + return false; + continue; + } + if (parent.kind === _ast.SyntaxKind.ArrayLiteralExpression && _is.isBinaryExpression.call(void 0, parent.parent) && parent.parent.left === parent) + return false; + if ((parent.kind === _ast.SyntaxKind.PrefixUnaryExpression || parent.kind === _ast.SyntaxKind.PostfixUnaryExpression) && (parent.operator === _ast.SyntaxKind.PlusPlusToken || parent.operator === _ast.SyntaxKind.MinusMinusToken)) + return false; + } + return true; + } + /** `x.length` on an Arr-only local: `get_array_length`'s marker arms need a Dict. */ + r18ArrLength(node, receiver) { + const recv = this.rustStripWrappers(_optionalChain([node, 'optionalAccess', _2632 => _2632.expression])); + if (!this.r18ArrLocal(recv, true)) + return void 0; + return `Value::Int(${receiver}.len() as i64)`; + } + /** `x.push(v)` statement on an Arr-only local: `append_to_array`'s cache-push arm needs a Dict. */ + r18ArrPush(node, name, parsedArg) { + const recv = _optionalChain([node, 'optionalAccess', _2633 => _2633.expression, 'optionalAccess', _2634 => _2634.expression]); + if (name === void 0 || parsedArg === void 0 || _optionalChain([node, 'optionalAccess', _2635 => _2635.arguments, 'optionalAccess', _2636 => _2636.length]) !== 1 || node.arguments[0].kind === _ast.SyntaxKind.SpreadElement || _optionalChain([node, 'access', _2637 => _2637.parent, 'optionalAccess', _2638 => _2638.kind]) !== _ast.SyntaxKind.ExpressionStatement || !this.r18ArrLocal(recv, false) || name.trim() !== this.printNode(recv, 0).trim()) + return void 0; + if (!this.rustVecPushShape(node, String(recv.text))) + return void 0; + const arg = parsedArg.trim(); + const value = /^[a-zA-Z_][a-zA-Z0-9_]*$/.test(arg) && arg !== "self" && arg !== "true" && arg !== "false" ? `${arg}.clone()` : arg; + return `if let Value::Arr(__a) = &mut ${name} { std::sync::Arc::make_mut(__a).push(${value}); }`; + } + // hx4 R20 — `startsWith/endsWith(..) === true|false` compares the runtime fn's bare bool + // (is_equal of two Bool boxes is the payload compare); `a + b` on R16 numeric kinds is the + // `add` helper's Int/Float/Null dispatch, the same native match as `-`/`*`. + r20BoolCallEquality(left, right, op) { + const l = this.unwrapParensNode(left); + const r = this.unwrapParensNode(right); + const isBoolLit = (n) => _optionalChain([n, 'optionalAccess', _2639 => _2639.kind]) === _ast.SyntaxKind.TrueKeyword || _optionalChain([n, 'optionalAccess', _2640 => _2640.kind]) === _ast.SyntaxKind.FalseKeyword; + if (isBoolLit(l) === isBoolLit(r)) + return void 0; + const literal = isBoolLit(l) ? l : r; + const call = isBoolLit(l) ? r : l; + if (!_is.isCallExpression.call(void 0, call) || !_is.isPropertyAccessExpression.call(void 0, call.expression)) + return void 0; + const name = String(call.expression.name.text); + if (name !== "startsWith" && name !== "endsWith" || call.arguments.length !== 1) + return void 0; + const text = this.printNode(call, 0).trim(); + const fn = name === "startsWith" ? "starts_with" : "ends_with"; + const m = /^Value::Bool\((.*)\)$/s.exec(text); + if (m === null || !m[1].startsWith(`${fn}(`) || !this.r20Balanced(m[1]) || text.includes("\n")) + return void 0; + const equals = op === _ast.SyntaxKind.EqualsEqualsToken || op === _ast.SyntaxKind.EqualsEqualsEqualsToken; + return literal.kind === _ast.SyntaxKind.TrueKeyword === equals ? m[1] : `!${m[1]}`; + } + /** `fn(...)` whose first `(` closes at the very end (string literals skipped). */ + r20Balanced(text) { + let depth = 0; + for (let i = 0; i < text.length; i++) { + const c = text[i]; + if (c === '"') { + for (i++; i < text.length && text[i] !== '"'; i++) + if (text[i] === "\\") + i++; + continue; + } + if (c === "(") + depth++; + else if (c === ")") { + depth--; + if (depth === 0 && i !== text.length - 1) + return false; + } + } + return depth === 0 && text.endsWith(")"); + } + r20NativeNumericAdd(op, left, right, leftText, rightText) { + if (op !== _ast.SyntaxKind.PlusToken) + return void 0; + if (!this.printsValueExpression(this.rustStripWrappers(left)) || !this.printsValueExpression(this.rustStripWrappers(right))) + return void 0; + if (this.rustR16NumericKind(left) === void 0 || this.rustR16NumericKind(right) === void 0) + return void 0; + return this.printNativeNumeric(op, leftText, rightText); + } + // hx4 R21 — `Object.keys/values` on an R10-proven plain local in the base tier (the + // helper's ws-tag filter is a no-op on a map built from literals), and native map reads + // that are the receiver of a non-mutating string method (`currency['id'].toUpperCase ()`). + /** Base-tier (`ts/src/base/**`) `Object.keys/values(x)` on an R10-proven plain local. */ + r21BaseEnum(node, parsedArg, kind) { + const arg = this.rustStripWrappers(_optionalChain([node, 'optionalAccess', _2641 => _2641.arguments, 'optionalAccess', _2642 => _2642[0]])); + if (arg === void 0 || parsedArg === void 0 || !_is.isIdentifier.call(void 0, arg) || !_RustTranspiler.RUST_BASE_TIER_FILE.test(this.r05Path(node)) || this.rustR10PlainReceiver(arg) !== "local") + return void 0; + const body = kind === "keys" ? "__m.keys().map(|__k| Value::Str(__k.clone().into())).collect()" : "__m.values().cloned().collect()"; + return `Value::Array(${parsedArg.trim()}.as_map().map(|__m| ${body}).unwrap_or_default())`; + } + /** `x['k'].m (…)` with `m` a non-mutating string method on a checker-`string` read: no + * ccxt pass rewrites that target (only `.push` / calls of the read itself). */ + r21PureStringMethodReceiver(node) { + const access = _optionalChain([node, 'optionalAccess', _2643 => _2643.parent]); + const call = _optionalChain([access, 'optionalAccess', _2644 => _2644.parent]); + if (!_is.isElementAccessExpression.call(void 0, node) || access === void 0 || !_is.isPropertyAccessExpression.call(void 0, access) || access.expression !== node || call === void 0 || !_is.isCallExpression.call(void 0, call) || call.expression !== access || !_RustTranspiler.RUST_R21_PURE_STRING_METHODS.has(String(access.name.text))) + return false; + const type = this.typeOfNodeIfAny(node); + return type !== void 0 && (type.flags & _sync.TypeFlags.StringLike) !== 0; + } + /** More always-`Value::Arr` sources for the R18 proof: base `arrayConcat` (Array on every + * arm), base `sortBy`/`sortBy2` of an Arr-only local (returns its input's variant), and a + * plain alias of a non-nullable Arr-only local (COW: the push never reaches the alias). */ + r21ArrSource(n) { + if (_is.isCallExpression.call(void 0, n) && _is.isPropertyAccessExpression.call(void 0, n.expression) && n.expression.expression.kind === _ast.SyntaxKind.ThisKeyword) { + const callee = String(n.expression.name.text); + if (callee === "arrayConcat") + return n.arguments.length === 2 && this.rustR01CalleeIsBase(n); + if (callee === "sortBy" || callee === "sortBy2") { + const first = this.rustStripWrappers(n.arguments[0]); + return first !== void 0 && _is.isIdentifier.call(void 0, first) && this.rustR01CalleeIsBase(n) && this.r21ArrAlias(first); + } + return false; + } + return _is.isIdentifier.call(void 0, n) && String(n.text) !== "undefined" && this.r21ArrAlias(n); + } + r21ArrAlias(ident) { + const declaration = this.rustSingleLocalDeclaration(ident); + if (declaration === void 0 || !_is.isVariableDeclaration.call(void 0, declaration)) + return false; + if (this.r21ArrVisiting.has(declaration)) + return true; + this.r21ArrVisiting.add(declaration); + try { + return this.r18ArrLocal(ident, false); + } finally { + this.r21ArrVisiting.delete(declaration); + } + } + // hx4 R22 — an R16 local re-read inside its own write (`p = p + 4`) is the assumed kind. + r22AssumedNumericSelf(inner) { + if (!_is.isIdentifier.call(void 0, inner)) + return void 0; + const declaration = this.rustSingleLocalDeclaration(inner); + return declaration !== void 0 && this.rustR16Assumed.has(declaration) ? "number" : void 0; + } + /** Always `Value::Str`: R17 shapes, a `+` chain with such an operand, or an always-Str local. */ + r22AlwaysStr(node) { + const inner = this.unwrapParensNode(node); + if (inner === void 0) + return false; + if (this.r17AlwaysStr(inner)) + return true; + if (_is.isBinaryExpression.call(void 0, inner) && inner.operatorToken.kind === _ast.SyntaxKind.PlusToken) + return this.r22AlwaysStr(inner.left) || this.r22AlwaysStr(inner.right); + return _is.isIdentifier.call(void 0, inner) && this.r22AlwaysStrLocal(inner); + } + /** A plain `Value` local, never captured by a closure, whose every write is always-Str (`x += e` + * keeps it), or Str|Null (R13 source / nullish) when the checker narrows this read to `string`. */ + r22AlwaysStrLocal(ident, allowNull = false) { + if (this.rustParamShadowOf(ident) !== void 0 || this.rustStringLocalIdentifierIsTyped(ident) || this.rustVecLocalDeclarationOf(ident) !== void 0) + return false; + const declaration = this.rustSingleLocalDeclaration(ident); + if (declaration === void 0 || !_is.isVariableDeclaration.call(void 0, declaration) || !_is.isIdentifier.call(void 0, declaration.name) || declaration.initializer === void 0) + return false; + if (this.r22StrVisiting.has(declaration)) + return allowNull || this.r22StrVisiting.get(declaration) === false; + const fn = this.rustEnclosingFunction(declaration); + if (fn === void 0) + return false; + const here = this.typeOfNodeIfAny(ident); + const narrowed = allowNull || here !== void 0 && this.isStringLikeType(here); + const nullish = (e) => { + const n = this.unwrapParensNode(e); + return _optionalChain([n, 'optionalAccess', _2645 => _2645.kind]) === _ast.SyntaxKind.NullKeyword || _is.isIdentifier.call(void 0, n) && String(n.text) === "undefined"; + }; + const local = (e) => { + const n = this.unwrapParensNode(e); + return _is.isIdentifier.call(void 0, n) && (this.rustR13ProvenStrIdentifier(n) || this.r22AlwaysStrLocal(n, true)); + }; + const source = (e) => this.r22AlwaysStr(e) || narrowed && (nullish(e) || this.rustR13ProvenStrSource(e) || local(e)); + this.r22StrVisiting.set(declaration, allowNull); + try { + if (!source(declaration.initializer)) + return false; + return this.rustLocalUsesAll(declaration, String(declaration.name.text), true, (n) => { + if (this.rustEnclosingFunction(n) !== fn || this.rustR13WriteTarget(n)) + return false; + const parent = n.parent; + if ((_optionalChain([parent, 'optionalAccess', _2646 => _2646.kind]) === _ast.SyntaxKind.PrefixUnaryExpression || _optionalChain([parent, 'optionalAccess', _2647 => _2647.kind]) === _ast.SyntaxKind.PostfixUnaryExpression) && parent.operator !== _ast.SyntaxKind.ExclamationToken) + return false; + if (!_is.isBinaryExpression.call(void 0, parent) || parent.left !== n || !rustIsAssignmentOperator(parent.operatorToken.kind)) + return true; + const op = parent.operatorToken.kind; + return op === _ast.SyntaxKind.PlusEqualsToken || op === _ast.SyntaxKind.EqualsToken && source(parent.right); + }); + } finally { + this.r22StrVisiting.delete(declaration); + } + } + r22ConcatAnchor(node) { + const inner = this.unwrapParensNode(node); + return inner !== void 0 && this.printsValueExpression(inner) && this.r22AlwaysStr(inner); + } + r22ConcatIsAnchored(left, right, leftType, rightType) { + return this.r22ConcatAnchor(left) && this.r17ConcatOperandSafe(right, rightType) || this.r22ConcatAnchor(right) && this.r17ConcatOperandSafe(left, leftType); + } + /** `Option<&str>` text of an operand that is always `Value::Str` / `Value::Null`, else undefined. */ + r22StrOrNullOperand(node) { + const inner = this.rustStripWrappers(node); + if (inner === void 0) + return void 0; + if (_is.isStringLiteral.call(void 0, inner)) + return inner.text in this.StringLiteralReplacements ? void 0 : `Some(${this.quotedStringLiteral(inner.text)})`; + if (_is.isIdentifier.call(void 0, inner) && this.r22AlwaysStrLocal(inner, true)) { + const text = this.printNode(inner, 0).trim(); + return /^[A-Za-z_][A-Za-z0-9_]*$/.test(text) ? `${text}.as_str()` : void 0; + } + const operand = this.rustR13StrOperand(inner, true); + return operand === void 0 ? void 0 : `${operand}.as_str()`; + } + // `a < b` (`<=`, `>`, `>=`) on Str|Null operands: the helper's f64 parse of both strings, else + // `str` order; `<=`/`>=` OR in `is_equal` (string equality, Null == Null). + r22StrOrderedComparison(node, op, left, right) { + const operator = _RustTranspiler.NATIVE_COMPARISON_OPERATORS[op]; + const a = this.r22StrOrNullOperand(left); + const b = a === void 0 ? void 0 : this.r22StrOrNullOperand(right); + if (operator === void 0 || b === void 0) + return void 0; + const strict = operator.charAt(0); + const orEqual = operator.length === 2; + const order = `(match (__x.parse::(), __y.parse::()) { (Ok(__p), Ok(__q)) => __p ${strict} __q, _ => __x ${strict} __y })`; + const text = `(match (${a}, ${b}) { (Some(__x), Some(__y)) => ${order}${orEqual ? " || __x == __y" : ""}, ${orEqual ? "(None, None) => true, " : ""}_ => false })`; + return this.isBooleanPosition(node) ? text : `Value::Bool(${text})`; + } + // hx4 R23 — the R12 plain sources (`safeDict*(x, k, {})`, same-file builders, `extend|omit`) + // also hold in the base tier and pro files, where a tagged handle can only arrive through a + // parameter: base admits typed plain-dict parameters, pro admits no parameter at all. + r23Tier(node) { + const path3 = this.r05Path(node); + if (_RustTranspiler.RUST_R12_REST_FILE.test(path3) && /\/ts\/src\/[^/]+\.ts$/.test(path3)) + return "rest"; + if (_RustTranspiler.RUST_BASE_TIER_FILE.test(path3) && !/\/base\/ws\//.test(path3)) + return "base"; + if (/\/ts\/src\/pro\/[^/]+\.ts$/.test(path3)) + return "pro"; + return void 0; + } + r23PlainSourceTier(node) { + return this.r23Tier(node) !== void 0; + } + /** A copied/read dict argument outside REST: in pro only `this.options` or a proven plain + * local; in base also a parameter annotated with a plain-dict type (no `any` caller handle). */ + r23TierSourceOk(arg) { + const tier = this.r23Tier(arg); + if (tier === "rest") + return true; + const node = this.rustStripWrappers(arg); + if (node === void 0 || !_is.isIdentifier.call(void 0, node)) + return true; + const declaration = this.rustSingleLocalDeclaration(node); + if (tier === "pro") + return declaration !== void 0 && !_is.isParameterDeclaration.call(void 0, declaration) && this.rustR10PlainReceiver(node) === "local"; + if (declaration === void 0 || !_is.isParameterDeclaration.call(void 0, declaration)) + return true; + if (tier !== "base" || declaration.type === void 0 || declaration.dotDotDotToken !== void 0) + return false; + const type = this.getCheckedTypeOf(declaration.type); + return type !== void 0 && this.isProvenMapType(type) && !this.rustParameterIsClientHandle(declaration); + } + r23FreshCopy(node, depth) { + const callee = String(node.expression.name.text); + if (callee !== "extend" && callee !== "omit" && callee !== "keysort" || this.r23CopyVisiting.has(node)) + return false; + this.r23CopyVisiting.add(node); + try { + return this.rustR12PlainReturn(node, depth); + } finally { + this.r23CopyVisiting.delete(node); + } + } + // hx4 R25 — `a - b` / `a * b` / `a / b` and `a < b` (`<=`, `>`, `>=`) on unproven `Value`s print the + // helper's own dispatch inline (f64 coercion: Int/Float, Str parse, Bool 1/0; `<=`/`>=` OR in + // `is_equal`); `a + b` on two Str|Null operands (fields of same-file object literals) is `format!`. + r25LooseF64(binding) { + return `(match ${binding} { Value::Int(__n) => Some(*__n as f64), Value::Float(__f) => Some(*__f), Value::Str(__s) => __s.parse::().ok(), Value::Bool(__b) => Some(if *__b { 1.0 } else { 0.0 }), _ => None })`; + } + r25PlainValueOperand(node) { + const inner = this.rustStripWrappers(node); + if (inner === void 0 || !this.printsValueExpression(inner) || this.rustNativeStrCalleeKind(inner) === "str") + return false; + if (_is.isIdentifier.call(void 0, inner) && this.rustParamShadowOf(inner) !== void 0) + return false; + return !(_is.isIdentifier.call(void 0, inner) && (this.rustStringLocalIdentifierIsTyped(inner) || this.rustVecLocalDeclarationOf(inner) !== void 0)); + } + r25NativeCoercingArithmetic(op, left, right, leftText, rightText) { + if (op === _ast.SyntaxKind.PlusToken) + return this.r25NativeStrOrNullConcat(left, right, leftText, rightText); + if (op !== _ast.SyntaxKind.MinusToken && op !== _ast.SyntaxKind.AsteriskToken && op !== _ast.SyntaxKind.SlashToken) + return void 0; + if (!this.r25PlainValueOperand(left) || !this.r25PlainValueOperand(right)) + return void 0; + const a = this.rustR16NumericKind(left) !== void 0 ? "__a.as_f64()" : this.r25LooseF64("__a"); + const b = this.rustR16NumericKind(right) !== void 0 ? "__b.as_f64()" : this.r25LooseF64("__b"); + if (op === _ast.SyntaxKind.SlashToken) { + return `(match (&(${leftText}), &(${rightText})) { (__a, __b) => match (${a}, ${b}) { (Some(__x), Some(__y)) if __y != 0.0 => Value::Float(__x / __y), _ => Value::Null } })`; + } + const sign = op === _ast.SyntaxKind.MinusToken ? "-" : "*"; + return `(match (&(${leftText}), &(${rightText})) { (Value::Int(__x), Value::Int(__y)) => Value::Int(__x ${sign} __y), (__a, __b) => match (${a}, ${b}) { (Some(__x), Some(__y)) => Value::Float(__x ${sign} __y), _ => Value::Null } })`; + } + // is_less_than / is_greater_than: f64 order when both coerce, else `str` order of two Str; + // the `-or_equal` forms OR in is_equal (Null==Null, same-variant payload, Int exact, else f64). + r25NativeLooseOrderedComparison(node, op, left, right) { + const operator = _RustTranspiler.NATIVE_COMPARISON_OPERATORS[op]; + if (operator === void 0 || !this.r25PlainValueOperand(left) || !this.r25PlainValueOperand(right)) + return void 0; + const strict = operator.charAt(0); + const p = `(${this.r25LooseF64("__a")}, ${this.r25LooseF64("__b")})`; + const order = `(match ${p} { (Some(__x), Some(__y)) => __x ${strict} __y, _ => matches!((__a, __b), (Value::Str(__x), Value::Str(__y)) if __x ${strict} __y) })`; + const equal = ` || (match (__a, __b) { (Value::Null, Value::Null) => true, (Value::Bool(__x), Value::Bool(__y)) => __x == __y, (Value::Str(__x), Value::Str(__y)) => __x == __y, (Value::Int(__x), Value::Int(__y)) => __x == __y, (Value::Float(__x), Value::Float(__y)) => __x == __y, _ => matches!(${p}, (Some(__x), Some(__y)) if __x == __y) })`; + const text = `(match (&(${this.printNode(left, 0)}), &(${this.printNode(right, 0)})) { (__a, __b) => ${order}${operator.length === 2 ? equal : ""} })`; + return this.isBooleanPosition(node) ? text : `Value::Bool(${text})`; + } + // Str+Str / Str+Null take `string_concat` (Display, Null is "null"); Null+Null is Null. + r25NativeStrOrNullConcat(left, right, leftText, rightText) { + if (!this.r25StrOrNull(left, 0) || !this.r25StrOrNull(right, 0)) + return void 0; + return `(match (&(${leftText}), &(${rightText})) { (Value::Null, Value::Null) => Value::Null, (__a, __b) => Value::Str(format!("{}{}", __a, __b).into()) })`; + } + r25StrOrNull(node, depth) { + const inner = this.rustStripWrappers(node); + if (inner === void 0 || depth > 12 || !this.r25PlainValueOperand(inner)) + return false; + if (_is.isStringLiteral.call(void 0, inner) || this.r22AlwaysStr(inner)) + return true; + if (_is.isCallExpression.call(void 0, inner) && _is.isPropertyAccessExpression.call(void 0, inner.expression) && (String(inner.expression.name.text) === "padStart" || String(inner.expression.name.text) === "padEnd")) + return true; + if (!_is.isElementAccessExpression.call(void 0, inner) || !_is.isStringLiteral.call(void 0, inner.argumentExpression)) + return false; + return this.r25DictFieldStrOrNull(inner.expression, String(inner.argumentExpression.text), depth + 1); + } + /** Every dict `node` can evaluate to holds `key` as Str/Null or lacks it (a read of a missing key / non-dict is Null). */ + r25DictFieldStrOrNull(node, key, depth) { + const inner = this.rustStripWrappers(node); + if (inner === void 0 || depth > 12) + return false; + if (inner.kind === _ast.SyntaxKind.NullKeyword || _is.isIdentifier.call(void 0, inner) && String(inner.text) === "undefined") + return true; + if (_is.isObjectLiteralExpression.call(void 0, inner)) { + for (const p of inner.properties) { + if (p.kind !== _ast.SyntaxKind.PropertyAssignment) + return false; + const name = p.name; + const text = _is.isStringLiteral.call(void 0, name) || _is.isIdentifier.call(void 0, name) ? String(name.text) : void 0; + if (text === void 0) + return false; + if (text === key && !this.r25StrOrNull(p.initializer, depth + 1)) + return false; + } + return true; + } + if (_is.isCallExpression.call(void 0, inner)) + return this.r25MethodFieldStrOrNull(inner, key, depth + 1); + if (!_is.isIdentifier.call(void 0, inner)) + return false; + const declaration = this.rustSingleLocalDeclaration(inner); + if (declaration === void 0 || !_is.isVariableDeclaration.call(void 0, declaration) || !_is.isIdentifier.call(void 0, declaration.name) || declaration.initializer === void 0 || (_optionalChain([declaration, 'access', _2648 => _2648.parent, 'optionalAccess', _2649 => _2649.flags]) & _ast.NodeFlags.Const) === 0) + return false; + const fn = this.rustEnclosingFunction(declaration); + if (fn === void 0) + return false; + for (const m of this.rustScopeNameNodes(fn, String(declaration.name.text))) { + if (m === declaration.name || m.kind !== _ast.SyntaxKind.Identifier) + continue; + let top = m; + while (_is.isElementAccessExpression.call(void 0, top.parent) && top.parent.expression === top) + top = top.parent; + if (top === m) + continue; + const parent = top.parent; + if (_is.isDeleteExpression.call(void 0, parent) || _is.isBinaryExpression.call(void 0, parent) && parent.left === top && rustIsAssignmentOperator(parent.operatorToken.kind)) + return false; + } + return this.r25DictFieldStrOrNull(declaration.initializer, key, depth + 1); + } + /** `this.m(..)` resolved to a same-file method with a body whose every return holds `key` as Str/Null. */ + r25MethodFieldStrOrNull(call, key, depth) { + const callee = call.expression; + if (!_is.isPropertyAccessExpression.call(void 0, callee) || callee.expression.kind !== _ast.SyntaxKind.ThisKeyword) + return false; + let declaration; + try { + declaration = _chunkUBXMRIM6cjs.signatureDeclaration.call(void 0, this.getChecker().getResolvedSignature(call)); + } catch (e) { + return false; + } + if (_optionalChain([declaration, 'optionalAccess', _2650 => _2650.kind]) !== _ast.SyntaxKind.MethodDeclaration || declaration.body === void 0 || declaration.getSourceFile() !== call.getSourceFile() || _RustTranspiler.RUST_BASE_TIER_FILE.test(this.r05Path(call))) + return false; + let ok = true; + const visit = (n) => { + if (!ok || n !== declaration && _chunkUBXMRIM6cjs.isFunctionLike.call(void 0, n)) + return; + if (_is.isReturnStatement.call(void 0, n) && n.expression !== void 0 && !this.r25DictFieldStrOrNull(n.expression, key, depth + 1)) + ok = false; + _optionalChain([n, 'access', _2651 => _2651.forEachChild, 'optionalCall', _2652 => _2652(visit)]); + }; + declaration.body.forEachChild(visit); + return ok; + } + r26ParamsSlot(rhs, selfName, depth) { + const call = this.rustStripWrappers(rhs); + if (depth > 4 || call === void 0 || !_is.isCallExpression.call(void 0, call) || !_is.isPropertyAccessExpression.call(void 0, call.expression) || call.expression.expression.kind !== _ast.SyntaxKind.ThisKeyword || this.r23Tier(call) === void 0) { + return false; + } + const index = _RustTranspiler.R26_PARAMS_SLOT_ARG[String(call.expression.name.text)]; + if (index === void 0 || !this.rustR01CalleeIsBase(call)) + return false; + const arg = this.rustStripWrappers(call.arguments[index]); + if (arg === void 0) + return call.arguments.length <= index; + if (this.rustPlainDictLiteral(arg)) + return true; + if (!_is.isIdentifier.call(void 0, arg)) + return false; + if (String(arg.text) === selfName) + return true; + const declaration = this.rustSingleLocalDeclaration(arg); + if (declaration !== void 0 && _is.isParameterDeclaration.call(void 0, declaration)) { + return this.r23TierSourceOk(arg) && (this.r23Tier(arg) !== "base" || this.rustParamStaysPlainDict(declaration)); + } + try { + return this.rustR10PlainReceiver(arg) === "local"; + } catch (e) { + return false; + } + } + // hx4 R30 — `slice` / `indexOf` / `toUpperCase` / `toLowerCase` on unproven `Value`s print the + // runtime helper's own dispatch inline (`runtime.rs` slice/get_index_of/to_upper/to_lower); + // every operand is evaluated once, in the helper's argument order. + r30LooseI64(expr) { + return `(match &(${expr}) { Value::Int(__n) => Some(*__n), Value::Float(__f) => Some(*__f as i64), Value::Str(__s) => __s.parse::().ok(), Value::Bool(__b) => Some(if *__b { 1 } else { 0 }), _ => None })`; + } + r30SliceArm(variant, len, take, empty) { + const bound = (b) => `if ${b} < 0 { (__l + ${b}).max(0) } else { ${b}.min(__l) }`; + return `(${variant}, __b, __e) => match (${len}) { __l => match (${bound("__b")}, match __e { None => __l, Some(__k) => ${bound("__k")} }) { (__i, __j) => if __i <= __j { ${take} } else { ${empty} } } }`; + } + r30Slice(name, start, end) { + const str = this.r30SliceArm( + "Value::Str(__sv)", + "__sv.chars().count() as i64", + "Value::Str(__sv.chars().skip(__i as usize).take((__j - __i) as usize).collect::().into())", + "Value::Str(String::new().into())" + ); + const arr = this.r30SliceArm( + "Value::Arr(__a)", + "__a.len() as i64", + "Value::Array(__a[__i as usize..__j as usize].to_vec())", + "Value::Array(vec![])" + ); + return `(match (&(${name}), ${this.r30LooseI64(start)}.unwrap_or(0), ${this.r30LooseI64(end)}) { ${str}, ${arr}, _ => Value::Null })`; + } + r30IndexOf(name, needle) { + const eq = `match (__it, __nd) { (Value::Null, Value::Null) => true, (Value::Bool(__x), Value::Bool(__y)) => __x == __y, (Value::Str(__x), Value::Str(__y)) => __x == __y, (Value::Int(__x), Value::Int(__y)) => __x == __y, (Value::Float(__x), Value::Float(__y)) => __x == __y, (__p, __q) => match (${this.r25LooseF64("__p")}, ${this.r25LooseF64("__q")}) { (Some(__x), Some(__y)) => __x == __y, _ => false } }`; + return `(match (&(${name}), &(${needle})) { (Value::Arr(__a), __nd) => Value::Int(__a.iter().position(|__it| ${eq}).map(|__i| __i as i64).unwrap_or(-1)), (Value::Str(__s), Value::Str(__nd)) => Value::Int(__s.find(&**__nd).map(|__i| __i as i64).unwrap_or(-1)), _ => Value::Int(-1) })`; + } + r30Case(name, method) { + return `(match &(${name}) { Value::Str(__s) => Value::Str(__s.${method}().into()), _ => Value::Null })`; + } +}; +// node kinds the printer types that the core per-file prefetch leaves to single round trips +_RustTranspiler.RUST_PREFETCH_TYPE_KINDS = /* @__PURE__ */ new Set([ + _ast.SyntaxKind.FalseKeyword, + _ast.SyntaxKind.TrueKeyword, + _ast.SyntaxKind.ParenthesizedExpression, + _ast.SyntaxKind.AwaitExpression, + _ast.SyntaxKind.PrefixUnaryExpression, + _ast.SyntaxKind.BooleanKeyword, + _ast.SyntaxKind.ObjectKeyword, + _ast.SyntaxKind.UnionType, + _ast.SyntaxKind.ConditionalExpression, + _ast.SyntaxKind.AsExpression +]); +// ── native equality emission ──────────────────────────────────────────── +// When the checker proves both operands hold the same primitive payload +// (string / number / boolean, or one side is a matching literal) the +// unwrapped payloads are compared with `==`/`!=` instead of is_equal(). +// Operators whose printed form is a bare Rust `bool` (not a Value). _RustTranspiler.BOOL_PRODUCING_OPERATORS = /* @__PURE__ */ new Set([ _ast.SyntaxKind.EqualsEqualsToken, _ast.SyntaxKind.EqualsEqualsEqualsToken, @@ -24831,10 +28084,53 @@ _RustTranspiler.BOOL_VALUE_PREFIXES = [ "is_number", "is_string" ]; +// hx4 R01 — native element write on a local the plain-dict proof admits +// through its write history: `const x = this.account ()`, a `let x = {}` / +// `let x: Dict = undefined` later reassigned, `[ x, p ] = this.handleUntilOption (…)`. +/** Base-tier methods whose every return is a fresh tag-free object + * literal (no venue override, no hand-written stub replaces them). */ +_RustTranspiler.RUST_R01_PLAIN_DICT_BUILDERS = /* @__PURE__ */ new Set(["account", "safeLedgerEntry", "depositWithdrawFee"]); +/** Base-tier `[Dict, Dict]` tuple helpers that hand back their `request` argument (index 1). */ +_RustTranspiler.RUST_R01_REQUEST_TUPLE_HELPERS = /* @__PURE__ */ new Set(["handleUntilOption"]); +// hx4 R12 — plain-dict sources from base `safeDict*` reads of unshared dicts and same-file +// sync request builders; native truthiness / bool equality on operands proven `Value::Bool` +// or `Value::Null` at runtime (bool tuple elements, bool-returning exchange methods). +/** Base-tier bool readers whose Rust form returns `Value::Bool` or `Value::Null` + * (`safe_bool*` keep only `Value::Bool` or the default; the `check_option_bool` stub). */ +_RustTranspiler.RUST_R12_BOOL_READERS = { safeBool: 2, safeBool2: 3, safeBoolN: 2, checkOptionBool: -1 }; +_RustTranspiler.RUST_R12_DICT_READERS = { safeDict: 2, safeDict2: 3, safeDictN: 2 }; +/** A REST venue file (`ts/src/.ts`): no base / pro / prediction tier. */ +_RustTranspiler.RUST_R12_REST_FILE = /ts\/src\/[^/]+\.ts$/; +/** Base-tier array readers whose result is the stored `Value::Arr` or the default argument. */ +_RustTranspiler.RUST_R18_LIST_READERS = { safeList: 2, safeList2: 3, safeListN: 2 }; +_RustTranspiler.RUST_R21_PURE_STRING_METHODS = /* @__PURE__ */ new Set(["toUpperCase", "toLowerCase", "trim", "startsWith", "endsWith", "split"]); +// hx4 R26 — tuple slot 1 of the base `handle*AndParams` / `handleParam*` helpers is their +// params argument or an `omit` copy of it: plain when that argument is a plain source. +_RustTranspiler.R26_PARAMS_SLOT_ARG = { + handleOptionAndParams: 0, + handleOptionAndParams2: 0, + handleOptionStringAndParams: 0, + handleOptionStringAndParams2: 0, + handleOptionBoolAndParams: 0, + handleOptionBoolAndParams2: 0, + handleOptionIntegerAndParams: 0, + handleOptionIntegerAndParams2: 0, + handleParamString: 0, + handleParamString2: 0, + handleParamInteger: 0, + handleParamInteger2: 0, + handleParamBool: 0, + handleParamBool2: 0, + handleNetworkCodeAndParams: 0, + handleMarginModeAndParams: 1, + handleMarketTypeAndParams: 2, + handleSubTypeAndParams: 2, + handleMaxEntriesPerRequestAndParams: 2 +}; var RustTranspiler = _RustTranspiler; // src/cppTranspiler.ts -_chunk4FDYB2TTcjs.init_cjs_shims.call(void 0, ); +_chunkUBXMRIM6cjs.init_cjs_shims.call(void 0, ); var parserConfig7 = { @@ -24989,7 +28285,7 @@ var CppTranspiler = class extends BaseTranspiler { const constructorBody = this.printFunctionBody(node, identation); let superCallParams = ""; let hasSuperCall = false; - _optionalChain([node, 'access', _2235 => _2235.body, 'optionalAccess', _2236 => _2236.statements, 'access', _2237 => _2237.forEach, 'call', _2238 => _2238((statement) => { + _optionalChain([node, 'access', _2653 => _2653.body, 'optionalAccess', _2654 => _2654.statements, 'access', _2655 => _2655.forEach, 'call', _2656 => _2656((statement) => { if (_is.isExpressionStatement.call(void 0, statement)) { const expression = statement.expression; if (_is.isCallExpression.call(void 0, expression)) { @@ -25025,7 +28321,7 @@ var CppTranspiler = class extends BaseTranspiler { printReturnStatement(node, identation) { if (this.asyncTranspiling && !node.expression) { let fn = node.parent; - while (fn !== void 0 && !_chunk4FDYB2TTcjs.isFunctionLike.call(void 0, fn)) { + while (fn !== void 0 && !_chunkUBXMRIM6cjs.isFunctionLike.call(void 0, fn)) { fn = fn.parent; } if (fn !== void 0 && this.isAsyncFunction(fn)) { @@ -25150,7 +28446,7 @@ var CppTranspiler = class extends BaseTranspiler { } printVariableDeclarationList(node, identation) { const declaration = node.declarations[0]; - if (_optionalChain([declaration, 'optionalAccess', _2239 => _2239.name, 'access', _2240 => _2240.kind]) === _ast.SyntaxKind.ArrayBindingPattern) { + if (_optionalChain([declaration, 'optionalAccess', _2657 => _2657.name, 'access', _2658 => _2658.kind]) === _ast.SyntaxKind.ArrayBindingPattern) { const arrayBindingPattern = declaration.name; const arrayBindingPatternElements = arrayBindingPattern.elements; const parsedArrayBindingElements = arrayBindingPatternElements.map((e) => this.printNode(e.name, 0)); @@ -25403,14 +28699,14 @@ var CppTranspiler = class extends BaseTranspiler { } if (node.expression.kind === _ast.SyntaxKind.NewExpression) { const expression = node.expression; - const argumentsExp = _nullishCoalesce(_optionalChain([expression, 'optionalAccess', _2241 => _2241.arguments]), () => ( [])); + const argumentsExp = _nullishCoalesce(_optionalChain([expression, 'optionalAccess', _2659 => _2659.arguments]), () => ( [])); const parsedArg = _nullishCoalesce(argumentsExp.map((n) => this.printNode(n, 0)).join(", "), () => ( "")); const newExpression = this.printNode(expression.expression, 0); if (expression.expression.kind === _ast.SyntaxKind.Identifier) { const id = expression.expression; const symbol = this.getChecker().getSymbolAtLocation(expression.expression); if (symbol) { - const declarations = (_nullishCoalesce(_optionalChain([this, 'access', _2242 => _2242.getChecker, 'call', _2243 => _2243(), 'access', _2244 => _2244.getDeclaredTypeOfSymbol, 'call', _2245 => _2245(symbol), 'access', _2246 => _2246.getSymbol, 'call', _2247 => _2247(), 'optionalAccess', _2248 => _2248.declarations]), () => ( []))).map((d) => d.resolve()); + const declarations = (_nullishCoalesce(_optionalChain([this, 'access', _2660 => _2660.getChecker, 'call', _2661 => _2661(), 'access', _2662 => _2662.getDeclaredTypeOfSymbol, 'call', _2663 => _2663(symbol), 'access', _2664 => _2664.getSymbol, 'call', _2665 => _2665(), 'optionalAccess', _2666 => _2666.declarations]), () => ( []))).map((d) => d.resolve()); const isClassDeclaration5 = declarations.find((l) => l.kind === _ast.SyntaxKind.InterfaceDeclaration || l.kind === _ast.SyntaxKind.ClassDeclaration); if (isClassDeclaration5) { return this.getIden(identation) + `${this.THROW_TOKEN} ${id.text}(toString(${parsedArg}))${this.LINE_TERMINATOR}`; @@ -25525,7 +28821,7 @@ function memoizePairMethod(owner, name) { if (args.length !== 2 || a === null || typeof a !== "object" || b === null || typeof b !== "object") { return original.apply(owner, args); } - const cached = _optionalChain([cache, 'access', _2249 => _2249.get, 'call', _2250 => _2250(a), 'optionalAccess', _2251 => _2251.get, 'call', _2252 => _2252(b)]); + const cached = _optionalChain([cache, 'access', _2667 => _2667.get, 'call', _2668 => _2668(a), 'optionalAccess', _2669 => _2669.get, 'call', _2670 => _2670(b)]); if (cached !== void 0) { return cached === UNDEFINED_SENTINEL ? void 0 : cached; } @@ -25565,7 +28861,7 @@ function memoizeUnaryMethod(owner, name) { } function memoizeBinaryKindMethod(owner, name) { const unary = owner[name]; - const original = _nullishCoalesce(_optionalChain([unary, 'optionalAccess', _2253 => _2253.original]), () => ( unary)); + const original = _nullishCoalesce(_optionalChain([unary, 'optionalAccess', _2671 => _2671.original]), () => ( unary)); if (typeof original !== "function") { return; } @@ -25615,17 +28911,17 @@ function prefetchChecker(checker, root, options = {}) { const typeNodes = [], symbolNodes = [], callNodes = []; const visit = (node) => { const kind = node.kind; - if (wantTypes && PREFETCH_TYPE_KINDS.has(kind) && !_optionalChain([getType, 'access', _2254 => _2254.has, 'optionalCall', _2255 => _2255(node)])) + if (wantTypes && PREFETCH_TYPE_KINDS.has(kind) && !_optionalChain([getType, 'access', _2672 => _2672.has, 'optionalCall', _2673 => _2673(node)])) typeNodes.push(node); - if (wantSymbols && kind === _ast.SyntaxKind.Identifier && !_optionalChain([getSymbol, 'access', _2256 => _2256.has, 'optionalCall', _2257 => _2257(node)])) + if (wantSymbols && kind === _ast.SyntaxKind.Identifier && !_optionalChain([getSymbol, 'access', _2674 => _2674.has, 'optionalCall', _2675 => _2675(node)])) symbolNodes.push(node); - if (wantSignatures && kind === _ast.SyntaxKind.CallExpression && !_optionalChain([getSig, 'access', _2258 => _2258.has, 'optionalCall', _2259 => _2259(node)])) + if (wantSignatures && kind === _ast.SyntaxKind.CallExpression && !_optionalChain([getSig, 'access', _2676 => _2676.has, 'optionalCall', _2677 => _2677(node)])) callNodes.push(node); node.forEachChild(visit); }; visit(root); const run = (nodes, fn) => { - if (_optionalChain([fn, 'optionalAccess', _2260 => _2260.seed]) === void 0 || fn.original === void 0) + if (_optionalChain([fn, 'optionalAccess', _2678 => _2678.seed]) === void 0 || fn.original === void 0) return; for (let i = 0; i < nodes.length; i += PREFETCH_BATCH) { const chunk = nodes.slice(i, i + PREFETCH_BATCH); @@ -25641,7 +28937,7 @@ function prefetchChecker(checker, root, options = {}) { run(typeNodes, getType); run(symbolNodes, getSymbol); const api = checker.__astTranspilerApi; - if (callNodes.length > 0 && _optionalChain([getSig, 'optionalAccess', _2261 => _2261.seed]) !== void 0 && api !== void 0 && _optionalChain([getSig, 'access', _2262 => _2262.original, 'optionalAccess', _2263 => _2263.gen]) !== void 0) { + if (callNodes.length > 0 && _optionalChain([getSig, 'optionalAccess', _2679 => _2679.seed]) !== void 0 && api !== void 0 && _optionalChain([getSig, 'access', _2680 => _2680.original, 'optionalAccess', _2681 => _2681.gen]) !== void 0) { for (let i = 0; i < callNodes.length; i += PREFETCH_BATCH) { const chunk = callNodes.slice(i, i + PREFETCH_BATCH); const gens = chunk.map((n) => { @@ -25668,7 +28964,7 @@ function prefetchChecker(checker, root, options = {}) { function prefetchDeclarationSignatures(checker, api, root) { const getSigDecl = checker.getSignatureFromDeclaration; const getTypeOfSymbolAtLocation = checker.getTypeOfSymbolAtLocation; - if (_optionalChain([getSigDecl, 'optionalAccess', _2264 => _2264.seed]) === void 0 || _optionalChain([getSigDecl, 'access', _2265 => _2265.original, 'optionalAccess', _2266 => _2266.gen]) === void 0) + if (_optionalChain([getSigDecl, 'optionalAccess', _2682 => _2682.seed]) === void 0 || _optionalChain([getSigDecl, 'access', _2683 => _2683.original, 'optionalAccess', _2684 => _2684.gen]) === void 0) return; const decls = []; const visit = (node) => { @@ -25694,9 +28990,9 @@ function prefetchDeclarationSignatures(checker, api, root) { }()))); api.batch(...chunk.map((decl) => safe(function* () { const type = checker.getTypeAtLocation(decl); - const symbol = _optionalChain([type, 'optionalAccess', _2267 => _2267.getSymbol, 'optionalAccess', _2268 => _2268.gen]) !== void 0 ? yield* type.getSymbol.gen() : void 0; - const location = _optionalChain([symbol, 'optionalAccess', _2269 => _2269.valueDeclaration, 'optionalAccess', _2270 => _2270.resolve, 'call', _2271 => _2271()]); - if (location === void 0 || _optionalChain([getTypeOfSymbolAtLocation, 'optionalAccess', _2272 => _2272.seed2]) === void 0) + const symbol = _optionalChain([type, 'optionalAccess', _2685 => _2685.getSymbol, 'optionalAccess', _2686 => _2686.gen]) !== void 0 ? yield* type.getSymbol.gen() : void 0; + const location = _optionalChain([symbol, 'optionalAccess', _2687 => _2687.valueDeclaration, 'optionalAccess', _2688 => _2688.resolve, 'call', _2689 => _2689()]); + if (location === void 0 || _optionalChain([getTypeOfSymbolAtLocation, 'optionalAccess', _2690 => _2690.seed2]) === void 0) return; const symbolType = yield* getTypeOfSymbolAtLocation.original.gen(symbol, location); getTypeOfSymbolAtLocation.seed2(symbol, location, symbolType); @@ -25788,7 +29084,7 @@ var Transpiler = class _Transpiler { const src = _nullishCoalesce(program.getSourceFile(fileName), () => ( program.getSourceFile(path2.resolve(fileName)))); const previous = this.snapshot; this.snapshot = snapshot; - _optionalChain([previous, 'optionalAccess', _2273 => _2273.dispose, 'call', _2274 => _2274()]); + _optionalChain([previous, 'optionalAccess', _2691 => _2691.dispose, 'call', _2692 => _2692()]); return this.setContext({ src, checker, program }); } createProgramInMemoryAndSetContext(content) { @@ -25812,7 +29108,7 @@ var Transpiler = class _Transpiler { // long as the file's text on disk still equals the snapshot's. Replaces any // previous shared program; pass [] to drop it. setSharedProgram(paths) { - _optionalChain([this, 'access', _2275 => _2275.programCache, 'access', _2276 => _2276.shared, 'optionalAccess', _2277 => _2277.snapshot, 'access', _2278 => _2278.dispose, 'call', _2279 => _2279()]); + _optionalChain([this, 'access', _2693 => _2693.programCache, 'access', _2694 => _2694.shared, 'optionalAccess', _2695 => _2695.snapshot, 'access', _2696 => _2696.dispose, 'call', _2697 => _2697()]); this.programCache.shared = void 0; if (paths.length === 0) { return; diff --git a/dist/transpiler.cjs.map b/dist/transpiler.cjs.map index 273e4180..9b24766a 100644 --- a/dist/transpiler.cjs.map +++ b/dist/transpiler.cjs.map @@ -1 +1 @@ -{"version":3,"sources":["../src/dirname.cjs","../src/transpiler.ts","../src/pythonTranspiler.ts","../src/baseTranspiler.ts","../src/types.ts","../src/utils.ts","../src/logger.ts","../src/phpTranspiler.ts","../src/csharpTranspiler.ts","../src/goTranspiler.ts","../src/javaTranspiler.ts","../src/rustTranspiler.ts","../src/cppTranspiler.ts"],"names":["SyntaxKind","API","ElementFlags","IndexKind","ObjectFlags","SignatureKind","SymbolFlags","TypeFlags","defaultValue","type","node","namedExports","isArrowFunction","isCallExpression","isFunctionDeclaration","isFunctionExpression","parserConfig","isArrayLiteralExpression","isBinaryExpression","isBooleanLiteral","isClassDeclaration","isMethodDeclaration","isNumericLiteral","isObjectLiteralExpression","isSourceFile","isStringLiteralLikeNode","symbol","named","isStringLiteral","path","fs","getLeadingCommentRanges","isBlock","isElementAccessExpression","isExpressionStatement","isIfStatement","isReturnStatement","isThrowStatement","name","rhs","native","level","isStatement","whenTrue","whenFalse","isAsExpression","isBreakStatement","isConditionalExpression","isContinueStatement","isIdentifier","isParameterDeclaration","isParenthesizedExpression","isPostfixUnaryExpression","isPrefixUnaryExpression","isPropertyAccessExpression","isSpreadAssignment","isSpreadElement","isTypeAssertion","isVariableDeclaration","target","isClassExpression","isDeleteExpression","isForInStatement","isForOfStatement","isNonNullExpression","isShorthandPropertyAssignment","accessor","args","text","value","currentPath"],"mappings":";;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AACA,WAAO,UAAU;AAAA;AAAA;;;ACDjB;AAEA,qBAAwB;AAFxB,SAAS,cAAc,cAAAA,mBAA8C;AACrE,SAAS,OAAAC,MAAK,YAAY,gBAAAC,eAAc,aAAAC,YAAW,eAAAC,cAAa,iBAAAC,gBAAe,eAAAC,cAAa,aAAAC,YAAW,uBAAwF;;;ACD/L;;;ACAA;AAAA,SAAS,YAAY,yBAAyB,gCAAyI;AACvL,SAAS,0BAA0B,iBAAiB,mBAAmB,oBAAoB,kBAAkB,kBAAkB,oBAAoB,yBAAyB,oBAAoB,qBAAqB,uBAAuB,sBAAsB,qBAAqB,qBAAqB,kBAAkB,2BAA2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B,WAAO,KAAK;AAAA,EAChB;AAAA;AAAA;AAAA,EAIA,kBAAkB,UAAqC;AACnD,UAAM,MAAM,KAAK,QAAQ,cAAc,QAAQ,KAAK,KAAK,QAAQ,cAAmB,cAAQ,QAAQ,CAAC;AACrG,QAAI,QAAQ,QAAW;AACnB,YAAM,IAAI,MAAM,oBAAoB,QAAQ,uCAAuC;AAAA,IACvF;AACA,UAAM,UAAU,KAAK,WAAW,WAAW,EAAE,KAAK,SAAS,KAAK,SAAS,SAAS,KAAK,QAAQ,CAAC;AAChG,SAAK,WAAW,qBAAqB,OAAO;AAC5C,WAAO;AAAA,EACX;AAAA,EAEA,gBAAgB,MAAiB,UAAkB,OAAO,OAAwB;AAC9E,SAAK,kBAAkB,QAAQ;AAC/B,WAAO,KAAK,WAAW,UAAU,sBAAgC,UAAU,MAAM,KAAK;AAAA,EAC1F;AAAA,EAEA,sBAAsB,UAAmC;AACrD,WAAO,KAAK,gCAAkC,UAAU,CAAC,KAAK,WAAW,iBAAiB,gBAAgB;AAAA,EAC9G;AAAA,EAEA,mBAAmB,UAAmC;AAClD,WAAO,KAAK,6BAA+B,UAAU,CAAC,KAAK,WAAW,cAAc,gBAAgB;AAAA,EACxG;AAAA,EAEA,sBAAsB,UAAmC;AACrD,WAAO,KAAK,gCAAkC,QAAQ;AAAA,EAC1D;AAAA,EAEA,kBAAkB,UAAmC;AACjD,WAAO,KAAK,4BAA8B,QAAQ;AAAA,EACtD;AAAA,EAEA,oBAAoB,UAAmC;AACnD,WAAO,KAAK,8BAAgC,QAAQ;AAAA,EACxD;AAAA,EAEA,oBAAoB,UAAmC;AACnD,WAAO,KAAK,8BAAgC,QAAQ;AAAA,EACxD;AAAA,EAEA,mBAAmB,UAAmC;AAClD,WAAO,KAAK,6BAA+B,QAAQ;AAAA,EACvD;AACJ","sourcesContent":["// https://github.com/kulshekhar/ts-jest/issues/1174\nmodule.exports = __dirname;","import { ScriptTarget, SyntaxKind, type Node, type SourceFile } from \"typescript/unstable/ast\";\nimport { API, CheckFlags, ElementFlags, IndexKind, ObjectFlags, SignatureKind, SymbolFlags, TypeFlags, TypeFormatFlags, type Checker, type CompilerOptions, type Program, type Snapshot } from \"typescript/unstable/sync\";\nimport currentPath from \"./dirname.cjs\";\nimport { PythonTranspiler } from './pythonTranspiler.js';\nimport { PhpTranspiler } from './phpTranspiler.js';\nimport { CSharpTranspiler } from './csharpTranspiler.js';\nimport * as path from \"path\";\nimport * as fs from \"fs\";\nimport { Logger } from './logger.js';\nimport { Languages, TranspilationMode, IFileExport, IFileImport, ITranspiledFile, IInput, ITranspileContext, ITranspileProgramCache } from './types.js';\nimport { GoTranspiler, alignGoTrailingComments } from './goTranspiler.js';\nimport { JavaTranspiler } from './javaTranspiler.js';\nimport { RustTranspiler, RUST_DECLARED_DICT_LOCALS } from './rustTranspiler.js';\nimport type { RustDeclaredDictLocalEntry } from './rustTranspiler.js';\nimport { CppTranspiler } from './cppTranspiler.js';\n\nconst __dirname_mock = currentPath;\n\n// minimal type environment: skip the auto-included @types/* packages (with empty\n// options typescript scans node_modules/@types and pulls every package it finds —\n// 160+ extra files) and replace the default es5+dom lib (lib.dom.d.ts alone is ~8MB)\n// with the es-only lib chain. Neither dom nor @types globals affect transpilation\n// output, but they dominate program creation time (~10x) and make the type\n// environment depend on whatever @types happen to be installed in the host project.\nconst fastCompilerOptions: CompilerOptions = {\n target: ScriptTarget.Latest,\n lib: [\"lib.esnext.d.ts\"],\n types: [],\n};\n\n// the host globals (console, Buffer, setTimeout, ...) previously came from the\n// auto-included @types packages; declare them here so references to them neither\n// produce \"Cannot find name\" diagnostics nor trigger typescript's (very expensive)\n// spelling-suggestion scans while computing those diagnostics\nconst globalsShim = `\ndeclare var require: any;\ndeclare var module: any;\ndeclare var exports: any;\ndeclare var console: any;\ndeclare var process: any;\ndeclare var Buffer: any;\ndeclare var __dirname: string;\ndeclare var __filename: string;\ndeclare var setTimeout: any;\ndeclare var clearTimeout: any;\ndeclare var setInterval: any;\ndeclare var clearInterval: any;\ndeclare var setImmediate: any;\ndeclare var fetch: any;\ndeclare var URL: any;\ndeclare var URLSearchParams: any;\ndeclare var TextEncoder: any;\ndeclare var TextDecoder: any;\ndeclare var crypto: any;\ndeclare var performance: any;\ndeclare var AbortController: any;\ndeclare var WebSocket: any;\ndeclare var atob: any;\ndeclare var btoa: any;\n`;\nconst globalsShimPath = path.resolve(path.join(__dirname_mock, \"__globals-shim.d.ts\"));\n\n// transpiling one file to several languages queries the checker repeatedly for the\n// same nodes (identifiers, binary operands, conditions). Types and symbols are\n// deterministic per (checker, node), so memoize the two hot lookups on the checker\n// instance itself — the caches die with the checker when a new program is created\nconst UNDEFINED_SENTINEL = Symbol(\"undefined\");\n// unary checker queries keyed by a snapshot object (node / type / symbol / signature);\n// the API returns registry-interned objects, so object identity is a stable key\nconst MEMOIZED_UNARY_CHECKER_METHODS = [\n \"getTypeAtLocation\", \"getSymbolAtLocation\", \"getResolvedSignature\", \"getContextualType\",\n \"getSignaturesOfType\", \"getSymbolOfType\", \"getReturnTypeOfSignature\", \"getSignatureFromDeclaration\",\n \"isArrayType\", \"isArrayLikeType\", \"isTupleType\", \"getTypeArguments\", \"getTypeFromTypeNode\",\n \"getDeclaredTypeOfSymbol\", \"getTypeOfSymbol\", \"getAliasedSymbol\", \"getBaseTypeOfLiteralType\",\n \"getApparentType\", \"getPropertiesOfType\", \"getNonNullableType\", \"getIndexInfosOfType\",\n];\nfunction memoizeCheckerCalls(checker: Checker): void {\n if ((checker as any).__astTranspilerMemoized) {\n return;\n }\n (checker as any).__astTranspilerMemoized = true;\n for (const name of MEMOIZED_UNARY_CHECKER_METHODS) {\n memoizeUnaryMethod(checker, name);\n }\n // typeToString(type) with no extra args is the only form worth caching\n memoizeUnaryMethod(checker, \"typeToString\");\n // (type, kind) pairs: a WeakMap per kind\n memoizeBinaryKindMethod(checker, \"getSignaturesOfType\");\n memoizeBinaryKindMethod(checker, \"getIndexTypeOfType\");\n memoizeBinaryKindMethod(checker, \"getIndexInfoOfType\");\n memoizePairMethod(checker, \"getTypeOfSymbolAtLocation\");\n}\n\n// (object, object) pairs, e.g. getTypeOfSymbolAtLocation(symbol, node); seed2 fills it from a prefetch\nfunction memoizePairMethod(owner: object, name: string): void {\n const original = owner[name];\n if (typeof original !== \"function\") {\n return;\n }\n const cache = new WeakMap>();\n const seed2 = (a: object, b: object, value: unknown) => {\n let inner = cache.get(a);\n if (inner === undefined) {\n cache.set(a, inner = new WeakMap());\n }\n inner.set(b, value === undefined ? UNDEFINED_SENTINEL : value);\n };\n const wrapped = function (this: unknown, ...args: unknown[]) {\n const [a, b] = args;\n if (args.length !== 2 || a === null || typeof a !== \"object\" || b === null || typeof b !== \"object\") {\n return original.apply(owner, args);\n }\n const cached = cache.get(a as object)?.get(b as object);\n if (cached !== undefined) {\n return cached === UNDEFINED_SENTINEL ? undefined : cached;\n }\n const result = original.call(owner, a, b);\n seed2(a as object, b as object, result);\n return result;\n };\n (wrapped as any).gen = (original as any).gen;\n (wrapped as any).original = original;\n (wrapped as any).seed2 = seed2;\n Object.defineProperty(owner, name, { configurable: true, value: wrapped });\n}\n\n// the TS7 checker exposes its methods as prototype getters: shadow them on the instance.\n// Only single-object-argument calls are cached; anything else goes straight through.\nfunction memoizeUnaryMethod(owner: object, name: string): void {\n const original = owner[name];\n if (typeof original !== \"function\") {\n return;\n }\n const cache = new WeakMap();\n const wrapped = function (this: unknown, ...args: unknown[]) {\n const key = args[0];\n if (args.length !== 1 || key === null || typeof key !== \"object\" || Array.isArray(key)) {\n return original.apply(owner, args);\n }\n const cached = cache.get(key);\n if (cached !== undefined) {\n return cached === UNDEFINED_SENTINEL ? undefined : cached;\n }\n const result = original.call(owner, key);\n cache.set(key, result === undefined ? UNDEFINED_SENTINEL : result);\n return result;\n };\n (wrapped as any).gen = (original as any).gen;\n (wrapped as any).original = original;\n // prefetch support: seed(key, value) fills the cache; has(key) tells whether it is filled\n (wrapped as any).seed = (key: object, value: unknown) => cache.set(key, value === undefined ? UNDEFINED_SENTINEL : value);\n (wrapped as any).has = (key: object) => cache.has(key);\n Object.defineProperty(owner, name, { configurable: true, value: wrapped });\n}\n\nfunction memoizeBinaryKindMethod(owner: object, name: string): void {\n const unary = owner[name];\n const original = (unary as any)?.original ?? unary;\n if (typeof original !== \"function\") {\n return;\n }\n const caches = new Map>();\n const wrapped = function (this: unknown, ...args: unknown[]) {\n const key = args[0];\n if (args.length === 1) {\n return unary.call(owner, key);\n }\n if (args.length !== 2 || key === null || typeof key !== \"object\" || typeof args[1] !== \"number\") {\n return original.apply(owner, args);\n }\n let cache = caches.get(args[1]);\n if (cache === undefined) {\n caches.set(args[1], cache = new WeakMap());\n }\n const cached = cache.get(key);\n if (cached !== undefined) {\n return cached === UNDEFINED_SENTINEL ? undefined : cached;\n }\n const result = original.call(owner, key, args[1]);\n cache.set(key, result === undefined ? UNDEFINED_SENTINEL : result);\n return result;\n };\n (wrapped as any).gen = (original as any).gen;\n Object.defineProperty(owner, name, { configurable: true, value: wrapped });\n}\n\n// Batch pre-resolve: walk `root` once and resolve, in one round trip per method, the\n// types/symbols of the node kinds the printers ask about, seeding the memo caches above.\n// Results are identical to per-node calls; nodes the printers never ask about only cost payload.\nconst PREFETCH_TYPE_KINDS = new Set([\n SyntaxKind.Identifier, SyntaxKind.PropertyAccessExpression, SyntaxKind.ElementAccessExpression,\n SyntaxKind.CallExpression, SyntaxKind.BinaryExpression, SyntaxKind.StringLiteral, SyntaxKind.TypeReference,\n SyntaxKind.MethodDeclaration, SyntaxKind.AnyKeyword, SyntaxKind.StringKeyword, SyntaxKind.NumberKeyword,\n SyntaxKind.ArrayType, SyntaxKind.NumericLiteral,\n]);\nconst PREFETCH_BATCH = 4096;\nfunction prefetchChecker(checker: Checker, root: Node, options: { types?: boolean, symbols?: boolean, signatures?: boolean } = {}): void {\n const wantTypes = options.types ?? true, wantSymbols = options.symbols ?? true, wantSignatures = options.signatures ?? true;\n const getType = checker.getTypeAtLocation as any, getSymbol = checker.getSymbolAtLocation as any, getSig = checker.getResolvedSignature as any;\n const typeNodes: Node[] = [], symbolNodes: Node[] = [], callNodes: Node[] = [];\n const visit = (node: Node) => {\n const kind = node.kind;\n if (wantTypes && PREFETCH_TYPE_KINDS.has(kind) && !getType.has?.(node)) typeNodes.push(node);\n if (wantSymbols && kind === SyntaxKind.Identifier && !getSymbol.has?.(node)) symbolNodes.push(node);\n if (wantSignatures && kind === SyntaxKind.CallExpression && !getSig.has?.(node)) callNodes.push(node);\n node.forEachChild(visit);\n };\n visit(root);\n const run = (nodes: Node[], fn: any) => {\n if (fn?.seed === undefined || fn.original === undefined) return;\n for (let i = 0; i < nodes.length; i += PREFETCH_BATCH) {\n const chunk = nodes.slice(i, i + PREFETCH_BATCH);\n let results: unknown[];\n try {\n results = fn.original(chunk);\n } catch {\n continue; // leave this chunk to the lazy per-node path\n }\n chunk.forEach((n, j) => fn.seed(n, results[j]));\n }\n };\n run(typeNodes, getType);\n run(symbolNodes, getSymbol);\n // no bulk getResolvedSignature: pipeline the per-call requests through api.batch\n const api = (checker as any).__astTranspilerApi as API | undefined;\n if (callNodes.length > 0 && getSig?.seed !== undefined && api !== undefined && getSig.original?.gen !== undefined) {\n for (let i = 0; i < callNodes.length; i += PREFETCH_BATCH) {\n const chunk = callNodes.slice(i, i + PREFETCH_BATCH);\n const gens = chunk.map((n) => {\n const g = getSig.original.gen(n);\n // a call the checker cannot resolve must not fail the whole batch\n return (function* () { try { return yield* g; } catch { return PREFETCH_FAILED; } })();\n });\n const results = api.batch(...gens) as unknown[];\n chunk.forEach((n, j) => { if (results[j] !== PREFETCH_FAILED) getSig.seed(n, results[j]); });\n }\n }\n if (wantSignatures && api !== undefined) {\n prefetchDeclarationSignatures(checker, api, root);\n }\n}\n\n// Warm the per-declaration chains baseTranspiler walks for every method/function\n// (getFunctionType, getReturnTypeFromMethod) in one pipelined batch per level\nfunction prefetchDeclarationSignatures(checker: Checker, api: API, root: Node): void {\n const getSigDecl = checker.getSignatureFromDeclaration as any;\n const getTypeOfSymbolAtLocation = (checker as any).getTypeOfSymbolAtLocation;\n if (getSigDecl?.seed === undefined || getSigDecl.original?.gen === undefined) return;\n const decls: Node[] = [];\n const visit = (node: Node) => {\n if (node.kind === SyntaxKind.MethodDeclaration || node.kind === SyntaxKind.FunctionDeclaration) decls.push(node);\n node.forEachChild(visit);\n };\n visit(root);\n const safe = (g: Generator) => (function* () { try { return yield* g; } catch { return PREFETCH_FAILED; } })();\n for (let i = 0; i < decls.length; i += PREFETCH_BATCH) {\n const chunk = decls.slice(i, i + PREFETCH_BATCH);\n api.batch(...chunk.map((decl) => safe((function* () {\n const sig = getSigDecl.has(decl) ? getSigDecl(decl) : yield* getSigDecl.original.gen(decl);\n getSigDecl.seed(decl, sig);\n if (sig !== undefined) yield* sig.getReturnType.gen();\n })())));\n // getReturnTypeFromMethod: type -> symbol -> type of symbol at its declaration -> call signatures\n api.batch(...chunk.map((decl) => safe((function* () {\n const type = checker.getTypeAtLocation(decl) as any;\n const symbol = type?.getSymbol?.gen !== undefined ? yield* type.getSymbol.gen() : undefined;\n const location = symbol?.valueDeclaration?.resolve();\n if (location === undefined || getTypeOfSymbolAtLocation?.seed2 === undefined) return;\n const symbolType = yield* getTypeOfSymbolAtLocation.original.gen(symbol, location);\n getTypeOfSymbolAtLocation.seed2(symbol, location, symbolType);\n yield* symbolType.getCallSignatures.gen();\n })())));\n }\n}\nconst PREFETCH_FAILED = Symbol(\"prefetchFailed\");\nconst prefetchedFiles = new WeakSet();\n\n// program-wide diagnostics are identical for every file of a program: fetch them once\ntype ProgramWideDiagnostics = { program: readonly { text: string }[], global: readonly { text: string }[] };\nconst programDiagnosticsCache = new WeakMap();\nfunction getProgramWideDiagnostics(program: Program): ProgramWideDiagnostics {\n let diagnostics = programDiagnosticsCache.get(program);\n if (diagnostics === undefined) {\n diagnostics = { program: program.getProgramDiagnostics(), global: program.getGlobalDiagnostics() };\n programDiagnosticsCache.set(program, diagnostics);\n }\n return diagnostics;\n}\n\n// one TS7 API server per isolate unless a cache brings its own\nlet processApi: API | undefined;\nfunction getApi(cache: ITranspileProgramCache): API {\n cache.api ??= (processApi ??= new API({ cwd: process.cwd() }));\n return cache.api;\n}\n\n// a snapshot with one synthetic program over rootFiles; `files` overlays virtual file contents\nfunction createSnapshotProgram(cache: ITranspileProgramCache, rootFiles: string[], files: Record): [Snapshot, Program, Checker] {\n const snapshot = getApi(cache).createSnapshot({\n fileSystem: { kind: \"layer\", files },\n createPrograms: [{ rootFiles: rootFiles.map((f) => path.resolve(f)), compilerOptions: fastCompilerOptions }],\n });\n const program = snapshot.operation.createdPrograms[0];\n const checker = snapshot.getProjects().find((p) => p.program === program).checker;\n memoizeCheckerCalls(checker);\n (checker as any).__astTranspilerApi = getApi(cache);\n return [snapshot, program, checker];\n}\n\nexport default class Transpiler {\n config;\n pythonTranspiler: PythonTranspiler;\n phpTranspiler: PhpTranspiler;\n csharpTranspiler: CSharpTranspiler;\n goTranspiler: GoTranspiler;\n javaTranspiler: JavaTranspiler;\n rustTranspiler: RustTranspiler;\n cppTranspiler: CppTranspiler;\n // ByPath transpilation cache: parsed SourceFiles (libs + the whole import graph)\n // are reused across createProgram calls — without this every transpile*ByPath call\n // re-parses the full import closure of the target file (~1s+ per file on big repos).\n // Lives in a standalone object so several Transpiler instances on the same thread\n // can be pointed at one cache (see Transpiler.createProgramCache).\n private programCache: ITranspileProgramCache;\n // typescript state of the transpilation in flight, shared with the language printers\n private context: ITranspileContext | undefined;\n // the snapshot behind the current single-file context\n private snapshot: Snapshot | undefined;\n // batch pre-resolve each source file's checker queries before printing it (config.prefetch=false disables)\n prefetch: boolean;\n\n // batch pre-resolve for callers that query the checker themselves (build hooks):\n // one round trip per method for every relevant node under `root`\n static prefetchChecker(checker: Checker, root: Node, options?: { types?: boolean, symbols?: boolean, signatures?: boolean }): void {\n prefetchChecker(checker, root, options);\n }\n\n // A program cache holds parsed typescript SourceFiles and the last program built\n // from them. Hand the same cache to several Transpiler instances to reuse one\n // parse/typecheck of the es lib chain and of every shared import across all of\n // them. Callers that need isolation simply omit it and get a private cache.\n //\n // Same-thread only: these are live V8 objects, so a cache cannot be posted to a\n // worker_threads isolate — give each worker its own long-lived cache instead.\n static createProgramCache(): ITranspileProgramCache {\n return {};\n }\n\n constructor(config = {}, programCache?: ITranspileProgramCache) {\n this.config = config;\n this.programCache = programCache ?? Transpiler.createProgramCache();\n this.prefetch = config[\"prefetch\"] ?? true;\n const phpConfig = config[\"php\"] || {};\n const pythonConfig = config[\"python\"] || {};\n const csharpConfig = config[\"csharp\"] || {};\n const goConfig = config[\"go\"] || {};\n const javaConfig = config[\"java\"] || {};\n const rustConfig = config[\"rust\"] || {};\n const cppConfig = config[\"cpp\"] || {};\n\n if (\"verbose\" in config) {\n Logger.setVerboseMode(Boolean(config['verbose']));\n }\n\n this.pythonTranspiler = new PythonTranspiler(pythonConfig);\n this.phpTranspiler = new PhpTranspiler(phpConfig);\n this.csharpTranspiler = new CSharpTranspiler(csharpConfig);\n this.goTranspiler = new GoTranspiler(goConfig);\n this.javaTranspiler = new JavaTranspiler(javaConfig);\n this.rustTranspiler = new RustTranspiler(rustConfig);\n this.cppTranspiler = new CppTranspiler(cppConfig);\n }\n\n setVerboseMode(verbose: boolean) {\n Logger.setVerboseMode(verbose);\n }\n\n // the cache this instance parses into, to hand to further Transpiler instances\n // that should reuse this one's parsed SourceFiles\n getProgramCache(): ITranspileProgramCache {\n return this.programCache;\n }\n\n // a second Transpiler over the same parsed typescript state, with its own\n // printers and its own transpile context, so both can be driven independently\n // on this thread without either clobbering the other's program\n cloneSharingProgramCache(config = this.config): Transpiler {\n return new Transpiler(config, this.programCache);\n }\n\n // single-file snapshots are released when the next one replaces them; batches own theirs\n private setSnapshotContext(snapshot: Snapshot, program: Program, checker: Checker, fileName: string): ITranspileContext {\n const src = program.getSourceFile(fileName) ?? program.getSourceFile(path.resolve(fileName));\n const previous = this.snapshot;\n this.snapshot = snapshot;\n previous?.dispose();\n return this.setContext({ src, checker, program });\n }\n\n createProgramInMemoryAndSetContext(content): ITranspileContext {\n const inMemoryFilePath = path.resolve(path.join(__dirname_mock, \"__dummy-file.ts\"));\n const [snapshot, program, checker] = createSnapshotProgram(this.programCache, [inMemoryFilePath, globalsShimPath], {\n [inMemoryFilePath]: content,\n [globalsShimPath]: globalsShim,\n });\n return this.setSnapshotContext(snapshot, program, checker, inMemoryFilePath);\n }\n\n createProgramByPathAndSetContext(filePath): ITranspileContext {\n const shared = this.findSharedProgramFile(filePath);\n if (shared !== undefined) {\n return this.setContext(shared);\n }\n const [snapshot, program, checker] = createSnapshotProgram(this.programCache, [filePath, globalsShimPath], { [globalsShimPath]: globalsShim });\n return this.setSnapshotContext(snapshot, program, checker, filePath);\n }\n\n // One snapshot/program for a whole run: later ByPath transpiles of any root (or\n // imported file) of `paths` reuse it instead of building a program per file, as\n // long as the file's text on disk still equals the snapshot's. Replaces any\n // previous shared program; pass [] to drop it.\n setSharedProgram(paths: string[]): void {\n this.programCache.shared?.snapshot.dispose();\n this.programCache.shared = undefined;\n if (paths.length === 0) {\n return;\n }\n const [snapshot, program, checker] = createSnapshotProgram(this.programCache, [...paths, globalsShimPath], { [globalsShimPath]: globalsShim });\n this.programCache.shared = { snapshot, program, checker };\n }\n\n private findSharedProgramFile(filePath: string): ITranspileContext | undefined {\n const shared = this.programCache.shared;\n if (shared === undefined) {\n return undefined;\n }\n const src = shared.program.getSourceFile(path.resolve(filePath));\n if (src === undefined || !fs.existsSync(filePath) || fs.readFileSync(filePath, \"utf8\") !== src.text) {\n return undefined;\n }\n return { src, checker: shared.checker, program: shared.program };\n }\n\n // One program over N root files, so the bind/check work behind the diagnostics\n // pass is paid once for the whole set; files importing each other are fine as\n // separate roots. The batch owns its snapshot until dispose().\n createProgramBatch(paths: string[]): TranspileProgramBatch {\n const [snapshot, program, checker] = createSnapshotProgram(this.programCache, [...paths, globalsShimPath], { [globalsShimPath]: globalsShim });\n return new TranspileProgramBatch(this, snapshot, program, checker);\n }\n\n // the language printers read the typescript state (source file, checker, program)\n // off the context handed to them here, so two Transpiler instances never share\n // state and a nested transpile can restore whatever its caller was working on\n setContext(context: ITranspileContext): ITranspileContext {\n this.context = context;\n this.pythonTranspiler.setContext(context);\n this.phpTranspiler.setContext(context);\n this.csharpTranspiler.setContext(context);\n this.goTranspiler.setContext(context);\n this.javaTranspiler.setContext(context);\n this.rustTranspiler.setContext(context);\n this.cppTranspiler.setContext(context);\n return context;\n }\n\n /** @deprecated renamed to createProgramInMemoryAndSetContext */\n createProgramInMemoryAndSetGlobals(content): ITranspileContext {\n return this.createProgramInMemoryAndSetContext(content);\n }\n\n /** @deprecated renamed to createProgramByPathAndSetContext */\n createProgramByPathAndSetGlobals(path): ITranspileContext {\n return this.createProgramByPathAndSetContext(path);\n }\n\n checkFileDiagnostics(context: ITranspileContext = this.context) {\n // the pass only produces a Logger warning; on TS7 getGlobalDiagnostics forces a\n // whole-program check in tsgo, so skip it when nothing would be printed\n if (!Logger.verbose) {\n return;\n }\n const fileName = context.src.fileName;\n const programWide = getProgramWideDiagnostics(context.program);\n const diagnostics = [\n ...programWide.program,\n ...context.program.getSyntacticDiagnostics(fileName), ...programWide.global,\n ...context.program.getSemanticDiagnostics(fileName),\n ];\n if (diagnostics.length > 0) {\n let errorMessage = \"Errors found in the typescript code. Transpilation might produce invalid results:\\n\";\n diagnostics.forEach( msg => {\n errorMessage+= \" - \" + msg.text + \"\\n\";\n });\n Logger.warning(errorMessage);\n }\n }\n\n transpile(lang: Languages, mode: TranspilationMode, file: string, sync = false, createContext = true, handleImports = true): ITranspiledFile {\n // improve this logic later\n if (createContext) {\n if (mode === TranspilationMode.ByPath) {\n this.createProgramByPathAndSetContext(file);\n } else {\n this.createProgramInMemoryAndSetContext(file);\n }\n\n // check for warnings and errors\n this.checkFileDiagnostics();\n }\n\n const src = this.context.src;\n if (this.prefetch && !prefetchedFiles.has(src)) {\n prefetchedFiles.add(src);\n prefetchChecker(this.context.checker, src);\n }\n\n let transpiledContent = undefined;\n switch(lang) {\n case Languages.Python:\n this.pythonTranspiler.asyncTranspiling = !sync;\n transpiledContent = this.pythonTranspiler.printNode(src, -1);\n this.pythonTranspiler.asyncTranspiling = true; // reset to default\n break;\n case Languages.Php:\n this.phpTranspiler.asyncTranspiling = !sync;\n transpiledContent = this.phpTranspiler.printNode(src, -1);\n this.phpTranspiler.asyncTranspiling = true; // reset to default\n break;\n case Languages.CSharp:\n transpiledContent = this.csharpTranspiler.printNode(src, -1);\n break;\n case Languages.Go:\n // gofmt aligns trailing `//` comments through its tabwriter; the printer has to do\n // that itself so the emitted Go is already gofmt-clean (see alignGoTrailingComments)\n transpiledContent = alignGoTrailingComments (this.goTranspiler.printNode(src, -1));\n break;\n case Languages.Java:\n transpiledContent = this.javaTranspiler.printNode(src, -1);\n break;\n case Languages.Rust:\n transpiledContent = this.rustTranspiler.printNode(src, -1);\n break;\n case Languages.Cpp:\n transpiledContent = this.cppTranspiler.printNode(src, -1);\n break;\n }\n let imports = [];\n let exports = [];\n\n if (handleImports) {\n imports = this.pythonTranspiler.getFileImports(src);\n exports = this.pythonTranspiler.getFileExports(src);\n }\n\n const methodsTypes = this.pythonTranspiler.getMethodTypes(src);\n Logger.success(\"transpilation finished successfully\");\n\n return {\n content: transpiledContent,\n imports,\n exports,\n methodsTypes\n };\n }\n\n transpileDifferentLanguagesGeneric(mode: TranspilationMode, input: IInput[], content: string): ITranspiledFile[] {\n let context: ITranspileContext;\n if (mode === TranspilationMode.ByPath) {\n context = this.createProgramByPathAndSetContext(content);\n } else {\n context = this.createProgramInMemoryAndSetContext(content);\n }\n\n // check for warnings and errors\n this.checkFileDiagnostics(context);\n\n const files = [];\n input.forEach( (inp) => {\n const async = inp.async;\n\n files.push({\n content: this.transpile(inp.language, mode, content, !async, false, false).content\n });\n });\n\n const methodsTypes = this.pythonTranspiler.getMethodTypes(context.src);\n\n const imports = this.pythonTranspiler.getFileImports(context.src);\n const exports = this.pythonTranspiler.getFileExports(context.src);\n\n const output = files.map( (file) => {\n return {\n content: file.content,\n imports,\n exports,\n methodsTypes\n };\n });\n\n return output;\n }\n\n transpileDifferentLanguages(input: any[], content: string): ITranspiledFile[] {\n const config = input.map( (inp) => {\n return {\n language: this.convertStringToLanguageEnum(inp.language),\n async: inp.async\n };\n } );\n return this.transpileDifferentLanguagesGeneric(TranspilationMode.ByContent, config, content);\n }\n\n transpileDifferentLanguagesByPath(input: any[], content: string): ITranspiledFile[] {\n const config = input.map( (inp) => {\n return {\n language: this.convertStringToLanguageEnum(inp.language),\n async: inp.async\n };\n } );\n return this.transpileDifferentLanguagesGeneric(TranspilationMode.ByPath, config, content);\n }\n\n transpilePython(content): ITranspiledFile {\n return this.transpile(Languages.Python, TranspilationMode.ByContent, content, !this.pythonTranspiler.asyncTranspiling);\n }\n\n transpilePythonByPath(path): ITranspiledFile {\n return this.transpile(Languages.Python, TranspilationMode.ByPath, path, !this.pythonTranspiler.asyncTranspiling);\n }\n\n transpilePhp(content): ITranspiledFile {\n return this.transpile(Languages.Php, TranspilationMode.ByContent, content, !this.phpTranspiler.asyncTranspiling);\n }\n\n transpilePhpByPath(path): ITranspiledFile {\n return this.transpile(Languages.Php, TranspilationMode.ByPath, path, !this.phpTranspiler.asyncTranspiling);\n }\n\n transpileCSharp(content): ITranspiledFile {\n return this.transpile(Languages.CSharp, TranspilationMode.ByContent, content);\n }\n\n transpileCSharpByPath(path): ITranspiledFile {\n return this.transpile(Languages.CSharp, TranspilationMode.ByPath, path);\n }\n\n transpileJava(content): ITranspiledFile {\n return this.transpile(Languages.Java, TranspilationMode.ByContent, content);\n }\n\n transpileJavaByPath(path): ITranspiledFile {\n return this.transpile(Languages.Java, TranspilationMode.ByPath, path);\n }\n\n transpileGoByPath(path): ITranspiledFile {\n return this.transpile(Languages.Go, TranspilationMode.ByPath, path);\n }\n\n transpileGo(content): ITranspiledFile {\n return this.transpile(Languages.Go, TranspilationMode.ByContent, content);\n }\n\n transpileRust(content): ITranspiledFile {\n return this.transpile(Languages.Rust, TranspilationMode.ByContent, content);\n }\n\n transpileRustByPath(path): ITranspiledFile {\n return this.transpile(Languages.Rust, TranspilationMode.ByPath, path);\n }\n\n transpileCpp(content): ITranspiledFile {\n return this.transpile(Languages.Cpp, TranspilationMode.ByContent, content);\n }\n\n transpileCppByPath(path): ITranspiledFile {\n return this.transpile(Languages.Cpp, TranspilationMode.ByPath, path);\n }\n\n\n getFileImports(content: string): IFileImport[] {\n const context = this.createProgramInMemoryAndSetContext(content);\n return this.phpTranspiler.getFileImports(context.src);\n }\n\n getFileExports(content: string): IFileExport[] {\n const context = this.createProgramInMemoryAndSetContext(content);\n return this.phpTranspiler.getFileExports(context.src);\n }\n\n setPHPPropResolution(props: string[]) {\n this.phpTranspiler.propRequiresScopeResolutionOperator = props;\n }\n\n setPhpUncamelCaseIdentifiers(uncamelCase: boolean) {\n this.phpTranspiler.uncamelcaseIdentifiers = uncamelCase;\n }\n\n setPythonUncamelCaseIdentifiers(uncamelCase: boolean) {\n this.pythonTranspiler.uncamelcaseIdentifiers = uncamelCase;\n }\n\n setPhpAsyncTranspiling(async: boolean) {\n this.phpTranspiler.asyncTranspiling = async;\n }\n\n setPythonAsyncTranspiling(async: boolean) {\n this.pythonTranspiler.asyncTranspiling = async;\n }\n\n setPythonStringLiteralReplacements(replacements): void {\n this.pythonTranspiler.StringLiteralReplacements = replacements;\n }\n\n convertStringToLanguageEnum(lang: string): Languages {\n switch(lang) {\n case \"python\":\n return Languages.Python;\n case \"php\":\n return Languages.Php;\n case \"csharp\":\n return Languages.CSharp;\n case \"go\":\n return Languages.Go;\n case \"java\":\n return Languages.Java;\n case \"rust\":\n return Languages.Rust;\n case \"cpp\":\n return Languages.Cpp;\n }\n }\n}\n\n// A set of root files compiled as one typescript program, transpiled one at a time.\n// Obtained from Transpiler.createProgramBatch; mirrors the transpile*ByPath methods\n// of the Transpiler it came from, so a caller batches by replacing\n// for (const f of files) transpiler.transpileGoByPath(f)\n// with\n// const batch = transpiler.createProgramBatch(files);\n// for (const f of files) batch.transpileGoByPath(f)\n//\n// A failing file throws out of its own call and leaves the batch usable: the context\n// is rebuilt from the program on every call, so the caller can try/catch per file and\n// keep going. The batch borrows the Transpiler's printers and context, so do not\n// drive that Transpiler through another path while a batch loop is in flight — use\n// cloneSharingProgramCache() for a second, independent driver.\nclass TranspileProgramBatch {\n private readonly transpiler: Transpiler;\n private readonly snapshot: Snapshot;\n private readonly program: Program;\n private readonly checker: Checker;\n\n constructor(transpiler: Transpiler, snapshot: Snapshot, program: Program, checker: Checker) {\n this.transpiler = transpiler;\n this.snapshot = snapshot;\n this.program = program;\n this.checker = checker;\n }\n\n // releases the batch's snapshot on the TS7 server; the batch is unusable afterwards\n dispose(): void {\n this.snapshot.dispose();\n }\n\n getProgram(): Program {\n return this.program;\n }\n\n // point the owning Transpiler at one file of this batch, then run the same\n // diagnostics pass the single-file path runs\n setContextForPath(filePath: string): ITranspileContext {\n const src = this.program.getSourceFile(filePath) ?? this.program.getSourceFile(path.resolve(filePath));\n if (src === undefined) {\n throw new Error(`ast-transpiler: \"${filePath}\" is not a file of this program batch`);\n }\n const context = this.transpiler.setContext({ src, checker: this.checker, program: this.program });\n this.transpiler.checkFileDiagnostics(context);\n return context;\n }\n\n transpileByPath(lang: Languages, filePath: string, sync = false): ITranspiledFile {\n this.setContextForPath(filePath);\n return this.transpiler.transpile(lang, TranspilationMode.ByPath, filePath, sync, false);\n }\n\n transpilePythonByPath(filePath: string): ITranspiledFile {\n return this.transpileByPath(Languages.Python, filePath, !this.transpiler.pythonTranspiler.asyncTranspiling);\n }\n\n transpilePhpByPath(filePath: string): ITranspiledFile {\n return this.transpileByPath(Languages.Php, filePath, !this.transpiler.phpTranspiler.asyncTranspiling);\n }\n\n transpileCSharpByPath(filePath: string): ITranspiledFile {\n return this.transpileByPath(Languages.CSharp, filePath);\n }\n\n transpileGoByPath(filePath: string): ITranspiledFile {\n return this.transpileByPath(Languages.Go, filePath);\n }\n\n transpileJavaByPath(filePath: string): ITranspiledFile {\n return this.transpileByPath(Languages.Java, filePath);\n }\n\n transpileRustByPath(filePath: string): ITranspiledFile {\n return this.transpileByPath(Languages.Rust, filePath);\n }\n\n transpileCppByPath(filePath: string): ITranspiledFile {\n return this.transpileByPath(Languages.Cpp, filePath);\n }\n}\n\nexport {\n Transpiler,\n TranspileProgramBatch,\n // the TS7 flag enums of the typescript the generator runs on, for consumer hooks whose\n // own `typescript` resolution may be an older 7.x lacking them\n CheckFlags, ElementFlags, IndexKind, ObjectFlags, SignatureKind, SymbolFlags, TypeFlags, TypeFormatFlags,\n SyntaxKind,\n // the trailing-comment alignment pass, so a consumer that assembles its own Go files\n // (ccxt build/goTranspiler.ts) can run it on the assembled text as well\n alignGoTrailingComments,\n // the rust declared-Dict locals vocabulary + entry shape (rust-25), so the\n // helper-removal consumers can import them from the package entry\n RUST_DECLARED_DICT_LOCALS,\n};\nexport type { RustDeclaredDictLocalEntry };\n","import { BaseTranspiler } from \"./baseTranspiler.js\";\nimport { regexAll } from \"./utils.js\";\nimport { SyntaxKind } from \"typescript/unstable/ast\";\n\nconst parserConfig = {\n 'STATIC_TOKEN': '', // to do static decorator\n 'PUBLIC_KEYWORD': '',\n 'UNDEFINED_TOKEN': 'None',\n 'IF_TOKEN': 'if',\n 'ELSE_TOKEN': 'else',\n 'ELSEIF_TOKEN': 'elif',\n 'THIS_TOKEN': 'self',\n 'AMPERSTAND_APERSAND_TOKEN': 'and',\n 'BAR_BAR_TOKEN': 'or',\n 'SPACE_DEFAULT_PARAM': '',\n 'BLOCK_OPENING_TOKEN': ':',\n 'BLOCK_CLOSING_TOKEN': '',\n 'SPACE_BEFORE_BLOCK_OPENING': '',\n 'CONDITION_OPENING': '',\n 'CONDITION_CLOSE': '',\n 'TRUE_KEYWORD': 'True',\n 'FALSE_KEYWORD': 'False',\n 'THROW_TOKEN': 'raise',\n 'NOT_TOKEN': 'not ',\n 'PLUS_PLUS_TOKEN': ' += 1',\n 'MINUS_MINUS_TOKEN': ' -= 1',\n 'CONSTRUCTOR_TOKEN': 'def __init__',\n 'SUPER_CALL_TOKEN': 'super().__init__',\n 'PROPERTY_ASSIGNMENT_TOKEN': ':',\n 'FUNCTION_TOKEN': 'def',\n 'SUPER_TOKEN': 'super()',\n 'NEW_TOKEN': '',\n 'STRING_QUOTE_TOKEN': '\\'',\n 'LINE_TERMINATOR': '',\n 'METHOD_TOKEN': 'def',\n 'CATCH_TOKEN': 'except',\n 'CATCH_DECLARATION': 'Exception as',\n 'METHOD_DEFAULT_ACCESS': '',\n 'SPREAD_TOKEN': '*',\n 'NULL_TOKEN': 'None',\n};\nexport class PythonTranspiler extends BaseTranspiler {\n constructor(config = {}) {\n\n config['parser'] = Object.assign ({}, parserConfig, config['parser'] ?? {});\n\n super(config);\n this.id = \"python\";\n\n this.initConfig();\n this.asyncTranspiling = config['async'] ?? true;\n this.uncamelcaseIdentifiers = config['uncamelcaseIdentifiers'] ?? true;\n this.removeVariableDeclarationForFunctionExpression = config['removeVariableDeclarationForFunctionExpression'] ?? true;\n this.includeFunctionNameInFunctionExpressionDeclaration = config['includeFunctionNameInFunctionExpressionDeclaration'] ?? true;\n\n // user overrides\n this.applyUserOverrides(config);\n }\n\n initConfig() {\n this.LeftPropertyAccessReplacements = {\n 'this': 'self'\n };\n this.RightPropertyAccessReplacements = {\n 'push': 'append',\n 'toUpperCase': 'upper',\n 'toLowerCase': 'lower',\n // 'parseFloat': 'float',\n // 'parseInt': 'int',\n 'indexOf': 'find',\n 'padEnd': 'ljust',\n 'padStart': 'rjust'\n };\n this.FullPropertyAccessReplacements = {\n 'console.log': 'print',\n 'JSON.stringify': 'json.dumps',\n 'JSON.parse': 'json.loads',\n 'Math.log': 'math.log',\n 'Math.abs': 'abs',\n 'Math.min': 'min',\n 'Math.max': 'max',\n 'Math.ceil': 'math.ceil',\n 'Math.round': 'math.round',\n 'Math.floor': 'math.floor',\n 'Math.pow': 'math.pow',\n 'process.exit': 'sys.exit',\n 'Number.MAX_SAFE_INTEGER': 'float(\\'inf\\')',\n };\n this.CallExpressionReplacements = {\n 'parseInt': 'int',\n 'parseFloat': 'float',\n };\n\n this.PropertyAccessRequiresParenthesisRemoval = [\n // 'length',\n // 'toString',\n ];\n }\n\n printArrayIsArrayCall(node, identation, parsedArg = undefined) {\n return `isinstance(${parsedArg}, list)`;\n }\n\n printObjectKeysCall(node, identation, parsedArg = undefined) {\n return `list(${parsedArg}.keys())`;\n }\n\n printObjectValuesCall(node, identation, parsedArg = undefined) {\n return `list(${parsedArg}.values())`;\n }\n\n printPromiseAllCall(node, identation, parsedArg) {\n return `asyncio.gather(*${parsedArg})`;\n }\n\n printMathFloorCall(node, identation, parsedArg = undefined) {\n return `int(math.floor(${parsedArg}))`;\n }\n\n printMathCeilCall(node, identation, parsedArg = undefined) {\n return `int(math.ceil(${parsedArg}))`;\n }\n\n printNumberIsIntegerCall(node, identation , parsedArg = undefined) {\n return `isinstance(${parsedArg}, int)`;\n }\n\n printMathRoundCall(node, identation, parsedArg = undefined) {\n return `int(round(${parsedArg}))`;\n }\n\n printIncludesCall(node, identation, name?, parsedArg?) {\n return `${parsedArg} in ${name}`;\n }\n\n printJoinCall(node: any, identation: any, name?: any, parsedArg?: any) {\n return `${parsedArg}.join(${name})`;\n }\n\n printSplitCall(node: any, identation: any, name?: any, parsedArg?: any) {\n return `${name}.split(${parsedArg})`;\n }\n\n printConcatCall(node: any, identation: any, name?: any, parsedArg?: any) {\n return `${name} + ${parsedArg}`;\n }\n\n printPopCall(node: any, identation: any, name?: any) {\n return `${name}.pop()`;\n }\n\n printShiftCall(node: any, identation: any, name?: any) {\n return `${name}.pop(0)`;\n }\n\n printReverseCall(node, identation, name = undefined) {\n return `${name}.reverse()`;\n }\n\n printArrayPushCall(node, identation, name, parsedArg) {\n return `${name}.append(${parsedArg})`;\n }\n\n printToStringCall(node, identation, name = undefined) {\n return `str(${name})`;\n }\n\n printIndexOfCall(node, identation, name = undefined, parsedArg = undefined) {\n return `${name}.find(${parsedArg})`;\n }\n\n printSearchCall(node, identation, name = undefined, parsedArg = undefined) {\n return `${name}.find(${parsedArg})`;\n }\n\n printStartsWithCall(node, identation, name = undefined, parsedArg = undefined) {\n return `${name}.startswith(${parsedArg})`;\n }\n\n printEndsWithCall(node, identation, name = undefined, parsedArg = undefined) {\n return `${name}.endswith(${parsedArg})`;\n }\n\n printPadEndCall(node, identation, name, parsedArg, parsedArg2) {\n return `${name}.ljust(${parsedArg}, ${parsedArg2})`;\n }\n\n printPadStartCall(node, identation, name, parsedArg, parsedArg2) {\n return `${name}.rjust(${parsedArg}, ${parsedArg2})`;\n }\n\n printTrimCall(node, identation, name = undefined) {\n return `${name}.strip()`;\n }\n\n printToUpperCaseCall(node, identation, name = undefined) {\n return `${name}.upper()`;\n }\n\n printToLowerCaseCall(node, identation, name = undefined) {\n return `${name}.lower()`;\n }\n\n printJsonParseCall(node: any, identation: any, parsedArg?: any) {\n return `json.loads(${parsedArg})`;\n }\n\n printJsonStringifyCall(node: any, identation: any, parsedArg?: any) {\n return `json.dumps(${parsedArg})`;\n }\n\n printReplaceCall(node: any, identation: any, name?: any, parsedArg?: any, parsedArg2?: any) {\n return `${name}.replace(${parsedArg}, ${parsedArg2})`;\n }\n\n printReplaceAllCall(node: any, identation: any, name?: any, parsedArg?: any, parsedArg2?: any) {\n return `${name}.replace(${parsedArg}, ${parsedArg2})`;\n }\n\n printElementAccessExpressionExceptionIfAny(node) {\n if (node.expression.kind === SyntaxKind.ThisKeyword) {\n return \"getattr(self, \" + this.printNode(node.argumentExpression, 0) + \")\";\n }\n }\n\n printAssertCall(node, identation, parsedArgs) {\n return `assert ${parsedArgs}`;\n }\n\n printDateNowCall(node, identation) {\n return \"int(time.time() * 1000)\";\n }\n\n\n printForStatement(node, identation) {\n const varName = node.initializer.declarations[0].name.text;\n const initValue = this.printNode(node.initializer.declarations[0].initializer, 0);\n const roofValue = this.printNode(node.condition.right,0);\n\n const forStm = this.getIden(identation) + this.FOR_TOKEN + \" \" + varName + \" in range(\" + initValue + \", \" + roofValue + \"):\\n\" + node.statement.statements.map(st => this.printNode(st, identation+1)).join(\"\\n\");\n return this.printNodeCommentsIfAny(node, identation, forStm);\n }\n\n printPropertyAccessModifiers(node) {\n return \"\"; // no access modifier in python\n }\n\n transformLeadingComment(comment) {\n const commentRegex = [\n [ /(^|\\s)\\/\\//g, '$1#' ], // regular comments\n [ /\\/\\*\\*/, '\\\"\\\"\\\"' ], // eslint-disable-line\n [ / \\*\\//, '\\\"\\\"\\\"' ], // eslint-disable-line\n [ /\\[([^\\[\\]]*)\\]\\{@link (.*)\\}/g, '`$1 <$2>`' ], // eslint-disable-line\n [ /\\s+\\* @method/g, '' ], // docstring @method\n [ /(\\s+) \\* @description (.*)/g, '$1$2' ], // docstring description\n [ /\\s+\\* @name .*/g, '' ], // docstring @name\n [ /(\\s+) \\* @see( .*)/g, '$1see$2' ], // docstring @see\n [ /(\\s+ \\* @(param|returns) {[^}]*)string([^}]*}.*)/g, '$1str$3' ], // docstring type conversion\n [ /(\\s+ \\* @(param|returns) {[^}]*)object([^}]*}.*)/g, '$1dict$3' ], // doctstrubg type conversion\n [ /(\\s+) \\* @returns ([^\\{])/g, '$1:returns: $2' ], // eslint-disable-line\n [ /(\\s+) \\* @returns \\{(.+)\\}/g, '$1:returns $2:' ], // docstring return\n [ /(\\s+ \\* @param \\{[\\]\\[\\|a-zA-Z]+\\} )([a-zA-Z0-9_-]+)\\.([a-zA-Z0-9_-]+) (.*)/g, '$1$2[\\'$3\\'] $4' ], // eslint-disable-line\n [ /(\\s+) \\* @([a-z]+) \\{([\\]\\[a-zA-Z\\|]+)\\} ([a-zA-Z0-9_\\-\\.\\[\\]\\']+)/g, '$1:$2 $3 $4:' ], // eslint-disable-line\n ];\n\n const transformed = regexAll(comment, commentRegex);\n return transformed;\n }\n\n transformTrailingComment(comment) {\n const commentRegex = [\n [ /(^|\\s)\\/\\//g, '$1#' ], // regular comments\n ];\n\n const transformed = regexAll(comment, commentRegex);\n return \" \" + transformed;\n }\n\n transformPropertyAcessExpressionIfNeeded(node: any) {\n const expression = node.expression;\n const leftSide = this.printNode(expression, 0);\n const rightSide = node.name.text;\n\n let rawExpression = undefined;\n\n if (rightSide === \"length\") {\n rawExpression = \"len(\" + leftSide + \")\";\n } else if (rightSide === \"toString\") {\n rawExpression = \"str(\" + leftSide + \")\";\n }\n return rawExpression;\n }\n\n printClassDefinition(node: any, identation: any): string {\n const className = node.name.text;\n const heritageClauses = node.heritageClauses;\n\n let classInit = \"\";\n if (heritageClauses !== undefined) {\n const classExtends = heritageClauses[0].types[0].expression.text;\n classInit = this.getIden(identation) + \"class \" + className + \"(\" + classExtends + \"):\\n\";\n } else {\n classInit = this.getIden(identation) + \"class \" + className + \":\\n\";\n }\n return classInit;\n }\n\n isFunctionOutSideClass(node) {\n return !(node.parent && node.parent.kind === SyntaxKind.ClassDeclaration);\n }\n\n printMethodParameters(node) {\n let parsedArgs = super.printMethodParameters(node);\n const shouldAddSelf = !this.isFunctionOutSideClass(node);\n parsedArgs = shouldAddSelf ? (parsedArgs ? \"self, \" + parsedArgs : \"self\") : parsedArgs;\n return parsedArgs;\n }\n\n printInstanceOfExpression(node, identation) {\n const left = this.printNode(node.left, 0);\n const right = this.printNode(node.right, 0);\n return this.getIden(identation) + `isinstance(${left}, ${right})`;\n }\n\n handleTypeOfInsideBinaryExpression(node, identation) {\n const expression = node.left.expression;\n const right = node.right.text;\n\n const op = node.operatorToken.kind;\n const isDifferentOperator = op === SyntaxKind.ExclamationEqualsEqualsToken || op === SyntaxKind.ExclamationEqualsToken;\n const notOperator = isDifferentOperator ? this.NOT_TOKEN : \"\";\n\n switch (right) {\n case \"string\":\n return this.getIden(identation) + notOperator + \"isinstance(\" + this.printNode(expression, 0) + \", str)\";\n case \"number\":\n return this.getIden(identation) + notOperator + \"isinstance(\" + this.printNode(expression, 0) + \", numbers.Real)\";\n case \"boolean\":\n return this.getIden(identation) + notOperator + \"isinstance(\" + this.printNode(expression, 0) + \", bool)\";\n case \"object\":\n return this.getIden(identation) + notOperator + \"isinstance(\" + this.printNode(expression, 0) + \", dict)\";\n case \"undefined\":\n return this.getIden(identation) + this.printNode(expression, 0) + \" is \" + notOperator + \"None\";\n }\n\n return undefined;\n\n }\n\n printCustomBinaryExpressionIfAny(node, identation) {\n const left = node.left;\n const right = node.right.text;\n\n const op = node.operatorToken.kind;\n\n // Fix E712 comparison: if cond == True -> if cond:\n if ((op === SyntaxKind.EqualsEqualsToken || op === SyntaxKind.EqualsEqualsEqualsToken) && node.right.kind === SyntaxKind.TrueKeyword) {\n return this.getIden(identation) + this.printNode(node.left, 0);\n }\n\n if (left.kind === SyntaxKind.TypeOfExpression) {\n const typeOfExpression = this.handleTypeOfInsideBinaryExpression(node, identation);\n if (typeOfExpression) {\n return typeOfExpression;\n }\n }\n\n const prop = node?.left?.expression?.name?.text;\n\n if (prop) {\n const args = left.arguments;\n const parsedArg = (args && args.length > 0) ? this.printNode(args[0], 0): undefined;\n const leftSideOfIndexOf = left.expression.expression; // myString in myString.indexOf\n const leftSide = this.printNode(leftSideOfIndexOf, 0);\n // const rightType = this.getChecker().getTypeAtLocation(leftSideOfIndexOf); // type of myString in myString.indexOf (\"b\") >= 0;\n\n switch(prop) {\n case 'indexOf':\n if (op === SyntaxKind.GreaterThanEqualsToken && right === '0') {\n return this.getIden(identation) + `${parsedArg} in ${leftSide}`;\n }\n }\n }\n return undefined;\n }\n\n printConditionalExpression(node, identation) {\n const condition = this.printNode(node.condition, 0);\n const whenTrue = this.printNode(node.whenTrue, 0);\n const whenFalse = this.printNode(node.whenFalse, 0);\n\n return this.getIden(identation) + whenTrue + \" if \" + condition + \" else \" + whenFalse;\n }\n\n printDeleteExpression(node, identation) {\n const expression = this.printNode (node.expression);\n return `del ${expression}`;\n }\n\n getCustomOperatorIfAny(left, right, operator) {\n const rightText = right.getText();\n const isUndefined = rightText === \"undefined\";\n if (isUndefined) {\n switch (operator.kind) {\n case SyntaxKind.EqualsEqualsToken:\n return \"is\";\n case SyntaxKind.ExclamationEqualsToken:\n return \"is not\";\n case SyntaxKind.ExclamationEqualsEqualsToken:\n return \"is not\";\n case SyntaxKind.EqualsEqualsEqualsToken:\n return \"is\";\n }\n }\n }\n}\n","import { SyntaxKind, getLeadingCommentRanges, getTrailingCommentRanges, type BinaryExpression, type ClassDeclaration, type Node, type PropertyAccessExpression, type SourceFile } from \"typescript/unstable/ast\";\nimport { isArrayLiteralExpression, isArrowFunction, isAwaitExpression, isBinaryExpression, isBooleanLiteral, isCallExpression, isClassDeclaration, isConditionalExpression, isExportAssignment, isExportDeclaration, isFunctionDeclaration, isFunctionExpression, isImportDeclaration, isMethodDeclaration, isNumericLiteral, isObjectLiteralExpression, isSourceFile, isStringLiteralLikeNode, isVariableStatement } from \"typescript/unstable/ast/is\";\nimport { createAwaitExpression, createParenthesizedExpression, createReturnStatement } from \"typescript/unstable/ast/factory\";\nimport { SignatureKind, TypeFlags, type Checker, type Program } from \"typescript/unstable/sync\";\nimport { findAncestor, getAllSuperTypeNodes, isFunctionLike } from \"./tsUtils.js\";\nimport { IFileImport, IFileExport, TranspilationError, IMethodType, IParameterType, ITranspileContext } from './types.js';\nimport { unCamelCase } from \"./utils.js\";\nimport { Logger } from \"./logger.js\";\nimport { timingSafeEqual } from 'crypto';\n\nconst NO_CONTEXT_ERROR = \"No transpilation context set: the typescript program must be created before printing nodes.\";\n\nclass BaseTranspiler {\n\n NUM_LINES_BETWEEN_CLASS_MEMBERS = 1;\n LINES_BETWEEN_FILE_MEMBERS = 0;\n NUM_LINES_END_FILE = 1;\n SPACE_DEFAULT_PARAM = \" \";\n BLOCK_OPENING_TOKEN = '{';\n BLOCK_CLOSING_TOKEN = '}';\n SPACE_BEFORE_BLOCK_OPENING = ' ';\n CONDITION_OPENING = '(';\n CONDITION_CLOSE = ')';\n DEFAULT_IDENTATION = \" \";\n STRING_QUOTE_TOKEN = '\"';\n UNDEFINED_TOKEN = \"null\";\n NULL_TOKEN = \"null\";\n IF_TOKEN = \"if\";\n ELSE_TOKEN = \"else\";\n ELSEIF_TOKEN = \"else if\";\n THIS_TOKEN = \"this\";\n SLASH_TOKEN = \"/\";\n ASTERISK_TOKEN = \"*\";\n PLUS_TOKEN = \"+\";\n MINUS_TOKEN = \"-\";\n EQUALS_TOKEN = \"=\";\n EQUALS_EQUALS_TOKEN = \"==\";\n EXCLAMATION_EQUALS_TOKEN = \"!=\";\n EXCLAMATION_EQUALS_EQUALS_TOKEN = \"!=\";\n EQUALS_EQUALS_EQUALS_TOKEN = \"==\";\n AMPERSTAND_APERSAND_TOKEN = \"&&\";\n PLUS_EQUALS = \"+=\";\n BAR_BAR_TOKEN = \"||\";\n PERCENT_TOKEN = \"%\";\n RETURN_TOKEN = \"return\";\n OBJECT_OPENING = \"{\";\n OBJECT_CLOSING = \"}\";\n LEFT_PARENTHESIS = \"(\";\n RIGHT_PARENTHESIS = \")\";\n ARRAY_OPENING_TOKEN = \"[\";\n ARRAY_CLOSING_TOKEN = \"]\";\n TRUE_KEYWORD = \"true\";\n FALSE_KEYWORD = \"false\";\n NEW_CORRESPODENT = \"new\";\n THROW_TOKEN = \"throw\";\n AWAIT_TOKEN = \"await\";\n STATIC_TOKEN = \"static\";\n CONTINUE_TOKEN = \"continue\";\n EXTENDS_TOKEN = \":\";\n NOT_TOKEN = \"!\";\n SUPER_TOKEN = \"super\";\n PROPERTY_ACCESS_TOKEN = \".\";\n TRY_TOKEN = \"try\";\n CATCH_TOKEN = \"catch\";\n CATCH_DECLARATION = \"Exception\";\n BREAK_TOKEN = \"break\";\n IN_TOKEN = \"in\";\n LESS_THAN_TOKEN = \"<\";\n GREATER_THAN_TOKEN = \">\";\n GREATER_THAN_EQUALS_TOKEN = \">=\";\n LESS_THAN_EQUALS_TOKEN = \"<=\";\n PLUS_PLUS_TOKEN = \"++\";\n MINUS_MINUS_TOKEN = \"--\";\n CONSTRUCTOR_TOKEN = \"def __init__\";\n SUPER_CALL_TOKEN = \"super().__init__\";\n WHILE_TOKEN = \"while\";\n FOR_TOKEN = \"for\";\n VAR_TOKEN = \"\";\n\n METHOD_DEFAULT_ACCESS = \"public\";\n\n PROPERTY_ASSIGNMENT_TOKEN = \":\";\n PROPERTY_ASSIGNMENT_OPEN = \"\";\n PROPERTY_ASSIGNMENT_CLOSE = \"\";\n\n LINE_TERMINATOR = \";\";\n\n FUNCTION_TOKEN = \"function\";\n METHOD_TOKEN = \"function\";\n ASYNC_TOKEN = \"async\";\n PROMISE_TYPE_KEYWORD = \"Task\";\n\n NEW_TOKEN = \"new\";\n\n STRING_LITERAL_KEYWORD = \"StringLiteral\";\n STRING_KEYWORD = \"string\";\n NUMBER_KEYWORD = \"float\";\n\n PUBLIC_KEYWORD = \"public\";\n PRIVATE_KEYWORD = \"private\";\n VOID_KEYWORD = \"void\";\n BOOLEAN_KEYWORD = \"bool\";\n\n ARRAY_KEYWORD = \"List\";\n OBJECT_KEYWORD = \"Dictionary\";\n INTEGER_KEYWORD = \"int\";\n DEFAULT_RETURN_TYPE = \"object\";\n DEFAULT_PARAMETER_TYPE = \"object\";\n DEFAULT_TYPE = \"object\";\n\n FALSY_WRAPPER_OPEN = \"\";\n FALSY_WRAPPER_CLOSE = \"\";\n\n ELEMENT_ACCESS_WRAPPER_OPEN = \"\";\n ELEMENT_ACCESS_WRAPPER_CLOSE = \"\";\n\n COMPARISON_WRAPPER_OPEN = \"\";\n COMPARISON_WRAPPER_CLOSE = \"\";\n\n UKNOWN_PROP_WRAPPER_OPEN = \"\";\n UNKOWN_PROP_WRAPPER_CLOSE = \"\";\n\n UKNOWN_PROP_ASYNC_WRAPPER_OPEN = \"\";\n UNKOWN_PROP_ASYNC_WRAPPER_CLOSE = \"\";\n\n EQUALS_EQUALS_WRAPPER_OPEN = \"\";\n EQUALS_EQUALS_WRAPPER_CLOSE = \"\";\n\n DIFFERENT_WRAPPER_OPEN = \"\";\n DIFFERENT_WRAPPER_CLOSE = \"\";\n\n GREATER_THAN_WRAPPER_OPEN = \"\";\n GREATER_THAN_WRAPPER_CLOSE = \"\";\n\n LESS_THAN_WRAPPER_OPEN = \"\";\n LESS_THAN_WRAPPER_CLOSE = \"\";\n\n GREATER_THAN_EQUALS_WRAPPER_OPEN = \"\";\n GREATER_THAN_EQUALS_WRAPPER_CLOSE = \"\";\n\n LESS_THAN_EQUALS_WRAPPER_OPEN = \"\";\n LESS_THAN_EQUALS_WRAPPER_CLOSE = \"\";\n\n DIVIDE_WRAPPER_OPEN = \"\";\n DIVIDE_WRAPPER_CLOSE = \"\";\n\n PLUS_WRAPPER_OPEN = \"\";\n PLUS_WRAPPER_CLOSE = \"\";\n\n MINUS_WRAPPER_OPEN = \"\";\n MINUS_WRAPPER_CLOSE = \"\";\n\n MOD_WRAPPER_OPEN = \"\";\n MOD_WRAPPER_CLOSE = \"\";\n\n ARRAY_LENGTH_WRAPPER_OPEN = \"\";\n ARRAY_LENGTH_WRAPPER_CLOSE = \"\";\n\n MULTIPLY_WRAPPER_OPEN = \"\";\n MULTIPLY_WRAPPER_CLOSE = \"\";\n\n INDEXOF_WRAPPER_OPEN = \"\";\n INDEXOF_WRAPPER_CLOSE = \"\";\n\n PARSEINT_WRAPPER_OPEN = \"\";\n PARSEINT_WRAPPER_CLOSE = \"\";\n\n DYNAMIC_CALL_OPEN = \"\";\n\n SPREAD_TOKEN = \"...\";\n\n INFER_VAR_TYPE = false;\n INFER_ARG_TYPE = false;\n\n SupportedKindNames = {};\n PostFixOperators = {};\n PrefixFixOperators = {};\n FunctionDefSupportedKindNames = {};\n\n LeftPropertyAccessReplacements = {};\n RightPropertyAccessReplacements = {};\n FullPropertyAccessReplacements = {};\n StringLiteralReplacements = {};\n\n CallExpressionReplacements = {};\n ReservedKeywordsReplacements = {};\n ReassignedVars = {};\n PropertyAccessRequiresParenthesisRemoval = [];\n VariableTypeReplacements = {};\n ArgTypeReplacements = {};\n\n FuncModifiers = {};\n defaultPropertyAccess = 'public';\n\n currentClassName = \"\";\n className = \"undefined\";\n\n uncamelcaseIdentifiers;\n asyncTranspiling;\n implicitAsyncTranspiling;\n requiresReturnType;\n requiresParameterType;\n supportsFalsyOrTruthyValues;\n requiresCallExpressionCast;\n removeVariableDeclarationForFunctionExpression;\n includeFunctionNameInFunctionExpressionDeclaration;\n id;\n // typescript state for the transpilation currently in flight. Set by the owning\n // Transpiler before it walks the AST, so nothing leaks through process globals.\n context: ITranspileContext | undefined;\n\n constructor(config) {\n Object.assign (this, (config['parser'] || {}));\n this.id = \"base\";\n this.uncamelcaseIdentifiers = false;\n this.requiresReturnType = false;\n this.requiresParameterType = false;\n this.supportsFalsyOrTruthyValues = true;\n this.requiresCallExpressionCast = false;\n this.removeVariableDeclarationForFunctionExpression = true;\n this.includeFunctionNameInFunctionExpressionDeclaration = true;\n this.initOperators();\n }\n\n setContext(context: ITranspileContext | undefined): void {\n this.context = context;\n }\n\n getSrc(): SourceFile {\n if (this.context === undefined) throw new Error(NO_CONTEXT_ERROR);\n return this.context.src;\n }\n\n getChecker(): Checker {\n if (this.context === undefined) throw new Error(NO_CONTEXT_ERROR);\n return this.context.checker;\n }\n\n // the checker when a transpilation context is set, undefined otherwise (an in-memory\n // program without one keeps every helper the checker would have proven away)\n // true when some node under `scope` (excluding `scope` itself) satisfies `predicate`;\n // the walk stops at the first hit and does not descend below it\n hasNodeWhere(scope: Node | undefined, predicate: (n: any) => boolean): boolean {\n if (scope === undefined) {\n return false;\n }\n let found = false;\n const visit = (n: any) => {\n if (found) {\n return;\n }\n if (predicate(n)) {\n found = true;\n return;\n }\n n.forEachChild(visit);\n };\n scope.forEachChild(visit);\n return found;\n }\n\n checkerOrUndefined(): Checker | undefined {\n return this.context?.checker;\n }\n\n getProgram(): Program {\n if (this.context === undefined) throw new Error(NO_CONTEXT_ERROR);\n return this.context.program;\n }\n\n initOperators() {\n this.SupportedKindNames = {\n [SyntaxKind.StringLiteral]: this.STRING_LITERAL_KEYWORD,\n [SyntaxKind.StringKeyword]: this.STRING_KEYWORD,\n // [ts.SyntaxKind.NumberKeyword]: this.NUMBER_KEYWORD,\n [SyntaxKind.NumberKeyword]: this.DEFAULT_TYPE,\n [SyntaxKind.MinusMinusToken]: this.MINUS_MINUS_TOKEN,\n [SyntaxKind.MinusToken]: this.MINUS_TOKEN,\n [SyntaxKind.SlashToken]: this.SLASH_TOKEN,\n [SyntaxKind.AsteriskToken]: this.ASTERISK_TOKEN,\n [SyntaxKind.InKeyword]: this.IN_TOKEN,\n [SyntaxKind.PlusToken]: this.PLUS_TOKEN,\n [SyntaxKind.PercentToken]: this.PERCENT_TOKEN,\n [SyntaxKind.LessThanToken]: this.LESS_THAN_TOKEN,\n [SyntaxKind.LessThanEqualsToken]: this.LESS_THAN_EQUALS_TOKEN,\n [SyntaxKind.GreaterThanToken]: this.GREATER_THAN_TOKEN,\n [SyntaxKind.GreaterThanEqualsToken]: this.GREATER_THAN_EQUALS_TOKEN,\n [SyntaxKind.EqualsEqualsToken]: this.EQUALS_EQUALS_TOKEN,\n [SyntaxKind.EqualsEqualsEqualsToken]: this.EQUALS_EQUALS_EQUALS_TOKEN,\n [SyntaxKind.EqualsToken]: this.EQUALS_TOKEN,\n [SyntaxKind.PlusEqualsToken]: this.PLUS_EQUALS,\n [SyntaxKind.BarBarToken]: this.BAR_BAR_TOKEN,\n [SyntaxKind.AmpersandAmpersandToken]: this.AMPERSTAND_APERSAND_TOKEN,\n [SyntaxKind.ExclamationEqualsEqualsToken]: this.EXCLAMATION_EQUALS_EQUALS_TOKEN,\n [SyntaxKind.ExclamationEqualsToken]: this.EXCLAMATION_EQUALS_TOKEN,\n [SyntaxKind.AsyncKeyword]: this.ASYNC_TOKEN,\n [SyntaxKind.AwaitKeyword]: this.AWAIT_TOKEN,\n [SyntaxKind.StaticKeyword]: this.STATIC_TOKEN,\n [SyntaxKind.PublicKeyword]: this.PUBLIC_KEYWORD,\n [SyntaxKind.PrivateKeyword]: this.PRIVATE_KEYWORD,\n [SyntaxKind.VoidKeyword]: this.VOID_KEYWORD,\n [SyntaxKind.BooleanKeyword]: this.BOOLEAN_KEYWORD,\n };\n\n this.PostFixOperators = {\n [SyntaxKind.PlusPlusToken]: this.PLUS_PLUS_TOKEN,\n [SyntaxKind.MinusMinusToken]: this.MINUS_MINUS_TOKEN,\n };\n\n this.PrefixFixOperators = {\n [SyntaxKind.ExclamationToken]: this.NOT_TOKEN,\n [SyntaxKind.MinusToken]: this.MINUS_TOKEN,\n };\n\n this.FunctionDefSupportedKindNames = {\n [SyntaxKind.StringKeyword]: this.STRING_KEYWORD\n };\n\n this.FuncModifiers = {\n [SyntaxKind.AsyncKeyword]: this.ASYNC_TOKEN,\n [SyntaxKind.PublicKeyword]: this.PUBLIC_KEYWORD,\n [SyntaxKind.PrivateKeyword]: this.PRIVATE_KEYWORD,\n [SyntaxKind.StaticKeyword]: this.STATIC_TOKEN,\n };\n }\n\n capitalize(str: string) {\n return str[0].toUpperCase() + str.slice(1);\n }\n\n applyUserOverrides(config): void {\n this.LeftPropertyAccessReplacements = Object.assign ({}, this.LeftPropertyAccessReplacements, config['LeftPropertyAccessReplacements'] ?? {});\n this.RightPropertyAccessReplacements = Object.assign ({}, this.RightPropertyAccessReplacements, config['RightPropertyAccessReplacements'] ?? {});\n this.FullPropertyAccessReplacements = Object.assign ({}, this.FullPropertyAccessReplacements, config['FullPropertyAccessReplacements'] ?? {});\n this.CallExpressionReplacements = Object.assign ({}, this.CallExpressionReplacements, config['CallExpressionReplacements'] ?? {});\n this.StringLiteralReplacements = Object.assign ({}, this.StringLiteralReplacements, config['StringLiteralReplacements'] ?? {});\n }\n\n getLineAndCharacterOfNode(node): [number,number] {\n const { line, character } =\n this.getSrc().getLineAndCharacterOfPosition(node.getStart());\n return [line + 1,character];\n }\n\n isComment(line: string){\n line = line.trim();\n return line.startsWith(\"//\") || line.startsWith(\"/*\") || line.startsWith(\"*\");\n }\n\n isStringType(flags: TypeFlags) {\n return flags === TypeFlags.String || flags === TypeFlags.StringLiteral;\n }\n\n isAnyType(flags: TypeFlags) {\n return flags === TypeFlags.Any;\n }\n\n warnIfAnyType(node, flags, variable, target) {\n if (this.isAnyType(flags)) {\n const [line, character] = this.getLineAndCharacterOfNode(node);\n Logger.warning(`[${this.id}] Line: ${line} char: ${character}: ${variable} has any type, ${target} might be incorrectly transpiled`);\n }\n }\n\n warn(node, target, message) {\n const [line, character] = this.getLineAndCharacterOfNode(node);\n Logger.warning(`[${this.id}] Line: ${line} char: ${character}: ${target} : ${message}`);\n }\n\n hasAsyncModifier(node) {\n return (node.modifiers ?? []).some(mod => mod.kind === SyntaxKind.AsyncKeyword);\n }\n\n isPromiseType(type) {\n return type !== undefined && this.getTypeFromRawType(type) === this.PROMISE_TYPE_KEYWORD;\n }\n\n isImplicitAsyncFunction(node) {\n // a function declared WITHOUT the `async` keyword that returns a Promise\n // directly, ie: `watchTicker (symbol: string): Promise { return this.watch (...); }`\n // (a common fast-path in JS for pure delegator/pass-through methods);\n // target languages without that distinction transpile it as if it were `async`\n if (!this.implicitAsyncTranspiling || !isFunctionLike(node) || this.hasAsyncModifier(node)) {\n return false;\n }\n const signature = this.getChecker().getSignatureFromDeclaration(node);\n return signature !== undefined && this.isPromiseType(this.getChecker().getReturnTypeOfSignature(signature));\n }\n\n isAsyncFunction(node) {\n return this.hasAsyncModifier(node) || this.isImplicitAsyncFunction(node);\n }\n\n getMethodOverride(node: Node): Node {\n /////\n //// Warning: Only takes into consideration 1 level of heritage\n //// might be costly, try to improve its performance later\n ////\n // Check if the method is a member of a class\n if (node === undefined) {\n return undefined;\n }\n if (!isClassDeclaration(node.parent)) {\n return undefined;\n }\n\n // Get the class declaration\n const classDeclaration = node.parent as ClassDeclaration;\n\n // Check if the class has a base class\n if (!classDeclaration.heritageClauses) {\n return undefined;\n }\n\n let method = undefined;\n\n let parentClass = getAllSuperTypeNodes(node.parent)[0];\n\n while (parentClass !== undefined) {\n const parentClassType = this.getChecker().getTypeAtLocation(parentClass);\n const parentClassDecl = parentClassType?.getSymbol()?.valueDeclaration?.resolve();\n\n if (parentClassDecl === undefined) {\n this.warn(node, \"Parent class\", \"Parent class not found\");\n return undefined;\n }\n\n const parentClassMembers = (parentClassDecl as any).members ?? [];\n\n parentClassMembers.forEach(elem=> {\n if (isMethodDeclaration(elem)) {\n\n const name = elem.name.getText().trim();\n if ((node as any).name.text === name) {\n method = elem;\n }\n }\n });\n\n parentClass = getAllSuperTypeNodes(parentClassDecl)[0] ?? undefined;\n }\n\n\n\n // TODO: Check if the method has the same signature as a method in the base class\n return method;\n }\n\n getIden (num) {\n return this.DEFAULT_IDENTATION.repeat(parseInt(num));\n }\n\n getBlockOpen(identation){\n return this.SPACE_BEFORE_BLOCK_OPENING + this.BLOCK_OPENING_TOKEN + \"\\n\";\n }\n\n getBlockClose(identation, chainBlock = false) {\n\n if (chainBlock) {\n return this.BLOCK_CLOSING_TOKEN ? \"\\n\" + this.getIden(identation) + this.BLOCK_CLOSING_TOKEN + this.SPACE_BEFORE_BLOCK_OPENING : \"\\n\" + this.getIden(identation) + this.BLOCK_CLOSING_TOKEN;\n }\n\n return this.BLOCK_CLOSING_TOKEN ? \"\\n\" + this.getIden(identation) + this.BLOCK_CLOSING_TOKEN : \"\";\n }\n\n startsWithUpperCase(str) {\n return str.charAt(0) === str.charAt(0).toUpperCase();\n }\n\n unCamelCaseIfNeeded(name: string): string {\n\n if (this.uncamelcaseIdentifiers && !this.startsWithUpperCase(name) ) { // avoid snake_case constant (MY_CONSTANT) or exception errors (BadRequestException)\n return unCamelCase(name) ?? name;\n }\n return name;\n }\n\n transformIdentifier(node, identifier) {\n return this.unCamelCaseIfNeeded(identifier);\n }\n\n transformCallExpressionName(name: string, nameNode = undefined) {\n return name;\n }\n\n transformPropertyAccessExpressionName(name: string, nameNode = undefined) {\n return name;\n }\n\n printIdentifier(node) {\n let idValue = node.text ?? node.text;\n\n if (this.ReservedKeywordsReplacements[idValue]) {\n idValue = this.ReservedKeywordsReplacements[idValue];\n }\n\n if (idValue === \"undefined\") {\n return this.UNDEFINED_TOKEN;\n }\n return this.transformIdentifier(node, idValue); // check this later\n }\n\n shouldRemoveParenthesisFromCallExpression(node) {\n if (node.expression.kind === SyntaxKind.PropertyAccessExpression) {\n return this.PropertyAccessRequiresParenthesisRemoval.includes(node.expression.name.text);\n }\n return false;\n }\n\n printInstanceOfExpression(node, identation) {\n // const left = this.printNode(node.left, 0);\n // const right = this.printNode(node.right, 0);\n const left = node.left.text;\n const right = node.right.text;\n return this.getIden(identation) + `${left} instanceof ${right}`;\n }\n\n getCustomOperatorIfAny(left, right, operator) {\n return undefined;\n }\n\n printCustomBinaryExpressionIfAny(node, identation) {\n return undefined; // stub to override\n }\n\n printBinaryExpression(node, identation) {\n\n const {left, right, operatorToken} = node;\n\n const customBinaryExp = this.printCustomBinaryExpressionIfAny(node, identation);\n if (customBinaryExp) {\n return customBinaryExp;\n }\n\n if (operatorToken.kind == SyntaxKind.InstanceOfKeyword) {\n return this.printInstanceOfExpression(node, identation);\n }\n\n let operator = this.SupportedKindNames[operatorToken.kind];\n\n\n let leftVar = undefined;\n let rightVar = undefined;\n\n // c# wrapper\n if (operatorToken.kind === SyntaxKind.EqualsEqualsToken || operatorToken.kind === SyntaxKind.EqualsEqualsEqualsToken) {\n if (this.COMPARISON_WRAPPER_OPEN) {\n leftVar = this.printNode(left, 0);\n rightVar = this.printNode(right, identation);\n return `${this.COMPARISON_WRAPPER_OPEN}${leftVar}, ${rightVar}${this.COMPARISON_WRAPPER_CLOSE}`;\n }\n }\n let prefixes = \"\";\n // check if boolean operators || and && because of the falsy values\n if (operatorToken.kind === SyntaxKind.BarBarToken || operatorToken.kind === SyntaxKind.AmpersandAmpersandToken) {\n leftVar = this.printCondition(left, 0);\n rightVar = this.printCondition(right, identation);\n } else {\n leftVar = this.printNode(left, 0);\n\n\n // if (right.kind === ts.SyntaxKind.ObjectLiteralExpression) {\n prefixes = this.getBinaryExpressionPrefixes(node, identation) ?? \"\";\n // }\n\n rightVar = this.printNode(right, identation);\n }\n\n const customOperator = this.getCustomOperatorIfAny(left, right, operatorToken);\n\n operator = customOperator ? customOperator : operator;\n\n return prefixes + leftVar +\" \"+ operator + \" \" + rightVar.trim();\n }\n\n getBinaryExpressionPrefixes(node, identation) {\n return undefined;\n }\n\n transformPropertyAcessExpressionIfNeeded (node) {\n return undefined;\n }\n\n transformPropertyAcessRightIdentifierIfNeeded (name: string): string {\n return this.unCamelCaseIfNeeded(name);\n }\n\n getExceptionalAccessTokenIfAny(node) {\n return undefined; // stub to override\n }\n\n printLengthProperty(node, identation, name = undefined) {\n return undefined; // stub to override\n }\n\n printPropertyAccessExpression(node, identation) {\n\n const expression = node.expression;\n\n const transformedProperty = this.transformPropertyAcessExpressionIfNeeded(node);\n if (transformedProperty) {\n return this.getIden(identation) + transformedProperty;\n }\n\n let leftSide = node.expression.text;\n let rightSide = node.name.text;\n\n switch (rightSide) {\n case \"length\":\n return this.printLengthProperty(node, identation, leftSide);\n }\n\n let rawExpression = node.getText().trim();\n\n if (this.FullPropertyAccessReplacements.hasOwnProperty(rawExpression)){ // eslint-disable-line\n return this.FullPropertyAccessReplacements[rawExpression]; // eslint-disable-line\n }\n\n leftSide = this.LeftPropertyAccessReplacements.hasOwnProperty(leftSide) ? this.LeftPropertyAccessReplacements[leftSide] : this.printNode(expression, 0); // eslint-disable-line\n\n // checking \"toString\" insde the object will return the builtin toString method :X\n rightSide = this.RightPropertyAccessReplacements.hasOwnProperty(rightSide) ? // eslint-disable-line\n this.RightPropertyAccessReplacements[rightSide] :\n this.transformPropertyAcessRightIdentifierIfNeeded(rightSide) ?? rightSide;\n\n // join together the left and right side again\n const accessToken = this.getExceptionalAccessTokenIfAny(node) ?? this.PROPERTY_ACCESS_TOKEN;\n\n rawExpression = leftSide + accessToken + this.transformPropertyAccessExpressionName(rightSide, node.name);\n\n return rawExpression;\n }\n\n printCustomDefaultValueIfNeeded(node) {\n return undefined;\n }\n\n printParameteCustomName(node, name, defaultValue = true) {\n // useful for when we have to get the parent's method argument type\n const initializer = node.initializer;\n\n let type = this.printParameterType(node);\n type = type ? type + \" \" : \"\";\n\n if (defaultValue) {\n if (initializer) {\n const customDefaultValue = this.printCustomDefaultValueIfNeeded(initializer);\n const defaultValue = customDefaultValue ? customDefaultValue : this.printNode(initializer, 0);\n return type + name + this.SPACE_DEFAULT_PARAM + \"=\" + this.SPACE_DEFAULT_PARAM + defaultValue;\n }\n return type + name;\n }\n return name;\n }\n\n printParameter(node, defaultValue = true) {\n const name = this.printNode(node.name, 0);\n const initializer = node.initializer;\n\n let type = this.printParameterType(node);\n type = type ? type + \" \" : \"\";\n\n if (defaultValue) {\n if (initializer) {\n const customDefaultValue = this.printCustomDefaultValueIfNeeded(initializer);\n const defaultValue = customDefaultValue ? customDefaultValue : this.printNode(initializer, 0);\n if (type) {\n type = (defaultValue === \"null\" && type !== \"object\") ? type + \"? \": type + \" \";\n }\n return type + name + this.SPACE_DEFAULT_PARAM + \"=\" + this.SPACE_DEFAULT_PARAM + defaultValue;\n }\n if (type === \"\") {\n return name;\n }\n return type + \" \" + name;\n }\n return name;\n }\n\n printModifiers(node) {\n let modifiers = node.modifiers ?? [];\n modifiers = modifiers.filter(mod => this.FuncModifiers[mod.kind]);\n\n if (!this.asyncTranspiling) {\n modifiers = modifiers.filter(mod => mod.kind !== SyntaxKind.AsyncKeyword);\n }\n let res = modifiers.map(modifier => this.FuncModifiers[modifier.kind]).join(\" \");\n\n if (this.asyncTranspiling && this.ASYNC_TOKEN && this.isImplicitAsyncFunction(node)) {\n // non-async functions returning a Promise directly are transpiled\n // as if they had been declared `async`\n res = res ? res + \" \" + this.ASYNC_TOKEN : this.ASYNC_TOKEN;\n }\n\n return res;\n }\n\n transformLeadingComment(comment) {\n return comment; // to override\n }\n\n transformTrailingComment(comment) {\n return comment; // to override\n }\n\n printLeadingComments(node, identation) {\n const fullText = this.getSrc().getFullText();\n const commentsRangeList = getLeadingCommentRanges(fullText, node.pos);\n const commentsRange = commentsRangeList ? commentsRangeList : undefined;\n let res = \"\";\n if (commentsRange) {\n for (const commentRange of commentsRange) {\n const commentText = fullText.slice(commentRange.pos, commentRange.end);\n if (commentText !== undefined) {\n const formatted = commentText\n .split(\"\\n\")\n .map(line=>line.trim())\n .map(line => !(line.trim().startsWith(\"*\")) ? this.getIden(identation) + line : this.getIden(identation) + \" \" + line) .join(\"\\n\");\n res+= this.transformLeadingComment(formatted) + \"\\n\";\n }\n }\n }\n return res;\n }\n\n printTraillingComment(node, identation) {\n const fullText = this.getSrc().getFullText();\n const commentsRangeList = getTrailingCommentRanges(fullText, node.end);\n const commentsRange = commentsRangeList ? commentsRangeList : undefined;\n let res = \"\";\n if (commentsRange) {\n for (const commentRange of commentsRange) {\n const commentText = fullText.slice(commentRange.pos, commentRange.end);\n if (commentText !== undefined) {\n res+= \" \" + this.transformTrailingComment(commentText);\n }\n }\n }\n return res;\n }\n\n printNodeCommentsIfAny(node, identation, parsedNode) {\n const leadingComment = this.printLeadingComments(node, identation);\n const trailingComment = this.printTraillingComment(node, identation);\n return leadingComment + parsedNode + trailingComment;\n }\n\n getType(node) {\n // try to get type from declared type, example: x: string = \"foo\"\n const type = node.type;\n if (type) {\n if (type.kind === SyntaxKind.TypeReference) {\n const typeRef = type.typeName.text;\n if (typeRef === \"Promise\") {\n const typeArgs = type.typeArguments.filter(t => t.kind !== SyntaxKind.VoidKeyword);\n const insideTypes = typeArgs.map(type => {\n if (this.SupportedKindNames.hasOwnProperty(type.kind)) { // eslint-disable-line\n return this.SupportedKindNames[type.kind];\n } else {\n return type.text;\n }\n }).join(\",\");\n\n if (insideTypes.length > 0) {\n return `${this.PROMISE_TYPE_KEYWORD}<${insideTypes}>`;\n }\n return this.PROMISE_TYPE_KEYWORD;\n }\n return type.typeName.text;\n } else if (this.SupportedKindNames.hasOwnProperty(type.kind)) { // eslint-disable-line\n return this.SupportedKindNames[type.kind];\n }\n }\n\n // todo: infer from initializer re-think this logic ex: x = 1;\n // can we use the type checker here?\n const initializer = node.initializer;\n if (initializer) {\n if (isArrayLiteralExpression(initializer)) {\n return this.ARRAY_KEYWORD;\n }\n if (isBooleanLiteral(initializer)) {\n return this.BOOLEAN_KEYWORD;\n }\n if (isObjectLiteralExpression(initializer)) {\n return this.OBJECT_KEYWORD;\n }\n if (isNumericLiteral(initializer)) {\n // return this.NUMBER_TYPE_TOKEN;\n // const value = initializer.text;\n // const num = Number(value);\n // if (Number.isInteger(num)) {\n // return this.INTEGER_KEYWORD;\n // }\n // return this.NUMBER_KEYWORD;\n return this.DEFAULT_TYPE; // int and number to object\n }\n if (isStringLiteralLikeNode(initializer)) {\n return this.STRING_KEYWORD;\n }\n }\n return undefined;\n }\n\n getTypeFromRawType(type) {\n // check for primitive types\n if (type.flags === TypeFlags.Any) {\n return undefined;\n }\n if (type.flags === TypeFlags.Void) {\n return this.VOID_KEYWORD;\n }\n if (type.flags === TypeFlags.Number) {\n // return this.NUMBER_KEYWORD;\n return this.DEFAULT_TYPE;\n }\n\n if (type.flags === TypeFlags.String) {\n return this.STRING_KEYWORD;\n }\n // if (type.flags === ts.TypeFlags.Boolean) {\n // return this.BOOLEAN_KEYWORD;\n // }\n\n // check for array or object\n\n if (type?.getSymbol()?.escapedName === 'Array') {\n return this.ARRAY_KEYWORD;\n }\n if (type?.getSymbol()?.escapedName === '__object') {\n return this.OBJECT_KEYWORD;\n }\n\n // check this out, trying to resolve Promise<{}>\n if (type?.getSymbol()?.escapedName === '__type') {\n return this.OBJECT_KEYWORD;\n // return this.DEFAULT_TYPE;\n }\n\n // check for promise type\n\n if (type?.getSymbol()?.escapedName === 'Promise') {\n return this.PROMISE_TYPE_KEYWORD;\n }\n\n // check this out not sure about this\n if (type?.intrinsicName === 'object') {\n return this.OBJECT_KEYWORD;\n }\n if (type?.intrinsicName === 'boolean') {\n return this.BOOLEAN_KEYWORD;\n }\n\n return undefined;\n }\n\n getFunctionType(node, async = true){\n // use type checker to do it here\n const type = this.getChecker().getReturnTypeOfSignature(this.getChecker().getSignatureFromDeclaration(node));\n\n const parsedTtype = this.getTypeFromRawType(type);\n\n if (parsedTtype === this.PROMISE_TYPE_KEYWORD) {\n const resolvedTypeArguments = this.getChecker().getTypeArguments(type as any);\n if (resolvedTypeArguments.length === 0) {\n return this.PROMISE_TYPE_KEYWORD;\n }\n if (resolvedTypeArguments.length === 1 && resolvedTypeArguments[0].flags === TypeFlags.Void) {\n return this.PROMISE_TYPE_KEYWORD;\n }\n\n const insideTypes = resolvedTypeArguments.map(type => this.getTypeFromRawType(type)).join(\",\");\n if (insideTypes.length > 0) {\n if (async) {\n return `${this.PROMISE_TYPE_KEYWORD}<${insideTypes}>`;\n } else {\n return insideTypes;\n }\n }\n return undefined;\n }\n return parsedTtype;\n }\n\n printFunctionBody(node, identation) {\n return this.printBlock(node.body, identation);\n }\n\n printParameterType(node) {\n if (!this.requiresParameterType) {\n return \"\";\n }\n\n if (!this.INFER_ARG_TYPE) {\n return this.DEFAULT_PARAMETER_TYPE;\n }\n\n const type = this.getChecker().typeToString(this.getChecker().getTypeAtLocation(node));\n\n if (this.ArgTypeReplacements[type]) {\n return this.ArgTypeReplacements[type];\n }\n\n return this.DEFAULT_PARAMETER_TYPE;\n }\n\n printFunctionType(node){\n if (!this.requiresReturnType) {\n return \"\";\n }\n\n const typeText = this.getFunctionType(node);\n if (typeText === undefined || (typeText !== this.VOID_KEYWORD && typeText !== this.PROMISE_TYPE_KEYWORD)) {\n // throw new FunctionReturnTypeError(\"Function return type is not supported\");\n let res = \"\";\n if (this.isAsyncFunction(node)) {\n res = `${this.PROMISE_TYPE_KEYWORD}<${this.DEFAULT_RETURN_TYPE}>`;\n } else {\n res = this.DEFAULT_RETURN_TYPE;\n }\n this.warn(node, node.name.getText(), \"Function return type not found, will default to: \" + res);\n return res;\n }\n return typeText;\n }\n\n\n printFunctionDefinition(node, identation) {\n let name = node.name?.text ?? \"\";\n name = this.transformFunctionNameIfNeeded(name);\n\n // const parsedArgs = node.parameters.map(param => this.printParameter(param)).join(\", \");\n const parsedArgs = this.printMethodParameters(node);\n\n let modifiers = this.printModifiers(node);\n modifiers = modifiers ? modifiers + \" \" : modifiers;\n\n let returnType = this.printFunctionType(node);\n // quick fix\n if (returnType === 'java.util.concurrent.CompletableFuture') {\n returnType = 'java.util.concurrent.CompletableFuture';\n }\n\n returnType = returnType ? returnType + \" \" : returnType;\n\n const fnKeyword = this.FUNCTION_TOKEN ? this.FUNCTION_TOKEN + \" \" : \"\";\n if (!fnKeyword && isFunctionDeclaration(node)){\n modifiers = modifiers + \"public \";\n }\n let functionDef = this.getIden(identation) + modifiers + returnType + fnKeyword;\n if (this.includeFunctionNameInFunctionExpressionDeclaration || !isFunctionExpression(node)) {\n functionDef += name;\n }\n functionDef += \"(\" + parsedArgs + \")\";\n\n return functionDef;\n }\n\n transformFunctionNameIfNeeded(name): string {\n return this.unCamelCaseIfNeeded(name);\n }\n\n printFunctionDeclaration(node, identation) {\n if (isArrowFunction(node)) {\n const parameters = node.parameters.map(param => this.printParameter(param)).join(\", \");\n const body = this.printNode(node.body);\n return `(${parameters}) => ${body}`;\n }\n const funcBody = this.printFunctionBody(node, identation);\n let functionDef = this.printFunctionDefinition(node, identation);\n functionDef += funcBody;\n\n return this.printNodeCommentsIfAny(node, identation, functionDef);\n }\n\n printMethodParameters(node) {\n return node.parameters.map(param => this.printParameter(param)).join(\", \");\n }\n\n transformMethodNameIfNeeded(name: string): string {\n return this.unCamelCaseIfNeeded(name);\n }\n\n printMethodDefinition(node, identation) {\n let name = node.name.text;\n name = this.transformMethodNameIfNeeded(name);\n\n let returnType = this.printFunctionType(node);\n\n let modifiers = this.printModifiers(node);\n const defaultAccess = this.METHOD_DEFAULT_ACCESS ? this.METHOD_DEFAULT_ACCESS + \" \": \"\";\n modifiers = modifiers ? modifiers + \" \" : defaultAccess; // tmp check this\n\n const parsedArgs = this.printMethodParameters(node);\n\n returnType = returnType ? returnType + \" \" : returnType;\n\n const methodToken = this.METHOD_TOKEN ? this.METHOD_TOKEN + \" \" : \"\";\n const methodDef = this.getIden(identation) + modifiers + returnType + methodToken + name\n + \"(\" + parsedArgs + \")\";\n\n return this.printNodeCommentsIfAny(node, identation, methodDef);\n }\n\n printMethodDeclaration(node, identation) {\n\n let methodDef = this.printMethodDefinition(node, identation);\n\n const funcBody = this.printFunctionBody(node, identation);\n\n methodDef += funcBody;\n\n return methodDef;\n }\n\n printStringLiteral(node) {\n const token = this.STRING_QUOTE_TOKEN;\n let text = node.text;\n if (text in this.StringLiteralReplacements) {\n return this.StringLiteralReplacements[text];\n }\n // trick to preserve valid backslashes (e.g. \\n, \\t)\n const backslashPlaceholder = \"\\x00\";\n text = text.replaceAll(\"\\\\\", backslashPlaceholder);\n text = text.replaceAll(\"\\b\", \"\\\\b\");\n text = text.replaceAll(\"\\f\", \"\\\\f\");\n text = text.replaceAll(\"\\n\", \"\\\\n\");\n text = text.replaceAll(\"\\r\", \"\\\\r\");\n text = text.replaceAll(\"\\t\", \"\\\\t\");\n text = text.replaceAll(backslashPlaceholder, \"\\\\\\\\\");\n if (token === \"'\") {\n text = text.replaceAll(\"'\", \"\\\\'\"); // escape single quotes\n } else if (token === \"\\\"\") {\n text = text.replaceAll(\"\\\"\", \"\\\\\\\"\"); // escape double quotes\n }\n return token + text + token;\n }\n\n printNumericLiteral(node) {\n return node.text;\n }\n\n printArrayLiteralExpression(node, identation) {\n\n const elements = node.elements.map((e) => {\n return this.printNode(e);\n }).join(\", \");\n return this.ARRAY_OPENING_TOKEN + elements + this.ARRAY_CLOSING_TOKEN;\n }\n\n printVariableDeclarationList(node,identation) {\n const declaration = node.declarations[0];\n const varToken = this.VAR_TOKEN ? this.VAR_TOKEN + \" \": \"\";\n\n if (this.removeVariableDeclarationForFunctionExpression && declaration?.initializer && (isFunctionExpression(declaration.initializer) || isArrowFunction(declaration.initializer))) {\n return this.printNode(declaration.initializer, identation).trimEnd();\n }\n // const name = declaration.name.escapedText;\n const parsedValue = (declaration.initializer) ? this.printNode(declaration.initializer, identation) : this.NULL_TOKEN;\n return this.getIden(identation) + varToken + this.printNode(declaration.name) + \" = \" + parsedValue.trim();\n }\n\n printVariableStatement(node, identation){\n\n if (this.isCJSRequireStatement(node)) {\n return \"\"; // remove cjs imports\n }\n\n const decList = node.declarationList;\n const varStatement = this.printVariableDeclarationList(decList, identation) + this.LINE_TERMINATOR;\n return this.printNodeCommentsIfAny(node, identation, varStatement);\n }\n\n printOutOfOrderCallExpressionIfAny(node, identation) {\n return undefined; // stub to override\n }\n\n printSuperCallInsideConstructor(node, identation) {\n const args = node.arguments;\n\n const parsedArgs = args.map((a) => {\n return this.printNode(a, identation).trim();\n }).join(\",\");\n return this.SUPER_CALL_TOKEN + \"(\" + parsedArgs + \")\";\n }\n\n isBuiltInFunctionCall(node) {\n const symbol = this.getChecker().getSymbolAtLocation(node);\n const isInLibFiles = symbol?.declarations\n ?.some(d => /\\/node_modules\\/(typescript|@typescript\\/typescript-[^/]+)\\/lib\\//.test(d.path))\n ?? false;\n\n\n return isInLibFiles;\n }\n\n getTypesFromCallExpressionParameters(node) {\n const resolvedParams = this.getChecker().getResolvedSignature(node).getParameters();\n const parsedTypes = [];\n resolvedParams.forEach((p) => {\n const decl = p.declarations[0].resolve();\n const type = this.getChecker().getTypeAtLocation(decl);\n const parsedType = this.getTypeFromRawType(type);\n parsedTypes.push(parsedType);\n });\n return parsedTypes;\n }\n\n printArgsForCallExpression(node, identation) {\n const args = node.arguments;\n\n const argsList = args.length > 0 ? args : [];\n const parsedArgs = argsList.map((a) => {\n return this.printNode(a, identation).trim();\n }).join(\", \");\n return parsedArgs;\n }\n\n // builtin functions override\n printArrayIsArrayCall(node, identation, parsedArg = undefined) {\n return undefined; // stub\n }\n\n printObjectKeysCall(node, identation, parsedArg = undefined) {\n return undefined; // stub\n }\n\n printObjectValuesCall(node, identation, parsedArg = undefined) {\n return undefined; // stub\n }\n\n printJsonParseCall(node, identation, parsedArg = undefined) {\n return undefined; // stub\n }\n\n printJsonStringifyCall(node, identation, parsedArg = undefined) {\n return undefined; // stub\n }\n\n\n printPromiseAllCall(node, identation, parsedArg = undefined) {\n return undefined; // stub\n }\n\n printMathFloorCall(node, identation, parsedArg = undefined) {\n return undefined; // stub\n }\n\n printMathRoundCall(node, identation, parsedArg = undefined) {\n return undefined; // stub\n }\n\n printMathCeilCall(node, identation, parsedArg = undefined) {\n return undefined; // stub\n }\n\n printNumberIsIntegerCall(node, identation, parsedArg = undefined) {\n return undefined; // stub\n }\n\n printArrayPushCall(node, identation, name = undefined, parsedArg = undefined) {\n return undefined; // stub\n }\n\n printIncludesCall(node, identation, name = undefined, parsedArg = undefined) {\n return undefined; // stub\n }\n\n printIndexOfCall(node, identation, name = undefined, parsedArg = undefined) {\n return undefined; // stub\n }\n\n printStartsWithCall(node, identation, name = undefined, parsedArg = undefined) {\n return undefined; // stub\n }\n\n printEndsWithCall(node, identation, name = undefined, parsedArg = undefined) {\n return undefined; // stub\n }\n\n printPadEndCall(node, identation, name, parsedArg, parsedArg2) {\n return undefined; // stub\n }\n\n printPadStartCall(node, identation, name, parsedArg, parsedArg2) {\n return undefined; // stub\n }\n\n printTrimCall(node, identation, name = undefined) {\n return undefined; // stub\n }\n\n printJoinCall(node, identation, name = undefined, parsedArg = undefined) {\n return undefined; // stub\n }\n\n printSplitCall(node, identation, name = undefined, parsedArg = undefined) {\n return undefined; // stub\n }\n\n printConcatCall(node, identation, name = undefined, parsedArg = undefined) {\n return undefined; // stub\n }\n\n printToFixedCall(node, identation, name = undefined, parsedArg = undefined) {\n return undefined; // stub\n }\n\n printSearchCall(node, identation, name = undefined, parsedArg = undefined) {\n return undefined; // stub\n }\n\n printSliceCall(node, identation, name = undefined, parsedArg = undefined, parsedArg2 = undefined) {\n return undefined; // stub\n }\n\n printReplaceCall(node, identation, name = undefined, parsedArg = undefined, parsedArg2 = undefined) {\n return undefined; // stub\n }\n\n printReplaceAllCall(node, identation, name = undefined, parsedArg = undefined, parsedArg2 = undefined) {\n return undefined; // stub\n }\n\n printToStringCall(node, identation, name = undefined) {\n return undefined; // stub\n }\n\n printToUpperCaseCall(node, identation, name = undefined) {\n return undefined; // stub\n }\n\n printToLowerCaseCall(node, identation, name = undefined) {\n return undefined; // stub\n }\n\n printShiftCall(node, identation, name = undefined) {\n return undefined; // stub\n }\n\n printReverseCall(node, identation, name = undefined) {\n return undefined; // stub\n }\n\n printPopCall(node, identation, name = undefined) {\n return undefined; // stub\n }\n\n printAssertCall(node, identation, parsedArgs) {\n return `assert(${parsedArgs})`;\n }\n\n printDateNowCall(node, identation) {\n return undefined; // stub\n }\n\n printCallExpression(node, identation) {\n const expression = node.expression;\n\n const parsedArgs = this.printArgsForCallExpression(node, identation);\n\n const removeParenthesis = this.shouldRemoveParenthesisFromCallExpression(node);\n\n const finalExpression = this.printOutOfOrderCallExpressionIfAny(node, identation);\n if (finalExpression) {\n return finalExpression;\n }\n\n // check propertyAccessExpression for built in functions calls like Json.parse\n if (node.expression.kind === SyntaxKind.PropertyAccessExpression) {\n const expressionText = node.expression.getText().trim();\n const args = node.arguments ?? [];\n\n if (args.length === 0) {\n switch(expressionText) {\n case \"Date.now\":\n return this.printDateNowCall(node, identation);\n }\n }\n\n if (args.length === 1) {\n const parsedArg = this.printNode(args[0], 0);\n switch (expressionText) {\n case \"JSON.parse\":\n return this.printJsonParseCall(node, identation, parsedArg);\n case \"JSON.stringify\":\n return this.printJsonStringifyCall(node, identation, parsedArg);\n case \"Array.isArray\":\n return this.printArrayIsArrayCall(node, identation, parsedArg);\n case \"Object.keys\":\n return this.printObjectKeysCall(node, identation, parsedArg);\n case \"Object.values\":\n return this.printObjectValuesCall(node, identation, parsedArg);\n case \"Promise.all\":\n return this.printPromiseAllCall(node, identation, parsedArg);\n case \"Math.round\":\n return this.printMathRoundCall(node, identation, parsedArg);\n case \"Math.floor\":\n return this.printMathFloorCall(node, identation, parsedArg);\n case \"Math.ceil\":\n return this.printMathCeilCall(node, identation, parsedArg);\n case \"Number.isInteger\":\n return this.printNumberIsIntegerCall(node, identation, parsedArg);\n }\n }\n const rightSide = node.expression.name?.text;\n const leftSide = node.expression?.expression;\n\n if (args.length === 0 && rightSide !== undefined && leftSide !== undefined) {\n const parsedLeftSide = this.printNode(leftSide, 0);\n switch (rightSide) {\n case \"toString\":\n return this.printToStringCall(node, identation, parsedLeftSide);\n case \"toUpperCase\":\n return this.printToUpperCaseCall(node, identation, parsedLeftSide);\n case \"toLowerCase\":\n return this.printToLowerCaseCall(node, identation, parsedLeftSide);\n case \"shift\":\n return this.printShiftCall(node, identation, parsedLeftSide);\n case \"pop\":\n return this.printPopCall(node, identation, parsedLeftSide);\n case \"reverse\":\n return this.printReverseCall(node, identation, parsedLeftSide);\n case \"trim\":\n return this.printTrimCall(node, identation, parsedLeftSide);\n }\n }\n\n // handle built in functions like\n\n const arg = args && args.length > 0 ? args[0] : undefined;\n\n if (leftSide && rightSide && arg) {\n const parsedArg = this.printNode(arg, identation).trimStart();\n const secondParsedArg = args[1] ? this.printNode(args[1], identation).trimStart() : undefined;\n const name = this.printNode(leftSide, 0);\n switch(rightSide) {\n case 'push':\n return this.printArrayPushCall(node, identation, name, parsedArg);\n case 'includes':\n return this.printIncludesCall(node, identation, name, parsedArg);\n case 'indexOf':\n return this.printIndexOfCall(node, identation, name, parsedArg);\n case 'join':\n return this.printJoinCall(node, identation, name, parsedArg);\n case 'split':\n return this.printSplitCall(node, identation, name, parsedArg);\n case 'toFixed':\n return this.printToFixedCall(node, identation, name, parsedArg);\n case 'concat':\n return this.printConcatCall(node, identation, name, parsedArg);\n case 'search':\n return this.printSearchCall(node, identation, name, parsedArg);\n case 'endsWith':\n return this.printEndsWithCall(node, identation, name, parsedArg);\n case 'startsWith':\n return this.printStartsWithCall(node, identation, name, parsedArg);\n case 'padEnd':\n return this.printPadEndCall(node, identation, name, parsedArg, secondParsedArg);\n case 'padStart':\n return this.printPadStartCall(node, identation, name, parsedArg, secondParsedArg);\n }\n\n if (args.length === 1 || args.length === 2) {\n const parsedArg2 = args[1] ? this.printNode(args[1], identation).trimStart() : undefined;\n switch(rightSide) {\n case 'slice':\n return this.printSliceCall(node, identation, name, parsedArg, parsedArg2);\n case 'replace':\n return this.printReplaceCall(node, identation, name, parsedArg, parsedArg2);\n case 'replaceAll':\n return this.printReplaceAllCall(node, identation, name, parsedArg, parsedArg2);\n }\n }\n }\n } else {\n // handle functions like assert\n const args = node.arguments ?? [];\n if (args.length === 2) {\n if ( expression.text === \"assert\") {\n return this.printAssertCall(node, identation, parsedArgs);\n }\n if (expression.text === \"padEnd\") {\n // check this\n }\n }\n }\n\n // print super() call inside constructor\n if (expression.kind === SyntaxKind.SuperKeyword) {\n return this.printSuperCallInsideConstructor(node, identation);\n }\n\n let parsedExpression = undefined;\n if (this.CallExpressionReplacements.hasOwnProperty(expression.getText())) { // eslint-disable-line\n parsedExpression = this.CallExpressionReplacements[expression.getText()];\n } else {\n if (expression.kind === SyntaxKind.Identifier) {\n const idValue = expression.text ?? expression.text;\n parsedExpression = this.transformCallExpressionName(this.unCamelCaseIfNeeded(idValue), expression);\n } else {\n parsedExpression = this.printNode(expression, 0);\n }\n }\n\n let parsedCall = parsedExpression;\n if (!removeParenthesis) {\n parsedCall+= \"(\" + parsedArgs + \")\";\n\n }\n return parsedCall;\n }\n\n printClassBody(node, identation) {\n // const parsedMembers = node.members.map(m => this.printNode(m, identation+1));\n\n const parsedMembers = [];\n node.members.forEach( (m, index) => {\n const parsedNode = this.printNode(m, identation+1);\n if (m.kind === SyntaxKind.PropertyDeclaration || index === 0) {\n parsedMembers.push(parsedNode);\n } else {\n parsedMembers.push(\"\\n\".repeat(this.NUM_LINES_BETWEEN_CLASS_MEMBERS) + parsedNode);\n }\n });\n return parsedMembers.join(\"\\n\");\n }\n\n getCustomClassName(node) {\n return node.name.text;\n }\n\n getClassModifier(node) {\n return \"\";\n }\n\n printClassDefinition(node, identation) {\n const className = this.getCustomClassName(node);\n this.currentClassName = className;\n const heritageClauses = node.heritageClauses;\n const classModifier = this.getClassModifier(node);\n\n let classInit = \"\";\n const classOpening = this.getBlockOpen(identation);\n if (heritageClauses !== undefined) {\n const classExtends = heritageClauses[0].types[0].expression.text;\n classInit = this.getIden(identation) + classModifier + \"class \" + className + \" \" + this.EXTENDS_TOKEN + \" \" + classExtends + classOpening;\n } else {\n classInit = this.getIden(identation) + classModifier + \"class \" + className + classOpening;\n }\n return classInit;\n }\n\n printClass(node, identation) {\n\n const classDefinition = this.printClassDefinition(node, identation);\n\n const classBody = this.printClassBody(node, identation);\n\n const classClosing = this.getBlockClose(identation);\n\n return classDefinition + classBody + classClosing;\n }\n\n printConstructorDeclaration (node, identation) {\n const args = this.printMethodParameters(node);\n const constructorBody = this.printFunctionBody(node, identation);\n return this.getIden(identation) +\n this.CONSTRUCTOR_TOKEN +\n \"(\" + args + \")\" +\n constructorBody;\n }\n\n printWhileStatement(node, identation) {\n const loopExpression = node.expression;\n\n const expression = this.printNode(loopExpression, 0);\n\n const whileStm = this.getIden(identation) +\n this.WHILE_TOKEN + \" \" +\n this.CONDITION_OPENING + expression + this.CONDITION_CLOSE +\n this.printBlock(node.statement, identation);\n return this.printNodeCommentsIfAny(node, identation, whileStm);\n }\n\n printForStatement(node, identation) {\n const initializer = this.printNode(node.initializer, 0);\n const condition = this.printNode(node.condition, 0);\n const incrementor = this.printNode(node.incrementor, 0);\n\n const forStm = this.getIden(identation) +\n this.FOR_TOKEN + \" \" +\n this.CONDITION_OPENING +\n initializer + \"; \" + condition + \"; \" + incrementor +\n this.CONDITION_CLOSE +\n this.printBlock(node.statement, identation);\n return this.printNodeCommentsIfAny(node, identation, forStm);\n }\n\n printBreakStatement(node, identation) {\n const breakStm = this.getIden(identation) + this.BREAK_TOKEN + this.LINE_TERMINATOR;\n return this.printNodeCommentsIfAny(node, identation, breakStm);\n }\n\n printPostFixUnaryExpression(node, identation) {\n const {operand, operator} = node;\n return this.getIden(identation) + this.printNode(operand, 0) + this.PostFixOperators[operator];\n }\n\n printPrefixUnaryExpression(node, identation) {\n const {operand, operator} = node;\n if (operator === SyntaxKind.ExclamationToken) {\n // not branch check falsy/turthy values if needed;\n return this.getIden(identation) + this.PrefixFixOperators[operator] + this.printCondition(node.operand, 0);\n }\n return this.getIden(identation) + this.PrefixFixOperators[operator] + this.printNode(operand, 0);\n }\n\n printObjectLiteralBody(node, identation) {\n let body = node.properties.map((p) => this.printNode(p, identation+1)).join(\",\\n\");\n body = body ? body + \",\" : body;\n return body;\n }\n\n printObjectLiteralExpression(node, identation) {\n const objectBody = this.printObjectLiteralBody(node, identation);\n const formattedObjectBody = objectBody ? \"\\n\" + objectBody + \"\\n\" + this.getIden(identation) : objectBody;\n return this.OBJECT_OPENING + formattedObjectBody + this.OBJECT_CLOSING;\n }\n\n printCustomRightSidePropertyAssignment(node, identation): string {\n return undefined; // stub to override\n }\n\n printPropertyAssignment(node, identation) {\n const {name, initializer} = node;\n const nameAsString = this.printNode(name, 0);\n\n const customRightSide = this.printCustomRightSidePropertyAssignment(initializer, identation);\n\n const valueAsString = customRightSide ? customRightSide : this.printNode(initializer, identation);\n\n let trailingComment = this.printTraillingComment(node, identation);\n trailingComment = trailingComment ? \" \" + trailingComment : trailingComment;\n\n const propOpen = this.PROPERTY_ASSIGNMENT_OPEN ? this.PROPERTY_ASSIGNMENT_OPEN + \" \": \"\";\n const propClose = this.PROPERTY_ASSIGNMENT_CLOSE ? \" \" + this.PROPERTY_ASSIGNMENT_CLOSE : \"\";\n\n return this.getIden(identation) +\n propOpen +\n nameAsString +\n this.PROPERTY_ASSIGNMENT_TOKEN + \" \" +\n valueAsString.trim() +\n propClose +\n trailingComment;\n }\n\n printElementAccessExpressionExceptionIfAny(node) {\n return undefined; // stub to override\n }\n\n // index WRITE (`x[\"k\"] = v`) whose receiver the C# classifier already declared as a\n // concrete dictionary: the `((IDictionary)x)` interface cast the C#\n // branch below emits only exists because the TS type says nothing about the printed\n // declaration, so a printer that knows the declared type can drop it. undefined/false\n // keeps the upstream cast (the untyped emission). See csharpTranspiler.ts.\n csharpDictionaryIndexWriteNeedsNoCast(node): boolean | undefined {\n return undefined; // stub to override\n }\n\n printElementAccessExpression(node, identation) {\n // example x['test']\n const {expression, argumentExpression} = node;\n\n const exception = this.printElementAccessExpressionExceptionIfAny(node);\n if (exception) {\n return exception;\n }\n\n // when we want replace x['test'] with getValue(x, 'test') only when in the left side\n // Examples:\n // x[\"a\"] = x[\"b\"] : binary expression\n // const a = x[\"b\"] : variable declaration\n const isLeftSideOfAssignment = node.parent?.kind === SyntaxKind.BinaryExpression &&\n (node.parent.operatorToken.kind === SyntaxKind.EqualsToken || node.parent.operatorToken.kind === SyntaxKind.PlusEqualsToken) &&\n node.parent?.left === node;\n // to do; check nested accesses\n // const newNode = node.parent;\n // we need this loop because we might have x[\"t\"][\"test\"][\"key\"]\n // so the parent of the node might be another ElementAccessExpression and not the binary expression/variable declaration directly\n // to do\n // while (newNode !== undefined && newNode.kind !== ts.SyntaxKind.BinaryExpression) {\n // if (newNode.right === node) {\n // rightSideOfAssignment = true;\n // break;\n // }\n // newNode = newNode.parent;\n // }\n\n const expressionAsString = this.printNode(expression, 0);\n const argumentAsString = this.printNode(argumentExpression, 0);\n\n // c# only\n if (!isLeftSideOfAssignment && this.ELEMENT_ACCESS_WRAPPER_OPEN && this.ELEMENT_ACCESS_WRAPPER_CLOSE) {\n return `${this.ELEMENT_ACCESS_WRAPPER_OPEN}${expressionAsString}, ${argumentAsString}${this.ELEMENT_ACCESS_WRAPPER_CLOSE}`;\n }\n // cast order[\"test\"] to ((Dictionariy)order)[\"test\"] or List\n if (isLeftSideOfAssignment && this.ELEMENT_ACCESS_WRAPPER_OPEN && this.ELEMENT_ACCESS_WRAPPER_CLOSE) {\n const type = this.getChecker().getTypeAtLocation(argumentExpression);\n const isString = this.isStringType(type.flags);\n\n let isUnionString = false; // handle unions later\n if (type.flags === TypeFlags.Union) {\n isUnionString = this.isStringType((type as any).getTypes()[0].flags);\n }\n\n if (isString || isUnionString || type.flags === TypeFlags.Any) { // default to string when unknown\n // to do refactor and move this to the derived classes\n if (this.id === \"C#\") {\n const cast = isStringLiteralLikeNode(argumentExpression) ? \"\" : '(string)';\n // a receiver the C# classifier declared as a concrete dictionary needs no\n // interface cast (see csharpDictionaryIndexWriteNeedsNoCast); the key keeps\n // its own spelling, so only the receiver's cast is dropped\n if (this.csharpDictionaryIndexWriteNeedsNoCast(node)) {\n return `${expressionAsString}[${cast}${argumentAsString}]`;\n }\n return `((IDictionary)${expressionAsString})[${cast}${argumentAsString}]`;\n } else if (this.id === \"Java\") {\n return `((java.util.HashMap)${expressionAsString}).get(${argumentAsString})`;\n }\n // if (this.id === \"Go\") {\n // return `AddElementToObject(${expressionAsString}, ${argumentAsString})`;\n // }\n\n }\n if (this.id === \"C#\") {\n return `((${this.ARRAY_KEYWORD})${expressionAsString})[Convert.ToInt32(${argumentAsString})]`;\n } else if (this.id === \"Java\") {\n return `((java.util.List)${expressionAsString}).get(Helpers.toInt(${argumentAsString}))`;\n }\n\n }\n\n return expressionAsString + \"[\" + argumentAsString + \"]\";\n }\n\n printCondition (node, identation) {\n\n if (this.supportsFalsyOrTruthyValues) {\n // languages like php or python do not need this extra logic\n return this.printNode(node, identation);\n }\n\n // can be called from ifs or conditional expressions or binary expressions so might contain the ! operator\n if (node.kind === SyntaxKind.PrefixUnaryExpression && node.operator === SyntaxKind.ExclamationToken) {\n return this.printPrefixUnaryExpression(node, identation); // avoid infinite recursion\n }\n\n // wrap falsy/truthy expressions unconditionally: printing the node once and\n // wrapping is equivalent to the previous always-true branches, which printed\n // the subtree twice and queried the type checker without using the result\n const expression = `${this.FALSY_WRAPPER_OPEN}${this.printNode(node, 0)}${this.FALSY_WRAPPER_CLOSE}`;\n return `${this.getIden(identation)}${expression}`; // stub to override\n }\n\n\n printIfStatement(node, identation) {\n\n const expression = this.printCondition(node.expression, 0);\n\n const elseExists = node.elseStatement !== undefined;\n const isElseIf = node.parent.kind === SyntaxKind.IfStatement;\n\n const needChainBlock = elseExists;\n const ifBody = this.printBlock(node.thenStatement, identation, needChainBlock);\n\n let ifComplete = this.CONDITION_OPENING + expression + this.CONDITION_CLOSE + ifBody;\n if (isElseIf) {\n ifComplete = this.ELSEIF_TOKEN + \" \" + ifComplete;\n } else {\n ifComplete = this.getIden(identation) + this.IF_TOKEN + \" \" + ifComplete;\n }\n\n const elseStatement = node.elseStatement;\n if (elseStatement?.kind === SyntaxKind.Block) {\n\n const elseBody = this.printBlock(elseStatement, identation);\n\n const elseBlock = this.ELSE_TOKEN + elseBody;\n\n ifComplete += elseBlock;\n\n } else if (elseStatement?.kind === SyntaxKind.IfStatement) {\n const elseBody = this.printIfStatement(elseStatement, identation);\n ifComplete += elseBody;\n }\n return this.printNodeCommentsIfAny(node, identation, ifComplete);\n }\n\n printParenthesizedExpression(node, identation) {\n if (node.expression.kind === SyntaxKind.AsExpression) {\n // transform (this as any) into this, () and as any are not necessary\n return this.getIden(identation) + this.printNode(node.expression, 0);\n }\n if (node.expression.kind === SyntaxKind.ArrowFunction) {\n // ignore arrowFunctions inside parenthesis\n return \"\";\n }\n return this.getIden(identation) + this.LEFT_PARENTHESIS + this.printNode(node.expression, 0) + this.RIGHT_PARENTHESIS;\n }\n\n printBooleanLiteral(node) {\n if (SyntaxKind.TrueKeyword === node.kind) {\n return this.TRUE_KEYWORD;\n }\n return this.FALSE_KEYWORD;\n }\n\n printTryStatement(node, identation) {\n const tryBody = this.printBlock(node.tryBlock, identation, true);\n\n const catchBody = this.printBlock(node.catchClause.block, identation);\n const catchDeclaration = this.CATCH_DECLARATION + \" \" + this.printNode(node.catchClause.variableDeclaration.name, 0);\n\n const catchCondOpen = this.CONDITION_OPENING ? this.CONDITION_OPENING : \" \";\n\n return this.getIden(identation) + this.TRY_TOKEN +\n tryBody +\n this.CATCH_TOKEN + catchCondOpen + catchDeclaration + this.CONDITION_CLOSE +\n catchBody;\n }\n\n printNewExpression(node, identation) {\n let expression = node.expression?.text;\n expression = expression ? expression : this.printNode(node.expression); // new Exception or new exact[string] check this out\n const args = node.arguments.map(n => this.printNode(n, identation)).join(\", \");\n const newToken = this.NEW_TOKEN ? this.NEW_TOKEN + \" \" : \"\";\n return newToken + expression + this.LEFT_PARENTHESIS + args + this.RIGHT_PARENTHESIS;\n }\n\n printThrowStatement(node, identation) {\n const expression = this.printNode(node.expression, 0);\n return this.getIden(identation) + this.THROW_TOKEN + \" \" + expression + this.LINE_TERMINATOR;\n }\n\n printAwaitExpression(node, identation) {\n const expression = this.printNode(node.expression, identation);\n const awaitToken = this.asyncTranspiling ? this.AWAIT_TOKEN + \" \" : \"\";\n return awaitToken + expression;\n }\n\n wrapSyntheticNode(synthetic, original) {\n // give the synthetic wrapper the original node's source range and splice it\n // into the parent chain, so position/type based helpers keep working\n synthetic.pos = original.pos;\n synthetic.end = original.end;\n synthetic.parent = original.parent;\n original.parent = synthetic;\n return synthetic;\n }\n\n wrapImplicitReturnAwait(node) {\n // inside a non-async function transpiled as async (isImplicitAsyncFunction),\n // returned Promises must be awaited to keep the generated code equivalent to\n // the classic `async`/`return await` form: wrap them in a synthetic await\n // expression so every language prints them through its usual await path\n let exp = node.expression;\n if (!exp || isAwaitExpression(exp)\n || !this.isImplicitAsyncFunction(findAncestor(node, isFunctionLike))\n || !this.isPromiseType(this.getChecker().getTypeAtLocation(exp))) {\n return node;\n }\n if (isConditionalExpression(exp) || isBinaryExpression(exp)) {\n // an await-token prefix would change precedence (e.g. `await a ? b : c`)\n exp = this.wrapSyntheticNode(createParenthesizedExpression(exp), exp);\n }\n // TS7 program nodes are read-only: print a synthetic return in place of the original\n const synthetic = this.wrapSyntheticNode(createReturnStatement(undefined), node);\n const awaited = this.wrapSyntheticNode(createAwaitExpression(exp), exp);\n awaited.parent = synthetic;\n Object.defineProperty(synthetic, \"expression\", { value: awaited });\n node.parent = synthetic.parent;\n return synthetic;\n }\n\n printConditionalExpression(node, identation) {\n const condition = this.printCondition(node.condition, identation);\n const whenTrue = this.printNode(node.whenTrue, 0);\n const whenFalse = this.printNode(node.whenFalse, 0);\n\n return condition + \" ? \" + whenTrue + \" : \" + whenFalse;\n }\n\n printAsExpression(node, identation) {\n return this.printNode(node.expression, identation);\n }\n\n getFunctionNodeFromReturn(node) {\n let parent = node.parent;\n while (parent) {\n if (parent.kind === SyntaxKind.FunctionDeclaration || parent.kind === SyntaxKind.MethodDeclaration) {\n return parent;\n }\n parent = parent.parent;\n }\n return undefined;\n }\n\n\n printReturnStatement(node, identation) {\n const leadingComment = this.printLeadingComments(node, identation);\n let trailingComment = this.printTraillingComment(node, identation);\n trailingComment = trailingComment ? \" \" + trailingComment : trailingComment;\n const exp = node.expression;\n let rightPart = exp ? (' ' + this.printNode(exp, identation)) : '';\n rightPart = rightPart.trim();\n\n // cast return type if needed\n // if (false && this.requiresCallExpressionCast) {\n // const functionNode = this.getFunctionNodeFromReturn(node);\n // let functionType = this.getFunctionType(functionNode, false);\n // if (functionType === undefined) {\n // // check the parent method type if any\n // const overrideMethod = this.getMethodOverride(functionNode);\n // if (overrideMethod !== undefined) {\n // functionType = this.getFunctionType(overrideMethod, false);\n // }\n // }\n // if (functionType && exp?.kind !== ts.SyntaxKind.UndefinedKeyword) {\n // rightPart = rightPart ? ' ' + `((${functionType}) (${rightPart}))` + this.LINE_TERMINATOR : this.LINE_TERMINATOR;\n // return leadingComment + this.getIden(identation) + this.RETURN_TOKEN + rightPart + trailingComment;\n // }\n // }\n rightPart = rightPart ? ' ' + rightPart + this.LINE_TERMINATOR : this.LINE_TERMINATOR;\n return leadingComment + this.getIden(identation) + this.RETURN_TOKEN + rightPart + trailingComment;\n }\n\n printArrayBindingPattern(node, identation) {\n const elements = node.elements.map((e) => this.printNode(e.name, identation)).join(\", \");\n return this.getIden(identation) + this.ARRAY_OPENING_TOKEN + elements + this.ARRAY_CLOSING_TOKEN;\n }\n\n printBlock(node, identation, chainBlock = false) {\n const blockOpen = this.getBlockOpen(identation);\n const blockClose = this.getBlockClose(identation, chainBlock);\n const statements = node.statements.map((s) => this.printNode(s, identation+1)).join(\"\\n\");\n\n return blockOpen + statements + blockClose;\n }\n\n printExpressionStatement(node, identation) {\n if (this.isCJSModuleExportsExpressionStatement(node)) {\n return \"\"; // remove module.exports = ...\n }\n\n const expressionStatementPrefixes = this.getExpressionStatementPrefixesIfAny(node, identation) ?? \"\";\n\n const exprStm = this.printNode(node.expression, identation);\n\n // skip empty statements\n if (exprStm.length === 0) {\n return \"\";\n }\n const expStatement = expressionStatementPrefixes + this.getIden(identation) + exprStm + this.LINE_TERMINATOR;\n return this.printNodeCommentsIfAny(node, identation, expStatement);\n }\n\n getExpressionStatementPrefixesIfAny(node, identation) {\n return undefined;\n }\n\n printPropertyDeclaration(node, identation) {\n const modifiers = this.printPropertyAccessModifiers(node);\n const name = this.printNode(node.name, 0);\n if (node.initializer) {\n const initializer = this.printNode(node.initializer, 0);\n return this.getIden(identation) + modifiers + name + \" = \" + initializer + this.LINE_TERMINATOR;\n }\n return this.getIden(identation) + modifiers + name + this.LINE_TERMINATOR;\n }\n\n printPropertyAccessModifiers (node) {\n let modifiers = this.printModifiers(node);\n modifiers = modifiers ? modifiers + \" \" : modifiers;\n return modifiers;\n }\n\n printSpreadElement(node, identation) {\n const expression = this.printNode(node.expression, 0);\n return this.getIden(identation) + this.SPREAD_TOKEN + expression;\n }\n\n printNullKeyword(node, identation){\n return this.getIden(identation) + this.NULL_TOKEN;\n }\n\n printContinueStatement(node, identation){\n return this.getIden(identation) + this.CONTINUE_TOKEN + this.LINE_TERMINATOR;\n }\n\n printDeleteExpression (node, identation) {\n return undefined;\n }\n\n printThisKeyword(node, identation) {\n return this.THIS_TOKEN;\n }\n\n printNode(node, identation = 0): string {\n\n try {\n // dispatch on node.kind directly: every ts.isX predicate used here is a\n // plain kind comparison, and a switch avoids running ~45 predicate calls\n // for nodes that match late (or not at all) in the former if-else chain\n switch (node.kind) {\n case SyntaxKind.ExpressionStatement:\n return this.printExpressionStatement(node, identation);\n case SyntaxKind.Block:\n return this.printBlock(node, identation);\n case SyntaxKind.FunctionDeclaration:\n case SyntaxKind.FunctionExpression:\n case SyntaxKind.ArrowFunction:\n return this.printFunctionDeclaration(node, identation);\n case SyntaxKind.ClassDeclaration:\n return this.printClass(node, identation);\n case SyntaxKind.VariableStatement:\n return this.printVariableStatement(node, identation);\n case SyntaxKind.MethodDeclaration:\n return this.printMethodDeclaration(node, identation);\n case SyntaxKind.StringLiteral:\n return this.printStringLiteral(node);\n case SyntaxKind.NumericLiteral:\n return this.printNumericLiteral(node);\n case SyntaxKind.PropertyAccessExpression:\n return this.printPropertyAccessExpression(node, identation);\n case SyntaxKind.ArrayLiteralExpression:\n return this.printArrayLiteralExpression(node, identation);\n case SyntaxKind.CallExpression:\n return this.printCallExpression(node, identation);\n case SyntaxKind.WhileStatement:\n return this.printWhileStatement(node, identation);\n case SyntaxKind.BinaryExpression:\n return this.printBinaryExpression(node, identation);\n case SyntaxKind.BreakStatement:\n return this.printBreakStatement(node, identation);\n case SyntaxKind.ForStatement:\n return this.printForStatement(node, identation);\n case SyntaxKind.PostfixUnaryExpression:\n return this.printPostFixUnaryExpression(node, identation);\n case SyntaxKind.VariableDeclarationList:\n return this.printVariableDeclarationList(node, identation); // statements are slightly different if inside a for\n case SyntaxKind.ObjectLiteralExpression:\n return this.printObjectLiteralExpression(node, identation);\n case SyntaxKind.PropertyAssignment:\n return this.printPropertyAssignment(node, identation);\n case SyntaxKind.Identifier:\n return this.printIdentifier(node);\n case SyntaxKind.ElementAccessExpression:\n return this.printElementAccessExpression(node, identation);\n case SyntaxKind.IfStatement:\n return this.printIfStatement(node, identation);\n case SyntaxKind.ParenthesizedExpression:\n return this.printParenthesizedExpression(node, identation);\n case SyntaxKind.TrueKeyword:\n case SyntaxKind.FalseKeyword:\n return this.printBooleanLiteral(node);\n case SyntaxKind.ThisKeyword:\n return this.printThisKeyword(node, identation);\n case SyntaxKind.SuperKeyword:\n return this.SUPER_TOKEN;\n case SyntaxKind.TryStatement:\n return this.printTryStatement(node, identation);\n case SyntaxKind.PrefixUnaryExpression:\n return this.printPrefixUnaryExpression(node, identation);\n case SyntaxKind.ThrowStatement:\n return this.printThrowStatement(node, identation);\n case SyntaxKind.NewExpression:\n return this.printNewExpression(node, identation);\n case SyntaxKind.AwaitExpression:\n return this.printAwaitExpression(node, identation);\n case SyntaxKind.ConditionalExpression:\n return this.printConditionalExpression(node, identation);\n case SyntaxKind.AsExpression:\n return this.printAsExpression(node, identation);\n case SyntaxKind.ReturnStatement:\n return this.printReturnStatement(this.wrapImplicitReturnAwait(node), identation);\n case SyntaxKind.ArrayBindingPattern:\n return this.printArrayBindingPattern(node, identation);\n case SyntaxKind.Parameter:\n return this.printParameter(node);\n case SyntaxKind.Constructor:\n return this.printConstructorDeclaration(node, identation);\n case SyntaxKind.PropertyDeclaration:\n return this.printPropertyDeclaration(node, identation);\n case SyntaxKind.SpreadElement:\n return this.printSpreadElement(node, identation);\n case SyntaxKind.NullKeyword:\n return this.printNullKeyword(node, identation);\n case SyntaxKind.ContinueStatement:\n return this.printContinueStatement(node, identation);\n case SyntaxKind.DeleteExpression:\n return this.printDeleteExpression(node, identation);\n }\n\n if (node.statements) {\n if (isSourceFile(node)) {\n // reset the current class name when entering a new file so a\n // class name from a previously transpiled file does not leak\n // into a class-less file (e.g. try/catch wrappers in tests)\n this.className = \"undefined\";\n }\n const transformedStatements = node.statements.map((m)=> {\n return this.printNode(m, identation + 1);\n });\n\n return transformedStatements.filter(st => st.length > 0 ).join(\"\\n\" + \"\\n\".repeat(this.LINES_BETWEEN_FILE_MEMBERS)) + \"\\n\".repeat(this.NUM_LINES_END_FILE);\n }\n return \"\";\n\n } catch (e) {\n if (!(e instanceof TranspilationError)) {\n console.error('[ast-transpiler] underlying error:', e && (e.stack || e.message || e));\n }\n throw new TranspilationError(this.id, (e && (e.messageText ?? e.message)) ?? String(e), node.getFullText(), node.pos, node.end);\n }\n }\n\n getFileESMImports(node): IFileImport[] {\n const result = [];\n const importStatements = node.statements.filter((s) => isImportDeclaration(s));\n importStatements.forEach(node => {\n const importPath = node.moduleSpecifier.text;\n const importClause = node.importClause;\n const namedImports = importClause.namedBindings;\n if (namedImports) {\n if (namedImports.elements) {\n // named imports\n namedImports.elements.forEach((elem) => {\n const name = elem.name.text;\n const fileImport: IFileImport = {\n name,\n path: importPath,\n isDefault: false\n };\n result.push(fileImport);\n });\n } else {\n // namespace import (import * as name from 'path')\n const name = namedImports.name.text;\n const fileImport: IFileImport = {\n name,\n path: importPath,\n isDefault: false\n };\n result.push(fileImport);\n }\n\n } else {\n // default import\n const name = importClause.name.text;\n const fileImport: IFileImport = {\n name,\n path: importPath,\n isDefault: true\n };\n result.push(fileImport);\n }\n });\n return result;\n }\n\n isCJSRequireStatement(node): boolean {\n const dec = node.declarationList.declarations[0];\n return dec.initializer && isCallExpression(dec.initializer) && dec.initializer.expression.getText() === \"require\";\n }\n\n isCJSModuleExportsExpressionStatement(node): boolean {\n if (node.expression && node.expression.kind === SyntaxKind.BinaryExpression ) {\n if (node.expression.left.kind === SyntaxKind.PropertyAccessExpression) {\n const left = node.expression.left as PropertyAccessExpression;\n return left.expression.getText() === \"module\" && left.name.getText() === \"exports\";\n }\n }\n return false;\n }\n\n getCJSImports(node): IFileImport[] {\n const result = [];\n const varStatements = node.statements.filter(s => isVariableStatement(s));\n const decList = varStatements.map(s => s.declarationList);\n const dec = decList.map(d => d.declarations[0]);\n\n dec.forEach(decNode => {\n if (decNode.initializer && decNode.initializer.kind === SyntaxKind.CallExpression) {\n const callExpression = decNode.initializer.expression.getText();\n if (callExpression === \"require\") {\n const isDefault = decNode.name.kind === SyntaxKind.Identifier;\n const importPath = decNode.initializer.arguments[0].text;\n if (isDefault) {\n const name = decNode.name.text;\n const fileImport: IFileImport = {\n name,\n path: importPath,\n isDefault: isDefault\n };\n result.push(fileImport);\n } else {\n const elems = decNode.name.elements;\n elems.forEach(elem => {\n const name = elem.name.text;\n const fileImport: IFileImport = {\n name,\n path: importPath,\n isDefault: false,\n };\n result.push(fileImport);\n });\n }\n }\n }\n });\n\n return result;\n }\n\n getFileImports(node): IFileImport[] {\n const esmImports = this.getFileESMImports(node);\n if (esmImports.length > 0) {\n return esmImports;\n }\n const cjsImports = this.getCJSImports(node);\n return cjsImports;\n }\n\n getESMExports(node): IFileExport[] {\n const result = [];\n const namedExports = node.statements.filter((s) => isExportDeclaration(s));\n const defaultExport = node.statements.filter((s) => isExportAssignment(s));\n\n namedExports.forEach(node => {\n const namedExports = node.exportClause;\n if (namedExports) {\n namedExports.elements.forEach((elem) => {\n const name = elem.name.text;\n const fileExport: IFileExport = {\n name,\n isDefault: false\n };\n result.push(fileExport);\n });\n }\n });\n\n defaultExport.forEach(node => {\n const name = node.expression.getText();\n const fileExport: IFileExport = {\n name,\n isDefault: true\n };\n result.push(fileExport);\n });\n return result;\n }\n\n getCJSExports(node): IFileExport[] {\n const result = [];\n const moduleExports = node.statements.filter(s => this.isCJSModuleExportsExpressionStatement(s)).map(s => s.expression as BinaryExpression);\n\n moduleExports.forEach(node => {\n const right = node.right;\n if (right.kind === SyntaxKind.ObjectLiteralExpression) {\n const props = right.properties;\n props.forEach(prop => {\n const name = prop.name.getText();\n const fileExport: IFileExport = {\n name,\n isDefault: false\n };\n result.push(fileExport);\n });\n }\n if (right.kind === SyntaxKind.Identifier) {\n const name = right.getText();\n const fileExport: IFileExport = {\n name,\n isDefault: true\n };\n result.push(fileExport);\n }\n });\n return result;\n }\n\n getExportDeclarations(node): IFileExport[] {\n // example export default class X\n const result = [];\n const classDeclarations = node.statements.filter((s) => isClassDeclaration(s));\n const functionDeclarations = node.statements.filter((s) => isFunctionDeclaration(s));\n\n const both = classDeclarations.concat(functionDeclarations);\n both.forEach(classNode => {\n const modifiers = classNode.modifiers;\n if (modifiers) {\n const isDefault = modifiers.some((m) => m.kind === SyntaxKind.DefaultKeyword);\n if (isDefault) {\n const name = classNode.name.text;\n const fileExport: IFileExport = {\n name,\n isDefault: true\n };\n result.push(fileExport);\n }\n }\n });\n return result;\n }\n\n getFileExports(node): IFileExport[] {\n const defaultClassAndFunctionsExports = this.getExportDeclarations(node);\n const esmExports = this.getESMExports(node).concat(defaultClassAndFunctionsExports);\n if (esmExports.length > 0) {\n return esmExports;\n }\n return this.getCJSExports(node);\n }\n\n getReturnTypeFromMethod(node): string {\n // first try custom type\n\n const bType = this.getChecker().getTypeAtLocation(node);\n // const func2Symbol = bType.getProperty(\"test1\")!;\n const bSymbol = bType.getSymbol();\n const func2Type = this.getChecker().getTypeOfSymbolAtLocation(bSymbol, bSymbol.valueDeclaration.resolve());\n const func2Signature = this.getChecker().getSignaturesOfType(func2Type, SignatureKind.Call)[0];\n const rawType = func2Signature.getReturnType();\n // const parsed = ts.TypeFlags[rawType.flags];\n // console.log(parsed);\n const res = this.getChecker().typeToString(rawType); // C\n if (res === undefined) {\n const name = node.type?.typeName?.text;\n if (name){\n return name as string;\n }\n }\n return res;\n }\n\n getParameterType(node): IParameterType {\n const isOptional = node.questionToken !== undefined;\n\n const result: IParameterType = {\n name: node.name.getText(),\n isOptional: isOptional,\n type: undefined\n };\n\n if (node.initializer !== undefined) {\n result.initializer = node.initializer.getText();\n }\n\n // first try custom type\n if (node.type === undefined) {\n // does not have a type or uses a initializer\n if (node.initializer !== undefined) {\n const type = this.getChecker().getTypeAtLocation(node.initializer);\n const res = this.getChecker().typeToString(type); // C\n // console.log(\"initializer\", res);\n // result.initializer = node.initializer.text;\n result.type = TypeFlags[type.flags];\n return result;\n }\n }\n\n const name = node.type?.typeName?.text;\n if (name){\n result.type = name as string;\n if (node.initializer !== undefined) {\n result.initializer = node.initializer.text;\n }\n return result;\n }\n\n if (node.type != undefined) {\n const type = this.getChecker().getTypeAtLocation(node.type);\n const res = this.getChecker().typeToString(type); // C\n result.type = res as string;\n return result;\n }\n return result;\n }\n\n getMethodTypes(file): IMethodType[] {\n const result: IMethodType[] = [];\n if (!file.statements) {\n return result;\n }\n const classDeclarations = file.statements.filter((s) => isClassDeclaration(s));\n classDeclarations.forEach((node) => {\n const methods = node.members.filter((m) => isMethodDeclaration(m));\n methods.forEach(m => {\n const isAsync = this.isAsyncFunction(m);\n const name = m.name.getText();\n const returnType = this.getReturnTypeFromMethod(m);\n const parameters = (m as any).parameters;\n // const paramTypes:IParameterType[] = parameters.map((p) => this.getParameterType(p));\n const paramTypes:IParameterType[] = [];\n parameters.forEach((p) => {\n const res = this.getParameterType(p);\n paramTypes.push(res);\n });\n result.push({\n name,\n async:isAsync,\n returnType,\n parameters: paramTypes\n });\n });\n });\n\n return result;\n }\n}\n\nexport {\n BaseTranspiler\n};\n","import { type SourceFile } from \"typescript/unstable/ast\";\nimport { type API, type Checker, type Program, type Snapshot } from \"typescript/unstable/sync\";\n\ninterface IInput {\n language: Languages;\n async: boolean;\n}\n\n// per-transpile typescript state. Holding it in an explicit object (owned by the\n// Transpiler instance and handed to the language printers) instead of process\n// globals keeps concurrent/nested transpilations from clobbering each other.\ninterface ITranspileContext {\n src: SourceFile;\n checker: Checker;\n program: Program;\n}\n\n// The TS7 API server the programs are created on. Shareable between Transpiler\n// instances on the same thread; a worker_threads isolate needs its own.\ninterface ITranspileProgramCache {\n api?: API;\n // the run-wide program set by Transpiler.setSharedProgram\n shared?: { snapshot: Snapshot, program: Program, checker: Checker };\n}\n\n\ninterface IParameterType {\n name: string;\n type: string;\n isOptional: boolean;\n initializer?: string;\n}\n\ninterface IMethodType {\n async: boolean;\n name: string;\n returnType: string;\n parameters: IParameterType[];\n}\n\ninterface IFileImport {\n name: string;\n path: string;\n isDefault: boolean;\n}\n\ninterface IFileExport {\n name: string;\n isDefault: boolean;\n}\n\ninterface ITranspiledFile {\n content: string;\n imports: IFileImport[];\n exports: IFileExport[];\n methodsTypes?: IMethodType[];\n}\n\nenum Languages {\n Python,\n Php,\n CSharp,\n Go,\n Java,\n Rust,\n Cpp\n}\n\nenum TranspilationMode {\n ByPath,\n ByContent\n}\n\n// const TranspilingError = (message) => ({\n// error: new Error(message),\n// code: 'TRANSPILING ERROR'\n// });\n\nclass TranspilationError extends Error {\n constructor (id, message, nodeText, start, end) {\n const parsedMessage = `Lang: ${id} Error: ${message} at ${start}:${end} node: \"${nodeText}\"`;\n super (parsedMessage);\n this.name = 'TranspilationError';\n\n }\n}\n\n// class FunctionReturnTypeError extends TranspilationError {\n// constructor (message) {\n// super (message);\n// this.name = 'FuctionReturnTypeError';\n// }\n// }\n\n// class FunctionArgumentTypeError extends TranspilationError {\n// constructor (message) {\n// super (message);\n// this.name = 'FunctionArgumentTypeError';\n// }\n// }\n\nexport {\n Languages,\n TranspilationMode,\n IFileImport,\n ITranspiledFile,\n IFileExport,\n ITranspileContext,\n ITranspileProgramCache,\n TranspilationError,\n // FunctionReturnTypeError,\n // FunctionArgumentTypeError,\n IInput,\n IMethodType,\n IParameterType\n};","\n\nfunction regexAll (text: string, array: any[]): string {\n for (const i in array) {\n let regex = array[i][0];\n const flags = (typeof regex === 'string') ? 'g' : undefined;\n regex = new RegExp (regex, flags);\n text = text.replace (regex, array[i][1]);\n }\n return text;\n}\n\nfunction unCamelCase (s: string): string | undefined {\n return s.match (/[A-Z]/) ? s.replace (/[a-z0-9][A-Z]/g, x => x[0] + '_' + x[1]).replace(/[A-Z0-9][A-Z0-9][a-z][^$]/g, x => x[0] + '_' + x[1] + x[2] + x[3]).replace(/[a-z][0-9]$/g, x=> x[0] + '_' + x[1]).toLowerCase () : undefined;\n}\n\n// function extend (...args) {\n// Object.assign ({}, ...args);\n// }\n\nexport {\n regexAll,\n unCamelCase,\n};\n","import { green, yellow, red } from \"colorette\";\n\nclass Logger {\n static verbose = true;\n\n // static createInstanceIfNeeded(): void {\n // if (!this._instance) {\n // this._instance = new Logger();\n // }\n // }\n\n static setVerboseMode(verbose: boolean) {\n this.verbose = verbose;\n }\n\n static log(message: string) {\n if (this.verbose) {\n console.log(message);\n }\n }\n\n static success(message: string) {\n this.log(green(`[SUCCESS]: ${message}`));\n }\n\n static warning(message: string) {\n this.log(yellow(`[WARNING]: ${message}`));\n }\n\n static error(message: string) {\n this.log(red(`[ERROR]: ${message}`));\n }\n}\n\nexport {\n Logger\n};\n\n","import { BaseTranspiler } from \"./baseTranspiler.js\";\nimport { SyntaxKind } from \"typescript/unstable/ast\";\nimport { isArrowFunction, isCallExpression, isFunctionDeclaration, isFunctionExpression } from \"typescript/unstable/ast/is\";\nimport { TypeFlags, type Checker } from \"typescript/unstable/sync\";\nimport { unCamelCase, regexAll } from \"./utils.js\";\nimport { Logger } from \"./logger.js\";\n\nconst parserConfig = {\n 'ELSEIF_TOKEN': 'elseif',\n 'THIS_TOKEN': '$this',\n 'PROPERTY_ACCESS_TOKEN': '->',\n 'UNDEFINED_TOKEN': 'null',\n 'NOT_TOKEN': '!',\n 'LINE_TERMINATOR': ';',\n 'ARRAY_OPENING_TOKEN':\"[\",\n 'ARRAY_CLOSING_TOKEN':\"]\",\n 'OBJECT_OPENING':\"array(\",\n 'OBJECT_CLOSING':\")\",\n 'FUNCTION_TOKEN': 'function',\n 'ASYNC_TOKEN': '',\n 'PROPERTY_ASSIGNMENT_TOKEN': ' =>',\n 'NEW_TOKEN': 'new',\n 'THROW_TOKEN': 'throw',\n 'SUPER_TOKEN': 'parent',\n 'CONSTRUCTOR_TOKEN': 'function __construct',\n 'SUPER_CALL_TOKEN': 'parent::__construct',\n 'CATCH_DECLARATION': 'Exception',\n 'CATCH_TOKEN': 'catch',\n 'BLOCK_OPENING_TOKEN' :'{',\n 'BLOCK_CLOSING_TOKEN' :'}',\n 'CONDITION_OPENING' :'(',\n 'CONDITION_CLOSE' :')',\n 'PLUS_PLUS_TOKEN': '++',\n 'MINUS_MINUS_TOKEN': '--',\n 'SPACE_DEFAULT_PARAM': ' ',\n 'EXCLAMATION_EQUALS_EQUALS_TOKEN': '!==',\n 'EQUALS_EQUALS_EQUALS_TOKEN': '===',\n 'STRING_QUOTE_TOKEN': '\\'',\n 'EXTENDS_TOKEN': 'extends',\n};\n\nexport class PhpTranspiler extends BaseTranspiler {\n awaitWrapper;\n propRequiresScopeResolutionOperator: string[];\n AWAIT_WRAPPER_OPEN;\n AWAIT_WRAPPER_CLOSE;\n ASYNC_FUNCTION_WRAPPER_OPEN = \"\";\n constructor(config = {}) {\n\n config['parser'] = Object.assign ({}, parserConfig, config['parser'] ?? {});\n\n super(config);\n this.id = \"php\";\n this.asyncTranspiling = config['async'] ?? true;\n this.uncamelcaseIdentifiers = config['uncamelcaseIdentifiers'] ?? false;\n this.removeVariableDeclarationForFunctionExpression = config['removeFunctionAssignToVariable'] ?? false;\n this.includeFunctionNameInFunctionExpressionDeclaration = config['includeFunctionNameInFunctionExpressionDeclaration'] ?? false;\n\n this.propRequiresScopeResolutionOperator = ['super'] + (config['ScopeResolutionProps'] ?? []);\n\n this.initConfig();\n\n // user overrides\n this.applyUserOverrides(config);\n\n // const propertyAccessRemoval = config['PropertyAccessRequiresParenthesisRemoval'] ?? [];\n // this.PropertyAccessRequiresParenthesisRemoval.push(...propertyAccessRemoval);\n\n this.AWAIT_WRAPPER_OPEN = config['AWAIT_WRAPPER_OPEN'] ?? \"\\\\React\\\\Async\\\\await(\";\n this.AWAIT_WRAPPER_CLOSE = config['AWAIT_WRAPPER_CLOSE'] ?? \")\";\n }\n\n printAwaitExpression(node, identation) {\n const expression = this.printNode(node.expression, identation);\n\n if (!this.asyncTranspiling) {\n return expression;\n }\n\n return this.AWAIT_WRAPPER_OPEN + expression + this.AWAIT_WRAPPER_CLOSE;\n }\n\n transformIdentifier(node, identifier) {\n if (this.uncamelcaseIdentifiers) {\n identifier = this.unCamelCaseIfNeeded(identifier);\n }\n\n // Get the symbol for the identifier\n const symbol = this.getChecker().getSymbolAtLocation(node);\n\n // Check if the symbol references a function declaration or expression\n const valueDecl = symbol?.valueDeclaration?.resolve();\n if (valueDecl) {\n\n // Check if it's a function (FunctionDeclaration, FunctionExpression, ArrowFunction)\n if (isFunctionDeclaration(valueDecl) || isFunctionExpression(valueDecl) || isArrowFunction(valueDecl)) {\n // Check if the identifier is passed as an argument in a function call\n if (node.parent && isCallExpression(node.parent) && node.parent.arguments.includes(node)) {\n return `'${identifier}'`; // Transpile function reference as string\n }\n }\n }\n\n // below is commented, due to : https://github.com/ccxt/ast-transpiler/pull/15\n //\n // If the identifier is a function parameter (callback), it should remain a variable with `$` prefix\n // if (node.parent && (ts.isParameter(node.parent) || (ts.isCallExpression(node.parent) && ts.isIdentifier(node)))) {\n // return \"$\" + identifier;\n // }\n\n // Default case: prepend $ for variables (non-functions), unless it's a class or constant\n if (!this.startsWithUpperCase(identifier)) {\n return \"$\" + identifier; // Prepend $ for variable names\n }\n\n return identifier;\n }\n\n\n getCustomOperatorIfAny(left, right, operator) {\n const STRING_CONCAT = '.';\n const PLUS_EQUALS_TOKEN = '.=';\n if (operator.kind == SyntaxKind.PlusToken || operator.kind == SyntaxKind.PlusEqualsToken) {\n\n const TOKEN = operator.kind == SyntaxKind.PlusToken ? STRING_CONCAT : PLUS_EQUALS_TOKEN;\n\n if (left.kind == SyntaxKind.StringLiteral || right.kind == SyntaxKind.StringLiteral) {\n return TOKEN;\n }\n\n const leftType = this.getChecker().getTypeAtLocation(left);\n const rightType = this.getChecker().getTypeAtLocation(right);\n\n if (leftType.flags === TypeFlags.String || rightType.flags === TypeFlags.String) {\n return TOKEN;\n }\n if (leftType.flags === TypeFlags.StringLiteral || rightType.flags === TypeFlags.StringLiteral) {\n return TOKEN;\n }\n }\n return undefined;\n }\n\n printLengthProperty(node, identation, name = undefined) {\n const leftSide = this.printNode(node.expression, 0);\n const type = (this.getChecker() as Checker).getTypeAtLocation(node.expression); // eslint-disable-line\n this.warnIfAnyType(node, type.flags, leftSide, \"length\");\n return this.isStringType(type.flags) ? `strlen(${leftSide})` : `count(${leftSide})`;\n }\n\n printPopCall(node, identation, name = undefined) {\n return `array_pop(${name})`;\n }\n\n printReverseCall(node, identation, name = undefined) {\n return `${name} = array_reverse(${name})`;\n }\n\n printShiftCall(node, identation, name = undefined) {\n return `array_shift(${name})`;\n }\n\n printToLowerCaseCall(node, identation, name = undefined) {\n return `strtolower(${name})`;\n }\n\n printToUpperCaseCall(node, identation, name = undefined) {\n return `strtoupper(${name})`;\n }\n\n printToStringCall(node, identation, name = undefined) {\n return `((string) ${name})`;\n }\n\n printArrayIsArrayCall(node, identation, parsedArg = undefined) {\n return `gettype(${parsedArg}) === 'array' && array_is_list(${parsedArg})`;\n }\n\n printObjectKeysCall(node, identation, parsedArg = undefined) {\n return `is_array(${parsedArg}) ? array_keys(${parsedArg}) : array()`;\n }\n\n printObjectValuesCall(node, identation, parsedArg = undefined) {\n return `is_array(${parsedArg}) ? array_values(${parsedArg}) : array()`;\n }\n\n printJsonParseCall(node, identation, parsedArg?) {\n return `json_decode(${parsedArg}, $as_associative_array = true)`;\n }\n\n printJsonStringifyCall(node: any, identation: any, parsedArg?: any) {\n return `json_encode(${parsedArg})`;\n }\n\n printArrayPushCall(node, identation, name = undefined, parsedArg = undefined) {\n return `${name}[] = ${parsedArg}`;\n }\n\n printPromiseAllCall(node, identation, parsedArg = undefined) {\n return `\\\\React\\\\Promise\\\\all(${parsedArg})`;\n }\n\n printMathCeilCall(node, identation, parsedArg = undefined) {\n return `((int) ceil(${parsedArg}))`;\n }\n\n printNumberIsIntegerCall(node, identation, parsedArg?) {\n return `is_int(${parsedArg})`;\n }\n\n printMathRoundCall(node, identation, parsedArg = undefined) {\n return `((int) round(${parsedArg}))`;\n }\n\n printMathFloorCall(node: any, identation: any, parsedArg?: any) {\n return `((int) floor(${parsedArg}))`;\n }\n\n printReplaceCall(node, identation, name = undefined, parsedArg = undefined, parsedArg2 = undefined) {\n return `str_replace(${parsedArg}, ${parsedArg2}, ${name})`;\n }\n\n printReplaceAllCall(node, identation, name = undefined, parsedArg = undefined, parsedArg2 = undefined) {\n return `str_replace(${parsedArg}, ${parsedArg2}, ${name})`;\n }\n\n printIncludesCall(node, identation, name = undefined, parsedArg = undefined) {\n // \"ol\".includes(\"o\") -> str_contains(\"ol\", \"o\") or [12,3,4].includes(3) -> in_array(3, [12,3,4])\n const leftSide = node.expression?.expression;\n const leftSideText = this.printNode(leftSide, 0);\n const type = this.getChecker().getTypeAtLocation(leftSide); // eslint-disable-line\n this.warnIfAnyType(node, type.flags, leftSideText, \"includes\");\n this.warnIfAnyType(node, type.flags, leftSideText, \"includes\");\n if (this.isStringType(type.flags)) {\n return `str_contains(${name}, ${parsedArg})`;\n } else {\n return `in_array(${parsedArg}, ${name})`;\n }\n }\n\n printIndexOfCall(node, identation, name = undefined, parsedArg = undefined) {\n const leftSide = node.expression?.expression;\n const leftSideText = this.printNode(leftSide, 0);\n const type = this.getChecker().getTypeAtLocation(leftSide); // eslint-disable-line\n this.warnIfAnyType(node, type.flags, leftSideText, \"indexOf\");\n if (this.isStringType(type.flags)) {\n return `mb_strpos(${name}, ${parsedArg})`;\n } else {\n return `array_search(${parsedArg}, ${name})`;\n }\n }\n\n printSearchCall(node, identation, name = undefined, parsedArg = undefined) {\n return `mb_strpos(${name}, ${parsedArg})`;\n }\n\n printStartsWithCall(node, identation, name = undefined, parsedArg = undefined) {\n return `str_starts_with(${name}, ${parsedArg})`;\n }\n\n printEndsWithCall(node, identation, name = undefined, parsedArg = undefined) {\n return `str_ends_with(${name}, ${parsedArg})`;\n }\n\n printTrimCall(node, identation, name = undefined) {\n return `trim(${name})`;\n }\n\n printJoinCall(node, identation, name = undefined, parsedArg = undefined) {\n return `implode(${parsedArg}, ${name})`;\n }\n\n printSplitCall(node, identation, name = undefined, parsedArg = undefined) {\n return `explode(${parsedArg}, ${name})`;\n }\n\n printConcatCall(node: any, identation: any, name?: any, parsedArg?: any) {\n return `array_merge(${name}, ${parsedArg})`;\n }\n\n printPadEndCall(node, identation, name, parsedArg, parsedArg2) {\n return `str_pad(${name}, ${parsedArg}, ${parsedArg2}, STR_PAD_RIGHT)`;\n }\n\n printPadStartCall(node, identation, name, parsedArg, parsedArg2) {\n return `str_pad(${name}, ${parsedArg}, ${parsedArg2}, STR_PAD_LEFT)`;\n }\n\n printDateNowCall(node, identation) {\n return \"round(microtime(true) * 1000)\";\n }\n\n printInstanceOfExpression(node, identation) {\n // const left = this.printNode(node.left, 0);\n // const right = this.printNode(node.right, 0);\n const left = node.left.text;\n const right = node.right.text;\n return this.getIden(identation) + \"$\"+left+\" instanceof \"+right+\"\";\n }\n\n printDeleteExpression(node, identation) {\n const expression = this.printNode (node.expression, 0);\n return `unset(${expression})`;\n }\n\n printNewExpression(node, identation) {\n let expression = node.expression?.text;\n expression = expression ? expression : this.printNode(node.expression);\n // JS's built-in `Error` maps to PHP's `Exception` (PHP's `Error` is reserved for internal engine errors)\n if (expression === 'Error') {\n expression = 'Exception';\n }\n const args = node.arguments.map(n => this.printNode(n, identation)).join(\", \");\n const newToken = this.NEW_TOKEN ? this.NEW_TOKEN + \" \" : \"\";\n return newToken + expression + this.LEFT_PARENTHESIS + args + this.RIGHT_PARENTHESIS;\n }\n\n getExceptionalAccessTokenIfAny(node) {\n const leftSide = node.expression.text ?? node.expression.getFullText().trim();\n\n if (!leftSide) {\n return undefined;\n }\n\n if (this.propRequiresScopeResolutionOperator.includes(leftSide)) {\n return \"::\";\n }\n return undefined;\n }\n\n handleTypeOfInsideBinaryExpression(node, identation) {\n const left = node.left;\n const right = node.right.text;\n const op = node.operatorToken.kind;\n const expression = left.expression;\n\n const isDifferentOperator = op === SyntaxKind.ExclamationEqualsEqualsToken || op === SyntaxKind.ExclamationEqualsToken;\n const notOperator = isDifferentOperator ? this.NOT_TOKEN : \"\";\n\n const opComp = isDifferentOperator ? this.EXCLAMATION_EQUALS_EQUALS_TOKEN : this.EQUALS_EQUALS_EQUALS_TOKEN;\n\n switch (right) {\n case \"string\":\n return this.getIden(identation) + notOperator + \"is_string(\" + this.printNode(expression, 0) + \")\";\n case \"number\":\n return this.getIden(identation) + notOperator + \"(is_int(\" + this.printNode(expression, 0) + \") || is_float(\" + this.printNode(expression, 0) + \"))\";\n case \"boolean\":\n return this.getIden(identation) + notOperator + \"is_bool(\" + this.printNode(expression, 0) + \")\";\n case \"object\":\n return this.getIden(identation) + notOperator + \"is_array(\" + this.printNode(expression, 0) + \")\";\n case \"undefined\":\n return this.getIden(identation) + this.printNode(expression, 0) + \" \" + opComp + \" null\";\n }\n\n return undefined;\n\n }\n\n printCustomBinaryExpressionIfAny(node, identation) {\n const left = node.left;\n const right = node.right.text;\n\n const op = node.operatorToken.kind;\n\n if (left.kind === SyntaxKind.TypeOfExpression) {\n // handle typeof operator\n // Example: typeof a === \"string\"\n const typeOfExpression = this.handleTypeOfInsideBinaryExpression(node, identation);\n if (typeOfExpression) {\n return typeOfExpression;\n }\n }\n\n if (op === SyntaxKind.InKeyword) {\n const rightSide = this.printNode(node.right, 0);\n const leftSide = this.printNode(node.left, 0);\n return `${this.getIden(identation)}is_array(${rightSide}) && array_key_exists(${leftSide}, ${rightSide})`;\n }\n\n const prop = node?.left?.expression?.name?.text;\n\n if (prop) {\n const args = left.arguments;\n const parsedArg = (args && args.length > 0) ? this.printNode(args[0], 0): undefined;\n const leftSideOfIndexOf = left.expression.expression; // myString in myString.indexOf\n const leftSide = this.printNode(leftSideOfIndexOf, 0);\n const rightType = this.getChecker().getTypeAtLocation(leftSideOfIndexOf); // type of myString in myString.indexOf (\"b\") >= 0;\n switch(prop) {\n case 'indexOf':\n if (op === SyntaxKind.GreaterThanEqualsToken && right === '0') {\n this.warnIfAnyType(node, rightType.flags,leftSide, \"indexOf\");\n if (this.isStringType(rightType.flags)) {\n return this.getIden(identation) + \"mb_strpos(\" + leftSide + \", \" + parsedArg + \") !== false\";\n } else {\n return this.getIden(identation) + \"in_array(\" + parsedArg + \", \" + leftSide + \")\";\n }\n }\n }\n }\n return undefined;\n }\n\n printFunctionDeclaration(node, identation) {\n let functionDef = this.printFunctionDefinition(node, identation);\n const funcBody = this.printFunctionBody(node, identation);\n functionDef += funcBody;\n\n return this.printNodeCommentsIfAny(node, identation, functionDef);\n }\n\n printFunctionBody(node, identation) {\n\n if (this.asyncTranspiling && this.isAsyncFunction(node)) {\n const blockOpen = this.getBlockOpen(identation);\n const blockClose = this.getBlockClose(identation);\n\n const parsedArgs = node.parameters.map(param => this.printParameter(param, false)).join(\", \");\n const params = parsedArgs ? \" use (\" + parsedArgs + \")\" : \"\";\n\n const bodyStms = [...node.body.statements];\n const firstBodyStm = this.printNode(bodyStms[0], identation+2);\n bodyStms.shift();\n const funcBody = bodyStms.map((s) => this.printNode(s, identation+2)).join(\"\\n\");\n\n // reformat first comment\n const bodyParts = firstBodyStm.split(\"\\n\");\n const commentPart = bodyParts.filter(line => this.isComment(line));\n const isComment = commentPart.length > 0;\n let header = this.getIden(identation+1) + \"return Async\\\\async(function ()\" + params + \" {\\n\";\n if (isComment) {\n const commentPartString = commentPart.map((c) => this.getIden(identation+1) + c.trim()).join(\"\\n\");\n const firstStmNoComment = bodyParts.filter(line => !this.isComment(line)).join(\"\\n\");\n header = commentPartString + \"\\n\" + header + firstStmNoComment + \"\\n\";\n } else {\n header += firstBodyStm + \"\\n\";\n }\n\n const result = header\n + funcBody + \"\\n\"\n + this.getIden(identation+1) + \"}) ();\";\n\n return blockOpen + result + blockClose;\n }\n return super.printFunctionBody(node, identation);\n }\n\n printPropertyAccessModifiers(node) {\n const modifiers = super.printPropertyAccessModifiers(node);\n return modifiers ? modifiers : \"public \"; // default to public\n }\n\n transformLeadingComment(comment) {\n const commentRegex = [\n [ /\\{([\\]\\[\\|a-zA-Z0-9_-]+?)\\}/g, '~$1~' ], // eslint-disable-line -- resolve the \"arrays vs url params\" conflict (both are in {}-brackets)\n [ /\\[([^\\]\\[]*)\\]\\{(@link .*)\\}/g, '~$2 $1~' ], // eslint-disable-line -- docstring item with link\n [ /\\s+\\* @method/g, '' ], // docstring @method\n [ /(\\s+)\\* @description (.*)/g, '$1\\* $2' ], // eslint-disable-line\n [ /\\s+\\* @name .*/g, '' ], // docstring @name\n [ /(\\s+)\\* @returns/g, '$1\\* @return' ], // eslint-disable-line\n [ /\\~([\\]\\[\\|@\\.\\s+\\:\\/#\\-a-zA-Z0-9_-]+?)\\~/g, '{$1}' ], // eslint-disable-line -- resolve the \"arrays vs url params\" conflict (both are in {}-brackets)\n [ /(\\s+ \\* @(param|return) {[^}]*)object([^}]*}.*)/g, '$1array$3' ], // docstring type conversion\n ];\n\n const transformed = regexAll(comment, commentRegex);\n\n return transformed;\n }\n\n initConfig() {\n this.LeftPropertyAccessReplacements = {\n 'this': '$this',\n };\n\n this.RightPropertyAccessReplacements = {\n\n };\n\n this.FullPropertyAccessReplacements = {\n 'Number.MAX_SAFE_INTEGER': 'PHP_INT_MAX',\n 'JSON.stringify': 'json_encode',\n 'console.log': 'var_dump',\n 'process.exit': 'exit',\n 'Math.log': 'log',\n 'Math.abs': 'abs',\n 'Math.floor': '(int) floor',\n 'Math.ceil': '(int) ceil',\n 'Math.round': '(int) round',\n 'Math.pow': 'pow',\n 'Math.min': 'min',\n 'Math.max': 'max',\n // 'Promise.all': '\\\\React\\\\Promise\\\\all',\n };\n\n this.CallExpressionReplacements = {\n 'parseFloat': 'floatval',\n 'parseInt': 'intval',\n };\n\n this.PropertyAccessRequiresParenthesisRemoval = [\n // 'length',\n // 'toString',\n // 'toUpperCase',\n // 'toLowerCase',\n // 'pop',\n // 'reverse',\n // 'shift',\n ];\n }\n\n}\n","import { BaseTranspiler } from \"./baseTranspiler.js\";\nimport { SyntaxKind, type Node, type ParameterDeclaration } from 'typescript/unstable/ast';\nimport { IndexKind, TypeFlags, type Checker, type Symbol as TsSymbol, type UnionType } from 'typescript/unstable/sync';\nimport { isArrayLiteralExpression, isAsExpression, isBinaryExpression, isBlock, isBooleanLiteral, isBreakStatement, isCallExpression, isClassDeclaration, isClassExpression, isClassLikeDeclaration, isContinueStatement, isDeleteExpression, isElementAccessExpression, isExpressionStatement, isForStatement, isFunctionExpression, isIdentifier, isIfStatement, isMethodDeclaration, isNumericLiteral, isObjectLiteralExpression, isParameterDeclaration, isParenthesizedExpression, isPostfixUnaryExpression, isPrefixUnaryExpression, isPropertyAccessExpression, isPropertyDeclaration, isPropertySignatureDeclaration, isReturnStatement, isSourceFile, isSpreadAssignment, isSpreadElement, isStringLiteral, isStringLiteralLikeNode, isThrowStatement, isTypeAssertion, isVariableDeclaration, isWhileStatement } from 'typescript/unstable/ast/is';\nimport { findAncestor, getAllSuperTypeNodes, isFunctionLike } from './tsUtils.js';\n\nconst parserConfig = {\n 'ELSEIF_TOKEN': 'else if',\n 'OBJECT_OPENING': 'new Dictionary() {',\n 'ARRAY_OPENING_TOKEN': 'new List() {',\n 'ARRAY_CLOSING_TOKEN': '}',\n 'PROPERTY_ASSIGNMENT_TOKEN': ',',\n 'VAR_TOKEN': 'object', // object\n 'METHOD_TOKEN': '',\n 'PROPERTY_ASSIGNMENT_OPEN': '{',\n 'PROPERTY_ASSIGNMENT_CLOSE': '}',\n 'SUPER_TOKEN': 'base',\n 'SUPER_CALL_TOKEN': 'base',\n 'FALSY_WRAPPER_OPEN': 'isTrue(',\n 'FALSY_WRAPPER_CLOSE': ')',\n 'COMPARISON_WRAPPER_OPEN' : \"isEqual(\",\n 'COMPARISON_WRAPPER_CLOSE' : \")\",\n 'UKNOWN_PROP_WRAPPER_OPEN': 'this.call(',\n 'UNKOWN_PROP_WRAPPER_CLOSE': ')',\n 'UKNOWN_PROP_ASYNC_WRAPPER_OPEN': 'this.callAsync(',\n 'UNKOWN_PROP_ASYNC_WRAPPER_CLOSE': ')',\n 'DYNAMIC_CALL_OPEN': 'callDynamically(',\n 'EQUALS_EQUALS_WRAPPER_OPEN': 'isEqual(',\n 'EQUALS_EQUALS_WRAPPER_CLOSE': ')',\n 'DIFFERENT_WRAPPER_OPEN': '!isEqual(',\n 'DIFFERENT_WRAPPER_CLOSE': ')',\n 'GREATER_THAN_WRAPPER_OPEN': 'isGreaterThan(',\n 'GREATER_THAN_WRAPPER_CLOSE': ')',\n 'GREATER_THAN_EQUALS_WRAPPER_OPEN': 'isGreaterThanOrEqual(',\n 'GREATER_THAN_EQUALS_WRAPPER_CLOSE': ')',\n 'LESS_THAN_WRAPPER_OPEN': 'isLessThan(',\n 'LESS_THAN_WRAPPER_CLOSE': ')',\n 'LESS_THAN_EQUALS_WRAPPER_OPEN': 'isLessThanOrEqual(',\n 'LESS_THAN_EQUALS_WRAPPER_CLOSE': ')',\n 'PLUS_WRAPPER_OPEN':'add(',\n 'PLUS_WRAPPER_CLOSE':')',\n 'MINUS_WRAPPER_OPEN':'subtract(',\n 'MINUS_WRAPPER_CLOSE':')',\n 'ARRAY_LENGTH_WRAPPER_OPEN': 'getArrayLength(',\n 'ARRAY_LENGTH_WRAPPER_CLOSE': ')',\n 'DIVIDE_WRAPPER_OPEN': 'divide(',\n 'DIVIDE_WRAPPER_CLOSE': ')',\n 'MULTIPLY_WRAPPER_OPEN': 'multiply(',\n 'MULTIPLY_WRAPPER_CLOSE': ')',\n 'INDEXOF_WRAPPER_OPEN': 'getIndexOf(',\n 'INDEXOF_WRAPPER_CLOSE': ')',\n 'MOD_WRAPPER_OPEN': 'mod(',\n 'MOD_WRAPPER_CLOSE': ')',\n 'FUNCTION_TOKEN': '',\n 'INFER_VAR_TYPE': false,\n 'INFER_ARG_TYPE': false,\n};\n\n// C# static type of the value each printed helper returns. A local initialised by\n// one of these already holds that concrete type inside its `object` box, so naming\n// the type at the declaration site keeps the very same runtime value and only\n// refines what the C# compiler knows about it.\n\n// instance-style calls the printer rewrites unconditionally by method name\n// (`x.toUpperCase()` always prints `((string)x).ToUpper()`, whatever `x` is)\nconst CSHARP_METHOD_RETURN_TYPES: { [name: string]: string } = {\n 'toUpperCase': 'string',\n 'toLowerCase': 'string',\n 'toString': 'string',\n 'trim': 'string',\n 'join': 'string',\n 'replace': 'string',\n 'replaceAll': 'string',\n 'split': 'List',\n 'startsWith': 'bool',\n 'endsWith': 'bool',\n 'indexOf': 'int',\n 'search': 'int',\n};\n\n// `Object.keys(x)`, `Math.floor(x)`, ... — matched on the full callee text\nconst CSHARP_STATIC_RETURN_TYPES: { [name: string]: string } = {\n 'Object.keys': 'List',\n 'Object.values': 'List',\n 'Object.entries': 'List',\n 'JSON.stringify': 'string',\n 'Math.floor': 'double',\n 'Math.ceil': 'double',\n 'Math.round': 'double',\n 'Array.isArray': 'bool',\n 'Number.isInteger': 'bool',\n};\n\n// delegate-valued members of the hand-written C# base (cs/ccxt/base/Exchange.Options.cs):\n// `Func<...>` with this many parameters, so `this.(args)` with that arity is a direct\n// delegate invocation. `proxy` is a `string` there — not callable — and stays out.\nconst CSHARP_NATIVE_THIS_DELEGATE_ARITY: { [name: string]: number } = {\n 'proxyUrlCallback': 3,\n 'proxy_url_callback': 3,\n 'httpProxyCallback': 4,\n 'http_proxy_callback': 4,\n 'httpsProxyCallback': 4,\n 'https_proxy_callback': 4,\n 'socksProxyCallback': 3,\n 'socks_proxy_callback': 3,\n};\n\n// base-class helpers whose C# signature is already concrete\nconst CSHARP_THIS_RETURN_TYPES: { [name: string]: string } = {\n 'extend': 'Dictionary',\n 'deepExtend': 'Dictionary',\n 'indexBy': 'Dictionary',\n 'groupBy': 'Dictionary',\n 'milliseconds': 'Int64',\n 'seconds': 'Int64',\n 'microseconds': 'Int64',\n 'uuid': 'string',\n 'hmac': 'string',\n 'capitalize': 'string',\n 'ymdhms': 'string',\n 'yyyymmdd': 'string',\n 'json': 'string',\n 'inArray': 'bool',\n 'valueIsDefined': 'bool',\n // the safe* accessor family: cs/ccxt/base already declares these with a concrete\n // return type (`string? safeString(...)`, `Int64? safeInteger(...)`, `bool? safeBool(...)`,\n // `IDictionary safeDict(...)`, `List safeList(...)`, ...), so a\n // local initialised by one of them already holds that type inside its `object` box\n 'safeString': 'string?',\n 'safeString2': 'string?',\n 'safeStringN': 'string?',\n 'safeStringLower': 'string?',\n 'safeStringLower2': 'string?',\n 'safeStringLowerN': 'string?',\n 'safeStringUpper': 'string?',\n 'safeStringUpper2': 'string?',\n 'safeStringUpperN': 'string?',\n 'safeCurrencyCode': 'string?',\n 'safeInteger': 'Int64?',\n 'safeInteger2': 'Int64?',\n 'safeIntegerN': 'Int64?',\n 'safeIntegerProduct': 'Int64?',\n 'safeFloat': 'double?',\n 'safeFloat2': 'double?',\n 'safeFloatN': 'double?',\n 'safeNumberN': 'double?',\n 'safeBool': 'bool?',\n 'safeBool2': 'bool?',\n 'safeBoolN': 'bool?',\n 'safeDict': 'IDictionary',\n 'safeDict2': 'IDictionary',\n 'safeDictN': 'IDictionary',\n 'safeList': 'List',\n 'safeList2': 'List',\n 'safeListN': 'List',\n};\n\n// helpers whose C# signature is `object` (safeValue, getValue, parseInt, add,\n// slice, safeTimestamp, ...) are deliberately absent above: their box holds a value the printer\n// cannot name, so those locals stay `object`.\n\n// this.(...) base methods whose printed C# signature is a concrete numeric value the\n// tables above do not carry: `int precisionFromString(object)` (Exchange.Number.cs) and\n// `Int64? parseToInt(object)` (Exchange.BaseMethods.cs, retyped by the build layer)\nconst CSHARP_NATIVE_NUMERIC_THIS_KINDS: { [name: string]: string } = {\n 'precisionFromString': 'int',\n 'parseToInt': 'Int64?',\n};\n\n// the safe* accessor names of the table above: a local initialised by one of them gets the\n// extra sink guards of csharpLocalIsSafeToType (list-only methods, hard `(string)` casts,\n// the `+` LEFT operand overload rebinding)\nconst CSHARP_SAFE_ACCESSOR_NAMES = Object.keys(CSHARP_THIS_RETURN_TYPES).filter((name) => name.startsWith('safe'));\n\n// S62: calls whose C# signature is a hand-written `bool` (isTrue, isEqual, isGreaterThan, ...,\n// inOp in cs/ccxt/base/Exchange.TranspileHelpers.cs; emitted for the comparison operators, `in`\n// and TS `isTrue`) are already C# `bool`, so the condition printer's falsy wrapper is the identity.\nconst CSHARP_BOOLEAN_PRINTED_CALLS = [\n 'isTrue', 'isEqual', 'isGreaterThan', 'isGreaterThanOrEqual',\n 'isLessThan', 'isLessThanOrEqual', 'inOp',\n];\n\n// a transpiled parameter or local can literally be named `bool`, which would turn\n// `bool x = ...` into a reference to that value instead of the type. `string` and\n// `object` are already renamed by ReservedKeywordsReplacements.\nconst CSHARP_TYPE_NAMES = [ 'string', 'bool', 'int', 'long', 'Int64', 'double', 'object', 'List', 'IList', 'Dictionary', 'IDictionary', 'var' ];\n\n// joins a receiver's printed text with a literal key in the `key in recv` guard index\nconst GUARD_KEY_SEPARATOR = \"\\u0000\";\n\n// C# kinds a comparison can be printed natively on: the runtime isLessThan family compares two\n// boxes of one kind with the conversions the C# operator applies too. `double` keeps only\n// `>`/`>=` — the helper reads a NaN operand as \"less than\", a native comparison is false — and\n// only meets another `double`: its isEqual accepts an integral double as an integer.\nconst CSHARP_NUMERIC_KINDS = [ 'int', 'Int64', 'double' ];\n\n// numeric kinds a printed call result can carry (with the nullable spellings the safe*\n// accessors and parseToInt use), for the equality path only\nconst CSHARP_NUMERIC_VALUE_KINDS = [ 'int', 'Int64', 'Int64?', 'double', 'double?' ];\n\n// integer kinds the helper normalises to Int64 (normalizeIntIfNeeded), the same widening the\n// C# operator applies to an int next to a long, so a mixed pair prints the identical comparison\nconst CSHARP_INTEGER_KINDS = [ 'int', 'Int64' ];\n\nconst CSHARP_NATIVE_COMPARISON_TOKENS = {\n [SyntaxKind.LessThanToken]: '<',\n [SyntaxKind.GreaterThanToken]: '>',\n [SyntaxKind.LessThanEqualsToken]: '<=',\n [SyntaxKind.GreaterThanEqualsToken]: '>=',\n};\n\n// C# kinds where Math.Min/Max may replace mathMin/mathMax: the helper reads both boxes via\n// Convert.ToDouble and returns an ORIGINAL box, so only integer kinds give the same value in the\n// same box. `double` keeps the helper (Math.Min propagates NaN, and -0/+0 differ).\nconst CSHARP_MINMAX_NATIVE_KINDS = [ 'int', 'Int64' ];\n\n// every binary operator that writes its left operand (typescript6 has no First/LastAssignmentOperator\n// range to test against), used by the element-access loop guards below\nconst CSHARP_ASSIGNMENT_OPERATOR_KINDS = [\n SyntaxKind.EqualsToken,\n SyntaxKind.PlusEqualsToken,\n SyntaxKind.MinusEqualsToken,\n SyntaxKind.AsteriskEqualsToken,\n SyntaxKind.AsteriskAsteriskEqualsToken,\n SyntaxKind.SlashEqualsToken,\n SyntaxKind.PercentEqualsToken,\n SyntaxKind.LessThanLessThanEqualsToken,\n SyntaxKind.GreaterThanGreaterThanEqualsToken,\n SyntaxKind.GreaterThanGreaterThanGreaterThanEqualsToken,\n SyntaxKind.AmpersandEqualsToken,\n SyntaxKind.BarEqualsToken,\n SyntaxKind.CaretEqualsToken,\n SyntaxKind.BarBarEqualsToken,\n SyntaxKind.AmpersandAmpersandEqualsToken,\n SyntaxKind.QuestionQuestionEqualsToken,\n];\n\n// hand-written BaseExchange fields whose C# declaration already is a concrete\n// dictionary/list (cs/ccxt/base/Exchange.Options.cs): a read of the field carries\n// that static type, so its own members (`Count`, `ContainsKey`) replace the helper\nconst CSHARP_NATIVE_FIELDS: { [name: string]: string } = {\n 'options': 'ConcurrentDictionary',\n 'has': 'Dictionary',\n 'features': 'Dictionary',\n 'httpExceptions': 'Dictionary',\n 'markets_by_id': 'IDictionary',\n 'symbols': 'List',\n 'codes': 'List',\n 'ids': 'List',\n};\n\n// hand-written BaseExchange fields declared `object` that always box a dictionary\n// (dict / CustomConcurrentDictionary): the member needs the same\n// `(IDictionary)` cast the transpiled helper body itself applies\nconst CSHARP_OBJECT_DICT_FIELDS = [ 'urls', 'tickers', 'bidsasks', 'orderbooks', 'ohlcvs', 'trades', 'markets', 'currencies', 'currencies_by_id', 'exceptions' ];\n\n// Hand-written BaseExchange / PredictionExchange fields declared as C# reference types: the field\n// holds a reference box, so a null comparison is exactly the isEqual(field, null) branch. A\n// value-typed field keeps the helper — rateLimit is a `double` (its TS number type proves nothing).\nconst CSHARP_REFERENCE_FIELDS_NATIVE = [\n 'id', 'hostname', 'apiKey', 'secret', 'password', 'uid', 'accountId', 'login', 'privateKey',\n 'walletAddress', 'twofa', 'proxy', 'proxyUrl', 'proxy_url', 'proxyUrlCallback',\n 'proxy_url_callback', 'last_http_response', 'markets', 'markets_by_id', 'features', 'tickers',\n 'bidsasks', 'ohlcvs', 'trades', 'orders', 'myTrades', 'positions', 'liquidations', 'balance',\n 'accounts', 'currencies', 'currencies_by_id', 'outcomes', 'outcomes_by_id', 'events',\n 'events_by_slug', 'clients', 'ids', 'tokenBucket',\n];\n\n// hand-written BaseExchange fields declared `bool` (cs/ccxt/base/Exchange.Options.cs, e.g.\n// `public bool newUpdates;` / `public bool verbose { get; set; }`): a `this.` read is\n// already a C# bool, so a condition holding one needs no isTrue wrapper\nconst CSHARP_NATIVE_BOOL_FIELDS = [\n 'alias', 'certified', 'enableRateLimit', 'isSandboxModeEnabled', 'newUpdates', 'pro',\n 'reduceFees', 'reloadingMarkets', 'returnResponseHeaders', 'substituteCommonCurrencyCodes', 'verbose',\n];\n\n// Hand-written BaseExchange fields whose reads print natively although the key may be absent:\n// `has`/`options` are concrete dictionaries; `urls`, `markets`, `exceptions` are `object` boxes\n// that always hold one. The native read tests the key, so a missing key still reads null.\nconst CSHARP_MISSING_KEY_FIELDS_NATIVE = [ 'has', 'options', 'urls', 'markets', 'exceptions' ];\n\n// C# collection types this printer can name whose members replace the helpers\nconst CSHARP_NATIVE_COLLECTION_TYPES = [ 'List', 'IList', 'Dictionary', 'IDictionary' ];\n\n// C# types isEqual's own branches can compare an element with: the box an element read\n// yields is unboxed with `as`, which answers null for every other box\nconst CSHARP_SCALAR_ELEMENT_BOOL = 1;\nconst CSHARP_SCALAR_ELEMENT_STRING = 2;\n\n// C# dictionary types this printer can name on a local\nconst CSHARP_NATIVE_DICTIONARY_TYPES = [ 'Dictionary', 'IDictionary' ];\n\n// the row-receiver family of the cs-08 unit, extended by B-19 to the currency row: a read of a\n// local with one of these names the declared table proves is a dictionary prints natively.\n// Other receivers belong to their own units (cs-09 fields, cs-10 response/result/balance locals)\nconst CSHARP_NATIVE_MARKET_RECEIVERS = [ 'market', 'currency' ];\n\n// Callees hand-written in cs/ccxt/base returning non-nullable `bool` with no TS declaration to read\n// an annotation from: `isEmpty`, `isJsonEncodedObject`, `isBinaryMessage` and Precise's string\n// comparisons. Keyed on printed callee text, so a `callDynamically` rewrite never matches.\nconst CSHARP_BOOL_CALLEES_NATIVE: { [name: string]: boolean } = {\n 'this.isEmpty': true,\n 'this.isJsonEncodedObject': true,\n 'this.isBinaryMessage': true,\n 'Precise.stringGt': true,\n 'Precise.stringGe': true,\n 'Precise.stringLt': true,\n 'Precise.stringLe': true,\n 'Precise.stringEq': true,\n 'Precise.stringEquals': true,\n};\n\n// TS base methods the C# port hand-writes with its own signature: the TS annotation is `boolean`\n// but the C# method bound by `this.(...)` returns something else (`object isDictionary`),\n// so the isTrue wrapper must stay regardless of the annotation.\nconst CSHARP_HANDWRITTEN_CALLEES_NATIVE = [ 'isDictionary' ];\n\n// Declared C# types whose `Count` counts exactly what getArrayLength's IList / ICollection\n// branches count. A prefix test: these are named with element types (`List`,\n// `Dictionary`, ...) and every member of the family carries `Count`.\nconst CSHARP_COUNT_TYPES = [ 'List<', 'IList<', 'Dictionary<', 'IDictionary<', 'ConcurrentDictionary<' ];\n\n// ==== native parseInt / parseFloat / mod / prefix `-x` ====\n// These helpers' answers depend on the runtime type of their boxes. Each emission below replaces\n// the call only where the printer can name the exact value the helper returns; else keep helper.\n\n// the numeric literal spellings this printer re-reads: decimal digits with an optional fraction\n// (a hex or separator literal prints characters the C# compiler would read differently)\nconst CSHARP_DECIMAL_LITERAL = /^[0-9]+(\\.[0-9]+)?$/;\n\n// the C# source of a double literal holding exactly `value`: String() is the shortest\n// round-trip spelling, and a whole number needs a fraction or an exponent to stay a double\nfunction csharpDoubleLiteral(value) {\n if (!Number.isFinite(value)) {\n return undefined;\n }\n const text = String(value);\n return (text.indexOf('.') >= 0 || text.indexOf('e') >= 0) ? text : text + '.0';\n}\n\n// the numeric value of a literal operand: a plain literal or one under a unary minus\nfunction csharpLiteralNumericValue(node) {\n if (isNumericLiteral(node)) {\n return CSHARP_DECIMAL_LITERAL.test(node.text) ? Number(node.text) : undefined;\n }\n if (isPrefixUnaryExpression(node) && (node.operator === SyntaxKind.MinusToken) && isNumericLiteral(node.operand)\n && CSHARP_DECIMAL_LITERAL.test(node.operand.text)) {\n return -Number(node.operand.text);\n }\n return undefined;\n}\n\n// `parseInt()` boxes Convert.ToInt64(Math.Floor(Convert.ToDouble(a))): a digits-only\n// string reads as the same number in every culture, so both readings fold into one Int64 literal\nfunction csharpParseIntLiteralArgument(arg) {\n if (isStringLiteral(arg)) {\n if (!/^[0-9]+$/.test(arg.text)) {\n return undefined; // a sign, a point or an exponent is read with the CURRENT culture\n }\n const value = Number(arg.text);\n return Number.isSafeInteger(value) ? `${value}L` : undefined;\n }\n const numeric = csharpLiteralNumericValue(arg);\n if (numeric === undefined) {\n return undefined;\n }\n const floored = Math.floor(numeric);\n if (!Number.isSafeInteger(floored)) {\n return undefined;\n }\n return (floored < 0) ? `(${floored}L)` : `${floored}L`;\n}\n\n// `parseFloat()` boxes Convert.ToDouble(a, InvariantCulture): a plain decimal string\n// and a numeric literal both read as the nearest double, the value the literal spells\nfunction csharpParseFloatLiteralArgument(arg) {\n if (isStringLiteral(arg)) {\n return CSHARP_DECIMAL_LITERAL.test(arg.text) ? csharpDoubleLiteral(Number(arg.text)) : undefined;\n }\n const numeric = csharpLiteralNumericValue(arg);\n return (numeric === undefined) ? undefined : csharpDoubleLiteral(numeric);\n}\n\n// receivers the market-typed-local unit owns (market/currency rows); this printer's literal-key\n// read rule leaves them to that family and covers every other declared-collection local\nconst CSHARP_MARKET_RECEIVER_NAMES = [ 'market', 'currency' ];\n\n// Parameters of a method whose override chain the ts/src census cleared: every declaration (base\n// member + every override) maps to the same spelling AND every call site in the generated tree\n// passes a compatible argument, so the whole-language build stays green. The three surviving\nconst CSHARP_OVERRIDE_PARAM_TYPES: { [name: string]: { [index: number]: string } } = {\n ethRpc: { 2: 'IList' },\n parsePredictionOpenInterest: { 0: 'IDictionary' },\n signEvmTransaction: { 0: 'IDictionary' },\n};\n\n\n// a leading cast of the printed expression: `(IList)(x)` names the receiver's static type\nconst CSHARP_LENGTH_CAST = /^\\(([A-Za-z_][\\w.]*(?:<[^<>]*(?:<[^<>]*>)?[^<>]*>)?)\\)/;\n\n// U55: declaration types where `isEqual (x, null)` -> `x == null` is the same test: `T?` (`== null`\n// is `!x.HasValue`, the helper's `a == null` guard) and named reference types (reference compare).\n// `object`/`var` and non-nullable scalars are refused (`x == null` won't compile for Int64/bool).\nconst CSHARP_NULL_COMPARISON_REFERENCE_HEADS = [ 'string', 'IDictionary<', 'Dictionary<', 'IList<', 'List<', 'ConcurrentDictionary<', 'ccxt.pro.', 'ArrayCache', 'IOrderBook', 'Future', 'WebSocketClient', 'Delegates' ];\n\nexport class CSharpTranspiler extends BaseTranspiler {\n\n binaryExpressionsWrappers;\n // method node -> 'bool' | 'bool?' | undefined (see csharpBooleanReturnType)\n csharpBooleanReturnTypes = new WeakMap();\n // variable declaration -> getCSharpLocalType result, shared by the condition checks\n csharpLocalTypes = new WeakMap();\n // method node -> `key in recv` guards of that method, keyed by receiver text + key\n csharpGuardIndex = new WeakMap>();\n // optional proof of the concrete C# type of an expression, installed by the embedding build\n // layer for the locals it retypes itself (ccxt: build/csharp-local-types.js); it must\n // describe the same type the declaration is emitted with, or the operator will not compile\n csharpExpressionTypeResolver?: (node) => string | undefined;\n // optional proof of the C# type a LOCAL's declaration was emitted with, installed by the\n // embedding build layer for declarations it retyped itself; the member-access rules read it\n // only after this printer's own declared-local table declined\n csharpDeclaredLocalTypeResolver?: (declaration) => string | undefined;\n // variable declaration -> the concrete C# type this printer named for it\n // (getCSharpLocalType): 'List' / 'Dictionary' / 'string' / ...\n // Only declarations the printer typed itself are kept: the printed ` name = `\n // prefix is final, so every later read of the local is statically that type and its\n // members may replace inOp/getArrayLength\n csharpTypedLocals = new WeakMap();\n // ws handler `message` parameter -> the typed signature this printer prints for it (D-19)\n csharpHandlerMessageTypes = new WeakMap();\n // method declaration -> a static call reference exists (a call binds its arguments)\n csharpHandlerCalled = new WeakMap();\n // class declaration -> the class routes the raw message through a list test\n csharpListRouteClasses = new WeakMap();\n // source file -> method symbol -> a static call reference exists (built once per file: a\n // sticky batch program is shared by every file of the stage, so a program-keyed index\n // would answer for another venue's class)\n csharpHandlerCallIndex = new WeakMap>();\n // parameter node -> the type the printed signature gives it (printParameterType, e.g.\n // `Dict` -> Dictionary), recorded as the signature is printed. Read-only:\n // no printer rule consults it, see csharpPrintedParamType\n csharpParamTypes = new WeakMap();\n // declaration node -> C# type of the local ('' = the printer prints `object`); see\n // csharpStringReceiverType -- the ccxt classifier asks once per string-method receiver\n stringReceiverTypes = new WeakMap();\n // declaration node -> 'bool' | 'bool?' | '' (the printer cannot name it); see\n // csharpConditionOperandType — asked once per condition operand\n conditionOperandTypes = new WeakMap();\n\n constructor(config = {}) {\n config['parser'] = Object.assign ({}, parserConfig, config['parser'] ?? {});\n\n super(config);\n\n this.requiresParameterType = true;\n this.requiresReturnType = true;\n this.asyncTranspiling = true;\n this.implicitAsyncTranspiling = true;\n this.supportsFalsyOrTruthyValues = false;\n this.requiresCallExpressionCast = true;\n this.id = \"C#\";\n\n\n this.initConfig();\n\n // user overrides\n this.applyUserOverrides(config);\n }\n\n initConfig() {\n this.LeftPropertyAccessReplacements = {\n // 'this': '$this',\n };\n\n this.RightPropertyAccessReplacements = {\n 'push': 'Add', // list method\n 'indexOf': 'IndexOf', // list method\n 'toUpperCase': 'ToUpper',\n 'toLowerCase': 'ToLower',\n 'toString': 'ToString',\n };\n\n this.FullPropertyAccessReplacements = {\n 'JSON.parse': 'parseJson', // custom helper method\n 'console.log': 'Console.WriteLine',\n 'Number.MAX_SAFE_INTEGER': 'Int32.MaxValue',\n 'Math.min': 'Math.Min',\n 'Math.max': 'Math.Max',\n 'Math.log': 'Math.Log',\n 'Math.abs': 'Math.Abs',\n // 'Math.ceil': 'Math.Ceiling', // need cast\n // 'Math.round': 'Math.Round', // need to cast\n 'Math.floor': 'Math.Floor',\n 'Math.pow': 'Math.Pow',\n // 'Promise.all': 'Task.WhenAll',\n };\n\n this.CallExpressionReplacements = {\n // \"parseInt\": \"parseINt\",\n // \"parseFloat\": \"float.Parse\",\n };\n\n this.ReservedKeywordsReplacements = {\n 'string': 'str',\n 'object': 'obj',\n 'params': 'parameters',\n 'base': 'bs',\n 'internal': 'intern',\n 'event': 'eventVar',\n 'fixed': 'fixedVar',\n };\n\n this.VariableTypeReplacements = {\n 'string': 'string',\n 'Str': 'string',\n 'number': 'double',\n 'Int': 'Int64',\n 'Num': 'double',\n 'Dict': 'Dictionary',\n 'Strings': 'List',\n 'List': 'List',\n 'boolean': 'bool',\n };\n\n this.ArgTypeReplacements = { ...this.VariableTypeReplacements };\n\n this.binaryExpressionsWrappers = {\n [SyntaxKind.EqualsEqualsToken]: [this.EQUALS_EQUALS_WRAPPER_OPEN, this.EQUALS_EQUALS_WRAPPER_CLOSE],\n [SyntaxKind.EqualsEqualsEqualsToken]: [this.EQUALS_EQUALS_WRAPPER_OPEN, this.EQUALS_EQUALS_WRAPPER_CLOSE],\n [SyntaxKind.ExclamationEqualsToken]: [this.DIFFERENT_WRAPPER_OPEN, this.DIFFERENT_WRAPPER_CLOSE],\n [SyntaxKind.ExclamationEqualsEqualsToken]: [this.DIFFERENT_WRAPPER_OPEN, this.DIFFERENT_WRAPPER_CLOSE],\n [SyntaxKind.GreaterThanToken]: [this.GREATER_THAN_WRAPPER_OPEN, this.GREATER_THAN_WRAPPER_CLOSE],\n [SyntaxKind.GreaterThanEqualsToken]: [this.GREATER_THAN_EQUALS_WRAPPER_OPEN, this.GREATER_THAN_EQUALS_WRAPPER_CLOSE],\n [SyntaxKind.LessThanToken]: [this.LESS_THAN_WRAPPER_OPEN, this.LESS_THAN_WRAPPER_CLOSE],\n [SyntaxKind.LessThanEqualsToken]: [this.LESS_THAN_EQUALS_WRAPPER_OPEN, this.LESS_THAN_EQUALS_WRAPPER_CLOSE],\n [SyntaxKind.PlusToken]: [this.PLUS_WRAPPER_OPEN, this.PLUS_WRAPPER_CLOSE],\n [SyntaxKind.MinusToken]: [this.MINUS_WRAPPER_OPEN, this.MINUS_WRAPPER_CLOSE],\n [SyntaxKind.AsteriskToken]: [this.MULTIPLY_WRAPPER_OPEN, this.MULTIPLY_WRAPPER_CLOSE],\n [SyntaxKind.PercentToken]: [this.MOD_WRAPPER_OPEN, this.MOD_WRAPPER_CLOSE],\n [SyntaxKind.SlashToken]: [this.DIVIDE_WRAPPER_OPEN, this.DIVIDE_WRAPPER_CLOSE],\n };\n }\n\n getBlockOpen(identation){\n return \"\\n\" + this.getIden(identation) + this.BLOCK_OPENING_TOKEN + \"\\n\";\n }\n\n printSuperCallInsideConstructor(node, identation) {\n return \"\"; // csharp does not need super call inside constructor\n }\n\n // method node -> base-class method it overrides (null: none); see getMethodOverride\n csharpMethodOverrides = new WeakMap();\n // class declaration -> member name -> its LAST method of that name (base scan order)\n csharpClassMethodsByName = new WeakMap>();\n\n csharpMethodsByName(classDecl): Map {\n let byName = this.csharpClassMethodsByName.get(classDecl);\n if (byName === undefined) {\n byName = new Map();\n for (const elem of classDecl.members ?? []) {\n if (isMethodDeclaration(elem)) {\n byName.set(elem.name.getText().trim(), elem);\n }\n }\n this.csharpClassMethodsByName.set(classDecl, byName);\n }\n return byName;\n }\n\n // base getMethodOverride rescans every parent member with getText() on each call; the\n // printer asks per method several times, so memoize it (same walk, same result)\n getMethodOverride(node: Node): Node {\n if (node === undefined || !isClassDeclaration(node.parent) || !(node.parent as any).heritageClauses) {\n return undefined;\n }\n const cached = this.csharpMethodOverrides.get(node);\n if (cached !== undefined) {\n return cached ?? undefined;\n }\n let method = undefined;\n let parentClass = getAllSuperTypeNodes(node.parent)[0];\n while (parentClass !== undefined) {\n const parentClassDecl = this.getChecker().getTypeAtLocation(parentClass)?.getSymbol()?.valueDeclaration?.resolve();\n if (parentClassDecl === undefined) {\n this.warn(node, \"Parent class\", \"Parent class not found\");\n method = undefined;\n break;\n }\n method = this.csharpMethodsByName(parentClassDecl).get((node as any).name.text) ?? method;\n parentClass = getAllSuperTypeNodes(parentClassDecl)[0] ?? undefined;\n }\n this.csharpMethodOverrides.set(node, method ?? null);\n return method;\n }\n\n printIdentifier(node) {\n let idValue = node.text ?? node.text;\n\n if (this.ReservedKeywordsReplacements[idValue]) {\n idValue = this.ReservedKeywordsReplacements[idValue];\n }\n\n if (idValue === \"undefined\") {\n return this.UNDEFINED_TOKEN;\n }\n\n // check if it is a class declaration that we need to wrap arounf typeof\n // example: const x = Error -> var x = typeof(Error)\n const type = this.getChecker().getTypeAtLocation(node);\n const symbol = type?.getSymbol();\n if (symbol !== undefined) {\n // const declarations = (this.getChecker().getDeclaredTypeOfSymbol(symbol).getSymbol()?.declarations ?? []).map((d) => d.resolve());\n const decl = (symbol?.declarations ?? []).map((d) => d.resolve());\n let isBuiltIn = undefined;\n if (decl.length > 0) {\n isBuiltIn = decl[0].getSourceFile().fileName.indexOf('typescript') > -1; //very hacky find a better solution later\n }\n\n if (isBuiltIn !== undefined && !isBuiltIn) {\n // const isClassDeclaration = declarations.find(l => l.kind === SyntaxKind.ClassDeclaration);\n const isInsideNewExpression = node?.parent?.kind === SyntaxKind.NewExpression;\n const isInsideCatch = node?.parent?.kind === SyntaxKind.ThrowStatement;\n const isLeftSide = node?.parent?.name === node || (node?.parent?.left === node);\n const isCallOrPropertyAccess = node?.parent?.kind === SyntaxKind.PropertyAccessExpression || node?.parent?.kind === SyntaxKind.ElementAccessExpression;\n if (!isLeftSide && !isCallOrPropertyAccess && !isInsideCatch && !isInsideNewExpression) {\n // return `typeof(${idValue})`; // this is not working as expected\n // for instance\n // const instance = new x();\n // const b = instance;\n // gets transpiled to\n // var instance = typeof(x);\n const symbol = this.getChecker().getSymbolAtLocation(node);\n let isClassDeclaration = false;\n if (symbol) {\n const first = symbol.declarations[0].resolve();\n if (first.kind === SyntaxKind.ClassDeclaration) {\n isClassDeclaration = true;\n }\n if (first.kind === SyntaxKind.ImportSpecifier) {\n const importedSymbol = this.getChecker().getAliasedSymbol(symbol);\n if (importedSymbol?.declarations[0]?.resolve()?.kind === SyntaxKind.ClassDeclaration) {\n isClassDeclaration = true;\n }\n }\n }\n // console.log(node.getText(), 'isClass declaration', isClass);\n if (isClassDeclaration) {\n return `typeof(${idValue})`;\n // this does not work then the class is imported from another file because\n // the type is not resolved correctly and the symbol declaration is simply a importSpecifier\n // we would need to find a way to get the type from the importSpecifier\n // by loading the entire code upon transpiling the ts file\n }\n }\n }\n }\n\n return this.transformIdentifier(node, idValue); // check this later\n }\n\n printConstructorDeclaration (node, identation) {\n const classNode = node.parent;\n const className = this.printNode(classNode.name, 0);\n const args = this.printMethodParameters(node);\n const constructorBody = this.printFunctionBody(node, identation);\n\n // find super call inside constructor and extract params\n let superClause = '';\n node.body?.statements.forEach(statement => {\n if (isExpressionStatement(statement)) {\n const expression = statement.expression;\n if (isCallExpression(expression)) {\n const expressionText = expression.expression.getText().trim();\n if (expressionText === 'super') {\n const superCallParams = expression.arguments.map((a) => {\n return this.printNode(a, identation).trim();\n }).join(\", \");\n superClause = ` : ${this.SUPER_CALL_TOKEN}(${superCallParams})`;\n }\n }\n }\n });\n\n return this.getIden(identation) + className + `(${args})` + superClause + constructorBody;\n }\n\n printDynamicCall(node, identation) {\n const elementAccess = node.expression;\n if (elementAccess?.kind === SyntaxKind.ElementAccessExpression) {\n const parsedArg = node.arguments.map(n => this.printNode(n, identation).trimStart()).join(\", \");\n const target = this.printNode(elementAccess.expression, 0);\n const propName = this.printNode(elementAccess.argumentExpression, 0);\n // always typed as async: the caller cannot tell whether the dynamic target is\n return `((Task)${this.DYNAMIC_CALL_OPEN}${target}, ${propName}, new object[] { ${parsedArg} }))`;\n }\n return undefined;\n }\n\n\n // The C# declared type of an expression's receiver (`request` in `request[\"k\"] = v`), as\n // the consumer's classifier knows it — ccxt's build/csharp-local-types.js overrides this\n // with its scope-aware local map. Undefined on an unpatched printer\n csharpDeclaredReceiverType(node): string | undefined {\n return undefined; // stub to override\n }\n\n // The C# type the printed SIGNATURE gives a parameter (`Dictionary` for `Dict`,\n // `object` when unnamed), recorded while printing so a body use can ask. Read-only: no printer\n // rule consults it; only the consumer's csharpDeclaredReceiverType override changes emission.\n csharpPrintedParamType(receiver): string | undefined {\n const declaration = this.csharpReceiverBinding(receiver);\n if (declaration?.kind !== SyntaxKind.Parameter) {\n return undefined;\n }\n const recorded = this.csharpParamTypes.get(declaration);\n return ((recorded === undefined) || (recorded === '') || (recorded === 'object')) ? undefined : recorded;\n }\n\n // A receiver whose declared C# type the consumer's classifier names as a concrete dictionary:\n // the `((IDictionary)x)` cast around element access is an identity conversion.\n // Gated entirely on the consumer's hook, so an object receiver and untyped runs keep the cast.\n csharpReceiverIsDeclaredDictionary(expression): boolean {\n const declared = this.csharpDeclaredReceiverType(expression);\n return (declared === 'Dictionary') || (declared === 'IDictionary');\n }\n\n // A dict element WRITE (`request[\"k\"] = v`) on a receiver whose *declared* C# type is already a\n // dictionary needs no `((IDictionary)…)` cast: both indexers are the same setter.\n // Gated entirely on csharpDeclaredReceiverType, so object receivers and untyped runs keep the cast.\n csharpDictionaryElementWriteTarget(node): string | undefined {\n const parent = node?.parent;\n // `request[\"k\"] += v` keeps the cast: only the plain assignment was audited\n const isWrite = parent?.kind === SyntaxKind.BinaryExpression\n && parent.operatorToken.kind === SyntaxKind.EqualsToken\n && parent.left === node;\n if (!isWrite || !this.ELEMENT_ACCESS_WRAPPER_OPEN || !this.ELEMENT_ACCESS_WRAPPER_CLOSE) {\n return undefined;\n }\n const { expression, argumentExpression } = node;\n if (!this.csharpReceiverIsDeclaredDictionary(expression)) {\n return undefined;\n }\n // the interface cast also carries the string-key proof; only a string key (or a union\n // holding one, the shape the index-signature key type reports) may stay cast-less\n const keyType = this.getChecker().getTypeAtLocation(argumentExpression);\n const members = (keyType.flags === TypeFlags.Union) ? ((keyType as any).getTypes() ?? [keyType]) : [keyType];\n const stringKey = (keyType.flags === TypeFlags.Any) || members.some((t) => this.isStringType(t.flags));\n if (!stringKey) {\n return undefined;\n }\n const cast = isStringLiteralLikeNode(argumentExpression) ? '' : '(string)';\n return this.printNode(expression, 0) + '[' + cast + this.printNode(argumentExpression, 0) + ']';\n }\n\n printElementAccessExpressionExceptionIfAny(node) {\n // convert this[method] into this.call(method) or this.callAsync(method)\n // if (node?.expression?.kind === SyntaxKind.ThisKeyword) {\n // const isAsyncDecl = node?.parent?.kind === SyntaxKind.AwaitExpression;\n // const open = isAsyncDecl ? this.UKNOWN_PROP_ASYNC_WRAPPER_OPEN : this.UKNOWN_PROP_WRAPPER_OPEN;\n // return open.replace('(', '');\n // }\n }\n\n // reads print getValue(recv, key), which yields null for a missing key; a C# indexer\n // throws instead, so the native form is only emitted where the source guarantees the key\n // is there: a dominating `key in recv` guard, or a receiver local built by a literal that\n // declares the key, or a receiver the declared table proves is a dictionary (the native\n // form then keeps the helper's null-for-a-missing-key result). every other read keeps the\n // helper.\n // the single element-access override, gates strongest (declaration-type) proof first:\n // S21 typed dict WRITE (csharpDictionaryElementWriteTarget), S63 typed dict READ twin\n // (printTypedDictElementAccessIfAny), S14 list-cast (csharpElementAccessReceiverIsList),\n // then the native read form proven from the printed source (#82, csharpNativeElementAccess,\n // see the note above). Every other read keeps the helper; a site no gate names keeps the\n // base printing.\n printElementAccessExpression(node, identation) {\n const native = this.csharpNativeElementAccess(node);\n if (native !== undefined) {\n return native;\n }\n const dictWrite = this.csharpDictionaryElementWriteTarget(node);\n if (dictWrite !== undefined) {\n return dictWrite;\n }\n const typedRead = this.printTypedDictElementAccessIfAny(node);\n if (typedRead !== undefined) {\n return typedRead;\n }\n if (this.csharpElementAccessReceiverIsList(node)) {\n const type = this.getChecker().getTypeAtLocation(node.argumentExpression);\n const isUnion = ((type.flags & TypeFlags.Union) !== 0) && Array.isArray((type as any).getTypes());\n // the base printer's own key dispatch, plus the union spelling the worker\n // handles: a string (or type-less) key is a dictionary element, never a list\n // index, and keeps the IDictionary cast\n const isStringOrUnknownKey = this.isStringType(type.flags)\n || (type.flags === TypeFlags.Any)\n || (isUnion && (type as any).getTypes().some((t) => this.isStringType(t.flags)));\n if (!isStringOrUnknownKey) {\n return `${this.printNode(node.expression, 0)}[Convert.ToInt32(${this.printNode(node.argumentExpression, 0)})]`;\n }\n }\n const listRead = this.csharpListIndexRead(node);\n if (listRead !== undefined) {\n return listRead;\n }\n return super.printElementAccessExpression(node, identation);\n }\n\n csharpNativeElementAccess(node): string | undefined {\n if (!this.ELEMENT_ACCESS_WRAPPER_OPEN || !this.ELEMENT_ACCESS_WRAPPER_CLOSE) {\n return undefined;\n }\n const exception: any = this.printElementAccessExpressionExceptionIfAny(node);\n if (exception) {\n return undefined; // the exception printing wins over the native form\n }\n const { expression, argumentExpression } = node;\n const parent = node.parent;\n const isWrite = parent?.kind === SyntaxKind.BinaryExpression &&\n (parent.operatorToken.kind === SyntaxKind.EqualsToken || parent.operatorToken.kind === SyntaxKind.PlusEqualsToken) &&\n parent.left === node;\n if (isWrite) {\n return undefined; // writes are native already, they are printed with the cast\n }\n const isStringKey = isStringLiteralLikeNode(argumentExpression);\n const isNumberKey = isNumericLiteral(argumentExpression);\n if (!isStringKey && !isNumberKey) {\n return this.csharpLoopIndexListRead(expression, argumentExpression); // counter proven in range by its loop\n }\n const key = (argumentExpression as any).text;\n const builtFromLiteral = this.csharpLiteralDeclaresKey(node, expression, key, isNumberKey);\n const guarded = !builtFromLiteral && this.csharpKeyPresenceGuarded(node, expression, key);\n if (!builtFromLiteral && !guarded) {\n return this.csharpNativeDeclaredDictionaryRead(expression, argumentExpression)\n ?? this.csharpDeclaredLocalResolverRowRead(expression, argumentExpression)\n ?? this.csharpDeclaredCollectionRead(node, expression, argumentExpression, isStringKey, isNumberKey)\n ?? this.csharpProvenDictionaryRead(node, expression, argumentExpression, isStringKey)\n ?? this.csharpMissingKeyFieldRead(expression, argumentExpression, isStringKey);\n }\n const receiver = this.printNode(expression, 0);\n const printedKey = this.printNode(argumentExpression, 0);\n if (isNumberKey) {\n return `((${this.ARRAY_KEYWORD})${receiver})[${printedKey}]`;\n }\n // a receiver the classifier already declared a concrete dictionary keeps its own\n // indexer: the interface cast named the box, never a conversion\n if (this.csharpReceiverIsDeclaredDictionary(expression)) {\n return `${receiver}[${printedKey}]`;\n }\n return `((IDictionary)${receiver})[${printedKey}]`;\n }\n\n // `getValue (market, \"lit\")` / `getValue (currency, \"lit\")` on a row local the declared\n // table proves is a C# dictionary: the native form tests the key, so a missing key still\n // reads null exactly like the helper. An untyped receiver keeps the helper.\n csharpIsMarketRowKeyRead(expression, argumentExpression): boolean {\n return isIdentifier(expression) && isStringLiteralLikeNode(argumentExpression)\n && CSHARP_NATIVE_MARKET_RECEIVERS.indexOf(expression.text as string) >= 0;\n }\n\n csharpNativeDeclaredDictionaryRead(expression, argumentExpression): string | undefined {\n if (!this.csharpIsMarketRowKeyRead(expression, argumentExpression)) {\n return undefined;\n }\n if (this.csharpDeclaredDictionaryType(expression) === undefined) {\n return undefined;\n }\n const receiver = this.printNode(expression, 0);\n const printedKey = this.printNode(argumentExpression, 0);\n return `(${receiver}.ContainsKey(${printedKey}) ? ${receiver}[${printedKey}] : null)`;\n }\n\n // the C# dictionary type the declared table names for a local read, or undefined: the\n // printer's own table, then the build layer's read proof (the row a market/currency builder\n // returned; never null on any path)\n csharpDeclaredDictionaryType(node): string | undefined {\n if (node?.kind !== SyntaxKind.Identifier) {\n return undefined;\n }\n const named = this.csharpTypedLocalType(node) ?? this.csharpExpressionTypeOf(node);\n if (named === undefined || CSHARP_NATIVE_DICTIONARY_TYPES.indexOf(named) < 0) {\n return undefined;\n }\n return named;\n }\n\n // the type the embedding build layer recorded for the declaration behind a read\n // (csharpDeclaredLocalTypeResolver): the declarations it retyped itself, i.e. the parameters\n // and locals whose printed prefix is no longer what the printer's own tables say\n csharpDeclaredLocalResolverType(node): string | undefined {\n if (typeof this.csharpDeclaredLocalTypeResolver !== 'function') {\n return undefined;\n }\n const checker: any = this.checkerOrUndefined();\n if (checker === undefined) {\n return undefined;\n }\n const declaration = checker.getSymbolAtLocation(node)?.valueDeclaration?.resolve();\n if (declaration === undefined) {\n return undefined;\n }\n const recorded = this.csharpDeclaredLocalTypeResolver(declaration);\n return (typeof recorded === 'string') ? recorded : undefined;\n }\n\n // the same read for a receiver only the build layer's declared-local resolver names (a\n // parameter B-17 retyped): its box may still be null, so the read carries the helper's\n // own `value2 == null -> null` branch as a null test\n csharpDeclaredLocalResolverRowRead(expression, argumentExpression): string | undefined {\n if (!this.csharpIsMarketRowKeyRead(expression, argumentExpression)) {\n return undefined;\n }\n const recorded = this.csharpDeclaredLocalResolverType(expression);\n if (recorded === undefined || CSHARP_NATIVE_DICTIONARY_TYPES.indexOf(recorded) < 0) {\n return undefined;\n }\n const receiver = this.printNode(expression, 0);\n const printedKey = this.printNode(argumentExpression, 0);\n return `(${receiver} != null && ${receiver}.ContainsKey(${printedKey}) ? ${receiver}[${printedKey}] : null)`;\n }\n\n // a read of a hand-written BaseExchange dictionary field whose key may be absent: the key\n // test plus the indexer print what the helper computes, so a missing key still reads null\n // (a bare indexer would throw). Any other receiver or a numeric key keeps the helper\n csharpMissingKeyFieldRead(expression, argumentExpression, isStringKey): string | undefined {\n if (!isStringKey) {\n return undefined;\n }\n if (!isPropertyAccessExpression(expression) || expression.expression.kind !== SyntaxKind.ThisKeyword) {\n return undefined;\n }\n const name = expression.name?.text as string;\n if (CSHARP_MISSING_KEY_FIELDS_NATIVE.indexOf(name) < 0) {\n return undefined;\n }\n const field = this.printNode(expression, 0);\n const printedKey = this.printNode(argumentExpression, 0);\n // `urls`/`markets`/`exceptions` are declared `object`: same cast and null-receiver branch as the\n // transpiled helper body (initializeProperties may leave the box null when describe() has no such\n // row). `has`/`options` are concrete dictionaries, never null, so they need no test.\n if (CSHARP_OBJECT_DICT_FIELDS.indexOf(name) >= 0) {\n const receiver = `((IDictionary)${field})`;\n return `(${field} != null && ${receiver}.ContainsKey(${printedKey}) ? ${receiver}[${printedKey}] : null)`;\n }\n return `(${field}.ContainsKey(${printedKey}) ? ${field}[${printedKey}] : null)`;\n }\n\n // A literal-key read on a local whose C# declaration is already a collection: no cast needed, but\n // the indexer throws where GetValue answers null, so the native form carries the helper's key/index\n // and null-receiver tests. Only an Identifier qualifies (its text is read up to three times).\n csharpDeclaredCollectionRead(node, expression, argumentExpression, isStringKey, isNumberKey): string | undefined {\n if (!isIdentifier(expression)) {\n return undefined;\n }\n if (CSHARP_MARKET_RECEIVER_NAMES.indexOf(expression.text as string) >= 0) {\n return undefined;\n }\n const csharpType = this.csharpDeclaredCollectionType(expression);\n if (csharpType === undefined) {\n return undefined;\n }\n const func = this.csharpEnclosingFunction(node);\n if (func === undefined || this.csharpReceiverIsRewritten(func, expression)) {\n return undefined; // a reassigned receiver is not the object the declared type describes\n }\n const receiver = this.printNode(expression, 0);\n if (csharpType.indexOf('Dictionary<') >= 0) {\n if (!isStringKey) {\n return undefined; // the helper reads a dictionary key as a string, a literal index has no native twin\n }\n const printedKey = this.printNode(argumentExpression, 0);\n return `(${receiver} != null && ${receiver}.ContainsKey(${printedKey}) ? ${receiver}[${printedKey}] : null)`;\n }\n if (isNumberKey) {\n const index = Number((argumentExpression as any).text);\n if (!Number.isInteger(index) || (index < 0)) {\n return undefined; // the helper throws on a negative index too, but never prints one itself\n }\n return `(${receiver} != null && ${index} < ${receiver}.Count ? ${receiver}[${index}] : null)`;\n }\n return undefined;\n }\n\n // The C# collection type a local read was DECLARED with: printed by this printer, or recorded by\n // embedding build layer for a declaration it retyped (csharpDeclaredLocalTypeResolver). The\n // value-type oracle does not qualify: the declaration may still be `object` and not compile.\n csharpDeclaredCollectionType(expression): string | undefined {\n const named = this.csharpTypedLocalType(expression);\n if (named !== undefined && CSHARP_NATIVE_COLLECTION_TYPES.indexOf(named) >= 0) {\n return named;\n }\n if (this.csharpDeclaredLocalTypeResolver === undefined) {\n return undefined;\n }\n const declaration = this.getChecker().getSymbolAtLocation(expression)?.valueDeclaration?.resolve();\n if (declaration === undefined) {\n return undefined;\n }\n const recorded = this.csharpDeclaredLocalTypeResolver(declaration);\n return (recorded !== undefined && CSHARP_NATIVE_COLLECTION_TYPES.indexOf(recorded) >= 0) ? recorded : undefined;\n }\n\n // A literal-key read on a local still declared `object` but whose box the build layer's value-type\n // oracle (build/csharp-local-types.js) proves a dictionary: the cast makes the read compile, and\n // key test plus null guard return exactly what the helper does. Sibling arms are filtered first.\n csharpProvenDictionaryRead(node, expression, argumentExpression, isStringKey): string | undefined {\n if (!isStringKey || !isIdentifier(expression)) {\n return undefined;\n }\n if (CSHARP_MARKET_RECEIVER_NAMES.indexOf(expression.text as string) >= 0) {\n return undefined;\n }\n if (this.csharpTypedLocalType(expression) !== undefined) {\n return undefined; // the declaration this printer wrote names its own type (see above)\n }\n const proven = this.csharpExpressionTypeOf(expression);\n if (proven === undefined || CSHARP_NATIVE_DICTIONARY_TYPES.indexOf(proven) < 0) {\n return undefined; // only a proven dictionary box has the members the read binds\n }\n const func = this.csharpEnclosingFunction(node);\n if (func === undefined || this.csharpReceiverIsRewritten(func, expression)) {\n return undefined; // a reassigned receiver may hold another box at this read\n }\n const local = this.printNode(expression, 0);\n const receiver = `((IDictionary)${local})`;\n const printedKey = this.printNode(argumentExpression, 0);\n return `(${local} != null && ${receiver}.ContainsKey(${printedKey}) ? ${receiver}[${printedKey}] : null)`;\n }\n\n // the read sits in a branch that a `key in recv` guard admitted: same then-branch as the\n // guard, the else-branch of a negated guard, or after an early-exiting `if (!(key in recv))`\n csharpKeyPresenceGuarded(node, expression, key): boolean {\n const func = this.csharpEnclosingFunction(node);\n if (func === undefined) {\n return false;\n }\n const guards = this.csharpInGuardsOf(func).get(expression.getText() + GUARD_KEY_SEPARATOR + key);\n if (guards === undefined || !this.csharpReceiverIsDictionaryLike(expression, key)) {\n return false;\n }\n if (this.csharpReceiverIsRewritten(func, expression)) {\n return false; // a reassigned receiver is not the object the guard inspected\n }\n if (this.csharpHasKeyRemoval(func, expression, key)) {\n return false; // delete could have removed the guarded key\n }\n return guards.some((guard) => this.csharpGuardAdmitsRead(guard, node));\n }\n\n // `recv[i]` where `i` is the counter of an enclosing `for (...; i < recv.length; ...)`: that\n // condition is the range proof, so the helper's out-of-range null branch is unreachable. Both\n // operands must print as the indexer's C# types (object-element list, `int`); else keep the helper.\n csharpLoopIndexListRead(expression, argumentExpression): string | undefined {\n if (!isIdentifier(expression) || !isIdentifier(argumentExpression)) {\n return undefined;\n }\n const receiverType = this.csharpExpressionTypeOf(expression);\n if (receiverType === undefined || !this.csharpTypeIsList(receiverType)) {\n return undefined;\n }\n if (this.csharpExpressionTypeOf(argumentExpression) !== 'int') {\n return undefined; // a boxed/Int64/double index does not bind the List indexer\n }\n const loop = this.csharpCounterRangeLoop(argumentExpression, expression);\n if (loop === undefined) {\n return undefined;\n }\n if (!this.csharpCounterUnwrittenIn(loop.statement, argumentExpression) ||\n !this.csharpReceiverIntactIn(loop.statement, expression)) {\n return undefined; // the bound the header proved no longer holds at this read\n }\n return `${this.printNode(expression, 0)}[${this.printNode(argumentExpression, 0)}]`;\n }\n\n // the enclosing `for` whose condition is ` < .length` and whose header declares\n // that counter: the condition held on entry to this pass and nothing in between moved off it\n csharpCounterRangeLoop(counter, receiver) {\n let node: any = counter;\n while (node.parent !== undefined) {\n const parent: any = node.parent;\n if (isFunctionLike(parent)) {\n return undefined; // a closure runs when the counter may already have moved on\n }\n if (isForStatement(parent) && this.csharpContains(parent.statement, counter) && this.csharpForBoundsCounter(parent, counter, receiver)) {\n return parent;\n }\n node = parent;\n }\n return undefined;\n }\n\n csharpForBoundsCounter(loop, counter, receiver): boolean {\n const condition = this.csharpUnparenthesized(loop.condition);\n if (condition?.kind !== SyntaxKind.BinaryExpression || condition.operatorToken.kind !== SyntaxKind.LessThanToken) {\n return false;\n }\n const left = this.csharpUnparenthesized(condition.left);\n const right = this.csharpUnparenthesized(condition.right);\n if (!isIdentifier(left) || !isPropertyAccessExpression(right) || right.name?.text !== 'length') {\n return false;\n }\n const receiverExpression = this.csharpUnparenthesized(right.expression);\n if (!isIdentifier(receiverExpression) || !this.csharpCounterStartsAtZero(loop, counter) || !this.csharpCounterAdvances(loop, counter)) {\n return false;\n }\n const declaration = this.getChecker().getSymbolAtLocation(counter)?.valueDeclaration?.resolve();\n const checker = this.getChecker();\n return declaration !== undefined &&\n checker.getSymbolAtLocation(left)?.valueDeclaration?.resolve() === declaration &&\n checker.getSymbolAtLocation(receiverExpression)?.valueDeclaration?.resolve() === checker.getSymbolAtLocation(receiver)?.valueDeclaration?.resolve();\n }\n\n // `for (let i = = 0>; ...)` — a negative start would index below the list\n csharpCounterStartsAtZero(loop, counter): boolean {\n const initializer: any = loop.initializer;\n if (initializer?.kind !== SyntaxKind.VariableDeclarationList || initializer.declarations.length !== 1) {\n return false;\n }\n const declaration: any = initializer.declarations[0];\n if (!isIdentifier(declaration.name) || !isNumericLiteral(declaration.initializer)) {\n return false;\n }\n return Number(declaration.initializer.text) >= 0 && this.getChecker().getSymbolAtLocation(counter)?.valueDeclaration?.resolve() === declaration;\n }\n\n // the header moves the counter forward: a decrement could leave a negative index behind\n csharpCounterAdvances(loop, counter): boolean {\n const declaration = this.getChecker().getSymbolAtLocation(counter)?.valueDeclaration?.resolve();\n const incrementor: any = this.csharpUnparenthesized(loop.incrementor);\n if (incrementor === undefined || declaration === undefined) {\n return false;\n }\n if (incrementor.kind === SyntaxKind.PostfixUnaryExpression || incrementor.kind === SyntaxKind.PrefixUnaryExpression) {\n return incrementor.operator === SyntaxKind.PlusPlusToken &&\n this.getChecker().getSymbolAtLocation(incrementor.operand)?.valueDeclaration?.resolve() === declaration;\n }\n if (incrementor.kind === SyntaxKind.BinaryExpression && incrementor.operatorToken.kind === SyntaxKind.PlusEqualsToken) {\n return this.getChecker().getSymbolAtLocation(incrementor.left)?.valueDeclaration?.resolve() === declaration &&\n isNumericLiteral(incrementor.right) && Number(incrementor.right.text) >= 0;\n }\n return false;\n }\n\n // a write to the counter in the body invalidates the bound the condition proved\n csharpCounterUnwrittenIn(range, counter): boolean {\n const declaration = this.getChecker().getSymbolAtLocation(counter)?.valueDeclaration?.resolve();\n if (declaration === undefined) {\n return false;\n }\n let written = false;\n this.csharpWalkIdentifiers(range, (identifier: any) => {\n if (written || !this.csharpIsSameDeclaration(identifier, declaration)) {\n return;\n }\n const parent: any = identifier.parent;\n if (isBinaryExpression(parent) && parent.left === identifier) {\n written = CSHARP_ASSIGNMENT_OPERATOR_KINDS.indexOf(parent.operatorToken.kind) >= 0;\n } else {\n written = ((isPrefixUnaryExpression(parent) || isPostfixUnaryExpression(parent)) && parent.operand === identifier)\n || isDeleteExpression(parent);\n }\n });\n return !written;\n }\n\n // the condition's `.length` still proves the range only while the list is intact: inside\n // the body the receiver may be read (element reads, its own `.length`) and nothing else\n csharpReceiverIntactIn(range, receiver): boolean {\n const declaration = this.getChecker().getSymbolAtLocation(receiver)?.valueDeclaration?.resolve();\n if (declaration === undefined) {\n return false;\n }\n let intact = true;\n this.csharpWalkIdentifiers(range, (identifier: any) => {\n if (!intact || !this.csharpIsSameDeclaration(identifier, declaration)) {\n return;\n }\n const parent: any = identifier.parent;\n if (isPropertyAccessExpression(parent) && parent.expression === identifier && parent.name?.text === 'length') {\n return;\n }\n if (isElementAccessExpression(parent) && parent.expression === identifier && !this.csharpIsWriteTarget(parent)) {\n return;\n }\n intact = false;\n });\n return intact;\n }\n\n csharpIsSameDeclaration(identifier, declaration): boolean {\n return this.getChecker().getSymbolAtLocation(identifier)?.valueDeclaration?.resolve() === declaration;\n }\n\n csharpWalkIdentifiers(node, visit) {\n if (node === undefined) {\n return;\n }\n if (isIdentifier(node)) {\n visit(node);\n }\n node.forEachChild((child: any) => this.csharpWalkIdentifiers(child, visit));\n }\n\n // `x[i] = v` / `x[i]++` / `delete x[i]` change the receiver in place\n csharpIsWriteTarget(node): boolean {\n let value: any = node;\n while (value.parent !== undefined && isParenthesizedExpression(value.parent)) {\n value = value.parent;\n }\n const parent: any = value.parent;\n if (parent === undefined) {\n return false;\n }\n if (isBinaryExpression(parent) && parent.left === value) {\n return CSHARP_ASSIGNMENT_OPERATOR_KINDS.indexOf(parent.operatorToken.kind) >= 0;\n }\n if ((isPrefixUnaryExpression(parent) || isPostfixUnaryExpression(parent)) && parent.operand === value) {\n return (parent.operator === SyntaxKind.PlusPlusToken) || (parent.operator === SyntaxKind.MinusMinusToken);\n }\n return isDeleteExpression(parent);\n }\n\n csharpUnparenthesized(node) {\n let value: any = node;\n while (value !== undefined && value.kind === SyntaxKind.ParenthesizedExpression) {\n value = value.expression;\n }\n return value;\n }\n\n csharpGuardAdmitsRead(guard, read): boolean {\n const negated = this.csharpGuardIsNegated(guard);\n let statement: any = guard;\n while (statement !== undefined && statement.parent !== undefined) {\n const parent: any = statement.parent;\n if (isIfStatement(parent) && this.csharpContains(parent.expression, guard)) {\n if (!negated && this.csharpContains(parent.thenStatement, read)) {\n return true;\n }\n if (negated && parent.elseStatement !== undefined && this.csharpContains(parent.elseStatement, read)) {\n return true;\n }\n // `if (!(key in recv)) { return/throw/continue; }` then the read after it\n if (negated && this.csharpAlwaysExits(parent.thenStatement) &&\n read.getStart() >= parent.getEnd() && this.csharpContains(parent.parent, read)) {\n return true;\n }\n return false;\n }\n if (isWhileStatement(parent) && this.csharpContains(parent.expression, guard)) {\n return !negated && this.csharpContains(parent.statement, read);\n }\n statement = parent;\n }\n return false;\n }\n\n // `key in recv` guards in the function body, indexed by receiver text + key; nested\n // functions are skipped, their guards cannot dominate a read of the outer function\n csharpInGuardsOf(func): Map {\n const cached = this.csharpGuardIndex.get(func);\n if (cached !== undefined) {\n return cached;\n }\n const index: Map = new Map();\n const collect = (n: any) => {\n if (n !== func && isFunctionLike(n)) {\n return;\n }\n if (isBinaryExpression(n) && n.operatorToken.kind === SyntaxKind.InKeyword) {\n const keyNode: any = n.left;\n if (isStringLiteralLikeNode(keyNode) || isNumericLiteral(keyNode)) {\n const id = n.right.getText() + GUARD_KEY_SEPARATOR + keyNode.text;\n const list = index.get(id);\n if (list === undefined) {\n index.set(id, [ n ]);\n } else {\n list.push(n);\n }\n }\n }\n n.forEachChild(collect);\n };\n collect(func);\n this.csharpGuardIndex.set(func, index);\n return index;\n }\n\n // the read's receiver is a local whose only initializer is a literal that declares the\n // key, and the local is not reassigned or deleted from afterwards\n csharpLiteralDeclaresKey(node, expression, key, isNumberKey): boolean {\n if (!isIdentifier(expression)) {\n return false;\n }\n const symbol: any = this.getChecker().getSymbolAtLocation(expression);\n const declarations: any = (symbol?.declarations ?? []).map((d) => d.resolve());\n if (declarations.length !== 1 || !isVariableDeclaration(declarations[0])) {\n return false;\n }\n const declaration: any = declarations[0];\n if (declaration.initializer === undefined || declaration.getStart() >= node.getStart()) {\n return false;\n }\n const initializer = declaration.initializer;\n let declares = false;\n if (isNumberKey && isArrayLiteralExpression(initializer)) {\n const spread = initializer.elements.some((element: any) => isSpreadElement(element));\n declares = !spread && Number(key) < initializer.elements.length;\n } else if (!isNumberKey && isObjectLiteralExpression(initializer)) {\n declares = this.csharpObjectLiteralDeclaresKey(initializer, key);\n }\n if (!declares) {\n return false;\n }\n const func = this.csharpEnclosingFunction(node);\n return func !== undefined && !this.csharpReceiverIsRewritten(func, expression);\n }\n\n csharpObjectLiteralDeclaresKey(literal, key): boolean {\n for (const property of literal.properties) {\n if (isSpreadAssignment(property)) {\n return false; // spread keys cannot be enumerated\n }\n const name: any = (property as any).name;\n if (name !== undefined && (isIdentifier(name) || isStringLiteralLikeNode(name) || isNumericLiteral(name)) && name.text === key) {\n return true;\n }\n }\n return false;\n }\n\n // the receiver must be a dictionary at runtime for the IDictionary cast to hold; `any`\n // receivers are rejected because the checker cannot tell what the read reaches\n csharpReceiverIsDictionaryLike(expression, key): boolean {\n const type: any = this.getChecker().getTypeAtLocation(expression);\n if (type.flags === TypeFlags.Any || type.flags === TypeFlags.Unknown) {\n return false;\n }\n const checker = this.getChecker();\n return checker.getIndexInfoOfType(type, IndexKind.String) !== undefined ||\n checker.getPropertyOfType(type, key) !== undefined;\n }\n\n // any assignment to the receiver (or to a same-named binding) in the function makes the\n // object the read evaluates unprovable, so the read falls back to the helper\n csharpReceiverIsRewritten(func, expression): boolean {\n const text = expression.getText();\n const name = isIdentifier(expression) ? text : text.split(/[.[]/)[1];\n if (name === undefined) {\n return true;\n }\n let rewritten = false;\n const walk = (n: any) => {\n if (rewritten) {\n return;\n }\n if (isIdentifier(n) && n.text === name) {\n const parent: any = n.parent;\n rewritten = (isBinaryExpression(parent) && parent.left === n)\n || ((isPrefixUnaryExpression(parent) || isPostfixUnaryExpression(parent)) && parent.operand === n)\n || isDeleteExpression(parent);\n }\n n.forEachChild(walk);\n };\n walk(func);\n return rewritten;\n }\n\n // ===== ws handler `message` parameter (batch D, D-19) =====\n // A ws handler `handleX (client: Client, message: Dict)` is reached at runtime either\n // through a dispatch-table entry (`{ \"k\", this.handleX }` -> DynamicInvoker) or a direct\n csharpHandlerMessageType(param): string | undefined {\n if (this.csharpHandlerMessageTypes.has(param)) {\n return this.csharpHandlerMessageTypes.get(param);\n }\n let result: string | undefined = undefined;\n const method: any = param?.parent;\n if (isMethodDeclaration(method) && (method.parameters.length >= 2) && (method.parameters[1] === param)) {\n if ((this.csharpCheckerTypeName(method.parameters[0]) === 'Client') &&\n (this.csharpCheckerTypeName(param) === 'Dict') &&\n (this.getMethodOverride(method) === undefined) &&\n !this.csharpReceiverIsRewritten(method, param.name) &&\n !this.csharpHandlerIsCalled(method) &&\n !this.csharpClassHasListRoute(method)) {\n result = this.ArgTypeReplacements['Dict'] ?? 'Dictionary';\n }\n }\n this.csharpHandlerMessageTypes.set(param, result);\n return result;\n }\n\n // the type name the checker prints for a node's type, or undefined in an in-memory\n // program (no checker answer: the printer keeps its own)\n csharpCheckerTypeName(node): string | undefined {\n if (node === undefined) {\n return undefined;\n }\n try {\n const checker = this.getChecker();\n const type = checker.getTypeAtLocation(node);\n return (type === undefined) ? undefined : checker.typeToString(type);\n } catch (e) {\n return undefined;\n }\n }\n\n csharpEnclosingClass(node): any | undefined {\n let current: any = node?.parent;\n while (current !== undefined) {\n if (isClassDeclaration(current) || isClassExpression(current)) {\n return current;\n }\n current = current.parent;\n }\n return undefined;\n }\n\n // the identifier is the raw `message` parameter of a handler-shaped method (a `Client`\n // first parameter, so `handleMessage` with its `any` annotation included): the class can\n // route that same value through its list arm\n csharpIsHandlerMessageIdentifier(node): boolean {\n if (!isIdentifier(node)) {\n return false;\n }\n try {\n const declaration: any = this.getChecker().getSymbolAtLocation(node)?.valueDeclaration?.resolve();\n if ((declaration === undefined) || !isParameterDeclaration(declaration)) {\n return false;\n }\n const owner: any = declaration.parent;\n return isMethodDeclaration(owner) && (owner.parameters.length >= 2) &&\n (owner.parameters[1] === declaration) && (this.csharpCheckerTypeName(owner.parameters[0]) === 'Client');\n } catch (e) {\n return false;\n }\n }\n\n // a class that tests the message (or another dict parameter) for a list can hand the\n // array itself to a dispatch-table entry (binance `'x@arr'`), so its handlers keep the\n // box; a class testing unrelated lists (an array-typed `symbols` parameter, a field of\n csharpClassHasListRoute(method): boolean {\n const cls = this.csharpEnclosingClass(method);\n if (cls === undefined) {\n return true; // no class, no proof\n }\n const cached = this.csharpListRouteClasses.get(cls);\n if (cached !== undefined) {\n return cached;\n }\n let found = false;\n const walk = (n: any) => {\n if (found) {\n return;\n }\n if (isCallExpression(n) && isPropertyAccessExpression(n.expression) &&\n ((n.expression as any).expression?.text === 'Array') && ((n.expression as any).name?.text === 'isArray')) {\n const argument: any = n.arguments[0];\n if (this.csharpIsHandlerMessageIdentifier(argument)) {\n found = true;\n return;\n }\n }\n n.forEachChild(walk);\n };\n walk(cls);\n this.csharpListRouteClasses.set(cls, found);\n return found;\n }\n\n // a static call reference (`this.handleX (…)`) binds the argument to the printed\n // signature; a method-group value (a dispatch-table entry) does not\n csharpHandlerIsCalled(method): boolean {\n const cached = this.csharpHandlerCalled.get(method);\n if (cached !== undefined) {\n return cached;\n }\n let called = true; // no symbol answer: keep the box\n const cls = this.csharpEnclosingClass(method);\n let file: any;\n try {\n file = method.getSourceFile();\n } catch (e) {\n file = undefined;\n }\n if ((cls !== undefined) && (file !== undefined)) {\n try {\n const symbol = this.getChecker().getSymbolAtLocation(method.name);\n if (symbol !== undefined) {\n called = this.csharpHandlerCallIndexFor(file).get(symbol) === true;\n }\n } catch (e) {\n called = true;\n }\n }\n this.csharpHandlerCalled.set(method, called);\n return called;\n }\n\n // every identifier of the FILE that resolves to one of its classes' own method names,\n // recorded as a call when it is the callee of a call expression; keyed by symbol, so a\n // same-named method of another class never marks this one\n csharpHandlerCallIndexFor(file): Map {\n const cached = this.csharpHandlerCallIndex.get(file);\n if (cached !== undefined) {\n return cached;\n }\n const names = new Set();\n const collect = (n: any) => {\n if (isClassDeclaration(n) || isClassExpression(n)) {\n for (const member of n.members) {\n const name: any = (member as any).name?.text;\n if (isMethodDeclaration(member) && (name !== undefined)) {\n names.add(name);\n }\n }\n }\n n.forEachChild(collect);\n };\n collect(file);\n const index = new Map();\n if (names.size > 0) {\n let checker;\n try {\n checker = this.getChecker();\n } catch (e) {\n checker = undefined;\n }\n if (checker !== undefined) {\n const walk = (n: any) => {\n if (isIdentifier(n) && names.has(n.text as string)) {\n let symbol;\n try {\n symbol = checker.getSymbolAtLocation(n);\n } catch (e) {\n symbol = undefined;\n }\n if (symbol !== undefined) {\n const parent: any = n.parent;\n const isCall = (isPropertyAccessExpression(parent) && (parent.name === n) &&\n isCallExpression(parent.parent) && (parent.parent.expression === parent)) ||\n (isCallExpression(parent) && (parent.expression === n));\n if (isCall) {\n index.set(symbol, true);\n } else if (index.get(symbol) === undefined) {\n index.set(symbol, false);\n }\n }\n }\n n.forEachChild(walk);\n };\n walk(file);\n }\n }\n this.csharpHandlerCallIndex.set(file, index);\n return index;\n }\n\n csharpHasKeyRemoval(func, expression, key): boolean {\n const text = expression.getText();\n let removed = false;\n const walk = (n: any) => {\n if (removed) {\n return;\n }\n if (isDeleteExpression(n) && isElementAccessExpression(n.expression) &&\n n.expression.expression.getText() === text && n.expression.argumentExpression.getText().replace(/['\"]/g, '') === key.replace(/['\"]/g, '')) {\n removed = true;\n }\n n.forEachChild(walk);\n };\n walk(func);\n return removed;\n }\n\n csharpGuardIsNegated(guard): boolean {\n let node: any = guard;\n while (node.parent !== undefined && isParenthesizedExpression(node.parent)) {\n node = node.parent;\n }\n return node.parent !== undefined && isPrefixUnaryExpression(node.parent) &&\n node.parent.operator === SyntaxKind.ExclamationToken;\n }\n\n csharpAlwaysExits(statement): boolean {\n if (statement === undefined) {\n return false;\n }\n const exits = (n: any) => isReturnStatement(n) || isThrowStatement(n) || isContinueStatement(n) || isBreakStatement(n);\n if (exits(statement)) {\n return true;\n }\n if (isBlock(statement) && statement.statements.length > 0) {\n return exits(statement.statements[statement.statements.length - 1]);\n }\n return false;\n }\n\n csharpContains(outer, inner): boolean {\n if (outer === undefined || inner === undefined) {\n return false;\n }\n return inner.getStart() >= outer.getStart() && inner.getEnd() <= outer.getEnd();\n }\n // cs-strict S14: `((List)x)[i] = v` needs no cast when the PRINTED declaration is\n // `List` (identity conversion; not IList, a checked downcast). Type comes via the\n // `csharpLocalTypeOf` hook; `x[i] += v` and reads stay on the base path (third override layer).\n csharpElementAccessReceiverIsList(node) {\n if (node?.kind !== SyntaxKind.ElementAccessExpression) {\n return false;\n }\n const parent = node.parent;\n if (parent?.kind !== SyntaxKind.BinaryExpression || parent.operatorToken?.kind !== SyntaxKind.EqualsToken || parent.left !== node) {\n return false;\n }\n const receiver = node.expression;\n if (receiver?.kind !== SyntaxKind.Identifier) {\n return false;\n }\n const localTypeOf = (this as any).csharpLocalTypeOf;\n return (typeof localTypeOf === 'function') && (localTypeOf.call(this, receiver) === 'List');\n }\n\n // The C# declared type pair of a list index READ (`x[i]`): receiver (`List` /\n // `IList`) and index (`int`). Consumer-installed (build/csharp-local-types.js);\n // undefined by default, so an unpatched printer keeps `getValue (x, i)` for every read.\n csharpListIndexReadTypes(node): { receiver: string, index: string } | undefined {\n return undefined; // stub to override\n }\n\n // `x[i]` read on a list receiver: the helper answers null off the end while the C# indexer throws,\n // so the native read is only emitted where the source proves the index in range. Types come from\n // the consumer hook above, so the untyped emission is byte-identical.\n csharpListIndexRead(node): string | undefined {\n if (node?.kind !== SyntaxKind.ElementAccessExpression) {\n return undefined;\n }\n const { expression, argumentExpression } = node;\n if (expression?.kind !== SyntaxKind.Identifier || argumentExpression?.kind !== SyntaxKind.Identifier) {\n return undefined;\n }\n if (this.csharpIsSetOrAddTarget(node)) {\n return undefined; // element writes print through the cast path\n }\n const types = (typeof this.csharpListIndexReadTypes === 'function') ? this.csharpListIndexReadTypes(node) : undefined;\n if (types?.index !== 'int') {\n return undefined; // only an int index binds the List indexer\n }\n if ((types.receiver !== 'List') && (types.receiver !== 'IList')) {\n return undefined;\n }\n if (!this.csharpIndexIsLoopBounded(node, expression, argumentExpression)) {\n return undefined;\n }\n return this.printNode(expression, 0) + '[' + this.printNode(argumentExpression, 0) + ']';\n }\n\n // the read sits in the body of a `for` that re-tests `index < receiver.length`, both\n // resolved to the very symbols the read uses, and nothing in the body can move either\n csharpIndexIsLoopBounded(read, receiver, index): boolean {\n const receiverSymbol = this.csharpIdentifierSymbol(receiver);\n const indexSymbol = this.csharpIdentifierSymbol(index);\n if (receiverSymbol === undefined || indexSymbol === undefined) {\n return false;\n }\n let node: any = read;\n while (node?.parent !== undefined) {\n const parent: any = node.parent;\n if (isFunctionLike(parent)) {\n return false; // a read under a nested function is not dominated by the condition\n }\n if (isForStatement(parent) && this.csharpForBoundsIndex(parent, read, receiverSymbol, indexSymbol)) {\n return true;\n }\n node = parent;\n }\n return false;\n }\n\n csharpIdentifierSymbol(node): any {\n if (node?.kind !== SyntaxKind.Identifier) {\n return undefined;\n }\n return this.checkerOrUndefined()?.getSymbolAtLocation(node);\n }\n\n csharpForBoundsIndex(forStatement, read, receiverSymbol, indexSymbol): boolean {\n if (!this.csharpContains(forStatement.statement, read)) {\n return false; // the read is in the loop header, not the body\n }\n const condition: any = forStatement.condition;\n if (condition?.kind !== SyntaxKind.BinaryExpression || condition.operatorToken?.kind !== SyntaxKind.LessThanToken) {\n return false;\n }\n const length: any = condition.right;\n if (length?.kind !== SyntaxKind.PropertyAccessExpression || length.name?.text !== 'length') {\n return false;\n }\n if (this.csharpIdentifierSymbol(condition.left) !== indexSymbol) {\n return false;\n }\n if (this.csharpIdentifierSymbol(this.csharpLengthReceiverIdentifier(length.expression)) !== receiverSymbol) {\n return false;\n }\n return !this.csharpIndexBoundIsVoided(forStatement.statement, receiverSymbol, indexSymbol);\n }\n\n // The identifier a `.length` receiver reads through wrappers whose C# print is the bare text:\n // parentheses, and `as T` where printAsExpression does not cast (`any`/`string`/`T[]` print a cast,\n // so the bound would not be the receiver's Count). `(response as List).length` -> `?.Count ?? 0`\n csharpLengthReceiverIdentifier(node): any {\n let current: any = node;\n while (current !== undefined) {\n if (current.kind === SyntaxKind.ParenthesizedExpression) {\n current = current.expression;\n continue;\n }\n if (current.kind === SyntaxKind.AsExpression && current.type !== undefined\n && current.type.kind !== SyntaxKind.AnyKeyword\n && current.type.kind !== SyntaxKind.StringKeyword\n && current.type.kind !== SyntaxKind.ArrayType) {\n current = current.expression;\n continue;\n }\n break;\n }\n return current;\n }\n\n // the condition ran before the body did: a write to the index, or any use of the receiver\n // other than an element access / a property read (a method call, an argument, a bare read —\n // anything that could hand the list to something that shrinks it) voids the bound\n csharpIndexBoundIsVoided(body, receiverSymbol, indexSymbol): boolean {\n let voided = false;\n const visit = (n: any) => {\n if (voided || n === undefined) {\n return;\n }\n if (n.kind === SyntaxKind.Identifier) {\n const symbol = this.csharpIdentifierSymbol(n);\n if (symbol === indexSymbol && this.csharpIdentifierIsWritten(n)) {\n voided = true;\n return;\n }\n if (symbol === receiverSymbol && !this.csharpReceiverUseKeepsBound(n)) {\n voided = true;\n return;\n }\n }\n n.forEachChild(visit);\n };\n body.forEachChild(visit);\n return voided;\n }\n\n // a use that cannot move the value the condition tested: the expression of an element\n // access (`recv[i]`, a read or an element write — neither changes the length) or of a\n // property READ (`recv.Count`); a property write or a call on the receiver is not one\n csharpReceiverUseKeepsBound(node): boolean {\n const parent: any = node.parent;\n if (parent === undefined) {\n return false;\n }\n if (parent.kind === SyntaxKind.ElementAccessExpression && parent.expression === node) {\n return true;\n }\n if (parent.kind === SyntaxKind.PropertyAccessExpression && parent.expression === node) {\n if (this.csharpIdentifierIsWritten(node)) {\n return false; // `recv.length = n`\n }\n const grand: any = parent.parent;\n return !(grand?.kind === SyntaxKind.CallExpression && grand.expression === parent);\n }\n return false;\n }\n\n // the identifier is a write target: `x = v`, `x += v`, `x++` / `x--`, a destructuring\n // element, or a property/element write through it (`x.length = 0`)\n csharpIdentifierIsWritten(node): boolean {\n const parent: any = node.parent;\n if (parent === undefined) {\n return false;\n }\n if (parent.kind === SyntaxKind.BinaryExpression && parent.left === node && this.csharpIsAssignmentOperator(parent.operatorToken.kind)) {\n return true;\n }\n if ((parent.kind === SyntaxKind.PrefixUnaryExpression || parent.kind === SyntaxKind.PostfixUnaryExpression)\n && (parent.operator === SyntaxKind.PlusPlusToken || parent.operator === SyntaxKind.MinusMinusToken)) {\n return true;\n }\n if (parent.kind === SyntaxKind.ArrayLiteralExpression || parent.kind === SyntaxKind.PropertyAccessExpression) {\n const grand: any = parent.parent;\n return grand?.kind === SyntaxKind.BinaryExpression && grand.left === parent && this.csharpIsAssignmentOperator(grand.operatorToken.kind);\n }\n return false;\n }\n\n // the node is the left side of `=` or `+=`\n csharpIsSetOrAddTarget(node): boolean {\n const parent: any = node.parent;\n return parent?.kind === SyntaxKind.BinaryExpression\n && (parent.operatorToken.kind === SyntaxKind.EqualsToken || parent.operatorToken.kind === SyntaxKind.PlusEqualsToken)\n && parent.left === node;\n }\n\n csharpIsAssignmentOperator(kind): boolean {\n return (kind >= SyntaxKind.FirstAssignment) && (kind <= SyntaxKind.LastAssignment);\n }\n\n // S22: an index WRITE (`x[\"k\"] = v`) needs no `((IDictionary)x)` cast when the\n // receiver's printed C# declaration already IS a dictionary. The ccxt classifier\n // (build/csharp-local-types.js) installs this predicate; undefined/false keeps the upstream cast.\n csharpDictionaryIndexWriteNeedsNoCast(node): boolean | undefined {\n return undefined;\n }\n // the consumer's classifier may prove the declared C# type of an element-access receiver\n // (`Dictionary` / `IDictionary`); consumer-installed, so an\n // answer of undefined keeps the untyped emission byte-identical\n csharpElementAccessTypedReceiver(node): string | undefined {\n return undefined;\n }\n\n // `recv[key]` read with a consumer-proven string-keyed dict receiver and a literal key: the typed\n // twin GetValue(IDictionary, string) runs the same dictionary read as the object\n // overload's dict branch without its runtime sniffing. Every other read keeps the wrapper.\n printTypedDictElementAccessIfAny(node) {\n if (this.csharpElementAccessTypedReceiver(node) === undefined) {\n return undefined;\n }\n const { expression, argumentExpression } = node;\n if (!isStringLiteralLikeNode(argumentExpression)) {\n return undefined; // the twin's key parameter is `string`; any other key keeps the object overload\n }\n if (this.csharpIsSetOrAddTarget(node)) {\n return undefined; // a write prints the dictionary element assignment, not this read\n }\n return 'GetValue(' + this.printNode(expression, 0) + ', ' + this.printNode(argumentExpression, 0) + ')';\n }\n\n printWrappedUnknownThisProperty(node) {\n const type = this.getChecker().getResolvedSignature(node);\n if (type?.declaration === undefined) {\n let parsedArguments = node.arguments?.map((a) => this.printNode(a, 0)).join(\", \");\n parsedArguments = parsedArguments ? parsedArguments : \"\";\n const propName = node.expression?.name.text;\n const nativeDelegateCall = this.csharpNativeDelegateCall(node, propName);\n if (nativeDelegateCall !== undefined) {\n return nativeDelegateCall;\n }\n // const isAsyncDecl = true;\n const isAsyncDecl = node?.parent?.kind === SyntaxKind.AwaitExpression;\n // const open = isAsyncDecl ? this.UKNOWN_PROP_ASYNC_WRAPPER_OPEN : this.UKNOWN_PROP_WRAPPER_OPEN;\n // const close = this.UNKOWN_PROP_WRAPPER_CLOSE;\n // return `${open}\"${propName}\"${parsedArguments}${close}`;\n const argsArray = `new object[] { ${parsedArguments} }`;\n const open = this.DYNAMIC_CALL_OPEN;\n let statement = `${open}this, \"${propName}\", ${argsArray})`;\n statement = isAsyncDecl ? `((Task)${statement})` : statement;\n return statement;\n }\n return undefined;\n }\n\n // A `this.(...)` call the checker cannot resolve on a function-valued property is a\n // delegate in the hand-written C# base, which `ResolveMethod` never finds (the helper throws\n // there); matching arity prints the same property invocation directly.\n csharpNativeDelegateCall(node, propName): string | undefined {\n const arity = CSHARP_NATIVE_THIS_DELEGATE_ARITY[propName as string];\n if (arity === undefined) {\n return undefined;\n }\n if (node?.parent?.kind === SyntaxKind.AwaitExpression) {\n return undefined; // the delegate returns object, not a Task\n }\n const args = node.arguments ?? [];\n if (args.length !== arity) {\n return undefined;\n }\n return `this.${propName as string}(${args.map((a) => this.printNode(a, 0)).join(\", \")})`;\n }\n\n printOutOfOrderCallExpressionIfAny(node, identation) {\n if (node.expression.kind === SyntaxKind.PropertyAccessExpression) {\n const expressionText = node.expression.getText().trim();\n const args = node.arguments;\n if (args.length === 1) {\n const parsedArg = this.printNode(args[0], 0);\n switch (expressionText) {\n // case \"JSON.parse\":\n // return `json_decode(${parsedArg}, $as_associative_array = true)`;\n case \"Math.abs\":\n return `Math.Abs(Convert.ToDouble(${parsedArg}))`;\n }\n } else if (args.length === 2)\n {\n const parsedArg1 = this.printNode(args[0], 0);\n const parsedArg2 = this.printNode(args[1], 0);\n switch (expressionText) {\n case \"Math.min\":\n return this.csharpNativeMathMinMax(node, 'Min', parsedArg1, parsedArg2) ?? `mathMin(${parsedArg1}, ${parsedArg2})`;\n case \"Math.max\":\n return this.csharpNativeMathMinMax(node, 'Max', parsedArg1, parsedArg2) ?? `mathMax(${parsedArg1}, ${parsedArg2})`;\n case \"Math.pow\":\n return `Math.Pow(Convert.ToDouble(${parsedArg1}), Convert.ToDouble(${parsedArg2}))`;\n }\n }\n const leftSide = node.expression?.expression;\n const leftSideText = leftSide ? this.printNode(leftSide, 0) : undefined;\n\n // wrap unknown property this.X calls\n if (leftSideText === this.THIS_TOKEN || leftSide.getFullText().indexOf(\"(this as any)\") > -1) { // double check this\n const res = this.printWrappedUnknownThisProperty(node);\n if (res) {\n return res;\n }\n }\n }\n\n // // replace this[method]() calls\n // const thisElementAccess = this.printThisElementAccesssIfNeeded(node, identation);\n // if (thisElementAccess) {\n // return thisElementAccess;\n // }\n\n // handle dynamic calls, this[method](A) or exchange[b] (c) using reflection\n if (node.expression.kind === SyntaxKind.ElementAccessExpression) {\n return this.printDynamicCall(node, identation);\n }\n\n\n return undefined;\n }\n\n handleTypeOfInsideBinaryExpression(node, identation) {\n const left = node.left;\n const right = node.right.text;\n const op = node.operatorToken.kind;\n const expression = left.expression;\n\n const isDifferentOperator = op === SyntaxKind.ExclamationEqualsEqualsToken || op === SyntaxKind.ExclamationEqualsToken;\n const notOperator = isDifferentOperator ? this.NOT_TOKEN : \"\";\n\n const target = this.printNode(expression, 0);\n switch (right) {\n case \"string\":\n return notOperator + `(${target} is string)`;\n case \"number\":\n return notOperator + `(${target} is Int64 || ${target} is int || ${target} is float || ${target} is double)`;\n case \"boolean\":\n return notOperator + `(${target} is bool)`;\n case \"object\":\n return notOperator + `(${target} is IDictionary)`;\n case \"function\":\n return notOperator + `(${target} is Delegate)`;\n }\n\n return undefined;\n\n }\n\n // The C# type of an operand of `==` / `!=` as the printer emits it, or undefined when\n // the printer only knows `object`: an `object` operand takes the reference-comparing\n // `operator ==`, so those keep the isEqual helper.\n csharpEqualityOperandType(node): string | undefined {\n if (node === undefined) {\n return undefined;\n }\n switch (node.kind) {\n case SyntaxKind.NullKeyword:\n return 'null';\n case SyntaxKind.TrueKeyword:\n case SyntaxKind.FalseKeyword:\n return 'bool';\n case SyntaxKind.NumericLiteral:\n return this.csharpNumericLiteralKind(node);\n case SyntaxKind.ParenthesizedExpression:\n return this.csharpEqualityOperandType(node.expression);\n case SyntaxKind.Identifier:\n // printIdentifier prints the `undefined` identifier as null\n if (node.text === 'undefined') {\n return 'null';\n }\n return this.csharpDeclaredTypeOfBinding(node) ?? this.csharpParameterOperandType(node);\n case SyntaxKind.PropertyAccessExpression: {\n const fieldType = this.csharpReferenceFieldType(node);\n return (fieldType === undefined) ? this.csharpTypeOfInitializer(node) : fieldType;\n }\n }\n if (isStringLiteralLikeNode(node)) {\n return 'string';\n }\n return this.csharpTypeOfInitializer(node);\n }\n\n // 'object' for a `this.` read of a hand-written field the table proves a reference box;\n // undefined otherwise. Only printInlineEquality's null branch accepts 'object', so the exact\n // field type is never claimed and the value-equality branches keep the helper.\n csharpReferenceFieldType(node): string | undefined {\n if (!isPropertyAccessExpression(node) || (node.expression?.kind !== SyntaxKind.ThisKeyword)) {\n return undefined;\n }\n const name = node.name?.text as string;\n if (CSHARP_REFERENCE_FIELDS_NATIVE.indexOf(name) < 0) {\n return undefined;\n }\n return this.csharpOperandIsValueTyped(node) ? undefined : 'object';\n }\n\n // the declaration behind an identifier read that is a plain method parameter; a\n // destructured or rest parameter prints a different declaration shape\n csharpParameterDeclaration(node): ParameterDeclaration | undefined {\n const declaration: any = (this.checkerOrUndefined() as any)?.getSymbolAtLocation(node)?.valueDeclaration?.resolve();\n if ((declaration === undefined) || !isParameterDeclaration(declaration)) {\n return undefined;\n }\n if (!isIdentifier(declaration.name) || (declaration.name.text !== node.text) || (declaration.dotDotDotToken !== undefined)) {\n return undefined;\n }\n return declaration;\n }\n\n // `object` for a parameter operand a null comparison compiles on, else undefined. An optional\n // parameter prints `object` / `string` / `Int64?` / `double?` / `bool?`; any other keeps the\n // helper unless its checker type holds no number/boolean member (a reference box).\n csharpParameterOperandType(node): string | undefined {\n const declaration = this.csharpParameterDeclaration(node);\n if (declaration === undefined) {\n return undefined;\n }\n if (this.csharpDeclarationPrintsNullComparable(declaration)) {\n return 'object'; // reference box or nullable value: only the null branch may use it\n }\n return this.csharpOperandIsValueTyped(node) ? undefined : 'object';\n }\n\n // Whether this parameter's printed C# type is a reference or nullable value, so `x == null`\n // compiles and is isEqual's null branch. optionalScalarCsharpType gives a nullable scalar only\n // when optional with no initializer or `= undefined`; required or real-default ones are non-null.\n csharpDeclarationPrintsNullComparable(declaration): boolean {\n const initializer = declaration.initializer;\n const optional = (declaration.questionToken !== undefined) || (initializer !== undefined);\n if (optional && ((initializer === undefined) || ((initializer.kind === SyntaxKind.Identifier) && (initializer.text === 'undefined')))) {\n return true;\n }\n return !this.csharpDeclarationHasValueScalar(declaration);\n }\n\n csharpDeclarationHasValueScalar(declaration): boolean {\n const checker: any = this.checkerOrUndefined();\n if (checker === undefined) {\n return true; // unknown: keep the helper\n }\n return this.csharpTypeHasValueScalar(checker.getTypeAtLocation(declaration));\n }\n\n // A numeric literal prints as an untyped C# constant that adapts to the operand on the\n // other side. isEqual's integer branches round-trip through Convert.ToInt64, which an\n // integer literal beyond 2^53 does not survive, so those stay on the helper.\n csharpNumericLiteralKind(node): string | undefined {\n const value = Number(node.text);\n if (!Number.isFinite(value) || (Number.isInteger(value) && !Number.isSafeInteger(value))) {\n return undefined;\n }\n return 'number';\n }\n\n // the C# type the declaration behind an identifier was printed with ('object' when the\n // printer named none), or undefined when the identifier is not a printed local\n csharpDeclaredTypeOfBinding(node): string | undefined {\n const declaration: any = (this.checkerOrUndefined() as any)?.getSymbolAtLocation(node)?.valueDeclaration?.resolve();\n if (declaration?.kind === SyntaxKind.VariableDeclaration) {\n return this.getCSharpLocalType(declaration);\n }\n if (declaration?.kind === SyntaxKind.BindingElement) {\n return 'var'; // `const [a, b] = ...` prints `var a = ((IList)...)[0]`\n }\n return undefined; // parameters are retyped after printing by the build script\n }\n\n // the C# operator family an operand belongs to: `==` compares two operands of one family\n // by value, exactly like the isEqual branches those types take\n csharpValueEqualityKind(csharpType): string | undefined {\n switch (csharpType) {\n case 'string':\n case 'string?':\n return 'string';\n case 'bool':\n case 'bool?':\n return 'bool';\n case 'double':\n case 'double?':\n return 'double';\n case 'Int64':\n case 'long':\n case 'Int64?':\n case 'long?':\n return 'Int64';\n case 'int':\n case 'int?':\n return 'int';\n case 'number':\n return 'number'; // numeric literal, adapts to the numeric operand it is compared with\n }\n return undefined;\n }\n\n // `x == null` compiles — and matches isEqual — for reference types and nullable value\n // types, but not for a non-nullable value type (double / bool / Int64 / int). Lists,\n // dictionaries, class instances and `var` are references, and are the only types left\n // once csharpValueEqualityKind has claimed the value-typed names above.\n csharpIsNullComparableType(csharpType): boolean {\n if ((csharpType === undefined) || (csharpType === '') || (csharpType === 'null')) {\n return false;\n }\n if (csharpType.endsWith('?')) {\n return true;\n }\n if ((csharpType === 'object') || (csharpType === 'string')) {\n return true;\n }\n return (this.csharpValueEqualityKind(csharpType) === undefined);\n }\n\n // `x == null` compiles and matches isEqual's null branch when x's printed type is a\n // reference box or a nullable value type: the operand table's declared types, an optional\n // parameter, or a box the checker proves holds no number/boolean scalar.\n csharpOperandIsNullComparable(node): boolean {\n const declaration = this.csharpParameterDeclaration(node);\n if ((declaration !== undefined) && this.csharpDeclarationPrintsNullComparable(declaration)) {\n return true;\n }\n return !this.csharpOperandIsValueTyped(node);\n }\n\n // U55: the null-comparison rule's gate, stricter than csharpIsNullComparableType above:\n // only a type the hook names (the emitted declaration's own text) is accepted, `object` /\n // `var` included in the refusal because those are the boxes the classifier did not name.\n csharpNullComparisonTypeIsProvable(csharpType): boolean {\n if ((csharpType === undefined) || (csharpType === '') || (csharpType === 'object') || (csharpType === 'var') || (csharpType === 'null')) {\n return false;\n }\n if (csharpType.endsWith('?')) {\n return true;\n }\n return CSHARP_NULL_COMPARISON_REFERENCE_HEADS.some((head) => csharpType.startsWith(head));\n }\n\n // TypeScript numbers and booleans are C# value types in this port (double / bool /\n // Int64 / int), and the ccxt build script retypes some `object` declarations to exactly\n // those from its own tables (precisionFromString -> int, milliseconds -> Int64,\n // isEmpty -> bool). A null comparison against one of them would not compile, and the\n // printer's `object` cannot rule it out, so these always keep the helper.\n csharpOperandIsValueTyped(node): boolean {\n if (node === undefined) {\n return true;\n }\n const checker: any = this.checkerOrUndefined();\n if (checker === undefined) {\n return true;\n }\n const type = checker.getTypeAtLocation(node);\n return this.csharpTypeHasValueScalar(type);\n }\n\n csharpTypeHasValueScalar(type): boolean {\n if (type === undefined) {\n return true;\n }\n const flags = type.flags;\n if (flags & TypeFlags.Union) {\n const members = type.getTypes?.() ?? [];\n return members.some((member) => this.csharpTypeHasValueScalar(member));\n }\n return (flags & (TypeFlags.Number | TypeFlags.NumberLiteral | TypeFlags.Boolean | TypeFlags.BooleanLiteral)) !== 0;\n }\n\n // `x == \"lit\"` / `x != \"lit\"` prints natively when x is a read of a local whose printed\n // declaration is a C# string: the printer's declared-local table, then the embedding build\n // layer's proof for the declarations it retypes itself (ccxt's csharp-local-types.js).\n csharpDeclaredStringLiteralComparison(left, right, leftText: string, rightText: string, isEquality: boolean): string | undefined {\n const ident = isIdentifier(left) ? left : (isIdentifier(right) ? right : undefined);\n if ((ident === undefined) || !isStringLiteralLikeNode((ident === left) ? right : left)) {\n return undefined;\n }\n const declared = this.csharpDeclaredReadType(ident);\n if ((declared === undefined) || !this.csharpTypeIsStringType(declared)) {\n return undefined;\n }\n return isEquality ? `(${leftText} == ${rightText})` : `(${leftText} != ${rightText})`;\n }\n\n // the C# type the declaration behind a local read was printed with, or undefined: the\n // printer's own declared-local table first, then the embedding build layer's answer for a\n // declaration it retyped after the printer had left it `object`\n csharpDeclaredReadType(node): string | undefined {\n let named;\n try {\n named = this.csharpTypedLocalType(node);\n } catch (e) {\n named = undefined;\n }\n return (named !== undefined) ? named : this.csharpResolvedReadType(node);\n }\n\n // the embedding build layer's string answer for a read, or undefined (no resolver, it threw)\n csharpResolvedReadType(node): string | undefined {\n const resolver = this.csharpExpressionTypeResolver;\n if (typeof resolver !== 'function') {\n return undefined;\n }\n let resolved;\n try {\n resolved = resolver(node);\n } catch (e) {\n return undefined;\n }\n return (typeof resolved === 'string') ? resolved : undefined;\n }\n\n // the declared type of an identifier read, including this printer's own local table\n csharpDeclaredLocalType(node): string | undefined {\n const provided = this.csharpExpressionTypeResolver ? this.csharpExpressionTypeResolver(node) : undefined;\n if (provided !== undefined) {\n return provided;\n }\n const declaration = this.getChecker().getSymbolAtLocation(node)?.valueDeclaration?.resolve();\n if (declaration === undefined || !isVariableDeclaration(declaration) || declaration.name?.kind !== SyntaxKind.Identifier) {\n return undefined;\n }\n if (!this.csharpLocalTypes.has(declaration)) {\n this.csharpLocalTypes.set(declaration, this.getCSharpLocalType(declaration));\n }\n const type = this.csharpLocalTypes.get(declaration);\n return (type === undefined || type === this.VAR_TOKEN) ? undefined : type;\n }\n\n // `a === b` / `a !== b` between two plain reads: a local or parameter prints as a bare\n // name and both operands are read once by the printed expression\n csharpOperandsAreDeclaredReads(left, right): boolean {\n const isRead = (node) => (node?.kind === SyntaxKind.Identifier) && (node.text !== 'undefined');\n return isRead(left) && isRead(right);\n }\n\n // the C# type the embedding build layer declares for a read the printer can only call\n // `object`: that layer retypes the declaration so its recorded type IS the printed one\n csharpDeclaredReadEqualityType(node, printerType: string | undefined): string | undefined {\n if ((printerType !== undefined) && (printerType !== this.VAR_TOKEN) && (printerType !== 'var')) {\n return printerType;\n }\n return this.csharpResolvedReadType(node) ?? printerType;\n }\n\n // `==` / `!=` in place of the isEqual wrapper when both operands are C# values of one\n // family, or one side is null/undefined against a type `== null` compiles for. Both\n // operands are printed once, so neither is evaluated twice.\n printInlineEquality(left, right, leftText: string, rightText: string, isEquality: boolean): string | undefined {\n const stringComparison = this.csharpDeclaredStringLiteralComparison(left, right, leftText, rightText, isEquality);\n if (stringComparison !== undefined) {\n return stringComparison;\n }\n let leftType = this.csharpEqualityOperandType(left);\n let rightType = this.csharpEqualityOperandType(right);\n if (this.csharpOperandsAreDeclaredReads(left, right)) {\n leftType = this.csharpDeclaredReadEqualityType(left, leftType);\n rightType = this.csharpDeclaredReadEqualityType(right, rightType);\n }\n // D-21: an operand the printer could not name (or only named `object`) is not a\n // rejection by itself -- the value branch below re-reads its DECLARED scalar type\n if ((leftType === 'null') || (rightType === 'null')) {\n const [other, otherType, otherText] = (leftType === 'null') ? [right, rightType, rightText] : [left, leftType, leftText];\n if (!this.csharpIsNullComparableType(otherType) || !this.csharpOperandIsNullComparable(other)) {\n return undefined;\n }\n return this.csharpNullComparison(otherText, isEquality);\n }\n // D-21: a read the printer's own tables could only call `object` still has the C# type\n // its emitted DECLARATION carries -- a parameter the build layer's typing pass narrowed,\n // a local retyped to the type of a typed return. The declared-read arm below names it.\n const leftKind = this.csharpValueEqualityKind(leftType);\n const rightKind = this.csharpValueEqualityKind(rightType);\n const leftReadKind = (leftKind !== undefined) ? leftKind : this.csharpDeclaredReadEqualityKind(left, leftType);\n const rightReadKind = (rightKind !== undefined) ? rightKind : this.csharpDeclaredReadEqualityKind(right, rightType);\n if ((leftReadKind === undefined) || (rightReadKind === undefined)) {\n return undefined;\n }\n // mixed numeric kinds are not equal in isEqual: `int` vs `double` takes the\n // `(int)a == (int)b` branch and throws on the boxed double, so only a numeric\n // literal may meet a different numeric type\n const numericKinds = [ 'double', 'Int64', 'int' ];\n const sameKind = (leftReadKind === rightReadKind);\n const literalVsNumeric = ((leftReadKind === 'number') && (numericKinds.indexOf(rightReadKind) >= 0))\n || ((rightReadKind === 'number') && (numericKinds.indexOf(leftReadKind) >= 0));\n if (!sameKind && !literalVsNumeric) {\n return undefined;\n }\n return isEquality ? `(${leftText} == ${rightText})` : `(${leftText} != ${rightText})`;\n }\n\n // the value kind of an operand the printer could only call `object`: the type the read's\n // declaration was PRINTED with (printer table -> build layer's read-type oracle -> the\n // declared-type registry for the declarations its own passes retyped). A collection/class\n csharpDeclaredReadEqualityKind(node, operandType: string | undefined): string | undefined {\n if ((operandType !== undefined) && (operandType !== '') && (operandType !== 'object')) {\n return undefined; // the printer named a non-value C# type: never a value comparison\n }\n if ((node?.kind !== SyntaxKind.Identifier) || (node.text === 'undefined')) {\n return undefined; // parameters of a written body / accesses / calls are other units\n }\n const declared = this.csharpDeclaredReadType(node) ?? this.csharpDeclaredLocalResolverType(node);\n return (declared === undefined) ? undefined : this.csharpValueEqualityKind(declared);\n }\n\n csharpNullComparison(text: string, isEquality: boolean) {\n return isEquality ? `(${text} == null)` : `(${text} != null)`;\n }\n\n // `isEqual(, N)` / `isEqual(N, )` -> `==` / `!=`: the call prints a\n // concrete numeric kind, the literal adapts to it, and the operator matches isEqual's integer and\n // double branches. String/bool/collection calls and every `object` box keep the helper.\n csharpNativeNumericCallEquality(left, right, leftText: string, rightText: string, isEquality: boolean): string | undefined {\n const leftKind = this.csharpNumericCallKind(left);\n const rightKind = this.csharpNumericCallKind(right);\n const leftLiteral = (leftKind === undefined) ? this.csharpIntegerLiteralKind(left) : undefined;\n const rightLiteral = (rightKind === undefined) ? this.csharpIntegerLiteralKind(right) : undefined;\n const callOnLeft = (leftKind !== undefined) && (rightLiteral !== undefined) && this.csharpNumericKindHoldsLiteral(leftKind, rightLiteral);\n const callOnRight = (rightKind !== undefined) && (leftLiteral !== undefined) && this.csharpNumericKindHoldsLiteral(rightKind, leftLiteral);\n if (!callOnLeft && !callOnRight) {\n return undefined;\n }\n // both operands are printed once: the call is not duplicated\n return isEquality ? `(${leftText} == ${rightText})` : `(${leftText} != ${rightText})`;\n }\n\n // The C# value kind of a call operand (or `x.length`) when its printed signature is numeric:\n // `.indexOf`/`.length` (int) and safe* accessors from the printer's tables, `this.()` from\n // CSHARP_NATIVE_NUMERIC_THIS_KINDS. undefined keeps the helper (an `object` box has no kind).\n csharpNumericCallKind(node): string | undefined {\n const expression = node?.expression;\n if ((node?.kind === SyntaxKind.CallExpression)\n && (expression?.kind === SyntaxKind.PropertyAccessExpression)\n && (expression.expression?.kind === SyntaxKind.ThisKeyword)) {\n const named = CSHARP_NATIVE_NUMERIC_THIS_KINDS[expression.name?.text as string];\n // an unresolvable callee prints callDynamically(this, ...), which returns object\n if ((named !== undefined) && this.csharpCalleeResolves(node)) {\n return named;\n }\n }\n const named = this.csharpCallReturnType(node);\n return ((named === undefined) || (CSHARP_NUMERIC_VALUE_KINDS.indexOf(named) < 0)) ? undefined : named;\n }\n\n // The C# kind of an integer literal operand (`N` / `-N`), or undefined when the text is not an\n // integer the literal holds exactly. isEqual round-trips through Convert.ToInt64 and truncates\n // via `(int)a == (int)b`, so only a safe integer literal keeps both comparisons identical.\n csharpIntegerLiteralKind(node): string | undefined {\n let value;\n if (node?.kind === SyntaxKind.PrefixUnaryExpression) {\n if ((node.operator !== SyntaxKind.MinusToken) || (node.operand?.kind !== SyntaxKind.NumericLiteral)) {\n return undefined;\n }\n value = -Number(node.operand.text);\n } else if (node?.kind === SyntaxKind.NumericLiteral) {\n value = Number(node.text);\n } else {\n return undefined;\n }\n if (!Number.isSafeInteger(value)) {\n return undefined;\n }\n return ((value >= -2147483648) && (value <= 2147483647)) ? 'int' : 'long';\n }\n\n // a `long` literal has no implicit conversion to an `int` operand; every other pair\n // converts the literal exactly, which is what isEqual's Convert.ToInt64 /\n // Convert.ToDouble branches do with the same two boxes\n csharpNumericKindHoldsLiteral(callKind: string, literalKind: string): boolean {\n if (callKind === 'int') {\n return literalKind === 'int';\n }\n return (callKind.indexOf('Int64') === 0) || (callKind.indexOf('double') === 0);\n }\n\n // the concrete C# type of an expression the printer can name, or undefined: the embedding\n // build layer's proof wins (it retypes locals the printer leaves `object`), then the\n // printer's own tables and the literals whose C# type is fixed by their text\n csharpExpressionTypeOf(node): string | undefined {\n const provided = this.csharpExpressionTypeResolver ? this.csharpExpressionTypeResolver(node) : undefined;\n if (provided !== undefined) {\n return provided;\n }\n if (isNumericLiteral(node)) {\n const value = Number(node.text);\n // wider literals are typed uint/long/ulong by the C# compiler, keep the helper\n return (Number.isInteger(value) && Math.abs(value) <= 2147483647) ? 'int' : undefined;\n }\n if (isPrefixUnaryExpression(node) && (node.operator === SyntaxKind.MinusToken) && isNumericLiteral(node.operand)) {\n const value = Number(node.operand.text);\n return (Number.isInteger(value) && (value <= 2147483647)) ? 'int' : undefined;\n }\n return this.csharpTypeOfInitializer(node);\n }\n\n csharpOperandIsPlainNumber(operand): boolean {\n const checker: any = this.checkerOrUndefined();\n if (checker === undefined) {\n return false; // in-memory program without a checker\n }\n const flags = checker.getTypeAtLocation(operand)?.flags;\n return (flags === TypeFlags.Number) || (flags === TypeFlags.NumberLiteral);\n }\n\n // `<`, `>`, `<=`, `>=` on two operands whose printed C# kind this printer can name (declaration,\n // literal, known call signature — never the JS type) print natively: the helper applies the same\n // conversions as the C# operator; an int/Int64 pair compares the same. See CSHARP_NUMERIC_KINDS.\n csharpNativeNumericComparison(node, identation): string | undefined {\n const token = CSHARP_NATIVE_COMPARISON_TOKENS[node.operatorToken.kind];\n if (token === undefined) {\n return undefined;\n }\n const leftKind = this.csharpExpressionTypeOf(node.left);\n const rightKind = this.csharpExpressionTypeOf(node.right);\n if ((leftKind === undefined) || (rightKind === undefined)) {\n return undefined;\n }\n const integerPair = (CSHARP_INTEGER_KINDS.indexOf(leftKind) >= 0) && (CSHARP_INTEGER_KINDS.indexOf(rightKind) >= 0);\n if (!integerPair && ((leftKind !== rightKind) || (CSHARP_NUMERIC_KINDS.indexOf(leftKind) < 0))) {\n return undefined;\n }\n if ((leftKind === 'double') && ((token === '<') || (token === '<='))) {\n return undefined;\n }\n const leftText = this.printNode(node.left, 0).trim();\n const rightText = this.printNode(node.right, 0).trim();\n return leftText + ' ' + token + ' ' + rightText;\n }\n\n // `Math.min/max (a, b)`: mathMin/mathMax read both boxes via Convert.ToDouble, return an ORIGINAL\n // one (null if either is null); Math.Min/Max returns one numeric kind. Native only when both are\n // declared integers of the same kind and the checker sees two plain numbers; else keep the helper.\n csharpNativeMathMinMax(node, name: string, parsedArg1: string, parsedArg2: string): string | undefined {\n const args = node.arguments;\n if ((args?.length !== 2) || !this.csharpMinMaxResultIsPlainValue(node)) {\n return undefined;\n }\n const leftKind = this.csharpExpressionTypeOf(args[0]);\n if ((leftKind === undefined) || (leftKind !== this.csharpExpressionTypeOf(args[1])) || (CSHARP_MINMAX_NATIVE_KINDS.indexOf(leftKind) < 0)) {\n return undefined;\n }\n if (!this.csharpOperandIsPlainNumber(args[0]) || !this.csharpOperandIsPlainNumber(args[1])) {\n return undefined;\n }\n return 'Math.' + name + '(' + parsedArg1 + ', ' + parsedArg2 + ')';\n }\n\n // the positions that take the primitive as the helper's box: assignment, argument,\n // dictionary/list value, return and ternary arm all box an int the same way. A receiver, an\n // `as`/`!` wrapper and the printer's hard `(string)` casts (throw / `delete`) do not.\n csharpMinMaxResultIsPlainValue(node): boolean {\n if (this.csharpIsClassThrowArgument(node) || this.csharpIsDeleteKey(node)) {\n return false;\n }\n let parent = node.parent;\n while (parent !== undefined && isParenthesizedExpression(parent)) {\n parent = parent.parent;\n }\n if (parent === undefined) {\n return false;\n }\n if ((isPropertyAccessExpression(parent) || isElementAccessExpression(parent) || isCallExpression(parent)) && parent.expression === node) {\n return false;\n }\n return (parent.kind !== SyntaxKind.AsExpression) && (parent.kind !== SyntaxKind.TypeAssertionExpression) && (parent.kind !== SyntaxKind.NonNullExpression);\n }\n\n // `parseInt(...)` / `parseFloat(...)` print the runtime helper call; the folds below replace\n // it with the exact box the helper returns, everything else falls through to the printer\n printCallExpression(node, identation) {\n const nativeParse = this.csharpNativeParseCall(node);\n if (nativeParse !== undefined) {\n return nativeParse;\n }\n return super.printCallExpression(node, identation);\n }\n\n csharpNativeParseCall(node) {\n if (node?.kind !== SyntaxKind.CallExpression || !isIdentifier(node.expression)) {\n return undefined;\n }\n const callee = node.expression.text as string;\n if ((callee !== 'parseInt') && (callee !== 'parseFloat')) {\n return undefined;\n }\n const args = node.arguments;\n if (args === undefined || args.length !== 1) {\n return undefined;\n }\n if (!this.csharpCalleeIsGlobalFunction(node.expression)) {\n return undefined; // a locally declared function of the same name is not the helper\n }\n const literal = (callee === 'parseInt') ? csharpParseIntLiteralArgument(args[0]) : csharpParseFloatLiteralArgument(args[0]);\n if (literal !== undefined) {\n return literal;\n }\n return this.csharpNativeParseCallOnDeclaredLocal(callee, args[0]);\n }\n\n // the global `parseInt` / `parseFloat` live in the TS lib chain; a declaration anywhere else\n // means the call prints a different function than the runtime helper\n csharpCalleeIsGlobalFunction(node): boolean {\n const checker: any = this.checkerOrUndefined();\n if (checker === undefined) {\n return true; // in-memory program without a checker: the name is all there is\n }\n const declarations = (checker.getSymbolAtLocation(node)?.declarations ?? []).map((d) => d.resolve());\n return declarations.every((declaration) => declaration.getSourceFile().fileName.indexOf('typescript') > -1);\n }\n\n // `parseFloat(x)` / `parseInt(x)` on a local declared numeric: Convert.ToDouble is an identity for\n // `double` and a widening for integer kinds. An Int64 parseInt operand (rounded above 2^53), a\n // double one (NaN/overflow -> null) and nullable or `object` locals (null -> 0) keep the helper.\n csharpNativeParseCallOnDeclaredLocal(callee, arg) {\n if (arg?.kind !== SyntaxKind.Identifier) {\n return undefined;\n }\n const kind = this.csharpExpressionTypeOf(arg);\n if (CSHARP_NUMERIC_KINDS.indexOf(kind) < 0) {\n return undefined;\n }\n const text = this.printNode(arg, 0);\n if (callee === 'parseFloat') {\n return (kind === 'double') ? text : `((double)${text})`;\n }\n return (kind === 'int') ? `((Int64)${text})` : undefined;\n }\n\n // `multiply(N, M)` over two unsigned numeric literals: two integers box the Int64 product\n // (`NL * ML`, the same value while it is a safe integer); otherwise the helper multiplies the\n // doubles and re-boxes an integral product as Int64, so only a fractional product goes native.\n csharpNativeLiteralProduct(left, right): string | undefined {\n if (!isNumericLiteral(left) || !isNumericLiteral(right)) {\n return undefined;\n }\n const leftText = left.text;\n const rightText = right.text;\n if (/^\\d+$/.test(leftText) && /^\\d+$/.test(rightText)) {\n const product = Number(leftText) * Number(rightText);\n return Number.isSafeInteger(product) ? `(${leftText}L * ${rightText}L)` : undefined;\n }\n const decimal = /^\\d+(\\.\\d+)?$/;\n // IsInteger reads the product through Convert.ToDecimal, i.e. rounded to 15 significant digits\n const rounded = Number((Number(leftText) * Number(rightText)).toPrecision(15));\n if (!decimal.test(leftText) || !decimal.test(rightText) || Number.isInteger(rounded)) {\n return undefined;\n }\n return `(${leftText} * ${rightText})`;\n }\n\n // `a % b` prints `mod(a, b)`: the helper takes the double remainder and converts back to Int64. An\n // Int32 dividend with a nonzero integer literal divisor is exact as double, so the native Int64\n // remainder matches. Int64 dividends (rounded above 2^53) and possibly-zero divisors keep helper.\n csharpNativeModExpression(left, right, leftText) {\n if (left?.kind !== SyntaxKind.Identifier) {\n return undefined;\n }\n if (this.csharpExpressionTypeOf(left) !== 'int') {\n return undefined;\n }\n const divisor = csharpLiteralNumericValue(right);\n if ((divisor === undefined) || !Number.isSafeInteger(divisor) || (divisor === 0)) {\n return undefined;\n }\n return `((Int64)${leftText} % ${divisor}L)`;\n }\n\n // `-x` prints `prefixUnaryNeg(ref x)`, whose typed overloads negate in place and return the same\n // box (`a = -a; return a;`): a local declared int / Int64 / double binds one, so the assignment is\n // the identical emission. Every other operand keeps the helper's runtime dispatch and null answer.\n csharpNativeNegatedLocal(operand, leftSide) {\n if (operand?.kind !== SyntaxKind.Identifier) {\n return undefined;\n }\n if (CSHARP_NUMERIC_KINDS.indexOf(this.csharpExpressionTypeOf(operand)) < 0) {\n return undefined;\n }\n return `(${leftSide} = -${leftSide})`;\n }\n\n // The printed receiver whose C# static type is a known collection: a local this printer declared\n // with a concrete type (csharpTypedLocals), or a hand-written BaseExchange field. undefined keeps\n // the runtime helper, since the printer cannot name the operand's type.\n csharpNativeReceiver(node): { text: string, type: string } | undefined {\n if (node?.kind === SyntaxKind.ParenthesizedExpression) {\n const inner = this.csharpNativeReceiver(node.expression);\n return inner === undefined ? undefined : { text: `(${inner.text})`, type: inner.type };\n }\n if (isIdentifier(node)) {\n const named = this.csharpTypedLocalType(node);\n return (named === undefined || CSHARP_NATIVE_COLLECTION_TYPES.indexOf(named) < 0) ? undefined : { text: this.printNode(node, 0), type: named };\n }\n if (isPropertyAccessExpression(node) && node.expression?.kind === SyntaxKind.ThisKeyword) {\n const name = node.name?.text as string;\n if (CSHARP_OBJECT_DICT_FIELDS.indexOf(name) >= 0) {\n // the field is declared `object`; its box is always a dictionary\n return { text: `((IDictionary)${this.printNode(node, 0)})`, type: 'IDictionary' };\n }\n return CSHARP_NATIVE_FIELDS[name] === undefined ? undefined : { text: this.printNode(node, 0), type: CSHARP_NATIVE_FIELDS[name] };\n }\n // a call whose printed C# type this printer already names (Object.keys, this.indexBy,\n // x.split, ...) is a collection too\n const callType = this.csharpCallReturnType(node);\n if (callType !== undefined && CSHARP_NATIVE_COLLECTION_TYPES.indexOf(callType) >= 0) {\n const printed = this.printNode(node, 0);\n return { text: printed.startsWith('new ') ? `(${printed})` : printed, type: callType };\n }\n return undefined;\n }\n\n // the C# types this printer can name on a local whose members replace the helpers:\n // the collection types (Count/ContainsKey) and string (Length/ContainsKey keys)\n csharpTypeIsNative(csharpType: string): boolean {\n return CSHARP_NATIVE_COLLECTION_TYPES.indexOf(csharpType) >= 0 || csharpType.indexOf('string') === 0;\n }\n\n // the C# type this printer declared for a local read, or undefined\n csharpTypedLocalType(node): string | undefined {\n const declaration = this.getChecker().getSymbolAtLocation(node)?.valueDeclaration?.resolve();\n return declaration === undefined ? undefined : this.csharpTypedLocals.get(declaration);\n }\n\n // the member that replaces getArrayLength on a declared C# type: Count counts the same\n // elements the helper's IList / ICollection branches count, Length is its string branch.\n // Any other declared type keeps the helper\n csharpCountMemberOf(csharpType: string): string | undefined {\n if ((csharpType === 'string') || (csharpType === 'string?')) {\n return 'Length';\n }\n return CSHARP_COUNT_TYPES.some((prefix) => csharpType.indexOf(prefix) === 0) ? 'Count' : undefined;\n }\n\n // `getArrayLength(x)` -> `(x?.Count ?? 0)` for a local whose printed declaration carries a C#\n // collection / string type (printer's declared-local table, then build/csharp-local-types.js).\n // The null-conditional is the helper's `null -> 0`; a plain member read would throw instead.\n csharpDeclaredLengthExpression(node): string | undefined {\n // a cast the printer itself printed around the receiver names the type outright, and\n // takes the whole expression as its operand (`(T)x?.Count` would cast the Count), so\n // the printed form is parenthesised before its own member read\n const printed = this.printNode(node, 0).trim();\n const cast = CSHARP_LENGTH_CAST.exec(printed);\n if (cast !== null) {\n const castMember = this.csharpCountMemberOf(cast[1]);\n if (castMember !== undefined) {\n return `(${isIdentifier(node) ? printed : `(${printed})`}?.${castMember} ?? 0)`;\n }\n }\n // `(x as List).length` / `((x)).length`: the printer prints the wrapper as the bare\n // local when it elides the assertion, so the read is still the identifier\n const receiver = this.csharpLengthReceiverIdentifier(node);\n if (receiver === undefined) {\n return undefined;\n }\n const named = this.csharpTypedLocalType(receiver);\n const csharpType = named !== undefined ? named\n : (this.csharpExpressionTypeResolver ? this.csharpExpressionTypeResolver(receiver) : undefined)\n ?? this.csharpLengthReceiverType(receiver);\n const member = csharpType === undefined ? undefined : this.csharpCountMemberOf(csharpType);\n if (member === undefined) {\n return undefined;\n }\n // a wrapper the printer does print (a `((string)x)` cast keeps its assertion) is a\n // different receiver: only the printed-as-identifier shape may take the member read\n const receiverText = this.printNode(receiver, 0);\n if (this.printNode(node, 0).trim() !== receiverText.trim()) {\n return undefined;\n }\n return `(${receiverText}?.${member} ?? 0)`;\n }\n\n // the printed key of ContainsKey must itself be a C# string: a literal, a local this\n // printer declared `string`, a call it types as string, or its own `((string)x)` cast\n csharpNativeStringKey(key): string | undefined {\n if (key?.kind === SyntaxKind.ParenthesizedExpression) {\n return this.csharpNativeStringKey(key.expression);\n }\n if (isStringLiteralLikeNode(key)) {\n return this.printNode(key, 0);\n }\n if (isIdentifier(key)) {\n const named = this.csharpTypedLocalType(key);\n // a non-nullable string local is the printed proof ContainsKey needs (`string?`\n // still needs the checker's string, or a null key would throw where inOp says false)\n if (named === 'string') {\n return this.printNode(key, 0);\n }\n if ((named === undefined) || (named.indexOf('string') !== 0)) {\n return undefined;\n }\n return this.isStringType(this.getChecker().getTypeAtLocation(key).flags) ? this.printNode(key, 0) : undefined;\n }\n if (this.csharpCallReturnType(key) === 'string') {\n // the callee's C# signature is a plain string; the checker proof is the phase-1 gate\n return this.isStringType(this.getChecker().getTypeAtLocation(key).flags) ? this.printNode(key, 0) : undefined;\n }\n const printed = this.printNode(key, 0);\n if (!printed.startsWith('((string)')) {\n return undefined;\n }\n // the cast is the printer's own string view of the value: only a checker-proven\n // string operand may have it (a non-string box would throw where the helper says false)\n return this.isStringType(this.getChecker().getTypeAtLocation(key).flags) ? printed : undefined;\n }\n\n // the checker's view of an `in` / `.length` operand: a dictionary carries a string\n // index signature, an array is the Array reference type. `any` proves nothing\n csharpIsDictionaryType(type): boolean {\n if (type === undefined || this.isAnyType(type.flags)) {\n return false;\n }\n return this.getChecker().getIndexTypeOfType(type, IndexKind.String) !== undefined;\n }\n\n csharpIsArrayType(type): boolean {\n if (type === undefined || this.isAnyType(type.flags)) {\n return false;\n }\n return type?.getSymbol()?.escapedName === 'Array';\n }\n\n // a union of dictionary members and nullish ones (what a `Dict | undefined` signature\n // widens to): a C# reference that happens to be null is a nullish arm, not a scalar one.\n // Any other member (arrays, classes, scalars) keeps the helper\n csharpNullableDictionaryType(type): boolean {\n if (type === undefined || ((type.flags & TypeFlags.Union) === 0)) {\n return false;\n }\n let dictionaries = 0;\n for (const member of (type as UnionType).getTypes() ?? []) {\n if ((member.flags & (TypeFlags.Undefined | TypeFlags.Null)) !== 0) {\n continue;\n }\n if (!this.csharpIsDictionaryType(member)) {\n return false;\n }\n dictionaries++;\n }\n return dictionaries > 0;\n }\n\n // a dictionary whose values are `any` — the shape the transpiled C# boxes as\n // Dictionary. A `Dictionary` / `Dictionary` keeps the\n // helper: the C# cast target is invariant, so `IDictionary` would throw\n csharpIsAnyValuedDictionaryType(type): boolean {\n if (!this.csharpIsDictionaryType(type)) {\n return false;\n }\n const value = this.getChecker().getIndexTypeOfType(type, IndexKind.String);\n return (value !== undefined) && this.isAnyType(value.flags);\n }\n\n // the parameter printFunctionBody gives a `??= new Dictionary()` line\n // (its initializer is an object literal): from the first statement on its box is a\n // dictionary whatever the caller passed, so a null check would be dead code\n csharpDictionaryParamsBag(node): boolean {\n const declaration = this.getChecker().getSymbolAtLocation(node)?.valueDeclaration?.resolve();\n const initializer = (declaration?.kind === SyntaxKind.Parameter) ? (declaration as ParameterDeclaration).initializer : undefined;\n return initializer?.kind === SyntaxKind.ObjectLiteralExpression;\n }\n\n // D2: the name is rewritten before this read, so the box it holds there is not the one its\n // declaration started with (the scan is a name match, so any earlier write bails)\n csharpNameWrittenBefore(node, name: string): boolean {\n const scope = this.csharpEnclosingFunction(node);\n if (scope === undefined) {\n return true;\n }\n let written = false;\n const visit = (n) => {\n if (written || (n.pos >= node.pos)) {\n return;\n }\n if ((n.kind === SyntaxKind.Identifier) && (n.text === name)) {\n const parent = n.parent;\n const assignment = (parent?.kind === SyntaxKind.BinaryExpression) && (parent.left === n);\n const increment = ((parent?.kind === SyntaxKind.PostfixUnaryExpression) || (parent?.kind === SyntaxKind.PrefixUnaryExpression))\n && ((parent.operator === SyntaxKind.PlusPlusToken) || (parent.operator === SyntaxKind.MinusMinusToken));\n if (assignment || increment) {\n written = true;\n return;\n }\n }\n n.forEachChild(visit);\n };\n scope.forEachChild(visit);\n return written;\n }\n\n // The C# dictionary a ContainsKey receiver reads through, or undefined: printer tables, then the\n // build layer's declared-type table, then an `object` parameter proven a dictionary by TS or an\n // emitted `??= new Dictionary()`. That case applies the helper's cast + null test.\n csharpNativeDictionaryReceiver(obj): { text: string, nullTest?: string } | undefined {\n const checker = this.getChecker();\n const type = checker.getTypeAtLocation(obj);\n const nullable = this.csharpNullableDictionaryType(type);\n const receiver = this.csharpNativeReceiver(obj);\n if (receiver !== undefined) {\n // only a dictionary C# type carries ContainsKey (IList keeps the helper)\n if (receiver.type.indexOf('Dictionary<') < 0) {\n return undefined;\n }\n return nullable ? { text: receiver.text, nullTest: receiver.text } : { text: receiver.text };\n }\n // the embedding build layer's declared-type table names the type the local's own\n // declaration carries, so it needs neither the checker proof nor a cast\n const declared = this.csharpExpressionTypeOf(obj);\n if (declared !== undefined) {\n return (declared.indexOf('Dictionary<') >= 0) ? { text: this.printNode(obj, 0) } : undefined;\n }\n // an `object` box: only a parameter of this function (a local may box the hand-written\n // base's own instantiation — `client.futures` is IDictionary — and the\n // printer cannot tell), and only while nothing has rewritten it (D2)\n if (!isIdentifier(obj) || (this.csharpTypedLocalType(obj) !== undefined)) {\n return undefined;\n }\n const name = obj.text as string;\n if (this.csharpNameWrittenBefore(obj, name)) {\n return undefined;\n }\n const declaration = checker.getSymbolAtLocation(obj)?.valueDeclaration?.resolve();\n if (declaration?.kind !== SyntaxKind.Parameter) {\n return undefined; // a local may box a hand-written instantiation the printer cannot name\n }\n const printed = this.printNode(obj, 0);\n const text = `((IDictionary)${printed})`;\n // the params bag: the printer's own `??= new Dictionary()` line made the\n // box a dictionary whatever the caller passed, so no checker proof is needed (and no\n // null test — the line is the first statement of the body)\n if (this.csharpDictionaryParamsBag(obj)) {\n return { text };\n }\n if ((!this.csharpIsDictionaryType(type) && !nullable) || !this.csharpIsAnyValuedDictionaryType(type)) {\n return undefined;\n }\n return { text, nullTest: printed };\n }\n\n // `key in obj` -> `obj.ContainsKey(key)`, only when both the printed key and the printed\n // operand are already C# string / dictionary values. Every other shape keeps the inOp helper\n csharpNativeInExpression(key, obj): string | undefined {\n const printedKey = this.csharpNativeStringKey(key);\n if (printedKey === undefined) {\n return this.csharpDeclaredDictInExpression(key, obj);\n }\n const receiver = this.csharpNativeDictionaryReceiver(obj);\n if (receiver !== undefined) {\n const call = `${receiver.text}.ContainsKey(${printedKey})`;\n return (receiver.nullTest === undefined) ? call : `(${receiver.nullTest} != null && ${call})`;\n }\n // a receiver the embedding build layer retypes AFTER printing: the checker may see\n // `any` on it, so no table above names it (see csharpDeclaredDictInExpression)\n return this.csharpDeclaredDictInExpression(key, obj);\n }\n\n // `key in obj` on a local whose EMITTED declaration is a dictionary the printer cannot name itself\n // (build/csharp-local-types.js retypes it, answers csharpDeclaredDictReceiverType): inOp's dict\n // branch is exactly `obj?.ContainsKey(key) == true` for a key that is already a C# string.\n csharpDeclaredDictInExpression(key, obj): string | undefined {\n if (obj?.kind !== SyntaxKind.Identifier) {\n return undefined;\n }\n const declared = (typeof this.csharpDeclaredDictReceiverType === 'function') ? this.csharpDeclaredDictReceiverType(obj) : undefined;\n if ((declared === undefined) || (declared.indexOf('Dictionary<') < 0)) {\n return undefined;\n }\n const printedKey = this.csharpNativeStringKey(key) ?? this.csharpDeclaredStringKey(key);\n if (printedKey === undefined) {\n return undefined;\n }\n const receiver = this.printNode(obj, 0);\n if (isStringLiteralLikeNode(key)) {\n return `(${receiver}?.ContainsKey(${printedKey}) == true)`;\n }\n // an identifier key may hold null, where a bare ContainsKey throws ArgumentNullException:\n // the helper's own null guard is emitted back. Undefined by default, so an untyped run is\n // byte-identical (a receiver no hook names keeps the helper call).\n if (isIdentifier(key)) {\n return `((${printedKey} != null) && (${receiver}?.ContainsKey(${printedKey}) == true))`;\n }\n return undefined;\n }\n\n // the key of the rule above, when the printer's own tables name no string for it but the\n // embedding build layer's record does (the same hook the isEqual twin reads)\n csharpDeclaredStringKey(key): string | undefined {\n if (key?.kind !== SyntaxKind.Identifier) {\n return undefined;\n }\n const type = (typeof this.csharpLocalTypeOf === 'function') ? this.csharpLocalTypeOf(key) : undefined;\n return ((type === 'string') || (type === 'string?')) ? this.printNode(key, 0) : undefined;\n }\n\n // `x.length` -> `x.Count`, same proof for the checker's array operands; strings keep\n // the `((string)x).Length` branch and every unproven operand keeps getArrayLength\n csharpNativeLengthExpression(expression): string | undefined {\n if (this.csharpIsArrayType(this.getChecker().getTypeAtLocation(expression))) {\n const receiver = this.csharpNativeReceiver(expression);\n if (receiver !== undefined) {\n return `${receiver.text}.Count`;\n }\n }\n return this.csharpDeclaredLengthExpression(expression);\n }\n\n // the C# type of a dictionary element read is `object`: isEqual compares the boxed\n // element, which `as` + the operator reproduce exactly (any other box reads as null,\n // where isEqual also answers false)\n csharpNativeElementLiteralEquality(left, right, leftText: string, rightText: string, isEquality: boolean): string | undefined {\n const elementIsLeft = this.csharpStringKeyedElementAccess(left);\n if (!elementIsLeft && !this.csharpStringKeyedElementAccess(right)) {\n return undefined;\n }\n const [element, literal] = elementIsLeft ? [left, right] : [right, left];\n const isBoolLiteral = (literal.kind === SyntaxKind.TrueKeyword) || (literal.kind === SyntaxKind.FalseKeyword);\n const isStringLiteral = isStringLiteralLikeNode(literal);\n if (!isBoolLiteral && !isStringLiteral) {\n return undefined;\n }\n if (this.csharpDictionaryReceiverType(element.expression) === undefined) {\n return undefined;\n }\n const wanted = isBoolLiteral ? CSHARP_SCALAR_ELEMENT_BOOL : CSHARP_SCALAR_ELEMENT_STRING;\n if ((this.csharpScalarElementKinds(element) & wanted) === 0) {\n return undefined;\n }\n const token = isEquality ? '==' : '!=';\n if (isStringLiteral && this.csharpNumericStringLiteral(literal)) {\n return undefined; // isEqual's double/decimal branches coerce a numeric string\n }\n const cast = isBoolLiteral ? 'bool?' : 'string';\n const castElement = `(${elementIsLeft ? leftText : rightText} as ${cast})`;\n const otherText = elementIsLeft ? rightText : leftText;\n return elementIsLeft ? `(${castElement} ${token} ${otherText})` : `(${otherText} ${token} ${castElement})`;\n }\n\n // `x[\"k\"]` — the element read of a dictionary key this printer prints as getValue(x, \"k\")\n csharpStringKeyedElementAccess(node): boolean {\n return (node?.kind === SyntaxKind.ElementAccessExpression) && isStringLiteralLikeNode(node.argumentExpression);\n }\n\n // isEqual compares a boxed number with a numeric string by converting both, which the\n // string cast of the native form cannot reproduce: a numeric-looking literal stays on\n // the helper (the element proof says the box is a string, and a number box would differ)\n csharpNumericStringLiteral(node): boolean {\n const text = String(node.text).trim();\n return (text !== '') && !isNaN(Number(text));\n }\n\n // the declared C# type of a dictionary receiver: a local the embedding build layer retypes\n // (csharpExpressionTypeResolver) or a hand-written BaseExchange field; undefined keeps the\n // runtime helper, since the printer cannot name the box the key lives in\n csharpDictionaryReceiverType(node): string | undefined {\n const native = this.csharpNativeReceiver(node);\n const declared = (native !== undefined) ? native.type : this.csharpExpressionTypeOf(node);\n if ((declared === undefined) || (declared.indexOf('Dictionary<') < 0)) {\n return undefined;\n }\n return declared;\n }\n\n // the scalar branches isEqual can compare an element with: every member of the element's\n // TypeScript type must be a boolean, a string or undefined, or the helper stays\n csharpScalarElementKinds(node): number {\n try {\n const type = this.getChecker().getTypeAtLocation(node);\n const members = ((type.flags & TypeFlags.Union) !== 0) ? ((type as any).getTypes() ?? []) : [ type ];\n let kinds = 0;\n for (const member of members) {\n const flags = member.flags;\n if (flags & (TypeFlags.Boolean | TypeFlags.BooleanLiteral)) {\n kinds |= CSHARP_SCALAR_ELEMENT_BOOL;\n } else if (flags & (TypeFlags.String | TypeFlags.StringLiteral | TypeFlags.TemplateLiteral)) {\n kinds |= CSHARP_SCALAR_ELEMENT_STRING;\n } else if (!(flags & TypeFlags.Undefined)) {\n return 0;\n }\n }\n return kinds;\n } catch (e) {\n return 0; // in-memory program without a checker\n }\n }\n\n // the C# type the emitted declaration gives a `.length` receiver, or undefined when this\n // printer names none. Installed by build/csharp-local-types.js; undefined by default, so\n // the untyped emission is byte-identical without the override\n csharpLengthReceiverType(expression): string | undefined {\n return undefined;\n }\n\n // `isEqual (x, \"lit\")` -> `x == \"lit\"` (and `!isEqual` -> `!=`) when the operand's emitted\n // declaration is a string: isEqual's string branch is the same ordinal comparison; a null operand\n // is false in both. Gated on csharpLocalTypeOf; an unnamed operand keeps the helper call.\n csharpStringLiteralEquality(op, left, right, leftText: string, rightText: string): string | undefined {\n const equality = (op === SyntaxKind.EqualsEqualsToken) || (op === SyntaxKind.EqualsEqualsEqualsToken);\n const inequality = (op === SyntaxKind.ExclamationEqualsToken) || (op === SyntaxKind.ExclamationEqualsEqualsToken);\n if (!equality && !inequality) {\n return undefined;\n }\n const leftLiteral = isStringLiteral(left);\n const rightLiteral = isStringLiteral(right);\n if (leftLiteral === rightLiteral) {\n return undefined; // exactly one side must be the (never-null) string literal\n }\n const operand = leftLiteral ? right : left;\n if (operand?.kind !== SyntaxKind.Identifier) {\n return undefined;\n }\n const operandType = this.csharpLocalTypeOf(operand);\n if ((operandType !== 'string') && (operandType !== 'string?')) {\n return undefined;\n }\n return `${leftText} ${inequality ? '!=' : '=='} ${rightText}`;\n }\n\n // U55: `isEqual (x, null)` -> `x == null` (`!isEqual` -> `!=`) when the emitted declaration is\n // a typed reference or nullable scalar: the helper's null guards return exactly the C# null test,\n // never reach a typed branch. Gated on csharpNullComparisonTypeOf; unnamed operands keep helper.\n csharpNullLiteralEquality(op, left, right, leftText: string, rightText: string): string | undefined {\n const equality = (op === SyntaxKind.EqualsEqualsToken) || (op === SyntaxKind.EqualsEqualsEqualsToken);\n const inequality = (op === SyntaxKind.ExclamationEqualsToken) || (op === SyntaxKind.ExclamationEqualsEqualsToken);\n if (!equality && !inequality) {\n return undefined;\n }\n const leftNull = this.csharpOperandIsNullLiteral(left);\n const rightNull = this.csharpOperandIsNullLiteral(right);\n if (leftNull === rightNull) {\n return undefined; // exactly one side must be the (never-typed) null literal\n }\n let operand = leftNull ? right : left;\n while (operand?.kind === SyntaxKind.ParenthesizedExpression) {\n operand = operand.expression;\n }\n if (operand?.kind !== SyntaxKind.Identifier) {\n return undefined;\n }\n const operandType = (typeof this.csharpNullComparisonTypeOf === 'function') ? this.csharpNullComparisonTypeOf(operand) : undefined;\n if (!this.csharpNullComparisonTypeIsProvable(operandType)) {\n return undefined;\n }\n return this.csharpNullComparison(leftNull ? rightText : leftText, equality);\n }\n\n // `null` and the `undefined` identifier both print as the C# null literal\n csharpOperandIsNullLiteral(node): boolean {\n return (node?.kind === SyntaxKind.NullKeyword)\n || ((node?.kind === SyntaxKind.Identifier) && (node.text === 'undefined'));\n }\n\n printCustomBinaryExpressionIfAny(node, identation) {\n const left = node.left;\n const right = node.right;\n\n const op = node.operatorToken.kind;\n\n if (left.kind === SyntaxKind.TypeOfExpression) {\n const typeOfExpression = this.handleTypeOfInsideBinaryExpression(node, identation);\n if (typeOfExpression) {\n return typeOfExpression;\n }\n }\n\n // handle: [x,d] = this.method()\n if (op === SyntaxKind.EqualsToken && left.kind === SyntaxKind.ArrayLiteralExpression) {\n const arrayBindingPatternElements = left.elements;\n const parsedArrayBindingElements = arrayBindingPatternElements.map((e) => this.printNode(e, 0));\n const syntheticName = parsedArrayBindingElements.join(\"\") + \"Variable\";\n\n // when the holder's C# type is known (see csharpDestructuringTempType), declare the\n // holder with it and index it directly: `((IList)holder)[i]` names nothing new\n const tempType = this.csharpDestructuringTempType(right);\n const tempExpression = this.printNode(right, 0);\n\n const tempCast = (tempType && this.csharpDestructuringTempNeedsCast(right, tempExpression)) ? `(${tempType})` : '';\n let arrayBindingStatement = tempType ? `${tempType} ${syntheticName} = ${tempCast}${tempExpression};\\n` : `var ${syntheticName} = ${tempExpression};\\n`;\n\n parsedArrayBindingElements.forEach((e, index) => {\n // const type = this.getType(node);\n // const parsedType = this.getTypeFromRawType(type);\n const leftElement = arrayBindingPatternElements[index];\n const leftType = this.getChecker().getTypeAtLocation(leftElement);\n const parsedType = this.getTypeFromRawType(leftType);\n\n const castExp = parsedType ? `(${parsedType})` : \"\";\n\n // const statement = this.getIden(identation) + `${e} = (${castExp}((List)${syntheticName}))[${index}]`;\n const statement = this.getIden(identation) + (tempType ? `${e} = ${syntheticName}[${index}]` : `${e} = ((IList)${syntheticName})[${index}]`);\n if (index < parsedArrayBindingElements.length - 1) {\n arrayBindingStatement += statement + \";\\n\";\n } else {\n // printStatement adds the last ;\n arrayBindingStatement += statement;\n }\n });\n\n return arrayBindingStatement;\n }\n\n if (op === SyntaxKind.InKeyword) {\n const nativeIn = this.csharpNativeInExpression(left, right);\n if (nativeIn !== undefined) {\n return nativeIn;\n }\n return `inOp(${this.printNode(right, 0)}, ${this.printNode(left, 0)})`;\n }\n\n // only print the operands when this op is actually handled here; otherwise\n // the base printBinaryExpression prints them, and doing it eagerly means\n // every unhandled binary expression gets its subtrees printed twice\n if (op === SyntaxKind.PlusEqualsToken || op === SyntaxKind.MinusEqualsToken || op in this.binaryExpressionsWrappers) {\n const nativeComparison = this.csharpNativeNumericComparison(node, identation);\n if (nativeComparison !== undefined) {\n return nativeComparison;\n }\n const leftText = this.printNode(left, 0);\n const rightText = this.printNode(right, 0);\n\n if (op === SyntaxKind.PlusEqualsToken) {\n return `${leftText} = add(${leftText}, ${rightText})`;\n }\n\n if (op === SyntaxKind.MinusEqualsToken) {\n return `${leftText} = subtract(${leftText}, ${rightText})`;\n }\n\n const isEquality = (op === SyntaxKind.EqualsEqualsToken) || (op === SyntaxKind.EqualsEqualsEqualsToken);\n const isDifference = (op === SyntaxKind.ExclamationEqualsToken) || (op === SyntaxKind.ExclamationEqualsEqualsToken);\n if (isEquality || isDifference) {\n // `isEqual (x, \"lit\")` / `!isEqual (x, \"lit\")` over a string-typed operand (S60,\n // csharpStringLiteralEquality) first; anything the hook cannot name falls through to the\n // printed-form inlining below, byte-identically.\n const nativeEquality = this.csharpStringLiteralEquality(op, left, right, leftText, rightText);\n // `isEqual (x, null)` / `!isEqual (x, null)` over a typed-reference or nullable-scalar operand\n // (U55, csharpNullLiteralEquality), the hook-gated null-literal twin of the rule above; anything\n // it cannot name falls through to the printed-form inlining below, byte-identically.\n const native = nativeEquality\n ?? this.csharpNullLiteralEquality(op, left, right, leftText, rightText)\n ?? this.printInlineEquality(left, right, leftText, rightText, isEquality)\n ?? this.csharpNativeElementLiteralEquality(left, right, leftText, rightText, isEquality)\n ?? this.csharpNativeNumericCallEquality(left, right, leftText, rightText, isEquality);\n if (native !== undefined) {\n return native;\n }\n }\n\n if (op === SyntaxKind.PlusToken) {\n // `add (x, y)` -> `(x + y)` when the classifier proves the LEFT operand's emitted declaration is a\n // string (U57): the call binds add(string, string) / add(string, object), exactly this\n // concatenation. Gated on the hook, so an unnamed operand keeps the helper.\n const nativeConcat = this.csharpNativeStringConcat(left, right, leftText, rightText);\n if (nativeConcat !== undefined) {\n return nativeConcat;\n }\n }\n\n if (op === SyntaxKind.AsteriskToken) {\n const nativeProduct = this.csharpNativeLiteralProduct(left, right);\n if (nativeProduct !== undefined) {\n return nativeProduct;\n }\n }\n\n const [open, close] = this.binaryExpressionsWrappers[op];\n if (op === SyntaxKind.PercentToken) {\n const nativeMod = this.csharpNativeModExpression(left, right, leftText);\n if (nativeMod !== undefined) {\n return nativeMod;\n }\n }\n return `${open}${leftText}, ${rightText}${close}`;\n }\n\n // x = y\n // cast y to x type when y is unknown\n // if (op === SyntaxKind.EqualsToken) {\n // const leftType = this.getChecker().getTypeAtLocation(left);\n // const rightType = this.getChecker().getTypeAtLocation(right);\n\n // if (this.isAnyType(rightType.flags) && !this.isAnyType(leftType.flags)) {\n // // const parsedType = this.getTypeFromRawType(leftType);\n // return `${leftText} = ${rightText}`;\n // }\n // }\n\n return undefined;\n }\n\n // castVariableAssignmentIfNeeded(left, right, identation) {\n // const leftType = this.getChecker().getTypeAtLocation(left);\n // const rightType = this.getChecker().getTypeAtLocation(right);\n\n // const leftText = this.printNode(left, 0);\n // const rightText = this.printNode(right, 0);\n\n // if (this.isAnyType(rightType.flags) && !this.isAnyType(leftType.flags)) {\n // const parsedType = this.getTypeFromRawType(leftType);\n // return `${this.getIden(identation)}${leftText} = (${parsedType})${rightText}`;\n // }\n // return undefined;\n // }\n\n // the C# type of a whole-call / whole-property initializer, keyed on the AST so\n // the printer's cast wrappers (`((string)x).ToUpper()`) do not hide the callee\n csharpCallReturnType(initializer): string | undefined {\n if (initializer?.kind === SyntaxKind.PropertyAccessExpression) {\n // `x.length` prints `((string)x).Length` or `getArrayLength(x)`, both int\n return (initializer.name?.text === 'length') ? 'int' : undefined;\n }\n if (initializer?.kind !== SyntaxKind.CallExpression) {\n return undefined;\n }\n const expression = initializer.expression;\n if (expression?.kind !== SyntaxKind.PropertyAccessExpression) {\n return undefined;\n }\n const methodName = expression.name?.text as string;\n const target = expression.expression;\n if (target?.kind === SyntaxKind.ThisKeyword) {\n // the table names the C# signature of the same-name base helper, which the printed\n // call only binds when the printer resolves the callee. An unresolvable one\n // (`this.proxyUrlCallback(...)` — a property holding the function — or a\n // checker-less program) prints `callDynamically(this, \"name\", ...)` instead, and\n // that helper returns `object`: no concrete type may be named for its value\n if (!this.csharpCalleeResolves(initializer)) {\n return undefined;\n }\n return CSHARP_THIS_RETURN_TYPES[methodName];\n }\n if (target?.kind === SyntaxKind.Identifier) {\n return CSHARP_STATIC_RETURN_TYPES[(target.text as string) + '.' + methodName] ?? CSHARP_METHOD_RETURN_TYPES[methodName];\n }\n return CSHARP_METHOD_RETURN_TYPES[methodName];\n }\n\n // mirrors printWrappedUnknownThisProperty: a `this.(...)` call whose callee the\n // checker cannot resolve is printed as `callDynamically(this, \"\", ...)`, whose C#\n // signature returns `object` whatever the name says\n csharpCalleeResolves(node): boolean {\n const checker: any = this.checkerOrUndefined();\n if (checker === undefined) {\n return false;\n }\n return checker.getResolvedSignature(node)?.declaration !== undefined;\n }\n\n // the concrete C# type the initializer already produces, or undefined when the\n // printer cannot name it (this.safeString, getValue, add, parseInt, ... return object)\n csharpTypeOfInitializer(initializer): string | undefined {\n switch (initializer?.kind) {\n case SyntaxKind.StringLiteral:\n case SyntaxKind.NoSubstitutionTemplateLiteral:\n return 'string';\n case SyntaxKind.TrueKeyword:\n case SyntaxKind.FalseKeyword:\n return 'bool';\n case SyntaxKind.PrefixUnaryExpression:\n // `!x` prints `!isTrue(x)`\n return (initializer.operator === SyntaxKind.ExclamationToken) ? 'bool' : undefined;\n case SyntaxKind.ParenthesizedExpression:\n return this.csharpTypeOfInitializer(initializer.expression);\n case SyntaxKind.BinaryExpression: {\n const op = initializer.operatorToken.kind;\n // `a || b` prints `isTrue(a) || isTrue(b)`; the comparison wrappers and\n // `in` all return bool\n switch (op) {\n case SyntaxKind.BarBarToken:\n case SyntaxKind.AmpersandAmpersandToken:\n case SyntaxKind.EqualsEqualsToken:\n case SyntaxKind.EqualsEqualsEqualsToken:\n case SyntaxKind.ExclamationEqualsToken:\n case SyntaxKind.ExclamationEqualsEqualsToken:\n case SyntaxKind.GreaterThanToken:\n case SyntaxKind.GreaterThanEqualsToken:\n case SyntaxKind.LessThanToken:\n case SyntaxKind.LessThanEqualsToken:\n case SyntaxKind.InKeyword:\n return 'bool';\n }\n return undefined;\n }\n }\n return this.csharpCallReturnType(initializer) ?? (this.csharpBoolCallTyped(initializer) ? 'bool' : undefined);\n }\n\n // A `this.(...)` call to a method the enclosing class declares with a plain `bool` return\n // (csharpBooleanReturnType prints that `bool`) hands back an unboxed bool, so a local holding it is\n // `bool`. Base helpers, names the table answers and overloaded families keep their box.\n csharpBoolCallTyped(node): boolean {\n if (node?.kind !== SyntaxKind.CallExpression || !this.csharpIsCheckedBoolean(node)) {\n return false;\n }\n const expression = node.expression;\n if (expression?.kind !== SyntaxKind.PropertyAccessExpression || expression.expression?.kind !== SyntaxKind.ThisKeyword) {\n return false;\n }\n let declaration;\n let checker;\n try {\n checker = this.getChecker();\n declaration = checker.getResolvedSignature(node)?.declaration?.resolve();\n } catch (e) {\n return false;\n }\n if (!isMethodDeclaration(declaration) || (this.csharpBooleanReturnType(declaration) !== 'bool')) {\n return false;\n }\n const owner = findAncestor(declaration, isClassLikeDeclaration);\n if ((owner === undefined) || (owner !== findAncestor(node, isClassLikeDeclaration))) {\n return false;\n }\n return checker.getSymbolAtLocation(declaration.name)?.declarations?.length === 1;\n }\n\n csharpEnclosingFunction(node) {\n let current = node?.parent;\n while (current) {\n switch (current.kind) {\n case SyntaxKind.MethodDeclaration:\n case SyntaxKind.FunctionDeclaration:\n case SyntaxKind.FunctionExpression:\n case SyntaxKind.ArrowFunction:\n case SyntaxKind.Constructor:\n case SyntaxKind.SourceFile:\n return current;\n }\n current = current.parent;\n }\n return undefined;\n }\n\n csharpTypeNameIsShadowed(scope, csharpType: string): boolean {\n const names = csharpType.match(/[A-Za-z_]\\w*/g) ?? [];\n const relevant = names.filter((n) => CSHARP_TYPE_NAMES.indexOf(n) >= 0);\n if (relevant.length === 0 || scope === undefined) {\n return false;\n }\n return this.hasNodeWhere(scope, (n: any) => {\n const isBinding = (n.kind === SyntaxKind.Parameter) || (n.kind === SyntaxKind.VariableDeclaration);\n if (isBinding && (n.name?.kind === SyntaxKind.Identifier)) {\n const printed = this.printNode(n.name, 0);\n if (relevant.indexOf(printed) >= 0) { return true; }\n }\n return false;\n });\n }\n\n // reject the refinement when something downstream needs the local to stay `object`:\n // `x.push(v)` prints `((IList)x).Add(v)` on a value that must be boxed, a\n // later assignment of another concrete type would stop compiling, and `x++` prints\n // `postFixIncrement(ref x)` whose parameter is `ref object`\n csharpLocalIsSafeToType(scope, declaration, varName: string, csharpType: string, safeAccessor = false): boolean {\n if (scope === undefined) {\n return false;\n }\n return !this.hasNodeWhere(scope, (n: any) => {\n if ((n.kind === SyntaxKind.Identifier) && (n.text === varName) && (n !== declaration.name)) {\n const parent = n.parent;\n if (parent?.kind === SyntaxKind.VariableDeclaration && parent.name === n) {\n return; // a sibling block-scoped declaration; it gets its own type\n }\n if ((parent?.kind === SyntaxKind.PostfixUnaryExpression) || (parent?.kind === SyntaxKind.PrefixUnaryExpression)) {\n const op = parent.operator;\n if ((op === SyntaxKind.PlusPlusToken) || (op === SyntaxKind.MinusMinusToken)) {\n return true;\n }\n // prefixUnaryNeg/Plus(ref x) has int / Int64 / double twins only: a\n // nullable or reference local would not bind any overload\n if (safeAccessor && (op !== SyntaxKind.ExclamationToken) && (csharpType !== 'int') && (csharpType !== 'Int64') && (csharpType !== 'double')) {\n return true;\n }\n }\n if (parent?.kind === SyntaxKind.SpreadElement) {\n return true;\n }\n if (parent?.kind === SyntaxKind.ArrayLiteralExpression\n && parent.parent?.kind === SyntaxKind.BinaryExpression\n && parent.parent.left === parent\n && parent.parent.operatorToken.kind === SyntaxKind.EqualsToken) {\n return true;\n }\n if (parent?.kind === SyntaxKind.PropertyAccessExpression && parent.expression === n) {\n const method = parent.name?.text;\n // these print as `((IList)x).Add(...)` / `x = (x as IList)...`\n if ((method === 'push') || (method === 'reverse') || (method === 'sort')) {\n return true;\n }\n // the remaining list methods print an `((IList)x)` cast too; only\n // a safe* list local can carry one\n if (safeAccessor && !this.csharpTypeIsList(csharpType) && ((method === 'join') || (method === 'shift') || (method === 'pop'))) {\n return true;\n }\n }\n if (safeAccessor) {\n // `const [a, b] = x` prints a `((IList)x)[0]` read\n if (parent?.kind === SyntaxKind.VariableDeclaration && parent.name?.kind === SyntaxKind.ArrayBindingPattern && !this.csharpTypeIsList(csharpType)) {\n return true;\n }\n // `throw new ExchangeError (x)` wraps the argument in a hard `(string)`\n // cast, which only compiles from `object` or a string; `delete obj[x]` prints\n // `.Remove((string)x)`, the same hard cast\n if (!this.csharpTypeIsStringType(csharpType) && (this.csharpIsClassThrowArgument(n) || this.csharpIsDeleteKey(n))) {\n return true;\n }\n }\n if (parent?.kind === SyntaxKind.BinaryExpression && parent.left === n) {\n const op = parent.operatorToken.kind;\n if (op === SyntaxKind.EqualsToken) {\n if (this.csharpTypeOfInitializer(parent.right) !== csharpType) {\n return true;\n }\n } else if ((op >= SyntaxKind.FirstCompoundAssignment) && (op <= SyntaxKind.LastCompoundAssignment)) {\n return true;\n }\n }\n // a `string?` local as the LEFT operand of `+` prints add(, ...): the\n // nullable-to-`string` conversion makes add(string, ...) a better match than\n // add(object, object), which turns a null left into the right operand instead\n // of null (see the same rule in the ccxt cs/ccxt/base comments)\n if (safeAccessor && (csharpType === 'string?') && this.csharpIsLeftPlusOperand(n)) {\n return true;\n }\n }\n return false;\n });\n }\n\n // a `((string)x)` wrapper is redundant as soon as the receiver's static C# type is\n // already string: the cast names the box the value is in, it never changes the value\n\n getCSharpLocalType(declaration): string {\n const csharpType = this.csharpTypeOfInitializer(declaration.initializer);\n if (csharpType === undefined) {\n return this.VAR_TOKEN;\n }\n // the scan matches AST identifiers, so it needs the source name, not the\n // printed one (`string` is renamed to `str` on the way out)\n const sourceName = declaration.name?.text;\n if (sourceName === undefined) {\n return this.VAR_TOKEN;\n }\n const scope = this.csharpEnclosingFunction(declaration);\n const safeAccessor = this.csharpIsSafeAccessorCall(declaration.initializer);\n if (this.csharpTypeNameIsShadowed(scope, csharpType) || !this.csharpLocalIsSafeToType(scope, declaration, sourceName, csharpType, safeAccessor)) {\n return this.VAR_TOKEN;\n }\n return csharpType;\n }\n\n // `this.safeString2 (...)`: the printed call binds the concrete C# signature of the\n // same-name base helper (see CSHARP_THIS_RETURN_TYPES). Used to gate the extra sinks.\n csharpIsSafeAccessorCall(initializer): boolean {\n if (initializer?.kind !== SyntaxKind.CallExpression) {\n return false;\n }\n const expression = initializer.expression;\n if (expression?.kind !== SyntaxKind.PropertyAccessExpression || expression.expression?.kind !== SyntaxKind.ThisKeyword) {\n return false;\n }\n return CSHARP_SAFE_ACCESSOR_NAMES.indexOf(expression.name?.text as string) >= 0;\n }\n\n csharpTypeIsList(csharpType: string): boolean {\n return (csharpType === 'List') || (csharpType === 'IList');\n }\n\n csharpTypeIsStringType(csharpType: string): boolean {\n return (csharpType === 'string') || (csharpType === 'string?');\n }\n\n // `throw new ExchangeError (x)`: the printer wraps the argument in a hard `(string)`\n csharpIsClassThrowArgument(node): boolean {\n let current = node;\n while (current.parent) {\n const parent = current.parent;\n if ((parent.kind === SyntaxKind.ParenthesizedExpression) || (parent.kind === SyntaxKind.AsExpression)) {\n current = parent;\n continue;\n }\n if ((parent.kind === SyntaxKind.NewExpression) && (parent.arguments?.indexOf(current) >= 0)) {\n current = parent;\n continue;\n }\n return parent.kind === SyntaxKind.ThrowStatement;\n }\n return false;\n }\n\n // `delete obj[x]` prints `.Remove((string)x)`\n csharpIsDeleteKey(node): boolean {\n let value = node;\n while (value.parent && ((value.parent.kind === SyntaxKind.ParenthesizedExpression) || (value.parent.kind === SyntaxKind.AsExpression))) {\n value = value.parent;\n }\n const access = value.parent;\n return access?.kind === SyntaxKind.ElementAccessExpression && access.argumentExpression === value && access.parent?.kind === SyntaxKind.DeleteExpression;\n }\n\n // `(x) + y` / `x + y` prints `add(x, y)`: the parentheses keep x's static type\n csharpIsLeftPlusOperand(node): boolean {\n let value = node;\n while (value.parent && (value.parent.kind === SyntaxKind.ParenthesizedExpression)) {\n value = value.parent;\n }\n const parent = value.parent;\n if (parent?.kind !== SyntaxKind.BinaryExpression || parent.left !== value) {\n return false;\n }\n const op = parent.operatorToken.kind;\n return (op === SyntaxKind.PlusToken) || (op === SyntaxKind.PlusEqualsToken);\n }\n // the binding a bare identifier resolves to (a local, a parameter, ...) or undefined\n // for every other receiver shape (`this.x`, a call result, a destructured target)\n csharpReceiverBinding(receiver) {\n if (receiver?.kind !== SyntaxKind.Identifier) {\n return undefined;\n }\n const symbol = (this.getChecker() as Checker).getSymbolAtLocation(receiver);\n return symbol?.valueDeclaration?.resolve();\n }\n\n // The static C# type the emitted declaration gives a string-method receiver, or undefined when the\n // printer cannot name it (parameters, call results, ...). Only printer-typed locals are provable\n // here; the ccxt classifier overrides this hook to add the locals and parameters ITS tables retype.\n csharpStringReceiverType(receiver): string | undefined {\n const declaration = this.csharpReceiverBinding(receiver);\n if (declaration?.kind !== SyntaxKind.VariableDeclaration) {\n return undefined;\n }\n if ((declaration.parent as any)?.declarations?.length !== 1) {\n return undefined; // `object a = ..., b = ...` is printed as one statement\n }\n // memoized: the caller asks per receiver, getCSharpLocalType scans the scope\n const cached = this.stringReceiverTypes.get(declaration);\n if (cached !== undefined) {\n return (cached === '') ? undefined : cached;\n }\n const type = this.getCSharpLocalType(declaration);\n this.stringReceiverTypes.set(declaration, type ?? '');\n return type;\n }\n\n // the receiver of `x.Split/.ToUpper/.ToLower/.Replace/.Trim/.Length`, already printed:\n // bare when its static C# type is a string, wrapped in `((string)...)` otherwise (the\n // untyped emission is unchanged)\n csharpStringMethodReceiver(node, name) {\n const expression = node?.expression;\n const receiver = (node?.kind === SyntaxKind.CallExpression)\n ? ((expression?.kind === SyntaxKind.PropertyAccessExpression) ? expression.expression : undefined)\n : expression;\n const type = this.csharpStringReceiverType(receiver);\n return ((type === 'string') || (type === 'string?')) ? name : `((string)${name})`;\n }\n\n // The declared C# type of the `Variable` holder of a destructuring block, or undefined\n // (keeps a `var` holder read via `((IList)holder)[i]`). The ccxt classifier overrides this\n // for the tuple-returning `handle*AndParams` family: holder is `IList`, read directly.\n csharpDestructuringTempType(initializer): string | undefined {\n return undefined;\n }\n\n // whether the typed holder needs the `(T)` cast on its printed initializer; a consumer that\n // proves the printed call already returns T (or a subtype) answers false\n csharpDestructuringTempNeedsCast(initializer, printedExpression: string): boolean {\n return true;\n }\n\n // `isTrue (x)` is the identity on a C# `bool`, and `x == true` is what it computes for a `bool?`\n // (null -> false), so in a condition the wrapper adds nothing. The hook answers the emitted\n // declaration's type (getCSharpLocalType, plus classifier retypes); unnamed operands keep isTrue.\n csharpConditionOperandType(node) {\n const declaration = this.csharpReceiverBinding(node);\n if (declaration?.kind !== SyntaxKind.VariableDeclaration) {\n return undefined; // a parameter / member read has no declaration this pass retypes\n }\n if ((declaration.parent as any)?.declarations?.length !== 1) {\n return undefined; // `object a = ..., b = ...` is printed as one statement\n }\n // memoized: the caller asks per operand, getCSharpLocalType scans the scope\n const cached = this.conditionOperandTypes.get(declaration);\n if (cached !== undefined) {\n return (cached === '') ? undefined : cached;\n }\n const type = this.getCSharpLocalType(declaration);\n const result = ((type === 'bool') || (type === 'bool?')) ? type : undefined;\n this.conditionOperandTypes.set(declaration, result ?? '');\n return result;\n }\n\n // the native spelling of a condition operand, or undefined when it needs `isTrue`.\n // `!x == true` would parse as `(!x) == true`, so the `bool?` form takes parentheses\n // under the `!` operator; every other allowed position binds `==` tighter already.\n csharpNativeCondition(node, identation) {\n const type = this.csharpConditionOperandType(node);\n if (type === undefined) {\n return undefined;\n }\n const text = this.printNode(node, 0);\n if (type === 'bool') {\n return this.getIden(identation) + text;\n }\n const equalsTrue = text + ' == true';\n const parent = node.parent;\n const negated = (parent?.kind === SyntaxKind.PrefixUnaryExpression) && (parent.operator === SyntaxKind.ExclamationToken);\n return this.getIden(identation) + (negated ? `(${equalsTrue})` : equalsTrue);\n }\n\n // `!x` on the `bool?` the hook names prints `x != true`: exactly `!(x == true)` (null -> true)\n // and the value isTrue computes for the box. A `bool` operand keeps the base `!x`; an operand\n // the hook cannot name keeps `!isTrue(x)` (the untyped emission is untouched).\n csharpNegatedConditionOperand(operand) {\n if (operand?.kind !== SyntaxKind.Identifier) {\n return undefined;\n }\n if (this.csharpConditionOperandType(operand) !== 'bool?') {\n return undefined;\n }\n return `${this.printNode(operand, 0)} != true`;\n }\n\n // only the if / while / && / || / ! condition positions print natively through this gate; the\n // ternary condition has its own hook-driven fold (csharpTernaryConditionOperand, U56) because\n // its operand is a plain value position the base printCondition path never asks about.\n csharpConditionPositionAllowsNative(node) {\n const parent = node?.parent;\n switch (parent?.kind) {\n case SyntaxKind.IfStatement:\n return parent.expression === node;\n case SyntaxKind.WhileStatement:\n return parent.expression === node;\n case SyntaxKind.PrefixUnaryExpression:\n return (parent.operator === SyntaxKind.ExclamationToken) && (parent.operand === node);\n case SyntaxKind.BinaryExpression: {\n const op = parent.operatorToken?.kind;\n return ((op === SyntaxKind.AmpersandAmpersandToken) || (op === SyntaxKind.BarBarToken))\n && ((parent.left === node) || (parent.right === node));\n }\n }\n return false;\n }\n\n printVariableDeclarationList(node,identation) {\n const declaration = node.declarations[0];\n // const name = declaration.name.text;\n\n if (this.removeVariableDeclarationForFunctionExpression && declaration?.initializer && isFunctionExpression(declaration.initializer)) {\n return this.printNode(declaration.initializer, identation).trimEnd();\n }\n // handle array binding : input: const [a,b] = this.method()\n // output: var abVar = this.method; var a = abVar[0]; var b = abVar[1];\n if (declaration?.name.kind === SyntaxKind.ArrayBindingPattern) {\n const arrayBindingPattern = declaration.name;\n const arrayBindingPatternElements = arrayBindingPattern.elements;\n const parsedArrayBindingElements = arrayBindingPatternElements.map((e) => this.printNode(e.name, 0));\n const syntheticName = parsedArrayBindingElements.join(\"\") + \"Variable\";\n\n // typed holder (see csharpDestructuringTempType): same value, read without the re-cast\n const tempType = this.csharpDestructuringTempType(declaration.initializer);\n const tempExpression = this.printNode(declaration.initializer, 0);\n const tempCast = (tempType && this.csharpDestructuringTempNeedsCast(declaration.initializer, tempExpression)) ? `(${tempType})` : '';\n const tempDeclaration = tempType ? `${tempType} ${syntheticName} = ${tempCast}${tempExpression}` : `var ${syntheticName} = ${tempExpression}`;\n\n let arrayBindingStatement = `${this.getIden(identation)}${tempDeclaration};\\n`;\n\n parsedArrayBindingElements.forEach((e, index) => {\n // const type = this.getType(node);\n // const parsedType = this.getTypeFromRawType(type);\n const statement = this.getIden(identation) + `var ${e} = ` + (tempType ? `${syntheticName}[${index}]` : `((IList) ${syntheticName})[${index}]`);\n if (index < parsedArrayBindingElements.length - 1) {\n arrayBindingStatement += statement + \";\\n\";\n } else {\n // printStatement adds the last ;\n arrayBindingStatement += statement;\n }\n });\n\n return arrayBindingStatement;\n }\n\n const isNew = declaration?.initializer && (declaration.initializer.kind === SyntaxKind.NewExpression);\n\n // handle the let id: Str; case (default undefined initialization)\n if (!declaration.initializer) {\n return this.getIden(identation) + 'object ' + this.printNode(declaration.name) + \" = \" + this.UNDEFINED_TOKEN;\n }\n const parsedValue = this.printNode(declaration.initializer, identation).trimStart();\n if (parsedValue === this.UNDEFINED_TOKEN) {\n let specificVarToken = \"object\";\n if (this.INFER_VAR_TYPE) {\n const variableType = this.getChecker().typeToString(this.getChecker().getTypeAtLocation(declaration));\n if (this.VariableTypeReplacements[variableType]) {\n specificVarToken = this.VariableTypeReplacements[variableType] + '?';\n }\n }\n return this.getIden(identation) + specificVarToken + \" \" + this.printNode(declaration.name) + \" = \" + parsedValue;\n }\n const declaredType = isNew ? 'var' : this.getCSharpLocalType(declaration);\n // remember the concrete types this printer declared itself: the printed prefix is\n // final (a host wrapper only rewrites untyped `object = ` declarations), so\n // the local's static type is known at every later read\n if (!isNew && node.declarations.length === 1 && this.csharpTypeIsNative(declaredType)) {\n this.csharpTypedLocals.set(declaration, declaredType);\n }\n return this.getIden(identation) + declaredType + \" \" + this.printNode(declaration.name) + \" = \" + parsedValue;\n }\n\n transformPropertyAcessExpressionIfNeeded(node) {\n const expression = node.expression;\n const leftSide = this.printNode(expression, 0);\n const rightSide = node.name.text;\n\n let rawExpression = undefined;\n\n switch(rightSide) {\n case 'length':\n const type = (this.getChecker() as Checker).getTypeAtLocation(expression); // eslint-disable-line\n this.warnIfAnyType(node, type.flags, leftSide, \"length\");\n // rawExpression = this.isStringType(type.flags) ? `(string${leftSide}).Length` : `(${leftSide}.Cast().ToList()).Count`;\n rawExpression = this.isStringType(type.flags) ? `${this.csharpStringMethodReceiver(node, leftSide)}.Length` : (this.csharpNativeLengthExpression(expression) ?? `${this.ARRAY_LENGTH_WRAPPER_OPEN}${leftSide}${this.ARRAY_LENGTH_WRAPPER_CLOSE}`); // `(${leftSide}.Cast()).ToList().Count`\n break;\n case 'push':\n rawExpression = `((IList)${leftSide}).Add`;\n break;\n // case 'push':\n // rawExpression = `(List${leftSide}).Add`s\n // break;\n }\n return rawExpression;\n }\n\n printCustomDefaultValueIfNeeded(node) {\n if (isArrayLiteralExpression(node) || isObjectLiteralExpression(node) || isStringLiteral(node) || isBooleanLiteral(node)\n || isNumericLiteral(node)) {\n return this.UNDEFINED_TOKEN;\n }\n\n // convert x: number = undefined (invalid) into x = -1 (valid)\n if (node?.text === \"undefined\" && this.getChecker().getTypeAtLocation(node?.parent)?.flags === TypeFlags.Number) {\n // return \"-1\";\n return this.UNDEFINED_TOKEN;\n }\n\n return undefined;\n }\n\n printFunctionBody(node, identation) {\n\n // check if there is any default parameter to initialize\n const funcParams = node.parameters;\n const initParams = [];\n if (funcParams.length > 0) {\n const body = node.body.statements;\n const first = body.length > 0 ? body[0] : [];\n const remaining = body.length > 0 ? body.slice(1): [];\n let firstStatement = this.printNode(first, identation + 1);\n\n const remainingString = remaining.map((statement) => this.printNode(statement, identation + 1)).join(\"\\n\");\n funcParams.forEach((param) => {\n const initializer = param.initializer;\n if (initializer) {\n if (isArrayLiteralExpression(initializer)) {\n initParams.push(`${this.printNode(param.name, 0)} ??= new List();`);\n }\n if (isObjectLiteralExpression(initializer)) {\n initParams.push(`${this.printNode(param.name, 0)} ??= new Dictionary();`);\n }\n if (isNumericLiteral(initializer) || isStringLiteral(initializer) || isBooleanLiteral(initializer)) {\n initParams.push(`${this.printNode(param.name, 0)} ??= ${this.printNode(initializer, 0)};`);\n }\n }\n });\n\n if (initParams.length > 0) {\n const defaultInitializers = initParams.map( l => this.getIden(identation+1) + l ).join(\"\\n\") + \"\\n\";\n const bodyParts = firstStatement.split(\"\\n\");\n const commentPart = bodyParts.filter(line => this.isComment(line));\n const isComment = commentPart.length > 0;\n if (isComment) {\n const commentPartString = commentPart.map((c) => this.getIden(identation+1) + c.trim()).join(\"\\n\");\n const firstStmNoComment = bodyParts.filter(line => !this.isComment(line)).join(\"\\n\");\n firstStatement = commentPartString + \"\\n\" + defaultInitializers + firstStmNoComment;\n } else {\n firstStatement = defaultInitializers + firstStatement;\n }\n }\n const blockOpen = this.getBlockOpen(identation);\n const blockClose = this.getBlockClose(identation);\n firstStatement = remainingString.length > 0 ? firstStatement + \"\\n\" : firstStatement;\n return blockOpen + firstStatement + remainingString + blockClose;\n }\n\n return super.printFunctionBody(node, identation);\n }\n\n printInstanceOfExpression(node, identation) {\n const left = node.left.text;\n const right = node.right.text;\n return this.getIden(identation) + `${left} is ${right}`;\n }\n\n printAsExpression(node, identation) {\n const type = node.type;\n\n if (type.kind === SyntaxKind.AnyKeyword) {\n return `((object)${this.printNode(node.expression, identation)})`;\n }\n\n if (type.kind === SyntaxKind.StringKeyword) {\n return `((string)${this.printNode(node.expression, identation)})`;\n }\n\n if (type.kind === SyntaxKind.ArrayType) {\n if (type.elementType.kind === SyntaxKind.AnyKeyword) {\n return `(IList)(${this.printNode(node.expression, identation)})`;\n }\n if (type.elementType.kind === SyntaxKind.StringKeyword) {\n // ts 'as string[]' is a compile-time-only assertion with no runtime\n // effect, and C# IList is invariant in BOTH directions: a hard\n // (IList) cast throws on the untyped core's List\n // (ccxt cs ws test lane, https://github.com/ccxt/ccxt/actions/runs/31173663316)\n // while a hard (IList) cast throws on genuinely typed\n // List values (starknet typedData via the paradex broker-id\n // leg, https://github.com/ccxt/ccxt/actions/runs/31322911365). The\n // honest emission is the bare expression, like the fallthrough below.\n return this.printNode(node.expression, identation);\n }\n }\n\n return this.printNode(node.expression, identation);\n }\n\n // A parameter of a method that participates in an override relation prints the spelling its\n // base member and every sibling override agree on (CSHARP_OVERRIDE_PARAM_TYPES; D8): C# is\n // invariant on override parameter types, so a half-retyped name is CS0115, while a name the\n printParameterType(node) {\n if (node === undefined || node.kind !== SyntaxKind.Parameter) {\n return super.printParameterType(node);\n }\n const method: any = findAncestor(node, (n) => isMethodDeclaration(n));\n const name = method === undefined || method.name === undefined ? undefined : method.name.getText().trim();\n const row = name === undefined ? undefined : CSHARP_OVERRIDE_PARAM_TYPES[name as string];\n const wanted = row === undefined ? undefined : row[method.parameters.indexOf(node)];\n if (wanted === undefined || this.csharpOverrideParamSpelling(node) !== wanted) {\n return super.printParameterType(node);\n }\n return wanted;\n }\n\n // checker spelling of a parameter the override table covers: a dictionary-shaped type (string\n // index signature, never a class instance or a callable) or an array of any/dictionary cells\n csharpOverrideParamSpelling(node): string | undefined {\n const type = this.getChecker().getTypeAtLocation(node);\n if (type === undefined || !type.isUnionType()) {\n return this.csharpOverrideParamSpellingOfType(type, 1);\n }\n const arms = type.getTypes().filter((m) => !(m.flags & (TypeFlags.Undefined | TypeFlags.Null)));\n return this.csharpOverrideParamSpellingOfType(arms[0], arms.length);\n }\n\n csharpOverrideParamSpellingOfType(type, unionArms = 1): string | undefined {\n if (type === undefined || unionArms !== 1) {\n return undefined;\n }\n if (type.flags & (TypeFlags.TypeParameter | TypeFlags.Any | TypeFlags.Unknown | TypeFlags.EnumLike)) {\n return undefined;\n }\n const checker = this.getChecker();\n if (checker.isArrayType(type) || checker.isTupleType(type)) {\n const el = (checker.getTypeArguments(type) || [])[0];\n if (el === undefined) {\n return undefined;\n }\n if (el.flags & (TypeFlags.Any | TypeFlags.Unknown)) {\n return 'IList';\n }\n return this.csharpOverrideParamSpellingOfType(el) === 'IDictionary' ? 'IList' : undefined;\n }\n if (checker.getIndexTypeOfType(type, IndexKind.String) === undefined) {\n return undefined;\n }\n const declarations = type.getSymbol()?.declarations ? type.getSymbol().declarations.map((d) => d.resolve()) : [];\n if (declarations.some((d) => d.kind === SyntaxKind.ClassDeclaration)) {\n return undefined; // a class instance is not a JSON dictionary\n }\n if (type.getCallSignatures && type.getCallSignatures().length > 0) {\n return undefined; // a callable is not a JSON dictionary\n }\n return 'IDictionary';\n }\n\n printParameter(node, defaultValue = true) {\n const name = this.printNode(node.name, 0);\n const initializer = node.initializer;\n\n const handlerType = this.csharpHandlerMessageType(node);\n if (handlerType !== undefined) {\n // the printed declaration is final, so every read of the parameter is that\n // dictionary and the member reads replace getValue/getArrayLength/inOp\n this.csharpTypedLocals.set(node, handlerType);\n }\n let type = handlerType !== undefined ? handlerType : this.printParameterType(node);\n type = type ? type : \"\";\n this.csharpParamTypes.set(node, type); // see csharpPrintedParamType\n\n if (defaultValue) {\n if (initializer) {\n const customDefaultValue = this.printCustomDefaultValueIfNeeded(initializer);\n const defaultValue = customDefaultValue ? customDefaultValue : this.printNode(initializer, 0);\n type = (defaultValue === \"null\" && type !== \"object\") ? type + \"? \": type + \" \";\n return type + name + this.SPACE_DEFAULT_PARAM + \"=\" + this.SPACE_DEFAULT_PARAM + defaultValue;\n }\n return type + \" \" + name;\n }\n return name;\n }\n\n // getFunctionType for a call site: TS7's getSignatureFromDeclaration panics on a CallExpression\n // (TS6 returned the resolved call signature there), so resolve the call itself\n csharpCallSiteFunctionType(node) {\n const checker = this.getChecker();\n const type = checker.getReturnTypeOfSignature(checker.getResolvedSignature(node));\n const parsedType = this.getTypeFromRawType(type);\n if (parsedType !== this.PROMISE_TYPE_KEYWORD) {\n return parsedType;\n }\n const typeArguments = checker.getTypeArguments(type as any);\n if (typeArguments.length === 0 || (typeArguments.length === 1 && typeArguments[0].flags === TypeFlags.Void)) {\n return this.PROMISE_TYPE_KEYWORD;\n }\n const insideTypes = typeArguments.map((t) => this.getTypeFromRawType(t)).join(\",\");\n return (insideTypes.length > 0) ? `${this.PROMISE_TYPE_KEYWORD}<${insideTypes}>` : undefined;\n }\n\n printArrayLiteralExpression(node) {\n\n let arrayOpen = this.ARRAY_OPENING_TOKEN;\n const elems = node.elements;\n\n const elements = node.elements.map((e) => this.printNode(e)).join(\", \");\n\n // take into consideration list of promises\n if (elems.length > 0) {\n const first = elems[0];\n if (first.kind === SyntaxKind.CallExpression) {\n // const type = this.getChecker().getTypeAtLocation(first);\n let type = this.csharpCallSiteFunctionType(first);\n // const parsedType = this.getTypeFromRawType(type);\n // parsedType === \"Task\" ||\n // to do check this later\n if (type === undefined || elements.indexOf(this.UKNOWN_PROP_ASYNC_WRAPPER_OPEN) > -1) {\n // if (type === undefined) {\n arrayOpen = \"new List {\";\n // }\n // else {\n // arrayOpen = \"new List> {\";\n // }\n } else {\n type = 'object';\n // check this out later\n // if (type === 'Task>') {\n // type = 'Task';\n // }\n // if (type === 'string'){\n // type = 'object';\n // }\n // type =\n arrayOpen = `new List<${type}> {`;\n }\n }\n }\n\n return arrayOpen + elements + this.ARRAY_CLOSING_TOKEN;\n }\n\n // A method declared `: boolean` / `: boolean | undefined` (or an alias of either) returns a\n // C# `bool` / `bool?` instead of `object`. Only non-async methods with an explicit annotation\n // qualify: `undefined`/`null` union members make the result nullable, any other member (or an\n // inferred type) keeps the upstream `object`. The nullable spelling is what keeps a missing\n // key a missing key — plain `bool` would turn it into `false`.\n csharpBooleanReturnType(node): string | undefined {\n if (node?.kind !== SyntaxKind.MethodDeclaration || this.isAsyncFunction(node)) {\n return undefined;\n }\n if (this.csharpBooleanReturnTypes.has(node)) {\n return this.csharpBooleanReturnTypes.get(node);\n }\n let result: string | undefined = undefined;\n if (node.type) {\n const type = this.getChecker().getTypeFromTypeNode(node.type);\n const members = type.isUnionType() ? type.getTypes() : [ type ];\n let nullable = false;\n let sawBoolean = false;\n let sawOther = false;\n for (const member of members) {\n if (member.flags & (TypeFlags.Undefined | TypeFlags.Null)) {\n nullable = true;\n } else if (member.flags & TypeFlags.BooleanLike) {\n sawBoolean = true;\n } else {\n sawOther = true;\n }\n }\n if (sawBoolean && !sawOther) {\n result = nullable ? this.BOOLEAN_KEYWORD + '?' : this.BOOLEAN_KEYWORD;\n }\n } else {\n // an un-annotated override inherits the parent's printed return type\n // (printMethodDefinition), so its returns need the same unboxing\n result = this.csharpBooleanReturnType(this.getMethodOverride(node));\n }\n this.csharpBooleanReturnTypes.set(node, result);\n return result;\n }\n\n printFunctionType(node) {\n const booleanType = this.csharpBooleanReturnType(node);\n if (booleanType !== undefined) {\n return booleanType;\n }\n return super.printFunctionType(node);\n }\n\n // `return x;` inside a bool/bool? method: the printed expression is still the `object`\n // box the rest of the printer produces, so unbox it through `object`. The nullable\n // spelling `(bool?)((object)(x))` accepts null; the non-nullable one needs the\n // null-forgiving `!` on the box (CS8605 under TreatWarningsAsErrors otherwise) — which is\n // exactly the runtime NullReferenceException a `: boolean` method returning null deserves\n printReturnStatement(node, identation) {\n // nearest function-like: a `return` inside an arrow/function expression belongs to\n // that callback, never to the enclosing bool method\n const booleanType = this.csharpBooleanReturnType(findAncestor(node.parent, isFunctionLike));\n if (booleanType === undefined || !node.expression) {\n return super.printReturnStatement(node, identation);\n }\n const leadingComment = this.printLeadingComments(node, identation);\n let trailingComment = this.printTraillingComment(node, identation);\n trailingComment = trailingComment ? \" \" + trailingComment : trailingComment;\n const value = this.printNode(node.expression, identation).trim();\n const forgiving = booleanType.endsWith('?') ? '' : '!';\n return leadingComment + this.getIden(identation) + this.RETURN_TOKEN + ` ((${booleanType})((object)(${value}))${forgiving})` + this.LINE_TERMINATOR + trailingComment;\n }\n\n printMethodDefinition(node, identation) {\n let name = node.name.text;\n name = this.transformMethodNameIfNeeded(name);\n\n let returnType = this.printFunctionType(node);\n\n let modifiers = this.printModifiers(node);\n const defaultAccess = this.METHOD_DEFAULT_ACCESS ? this.METHOD_DEFAULT_ACCESS + \" \": \"\";\n modifiers = modifiers ? modifiers + \" \" : defaultAccess; // tmp check this\n\n modifiers = modifiers.indexOf(\"public\") === -1 && modifiers.indexOf(\"private\") === -1 && modifiers.indexOf(\"protected\") === -1 ? defaultAccess + modifiers : modifiers;\n\n let parsedArgs = undefined;\n // c# only move this elsewhere (csharp transpiler)\n const methodOverride = this.getMethodOverride(node) as any;\n const isOverride = methodOverride !== undefined;\n modifiers = isOverride ? modifiers + \"override \" : modifiers + \"virtual \";\n\n // infer parent return type\n if (isOverride && (returnType === \"object\" || returnType === \"Task\")) {\n returnType = this.printFunctionType(methodOverride);\n }\n\n // ts does not infer parameters types of overriden methods :x , so we need some\n // heuristic here to infer the types\n if (isOverride && node.parameters.length > 0) {\n const first = node.parameters[0];\n const firstType = this.getType(first);\n\n if (firstType === undefined) {\n // use the override version, check this out later\n // parsedArgs = this.printMethodParameters(methodOverride);\n const currentArgs = node.parameters;\n const parentArgs = methodOverride.parameters;\n parsedArgs = parentArgs.map((param, index) => this.printParameteCustomName(param, this.printNode(currentArgs[index].name, 0))).join(\", \");\n }\n }\n\n parsedArgs = parsedArgs ? parsedArgs : this.printMethodParameters(node);\n\n returnType = returnType ? returnType + \" \" : returnType;\n\n const methodToken = this.METHOD_TOKEN ? this.METHOD_TOKEN + \" \" : \"\";\n const methodDef = this.getIden(identation) + modifiers + returnType + methodToken + name\n + \"(\" + parsedArgs + \")\";\n\n return this.printNodeCommentsIfAny(node, identation, methodDef);\n }\n\n // check this out later\n\n printArrayIsArrayCall(node, identation, parsedArg = undefined) {\n return `((${parsedArg} is IList) || (${parsedArg}.GetType().IsGenericType && ${parsedArg}.GetType().GetGenericTypeDefinition().IsAssignableFrom(typeof(List<>))))`;\n }\n\n printObjectKeysCall(node, identation, parsedArg = undefined) {\n // `Object.keys(x)` on a receiver the classifier declared a concrete dictionary: the\n // cast only named the box; `.Keys` is the same collection either way\n if ((node?.arguments?.length === 1) && this.csharpReceiverIsDeclaredDictionary(node.arguments[0])) {\n return `new List(${parsedArg}.Keys)`;\n }\n return `new List(((IDictionary)${parsedArg}).Keys)`;\n }\n\n printObjectValuesCall(node, identation, parsedArg = undefined) {\n if ((node?.arguments?.length === 1) && this.csharpReceiverIsDeclaredDictionary(node.arguments[0])) {\n return `new List(${parsedArg}.Values)`;\n }\n return `new List(((IDictionary)${parsedArg}).Values)`;\n }\n\n printJsonParseCall(node, identation, parsedArg = undefined) {\n return `parseJson(${parsedArg})`;\n }\n\n printJsonStringifyCall(node, identation, parsedArg = undefined) {\n return `json(${parsedArg})`; // make this customizable\n }\n\n printPromiseAllCall(node, identation, parsedArg = undefined) {\n return `promiseAll(${parsedArg})`;\n }\n\n printMathFloorCall(node, identation, parsedArg = undefined) {\n return `(Math.Floor(Double.Parse((${parsedArg}).ToString())))`;\n }\n\n printMathRoundCall(node, identation, parsedArg = undefined) {\n return `Math.Round(Convert.ToDouble(${parsedArg}))`;\n }\n\n printMathCeilCall(node, identation, parsedArg = undefined) {\n return `Math.Ceiling(Convert.ToDouble(${parsedArg}))`;\n }\n\n printNumberIsIntegerCall(node: any, identation: any, parsedArg?: any) {\n return `((${parsedArg} is int) || (${parsedArg} is long) || (${parsedArg} is Int32) || (${parsedArg} is Int64))`;\n }\n\n printArrayPushCall(node, identation, name = undefined, parsedArg = undefined) {\n // `x.push (v)` on a receiver whose printed declaration already IS a list needs no cast:\n // (IList)x is an identity conversion and `.Add` binds the same ICollection.Add.\n // An `object` receiver (and every receiver this printer cannot name) keeps the cast.\n if (this.csharpReceiverIsDeclaredList(node?.expression?.expression)) {\n return `${name}.Add(${parsedArg})`;\n }\n return `((IList)${name}).Add(${parsedArg})`;\n }\n\n // The C# type the emitted declaration gives a local / operand read (`string`, `List`,\n // `Dictionary`, ...), or undefined. Installed by build/csharp-local-types.js, which\n // retypes the declaration AFTER printing. Undefined by default: callers keep the helper form.\n csharpLocalTypeOf(node): string | undefined {\n return undefined;\n }\n\n // U55: the emitted C# type of an identifier operand of a null comparison, installed by\n // build/csharp-local-types.js from the PRINTED declaration lines (retyped after printing, so the\n // printer cannot see it). Undefined by default: every null comparison keeps isEqual unchanged.\n csharpNullComparisonTypeOf(node): string | undefined {\n return undefined;\n }\n\n // `add (x, y)` -> `(x + y)` when the classifier proves the LEFT operand's emitted declaration is a\n // string (U57): add(string, string) / add(string, object) compute exactly C# concatenation, nulls\n // included. Undefined keeps the helper; parenthesised because `+` binds looser in embedded text.\n csharpNativeStringConcat(left, right, leftText: string, rightText: string): string | undefined {\n return undefined;\n }\n\n // The emitted declaration type of a local read the embedding build layer retypes AFTER\n // printing (ccxt: build/csharp-local-types.js): the dict type for the `key in x` rule,\n // undefined for every receiver it does not retype. Undefined by default.\n csharpDeclaredDictReceiverType(node): string | undefined {\n return undefined;\n }\n\n // is this receiver expression, as printed, a local declared List /\n // IList? Only a bare identifier reads the type hook; a parameter (printed\n // `object`), a member read and every composite expression keep the cast.\n csharpReceiverIsDeclaredList(receiver): boolean {\n if (receiver?.kind !== SyntaxKind.Identifier) {\n return false;\n }\n const type = (typeof this.csharpLocalTypeOf === 'function') ? this.csharpLocalTypeOf(receiver) : undefined;\n return (type === 'List') || (type === 'IList');\n }\n\n printIncludesCall(node, identation, name = undefined, parsedArg = undefined) {\n return `${name}.Contains(${parsedArg})`;\n }\n\n // `x.indexOf (y)` prints `x`'s own member when the printer proves the receiver holds a\n // string or a list at this read and can name that C# type; every other receiver keeps the\n // runtime getIndexOf helper, which is the only form that answers -1 for a null box.\n printIndexOfCall(node, identation, name = undefined, parsedArg = undefined) {\n const native = this.csharpNativeIndexOfCall(node, name, parsedArg);\n if (native !== undefined) {\n return native;\n }\n return `${this.INDEXOF_WRAPPER_OPEN}${name}, ${parsedArg}${this.INDEXOF_WRAPPER_CLOSE}`;\n }\n\n // the helper's `(string)` branch spelled natively: `((string)x).IndexOf(needle, Ordinal)` is\n // the ordinal scan TS indexOf performs (not-found stays -1, an empty needle stays 0); a\n // `List` local takes its own IndexOf, a possibly-null box keeps the helper\n csharpNativeIndexOfCall(node, name = undefined, parsedArg = undefined): string | undefined {\n const receiver = node?.expression?.expression;\n if (receiver === undefined || name === undefined) {\n return undefined;\n }\n const declared = this.csharpExpressionTypeOf(receiver);\n if (this.csharpIndexOfReceiverHoldsString(node, receiver, declared)) {\n const needle = this.csharpNativeIndexOfNeedle(node.arguments?.[0], parsedArg);\n if (needle === undefined) {\n return undefined;\n }\n // the helper's own `((string)str)` cast; a cast the printer already emitted is final\n const casted = name.startsWith('((string)') ? name : `((string)${name})`;\n return `${casted}.IndexOf(${needle}, StringComparison.Ordinal)`;\n }\n if ((declared === 'List') || (declared === 'IList')) {\n return `((${declared})${name}).IndexOf(${parsedArg})`;\n }\n // a `string?` local holds a string or null: `?.` answers the helper's -1 for null; the\n // needle is a literal or a local, so skipping its evaluation on null changes nothing\n const key = node.arguments?.[0];\n const plainNeedle = (key !== undefined) && (isStringLiteralLikeNode(key) || isIdentifier(key));\n if ((declared === 'string?') && isIdentifier(receiver) && plainNeedle) {\n const needle = this.csharpNativeIndexOfNeedle(node.arguments?.[0], parsedArg);\n if (needle !== undefined) {\n return `(${name}?.IndexOf(${needle}, StringComparison.Ordinal) ?? -1)`;\n }\n }\n return undefined;\n }\n\n // the receiver is a string the helper would scan and no null can reach the read: a C#\n // `string` declaration, a checker `string`/literal whose own declaration is a plain\n // non-optional `string` (`as string` included), or a value a `!== undefined` test admits\n csharpIndexOfReceiverHoldsString(node, receiver, declared): boolean {\n if (declared === 'string') {\n return true;\n }\n if ((declared !== undefined) && (declared !== 'string?')) {\n return false; // a named C# type that is not a string\n }\n if (!this.csharpIndexOfReceiverIsCheckedString(receiver)) {\n return false;\n }\n return this.csharpNullGuardAdmitsRead(node, receiver) || ((declared === undefined) && this.csharpReceiverDeclaredNonNullString(receiver));\n }\n\n // the checker's view of the receiver: exactly `string` / a string literal. `any` (could box\n // anything) and `string[]` (boxes a List where the helper casts its target) are not\n csharpIndexOfReceiverIsCheckedString(receiver): boolean {\n const checker: any = this.checkerOrUndefined();\n if (checker === undefined) {\n return false; // in-memory program without a checker\n }\n const type = checker.getTypeAtLocation(receiver);\n return this.isStringType(type?.flags);\n }\n\n // the receiver's own declaration says non-optional `string` (params, fields, locals), or the\n // source pinned a string itself (a literal, an `as string` assertion). The `Str` alias and\n // `= undefined` fields hold the undefined the helper answers -1 for: they need the guard\n csharpReceiverDeclaredNonNullString(receiver): boolean {\n const kind = receiver?.kind;\n if ((kind === SyntaxKind.StringLiteral) || (kind === SyntaxKind.NoSubstitutionTemplateLiteral)) {\n return true;\n }\n if (kind === SyntaxKind.ParenthesizedExpression) {\n return this.csharpReceiverDeclaredNonNullString(receiver.expression);\n }\n if ((kind === SyntaxKind.AsExpression) && (receiver.type?.kind === SyntaxKind.StringKeyword)) {\n return true; // the source itself pinned a string here\n }\n const checker: any = this.checkerOrUndefined();\n if (checker === undefined) {\n return false;\n }\n const symbol = checker.getSymbolAtLocation(receiver);\n const declarations: any[] = (symbol?.declarations ?? []).map((d) => d.resolve());\n return (declarations.length > 0) && declarations.every((declaration) => this.csharpDeclarationIsNonNullString(declaration));\n }\n\n csharpDeclarationIsNonNullString(declaration): boolean {\n const annotation: any = declaration?.type;\n if (declaration?.kind === SyntaxKind.Parameter) {\n return (declaration.questionToken === undefined) && (declaration.dotDotDotToken === undefined)\n && ((annotation?.kind === SyntaxKind.StringKeyword) || ((annotation === undefined) && isStringLiteralLikeNode(declaration.initializer)));\n }\n const isField = isPropertyDeclaration(declaration) || isPropertySignatureDeclaration(declaration);\n if (isVariableDeclaration(declaration) || isField) {\n if ((declaration as any).questionToken !== undefined) {\n return false;\n }\n if (annotation !== undefined) {\n // `apiKey: string = undefined` holds undefined until the credentials are set\n return (annotation.kind === SyntaxKind.StringKeyword) && !this.csharpInitializerIsUndefined((declaration as any).initializer);\n }\n return isStringLiteralLikeNode((declaration as any).initializer);\n }\n return false;\n }\n\n csharpInitializerIsUndefined(initializer): boolean {\n return (initializer?.kind === SyntaxKind.NullKeyword)\n || ((initializer?.kind === SyntaxKind.Identifier) && (initializer.text === 'undefined'));\n }\n\n // a `x !== undefined` / `x !== null` (or `!= null`) test in a branch that admits the read:\n // inside the right operand of its `&&`, inside the then-branch of its `if`, or after an\n // early-exiting `if (x === undefined) { return/throw/continue/break }`\n csharpNullGuardAdmitsRead(node, receiver): boolean {\n if (!isIdentifier(receiver)) {\n return false;\n }\n const checker: any = this.checkerOrUndefined();\n if (checker === undefined) {\n return false;\n }\n const symbol = checker.getSymbolAtLocation(receiver);\n if (symbol === undefined) {\n return false;\n }\n const scope = this.csharpEnclosingFunction(node);\n let current: any = node;\n while (current !== undefined) {\n const parent: any = current.parent;\n if (parent === undefined) {\n return false;\n }\n if ((parent.kind === SyntaxKind.BinaryExpression) && (parent.operatorToken.kind === SyntaxKind.AmpersandAmpersandToken)\n && this.csharpContains(parent.right, current) && this.csharpTestIsNonNullCheck(parent.left, symbol, true)) {\n return true;\n }\n if (parent.kind === SyntaxKind.IfStatement) {\n if (this.csharpContains(parent.thenStatement, current) && this.csharpTestIsNonNullCheck(parent.expression, symbol, true)) {\n return true;\n }\n if (this.csharpContains(parent.elseStatement, current) && this.csharpTestIsNonNullCheck(parent.expression, symbol, false)) {\n return true;\n }\n }\n if ((isBlock(parent) || isSourceFile(parent)) && this.csharpEarlyExitNonNullGuarded(parent, current, symbol, scope)) {\n return true;\n }\n if (this.csharpIsFunctionLike(parent)) {\n return false; // a guard outside this function cannot dominate a read inside it\n }\n current = parent;\n }\n return false;\n }\n\n csharpIsFunctionLike(node): boolean {\n switch (node?.kind) {\n case SyntaxKind.MethodDeclaration:\n case SyntaxKind.FunctionDeclaration:\n case SyntaxKind.FunctionExpression:\n case SyntaxKind.ArrowFunction:\n case SyntaxKind.Constructor:\n return true;\n }\n return false;\n }\n\n // `if (x === undefined) { return/throw/... }` (or the same test with an exiting else) in the\n // same block, with no write to x in between: every statement after it runs with x bound\n csharpEarlyExitNonNullGuarded(block, statement, symbol, scope): boolean {\n for (const sibling of block.statements) {\n if (sibling.getStart() >= statement.getStart()) {\n return false;\n }\n if (!isIfStatement(sibling)) {\n continue;\n }\n const exitsOnNull = this.csharpTestIsNonNullCheck(sibling.expression, symbol, false) && this.csharpAlwaysExits(sibling.thenStatement);\n const continuesOnNonNull = this.csharpTestIsNonNullCheck(sibling.expression, symbol, true) && this.csharpAlwaysExits(sibling.elseStatement);\n if ((exitsOnNull || continuesOnNonNull) && !this.csharpReceiverWrittenBetween(scope, sibling.getEnd(), statement.getStart(), symbol)) {\n return true;\n }\n }\n return false;\n }\n\n // the test proves the binding non-null when it evaluates to `truthy`: `x != null`, `x !==\n // undefined` (either operand order), and both sides of an `&&` (a false `||`). Everything\n // else — `any` comparisons, a different binding — proves nothing\n csharpTestIsNonNullCheck(test, symbol, truthy): boolean {\n switch (test?.kind) {\n case SyntaxKind.ParenthesizedExpression:\n return this.csharpTestIsNonNullCheck(test.expression, symbol, truthy);\n case SyntaxKind.PrefixUnaryExpression:\n return (test.operator === SyntaxKind.ExclamationToken) && this.csharpTestIsNonNullCheck(test.operand, symbol, !truthy);\n case SyntaxKind.BinaryExpression: {\n const op = test.operatorToken.kind;\n if (op === SyntaxKind.AmpersandAmpersandToken) {\n return truthy && (this.csharpTestIsNonNullCheck(test.left, symbol, true) || this.csharpTestIsNonNullCheck(test.right, symbol, true));\n }\n if (op === SyntaxKind.BarBarToken) {\n return !truthy && (this.csharpTestIsNonNullCheck(test.left, symbol, false) || this.csharpTestIsNonNullCheck(test.right, symbol, false));\n }\n const inequality = (op === SyntaxKind.ExclamationEqualsToken) || (op === SyntaxKind.ExclamationEqualsEqualsToken);\n const isNullTest = (op === SyntaxKind.EqualsEqualsToken) || (op === SyntaxKind.EqualsEqualsEqualsToken) || inequality;\n if (!isNullTest || (truthy !== inequality)) {\n return false;\n }\n const tested = isIdentifier(test.left) ? test.left : test.right;\n const literal = isIdentifier(test.left) ? test.right : test.left;\n return isIdentifier(tested) && this.csharpInitializerIsUndefined(literal) && this.csharpSameBinding(tested, symbol);\n }\n }\n return false;\n }\n\n csharpSameBinding(node, symbol): boolean {\n try {\n const resolved = this.getChecker().getSymbolAtLocation(node);\n return (resolved !== undefined) && (resolved === symbol);\n } catch (e) {\n return false;\n }\n }\n\n // any write to the same binding inside the window voids a dominance proof\n csharpReceiverWrittenBetween(scope, from: number, to: number, symbol): boolean {\n if (scope === undefined) {\n return true;\n }\n let written = false;\n const visit = (n: any) => {\n if (written || (n.getStart() >= to) || (n.getEnd() <= from)) {\n return;\n }\n if (isIdentifier(n) && this.csharpIsWriteTarget(n) && this.csharpSameBinding(n, symbol)) {\n written = true;\n return;\n }\n n.forEachChild(visit);\n };\n scope.forEachChild(visit);\n return written;\n }\n\n // the C# string the native `IndexOf` takes as its needle: a value the printer types a C#\n // string prints as-is, an `object`-printed operand takes the helper's own `(string)` cast.\n // A value of any other named C# type (number, bool, collection) keeps the helper\n csharpNativeIndexOfNeedle(key, printed = undefined): string | undefined {\n if (key === undefined || printed === undefined) {\n return undefined;\n }\n const keyType = this.csharpExpressionTypeOf(key);\n if (keyType === 'string') {\n return printed;\n }\n return ((keyType === undefined) || (keyType === 'string?')) ? `((string)${printed})` : undefined;\n }\n\n printSearchCall(node, identation, name = undefined, parsedArg = undefined) {\n return `((string)${name}).IndexOf(${parsedArg})`;\n }\n\n printStartsWithCall(node, identation, name = undefined, parsedArg = undefined) {\n return `((string)${name}).StartsWith(((string)${parsedArg}))`;\n }\n\n printEndsWithCall(node, identation, name = undefined, parsedArg = undefined) {\n return `((string)${name}).EndsWith(((string)${parsedArg}))`;\n }\n\n printTrimCall(node, identation, name = undefined) {\n return `${this.csharpStringMethodReceiver(node, name)}.Trim()`;\n }\n\n printJoinCall(node, identation, name = undefined, parsedArg = undefined) {\n return `String.Join(${parsedArg}, ((IList)${name}).ToArray())`;\n }\n\n printSplitCall(node, identation, name = undefined, parsedArg = undefined) {\n return `${this.csharpStringMethodReceiver(node, name)}.Split(new [] {((string)${parsedArg})}, StringSplitOptions.None).ToList()`;\n }\n\n printConcatCall(node, identation, name = undefined, parsedArg = undefined) {\n return `concat(${name}, ${parsedArg})`;\n }\n\n printToFixedCall(node, identation, name = undefined, parsedArg = undefined) {\n return `toFixed(${name}, ${parsedArg})`;\n }\n\n printToStringCall(node, identation, name = undefined) {\n return `((object)${name}).ToString()`;\n }\n\n printToUpperCaseCall(node, identation, name = undefined) {\n return `${this.csharpStringMethodReceiver(node, name)}.ToUpper()`;\n }\n\n printToLowerCaseCall(node, identation, name = undefined) {\n return `${this.csharpStringMethodReceiver(node, name)}.ToLower()`;\n }\n\n printShiftCall(node, identation, name = undefined) {\n return `((IList)${name}).First()`;\n }\n\n printReverseCall(node, identation, name = undefined) {\n return `${name} = (${name} as IList).Reverse().ToList()`;\n }\n\n printPopCall(node, identation, name = undefined) {\n return `((IList)${name}).Last()`;\n }\n\n printSliceCall(node, identation, name = undefined, parsedArg = undefined, parsedArg2 = undefined) {\n const nativeCall = this.csharpNativeSliceCall(node, name);\n if (nativeCall !== undefined) {\n return nativeCall;\n }\n if (parsedArg2 === undefined){\n // return `((string)${name}).Substring((int)${parsedArg})`;\n parsedArg2 = 'null';\n }\n // return `((string)${name})[((int)${parsedArg})..((int)${parsedArg2})]`;\n return `slice(${name}, ${parsedArg}, ${parsedArg2})`;\n }\n\n // `x.slice (a, b)` -> Substring / GetRange when x is a checker-proven string (or a printer-declared\n // `List`) and every bound is an integer literal: JS clamps bounds into [0, length] where C#\n // throws, so literals are clamped with Math.Min / Math.Max. Anything unproven keeps the helper.\n csharpNativeSliceCall(node, name) {\n const args = node?.arguments ?? [];\n if ((args.length < 1) || (args.length > 2)) {\n return undefined;\n }\n const start = this.csharpSliceLiteralBound(args[0]);\n if (start === undefined) {\n return undefined;\n }\n const hasEnd = args.length === 2;\n const end = hasEnd ? this.csharpSliceLiteralBound(args[1]) : undefined;\n if (hasEnd && (end === undefined)) {\n return undefined;\n }\n // x.slice (a, b) prints through this method for the CALL, so the receiver is `.expression.expression`\n const receiver = isPropertyAccessExpression(node?.expression) ? node.expression.expression : undefined;\n if (!this.csharpSliceReceiverIsSideEffectFree(receiver)) {\n return undefined;\n }\n const kind = this.csharpSliceReceiverKind(receiver);\n if (kind === undefined) {\n return undefined;\n }\n const isString = (kind === 'string');\n // `(id as string)` already prints `((string)id)`: a second cast would only add parens\n const cast = (isString && name.startsWith('((string)')) ? name : `((${isString ? 'string' : 'List'})${name})`;\n const length = `${cast}.${isString ? 'Length' : 'Count'}`;\n const from = this.csharpSliceBoundExpression(start, length);\n // the null guard reproduces the helper's null -> null result for a null receiver; the\n // whole emission is parenthesised because a ternary binds looser than the `+` / `+` chain\n // the printer may wrap this call in\n const guard = `(${this.csharpNullComparison(name, true)} ? null : `;\n const method = isString ? 'Substring' : 'GetRange';\n if (!hasEnd) {\n // the open end is the length itself: `Substring (from)` and `GetRange (from, length - from)`\n const open = isString ? `Substring(${from})` : `GetRange(${from}, ${from === '0' ? length : `${length} - ${from}`})`;\n return `${guard}${cast}.${open})`;\n }\n const to = this.csharpSliceBoundExpression(end, length);\n // from <= to is proven per case: 0 is never above a clamp, and two literals clamp\n // monotonically once they keep their order (non-negative, or both counting from the end)\n const ordered = (start === 0) || ((start >= 0) && (end >= 0) && (start <= end)) || ((start < 0) && (end < 0) && (start <= end));\n let count;\n if (from === to) {\n count = '0'; // two bounds that clamp to the same index: an empty result\n } else if (from === '0') {\n count = to; // from 0: the clamped end IS the count\n } else {\n // an inverted pair yields an empty slice in JS, so the count never goes below 0\n count = ordered ? `${to} - ${from}` : `Math.Max(${to} - ${from}, 0)`;\n }\n return `${guard}${cast}.${method}(${from}, ${count}))`;\n }\n\n // Integer value of a slice bound that is an integer literal (`18`, `-64`); anything\n // else (expression, float, exponent, out of int range) keeps the helper — the bounds\n // are clamped with the integer Math.Min / Math.Max of the native form.\n csharpSliceLiteralBound(node) {\n if (node === undefined) {\n return undefined;\n }\n if (isNumericLiteral(node)) {\n const text = String(node.text);\n if ((text.indexOf('.') !== -1) || (text.indexOf('e') !== -1) || (text.indexOf('E') !== -1)) {\n return undefined;\n }\n const value = Number(text);\n return value <= 2147483647 ? value : undefined;\n }\n if (isPrefixUnaryExpression(node) && (node.operator === SyntaxKind.MinusToken)) {\n const inner = this.csharpSliceLiteralBound(node.operand);\n return inner === undefined ? undefined : -inner;\n }\n return undefined;\n }\n\n // JS slice clamps a literal bound into [0, length]: a non-negative bound is min\n // (bound, length), a negative one counts from the end (max (length - |bound|, 0)).\n // `0` stays `0` because the length of a string / list is never negative.\n csharpSliceBoundExpression(value, length) {\n if (value === 0) {\n return '0';\n }\n return value > 0 ? `Math.Min(${value}, ${length})` : `Math.Max(${length} - ${-value}, 0)`;\n }\n\n // The receiver of a native slice: a `List` the printer / build layer declared (the only\n // receiver with GetRange), or a CHECKER-proven string (`string`, a literal, or a union with\n // null / undefined such as ccxt's `Str`); `any`, Dict and every other type keep the helper.\n csharpSliceReceiverKind(expression) {\n // a declared `List` (printer table or the embedding build layer's retype) is the\n // only receiver carrying a native bounding accessor, GetRange\n const declared = (isIdentifier(expression) ? this.csharpTypedLocalType(expression) : undefined) ?? this.csharpExpressionTypeOf(expression);\n if (declared === 'List') {\n return 'list';\n }\n const checker: any = this.checkerOrUndefined();\n if (checker === undefined) {\n return undefined;\n }\n const type = checker.getTypeAtLocation(expression);\n return this.csharpSliceStringType(type) ? 'string' : undefined;\n }\n\n // the checker's string view of a slice receiver: a string type, or a union of string\n // members and nullish ones only. `boolean | string`, `any` and every unproven shape fail\n csharpSliceStringType(type): boolean {\n if (this.isStringType(type?.flags)) {\n return true;\n }\n if (type?.flags !== TypeFlags.Union) {\n return false;\n }\n const members = type.getTypes?.() ?? [];\n return (members.length > 0) && members.every((member) => this.isStringType(member.flags)\n || (member.flags === TypeFlags.Undefined) || (member.flags === TypeFlags.Null));\n }\n\n // True for receivers that read a value without calling anything: `x`, `x.y`, `this.x`,\n // `(x as string)` and parenthesised forms of those. Guards the repeated receiver read —\n // the clamp reads `Length` / `Count` and the call itself reads the receiver again.\n csharpSliceReceiverIsSideEffectFree(expression): boolean {\n if (expression === undefined) {\n return false;\n }\n if (isIdentifier(expression) || (expression.kind === SyntaxKind.ThisKeyword)) {\n return true;\n }\n if (isParenthesizedExpression(expression) || isAsExpression(expression) || isTypeAssertion(expression)\n || isPropertyAccessExpression(expression)) {\n return this.csharpSliceReceiverIsSideEffectFree(expression.expression);\n }\n return false;\n }\n\n printReplaceCall(node, identation, name = undefined, parsedArg = undefined, parsedArg2 = undefined) {\n return `${this.csharpStringMethodReceiver(node, name)}.Replace((string)${parsedArg}, (string)${parsedArg2})`;\n }\n\n printReplaceAllCall(node, identation, name = undefined, parsedArg = undefined, parsedArg2 = undefined) {\n return `${this.csharpStringMethodReceiver(node, name)}.Replace((string)${parsedArg}, (string)${parsedArg2})`;\n }\n\n printPadEndCall(node, identation, name, parsedArg, parsedArg2) {\n return `(${name} as String).PadRight(Convert.ToInt32(${parsedArg}), Convert.ToChar(${parsedArg2}))`;\n }\n\n printPadStartCall(node, identation, name, parsedArg, parsedArg2) {\n return `(${name} as String).PadLeft(Convert.ToInt32(${parsedArg}), Convert.ToChar(${parsedArg2}))`;\n }\n\n printDateNowCall(node, identation) {\n return \"(new DateTimeOffset(DateTime.UtcNow)).ToUnixTimeMilliseconds()\";\n }\n\n printLengthProperty(node, identation, name = undefined) {\n const leftSide = this.printNode(node.expression, 0);\n const type = (this.getChecker() as Checker).getTypeAtLocation(node.expression); // eslint-disable-line\n this.warnIfAnyType(node, type.flags, leftSide, \"length\");\n return this.isStringType(type.flags) ? `${this.csharpStringMethodReceiver(node, leftSide)}.Length` : (this.csharpNativeLengthExpression(node.expression) ?? `${this.ARRAY_LENGTH_WRAPPER_OPEN}${leftSide}${this.ARRAY_LENGTH_WRAPPER_CLOSE}`);\n }\n\n // A for-header incrementor discards the postfix value, so an operand whose printed C# type is `int`\n // takes the native operator: the same unchecked +1 / -1 as the (ref int) helper twin. Any other\n // operand keeps the helper, whose overload set binds an `object` counter.\n csharpNativePostFixIncrement(node): boolean {\n if (node.operand?.kind !== SyntaxKind.Identifier) {\n return false;\n }\n const parent = node.parent;\n if (parent?.kind !== SyntaxKind.ForStatement || parent.incrementor !== node) {\n return false;\n }\n return this.csharpExpressionTypeOf(node.operand) === 'int';\n }\n\n printPostFixUnaryExpression(node, identation) {\n const {operand, operator} = node;\n if (operand.kind === SyntaxKind.NumericLiteral) {\n return super.printPostFixUnaryExpression(node, identation);\n }\n const leftSide = this.printNode(operand, 0);\n const op = this.PostFixOperators[operator]; // todo: handle --\n if (this.csharpNativePostFixIncrement(node)) {\n return `${leftSide}${op}`;\n }\n return (op === '--') ? `postFixDecrement(ref ${leftSide})` : `postFixIncrement(ref ${leftSide})`;\n }\n\n printPrefixUnaryExpression(node, identation) {\n const {operand, operator} = node;\n if (operand.kind === SyntaxKind.NumericLiteral) {\n return super.printPrefixUnaryExpression(node, identation);\n }\n if (operator === SyntaxKind.ExclamationToken) {\n // not branch check falsy/turthy values if needed;\n const nativeNot = this.csharpNegatedConditionOperand(operand);\n if (nativeNot !== undefined) {\n return nativeNot;\n }\n return this.PrefixFixOperators[operator] + this.printCondition(node.operand, 0);\n }\n const leftSide = this.printNode(operand, 0);\n if (operator === SyntaxKind.PlusToken) {\n return `prefixUnaryPlus(ref ${leftSide})`;\n }\n const nativeNegation = this.csharpNativeNegatedLocal(operand, leftSide);\n if (nativeNegation !== undefined) {\n return nativeNegation;\n }\n return `prefixUnaryNeg(ref ${leftSide})`;\n }\n\n // `isTrue(x)` is the identity function on a C# bool (`isTrue` returns a bool unchanged),\n // so the wrapper is only needed for values the printer leaves boxed as `object`. Every\n // shape below is rendered as a C# bool by the printer itself; anything else keeps the helper.\n csharpConditionPrintsBool(node): boolean {\n switch (node?.kind) {\n case SyntaxKind.TrueKeyword:\n case SyntaxKind.FalseKeyword:\n return true; // `true` / `false`\n case SyntaxKind.ParenthesizedExpression:\n return this.csharpConditionPrintsBool(node.expression);\n case SyntaxKind.PrefixUnaryExpression:\n // `!x` prints `!isTrue(x)`, and printCondition always returns a bool\n return node.operator === SyntaxKind.ExclamationToken;\n case SyntaxKind.BinaryExpression:\n return this.csharpBinaryExpressionPrintsBool(node);\n case SyntaxKind.Identifier:\n return this.csharpIdentifierPrintsBool(node);\n case SyntaxKind.PropertyAccessExpression:\n return this.csharpFieldPrintsBool(node);\n case SyntaxKind.CallExpression:\n return this.csharpCallPrintsBool(node);\n }\n return false;\n }\n\n // `this.` reads of the hand-written BaseExchange bool fields: the field is declared\n // `bool` there, so a checker-typed plain boolean read is a C# bool the condition can use bare\n csharpFieldPrintsBool(node): boolean {\n if (node.expression?.kind !== SyntaxKind.ThisKeyword) {\n return false;\n }\n return (CSHARP_NATIVE_BOOL_FIELDS.indexOf(node.name?.text as string) >= 0) && this.csharpIsCheckedBoolean(node);\n }\n\n // isEqual / !isEqual / isGreaterThan / ... / inOp all have a C# `bool` signature, a\n // `&&` / `||` prints both operands through printCondition, i.e. as bool themselves, and\n // `x instanceof T` prints the C# type test ` is `, itself a bool\n csharpBinaryExpressionPrintsBool(node): boolean {\n switch (node.operatorToken.kind) {\n case SyntaxKind.EqualsEqualsToken:\n case SyntaxKind.EqualsEqualsEqualsToken:\n case SyntaxKind.ExclamationEqualsToken:\n case SyntaxKind.ExclamationEqualsEqualsToken:\n case SyntaxKind.GreaterThanToken:\n case SyntaxKind.GreaterThanEqualsToken:\n case SyntaxKind.LessThanToken:\n case SyntaxKind.LessThanEqualsToken:\n case SyntaxKind.InKeyword:\n case SyntaxKind.InstanceOfKeyword:\n case SyntaxKind.BarBarToken:\n case SyntaxKind.AmpersandAmpersandToken:\n return true;\n }\n return false;\n }\n\n // the checker sees a value that is exactly boolean; `boolean | undefined` is a\n // TypeFlags.Union here and is therefore rejected (`bool?` is no condition in C#)\n csharpIsCheckedBoolean(node): boolean {\n const type = this.getChecker().getTypeAtLocation(node);\n return ((type?.flags ?? 0) & TypeFlags.BooleanLike) !== 0;\n }\n\n // `bool name = ...` is only declared when getCSharpLocalType resolved that exact\n // declaration to `bool`, so ask the same function: the condition and the declaration\n // cannot disagree. Parameters, members and demoted locals return `object` there. The\n // embedding layer's resolver (ccxt: build/csharp-local-types.js) retypes locals the\n // printer cannot name itself and reports the type the printed declaration carries, so a\n // `bool` there is the same proof for a declaration this printer did not write\n csharpIdentifierPrintsBool(node): boolean {\n if (!this.csharpIsCheckedBoolean(node)) {\n return false;\n }\n if (this.csharpExpressionTypeOf(node) === 'bool') {\n return true;\n }\n const declaration = this.getChecker().getSymbolAtLocation(node)?.valueDeclaration?.resolve();\n if (declaration === undefined || !isVariableDeclaration(declaration) || declaration.name?.kind !== SyntaxKind.Identifier) {\n return false;\n }\n if (!this.csharpLocalTypes.has(declaration)) {\n this.csharpLocalTypes.set(declaration, this.getCSharpLocalType(declaration));\n }\n return this.csharpLocalTypes.get(declaration) === 'bool';\n }\n\n // the printed callee text of a method call the printer can name statically: `this.` and\n // `.`. A deeper receiver (`a.b.c(...)`) or a plain function call stays undefined —\n // the hand-written-callee proof must know exactly which callee the emitted text binds\n csharpCalleeName_Native(node): string | undefined {\n const expression = node?.expression;\n if (expression?.kind !== SyntaxKind.PropertyAccessExpression) {\n return undefined;\n }\n const receiver = expression.expression;\n const name = expression.name?.text as string;\n if (receiver?.kind === SyntaxKind.ThisKeyword) {\n return 'this.' + name;\n }\n if (receiver?.kind === SyntaxKind.Identifier) {\n return (receiver.text as string) + '.' + name;\n }\n return undefined;\n }\n\n // cs-14: `isTrue()` goes bare when the call's own C# signature is non-nullable `bool`: (a)\n // hand-written cs/ccxt/base callees (CSHARP_BOOL_CALLEES_NATIVE), (b) `this.(...)` printed by\n // the same csharpBooleanReturnType. Hand-written overrides and `callDynamically` keep the wrapper.\n csharpBoolCall_Native(node): boolean {\n const callee = this.csharpCalleeName_Native(node);\n if (callee !== undefined && CSHARP_BOOL_CALLEES_NATIVE[callee] === true) {\n return true;\n }\n return this.csharpGeneratedThisCallBoolType_Native(node, callee) === 'bool';\n }\n\n // csharpBooleanReturnType of a generator-printed `this.(...)` callee, else undefined\n csharpGeneratedThisCallBoolType_Native(node, callee: string | undefined): string | undefined {\n if (callee === undefined || callee.indexOf('this.') !== 0) {\n return undefined;\n }\n if (CSHARP_HANDWRITTEN_CALLEES_NATIVE.indexOf(callee.substring('this.'.length)) > -1) {\n return undefined;\n }\n if (!this.csharpCalleeResolves(node)) {\n return undefined;\n }\n const declaration: any = this.getChecker().getResolvedSignature(node)?.declaration?.resolve();\n // a bodiless overload signature (`safeBool (…, defaultValue: boolean): boolean` next to a\n // `boolean | undefined` implementation) states only that overload's type, while C# binds\n // the single implementation: its `bool?` must not lose the wrapper\n if (declaration?.kind !== SyntaxKind.MethodDeclaration || declaration.body === undefined) {\n return undefined;\n }\n return this.csharpBooleanReturnType(declaration);\n }\n\n // calls the printer gives a concrete bool signature (inArray, valueIsDefined, startsWith,\n // Array.isArray, ...); safeBool and friends are `bool?` / `object` and keep the wrapper\n csharpCallPrintsBool(node): boolean {\n return this.csharpIsCheckedBoolean(node) && ((this.csharpCallReturnType(node) === 'bool') || this.csharpBoolCall_Native(node));\n }\n\n // The declared type of an identifier read: build layer's proof first, then this printer's table;\n // `var`/`object` mean \"no type\". `isTrue (x)` answers false for a null box, exactly the lifted\n // `x == true` on a `bool?`. Only reads declared `bool?` qualify; every other shape keeps helper.\n csharpNullableBoolCondition(node): string | undefined {\n let value = node;\n while (value?.kind === SyntaxKind.ParenthesizedExpression) {\n value = value.expression;\n }\n // the resolver arm: a declaration the embedding build layer retyped itself — the parameter/override\n // signatures the typed-param units print: the recorded type IS the emitted\n // declaration's, so a `bool?` parameter is no C# condition either\n const nullable = (value?.kind === SyntaxKind.Identifier)\n ? (this.csharpDeclaredLocalType(value) === 'bool?' || this.csharpDeclaredLocalResolverType(value) === 'bool?')\n : ((value?.kind === SyntaxKind.CallExpression) && this.csharpCallPrintsNullableBool(value));\n return nullable ? `(${this.printNode(value, 0)} == true)` : undefined;\n }\n\n // a call whose printed C# signature is `bool?`: the `bool? safeBool(...)` family of the\n // hand-written base (CSHARP_THIS_RETURN_TYPES, which names that signature), and a\n // `this.(...)` whose TS declaration the generator itself prints — definition and call\n csharpCallPrintsNullableBool(node): boolean {\n if (this.csharpCallReturnType(node) === 'bool?') {\n return true;\n }\n return this.csharpGeneratedThisCallBoolType_Native(node, this.csharpCalleeName_Native(node)) === 'bool?';\n }\n\n // same emission as the base implementation except for the bare-bool branch: the node is\n // printed once and only wrapped in isTrue(...) when the printer did not already render a bool\n //\n // the single `printCondition` override, rules layered strongest-proof-first over the base\n // body (the untyped fallback at the bottom):\n // S61 -- bare `isTrue (x)` in an if / while / && / || / ! condition: the operand is already\n // the `bool` (or `bool?`) the helper computes, so the wrapper adds nothing (the gate is the\n // csharpConditionPositionAllowsNative / csharpNativeCondition pair, never a name shape).\n // S62 -- a condition whose printed text is already a C# `bool` helper call\n // (csharpPrintedConditionIsBoolean) needs no wrapper either; the same identity proven from\n // the printed form rather than from the declaration.\n // #82 -- csharpConditionPrintsBool folds the wrapper on the node shapes the printer itself\n // renders as a bool, with csharpConditionParensIfNeeded keeping the `&&` / `||` precedence.\n printCondition(node, identation) {\n if (this.supportsFalsyOrTruthyValues) {\n return this.printNode(node, identation);\n }\n // can be called from ifs or conditional expressions or binary expressions so might contain the ! operator\n if (node?.kind === SyntaxKind.PrefixUnaryExpression && node.operator === SyntaxKind.ExclamationToken) {\n return this.printPrefixUnaryExpression(node, identation); // avoid infinite recursion\n }\n const nullableBool = this.csharpNullableBoolCondition(node);\n if (nullableBool !== undefined) {\n return `${this.getIden(identation)}${nullableBool}`;\n }\n const native = this.csharpConditionPositionAllowsNative(node) ? this.csharpNativeCondition(node, identation) : undefined;\n if (native !== undefined) {\n return native;\n }\n const printed = this.printNode(node, 0);\n if (this.csharpConditionPrintsBool(node)) {\n return `${this.getIden(identation)}${this.csharpConditionParensIfNeeded(node, printed)}`;\n }\n // `isTrue(X)` is the identity on a printed C# bool (Exchange.TranspileHelpers.cs:\n // `isTrue(object)` returns `(bool)value`, and normalizeIntIfNeeded is a no-op on bools),\n // so the wrapper is dropped when the node already prints as one\n if (this.csharpPrintedConditionIsBoolean(printed)) {\n return `${this.getIden(identation)}${printed}`;\n }\n return `${this.getIden(identation)}${this.FALSY_WRAPPER_OPEN}${printed}${this.FALSY_WRAPPER_CLOSE}`;\n }\n\n // dropping the wrapper exposes the `&&` / `||` / `is` of the node, so the bare text needs its own\n // parentheses where C# binds tighter than the JS it replaces: under `!` (which binds tighter\n // than both), and a `||` that becomes an operand of a `&&` (`(a || b) && c` must not flatten\n // to `a || b && c`). A type test additionally needs them under the `(bool)` cast the\n // conditional-expression printer prepends (`(bool) x is T` would bind as `((bool) x) is T`).\n // Source parentheses, when present, already come out in `printed`.\n csharpConditionParensIfNeeded(node, printed: string): string {\n if (node?.kind !== SyntaxKind.BinaryExpression) {\n return printed;\n }\n const op = node.operatorToken.kind;\n const parent = node.parent;\n const underNot = parent?.kind === SyntaxKind.PrefixUnaryExpression && parent.operator === SyntaxKind.ExclamationToken;\n if (op === SyntaxKind.InstanceOfKeyword) {\n const underCast = parent?.kind === SyntaxKind.ConditionalExpression && parent.condition === node;\n return (underNot || underCast) ? `(${printed})` : printed;\n }\n if (op !== SyntaxKind.BarBarToken && op !== SyntaxKind.AmpersandAmpersandToken) {\n return printed;\n }\n const underAnd = op === SyntaxKind.BarBarToken && parent?.kind === SyntaxKind.BinaryExpression\n && parent.operatorToken.kind === SyntaxKind.AmpersandAmpersandToken;\n return (underNot || underAnd) ? `(${printed})` : printed;\n }\n\n printConditionalExpression(node, identation) {\n const condition = this.printTernaryCondition(node.condition);\n const whenTrue = this.printNode(node.whenTrue, 0);\n const whenFalse = this.printNode(node.whenFalse, 0);\n\n return condition + \" ? \" + whenTrue + \" : \" + whenFalse;\n }\n\n // The ternary condition is a condition position the native gate above never sees: the same hook\n // answer prints natively there — `bool` bare, `bool?` as `x == true` (null -> false), source parens\n // unwrapped. Undefined keeps the base path, so an unnamed operand is unchanged.\n csharpTernaryConditionOperand(node) {\n let operand = node;\n while (operand?.kind === SyntaxKind.ParenthesizedExpression) {\n operand = operand.expression;\n }\n if (operand?.kind !== SyntaxKind.Identifier) {\n return undefined;\n }\n const type = this.csharpConditionOperandType(operand);\n if (type === 'bool') {\n return this.printNode(operand, 0);\n }\n if (type === 'bool?') {\n return `${this.printNode(operand, 0)} == true`;\n }\n return undefined;\n }\n\n // printCondition already yields a C# `bool` (`isTrue(x)` / `!isTrue(x)`), so a `((bool) )`\n // wrapper is a cast on a bool. The hook fold above answers the emitted declaration's type first;\n // anything it cannot name keeps the printer's `bool` fold (getCSharpLocalType) and then `isTrue`.\n printTernaryCondition(node) {\n const native = this.csharpTernaryConditionOperand(node);\n if (native !== undefined) {\n return native;\n }\n if (this.csharpConditionPrintsAsBool(node)) {\n return this.printNode(node, 0);\n }\n return this.printCondition(node, 0);\n }\n\n csharpConditionPrintsAsBool(node): boolean {\n if (node?.kind !== SyntaxKind.Identifier) {\n return false;\n }\n const checker = this.getChecker() as Checker; // eslint-disable-line\n const declaration = checker.getSymbolAtLocation(node)?.valueDeclaration?.resolve();\n if (declaration?.kind !== SyntaxKind.VariableDeclaration) {\n return false;\n }\n return this.getCSharpLocalType(declaration) === 'bool';\n }\n\n // index of the `)` matching the `(` at `start` inside printed C# text, or -1; string\n // and char literals are skipped so a `(` inside a literal cannot shift the depth\n csharpMatchingParenIndex(text: string, start: number): number {\n let depth = 0;\n for (let i = start; i < text.length; i++) {\n const char = text[i];\n if (char === '\"' || char === '\\'') {\n const quote = char;\n i++;\n while (i < text.length) {\n if (text[i] === '\\\\') { i += 2; continue; }\n if (text[i] === quote) { break; }\n i++;\n }\n } else if (char === '(') {\n depth++;\n } else if (char === ')') {\n depth--;\n if (depth === 0) {\n return i;\n }\n }\n }\n return -1;\n }\n\n // S62: a `?` at paren/bracket/brace depth 0 in printed condition text is a C# conditional; its type\n // is the branches' common type (`object`), never `bool`; without this guard the falsy wrapper would\n // be folded into an invalid `if (object)`. `?` inside parens/brackets and in literals is ignored.\n csharpTextHasTopLevelConditional(text: string): boolean {\n let depth = 0;\n for (let i = 0; i < text.length; i++) {\n const char = text[i];\n if (char === '\"' || char === '\\'') {\n const quote = char;\n i++;\n while (i < text.length) {\n if (text[i] === '\\\\') { i += 2; continue; }\n if (text[i] === quote) { break; }\n i++;\n }\n } else if ((char === '(') || (char === '[') || (char === '{')) {\n depth++;\n } else if ((char === ')') || (char === ']') || (char === '}')) {\n depth--;\n } else if ((char === '?') && (depth === 0)) {\n return true;\n }\n }\n return false;\n }\n\n // S62: is this printed condition text already a C# `bool`? Only `isTrue`/`isEqual`/`isGreaterThan\n // (OrEqual)`/`isLessThan(OrEqual)`/`inOp` calls qualify (CSHARP_BOOLEAN_PRINTED_CALLS). A `!`,\n // whole-text parens and `&&`/`||` composites (via the leading operand) keep the property.\n csharpPrintedConditionIsBoolean(text: string): boolean {\n const trimmed = text.trim();\n if (trimmed.length === 0) {\n return false;\n }\n if (this.csharpTextHasTopLevelConditional(trimmed)) {\n return false;\n }\n if (trimmed.startsWith('(') && (this.csharpMatchingParenIndex(trimmed, 0) === trimmed.length - 1)) {\n return this.csharpPrintedConditionIsBoolean(trimmed.substring(1, trimmed.length - 1));\n }\n if (trimmed.startsWith('!')) {\n return this.csharpPrintedConditionIsBoolean(trimmed.substring(1));\n }\n const printedCall = /^([A-Za-z_]\\w*)\\(/.exec(trimmed);\n return (printedCall !== null) && (CSHARP_BOOLEAN_PRINTED_CALLS.indexOf(printedCall[1]) >= 0);\n }\n\n printDeleteExpression(node, identation) {\n const receiver = node.expression.expression;\n const object = this.printNode (receiver, 0);\n const key = this.printNode (node.expression.argumentExpression, 0);\n // same identity as the element write: `Remove` on the declared dictionary is the\n // interface method the cast would bind to\n if (this.csharpReceiverIsDeclaredDictionary(receiver)) {\n return `${object}.Remove((string)${key})`;\n }\n return `((IDictionary)${object}).Remove((string)${key})`;\n }\n\n printNewExpression(node, identation) {\n let expression = node.expression?.text;\n expression = expression ? expression : this.printNode(node.expression);\n // JS's built-in `Error` maps to C#'s `Exception` (C# has no `Error` type in the BCL)\n if (expression === 'Error') {\n expression = 'Exception';\n }\n const args = node.arguments.map(n => this.printNode(n, identation)).join(\", \");\n const newToken = this.NEW_TOKEN ? this.NEW_TOKEN + \" \" : \"\";\n return newToken + expression + this.LEFT_PARENTHESIS + args + this.RIGHT_PARENTHESIS;\n }\n\n printThrowStatement(node, identation) {\n // const expression = this.printNode(node.expression, 0);\n // return this.getIden(node) + this.THROW_TOKEN + \" \" + expression + this.LINE_TERMINATOR;\n if (node.expression.kind === SyntaxKind.Identifier) {\n return this.getIden(identation) + this.THROW_TOKEN + ' ' + this.printNode(node.expression, 0) + this.LINE_TERMINATOR;\n }\n if (node.expression.kind === SyntaxKind.NewExpression) {\n const expression = node.expression;\n // handle throw new Error (Message)\n // and throw new x[a] (message)\n const argumentsExp = expression?.arguments ?? [];\n const parsedArg = argumentsExp.map(n => this.printNode(n, 0)).join(\",\") ?? '';\n const newExpression = this.printNode(expression.expression, 0);\n if (expression.expression.kind === SyntaxKind.Identifier) {\n // handle throw new X\n const id = expression.expression;\n // JS's built-in `Error` maps to C#'s `Exception` (C# has no `Error` type in the BCL)\n const idName = id.text === 'Error' ? 'Exception' : id.text;\n const symbol = this.getChecker().getSymbolAtLocation(expression.expression);\n if (symbol) {\n const declarations = (this.getChecker().getDeclaredTypeOfSymbol(symbol).getSymbol()?.declarations ?? []).map((d) => d.resolve());\n const isClassDeclaration = declarations.find(l => l.kind === SyntaxKind.InterfaceDeclaration || l.kind === SyntaxKind.ClassDeclaration);\n if (isClassDeclaration){\n return this.getIden(identation) + `${this.THROW_TOKEN} ${this.NEW_TOKEN} ${idName} ((string)${parsedArg}) ${this.LINE_TERMINATOR}`;\n } else {\n return this.getIden(identation) + `throwDynamicException(${idName}, ${parsedArg});return null;`;\n }\n }\n return this.getIden(identation) + `${this.THROW_TOKEN} ${this.NEW_TOKEN} ${idName === id.text ? newExpression : idName} (${parsedArg}) ${this.LINE_TERMINATOR}`;\n } else if (expression.expression.kind === SyntaxKind.ElementAccessExpression) {\n return this.getIden(identation) + `throwDynamicException(${newExpression}, ${parsedArg});`;\n }\n return super.printThrowStatement(node, identation);\n }\n // const newToken = this.NEW_TOKEN ? this.NEW_TOKEN + \" \" : \"\";\n // const newExpression = node.expression?.expression?.text;\n // // newExpression = newExpression ? newExpression : this.printNode(node.expression.expression, 0); // new Exception or new exact[string] check this out\n // // const args = node.expression?.arguments.map(n => this.printNode(n, 0)).join(\",\");\n // // const throwExpression = ` ${newToken}${newExpression}${this.LEFT_PARENTHESIS}((string)${args})${this.RIGHT_PARENTHESIS}`;\n // return this.getIden(identation) + this.THROW_TOKEN + throwExpression + this.LINE_TERMINATOR;\n }\n\n printPropertyAccessModifiers(node) {\n let modifiers = this.printModifiers(node);\n if (modifiers === '') {\n modifiers = this.defaultPropertyAccess;\n }\n // add type\n let typeText = 'object';\n if (node.type) {\n typeText = this.getType(node);\n if (!typeText && node.type.kind === SyntaxKind.AnyKeyword) {\n typeText = this.OBJECT_KEYWORD + ' ';\n }\n }\n return modifiers + ' ' + typeText + ' ';\n }\n\n // printLeadingComments(node, identation) {\n // const fullText = this.getSrc().getFullText();\n // const commentsRangeList = ts.getLeadingCommentRanges(fullText, node.pos);\n // const commentsRange = commentsRangeList ? commentsRangeList : undefined;\n // let res = \"\";\n // if (commentsRange) {\n // for (const commentRange of commentsRange) {\n // const commentText = fullText.slice(commentRange.pos, commentRange.end);\n // if (commentText !== undefined) {\n // const formatted = commentText\n // .split(\"\\n\")\n // .map(line=>line.trim())\n // .map(line => !(line.trim().startsWith(\"*\")) ? this.getIden(identation) + line : this.getIden(identation) + \" \" + line) .join(\"\\n\");\n // // res+= this.transformLeadingComment(formatted) + \"\\n\";\n // }\n // }\n // }\n // return res;\n // }\n}\n\n// if (this.requiresCallExpressionCast) {\n// const parsedTypes = this.getTypesFromCallExpressionParameters(node);\n// const tmpArgs = [];\n// args.forEach((arg, index) => {\n// const parsedType = parsedTypes[index];\n// const cast = parsedType ? `(${parsedType})` : '';\n// tmpArgs.push(cast + this.printNode(arg, identation).trim());\n// });\n// parsedArgs = tmpArgs.join(\",\");\n// } else {\n// parsedArgs = args.map((a) => {\n// return this.printNode(a, identation).trim();\n// }).join(\", \");\n// }\n\n// getTypesFromCallExpressionParameters(node) {\n// const resolvedParams = this.getChecker().getResolvedSignature(node).parameters;\n// const parsedTypes = [];\n// resolvedParams.forEach((p) => {\n// const decl = p.declarations[0];\n// const type = this.getChecker().getTypeAtLocation(decl);\n// const parsedType = this.getTypeFromRawType(type);\n// parsedTypes.push(parsedType);\n// });\n\n// return parsedTypes;\n// }\n\n\n// get class decl node\n// Use the ts.getAllSuperTypeNodes function to get the base classes for the MyClass\n// const baseClasses = ts.getAllSuperTypeNodes(classDeclaration);\n\n// // Create a type checker\n// const typeChecker = ts.createTypeChecker(sourceFile.context.program, sourceFile.context.checker);\n\n// // Get the type of the base class\n// const baseClassType = typeChecker.getTypeAtLocation(baseClasses[0]);\n\n// // Get the class declaration for the base class\n// const baseClassDeclaration = baseClassType.symbol.valueDeclaration;\n\n// console.log(baseClassDeclaration);\n","import { BaseTranspiler } from \"./baseTranspiler.js\";\nimport * as fs from \"fs\";\nimport * as path from \"path\";\nimport { SyntaxKind, getLeadingCommentRanges } from 'typescript/unstable/ast';\nimport { isArrowFunction, isBinaryExpression, isBlock, isBooleanLiteral, isCallExpression, isClassDeclaration as isClassDeclarationNode, isElementAccessExpression, isExpressionStatement, isFunctionDeclaration, isFunctionExpression, isIfStatement, isMethodDeclaration, isReturnStatement, isSourceFile, isStatement as isStatementNode, isThrowStatement, isTryStatement } from 'typescript/unstable/ast/is';\nimport { Checker, IndexKind, SymbolFlags, TypeFlags } from 'typescript/unstable/sync';\nimport type { BinaryExpression, CallExpression, Node, NodeArray, Statement } from 'typescript/unstable/ast';\nimport { getAllSuperTypeNodes, isFunctionLike } from './tsUtils.js';\n\n\nconst GO_ITERATION_STATEMENT_KINDS = new Set([SyntaxKind.ForStatement, SyntaxKind.ForInStatement,\n SyntaxKind.ForOfStatement, SyntaxKind.DoStatement, SyntaxKind.WhileStatement]);\n\nconst parserConfig = {\n 'ELSEIF_TOKEN': 'else if',\n 'OBJECT_OPENING': 'map[string]any{',\n 'ARRAY_OPENING_TOKEN': '[]any{',\n 'ARRAY_CLOSING_TOKEN': '}',\n 'PROPERTY_ASSIGNMENT_TOKEN': ':',\n 'VAR_TOKEN': 'object', // object\n 'METHOD_TOKEN': 'func',\n 'PROPERTY_ASSIGNMENT_OPEN': '',\n 'PROPERTY_ASSIGNMENT_CLOSE': '',\n 'SUPER_TOKEN': 'base',\n 'SUPER_CALL_TOKEN': 'base',\n 'FALSY_WRAPPER_OPEN': 'EvalTruthy(',\n 'FALSY_WRAPPER_CLOSE': ')',\n 'COMPARISON_WRAPPER_OPEN' : \"IsEqual(\",\n 'COMPARISON_WRAPPER_CLOSE' : \")\",\n 'UKNOWN_PROP_WRAPPER_OPEN': 'this.call(',\n 'UNKOWN_PROP_WRAPPER_CLOSE': ')',\n 'UKNOWN_PROP_ASYNC_WRAPPER_OPEN': 'this.callAsync(',\n 'UNKOWN_PROP_ASYNC_WRAPPER_CLOSE': ')',\n 'DYNAMIC_CALL_OPEN': 'callDynamically(',\n 'EQUALS_EQUALS_WRAPPER_OPEN': 'IsEqual(',\n 'EQUALS_EQUALS_WRAPPER_CLOSE': ')',\n 'DIFFERENT_WRAPPER_OPEN': '!IsEqual(',\n 'DIFFERENT_WRAPPER_CLOSE': ')',\n 'GREATER_THAN_WRAPPER_OPEN': 'IsGreaterThan(',\n 'GREATER_THAN_WRAPPER_CLOSE': ')',\n 'GREATER_THAN_EQUALS_WRAPPER_OPEN': 'IsGreaterThanOrEqual(',\n 'GREATER_THAN_EQUALS_WRAPPER_CLOSE': ')',\n 'LESS_THAN_WRAPPER_OPEN': 'IsLessThan(',\n 'LESS_THAN_WRAPPER_CLOSE': ')',\n 'LESS_THAN_EQUALS_WRAPPER_OPEN': 'IsLessThanOrEqual(',\n 'LESS_THAN_EQUALS_WRAPPER_CLOSE': ')',\n 'PLUS_WRAPPER_OPEN':'Add(',\n 'PLUS_WRAPPER_CLOSE':')',\n 'MINUS_WRAPPER_OPEN':'Subtract(',\n 'MINUS_WRAPPER_CLOSE':')',\n 'ARRAY_LENGTH_WRAPPER_OPEN': 'GetArrayLength(',\n 'ARRAY_LENGTH_WRAPPER_CLOSE': ')',\n 'DIVIDE_WRAPPER_OPEN': 'Divide(',\n 'DIVIDE_WRAPPER_CLOSE': ')',\n 'MULTIPLY_WRAPPER_OPEN': 'Multiply(',\n 'MULTIPLY_WRAPPER_CLOSE': ')',\n 'INDEXOF_WRAPPER_OPEN': 'GetIndexOf(',\n 'INDEXOF_WRAPPER_CLOSE': ')',\n 'MOD_WRAPPER_OPEN': 'Mod(',\n 'MOD_WRAPPER_CLOSE': ')',\n 'FUNCTION_TOKEN': 'func',\n 'DEFAULT_RETURN_TYPE': 'any',\n 'BLOCK_OPENING_TOKEN': '{',\n 'DEFAULT_PARAMETER_TYPE': 'any',\n 'LINE_TERMINATOR': '',\n 'CONDITION_OPENING':'',\n 'CONDITION_CLOSE':'',\n 'AWAIT_TOKEN': '',\n 'NULL_TOKEN': 'nil',\n 'UNDEFINED_TOKEN': 'nil',\n 'WHILE_TOKEN': 'for',\n 'ELEMENT_ACCESS_WRAPPER_OPEN': 'GetValue(',\n 'ELEMENT_ACCESS_WRAPPER_CLOSE': ')',\n};\n\n// Go static type of the native emissions the printer itself makes (a stdlib call,\n// or one of its own immediately-called literals). A local that captures one holds\n// that concrete type, exactly like the helper result the emission replaced.\nconst GO_NATIVE_CALL_RETURN_TYPES: { [name: string]: string } = {\n 'strings.Index': 'int',\n};\n\n// `this.`, `this.2` and `this.N` of each accessor family, all typed `goType`\nfunction goSafeAccessorTypes (names: string[], goType: string): { [name: string]: string } {\n return Object.fromEntries(names.flatMap((name) => [ '', '2', 'N' ].map((suffix) => [ 'this.' + name + suffix, goType ])));\n}\n\n// Go static type of the value each base helper returns. A local initialised by\n// one of these already holds that concrete type inside its `any` box, so naming\n// the type at the declaration site keeps the very same runtime value and only\n// refines what the Go compiler knows about it.\nconst GO_HELPER_RETURN_TYPES: { [name: string]: string } = {\n 'GetArrayLength': 'int',\n 'GetLength': 'int',\n // the printInlineArrayLength emission of `.length` on a slice\n 'len': 'int',\n 'GetIndexOf': 'int',\n 'ToString': 'string',\n // hand-written exchange_encode.go helper, a plain Go `string` on its only return path\n 'this.UrlencodeNested': 'string',\n 'ToLower': 'string',\n 'ToUpper': 'string',\n 'JsonStringify': 'string',\n 'Capitalize': 'string',\n 'this.Uuid': 'string',\n 'this.Hmac': 'string',\n 'this.Ymdhms': 'string',\n 'this.Yyyymmdd': 'string',\n 'this.Ymd': 'string',\n 'Split': '[]string',\n 'ObjectKeys': '[]string',\n 'this.Extend': 'map[string]any',\n 'this.DeepExtend': 'map[string]any',\n 'this.Keysort': 'map[string]any',\n 'this.IndexBy': 'map[string]any',\n 'this.GroupBy': 'map[string]any',\n 'this.Milliseconds': 'int64',\n 'this.Seconds': 'int64',\n 'this.Microseconds': 'int64',\n 'ParseInt': 'int64',\n 'MathFloor': 'float64',\n 'MathCeil': 'float64',\n 'MathRound': 'float64',\n 'MathAbs': 'float64',\n 'MathPow': 'float64',\n 'ToFloat64': 'float64',\n 'EvalTruthy': 'bool',\n 'IsEqual': 'bool',\n 'IsGreaterThan': 'bool',\n 'IsLessThan': 'bool',\n 'IsGreaterThanOrEqual': 'bool',\n 'IsLessThanOrEqual': 'bool',\n 'InOp': 'bool',\n 'IsArray': 'bool',\n 'IsString': 'bool',\n 'IsInt': 'bool',\n 'IsBool': 'bool',\n 'IsNumber': 'bool',\n 'IsObject': 'bool',\n 'IsDictionary': 'bool',\n 'StartsWith': 'bool',\n 'EndsWith': 'bool',\n // the native string operations (emitted with a proven Go `string` receiver) return exactly\n // the type of the helper they replace, so a local initialised by one keeps its declared type\n 'strings.Split': '[]string',\n 'strings.Join': 'string',\n 'strings.ToUpper': 'string',\n 'strings.ToLower': 'string',\n 'strings.Replace': 'string',\n 'strings.ReplaceAll': 'string',\n 'strings.HasPrefix': 'bool',\n 'strings.HasSuffix': 'bool',\n 'strconv.FormatInt': 'string',\n 'IsInstance': 'bool',\n 'IsInteger': 'bool',\n 'this.InArray': 'bool',\n 'this.ValueIsDefined': 'bool',\n 'Precise.StringGt': 'bool',\n 'Precise.StringGe': 'bool',\n 'Precise.StringLt': 'bool',\n 'Precise.StringLe': 'bool',\n 'Precise.StringEq': 'bool',\n 'Precise.StringEquals': 'bool',\n // the base Safe* accessors return a typed pointer so that an absent value is a\n // nil pointer, distinct from a present zero value (\"\" / 0 / false)\n ...goSafeAccessorTypes([ 'SafeString', 'SafeStringLower', 'SafeStringUpper' ], '*string'),\n ...goSafeAccessorTypes([ 'SafeInteger', 'SafeIntegerProduct', 'SafeTimestamp' ], '*int64'),\n ...goSafeAccessorTypes([ 'SafeFloat' ], '*float64'),\n // absent flag → nil pointer, present flag → its value, mirroring the string/number accessors\n ...goSafeAccessorTypes([ 'SafeBool' ], '*bool'),\n // SafeDict*/SafeList* stay untyped: the Go accessors return `any` because the value\n // may be a *sync.Map, a Dict or an order-book side, none of which is a map[string]any / []any\n // Precise arithmetic returns a numeric string, or nil when an operand is\n // absent, so it carries the same *string shape as the Safe* string accessors\n ...Object.fromEntries([ 'Mul', 'Div', 'Sub', 'Add', 'Or', 'Max', 'Min', 'Abs', 'Neg', 'Mod' ].map((op) => [ 'Precise.String' + op, '*string' ])),\n};\n\n// helpers whose Go signature is `any` (GetValue, Ternary, Add, SafeValue, ...) are\n// deliberately absent above: their box holds a value the printer cannot name, so\n// those locals stay `any`. A Safe* entry presupposes the matching Go accessor\n// returns that shape (as the hand-written base already does for Str/Int/Float).\n\n// printed calls whose Go result is a JSON decode: map/slice/scalar or nil, never a\n// typed pointer. `this.parseJson` / `this.json` are the hand-written base decoders,\n// `JsonParse` / `ParseJSON` their runtime twins.\nconst GO_JSON_PARSE_CALLS = [ 'Json', 'JsonParse', 'ParseJson', 'ParseJSON' ];\n\n// Hand-written CCXT fields whose Go type is a plain `bool` (go/v4/exchange.go,\n// struct BaseExchange, embedded by every derived exchange). Reading one already\n// yields a Go bool, so a condition on it needs no truthiness helper at all.\nconst GO_BOOL_FIELDS = new Set([\n 'this.Verbose',\n 'this.EnableRateLimit',\n 'this.ReduceFees',\n 'this.SubstituteCommonCurrencyCodes',\n 'this.IsSandboxModeEnabled',\n // `public newUpdates: boolean` in ts/src/base/Exchange.ts; the hand-written\n // struct field is the `NewUpdates bool` read by every WS loop\n 'this.NewUpdates',\n]);\n\n// Hand-written BaseExchange methods (go/v4/exchange.go) whose Go signature returns a\n// plain `bool`, so `EvalTruthy(this.IsEmpty(x))` IS `this.IsEmpty(x)`. InArray,\n// Precise.String* and the retagged generated methods are already in GO_HELPER_RETURN_TYPES.\nconst GO_BOOL_CALL_NAMES_NATIVE = [\n 'this.IsEmpty',\n 'this.IsJsonEncodedObject',\n 'this.IsBinaryMessage',\n];\n// Pointer-returning accessors the ccxt build pass wraps with DerefScalar but that the\n// Go type table above does not name (their printed Go signature is not in it).\nconst GO_DEREF_WRAPPED_CALLS = [ 'NumberToString', 'Parse8601', 'Iso8601' ];\n\n// A printed call the printer cannot type *and* whose Go signature returns `any`\n// can be compared with nil / a string / a bool literal without the helper: the\n// box holds a scalar or nil, never a typed pointer.\nconst GO_ANY_BOX_CALLS = [\n 'GetValue', 'Ternary',\n 'SafeValue', 'this.SafeValue',\n 'SafeDict', 'this.SafeDict',\n 'SafeList', 'this.SafeList',\n 'SafeNumber', 'this.SafeNumber',\n];\n\n// read-only string accessors whose printed Go result is a `*string`. Each one reads\n// its arguments and returns a fresh pointer, so repeating the call in the two halves\n// of a deref comparison returns the same value when every argument is a plain read.\nconst GO_PURE_STRING_ACCESSORS = [\n 'this.SafeString', 'this.SafeString2', 'this.SafeStringN',\n 'this.SafeStringLower', 'this.SafeStringLower2', 'this.SafeStringLowerN',\n 'this.SafeStringUpper', 'this.SafeStringUpper2', 'this.SafeStringUpperN',\n 'this.NumberToString', 'this.SafeCurrencyCode',\n];\n\n// the `*bool` twin of the table above: the accessors whose Go signature returns a\n// pointer that is nil for an absent flag and carries the flag otherwise — the same\n// two states `derefScalar` hands the truthiness helper.\nconst GO_PURE_BOOL_ACCESSORS = [\n 'this.SafeBool', 'this.SafeBool2', 'this.SafeBoolN',\n];\n\n// Pointer types the Go nil test of the runtime helpers reproduces exactly: derefScalar\n// unwraps them to an untyped nil, IsEqual has its own *sync.Map case. Other pointers\n// (*sync.Mutex), map/slice fields and `any` fields flip meaning, so they keep the helper.\nconst GO_NIL_EQUIVALENT_POINTER_TYPES_Native = new Set([\n '*sync.Map', '*string', '*int64', '*float64', '*bool', '*int', '*[]string', '*[]any', '*map[string]any',\n]);\n\n// hand-written BaseExchange fields (go/v4/exchange.go) declared `*sync.Map`\nconst GO_SYNC_MAP_FIELDS = [\n 'Options', 'Markets', 'Markets_by_id', 'MarketsById', 'Currencies', 'Currencies_by_id', 'CurrenciesById',\n 'BaseCurrencies', 'QuoteCurrencies', 'Tickers', 'Orderbooks', 'Transactions',\n];\n\n// Hand-written BaseExchange fields (go/v4/exchange.go, embedded by every exchange\n// class) declared with one of those pointer types, keyed by the printed Go field name;\n// the Go type lives in the hand-written base, not in the TypeScript class.\nconst GO_NILABLE_FIELDS_Typed: { [name: string]: string } = Object.fromEntries(\n [ ...GO_SYNC_MAP_FIELDS, 'Bidsasks' ].map((name) => [ 'this.' + name, '*sync.Map' ]));\n\nconst GO_TYPE_NAMES = [ 'string', 'int', 'int64', 'float64', 'bool', 'any' ];\n\n// `var x any = this.SafeDict(container, key)` may declare the map type: SafeMapTyped reads the same\n// member and returns the map (sync.Map converted), nil when absent or not a map. Emitted only when\n// every later use READS it as a dictionary — a typed nil map is a non-nil interface otherwise.\nconst GO_SAFE_DICT_LOCAL_TYPE = 'map[string]any';\n\n// the hand-written helpers a typed dict local may be handed to as their receiver: each one\n// normalises the argument with derefScalar/GetValue, so a nil map reads exactly like the nil\n// interface the local used to hold\nconst GO_SAFE_DICT_READ_HELPERS = [ 'GetValue', 'InOp', 'ObjectKeys', 'IsDictionary' ];\n\n// `var market any = this.Market(symbol)` / `this.SafeMarket(…)`: the TS return type is the\n// `MarketInterface` interface, so MapTyped returns the same dictionary and the local can be\n// `map[string]any`. Emitted only while every later use READS it as a dictionary (SafeDict scan).\nconst GO_MARKET_LOCAL_TYPE = 'map[string]any';\n\n// the binary operators under which a market/currency local's element read is a pure READ: the\n// element is derefed by the GetValue the element-read printer keeps for these operands\n// (goMarketComparisonElementRead), so `market['swap'] === true` keeps answering exactly what the\nconst GO_MARKET_READ_COMPARISON_OPERATORS = [\n SyntaxKind.EqualsEqualsToken,\n SyntaxKind.ExclamationEqualsToken,\n SyntaxKind.EqualsEqualsEqualsToken,\n SyntaxKind.ExclamationEqualsEqualsToken,\n SyntaxKind.LessThanToken,\n SyntaxKind.GreaterThanToken,\n SyntaxKind.LessThanEqualsToken,\n SyntaxKind.GreaterThanEqualsToken,\n SyntaxKind.AmpersandAmpersandToken,\n SyntaxKind.BarBarToken,\n];\n\n// `var x any = this.SafeList(container, key)` may carry the slice type for the same reason: the\n// accessor returns `any`, so SafeListTyped reads the same member and hands back a []any with the\n// same length and elements (every array kind IsArray admits is converted), nil when the member is\nconst GO_SAFE_LIST_LOCAL_TYPE = '[]any';\n\n// the boundary comment ccxt's base sources (ts/src/base/Exchange.ts, PredictionExchange.ts)\n// carry and build/goTranspiler.ts re-assembles the generated file around\n\n// the Go numeric kinds. `<` `>` `<=` `>=` compile without a conversion only when\n// both operands carry the same one of these\nconst GO_NUMERIC_KINDS = [ 'int', 'int64', 'float64' ];\n\nconst ORDERED_COMPARISON_OPERATORS: { [kind: number]: string } = {\n [SyntaxKind.GreaterThanToken]: '>',\n [SyntaxKind.GreaterThanEqualsToken]: '>=',\n [SyntaxKind.LessThanToken]: '<',\n [SyntaxKind.LessThanEqualsToken]: '<=',\n};\n\n// hand-written BaseExchange fields (go/v4/exchange.go) declared `string`: their Go\n// value is never nil, so `this. + s` matches Add(field, s) exactly. The Go\n// struct field is what decides — a batch-A `Str` TS annotation (`version: Str`)\n// still prints this field as a plain Go string.\nconst GO_STRING_FIELD_NAMES = [ 'Id', 'Name', 'Version', 'Url', 'Hostname', 'UserAgent' ];\n\n// the hand-written SafeString-family methods (go/v4/exchange_safe.go) return a fresh\n// non-nil pointer whenever the call passes a non-nil default: the value branch takes\n// the address of the found string, the default branch the address of ToString(def).\nconst GO_DEFAULTED_SAFE_STRING_ARITY: { [name: string]: number } = {\n 'safeString': 3, 'safeStringLower': 3, 'safeStringUpper': 3,\n 'safeString2': 4, 'safeStringLower2': 4, 'safeStringUpper2': 4,\n 'safeStringN': 3, 'safeStringLowerN': 3, 'safeStringUpperN': 3,\n};\n\n// the default shapes derefScalar leaves non-nil: a literal default is never the absent\n// case, so the method's nil return is unreachable for a call carrying one\nconst GO_NON_NIL_DEFAULT_KINDS = [\n SyntaxKind.StringLiteral, SyntaxKind.NoSubstitutionTemplateLiteral,\n SyntaxKind.NumericLiteral, SyntaxKind.TrueKeyword, SyntaxKind.FalseKeyword,\n];\n\n// the operators that write their left operand: an assignment through any of them may\n// store a nil pointer where the deref proof expected the defaulted call's result\nconst GO_WRITE_OPERATOR_KINDS = [\n SyntaxKind.EqualsToken, SyntaxKind.PlusEqualsToken, SyntaxKind.MinusEqualsToken,\n SyntaxKind.AsteriskEqualsToken, SyntaxKind.SlashEqualsToken, SyntaxKind.PercentEqualsToken,\n];\n\n// hand-written BaseExchange fields (go/v4/exchange.go) declared as a container: an\n// element write on one of them is native code — a map index write, or `Store` for the\n// thread-safe ones, which is exactly what AddElementToObject does for a *sync.Map.\nconst GO_FIELD_CONTAINER_TYPES_NATIVE: { [name: string]: string } = Object.fromEntries([\n ...[\n 'Has', 'Api', 'TransformedApi', 'RequiredCredentials', 'HttpExceptions', 'Timeframes', 'Features',\n 'Exceptions', 'Precision', 'UserAgents', 'TokenBucket', 'CommonCurrencies', 'ProxyDictionaries',\n 'WsClients', 'Clients', 'Limits', 'Fees', 'Status', 'Countries',\n ].map((name) => [ name, 'map[string]any' ]),\n ...GO_SYNC_MAP_FIELDS.map((name) => [ name, '*sync.Map' ]),\n]);\n\n// operator kinds the arithmetic helpers are emitted for\nconst GO_ARITHMETIC_KINDS = [\n SyntaxKind.PlusToken,\n SyntaxKind.MinusToken,\n SyntaxKind.AsteriskToken,\n SyntaxKind.SlashToken,\n SyntaxKind.PercentToken,\n];\n\n// ---------------------------------------------------------------------------------------------\n// Trailing `//` comment alignment (gofmt's tabwriter cells).\n//\n// go/printer separates a trailing comment from the code with a hard tab (`writeCommentPrefix`),\n// so the code text is the last tab-terminated cell of the line. text/tabwriter pads that cell to\n// the widest cell of its column block plus `padding = 1` (gofmt runs with `minwidth = 0`,\n// `padding = 1`, `padchar = ' '`), which is why adjacent statements get their comments aligned\n// and a lone one gets exactly one space. A column block is the run of adjacent lines whose code\n// cell sits in the same column (same indentation); formfeeds terminate all columns, and\n// go/printer emits them between sections: blank and comment-only lines, a change of indentation,\n// each line of a multi-line expression (`binaryExpr` breaks with `newSection = true`) and every\n// statement that follows a multi-line one (`stmtList` breaks with `newSection = true`).\n//\n// The pass below reproduces that padding on the printed text. It is a no-op on text gofmt has\n// already aligned (verified over the whole go/v4 tree) and it never reflows or re-wraps a line.\n// ---------------------------------------------------------------------------------------------\n\n// a line whose code ends like this does not end its statement: the line below it belongs to the\n// same multi-line expression, and go/printer puts a formfeed before it (a new column block)\nconst GO_COMMENT_BREAK_END = /(?:[({[:]|[+\\-*/%&|^<>=!])$/;\n\n// the index just past the `\"`/`'` literal opening at `start` (backslash escapes skipped)\nfunction goSkipQuoted (text: string, start: number): number {\n let i = start + 1;\n while (i < text.length) {\n if (text[i] === '\\\\') {\n i += 2;\n continue;\n }\n if (text[i] === text[start]) {\n return i + 1;\n }\n i += 1;\n }\n return i;\n}\n\n// (opens - closes) of ()[]{} outside strings, so `foo(` (statement continues) and `}` (statement\n// ended before this line) are not mistaken for complete single-line statements\nfunction goBracketBalance (code: string): number {\n let depth = 0;\n let i = 0;\n while (i < code.length) {\n const ch = code[i];\n if ((ch === '\"') || (ch === '\\'')) {\n i = goSkipQuoted (code, i);\n continue;\n }\n if (ch === '`') {\n i += 1;\n while ((i < code.length) && (code[i] !== '`')) {\n i += 1;\n }\n i += 1;\n continue;\n }\n if ((ch === '(') || (ch === '[') || (ch === '{')) {\n depth += 1;\n } else if ((ch === ')') || (ch === ']') || (ch === '}')) {\n depth -= 1;\n }\n i += 1;\n }\n return depth;\n}\n\n// the return type the printer's own immediately-called func literal carries\n// (`func() T { … }()`), or undefined when the text is not one or T is an `any` box\nfunction goFuncLiteralReturnType (value: string): string | undefined {\n const literal = /^func\\(\\) ([\\w.[\\]]*) \\{/.exec(value);\n if ((literal === null) || !value.endsWith('}()') || (literal[1] === 'any')) {\n return undefined;\n }\n return literal[1];\n}\n\n// index of the first `//` outside strings and comments, or -1. The state is carried across lines\n// because `/* */` comments and `-quoted strings can span them (a `//` inside a string literal is\n// data, e.g. the `https://` of an endpoint, and must not be taken for a comment)\nfunction goTrailingCommentIndex (line: string, state: { block: boolean, raw: boolean }): number {\n let i = 0;\n while (i < line.length) {\n const ch = line[i];\n if (state.block) {\n if ((ch === '*') && (line[i + 1] === '/')) {\n state.block = false;\n i += 2;\n continue;\n }\n i += 1;\n continue;\n }\n if (state.raw) {\n if (ch === '`') {\n state.raw = false;\n }\n i += 1;\n continue;\n }\n if (ch === '`') {\n state.raw = true;\n i += 1;\n continue;\n }\n if ((ch === '\"') || (ch === '\\'')) {\n i = goSkipQuoted (line, i);\n continue;\n }\n if ((ch === '/') && (line[i + 1] === '/')) {\n return i;\n }\n if ((ch === '/') && (line[i + 1] === '*')) {\n state.block = true;\n i += 2;\n continue;\n }\n i += 1;\n }\n return -1;\n}\n\n// tabwriter counts runes, not bytes (a multi-byte identifier is one column wide)\nfunction goRuneWidth (text: string): number {\n return [ ...text ].length;\n}\n\nfunction alignGoTrailingComments (content: string): string {\n const lines = content.split ('\\n');\n const entries: { index: number, indent: string, code: string, comment: string }[] = [];\n const state = { 'block': false, 'raw': false };\n for (let index = 0; index < lines.length; index++) {\n const commentIndex = goTrailingCommentIndex (lines[index], state);\n if (commentIndex < 0) {\n continue;\n }\n // the code cell: everything before the comment, without the padding already inside it\n const code = lines[index].slice (0, commentIndex).replace (/[ \\t]+$/, '');\n if (!code.trim ()) {\n continue; // a comment-only line is a section break, it is never a cell\n }\n const indent = code.match (/^[ \\t]*/)[0];\n entries.push ({ 'index': index, indent, code, 'comment': lines[index].slice (commentIndex) });\n }\n // group the lines that share a code column: adjacent, same indentation, and no section break\n // in between (the previous line must end its own statement, and that statement must be a\n // single-line one, or the next statement starts a new section)\n const groups: typeof entries[] = [];\n let group: typeof entries = [];\n for (const entry of entries) {\n const previous = group[group.length - 1];\n const continues = previous\n && (entry.index === previous.index + 1)\n && (entry.indent === previous.indent)\n && (goBracketBalance (previous.code) === 0)\n && !GO_COMMENT_BREAK_END.test (previous.code);\n if (continues) {\n group.push (entry);\n } else {\n if (group.length) {\n groups.push (group);\n }\n group = [ entry ];\n }\n }\n if (group.length) {\n groups.push (group);\n }\n for (const members of groups) {\n let width = 0;\n for (const member of members) {\n width = Math.max (width, goRuneWidth (member.code));\n }\n width += 1; // tabwriter padding\n for (const member of members) {\n const pad = width - goRuneWidth (member.code);\n lines[member.index] = member.code + ' '.repeat (pad) + member.comment;\n }\n }\n return lines.join ('\\n');\n}\n\n// `/^this\\s*\\.\\s*\\s*\\(/` for each name: a call of that method on `this`\nfunction goThisCallPatterns (names: string[]): RegExp[] {\n return names.map((name) => new RegExp('^this\\\\s*\\\\.\\\\s*' + name + '\\\\s*\\\\('));\n}\n\n// the TypeScript accessors whose Go signature this printer knows to be `*string`\n// (GO_HELPER_RETURN_TYPES plus coerced SafeCurrencyCode/SafeSymbol); the textual call-site proof\n// uses them for ts/src sibling files a scoped run's program does not carry.\nconst GO_TS_SRC_STRING_PRODUCERS = goThisCallPatterns([\n 'safeString', 'safeString2', 'safeString3', 'safeStringN', 'safeStringLower', 'safeStringLower2',\n 'safeStringUpper', 'safeStringUpper2', 'safeCurrencyCode', 'safeSymbol',\n]);\n\n// the TS accessors whose Go signature GO_HELPER_RETURN_TYPES already names\n// `map[string]any`, for the same textual sibling-file proof. A map argument is also\n// proven when it is an object literal (its printed Go form is exactly that map) or a\nconst GO_TS_SRC_MAP_PRODUCERS = goThisCallPatterns([ 'extend', 'deepExtend', 'keysort', 'indexBy', 'groupBy' ]);\n\n// the argument texts of a call whose opening parenthesis sits at `open`, or undefined\n// when the parentheses do not balance — an unproven call site must never pass the proof\nfunction goBalancedCallArgs (text: string, open: number): string[] | undefined {\n const args: string[] = [];\n let depth = 0;\n let current = '';\n let quote: string | undefined;\n for (let i = open; i < text.length; i++) {\n const ch = text[i];\n if (quote !== undefined) {\n current += ch;\n if (ch === '\\\\') {\n current += text[i + 1] ?? '';\n i++;\n continue;\n }\n if (ch === quote) {\n quote = undefined;\n }\n continue;\n }\n if ((ch === '\"') || (ch === \"'\") || (ch === '`')) {\n quote = ch;\n current += ch;\n continue;\n }\n if ((ch === '/') && (text[i + 1] === '/')) {\n while ((i < text.length) && (text[i] !== '\\n')) { i++; }\n continue;\n }\n if (ch === '(') {\n depth++;\n if (depth > 1) { current += ch; }\n continue;\n }\n if (ch === ')') {\n depth--;\n if (depth === 0) {\n if (current.trim().length > 0) { args.push (current.trim ()); }\n return args;\n }\n current += ch;\n continue;\n }\n if ((ch === ',') && (depth === 1)) {\n args.push (current.trim ());\n current = '';\n continue;\n }\n current += ch;\n }\n return undefined;\n}\n\nexport {\n alignGoTrailingComments,\n};\n\n// implicit endpoints pass api (['v1', 'private']) and params (a list for batch orders) untyped;\n// exchange overrides of sign/fetch2/request usually omit the base `api: any` annotation\nconst GO_GETARG_EXCLUDED_POSITIONS: { [name: string]: number[] } = {\n 'fetch2': [ 1, 3 ],\n 'request': [ 1, 3 ],\n 'sign': [ 1, 3 ],\n};\n\n// base helpers typed `any[]` that hand back, at this index, the params map they were given\n// (unchanged, omitted or extended: always a map[string]any in Go)\nconst GO_PARAMS_TUPLE_HELPERS: { [name: string]: number } = {\n 'handleUntilOption': 1,\n 'handleNetworkCodeAndParams': 1,\n 'handleWithdrawTagAndParams': 1,\n 'handleTriggerAndParams': 1,\n 'handleTriggerDirectionAndParams': 1,\n 'handlePostOnly': 1,\n 'handleTriggerPricesAndParams': 3,\n};\n\n// receivers that read a nil map exactly like an untyped nil (derefScalar + a missed lookup);\n// IsDictionary and IsEqual answer differently for a nil map, so they are not listed\nconst GO_GETARG_NIL_MAP_READERS = [\n 'GetValue', 'InOp', 'ObjectKeys', 'SafeValue', 'SafeValue2', 'SafeDict', 'SafeList',\n 'SafeString', 'SafeString2', 'SafeStringN', 'SafeStringUpper', 'SafeStringLower',\n 'SafeInteger', 'SafeInteger2', 'SafeNumber', 'SafeNumber2', 'SafeFloat', 'SafeBool', 'SafeTimestamp',\n];\n\nexport class GoTranspiler extends BaseTranspiler {\n\n // scopes are scanned many times per local; walking remote TS7 nodes is costly, so the\n // preorder descendant list is built once per scope (same visit order and early stop)\n goScopeDescendants = new WeakMap();\n goDescendantsOf(scope): any[] {\n let list = this.goScopeDescendants.get(scope);\n if (list === undefined) {\n list = [];\n const out = list;\n const visit = (n: any) => {\n out.push(n);\n n.forEachChild(visit);\n };\n scope.forEachChild(visit);\n this.goScopeDescendants.set(scope, list);\n }\n return list;\n }\n\n hasNodeWhere(scope: Node | undefined, predicate: (n: any) => boolean): boolean {\n if (scope === undefined) {\n return false;\n }\n return this.goDescendantsOf(scope).some(predicate);\n }\n\n binaryExpressionsWrappers;\n wrapThisCalls: boolean;\n wrapCallMethods: string[] = [];\n // inherited method name -> indexes of required params that print `string` on the base and every\n // override (the caller audits all declarations); other callers convert through StringArg\n unifiedStringParams: { [method: string]: number[] } = {};\n // installed by the ccxt build: GetArg alias -> Go types, and the audited consumer table\n CCXT_GO_GETARG_DECLARED_TYPES: any;\n CCXT_GO_GETARG_SAFE_CONSUMERS: any;\n goGetArgTypeCache: WeakMap;\n goGetArgTypeComputing: Set;\n // declarations whose Go local type is being resolved right now (see goLocalStaticType)\n goLocalTypeResolution = new Set();\n // goSelfConcatIsString's answer per non-self leaf node\n goSelfConcatLeafCache = new WeakMap();\n goLocalStaticTypeCache = new WeakMap();\n // binary-expression texts and goNativeArithmetic types, keyed by node + print context, alive only\n // while the outermost binary print/typing runs: operand typing re-prints every nested operator\n goBinaryMemo: Map> | undefined;\n // appended to every async (channel returning) Go method/function name and to each\n // checker-resolved call site of one; '' disables the rename\n asyncMethodSuffix = '';\n // declaring-file patterns whose async methods keep the plain name at call sites (generated\n // endpoint bodies the target language implements itself, e.g. ccxt's ts/src/abstract/)\n asyncSuffixExemptPaths: RegExp[] = [];\n classNameMap: { [key: string]: string };\n DEFAULT_RETURN_TYPE = 'any';\n // suffix of the sibling body method an async trampoline hands its work to\n ASYNC_BODY_SUFFIX = 'Body';\n // gofmt indents every nesting level with exactly one tab; the printer emits the\n // same bytes so the generated tree needs no `gofmt` pass (campaign go-gofmt F01)\n DEFAULT_IDENTATION = \"\\t\";\n // stdlib packages the printed source file references. A Go import must precede the first\n // declaration, so the file-level print (printSourceFileStatements) collects names here and\n // prepends `import \"...\"`. Nested prints keep their own list; memo of goStdlibImportIsPlaceable().\n\n constructor(config = {}) {\n config['parser'] = Object.assign ({}, parserConfig, config['parser'] ?? {});\n\n super(config);\n\n this.requiresParameterType = true;\n this.requiresReturnType = true;\n this.asyncTranspiling = false;\n this.implicitAsyncTranspiling = true;\n this.supportsFalsyOrTruthyValues = false;\n this.requiresCallExpressionCast = true;\n this.wrapThisCalls = false;\n this.id = \"Go\";\n this.className = \"undefined\";\n this.classNameMap = config['classNameMap'] ?? {};\n this.initConfig();\n\n // user overrides\n this.applyUserOverrides(config);\n this.wrapThisCalls = config['wrapThisCalls'] ?? false;\n this.wrapCallMethods = config['wrapCallMethods'] ?? [];\n this.asyncMethodSuffix = config['asyncMethodSuffix'] ?? '';\n this.asyncSuffixExemptPaths = (config['asyncSuffixExemptPaths'] ?? []).map((p) => new RegExp(p));\n this.unifiedStringParams = config['unifiedStringParams'] ?? {};\n }\n\n initConfig() {\n this.LeftPropertyAccessReplacements = {\n // 'this': '$this',\n };\n\n this.RightPropertyAccessReplacements = {\n 'push': 'Add', // list method\n 'indexOf': 'IndexOf', // list method\n 'toUpperCase': 'ToUpper',\n 'toLowerCase': 'ToLower',\n 'toString': 'ToString',\n };\n\n this.FullPropertyAccessReplacements = {\n 'JSON.parse': 'parseJson', // custom helper method\n 'console.log': 'fmt.Println',\n 'Number.MAX_SAFE_INTEGER': 'Int32.MaxValue',\n 'Math.min': 'Math.Min',\n 'Math.max': 'Math.Max',\n 'Math.log': 'Math.Log',\n 'Math.abs': 'Math.Abs',\n // 'Math.ceil': 'Math.Ceiling', // need cast\n // 'Math.round': 'Math.Round', // need to cast\n 'Math.floor': 'Math.Floor',\n 'Math.pow': 'Math.Pow',\n // 'Promise.all': 'Task.WhenAll',\n };\n\n this.CallExpressionReplacements = {\n // \"parseInt\": \"parseINt\",\n // \"parseFloat\": \"float.Parse\",\n };\n\n this.ReservedKeywordsReplacements = {\n // 'string': 'str',\n // 'params': 'parameters',\n 'type': 'typeVar',\n // 'internal': 'intern',\n // 'event': 'eventVar',\n // 'fixed': 'fixedVar',\n };\n\n this.binaryExpressionsWrappers = {\n [SyntaxKind.EqualsEqualsToken]: [this.EQUALS_EQUALS_WRAPPER_OPEN, this.EQUALS_EQUALS_WRAPPER_CLOSE],\n [SyntaxKind.EqualsEqualsEqualsToken]: [this.EQUALS_EQUALS_WRAPPER_OPEN, this.EQUALS_EQUALS_WRAPPER_CLOSE],\n [SyntaxKind.ExclamationEqualsToken]: [this.DIFFERENT_WRAPPER_OPEN, this.DIFFERENT_WRAPPER_CLOSE],\n [SyntaxKind.ExclamationEqualsEqualsToken]: [this.DIFFERENT_WRAPPER_OPEN, this.DIFFERENT_WRAPPER_CLOSE],\n [SyntaxKind.GreaterThanToken]: [this.GREATER_THAN_WRAPPER_OPEN, this.GREATER_THAN_WRAPPER_CLOSE],\n [SyntaxKind.GreaterThanEqualsToken]: [this.GREATER_THAN_EQUALS_WRAPPER_OPEN, this.GREATER_THAN_EQUALS_WRAPPER_CLOSE],\n [SyntaxKind.LessThanToken]: [this.LESS_THAN_WRAPPER_OPEN, this.LESS_THAN_WRAPPER_CLOSE],\n [SyntaxKind.LessThanEqualsToken]: [this.LESS_THAN_EQUALS_WRAPPER_OPEN, this.LESS_THAN_EQUALS_WRAPPER_CLOSE],\n [SyntaxKind.PlusToken]: [this.PLUS_WRAPPER_OPEN, this.PLUS_WRAPPER_CLOSE],\n [SyntaxKind.MinusToken]: [this.MINUS_WRAPPER_OPEN, this.MINUS_WRAPPER_CLOSE],\n [SyntaxKind.AsteriskToken]: [this.MULTIPLY_WRAPPER_OPEN, this.MULTIPLY_WRAPPER_CLOSE],\n [SyntaxKind.PercentToken]: [this.MOD_WRAPPER_OPEN, this.MOD_WRAPPER_CLOSE],\n [SyntaxKind.SlashToken]: [this.DIVIDE_WRAPPER_OPEN, this.DIVIDE_WRAPPER_CLOSE],\n };\n }\n\n // getBlockOpen(identation){\n // return this.getIden(identation) + this.BLOCK_OPENING_TOKEN;\n // }\n\n printSuperCallInsideConstructor(node, identation) {\n return \"\"; // csharp does not need super call inside constructor\n }\n\n printStringLiteral(node) {\n const token = this.STRING_QUOTE_TOKEN;\n let text = node.text;\n if (text in this.StringLiteralReplacements) {\n return this.StringLiteralReplacements[text];\n }\n // skip the replaceAll passes when there is nothing to escape\n // note: single quotes must NOT be escaped — \\' is an invalid escape in Go string literals\n if (/[\\\\\"\\b\\f\\n\\r\\t]/.test(text)) {\n // Preserve real backslashes\n const backslashPlaceholder = \"\\x00\";\n text = text.replaceAll(\"\\\\\", backslashPlaceholder);\n text = text.replaceAll(\"\\b\", \"\\\\b\");\n text = text.replaceAll(\"\\f\", \"\\\\f\");\n text = text.replaceAll(\"\\n\", \"\\\\n\");\n text = text.replaceAll(\"\\r\", \"\\\\r\");\n text = text.replaceAll(\"\\t\", \"\\\\t\");\n text = text.replaceAll(backslashPlaceholder, \"\\\\\\\\\");\n text = text.replaceAll(\"\\\"\", \"\\\\\\\"\");\n }\n return token + text + token;\n }\n\n transformFunctionNameIfNeeded(name): string {\n return this.capitalize(name);\n }\n\n // The cells of one struct field in the shape gofmt's fieldList() prints them: a named\n // field is `Name Type [Tag]` (the name cell — and, when the field carries a tag, the type\n // cell too — is a tab-terminated column cell) and an embedded field is a single cell.\n // printStruct() lays those cells out; printPropertyDeclaration() joins them with spaces.\n getStructFieldCells(node) {\n const name = this.capitalize(this.printNode(node.name, 0));\n let type = 'any';\n if (node.type === undefined) {\n type = 'any';\n } else if (node.type.kind === SyntaxKind.StringKeyword) {\n type = 'string';\n } else if (node.type.kind === SyntaxKind.NumberKeyword) {\n type = 'int';\n } else if (node.type.kind === SyntaxKind.BooleanKeyword || isBooleanLiteral(node)) {\n type = 'bool';\n } else if (node.type.kind === SyntaxKind.ArrayType) {\n type = '[]any';\n }\n const cells = [ name, type ];\n if (node.initializer) {\n // we have to save the value and initialize it later\n let initializer = this.printNode(node.initializer, 0);\n // quick fix\n initializer = initializer.replaceAll('\"', '');\n cells.push(`\\`default:\"${initializer}\"\\``);\n }\n return cells;\n }\n\n printPropertyDeclaration(node, identation) {\n return this.getIden(identation) + this.getStructFieldCells(node).join(' ') + this.LINE_TERMINATOR;\n }\n\n printStruct(node, indentation) {\n\n const rows: string[][] = [];\n // check if we have heritage\n if (node?.heritageClauses?.length > 0) {\n const heritage = node.heritageClauses[0];\n const heritageType = heritage.types[0];\n let heritageEscapedText = heritageType.expression.text;\n if (this.classNameMap[heritageEscapedText]) {\n heritageEscapedText = this.classNameMap[heritageEscapedText];\n }\n // an embedded field has no type cell: it is a single, unterminated cell\n rows.push([ heritageEscapedText ]);\n }\n\n const propDeclarations = node.members.filter(member => member.kind === SyntaxKind.PropertyDeclaration);\n propDeclarations.forEach(member => rows.push(this.getStructFieldCells(member)));\n\n // gofmt lays the fields out with text/tabwriter (go/printer's fieldList): a column\n // block is a run of consecutive fields whose cell in that column is tab-terminated,\n // and every cell of the block is padded with spaces to the widest cell of the block\n // plus one. An embedded field (a single cell) and a field without a tag (its type is\n // the trailing cell) end the block of every column they have no cell in, which is\n // what keeps `Exchange` from widening the `exchangeTyped *ExchangeTyped` column.\n const lines = rows.map((cells, row) => {\n let line = cells[0];\n for (let column = 0; column < cells.length - 1; column++) {\n let width = 0;\n for (let previous = row; previous >= 0 && rows[previous].length > column + 1; previous--) {\n width = Math.max(width, rows[previous][column].length);\n }\n for (let next = row + 1; next < rows.length && rows[next].length > column + 1; next++) {\n width = Math.max(width, rows[next][column].length);\n }\n line += ' '.repeat(width + 1 - cells[column].length) + cells[column + 1];\n }\n return this.getIden(indentation + 1) + line;\n });\n\n // a struct with no fields is `type X struct {\\n}`: no stray blank line before the brace\n const body = lines.length ? '\\n' + lines.join('\\n') + '\\n' : '\\n';\n return `type ${this.className} struct {${body}}`;\n }\n\n printNewStructMethod(node){\n return `\nfunc New${this.capitalize(this.className)}() *${(this.className)} {\n\\tp := &${this.className}{}\n\\tsetDefaults(p)\n\\treturn p\n}\\n`;\n // TO remove `return copies lock value: github.com/ccxt/ccxt/go/v4.bitvavoWs contains github.com/ccxt/ccxt/go/v4.bitvavo contains github.com/ccxt/ccxt/go/v4.Exchange contains sync.Mutex`\n // change the return value to\n //\n // return `\n // func New${this.capitalize(className)}() *${(className)} {\n // p := ${className}{}\n // setDefaults(&p)\n // return &p\n // }\\n`;\n //\n\n }\n\n printClass(node, identation) {\n this.className = node.name.text;\n if (this.classNameMap[this.className]) {\n this.className = this.classNameMap[this.className];\n }\n\n const struct = this.printStruct(node, identation);\n const newMethod = this.printNewStructMethod(node);\n\n const methods = node.members.filter(member => member.kind === SyntaxKind.MethodDeclaration);\n const classMethods = this.joinTopLevelDecls(methods.map(method => this.printMethodDeclaration(method, identation)));\n // const classDefinition = this.printClassDefinition(node, identation);\n\n // const classBody = this.printClassBody(node, identation);\n\n // const classClosing = this.getBlockClose(identation);\n\n // return classDefinition + classBody + classClosing;\n return struct + \"\\n\" + newMethod + \"\\n\" + classMethods;\n }\n\n /**\n * gofmt's declaration-list rule (go/printer nodes.go `declList`): a top-level\n * declaration that carries a doc comment is separated from the previous declaration\n * by exactly one blank line (`min = 2` linebreaks), while a declaration without one\n * keeps the source's own separation (the printer emits members adjacent to the\n * closing brace above them). `printClass` used to join every member with a bare\n * \"\\n\", so a method whose leading `/** ... *` + `/` comment follows the previous\n * method's closing brace came out as `}\\n/**` and gofmt re-inserted the blank line.\n */\n joinTopLevelDecls (decls: string[]): string {\n return decls.map((decl, index) => {\n if (index === 0) {\n return decl;\n }\n return (this.startsWithComment(decl) ? \"\\n\\n\" : \"\\n\") + decl;\n }).join(\"\");\n }\n\n /**\n * True when the emitted declaration text opens with its doc comment - the comment\n * group gofmt attaches to the declaration (`getDoc(d) != nil` in go/printer).\n */\n startsWithComment (decl: string): boolean {\n return this.isComment(decl.split(\"\\n\")[0]);\n }\n\n /**\n * Indent every non-blank line of `lines` by `identation` levels. gofmt trims trailing\n * whitespace, so an indented *blank* line (only the indentation of a blank source\n * line) must stay empty instead of becoming whitespace-only text.\n */\n indentLines (lines: string[], identation: number): string[] {\n return lines.map((line) => line.trim().length === 0 ? \"\" : this.getIden(identation) + line);\n }\n\n printPropertyAccessModifiers (node) {\n return \"\";\n }\n\n printSpreadElement(node, identation) {\n const expression = this.printNode(node.expression, 0);\n return this.getIden(identation) + expression + this.SPREAD_TOKEN;\n }\n\n printMethodDeclaration(node, identation) {\n const methodDef = this.printMethodDefinition(node, identation);\n const isAsync = this.isAsyncFunction(node);\n const funcBody = this.printFunctionBody(node, identation, isAsync);\n if (!isAsync) {\n return methodDef + funcBody;\n }\n return this.printAsyncDeclarationPair(node, identation, methodDef, funcBody, true);\n }\n\n // Trampoline + body pair, see printAsyncTrampolineBlock. A module-scope `async function`\n // has no receiver: its body is a package-level sibling with the same trampoline contract.\n printAsyncDeclarationPair(node, identation, def: string, funcBody: string, isMethod: boolean): string {\n const goName = this.transformMethodNameIfNeeded(node.name.text);\n const bodyName = this.getAsyncBodyName(node, goName);\n const callee = isMethod ? `${this.THIS_TOKEN}.${bodyName}` : bodyName;\n const trampoline = def + this.printAsyncTrampolineBlock(node, identation, callee);\n const receiver = isMethod ? `(${this.THIS_TOKEN} *${this.className}) ` : \"\";\n const bodyDef = `${this.getIden(identation)}func ${receiver}${bodyName}(${this.printAsyncBodyParameters(node)}) ${this.DEFAULT_RETURN_TYPE} `;\n return trampoline + \"\\n\" + bodyDef + funcBody;\n }\n\n printFunctionDeclaration(node, identation) {\n if (isArrowFunction(node)) {\n const parameters = node.parameters.map(param => this.printParameter(param)).join(\", \");\n const body = this.printNode(node.body);\n return `(${parameters}) => ${body}`;\n }\n const isAsync = this.isAsyncFunction(node);\n const functionDef = this.printFunctionDefinition(node, identation);\n const funcBody = this.printFunctionBody(node, identation, isAsync);\n\n // printFunctionDefinition already carries the leading comment\n if (!isAsync) {\n return functionDef + funcBody;\n }\n return this.printAsyncDeclarationPair(node, identation, functionDef, funcBody, false);\n }\n\n /**\n * Name of the sibling *body* method/function an async core hands its work to.\n *\n * `FetchTicker` -> `fetchTickerBody`. Deliberately UNEXPORTED: the body is an\n * implementation detail of the trampoline, so it must not show up on the generated\n * interfaces (ICoreExchange) nor on the typed `*_wrapper.go` facades, and it stays\n * invisible to the reflection based `callInternal`/`callDynamically` dispatch.\n *\n * If that name is already taken by a real declaration (a hand written\n * `fetchTickerBody`), a numeric suffix is appended instead of silently clobbering it.\n */\n getAsyncBodyName(node, goName: string): string {\n const taken = new Set();\n const remember = (raw) => {\n if (!raw) {\n return;\n }\n const name = String(raw);\n taken.add(name);\n try {\n taken.add(this.transformMethodNameIfNeeded(name));\n } catch {\n // a malformed name must never break emission\n }\n };\n try {\n const parent = node?.parent;\n if (parent && isClassDeclarationNode(parent)) {\n parent.members.forEach((member: any) => remember(member?.name?.text));\n } else if (parent && isSourceFile(parent)) {\n parent.statements.forEach((statement: any) => {\n if (isFunctionDeclaration(statement)) {\n remember(statement?.name?.text);\n }\n });\n }\n } catch {\n // a malformed/synthesised node must never break emission\n }\n const base = goName.charAt(0).toLowerCase() + goName.slice(1) + this.ASYNC_BODY_SUFFIX;\n let name = base;\n let suffix = 0;\n while (taken.has(name)) {\n suffix++;\n name = `${base}${suffix}`;\n }\n return name;\n }\n\n /**\n * Parameter list of the body: the channel it must fill, then the original parameters\n * verbatim (including the `optionalArgs ...any` tail), so the trampoline can forward\n * its own arguments unchanged.\n */\n printAsyncBodyParameters(node): string {\n const params = this.printMethodParameters(node);\n const channelParam = `ch chan ${this.DEFAULT_RETURN_TYPE}`;\n return params ? `${channelParam}, ${params}` : channelParam;\n }\n\n /**\n * Arguments the trampoline forwards to its body, matching printMethodParameters:\n * the declared parameters in order, plus the variadic `optionalArgs...` tail when\n * the function has any defaulted parameter.\n */\n printAsyncTrampolineArgs(node): string {\n const args = [];\n let hasOptionalParameter = false;\n (node?.parameters ?? []).forEach((param) => {\n if (param.initializer) {\n hasOptionalParameter = true;\n return;\n }\n args.push(this.printNode(param.name, 0));\n });\n if (hasOptionalParameter) {\n args.push('optionalArgs...');\n }\n return args.join(\", \");\n }\n\n /**\n * The trampoline: an async core hands back a *hot handle*.\n *\n * func (this *Exchange) FetchTicker(symbol any) <-chan any {\n * ch := make(chan any, 1)\n * go this.fetchTickerBody(ch, symbol)\n * return ch\n * }\n *\n * - `ch` is buffered (cap 1): the body's single `ch <- value` never blocks, so a\n * result nobody ever receives still lets the goroutine finish and run\n * `defer close(ch)` (no leak for abandoned calls).\n * - the body runs on its own goroutine, so the call expression returns immediately\n * with work already in flight. That is what makes\n * `const a = this.fetchA (); const b = this.fetchB (); await Promise.all([a,b])`\n * overlap, exactly like the C#/Java ports, with no call-site wrapper.\n * - the result stays UNNAMED (`<-chan any`): `return ch` is the trampoline's only\n * statement and it always runs, because the recover (`defer ReturnPanicError(ch)`)\n * lives on the body, not here.\n */\n printAsyncTrampolineBlock(node, identation, callee: string): string {\n const args = this.printAsyncTrampolineArgs(node);\n const argList = args ? `, ${args}` : \"\";\n return [\n // F04: the signature above ends WITHOUT a trailing space, so the block opener\n // carries the one space before `{` (same contract as getBlockOpen)\n \" {\",\n `${this.getIden(identation + 1)}ch := make(chan ${this.DEFAULT_RETURN_TYPE}, 1)`,\n `${this.getIden(identation + 1)}go ${callee}(ch${argList})`,\n `${this.getIden(identation + 1)}return ch`,\n `${this.getIden(identation)}}`,\n ].join(\"\\n\");\n }\n\n /**\n * Go name of an async (channel returning) declaration: `fetchTicker` -> `FetchTickerAsync`.\n * Empty `asyncMethodSuffix` (the default) keeps the plain name, so the suffix is opt-in.\n */\n printAsyncDeclarationName(node, goName: string): string {\n if (!this.asyncMethodSuffix || !this.isAsyncFunction(node)) {\n return goName;\n }\n return goName + this.asyncMethodSuffix;\n }\n\n /**\n * Resolve the declaration a call/property access refers to and append `asyncMethodSuffix`\n * when it is an async function. Uses the checker, so `this.x()`, `super.x()`, `obj.x()` and\n * bare `x()` all agree with the declaration site. Unresolvable or non-function symbols\n * (properties, `any` receivers, JS builtins) keep the plain name.\n */\n applyAsyncSuffixToCallee(nameNode, goName: string): string {\n if (!this.asyncMethodSuffix || !nameNode) {\n return goName;\n }\n let decls;\n try {\n let symbol = this.getChecker().getSymbolAtLocation(nameNode);\n if (symbol && (symbol.flags & SymbolFlags.Alias)) {\n symbol = this.getChecker().getAliasedSymbol(symbol);\n }\n decls = symbol?.declarations?.map((d) => d.resolve());\n } catch {\n return goName;\n }\n if (!decls || decls.length === 0) {\n return goName;\n }\n // only declarations with a body count: interface/abstract signatures (e.g. implicit API\n // endpoints declared as `foo(params?: {}): Promise;`) are emitted elsewhere, unsuffixed\n const isAsyncDecl = decls.some((d) => (isMethodDeclaration(d) || isFunctionDeclaration(d))\n && d.body !== undefined && this.isAsyncFunction(d) && !this.isAsyncSuffixExempt(d));\n return isAsyncDecl ? goName + this.asyncMethodSuffix : goName;\n }\n\n isAsyncSuffixExempt(decl): boolean {\n if (this.asyncSuffixExemptPaths.length === 0) {\n return false;\n }\n const fileName = String(decl.getSourceFile()?.fileName ?? '').replace(/\\\\/g, '/');\n return this.asyncSuffixExemptPaths.some((re) => re.test(fileName));\n }\n\n printMethodDefinition(node, identation) {\n return this.printGoSignature(node, identation, `(${this.THIS_TOKEN} *${this.className}) `);\n }\n\n printFunctionDefinition(node, identation) {\n return this.printGoSignature(node, identation, \"\");\n }\n\n // F04: `func`, the receiver, the name and the return type are separated by exactly one\n // space, and the signature carries NO trailing space — the block opener (`getBlockOpen`,\n // or `printAsyncTrampolineBlock`) contributes the single space before `{`.\n printGoSignature(node, identation, receiver: string): string {\n const name = this.printAsyncDeclarationName(node, this.transformMethodNameIfNeeded(node.name.text));\n const returnType = this.printFunctionType(node).trim();\n const parsedArgs = this.printMethodParameters(node);\n const methodToken = this.METHOD_TOKEN ? this.METHOD_TOKEN + \" \" : \" \";\n const returnSignature = returnType ? \" \" + returnType : \"\";\n const methodDef = this.getIden(identation) + methodToken + receiver + name + \"(\" + parsedArgs + \")\" + returnSignature;\n return this.printNodeCommentsIfAny(node, identation, methodDef);\n }\n\n printMethodParameters(node) {\n const params = node.parameters.map(param => this.printParameter(param));\n const required = params.filter(param => param !== 'optional');\n if (required.length < params.length) {\n required.push('optionalArgs ...any');\n }\n return required.join(\", \");\n }\n\n printParameter(node, defaultValue = true) {\n const name = this.printNode(node.name, 0);\n const initializer = node.initializer;\n\n const type = this.printParameterType(node);\n\n if (defaultValue && initializer) {\n return 'optional'; // printMethodParameters folds these into `optionalArgs ...any`\n }\n return name + ' ' + type;\n }\n\n printParameterType(node) {\n // B-02: an internal method's parameter that the call-site proof types prints\n // its native Go type; every other parameter keeps the `any` box\n const nativeType = this.goNativeParameterType(node);\n if (nativeType !== undefined) {\n return nativeType;\n }\n return 'any';\n }\n\n printFunctionType(node){\n const typeText = this.getFunctionType(node);\n if (typeText === 'void') {\n return \"\";\n }\n if (typeText === undefined || (typeText !== this.VOID_KEYWORD && typeText !== this.PROMISE_TYPE_KEYWORD)) {\n const res = this.isAsyncFunction(node) ? `<-chan ${this.DEFAULT_RETURN_TYPE}` : this.DEFAULT_RETURN_TYPE;\n this.warn(node, node.name.getText(), \"Function return type not found, will default to: \" + res);\n return res;\n }\n if (typeText === this.PROMISE_TYPE_KEYWORD) {\n return `<-chan any`;\n }\n\n // move any trailing array brackets \"[]\" to directly precede the element type\n if (typeText && typeText.endsWith('[]')) {\n const core = typeText.substring(0, typeText.length - 2); // drop []\n const lastBracketPos = core.lastIndexOf(']');\n if (lastBracketPos !== -1) {\n // insert [] right after the last ']'\n return core.substring(0, lastBracketPos + 1) + '[]' + core.substring(lastBracketPos + 1);\n }\n }\n return typeText;\n }\n\n // true when the printed expression is a single call `Callee(...)` covering the\n // whole string, so its Go type is the callee's return type and nothing else\n isWholePrintedCall(value: string, open: number): boolean {\n let depth = 0;\n let inString = false;\n let escaped = false;\n for (let i = open; i < value.length; i++) {\n const c = value[i];\n if (inString) {\n if (escaped) { escaped = false; }\n else if (c === '\\\\') { escaped = true; }\n else if (c === '\"') { inString = false; }\n continue;\n }\n if (c === '\"') { inString = true; continue; }\n if (c === '(') { depth++; continue; }\n if (c === ')') {\n depth--;\n if (depth === 0) { return i === value.length - 1; }\n }\n }\n return false;\n }\n\n // the concrete Go type the initializer already produces, or undefined when the\n // printer cannot name it (GetValue, Ternary, Add, ... return any)\n goTypeOfInitializer(initializer, printedValue: string): string | undefined {\n // a `.slice(a, b)` this printer inlines to a Go subscript (or its guarded func\n // literal) still holds a string, so its local keeps the type the helper gave it\n if (this.goIsNativeSliceCall(initializer)) {\n return 'string';\n }\n switch (initializer?.kind) {\n case SyntaxKind.StringLiteral:\n case SyntaxKind.NoSubstitutionTemplateLiteral:\n return 'string';\n case SyntaxKind.TrueKeyword:\n case SyntaxKind.FalseKeyword:\n return 'bool';\n case SyntaxKind.ObjectLiteralExpression:\n return 'map[string]any';\n case SyntaxKind.ArrayLiteralExpression:\n return '[]any';\n case SyntaxKind.PrefixUnaryExpression:\n // `!x` prints `!EvalTruthy(x)`\n return (initializer.operator === SyntaxKind.ExclamationToken) ? 'bool' : undefined;\n case SyntaxKind.ParenthesizedExpression:\n return this.goTypeOfInitializer(initializer.expression, printedValue);\n case SyntaxKind.BinaryExpression: {\n // `a || b` prints `EvalTruthy(a) || EvalTruthy(b)`, a Go bool\n const op = initializer.operatorToken.kind;\n if ((op === SyntaxKind.BarBarToken) || (op === SyntaxKind.AmpersandAmpersandToken)) {\n return 'bool';\n }\n // `a === b` prints either `IsEqual(a, b)` or an inlined `(a == b)`;\n // `a < b` prints either `IsLessThan(a, b)` or an inlined `(a < b)`.\n // All of them are Go bools.\n if ((op === SyntaxKind.EqualsEqualsToken) || (op === SyntaxKind.EqualsEqualsEqualsToken)\n || (op === SyntaxKind.ExclamationEqualsToken) || (op === SyntaxKind.ExclamationEqualsEqualsToken)\n || (ORDERED_COMPARISON_OPERATORS[op] !== undefined)) {\n return 'bool';\n }\n // a `+` chain goNativeStringConcat prints as the Go operator is a Go string\n if ((op === SyntaxKind.PlusToken) && (this.goNativeArithmetic(initializer)?.goType === 'string')) {\n return 'string';\n }\n break;\n }\n case SyntaxKind.CallExpression: {\n // `x.toString()` that printToStringCall inlined to the receiver's own text: the\n // declaration then holds that receiver's value, i.e. the same Go string. Every\n // other receiver keeps the helper call, whose own return type is classified below.\n const property = initializer.expression;\n if ((property?.kind === SyntaxKind.PropertyAccessExpression)\n && (property.name?.text === 'toString')\n && (initializer.arguments?.length === 0)\n && ((this.goOperandStaticType(property.expression, printedValue) === 'string')\n || this.goDerefableStringOperand(property.expression))) {\n return 'string';\n }\n break;\n }\n }\n // `const x = (a === b)` prints the wrapping parentheses of the source\n const value = this.goUnwrapPrintedParens(printedValue);\n const open = value.indexOf('(');\n // the printer's own emissions are immediately-called func literals: the native\n // `key in obj` returns a Go bool (no EvalTruthy round-trip), and a ternary whose\n // arms print as one scalar returns that scalar — both name the value natively\n const literalType = goFuncLiteralReturnType(value);\n if ((literalType !== undefined) && (GO_TYPE_NAMES.indexOf(literalType) >= 0)) {\n return literalType;\n }\n // the nil-guarded `indexOf` literal holds the same Go int GetIndexOf returned\n if (value.startsWith('func() int {') && value.endsWith('}()')) {\n return 'int';\n }\n if (open <= 0 || !this.isWholePrintedCall(value, open)) {\n return undefined;\n }\n const callee = value.substring(0, open);\n if (!/^[A-Za-z_][\\w.]*$/.test(callee)) {\n return undefined;\n }\n return GO_NATIVE_CALL_RETURN_TYPES[callee] ?? GO_HELPER_RETURN_TYPES[callee];\n }\n\n // strips the wrapping parentheses the source (or an operand) printed around a\n // whole expression, so the inner text can be classified\n goUnwrapPrintedParens(printedText: string): string {\n let value = (printedText ?? '').trim();\n while (value.startsWith('(') && this.isWholePrintedCall(value, 0)) {\n value = value.substring(1, value.length - 1).trim();\n }\n return value;\n }\n\n // the concrete Go type of a `var x T = ` local, undefined for `any`\n goLocalStaticType(node): string | undefined {\n const declaration: any = this.getChecker().getSymbolAtLocation(node)?.valueDeclaration?.resolve();\n if (declaration?.kind !== SyntaxKind.VariableDeclaration || declaration.initializer === undefined) {\n return undefined;\n }\n if (declaration.parent?.parent?.kind !== SyntaxKind.FirstStatement) {\n return undefined; // declared with `:=`, where the printer annotates nothing\n }\n if (this.goLocalTypeResolution.has(declaration)) {\n return undefined; // the safety scan below prints an expression using this same local\n }\n // only a top-level answer is stable: nested ones see the recursion guard above\n const topLevel = this.goLocalTypeResolution.size === 0;\n if (topLevel && this.goLocalStaticTypeCache.has(declaration)) {\n return this.goLocalStaticTypeCache.get(declaration);\n }\n this.goLocalTypeResolution.add(declaration);\n try {\n const goType = this.getGoLocalType(declaration, this.printNode(declaration.initializer, 0));\n if (topLevel) {\n this.goLocalStaticTypeCache.set(declaration, goType);\n }\n return goType;\n } finally {\n this.goLocalTypeResolution.delete(declaration);\n }\n }\n\n // `x := ` takes the Go type of the printed initializer, and a `for` initializer carries no\n // annotation, so only decidable literal shapes are named: untyped integer constant is `int`,\n // floating-point is `float64`. Integers not fitting `int` and other initializers keep the helper.\n goInferredLocalStaticType(node): string | undefined {\n const checker: any = this.checkerOrUndefined();\n if (checker === undefined) {\n return undefined;\n }\n const declaration = checker.getSymbolAtLocation(node)?.valueDeclaration?.resolve();\n if (declaration?.kind !== SyntaxKind.VariableDeclaration || declaration.initializer === undefined) {\n return undefined;\n }\n const declarationList = declaration.parent;\n if (declarationList?.kind !== SyntaxKind.VariableDeclarationList\n || declarationList.parent?.kind === SyntaxKind.FirstStatement) {\n return undefined; // the `var x = …` form the printer writes a type on\n }\n const kind = this.goNumericLiteralKind(declaration.initializer);\n if ((kind === 'int') && !this.goLiteralFitsKind(declaration.initializer, 'int')) {\n return undefined;\n }\n return kind;\n }\n\n // `this.` read of a hand-written BaseExchange string field\n goStringFieldStaticType(node, printedText: string): string | undefined {\n const match = /^this\\.([A-Za-z_]\\w*)$/.exec(this.goUnwrapPrintedParens(printedText));\n if (match === null || GO_STRING_FIELD_NAMES.indexOf(match[1]) < 0) {\n return undefined;\n }\n // the struct field is a plain Go `string`: a string cannot be nil, so Add's\n // nil branch is unreachable and every read is the same non-nil string\n return 'string';\n }\n\n // a parameter the printer's own signature printer types with a concrete Go scalar:\n // the emitted Go parameter holds that type at every use, so the operator rule can\n // consume it (the typed-param families re-type `Str`/`Int`/`Num` params this way)\n goDeclaredParamStaticType(node): string | undefined {\n const checker: any = this.checkerOrUndefined();\n if (checker === undefined) {\n return undefined;\n }\n const declaration = checker.getSymbolAtLocation(node)?.valueDeclaration?.resolve();\n if (declaration?.kind !== SyntaxKind.Parameter) {\n return undefined;\n }\n // a defaulted parameter bound through `GetArgString` & co. is that Go scalar\n const bound = this.goGetArgParameterType(declaration);\n if ((bound !== undefined) && (GO_TYPE_NAMES.indexOf(bound) >= 0) && ['string', 'int64', 'float64'].includes(bound)) {\n return bound;\n }\n let type;\n try {\n type = this.printParameterType(declaration);\n } catch (e) {\n return undefined;\n }\n if ((typeof type !== 'string') || (type === 'any') || (GO_TYPE_NAMES.indexOf(type) < 0)) {\n return undefined;\n }\n return this.goTypeNameIsShadowed(this.goEnclosingFunction(declaration), type) ? undefined : type;\n }\n\n // a `*string` local prints a nilable Go pointer; it may only be dereferenced\n // where the checker narrowed it to a non-nilable string (a guard that always\n // exits, an `if (x !== undefined)` block). TypeScript `undefined` == Go nil here.\n goNilProvenStringDeref(node): boolean {\n if (node?.kind !== SyntaxKind.Identifier) {\n return false;\n }\n if (this.goDeclaredTypeOfIdentifier(node) !== '*string') {\n return false;\n }\n const checker: any = this.checkerOrUndefined();\n if (checker === undefined) {\n return false;\n }\n const type = checker.getTypeAtLocation(node);\n return (type.flags & TypeFlags.StringLike) !== 0;\n }\n\n // a `*string` local every write of which is a SafeString-family call with a literal\n // default: that Go method can only return a fresh non-nil pointer, so the local may\n // be deref'd even where the checker offers no narrowing. One write of any other\n goDefaultedSafeStringLocal(node): boolean {\n if (node?.kind !== SyntaxKind.Identifier) {\n return false;\n }\n let declaration;\n try {\n declaration = this.getChecker().getSymbolAtLocation(node)?.valueDeclaration?.resolve();\n } catch (e) {\n return false;\n }\n if ((declaration?.kind !== SyntaxKind.VariableDeclaration) || (declaration.name?.kind !== SyntaxKind.Identifier)) {\n return false;\n }\n if (this.goDeclaredTypeOfIdentifier(node) !== '*string') {\n return false;\n }\n if (!this.goDefaultedSafeStringCall(declaration.initializer)) {\n return false;\n }\n const scope = this.goEnclosingFunction(declaration);\n if (scope === undefined) {\n return false;\n }\n const name = declaration.name.text;\n let everyWriteDefaulted = true;\n const visit = (n) => {\n if (!everyWriteDefaulted) {\n return;\n }\n if ((n.kind === SyntaxKind.Identifier) && (n.text === name) && (n !== declaration.name)) {\n const parent: any = n.parent;\n if ((parent?.kind === SyntaxKind.BinaryExpression) && (parent.left === n)\n && (GO_WRITE_OPERATOR_KINDS.indexOf(parent.operatorToken?.kind) >= 0)) {\n everyWriteDefaulted = (parent.operatorToken.kind === SyntaxKind.EqualsToken)\n && this.goDefaultedSafeStringCall(parent.right);\n return;\n }\n if ((parent?.kind === SyntaxKind.PrefixUnaryExpression) || (parent?.kind === SyntaxKind.PostfixUnaryExpression)) {\n everyWriteDefaulted = false;\n return;\n }\n }\n n.forEachChild(visit);\n };\n scope.forEachChild(visit);\n return everyWriteDefaulted;\n }\n\n // a call to one of the hand-written SafeString-family methods that passes enough\n // arguments for the default and whose default is a literal (never the absent case)\n goDefaultedSafeStringCall(node): boolean {\n const call: any = node;\n if (call?.kind !== SyntaxKind.CallExpression) {\n return false;\n }\n const callee: any = call.expression;\n if ((callee?.kind !== SyntaxKind.PropertyAccessExpression) || (callee.expression?.kind !== SyntaxKind.ThisKeyword)) {\n return false;\n }\n const arity = GO_DEFAULTED_SAFE_STRING_ARITY[callee.name?.text];\n if ((arity === undefined) || ((call.arguments?.length ?? 0) < arity)) {\n return false;\n }\n const last: any = call.arguments[call.arguments.length - 1];\n return GO_NON_NIL_DEFAULT_KINDS.indexOf(last?.kind) >= 0;\n }\n\n // a `*string` leaf the concat may deref: the checker narrowed it to a non-nilable\n // string at that use, a local whose every write is a defaulted SafeString-family\n // call, or such a call inline\n goDerefableStringOperand(node): boolean {\n if (this.goNilProvenStringDeref(node)) {\n return true;\n }\n if (node?.kind === SyntaxKind.Identifier) {\n return this.goDefaultedSafeStringLocal(node);\n }\n return this.goDefaultedSafeStringCall(node);\n }\n\n // the printed text of a `+` operand the concat rule may use: the printer's own\n // text for a proven string, or the deref goNativeBinaryText adds for a derefable\n // `*string` leaf. undefined keeps the helper call.\n goStringConcatOperandType(node, printedText: string): string | undefined {\n if (this.goDerefableStringOperand(node)) {\n return 'string';\n }\n return (this.goOperandStaticType(node, printedText) === 'string') ? 'string' : undefined;\n }\n\n // `Add(Add(a, \"lit\"), b)` and every other `+` chain whose leaves are all non-nil\n // Go strings: the runtime Add only ever takes its string branch for those, so the\n // chain prints as the Go operator (`a + \"lit\" + b`). Anything else keeps the call.\n goNativeStringConcat(node, leftText: string, rightText: string): { goType: string, text: string } | undefined {\n if (this.goStringConcatOperandType(node.left, leftText) === undefined\n || this.goStringConcatOperandType(node.right, rightText) === undefined) {\n return undefined;\n }\n return { 'goType': 'string', 'text': this.goNativeBinaryText(node, '+', leftText, rightText) };\n }\n\n // Go static type of an operand's printed form: 'string', 'int', 'int64',\n // 'float64', or 'const-int' / 'const-float' (an untyped literal). undefined when\n // the printer cannot name it — a nilable/`any` operand keeps the helper call.\n goOperandStaticType(node, printedText: string): string | undefined {\n switch (node?.kind) {\n case SyntaxKind.StringLiteral:\n case SyntaxKind.NoSubstitutionTemplateLiteral:\n return 'string';\n case SyntaxKind.NumericLiteral:\n return /^[0-9]+$/.test(node.text) ? 'const-int' : this.goConstFloatStaticType(node);\n case SyntaxKind.ParenthesizedExpression:\n return this.goOperandStaticType(node.expression, this.goUnwrapPrintedParens(printedText));\n case SyntaxKind.BinaryExpression:\n return this.goConstantProductKind(node) ?? this.goNativeArithmeticType(node);\n case SyntaxKind.Identifier:\n return this.goLocalStaticType(node) ?? this.goInferredLocalStaticType(node) ?? this.goDeclaredParamStaticType(node);\n case SyntaxKind.PropertyAccessExpression:\n // `a.length` / `s.replace(...)` print as helper calls, `this.Id` as a field\n return this.goStringFieldStaticType(node, printedText) ?? this.goStringCallStaticType(node, printedText);\n }\n return this.goStringCallStaticType(node, printedText);\n }\n\n // the Go type the printed expression already produces; '*string' / '*int64'\n // helpers box a nilable pointer, so those keep the helper call as well\n goStringCallStaticType(node, printedText: string): string | undefined {\n // the operator needs the printed expression's *static* Go type. A helper whose\n // Go signature returns `any` (GetValue, Ternary, ...) prints an interface box even\n // when a classifier can name the value inside it — that value only becomes\n // typed through an assertion at a declaration, never inline as an operand.\n if (GO_ANY_BOX_CALLS.indexOf(this.goPrintedCallee(printedText)) >= 0) {\n return undefined;\n }\n const goType = this.goTypeOfInitializer(node, printedText);\n return ('string' === goType || 'int' === goType || 'int64' === goType || 'float64' === goType) ? goType : undefined;\n }\n\n // an untyped Go floating-point constant: the helper boxes it as float64 and the\n // compiler converts the operand to float64 the same way\n goConstFloatStaticType(node): string | undefined {\n const text = node?.text;\n if ((typeof text !== 'string') || !/^[0-9][.eE]/.test(text)) {\n return undefined;\n }\n return Number.isFinite(Number(text.replaceAll('_', ''))) ? 'const-float' : undefined;\n }\n\n isNonZeroIntegerLiteral(node): boolean {\n if (node?.kind === SyntaxKind.ParenthesizedExpression) {\n return this.isNonZeroIntegerLiteral(node.expression);\n }\n return node?.kind === SyntaxKind.NumericLiteral && /^[1-9][0-9]*$/.test(node.text);\n }\n\n isNonZeroFloatLiteral(node): boolean {\n if (node?.kind === SyntaxKind.ParenthesizedExpression) {\n return this.isNonZeroFloatLiteral(node.expression);\n }\n return (this.goConstFloatStaticType(node) !== undefined) && (Number(node.text.replaceAll('_', '')) !== 0);\n }\n\n // the exact value of a constant-only integer expression, undefined otherwise. Go folds `a * b`\n // over literals in arbitrary precision, so it must fit `int` and stay exact for the helper's\n // float64 path — the bound the caller checks.\n goConstantIntValue(node): number | undefined {\n if (node?.kind === SyntaxKind.ParenthesizedExpression) {\n return this.goConstantIntValue(node.expression);\n }\n if (node?.kind === SyntaxKind.NumericLiteral) {\n return /^[0-9]+$/.test(node.text) ? Number(node.text) : undefined;\n }\n if (node?.kind !== SyntaxKind.BinaryExpression) {\n return undefined;\n }\n const left = this.goConstantIntValue(node.left);\n const right = (left === undefined) ? undefined : this.goConstantIntValue(node.right);\n if (right === undefined) {\n return undefined;\n }\n switch (node.operatorToken.kind) {\n case SyntaxKind.PlusToken: return left + right;\n case SyntaxKind.MinusToken: return left - right;\n case SyntaxKind.AsteriskToken: return left * right;\n case SyntaxKind.SlashToken: return (right === 0) ? undefined : Math.trunc(left / right);\n case SyntaxKind.PercentToken: return (right === 0) ? undefined : left % right;\n }\n return undefined;\n }\n\n // an arithmetic expression that is the whole initializer of a printed `var x T = ...`: the\n // declared-local table owns that position (naming int64 when its int-kind proof holds, with the\n // forced unbox), so the operator rule leaves the call to it.\n goInsideTypedDeclarationInitializer(node): boolean {\n let current = node;\n while (current !== undefined) {\n const parent = current.parent;\n if (parent?.kind === SyntaxKind.ParenthesizedExpression && (parent.expression === current)) {\n current = parent;\n continue;\n }\n if (parent?.kind === SyntaxKind.BinaryExpression && ((parent.left === current) || (parent.right === current))\n && (GO_ARITHMETIC_KINDS.indexOf(parent.operatorToken.kind) >= 0)) {\n current = parent;\n continue;\n }\n break;\n }\n const declaration = current?.parent;\n if (declaration?.kind !== SyntaxKind.VariableDeclaration || declaration.initializer !== current) {\n return false;\n }\n // the printer annotates `var x T = ...` only; `x := ...` carries the\n // initializer's own type instead\n return declaration.parent?.parent?.kind === SyntaxKind.FirstStatement;\n }\n\n // The bare Go operator must yield what the runtime helper returns (go/v4/exchange_helpers.go):\n // Add keeps int/int64, while Subtract/Multiply/Divide/Mod take an exact int64 path or a float64\n // path, so only the rows below are equivalent.\n goNativeNumericResultType(op, leftType: string, rightType: string, node): string | undefined {\n const isIntKind = (kind: string) => (kind === 'int') || (kind === 'int64') || (kind === 'const-int');\n const isFloatKind = (kind: string) => (kind === 'float64') || (kind === 'const-float');\n const leftNode = node.left;\n const rightNode = node.right;\n const constKinds = ['const-int', 'const-float'];\n if ((op === SyntaxKind.AsteriskToken) && constKinds.includes(leftType) && constKinds.includes(rightType)) {\n // literal products fold as exact Go constants (may differ from the float64 helper in the last bit)\n return this.goNativeConstantProductType(node, leftType, rightType);\n }\n if (isFloatKind(leftType) !== isFloatKind(rightType)) {\n return undefined; // Go has no operator that mixes an int and a float64 operand\n }\n if (isFloatKind(leftType) && isFloatKind(rightType)) {\n // the helper's float path is float64 arithmetic; its integral result boxes\n // as int64, the same normalization Subtract/Multiply/Divide already accept.\n // A constant operand must stay exactly representable: Go folds a constant\n if (op === SyntaxKind.PercentToken) {\n return undefined; // Mod is math.Mod, no Go operator matches it\n }\n if (((leftType === 'const-float') && (rightType === 'const-float'))) {\n return undefined; // only a value the compiler folds exactly would match\n }\n if ((op === SyntaxKind.SlashToken) && !this.isNonZeroFloatLiteral(rightNode)) {\n return undefined; // Divide returns nil on a zero divisor, / gives Inf\n }\n return 'float64';\n }\n if (!isIntKind(leftType) || !isIntKind(rightType)) {\n return undefined; // string / nilable / `any` operand: the helper's nil paths stay\n }\n if ((leftType === 'int64' && rightType === 'int') || (leftType === 'int' && rightType === 'int64')) {\n return undefined; // neither operand is untyped, Go refuses to mix the kinds\n }\n if ((leftType === 'const-int') && (rightType === 'const-int')) {\n // a constant-only expression is folded in arbitrary precision by the Go\n // compiler: require a value both kinds hold exactly, so no `constant\n // overflows int` and the helper's float64 path is exact as well\n const value = this.goConstantIntValue(node);\n if ((value === undefined) || (Math.abs(value) > Number.MAX_SAFE_INTEGER)) {\n return undefined;\n }\n }\n const operands = ((leftType === 'int64') || (rightType === 'int64')) ? 'int64' : 'int';\n if (op === SyntaxKind.PlusToken) {\n // Add keeps its own int/int64 rows: its box carries the operand kind\n return operands;\n }\n if ((op === SyntaxKind.SlashToken) && this.isNonZeroIntegerLiteral(rightNode)) {\n return 'float64'; // JS division: goNativeArithmetic converts the operands to float64\n }\n if ((operands === 'int') && this.goInsideTypedDeclarationInitializer(node)) {\n // the declared-local table names this position int64 when its int-kind\n // proof holds, and the `int` an operator would yield is not that type\n return undefined;\n }\n if (op === SyntaxKind.PercentToken) {\n // Mod is math.Mod over float64: exact for integral operands, but a zero\n // divisor boxes NaN where % panics, so only a literal divisor is decidable\n return this.isNonZeroIntegerLiteral(rightNode) ? operands : undefined;\n }\n if ((op === SyntaxKind.SlashToken) && !this.isNonZeroIntegerLiteral(rightNode)) {\n return undefined; // Divide returns nil on a zero divisor, the operator panics\n }\n // int64 in, int64 out: Subtract goes through ParseInt, Multiply/Mod use reflect Int()\n return operands;\n }\n\n // a literal-only `*` chain is itself an untyped Go constant, so an enclosing product folds too\n goConstantProductKind(node): string | undefined {\n if (node?.kind === SyntaxKind.ParenthesizedExpression) {\n return this.goConstantProductKind(node.expression);\n }\n if (node?.kind === SyntaxKind.NumericLiteral) {\n return /^[0-9]+$/.test(node.text) ? 'const-int' : this.goConstFloatStaticType(node);\n }\n if ((node?.kind !== SyntaxKind.BinaryExpression) || (node.operatorToken.kind !== SyntaxKind.AsteriskToken)) {\n return undefined;\n }\n const left = this.goConstantProductKind(node.left);\n const right = (left === undefined) ? undefined : this.goConstantProductKind(node.right);\n if ((right === undefined) || (this.goNativeConstantProductType(node, left, right) === undefined)) {\n return undefined;\n }\n return ((left === 'const-float') || (right === 'const-float')) ? 'const-float' : 'const-int';\n }\n\n // `2 * 1.67` is an untyped float constant (float64); an integer chain stays an untyped int\n // constant, which a typed `var x int64 = ...` declaration converts, so it is named int64 there.\n goNativeConstantProductType(node, leftType: string, rightType: string): string | undefined {\n if ((leftType === 'const-float') || (rightType === 'const-float')) {\n return 'float64';\n }\n const value = this.goConstantIntValue(node);\n if ((value === undefined) || (Math.abs(value) > Number.MAX_SAFE_INTEGER)) {\n return undefined;\n }\n return this.goInsideTypedDeclarationInitializer(node) ? 'int64' : 'int';\n }\n\n // an operand that is itself a bare operator expression needs parens under a\n // tighter parent operator; a whole helper call is already delimited\n goNativeOperandText(node, printedText: string): string {\n const text = printedText.trim();\n if (node?.kind !== SyntaxKind.BinaryExpression || text.startsWith('(')) {\n return text;\n }\n const open = text.indexOf('(');\n if (open > 0 && this.isWholePrintedCall(text, open)) {\n return text;\n }\n // `a + b` on strings is the only shape that can never sit under a tighter\n // operator, so it is the only one left unwrapped\n return (this.goOperandStaticType(node, text) === 'string') ? text : '(' + text + ')';\n }\n\n // goNativeArithmetic's Go type for an operand (memoized within the enclosing binary print)\n goNativeArithmeticType(node): string | undefined {\n const key = `type|${this.goBinaryContextKey()}`;\n return this.goBinaryMemoized(node, key, () => this.goNativeArithmetic(node)?.goType);\n }\n\n // `Add(a, b)` & co. become the Go operator when both printed operands already\n // hold a concrete Go type the helper would return unchanged; undefined keeps the\n // helper call (nil branches, `any` boxes, strings passed to Subtract, ...).\n goNativeArithmetic(node, leftText = undefined, rightText = undefined): { goType: string, text: string } | undefined {\n const op = node.operatorToken.kind;\n if (GO_ARITHMETIC_KINDS.indexOf(op) < 0) {\n return undefined;\n }\n leftText = leftText ?? this.printNode(node.left, 0);\n rightText = rightText ?? this.printNode(node.right, 0);\n if (op === SyntaxKind.PlusToken) {\n const concat = this.goNativeStringConcat(node, leftText, rightText);\n if (concat !== undefined) {\n return concat;\n }\n }\n const pointerSubtraction = this.goNonNilPointerSubtractionText(node, leftText, rightText);\n if (pointerSubtraction !== undefined) {\n return { 'goType': 'int64', 'text': pointerSubtraction };\n }\n const pointerProduct = this.goNonNilPointerProductText(node, leftText, rightText);\n if (pointerProduct !== undefined) {\n return { 'goType': 'int64', 'text': pointerProduct };\n }\n const pointerDivision = this.goNonNilPointerDivisionText(node, leftText, rightText);\n if (pointerDivision !== undefined) {\n return { 'goType': 'float64', 'text': pointerDivision };\n }\n const leftType = this.goOperandStaticType(node.left, leftText);\n const rightType = this.goOperandStaticType(node.right, rightText);\n if (leftType === undefined || rightType === undefined) {\n return undefined;\n }\n if (leftType === 'string' || rightType === 'string') {\n if (leftType !== 'string' || rightType !== 'string' || op !== SyntaxKind.PlusToken) {\n return undefined; // the other four helpers return nil for strings\n }\n return { 'goType': 'string', 'text': this.goNativeBinaryText(node, '+', leftText, rightText) };\n }\n const goType = this.goNativeNumericResultType(op, leftType, rightType, node);\n if (goType === undefined) {\n return undefined;\n }\n const isIntKind = (kind: string) => (kind === 'int') || (kind === 'int64') || (kind === 'const-int');\n if ((op === SyntaxKind.SlashToken) && isIntKind(leftType) && isIntKind(rightType)) {\n return { goType, 'text': this.goFloatDivisionText(node, leftType, rightType, leftText, rightText) };\n }\n return { goType, 'text': this.goNativeBinaryText(node, this.SupportedKindNames[op], leftText, rightText) };\n }\n\n // `a - b` where each side is a non-nil `*int64` (dereferenced), an int64 value or an int literal and at\n // least one side is a pointer: Subtract's integral result is the same int64 box\n goNonNilPointerSubtractionText(node, leftText: string, rightText: string): string | undefined {\n if (node.operatorToken.kind !== SyntaxKind.MinusToken) {\n return undefined;\n }\n const left = this.goInt64Operand(node.left, leftText);\n const right = (left === undefined) ? undefined : this.goInt64Operand(node.right, rightText);\n if ((right === undefined) || (!left.pointer && !right.pointer)) {\n return undefined;\n }\n return left.text + ' - ' + right.text;\n }\n\n goInt64Operand(node, printedText: string): { pointer: boolean, text: string } | undefined {\n const text = this.goUnwrapPrintedParens(printedText.trim());\n if (node?.kind === SyntaxKind.ParenthesizedExpression) {\n return this.goInt64Operand(node.expression, text);\n }\n if (node?.kind === SyntaxKind.NumericLiteral) {\n return (/^[0-9]+$/.test(node.text) && (Number(node.text) <= Number.MAX_SAFE_INTEGER)) ? { 'pointer': false, text } : undefined;\n }\n if (node?.kind === SyntaxKind.Identifier) {\n if ((this.goDeclaredTypeOfIdentifier(node) === '*int64') && this.goPointerNumberIsNonNil(node)) {\n return { 'pointer': true, 'text': '*' + text };\n }\n return (this.goOperandStaticType(node, text) === 'int64') ? { 'pointer': false, text } : undefined;\n }\n if (this.goDefaultedSafeIntegerCall(node)) {\n return { 'pointer': true, 'text': '*' + text };\n }\n if ((node?.kind === SyntaxKind.CallExpression) && (this.goOperandStaticType(node, text) === 'int64')) {\n return { 'pointer': false, text };\n }\n return undefined;\n }\n\n // `a * b` over the same operands as the subtraction (or a nested int64 product): Multiply's\n // Int-kind branch returns the same wrapping int64 product\n goNonNilPointerProductText(node, leftText: string, rightText: string): string | undefined {\n if (node.operatorToken.kind !== SyntaxKind.AsteriskToken) {\n return undefined;\n }\n const left = this.goInt64ProductOperand(node.left, leftText);\n const right = (left === undefined) ? undefined : this.goInt64ProductOperand(node.right, rightText);\n if ((right === undefined) || (!left.pointer && !right.pointer)) {\n return undefined;\n }\n return left.text + ' * ' + right.text;\n }\n\n goInt64ProductOperand(node, printedText: string): { pointer: boolean, text: string } | undefined {\n let inner = node;\n while (inner?.kind === SyntaxKind.ParenthesizedExpression) {\n inner = inner.expression;\n }\n if ((inner?.kind === SyntaxKind.BinaryExpression) && (this.goNativeArithmeticType(inner) === 'int64')) {\n const text = printedText.trim();\n return { 'pointer': false, 'text': text.startsWith('(') ? text : '(' + text + ')' };\n }\n return this.goInt64Operand(node, printedText);\n }\n\n // this.safeInteger{,2,N} with an integer literal default: the Go method returns &default on every nil path\n goDefaultedSafeIntegerCall(node): boolean {\n if ((node?.kind !== SyntaxKind.CallExpression) || (node.expression?.kind !== SyntaxKind.PropertyAccessExpression)\n || (node.expression.expression?.kind !== SyntaxKind.ThisKeyword)) {\n return false;\n }\n const arity = { 'safeInteger': 3, 'safeInteger2': 4, 'safeIntegerN': 3 }[node.expression.name?.text];\n const last = node.arguments?.[arity - 1];\n return (arity !== undefined) && (node.arguments.length === arity) && (last?.kind === SyntaxKind.NumericLiteral)\n && /^[0-9]+$/.test(last.text);\n }\n\n // `x / N` on a non-nil `*int64` with a nonzero integer literal N, passed whole to Math.floor/ceil/round\n // or parseToInt: those read Divide's int64-when-integral box and the float64 quotient alike\n // (`*float64` keeps the helper: -0 and ±Inf box differently)\n goNonNilPointerDivisionText(node, leftText: string, rightText: string): string | undefined {\n if ((node.operatorToken.kind !== SyntaxKind.SlashToken) || !this.isNonZeroIntegerLiteral(node.right)) {\n return undefined;\n }\n const left = node.left;\n const declared = this.goDeclaredTypeOfIdentifier(left);\n if (declared !== '*int64') {\n return undefined;\n }\n if (!this.goPointerNumberIsNonNil(left) || !this.goDivisionConsumerIgnoresBox(node)) {\n return undefined;\n }\n return 'float64(*' + leftText.trim() + ') / ' + this.goUnwrapPrintedParens(rightText.trim());\n }\n\n // the checker narrowed the identifier to a plain number here, or an enclosing guard tests it\n goPointerNumberIsNonNil(ident): boolean {\n if (this.goHasEnclosingNilGuard(ident)) {\n return true;\n }\n const checker: any = this.checkerOrUndefined();\n if (checker === undefined) {\n return false;\n }\n const type = checker.getTypeAtLocation(ident);\n return (type !== undefined) && ((type.flags & TypeFlags.NumberLike) !== 0);\n }\n\n // the division (through parens) is the only argument of this.parseToInt or Math.floor/ceil/round\n goDivisionConsumerIgnoresBox(node): boolean {\n let child = node;\n let parent = node.parent;\n while (parent?.kind === SyntaxKind.ParenthesizedExpression) {\n child = parent;\n parent = parent.parent;\n }\n if ((parent?.kind !== SyntaxKind.CallExpression) || (parent.arguments?.length !== 1) || (parent.arguments[0] !== child)) {\n return false;\n }\n const callee = parent.expression;\n if (callee?.kind !== SyntaxKind.PropertyAccessExpression) {\n return false;\n }\n const owner = callee.expression;\n const name = callee.name?.text;\n if (owner?.kind === SyntaxKind.ThisKeyword) {\n return name === 'parseToInt';\n }\n return (owner?.kind === SyntaxKind.Identifier) && (owner.text === 'Math') && ['floor', 'ceil', 'round'].includes(name);\n }\n\n // int / int is a float64 division as in JS: typed operands convert, and with two constants\n // the left one does (an untyped constant operand then converts implicitly)\n goFloatDivisionText(node, leftType: string, rightType: string, leftText: string, rightText: string): string {\n const castLeft = (leftType !== 'const-int') || (rightType === 'const-int');\n const castRight = rightType !== 'const-int';\n const cast = (printed: string) => 'float64(' + this.goUnwrapPrintedParens(printed.trim()) + ')';\n const left = castLeft ? cast(leftText) : this.goNativeOperandText(node.left, leftText);\n const right = castRight ? cast(rightText) : this.goNativeOperandText(node.right, rightText);\n return left + ' / ' + right;\n }\n\n // the operator line gofmt prints for a natively emitted arithmetic expression: the\n // blanks follow go/printer's cutoff at the current depth, and a binary operand is\n // re-printed at the expression's own depth (a same-precedence left operand, or the\n // parentheses the printer wraps it in, which undo the one level the operand adds)\n goNativeBinaryText(node, symbol: string, leftText: string, rightText: string): string {\n const operandText = (operand, printed: string) => {\n const isBinary = operand?.kind === SyntaxKind.BinaryExpression;\n const text = isBinary ? this.goWithExprDepth(this.goExprDepth, () => this.printNode(operand, 0)) : printed;\n // a derefable `*string` leaf is the only operand that prints in a different\n // shape than the printer produced: the operator needs its pointee\n const leaf = this.goDerefableStringOperand(operand) ? ('*' + text.trim()) : text;\n return this.goNativeOperandText(operand, leaf);\n };\n const left = operandText(node.left, leftText);\n const right = operandText(node.right, rightText);\n const separator = this.goBinarySeparator(symbol, right, node.left, node.right);\n return left + separator + symbol + separator + right;\n }\n\n // `x += y` prints `x = Add(x, y)`; the compound operator is equivalent while\n // both sides hold a concrete Go type that can never make the helper return nil\n goNativeCompoundAssignment(op, leftNode, leftText: string, rightNode, rightText: string): string | undefined {\n const leftType = this.goOperandStaticType(leftNode, leftText);\n const rightType = this.goOperandStaticType(rightNode, rightText);\n if (leftType === undefined || rightType === undefined) {\n return undefined;\n }\n const isAdd = op === SyntaxKind.PlusEqualsToken;\n const isSubtract = op === SyntaxKind.MinusEqualsToken;\n if (!isAdd && !isSubtract) {\n return undefined;\n }\n const stringAdd = leftType === 'string' && isAdd && rightType === 'string';\n const int64Op = leftType === 'int64' && (rightType === 'int64' || rightType === 'const-int');\n if (!stringAdd && !int64Op) {\n return undefined;\n }\n return `${leftText.trim()} ${isAdd ? '+=' : '-='} ${rightText.trim()}`;\n }\n\n goEnclosingFunction(node) {\n let current = node?.parent;\n while (current) {\n switch (current.kind) {\n case SyntaxKind.MethodDeclaration:\n case SyntaxKind.FunctionDeclaration:\n case SyntaxKind.FunctionExpression:\n case SyntaxKind.ArrowFunction:\n case SyntaxKind.Constructor:\n case SyntaxKind.SourceFile:\n return current;\n }\n current = current.parent;\n }\n return undefined;\n }\n\n // a transpiled parameter or local can literally be named `string`, which would\n // turn `var x string = ...` into a reference to that value instead of the type\n goTypeNameIsShadowed(scope, goType: string): boolean {\n const names = goType.match(/[A-Za-z_]\\w*/g) ?? [];\n const relevant = names.filter((n) => GO_TYPE_NAMES.indexOf(n) >= 0);\n if (relevant.length === 0 || scope === undefined) {\n return false;\n }\n return this.hasNodeWhere(scope, (n: any) => {\n const isBinding = (n.kind === SyntaxKind.Parameter) || (n.kind === SyntaxKind.VariableDeclaration);\n if (isBinding && (n.name?.kind === SyntaxKind.Identifier)) {\n if (relevant.indexOf(n.name.text as string) >= 0) { return true; }\n }\n return false;\n });\n }\n\n // the shape `x.push(v)` that both the native emission and the declaration's safety\n // scan accept: the printed `x = append(x, v)` is a statement, so a value position or\n // a multi-argument/spread call still needs the helper\n goIsNativeAppendShape(receiverNode, pushNode): boolean {\n if (receiverNode?.kind !== SyntaxKind.Identifier) {\n return false;\n }\n if (pushNode?.parent?.kind !== SyntaxKind.ExpressionStatement) {\n return false;\n }\n if ((pushNode.questionDotToken !== undefined) || (pushNode.expression?.questionDotToken !== undefined)) {\n return false;\n }\n const access = pushNode.expression;\n if ((access?.kind !== SyntaxKind.PropertyAccessExpression) || (access.expression !== receiverNode)\n || (access.name?.text !== 'push')) {\n return false;\n }\n const args = pushNode.arguments;\n return (args?.length === 1) && (args[0].kind !== SyntaxKind.SpreadElement);\n }\n\n // `x.push(v)` on a local declared `[]any` prints `x = append(x, v)`; undefined keeps\n // AppendToArray(&x, v). An `any` box keeps the helper: `&x` is a *any there, while a declared\n // []any local would pass a *[]any the helper's parameter does not accept.\n goNativeAppendReceiver(pushNode): string | undefined {\n const receiver = pushNode?.expression?.expression;\n if (!this.goIsNativeAppendShape(receiver, pushNode)) {\n return undefined;\n }\n if (this.goDeclaredTypeOfIdentifier(receiver) !== '[]any') {\n return undefined;\n }\n return this.printNode(receiver, 0);\n }\n\n // reject the refinement when something downstream needs the local to stay `any`:\n // `x.push(v)` prints `AppendToArray(&x, v)` (a *T is not a *any) and a later\n // assignment of a value with another concrete type would stop compiling\n goLocalIsSafeToType(scope, declaration, varName: string, goType: string): boolean {\n if (scope === undefined) {\n return false;\n }\n const safe = !this.hasNodeWhere(scope, (n: any) => {\n if ((n.kind === SyntaxKind.Identifier) && (n.text === varName) && (n !== declaration.name)) {\n const parent = n.parent;\n if (parent?.kind === SyntaxKind.PropertyAccessExpression && parent.expression === n\n && parent.name?.text === 'push') {\n // a []any local appends natively, so its receiver may be typed; every\n // other push shape keeps the helper and with it the box\n if ((goType !== '[]any') || !this.goIsNativeAppendShape(n, parent.parent)) {\n return true;\n }\n }\n if (parent?.kind === SyntaxKind.VariableDeclaration && parent.name === n) {\n return; // a sibling block-scoped declaration; it gets its own type\n }\n if ((parent?.kind === SyntaxKind.PostfixUnaryExpression) || (parent?.kind === SyntaxKind.PrefixUnaryExpression)) {\n const op = parent.operator;\n if ((op === SyntaxKind.PlusPlusToken) || (op === SyntaxKind.MinusMinusToken)) {\n return true;\n }\n }\n if (parent?.kind === SyntaxKind.SpreadElement) {\n return true;\n }\n if (parent?.kind === SyntaxKind.ArrayLiteralExpression\n && parent.parent?.kind === SyntaxKind.BinaryExpression\n && parent.parent.left === parent\n && parent.parent.operatorToken.kind === SyntaxKind.EqualsToken\n && !((goType === 'map[string]any') && this.goGetArgTupleWriteIsDict(declaration, parent.parent.right, parent.elements.indexOf(n)))) {\n return true;\n }\n if (parent?.kind === SyntaxKind.BinaryExpression && parent.left === n) {\n const op = parent.operatorToken.kind;\n if (op === SyntaxKind.EqualsToken) {\n if ((goType === 'string') && this.goSelfConcatWriteIsString(parent.right, varName)) {\n return false;\n }\n if ((this.goTypeOfInitializer(parent.right, this.printNode(parent.right, 0)) !== goType)\n && !((declaration.kind === SyntaxKind.VariableDeclaration) && this.goPointerWriteConversion(parent.right, goType) !== undefined)) {\n return true;\n }\n } else if ((op === SyntaxKind.PlusEqualsToken) && (goType === 'string')\n && (this.goOperandStaticType(parent.right, this.printNode(parent.right, 0)) === 'string')) {\n return false;\n } else if ((op >= SyntaxKind.FirstCompoundAssignment) && (op <= SyntaxKind.LastCompoundAssignment)) {\n return true;\n }\n }\n }\n return false;\n });\n return safe;\n }\n\n // `x = <+ chain>` that reads x itself: only a whole chain prints native (a bare\n // derefable leaf would be assigned as the *string it is)\n goSelfConcatWriteIsString(node, varName: string): boolean {\n while (node?.kind === SyntaxKind.ParenthesizedExpression) {\n node = node.expression;\n }\n if ((node?.kind !== SyntaxKind.BinaryExpression) || (node.operatorToken.kind !== SyntaxKind.PlusToken)) {\n return false;\n }\n const readsSelf = this.hasNodeWhere(node, (n: any) => (n.kind === SyntaxKind.Identifier) && (n.text === varName));\n return readsSelf && this.goSelfConcatIsString(node, varName);\n }\n\n // a `+` chain written back into a `string` local (`x = x + \"&\" + y`, `x += y`): every leaf is\n // the local itself (a Go string by the typing being proven) or a proven non-nil Go string,\n // so the chain prints native and the local only ever holds a string\n goSelfConcatIsString(node, varName: string): boolean {\n while (node?.kind === SyntaxKind.ParenthesizedExpression) {\n node = node.expression;\n }\n if ((node?.kind === SyntaxKind.Identifier) && (node.text === varName)) {\n return true;\n }\n if ((node?.kind === SyntaxKind.BinaryExpression) && (node.operatorToken.kind === SyntaxKind.PlusToken)) {\n return this.goSelfConcatIsString(node.left, varName) && this.goSelfConcatIsString(node.right, varName);\n }\n if (this.hasNodeWhere(node, (n: any) => (n.kind === SyntaxKind.Identifier) && (n.text === varName))) {\n return false;\n }\n const cache = this.goSelfConcatLeafCache;\n if (cache.has(node)) {\n return cache.get(node);\n }\n // an answer computed while another local is being resolved may be the guard's `any`\n const settled = (this.goLocalTypeResolution.size === 0);\n const result = this.goStringConcatOperandType(node, this.printNode(node, 0)) === 'string';\n if (settled) {\n cache.set(node, result);\n }\n return result;\n }\n\n // How a write of another shape reaches a pointer-typed local: 'nil' (undefined/null prints nil),\n // 'wrap' (a Go string becomes SafeStringPtr(v), never nil), or undefined (not convertible).\n // Shared by goLocalIsSafeToType (admission) and goPointerWriteText (emission).\n goPointerWriteConversion(right, goType: string): 'nil' | 'wrap' | undefined {\n while (right?.kind === SyntaxKind.ParenthesizedExpression) {\n right = right.expression;\n }\n if (!['*string', '*int64', '*float64'].includes(goType) || right === undefined) {\n return undefined;\n }\n if ((right.kind === SyntaxKind.NullKeyword) || (right.kind === SyntaxKind.UndefinedKeyword)\n || ((right.kind === SyntaxKind.Identifier) && (right.text === 'undefined'))) {\n return 'nil';\n }\n if ((goType === '*string') && (this.goTypeOfInitializer(right, this.printNode(right, 0)) === 'string')) {\n return 'wrap';\n }\n return undefined;\n }\n\n // `x = \"limit\"` on a *string local prints `x = SafeStringPtr(\"limit\")`; undefined otherwise\n goPointerWriteText(node, identation): string | undefined {\n const { left, right } = node;\n if (left?.kind !== SyntaxKind.Identifier) {\n return undefined;\n }\n const decl: any = this.checkerOrUndefined()?.getSymbolAtLocation(left)?.valueDeclaration?.resolve();\n if (decl?.kind !== SyntaxKind.VariableDeclaration) {\n return undefined;\n }\n const goType = this.goDeclaredTypeOfIdentifier(left);\n if ((goType === undefined) || (this.goPointerWriteConversion(right, goType) !== 'wrap')) {\n return undefined;\n }\n const value = this.goWithExprDepth(this.goExprDepth + 1, () => this.printNode(right, identation)).trim();\n return `${this.printNode(left, 0)} = SafeStringPtr(${value})`;\n }\n\n // the container/key argument nodes of a whole `this.SafeDict(container, key)` call, or undefined\n // for another shape. A third argument is droppable only when it is the empty map literal\n // (`safeDict(x, k, {})`), which no whitelisted read could observe.\n goSafeDictLocalArgs(initializer) {\n return this.goSafeAccessorLocalArgs(initializer, 'safeDict', SyntaxKind.ObjectLiteralExpression, 'properties');\n }\n\n // shared by the dict/list rules: `this.(container, key[, ])`\n goSafeAccessorLocalArgs(initializer, accessor: string, fallbackKind: SyntaxKind, fallbackItems: string) {\n if (initializer?.kind !== SyntaxKind.CallExpression) {\n return undefined;\n }\n const callee: any = initializer.expression;\n if (callee?.kind !== SyntaxKind.PropertyAccessExpression || callee.name?.text !== accessor) {\n return undefined;\n }\n if (callee.expression?.kind !== SyntaxKind.ThisKeyword) {\n return undefined;\n }\n const args = initializer.arguments;\n if (args.length === 3) {\n const fallback = args[2];\n if (fallback?.kind !== fallbackKind || fallback[fallbackItems].length !== 0) {\n return undefined;\n }\n } else if (args.length !== 2) {\n return undefined;\n }\n return { container: args[0], key: args[1] };\n }\n\n // one later use of a dict local: it must read the value as a dictionary, never hand the\n // box out. Only the receiver position of the deref-aware read helpers, the `this.Safe*`\n // accessors and a plain `x[k]` element read qualify.\n goSafeDictUseReadsTheMap(node): boolean {\n const parent: any = node.parent;\n if (parent === undefined) {\n return false;\n }\n switch (parent.kind) {\n case SyntaxKind.ElementAccessExpression: {\n if (parent.expression !== node) {\n return false; // x as an index key\n }\n const grandparent: any = parent.parent;\n if (grandparent?.kind === SyntaxKind.BinaryExpression && grandparent.left === parent) {\n return false; // `x[k] = v` / `x[k] += v` writes into the map\n }\n if ((grandparent?.kind === SyntaxKind.PostfixUnaryExpression) || (grandparent?.kind === SyntaxKind.PrefixUnaryExpression)) {\n return false; // `x[k]++` / `&x[k]`\n }\n if (grandparent?.kind === SyntaxKind.DeleteExpression) {\n return false;\n }\n return true;\n }\n case SyntaxKind.BinaryExpression: {\n // `key in x` prints `InOp(x, key)`: the helper reads the map and answers false for\n // an absent (nil) map, exactly like the nil interface it used to hold\n return (parent.operatorToken?.kind === SyntaxKind.InKeyword) && (parent.right === node);\n }\n case SyntaxKind.CallExpression: {\n if (parent.expression === node) {\n return false; // the local called as a function\n }\n if (parent.arguments.indexOf(node) !== 0) {\n return false; // value position: the box escapes\n }\n const callee = this.goPrintedCallee(this.printNode(parent, 0));\n if (callee === undefined) {\n return false;\n }\n if (GO_SAFE_DICT_READ_HELPERS.indexOf(callee) >= 0) {\n return true;\n }\n return /^(?:this\\.)?Safe[A-Z]/.test(callee) || (callee === 'this.IsDictionary');\n }\n default:\n return false;\n }\n }\n\n // `var x any = this.SafeDict(container, key)` -> `var x map[string]any = SafeMapTyped(...)`:\n // same member read, and every later use reads the local; with the absent case a nil map,\n // GetValue/InOp/ObjectKeys/IsDictionary and Safe* normalise a nil receiver. Else keep the box.\n goSafeDictLocalUnboxCache = new Map();\n\n // memoised, re-entrancy-guarded typing of a `var x T = …` declaration statement; a for-init\n // or any other shape prints `:=`, where the annotation would not appear\n goCachedLocalUnbox(cache: Map, declaration, compute: () => string | undefined): string | undefined {\n if (declaration?.kind !== SyntaxKind.VariableDeclaration || declaration.name?.kind !== SyntaxKind.Identifier) {\n return undefined;\n }\n if (declaration.parent?.parent?.kind !== SyntaxKind.FirstStatement) {\n return undefined;\n }\n if (cache.has(declaration)) {\n return cache.get(declaration);\n }\n cache.set(declaration, undefined); // in-progress guard\n let result: string | undefined;\n try {\n result = compute();\n } finally {\n cache.set(declaration, result);\n }\n return result;\n }\n\n goSafeDictLocalUnbox(declaration): string | undefined {\n return this.goCachedLocalUnbox(this.goSafeDictLocalUnboxCache, declaration, () => this.goSafeDictLocalUnboxUncached(declaration));\n }\n\n // every read of `declaration`'s name inside its function must keep the boxed value's meaning for\n // the local to take a named Go type: a rebinding mixes two values, and a use `readsTheValue`\n // rejects re-boxes the local. `skipUse` drops nodes that are not references at all.\n goDeclaredLocalTypeIfSafe(declaration, goType: string, readsTheValue: (n: any) => boolean, skipUse?: (n: any) => boolean): string | undefined {\n const sourceName = declaration.name.text as string;\n const scope: any = this.goEnclosingFunction(declaration);\n if (scope === undefined) {\n return undefined;\n }\n const unsafe = this.hasNodeWhere(scope, (n: any) => {\n if ((n.kind === SyntaxKind.VariableDeclaration || n.kind === SyntaxKind.Parameter)\n && (n !== declaration) && (n.name?.kind === SyntaxKind.Identifier) && (n.name.text === sourceName)) {\n return true; // a shadowing binding would mix two values under one name\n }\n if ((n.kind !== SyntaxKind.Identifier) || (n.text !== sourceName) || (n === declaration.name)) {\n return false;\n }\n return (skipUse !== undefined && skipUse(n)) ? false : !readsTheValue(n);\n });\n if (unsafe || this.goTypeNameIsShadowed(scope, goType)) {\n return undefined;\n }\n return goType;\n }\n\n goSafeDictLocalUnboxUncached(declaration): string | undefined {\n if (this.goSafeDictLocalArgs(declaration.initializer) === undefined) {\n return undefined;\n }\n return this.goDeclaredLocalTypeIfSafe(declaration, GO_SAFE_DICT_LOCAL_TYPE, (n) => this.goSafeDictUseReadsTheMap(n));\n }\n\n // the initializer a typed dict local is declared with: the accessor call is replaced by the\n // typed reader, which reads the same member (and converts a sync.Map) but names the result\n goSafeDictUnboxValue(declaration, identation: number): string | undefined {\n if (this.goSafeDictLocalUnbox(declaration) !== GO_SAFE_DICT_LOCAL_TYPE) {\n return undefined;\n }\n const args: any = this.goSafeDictLocalArgs(declaration.initializer);\n const container = this.printNode(args.container, identation);\n const key = this.printNode(args.key, 0);\n return `SafeMapTyped(${container}, ${key})`;\n }\n\n // the TypeScript return type proves the boxed value is the market dictionary: the checker reports\n // the `MarketInterface` interface for `this.Market(...)` / `this.SafeMarket(...)` (the `Market`\n // alias is the same interface unioned with undefined). Read from the checker, never a printed name.\n goMarketCallReturnsDict(initializer): boolean {\n if (initializer?.kind !== SyntaxKind.CallExpression) {\n return false;\n }\n const callee: any = initializer.expression;\n if (callee?.kind !== SyntaxKind.PropertyAccessExpression) {\n return false;\n }\n const name = callee.name?.text;\n if (name === undefined) {\n return false;\n }\n const receiver: any = callee.expression;\n const onThis = receiver?.kind === SyntaxKind.ThisKeyword;\n const onDerived = (receiver?.kind === SyntaxKind.PropertyAccessExpression)\n && (receiver.expression?.kind === SyntaxKind.ThisKeyword)\n && (receiver.name?.text === 'DerivedExchange');\n if (!onThis && !onDerived) {\n return false;\n }\n const checker: any = this.checkerOrUndefined();\n if (checker === undefined) {\n return false;\n }\n const type = checker.getTypeAtLocation(initializer);\n if (type === undefined) {\n return false;\n }\n const isMarketInterface = (t) => {\n const names = [ t?.getSymbol()?.name, t?.getAliasSymbol()?.name ];\n return (names.indexOf('MarketInterface') >= 0) || (names.indexOf('CurrencyInterface') >= 0);\n };\n if (isMarketInterface(type)) {\n return true;\n }\n if ((typeof type.isUnionType === 'function') && type.isUnionType()) {\n return type.getTypes().some((t) => isMarketInterface(t));\n }\n return false;\n }\n\n // `var market any = this.Market(symbol)` -> `var market map[string]any = MapTyped(...)`.\n // The box holds the dictionary the checker proved and every later use reads it (SafeDict's scan),\n // so this is a pure refinement. A value position, nil test or map write keeps the box.\n goMarketLocalUnboxCache = new Map();\n\n goMarketLocalUnbox(declaration): string | undefined {\n return this.goCachedLocalUnbox(this.goMarketLocalUnboxCache, declaration, () => this.goMarketLocalUnboxUncached(declaration));\n }\n\n // true when this identifier resolves to the declaration being typed (a property name or a\n // binding of the same name in another scope is not a use of the local). Without checker\n // information the name match stands.\n goIdentifierRefersToDeclaration(node, declaration): boolean {\n const checker: any = this.checkerOrUndefined();\n if (checker === undefined) {\n return true;\n }\n const symbol = checker.getSymbolAtLocation(node);\n if (symbol === undefined) {\n return true;\n }\n const valueDeclaration = symbol.valueDeclaration?.resolve() ?? symbol.declarations?.map((d) => d.resolve())?.[0];\n return (valueDeclaration === undefined) || (valueDeclaration === declaration);\n }\n\n // one later use of the market local: the dictionary read shapes SafeDict proves (element read,\n // `in`, read-helper argument), plus — only when the accessor throws rather than answers absent —\n // a plain argument position, since Go re-boxes the map into the callee's `any` as the box did.\n goMarketUseReadsTheValue(node, throwingAccessor: boolean): boolean {\n if (this.goSafeDictUseReadsTheMap(node)) {\n return true;\n }\n const parent: any = node.parent;\n if ((parent?.kind === SyntaxKind.ElementAccessExpression) && (parent.expression === node) && this.goIsComparedOperand(parent)) {\n return true;\n }\n if (!throwingAccessor) {\n return false;\n }\n return (parent?.kind === SyntaxKind.CallExpression)\n && (parent.expression !== node) && (parent.arguments.indexOf(node) >= 0);\n }\n\n goMarketLocalUnboxUncached(declaration): string | undefined {\n if (!this.goMarketCallReturnsDict(declaration.initializer)) {\n return undefined;\n }\n // the throwing accessors (`this.market`, `this.currency`) panic instead of answering absent, so\n // the boxed result is always a dictionary and passing the local re-boxes the same map into the\n // callee's `any`. The Safe* accessors may answer their own optional argument: read shapes only.\n const accessorName = declaration.initializer.expression?.name?.text;\n const throwingAccessor = (accessorName === 'market') || (accessorName === 'currency');\n // `this.market(…)` carries the same name as the local: a property/method name is not\n // a reference, and neither is a different binding of the same name\n return this.goDeclaredLocalTypeIfSafe(declaration, GO_MARKET_LOCAL_TYPE,\n (n) => this.goMarketUseReadsTheValue(n, throwingAccessor),\n (n) => ((n.parent?.kind === SyntaxKind.PropertyAccessExpression) && (n.parent.name === n))\n || !this.goIdentifierRefersToDeclaration(n, declaration));\n }\n\n // the initializer a typed market local is declared with: the same call, its boxed result\n // converted to the map the checker proved (nil when the call answered a non-map)\n goMarketUnboxValue(declaration, parsedValue: string): string | undefined {\n if (this.goMarketLocalUnbox(declaration) !== GO_MARKET_LOCAL_TYPE) {\n return undefined;\n }\n return `MapTyped(${parsedValue.trimStart()})`;\n }\n\n // the variable declaration an identifier binds to, through the checker (undefined for every\n // other shape) — the market rule resolves its own locals this way, never by printed name\n goDeclarationOfIdentifier(node): any {\n try {\n const symbol = this.getChecker().getSymbolAtLocation(node);\n const declaration = symbol?.valueDeclaration?.resolve() ?? symbol?.declarations?.map((d) => d.resolve())?.[0];\n if (declaration?.kind === SyntaxKind.VariableDeclaration) {\n return declaration;\n }\n } catch (e) {\n return undefined;\n }\n return undefined;\n }\n\n // a compared element of a market/currency local keeps the GetValue helper: its deref is what\n // the boxed local's read used to apply, and a parseMarket may have stored a `*bool`/`*string`\n // under the key. Only the operands the use scan admits this way are affected; every other\n goMarketComparisonElementRead(node): boolean {\n const base: any = node?.expression;\n if (base?.kind !== SyntaxKind.Identifier) {\n return false;\n }\n const declaration = this.goDeclarationOfIdentifier(base);\n if ((declaration === undefined) || (this.goMarketLocalUnbox(declaration) !== GO_MARKET_LOCAL_TYPE)) {\n return false;\n }\n return this.goIsComparedOperand(node);\n }\n\n // `node`, through any parentheses, is an operand of a GO_MARKET_READ_COMPARISON_OPERATORS comparison\n goIsComparedOperand(node): boolean {\n let operand: any = node;\n let above: any = node.parent;\n while (above?.kind === SyntaxKind.ParenthesizedExpression) {\n operand = above;\n above = above.parent;\n }\n return (above?.kind === SyntaxKind.BinaryExpression)\n && ((above.left === operand) || (above.right === operand))\n && (GO_MARKET_READ_COMPARISON_OPERATORS.indexOf(above.operatorToken?.kind) >= 0);\n }\n\n // the container/key argument nodes of a whole `this.SafeList(container, key)` call, or\n // undefined when the initializer is another shape. A third argument is only droppable when\n // it is the empty array literal the TS call sites pass (`safeList(x, k, [])`): the typed\n goSafeListLocalArgs(initializer) {\n return this.goSafeAccessorLocalArgs(initializer, 'safeList', SyntaxKind.ArrayLiteralExpression, 'elements');\n }\n\n // one later use of a list local: it must read the value as a list, never hand the box out.\n // A length read, an element read and the statement-shaped push all answer for a []any what\n // the accessors answered for the box; every other use keeps the box.\n goSafeListUseReadsTheList(node): boolean {\n const parent: any = node.parent;\n if (parent === undefined) {\n return false;\n }\n switch (parent.kind) {\n case SyntaxKind.PropertyAccessExpression: {\n if (parent.expression !== node) {\n return false; // the local as the receiver of a further member\n }\n if (parent.name?.text === 'length') {\n return true; // prints GetArrayLength(x)\n }\n // `x.push(v)` prints `x = append(x, v)` only in the statement shape; every other\n // push keeps AppendToArray(&x, …), whose *any parameter a []any local cannot take\n return (parent.name?.text === 'push') && this.goIsNativeAppendShape(node, parent.parent);\n }\n case SyntaxKind.ElementAccessExpression: {\n if (parent.expression !== node) {\n return false; // the local as the index\n }\n return !this.isGoElementAccessAssignmentTarget(parent); // `x[k] = v` writes through the box\n }\n case SyntaxKind.CallExpression: {\n if (parent.expression === node) {\n return false; // the local called as a function\n }\n if (parent.arguments.indexOf(node) !== 0) {\n return false; // value position: the box escapes\n }\n const callee = this.goPrintedCallee(this.printNode(parent, 0));\n // both accessors read a []any receiver with the very answer they gave the box\n return (callee === 'GetValue') || (callee === 'GetArrayLength');\n }\n default:\n return false;\n }\n }\n\n // `var x any = this.SafeList(container, key)` -> `var x []any = SafeListTyped(container, key)`.\n // SafeListTyped reads the same member and every later use reads it as a list: a nil slice counts\n // 0 and indexes to nil, matching the box's absent case. Anything else keeps the box.\n goSafeListLocalUnboxCache = new Map();\n\n goSafeListLocalUnbox(declaration): string | undefined {\n return this.goCachedLocalUnbox(this.goSafeListLocalUnboxCache, declaration, () => this.goSafeListLocalUnboxUncached(declaration));\n }\n\n goSafeListLocalUnboxUncached(declaration): string | undefined {\n if (this.goSafeListLocalArgs(declaration.initializer) === undefined) {\n return undefined;\n }\n return this.goDeclaredLocalTypeIfSafe(declaration, GO_SAFE_LIST_LOCAL_TYPE, (n) => this.goSafeListUseReadsTheList(n));\n }\n\n // the initializer a typed list local is declared with: the accessor call is replaced by the\n // typed reader, which reads the same member but names the result\n goSafeListUnboxValue(declaration, identation: number): string | undefined {\n if (this.goSafeListLocalUnbox(declaration) !== GO_SAFE_LIST_LOCAL_TYPE) {\n return undefined;\n }\n const args: any = this.goSafeListLocalArgs(declaration.initializer);\n const container = this.printNode(args.container, identation);\n const key = this.printNode(args.key, 0);\n return `SafeListTyped(${container}, ${key})`;\n }\n\n getGoLocalType(declaration, parsedValue: string): string {\n const goType = this.goTypeOfInitializer(declaration.initializer, parsedValue);\n if (goType === undefined) {\n return this.goSafeDictLocalUnbox(declaration) ?? this.goSafeListLocalUnbox(declaration) ?? this.goMarketLocalUnbox(declaration) ?? 'any';\n }\n // the scan matches AST identifiers, so it needs the source name, not the\n // printed one (`type` is renamed to `typeVar` on the way out)\n const sourceName = declaration.name?.text;\n if (sourceName === undefined) {\n return 'any';\n }\n const scope = this.goEnclosingFunction(declaration);\n // outside any nested resolution the verdict depends only on (declaration, goType)\n const stable = (this.goLocalTypeResolution.size <= 1) && (this.goDeclaredTypeInProgress.size === 0);\n const memoKey = goType;\n let perDecl = stable ? this.goLocalSafeVerdicts.get(declaration) : undefined;\n if (perDecl !== undefined && perDecl.has(memoKey)) {\n return perDecl.get(memoKey);\n }\n const result = (this.goTypeNameIsShadowed(scope, goType) || !this.goLocalIsSafeToType(scope, declaration, sourceName, goType)) ? 'any' : goType;\n if (stable) {\n if (perDecl === undefined) {\n perDecl = new Map();\n this.goLocalSafeVerdicts.set(declaration, perDecl);\n }\n perDecl.set(memoKey, result);\n }\n return result;\n }\n goLocalSafeVerdicts = new WeakMap>();\n\n // Typed async receive: an extension that knows the core's channel element type replaces\n // `x := (<-this.FooAsync(..))` + `PanicOnError(x)` with a typed declaration that runs PanicOnError\n // first (same frame and message). The default returns undefined and changes nothing.\n goAwaitReceiveUnbox(awaitNode, printedInitializer: string): { goType: string, wrap: (recv: string) => string } | undefined {\n return undefined;\n }\n\n printVariableDeclarationList(node,identation) {\n const declaration = node.declarations[0];\n // const varToken = this.VAR_TOKEN ? this.VAR_TOKEN + \" \": \"\";\n // const name = declaration.name.text;\n\n if (declaration?.name.kind === SyntaxKind.ArrayBindingPattern) {\n const arrayBindingPattern = declaration.name;\n const arrayBindingPatternElements = arrayBindingPattern.elements;\n const parsedArrayBindingElements = arrayBindingPatternElements.map((e) => this.printNode(e.name, 0));\n const syntheticName = parsedArrayBindingElements.join(\"\") + \"Variable\";\n\n // gofmt drops every redundant statement terminator: Go statements are\n // newline-separated, so the joins below must not emit ';'\n let arrayBindingStatement = `${this.getIden(identation)}${syntheticName} := ${this.printNode(declaration.initializer, 0)}\\n`;\n\n arrayBindingStatement += parsedArrayBindingElements\n .map((e, index) => this.getIden(identation) + `${e} := GetValue(${syntheticName}, ${index})`).join(\"\\n\");\n\n return arrayBindingStatement;\n }\n\n if (declaration?.initializer?.kind=== SyntaxKind.AwaitExpression) {\n const parsedName = this.printNode(declaration.name, 0);\n // the awaited call can carry a multi-line literal argument: printing it at the\n // declaration's own level keeps that literal one level deeper\n const parsedInitializer = this.printNode(declaration.initializer, identation);\n const awaitUnbox = this.goAwaitReceiveUnbox(declaration.initializer, parsedInitializer);\n if (awaitUnbox !== undefined) {\n // the conversion runs PanicOnError first (inside the bracket), so the panic\n // path keeps the same caller, message and stack as the boxed pair below\n return `\n${this.getIden(identation)}var ${parsedName} ${awaitUnbox.goType} = ${awaitUnbox.wrap(parsedInitializer)}`;\n }\n return `\n${this.getIden(identation)}${parsedName} := ${parsedInitializer}\n${this.getIden(identation)}PanicOnError(${parsedName})`;\n\n }\n\n const isNew = declaration.initializer && (declaration.initializer.kind === SyntaxKind.NewExpression);\n\n const parsedValue = (declaration.initializer) ? this.printNode(declaration.initializer, identation) : this.NULL_TOKEN;\n\n if (parsedValue === this.UNDEFINED_TOKEN) {\n return this.getIden(identation) + \"var \" + this.printNode(declaration.name) + \" any = \" + parsedValue;\n }\n\n if (node?.parent?.kind === SyntaxKind.FirstStatement) {\n if (isNew) {\n return this.getIden(identation) + this.printNode(declaration.name) + \" := \" + parsedValue;\n }\n const varName = this.printNode(declaration.name);\n const declaredType = this.getGoLocalType(declaration, parsedValue);\n // a typed dict/list local is declared with the typed reader rather than the `any`\n // accessor, so the declaration compiles against the map/slice type\n const unboxValue = this.goMarketUnboxValue(declaration, parsedValue)\n ?? ((declaredType === GO_SAFE_DICT_LOCAL_TYPE)\n ? this.goSafeDictUnboxValue(declaration, identation)\n : ((declaredType === GO_SAFE_LIST_LOCAL_TYPE) ? this.goSafeListUnboxValue(declaration, identation) : undefined));\n const declaredValue = (unboxValue !== undefined) ? unboxValue : parsedValue.trimStart();\n // an initializer printed at the declaration's own level (parenthesized expression,\n // helper call) carries that indentation; gofmt puts one space after `=`\n const stm = this.getIden(identation) + \"var \" + varName + \" \" + declaredType + \" = \" + declaredValue;\n if (parsedValue.startsWith(\"<-this.callInternal(\")) {\n return `\n${stm}\n${this.getIden(identation)}PanicOnError(${varName})`;\n }\n return stm;\n }\n\n return this.getIden(identation) + this.printNode(declaration.name) + \" := \" + parsedValue.trim();\n }\n\n // printObjectLiteralExpression(node, identation) {\n // const objectCreation = 'make(map[string]any) {';\n // let formattedObjectBody = '{}';\n // if (node.properties?.length > 0) {\n // const objectBody = this.printObjectLiteralBody(node, identation);\n // formattedObjectBody = objectBody ? \"\\n\" + objectBody + \"\\n\" + this.getIden(identation) : objectBody;\n // }\n // // return this.OBJECT_OPENING + formattedObjectBody + this.OBJECT_CLOSING;\n // return objectCreation + formattedObjectBody;\n // }\n\n // printObjectLiteralBody(node, identation) {\n // let objectName = node.parent?.name?.text;\n // if (objectName === undefined) {\n // objectName = \"object\";\n // }\n // const body = node.properties.map((p) => `${this.getIden(identation)}${objectName}[\"${node.properties[0].name.text}\"] = ${p.initializer.text}` ).join(\"\\n\");\n // return body;\n // }\n\n // F09 — gofmt aligns the key/value columns inside multi-line composite literals.\n //\n // go/printer's exprList prints a single-line `key: value` entry as `key:` + vtab, so\n // every consecutive single-line entry of a literal body lands in one text/tabwriter\n // column block: the value starts after the widest key cell of that block (`\"key\":`,\n // the key plus its colon) and one space of padding. An entry whose value spans lines\n // carries no vtab cell, so it ends the block on both sides, exactly like a blank line\n // does. exprList also writes a formfeed — turned into a plain newline by the trimmer,\n // so it never shows up in the output — before an entry that opens a new alignment\n // section: that happens when the entry or its predecessor does not fit on a single\n // line, and when the key size ratio against the geometric mean of the previous key\n // sizes of the section reaches r = 2.5 (or drops to 1/r) while at least one of the\n // two keys is larger than smallSize = 40 bytes; keys of at most 40 bytes always keep\n // the section aligned. A trailing comment is one more tabwriter cell, so comments\n // line up after the widest `value,` cell of the run of consecutive commented entries.\n printObjectLiteralBody(node, identation) {\n // composite literal elements are printed at depth 1 again (go/printer exprList(..., 1, ...));\n // a literal nested in an entry's value is laid out relative to that entry\n const previousLevel = this.goStatementLevel;\n this.goStatementLevel = identation + 1;\n try {\n const entries = node.properties.map((p) => this.goWithExprDepth(1, () => this.printNode(p, identation + 1)));\n return this.alignGoCompositeEntries(entries).join(\"\\n\");\n } finally {\n this.goStatementLevel = previousLevel;\n }\n }\n\n // Applies the gofmt column alignment to already-printed `key: value` entries (the\n // entries must not carry the separating comma). Reused by the hand-written composite\n // literals in ccxt's build/goTranspiler.ts, which do not go through this printer.\n alignGoCompositeEntries(entries) {\n const parsedEntries = entries.map((entry) => this.parseGoCompositeEntry(entry));\n const paddings = this.getGoCompositePaddings(parsedEntries);\n return entries.map((entry, index) => this.renderGoCompositeEntry(entry, parsedEntries[index], paddings[index]));\n }\n\n // ` \"key\": value, // comment` -> the pieces gofmt's tabwriter aligns.\n // Returns undefined for anything that is not a plain `key: value` entry (a spread, a\n // method, a computed key): the caller then leaves that entry alone and ends the block.\n parseGoCompositeEntry(entry) {\n const newlineIndex = entry.indexOf(\"\\n\");\n const firstLine = newlineIndex === -1 ? entry : entry.slice(0, newlineIndex);\n const keyMatch = /^([ \\t]*)(\"(?:[^\"\\\\]|\\\\.)*\"): /.exec(firstLine);\n if (keyMatch === null) {\n return undefined;\n }\n const singleLine = newlineIndex === -1;\n // for a multi-line entry only the trailing comment of its last line matters here\n const tail = singleLine ? entry.slice(keyMatch[0].length) : entry.slice(entry.lastIndexOf(\"\\n\") + 1);\n const commentIndex = this.findGoTrailingCommentStart(tail);\n return {\n 'indent': keyMatch[1],\n 'key': keyMatch[2],\n // nodeSize() measures the printed key; a value that spans lines gets size 0\n 'size': singleLine ? this.getGoByteLength(keyMatch[2]) : 0,\n 'singleLine': singleLine,\n 'value': singleLine ? (commentIndex === -1 ? tail : tail.slice(0, commentIndex)).trimEnd() : undefined,\n 'comment': commentIndex === -1 ? undefined : tail.slice(commentIndex).trimEnd(),\n };\n }\n\n // Index of the trailing comment of a printed line, or -1. `//` or `/*` inside a string\n // or a rune literal (e.g. a \"https://…\" value) is not a comment.\n findGoTrailingCommentStart(line) {\n let quote;\n for (let index = 0; index < line.length; ++index) {\n const character = line[index];\n if (quote !== undefined) {\n if (character === \"\\\\\" && quote !== \"`\") {\n index += 1;\n } else if (character === quote) {\n quote = undefined;\n }\n continue;\n }\n if (character === \"\\\"\" || character === \"`\" || character === \"'\") {\n quote = character;\n } else if (character === \"/\" && (line[index + 1] === \"/\" || line[index + 1] === \"*\")) {\n return index;\n }\n }\n return -1;\n }\n\n // {key, comment} space counts per entry, i.e. the padding gofmt's tabwriter inserts.\n // Only entries that are part of a block get a padding; every other entry is rendered\n // as printed (gofmt leaves single-line and multi-line sections untouched).\n getGoCompositePaddings(parsedEntries) {\n // the sectioning below mirrors go/printer's exprList\n const smallSize = 40;\n const ratio = 2.5;\n const paddings = parsedEntries.map(() => undefined);\n let block = [];\n let previousSize = 0;\n let size = 0;\n let lnSum = 0;\n let count = 0;\n const flushBlock = () => {\n if (block.length === 0) {\n return;\n }\n let keyWidth = 1; // widest key cell of the block + one space of padding\n for (const index of block) {\n keyWidth = Math.max(keyWidth, this.getGoRuneLength(parsedEntries[index].key) + 2);\n }\n for (const index of block) {\n paddings[index] = { 'key': keyWidth - this.getGoRuneLength(parsedEntries[index].key) - 1, 'comment': 1 };\n }\n // the comment column only spans the runs of consecutive commented entries\n let run = [];\n const flushRun = () => {\n if (run.length === 0) {\n return;\n }\n let runWidth = 1; // widest `value,` cell of the run + one space of padding\n for (const index of run) {\n runWidth = Math.max(runWidth, this.getGoRuneLength(parsedEntries[index].value) + 2);\n }\n for (const index of run) {\n paddings[index].comment = runWidth - this.getGoRuneLength(parsedEntries[index].value) - 1;\n }\n run = [];\n };\n for (const index of block) {\n if (parsedEntries[index].comment !== undefined) {\n run.push(index);\n } else {\n flushRun();\n }\n }\n flushRun();\n block = [];\n };\n for (let index = 0; index < parsedEntries.length; ++index) {\n const entry = parsedEntries[index];\n previousSize = size;\n size = entry !== undefined ? entry.size : 0;\n let sectionBreak = true; // exprList's useFF\n if (previousSize > 0 && size > 0) {\n if (count === 0 || (previousSize <= smallSize && size <= smallSize)) {\n sectionBreak = false;\n } else {\n const geomean = this.goExp2ish(lnSum / count);\n const sizeRatio = size / geomean;\n sectionBreak = ratio * sizeRatio <= 1 || ratio <= sizeRatio;\n }\n }\n const alignable = entry !== undefined && entry.singleLine;\n if (index > 0 && sectionBreak) {\n // exprList resets the geometric mean accumulation whenever it starts a\n // new section (a formfeed break is two line breaks, nbreaks > 1), so the\n // ratio below is measured against the current section only\n lnSum = 0;\n count = 0;\n }\n if (!alignable || sectionBreak) {\n flushBlock();\n }\n if (alignable) {\n block.push(index);\n }\n if (size > 0) {\n lnSum += this.goLog2ish(size);\n count += 1;\n }\n }\n flushBlock();\n return paddings;\n }\n\n // go/printer's crude log2/exp2 (math.go log2ish/exp2ish): the geomean must match it bit for\n // bit, a ratio landing on exactly 2.5 decides the section break\n goLog2ish(x: number): number {\n let exponent = x === 0 ? 0 : Math.floor(Math.log2(x)) + 1;\n let fraction = x / Math.pow(2, exponent);\n if (fraction >= 1) { fraction /= 2; exponent += 1; }\n if (fraction < 0.5 && fraction !== 0) { fraction *= 2; exponent -= 1; }\n return exponent + 2 * (fraction - 1);\n }\n\n goExp2ish(x: number): number {\n const n = Math.floor(x);\n return (1 + x - n) * Math.pow(2, n);\n }\n\n renderGoCompositeEntry(entry, parsed, padding) {\n if (parsed === undefined || !parsed.singleLine || padding === undefined) {\n return this.appendGoTrailingComma(entry);\n }\n const comment = parsed.comment === undefined ? \"\" : \" \".repeat(padding.comment) + parsed.comment;\n return parsed.indent + parsed.key + \":\" + \" \".repeat(padding.key) + parsed.value + \",\" + comment;\n }\n\n // gofmt prints the comma of an entry before its trailing comment (`value, // comment`),\n // the entry text carries the comment last, so move the comma in front of it\n appendGoTrailingComma(entry) {\n const newlineIndex = entry.lastIndexOf(\"\\n\");\n const lastLine = newlineIndex === -1 ? entry : entry.slice(newlineIndex + 1);\n const commentIndex = this.findGoTrailingCommentStart(lastLine);\n if (commentIndex === -1) {\n return entry + \",\";\n }\n const offset = entry.length - lastLine.length + commentIndex;\n return entry.slice(0, offset).trimEnd() + \", \" + entry.slice(offset).trimEnd();\n }\n\n // text/tabwriter sizes cells in runes, go/printer's nodeSize counts bytes\n getGoRuneLength(text) {\n return [...text].length;\n }\n\n getGoByteLength(text) {\n let length = 0;\n for (const character of text) {\n const codePoint = character.codePointAt(0);\n length += codePoint < 0x80 ? 1 : codePoint < 0x800 ? 2 : codePoint < 0x10000 ? 3 : 4;\n }\n return length;\n }\n\n printConstructorDeclaration (node, identation) {\n const classNode = node.parent;\n const className = this.printNode(classNode.name, 0);\n const args = this.printMethodParameters(node);\n const constructorBody = this.printFunctionBody(node, identation);\n\n // find super call inside constructor and extract params\n let superCallParams = '';\n let hasSuperCall = false;\n node.body?.statements.forEach(statement => {\n if (isExpressionStatement(statement)) {\n const expression = statement.expression;\n if (isCallExpression(expression)) {\n const expressionText = expression.expression.getText().trim();\n if (expressionText === 'super') {\n hasSuperCall = true;\n superCallParams = expression.arguments.map((a) => {\n return this.printNode(a, identation).trim();\n }).join(\", \");\n }\n }\n }\n });\n\n if (hasSuperCall) {\n return this.getIden(identation) + className +\n `(${args}) : ${this.SUPER_CALL_TOKEN}(${superCallParams})` +\n constructorBody;\n }\n\n return this.getIden(identation) +\n className +\n \"(\" + args + \")\" +\n constructorBody;\n }\n\n printDynamicCall(node, identation) {\n // const isAsync = true; // setting to true for now, because there are some scenarios where we don't know\n const elementAccess = node.expression;\n if (elementAccess?.kind === SyntaxKind.ElementAccessExpression) {\n // the emitted call also carries the property name as its first\n // argument, so a call with arguments is a call with more than one\n // argument and prints them one level deeper\n const argumentDepth = this.goExprDepth + ((node.arguments?.length > 0) ? 1 : 0);\n const parsedArg = node.arguments?.length > 0 ? node.arguments.map(n => this.goWithExprDepth(argumentDepth, () => this.printNode(n, identation).trimStart())).join(\", \") : \"\";\n // const target = this.printNode(elementAccess.expression, 0);\n const propName = this.goWithExprDepth(argumentDepth, () => this.printNode(elementAccess.argumentExpression, 0));\n const argsArray = `${parsedArg}`;\n const open = this.DYNAMIC_CALL_OPEN;\n const statement = `${open}${propName}, ${argsArray})`;\n // statement = isAsync ? `((Task)${statement})` : statement;\n return statement;\n }\n return undefined;\n }\n\n\n printElementAccessExpressionExceptionIfAny(node) {\n // Fix malformed Split(...) element access where the index arg is mistakenly placed\n // inside the Split call. We force the correct pattern: GetValue(Split(str, sep), idx)\n const tsKind = SyntaxKind;\n if (node.expression.kind === tsKind.CallExpression) {\n const callExp = node.expression;\n const calleeText = callExp.expression.getText();\n if (calleeText.endsWith('.split') || calleeText.toLowerCase().includes('split')) {\n // print Split call normally (should already close with ))\n let splitCall = this.printNode(callExp, 0).trim();\n if (!splitCall.endsWith(')')) {\n splitCall += ')';\n }\n const idxArg = this.printNode(node.argumentExpression, 0);\n return `GetValue(${splitCall}, ${idxArg})`;\n }\n }\n // default: no exception\n return undefined;\n }\n\n printWrappedUnknownThisProperty(node, identation = 0) {\n const type = this.getChecker().getResolvedSignature(node);\n if (type?.declaration?.resolve() === undefined) {\n // the emitted call carries the property name as its first argument; arguments\n // print at the call's level so a multi-line literal keeps its nesting\n const argumentDepth = this.goExprDepth + ((node.arguments?.length > 0) ? 1 : 0);\n let parsedArguments = node.arguments?.map((a) => this.goWithExprDepth(argumentDepth, () => this.printNode(a, identation).trimStart())).join(\", \");\n parsedArguments = parsedArguments || \"\";\n const propName = node.expression?.name.text;\n // const isAsyncDecl = true;\n // const isAsyncDecl = node?.parent?.kind === SyntaxKind.AwaitExpression;\n // const isAsyncDecl = false;\n // const open = isAsyncDecl ? this.UKNOWN_PROP_ASYNC_WRAPPER_OPEN : this.UKNOWN_PROP_WRAPPER_OPEN;\n // const close = this.UNKOWN_PROP_WRAPPER_CLOSE;\n // return `${open}\"${propName}\"${parsedArguments}${close}`;\n const argsArray = `${parsedArguments}`;\n const open = this.DYNAMIC_CALL_OPEN;\n const statement = `${open}\"${propName}\", ${argsArray})`;\n return statement;\n }\n return undefined;\n }\n\n transformMethodNameIfNeeded(name: string): string {\n const res = this.unCamelCaseIfNeeded(name);\n return this.capitalize(res);\n }\n\n transformCallExpressionName(name: string, nameNode = undefined) {\n return this.applyAsyncSuffixToCallee(nameNode, this.capitalize(name));\n }\n\n transformPropertyAccessExpressionName(name: string, nameNode = undefined) {\n return this.applyAsyncSuffixToCallee(nameNode, this.capitalize(name));\n }\n\n printOutOfOrderCallExpressionIfAny(node, identation) {\n if (node.expression.kind === SyntaxKind.PropertyAccessExpression) {\n const args = node.arguments;\n\n if (node.expression.expression.kind === SyntaxKind.ThisKeyword) {\n const methodName = this.printNode(node.expression.name, 0);\n if (this.wrapThisCalls || (this.wrapCallMethods.includes(methodName))) {\n const argsParsed = this.goUnifiedStringCallArgs(node, 0, true) ?? args.map((a) => this.printNode(a, 0)).join(\", \");\n return `<-this.callInternal(\"${methodName}\"${(args.length > 0) ? \", \" + argsParsed : \"\"})`;\n }\n }\n\n const expressionText = node.expression.getText().trim();\n if (args.length === 1) {\n const parsedArg = this.printNode(args[0], 0);\n switch (expressionText) {\n // case \"JSON.parse\":\n // return `json_decode(${parsedArg}, $as_associative_array = true)`;\n case \"Math.abs\":\n return `mathAbs(${parsedArg})`;\n }\n } else if (args.length === 2)\n {\n const parsedArg1 = this.printNode(args[0], 0);\n const parsedArg2 = this.printNode(args[1], 0);\n switch (expressionText) {\n case \"Math.min\":\n return `mathMin(${parsedArg1}, ${parsedArg2})`;\n case \"Math.max\":\n return `mathMax(${parsedArg1}, ${parsedArg2})`;\n case \"Math.pow\":\n return `MathPow(${parsedArg1}, ${parsedArg2})`;\n }\n }\n const leftSide = node.expression?.expression;\n const leftSideText = leftSide ? this.printNode(leftSide, 0) : undefined;\n\n // wrap unknown property this.X calls\n if (leftSideText === this.THIS_TOKEN || leftSide.getFullText().indexOf(\"(this as any)\") > -1) { // double check this\n const res = this.printWrappedUnknownThisProperty(node, identation);\n if (res) {\n return res;\n }\n }\n }\n\n // // replace this[method]() calls\n // const thisElementAccess = this.printThisElementAccesssIfNeeded(node, identation);\n // if (thisElementAccess) {\n // return thisElementAccess;\n // }\n\n // handle dynamic calls, this[method](A) or exchange[b] (c) using reflection\n if (node.expression.kind === SyntaxKind.ElementAccessExpression) {\n return this.printDynamicCall(node, identation);\n }\n\n\n return undefined;\n }\n\n // `typeof x === \"\"` checks and the Go predicate helper each maps to\n goTypeOfHelpers = new Map([\n ['string', 'IsString'], ['number', 'IsNumber'], ['boolean', 'IsBool'], ['object', 'IsObject'], ['function', 'IsFunction'],\n ]);\n handleTypeOfInsideBinaryExpression(node, identation) {\n const left = node.left;\n const right = node.right.text;\n const op = node.operatorToken.kind;\n const expression = left.expression;\n\n const isDifferentOperator = op === SyntaxKind.ExclamationEqualsEqualsToken || op === SyntaxKind.ExclamationEqualsToken;\n const notOperator = isDifferentOperator ? this.NOT_TOKEN : \"\";\n\n const target = this.printNode(expression, 0);\n const helper = this.goTypeOfHelpers.get(right);\n return (helper === undefined) ? undefined : notOperator + `${helper}(${target})`;\n\n }\n\n printCustomBinaryExpressionIfAny(node, identation) {\n const left = node.left;\n const right = node.right;\n\n const op = node.operatorToken.kind;\n\n // ---------------------------------------------------------------\n // Array destructuring assignment: [a, b] = foo()\n // Transforms into:\n // __tmpX := foo()\n // a = GetValue(__tmpX, 0)\n // b = GetValue(__tmpX, 1)\n // ---------------------------------------------------------------\n if (op === SyntaxKind.EqualsToken &&\n left.kind === SyntaxKind.ArrayLiteralExpression) {\n // const elems = (left.elements as any[]);\n // const returnRandName = \"retRes\" + this.getLineBasedSuffix(node);\n // const rhs = this.printNode(right, 0);\n\n // // build extraction lines\n // const assignments = elems.map((el, idx) => {\n // const leftName = this.printNode(el, 0);\n // return `${leftName} = GetValue(${returnRandName}, ${idx})`;\n // }).join(`\\n${this.getIden(identation)}`);\n\n // return `${returnRandName} := ${rhs}\\n${this.getIden(identation)}${assignments}`;\n //\n const arrayBindingPatternElements = left.elements;\n const parsedArrayBindingElements = arrayBindingPatternElements.map((e) => this.printNode(e, 0));\n const syntheticName = parsedArrayBindingElements.join(\"\") + \"Variable\";\n\n let arrayBindingStatement = `${syntheticName} := ${this.printNode(right, 0)}\\n`;\n\n parsedArrayBindingElements.forEach((e, index) => {\n\n const statement = this.getIden(identation) + (this.goGetArgBindsDictElement(arrayBindingPatternElements[index], right, index)\n ? `${e} = MapTyped(GetValue(${syntheticName}, ${index}))`\n : `${e} = GetValue(${syntheticName}, ${index})`);\n if (index < parsedArrayBindingElements.length - 1) {\n arrayBindingStatement += statement + \"\\n\";\n } else {\n arrayBindingStatement += statement;\n }\n });\n\n return arrayBindingStatement;\n }\n\n // ---------------------------------------------------------------\n // Go-style setter for element-access assignments: a[b] = v and a[b] += v\n // ---------------------------------------------------------------\n if ((op === SyntaxKind.EqualsToken || op === SyntaxKind.PlusEqualsToken) &&\n left.kind === SyntaxKind.ElementAccessExpression) {\n // Collect base container and all keys (inner-most key is last).\n const keys: any[] = [];\n let baseExpr: any = null;\n let cur: any = left;\n while (isElementAccessExpression(cur)) {\n keys.unshift(cur.argumentExpression); // prepend\n const expr = cur.expression;\n if (!isElementAccessExpression(expr)) {\n baseExpr = expr;\n break;\n }\n cur = expr;\n }\n\n const containerStr = this.printNode(baseExpr, 0);\n const keyStrs = keys.map(k => this.printNode(k, 0));\n\n // the container of a nested `m[\"a\"][\"b\"] = v` write is a plain read of the\n // receiver: a declared map indexes natively and only the `any` steps above\n // it keep the helper (Go refuses to index an `any`)\n const acc = this.goElementWriteChain(baseExpr, containerStr, keys, keyStrs);\n\n const lastKey = keyStrs[keyStrs.length - 1];\n if (op === SyntaxKind.PlusEqualsToken) {\n const rhs = this.printNode(right, 0);\n // For +=, we need to get the current value, add to it, then set it back\n const currentValue = `${this.ELEMENT_ACCESS_WRAPPER_OPEN}${acc}, ${lastKey}${this.ELEMENT_ACCESS_WRAPPER_CLOSE}`;\n const native = (keyStrs.length === 1)\n ? this.printNativeElementAssignment(baseExpr, containerStr, keys[0], lastKey, `Add(${containerStr}[${lastKey}], ${rhs})`, true)\n : undefined;\n return (native !== undefined) ? native : `AddElementToObject(${acc}, ${lastKey}, Add(${currentValue}, ${rhs}))`;\n }\n // the value is printed at the statement's own level so a multi-line object\n // literal (bare, or nested inside a call argument) lands one level deeper with\n // its closing brace at the statement level; the leading indentation is dropped\n const rhs = this.goWithExprDepth(this.goExprDepth + 1, () => this.printNode(right, identation)).trimStart();\n\n // a single key over a receiver the printer typed itself is plain Go\n // indexing; a nested chain goes through GetValue, which is `any`\n // a native `m[k] = v` is a plain assignment, whose value go/printer prints at\n // the statement's own depth rather than inside the helper's argument list\n const nativeRhs = (right.kind === SyntaxKind.BinaryExpression)\n ? this.goWithExprDepth(this.goExprDepth, () => this.printNode(right, identation)).trimStart()\n : rhs;\n const native = (keyStrs.length === 1)\n ? this.printNativeElementAssignment(baseExpr, containerStr, keys[0], lastKey, nativeRhs, false, right)\n : undefined;\n return (native !== undefined) ? native : `AddElementToObject(${acc}, ${lastKey}, ${rhs})`;\n }\n\n if (left.kind === SyntaxKind.TypeOfExpression) {\n const typeOfExpression = this.handleTypeOfInsideBinaryExpression(node, identation);\n if (typeOfExpression) {\n return typeOfExpression;\n }\n }\n\n if (op === SyntaxKind.InKeyword) {\n const dictText = this.printNode(right, 0);\n const keyText = this.printNode(left, 0);\n const inlined = this.printInlineInOp(right, left, dictText, keyText);\n if (inlined !== undefined) {\n return inlined;\n }\n return `InOp(${dictText}, ${keyText})`;\n }\n\n // only print the operands when this op is actually handled here; otherwise\n // the base printBinaryExpression prints them, and doing it eagerly means\n // every unhandled binary expression gets its subtrees printed twice\n if (op === SyntaxKind.PlusEqualsToken || op === SyntaxKind.MinusEqualsToken || op in this.binaryExpressionsWrappers) {\n // both operands end up in the two-argument helper call below (or in the\n // `Add(x, y)` on the right of the compound assignment), i.e. one level\n // deeper than the expression itself\n const operandDepth = this.goExprDepth + 1;\n const leftText = this.goWithExprDepth(operandDepth, () => this.printNode(left, 0));\n const rightText = this.goWithExprDepth(operandDepth, () => this.printNode(right, 0));\n\n const nativeAssignment = this.goNativeCompoundAssignment(op, left, leftText, right, rightText);\n if (nativeAssignment !== undefined) {\n return nativeAssignment;\n }\n\n if (op === SyntaxKind.PlusEqualsToken) {\n return `${leftText} = Add(${leftText}, ${rightText})`;\n }\n\n if (op === SyntaxKind.MinusEqualsToken) {\n return `${leftText} = Subtract(${leftText}, ${rightText})`;\n }\n\n const isEquality = (op === SyntaxKind.EqualsEqualsToken) || (op === SyntaxKind.EqualsEqualsEqualsToken);\n const isDifference = (op === SyntaxKind.ExclamationEqualsToken) || (op === SyntaxKind.ExclamationEqualsEqualsToken);\n if (isEquality || isDifference) {\n const inlined = this.printInlineEquality(left, right, leftText, rightText, isEquality);\n if (inlined !== undefined) {\n return inlined;\n }\n }\n\n if (ORDERED_COMPARISON_OPERATORS[op] !== undefined) {\n const inlined = this.printInlineOrderedComparison(left, right, leftText, rightText, op);\n if (inlined !== undefined) {\n return inlined;\n }\n }\n\n const wrapper = this.binaryExpressionsWrappers[op];\n const open = wrapper[0];\n const close = wrapper[1];\n const nativeArithmetic = this.goNativeArithmetic(node, leftText, rightText);\n if (nativeArithmetic !== undefined) {\n return nativeArithmetic.text;\n }\n return `${open}${leftText}, ${rightText}${close}`;\n }\n\n // x = y\n // cast y to x type when y is unknown\n // if (op === SyntaxKind.EqualsToken) {\n // const leftType = this.getChecker().getTypeAtLocation(left);\n // const rightType = this.getChecker().getTypeAtLocation(right);\n\n // if (this.isAnyType(rightType.flags) && !this.isAnyType(leftType.flags)) {\n // // const parsedType = this.getTypeFromRawType(leftType);\n // return `${leftText} = ${rightText}`;\n // }\n // }\n\n return undefined;\n }\n\n // the scalar family the TypeScript type of an operand belongs to: 'string',\n // 'int', 'float', 'bool', 'nil' for the undefined/null literals, or undefined\n // when the type is any/unknown/a union of several families\n goScalarFamily(node): string | undefined {\n // TypeScript narrows `x !== undefined && x === 'v'` to `string`, but the Go\n // local is still the `any` box the declaration printed; when that box holds\n // a *T helper result, `==` against a string is never true in Go\n const checker: any = this.checkerOrUndefined();\n if (node?.kind === SyntaxKind.Identifier && this.goDeclaredTypeOfIdentifier(node) === undefined\n && this.goAnyLocalHoldsPointer(checker.getSymbolAtLocation(node)?.valueDeclaration?.resolve())) {\n return undefined;\n }\n return (checker === undefined) ? undefined : this.goScalarFamilyOfType(checker.getTypeAtLocation(node));\n }\n\n // the scalar family the TypeScript type of an operand belongs to, where a\n // `string | undefined` union still counts as 'string': the Go box holds that\n // scalar or nil, and both `x == nil` and `x == \"lit\"` are then the same\n // predicate as the helper. Numbers are excluded by the caller.\n goScalarFamilyWithNil(node): string | undefined {\n const checker: any = this.checkerOrUndefined();\n return (checker === undefined) ? undefined : this.goScalarFamilyOfType(checker.getTypeAtLocation(node), true);\n }\n\n // true when this operand is a *parameter* boxed as `any` whose TypeScript type is an array or\n // object (`Strings`, `Market`, `NullableDict`, `object[]`, `object`): a Go map/slice, never a\n // pointer, so a nil test needs no helper. Locals may box a nil `*sync.Map`, which is not `== nil`.\n goObjectBoxParameter(node): boolean {\n if (node?.kind !== SyntaxKind.Identifier) {\n return false;\n }\n const checker: any = this.checkerOrUndefined();\n if (checker === undefined) {\n return false;\n }\n if (checker.getSymbolAtLocation(node)?.valueDeclaration?.resolve()?.kind !== SyntaxKind.Parameter) {\n return false;\n }\n return this.goTypeIsNilComparableObject(checker.getTypeAtLocation(node));\n }\n\n // an object type whose Go value is a map/slice, or a union of such a type with\n // undefined/null. `any`, functions and class instances are excluded: their Go\n // value may be an identity-bearing pointer\n goTypeIsNilComparableObject(type): boolean {\n if (type === undefined) {\n return false;\n }\n if (type.flags & TypeFlags.Union) {\n let seen = false;\n for (const member of type.getTypes()) {\n if (member.flags & (TypeFlags.Undefined | TypeFlags.Null | TypeFlags.Void)) {\n continue;\n }\n if (!this.goTypeIsNilComparableObject(member)) {\n return false;\n }\n seen = true;\n }\n return seen;\n }\n if (!(type.flags & (TypeFlags.Object | TypeFlags.NonPrimitive))) {\n return false;\n }\n if (type.getCallSignatures().length > 0 || type.getConstructSignatures().length > 0) {\n return false;\n }\n const declaration = type.getSymbol()?.valueDeclaration?.resolve() ?? type.getSymbol()?.declarations?.map((d) => d.resolve())?.[0];\n return declaration?.kind !== SyntaxKind.ClassDeclaration;\n }\n\n // the callee name of a printed call, e.g. `this.SafeDict(x, 0, {})` → `this.SafeDict`\n goPrintedCallee(printedValue: string): string | undefined {\n let value = printedValue.trim();\n while (value.startsWith('(') && this.isWholePrintedCall(value, 0)) {\n value = value.substring(1, value.length - 1).trim();\n }\n const open = value.indexOf('(');\n if (open <= 0 || !this.isWholePrintedCall(value, open)) {\n return undefined;\n }\n const callee = value.substring(0, open);\n return /^[A-Za-z_][\\w.]*$/.test(callee) ? callee : undefined;\n }\n\n // true when this expression prints to an interface (`any`) box: a parameter, a\n // local the printer left `any`, or one of the helpers whose Go signature returns\n // `any`. A *T / scalar local or call is not a box and keeps its own rule.\n goIsAnyBoxExpression(node, printedText: string): boolean {\n if (node?.kind === SyntaxKind.Identifier) {\n const decl = this.goAnyBoxLocalDeclaration(node);\n const isBinding = (decl?.kind === SyntaxKind.Parameter)\n || (decl?.kind === SyntaxKind.VariableDeclaration);\n if (!isBinding) {\n return false;\n }\n // the printer names a Go type for this local/`:=` initializer, so the\n // value is not behind an interface\n if (this.goDeclaredTypeOfIdentifier(node) !== undefined) {\n return false;\n }\n // an `any` local initialised from a *T helper (`var x any = this.SafeString(…)`)\n // boxes the pointer itself: a nil *string inside `any` is not `== nil` in Go,\n // so only the deref-aware helper compares it correctly\n return !this.goAnyLocalHoldsPointer(decl);\n }\n if (node?.kind === SyntaxKind.CallExpression) {\n if (this.goTypeOfInitializer(node, printedText) !== undefined) {\n return false; // a *T or a scalar the printer can name\n }\n return GO_ANY_BOX_CALLS.indexOf(this.goPrintedCallee(printedText)) >= 0;\n }\n return false;\n }\n\n // an element read prints either a native map[string]any index or the\n // GetValue(container, key) helper call — an `any` box in both cases\n goBoxedElementRead(node, printedText: string): boolean {\n node = this.goUnwrapParenthesizedNode(node);\n if (node?.kind !== SyntaxKind.ElementAccessExpression) {\n return false;\n }\n if (GO_ANY_BOX_CALLS.indexOf(this.goPrintedCallee(printedText)) >= 0) {\n return true; // GetValue(container, key)\n }\n let base = node.expression;\n while (isElementAccessExpression(base)) {\n base = base.expression;\n }\n // the printed base is unknown here: `goIndexableTypeOf` answers on the\n // declared table alone for every shape but a call, which stays a box anyway\n return this.goIndexableTypeOf(base, '') === 'map[string]any';\n }\n\n // true when an `any`-typed local can hold a *T helper result: its initializer or a\n // later `x = …` write is a `this.safeX(…)` call whose Go signature returns a pointer\n goAnyLocalHoldsPointerCache = new Map();\n goAnyLocalHoldsPointer(decl): boolean {\n if (decl?.kind !== SyntaxKind.VariableDeclaration || decl.name?.kind !== SyntaxKind.Identifier) {\n return false;\n }\n if (this.goAnyLocalHoldsPointerCache.has(decl)) {\n return this.goAnyLocalHoldsPointerCache.get(decl);\n }\n // the callee is read from the AST, never printed: printing an operand would\n // re-enter the equality classifier that asks this question\n this.goAnyLocalHoldsPointerCache.set(decl, false);\n let settled = true;\n const isPointerInit = (expr): boolean => {\n expr = this.goUnwrapParenthesizedNode(expr);\n if (expr?.kind === SyntaxKind.ConditionalExpression) {\n return isPointerInit(expr.whenTrue) || isPointerInit(expr.whenFalse);\n }\n if (expr?.kind === SyntaxKind.Identifier) {\n // a copy of a pointer-bound GetArg parameter (or of a local holding one) boxes it\n const source: any = this.checkerOrUndefined()?.getSymbolAtLocation(expr)?.valueDeclaration?.resolve();\n if (source?.kind === SyntaxKind.Parameter) {\n if (this.goGetArgTypeComputing?.has(source)) {\n settled = false;\n return true;\n }\n return String(this.goGetArgParameterType(source) ?? '').startsWith('*');\n }\n const inner = (source !== decl) && this.goAnyLocalHoldsPointer(source);\n settled = settled && ((source === decl) || this.goAnyLocalHoldsPointerCache.has(source));\n return inner;\n }\n const callee = (expr?.kind === SyntaxKind.CallExpression) ? expr.expression : undefined;\n if (callee?.kind !== SyntaxKind.PropertyAccessExpression || callee.expression?.kind !== SyntaxKind.ThisKeyword) {\n return false;\n }\n const name = this.goAstCalleeName(expr);\n const goType = (name === undefined) ? undefined : GO_HELPER_RETURN_TYPES[name];\n return (typeof goType === 'string') && goType.startsWith('*');\n };\n let holds = isPointerInit(decl.initializer);\n if (!holds) {\n const name = decl.name.text;\n const scope = this.goEnclosingFunction(decl);\n const visit = (n) => {\n if (holds) { return; }\n if (n.kind === SyntaxKind.BinaryExpression && n.operatorToken.kind === SyntaxKind.EqualsToken\n && n.left?.kind === SyntaxKind.Identifier && n.left.text === name && isPointerInit(n.right)) {\n holds = true;\n return;\n }\n n.forEachChild(visit);\n };\n if (scope !== undefined) {\n scope.forEachChild(visit);\n }\n }\n if (settled) {\n this.goAnyLocalHoldsPointerCache.set(decl, holds);\n } else {\n this.goAnyLocalHoldsPointerCache.delete(decl);\n }\n return holds;\n }\n\n // the callee name of a call, read from the AST and capitalised the way the\n // printer names Go functions (`this.parseJson` -> `this.ParseJson`). Printing the\n // callee would re-enter the equality classifier that asks this question.\n goAstCalleeName(call): string | undefined {\n const callee = call?.expression;\n if (callee?.kind === SyntaxKind.Identifier) {\n const name = callee.text;\n return (typeof name === 'string' && name.length > 0) ? name.charAt(0).toUpperCase() + name.substring(1) : undefined;\n }\n if (callee?.kind === SyntaxKind.PropertyAccessExpression && callee.expression?.kind === SyntaxKind.ThisKeyword) {\n const name = callee.name?.text;\n return (typeof name === 'string' && name.length > 0) ? 'this.' + name.charAt(0).toUpperCase() + name.substring(1) : undefined;\n }\n return undefined;\n }\n\n // true when every declaration of the awaited callee is a bodyless method signature:\n // TS never implements it, the endpoint generator does, and the Go body is the\n // `<-chan any` wrapper over callEndpointAsync (decoded JSON / \"panic: \" / nil)\n goAwaitedCallIsImplicitEndpoint(expression): boolean {\n const call = this.goUnwrapParenthesizedNode(expression);\n if (call?.kind !== SyntaxKind.CallExpression) {\n return false;\n }\n const callee = call.expression;\n if (callee?.kind !== SyntaxKind.PropertyAccessExpression || callee.expression?.kind !== SyntaxKind.ThisKeyword) {\n return false;\n }\n const nameNode = callee.name;\n if (nameNode?.kind !== SyntaxKind.Identifier) {\n return false;\n }\n const checker: any = this.checkerOrUndefined();\n if (checker === undefined) {\n return false;\n }\n const symbol = checker.getSymbolAtLocation(nameNode);\n const declarations = symbol?.declarations?.map((d) => d.resolve());\n if (!declarations || declarations.length === 0) {\n return false;\n }\n return declarations.every((d) => (d.kind === SyntaxKind.MethodSignature)\n && (d.body === undefined)\n && (d.parent?.kind === SyntaxKind.InterfaceDeclaration));\n }\n\n // true when the printed value of this expression is never a *T whose nil\n // derefScalar folds to nil (nor a *sync.Map): null/undefined, an object/array\n // literal, an endpoint await or a JSON decode. Everything else stays unproven.\n goIsNonPointerValueSource(expr): boolean {\n expr = this.goUnwrapParenthesizedNode(expr);\n if (expr === undefined) {\n return true; // `var x any` never written holds nil\n }\n switch (expr.kind) {\n case SyntaxKind.NullKeyword:\n return true;\n case SyntaxKind.Identifier:\n return expr.text === 'undefined';\n case SyntaxKind.ObjectLiteralExpression:\n case SyntaxKind.ArrayLiteralExpression:\n return true;\n case SyntaxKind.AwaitExpression:\n return this.goAwaitedCallIsImplicitEndpoint(expr.expression);\n case SyntaxKind.CallExpression: {\n const name = this.goAstCalleeName(expr);\n if (name === undefined) {\n return false;\n }\n return GO_JSON_PARSE_CALLS.indexOf(name.replace(/^this\\./, '')) >= 0;\n }\n }\n return false;\n }\n\n // true when every value written into an `any` local is a non-pointer source: the\n // box holds a container, a scalar or nil, so IsEqual(x, nil) is exactly `x == nil`.\n // A write of any other shape in the enclosing function (D2 scan) keeps the helper\n goAnyLocalHoldsNonPointerCache = new Map();\n goAnyLocalHoldsNonPointer(decl): boolean {\n if (decl?.kind !== SyntaxKind.VariableDeclaration || decl.name?.kind !== SyntaxKind.Identifier) {\n return false;\n }\n if (this.goAnyLocalHoldsNonPointerCache.has(decl)) {\n return this.goAnyLocalHoldsNonPointerCache.get(decl);\n }\n let holds = !this.goAnyLocalHoldsPointer(decl) && this.goIsNonPointerValueSource(decl.initializer);\n if (holds) {\n const name = decl.name.text;\n const scope = this.goEnclosingFunction(decl);\n if (scope === undefined) {\n holds = false;\n } else {\n const visit = (n) => {\n if (!holds) { return; }\n // `[ a, b ] = …` writes a and b through GetValue(, i), so its\n // source is the right-hand side as well\n if (n.kind === SyntaxKind.BinaryExpression && n.operatorToken?.kind === SyntaxKind.EqualsToken\n && this.goAssignmentWritesName(n.left, name)\n && !this.goIsNonPointerValueSource(n.right)) {\n holds = false;\n return;\n }\n n.forEachChild(visit);\n };\n scope.forEachChild(visit);\n }\n }\n this.goAnyLocalHoldsNonPointerCache.set(decl, holds);\n return holds;\n }\n\n // true when this assignment target binds the named local: a plain identifier, or a\n // destructuring element (`[ a, b ] = …` prints GetValue(, i) writes)\n goAssignmentWritesName(left, name): boolean {\n if (left?.kind === SyntaxKind.Identifier) {\n return left.text === name;\n }\n if (left?.kind === SyntaxKind.ArrayLiteralExpression) {\n return left.elements.some((e) => (e?.kind === SyntaxKind.Identifier) && (e.text === name));\n }\n return false;\n }\n\n // the variable declaration an identifier resolves to, when it is one\n goAnyBoxLocalDeclaration(node): any {\n if (node?.kind !== SyntaxKind.Identifier) {\n return undefined;\n }\n const checker: any = this.checkerOrUndefined();\n if (checker === undefined) {\n return undefined;\n }\n const symbol = checker.getSymbolAtLocation(node);\n return symbol?.valueDeclaration?.resolve();\n }\n\n // true when this identifier is a parameter bound by `x := GetArg(optionalArgs, i, default)`:\n // GetArg runs derefScalar and folds a typed nil pointer (and nil []string/[]any) into the untyped\n // default, so the box holds a plain scalar or an untyped nil, never a nil *T.\n goGetArgBoundParameter(node): boolean {\n const decl = this.goAnyBoxLocalDeclaration(node);\n // a parameter without a default keeps the caller's value as-is in a plain `any`\n // parameter, where a *int64 handed over by another method stays a pointer\n if (decl?.kind !== SyntaxKind.Parameter || decl.initializer === undefined) {\n return false;\n }\n // only a method/function body binds its defaulted parameters with GetArg: an arrow\n // function's printed parameters carry no default binding at all\n const owner = decl.parent?.kind;\n if (owner !== SyntaxKind.MethodDeclaration && owner !== SyntaxKind.FunctionDeclaration\n && owner !== SyntaxKind.Constructor) {\n return false;\n }\n return !this.goParameterLaterWritesPointerBox(decl);\n }\n\n // D2 for a GetArg-bound parameter: a later `x = …` write whose printed value is a typed\n // pointer puts a nil *T back in the box, where IsEqual(x, nil) is true but `x == nil` is not\n goParameterLaterWritesPointerBox(decl): boolean {\n const name = (decl?.name?.kind === SyntaxKind.Identifier) ? decl.name.text : undefined;\n if (typeof name !== 'string') {\n return true; // a binding pattern: the write scan cannot follow it\n }\n const scope = this.goEnclosingFunction(decl);\n if (scope === undefined) {\n return true;\n }\n let pointerWrite = false;\n const visit = (n) => {\n if (pointerWrite) {\n return;\n }\n if (n.kind === SyntaxKind.BinaryExpression && n.operatorToken?.kind === SyntaxKind.EqualsToken\n && this.goAssignmentWritesName(n.left, name) && this.goWritePrintsPointerBox(n.right)) {\n pointerWrite = true;\n return;\n }\n n.forEachChild(visit);\n };\n scope.forEachChild(visit);\n return pointerWrite;\n }\n\n // true when the printed value of an assignment's right-hand side is a typed pointer: a\n // `this.safeX(…)`/`this.Parse8601(…)` accessor (GO_HELPER_RETURN_TYPES), an identifier the\n // printer declared `*T`, or a hand-written *sync.Map field. Read from the AST, never printed.\n goWritePrintsPointerBox(expr): boolean {\n expr = this.goUnwrapParenthesizedNode(expr);\n if (expr === undefined) {\n return false;\n }\n if (expr.kind === SyntaxKind.CallExpression) {\n const name = this.goAstCalleeName(expr);\n if (typeof name === 'string') {\n const goType = GO_HELPER_RETURN_TYPES[name];\n if ((typeof goType === 'string') && goType.startsWith('*')) {\n return true;\n }\n // the accessors the ccxt build pass wraps with DerefScalar but the Go type\n // table does not name (`this.NumberToString`, `this.Parse8601`, `this.Iso8601`)\n // return a pointer too, so their write stays unproven\n return GO_DEREF_WRAPPED_CALLS.indexOf(name.replace(/^this\\./, '')) >= 0;\n }\n return false;\n }\n if (expr.kind === SyntaxKind.Identifier) {\n const declared = this.goDeclaredTypeOfIdentifier(expr);\n return (typeof declared === 'string') && declared.startsWith('*');\n }\n if (expr.kind === SyntaxKind.PropertyAccessExpression && expr.expression?.kind === SyntaxKind.ThisKeyword) {\n const fieldType = GO_NILABLE_FIELDS_Typed['this.' + expr.name?.text];\n return (typeof fieldType === 'string') && GO_NIL_EQUIVALENT_POINTER_TYPES_Native.has(fieldType);\n }\n return false;\n }\n\n goScalarFamilyOfType(type, allowNil = false): string | undefined {\n if (type === undefined) {\n return undefined;\n }\n // Str/Int/Num/Bool are nullable aliases of `string | undefined` & friends;\n // their Go representation is still `any`, so they never inline — unless the\n // caller is asking about the value the `any` box holds (allowNil)\n const alias = type.getAliasSymbol()?.escapedName;\n if (!allowNil) {\n switch (alias) {\n case 'Str':\n case 'Int':\n case 'Num':\n case 'Bool':\n return undefined;\n }\n }\n const flags = type.flags;\n if (flags & TypeFlags.Union) {\n const families = new Set();\n for (const member of type.getTypes()) {\n const family = this.goScalarFamilyOfType(member, allowNil);\n if (family === undefined) {\n return undefined;\n }\n // `string | undefined` is `any` in Go, never a bare Go string:\n // one nullable member disqualifies the whole union\n if (family === 'nil') {\n if (allowNil) {\n continue; // the box holds nil for that member\n }\n return undefined;\n }\n families.add(family);\n }\n if (families.size !== 1) {\n return undefined; // `boolean` is `true | false`, so size === 1\n }\n return families.values().next().value;\n }\n if (flags & (TypeFlags.String | TypeFlags.StringLiteral)) {\n return 'string';\n }\n if (flags & (TypeFlags.Number | TypeFlags.NumberLiteral)) {\n return 'number';\n }\n if (flags & (TypeFlags.Boolean | TypeFlags.BooleanLiteral)) {\n return 'bool';\n }\n if (flags & (TypeFlags.Undefined | TypeFlags.Null | TypeFlags.Void)) {\n return 'nil';\n }\n return undefined;\n }\n\n // B-02: a parameter of a nullable ccxt alias (`Str`) prints as the native Go type (`*string`) only\n // when the method is internal (not async/override, no inherited member), every call site passes\n // that type (checker here, textual for siblings), and the body never writes another type (D2).\n goNativeParameterTypeCache = new Map();\n goSameFileCallCache = new Map>>();\n goTsSrcTreeCache = new Map();\n\n goNativeParameterType(param): string | undefined {\n if (param?.kind !== SyntaxKind.Parameter) {\n return undefined;\n }\n if (this.goNativeParameterTypeCache.has(param)) {\n return this.goNativeParameterTypeCache.get(param);\n }\n // the call-site proof prints argument expressions, which can land back here\n this.goNativeParameterTypeCache.set(param, undefined);\n const result = this.goNativeParameterTypeOf(param);\n this.goNativeParameterTypeCache.set(param, result);\n return result;\n }\n\n goNativeParameterTypeOf(param): string | undefined {\n if ((param.initializer !== undefined) || (param.dotDotDotToken !== undefined)) {\n return undefined; // optional/variadic parameters keep the optionalArgs ABI\n }\n if (param.name?.kind !== SyntaxKind.Identifier) {\n return undefined;\n }\n const fn: any = param.parent;\n if ((fn?.kind !== SyntaxKind.MethodDeclaration) || (fn.body === undefined) || (fn.name?.kind !== SyntaxKind.Identifier)) {\n return undefined;\n }\n const parseParam = fn.name.text.startsWith('parse');\n // D-03: a pro handler's frame parameter (`handleX (client: Client, message: Dict)`)\n // is the second family whose call-site proof can name a Go type\n const handlerParam = !parseParam && this.goIsProHandlerMethod(fn);\n if (this.goIsUnifiedStringParameter(fn.name.text, fn.parameters.indexOf(param))) {\n // the table types the base and every override together: a body that breaks it fails the build\n if ((this.goRequiredStringParameterType(param) !== 'string')\n || !this.goLocalIsSafeToType(fn.body, param, param.name.text, 'string')\n || !this.goParameterKeepsNilCompareNative(fn.body, param, 'string')) {\n throw new Error(`unifiedStringParams: ${fn.name.text} parameter ${param.name.text} is not a required string written only as string`);\n }\n return 'string';\n }\n if (this.goMethodKeepsBaseSignature(fn)) {\n return undefined; // inherited/base methods are pinned by the base class and IDerivedExchange\n }\n const index = fn.parameters.indexOf(param);\n if (!parseParam && !handlerParam) {\n // any other exchange-local method: only a non-nullable TS `string` becomes a Go `string`\n // at least one proven caller: an uncalled method's signature is outside API only by accident\n const goType = this.goRequiredStringParameterType(param);\n return ((goType !== undefined) && this.goHasTreeCallSite(fn) && this.goParameterCallSitesPassType(fn, index, goType)\n && this.goLocalIsSafeToType(fn.body, param, param.name.text, goType)\n && this.goParameterKeepsNilCompareNative(fn.body, param, goType)) ? goType : undefined;\n }\n if (this.isAsyncFunction(fn)) {\n return undefined;\n }\n for (const goType of this.goNativeParameterTypeCandidates(param, handlerParam)) {\n if (this.goParameterCallSitesPassType(fn, index, goType)\n && this.goLocalIsSafeToType(fn.body, param, param.name.text, goType)\n && this.goParameterKeepsNilCompareNative(fn.body, param, goType)) {\n return goType;\n }\n }\n return undefined;\n }\n\n goIsUnifiedStringParameter(methodName: string, index: number): boolean {\n const indexes = Object.prototype.hasOwnProperty.call(this.unifiedStringParams, methodName) ? this.unifiedStringParams[methodName] : undefined;\n return Array.isArray(indexes) && indexes.includes(index);\n }\n\n // the call arguments of a unified method whose parameter prints `string`: an argument the\n // printer cannot prove a Go string goes through StringArg, which panics on any other value\n goUnifiedStringCallArgs(node, identation, flat = false): string | undefined {\n const callee: any = node.expression;\n const name = (callee?.kind === SyntaxKind.PropertyAccessExpression) ? callee.name?.text : undefined;\n if ((typeof name !== 'string') || !Object.prototype.hasOwnProperty.call(this.unifiedStringParams, name)) {\n return undefined;\n }\n const args = node.arguments ?? [];\n if (args.some((a) => a.kind === SyntaxKind.SpreadElement)) {\n return undefined;\n }\n const depth = this.goExprDepth + ((args.length > 1) ? 1 : 0);\n return args.map((a, i) => {\n const printed = flat ? this.printNode(a, 0) : this.goWithExprDepth(depth, () => this.printNode(a, identation)).trim();\n if (!this.goIsUnifiedStringParameter(name, i) || (this.goPrintedArgType(a) === 'string')) {\n return printed;\n }\n return `StringArg(${printed})`;\n }).join(', ');\n }\n\n // `string` for a parameter whose declared TS type is string (or a string-literal union) with no\n // undefined/null member; a nullable one stays boxed here (callers pass *string or nil)\n goRequiredStringParameterType(param): string | undefined {\n const type = this.checkerOrUndefined()?.getTypeAtLocation(param);\n if (type === undefined) {\n return undefined;\n }\n const parts = ((typeof type.isUnionType === 'function') && type.isUnionType()) ? type.getTypes() : [type];\n return parts.every(p => (p.flags & (TypeFlags.String | TypeFlags.StringLiteral)) !== 0) ? 'string' : undefined;\n }\n\n // The boxed object parameter prints `x === undefined` as a native `x == nil`\n // (goObjectBoxParameter); a parameter the printer typed as a Go map/slice would fall\n // through to IsEqual(x, nil) instead. Both predicates answer false for every value a\n goParameterKeepsNilCompareNative(body, param, goType: string): boolean {\n if (goType === '*string') {\n return true;\n }\n const name = param.name.text;\n let keeps = true;\n const visit = (n) => {\n if (!keeps) {\n return;\n }\n if ((n.kind === SyntaxKind.Identifier) && (n.text === name)) {\n let symbol;\n try {\n symbol = this.getChecker().getSymbolAtLocation(n);\n } catch (e) {\n symbol = undefined;\n }\n const binary: any = n.parent;\n if ((symbol?.valueDeclaration?.resolve() === param) && (binary?.kind === SyntaxKind.BinaryExpression)\n && ((binary.left === n) || (binary.right === n))) {\n const op = binary.operatorToken?.kind;\n if ((op === SyntaxKind.EqualsEqualsToken) || (op === SyntaxKind.EqualsEqualsEqualsToken)\n || (op === SyntaxKind.ExclamationEqualsToken) || (op === SyntaxKind.ExclamationEqualsEqualsToken)) {\n const other: any = (binary.left === n) ? binary.right : binary.left;\n if ((other?.kind === SyntaxKind.NullKeyword)\n || ((other?.kind === SyntaxKind.Identifier) && (other.text === 'undefined'))) {\n keeps = false;\n return;\n }\n }\n }\n }\n n.forEachChild(visit);\n };\n body.forEachChild(visit);\n return keeps;\n }\n\n // ---- D-03: pro handler frame parameters ------------------------------------\n // A `handle*` method of a pro exchange class receives the raw frame from the WS\n // client. When the checker types that parameter as `Dict`, and every call site\n goIsProHandlerMethod(fn): boolean {\n // the main-thread transpile registers the file relative to the repo root\n // (ts/src/pro/.ts) while the batch registers it absolute, so accept both\n const fileName = String(fn.getSourceFile().fileName ?? '');\n if (!(/(^|[\\\\/])ts[\\\\/]src[\\\\/]pro[\\\\/]/.test(fileName))) {\n return false;\n }\n const name = fn.name.text;\n return (name.length > 6) && name.startsWith('handle') && (name[6] === name[6].toUpperCase());\n }\n\n // `Dict` is the checker's structural `{[key: string]: any}`: a string index\n // signature is the proof. Class instances (OrderBook, ArrayCache*, Client, Future),\n // named-member interfaces (Market, Order, Ticker) and arrays carry none of them, so\n goParameterTypeIsDict(type): boolean {\n try {\n return (typeof type.getStringIndexType === 'function') && (type.getStringIndexType() !== undefined);\n } catch (e) {\n return false;\n }\n }\n\n // the Go types the declared TypeScript type can carry. `Dict`/`Market`/`Currency`\n // and the other dict-shaped object types print as the `map[string]any` the Go side\n // builds them from, `List` (= any[]) as its `[]any`; pro `handle*` frames (isHandler)\n goNativeParameterTypeCandidates(param, isHandler = false): string[] {\n const checker: any = this.checkerOrUndefined();\n const type = checker?.getTypeAtLocation(param);\n if (type === undefined) {\n return [];\n }\n let parts = ((typeof type.isUnionType === 'function') && type.isUnionType()) ? type.getTypes().slice() : [type];\n parts = parts.filter(p => !(p.flags & (TypeFlags.Undefined | TypeFlags.Null)));\n if (parts.length !== 1) {\n return [];\n }\n const inner: any = parts[0];\n if (inner.flags & TypeFlags.String) {\n return isHandler ? [] : ['*string'];\n }\n if (isHandler && this.goParameterTypeIsDict(inner)) {\n return ['map[string]any'];\n }\n if (!(inner.flags & TypeFlags.Object)) {\n return [];\n }\n if (checker.isArrayType(inner)) {\n // List / any[]: the element must itself be `any`, or the Go slice would need\n // the narrower element type (`string[]` is a []string the printer does not build)\n const element = checker.getIndexTypeOfType(inner, IndexKind.Number);\n return ((element !== undefined) && (element.flags & (TypeFlags.Any | TypeFlags.Unknown))) ? ['[]any'] : [];\n }\n // Dict / Market / Currency / a structure interface: a plain Go dictionary, never a\n // class instance or a function (goTypeIsNilComparableObject is the printer's own\n // test for exactly those types, used for the boxed nil test above)\n return this.goTypeIsNilComparableObject(inner) ? ['map[string]any'] : [];\n }\n\n // true when the method overrides (or shadows) a member of the class it extends, or carries an\n // explicit `override`: those print the base signature so the generated base classes and\n // IDerivedExchange keep compiling. The abstract base (ts/src/base/**) is never retyped.\n goMethodKeepsBaseSignature(fn): boolean {\n if ((fn.modifiers ?? []).some(m => m.kind === SyntaxKind.OverrideKeyword)) {\n return true;\n }\n if (/(^|\\/)ts\\/src\\/base\\//.test(fn.getSourceFile().fileName)) {\n return true;\n }\n const name = fn.name.text;\n const cls = this.goEnclosingClass(fn);\n if (cls === undefined) {\n return true;\n }\n const extendsClauses = (cls.heritageClauses ?? []).filter(clause => clause.token === SyntaxKind.ExtendsKeyword);\n if (extendsClauses.length === 0) {\n return true; // a root class: the abstract base of the generated tree\n }\n for (const clause of extendsClauses) {\n for (const expr of (clause.types ?? [])) {\n const checker: any = this.checkerOrUndefined();\n const baseType = checker.getTypeAtLocation(expr);\n if (baseType?.getProperty?.(name) !== undefined) {\n return true;\n }\n }\n }\n return false;\n }\n\n goHasTreeCallSite(fn): boolean {\n const name = fn.name.text;\n if (this.goSameFileCallsOf(fn, name).length > 0) {\n return true;\n }\n const tree = this.goTsSrcTree(fn.getSourceFile());\n const myClass = this.goEnclosingClassName(fn);\n return (tree?.callIndex.get(name) ?? []).some(site => this.goTsSrcFileDerivesFrom(tree, site.file, myClass));\n }\n\n // every call site of `fn` in the whole tree must pass exactly `goType` at `index`\n goParameterCallSitesPassType(fn, index: number, goType: string): boolean {\n const name = fn.name.text;\n for (const call of this.goSameFileCallsOf(fn, name)) {\n const arg = call.arguments?.[index];\n if ((arg === undefined) || (arg.kind === SyntaxKind.SpreadElement)) {\n return false;\n }\n if (this.goPrintedArgType(arg) !== goType) {\n return false;\n }\n }\n const tree = this.goTsSrcTree(fn.getSourceFile());\n if (tree !== undefined) {\n const myClass = this.goEnclosingClassName(fn);\n const myFile = tree.relativeOf.get(path.resolve(fn.getSourceFile().fileName));\n for (const site of (tree.callIndex.get(name) ?? [])) {\n if (site.file === myFile) {\n continue; // proven above off the checker\n }\n if (!this.goTsSrcFileDerivesFrom(tree, site.file, myClass)) {\n continue; // a same-named method of another exchange\n }\n const arg = site.args[index];\n if ((arg === undefined) || !this.goTextArgMatchesType(arg, goType, site.file, tree)) {\n return false;\n }\n }\n }\n return true;\n }\n\n goEnclosingClass(fn) {\n let cls = fn.parent;\n while ((cls !== undefined) && (cls.kind !== SyntaxKind.ClassDeclaration) && (cls.kind !== SyntaxKind.ClassExpression)) {\n cls = cls.parent;\n }\n return cls;\n }\n\n goEnclosingClassName(fn): string | undefined {\n const cls = this.goEnclosingClass(fn);\n return (cls?.name?.kind === SyntaxKind.Identifier) ? cls.name.text : undefined;\n }\n\n // the printed Go type of a call-site argument, or undefined when the printer\n // cannot name it (then the call site does not prove anything)\n goPrintedArgType(arg): string | undefined {\n if (arg.kind === SyntaxKind.Identifier) {\n return this.goDeclaredTypeOfIdentifier(arg);\n }\n return this.goTypeOfInitializer(arg, this.printNode(arg, 0));\n }\n\n // every `this.(...)` of this file whose resolved signature is `fn`\n goSameFileCallsOf(fn, name: string): Array {\n const file = fn.getSourceFile();\n let index = this.goSameFileCallCache.get(file);\n if (index === undefined) {\n index = new Map>();\n const visit = (node) => {\n if (node.kind === SyntaxKind.CallExpression) {\n const callee: any = node.expression;\n const calleeName = (callee?.kind === SyntaxKind.PropertyAccessExpression) ? callee.name?.text : undefined;\n if (typeof calleeName === 'string') {\n const list = index.get(calleeName) ?? [];\n list.push(node);\n index.set(calleeName, list);\n }\n }\n node.forEachChild(visit);\n };\n visit(file);\n this.goSameFileCallCache.set(file, index);\n }\n const checker = this.getChecker();\n const result = [];\n for (const call of (index.get(name) ?? [])) {\n let declaration;\n try {\n declaration = checker.getResolvedSignature(call)?.declaration?.resolve();\n } catch (e) {\n declaration = undefined;\n }\n if (declaration === fn) {\n result.push(call);\n }\n }\n return result;\n }\n\n // Lazily read the ts/src tree this file belongs to: the call sites of every\n // `this.x(...)`, each file's text and its class -> base map. A scoped run's\n // program holds one exchange, so the sibling files are only provable textually.\n goTsSrcTree(file): any {\n // drivers pass relative names (`ts/src/x.ts`): resolve so the marker and relativeOf match\n const fileName: string = path.resolve(file.fileName);\n const marker = '/ts/src/';\n const at = fileName.lastIndexOf(marker);\n if (at < 0) {\n return undefined; // in-memory source (tests): no sibling files to prove\n }\n const root = fileName.substring(0, at + marker.length - 1);\n if (!this.goTsSrcTreeCache.has(root)) {\n this.goTsSrcTreeCache.set(root, this.goTsSrcTreeBuild(root));\n }\n return this.goTsSrcTreeCache.get(root);\n }\n\n goTsSrcTreeBuild(root: string) {\n const callIndex = new Map>();\n const fileText = new Map();\n const classBases = new Map();\n const relativeOf = new Map();\n const walk = (dir: string, rel: string) => {\n let entries;\n try {\n entries = fs.readdirSync(dir, { withFileTypes: true });\n } catch (e) {\n return;\n }\n for (const entry of entries) {\n if (entry.isDirectory()) {\n if (entry.name !== 'node_modules') {\n walk(path.join(dir, entry.name), rel + entry.name + '/');\n }\n continue;\n }\n if (!entry.name.endsWith('.ts') || entry.name.endsWith('.d.ts')) {\n continue;\n }\n const relPath = rel + entry.name;\n let text;\n try {\n text = fs.readFileSync(path.join(dir, entry.name), 'utf8');\n } catch (e) {\n continue;\n }\n fileText.set(relPath, text);\n relativeOf.set(path.join(dir, entry.name), relPath);\n const classRe = /\\bclass\\s+([A-Za-z_$][\\w$]*)\\s+extends\\s+([A-Za-z_$][\\w$]*)/g;\n let match;\n while ((match = classRe.exec(text)) !== null) {\n classBases.set(match[1], match[2]);\n }\n const callRe = /this\\s*\\.\\s*([A-Za-z_$][\\w$]*)\\s*\\(/g;\n while ((match = callRe.exec(text)) !== null) {\n const args = goBalancedCallArgs(text, callRe.lastIndex - 1);\n if (args === undefined) {\n continue;\n }\n const list = callIndex.get(match[1]) ?? [];\n list.push({ file: relPath, args });\n callIndex.set(match[1], list);\n }\n }\n };\n walk(root, '');\n return { callIndex, fileText, classBases, relativeOf };\n }\n\n goTsSrcFileDerivesFrom(tree, file: string, className: string | undefined): boolean {\n if (className === undefined) {\n return true; // unknown owner: keep the reference inside the proof\n }\n const text = tree.fileText.get(file);\n if (text === undefined) {\n return true;\n }\n const classRe = /\\bclass\\s+([A-Za-z_$][\\w$]*)/g;\n let match;\n while ((match = classRe.exec(text)) !== null) {\n let current: string | undefined = match[1];\n for (let hops = 0; (hops < 12) && (current !== undefined); hops++) {\n if (current === className) {\n return true;\n }\n current = tree.classBases.get(current);\n }\n }\n return false;\n }\n\n // the textual call-site proof. `*string` is the only pointer-shaped native type\n // with siblings the printer can name from text; a map/slice parameter is proven for\n // the argument shapes whose printed Go form IS that type: the object/array literals\n goTextArgMatchesType(argText: string, goType: string, file: string, tree): boolean {\n let text = (argText ?? '').trim();\n while (text.startsWith('(') && text.endsWith(')')) {\n text = text.substring(1, text.length - 1).trim();\n }\n const isStringProducer = (candidate: string) => GO_TS_SRC_STRING_PRODUCERS.some(rx => rx.test(candidate));\n const localDeclaredFrom = (name: string, accept: (init: string) => boolean) => {\n const fileText = tree.fileText.get(file) ?? '';\n const declRe = new RegExp('(?:const|let|var)\\\\s+' + name + '\\\\s*(?::[^=]*)?=\\\\s*([^;\\\\n]+)');\n const match = declRe.exec(fileText);\n return (match !== null) && accept(match[1].trim());\n };\n if (goType === 'string') {\n return /^(?:'[^'\\\\]*'|\"[^\"\\\\]*\")$/.test(text); // a sibling file proves only a plain literal\n }\n if (goType === '*string') {\n if (isStringProducer(text)) {\n return true;\n }\n const identifier = /^([A-Za-z_$][\\w$]*)$/.exec(text);\n if (identifier !== null) {\n return localDeclaredFrom(identifier[1], isStringProducer);\n }\n }\n if ((goType === 'map[string]any') || (goType === '[]any')) {\n // Only the argument shapes whose printed Go form IS this map/slice: the\n // matching literal and the printer's own map producers. An identifier is\n // deliberately not proven here: this proof reads one file's text, so it\n const isMap = goType === 'map[string]any';\n const literal = isMap ? '{' : '[';\n const producers = isMap ? GO_TS_SRC_MAP_PRODUCERS : [];\n return text.startsWith(literal) || producers.some(rx => rx.test(text));\n }\n return false;\n }\n\n // the Go type this identifier is actually *declared* with, or undefined when it\n // stays `any`. It goes through getGoLocalType, not goTypeOfInitializer, so a\n // declaration the reject filters demoted back to `any` is reported as `any` here\n // too — otherwise we would emit `*x` against an `any` box.\n // A parameter resolves to its declared Go type only when goNativeParameterType\n // proved it (see the B-02 block above); everything else stays `any`.\n //\n // getGoLocalType re-prints every reassignment's right-hand side, and printing a\n // ternary re-enters printCondition, which lands back here: `x = (x === 'a') ? …`\n // would recurse forever. The in-progress set breaks that cycle by answering\n // `any` for the declaration currently being classified, and the cache keeps the\n // per-occurrence cost at one scope scan per declaration.\n goDeclaredTypeCache = new Map();\n goDeclaredTypeInProgress = new Set();\n\n goDeclaredTypeOfIdentifier(node): string | undefined {\n if (node?.kind !== SyntaxKind.Identifier) {\n return undefined;\n }\n const decl: any = this.checkerOrUndefined()?.getSymbolAtLocation(node)?.valueDeclaration?.resolve();\n if (decl === undefined) {\n return undefined;\n }\n if (decl.kind === SyntaxKind.Parameter) {\n // a defaulted parameter bound through a pointer GetArg twin is that pointer at every consumer\n const bound = this.goGetArgParameterType(decl);\n if ((bound !== undefined) && bound.startsWith('*')) {\n return bound;\n }\n // B-02: a parameter the call-site proof typed prints its native Go type\n return this.goNativeParameterType(decl);\n }\n if (decl.kind !== SyntaxKind.VariableDeclaration || decl.initializer === undefined || decl.name?.kind !== SyntaxKind.Identifier) {\n return undefined;\n }\n if (this.goDeclaredTypeCache.has(decl)) {\n return this.goDeclaredTypeCache.get(decl);\n }\n if (this.goDeclaredTypeInProgress.has(decl)) {\n return undefined;\n }\n this.goDeclaredTypeInProgress.add(decl);\n let goType;\n try {\n goType = this.getGoLocalType(decl, this.printNode(decl.initializer, 0));\n } finally {\n this.goDeclaredTypeInProgress.delete(decl);\n }\n const result = (goType === 'any') ? undefined : goType;\n this.goDeclaredTypeCache.set(decl, result);\n return result;\n }\n\n // true when this identifier's Go type is a pointer we can deref (*string / *int64 / …)\n goIsPointerIdentifier(node): boolean {\n const goType = this.goDeclaredTypeOfIdentifier(node);\n return (typeof goType === 'string') && goType.startsWith('*');\n }\n\n // the Go pointer type an *expression* evaluates to, or undefined. Covers both a\n // local declared `var x *string = …` and a direct `this.SafeString(...)` call,\n // whose Go signature returns a pointer even though TypeScript says `string`.\n goPointerTypeOfExpression(node, printedText: string): string | undefined {\n const declared = this.goDeclaredTypeOfIdentifier(node);\n if ((typeof declared === 'string') && declared.startsWith('*')) {\n return declared;\n }\n // a hand-written BaseExchange field, e.g. `this.Markets`: its Go type is the one\n // go/v4/exchange.go declares, and the helpers turn a nil one into a nil\n if (node?.kind === SyntaxKind.PropertyAccessExpression) {\n const fieldType = GO_NILABLE_FIELDS_Typed[printedText];\n if ((typeof fieldType === 'string') && GO_NIL_EQUIVALENT_POINTER_TYPES_Native.has(fieldType)) {\n return fieldType;\n }\n }\n if (node?.kind === SyntaxKind.CallExpression) {\n const goType = this.goTypeOfInitializer(node, printedText);\n if ((typeof goType === 'string') && goType.startsWith('*')) {\n return goType;\n }\n }\n return undefined;\n }\n\n // the concrete Go type a `x[k] = v` receiver is declared with, when the printer\n // can name it: a local it typed itself, or a whole call whose Go return type it\n // knows. Everything else is an `any` box, and indexing an `any` in Go needs a\n // type assertion, so those keep the runtime helper.\n goElementAssignmentContainerType(node, printedText: string): string | undefined {\n const declared = this.goDeclaredTypeOfIdentifier(node);\n if ((declared === 'map[string]any') || (declared === '[]any')) {\n return declared;\n }\n if (node?.kind === SyntaxKind.CallExpression) {\n const known = this.goTypeOfInitializer(node, printedText);\n if ((known === 'map[string]any') || (known === '[]any')) {\n return known;\n }\n }\n return undefined;\n }\n\n // the Go container type of a hand-written `this.` receiver, undefined for every other\n // shape. Generated structs embed BaseExchange, so `this.` is the only property access the\n // field table types — a local or parameter of the same name is a different declaration.\n goFieldContainerTypeNative(node): string | undefined {\n if ((node?.kind !== SyntaxKind.PropertyAccessExpression) || (node.expression?.kind !== SyntaxKind.ThisKeyword)) {\n return undefined;\n }\n const name = node.name?.text;\n if (typeof name !== 'string') {\n return undefined;\n }\n return GO_FIELD_CONTAINER_TYPES_NATIVE[this.transformPropertyAccessExpressionName(name, node.name)];\n }\n\n // the printed key is a Go string when the printer knows it: a string literal, or\n // an identifier declared `string`. Params, GetValue(...) and string concatenation\n // all print as `any`, which Go refuses as a map key.\n goIsStringKeyExpression(node): boolean {\n if ((node.kind === SyntaxKind.StringLiteral) || (node.kind === SyntaxKind.NoSubstitutionTemplateLiteral)) {\n return true;\n }\n return this.goDeclaredTypeOfIdentifier(node) === 'string';\n }\n\n // `[]any` receivers only inline when the index is a literal the slice's own\n // literal initializer covers and nothing rebinds the local: the helper silently\n // ignores an out-of-range index, while Go panics on the assignment.\n goSliceIndexProvablyInRange(node, indexNode): boolean {\n if ((node?.kind !== SyntaxKind.Identifier) || (indexNode?.kind !== SyntaxKind.NumericLiteral)) {\n return false;\n }\n const index = Number(indexNode.text);\n if (!Number.isInteger(index) || (index < 0)) {\n return false;\n }\n const decl: any = this.checkerOrUndefined()?.getSymbolAtLocation(node)?.valueDeclaration?.resolve();\n if (decl === undefined || decl.kind !== SyntaxKind.VariableDeclaration || decl.name?.kind !== SyntaxKind.Identifier) {\n return false;\n }\n const initializer = decl.initializer;\n if ((initializer?.kind !== SyntaxKind.ArrayLiteralExpression) || (initializer.elements.length <= index)) {\n return false;\n }\n return !this.goLocalIsRebound(this.goEnclosingFunction(decl), decl.name);\n }\n\n // true when the local is rebound anywhere in its function; an element write\n // (`x[k] = v`) leaves the local itself bound, so only the slice header is at stake\n goLocalIsRebound(scope, nameNode): boolean {\n if (scope === undefined) {\n return true;\n }\n const name = nameNode.text;\n let rebound = false;\n const visit = (n) => {\n if (rebound) {\n return;\n }\n if ((n.kind === SyntaxKind.Identifier) && (n.text === name) && (n !== nameNode)) {\n if (this.goRebindingTargetOf(n) !== undefined) {\n rebound = true;\n return;\n }\n }\n n.forEachChild(visit);\n };\n visit(scope);\n return rebound;\n }\n\n // walks up from the identifier to the assignment it targets: `x = …` / `x += …` /\n // `[x, y] = …` / `for (x of …)` rebind the local, `x[k] = v` does not\n goRebindingTargetOf(identifier) {\n let node: any = identifier;\n let parent = node.parent;\n while (parent?.kind === SyntaxKind.ArrayLiteralExpression) {\n node = parent;\n parent = parent.parent;\n }\n if ((parent?.kind === SyntaxKind.ForOfStatement) && (parent.initializer === node)) {\n return parent;\n }\n if ((parent?.kind === SyntaxKind.BinaryExpression) && (parent.left === node)) {\n const op = parent.operatorToken.kind;\n if ((op === SyntaxKind.EqualsToken) || ((op >= SyntaxKind.FirstCompoundAssignment) && (op <= SyntaxKind.LastCompoundAssignment))) {\n return parent;\n }\n }\n return undefined;\n }\n\n // native `container[key] = value` when the receiver's Go type is proved by the\n // printer, otherwise undefined and the caller keeps the runtime helper\n printNativeElementAssignment(containerNode, containerStr: string, keyNode, keyStr: string, valueStr: string, compound = false, valueNode?): string | undefined {\n const containerType = this.goElementAssignmentContainerType(containerNode, containerStr);\n const fieldType = this.goFieldContainerTypeNative(containerNode);\n if ((fieldType !== undefined) || (containerType === 'map[string]any')) {\n if (!this.goIsStringKeyExpression(keyNode)) {\n return this.printNativeGuardedPointerKeyAssignment(containerNode, containerStr, containerType, fieldType, keyNode, keyStr, valueStr, compound, valueNode);\n }\n if (fieldType === '*sync.Map') {\n // a `+=` reads the element back through `container[key]`, which a\n // sync.Map has no operator for: that shape keeps the runtime helper\n return compound ? undefined : `${containerStr}.Store(${keyStr}, ${valueStr})`;\n }\n return `${containerStr}[${keyStr}] = ${valueStr}`;\n }\n if ((containerType === '[]any') && this.goSliceIndexProvablyInRange(containerNode, keyNode)) {\n return `${containerStr}[${keyStr}] = ${valueStr}`;\n }\n return undefined;\n }\n\n // `m[*k] = v` for a fresh unshared map local, a nil-guarded *string key and a\n // non-pointer value: exactly the helper's map branch minus its lock and derefs\n printNativeGuardedPointerKeyAssignment(containerNode, containerStr: string, containerType, fieldType, keyNode, keyStr: string, valueStr: string, compound: boolean, valueNode): string | undefined {\n if (compound || (fieldType !== undefined) || (containerType !== 'map[string]any') || (valueNode === undefined)) {\n return undefined;\n }\n if (this.goIsNilGuardedStringPointerKey(keyNode) && this.goIsFreshUnsharedMapLocal(containerNode, containerNode) && this.goIsNonPointerValue(valueNode)) {\n return `${containerStr}[*${keyStr}] = ${valueStr}`;\n }\n return undefined;\n }\n\n // a `*string` local the enclosing control flow proves non-nil: the helper's deref\n // yields the same string key (a nil key would have made it a no-op)\n goIsNilGuardedStringPointerKey(keyNode): boolean {\n return (keyNode?.kind === SyntaxKind.Identifier) && (this.goDeclaredTypeOfIdentifier(keyNode) === '*string')\n && this.goHasEnclosingNilGuard(keyNode);\n }\n\n // a local bound once to an object literal, never read by a nested function and not handed\n // out (anything but `m[k]`) before this write: no other goroutine can hold the map yet\n goIsFreshUnsharedMapLocal(node, writeSite): boolean {\n if (node?.kind !== SyntaxKind.Identifier) {\n return false;\n }\n const decl: any = this.checkerOrUndefined()?.getSymbolAtLocation(node)?.valueDeclaration?.resolve();\n if ((decl?.kind !== SyntaxKind.VariableDeclaration) || (decl.name?.kind !== SyntaxKind.Identifier)\n || (decl.initializer?.kind !== SyntaxKind.ObjectLiteralExpression)) {\n return false;\n }\n const scope = this.goEnclosingFunction(decl);\n if ((scope === undefined) || (scope.kind === SyntaxKind.SourceFile) || this.goLocalIsRebound(scope, decl.name)) {\n return false;\n }\n const symbol = this.checkerOrUndefined()?.getSymbolAtLocation(decl.name);\n let captured = false;\n const visit = (n, nested: boolean) => {\n if (captured) {\n return;\n }\n if ((n.kind === SyntaxKind.Identifier) && (n !== decl.name) && (n.text === decl.name.text)\n && (this.checkerOrUndefined()?.getSymbolAtLocation(n) === symbol)) {\n const receiver = (n.parent?.kind === SyntaxKind.ElementAccessExpression) && (n.parent.expression === n);\n if (nested || (!receiver && this.goUseMayPrecede(n, writeSite, scope))) {\n captured = true;\n }\n return;\n }\n const inner = nested || isFunctionLike(n);\n n.forEachChild((c) => visit(c, inner));\n };\n scope.forEachChild((c) => visit(c, false));\n return !captured;\n }\n\n // the use runs before the write: earlier in the text, or both inside one loop body\n goUseMayPrecede(use, writeSite, scope): boolean {\n if (use.pos < writeSite.pos) {\n return true;\n }\n for (let n = writeSite.parent; (n !== undefined) && (n !== scope); n = n.parent) {\n if (GO_ITERATION_STATEMENT_KINDS.has(n.kind) && (use.pos >= n.pos) && (use.end <= n.end)) {\n return true;\n }\n }\n return false;\n }\n\n // the value's printed Go type is concrete and not a pointer, so the helper's derefScalar\n // leaves it unchanged; an `any` box or a pointer keeps the helper\n goIsNonPointerValue(valueNode): boolean {\n const inner = this.goUnwrapParenthesizedNode(valueNode);\n switch (inner?.kind) {\n case SyntaxKind.StringLiteral:\n case SyntaxKind.NoSubstitutionTemplateLiteral:\n case SyntaxKind.TrueKeyword:\n case SyntaxKind.FalseKeyword:\n case SyntaxKind.ObjectLiteralExpression:\n case SyntaxKind.ArrayLiteralExpression:\n return true;\n }\n if (inner === undefined) {\n return false;\n }\n const goType = this.goPrintedTypeOfExpression(inner, this.printNode(inner, 0));\n return (typeof goType === 'string') && (goType !== 'any') && !goType.startsWith('*');\n }\n\n // the concrete Go type an *expression* is printed as: a local's declared type,\n // the return type of a runtime helper call, or a literal. undefined when the value\n // stays inside an `any` box — a native Go operation on an `any` box would not\n // compile, so every rule below falls back to its helper in that case.\n goPrintedTypeOfExpression(node, printedText: string): string | undefined {\n const inner = (node?.kind === SyntaxKind.ParenthesizedExpression) ? node.expression : node;\n if (inner?.kind === SyntaxKind.Identifier) {\n return this.goDeclaredTypeOfIdentifier(inner);\n }\n return this.goTypeOfInitializer(inner, printedText);\n }\n\n // `x.length` on a value the printer declares as a slice is `len(x)`: Go's len is\n // 0 for a nil slice, exactly like GetArrayLength's `[]T` cases. On a map or an\n // `any` box GetArrayLength answers 0, so only a `[]`-typed value may inline —\n // and only for the slice types the helper itself counts (a []byte would answer 0).\n sliceLengthTypes = [ '[]any', '[]string', '[]int64', '[]float64', '[]bool', '[]int', '[][]any', '[]map[string]any' ];\n\n // hand-written BaseExchange fields (go/v4/exchange.go) whose Go type is one of the\n // slice types above: the struct value is never a nil pointer and len(field) is the\n // very value the helper's type switch returns for it.\n GO_NATIVE_LENGTH_FIELDS = [ 'Symbols' ];\n\n printInlineArrayLength(expression, printedText: string, lengthNode?): string | undefined {\n if (printedText.includes('\\n')) {\n return undefined;\n }\n const goType = this.goPrintedTypeOfExpression(expression, printedText);\n if ((typeof goType === 'string') && this.sliceLengthTypes.indexOf(goType) >= 0) {\n return `len(${printedText})`;\n }\n if (this.goLengthFeedsArithmeticClassifier(lengthNode)) {\n return undefined;\n }\n // a Go `string` counts its bytes in both helpers (GetLength's reflect.String\n // case, GetArrayLength's `case string`), and neither helper's nil/`any` branch\n // is reachable for it; a *string / any box keeps the helper it prints today\n if ((goType === 'string') || (this.goNativeLengthFieldType(printedText) !== undefined)) {\n return `len(${printedText})`;\n }\n return undefined;\n }\n\n // the hand-written struct type of a `this.` read, for fields declared as a slice the\n // length helpers count. Any other type (map / *sync.Map / interface{}) keeps the helper:\n // GetArrayLength answers 0 for those, while len would answer the real count.\n goNativeLengthFieldType(printedText: string): string | undefined {\n const match = /^this\\.([A-Za-z_]\\w*)$/.exec(this.goUnwrapPrintedParens(printedText));\n if (match === null || this.GO_NATIVE_LENGTH_FIELDS.indexOf(match[1]) < 0) {\n return undefined;\n }\n return '[]string';\n }\n\n // true when the `.length` sits inside a `-`, `*`, `/` or `%` chain. The ccxt-side classifier\n // (build/go-local-types.js, CCXT_GO_INT_OPERAND_CALLEES) names `GetArrayLength(`/`GetLength(` an\n // `int` operand, so inlining `len` would declassify the chain's int64 local and `.(int64)` unbox.\n goLengthFeedsArithmeticClassifier(lengthNode): boolean {\n let current = lengthNode?.parent;\n for (let i = 0; (i < 16) && (current !== undefined); i++) {\n if (current.kind === SyntaxKind.BinaryExpression) {\n const op = current.operatorToken?.kind;\n if ((op === SyntaxKind.MinusToken) || (op === SyntaxKind.AsteriskToken)\n || (op === SyntaxKind.SlashToken) || (op === SyntaxKind.PercentToken)) {\n return true;\n }\n }\n switch (current.kind) {\n case SyntaxKind.ExpressionStatement:\n case SyntaxKind.VariableStatement:\n case SyntaxKind.ReturnStatement:\n case SyntaxKind.IfStatement:\n case SyntaxKind.Block:\n case SyntaxKind.ForStatement:\n case SyntaxKind.WhileStatement:\n case SyntaxKind.MethodDeclaration:\n case SyntaxKind.FunctionDeclaration:\n case SyntaxKind.ArrowFunction:\n return false;\n }\n current = current.parent;\n }\n return false;\n }\n\n // Go has no ternary operator. The func literal returns the same branch value the\n // helper would and prints the condition the same way; it evaluates only the branch\n // TypeScript would take, while Ternary receives both already evaluated. Both arms\n // printing as one and the same Go scalar names it (`func() string`), so the literal\n // carries the value itself instead of an `any` box.\n printInlineTernary(condition: string, whenTrue: string, whenFalse: string, resultType: string = undefined): string | undefined {\n if (condition.includes('\\n')) {\n return undefined;\n }\n // go/printer never keeps a func literal whose body holds an `if` on one line, and\n // controlClause() strips the parentheses around the `if` condition; the body sits one\n // level below the statement the literal belongs to, `}()` at the statement's level\n const level = this.goStatementLevel;\n const body = this.getIden(level + 1);\n const branch = this.getIden(level + 2);\n return `func() ${resultType ?? 'any'} {\\n${body}if ${this.goStripControlClauseParens(condition)} {\\n${branch}return ${whenTrue}\\n${body}}\\n${body}return ${whenFalse}\\n${this.getIden(level)}}()`;\n }\n\n // the Go scalar an arm already prints a VALUE of, or undefined while the arm is an `any` box.\n // Only the printed text counts: a literal, a local declared with that type, or a call whose Go\n // signature returns it. A classifier-named box (`Subtract(...)`) cannot be carried by `return`.\n goTernaryArmType(node, printedText: string): string | undefined {\n const text = this.goUnwrapPrintedParens(printedText);\n const inner = (node?.kind === SyntaxKind.ParenthesizedExpression) ? node.expression : node;\n switch (inner?.kind) {\n case SyntaxKind.StringLiteral:\n case SyntaxKind.NoSubstitutionTemplateLiteral:\n return 'string';\n case SyntaxKind.TrueKeyword:\n case SyntaxKind.FalseKeyword:\n return 'bool';\n case SyntaxKind.NumericLiteral:\n // an integer literal is an untyped constant of Go default type `int`; a\n // fraction/exponent makes it a float64 constant\n if (/^[0-9]+$/.test(inner.text)) {\n return 'int';\n }\n return (/^[0-9]*\\.[0-9]+([eE][+-]?[0-9]+)?$/.test(inner.text) || /^[0-9]+[eE][+-]?[0-9]+$/.test(inner.text)) ? 'float64' : undefined;\n case SyntaxKind.Identifier:\n return this.goLocalStaticType(inner); // declared `var x T = …` (never `:=`)\n }\n // a nested ternary prints the printer's own typed literal, whose return type is\n // the arm's type as well\n const literalType = goFuncLiteralReturnType(text);\n if (literalType !== undefined) {\n return literalType;\n }\n const open = text.indexOf('(');\n if (open <= 0 || !this.isWholePrintedCall(text, open)) {\n return undefined;\n }\n const goType = GO_HELPER_RETURN_TYPES[text.substring(0, open)];\n return ((goType === undefined) || goType.startsWith('*')) ? undefined : goType;\n }\n\n // the one Go scalar both arms print as, or undefined when the literal keeps the `any`\n // box: only GO_TYPE_NAMES are nameable, and a pointer/`any` arm (or two different\n // types) is not a type the literal could return\n goTernaryResultType(whenTrueNode, whenTrue: string, whenFalseNode, whenFalse: string): string | undefined {\n const whenTrueType = this.goTernaryArmType(whenTrueNode, whenTrue);\n if ((typeof whenTrueType !== 'string') || (whenTrueType === 'any') || (GO_TYPE_NAMES.indexOf(whenTrueType) < 0)) {\n return undefined;\n }\n return (this.goTernaryArmType(whenFalseNode, whenFalse) === whenTrueType) ? whenTrueType : undefined;\n }\n\n // stripParens() applied to a printed condition text (see goControlClauseParens)\n goStripControlClauseParens(text: string): string {\n for (;;) {\n const inner = this.goEnclosedExpression(text);\n if (inner === undefined) {\n return text;\n }\n text = inner;\n }\n }\n\n // a multi-line branch (a nested ternary, a composite literal) is laid out relative to\n // the `return` statement that holds it: inside the `if` for whenTrue (two levels below\n // the statement), the literal's body for whenFalse (one level)\n goPrintTernaryBranch(node, levels: number) {\n const previousLevel = this.goStatementLevel;\n this.goStatementLevel = previousLevel + levels;\n try {\n return this.goWithExprDepth(1, () => this.printNode(node, 0));\n } finally {\n this.goStatementLevel = previousLevel;\n }\n }\n\n // `key in obj` on a Go map[string]any with a Go string key: the two-value read is a statement,\n // hence the func literal; present-but-nil is ok=true like InOp. A `*string` key derefs, nil\n // answering false. InOp also covers nil/number keys and sync.Map/orderbook receivers: else keep it.\n printInlineInOp(dictNode, keyNode, dictText: string, keyText: string): string | undefined {\n if (dictText.includes('\\n') || keyText.includes('\\n')) {\n return undefined;\n }\n if (this.goPrintedTypeOfExpression(dictNode, dictText) !== 'map[string]any') {\n return undefined;\n }\n if (this.goPrintedTypeOfExpression(keyNode, keyText) !== 'string') {\n // InOp runs derefScalar over both operands: a `*string` key is the pointed-to\n // string, and a nil pointer is a nil key, i.e. false. Only an identifier may be\n // repeated by the guard — any other expression would be evaluated twice.\n if ((keyNode?.kind !== SyntaxKind.Identifier) || (this.goDeclaredTypeOfIdentifier(keyNode) !== '*string')) {\n return undefined;\n }\n const level = this.goStatementLevel;\n const body = this.getIden(level + 1);\n return `func() bool {\\n${body}if ${keyText} == nil {\\n${this.getIden(level + 2)}return false\\n${body}}\\n${body}_, ok := ${dictText}[*${keyText}]\\n${body}return ok\\n${this.getIden(level)}}()`;\n }\n // funcBody() keeps the literal on one line while `func() bool` (11 columns) plus\n // the two statements and their `; ` separator fit in 100 columns\n const read = `_, ok := ${dictText}[${keyText}]`;\n if (11 + read.length + 2 + 'return ok'.length <= 100) {\n return `func() bool { ${read}; return ok }()`;\n }\n const level = this.goStatementLevel;\n return `func() bool {\\n${this.getIden(level + 1)}${read}\\n${this.getIden(level + 1)}return ok\\n${this.getIden(level)}}()`;\n }\n\n // comparison helpers that normalize int/int64/float64 against each other, so a\n // literal operand's Go default type (int) behaves like the int64 OpNeg produces\n comparisonHelpers = [ 'IsEqual', 'IsGreaterThan', 'IsLessThan', 'IsGreaterThanOrEqual', 'IsLessThanOrEqual' ];\n\n // OpNeg boxes `-val.Int()` / `-val.Float()`, i.e. an int64 or a float64, and nil\n // for anything else. `-x` reproduces that exactly only for an operand that already\n // prints as float64/int64; a Go `int` (or an integer literal) boxes as int instead.\n printInlineOpNeg(node, printedText: string): string | undefined {\n if (printedText.includes('\\n')) {\n return undefined;\n }\n const goType = this.goPrintedTypeOfExpression(node.operand, printedText);\n if ((goType === 'float64') || (goType === 'int64')) {\n return `-${printedText}`;\n }\n // a fractional/exponent literal is already a Go float64 constant; an integer\n // literal is only interchangeable where the consumer normalizes the number\n if (/^\\d+(\\.\\d+)?([eE][+-]?\\d+)?$/.test(printedText.trim())) {\n if (printedText.includes('.') || /[eE]/.test(printedText)) {\n return `-${printedText}`;\n }\n const parent = node.parent;\n if (parent?.kind === SyntaxKind.CallExpression) {\n const callee = this.printNode(parent.expression, 0);\n if (this.comparisonHelpers.indexOf(callee) >= 0) {\n return `-${printedText}`;\n }\n }\n // `a > -1` prints as IsGreaterThan(a, …); the relational wrappers all\n // normalise int/int64/float64 the same way the equality helpers do\n if (parent?.kind === SyntaxKind.BinaryExpression) {\n const op = parent.operatorToken.kind;\n if ((op === SyntaxKind.GreaterThanToken) || (op === SyntaxKind.GreaterThanEqualsToken)\n || (op === SyntaxKind.LessThanToken) || (op === SyntaxKind.LessThanEqualsToken)) {\n return `-${printedText}`;\n }\n }\n }\n return undefined;\n }\n\n // JS truthiness of an operand whose Go type the printer knows, expressed with\n // plain Go instead of boxing the value into `EvalTruthy(any)`. Each arm mirrors the\n // matching `EvalTruthy` case exactly, including nil (a nil *T and a nil map are\n // both falsy) — so this is the same predicate, minus the interface round-trip.\n printInlineTruthy(node): string | undefined {\n // every pointer/slice arm below repeats the operand, so only an identifier\n // qualifies; inlining a call would evaluate it twice\n if (node?.kind !== SyntaxKind.Identifier) {\n return undefined;\n }\n const goType = this.goDeclaredTypeOfIdentifier(node);\n if (goType === undefined) {\n return undefined;\n }\n const text = this.printNode(node, 0);\n switch (goType) {\n case 'bool':\n return text;\n case 'string':\n return `(${text} != \"\")`;\n case 'int':\n case 'int64':\n case 'float64':\n return `(${text} != 0)`;\n case '*bool':\n return `(${text} != nil && *${text})`;\n case '*string':\n return `(${text} != nil && *${text} != \"\")`;\n case '*int':\n case '*int64':\n case '*float64':\n return `(${text} != nil && *${text} != 0)`;\n case '[]string':\n case '[]any':\n case 'map[string]any':\n return `(len(${text}) > 0)`;\n }\n return undefined;\n }\n\n // an `any` box the checker proves can only hold a bool or nil — a `boolean`\n // local whose Go declaration stayed `any` (a later write the printer cannot\n // type, e.g. a tuple read) — is what `EvalTruthy` reduces to: nil and `false`\n printInlineBoolBoxTruthy(node): string | undefined {\n if (this.goScalarFamilyWithNil(node) !== 'bool') {\n return undefined;\n }\n let declaration;\n try {\n declaration = this.getChecker().getSymbolAtLocation(node)?.valueDeclaration?.resolve();\n } catch (e) {\n return undefined;\n }\n if (declaration?.kind !== SyntaxKind.VariableDeclaration && !this.goGetArgBoundParameter(node)) {\n return undefined; // a plain parameter keeps the caller's box untouched\n }\n const text = this.printNode(node, 0);\n if (!this.goIsAnyBoxExpression(node, text)) {\n return undefined;\n }\n return `(${text} == true)`;\n }\n\n // `EvalTruthy(this.SafeBool(…))`: the accessor's Go signature returns a `*bool`,\n // nil for an absent flag and the flag otherwise — exactly the two states\n // `derefScalar` hands the helper — so the predicate is `x != nil && *x`.\n printInlineBoolPointerTruthy(node, printedText: string): string | undefined {\n if (node?.kind !== SyntaxKind.CallExpression) {\n return undefined;\n }\n if (GO_PURE_BOOL_ACCESSORS.indexOf(this.goPrintedCallee(printedText) as string) < 0) {\n return undefined;\n }\n // the pointer is dereferenced twice, so every argument has to be a plain read\n if (!node.arguments.every((argument) => this.goIsRepeatSafePointerArgument(argument))) {\n return undefined;\n }\n return `(${printedText} != nil && *${printedText})`;\n }\n\n // an argument the two halves of a pointer deref may read twice: a plain\n // identifier/literal read, or a `this.` read of the exchange instance\n goIsRepeatSafePointerArgument(node): boolean {\n while (node?.kind === SyntaxKind.ParenthesizedExpression) {\n node = node.expression;\n }\n if (this.goIsReadOnlyCallArgument(node)) {\n return true;\n }\n return (node?.kind === SyntaxKind.PropertyAccessExpression)\n && (node.expression?.kind === SyntaxKind.ThisKeyword)\n && (node.name?.kind === SyntaxKind.Identifier);\n }\n\n // the native Go text for a condition operand the printer can type, or undefined\n // when the operand has to go through the truthiness helper. `(x)` is decided on\n // its operand and keeps the source parentheses, so the surrounding operator still\n // parses exactly the same way.\n goNativeCondition(node): string | undefined {\n if (node?.kind === SyntaxKind.Identifier) {\n return this.printInlineTruthy(node) ?? this.printInlineBoolBoxTruthy(node);\n }\n if (node?.kind === SyntaxKind.ParenthesizedExpression) {\n const inner = this.goNativeCondition(node.expression);\n if (inner === undefined) {\n return undefined;\n }\n return (inner.startsWith('(') && this.isWholePrintedCall(inner, 0)) ? inner : `(${inner})`;\n }\n // an expression that already prints a Go `bool` needs no EvalTruthy round-trip:\n // `a || b`, `!x`, `a === b` and the Is*/Precise.String* predicates are all\n // bool-typed, so `EvalTruthy()` is the identity function on them\n const printed = this.printNode(node, 0);\n const pointerTruthy = this.printInlineBoolPointerTruthy(node, printed);\n if (pointerTruthy !== undefined) {\n return pointerTruthy;\n }\n if (this.goTypeOfInitializer(node, printed) === 'bool') {\n return printed;\n }\n // a predicate the printer folds to a constant — IsArray on a proven slice or map —\n // prints a Go bool that the probe above cannot name\n if ((node?.kind === SyntaxKind.CallExpression) && ((printed === 'true') || (printed === 'false'))) {\n return printed;\n }\n if (GO_BOOL_FIELDS.has(printed)) {\n return printed;\n }\n // a hand-written bool-returning base method already prints a Go bool\n const callee = this.goPrintedCallee(printed);\n return (callee !== undefined && GO_BOOL_CALL_NAMES_NATIVE.indexOf(callee) >= 0) ? printed : undefined;\n }\n\n\n // gofmt prints the condition of every `if`/`for`/`switch` through\n // go/printer/nodes.go controlClause() -> stripParens(): the single outermost,\n // fully enclosing parentheses pair is dropped, and the rule applies again to the\n // enclosed expression while that one is parenthesized as well\n // (`if (x == 1) {` -> `if x == 1 {`, `if ((x == 1)) {` -> `if x == 1 {`).\n // Parentheses survive when the enclosed expression holds an unparenthesized\n // composite literal whose type is a type name, because `if T{} == x {` does not\n // parse. The printer emits text instead of an ast.Expr, so stripParens runs over\n // the printed condition text here.\n goControlClauseParens(node, expression: string): string {\n return this.goIsControlClauseCondition(node) ? this.goStripControlClauseParens(expression) : expression;\n }\n\n // the expression inside the outermost parentheses pair of `text`, or undefined\n // when `text` is not one fully enclosing pair or gofmt keeps that pair\n goEnclosedExpression(text: string): string | undefined {\n const trimmed = text.trim();\n if (!trimmed.startsWith('(') || !trimmed.endsWith(')')) {\n return undefined;\n }\n // `(a) && (b)` opens and closes with a parenthesis, but not the same pair\n if (this.goSkipBalanced(trimmed, 0, '(', ')') !== trimmed.length) {\n return undefined;\n }\n const inner = trimmed.substring(1, trimmed.length - 1).trim();\n if (this.goHasTypeNameCompositeLiteral(inner)) {\n return undefined; // stripParens keeps parentheses protecting a literal\n }\n return inner;\n }\n\n // the expression a Go `if`/`for`/`switch` statement tests, the only positions\n // gofmt's controlClause() rewrites\n goIsControlClauseCondition(node): boolean {\n const parent = node?.parent;\n switch (parent?.kind) {\n case SyntaxKind.IfStatement:\n case SyntaxKind.WhileStatement:\n case SyntaxKind.SwitchStatement:\n return parent.expression === node;\n case SyntaxKind.ForStatement:\n return parent.condition === node;\n }\n return false;\n }\n\n // stripParens' ast.Inspect stops at nested parentheses, which protect whatever\n // they enclose, and reports a composite literal whenever its type is a type name\n goHasTypeNameCompositeLiteral(text: string): boolean {\n let index = 0;\n while (index < text.length) {\n const char = text[index];\n if ((char === '\"') || (char === '`') || (char === '\\'')) {\n index = this.goSkipQuoted(text, index);\n continue;\n }\n if ((char === '(') || (char === '{')) {\n if ((char === '{') && this.goCompositeLitHasTypeName(text, index)) {\n return true;\n }\n const next = this.goSkipBalanced(text, index, char, (char === '(') ? ')' : '}');\n if (next < 0) {\n return false; // unbalanced text cannot be inspected any further\n }\n index = next;\n continue;\n }\n index += 1;\n }\n return false;\n }\n\n // `{` opens a composite literal whose type is a type name when the text in front\n // of it is an ident or a selector chain of idents; `map[string]any{` and `[]any{`\n // are type literals and do not count (isTypeName in go/printer/nodes.go)\n goCompositeLitHasTypeName(text: string, braceIndex: number): boolean {\n let start = braceIndex;\n while (start > 0 && /[A-Za-z0-9_.[\\]]/.test(text[start - 1])) {\n start -= 1;\n }\n const typeText = text.substring(start, braceIndex).trim();\n if (['map', 'struct', 'interface', 'func', 'chan'].indexOf(typeText) >= 0) {\n return false;\n }\n return /^[A-Za-z_]\\w*(\\.[A-Za-z_]\\w*)*$/.test(typeText);\n }\n\n // the index right after the bracket closing the one at `start`, or -1 when the\n // brackets are unbalanced (the printer sees statement fragments, not whole files)\n goSkipBalanced(text: string, start: number, open: string, close: string): number {\n let depth = 0;\n let index = start;\n while (index < text.length) {\n const char = text[index];\n if ((char === '\"') || (char === '`') || (char === '\\'')) {\n index = this.goSkipQuoted(text, index);\n continue;\n }\n if (char === open) {\n depth += 1;\n } else if (char === close) {\n depth -= 1;\n if (depth === 0) {\n return index + 1;\n }\n }\n index += 1;\n }\n return -1;\n }\n\n // the index right after the string, rune or raw string literal opening at `start`\n goSkipQuoted(text: string, start: number): number {\n const quote = text[start];\n let index = start + 1;\n while (index < text.length) {\n const char = text[index];\n if ((char === '\\\\') && (quote !== '`')) {\n index += 2;\n continue;\n }\n if (char === quote) {\n return index + 1;\n }\n index += 1;\n }\n return text.length;\n }\n\n // gofmt keeps a comment group that the source separates from the following\n // declaration by a blank line as a free-standing comment; joined to it, it becomes\n // the declaration's doc comment and its indented lines are re-laid out as a code\n // block. The blank line is preserved so the emitted text keeps the source's shape.\n printLeadingComments(node, identation) {\n const printed = super.printLeadingComments(node, identation);\n if (printed.length === 0) {\n return printed;\n }\n const fullText = this.getSrc().getFullText();\n const ranges = getLeadingCommentRanges(fullText, node.pos) ?? [];\n const last = ranges[ranges.length - 1];\n if (last === undefined) {\n return printed;\n }\n const gap = fullText.slice(last.end, node.getStart());\n const detached = (gap.match(/\\n/g) ?? []).length > 1;\n return detached ? printed + \"\\n\" : printed;\n }\n\n // level of the statement being printed: a multi-line composite literal is laid out\n // relative to it (go/printer), whatever level the expression printers hand down\n goStatementLevel = 0;\n\n // stdlib packages this file's native emissions call; printSourceFileStatements turns them\n // into the import declarations the emitted Go needs (an occurrence outside a file print,\n // e.g. the intellisense body, only marks a set that the next file print replaces)\n goFileStdlibImports = new Set();\n\n // gofmt separates a top-level declaration that carries a comment from the previous\n // declaration by a blank line (go/printer declList: min = 2 when the decl has a doc\n // comment); the file members are joined with a bare newline otherwise\n printSourceFileStatements(node, identation): string {\n const outerImports = this.goFileStdlibImports;\n const fileImports = new Set();\n this.goFileStdlibImports = fileImports;\n let body = '';\n try {\n const printed = node.statements.map((m) => this.printNode(m, identation + 1)).filter((st) => st.length > 0);\n body = printed.map((st, index) => (index > 0 && /^\\s*(\\/\\/|\\/\\*)/.test(st)) ? \"\\n\" + st : st).join(\"\\n\") + \"\\n\".repeat(this.NUM_LINES_END_FILE);\n } finally {\n this.goFileStdlibImports = outerImports;\n }\n if (fileImports.size === 0) {\n return body;\n }\n // a native emission needs its stdlib package, and an import declaration must precede\n // every other declaration: the file assembly puts this text right behind the generated\n // header, so the imports lead it (gofmt keeps an import clause before the first decl)\n return [...fileImports].sort().map((path) => `import \"${path}\"`).join(\"\\n\") + \"\\n\\n\" + body;\n }\n\n goBinaryMemoized(node, key: string, compute: () => T): T {\n const outermost = this.goBinaryMemo === undefined;\n const memo = this.goBinaryMemo ??= new Map();\n try {\n let byKey = memo.get(node);\n if (byKey?.has(key)) {\n const cached = byKey.get(key);\n return cached;\n }\n const value = compute();\n if (byKey === undefined) {\n memo.set(node, byKey = new Map());\n }\n byKey.set(key, value);\n return value;\n } finally {\n if (outermost) {\n this.goBinaryMemo = undefined;\n }\n }\n }\n\n // the printer state a binary print reads besides the node: depth, level and the recursion guards\n goBinaryContextKey(): string {\n return `${this.goExprDepth}|${this.goStatementLevel}|${this.goLocalTypeResolution.size}|${this.goDeclaredTypeInProgress.size}`;\n }\n\n goPrintBinaryMemoized(node, identation: number): string {\n const key = `print|${this.goBinaryContextKey()}|${identation}`;\n return this.goBinaryMemoized(node, key, () => this.goControlClauseParens(node, super.printNode(node, identation)));\n }\n\n printNode(node, identation = 0): string {\n if (node !== undefined && isSourceFile(node)) {\n this.className = \"undefined\";\n return this.printSourceFileStatements(node, identation);\n }\n if (node?.kind === SyntaxKind.BinaryExpression && GO_ARITHMETIC_KINDS.indexOf(node.operatorToken.kind) >= 0) {\n return this.goPrintBinaryMemoized(node, identation);\n }\n const isStatement = node !== undefined && isStatementNode(node) && node.kind !== SyntaxKind.Block;\n const previousLevel = this.goStatementLevel;\n if (isStatement) {\n this.goStatementLevel = identation;\n }\n try {\n const printed = super.printNode(node, identation);\n // the if/for/switch conditions go through here (printCondition resolves the\n // bool and the falsy/truthy paths before printing the node's text)\n return this.goControlClauseParens(node, printed);\n } finally {\n this.goStatementLevel = previousLevel;\n }\n }\n\n // composite literal body one level deeper than the statement, closing brace at the\n // statement's level; the leading indentation belongs to the enclosing printer\n printObjectLiteralExpression(node, identation) {\n const level = this.goStatementLevel;\n const objectBody = this.printObjectLiteralBody(node, level);\n const formattedObjectBody = objectBody ? \"\\n\" + objectBody + \"\\n\" + this.getIden(level) : objectBody;\n return this.OBJECT_OPENING + formattedObjectBody + this.OBJECT_CLOSING;\n }\n\n printCondition(node, identation) {\n // `!x` is handled by printPrefixUnaryExpression, which calls back into this\n // method with the operand; let the base class keep that recursion intact\n const native = this.goNativeCondition(node);\n if (native !== undefined) {\n // goNativeCondition prints the operand itself, so the control-clause\n // parens of printNode do not see the parentheses it wraps it in\n return `${this.getIden(identation)}${this.goControlClauseParens(node, native)}`;\n }\n // a native `key in obj` prints as a `func() bool` call, which the type probe\n // above cannot name; it is a Go bool all the same\n const inNode = (node?.kind === SyntaxKind.ParenthesizedExpression) ? node.expression : node;\n if (inNode?.kind === SyntaxKind.BinaryExpression && inNode.operatorToken.kind === SyntaxKind.InKeyword) {\n const inlined = this.printInlineInOp(inNode.right, inNode.left, this.printNode(inNode.right, 0), this.printNode(inNode.left, 0));\n if (inlined !== undefined) {\n const text = (inNode === node) ? inlined : `(${inlined})`;\n return `${this.getIden(identation)}${this.goControlClauseParens(node, text)}`;\n }\n }\n return super.printCondition(node, identation);\n }\n\n // === / !== inlined to plain Go operators when both sides are concrete Go\n // values or real pointers. Everything else — in particular anything that is\n // still `any` in Go — falls through to the existing IsEqual helper.\n // `(a == b || *a == *b)` is rejected: a nil *T panics on the second clause.\n // Go has no implicit numeric conversion: `*limit == length` does not compile\n // when limit is *int64 and length is int, even though TypeScript calls both\n // `number`. Dereferencing is therefore only safe against an untyped constant\n // (a literal, which adapts to the pointee) or an operand of the very same Go\n // type. Anything else — including any `any` operand — keeps IsEqual.\n goDerefComparableWith(ptrNode, ptrText: string, otherNode): boolean {\n const pointee = this.goPointerTypeOfExpression(ptrNode, ptrText)?.substring(1);\n if (pointee === undefined) {\n return false;\n }\n switch (otherNode?.kind) {\n case SyntaxKind.StringLiteral:\n case SyntaxKind.NoSubstitutionTemplateLiteral:\n return pointee === 'string';\n case SyntaxKind.NumericLiteral:\n return (pointee === 'int') || (pointee === 'int64') || (pointee === 'float64');\n case SyntaxKind.TrueKeyword:\n case SyntaxKind.FalseKeyword:\n return pointee === 'bool';\n }\n const otherType = this.goDeclaredTypeOfIdentifier(otherNode);\n return otherType === pointee;\n }\n\n // a node the printer prints as a Go string constant: both literal forms are\n // emitted with the printer's string quote token, so the comparison is a plain\n // Go string comparison\n goIsStringLiteralNode(node): boolean {\n return (node?.kind === SyntaxKind.StringLiteral) || (node?.kind === SyntaxKind.NoSubstitutionTemplateLiteral);\n }\n\n // the deref arms print their operand twice, so it must read the same value both times: an\n // identifier is a plain read, and a string accessor call whose arguments are all\n // identifiers/literals re-reads them (no statement runs between the two evaluations).\n goDerefRepeatableOperand(node, printedText: string): boolean {\n if (node?.kind === SyntaxKind.Identifier) {\n return true;\n }\n if (node?.kind !== SyntaxKind.CallExpression) {\n return false;\n }\n if (GO_PURE_STRING_ACCESSORS.indexOf(this.goPrintedCallee(printedText) as string) < 0) {\n return false;\n }\n return node.arguments.every((argument) => this.goIsReadOnlyCallArgument(argument));\n }\n\n // an argument whose evaluation is a plain read: a value the printer already\n // holds, never a call that could observe or cause a change\n goIsReadOnlyCallArgument(node): boolean {\n switch (this.goUnwrapParenthesizedNode(node)?.kind) {\n case SyntaxKind.Identifier:\n case SyntaxKind.StringLiteral:\n case SyntaxKind.NoSubstitutionTemplateLiteral:\n case SyntaxKind.NumericLiteral:\n case SyntaxKind.TrueKeyword:\n case SyntaxKind.FalseKeyword:\n case SyntaxKind.NullKeyword:\n return true;\n }\n return false;\n }\n\n // true when the Go value of this operand is a bare `string`: a local declared `string`, or a\n // parameter the signature printer emits as `string`. A Go string holds neither nil nor a pointer,\n // so `x == \"lit\"` is exactly IsEqual(x, \"lit\") — the pointer arms never see this type.\n goIsBareStringOperand(node): boolean {\n if (this.goDeclaredTypeOfIdentifier(node) === 'string') {\n return true;\n }\n if (node?.kind !== SyntaxKind.Identifier) {\n return false;\n }\n const checker: any = this.checkerOrUndefined();\n if (checker === undefined) {\n return false;\n }\n const symbol = checker.getSymbolAtLocation(node);\n const declaration = symbol?.valueDeclaration?.resolve();\n if (declaration?.kind !== SyntaxKind.Parameter) {\n return false;\n }\n return this.printParameterType(declaration) === 'string';\n }\n\n printInlineEquality(left, right, leftText: string, rightText: string, isEq: boolean): string | undefined {\n const lPtr = this.goPointerTypeOfExpression(left, leftText) !== undefined;\n const rPtr = this.goPointerTypeOfExpression(right, rightText) !== undefined;\n // the branches below that deref repeat the operand, so they may only be used\n // on an identifier or on one of the read-only string accessors (whose\n // arguments are plain reads); a call that does anything else stays IsEqual\n const lRepeatable = this.goDerefRepeatableOperand(left, leftText);\n const rRepeatable = this.goDerefRepeatableOperand(right, rightText);\n const lFam = this.goScalarFamily(left);\n const rFam = this.goScalarFamily(right);\n if (lFam === 'nil' && rPtr) {\n return isEq ? `(${rightText} == nil)` : `(${rightText} != nil)`;\n }\n if (rFam === 'nil' && lPtr) {\n return isEq ? `(${leftText} == nil)` : `(${leftText} != nil)`;\n }\n if (lPtr && rPtr) {\n const lPointee = this.goPointerTypeOfExpression(left, leftText);\n if (!lRepeatable || !rRepeatable\n || lPointee !== this.goPointerTypeOfExpression(right, rightText)) {\n return undefined; // IsEqual + derefScalar evaluates each side once\n }\n if (isEq) {\n return `(${leftText} == ${rightText} || (${leftText} != nil && ${rightText} != nil && *${leftText} == *${rightText}))`;\n }\n return `(${leftText} != ${rightText} && (${leftText} == nil || ${rightText} == nil || *${leftText} != *${rightText}))`;\n }\n if (lPtr && rFam !== undefined && rFam !== 'nil') {\n if (!lRepeatable || !this.goDerefComparableWith(left, leftText, right)) {\n return undefined;\n }\n return isEq\n ? `(${leftText} != nil && *${leftText} == ${rightText})`\n : `(${leftText} == nil || *${leftText} != ${rightText})`;\n }\n if (rPtr && lFam !== undefined && lFam !== 'nil') {\n if (!rRepeatable || !this.goDerefComparableWith(right, rightText, left)) {\n return undefined;\n }\n return isEq\n ? `(${rightText} != nil && *${rightText} == ${leftText})`\n : `(${rightText} == nil || *${rightText} != ${leftText})`;\n }\n // two definitely-present scalars of the same family: `==` is valid Go and\n // needs no helper. Nullable aliases (Str/Int/Num/Bool) are `any` in Go and\n // returned undefined by goScalarFamily, so they keep IsEqual.\n if (!lPtr && !rPtr && lFam !== undefined && rFam !== undefined\n && lFam !== 'nil' && rFam !== 'nil' && lFam === rFam) {\n return isEq ? `(${leftText} == ${rightText})` : `(${leftText} != ${rightText})`;\n }\n // both operands print as a concrete Go numeric kind (a declared int/int64/float64, or a\n // constant that fits the other side): IsEqual converts to that same kind, never sees nil\n const numericKind = (!lPtr && !rPtr) ? this.goNativeNumericEqualityKind(left, leftText, right, rightText) : undefined;\n if (numericKind !== undefined) {\n return isEq ? `(${leftText} == ${rightText})` : `(${leftText} != ${rightText})`;\n }\n // the declared-local table names `string` for this identifier (or the signature printer emits the\n // parameter as `string`): a `var x string` cannot hold a pointer or nil, so a string-literal\n // comparison equals the helper. A local ever written another type is reported `any` and boxed.\n if (!lPtr && !rPtr) {\n if ((this.goIsBareStringOperand(left) && this.goIsStringLiteralNode(right))\n || (this.goIsBareStringOperand(right) && this.goIsStringLiteralNode(left))) {\n return isEq ? `(${leftText} == ${rightText})` : `(${leftText} != ${rightText})`;\n }\n }\n // an operand the printer boxes into `any` whose TypeScript type proves the box\n // holds a scalar or nil: `x === undefined` and `x === 'lit'` are then the same\n // predicate as the helper, without the interface round-trip. Numbers stay on\n // IsEqual: an `any` box may hold int, int64 or float64, and Go compares those\n // by exact width.\n const lNilFam = this.goScalarFamilyWithNil(left);\n const rNilFam = this.goScalarFamilyWithNil(right);\n const lBox = !lPtr && this.goIsAnyBoxExpression(left, leftText);\n const rBox = !rPtr && this.goIsAnyBoxExpression(right, rightText);\n if (lBox && (rFam === 'nil') && (lNilFam !== undefined) && (lNilFam !== 'number')) {\n return isEq ? `(${leftText} == nil)` : `(${leftText} != nil)`;\n }\n if (rBox && (lFam === 'nil') && (rNilFam !== undefined) && (rNilFam !== 'number')) {\n return isEq ? `(${rightText} == nil)` : `(${rightText} != nil)`;\n }\n // a parameter whose TypeScript type is an array or object (`Strings`, `Market`, `NullableDict`,\n // `object[]`): the Go box holds a map/slice or an untyped nil, not a pointer — GetArg unwraps the\n // typed nil pointers the wrappers pass, so `x == nil` is exactly IsEqual(x, nil)\n const lObjParam = (lNilFam === undefined) && lBox && this.goObjectBoxParameter(left);\n const rObjParam = (rNilFam === undefined) && rBox && this.goObjectBoxParameter(right);\n if (lObjParam && (rFam === 'nil')) {\n return isEq ? `(${leftText} == nil)` : `(${leftText} != nil)`;\n }\n if (rObjParam && (lFam === 'nil')) {\n return isEq ? `(${rightText} == nil)` : `(${rightText} != nil)`;\n }\n // an `any` local the printer cannot type whose every write is a non-pointer\n // source (endpoint await / JSON decode / literal / nil): its box is never a\n // nil *T, so the interface test is the same predicate as the helper\n if (lBox && (rFam === 'nil') && this.goAnyLocalHoldsNonPointer(this.goAnyBoxLocalDeclaration(left))) {\n return isEq ? `(${leftText} == nil)` : `(${leftText} != nil)`;\n }\n if (rBox && (lFam === 'nil') && this.goAnyLocalHoldsNonPointer(this.goAnyBoxLocalDeclaration(right))) {\n return isEq ? `(${rightText} == nil)` : `(${rightText} != nil)`;\n }\n // a parameter with a TypeScript default is bound by `x := GetArg(optionalArgs, i, default)`, which\n // folds a typed nil pointer (and nil []string/[]any) into the untyped default: never a nil *T.\n // Nullable Int/Num aliases are excluded above only because exact-width comparison needs `number`.\n if ((lNilFam === 'number') && (rFam === 'nil') && this.goGetArgBoundParameter(left)) {\n return isEq ? `(${leftText} == nil)` : `(${leftText} != nil)`;\n }\n if ((rNilFam === 'number') && (lFam === 'nil') && this.goGetArgBoundParameter(right)) {\n return isEq ? `(${rightText} == nil)` : `(${rightText} != nil)`;\n }\n // a string or bool literal: only a value of that very type is equal in both\n // predicates, so no numeric or nil member can be compared away\n const isLiteral = (node): boolean => {\n switch (node?.kind) {\n case SyntaxKind.StringLiteral:\n case SyntaxKind.NoSubstitutionTemplateLiteral:\n case SyntaxKind.TrueKeyword:\n case SyntaxKind.FalseKeyword:\n return true;\n }\n return false;\n };\n const literalMatchesBox = (boxFam: string | undefined, litNode, litFam: string | undefined): boolean =>\n ((litFam === 'string') || (litFam === 'bool')) && isLiteral(litNode)\n && ((boxFam === litFam) || (boxFam === undefined));\n if ((lBox && literalMatchesBox(lNilFam, right, rFam)) || (rBox && literalMatchesBox(rNilFam, left, lFam))) {\n return isEq ? `(${leftText} == ${rightText})` : `(${leftText} != ${rightText})`;\n }\n // IsEqual(GetValue(market, \"spot\"), true): the checker proves the read holds\n // a bool or nil (Market.spot), and every other dynamic type is unequal to a\n // Go bool, nil included — the same predicate as the helper\n const isBoolLiteral = (node): boolean =>\n (node?.kind === SyntaxKind.TrueKeyword) || (node?.kind === SyntaxKind.FalseKeyword);\n if ((!lPtr && isBoolLiteral(right) && (this.goScalarFamilyWithNil(left) === 'bool') && this.goBoxedElementRead(left, leftText))\n || (!rPtr && isBoolLiteral(left) && (this.goScalarFamilyWithNil(right) === 'bool') && this.goBoxedElementRead(right, rightText))) {\n return isEq ? `(${leftText} == ${rightText})` : `(${leftText} != ${rightText})`;\n }\n // two boxes of one non-numeric family: both hold that scalar or nil\n if (lBox && rBox && (lNilFam !== undefined) && (lNilFam !== 'number') && (lNilFam === rNilFam)) {\n return isEq ? `(${leftText} == ${rightText})` : `(${leftText} != ${rightText})`;\n }\n return undefined;\n }\n\n // the kind a native `==` compares two numeric operands in; undefined keeps IsEqual. Two\n // constants are left to the helper (nothing to type), as is any mix Go would refuse.\n goNativeNumericEqualityKind(left, leftText: string, right, rightText: string): string | undefined {\n if (this.goIsNumericConstant(left) && this.goIsNumericConstant(right)) {\n return undefined;\n }\n const leftKind = this.goOperandNumericKind(left, leftText);\n const rightKind = this.goOperandNumericKind(right, rightText);\n if ((leftKind === undefined) || (rightKind === undefined)) {\n return undefined;\n }\n return this.goComparisonKind(left, leftKind, right, rightKind);\n }\n\n // the Go numeric kind an operand's static type is, or undefined when it stays\n // `any` (unknown helper result, union, pointer box): only a concrete kind can\n // join a comparison the Go compiler accepts\n goOperandNumericKind(node, printedText: string): string | undefined {\n if (node === undefined) {\n return undefined;\n }\n if (node.kind === SyntaxKind.Identifier) {\n const declared = this.goDeclaredTypeOfIdentifier(node);\n if (declared !== undefined) {\n return (GO_NUMERIC_KINDS.indexOf(declared) >= 0) ? declared : undefined;\n }\n return this.goLiteralTypedLocalKind(node);\n }\n if (this.goIsNumericConstant(node)) {\n return this.goNumericLiteralKind(node);\n }\n if (node.kind === SyntaxKind.ParenthesizedExpression) {\n return this.goOperandNumericKind(node.expression, this.printNode(node.expression, 0));\n }\n const goType = this.goTypeOfInitializer(node, printedText);\n return (goType !== undefined && GO_NUMERIC_KINDS.indexOf(goType) >= 0) ? goType : undefined;\n }\n\n // a local bound by `:=` takes its Go type from the initializer: an untyped\n // integer constant is `int`, a floating-point one is `float64`. A variable\n // statement prints `var x = …` instead, where the printer already\n // decided the type, so only the `:=` form may be trusted here.\n goLiteralTypedLocalKind(node): string | undefined {\n const checker: any = this.checkerOrUndefined();\n if (checker === undefined) {\n return undefined;\n }\n const symbol = checker.getSymbolAtLocation(node);\n const declaration = symbol?.valueDeclaration?.resolve();\n if (declaration?.kind !== SyntaxKind.VariableDeclaration || declaration.initializer === undefined) {\n return undefined;\n }\n const declarationList = declaration.parent;\n if (declarationList?.kind !== SyntaxKind.VariableDeclarationList\n || declarationList.parent?.kind === SyntaxKind.FirstStatement) {\n return undefined;\n }\n return this.goNumericLiteralKind(declaration.initializer);\n }\n\n // an untyped Go constant: the integer forms adopt any numeric kind, the\n // floating-point ones only fit float64. A signed literal is the same constant:\n // the printer writes `-1` as text, never through OpNeg's box.\n goNumericLiteralKind(node): string | undefined {\n if (this.goIsSignedNumericLiteral(node)) {\n return this.goNumericLiteralKind(node.operand);\n }\n const text = node?.text;\n if (text === undefined) {\n return undefined;\n }\n if (/^[0-9][0-9_]*$/.test(text) || /^0[xXoObB][0-9a-fA-F_]+$/.test(text)) {\n return 'int';\n }\n if (/^[0-9][.eE]/.test(text)) {\n return 'float64';\n }\n return undefined;\n }\n\n // `-1` / `+1.5` as written: a sign on a numeric literal, the only prefix-unary\n // shape that reaches a comparison as a constant rather than as OpNeg(...)\n goIsSignedNumericLiteral(node): boolean {\n if (node?.kind !== SyntaxKind.PrefixUnaryExpression) {\n return false;\n }\n if ((node.operator !== SyntaxKind.MinusToken) && (node.operator !== SyntaxKind.PlusToken)) {\n return false;\n }\n return node.operand?.kind === SyntaxKind.NumericLiteral;\n }\n\n // a numeric constant operand: an integer/float literal, with an optional sign\n goIsNumericConstant(node): boolean {\n return (node?.kind === SyntaxKind.NumericLiteral) || this.goIsSignedNumericLiteral(node);\n }\n\n // the constant's value with its sign; NaN for anything but a numeric constant\n goNumericConstantValue(node): number {\n if (this.goIsSignedNumericLiteral(node)) {\n const value = Number(node.operand.text.replaceAll('_', ''));\n return (node.operator === SyntaxKind.MinusToken) ? -value : value;\n }\n if (node?.kind !== SyntaxKind.NumericLiteral) {\n return Number.NaN;\n }\n return Number(node.text.replaceAll('_', ''));\n }\n\n // a constant only joins a comparison when its value is representable in the\n // other operand's kind: `0.5` is not an int, and neither is 1e400 (infinity)\n goLiteralFitsKind(node, kind: string): boolean {\n const value = this.goNumericConstantValue(node);\n if (!Number.isFinite(value)) {\n return false;\n }\n if (kind === 'float64') {\n return true;\n }\n return Number.isInteger(value) && (Math.abs(value) <= 2147483647);\n }\n\n // the kind both operands are compared in, or undefined when Go would need a\n // conversion (two different concrete kinds) or the constant does not fit\n goComparisonKind(left, leftKind: string, right, rightKind: string): string | undefined {\n if (leftKind === rightKind) {\n return leftKind;\n }\n if (this.goIsNumericConstant(left) && !this.goIsNumericConstant(right)) {\n return this.goLiteralFitsKind(left, rightKind) ? rightKind : undefined;\n }\n if (this.goIsNumericConstant(right) && !this.goIsNumericConstant(left)) {\n return this.goLiteralFitsKind(right, leftKind) ? leftKind : undefined;\n }\n return undefined;\n }\n\n // `<` `>` `<=` `>=` between two operands the checker proves to be numbers of the\n // same Go kind is exactly the comparison the helper performs, minus the interface\n // round-trip, so the call carries no information. A `*int64` / `*float64` operand\n // joins them with its deref written out, and the helper's nil predicate with it.\n // Everything else — `any` boxes, mixed kinds, strings — keeps the helper. float64\n // keeps IsLessThan/IsLessThanOrEqual: the helper answers true whenever an operand\n // is NaN while Go (and JS) answer false, and only those two operators differ.\n printInlineOrderedComparison(left, right, leftText: string, rightText: string, op): string | undefined {\n const operator = ORDERED_COMPARISON_OPERATORS[op];\n if (operator === undefined) {\n return undefined;\n }\n const leftPointee = this.goOrderedComparisonPointerKind(left);\n const rightPointee = this.goOrderedComparisonPointerKind(right);\n if ((leftPointee !== undefined) || (rightPointee !== undefined)) {\n return this.printPointerOrderedComparison(left, right, leftText, rightText, operator, leftPointee, rightPointee);\n }\n const leftKind = this.goOperandNumericKind(left, leftText);\n const rightKind = this.goOperandNumericKind(right, rightText);\n if ((leftKind === undefined) || (rightKind === undefined)) {\n return undefined;\n }\n // both operands may additionally be checker-typed numbers; that check is\n // implied by the concrete Go kind above and buys nothing\n const kind = this.goComparisonKind(left, leftKind, right, rightKind);\n if (kind === undefined) {\n return undefined;\n }\n if ((kind === 'float64') && ((operator === '<') || (operator === '<='))) {\n return undefined;\n }\n return `(${leftText} ${operator} ${rightText})`;\n }\n\n // the pointee kind of a `*int64` / `*float64` **identifier** operand. Only a local\n // the printer itself declared as that pointer qualifies: a call would be repeated by\n // the nil test, and an `any` box holds a value the printer cannot name.\n goOrderedComparisonPointerKind(node): string | undefined {\n if (node?.kind !== SyntaxKind.Identifier) {\n return undefined;\n }\n const declared = this.goDeclaredTypeOfIdentifier(node);\n if ((declared !== '*int64') && (declared !== '*float64')) {\n return undefined;\n }\n return declared.substring(1);\n }\n\n // an ordered comparison with a `*int64` / `*float64` operand on at least one side. The helper\n // derefs both sides and answers its own predicate when one is nil, so the native form spells that\n // out; an enclosing `x !== undefined` guard (printed as `x != nil`) removes it for that side.\n printPointerOrderedComparison(left, right, leftText: string, rightText: string, operator: string, leftPointee: string | undefined, rightPointee: string | undefined): string | undefined {\n const leftKind = (leftPointee === undefined) ? this.goOperandNumericKind(left, leftText) : leftPointee;\n const rightKind = (rightPointee === undefined) ? this.goOperandNumericKind(right, rightText) : rightPointee;\n if ((leftKind === undefined) || (rightKind === undefined)) {\n return undefined;\n }\n const kind = this.goComparisonKind(left, leftKind, right, rightKind);\n if (kind === undefined) {\n return undefined;\n }\n // NaN is a float64 to the helper too: `<` / `<=` answer true for it while Go\n // answers false, so those two operators keep the call exactly as phase-1 does\n if ((kind === 'float64') && ((operator === '<') || (operator === '<='))) {\n return undefined;\n }\n const leftNil = (leftPointee !== undefined) && !this.goHasEnclosingNilGuard(left);\n const rightNil = (rightPointee !== undefined) && !this.goHasEnclosingNilGuard(right);\n // a nil test short-circuits the operand on the other side, so that side has to\n // be free of calls for the helper's single evaluation to stay unobservable\n if (leftNil && (rightPointee === undefined) && !this.goIsPureComparisonOperand(right)) {\n return undefined;\n }\n if (rightNil && (leftPointee === undefined) && !this.goIsPureComparisonOperand(left)) {\n return undefined;\n }\n const lv = (leftPointee === undefined) ? leftText : `*${leftText}`;\n const rv = (rightPointee === undefined) ? rightText : `*${rightText}`;\n if (!leftNil && !rightNil) {\n return `(${lv} ${operator} ${rv})`;\n }\n // every arm below answers what the helper answers when a side is nil:\n // `a != nil && b == nil` for `>`/`>=`, `a == nil && b != nil` for `<`/`<=`\n const greater = (operator === '>') || (operator === '>=');\n if (leftNil && !rightNil) {\n return greater ? `(${leftText} != nil && ${lv} ${operator} ${rv})` : `(${leftText} == nil || ${lv} ${operator} ${rv})`;\n }\n if (!leftNil && rightNil) {\n return greater ? `(${rightText} == nil || ${lv} ${operator} ${rv})` : `(${rightText} != nil && ${lv} ${operator} ${rv})`;\n }\n if (operator === '>') {\n return `(${leftText} != nil && (${rightText} == nil || ${lv} > ${rv}))`;\n }\n if (operator === '>=') {\n return `(${rightText} == nil || (${leftText} != nil && ${lv} >= ${rv}))`;\n }\n if (operator === '<') {\n return `(${rightText} != nil && (${leftText} == nil || ${lv} < ${rv}))`;\n }\n return `(${leftText} == nil || (${rightText} != nil && ${lv} <= ${rv}))`;\n }\n\n // `x !== undefined` / `x != null` on that identifier: the printer writes the Go\n // `x != nil` test for it, so an enclosing one proves the pointer present\n goIsNonNilTestOf(node, ident): boolean {\n if (node?.kind !== SyntaxKind.BinaryExpression) {\n return false;\n }\n const op = node.operatorToken?.kind;\n if ((op !== SyntaxKind.ExclamationEqualsToken) && (op !== SyntaxKind.ExclamationEqualsEqualsToken)) {\n return false;\n }\n return (this.goIsSameSymbol(node.left, ident) && this.goIsNilLiteral(node.right))\n || (this.goIsSameSymbol(node.right, ident) && this.goIsNilLiteral(node.left));\n }\n\n // a null/undefined literal, or any expression the checker types as one\n goIsNilLiteral(node): boolean {\n if ((node?.kind === SyntaxKind.NullKeyword) || (node?.kind === SyntaxKind.UndefinedKeyword)) {\n return true;\n }\n return (node?.kind === SyntaxKind.Identifier) && (this.goScalarFamily(node) === 'nil');\n }\n\n goIsSameSymbol(a, b): boolean {\n if ((a?.kind !== SyntaxKind.Identifier) || (b?.kind !== SyntaxKind.Identifier)) {\n return false;\n }\n try {\n const checker = this.getChecker();\n const leftSymbol = checker.getSymbolAtLocation(a);\n return (leftSymbol !== undefined) && (leftSymbol === checker.getSymbolAtLocation(b));\n } catch (e) {\n return false;\n }\n }\n\n // [guarded child, guarding condition] fields of the constructs a nil guard dominates\n goNilGuardFields: { [kind: number]: [string, string] } = {\n [SyntaxKind.IfStatement]: ['thenStatement', 'expression'],\n [SyntaxKind.WhileStatement]: ['statement', 'expression'],\n [SyntaxKind.ForStatement]: ['statement', 'condition'],\n [SyntaxKind.ConditionalExpression]: ['whenTrue', 'condition'],\n };\n\n // true when the enclosing control flow already proves the identifier non-nil at this node: an\n // earlier conjunct of an `&&` chain, or the condition of a wrapping if/loop/ternary containing the\n // node. A local rebound anywhere in its function never counts — the guard may be dead by then.\n goHasEnclosingNilGuard(ident): boolean {\n const checker: any = this.checkerOrUndefined();\n if (checker === undefined) {\n return false;\n }\n const declaration = checker.getSymbolAtLocation(ident)?.valueDeclaration?.resolve();\n if (this.goLocalIsRebound(this.goEnclosingFunction(declaration ?? ident), ident)) {\n return false;\n }\n let child = ident;\n let parent = ident?.parent;\n while (parent !== undefined) {\n const kind = parent.kind;\n if ((kind === SyntaxKind.ParenthesizedExpression) || (kind === SyntaxKind.VariableStatement)\n || (kind === SyntaxKind.ExpressionStatement) || (kind === SyntaxKind.Block)\n || (kind === SyntaxKind.ReturnStatement) || (kind === SyntaxKind.ElementAccessExpression)\n || (kind === SyntaxKind.CallExpression) || (kind === SyntaxKind.PropertyAccessExpression)\n || (kind === SyntaxKind.ObjectLiteralExpression) || (kind === SyntaxKind.PropertyAssignment)\n || (kind === SyntaxKind.ArrayLiteralExpression) || (kind === SyntaxKind.AwaitExpression)\n || (kind === SyntaxKind.CaseClause) || (kind === SyntaxKind.SwitchStatement)\n || (kind === SyntaxKind.DoStatement) || (kind === SyntaxKind.LabeledStatement)) {\n // the guard still dominates everything below such a wrapper\n child = parent;\n parent = parent.parent;\n continue;\n }\n if (kind === SyntaxKind.BinaryExpression) {\n const op = parent.operatorToken?.kind;\n if ((op === SyntaxKind.AmpersandAmpersandToken) && (child === parent.right)\n && this.goConditionProvesNonNil(parent.left, ident)) {\n return true;\n }\n // `a || b` and a left conjunct are evaluated before the guard, so they\n // prove nothing; the guard of an enclosing construct still applies\n child = parent;\n parent = parent.parent;\n continue;\n }\n const guard = this.goNilGuardFields[kind];\n if (guard !== undefined) {\n if ((child === parent[guard[0]]) && this.goConditionProvesNonNil(parent[guard[1]], ident)) {\n return true;\n }\n child = parent;\n parent = parent.parent;\n continue;\n }\n // functions, classes and everything else the scan does not model: the\n // guard cannot be carried across\n return false;\n }\n return false;\n }\n\n // the whole condition, or any conjunct of its `&&` chain, is the non-nil test\n goConditionProvesNonNil(condition, ident): boolean {\n const inner = this.goUnwrapParenthesizedNode(condition);\n if (inner === undefined) {\n return false;\n }\n if (this.goIsNonNilTestOf(inner, ident)) {\n return true;\n }\n if ((inner.kind !== SyntaxKind.BinaryExpression) || (inner.operatorToken?.kind !== SyntaxKind.AmpersandAmpersandToken)) {\n return false;\n }\n return this.goConditionProvesNonNil(inner.left, ident) || this.goConditionProvesNonNil(inner.right, ident);\n }\n\n goUnwrapParenthesizedNode(node) {\n let current = node;\n while (current?.kind === SyntaxKind.ParenthesizedExpression) {\n current = current.expression;\n }\n return current;\n }\n\n // an operand a short-circuit may skip without any observable difference: no calls,\n // no assignments, nothing the helper would have evaluated exactly once\n goIsPureComparisonOperand(node): boolean {\n switch (node?.kind) {\n case SyntaxKind.Identifier:\n case SyntaxKind.NumericLiteral:\n case SyntaxKind.StringLiteral:\n case SyntaxKind.NoSubstitutionTemplateLiteral:\n case SyntaxKind.PropertyAccessExpression:\n return true;\n case SyntaxKind.PrefixUnaryExpression:\n return (node.operator === SyntaxKind.MinusToken) && this.goIsPureComparisonOperand(node.operand);\n case SyntaxKind.ParenthesizedExpression:\n return this.goIsPureComparisonOperand(node.expression);\n }\n return false;\n }\n\n // Go's printer never wraps an already parenthesised expression: gofmt prints a\n // ParenExpr whose child is itself a ParenExpr without its own parentheses\n // (`((x))` prints as `(x)`), because the text it is handed is re-parsed that way.\n // Our output is re-parsed exactly like that, so a source parenthesis around an\n // expression that already prints parenthesised -- an inlined comparison, a nested\n // parenthesised expression, an EvalTruthy(...) arm -- must emit the single pair\n // gofmt keeps instead of doubling it.\n printParenthesizedExpression(node, identation) {\n const expression = node.expression;\n if (expression?.kind === SyntaxKind.AsExpression) {\n // transform (this as any) into this, () and as any are not necessary\n return this.getIden(identation) + this.printNode(expression, 0);\n }\n if (expression?.kind === SyntaxKind.ArrowFunction) {\n // ignore arrowFunctions inside parenthesis\n return \"\";\n }\n // parentheses undo one level of depth (go/printer reduceDepth())\n const printed = this.goWithExprDepth(this.goExprDepth - 1, () => this.printNode(expression, 0));\n if (this.goIsParenthesizedExpression(printed)) {\n return this.getIden(identation) + printed;\n }\n return this.getIden(identation) + this.LEFT_PARENTHESIS + printed + this.RIGHT_PARENTHESIS;\n }\n\n // true when the printed text is exactly one parenthesised expression: its first\n // `(` closes on the last non-space character. Literals and comments are skipped\n // so a parenthesis inside them cannot unbalance the scan.\n goIsParenthesizedExpression(printed: string): boolean {\n const text = printed.trimStart();\n if (text[0] !== '(') {\n return false;\n }\n let depth = 0;\n for (let i = 0; i < text.length; i++) {\n const c = text[i];\n if ((c === '/') && (text[i + 1] === '/')) {\n // a trailing line comment belongs to the statement, not to the expression\n return false;\n }\n if ((c === '/') && (text[i + 1] === '*')) {\n const end = text.indexOf('*/', i + 2);\n if (end < 0) {\n return false;\n }\n i = end + 1;\n continue;\n }\n if ((c === '\"') || (c === '\\'') || (c === '`')) {\n i = this.goSkipGoLiteral(text, i);\n if (i < 0) {\n return false;\n }\n continue;\n }\n if (c === '(') {\n depth += 1;\n } else if (c === ')') {\n depth -= 1;\n if (depth === 0) {\n return text.substring(i + 1).trim().length === 0;\n }\n }\n }\n return false;\n }\n\n // index of the quote closing the Go string/rune literal that starts at `start`, -1 when unterminated\n goSkipGoLiteral(text: string, start: number): number {\n const quote = text[start];\n for (let i = start + 1; i < text.length; i++) {\n const c = text[i];\n if (c === '\\\\') {\n i += 1;\n continue;\n }\n if (c === quote) {\n return i;\n }\n }\n return -1;\n }\n\n // castVariableAssignmentIfNeeded(left, right, identation) {\n // const leftType = this.getChecker().getTypeAtLocation(left);\n // const rightType = this.getChecker().getTypeAtLocation(right);\n\n // const leftText = this.printNode(left, 0);\n // const rightText = this.printNode(right, 0);\n\n // if (this.isAnyType(rightType.flags) && !this.isAnyType(leftType.flags)) {\n // const parsedType = this.getTypeFromRawType(leftType);\n // return `${this.getIden(identation)}${leftText} = (${parsedType})${rightText}`;\n // }\n // return undefined;\n // }\n\n transformPropertyAcessExpressionIfNeeded(node) {\n const expression = node.expression;\n const leftSide = this.printNode(expression, 0);\n const rightSide = node.name.text;\n\n let rawExpression = undefined;\n\n switch(rightSide) {\n case 'length':\n const type = (this.getChecker() as Checker).getTypeAtLocation(expression); // eslint-disable-line\n // this.warnIfAnyType(node, type.flags, leftSide, \"length\");\n // rawExpression = this.isStringType(type.flags) ? `(string${leftSide}).Length` : `(${leftSide}.Cast().ToList()).Count`;\n rawExpression = this.printInlineArrayLength(expression, leftSide, node) ?? (this.isStringType(type.flags) ? `GetLength(${leftSide})` : `${this.ARRAY_LENGTH_WRAPPER_OPEN}${leftSide}${this.ARRAY_LENGTH_WRAPPER_CLOSE}`); // `(${leftSide}.Cast()).ToList().Count`\n break;\n case 'push':\n rawExpression = `((IList)${leftSide}).Add`;\n break;\n // case 'push':\n // rawExpression = `(List${leftSide}).Add`s\n // break;\n }\n return rawExpression;\n }\n\n // The Go type of a GetArg-bound optional local (from the printed default, or the declared type\n // for a nil default), or undefined to keep `any`; the retype needs goLocalIsSafeToType,\n // goParameterKeepsNilCompareNative and goGetArgConsumersAreSafe to agree.\n goGetArgLocalType(body, param, printedDefault: string): string | undefined {\n const method: any = param?.parent;\n const excluded = GO_GETARG_EXCLUDED_POSITIONS[method?.name?.text];\n if ((excluded !== undefined) && excluded.includes(method.parameters.indexOf(param))) {\n return undefined;\n }\n // an explicit `any` annotation admits values of other shapes than the default (api lists),\n // unless it only restates an override of a base parameter the base leaves unannotated\n if ((param?.type?.kind === SyntaxKind.AnyKeyword) && !this.goGetArgBaseParamIsUnannotated(param)) {\n return undefined;\n }\n const shape = (printedDefault ?? '').trim();\n const byDefault = this.goGetArgTypeOfShape(shape);\n if (byDefault !== undefined) {\n // a declared type naming no single Go type (IndexType = number | string) admits other shapes;\n // an admitted `any` restatement binds by its default, as the base does\n if ((param?.type !== undefined) && (param.type.kind !== SyntaxKind.AnyKeyword)\n && !this.goGetArgDeclaredTypeCandidates(param).some((t) => t.replace(/^\\*/, '') === byDefault)) {\n return undefined;\n }\n return this.goGetArgLocalIsSafe(body, param, byDefault) ? byDefault : undefined;\n }\n if ((shape !== 'nil') && (shape !== 'undefined')) {\n return undefined;\n }\n for (const goType of this.goGetArgDeclaredTypeCandidates(param)) {\n if (this.goGetArgLocalIsSafe(body, param, goType, true)) {\n return goType;\n }\n }\n return undefined;\n }\n\n // true when the method overrides a base method whose parameter at the same position has no\n // type annotation and a default of the same syntax kind (the base binds it through its twin)\n goGetArgBaseParamIsUnannotated(param): boolean {\n const method: any = param?.parent;\n const name = method?.name?.text;\n const index = method?.parameters?.indexOf(param) ?? -1;\n const cls: any = method?.parent;\n const checker: any = this.checkerOrUndefined();\n if ((name === undefined) || (index < 0) || (checker === undefined) || (param.initializer === undefined)) {\n return false;\n }\n for (const clause of (cls?.heritageClauses ?? [])) {\n if (clause.token !== SyntaxKind.ExtendsKeyword) {\n continue;\n }\n for (const expr of (clause.types ?? [])) {\n const baseDecl: any = checker.getTypeAtLocation(expr)?.getProperty?.(name)?.valueDeclaration?.resolve();\n const baseParam: any = baseDecl?.parameters?.[index];\n if (baseParam === undefined) {\n return false;\n }\n return (baseParam.type === undefined) && (baseParam.initializer !== undefined)\n && (baseParam.initializer.kind === param.initializer.kind);\n }\n }\n return false;\n }\n\n // a use of a nil-defaulted map local that only reads it: an element read, `k in x`, or the\n // receiver of a helper that treats a nil map like an absent value (no IsDictionary/IsEqual)\n goGetArgNilMapUseOnlyReads(n): boolean {\n const parent: any = n.parent;\n if ((parent?.kind === SyntaxKind.ElementAccessExpression) || (parent?.kind === SyntaxKind.BinaryExpression)) {\n return this.goSafeDictUseReadsTheMap(n);\n }\n if ((parent?.kind !== SyntaxKind.CallExpression) || (parent.arguments.indexOf(n) !== 0)) {\n return false;\n }\n const callee = this.goPrintedCallee(this.printNode(parent, 0));\n return (callee !== undefined) && (GO_GETARG_NIL_MAP_READERS.indexOf(callee.replace(/^this\\./, '')) >= 0);\n }\n\n // a nil []string reads like the absent box: `x.length` / GetArrayLength is 0, `x[i]` (GetValue)\n // is nil, InArray finds nothing, and a defaulted Strings position's GetArg folds it to its default\n goGetArgNilStringSliceUseOnlyReads(n): boolean {\n const parent: any = n.parent;\n if ((parent?.kind === SyntaxKind.PropertyAccessExpression) && (parent.expression === n)) {\n return (parent.name?.text === 'length') && (parent.parent?.kind !== SyntaxKind.CallExpression || parent.parent.expression !== parent)\n && !((parent.parent?.kind === SyntaxKind.BinaryExpression) && (parent.parent.left === parent));\n }\n if (parent?.kind === SyntaxKind.ElementAccessExpression) {\n return this.goSafeDictUseReadsTheMap(n);\n }\n if ((parent?.kind !== SyntaxKind.CallExpression) || (parent.expression === n)) {\n return false;\n }\n const argIndex = parent.arguments.indexOf(n);\n const callee: any = parent.expression;\n if ((callee?.kind === SyntaxKind.PropertyAccessExpression) && (callee.expression?.kind === SyntaxKind.ThisKeyword)\n && (callee.name?.text === 'inArray') && (argIndex === 1)) {\n return true;\n }\n if (!this.goGetArgPositionIsDefaulted(callee, argIndex)) {\n return false;\n }\n let decl: any;\n try {\n decl = this.getChecker().getSymbolAtLocation(callee)?.valueDeclaration?.resolve();\n } catch (e) {\n decl = undefined;\n }\n // the callee binds it as `any` or through GetArgStringSlice, never a []any twin\n const declared = String(decl?.parameters?.[argIndex]?.type?.getText() ?? '').replace(/\\s+/g, ' ');\n return (declared === 'Strings') || (declared === 'string[]');\n }\n\n // the Go type the printed default names, or undefined when it names none\n goGetArgTypeOfShape(shape: string): string | undefined {\n const shapes: [RegExp, string][] = [[/^map\\[string\\]any\\{/, 'map[string]any'], [/^\\[map\\[string\\]any\\]\\{/, '[]map[string]any'],\n [/^\\[\\]string\\{/, '[]string'], [/^\\[\\]any\\{/, '[]any'], [/^\"/, 'string'], [/^(?:true|false)$/, 'bool'], [/^(?:-?[0-9]|math\\.)/, 'int64']];\n return shapes.find(([re]) => re.test(shape))?.[1];\n }\n\n // Go type candidates for a nil-defaulted parameter, in try order: the annotation text\n // (`Int` vs `Num` exist only there), then goNativeParameterTypeCandidates.\n goGetArgDeclaredTypeCandidates(param): string[] {\n const out: string[] = [];\n const declared = (param?.type !== undefined) ? String(param.type.getText()).replace(/\\s+/g, ' ') : undefined;\n const alias: any = this.CCXT_GO_GETARG_DECLARED_TYPES ?? {};\n if ((declared !== undefined) && (alias[declared] !== undefined)) {\n out.push(alias[declared]);\n } else if ((declared !== undefined) && this.goGetArgPrimitiveType(declared) !== undefined) {\n out.push('*' + this.goGetArgPrimitiveType(declared));\n }\n for (const goType of this.goNativeParameterTypeCandidates(param)) {\n if (out.indexOf(goType) < 0) {\n out.push(goType);\n }\n }\n return out;\n }\n\n goGetArgPrimitiveType(declared: string): string | undefined {\n switch (declared) {\n case 'Int': case 'Integer': case 'int': return 'int64';\n case 'Num': case 'number': case 'Float': return 'float64';\n case 'Bool': case 'boolean': return 'bool';\n case 'Str': case 'string': case 'String': return 'string';\n }\n return undefined;\n }\n\n // the twin of a declared Go type (go/v4/exchange_helpers.go); undefined when the twin is\n // missing, in which case the parameter keeps the `any` box (an `any` return must never be\n // assigned to a typed local)\n goGetArgTwinName(goType: string): string | undefined {\n switch (goType) {\n case 'map[string]any': return 'GetArgMap';\n case '[]map[string]any': return 'GetArgMapSlice';\n case '[]string': return 'GetArgStringSlice';\n case '[]any': return 'GetArgAnySlice';\n case 'string': return 'GetArgString';\n case 'bool': return 'GetArgBool';\n case 'int64': return 'GetArgInt64';\n case 'float64': return 'GetArgFloat64';\n case '*string': return 'GetArgStringPtr';\n case '*int64': return 'GetArgInt64Ptr';\n case '*float64': return 'GetArgFloat64Ptr';\n case '*bool': return 'GetArgBoolPtr';\n }\n return undefined;\n }\n\n goGetArgIsValueType(goType: string): boolean {\n return (goType === 'string') || (goType === 'bool') || (goType === 'int64') || (goType === 'float64');\n }\n\n goGetArgLocalIsSafe(body, param, goType: string, nilable = false): boolean {\n const name = param.name.text;\n if (this.goGetArgTwinName(goType) === undefined) {\n return false; // no twin for this type: keep the `any` box\n }\n if (!this.goLocalIsSafeToType(body, param, name, goType)) {\n return false;\n }\n if (this.goGetArgIsValueType(goType)) {\n // `x == nil` does not compile for a Go string/bool/int64/float64: keep the box\n return this.goParameterKeepsNilCompareNative(body, param, goType);\n }\n return this.goGetArgConsumersAreSafe(body, param, goType, nilable);\n }\n\n // Every later use must read the typed local as it read the `any` box: pointers only reach\n // audited deref consumers (fail-closed); containers are the same map/list, and nil-sensitive\n // consumers are tabled as `container` (goGetArgPassesIntoContainerDefault covers call chains).\n goGetArgConsumersAreSafe(body, param, goType: string, nilable: boolean): boolean {\n return this.goGetArgUsesAreSafe(body, param, param.name.text, goType, nilable, new Set());\n }\n\n // `(x === undefined) ? d : x` / `x !== undefined ? x : d`: the arm holding `n` only runs when\n // the same name is not nil, so the copy never boxes a typed nil\n goGetArgArmIsNilGuarded(n: any, cond: any): boolean {\n let test: any = cond.condition;\n while (test?.kind === SyntaxKind.ParenthesizedExpression) {\n test = test.expression;\n }\n if ((test?.kind !== SyntaxKind.BinaryExpression)) {\n return false;\n }\n const isNil = (e: any) => (e?.kind === SyntaxKind.NullKeyword) || ((e?.kind === SyntaxKind.Identifier) && (e.text === 'undefined'));\n const sameName = (e: any) => (e?.kind === SyntaxKind.Identifier) && (e.text === n.text);\n if (!((sameName(test.left) && isNil(test.right)) || (sameName(test.right) && isNil(test.left)))) {\n return false;\n }\n const op = test.operatorToken?.kind;\n const eq = (op === SyntaxKind.EqualsEqualsEqualsToken) || (op === SyntaxKind.EqualsEqualsToken);\n const ne = (op === SyntaxKind.ExclamationEqualsEqualsToken) || (op === SyntaxKind.ExclamationEqualsToken);\n let arm: any = n;\n while (arm.parent !== cond) {\n arm = arm.parent;\n }\n return (eq && (arm === cond.whenFalse)) || (ne && (arm === cond.whenTrue));\n }\n\n // a native int64/float64 arithmetic result boxes the same number its Add/Subtract/... helper form\n // boxed, so it reads like that helper write rather than a value-family write\n goGetArgWriteIsNativeArithmetic(rhs: any): boolean {\n let e: any = rhs;\n while (e?.kind === SyntaxKind.ParenthesizedExpression) {\n e = e.expression;\n }\n const ops = [SyntaxKind.PlusToken, SyntaxKind.MinusToken, SyntaxKind.AsteriskToken, SyntaxKind.SlashToken, SyntaxKind.PercentToken];\n if ((e?.kind !== SyntaxKind.BinaryExpression) || !ops.includes(e.operatorToken?.kind)) {\n return false;\n }\n const goType = this.goNativeArithmeticType(e) ?? this.goConstantProductKind(e);\n return (goType === 'int64') || (goType === 'float64');\n }\n\n // the body-local `r` a copy `let r = x` / `r = x` lands in (the value, not the box, is copied)\n goGetArgCopyTarget(use: any, body: any): any {\n const parent: any = use.parent;\n let target: any;\n if ((parent?.kind === SyntaxKind.VariableDeclaration) && (parent.initializer === use)) {\n target = parent;\n } else if ((parent?.kind === SyntaxKind.BinaryExpression) && (parent.right === use)\n && (parent.operatorToken?.kind === SyntaxKind.EqualsToken) && (parent.left?.kind === SyntaxKind.Identifier)\n && (parent.parent?.kind === SyntaxKind.ExpressionStatement)) {\n try {\n target = this.getChecker().getSymbolAtLocation(parent.left)?.valueDeclaration?.resolve();\n } catch (e) {\n target = undefined;\n }\n }\n if ((target?.kind !== SyntaxKind.VariableDeclaration) || (target.name?.kind !== SyntaxKind.Identifier)) {\n return undefined;\n }\n let inBody = false;\n for (let p: any = target.parent; p !== undefined; p = p.parent) {\n inBody = inBody || (p === body);\n }\n // a value-typed write (`r = \"s\"`) may type the copy as the pointer's value family\n let valueWrite = false;\n const visit = (n: any): void => {\n if (valueWrite) {\n return;\n }\n if ((n.kind === SyntaxKind.BinaryExpression) && (n.operatorToken?.kind === SyntaxKind.EqualsToken)\n && (n.left?.kind === SyntaxKind.Identifier) && (n.left.text === target.name.text)) {\n valueWrite = this.goGetArgIsValueType(String(this.goTypeOfInitializer(n.right, this.printNode(n.right, 0))))\n && !this.goGetArgWriteIsNativeArithmetic(n.right);\n }\n n.forEachChild(visit);\n };\n body.forEachChild(visit);\n return (inBody && !valueWrite) ? target : undefined;\n }\n\n goGetArgUsesAreSafe(body, param, name: string, goType: string, nilable: boolean, seen: Set, boxed = false): boolean {\n seen.add(param);\n const table: any = this.CCXT_GO_GETARG_SAFE_CONSUMERS ?? {};\n const pointer = goType.startsWith('*');\n let safe = true;\n const verdictOf = (callee: string, argIndex: number): string => {\n // the table is keyed by the printed Go callee (`this.market` prints `this.Market`); a\n // pointer is unwrapped by derefScalar, a nil map is not, so only pointers fold the case\n const goName = callee.charAt(0).toUpperCase() + callee.slice(1);\n const entry = table[callee] ?? (pointer ? (table[goName] ?? table[goName + 'Async']) : undefined);\n if (entry === undefined) {\n // a nil-defaulted container may be handed back through `any` as a non-nil typed nil\n return (pointer || nilable) ? 'unknown' : 'deref';\n }\n if (typeof entry === 'string') {\n return entry;\n }\n return entry[String(argIndex)] ?? entry['*'] ?? (pointer ? 'unknown' : 'deref');\n };\n const visit = (n: any): void => {\n if (!safe) {\n return;\n }\n if ((n?.kind === SyntaxKind.Identifier) && (n.text === name)) {\n let symbol;\n try {\n symbol = this.getChecker().getSymbolAtLocation(n);\n } catch (e) {\n symbol = undefined;\n }\n if (symbol?.valueDeclaration?.resolve() === param) {\n const parent: any = n.parent;\n if (parent === param) {\n return; // the parameter's own name is not a use\n }\n if (nilable && (goType === 'map[string]any')) {\n // goLocalIsSafeToType already matched the type of an assigned value\n const assigned = (parent?.kind === SyntaxKind.BinaryExpression) && (parent.left === n)\n && (parent.operatorToken?.kind === SyntaxKind.EqualsToken);\n if (assigned || this.goGetArgNilMapUseOnlyReads(n)) {\n return;\n }\n }\n if (nilable && (goType === '[]string') && this.goGetArgNilStringSliceUseOnlyReads(n)) {\n return;\n }\n if (pointer && (parent?.kind === SyntaxKind.BinaryExpression)) {\n // a write already type-matched by goLocalIsSafeToType, or the key of `x in d` (InOp derefs it)\n const op = parent.operatorToken?.kind;\n if ((parent.left === n) && ((op === SyntaxKind.EqualsToken) || (op === SyntaxKind.InKeyword))) {\n return;\n }\n // `x === 'lit'`: a pointer operand prints nil-guarded native or through IsEqual (derefs)\n const other: any = (parent.left === n) ? parent.right : parent.left;\n const equality = [SyntaxKind.EqualsEqualsEqualsToken, SyntaxKind.ExclamationEqualsEqualsToken].includes(op);\n if (equality && ((other?.kind === SyntaxKind.StringLiteral) || (other?.kind === SyntaxKind.NumericLiteral))) {\n return;\n }\n }\n // a copy (ternary arm, `let r = x`, `r = x`) hands the value to a body local whose\n // own uses must pass the same rules; an `any` alias prints its nil tests via IsEqual,\n // which derefs a nil pointer but not a nil map, so containers need a nil-guarded arm\n let use: any = n;\n let guarded = false;\n while ((use.parent?.kind === SyntaxKind.ParenthesizedExpression)\n || ((use.parent?.kind === SyntaxKind.ConditionalExpression) && (use.parent.condition !== use))) {\n if (use.parent.kind === SyntaxKind.ConditionalExpression) {\n guarded = guarded || this.goGetArgArmIsNilGuarded(n, use.parent);\n }\n use = use.parent;\n }\n const target = (pointer || nilable) ? this.goGetArgCopyTarget(use, body) : undefined;\n if (target !== undefined) {\n if ((!pointer && guarded) || seen.has(target)) {\n return;\n }\n safe = this.goGetArgUsesAreSafe(body, target, target.name.text, goType, nilable, seen, true);\n return;\n }\n if ((use !== n) && (pointer || nilable)) {\n safe = pointer && this.goGetArgPointerStoredAsValue(use, param);\n return;\n }\n // a non-nil container arm hands the same map/list value on (as before copies were followed)\n if (parent?.kind === SyntaxKind.BinaryExpression) {\n const other: any = (parent.left === n) ? parent.right : parent.left;\n const isNullTest = (other?.kind === SyntaxKind.NullKeyword)\n || ((other?.kind === SyntaxKind.Identifier) && (other.text === 'undefined'));\n if (isNullTest) {\n // an `any` alias tests the box through IsEqual: a nil map box is not nil\n safe = pointer || !boxed;\n return;\n // `x == nil` / `x != nil`: native for a pointer and for a container\n // (a nil map compares equal to nil exactly like the untyped nil box\n // did when the value came in untyped); a value type never gets here.\n safe = true;\n return;\n }\n }\n if (parent?.kind === SyntaxKind.CallExpression) {\n const args: any[] = parent.arguments ?? [];\n const argIndex = args.indexOf(n);\n const callee: any = parent.expression;\n let calleeName = (callee?.name !== undefined) ? callee.name.text\n : ((callee?.text !== undefined) ? callee.text : undefined);\n // Math.min / Math.max print as the deref-aware mathMin / mathMax\n if ((callee?.expression?.text === 'Math') && ((calleeName === 'min') || (calleeName === 'max'))) {\n calleeName = 'math' + calleeName.charAt(0).toUpperCase() + calleeName.slice(1);\n }\n if (calleeName === undefined) {\n safe = !pointer && !nilable;\n return;\n }\n const verdict = verdictOf(calleeName, argIndex);\n if ((verdict === 'unsafe') || ((verdict === 'container') && nilable)) {\n safe = false;\n return;\n }\n if ((calleeName === 'IsEqual') && nilable) {\n // IsEqual(x, nil) tests the *box*: an untyped nil answered true, a nil\n // map is not equal to nil\n const other: any = (argIndex === 0) ? args[1] : args[0];\n const otherIsNil = (other === undefined) || (other?.kind === SyntaxKind.NullKeyword)\n || ((other?.kind === SyntaxKind.Identifier) && (other.text === 'undefined'));\n if (otherIsNil) {\n safe = false;\n return;\n }\n }\n // GetArg folds a nil map box to its default, and a defaulted position binds through GetArg or its\n // twins, which deref a pointer and fold a nil one: both read it as absent\n if (verdict === 'unknown') {\n safe = ((nilable && (goType === 'map[string]any')) || pointer) && this.goGetArgPositionIsDefaulted(callee, argIndex);\n return;\n }\n if (nilable && !pointer && this.goGetArgPassesIntoContainerDefault(callee, argIndex)) {\n safe = false;\n return;\n }\n safe = true;\n return;\n }\n if (parent?.kind === SyntaxKind.ExpressionStatement) {\n safe = true; // `_ = x` and other inert statements\n return;\n }\n if (pointer && this.goGetArgPointerStoredAsValue(n, param)) {\n safe = true;\n return;\n }\n if (pointer && this.goGetArgPointerInHelperArithmetic(n)) {\n safe = true;\n return;\n }\n // a bare read hands the local on as `any`: a pointer or a nil-defaulted container would\n // no longer compare equal to nil there, so both keep the box\n safe = !pointer && !nilable;\n return;\n }\n }\n n.forEachChild(visit);\n };\n body.forEachChild(visit);\n return safe;\n }\n\n // `x / 1000`, `x - 1`, `x > 0`: printed through Divide/Subtract/…/IsGreaterThan, which\n // derefScalar both operands at entry (checked on the printed text by the caller's diff)\n goGetArgPointerInHelperArithmetic(n: any): boolean {\n const parent: any = n.parent;\n if (parent?.kind !== SyntaxKind.BinaryExpression) {\n return false;\n }\n const ops = [SyntaxKind.SlashToken, SyntaxKind.MinusToken, SyntaxKind.AsteriskToken, SyntaxKind.PercentToken,\n SyntaxKind.GreaterThanToken, SyntaxKind.LessThanToken, SyntaxKind.GreaterThanEqualsToken, SyntaxKind.LessThanEqualsToken];\n if (!ops.includes(parent.operatorToken?.kind)) {\n return false;\n }\n const printed = this.printNode(parent, 0).trim();\n return /^(?:\\(\\s*)*(?:Divide|Subtract|Multiply|Mod|IsGreaterThan|IsLessThan|IsGreaterThanOrEqual|IsLessThanOrEqual)\\(/.test(printed);\n }\n\n // `request[k] = x` / `{ k: x }`: the pointer lands in an `any` dictionary whose readers\n // (GetValue, Urlencode, Json, IsEqual) derefScalar it; a `*Request` builder returns that\n // dictionary to its caller, so it keeps the box\n goGetArgPointerStoredAsValue(n: any, param: any): boolean {\n const parent: any = n.parent;\n const stored = ((parent?.kind === SyntaxKind.BinaryExpression) && (parent.right === n)\n && (parent.operatorToken?.kind === SyntaxKind.EqualsToken)\n && (parent.left?.kind === SyntaxKind.ElementAccessExpression))\n || ((parent?.kind === SyntaxKind.PropertyAssignment) && (parent.initializer === n));\n let method: any = param?.parent;\n while ((method !== undefined) && !isFunctionLike(method)) {\n method = method.parent;\n }\n const methodName = String(method?.name?.text ?? '');\n return stored && !methodName.endsWith('Request');\n }\n\n // element `index` of a tuple-typed call result is `Dict` (`[T, Dict]`); the Go tuple holds\n // that map, so MapTyped reads the same dictionary back\n goTupleElementIsDict(right: any, index: number): boolean {\n const checker: any = this.checkerOrUndefined();\n if ((checker === undefined) || (index < 0)) {\n return false;\n }\n const expr: any = (right?.kind === SyntaxKind.AwaitExpression) ? right.expression : right;\n if (expr?.kind !== SyntaxKind.CallExpression) {\n return false;\n }\n const type: any = checker.getTypeAtLocation(expr);\n if ((type === undefined) || !checker.isTupleType(type)) {\n return this.goParamsTupleHelperIndex(expr) === index;\n }\n const element: any = checker.getTypeArguments(type)?.[index];\n return (element !== undefined) && !(element.flags & (TypeFlags.Any | TypeFlags.Unknown))\n && this.goParameterTypeIsDict(element);\n }\n\n // `this.handleXxx(…, params, …)` of a base helper typed `any[]` whose element holds the params\n // map it was given after omit/extend; only when that element is the same map-typed local\n goParamsTupleHelperIndex(call: any): number {\n const callee: any = call?.expression;\n if ((callee?.kind !== SyntaxKind.PropertyAccessExpression) || (callee.expression?.kind !== SyntaxKind.ThisKeyword)) {\n return -1;\n }\n const index = GO_PARAMS_TUPLE_HELPERS[callee.name?.text];\n if (index === undefined) {\n return -1;\n }\n const target: any = call.parent?.left?.elements?.[index];\n const passesTarget = (target?.kind === SyntaxKind.Identifier)\n && (call.arguments ?? []).some((a: any) => (a.kind === SyntaxKind.Identifier) && (a.text === target.text));\n return passesTarget ? index : -1;\n }\n\n // the safety check of a map-typed GetArg local: a Dict tuple element written into it is printed\n // through MapTyped once the local is bound as a map (no recursion into goGetArgLocalType)\n goGetArgTupleWriteIsDict(declaration: any, right: any, index: number): boolean {\n return (declaration?.kind === SyntaxKind.Parameter) && (declaration.initializer !== undefined)\n && this.goTupleElementIsDict(right, index);\n }\n\n // `[x, params] = f()` writes a GetArg local bound as map[string]any: unbox the element\n goGetArgBindsDictElement(leftElement: any, right: any, index: number): boolean {\n if ((leftElement?.kind !== SyntaxKind.Identifier) || !this.goTupleElementIsDict(right, index)) {\n return false;\n }\n let decl: any;\n try {\n decl = this.checkerOrUndefined()?.getSymbolAtLocation(leftElement)?.valueDeclaration?.resolve();\n } catch (e) {\n decl = undefined;\n }\n if ((decl?.kind !== SyntaxKind.Parameter) || (decl.initializer === undefined) || (decl.parent?.body === undefined)) {\n return false;\n }\n return this.goGetArgParameterType(decl) === 'map[string]any';\n }\n\n // the Go type a defaulted parameter's GetArg twin binds (undefined: the `any` GetArg); the one\n // predicate shared by the binding line and every consumer's printing\n goGetArgParameterType(decl: any): string | undefined {\n if ((decl?.kind !== SyntaxKind.Parameter) || (decl.initializer === undefined) || (decl.dotDotDotToken !== undefined)\n || (decl.name?.kind !== SyntaxKind.Identifier) || (decl.parent?.body === undefined)\n || ![SyntaxKind.MethodDeclaration, SyntaxKind.FunctionDeclaration].includes(decl.parent.kind)) {\n return undefined;\n }\n this.goGetArgTypeCache ??= new WeakMap();\n if (!this.goGetArgTypeCache.has(decl)) {\n this.goGetArgTypeCache.set(decl, undefined);\n this.goGetArgTypeComputing ??= new Set();\n this.goGetArgTypeComputing.add(decl);\n let goType: string | undefined;\n try {\n goType = this.goGetArgLocalType(decl.parent.body, decl, this.printNode(decl.initializer, 0));\n } finally {\n this.goGetArgTypeComputing.delete(decl);\n }\n this.goGetArgTypeCache.set(decl, (goType !== undefined) && (this.goGetArgTwinName(goType) !== undefined) ? goType : undefined);\n }\n return this.goGetArgTypeCache.get(decl);\n }\n\n // argument `argIndex` of the callee binds a parameter with a TypeScript default (GetArg-bound)\n goGetArgPositionIsDefaulted(callee: any, argIndex: number): boolean {\n if (argIndex < 0) {\n return false;\n }\n let decl: any;\n try {\n decl = this.getChecker().getSymbolAtLocation(callee)?.valueDeclaration?.resolve();\n } catch (e) {\n decl = undefined;\n }\n const kinds = [SyntaxKind.MethodDeclaration, SyntaxKind.FunctionDeclaration];\n const param: any = (decl !== undefined) && kinds.includes(decl.kind) ? decl.parameters?.[argIndex] : undefined;\n return (param?.initializer !== undefined) && (param.dotDotDotToken === undefined);\n }\n\n // the callee's own GetArg with a container default returns def for an untyped nil box but the\n // nil map for a nil map box (nil slices collapse to def), so only map shapes differ\n goGetArgPassesIntoContainerDefault(callee: any, argIndex: number): boolean {\n if (argIndex < 0) {\n return false;\n }\n let symbol;\n try {\n symbol = this.getChecker().getSymbolAtLocation(callee);\n } catch (e) {\n symbol = undefined;\n }\n const decl: any = symbol?.valueDeclaration?.resolve();\n const params: any[] = decl?.parameters ?? [];\n const param: any = params[argIndex];\n const initializer: any = param?.initializer;\n if (initializer === undefined) {\n return false;\n }\n return initializer.kind === SyntaxKind.ObjectLiteralExpression;\n }\n\n printFunctionBody(node, identation, wrapInChannel = false) {\n\n // check if there is any default parameter to initialize\n let functionBody: string;\n const funcParams = node.parameters;\n const initParams = [];\n if (funcParams.length > 0) {\n const body = node.body.statements;\n const first = body.length > 0 ? body[0] : [];\n const remaining = body.length > 0 ? body.slice(1): [];\n let firstStatement = this.printNode(first, identation + 1);\n\n const remainingString = remaining.map((statement) => this.printNode(statement, identation + 1)).join(\"\\n\");\n let offSetIndex = 0;\n funcParams.forEach((param, i) => {\n const initializer = param.initializer;\n if (initializer) {\n const index = i + offSetIndex;\n // index = index < 0 ? 0 : i - 1;\n const paramName = this.printNode(param.name, 0);\n const printedDefault = this.printNode(initializer, 0);\n // a default that names a Go type exactly binds through its typed twin; others keep GetArg (ABI unchanged)\n const goType = this.goGetArgParameterType(param);\n const twinName = (goType !== undefined) ? this.goGetArgTwinName(goType) : undefined;\n if ((goType !== undefined) && (twinName !== undefined)) {\n initParams.push(`var ${paramName} ${goType} = ${twinName}(optionalArgs, ${index}, ${printedDefault})`);\n } else {\n initParams.push(`${paramName} := GetArg(optionalArgs, ${index}, ${printedDefault})`);\n }\n initParams.push(`_ = ${paramName}`);\n } else {\n offSetIndex--;\n }\n });\n\n if (initParams.length > 0) {\n const defaultInitializers = initParams.map( l => this.getIden(identation+1) + l ).join(\"\\n\") + \"\\n\";\n const bodyParts = firstStatement.split(\"\\n\");\n const commentPart = bodyParts.filter(line => this.isComment(line));\n const isComment = commentPart.length > 0;\n if (isComment) {\n // the statement's leading comment must keep the ' * ' continuation-alignment\n // of printLeadingComments: gofmt re-indents a /* */ block to\n // ` * text` (printer.stripCommonPrefix + the tab indent), so a bare\n // trim() here would emit `* text` under the '/**'.\n const commentPartString = commentPart.map((c) => {\n const line = c.trim();\n return this.getIden(identation+1) + (line.startsWith(\"*\") ? \" \" + line : line);\n }).join(\"\\n\");\n const firstStmNoComment = bodyParts.filter(line => !this.isComment(line)).join(\"\\n\");\n firstStatement = commentPartString + \"\\n\" + defaultInitializers + firstStmNoComment;\n } else {\n firstStatement = defaultInitializers + firstStatement;\n }\n }\n const blockOpen = this.getBlockOpen(identation);\n const blockClose = this.getBlockClose(identation);\n firstStatement = remainingString.length > 0 ? firstStatement + \"\\n\" : firstStatement;\n if (!wrapInChannel) {\n functionBody = blockOpen + firstStatement + remainingString + blockClose;\n } else {\n functionBody = firstStatement + remainingString;\n }\n } else {\n if (!wrapInChannel) {\n functionBody = super.printFunctionBody(node, identation);\n } else {\n functionBody = node.body.statements.map(statement => this.printNode(statement, identation + 1)).join(\"\\n\");\n }\n }\n if (wrapInChannel) {\n // return statement might be inside ifs or other complex statements so we still have to replace them manually :(\n // functionBody = functionBody.replace(/(\\s*)return\\s+([^\\n]+\\n?)/g, '$1ch <- $2$1');\n // the body half of the trampoline pair is a flat function body: the statements\n // are already printed at their own level, so no extra indentation level is added here\n const lastLine = functionBody.split(\"\\n\").pop().trim();\n // no trailing return after a return/panic or a conditional that returns in all branches\n const shouldAddLastReturn = !lastLine.startsWith(\"return\") && !lastLine.startsWith(\"panic\")\n && !(node.body && this.blockEndsWithConditionalReturn(node.body.statements));\n\n // This is the *body* half of the trampoline pair (see printAsyncTrampolineBlock):\n //\n // func (this *Exchange) fetchTickerBody(ch chan any, symbol any) any {\n // defer close(ch)\n // defer ReturnPanicError(ch)\n // ch <- ...\n // return nil\n // }\n //\n // It is a plain flat function: the trampoline already `go`es it, so there is no\n // `go func() any {...}()` envelope here, and no channel allocation either — the\n // trampoline owns `ch` and hands it in. The recover lives HERE, on the goroutine\n // that can actually panic, which is why the trampoline's result can stay unnamed.\n const lines = [\n \"{\",\n `${this.getIden(identation + 1)}defer close(ch)`,\n `${this.getIden(identation + 1)}defer ReturnPanicError(ch)`,\n functionBody,\n ];\n if (shouldAddLastReturn) {\n lines.push(this.getIden(identation+1) + \"return nil\");\n }\n lines.push(`${this.getIden(identation)}}`);\n functionBody = lines.join(\"\\n\");\n\n // to do fix this later\n // we can't pass nil to the channel when we just want to\n // return from the try catch, otherwise the channel will close with nil\n // instead of the proper result\n functionBody = functionBody.replaceAll(/(^\\s*)ch\\s<-\\snil\\s+return\\snil(\\s*\\})/gm, \"$1return nil$2\");\n\n }\n\n return functionBody;\n }\n\n printAwaitExpression(node, identation) {\n const expression = this.printNode(node.expression, identation);\n if (expression.startsWith(\"<-\")) {\n return expression;\n }\n return `(<-${expression})`;\n }\n\n printInstanceOfExpression(node: BinaryExpression, identation: number): string {\n const left = this.printNode (node.left);\n const right = this.printNode (node.right);\n return this.getIden(identation) + `IsInstance(${left}, ${right})`;\n }\n\n getLineBasedSuffix(node): string {\n const { line, character } = this.getSrc().getLineAndCharacterOfPosition(node.getStart());\n return `${line}${character}`;\n }\n\n printExpressionStatement(node, identation) {\n\n if (node?.expression?.kind === SyntaxKind.AsExpression) {\n node = node.expression;\n }\n if (node.expression.kind !== SyntaxKind.AwaitExpression) {\n return this.stripWhitespaceOnlyLines (super.printExpressionStatement(node, identation));\n }\n\n const exprStm = this.printNode(node.expression, identation);\n\n // const { line, character } = this.getSrc().getLineAndCharacterOfPosition(node.getStart());\n // console.log(`line: ${line}, character: ${character}`);\n const returnRandName = \"retRes\" + this.getLineBasedSuffix(node);\n\n // const expStatement =this.getIden(identation) + exprStm + this.LINE_TERMINATOR;\n\n // the awaited call's value is discarded here (`await this.loadMarkets();`), so the\n // extension may still name it: `var retResNNN T = MapTyped(PanicOnError(<-...))`\n const stmtUnbox = this.goAwaitReceiveUnbox(node.expression, exprStm);\n const expStatement = (stmtUnbox !== undefined)\n ? `\n${this.getIden(identation)}var ${returnRandName} ${stmtUnbox.goType} = ${stmtUnbox.wrap(exprStm)}`\n // the discarded value needs no local: PanicOnError still surfaces the channel's error\n : `\n${this.getIden(identation)}PanicOnError(${exprStm.trim()})`;\n return this.printNodeCommentsIfAny(node, identation, expStatement);\n }\n\n isInsideAsyncFunction(returnStatementNode) {\n let currentNode = returnStatementNode;\n\n while (currentNode) {\n // Check if the current node is a function or method\n if (isFunctionDeclaration(currentNode) ||\n isFunctionExpression(currentNode) ||\n isArrowFunction(currentNode) ||\n isMethodDeclaration(currentNode)) {\n return this.isAsyncFunction(currentNode);\n }\n // Move up the tree to the parent node\n currentNode = currentNode.parent;\n }\n\n // Return false if no async function or method is found\n return false;\n }\n\n /**\n * Statement that terminates an async (channel returning) function body.\n *\n * The body is the trampoline's sibling method (`go this.fetchTickerBody(ch, ...)`),\n * and the synthetic try/catch closures nest inside it: in both cases `return` leaves\n * a function whose result is a plain `any`, never the channel. The trampoline itself\n * owns the single `return ch`, emitted by printFunctionBody.\n */\n getAsyncReturnStatement(node): string {\n return \"return nil\";\n }\n\n printReturnStatement(node, identation) {\n\n const isAsyncFunction = this.isInsideAsyncFunction(node);\n // if (node?.expression?.kind !== SyntaxKind.AwaitExpression) {\n // return super.printReturnStatement(node, identation);\n // }\n if (!isAsyncFunction) {\n return super.printReturnStatement(node, identation);\n }\n\n const leadingComment = this.printLeadingComments(node, identation);\n let trailingComment = this.printTraillingComment(node, identation);\n trailingComment = trailingComment ? \" \" + trailingComment : trailingComment;\n const exp = node.expression;\n let rightPart = exp ? (' ' + this.printNode(exp, identation)) : '';\n rightPart = rightPart.trim();\n\n // `return nil` only exits the synthetic try/catch closure; at the function's own\n // level the async core has to hand the (named) result channel back instead.\n const returnStatement = this.getAsyncReturnStatement(node);\n\n if (node?.expression?.kind === SyntaxKind.AsExpression) {\n node = node.expression;\n }\n\n if (node?.expression?.kind === SyntaxKind.AwaitExpression) {\n const returnRandName = \"retRes\" + this.getLineBasedSuffix(node.expression);\n // the template's `:= ` already supplies the separator; keep the printed expression\n // flush so the receive reads `retResNNN := (<-this.X())` (gofmt spacing)\n const printedExpr = rightPart;\n rightPart = rightPart ? rightPart + this.LINE_TERMINATOR : this.LINE_TERMINATOR;\n // return leadingComment + this.getIden(identation) + this.RETURN_TOKEN + rightPart + trailingComment;\n // printLeadingComments returns the comment lines with their own indentation and a\n // trailing newline, so the comment is emitted as its own line(s) and the `ch <-`\n // line carries the indentation the comment would otherwise have swallowed.\n const retUnbox = this.goAwaitReceiveUnbox(node.expression, printedExpr);\n if (retUnbox !== undefined) {\n return `\n${this.getIden(identation)}var ${returnRandName} ${retUnbox.goType} = ${retUnbox.wrap(printedExpr)}\n${leadingComment}${this.getIden(identation)}ch <- ${returnRandName}${trailingComment}\n${this.getIden(identation)}${returnStatement}`;\n }\n return `\n${this.getIden(identation)}${returnRandName} := ${rightPart}\n${this.getIden(identation)}PanicOnError(${returnRandName})\n${leadingComment}${this.getIden(identation)}ch <- ${returnRandName}${trailingComment}\n${this.getIden(identation)}${returnStatement}`;\n // ${this.getIden(identation)}return ${returnRandName}`;\n }\n\n if (rightPart.length === 0) {\n return `\\n${this.getIden(identation)}${returnStatement}`;\n }\n\n return `\n${leadingComment}${this.getIden(identation)}ch <- ${rightPart}${trailingComment}\n${this.getIden(identation)}${returnStatement}`;\n // ${this.getIden(identation)}return ${rightPart}`;\n // ${this.getIden(identation)}return ${rightPart}`;\n }\n\n\n printArrayLiteralExpression(node, identation = 0) {\n // elements that span lines (object literals, calls carrying one) need the\n // statement's own level so their bodies land one level deeper\n // …but an element is inline after `{`, so any leading indent a printer prepends is trimmed\n // go/printer prints composite literal elements at depth 1 (exprList(..., 1, ...))\n const elements = node.elements.map((e) => this.goWithExprDepth(1, () => this.printNode(e, identation)).trim()).join(\", \");\n // a list of calls (promises included) always opens as `[]any{`; getFunctionType is kept for its\n // checker side effect (it caches a signature on the call node)\n const first = node.elements[0];\n const arrayOpen = (first?.kind === SyntaxKind.CallExpression) && (this.getFunctionType(first) || true)\n ? '[]any{' : this.ARRAY_OPENING_TOKEN;\n return arrayOpen + elements + this.ARRAY_CLOSING_TOKEN;\n }\n\n printArgsForCallExpression(node, identation) {\n const unified = this.goUnifiedStringCallArgs(node, identation);\n if (unified !== undefined) {\n return unified;\n }\n // go/printer prints the arguments of a call with more than one argument\n // one level deeper than the call itself (nodes.go, CallExpr)\n if (node.arguments && node.arguments.length > 1) {\n return this.goWithExprDepth(this.goExprDepth + 1, () => super.printArgsForCallExpression(node, identation));\n }\n return super.printArgsForCallExpression(node, identation);\n }\n\n // check this out later\n\n // IsArray(v) answers true exactly for the slice types its runtime type switch lists\n // and false for every other box, a nil box included. On an operand whose Go type the\n // printer can name the predicate is that constant.\n isArraySliceTypes = [ '[]any', '[][]any', '[]map[string]any', '[]string', '[]bool',\n '[]int', '[]int8', '[]int16', '[]int32', '[]int64', '[]float32', '[]float64',\n '[]uint', '[]uint8', '[]uint16', '[]uint32', '[]uint64' ];\n\n // the other Go types the printer can name: a map, a string, a bool, a number, or a\n // pointer to a scalar — none of them is a slice the switch matches\n isArrayNonSliceTypes = [ 'map[string]any', 'string', 'bool', 'int', 'int64', 'float64',\n '*string', '*int64', '*float64', '*bool', '*int' ];\n\n // true when the identifier keeps a reference besides this one: the constant fold\n // drops the call's reference to the operand, and Go rejects a local that ends up\n // unused, so an operand without another use keeps the helper\n goIdentifierUsedElsewhere(nameNode): boolean {\n const scope = this.goEnclosingFunction(nameNode);\n if (scope === undefined) {\n return false;\n }\n const name = nameNode.text;\n let used = false;\n const visit = (n) => {\n if (used) {\n return;\n }\n if ((n.kind === SyntaxKind.Identifier) && (n.text === name) && (n !== nameNode)) {\n const parent = n.parent;\n const isDeclarationName = (parent?.kind === SyntaxKind.VariableDeclaration) && (parent.name === n);\n const isPropertyName = (parent?.kind === SyntaxKind.PropertyAccessExpression) && (parent.name === n);\n if (!isDeclarationName && !isPropertyName) {\n used = true;\n return;\n }\n }\n n.forEachChild(visit);\n };\n scope.forEachChild(visit);\n return used;\n }\n\n // the local is printed `any` yet every value that reaches it is a []any: it starts\n // from a slice initializer and no later statement rebinds it (a push only appends\n // to the same slice), so the box holds a []any at every use\n goLocalHoldsOnlyArrays(nameNode): boolean {\n const checker: any = this.checkerOrUndefined();\n if (checker === undefined) {\n return false;\n }\n const symbol = checker.getSymbolAtLocation(nameNode);\n const declaration: any = symbol?.valueDeclaration?.resolve();\n if ((declaration?.kind !== SyntaxKind.VariableDeclaration) || (declaration.initializer === undefined)) {\n return false;\n }\n if (this.goTypeOfInitializer(declaration.initializer, this.printNode(declaration.initializer, 0)) !== '[]any') {\n return false;\n }\n const scope = this.goEnclosingFunction(declaration);\n if (scope === undefined) {\n return false;\n }\n const name = declaration.name.text;\n let safe = true;\n const visit = (n) => {\n if (!safe) {\n return;\n }\n if ((n.kind === SyntaxKind.Identifier) && (n.text === name) && (n !== declaration.name) && (n !== nameNode)) {\n const parent = n.parent;\n if (parent?.kind === SyntaxKind.VariableDeclaration && parent.name === n) {\n return; // a sibling block-scoped declaration; it gets its own type\n }\n if (this.goRebindingTargetOf(n) !== undefined) {\n safe = false; // a rebinding write can box another type\n return;\n }\n }\n n.forEachChild(visit);\n };\n scope.forEachChild(visit);\n return safe;\n }\n\n // native IsArray: a constant for an operand whose Go type the printer proves, and\n // the two-value assertion on an `any` box that only ever holds a []any\n printNativeIsArray(node, parsedArg: string | undefined): string | undefined {\n if ((typeof parsedArg !== 'string') || parsedArg.includes('\\n')) {\n return undefined;\n }\n const argNode = node.arguments?.[0];\n if (argNode?.kind !== SyntaxKind.Identifier) {\n return undefined; // a call operand may have effects and has no declared type\n }\n const goType = this.goPrintedTypeOfExpression(argNode, parsedArg);\n if (goType !== undefined) {\n const isSlice = this.isArraySliceTypes.indexOf(goType) >= 0;\n if (isSlice || (this.isArrayNonSliceTypes.indexOf(goType) >= 0)) {\n return this.goIdentifierUsedElsewhere(argNode) ? (isSlice ? 'true' : 'false') : undefined;\n }\n return undefined;\n }\n if (!this.goLocalHoldsOnlyArrays(argNode)) {\n return undefined;\n }\n // the box only ever holds a []any, so the assertion answers what the type switch\n // would and keeps the operand referenced\n const read = `_, ok := ${parsedArg}.([]any)`;\n if (11 + read.length + 2 + 'return ok'.length <= 100) {\n return `func() bool { ${read}; return ok }()`;\n }\n const level = this.goStatementLevel;\n return `func() bool {\\n${this.getIden(level + 1)}${read}\\n${this.getIden(level + 1)}return ok\\n${this.getIden(level)}}()`;\n }\n\n printArrayIsArrayCall(node, identation, parsedArg = undefined) {\n return this.printNativeIsArray(node, parsedArg) ?? `IsArray(${parsedArg})`;\n }\n\n printObjectKeysCall(node, identation, parsedArg = undefined) {\n return `ObjectKeys(${parsedArg})`;\n }\n\n printObjectValuesCall(node, identation, parsedArg = undefined) {\n return `ObjectValues(${parsedArg})`;\n }\n\n printJsonParseCall(node, identation, parsedArg = undefined) {\n return `JsonParse(${parsedArg})`;\n }\n\n printJsonStringifyCall(node, identation, parsedArg = undefined) {\n return `JsonStringify(${parsedArg})`; // make this customizable\n }\n\n printPromiseAllCall(node, identation, parsedArg = undefined) {\n return `promiseAll(${parsedArg})`;\n }\n\n printMathFloorCall(node, identation, parsedArg = undefined) {\n return `MathFloor(${parsedArg})`;\n }\n\n printMathRoundCall(node, identation, parsedArg = undefined) {\n return `MathRound(${parsedArg})`;\n }\n\n printMathCeilCall(node, identation, parsedArg = undefined) {\n return `MathCeil(${parsedArg})`;\n }\n\n printNumberIsIntegerCall(node: any, identation: any, parsedArg?: any) {\n return `IsInt(${parsedArg})`;\n }\n\n // the base printer prints a method-call argument at the statement's depth; the\n // emitted Go call has two or more arguments, which go/printer lays out one level\n // deeper (a native `a + b` argument then drops its blanks)\n goPrintCallArgument(argument, printedText: string | undefined): string | undefined {\n if (argument?.kind !== SyntaxKind.BinaryExpression || printedText === undefined) {\n return printedText;\n }\n return this.goWithExprDepth(this.goExprDepth + 1, () => this.printNode(argument, 0)).trimStart();\n }\n\n printArrayPushCall(node: CallExpression, identation: number, name: string | undefined = undefined, parsedArg: string | undefined = undefined) {\n let returnValue = '';\n let returnRandName = name;\n parsedArg = this.goPrintCallArgument(node.arguments?.[0], parsedArg);\n // a `[]any` local is the slice itself, so it appends natively\n const nativeReceiver = this.goNativeAppendReceiver(node);\n if (nativeReceiver !== undefined) {\n return `${nativeReceiver} = append(${nativeReceiver}, ${parsedArg})`;\n }\n // a map/slice index or a GetValue box is not addressable: copy it into a local first\n if (name?.startsWith('GetValue') || /[\\])]$/.test(name ?? '')) {\n returnRandName = \"retRes\" + this.getLineBasedSuffix(node);\n returnValue = `${returnRandName} := ${name}\\n${this.getIden(identation)}`;\n }\n return `${returnValue}AppendToArray(&${returnRandName}, ${parsedArg})`;\n // works with:\n // func AppendToArray(slicePtr *any, element any)\n // func AppendToArrayValue(slice any, element any) any\n // func AppendToArraySafe(slice any, element any) any\n }\n\n printIncludesCall(node, identation, name = undefined, parsedArg = undefined) {\n return `Contains(${name}, ${parsedArg})`;\n }\n\n // the Go type an `indexOf` operand is printed as, or undefined for anything Go cannot\n // hand to strings.Index: an `any` box (a parameter, a GetValue/Ternary result), a\n // number, a slice. The receiver and the needle both have to be Go strings\n goIndexOfOperandType(node, printedText: string): string | undefined {\n if (this.goIsAnyBoxExpression(node, printedText)) {\n return undefined;\n }\n if (node?.kind === SyntaxKind.Identifier) {\n return this.goDeclaredTypeOfIdentifier(node);\n }\n if (GO_ANY_BOX_CALLS.indexOf(this.goPrintedCallee(printedText)) >= 0) {\n return undefined;\n }\n return this.goStringCallStaticType(node, printedText) ?? this.goStringFieldStaticType(node, printedText);\n }\n\n // The ccxt writers assemble four outputs from a *slice* of the printer output (base-class files\n // after their TRANSPILED marker, ws cache tests after their first separator), which would cut off\n // the leading file-level import; they keep the helper until their writer adds the import itself.\n goFileKeepsFileLevelImports(): boolean {\n const fileName = this.getSrc()?.fileName ?? '';\n return !/(?:base\\/Exchange(?:\\.nooverloads\\.\\d+)?|base\\/PredictionExchange|base\\/test\\.orderBook|base\\/test\\.cache)\\.ts$/.test(fileName);\n }\n\n // `GetIndexOf(s, t)` is `strings.Index(s, t)` for a receiver declared `string` once `t` is a\n // string too (`target.(string)` succeeds; -1 is both not-found answers); a `*string` receiver\n // answers -1 when nil, reproduced by the nil guard. Slices and `any` boxes keep the helper.\n goNativeIndexOf(node, name, parsedArg): string | undefined {\n if ((typeof name !== 'string') || (typeof parsedArg !== 'string')) {\n return undefined;\n }\n if (name.includes('\\n') || parsedArg.includes('\\n')) {\n return undefined;\n }\n if (!this.goFileKeepsFileLevelImports()) {\n return undefined;\n }\n const receiver = this.goUnwrapPrintedAssertions(node?.expression?.expression);\n const target = this.goUnwrapPrintedAssertions(node?.arguments?.[0]);\n if (this.goIndexOfOperandType(target, parsedArg) !== 'string') {\n return undefined; // a nilable/number needle answers -1 in the helper\n }\n const receiverType = this.goIndexOfOperandType(receiver, name);\n if (receiverType === 'string') {\n this.goFileStdlibImports.add('strings');\n return `strings.Index(${name}, ${parsedArg})`;\n }\n // the literal repeats the identifier, so the receiver is still read exactly once\n if ((receiverType === '*string') && (receiver?.kind === SyntaxKind.Identifier)) {\n this.goFileStdlibImports.add('strings');\n const level = this.goStatementLevel;\n const body = this.getIden(level + 1);\n const inner = this.getIden(level + 2);\n return `func() int {\\n${body}if ${name} == nil {\\n${inner}return -1\\n${body}}\\n${body}return strings.Index(*${name}, ${parsedArg})\\n${this.getIden(level)}}()`;\n }\n return undefined;\n }\n\n printIndexOfCall(node, identation, name = undefined, parsedArg = undefined) {\n const native = this.goNativeIndexOf(node, name, parsedArg);\n if (native !== undefined) {\n return native;\n }\n return `${this.INDEXOF_WRAPPER_OPEN}${name}, ${parsedArg}${this.INDEXOF_WRAPPER_CLOSE}`;\n }\n\n // A native string operation needs every operand to be a Go `string`: a proven one prints as is,\n // a `*string` goDerefableStringOperand proves non-nil prints as its pointee (the helper's nil\n // branch is unreachable). A regex literal is a pattern, never a string: undefined keeps the helper.\n goNativeStringOperandTexts(operands: any[], texts: string[], expected: string[]): string[] | undefined {\n const result: string[] = [];\n for (let i = 0; i < expected.length; i++) {\n const operand = operands[i];\n if (operand === undefined || operand.kind === SyntaxKind.RegularExpressionLiteral) {\n return undefined;\n }\n if (this.goOperandStaticType(operand, texts[i]) === expected[i]) {\n result.push(texts[i]);\n } else if ((expected[i] === 'string') && !texts[i].includes('\\n') && this.goDerefableStringOperand(operand)) {\n result.push('*' + texts[i].trim());\n } else {\n return undefined;\n }\n }\n return result;\n }\n\n // `(x as T)` and `(x)` print as `x`, so the operand's own Go type governs the printed receiver\n goUnwrapPrintedAssertions(node) {\n while ((node?.kind === SyntaxKind.AsExpression) || (node?.kind === SyntaxKind.ParenthesizedExpression)) {\n node = node.expression;\n }\n return node;\n }\n\n // the native string call (built from the proven operand texts, `*`-dereferenced where needed) when\n // every operand matches `expected` and the file's stdlib import can be placed (see\n // goStdlibImportIsPlaceable), else the helper call; an unprinted argument keeps the helper\n goNativeStringCallOr(node, texts: string[], expected: string[], nativeCall: (ops: string[]) => string, helperCall: string, unwrapReceiver = false): string {\n const receiver = unwrapReceiver ? this.goUnwrapPrintedAssertions(node.expression?.expression) : node.expression?.expression;\n const operands = [receiver, ...expected.slice(1).map((_, i) => node.arguments?.[i])];\n const ops = texts.slice(1).includes(undefined) ? undefined : this.goNativeStringOperandTexts(operands, texts, expected);\n if ((ops !== undefined) && this.goStdlibImportIsPlaceable()) {\n this.goFileStdlibImports.add('strings');\n return nativeCall(ops);\n }\n return helperCall;\n }\n\n // The native string calls need `import \"strings\"` before the file's first declaration. Every ccxt\n // consumer splices the body at file head, except build/goTranspiler.ts#transpileBaseMethods and\n // #transpilePredictionBaseMethods; those keep the helper until getGoImports(file) declares it.\n goStdlibImportIsPlaceable(): boolean {\n return this.goFileKeepsFileLevelImports();\n }\n\n printStartsWithCall(node, identation, name = undefined, parsedArg = undefined) {\n // `s.startsWith (p)` -> strings.HasPrefix\n return this.goNativeStringCallOr(node, [name, parsedArg], ['string', 'string'],\n (o) => `strings.HasPrefix(${o[0]}, ${o[1]})`, `StartsWith(${name}, ${parsedArg})`);\n }\n\n printEndsWithCall(node, identation, name = undefined, parsedArg = undefined) {\n // `s.endsWith (p)` -> strings.HasSuffix\n return this.goNativeStringCallOr(node, [name, parsedArg], ['string', 'string'],\n (o) => `strings.HasSuffix(${o[0]}, ${o[1]})`, `EndsWith(${name}, ${parsedArg})`);\n }\n\n printTrimCall(node, identation, name = undefined) {\n return `Trim(${name})`;\n }\n\n printJoinCall(node, identation, name = undefined, parsedArg = undefined) {\n // `a.join (sep)` -> strings.Join: only a declared `[]string` receiver can skip the\n // per-element ToString the helper applies to a []any\n return this.goNativeStringCallOr(node, [name, parsedArg], ['[]string', 'string'],\n (o) => `strings.Join(${o[0]}, ${o[1]})`, `Join(${name}, ${parsedArg})`);\n }\n\n printSplitCall(node, identation, name = undefined, parsedArg = undefined) {\n // `s.split (sep)` -> strings.Split, which keeps JS's empty trailing element\n // (\"a,\" -> [\"a\", \"\"]) exactly like the helper's own strings.Split call\n return this.goNativeStringCallOr(node, [name, parsedArg], ['string', 'string'],\n (o) => `strings.Split(${o[0]}, ${o[1]})`, `Split(${name}, ${parsedArg})`);\n }\n\n printToFixedCall(node, identation, name = undefined, parsedArg = undefined) {\n return `toFixed(${name}, ${parsedArg})`;\n }\n\n // ToString is the identity on a Go string (exchange_helpers.go: derefScalar and `case string`\n // return it unchanged), so a receiver declared `string` prints as itself. An `any` box, a\n // *string (derefScalar answers nil) or a float64 keeps the helper's runtime formatting.\n printToStringCall(node, identation, name = undefined) {\n if ((name !== undefined) && (name.indexOf('\\n') < 0)) {\n const receiver = (node?.expression?.kind === SyntaxKind.PropertyAccessExpression)\n ? node.expression.expression\n : undefined;\n if ((receiver !== undefined) && (this.goOperandStaticType(receiver, name) === 'string')) {\n return name;\n }\n // a non-nil `*string`: derefScalar hands ToString the pointee, returned unchanged\n if ((receiver !== undefined) && this.goDerefableStringOperand(receiver)) {\n return '*' + name.trim();\n }\n // an int64 prints its decimal digits in both: the helper's Sprintf(\"%d\") and FormatInt\n if ((receiver !== undefined) && (this.goOperandStaticType(receiver, name) === 'int64') && this.goStdlibImportIsPlaceable()) {\n this.goFileStdlibImports.add('strconv');\n return `strconv.FormatInt(${name}, 10)`;\n }\n }\n return `ToString(${name})`;\n }\n\n printConcatCall(node, identation, name = undefined, parsedArg = undefined) {\n return `Concat(${name}, ${parsedArg})`;\n }\n\n printToUpperCaseCall(node, identation, name = undefined) {\n // `s.toUpperCase ()` -> strings.ToUpper\n return this.goNativeStringCallOr(node, [name], ['string'], (o) => `strings.ToUpper(${o[0]})`, `ToUpper(${name})`, true);\n }\n\n printToLowerCaseCall(node, identation, name = undefined) {\n // `s.toLowerCase ()` -> strings.ToLower\n return this.goNativeStringCallOr(node, [name], ['string'], (o) => `strings.ToLower(${o[0]})`, `ToLower(${name})`, true);\n }\n\n printShiftCall(node, identation, name = undefined) {\n return `Shift(${name})`;\n }\n\n printReverseCall(node, identation, name = undefined) {\n return `Reverse(${name})`;\n }\n\n printPopCall(node, identation, name = undefined) {\n return `Pop(${name}))`;\n }\n\n printAssertCall(node, identation, parsedArgs) {\n return `assert(${parsedArgs})`;\n }\n\n // `x.slice(a)` / `x.slice(a, b)` prints `Slice(x, a, b)`, a JS slice on a string: a\n // negative bound counts from the end, a start-only call clamps its start to 0 and an\n // end past len is clamped to len, where Go's native slicing panics\n goSliceLiteralBound(node): number | undefined {\n if (node?.kind === SyntaxKind.NumericLiteral) {\n const text = node.text;\n if (!/^\\d+$/.test(text)) {\n return undefined;\n }\n const value = Number(text);\n return (value > 2147483647) ? undefined : value;\n }\n if ((node?.kind === SyntaxKind.PrefixUnaryExpression) && (node.operator === SyntaxKind.MinusToken)) {\n const operand = this.goSliceLiteralBound(node.operand);\n return (operand === undefined) ? undefined : -operand;\n }\n return undefined;\n }\n\n // the subscript for a string value, with the helper's own index arithmetic\n goSliceSubscript(value: string, start: number, hasEnd: boolean, end: number | undefined): string {\n const length = `len(${value})`;\n let startText;\n if (start >= 0) {\n startText = `${start}`;\n } else if (hasEnd) {\n startText = `${length} - ${-start}`;\n } else {\n startText = `max(${length} - ${-start}, 0)`;\n }\n if (!hasEnd) {\n return `${value}[${startText}:]`;\n }\n const endText = (end >= 0) ? `min(${end}, ${length})` : `${length} - ${-end}`;\n return `${value}[${startText}:${endText}]`;\n }\n\n // receiver of an inlinable `.slice(...)`: `string` prints a plain subscript and\n // `*string` a nil-guarded one, while anything else (an `any` box) keeps the helper.\n // A TS cast (`(id as string).slice(...)`) prints nothing, so it is transparent here.\n goSliceReceiverType(node): string | undefined {\n let receiverNode = node?.expression?.expression;\n while ((receiverNode?.kind === SyntaxKind.AsExpression) || (receiverNode?.kind === SyntaxKind.NonNullExpression)\n || (receiverNode?.kind === SyntaxKind.ParenthesizedExpression)) {\n receiverNode = receiverNode.expression;\n }\n if (receiverNode?.kind !== SyntaxKind.Identifier) {\n return undefined;\n }\n const goType = this.goPrintedTypeOfExpression(receiverNode, '');\n return ((goType === 'string') || (goType === '*string')) ? goType : undefined;\n }\n\n // the integer-literal bounds of a `.slice(a, b)` call; undefined when a bound is an\n // expression, whose Go value is not provably a non-negative int the subscript could take\n goSliceLiteralBounds(node): { start: number, hasEnd: boolean, end: number } | undefined {\n const args = node?.arguments ?? [];\n const start = this.goSliceLiteralBound(args[0]);\n if (start === undefined) {\n return undefined;\n }\n const hasEnd = args.length > 1;\n const end = hasEnd ? this.goSliceLiteralBound(args[1]) : undefined;\n if (hasEnd && (end === undefined)) {\n return undefined;\n }\n return { start, hasEnd, end };\n }\n\n // true when this `.slice(a, b)` call prints native Go slicing of a string value\n goIsNativeSliceCall(node): boolean {\n if (node?.kind !== SyntaxKind.CallExpression) {\n return false;\n }\n const callee: any = node.expression;\n if ((callee?.kind !== SyntaxKind.PropertyAccessExpression) || (callee.name?.text !== 'slice')) {\n return false;\n }\n if (this.goSliceReceiverType(node) === undefined) {\n return false;\n }\n return this.goSliceLiteralBounds(node) !== undefined;\n }\n\n // `x.slice(a, b)` -> `x[a:b]` when the receiver is a local the printer declares\n // `string` (or `*string`, which keeps the helper's nil -> \"\" branch as a guard) and\n // both bounds are integer literals. Any other bound or receiver keeps the helper.\n printInlineSlice(node, receiverText: string): string | undefined {\n if ((receiverText ?? '').includes('\\n')) {\n return undefined;\n }\n const goType = this.goSliceReceiverType(node);\n if (goType === undefined) {\n return undefined;\n }\n const bounds = this.goSliceLiteralBounds(node);\n if (bounds === undefined) {\n return undefined;\n }\n const { start, hasEnd, end } = bounds;\n if (goType === 'string') {\n return this.goSliceSubscript(receiverText, start, hasEnd, end);\n }\n const level = this.goStatementLevel;\n const body = this.getIden(level + 1);\n const branch = this.getIden(level + 2);\n const subscript = this.goSliceSubscript('str', start, hasEnd, end);\n return `func() string {\\n${body}if ${receiverText} == nil {\\n${branch}return \"\"\\n${body}}\\n${body}str := *${receiverText}\\n${body}return ${subscript}\\n${this.getIden(level)}}()`;\n }\n\n printSliceCall(node, identation, name = undefined, parsedArg = undefined, parsedArg2 = undefined) {\n parsedArg = this.goPrintCallArgument(node.arguments?.[0], parsedArg);\n parsedArg2 = this.goPrintCallArgument(node.arguments?.[1], parsedArg2);\n const nativeSlice = this.printInlineSlice(node, name);\n if (nativeSlice !== undefined) {\n return nativeSlice;\n }\n if (parsedArg2 === undefined){\n parsedArg2 = 'nil';\n }\n return `Slice(${name}, ${parsedArg}, ${parsedArg2})`;\n }\n\n printReplaceCall(node, identation, name = undefined, parsedArg = undefined, parsedArg2 = undefined) {\n // JS `replace` with a *string* pattern replaces the first occurrence only, which the\n // boxed helper (ReplaceAll for every argument) cannot express: with all three operands\n // proven strings, emit the count-1 form and the JS semantics exactly.\n return this.goNativeStringCallOr(node, [name, parsedArg, parsedArg2], ['string', 'string', 'string'],\n (o) => `strings.Replace(${o[0]}, ${o[1]}, ${o[2]}, 1)`, `Replace(${name}, ${parsedArg}, ${parsedArg2})`);\n }\n\n printReplaceAllCall(node, identation, name = undefined, parsedArg = undefined, parsedArg2 = undefined) {\n // `s.replaceAll (a, b)` replaces every occurrence, like the helper\n return this.goNativeStringCallOr(node, [name, parsedArg, parsedArg2], ['string', 'string', 'string'],\n (o) => `strings.ReplaceAll(${o[0]}, ${o[1]}, ${o[2]})`, `Replace(${name}, ${parsedArg}, ${parsedArg2})`);\n }\n\n printPadEndCall(node, identation, name, parsedArg, parsedArg2) {\n return `PadEnd(${name}, ${parsedArg}, ${parsedArg2})`;\n }\n\n printPadStartCall(node, identation, name, parsedArg, parsedArg2) {\n return `PadStart(${name}, ${parsedArg}, ${parsedArg2})`;\n }\n\n printDateNowCall(node, identation) {\n return \"DateNow()\";\n }\n\n printLengthProperty(node, identation, name = undefined) {\n const leftSide = this.printNode(node.expression, 0);\n // const type = (this.getChecker() as Checker).getTypeAtLocation(node.expression); // eslint-disable-line\n // this.warnIfAnyType(node, type.flags, leftSide, \"length\");\n return `GetLength(${leftSide})`;\n }\n\n // printPostFixUnaryExpression(node, identation) {\n // const {operand, operator} = node;\n // if (operand.kind === SyntaxKind.NumericLiteral) {\n // return super.printPostFixUnaryExpression(node, identation);\n // }\n // const leftSide = this.printNode(operand, 0);\n // const op = this.PostFixOperators[operator]; // todo: handle --\n // if (op === '--') {\n // return `postFixDecrement(ref ${leftSide})`;\n // }\n // return `postFixIncrement(ref ${leftSide})`;\n // }\n\n // printPrefixUnaryExpression(node, identation) {\n // const {operand, operator} = node;\n // if (operand.kind === SyntaxKind.NumericLiteral) {\n // return super.printPrefixUnaryExpression(node, identation);\n // }\n // if (operator === SyntaxKind.ExclamationToken) {\n // // not branch check falsy/turthy values if needed;\n // return this.PrefixFixOperators[operator] + this.printCondition(node.operand, 0);\n // }\n // const leftSide = this.printNode(operand, 0);\n // if (operator === SyntaxKind.PlusToken) {\n // return `prefixUnaryPlus(ref ${leftSide})`;\n // } else {\n // return `prefixUnaryNeg(ref ${leftSide})`;\n // }\n // }\n\n printConditionalExpression(node, identation) {\n const condition = this.goWithExprDepth(1, () => this.printCondition(node.condition, 0));\n if (!condition.includes('\\n')) {\n const whenTrue = this.goPrintTernaryBranch(node.whenTrue, 2);\n const whenFalse = this.goPrintTernaryBranch(node.whenFalse, 1);\n const inlined = this.printInlineTernary(condition, whenTrue, whenFalse, this.goTernaryResultType(node.whenTrue, whenTrue, node.whenFalse, whenFalse));\n if (inlined !== undefined) {\n return inlined;\n }\n }\n const whenTrue = this.printNode(node.whenTrue, 0);\n const whenFalse = this.printNode(node.whenFalse, 0);\n return `Ternary(${condition}, ${whenTrue}, ${whenFalse})`;\n }\n\n printDeleteExpression(node, identation) {\n const object = this.printNode (node.expression.expression, 0);\n const key = this.printNode (node.expression.argumentExpression, 0);\n return `Remove(${object}, ${key})`;\n }\n\n printThrowStatement(node, identation) {\n // const expression = this.printNode(node.expression, 0);\n // return this.getIden(node) + this.THROW_TOKEN + \" \" + expression + this.LINE_TERMINATOR;\n if (node.expression.kind === SyntaxKind.Identifier) {\n return this.getIden(identation) + 'panic(' + this.printNode(node.expression, 0) + ')' + this.LINE_TERMINATOR;\n }\n if (node.expression.kind === SyntaxKind.NewExpression) {\n const expression = node.expression;\n // handle throw new Error (Message)\n // and throw new x[a] (message)\n const argumentsExp = expression?.arguments ?? [];\n const parsedArg = argumentsExp.map(n => this.printNode(n, 0)).join(\",\") ?? '';\n const newExpression = this.printNode(expression.expression, 0);\n if (expression.expression.kind === SyntaxKind.Identifier) {\n // handle throw new X\n const id = expression.expression;\n const symbol = this.getChecker().getSymbolAtLocation(expression.expression);\n if (symbol) {\n const declarations = this.getChecker().getDeclaredTypeOfSymbol(symbol).getSymbol()?.declarations?.map((d) => d.resolve()) ?? [];\n const isClassDeclaration = declarations.find(l => l.kind === SyntaxKind.InterfaceDeclaration || l.kind === SyntaxKind.ClassDeclaration);\n if (isClassDeclaration){\n // return this.getIden(identation) + `${this.THROW_TOKEN} ${this.NEW_TOKEN} ${id.text} ((string)${parsedArg}) ${this.LINE_TERMINATOR}`;\n } else {\n // Go has no statement terminator: the two statements go on\n // their own lines (gofmt splits `a; b` exactly like this)\n return this.getIden(identation) + `throwDynamicException(${id.text}, ${parsedArg})\\n${this.getIden(identation)}return nil`;\n }\n }\n return this.getIden(identation) + `panic(${id.text}(${parsedArg}))${this.LINE_TERMINATOR}`;\n } else if (expression.expression.kind === SyntaxKind.ElementAccessExpression) {\n return this.getIden(identation) + `throwDynamicException(${newExpression}, ${parsedArg})`;\n }\n return super.printThrowStatement(node, identation);\n }\n // const newToken = this.NEW_TOKEN ? this.NEW_TOKEN + \" \" : \"\";\n // const newExpression = node.expression?.expression?.text;\n // // newExpression = newExpression ? newExpression : this.printNode(node.expression.expression, 0); // new Exception or new exact[string] check this out\n // // const args = node.expression?.arguments.map(n => this.printNode(n, 0)).join(\",\");\n // // const throwExpression = ` ${newToken}${newExpression}${this.LEFT_PARENTHESIS}((string)${args})${this.RIGHT_PARENTHESIS}`;\n // return this.getIden(identation) + this.THROW_TOKEN + throwExpression + this.LINE_TERMINATOR;\n }\n\n // -----------------------------------------------------------------------\n // gofmt-compatible spacing of the binary expressions this printer emits\n // -----------------------------------------------------------------------\n // go/printer (nodes.go) prints a binary expression with blanks around the\n // operator unless the expression sits deeper than the top level of a\n // statement: binaryExpr() asks cutoff() - which inspects the operator tree\n // through walkBinary() - and drops *both* blanks when the operator\n // precedence is below that cutoff. Level 4/5 operators (`+ - * / % & | ^\n // << >>`) therefore print as `a + b` at the top level but as `a+b`, `a[i+1]`\n // one level down; comparisons and `&&`/`||` (level 3 and below) always keep\n // their blanks.\n //\n // goExprDepth mirrors the depth go/printer tracks over the Go AST it is\n // about to emit: 1 at the start of every statement, +1 for an argument list\n // with more than one argument, +1 for an index expression, +1 for the right\n // operand of a binary expression, -1 inside parentheses (never below 1), and\n // back to 1 for composite literal elements.\n goExprDepth = 1;\n\n goWithExprDepth(depth: number, callback: () => T): T {\n const previous = this.goExprDepth;\n this.goExprDepth = depth < 1 ? 1 : depth;\n try {\n return callback();\n } finally {\n this.goExprDepth = previous;\n }\n }\n\n // go/token precedence of the operators this printer can print natively\n // (5 `* / % << >> & &^`, 4 `+ - | ^`, 3 comparisons, 2 `&&`, 1 `||`)\n goOperatorPrecedence(operator: string): number {\n switch (operator) {\n case '*': case '/': case '%': case '<<': case '>>': case '&': case '&^':\n return 5;\n case '+': case '-': case '|': case '^':\n return 4;\n case '==': case '!=': case '<': case '<=': case '>': case '>=':\n return 3;\n case '&&':\n return 2;\n case '||':\n return 1;\n }\n return 0;\n }\n\n // the operator string a node is printed as when it stays a Go binary\n // expression, or undefined when the node becomes a helper call or is not\n // binary at all - a primary expression, which walkBinary() never looks into\n goNativeBinaryOperator(node): string | undefined {\n if (!node || !isBinaryExpression(node)) {\n return undefined;\n }\n const kind = node.operatorToken.kind;\n if (kind === SyntaxKind.EqualsToken || kind === SyntaxKind.PlusEqualsToken ||\n kind === SyntaxKind.MinusEqualsToken || kind === SyntaxKind.InKeyword ||\n kind === SyntaxKind.InstanceOfKeyword || kind in this.binaryExpressionsWrappers) {\n return undefined;\n }\n const operator = this.SupportedKindNames[kind];\n return this.goOperatorPrecedence(operator) > 0 ? operator : undefined;\n }\n\n // walkBinary(): has4 / has5 / maxProblem of the operator tree that is about\n // to be printed. Operands that stay binary expressions are walked, every\n // other operand is a primary expression and stops the walk - the same\n // boundary go/printer draws for parens and calls.\n goWalkBinary(operator: string, left, right, rightText: string) {\n const precedence = this.goOperatorPrecedence(operator);\n let has4 = precedence === 4;\n let has5 = precedence === 5;\n let maxProblem = 0;\n const walk = (childOperator: string, child) => {\n const info = this.goWalkBinary(childOperator, child.left, child.right, '');\n has4 = has4 || info.has4;\n has5 = has5 || info.has5;\n maxProblem = Math.max(maxProblem, info.maxProblem);\n };\n const leftOperator = this.goNativeBinaryOperator(left);\n if (leftOperator !== undefined && this.goOperatorPrecedence(leftOperator) >= precedence) {\n walk(leftOperator, left);\n }\n const rightOperator = this.goNativeBinaryOperator(right);\n if (rightOperator !== undefined && this.goOperatorPrecedence(rightOperator) > precedence) {\n walk(rightOperator, right);\n } else if (rightOperator === undefined) {\n // `/*`, `&&`, `&^` and the `+ +` / `- -` pairs must keep a blank so\n // that the two tokens cannot glue into a different operator\n const pair = operator + rightText.replace(/^[ \\t]+/, '').slice(0, 1);\n if (pair === '/*' || pair === '&&' || pair === '&^') {\n maxProblem = 5;\n } else if (pair === '++' || pair === '--') {\n maxProblem = Math.max(maxProblem, 4);\n }\n }\n return { has4, has5, maxProblem };\n }\n\n // the separator gofmt puts around a natively printed operator: `' '` keeps\n // the blanks, `''` drops them (go/printer cutoff())\n goBinarySeparator(operator: string, rightText: string, left, right): string {\n const precedence = this.goOperatorPrecedence(operator);\n if (precedence < 4) {\n // level 3 and below always keep both blanks\n return ' ';\n }\n const { has4, has5, maxProblem } = this.goWalkBinary(operator, left, right, rightText);\n let cutoff;\n if (maxProblem > 0) {\n cutoff = maxProblem + 1;\n } else if (has4 && has5) {\n cutoff = this.goExprDepth === 1 ? 5 : 4;\n } else {\n cutoff = this.goExprDepth === 1 ? 6 : 4;\n }\n return precedence < cutoff ? ' ' : '';\n }\n\n printBinaryExpression(node, identation) {\n\n const {left, right, operatorToken} = node;\n\n const customBinaryExp = this.printCustomBinaryExpressionIfAny(node, identation);\n if (customBinaryExp) {\n return customBinaryExp;\n }\n\n if (operatorToken.kind == SyntaxKind.InstanceOfKeyword) {\n return this.printInstanceOfExpression(node, identation);\n }\n\n if (operatorToken.kind === SyntaxKind.EqualsToken) {\n const pointerWrite = this.goPointerWriteText(node, identation);\n if (pointerWrite !== undefined) {\n return pointerWrite;\n }\n // handle test['a'] = 1;\n const elementAccess = left;\n const rightSide = this.goWithExprDepth(this.goExprDepth + 1, () => this.printNode(right, 0));\n if (left.kind === SyntaxKind.ElementAccessExpression) {\n const leftSide = this.printNode(elementAccess.expression, 0);\n const propName = this.printNode(elementAccess.argumentExpression, 0);\n const value = this.goWithExprDepth(this.goExprDepth + 1, () => this.printNode(right, identation)).trimStart();\n const native = this.printNativeElementAssignment(elementAccess.expression, leftSide, elementAccess.argumentExpression, propName, value, false, right);\n if (native !== undefined) {\n return native;\n }\n return `AddElementToObject(${leftSide}, ${propName}, ${value})`;\n }\n\n if (right?.kind === SyntaxKind.AwaitExpression || rightSide.startsWith('<-this.callInternal')) {\n const leftParsed = this.printNode(left, 0);\n // the awaited call can carry a multi-line object literal argument: printing it\n // at the statement's own level keeps that literal one level deeper\n const awaited = (right?.kind === SyntaxKind.AwaitExpression)\n ? this.printNode(right, identation)\n : rightSide;\n return `\n${this.getIden(identation)}${leftParsed} = ${awaited}\n${this.getIden(identation)}PanicOnError(${leftParsed})`;\n }\n }\n\n const op = operatorToken.kind;\n // handle: [x,d] = this.method()\n if (op === SyntaxKind.EqualsToken && left.kind === SyntaxKind.ArrayLiteralExpression) {\n const arrayBindingPatternElements = left.elements;\n const parsedArrayBindingElements = arrayBindingPatternElements.map((e) => this.printNode(e, 0));\n const syntheticName = parsedArrayBindingElements.join(\"\") + \"Variable\";\n\n let arrayBindingStatement = `${syntheticName} := ${this.printNode(right, 0)}\\n`;\n\n parsedArrayBindingElements.forEach((e, index) => {\n // const type = this.getType(node);\n // const parsedType = this.getTypeFromRawType(type);\n const leftElement = arrayBindingPatternElements[index];\n const leftType = this.getChecker().getTypeAtLocation(leftElement);\n const parsedType = this.getTypeFromRawType(leftType);\n\n const castExp = parsedType ? `(${parsedType})` : \"\";\n\n // const statement = this.getIden(identation) + `${e} = (${castExp}((List)${syntheticName}))[${index}]`;\n const statement = this.getIden(identation) + (this.goGetArgBindsDictElement(leftElement, right, index)\n ? `${e} = MapTyped(GetValue(${syntheticName}, ${index}))`\n : `${e} = GetValue(${syntheticName}, ${index})`);\n if (index < parsedArrayBindingElements.length - 1) {\n arrayBindingStatement += statement + \"\\n\";\n } else {\n arrayBindingStatement += statement;\n }\n });\n\n return arrayBindingStatement;\n }\n\n let operator = this.SupportedKindNames[operatorToken.kind];\n\n\n let leftVar = undefined;\n let rightVar = undefined;\n\n // c# wrapper\n if (operatorToken.kind === SyntaxKind.EqualsEqualsToken || operatorToken.kind === SyntaxKind.EqualsEqualsEqualsToken) {\n if (this.COMPARISON_WRAPPER_OPEN) {\n leftVar = this.printNode(left, 0);\n rightVar = this.printNode(right, identation);\n return `${this.COMPARISON_WRAPPER_OPEN}${leftVar}, ${rightVar}${this.COMPARISON_WRAPPER_CLOSE}`;\n }\n }\n\n // check if boolean operators || and && because of the falsy values\n if (operatorToken.kind === SyntaxKind.BarBarToken || operatorToken.kind === SyntaxKind.AmpersandAmpersandToken) {\n leftVar = this.printCondition(left, 0);\n rightVar = this.printCondition(right, identation);\n if (operatorToken.kind === SyntaxKind.AmpersandAmpersandToken) {\n // `x !== undefined && x === 'v'` inlines to `(x != nil) && (x != nil && *x == \"v\")`.\n // The right operand already guards nil, so the left test is provably\n // implied — `go vet` reports it as a redundant and. Dropping it keeps\n // the exact same value (Go && is short-circuiting, both sides pure).\n const collapsed = this.goDropRedundantNilGuard(leftVar.trim(), rightVar.trim());\n if (collapsed !== undefined) {\n return collapsed;\n }\n }\n } else {\n // go/printer prints the left operand of a binary expression at the\n // depth of the parent plus diffPrec() - 0 only when it is a binary\n // expression of the very same precedence - and the right operand one\n // level deeper. An operator that is not binary in Go (the assignment\n // `=`, or a compound assignment) prints both sides at their own level.\n const precedence = this.goOperatorPrecedence(operator);\n if (precedence > 0) {\n const leftOperator = this.goNativeBinaryOperator(left);\n const samePrecedence = leftOperator !== undefined && this.goOperatorPrecedence(leftOperator) === precedence;\n const leftDepth = samePrecedence ? this.goExprDepth : this.goExprDepth + 1;\n leftVar = this.goWithExprDepth(leftDepth, () => this.printNode(left, 0));\n rightVar = this.goWithExprDepth(this.goExprDepth + 1, () => this.printNode(right, identation));\n } else {\n leftVar = this.printNode(left, 0);\n rightVar = this.printNode(right, identation);\n }\n }\n\n const customOperator = this.getCustomOperatorIfAny(left, right, operatorToken);\n\n operator = customOperator ? customOperator : operator;\n\n const separator = this.goBinarySeparator(operator, rightVar.trim(), left, right);\n\n return leftVar + separator + operator + separator + rightVar.trim();\n }\n\n // `(x != nil) && (x != nil && …)` -> `(x != nil && …)`. Only fires when the\n // right operand opens with the very same nil guard the left operand *is*, so\n // the left is implied and dropping it cannot change the result.\n goDropRedundantNilGuard(leftVar: string, rightVar: string): string | undefined {\n const guard = /^\\(([A-Za-z_]\\w*) != nil\\)$/.exec(leftVar);\n if (guard === null) {\n return undefined;\n }\n if (rightVar.startsWith(`(${guard[1]} != nil && `)) {\n return rightVar;\n }\n return undefined;\n }\n\n printTryStatement(node, identation: number) {\n // const tryBody = this.printNode(node.tryBlock, 0);\n\n let tryBody = node.tryBlock.statements.map((s) => {\n return this.printNode(s, identation + 1);\n }).join(\"\\n\");\n tryBody = tryBody.replaceAll(/(\\s*)break\\s*$/gm, \"$1panic(\\\"break\\\")\"); // to do do thing regex-based\n\n // const catchBody = this.printNode(node.catchClause.block, 0);\n const catchBody = node.catchClause.block.statements.map((s) => this.printNode(s, identation + 1)).join(\"\\n\");\n\n const bodyEndsWithReturn = (body: string, statements) => {\n const lines = body.split(\"\\n\").map(l => l.trim()).filter(Boolean);\n const lastLine = lines.length ? lines[lines.length - 1] : \"\";\n return lastLine.startsWith(\"return\") || lastLine.startsWith(\"panic\") || lastLine.startsWith(\"throw new\")\n || this.blockEndsWithConditionalReturn(statements);\n };\n const catchBodyEndsWithReturn = bodyEndsWithReturn(catchBody, node.catchClause.block.statements);\n const tryBodyEndsWithReturn = bodyEndsWithReturn(tryBody, node.tryBlock.statements);\n\n const returNil = \"return nil\";\n const isVoid = this.isInsideVoidFunction(node);\n\n const nodeEndsWithReturn = tryBodyEndsWithReturn && catchBodyEndsWithReturn && !isVoid;\n const errorName = node.catchClause.variableDeclaration.name.text;\n const classPrefix = this.className !== 'undefined' ? `(this *${this.className})` : \"()\";\n const thisWord = this.className !== 'undefined' ? \"this\" : \"\";\n // the printer indents statements with getIden(); the bodies embedded below are\n // re-placed at their own explicit level so the template only carries the levels\n // *inside* the block (the enclosing getIden(identation) lands on every line)\n const catchBodyBlock = this.indentBlock (catchBody, \"\t\t\t\t\t\");\n const tryBodyBlock = this.indentBlock (tryBody, \"\t\t\");\n const catchBlock =`\n{\n\t${nodeEndsWithReturn ? 'ret__ := ' : ''}func${classPrefix} (ret_ any) {\n\t\tdefer func() {\n\t\t\tif ${errorName} := recover(); ${errorName} != nil {\n\t\t\t\tif ${errorName} == \"break\" {\n\t\t\t\t\treturn\n\t\t\t\t}\n\t\t\t\tret_ = func${classPrefix} any {\n\t\t\t\t\t// catch block:\n${catchBodyBlock}\n\t\t\t\t\t${catchBodyEndsWithReturn ? \"\" : returNil}\n\t\t\t\t}(${thisWord})\n\t\t\t}\n\t\t}()\n\t\t// try block:\n${tryBodyBlock}\n\t\t${tryBodyEndsWithReturn ? \"\" : returNil}\n\t}(${thisWord})\n\t${nodeEndsWithReturn\n ? `if ret__ != nil {\n\t\treturn ret__\n\t}\n\treturn nil`\n : ''}\n}`;\n // add identation to every line; a line that is left blank (the conditional\n // entries above emit nothing, and the block opens on a fresh line) stays\n // empty because gofmt trims trailing whitespace\n const indentedBlock = catchBlock.split(\"\\n\")\n .map((line) => line.trim().length ? this.getIden(identation) + line : \"\")\n .join(\"\\n\");\n // const catchCondOpen = this.CONDITION_OPENING ? this.CONDITION_OPENING : \" \";\n\n return indentedBlock;\n }\n\n /**\n * Strip the printer's own leading indentation from every line of a printed\n * statement block so the caller can re-place it at an explicit level. Only the\n * common prefix goes away: relative nesting (one tab per level) is preserved.\n */\n dedentBlock (block: string) {\n const lines = block.split(\"\\n\");\n const indents = lines\n .filter((line) => line.trim().length > 0)\n .map((line) => (line.match(/^[\\t ]*/) as RegExpMatchArray)[0].length);\n const common = indents.length ? Math.min(...indents) : 0;\n return lines.map((line) => line.slice(common)).join(\"\\n\");\n }\n\n /**\n * Re-place a printed statement block at `level` (a run of tabs): the block's own\n * leading indentation is dropped and every non-blank line is prefixed with `level`,\n * so relative nesting (one tab per level) survives the move.\n */\n indentBlock (block: string, level: string) {\n return this.dedentBlock (block)\n .split(\"\\n\")\n .map((line) => line.trim().length ? level + line : \"\")\n .join(\"\\n\");\n }\n\n /**\n * gofmt writes blank lines with no whitespace at all. A multi-line statement template\n * opens on a fresh line, so the inherited `getIden(identation) + ` prefix\n * lands on a line that carries nothing else: drop that prefix instead of leaving a\n * whitespace-only line behind. Only blank lines are touched, never printed content.\n */\n stripWhitespaceOnlyLines (block: string) {\n return block.split(\"\\n\").map((line) => line.trim().length ? line : \"\").join(\"\\n\");\n }\n\n printPrefixUnaryExpression(node, identation) {\n const {operand, operator} = node;\n if (operator === SyntaxKind.ExclamationToken) {\n // not branch check falsy/turthy values if needed;\n return this.getIden(identation) + this.PrefixFixOperators[operator] + this.printCondition(node.operand, 0);\n }\n if (operator === SyntaxKind.MinusToken) {\n const printed = this.printNode(node.operand, 0);\n const inlined = this.printInlineOpNeg(node, printed);\n if (inlined !== undefined) {\n return this.getIden(identation) + inlined;\n }\n return this.getIden(identation) + `OpNeg(${printed})`;\n }\n return this.getIden(identation) + this.PrefixFixOperators[operator] + this.printNode(operand, 0);\n }\n\n printNewExpression(node, identation) {\n let expression = node.expression?.text;\n expression = expression ? expression : this.printNode(node.expression); // new Exception or new exact[string] check this out\n if (node.arguments.length === 0) {\n return `New${this.capitalize(expression)}()`;\n }\n // an argument printer may prepend the statement indent (parenthesised casts do);\n // inside the call the argument is inline, so trim it like printArgsForCallExpression\n const args = node.arguments.map(n => this.printNode(n, identation).trim()).join(\", \");\n if (expression.endsWith('Error')) {\n return expression + this.LEFT_PARENTHESIS + args + this.RIGHT_PARENTHESIS;\n }\n return 'New' + this.capitalize(expression) + this.LEFT_PARENTHESIS + args + this.RIGHT_PARENTHESIS;\n }\n\n /**\n * Override the default element-access printer with a version that walks the\n * entire `x[y][z]` chain and builds a properly nested sequence of helper\n * calls. This removes the root cause of the unbalanced-parenthesis bug\n * without any post-processing or regex hacks.\n */\n // The Go static type of `printed` when the printer can name it as a native Go\n // map or slice, undefined while the value stays boxed in `any` (GetValue,\n // Ternary, a parameter, an untyped struct field). Only initializer shapes the\n // printer itself types — object/array literals, helper calls whose Go return\n // type it knows (GO_HELPER_RETURN_TYPES + the ccxt extension), and locals whose\n // declaration got that same concrete type — are reported.\n goIndexableTypeOf(node, printed: string): string | undefined {\n if (node === undefined) {\n return undefined;\n }\n switch (node.kind) {\n // a type assertion prints as its operand (printAsExpression hands the operand\n // back), so the operand's Go type still governs the read: `(this.fees as Dict)['x']`\n // is the element access on `this.fees`, whose Go type decides the index\n case SyntaxKind.ParenthesizedExpression:\n case SyntaxKind.AsExpression:\n return this.goIndexableTypeOf(node.expression, printed);\n case SyntaxKind.ObjectLiteralExpression:\n return 'map[string]any';\n case SyntaxKind.ArrayLiteralExpression:\n return '[]any';\n case SyntaxKind.CallExpression:\n return this.goTypeOfInitializer(node, printed);\n case SyntaxKind.Identifier:\n return this.goDeclaredTypeOfIdentifier(node);\n }\n return undefined;\n }\n\n // the leftover chain after the first (native) step, still helper-wrapped:\n // `m[\"a\"][\"b\"][\"c\"]` prints `GetValue(GetValue(m[\"a\"], \"b\"), \"c\")`\n goElementAccessChain(containerStr: string, keyStrs: string[]) {\n let acc = containerStr;\n for (let i = 1; i < keyStrs.length; i++) {\n acc = `${this.ELEMENT_ACCESS_WRAPPER_OPEN}${acc}, ${keyStrs[i]}${this.ELEMENT_ACCESS_WRAPPER_CLOSE}`;\n }\n return acc;\n }\n\n // the container of a nested `m[\"a\"][\"b\"] = v` write, for all but the last key: its first step is a\n // plain read, so a receiver typed as a map indexes natively and only `any` steps keep the helper.\n // A missing key or nil map reads nil in both forms; a non-map container is a no-op either way.\n goElementWriteChain(baseExpr, containerStr: string, keyNodes, keyStrs: string[]): string {\n let acc = containerStr;\n let first = 0;\n if ((keyStrs.length > 1) && (this.goIndexableTypeOf(baseExpr, containerStr) === 'map[string]any')\n && this.goKeyIsString(keyNodes[0], keyStrs[0])) {\n acc = `${containerStr}[${keyStrs[0]}]`;\n first = 1;\n }\n for (let i = first; i < keyStrs.length - 1; i++) {\n acc = `${this.ELEMENT_ACCESS_WRAPPER_OPEN}${acc}, ${keyStrs[i]}${this.ELEMENT_ACCESS_WRAPPER_CLOSE}`;\n }\n return acc;\n }\n\n // true when the printed key is a Go string, so `m[key]` reads the map with the\n // same key GetValue resolves for a string operand (GetValue parses a non-string\n // key, which on map[string]any just yields nil)\n goKeyIsString(node, printed: string) {\n if (node === undefined) {\n return false;\n }\n switch (node.kind) {\n case SyntaxKind.StringLiteral:\n case SyntaxKind.NoSubstitutionTemplateLiteral:\n return true;\n case SyntaxKind.ParenthesizedExpression:\n case SyntaxKind.AsExpression:\n return this.goKeyIsString(node.expression, printed);\n case SyntaxKind.Identifier:\n return this.goDeclaredTypeOfIdentifier(node) === 'string';\n case SyntaxKind.CallExpression:\n return this.goTypeOfInitializer(node, printed) === 'string';\n }\n return false;\n }\n\n // true when the printed key is a Safe*-boxed string: an identifier declared `*string`,\n // i.e. a nilable Go pointer. The native read needs GetValue's `*` deref and its nil\n // answer, neither of which an index expression expresses.\n goIsDerefStringKeyExpression(node): boolean {\n return (node?.kind === SyntaxKind.Identifier) && (this.goDeclaredTypeOfIdentifier(node) === '*string');\n }\n\n // the nil-guarded native read of a declared map with a `*string` key, reproducing GetValue's key\n // deref: a nil key reads nil, otherwise the map index (missing key is the `any` nil). gofmt keeps\n // a func literal holding an `if` on its own lines, so the guard sits at the statement's level.\n printNilGuardedMapIndex(containerStr: string, keyStr: string): string {\n const level = this.goStatementLevel;\n const body = this.getIden(level + 1);\n return `func() any {\\n${body}if ${keyStr} == nil {\\n${this.getIden(level + 2)}return nil\\n${body}}\\n${body}return ${containerStr}[*${keyStr}]\\n${this.getIden(level)}}()`;\n }\n\n // true for `this.` — the one property-access shape whose Go type the\n // printer itself cannot name (the fields live in the hand-written Go structs)\n isGoThisPropertyAccessExpression(node) {\n return (node?.kind === SyntaxKind.PropertyAccessExpression)\n && (node.expression?.kind === SyntaxKind.ThisKeyword);\n }\n\n // true when the element access is the target of an assignment: the binary\n // expression printer owns that shape (AddElementToObject / rewritten GetValue\n // chains), a native `x[k]` index there would drop the write\n isGoElementAccessAssignmentTarget(node) {\n const parent = node.parent;\n return (parent?.kind === SyntaxKind.BinaryExpression) && (parent.left === node)\n && ((parent.operatorToken.kind === SyntaxKind.EqualsToken) || (parent.operatorToken.kind === SyntaxKind.PlusEqualsToken));\n }\n\n // the key of a native list read: its printed Go type must be `int` for the guard's two\n // comparisons to compile, and the key expression is printed twice (the bounds test and the\n // index), so a call operand — evaluated twice — is rejected. Every other key keeps GetValue.\n goIntIndexExpression(node): boolean {\n switch (node?.kind) {\n case SyntaxKind.NumericLiteral: {\n const text = `${node.text ?? ''}`;\n return /^\\d+$/.test(text);\n }\n case SyntaxKind.ParenthesizedExpression:\n return this.goIntIndexExpression(node.expression);\n case SyntaxKind.PrefixUnaryExpression:\n return (node.operator === SyntaxKind.MinusToken) && this.goIntIndexExpression(node.operand);\n case SyntaxKind.Identifier:\n return this.goIntOperandIdentifier(node);\n case SyntaxKind.BinaryExpression: {\n const op = node.operatorToken?.kind;\n if ((op === SyntaxKind.PlusToken) || (op === SyntaxKind.MinusToken)\n || (op === SyntaxKind.AsteriskToken) || (op === SyntaxKind.PercentToken)) {\n return this.goIntIndexExpression(node.left) && this.goIntIndexExpression(node.right);\n }\n return false;\n }\n }\n return false;\n }\n\n // true for an identifier the printer emits as a Go int: a local it declared `int`, and a\n // `for (let i = 0; …)` counter, which prints `for i := 0` and is inferred as `int`\n goIntOperandIdentifier(node): boolean {\n if (this.goDeclaredTypeOfIdentifier(node) === 'int') {\n return true;\n }\n const checker: any = this.checkerOrUndefined();\n if (checker === undefined) {\n return false;\n }\n const symbol = checker.getSymbolAtLocation(node);\n const declaration: any = symbol?.valueDeclaration?.resolve();\n if ((declaration?.kind !== SyntaxKind.VariableDeclaration) || (declaration.initializer === undefined)) {\n return false;\n }\n const list: any = declaration.parent;\n const loop: any = list?.parent;\n if ((list?.kind !== SyntaxKind.VariableDeclarationList) || (list.declarations?.length !== 1)\n || (loop?.kind !== SyntaxKind.ForStatement) || (loop.initializer !== list)) {\n return false;\n }\n const text = `${declaration.initializer.text ?? ''}`;\n return (declaration.initializer.kind === SyntaxKind.NumericLiteral) && /^\\d+$/.test(text);\n }\n\n // true when this identifier is a local the printer declared []any because it was unboxed\n // from a `this.SafeList` accessor. Only that family carried the first guarded element read;\n // the declared-type arm below is the D-06 widening.\n goSafeListUnboxIdentifier(node): boolean {\n const checker: any = this.checkerOrUndefined();\n if (checker === undefined) {\n return false;\n }\n const symbol = checker.getSymbolAtLocation(node);\n const declaration: any = symbol?.valueDeclaration?.resolve();\n return (declaration?.kind === SyntaxKind.VariableDeclaration)\n && (this.goSafeListLocalUnbox(declaration) === GO_SAFE_LIST_LOCAL_TYPE);\n }\n\n // true when the identifier's printed Go declaration is a `[]any` slice: the SafeList family\n // above, or any other local/param the declared-type table proved a slice (a slice literal,\n // a `[]any`-returning accessor, a slice param the typed-param family registers). All of them\n goDeclaredListIdentifier(node): boolean {\n return (this.goDeclaredTypeOfIdentifier(node) === GO_SAFE_LIST_LOCAL_TYPE)\n || this.goSafeListUnboxIdentifier(node);\n }\n\n // `x[k]` on a local the printer declared []any is a slice index: GetValue answered nil for an\n // absent index (negative or out of range) and derefs a pointer element, so the native read is\n // the same index behind that guard. Only a key printed as an `int` carries it; every other\n goNativeListElementRead(node, containerStr: string, keyNode, keyStr: string): string | undefined {\n if (containerStr.includes('\\n') || keyStr.includes('\\n')) {\n return undefined;\n }\n if (this.isGoElementAccessAssignmentTarget(node) || !this.goIntIndexExpression(keyNode)) {\n return undefined;\n }\n const level = this.goStatementLevel;\n const body = this.getIden(level + 1);\n return `func() any {\\n${body}if ${keyStr} >= 0 && ${keyStr} < len(${containerStr}) {\\n${this.getIden(level + 2)}return DerefScalar(${containerStr}[${keyStr}])\\n${body}}\\n${body}return nil\\n${this.getIden(level)}}()`;\n }\n\n printElementAccessExpression(node, identation) {\n // Maintain original special-case handling first.\n const special = this.printElementAccessExpressionExceptionIfAny(node);\n if (special) {\n return special;\n }\n\n // Always process element access expressions the same way\n // The binary expression handler will override this for assignments\n\n // For right-side access, build the full nested chain\n const keys: any[] = [];\n let baseExpr = null;\n let current = node as any;\n // Walk down while the *expression* is another ElementAccessExpression.\n while (isElementAccessExpression(current)) {\n keys.unshift(current.argumentExpression); // prepend\n const expr = current.expression;\n if (!isElementAccessExpression(expr)) {\n // Reached the base container.\n baseExpr = expr;\n break;\n }\n current = expr;\n }\n\n // go/printer prints the base of an index expression at depth 1 and the\n // index itself one level deeper; GetValue(base, key) is a two-argument\n // call, so both operands sit one level below the current expression\n const indexDepth = this.goExprDepth + 1;\n const containerStr = this.goWithExprDepth(indexDepth, () => this.printNode(baseExpr, 0));\n const keyStrs = keys.map(k => this.goWithExprDepth(indexDepth, () => this.printNode(k, 0)));\n\n // GetValue(m, \"k\") is a read of a Go map[string]any already: a missing key\n // and a nil element both come back as the `any` nil, so the native index\n // yields the identical value without the helper call\n if (this.goIndexableTypeOf(baseExpr, containerStr) === 'map[string]any') {\n if (this.goKeyIsString(keys[0], keyStrs[0]) && !this.isGoElementAccessAssignmentTarget(node)\n && !this.goMarketComparisonElementRead(node)) {\n return this.goElementAccessChain(`${containerStr}[${keyStrs[0]}]`, keyStrs);\n }\n // a Safe*-boxed string key holds a nilable `*string`, so the read needs the\n // helper's nil answer and deref around the same map index. A multi-line\n // receiver cannot carry the guard's own indentation, so it keeps the helper.\n if (this.goIsDerefStringKeyExpression(keys[0]) && !containerStr.includes('\\n')\n && !this.isGoElementAccessAssignmentTarget(node)) {\n return this.goElementAccessChain(this.printNilGuardedMapIndex(containerStr, keyStrs[0]), keyStrs);\n }\n }\n\n // Now build nested helpers.\n let acc = containerStr;\n keyStrs.forEach(k => {\n acc = `${this.ELEMENT_ACCESS_WRAPPER_OPEN}${acc}, ${k}${this.ELEMENT_ACCESS_WRAPPER_CLOSE}`;\n });\n\n // a local the printer declared []any — either unboxed from a `this.SafeList` accessor or\n // named []any by the declared-type table — is a slice, so an element read with a key it\n // prints as an int is the guarded native index (see goNativeListElementRead)\n if ((baseExpr?.kind === SyntaxKind.Identifier) && this.goDeclaredListIdentifier(baseExpr)) {\n const nativeRead = this.goNativeListElementRead(node, containerStr, keys[0], keyStrs[0]);\n if (nativeRead !== undefined) {\n return this.goElementAccessChain(nativeRead, keyStrs);\n }\n }\n\n return acc;\n }\n\n isInsideVoidFunction(node: Node): boolean {\n for (let cur = node.parent; cur; cur = cur.parent) {\n if (isFunctionLike(cur)) {\n return (cur as any).type === undefined || (cur as any).type.kind === SyntaxKind.VoidKeyword;\n }\n }\n return true; // default-to-void if uncertain\n }\n\n /**\n * Check if a block or statement contains a return statement or throws an error\n */\n hasReturnInBlock(statement: Statement): boolean {\n if (isBlock(statement)) {\n // A sequence of statements returns on all control paths if the last statement returns on all control paths\n if (statement.statements.length === 0) {\n return false;\n }\n return this.hasReturnInBlock(statement.statements[statement.statements.length - 1]);\n } else if (isReturnStatement(statement)) {\n return true;\n } else if (isThrowStatement(statement)) {\n return true;\n } else if (isIfStatement(statement)) {\n // An if statement returns on all control paths if both the \"if\" and \"else\" branches return on all control paths\n const ifHasReturn = this.hasReturnInBlock(statement.thenStatement);\n if (statement.elseStatement) {\n const elseHasReturn = this.hasReturnInBlock(statement.elseStatement);\n return ifHasReturn && elseHasReturn;\n }\n return false; // No else statement, so execution can continue\n } else if (isTryStatement(statement)) {\n // A try statement returns on all control paths if both try and catch blocks return on all control paths\n const tryHasReturn = this.hasReturnInBlock(statement.tryBlock);\n const catchHasReturn = this.hasReturnInBlock(statement.catchClause.block);\n return tryHasReturn && catchHasReturn;\n }\n return false;\n }\n\n /**\n * Check if the last statement in a block is a conditional with returns in all branches\n */\n blockEndsWithConditionalReturn(statements: NodeArray): boolean {\n if (statements.length === 0) {\n return false;\n }\n\n // an if (with an else) or a try returning on every path: hasReturnInBlock's own rules for both\n const lastStatement = statements[statements.length - 1];\n return (isIfStatement(lastStatement) || isTryStatement(lastStatement)) && this.hasReturnInBlock(lastStatement);\n }\n\n\n}\n\n\n// get class decl node\n// Use the getAllSuperTypeNodes function to get the base classes for the MyClass\n// const baseClasses = getAllSuperTypeNodes(classDeclaration);\n\n// // Create a type checker\n// const typeChecker = ts.createTypeChecker(sourceFile.context.program, sourceFile.context.checker);\n\n// // Get the type of the base class\n// const baseClassType = typeChecker.getTypeAtLocation(baseClasses[0]);\n\n// // Get the class declaration for the base class\n// const baseClassDeclaration = baseClassType.symbol.valueDeclaration?.resolve();\n\n// console.log(baseClassDeclaration);\n\n","import { BaseTranspiler } from \"./baseTranspiler.js\";\nimport { NodeFlags, SyntaxKind, type Expression, type Node } from \"typescript/unstable/ast\";\nimport { isArrayLiteralExpression, isArrowFunction, isAsExpression, isBinaryExpression, isBlock, isBooleanLiteral, isCallExpression, isBreakStatement, isClassDeclaration, isConditionalExpression, isContinueStatement, isElementAccessExpression, isExpressionStatement, isForInStatement, isForOfStatement, isFunctionDeclaration, isFunctionExpression, isIdentifier, isIfStatement, isMethodDeclaration, isNonNullExpression, isNumericLiteral, isObjectLiteralExpression, isParameterDeclaration, isParenthesizedExpression, isPostfixUnaryExpression, isPrefixUnaryExpression, isPropertyAccessExpression, isPropertyAssignment, isReturnStatement, isShorthandPropertyAssignment, isSourceFile, isSpreadAssignment, isSpreadElement, isStringLiteral, isStringLiteralLikeNode, isThrowStatement, isTypeAssertion, isTypeOfExpression, isTypeReferenceNode, isVariableDeclaration, isVariableDeclarationList } from \"typescript/unstable/ast/is\";\nimport { createIdentifier } from \"typescript/unstable/ast/factory\";\nimport { API, ElementFlags, IndexKind, SymbolFlags, TypeFlags, type Checker } from \"typescript/unstable/sync\";\nimport { Logger } from \"./logger.js\";\nimport { getAllSuperTypeNodes, getCombinedNodeFlags, isFunctionLike } from \"./tsUtils.js\";\n\nconst parserConfig = {\n EXTENDS_TOKEN: \"extends\",\n PROMISE_TYPE_KEYWORD: \"java.util.concurrent.CompletableFuture\",\n ARRAY_KEYWORD: \"java.util.List\",\n OBJECT_KEYWORD: \"java.util.Map\",\n STRING_KEYWORD: \"String\",\n BOOLEAN_KEYWORD: \"boolean\",\n DEFAULT_PARAMETER_TYPE: \"Object\",\n DEFAULT_RETURN_TYPE: \"Object\",\n DEFAULT_TYPE: \"Object\",\n ELSEIF_TOKEN: \"else if\",\n // Objects in Java: we'll use double-brace initialization so property puts work\n OBJECT_OPENING: \"new java.util.HashMap() {{\",\n OBJECT_CLOSING: \"}}\",\n // Arrays in Java: emit Arrays.asList(...) wrapped by ArrayList\n ARRAY_OPENING_TOKEN: \"new java.util.ArrayList(java.util.Arrays.asList(\",\n ARRAY_CLOSING_TOKEN: \"))\",\n // For object literal properties we'll emit: put(key, value);\n PROPERTY_ASSIGNMENT_TOKEN: \",\",\n VAR_TOKEN: \"Object\", // Java 10+ local var\n METHOD_TOKEN: \"\",\n PROPERTY_ASSIGNMENT_OPEN: \"put(\",\n PROPERTY_ASSIGNMENT_CLOSE: \");\",\n SUPER_TOKEN: \"super\",\n SUPER_CALL_TOKEN: \"super\",\n FALSY_WRAPPER_OPEN: \"Helpers.isTrue(\",\n FALSY_WRAPPER_CLOSE: \")\",\n COMPARISON_WRAPPER_OPEN: \"Helpers.isEqual(\",\n COMPARISON_WRAPPER_CLOSE: \")\",\n UKNOWN_PROP_WRAPPER_OPEN: \"this.call(\",\n UNKOWN_PROP_WRAPPER_CLOSE: \")\",\n UKNOWN_PROP_ASYNC_WRAPPER_OPEN: \"this.callAsync(\",\n UNKOWN_PROP_ASYNC_WRAPPER_CLOSE: \")\",\n DYNAMIC_CALL_OPEN: \"Helpers.callDynamically(\",\n EQUALS_EQUALS_WRAPPER_OPEN: \"Helpers.isEqual(\",\n EQUALS_EQUALS_WRAPPER_CLOSE: \")\",\n DIFFERENT_WRAPPER_OPEN: \"!Helpers.isEqual(\",\n DIFFERENT_WRAPPER_CLOSE: \")\",\n GREATER_THAN_WRAPPER_OPEN: \"Helpers.isGreaterThan(\",\n GREATER_THAN_WRAPPER_CLOSE: \")\",\n GREATER_THAN_EQUALS_WRAPPER_OPEN: \"Helpers.isGreaterThanOrEqual(\",\n GREATER_THAN_EQUALS_WRAPPER_CLOSE: \")\",\n LESS_THAN_WRAPPER_OPEN: \"Helpers.isLessThan(\",\n LESS_THAN_WRAPPER_CLOSE: \")\",\n LESS_THAN_EQUALS_WRAPPER_OPEN: \"Helpers.isLessThanOrEqual(\",\n LESS_THAN_EQUALS_WRAPPER_CLOSE: \")\",\n PLUS_WRAPPER_OPEN: \"Helpers.add(\",\n PLUS_WRAPPER_CLOSE: \")\",\n MINUS_WRAPPER_OPEN: \"Helpers.subtract(\",\n MINUS_WRAPPER_CLOSE: \")\",\n ARRAY_LENGTH_WRAPPER_OPEN: \"Helpers.getArrayLength(\",\n ARRAY_LENGTH_WRAPPER_CLOSE: \")\",\n DIVIDE_WRAPPER_OPEN: \"Helpers.divide(\",\n DIVIDE_WRAPPER_CLOSE: \")\",\n MULTIPLY_WRAPPER_OPEN: \"Helpers.multiply(\",\n MULTIPLY_WRAPPER_CLOSE: \")\",\n INDEXOF_WRAPPER_OPEN: \"Helpers.getIndexOf(\",\n INDEXOF_WRAPPER_CLOSE: \")\",\n MOD_WRAPPER_OPEN: \"Helpers.mod(\",\n MOD_WRAPPER_CLOSE: \")\",\n FUNCTION_TOKEN: \"\",\n ELEMENT_ACCESS_WRAPPER_OPEN: 'Helpers.GetValue(',\n ELEMENT_ACCESS_WRAPPER_CLOSE: ')',\n INFER_VAR_TYPE: false,\n INFER_ARG_TYPE: false,\n};\n\n// hand-written base methods whose Java declaration carries a concrete numeric return type\n// (BaseExchange.java: `public Long milliseconds()`), so a `this.()` call holds that box on\n// every path. Generated methods print `Object`; only this closed table is an arithmetic anchor.\nconst JAVA_THIS_RETURN_TYPES: { [name: string]: string } = {\n 'milliseconds': 'long',\n};\n\n// source files the table was audited against: the declaration on the base class, or\n// its overload-stripped temp copy (build/stripOverloads.ts). A call resolving anywhere\n// else is a venue override that prints its own signature - not provable.\n// `extend = extend` / `deepExtend = deepExtend` resolve to the base-tier generic helpers\nconst JAVA_FRESH_EXTEND_FILE = /(^|[\\\\/])ts[\\\\/]src[\\\\/]base[\\\\/](functions[\\\\/]generic|Exchange(\\.nooverloads\\.\\d+)?)\\.ts$/;\nconst JAVA_THIS_RETURN_TYPES_BASE_FILE = /(^|[\\\\/])ts[\\\\/]src[\\\\/]base[\\\\/]Exchange(\\.nooverloads\\.\\d+)?\\.ts$/;\n// `milliseconds = milliseconds` (Exchange.ts) mixes in the functions/time.ts helper, so\n// the same call may resolve to the Date.now signature in a typescript lib.d.ts instead.\nconst JAVA_THIS_RETURN_TYPES_LIB_FILE = /(^|[\\\\/])node_modules[\\\\/](?:[^\\\\/]+[\\\\/]node_modules[\\\\/])?typescript6?[\\\\/]lib[\\\\/]lib\\.[^\\\\/]*\\.d\\.ts$/;\n\n// every assignment operator (`=`, `+=`, `??=`, ...) but no comparison (`===`, `!==`, `<=`, `>=`):\n// an element access on the left of one of these is a write site and keeps the base emission\nconst JAVA_ASSIGNMENT_OPERATOR_KINDS: Set = (() => {\n const kinds: any = SyntaxKind;\n const names = Object.keys(kinds).filter((name) => name.endsWith('EqualsToken')\n && !/^Equals|^Exclamation|^LessThan|^GreaterThan/.test(name));\n return new Set(([ 'EqualsToken' ].concat(names)).map((name) => kinds[name]).filter((kind) => kind !== undefined));\n})();\n\n// TS type flags whose Java print is a scalar final class or a primitive: `instanceof\n// java.util.List` is not convertible on those operands, so they keep the helper\nconst JAVA_SCALAR_TYPE_FLAGS: number = TypeFlags.String | TypeFlags.StringLiteral\n | TypeFlags.Number | TypeFlags.NumberLiteral\n | TypeFlags.Boolean | TypeFlags.BooleanLiteral\n | TypeFlags.BigInt | TypeFlags.BigIntLiteral\n | TypeFlags.Enum | TypeFlags.EnumLiteral\n | TypeFlags.ESSymbol | TypeFlags.UniqueESSymbol;\n\n// TS type flags that are never an array (JS `Array.isArray(null)` / `(undefined)` is false)\nconst JAVA_NULLISH_TYPE_FLAGS: number = TypeFlags.Undefined | TypeFlags.Null\n | TypeFlags.Void | TypeFlags.Never;\n\n// hand-written `boolean` fields in the class body of BaseExchange.java / PredictionExchange.java\n// (the half hand-written base files the generated exchanges inherit): a read of one prints a\n// primitive Java boolean, so `this.` IS the wrapper's result.\nconst JAVA_BOOLEAN_BASE_FIELDS = new Set([\n 'this.alias',\n 'this.verbose',\n 'this.validateServerSsl',\n 'this.enableRateLimit',\n 'this.pro',\n 'this.certified',\n 'this.reloadingMarkets',\n 'this.marketsLoaded',\n 'this.reduceFees',\n 'this.substituteCommonCurrencyCodes',\n 'this.isSandboxModeEnabled',\n 'this.returnResponseHeaders',\n 'this.newUpdates',\n 'this.syncSleep',\n // PredictionExchange.java\n 'this.reloadingEvents',\n]);\n\n// hand-written map fields of BaseExchange.java: each value is a java.util.Map, so `this.[k]`\n// is the helper's Map branch. `nullable` marks a field set to null or written from an Object-typed\n// call, so the read keeps the null answer behind a receiver guard.\nconst JAVA_FIELD_TYPES: { [name: string]: { map: boolean, nullable: boolean } } = {\n 'ohlcvs': { map: true, nullable: false },\n 'orderbooks': { map: true, nullable: false },\n 'balance': { map: true, nullable: true },\n 'options': { map: true, nullable: true },\n 'markets': { map: true, nullable: true },\n};\n\n// hand-written base methods declared `public boolean` (BaseExchange.java): a call prints a\n// primitive Java boolean, so a local fed by one holds a Boolean box or null.\nconst JAVA_BOOLEAN_BASE_CALLS = new Set([\n 'valueIsDefined',\n 'inArray',\n 'isEmpty',\n 'isJsonEncodedObject',\n 'isBinaryMessage',\n]);\n\n// operators whose printed Java form is a primitive boolean on every path: the logical ones and\n// every comparison / `in` / `instanceof`-style test the printer lowers to Helpers.isEqual /\n// isGreaterThan / inOp (all declared `public static boolean`) or to a native Java boolean\nconst JAVA_BOOLEAN_OPERATOR_KINDS: Set = (() => {\n const k: any = SyntaxKind;\n return new Set([\n k.AmpersandAmpersandToken,\n k.BarBarToken,\n k.EqualsEqualsToken,\n k.EqualsEqualsEqualsToken,\n k.ExclamationEqualsToken,\n k.ExclamationEqualsEqualsToken,\n k.LessThanToken,\n k.LessThanEqualsToken,\n k.GreaterThanToken,\n k.GreaterThanEqualsToken,\n k.InKeyword,\n k.InstanceOfKeyword,\n ]);\n})();\n\n// the relational `Precise.string*` statics are declared `public static boolean` in the\n// hand-written java/lib/src/main/java/io/github/ccxt/base/Precise.java, so their printed call is\n// already a Java primitive boolean (the String-returning statics are NOT listed here)\nconst JAVA_PRECISE_BOOLEAN_STATICS: Set = new Set([\n 'stringEq', 'stringEquals', 'stringGt', 'stringGe', 'stringLt', 'stringLe',\n]);\n\n// The printer erases TS return annotations to `Object`, so Helpers.isTrue would re-test a value the\n// hand-written Java base (BaseExchange.java, above the transpiled delimiter) already returns as a\n// boolean. Java overrides are covariant, so no generated venue method can widen these returns.\nconst JAVA_THIS_BOOLEAN_METHODS = new Set([\n 'inArray', // public boolean inArray (Object elem, Object list2)\n 'isArray', // public boolean isArray (Object a)\n 'isEmpty', // public boolean isEmpty (Object a)\n 'valueIsDefined', // public boolean valueIsDefined (Object value)\n 'isJsonEncodedObject', // public boolean isJsonEncodedObject (Object str)\n 'isBinaryMessage', // public boolean isBinaryMessage (Object message)\n]);\n\n// The GENERATED boolean accessors (`Object safeBool (...)`) hand the caller's `defaultValue` back\n// untouched when the found value is not a Boolean, so the box is Boolean-or-null only when the\n// default argument is absent or a boolean literal. Value = index of that argument in the call.\nconst JAVA_THIS_BOOLEAN_BOX_METHODS: { [name: string]: number } = {\n 'safeBool': 2,\n 'safeBool2': 3,\n 'safeBoolN': 2,\n};\n\n// the Java spellings a consumer declares a dict local with (import-shortened forms\n// included); every other declared type keeps Helpers.GetValue\nconst JAVA_DECLARED_MAP_TYPES = /^(java\\.util\\.)?(Map|HashMap)\\s*<\\s*String\\s*,\\s*Object\\s*>$/;\n\n// the Java spellings a consumer declares an element-read receiver with when it is a List:\n// the read prints `x.get(i)` / `x.size()` with no cast, because the declaration is the List\nconst JAVA_DECLARED_LIST_TYPES = /^(java\\.util\\.)?(List|ArrayList)\\s*<[^;\\n=]+>$/;\n\n// the Java primitive spellings a declaration can publish: an operand that prints as one\n// cannot take the `instanceof` test a native map read guards with\nconst JAVA_PRIMITIVE_DECLARED_TYPES = new Set(['boolean', 'byte', 'char', 'short', 'int', 'long', 'float', 'double']);\n\n// the numeric declaration types the ccxt-side pass publishes; the boxed ones can hold\n// null, so a native compare guards them first\nconst JAVA_DECLARED_NUMERIC_TYPES: Set =\n new Set(['Integer', 'Long', 'Double', 'int', 'long', 'double']);\n\nconst JAVA_BOXED_NUMERIC_TYPES: Set =\n new Set(['Integer', 'Long', 'Double']);\n\n// receiver node kinds whose printed Java is a primary expression, so the `(String)`\n// checkcast in front of them binds the whole receiver (a native `+` prints its own parens)\nconst JAVA_SPLIT_RECEIVER_KINDS: Set = new Set([\n SyntaxKind.Identifier,\n SyntaxKind.PropertyAccessExpression,\n SyntaxKind.ElementAccessExpression,\n SyntaxKind.CallExpression,\n SyntaxKind.ParenthesizedExpression,\n SyntaxKind.StringLiteral,\n SyntaxKind.NoSubstitutionTemplateLiteral,\n]);\n\n// TS classes/interfaces whose hand-written java counterpart extends java.util.ArrayList\n// (java/lib/.../ws/ArrayCache.java and ws/OrderBookSide.java, plus the IndexedOrderBookSide and\n// Asks/Bids subclasses); every runtime value of these types answers `.length` with the list size\nconst JAVA_LIST_BACKED_TS_CLASSES: Set = new Set([\n 'ArrayCache',\n 'ArrayCacheByTimestamp',\n 'ArrayCacheBySymbolById',\n 'ArrayCacheByOutcomeById',\n 'ArrayCacheBySymbolBySide',\n 'OrderBookSide',\n 'IndexedOrderBookSide',\n 'Asks',\n 'Bids',\n 'IndexedAsks',\n 'IndexedBids',\n 'IOrderBookSide',\n]);\n\n// the Java spelling that lets the printed key go straight to containsKey: the helper only\n// looks a key up when it is a String, and a String-typed operand is one on every path\nconst JAVA_DECLARED_STRING_TYPE = /^(java\\.util\\.)?String$/;\n\n// TS parameter annotations (`Dict`, `Market`, `Currency`, `Str`, `OrderType`/`OrderSide`, `Bool`) print the native Java\n// type on the declaring method. `Int`/`Num` stay `Object`: a TS `number` is an Integer, Long or\n// Double box in generated code, so neither a `Long`/`Double` parameter nor a cast site is provable.\nconst JAVA_NATIVE_PARAMETER_TYPES: { [name: string]: string } = {\n 'Dict': 'java.util.Map',\n 'Market': 'java.util.Map',\n 'Currency': 'java.util.Map',\n 'Str': 'String',\n 'OrderType': 'String',\n 'OrderSide': 'String',\n 'Bool': 'Boolean',\n};\n\n// Java types of default-valued parameters; separate from the fixed-parameter table.\n// `Num`/`Bool`/`Strings` stay Object: widening them changes payload strings or varargs spreading.\nconst JAVA_NATIVE_PARAMETER_TYPES_OPTIONAL: { [name: string]: string } = {\n 'Dict': 'java.util.Map',\n 'Market': 'java.util.Map',\n 'Currency': 'java.util.Map',\n 'Str': 'String',\n 'OrderType': 'String',\n 'OrderSide': 'String',\n 'Int': 'Long',\n 'Strings': 'java.util.List',\n};\n\n// `Strings` (and a `string[]` spelling of the same slot) is typed only on parameters named `symbols`\nconst JAVA_STRINGS_OPTIONAL_PARAMETER_NAMES = new Set(['symbols']);\nconst JAVA_STRING_LIST_TYPE = 'java.util.List';\n// base symbol-list helpers keep their Object slot (hand-written java callers pass Object)\nconst JAVA_STRINGS_EXCLUDED_METHODS = new Set(['marketSymbols', 'marketIds', 'marketsForSymbols', 'getMarketFromSymbols']);\n\n// the aliases above have to come from the shared ts/src/base/types.ts declaration\nconst JAVA_NATIVE_PARAMETER_SOURCE_FILES = /(^|\\/)ts\\/src\\/base\\/types\\.ts$/;\n\n// Parameter positions whose Java signature cannot move to the annotated type even though\n// the base declaration carries it. Java overrides are invariant, so one excluded position\n// boxes every declaration of the name at once.\nconst JAVA_NATIVE_PARAMETER_EXCLUDED_POSITIONS: { [name: string]: number[] } = {\n // implicit endpoints pass fetch2/request/sign params through untyped (arrays for batch orders)\n 'fetch2': [ 3 ],\n // the Exchange tier keeps fetchOrderBook's symbol Object; PredictionExchange overrides must erase alike\n 'fetchOrderBook': [ 0 ],\n 'request': [ 3 ],\n 'sign': [ 3 ],\n 'handleErrors': [ 4 ],\n 'parseOrder': [ 0 ],\n 'parseTrade': [ 0 ],\n 'amountToPrecision': [ 0 ],\n 'client': [ 0 ],\n 'costToPrecision': [ 0 ],\n 'handleOptionAndParams': [ 1 ],\n 'market': [ 0 ],\n 'marketSymbols': [ 1 ],\n 'parseAccount': [ 0 ],\n 'parseMarket': [ 0 ],\n 'parseOrderBook': [ 1 ],\n 'priceToPrecision': [ 0 ],\n 'safeBalance': [ 0 ],\n 'safeOpenInterest': [ 0 ],\n 'safeSymbol': [ 0 ],\n // java/tests/src/main/java/tests/base/TestSafeTicker.java is generated by the\n // --baseTests stage, which the farm's java target never reruns: it calls\n // `exchange.safeTicker()` and cannot be regenerated with a checkcast\n 'safeTicker': [ 0 ],\n 'symbol': [ 0 ],\n 'watch': [ 0, 1 ],\n};\n\n// only the generated tiers carry the annotation: a method declared in ts/src/base/** has a\n// hand-written java counterpart (BaseExchange/Exchange/Helpers/Precise) that keeps `Object`\nconst JAVA_NATIVE_PARAMETER_GENERATED_FILES = /(^|\\/)ts\\/src\\/(?:pro\\/|prediction\\/)?[a-z0-9_]+\\.ts$/;\n\n// the base tier is generated too: the transpiled `BaseExchange` body of\n// ts/src/base/Exchange.ts is spliced into java/lib/.../BaseExchange.java (the hand-written\n// java surface around it is not a class of its own), so its declarations print the\n// the base tiers print only the methods below this line of ts/src/base/(Prediction)Exchange.ts\nconst JAVA_TRANSPILE_DELIMITER = 'METHODS BELOW THIS LINE ARE TRANSPILED FROM TYPESCRIPT';\n// hand-written base methods whose Java runtime declares exactly the TS parameters (no varargs)\nconst JAVA_HANDWRITTEN_FULL_ARITY = new Set(['loadMarkets', 'fetchMarkets', 'fetchCurrencies', 'exceptionMessage']);\nconst JAVA_HANDWRITTEN_TIER_FILES = /(^|\\/)ts\\/src\\/(?:base|static_dependencies)\\//;\nconst JAVA_NATIVE_PARAMETER_BASE_FILES = /(^|[\\\\/])ts[\\\\/]src[\\\\/]base[\\\\/](Prediction)?Exchange(\\.nooverloads[^/]*)?\\.ts$/;\n\n// ===== native RETURN types (D-09) =====\n//\n// The printer declares every generated method `Object` (BaseTranspiler.printFunctionType\nconst JAVA_NATIVE_RETURN_MAP_TYPE = 'java.util.Map';\n\n// the hand-written `public String` producers of the base tier a `this. (...)` return\n// may print: the safeString* family, decimalToPrecision / numberToString (BaseExchange.java)\n// and the string helpers of base/functions/type.ts. Guarded by the resolved signature still\nconst JAVA_STRING_RETURN_BASE_METHODS: Set = new Set([\n 'safeString', 'safeString2', 'safeStringN',\n 'safeStringUpper', 'safeStringUpper2', 'safeStringUpperN',\n 'safeStringLower', 'safeStringLower2', 'safeStringLowerN',\n 'decimalToPrecision', 'numberToString', 'formatNumber', 'implodeParams', 'implodeHostname',\n]);\nconst JAVA_STRING_RETURN_BASE_FILES = /(^|[\\\\/])ts[\\\\/]src[\\\\/]base[\\\\/](?:functions[\\\\/](?:type|time)\\.ts|Exchange(\\.nooverloads[^/]*)?\\.ts)$/;\n\n// prediction venues (ts/src/prediction/.ts) live in their own package: their Java base,\n// PredictionExchange.java, carries the injected Exchange-tier body (javaTranspiler.ts\n// getExchangeTierBody), and the venue chain (abstract/prediction/ -> PredictionExchange ->\nconst JAVA_NATIVE_PARAMETER_PREDICTION_FILES = /(^|\\/)ts\\/src\\/prediction\\/[a-z0-9_]+\\.ts$/;\n\nconst JAVA_BOOLEAN_EXCLUDED_TYPE_FLAGS: number =\n TypeFlags.Any | TypeFlags.Unknown | TypeFlags.Undefined | TypeFlags.Null\n | TypeFlags.Void | TypeFlags.Never | TypeFlags.TypeParameter | TypeFlags.Conditional\n | TypeFlags.Enum | TypeFlags.EnumLiteral;\n\n// the union members a nullable boolean box may hold: `Bool` (`boolean | undefined`) and the\n// `boolean | null` spellings. A member of any other family (`Int`, `Str`, `any`) is a box the\n// isTrue helper tests with its runtime truthiness, so the helper must stay.\nconst JAVA_NULLABLE_BOOLEAN_MEMBER_FLAGS: number =\n TypeFlags.Boolean | TypeFlags.BooleanLiteral | TypeFlags.Undefined | TypeFlags.Null\n | TypeFlags.Void;\n\n// the `handle*Bool` accessors route through safeBool, which returns the caller's default untouched\n// when the found value is not a Boolean, so element 0 of their `[Bool, Dict]` tuple is a\n// Boolean-or-null box. The handleOptionAndParams family returns the raw member and is absent.\nconst JAVA_BOOLEAN_BOX_TUPLE_METHODS = new Set([\n 'handleParamBool',\n 'handleParamBool2',\n 'handleOptionBoolAndParams', // element 0 is checkOptionBool's Boolean-or-null (throws otherwise)\n 'handleOptionBoolAndParams2',\n]);\n\n// the Java printer and its build hooks re-ask the same checker questions about one node,\n// type, symbol or signature; answers are fixed per snapshot, so each is one round trip\nconst JAVA_MEMO_UNDEFINED = Symbol(\"javaMemoUndefined\");\nconst JAVA_MEMOIZED_METHODS = [\"getSignatureFromDeclaration\", \"isArrayType\", \"isTupleType\", \"getAliasedSymbol\", \"getTypeArguments\", \"getDeclaredTypeOfSymbol\", \"getReturnTypeOfSignature\", \"getSymbolOfType\", \"getTypeOfSymbolAtLocation\", \"getSignaturesOfType\", \"typeToString\", \"getTypesOfType\"];\nconst JAVA_TYPE_PREFETCH_KINDS = new Set([SyntaxKind.Identifier, SyntaxKind.BinaryExpression, SyntaxKind.Parameter, SyntaxKind.VariableDeclaration, SyntaxKind.StringLiteral, SyntaxKind.MethodDeclaration, SyntaxKind.PropertyAccessExpression, SyntaxKind.ParenthesizedExpression, SyntaxKind.ElementAccessExpression]);\nconst JAVA_SYMBOL_PREFETCH_KINDS = new Set([SyntaxKind.Identifier]);\n// the first lookup in a source file answers every node of the hot kinds in that file in one\n// array request, skipping nodes the core prefetch already cached; other kinds go one by one\nfunction prefetchByFile(checker: Checker, name: \"getTypeAtLocation\" | \"getSymbolAtLocation\", kinds: Set): void {\n const original = (checker as any)[name] as ((nodes: any) => any) & { has?: (node: Node) => boolean };\n const cache = new WeakMap();\n const done = new WeakSet();\n Object.defineProperty(checker, name, { configurable: true, value: (node: any) => {\n if (Array.isArray(node)) {\n return original(node);\n }\n if (cache.has(node)) {\n return cache.get(node);\n }\n const sf = node.getSourceFile?.();\n if (sf !== undefined && !done.has(sf)) {\n done.add(sf);\n const nodes: Node[] = [];\n const visit = (n: Node) => {\n if (kinds.has(n.kind) && !original.has?.(n)) {\n nodes.push(n);\n }\n n.forEachChild(visit);\n };\n sf.forEachChild(visit);\n if (nodes.length > 0) {\n const results = original(nodes);\n for (let i = 0; i < nodes.length; i++) {\n cache.set(nodes[i], results[i]);\n }\n }\n if (cache.has(node)) {\n return cache.get(node);\n }\n }\n const result = original(node);\n cache.set(node, result);\n return result;\n } });\n}\n\n// getResolvedSignature has no array form: the first lookup in a file pipelines every call\n// expression of that file through one batched request (API#batch over the checker's client)\nfunction prefetchResolvedSignatures(checker: Checker): void {\n const original = checker.getResolvedSignature;\n const client = (checker as any).client;\n if (client === undefined) {\n return;\n }\n const cache = new WeakMap();\n const done = new WeakSet();\n Object.defineProperty(checker, \"getResolvedSignature\", { configurable: true, value: (node: any) => {\n if (cache.has(node)) {\n return cache.get(node);\n }\n const sf = node?.getSourceFile?.();\n if (sf !== undefined && !done.has(sf)) {\n done.add(sf);\n const calls: Node[] = [];\n const visit = (n: Node) => {\n if (n.kind === SyntaxKind.CallExpression && !(original as any).has?.(n)) {\n calls.push(n);\n }\n n.forEachChild(visit);\n };\n sf.forEachChild(visit);\n if (calls.length > 0) {\n const results = API.prototype.batch.call({ client }, ...calls.map((c) => original.gen(c))) as unknown[];\n for (let i = 0; i < calls.length; i++) {\n cache.set(calls[i], results[i]);\n }\n }\n if (cache.has(node)) {\n return cache.get(node);\n }\n }\n const result = original(node);\n cache.set(node, result);\n return result;\n } });\n}\n\nfunction memoizeJavaCheckerCalls(checker: Checker): Checker {\n if ((checker as any).__javaMemoized) {\n return checker;\n }\n Object.defineProperty(checker, \"__javaMemoized\", { value: true });\n prefetchByFile(checker, \"getTypeAtLocation\", JAVA_TYPE_PREFETCH_KINDS);\n prefetchByFile(checker, \"getSymbolAtLocation\", JAVA_SYMBOL_PREFETCH_KINDS);\n prefetchResolvedSignatures(checker);\n for (const name of JAVA_MEMOIZED_METHODS) {\n const original = (checker as any)[name];\n if (typeof original !== \"function\") {\n continue;\n }\n const byFirst = new WeakMap>();\n Object.defineProperty(checker, name, { configurable: true, value: (first: any, ...rest: any[]) => {\n if (first === null || (typeof first !== \"object\" && typeof first !== \"function\") || rest.some((a) => a !== undefined && typeof a === \"object\")) {\n return original(first, ...rest);\n }\n let byRest = byFirst.get(first);\n if (byRest === undefined) {\n byRest = new Map();\n byFirst.set(first, byRest);\n }\n const key = rest.length === 0 ? \"\" : JSON.stringify(rest);\n const cached = byRest.get(key);\n if (cached !== undefined) {\n return cached === JAVA_MEMO_UNDEFINED ? undefined : cached;\n }\n const result = original(first, ...rest);\n byRest.set(key, result === undefined ? JAVA_MEMO_UNDEFINED : result);\n return result;\n } });\n }\n return checker;\n}\n\nexport class JavaTranspiler extends BaseTranspiler {\n\n getChecker(): Checker {\n return memoizeJavaCheckerCalls(super.getChecker());\n }\n\n // override lookups repeat per method on every printed call and hook; the answer is fixed per node\n private methodOverrideCache = new WeakMap();\n getMethodOverride(node: Node): Node {\n if (node === undefined || node === null) {\n return super.getMethodOverride(node);\n }\n const cached = this.methodOverrideCache.get(node);\n if (cached !== undefined) {\n return cached === JAVA_MEMO_UNDEFINED ? undefined : cached;\n }\n const result = this.javaMethodOverrideFromIndex(node);\n this.methodOverrideCache.set(node, result === undefined ? JAVA_MEMO_UNDEFINED : result);\n return result;\n }\n\n // BaseTranspiler.getMethodOverride answered from a per-class ancestor chain of\n // name -> last method maps (the furthest ancestor declaring the name wins, as there)\n private overrideChainCache = new WeakMap[] | null>();\n private javaMethodOverrideFromIndex(node: Node): Node {\n const classDeclaration = node.parent;\n if (!isClassDeclaration(classDeclaration) || !(classDeclaration as any).heritageClauses) {\n return undefined;\n }\n let chain = this.overrideChainCache.get(classDeclaration);\n if (chain === undefined) {\n chain = [];\n let parentClass = getAllSuperTypeNodes(classDeclaration)[0];\n while (parentClass !== undefined) {\n const parentClassDecl = this.getChecker().getTypeAtLocation(parentClass)?.getSymbol()?.valueDeclaration?.resolve();\n if (parentClassDecl === undefined) {\n chain = null; // the base path warns and answers undefined\n break;\n }\n const byName = new Map();\n for (const elem of (parentClassDecl as any).members ?? []) {\n if (isMethodDeclaration(elem)) {\n byName.set(elem.name.getText().trim(), elem);\n }\n }\n chain.push(byName);\n parentClass = getAllSuperTypeNodes(parentClassDecl)[0] ?? undefined;\n }\n this.overrideChainCache.set(classDeclaration, chain);\n }\n if (chain === null) {\n return super.getMethodOverride(node);\n }\n const name = (node as any).name.text;\n let method = undefined;\n for (const byName of chain) {\n method = byName.get(name) ?? method;\n }\n return method;\n }\n\n checkerOrUndefined(): Checker | undefined {\n const checker = super.checkerOrUndefined();\n return checker === undefined ? undefined : memoizeJavaCheckerCalls(checker);\n }\n\n // optional proof of the concrete printed Java type of an expression, installed by the embedding\n // build layer for the locals it retypes (ccxt: build/java-local-types.js); it must match the\n // declared type or the operator will not compile. Only `String` is consumed (native `+` anchor).\n javaExpressionTypeResolver?: (node) => string | undefined;\n\n // the embedding build layer (build/java-local-types.js) installs this: it names the\n // Java type of a local whose printed declaration line it rewrote (`Long`/`Double`).\n // The arithmetic rule reads it for identifier operands only.\n\n countRequiredParameters(declaration) {\n // parameters with no default, no question token and no rest are required positionally\n return (declaration?.parameters ?? [])\n .filter((p) => p.initializer === undefined && p.questionToken === undefined && p.dotDotDotToken === undefined).length;\n }\n\n printArgsForCallExpression(node, identation) {\n const fullArity = this.javaFullArityCallArguments(node.arguments ?? [], node, identation);\n if (fullArity !== undefined) {\n return fullArity;\n }\n let args: readonly any[] = node.arguments ?? [];\n const callee = node.expression;\n const isThisCall = callee?.kind === SyntaxKind.PropertyAccessExpression\n && callee.expression?.kind === SyntaxKind.ThisKeyword;\n if (isThisCall && args.length > 0) {\n const last = args[args.length - 1];\n const isNullish = last.kind === SyntaxKind.NullKeyword\n || (last.kind === SyntaxKind.Identifier && last.text === 'undefined');\n // the trailing nullish may only be dropped when it sits in the OPTIONAL tail\n // of the resolved signature - a required positional parameter passed as an\n // explicit undefined (e.g. dydx signDydxTx) must be kept, otherwise the\n // emitted call breaks arity, see https://github.com/ccxt/ccxt/actions/runs/31321542066\n let inOptionalTail = false;\n if (isNullish) {\n const signature = this.getChecker().getResolvedSignature(node);\n const declaration = signature?.declaration?.resolve();\n if (declaration !== undefined) {\n inOptionalTail = args.length > this.countRequiredParameters(declaration);\n }\n }\n if (isNullish && inOptionalTail) {\n // drop exactly one trailing null/undefined argument: the generated java\n // surface is uniformly (required..., Object... optionals), and a bare\n // trailing null is ambiguous to javac (\"non-varargs call of varargs\n // method with inexact argument type for last parameter\"). Omission is\n // behaviorally identical - both Helpers.getArg and SafeMethods.opt\n // treat a null varargs array and an empty one the same, see\n // https://github.com/ccxt/ccxt/pull/29617 for the warning inventory\n args = args.slice(0, -1);\n }\n }\n return this.javaPrintCallArguments(args, node, identation);\n }\n\n // a call into a method whose fixed parameter prints a native type: generated locals are `Object`,\n // so the argument carries the same checkcast as native map/string reads. The checker proved the\n // argument assignable to the parameter, so the declared type describes the value received.\n javaPrintCallArguments(args, node, identation) {\n const superCore = this.javaSuperCoreCallArguments(args, node, identation);\n if (superCore !== undefined) {\n return superCore;\n }\n const scheduled = this.javaScheduledCallArguments(args, node, identation);\n if (scheduled !== undefined) {\n return scheduled;\n }\n const spawnTypes = this.javaSpawnCallParameterTypes(node);\n const parameterTypes = spawnTypes !== undefined ? spawnTypes : this.javaNativeCallParameterTypes(node);\n return args.map((a, i) => {\n const parsedArg = this.printNode(a, identation).trim();\n const type = parameterTypes[i];\n if (type === undefined || this.javaNativeArgumentAlreadyTyped(a, type)) {\n return parsedArg;\n }\n // the checkcast carries its own parentheses: a bare `(T) cond ? a : b` binds the\n // condition, not the whole argument\n return `(${type}) (${parsedArg})`;\n }).join(\", \");\n }\n\n // the implementation declaration of a resolved method (an overload signature has no body)\n javaMethodImplementation(declaration) {\n if (declaration === undefined || !isMethodDeclaration(declaration)) {\n return undefined;\n }\n if (declaration.body !== undefined) {\n return declaration;\n }\n try {\n const symbol = this.getChecker().getSymbolAtLocation(declaration.name);\n return symbol?.declarations?.map((d) => d.resolve()).find((d) => isMethodDeclaration(d) && d.body !== undefined);\n } catch (e) {\n return undefined;\n }\n }\n\n // a method this printer emits with its single typed signature: hand-written Java declares\n // ts/src/base/** except the base tiers below their transpile delimiter\n javaIsPrintedMethod(method): boolean {\n if (method === undefined || !isMethodDeclaration(method) || method.body === undefined\n || !isClassDeclaration(method.parent)) {\n return false;\n }\n const file = method.getSourceFile();\n const fileName = file.fileName.replace(/\\\\/g, '/');\n if (!/(^|\\/)ts\\/src\\//.test(fileName)) {\n return true;\n }\n if (JAVA_NATIVE_PARAMETER_BASE_FILES.test(fileName)) {\n const delimiter = file.text.indexOf(JAVA_TRANSPILE_DELIMITER);\n return (delimiter >= 0 && method.pos > delimiter)\n || JAVA_HANDWRITTEN_FULL_ARITY.has((method.name as any)?.text);\n }\n // every class outside the hand-written tiers is printed (exchanges, tests, ...)\n return !JAVA_HANDWRITTEN_TIER_FILES.test(fileName);\n }\n\n javaHasOptionalParameter(method): boolean {\n return (method?.parameters ?? []).some((p) => p.initializer !== undefined || p.questionToken !== undefined);\n }\n\n // a call into a printed method with optional parameters passes every parameter: omitted or\n // `undefined` slots take the TS default, fixed slots keep the native checkcast\n javaFullArityCallArguments(args, node, identation): string | undefined {\n const callee = node.expression;\n if (callee?.kind !== SyntaxKind.PropertyAccessExpression\n || callee.expression?.kind === SyntaxKind.SuperKeyword) {\n return undefined;\n }\n let method;\n try {\n method = this.javaMethodImplementation(this.getChecker().getResolvedSignature(node)?.declaration?.resolve())\n ?? this.javaAnyReceiverBaseMethod(callee);\n } catch (e) {\n return undefined;\n }\n return this.javaFullArityArguments(method, args, identation);\n }\n\n // an `any` receiver (the tests' `exchange: any`) compiles against the Java Exchange class:\n // bind the base Exchange method of that name when it is implemented exactly once\n javaAnyReceiverBaseMethod(callee) {\n const type = this.getChecker().getTypeAtLocation(callee.expression);\n if ((type.flags & TypeFlags.Any) === 0) {\n return undefined;\n }\n const methods = this.baseExchangeMethodsByName().get(callee.name?.text as string);\n return methods?.length === 1 ? methods[0] : undefined;\n }\n\n private _baseExchangeMethodsByName = new WeakMap>();\n baseExchangeMethodsByName(): Map {\n const program = this.getProgram();\n const cached = this._baseExchangeMethodsByName.get(program);\n if (cached !== undefined) {\n return cached;\n }\n const names = new Map();\n const fileName = program.getSourceFileNames()\n .find((f) => /(^|[\\\\/])ts[\\\\/]src[\\\\/]base[\\\\/]Exchange\\.ts$/.test(f));\n const file = fileName !== undefined ? program.getSourceFile(fileName) : undefined;\n // the implementations live on BaseExchange; Exchange only adds its own tier, and a name\n // the base class implements binds there (the receiver compiles against BaseExchange)\n for (const className of ['BaseExchange', 'Exchange']) {\n const cls = file?.statements.find((s) => isClassDeclaration(s) && s.name?.text === className) as any;\n const own = new Map();\n for (const member of cls?.members ?? []) {\n if (isMethodDeclaration(member) && member.body !== undefined && isIdentifier(member.name)) {\n own.set(member.name.text, (own.get(member.name.text) ?? []).concat([member]));\n }\n }\n own.forEach((methods, key) => names.has(key) || names.set(key, methods));\n }\n this._baseExchangeMethodsByName.set(program, names);\n return names;\n }\n\n javaFullArityArguments(method, args, identation): string | undefined {\n if (!this.javaIsPrintedMethod(method) || !this.javaHasOptionalParameter(method)) {\n return undefined;\n }\n const params = method.parameters;\n if (args.length > params.length || params.some((p) => p.dotDotDotToken !== undefined)\n || args.some((a) => a.kind === SyntaxKind.SpreadElement)) {\n return undefined;\n }\n const types = this.javaCoreParameterTypes(method);\n return params.map((p, i) => {\n const arg = args[i];\n if (arg === undefined || (p.initializer !== undefined && this.javaIsUndefinedLiteral(arg))) {\n return this.javaCoreDefaultArgument(p, types[i]);\n }\n const printed = this.printNode(arg, identation).trim();\n if (p.initializer !== undefined) {\n return this.javaArgumentHasType(arg, types[i]) || types[i] === 'Object'\n ? (this.javaIsUndefinedLiteral(arg) ? 'null' : printed)\n : this.javaConvertToCoreType(types[i], printed, arg);\n }\n const native = this.javaNativeParameterType(p);\n if (native === undefined || this.javaNativeArgumentAlreadyTyped(arg, native)) {\n return printed;\n }\n return `(${native}) (${printed})`;\n }).join(', ');\n }\n\n javaIsUndefinedLiteral(node): boolean {\n return node?.kind === SyntaxKind.Identifier && node.text === 'undefined';\n }\n\n // `this.spawn(this.m, a..)` / `this.delay(ms, this.m, a..)`: the ccxt post-pass turns the\n // reference into a lambda calling `this.m(a..)`, so those arguments take m's full arity\n javaScheduledCallArguments(args, node, identation): string | undefined {\n const callee = node.expression;\n if (callee?.kind !== SyntaxKind.PropertyAccessExpression\n || callee.expression?.kind !== SyntaxKind.ThisKeyword) {\n return undefined;\n }\n const at = callee.name?.text === 'spawn' ? 0 : (callee.name?.text === 'delay' ? 1 : -1);\n const reference = at >= 0 ? args[at] : undefined;\n if (reference?.kind !== SyntaxKind.PropertyAccessExpression\n || reference.expression?.kind !== SyntaxKind.ThisKeyword) {\n return undefined;\n }\n let method;\n try {\n const symbol = this.getChecker().getSymbolAtLocation(reference.name);\n method = this.javaMethodImplementation(symbol?.valueDeclaration?.resolve() ?? symbol?.declarations?.[0]?.resolve());\n } catch (e) {\n return undefined;\n }\n const forwarded = this.javaFullArityArguments(method, args.slice(at + 1), identation);\n if (forwarded === undefined) {\n return undefined;\n }\n const head = args.slice(0, at + 1).map((a) => this.printNode(a, identation).trim());\n return head.concat(forwarded.length > 0 ? [forwarded] : []).join(', ');\n }\n\n // `super.x(..)` into a split method must bind the typed core: an ancestor bridge re-dispatches\n // through `this`, which lands back in the overriding core (infinite recursion)\n javaSuperCoreCallArguments(args, node, identation): string | undefined {\n const callee = node.expression;\n if (callee?.kind !== SyntaxKind.PropertyAccessExpression\n || callee.expression?.kind !== SyntaxKind.SuperKeyword) {\n return undefined;\n }\n let declaration;\n try {\n declaration = this.javaMethodImplementation(this.getChecker().getResolvedSignature(node)?.declaration?.resolve());\n } catch (e) {\n return undefined;\n }\n if (declaration === undefined || !this.hasDefaultedTail(declaration)) {\n return undefined;\n }\n const params = (declaration as any).parameters;\n if (params.some((p) => p.dotDotDotToken !== undefined)) {\n return undefined;\n }\n if (args.length > params.length) {\n return undefined;\n }\n const types = this.javaCoreParameterTypes(declaration);\n return params.map((p, i) => (i < args.length\n ? (this.javaArgumentHasType(args[i], types[i]) ? this.printNode(args[i], identation).trim()\n : this.javaConvertToCoreType(types[i], this.printNode(args[i], identation).trim(), args[i]))\n : this.javaCoreDefaultArgument(p, types[i]))).join(', ');\n }\n\n // an argument that is a parameter of the enclosing method already printed with this type\n javaArgumentHasType(arg, type: string): boolean {\n if (arg?.kind !== SyntaxKind.Identifier) {\n return false;\n }\n let declaration;\n try {\n declaration = this.getChecker().getSymbolAtLocation(arg)?.valueDeclaration?.resolve();\n } catch (e) {\n return false;\n }\n if (declaration === undefined || !isParameterDeclaration(declaration)) {\n return false;\n }\n const method = declaration.parent;\n if (!isMethodDeclaration(method) && this.ReassignedVars[this.getVarKey(declaration)] && this.isAsyncFunction(method)) {\n return false; // an async function body reads an `Object` copy\n }\n const printed = declaration.initializer !== undefined\n ? (this.hasDefaultedTail(method) ? this.javaOptionalParameterJavaType(declaration) : 'Object')\n : (this.printParameterType(declaration) || 'Object').trim();\n return this.javaErasure(printed) === this.javaErasure(type);\n }\n\n // the printed Java type of every parameter of a split method's typed core\n javaCoreParameterTypes(method): string[] {\n return method.parameters.map((p) => (p.initializer !== undefined\n ? this.javaOptionalParameterJavaType(p)\n : (this.printParameterType(p) || 'Object').trim()));\n }\n\n // an omitted parameter of a typed-core call: its TS default, typed like the front's reader\n javaCoreDefaultArgument(param, type: string): string {\n const initializer = param.initializer;\n // a default that reads other parameters or has effects is applied by the callee\n const value = initializer === undefined || !this.isPureInitializer(initializer) ? 'null' : this.printNode(initializer, 0);\n if (value === 'null') {\n return `(${type}) null`;\n }\n if (type === 'Long' && /^-?\\d+$/.test(value)) {\n return value + 'L';\n }\n if (type === JAVA_STRING_LIST_TYPE && isArrayLiteralExpression(initializer) && initializer.elements.length === 0) {\n return 'new java.util.ArrayList()';\n }\n if (type === 'Object' || (type === 'String' && isStringLiteralLikeNode(initializer))\n || (type === 'java.util.Map' && isObjectLiteralExpression(initializer))) {\n return value;\n }\n return this.javaConvertToCoreType(type, value, initializer);\n }\n\n // a value of any static type converted to a typed-core parameter, with the fronts' semantics\n javaConvertToCoreType(type: string, printed: string, node): string {\n if (node?.kind === SyntaxKind.NullKeyword\n || (node?.kind === SyntaxKind.Identifier && node.text === 'undefined')) {\n return `(${type}) null`;\n }\n if (type === 'Object') {\n return `(Object) (${printed})`;\n }\n if (this.javaLocalDeclaredAs(node, printed, type)) {\n return printed;\n }\n if (type === 'Long') {\n if (/^-?\\d+$/.test(printed) && isNumericLiteral(isPrefixUnaryExpression(node) ? node.operand : node)) {\n return printed + 'L';\n }\n return /^-?\\d+L$/.test(printed) ? printed : `Helpers.toLongOrNull(${printed})`;\n }\n if (type === 'String') {\n return this.javaNativeArgumentAlreadyTyped(node, type) ? printed : `Helpers.toStringArg(${printed})`;\n }\n if (type === 'java.util.Map') {\n return `Helpers.toMapArg(${printed})`;\n }\n if (type === JAVA_STRING_LIST_TYPE) {\n return `Helpers.toStringListArg(${printed})`;\n }\n return `(${type}) (${printed})`;\n }\n\n // an identifier whose final Java declaration (the build layer's table, or a natively typed\n // parameter) is exactly the core type and which prints under its own name: no conversion\n javaLocalDeclaredAs(node, printed: string, type: string): boolean {\n if (node === undefined || !isIdentifier(node) || printed !== node.text) {\n return false;\n }\n const declaration = this.javaDeclarationOfIdentifier(node);\n if (declaration === undefined || !isVariableDeclaration(declaration)) {\n return this.javaArgumentHasType(node, type)\n && (type !== JAVA_STRING_LIST_TYPE || this.javaDeclaredTypeOf(node) === JAVA_STRING_LIST_TYPE);\n }\n const declared = this.javaDeclaredTypeOf(node);\n return declared !== undefined && declared.replace(/\\s+/g, '').replace(/^java\\.util\\./, '')\n === type.replace(/\\s+/g, '').replace(/^java\\.util\\./, '');\n }\n\n // Java erasure of a printed type, for override/bridge comparisons\n javaErasure(type: string): string {\n return type.replace(/<.*>/, '').replace(/^java\\.util\\./, '').trim();\n }\n\n // An override whose typed core differs from an ancestor's (another parameter count, another\n // default position or type) no longer overrides it in Java: a bridge with the ancestor's\n // signature forwards to this method, so base code calling the ancestor core reaches it.\n printOverrideBridges(node, identation): string {\n const ownTypes = this.javaCoreParameterTypes(node);\n const ownKey = ownTypes.map((t) => this.javaErasure(t)).join(',');\n const seen = new Set();\n let out = '';\n let ancestor;\n try {\n ancestor = this.getMethodOverride(node);\n } catch (e) {\n return '';\n }\n while (ancestor !== undefined) {\n if (this.hasDefaultedTail(ancestor)) {\n const ancestorTypes = this.javaCoreParameterTypes(ancestor);\n const key = ancestorTypes.map((t) => this.javaErasure(t)).join(',');\n if (key !== ownKey && !seen.has(key)) {\n seen.add(key);\n out += this.printOverrideBridge(node, ancestor, ancestorTypes, ownTypes, identation);\n }\n }\n try {\n ancestor = this.getMethodOverride(ancestor);\n } catch (e) {\n ancestor = undefined;\n }\n }\n return out;\n }\n\n printOverrideBridge(node, ancestor, ancestorTypes: string[], ownTypes: string[], identation): string {\n const name = this.transformMethodNameIfNeeded(node.name.text);\n const ancestorNames = ancestor.parameters.map((p) => this.printNode(p.name, 0));\n const ancestorDef = this.printMethodDefinition(ancestor, identation,\n () => ancestorTypes.map((t, i) => `${t} ${ancestorNames[i]}`).join(', '));\n const forwarded = node.parameters.map((p, i) => (i < ancestorNames.length\n ? (this.javaErasure(ownTypes[i]) === this.javaErasure(ancestorTypes[i]) ? ancestorNames[i]\n : this.javaConvertToCoreType(ownTypes[i], ancestorNames[i], undefined))\n : this.javaCoreDefaultArgument(p, ownTypes[i]))).join(', ');\n const call = `this.${name}(${forwarded})`;\n const returnOf = (def: string) => def.match(/(?:public|protected|private)\\s+(?:static\\s+)?(.+?)\\s+\\w+\\s*\\(/)?.[1]?.trim() ?? 'Object';\n const returnType = returnOf(ancestorDef);\n const ownReturn = returnOf(this.printMethodDefinition(node, identation, () => ''));\n const body = returnType === 'void' ? `${call};`\n : returnType === ownReturn ? `return ${call};` : `return (${returnType}) (Object) ${call};`;\n return \"\\n\" + ancestorDef + this.getBlockOpen(identation)\n + this.getIden(identation + 1) + body\n + this.getBlockClose(identation);\n }\n\n // `this.spawn(this.someMethod, args...)`: the spawned work executes `this.someMethod(args)`\n // (the ccxt post-pass rewrites the reference into a lambda), so the arguments belong to the\n // referenced method's signature, not to spawn's `...args` - each one carries the checkcast\n javaSpawnCallParameterTypes(node): (string | undefined)[] | undefined {\n const callee = node.expression;\n if (callee?.kind !== SyntaxKind.PropertyAccessExpression\n || callee.expression?.kind !== SyntaxKind.ThisKeyword\n || callee.name?.text !== 'spawn') {\n return undefined;\n }\n const reference = (node.arguments ?? [])[0];\n if (reference?.kind !== SyntaxKind.PropertyAccessExpression\n || reference.expression?.kind !== SyntaxKind.ThisKeyword\n || reference.name?.text === undefined) {\n return undefined;\n }\n let declaration;\n try {\n const symbol = this.getChecker().getSymbolAtLocation(reference.name);\n declaration = symbol?.valueDeclaration?.resolve() ?? symbol?.declarations?.[0]?.resolve();\n } catch (e) {\n return undefined;\n }\n const parameters = (declaration as any)?.parameters;\n if (parameters === undefined) {\n return undefined;\n }\n return (node.arguments ?? []).map((a, i) => {\n if (i === 0) {\n return undefined;\n }\n const param = parameters[i - 1];\n if (param === undefined || !isParameterDeclaration(param)) {\n return undefined;\n }\n return this.javaNativeParameterType(param);\n });\n }\n\n // the argument is a literal (or a String the embedding build layer's resolver proves)\n // and the parameter declares exactly that type, so no cast is needed. Every other\n // argument prints from a local the printer declares `Object`, and needs the checkcast.\n javaNativeArgumentAlreadyTyped(arg, type: string) {\n if (arg.kind === SyntaxKind.NullKeyword) {\n return true;\n }\n // an object literal prints a `HashMap` instance, already a Map\n if (type === JAVA_NATIVE_RETURN_MAP_TYPE && isObjectLiteralExpression(arg)) {\n return true;\n }\n if (type !== 'String') {\n return false;\n }\n if (isStringLiteralLikeNode(arg)) {\n return true;\n }\n return this.javaProvableString(arg);\n }\n\n // the native printed type of each argument position of a call, when the resolved\n // signature declares that parameter natively\n javaNativeCallParameterTypes(node): (string | undefined)[] {\n const checker: any = this.checkerOrUndefined();\n if (checker === undefined) {\n return [];\n }\n const declaration = checker.getResolvedSignature(node)?.declaration?.resolve();\n const parameters = (declaration as any)?.parameters;\n if (parameters === undefined) {\n return [];\n }\n return (node.arguments ?? []).map((a, i) => {\n const param = parameters[i];\n if (param === undefined || !isParameterDeclaration(param)) {\n return undefined;\n }\n return this.javaNativeParameterType(param);\n });\n }\n\n binaryExpressionsWrappers;\n\n varListFromObjectLiterals = {};\n // binary operators whose printed Java is a primitive boolean: Helpers.isEqual (and the\n // negated `!Helpers.isEqual` / `<` / `>` / `<=` / `>=` family), Helpers.inOp,\n // Helpers.isInstance and the native `&&` / `||`\n javaBooleanOperators = Array.from(JAVA_BOOLEAN_OPERATOR_KINDS);\n // Per-function analysis results. Populated by analyzeFinalVars at the start of\n // printFunctionBody and consumed during printing of the same function body.\n usageToFinalName: WeakMap = new WeakMap();\n // Stack of emitted-finalName sets, one entry per enclosing block. Pushed on block\n // entry, popped on exit. Used by buildFinalVarDeclarations to dedup: skip if the\n // finalName is already in scope via any ancestor.\n finalVarScopeStack: Array> = [];\n // Identifiers rewritten in place to their finalXxx name during the current emit.\n // The parsed ts.SourceFile is cached and reused across transpile calls, so the\n // rewrite has to be undone when the emit ends — otherwise a second emit of the\n // same file reads `finalX` where the first read `x`, the symbol no longer\n // resolves, and the hoisted `final Object finalX = x;` declaration is dropped\n // while its usages remain.\n finalVarMutations: Array<{ node: any; text: any; ownGetFullText: boolean; getFullText: any }> = [];\n // Java expression passed as the second supplyAsync argument for async methods.\n // Empty (the default) emits the single-argument, common-pool supplyAsync form.\n asyncExecutor = '';\n // Static method emitted in place of java.util.concurrent.CompletableFuture.supplyAsync\n // for async methods. The callee owns the executor choice, so no second argument is emitted.\n asyncSupplier = '';\n\n constructor(config = {}) {\n config[\"parser\"] = Object.assign({}, parserConfig, config[\"parser\"] ?? {});\n super(config);\n\n this.requiresParameterType = true;\n this.requiresReturnType = true;\n this.asyncTranspiling = true;\n this.implicitAsyncTranspiling = true;\n this.supportsFalsyOrTruthyValues = false;\n this.requiresCallExpressionCast = true;\n this.id = \"Java\";\n\n this.initConfig();\n this.applyUserOverrides(config);\n this.asyncExecutor = config['asyncExecutor'] ?? '';\n this.asyncSupplier = config['asyncSupplier'] ?? '';\n }\n\n initConfig() {\n this.LeftPropertyAccessReplacements = {\n // 'this': '$this',\n };\n\n this.RightPropertyAccessReplacements = {\n // Java list/string methods (lowerCamelCase)\n push: \"add\",\n indexOf: \"indexOf\",\n toUpperCase: \"toUpperCase\",\n toLowerCase: \"toLowerCase\",\n toString: \"toString\",\n };\n\n this.FullPropertyAccessReplacements = {\n \"JSON.parse\": \"parseJson\",\n \"console.log\": \"System.out.println\",\n \"Number.MAX_SAFE_INTEGER\": \"Long.MAX_VALUE\",\n \"Math.min\": \"Math.min\",\n \"Math.max\": \"Math.max\",\n \"Math.log\": \"Math.log\",\n \"Math.abs\": \"Math.abs\",\n \"Math.floor\": \"Math.floor\",\n \"Math.pow\": \"Math.pow\",\n // 'Promise.all' handled via promiseAll wrapper\n };\n\n this.CallExpressionReplacements = {\n 'parseInt': \"Helpers.parseInt\",\n \"parseFloat\": \"Helpers.parseFloat\",\n // Add ad-hoc function call rewrites here if you need them\n };\n\n\n this.ReservedKeywordsReplacements = {\n string: \"str\",\n object: \"obj\",\n params: \"parameters\",\n // base: \"bs\",\n internal: \"intern\",\n event: \"eventVar\",\n fixed: \"fixedVar\",\n final: \"finalVar\",\n native: \"nativeVar\",\n // add Java keywords if you need to avoid collisions (e.g., enum, assert)\n };\n\n this.VariableTypeReplacements = {\n string: \"String\",\n Str: \"String\",\n number: \"double\",\n Int: \"long\",\n Num: \"double\",\n Dict: \"java.util.Map\",\n Strings: \"java.util.List\",\n List: \"java.util.List\",\n boolean: \"boolean\",\n object: \"Object\",\n };\n\n this.ArgTypeReplacements = { ...this.VariableTypeReplacements };\n\n this.binaryExpressionsWrappers = {\n [SyntaxKind.EqualsEqualsToken]: [this.EQUALS_EQUALS_WRAPPER_OPEN, this.EQUALS_EQUALS_WRAPPER_CLOSE],\n [SyntaxKind.EqualsEqualsEqualsToken]: [this.EQUALS_EQUALS_WRAPPER_OPEN, this.EQUALS_EQUALS_WRAPPER_CLOSE],\n [SyntaxKind.ExclamationEqualsToken]: [this.DIFFERENT_WRAPPER_OPEN, this.DIFFERENT_WRAPPER_CLOSE],\n [SyntaxKind.ExclamationEqualsEqualsToken]: [this.DIFFERENT_WRAPPER_OPEN, this.DIFFERENT_WRAPPER_CLOSE],\n [SyntaxKind.GreaterThanToken]: [this.GREATER_THAN_WRAPPER_OPEN, this.GREATER_THAN_WRAPPER_CLOSE],\n [SyntaxKind.GreaterThanEqualsToken]: [this.GREATER_THAN_EQUALS_WRAPPER_OPEN, this.GREATER_THAN_EQUALS_WRAPPER_CLOSE],\n [SyntaxKind.LessThanToken]: [this.LESS_THAN_WRAPPER_OPEN, this.LESS_THAN_WRAPPER_CLOSE],\n [SyntaxKind.LessThanEqualsToken]: [this.LESS_THAN_EQUALS_WRAPPER_OPEN, this.LESS_THAN_EQUALS_WRAPPER_CLOSE],\n [SyntaxKind.PlusToken]: [this.PLUS_WRAPPER_OPEN, this.PLUS_WRAPPER_CLOSE],\n [SyntaxKind.MinusToken]: [this.MINUS_WRAPPER_OPEN, this.MINUS_WRAPPER_CLOSE],\n [SyntaxKind.AsteriskToken]: [this.MULTIPLY_WRAPPER_OPEN, this.MULTIPLY_WRAPPER_CLOSE],\n [SyntaxKind.PercentToken]: [this.MOD_WRAPPER_OPEN, this.MOD_WRAPPER_CLOSE],\n [SyntaxKind.SlashToken]: [this.DIVIDE_WRAPPER_OPEN, this.DIVIDE_WRAPPER_CLOSE],\n };\n }\n\n getBlockOpen(identation) {\n return \"\\n\" + this.getIden(identation) + this.BLOCK_OPENING_TOKEN + \"\\n\";\n }\n\n\n getCustomClassName(node) {\n return this.capitalize(node.name.text);\n }\n\n getClassModifier(node) {\n return \"public \";\n }\n\n printSuperCallInsideConstructor(_node, _identation) {\n // Java allows \"super(...)\" as the first line; we already inject it when needed.\n return \"\";\n }\n\n printNumericLiteral(node) {\n const javaMax = 2147483647;\n const nodeText = node.text;\n if (Number(nodeText) > javaMax && Number.isInteger(Number(nodeText)) && node.text.indexOf('e') === -1) {\n return `${nodeText}L`;\n }\n return node.text;\n }\n\n printIdentifier(node) {\n let idValue = node.text ?? node.text;\n\n if (this.ReservedKeywordsReplacements[idValue]) {\n idValue = this.ReservedKeywordsReplacements[idValue];\n }\n\n if (idValue === \"undefined\") {\n return this.UNDEFINED_TOKEN;\n }\n\n const defaulted = this.javaDefaultedLocalName(node);\n if (defaulted !== undefined) {\n return defaulted;\n }\n\n // keep the same class-reference typeof-guarding logic as your original file,\n // but run the syntactic (parent-position) checks first: they exclude the vast\n // majority of identifiers without paying for a type-checker lookup\n const isInsideNewExpression =\n node?.parent?.kind === SyntaxKind.NewExpression;\n const isInsideCatch =\n node?.parent?.kind === SyntaxKind.ThrowStatement;\n const isLeftSide =\n node?.parent?.name === node || node?.parent?.left === node;\n const isCallOrPropertyAccess =\n node?.parent?.kind === SyntaxKind.PropertyAccessExpression ||\n node?.parent?.kind === SyntaxKind.ElementAccessExpression;\n if (!isLeftSide && !isCallOrPropertyAccess && !isInsideCatch && !isInsideNewExpression) {\n const type = this.getChecker().getTypeAtLocation(node);\n const typeSymbol = type?.getSymbol?.();\n if (typeSymbol !== undefined) {\n const decl = (typeSymbol?.declarations ?? []).map((d) => d.resolve());\n if (decl.length > 0 && decl[0].getSourceFile().fileName.indexOf(\"typescript\") === -1) {\n const symbol = this.getChecker().getSymbolAtLocation(node);\n const first = symbol?.declarations[0]?.resolve();\n const isClassDeclaration = !!symbol && (first.kind === SyntaxKind.ClassDeclaration\n || (first.kind === SyntaxKind.ImportSpecifier\n && this.getChecker().getAliasedSymbol(symbol)?.declarations[0]?.resolve()?.kind === SyntaxKind.ClassDeclaration));\n if (isClassDeclaration) {\n return `${idValue}.class`;\n }\n }\n }\n }\n\n return this.transformIdentifier(node, idValue);\n }\n\n printConstructorDeclaration(node, identation) {\n const classNode = node.parent;\n const className = this.printNode(classNode.name, 0);\n const args = this.printMethodParameters(node);\n const constructorBody = this.printFunctionBody(node, identation);\n\n // find super call inside constructor and extract params\n let superCallParams = \"\";\n let hasSuperCall = false;\n node.body?.statements.forEach((statement) => {\n const expression = isExpressionStatement(statement) ? statement.expression : undefined;\n if (expression && isCallExpression(expression) && expression.expression.getText().trim() === \"super\") {\n hasSuperCall = true;\n superCallParams = expression.arguments.map((a) => this.printNode(a, identation).trim()).join(\", \");\n }\n });\n\n const header = this.getIden(identation) + className + \"(\" + args + \")\";\n // In Java, super(...) must be the first statement inside the body.\n return header + (hasSuperCall ? this.injectLeadingInBody(constructorBody, `super(${superCallParams});`) : constructorBody);\n }\n\n injectLeadingInBody(body, firstLine) {\n // body is \"{\\n ...\\n}\"\n const lines = body.split(\"\\n\");\n if (lines.length >= 2) {\n lines.splice(1, 0, this.getIden(1) + firstLine);\n }\n return lines.join(\"\\n\");\n }\n\n printDynamicCall(node, identation) {\n // Use reflection helper exactly like before; Java runtime should provide callDynamically(Object, String, Object[])\n const elementAccess = node.expression;\n if (elementAccess?.kind === SyntaxKind.ElementAccessExpression) {\n const parsedArg = node.arguments?.map((n) => this.printNode(n, identation).trimStart()).join(\", \") ?? \"\";\n const target = this.printNode(elementAccess.expression, 0);\n const propName = this.printNode(elementAccess.argumentExpression, 0);\n return `${this.DYNAMIC_CALL_OPEN}${target}, ${propName}, new Object[] { ${parsedArg} })`;\n }\n return undefined;\n }\n\n // printElementAccessExpressionExceptionIfAny(node) {\n // const tsKind = ts.SyntaxKind;\n // if (node.expression.kind === tsKind.CallExpression) {\n // const callExp = node.expression;\n // const calleeText = callExp.expression.getText();\n // if (calleeText.endsWith('.split') || calleeText.toLowerCase().includes('split')) {\n // // print Split call normally (should already close with ))\n // let splitCall = this.printNode(callExp, 0).trim();\n // if (!splitCall.endsWith(')')) {\n // splitCall += ')';\n // }\n // const idxArg = this.printNode(node.argumentExpression, 0);\n // return `GetValue(${splitCall}, ${idxArg})`;\n // }\n // }\n // // default: no exception\n // return undefined;\n // }\n\n printWrappedUnknownThisProperty(node) {\n const type = this.getChecker().getResolvedSignature(node);\n if (type?.declaration === undefined) {\n const parsedArguments = node.arguments?.map((a) => this.printNode(a, 0)).join(\", \") || \"\";\n const propName = node.expression?.name.text;\n return `${this.DYNAMIC_CALL_OPEN}this, \"${propName}\", new Object[] { ${parsedArguments} })`;\n }\n return undefined;\n }\n\n printOutOfOrderCallExpressionIfAny(node, identation) {\n if (node.expression.kind === SyntaxKind.Identifier) {\n const callee = node.expression.text;\n if (callee === 'parseInt' || callee === 'parseFloat') {\n const nativeParse = this.printNativeScalarParse(node, callee);\n if (nativeParse !== undefined) {\n return nativeParse;\n }\n }\n }\n if (node.expression.kind === SyntaxKind.PropertyAccessExpression) {\n const expressionText = node.expression.getText().trim();\n const args = node.arguments;\n if (args.length === 1) {\n const parsedArg = this.printNode(args[0], 0);\n switch (expressionText) {\n case \"Math.abs\":\n return `Helpers.mathAbs(Double.parseDouble(${this.javaStringBoxText(args[0], parsedArg)}))`;\n }\n } else if (args.length === 2) {\n const parsedArg1 = this.printNode(args[0], 0);\n const parsedArg2 = this.printNode(args[1], 0);\n switch (expressionText) {\n case \"Math.min\":\n case \"Math.max\": {\n const native = this.printNativeMathMinMax(\n node, args[0], args[1], parsedArg1, parsedArg2, expressionText === \"Math.min\" ? \"min\" : \"max\");\n if (native !== undefined) {\n return native;\n }\n const wrapper = expressionText === \"Math.min\" ? \"Helpers.mathMin(\" : \"Helpers.mathMax(\";\n return `${wrapper}${parsedArg1}, ${parsedArg2})`;\n }\n case \"Math.pow\":\n // both arguments are Double.parseDouble results, so Helpers.mathPow always\n // takes its Number branch and returns the same double java.lang.Math.pow does\n return `Math.pow(Double.parseDouble(${this.javaStringBoxText(args[0], parsedArg1)}), Double.parseDouble(${this.javaStringBoxText(args[1], parsedArg2)}))`;\n }\n }\n const leftSide = node.expression?.expression;\n const leftSideText = leftSide ? this.printNode(leftSide, 0) : undefined;\n\n // wrap unknown property this.X calls\n if (\n leftSideText === this.THIS_TOKEN ||\n leftSide.getFullText().indexOf(\"(this as any)\") > -1\n ) {\n const res = this.printWrappedUnknownThisProperty(node);\n if (res) return res;\n }\n }\n\n // dynamic call: obj[prop](...)\n if (node.expression.kind === SyntaxKind.ElementAccessExpression) {\n return this.printDynamicCall(node, identation);\n }\n\n return undefined;\n }\n\n handleTypeOfInsideBinaryExpression(node, _identation) {\n const left = node.left;\n const right = node.right.text;\n const op = node.operatorToken.kind;\n const expression = left.expression;\n\n const isDifferentOperator =\n op === SyntaxKind.ExclamationEqualsEqualsToken ||\n op === SyntaxKind.ExclamationEqualsToken;\n const notOperator = isDifferentOperator ? this.NOT_TOKEN : \"\";\n\n const target = this.printNode(expression, 0);\n switch (right) {\n case \"string\":\n return `${notOperator}(${target} instanceof String)`;\n case \"number\":\n return `${notOperator}(${target} instanceof Long || ${target} instanceof Integer || ${target} instanceof Float || ${target} instanceof Double)`;\n case \"boolean\":\n return `${notOperator}(${target} instanceof Boolean)`;\n case \"object\":\n return `${notOperator}(${target} instanceof java.util.Map)`;\n case \"function\":\n // no universal Function type in Java; treat as any Method/Callable\n return `${notOperator}(${target} instanceof java.util.concurrent.Callable)`;\n }\n return undefined;\n }\n\n getVarMethodIfAny(node) {\n // should return the name of the method this node belongs to, if any;\n // the raw AST name is enough here — the result is only used as a scoping\n // key, and printNode on an identifier consults the type checker\n let current = node?.parent;\n while (current) {\n if (isMethodDeclaration(current) || isFunctionDeclaration(current)) {\n return String((current.name as any)?.text ?? '');\n }\n current = current.parent;\n }\n return 'outsideAnyMethod';\n }\n\n getVarClassIfAny(node) {\n // should return the name of the class this node belongs to, if any;\n // raw AST name for the same reason as getVarMethodIfAny\n let current = node?.parent;\n while (current) {\n if (isClassDeclaration(current)) {\n return String((current.name as any)?.text ?? '');\n }\n current = current.parent;\n }\n return '';\n }\n\n getVarKey(node) {\n const varName = node?.text ?? node?.name?.text;\n if (!varName) {\n return '';\n }\n return `${this.getVarClassIfAny(node)}-${this.getVarMethodIfAny(node)}-${varName}`;\n }\n\n // Static operand family of one side of an equality, undefined when the checker proves\n // nothing usable. Null/undefined union members are folded away: Objects.equals handles\n // those exactly like the helper, so `string | undefined` still counts as string.\n equalityOperandFamily(type: any): string | undefined {\n if (type === undefined || type === null) {\n return undefined;\n }\n const flags = type.flags;\n if (flags & TypeFlags.Intersection) {\n return undefined;\n }\n if (flags & TypeFlags.Union) {\n // `boolean` is itself the union true|false and carries the Boolean bit\n if (flags & TypeFlags.Boolean) {\n return 'boolean';\n }\n const families = new Set((type.getTypes?.() ?? []).map((t) => this.equalityOperandFamily(t)));\n families.delete(undefined as any);\n families.delete('null');\n return families.size === 1 ? families.values().next().value : undefined;\n }\n if (flags & (TypeFlags.String | TypeFlags.StringLiteral)) {\n return 'string';\n }\n if (flags & (TypeFlags.Boolean | TypeFlags.BooleanLiteral)) {\n return 'boolean';\n }\n if (flags & (TypeFlags.Null | TypeFlags.Undefined | TypeFlags.Void)) {\n return 'null';\n }\n return undefined;\n }\n\n // The null/undefined literal: its Java text is `null`, so Objects.equals(x, null)\n // is literally the identity test Helpers.isEqual performs on that operand.\n isNullishLiteral(node): boolean {\n return node?.kind === SyntaxKind.NullKeyword\n || (node?.kind === SyntaxKind.Identifier && node.text === 'undefined');\n }\n\n // ---- numeric operand kinds (java-15) ----\n // Helpers.isEqual compares numeric operands by value (integers via toLong, Double/Float via\n // toDouble, class mismatch false), so two operands of the SAME kind compare natively.\n\n // the Java kind a decimal numeric literal prints with: integer literal as `N` (int) or `NL` (long),\n // a '.'/exponent literal as a Java double. TypeScript normalizes the literal text (`1e3` -> `1000`,\n // `0x10` -> `16`, `100.0` -> `100`), so node.text is exactly what prints.\n javaEqualityLiteralKind(node) {\n if (!node) {\n return undefined;\n }\n // `-1`: the printer prints the sign in front of the literal, so the value is a Java\n // primitive of the operand's own kind — only an int-range operand keeps it (a long\n // literal would print with its own `L` suffix and the sign would not widen)\n if (node.kind === SyntaxKind.PrefixUnaryExpression && node.operator === SyntaxKind.MinusToken) {\n return this.javaIntegerLiteralKind(node.operand) === 'int' ? 'int' : undefined;\n }\n if (!isNumericLiteral(node)) {\n return undefined;\n }\n return /[.eE]/.test(node.text) ? 'double' : this.javaIntegerLiteralKind(node);\n }\n\n // `x.length` on a checker-proven String/List receiver prints a native int\n // (((String)x).length() / ((List)x).size(), see javaLengthKind). Every other\n // receiver prints Helpers.getArrayLength, whose value is not an int.\n javaNativeLengthKind(node) {\n if (node?.kind !== SyntaxKind.PropertyAccessExpression || node.name.text !== 'length') {\n return undefined;\n }\n return this.javaLengthKind(node.expression) !== undefined ? 'int' : undefined;\n }\n\n // `for (var i = ; ...; i++)`: javac infers a primitive int counter, so\n // every read of it — not only the loop condition the comparison rule sees — is a\n // native int. ++/-- keep it int and the counter cannot hold another box.\n isJavaPrimitiveCounterReference(node) {\n if (!node || node.kind !== SyntaxKind.Identifier) {\n return false;\n }\n const checker = this.getChecker();\n const symbol = checker.getSymbolAtLocation(node);\n const declaration: any = symbol?.valueDeclaration?.resolve() ?? symbol?.declarations?.[0]?.resolve();\n if (!declaration || declaration.kind !== SyntaxKind.VariableDeclaration || !isIdentifier(declaration.name)) {\n return false;\n }\n const list = declaration.parent;\n const forStatement: any = list?.parent;\n if (!list || !forStatement || forStatement.kind !== SyntaxKind.ForStatement || forStatement.initializer !== list) {\n return false;\n }\n if (list.declarations?.length !== 1 || this.javaIntegerLiteralKind(declaration.initializer) === undefined) {\n return false;\n }\n const incrementor = forStatement.incrementor;\n if (!incrementor\n || (incrementor.kind !== SyntaxKind.PostfixUnaryExpression && incrementor.kind !== SyntaxKind.PrefixUnaryExpression)\n || (incrementor.operator !== SyntaxKind.PlusPlusToken && incrementor.operator !== SyntaxKind.MinusMinusToken)\n || incrementor.operand?.kind !== SyntaxKind.Identifier) {\n return false;\n }\n const incrementorSymbol = checker.getSymbolAtLocation(incrementor.operand);\n return incrementorSymbol === undefined || symbol === undefined || incrementorSymbol === symbol;\n }\n\n // the box a printed local carries: the kind of its declaration's initializer, kept\n // only while every write in the declaring function writes the same kind (D2 scan).\n // A `const` declaration has no write to scan.\n javaLocalNumberKind(node, depth) {\n if (!node || node.kind !== SyntaxKind.Identifier) {\n return undefined;\n }\n const symbol = this.getChecker().getSymbolAtLocation(node);\n const declaration: any = symbol?.valueDeclaration?.resolve() ?? symbol?.declarations?.[0]?.resolve();\n if (!declaration || declaration.kind !== SyntaxKind.VariableDeclaration || !isIdentifier(declaration.name)) {\n return undefined;\n }\n const kind = this.javaPrintedNumberKind(declaration.initializer, depth + 1);\n if (kind === undefined) {\n return undefined;\n }\n const isConst = (declaration.parent?.flags & NodeFlags.Const) !== 0;\n if (!isConst && !this.javaWritesKeepNumberKind(declaration, symbol, kind)) {\n return undefined;\n }\n return kind;\n }\n\n // true when every assignment to the symbol inside its function writes the same\n // numeric kind; a compound assignment (`x += 1` prints Helpers.add) changes the box.\n javaWritesKeepNumberKind(declaration, symbol, kind) {\n const owner = this.enclosingFunctionLike(declaration);\n if (owner === undefined) {\n return false;\n }\n let safe = true;\n const visit = (node) => {\n if (!safe) {\n return;\n }\n if (isBinaryExpression(node)) {\n const op = node.operatorToken.kind;\n if (this.isAssignmentOperator(op) && this.expressionReferencesSymbol(node.left, symbol)) {\n if (op !== SyntaxKind.EqualsToken || this.javaPrintedNumberKind(node.right, 0) !== kind) {\n safe = false;\n return;\n }\n }\n } else if ((node.kind === SyntaxKind.ForOfStatement || node.kind === SyntaxKind.ForInStatement)\n && this.expressionReferencesSymbol(node.initializer, symbol)) {\n safe = false;\n return;\n } else if ((isPrefixUnaryExpression(node) || isPostfixUnaryExpression(node))\n && (node.operator === SyntaxKind.PlusPlusToken || node.operator === SyntaxKind.MinusMinusToken)\n && kind !== 'int' && this.expressionReferencesSymbol(node.operand, symbol)) {\n safe = false;\n return;\n }\n node.forEachChild(visit);\n };\n owner.forEachChild(visit);\n return safe;\n }\n\n expressionReferencesSymbol(node, symbol): boolean {\n if (node === undefined || symbol === undefined) {\n return false;\n }\n let found = false;\n const visit = (child) => {\n if (found) {\n return;\n }\n if (child.kind === SyntaxKind.Identifier && this.getChecker().getSymbolAtLocation(child) === symbol) {\n found = true;\n return;\n }\n child.forEachChild(visit);\n };\n visit(node);\n return found;\n }\n\n enclosingFunctionLike(node) {\n let current = node?.parent;\n while (current) {\n if (isFunctionLike(current)) {\n return current;\n }\n current = current.parent;\n }\n return undefined;\n }\n\n // box/primitive kind of an operand the printer prints as a native number, or undefined\n // when the printed value could be any box (a call, a parameter, an `any` local)\n javaPrintedNumberKind(node, depth = 0) {\n const literalKind = this.javaEqualityLiteralKind(node);\n if (literalKind !== undefined) {\n return literalKind;\n }\n const lengthKind = this.javaNativeLengthKind(node);\n if (lengthKind !== undefined) {\n return lengthKind;\n }\n if (this.isJavaPrimitiveCounterReference(node)) {\n return 'int';\n }\n const arithmeticKind = this.javaNativeArithmeticKind(node);\n if (arithmeticKind !== undefined) {\n return arithmeticKind;\n }\n return depth < 2 ? this.javaLocalNumberKind(node, depth) : undefined;\n }\n\n // numeric equality operand: the checker proves a plain number and the printed Java\n // value carries a known kind. Aliases (Int/Num), unions and `any` stay with the\n // helper, like in the arithmetic rule.\n javaEqualityNumberKind(node) {\n if (this.javaScalarFamily(node) !== 'number') {\n return undefined;\n }\n return this.javaPrintedNumberKind(node);\n }\n\n // ==/===/!=/!== become java.util.Objects.equals once the checker proves one operand is\n // a string, a boolean or the null/undefined literal: for those Helpers.isEqual reduces\n // to Objects.equals (value compare, class-strict, no numeric promotion). Two operands\n // the checker types as plain numbers compare natively when their printed Java kinds\n // match (java-15): the helper's numeric paths are the same value compare.\n printNativeEqualityIfProvable(node, leftText: string, rightText: string): string | undefined {\n const op = node.operatorToken.kind;\n const negated = op === SyntaxKind.ExclamationEqualsToken || op === SyntaxKind.ExclamationEqualsEqualsToken;\n if (!negated && op !== SyntaxKind.EqualsEqualsToken && op !== SyntaxKind.EqualsEqualsEqualsToken) {\n return undefined;\n }\n const checker = this.getChecker();\n const leftFamily = this.equalityOperandFamily(checker?.getTypeAtLocation(node.left));\n const rightFamily = this.equalityOperandFamily(checker?.getTypeAtLocation(node.right));\n const leftProved = leftFamily !== undefined && (leftFamily !== 'null' || this.isNullishLiteral(node.left));\n const rightProved = rightFamily !== undefined && (rightFamily !== 'null' || this.isNullishLiteral(node.right));\n const equalCall = `${negated ? '!' : ''}java.util.Objects.equals(${leftText}, ${rightText})`;\n // a declared Java String on either side: a String never equals a non-String, and\n // Objects.equals carries the same null answer, so the class-strict compare is the\n // helper's own String branch for every other operand.\n if (leftProved || rightProved || this.javaDeclaredStringType(node.left) || this.javaDeclaredStringType(node.right)) {\n return equalCall;\n }\n // both operands print a Java numeric primitive (literals, `.length`, index/search results, for\n // counters, native arithmetic): neither can be null, so the operator is the helper's value compare\n // on the two boxes (never a boxed Double, whose equals would separate -0.0).\n if (this.javaOperandPrintsPrimitiveNumber(node.left) && this.javaOperandPrintsPrimitiveNumber(node.right)) {\n return `(${leftText} ${negated ? '!=' : '=='} ${rightText})`;\n }\n // java-15: two checker-typed plain numbers whose printed Java values carry the same\n // kind (two primitives returned above); a box compares with\n // Objects.equals, whose class the kind pins to the box the helper would compare.\n const leftKind = this.javaEqualityNumberKind(node.left);\n const rightKind = this.javaEqualityNumberKind(node.right);\n if (leftKind !== undefined && leftKind === rightKind) {\n // a boxed double compares through Double.equals, which separates -0.0 from 0.0\n // where the helper's toDouble compare does not: doubles stay native only as\n // primitives (there the native operator is the same value compare)\n if (leftKind !== 'double') {\n return equalCall;\n }\n }\n // a numeric operand the pass declared Long/Double/Integer/int/long/double: the box\n // is unboxed by the operator (numeric compare, exactly the helper's toLong/toDouble\n // path) and a boxed declaration is null-tested first, which the helper answers false.\n const leftDeclared = this.javaDeclaredNumericFamily(node.left);\n const rightDeclared = this.javaDeclaredNumericFamily(node.right);\n if (leftDeclared !== undefined || rightDeclared !== undefined) {\n const leftOk = leftDeclared !== undefined || this.javaOperandPrintsPrimitiveNumber(node.left);\n const rightOk = rightDeclared !== undefined || this.javaOperandPrintsPrimitiveNumber(node.right);\n if (leftOk && rightOk) {\n const boxes: string[] = [];\n if (leftDeclared !== undefined && JAVA_BOXED_NUMERIC_TYPES.has(leftDeclared)) {\n boxes.push(leftText);\n }\n if (rightDeclared !== undefined && JAVA_BOXED_NUMERIC_TYPES.has(rightDeclared)) {\n boxes.push(rightText);\n }\n const compare = `${leftText} ${negated ? '!=' : '=='} ${rightText}`;\n if (boxes.length === 0) {\n return `(${compare})`;\n }\n // a boxed declaration can hold null, which the helper answers false for; the\n // negated comparison therefore has to accept the null arm instead of testing it\n return negated\n ? `(${boxes.map((box) => `${box} == null`).join(' || ')} || ${compare})`\n : `(${boxes.map((box) => `${box} != null`).join(' && ')} && ${compare})`;\n }\n }\n return undefined;\n }\n\n // true when the printer prints the operand as a Java primitive (a decimal literal, a\n // native .length/.size(), a for counter or a nested native arithmetic node) rather\n // than as the Object-declared box every other local gets\n javaOperandPrintsPrimitiveNumber(node): boolean {\n return this.javaEqualityLiteralKind(node) !== undefined\n || this.javaNativeLengthKind(node) !== undefined\n || this.isJavaPrimitiveCounterReference(node)\n || this.javaNativeArithmeticKind(node) !== undefined\n // `.length` on a receiver whose Java text the printer does not prove is still\n // the int-returning Helpers.getArrayLength; indexOf/search print int helpers\n || this.javaPrimitiveOperandKind(node) !== undefined;\n }\n\n // the numeric family the pass declared for a local (`Long`/`Double`/`Integer` boxed,\n // `int`/`long`/`double` primitive), undefined when nothing was declared or the declared\n // type is not numeric\n javaDeclaredNumericFamily(expression): string | undefined {\n const type = this.javaDeclaredTypeOf(expression)?.trim();\n return type !== undefined && JAVA_DECLARED_NUMERIC_TYPES.has(type) ? type : undefined;\n }\n\n // `x[k] = v` prints the runtime helper by default. Helpers.addElementToObject\n // exists for receivers the printer cannot type (Lists, arbitrary objects via\n // reflection) and for ConcurrentHashMap null-removal, so the native Map.put is\n // printed only when the checker excludes all of those.\n elementWriteTargetsMap(container, base, keys, value): boolean {\n const lastKey = keys[keys.length - 1];\n if (!isStringLiteral(lastKey) && !this.isJavaStringType(this.getChecker().getTypeAtLocation(lastKey))) {\n return false; // Map.put takes the String key; every other key prints as Object\n }\n if (isPropertyAccessExpression(base) && base.expression.kind === SyntaxKind.ThisKeyword) {\n return false; // field maps are ConcurrentHashMaps (a null value must remove, not put) and other threads read them\n }\n if (this.isPlainHashMapReceiver(container, keys)) {\n return true; // a HashMap the code created holds a null value like the helper does\n }\n // any other Map may be a ConcurrentHashMap, which rejects a null value the helper removes\n return this.isDictionaryType(container) && !this.elementWriteValueMayBeNull(value);\n }\n\n // true unless the checker proves the written value is never null/undefined\n elementWriteValueMayBeNull(value): boolean {\n const checker: any = this.checkerOrUndefined();\n if (checker === undefined || value === undefined) {\n return true;\n }\n const type = checker.getTypeAtLocation(value);\n const parts: any[] = (type.flags & TypeFlags.Union) ? (type.getTypes?.() ?? []) : [type];\n const nullable = TypeFlags.Any | TypeFlags.Unknown | JAVA_NULLISH_TYPE_FLAGS | TypeFlags.TypeParameter;\n return parts.length === 0 || parts.some((t) => (t.flags & nullable) !== 0);\n }\n\n // a key proven by the checker to be a string prints as a java String: the read is\n // the same expression, only the key needs the (String) cast the typed put demands\n elementWriteKeyText(key, keyText: string): string {\n return isStringLiteral(key) ? keyText : `(String)${keyText}`;\n }\n\n // Receivers that are a plain java.util.HashMap at runtime, where \".put\" and the helper's map branch\n // are the same write: a local initialized with an object literal or a call whose every return is\n // such a literal (this.account()). Lists, class instances and ConcurrentHashMaps stay helpers.\n isPlainHashMapReceiver(container, keys: any[]): boolean {\n if (keys.length !== 1 || container === undefined || container.kind !== SyntaxKind.Identifier) {\n return false; // only a direct write on the proven local, no read in between\n }\n const checker: any = this.checkerOrUndefined();\n if (checker === undefined) {\n return false;\n }\n const symbol = checker.getSymbolAtLocation(container);\n const declaration: any = symbol?.valueDeclaration?.resolve() ?? symbol?.declarations?.[0]?.resolve();\n if (!declaration || declaration.kind !== SyntaxKind.VariableDeclaration || !declaration.initializer) {\n return false; // parameters and receivers without an initializer stay the helper\n }\n if (!this.javaFreshHashMapValue(container, declaration.initializer)) {\n return false;\n }\n // every later `x = rhs` must hand the local another fresh map too (D2)\n return !this.javaLocalIsReassigned(container, (rhs) => this.javaFreshHashMapValue(container, rhs));\n }\n\n // a value that is a freshly built HashMap/LinkedHashMap on the Java side\n javaFreshHashMapValue(container, value): boolean {\n const initializer = this.unwrapPrintTransparentExpression(value);\n return initializer !== undefined && (isObjectLiteralExpression(initializer)\n || (isCallExpression(initializer) && this.callAlwaysReturnsPlainHashMap(initializer, 0))\n || (this.javaDeclaredMapReceiver(container) && this.javaFreshExtendMap(initializer)));\n }\n\n // a value whose Java print can never be null: non-null literals and fresh containers\n javaPrintsNonNullValue(node): boolean {\n const value = this.unwrapPrintTransparentExpression(node);\n if (value === undefined) {\n return false;\n }\n return isStringLiteralLikeNode(value) || isNumericLiteral(value)\n || value.kind === SyntaxKind.TrueKeyword || value.kind === SyntaxKind.FalseKeyword\n || isObjectLiteralExpression(value) || isArrayLiteralExpression(value)\n || (isPrefixUnaryExpression(value) && value.operator === SyntaxKind.MinusToken && isNumericLiteral(value.operand));\n }\n\n // `this.extend(..)` / `this.deepExtend(..)` from the base tier hand back a fresh LinkedHashMap\n // when the call has two arguments (Generic.Extend copies both) or ends in an object literal\n // (deepExtend's last Map argument replaces any earlier non-Map box with a new map)\n javaFreshExtendMap(initializer): boolean {\n if (initializer === undefined || !isCallExpression(initializer)\n || !isPropertyAccessExpression(initializer.expression)\n || initializer.expression.expression.kind !== SyntaxKind.ThisKeyword) {\n return false;\n }\n const name = initializer.expression.name.text;\n const args = initializer.arguments;\n const last = args.length > 0 ? this.unwrapPrintTransparentExpression(args[args.length - 1]) : undefined;\n const endsInLiteral = last !== undefined && isObjectLiteralExpression(last);\n if (!((name === 'extend' && (args.length === 2 || endsInLiteral)) || (name === 'deepExtend' && endsInLiteral))) {\n return false;\n }\n const checker: any = this.checkerOrUndefined();\n const fileName = checker?.getResolvedSignature(initializer)?.declaration?.resolve()?.getSourceFile?.()?.fileName;\n return typeof fileName === 'string' && JAVA_FRESH_EXTEND_FILE.test(fileName);\n }\n\n // the bottom container of `x[k1][k2].. = v` when x is a declared Map / List and k1 is not a\n // string literal: the guarded native read of the element-read families (the literal key is\n // printed by the caller's own arm)\n javaDeclaredChainContainerRead(left, keyCount: number): string | undefined {\n let inner = left;\n for (let i = 1; i < keyCount; i++) {\n inner = inner.expression;\n }\n if (inner === undefined || !isElementAccessExpression(inner) || isStringLiteralLikeNode(inner.argumentExpression)) {\n return undefined;\n }\n const declared = this.javaDeclaredTypeOf(inner.expression);\n if (declared === undefined) {\n return undefined;\n }\n if (JAVA_DECLARED_MAP_TYPES.test(declared)) {\n return this.javaDeclaredMapElementRead(inner);\n }\n if (JAVA_DECLARED_LIST_TYPES.test(declared) && this.javaPrimitiveCounterIndex(inner.argumentExpression)) {\n return this.javaDeclaredListElementRead(inner, true);\n }\n return undefined;\n }\n\n unwrapPrintTransparentExpression(node): any {\n let current = node;\n while (current && (isParenthesizedExpression(current)\n || isAsExpression(current)\n || isTypeAssertion(current)\n || current.kind === SyntaxKind.NonNullExpression)) {\n current = current.expression;\n }\n return current;\n }\n\n // Every write of the local in its enclosing function must be the element write\n // itself; an assignment could replace the HashMap with a List or a class instance.\n javaLocalIsReassigned(node, admitsWrite?: (rhs) => boolean): boolean {\n let scope: any = node;\n while (scope && !isFunctionLike(scope) && !isSourceFile(scope)) {\n scope = scope.parent;\n }\n if (!scope) {\n return true;\n }\n const symbol = this.getChecker().getSymbolAtLocation(node);\n let reassigned = false;\n const walk = (current) => {\n if (reassigned || current === undefined) {\n return;\n }\n if (current.kind === SyntaxKind.BinaryExpression\n && current.operatorToken.kind === SyntaxKind.EqualsToken\n && current.left.kind === SyntaxKind.Identifier\n && this.getChecker().getSymbolAtLocation(current.left) === symbol) {\n if (admitsWrite === undefined || !admitsWrite(current.right)) {\n reassigned = true;\n return;\n }\n }\n if (current.kind === SyntaxKind.BinaryExpression\n && current.operatorToken.kind >= SyntaxKind.FirstAssignment && current.operatorToken.kind <= SyntaxKind.LastAssignment\n && !isIdentifier(current.left)\n && !isElementAccessExpression(current.left) && !isPropertyAccessExpression(current.left)\n && this.javaPatternBindsSymbol(current.left, symbol)\n && !this.javaDestructuringHandsBackLocal(current, symbol)) {\n reassigned = true; // destructuring assignment `[x, p] = ..`\n return;\n }\n if (current.kind === SyntaxKind.BinaryExpression\n && current.operatorToken.kind !== SyntaxKind.EqualsToken\n && current.operatorToken.kind >= SyntaxKind.FirstAssignment && current.operatorToken.kind <= SyntaxKind.LastAssignment\n && isIdentifier(current.left)\n && this.getChecker().getSymbolAtLocation(current.left) === symbol) {\n reassigned = true; // compound write (`x ??= ..`)\n return;\n }\n if ((isForOfStatement(current) || isForInStatement(current))\n && isIdentifier(current.initializer)\n && this.getChecker().getSymbolAtLocation(current.initializer) === symbol) {\n reassigned = true;\n return;\n }\n current.forEachChild(walk);\n };\n walk(scope);\n return reassigned;\n }\n\n // `[.., x, ..] = this.m(.., x, ..)` where every return of m is an array literal whose\n // element at x's position is the never-reassigned parameter x was passed to: x keeps its object\n javaDestructuringHandsBackLocal(assignment, symbol): boolean {\n const checker: any = this.getChecker();\n const left = assignment.left;\n const call = this.unwrapPrintTransparentExpression(assignment.right);\n if (!isArrayLiteralExpression(left) || call === undefined || !isCallExpression(call)) {\n return false;\n }\n const index = left.elements.findIndex((e) => isIdentifier(e) && checker.getSymbolAtLocation(e) === symbol);\n if (index < 0 || left.elements.some((e, i) => i !== index && this.javaPatternBindsSymbol(e, symbol))) {\n return false;\n }\n const declaration: any = checker.getResolvedSignature(call)?.declaration?.resolve();\n if (!declaration || !isMethodDeclaration(declaration) || !declaration.body) {\n return false;\n }\n const argIndex = call.arguments.findIndex((a) => isIdentifier(a) && checker.getSymbolAtLocation(a) === symbol);\n const parameter = argIndex >= 0 ? declaration.parameters[argIndex] : undefined;\n if (parameter === undefined || !isIdentifier(parameter.name) || parameter.dotDotDotToken) {\n return false;\n }\n const parameterSymbol = checker.getSymbolAtLocation(parameter.name);\n let returns = 0;\n let proven = true;\n const walk = (n) => {\n if (!proven || n === undefined || (n !== declaration.body && isFunctionLike(n))) {\n return;\n }\n if (isReturnStatement(n)) {\n returns++;\n const value = this.unwrapPrintTransparentExpression(n.expression);\n const element = value !== undefined && isArrayLiteralExpression(value) ? value.elements[index] : undefined;\n proven = element !== undefined && isIdentifier(element) && checker.getSymbolAtLocation(element) === parameterSymbol;\n return;\n }\n n.forEachChild(walk);\n };\n walk(declaration.body);\n if (!proven || returns === 0 || this.javaHandBackVisiting.has(declaration)) {\n return false; // a recursive hand-back chain stays unproven\n }\n this.javaHandBackVisiting.add(declaration);\n try {\n return !this.javaLocalIsReassigned(parameter.name);\n } finally {\n this.javaHandBackVisiting.delete(declaration);\n }\n }\n\n javaHandBackVisiting = new Set();\n\n // true when a destructuring target mentions the symbol anywhere\n javaPatternBindsSymbol(pattern, symbol): boolean {\n let found = false;\n const walk = (n) => {\n if (found || n === undefined) {\n return;\n }\n if (isIdentifier(n) && this.getChecker().getSymbolAtLocation(n) === symbol) {\n found = true;\n return;\n }\n n.forEachChild(walk);\n };\n walk(pattern);\n return found;\n }\n\n // A call whose callee body returns object literals only, so the value it hands\n // back is always a freshly built HashMap on the Java side as well.\n callAlwaysReturnsPlainHashMap(node, depth: number): boolean {\n if (depth > 3) {\n return false;\n }\n const checker: any = this.getChecker();\n let callee: any = this.unwrapPrintTransparentExpression(node.expression);\n if (callee !== undefined && isPropertyAccessExpression(callee)) {\n if (callee.expression.kind !== SyntaxKind.ThisKeyword) {\n return false; // this.() only: another receiver's body is not in this class\n }\n callee = callee.name;\n }\n if (callee === undefined || callee.kind !== SyntaxKind.Identifier) {\n return false;\n }\n let symbol: any;\n try {\n symbol = checker.getSymbolAtLocation(callee);\n } catch (e) {\n return false;\n }\n const declaration: any = symbol?.valueDeclaration?.resolve() ?? symbol?.declarations?.[0]?.resolve();\n if (!declaration || (declaration.kind !== SyntaxKind.MethodDeclaration && declaration.kind !== SyntaxKind.FunctionDeclaration)) {\n return false;\n }\n if (!this.returnTypePrintsAsHashMap(declaration)) {\n return false;\n }\n const body = declaration.body;\n if (!body || !isBlock(body)) {\n return false;\n }\n let plain = true;\n let returns = 0;\n const walk = (current) => {\n if (!plain || current === undefined) {\n return;\n }\n if (isFunctionLike(current) && current !== declaration) {\n return; // a nested closure returns into its own call\n }\n if (isReturnStatement(current)) {\n returns += 1;\n const expression = current.expression;\n if (expression === undefined) {\n plain = false;\n return;\n }\n const value = this.unwrapPrintTransparentExpression(expression);\n if (isObjectLiteralExpression(value)) {\n return;\n }\n if (isCallExpression(value) && this.callAlwaysReturnsPlainHashMap(value, depth + 1)) {\n return;\n }\n plain = false;\n return;\n }\n current.forEachChild(walk);\n };\n walk(body);\n return plain && returns > 0;\n }\n\n // the declared return type must not be a class instance (those print as objects)\n // or an array (those print as Lists), so the object-literal returns above are what\n // the caller can rely on\n returnTypePrintsAsHashMap(declaration): boolean {\n try {\n const checker: any = this.getChecker();\n const signature = checker.getSignatureFromDeclaration(declaration);\n const type: any = signature?.getReturnType();\n if (!type || (type.flags & TypeFlags.Object) === 0) {\n return false;\n }\n if (checker.isArrayType(type) || checker.isTupleType(type)) {\n return false;\n }\n const declarations = (type.getSymbol()?.declarations ?? []).map((d) => d.resolve());\n if (declarations.some((d) => d.kind === SyntaxKind.ClassDeclaration)) {\n return false;\n }\n return type.getCallSignatures().length === 0;\n } catch (e) {\n return false;\n }\n }\n\n isDictionaryType(node): boolean {\n try {\n const checker: any = this.getChecker();\n const type = checker.getTypeAtLocation(node);\n return this.isDictionaryTsType(type, checker, 0);\n } catch (e) {\n return false;\n }\n }\n\n // A TS dictionary (`{ [key: string]: any }`, i.e. ccxt's Dict) is a Map on every\n // print and run path. Arrays, class instances and unknown types are not, so they\n // keep the helper.\n isDictionaryTsType(type: any, checker: any, depth: number): boolean {\n if (!type || depth > 3) {\n return false;\n }\n const flags: any = type.flags;\n if (flags & TypeFlags.Union) {\n const parts: any[] = type.getTypes?.() ?? [];\n return parts.length > 0 && parts.every((t) => this.isDictionaryTsType(t, checker, depth + 1));\n }\n if (!(flags & TypeFlags.Object)) {\n return false;\n }\n try {\n if (checker.isArrayType(type) || checker.isTupleType(type)) {\n return false;\n }\n return checker.getIndexTypeOfType(type, IndexKind.String) !== undefined;\n } catch (e) {\n return false;\n }\n }\n\n // -------------------------------------------------------------------\n // helper removal: native emission when the checker proves the printed\n // operand is a Java numeric primitive / List / Map\n // -------------------------------------------------------------------\n\n // int/long kind of a literal as printNumericLiteral emits it. Fraction and\n // exponent forms are Java doubles and a double can hold NaN, which the\n // comparison helpers order differently (`NaN < x` is true there), so those\n // never become a native comparison.\n javaIntegerLiteralKind(node) {\n if (!node || !isNumericLiteral(node)) {\n return undefined;\n }\n if (/[.eE]/.test(node.text)) {\n return undefined;\n }\n return Number(node.text) > 2147483647 ? 'long' : 'int';\n }\n\n // A rest parameter is a Java varargs array, not a List, so a List cast on it\n // would throw ClassCastException; simple identifier aliases are followed too.\n isVarargsArrayReference(node, depth = 0) {\n if (!node || depth > 4 || node.kind !== SyntaxKind.Identifier) {\n return false;\n }\n const symbol = this.getChecker().getSymbolAtLocation(node);\n const declaration: any = symbol?.valueDeclaration?.resolve() ?? symbol?.declarations?.[0]?.resolve();\n if (!declaration) {\n return false;\n }\n if (declaration.dotDotDotToken !== undefined) {\n return true;\n }\n const initializer = declaration.initializer;\n if (initializer && isIdentifier(initializer)) {\n return this.isVarargsArrayReference(initializer, depth + 1);\n }\n return false;\n }\n\n // checker proof that the value is printed as a java.util.List: TS arrays and\n // tuples become ArrayList, ReadonlyArray only adds a readonly modifier\n isJavaListType(type) {\n if (!type) {\n return false;\n }\n const checker = this.getChecker();\n if (checker.isArrayType(type) || checker.isTupleType(type)) {\n return true;\n }\n return (type as any).isTypeReference?.() === true && (type as any).getTarget().getSymbol()?.escapedName === 'ReadonlyArray';\n }\n\n // `.length` is a Java int for exactly these receivers; every other receiver keeps\n // Helpers.getArrayLength, whose result type is not proven\n javaLengthKind(expression) {\n const type = this.getChecker().getTypeAtLocation(expression);\n if (this.isJavaStringType(type)) {\n return 'String';\n }\n if (this.isJavaListValueType(type) && !this.isVarargsArrayReference(expression)) {\n return 'List';\n }\n // a nullish union member cannot take a bare `.size()`/`.length()`, but the\n // guard below answers 0 for null exactly like the helper, and only a bare\n // identifier keeps the receiver evaluate-once\n if (isIdentifier(expression)) {\n if (this.isJavaNullishUnion(type, (member) => this.isStringType(member.flags))) {\n return 'StringOrNull';\n }\n if (this.isJavaNullishUnion(type, (member) => this.isJavaListValueType(member))\n && !this.isVarargsArrayReference(expression)) {\n return 'ListOrNull';\n }\n }\n return undefined;\n }\n\n // every union member is a List-printing type (TS array/tuple/ReadonlyArray, or an\n // Array-derived class whose hand-written java counterpart is an ArrayList)\n isJavaListValueType(type) {\n if (!type) {\n return false;\n }\n if ((type.flags & TypeFlags.Union) !== 0) {\n return type.getTypes().length > 0 && type.getTypes().every((member) => this.isJavaListValueType(member));\n }\n return this.isJavaListType(type) || this.isJavaListBackedClassType(type);\n }\n\n // TS class/interface whose java counterpart extends java.util.ArrayList:\n // the ws caches (ws/ArrayCache.java) and the order-book sides (ws/OrderBookSide.java)\n isJavaListBackedClassType(type) {\n if (!type || (type.flags & TypeFlags.Object) === 0) {\n return false;\n }\n let current: any = (type as any).isTypeReference?.() ? (type as any).getTarget() : type;\n for (let depth = 0; current && depth < 8; depth++) {\n const name = current.getSymbol?.()?.escapedName;\n if (name !== undefined && JAVA_LIST_BACKED_TS_CLASSES.has(name)) {\n return true;\n }\n const bases: any[] = current.getBaseTypes?.() ?? [];\n current = bases.length > 0 ? ((bases[0] as any).isTypeReference?.() ? (bases[0] as any).getTarget() : bases[0]) : undefined;\n }\n return false;\n }\n\n // union of one accepted member family plus null/undefined: the emitted guard is the\n // helper's answer for the nullish case and the native read otherwise\n isJavaNullishUnion(type, isMember) {\n if (!type || (type.flags & TypeFlags.Union) === 0 || type.getTypes().length === 0) {\n return false;\n }\n return type.getTypes().every((member) => isMember(member)\n || (member.flags & (TypeFlags.Undefined | TypeFlags.Null)) !== 0);\n }\n\n // shared by printLengthProperty and transformPropertyAcessExpressionIfNeeded\n printJavaLength(expression, leftSide) {\n const kind = this.javaLengthKind(expression);\n if (kind !== undefined) {\n const read = kind.startsWith('String') ? `((String)${leftSide}).length()` : `((java.util.List)${leftSide}).size()`;\n return kind.endsWith('OrNull') ? `(${leftSide} == null ? 0 : ${read})` : read;\n }\n // a receiver the embedding pass declared a java.util.List (`List response =\n // (this.someRequest(..)).join()` — a typed list return bound to a local, or a list\n // parameter the pass retyped): the declaration carries the type, so `x.size()` needs\n const declared = this.javaDeclaredTypeOf(expression);\n if (declared !== undefined && JAVA_DECLARED_LIST_TYPES.test(declared)) {\n return `(${leftSide} == null ? 0 : ${leftSide}.size())`;\n }\n return `${this.ARRAY_LENGTH_WRAPPER_OPEN}${leftSide}${this.ARRAY_LENGTH_WRAPPER_CLOSE}`;\n }\n\n // `for (var i = ; ...; i++)`: printForStatement rewrites the\n // Object initializer into `var`, so javac infers a primitive counter there,\n // and only ++/-- writes keep it primitive\n isJavaPrimitiveForCounter(node) {\n if (node.kind !== SyntaxKind.Identifier) {\n return false;\n }\n const comparison = node.parent;\n if (!comparison || comparison.kind !== SyntaxKind.BinaryExpression) {\n return false;\n }\n const forStatement = comparison.parent;\n if (!forStatement || forStatement.kind !== SyntaxKind.ForStatement || forStatement.condition !== comparison) {\n return false;\n }\n const initializer = forStatement.initializer;\n if (!initializer || initializer.kind !== SyntaxKind.VariableDeclarationList) {\n return false;\n }\n const declarations = initializer.declarations ?? [];\n if (declarations.length !== 1) {\n return false;\n }\n const declaration = declarations[0];\n if (!isIdentifier(declaration.name) || declaration.name.text !== node.text) {\n return false;\n }\n if (this.javaIntegerLiteralKind(declaration.initializer) === undefined) {\n return false;\n }\n const counterSymbol = this.getChecker().getSymbolAtLocation(node);\n const declarationSymbol = this.getChecker().getSymbolAtLocation(declaration.name);\n if (counterSymbol !== undefined && declarationSymbol !== undefined && counterSymbol !== declarationSymbol) {\n return false;\n }\n const incrementor = forStatement.incrementor;\n if (!incrementor || incrementor.operand?.kind !== SyntaxKind.Identifier || incrementor.operand.text !== node.text) {\n return false;\n }\n return incrementor.kind === SyntaxKind.PostfixUnaryExpression || incrementor.kind === SyntaxKind.PrefixUnaryExpression;\n }\n\n // Java primitive kind of a comparison operand; undefined keeps the helper. Proof sources: literals\n // (int/long/double) and expressions the printer's own emitter pins: `var` for-counter, `.length`,\n // `x.indexOf(arg)`/`x.search(arg)` (int), Math.round (long), Math.floor/ceil/pow (double).\n javaPrimitiveOperandKind(node) {\n if (node === undefined || node === null) {\n return undefined;\n }\n if (node.kind === SyntaxKind.ParenthesizedExpression) {\n return this.javaPrimitiveOperandKind(node.expression);\n }\n const literalKind = this.javaIntegerLiteralKind(node);\n if (literalKind !== undefined) {\n return literalKind;\n }\n if (this.isJavaFloatLiteral(node)) {\n return 'double';\n }\n if (this.isJavaPrimitiveForCounter(node) || this.javaPrintedIntCounter(node)) {\n return 'int';\n }\n // `-1`: the sign prints in front of an int literal, still a Java int\n if (node.kind === SyntaxKind.PrefixUnaryExpression && node.operator === SyntaxKind.MinusToken\n && this.javaIntegerLiteralKind(node.operand) === 'int') {\n return 'int';\n }\n if (node.kind === SyntaxKind.PropertyAccessExpression && node.name.text === 'length') {\n return 'int';\n }\n if (node.kind === SyntaxKind.CallExpression) {\n return this.javaPrintedCallKind(node);\n }\n // a nested `+ - * /` this printer emits natively is a Java primitive of its kind\n if (node.kind === SyntaxKind.BinaryExpression) {\n return this.javaNativeArithmeticKind(node);\n }\n return undefined;\n }\n\n // a read of a `for (var i = ; ..; i++)` counter anywhere in the loop: javac types it\n // int and no box write reaches it; a capture rename (`finalI`) prints an Object copy instead\n javaPrintedIntCounter(node): boolean {\n return node?.kind === SyntaxKind.Identifier && this.javaIntForCounter(node)\n && this.javaIdentifierPrintsDeclaredName(node);\n }\n\n // fractional / exponent literals print as Java double literals (printNumericLiteral)\n isJavaFloatLiteral(node) {\n if (!node || !isNumericLiteral(node)) {\n return false;\n }\n return !/^0[xXbBoO]/.test(node.text) && /[.eE]/.test(node.text);\n }\n\n // Java kind of a call the printer emits itself, undefined otherwise. Mirrors printIndexOfCall /\n // printSearchCall / printMathRoundCall / printMathFloorCall / printMathCeilCall and Math.pow:\n // x.indexOf(a) / x.search(a) -> int; Math.round(x) -> long; Math.floor/ceil/pow -> double.\n javaPrintedCallKind(node) {\n const callee = node.expression;\n if (callee?.kind !== SyntaxKind.PropertyAccessExpression) {\n return undefined;\n }\n const name = callee.name?.text;\n const argCount = node.arguments?.length ?? 0;\n const onMath = callee.expression?.kind === SyntaxKind.Identifier\n && callee.expression.text === 'Math';\n switch (name) {\n case 'indexOf':\n case 'search':\n // the dispatch routes a 1-argument indexOf/search through the int-returning\n // helpers; a receiver that prints String keeps String.indexOf (int as well)\n return argCount >= 1 ? 'int' : undefined;\n case 'round':\n return onMath && argCount === 1 ? 'long' : undefined;\n case 'floor':\n case 'ceil':\n return onMath && argCount === 1 ? 'double' : undefined;\n case 'pow':\n return onMath && argCount === 2 ? 'double' : undefined;\n }\n return undefined;\n }\n\n // operand usability for `>=` / `<` / `<=`, which route through the helper's isEqual. Two integral\n // operands are always exact; once a double is involved, toLong saturates and BigDecimal throws on\n // ±Infinity, so a double or long is accepted only as a finite literal within ±2^53.\n javaComparisonOperandsAreExact(left, leftKind, right, rightKind) {\n if (leftKind !== 'double' && rightKind !== 'double') {\n return true;\n }\n return this.javaComparisonOperandIsExactAgainstDouble(left, leftKind)\n && this.javaComparisonOperandIsExactAgainstDouble(right, rightKind);\n }\n\n javaComparisonOperandIsExactAgainstDouble(node, kind) {\n if (kind === 'int') {\n return true;\n }\n if ((kind !== 'long' && kind !== 'double') || !isNumericLiteral(node)) {\n return false;\n }\n const text = node.text;\n if (/^[0-9]+$/.test(text)) {\n // the text is what the printer emits, and JS Number() rounds above 2^53 —\n // compare the literal's exact value instead\n return BigInt(text) <= 9007199254740992n;\n }\n const value = Number(text);\n return Number.isFinite(value) && Math.abs(value) <= 9007199254740992;\n }\n\n // checker proof that the value is printed as a java.util.HashMap: TS object\n // shapes (interfaces, object literals, aliases) become HashMaps, while class\n // instances are real Java objects and arrays/unions are not proven here\n isJavaMapType(type) {\n if (!type || (type.flags & TypeFlags.Object) === 0) {\n return false;\n }\n const checker = this.getChecker();\n if (checker.isArrayType(type) || checker.isTupleType(type)) {\n return false;\n }\n if (type.getCallSignatures().length > 0) {\n return false;\n }\n const declarations = (type.getSymbol()?.declarations ?? []).map((d) => d.resolve());\n return !declarations.some((declaration) => declaration.kind === SyntaxKind.ClassDeclaration\n || declaration.getSourceFile().fileName.indexOf('typescript') > -1);\n }\n\n // string keys (plain, literal or a union of literals) print as Java Strings\n isJavaStringType(type) {\n if (!type) {\n return false;\n }\n if (this.isStringType(type.flags)) {\n return true;\n }\n if ((type.flags & TypeFlags.Union) === 0) {\n return false;\n }\n return type.getTypes().every((member) => this.isStringType(member.flags));\n }\n\n // `Dictionary | undefined` (what a no-overload safe* signature widens to): the helper\n // answers false for the nullish arm and the guarded emission keeps exactly that; every\n // non-map member (arrays, classes, scalars) keeps the helper\n isJavaNullableMapType(type) {\n return this.isJavaNullishUnion(type, (member) => this.isJavaMapType(member))\n && ((type as any).getTypes?.() ?? []).some((member) => (member.flags & (TypeFlags.Undefined | TypeFlags.Null)) === 0);\n }\n\n // the guarded emission reads the receiver twice, so it is only printed for an operand\n // that cannot run anything twice: a name or a `this.` field. Everything else (calls,\n // element reads) keeps the helper so the operand is still evaluated once.\n javaRepeatableOperand(node) {\n if (node === undefined) {\n return false;\n }\n if (isIdentifier(node)) {\n return true;\n }\n if (isParenthesizedExpression(node)) {\n return this.javaRepeatableOperand(node.expression);\n }\n return isPropertyAccessExpression(node) && node.expression?.kind === SyntaxKind.ThisKeyword;\n }\n\n // The declared Java type of a local/parameter is known to the pass that rewrites the declaration\n // text (build/java-local-types.js), which records every name it typed here. With no consumer\n // installed the table is empty and every read keeps the helper.\n javaDeclaredTypeOf(expression): string | undefined {\n if (expression === undefined || !isIdentifier(expression)) {\n return undefined;\n }\n const declaration = this.javaDeclarationOfIdentifier(expression);\n if (declaration === undefined || expression.text !== declaration.name?.text) {\n return undefined;\n }\n return this.javaDeclaredTypeOfDeclaration(declaration);\n }\n\n // the declared Java type of a declaration: the embedding build layer names the\n // declarations it retypes itself, and a parameter the printer retypes\n // (javaNativeParameterType) answers for itself, so its element reads go native too\n javaDeclaredTypeOfDeclaration(declaration): string | undefined {\n const resolver = this.javaDeclaredLocalTypeResolver;\n if (resolver !== undefined) {\n let type;\n try {\n type = resolver(declaration);\n } catch (e) {\n type = undefined;\n }\n if (typeof type === 'string' && type.trim().length > 0) {\n return type.trim();\n }\n }\n if (isParameterDeclaration(declaration)) {\n return this.javaNativeParameterType(declaration);\n }\n return undefined;\n }\n\n // The native Java type a parameter prints with when its TS annotation is a base/types.ts alias in\n // JAVA_NATIVE_PARAMETER_TYPES. Fixed parameters of generated-tier methods only, and every\n // declaration up the heritage chain must print the same type: Java overrides are invariant.\n javaNativeParameterType(node): string | undefined {\n if (node === undefined || !isParameterDeclaration(node)\n || node.initializer !== undefined || node.dotDotDotToken !== undefined) {\n return undefined;\n }\n const own = this.javaNativeParameterTypeOf(node);\n const type = own !== undefined ? own : this.javaInheritedParameterType(node);\n if (type === undefined) {\n return undefined;\n }\n // D2: a parameter the enclosing body assigns with a compound operator keeps the box — `url += '/x'`\n // prints `url = Helpers.add(url, ..)`, whose result is an Object. A plain `x = ..` or a\n // destructuring target is cast at the write site instead (javaParameterAssignmentCast).\n if (this.javaParameterIsCompoundAssigned(node)) {\n return undefined;\n }\n try {\n const method: any = node.parent;\n const index = method.parameters.indexOf(node);\n let override = this.getMethodOverride(method);\n if (override === undefined\n && JAVA_NATIVE_PARAMETER_PREDICTION_FILES.test(node.getSourceFile().fileName)\n && method.name !== undefined) {\n // a venue method overriding the Exchange-tier body PredictionExchange.java carries\n // must print that tier parameter's type (D8: Java overrides are invariant)\n const tier = this.exchangeTierMethods().get(method.name.getText().trim());\n if (tier !== undefined && !this.javaParameterPrintsType(tier.parameters?.[index], type)) {\n return undefined;\n }\n }\n while (override !== undefined) {\n const baseParam = (override as any).parameters?.[index];\n if (!this.javaParameterPrintsType(baseParam, type)) {\n return undefined;\n }\n override = this.getMethodOverride(override);\n }\n } catch (e) {\n return undefined; // an unresolvable heritage keeps the box\n }\n return type;\n }\n\n // method declarations (first per name) of the `Exchange` class of ts/src/base/Exchange.ts, read off the\n // program the warp ran on. A prediction venue's method with one of these names overrides\n // the tier body javaTranspiler.ts injects into PredictionExchange.java.\n private _exchangeTierMethods: Map | undefined = undefined;\n exchangeTierMethods(): Map {\n if (this._exchangeTierMethods !== undefined) {\n return this._exchangeTierMethods;\n }\n const names = new Map();\n try {\n const program = this.getProgram();\n const fileName = program.getSourceFileNames().find((f) => JAVA_NATIVE_PARAMETER_BASE_FILES.test(f));\n const file = fileName !== undefined ? program.getSourceFile(fileName) : undefined;\n const collect = (node: Node) => {\n if (isClassDeclaration(node) && node.name?.text === 'Exchange') {\n for (const member of node.members) {\n const key = (member as any).name?.getText().trim();\n if (isMethodDeclaration(member) && key !== undefined && !names.has(key)) {\n names.set(key, member);\n }\n }\n }\n node.forEachChild(collect);\n };\n if (file !== undefined) {\n collect(file);\n }\n } catch (e) {\n // no program yet: the heritage walk above already answered\n }\n this._exchangeTierMethods = names;\n return names;\n }\n\n // the same parameter position of an ancestor declaration prints this native type: its\n // own annotation names it, or - with no annotation of its own - it inherits the same\n // type from a declaration above it, exactly like this one does\n javaParameterPrintsType(baseParam, type: string): boolean {\n if (baseParam === undefined || !isParameterDeclaration(baseParam)\n || baseParam.initializer !== undefined || baseParam.dotDotDotToken !== undefined) {\n return false;\n }\n const own = this.javaNativeParameterTypeOf(baseParam);\n const printed = own !== undefined ? own : this.javaInheritedParameterType(baseParam);\n return printed === type;\n }\n\n // the type a fixed parameter with no annotation of its own inherits: the nearest\n // declaration of the method up the heritage chain that prints a native type. An\n // unannotated root declaration prints `Object`, so nothing is inherited and the whole\n javaInheritedParameterType(node): string | undefined {\n const method = node.parent;\n const index = method?.parameters?.indexOf(node);\n if (method === undefined || index === undefined || index < 0) {\n return undefined;\n }\n let override = this.getMethodOverride(method);\n while (override !== undefined) {\n const baseParam = (override as any).parameters?.[index];\n const type = baseParam === undefined ? undefined : this.javaNativeParameterTypeOf(baseParam);\n if (type !== undefined) {\n return type;\n }\n override = this.getMethodOverride(override);\n }\n return undefined;\n }\n\n // Default-valued parameters are real parameters of the typed core that carries the body;\n // the untyped `Object... optionalArgs` front delegates to it.\n javaOptionalParameterJavaType(node): string {\n return this.javaOptionalParameterType(node) ?? 'Object';\n }\n\n javaOptionalParameterType(node): string | undefined {\n if (node === undefined || !isParameterDeclaration(node)) {\n return undefined;\n }\n if (node.initializer === undefined || node.dotDotDotToken !== undefined) {\n return undefined; // `?` parameters keep today's shape (they print in the fixed prefix)\n }\n const own = this.javaOptionalParameterTypeOf(node);\n if (own === undefined) {\n return undefined;\n }\n // a parameter the body assigns with a compound operator keeps the box (`x += ..` prints\n // Helpers.add(x, ..), an Object result) - the same rule as the fixed-parameter path\n if (this.javaParameterIsCompoundAssigned(node)) {\n return undefined;\n }\n // a list parameter the body `typeof`-probes also accepts other boxes at runtime\n if (own === JAVA_STRING_LIST_TYPE && this.javaParameterIsTypeofTested(node)) {\n return undefined;\n }\n const method: any = node.parent;\n try {\n const index = method.parameters.indexOf(node);\n let override = this.getMethodOverride(method);\n while (override !== undefined) {\n if (!this.javaOptionalParameterFamilyAgrees(method, override, index, own)) {\n return undefined;\n }\n override = this.getMethodOverride(override);\n }\n } catch (e) {\n return undefined; // an unresolvable heritage keeps the box\n }\n return own;\n }\n\n // the annotation proof for an optional parameter (no initializer bail)\n javaOptionalParameterTypeOf(node): string | undefined {\n if (node === undefined || !isParameterDeclaration(node) || node.dotDotDotToken !== undefined) {\n return undefined;\n }\n const method = node.parent;\n if (method === undefined || !isMethodDeclaration(method) || !isClassDeclaration(method.parent)) {\n return undefined;\n }\n if (!JAVA_NATIVE_PARAMETER_BASE_FILES.test(node.getSourceFile().fileName)\n && !JAVA_NATIVE_PARAMETER_GENERATED_FILES.test(node.getSourceFile().fileName)) {\n return undefined; // a hand-written java class declares this method, not the printer\n }\n const checker: any = this.checkerOrUndefined();\n if (checker === undefined) {\n return undefined;\n }\n const type = checker.getTypeAtLocation(node);\n if (type === undefined) {\n return undefined;\n }\n const symbol = this.javaParameterAliasSymbol(node, type, checker);\n const name = symbol?.name;\n const excluded = JAVA_NATIVE_PARAMETER_EXCLUDED_POSITIONS[(method.name as any)?.text];\n if (excluded !== undefined && excluded.includes(method.parameters.indexOf(node))) {\n return undefined;\n }\n if (name === 'Strings' || this.javaIsStringArrayType(checker, type)) {\n const listName = JAVA_STRINGS_OPTIONAL_PARAMETER_NAMES.has((node.name as any)?.text)\n && !JAVA_STRINGS_EXCLUDED_METHODS.has((method.name as any)?.text);\n return listName ? JAVA_STRING_LIST_TYPE : undefined;\n }\n if (name === undefined || JAVA_NATIVE_PARAMETER_TYPES_OPTIONAL[name] === undefined) {\n return undefined;\n }\n const declaration = symbol?.declarations?.[0]?.resolve();\n const fileName = declaration?.getSourceFile?.()?.fileName;\n return JAVA_NATIVE_PARAMETER_SOURCE_FILES.test(fileName ?? '')\n ? JAVA_NATIVE_PARAMETER_TYPES_OPTIONAL[name] : undefined;\n }\n\n // a `string[]` annotation (optionally `| undefined`), the unaliased spelling of `Strings`\n javaIsStringArrayType(checker, type): boolean {\n const members = type.isUnionType?.() ? type.getTypes() : [type];\n let arrays = 0;\n for (const member of members) {\n if (member.flags & (TypeFlags.Undefined | TypeFlags.Null)) {\n continue;\n }\n if (!checker.isArrayType(member)) {\n return false;\n }\n const element = checker.getTypeArguments(member)?.[0];\n if (element === undefined || !(element.flags & TypeFlags.String)) {\n return false;\n }\n arrays++;\n }\n return arrays === 1;\n }\n\n // Java overrides are invariant: every ancestor declaration must match the parameter count,\n // the first default-valued index and this position's type, otherwise the position stays Object.\n javaOptionalParameterFamilyAgrees(method, override, index, type: string): boolean {\n const baseParams = override?.parameters;\n if (baseParams === undefined || baseParams.length !== method.parameters.length) {\n return false;\n }\n if (this.firstDefaultParameterIndex(baseParams) !== this.firstDefaultParameterIndex(method.parameters)) {\n return false;\n }\n const baseParam = baseParams[index];\n if (baseParam === undefined || !isParameterDeclaration(baseParam) || baseParam.dotDotDotToken !== undefined) {\n return false;\n }\n const baseIsOptional = baseParam.initializer !== undefined || baseParam.questionToken !== undefined;\n const ownIsOptional = method.parameters[index].initializer !== undefined\n || method.parameters[index].questionToken !== undefined;\n if (baseIsOptional !== ownIsOptional) {\n return false;\n }\n const baseType = baseIsOptional\n ? this.javaOptionalParameterTypeOf(baseParam)\n : this.javaNativeParameterTypeOf(baseParam);\n return baseType === type;\n }\n\n firstDefaultParameterIndex(params): number {\n for (let i = 0; i < params.length; i++) {\n if (params[i].initializer !== undefined || params[i].questionToken !== undefined) {\n return i;\n }\n }\n return -1;\n }\n\n // a method with >=1 optional parameter prints one typed full signature (callers pass every slot).\n hasDefaultedTail(node): boolean {\n if (node === undefined || !isMethodDeclaration(node)) {\n return false; // constructors and functions keep the optionalArgs unpack\n }\n return this.javaHasOptionalParameter(node);\n }\n\n // a typed default-valued method parameter is written in place, so its writes convert to the declared type\n javaSplitParameterWriteType(node): string | undefined {\n if (node?.initializer === undefined || !this.hasDefaultedTail(node.parent)) {\n return undefined;\n }\n return this.javaOptionalParameterType(node);\n }\n\n // the async body copy of a reassigned default-valued parameter keeps a `List` type;\n // its writes convert like the sync in-place ones (other types keep the `Object` copy)\n javaAsyncParameterLocalType(node): string | undefined {\n if (node?.initializer === undefined || !this.hasDefaultedTail(node.parent) || !this.isAsyncFunction(node.parent)) {\n return undefined;\n }\n const type = this.javaOptionalParameterType(node);\n if (type === 'Long' && !this.javaParameterIsWritten(node)) {\n return type; // a read-only copy of the Long core parameter\n }\n return type === JAVA_STRING_LIST_TYPE ? type : undefined;\n }\n\n // any write to the parameter in its method: assignment (plain or compound), a destructuring\n // target, `++`/`--`, a for-of/in binding\n javaParameterIsWritten(node): boolean {\n const method = node?.parent;\n const checker: any = this.checkerOrUndefined();\n if (method?.body === undefined || checker === undefined) {\n return true;\n }\n const symbol = checker.getSymbolAtLocation(node.name);\n if (symbol === undefined) {\n return true;\n }\n const same = (n) => n !== undefined && isIdentifier(n) && checker.getSymbolAtLocation(n) === symbol;\n let written = false;\n const visit = (n) => {\n if (written) {\n return;\n }\n if (isBinaryExpression(n) && JAVA_ASSIGNMENT_OPERATOR_KINDS.has(n.operatorToken.kind)) {\n const left = n.left;\n if (same(left) || (isArrayLiteralExpression(left) && left.elements.some(same))) {\n written = true;\n return;\n }\n }\n if ((isPrefixUnaryExpression(n) || isPostfixUnaryExpression(n)) && same(n.operand)\n && (n.operator === SyntaxKind.PlusPlusToken || n.operator === SyntaxKind.MinusMinusToken)) {\n written = true;\n return;\n }\n if ((isForOfStatement(n) || isForInStatement(n)) && same(n.initializer)) {\n written = true;\n return;\n }\n n.forEachChild(visit);\n };\n visit(method.body);\n return written;\n }\n\n // a read the enclosing code only reaches with the binding non-null: the right operand of\n // `x !== undefined && ..`, the matching arm of an `if`/`?:` on that test, or any statement\n // after `if (x === undefined) { return/throw/.. }`. Callers require an unwritten binding.\n javaNullGuardAdmitsRead(node): boolean {\n const checker: any = this.checkerOrUndefined();\n const symbol = checker?.getSymbolAtLocation(node);\n if (symbol === undefined) {\n return false;\n }\n let current: any = node;\n while (current.parent !== undefined) {\n const parent: any = current.parent;\n if (isBinaryExpression(parent) && parent.operatorToken.kind === SyntaxKind.AmpersandAmpersandToken\n && parent.right === current && this.javaTestProvesNonNull(parent.left, symbol, true)) {\n return true;\n }\n if (isBinaryExpression(parent) && parent.operatorToken.kind === SyntaxKind.BarBarToken\n && parent.right === current && this.javaTestProvesNonNull(parent.left, symbol, false)) {\n return true;\n }\n if ((isIfStatement(parent) || isConditionalExpression(parent))) {\n const test = isIfStatement(parent) ? parent.expression : parent.condition;\n const whenTrue = isIfStatement(parent) ? parent.thenStatement : parent.whenTrue;\n const whenFalse = isIfStatement(parent) ? parent.elseStatement : parent.whenFalse;\n if ((whenTrue === current && this.javaTestProvesNonNull(test, symbol, true))\n || (whenFalse === current && this.javaTestProvesNonNull(test, symbol, false))) {\n return true;\n }\n }\n if (isBlock(parent)) {\n for (const sibling of parent.statements) {\n if (sibling === current) {\n break;\n }\n if (isIfStatement(sibling)\n && ((this.javaTestProvesNonNull(sibling.expression, symbol, false) && this.javaStatementAlwaysExits(sibling.thenStatement))\n || (this.javaTestProvesNonNull(sibling.expression, symbol, true) && this.javaStatementAlwaysExits(sibling.elseStatement)))) {\n return true;\n }\n }\n }\n current = parent;\n }\n return false;\n }\n\n // `x !== undefined` / `x != null` (either order) proves x non-null when the test is true;\n // `x === undefined` when false; `&&` (true) / `||` (false) prove through either side, `!` flips\n javaTestProvesNonNull(test, symbol, truthy): boolean {\n if (test === undefined) {\n return false;\n }\n if (isParenthesizedExpression(test)) {\n return this.javaTestProvesNonNull(test.expression, symbol, truthy);\n }\n if (isPrefixUnaryExpression(test) && test.operator === SyntaxKind.ExclamationToken) {\n return this.javaTestProvesNonNull(test.operand, symbol, !truthy);\n }\n if (!isBinaryExpression(test)) {\n return false;\n }\n const op = test.operatorToken.kind;\n if (op === SyntaxKind.AmpersandAmpersandToken) {\n return truthy && (this.javaTestProvesNonNull(test.left, symbol, true) || this.javaTestProvesNonNull(test.right, symbol, true));\n }\n if (op === SyntaxKind.BarBarToken) {\n return !truthy && (this.javaTestProvesNonNull(test.left, symbol, false) || this.javaTestProvesNonNull(test.right, symbol, false));\n }\n const inequality = op === SyntaxKind.ExclamationEqualsToken || op === SyntaxKind.ExclamationEqualsEqualsToken;\n const equality = op === SyntaxKind.EqualsEqualsToken || op === SyntaxKind.EqualsEqualsEqualsToken;\n if ((!inequality && !equality) || truthy !== inequality) {\n return false;\n }\n const nullish = (n) => n.kind === SyntaxKind.NullKeyword || (isIdentifier(n) && n.text === 'undefined');\n const tested = nullish(test.right) ? test.left : (nullish(test.left) ? test.right : undefined);\n const checker: any = this.checkerOrUndefined();\n return tested !== undefined && isIdentifier(tested) && checker?.getSymbolAtLocation(tested) === symbol;\n }\n\n javaStatementAlwaysExits(statement): boolean {\n if (statement === undefined) {\n return false;\n }\n const exits = (n) => isReturnStatement(n) || isThrowStatement(n) || isContinueStatement(n) || isBreakStatement(n);\n if (exits(statement)) {\n return true;\n }\n return isBlock(statement) && statement.statements.length > 0 && exits(statement.statements[statement.statements.length - 1]);\n }\n\n // `Long` when the body reads this default-valued `Int` parameter as the core's own Long (the\n // parameter itself or its read-only async copy); undefined otherwise\n javaLongParameterRead(node): boolean {\n if (node === undefined || !isIdentifier(node) || !this.javaIdentifierPrintsDeclaredName(node)\n || !this.javaIdentifierKeepsDeclaredName(node)) {\n return false;\n }\n const declaration = this.javaDeclarationOfIdentifier(node);\n if (declaration === undefined || !isParameterDeclaration(declaration) || declaration.initializer === undefined\n || !this.hasDefaultedTail(declaration.parent)) {\n return false;\n }\n return this.javaOptionalParameterType(declaration) === 'Long' && !this.javaParameterIsWritten(declaration);\n }\n\n // the names the enclosing method body assigns with a compound operator (`x += ..`),\n // by method node; a plain assignment is handled by javaParameterAssignmentCast\n javaMethodAssignedNames: WeakMap> = new WeakMap();\n\n // D-09 memo/cycle guard for javaNativeReturnType (mutually recursive return chains)\n javaReturnTypeCache: WeakMap = new WeakMap();\n javaReturnTypeInProgress: Set = new Set();\n\n javaParameterIsTypeofTested(node): boolean {\n const method = node.parent;\n const name = (node.name as any)?.text;\n // forEachChild stops at the first truthy visit, i.e. the first matching typeof\n const visit = (n: Node): boolean => (isTypeOfExpression(n) && isIdentifier(n.expression) && n.expression.text === name)\n || n.forEachChild(visit) === true;\n return method?.body !== undefined && name !== undefined && method.body.forEachChild(visit) === true;\n }\n\n javaParameterIsCompoundAssigned(node): boolean {\n const method = node.parent;\n const name = (node.name as any)?.text;\n if (method?.body === undefined || name === undefined) {\n return false;\n }\n let assigned = this.javaMethodAssignedNames.get(method);\n if (assigned === undefined) {\n assigned = new Set();\n const collect = (n: Node) => {\n if (isBinaryExpression(n) && n.operatorToken.kind !== SyntaxKind.EqualsToken\n && JAVA_ASSIGNMENT_OPERATOR_KINDS.has(n.operatorToken.kind)) {\n const left = n.left;\n if (isIdentifier(left) && left.text !== undefined) {\n assigned.add(left.text as string);\n }\n }\n n.forEachChild(collect);\n };\n method.body.forEachChild(collect);\n this.javaMethodAssignedNames.set(method, assigned);\n }\n return assigned.has(name as string);\n }\n\n // a write to a parameter this printer declared natively: the right side prints from `Object`\n // locals, so the assignment carries the same checkcast as the call sites. The checker proved the\n // right side assignable to the parameter, so the declared type describes the value received.\n javaParameterAssignmentCast(left, right, identation): string | undefined {\n if (!isIdentifier(left)) {\n return undefined;\n }\n const declaration = this.javaDeclarationOfIdentifier(left);\n if (declaration === undefined || !isParameterDeclaration(declaration) || left.text !== (declaration.name as any)?.text) {\n return undefined;\n }\n const native = this.javaNativeParameterType(declaration) ?? this.javaSplitParameterWriteType(declaration);\n if (native === undefined) {\n return undefined;\n }\n const leftText = this.printNode(left, 0);\n if (this.javaNativeArgumentAlreadyTyped(right, native)) {\n return `${leftText} = ${this.printNode(right, identation)}`;\n }\n if (native === 'Long') {\n return `${leftText} = Helpers.toLongOrNull(${this.printNode(right, identation)})`;\n }\n if (native === JAVA_STRING_LIST_TYPE) {\n return `${leftText} = Helpers.toStringListArg(${this.printNode(right, identation)})`;\n }\n // the checkcast carries its own parentheses: a bare `(T) cond ? a : b` binds the\n // condition, not the whole right side\n return `${leftText} = (${native}) (${this.printNode(right, identation)})`;\n }\n\n // ===== native return types (D-09) =====\n //\n // The native Java return a generated method declaration prints with, when its TS\n javaNativeReturnType(node): string | undefined {\n if (node === undefined || node.kind !== SyntaxKind.MethodDeclaration\n || node.name === undefined || node.type === undefined || node.body === undefined\n || !isClassDeclaration(node.parent)) {\n return undefined;\n }\n if (this.javaReturnTypeInProgress.has(node)) {\n return undefined; // a mutually recursive return chain reads as unproven\n }\n if (this.javaReturnTypeCache.has(node)) {\n return this.javaReturnTypeCache.get(node);\n }\n this.javaReturnTypeInProgress.add(node);\n let result;\n try {\n result = this.javaNativeReturnTypeUncached(node);\n } finally {\n this.javaReturnTypeInProgress.delete(node);\n }\n this.javaReturnTypeCache.set(node, result);\n return result;\n }\n\n javaNativeReturnTypeUncached(node): string | undefined {\n const fileName = node.getSourceFile().fileName;\n const generated = JAVA_NATIVE_PARAMETER_GENERATED_FILES.test(fileName);\n // the printed base tier (below the transpile delimiter) may carry a Boolean return\n // when no venue in the program redeclares the name\n const baseTier = !generated && JAVA_NATIVE_PARAMETER_BASE_FILES.test(fileName) && this.javaIsPrintedMethod(node);\n if ((!generated && !baseTier) || this.isAsyncFunction(node)) {\n return undefined;\n }\n const target = this.javaNativeReturnTypeTarget(node);\n if (target === undefined || (baseTier && target !== 'Boolean')) {\n return undefined;\n }\n // D8: an override prints the base declaration's boxed signature; a Boolean base\n // signature binds every override to Boolean (Java return types are covariant only)\n const ancestor = this.getMethodOverride(node);\n const ancestorBoolean = ancestor !== undefined && this.javaNativeReturnType(ancestor) === 'Boolean';\n if (ancestorBoolean && (target !== 'Boolean' || !this.javaReturnSitesPrintType(node, target)\n || (this.javaMethodReturnsNonNullBoolean(ancestor, 0) && !this.javaMethodReturnsNonNullBoolean(node, 0)))) {\n throw new Error(`java: ${String((node.name as any).text)} overrides a Boolean base method but its returns do not all print Boolean`);\n }\n if (ancestor !== undefined && !ancestorBoolean) {\n return undefined;\n }\n if (!this.javaReturnSitesPrintType(node, target)) {\n return undefined;\n }\n return target;\n }\n\n // a native-Boolean method whose every return prints a primitive Java boolean (never null):\n // a call to it can be a condition as is (unboxing cannot throw)\n javaMethodReturnsNonNullBoolean(method, depth: number): boolean {\n if (method === undefined || depth > 3 || method.body === undefined) {\n return false;\n }\n const name = String((method.name as any)?.text);\n if (this.javaNativeReturnType(method) !== 'Boolean' && !JAVA_THIS_BOOLEAN_METHODS.has(name)) {\n return false;\n }\n let returns = 0;\n let ok = true;\n const scan = (n: Node) => {\n if (!ok || (n !== method && isFunctionLike(n))) {\n return;\n }\n if (isReturnStatement(n)) {\n returns++;\n ok = n.expression !== undefined && this.javaPrintsNonNullBoolean(n.expression, depth);\n return;\n }\n n.forEachChild(scan);\n };\n scan(method.body);\n return ok && returns > 0;\n }\n\n javaPrintsNonNullBoolean(node, depth: number): boolean {\n switch (node?.kind) {\n case SyntaxKind.TrueKeyword:\n case SyntaxKind.FalseKeyword:\n return true;\n case SyntaxKind.ParenthesizedExpression:\n return this.javaPrintsNonNullBoolean(node.expression, depth);\n case SyntaxKind.PrefixUnaryExpression:\n return node.operator === SyntaxKind.ExclamationToken; // prints `!` + a condition\n case SyntaxKind.BinaryExpression:\n return JAVA_BOOLEAN_OPERATOR_KINDS.has(node.operatorToken.kind);\n case SyntaxKind.ConditionalExpression:\n return this.javaPrintsNonNullBoolean(node.whenTrue, depth) && this.javaPrintsNonNullBoolean(node.whenFalse, depth);\n case SyntaxKind.CallExpression:\n return this.javaCallPrintsNonNullBoolean(node, depth + 1);\n }\n return false;\n }\n\n // `this.(...)` resolving to a method proven by javaMethodReturnsNonNullBoolean\n javaCallPrintsNonNullBoolean(node, depth: number): boolean {\n if (this.isArrayIsArrayCall(node) || this.javaPreciseBooleanCall(node) || this.javaStringAffixCall(node)) {\n return true;\n }\n const callee = node.expression;\n if (!isPropertyAccessExpression(callee) || callee.expression.kind !== SyntaxKind.ThisKeyword) {\n return false;\n }\n let declaration;\n try {\n declaration = this.getChecker().getResolvedSignature(node)?.declaration?.resolve();\n } catch (e) {\n return false;\n }\n if (declaration === undefined || declaration.kind !== SyntaxKind.MethodDeclaration) {\n return false;\n }\n if (JAVA_THIS_BOOLEAN_METHODS.has(String(callee.name.text))) {\n return this.javaCallBooleanKind(node) === 'boolean';\n }\n return this.javaMethodReturnsNonNullBoolean(declaration, depth);\n }\n\n javaNativeReturnTypeTarget(node): string | undefined {\n let type;\n try {\n type = this.getChecker().getTypeAtLocation(node.type);\n } catch (e) {\n return undefined;\n }\n if (type === undefined) {\n return undefined;\n }\n const aliasSymbol = (type as any).getAliasSymbol?.();\n if (aliasSymbol !== undefined) {\n const name = aliasSymbol.name;\n const fileName = aliasSymbol.declarations?.[0]?.resolve()?.getSourceFile?.()?.fileName;\n if (fileName !== undefined && JAVA_NATIVE_PARAMETER_SOURCE_FILES.test(fileName) && (name === 'Str' || name === 'Bool')) {\n return name === 'Str' ? 'String' : 'Boolean';\n }\n }\n // a plain (non-alias) string annotation already prints String; the flag proof keeps\n // this rule consistent with the printer's own plain-string handling\n if (type.flags === TypeFlags.String) {\n return 'String';\n }\n // plain `boolean` is the true|false union: the Boolean bit, with no alias (`Bool` is handled above)\n if (aliasSymbol === undefined && (type.flags & TypeFlags.Boolean) !== 0) {\n return 'Boolean';\n }\n return this.isJavaMapStructureType(type) ? JAVA_NATIVE_RETURN_MAP_TYPE : undefined;\n }\n\n // every `return` of the method body (nested functions are separate scopes) prints the\n // target Java type\n javaReturnSitesPrintType(method, target: string): boolean {\n const returns: any[] = [];\n const collect = (n) => {\n if (n === undefined) {\n return;\n }\n if (n !== method && isFunctionLike(n)) {\n return;\n }\n if (isReturnStatement(n)) {\n returns.push(n);\n }\n n.forEachChild(collect);\n };\n collect(method.body);\n if (returns.length === 0) {\n return false;\n }\n return returns.every((r) => r.expression !== undefined\n && this.javaExpressionPrintsType(r.expression, target));\n }\n\n javaExpressionPrintsType(expression, target: string): boolean {\n const node = this.javaUnwrapReturnExpression(expression);\n if (node === undefined) {\n return false;\n }\n if (node.kind === SyntaxKind.NullKeyword) {\n return true; // null is assignable to String / Boolean / Map\n }\n if (isIdentifier(node) && node.text === 'undefined') {\n return true;\n }\n if (node.kind === SyntaxKind.ConditionalExpression) {\n return this.javaExpressionPrintsType(node.whenTrue, target)\n && this.javaExpressionPrintsType(node.whenFalse, target);\n }\n let literal: boolean;\n if (target === JAVA_NATIVE_RETURN_MAP_TYPE) {\n literal = isObjectLiteralExpression(node); // a fresh HashMap literal\n } else if (target === 'String') {\n literal = isStringLiteralLikeNode(node);\n } else if (target === 'Boolean') {\n // the printer's own proof that this expression prints a Java boolean (or a\n // Boolean box): the comparison helpers, `!`, the logical operators, boolean\n // literals and the verified boolean-returning calls\n literal = this.javaPrintsBooleanValue(node, new Set(), 0);\n } else {\n return false;\n }\n return literal\n || this.javaReturnedParameterType(node) === target\n || this.javaReturnedCallType(node) === target\n || (target === 'String' && this.javaStringCallReturn(node));\n }\n\n javaUnwrapReturnExpression(expression) {\n if (expression === undefined) {\n return undefined;\n }\n let node = expression;\n while (node !== undefined && (isParenthesizedExpression(node) || isAsExpression(node)\n || isNonNullExpression(node) || isTypeAssertion(node)\n || node.kind === SyntaxKind.SatisfiesExpression)) {\n node = node.expression;\n }\n return node;\n }\n\n // an identifier bound to a parameter the printer itself declares with the target Java\n // type (javaNativeParameterType: Dict/Market/Currency/Str/Bool annotations)\n javaReturnedParameterType(node): string | undefined {\n if (!isIdentifier(node)) {\n return undefined;\n }\n const declaration = this.javaDeclarationOfIdentifier(node);\n if (declaration === undefined || !isParameterDeclaration(declaration)) {\n return undefined;\n }\n return this.javaNativeParameterType(declaration);\n }\n\n // a `this. (...)` / `super. (...)` return is the callee's native return type\n // (fixpoint over javaNativeReturnType)\n javaReturnedCallType(node): string | undefined {\n if (!isCallExpression(node)) {\n return undefined;\n }\n const callee = node.expression;\n if (!isPropertyAccessExpression(callee)\n || (callee.expression.kind !== SyntaxKind.ThisKeyword\n && !(isIdentifier(callee.expression) && callee.expression.text === 'super'))) {\n return undefined;\n }\n let declaration;\n try {\n declaration = this.getChecker().getResolvedSignature(node)?.declaration?.resolve();\n } catch (e) {\n return undefined;\n }\n if (declaration === undefined || declaration.kind !== SyntaxKind.MethodDeclaration) {\n return undefined;\n }\n return this.javaNativeReturnType(declaration);\n }\n\n // a `this. (...)` return of a hand-written base String producer: the resolved\n // signature must still live in the base tier (a venue override prints its own boxed\n // Object signature)\n javaStringCallReturn(node): boolean {\n if (!isCallExpression(node)) {\n return false;\n }\n const callee = node.expression;\n if (!isPropertyAccessExpression(callee) || callee.expression.kind !== SyntaxKind.ThisKeyword) {\n return false;\n }\n if (!JAVA_STRING_RETURN_BASE_METHODS.has(callee.name.text as string)) {\n return false;\n }\n let declaration;\n try {\n declaration = this.getChecker().getResolvedSignature(node)?.declaration?.resolve();\n } catch (e) {\n return false;\n }\n if (declaration === undefined) {\n return false; // an unresolvable call prints Helpers.callDynamically (Object)\n }\n const fileName = declaration.getSourceFile?.()?.fileName;\n return fileName !== undefined && JAVA_STRING_RETURN_BASE_FILES.test(fileName);\n }\n\n // the alias a parameter's annotation names; `OrderType` ('limit' | 'market' | string) reduces\n // to plain `string` and keeps no aliasSymbol, so read the annotation's type reference instead\n javaParameterAliasSymbol(node, type, checker) {\n const symbol = (type as any).getAliasSymbol?.() ?? (type as any).getSymbol?.();\n if (symbol !== undefined || node.type === undefined || !isTypeReferenceNode(node.type)) {\n return symbol;\n }\n const referenced = checker.getSymbolAtLocation(node.type.typeName);\n const alias = referenced !== undefined && (referenced.flags & SymbolFlags.Alias)\n ? checker.getAliasedSymbol(referenced) : referenced;\n return alias !== undefined && (alias.flags & SymbolFlags.TypeAlias) ? alias : undefined;\n }\n\n // the annotation proof alone, without the heritage check\n javaNativeParameterTypeOf(node): string | undefined {\n if (node === undefined || !isParameterDeclaration(node)\n || node.initializer !== undefined || node.dotDotDotToken !== undefined) {\n return undefined;\n }\n const method = node.parent;\n if (method === undefined || !isMethodDeclaration(method) || !isClassDeclaration(method.parent)) {\n return undefined;\n }\n if (!JAVA_NATIVE_PARAMETER_BASE_FILES.test(node.getSourceFile().fileName)\n && !JAVA_NATIVE_PARAMETER_GENERATED_FILES.test(node.getSourceFile().fileName)) {\n return undefined; // a hand-written java class declares this method, not the printer\n }\n const checker: any = this.checkerOrUndefined();\n if (checker === undefined) {\n return undefined;\n }\n const type = checker.getTypeAtLocation(node);\n if (type === undefined) {\n return undefined;\n }\n const symbol = this.javaParameterAliasSymbol(node, type, checker);\n const name = symbol?.name;\n if (name === undefined || JAVA_NATIVE_PARAMETER_TYPES[name] === undefined) {\n return undefined;\n }\n const excluded = JAVA_NATIVE_PARAMETER_EXCLUDED_POSITIONS[(method.name as any)?.text];\n if (excluded !== undefined && excluded.includes(method.parameters.indexOf(node))) {\n return undefined;\n }\n const declaration = symbol?.declarations?.[0]?.resolve();\n const fileName = declaration?.getSourceFile?.()?.fileName;\n return JAVA_NATIVE_PARAMETER_SOURCE_FILES.test(fileName ?? '') ? JAVA_NATIVE_PARAMETER_TYPES[name] : undefined;\n }\n\n // `k` where the consumer declares k as a Java String: the helper's String branch (the\n // only one that can answer true for a map) is the native lookup, and no null key can\n // reach containsKey\n javaDeclaredStringType(expression) {\n const type = this.javaDeclaredTypeOf(expression);\n return type !== undefined && JAVA_DECLARED_STRING_TYPE.test(type);\n }\n\n printCustomBinaryExpressionIfAny(node, identation) {\n const left = node.left;\n const right = node.right;\n const op = node.operatorToken.kind;\n\n if (left.kind === SyntaxKind.Identifier) {\n this.ReassignedVars[this.getVarKey(left)] = true;\n }\n\n if (left.kind === SyntaxKind.TypeOfExpression) {\n const typeOfExpression = this.handleTypeOfInsideBinaryExpression(\n node,\n identation\n );\n if (typeOfExpression) return typeOfExpression;\n }\n\n // a write to a parameter the printer declared natively casts its right side\n if (op === SyntaxKind.EqualsToken && left.kind === SyntaxKind.Identifier) {\n const assignment = this.javaParameterAssignmentCast(left, right, identation);\n if (assignment !== undefined) {\n return assignment;\n }\n }\n\n // destructuring: [a,b] = this.method()\n if (\n op === SyntaxKind.EqualsToken &&\n left.kind === SyntaxKind.ArrayLiteralExpression\n ) {\n const arrayBindingPatternElements = left.elements;\n const parsedArrayBindingElements = arrayBindingPatternElements.map((e) => {\n this.ReassignedVars[this.getVarKey(e)] = true;\n return this.printNode(e, 0);\n });\n const syntheticName = parsedArrayBindingElements.join(\"\") + \"Variable\";\n\n let arrayBindingStatement =\n `var ${syntheticName} = ${this.printNode(right, 0)};\\n`;\n\n parsedArrayBindingElements.forEach((e, index) => {\n // a destructuring target the printer declares natively carries the cast the\n // synthesized `.get(index)` result needs (a plain `Object` read)\n let elementValue = `((java.util.List) ${syntheticName}).get(${index})`;\n const target = arrayBindingPatternElements[index];\n if (isIdentifier(target)) {\n const declaration = this.javaDeclarationOfIdentifier(target);\n const native = declaration !== undefined && isParameterDeclaration(declaration)\n ? (this.javaNativeParameterType(declaration) ?? this.javaSplitParameterWriteType(declaration)) : undefined;\n if (native === 'Long') {\n elementValue = `Helpers.toLongOrNull(${elementValue})`;\n } else if (native !== undefined) {\n elementValue = `(${native}) ${elementValue}`;\n }\n }\n const terminator = index < parsedArrayBindingElements.length - 1 ? \";\\n\" : \"\";\n arrayBindingStatement += this.getIden(identation) + `${e} = ${elementValue}` + terminator;\n });\n\n return arrayBindingStatement;\n }\n\n // ---------------------------------------------------------------\n // setter for element-access assignments: a[b] = v\n // ---------------------------------------------------------------\n if (op === SyntaxKind.EqualsToken &&\n left.kind === SyntaxKind.ElementAccessExpression) {\n // Collect base container and all keys (inner-most key is last).\n const keys: any[] = [];\n let baseExpr: any = null;\n let cur: any = left;\n while (isElementAccessExpression(cur)) {\n keys.unshift(cur.argumentExpression); // prepend\n const expr = cur.expression;\n if (!isElementAccessExpression(expr)) {\n baseExpr = expr;\n break;\n }\n cur = expr;\n }\n\n const containerStr = this.printNode(baseExpr, 0);\n const keyStrs = keys.map(k => this.printNode(k, 0));\n\n // Build GetValue(GetValue( ... )) chain for all but the last key; the first\n // step reads the receiver itself, so a declared map indexes natively and only\n // the `any` steps above it keep the helper (Go: goElementWriteChain).\n let acc = containerStr;\n let firstKey = 0;\n const chainRead = (keyStrs.length > 1) ? this.javaDeclaredChainContainerRead(left, keys.length) : undefined;\n if ((keyStrs.length > 1) && this.javaDeclaredMapReceiver(baseExpr)\n && isStringLiteralLikeNode(keys[0])) {\n acc = `${containerStr}.get(${keyStrs[0]})`;\n firstKey = 1;\n } else if (chainRead !== undefined) {\n acc = chainRead;\n firstKey = 1;\n } else if (keyStrs.length > 1) {\n // `this.[k1][k2] = v`: the bottom step reads the hand-written base map\n // field natively (JAVA_FIELD_TYPES), every step above it keeps the helper\n const fieldRead = this.javaFieldMapReadText(baseExpr, keys[0]);\n if (fieldRead !== undefined) {\n acc = fieldRead;\n firstKey = 1;\n }\n }\n for (let i = firstKey; i < keyStrs.length - 1; i++) {\n acc = `${this.ELEMENT_ACCESS_WRAPPER_OPEN}${acc}, ${keyStrs[i]}${this.ELEMENT_ACCESS_WRAPPER_CLOSE}`;\n }\n\n const prefixes = \"\";\n\n\n const lastKey = keyStrs[keyStrs.length - 1];\n const rhs = this.printNode(right, 0);\n const keyArg = this.elementWriteKeyText(keys[keys.length - 1], lastKey);\n\n if (this.elementWriteTargetsMap(left.expression, baseExpr, keys, right)) {\n // a receiver declared as a Map already carries the type the put binds on\n const target = (keys.length === 1 && this.javaDeclaredMapReceiver(baseExpr))\n ? acc : `((${this.OBJECT_KEYWORD})${acc})`;\n return `${prefixes}${target}.put(${keyArg}, ${rhs})`;\n }\n // a declared Map local takes a non-null value: the helper's only non-put branch is\n // the ConcurrentHashMap null removal, so the native put is the same write\n if (keys.length === 1 && this.javaDeclaredMapReceiver(baseExpr)\n && (isStringLiteralLikeNode(keys[0]) || this.javaDeclaredStringType(keys[0]))\n && this.javaPrintsNonNullValue(right)) {\n return `${prefixes}${acc}.put(${lastKey}, ${rhs})`;\n }\n\n return `${prefixes}Helpers.addElementToObject(${acc}, ${lastKey}, ${rhs})`;\n }\n\n if (op === SyntaxKind.InKeyword) {\n const objectType = this.getChecker().getTypeAtLocation(right);\n const keyType = this.getChecker().getTypeAtLocation(left);\n const objText = this.printNode(right, 0);\n const keyText = this.printNode(left, 0);\n // A key the checker does not prove a Java String: the helper's map branch and containsKey both\n // answer false for it, and the null test keeps ConcurrentHashMap/TreeMap receivers from throwing\n // on a null key. The key prints once per guard, so it must be a side-effect-free read.\n let guarded: string | undefined;\n if (this.isJavaStringType(keyType) || this.javaDeclaredStringType(left)) {\n guarded = '';\n } else if (this.javaSideEffectFreeReference(left) && !this.javaOperandPrintsPrimitiveNumber(left)\n && !this.isNullishLiteral(left)\n && left.kind !== SyntaxKind.TrueKeyword && left.kind !== SyntaxKind.FalseKeyword) {\n guarded = `${keyText} != null && `;\n }\n const withGuard = (read: string) => (guarded ? `(${guarded}${read})` : read);\n if (guarded !== undefined) {\n // the declaration the pass rewrote already carries the map type (and, for a\n // `this.` field or a retyped local, the surface that names it): no cast needed\n if (this.javaDeclaredMapReceiver(right)) {\n return withGuard(`${objText}.containsKey(${keyText})`);\n }\n if (this.isJavaMapType(objectType)) {\n return withGuard(`((java.util.Map)${objText}).containsKey(${keyText})`);\n }\n // `Dictionary | undefined` (a no-overload safe* signature): the helper answers\n // false for the nullish arm, the guard keeps exactly that\n if (this.isJavaNullableMapType(objectType) && this.javaRepeatableOperand(right)) {\n return `(${objText} != null && ${guarded}((java.util.Map)${objText}).containsKey(${keyText}))`;\n }\n }\n return `Helpers.inOp(${objText}, ${keyText})`;\n }\n\n // native comparison when both operands provably print as Java numbers. `>` is exact for every\n // numeric pair (isGreaterThan is a toDouble compare, NaN included); `>=` / `<` / `<=` also go\n // through the helper's isEqual, so they need operands isEqual reproduces exactly.\n if (op === SyntaxKind.LessThanToken || op === SyntaxKind.GreaterThanToken ||\n op === SyntaxKind.LessThanEqualsToken || op === SyntaxKind.GreaterThanEqualsToken) {\n const leftKind = this.javaPrimitiveOperandKind(left);\n const rightKind = this.javaPrimitiveOperandKind(right);\n const orderingSafe = op === SyntaxKind.GreaterThanToken\n || this.javaComparisonOperandsAreExact(left, leftKind, right, rightKind);\n if (leftKind !== undefined && rightKind !== undefined && orderingSafe) {\n return `${this.printNode(left, 0)} ${this.SupportedKindNames[op]} ${this.printNode(right, 0)}`;\n }\n const declaredCompare = this.printDeclaredNumericComparison(left, right, op);\n if (declaredCompare !== undefined) {\n return declaredCompare;\n }\n }\n\n // only print the operands when this op is actually handled here; otherwise\n // the base printBinaryExpression prints them, and doing it eagerly means\n // every unhandled binary expression gets its subtrees printed twice\n if (op === SyntaxKind.PlusEqualsToken || op === SyntaxKind.MinusEqualsToken || op in this.binaryExpressionsWrappers) {\n const leftText = this.printNode(left, 0);\n const rightText = this.printNode(right, 0);\n\n const inlined = this.printInlineHelperArithmetic(left, right, leftText, rightText, op);\n if (inlined !== undefined) {\n return inlined;\n }\n\n\n if (op === SyntaxKind.PlusEqualsToken) {\n return `${leftText} = Helpers.add(${leftText}, ${rightText})`;\n }\n\n if (op === SyntaxKind.MinusEqualsToken) {\n return `${leftText} = Helpers.subtract(${leftText}, ${rightText})`;\n }\n\n const wrapper = this.binaryExpressionsWrappers[op];\n const nativeEquality = this.printNativeEqualityIfProvable(node, leftText, rightText);\n if (nativeEquality !== undefined) {\n return nativeEquality;\n }\n return `${wrapper[0]}${leftText}, ${rightText}${wrapper[1]}`;\n }\n\n return undefined;\n }\n\n\n // dict-shaped values are Map in the Java port: raw HashMap/ConcurrentHashMap\n // or a types.TypedMap view (AbstractMap over the raw payload). Proven by the\n // checker (string index signature, or an interface/alias declared in the base types file).\n // a concrete (non-any, non-union, non-generic) type the structure proofs below can reason about\n javaConcreteStructureType(type) {\n const excludedFlags = TypeFlags.Any | TypeFlags.Unknown | TypeFlags.Union\n | TypeFlags.Intersection | TypeFlags.Undefined | TypeFlags.Null\n | TypeFlags.TypeParameter | TypeFlags.Conditional | TypeFlags.Never;\n return type !== undefined && (type.flags & excludedFlags) === 0;\n }\n\n isJavaMapStructureType(type) {\n if (!this.javaConcreteStructureType(type)) {\n return false;\n }\n const checker = this.getChecker();\n if (checker.isArrayType(type) || checker.isTupleType(type)) {\n return false;\n }\n if (type.getStringIndexType() !== undefined) {\n return true;\n }\n const symbol = (type as any).getAliasSymbol?.() ?? type.getSymbol?.();\n const declaration = symbol?.declarations?.[0]?.resolve();\n const fileName = declaration?.getSourceFile?.()?.fileName;\n return fileName !== undefined && /(^|\\/)ts\\/src\\/base\\/types\\.ts$/.test(fileName);\n }\n\n // tuples are List in the Java port (types.TypedList). Only an index inside the\n // tuple's required elements goes native: .get(i) throws out of range where the helper\n // returns null, so non-tuple array reads (any[], string[], ...) keep the helper.\n isJavaListStructureType(type) {\n return this.javaConcreteStructureType(type) && this.getChecker().isTupleType(type);\n }\n\n tupleRequiredElementCount(type) {\n const flags = ((type as any)?.isTypeReference?.() ? (type as any).getTarget().elementFlags : undefined) ?? (type as any)?.elementFlags ?? [];\n let required = 0;\n for (const flag of flags) {\n if (flag !== ElementFlags.Optional && flag !== ElementFlags.Rest) {\n required++;\n } else {\n break;\n }\n }\n return required;\n }\n\n // non-tuple array reads: the Java representation is java.util.List (the printer maps every\n // array type to one), but neither the receiver nor the index is bounded statically, so the\n // read keeps the helper's null / off-range outcomes.\n isJavaArrayStructureType(type) {\n if (!this.javaConcreteStructureType(type)) {\n return false;\n }\n const checker = this.getChecker();\n if (checker.isTupleType(type)) {\n return false; // handled by the tuple branch, where the bound is provable\n }\n return checker.isArrayType(type);\n }\n\n // the null-safe element read prints its receiver once per guard; only a reference whose\n // printed Java has no side effects (identifier, `this`/`this.field` chain) may repeat it.\n javaSideEffectFreeReference(node) {\n if (node === undefined) {\n return false;\n }\n switch (node.kind) {\n case SyntaxKind.Identifier:\n case SyntaxKind.ThisKeyword:\n return true;\n case SyntaxKind.ParenthesizedExpression:\n case SyntaxKind.PropertyAccessExpression:\n return this.javaSideEffectFreeReference(node.expression);\n default:\n return false;\n }\n }\n\n // receivers whose printed elements the ccxt post-pass types as String FROM the helper call\n // (`x.split(sep)` and string-literal array producers): those locals narrow to String only\n // while the read prints `Helpers.GetValue(`, so their reads keep the helper.\n javaStringElementsReceiver(node) {\n if (!isIdentifier(node)) {\n return false;\n }\n const declaration = this.getChecker().getSymbolAtLocation(node)?.valueDeclaration?.resolve();\n const initializer = declaration !== undefined && isVariableDeclaration(declaration) ? declaration.initializer : undefined;\n if (initializer === undefined) {\n return false;\n }\n if (isCallExpression(initializer) && isPropertyAccessExpression(initializer.expression)) {\n return initializer.expression.name?.text === 'split';\n }\n if (isArrayLiteralExpression(initializer)) {\n return initializer.elements.length > 0 && initializer.elements.every((element) =>\n element.kind === SyntaxKind.StringLiteral\n || element.kind === SyntaxKind.NoSubstitutionTemplateLiteral);\n }\n return false;\n }\n\n isLeftSideOfAssignment(node) {\n const parent = node.parent;\n if (parent?.kind !== SyntaxKind.BinaryExpression || parent.left !== node) {\n return false;\n }\n return JAVA_ASSIGNMENT_OPERATOR_KINDS.has(parent.operatorToken.kind);\n }\n\n // The declared Java type of a local is known to the pass that rewrites the declaration\n // text (build/java-local-types.js): it records every local it typed here. Reads consult\n // it; with no consumer installed the table is empty and every read keeps the helper.\n javaDeclaredLocalTypeResolver: ((declaration: Node) => string | undefined) | undefined;\n\n // the declaration node behind an identifier, when the checker resolves one\n javaDeclarationOfIdentifier(expression) {\n if (expression === undefined || !isIdentifier(expression)) {\n return undefined;\n }\n const checker: any = this.checkerOrUndefined();\n if (checker === undefined) {\n return undefined;\n }\n const symbol = checker.getSymbolAtLocation(expression);\n const declaration = symbol?.valueDeclaration?.resolve() ?? symbol?.declarations?.[0]?.resolve();\n const kind = declaration?.kind;\n return kind === SyntaxKind.VariableDeclaration || kind === SyntaxKind.Parameter ? declaration : undefined;\n }\n\n // `x[\"lit\"]` where the consumer declares x as a Java map: the native read returns the\n // element or null, exactly what the helper's Map branch returns, and the declaration\n // already carries the type, so no cast is needed.\n javaDeclaredMapReceiver(expression) {\n const declaration = this.javaDeclarationOfIdentifier(expression);\n if (declaration === undefined) {\n return false;\n }\n if (expression.text !== declaration.name?.text) {\n return false; // a capture rename prints `final Object finalX = x` (Object)\n }\n const type = this.javaDeclaredTypeOfDeclaration(declaration);\n return type !== undefined && JAVA_DECLARED_MAP_TYPES.test(type);\n }\n\n // `x[i]` where x is a declared java List and i is the int counter of `for (var i = `:\n // GetValue answers null for a null receiver or index outside [0, size) while List.get throws, so\n // the emission carries the same tests. `||` short-circuits over identifiers, so nothing runs twice.\n javaDeclaredListElementRead(node, isCounter) {\n if (node.parent?.kind === SyntaxKind.ExpressionStatement) {\n return undefined; // a bare conditional expression is not a Java statement\n }\n // the ws-tier post-pass types `Object client = Helpers.GetValue(..)` by that exact\n // printed text (build/javaTranspiler.ts postProcessWsJava: `Client client =\n // (Client)Helpers.GetValue(..)`). A native read drops the shape and the checkcast\n if (node.parent?.kind === SyntaxKind.VariableDeclaration\n && (node.parent as any).initializer === node\n && ((node.parent as any).name?.text === 'client')) {\n return undefined;\n }\n const declared = this.javaDeclaredTypeOf(node.expression);\n const declaredList = declared !== undefined && JAVA_DECLARED_LIST_TYPES.test(declared);\n let target;\n let list;\n if (declaredList) {\n target = this.printNode(node.expression, 0);\n list = target;\n } else {\n const type = this.getChecker().getTypeAtLocation(node.expression);\n if (!this.isJavaListValueType(type) || this.isVarargsArrayReference(node.expression)\n || !this.javaSideEffectFreeReference(node.expression)) {\n return undefined;\n }\n target = this.printNode(node.expression, 0);\n list = `((java.util.List)${target})`;\n }\n if (!isCounter && Number(node.argumentExpression.text) > 2147483647) {\n return undefined; // printNumericLiteral would add an `L` suffix List.get cannot take\n }\n if (this.javaStringElementsReceiver(node.expression)) {\n return undefined; // its String consumers are typed from the `Helpers.GetValue(` prefix\n }\n const indexText = this.printNode(node.argumentExpression, 0);\n const lowerBound = isCounter ? `${indexText} < 0 || ` : '';\n return `(${target} == null || ${lowerBound}${indexText} >= ${list}.size() ? null : ${list}.get(${indexText}))`;\n }\n\n // `x[k]` where a consumer declares x a java Map and the key is not a literal: the\n // helper's Map branch is the map accessor behind its own tests — a null receiver, a\n // null key and a key that is not a String all answer null, and a String-keyed map's\n javaDeclaredMapElementRead(node) {\n if (node.parent?.kind === SyntaxKind.ExpressionStatement) {\n return undefined; // a bare conditional expression is not a Java statement\n }\n if (this.printElementAccessExpressionExceptionIfAny(node) !== undefined\n || this.isLeftSideOfAssignment(node)) {\n return undefined;\n }\n if (!this.javaDeclaredMapReceiver(node.expression)) {\n return undefined;\n }\n const key = node.argumentExpression;\n if (!isIdentifier(key) || !this.javaRepeatableOperand(key)) {\n return undefined; // the guard prints the key twice\n }\n const declared = this.javaDeclaredTypeOf(key);\n if (declared !== undefined && JAVA_PRIMITIVE_DECLARED_TYPES.has(declared.trim())) {\n return undefined; // a java primitive cannot take the `instanceof` test\n }\n if (declared === undefined && this.javaOperandPrintsPrimitiveNumber(key)) {\n return undefined;\n }\n let keyType;\n try {\n keyType = this.getChecker().getTypeAtLocation(key);\n } catch (e) {\n return undefined;\n }\n if (keyType === undefined\n || this.getChecker().isArrayType(keyType) || this.getChecker().isTupleType(keyType)) {\n return undefined;\n }\n const target = this.printNode(node.expression, 0);\n const keyText = this.printNode(key, 0);\n if (keyType.getAliasSymbol?.() === undefined && keyType.flags === TypeFlags.String) {\n // a plain `string` key prints a java String; the null test keeps a receiver that\n // aliases a ConcurrentHashMap from throwing on a null the alias admits\n return `(${target} == null || ${keyText} == null ? null : ${target}.get(${keyText}))`;\n }\n return `(${target} == null || !(${keyText} instanceof String) ? null : ${target}.get(${keyText}))`;\n }\n\n // the identifier of a `for (var i = ; …; i++)` counter that still prints as\n // `i`: the JN capture rename prints `finalI`, a `final Object` box, which is not an int\n javaPrimitiveCounterIndex(node) {\n if (!this.isJavaPrimitiveCounterReference(node)) {\n return false;\n }\n const declaration = this.javaDeclarationOfIdentifier(node);\n return declaration !== undefined && node.text === declaration.name?.text;\n }\n\n // `this.[k]` on a hand-written base map field (JAVA_FIELD_TYPES): the helper's Map branch is\n // the native `get`. The helper answers null for a null receiver or key, so both stay guarded; the\n // receiver and key are side-effect free. An unguarded read has no parens so a checkcast binds it.\n javaFieldMapReadText(receiver, key): string | undefined {\n if (receiver === undefined || receiver.kind !== SyntaxKind.PropertyAccessExpression\n || receiver.expression?.kind !== SyntaxKind.ThisKeyword) {\n return undefined;\n }\n const name = receiver.name?.text;\n const field = (typeof name === 'string') ? JAVA_FIELD_TYPES[name] : undefined;\n if (field === undefined || field.map !== true) {\n return undefined;\n }\n const keyText = this.printNode(key, 0);\n let keyGuarded = false;\n const checker: any = this.checkerOrUndefined();\n if (checker === undefined) {\n return undefined;\n }\n const keyType = checker.getTypeAtLocation(key);\n if (!this.isJavaStringType(keyType) && !this.javaDeclaredStringType(key)) {\n // the guard prints the key twice, so only a repeatable operand can take it\n if (!this.javaRepeatableOperand(key)) {\n return undefined;\n }\n keyGuarded = true;\n }\n const target = this.printNode(receiver, 0);\n const read = `((java.util.Map)${target}).get(${keyText})`;\n if (!keyGuarded && field.nullable !== true) {\n return read;\n }\n const receiverGuard = (field.nullable === true) ? `${target} == null ? null : ` : '';\n return `(${keyGuarded ? `${keyText} == null ? null : ` : ''}${receiverGuard}${read})`;\n }\n\n // the read stands only where no exchange-specific override claims the site and the node\n // is not a write target\n javaFieldMapReadIfAllowed(node): string | undefined {\n const read = this.javaFieldMapReadText(node.expression, node.argumentExpression);\n if (read === undefined) {\n return undefined;\n }\n if (this.printElementAccessExpressionExceptionIfAny(node) !== undefined || this.isLeftSideOfAssignment(node)) {\n return undefined;\n }\n return read;\n }\n\n // `x[k]` reads: emit the native container accessor when the checker proves the Java\n // representation of `x`, otherwise return undefined so the base prints Helpers.GetValue.\n printCheckerTypedElementAccessRead(node) {\n const key = node.argumentExpression;\n const isStringKey = isStringLiteralLikeNode(key);\n const isNumberKey = isNumericLiteral(key);\n const isCounterKey = !isStringKey && !isNumberKey && this.javaPrimitiveCounterIndex(key);\n if (!isStringKey && !isNumberKey && !isCounterKey) {\n // a `this.` map read carries its own Java proof (JAVA_FIELD_TYPES): the\n // field declaration the printer cannot see is what makes `k` bind natively\n const field = this.javaFieldMapReadIfAllowed(node);\n if (field !== undefined) {\n return field;\n }\n // a declared map (a local the build layer typed, or a param the printer retypes)\n // is the other proof a non-literal key binds natively\n return this.javaDeclaredMapElementRead(node);\n }\n if (this.printElementAccessExpressionExceptionIfAny(node) !== undefined) {\n return undefined; // an exchange-specific override wins, the base prints it\n }\n if (this.isLeftSideOfAssignment(node)) {\n return undefined;\n }\n const type = this.getChecker().getTypeAtLocation(node.expression);\n if (isStringKey) {\n if (!this.isJavaMapStructureType(type)) {\n if (!this.javaDeclaredMapReceiver(node.expression)) {\n // a literal key on a table field the checker does not type (balance is\n // `any`) still has the field table's Java proof\n return this.javaFieldMapReadIfAllowed(node);\n }\n // the declared local is already a map: the accessor binds with no cast\n return `${this.printNode(node.expression, 0)}.get(${this.printNode(key, 0)})`;\n }\n const target = this.printNode(node.expression, 0);\n return `((java.util.Map)${target}).get(${this.printNode(key, 0)})`;\n }\n if (isCounterKey) {\n // a `var` int loop index on a declared List: the only proof that prints an int\n return this.javaDeclaredListElementRead(node, true);\n }\n const index = Number(key.text);\n if (!Number.isInteger(index) || index < 0) {\n return undefined;\n }\n if (this.isJavaListStructureType(type)) {\n if (index >= this.tupleRequiredElementCount(type)) {\n return undefined;\n }\n const target = this.printNode(node.expression, 0);\n return `((java.util.List)${target}).get(${this.printNode(key, 0)})`;\n }\n if (!this.isJavaArrayStructureType(type)) {\n // the checker leaves the receiver boxed: a declared List still reads natively\n return this.javaDeclaredListElementRead(node, false);\n }\n if (!this.javaSideEffectFreeReference(node.expression) || this.javaStringElementsReceiver(node.expression)) {\n return undefined;\n }\n // `Helpers.GetValue` returns null for a null receiver and off range; List.get\n // throws on both, so the native read carries both guards. `||` short-circuits and\n // the receiver is side-effect free, so it is evaluated as often as before.\n const target = this.printNode(node.expression, 0);\n const list = `((java.util.List)${target})`;\n const keyText = this.printNode(key, 0);\n return `(${target} == null || ${keyText} >= ${list}.size() ? null : ${list}.get(${keyText}))`;\n }\n\n printElementAccessExpression(node, identation) {\n return this.printCheckerTypedElementAccessRead(node) ?? super.printElementAccessExpression(node, identation);\n }\n\n\n // ---- helper-family inlining: `+ - * / += -=` ---------------------------\n // `x + y` normally prints Helpers.add, `- * /` print Helpers.subtract/multiply/\n // divide, and `+=`/`-=` print `x = Helpers.add/subtract(...)`. They print native\n // Java when BOTH operands are checker-typed in the same non-nullable scalar family\n // and the printed operands carry the matching Java kind, so the native expression\n // has the helper's boxed result kind and value on every path.\n\n // the TypeScript scalar family of a binary operand: plain `string`/`number` and\n // their literals only. The nullable aliases (Str/Int/Num/Bool), unions and `any`\n // can hold undefined at runtime, which the helpers absorb.\n javaScalarFamily(node): string | undefined {\n const checker: any = this.checkerOrUndefined();\n if (checker === undefined) {\n return undefined;\n }\n const type = checker.getTypeAtLocation(node);\n if (type === undefined || type.getAliasSymbol?.() !== undefined) {\n return undefined;\n }\n const flags = type.flags;\n if (flags === TypeFlags.String || flags === TypeFlags.StringLiteral) {\n return 'string';\n }\n if (flags === TypeFlags.Number || flags === TypeFlags.NumberLiteral) {\n return 'number';\n }\n return undefined;\n }\n\n // true when the printed Java for this operand is statically a String: a string\n // literal, a nested `+` this rule prints as a native concat, or a form the\n // embedding build layer's javaExpressionTypeResolver names `String` (a local whose\n // emitted declaration is `String = `, a call to a hand-written `public\n // String` runtime method). Java compiles `+` only when at least one operand is\n // statically a String, so a String local anchors the concat like a literal does.\n javaProvableString(node): boolean {\n if (node === undefined) {\n return false;\n }\n switch (node.kind) {\n case SyntaxKind.StringLiteral:\n case SyntaxKind.NoSubstitutionTemplateLiteral:\n return true;\n case SyntaxKind.ParenthesizedExpression:\n return this.javaProvableString(node.expression);\n case SyntaxKind.BinaryExpression:\n return this.javaNativeConcat(node);\n }\n return this.javaResolvedString(node);\n }\n\n // the embedding build layer's proof of the concrete printed Java type of an\n // expression (installed like csharpExpressionTypeResolver); only `String` is\n // consumed here, and a missing resolver proves nothing\n javaResolvedString(node): boolean {\n if (node === undefined || this.javaExpressionTypeResolver === undefined) {\n return false;\n }\n try {\n return this.javaExpressionTypeResolver(node) === 'String';\n } catch (e) {\n return false;\n }\n }\n\n // does this `+` node print as a native concat (both sides plain string, one side a\n // provable String)? Mirrors printInlineHelperArithmetic so callers can reason about\n // the printed text of a nested concat.\n javaNativeConcat(node): boolean {\n if (node?.operatorToken?.kind !== SyntaxKind.PlusToken) {\n return false;\n }\n if (this.javaScalarFamily(node.left) !== 'string' || this.javaScalarFamily(node.right) !== 'string') {\n return false;\n }\n return this.javaProvableString(node.left) || this.javaProvableString(node.right);\n }\n\n // B-13: the `+` / `+=` concat drops the helper when one side's printed Java is\n // provably a String and the other side is an operand Helpers.add's String branch\n // converts exactly like javac's `+` does\n javaStringConcatIsProvable(left, right, leftFamily, rightFamily) {\n const leftProvable = this.javaProvableString(left);\n const rightProvable = this.javaProvableString(right);\n if (leftFamily === 'string' && rightFamily === 'string' && (leftProvable || rightProvable)) {\n return true;\n }\n return (leftProvable && this.javaConcatOtherOperandIsSafe(right))\n || (rightProvable && this.javaConcatOtherOperandIsSafe(left));\n }\n\n // the non-anchor operand of a concat: a value StringBuilder.append and Helpers.add's\n // `String.valueOf` branch turn into the same text. Inlined when it is a printed String, when the\n // checker proves a plain non-nullable `string`, or when the type cannot be a boxed Double.\n javaConcatOtherOperandIsSafe(node) {\n if (node === undefined) {\n return false;\n }\n if (this.javaProvableString(node) || this.javaScalarFamily(node) === 'string') {\n return true;\n }\n return this.javaConcatOperandPrintsAsValue(node) && !this.javaConcatOperandCanBeDouble(node);\n }\n\n // a bare value an infix operator can take without extra parentheses: a ternary,\n // assignment or comma expression printed here would re-parse (`(x + c ? a : b)`),\n // and an optional-chain call prints a guarded shape that is not an operand\n javaConcatOperandPrintsAsValue(node) {\n if (node === undefined) {\n return false;\n }\n if (isParenthesizedExpression(node)) {\n return this.javaConcatOperandPrintsAsValue(node.expression);\n }\n switch (node.kind) {\n case SyntaxKind.Identifier:\n case SyntaxKind.StringLiteral:\n case SyntaxKind.NoSubstitutionTemplateLiteral:\n case SyntaxKind.NumericLiteral:\n case SyntaxKind.TrueKeyword:\n case SyntaxKind.FalseKeyword:\n case SyntaxKind.NullKeyword:\n case SyntaxKind.ThisKeyword:\n case SyntaxKind.NewExpression:\n case SyntaxKind.ArrayLiteralExpression:\n return true;\n case SyntaxKind.PropertyAccessExpression:\n case SyntaxKind.ElementAccessExpression:\n case SyntaxKind.CallExpression:\n return node.questionDotToken === undefined;\n }\n return false;\n }\n\n // a Double operand makes Helpers.add take its `instanceof Double` branch and return a NUMBER, while\n // javac's `+` concatenates, so an operand that can be a boxed Double keeps the helper. Only types\n // that can never hold a number are accepted, plus integer literals that print as a Java `long`.\n javaConcatOperandCanBeDouble(node) {\n if (this.javaProvableNumericKind(node) === 'long') {\n return false;\n }\n const checker: any = this.checkerOrUndefined();\n if (checker === undefined) {\n return true;\n }\n const type = checker.getTypeAtLocation(node);\n if (type === undefined) {\n return true;\n }\n const notNumber = TypeFlags.String | TypeFlags.StringLiteral | TypeFlags.TemplateLiteral\n | TypeFlags.Boolean | TypeFlags.BooleanLiteral | TypeFlags.Object | TypeFlags.Null\n | TypeFlags.Undefined | TypeFlags.Void | TypeFlags.Never;\n const notNumeric = (t) => {\n if (t === undefined || t.flags === 0) {\n return false;\n }\n if (t.isUnionType?.()) {\n return t.getTypes().every(notNumeric);\n }\n return (t.flags & ~notNumber) === 0;\n };\n return !notNumeric(type);\n }\n\n // the Java kind a `this.(...)` call provably prints with (JAVA_THIS_RETURN_TYPES), or\n // undefined. The signature must resolve to the base tier or the Date.now lib signature of the\n // functions/time.ts mixin; a venue override prints its own (usually Object) signature.\n javaThisCallNumericKind(node): string | undefined {\n if (node?.kind !== SyntaxKind.CallExpression) {\n return undefined;\n }\n const callee = node.expression;\n if (callee?.kind !== SyntaxKind.PropertyAccessExpression || callee.expression?.kind !== SyntaxKind.ThisKeyword) {\n return undefined;\n }\n const name = callee.name?.text;\n if (typeof name !== 'string') {\n return undefined;\n }\n const kind = JAVA_THIS_RETURN_TYPES[name];\n if (kind === undefined) {\n return undefined;\n }\n const checker: any = this.checkerOrUndefined();\n const declaration = checker.getResolvedSignature(node)?.declaration?.resolve();\n const fileName = declaration?.getSourceFile?.().fileName;\n if (typeof fileName !== 'string') {\n return undefined;\n }\n if (!JAVA_THIS_RETURN_TYPES_BASE_FILE.test(fileName) && !JAVA_THIS_RETURN_TYPES_LIB_FILE.test(fileName)) {\n return undefined;\n }\n return kind;\n }\n\n // the Java kind a numeric operand provably prints with: decimal integer literal -> 'long',\n // fractional literal -> 'double', a nested native `+ - * /` -> its kind, a local retyped\n // `Long`/`Double` -> that kind. Hex/binary literals, negatives, calls, untyped locals: undefined.\n javaProvableNumericKind(node, allowDeclaredLocals = true): string | undefined {\n if (node === undefined) {\n return undefined;\n }\n if (node.kind === SyntaxKind.ParenthesizedExpression) {\n return this.javaProvableNumericKind(node.expression, allowDeclaredLocals);\n }\n if (isNumericLiteral(node)) {\n const text = node.text;\n if (/^0[xXbBoO]/.test(text)) {\n return undefined;\n }\n return /[.eE]/.test(text) ? 'double' : 'long';\n }\n if (node.kind === SyntaxKind.Identifier) {\n if (this.javaPrintedIntCounter(node)) {\n return 'int';\n }\n if (allowDeclaredLocals && this.javaLongParameterRead(node) && this.javaNullGuardAdmitsRead(node)) {\n return 'long'; // an unwritten Long core parameter behind a null test\n }\n return allowDeclaredLocals ? this.javaDeclaredNumericLocalKind(node) : undefined;\n }\n if (node.kind === SyntaxKind.CallExpression) {\n // hand-written base accessors that box a primitive (`Long milliseconds()`,\n // `int parseTimeframe(..)`) - never null, so they anchor the native arithmetic\n if (this.javaBaseTimeLongCall(node)) {\n return 'long';\n }\n if (this.javaBaseIntCall(node)) {\n return 'int';\n }\n // indexOf/search print int, Math.round a primitive long (javaPrintedCallKind)\n const printed = this.javaPrintedCallKind(node);\n return (printed === 'int' || printed === 'long') ? printed : undefined;\n }\n if (node.kind === SyntaxKind.BinaryExpression) {\n return this.javaNativeArithmeticKind(node, allowDeclaredLocals);\n }\n if (this.javaLengthIntRead(node)) {\n return 'int';\n }\n return undefined;\n }\n\n // a bare identifier the embedding layer declares `Long`/`Double` prints as a boxed numeric, but a\n // null box would NPE where the helpers return null, so the checker must see a plain non-nullable\n // number here (nullable aliases and `any` excluded; a narrowed `number` is a real guard in Java).\n javaDeclaredNumericLocalKind(node): string | undefined {\n if (!this.javaOperandIsNonNullNumber(node) || !this.javaIdentifierKeepsDeclaredName(node)\n || !this.javaIdentifierPrintsDeclaredName(node)) {\n return undefined;\n }\n const declaration = this.javaDeclarationOfIdentifier(node);\n let javaType;\n if (declaration !== undefined) {\n try {\n javaType = this.javaDeclaredTypeOfDeclaration(declaration);\n } catch (e) {\n javaType = undefined;\n }\n }\n if (javaType === undefined && typeof this.javaExpressionTypeResolver === 'function') {\n try {\n javaType = this.javaExpressionTypeResolver(node);\n } catch (e) {\n javaType = undefined;\n }\n }\n return this.javaDeclaredNumericTypeKind(javaType);\n }\n\n // the numeric kind a printed Java declaration type names, or undefined for every other\n // type (`Object`, `String`, a boxed collection)\n javaDeclaredNumericTypeKind(javaType): string | undefined {\n if (javaType === undefined) {\n return undefined;\n }\n const type = String(javaType).replace(/^final\\s+/, '').trim();\n const kinds = new Map([['Long', 'long'], ['long', 'long'], ['Double', 'double'], ['double', 'double'],\n ['Integer', 'int'], ['int', 'int']]);\n return kinds.get(type);\n }\n\n // the use prints the declaration's own name: a local or parameter the printer renamed\n // (the `finalX` object-literal capture, the async parameter wrapper) prints against a\n // different declaration, whose recorded type does not describe it\n javaIdentifierPrintsDeclaredName(node): boolean {\n try {\n return this.printNode(node, 0) === String(node.text);\n } catch (e) {\n return false;\n }\n }\n\n // a use the printer rewrote to its `finalX` anonymous-class capture prints against its\n // own `Object finalX = x;` local, so the recorded type of the declaration no longer\n // holds (`(finalTime - 8L)` on an Object local does not compile)\n javaIdentifierKeepsDeclaredName(node): boolean {\n const checker: any = this.checkerOrUndefined();\n if (checker === undefined) {\n return false;\n }\n const declaration = checker.getSymbolAtLocation(node)?.valueDeclaration?.resolve();\n if (declaration === undefined || (declaration.kind !== SyntaxKind.VariableDeclaration\n && !isParameterDeclaration(declaration))) {\n return false;\n }\n return String(node.text) === String(declaration.name?.text);\n }\n\n // the checker type is the plain non-nullable `number` (TypeFlags.Number/NumberLiteral, no\n // alias): `Int`/`Num`/`any` and unions hold undefined at runtime, which the helpers absorb\n javaOperandIsNonNullNumber(node): boolean {\n const checker: any = this.checkerOrUndefined();\n if (checker === undefined) {\n return false;\n }\n const type = checker.getTypeAtLocation(node);\n return type !== undefined && type.getAliasSymbol?.() === undefined\n && (type.flags === TypeFlags.Number || type.flags === TypeFlags.NumberLiteral);\n }\n\n // the kind of the native arithmetic this rule prints for `+ - * /`, or undefined when\n // the node keeps the helper. Mirrors printInlineHelperArithmetic operand-for-operand\n // so callers can reason about the printed text of a nested arithmetic operand;\n // `allowDeclaredLocals=false` asks for a kind that does not rely on a retyped local\n // anywhere in the subtree (`+` never consumes one — java-13/14 own Add).\n javaNativeArithmeticKind(node, allowDeclaredLocals = true): string | undefined {\n const op = node?.operatorToken?.kind;\n const isPlus = op === SyntaxKind.PlusToken;\n const isMinus = op === SyntaxKind.MinusToken;\n const isMultiply = op === SyntaxKind.AsteriskToken;\n const isDivide = op === SyntaxKind.SlashToken;\n if (!isPlus && !isMinus && !isMultiply && !isDivide) {\n return undefined;\n }\n if (this.javaScalarFamily(node.left) !== 'number' || this.javaScalarFamily(node.right) !== 'number') {\n return undefined;\n }\n if (isMultiply && this.javaLiteralFractionalProduct(node.left, node.right)) {\n return 'double';\n }\n const childAllows = allowDeclaredLocals && !isPlus;\n const leftKind = this.javaProvableNumericKind(node.left, childAllows);\n const rightKind = this.javaProvableNumericKind(node.right, childAllows);\n return this.javaNativeArithmeticPairKind(isPlus, isMultiply, isDivide, leftKind, rightKind);\n }\n\n // `2 * 1.67`: two decimal literals whose IEEE product is finite and fractional. Helpers.multiply\n // re-boxes only an integral product as Long, so a fractional one is the native double product.\n javaLiteralFractionalProduct(left, right): boolean {\n const value = (node) => ((node !== undefined && isNumericLiteral(node) && !/^0[xXbBoO]/.test(node.text)) ? Number(node.text) : undefined);\n const a = value(left);\n const b = value(right);\n if (a === undefined || b === undefined || (!/[.eE]/.test(left.text) && !/[.eE]/.test(right.text))) {\n return false;\n }\n const product = a * b;\n return Number.isFinite(product) && !Number.isInteger(product);\n }\n\n // the native operator kind for a proven pair, or undefined. The helper's branch IS this operator:\n // `/` is always double division; `-` boxes long for long/long and double otherwise; `*` only on\n // long pairs (multiply re-boxes an integral double product as Long); `+` keeps the equal-kind rule.\n javaNativeArithmeticPairKind(isPlus, isMultiply, isDivide, leftKind, rightKind): string | undefined {\n if (leftKind === undefined || rightKind === undefined) {\n return undefined;\n }\n if (isDivide) {\n return 'double';\n }\n const hasDouble = (leftKind === 'double') || (rightKind === 'double');\n if (isMultiply) {\n return hasDouble ? undefined : 'long';\n }\n if (isPlus) {\n return (leftKind === rightKind) ? leftKind : undefined;\n }\n return hasDouble ? 'double' : 'long';\n }\n\n // ---- ordered comparison over declared numeric locals ----\n // Helpers.isGreaterThan answers its own predicate when an operand is null (GT: a != null && b == null;\n // LT = !GT && !EQ; GE = GT || EQ; LE = LT || EQ), so a Long/Integer/Double box compares natively\n // inside that exact null table. `>` is a toDouble compare for every numeric pair; `>= < <=` also go\n // through isEqual, so they stay native only for integral pairs (no NaN / BigDecimal rounding arm).\n\n // 'long' | 'double' for an operand the printer proves: a primitive-printing expression, or an\n // identifier whose printed declaration is a numeric type (boxed = may be null)\n javaComparisonOperand(node): { kind: string, boxed: boolean } | undefined {\n let inner = node;\n while (inner !== undefined && inner.kind === SyntaxKind.ParenthesizedExpression) {\n inner = inner.expression;\n }\n if (inner === undefined) {\n return undefined;\n }\n const primitive = this.javaPrimitiveOperandKind(inner);\n if (primitive !== undefined) {\n return { kind: primitive === 'double' ? 'double' : 'long', boxed: false };\n }\n if (!isIdentifier(inner) || !this.javaIdentifierPrintsDeclaredName(inner)) {\n return undefined;\n }\n if (this.javaLongParameterRead(inner)) {\n return { kind: 'long', boxed: !this.javaNullGuardAdmitsRead(inner) };\n }\n const declared = this.javaDeclaredNumericFamily(inner);\n if (declared === undefined) {\n return undefined;\n }\n const kind = (declared === 'Double' || declared === 'double') ? 'double' : 'long';\n return { kind, boxed: JAVA_BOXED_NUMERIC_TYPES.has(declared) };\n }\n\n printDeclaredNumericComparison(left, right, op): string | undefined {\n const l = this.javaComparisonOperand(left);\n const r = this.javaComparisonOperand(right);\n if (l === undefined || r === undefined) {\n return undefined;\n }\n if (op !== SyntaxKind.GreaterThanToken && (l.kind !== 'long' || r.kind !== 'long')) {\n return undefined;\n }\n const a = this.printNode(left, 0);\n const b = this.printNode(right, 0);\n const cmp = `${a} ${this.SupportedKindNames[op]} ${b}`;\n if (!l.boxed && !r.boxed) {\n return `(${cmp})`; // a guarded Long parameter unboxes like a primitive\n }\n const aNull = `${a} == null`;\n const aSet = `${a} != null`;\n const bNull = `${b} == null`;\n const bSet = `${b} != null`;\n // each arm below is the helper's null table, with the unreachable nulls folded away\n switch (op) {\n case SyntaxKind.GreaterThanToken:\n return `(${[l.boxed ? aSet : undefined, r.boxed ? `(${bNull} || ${cmp})` : cmp].filter((x) => x !== undefined).join(' && ')})`;\n case SyntaxKind.LessThanToken:\n return `(${[r.boxed ? bSet : undefined, l.boxed ? `(${aNull} || ${cmp})` : cmp].filter((x) => x !== undefined).join(' && ')})`;\n case SyntaxKind.GreaterThanEqualsToken:\n return `(${[r.boxed ? bNull : undefined, l.boxed ? `(${aSet} && ${cmp})` : cmp].filter((x) => x !== undefined).join(' || ')})`;\n case SyntaxKind.LessThanEqualsToken:\n return `(${[l.boxed ? aNull : undefined, r.boxed ? `(${bSet} && ${cmp})` : cmp].filter((x) => x !== undefined).join(' || ')})`;\n }\n return undefined;\n }\n\n // ---- widened native add (`+` only) ----\n // Helpers.add normalizes Integer to Long, boxes Long for integral operands and Double otherwise\n // (null in -> null out), so native `+` over proven numeric non-null operands gives the same box.\n\n // `this.milliseconds()` / `this.seconds()`: the hand-written Java declares both `public Long` over\n // a primitive time value, so the box is never null. Only a signature resolving into the base time\n // mixin or the Date.now lib chain qualifies; an unresolved call or venue override keeps the helper.\n javaBaseTimeLongCall(node) {\n const name = this.javaThisCallName(node);\n if (name !== 'milliseconds' && name !== 'seconds') {\n return false;\n }\n const checker: any = this.checkerOrUndefined();\n const declaration = checker.getResolvedSignature(node)?.declaration?.resolve();\n if (declaration === undefined) {\n return false;\n }\n const fileName = declaration.getSourceFile?.()?.fileName ?? '';\n // `milliseconds = now` where `now = Date.now` (ts/src/base/functions/time.ts) resolves\n // to the Date.now signature inside the typescript lib chain; `seconds` is declared\n // in that same base file.\n return /(^|[\\\\/])ts[\\\\/]src[\\\\/]base[\\\\/]functions[\\\\/]time\\.ts$/.test(fileName)\n || /(^|[\\\\/])lib\\.[^\\\\/]*\\.d\\.ts$/.test(fileName);\n }\n\n // `this.parseTimeframe(..)`: the hand-written java BaseExchange declares `public int\n // parseTimeframe(Object)` (java/lib/.../BaseExchange.java:1513) over the primitive-int\n // ts/src/base/functions/misc.ts arrow, so the call is a never-null Java int. A venue's\n javaBaseIntCall(node) {\n if (this.javaThisCallName(node) !== 'parseTimeframe') {\n return false;\n }\n let declaration;\n try {\n declaration = this.getChecker().getResolvedSignature(node)?.declaration?.resolve();\n } catch (e) {\n declaration = undefined;\n }\n if (declaration === undefined) {\n return false;\n }\n const fileName = declaration.getSourceFile?.()?.fileName ?? '';\n return /(^|[\\\\/])ts[\\\\/]src[\\\\/]base[\\\\/]functions[\\\\/]misc\\.ts$/.test(fileName);\n }\n\n // the method name of a `this.(...)` call, or undefined for any other node\n javaThisCallName(node) {\n const callee = node?.kind === SyntaxKind.CallExpression ? node.expression : undefined;\n if (callee?.kind !== SyntaxKind.PropertyAccessExpression || callee.expression.kind !== SyntaxKind.ThisKeyword) {\n return undefined;\n }\n return callee.name?.text;\n }\n\n // `for (var i = ; ...; i++)`: printForStatement rewrites the emitted\n // `Object i = 0` initializer to `var i = 0`, so javac types the counter int. The\n // counter is widened explicitly by javaPrintWidenedOperand, and no `=`/compound\n javaIntForCounter(node) {\n if (node?.kind !== SyntaxKind.Identifier) {\n return false;\n }\n const symbol = this.getChecker().getSymbolAtLocation(node);\n const declaration = symbol?.valueDeclaration?.resolve();\n if (declaration === undefined || !isVariableDeclaration(declaration)) {\n return false;\n }\n const declarationList = declaration.parent;\n if (declarationList === undefined || !isVariableDeclarationList(declarationList)\n || declarationList.declarations.length !== 1) {\n return false;\n }\n const forStatement: any = declarationList.parent;\n if (forStatement === undefined || forStatement.kind !== SyntaxKind.ForStatement\n || forStatement.initializer !== declarationList) {\n return false;\n }\n if (this.javaIntegerLiteralKind(declaration.initializer) !== 'int') {\n return false;\n }\n return this.javaCounterHasNoBoxWrite(node, symbol);\n }\n\n // no `=`/compound assignment anywhere in the enclosing function writes this counter;\n // `++`/`--` keep the primitive int, any other operator would not\n javaCounterHasNoBoxWrite(node, symbol) {\n let scope = node.parent;\n while (scope !== undefined && !isFunctionLike(scope) && scope.kind !== SyntaxKind.SourceFile) {\n scope = scope.parent;\n }\n if (scope === undefined) {\n return false;\n }\n let safe = true;\n const visit = (current) => {\n if (!safe || current === undefined) {\n return;\n }\n if (isIdentifier(current) && this.getChecker().getSymbolAtLocation(current) === symbol) {\n const parent = current.parent;\n if (parent !== undefined && isBinaryExpression(parent) && parent.left === current\n && JAVA_ASSIGNMENT_OPERATOR_KINDS.has(parent.operatorToken.kind)) {\n safe = false;\n return;\n }\n }\n current.forEachChild(visit);\n };\n scope.forEachChild(visit);\n return safe;\n }\n\n // `x.length` on a String/List receiver prints `((String)x).length()` /\n // `((java.util.List)x).size()` — a Java int on every path printJavaLength takes\n javaLengthIntRead(node) {\n if (node?.kind !== SyntaxKind.PropertyAccessExpression || node.name?.text !== 'length') {\n return false;\n }\n return this.javaLengthKind(node.expression) !== undefined;\n }\n\n // the Java numeric kind of one `+` operand: the literal proofs above plus the\n // non-null base-tier Long accessors, primitive int for-counters and String/List\n // length reads. Undefined keeps the helper.\n javaWidenedNumericKind(node) {\n if (node === undefined) {\n return undefined;\n }\n if (node.kind === SyntaxKind.ParenthesizedExpression) {\n return this.javaWidenedNumericKind(node.expression);\n }\n const literalKind = this.javaIntegerLiteralKind(node);\n if (literalKind !== undefined) {\n return literalKind;\n }\n if (isNumericLiteral(node)) {\n // hex/octal/binary literals keep the helper; fractional/exponent literals are\n // Java doubles and can hold NaN, which the helper's arithmetic propagates\n if (/^0[xXbBoO]/.test(node.text)) {\n return undefined;\n }\n return /[.eE]/.test(node.text) ? 'double' : undefined;\n }\n if (this.javaBaseTimeLongCall(node)) {\n return 'long';\n }\n if (this.javaBaseIntCall(node) || this.javaIntForCounter(node) || this.javaLengthIntRead(node)) {\n return 'int';\n }\n if (node.kind === SyntaxKind.Identifier) {\n // a declared numeric local/parameter (the embedding layer's declaration table,\n // or a native parameter type): an Integer declares as integral, and the helper\n // normalized it to Long anyway\n if (this.javaLongParameterRead(node) && this.javaNullGuardAdmitsRead(node)) {\n return 'long';\n }\n return this.javaDeclaredNumericLocalKind(node);\n }\n if (node.kind === SyntaxKind.BinaryExpression && node.operatorToken.kind === SyntaxKind.PlusToken) {\n return this.javaWidenedAddKind(node);\n }\n // a nested `- * /` keeps the printer's own literal rule (java-18's family)\n return this.javaNativeArithmeticKind(node);\n }\n\n // the kind of a nested native `+` this rule prints, or undefined when it keeps the helper\n javaWidenedAddKind(node) {\n const leftKind = this.javaWidenedNumericKind(node.left);\n const rightKind = this.javaWidenedNumericKind(node.right);\n if (leftKind === undefined || rightKind === undefined) {\n return undefined;\n }\n return (leftKind === 'double' || rightKind === 'double') ? 'double' : 'long';\n }\n\n // the native form of a numeric `+`, or undefined to keep Helpers.add\n printWidenedNativeAdd(left, right, leftText, rightText) {\n const leftKind = this.javaWidenedNumericKind(left);\n const rightKind = this.javaWidenedNumericKind(right);\n if (leftKind === undefined || rightKind === undefined) {\n return undefined;\n }\n const resultKind = (leftKind === 'double' || rightKind === 'double') ? 'double' : 'long';\n const leftOperand = this.javaPrintWidenedOperand(leftKind, resultKind, left, leftText);\n const rightOperand = this.javaPrintWidenedOperand(rightKind, resultKind, right, rightText);\n return `(${leftOperand} + ${rightOperand})`;\n }\n\n // an int operand is widened to long explicitly: `i + 1` would box an Integer where\n // Helpers.add hands back a Long, and an all-int sum wraps where the helper's long\n // does not. Integer literals print long; a Double result needs no widening.\n javaPrintWidenedOperand(kind, resultKind, node, text) {\n if (kind === 'double') {\n return text;\n }\n if (kind === 'long' || isNumericLiteral(node)) {\n return this.javaPrintOperandAsLong(node, text);\n }\n if (resultKind === 'long') {\n return `((long) ${text})`;\n }\n return text;\n }\n\n // true when the receiver's printed Java would be a `cond ? a : b` (a parenthesised\n // conditional): those keep the helper so no added line carries a `?`\n javaSplitTernaryReceiver(node): boolean {\n if (node.kind === SyntaxKind.ParenthesizedExpression) {\n return this.javaSplitTernaryReceiver(node.expression);\n }\n return node.kind === SyntaxKind.ConditionalExpression;\n }\n\n // `s.split ()` -> the printer's own TS-array shape around Java's\n // String.split(Pattern.quote(...)): the plain-string receiver makes the helper's\n // String.valueOf/null branch unreachable and the result stays readable as List.\n javaNativeSplitCall(node, name, parsedArg): string | undefined {\n if (node === undefined || name === undefined || parsedArg === undefined) {\n return undefined;\n }\n const callee = node.expression;\n if (callee === undefined || callee.kind !== SyntaxKind.PropertyAccessExpression) {\n return undefined;\n }\n if (callee.name?.text !== 'split' || node.arguments?.length !== 1) {\n return undefined;\n }\n const receiver = callee.expression;\n const separator = node.arguments[0];\n if (receiver === undefined || !JAVA_SPLIT_RECEIVER_KINDS.has(receiver.kind)) {\n return undefined;\n }\n // a conditional receiver keeps the helper: the campaign's diff audit flags every\n // added line that carries a `?`, and such a line never goes native in this family\n if (this.javaSplitTernaryReceiver(receiver)) {\n return undefined;\n }\n // the separator is a literal: Helpers.split String.valueOf()s it and quotes it as\n // a regex, and a literal is the only separator whose printed Java is a String\n if (separator.kind !== SyntaxKind.StringLiteral\n && separator.kind !== SyntaxKind.NoSubstitutionTemplateLiteral) {\n return undefined;\n }\n if (this.javaScalarFamily(receiver) !== 'string') {\n return undefined;\n }\n return `${this.ARRAY_OPENING_TOKEN}((String)${name}).split(java.util.regex.Pattern.quote(${parsedArg}))${this.ARRAY_CLOSING_TOKEN}`;\n }\n\n // integer literals print as Java `int`; the helpers normalize Integer to Long before\n // the arithmetic, so native integer arithmetic is emitted in long to keep the boxed\n // result identical\n javaPrintOperandAsLong(node, text) {\n if (!isNumericLiteral(node) || /[.eE]/.test(node.text)) {\n return text;\n }\n return /L$/.test(text) ? text : text + 'L';\n }\n\n // the native form of a helper-family binary operator, or undefined to keep the helper\n // `for (var i = ; ...; i++)` prints a primitive `var` counter (see\n // isJavaPrimitiveForCounter). Only ++/-- may write it: any other assignment in the\n // loop would print a different kind into the same slot (D2), so the proof bails.\n javaProvableCounterInt(node) {\n if (!node || node.kind !== SyntaxKind.Identifier) {\n return false;\n }\n const symbol = this.getChecker().getSymbolAtLocation(node);\n const declaration: any = symbol?.valueDeclaration?.resolve() ?? symbol?.declarations?.[0]?.resolve();\n if (!declaration || declaration.kind !== SyntaxKind.VariableDeclaration) {\n return false;\n }\n if (this.javaIntegerLiteralKind(declaration.initializer) !== 'int') {\n return false;\n }\n const list = declaration.parent;\n const forStatement: any = list?.parent;\n if (!forStatement || forStatement.kind !== SyntaxKind.ForStatement || forStatement.initializer !== list) {\n return false;\n }\n const incrementor = forStatement.incrementor;\n if (!incrementor || incrementor.operand?.kind !== SyntaxKind.Identifier\n || incrementor.operand.text !== node.text) {\n return false;\n }\n if (incrementor.kind !== SyntaxKind.PostfixUnaryExpression && incrementor.kind !== SyntaxKind.PrefixUnaryExpression) {\n return false;\n }\n const name = node.text;\n let safe = true;\n const scan = (n) => {\n if (!safe || !n || n === incrementor) {\n return;\n }\n if (n.kind === SyntaxKind.BinaryExpression && JAVA_ASSIGNMENT_OPERATOR_KINDS.has(n.operatorToken.kind)\n && n.left?.kind === SyntaxKind.Identifier && n.left.text === name) {\n safe = false;\n return;\n }\n if ((n.kind === SyntaxKind.PostfixUnaryExpression || n.kind === SyntaxKind.PrefixUnaryExpression)\n && n.operand?.kind === SyntaxKind.Identifier && n.operand.text === name) {\n return;\n }\n n.forEachChild(scan);\n };\n scan(forStatement.statement);\n if (!safe) {\n return false;\n }\n // the enclosing function may not write it either\n let enclosing = forStatement.parent;\n while (enclosing && !isFunctionLike(enclosing)) {\n enclosing = enclosing.parent;\n }\n if (enclosing) {\n const body = enclosing.body ?? enclosing;\n const scanOuter = (n) => {\n if (!safe || !n || n === forStatement || isFunctionLike(n)) {\n return;\n }\n if (n.kind === SyntaxKind.BinaryExpression && JAVA_ASSIGNMENT_OPERATOR_KINDS.has(n.operatorToken.kind)\n && n.left?.kind === SyntaxKind.Identifier && n.left.text === name) {\n safe = false;\n return;\n }\n n.forEachChild(scanOuter);\n };\n scanOuter(body);\n }\n return safe;\n }\n\n printInlineHelperArithmetic(left, right, leftText, rightText, op) {\n const isPlus = op === SyntaxKind.PlusToken || op === SyntaxKind.PlusEqualsToken;\n const isMinus = op === SyntaxKind.MinusToken || op === SyntaxKind.MinusEqualsToken;\n const isMultiply = op === SyntaxKind.AsteriskToken;\n const isDivide = op === SyntaxKind.SlashToken;\n const isMod = op === SyntaxKind.PercentToken;\n if (!isPlus && !isMinus && !isMultiply && !isDivide && !isMod) {\n return undefined;\n }\n const leftFamily = this.javaScalarFamily(left);\n const rightFamily = this.javaScalarFamily(right);\n if (isPlus && this.javaStringConcatIsProvable(left, right, leftFamily, rightFamily)) {\n const concat = `(${leftText} + ${rightText})`;\n return op === SyntaxKind.PlusEqualsToken ? `${leftText} = ${concat}` : concat;\n }\n // compound assignments keep the helper: the left side is a local the printer\n // declares Object, so the native operator would not compile\n if (op === SyntaxKind.PlusEqualsToken || op === SyntaxKind.MinusEqualsToken) {\n return undefined;\n }\n // `this.milliseconds() - `: the hand-written base call hands back\n // a Long, and Helpers.subtract's Long - Long branch is plain long arithmetic with\n // the same box (Helpers.java), so the helper drops when the right side is long too\n if (op === SyntaxKind.MinusToken) {\n const anchoredKind = this.javaThisCallNumericKind(left);\n if (anchoredKind === 'long' && this.javaProvableNumericKind(right) === 'long') {\n return `(${leftText} - ${this.javaPrintOperandAsLong(right, rightText)})`;\n }\n }\n if (leftFamily !== 'number' || rightFamily !== 'number') {\n return undefined;\n }\n if (op === SyntaxKind.PlusToken) {\n // the widened rule: literals + the non-null numeric proofs this printer owns\n return this.printWidenedNativeAdd(left, right, leftText, rightText);\n }\n if (isMod) {\n // Helpers.mod normalizes both operands to double and returns their double\n // remainder: the same value once both operands print as a non-null Java number\n if (!this.javaProvableNumericDoubleOperand(left) || !this.javaProvableNumericDoubleOperand(right)) {\n return undefined;\n }\n return `(((double) ${leftText}) % ((double) ${rightText}))`;\n }\n if (isMultiply && this.javaLiteralFractionalProduct(left, right)) {\n return `(${leftText} * ${rightText})`;\n }\n // `+` keeps phase-1's literal-only rule (java-13/14 own Add): its operands must not\n // derive from a retyped local anywhere below\n const childAllows = !isPlus;\n const leftKind = this.javaProvableNumericKind(left, childAllows);\n const rightKind = this.javaProvableNumericKind(right, childAllows);\n const pairKind = this.javaNativeArithmeticPairKind(isPlus, isMultiply, isDivide, leftKind, rightKind);\n if (pairKind === undefined) {\n return undefined;\n }\n if (isDivide) {\n // TS `/` is always float division and Helpers.divide never returns a long\n return `(((double) ${leftText}) / ((double) ${rightText}))`;\n }\n const operator = isPlus ? '+' : (isMinus ? '-' : '*');\n const widenedLeft = this.javaPrintArithmeticOperand(leftKind, left, leftText);\n const widenedRight = this.javaPrintArithmeticOperand(rightKind, right, rightText);\n return `(${widenedLeft} ${operator} ${widenedRight})`;\n }\n\n // an Integer/int operand is widened to long before the operator: Helpers normalizes an\n // Integer to Long first, so the native long arithmetic reproduces both the value (no\n // int-width wrap) and the Long box the helper hands back\n javaPrintArithmeticOperand(kind, node, text) {\n if (kind === 'int') {\n return `((long) ${text})`;\n }\n return this.javaPrintOperandAsLong(node, text);\n }\n\n // Helpers.mathMin/mathMax take Object, tolerate null and return the ORIGINAL box; Math.min/max take\n // primitives, so the native call needs both operands primitive of one family: literals, `for`\n // counters, `.length`/`.size()`, native long arithmetic; the only NaN-free double is a literal.\n javaNativeMathMinMaxOperandKind(node) {\n if (this.javaIntegerLiteralKind(node) !== undefined || this.isJavaPrimitiveForCounter(node)\n || (isPropertyAccessExpression(node) && node.name.text === 'length'\n && this.javaLengthKind(node.expression) !== undefined)) {\n return 'integral';\n }\n if (isNumericLiteral(node)) {\n return this.javaProvableNumericKind(node) === 'double' ? 'double' : undefined;\n }\n return this.javaProvableNumericKind(node) === 'long' ? 'integral' : undefined;\n }\n\n // a primitive has no members, so a receiver position (and the printer's cast wrappers) keep the\n // helper - every other position boxes the primitive exactly like the helper's own box (Jackson,\n // isEqual and toString all read an Integer and a Long the same way)\n javaNativeMathMinMaxResultIsPlainValue(node) {\n let parent = node.parent;\n while (parent !== undefined && isParenthesizedExpression(parent)) {\n parent = parent.parent;\n }\n if (parent === undefined) {\n return false;\n }\n if ((isPropertyAccessExpression(parent) || isElementAccessExpression(parent)\n || isCallExpression(parent)) && parent.expression === node) {\n return false;\n }\n return parent.kind !== SyntaxKind.AsExpression\n && parent.kind !== SyntaxKind.TypeAssertionExpression\n && parent.kind !== SyntaxKind.NonNullExpression;\n }\n\n // the native form of Math.min/Math.max, or undefined to keep the helper\n printNativeMathMinMax(node, left, right, leftText, rightText, name) {\n if (!this.javaNativeMathMinMaxResultIsPlainValue(node)) {\n return undefined;\n }\n const kind = this.javaNativeMathMinMaxOperandKind(left);\n if (kind === undefined || kind !== this.javaNativeMathMinMaxOperandKind(right)) {\n return undefined;\n }\n return `Math.${name}(${leftText}, ${rightText})`;\n }\n\n // ---- helper-family inlining: `parseInt/parseFloat/toString/padStart` ----\n // parseInt catches NumberFormatException into null, parseFloat into 0.0, Helpers.toString maps\n // null to null, Helpers.padStart truncates: native form only where the fallback is unreachable.\n\n // `Helpers.toString(x)` is `x == null ? null : x.toString()`, so `String.valueOf(x)`\n // is exact for every argument that cannot be null. Only a numeric literal or a\n // nested `+ - * /` this rule prints natively qualifies: both are Java primitives.\n javaStringBoxText(node, text) {\n return this.javaProvableNumericKind(node) !== undefined ? `String.valueOf(${text})` : `Helpers.toString(${text})`;\n }\n\n // The runtime uses Long.parseLong (parseInt) / Double.parseDouble (parseFloat) inside a catch; a\n // literal the native parser ACCEPTS cannot reach the catch, so the native call cannot change the\n // answer (parseInt additionally needs the value in long range, else the helper answers null).\n javaScalarParseAccepts(callee, text) {\n if (callee === 'parseInt') {\n if (!/^[+-]?[0-9]+$/.test(text)) {\n return false;\n }\n const value = BigInt(text.replace(/^\\+/, ''));\n return value >= BigInt('-9223372036854775808') && value <= BigInt('9223372036854775807');\n }\n // Double.parseDouble's grammar minus the suffix forms; NaN/Infinity are parsed\n // by both, whitespace and hex floats by neither of the two the same way.\n return /^[+-]?([0-9]+(\\.[0-9]*)?|\\.[0-9]+)([eE][+-]?[0-9]+)?$/.test(text)\n || /^[+-]?Infinity$/.test(text)\n || text === 'NaN';\n }\n\n // `parseInt(x)` / `parseFloat(x)` -> the native parse, or undefined to keep the helper\n printNativeScalarParse(node, callee) {\n const args = node?.arguments;\n if (args === undefined || args.length !== 1 || !isStringLiteral(args[0])) {\n return undefined;\n }\n if (!this.javaScalarParseAccepts(callee, args[0].text)) {\n return undefined;\n }\n const nativeName = callee === 'parseInt' ? 'Long.parseLong' : 'Double.parseDouble';\n return `${nativeName}(${this.printNode(args[0], 0)})`;\n }\n\n // The printed receiver of a `padStart` this rule can inline: already cast (`((String)x)`) by the\n // printer or the ccxt local-typing pass, or the checker proves a plain TS string, so the accessor\n // cast this rule adds cannot fire.\n javaPadStartReceiverText(receiver, name) {\n if (/^\\(+\\(String\\)/.test(name)) {\n return name;\n }\n if (this.javaScalarFamily(receiver) === 'string') {\n return `((String)${name})`;\n }\n return undefined;\n }\n\n // `x.padStart(n, 'c')` with a non-negative integer literal length and single-char literal pad.\n // Helpers.padStart pads then answers the LAST `n` chars, so the native form keeps both halves:\n // String.format builds the pad from an empty `%s` and the >= arm reproduces the truncation.\n printNativePadStart(node, name) {\n const args = node?.arguments;\n if (args === undefined || args.length !== 2 || name === undefined) {\n return undefined;\n }\n if (this.javaIntegerLiteralKind(args[0]) !== 'int' || !/^[0-9]+$/.test(args[0].text)) {\n return undefined;\n }\n if (!isStringLiteral(args[1]) || args[1].text.length === 0) {\n return undefined;\n }\n const receiver = node.expression?.expression;\n if (!this.sideEffectFreeReceiver(receiver)) {\n return undefined;\n }\n const receiverText = this.javaPadStartReceiverText(receiver, name);\n if (receiverText === undefined) {\n return undefined;\n }\n const length = args[0].text;\n const pad = `'${this.javaCharLiteral(args[1].text[0])}'`;\n const lengthCall = `${receiverText}.length()`;\n return `(${lengthCall} >= ${length} ? ${receiverText}.substring(${lengthCall} - ${length})`\n + ` : String.format(\"%\" + (${length} - ${lengthCall}) + \"s\", \"\").replace(' ', ${pad}) + ${receiverText})`;\n }\n\n // one char literal for the `String.format(...).replace(' ', c)` pad, escaped\n javaCharLiteral(character) {\n if (character === \"'\" || character === '\\\\') {\n return `\\\\${character}`;\n }\n return character;\n }\n\n // ---- typed locals for native arithmetic ----\n // A local whose initializer prints as native arithmetic holds a String / Long / Double box, so the\n // declaration carries that type; every other use is scanned first (D2) as it changes resolution.\n\n javaUnwrapParentheses(node) {\n let current = node;\n while (current?.kind === SyntaxKind.ParenthesizedExpression) {\n current = current.expression;\n }\n return current;\n }\n\n // the Java type of the native arithmetic this printer prints for a `+ - * / +=`\n // node, or undefined when the node keeps the helper (its printed value is an\n // Object box). Mirrors printInlineHelperArithmetic operand-for-operand.\n javaNativeArithmeticType(node) {\n const value = this.javaUnwrapParentheses(node);\n if (value?.kind !== SyntaxKind.BinaryExpression) {\n return undefined;\n }\n const op = value.operatorToken.kind;\n if (op === SyntaxKind.PlusToken && this.javaNativeConcat(value)) {\n return 'String';\n }\n if (op === SyntaxKind.PlusEqualsToken) {\n // the inlined `x = (x + y)` shape needs the same operand pair the concat\n // branch of printInlineHelperArithmetic needs\n const isStringPair = this.javaScalarFamily(value.left) === 'string'\n && this.javaScalarFamily(value.right) === 'string'\n && (this.javaProvableString(value.left) || this.javaProvableString(value.right));\n return isStringPair ? 'String' : undefined;\n }\n const kind = this.javaNativeArithmeticKind(value);\n return kind === 'long' ? 'Long' : (kind === 'double' ? 'Double' : undefined);\n }\n\n // the enclosing function-like node: the D2 scan scope of a typed local\n javaEnclosingFunction(node) {\n let current = node?.parent;\n while (current !== undefined) {\n const kind = current.kind;\n if (kind === SyntaxKind.MethodDeclaration || kind === SyntaxKind.FunctionDeclaration\n || kind === SyntaxKind.FunctionExpression || kind === SyntaxKind.ArrowFunction\n || kind === SyntaxKind.GetAccessor || kind === SyntaxKind.SetAccessor\n || kind === SyntaxKind.Constructor) {\n return current;\n }\n current = current.parent;\n }\n return undefined;\n }\n\n // a reassignment may keep the narrowed declaration only when its printed value is the\n // same Java type (the helper's box stays an Object, so it keeps the box)\n javaArithmeticWriteIsSafe(right, javaType) {\n const value = this.javaUnwrapParentheses(right);\n if (value === undefined) {\n return false;\n }\n if (value.kind === SyntaxKind.NullKeyword) {\n return true; // `null` is assignable to every box\n }\n if (value.kind === SyntaxKind.Identifier && value.text === 'undefined') {\n return true;\n }\n return (javaType === 'String' && (value.kind === SyntaxKind.StringLiteral\n || value.kind === SyntaxKind.NoSubstitutionTemplateLiteral))\n || this.javaNativeArithmeticType(value) === javaType;\n }\n\n // the innermost block that scopes a declaration (Java locals live to the end of\n // their block; sibling blocks may reuse the name, nested ones may not)\n javaScopingBlock(node) {\n let current = node?.parent;\n let last = undefined;\n while (current !== undefined) {\n if (current.kind === SyntaxKind.Block || current.kind === SyntaxKind.SourceFile) {\n return current;\n }\n last = current;\n current = current.parent;\n }\n return last;\n }\n\n javaNodeContains(outer, inner) {\n return outer !== undefined && inner !== undefined && outer.pos <= inner.pos && inner.end <= outer.end;\n }\n\n // two same-named bindings may both keep their own printed type only in disjoint\n // blocks: a nested one would already be an illegal Java shadowing of the Object\n // declaration the corpus compiles with\n javaBindingsAreDisjoint(declaration, other) {\n const mine = this.javaScopingBlock(declaration);\n const theirs = this.javaScopingBlock(other);\n if (mine === undefined || theirs === undefined) {\n return false;\n }\n return !this.javaNodeContains(mine, theirs) && !this.javaNodeContains(theirs, mine);\n }\n\n // is this occurrence of the local compatible with the narrowed declaration?\n javaArithmeticLocalUseIsSafe(node, declaration, javaType) {\n const parent = node.parent;\n if (parent === undefined) {\n return false;\n }\n if ((parent.kind === SyntaxKind.PropertyAccessExpression || parent.kind === SyntaxKind.PropertyAssignment)\n && parent.name === node) {\n return true; // a member name, not a use of the local\n }\n if ((parent.kind === SyntaxKind.VariableDeclaration || parent.kind === SyntaxKind.Parameter\n || parent.kind === SyntaxKind.BindingElement) && parent.name === node) {\n // a second binding of the same source name: only a disjoint sibling block may\n // keep its own type (no shadowing of the narrowed declaration)\n return this.javaBindingsAreDisjoint(declaration, parent);\n }\n if (parent.kind === SyntaxKind.PostfixUnaryExpression || parent.kind === SyntaxKind.PrefixUnaryExpression) {\n return false; // ++/--/-x/+x print an unboxing or primitive operator\n }\n if (parent.kind === SyntaxKind.SpreadElement || parent.kind === SyntaxKind.DeleteExpression\n || parent.kind === SyntaxKind.ForOfStatement || parent.kind === SyntaxKind.ForInStatement) {\n return false;\n }\n if (parent.kind === SyntaxKind.TypeOfExpression) {\n // prints \\`x instanceof String\\`, the same test the Object declaration printed\n return javaType === 'String';\n }\n if (parent.kind === SyntaxKind.AsExpression || parent.kind === SyntaxKind.TypeAssertionExpression) {\n // \\`x as string\\` prints the identity ((String) x); any other asserted type\n // prints a cast the narrower declaration cannot satisfy\n return javaType === 'String' && parent.type?.kind === SyntaxKind.StringKeyword;\n }\n if (parent.kind === SyntaxKind.ConditionalExpression) {\n // a numeric arm next to a numeric arm makes the conditional numeric and javac\n // unboxes it (an NPE where the Object declaration carried null)\n return javaType === 'String';\n }\n if (parent.kind === SyntaxKind.ElementAccessExpression && parent.expression === node) {\n const grand = parent.parent;\n if (grand?.kind === SyntaxKind.DeleteExpression) {\n return false;\n }\n if (grand?.kind === SyntaxKind.BinaryExpression && grand.left === parent\n && JAVA_ASSIGNMENT_OPERATOR_KINDS.has(grand.operatorToken.kind)) {\n return false; // `x[k] = v` prints a receiver cast the box cannot satisfy\n }\n }\n if (parent.kind === SyntaxKind.ArrayLiteralExpression) {\n const grand = parent.parent;\n if (grand?.kind === SyntaxKind.BinaryExpression && grand.left === parent\n && JAVA_ASSIGNMENT_OPERATOR_KINDS.has(grand.operatorToken.kind)) {\n return false; // `[x, y] = f()` prints a destructuring write into the local\n }\n }\n if (parent.kind === SyntaxKind.BinaryExpression && parent.left === node) {\n const op = parent.operatorToken.kind;\n if (op === SyntaxKind.EqualsToken) {\n return this.javaArithmeticWriteIsSafe(parent.right, javaType);\n }\n if (op === SyntaxKind.PlusEqualsToken) {\n // `x += y` prints a native `x = (x + y)` or the Object-typed helper\n return this.javaNativeArithmeticType(parent) === javaType;\n }\n if (JAVA_ASSIGNMENT_OPERATOR_KINDS.has(op)) {\n return false; // every other compound assignment writes a helper result\n }\n if (op === SyntaxKind.PlusToken && javaType === 'String') {\n // the overload trap: once the local is String, a printed Helpers.add(local, y)\n // binds add(String, Object) instead of add(Object, Object), and the two\n // diverge for a non-string y. A printed native concat has no helper call.\n return this.javaNativeArithmeticType(parent) === 'String';\n }\n }\n return true;\n }\n\n // D2: the narrowed declaration needs every later use of the local in the enclosing\n // function to still compile and resolve the way the Object declaration did\n javaArithmeticLocalIsSafeToType(scope, declaration, javaType) {\n if (scope === undefined) {\n return false;\n }\n const sourceName = declaration.name.text;\n let safe = true;\n const visit = (n) => {\n if (!safe) {\n return;\n }\n if (n.kind === SyntaxKind.Identifier && n.text === sourceName && n !== declaration.name) {\n if (!this.javaArithmeticLocalUseIsSafe(n, declaration, javaType)) {\n safe = false;\n return;\n }\n }\n n.forEachChild(visit);\n };\n scope.forEachChild(visit);\n return safe;\n }\n\n // the Java type a declaration can carry because its initializer prints as native\n // arithmetic, or undefined to keep the Object declaration\n javaArithmeticLocalType(declaration) {\n if (!isIdentifier(declaration.name) || declaration.initializer === undefined) {\n return undefined;\n }\n const javaType = this.javaNativeArithmeticType(declaration.initializer);\n if (javaType === undefined) {\n return undefined;\n }\n const scope = this.javaEnclosingFunction(declaration);\n return this.javaArithmeticLocalIsSafeToType(scope, declaration, javaType)\n ? javaType : undefined;\n }\n\n // an operand `(double) ` can be applied to without changing what Helpers.mod\n // computes: a numeric literal or a native arithmetic node (javaProvableNumericKind,\n // already printed as a java number) or a primitive int loop counter\n javaProvableNumericDoubleOperand(node) {\n return this.javaProvableNumericKind(node) !== undefined || this.javaProvableCounterInt(node);\n }\n\n getFinalVarName(varName: string): string {\n varName = this.getOriginalVarName(varName);\n if (varName.startsWith('final')) {\n return varName;\n }\n return `final${this.capitalize(varName)}`;\n }\n\n getOriginalVarName(name: string): string {\n if (this.ReservedKeywordsReplacements[name]) {\n name = this.ReservedKeywordsReplacements[name];\n }\n return name;\n }\n\n // Resolves the trio of names used to wrap a reassigned async-method param\n // so the lambda body sees an effectively-final local. We base every name on\n // the keyword-remapped Java identifier — using the raw TS name when remapped\n // (e.g. params -> parameters) makes the wrapper text and the body diverge,\n // because identifier emission already routes through ReservedKeywordsReplacements.\n private getAsyncParamWrapperNames(paramName: string): { sigName: string; snapName: string; localName: string } {\n const javaName = this.getOriginalVarName(paramName);\n return {\n sigName: `${javaName}2`,\n snapName: `${javaName}3`,\n localName: javaName,\n };\n }\n\n private isAssignmentOperator(op: SyntaxKind): boolean {\n return op >= SyntaxKind.FirstAssignment && op <= SyntaxKind.LastAssignment;\n }\n\n private isIncDecOperator(op: SyntaxKind): boolean {\n return op === SyntaxKind.PlusPlusToken || op === SyntaxKind.MinusMinusToken;\n }\n\n // Walk the function body in source order and assign a version-aware finalName to\n // every identifier that appears inside an object literal property and refers to a\n // variable that's reassigned anywhere in this function. Each reassignment bumps the\n // per-variable version counter; usages of the same (var, version) share one finalName.\n //\n // Naming:\n // - If only one version of a var is ever used in object literals, use `final`\n // (matches prior behavior).\n // - If multiple versions are used, name them `final`, `final_2`,\n // `final_3` in source-order of the version they correspond to.\n analyzeFinalVars(fnBody: Node): void {\n this.usageToFinalName = new WeakMap();\n if (!fnBody) return;\n\n // Symbol identity: two identifiers are the same lexical variable iff they\n // resolve to the same declaration. This differentiates e.g. `i` in two\n // sibling for-loops (separate `let i` declarations = separate symbols).\n const symbolIdOf = (n: any): string => {\n try {\n const checker = this.getChecker();\n const sym = checker?.getSymbolAtLocation?.(n);\n const decl = sym?.declarations?.[0]?.resolve() ?? sym?.valueDeclaration?.resolve();\n if (decl) return `s:${decl.pos}:${decl.end}`;\n } catch {\n // checker may be unavailable in some contexts — fall through to name-based id\n }\n return `n:${n.text}`;\n };\n\n // Pass 1 — discover which symbols the printer will treat as reassigned.\n //\n // The printer's `printCustomBinaryExpressionIfAny` sets\n // `ReassignedVars[varKey] = true` for the LEFT identifier of *every*\n // BinaryExpression — not just assignment operators. So `timestamp + '#'`\n // or `x === 5` will both flag `timestamp`/`x` later during emit, even\n // though they're plain reads syntactically. The printer's substitution\n // path then uses ReassignedVars as a fallback trigger for the finalXxx\n // rewrite, so a literal capturing such an identifier ends up referring\n // to `finalTimestamp` even when the analyzer thinks the symbol isn't\n // reassigned.\n //\n // If the analyzer disagrees with the printer here, the printer's\n // fallback substitution uses the un-suffixed base name for *every* use\n // (including in sibling if/else branches), and any environment with\n // ancestor-scope dedup leak will suppress one of the two declarations.\n //\n // Mirror the printer's over-broad heuristic in the analyzer so the\n // version-bump machinery (a5c2036 / ac618b0 / 48a1786) can assign\n // distinct names to sibling and post-block uses.\n const reassignedSyms = new Set();\n const discoverPotentialReassignments = (node: any) => {\n if (!node) return;\n if (node.kind === SyntaxKind.BinaryExpression) {\n if (node.left?.kind === SyntaxKind.Identifier) {\n // Mirror printCustomBinaryExpressionIfAny: any BinaryExpression\n // with an Identifier left flags it, regardless of operator.\n reassignedSyms.add(symbolIdOf(node.left));\n } else if (\n node.operatorToken.kind === SyntaxKind.EqualsToken &&\n node.left?.kind === SyntaxKind.ArrayLiteralExpression\n ) {\n // Tuple destructuring assignment: `[a, b] = expr`. The printer's\n // ArrayLiteralExpression branch in printCustomBinaryExpressionIfAny\n // flags each Identifier element in ReassignedVars, so mirror it\n // here for version-bump coverage.\n for (const elem of node.left.elements ?? []) {\n if (elem?.kind === SyntaxKind.Identifier) {\n reassignedSyms.add(symbolIdOf(elem));\n }\n }\n }\n }\n if ((node.kind === SyntaxKind.PrefixUnaryExpression ||\n node.kind === SyntaxKind.PostfixUnaryExpression) &&\n this.isIncDecOperator(node.operator) &&\n node.operand?.kind === SyntaxKind.Identifier) {\n reassignedSyms.add(symbolIdOf(node.operand));\n }\n // Cross-call / cross-method state leak: ReassignedVars accumulates\n // across transpile calls and earlier-printed methods in the same\n // class+method context, so a var declared `const` in this function\n // body may still be flagged from a prior context. The printer's\n // substitution path consults ReassignedVars as a fallback; if the\n // analyzer disagrees, version-bump can't apply and sibling if/else\n // branches end up with the same base name.\n if (node.kind === SyntaxKind.Identifier) {\n const name = node.text as string | undefined;\n if (name && name !== 'undefined' && !name.startsWith?.('null')) {\n if (this.ReassignedVars[this.getVarKey(node)]) {\n reassignedSyms.add(symbolIdOf(node));\n }\n }\n return;\n }\n node.forEachChild(discoverPotentialReassignments);\n };\n discoverPotentialReassignments(fnBody);\n\n if (reassignedSyms.size === 0) return;\n\n // Pass 2 — walk in source order, producing a stream of reassignment and usage\n // events keyed by symbol. Usages are identifiers that (a) sit inside an\n // object literal property initializer expression, (b) refer to a reassigned symbol.\n type Event =\n | { kind: 'reassign'; sym: string }\n | { kind: 'use'; sym: string; name: string; node: Node };\n const events: Event[] = [];\n\n const visitExprInObjLit = (n: any) => {\n if (!n) return;\n if (n.kind === SyntaxKind.Identifier) {\n const name = n.text as string;\n if (name && name !== 'undefined' && !name.startsWith?.('null')) {\n const sym = symbolIdOf(n);\n if (reassignedSyms.has(sym)) {\n events.push({ kind: 'use', sym, name, node: n });\n }\n }\n return;\n }\n if (n.kind === SyntaxKind.BinaryExpression) {\n visitExprInObjLit(n.left);\n visitExprInObjLit(n.right);\n return;\n }\n if (n.kind === SyntaxKind.ParenthesizedExpression) {\n visitExprInObjLit(n.expression);\n return;\n }\n if (n.kind === SyntaxKind.ConditionalExpression) {\n visitExprInObjLit(n.condition);\n visitExprInObjLit(n.whenTrue);\n visitExprInObjLit(n.whenFalse);\n return;\n }\n if (n.kind === SyntaxKind.CallExpression) {\n n.arguments?.forEach(visitExprInObjLit);\n if (n.expression?.kind === SyntaxKind.PropertyAccessExpression) {\n visitExprInObjLit(n.expression.expression);\n }\n return;\n }\n if (n.kind === SyntaxKind.PrefixUnaryExpression) {\n visitExprInObjLit(n.operand);\n return;\n }\n if (n.kind === SyntaxKind.ElementAccessExpression) {\n let left = n.expression;\n while (left?.kind === SyntaxKind.ElementAccessExpression) {\n left = left.expression;\n }\n visitExprInObjLit(left);\n visitExprInObjLit(n.argumentExpression);\n return;\n }\n if (n.kind === SyntaxKind.ObjectLiteralExpression) {\n n.properties?.forEach((p: any) => {\n if (p.initializer) visitExprInObjLit(p.initializer);\n });\n return;\n }\n // Fallback for any other expression kind (ArrayLiteralExpression,\n // SpreadElement, TemplateExpression, AsExpression, NonNullExpression,\n // PropertyAccessExpression, TypeAssertion, etc.) — descend uniformly\n // so identifiers nested inside `[rawHash]`, `{...x}`, `` `${x}` ``, and\n // so on are still tagged. ObjectLiteralExpression is handled above so\n // it doesn't fall through to the generic descent (which would re-walk\n // the same prop initializers and double-count).\n n.forEachChild(visitExprInObjLit);\n };\n\n const walk = (node: any) => {\n if (!node) return;\n\n if (node.kind === SyntaxKind.BinaryExpression &&\n this.isAssignmentOperator(node.operatorToken.kind)) {\n walk(node.right);\n if (node.left?.kind === SyntaxKind.Identifier) {\n const sym = symbolIdOf(node.left);\n if (reassignedSyms.has(sym)) {\n events.push({ kind: 'reassign', sym });\n }\n } else {\n walk(node.left);\n }\n return;\n }\n\n if ((node.kind === SyntaxKind.PrefixUnaryExpression ||\n node.kind === SyntaxKind.PostfixUnaryExpression) &&\n this.isIncDecOperator(node.operator) &&\n node.operand?.kind === SyntaxKind.Identifier) {\n const sym = symbolIdOf(node.operand);\n if (reassignedSyms.has(sym)) {\n events.push({ kind: 'reassign', sym });\n }\n return;\n }\n\n if (node.kind === SyntaxKind.ObjectLiteralExpression) {\n node.properties?.forEach((prop: any) => {\n if (prop.initializer) {\n visitExprInObjLit(prop.initializer);\n walk(prop.initializer);\n }\n });\n return;\n }\n\n // If/else branches introduce sibling scopes for declarations inside\n // them. Without intervention, the analyzer assigns the same per-symbol\n // version to uses across siblings and to uses after the branch.\n // Java permits sibling-scope name reuse when the inner block has\n // popped, but ancestor-scope dedup in buildFinalVarDeclarations +\n // any scope tracking leak in the consumer environment can suppress\n // the outer declaration, leaving an undeclared reference.\n //\n // The helper below records 'use' events inside a sub-block and emits\n // a phantom reassign on exit for every symbol used inside, so each\n // region gets a distinct per-symbol version → distinct finalXxx name.\n const walkBlockAndBump = (subNode: Node | undefined): Set => {\n const usedInBlock = new Set();\n if (!subNode) return usedInBlock;\n const eventsBefore = events.length;\n walk(subNode);\n for (let i = eventsBefore; i < events.length; i++) {\n const e = events[i];\n if (e.kind === 'use') usedInBlock.add(e.sym);\n }\n for (const sym of usedInBlock) {\n events.push({ kind: 'reassign', sym });\n }\n return usedInBlock;\n };\n\n if (node.kind === SyntaxKind.IfStatement) {\n walk(node.expression);\n walkBlockAndBump(node.thenStatement);\n walkBlockAndBump(node.elseStatement);\n // After walking either branch we've already bumped for every\n // symbol used inside it, so post-if uses naturally land on a\n // version higher than either branch's uses.\n return;\n }\n\n // try / catch / finally: catch is a sibling scope to try; finally\n // executes after both. Treat each block the same way as if/else\n // branches so captures across them get distinct snapshot names.\n if (node.kind === SyntaxKind.TryStatement) {\n walkBlockAndBump(node.tryBlock);\n walkBlockAndBump(node.catchClause?.block);\n walkBlockAndBump(node.finallyBlock);\n return;\n }\n\n node.forEachChild(walk);\n };\n\n walk(fnBody);\n\n // Post-process: compute per-symbol versions and assign final names. The\n // final name is derived from the identifier's text, not the symbol — so\n // two distinct symbols named `i` both get `finalI` (each lives in its own\n // lexical scope, so scope-stack dedup allows both to be emitted).\n const counters = new Map();\n const perSym = new Map }>();\n for (const e of events) {\n if (e.kind === 'reassign') {\n counters.set(e.sym, (counters.get(e.sym) ?? 0) + 1);\n } else {\n const v = counters.get(e.sym) ?? 0;\n if (!perSym.has(e.sym)) perSym.set(e.sym, { name: e.name, byVer: new Map() });\n const entry = perSym.get(e.sym)!;\n if (!entry.byVer.has(v)) entry.byVer.set(v, []);\n entry.byVer.get(v)!.push(e.node);\n }\n }\n\n for (const { name, byVer } of perSym.values()) {\n const versions = [...byVer.keys()].sort((a, b) => a - b);\n const baseName = this.getFinalVarName(name);\n versions.forEach((v, idx) => {\n const finalName = idx === 0 ? baseName : `${baseName}_${idx + 1}`;\n for (const n of byVer.get(v)!) {\n this.usageToFinalName.set(n, finalName);\n }\n });\n }\n }\n\n // Undo every in-place identifier rewrite made during the current emit, newest\n // first so repeated rewrites of one node unwind to the original value.\n restoreFinalVarMutations(): void {\n for (let i = this.finalVarMutations.length - 1; i >= 0; i--) {\n const mutation = this.finalVarMutations[i];\n Object.defineProperty(mutation.node, 'text', { value: mutation.text, configurable: true, writable: true });\n if (mutation.ownGetFullText) {\n mutation.node.getFullText = mutation.getFullText;\n } else {\n delete mutation.node.getFullText;\n }\n }\n this.finalVarMutations = [];\n }\n\n printNode(node, identation = 0): string {\n if (node && node.kind === SyntaxKind.SourceFile) {\n // Everything below influences emitted text and outlives a single\n // transpile call (the transpiler instance and the parsed SourceFile are\n // both reused), so reset it per file: an emit must not be able to tell\n // whether it is the first or the tenth for the same input.\n this.restoreFinalVarMutations();\n this.ReassignedVars = {};\n this.varListFromObjectLiterals = {};\n this.usageToFinalName = new WeakMap();\n this.finalVarScopeStack = [];\n try {\n return super.printNode(node, identation);\n } finally {\n this.restoreFinalVarMutations();\n }\n }\n return super.printNode(node, identation);\n }\n\n // true when a property value reads a local the body reassigns (or the analyzer saw\n // reassigned ahead): a double-brace anonymous class could not capture it\n objectLiteralCapturesReassigned(node): boolean {\n return this.objectLiteralCapturedKeys(node).length > 0;\n }\n\n // ReassignedVars keys of the reassigned locals a literal's property values read\n objectLiteralCapturedKeys(node): string[] {\n const keys: string[] = [];\n const walk = (n) => {\n if (!n) return;\n if (n.kind === SyntaxKind.Identifier) {\n const name = n.text as string | undefined;\n const key = this.getVarKey(n);\n if (name && name !== 'undefined' && !name.startsWith('null') &&\n (this.usageToFinalName.has(n) || this.ReassignedVars[key])) {\n keys.push(key);\n }\n return;\n }\n n.forEachChild(walk);\n };\n for (const prop of node.properties) {\n walk(prop.initializer);\n }\n return keys;\n }\n\n printVariableDeclarationList(node, identation) {\n const declaration = node.declarations[0];\n\n if (\n this.removeVariableDeclarationForFunctionExpression &&\n declaration?.initializer &&\n isFunctionExpression(declaration.initializer)\n ) {\n return this.printNode(declaration.initializer, identation).trimEnd();\n }\n\n // array destructuring in variable declaration\n if (declaration?.name.kind === SyntaxKind.ArrayBindingPattern) {\n const arrayBindingPattern = declaration.name;\n const arrayBindingPatternElements = arrayBindingPattern.elements;\n const parsedArrayBindingElements = arrayBindingPatternElements.map((e) =>\n this.printNode(e.name, 0)\n );\n const syntheticName = parsedArrayBindingElements.join(\"\") + \"Variable\";\n\n const arrayBindingStatement =\n `${this.getIden(identation)}var ${syntheticName} = ${this.printNode(\n declaration.initializer,\n 0\n )};\\n`;\n\n return arrayBindingStatement + parsedArrayBindingElements.map((e, index) =>\n this.getIden(identation) + `var ${e} = ((java.util.List) ${syntheticName}).get(${index})`\n ).join(\";\\n\");\n }\n\n const isNew =\n declaration?.initializer &&\n declaration.initializer.kind === SyntaxKind.NewExpression;\n let varToken = isNew ? \"var \" : this.VAR_TOKEN + \" \";\n if (!isNew) {\n // a native-arithmetic initializer prints a String/Long/Double value: the\n // declaration can name that type instead of Object (D3, scanned by java-31)\n const arithmeticType = this.javaArithmeticLocalType(declaration);\n if (arithmeticType !== undefined) {\n varToken = arithmeticType + \" \";\n }\n }\n\n // handle `let x;`\n if (!declaration.initializer) {\n return (\n this.getIden(identation) +\n \"Object \" +\n this.printNode(declaration.name) +\n \" = \" +\n this.UNDEFINED_TOKEN\n );\n }\n\n const parsedValue = this.printNode(declaration.initializer, identation).trimStart();\n if (parsedValue === this.UNDEFINED_TOKEN) {\n let specificVarToken = \"Object\";\n if (this.INFER_VAR_TYPE) {\n const variableType = this.getChecker().typeToString(\n this.getChecker().getTypeAtLocation(declaration)\n );\n if (this.VariableTypeReplacements[variableType]) {\n specificVarToken = this.VariableTypeReplacements[variableType];\n }\n }\n return (\n this.getIden(identation) +\n specificVarToken +\n \" \" +\n this.printNode(declaration.name) +\n \" = \" +\n parsedValue\n );\n }\n return (\n this.getIden(identation) +\n varToken +\n this.printNode(declaration.name) +\n \" = \" +\n parsedValue\n );\n }\n\n printThisKeyword(node, identation) {\n\n let current = node?.parent;\n while (current) {\n if (current.kind === SyntaxKind.PropertyAssignment &&\n !this.builderObjectLiterals.has(current.parent)) {\n const className = this.currentClassName;\n return `${this.capitalize(className)}.this`;\n }\n current = current?.parent;\n }\n // if this.x() is inside a object a object literal and we need to add the class name\n return this.THIS_TOKEN;\n }\n\n transformPropertyAcessExpressionIfNeeded(node) {\n const expression = node.expression;\n\n const leftSide = this.printNode(expression, 0);\n const rightSide = node.name.text;\n\n let rawExpression = undefined;\n\n switch (rightSide) {\n case \"length\": {\n const type = (this.getChecker() as Checker).getTypeAtLocation(\n expression\n );\n this.warnIfAnyType(node, (type as any).flags, leftSide, \"length\");\n rawExpression = this.printJavaLength(expression, leftSide);\n break;\n }\n case \"push\":\n rawExpression = `((java.util.List)${leftSide}).add`;\n break;\n }\n return rawExpression;\n }\n\n printCustomDefaultValueIfNeeded(node) {\n if (\n isArrayLiteralExpression(node) ||\n isObjectLiteralExpression(node) ||\n isStringLiteral(node) ||\n isBooleanLiteral(node) ||\n isNumericLiteral(node)\n ) {\n return this.UNDEFINED_TOKEN;\n }\n\n if (\n node?.text === \"undefined\" &&\n this.getChecker().getTypeAtLocation(node?.parent)?.flags ===\n TypeFlags.Number\n ) {\n return this.UNDEFINED_TOKEN;\n }\n\n return undefined;\n }\n\n // Unpacks one optional parameter. Native array access replaces Helpers.getArg\n // when the initializer is a pure literal; the null check keeps the helper's\n // contract that a null varargs array reads like an empty one.\n // The expression half is shared with the untyped front, which passes the same value to the\n // typed core as an argument instead of binding a local.\n printOptionalArgExpression(index, initializer) {\n const defaultValue = this.printNode(initializer, 0);\n if (!this.isPureInitializer(initializer)) {\n return `Helpers.getArg(optionalArgs, ${index}, ${defaultValue})`;\n }\n return `optionalArgs != null && optionalArgs.length > ${index} ? optionalArgs[${index}] : ${defaultValue}`;\n }\n\n printOptionalArgInit(paramName, index, initializer) {\n return `Object ${paramName} = ${this.printOptionalArgExpression(index, initializer)};`;\n }\n\n // Pure = evaluating the initializer has no effect and cannot throw, so\n // skipping it when the argument was supplied cannot change behavior.\n isPureInitializer(node) {\n switch (node?.kind) {\n case SyntaxKind.NullKeyword:\n case SyntaxKind.TrueKeyword:\n case SyntaxKind.FalseKeyword:\n case SyntaxKind.StringLiteral:\n case SyntaxKind.NoSubstitutionTemplateLiteral:\n case SyntaxKind.NumericLiteral:\n return true;\n case SyntaxKind.Identifier:\n // `= undefined` prints as null; any other name could be a call result\n return node.text === 'undefined';\n case SyntaxKind.ArrayLiteralExpression:\n return node.elements.every((element) => this.isPureInitializer(element));\n case SyntaxKind.ObjectLiteralExpression:\n return node.properties.every((property) => isPropertyAssignment(property) && this.isPureInitializer(property.initializer));\n case SyntaxKind.ParenthesizedExpression:\n case SyntaxKind.AsExpression:\n case SyntaxKind.TypeAssertionExpression:\n case SyntaxKind.NonNullExpression:\n return this.isPureInitializer(node.expression);\n default:\n return false;\n }\n }\n\n // a literal-defaulted parameter is read as `Objects.requireNonNullElse(x, )`: a dynamic\n // caller pads omitted slots with null, and the parameter stays final with no local copy\n javaDefaultedLocalNames: Map = new Map();\n\n javaDefaultedParameterLocals(node): string[] {\n if (node.body === undefined) {\n return [];\n }\n const types = this.javaCoreParameterTypes(node);\n node.parameters.forEach((param, i) => {\n if (!this.javaIsLiteralDefault(param.initializer) || !isIdentifier(param.name)) {\n return;\n }\n const symbol = this.javaSymbolOf(param.name);\n if (symbol === undefined) {\n return;\n }\n const name = this.printNode(param.name, 0);\n const value = this.javaCoreDefaultArgument(param, types[i]);\n this.javaDefaultedLocalNames.set(symbol, `java.util.Objects.requireNonNullElse(${name}, ${value})`);\n });\n return [];\n }\n\n // a string, number or boolean literal default (null, `undefined` and `{}` / `[]` keep the parameter)\n javaIsLiteralDefault(initializer): boolean {\n let node = initializer;\n while (node !== undefined && (isParenthesizedExpression(node) || isAsExpression(node))) {\n node = node.expression;\n }\n if (node !== undefined && isPrefixUnaryExpression(node) && node.operator === SyntaxKind.MinusToken) {\n node = node.operand;\n }\n return node !== undefined && (isStringLiteralLikeNode(node) || isNumericLiteral(node)\n || node.kind === SyntaxKind.TrueKeyword || node.kind === SyntaxKind.FalseKeyword);\n }\n\n javaDefaultedLocalName(node): string | undefined {\n if (this.javaDefaultedLocalNames.size === 0 || isParameterDeclaration(node.parent)\n || (isPropertyAccessExpression(node.parent) && node.parent.name === node)\n || isPropertyAssignment(node.parent) && node.parent.name === node) {\n return undefined;\n }\n let symbol;\n try {\n symbol = this.getChecker().getSymbolAtLocation(node);\n } catch (e) {\n return undefined;\n }\n return symbol === undefined ? undefined : this.javaDefaultedLocalNames.get(symbol);\n }\n\n printFunctionBody(node, identation) {\n // Save/restore rather than clobber: a nested function re-enters this method\n // and must not destroy the enclosing body's analysis state on the way out.\n const savedVarList = this.varListFromObjectLiterals;\n const savedUsageToFinalName = this.usageToFinalName;\n const savedScopeStack = this.finalVarScopeStack;\n this.varListFromObjectLiterals = {};\n this.analyzeFinalVars(node.body);\n this.finalVarScopeStack = [new Set()];\n const funcParams = node.parameters ?? [];\n const bodyStatements = node.body.statements;\n const isAsync = this.isAsyncFunction(node);\n // a method's default-valued parameters are parameters of its typed signature: no unpack locals\n const splitCore = isMethodDeclaration(node);\n const initParams = splitCore ? this.javaDefaultedParameterLocals(node) : [];\n const processedParts = [];\n try {\n for (let i = 0; i < bodyStatements.length; i++) {\n processedParts.push(this.printNode(bodyStatements[i], identation + 1));\n }\n } finally {\n this.varListFromObjectLiterals = savedVarList;\n this.usageToFinalName = savedUsageToFinalName;\n this.finalVarScopeStack = savedScopeStack;\n }\n let firstStatement = processedParts[0] || '';\n const remainingString = processedParts.slice(1).join(\"\\n\");\n let offSetIndex = 0;\n funcParams.forEach((param, i) => {\n const initializer = param.initializer;\n if (initializer) {\n if (splitCore) {\n if (!this.isPureInitializer(initializer) && !this.javaDefaultedLocalNames.has(this.javaSymbolOf(param.name))) {\n const name = this.printNode(param.name, 0);\n initParams.push(`if (${name} == null) { ${name} = ${this.printNode(initializer, 0)}; }`);\n }\n return; // the value arrives as a parameter of the typed signature\n }\n const index = i + offSetIndex;\n // index = index < 0 ? 0 : i - 1;\n const paramName = this.printNode(param.name, 0);\n initParams.push(this.printOptionalArgInit(paramName, index, initializer));\n } else {\n offSetIndex--;\n }\n });\n\n if (initParams.length > 0) {\n const defaultInitializers =\n initParams.map((l) => this.getIden(identation + 1) + l).join(\"\\n\") +\n \"\\n\";\n const bodyParts = firstStatement.split(\"\\n\");\n const commentPart = bodyParts.filter((line) => this.isComment(line));\n const isComment = commentPart.length > 0;\n if (isComment) {\n const commentPartString = commentPart\n .map((c) => this.getIden(identation + 1) + c.trim())\n .join(\"\\n\");\n const firstStmNoComment = bodyParts\n .filter((line) => !this.isComment(line))\n .join(\"\\n\");\n firstStatement =\n commentPartString + \"\\n\" + defaultInitializers + firstStmNoComment;\n } else {\n firstStatement = defaultInitializers + firstStatement;\n }\n }\n const blockOpen = this.getBlockOpen(identation);\n const blockClose = this.getBlockClose(identation);\n firstStatement = remainingString.length > 0 ? firstStatement + \"\\n\" : firstStatement;\n\n if (isAsync && isMethodDeclaration(node) && this.javaReassignsParameter(node)) {\n // unsupported: a lambda cannot capture a reassigned parameter; the TS source must not reassign it\n const where = `${node.getSourceFile().fileName}:${(node.name as any).text}`;\n this.javaReassigningMethods.push(where);\n const message = `[Java] async method reassigns a parameter (not effectively final, the TS source must use a new local): ${where}`;\n if (this.javaStrictEffectivelyFinal) {\n throw new Error(message);\n }\n Logger.warning(message);\n }\n if (isAsync) {\n const finalWrapperVars = isMethodDeclaration(node) ? '\\n' : this.printFinalOutsideMethodVariableWrappersIfAny(node, identation) + \"\\n\";\n const insideWrappers = isMethodDeclaration(node) ? '\\n' : this.printInsideMethodVariableWrappersIfAny(node, identation + 1) + \"\\n\";\n const body = (firstStatement + remainingString).split(\"\\n\").map(line => this.getIden(identation) + line).join(\"\\n\");\n // Check if last statement is a return — if not, add return null for supplyAsync lambda\n const lastStatement = bodyStatements.length > 1 ? bodyStatements[bodyStatements.length - 1] : (bodyStatements.length > 0 ? bodyStatements[0] : undefined);\n const lastStmtIsReturn = lastStatement && (isReturnStatement(lastStatement) || this.allBranchesTerminate(lastStatement));\n const returnNull = lastStmtIsReturn ? \"\" : (this.getIden(identation + 2) + \"return null;\\n\");\n const supplier = this.asyncSupplier || \"java.util.concurrent.CompletableFuture.supplyAsync\";\n const executorArg = (!this.asyncSupplier && this.asyncExecutor) ? `, ${this.asyncExecutor}` : \"\";\n const asyncBody = this.getIden(identation + 1) + `return ${supplier}(() -> {\\n` +\n insideWrappers +\n body + \"\\n\" +\n returnNull +\n this.getIden(identation + 1) + `}${executorArg});\\n`;\n return blockOpen + finalWrapperVars + asyncBody + blockClose;\n\n }\n return blockOpen + firstStatement + remainingString + blockClose;\n }\n\n printBlock(node, identation, chainBlock = false) {\n // Track per-block scope for final var dedup: same final name must not be\n // declared twice in a single block (Java would error), but may shadow\n // across nested blocks. We push an empty scope on entry and pop on exit.\n const managed = this.finalVarScopeStack.length > 0;\n if (managed) this.finalVarScopeStack.push(new Set());\n try {\n return super.printBlock(node, identation, chainBlock);\n } finally {\n if (managed) this.finalVarScopeStack.pop();\n }\n }\n\n printInstanceOfExpression(node, identation) {\n // const left = node.left.escapedText;\n const right = node.right.text;\n const left = this.printNode(node.left, 0);\n // const right = this.printNode(node.right, 0);\n return this.getIden(identation) + `Helpers.isInstance(${left}, ${right}.class)`;\n }\n\n printAwaitExpression(node, identation) {\n const expression = this.printNode(node.expression, identation);\n return `(${expression}).join()`;\n }\n\n printAsExpression(node, identation) {\n const type = node.type;\n\n if (type.kind === SyntaxKind.AnyKeyword) {\n return `((${this.VariableTypeReplacements['object']})${this.printNode(\n node.expression,\n identation\n )})`;\n }\n\n if (type.kind === SyntaxKind.StringKeyword) {\n return `((String)${this.printNode(node.expression, identation)})`;\n }\n\n if (type.kind === SyntaxKind.ArrayType) {\n const element = type.elementType.kind === SyntaxKind.AnyKeyword ? 'Object'\n : type.elementType.kind === SyntaxKind.StringKeyword ? 'String' : undefined;\n if (element !== undefined) {\n return `(java.util.List<${element}>)(${this.printNode(node.expression, identation)})`;\n }\n }\n\n return this.printNode(node.expression, identation);\n }\n\n // every Java parameter is `Object` (base printParameterType), except the ones whose TS\n // annotation names a native-carriable alias (javaNativeParameterType)\n printParameterType(node) {\n const native = this.javaNativeParameterType(node);\n if (native !== undefined) {\n return native;\n }\n return super.printParameterType(node);\n }\n\n printParameter(node, defaultValue = true) {\n const name = this.printNode(node.name, 0);\n const initializer = node.initializer;\n\n const type = this.printParameterType(node) || \"\";\n\n if (defaultValue) {\n if (initializer) {\n const def = this.printCustomDefaultValueIfNeeded(initializer) || this.printNode(initializer, 0);\n return type + \" \" + name + this.SPACE_DEFAULT_PARAM + \"=\" + this.SPACE_DEFAULT_PARAM + def;\n }\n return type + \" \" + name;\n }\n return name;\n }\n\n // the typed core signature: every parameter prints its Java type, the default-valued ones\n // included (a Java signature cannot carry a default - the front supplies it)\n printCoreMethodParameters(node) {\n return node.parameters.map(param => (param.initializer !== undefined\n ? `${this.javaOptionalParameterJavaType(param)} ${this.printNode(param.name, 0)}`\n : this.printParameter(param))).join(\", \");\n }\n\n // an async method's reassigned parameter prints under sigName (post keyword-remap),\n // freeing the original name for the lambda body to bind\n javaAsyncSignatureParameter(param, isAsyncMethod, printedParam) {\n if (isAsyncMethod && this.ReassignedVars[this.getVarKey(param)]) {\n const { localName, sigName } = this.getAsyncParamWrapperNames(param.name.text);\n return printedParam.replace(localName, sigName);\n }\n return printedParam;\n }\n\n // the async method body writes one of its parameters, or a non-pure default must be applied\n // by an `if (x == null) { x = init; }` inside the lambda (both break effective finality)\n javaReassignsParameter(node): boolean {\n const params = node.parameters ?? [];\n if (params.some((p) => p.initializer !== undefined && !this.isPureInitializer(p.initializer) && this.isAsyncFunction(node))) {\n return true;\n }\n const symbols = new Set();\n params.forEach((p) => {\n const symbol = this.javaSymbolOf(p.name);\n if (symbol !== undefined) {\n symbols.add(symbol);\n }\n });\n return symbols.size > 0 && node.body !== undefined && this.javaWritesSymbol(node.body, symbols);\n }\n\n javaSymbolOf(node): any | undefined {\n return this.getChecker().getSymbolAtLocation(node);\n }\n\n // syntactic walk: assignment targets, ++/--, destructuring targets and for-in/of expression heads\n javaWritesSymbol(node, symbols: Set): boolean {\n if (isBinaryExpression(node)) {\n const op = node.operatorToken.kind;\n if (op >= SyntaxKind.FirstAssignment && op <= SyntaxKind.LastAssignment\n && this.javaTargetWritesSymbol(node.left, symbols, op === SyntaxKind.EqualsToken)) {\n return true;\n }\n } else if ((isPrefixUnaryExpression(node) || isPostfixUnaryExpression(node))\n && (node.operator === SyntaxKind.PlusPlusToken || node.operator === SyntaxKind.MinusMinusToken)\n && this.javaTargetWritesSymbol(node.operand, symbols, false)) {\n return true;\n } else if ((isForInStatement(node) || isForOfStatement(node))\n && !isVariableDeclarationList(node.initializer)\n && this.javaTargetWritesSymbol(node.initializer, symbols, true)) {\n return true;\n }\n return node.forEachChild((child) => this.javaWritesSymbol(child, symbols) || undefined) === true;\n }\n\n javaTargetWritesSymbol(target, symbols: Set, destructuring: boolean): boolean {\n if (isParenthesizedExpression(target) || isNonNullExpression(target) || isAsExpression(target)) {\n return this.javaTargetWritesSymbol(target.expression, symbols, destructuring);\n }\n if (isIdentifier(target)) {\n const symbol = this.javaSymbolOf(target);\n return symbol !== undefined && symbols.has(symbol);\n }\n if (!destructuring) {\n return false;\n }\n if (isArrayLiteralExpression(target)) {\n return target.elements.some((e) => this.javaTargetWritesSymbol(isSpreadElement(e) ? e.expression : e, symbols, true));\n }\n if (isObjectLiteralExpression(target)) {\n return target.properties.some((p) => {\n if (isShorthandPropertyAssignment(p)) {\n return this.javaTargetWritesSymbol(p.name, symbols, true);\n }\n if (isPropertyAssignment(p)) {\n return this.javaTargetWritesSymbol(p.initializer, symbols, true);\n }\n return isSpreadAssignment(p) && this.javaTargetWritesSymbol(p.expression, symbols, true);\n });\n }\n if (isBinaryExpression(target) && target.operatorToken.kind === SyntaxKind.EqualsToken) {\n return this.javaTargetWritesSymbol(target.left, symbols, true); // `[x = 1] = ...` default\n }\n return false;\n }\n\n // `file:method` of every async method whose body reassigns a parameter (unsupported in Java lambdas)\n javaReassigningMethods: string[] = [];\n // the embedding build turns a reassigned async parameter into a hard transpile error\n javaStrictEffectivelyFinal = false;\n\n printMethodParameters(node) {\n const isAsyncMethod = this.isAsyncFunction(node);\n const params = node.parameters.map(param => this.javaAsyncSignatureParameter(param, isAsyncMethod, this.printParameter(param)));\n const hasOptionalParameter = node.parameters.some(p => p.initializer !== undefined || p.questionToken !== undefined);\n if (!hasOptionalParameter) {\n return params.join(\", \");\n }\n const paramsWithOptional = params.filter(param => param.indexOf('=') === -1);\n paramsWithOptional.push('Object... optionalArgs');\n return paramsWithOptional.join(\", \");\n }\n\n printArrayLiteralExpression(node) {\n // For Java: new ArrayList<>(Arrays.asList(elem1, elem2, ...))\n const elements = node.elements.map((e) => this.printNode(e)).join(\", \");\n return `${this.ARRAY_OPENING_TOKEN}${elements}${this.ARRAY_CLOSING_TOKEN}`;\n }\n\n\n printFinalOutsideMethodVariableWrappersIfAny(node, identation) {\n return this.javaAsyncParamWrapperLines(node, identation, (param, isOptionalParam, { sigName, snapName }) => {\n // a default-valued parameter of the split core keeps its type in the\n // snapshot (`final Long since3 = since2;`); the body local stays `Object`\n const snapType = (isOptionalParam && param.initializer !== undefined)\n ? this.javaOptionalParameterJavaType(param) : 'Object';\n return `final ${snapType} ${snapName} = ${sigName};`;\n });\n }\n\n printInsideMethodVariableWrappersIfAny(node, identation) {\n return this.javaAsyncParamWrapperLines(node, identation, (param, _isOptionalParam, { localName, snapName }) =>\n `${this.javaAsyncParameterLocalType(param) ?? 'Object'} ${localName} = ${snapName};`);\n }\n\n // one line per reassigned parameter of an async method (optional ones only in a split core)\n javaAsyncParamWrapperLines(node, identation, printLine) {\n const parameters = node?.parameters;\n const finalVarWrappers = [];\n if (parameters) {\n const isAsyncMethod = this.isAsyncFunction(node);\n const splitCore = this.hasDefaultedTail(node);\n parameters.forEach(param => {\n const isOptionalParam = param.initializer !== undefined || param.questionToken !== undefined;\n if ((!isOptionalParam || splitCore) && isAsyncMethod && this.ReassignedVars[this.getVarKey(param)]) {\n const names = this.getAsyncParamWrapperNames(param.name.text);\n finalVarWrappers.push(this.getIden(identation + 1) + printLine(param, isOptionalParam, names));\n }\n });\n }\n return finalVarWrappers.join(\"\\n\");\n }\n\n printMethodDeclaration(node, identation) {\n const funcBody = this.printFunctionBody(node, identation); // print body first to get var reassignments filled\n // one typed signature: default-valued and `?` parameters are ordinary typed parameters\n let methodDef = this.printMethodDefinition(node, identation, (n) => this.printCoreMethodParameters(n));\n methodDef += funcBody;\n methodDef += this.printOverrideBridges(node, identation);\n\n return methodDef;\n }\n\n printMethodDefinition(node, identation, paramsPrinter = undefined) {\n const name = this.transformMethodNameIfNeeded(node.name.text);\n\n let returnType = this.printFunctionType(node);\n\n // quick fix\n if (returnType === 'java.util.concurrent.CompletableFuture') {\n returnType = 'java.util.concurrent.CompletableFuture';\n }\n\n // D-09: an internal (non-override) generated method whose every return already\n // prints the native type carries it in its signature (see javaNativeReturnType).\n // Only the boxed default is replaced - void/Promise/plain-string stay as printed.\n if (returnType === this.DEFAULT_RETURN_TYPE) {\n const native = this.javaNativeReturnType(node);\n if (native !== undefined) {\n returnType = native;\n }\n }\n\n const modifiers = this.METHOD_DEFAULT_ACCESS ? this.METHOD_DEFAULT_ACCESS + \" \" : \"\";\n const parsedArgs = paramsPrinter ? paramsPrinter(node) : this.printMethodParameters(node);\n\n returnType = returnType ? returnType + \" \" : returnType;\n\n const methodToken = this.METHOD_TOKEN ? this.METHOD_TOKEN + \" \" : \"\";\n const signature = this.getIden(identation) + modifiers + returnType + methodToken + name + \"(\" + parsedArgs + \")\";\n\n return this.printNodeCommentsIfAny(node, identation, signature);\n }\n\n // `Array.isArray(x)` prints `(x instanceof java.util.List)`: false for null, true for a List, same\n // as the helper for every Java-object operand. The helper stays where the operand prints as a Java\n // array (rest parameter: `getClass().isArray()` branch) or a final class not convertible to List.\n printArrayIsArrayCall(node, _identation, parsedArg = undefined) {\n const native = this.printNativeArrayIsArray(node, parsedArg);\n return native === undefined ? `Helpers.isArray(${parsedArg})` : native;\n }\n\n printNativeArrayIsArray(node, parsedArg) {\n const operand: any = node?.arguments?.[0];\n if (operand === undefined || parsedArg === undefined) {\n return undefined;\n }\n // the whole call is the value of an expression statement: a bare `true;`/`false;` is\n // not a Java statement, so that position keeps the helper call\n if (node.parent !== undefined && isExpressionStatement(node.parent)) {\n return undefined;\n }\n // a side-effect-free array literal prints as a fresh ArrayList (never null), so the\n // answer is true without evaluating anything the helper would have to keep\n if (isArrayLiteralExpression(operand)) {\n return this.javaArrayLiteralDropsNothing(operand) ? 'true' : undefined;\n }\n if (!this.javaPrimaryIsArrayOperand(operand)) {\n return undefined;\n }\n const type = this.javaOperandType(operand);\n // a plain identifier of a type that can never hold a List: the helper answers false\n // for null/undefined and for every scalar, and the reference stays untouched\n if (operand.kind === SyntaxKind.Identifier && this.javaNonArrayType(type)) {\n return 'false';\n }\n if (this.isVarargsArrayReference(operand)) {\n return undefined;\n }\n if (this.javaScalarType(type)) {\n return undefined;\n }\n return `(${parsedArg} instanceof java.util.List)`;\n }\n\n // Operand shapes whose print is a primary expression: `instanceof` binds tighter than the\n // low-precedence operators, so a ternary/binary operand would re-parse, and a constructor\n // or cast print can be a final Java class on which `instanceof List` is not convertible.\n javaPrimaryIsArrayOperand(node): boolean {\n const kind = node.kind;\n return kind === SyntaxKind.Identifier\n || kind === SyntaxKind.PropertyAccessExpression\n || kind === SyntaxKind.ElementAccessExpression\n || kind === SyntaxKind.CallExpression;\n }\n\n javaOperandType(operand) {\n return this.checkerOrUndefined()?.getTypeAtLocation(operand);\n }\n\n // literals and identifiers have nothing an array-literal wrapper could skip by dropping\n javaArrayLiteralDropsNothing(node, depth = 0): boolean {\n if (depth > 4) {\n return false;\n }\n return node.elements.every((element) => isStringLiteral(element)\n || isNumericLiteral(element)\n || element.kind === SyntaxKind.TrueKeyword\n || element.kind === SyntaxKind.FalseKeyword\n || element.kind === SyntaxKind.NullKeyword\n || element.kind === SyntaxKind.Identifier\n || (isArrayLiteralExpression(element) && this.javaArrayLiteralDropsNothing(element, depth + 1)));\n }\n\n // types whose Java print is a scalar final class (`instanceof java.util.List` is not\n // convertible on them): the scalar family, and unions made only of scalars/nulls\n javaScalarType(type): boolean {\n return this.javaTypeFlagsOnly(type, JAVA_SCALAR_TYPE_FLAGS);\n }\n\n // types that provably never hold a List: every scalar (Java String/Long/Double/Boolean\n // answer false) and the nullish types (JS Array.isArray(null) is false)\n javaNonArrayType(type): boolean {\n return this.javaTypeFlagsOnly(type, JAVA_SCALAR_TYPE_FLAGS | JAVA_NULLISH_TYPE_FLAGS);\n }\n\n // the type, or every member of its (nested) union, carries one of the mask's flags\n javaTypeFlagsOnly(type, mask: number, depth = 0): boolean {\n if (type === undefined || type === null || depth > 3) {\n return false;\n }\n const flags: any = type.flags;\n if (flags & TypeFlags.Union) {\n const parts: any[] = type.getTypes?.() ?? [];\n return parts.length > 0 && parts.every((part) => this.javaTypeFlagsOnly(part, mask, depth + 1));\n }\n return (flags & mask) !== 0;\n }\n\n // A checker-proven dict prints a Map on every path, so the key copy is native;\n // every other target keeps the helper — shared field maps need its synchronized\n // snapshot, the rest need its instanceof/null fallbacks.\n printObjectKeysCall(node, _identation, parsedArg = undefined) {\n return this.printNativeObjectKeysCall(node) ?? `Helpers.objectKeys(${parsedArg})`;\n }\n\n printNativeObjectKeysCall(node) {\n const argument = node?.arguments?.[0];\n if (argument === undefined || isPropertyAccessExpression(argument)) {\n return undefined;\n }\n // a local the pass declares a Map needs no checkcast: the key copy binds on the\n // declaration's own type, exactly the helper's synchronized map branch\n if (this.javaDeclaredMapReceiver(argument)) {\n return `new java.util.ArrayList(${this.printNode(argument, 0)}.keySet())`;\n }\n const checker: any = this.checkerOrUndefined();\n if (checker === undefined) {\n return undefined;\n }\n const type = checker.getTypeAtLocation(argument);\n if (!this.isJavaMapStructureType(type)) {\n return undefined;\n }\n return `new java.util.ArrayList(((java.util.Map)${this.printNode(argument, 0)}).keySet())`;\n }\n\n printObjectValuesCall(_node, _identation, parsedArg = undefined) {\n return `Helpers.objectValues(${parsedArg})`;\n }\n\n printJsonParseCall(_node, _identation, parsedArg = undefined) {\n return `Helpers.parseJson(${parsedArg})`;\n }\n\n printJsonStringifyCall(_node, _identation, parsedArg = undefined) {\n return `Helpers.json(${parsedArg})`;\n }\n\n // `await Promise.all ([e1, ..., en])` with every element checker-typed `Promise<...>`:\n // CompletableFuture.allOf waits for exactly those, so Helpers.promiseAll's reflective loop adds\n // nothing. Result used -> thenApply collecting values, only for `const` locals (no double runs).\n printNativePromiseAllCall(node) {\n const awaitNode = node?.parent;\n if (awaitNode?.kind !== SyntaxKind.AwaitExpression) {\n return undefined;\n }\n const listNode = node.arguments?.[0];\n if (listNode?.kind !== SyntaxKind.ArrayLiteralExpression) {\n return undefined;\n }\n const elements = listNode.elements as unknown as Expression[];\n const checker = this.getChecker();\n for (const element of elements) {\n if (element.kind === SyntaxKind.SpreadElement\n || !this.isPromiseType(checker.getTypeAtLocation(element))) {\n return undefined;\n }\n }\n const printed = elements.map((element) => this.printNode(element));\n const futureCast = `((${this.PROMISE_TYPE_KEYWORD}) `;\n const casted = printed.map((element) => `${futureCast}${element})`);\n const allOf = `${this.PROMISE_TYPE_KEYWORD}.allOf(${casted.join(\", \")})`;\n if (awaitNode.parent?.kind === SyntaxKind.ExpressionStatement) {\n return allOf;\n }\n if (elements.length === 0\n || !elements.every((element) => this.isConstBoundIdentifier(element))\n || printed.indexOf('promiseAllValue') !== -1) {\n return undefined;\n }\n const collected = casted.map((element) => `${element}.join()`).join(\", \");\n const collectList = `${this.ARRAY_OPENING_TOKEN}${collected}${this.ARRAY_CLOSING_TOKEN}`;\n return `${allOf}.thenApply(promiseAllValue -> ${collectList})`;\n }\n\n // a `const`-bound local is assigned exactly once, so the printed java local is\n // effectively final (a lambda can capture it) and re-reading it joins the same future\n isConstBoundIdentifier(node) {\n if (node.kind !== SyntaxKind.Identifier) {\n return false;\n }\n const declaration = this.getChecker().getSymbolAtLocation(node)?.valueDeclaration?.resolve();\n return declaration?.kind === SyntaxKind.VariableDeclaration\n && (getCombinedNodeFlags(declaration) & NodeFlags.Const) === NodeFlags.Const;\n }\n\n printPromiseAllCall(node, identation, parsedArg = undefined) {\n return this.printNativePromiseAllCall(node) ?? `Helpers.promiseAll(${parsedArg})`;\n }\n\n printMathFloorCall(node, _identation, parsedArg = undefined) {\n return `(Math.floor(Double.parseDouble(${this.javaStringBoxText(node?.arguments?.[0], parsedArg)})))`;\n }\n\n printMathRoundCall(node, _identation, parsedArg = undefined) {\n return `Math.round(Double.parseDouble(${this.javaStringBoxText(node?.arguments?.[0], parsedArg)}))`;\n }\n\n printMathCeilCall(node, _identation, parsedArg = undefined) {\n return `Math.ceil(Double.parseDouble(${this.javaStringBoxText(node?.arguments?.[0], parsedArg)}))`;\n }\n\n printNumberIsIntegerCall(_node, _identation, parsedArg = undefined) {\n return `((${parsedArg} instanceof Integer) || (${parsedArg} instanceof Long))`;\n }\n\n printArrayPushCall(_node, _identation, name = undefined, parsedArg = undefined) {\n return `((java.util.List)${name}).add(${parsedArg})`;\n }\n\n printIncludesCall(_node, _identation, name = undefined, parsedArg = undefined) {\n return `${name}.contains(${parsedArg})`;\n }\n\n // Helpers.getIndexOf(str, target) is List.indexOf for a List receiver, String.indexOf for a String\n // receiver with a String target, -1 otherwise. Locals are `Object`/`var`, so the native call takes\n // the same checkcast as `.length()` / `containsKey`; the target takes one unless a printed String.\n javaNativeIndexOfCall(node, name, parsedArg) {\n if (node === undefined || name === undefined || parsedArg === undefined) {\n return undefined;\n }\n const receiver = node?.expression?.expression;\n if (receiver === undefined) {\n return undefined;\n }\n const checker: any = this.getChecker();\n let receiverType: any;\n try {\n receiverType = checker.getTypeAtLocation(receiver);\n } catch (e) {\n return undefined;\n }\n // a rest parameter is a Java array, not a List: the helper's `instanceof List` test fails there\n // and so must the native call. The wildcard receiver cast is the `.length()` family's and accepts\n // a List of any element type (a `List` cast fails on a `List`-static receiver).\n if (this.isJavaListType(receiverType) && !this.isVarargsArrayReference(receiver)) {\n return `((java.util.List)${name}).indexOf(${parsedArg})`;\n }\n // plain `string` only: the nullable aliases (`Str`) and every union can hold\n // undefined, which the helper absorbs as -1 but String.indexOf has no receiver for\n if (receiverType.getAliasSymbol?.() !== undefined || !this.isStringType(receiverType.flags)) {\n return undefined;\n }\n const arg = node.arguments?.[0];\n if (arg === undefined) {\n return undefined;\n }\n if (this.javaProvableString(arg)) {\n return `((String)${name}).indexOf(${parsedArg})`;\n }\n let argType: any;\n try {\n argType = checker.getTypeAtLocation(arg);\n } catch (e) {\n return undefined;\n }\n // a bare identifier / field target the checker types as a plain string: the cast is\n // the printer's own startsWith/endsWith argument shape\n if (argType.getAliasSymbol?.() === undefined && this.isStringType(argType.flags)\n && (isIdentifier(arg) || isPropertyAccessExpression(arg))) {\n return `((String)${name}).indexOf(((String)${parsedArg}))`;\n }\n return undefined;\n }\n\n printIndexOfCall(node, _identation, name = undefined, parsedArg = undefined) {\n return this.javaNativeIndexOfCall(node, name, parsedArg) ?? `${this.INDEXOF_WRAPPER_OPEN}${name}, ${parsedArg}${this.INDEXOF_WRAPPER_CLOSE}`;\n }\n\n printSearchCall(_node, _identation, name = undefined, parsedArg = undefined) {\n return `((String)${name}).indexOf(${parsedArg})`;\n }\n\n printStartsWithCall(_node, _identation, name = undefined, parsedArg = undefined) {\n return `((String)${name}).startsWith(((String)${parsedArg}))`;\n }\n\n printEndsWithCall(_node, _identation, name = undefined, parsedArg = undefined) {\n return `((String)${name}).endsWith(((String)${parsedArg}))`;\n }\n\n printTrimCall(_node, _identation, name = undefined) {\n return `((String)${name}).trim()`;\n }\n\n printJoinCall(_node, _identation, name = undefined, parsedArg = undefined) {\n // assumes List\n return `String.join((String)${parsedArg}, (java.util.List)${name})`;\n }\n\n printSplitCall(node, _identation, name = undefined, parsedArg = undefined) {\n return this.javaNativeSplitCall(node, name, parsedArg) ?? `Helpers.split(${name}, ${parsedArg})`;\n }\n\n printConcatCall(_node, _identation, name = undefined, parsedArg = undefined) {\n return `Helpers.concat(${name}, ${parsedArg})`;\n }\n\n printToFixedCall(_node, _identation, name = undefined, parsedArg = undefined) {\n return `toFixed(${name}, ${parsedArg})`;\n }\n\n printToStringCall(_node, _identation, name = undefined) {\n return `String.valueOf(${name})`;\n }\n\n printToUpperCaseCall(_node, _identation, name = undefined) {\n return `((String)${name}).toUpperCase()`;\n }\n\n printToLowerCaseCall(_node, _identation, name = undefined) {\n return `((String)${name}).toLowerCase()`;\n }\n\n printShiftCall(_node, _identation, name = undefined) {\n return `((java.util.List)${name}).get(0)`;\n }\n\n printReverseCall(_node, _identation, name = undefined) {\n return `java.util.Collections.reverse((java.util.List)${name})`;\n }\n\n printPopCall(_node, _identation, name = undefined) {\n return `((java.util.List)${name}).get(((java.util.List)${name}).size()-1)`;\n }\n\n printAssertCall(_node, _identation, parsedArgs) {\n return `assert(${parsedArgs})`;\n }\n\n printSliceCall(node, _identation, name = undefined, parsedArg = undefined, parsedArg2 = undefined) {\n const nativeCall = this.nativeSliceCallIfProvable(node, name);\n if (nativeCall !== undefined) {\n return nativeCall;\n }\n if (parsedArg2 === undefined) {\n parsedArg2 = \"null\";\n }\n return `Helpers.slice(${name}, ${parsedArg}, ${parsedArg2})`;\n }\n\n // Integer value of a slice bound that is an integer literal (`18`, `-64`); anything else keeps\n // the helper — the Java helper converts bounds with toInt, and a double cannot be clamped with the\n // integer Math.min/Math.max of the native form.\n javaSliceLiteralBound(node) {\n if (node === undefined) {\n return undefined;\n }\n if (isNumericLiteral(node)) {\n const text = String(node.text);\n if (text.indexOf('.') !== -1 || text.indexOf('e') !== -1 || text.indexOf('E') !== -1) {\n return undefined;\n }\n const value = Number(text);\n return value <= 2147483647 ? value : undefined;\n }\n if (isPrefixUnaryExpression(node) && node.operator === SyntaxKind.MinusToken) {\n const inner = this.javaSliceLiteralBound(node.operand);\n return inner === undefined ? undefined : -inner;\n }\n return undefined;\n }\n\n // JS slice clamps a literal bound into [0, length]: a non-negative bound is min\n // (bound, length), a negative one counts from the end (max (length - |bound|, 0)).\n // `0` stays `0` because the length of a String/List is never negative.\n javaSliceBoundExpression(value, length) {\n if (value === 0) {\n return '0';\n }\n return value > 0 ? `Math.min(${value}, ${length})` : `Math.max(${length} - ${-value}, 0)`;\n }\n\n // `x.slice (a, b)` -> substring/subList when the receiver provably prints as String/List AND every\n // bound is an integer literal: Java throws where JS clamps, so only literal bounds can be clamped.\n // The null guard keeps null -> null and needs a side-effect-free receiver (read up to three times).\n nativeSliceCallIfProvable(node, name) {\n const args = node?.arguments ?? [];\n if (args.length < 1 || args.length > 2) {\n return undefined;\n }\n const start = this.javaSliceLiteralBound(args[0]);\n if (start === undefined) {\n return undefined;\n }\n const hasEnd = args.length === 2;\n const end = hasEnd ? this.javaSliceLiteralBound(args[1]) : undefined;\n if (hasEnd && end === undefined) {\n return undefined;\n }\n const receiverExpression = isPropertyAccessExpression(node?.expression) ? node.expression.expression : undefined;\n if (!this.sideEffectFreeReceiver(receiverExpression)) {\n return undefined;\n }\n let kind: string;\n try {\n const type = this.getChecker().getTypeAtLocation(receiverExpression);\n if (this.isStringType(type.flags)) {\n kind = 'String';\n } else if (this.isJavaListType(type) && !this.isVarargsArrayReference(receiverExpression)) {\n kind = 'List';\n } else {\n return undefined;\n }\n } catch (e) {\n return undefined;\n }\n const cast = kind === 'String' ? `((String)${name})` : `((java.util.List)${name})`;\n const length = kind === 'String' ? `${cast}.length()` : `${cast}.size()`;\n const startText = this.javaSliceBoundExpression(start, length);\n const endText = hasEnd ? this.javaSliceBoundExpression(end, length) : length;\n // from <= to is proven per case: 0 is never above a clamp, an open end is the\n // length, and two literals clamp monotonically once they keep their order\n // (non-negative, or both counting from the end with |start| >= |end|).\n const ordered = start === 0 || !hasEnd\n || (start >= 0 && end >= 0 && start <= end)\n || (start < 0 && end < 0 && start <= end);\n const fromText = ordered ? startText : `Math.min(${startText}, ${endText})`;\n // an inverted pair yields an empty slice in JS, so the substrings collapse to\n // substring (to, to); a one-argument String slice drops the end entirely\n const argumentsText = hasEnd || kind === 'List' ? `${fromText}, ${endText}` : fromText;\n const method = kind === 'String' ? 'substring' : 'subList';\n return `(${name} == null ? null : ${cast}.${method}(${argumentsText}))`;\n }\n\n printReplaceCall(_node, _identation, name = undefined, parsedArg = undefined, parsedArg2 = undefined) {\n return `Helpers.replace((String)${name}, (String)${parsedArg}, (String)${parsedArg2})`;\n }\n\n printReplaceAllCall(node, identation, name = undefined, parsedArg = undefined, parsedArg2 = undefined) {\n // Native when both arguments are plain string literals and the pattern is non-empty: the\n // helper's null / empty-pattern guards cannot fire for them, and `String.replace` is the\n // literal all-occurrences replacement. The null guard on the receiver keeps the helper's\n // null -> null behaviour; it is only emitted for a side-effect-free receiver (identifier\n // or property access), so a double read cannot change semantics.\n const pattern = this.stringLiteralArgument(node?.arguments?.[0]);\n const replacement = this.stringLiteralArgument(node?.arguments?.[1]);\n const receiver = this.sideEffectFreeReceiver(node?.expression);\n if (pattern !== undefined && replacement !== undefined && receiver) {\n return `(${name} == null ? null : ((String)${name}).replace(${pattern}, ${replacement}))`;\n }\n return `Helpers.replaceAll((String)${name}, (String)${parsedArg}, (String)${parsedArg2})`;\n }\n\n // Printed form of a non-empty string-literal argument with no escapes, or undefined when the\n // argument is not a literal, prints with an escape sequence, or is the empty pattern.\n stringLiteralArgument(argument) {\n if (argument === undefined || !isStringLiteral(argument)) {\n return undefined;\n }\n const printed = this.printNode(argument, 0);\n return /^\"[^\"\\\\]+\"$/.test(printed) ? printed : undefined;\n }\n\n // True for receivers that read a value without calling anything: `x`, `x.y`, `this.x`,\n // `(x as string)` and parenthesised forms of those. Guards the double read of the ternary.\n sideEffectFreeReceiver(expression) {\n if (expression === undefined) {\n return false;\n }\n if (isParenthesizedExpression(expression) || isAsExpression(expression) || isTypeAssertion(expression)) {\n return this.sideEffectFreeReceiver(expression.expression);\n }\n if (isIdentifier(expression) || expression.kind === SyntaxKind.ThisKeyword) {\n return true;\n }\n if (isPropertyAccessExpression(expression)) {\n return this.sideEffectFreeReceiver(expression.expression);\n }\n return false;\n }\n\n printPadEndCall(_node, _identation, name, parsedArg, parsedArg2) {\n // You can point this to a runtime helper if you have one\n return `Helpers.padEnd((String)${name}, ((Number)${parsedArg}).intValue(), ((String)${parsedArg2}).charAt(0))`;\n }\n\n printPadStartCall(node, _identation, name, parsedArg, parsedArg2) {\n return this.printNativePadStart(node, name) ?? `Helpers.padStart((String)${name}, ((Number)${parsedArg}).intValue(), ((String)${parsedArg2}).charAt(0))`;\n }\n\n printDateNowCall(_node, _identation) {\n return \"System.currentTimeMillis()\";\n }\n\n printLengthProperty(node, _identation, _name = undefined) {\n const leftSide = this.printNode(node.expression, 0);\n const type = (this.getChecker() as Checker).getTypeAtLocation(node.expression);\n this.warnIfAnyType(node, (type as any).flags, leftSide, \"length\");\n return this.printJavaLength(node.expression, leftSide);\n }\n\n // For ++/--, prefer native Java operators rather than the C# ref-helpers\n printPostFixUnaryExpression(node, identation) {\n const { operand, operator } = node;\n const leftSide = this.printNode(operand, 0);\n return this.PostFixOperators[operator] === \"--\" ? `${leftSide}--` : `${leftSide}++`;\n }\n\n // the identifier declared by a `for (var i = ; ...; i++)` header: the\n // printer writes that initializer as `var`, so javac infers a primitive int and the\n // ++/-- increment keeps it one\n javaPrimitiveCounter(node): boolean {\n if (node?.kind !== SyntaxKind.Identifier) {\n return false;\n }\n const symbol = this.getChecker().getSymbolAtLocation(node);\n const declaration: any = symbol?.valueDeclaration?.resolve() ?? symbol?.declarations?.[0]?.resolve();\n if (declaration === undefined || !isVariableDeclaration(declaration) || !isIdentifier(declaration.name)) {\n return false;\n }\n if (declaration.name.text !== node.text || declaration.initializer === undefined) {\n return false;\n }\n const list: any = declaration.parent;\n if (list?.kind !== SyntaxKind.VariableDeclarationList || list.declarations.length !== 1) {\n return false;\n }\n const forStatement: any = list.parent;\n if (forStatement?.kind !== SyntaxKind.ForStatement || forStatement.initializer !== list) {\n return false;\n }\n if (this.javaIntegerLiteralKind(declaration.initializer) === undefined) {\n return false;\n }\n const incrementor = forStatement.incrementor;\n return incrementor?.kind === SyntaxKind.PostfixUnaryExpression\n && incrementor.operand?.kind === SyntaxKind.Identifier\n && incrementor.operand.text === node.text;\n }\n\n // `-x` prints as the plain Java operator when the operand is already primitive: a decimal literal,\n // a nested native `+ - * /`, a `for (var i = ` counter or a `.length` read.\n // Helpers.opNeg preserves the box and maps null to null, so every boxed local keeps the helper.\n javaNativeNegation(node): boolean {\n if (node === undefined) {\n return false;\n }\n if (node.kind === SyntaxKind.ParenthesizedExpression) {\n return this.javaNativeNegation(node.expression);\n }\n if (isNumericLiteral(node)) {\n return this.javaProvableNumericKind(node) !== undefined;\n }\n if (node.kind === SyntaxKind.BinaryExpression) {\n return this.javaNativeArithmeticKind(node) !== undefined;\n }\n if (this.javaPrimitiveCounter(node)) {\n return true;\n }\n return node.kind === SyntaxKind.PropertyAccessExpression\n && node.name.text === 'length'\n && this.javaLengthKind(node.expression) !== undefined;\n }\n\n printPrefixUnaryExpression(node, identation) {\n const { operand, operator } = node;\n if (operator === SyntaxKind.ExclamationToken) {\n return this.PrefixFixOperators[operator] + this.printCondition(node.operand, 0);\n }\n const leftSide = this.printNode(operand, 0);\n if (operator === SyntaxKind.PlusToken) {\n return `+(${leftSide})`;\n } else if (operator === SyntaxKind.MinusToken) {\n if (this.javaNativeNegation(operand)) {\n return `-${leftSide}`;\n }\n return `Helpers.opNeg(${leftSide})`;\n }\n return super.printPrefixUnaryExpression(node, identation);\n }\n\n javaBooleanCondition(node) {\n if (node.kind === SyntaxKind.ParenthesizedExpression) {\n return this.javaBooleanCondition(node.expression);\n }\n if (node.kind === SyntaxKind.PrefixUnaryExpression) {\n return node.operator === SyntaxKind.ExclamationToken && this.javaBooleanCondition(node.operand);\n }\n if (node.kind !== SyntaxKind.BinaryExpression) {\n return false;\n }\n return this.javaBooleanOperators.includes(node.operatorToken.kind);\n }\n\n // `Precise.(a, b)` resolving to a static of the base `Precise` class: Precise.java\n // declares them `public static boolean`, so the call is a primitive boolean. The receiver name\n // alone is no proof (a shadowing local prints the same text), so the resolution is checked too.\n javaPreciseBooleanCall(node) {\n if (node.kind === SyntaxKind.ParenthesizedExpression) {\n return this.javaPreciseBooleanCall(node.expression);\n }\n // `!` is a boolean too (the negation of a proven boolean)\n if (node.kind === SyntaxKind.PrefixUnaryExpression) {\n return node.operator === SyntaxKind.ExclamationToken && this.javaPreciseBooleanCall(node.operand);\n }\n if (node.kind !== SyntaxKind.CallExpression\n || node.expression.kind !== SyntaxKind.PropertyAccessExpression\n || node.expression.expression.kind !== SyntaxKind.Identifier\n || node.expression.expression.text !== 'Precise'\n || !JAVA_PRECISE_BOOLEAN_STATICS.has(node.expression.name.text)) {\n return false;\n }\n const declaration: any = this.getChecker().getResolvedSignature(node)?.declaration?.resolve();\n if (declaration === undefined\n || declaration.kind !== SyntaxKind.MethodDeclaration\n || declaration.parent?.kind !== SyntaxKind.ClassDeclaration\n || declaration.parent.name?.text !== 'Precise'\n || !declaration.modifiers?.some((modifier) => modifier.kind === SyntaxKind.StaticKeyword)) {\n return false;\n }\n // the relational statics answer a plain boolean (never null), which is what\n // Helpers.isTrue(Boolean) returns unchanged; a union (boolean | undefined) keeps the helper\n return (this.getChecker().getTypeAtLocation(node).flags & TypeFlags.Boolean) !== 0;\n }\n\n // the checker's view of a condition value: BooleanLike is the plain `boolean` (the `boolean |\n // undefined` of an accessor with a default is BooleanLiteral + Undefined and does not qualify),\n // while a union whose every member is boolean/nullish is the nullable box.\n javaBooleanValueKind(node): 'boolean' | 'nullableBoolean' | undefined {\n const type = this.getChecker().getTypeAtLocation(node);\n const flags = type?.flags ?? 0;\n if (flags & TypeFlags.BooleanLike) {\n return 'boolean';\n }\n if ((flags & TypeFlags.Union) === 0) {\n return undefined;\n }\n const members = (type as any).getTypes?.() ?? [];\n const booleanishMembers = TypeFlags.BooleanLike | TypeFlags.Null\n | TypeFlags.Undefined | TypeFlags.Void;\n const allBooleanish = members.length > 0\n && members.every((member) => (((member as any).flags ?? 0) & booleanishMembers) !== 0);\n return allBooleanish ? 'nullableBoolean' : undefined;\n }\n\n // mirrors printWrappedUnknownThisProperty: a `this.(...)` call the checker cannot\n // resolve prints `Helpers.callDynamically(this, \"\", ...)`, whose Java return is Object\n javaCalleeResolves(node): boolean {\n const checker: any = this.checkerOrUndefined();\n if (checker === undefined) {\n return false;\n }\n const signature = checker.getResolvedSignature(node);\n return signature?.declaration !== undefined;\n }\n\n // the boolean the printed Java of a `this.(...)` call already carries, from the\n // hand-written base declarations in JAVA_THIS_BOOLEAN_METHODS / the box proof in\n // JAVA_THIS_BOOLEAN_BOX_METHODS. undefined: not a direct boolean call, keep the wrapper.\n javaCallBooleanKind(node): 'boolean' | 'nullableBoolean' | undefined {\n if (node?.kind !== SyntaxKind.CallExpression) {\n return undefined;\n }\n const callee = node.expression;\n if (callee?.kind !== SyntaxKind.PropertyAccessExpression\n || callee.expression?.kind !== SyntaxKind.ThisKeyword) {\n return undefined;\n }\n const kind = this.javaBooleanValueKind(node);\n if (kind === undefined || !this.javaCalleeResolves(node)) {\n return undefined;\n }\n const name = callee.name?.text as string;\n if (JAVA_THIS_BOOLEAN_METHODS.has(name)) {\n // the hand-written declaration is the only source of the primitive return: a\n // non-base `this.(...)` is a different method, printed `Object`\n return kind === 'boolean' ? 'boolean' : undefined;\n }\n const defaultArgumentIndex = JAVA_THIS_BOOLEAN_BOX_METHODS[name];\n if (defaultArgumentIndex === undefined) {\n return undefined;\n }\n const defaultArgument = node.arguments?.[defaultArgumentIndex];\n // a nullish literal reaches the Java accessor as null (the printer drops a trailing\n // `undefined` in the optional tail), and null is what an absent argument yields\n const defaultIsNullish = defaultArgument === undefined\n || defaultArgument.kind === SyntaxKind.NullKeyword\n || (defaultArgument.kind === SyntaxKind.Identifier && defaultArgument.text === 'undefined');\n const defaultIsBoolean = defaultIsNullish\n || defaultArgument?.kind === SyntaxKind.TrueKeyword\n || defaultArgument?.kind === SyntaxKind.FalseKeyword;\n return defaultIsBoolean ? 'nullableBoolean' : undefined;\n }\n\n // the printer already emits these conditions as Java `boolean` (the comparison helpers,\n // `in`/`instanceof` and the logical operators all return/print primitive boolean), so\n // Helpers.isTrue would only re-test a value the checker proves is boolean\n javaConditionPrintsBoolean(node) {\n let inner = node;\n while (inner.kind === SyntaxKind.ParenthesizedExpression) {\n inner = inner.expression;\n }\n if (inner.kind === SyntaxKind.PrefixUnaryExpression && inner.operator === SyntaxKind.ExclamationToken) {\n return true; // printPrefixUnaryExpression prints `!` + printCondition(operand): a primitive boolean\n }\n if (this.javaBooleanCondition(node)) {\n // TS models `boolean` as the true|false union: the Boolean bit is set on plain\n // boolean and cleared on `boolean | undefined`-style unions, which keep the helper\n return (this.getChecker().getTypeAtLocation(node).flags & TypeFlags.Boolean) !== 0;\n }\n return this.javaPreciseBooleanCall(node);\n }\n\n // the checker proves this expression's TypeScript type is exactly `boolean` (or a boolean\n // literal type): no `any`, no `undefined`/`null` union, no nullable alias\n javaBooleanBoxType(type: any): boolean {\n if (type === undefined) {\n return false;\n }\n if (type.getAliasSymbol?.() !== undefined) {\n return false;\n }\n const flags = type.flags ?? 0;\n if ((flags & JAVA_BOOLEAN_EXCLUDED_TYPE_FLAGS) !== 0) {\n return false;\n }\n return (flags & (TypeFlags.Boolean | TypeFlags.BooleanLiteral)) !== 0;\n }\n\n javaTypeOfNode(node): any {\n return this.checkerOrUndefined()?.getTypeAtLocation(node);\n }\n\n // the DECLARED type of a declaration, not the narrowed type at a use site: TypeScript\n // narrows a `const ok: boolean = true` to the literal `true` and can even reach `never`\n // after a guarding `if (ok) return;`, which says nothing about the box the local holds\n javaTypeOfDeclaration(decl): any {\n if (decl === undefined) {\n return undefined;\n }\n return this.checkerOrUndefined()?.getTypeAtLocation(decl);\n }\n\n // the printed Java of this expression is a primitive `boolean` (or Boolean box): boolean literals,\n // `!`, logical / comparison / `in` operators, `Array.isArray(x)` (Helpers.isArray, `public static\n // boolean`) and hand-written `public boolean` base methods. `seen` breaks `a = b; b = a;` cycles.\n javaPrintsBooleanValue(node, seen: Set, depth = 0): boolean {\n if (node === undefined) {\n return false;\n }\n switch (node.kind) {\n case SyntaxKind.TrueKeyword:\n case SyntaxKind.FalseKeyword:\n return true;\n case SyntaxKind.ParenthesizedExpression:\n case SyntaxKind.AsExpression:\n case SyntaxKind.NonNullExpression:\n return this.javaPrintsBooleanValue(node.expression, seen, depth);\n case SyntaxKind.PrefixUnaryExpression:\n return node.operator === SyntaxKind.ExclamationToken && this.javaPrintsBooleanValue(node.operand, seen, depth);\n case SyntaxKind.BinaryExpression:\n // the comparison and logical operators all print a Java primitive boolean (the\n // helpers they lower to are declared `public static boolean`), whatever the operands\n return JAVA_BOOLEAN_OPERATOR_KINDS.has(node.operatorToken.kind);\n case SyntaxKind.CallExpression:\n return this.javaPrintsBooleanCall(node, seen, depth);\n case SyntaxKind.ConditionalExpression:\n // both branches print a Java boolean value, so the whole `cond ? a : b` does:\n // the printed ternary yields a boolean (or its Boolean box once assigned)\n return this.javaPrintsBooleanValue(node.whenTrue, seen, depth)\n && this.javaPrintsBooleanValue(node.whenFalse, seen, depth);\n case SyntaxKind.PropertyAccessExpression:\n return this.javaBooleanBaseField(node) !== undefined;\n case SyntaxKind.Identifier:\n return this.javaBooleanBoxIdentifier(node, seen) !== undefined;\n }\n return false;\n }\n\n // the Java box of a `this.(...)` call whose generated body returns a boolean on every path:\n // the TS return type is a boolean family and every `return` in the resolved declaration prints a\n // Java boolean or a proven Boolean-or-null box. `depth` and `seen` bound the recursion.\n javaCallReturnsBooleanBox(node, seen: Set, depth: number): boolean {\n if (node?.kind !== SyntaxKind.CallExpression || depth > 2) {\n return false;\n }\n const checker: any = this.checkerOrUndefined();\n if (checker === undefined) {\n return false;\n }\n const declaration = checker.getResolvedSignature(node)?.declaration?.resolve();\n if (declaration === undefined || declaration.kind !== SyntaxKind.MethodDeclaration\n || declaration.body === undefined || seen.has(declaration)) {\n return false;\n }\n if (this.javaBooleanValueKind(node) === undefined) {\n return false; // the call's TS type is not a boolean family (any/undefined-able)\n }\n const callee = node.expression;\n if (!isPropertyAccessExpression(callee) || callee.expression.kind !== SyntaxKind.ThisKeyword) {\n return false; // only a method of this class; a foreign class is not under the printer\n }\n const name = String(callee.name.text);\n if (JAVA_THIS_BOOLEAN_METHODS.has(name) || JAVA_THIS_BOOLEAN_BOX_METHODS[name] !== undefined) {\n return false; // the hand-written base tables are authoritative for these accessors\n }\n const next = new Set(seen);\n next.add(declaration);\n let returns = 0;\n let ok = true;\n const scan = (current: Node) => {\n if (!ok) {\n return;\n }\n if (current !== declaration && isFunctionLike(current)) {\n return; // a nested function's returns are not the method's\n }\n if (isReturnStatement(current)) {\n returns++;\n const expression = current.expression;\n if (expression === undefined || !this.javaPrintsBooleanValue(expression, next, depth + 1)) {\n ok = false;\n return;\n }\n }\n current.forEachChild(scan);\n };\n scan(declaration.body);\n return ok && returns > 0;\n }\n\n // `Array.isArray(x)` prints `Helpers.isArray(x)` (`public static boolean`), the relational\n // Precise statics print `public static boolean` and the hand-written `public boolean` base\n // methods print a primitive boolean. Everything else - including the generated\n javaPrintsBooleanCall(node, seen: Set = new Set(), depth = 0): boolean {\n if (this.isArrayIsArrayCall(node)) {\n return true;\n }\n if (this.javaPreciseBooleanCall(node)) {\n return true;\n }\n if (this.javaStringAffixCall(node)) {\n return true;\n }\n const callee = node.expression;\n if (isPropertyAccessExpression(callee) && callee.expression.kind === SyntaxKind.ThisKeyword\n && JAVA_BOOLEAN_BASE_CALLS.has(String(callee.name.text))) {\n return true;\n }\n return this.javaCallReturnsBooleanBox(node, seen, depth);\n }\n\n // `s.startsWith(x)` / `s.endsWith(x)` on a checker-proven string receiver prints\n // `((String)s).startsWith(..)`, a primitive boolean (String.startsWith/endsWith)\n javaStringAffixCall(node): boolean {\n if (node?.kind !== SyntaxKind.CallExpression || (node.arguments?.length ?? 0) !== 1) {\n return false;\n }\n const callee: any = node.expression;\n if (!isPropertyAccessExpression(callee)) {\n return false;\n }\n const name = String(callee.name.text);\n if (name !== 'startsWith' && name !== 'endsWith') {\n return false;\n }\n const type = this.javaTypeOfNode(callee.expression);\n if (type === undefined || !this.isStringType(type.flags)) {\n return false;\n }\n return /^\\(\\(String\\)[\\s\\S]*\\.(startsWith|endsWith)\\([\\s\\S]*\\)$/.test(this.printNode(node, 0));\n }\n\n isArrayIsArrayCall(node): boolean {\n if (node === undefined || node.kind !== SyntaxKind.CallExpression) {\n return false;\n }\n const callee: any = node.expression;\n return isPropertyAccessExpression(callee)\n && String(callee.name.text) === 'isArray'\n && callee.expression.kind === SyntaxKind.Identifier\n && String((callee.expression as any).text) === 'Array'\n && (node.arguments?.length ?? 0) === 1;\n }\n\n // `this.` read of a hand-written base field declared `boolean`, or undefined. The\n // TsChecker guard keeps a field the hand-written base declares Object (or String) out.\n javaBooleanBaseField(node): string | undefined {\n if (!isPropertyAccessExpression(node) || node.expression.kind !== SyntaxKind.ThisKeyword) {\n return undefined;\n }\n const printed = this.printNode(node, 0);\n if (!JAVA_BOOLEAN_BASE_FIELDS.has(printed)) {\n return undefined;\n }\n const declaration = (this.checkerOrUndefined() as any).getSymbolAtLocation(node.name)?.valueDeclaration?.resolve();\n const type = this.javaTypeOfDeclaration(declaration) ?? this.javaTypeOfNode(node);\n return this.javaBooleanBoxType(type) ? printed : undefined;\n }\n\n // the Java name of an identifier that provably holds a Boolean box or null, so `Helpers.isTrue(x)`\n // IS `Boolean.TRUE.equals(x)`. Proof: the TS type (`boolean`, never `any`/`undefined`-able) plus\n // the D2 write scan: every write in the enclosing function must print a Java boolean value.\n javaBooleanBoxIdentifier(node, seen: Set): string | undefined {\n if (node?.kind !== SyntaxKind.Identifier || seen.has(node)) {\n return undefined;\n }\n const checker: any = this.checkerOrUndefined();\n if (checker === undefined) {\n return undefined;\n }\n const symbol = checker.getSymbolAtLocation(node);\n const decl = symbol?.valueDeclaration?.resolve();\n if (decl === undefined) {\n return undefined;\n }\n // only a local with its own initializer: a parameter (and the `optionalArgs[n]` prologue for an\n // optional one) is an `Object` box its CALLERS fill, so it is not proven boolean; a binding\n // element (`for (const b of ...)`, destructuring) is fed by the container, not a typed value.\n if (decl.kind !== SyntaxKind.VariableDeclaration) {\n return undefined;\n }\n let type;\n try {\n type = this.javaTypeOfDeclaration(decl);\n } catch (e) {\n type = undefined;\n }\n if (!this.javaBooleanBoxType(type)) {\n return undefined;\n }\n if (!this.javaBooleanWritesAreBoxed(symbol, decl, node, seen)) {\n return undefined;\n }\n return this.printNode(node, 0);\n }\n\n // every value written to the symbol prints a Java boolean. The scan runs over the function\n // the DECLARATION lives in (a local can only be written inside it or inside a closure nested\n // in it), so a write in an enclosing scope is never missed.\n javaBooleanWritesAreBoxed(symbol, decl, node, seen: Set): boolean {\n const next = new Set(seen);\n next.add(node);\n return this.javaWritesAreBoxed(symbol, decl, next, (value) => this.javaPrintsBooleanValue(value, next), false);\n }\n\n // shared D2 write scan over the function the declaration lives in: the initializer and every\n // identifier write must pass `accepts`; `tuples` also checks `[ x, params ] = ...` destructures\n javaWritesAreBoxed(symbol, decl, next: Set, accepts: (value: any) => boolean, tuples: boolean): boolean {\n let fn = decl.parent;\n while (fn !== undefined && !isFunctionLike(fn)) {\n fn = fn.parent;\n }\n if (fn === undefined) {\n return false;\n }\n if (decl.initializer !== undefined && !accepts(decl.initializer)) {\n return false;\n }\n let ok = true;\n const scan = (current: Node) => {\n if (!ok) {\n return;\n }\n if ((isForOfStatement(current) || isForInStatement(current))\n && isIdentifier(current.initializer)) {\n // `for (x of list)` re-fills the box from the container\n const loop = (this.checkerOrUndefined() as any).getSymbolAtLocation(current.initializer);\n if (loop === symbol) {\n ok = false;\n return;\n }\n }\n if (isBinaryExpression(current)\n && JAVA_ASSIGNMENT_OPERATOR_KINDS.has(current.operatorToken.kind)) {\n if (isIdentifier(current.left)) {\n const left = (this.checkerOrUndefined() as any).getSymbolAtLocation(current.left);\n if (left === symbol && !accepts(current.right)) {\n ok = false;\n return;\n }\n } else if (tuples && isArrayLiteralExpression(current.left)) {\n // `[ x, params ] = this.handle*Bool (...)` binds element `index`\n const index = current.left.elements.findIndex((element: any) => isIdentifier(element)\n && (this.checkerOrUndefined() as any).getSymbolAtLocation(element) === symbol);\n if (index !== -1 && !this.javaBooleanBoxTupleElement(current.right, index)) {\n ok = false;\n return;\n }\n }\n }\n current.forEachChild(scan);\n };\n scan(fn);\n return ok;\n }\n\n // the declared Java type the ccxt-side declaration chain gave this local/param, via the\n // javaDeclaredLocalTypeResolver hook (build/java-local-types.js): `boolean` prints as the\n // primitive, so the identifier IS the condition; `Boolean` is the nullable box (isTrue = equals).\n javaDeclaredBooleanKind(node): 'boolean' | 'Boolean' | undefined {\n const declaration = this.javaDeclarationOfIdentifier(node);\n if (declaration === undefined || node.text !== declaration.name?.text) {\n return undefined; // a capture rename prints `final Object finalX = x`\n }\n let declared;\n try {\n declared = this.javaDeclaredTypeOfDeclaration(declaration);\n } catch (e) {\n return undefined;\n }\n return declared === 'boolean' || declared === 'Boolean' ? declared : undefined;\n }\n\n // the DECLARED type of the local is a nullable boolean: `Bool` (`boolean | undefined`) or an\n // equivalent union. Every member must be boolean or nullish - an `Int`/`Str`/`any` member can\n // hold a box the isTrue helper tests with its runtime truthiness, so the helper must stay.\n javaNullableBooleanDeclaration(declaration): boolean {\n if (declaration?.kind !== SyntaxKind.VariableDeclaration) {\n return false;\n }\n const type = this.javaTypeOfDeclaration(declaration);\n if (type === undefined) {\n return false;\n }\n const flags: number = type.flags ?? 0;\n if ((flags & (TypeFlags.Any | TypeFlags.Unknown)) !== 0) {\n return false;\n }\n if ((flags & TypeFlags.Boolean) !== 0) {\n return false; // the plain `boolean` is the strict box family's own proof\n }\n if ((flags & TypeFlags.Union) === 0) {\n return false;\n }\n const members: any[] = (type as any).getTypes?.() ?? [];\n if (members.length === 0) {\n return false;\n }\n const booleanish = (member: any) => (((member?.flags ?? 0) & JAVA_NULLABLE_BOOLEAN_MEMBER_FLAGS) !== 0);\n const hasBoolean = members.some((member: any) => (((member?.flags ?? 0) & (TypeFlags.Boolean | TypeFlags.BooleanLiteral)) !== 0));\n return hasBoolean && members.every(booleanish);\n }\n\n // a value the nullable-boolean write scan accepts: a Java boolean value this printer proves, a\n // nullish literal, or a safeBool-family accessor whose other paths return the caller's default\n // (Boolean or null). A Long/Int/String/List box would change what isTrue answers.\n javaPrintsBooleanBoxValue(node, seen: Set): boolean {\n if (node === undefined) {\n return false;\n }\n if (node.kind === SyntaxKind.ParenthesizedExpression || node.kind === SyntaxKind.AsExpression\n || node.kind === SyntaxKind.NonNullExpression) {\n return this.javaPrintsBooleanBoxValue(node.expression, seen);\n }\n if (node.kind === SyntaxKind.NullKeyword) {\n return true;\n }\n if (node.kind === SyntaxKind.Identifier && node.text === 'undefined') {\n return true; // prints null\n }\n if (this.javaPrintsBooleanValue(node, seen)) {\n return true;\n }\n if (node.kind === SyntaxKind.Identifier && this.javaNullableBooleanBoxIdentifier(node, seen) !== undefined) {\n return true; // a local whose declared type is the nullable boolean and every write boxes\n }\n if (node.kind === SyntaxKind.Identifier && this.javaBooleanTupleBindingIdentifier(node, seen) !== undefined) {\n return true;\n }\n if (node.kind === SyntaxKind.CallExpression) {\n return this.javaCallBooleanKind(node) !== undefined;\n }\n return false;\n }\n\n // element `index` of a `[ x, params ] = this.handle*Bool (...)` destructure is a Boolean-or-null\n // box: those accessors return a safeBool result, never the raw member when not a Boolean. The\n // handleOptionAndParams family returns the raw member and is deliberately not a box proof.\n javaBooleanBoxTupleElement(node, index: number): boolean {\n if (node?.kind !== SyntaxKind.CallExpression) {\n return false;\n }\n const callee = node.expression;\n if (!isPropertyAccessExpression(callee) || callee.expression.kind !== SyntaxKind.ThisKeyword) {\n return false;\n }\n const name = String(callee.name.text);\n if (!JAVA_BOOLEAN_BOX_TUPLE_METHODS.has(name)) {\n return false;\n }\n const declaration: any = this.getChecker().getResolvedSignature(node)?.declaration?.resolve();\n if (declaration?.name?.text !== name) {\n return false; // a same-named override is not the base accessor\n }\n return index === 0;\n }\n\n // `const [ x, p ] = this.handle*Bool (...)` binds x to element 0, a Boolean-or-null box; any\n // later identifier or tuple write must also be a proven box (the D2 scan over the function)\n javaBooleanTupleBindingIdentifier(node, seen: Set = new Set()): string | undefined {\n if (node?.kind !== SyntaxKind.Identifier) {\n return undefined;\n }\n const checker: any = this.checkerOrUndefined();\n if (checker === undefined) {\n return undefined;\n }\n const symbol = checker.getSymbolAtLocation(node);\n const element = symbol?.valueDeclaration?.resolve();\n if (element === undefined || element.kind !== SyntaxKind.BindingElement || element.initializer !== undefined\n || element.dotDotDotToken !== undefined || element.name?.text !== node.text || seen.has(element)) {\n return undefined;\n }\n const pattern = element.parent;\n const declaration = pattern?.parent;\n if (pattern?.kind !== SyntaxKind.ArrayBindingPattern || declaration?.kind !== SyntaxKind.VariableDeclaration\n || !this.javaBooleanBoxTupleElement(declaration.initializer, pattern.elements.indexOf(element))) {\n return undefined;\n }\n const next = new Set(seen);\n next.add(element);\n const binding = { initializer: undefined, parent: declaration };\n if (!this.javaWritesAreBoxed(symbol, binding, next, (value) => this.javaPrintsBooleanBoxValue(value, next), true)) {\n return undefined;\n }\n return this.printNode(node, 0);\n }\n\n // the D2 scan over a nullable boolean local: every write prints a Java boolean value or a\n // proven Boolean-or-null box, so no path can leave a truthy non-boolean box in it\n javaBooleanNullableWritesAreBoxed(symbol, declaration, node, seen: Set): boolean {\n const next = new Set(seen);\n next.add(node);\n next.add(declaration); // a write scan that reaches this declaration again stops\n return this.javaWritesAreBoxed(symbol, declaration, next, (value) => this.javaPrintsBooleanBoxValue(value, next), true);\n }\n\n // `Helpers.isTrue(x)` where the DECLARED type of x is a nullable boolean and every write is a\n // proven Boolean-or-null box: `Boolean.TRUE.equals(x)` is exactly what the helper answers on\n // such a box (null and FALSE test false, TRUE tests true)\n javaNullableBooleanBoxIdentifier(node, seen: Set = new Set()): string | undefined {\n if (node?.kind !== SyntaxKind.Identifier) {\n return undefined;\n }\n const checker: any = this.checkerOrUndefined();\n if (checker === undefined) {\n return undefined;\n }\n const symbol = checker.getSymbolAtLocation(node);\n const declaration = symbol?.valueDeclaration?.resolve();\n if (declaration === undefined || declaration.name?.text !== node.text) {\n return undefined;\n }\n if (seen.has(declaration)) {\n return undefined; // a write graph that reaches this declaration again keeps the helper\n }\n if (!this.javaNullableBooleanDeclaration(declaration)) {\n return undefined;\n }\n if (!this.javaBooleanNullableWritesAreBoxed(symbol, declaration, node, seen)) {\n return undefined;\n }\n return this.printNode(node, 0);\n }\n\n // the native Java a falsy wrapper around this condition prints, or undefined to keep\n // `Helpers.isTrue(...)`: a hand-written boolean field prints bare; `Array.isArray(x)` prints\n // `Helpers.isArray(x)` (null -> false like helper); a proven Boolean box: `Boolean.TRUE.equals(x)`\n javaBooleanWrapperFreeCondition(node): string | undefined {\n if (node === undefined) {\n return undefined;\n }\n if (node.kind === SyntaxKind.ParenthesizedExpression) {\n return this.javaBooleanWrapperFreeCondition(node.expression);\n }\n if (this.isArrayIsArrayCall(node)) {\n return `(${this.printNode(node.arguments[0], 0)} instanceof java.util.List)`;\n }\n if (this.javaStringAffixCall(node)) {\n return this.printNode(node, 0);\n }\n const field = this.javaBooleanBaseField(node);\n if (field !== undefined) {\n return field;\n }\n // a `this.(...)` call whose generated body returns a boolean value on every path\n // prints a Boolean box; the bare declarations in JAVA_THIS_BOOLEAN_METHODS are printed\n // native by printCondition and are left to it\n if (node.kind === SyntaxKind.CallExpression && this.javaCallBooleanKind(node) === undefined\n && this.javaCallReturnsBooleanBox(node, new Set(), 0)) {\n return `Boolean.TRUE.equals(${this.printNode(node, 0)})`;\n }\n if (node.kind === SyntaxKind.Identifier) {\n // the ccxt-side declaration chain types a local/param `boolean`/`Boolean` inside\n // javaDeclaredLocalTypeResolver: a primitive declaration IS the condition, a box\n // needs the null-safe TRUE test the helper performs\n const declared = this.javaDeclaredBooleanKind(node);\n if (declared === 'boolean') {\n return this.printNode(node, 0);\n }\n if (declared === 'Boolean') {\n return `Boolean.TRUE.equals(${this.printNode(node, 0)})`;\n }\n }\n const box = this.javaBooleanBoxIdentifier(node, new Set()) ?? this.javaNullableBooleanBoxIdentifier(node)\n ?? this.javaBooleanTupleBindingIdentifier(node);\n return box === undefined ? undefined : `Boolean.TRUE.equals(${box})`;\n }\n\n printCondition(node, identation) {\n if (this.javaConditionPrintsBoolean(node)) {\n return this.getIden(identation) + this.printNode(node, 0);\n }\n let bareCall = node;\n while (bareCall.kind === SyntaxKind.ParenthesizedExpression) {\n bareCall = bareCall.expression;\n }\n if (bareCall.kind === SyntaxKind.CallExpression && this.javaCallPrintsNonNullBoolean(bareCall, 0)) {\n return this.getIden(identation) + this.printNode(node, 0); // a never-null Boolean unboxes safely\n }\n const wrapperFree = this.javaBooleanWrapperFreeCondition(node);\n if (wrapperFree !== undefined) {\n return this.getIden(identation) + wrapperFree;\n }\n const callKind = this.javaCallBooleanKind(bareCall);\n if (callKind === 'boolean') {\n return this.getIden(identation) + this.printNode(node, 0);\n }\n if (callKind === 'nullableBoolean') {\n // Helpers.isTrue(box) on a Boolean-or-null box is Boolean.TRUE.equals(box): null\n // and FALSE test false, TRUE tests true\n return this.getIden(identation) + `Boolean.TRUE.equals(${this.printNode(node, 0)})`;\n }\n return super.printCondition(node, identation);\n }\n\n printConditionalExpression(node, _identation) {\n const condition = this.printCondition(node.condition, 0);\n const whenTrue = this.printNode(node.whenTrue, 0);\n const whenFalse = this.printNode(node.whenFalse, 0);\n return `((${condition})) ? ${whenTrue} : ${whenFalse}`;\n }\n\n printDeleteExpression(node, _identation) {\n const object = this.printNode(node.expression.expression, 0);\n const key = this.printNode(node.expression.argumentExpression, 0);\n return `((java.util.Map)${object}).remove((String)${key})`;\n }\n\n printThrowStatement(node, identation) {\n if (node.expression.kind === SyntaxKind.Identifier) {\n // a bare rethrow (`throw e`) of a caught java.lang.Exception is a checked\n // exception, which the surrounding async lambdas cannot declare - keep\n // unchecked exceptions (ccxt errors extend RuntimeException) as-is and\n // wrap checked ones, preserving the original as the cause\n const name = this.printNode(node.expression, 0);\n return (\n this.getIden(identation) +\n `${this.THROW_TOKEN} (${name} instanceof RuntimeException ? (RuntimeException)${name} : new RuntimeException(${name}))${this.LINE_TERMINATOR}`\n );\n }\n if (node.expression.kind === SyntaxKind.NewExpression) {\n const expression = node.expression;\n const argumentsExp = expression?.arguments ?? [];\n const parsedArg = argumentsExp.map((n) => this.printNode(n, 0)).join(\",\") ?? \"\";\n const newExpression = this.printNode(expression.expression, 0);\n if (expression.expression.kind === SyntaxKind.Identifier) {\n const id = expression.expression;\n // java.lang.Error is a sibling of Exception under Throwable, so\n // `catch (Exception e)` won't catch it. Map JS/TS `Error` to\n // RuntimeException so standard catch blocks work.\n const exceptionName = id.text === \"Error\" ? \"RuntimeException\" : id.text;\n const symbol = this.getChecker().getSymbolAtLocation(expression.expression);\n if (symbol) {\n const declarations =\n (this.getChecker().getDeclaredTypeOfSymbol(symbol).getSymbol()?.declarations ?? []).map((d) => d.resolve());\n const isClassDeclaration = declarations.find(\n (l) =>\n l.kind === SyntaxKind.InterfaceDeclaration ||\n l.kind === SyntaxKind.ClassDeclaration\n );\n if (isClassDeclaration) {\n return (\n this.getIden(identation) +\n `${this.THROW_TOKEN} ${this.NEW_TOKEN} ${exceptionName}((String)${parsedArg}) ${this.LINE_TERMINATOR}`\n );\n } else {\n return (\n this.getIden(identation) +\n `Helpers.throwDynamicException(${exceptionName}, ${parsedArg});return null;`\n );\n }\n }\n return (\n this.getIden(identation) +\n `${this.THROW_TOKEN} ${this.NEW_TOKEN} ${exceptionName}(${parsedArg}) ${this.LINE_TERMINATOR}`\n );\n } else if (expression.expression.kind === SyntaxKind.ElementAccessExpression) {\n return this.getIden(identation) + `Helpers.throwDynamicException(${newExpression}, ${parsedArg});`;\n }\n return super.printThrowStatement(node, identation);\n }\n }\n\n csModifiers = {};\n\n printPropertyAccessModifiers(node) {\n let modifiers = this.printModifiers(node);\n if (modifiers === \"\") {\n modifiers = this.defaultPropertyAccess;\n }\n // add type\n let typeText = \"Object\";\n if (node.type) {\n typeText = this.getType(node);\n if (!typeText) {\n if (node.type.kind === SyntaxKind.AnyKeyword) {\n typeText = this.OBJECT_KEYWORD + \" \";\n }\n }\n }\n return modifiers + \" \" + typeText + \" \";\n }\n\n printModifiers(node) {\n let modifiers = node.modifiers;\n if (modifiers === undefined) {\n return \"\";\n }\n modifiers = modifiers.filter(mod => this.FuncModifiers[mod.kind] && mod.kind !== SyntaxKind.AsyncKeyword);\n return modifiers.map(modifier => this.FuncModifiers[modifier.kind]).join(\" \");\n }\n\n // literals printed as `Helpers.newMap(k, v, ...)` (no anonymous class, so no capture rule)\n builderObjectLiterals: WeakSet = new WeakSet();\n\n printObjectLiteralExpression(node, identation) {\n if (node.properties.length > 0 && node.properties.every((p) => isPropertyAssignment(p)) &&\n this.objectLiteralCapturesReassigned(node)) {\n this.builderObjectLiterals.add(node);\n return this.printObjectLiteralBuilder(node, identation);\n }\n this.builderObjectLiterals.delete(node);\n const objectBody = this.printObjectLiteralBody(node, identation);\n const formattedObjectBody = objectBody ? \"\\n\" + objectBody + \"\\n\" + this.getIden(identation) : objectBody;\n return this.OBJECT_OPENING + formattedObjectBody + this.OBJECT_CLOSING;\n }\n\n printObjectLiteralBuilder(node, identation) {\n // a comparison inside the values must not mark a captured local as reassigned\n // (that flag drives the async-parameter copies and the typed-parameter write casts)\n const keys = this.objectLiteralCapturedKeys(node);\n const saved = keys.map((key) => this.ReassignedVars[key]);\n try {\n return this.printObjectLiteralBuilderText(node, identation);\n } finally {\n keys.forEach((key, i) => {\n if (saved[i] === undefined) {\n delete this.ReassignedVars[key];\n } else {\n this.ReassignedVars[key] = saved[i];\n }\n });\n }\n }\n\n printObjectLiteralBuilderText(node, identation) {\n const props = node.properties;\n const lines = props.map((prop, i) => {\n const name = this.printNode(prop.name, 0);\n const custom = this.printCustomRightSidePropertyAssignment(prop.initializer, identation + 1);\n const value = (custom ? custom : this.printNode(prop.initializer, identation + 1)).trim();\n let comment = this.printTraillingComment(prop, identation + 1);\n comment = comment ? \" \" + comment : \"\";\n const sep = i < props.length - 1 ? \",\" : \"\";\n return this.getIden(identation + 1) + name + \", \" + value + sep + comment;\n });\n return \"Helpers.newMap(\\n\" + lines.join(\"\\n\") + \"\\n\" + this.getIden(identation) + \")\";\n }\n\n printObjectLiteralBody(node, identation) {\n const body = node.properties.map((p) => this.printNode(p, identation+1)).join(\"\\n\");\n // body = body.replaceAll('this.', `${name}.this.`);\n return body;\n }\n\n printForStatement(node, identation) {\n const initializer = this.printNode(node.initializer, 0).replace('Object ', 'var ');\n const condition = this.printNode(node.condition, 0);\n const incrementor = this.printNode(node.incrementor, 0);\n\n const forStm = this.getIden(identation) +\n this.FOR_TOKEN + \" \" +\n this.CONDITION_OPENING +\n initializer + \"; \" + condition + \"; \" + incrementor +\n this.CONDITION_CLOSE +\n this.printBlock(node.statement, identation);\n return this.printNodeCommentsIfAny(node, identation, forStm);\n }\n\n printReturnStatement(node, identation) {\n const leadingComment = this.printLeadingComments(node, identation);\n let trailingComment = this.printTraillingComment(node, identation);\n trailingComment = trailingComment ? \" \" + trailingComment : trailingComment;\n let exp = node.expression;\n if (exp && exp.kind === SyntaxKind.AsExpression && (exp.expression.kind === SyntaxKind.ObjectLiteralExpression || SyntaxKind.CallExpression)) {\n exp = exp.expression; // go over something like return {} as SomeType\n }\n let rightPart = exp ? (' ' + this.printNode(exp, identation)) : '';\n rightPart = rightPart.trim();\n if (!rightPart) {\n // bare return; — check if inside async method (supplyAsync lambda needs return null)\n let parent = node.parent;\n while (parent) {\n if (isFunctionDeclaration(parent) || isMethodDeclaration(parent) || isFunctionExpression(parent) || isArrowFunction(parent)) {\n if (this.isAsyncFunction(parent)) {\n rightPart = 'null';\n }\n break;\n }\n parent = parent.parent;\n }\n }\n rightPart = rightPart ? ' ' + rightPart + this.LINE_TERMINATOR : this.LINE_TERMINATOR;\n return leadingComment + this.getIden(identation) + this.RETURN_TOKEN + rightPart + trailingComment;\n }\n\n private allBranchesTerminate(node: Node): boolean {\n if (isReturnStatement(node) || isThrowStatement(node)) {\n return true;\n }\n if (isBlock(node)) {\n const stmts = node.statements;\n return stmts.length > 0 && this.allBranchesTerminate(stmts[stmts.length - 1]);\n }\n if (isIfStatement(node)) {\n if (!node.elseStatement) {\n return false; // no else: not all paths covered\n }\n return this.allBranchesTerminate(node.thenStatement) && this.allBranchesTerminate(node.elseStatement);\n }\n return false;\n }\n}\n","import { BaseTranspiler } from \"./baseTranspiler.js\";\nimport { SyntaxKind, type Block, type CallExpression, type Declaration, type Expression, type Identifier, type Node, type NodeArray, type ParameterDeclaration, type SourceFile, type VariableDeclaration } from \"typescript/unstable/ast\";\nimport { isArrayLiteralExpression, isArrowFunction, isAsExpression, isBinaryExpression, isBindingElement, isBlock, isCallExpression, isClassDeclaration, isClassExpression, isConditionalExpression, isDeleteExpression, isElementAccessExpression, isForInStatement, isForOfStatement, isIdentifier, isMethodDeclaration, isNoSubstitutionTemplateLiteral, isNonNullExpression, isNumericLiteral, isObjectLiteralExpression, isParameterDeclaration, isParenthesizedExpression, isPrefixUnaryExpression, isPropertyAccessExpression, isReturnStatement, isShorthandPropertyAssignment, isSourceFile, isStatement, isStringLiteral, isStringLiteralLikeNode, isTypeAssertion, isVariableDeclaration } from \"typescript/unstable/ast/is\";\nimport { IndexKind, ObjectFlags, SignatureKind, SymbolFlags, TypeFlags, type Symbol as TsSymbol, type Type } from \"typescript/unstable/sync\";\nimport { findAncestor, getAllSuperTypeNodes, isFunctionLike, signatureDeclaration, symbolDeclarations, symbolValueDeclaration, typeParts, typeTarget } from \"./tsUtils.js\";\n\nconst parserConfig = {\n 'ELSEIF_TOKEN': 'else if',\n 'OBJECT_OPENING': '{',\n 'OBJECT_CLOSING': '}',\n 'ARRAY_OPENING_TOKEN': 'Value::from(vec![',\n 'ARRAY_CLOSING_TOKEN': '])',\n 'PROPERTY_ASSIGNMENT_TOKEN': ':',\n 'VAR_TOKEN': 'let mut',\n 'METHOD_TOKEN': 'fn',\n 'FUNCTION_TOKEN': 'fn',\n 'PROPERTY_ASSIGNMENT_OPEN': '',\n 'PROPERTY_ASSIGNMENT_CLOSE': '',\n 'SUPER_TOKEN': 'super',\n 'SUPER_CALL_TOKEN': 'super',\n 'FALSY_WRAPPER_OPEN': 'is_true(&',\n 'FALSY_WRAPPER_CLOSE': ')',\n 'COMPARISON_WRAPPER_OPEN': 'is_equal(&',\n 'COMPARISON_WRAPPER_CLOSE': ')',\n 'UKNOWN_PROP_WRAPPER_OPEN': '',\n 'UNKOWN_PROP_WRAPPER_CLOSE': '',\n 'UKNOWN_PROP_ASYNC_WRAPPER_OPEN': '',\n 'UNKOWN_PROP_ASYNC_WRAPPER_CLOSE': '',\n 'DYNAMIC_CALL_OPEN': '',\n 'EQUALS_EQUALS_WRAPPER_OPEN': 'is_equal(&',\n 'EQUALS_EQUALS_WRAPPER_CLOSE': ')',\n 'DIFFERENT_WRAPPER_OPEN': '!is_equal(&',\n 'DIFFERENT_WRAPPER_CLOSE': ')',\n 'GREATER_THAN_WRAPPER_OPEN': 'is_greater_than(&',\n 'GREATER_THAN_WRAPPER_CLOSE': ')',\n 'GREATER_THAN_EQUALS_WRAPPER_OPEN': 'is_greater_than_or_equal(&',\n 'GREATER_THAN_EQUALS_WRAPPER_CLOSE': ')',\n 'LESS_THAN_WRAPPER_OPEN': 'is_less_than(&',\n 'LESS_THAN_WRAPPER_CLOSE': ')',\n 'LESS_THAN_EQUALS_WRAPPER_OPEN': 'is_less_than_or_equal(&',\n 'LESS_THAN_EQUALS_WRAPPER_CLOSE': ')',\n 'PLUS_WRAPPER_OPEN': 'add(&',\n 'PLUS_WRAPPER_CLOSE': ')',\n 'MINUS_WRAPPER_OPEN': 'subtract(&',\n 'MINUS_WRAPPER_CLOSE': ')',\n 'ARRAY_LENGTH_WRAPPER_OPEN': 'get_array_length(&',\n 'ARRAY_LENGTH_WRAPPER_CLOSE': ')',\n 'DIVIDE_WRAPPER_OPEN': 'divide(&',\n 'DIVIDE_WRAPPER_CLOSE': ')',\n 'MULTIPLY_WRAPPER_OPEN': 'multiply(&',\n 'MULTIPLY_WRAPPER_CLOSE': ')',\n 'INDEXOF_WRAPPER_OPEN': 'get_index_of(&',\n 'INDEXOF_WRAPPER_CLOSE': ')',\n 'MOD_WRAPPER_OPEN': 'mod_val(&',\n 'MOD_WRAPPER_CLOSE': ')',\n 'LINE_TERMINATOR': ';',\n 'CONDITION_OPENING': '',\n 'CONDITION_CLOSE': '',\n 'AWAIT_TOKEN': '',\n 'NULL_TOKEN': 'Value::Null',\n 'UNDEFINED_TOKEN': 'Value::Null',\n 'WHILE_TOKEN': 'while',\n 'ELEMENT_ACCESS_WRAPPER_OPEN': 'get_value(&',\n 'ELEMENT_ACCESS_WRAPPER_CLOSE': ')',\n 'DEFAULT_PARAMETER_TYPE': 'Value',\n 'DEFAULT_RETURN_TYPE': 'Value',\n 'BLOCK_OPENING_TOKEN': '{',\n 'TRUE_KEYWORD': 'Value::Bool(true)',\n 'FALSE_KEYWORD': 'Value::Bool(false)',\n};\n\n/** Answer of `RustTranspiler.rustDeclaredLocalTypeResolver` for a local whose\n * value provably holds a `Value::Dict` at every use. */\nexport type RustDeclaredLocalKind = 'dict';\n\n/** One `let x: Value = ` declaration. `kind` is only\n * answered by the resolver when `alwaysDict && stable`. */\nexport interface RustDeclaredDictLocalEntry {\n kind: RustDeclaredLocalKind;\n name: string;\n /** printed callee of the initialiser: a `safe_dict*` name, or `value_map`. */\n source: string;\n /** the `safe_dict*` `optionalArgs` default is itself Dict-proven, so the\n * helper returns a Dict on every path (it returns that default when the\n * key does not hold one). */\n alwaysDict: boolean;\n /** no later write in the enclosing function can change the kind (D2). */\n stable: boolean;\n /** use census: element-access receiver / kind-preserving mutator / anything else. */\n uses: { elementAccess: number, mutHelper: number, other: number };\n declaration: VariableDeclaration;\n start: number;\n}\n\n/** A `Dict`/`List` parameter whose body uses are all printable reads: the\n * printer re-binds the same name to a borrowed container at fn entry\n * (`let x = x.as_map().unwrap_or(&__x_empty);`) so every read is native. */\nexport interface RustParamShadow {\n kind: RustParamShadowKind;\n /** the parameter name; the shadow re-binds it, the `Value` ABI is untouched. */\n name: string;\n declaration: ParameterDeclaration;\n}\n\n/** Shadow kinds: `&IndexMap` / `&Vec` (D-25). */\nexport type RustParamShadowKind = 'map' | 'list';\n\n/** Vocabulary of the parameter-shadow table (`RustTranspiler.rustParamShadowOf`). */\nexport const RUST_PARAM_SHADOWS = {\n MAP: 'map' as RustParamShadowKind,\n LIST: 'list' as RustParamShadowKind,\n /** `this.` reads inlined natively against a shadowed dict param. */\n SAFE_READS: new Set([\n 'safeValue', 'safeString', 'safeInteger', 'safeNumber', 'safeBool',\n 'safeDict', 'safeList',\n ]),\n};\n\n/** Vocabulary of the declared-Dict locals table (see\n * `RustTranspiler.rustDeclaredLocalTypeResolver`). */\nexport const RUST_DECLARED_DICT_LOCALS = {\n /** value the resolver answers for a proven Dict local */\n DICT: 'dict' as RustDeclaredLocalKind,\n /** printed `self.` -> index of its `optionalArgs` parameter.\n * `safe_dict*` returns `optional_args[0]` whenever the key holds a non-Dict. */\n SAFE_CALLEES: {\n safe_dict_k: 2,\n safe_dict: 2,\n safe_dict_n: 2,\n safe_dict2: 3,\n } as Record,\n /** `&mut` receivers whose writes land inside the container, so a Dict local\n * stays a Dict (`add_element_to_object` / `append_to_array` no-op on a\n * non-container, `set_value` / `remove` write a key). */\n KIND_PRESERVING_MUTATORS: new Set([\n 'add_element_to_object', 'append_to_array', 'set_value', 'remove',\n 'get_value_mut',\n ]),\n};\n\n/** `x = ..` / `x += ..` — every token that writes a place. */\nfunction rustIsAssignmentOperator(kind: SyntaxKind): boolean {\n return kind === SyntaxKind.EqualsToken ||\n (kind >= SyntaxKind.PlusEqualsToken && kind <= SyntaxKind.CaretEqualsToken);\n}\n\n/** Preorder (forEachChild order) of a scope's descendants, decoded once: `end[i]` is the index past\n * node i's subtree; `byName` lists identifiers and name-binding declarations per name text. */\ninterface RustScopeIndex {\n nodes: Node[];\n end: number[];\n byName: Map | undefined;\n}\n\nconst RUST_NAME_BINDER_KINDS = new Set([\n SyntaxKind.VariableDeclaration, SyntaxKind.Parameter, SyntaxKind.FunctionDeclaration,\n SyntaxKind.ClassDeclaration, SyntaxKind.PropertyDeclaration, SyntaxKind.FunctionExpression,\n SyntaxKind.ArrowFunction,\n]);\n\nconst RUST_WALK_SKIP = 1;\nconst RUST_WALK_STOP = 2;\n\nfunction rustBuildScopeIndex(scope: Node): RustScopeIndex {\n const nodes: Node[] = [];\n const end: number[] = [];\n const visit = (n: any) => {\n const i = nodes.length;\n nodes.push(n);\n end.push(0);\n n.forEachChild(visit);\n end[i] = nodes.length;\n };\n scope.forEachChild(visit);\n return { nodes, end, byName: undefined };\n}\n\n// name text decoding is the costly part, so the name table is built on first use only\nfunction rustScopeNameTable(index: RustScopeIndex): Map {\n if (index.byName !== undefined) return index.byName;\n const byName = new Map();\n const add = (name: string, i: number) => {\n const list = byName.get(name);\n if (list === undefined) byName.set(name, [i]);\n else if (list[list.length - 1] !== i) list.push(i);\n };\n const nodes: any[] = index.nodes;\n for (let i = 0; i < nodes.length; i++) {\n const n = nodes[i];\n const kind = n.kind;\n if (RUST_NAME_BINDER_KINDS.has(kind) && n.name?.kind === SyntaxKind.Identifier) add(n.name.text, i);\n if (kind === SyntaxKind.Identifier) add(n.text, i);\n }\n index.byName = byName;\n return byName;\n}\n\nexport class RustTranspiler extends BaseTranspiler {\n\n private rustScopeIndexes = new WeakMap();\n\n rustScopeIndex(scope: Node): RustScopeIndex {\n let index = this.rustScopeIndexes.get(scope);\n if (index === undefined) {\n index = rustBuildScopeIndex(scope);\n this.rustScopeIndexes.set(scope, index);\n }\n return index;\n }\n\n /** `scope.forEachChild(visit)` recursion over the cached preorder: `visit` answers\n * RUST_WALK_SKIP to skip the node's subtree, RUST_WALK_STOP to end the walk. */\n rustWalkScope(scope: Node, visit: (n: any) => number | void): void {\n const { nodes, end } = this.rustScopeIndex(scope);\n for (let i = 0; i < nodes.length;) {\n const r = visit(nodes[i]);\n if (r === RUST_WALK_STOP) return;\n i = r === RUST_WALK_SKIP ? end[i] : i + 1;\n }\n }\n\n /** Scope nodes that are an identifier or a name-binding declaration spelled `name`, in walk order. */\n rustScopeNameNodes(scope: Node, name: string): Node[] {\n const index = this.rustScopeIndex(scope);\n return (rustScopeNameTable(index).get(name) ?? []).map((i) => index.nodes[i]);\n }\n\n // node kinds the printer types that the core per-file prefetch leaves to single round trips\n private static readonly RUST_PREFETCH_TYPE_KINDS = new Set([\n SyntaxKind.FalseKeyword, SyntaxKind.TrueKeyword, SyntaxKind.ParenthesizedExpression,\n SyntaxKind.AwaitExpression, SyntaxKind.PrefixUnaryExpression,\n SyntaxKind.BooleanKeyword, SyntaxKind.ObjectKeyword, SyntaxKind.UnionType,\n SyntaxKind.ConditionalExpression, SyntaxKind.AsExpression,\n ]);\n\n /** One bulk getTypeAtLocation for the class's nodes of those kinds, seeding the checker memo. */\n rustPrefetchClassTypes(node: Node): void {\n const getType: any = this.checkerOrUndefined()?.getTypeAtLocation;\n if (getType?.seed === undefined || getType.original === undefined) return;\n const kinds = RustTranspiler.RUST_PREFETCH_TYPE_KINDS;\n const nodes: Node[] = [];\n for (const n of this.rustScopeIndex(node).nodes) {\n if (kinds.has(n.kind) && !getType.has(n)) nodes.push(n);\n }\n if (nodes.length === 0) return;\n let results: unknown[];\n try {\n results = getType.original(nodes);\n } catch (e) {\n return; // the lazy per-node path answers them\n }\n nodes.forEach((n, i) => getType.seed(n, results[i]));\n }\n\n binaryExpressionsWrappers;\n methodSignatures: Record;\n forLoopCounter: number;\n /** The handler `message` parameter a shadow is being printed for (set only\n * while its method body is printed). */\n rustProHandlerShadowParam: ParameterDeclaration | undefined;\n\n constructor(config = {}) {\n config['parser'] = Object.assign({}, parserConfig, config['parser'] ?? {});\n super(config);\n\n this.requiresParameterType = true;\n this.requiresReturnType = false;\n this.asyncTranspiling = true;\n this.supportsFalsyOrTruthyValues = false;\n this.id = \"Rust\";\n this.className = \"undefined\";\n this.methodSignatures = {};\n this.forLoopCounter = 0;\n\n this.initConfig();\n this.applyUserOverrides(config);\n }\n\n initConfig() {\n this.LeftPropertyAccessReplacements = {};\n\n this.RightPropertyAccessReplacements = {};\n\n this.FullPropertyAccessReplacements = {\n 'console.log': 'println_val',\n 'Math.floor': 'math_floor',\n 'Math.ceil': 'math_ceil',\n 'Math.round': 'math_round',\n };\n\n this.CallExpressionReplacements = {};\n\n this.ReservedKeywordsReplacements = {\n 'type': 'type_var',\n 'move': 'move_val',\n 'ref': 'ref_val',\n 'str': 'str_val',\n 'use': 'use_val',\n 'mod': 'mod_kw',\n 'loop': 'loop_val',\n 'match': 'match_val',\n 'where': 'where_val',\n 'final': 'final_val',\n 'box': 'box_val',\n 'become': 'become_val',\n 'priv': 'priv_val',\n 'override': 'override_val',\n 'unsized': 'unsized_val',\n 'async': 'async_val',\n 'await': 'await_val',\n 'try': 'try_val',\n 'abstract': 'abstract_val',\n 'dyn': 'dyn_val',\n 'fn': 'fn_val',\n 'impl': 'impl_val',\n 'pub': 'pub_val',\n 'self': 'self_val',\n 'super': 'super_val',\n 'crate': 'crate_val',\n };\n\n // [fnName, close] — ensureRef adds & to each operand\n this.binaryExpressionsWrappers = {\n [SyntaxKind.EqualsEqualsToken]: ['is_equal(', ')'],\n [SyntaxKind.EqualsEqualsEqualsToken]: ['is_equal(', ')'],\n [SyntaxKind.ExclamationEqualsToken]: ['!is_equal(', ')'],\n [SyntaxKind.ExclamationEqualsEqualsToken]: ['!is_equal(', ')'],\n [SyntaxKind.GreaterThanToken]: ['is_greater_than(', ')'],\n [SyntaxKind.GreaterThanEqualsToken]: ['is_greater_than_or_equal(', ')'],\n [SyntaxKind.LessThanToken]: ['is_less_than(', ')'],\n [SyntaxKind.LessThanEqualsToken]: ['is_less_than_or_equal(', ')'],\n [SyntaxKind.PlusToken]: ['add(', ')'],\n [SyntaxKind.MinusToken]: ['subtract(', ')'],\n [SyntaxKind.AsteriskToken]: ['multiply(', ')'],\n [SyntaxKind.PercentToken]: ['mod_val(', ')'],\n [SyntaxKind.SlashToken]: ['divide(', ')'],\n };\n }\n\n // Escaped Rust string literal for the given TS literal text — shared by\n // the `Value::Str(..)` form and the `&str` key form below.\n quotedStringLiteral(text: string): string {\n // Preserve real backslashes\n const backslashPlaceholder = \"\\x00\";\n text = text.replaceAll(\"\\\\\", backslashPlaceholder);\n text = text.replaceAll(\"\\b\", \"\\\\b\");\n text = text.replaceAll(\"\\f\", \"\\\\f\");\n text = text.replaceAll(\"\\n\", \"\\\\n\");\n text = text.replaceAll(\"\\r\", \"\\\\r\");\n text = text.replaceAll(\"\\t\", \"\\\\t\");\n text = text.replaceAll(backslashPlaceholder, \"\\\\\\\\\");\n text = text.replaceAll('\"', '\\\\\"');\n return `\"${text}\"`;\n }\n\n printStringLiteral(node) {\n const text = node.text;\n if (text in this.StringLiteralReplacements) return this.StringLiteralReplacements[text];\n // `.into()` borrows the `&'static str` into the `Cow` payload — no alloc.\n return `Value::Str(${this.quotedStringLiteral(text)}.into())`;\n }\n\n printNumericLiteral(node) {\n const text = node.text;\n // a decimal point or an exponent makes the literal a float\n if (text.includes('.') || /[eE]/.test(text)) return `Value::Float(${text})`;\n return `Value::Int(${text})`;\n }\n\n printBooleanLiteral(node) {\n return `Value::Bool(${SyntaxKind.TrueKeyword === node.kind})`;\n }\n\n printNullKeyword(node, identation) {\n return 'Value::Null';\n }\n\n // ── native equality emission ────────────────────────────────────────────\n // When the checker proves both operands hold the same primitive payload\n // (string / number / boolean, or one side is a matching literal) the\n // unwrapped payloads are compared with `==`/`!=` instead of is_equal().\n\n // Operators whose printed form is a bare Rust `bool` (not a Value).\n private static readonly BOOL_PRODUCING_OPERATORS = new Set([\n SyntaxKind.EqualsEqualsToken,\n SyntaxKind.EqualsEqualsEqualsToken,\n SyntaxKind.ExclamationEqualsToken,\n SyntaxKind.ExclamationEqualsEqualsToken,\n SyntaxKind.LessThanToken,\n SyntaxKind.LessThanEqualsToken,\n SyntaxKind.GreaterThanToken,\n SyntaxKind.GreaterThanEqualsToken,\n SyntaxKind.AmpersandAmpersandToken,\n SyntaxKind.BarBarToken,\n SyntaxKind.InstanceOfKeyword,\n ]);\n\n // Method names whose Rust helper returns a bare `bool` (not a Value).\n private static readonly BOOL_PRODUCING_CALLS = new Set([\n 'isInteger',\n 'isSafeInteger',\n 'some',\n 'every',\n 'test',\n ]);\n\n // Receiver locals whose element writes may go native (rust-13). `request`\n // is rust-12's family; every other receiver keeps the helper.\n private static readonly RUST_NATIVE_INSERT_RECEIVERS = new Set([\n 'result',\n 'account',\n 'params',\n 'fee',\n ]);\n\n // Scalar book fields the shared order-book store keeps instead of the Dict\n // (value.rs `is_book_meta_key` plus the `cache` replacement write).\n private static readonly RUST_BOOK_META_KEYS = new Set([\n 'timestamp',\n 'datetime',\n 'nonce',\n 'symbol',\n 'checksum',\n 'cache',\n ]);\n\n // `this.` receivers whose Value may be a tagged live handle (order\n // book / cache / ws client / subscriptions snapshot) — these keep the helper\n // so its store write-through stays reachable.\n private static readonly RUST_TAGGED_HANDLE_FIELDS = new Set([\n 'cache',\n 'client',\n 'subscriptions',\n 'orderbook',\n ]);\n\n // Fields the hand-written base keeps as a plain dict: `rust/ccxt-base/src/exchange.rs`\n // initialises each to `Value::Map(HashMap::new())` and never tags it, so an element write\n // is the whole helper even though the TS declaration is `any` (no checker shape to read).\n private static readonly RUST_PLAIN_DICT_FIELDS = new Set([\n 'balance',\n 'orderbooks',\n 'trades',\n 'tickers',\n 'bidsasks',\n 'ohlcvs',\n 'clients',\n 'transactions',\n 'headers',\n 'currencies',\n 'has',\n 'tokenBucket',\n ]);\n\n // Free helpers whose call prints a bare `bool` — an argument position that\n // expects a `Value` has to box them (ccxt's wrapBoolValueArgs set).\n private static readonly RUST_BOOL_VALUE_HELPERS = [\n 'is_equal',\n 'is_true',\n 'is_greater_than',\n 'is_less_than',\n 'is_greater_than_or_equal',\n 'is_less_than_or_equal',\n 'is_array',\n 'is_object',\n 'in_op',\n 'is_number',\n 'is_string',\n ];\n\n // Payload accessor used to compare each primitive kind natively.\n private static readonly PAYLOAD_ACCESSORS = {\n 'string': 'as_str',\n 'number': 'as_f64',\n 'boolean': 'as_bool',\n };\n\n // Primitive kind the checker proves for `type`; a union keeps the kind only\n // when every non-nullable member is that same primitive.\n primitiveKindOfType(type): string {\n if (type === undefined) return undefined;\n const flags = type.flags;\n if (this.isStringType(flags)) return 'string';\n if (flags === TypeFlags.Number || flags === TypeFlags.NumberLiteral) return 'number';\n if (flags === TypeFlags.Boolean || flags === TypeFlags.BooleanLiteral) return 'boolean';\n if (flags & TypeFlags.Union) {\n let kind = undefined;\n for (const member of typeParts(type) ?? []) {\n if (member.flags & (TypeFlags.Undefined | TypeFlags.Null)) {\n continue;\n }\n const memberKind = this.primitiveKindOfType(member);\n if (memberKind === undefined || (kind !== undefined && kind !== memberKind)) return undefined;\n kind = memberKind;\n }\n return kind;\n }\n return undefined;\n }\n\n // Native truthiness of a checker-proved boolean Value: `is_true(&v)` is `v.is_truthy()`\n // (`\"\"`/`0`/`[]`/`{}`/Null are false). When the operand is proven `bool`/`undefined` only,\n // the runtime value is `Value::Bool(..)` or `Value::Null`, so `matches!(v, Value::Bool(true))`.\n\n /** `true` / `false` / `boolean` (a union of BooleanLiteral members too). */\n isBooleanValueType(type: Type | undefined): boolean {\n if (type === undefined) return false;\n if (type.flags & TypeFlags.Union) {\n const members: Type[] = typeParts(type) ?? [];\n return members.length > 0 && members.every((member) => this.isBooleanValueType(member));\n }\n return (type.flags & (TypeFlags.Boolean | TypeFlags.BooleanLiteral)) !== 0;\n }\n\n /** `boolean | undefined`: `undefined`/`null` both print `Value::Null` (false\n * for the helper and for the `matches!` alike), so they may join the union. */\n isBooleanOrUndefinedType(type: Type | undefined): boolean {\n if (type === undefined) return false;\n const members: Type[] = (type.flags & TypeFlags.Union) ? (typeParts(type) ?? []) : [type];\n if (members.length === 0) return false;\n const onlyBooleanOrEmpty = members.every((member) =>\n this.isBooleanValueType(member) ||\n (member.flags & (TypeFlags.Undefined | TypeFlags.Void | TypeFlags.Null)) !== 0);\n return onlyBooleanOrEmpty && members.some((member) => this.isBooleanValueType(member));\n }\n\n /** Operands this unit owns: `safeBool`/`safeBool2`/`safeBoolN` calls (a\n * `Value` in the port) and element accesses (printed as `get_value`). */\n isBooleanValueFamilyOperand(node): boolean {\n const inner = this.unwrapParens(node);\n if (inner === undefined) return false;\n if (isElementAccessExpression(inner)) return true;\n if (isCallExpression(inner)) {\n const name = this.callExpressionName(inner);\n return name === 'safeBool' || name === 'safeBool2' || name === 'safeBoolN';\n }\n return false;\n }\n\n /** The emitted `matches!` is a bare Rust `bool`: it is only valid where the\n * whole enclosing boolean expression already sits in a bool slot. A logical\n * expression stored in a `Value` slot gets its `Value::Bool(..)` box from the\n * ccxt post-passes, which key on the leading helper token the operand would\n * no longer provide. */\n isBareBoolEmissionSafe(node): boolean {\n return this.isBooleanPosition(this.rustClimbLogicalWrappers(node));\n }\n\n /** Outermost ancestor reached through parens, `!` and `&&`/`||`. */\n rustClimbLogicalWrappers(node): any {\n let current: any = node;\n let parent: any = current.parent;\n while (parent !== undefined && (isParenthesizedExpression(parent) ||\n (parent.kind === SyntaxKind.PrefixUnaryExpression && parent.operator === SyntaxKind.ExclamationToken) ||\n (parent.kind === SyntaxKind.BinaryExpression &&\n (parent.operatorToken.kind === SyntaxKind.AmpersandAmpersandToken ||\n parent.operatorToken.kind === SyntaxKind.BarBarToken)))) {\n current = parent;\n parent = parent.parent;\n }\n return current;\n }\n\n // B-26 extends the proof with the printer's own bool-typed sinks: a narrowed `let x: bool = …`\n // (getRustBoolLocalInitializer) and a logical boxed in `Value::Bool(…)`\n // (printCustomBinaryExpressionIfAny) both demand a `bool`, so their operands may print bare.\n rustConditionBoolSlot(node): boolean {\n if (this.isBareBoolEmissionSafe(node)) return true;\n const current = this.rustClimbLogicalWrappers(node);\n // A logical the printer boxes (`Value::Bool()`) for a Value slot.\n const inner = this.unwrapParens(current);\n if (inner !== undefined && inner.kind === SyntaxKind.BinaryExpression &&\n (inner.operatorToken.kind === SyntaxKind.AmpersandAmpersandToken ||\n inner.operatorToken.kind === SyntaxKind.BarBarToken) &&\n (this.hasNativeComparisonOperand(inner.left) || this.hasNativeComparisonOperand(inner.right))) {\n return true;\n }\n // The initializer of a local this printer declares `bool`.\n const declaration: any = current.parent;\n if (declaration === undefined || !isVariableDeclaration(declaration) ||\n declaration.initializer !== current || declaration.name?.kind !== SyntaxKind.Identifier) {\n return false;\n }\n return this.rustNodeIsBoolExpression(declaration.initializer) &&\n this.rustTypeIsBoolean(declaration.initializer) &&\n this.rustLocalUsesAcceptBool(declaration, String(declaration.name.text));\n }\n\n /** Native truthiness text of the operand, or undefined to keep `is_true`. */\n printNativeTruthiness(node): string | undefined {\n if (!this.isBooleanValueFamilyOperand(node) || !this.printsValueExpression(node) ||\n !this.isBooleanOrUndefinedType(this.typeOfNodeIfAny(node)) || !this.isBareBoolEmissionSafe(node)) {\n return undefined;\n }\n return `matches!(${this.printNode(node, 0)}, Value::Bool(true))`;\n }\n\n // Kind of a literal operand whose printed Value variant is exactly known.\n literalKindOfNode(node): string {\n if (node === undefined) return undefined;\n switch (node.kind) {\n case SyntaxKind.StringLiteral: return 'string';\n case SyntaxKind.NumericLiteral: return 'number';\n case SyntaxKind.TrueKeyword:\n case SyntaxKind.FalseKeyword: return 'boolean';\n case SyntaxKind.NullKeyword: return 'null';\n case SyntaxKind.Identifier: return node.text === 'undefined' ? 'null' : undefined;\n }\n return undefined;\n }\n\n // Does printNode() render `node` as a Rust `Value` (and not a bare bool)?\n printsValueExpression(node): boolean {\n if (node === undefined) return false;\n switch (node.kind) {\n case SyntaxKind.ParenthesizedExpression: return this.printsValueExpression(node.expression);\n case SyntaxKind.AwaitExpression: return this.printsValueExpression(node.expression);\n case SyntaxKind.BinaryExpression: return !RustTranspiler.BOOL_PRODUCING_OPERATORS.has(node.operatorToken.kind);\n case SyntaxKind.PrefixUnaryExpression: return node.operator !== SyntaxKind.ExclamationToken;\n case SyntaxKind.CallExpression: return !RustTranspiler.BOOL_PRODUCING_CALLS.has(this.callExpressionName(node));\n case SyntaxKind.Identifier:\n case SyntaxKind.PropertyAccessExpression:\n case SyntaxKind.ElementAccessExpression:\n return !this.isClassInstanceType(this.getChecker().getTypeAtLocation(node));\n case SyntaxKind.StringLiteral:\n case SyntaxKind.NumericLiteral:\n case SyntaxKind.TrueKeyword:\n case SyntaxKind.FalseKeyword:\n case SyntaxKind.NullKeyword:\n case SyntaxKind.ArrayLiteralExpression:\n case SyntaxKind.ObjectLiteralExpression:\n case SyntaxKind.ConditionalExpression:\n return true;\n }\n return false;\n }\n\n // Class instances are emitted as their Rust struct (not a Value), so they\n // can neither be compared to Value::Null nor unwrapped with as_*().\n callExpressionName(node): string {\n const expression = node.expression;\n if (isIdentifier(expression)) return expression.text as string;\n if (isPropertyAccessExpression(expression)) return expression.name.text as string;\n return '';\n }\n\n // Does a string (literal text or literal-type value) parse as a number?\n // is_equal() coerces those against numeric/bool operands, a plain string\n // compare does not.\n textCoercesToNumber(text: string): boolean {\n return /^[+-]?(\\d+\\.?\\d*|\\.\\d+)([eE][+-]?\\d+)?$/.test(text) || /^[+-]?(inf|infinity|nan)$/i.test(text);\n }\n\n // f64 literal text for a numeric literal; undefined when it is not a Rust\n // decimal/float literal (hex/octal/binary fall back to the helper).\n numericLiteralF64Text(node): string {\n const text = node.text;\n if (text.startsWith('0x') || text.startsWith('0o') || text.startsWith('0b')) return undefined;\n if (text.startsWith('.')) return `0${text}`;\n if (text.includes('.') || text.includes('e') || text.includes('E')) return text;\n return `${text}.0`;\n }\n\n // The printer's own proof that a plain read prints as a Rust `Value`: `this.` (every\n // declared field is `Value`) or an identifier bound to a local/param (a local is narrowed to\n // `bool` only when every use is a condition sink — never an is_equal argument).\n rustReadPrintsValue(node): boolean {\n if (node === undefined) return false;\n if (node.kind === SyntaxKind.PropertyAccessExpression && node.expression.kind === SyntaxKind.ThisKeyword) return true;\n if (node.kind !== SyntaxKind.Identifier) return false;\n const symbol: any = this.getChecker().getSymbolAtLocation(node);\n const declarations: any[] = symbolDeclarations(symbol);\n if (declarations.length === 0) return false;\n return declarations.every((declaration) => isParameterDeclaration(declaration)\n || (isVariableDeclaration(declaration)\n && declaration.initializer?.kind !== SyntaxKind.NewExpression));\n }\n\n // Can the checked type only hold a Bool, Null/undefined or a non-numeric\n // string? Then `x.as_bool() == Some(b)` answers exactly what is_equal(x, b)\n // does: its f64 fallback (Str parse / Bool→0|1) can never fire.\n rustBooleanComparableType(type): boolean {\n if (type === undefined) return false;\n if (type.flags & TypeFlags.Union) {\n const members: any[] = typeParts(type) ?? [];\n return members.length > 0 && members.every((member) => this.rustBooleanComparableType(member));\n }\n if (type.flags & (TypeFlags.Boolean | TypeFlags.BooleanLiteral)) return true;\n if (type.flags & (TypeFlags.Undefined | TypeFlags.Null)) return true;\n if (type.flags & TypeFlags.StringLiteral) return !this.textCoercesToNumber(String((type as any).value ?? ''));\n return false;\n }\n\n // Native `==`/`!=` on the unwrapped payload when the checker proves the\n // Value variants line up; undefined keeps the is_equal() helper.\n printNativeEqualityComparison(left, right, op): string {\n const operator = (op === SyntaxKind.EqualsEqualsToken || op === SyntaxKind.EqualsEqualsEqualsToken) ? '==' : '!=';\n const leftLiteral = this.literalKindOfNode(left);\n const rightLiteral = this.literalKindOfNode(right);\n if (leftLiteral !== undefined && rightLiteral !== undefined) return undefined;\n if (leftLiteral !== undefined || rightLiteral !== undefined) {\n const literal = leftLiteral !== undefined ? left : right;\n const literalKind = leftLiteral ?? rightLiteral;\n const other = leftLiteral !== undefined ? right : left;\n if (!this.printsValueExpression(other) && (literalKind !== 'null' || !this.rustReadPrintsValue(other))) return undefined;\n const otherType = this.getChecker().getTypeAtLocation(other);\n const otherKind = this.primitiveKindOfType(otherType);\n const typedStringLocal = this.rustStringLocalIdentifierIsTyped(other);\n if (literalKind === 'null') {\n // Exact for every runtime value: is_equal(x, null) is true only\n // when x is Null, and the derived PartialEq says the same.\n if (typedStringLocal) return `${this.printNode(other, 0)}.${operator === '==' ? 'is_none' : 'is_some'}()`;\n return `${this.printNode(other, 0)} ${operator} Value::Null`;\n }\n if (literalKind === 'string') {\n if (literal.text in this.StringLiteralReplacements) return undefined;\n if (this.textCoercesToNumber(literal.text) && otherKind !== 'string') return undefined;\n const accessor = typedStringLocal ? 'as_deref' : 'as_str';\n return `${this.printNode(other, 0)}.${accessor}() ${operator} Some(${this.quotedStringLiteral(literal.text)})`;\n }\n if (literalKind === 'number') {\n if (otherKind !== 'number') return undefined;\n const text = this.numericLiteralF64Text(literal);\n if (text === undefined) return undefined;\n return `${this.printNode(other, 0)}.as_f64() ${operator} Some(${text})`;\n }\n if (literalKind === 'boolean') {\n if (otherKind !== 'boolean' && !this.rustBooleanComparableType(otherType)) return undefined;\n const value = literal.kind === SyntaxKind.TrueKeyword ? 'true' : 'false';\n return `${this.printNode(other, 0)}.as_bool() ${operator} Some(${value})`;\n }\n return undefined;\n }\n if (!this.printsValueExpression(left) || !this.printsValueExpression(right)) return undefined;\n const leftKind = this.primitiveKindOfType(this.getChecker().getTypeAtLocation(left));\n const rightKind = this.primitiveKindOfType(this.getChecker().getTypeAtLocation(right));\n if (leftKind === undefined || leftKind !== rightKind) return undefined;\n const accessor = RustTranspiler.PAYLOAD_ACCESSORS[leftKind];\n return `${this.printNode(left, 0)}.${accessor}() ${operator} ${this.printNode(right, 0)}.${accessor}()`;\n }\n\n // ── checker-typed helper elimination ─────────────────────────────────\n // Each predicate proves a static TS shape for which the native Rust form\n // is exactly what the runtime helper computes; only then is the helper\n // call dropped, anything unproven keeps the helper.\n\n typeOfNodeIfAny(node: Node): Type | undefined {\n // A transpile without a program/checker (bare snippet) has no types.\n return this.checkerOrUndefined()?.getTypeAtLocation(node);\n }\n\n // Arrays/tuples/strings: `.length` is exactly what `Value::len()` returns.\n // Other shapes (Dict) keep the helper — ArrayCache / OrderBookSide markers\n // hold their length in the marker dict, which get_array_length unwraps.\n isValueLengthType(type: Type | undefined): boolean {\n if (type === undefined) return false;\n if (type.flags & TypeFlags.Union) {\n const parts: Type[] = typeParts(type) ?? [];\n return parts.length > 0 && parts.every((part) => this.isValueLengthType(part));\n }\n // A `null`/`undefined` member boxes as `Value::Null`, whose `len()` is\n // the same number the helper's fallthrough returns for it.\n return (type.flags & (TypeFlags.Undefined | TypeFlags.Null | TypeFlags.Void)) !== 0\n || this.getChecker().isArrayType(type)\n || this.getChecker().isTupleType(type)\n || this.isStringType(type.flags);\n }\n\n printArrayLength(node, identation, leftExpr = undefined) {\n const receiver = leftExpr ?? this.printNode(node.expression, 0);\n if (!this.rustIsOrderBookSide(node.expression) && this.isValueLengthType(this.typeOfNodeIfAny(node.expression))) return `Value::Int(${receiver}.len() as i64)`;\n return `get_array_length(&${receiver})`;\n }\n\n /** `orderbook['bids']` / `orderbook.asks` on an `OrderBook`-typed receiver, or a\n * local initialised from one. The WS runtime keeps those sides as marker dicts\n * whose levels live in the side store, so only `get_array_length` / `get_value`\n * reach them — the checker's array type is not the runtime shape. */\n rustIsOrderBookSide(node: Node, depth = 0): boolean {\n const stripped = this.rustStripWrappers(node);\n if (stripped === undefined || depth > 4) return false;\n if (isIdentifier(stripped)) {\n const declaration = this.rustSingleLocalDeclaration(stripped);\n return declaration !== undefined && isVariableDeclaration(declaration)\n && this.rustIsOrderBookSide(declaration.initializer, depth + 1);\n }\n let receiver: Node | undefined;\n let key: string | undefined;\n if (isElementAccessExpression(stripped) && isStringLiteralLikeNode(stripped.argumentExpression)) {\n receiver = stripped.expression;\n key = stripped.argumentExpression.text;\n } else if (isPropertyAccessExpression(stripped)) {\n receiver = stripped.expression;\n key = String(stripped.name.text);\n }\n if (receiver === undefined || (key !== 'bids' && key !== 'asks')) return false;\n const symbol = (this.typeOfNodeIfAny(receiver) as any)?.getSymbol?.();\n return symbol !== undefined && /^(Indexed|Counted)?OrderBook$/.test(symbol.name);\n }\n\n // Native string search / slicing: `x.indexOf(y)` and `x.slice(a, b)` on a checker-proven\n // string receiver print native `str` code. The receiver is a `Value`, so the payload is reached\n // via `as_str()`; a `Value::Null` receiver takes the helper's `-1` / `Value::Null` branch.\n\n /** Literal integer bound of a `slice` call (`3`, `-64`), else undefined. */\n rustSliceLiteralBound(node): number | undefined {\n if (node === undefined) return undefined;\n if (isNumericLiteral(node)) {\n const value = Number(node.text);\n return Number.isSafeInteger(value) ? value : undefined;\n }\n if (isPrefixUnaryExpression(node) && node.operator === SyntaxKind.MinusToken &&\n isNumericLiteral(node.operand)) {\n const value = Number(node.operand.text);\n return Number.isSafeInteger(value) ? -value : undefined;\n }\n return undefined;\n }\n\n // `slice` clamps like JS: a non-negative bound is capped at the length, a\n // negative one counts from the end and is floored at 0.\n rustSliceClampedIndex(value: number): string {\n return value < 0 ? `(__l - ${-value}).max(0)` : `__l.min(${value})`;\n }\n\n // `x.indexOf(\"lit\")` on a proven string receiver: `str::find` is exactly\n // the helper's `Value::Str` arm (byte index, `-1` when absent).\n printNativeStringIndexOf(node, receiverText: string): string | undefined {\n if (node === undefined || !isCallExpression(node) ||\n !isPropertyAccessExpression(node.expression) || node.arguments?.length !== 1) {\n return undefined;\n }\n if (this.primitiveKindOfType(this.typeOfNodeIfAny(node.expression.expression)) !== 'string') return undefined;\n const needle = node.arguments[0];\n if (!isStringLiteral(needle) && !isNoSubstitutionTemplateLiteral(needle)) return undefined;\n if (typeof receiverText !== 'string' || receiverText.includes('\\n')) return undefined;\n const literal = this.escapeRustStringLiteral(needle.text);\n return `Value::Int(${receiverText}.as_str().and_then(|__s| __s.find(\"${literal}\")).map(|__i| __i as i64).unwrap_or(-1))`;\n }\n\n // `x.slice(a)` / `x.slice(a, b)` with literal bounds on a proven string\n // receiver: the helper's char-vector clamps are inlined, so the emission\n // returns the same string (and `Value::Null` for a null receiver).\n printNativeStringSlice(node, receiverText: string): string | undefined {\n if (node === undefined || !isCallExpression(node) ||\n !isPropertyAccessExpression(node.expression)) {\n return undefined;\n }\n const args = node.arguments ?? [];\n if (args.length === 0 || args.length > 2) return undefined;\n if (this.primitiveKindOfType(this.typeOfNodeIfAny(node.expression.expression)) !== 'string') return undefined;\n if (typeof receiverText !== 'string' || receiverText.includes('\\n')) return undefined;\n const start = this.rustSliceLiteralBound(args[0]);\n if (start === undefined) return undefined;\n let end = '__l';\n if (args[1] !== undefined && args[1].kind !== SyntaxKind.NullKeyword && args[1].kind !== SyntaxKind.UndefinedKeyword) {\n const bound = this.rustSliceLiteralBound(args[1]);\n if (bound === undefined) return undefined;\n end = this.rustSliceClampedIndex(bound);\n }\n const begin = this.rustSliceClampedIndex(start);\n return `${receiverText}.as_str().map(|__s| { let __c: Vec = __s.chars().collect();` +\n ` let __l = __c.len() as i64; let __i = ${begin}; let __j = ${end};` +\n ` if __i <= __j { __c[__i as usize..__j as usize].iter().collect::() } else { String::new() } })` +\n `.map(|__s| Value::Str(__s.into())).unwrap_or(Value::Null)`;\n }\n\n // Native value predicates (`Array.isArray` / `typeof … === '…'`): each runtime predicate is a\n // single `matches!` over the `Value` variants, so on a declared `Value` place the call is\n // replaced by that same match — no helper call, operand still read exactly once.\n\n // `matches!` pattern of the runtime predicate, keyed by the `typeof` word.\n private static readonly RUST_TYPE_PREDICATE_PATTERNS: { [key: string]: string } = {\n 'array': 'Value::Arr(_)',\n 'string': 'Value::Str(_)',\n 'number': 'Value::Int(_) | Value::Float(_)',\n 'boolean': 'Value::Bool(_)',\n 'object': 'Value::Dict(_)',\n };\n\n // An identifier bound by a local/param declaration: the printer declares\n // every one of them as `Value`. Imports, classes and function names print\n // as Rust items rather than as values, so they keep the helper.\n isDeclaredValueIdentifier(node): boolean {\n const declarations = symbolDeclarations((this.getChecker() as any).getSymbolAtLocation(node));\n return declarations.length > 0 && declarations.every((d) =>\n isVariableDeclaration(d) || isParameterDeclaration(d) || isBindingElement(d));\n }\n\n // A declared `Value` place: a local/param identifier, or a field/element\n // access rooted at `this` or at such an identifier. Those are the operands\n // whose printed text the helper already borrows as a `Value`.\n isDeclaredValuePlace(node): boolean {\n const inner = this.unwrapParens(node);\n if (inner !== undefined && isIdentifier(inner)) {\n return this.isDeclaredValueIdentifier(inner);\n }\n if (inner !== undefined && (isPropertyAccessExpression(inner) || isElementAccessExpression(inner))) {\n const root = this.unwrapParens(this.valuePlaceRoot(inner));\n return root !== undefined &&\n (root.kind === SyntaxKind.ThisKeyword || this.isDeclaredValueIdentifier(root));\n }\n return false;\n }\n\n valuePlaceRoot(node): any {\n let current: any = node;\n while (isPropertyAccessExpression(current) || isElementAccessExpression(current)) {\n current = current.expression;\n }\n return current;\n }\n\n nativeValuePredicateText(kind: string, operandNode, printedOperand: string): string | undefined {\n const pattern = RustTranspiler.RUST_TYPE_PREDICATE_PATTERNS[kind];\n if (pattern === undefined || operandNode === undefined || printedOperand === undefined ||\n !this.isDeclaredValuePlace(operandNode)) {\n return undefined;\n }\n return `matches!(${this.ensureRef(printedOperand)}, ${pattern})`;\n }\n\n // Object-typed values are Dicts at runtime, so `key in obj` is a plain\n // key lookup. Arrays keep the helper: `in_op` searches them element-wise.\n // A `Dict`/`Dictionary` receiver is a Reference to its index-signature\n // interface, so the class/lib guards — not the Reference flag — decide it.\n isDictShapedType(type: Type | undefined): boolean {\n if (type === undefined) return false;\n if (type.flags & TypeFlags.Union) {\n // `Market | undefined` style aliases: a nullish member carries no\n // value, so only the value-carrying members have to be dict-shaped.\n // `in_op` and the native insert both answer false / no-op on Null.\n const parts: Type[] = typeParts(type) ?? [];\n const valueParts = parts.filter((part) => !this.rustTypeIsNullish(part));\n return parts.length > valueParts.length && valueParts.length > 0\n && valueParts.every((part) => this.isDictShapedType(part));\n }\n const checker = this.getChecker();\n if (!(type.flags & TypeFlags.Object) || type.getCallSignatures().length !== 0\n || checker.isArrayType(type) || checker.isTupleType(type) || checker.isArrayLikeType(type)) {\n return false;\n }\n return !this.isClassInstanceType(type) && !this.isLibDeclaredType(type);\n }\n\n // `\"key\" in obj` → `matches!(&obj, Value::Dict(__d) if __d.contains_key(\"key\"))`\n // In the TS AST `key` is the left operand and `obj` the right one.\n printNativeInOperator(key, obj) {\n if (!isStringLiteral(key) || !this.isDictShapedType(this.typeOfNodeIfAny(obj))) {\n return undefined;\n }\n const keyLiteral = this.rustStringLiteralOf(this.printStringLiteral(key));\n if (keyLiteral === undefined) {\n return undefined;\n }\n const objExpr = this.printNode(obj, 0);\n return `Value::Bool(matches!(&${objExpr}, Value::Dict(__d) if __d.contains_key(${keyLiteral})))`;\n }\n\n // The Rust string literal behind a printed TS string literal — the boxed\n // shapes the printer emits today (`Value::Str(\"k\".to_string())`,\n // `Value::from(\"k\")`) plus a bare `\"k\"` once an arg-shape unit drops the box.\n rustStringLiteralOf(printedKey: string): string | undefined {\n const boxed = printedKey.match(/^(?:Value::Str|Value::from)\\((.+)\\)$/);\n const literal = (boxed ? boxed[1].replace(/\\.(?:to_string|into)\\(\\)$/, '') : printedKey).trim();\n return /^\"(?:[^\"\\\\]|\\\\.)*\"$/.test(literal) ? literal : undefined;\n }\n\n // `X[\"k\"] = v` on a checker-proven plain Dict receiver: mutate the Dict\n // natively. The helper's tag hooks (book meta, ws subscriptions, cache\n // hashmap) only fire on tagged dicts, which a plain object type never is.\n printNativeDictInsert(baseExpr, keyNode, keyText, valueText): string | undefined {\n const receiver = this.rustNativeInsertReceiver(baseExpr);\n if (receiver === undefined || !this.rustReceiverStaysDict(baseExpr, receiver)) {\n return undefined;\n }\n // A bucket read off `cache.hashmap` / client `subscriptions`/`futures` carries a runtime\n // backref: only the helper writes through to the shared store, so keep it.\n if (!receiver.isField && this.rustLocalInitReadsTaggedContainer(baseExpr)) {\n return undefined;\n }\n const keyArg = this.rustNativeInsertKeyArg(receiver, keyNode, keyText);\n if (keyArg === undefined) {\n return undefined;\n }\n const name = receiver.text;\n const value = this.rustPrintedBoolArg(valueText) ? `Value::Bool(${valueText})` : valueText;\n const insert = (val: string) =>\n `if let Value::Dict(__d) = &mut ${name} { std::sync::Arc::make_mut(__d).insert(${keyArg}, ${val}); }`;\n // Any mention of the receiver in the value operand reads it while the\n // write holds the `&mut` — ccxt's splitAddElementBorrowConflicts pass\n // hoists on the same signal, so mirror it with a temp binding.\n const readsReceiver = receiver.isField ? /\\bself\\b/.test(value) : new RegExp(`\\\\b${name}\\\\b`).test(value);\n if (readsReceiver) {\n return `{ let __be_tmp = ${value}; ${insert('__be_tmp')} }`;\n }\n const trimmed = value.trim();\n if (/^[a-zA-Z_][a-zA-Z0-9_]*$/.test(trimmed) && trimmed !== 'self'\n && trimmed !== 'true' && trimmed !== 'false') {\n return insert(`${trimmed}.clone()`);\n }\n return insert(value);\n }\n\n /** The `insert` key argument. A literal becomes `\"k\".into()`; a proven\n * string place becomes `crate::runtime::stringify_param(&k)` — the exact\n * conversion the helper's dict branch applies to a non-string key, and\n * `k.to_string()` for a string one. */\n rustNativeInsertKeyArg(receiver, keyNode, keyText: string): string | undefined {\n if (isStringLiteral(keyNode)) {\n // A book-meta key can only reach the store through a `__book_id`:\n // provable only for receivers the transpiler itself built as plain\n // maps or the hand-written base never tags (fields).\n if (RustTranspiler.RUST_BOOK_META_KEYS.has(keyNode.text) && !receiver.plain) {\n return undefined;\n }\n const keyLiteral = keyText.match(/^Value::Str\\((.+)\\.(?:to_string|into)\\(\\)\\)$/);\n return keyLiteral === null ? undefined : `${keyLiteral[1]}.into()`;\n }\n // Dynamic key: a plain place, never one that reads the receiver (the\n // insert holds its `&mut`). Every other key shape keeps the helper.\n const key = keyText.trim();\n if (!/^[A-Za-z_][A-Za-z0-9_]*$/.test(key)\n || (receiver.isField ? key.includes('self') : new RegExp(`\\\\b${receiver.text}\\\\b`).test(key))) {\n return undefined;\n }\n return `crate::runtime::stringify_param(&${key})`;\n }\n\n // Receivers this unit may write natively: any local whose every path builds\n // a plain `Value::Map` (name-independent — rust-13's four names are the\n // batch-A subset of this proof), any parameter the checker proves is a\n rustNativeInsertReceiver(expr): { text: string, isField: boolean, plain: boolean, nameNode: any } | undefined {\n if (isIdentifier(expr)) {\n const plain = this.rustInsertIdentifierReceiver(expr);\n return plain === undefined ? undefined : { text: expr.text, isField: false, plain, nameNode: expr };\n }\n if (isPropertyAccessExpression(expr) && expr.expression.kind === SyntaxKind.ThisKeyword\n && expr.name?.kind === SyntaxKind.Identifier) {\n return {\n text: `self.${expr.name.text}`, isField: true,\n plain: RustTranspiler.RUST_PLAIN_DICT_FIELDS.has(expr.name.text),\n nameNode: expr.name,\n };\n }\n return undefined;\n }\n\n /** Element-write receiver proof for a local: the batch-A names (rust-13,\n * `plain: false` — the whitelist is not a construction proof) or, for any\n * other name, the dict-shape proof plus a plain-`Value::Map` build on\n * every path (rust-12's proof, read off the checker), or a parameter whose\n * annotation proves a plain dict and whose writes keep that shape. The\n * returned flag is the *by-construction* plainness (literal-init locals,\n * handler tuples, hand-written plain fields) that a book-meta key needs. */\n rustInsertIdentifierReceiver(ident): boolean | undefined {\n const declaration = this.rustSingleLocalDeclaration(ident);\n if (declaration !== undefined && isParameterDeclaration(declaration as any)) {\n // A default value (`params: Dict = {}`) keeps the pre-unit\n // initializer proof — `rustReceiverStaysDict` runs both it and the\n // annotation proof and rejects the site when neither holds.\n if (this.rustParamStaysPlainDict(declaration as ParameterDeclaration)\n || (declaration as ParameterDeclaration).initializer !== undefined) {\n return false;\n }\n } else if (declaration !== undefined && isVariableDeclaration(declaration as any)) {\n if (this.rustInsertReceiverBuildsPlainDict(declaration as VariableDeclaration)) {\n return true;\n }\n // A local the declared-Dict table proves holds a Dict at every use\n // (alwaysDict && stable): the helper's non-dict branches are dead,\n // so only the tag hooks and the insert remain — the key rules of\n if (this.rustDeclaredLocalEntry(ident) !== undefined\n && this.rustDeclaredInitIsTagFree(declaration as VariableDeclaration)) {\n return false;\n }\n }\n if (RustTranspiler.RUST_NATIVE_INSERT_RECEIVERS.has(ident.text)) {\n return false; // rust-13 whitelist: not a construction proof\n }\n return undefined;\n }\n\n /** A literal initializer must carry no runtime tag key; a call initializer\n * is the axiom the declared-Dict table itself rests on. */\n rustDeclaredInitIsTagFree(declaration: VariableDeclaration): boolean {\n const init = this.rustStripWrappers(declaration.initializer);\n return init === undefined || !isObjectLiteralExpression(init) || this.rustPlainDictLiteral(init);\n }\n\n /** Skip `( … )`, `x!` and `x as T` wrappers. */\n rustStripWrappers(node: any): any {\n while (node !== undefined && (isParenthesizedExpression(node) || isNonNullExpression(node) || isAsExpression(node))) {\n node = node.expression;\n }\n return node;\n }\n\n /** The local's single declaration is initialised from a call that reads\n * `x.hashmap` / `x.subscriptions` / `x.futures` — element dicts the runtime\n * tags with a backref so writes reach the shared store, not the COW copy. */\n rustLocalInitReadsTaggedContainer(ident: Identifier): boolean {\n const declaration = this.rustSingleLocalDeclaration(ident);\n if (declaration === undefined || !isVariableDeclaration(declaration)) {\n return false;\n }\n const init = this.rustStripWrappers(declaration.initializer);\n return init !== undefined && isCallExpression(init) && init.arguments.some((arg) => {\n const n = this.rustStripWrappers(arg);\n return n !== undefined && isPropertyAccessExpression(n)\n && RustTranspiler.RUST_TAGGED_CONTAINER_FIELDS.has(n.name.text);\n });\n }\n\n static readonly RUST_TAGGED_CONTAINER_FIELDS = new Set([ 'hashmap', 'subscriptions', 'futures' ]);\n\n /** True when every value the local can hold comes from an object literal:\n * the runtime tags a dict (`__book_id`, `__ws_subs_url`, `__ws_sub_ref`,\n * `__cache_backref`) only on handles its own store builds, so the helper's\n * write-through branches are provably dead and `insert` is the whole\n * helper. A `[ x, params ] = this.handle…(…)` tuple re-assigns the\n * hand-written handler's own dict arguments. */\n rustInsertReceiverBuildsPlainDict(declaration: VariableDeclaration): boolean {\n const name = String((declaration.name as Identifier).text);\n const scope = this.rustEnclosingFunction(declaration);\n if (!this.rustPlainDictLiteral(declaration.initializer) || scope === undefined) {\n return false;\n }\n const declarationSymbol = this.rustSymbolOf(declaration.name as Identifier);\n let plain = true;\n this.rustWalkScope(scope, (n) => {\n if (!plain || !isBinaryExpression(n) || n.operatorToken.kind !== SyntaxKind.EqualsToken) {\n return;\n }\n const left: any = n.left;\n if (isIdentifier(left) && String(left.text) === name\n && (declarationSymbol === undefined || this.rustSymbolOf(left) === declarationSymbol)) {\n plain = this.rustPlainDictLiteral(n.right) || this.rustTypeIsUndefinedish(n.right);\n } else if (isArrayLiteralExpression(left)\n && left.elements.some((e) => isIdentifier(e) && String(e.text) === name)) {\n plain = this.rustHandlerTupleCall(n.right);\n }\n });\n return plain;\n }\n\n /** An object literal with no runtime tag key — the transpiler built it, so\n * it is a fresh plain `Value::Map` on every path. */\n rustPlainDictLiteral(node: Node | undefined): boolean {\n if (node !== undefined && isParenthesizedExpression(node)) {\n return this.rustPlainDictLiteral(node.expression);\n }\n return node !== undefined && isObjectLiteralExpression(node) && node.properties.every((property: any) => {\n const key = property.name;\n if (key === undefined) {\n return false;\n }\n const text = isStringLiteral(key) ? key.text\n : (isIdentifier(key) ? String(key.text) : undefined);\n return text === undefined || !text.startsWith('__');\n });\n }\n\n /** `this.handle…(…)` — the hand-written `handle*AndParams` / `handleUntil…`\n * family; each returns its own request/params dict arguments. */\n rustHandlerTupleCall(node: Node | undefined): boolean {\n const callee: any = node !== undefined && isCallExpression(node) ? node.expression : undefined;\n return callee !== undefined && isPropertyAccessExpression(callee) && callee.expression.kind === SyntaxKind.ThisKeyword\n && callee.name?.kind === SyntaxKind.Identifier && /^handle[A-Z]/.test(callee.name.text);\n }\n\n /** A `null`/`undefined` write leaves the receiver a non-dict, which the\n * emitted `if let Value::Dict` no-ops exactly like the helper. */\n private rustTypeIsUndefinedish(node: Node): boolean {\n if (node.kind === SyntaxKind.NullKeyword || (isIdentifier(node) && node.text === 'undefined')) {\n return true;\n }\n const type = this.typeOfNodeIfAny(node);\n return type !== undefined && (type.flags & (TypeFlags.Undefined | TypeFlags.Null | TypeFlags.Void)) !== 0;\n }\n\n /** The single variable declaration a local identifier binds to, or\n * undefined when the checker cannot answer / the binding is not a local. */\n rustSingleLocalDeclaration(ident: Identifier): VariableDeclaration | ParameterDeclaration | undefined {\n const checker: any = this.checkerOrUndefined();\n if (checker === undefined) {\n return undefined;\n }\n const declarations = symbolDeclarations(checker.getSymbolAtLocation(ident));\n const declaration: any = declarations.length === 1 ? declarations[0] : undefined;\n return declaration !== undefined && (isVariableDeclaration(declaration) || isParameterDeclaration(declaration))\n ? declaration : undefined;\n }\n\n // Dict-shape proof for a write receiver: an object type with no class, array or callable shape\n // — `Dictionary` instantiations count (they resolve to their interface target). A union keeps\n // the proof when every member is a Dict or `undefined` (both untaggable at runtime).\n rustWriteDictShape(type): boolean {\n if (type === undefined) return false;\n if (type.flags & TypeFlags.Union) {\n const parts: any[] = typeParts(type) ?? [];\n return parts.length > 0 && parts.every((part) => this.rustWriteDictShape(part));\n }\n if (type.flags & (TypeFlags.Undefined | TypeFlags.Void)) {\n return true;\n }\n const checker = this.getChecker();\n if (!(type.flags & TypeFlags.Object)\n || checker.isArrayType(type) || checker.isTupleType(type) || checker.isArrayLikeType(type)\n || ((typeTarget(type) ?? type as any).objectFlags & ObjectFlags.Class)) {\n return false;\n }\n return type.getCallSignatures().length === 0 && type.getConstructSignatures().length === 0;\n }\n\n // The receiver is a plain Dict on every path: its declared/initializer type is object-shaped\n // (never a class or array handle), its initializer is not an element read (the get_value COW\n // write-back pass keys on the `&mut ` text), and no write in scope assigns another shape.\n rustReceiverStaysDict(baseExpr, receiver): boolean {\n if (receiver.isField) {\n return this.rustFieldStaysDict(baseExpr, receiver.nameNode.text);\n }\n const ident = baseExpr;\n const declaration: any = this.rustSingleLocalDeclaration(ident);\n if (declaration === undefined) {\n return false;\n }\n // The declared-Dict table is its own proof (alwaysDict && stable, D2):\n // a table local the checker cannot type (an untyped `safe_dict*`\n // default) still stays a Dict at every use.\n if (this.rustDeclaredLocalEntry(ident) !== undefined) {\n return true;\n }\n // A parameter with a default carries the transpiler's own initializer,\n // so it keeps the pre-unit proof; without one only the annotation proof\n // (`Dict`-style params — the B-25 read family) can admit it.\n if (isParameterDeclaration(declaration) && this.rustParamStaysPlainDict(declaration)) {\n return true;\n }\n const name = ident.text;\n const initializer = declaration.initializer;\n const scope = this.rustEnclosingFunction(declaration);\n if (initializer === undefined || isElementAccessExpression(initializer)\n || declaration.name?.kind !== SyntaxKind.Identifier || scope === undefined) {\n return false;\n }\n let safe = this.rustWriteDictShape(this.typeOfNodeIfAny(ident))\n && this.rustWriteDictShape(this.typeOfNodeIfAny(initializer));\n this.rustWalkScope(scope, (n) => {\n if (n !== declaration && this.rustBindsName(n, name)) {\n safe = false; // a second binding of the name in scope — stay boxed\n return RUST_WALK_STOP;\n }\n if (isBinaryExpression(n) && n.operatorToken.kind === SyntaxKind.EqualsToken\n && isIdentifier(n.left) && n.left.text === name\n && !this.rustWriteDictShape(this.typeOfNodeIfAny(n.right))) {\n safe = false;\n return RUST_WALK_STOP;\n }\n });\n return safe;\n }\n\n // `this.` receivers: the field is a plain dict (object-shaped checker type, or held as one\n // by the hand-written base when the TS declaration is `any`) and no `this. = …` in the\n // method assigns another shape. Handle fields (cache/client/subscriptions/order book) are excluded.\n rustFieldStaysDict(baseExpr, fieldName: string): boolean {\n if (RustTranspiler.RUST_TAGGED_HANDLE_FIELDS.has(fieldName)\n || (!this.rustWriteDictShape(this.typeOfNodeIfAny(baseExpr))\n && !RustTranspiler.RUST_PLAIN_DICT_FIELDS.has(fieldName))) {\n return false;\n }\n const scope = this.rustEnclosingFunction(baseExpr);\n if (scope === undefined) {\n return false;\n }\n let safe = true;\n this.rustWalkScope(scope, (n) => {\n if (isBinaryExpression(n) && n.operatorToken.kind === SyntaxKind.EqualsToken\n && isPropertyAccessExpression(n.left) && n.left.expression.kind === SyntaxKind.ThisKeyword\n && n.left.name?.text === fieldName\n && !this.rustWriteDictShape(this.typeOfNodeIfAny(n.right))) {\n safe = false;\n return RUST_WALK_STOP;\n }\n });\n return safe;\n }\n\n // A parameter the checker proves is a plain dict (`Dict`, `Dictionary`,\n // a `Market`-style alias — the proof B-25's native reads use) whose every\n // write in the body keeps that shape: an object literal with no runtime tag\n rustParamStaysPlainDict(declaration: ParameterDeclaration): boolean {\n if (declaration.type === undefined || declaration.name?.kind !== SyntaxKind.Identifier) {\n return false;\n }\n const type = this.getCheckedTypeOf(declaration.type);\n const scope = this.rustEnclosingFunction(declaration);\n if (type === undefined || !this.isProvenMapType(type) || scope === undefined) {\n return false;\n }\n const name = String((declaration.name as Identifier).text);\n let plain = true;\n this.rustWalkScope(scope, (n) => {\n if (isBinaryExpression(n) && rustIsAssignmentOperator(n.operatorToken.kind)\n && isIdentifier(n.left) && n.left.text === name\n && !this.rustPlainDictPreservingRhs(n.right, name)) {\n plain = false;\n return RUST_WALK_STOP;\n }\n if (isBinaryExpression(n) && n.operatorToken.kind === SyntaxKind.EqualsToken\n && isArrayLiteralExpression(n.left)\n && n.left.elements.some((e) => isIdentifier(e) && String((e as Identifier).text) === name)\n && !this.rustHandlerTupleCall(n.right)) {\n plain = false; // a tuple write keeps only the handle-arg family\n return RUST_WALK_STOP;\n }\n });\n return plain;\n }\n\n /** RHS of a write to a plain-dict parameter that keeps the shape. */\n rustPlainDictPreservingRhs(node: Node, name: string): boolean {\n // `this.handle…(…)` returns its own dict arguments (rust-12's proof).\n if (this.rustPlainDictLiteral(node) || this.rustTypeIsUndefinedish(node)\n || (isIdentifier(node) && node.text === name) || this.rustHandlerTupleCall(node)) {\n return true;\n }\n if (isParenthesizedExpression(node) || isNonNullExpression(node) || isAsExpression(node)) {\n return this.rustPlainDictPreservingRhs(node.expression, name);\n }\n if (isConditionalExpression(node)) {\n return this.rustPlainDictPreservingRhs(node.whenTrue, name)\n && this.rustPlainDictPreservingRhs(node.whenFalse, name);\n }\n if (isBinaryExpression(node)\n && (node.operatorToken.kind === SyntaxKind.BarBarToken\n || node.operatorToken.kind === SyntaxKind.QuestionQuestionToken)) {\n return this.rustPlainDictPreservingRhs(node.left, name)\n && this.rustPlainDictPreservingRhs(node.right, name);\n }\n return false;\n }\n\n // Conservative \"argument position expects a Value\" bool test — the same set\n // ccxt's wrapBoolValueArgs pass uses on the helper call's value operand.\n rustPrintedBoolArg(raw: string): boolean {\n let s = raw.trim();\n while (s.startsWith('(') && s.endsWith(')')) {\n let depth = 0;\n let balanced = true;\n for (let k = 0; k < s.length; k++) {\n if (s[k] === '(') depth++;\n else if (s[k] === ')') { depth--; if (depth === 0 && k < s.length - 1) { balanced = false; break; } }\n }\n if (!balanced || depth !== 0) break;\n s = s.slice(1, -1).trim();\n }\n if (s.startsWith('!')) s = s.slice(1).trim();\n return RustTranspiler.RUST_BOOL_VALUE_HELPERS.some(fn => s.startsWith(fn + '('));\n }\n\n // `negate(&Value::Int(n))` is `Value::Int(-n)` (same for Float) — fold the\n // literal so no helper call is needed. Runtime `negate` also coerces\n // strings/bools/floats, so only Int/Float literals can be folded.\n foldNegateLiteral(operandText: string): string | undefined {\n const match = operandText.match(/^Value::(Int|Float)\\((-?)(\\d[\\d_]*(?:\\.\\d+)?(?:[eE][+-]?\\d+)?)\\)$/);\n // leave big literals to the runtime helper\n if (!match || match[3].replaceAll('_', '').replace('.', '').length > 18) {\n return undefined;\n }\n const sign = match[2] === '-' ? '' : '-';\n return `Value::${match[1]}(${sign}${match[3]})`;\n }\n\n // Ensure a & ref prefix — skip only if already a reference\n ensureRef(expr: string): string {\n return expr.startsWith('&') ? expr : `&${expr}`;\n }\n\n // TS `number` / number-literal type proof for a comparison operand. Unions\n // (`number | undefined`) and `any` are rejected — those keep the helper.\n isNumberTyped(node) {\n const type = this.getChecker().getTypeAtLocation(node);\n return type !== undefined && (type.flags & (TypeFlags.Number | TypeFlags.NumberLiteral)) !== 0;\n }\n\n // Positions whose emitted Rust is a native `bool`: if/while/do/for\n // conditions, `? :` conditions, `!` operands and `&&` / `||` operands.\n // Parentheses are transparent.\n isBooleanPosition(node) {\n let current = node;\n let parent = current.parent;\n while (parent !== undefined && isParenthesizedExpression(parent)) {\n current = parent;\n parent = parent.parent;\n }\n if (parent === undefined) {\n return false;\n }\n switch (parent.kind) {\n case SyntaxKind.IfStatement:\n case SyntaxKind.WhileStatement:\n case SyntaxKind.DoStatement:\n return parent.expression === current;\n case SyntaxKind.ForStatement:\n case SyntaxKind.ConditionalExpression:\n return parent.condition === current;\n case SyntaxKind.PrefixUnaryExpression:\n return parent.operator === SyntaxKind.ExclamationToken;\n case SyntaxKind.BinaryExpression:\n return parent.operatorToken.kind === SyntaxKind.AmpersandAmpersandToken ||\n parent.operatorToken.kind === SyntaxKind.BarBarToken;\n }\n return false;\n }\n\n // `is_less_than` & co. compare two `Value`s and answer `false` for\n // non-numbers; with both operands checker-typed numbers the same f64\n // comparison runs natively on `Value::as_f64()` unwraps.\n printNativeNumericComparison(node, operator, leftText, rightText) {\n const unwrap = (text: string) => `${text}.as_f64().unwrap_or(f64::NAN)`;\n const comparison = `${unwrap(leftText)} ${operator} ${unwrap(rightText)}`;\n // Conditions/logical operands already expect a bool; every other\n // position stores the result in a `Value`, so box it as before.\n return this.isBooleanPosition(node) ? comparison : `Value::Bool(${comparison})`;\n }\n\n // How numeric an ordered-comparison operand is: 'definite' (numeric\n // literal / `.length` / `indexOf` — Int/Float at runtime, never Null),\n // 'number' (checker-typed — Int, Float or Null, never a string), undefined.\n rustNumericOperandKind(node): string | undefined {\n const inner = this.orderedComparisonOperand(node);\n // `.length` prints through printArrayLength (`Value::Int(len)` or `get_array_length`),\n // `.indexOf(x)` through printIndexOfCall (`get_index_of`): always `Value::Int`.\n if (inner.kind === SyntaxKind.NumericLiteral\n || (isPropertyAccessExpression(inner) && inner.name.text === 'length')\n || (inner.kind === SyntaxKind.CallExpression && this.callExpressionName(inner) === 'indexOf')) {\n return 'definite';\n }\n return this.isNumberTyped(node) ? 'number' : undefined;\n }\n\n // Parens and `x as T` print as the operand itself (printAsExpression drops\n // the assertion), so the operand's own shape drives the emission.\n orderedComparisonOperand(node) {\n let inner = node;\n while (inner !== undefined && (isParenthesizedExpression(inner) || isAsExpression(inner))) {\n inner = inner.expression;\n }\n return inner;\n }\n\n // Native text for an `is_less_than`-family call, undefined unless the\n // operands prove the helper's answer: one number pins `<`/`>`; `>=`/`<=`\n // OR `is_equal` in (TRUE for two Nulls) and need a 'definite' operand.\n printNativeOrderedComparison(node, op, left, right): string | undefined {\n const operator = RustTranspiler.NATIVE_COMPARISON_OPERATORS[op];\n if (operator === undefined || !this.printsValueExpression(this.orderedComparisonOperand(left)) ||\n !this.printsValueExpression(this.orderedComparisonOperand(right))) {\n return undefined;\n }\n const leftKind = this.rustNumericOperandKind(left);\n const rightKind = this.rustNumericOperandKind(right);\n const ordered = op === SyntaxKind.LessThanToken || op === SyntaxKind.GreaterThanToken;\n const proven = leftKind === 'definite' || rightKind === 'definite' ||\n (ordered\n ? (leftKind !== undefined || rightKind !== undefined)\n : (leftKind === 'number' && rightKind === 'number'));\n if (!proven) {\n return undefined;\n }\n return this.printNativeNumericComparison(node, operator, this.printNode(left, 0), this.printNode(right, 0));\n }\n\n // ── native arithmetic (`+ - * /`) ────────────────────────────────────────\n // When the checker proves both operands are numbers (`Int`/`Float` at\n // runtime) or that one is always a string and the other a string or the\n // null the helper stringifies the same way, the helper call is replaced by\n // the arithmetic itself: a 4-arm `Value` match reproducing the helper's\n // Int/Float dispatch, `as_f64()` division, or a `format!` string concat.\n // Anything the checker cannot prove keeps the runtime helper.\n\n // `type` (or every member of a non-empty union) has exactly one of `flags`.\n rustTypeFlagsAll(type: any, flags: Set): boolean {\n if (!type) {\n return false;\n }\n if (type.flags === TypeFlags.Union && Array.isArray(typeParts(type))) {\n return typeParts(type).length > 0 && typeParts(type).every((member: any) => this.rustTypeFlagsAll(member, flags));\n }\n return flags.has(type.flags);\n }\n\n isNumberLikeType(type: any): boolean {\n return this.rustTypeFlagsAll(type, new Set([ TypeFlags.Number, TypeFlags.NumberLiteral ]));\n }\n\n isStringLikeType(type: any): boolean {\n return this.rustTypeFlagsAll(type, new Set([ TypeFlags.String, TypeFlags.StringLiteral ]));\n }\n\n // Types whose runtime value the `add` helper stringifies exactly as `format!` does: a string,\n // or `undefined`/`null` boxed as `Value::Null` (`stringify_simple(Value::Null)` and `Display`\n // both give \"null\"). `any` is absent — the Precise-dict branch has no `Display` equivalent.\n private static readonly RUST_CONCAT_SAFE_FLAGS = new Set([\n TypeFlags.String,\n TypeFlags.StringLiteral,\n TypeFlags.Undefined,\n TypeFlags.Null,\n ]);\n\n isStringOrNullishType(type: any): boolean {\n return this.rustTypeFlagsAll(type, RustTranspiler.RUST_CONCAT_SAFE_FLAGS);\n }\n\n // `Str` (`string | undefined`) operands concatenate natively only against an operand proven\n // ALWAYS a string: the helper then takes its string branch, which `format!` reproduces.\n // Without that anchor (`Str + Str`) the both-null case yields `Value::Null`, not \"nullnull\".\n isNativeStringConcatPair(leftType: any, rightType: any): boolean {\n return this.isStringOrNullishType(leftType) && this.isStringOrNullishType(rightType)\n && (this.isStringLikeType(leftType) || this.isStringLikeType(rightType));\n }\n\n // `(+|-)` with the left operand of `+=`/`-=`: assignment plus the same\n // native emission as the plain binary form.\n printNativeAssignmentArithmetic(op, left, right, leftText, rightText): string | undefined {\n const native = this.printNativeArithmetic(op, left, right, leftText, rightText);\n return native === undefined ? undefined : `${leftText} = ${native}`;\n }\n\n printNativeArithmetic(op, left, right, leftText, rightText): string | undefined {\n if (op !== SyntaxKind.PlusToken && op !== SyntaxKind.MinusToken &&\n op !== SyntaxKind.AsteriskToken && op !== SyntaxKind.SlashToken) {\n return undefined;\n }\n let leftType, rightType;\n try {\n const checker = this.getChecker();\n leftType = checker.getTypeAtLocation(left);\n rightType = checker.getTypeAtLocation(right);\n } catch (e) {\n return undefined;\n }\n if (op === SyntaxKind.PlusToken && this.isNativeStringConcatPair(leftType, rightType)) {\n return this.printNativeStringConcat(leftText, rightText);\n }\n if (!this.isNumberLikeType(leftType) || !this.isNumberLikeType(rightType)) {\n return undefined;\n }\n return this.printNativeNumeric(op, leftText, rightText);\n }\n\n printNativeStringConcat(leftText: string, rightText: string): string {\n return `Value::Str(format!(\"{}{}\", ${leftText}, ${rightText}).into())`;\n }\n\n // Both operands are `Int`/`Float` at runtime; `-> Value::Null` covers the\n // `Null`/non-numeric values the same way the helper's fallthrough does.\n // Always parenthesised so it composes under `&`, in argument position and\n // as an operand of another native match.\n printNativeNumeric(op, leftText: string, rightText: string): string {\n const [ left, right ] = [ `(${leftText})`, `(${rightText})` ];\n if (op === SyntaxKind.SlashToken) {\n return `(match (${left}.as_f64(), ${right}.as_f64()) { (Some(x), Some(y)) if y != 0.0 => Value::Float(x / y), _ => Value::Null })`;\n }\n const sign = op === SyntaxKind.PlusToken ? '+' : (op === SyntaxKind.MinusToken ? '-' : '*');\n return `(match (&${left}, &${right}) {` +\n ` (Value::Int(x), Value::Int(y)) => Value::Int(x ${sign} y),` +\n ` (Value::Int(x), Value::Float(y)) => Value::Float(*x as f64 ${sign} *y),` +\n ` (Value::Float(x), Value::Int(y)) => Value::Float(*x ${sign} *y as f64),` +\n ` (Value::Float(x), Value::Float(y)) => Value::Float(x ${sign} y),` +\n ` _ => Value::Null })`;\n }\n\n private static readonly RUST_TYPEOF_HELPERS = new Map([\n ['string', 'is_string'], ['number', 'is_number'], ['boolean', 'is_bool'], ['object', 'is_object'], ['function', 'is_function'],\n ]);\n\n printCustomBinaryExpressionIfAny(node, identation) {\n const { left, right } = node;\n const op = node.operatorToken.kind;\n const isAssign = op === SyntaxKind.EqualsToken;\n // Array destructuring reassignment: [a, b] = expr → bind once, reassign each\n if (isAssign && left.kind === SyntaxKind.ArrayLiteralExpression) {\n const tmpName = '__destr_tmp';\n const rhs = this.printNode(right, 0);\n const nativeList = this.rustNativeListSource(right);\n const assignments = left.elements.map((e, idx) => `${this.printNode(e, 0)} = ${nativeList\n ? this.printNativeListIndex(tmpName, idx) : `get_value(&${tmpName}, &Value::Int(${idx}))`}`).join('; ');\n return `{ let ${tmpName} = ${rhs}; ${assignments}; }`;\n }\n // Element access assignment: a[b] = v → add_element_to_object(&mut a, &b, v)\n if (isAssign && left.kind === SyntaxKind.ElementAccessExpression) {\n const keys: any[] = [];\n let baseExpr: any = left;\n while (isElementAccessExpression(baseExpr)) {\n keys.unshift(baseExpr.argumentExpression);\n baseExpr = baseExpr.expression;\n }\n let acc = `&mut ${this.printNode(baseExpr, 0)}`;\n const keyStrs = keys.map(k => this.printNode(k, 0));\n for (const key of keyStrs.slice(0, -1)) acc = `get_value_mut(${acc}, &${key})`;\n const rhs = this.printNode(right, 0);\n const nativeInsert = keyStrs.length === 1 ? this.printNativeDictInsert(baseExpr, keys[0], keyStrs[0], rhs) : undefined;\n return nativeInsert ?? `add_element_to_object(${acc}, &${keyStrs[keyStrs.length - 1]}, ${rhs})`;\n }\n // typeof comparisons\n if (left.kind === SyntaxKind.TypeOfExpression) {\n const rightText = right.text;\n const target = this.printNode(left.expression, 0);\n const isDiff = op === SyntaxKind.ExclamationEqualsEqualsToken || op === SyntaxKind.ExclamationEqualsToken;\n const native = this.nativeValuePredicateText(rightText, left.expression, target);\n if (native !== undefined) {\n const negated = isDiff ? `!${native}` : native;\n // Conditions/logical operands expect a bool; other positions store a boxed `Value`.\n return this.isBooleanPosition(node) ? negated : `Value::Bool(${negated})`;\n }\n const helper = RustTranspiler.RUST_TYPEOF_HELPERS.get(rightText);\n if (helper !== undefined) return `${isDiff ? '!' : ''}${helper}(&${target})`;\n }\n // `in` — wrapped as Value so it composes in any context\n if (op === SyntaxKind.InKeyword) {\n const shadow = this.rustParamShadowOf(right);\n return (shadow !== undefined ? this.printShadowInOperator(shadow, left) : undefined)\n ?? this.printNativeInOperator(left, right)\n ?? `Value::Bool(in_op(&${this.printNode(right, 0)}, &${this.printNode(left, 0)}))`;\n }\n // `+=` / `-=` on regular variables\n if ((op === SyntaxKind.PlusEqualsToken || op === SyntaxKind.MinusEqualsToken) && left.kind !== SyntaxKind.ElementAccessExpression) {\n const isPlus = op === SyntaxKind.PlusEqualsToken;\n const leftText = this.printNode(left, 0);\n const rightText = this.printNode(right, 0);\n return this.printNativeAssignmentArithmetic(isPlus ? SyntaxKind.PlusToken : SyntaxKind.MinusToken, left, right, leftText, rightText)\n ?? `${leftText} = ${isPlus ? 'add' : 'subtract'}(&${leftText}, &${rightText})`;\n }\n // Native equality on unwrapped payloads when the checker proves the variants line up\n // (see printNativeEqualityComparison); the bool is boxed like the other Value helpers.\n if (op === SyntaxKind.EqualsEqualsToken || op === SyntaxKind.EqualsEqualsEqualsToken ||\n op === SyntaxKind.ExclamationEqualsToken || op === SyntaxKind.ExclamationEqualsEqualsToken) {\n const nativeEquality = this.printNativeEqualityComparison(left, right, op);\n if (nativeEquality) return `Value::Bool(${nativeEquality})`;\n }\n // A logical expression with a native-compare operand no longer starts with a bool helper: box it.\n if ((op === SyntaxKind.AmpersandAmpersandToken || op === SyntaxKind.BarBarToken)\n && (this.hasNativeComparisonOperand(left) || this.hasNativeComparisonOperand(right))) {\n return `Value::Bool(${this.printLogicalInBooleanContext(node)})`;\n }\n // Binary wrapper functions (is_equal, add, etc.) - add & to both sides\n if (op in this.binaryExpressionsWrappers) {\n const nativeCompare = RustTranspiler.NATIVE_COMPARISON_OPERATORS[op] !== undefined\n ? this.printNativeOrderedComparison(node, op, left, right) : undefined;\n if (nativeCompare !== undefined) return nativeCompare;\n const [fnName, close] = this.binaryExpressionsWrappers[op];\n const leftText = this.printNode(left, 0);\n const rightText = this.printNode(right, 0);\n return this.printNativeArithmetic(op, left, right, leftText, rightText)\n ?? `${fnName}${this.ensureRef(leftText)}, ${this.ensureRef(rightText)}${close}`;\n }\n return undefined;\n }\n\n printBinaryExpression(node, identation) {\n return this.printCustomBinaryExpressionIfAny(node, identation) || super.printBinaryExpression(node, identation);\n }\n\n // `Date.now()` → runtime helper returning current epoch millis.\n printDateNowCall(node, identation) {\n return 'date_now()';\n }\n\n // `str.padStart(len, pad)` / `str.padEnd(len, pad)` → runtime helpers `(&Value, &Value, &Value)`.\n printPadStartCall(node, identation, name, parsedArg, parsedArg2) {\n return `pad_start(${this.ensureRef(name)}, ${this.ensureRef(parsedArg)}, ${this.ensureRef(parsedArg2)})`;\n }\n\n printPadEndCall(node, identation, name, parsedArg, parsedArg2) {\n return `pad_end(${this.ensureRef(name)}, ${this.ensureRef(parsedArg)}, ${this.ensureRef(parsedArg2)})`;\n }\n\n printVariableDeclarationList(node, identation) {\n const declaration = node.declarations[0];\n const indent = this.getIden(identation);\n if (declaration?.name.kind === SyntaxKind.ArrayBindingPattern) {\n const parsedElements = declaration.name.elements.map(e => this.printNode(e.name, 0));\n const syntheticName = parsedElements.join('') + 'Variable';\n const head = `${indent}let mut ${syntheticName} = ${this.printNode(declaration.initializer, 0)};\\n`;\n const nativeList = this.rustNativeListSource(declaration.initializer);\n const lines = parsedElements.map((e, idx) => `${indent}let mut ${e}: Value = ${nativeList\n ? this.printNativeListIndex(syntheticName, idx) : `get_value(&${syntheticName}, &Value::Int(${idx}))`}`);\n return head + lines.join(';\\n');\n }\n const varName = this.printNode(declaration.name, 0);\n if (!declaration.initializer) {\n return `${indent}let mut ${varName}: Value = Value::Null`;\n }\n const parsedValue = this.printNode(declaration.initializer, identation).trim();\n if (declaration.initializer.kind === SyntaxKind.NewExpression) {\n return `${indent}let mut ${varName} = ${parsedValue}`;\n }\n const boolValue = this.getRustBoolLocalInitializer(declaration, parsedValue);\n if (boolValue !== undefined) {\n return `${indent}let mut ${varName}: bool = ${boolValue}`;\n }\n const typedStr = this.rustSafeStringLocalIsTyped(declaration);\n const nativeStr = this.rustNativeStrCalleeKind(declaration.initializer) === 'str';\n if (typedStr) {\n // A native-`Option` callee already carries the payload; `safeString` helpers need the unwrap.\n return `${indent}let mut ${varName}: Option = ${parsedValue}${nativeStr ? '' : '.as_str().map(str::to_owned)'}`;\n }\n // A callee returning `Option` into a boxed local keeps the box.\n return `${indent}let mut ${varName}: Value = ${nativeStr ? this.rustNativeStrValueBox(parsedValue) : parsedValue}`;\n }\n\n // ── native-typed locals ───────────────────────────────────────────────────\n //\n // A local is declared `bool` (instead of `Value`) when its initializer is\n // already a bool-valued Rust expression and every use is a condition sink\n // (`is_true(&x)`) — the one sink that accepts a native bool today.\n //\n // `is_true` is generic over `IsTruthy` (impl for `bool`/`&bool` in\n // runtime.rs); every other sink takes `&Value`, so any other use keeps the\n // local boxed. Bools come in two shapes: helpers whose Rust return type is\n // already `bool` (below), and the printer's own `Value::Bool(...)` box,\n // which the declaration drops at the init site.\n\n private static readonly RUST_BOOL_RESULT_HELPERS = new Set([\n 'is_true', 'is_equal', 'is_greater_than', 'is_greater_than_or_equal',\n 'is_less_than', 'is_less_than_or_equal', 'is_array', 'is_object',\n 'is_string', 'is_number', 'is_bool', 'is_integer', 'is_function',\n 'is_instance', 'starts_with', 'ends_with', 'in_op', 'contains',\n ]);\n\n // Hand-written Rust fns outside `runtime.rs` with a `-> bool` signature, keyed by the TS callee\n // name (verified in `rust/tests/src/tests_support.rs`). A call is already a Rust bool, so the\n // condition printer's `is_true(&…)` wrapper is the identity (`IsTruthy for bool`) and is dropped.\n private static readonly RUST_BOOL_RESULT_CALLEES = new Set([\n 'tickerExceptionNeedsOhlcv',\n ]);\n\n // Call to a hand-written `-> bool` fn: the checker must agree the TS call\n // is boolean-typed and the callee must be in the verified table above.\n rustCallPrintsBool(node): boolean {\n if (node?.kind !== SyntaxKind.CallExpression) {\n return false;\n }\n const callee: any = node.expression;\n const name = callee?.kind === SyntaxKind.Identifier ? callee.text\n : callee?.kind === SyntaxKind.PropertyAccessExpression ? callee.name?.text : undefined;\n return name !== undefined && RustTranspiler.RUST_BOOL_RESULT_CALLEES.has(name) && this.rustTypeIsBoolean(node);\n }\n\n // Index just past the `\"...\"` literal opening at `i` (escapes skipped).\n private rustSkipStringLiteral(text: string, i: number): number {\n for (i++; i < text.length && text[i] !== '\"'; i++) {\n if (text[i] === '\\\\') i++;\n }\n return i;\n }\n\n // `)` spanning the whole printed value → ``. The payload is\n // only reachable this way: the printer prints the value, not its parts.\n peelValueBox(printedValue: string, prefix: string): string | undefined {\n if (!printedValue.startsWith(prefix) || !printedValue.endsWith(')')) {\n return undefined;\n }\n let depth = 0;\n for (let i = prefix.length - 1; i < printedValue.length; i++) {\n const char = printedValue[i];\n if (char === '\"') i = this.rustSkipStringLiteral(printedValue, i);\n else if (char === '(') depth++;\n else if (char === ')' && --depth === 0) {\n return i === printedValue.length - 1 ? printedValue.slice(prefix.length, i) : undefined;\n }\n }\n return undefined;\n }\n\n // `Value::Bool()` spanning the whole expression → ``.\n peelValueBoolBox(printedValue: string): string | undefined {\n return this.peelValueBox(printedValue, 'Value::Bool(');\n }\n\n // `Value::Str()` spanning the whole expression → `` (a String).\n peelValueStrBox(printedValue: string): string | undefined {\n return this.peelValueBox(printedValue, 'Value::Str(');\n }\n\n // `((expr))` → `expr` — a redundant layer kept from the TS source; the\n // right-hand side of a declaration binds the whole expression anyway.\n stripOuterParens(printedValue: string): string {\n let value = printedValue.trim();\n while (value.startsWith('(') && value.endsWith(')')) {\n let depth = 0;\n let closesAtEnd = true;\n for (let i = 0; i < value.length && closesAtEnd; i++) {\n const char = value[i];\n if (char === '\"') i = this.rustSkipStringLiteral(value, i);\n else if (char === '(') depth++;\n else if (char === ')' && --depth === 0 && i !== value.length - 1) closesAtEnd = false;\n }\n if (!closesAtEnd || depth !== 0) break;\n value = value.slice(1, -1).trim();\n }\n return value;\n }\n\n // `is_equal(...)` / `!is_true(...)` / `contains(...)` — bare bool helper calls.\n printedBoolHelperCall(printedValue: string): boolean {\n const stripped = printedValue.startsWith('!') ? printedValue.slice(1).trim() : printedValue;\n const match = /^([a-z_][a-z0-9_]*)\\(/.exec(stripped);\n return match !== null && RustTranspiler.RUST_BOOL_RESULT_HELPERS.has(match[1]);\n }\n\n // Source shapes the printer turns into a bool: comparisons, `&&`/`||`\n // (each operand is is_true-wrapped), `!`, `in`, `instanceof`, true/false.\n rustNodeIsBoolExpression(node): boolean {\n switch (node?.kind) {\n case SyntaxKind.TrueKeyword:\n case SyntaxKind.FalseKeyword:\n return true;\n case SyntaxKind.ParenthesizedExpression:\n return this.rustNodeIsBoolExpression(node.expression);\n case SyntaxKind.PrefixUnaryExpression:\n return node.operator === SyntaxKind.ExclamationToken;\n case SyntaxKind.BinaryExpression: {\n const kind = node.operatorToken.kind;\n return (RustTranspiler as any).COMPARISON_OPS.has(kind) || kind === SyntaxKind.AmpersandAmpersandToken\n || kind === SyntaxKind.BarBarToken || kind === SyntaxKind.InKeyword || kind === SyntaxKind.InstanceOfKeyword;\n }\n }\n return false;\n }\n\n rustTypeIsBoolean(node): boolean {\n try {\n const type = this.getChecker().getTypeAtLocation(node);\n return (type.flags & TypeFlags.BooleanLike) !== 0 || this.getChecker().typeToString(type).trim() === 'boolean';\n } catch (e) {\n return false; // no checker type → keep the boxed form\n }\n }\n\n rustTypeIsString(node): boolean {\n const checker: any = this.checkerOrUndefined();\n // no checker type → keep the boxed form\n return checker !== undefined && this.isStringLikeType(checker.getTypeAtLocation(node));\n }\n\n rustEnclosingFunction(node) {\n for (let current = node?.parent; current; current = current.parent) {\n switch (current.kind) {\n case SyntaxKind.MethodDeclaration:\n case SyntaxKind.FunctionDeclaration:\n case SyntaxKind.FunctionExpression:\n case SyntaxKind.ArrowFunction:\n case SyntaxKind.Constructor:\n case SyntaxKind.SourceFile:\n return current;\n }\n }\n return undefined;\n }\n\n rustBindsName(node, name: string): boolean {\n switch (node?.kind) {\n case SyntaxKind.VariableDeclaration:\n case SyntaxKind.Parameter:\n case SyntaxKind.FunctionDeclaration:\n case SyntaxKind.ClassDeclaration:\n case SyntaxKind.PropertyDeclaration:\n case SyntaxKind.FunctionExpression:\n case SyntaxKind.ArrowFunction:\n return node.name?.kind === SyntaxKind.Identifier && node.name.text === name;\n }\n return false;\n }\n\n // Only these uses compile against a native `bool` local today: `is_true(&x)`\n // (under any depth of `(...)`, `!`, `&&`/`||`), and the condition slot of\n // if/while/for/ternary — all printed is_true-wrapped.\n rustIdentifierUseIsCondition(node): boolean {\n for (let current: any = node, parent: any = node.parent; parent; current = parent, parent = parent.parent) {\n switch (parent.kind) {\n case SyntaxKind.ParenthesizedExpression:\n if (parent.expression !== current) return false;\n break;\n case SyntaxKind.PrefixUnaryExpression:\n if (parent.operator !== SyntaxKind.ExclamationToken || parent.operand !== current) return false;\n break;\n case SyntaxKind.BinaryExpression:\n if (parent.operatorToken.kind !== SyntaxKind.AmpersandAmpersandToken\n && parent.operatorToken.kind !== SyntaxKind.BarBarToken) return false;\n break;\n case SyntaxKind.IfStatement:\n case SyntaxKind.WhileStatement:\n case SyntaxKind.DoStatement:\n return parent.expression === current;\n case SyntaxKind.ForStatement:\n case SyntaxKind.ConditionalExpression:\n return parent.condition === current;\n default:\n return false;\n }\n }\n return false;\n }\n\n // Visits every in-scope use of the local `name` declared by `declaration`: false as soon as the\n // name is re-bound in scope or `acceptUse(identifier)` rejects a use. `skipPropertyNames` leaves\n // `x.foo` / `{ foo }` names out of the uses.\n private rustLocalUsesAll(declaration, name: string, skipPropertyNames: boolean, acceptUse: (n) => boolean): boolean {\n const scope = this.rustEnclosingFunction(declaration);\n if (scope === undefined || name === undefined) {\n return false;\n }\n let safe = true;\n for (const n of this.rustScopeNameNodes(scope, name) as any[]) {\n if (n !== declaration && this.rustBindsName(n, name)) {\n safe = false; // a second binding of the name in scope — stay boxed\n break;\n }\n if (n.kind === SyntaxKind.Identifier && n !== declaration.name\n && !(skipPropertyNames && this.rustIdentifierIsPropertyName(n)) && !acceptUse(n)) {\n safe = false;\n break;\n }\n }\n return safe;\n }\n\n rustLocalUsesAcceptBool(declaration, sourceName: string): boolean {\n return this.rustLocalUsesAll(declaration, sourceName, false, (n) => this.rustIdentifierUseIsCondition(n));\n }\n\n // Typed string locals: `let x: Value = self.safeString(..)` is declared `Option` when\n // the checker proves a string and every use is a native sink (`x.is_none()`, `x.as_deref() ==\n // Some(\"lit\")`). The helper's Value is unwrapped with `.as_str()`; any other sink keeps the box.\n\n private static readonly RUST_STRING_LOCAL_HELPERS = new Set([\n 'safeString', 'safeString2', 'safeStringN',\n 'safeStringLower', 'safeStringLower2', 'safeStringLowerN',\n 'safeStringUpper', 'safeStringUpper2', 'safeStringUpperN',\n ]);\n\n private rustStringLocalDecisions = new Map();\n\n // `let x = this.safeString(..)` / `safeString(..)` — the whole initializer;\n // a call whose callee already returns `Option` (a native-`Str`\n // method) is the same payload without the unwrap.\n rustSafeStringLocalInitializer(declaration): boolean {\n const initializer = declaration.initializer;\n if (declaration.name?.kind !== SyntaxKind.Identifier || initializer?.kind !== SyntaxKind.CallExpression) {\n return false;\n }\n if (this.rustNativeStrCalleeKind(initializer) === 'str') {\n return true;\n }\n const callee = initializer.expression;\n const helpers = RustTranspiler.RUST_STRING_LOCAL_HELPERS;\n if (callee?.kind === SyntaxKind.PropertyAccessExpression) {\n return callee.expression?.kind === SyntaxKind.ThisKeyword && helpers.has(callee.name.text);\n }\n return callee?.kind === SyntaxKind.Identifier && helpers.has(callee.text);\n }\n\n // The two uses that compile against an `Option` local and print\n // natively: `x ==/!= null|undefined` and `x ==/!= \"lit\"`.\n rustStringLocalUseIsNative(node): boolean {\n const parent = node.parent;\n if (parent?.kind !== SyntaxKind.BinaryExpression) {\n return false;\n }\n const op = parent.operatorToken.kind;\n if (op !== SyntaxKind.EqualsEqualsToken && op !== SyntaxKind.EqualsEqualsEqualsToken\n && op !== SyntaxKind.ExclamationEqualsToken && op !== SyntaxKind.ExclamationEqualsEqualsToken) {\n return false;\n }\n const other = parent.left === node ? parent.right : (parent.right === node ? parent.left : undefined);\n if (other === undefined) {\n return false;\n }\n const otherLiteral = this.literalKindOfNode(other);\n // The string-literal compare prints as `.as_deref() == Some(\"lit\")`;\n // the printer's own rejections (replacement tokens) must match.\n return otherLiteral === 'null' || (otherLiteral === 'string' && !(other.text in this.StringLiteralReplacements));\n }\n\n // Every use compiles against `Option`, and at least one native sink\n // consumes it (otherwise the retype buys nothing).\n rustSafeStringLocalIsTyped(declaration): boolean {\n const cached = this.rustStringLocalDecisions.get(declaration);\n if (cached !== undefined) {\n return cached;\n }\n this.rustStringLocalDecisions.set(declaration, false); // re-entrancy guard\n const decision = this.rustSafeStringLocalIsTypedUncached(declaration);\n this.rustStringLocalDecisions.set(declaration, decision);\n return decision;\n }\n\n rustSafeStringLocalIsTypedUncached(declaration): boolean {\n if (!this.rustSafeStringLocalInitializer(declaration)\n || this.primitiveKindOfType(this.typeOfNodeIfAny(declaration.name)) !== 'string') {\n return false;\n }\n let nativeUses = 0;\n const safe = this.rustLocalUsesAll(declaration, declaration.name.text, true,\n (n) => this.rustStringLocalUseIsNative(n) && ++nativeUses > 0);\n return safe && nativeUses > 0;\n }\n\n // `x.foo` / `{ foo: 1 }` — a property name is not a use of the local.\n rustIdentifierIsPropertyName(node): boolean {\n const parent = node.parent;\n switch (parent?.kind) {\n case SyntaxKind.PropertyAccessExpression:\n case SyntaxKind.PropertyAssignment:\n case SyntaxKind.PropertySignature:\n case SyntaxKind.ShorthandPropertyAssignment:\n return parent.name === node;\n }\n return false;\n }\n\n // Is this identifier occurrence bound to a typed string local?\n rustStringLocalIdentifierIsTyped(node): boolean {\n const checker: any = node?.kind === SyntaxKind.Identifier ? this.checkerOrUndefined() : undefined;\n if (checker === undefined) {\n return false;\n }\n const symbol = checker.getSymbolAtLocation(node);\n const declaration = symbolValueDeclaration(symbol) ?? symbolDeclarations(symbol)[0];\n return declaration?.kind === SyntaxKind.VariableDeclaration && this.rustSafeStringLocalIsTyped(declaration);\n }\n\n // `let x = ` → the printed bool expression, or undefined.\n getRustBoolLocalInitializer(declaration, printedValue: string): string | undefined {\n const initializer = declaration.initializer;\n if (initializer === undefined || declaration.name?.kind !== SyntaxKind.Identifier) {\n return undefined;\n }\n const inner = this.stripOuterParens(printedValue);\n const peeled = this.peelValueBoolBox(inner);\n if (peeled === undefined && !this.printedBoolHelperCall(inner) && !this.rustNodeIsBoolExpression(initializer)) {\n return undefined;\n }\n if (!this.rustTypeIsBoolean(initializer) || !this.rustLocalUsesAcceptBool(declaration, declaration.name.text)) {\n return undefined;\n }\n return peeled ?? inner;\n }\n\n // ── native `Option` returns (`: Str` methods) ─────────────────────\n //\n // An internal, non-override, non-async method declared `: Str`\n\n private rustNativeStrReturnDecisions = new WeakMap();\n\n // `ts/src/base/**` — the shared `Exchange` / `PredictionExchange` classes\n // (the transpiler synthesises variants like `.__ExchangeNoOverloads.ts`).\n private static readonly RUST_BASE_TIER_FILE = /ts[\\\\/]src[\\\\/]base[\\\\/]/;\n\n /** `'str'` when the method is emitted `-> Option`, else undefined. */\n rustNativeStrReturnKind(node: Node): string | undefined {\n if (node === undefined || node.kind !== SyntaxKind.MethodDeclaration) {\n return undefined;\n }\n let decision = this.rustNativeStrReturnDecisions.get(node);\n if (decision === undefined) {\n this.rustNativeStrReturnDecisions.set(node, false); // re-entrancy guard\n decision = this.rustNativeStrReturnDecisionUncached(node);\n this.rustNativeStrReturnDecisions.set(node, decision);\n }\n return decision ? 'str' : undefined;\n }\n\n private rustMethodOverrides = new WeakMap();\n private rustClassAncestorTables = new WeakMap[] | null>();\n\n /** Per ancestor class (nearest first): method name -> its LAST declaration; undefined when a\n * parent class does not resolve. */\n private rustAncestorMethodTables(classDecl: Node): Map[] | undefined {\n const cached = this.rustClassAncestorTables.get(classDecl);\n if (cached !== undefined) {\n return cached ?? undefined;\n }\n const chain: Map[] = [];\n let parentClass = getAllSuperTypeNodes(classDecl)[0];\n let ok = true;\n while (parentClass !== undefined) {\n const parentClassDecl = this.getChecker().getTypeAtLocation(parentClass)?.getSymbol()?.valueDeclaration?.resolve();\n if (parentClassDecl === undefined) {\n ok = false;\n break;\n }\n const byName = new Map();\n for (const elem of (parentClassDecl as any).members ?? []) {\n if (isMethodDeclaration(elem)) {\n byName.set(elem.name.getText().trim(), elem);\n }\n }\n chain.push(byName);\n parentClass = getAllSuperTypeNodes(parentClassDecl)[0] ?? undefined;\n }\n this.rustClassAncestorTables.set(classDecl, ok ? chain : null);\n return ok ? chain : undefined;\n }\n\n // base getMethodOverride rescans every parent member (getText) per call; same walk, memoized\n getMethodOverride(node: Node): Node {\n if (node === undefined || !isClassDeclaration(node.parent) || !(node.parent as any).heritageClauses) {\n return undefined;\n }\n const cached = this.rustMethodOverrides.get(node);\n if (cached !== undefined) {\n return cached ?? undefined;\n }\n const chain = this.rustAncestorMethodTables(node.parent);\n let method = undefined;\n if (chain === undefined) {\n this.warn(node, \"Parent class\", \"Parent class not found\");\n } else {\n const name = (node as any).name.text;\n for (const byName of chain) {\n method = byName.get(name) ?? method;\n }\n }\n this.rustMethodOverrides.set(node, method ?? null);\n return method;\n }\n\n private rustNativeStrReturnDecisionUncached(node): boolean {\n // An override's base/trait copy prints `-> Value`. The base classes are hand-tuned across the\n // whole tree: their methods are called from ~every derived file (and the hand-written runtime),\n // where the boxed `Value` ABI is load-bearing. Only per-exchange\n if (node.type === undefined || this.isAsyncFunction(node) || this.getMethodOverride(node) !== undefined\n || RustTranspiler.RUST_BASE_TIER_FILE.test(node.getSourceFile().fileName)) {\n return false;\n }\n let type: Type;\n try {\n type = this.getChecker().getTypeFromTypeNode(node.type);\n } catch (e) {\n return false;\n }\n return this.primitiveKindOfType(type) === 'string' && this.rustStrReturnPathsConvert(node.body);\n }\n\n /** Every `return` of the method's own body converts, and the body's last\n * statement is one of them (so Rust sees no `()`-valued tail the\n * `-> Value` post-passes would have patched with `Value::Null`). */\n rustStrReturnPathsConvert(body: Block): boolean {\n const last = body?.statements[body.statements.length - 1];\n if (last === undefined || !isReturnStatement(last)) {\n return false;\n }\n let ok = true;\n const visit = (n: Node) => {\n if (!ok || (n !== body && isFunctionLike(n))) {\n return; // a nested function keeps the boxed signature\n }\n if (isReturnStatement(n) && !this.rustStrReturnValueConverts(n.expression)) {\n ok = false;\n return;\n }\n n.forEachChild(visit);\n };\n body.forEachChild(visit);\n return ok;\n }\n\n /** A `return` value of a native-`Str` method: a nullish literal, an\n * expression already printing an `Option` (a nested retyped call\n * or a typed string local), or a `Value`-printing expression the checker\n * types `string | undefined`. */\n rustStrReturnValueConverts(expression: Node): boolean {\n const inner = this.unwrapParensNode(expression);\n if (inner === undefined) {\n return false;\n }\n if (this.literalKindOfNode(inner) === 'null' || this.rustStrNativeExpression(inner)) {\n return true;\n }\n return this.printsValueExpression(inner) && this.primitiveKindOfType(this.getCheckedTypeOf(inner)) === 'string';\n }\n\n /** An expression that already prints an `Option` in a `: Str`\n * method's return position. */\n rustStrNativeExpression(expression: Node): boolean {\n const inner = this.unwrapParensNode(expression);\n if (inner !== undefined && isCallExpression(inner)) {\n return this.rustNativeStrCalleeKind(inner) === 'str';\n }\n return inner !== undefined && isIdentifier(inner) && this.rustStringLocalIdentifierIsTyped(inner);\n }\n\n unwrapParensNode(node: Node): Node | undefined {\n let current = node;\n while (current !== undefined && isParenthesizedExpression(current)) {\n current = current.expression;\n }\n return current;\n }\n\n /** The callee declaration behind `self.(..)` when it is emitted\n * `-> Option`; undefined otherwise (no proof → keep the box). */\n // call node -> resolved signature's declaration (null: none); a handle resolve per call is JS-heavy\n private rustCallDeclarations = new WeakMap();\n\n rustNativeStrCalleeKind(node: Node): string | undefined {\n if (node === undefined || node.kind !== SyntaxKind.CallExpression) {\n return undefined;\n }\n let declaration = this.rustCallDeclarations.get(node);\n if (declaration === undefined) {\n try {\n declaration = signatureDeclaration((this.getChecker() as any).getResolvedSignature(node)) ?? null;\n } catch (e) {\n return undefined;\n }\n this.rustCallDeclarations.set(node, declaration);\n }\n return declaration?.kind === SyntaxKind.MethodDeclaration ? this.rustNativeStrReturnKind(declaration) : undefined;\n }\n\n /** `Option` → `Value` (exact inverse of the return conversion). */\n rustNativeStrValueBox(text: string): string {\n return `${text}.map(|__s| Value::Str(__s.into())).unwrap_or(Value::Null)`;\n }\n\n /** True when a call to a native-`Str` callee must be boxed back to a\n * `Value` at this position; the declaration and return printers run the\n * conversion themselves. */\n rustNativeStrCallNeedsBox(node: Node): boolean {\n let current: any = node;\n let parent: any = current.parent;\n while (parent !== undefined && isParenthesizedExpression(parent) && parent.expression === current) {\n current = parent;\n parent = parent.parent;\n }\n if (parent === undefined) {\n return true;\n }\n if (isVariableDeclaration(parent) && parent.initializer === current && isIdentifier(parent.name)) {\n return false; // the declaration printer binds the type / boxes it\n }\n if (isReturnStatement(parent) && parent.expression === current) {\n // only a native-`Str` method's own return printer runs the conversion\n return this.rustNativeStrReturnKind(findAncestor(parent.parent, isFunctionLike) as any) !== 'str';\n }\n return true;\n }\n\n /** Wrap a call text when the callee returns a native `Option`\n * and the position still needs a `Value`. */\n rustBoxNativeStrCallIfNeeded(node: Node, text: string): string {\n return this.rustNativeStrCalleeKind(node) === 'str' && this.rustNativeStrCallNeedsBox(node)\n ? this.rustNativeStrValueBox(text) : text;\n }\n\n // ── declared-Dict locals (`let x: Value = self.safe_dict_k(..)`) ───────────\n //\n // The printer declares non-bool locals `Value`, and the checker types a\n\n private declaredDictLocalsCache: { src: SourceFile, table: Map } | undefined;\n\n /** All `let x: Value = ` declarations of the current\n * source file, keyed by local name in declaration order. */\n rustDeclaredDictLocals(): Map {\n const src = this.getSrc();\n if (this.declaredDictLocalsCache?.src !== src) {\n let table: Map;\n try {\n table = this.collectRustDeclaredDictLocals(src);\n } catch (e) {\n table = new Map(); // no proof -> consumers keep the helper\n }\n this.declaredDictLocalsCache = { src, table };\n }\n return this.declaredDictLocalsCache.table;\n }\n\n /** Printer hook for the helper-removal units: the proven kind of a declared\n * local, or undefined when the local is not proven Dict at every use.\n * Accepts the receiver node of the helper call (identifier, `x['k']` chain,\n * `this.x` chain) or the declaration itself. */\n rustDeclaredLocalTypeResolver(node: Node): RustDeclaredLocalKind | undefined {\n return this.rustDeclaredLocalEntry(node)?.kind;\n }\n\n /** The table entry a use site resolves to (the declaration whose binding the\n * use refers to, proven), or undefined. */\n rustDeclaredLocalEntry(node: Node): RustDeclaredDictLocalEntry | undefined {\n if (node === undefined) return undefined;\n const name = isVariableDeclaration(node) ? (node.name as Identifier).text : this.rootPlaceText(node);\n if (name === undefined) return undefined;\n const entries = this.rustDeclaredDictLocals().get(name);\n if (entries === undefined) return undefined;\n const start = node.getStart();\n const identifier = this.rustDeclaredLocalIdentifier(node);\n const symbol = identifier === undefined ? undefined : this.rustSymbolOf(identifier);\n let best: RustDeclaredDictLocalEntry | undefined;\n for (const entry of entries) {\n if (entry.start > start || !entry.alwaysDict || !entry.stable) continue;\n const scope = this.rustEnclosingFunction(entry.declaration);\n if (scope !== undefined && !this.isNodeInsideNode(node, scope)) continue;\n if (identifier !== undefined) {\n const entrySymbol = this.rustSymbolOf((entry.declaration.name as Identifier));\n if (symbol !== undefined && entrySymbol !== undefined && symbol !== entrySymbol) continue;\n }\n if (best === undefined || entry.start > best.start) best = entry;\n }\n return best;\n }\n\n /** The identifier at the head of a place (`x`, `x['k']`, `this.x` is not a\n * local) — the node the resolver matches against the table. */\n private rustDeclaredLocalIdentifier(node: Node): Identifier | undefined {\n let current: any = node;\n while (current !== undefined && !isIdentifier(current)) {\n if (isElementAccessExpression(current) || isPropertyAccessExpression(current)) {\n if (current.expression.kind === SyntaxKind.ThisKeyword) return undefined;\n } else if (!isParenthesizedExpression(current) && !isNonNullExpression(current)) {\n return undefined;\n }\n current = current.expression;\n }\n return current;\n }\n\n /** Binding symbol of an identifier, or undefined when the checker cannot\n * answer (ByContent probes without a class context, for instance). */\n private rustSymbolOf(node: Identifier): TsSymbol | undefined {\n return this.checkerOrUndefined()?.getSymbolAtLocation(node);\n }\n\n /** True when this identifier is a use of the given declaration's binding.\n * Without a checker answer the callers stay conservative (reject). */\n private rustIdentifierRefersToDeclaration(node: Identifier, declaration: VariableDeclaration): boolean {\n const symbol = this.rustSymbolOf(node);\n return symbol !== undefined && symbol === this.rustSymbolOf(declaration.name as Identifier);\n }\n\n /** Census of the current source file's table, for reports and tests. */\n rustDeclaredDictLocalCensus(): { declarators: number, dict: number, alwaysDict: number, kindUnstable: number, retypeEligible: number } {\n let declarators = 0, dict = 0, alwaysDict = 0, kindUnstable = 0, retypeEligible = 0;\n for (const entries of this.rustDeclaredDictLocals().values()) {\n for (const entry of entries) {\n declarators++;\n if (entry.alwaysDict) alwaysDict++;\n if (entry.alwaysDict && entry.stable) dict++;\n if (entry.alwaysDict && !entry.stable) kindUnstable++;\n // every later use is an element access or a kind-preserving\n // mutator -> the only uses a native declaration has to serve.\n if (entry.alwaysDict && entry.stable && entry.uses.other === 0) retypeEligible++;\n }\n }\n return { declarators, dict, alwaysDict, kindUnstable, retypeEligible };\n }\n\n private collectRustDeclaredDictLocals(src: SourceFile): Map {\n const candidates: { declaration: VariableDeclaration, name: string, source: string, defaultNode: Node | undefined }[] = [];\n this.rustWalkScope(src, (node) => {\n if (isVariableDeclaration(node) && node.initializer !== undefined && node.name.kind === SyntaxKind.Identifier) {\n const info = this.rustDictInitializerInfo(node.initializer);\n if (info !== undefined) {\n candidates.push({ declaration: node, name: String(node.name.text), source: info.source, defaultNode: info.defaultNode });\n }\n }\n });\n candidates.sort((a, b) => a.declaration.getStart() - b.declaration.getStart());\n const table = new Map();\n for (const candidate of candidates) {\n const declaration = candidate.declaration;\n const start = declaration.getStart();\n const alwaysDict = this.rustDictProvenExpression(candidate.defaultNode, table, start);\n const scan = this.rustDictLocalWriteScan(declaration, candidate.name, table);\n const entries = table.get(candidate.name) ?? [];\n entries.push({ kind: RUST_DECLARED_DICT_LOCALS.DICT, name: candidate.name, source: candidate.source,\n alwaysDict, stable: scan.stable, uses: scan.uses, declaration, start });\n table.set(candidate.name, entries);\n }\n return table;\n }\n\n /** The Dict-proven initialiser shape of a declaration, or undefined. */\n private rustDictInitializerInfo(node: Node): { source: string, defaultNode: Node | undefined } | undefined {\n if (isObjectLiteralExpression(node)) {\n return { source: 'value_map', defaultNode: node };\n }\n if (isParenthesizedExpression(node) || isAsExpression(node) || isNonNullExpression(node)) {\n return this.rustDictInitializerInfo(node.expression);\n }\n if (!isCallExpression(node)) return undefined;\n const callee = this.rustSafeDictCallee(node);\n if (callee === undefined) return undefined;\n return { source: callee, defaultNode: node.arguments[RUST_DECLARED_DICT_LOCALS.SAFE_CALLEES[callee]] };\n }\n\n /** Printed `safe_dict*` callee name of `self.(..)`, or undefined. */\n private rustSafeDictCallee(node: CallExpression): string | undefined {\n const expression = node.expression;\n if (!isPropertyAccessExpression(expression) || expression.expression.kind !== SyntaxKind.ThisKeyword) {\n return undefined;\n }\n const printed = this.toSnakeCaseName(expression.name.text);\n return RUST_DECLARED_DICT_LOCALS.SAFE_CALLEES[printed] === undefined ? undefined : printed;\n }\n\n /** True when the expression can only be a Dict at run time: an object\n * literal, a `safe_dict*` call with a Dict-proven default, an element of a\n * one-element literal default, or an already-proven local. */\n private rustDictProvenExpression(node: Node | undefined, table: Map, useStart: number): boolean {\n if (node === undefined) return false;\n if (isObjectLiteralExpression(node)) return true;\n if (isParenthesizedExpression(node) || isAsExpression(node) || isNonNullExpression(node)) {\n return this.rustDictProvenExpression(node.expression, table, useStart);\n }\n if (isArrayLiteralExpression(node)) {\n return node.elements.length === 1 && this.rustDictProvenExpression(node.elements[0], table, useStart);\n }\n if (isIdentifier(node)) {\n const entries = table.get(node.text) ?? [];\n return entries.some((entry) => {\n if (!entry.alwaysDict || entry.start > useStart) return false;\n const scope = this.rustEnclosingFunction(entry.declaration);\n return scope === undefined || this.isNodeInsideNode(node, scope);\n });\n }\n const info = this.rustDictInitializerInfo(node);\n return info !== undefined && this.rustDictProvenExpression(info.defaultNode, table, useStart);\n }\n\n /** D2 scan over the enclosing function: an assignment of a non-Dict-proven\n * value would let the kind change. Every other write path the printer emits\n * for a local is kind-preserving (`x['k'] = v` -> `add_element_to_object`,\n * `x.push(v)` -> `append_to_array`, `delete x[k]` -> `remove`, nested\n * `x['a']['b'] = v` -> `get_value_mut`/`set_value`). A *different* binding of\n * the same name (sibling block, parameter) is not this local and does not\n * count; when the checker cannot separate the two bindings the scan stays\n * conservative and rejects. */\n private rustDictLocalWriteScan(declaration: VariableDeclaration, name: string, table: Map): { stable: boolean, uses: { elementAccess: number, mutHelper: number, other: number } } {\n const uses = { elementAccess: 0, mutHelper: 0, other: 0 };\n let stable = true;\n const scope = this.rustEnclosingFunction(declaration);\n if (scope === undefined) return { stable, uses };\n const declarationSymbol = this.rustSymbolOf(declaration.name as Identifier);\n // every event of the scan is rooted at a node spelled `name`: a re-binding, a use, or the\n // identifier inside an assignment target / for-of-in head (the target's own node is an ancestor)\n for (const node of this.rustScopeNameNodes(scope, name) as any[]) {\n if (node !== declaration && this.rustBindsName(node, name)) {\n const otherSymbol = this.rustSymbolOf((node as any).name);\n if (declarationSymbol === undefined || otherSymbol === undefined || otherSymbol === declarationSymbol) {\n stable = false; // same binding, or the checker cannot tell them apart\n break;\n }\n }\n if (node.kind !== SyntaxKind.Identifier) continue;\n if (node !== declaration.name && this.rustIdentifierRefersToDeclaration(node, declaration)) {\n this.rustDictLocalClassifyUse(node, uses);\n }\n let target: any = node;\n while (target.parent !== undefined && (isParenthesizedExpression(target.parent) || isArrayLiteralExpression(target.parent)\n || isShorthandPropertyAssignment(target.parent) || isObjectLiteralExpression(target.parent))) {\n target = target.parent;\n }\n const holder: any = target.parent;\n if (holder !== undefined && isBinaryExpression(holder) && holder.left === target\n && rustIsAssignmentOperator(holder.operatorToken.kind) &&\n this.rustAssignmentWritesWholeLocal(holder.left, declaration) &&\n !this.rustDictProvenExpression(holder.right, table, declaration.getStart())) {\n stable = false; // the local itself is reassigned a non-Dict value\n break;\n }\n // `for (x of list)` / `for (x in obj)` rebind an existing local.\n if (holder !== undefined && (isForOfStatement(holder) || isForInStatement(holder)) && holder.initializer === target &&\n this.rustAssignmentWritesWholeLocal(holder.initializer, declaration)) {\n stable = false;\n break;\n }\n }\n return { stable, uses };\n }\n\n /** True when this assignment target writes the local ITSELF (`x = ..`,\n * `[x, y] = ..`, `({x} = ..)`), as opposed to a write *into* it\n * (`x['k'] = ..`, kind-preserving). */\n private rustAssignmentWritesWholeLocal(left: Node, declaration: VariableDeclaration): boolean {\n if (isIdentifier(left)) {\n return this.rustIdentifierRefersToDeclaration(left, declaration);\n }\n if (isParenthesizedExpression(left)) {\n return this.rustAssignmentWritesWholeLocal(left.expression, declaration);\n }\n if (isArrayLiteralExpression(left)) {\n return left.elements.some((element) => this.rustAssignmentWritesWholeLocal(element, declaration));\n }\n if (isObjectLiteralExpression(left)) {\n return left.properties.some((property) => {\n if (!isShorthandPropertyAssignment(property)) return false;\n return this.rustAssignmentWritesWholeLocal(property.name, declaration);\n });\n }\n return false;\n }\n\n /** One use of a dict-proven local: an element-access chain (`x['k']`, also\n * the `x['k'] = v` write), a kind-preserving mutator (`x.push(v)`,\n * `delete x[k]`), or something that would need the local to still be a\n * `Value`. */\n private rustDictLocalClassifyUse(node: Node, uses: { elementAccess: number, mutHelper: number, other: number }): void {\n const isAccessOf = (p: any, c: Node) => p !== undefined &&\n (isElementAccessExpression(p) || isPropertyAccessExpression(p)) && p.expression === c;\n let current: any = node;\n const parent: any = current.parent;\n if (isAccessOf(parent, current)) {\n while (isAccessOf(current.parent, current)) current = current.parent;\n if (isElementAccessExpression(current)) uses.elementAccess++;\n else uses.other++; // `x.field` on a dict value\n } else if (parent !== undefined && (isDeleteExpression(parent) || (isCallExpression(parent) &&\n isPropertyAccessExpression(parent.expression) && parent.expression.expression === current &&\n parent.expression.name.text === 'push'))) {\n uses.mutHelper++;\n } else {\n uses.other++;\n }\n }\n\n\n printPropertyDeclaration(node, identation) {\n const name = this.printNode(node.name, 0);\n if (node.initializer) {\n const init = this.printNode(node.initializer, 0);\n return `${this.getIden(identation)}${name}: Value, // default: ${init}`;\n }\n return `${this.getIden(identation)}${name}: Value,`;\n }\n\n // Collect property declarations with their initializers for use in new()\n getStructFields(node): Array<{ name: string, init: string }> {\n return node.members.filter(m => m.kind === SyntaxKind.PropertyDeclaration).map(p => ({\n name: this.printNode(p.name, 0),\n init: p.initializer ? this.printNode(p.initializer, 0) : 'Value::Null',\n }));\n }\n\n printStruct(node, identation) {\n const fieldLines = this.getStructFields(node).map(f => `${this.getIden(identation + 1)}pub ${f.name}: Value,`).join('\\n');\n return `#[derive(Debug, Clone)]\\npub struct ${this.className} {\\n${fieldLines}\\n}`;\n }\n\n printNewMethod(node, identation) {\n const fieldInits = this.getStructFields(node).map(f => `${this.getIden(identation + 2)}${f.name}: ${f.init},`).join('\\n');\n return `\\nimpl ${this.className} {\\n${this.getIden(identation + 1)}pub fn new() -> Self {\\n${this.getIden(identation + 2)}${this.className} {\\n${fieldInits}\\n${this.getIden(identation + 2)}}\\n${this.getIden(identation + 1)}}\\n}`;\n }\n\n printClass(node, identation) {\n this.rustPrefetchClassTypes(node);\n this.className = node.name.text;\n\n // First pass: collect method signatures for optional param handling\n const methods = node.members.filter(m => m.kind === SyntaxKind.MethodDeclaration);\n methods.forEach((method: any) => {\n const requiredCount = method.parameters.filter(p => !p.initializer && !p.questionToken).length;\n if (requiredCount < method.parameters.length) {\n this.methodSignatures[method.name.text] = { requiredCount };\n }\n });\n\n const struct = this.printStruct(node, identation);\n const newMethod = this.printNewMethod(node, identation);\n const classMethods = methods.map(m => this.printMethodDeclaration(m, identation)).join('\\n\\n');\n return struct + newMethod + `\\nimpl ${this.className} {\\n${classMethods}\\n}`;\n }\n\n printMethodDefinition(node, identation) {\n const name = (node.name as any).text;\n const params = node.parameters;\n const requiredParams = params.filter(p => !p.initializer && !p.questionToken);\n let parsedArgs = ['&self', ...requiredParams.map(p => `${this.printNode(p.name, 0)}: Value`)].join(', ');\n if (requiredParams.length < params.length) {\n parsedArgs += ', optional_args: &[Value]';\n }\n const returnType = this.printRustFunctionType(node);\n const retStr = returnType ? ` -> ${returnType}` : '';\n return `${this.getIden(identation + 1)}pub fn ${name}(${parsedArgs})${retStr}`;\n }\n\n printRustFunctionType(node): string {\n // An internal `: Str` method that proves the conversion prints the\n // native `Option` (its returns run the conversion; callers\n // box back where a `Value` is still needed).\n if (this.rustNativeStrReturnKind(node) === 'str') {\n return 'Option';\n }\n try {\n const checker = this.getChecker();\n if (checker.getReturnTypeOfSignature(checker.getSignatureFromDeclaration(node)).flags === TypeFlags.Void) return '';\n } catch (e) {\n // ignore\n }\n return 'Value';\n }\n\n printMethodDeclaration(node, identation) {\n const methodDef = this.printMethodDefinition(node, identation);\n const params = node.parameters;\n const optionalParams = params.filter(p => p.initializer !== undefined || p.questionToken !== undefined);\n\n // Build optional param initializations\n const optionalInits = optionalParams.map((p, idx) => {\n const defaultVal = p.initializer ? this.printNode(p.initializer, 0) : 'Value::Null';\n return `${this.getIden(identation + 2)}let ${this.printNode(p.name, 0)} = get_arg(optional_args, ${idx}, ${defaultVal});\\n`;\n }).join('');\n\n const blockOpen = this.getBlockOpen(identation);\n const blockClose = this.getBlockClose(identation);\n const shadows = this.rustParamShadowLines(node, identation + 2);\n // D-27: a `handle*` method's `message: Dict` param gets a borrowed\n // `&IndexMap` shadow so its `safe_*` reads print natively.\n const shadowPlan = this.rustProHandlerShadowPlan(node, identation);\n const savedShadowParam = this.rustProHandlerShadowParam;\n if (shadowPlan !== undefined) this.rustProHandlerShadowParam = shadowPlan.param;\n const statements = node.body.statements.map(s => this.printNode(s, identation + 2)).join('\\n');\n this.rustProHandlerShadowParam = savedShadowParam;\n const body = blockOpen + optionalInits + shadows + (shadowPlan?.lines ?? '') + statements + blockClose;\n\n return this.printNodeCommentsIfAny(node, identation, methodDef + body);\n }\n\n printFunctionDefinition(node, identation) {\n const name = node.name?.text ?? '';\n const params = node.parameters;\n const parsedArgs = params.map(p => `${this.printNode(p.name, 0)}: Value`).join(', ');\n const returnType = this.printRustFunctionType(node);\n const retStr = returnType ? ` -> ${returnType}` : '';\n return `${this.getIden(identation)}fn ${name}(${parsedArgs})${retStr}`;\n }\n\n printFunctionDeclaration(node, identation) {\n if (isArrowFunction(node)) {\n const parameters = node.parameters.map(p => `${this.printNode(p.name, 0)}: Value`).join(', ');\n const body = this.printNode(node.body);\n return `|${parameters}| ${body}`;\n }\n const funcDef = this.printFunctionDefinition(node, identation);\n const funcBody = super.printFunctionBody(node, identation);\n return this.printNodeCommentsIfAny(node, identation, funcDef + funcBody);\n }\n\n printOutOfOrderCallExpressionIfAny(node, identation) {\n if (node.expression.kind !== SyntaxKind.PropertyAccessExpression) {\n return undefined;\n }\n\n const expr = node.expression;\n const args = node.arguments;\n\n // Handle this.method(...) calls with optional params\n if (expr.expression.kind === SyntaxKind.ThisKeyword) {\n const methodName = expr.name.text;\n const sig = this.methodSignatures[methodName];\n if (sig) {\n const printArgs = (list) => list.map(a => this.printNode(a, 0)).join(', ');\n const requiredArgs = printArgs(args.slice(0, sig.requiredCount));\n const reqPart = requiredArgs ? `${requiredArgs}, ` : '';\n return `self.${methodName}(${reqPart}&[${printArgs(args.slice(sig.requiredCount))}])`;\n }\n }\n\n return undefined;\n }\n\n printCallExpression(node, identation) {\n const expression = node.expression;\n\n // `this.safeString(, 'k')` — the read inlined against\n // the parameter shadow (D-25). Ahead of the optional-arg dispatch below,\n // which prints the call for any callee with optional parameters\n const shadowSafeRead = this.printShadowSafeReadCall(node);\n if (shadowSafeRead !== undefined) return shadowSafeRead;\n\n // D-27: `this.safe_*(message, \"k\")` on a shadowed WS-handler param —\n // the native `.get(\"k\")` match replaces the `safe_*_k` helper call.\n // Checked first: the out-of-order path would print the boxed call for\n const shadowRead = this.printProHandlerShadowRead(node);\n if (shadowRead !== undefined) return shadowRead;\n\n // Handle console.log specially\n if (expression.kind === SyntaxKind.PropertyAccessExpression) {\n const exprText = expression.getText().trim();\n if (exprText === 'console.log') {\n const args = node.arguments;\n if (args.length === 1) {\n const argText = this.printNode(args[0], 0).trim();\n return `println_val(${argText.startsWith('&') ? argText : `&${argText}`})`;\n }\n // Multiple args: print each\n const argParts = Array.from(args).map(a => {\n const t = this.printNode(a, 0).trim();\n return t.startsWith('Value::') || !t.startsWith('&') ? `&${t}` : t;\n }).join(', ');\n return `println_val(${argParts})`;\n }\n }\n\n const outOfOrder = this.printOutOfOrderCallExpressionIfAny(node, identation);\n if (outOfOrder) {\n return this.rustBoxNativeStrCallIfNeeded(node, outOfOrder);\n }\n\n // `parseInt`/`parseFloat` on a checker-proven string: native `str::parse`\n // instead of the runtime helper the ccxt post-pass would emit.\n const nativeParse = this.printNativeParseCall(node);\n if (nativeParse !== undefined) return nativeParse;\n\n // `this.json(v)`: `Exchange::json` is exactly the free `json_stringify`, which takes the value\n // by reference, so the call sites' `.clone()` is dropped. `self.` args keep the method:\n // the post-pass hoisting `self.(…)` out of `&mut self` args ignores a `&self.`.\n if (expression.kind === SyntaxKind.PropertyAccessExpression &&\n expression.expression.kind === SyntaxKind.ThisKeyword &&\n expression.name.text === 'json' && node.arguments.length === 1) {\n const argText = this.printNode(node.arguments[0], 0).trim();\n if (!argText.includes('self.')) {\n const withoutClone = argText.replace(/\\.clone\\(\\)$/, '');\n return `json_stringify(${this.ensureRef(withoutClone)})`;\n }\n }\n\n return this.rustBoxNativeStrCallIfNeeded(node, super.printCallExpression(node, identation));\n }\n\n printThisKeyword(node, identation) {\n return 'self';\n }\n\n // Native string args to the runtime error constructors, audited against\n // rust/ccxt-base/src/exchange_errors.rs: `msg` is `impl ToErrorMessage` (`&str`/`String`/`Value`\n // yield the same string) and `create_error`'s class name is `&str` (bare literal only).\n private static readonly RUST_ERROR_CONSTRUCTOR_ARGS: Record = {\n ...Object.fromEntries((\n 'exchange_error authentication_error permission_denied account_not_enabled account_suspended ' +\n 'arguments_required bad_request bad_symbol operation_rejected no_change margin_mode_already_set ' +\n 'market_closed manual_interaction_needed restricted_location insufficient_funds invalid_address ' +\n 'address_pending invalid_order order_not_found order_not_cached order_immediately_fillable ' +\n 'order_not_fillable duplicate_order_id contract_unavailable not_supported invalid_proxy_settings ' +\n 'exchange_closed_by_user operation_failed network_error d_do_s_protection rate_limit_exceeded ' +\n 'exchange_not_available on_maintenance invalid_nonce checksum_error request_timeout bad_response ' +\n 'null_response cancel_pending unsubscribe_error '\n ).trim().split(' ').map((n) => [n, ['msg']])),\n create_error: ['str', 'msg'],\n };\n\n // A string literal prints as the bare `\"lit\"` (`&str` — no String\n // allocation); a checker-proven string drops the redundant `Value::Str` box.\n printErrorConstructorArg(name: string, index: number, node, identation: number): string {\n const kind = (RustTranspiler as any).RUST_ERROR_CONSTRUCTOR_ARGS[name]?.[index];\n if (kind === undefined) {\n return this.printNode(node, identation);\n }\n if (isStringLiteral(node) && !(node.text in this.StringLiteralReplacements)) {\n return this.quotedStringLiteral(node.text);\n }\n const printed = this.printNode(node, identation).trim();\n if (kind !== 'msg' || !this.rustTypeIsString(node)) {\n return printed;\n }\n const payload = this.peelValueStrBox(printed)\n ?? this.peelValueStrBox(this.stripOuterParens(printed))\n ?? printed;\n // The `Value::Str(..)` box carries the `Cow` conversion; the error\n // ctors take an `impl ToErrorMessage` (String / &str / Value).\n return payload.replace(/\\.into\\(\\)$/, '');\n }\n\n // `BadRequest` → `bad_request`: the class-to-runtime-fn name the ccxt\n // post-pass applies to `X::new(..)` calls.\n rustErrorConstructorName(className: string): string {\n return this.toSnakeCaseName(className);\n }\n\n printNewExpression(node, identation) {\n let expression = node.expression?.text;\n expression = expression ? expression : this.printNode(node.expression);\n // Plain `new Error(msg)` becomes just the message Value so it can be\n // formatted by `panic!(\"{:?}\", ...)` in printThrowStatement.\n if (expression === 'Error') {\n const args = node.arguments.map(a => this.printNode(a, identation)).join(', ');\n return args || 'Value::Null';\n }\n // CCXT exception classes end in \"Error\", \"Required\", \"Found\", etc. and\n // are constructed via `new XError(msg)`. Route them through the runtime\n // error constructors (snake_case fn calls).\n const errorClassPattern = /^(?:[A-Z][a-zA-Z]*(?:Error|Required|Found|Failed|Rejected|Available|Exceeded|Limit|Pending|Funds|Address|Order|Cached|Fillable|Closed|Maintenance|Nonce|Timeout|Response|Settings|User|Supported|Implemented|Denied|Enabled|Suspended|Symbol|Change|Unavailable|Proxy|Set|Needed))$/;\n if (typeof expression === 'string' && errorClassPattern.test(expression)) {\n const snake = this.rustErrorConstructorName(expression);\n const args = node.arguments.map((a, index) => this.printErrorConstructorArg(snake, index, a, identation)).join(', ');\n return `crate::exchange_errors::${snake}(${args})`;\n }\n // Classes the ccxt post-pass routes to the same constructors — their\n // message argument is audited too; every other `X::new(..)` prints as\n // before.\n const args = typeof expression === 'string'\n ? node.arguments.map((a, index) => this.printErrorConstructorArg(this.rustErrorConstructorName(expression), index, a, identation)).join(', ')\n : node.arguments.map(a => this.printNode(a, identation)).join(', ');\n return `${expression}::new(${args})`;\n }\n\n printPropertyAccessExpression(node, identation) {\n const transformedProperty = this.transformPropertyAcessExpressionIfNeeded(node);\n if (transformedProperty) {\n return this.getIden(identation) + transformedProperty;\n }\n\n const rightSide = node.name.text;\n const rawExpression = node.getText().trim();\n\n if (this.FullPropertyAccessReplacements.hasOwnProperty(rawExpression)) { // eslint-disable-line\n return this.FullPropertyAccessReplacements[rawExpression]; // eslint-disable-line\n }\n\n const leftExpr = this.printNode(node.expression, 0);\n\n if (rightSide === 'length') {\n return this.printArrayLength(node, 0, leftExpr);\n }\n\n // Typed field on a checker-proven map local (`x.field`) reads natively;\n // the ccxt post-pass otherwise rewrites it to `get_value(&x, \"field\")`.\n if (isIdentifier(node.name) && this.isShallowValueReceiver(node.expression) &&\n this.isNativeAccessPositionSafe(node) && !this.isNativeWriteTargetBase(node)) {\n const native = this.printNativeMapAccess(leftExpr, node.expression, String(rightSide));\n if (native) return native;\n }\n\n return `${leftExpr}.${rightSide}`;\n }\n\n // ── native container access (`get_value(...)` -> `.get(...)`) ─────────────\n // When the TypeScript checker proves the receiver is a plain Map/List value\n // and the key is a literal, the runtime `get_value` key-marker / `__live_id`\n // paths cannot apply, so the access is emitted natively. Missing keys still\n // fall back to `Value::Null`.\n\n /** Methods whose Rust counterpart takes `&mut self`: a `self.` read in\n * their args must keep the `get_value(...)` shape the ccxt post-pass hoists. */\n static readonly MUT_SELF_METHODS = new Set([\n 'watch', 'watch_multiple', 'fetch_order_book_snapshot', 'un_watch',\n 'client', 'spawn', 'delay', 'fetch_tickers', 'extend', 'fetch',\n 'send_evm_transaction',\n ]);\n\n /** Global parse helpers that go native (`str::parse`) on a proven string arg,\n * keyed to the rust integer/float type their runtime helper parses into. */\n static readonly RUST_PARSE_HELPERS: Record = {\n parseInt: 'i64',\n parseFloat: 'f64',\n };\n\n toSnakeCaseName(name: string): string {\n return name.replace(/([A-Z]+)([A-Z][a-z])/g, '$1_$2').replace(/([a-z\\d])([A-Z])/g, '$1_$2').toLowerCase();\n }\n\n escapeRustStringLiteral(text: string): string {\n return String(text).replace(/\\\\/g, '\\\\\\\\').replace(/\"/g, '\\\\\"')\n .replace(/\\n/g, '\\\\n').replace(/\\r/g, '\\\\r').replace(/\\t/g, '\\\\t');\n }\n\n getCheckedTypeOf(node): Type | undefined {\n return this.checkerOrUndefined()?.getTypeAtLocation(node);\n }\n\n typeSymbolOf(type: Type): TsSymbol | undefined {\n if (type === undefined || type === null) return undefined;\n return type?.getSymbol() ?? type?.getAliasSymbol();\n }\n\n /** Types declared outside ts/src (Date, Response, Array, Promise, …) are never\n * backed by a plain `Value` map in the rust port. */\n isLibDeclaredType(type: Type): boolean {\n const declarations: any[] = symbolDeclarations(this.typeSymbolOf(type));\n return declarations.some(d => {\n const file = d?.getSourceFile?.()?.fileName ?? '';\n return /[\\\\/]lib\\.[^\\\\/]*\\.d\\.ts$/.test(file) || /[\\\\/]node_modules[\\\\/]typescript[\\\\/]/.test(file);\n });\n }\n\n isClassInstanceType(type: Type): boolean {\n if (type === undefined) return false;\n if (type.flags & (TypeFlags.Union | TypeFlags.Intersection)) {\n return (typeParts(type) ?? []).some((member) => this.isClassInstanceType(member));\n }\n const symbol: any = this.typeSymbolOf(type) ?? type.getAliasSymbol();\n if (symbol?.flags & SymbolFlags.Class) return true;\n const declarations: any[] = symbolDeclarations(symbol);\n return declarations.some(d => isClassDeclaration(d) || isClassExpression(d));\n }\n\n hasCallableShape(type: Type): boolean {\n const checker = this.getChecker();\n return checker.getSignaturesOfType(type, SignatureKind.Call).length > 0 ||\n checker.getSignaturesOfType(type, SignatureKind.Construct).length > 0;\n }\n\n isProvenListType(type: Type): boolean {\n if (!(type.flags & TypeFlags.Object)) return false;\n // Tuple references carry the Tuple flag on their target.\n const objectFlags = ((type as any).objectFlags ?? 0) | ((typeTarget(type)?.objectFlags) ?? 0);\n if (objectFlags & ObjectFlags.Tuple) return true;\n const name = (this.typeSymbolOf(type) as any)?.name;\n if (name === 'Array' || name === 'ReadonlyArray') return true;\n const targetName = (this.typeSymbolOf(typeTarget(type)) as any)?.name;\n return targetName === 'Array' || targetName === 'ReadonlyArray';\n }\n\n /** True only for object types the rust port represents as `Value::Dict`\n * (plain interfaces / index-signature / literal types — never classes). */\n isProvenMapType(type: Type): boolean {\n if (type === undefined) return false;\n if (type.flags & TypeFlags.Union) {\n // `Market` / `Currency` / `Order | undefined` style aliases: the runtime value is the dict (or\n // Null), so a map receiver is proven once every value-carrying member is a proven map. An\n // all-dict union without a nullish member stays on the strict path (a class may hide behind it).\n const parts: Type[] = typeParts(type) ?? [];\n const nullish = parts.filter((p) => this.rustTypeIsNullish(p));\n const valueParts = parts.filter((p) => !this.rustTypeIsNullish(p));\n return nullish.length > 0 && valueParts.length > 0 && valueParts.every((p) => this.isProvenMapType(p));\n }\n if (!(type.flags & TypeFlags.Object)) return false;\n if (this.isProvenListType(type)) return false;\n if (this.hasCallableShape(type)) return false;\n if (this.isClassInstanceType(type)) return false;\n if (this.isLibDeclaredType(type)) return false;\n // A named type or a string index signature; a bare `object` proves nothing.\n const hasStringIndex = this.getChecker().getIndexTypeOfType(type, IndexKind.String) !== undefined;\n return hasStringIndex || this.typeSymbolOf(type) !== undefined;\n }\n\n /** `undefined` / `null` / `void` / `never` — a union member that carries no\n * runtime value; `Value::Null` is the only box these ever get. */\n rustTypeIsNullish(type: Type): boolean {\n return type !== undefined && (type.flags & (TypeFlags.Undefined | TypeFlags.Null | TypeFlags.Void | TypeFlags.Never)) !== 0;\n }\n\n isProvenMapExpression(node: Node): boolean {\n return this.isProvenMapType(this.getCheckedTypeOf(node));\n }\n\n isProvenListExpression(node: Node): boolean {\n if (this.rustIsOrderBookSide(node)) return false;\n const type = this.getCheckedTypeOf(node);\n return type !== undefined && this.isProvenListType(type);\n }\n\n /** RHS of a generator destructure that provably holds a `Value::Arr`: the\n * checker-proven list, or a call whose callee returns an array literal on\n * every path. */\n rustNativeListSource(node: Node): boolean {\n return this.isProvenListExpression(node) || this.rustCallReturnsProvenList(node);\n }\n\n /** `x.split(sep)` → the runtime `split`, which yields an array on every\n * path (a non-string receiver gives the empty array, never a dict). */\n rustCallPrintsRuntimeSplit(node: Node): boolean {\n if (!isCallExpression(node) || node.arguments.length === 0) return false;\n const expression: any = node.expression;\n return isPropertyAccessExpression(expression) && expression.expression.kind !== SyntaxKind.ThisKeyword &&\n String(expression.name.text) === 'split';\n }\n\n /** True when the call's value is always a runtime array: the `handle*AndParams`\n * family and its exchange overrides declare `any`, so the checker cannot\n * prove the `[T, Dict]` tuple the body always builds — walk the resolved\n * callee instead. */\n rustCallReturnsProvenList(node: Node): boolean {\n if (!isCallExpression(node)) return false;\n return this.rustProvenListCall(node, new Set());\n }\n\n private rustProvenListCall(node: Node, stack: Set): boolean {\n if (this.rustCallPrintsRuntimeSplit(node)) return true;\n const declaration = this.rustCalleeDeclaration(node);\n return declaration !== undefined && this.rustFunctionReturnsArrayLiteral(declaration, stack);\n }\n\n /** Implementation of a `x.y(..)` call, when the checker resolves one. */\n private rustCalleeDeclaration(node: Node): Node | undefined {\n if (!isCallExpression(node)) return undefined;\n if (!isPropertyAccessExpression((node as any).expression)) return undefined;\n try {\n return signatureDeclaration((this.getChecker() as any).getResolvedSignature(node));\n } catch (e) {\n return undefined;\n }\n }\n\n /** Every `return` in the function's own body builds an array literal, or\n * delegates to a call that does. `throw` and fall-through (the printer's\n * `Value::Null`) read the same through both forms. */\n private rustFunctionReturnsArrayLiteral(declaration: Node, stack: Set): boolean {\n if (stack.has(declaration)) return false;\n const body: any = (declaration as any).body;\n if (body === undefined || !isBlock(body)) return false;\n stack.add(declaration);\n try {\n let returns = 0;\n let all = true;\n const visit = (node: Node) => {\n if (!all) return;\n if (node !== body && isFunctionLike(node)) return; // nested closure\n if (isReturnStatement(node)) {\n returns++;\n const expression: any = node.expression;\n all = expression !== undefined && (isArrayLiteralExpression(expression) ||\n (isCallExpression(expression) && this.rustProvenListCall(expression, stack)) ||\n (isParenthesizedExpression(expression) && isArrayLiteralExpression(expression.expression)));\n return;\n }\n node.forEachChild(visit);\n };\n body.forEachChild(visit);\n return all && returns > 0;\n } finally {\n stack.delete(declaration);\n }\n }\n\n /** Native list-index read of a generator temp (`__destr_tmp.as_array()…`). */\n printNativeListIndex(receiverText: string, index: number): string {\n return `${receiverText}.as_array().and_then(|__arr| __arr.get(${index})).cloned().unwrap_or(Value::Null)`;\n }\n\n /** Native read for one chain level, or undefined to keep `get_value`. */\n printNativeContainerAccess(receiverText: string, receiverNode: Node, keyNode: Node): string | undefined {\n // A shadowed parameter reads through the borrowed container.\n const shadow = this.rustParamShadowOf(receiverNode);\n if (shadow !== undefined) {\n const native = this.printShadowContainerRead(shadow, keyNode);\n if (native !== undefined) return native;\n }\n if (isStringLiteralLikeNode(keyNode)) {\n return this.printNativeMapAccess(receiverText, receiverNode, keyNode.text);\n }\n if (isNumericLiteral(keyNode)) {\n const index = Number(keyNode.text);\n if (!Number.isInteger(index) || index < 0) return undefined;\n if (!this.isProvenListExpression(receiverNode)) return undefined;\n return this.printNativeListIndex(receiverText, index);\n }\n const dictRead = this.printNativeDynamicMapAccess(receiverText, receiverNode, keyNode);\n if (dictRead !== undefined) return dictRead;\n // A non-literal index (the `for (let i = 0; …)` counter) into a\n // checker-proven list reads natively too.\n return this.printNativeDynamicListIndex(receiverText, receiverNode, keyNode);\n }\n\n /** `get_value(&X, &i)` for a checker-proven list `X` and a dynamic integer\n * index local `i`: the runtime's own array branch, spelled natively.\n * `get_value` reaches its array arm for an `Arr` receiver and its default\n * (`Value::Null`) otherwise, so the emitted match reproduces both — an\n * `Int` index by value (a negative or out-of-range index misses), a\n * numeric string by parse, anything else a miss. */\n printNativeDynamicListIndex(receiverText: string, receiverNode: Node, keyNode: Node): string | undefined {\n if (!this.isProvenListExpression(receiverNode)) return undefined;\n if (!this.isRustValueIndexKey(keyNode)) return undefined;\n // The ccxt `writeBackIndexedMutations` pass matches the `let x = get_value(&C, &K)` text to\n // write a mutated `x` back into `C[K]`; native text is invisible to it, so a bind the next\n // statement mutates keeps the helper.\n if (this.isWriteBackBindRead(keyNode.parent)) return undefined;\n const keyText = this.printNode(keyNode, 0).trim();\n // A text that already carries the post-pass `&` is not a place.\n if (!keyText || keyText.startsWith('&')) return undefined;\n return `${receiverText}.as_array().and_then(|__arr| match &${keyText} { Value::Int(__n) => __arr.get(*__n as usize), Value::Str(__s) => __s.parse::().ok().and_then(|__n| __arr.get(__n)), _ => None }).cloned().unwrap_or(Value::Null)`;\n }\n\n /** True when this read initialises a local that the very next statement in\n * the same block mutates (`x['k'] = v` -> `add_element_to_object(&mut x…)`,\n * `x.push(v)` -> `append_to_array(&mut x…)`). */\n isWriteBackBindRead(read: Node): boolean {\n const declaration: any = read === undefined ? undefined : read.parent;\n if (declaration === undefined || !isVariableDeclaration(declaration) || declaration.initializer !== read) return false;\n if (!isIdentifier(declaration.name)) return false;\n const name = String(declaration.name.text);\n let statement: any = declaration;\n while (statement !== undefined && !isStatement(statement)) statement = statement.parent;\n const siblings: any[] = statement?.parent?.statements ?? [];\n const at = siblings.indexOf(statement);\n if (at < 0 || at + 1 >= siblings.length) return false;\n return this.rustStatementMutatesLocal(siblings[at + 1], name);\n }\n\n /** A statement containing a write into a local (`x['k'] = v`, `x.k = v`,\n * `x.push(v)`). */\n rustStatementMutatesLocal(node: Node, name: string): boolean {\n let mutated = false;\n const visit = (n: Node) => {\n if (mutated) return;\n if ((isBinaryExpression(n) && rustIsAssignmentOperator(n.operatorToken.kind) && this.rootPlaceText(n.left) === name) ||\n (isCallExpression(n) && isPropertyAccessExpression(n.expression) &&\n n.expression.name.text === 'push' && this.rootPlaceText(n.expression.expression) === name)) {\n mutated = true;\n return;\n }\n n.forEachChild(visit);\n };\n node.forEachChild(visit);\n return mutated;\n }\n\n /** A dynamic index the printer emits as a `Value` number: a `let x = ` declaration of the same function (the C-style loop counter).\n * Any other shape keeps the helper — the printed local could be a native\n * `i64`/`f64`, which the `Value` match would not compile against. */\n isRustValueIndexKey(node: Node): boolean {\n const current: any = this.rustSkipWrappers(node);\n if (!isIdentifier(current)) return false;\n const type = this.getCheckedTypeOf(current);\n if (type === undefined || !(type.flags & (TypeFlags.Number | TypeFlags.NumberLiteral))) return false;\n const declaration: any = this.rustDeclarationOfIdentifier(current);\n if (declaration === undefined || !isVariableDeclaration(declaration) || declaration.initializer === undefined) return false;\n return isNumericLiteral(this.rustSkipWrappers(declaration.initializer));\n }\n\n /** Strips `( )`, `as T` and `!` wrappers. */\n rustSkipWrappers(node: any): any {\n while (node !== undefined && (isParenthesizedExpression(node) || isAsExpression(node) || isNonNullExpression(node))) node = node.expression;\n return node;\n }\n\n // Typed-parameter dict reads: a checker-proven plain dict param (`Dict`, `Dictionary`,\n // `Market`-style alias) holds the dict or `Value::Null`, so `get_value`'s marker routes cannot\n // fire and the read is `m.get(k)`. The key must be a proven `Str` box so `.as_str()` reproduces it.\n\n /** The parameter declaration behind a receiver when its *annotation* proves\n * a plain dict; undefined otherwise (no proof → keep the helper). */\n rustProvenDictParameter(node: Node): ParameterDeclaration | undefined {\n const declaration: any = this.rustDeclarationOfIdentifier(node);\n if (declaration === undefined || !isParameterDeclaration(declaration)) return undefined;\n if (declaration.type === undefined) return undefined;\n const type = this.getCheckedTypeOf(declaration.type);\n if (type === undefined || !this.isProvenMapType(type)) return undefined;\n // D2: a later write can change the kind.\n return this.rustLocalIsReassigned(declaration, String((declaration.name as any).text)) ? undefined : declaration;\n }\n\n /** `Str` (`string | undefined`) — the key box is `Value::Str` or Null. */\n rustKeyIsProvenString(node: Node): boolean {\n const type = this.getCheckedTypeOf(node);\n if (type === undefined) return false;\n const parts: Type[] = (type.flags & TypeFlags.Union) ? (typeParts(type) ?? []) : [type];\n let strings = 0;\n for (const part of parts) {\n if (part.flags & (TypeFlags.String | TypeFlags.StringLiteral)) {\n strings++;\n continue;\n }\n if (this.rustTypeIsNullish(part)) continue;\n return false;\n }\n return strings > 0;\n }\n\n /** The local/parameter proof of a dynamic-key map read: a parameter whose\n * annotation proves a plain dict (B-25), or any local whose checker type\n * proves a plain map and which nothing in the enclosing function\n * re-assigns (D2). Returns the proven declaration. */\n rustProvenDynamicMapReceiver(node: Node): Declaration | undefined {\n const parameter = this.rustProvenDictParameter(node);\n if (parameter !== undefined) return parameter;\n if (!isIdentifier(node)) return undefined;\n const declaration: any = this.rustDeclarationOfIdentifier(node);\n if (declaration === undefined || !isVariableDeclaration(declaration)) return undefined;\n if (declaration.initializer === undefined) return undefined;\n if (!this.isProvenMapExpression(node)) return undefined;\n if (this.rustLocalIsReassigned(declaration, String(node.text))) return undefined;\n return declaration;\n }\n\n /** The element-access read a key node belongs to (`x[k]`, `x[(k)]`). */\n rustElementReadOfKey(keyNode: Node): Node | undefined {\n let current: any = keyNode;\n while (current !== undefined && (isParenthesizedExpression(current) || isAsExpression(current) || isNonNullExpression(current))) {\n current = current.parent;\n }\n const parent: any = current === undefined ? undefined : current.parent;\n if (parent === undefined || !isElementAccessExpression(parent) || parent.argumentExpression !== current) return undefined;\n return parent;\n }\n\n /** `x[k]` where `x` is a proven-dict parameter and `k` a proven string. */\n printNativeDynamicMapAccess(receiverText: string, receiverNode: Node, keyNode: Node): string | undefined {\n if (this.rustProvenDynamicMapReceiver(receiverNode) === undefined) return undefined;\n if (!this.rustKeyIsProvenString(keyNode)) return undefined;\n // The ccxt `writeBackIndexedMutations` pass matches the\n // `let x = get_value(&C, &K)` text to write a mutated `x` back into\n // `C[K]`; the native text is invisible to it, so a bind the next\n const read = this.rustElementReadOfKey(keyNode);\n if (read !== undefined && this.isWriteBackBindRead(read)) return undefined;\n const keyText = this.printNode(keyNode, 0).trim();\n // A plain place keeps the borrow local; a call/temporary text does not.\n if (!/^[A-Za-z_][A-Za-z0-9_]*$/.test(keyText)) return undefined;\n if (this.rustNodeIsKeyUnsafePlace(keyText)) return undefined;\n return `${receiverText}.as_map().and_then(|__m| ${keyText}.as_str().and_then(|__k| __m.get(__k))).cloned().unwrap_or(Value::Null)`;\n }\n\n /** Keys `get_value` serves from the book store / cache bucket / live\n * snapshot instead of the dict itself — a dynamic read cannot prove the\n * key away, so a place named after one stays boxed. */\n rustNodeIsKeyUnsafePlace(keyText: string): boolean {\n return RustTranspiler.RUST_DICT_LOCAL_UNSAFE_KEYS.has(keyText);\n }\n\n // ── parameter shadows (`let x = x.as_map().unwrap_or(&__x_empty)`) ─────────\n //\n // A `Dict`/`List` parameter holds the container or `Value::Null`, and\n\n private paramShadowCache: { src: SourceFile, tables: Map> } | undefined;\n\n /** Functions whose shadow lines were actually emitted — a read converts\n * only inside one of those (an arrow body prints inline and gets none). */\n private paramShadowEmitted: { src: SourceFile, fns: Set } | undefined;\n\n private rustParamShadowEmittedSet(): Set {\n const src = this.getSrc();\n if (this.paramShadowEmitted === undefined || this.paramShadowEmitted.src !== src) {\n this.paramShadowEmitted = { src, fns: new Set() };\n }\n return this.paramShadowEmitted.fns;\n }\n\n rustParamShadowTables(): Map> {\n const src = this.getSrc();\n if (this.paramShadowCache === undefined || this.paramShadowCache.src !== src) {\n this.paramShadowCache = { src, tables: new Map() };\n }\n return this.paramShadowCache.tables;\n }\n\n /** Emitted shadow lines for a function, or '' when no parameter qualifies.\n * The caller must use this before printing the body statements (it both\n * registers the function as shadowed and computes the lines). */\n rustParamShadowLines(fn: Node, identation: number): string {\n const table = this.rustParamShadowTable(fn);\n if (table.size === 0) return '';\n const idn = this.getIden(identation);\n const lines: string[] = [];\n for (const shadow of table.values()) {\n const empty = `__${shadow.name}_empty`;\n if (this.rustFunctionDeclaresName(fn, empty)) continue;\n const map = shadow.kind === RUST_PARAM_SHADOWS.MAP;\n const accessor = map ? 'as_map' : 'as_array';\n lines.push(`${idn}let ${empty} = ${map ? 'indexmap::IndexMap::new()' : 'Vec::new()'};`);\n lines.push(`${idn}let ${shadow.name} = ${shadow.name}.${accessor}().unwrap_or(&${empty});`);\n }\n if (lines.length === 0) return '';\n this.rustParamShadowEmittedSet().add(fn);\n return lines.join('\\n') + '\\n';\n }\n\n private rustParamShadowTable(fn: Node): Map {\n const tables = this.rustParamShadowTables();\n let table = tables.get(fn);\n if (table === undefined) {\n try {\n table = this.collectRustParamShadows(fn);\n } catch (e) {\n table = new Map(); // no proof -> every read keeps its helper\n }\n tables.set(fn, table);\n }\n return table;\n }\n\n /** The shadow a read receiver resolves to, or undefined (no proof → helper). */\n rustParamShadowOf(node: Node): RustParamShadow | undefined {\n const current: any = this.rustSkipWrappers(node);\n if (current === undefined || !isIdentifier(current)) return undefined;\n const name = String(current.text);\n const declaration = this.rustDeclarationOfIdentifier(current);\n if (declaration === undefined || !isParameterDeclaration(declaration)) return undefined;\n const emitted = this.rustParamShadowEmittedSet();\n let scope: any = current.parent;\n while (scope !== undefined) {\n if (isFunctionLike(scope)) {\n const entry = emitted.has(scope) ? this.rustParamShadowTable(scope).get(name) : undefined;\n if (entry !== undefined && entry.declaration === declaration) return entry;\n }\n scope = scope.parent;\n }\n return undefined;\n }\n\n /** True when the enclosing function already binds this name somewhere. */\n private rustFunctionDeclaresName(fn: Node, name: string): boolean {\n let found = false;\n this.rustWalkScope(fn, (node: Node) => {\n if (isFunctionLike(node)) return RUST_WALK_SKIP; // nested closure: own scope\n if ((isVariableDeclaration(node) || isParameterDeclaration(node)) && isIdentifier(node.name) && node.name.text === name) {\n found = true;\n return RUST_WALK_STOP;\n }\n });\n return found;\n }\n\n private collectRustParamShadows(fn: Node): Map {\n const table = new Map();\n const parameters: any[] = (fn as any).parameters ?? [];\n const body: any = (fn as any).body;\n if (body === undefined) return table;\n for (const param of parameters) {\n if (!isParameterDeclaration(param) || !isIdentifier(param.name)) continue;\n const name = String(param.name.text);\n if (name === 'optional_args') continue;\n if (param.type === undefined) continue;\n const type = this.getCheckedTypeOf(param.type);\n if (type === undefined) continue;\n const kind: RustParamShadowKind | undefined = this.isProvenMapType(type) ? RUST_PARAM_SHADOWS.MAP :\n this.isProvenShadowListType(type) ? RUST_PARAM_SHADOWS.LIST : undefined;\n if (kind === undefined) continue;\n if (this.rustParameterIsClientHandle(param)) continue;\n if (this.rustParamShadowUseCensus(fn, param, kind) === undefined) continue;\n table.set(name, { kind, name, declaration: param });\n }\n return table;\n }\n\n /** A checker-proven array parameter type (`Vec` on the rust side);\n * tuples are excluded (their printed shape is not a plain `Vec`). */\n isProvenShadowListType(type: Type): boolean {\n if (type === undefined) return false;\n if (!(type.flags & TypeFlags.Object)) return false;\n const objectFlags = ((type as any).objectFlags ?? 0) | ((typeTarget(type)?.objectFlags) ?? 0);\n if (objectFlags & ObjectFlags.Tuple) return false;\n if (this.hasCallableShape(type)) return false;\n if (this.isClassInstanceType(type)) return false;\n const name = (this.typeSymbolOf(type) as any)?.name;\n if (name === 'Array' || name === 'ReadonlyArray') return true;\n const targetName = (this.typeSymbolOf(typeTarget(type)) as any)?.name;\n return targetName === 'Array' || targetName === 'ReadonlyArray';\n }\n\n /** Every reference to the parameter must be a printable read, and at least\n * one must exist; anything else (a write, a `Value` pass-through, a Null\n * comparison, a marker key) answers undefined and the parameter keeps its\n * box. */\n private rustParamShadowUseCensus(fn: Node, param: ParameterDeclaration, kind: RustParamShadowKind): { reads: number } | undefined {\n const name = String((param.name as Identifier).text);\n const paramSymbol = this.rustSymbolOf(param.name as Identifier);\n if (paramSymbol === undefined) return undefined;\n let reads = 0;\n let ok = true;\n const visit = (node: Node) => {\n if (!ok) return;\n if (isIdentifier(node) && node.text === name && node !== param.name) {\n if (this.rustSymbolOf(node) !== paramSymbol || !this.rustParamUseIsRead(node, kind)) {\n ok = false;\n return;\n }\n reads++;\n }\n node.forEachChild(visit);\n };\n (fn as any).body.forEachChild(visit);\n return ok && reads > 0 ? { reads } : undefined;\n }\n\n /** One reference of a shadow candidate: true only for a read the shadow can\n * print exactly (same proofs the emitted forms re-check). */\n private rustParamUseIsRead(id: Identifier, kind: RustParamShadowKind): boolean {\n const parent: any = id.parent;\n if (parent === undefined) return false;\n // `x[k]` — element read. Writes (`x[k] = v`, `x[k].push(..)`) and the\n // post-pass write-back binds keep the box.\n if (isElementAccessExpression(parent) && parent.expression === id) {\n if (this.isNativeWriteTargetBase(id)) return false;\n if (!this.isNativeAccessPositionSafe(id)) return false;\n if (this.isWriteBackBindRead(parent)) return false;\n return this.rustShadowKeyIsReadable(parent.argumentExpression, kind);\n }\n // `x.length` — array length read.\n if (isPropertyAccessExpression(parent) && parent.expression === id) {\n return kind === RUST_PARAM_SHADOWS.LIST && String(parent.name.text) === 'length';\n }\n // `'k' in x` / `k in x`.\n if (isBinaryExpression(parent) && parent.operatorToken.kind === SyntaxKind.InKeyword && parent.right === id) {\n if (kind !== RUST_PARAM_SHADOWS.MAP) return false;\n return this.rustShadowKeyIsReadable(parent.left, RUST_PARAM_SHADOWS.MAP);\n }\n // `this.safe(x, 'k'[, default])` — the read families the shadow\n // inlines (literal keys only). Any other call keeps the box.\n if (isCallExpression(parent) && kind === RUST_PARAM_SHADOWS.MAP) {\n if (this.rustShadowSafeCallee(parent) === undefined) return false;\n const args: NodeArray = parent.arguments;\n if (args[0] !== id || args.length < 2 || args.length > 3) return false;\n return this.rustShadowKeyIsLiteral(args[1]);\n }\n return false;\n }\n\n /** A key a shadow read can print: dicts take a bare string literal or a\n * proven-string place, lists a literal non-negative index; the `safe_*`\n * inline takes the literal key form only. Marker-route key names and keys\n * whose text needs escaping are excluded. */\n private rustShadowKeyIsReadable(key: any, kind: RustParamShadowKind): boolean {\n if (key === undefined) return false;\n if (kind === RUST_PARAM_SHADOWS.MAP) {\n if (isStringLiteralLikeNode(key)) return this.rustShadowKeyIsLiteral(key);\n if (isIdentifier(key)) {\n return this.rustKeyIsProvenString(key) && !this.rustNodeIsKeyUnsafePlace(String(key.text));\n }\n return false;\n }\n if (isNumericLiteral(key)) {\n const index = Number(key.text);\n return Number.isInteger(index) && index >= 0;\n }\n return false;\n }\n\n private rustShadowKeyIsLiteral(key: any): boolean {\n if (key === undefined || !isStringLiteralLikeNode(key)) return false;\n const text = String(key.text);\n return this.rustShadowKeyLiteral(text) && !this.rustNodeIsKeyUnsafePlace(text);\n }\n\n /** Keys whose text is safe to inline into a rust string literal. */\n private rustShadowKeyLiteral(text: string): boolean {\n return /^[A-Za-z0-9_./-]*$/.test(text) && text.length > 0;\n }\n\n /** `this.safeString`-style callee of a call, or undefined. */\n private rustShadowSafeCallee(node: CallExpression): string | undefined {\n const callee: any = (node as any).expression;\n if (callee === undefined || !isPropertyAccessExpression(callee)) return undefined;\n if (callee.expression.kind !== SyntaxKind.ThisKeyword) return undefined;\n const name = String(callee.name.text);\n return RUST_PARAM_SHADOWS.SAFE_READS.has(name) ? name : undefined;\n }\n\n /** `x['k']` / `x[i]` / `'k' in x` on a shadowed parameter: the native read,\n * or undefined to keep the helper (the census guarantees it never happens\n * for an emitted shadow). */\n printShadowContainerRead(shadow: RustParamShadow, keyNode: Node): string | undefined {\n const key: any = keyNode;\n if (shadow.kind === RUST_PARAM_SHADOWS.MAP) {\n const k = this.rustShadowMapKey(key);\n if (k === undefined) return undefined;\n return k.literal !== undefined ? `${shadow.name}.get(\"${k.literal}\").cloned().unwrap_or(Value::Null)`\n : `${k.place}.as_str().and_then(|__k| ${shadow.name}.get(__k)).cloned().unwrap_or(Value::Null)`;\n }\n if (isNumericLiteral(key)) {\n const index = Number(key.text);\n if (!Number.isInteger(index) || index < 0) return undefined;\n return `${shadow.name}.get(${index}).cloned().unwrap_or(Value::Null)`;\n }\n return undefined;\n }\n\n /** `'k' in x` on a shadowed dict parameter. */\n printShadowInOperator(shadow: RustParamShadow, keyNode: Node): string | undefined {\n if (shadow.kind !== RUST_PARAM_SHADOWS.MAP) return undefined;\n const k = this.rustShadowMapKey(keyNode);\n if (k === undefined) return undefined;\n return k.literal !== undefined ? `Value::Bool(${shadow.name}.contains_key(\"${k.literal}\"))`\n : `Value::Bool(${k.place}.as_str().map(|__k| ${shadow.name}.contains_key(__k)).unwrap_or(false))`;\n }\n\n /** A shadow dict key: an inlinable literal, or a proven-string plain place. */\n private rustShadowMapKey(key: any): { literal?: string, place?: string } | undefined {\n if (isStringLiteralLikeNode(key)) {\n const text = String(key.text);\n return this.rustShadowKeyLiteral(text) && !this.rustNodeIsKeyUnsafePlace(text) ? { literal: text } : undefined;\n }\n if (!isIdentifier(key) || !this.rustKeyIsProvenString(key) || this.rustNodeIsKeyUnsafePlace(String(key.text))) return undefined;\n const place = this.printNode(key, 0).trim();\n return /^[A-Za-z_][A-Za-z0-9_]*$/.test(place) ? { place } : undefined;\n }\n\n /** `x.length` on a shadowed list parameter — `get_array_length` natively. */\n printShadowLength(shadow: RustParamShadow): string | undefined {\n if (shadow.kind !== RUST_PARAM_SHADOWS.LIST) return undefined;\n return `Value::Int(${shadow.name}.len() as i64)`;\n }\n\n /** `this.safe(x, 'k'[, default])` on a shadowed dict parameter: the\n * runtime helper's exact semantics over `.get(..)`. */\n printShadowSafeReadCall(node: CallExpression): string | undefined {\n const callee = this.rustShadowSafeCallee(node);\n if (callee === undefined) return undefined;\n const args: any[] = (node as any).arguments ?? [];\n if (args.length < 2 || args.length > 3) return undefined;\n const shadow = this.rustParamShadowOf(args[0]);\n if (shadow === undefined || shadow.kind !== RUST_PARAM_SHADOWS.MAP) return undefined;\n const key: any = args[1];\n if (!isStringLiteralLikeNode(key)) return undefined;\n const text = String(key.text);\n if (!this.rustShadowKeyLiteral(text) || this.rustNodeIsKeyUnsafePlace(text)) return undefined;\n const fallback = args.length === 3 ? this.printNode(args[2], 0).trim() : 'Value::Null';\n const get = `${shadow.name}.get(\"${text}\")`;\n // The ccxt post-pass strips the `;` of a statement ending in `};`\n // (`[/\\};(\\s*\\n)/g, '}$1']`), so the match — like the printer's other\n // block-valued expressions — is parenthesized.\n const wrap = (text: string) => `(${text})`;\n switch (callee) {\n case 'safeValue':\n return wrap(`match ${get} { Some(__v) if !matches!(__v, Value::Null) && !matches!(__v, Value::Str(__s) if __s.is_empty()) => __v.clone(), _ => ${fallback} }`);\n case 'safeString':\n return wrap(`match ${get} { Some(Value::Str(__s)) if !__s.is_empty() => Value::Str(__s.clone()), Some(Value::Int(__n)) => Value::Str(__n.to_string().into()), Some(Value::Float(__f)) => Value::Str(__f.to_string().into()), _ => ${fallback} }`);\n case 'safeInteger':\n return wrap(`match ${get} { Some(Value::Int(__n)) => Value::Int(*__n), Some(Value::Float(__f)) => Value::Int(*__f as i64), Some(Value::Str(__s)) => match __s.parse::() { Ok(__n) => Value::Int(__n), Err(_) => match __s.parse::() { Ok(__f) if __f.is_finite() => Value::Int(__f as i64), _ => ${fallback} } }, _ => ${fallback} }`);\n case 'safeNumber':\n return wrap(`match ${get} { Some(Value::Float(__f)) => Value::Float(*__f), Some(Value::Int(__n)) => Value::Float(*__n as f64), Some(Value::Str(__s)) => match __s.parse::() { Ok(__n) => Value::Float(__n), Err(_) => ${fallback} }, _ => ${fallback} }`);\n case 'safeBool':\n return wrap(`match ${get} { Some(Value::Bool(__b)) => Value::Bool(*__b), _ => ${fallback} }`);\n case 'safeDict':\n return wrap(`match ${get} { Some(__v) if matches!(__v, Value::Dict(_)) => __v.clone(), _ => ${fallback} }`);\n case 'safeList':\n return wrap(`match ${get} { Some(__v) if matches!(__v, Value::Arr(_)) => __v.clone(), _ => ${fallback} }`);\n }\n return undefined;\n }\n\n // ── pro-tier WS handler `message` shadow (D-27) ───────────────────────────\n // `handle_x (client: Client, message: Dict)` is dispatched by NAME with\n // `Value` args, so the printed signature keeps `Value`; the annotation still\n\n /** The borrowed view bound by the shadow. */\n private static readonly PRO_HANDLER_SHADOW_NAME = '__pro_message';\n\n /** TS helper name -> emitted match kind. */\n private static readonly PRO_HANDLER_SHADOW_SAFE_READS: Record = {\n 'safeValue': 'value',\n 'safeString': 'string',\n 'safeInteger': 'integer',\n 'safeNumber': 'float',\n 'safeFloat': 'float',\n 'safeDict': 'dict',\n 'safeList': 'list',\n 'safeBool': 'bool',\n };\n\n /** The `message: Dict` parameter of a WS handler method (2nd param of a\n * `handle*` method), undefined when unproven or written (D2). */\n rustProHandlerMessageParam(node: Node): ParameterDeclaration | undefined {\n if (node === undefined || !isMethodDeclaration(node) || node.body === undefined) return undefined;\n const params: any[] = (node.parameters ?? []) as any;\n if (params.length < 2) return undefined;\n const methodName: any = node.name;\n if (methodName === undefined || !/^handle[A-Z]/.test(String(methodName.text ?? ''))) return undefined;\n const param: any = params[1];\n if (param === undefined || !isIdentifier(param.name) || param.type === undefined) return undefined;\n // The ws-handler shape `handle_x (client: Client, message: Dict)`: the\n // message is a required parameter and the first one is the Client\n // class handle. (Base helpers like `handleMarginModeAndParams\n if (param.initializer !== undefined || param.questionToken !== undefined) return undefined;\n const clientParam: any = params[0];\n if (clientParam === undefined || clientParam.type === undefined) return undefined;\n const clientType = this.getCheckedTypeOf(clientParam.type);\n if (clientType === undefined || !this.isClassInstanceType(clientType)) return undefined;\n const type = this.getCheckedTypeOf(param.type);\n if (type === undefined || !this.isProvenMapType(type)) return undefined;\n const name = String(param.name.text);\n return this.rustProHandlerParamIsWritten(param, name) ? undefined : param;\n }\n\n /** D2: a write rooted at the parameter (reassignment, element/property\n * write, a merge/splice onto it) can reshape the dict after the shadow is\n * taken — the shadow is skipped and every read keeps the helper. */\n rustProHandlerParamIsWritten(param: ParameterDeclaration, name: string): boolean {\n if (this.rustLocalIsReassigned(param, name)) return true;\n const scope = this.rustEnclosingFunction(param);\n if (scope === undefined) return true;\n if (this.rustStatementMutatesLocal(scope, name)) return true;\n const merging = ['deepExtend', 'extend', 'addElementToObject', 'remove'];\n let written = false;\n this.rustWalkScope(scope, (n: Node) => {\n if (isCallExpression(n) && n.arguments.length > 0 && isIdentifier(n.arguments[0]) && (n.arguments[0] as any).text === name) {\n const callee: any = n.expression;\n written = merging.includes(isPropertyAccessExpression(callee) ? String(callee.name?.text ?? '') :\n isIdentifier(callee) ? String(callee.text ?? '') : '');\n if (written) return RUST_WALK_STOP;\n }\n });\n return written;\n }\n\n /** Shadow plan for a handler: the parameter plus the two binding lines,\n * present only when some body read actually turns native (no dead shed). */\n rustProHandlerShadowPlan(node: Node, identation: number): { param: ParameterDeclaration, lines: string } | undefined {\n const param = this.rustProHandlerMessageParam(node);\n if (param === undefined) return undefined;\n // a D-25 parameter shadow already rebinds the name to the borrowed map; its reads are native\n if (this.rustParamShadowTable(node).has(String((param.name as any).text))) return undefined;\n const saved = this.rustProHandlerShadowParam;\n this.rustProHandlerShadowParam = param;\n let hasRead = false;\n const scope = this.rustEnclosingFunction(param);\n this.rustWalkScope(scope, (n: Node) => {\n if (isCallExpression(n) && this.printProHandlerShadowRead(n, true) !== undefined) {\n hasRead = true;\n return RUST_WALK_STOP;\n }\n });\n this.rustProHandlerShadowParam = saved;\n if (!hasRead) return undefined;\n const name = String((param.name as any).text);\n const view = RustTranspiler.PRO_HANDLER_SHADOW_NAME;\n const arc = `${view}_arc`;\n const map = 'indexmap::IndexMap';\n const ind = this.getIden(identation + 2);\n const lines =\n `${ind}let ${arc}: std::sync::Arc<${map}> = (match &${name} { Value::Dict(__d) => __d.clone(), _ => std::sync::Arc::new(indexmap::IndexMap::new()) });\\n` +\n `${ind}let ${view}: &${map} = &${arc};\\n`;\n return { param, lines };\n }\n\n /** The `safe_*` call on the shadowed parameter prints as a native\n * `.get(\"k\")` match, or undefined when the call is not one. In `probe`\n * mode the shape is checked without printing (the pre-scan must not print\n * a node twice). */\n printProHandlerShadowRead(node: Node, probe = false): string | undefined {\n const param = this.rustProHandlerShadowParam;\n if (param === undefined || node === undefined || !isCallExpression(node)) return undefined;\n const callee: any = node.expression;\n if (callee === undefined || !isPropertyAccessExpression(callee)) return undefined;\n if (callee.expression.kind !== SyntaxKind.ThisKeyword) return undefined;\n const kind = RustTranspiler.PRO_HANDLER_SHADOW_SAFE_READS[String(callee.name?.text ?? '')];\n if (kind === undefined) return undefined;\n const args: any[] = (node.arguments ?? []) as any;\n if (args.length < 2 || args.length > 3) return undefined;\n const receiver: any = args[0];\n if (receiver === undefined || receiver.kind !== SyntaxKind.Identifier) return undefined;\n if (this.rustDeclarationOfIdentifier(receiver) !== param) return undefined;\n const key: any = args[1];\n if (key === undefined || !isStringLiteral(key)) return undefined;\n const keyText = key.text;\n if (keyText === '' || RustTranspiler.RUST_DICT_LOCAL_UNSAFE_KEYS.has(keyText)) return undefined;\n if (args.length === 3 && !this.rustProHandlerShadowDefaultShape(args[2])) return undefined;\n if (probe) return 'native';\n const dflt = args.length === 3 ? this.rustProHandlerShadowDefault(args[2]) : 'Value::Null';\n if (dflt === undefined) return undefined;\n return this.rustProHandlerShadowReadText(kind, this.escapeRustStringLiteral(keyText), dflt);\n }\n\n /** A miss-arm default the match can hold: absent (`Value::Null`) or a\n * literal; a computed default keeps the helper (its Value is not\n * re-printable inside an arm without re-evaluating it twice). */\n rustProHandlerShadowDefaultShape(node: Node): boolean {\n return node.kind === SyntaxKind.StringLiteral || node.kind === SyntaxKind.NumericLiteral ||\n node.kind === SyntaxKind.TrueKeyword || node.kind === SyntaxKind.FalseKeyword ||\n node.kind === SyntaxKind.NullKeyword || node.kind === SyntaxKind.ArrayLiteralExpression ||\n node.kind === SyntaxKind.ObjectLiteralExpression ||\n (isIdentifier(node) && (node as any).text === 'undefined');\n }\n\n rustProHandlerShadowDefault(node: Node): string | undefined {\n if (!this.rustProHandlerShadowDefaultShape(node)) return undefined;\n const text = this.printNode(node, 0).trim();\n return text === '' ? undefined : text;\n }\n\n /** Exact native form of the runtime `_k` helper: same value kinds, same\n * empty-string-is-missing rule, same default (verified against\n * `exchange_stubs.rs`). `.cloned()` keeps the emitted line clone-free for\n * the ccxt clone-pruning passes; the parenthesised `match` keeps the\n * driver's `};` trailing-block replacement off the statement's `;`. */\n rustProHandlerShadowReadText(kind: string, key: string, dflt: string): string {\n const m = RustTranspiler.PRO_HANDLER_SHADOW_NAME;\n const at = `${m}.get(\"${key}\").cloned()`;\n switch (kind) {\n case 'value':\n return `(match ${at} { Some(Value::Str(__s)) if __s.is_empty() => ${dflt}, Some(__v) => __v, None => ${dflt} })`;\n case 'string':\n return `(match ${at} { Some(Value::Str(__s)) if !__s.is_empty() => Value::Str(__s), Some(Value::Int(__n)) => Value::Str(__n.to_string().into()), Some(Value::Float(__f)) => Value::Str(__f.to_string().into()), _ => ${dflt} })`;\n case 'integer':\n return `(match ${at} { Some(Value::Int(__n)) => Value::Int(__n), Some(Value::Float(__f)) => Value::Int(__f as i64), Some(Value::Str(__s)) if !__s.is_empty() => match __s.parse::() { Ok(__n) => Value::Int(__n), Err(_) => match __s.parse::() { Ok(__f) if __f.is_finite() => Value::Int(__f as i64), _ => ${dflt} } }, _ => ${dflt} })`;\n case 'float':\n return `(match ${at} { Some(Value::Float(__f)) => Value::Float(__f), Some(Value::Int(__n)) => Value::Float(__n as f64), Some(Value::Str(__s)) if !__s.is_empty() => match __s.parse::() { Ok(__f) => Value::Float(__f), Err(_) => ${dflt} }, _ => ${dflt} })`;\n case 'dict':\n return `(match ${at} { Some(__v) if matches!(__v, Value::Dict(_)) => __v, _ => ${dflt} })`;\n case 'list':\n return `(match ${at} { Some(__v) if matches!(__v, Value::Arr(_)) => __v, _ => ${dflt} })`;\n case 'bool':\n return `(match ${at} { Some(__v) if matches!(__v, Value::Bool(_)) => __v, _ => ${dflt} })`;\n }\n return undefined;\n }\n\n printNativeMapAccess(receiverText: string, receiverNode: Node, keyText: string): string | undefined {\n if (!this.isProvenMapExpression(receiverNode)) {\n // Declared-Dict locals read natively too (see the classifier below).\n if (!this.rustIsDeclaredDictLocal(receiverNode)) return undefined;\n if (RustTranspiler.RUST_DICT_LOCAL_UNSAFE_KEYS.has(keyText)) return undefined;\n if (keyText === '' || /^\\d+$/.test(keyText)) return undefined;\n }\n const key = this.escapeRustStringLiteral(keyText);\n return `${receiverText}.as_map().and_then(|__m| __m.get(\"${key}\")).cloned().unwrap_or(Value::Null)`;\n }\n\n // Declared-Dict locals: the checker types many dict-holding locals `any`, losing the proof\n // above, but the declaration still proves a plain dict (object literal, `getArg(.., {})` bag,\n // `this.safeDict`, `extend` onto those, or an element of a map-typed container) at every read.\n\n /** Keys `get_value(_k)` serves from the book store, a cache bucket or a\n * live `__live_id` snapshot instead of from the dict itself: those routes\n * are invisible to a plain map read, so they keep the helper. */\n static readonly RUST_DICT_LOCAL_UNSAFE_KEYS = new Set([\n 'timestamp', 'datetime', 'nonce', 'symbol', 'checksum', 'cache',\n 'hashmap', 'subscriptions', 'futures',\n ]);\n\n rustDeclarationOfIdentifier(node: Node): Declaration | undefined {\n if (!isIdentifier(node)) return undefined;\n try {\n const symbol: any = this.getChecker().getSymbolAtLocation(node);\n return symbolValueDeclaration(symbol);\n } catch (e) {\n return undefined;\n }\n }\n\n /** Initializer shapes that construct or return a plain dict. */\n rustDictProducingInitializer(node: Node | undefined, seen: Set): boolean {\n if (node === undefined || node === null || seen.has(node)) return false;\n seen.add(node);\n if (isObjectLiteralExpression(node)) return true;\n if (isParenthesizedExpression(node) || isAsExpression(node) ||\n isNonNullExpression(node) || isTypeAssertion(node)) {\n return this.rustDictProducingInitializer((node as any).expression, seen);\n }\n if (isIdentifier(node)) {\n const declaration: any = this.rustDeclarationOfIdentifier(node);\n if (declaration === undefined || !isVariableDeclaration(declaration)) return false;\n return this.rustDictProducingInitializer(declaration.initializer, seen);\n }\n if (isElementAccessExpression(node)) {\n // `this.markets[symbol]`: the container's declared element type is\n // what the rust port stores there.\n const containerType = this.getCheckedTypeOf((node as any).expression);\n if (containerType === undefined) return false;\n const elementType = this.getChecker().getIndexTypeOfType(containerType, IndexKind.String);\n return elementType !== undefined && this.isProvenMapType(elementType);\n }\n if (!isCallExpression(node)) return false;\n const callee: any = (node as any).expression;\n if (!isPropertyAccessExpression(callee) || callee.expression.kind !== SyntaxKind.ThisKeyword) {\n return false;\n }\n const name = String(callee.name.text);\n // Readers whose rust counterpart returns the stored dict itself.\n // `this.client(url)` returns the WS client handle Dict the runtime keeps\n // (`Map{url, subscriptions, futures}`), never a class instance.\n if (['safeDict', 'safeMarketStructure', 'market', 'currency', 'safeMarket', 'safeCurrency', 'client'].includes(name)) return true;\n // `extend`/`deepExtend` merge onto their first argument.\n if (name === 'extend' || name === 'deepExtend') {\n return this.rustDictProducingInitializer((node as any).arguments[0], seen);\n }\n return false;\n }\n\n /** D2: the proof holds only while nothing re-assigns the local. */\n rustLocalIsReassigned(declaration: Declaration, name: string): boolean {\n let scope: Node | undefined = declaration;\n while (scope !== undefined && !isFunctionLike(scope) && !isSourceFile(scope)) scope = scope.parent;\n if (scope === undefined) return true;\n // only an identifier spelled `name` can be the assignment's left side\n return this.rustScopeNameNodes(scope, name).some((id: any) => {\n const node: any = id.parent;\n return id.kind === SyntaxKind.Identifier && node !== undefined && isBinaryExpression(node) && node.left === id\n && node.operatorToken.kind >= SyntaxKind.FirstAssignment && node.operatorToken.kind <= SyntaxKind.LastAssignment;\n });\n }\n\n /** True when the receiver is a local declared as (or provably holding) a\n * plain dict — `get_value(_k)` and this read agree on every key the\n * runtime does not route elsewhere. */\n rustIsDeclaredDictLocal(node: Node): boolean {\n const declaration: any = this.rustDeclarationOfIdentifier(node);\n if (declaration === undefined) return false;\n const name = declaration.name?.text;\n if (typeof name !== 'string') return false;\n if (isParameterDeclaration(declaration)) {\n // A `Client`-typed parameter is the WS handle passed to `handle_message`/`handle*`\n // (`ws_client::client_value`): a `Value::Dict{url, subscriptions, futures}` in the port, not\n // the TS class. Its fields are plain map reads.\n if (!this.rustParameterIsClientHandle(declaration) && !this.rustDictProducingInitializer(declaration.initializer, new Set())) return false;\n } else if (isVariableDeclaration(declaration)) {\n if (!this.rustDictProducingInitializer(declaration.initializer, new Set())) return false;\n } else {\n return false;\n }\n return !this.rustLocalIsReassigned(declaration, name);\n }\n\n /** A parameter declared as the ws `Client` class (or a union with it). The\n * class is the default export of `ts/src/base/ws/Client.ts`, so its type\n * symbol is named `default`; the declaration itself carries the name. */\n rustParameterIsClientHandle(declaration: ParameterDeclaration): boolean {\n const named = (type: Type | undefined): boolean => {\n if (type === undefined) return false;\n const symbol: any = this.typeSymbolOf(type);\n const declarations: any[] = symbolDeclarations(symbol);\n return declarations.some((d) => {\n if (!isClassDeclaration(d) || d.name === undefined || d.name.text !== 'Client') return false;\n const file = String(d.getSourceFile().fileName).replace(/\\\\/g, '/');\n return file.endsWith('/ws/Client.ts') || file.endsWith('/ws/Client.d.ts');\n });\n };\n const type = this.getCheckedTypeOf(declaration.name);\n if (named(type)) return true;\n return (typeParts(type) ?? []).some((member: Type) => named(member));\n }\n\n /** Constant string argument of `parseInt`/`parseFloat` folded the way rust's\n * `str::parse` would; undefined when the fold is not obviously exact. */\n foldParsedStringLiteral(name: string, text: string): string | undefined {\n const t = text.trim();\n if (name === 'parseInt') {\n if (!/^[+-]?[0-9]+$/.test(t)) return undefined;\n const value = BigInt(t.replace(/^\\+/, '') || '0');\n if (value < -9223372036854775808n || value > 9223372036854775807n) return undefined;\n return `Value::Int(${value.toString()})`;\n }\n if (!/^[+-]?[0-9]+(?:\\.[0-9]+)?$/.test(t)) return undefined;\n const value = Number(t);\n // `String(value)` must re-read as a rust float literal holding the same f64;\n // `-0` prints as `0`, which would drop the sign the runtime keeps.\n if (!Number.isFinite(value) || Object.is(value, -0)) return undefined;\n if (!/^-?[0-9]+(?:\\.[0-9]+)?$/.test(String(value))) return undefined;\n return `Value::Float(${String(value)})`;\n }\n\n /** `parseInt(x)` / `parseFloat(x)` with a single checker-proven string argument\n * become the runtime helper's own match with native `str::parse`; every other\n * argument shape keeps the helper call the ccxt post-pass rewrites. */\n printNativeParseCall(node: CallExpression): string | undefined {\n const callee = node.expression;\n if (!isIdentifier(callee)) return undefined;\n const name = String(callee.text);\n const helper = RustTranspiler.RUST_PARSE_HELPERS[name];\n if (helper === undefined) return undefined;\n if (node.arguments.length !== 1) return undefined; // radix / unknown arity\n const arg = node.arguments[0];\n const type = this.getCheckedTypeOf(arg);\n if (type === undefined || !this.isStringType(type.flags)) return undefined;\n if (isStringLiteralLikeNode(arg)) {\n const folded = this.foldParsedStringLiteral(name, arg.text);\n if (folded !== undefined) return folded;\n }\n const argText = this.printNode(arg, 0).trim();\n // The post-pass adds the `&`; a text that already carries one is not a place.\n if (!argText || argText.startsWith('&')) return undefined;\n if (helper === 'i64') {\n return `(match &${argText} { Value::Str(__parse_s) => __parse_s.trim().parse::().map(Value::Int).unwrap_or(Value::Null), Value::Int(__parse_n) => Value::Int(*__parse_n), Value::Float(__parse_f) => Value::Int(*__parse_f as i64), _ => Value::Null })`;\n }\n return `(match &${argText} { Value::Str(__parse_s) => __parse_s.trim().parse::().map(Value::Float).unwrap_or(Value::Null), Value::Float(__parse_f) => Value::Float(*__parse_f), Value::Int(__parse_n) => Value::Float(*__parse_n as f64), _ => Value::Null })`;\n }\n\n isNodeInsideNode(node: Node, container: Node): boolean {\n return node.pos >= container.pos && node.end <= container.end;\n }\n\n /** Root place of an access chain (`x` for `x['a']['b']`, `this.balance` for\n * `this.balance['usdt']`), or undefined for a temporary. */\n rootPlaceText(node: Node): string | undefined {\n let current: any = node;\n while (isPropertyAccessExpression(current) || isElementAccessExpression(current) || isParenthesizedExpression(current)) {\n if (!isParenthesizedExpression(current) && current.expression.kind === SyntaxKind.ThisKeyword) return current.getText().trim();\n current = current.expression;\n }\n return current && (isIdentifier(current) || current.kind === SyntaxKind.ThisKeyword) ? current.getText().trim() : undefined;\n }\n\n /** The ccxt post-passes hoist `get_value(...)` reads out of `&mut` calls by\n * matching their text; the native form is invisible to them, so it is only\n * emitted where no such hoist is needed. */\n isNativeAccessPositionSafe(node: Node): boolean {\n const parent = node.parent;\n // `x['k'].push(...)` / `x['k'](...)`: the post-pass rewrites the target.\n if (parent && (isPropertyAccessExpression(parent) || isCallExpression(parent)) && parent.expression === node) return false;\n const root = this.rootPlaceText(node);\n for (let current: any = node.parent; current; current = current.parent) {\n if (isStatement(current) || isSourceFile(current) || isFunctionLike(current)) break;\n if (isBinaryExpression(current) && this.isNodeInsideNode(node, current.right)) {\n const op = current.operatorToken.kind;\n const isAssign = op === SyntaxKind.EqualsToken || (op >= SyntaxKind.PlusEqualsToken && op <= SyntaxKind.CaretEqualsToken);\n if (isAssign && root !== undefined && this.rootPlaceText(current.left) === root) return false;\n }\n if (isCallExpression(current) && isPropertyAccessExpression(current.expression) &&\n this.isNodeInsideNode(node, current) && current.arguments.some(a => this.isNodeInsideNode(node, a))) {\n const callee = current.expression;\n // Same-place receiver (`x.push(x[0])`) is rewritten to `&mut x` args.\n if (root !== undefined && this.rootPlaceText(callee.expression) === root) return false;\n // `&mut self.(...)` arg lists are hoisted by the ccxt\n // pass because a `&self` reborrow conflicts with the outer `&mut self`.\n if (callee.expression.kind === SyntaxKind.ThisKeyword &&\n RustTranspiler.MUT_SELF_METHODS.has(this.toSnakeCaseName(String(callee.name.text))) &&\n (root === undefined || root === 'this' || root.startsWith('this.'))) return false;\n }\n }\n return true;\n }\n\n /** Receiver shapes whose printed text is a single `Value` place (`x`, `this.x`). */\n isShallowValueReceiver(node: Node): boolean {\n return isIdentifier(node) || (isPropertyAccessExpression(node) && node.expression.kind === SyntaxKind.ThisKeyword);\n }\n\n /** True when this read is the receiver of an element-access chain that is\n * written (`x['a'] = v`, `x['a']['b'] = v`, `delete x['a']['b']`), or a\n * property write itself (`x.k = v`, `delete x.k`). The ccxt write passes\n * match the `get_value(&…)` / `x.k` text to reach the real container, so a\n * native read would write into a discarded clone. */\n isNativeWriteTargetBase(node: Node): boolean {\n const isWrite = (n: any, target: any) => n !== undefined && (isDeleteExpression(n) ||\n (isBinaryExpression(n) && n.left === target && rustIsAssignmentOperator(n.operatorToken.kind)));\n const parent: any = node.parent;\n if (isWrite(parent, node)) return true;\n if (parent === undefined || !isElementAccessExpression(parent) || parent.expression !== node) return false;\n let current: any = parent;\n while (current.parent !== undefined && isElementAccessExpression(current.parent) && current.parent.expression === current) current = current.parent;\n return isWrite(current.parent, current);\n }\n\n transformPropertyAcessExpressionIfNeeded(node) {\n // Printed here (as before) so the receiver's loop-flag numbering in the\n // generated file matches the pinned baseline for non-length accesses.\n const leftExpr = this.printNode(node.expression, 0);\n if (node.name.text !== 'length') return undefined;\n const shadow = this.rustParamShadowOf(node.expression);\n const native = shadow !== undefined ? this.printShadowLength(shadow) : undefined;\n return native ?? this.printArrayLength(node, 0, leftExpr);\n }\n\n // `crate::value::get_value_k` is `get_value` for a `&str` key — the same\n // dict lookup minus the per-read `Value::Str` allocation. Three literal-key\n // families reach branches only `get_value` has (numeric cache/side indices,\n // the cache `hashmap` bucket, live client `subscriptions`/`futures`) and a\n // `this`/class receiver is not a `Value`, so those keep `get_value`.\n staticKeyLookup(node, container): string | undefined {\n if (!isStringLiteral(node)) return undefined;\n // Test sources keep the allocating form: the test-only post-passes\n // pattern-match `get_value(&…, &Value::Str(…))` call sites.\n const source = (node as any).getSourceFile ? (node as any).getSourceFile().fileName : '';\n if (typeof source === 'string' && /\\/test\\//.test(source)) return undefined;\n if (container.kind === SyntaxKind.ThisKeyword) return undefined;\n const text = node.text;\n if (text === '' || text in this.StringLiteralReplacements) return undefined;\n if (/^\\d+$/.test(text) || text === 'hashmap' || text === 'subscriptions' || text === 'futures') return undefined;\n const checker: any = this.checkerOrUndefined();\n if (checker === undefined) return undefined;\n const type = checker.getTypeAtLocation(container);\n if (type !== undefined && ((type as any).objectFlags & ObjectFlags.Class)) return undefined;\n return this.quotedStringLiteral(text);\n }\n\n printElementAccessExpression(node, identation) {\n const special = this.printElementAccessExpressionExceptionIfAny(node);\n if (special) return special;\n // `obj['x'] = v` is rewritten to `crate::set_value(...)` by a pass that\n // matches the `get_value(&obj, &key)` target shape, so targets keep it.\n // `d['a'].push(v)` lowers to `append_to_array(&mut , v)` and the\n // ccxt pass giving it write-through semantics (`append_to_object_array`)\n // matches `append_to_array(&mut get_value(&` literally, so call/property\n // targets keep the allocating form too: `get_value_k` is invisible to\n // that pass and the append would land on a discarded COW clone.\n const parent = node.parent;\n const keepGetValue = parent !== undefined && (\n (isBinaryExpression(parent) && parent.left === node &&\n parent.operatorToken.kind >= SyntaxKind.FirstAssignment && parent.operatorToken.kind <= SyntaxKind.LastAssignment) ||\n ((isPropertyAccessExpression(parent) || isCallExpression(parent)) && parent.expression === node));\n const chain: any[] = [];\n let current: any = node;\n while (isElementAccessExpression(current)) {\n chain.unshift(current);\n current = current.expression;\n }\n // One checker proof per chain: the emitted text replaces `get_value` only\n // when it is legal at the position the whole chain occupies.\n const nativeAllowed = this.isNativeAccessPositionSafe(node) && !this.isNativeWriteTargetBase(node);\n let acc = this.printNode(current, 0);\n for (const { expression: receiver, argumentExpression: key } of chain) {\n const native = nativeAllowed ? this.printNativeContainerAccess(acc, receiver, key) : undefined;\n const staticKey = native === undefined && !keepGetValue ? this.staticKeyLookup(key, receiver) : undefined;\n acc = native ?? (staticKey !== undefined\n ? `crate::value::get_value_k(&${acc}, ${staticKey})`\n : `get_value(&${acc}, &${this.printNode(key, 0)})`);\n }\n return acc;\n }\n\n printForStatement(node, identation) {\n const idn = this.getIden(identation);\n const idn1 = this.getIden(identation + 1);\n const initStr = node.initializer ? this.printNode(node.initializer, identation + 1) + ';\\n' : '';\n const condStr = node.condition ? this.printComparisonInBooleanContext(node.condition, 0).trim() : 'true';\n const incrStr = node.incrementor ? this.printNode(node.incrementor, 0) : '';\n const statements = node.statement.statements.map(s => this.printNode(s, identation + 1)).join('\\n');\n const body = `{\\n${statements}\\n${idn}}`;\n // A C-style `for` becomes a Rust `while`. The increment must run on\n // every iteration *including* one ended by `continue`, so it is folded\n // into the condition (guarded by a first-iteration flag); at the end of\n // the body a `continue` would skip it and spin the loop forever.\n if (incrStr !== '') {\n const flag = `__for_first_${this.forLoopCounter++}`;\n const cond = `{ if !${flag} { ${incrStr}; } ${flag} = false; ${condStr} }`;\n return `${idn}{\\n${idn1}${initStr}${idn1}let mut ${flag}: bool = true;\\n${idn1}while ${cond} ${body}\\n${idn}}`;\n }\n return `${idn}{\\n${idn1}${initStr}${idn1}while ${condStr} ${body}\\n${idn}}`;\n }\n\n private static readonly COMPARISON_OPS = new Set([\n SyntaxKind.EqualsEqualsToken, SyntaxKind.EqualsEqualsEqualsToken, SyntaxKind.ExclamationEqualsToken, SyntaxKind.ExclamationEqualsEqualsToken,\n SyntaxKind.LessThanToken, SyntaxKind.LessThanEqualsToken, SyntaxKind.GreaterThanToken, SyntaxKind.GreaterThanEqualsToken,\n ]);\n\n // Comparison helpers that can be replaced by a native numeric operator.\n private static readonly NATIVE_COMPARISON_OPERATORS: Record = {\n [SyntaxKind.LessThanToken]: '<', [SyntaxKind.LessThanEqualsToken]: '<=',\n [SyntaxKind.GreaterThanToken]: '>', [SyntaxKind.GreaterThanEqualsToken]: '>=',\n };\n\n isEqualityOp(op): boolean {\n return op === SyntaxKind.EqualsEqualsToken || op === SyntaxKind.EqualsEqualsEqualsToken ||\n op === SyntaxKind.ExclamationEqualsToken || op === SyntaxKind.ExclamationEqualsEqualsToken;\n }\n\n isLogicalOp(op): boolean {\n return op === SyntaxKind.AmpersandAmpersandToken || op === SyntaxKind.BarBarToken;\n }\n\n printCondition(node, identation) {\n const idn = this.getIden(identation);\n if (node.kind === SyntaxKind.BinaryExpression) {\n const opKind = node.operatorToken.kind;\n // Comparison binary expressions already return bool — skip is_true() wrapping\n if (RustTranspiler.COMPARISON_OPS.has(opKind)) return this.printComparisonInBooleanContext(node, identation);\n // Logical &&/|| operands are individually is_true()-wrapped in\n // printBinaryExpression, so the whole expression is already bool —\n // unless one carries a native compare, which needs no is_true().\n if (this.isLogicalOp(opKind)) {\n const native = this.hasNativeComparisonOperand(node.left) || this.hasNativeComparisonOperand(node.right);\n return idn + (native ? this.printLogicalInBooleanContext(node) : this.printNode(node, 0));\n }\n }\n // PrefixUnary ! — delegate to avoid double-wrapping\n if (node.kind === SyntaxKind.PrefixUnaryExpression && node.operator === SyntaxKind.ExclamationToken) {\n return this.printPrefixUnaryExpression(node, identation);\n }\n // A call to a hand-written `-> bool` fn is already a Rust bool.\n if (this.rustCallPrintsBool(node)) return idn + this.printNode(node, 0);\n // Checker-proved boolean Value (safe_bool / get_value): native matches!.\n const nativeTruthiness = this.printNativeTruthiness(node);\n if (nativeTruthiness !== undefined) return idn + nativeTruthiness;\n // B-26: an operand whose printer emission is already a Rust `bool`.\n const nativeCondition = this.printNativeParenthesizedCondition(node);\n if (nativeCondition !== undefined && this.rustConditionBoolSlot(node)) return idn + nativeCondition;\n const expression = this.printNode(node, 0);\n const peeled = this.peelValueBoolBox(this.stripOuterParens(expression));\n if (peeled !== undefined && this.rustConditionBoolSlot(node) && !this.printedBoolHelperCall(this.stripOuterParens(peeled))) {\n return `${idn}(${peeled})`;\n }\n return `${idn}is_true(&${this.printTruthyArgument(expression)})`;\n }\n\n // B-26: `is_true(&(…)` on an operand the printer already emits as a native Rust `bool` (payload\n // compares, `matches!` predicates, `&&`/`||` of those) is the identity (`IsTruthy for bool`);\n // native text has no helper token, so it is emitted only in a bool slot (`isBareBoolEmissionSafe`).\n\n /** Bool-slot text of a parenthesised native comparison/predicate, else undefined. */\n printNativeParenthesizedCondition(node): string | undefined {\n const inner = this.unwrapParens(node);\n if (inner === undefined || inner === node || inner.kind !== SyntaxKind.BinaryExpression) return undefined;\n const op = inner.operatorToken.kind;\n if (this.isLogicalOp(op)) {\n // Every operand of a logical already prints a bool; keep the wrapper\n // when they are all helper-led (the post-passes key on that token).\n if (!this.hasNativeComparisonOperand(inner.left) && !this.hasNativeComparisonOperand(inner.right)) return undefined;\n return `(${this.printLogicalInBooleanContext(inner)})`;\n }\n if (!RustTranspiler.COMPARISON_OPS.has(op)) return undefined;\n let native: string | undefined;\n if (inner.left.kind === SyntaxKind.TypeOfExpression) {\n // `typeof x === 'string'` prints the same native predicate as `x in obj`.\n native = this.nativeValuePredicateText(inner.right.text, inner.left.expression, this.printNode(inner.left.expression, 0));\n const isDiff = op === SyntaxKind.ExclamationEqualsEqualsToken || op === SyntaxKind.ExclamationEqualsToken;\n if (native !== undefined && isDiff) native = '!' + native;\n } else {\n native = this.isEqualityOp(op) ? this.nativeEqualityText(inner) : this.printNativeOrderedComparison(inner, op, inner.left, inner.right);\n }\n return native === undefined ? undefined : `(${native})`;\n }\n\n // The argument of an `is_true(&…)` sink with the printer's `Value::Bool(…)` box peeled when it\n // spans the whole argument: `IsTruthy for Value` unboxes `Value::Bool(b)` to `b`, so the bool\n // prints bare. `is_true` is the one sink taking a native `bool`; the marker stays for post-passes.\n printTruthyArgument(expression: string): string {\n const inner = this.peelValueBoolBox(this.stripOuterParens(expression));\n // parens kept: `is_true(&a == b)` would re-associate the argument.\n return inner === undefined ? expression : `(${inner})`;\n }\n\n // `assert(, )` — the test harness' `assert` takes a\n // native `bool` (`impl Truthy for bool`), so a whole-argument\n // `Value::Bool(…)` box prints bare there too. The message list is untouched.\n printAssertCall(node, identation, parsedArgs) {\n const [first, rest] = this.splitFirstArgument(parsedArgs);\n const inner = this.peelValueBoolBox(this.stripOuterParens(first));\n return inner === undefined ? `assert(${parsedArgs})` : `assert((${inner})${rest})`;\n }\n\n // Splits an already-printed argument list after its first top-level `,`.\n splitFirstArgument(parsedArgs: string): [string, string] {\n let depth = 0;\n for (let i = 0; i < parsedArgs.length; i++) {\n const char = parsedArgs[i];\n if (char === '\"') {\n for (i++; i < parsedArgs.length && parsedArgs[i] !== '\"'; i++) {\n if (parsedArgs[i] === '\\\\') i++;\n }\n } else if ('([{'.includes(char)) depth++;\n else if (')]}'.includes(char)) depth--;\n else if (char === ',' && depth === 0) return [parsedArgs.slice(0, i), parsedArgs.slice(i)];\n }\n return [parsedArgs, ''];\n }\n\n // Bool-position text for a comparison: the native payload compare (already\n // bool) when the checker proves it, the is_equal() helper otherwise.\n printComparisonInBooleanContext(node, identation) {\n const native = this.nativeEqualityText(node);\n return this.getIden(identation) + (native ? `(${native})` : this.printNode(node, 0));\n }\n\n // Native equality text of `node` (parens unwrapped), if the checker proves it.\n nativeEqualityText(node) {\n const inner = this.unwrapParens(node);\n if (inner === undefined || inner.kind !== SyntaxKind.BinaryExpression || !this.isEqualityOp(inner.operatorToken.kind)) return undefined;\n return this.printNativeEqualityComparison(inner.left, inner.right, inner.operatorToken.kind);\n }\n\n unwrapParens(node) {\n let inner = node;\n while (inner !== undefined && inner.kind === SyntaxKind.ParenthesizedExpression) inner = inner.expression;\n return inner;\n }\n\n // Does `node` carry a native payload compare in a position where the old\n // text started with a bool helper? The post-pass types locals by that token.\n hasNativeComparisonOperand(node) {\n const inner = this.unwrapParens(node);\n if (inner === undefined) return false;\n if (inner.kind === SyntaxKind.PrefixUnaryExpression && inner.operator === SyntaxKind.ExclamationToken) {\n return this.hasNativeComparisonOperand(inner.operand);\n }\n if (this.nativeEqualityText(inner) !== undefined) return true;\n return inner.kind === SyntaxKind.BinaryExpression && this.isLogicalOp(inner.operatorToken.kind) &&\n (this.hasNativeComparisonOperand(inner.left) || this.hasNativeComparisonOperand(inner.right));\n }\n\n // Bare `&&`/`||` text of a logical expression (its operands are bools).\n printLogicalInBooleanContext(node) {\n const token = node.operatorToken.kind === SyntaxKind.AmpersandAmpersandToken ? '&&' : '||';\n return `${this.printCondition(node.left, 0).trim()} ${token} ${this.printCondition(node.right, 0).trim()}`;\n }\n\n printWhileStatement(node, identation) {\n return `${this.getIden(identation)}while ${this.printCondition(node.expression, 0)}${this.printBlock(node.statement, identation)}`;\n }\n\n printIfStatement(node, identation) {\n const elseStatement = node.elseStatement;\n const ifBody = this.printBlock(node.thenStatement, identation, elseStatement !== undefined);\n const head = node.parent.kind === SyntaxKind.IfStatement ? 'else if ' : `${this.getIden(identation)}if `;\n let ifComplete = `${head}${this.printCondition(node.expression, 0)}${ifBody}`;\n if (elseStatement?.kind === SyntaxKind.Block) {\n ifComplete += ` else${this.printBlock(elseStatement, identation)}`;\n } else if (elseStatement?.kind === SyntaxKind.IfStatement) {\n ifComplete += ' ' + this.printIfStatement(elseStatement, identation);\n }\n return this.printNodeCommentsIfAny(node, identation, ifComplete);\n }\n\n printPostFixUnaryExpression(node, identation) {\n const { operand, operator } = node;\n const helper = operator === SyntaxKind.PlusPlusToken ? 'add' : operator === SyntaxKind.MinusMinusToken ? 'subtract' : undefined;\n if (helper === undefined) return super.printPostFixUnaryExpression(node, identation);\n const operandText = this.printNode(operand, 0);\n const native = this.printNativeIncrement(helper === 'add' ? SyntaxKind.PlusToken : SyntaxKind.MinusToken, operand, operandText);\n return `${this.getIden(identation)}${operandText} = ${native ?? `${helper}(&${operandText}, &Value::Int(1))`}`;\n }\n\n // `x++` / `x--` on a checker-typed number: native `+`/`-` with `Value::Int(1)`.\n printNativeIncrement(op, operand, operandText: string): string | undefined {\n try {\n if (!this.isNumberLikeType(this.getChecker().getTypeAtLocation(operand))) return undefined;\n } catch (e) {\n return undefined;\n }\n return this.printNativeNumeric(op, operandText, 'Value::Int(1)');\n }\n\n printPrefixUnaryExpression(node, identation) {\n const { operand, operator } = node;\n const idn = this.getIden(identation);\n if (operator === SyntaxKind.ExclamationToken) return idn + '!' + this.printCondition(operand, 0);\n if (operator !== SyntaxKind.MinusToken) return idn + this.PrefixFixOperators[operator] + this.printNode(operand, 0);\n const operandText = this.printNode(operand, 0);\n return idn + (this.foldNegateLiteral(operandText) ?? `negate(&${operandText})`);\n }\n\n printObjectLiteralExpression(node, identation) {\n const escapeKey = (s: any): string => String(s).replace(/\\\\/g, '\\\\\\\\').replace(/\"/g, '\\\\\"')\n .replace(/\\n/g, '\\\\n').replace(/\\r/g, '\\\\r').replace(/\\t/g, '\\\\t');\n const idn2 = this.getIden(identation + 2);\n const lines = node.properties.map(p => {\n // Shorthand: { foo } → m.insert(\"foo\", foo.clone());\n if (isShorthandPropertyAssignment(p)) {\n const name = (p.name as Identifier).text;\n return `${idn2}m.insert(\"${escapeKey(name)}\".to_string(), ${name}.clone());`;\n }\n const keyText = isStringLiteral(p.name) ? p.name.text : p.name.text;\n return `${idn2}m.insert(\"${escapeKey(keyText)}\".to_string(), ${this.printNode(p.initializer, 0)});`;\n });\n const idn1 = this.getIden(identation + 1);\n const body = lines.map(l => l + '\\n').join('');\n return `Value::Map({\\n${idn1}let mut m = std::collections::HashMap::new();\\n${body}${idn1}m\\n${this.getIden(identation)}})`;\n }\n\n printArrayLiteralExpression(node, identation) {\n return `Value::from(vec![${node.elements.map(e => this.printNode(e, 0)).join(', ')}])`;\n }\n\n printDeleteExpression(node, identation) {\n return `remove(&mut ${this.printNode(node.expression.expression, 0)}, &${this.printNode(node.expression.argumentExpression, 0)})`;\n }\n\n printInstanceOfExpression(node, identation) {\n return `${this.getIden(identation)}is_instance(&${this.printNode(node.left, 0)}, &${this.printNode(node.right, 0)})`;\n }\n\n printConditionalExpression(node, identation) {\n const condition = this.printCondition(node.condition, 0);\n const whenTrue = this.printTernaryArm(node.whenTrue);\n const whenFalse = this.printTernaryArm(node.whenFalse);\n // `ternary` is `if cond { a } else { b }` over `Value`; the arms are\n // normalized to `Value`, so the native form matches it and evaluates\n // only the taken arm (TS semantics).\n return `(if ${condition} { ${whenTrue} } else { ${whenFalse} })`;\n }\n\n // Free runtime functions that print as `bool` (not `Value`) — mirror of the\n // Rust pipeline's `ternary()` bool-boxing list.\n private static readonly BOOL_VALUE_PREFIXES = [\n 'is_equal', 'is_true', 'is_greater_than', 'is_less_than',\n 'is_greater_than_or_equal', 'is_less_than_or_equal', 'is_array',\n 'is_object', 'in_op', 'is_number', 'is_string',\n ];\n\n private static isBoolValueExpression(text: string): boolean {\n let value = text.trim();\n while (value.startsWith('(') && value.endsWith(')')) {\n let depth = 0;\n let wrapsWhole = true;\n for (let i = 0; i < value.length && wrapsWhole; i++) {\n if (value[i] === '(') depth++;\n else if (value[i] === ')' && --depth === 0 && i < value.length - 1) wrapsWhole = false;\n }\n if (!wrapsWhole) break;\n value = value.slice(1, -1).trim();\n }\n if (value.startsWith('!')) value = value.slice(1).trim();\n return RustTranspiler.BOOL_VALUE_PREFIXES.some((fn) => value.startsWith(fn + '('));\n }\n\n // An if-expression arm keeps the type `ternary()`'s `Value` parameters gave\n // it: box bool expressions, and clone bare identifiers so the arm does not\n // move a local the caller still uses.\n printTernaryArm(node, identation = 0) {\n const text = this.printNode(node, identation);\n const trimmed = text.trim();\n if (RustTranspiler.isBoolValueExpression(trimmed)) return `Value::Bool(${trimmed})`;\n if (/^[a-zA-Z_][a-zA-Z0-9_]*$/.test(trimmed) && trimmed !== 'self' && trimmed !== 'true' && trimmed !== 'false') return `${trimmed}.clone()`;\n return text;\n }\n\n // Built-in method call overrides\n printArrayIsArrayCall(node, identation, parsedArg = undefined) {\n return `Value::Bool(${this.nativeValuePredicateText('array', node?.arguments?.[0], parsedArg) ?? `is_array(&${parsedArg})`})`;\n }\n\n printObjectKeysCall(node, identation, parsedArg = undefined) {\n return `object_keys(&${parsedArg})`;\n }\n\n printObjectValuesCall(node, identation, parsedArg = undefined) {\n return `object_values(&${parsedArg})`;\n }\n\n printJsonParseCall(node, identation, parsedArg = undefined) {\n return `json_parse(&${parsedArg})`;\n }\n\n printJsonStringifyCall(node, identation, parsedArg = undefined) {\n return `json_stringify(&${parsedArg})`;\n }\n\n printMathFloorCall(node, identation, parsedArg = undefined) {\n return `math_floor(&${parsedArg})`;\n }\n\n // No `.await` here: `printAwaitExpression` appends it for `await Promise.all(...)`.\n printPromiseAllCall(node, identation, parsedArg = undefined) {\n return `promise_all(&${parsedArg})`;\n }\n\n // Rust uses postfix `.await`; the base transpiler defaults to prefix.\n printAwaitExpression(node, identation) {\n return `${this.printNode(node.expression, identation)}.await`;\n }\n\n printMathRoundCall(node, identation, parsedArg = undefined) {\n return `math_round(&${parsedArg})`;\n }\n\n printMathCeilCall(node, identation, parsedArg = undefined) {\n return `math_ceil(&${parsedArg})`;\n }\n\n printNumberIsIntegerCall(node, identation, parsedArg = undefined) {\n return `is_integer(&${parsedArg})`;\n }\n\n printArrayPushCall(node, identation, name = undefined, parsedArg = undefined) {\n return `append_to_array(&mut ${name}, ${parsedArg})`;\n }\n\n printIncludesCall(node, identation, name = undefined, parsedArg = undefined) {\n return `Value::Bool(contains(&${name}, &${parsedArg}))`;\n }\n\n printIndexOfCall(node, identation, name = undefined, parsedArg = undefined) {\n return this.printNativeStringIndexOf(node, name) ?? `get_index_of(&${name}, &${parsedArg})`;\n }\n\n printStartsWithCall(node, identation, name = undefined, parsedArg = undefined) {\n return `Value::Bool(starts_with(&${name}, &${parsedArg}))`;\n }\n\n printEndsWithCall(node, identation, name = undefined, parsedArg = undefined) {\n return `Value::Bool(ends_with(&${name}, &${parsedArg}))`;\n }\n\n printTrimCall(node, identation, name = undefined) {\n return `trim(&${name})`;\n }\n\n printJoinCall(node, identation, name = undefined, parsedArg = undefined) {\n return `join(&${name}, &${parsedArg})`;\n }\n\n printSplitCall(node, identation, name = undefined, parsedArg = undefined) {\n return `split(&${name}, &${parsedArg})`;\n }\n\n printConcatCall(node, identation, name = undefined, parsedArg = undefined) {\n return `concat(${name}.clone(), ${parsedArg}.clone())`;\n }\n\n printToFixedCall(node, identation, name = undefined, parsedArg = undefined) {\n return `to_fixed(&${name}, &${parsedArg})`;\n }\n\n printToStringCall(node, identation, name = undefined) {\n return `to_string_val(&${name})`;\n }\n\n printToUpperCaseCall(node, identation, name = undefined) {\n return `to_upper(&${name})`;\n }\n\n printToLowerCaseCall(node, identation, name = undefined) {\n return `to_lower(&${name})`;\n }\n\n printShiftCall(node, identation, name = undefined) {\n return `shift(${name}.clone())`;\n }\n\n printReverseCall(node, identation, name = undefined) {\n return `${name} = reverse(${name}.clone())`;\n }\n\n printPopCall(node, identation, name = undefined) {\n return `pop(${name}.clone())`;\n }\n\n printSliceCall(node, identation, name = undefined, parsedArg = undefined, parsedArg2 = undefined) {\n return this.printNativeStringSlice(node, name) ?? `slice(&${name}, &${parsedArg}, &${parsedArg2 ?? 'Value::Null'})`;\n }\n\n printReplaceCall(node, identation, name = undefined, parsedArg = undefined, parsedArg2 = undefined) {\n return `replace_str(&${name}, &${parsedArg}, &${parsedArg2})`;\n }\n\n printReplaceAllCall(node, identation, name = undefined, parsedArg = undefined, parsedArg2 = undefined) {\n return `replace_all_str(&${name}, &${parsedArg}, &${parsedArg2})`;\n }\n\n // `{}` (Display) renders an ExchangeError as `[Kind] message`; `{:?}` would dump the struct fields.\n printThrowStatement(node, identation) {\n return `${this.getIden(identation)}panic!(\"{}\", ${this.printNode(node.expression, 0)});`;\n }\n\n printTryStatement(node, identation) {\n const body = (block) => block.statements.map(s => this.printNode(s, identation + 1)).join('\\n');\n const rawName = node.catchClause?.variableDeclaration?.name?.text;\n const iden = this.getIden(identation);\n const errorName = rawName ? `_${rawName}` : '_e';\n return `${iden}let _try_result = std::panic::catch_unwind(std::panic::AssertUnwindSafe(|| {\\n${body(node.tryBlock)}\\n${iden}}));\\n` +\n `${iden}if let Err(${errorName}) = _try_result {\\n${body(node.catchClause.block)}\\n${iden}}`;\n }\n\n printReturnStatement(node, identation) {\n const exp = node.expression;\n const idn = this.getIden(identation);\n if (!exp) return `${idn}return;`;\n // `return X;` inside a native-`Option` method: the printed\n // expression is still the `Value` box, so convert it back to the\n // native payload (a nullish literal is the `None` arm).\n const fn: any = findAncestor(node.parent, isFunctionLike);\n if (this.rustNativeStrReturnKind(fn) === 'str' && this.rustStrReturnValueConverts(exp)) {\n if (this.literalKindOfNode(this.unwrapParensNode(exp)) === 'null') return `${idn}return None;`;\n const suffix = this.rustStrNativeExpression(exp) ? '' : '.as_str().map(str::to_owned)';\n return `${idn}return ${this.printNode(exp, 0).trim()}${suffix};`;\n }\n return `${idn}return ${this.printNode(exp, 0).trim()};`;\n }\n\n printBreakStatement(node, identation) {\n return `${this.getIden(identation)}break;`;\n }\n\n printContinueStatement(node, identation) {\n return `${this.getIden(identation)}continue;`;\n }\n\n printConstructorDeclaration(node, identation) {\n return ''; // handled in printNewMethod\n }\n\n printSpreadElement(node, identation) {\n return `${this.getIden(identation)}${this.printNode(node.expression, 0)}`;\n }\n}\n","import { BaseTranspiler } from \"./baseTranspiler.js\";\nimport { SyntaxKind } from \"typescript/unstable/ast\";\nimport { isCallExpression, isExpressionStatement } from \"typescript/unstable/ast/is\";\nimport { type Checker } from \"typescript/unstable/sync\";\nimport { isFunctionLike } from \"./tsUtils.js\";\n\nconst parserConfig = {\n 'ELSEIF_TOKEN': 'else if',\n 'OBJECT_OPENING': 'std::unordered_map {',\n 'OBJECT_CLOSING': '}',\n 'ARRAY_OPENING_TOKEN': 'std::vector{',\n 'ARRAY_CLOSING_TOKEN': '}',\n 'PROPERTY_ASSIGNMENT_TOKEN': ',',\n 'VAR_TOKEN': 'std::any', // object\n 'METHOD_TOKEN': '',\n 'PROPERTY_ASSIGNMENT_OPEN': '{',\n 'PROPERTY_ASSIGNMENT_CLOSE': '}',\n 'SUPER_TOKEN': 'base',\n 'SUPER_CALL_TOKEN': 'base',\n 'FALSY_WRAPPER_OPEN': 'isTrue(',\n 'FALSY_WRAPPER_CLOSE': ')',\n 'COMPARISON_WRAPPER_OPEN' : \"isEqual(\",\n 'COMPARISON_WRAPPER_CLOSE' : \")\",\n 'UKNOWN_PROP_WRAPPER_OPEN': 'this.call(',\n 'UNKOWN_PROP_WRAPPER_CLOSE': ')',\n 'UKNOWN_PROP_ASYNC_WRAPPER_OPEN': 'this.callAsync(',\n 'UNKOWN_PROP_ASYNC_WRAPPER_CLOSE': ')',\n 'DYNAMIC_CALL_OPEN': 'callDynamically(',\n 'EQUALS_EQUALS_WRAPPER_OPEN': 'isEqual(',\n 'EQUALS_EQUALS_WRAPPER_CLOSE': ')',\n 'DIFFERENT_WRAPPER_OPEN': '!isEqual(',\n 'DIFFERENT_WRAPPER_CLOSE': ')',\n 'GREATER_THAN_WRAPPER_OPEN': 'isGreaterThan(',\n 'GREATER_THAN_WRAPPER_CLOSE': ')',\n 'GREATER_THAN_EQUALS_WRAPPER_OPEN': 'isGreaterThanOrEqual(',\n 'GREATER_THAN_EQUALS_WRAPPER_CLOSE': ')',\n 'LESS_THAN_WRAPPER_OPEN': 'isLessThan(',\n 'LESS_THAN_WRAPPER_CLOSE': ')',\n 'LESS_THAN_EQUALS_WRAPPER_OPEN': 'isLessThanOrEqual(',\n 'LESS_THAN_EQUALS_WRAPPER_CLOSE': ')',\n 'PLUS_WRAPPER_OPEN':'add(',\n 'PLUS_WRAPPER_CLOSE':')',\n 'MINUS_WRAPPER_OPEN':'subtract(',\n 'MINUS_WRAPPER_CLOSE':')',\n 'ARRAY_LENGTH_WRAPPER_OPEN': 'getArrayLength(',\n 'ARRAY_LENGTH_WRAPPER_CLOSE': ')',\n 'DIVIDE_WRAPPER_OPEN': 'divide(',\n 'DIVIDE_WRAPPER_CLOSE': ')',\n 'MULTIPLY_WRAPPER_OPEN': 'multiply(',\n 'MULTIPLY_WRAPPER_CLOSE': ')',\n 'INDEXOF_WRAPPER_OPEN': 'getIndexOf(',\n 'INDEXOF_WRAPPER_CLOSE': ')',\n 'MOD_WRAPPER_OPEN': 'mod(',\n 'MOD_WRAPPER_CLOSE': ')',\n 'FUNCTION_TOKEN': '',\n 'DEFAULT_PARAMETER_TYPE': 'std::any',\n 'INFER_VAR_TYPE': false,\n 'INFER_ARG_TYPE': false,\n 'UNDEFINED_TOKEN': 'std::any{}',\n // qualified with :: so class methods with the same name never shadow the helper\n 'ELEMENT_ACCESS_WRAPPER_OPEN': '::getValue(',\n 'ELEMENT_ACCESS_WRAPPER_CLOSE': ')',\n 'DEFAULT_RETURN_TYPE': 'std::any',\n 'THIS_TOKEN': 'this',\n 'NEW_TOKEN': '',\n 'CATCH_DECLARATION': 'const std::exception&',\n};\n\nexport class CppTranspiler extends BaseTranspiler {\n\n binaryExpressionsWrappers;\n\n constructor(config = {}) {\n config['parser'] = Object.assign ({}, parserConfig, config['parser'] ?? {});\n\n super(config);\n\n this.requiresParameterType = true;\n this.requiresReturnType = true;\n this.asyncTranspiling = true;\n this.supportsFalsyOrTruthyValues = false;\n this.requiresCallExpressionCast = false;\n this.id = \"c++\";\n\n this.initConfig();\n\n // user overrides\n this.applyUserOverrides(config);\n }\n\n initConfig() {\n this.LeftPropertyAccessReplacements = {\n };\n\n this.RightPropertyAccessReplacements = {\n };\n\n this.FullPropertyAccessReplacements = {\n 'JSON.parse': 'parseJson',\n 'JSON.stringify': 'jsonStringify',\n 'console.log': 'consoleLog',\n 'Number.MAX_SAFE_INTEGER': 'INT_MAX',\n 'Math.min': 'mathMin',\n 'Math.max': 'mathMax',\n 'Math.log': 'mathLog',\n 'Math.abs': 'mathAbs',\n 'Math.floor': 'mathFloor',\n 'Math.pow': 'mathPow',\n };\n\n this.CallExpressionReplacements = {\n };\n\n this.ReservedKeywordsReplacements = {\n 'union': 'unionVar',\n 'char': 'charVar',\n 'default': 'defaultVar',\n 'operator': 'operatorVar',\n 'new': 'newVar',\n 'delete': 'deleteVar',\n 'template': 'templateVar',\n };\n\n this.VariableTypeReplacements = {\n };\n\n this.ArgTypeReplacements = {\n };\n\n this.binaryExpressionsWrappers = {\n [SyntaxKind.EqualsEqualsToken]: [this.EQUALS_EQUALS_WRAPPER_OPEN, this.EQUALS_EQUALS_WRAPPER_CLOSE],\n [SyntaxKind.EqualsEqualsEqualsToken]: [this.EQUALS_EQUALS_WRAPPER_OPEN, this.EQUALS_EQUALS_WRAPPER_CLOSE],\n [SyntaxKind.ExclamationEqualsToken]: [this.DIFFERENT_WRAPPER_OPEN, this.DIFFERENT_WRAPPER_CLOSE],\n [SyntaxKind.ExclamationEqualsEqualsToken]: [this.DIFFERENT_WRAPPER_OPEN, this.DIFFERENT_WRAPPER_CLOSE],\n [SyntaxKind.GreaterThanToken]: [this.GREATER_THAN_WRAPPER_OPEN, this.GREATER_THAN_WRAPPER_CLOSE],\n [SyntaxKind.GreaterThanEqualsToken]: [this.GREATER_THAN_EQUALS_WRAPPER_OPEN, this.GREATER_THAN_EQUALS_WRAPPER_CLOSE],\n [SyntaxKind.LessThanToken]: [this.LESS_THAN_WRAPPER_OPEN, this.LESS_THAN_WRAPPER_CLOSE],\n [SyntaxKind.LessThanEqualsToken]: [this.LESS_THAN_EQUALS_WRAPPER_OPEN, this.LESS_THAN_EQUALS_WRAPPER_CLOSE],\n [SyntaxKind.PlusToken]: [this.PLUS_WRAPPER_OPEN, this.PLUS_WRAPPER_CLOSE],\n [SyntaxKind.MinusToken]: [this.MINUS_WRAPPER_OPEN, this.MINUS_WRAPPER_CLOSE],\n [SyntaxKind.AsteriskToken]: [this.MULTIPLY_WRAPPER_OPEN, this.MULTIPLY_WRAPPER_CLOSE],\n [SyntaxKind.PercentToken]: [this.MOD_WRAPPER_OPEN, this.MOD_WRAPPER_CLOSE],\n [SyntaxKind.SlashToken]: [this.DIVIDE_WRAPPER_OPEN, this.DIVIDE_WRAPPER_CLOSE],\n };\n }\n\n getBlockOpen(identation){\n return \"\\n\" + this.getIden(identation) + this.BLOCK_OPENING_TOKEN + \"\\n\";\n }\n\n printSuperCallInsideConstructor(node, identation) {\n return \"\"; // c++ initializes the base class in the member initializer list\n }\n\n printStringLiteral(node) {\n // wrap in std::string so std::any always holds std::string, never const char*\n return `std::string(${super.printStringLiteral(node)})`;\n }\n\n printClass(node, identation) {\n const classDefinition = this.printClassDefinition(node, identation);\n const classBody = this.printClassBody(node, identation);\n const classClosing = this.getBlockClose(identation);\n return classDefinition + classBody + classClosing + ';';\n }\n\n printClassDefinition(node, identation) {\n const className = node.name.text;\n const heritageClauses = node.heritageClauses;\n\n let classInit = \"\";\n if (heritageClauses !== undefined) {\n const classExtends = heritageClauses[0].types[0].expression.text;\n classInit = this.getIden(identation) + \"class \" + className + \" : public \" + classExtends;\n } else {\n classInit = this.getIden(identation) + \"class \" + className;\n }\n return classInit + \"\\n\" + this.getIden(identation) + this.BLOCK_OPENING_TOKEN + \"\\n\" +\n this.getIden(identation) + \"public:\\n\";\n }\n\n printConstructorDeclaration (node, identation) {\n const classNode = node.parent;\n const className = this.printNode(classNode.name, 0);\n const args = this.printMethodParameters(node);\n const constructorBody = this.printFunctionBody(node, identation);\n\n // find super call inside constructor and extract params\n let superCallParams = '';\n let hasSuperCall = false;\n node.body?.statements.forEach(statement => {\n if (isExpressionStatement(statement)) {\n const expression = statement.expression;\n if (isCallExpression(expression)) {\n const expressionText = expression.expression.getText().trim();\n if (expressionText === 'super') {\n hasSuperCall = true;\n superCallParams = expression.arguments.map((a) => {\n return this.printNode(a, identation).trim();\n }).join(\", \");\n }\n }\n }\n });\n\n if (hasSuperCall) {\n const parentClassName = classNode.heritageClauses[0].types[0].expression.text;\n return this.getIden(identation) + className +\n `(${args}) : ${parentClassName}(${superCallParams})` +\n constructorBody;\n }\n\n return this.getIden(identation) +\n className +\n \"(\" + args + \")\" +\n constructorBody;\n }\n\n printThisElementAccesssIfNeeded(node, identation) {\n return undefined; // dynamic this[method]() calls are not supported yet\n }\n\n printDynamicCall(node, identation) {\n return undefined; // dynamic calls are not supported yet\n }\n\n printAwaitExpression(node, identation) {\n const expression = this.printNode(node.expression, identation);\n if (this.asyncTranspiling) {\n // awaitValue resolves a std::shared_future (or passes a\n // plain value through, like awaiting a non-promise in JS)\n return `awaitValue(${expression})`;\n }\n return expression;\n }\n\n printReturnStatement(node, identation) {\n // a bare `return;` inside an async body must yield a value: the body\n // runs in a lambda returning std::any\n if (this.asyncTranspiling && !node.expression) {\n let fn = node.parent;\n while (fn !== undefined && !isFunctionLike(fn)) {\n fn = fn.parent;\n }\n if (fn !== undefined && this.isAsyncFunction(fn)) {\n return this.getIden(identation) + \"return std::any{}\" + this.LINE_TERMINATOR;\n }\n }\n return super.printReturnStatement(node, identation);\n }\n\n printFunctionBody(node, identation) {\n if (this.asyncTranspiling && this.isAsyncFunction(node)) {\n // run the body on a std::async task so independent calls overlap;\n // sharing the future makes it copyable and thus storable in std::any\n const innerIdentation = identation + 2;\n const bodyStatements = node.body.statements;\n const statements = bodyStatements.map((s) => this.printNode(s, innerIdentation)).join(\"\\n\");\n // the lambda returns std::any, so a body that can flow off the end\n // needs a fallback return\n const lastStatement = bodyStatements.length > 0 ? bodyStatements[bodyStatements.length - 1] : undefined;\n const endsWithReturn = lastStatement !== undefined && lastStatement.kind === SyntaxKind.ReturnStatement;\n const fallbackReturn = endsWithReturn ? \"\" : this.getIden(innerIdentation) + \"return std::any{};\\n\";\n return this.getBlockOpen(identation) +\n this.getIden(identation + 1) + \"return std::async(std::launch::async, [=]() -> std::any {\\n\" +\n (statements ? statements + \"\\n\" : \"\") +\n fallbackReturn +\n this.getIden(identation + 1) + \"}).share();\" +\n this.getBlockClose(identation);\n }\n return super.printFunctionBody(node, identation);\n }\n\n printWrappedUnknownThisProperty(node) {\n return undefined;\n }\n\n printOutOfOrderCallExpressionIfAny(node, identation) {\n if (node.expression.kind === SyntaxKind.PropertyAccessExpression) {\n const expressionText = node.expression.getText().trim();\n const args = node.arguments;\n if (args.length === 1) {\n const parsedArg = this.printNode(args[0], 0);\n switch (expressionText) {\n case \"Math.abs\":\n return `mathAbs(${parsedArg})`;\n }\n } else if (args.length === 2) {\n const parsedArg1 = this.printNode(args[0], 0);\n const parsedArg2 = this.printNode(args[1], 0);\n switch (expressionText) {\n case \"Math.min\":\n return `mathMin(${parsedArg1}, ${parsedArg2})`;\n case \"Math.max\":\n return `mathMax(${parsedArg1}, ${parsedArg2})`;\n case \"Math.pow\":\n return `mathPow(${parsedArg1}, ${parsedArg2})`;\n }\n }\n }\n\n return undefined;\n }\n\n handleTypeOfInsideBinaryExpression(node, identation) {\n const right = node.right.text;\n const op = node.operatorToken.kind;\n const expression = node.left.expression;\n\n const isDifferentOperator = op === SyntaxKind.ExclamationEqualsEqualsToken || op === SyntaxKind.ExclamationEqualsToken;\n const notOperator = isDifferentOperator ? this.NOT_TOKEN : \"\";\n\n const target = this.printNode(expression, 0);\n switch (right) {\n case \"string\":\n return notOperator + `isString(${target})`;\n case \"number\":\n return notOperator + `isNumber(${target})`;\n case \"boolean\":\n return notOperator + `isBool(${target})`;\n case \"object\":\n return notOperator + `isDictionary(${target})`;\n case \"function\":\n return notOperator + `isFunction(${target})`;\n }\n\n return undefined;\n }\n\n printCustomBinaryExpressionIfAny(node, identation) {\n const left = node.left;\n const right = node.right;\n\n const op = node.operatorToken.kind;\n\n if (left.kind === SyntaxKind.TypeOfExpression) {\n const typeOfExpression = this.handleTypeOfInsideBinaryExpression(node, identation);\n if (typeOfExpression) {\n return typeOfExpression;\n }\n }\n\n // handle: [x,d] = this.method()\n if (op === SyntaxKind.EqualsToken && left.kind === SyntaxKind.ArrayLiteralExpression) {\n const arrayBindingPatternElements = left.elements;\n const parsedArrayBindingElements = arrayBindingPatternElements.map((e) => this.printNode(e, 0));\n const syntheticName = parsedArrayBindingElements.join(\"\") + \"Variable\";\n\n let arrayBindingStatement = `std::any ${syntheticName} = ${this.printNode(right, 0)};\\n`;\n\n parsedArrayBindingElements.forEach((e, index) => {\n const statement = this.getIden(identation) + `${e} = ::getValue(${syntheticName}, ${index})`;\n if (index < parsedArrayBindingElements.length - 1) {\n arrayBindingStatement += statement + \";\\n\";\n } else {\n // printStatement adds the last ;\n arrayBindingStatement += statement;\n }\n });\n\n return arrayBindingStatement;\n }\n\n if (op === SyntaxKind.InKeyword) {\n return `inOp(${this.printNode(right, 0)}, ${this.printNode(left, 0)})`;\n }\n\n const leftText = this.printNode(left, 0);\n const rightText = this.printNode(right, 0);\n\n if (op === SyntaxKind.PlusEqualsToken) {\n return `${leftText} = add(${leftText}, ${rightText})`;\n }\n\n if (op === SyntaxKind.MinusEqualsToken) {\n return `${leftText} = subtract(${leftText}, ${rightText})`;\n }\n\n if (op === SyntaxKind.EqualsToken) {\n // handle dict['a'] = 3 and list[0] = 3\n if (left.kind === SyntaxKind.ElementAccessExpression) {\n const elementAccess = left;\n const target = this.printNode(elementAccess.expression, 0);\n const propName = this.printNode(elementAccess.argumentExpression, 0);\n return `::setValue(${target}, ${propName}, ${rightText})`;\n }\n }\n\n if (op in this.binaryExpressionsWrappers) {\n const wrapper = this.binaryExpressionsWrappers[op];\n const open = wrapper[0];\n const close = wrapper[1];\n return `${open}${leftText}, ${rightText}${close}`;\n }\n\n return undefined;\n }\n\n printVariableDeclarationList(node,identation) {\n const declaration = node.declarations[0];\n\n // handle array binding : input: const [a,b] = this.method()\n // output: std::any abVariable = this.method(); std::any a = getValue(abVariable, 0); ...\n if (declaration?.name.kind === SyntaxKind.ArrayBindingPattern) {\n const arrayBindingPattern = declaration.name;\n const arrayBindingPatternElements = arrayBindingPattern.elements;\n const parsedArrayBindingElements = arrayBindingPatternElements.map((e) => this.printNode(e.name, 0));\n const syntheticName = parsedArrayBindingElements.join(\"\") + \"Variable\";\n\n let arrayBindingStatement = `${this.getIden(identation)}std::any ${syntheticName} = ${this.printNode(declaration.initializer, 0)};\\n`;\n\n parsedArrayBindingElements.forEach((e, index) => {\n const statement = this.getIden(identation) + `std::any ${e} = ::getValue(${syntheticName}, ${index})`;\n if (index < parsedArrayBindingElements.length - 1) {\n arrayBindingStatement += statement + \";\\n\";\n } else {\n // printStatement adds the last ;\n arrayBindingStatement += statement;\n }\n });\n\n return arrayBindingStatement;\n }\n\n const isNew = declaration.initializer && (declaration.initializer.kind === SyntaxKind.NewExpression);\n let className = undefined;\n if (isNew) {\n className = declaration.initializer.expression.text;\n }\n const varToken = isNew ? className + ' ' : this.VAR_TOKEN + ' ' ;\n\n // handle default undefined initialization: let id: Str;\n if (declaration.initializer === undefined) {\n return this.getIden(identation) + this.VAR_TOKEN + ' ' + this.printNode(declaration.name) + \" = \" + this.UNDEFINED_TOKEN;\n }\n const parsedValue = this.printNode(declaration.initializer, identation).trimStart();\n return this.getIden(identation) + varToken + this.printNode(declaration.name) + \" = \" + parsedValue;\n }\n\n printFunctionDefinition(node, identation) {\n let name = node.name.text;\n name = this.transformFunctionNameIfNeeded(name);\n\n const parsedArgs = node.parameters.map(param => this.printParameter(param)).join(\", \");\n\n let returnType = this.printFunctionType(node);\n returnType = returnType ? returnType + \" \" : returnType;\n\n const functionDef = this.getIden(identation) + returnType + name\n + \"(\" + parsedArgs + \")\";\n\n return functionDef;\n }\n\n printInstanceOfExpression(node, identation) {\n const left = this.printNode(node.left, 0);\n const right = node.right.text;\n return this.getIden(identation) + `(dynamic_cast(&(${left})) != nullptr)`;\n }\n\n printAsExpression(node, identation) {\n return this.printNode(node.expression, identation);\n }\n\n printParameter(node, defaultValue = true) {\n const name = this.printNode(node.name, 0);\n const initializer = node.initializer;\n\n if (defaultValue) {\n if (initializer) {\n return this.DEFAULT_PARAMETER_TYPE + \" \" + name + this.SPACE_DEFAULT_PARAM + \"=\" + this.SPACE_DEFAULT_PARAM + this.printNode(initializer, 0);\n }\n return this.DEFAULT_PARAMETER_TYPE + \" \" + name;\n }\n return name;\n }\n\n printFunctionType(node){\n if (!this.requiresReturnType) {\n return \"\";\n }\n\n if (this.asyncTranspiling && this.isAsyncFunction(node)) {\n return `std::shared_future<${this.DEFAULT_RETURN_TYPE}>`;\n }\n\n const typeText = this.getFunctionType(node);\n if (typeText === this.VOID_KEYWORD) {\n return this.VOID_KEYWORD;\n }\n return this.DEFAULT_RETURN_TYPE;\n }\n\n printMethodDefinition(node, identation) {\n let name = node.name.text;\n name = this.transformMethodNameIfNeeded(name);\n\n let returnType = this.printFunctionType(node);\n\n const methodOverride = this.getMethodOverride(node) as any;\n const isOverride = methodOverride !== undefined;\n const virtualPrefix = isOverride ? \"\" : \"virtual \";\n const overrideSuffix = isOverride ? \" override\" : \"\";\n\n // keep the overridden method's return type so the signatures match\n if (isOverride) {\n returnType = this.printFunctionType(methodOverride);\n }\n\n const parsedArgs = this.printMethodParameters(node);\n\n returnType = returnType ? returnType + \" \" : returnType;\n\n const methodToken = this.METHOD_TOKEN ? this.METHOD_TOKEN + \" \" : \"\";\n const methodDef = this.getIden(identation) + virtualPrefix + returnType + methodToken + name\n + \"(\" + parsedArgs + \")\" + overrideSuffix;\n\n return this.printNodeCommentsIfAny(node, identation, methodDef);\n }\n\n printPropertyDeclaration(node, identation) {\n const name = this.printNode(node.name, 0);\n if (node.initializer) {\n const initializer = this.printNode(node.initializer, 0);\n return this.getIden(identation) + 'std::any ' + name + \" = \" + initializer + this.LINE_TERMINATOR;\n }\n return this.getIden(identation) + 'std::any ' + name + this.LINE_TERMINATOR;\n }\n\n printArrayLiteralExpression(node) {\n const elements = node.elements.map((e) => {\n return this.printNode(e);\n }).join(\", \");\n return this.ARRAY_OPENING_TOKEN + elements + this.ARRAY_CLOSING_TOKEN;\n }\n\n printArrayIsArrayCall(node, identation, parsedArg = undefined) {\n return `isArray(${parsedArg})`;\n }\n\n printObjectKeysCall(node, identation, parsedArg = undefined) {\n return `getObjectKeys(${parsedArg})`;\n }\n\n printObjectValuesCall(node, identation, parsedArg = undefined) {\n return `getObjectValues(${parsedArg})`;\n }\n\n printJsonParseCall(node, identation, parsedArg = undefined) {\n return `parseJson(${parsedArg})`;\n }\n\n printJsonStringifyCall(node, identation, parsedArg = undefined) {\n return `jsonStringify(${parsedArg})`;\n }\n\n printPromiseAllCall(node, identation, parsedArg = undefined) {\n return `promiseAll(${parsedArg})`;\n }\n\n printMathFloorCall(node, identation, parsedArg = undefined) {\n return `mathFloor(${parsedArg})`;\n }\n\n printMathRoundCall(node, identation, parsedArg = undefined) {\n return `mathRound(${parsedArg})`;\n }\n\n printMathCeilCall(node, identation, parsedArg = undefined) {\n return `mathCeil(${parsedArg})`;\n }\n\n printNumberIsIntegerCall(node: any, identation: any, parsedArg?: any) {\n return `isInteger(${parsedArg})`;\n }\n\n printArrayPushCall(node, identation, name = undefined, parsedArg = undefined) {\n return `arrayPush(${name}, ${parsedArg})`;\n }\n\n printIncludesCall(node, identation, name = undefined, parsedArg = undefined) {\n return `includes(${name}, ${parsedArg})`;\n }\n\n printIndexOfCall(node, identation, name = undefined, parsedArg = undefined) {\n return `${this.INDEXOF_WRAPPER_OPEN}${name}, ${parsedArg}${this.INDEXOF_WRAPPER_CLOSE}`;\n }\n\n printStartsWithCall(node, identation, name = undefined, parsedArg = undefined) {\n return `startsWith(${name}, ${parsedArg})`;\n }\n\n printEndsWithCall(node, identation, name = undefined, parsedArg = undefined) {\n return `endsWith(${name}, ${parsedArg})`;\n }\n\n printTrimCall(node, identation, name = undefined) {\n return `trim(${name})`;\n }\n\n printJoinCall(node, identation, name = undefined, parsedArg = undefined) {\n return `join(${name}, ${parsedArg})`;\n }\n\n printSplitCall(node, identation, name = undefined, parsedArg = undefined) {\n return `split(${name}, ${parsedArg})`;\n }\n\n printConcatCall(node, identation, name = undefined, parsedArg = undefined) {\n return `concat(${name}, ${parsedArg})`;\n }\n\n printToFixedCall(node, identation, name = undefined, parsedArg = undefined) {\n return `toFixed(${name}, ${parsedArg})`;\n }\n\n printToStringCall(node, identation, name = undefined) {\n return `toString(${name})`;\n }\n\n printToUpperCaseCall(node, identation, name = undefined) {\n return `toUpperCase(${name})`;\n }\n\n printToLowerCaseCall(node, identation, name = undefined) {\n return `toLowerCase(${name})`;\n }\n\n printShiftCall(node, identation, name = undefined) {\n return `shift(${name})`;\n }\n\n printReverseCall(node, identation, name = undefined) {\n return `reverse(${name})`;\n }\n\n printPopCall(node, identation, name = undefined) {\n return `pop(${name})`;\n }\n\n printAssertCall(node, identation, parsedArgs) {\n return `assertTrue(${parsedArgs})`;\n }\n\n printSliceCall(node, identation, name = undefined, parsedArg = undefined, parsedArg2 = undefined) {\n if (parsedArg2 === undefined){\n parsedArg2 = this.UNDEFINED_TOKEN;\n }\n return `slice(${name}, ${parsedArg}, ${parsedArg2})`;\n }\n\n printReplaceCall(node, identation, name = undefined, parsedArg = undefined, parsedArg2 = undefined) {\n return `replace(${name}, ${parsedArg}, ${parsedArg2})`;\n }\n\n printReplaceAllCall(node, identation, name = undefined, parsedArg = undefined, parsedArg2 = undefined) {\n return `replaceAll(${name}, ${parsedArg}, ${parsedArg2})`;\n }\n\n printPadEndCall(node, identation, name, parsedArg, parsedArg2) {\n return `padEnd(${name}, ${parsedArg}, ${parsedArg2})`;\n }\n\n printPadStartCall(node, identation, name, parsedArg, parsedArg2) {\n return `padStart(${name}, ${parsedArg}, ${parsedArg2})`;\n }\n\n printDateNowCall(node, identation) {\n return \"getCurrentTimestamp()\";\n }\n\n printLengthProperty(node, identation, name = undefined) {\n const leftSide = this.printNode(node.expression, 0);\n const type = (this.getChecker() as Checker).getTypeAtLocation(node.expression); // eslint-disable-line\n this.warnIfAnyType(node, type.flags, leftSide, \"length\");\n return this.isStringType(type.flags) ? `getStringLength(${leftSide})` : `${this.ARRAY_LENGTH_WRAPPER_OPEN}${leftSide}${this.ARRAY_LENGTH_WRAPPER_CLOSE}`;\n }\n\n printPostFixUnaryExpression(node, identation) {\n const {operand, operator} = node;\n if (operand.kind === SyntaxKind.NumericLiteral) {\n return super.printPostFixUnaryExpression(node, identation);\n }\n const leftSide = this.printNode(operand, 0);\n const op = this.PostFixOperators[operator];\n if (op === '--') {\n return `postFixDecrement(${leftSide})`;\n }\n return `postFixIncrement(${leftSide})`;\n }\n\n printPrefixUnaryExpression(node, identation) {\n const {operand, operator} = node;\n if (operand.kind === SyntaxKind.NumericLiteral) {\n return super.printPrefixUnaryExpression(node, identation);\n }\n if (operator === SyntaxKind.ExclamationToken) {\n // not branch check falsy/truthy values if needed;\n return this.PrefixFixOperators[operator] + this.printCondition(node.operand, 0);\n }\n const leftSide = this.printNode(operand, 0);\n if (operator === SyntaxKind.PlusToken) {\n return `prefixUnaryPlus(${leftSide})`;\n } else {\n return `prefixUnaryNeg(${leftSide})`;\n }\n }\n\n printConditionalExpression(node, identation) {\n const condition = this.printCondition(node.condition, 0);\n const whenTrue = this.printNode(node.whenTrue, 0);\n const whenFalse = this.printNode(node.whenFalse, 0);\n\n // wrap both branches in std::any so the ternary has one common type\n return `(${condition} ? std::any(${whenTrue}) : std::any(${whenFalse}))`;\n }\n\n printDeleteExpression(node, identation) {\n const object = this.printNode (node.expression.expression, 0);\n const key = this.printNode (node.expression.argumentExpression, 0);\n return `deleteKey(${object}, ${key})`;\n }\n\n printThrowStatement(node, identation) {\n if (node.expression.kind === SyntaxKind.Identifier) {\n return this.getIden(identation) + this.THROW_TOKEN + ' ' + this.printNode(node.expression, 0) + this.LINE_TERMINATOR;\n }\n if (node.expression.kind === SyntaxKind.NewExpression) {\n const expression = node.expression;\n // handle throw new Error (message) and throw new x[a] (message)\n const argumentsExp = expression?.arguments ?? [];\n const parsedArg = argumentsExp.map(n => this.printNode(n, 0)).join(\", \") ?? '';\n const newExpression = this.printNode(expression.expression, 0);\n if (expression.expression.kind === SyntaxKind.Identifier) {\n const id = expression.expression;\n const symbol = this.getChecker().getSymbolAtLocation(expression.expression);\n if (symbol) {\n const declarations = (this.getChecker().getDeclaredTypeOfSymbol(symbol).getSymbol()?.declarations ?? []).map((d) => d.resolve());\n const isClassDeclaration = declarations.find(l => l.kind === SyntaxKind.InterfaceDeclaration || l.kind === SyntaxKind.ClassDeclaration);\n if (isClassDeclaration){\n return this.getIden(identation) + `${this.THROW_TOKEN} ${id.text}(toString(${parsedArg}))${this.LINE_TERMINATOR}`;\n }\n return this.getIden(identation) + `throwDynamicException(${id.text}, ${parsedArg})${this.LINE_TERMINATOR}`;\n }\n return this.getIden(identation) + `${this.THROW_TOKEN} ${newExpression}(${parsedArg})${this.LINE_TERMINATOR}`;\n } else if (expression.expression.kind === SyntaxKind.ElementAccessExpression) {\n return this.getIden(identation) + `throwDynamicException(${newExpression}, ${parsedArg})${this.LINE_TERMINATOR}`;\n }\n return super.printThrowStatement(node, identation);\n }\n return super.printThrowStatement(node, identation);\n }\n\n getExceptionalAccessTokenIfAny(node) {\n const leftSide = node.expression;\n const leftSideText = this.printNode(leftSide, 0);\n if (leftSideText === this.THIS_TOKEN) {\n return '->';\n }\n return undefined;\n }\n}\n"]} \ No newline at end of file +{"version":3,"sources":["../src/dirname.cjs","../src/transpiler.ts","../src/pythonTranspiler.ts","../src/baseTranspiler.ts","../src/types.ts","../src/utils.ts","../src/logger.ts","../src/phpTranspiler.ts","../src/csharpTranspiler.ts","../src/goTranspiler.ts","../src/javaTranspiler.ts","../src/rustTranspiler.ts","../src/cppTranspiler.ts"],"names":["SyntaxKind","API","ElementFlags","IndexKind","ObjectFlags","SignatureKind","SymbolFlags","TypeFlags","defaultValue","type","node","namedExports","isArrowFunction","isCallExpression","isFunctionDeclaration","isFunctionExpression","parserConfig","isArrayLiteralExpression","isBinaryExpression","isBooleanLiteral","isClassDeclaration","isMethodDeclaration","isNumericLiteral","isObjectLiteralExpression","isSourceFile","isStringLiteralLikeNode","symbol","named","isStringLiteral","printedKey","path","fs","getLeadingCommentRanges","isBlock","isElementAccessExpression","isExpressionStatement","isIfStatement","isReturnStatement","isThrowStatement","name","rhs","native","level","isStatement","whenTrue","whenFalse","isAsExpression","isBreakStatement","isConditionalExpression","isContinueStatement","isIdentifier","isParameterDeclaration","isParenthesizedExpression","isPostfixUnaryExpression","isPrefixUnaryExpression","isPropertyAccessExpression","isSpreadAssignment","isSpreadElement","isTypeAssertion","isVariableDeclaration","target","NodeFlags","isClassExpression","isDeleteExpression","isForInStatement","isForOfStatement","isNonNullExpression","isShorthandPropertyAssignment","accessor","args","text","value","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OAAO,OAAwB;AAC9E,SAAK,kBAAkB,QAAQ;AAC/B,WAAO,KAAK,WAAW,UAAU,sBAAgC,UAAU,MAAM,KAAK;AAAA,EAC1F;AAAA,EAEA,sBAAsB,UAAmC;AACrD,WAAO,KAAK,gCAAkC,UAAU,CAAC,KAAK,WAAW,iBAAiB,gBAAgB;AAAA,EAC9G;AAAA,EAEA,mBAAmB,UAAmC;AAClD,WAAO,KAAK,6BAA+B,UAAU,CAAC,KAAK,WAAW,cAAc,gBAAgB;AAAA,EACxG;AAAA,EAEA,sBAAsB,UAAmC;AACrD,WAAO,KAAK,gCAAkC,QAAQ;AAAA,EAC1D;AAAA,EAEA,kBAAkB,UAAmC;AACjD,WAAO,KAAK,4BAA8B,QAAQ;AAAA,EACtD;AAAA,EAEA,oBAAoB,UAAmC;AACnD,WAAO,KAAK,8BAAgC,QAAQ;AAAA,EACxD;AAAA,EAEA,oBAAoB,UAAmC;AACnD,WAAO,KAAK,8BAAgC,QAAQ;AAAA,EACxD;AAAA,EAEA,mBAAmB,UAAmC;AAClD,WAAO,KAAK,6BAA+B,QAAQ;AAAA,EACvD;AACJ","sourcesContent":["// https://github.com/kulshekhar/ts-jest/issues/1174\nmodule.exports = __dirname;","import { ScriptTarget, SyntaxKind, type Node, type SourceFile } from \"typescript/unstable/ast\";\nimport { API, CheckFlags, ElementFlags, IndexKind, ObjectFlags, SignatureKind, SymbolFlags, TypeFlags, TypeFormatFlags, type Checker, type CompilerOptions, type Program, type Snapshot } from \"typescript/unstable/sync\";\nimport currentPath from \"./dirname.cjs\";\nimport { PythonTranspiler } from './pythonTranspiler.js';\nimport { PhpTranspiler } from './phpTranspiler.js';\nimport { CSharpTranspiler } from './csharpTranspiler.js';\nimport * as path from \"path\";\nimport * as fs from \"fs\";\nimport { Logger } from './logger.js';\nimport { Languages, TranspilationMode, IFileExport, IFileImport, ITranspiledFile, IInput, ITranspileContext, ITranspileProgramCache } from './types.js';\nimport { GoTranspiler, alignGoTrailingComments } from './goTranspiler.js';\nimport { JavaTranspiler } from './javaTranspiler.js';\nimport { RustTranspiler, RUST_DECLARED_DICT_LOCALS } from './rustTranspiler.js';\nimport type { RustDeclaredDictLocalEntry } from './rustTranspiler.js';\nimport { CppTranspiler } from './cppTranspiler.js';\n\nconst __dirname_mock = currentPath;\n\n// minimal type environment: skip the auto-included @types/* packages (with empty\n// options typescript scans node_modules/@types and pulls every package it finds —\n// 160+ extra files) and replace the default es5+dom lib (lib.dom.d.ts alone is ~8MB)\n// with the es-only lib chain. Neither dom nor @types globals affect transpilation\n// output, but they dominate program creation time (~10x) and make the type\n// environment depend on whatever @types happen to be installed in the host project.\nconst fastCompilerOptions: CompilerOptions = {\n target: ScriptTarget.Latest,\n lib: [\"lib.esnext.d.ts\"],\n types: [],\n};\n\n// the host globals (console, Buffer, setTimeout, ...) previously came from the\n// auto-included @types packages; declare them here so references to them neither\n// produce \"Cannot find name\" diagnostics nor trigger typescript's (very expensive)\n// spelling-suggestion scans while computing those diagnostics\nconst globalsShim = `\ndeclare var require: any;\ndeclare var module: any;\ndeclare var exports: any;\ndeclare var console: any;\ndeclare var process: any;\ndeclare var Buffer: any;\ndeclare var __dirname: string;\ndeclare var __filename: string;\ndeclare var setTimeout: any;\ndeclare var clearTimeout: any;\ndeclare var setInterval: any;\ndeclare var clearInterval: any;\ndeclare var setImmediate: any;\ndeclare var fetch: any;\ndeclare var URL: any;\ndeclare var URLSearchParams: any;\ndeclare var TextEncoder: any;\ndeclare var TextDecoder: any;\ndeclare var crypto: any;\ndeclare var performance: any;\ndeclare var AbortController: any;\ndeclare var WebSocket: any;\ndeclare var atob: any;\ndeclare var btoa: any;\n`;\nconst globalsShimPath = path.resolve(path.join(__dirname_mock, \"__globals-shim.d.ts\"));\n\n// transpiling one file to several languages queries the checker repeatedly for the\n// same nodes (identifiers, binary operands, conditions). Types and symbols are\n// deterministic per (checker, node), so memoize the two hot lookups on the checker\n// instance itself — the caches die with the checker when a new program is created\nconst UNDEFINED_SENTINEL = Symbol(\"undefined\");\n// unary checker queries keyed by a snapshot object (node / type / symbol / signature);\n// the API returns registry-interned objects, so object identity is a stable key\nconst MEMOIZED_UNARY_CHECKER_METHODS = [\n \"getTypeAtLocation\", \"getSymbolAtLocation\", \"getResolvedSignature\", \"getContextualType\",\n \"getSignaturesOfType\", \"getSymbolOfType\", \"getReturnTypeOfSignature\", \"getSignatureFromDeclaration\",\n \"isArrayType\", \"isArrayLikeType\", \"isTupleType\", \"getTypeArguments\", \"getTypeFromTypeNode\",\n \"getDeclaredTypeOfSymbol\", \"getTypeOfSymbol\", \"getAliasedSymbol\", \"getBaseTypeOfLiteralType\",\n \"getApparentType\", \"getPropertiesOfType\", \"getNonNullableType\", \"getIndexInfosOfType\",\n];\nfunction memoizeCheckerCalls(checker: Checker): void {\n if ((checker as any).__astTranspilerMemoized) {\n return;\n }\n (checker as any).__astTranspilerMemoized = true;\n for (const name of MEMOIZED_UNARY_CHECKER_METHODS) {\n memoizeUnaryMethod(checker, name);\n }\n // typeToString(type) with no extra args is the only form worth caching\n memoizeUnaryMethod(checker, \"typeToString\");\n // (type, kind) pairs: a WeakMap per kind\n memoizeBinaryKindMethod(checker, \"getSignaturesOfType\");\n memoizeBinaryKindMethod(checker, \"getIndexTypeOfType\");\n memoizeBinaryKindMethod(checker, \"getIndexInfoOfType\");\n memoizePairMethod(checker, \"getTypeOfSymbolAtLocation\");\n}\n\n// (object, object) pairs, e.g. getTypeOfSymbolAtLocation(symbol, node); seed2 fills it from a prefetch\nfunction memoizePairMethod(owner: object, name: string): void {\n const original = owner[name];\n if (typeof original !== \"function\") {\n return;\n }\n const cache = new WeakMap>();\n const seed2 = (a: object, b: object, value: unknown) => {\n let inner = cache.get(a);\n if (inner === undefined) {\n cache.set(a, inner = new WeakMap());\n }\n inner.set(b, value === undefined ? UNDEFINED_SENTINEL : value);\n };\n const wrapped = function (this: unknown, ...args: unknown[]) {\n const [a, b] = args;\n if (args.length !== 2 || a === null || typeof a !== \"object\" || b === null || typeof b !== \"object\") {\n return original.apply(owner, args);\n }\n const cached = cache.get(a as object)?.get(b as object);\n if (cached !== undefined) {\n return cached === UNDEFINED_SENTINEL ? undefined : cached;\n }\n const result = original.call(owner, a, b);\n seed2(a as object, b as object, result);\n return result;\n };\n (wrapped as any).gen = (original as any).gen;\n (wrapped as any).original = original;\n (wrapped as any).seed2 = seed2;\n Object.defineProperty(owner, name, { configurable: true, value: wrapped });\n}\n\n// the TS7 checker exposes its methods as prototype getters: shadow them on the instance.\n// Only single-object-argument calls are cached; anything else goes straight through.\nfunction memoizeUnaryMethod(owner: object, name: string): void {\n const original = owner[name];\n if (typeof original !== \"function\") {\n return;\n }\n const cache = new WeakMap();\n const wrapped = function (this: unknown, ...args: unknown[]) {\n const key = args[0];\n if (args.length !== 1 || key === null || typeof key !== \"object\" || Array.isArray(key)) {\n return original.apply(owner, args);\n }\n const cached = cache.get(key);\n if (cached !== undefined) {\n return cached === UNDEFINED_SENTINEL ? undefined : cached;\n }\n const result = original.call(owner, key);\n cache.set(key, result === undefined ? UNDEFINED_SENTINEL : result);\n return result;\n };\n (wrapped as any).gen = (original as any).gen;\n (wrapped as any).original = original;\n // prefetch support: seed(key, value) fills the cache; has(key) tells whether it is filled\n (wrapped as any).seed = (key: object, value: unknown) => cache.set(key, value === undefined ? UNDEFINED_SENTINEL : value);\n (wrapped as any).has = (key: object) => cache.has(key);\n Object.defineProperty(owner, name, { configurable: true, value: wrapped });\n}\n\nfunction memoizeBinaryKindMethod(owner: object, name: string): void {\n const unary = owner[name];\n const original = (unary as any)?.original ?? unary;\n if (typeof original !== \"function\") {\n return;\n }\n const caches = new Map>();\n const wrapped = function (this: unknown, ...args: unknown[]) {\n const key = args[0];\n if (args.length === 1) {\n return unary.call(owner, key);\n }\n if (args.length !== 2 || key === null || typeof key !== \"object\" || typeof args[1] !== \"number\") {\n return original.apply(owner, args);\n }\n let cache = caches.get(args[1]);\n if (cache === undefined) {\n caches.set(args[1], cache = new WeakMap());\n }\n const cached = cache.get(key);\n if (cached !== undefined) {\n return cached === UNDEFINED_SENTINEL ? undefined : cached;\n }\n const result = original.call(owner, key, args[1]);\n cache.set(key, result === undefined ? UNDEFINED_SENTINEL : result);\n return result;\n };\n (wrapped as any).gen = (original as any).gen;\n Object.defineProperty(owner, name, { configurable: true, value: wrapped });\n}\n\n// Batch pre-resolve: walk `root` once and resolve, in one round trip per method, the\n// types/symbols of the node kinds the printers ask about, seeding the memo caches above.\n// Results are identical to per-node calls; nodes the printers never ask about only cost payload.\nconst PREFETCH_TYPE_KINDS = new Set([\n SyntaxKind.Identifier, SyntaxKind.PropertyAccessExpression, SyntaxKind.ElementAccessExpression,\n SyntaxKind.CallExpression, SyntaxKind.BinaryExpression, SyntaxKind.StringLiteral, SyntaxKind.TypeReference,\n SyntaxKind.MethodDeclaration, SyntaxKind.AnyKeyword, SyntaxKind.StringKeyword, SyntaxKind.NumberKeyword,\n SyntaxKind.ArrayType, SyntaxKind.NumericLiteral,\n]);\nconst PREFETCH_BATCH = 4096;\nfunction prefetchChecker(checker: Checker, root: Node, options: { types?: boolean, symbols?: boolean, signatures?: boolean } = {}): void {\n const wantTypes = options.types ?? true, wantSymbols = options.symbols ?? true, wantSignatures = options.signatures ?? true;\n const getType = checker.getTypeAtLocation as any, getSymbol = checker.getSymbolAtLocation as any, getSig = checker.getResolvedSignature as any;\n const typeNodes: Node[] = [], symbolNodes: Node[] = [], callNodes: Node[] = [];\n const visit = (node: Node) => {\n const kind = node.kind;\n if (wantTypes && PREFETCH_TYPE_KINDS.has(kind) && !getType.has?.(node)) typeNodes.push(node);\n if (wantSymbols && kind === SyntaxKind.Identifier && !getSymbol.has?.(node)) symbolNodes.push(node);\n if (wantSignatures && kind === SyntaxKind.CallExpression && !getSig.has?.(node)) callNodes.push(node);\n node.forEachChild(visit);\n };\n visit(root);\n const run = (nodes: Node[], fn: any) => {\n if (fn?.seed === undefined || fn.original === undefined) return;\n for (let i = 0; i < nodes.length; i += PREFETCH_BATCH) {\n const chunk = nodes.slice(i, i + PREFETCH_BATCH);\n let results: unknown[];\n try {\n results = fn.original(chunk);\n } catch {\n continue; // leave this chunk to the lazy per-node path\n }\n chunk.forEach((n, j) => fn.seed(n, results[j]));\n }\n };\n run(typeNodes, getType);\n run(symbolNodes, getSymbol);\n // no bulk getResolvedSignature: pipeline the per-call requests through api.batch\n const api = (checker as any).__astTranspilerApi as API | undefined;\n if (callNodes.length > 0 && getSig?.seed !== undefined && api !== undefined && getSig.original?.gen !== undefined) {\n for (let i = 0; i < callNodes.length; i += PREFETCH_BATCH) {\n const chunk = callNodes.slice(i, i + PREFETCH_BATCH);\n const gens = chunk.map((n) => {\n const g = getSig.original.gen(n);\n // a call the checker cannot resolve must not fail the whole batch\n return (function* () { try { return yield* g; } catch { return PREFETCH_FAILED; } })();\n });\n const results = api.batch(...gens) as unknown[];\n chunk.forEach((n, j) => { if (results[j] !== PREFETCH_FAILED) getSig.seed(n, results[j]); });\n }\n }\n if (wantSignatures && api !== undefined) {\n prefetchDeclarationSignatures(checker, api, root);\n }\n}\n\n// Warm the per-declaration chains baseTranspiler walks for every method/function\n// (getFunctionType, getReturnTypeFromMethod) in one pipelined batch per level\nfunction prefetchDeclarationSignatures(checker: Checker, api: API, root: Node): void {\n const getSigDecl = checker.getSignatureFromDeclaration as any;\n const getTypeOfSymbolAtLocation = (checker as any).getTypeOfSymbolAtLocation;\n if (getSigDecl?.seed === undefined || getSigDecl.original?.gen === undefined) return;\n const decls: Node[] = [];\n const visit = (node: Node) => {\n if (node.kind === SyntaxKind.MethodDeclaration || node.kind === SyntaxKind.FunctionDeclaration) decls.push(node);\n node.forEachChild(visit);\n };\n visit(root);\n const safe = (g: Generator) => (function* () { try { return yield* g; } catch { return PREFETCH_FAILED; } })();\n for (let i = 0; i < decls.length; i += PREFETCH_BATCH) {\n const chunk = decls.slice(i, i + PREFETCH_BATCH);\n api.batch(...chunk.map((decl) => safe((function* () {\n const sig = getSigDecl.has(decl) ? getSigDecl(decl) : yield* getSigDecl.original.gen(decl);\n getSigDecl.seed(decl, sig);\n if (sig !== undefined) yield* sig.getReturnType.gen();\n })())));\n // getReturnTypeFromMethod: type -> symbol -> type of symbol at its declaration -> call signatures\n api.batch(...chunk.map((decl) => safe((function* () {\n const type = checker.getTypeAtLocation(decl) as any;\n const symbol = type?.getSymbol?.gen !== undefined ? yield* type.getSymbol.gen() : undefined;\n const location = symbol?.valueDeclaration?.resolve();\n if (location === undefined || getTypeOfSymbolAtLocation?.seed2 === undefined) return;\n const symbolType = yield* getTypeOfSymbolAtLocation.original.gen(symbol, location);\n getTypeOfSymbolAtLocation.seed2(symbol, location, symbolType);\n yield* symbolType.getCallSignatures.gen();\n })())));\n }\n}\nconst PREFETCH_FAILED = Symbol(\"prefetchFailed\");\nconst prefetchedFiles = new WeakSet();\n\n// program-wide diagnostics are identical for every file of a program: fetch them once\ntype ProgramWideDiagnostics = { program: readonly { text: string }[], global: readonly { text: string }[] };\nconst programDiagnosticsCache = new WeakMap();\nfunction getProgramWideDiagnostics(program: Program): ProgramWideDiagnostics {\n let diagnostics = programDiagnosticsCache.get(program);\n if (diagnostics === undefined) {\n diagnostics = { program: program.getProgramDiagnostics(), global: program.getGlobalDiagnostics() };\n programDiagnosticsCache.set(program, diagnostics);\n }\n return diagnostics;\n}\n\n// one TS7 API server per isolate unless a cache brings its own\nlet processApi: API | undefined;\nfunction getApi(cache: ITranspileProgramCache): API {\n cache.api ??= (processApi ??= new API({ cwd: process.cwd() }));\n return cache.api;\n}\n\n// a snapshot with one synthetic program over rootFiles; `files` overlays virtual file contents\nfunction createSnapshotProgram(cache: ITranspileProgramCache, rootFiles: string[], files: Record): [Snapshot, Program, Checker] {\n const snapshot = getApi(cache).createSnapshot({\n fileSystem: { kind: \"layer\", files },\n createPrograms: [{ rootFiles: rootFiles.map((f) => path.resolve(f)), compilerOptions: fastCompilerOptions }],\n });\n const program = snapshot.operation.createdPrograms[0];\n const checker = snapshot.getProjects().find((p) => p.program === program).checker;\n memoizeCheckerCalls(checker);\n (checker as any).__astTranspilerApi = getApi(cache);\n return [snapshot, program, checker];\n}\n\nexport default class Transpiler {\n config;\n pythonTranspiler: PythonTranspiler;\n phpTranspiler: PhpTranspiler;\n csharpTranspiler: CSharpTranspiler;\n goTranspiler: GoTranspiler;\n javaTranspiler: JavaTranspiler;\n rustTranspiler: RustTranspiler;\n cppTranspiler: CppTranspiler;\n // ByPath transpilation cache: parsed SourceFiles (libs + the whole import graph)\n // are reused across createProgram calls — without this every transpile*ByPath call\n // re-parses the full import closure of the target file (~1s+ per file on big repos).\n // Lives in a standalone object so several Transpiler instances on the same thread\n // can be pointed at one cache (see Transpiler.createProgramCache).\n private programCache: ITranspileProgramCache;\n // typescript state of the transpilation in flight, shared with the language printers\n private context: ITranspileContext | undefined;\n // the snapshot behind the current single-file context\n private snapshot: Snapshot | undefined;\n // batch pre-resolve each source file's checker queries before printing it (config.prefetch=false disables)\n prefetch: boolean;\n\n // batch pre-resolve for callers that query the checker themselves (build hooks):\n // one round trip per method for every relevant node under `root`\n static prefetchChecker(checker: Checker, root: Node, options?: { types?: boolean, symbols?: boolean, signatures?: boolean }): void {\n prefetchChecker(checker, root, options);\n }\n\n // A program cache holds parsed typescript SourceFiles and the last program built\n // from them. Hand the same cache to several Transpiler instances to reuse one\n // parse/typecheck of the es lib chain and of every shared import across all of\n // them. Callers that need isolation simply omit it and get a private cache.\n //\n // Same-thread only: these are live V8 objects, so a cache cannot be posted to a\n // worker_threads isolate — give each worker its own long-lived cache instead.\n static createProgramCache(): ITranspileProgramCache {\n return {};\n }\n\n constructor(config = {}, programCache?: ITranspileProgramCache) {\n this.config = config;\n this.programCache = programCache ?? Transpiler.createProgramCache();\n this.prefetch = config[\"prefetch\"] ?? true;\n const phpConfig = config[\"php\"] || {};\n const pythonConfig = config[\"python\"] || {};\n const csharpConfig = config[\"csharp\"] || {};\n const goConfig = config[\"go\"] || {};\n const javaConfig = config[\"java\"] || {};\n const rustConfig = config[\"rust\"] || {};\n const cppConfig = config[\"cpp\"] || {};\n\n if (\"verbose\" in config) {\n Logger.setVerboseMode(Boolean(config['verbose']));\n }\n\n this.pythonTranspiler = new PythonTranspiler(pythonConfig);\n this.phpTranspiler = new PhpTranspiler(phpConfig);\n this.csharpTranspiler = new CSharpTranspiler(csharpConfig);\n this.goTranspiler = new GoTranspiler(goConfig);\n this.javaTranspiler = new JavaTranspiler(javaConfig);\n this.rustTranspiler = new RustTranspiler(rustConfig);\n this.cppTranspiler = new CppTranspiler(cppConfig);\n }\n\n setVerboseMode(verbose: boolean) {\n Logger.setVerboseMode(verbose);\n }\n\n // the cache this instance parses into, to hand to further Transpiler instances\n // that should reuse this one's parsed SourceFiles\n getProgramCache(): ITranspileProgramCache {\n return this.programCache;\n }\n\n // a second Transpiler over the same parsed typescript state, with its own\n // printers and its own transpile context, so both can be driven independently\n // on this thread without either clobbering the other's program\n cloneSharingProgramCache(config = this.config): Transpiler {\n return new Transpiler(config, this.programCache);\n }\n\n // single-file snapshots are released when the next one replaces them; batches own theirs\n private setSnapshotContext(snapshot: Snapshot, program: Program, checker: Checker, fileName: string): ITranspileContext {\n const src = program.getSourceFile(fileName) ?? program.getSourceFile(path.resolve(fileName));\n const previous = this.snapshot;\n this.snapshot = snapshot;\n previous?.dispose();\n return this.setContext({ src, checker, program });\n }\n\n createProgramInMemoryAndSetContext(content): ITranspileContext {\n const inMemoryFilePath = path.resolve(path.join(__dirname_mock, \"__dummy-file.ts\"));\n const [snapshot, program, checker] = createSnapshotProgram(this.programCache, [inMemoryFilePath, globalsShimPath], {\n [inMemoryFilePath]: content,\n [globalsShimPath]: globalsShim,\n });\n return this.setSnapshotContext(snapshot, program, checker, inMemoryFilePath);\n }\n\n createProgramByPathAndSetContext(filePath): ITranspileContext {\n const shared = this.findSharedProgramFile(filePath);\n if (shared !== undefined) {\n return this.setContext(shared);\n }\n const [snapshot, program, checker] = createSnapshotProgram(this.programCache, [filePath, globalsShimPath], { [globalsShimPath]: globalsShim });\n return this.setSnapshotContext(snapshot, program, checker, filePath);\n }\n\n // One snapshot/program for a whole run: later ByPath transpiles of any root (or\n // imported file) of `paths` reuse it instead of building a program per file, as\n // long as the file's text on disk still equals the snapshot's. Replaces any\n // previous shared program; pass [] to drop it.\n setSharedProgram(paths: string[]): void {\n this.programCache.shared?.snapshot.dispose();\n this.programCache.shared = undefined;\n if (paths.length === 0) {\n return;\n }\n const [snapshot, program, checker] = createSnapshotProgram(this.programCache, [...paths, globalsShimPath], { [globalsShimPath]: globalsShim });\n this.programCache.shared = { snapshot, program, checker };\n }\n\n private findSharedProgramFile(filePath: string): ITranspileContext | undefined {\n const shared = this.programCache.shared;\n if (shared === undefined) {\n return undefined;\n }\n const src = shared.program.getSourceFile(path.resolve(filePath));\n if (src === undefined || !fs.existsSync(filePath) || fs.readFileSync(filePath, \"utf8\") !== src.text) {\n return undefined;\n }\n return { src, checker: shared.checker, program: shared.program };\n }\n\n // One program over N root files, so the bind/check work behind the diagnostics\n // pass is paid once for the whole set; files importing each other are fine as\n // separate roots. The batch owns its snapshot until dispose().\n createProgramBatch(paths: string[]): TranspileProgramBatch {\n const [snapshot, program, checker] = createSnapshotProgram(this.programCache, [...paths, globalsShimPath], { [globalsShimPath]: globalsShim });\n return new TranspileProgramBatch(this, snapshot, program, checker);\n }\n\n // the language printers read the typescript state (source file, checker, program)\n // off the context handed to them here, so two Transpiler instances never share\n // state and a nested transpile can restore whatever its caller was working on\n setContext(context: ITranspileContext): ITranspileContext {\n this.context = context;\n this.pythonTranspiler.setContext(context);\n this.phpTranspiler.setContext(context);\n this.csharpTranspiler.setContext(context);\n this.goTranspiler.setContext(context);\n this.javaTranspiler.setContext(context);\n this.rustTranspiler.setContext(context);\n this.cppTranspiler.setContext(context);\n return context;\n }\n\n /** @deprecated renamed to createProgramInMemoryAndSetContext */\n createProgramInMemoryAndSetGlobals(content): ITranspileContext {\n return this.createProgramInMemoryAndSetContext(content);\n }\n\n /** @deprecated renamed to createProgramByPathAndSetContext */\n createProgramByPathAndSetGlobals(path): ITranspileContext {\n return this.createProgramByPathAndSetContext(path);\n }\n\n checkFileDiagnostics(context: ITranspileContext = this.context) {\n // the pass only produces a Logger warning; on TS7 getGlobalDiagnostics forces a\n // whole-program check in tsgo, so skip it when nothing would be printed\n if (!Logger.verbose) {\n return;\n }\n const fileName = context.src.fileName;\n const programWide = getProgramWideDiagnostics(context.program);\n const diagnostics = [\n ...programWide.program,\n ...context.program.getSyntacticDiagnostics(fileName), ...programWide.global,\n ...context.program.getSemanticDiagnostics(fileName),\n ];\n if (diagnostics.length > 0) {\n let errorMessage = \"Errors found in the typescript code. Transpilation might produce invalid results:\\n\";\n diagnostics.forEach( msg => {\n errorMessage+= \" - \" + msg.text + \"\\n\";\n });\n Logger.warning(errorMessage);\n }\n }\n\n transpile(lang: Languages, mode: TranspilationMode, file: string, sync = false, createContext = true, handleImports = true): ITranspiledFile {\n // improve this logic later\n if (createContext) {\n if (mode === TranspilationMode.ByPath) {\n this.createProgramByPathAndSetContext(file);\n } else {\n this.createProgramInMemoryAndSetContext(file);\n }\n\n // check for warnings and errors\n this.checkFileDiagnostics();\n }\n\n const src = this.context.src;\n if (this.prefetch && !prefetchedFiles.has(src)) {\n prefetchedFiles.add(src);\n prefetchChecker(this.context.checker, src);\n }\n\n let transpiledContent = undefined;\n switch(lang) {\n case Languages.Python:\n this.pythonTranspiler.asyncTranspiling = !sync;\n transpiledContent = this.pythonTranspiler.printNode(src, -1);\n this.pythonTranspiler.asyncTranspiling = true; // reset to default\n break;\n case Languages.Php:\n this.phpTranspiler.asyncTranspiling = !sync;\n transpiledContent = this.phpTranspiler.printNode(src, -1);\n this.phpTranspiler.asyncTranspiling = true; // reset to default\n break;\n case Languages.CSharp:\n transpiledContent = this.csharpTranspiler.printNode(src, -1);\n break;\n case Languages.Go:\n // gofmt aligns trailing `//` comments through its tabwriter; the printer has to do\n // that itself so the emitted Go is already gofmt-clean (see alignGoTrailingComments)\n transpiledContent = alignGoTrailingComments (this.goTranspiler.printNode(src, -1));\n break;\n case Languages.Java:\n transpiledContent = this.javaTranspiler.printNode(src, -1);\n break;\n case Languages.Rust:\n transpiledContent = this.rustTranspiler.printNode(src, -1);\n break;\n case Languages.Cpp:\n transpiledContent = this.cppTranspiler.printNode(src, -1);\n break;\n }\n let imports = [];\n let exports = [];\n\n if (handleImports) {\n imports = this.pythonTranspiler.getFileImports(src);\n exports = this.pythonTranspiler.getFileExports(src);\n }\n\n const methodsTypes = this.pythonTranspiler.getMethodTypes(src);\n Logger.success(\"transpilation finished successfully\");\n\n return {\n content: transpiledContent,\n imports,\n exports,\n methodsTypes\n };\n }\n\n transpileDifferentLanguagesGeneric(mode: TranspilationMode, input: IInput[], content: string): ITranspiledFile[] {\n let context: ITranspileContext;\n if (mode === TranspilationMode.ByPath) {\n context = this.createProgramByPathAndSetContext(content);\n } else {\n context = this.createProgramInMemoryAndSetContext(content);\n }\n\n // check for warnings and errors\n this.checkFileDiagnostics(context);\n\n const files = [];\n input.forEach( (inp) => {\n const async = inp.async;\n\n files.push({\n content: this.transpile(inp.language, mode, content, !async, false, false).content\n });\n });\n\n const methodsTypes = this.pythonTranspiler.getMethodTypes(context.src);\n\n const imports = this.pythonTranspiler.getFileImports(context.src);\n const exports = this.pythonTranspiler.getFileExports(context.src);\n\n const output = files.map( (file) => {\n return {\n content: file.content,\n imports,\n exports,\n methodsTypes\n };\n });\n\n return output;\n }\n\n transpileDifferentLanguages(input: any[], content: string): ITranspiledFile[] {\n const config = input.map( (inp) => {\n return {\n language: this.convertStringToLanguageEnum(inp.language),\n async: inp.async\n };\n } );\n return this.transpileDifferentLanguagesGeneric(TranspilationMode.ByContent, config, content);\n }\n\n transpileDifferentLanguagesByPath(input: any[], content: string): ITranspiledFile[] {\n const config = input.map( (inp) => {\n return {\n language: this.convertStringToLanguageEnum(inp.language),\n async: inp.async\n };\n } );\n return this.transpileDifferentLanguagesGeneric(TranspilationMode.ByPath, config, content);\n }\n\n transpilePython(content): ITranspiledFile {\n return this.transpile(Languages.Python, TranspilationMode.ByContent, content, !this.pythonTranspiler.asyncTranspiling);\n }\n\n transpilePythonByPath(path): ITranspiledFile {\n return this.transpile(Languages.Python, TranspilationMode.ByPath, path, !this.pythonTranspiler.asyncTranspiling);\n }\n\n transpilePhp(content): ITranspiledFile {\n return this.transpile(Languages.Php, TranspilationMode.ByContent, content, !this.phpTranspiler.asyncTranspiling);\n }\n\n transpilePhpByPath(path): ITranspiledFile {\n return this.transpile(Languages.Php, TranspilationMode.ByPath, path, !this.phpTranspiler.asyncTranspiling);\n }\n\n transpileCSharp(content): ITranspiledFile {\n return this.transpile(Languages.CSharp, TranspilationMode.ByContent, content);\n }\n\n transpileCSharpByPath(path): ITranspiledFile {\n return this.transpile(Languages.CSharp, TranspilationMode.ByPath, path);\n }\n\n transpileJava(content): ITranspiledFile {\n return this.transpile(Languages.Java, TranspilationMode.ByContent, content);\n }\n\n transpileJavaByPath(path): ITranspiledFile {\n return this.transpile(Languages.Java, TranspilationMode.ByPath, path);\n }\n\n transpileGoByPath(path): ITranspiledFile {\n return this.transpile(Languages.Go, TranspilationMode.ByPath, path);\n }\n\n transpileGo(content): ITranspiledFile {\n return this.transpile(Languages.Go, TranspilationMode.ByContent, content);\n }\n\n transpileRust(content): ITranspiledFile {\n return this.transpile(Languages.Rust, TranspilationMode.ByContent, content);\n }\n\n transpileRustByPath(path): ITranspiledFile {\n return this.transpile(Languages.Rust, TranspilationMode.ByPath, path);\n }\n\n transpileCpp(content): ITranspiledFile {\n return this.transpile(Languages.Cpp, TranspilationMode.ByContent, content);\n }\n\n transpileCppByPath(path): ITranspiledFile {\n return this.transpile(Languages.Cpp, TranspilationMode.ByPath, path);\n }\n\n\n getFileImports(content: string): IFileImport[] {\n const context = this.createProgramInMemoryAndSetContext(content);\n return this.phpTranspiler.getFileImports(context.src);\n }\n\n getFileExports(content: string): IFileExport[] {\n const context = this.createProgramInMemoryAndSetContext(content);\n return this.phpTranspiler.getFileExports(context.src);\n }\n\n setPHPPropResolution(props: string[]) {\n this.phpTranspiler.propRequiresScopeResolutionOperator = props;\n }\n\n setPhpUncamelCaseIdentifiers(uncamelCase: boolean) {\n this.phpTranspiler.uncamelcaseIdentifiers = uncamelCase;\n }\n\n setPythonUncamelCaseIdentifiers(uncamelCase: boolean) {\n this.pythonTranspiler.uncamelcaseIdentifiers = uncamelCase;\n }\n\n setPhpAsyncTranspiling(async: boolean) {\n this.phpTranspiler.asyncTranspiling = async;\n }\n\n setPythonAsyncTranspiling(async: boolean) {\n this.pythonTranspiler.asyncTranspiling = async;\n }\n\n setPythonStringLiteralReplacements(replacements): void {\n this.pythonTranspiler.StringLiteralReplacements = replacements;\n }\n\n convertStringToLanguageEnum(lang: string): Languages {\n switch(lang) {\n case \"python\":\n return Languages.Python;\n case \"php\":\n return Languages.Php;\n case \"csharp\":\n return Languages.CSharp;\n case \"go\":\n return Languages.Go;\n case \"java\":\n return Languages.Java;\n case \"rust\":\n return Languages.Rust;\n case \"cpp\":\n return Languages.Cpp;\n }\n }\n}\n\n// A set of root files compiled as one typescript program, transpiled one at a time.\n// Obtained from Transpiler.createProgramBatch; mirrors the transpile*ByPath methods\n// of the Transpiler it came from, so a caller batches by replacing\n// for (const f of files) transpiler.transpileGoByPath(f)\n// with\n// const batch = transpiler.createProgramBatch(files);\n// for (const f of files) batch.transpileGoByPath(f)\n//\n// A failing file throws out of its own call and leaves the batch usable: the context\n// is rebuilt from the program on every call, so the caller can try/catch per file and\n// keep going. The batch borrows the Transpiler's printers and context, so do not\n// drive that Transpiler through another path while a batch loop is in flight — use\n// cloneSharingProgramCache() for a second, independent driver.\nclass TranspileProgramBatch {\n private readonly transpiler: Transpiler;\n private readonly snapshot: Snapshot;\n private readonly program: Program;\n private readonly checker: Checker;\n\n constructor(transpiler: Transpiler, snapshot: Snapshot, program: Program, checker: Checker) {\n this.transpiler = transpiler;\n this.snapshot = snapshot;\n this.program = program;\n this.checker = checker;\n }\n\n // releases the batch's snapshot on the TS7 server; the batch is unusable afterwards\n dispose(): void {\n this.snapshot.dispose();\n }\n\n getProgram(): Program {\n return this.program;\n }\n\n // point the owning Transpiler at one file of this batch, then run the same\n // diagnostics pass the single-file path runs\n setContextForPath(filePath: string): ITranspileContext {\n const src = this.program.getSourceFile(filePath) ?? this.program.getSourceFile(path.resolve(filePath));\n if (src === undefined) {\n throw new Error(`ast-transpiler: \"${filePath}\" is not a file of this program batch`);\n }\n const context = this.transpiler.setContext({ src, checker: this.checker, program: this.program });\n this.transpiler.checkFileDiagnostics(context);\n return context;\n }\n\n transpileByPath(lang: Languages, filePath: string, sync = false): ITranspiledFile {\n this.setContextForPath(filePath);\n return this.transpiler.transpile(lang, TranspilationMode.ByPath, filePath, sync, false);\n }\n\n transpilePythonByPath(filePath: string): ITranspiledFile {\n return this.transpileByPath(Languages.Python, filePath, !this.transpiler.pythonTranspiler.asyncTranspiling);\n }\n\n transpilePhpByPath(filePath: string): ITranspiledFile {\n return this.transpileByPath(Languages.Php, filePath, !this.transpiler.phpTranspiler.asyncTranspiling);\n }\n\n transpileCSharpByPath(filePath: string): ITranspiledFile {\n return this.transpileByPath(Languages.CSharp, filePath);\n }\n\n transpileGoByPath(filePath: string): ITranspiledFile {\n return this.transpileByPath(Languages.Go, filePath);\n }\n\n transpileJavaByPath(filePath: string): ITranspiledFile {\n return this.transpileByPath(Languages.Java, filePath);\n }\n\n transpileRustByPath(filePath: string): ITranspiledFile {\n return this.transpileByPath(Languages.Rust, filePath);\n }\n\n transpileCppByPath(filePath: string): ITranspiledFile {\n return this.transpileByPath(Languages.Cpp, filePath);\n }\n}\n\nexport {\n Transpiler,\n TranspileProgramBatch,\n // the TS7 flag enums of the typescript the generator runs on, for consumer hooks whose\n // own `typescript` resolution may be an older 7.x lacking them\n CheckFlags, ElementFlags, IndexKind, ObjectFlags, SignatureKind, SymbolFlags, TypeFlags, TypeFormatFlags,\n SyntaxKind,\n // the trailing-comment alignment pass, so a consumer that assembles its own Go files\n // (ccxt build/goTranspiler.ts) can run it on the assembled text as well\n alignGoTrailingComments,\n // the rust declared-Dict locals vocabulary + entry shape (rust-25), so the\n // helper-removal consumers can import them from the package entry\n RUST_DECLARED_DICT_LOCALS,\n};\nexport type { RustDeclaredDictLocalEntry };\n","import { BaseTranspiler } from \"./baseTranspiler.js\";\nimport { regexAll } from \"./utils.js\";\nimport { SyntaxKind } from \"typescript/unstable/ast\";\n\nconst parserConfig = {\n 'STATIC_TOKEN': '', // to do static decorator\n 'PUBLIC_KEYWORD': '',\n 'UNDEFINED_TOKEN': 'None',\n 'IF_TOKEN': 'if',\n 'ELSE_TOKEN': 'else',\n 'ELSEIF_TOKEN': 'elif',\n 'THIS_TOKEN': 'self',\n 'AMPERSTAND_APERSAND_TOKEN': 'and',\n 'BAR_BAR_TOKEN': 'or',\n 'SPACE_DEFAULT_PARAM': '',\n 'BLOCK_OPENING_TOKEN': ':',\n 'BLOCK_CLOSING_TOKEN': '',\n 'SPACE_BEFORE_BLOCK_OPENING': '',\n 'CONDITION_OPENING': '',\n 'CONDITION_CLOSE': '',\n 'TRUE_KEYWORD': 'True',\n 'FALSE_KEYWORD': 'False',\n 'THROW_TOKEN': 'raise',\n 'NOT_TOKEN': 'not ',\n 'PLUS_PLUS_TOKEN': ' += 1',\n 'MINUS_MINUS_TOKEN': ' -= 1',\n 'CONSTRUCTOR_TOKEN': 'def __init__',\n 'SUPER_CALL_TOKEN': 'super().__init__',\n 'PROPERTY_ASSIGNMENT_TOKEN': ':',\n 'FUNCTION_TOKEN': 'def',\n 'SUPER_TOKEN': 'super()',\n 'NEW_TOKEN': '',\n 'STRING_QUOTE_TOKEN': '\\'',\n 'LINE_TERMINATOR': '',\n 'METHOD_TOKEN': 'def',\n 'CATCH_TOKEN': 'except',\n 'CATCH_DECLARATION': 'Exception as',\n 'METHOD_DEFAULT_ACCESS': '',\n 'SPREAD_TOKEN': '*',\n 'NULL_TOKEN': 'None',\n};\nexport class PythonTranspiler extends BaseTranspiler {\n constructor(config = {}) {\n\n config['parser'] = Object.assign ({}, parserConfig, config['parser'] ?? {});\n\n super(config);\n this.id = \"python\";\n\n this.initConfig();\n this.asyncTranspiling = config['async'] ?? true;\n this.uncamelcaseIdentifiers = config['uncamelcaseIdentifiers'] ?? true;\n this.removeVariableDeclarationForFunctionExpression = config['removeVariableDeclarationForFunctionExpression'] ?? true;\n this.includeFunctionNameInFunctionExpressionDeclaration = config['includeFunctionNameInFunctionExpressionDeclaration'] ?? true;\n\n // user overrides\n this.applyUserOverrides(config);\n }\n\n initConfig() {\n this.LeftPropertyAccessReplacements = {\n 'this': 'self'\n };\n this.RightPropertyAccessReplacements = {\n 'push': 'append',\n 'toUpperCase': 'upper',\n 'toLowerCase': 'lower',\n // 'parseFloat': 'float',\n // 'parseInt': 'int',\n 'indexOf': 'find',\n 'padEnd': 'ljust',\n 'padStart': 'rjust'\n };\n this.FullPropertyAccessReplacements = {\n 'console.log': 'print',\n 'JSON.stringify': 'json.dumps',\n 'JSON.parse': 'json.loads',\n 'Math.log': 'math.log',\n 'Math.abs': 'abs',\n 'Math.min': 'min',\n 'Math.max': 'max',\n 'Math.ceil': 'math.ceil',\n 'Math.round': 'math.round',\n 'Math.floor': 'math.floor',\n 'Math.pow': 'math.pow',\n 'process.exit': 'sys.exit',\n 'Number.MAX_SAFE_INTEGER': 'float(\\'inf\\')',\n };\n this.CallExpressionReplacements = {\n 'parseInt': 'int',\n 'parseFloat': 'float',\n };\n\n this.PropertyAccessRequiresParenthesisRemoval = [\n // 'length',\n // 'toString',\n ];\n }\n\n printArrayIsArrayCall(node, identation, parsedArg = undefined) {\n return `isinstance(${parsedArg}, list)`;\n }\n\n printObjectKeysCall(node, identation, parsedArg = undefined) {\n return `list(${parsedArg}.keys())`;\n }\n\n printObjectValuesCall(node, identation, parsedArg = undefined) {\n return `list(${parsedArg}.values())`;\n }\n\n printPromiseAllCall(node, identation, parsedArg) {\n return `asyncio.gather(*${parsedArg})`;\n }\n\n printMathFloorCall(node, identation, parsedArg = undefined) {\n return `int(math.floor(${parsedArg}))`;\n }\n\n printMathCeilCall(node, identation, parsedArg = undefined) {\n return `int(math.ceil(${parsedArg}))`;\n }\n\n printNumberIsIntegerCall(node, identation , parsedArg = undefined) {\n return `isinstance(${parsedArg}, int)`;\n }\n\n printMathRoundCall(node, identation, parsedArg = undefined) {\n return `int(round(${parsedArg}))`;\n }\n\n printIncludesCall(node, identation, name?, parsedArg?) {\n return `${parsedArg} in ${name}`;\n }\n\n printJoinCall(node: any, identation: any, name?: any, parsedArg?: any) {\n return `${parsedArg}.join(${name})`;\n }\n\n printSplitCall(node: any, identation: any, name?: any, parsedArg?: any) {\n return `${name}.split(${parsedArg})`;\n }\n\n printConcatCall(node: any, identation: any, name?: any, parsedArg?: any) {\n return `${name} + ${parsedArg}`;\n }\n\n printPopCall(node: any, identation: any, name?: any) {\n return `${name}.pop()`;\n }\n\n printShiftCall(node: any, identation: any, name?: any) {\n return `${name}.pop(0)`;\n }\n\n printReverseCall(node, identation, name = undefined) {\n return `${name}.reverse()`;\n }\n\n printArrayPushCall(node, identation, name, parsedArg) {\n return `${name}.append(${parsedArg})`;\n }\n\n printToStringCall(node, identation, name = undefined) {\n return `str(${name})`;\n }\n\n printIndexOfCall(node, identation, name = undefined, parsedArg = undefined) {\n return `${name}.find(${parsedArg})`;\n }\n\n printSearchCall(node, identation, name = undefined, parsedArg = undefined) {\n return `${name}.find(${parsedArg})`;\n }\n\n printStartsWithCall(node, identation, name = undefined, parsedArg = undefined) {\n return `${name}.startswith(${parsedArg})`;\n }\n\n printEndsWithCall(node, identation, name = undefined, parsedArg = undefined) {\n return `${name}.endswith(${parsedArg})`;\n }\n\n printPadEndCall(node, identation, name, parsedArg, parsedArg2) {\n return `${name}.ljust(${parsedArg}, ${parsedArg2})`;\n }\n\n printPadStartCall(node, identation, name, parsedArg, parsedArg2) {\n return `${name}.rjust(${parsedArg}, ${parsedArg2})`;\n }\n\n printTrimCall(node, identation, name = undefined) {\n return `${name}.strip()`;\n }\n\n printToUpperCaseCall(node, identation, name = undefined) {\n return `${name}.upper()`;\n }\n\n printToLowerCaseCall(node, identation, name = undefined) {\n return `${name}.lower()`;\n }\n\n printJsonParseCall(node: any, identation: any, parsedArg?: any) {\n return `json.loads(${parsedArg})`;\n }\n\n printJsonStringifyCall(node: any, identation: any, parsedArg?: any) {\n return `json.dumps(${parsedArg})`;\n }\n\n printReplaceCall(node: any, identation: any, name?: any, parsedArg?: any, parsedArg2?: any) {\n return `${name}.replace(${parsedArg}, ${parsedArg2})`;\n }\n\n printReplaceAllCall(node: any, identation: any, name?: any, parsedArg?: any, parsedArg2?: any) {\n return `${name}.replace(${parsedArg}, ${parsedArg2})`;\n }\n\n printElementAccessExpressionExceptionIfAny(node) {\n if (node.expression.kind === SyntaxKind.ThisKeyword) {\n return \"getattr(self, \" + this.printNode(node.argumentExpression, 0) + \")\";\n }\n }\n\n printAssertCall(node, identation, parsedArgs) {\n return `assert ${parsedArgs}`;\n }\n\n printDateNowCall(node, identation) {\n return \"int(time.time() * 1000)\";\n }\n\n\n printForStatement(node, identation) {\n const varName = node.initializer.declarations[0].name.text;\n const initValue = this.printNode(node.initializer.declarations[0].initializer, 0);\n const roofValue = this.printNode(node.condition.right,0);\n\n const forStm = this.getIden(identation) + this.FOR_TOKEN + \" \" + varName + \" in range(\" + initValue + \", \" + roofValue + \"):\\n\" + node.statement.statements.map(st => this.printNode(st, identation+1)).join(\"\\n\");\n return this.printNodeCommentsIfAny(node, identation, forStm);\n }\n\n printPropertyAccessModifiers(node) {\n return \"\"; // no access modifier in python\n }\n\n transformLeadingComment(comment) {\n const commentRegex = [\n [ /(^|\\s)\\/\\//g, '$1#' ], // regular comments\n [ /\\/\\*\\*/, '\\\"\\\"\\\"' ], // eslint-disable-line\n [ / \\*\\//, '\\\"\\\"\\\"' ], // eslint-disable-line\n [ /\\[([^\\[\\]]*)\\]\\{@link (.*)\\}/g, '`$1 <$2>`' ], // eslint-disable-line\n [ /\\s+\\* @method/g, '' ], // docstring @method\n [ /(\\s+) \\* @description (.*)/g, '$1$2' ], // docstring description\n [ /\\s+\\* @name .*/g, '' ], // docstring @name\n [ /(\\s+) \\* @see( .*)/g, '$1see$2' ], // docstring @see\n [ /(\\s+ \\* @(param|returns) {[^}]*)string([^}]*}.*)/g, '$1str$3' ], // docstring type conversion\n [ /(\\s+ \\* @(param|returns) {[^}]*)object([^}]*}.*)/g, '$1dict$3' ], // doctstrubg type conversion\n [ /(\\s+) \\* @returns ([^\\{])/g, '$1:returns: $2' ], // eslint-disable-line\n [ /(\\s+) \\* @returns \\{(.+)\\}/g, '$1:returns $2:' ], // docstring return\n [ /(\\s+ \\* @param \\{[\\]\\[\\|a-zA-Z]+\\} )([a-zA-Z0-9_-]+)\\.([a-zA-Z0-9_-]+) (.*)/g, '$1$2[\\'$3\\'] $4' ], // eslint-disable-line\n [ /(\\s+) \\* @([a-z]+) \\{([\\]\\[a-zA-Z\\|]+)\\} ([a-zA-Z0-9_\\-\\.\\[\\]\\']+)/g, '$1:$2 $3 $4:' ], // eslint-disable-line\n ];\n\n const transformed = regexAll(comment, commentRegex);\n return transformed;\n }\n\n transformTrailingComment(comment) {\n const commentRegex = [\n [ /(^|\\s)\\/\\//g, '$1#' ], // regular comments\n ];\n\n const transformed = regexAll(comment, commentRegex);\n return \" \" + transformed;\n }\n\n transformPropertyAcessExpressionIfNeeded(node: any) {\n const expression = node.expression;\n const leftSide = this.printNode(expression, 0);\n const rightSide = node.name.text;\n\n let rawExpression = undefined;\n\n if (rightSide === \"length\") {\n rawExpression = \"len(\" + leftSide + \")\";\n } else if (rightSide === \"toString\") {\n rawExpression = \"str(\" + leftSide + \")\";\n }\n return rawExpression;\n }\n\n printClassDefinition(node: any, identation: any): string {\n const className = node.name.text;\n const heritageClauses = node.heritageClauses;\n\n let classInit = \"\";\n if (heritageClauses !== undefined) {\n const classExtends = heritageClauses[0].types[0].expression.text;\n classInit = this.getIden(identation) + \"class \" + className + \"(\" + classExtends + \"):\\n\";\n } else {\n classInit = this.getIden(identation) + \"class \" + className + \":\\n\";\n }\n return classInit;\n }\n\n isFunctionOutSideClass(node) {\n return !(node.parent && node.parent.kind === SyntaxKind.ClassDeclaration);\n }\n\n printMethodParameters(node) {\n let parsedArgs = super.printMethodParameters(node);\n const shouldAddSelf = !this.isFunctionOutSideClass(node);\n parsedArgs = shouldAddSelf ? (parsedArgs ? \"self, \" + parsedArgs : \"self\") : parsedArgs;\n return parsedArgs;\n }\n\n printInstanceOfExpression(node, identation) {\n const left = this.printNode(node.left, 0);\n const right = this.printNode(node.right, 0);\n return this.getIden(identation) + `isinstance(${left}, ${right})`;\n }\n\n handleTypeOfInsideBinaryExpression(node, identation) {\n const expression = node.left.expression;\n const right = node.right.text;\n\n const op = node.operatorToken.kind;\n const isDifferentOperator = op === SyntaxKind.ExclamationEqualsEqualsToken || op === SyntaxKind.ExclamationEqualsToken;\n const notOperator = isDifferentOperator ? this.NOT_TOKEN : \"\";\n\n switch (right) {\n case \"string\":\n return this.getIden(identation) + notOperator + \"isinstance(\" + this.printNode(expression, 0) + \", str)\";\n case \"number\":\n return this.getIden(identation) + notOperator + \"isinstance(\" + this.printNode(expression, 0) + \", numbers.Real)\";\n case \"boolean\":\n return this.getIden(identation) + notOperator + \"isinstance(\" + this.printNode(expression, 0) + \", bool)\";\n case \"object\":\n return this.getIden(identation) + notOperator + \"isinstance(\" + this.printNode(expression, 0) + \", dict)\";\n case \"undefined\":\n return this.getIden(identation) + this.printNode(expression, 0) + \" is \" + notOperator + \"None\";\n }\n\n return undefined;\n\n }\n\n printCustomBinaryExpressionIfAny(node, identation) {\n const left = node.left;\n const right = node.right.text;\n\n const op = node.operatorToken.kind;\n\n // Fix E712 comparison: if cond == True -> if cond:\n if ((op === SyntaxKind.EqualsEqualsToken || op === SyntaxKind.EqualsEqualsEqualsToken) && node.right.kind === SyntaxKind.TrueKeyword) {\n return this.getIden(identation) + this.printNode(node.left, 0);\n }\n\n if (left.kind === SyntaxKind.TypeOfExpression) {\n const typeOfExpression = this.handleTypeOfInsideBinaryExpression(node, identation);\n if (typeOfExpression) {\n return typeOfExpression;\n }\n }\n\n const prop = node?.left?.expression?.name?.text;\n\n if (prop) {\n const args = left.arguments;\n const parsedArg = (args && args.length > 0) ? this.printNode(args[0], 0): undefined;\n const leftSideOfIndexOf = left.expression.expression; // myString in myString.indexOf\n const leftSide = this.printNode(leftSideOfIndexOf, 0);\n // const rightType = this.getChecker().getTypeAtLocation(leftSideOfIndexOf); // type of myString in myString.indexOf (\"b\") >= 0;\n\n switch(prop) {\n case 'indexOf':\n if (op === SyntaxKind.GreaterThanEqualsToken && right === '0') {\n return this.getIden(identation) + `${parsedArg} in ${leftSide}`;\n }\n }\n }\n return undefined;\n }\n\n printConditionalExpression(node, identation) {\n const condition = this.printNode(node.condition, 0);\n const whenTrue = this.printNode(node.whenTrue, 0);\n const whenFalse = this.printNode(node.whenFalse, 0);\n\n return this.getIden(identation) + whenTrue + \" if \" + condition + \" else \" + whenFalse;\n }\n\n printDeleteExpression(node, identation) {\n const expression = this.printNode (node.expression);\n return `del ${expression}`;\n }\n\n getCustomOperatorIfAny(left, right, operator) {\n const rightText = right.getText();\n const isUndefined = rightText === \"undefined\";\n if (isUndefined) {\n switch (operator.kind) {\n case SyntaxKind.EqualsEqualsToken:\n return \"is\";\n case SyntaxKind.ExclamationEqualsToken:\n return \"is not\";\n case SyntaxKind.ExclamationEqualsEqualsToken:\n return \"is not\";\n case SyntaxKind.EqualsEqualsEqualsToken:\n return \"is\";\n }\n }\n }\n}\n","import { SyntaxKind, getLeadingCommentRanges, getTrailingCommentRanges, type BinaryExpression, type ClassDeclaration, type Node, type PropertyAccessExpression, type SourceFile } from \"typescript/unstable/ast\";\nimport { isArrayLiteralExpression, isArrowFunction, isAwaitExpression, isBinaryExpression, isBooleanLiteral, isCallExpression, isClassDeclaration, isConditionalExpression, isExportAssignment, isExportDeclaration, isFunctionDeclaration, isFunctionExpression, isImportDeclaration, isMethodDeclaration, isNumericLiteral, isObjectLiteralExpression, isSourceFile, isStringLiteralLikeNode, isVariableStatement } from \"typescript/unstable/ast/is\";\nimport { createAwaitExpression, createParenthesizedExpression, createReturnStatement } from \"typescript/unstable/ast/factory\";\nimport { SignatureKind, TypeFlags, type Checker, type Program } from \"typescript/unstable/sync\";\nimport { findAncestor, getAllSuperTypeNodes, isFunctionLike } from \"./tsUtils.js\";\nimport { IFileImport, IFileExport, TranspilationError, IMethodType, IParameterType, ITranspileContext } from './types.js';\nimport { unCamelCase } from \"./utils.js\";\nimport { Logger } from \"./logger.js\";\nimport { timingSafeEqual } from 'crypto';\n\nconst NO_CONTEXT_ERROR = \"No transpilation context set: the typescript program must be created before printing nodes.\";\n\nclass BaseTranspiler {\n\n NUM_LINES_BETWEEN_CLASS_MEMBERS = 1;\n LINES_BETWEEN_FILE_MEMBERS = 0;\n NUM_LINES_END_FILE = 1;\n SPACE_DEFAULT_PARAM = \" \";\n BLOCK_OPENING_TOKEN = '{';\n BLOCK_CLOSING_TOKEN = '}';\n SPACE_BEFORE_BLOCK_OPENING = ' ';\n CONDITION_OPENING = '(';\n CONDITION_CLOSE = ')';\n DEFAULT_IDENTATION = \" \";\n STRING_QUOTE_TOKEN = '\"';\n UNDEFINED_TOKEN = \"null\";\n NULL_TOKEN = \"null\";\n IF_TOKEN = \"if\";\n ELSE_TOKEN = \"else\";\n ELSEIF_TOKEN = \"else if\";\n THIS_TOKEN = \"this\";\n SLASH_TOKEN = \"/\";\n ASTERISK_TOKEN = \"*\";\n PLUS_TOKEN = \"+\";\n MINUS_TOKEN = \"-\";\n EQUALS_TOKEN = \"=\";\n EQUALS_EQUALS_TOKEN = \"==\";\n EXCLAMATION_EQUALS_TOKEN = \"!=\";\n EXCLAMATION_EQUALS_EQUALS_TOKEN = \"!=\";\n EQUALS_EQUALS_EQUALS_TOKEN = \"==\";\n AMPERSTAND_APERSAND_TOKEN = \"&&\";\n PLUS_EQUALS = \"+=\";\n BAR_BAR_TOKEN = \"||\";\n PERCENT_TOKEN = \"%\";\n RETURN_TOKEN = \"return\";\n OBJECT_OPENING = \"{\";\n OBJECT_CLOSING = \"}\";\n LEFT_PARENTHESIS = \"(\";\n RIGHT_PARENTHESIS = \")\";\n ARRAY_OPENING_TOKEN = \"[\";\n ARRAY_CLOSING_TOKEN = \"]\";\n TRUE_KEYWORD = \"true\";\n FALSE_KEYWORD = \"false\";\n NEW_CORRESPODENT = \"new\";\n THROW_TOKEN = \"throw\";\n AWAIT_TOKEN = \"await\";\n STATIC_TOKEN = \"static\";\n CONTINUE_TOKEN = \"continue\";\n EXTENDS_TOKEN = \":\";\n NOT_TOKEN = \"!\";\n SUPER_TOKEN = \"super\";\n PROPERTY_ACCESS_TOKEN = \".\";\n TRY_TOKEN = \"try\";\n CATCH_TOKEN = \"catch\";\n CATCH_DECLARATION = \"Exception\";\n BREAK_TOKEN = \"break\";\n IN_TOKEN = \"in\";\n LESS_THAN_TOKEN = \"<\";\n GREATER_THAN_TOKEN = \">\";\n GREATER_THAN_EQUALS_TOKEN = \">=\";\n LESS_THAN_EQUALS_TOKEN = \"<=\";\n PLUS_PLUS_TOKEN = \"++\";\n MINUS_MINUS_TOKEN = \"--\";\n CONSTRUCTOR_TOKEN = \"def __init__\";\n SUPER_CALL_TOKEN = \"super().__init__\";\n WHILE_TOKEN = \"while\";\n FOR_TOKEN = \"for\";\n VAR_TOKEN = \"\";\n\n METHOD_DEFAULT_ACCESS = \"public\";\n\n PROPERTY_ASSIGNMENT_TOKEN = \":\";\n PROPERTY_ASSIGNMENT_OPEN = \"\";\n PROPERTY_ASSIGNMENT_CLOSE = \"\";\n\n LINE_TERMINATOR = \";\";\n\n FUNCTION_TOKEN = \"function\";\n METHOD_TOKEN = \"function\";\n ASYNC_TOKEN = \"async\";\n PROMISE_TYPE_KEYWORD = \"Task\";\n\n NEW_TOKEN = \"new\";\n\n STRING_LITERAL_KEYWORD = \"StringLiteral\";\n STRING_KEYWORD = \"string\";\n NUMBER_KEYWORD = \"float\";\n\n PUBLIC_KEYWORD = \"public\";\n PRIVATE_KEYWORD = \"private\";\n VOID_KEYWORD = \"void\";\n BOOLEAN_KEYWORD = \"bool\";\n\n ARRAY_KEYWORD = \"List\";\n OBJECT_KEYWORD = \"Dictionary\";\n INTEGER_KEYWORD = \"int\";\n DEFAULT_RETURN_TYPE = \"object\";\n DEFAULT_PARAMETER_TYPE = \"object\";\n DEFAULT_TYPE = \"object\";\n\n FALSY_WRAPPER_OPEN = \"\";\n FALSY_WRAPPER_CLOSE = \"\";\n\n ELEMENT_ACCESS_WRAPPER_OPEN = \"\";\n ELEMENT_ACCESS_WRAPPER_CLOSE = \"\";\n\n COMPARISON_WRAPPER_OPEN = \"\";\n COMPARISON_WRAPPER_CLOSE = \"\";\n\n UKNOWN_PROP_WRAPPER_OPEN = \"\";\n UNKOWN_PROP_WRAPPER_CLOSE = \"\";\n\n UKNOWN_PROP_ASYNC_WRAPPER_OPEN = \"\";\n UNKOWN_PROP_ASYNC_WRAPPER_CLOSE = \"\";\n\n EQUALS_EQUALS_WRAPPER_OPEN = \"\";\n EQUALS_EQUALS_WRAPPER_CLOSE = \"\";\n\n DIFFERENT_WRAPPER_OPEN = \"\";\n DIFFERENT_WRAPPER_CLOSE = \"\";\n\n GREATER_THAN_WRAPPER_OPEN = \"\";\n GREATER_THAN_WRAPPER_CLOSE = \"\";\n\n LESS_THAN_WRAPPER_OPEN = \"\";\n LESS_THAN_WRAPPER_CLOSE = \"\";\n\n GREATER_THAN_EQUALS_WRAPPER_OPEN = \"\";\n GREATER_THAN_EQUALS_WRAPPER_CLOSE = \"\";\n\n LESS_THAN_EQUALS_WRAPPER_OPEN = \"\";\n LESS_THAN_EQUALS_WRAPPER_CLOSE = \"\";\n\n DIVIDE_WRAPPER_OPEN = \"\";\n DIVIDE_WRAPPER_CLOSE = \"\";\n\n PLUS_WRAPPER_OPEN = \"\";\n PLUS_WRAPPER_CLOSE = \"\";\n\n MINUS_WRAPPER_OPEN = \"\";\n MINUS_WRAPPER_CLOSE = \"\";\n\n MOD_WRAPPER_OPEN = \"\";\n MOD_WRAPPER_CLOSE = \"\";\n\n ARRAY_LENGTH_WRAPPER_OPEN = \"\";\n ARRAY_LENGTH_WRAPPER_CLOSE = \"\";\n\n MULTIPLY_WRAPPER_OPEN = \"\";\n MULTIPLY_WRAPPER_CLOSE = \"\";\n\n INDEXOF_WRAPPER_OPEN = \"\";\n INDEXOF_WRAPPER_CLOSE = \"\";\n\n PARSEINT_WRAPPER_OPEN = \"\";\n PARSEINT_WRAPPER_CLOSE = \"\";\n\n DYNAMIC_CALL_OPEN = \"\";\n\n SPREAD_TOKEN = \"...\";\n\n INFER_VAR_TYPE = false;\n INFER_ARG_TYPE = false;\n\n SupportedKindNames = {};\n PostFixOperators = {};\n PrefixFixOperators = {};\n FunctionDefSupportedKindNames = {};\n\n LeftPropertyAccessReplacements = {};\n RightPropertyAccessReplacements = {};\n FullPropertyAccessReplacements = {};\n StringLiteralReplacements = {};\n\n CallExpressionReplacements = {};\n ReservedKeywordsReplacements = {};\n ReassignedVars = {};\n PropertyAccessRequiresParenthesisRemoval = [];\n VariableTypeReplacements = {};\n ArgTypeReplacements = {};\n\n FuncModifiers = {};\n defaultPropertyAccess = 'public';\n\n currentClassName = \"\";\n className = \"undefined\";\n\n uncamelcaseIdentifiers;\n asyncTranspiling;\n implicitAsyncTranspiling;\n requiresReturnType;\n requiresParameterType;\n supportsFalsyOrTruthyValues;\n requiresCallExpressionCast;\n removeVariableDeclarationForFunctionExpression;\n includeFunctionNameInFunctionExpressionDeclaration;\n id;\n // typescript state for the transpilation currently in flight. Set by the owning\n // Transpiler before it walks the AST, so nothing leaks through process globals.\n context: ITranspileContext | undefined;\n\n constructor(config) {\n Object.assign (this, (config['parser'] || {}));\n this.id = \"base\";\n this.uncamelcaseIdentifiers = false;\n this.requiresReturnType = false;\n this.requiresParameterType = false;\n this.supportsFalsyOrTruthyValues = true;\n this.requiresCallExpressionCast = false;\n this.removeVariableDeclarationForFunctionExpression = true;\n this.includeFunctionNameInFunctionExpressionDeclaration = true;\n this.initOperators();\n }\n\n setContext(context: ITranspileContext | undefined): void {\n this.context = context;\n }\n\n getSrc(): SourceFile {\n if (this.context === undefined) throw new Error(NO_CONTEXT_ERROR);\n return this.context.src;\n }\n\n getChecker(): Checker {\n if (this.context === undefined) throw new Error(NO_CONTEXT_ERROR);\n return this.context.checker;\n }\n\n // the checker when a transpilation context is set, undefined otherwise (an in-memory\n // program without one keeps every helper the checker would have proven away)\n // true when some node under `scope` (excluding `scope` itself) satisfies `predicate`;\n // the walk stops at the first hit and does not descend below it\n hasNodeWhere(scope: Node | undefined, predicate: (n: any) => boolean): boolean {\n if (scope === undefined) {\n return false;\n }\n let found = false;\n const visit = (n: any) => {\n if (found) {\n return;\n }\n if (predicate(n)) {\n found = true;\n return;\n }\n n.forEachChild(visit);\n };\n scope.forEachChild(visit);\n return found;\n }\n\n checkerOrUndefined(): Checker | undefined {\n return this.context?.checker;\n }\n\n getProgram(): Program {\n if (this.context === undefined) throw new Error(NO_CONTEXT_ERROR);\n return this.context.program;\n }\n\n initOperators() {\n this.SupportedKindNames = {\n [SyntaxKind.StringLiteral]: this.STRING_LITERAL_KEYWORD,\n [SyntaxKind.StringKeyword]: this.STRING_KEYWORD,\n // [ts.SyntaxKind.NumberKeyword]: this.NUMBER_KEYWORD,\n [SyntaxKind.NumberKeyword]: this.DEFAULT_TYPE,\n [SyntaxKind.MinusMinusToken]: this.MINUS_MINUS_TOKEN,\n [SyntaxKind.MinusToken]: this.MINUS_TOKEN,\n [SyntaxKind.SlashToken]: this.SLASH_TOKEN,\n [SyntaxKind.AsteriskToken]: this.ASTERISK_TOKEN,\n [SyntaxKind.InKeyword]: this.IN_TOKEN,\n [SyntaxKind.PlusToken]: this.PLUS_TOKEN,\n [SyntaxKind.PercentToken]: this.PERCENT_TOKEN,\n [SyntaxKind.LessThanToken]: this.LESS_THAN_TOKEN,\n [SyntaxKind.LessThanEqualsToken]: this.LESS_THAN_EQUALS_TOKEN,\n [SyntaxKind.GreaterThanToken]: this.GREATER_THAN_TOKEN,\n [SyntaxKind.GreaterThanEqualsToken]: this.GREATER_THAN_EQUALS_TOKEN,\n [SyntaxKind.EqualsEqualsToken]: this.EQUALS_EQUALS_TOKEN,\n [SyntaxKind.EqualsEqualsEqualsToken]: this.EQUALS_EQUALS_EQUALS_TOKEN,\n [SyntaxKind.EqualsToken]: this.EQUALS_TOKEN,\n [SyntaxKind.PlusEqualsToken]: this.PLUS_EQUALS,\n [SyntaxKind.BarBarToken]: this.BAR_BAR_TOKEN,\n [SyntaxKind.AmpersandAmpersandToken]: this.AMPERSTAND_APERSAND_TOKEN,\n [SyntaxKind.ExclamationEqualsEqualsToken]: this.EXCLAMATION_EQUALS_EQUALS_TOKEN,\n [SyntaxKind.ExclamationEqualsToken]: this.EXCLAMATION_EQUALS_TOKEN,\n [SyntaxKind.AsyncKeyword]: this.ASYNC_TOKEN,\n [SyntaxKind.AwaitKeyword]: this.AWAIT_TOKEN,\n [SyntaxKind.StaticKeyword]: this.STATIC_TOKEN,\n [SyntaxKind.PublicKeyword]: this.PUBLIC_KEYWORD,\n [SyntaxKind.PrivateKeyword]: this.PRIVATE_KEYWORD,\n [SyntaxKind.VoidKeyword]: this.VOID_KEYWORD,\n [SyntaxKind.BooleanKeyword]: this.BOOLEAN_KEYWORD,\n };\n\n this.PostFixOperators = {\n [SyntaxKind.PlusPlusToken]: this.PLUS_PLUS_TOKEN,\n [SyntaxKind.MinusMinusToken]: this.MINUS_MINUS_TOKEN,\n };\n\n this.PrefixFixOperators = {\n [SyntaxKind.ExclamationToken]: this.NOT_TOKEN,\n [SyntaxKind.MinusToken]: this.MINUS_TOKEN,\n };\n\n this.FunctionDefSupportedKindNames = {\n [SyntaxKind.StringKeyword]: this.STRING_KEYWORD\n };\n\n this.FuncModifiers = {\n [SyntaxKind.AsyncKeyword]: this.ASYNC_TOKEN,\n [SyntaxKind.PublicKeyword]: this.PUBLIC_KEYWORD,\n [SyntaxKind.PrivateKeyword]: this.PRIVATE_KEYWORD,\n [SyntaxKind.StaticKeyword]: this.STATIC_TOKEN,\n };\n }\n\n capitalize(str: string) {\n return str[0].toUpperCase() + str.slice(1);\n }\n\n applyUserOverrides(config): void {\n this.LeftPropertyAccessReplacements = Object.assign ({}, this.LeftPropertyAccessReplacements, config['LeftPropertyAccessReplacements'] ?? {});\n this.RightPropertyAccessReplacements = Object.assign ({}, this.RightPropertyAccessReplacements, config['RightPropertyAccessReplacements'] ?? {});\n this.FullPropertyAccessReplacements = Object.assign ({}, this.FullPropertyAccessReplacements, config['FullPropertyAccessReplacements'] ?? {});\n this.CallExpressionReplacements = Object.assign ({}, this.CallExpressionReplacements, config['CallExpressionReplacements'] ?? {});\n this.StringLiteralReplacements = Object.assign ({}, this.StringLiteralReplacements, config['StringLiteralReplacements'] ?? {});\n }\n\n getLineAndCharacterOfNode(node): [number,number] {\n const { line, character } =\n this.getSrc().getLineAndCharacterOfPosition(node.getStart());\n return [line + 1,character];\n }\n\n isComment(line: string){\n line = line.trim();\n return line.startsWith(\"//\") || line.startsWith(\"/*\") || line.startsWith(\"*\");\n }\n\n isStringType(flags: TypeFlags) {\n return flags === TypeFlags.String || flags === TypeFlags.StringLiteral;\n }\n\n isAnyType(flags: TypeFlags) {\n return flags === TypeFlags.Any;\n }\n\n warnIfAnyType(node, flags, variable, target) {\n if (this.isAnyType(flags)) {\n const [line, character] = this.getLineAndCharacterOfNode(node);\n Logger.warning(`[${this.id}] Line: ${line} char: ${character}: ${variable} has any type, ${target} might be incorrectly transpiled`);\n }\n }\n\n warn(node, target, message) {\n const [line, character] = this.getLineAndCharacterOfNode(node);\n Logger.warning(`[${this.id}] Line: ${line} char: ${character}: ${target} : ${message}`);\n }\n\n hasAsyncModifier(node) {\n return (node.modifiers ?? []).some(mod => mod.kind === SyntaxKind.AsyncKeyword);\n }\n\n isPromiseType(type) {\n return type !== undefined && this.getTypeFromRawType(type) === this.PROMISE_TYPE_KEYWORD;\n }\n\n isImplicitAsyncFunction(node) {\n // a function declared WITHOUT the `async` keyword that returns a Promise\n // directly, ie: `watchTicker (symbol: string): Promise { return this.watch (...); }`\n // (a common fast-path in JS for pure delegator/pass-through methods);\n // target languages without that distinction transpile it as if it were `async`\n if (!this.implicitAsyncTranspiling || !isFunctionLike(node) || this.hasAsyncModifier(node)) {\n return false;\n }\n const signature = this.getChecker().getSignatureFromDeclaration(node);\n return signature !== undefined && this.isPromiseType(this.getChecker().getReturnTypeOfSignature(signature));\n }\n\n isAsyncFunction(node) {\n return this.hasAsyncModifier(node) || this.isImplicitAsyncFunction(node);\n }\n\n getMethodOverride(node: Node): Node {\n /////\n //// Warning: Only takes into consideration 1 level of heritage\n //// might be costly, try to improve its performance later\n ////\n // Check if the method is a member of a class\n if (node === undefined) {\n return undefined;\n }\n if (!isClassDeclaration(node.parent)) {\n return undefined;\n }\n\n // Get the class declaration\n const classDeclaration = node.parent as ClassDeclaration;\n\n // Check if the class has a base class\n if (!classDeclaration.heritageClauses) {\n return undefined;\n }\n\n let method = undefined;\n\n let parentClass = getAllSuperTypeNodes(node.parent)[0];\n\n while (parentClass !== undefined) {\n const parentClassType = this.getChecker().getTypeAtLocation(parentClass);\n const parentClassDecl = parentClassType?.getSymbol()?.valueDeclaration?.resolve();\n\n if (parentClassDecl === undefined) {\n this.warn(node, \"Parent class\", \"Parent class not found\");\n return undefined;\n }\n\n const parentClassMembers = (parentClassDecl as any).members ?? [];\n\n parentClassMembers.forEach(elem=> {\n if (isMethodDeclaration(elem)) {\n\n const name = elem.name.getText().trim();\n if ((node as any).name.text === name) {\n method = elem;\n }\n }\n });\n\n parentClass = getAllSuperTypeNodes(parentClassDecl)[0] ?? undefined;\n }\n\n\n\n // TODO: Check if the method has the same signature as a method in the base class\n return method;\n }\n\n getIden (num) {\n return this.DEFAULT_IDENTATION.repeat(parseInt(num));\n }\n\n getBlockOpen(identation){\n return this.SPACE_BEFORE_BLOCK_OPENING + this.BLOCK_OPENING_TOKEN + \"\\n\";\n }\n\n getBlockClose(identation, chainBlock = false) {\n\n if (chainBlock) {\n return this.BLOCK_CLOSING_TOKEN ? \"\\n\" + this.getIden(identation) + this.BLOCK_CLOSING_TOKEN + this.SPACE_BEFORE_BLOCK_OPENING : \"\\n\" + this.getIden(identation) + this.BLOCK_CLOSING_TOKEN;\n }\n\n return this.BLOCK_CLOSING_TOKEN ? \"\\n\" + this.getIden(identation) + this.BLOCK_CLOSING_TOKEN : \"\";\n }\n\n startsWithUpperCase(str) {\n return str.charAt(0) === str.charAt(0).toUpperCase();\n }\n\n unCamelCaseIfNeeded(name: string): string {\n\n if (this.uncamelcaseIdentifiers && !this.startsWithUpperCase(name) ) { // avoid snake_case constant (MY_CONSTANT) or exception errors (BadRequestException)\n return unCamelCase(name) ?? name;\n }\n return name;\n }\n\n transformIdentifier(node, identifier) {\n return this.unCamelCaseIfNeeded(identifier);\n }\n\n transformCallExpressionName(name: string, nameNode = undefined) {\n return name;\n }\n\n transformPropertyAccessExpressionName(name: string, nameNode = undefined) {\n return name;\n }\n\n printIdentifier(node) {\n let idValue = node.text ?? node.text;\n\n if (this.ReservedKeywordsReplacements[idValue]) {\n idValue = this.ReservedKeywordsReplacements[idValue];\n }\n\n if (idValue === \"undefined\") {\n return this.UNDEFINED_TOKEN;\n }\n return this.transformIdentifier(node, idValue); // check this later\n }\n\n shouldRemoveParenthesisFromCallExpression(node) {\n if (node.expression.kind === SyntaxKind.PropertyAccessExpression) {\n return this.PropertyAccessRequiresParenthesisRemoval.includes(node.expression.name.text);\n }\n return false;\n }\n\n printInstanceOfExpression(node, identation) {\n // const left = this.printNode(node.left, 0);\n // const right = this.printNode(node.right, 0);\n const left = node.left.text;\n const right = node.right.text;\n return this.getIden(identation) + `${left} instanceof ${right}`;\n }\n\n getCustomOperatorIfAny(left, right, operator) {\n return undefined;\n }\n\n printCustomBinaryExpressionIfAny(node, identation) {\n return undefined; // stub to override\n }\n\n printBinaryExpression(node, identation) {\n\n const {left, right, operatorToken} = node;\n\n const customBinaryExp = this.printCustomBinaryExpressionIfAny(node, identation);\n if (customBinaryExp) {\n return customBinaryExp;\n }\n\n if (operatorToken.kind == SyntaxKind.InstanceOfKeyword) {\n return this.printInstanceOfExpression(node, identation);\n }\n\n let operator = this.SupportedKindNames[operatorToken.kind];\n\n\n let leftVar = undefined;\n let rightVar = undefined;\n\n // c# wrapper\n if (operatorToken.kind === SyntaxKind.EqualsEqualsToken || operatorToken.kind === SyntaxKind.EqualsEqualsEqualsToken) {\n if (this.COMPARISON_WRAPPER_OPEN) {\n leftVar = this.printNode(left, 0);\n rightVar = this.printNode(right, identation);\n return `${this.COMPARISON_WRAPPER_OPEN}${leftVar}, ${rightVar}${this.COMPARISON_WRAPPER_CLOSE}`;\n }\n }\n let prefixes = \"\";\n // check if boolean operators || and && because of the falsy values\n if (operatorToken.kind === SyntaxKind.BarBarToken || operatorToken.kind === SyntaxKind.AmpersandAmpersandToken) {\n leftVar = this.printCondition(left, 0);\n rightVar = this.printCondition(right, identation);\n } else {\n leftVar = this.printNode(left, 0);\n\n\n // if (right.kind === ts.SyntaxKind.ObjectLiteralExpression) {\n prefixes = this.getBinaryExpressionPrefixes(node, identation) ?? \"\";\n // }\n\n rightVar = this.printNode(right, identation);\n }\n\n const customOperator = this.getCustomOperatorIfAny(left, right, operatorToken);\n\n operator = customOperator ? customOperator : operator;\n\n return prefixes + leftVar +\" \"+ operator + \" \" + rightVar.trim();\n }\n\n getBinaryExpressionPrefixes(node, identation) {\n return undefined;\n }\n\n transformPropertyAcessExpressionIfNeeded (node) {\n return undefined;\n }\n\n transformPropertyAcessRightIdentifierIfNeeded (name: string): string {\n return this.unCamelCaseIfNeeded(name);\n }\n\n getExceptionalAccessTokenIfAny(node) {\n return undefined; // stub to override\n }\n\n printLengthProperty(node, identation, name = undefined) {\n return undefined; // stub to override\n }\n\n printPropertyAccessExpression(node, identation) {\n\n const expression = node.expression;\n\n const transformedProperty = this.transformPropertyAcessExpressionIfNeeded(node);\n if (transformedProperty) {\n return this.getIden(identation) + transformedProperty;\n }\n\n let leftSide = node.expression.text;\n let rightSide = node.name.text;\n\n switch (rightSide) {\n case \"length\":\n return this.printLengthProperty(node, identation, leftSide);\n }\n\n let rawExpression = node.getText().trim();\n\n if (this.FullPropertyAccessReplacements.hasOwnProperty(rawExpression)){ // eslint-disable-line\n return this.FullPropertyAccessReplacements[rawExpression]; // eslint-disable-line\n }\n\n leftSide = this.LeftPropertyAccessReplacements.hasOwnProperty(leftSide) ? this.LeftPropertyAccessReplacements[leftSide] : this.printNode(expression, 0); // eslint-disable-line\n\n // checking \"toString\" insde the object will return the builtin toString method :X\n rightSide = this.RightPropertyAccessReplacements.hasOwnProperty(rightSide) ? // eslint-disable-line\n this.RightPropertyAccessReplacements[rightSide] :\n this.transformPropertyAcessRightIdentifierIfNeeded(rightSide) ?? rightSide;\n\n // join together the left and right side again\n const accessToken = this.getExceptionalAccessTokenIfAny(node) ?? this.PROPERTY_ACCESS_TOKEN;\n\n rawExpression = leftSide + accessToken + this.transformPropertyAccessExpressionName(rightSide, node.name);\n\n return rawExpression;\n }\n\n printCustomDefaultValueIfNeeded(node) {\n return undefined;\n }\n\n printParameteCustomName(node, name, defaultValue = true) {\n // useful for when we have to get the parent's method argument type\n const initializer = node.initializer;\n\n let type = this.printParameterType(node);\n type = type ? type + \" \" : \"\";\n\n if (defaultValue) {\n if (initializer) {\n const customDefaultValue = this.printCustomDefaultValueIfNeeded(initializer);\n const defaultValue = customDefaultValue ? customDefaultValue : this.printNode(initializer, 0);\n return type + name + this.SPACE_DEFAULT_PARAM + \"=\" + this.SPACE_DEFAULT_PARAM + defaultValue;\n }\n return type + name;\n }\n return name;\n }\n\n printParameter(node, defaultValue = true) {\n const name = this.printNode(node.name, 0);\n const initializer = node.initializer;\n\n let type = this.printParameterType(node);\n type = type ? type + \" \" : \"\";\n\n if (defaultValue) {\n if (initializer) {\n const customDefaultValue = this.printCustomDefaultValueIfNeeded(initializer);\n const defaultValue = customDefaultValue ? customDefaultValue : this.printNode(initializer, 0);\n if (type) {\n type = (defaultValue === \"null\" && type !== \"object\") ? type + \"? \": type + \" \";\n }\n return type + name + this.SPACE_DEFAULT_PARAM + \"=\" + this.SPACE_DEFAULT_PARAM + defaultValue;\n }\n if (type === \"\") {\n return name;\n }\n return type + \" \" + name;\n }\n return name;\n }\n\n printModifiers(node) {\n let modifiers = node.modifiers ?? [];\n modifiers = modifiers.filter(mod => this.FuncModifiers[mod.kind]);\n\n if (!this.asyncTranspiling) {\n modifiers = modifiers.filter(mod => mod.kind !== SyntaxKind.AsyncKeyword);\n }\n let res = modifiers.map(modifier => this.FuncModifiers[modifier.kind]).join(\" \");\n\n if (this.asyncTranspiling && this.ASYNC_TOKEN && this.isImplicitAsyncFunction(node)) {\n // non-async functions returning a Promise directly are transpiled\n // as if they had been declared `async`\n res = res ? res + \" \" + this.ASYNC_TOKEN : this.ASYNC_TOKEN;\n }\n\n return res;\n }\n\n transformLeadingComment(comment) {\n return comment; // to override\n }\n\n transformTrailingComment(comment) {\n return comment; // to override\n }\n\n printLeadingComments(node, identation) {\n const fullText = this.getSrc().getFullText();\n const commentsRangeList = getLeadingCommentRanges(fullText, node.pos);\n const commentsRange = commentsRangeList ? commentsRangeList : undefined;\n let res = \"\";\n if (commentsRange) {\n for (const commentRange of commentsRange) {\n const commentText = fullText.slice(commentRange.pos, commentRange.end);\n if (commentText !== undefined) {\n const formatted = commentText\n .split(\"\\n\")\n .map(line=>line.trim())\n .map(line => !(line.trim().startsWith(\"*\")) ? this.getIden(identation) + line : this.getIden(identation) + \" \" + line) .join(\"\\n\");\n res+= this.transformLeadingComment(formatted) + \"\\n\";\n }\n }\n }\n return res;\n }\n\n printTraillingComment(node, identation) {\n const fullText = this.getSrc().getFullText();\n const commentsRangeList = getTrailingCommentRanges(fullText, node.end);\n const commentsRange = commentsRangeList ? commentsRangeList : undefined;\n let res = \"\";\n if (commentsRange) {\n for (const commentRange of commentsRange) {\n const commentText = fullText.slice(commentRange.pos, commentRange.end);\n if (commentText !== undefined) {\n res+= \" \" + this.transformTrailingComment(commentText);\n }\n }\n }\n return res;\n }\n\n printNodeCommentsIfAny(node, identation, parsedNode) {\n const leadingComment = this.printLeadingComments(node, identation);\n const trailingComment = this.printTraillingComment(node, identation);\n return leadingComment + parsedNode + trailingComment;\n }\n\n getType(node) {\n // try to get type from declared type, example: x: string = \"foo\"\n const type = node.type;\n if (type) {\n if (type.kind === SyntaxKind.TypeReference) {\n const typeRef = type.typeName.text;\n if (typeRef === \"Promise\") {\n const typeArgs = type.typeArguments.filter(t => t.kind !== SyntaxKind.VoidKeyword);\n const insideTypes = typeArgs.map(type => {\n if (this.SupportedKindNames.hasOwnProperty(type.kind)) { // eslint-disable-line\n return this.SupportedKindNames[type.kind];\n } else {\n return type.text;\n }\n }).join(\",\");\n\n if (insideTypes.length > 0) {\n return `${this.PROMISE_TYPE_KEYWORD}<${insideTypes}>`;\n }\n return this.PROMISE_TYPE_KEYWORD;\n }\n return type.typeName.text;\n } else if (this.SupportedKindNames.hasOwnProperty(type.kind)) { // eslint-disable-line\n return this.SupportedKindNames[type.kind];\n }\n }\n\n // todo: infer from initializer re-think this logic ex: x = 1;\n // can we use the type checker here?\n const initializer = node.initializer;\n if (initializer) {\n if (isArrayLiteralExpression(initializer)) {\n return this.ARRAY_KEYWORD;\n }\n if (isBooleanLiteral(initializer)) {\n return this.BOOLEAN_KEYWORD;\n }\n if (isObjectLiteralExpression(initializer)) {\n return this.OBJECT_KEYWORD;\n }\n if (isNumericLiteral(initializer)) {\n // return this.NUMBER_TYPE_TOKEN;\n // const value = initializer.text;\n // const num = Number(value);\n // if (Number.isInteger(num)) {\n // return this.INTEGER_KEYWORD;\n // }\n // return this.NUMBER_KEYWORD;\n return this.DEFAULT_TYPE; // int and number to object\n }\n if (isStringLiteralLikeNode(initializer)) {\n return this.STRING_KEYWORD;\n }\n }\n return undefined;\n }\n\n getTypeFromRawType(type) {\n // check for primitive types\n if (type.flags === TypeFlags.Any) {\n return undefined;\n }\n if (type.flags === TypeFlags.Void) {\n return this.VOID_KEYWORD;\n }\n if (type.flags === TypeFlags.Number) {\n // return this.NUMBER_KEYWORD;\n return this.DEFAULT_TYPE;\n }\n\n if (type.flags === TypeFlags.String) {\n return this.STRING_KEYWORD;\n }\n // if (type.flags === ts.TypeFlags.Boolean) {\n // return this.BOOLEAN_KEYWORD;\n // }\n\n // check for array or object\n\n if (type?.getSymbol()?.escapedName === 'Array') {\n return this.ARRAY_KEYWORD;\n }\n if (type?.getSymbol()?.escapedName === '__object') {\n return this.OBJECT_KEYWORD;\n }\n\n // check this out, trying to resolve Promise<{}>\n if (type?.getSymbol()?.escapedName === '__type') {\n return this.OBJECT_KEYWORD;\n // return this.DEFAULT_TYPE;\n }\n\n // check for promise type\n\n if (type?.getSymbol()?.escapedName === 'Promise') {\n return this.PROMISE_TYPE_KEYWORD;\n }\n\n // check this out not sure about this\n if (type?.intrinsicName === 'object') {\n return this.OBJECT_KEYWORD;\n }\n if (type?.intrinsicName === 'boolean') {\n return this.BOOLEAN_KEYWORD;\n }\n\n return undefined;\n }\n\n getFunctionType(node, async = true){\n // use type checker to do it here\n const type = this.getChecker().getReturnTypeOfSignature(this.getChecker().getSignatureFromDeclaration(node));\n\n const parsedTtype = this.getTypeFromRawType(type);\n\n if (parsedTtype === this.PROMISE_TYPE_KEYWORD) {\n const resolvedTypeArguments = this.getChecker().getTypeArguments(type as any);\n if (resolvedTypeArguments.length === 0) {\n return this.PROMISE_TYPE_KEYWORD;\n }\n if (resolvedTypeArguments.length === 1 && resolvedTypeArguments[0].flags === TypeFlags.Void) {\n return this.PROMISE_TYPE_KEYWORD;\n }\n\n const insideTypes = resolvedTypeArguments.map(type => this.getTypeFromRawType(type)).join(\",\");\n if (insideTypes.length > 0) {\n if (async) {\n return `${this.PROMISE_TYPE_KEYWORD}<${insideTypes}>`;\n } else {\n return insideTypes;\n }\n }\n return undefined;\n }\n return parsedTtype;\n }\n\n printFunctionBody(node, identation) {\n return this.printBlock(node.body, identation);\n }\n\n printParameterType(node) {\n if (!this.requiresParameterType) {\n return \"\";\n }\n\n if (!this.INFER_ARG_TYPE) {\n return this.DEFAULT_PARAMETER_TYPE;\n }\n\n const type = this.getChecker().typeToString(this.getChecker().getTypeAtLocation(node));\n\n if (this.ArgTypeReplacements[type]) {\n return this.ArgTypeReplacements[type];\n }\n\n return this.DEFAULT_PARAMETER_TYPE;\n }\n\n printFunctionType(node){\n if (!this.requiresReturnType) {\n return \"\";\n }\n\n const typeText = this.getFunctionType(node);\n if (typeText === undefined || (typeText !== this.VOID_KEYWORD && typeText !== this.PROMISE_TYPE_KEYWORD)) {\n // throw new FunctionReturnTypeError(\"Function return type is not supported\");\n let res = \"\";\n if (this.isAsyncFunction(node)) {\n res = `${this.PROMISE_TYPE_KEYWORD}<${this.DEFAULT_RETURN_TYPE}>`;\n } else {\n res = this.DEFAULT_RETURN_TYPE;\n }\n this.warn(node, node.name.getText(), \"Function return type not found, will default to: \" + res);\n return res;\n }\n return typeText;\n }\n\n\n printFunctionDefinition(node, identation) {\n let name = node.name?.text ?? \"\";\n name = this.transformFunctionNameIfNeeded(name);\n\n // const parsedArgs = node.parameters.map(param => this.printParameter(param)).join(\", \");\n const parsedArgs = this.printMethodParameters(node);\n\n let modifiers = this.printModifiers(node);\n modifiers = modifiers ? modifiers + \" \" : modifiers;\n\n let returnType = this.printFunctionType(node);\n // quick fix\n if (returnType === 'java.util.concurrent.CompletableFuture') {\n returnType = 'java.util.concurrent.CompletableFuture';\n }\n\n returnType = returnType ? returnType + \" \" : returnType;\n\n const fnKeyword = this.FUNCTION_TOKEN ? this.FUNCTION_TOKEN + \" \" : \"\";\n if (!fnKeyword && isFunctionDeclaration(node)){\n modifiers = modifiers + \"public \";\n }\n let functionDef = this.getIden(identation) + modifiers + returnType + fnKeyword;\n if (this.includeFunctionNameInFunctionExpressionDeclaration || !isFunctionExpression(node)) {\n functionDef += name;\n }\n functionDef += \"(\" + parsedArgs + \")\";\n\n return functionDef;\n }\n\n transformFunctionNameIfNeeded(name): string {\n return this.unCamelCaseIfNeeded(name);\n }\n\n printFunctionDeclaration(node, identation) {\n if (isArrowFunction(node)) {\n const parameters = node.parameters.map(param => this.printParameter(param)).join(\", \");\n const body = this.printNode(node.body);\n return `(${parameters}) => ${body}`;\n }\n const funcBody = this.printFunctionBody(node, identation);\n let functionDef = this.printFunctionDefinition(node, identation);\n functionDef += funcBody;\n\n return this.printNodeCommentsIfAny(node, identation, functionDef);\n }\n\n printMethodParameters(node) {\n return node.parameters.map(param => this.printParameter(param)).join(\", \");\n }\n\n transformMethodNameIfNeeded(name: string): string {\n return this.unCamelCaseIfNeeded(name);\n }\n\n printMethodDefinition(node, identation) {\n let name = node.name.text;\n name = this.transformMethodNameIfNeeded(name);\n\n let returnType = this.printFunctionType(node);\n\n let modifiers = this.printModifiers(node);\n const defaultAccess = this.METHOD_DEFAULT_ACCESS ? this.METHOD_DEFAULT_ACCESS + \" \": \"\";\n modifiers = modifiers ? modifiers + \" \" : defaultAccess; // tmp check this\n\n const parsedArgs = this.printMethodParameters(node);\n\n returnType = returnType ? returnType + \" \" : returnType;\n\n const methodToken = this.METHOD_TOKEN ? this.METHOD_TOKEN + \" \" : \"\";\n const methodDef = this.getIden(identation) + modifiers + returnType + methodToken + name\n + \"(\" + parsedArgs + \")\";\n\n return this.printNodeCommentsIfAny(node, identation, methodDef);\n }\n\n printMethodDeclaration(node, identation) {\n\n let methodDef = this.printMethodDefinition(node, identation);\n\n const funcBody = this.printFunctionBody(node, identation);\n\n methodDef += funcBody;\n\n return methodDef;\n }\n\n printStringLiteral(node) {\n const token = this.STRING_QUOTE_TOKEN;\n let text = node.text;\n if (text in this.StringLiteralReplacements) {\n return this.StringLiteralReplacements[text];\n }\n // trick to preserve valid backslashes (e.g. \\n, \\t)\n const backslashPlaceholder = \"\\x00\";\n text = text.replaceAll(\"\\\\\", backslashPlaceholder);\n text = text.replaceAll(\"\\b\", \"\\\\b\");\n text = text.replaceAll(\"\\f\", \"\\\\f\");\n text = text.replaceAll(\"\\n\", \"\\\\n\");\n text = text.replaceAll(\"\\r\", \"\\\\r\");\n text = text.replaceAll(\"\\t\", \"\\\\t\");\n text = text.replaceAll(backslashPlaceholder, \"\\\\\\\\\");\n if (token === \"'\") {\n text = text.replaceAll(\"'\", \"\\\\'\"); // escape single quotes\n } else if (token === \"\\\"\") {\n text = text.replaceAll(\"\\\"\", \"\\\\\\\"\"); // escape double quotes\n }\n return token + text + token;\n }\n\n printNumericLiteral(node) {\n return node.text;\n }\n\n printArrayLiteralExpression(node, identation) {\n\n const elements = node.elements.map((e) => {\n return this.printNode(e);\n }).join(\", \");\n return this.ARRAY_OPENING_TOKEN + elements + this.ARRAY_CLOSING_TOKEN;\n }\n\n printVariableDeclarationList(node,identation) {\n const declaration = node.declarations[0];\n const varToken = this.VAR_TOKEN ? this.VAR_TOKEN + \" \": \"\";\n\n if (this.removeVariableDeclarationForFunctionExpression && declaration?.initializer && (isFunctionExpression(declaration.initializer) || isArrowFunction(declaration.initializer))) {\n return this.printNode(declaration.initializer, identation).trimEnd();\n }\n // const name = declaration.name.escapedText;\n const parsedValue = (declaration.initializer) ? this.printNode(declaration.initializer, identation) : this.NULL_TOKEN;\n return this.getIden(identation) + varToken + this.printNode(declaration.name) + \" = \" + parsedValue.trim();\n }\n\n printVariableStatement(node, identation){\n\n if (this.isCJSRequireStatement(node)) {\n return \"\"; // remove cjs imports\n }\n\n const decList = node.declarationList;\n const varStatement = this.printVariableDeclarationList(decList, identation) + this.LINE_TERMINATOR;\n return this.printNodeCommentsIfAny(node, identation, varStatement);\n }\n\n printOutOfOrderCallExpressionIfAny(node, identation) {\n return undefined; // stub to override\n }\n\n printSuperCallInsideConstructor(node, identation) {\n const args = node.arguments;\n\n const parsedArgs = args.map((a) => {\n return this.printNode(a, identation).trim();\n }).join(\",\");\n return this.SUPER_CALL_TOKEN + \"(\" + parsedArgs + \")\";\n }\n\n isBuiltInFunctionCall(node) {\n const symbol = this.getChecker().getSymbolAtLocation(node);\n const isInLibFiles = symbol?.declarations\n ?.some(d => /\\/node_modules\\/(typescript|@typescript\\/typescript-[^/]+)\\/lib\\//.test(d.path))\n ?? false;\n\n\n return isInLibFiles;\n }\n\n getTypesFromCallExpressionParameters(node) {\n const resolvedParams = this.getChecker().getResolvedSignature(node).getParameters();\n const parsedTypes = [];\n resolvedParams.forEach((p) => {\n const decl = p.declarations[0].resolve();\n const type = this.getChecker().getTypeAtLocation(decl);\n const parsedType = this.getTypeFromRawType(type);\n parsedTypes.push(parsedType);\n });\n return parsedTypes;\n }\n\n printArgsForCallExpression(node, identation) {\n const args = node.arguments;\n\n const argsList = args.length > 0 ? args : [];\n const parsedArgs = argsList.map((a) => {\n return this.printNode(a, identation).trim();\n }).join(\", \");\n return parsedArgs;\n }\n\n // builtin functions override\n printArrayIsArrayCall(node, identation, parsedArg = undefined) {\n return undefined; // stub\n }\n\n printObjectKeysCall(node, identation, parsedArg = undefined) {\n return undefined; // stub\n }\n\n printObjectValuesCall(node, identation, parsedArg = undefined) {\n return undefined; // stub\n }\n\n printJsonParseCall(node, identation, parsedArg = undefined) {\n return undefined; // stub\n }\n\n printJsonStringifyCall(node, identation, parsedArg = undefined) {\n return undefined; // stub\n }\n\n\n printPromiseAllCall(node, identation, parsedArg = undefined) {\n return undefined; // stub\n }\n\n printMathFloorCall(node, identation, parsedArg = undefined) {\n return undefined; // stub\n }\n\n printMathRoundCall(node, identation, parsedArg = undefined) {\n return undefined; // stub\n }\n\n printMathCeilCall(node, identation, parsedArg = undefined) {\n return undefined; // stub\n }\n\n printNumberIsIntegerCall(node, identation, parsedArg = undefined) {\n return undefined; // stub\n }\n\n printArrayPushCall(node, identation, name = undefined, parsedArg = undefined) {\n return undefined; // stub\n }\n\n printIncludesCall(node, identation, name = undefined, parsedArg = undefined) {\n return undefined; // stub\n }\n\n printIndexOfCall(node, identation, name = undefined, parsedArg = undefined) {\n return undefined; // stub\n }\n\n printStartsWithCall(node, identation, name = undefined, parsedArg = undefined) {\n return undefined; // stub\n }\n\n printEndsWithCall(node, identation, name = undefined, parsedArg = undefined) {\n return undefined; // stub\n }\n\n printPadEndCall(node, identation, name, parsedArg, parsedArg2) {\n return undefined; // stub\n }\n\n printPadStartCall(node, identation, name, parsedArg, parsedArg2) {\n return undefined; // stub\n }\n\n printTrimCall(node, identation, name = undefined) {\n return undefined; // stub\n }\n\n printJoinCall(node, identation, name = undefined, parsedArg = undefined) {\n return undefined; // stub\n }\n\n printSplitCall(node, identation, name = undefined, parsedArg = undefined) {\n return undefined; // stub\n }\n\n printConcatCall(node, identation, name = undefined, parsedArg = undefined) {\n return undefined; // stub\n }\n\n printToFixedCall(node, identation, name = undefined, parsedArg = undefined) {\n return undefined; // stub\n }\n\n printSearchCall(node, identation, name = undefined, parsedArg = undefined) {\n return undefined; // stub\n }\n\n printSliceCall(node, identation, name = undefined, parsedArg = undefined, parsedArg2 = undefined) {\n return undefined; // stub\n }\n\n printReplaceCall(node, identation, name = undefined, parsedArg = undefined, parsedArg2 = undefined) {\n return undefined; // stub\n }\n\n printReplaceAllCall(node, identation, name = undefined, parsedArg = undefined, parsedArg2 = undefined) {\n return undefined; // stub\n }\n\n printToStringCall(node, identation, name = undefined) {\n return undefined; // stub\n }\n\n printToUpperCaseCall(node, identation, name = undefined) {\n return undefined; // stub\n }\n\n printToLowerCaseCall(node, identation, name = undefined) {\n return undefined; // stub\n }\n\n printShiftCall(node, identation, name = undefined) {\n return undefined; // stub\n }\n\n printReverseCall(node, identation, name = undefined) {\n return undefined; // stub\n }\n\n printPopCall(node, identation, name = undefined) {\n return undefined; // stub\n }\n\n printAssertCall(node, identation, parsedArgs) {\n return `assert(${parsedArgs})`;\n }\n\n printDateNowCall(node, identation) {\n return undefined; // stub\n }\n\n printCallExpression(node, identation) {\n const expression = node.expression;\n\n const parsedArgs = this.printArgsForCallExpression(node, identation);\n\n const removeParenthesis = this.shouldRemoveParenthesisFromCallExpression(node);\n\n const finalExpression = this.printOutOfOrderCallExpressionIfAny(node, identation);\n if (finalExpression) {\n return finalExpression;\n }\n\n // check propertyAccessExpression for built in functions calls like Json.parse\n if (node.expression.kind === SyntaxKind.PropertyAccessExpression) {\n const expressionText = node.expression.getText().trim();\n const args = node.arguments ?? [];\n\n if (args.length === 0) {\n switch(expressionText) {\n case \"Date.now\":\n return this.printDateNowCall(node, identation);\n }\n }\n\n if (args.length === 1) {\n const parsedArg = this.printNode(args[0], 0);\n switch (expressionText) {\n case \"JSON.parse\":\n return this.printJsonParseCall(node, identation, parsedArg);\n case \"JSON.stringify\":\n return this.printJsonStringifyCall(node, identation, parsedArg);\n case \"Array.isArray\":\n return this.printArrayIsArrayCall(node, identation, parsedArg);\n case \"Object.keys\":\n return this.printObjectKeysCall(node, identation, parsedArg);\n case \"Object.values\":\n return this.printObjectValuesCall(node, identation, parsedArg);\n case \"Promise.all\":\n return this.printPromiseAllCall(node, identation, parsedArg);\n case \"Math.round\":\n return this.printMathRoundCall(node, identation, parsedArg);\n case \"Math.floor\":\n return this.printMathFloorCall(node, identation, parsedArg);\n case \"Math.ceil\":\n return this.printMathCeilCall(node, identation, parsedArg);\n case \"Number.isInteger\":\n return this.printNumberIsIntegerCall(node, identation, parsedArg);\n }\n }\n const rightSide = node.expression.name?.text;\n const leftSide = node.expression?.expression;\n\n if (args.length === 0 && rightSide !== undefined && leftSide !== undefined) {\n const parsedLeftSide = this.printNode(leftSide, 0);\n switch (rightSide) {\n case \"toString\":\n return this.printToStringCall(node, identation, parsedLeftSide);\n case \"toUpperCase\":\n return this.printToUpperCaseCall(node, identation, parsedLeftSide);\n case \"toLowerCase\":\n return this.printToLowerCaseCall(node, identation, parsedLeftSide);\n case \"shift\":\n return this.printShiftCall(node, identation, parsedLeftSide);\n case \"pop\":\n return this.printPopCall(node, identation, parsedLeftSide);\n case \"reverse\":\n return this.printReverseCall(node, identation, parsedLeftSide);\n case \"trim\":\n return this.printTrimCall(node, identation, parsedLeftSide);\n }\n }\n\n // handle built in functions like\n\n const arg = args && args.length > 0 ? args[0] : undefined;\n\n if (leftSide && rightSide && arg) {\n const parsedArg = this.printNode(arg, identation).trimStart();\n const secondParsedArg = args[1] ? this.printNode(args[1], identation).trimStart() : undefined;\n const name = this.printNode(leftSide, 0);\n switch(rightSide) {\n case 'push':\n return this.printArrayPushCall(node, identation, name, parsedArg);\n case 'includes':\n return this.printIncludesCall(node, identation, name, parsedArg);\n case 'indexOf':\n return this.printIndexOfCall(node, identation, name, parsedArg);\n case 'join':\n return this.printJoinCall(node, identation, name, parsedArg);\n case 'split':\n return this.printSplitCall(node, identation, name, parsedArg);\n case 'toFixed':\n return this.printToFixedCall(node, identation, name, parsedArg);\n case 'concat':\n return this.printConcatCall(node, identation, name, parsedArg);\n case 'search':\n return this.printSearchCall(node, identation, name, parsedArg);\n case 'endsWith':\n return this.printEndsWithCall(node, identation, name, parsedArg);\n case 'startsWith':\n return this.printStartsWithCall(node, identation, name, parsedArg);\n case 'padEnd':\n return this.printPadEndCall(node, identation, name, parsedArg, secondParsedArg);\n case 'padStart':\n return this.printPadStartCall(node, identation, name, parsedArg, secondParsedArg);\n }\n\n if (args.length === 1 || args.length === 2) {\n const parsedArg2 = args[1] ? this.printNode(args[1], identation).trimStart() : undefined;\n switch(rightSide) {\n case 'slice':\n return this.printSliceCall(node, identation, name, parsedArg, parsedArg2);\n case 'replace':\n return this.printReplaceCall(node, identation, name, parsedArg, parsedArg2);\n case 'replaceAll':\n return this.printReplaceAllCall(node, identation, name, parsedArg, parsedArg2);\n }\n }\n }\n } else {\n // handle functions like assert\n const args = node.arguments ?? [];\n if (args.length === 2) {\n if ( expression.text === \"assert\") {\n return this.printAssertCall(node, identation, parsedArgs);\n }\n if (expression.text === \"padEnd\") {\n // check this\n }\n }\n }\n\n // print super() call inside constructor\n if (expression.kind === SyntaxKind.SuperKeyword) {\n return this.printSuperCallInsideConstructor(node, identation);\n }\n\n let parsedExpression = undefined;\n if (this.CallExpressionReplacements.hasOwnProperty(expression.getText())) { // eslint-disable-line\n parsedExpression = this.CallExpressionReplacements[expression.getText()];\n } else {\n if (expression.kind === SyntaxKind.Identifier) {\n const idValue = expression.text ?? expression.text;\n parsedExpression = this.transformCallExpressionName(this.unCamelCaseIfNeeded(idValue), expression);\n } else {\n parsedExpression = this.printNode(expression, 0);\n }\n }\n\n let parsedCall = parsedExpression;\n if (!removeParenthesis) {\n parsedCall+= \"(\" + parsedArgs + \")\";\n\n }\n return parsedCall;\n }\n\n printClassBody(node, identation) {\n // const parsedMembers = node.members.map(m => this.printNode(m, identation+1));\n\n const parsedMembers = [];\n node.members.forEach( (m, index) => {\n const parsedNode = this.printNode(m, identation+1);\n if (m.kind === SyntaxKind.PropertyDeclaration || index === 0) {\n parsedMembers.push(parsedNode);\n } else {\n parsedMembers.push(\"\\n\".repeat(this.NUM_LINES_BETWEEN_CLASS_MEMBERS) + parsedNode);\n }\n });\n return parsedMembers.join(\"\\n\");\n }\n\n getCustomClassName(node) {\n return node.name.text;\n }\n\n getClassModifier(node) {\n return \"\";\n }\n\n printClassDefinition(node, identation) {\n const className = this.getCustomClassName(node);\n this.currentClassName = className;\n const heritageClauses = node.heritageClauses;\n const classModifier = this.getClassModifier(node);\n\n let classInit = \"\";\n const classOpening = this.getBlockOpen(identation);\n if (heritageClauses !== undefined) {\n const classExtends = heritageClauses[0].types[0].expression.text;\n classInit = this.getIden(identation) + classModifier + \"class \" + className + \" \" + this.EXTENDS_TOKEN + \" \" + classExtends + classOpening;\n } else {\n classInit = this.getIden(identation) + classModifier + \"class \" + className + classOpening;\n }\n return classInit;\n }\n\n printClass(node, identation) {\n\n const classDefinition = this.printClassDefinition(node, identation);\n\n const classBody = this.printClassBody(node, identation);\n\n const classClosing = this.getBlockClose(identation);\n\n return classDefinition + classBody + classClosing;\n }\n\n printConstructorDeclaration (node, identation) {\n const args = this.printMethodParameters(node);\n const constructorBody = this.printFunctionBody(node, identation);\n return this.getIden(identation) +\n this.CONSTRUCTOR_TOKEN +\n \"(\" + args + \")\" +\n constructorBody;\n }\n\n printWhileStatement(node, identation) {\n const loopExpression = node.expression;\n\n const expression = this.printNode(loopExpression, 0);\n\n const whileStm = this.getIden(identation) +\n this.WHILE_TOKEN + \" \" +\n this.CONDITION_OPENING + expression + this.CONDITION_CLOSE +\n this.printBlock(node.statement, identation);\n return this.printNodeCommentsIfAny(node, identation, whileStm);\n }\n\n printForStatement(node, identation) {\n const initializer = this.printNode(node.initializer, 0);\n const condition = this.printNode(node.condition, 0);\n const incrementor = this.printNode(node.incrementor, 0);\n\n const forStm = this.getIden(identation) +\n this.FOR_TOKEN + \" \" +\n this.CONDITION_OPENING +\n initializer + \"; \" + condition + \"; \" + incrementor +\n this.CONDITION_CLOSE +\n this.printBlock(node.statement, identation);\n return this.printNodeCommentsIfAny(node, identation, forStm);\n }\n\n printBreakStatement(node, identation) {\n const breakStm = this.getIden(identation) + this.BREAK_TOKEN + this.LINE_TERMINATOR;\n return this.printNodeCommentsIfAny(node, identation, breakStm);\n }\n\n printPostFixUnaryExpression(node, identation) {\n const {operand, operator} = node;\n return this.getIden(identation) + this.printNode(operand, 0) + this.PostFixOperators[operator];\n }\n\n printPrefixUnaryExpression(node, identation) {\n const {operand, operator} = node;\n if (operator === SyntaxKind.ExclamationToken) {\n // not branch check falsy/turthy values if needed;\n return this.getIden(identation) + this.PrefixFixOperators[operator] + this.printCondition(node.operand, 0);\n }\n return this.getIden(identation) + this.PrefixFixOperators[operator] + this.printNode(operand, 0);\n }\n\n printObjectLiteralBody(node, identation) {\n let body = node.properties.map((p) => this.printNode(p, identation+1)).join(\",\\n\");\n body = body ? body + \",\" : body;\n return body;\n }\n\n printObjectLiteralExpression(node, identation) {\n const objectBody = this.printObjectLiteralBody(node, identation);\n const formattedObjectBody = objectBody ? \"\\n\" + objectBody + \"\\n\" + this.getIden(identation) : objectBody;\n return this.OBJECT_OPENING + formattedObjectBody + this.OBJECT_CLOSING;\n }\n\n printCustomRightSidePropertyAssignment(node, identation): string {\n return undefined; // stub to override\n }\n\n printPropertyAssignment(node, identation) {\n const {name, initializer} = node;\n const nameAsString = this.printNode(name, 0);\n\n const customRightSide = this.printCustomRightSidePropertyAssignment(initializer, identation);\n\n const valueAsString = customRightSide ? customRightSide : this.printNode(initializer, identation);\n\n let trailingComment = this.printTraillingComment(node, identation);\n trailingComment = trailingComment ? \" \" + trailingComment : trailingComment;\n\n const propOpen = this.PROPERTY_ASSIGNMENT_OPEN ? this.PROPERTY_ASSIGNMENT_OPEN + \" \": \"\";\n const propClose = this.PROPERTY_ASSIGNMENT_CLOSE ? \" \" + this.PROPERTY_ASSIGNMENT_CLOSE : \"\";\n\n return this.getIden(identation) +\n propOpen +\n nameAsString +\n this.PROPERTY_ASSIGNMENT_TOKEN + \" \" +\n valueAsString.trim() +\n propClose +\n trailingComment;\n }\n\n printElementAccessExpressionExceptionIfAny(node) {\n return undefined; // stub to override\n }\n\n // index WRITE (`x[\"k\"] = v`) whose receiver the C# classifier already declared as a\n // concrete dictionary: the `((IDictionary)x)` interface cast the C#\n // branch below emits only exists because the TS type says nothing about the printed\n // declaration, so a printer that knows the declared type can drop it. undefined/false\n // keeps the upstream cast (the untyped emission). See csharpTranspiler.ts.\n csharpDictionaryIndexWriteNeedsNoCast(node): boolean | undefined {\n return undefined; // stub to override\n }\n\n printElementAccessExpression(node, identation) {\n // example x['test']\n const {expression, argumentExpression} = node;\n\n const exception = this.printElementAccessExpressionExceptionIfAny(node);\n if (exception) {\n return exception;\n }\n\n // when we want replace x['test'] with getValue(x, 'test') only when in the left side\n // Examples:\n // x[\"a\"] = x[\"b\"] : binary expression\n // const a = x[\"b\"] : variable declaration\n const isLeftSideOfAssignment = node.parent?.kind === SyntaxKind.BinaryExpression &&\n (node.parent.operatorToken.kind === SyntaxKind.EqualsToken || node.parent.operatorToken.kind === SyntaxKind.PlusEqualsToken) &&\n node.parent?.left === node;\n // to do; check nested accesses\n // const newNode = node.parent;\n // we need this loop because we might have x[\"t\"][\"test\"][\"key\"]\n // so the parent of the node might be another ElementAccessExpression and not the binary expression/variable declaration directly\n // to do\n // while (newNode !== undefined && newNode.kind !== ts.SyntaxKind.BinaryExpression) {\n // if (newNode.right === node) {\n // rightSideOfAssignment = true;\n // break;\n // }\n // newNode = newNode.parent;\n // }\n\n const expressionAsString = this.printNode(expression, 0);\n const argumentAsString = this.printNode(argumentExpression, 0);\n\n // c# only\n if (!isLeftSideOfAssignment && this.ELEMENT_ACCESS_WRAPPER_OPEN && this.ELEMENT_ACCESS_WRAPPER_CLOSE) {\n return `${this.ELEMENT_ACCESS_WRAPPER_OPEN}${expressionAsString}, ${argumentAsString}${this.ELEMENT_ACCESS_WRAPPER_CLOSE}`;\n }\n // cast order[\"test\"] to ((Dictionariy)order)[\"test\"] or List\n if (isLeftSideOfAssignment && this.ELEMENT_ACCESS_WRAPPER_OPEN && this.ELEMENT_ACCESS_WRAPPER_CLOSE) {\n const type = this.getChecker().getTypeAtLocation(argumentExpression);\n const isString = this.isStringType(type.flags);\n\n let isUnionString = false; // handle unions later\n if (type.flags === TypeFlags.Union) {\n isUnionString = this.isStringType((type as any).getTypes()[0].flags);\n }\n\n if (isString || isUnionString || type.flags === TypeFlags.Any) { // default to string when unknown\n // to do refactor and move this to the derived classes\n if (this.id === \"C#\") {\n const cast = isStringLiteralLikeNode(argumentExpression) ? \"\" : '(string)';\n // a receiver the C# classifier declared as a concrete dictionary needs no\n // interface cast (see csharpDictionaryIndexWriteNeedsNoCast); the key keeps\n // its own spelling, so only the receiver's cast is dropped\n if (this.csharpDictionaryIndexWriteNeedsNoCast(node)) {\n return `${expressionAsString}[${cast}${argumentAsString}]`;\n }\n return `((IDictionary)${expressionAsString})[${cast}${argumentAsString}]`;\n } else if (this.id === \"Java\") {\n return `((java.util.HashMap)${expressionAsString}).get(${argumentAsString})`;\n }\n // if (this.id === \"Go\") {\n // return `AddElementToObject(${expressionAsString}, ${argumentAsString})`;\n // }\n\n }\n if (this.id === \"C#\") {\n return `((${this.ARRAY_KEYWORD})${expressionAsString})[Convert.ToInt32(${argumentAsString})]`;\n } else if (this.id === \"Java\") {\n return `((java.util.List)${expressionAsString}).get(Helpers.toInt(${argumentAsString}))`;\n }\n\n }\n\n return expressionAsString + \"[\" + argumentAsString + \"]\";\n }\n\n printCondition (node, identation) {\n\n if (this.supportsFalsyOrTruthyValues) {\n // languages like php or python do not need this extra logic\n return this.printNode(node, identation);\n }\n\n // can be called from ifs or conditional expressions or binary expressions so might contain the ! operator\n if (node.kind === SyntaxKind.PrefixUnaryExpression && node.operator === SyntaxKind.ExclamationToken) {\n return this.printPrefixUnaryExpression(node, identation); // avoid infinite recursion\n }\n\n // wrap falsy/truthy expressions unconditionally: printing the node once and\n // wrapping is equivalent to the previous always-true branches, which printed\n // the subtree twice and queried the type checker without using the result\n const expression = `${this.FALSY_WRAPPER_OPEN}${this.printNode(node, 0)}${this.FALSY_WRAPPER_CLOSE}`;\n return `${this.getIden(identation)}${expression}`; // stub to override\n }\n\n\n printIfStatement(node, identation) {\n\n const expression = this.printCondition(node.expression, 0);\n\n const elseExists = node.elseStatement !== undefined;\n const isElseIf = node.parent.kind === SyntaxKind.IfStatement;\n\n const needChainBlock = elseExists;\n const ifBody = this.printBlock(node.thenStatement, identation, needChainBlock);\n\n let ifComplete = this.CONDITION_OPENING + expression + this.CONDITION_CLOSE + ifBody;\n if (isElseIf) {\n ifComplete = this.ELSEIF_TOKEN + \" \" + ifComplete;\n } else {\n ifComplete = this.getIden(identation) + this.IF_TOKEN + \" \" + ifComplete;\n }\n\n const elseStatement = node.elseStatement;\n if (elseStatement?.kind === SyntaxKind.Block) {\n\n const elseBody = this.printBlock(elseStatement, identation);\n\n const elseBlock = this.ELSE_TOKEN + elseBody;\n\n ifComplete += elseBlock;\n\n } else if (elseStatement?.kind === SyntaxKind.IfStatement) {\n const elseBody = this.printIfStatement(elseStatement, identation);\n ifComplete += elseBody;\n }\n return this.printNodeCommentsIfAny(node, identation, ifComplete);\n }\n\n printParenthesizedExpression(node, identation) {\n if (node.expression.kind === SyntaxKind.AsExpression) {\n // transform (this as any) into this, () and as any are not necessary\n return this.getIden(identation) + this.printNode(node.expression, 0);\n }\n if (node.expression.kind === SyntaxKind.ArrowFunction) {\n // ignore arrowFunctions inside parenthesis\n return \"\";\n }\n return this.getIden(identation) + this.LEFT_PARENTHESIS + this.printNode(node.expression, 0) + this.RIGHT_PARENTHESIS;\n }\n\n printBooleanLiteral(node) {\n if (SyntaxKind.TrueKeyword === node.kind) {\n return this.TRUE_KEYWORD;\n }\n return this.FALSE_KEYWORD;\n }\n\n printTryStatement(node, identation) {\n const tryBody = this.printBlock(node.tryBlock, identation, true);\n\n const catchBody = this.printBlock(node.catchClause.block, identation);\n const catchDeclaration = this.CATCH_DECLARATION + \" \" + this.printNode(node.catchClause.variableDeclaration.name, 0);\n\n const catchCondOpen = this.CONDITION_OPENING ? this.CONDITION_OPENING : \" \";\n\n return this.getIden(identation) + this.TRY_TOKEN +\n tryBody +\n this.CATCH_TOKEN + catchCondOpen + catchDeclaration + this.CONDITION_CLOSE +\n catchBody;\n }\n\n printNewExpression(node, identation) {\n let expression = node.expression?.text;\n expression = expression ? expression : this.printNode(node.expression); // new Exception or new exact[string] check this out\n const args = node.arguments.map(n => this.printNode(n, identation)).join(\", \");\n const newToken = this.NEW_TOKEN ? this.NEW_TOKEN + \" \" : \"\";\n return newToken + expression + this.LEFT_PARENTHESIS + args + this.RIGHT_PARENTHESIS;\n }\n\n printThrowStatement(node, identation) {\n const expression = this.printNode(node.expression, 0);\n return this.getIden(identation) + this.THROW_TOKEN + \" \" + expression + this.LINE_TERMINATOR;\n }\n\n printAwaitExpression(node, identation) {\n const expression = this.printNode(node.expression, identation);\n const awaitToken = this.asyncTranspiling ? this.AWAIT_TOKEN + \" \" : \"\";\n return awaitToken + expression;\n }\n\n wrapSyntheticNode(synthetic, original) {\n // give the synthetic wrapper the original node's source range and splice it\n // into the parent chain, so position/type based helpers keep working\n synthetic.pos = original.pos;\n synthetic.end = original.end;\n synthetic.parent = original.parent;\n original.parent = synthetic;\n return synthetic;\n }\n\n wrapImplicitReturnAwait(node) {\n // inside a non-async function transpiled as async (isImplicitAsyncFunction),\n // returned Promises must be awaited to keep the generated code equivalent to\n // the classic `async`/`return await` form: wrap them in a synthetic await\n // expression so every language prints them through its usual await path\n let exp = node.expression;\n if (!exp || isAwaitExpression(exp)\n || !this.isImplicitAsyncFunction(findAncestor(node, isFunctionLike))\n || !this.isPromiseType(this.getChecker().getTypeAtLocation(exp))) {\n return node;\n }\n if (isConditionalExpression(exp) || isBinaryExpression(exp)) {\n // an await-token prefix would change precedence (e.g. `await a ? b : c`)\n exp = this.wrapSyntheticNode(createParenthesizedExpression(exp), exp);\n }\n // TS7 program nodes are read-only: print a synthetic return in place of the original\n const synthetic = this.wrapSyntheticNode(createReturnStatement(undefined), node);\n const awaited = this.wrapSyntheticNode(createAwaitExpression(exp), exp);\n awaited.parent = synthetic;\n Object.defineProperty(synthetic, \"expression\", { value: awaited });\n node.parent = synthetic.parent;\n return synthetic;\n }\n\n printConditionalExpression(node, identation) {\n const condition = this.printCondition(node.condition, identation);\n const whenTrue = this.printNode(node.whenTrue, 0);\n const whenFalse = this.printNode(node.whenFalse, 0);\n\n return condition + \" ? \" + whenTrue + \" : \" + whenFalse;\n }\n\n printAsExpression(node, identation) {\n return this.printNode(node.expression, identation);\n }\n\n getFunctionNodeFromReturn(node) {\n let parent = node.parent;\n while (parent) {\n if (parent.kind === SyntaxKind.FunctionDeclaration || parent.kind === SyntaxKind.MethodDeclaration) {\n return parent;\n }\n parent = parent.parent;\n }\n return undefined;\n }\n\n\n printReturnStatement(node, identation) {\n const leadingComment = this.printLeadingComments(node, identation);\n let trailingComment = this.printTraillingComment(node, identation);\n trailingComment = trailingComment ? \" \" + trailingComment : trailingComment;\n const exp = node.expression;\n let rightPart = exp ? (' ' + this.printNode(exp, identation)) : '';\n rightPart = rightPart.trim();\n\n // cast return type if needed\n // if (false && this.requiresCallExpressionCast) {\n // const functionNode = this.getFunctionNodeFromReturn(node);\n // let functionType = this.getFunctionType(functionNode, false);\n // if (functionType === undefined) {\n // // check the parent method type if any\n // const overrideMethod = this.getMethodOverride(functionNode);\n // if (overrideMethod !== undefined) {\n // functionType = this.getFunctionType(overrideMethod, false);\n // }\n // }\n // if (functionType && exp?.kind !== ts.SyntaxKind.UndefinedKeyword) {\n // rightPart = rightPart ? ' ' + `((${functionType}) (${rightPart}))` + this.LINE_TERMINATOR : this.LINE_TERMINATOR;\n // return leadingComment + this.getIden(identation) + this.RETURN_TOKEN + rightPart + trailingComment;\n // }\n // }\n rightPart = rightPart ? ' ' + rightPart + this.LINE_TERMINATOR : this.LINE_TERMINATOR;\n return leadingComment + this.getIden(identation) + this.RETURN_TOKEN + rightPart + trailingComment;\n }\n\n printArrayBindingPattern(node, identation) {\n const elements = node.elements.map((e) => this.printNode(e.name, identation)).join(\", \");\n return this.getIden(identation) + this.ARRAY_OPENING_TOKEN + elements + this.ARRAY_CLOSING_TOKEN;\n }\n\n printBlock(node, identation, chainBlock = false) {\n const blockOpen = this.getBlockOpen(identation);\n const blockClose = this.getBlockClose(identation, chainBlock);\n const statements = node.statements.map((s) => this.printNode(s, identation+1)).join(\"\\n\");\n\n return blockOpen + statements + blockClose;\n }\n\n printExpressionStatement(node, identation) {\n if (this.isCJSModuleExportsExpressionStatement(node)) {\n return \"\"; // remove module.exports = ...\n }\n\n const expressionStatementPrefixes = this.getExpressionStatementPrefixesIfAny(node, identation) ?? \"\";\n\n const exprStm = this.printNode(node.expression, identation);\n\n // skip empty statements\n if (exprStm.length === 0) {\n return \"\";\n }\n const expStatement = expressionStatementPrefixes + this.getIden(identation) + exprStm + this.LINE_TERMINATOR;\n return this.printNodeCommentsIfAny(node, identation, expStatement);\n }\n\n getExpressionStatementPrefixesIfAny(node, identation) {\n return undefined;\n }\n\n printPropertyDeclaration(node, identation) {\n const modifiers = this.printPropertyAccessModifiers(node);\n const name = this.printNode(node.name, 0);\n if (node.initializer) {\n const initializer = this.printNode(node.initializer, 0);\n return this.getIden(identation) + modifiers + name + \" = \" + initializer + this.LINE_TERMINATOR;\n }\n return this.getIden(identation) + modifiers + name + this.LINE_TERMINATOR;\n }\n\n printPropertyAccessModifiers (node) {\n let modifiers = this.printModifiers(node);\n modifiers = modifiers ? modifiers + \" \" : modifiers;\n return modifiers;\n }\n\n printSpreadElement(node, identation) {\n const expression = this.printNode(node.expression, 0);\n return this.getIden(identation) + this.SPREAD_TOKEN + expression;\n }\n\n printNullKeyword(node, identation){\n return this.getIden(identation) + this.NULL_TOKEN;\n }\n\n printContinueStatement(node, identation){\n return this.getIden(identation) + this.CONTINUE_TOKEN + this.LINE_TERMINATOR;\n }\n\n printDeleteExpression (node, identation) {\n return undefined;\n }\n\n printThisKeyword(node, identation) {\n return this.THIS_TOKEN;\n }\n\n printNode(node, identation = 0): string {\n\n try {\n // dispatch on node.kind directly: every ts.isX predicate used here is a\n // plain kind comparison, and a switch avoids running ~45 predicate calls\n // for nodes that match late (or not at all) in the former if-else chain\n switch (node.kind) {\n case SyntaxKind.ExpressionStatement:\n return this.printExpressionStatement(node, identation);\n case SyntaxKind.Block:\n return this.printBlock(node, identation);\n case SyntaxKind.FunctionDeclaration:\n case SyntaxKind.FunctionExpression:\n case SyntaxKind.ArrowFunction:\n return this.printFunctionDeclaration(node, identation);\n case SyntaxKind.ClassDeclaration:\n return this.printClass(node, identation);\n case SyntaxKind.VariableStatement:\n return this.printVariableStatement(node, identation);\n case SyntaxKind.MethodDeclaration:\n return this.printMethodDeclaration(node, identation);\n case SyntaxKind.StringLiteral:\n return this.printStringLiteral(node);\n case SyntaxKind.NumericLiteral:\n return this.printNumericLiteral(node);\n case SyntaxKind.PropertyAccessExpression:\n return this.printPropertyAccessExpression(node, identation);\n case SyntaxKind.ArrayLiteralExpression:\n return this.printArrayLiteralExpression(node, identation);\n case SyntaxKind.CallExpression:\n return this.printCallExpression(node, identation);\n case SyntaxKind.WhileStatement:\n return this.printWhileStatement(node, identation);\n case SyntaxKind.BinaryExpression:\n return this.printBinaryExpression(node, identation);\n case SyntaxKind.BreakStatement:\n return this.printBreakStatement(node, identation);\n case SyntaxKind.ForStatement:\n return this.printForStatement(node, identation);\n case SyntaxKind.PostfixUnaryExpression:\n return this.printPostFixUnaryExpression(node, identation);\n case SyntaxKind.VariableDeclarationList:\n return this.printVariableDeclarationList(node, identation); // statements are slightly different if inside a for\n case SyntaxKind.ObjectLiteralExpression:\n return this.printObjectLiteralExpression(node, identation);\n case SyntaxKind.PropertyAssignment:\n return this.printPropertyAssignment(node, identation);\n case SyntaxKind.Identifier:\n return this.printIdentifier(node);\n case SyntaxKind.ElementAccessExpression:\n return this.printElementAccessExpression(node, identation);\n case SyntaxKind.IfStatement:\n return this.printIfStatement(node, identation);\n case SyntaxKind.ParenthesizedExpression:\n return this.printParenthesizedExpression(node, identation);\n case SyntaxKind.TrueKeyword:\n case SyntaxKind.FalseKeyword:\n return this.printBooleanLiteral(node);\n case SyntaxKind.ThisKeyword:\n return this.printThisKeyword(node, identation);\n case SyntaxKind.SuperKeyword:\n return this.SUPER_TOKEN;\n case SyntaxKind.TryStatement:\n return this.printTryStatement(node, identation);\n case SyntaxKind.PrefixUnaryExpression:\n return this.printPrefixUnaryExpression(node, identation);\n case SyntaxKind.ThrowStatement:\n return this.printThrowStatement(node, identation);\n case SyntaxKind.NewExpression:\n return this.printNewExpression(node, identation);\n case SyntaxKind.AwaitExpression:\n return this.printAwaitExpression(node, identation);\n case SyntaxKind.ConditionalExpression:\n return this.printConditionalExpression(node, identation);\n case SyntaxKind.AsExpression:\n return this.printAsExpression(node, identation);\n case SyntaxKind.ReturnStatement:\n return this.printReturnStatement(this.wrapImplicitReturnAwait(node), identation);\n case SyntaxKind.ArrayBindingPattern:\n return this.printArrayBindingPattern(node, identation);\n case SyntaxKind.Parameter:\n return this.printParameter(node);\n case SyntaxKind.Constructor:\n return this.printConstructorDeclaration(node, identation);\n case SyntaxKind.PropertyDeclaration:\n return this.printPropertyDeclaration(node, identation);\n case SyntaxKind.SpreadElement:\n return this.printSpreadElement(node, identation);\n case SyntaxKind.NullKeyword:\n return this.printNullKeyword(node, identation);\n case SyntaxKind.ContinueStatement:\n return this.printContinueStatement(node, identation);\n case SyntaxKind.DeleteExpression:\n return this.printDeleteExpression(node, identation);\n }\n\n if (node.statements) {\n if (isSourceFile(node)) {\n // reset the current class name when entering a new file so a\n // class name from a previously transpiled file does not leak\n // into a class-less file (e.g. try/catch wrappers in tests)\n this.className = \"undefined\";\n }\n const transformedStatements = node.statements.map((m)=> {\n return this.printNode(m, identation + 1);\n });\n\n return transformedStatements.filter(st => st.length > 0 ).join(\"\\n\" + \"\\n\".repeat(this.LINES_BETWEEN_FILE_MEMBERS)) + \"\\n\".repeat(this.NUM_LINES_END_FILE);\n }\n return \"\";\n\n } catch (e) {\n if (!(e instanceof TranspilationError)) {\n console.error('[ast-transpiler] underlying error:', e && (e.stack || e.message || e));\n }\n throw new TranspilationError(this.id, (e && (e.messageText ?? e.message)) ?? String(e), node.getFullText(), node.pos, node.end);\n }\n }\n\n getFileESMImports(node): IFileImport[] {\n const result = [];\n const importStatements = node.statements.filter((s) => isImportDeclaration(s));\n importStatements.forEach(node => {\n const importPath = node.moduleSpecifier.text;\n const importClause = node.importClause;\n const namedImports = importClause.namedBindings;\n if (namedImports) {\n if (namedImports.elements) {\n // named imports\n namedImports.elements.forEach((elem) => {\n const name = elem.name.text;\n const fileImport: IFileImport = {\n name,\n path: importPath,\n isDefault: false\n };\n result.push(fileImport);\n });\n } else {\n // namespace import (import * as name from 'path')\n const name = namedImports.name.text;\n const fileImport: IFileImport = {\n name,\n path: importPath,\n isDefault: false\n };\n result.push(fileImport);\n }\n\n } else {\n // default import\n const name = importClause.name.text;\n const fileImport: IFileImport = {\n name,\n path: importPath,\n isDefault: true\n };\n result.push(fileImport);\n }\n });\n return result;\n }\n\n isCJSRequireStatement(node): boolean {\n const dec = node.declarationList.declarations[0];\n return dec.initializer && isCallExpression(dec.initializer) && dec.initializer.expression.getText() === \"require\";\n }\n\n isCJSModuleExportsExpressionStatement(node): boolean {\n if (node.expression && node.expression.kind === SyntaxKind.BinaryExpression ) {\n if (node.expression.left.kind === SyntaxKind.PropertyAccessExpression) {\n const left = node.expression.left as PropertyAccessExpression;\n return left.expression.getText() === \"module\" && left.name.getText() === \"exports\";\n }\n }\n return false;\n }\n\n getCJSImports(node): IFileImport[] {\n const result = [];\n const varStatements = node.statements.filter(s => isVariableStatement(s));\n const decList = varStatements.map(s => s.declarationList);\n const dec = decList.map(d => d.declarations[0]);\n\n dec.forEach(decNode => {\n if (decNode.initializer && decNode.initializer.kind === SyntaxKind.CallExpression) {\n const callExpression = decNode.initializer.expression.getText();\n if (callExpression === \"require\") {\n const isDefault = decNode.name.kind === SyntaxKind.Identifier;\n const importPath = decNode.initializer.arguments[0].text;\n if (isDefault) {\n const name = decNode.name.text;\n const fileImport: IFileImport = {\n name,\n path: importPath,\n isDefault: isDefault\n };\n result.push(fileImport);\n } else {\n const elems = decNode.name.elements;\n elems.forEach(elem => {\n const name = elem.name.text;\n const fileImport: IFileImport = {\n name,\n path: importPath,\n isDefault: false,\n };\n result.push(fileImport);\n });\n }\n }\n }\n });\n\n return result;\n }\n\n getFileImports(node): IFileImport[] {\n const esmImports = this.getFileESMImports(node);\n if (esmImports.length > 0) {\n return esmImports;\n }\n const cjsImports = this.getCJSImports(node);\n return cjsImports;\n }\n\n getESMExports(node): IFileExport[] {\n const result = [];\n const namedExports = node.statements.filter((s) => isExportDeclaration(s));\n const defaultExport = node.statements.filter((s) => isExportAssignment(s));\n\n namedExports.forEach(node => {\n const namedExports = node.exportClause;\n if (namedExports) {\n namedExports.elements.forEach((elem) => {\n const name = elem.name.text;\n const fileExport: IFileExport = {\n name,\n isDefault: false\n };\n result.push(fileExport);\n });\n }\n });\n\n defaultExport.forEach(node => {\n const name = node.expression.getText();\n const fileExport: IFileExport = {\n name,\n isDefault: true\n };\n result.push(fileExport);\n });\n return result;\n }\n\n getCJSExports(node): IFileExport[] {\n const result = [];\n const moduleExports = node.statements.filter(s => this.isCJSModuleExportsExpressionStatement(s)).map(s => s.expression as BinaryExpression);\n\n moduleExports.forEach(node => {\n const right = node.right;\n if (right.kind === SyntaxKind.ObjectLiteralExpression) {\n const props = right.properties;\n props.forEach(prop => {\n const name = prop.name.getText();\n const fileExport: IFileExport = {\n name,\n isDefault: false\n };\n result.push(fileExport);\n });\n }\n if (right.kind === SyntaxKind.Identifier) {\n const name = right.getText();\n const fileExport: IFileExport = {\n name,\n isDefault: true\n };\n result.push(fileExport);\n }\n });\n return result;\n }\n\n getExportDeclarations(node): IFileExport[] {\n // example export default class X\n const result = [];\n const classDeclarations = node.statements.filter((s) => isClassDeclaration(s));\n const functionDeclarations = node.statements.filter((s) => isFunctionDeclaration(s));\n\n const both = classDeclarations.concat(functionDeclarations);\n both.forEach(classNode => {\n const modifiers = classNode.modifiers;\n if (modifiers) {\n const isDefault = modifiers.some((m) => m.kind === SyntaxKind.DefaultKeyword);\n if (isDefault) {\n const name = classNode.name.text;\n const fileExport: IFileExport = {\n name,\n isDefault: true\n };\n result.push(fileExport);\n }\n }\n });\n return result;\n }\n\n getFileExports(node): IFileExport[] {\n const defaultClassAndFunctionsExports = this.getExportDeclarations(node);\n const esmExports = this.getESMExports(node).concat(defaultClassAndFunctionsExports);\n if (esmExports.length > 0) {\n return esmExports;\n }\n return this.getCJSExports(node);\n }\n\n getReturnTypeFromMethod(node): string {\n // first try custom type\n\n const bType = this.getChecker().getTypeAtLocation(node);\n // const func2Symbol = bType.getProperty(\"test1\")!;\n const bSymbol = bType.getSymbol();\n const func2Type = this.getChecker().getTypeOfSymbolAtLocation(bSymbol, bSymbol.valueDeclaration.resolve());\n const func2Signature = this.getChecker().getSignaturesOfType(func2Type, SignatureKind.Call)[0];\n const rawType = func2Signature.getReturnType();\n // const parsed = ts.TypeFlags[rawType.flags];\n // console.log(parsed);\n const res = this.getChecker().typeToString(rawType); // C\n if (res === undefined) {\n const name = node.type?.typeName?.text;\n if (name){\n return name as string;\n }\n }\n return res;\n }\n\n getParameterType(node): IParameterType {\n const isOptional = node.questionToken !== undefined;\n\n const result: IParameterType = {\n name: node.name.getText(),\n isOptional: isOptional,\n type: undefined\n };\n\n if (node.initializer !== undefined) {\n result.initializer = node.initializer.getText();\n }\n\n // first try custom type\n if (node.type === undefined) {\n // does not have a type or uses a initializer\n if (node.initializer !== undefined) {\n const type = this.getChecker().getTypeAtLocation(node.initializer);\n const res = this.getChecker().typeToString(type); // C\n // console.log(\"initializer\", res);\n // result.initializer = node.initializer.text;\n result.type = TypeFlags[type.flags];\n return result;\n }\n }\n\n const name = node.type?.typeName?.text;\n if (name){\n result.type = name as string;\n if (node.initializer !== undefined) {\n result.initializer = node.initializer.text;\n }\n return result;\n }\n\n if (node.type != undefined) {\n const type = this.getChecker().getTypeAtLocation(node.type);\n const res = this.getChecker().typeToString(type); // C\n result.type = res as string;\n return result;\n }\n return result;\n }\n\n getMethodTypes(file): IMethodType[] {\n const result: IMethodType[] = [];\n if (!file.statements) {\n return result;\n }\n const classDeclarations = file.statements.filter((s) => isClassDeclaration(s));\n classDeclarations.forEach((node) => {\n const methods = node.members.filter((m) => isMethodDeclaration(m));\n methods.forEach(m => {\n const isAsync = this.isAsyncFunction(m);\n const name = m.name.getText();\n const returnType = this.getReturnTypeFromMethod(m);\n const parameters = (m as any).parameters;\n // const paramTypes:IParameterType[] = parameters.map((p) => this.getParameterType(p));\n const paramTypes:IParameterType[] = [];\n parameters.forEach((p) => {\n const res = this.getParameterType(p);\n paramTypes.push(res);\n });\n result.push({\n name,\n async:isAsync,\n returnType,\n parameters: paramTypes\n });\n });\n });\n\n return result;\n }\n}\n\nexport {\n BaseTranspiler\n};\n","import { type SourceFile } from \"typescript/unstable/ast\";\nimport { type API, type Checker, type Program, type Snapshot } from \"typescript/unstable/sync\";\n\ninterface IInput {\n language: Languages;\n async: boolean;\n}\n\n// per-transpile typescript state. Holding it in an explicit object (owned by the\n// Transpiler instance and handed to the language printers) instead of process\n// globals keeps concurrent/nested transpilations from clobbering each other.\ninterface ITranspileContext {\n src: SourceFile;\n checker: Checker;\n program: Program;\n}\n\n// The TS7 API server the programs are created on. Shareable between Transpiler\n// instances on the same thread; a worker_threads isolate needs its own.\ninterface ITranspileProgramCache {\n api?: API;\n // the run-wide program set by Transpiler.setSharedProgram\n shared?: { snapshot: Snapshot, program: Program, checker: Checker };\n}\n\n\ninterface IParameterType {\n name: string;\n type: string;\n isOptional: boolean;\n initializer?: string;\n}\n\ninterface IMethodType {\n async: boolean;\n name: string;\n returnType: string;\n parameters: IParameterType[];\n}\n\ninterface IFileImport {\n name: string;\n path: string;\n isDefault: boolean;\n}\n\ninterface IFileExport {\n name: string;\n isDefault: boolean;\n}\n\ninterface ITranspiledFile {\n content: string;\n imports: IFileImport[];\n exports: IFileExport[];\n methodsTypes?: IMethodType[];\n}\n\nenum Languages {\n Python,\n Php,\n CSharp,\n Go,\n Java,\n Rust,\n Cpp\n}\n\nenum TranspilationMode {\n ByPath,\n ByContent\n}\n\n// const TranspilingError = (message) => ({\n// error: new Error(message),\n// code: 'TRANSPILING ERROR'\n// });\n\nclass TranspilationError extends Error {\n constructor (id, message, nodeText, start, end) {\n const parsedMessage = `Lang: ${id} Error: ${message} at ${start}:${end} node: \"${nodeText}\"`;\n super (parsedMessage);\n this.name = 'TranspilationError';\n\n }\n}\n\n// class FunctionReturnTypeError extends TranspilationError {\n// constructor (message) {\n// super (message);\n// this.name = 'FuctionReturnTypeError';\n// }\n// }\n\n// class FunctionArgumentTypeError extends TranspilationError {\n// constructor (message) {\n// super (message);\n// this.name = 'FunctionArgumentTypeError';\n// }\n// }\n\nexport {\n Languages,\n TranspilationMode,\n IFileImport,\n ITranspiledFile,\n IFileExport,\n ITranspileContext,\n ITranspileProgramCache,\n TranspilationError,\n // FunctionReturnTypeError,\n // FunctionArgumentTypeError,\n IInput,\n IMethodType,\n IParameterType\n};","\n\nfunction regexAll (text: string, array: any[]): string {\n for (const i in array) {\n let regex = array[i][0];\n const flags = (typeof regex === 'string') ? 'g' : undefined;\n regex = new RegExp (regex, flags);\n text = text.replace (regex, array[i][1]);\n }\n return text;\n}\n\nfunction unCamelCase (s: string): string | undefined {\n return s.match (/[A-Z]/) ? s.replace (/[a-z0-9][A-Z]/g, x => x[0] + '_' + x[1]).replace(/[A-Z0-9][A-Z0-9][a-z][^$]/g, x => x[0] + '_' + x[1] + x[2] + x[3]).replace(/[a-z][0-9]$/g, x=> x[0] + '_' + x[1]).toLowerCase () : undefined;\n}\n\n// function extend (...args) {\n// Object.assign ({}, ...args);\n// }\n\nexport {\n regexAll,\n unCamelCase,\n};\n","import { green, yellow, red } from \"colorette\";\n\nclass Logger {\n static verbose = true;\n\n // static createInstanceIfNeeded(): void {\n // if (!this._instance) {\n // this._instance = new Logger();\n // }\n // }\n\n static setVerboseMode(verbose: boolean) {\n this.verbose = verbose;\n }\n\n static log(message: string) {\n if (this.verbose) {\n console.log(message);\n }\n }\n\n static success(message: string) {\n this.log(green(`[SUCCESS]: ${message}`));\n }\n\n static warning(message: string) {\n this.log(yellow(`[WARNING]: ${message}`));\n }\n\n static error(message: string) {\n this.log(red(`[ERROR]: ${message}`));\n }\n}\n\nexport {\n Logger\n};\n\n","import { BaseTranspiler } from \"./baseTranspiler.js\";\nimport { SyntaxKind } from \"typescript/unstable/ast\";\nimport { isArrowFunction, isCallExpression, isFunctionDeclaration, isFunctionExpression } from \"typescript/unstable/ast/is\";\nimport { TypeFlags, type Checker } from \"typescript/unstable/sync\";\nimport { unCamelCase, regexAll } from \"./utils.js\";\nimport { Logger } from \"./logger.js\";\n\nconst parserConfig = {\n 'ELSEIF_TOKEN': 'elseif',\n 'THIS_TOKEN': '$this',\n 'PROPERTY_ACCESS_TOKEN': '->',\n 'UNDEFINED_TOKEN': 'null',\n 'NOT_TOKEN': '!',\n 'LINE_TERMINATOR': ';',\n 'ARRAY_OPENING_TOKEN':\"[\",\n 'ARRAY_CLOSING_TOKEN':\"]\",\n 'OBJECT_OPENING':\"array(\",\n 'OBJECT_CLOSING':\")\",\n 'FUNCTION_TOKEN': 'function',\n 'ASYNC_TOKEN': '',\n 'PROPERTY_ASSIGNMENT_TOKEN': ' =>',\n 'NEW_TOKEN': 'new',\n 'THROW_TOKEN': 'throw',\n 'SUPER_TOKEN': 'parent',\n 'CONSTRUCTOR_TOKEN': 'function __construct',\n 'SUPER_CALL_TOKEN': 'parent::__construct',\n 'CATCH_DECLARATION': 'Exception',\n 'CATCH_TOKEN': 'catch',\n 'BLOCK_OPENING_TOKEN' :'{',\n 'BLOCK_CLOSING_TOKEN' :'}',\n 'CONDITION_OPENING' :'(',\n 'CONDITION_CLOSE' :')',\n 'PLUS_PLUS_TOKEN': '++',\n 'MINUS_MINUS_TOKEN': '--',\n 'SPACE_DEFAULT_PARAM': ' ',\n 'EXCLAMATION_EQUALS_EQUALS_TOKEN': '!==',\n 'EQUALS_EQUALS_EQUALS_TOKEN': '===',\n 'STRING_QUOTE_TOKEN': '\\'',\n 'EXTENDS_TOKEN': 'extends',\n};\n\nexport class PhpTranspiler extends BaseTranspiler {\n awaitWrapper;\n propRequiresScopeResolutionOperator: string[];\n AWAIT_WRAPPER_OPEN;\n AWAIT_WRAPPER_CLOSE;\n ASYNC_FUNCTION_WRAPPER_OPEN = \"\";\n constructor(config = {}) {\n\n config['parser'] = Object.assign ({}, parserConfig, config['parser'] ?? {});\n\n super(config);\n this.id = \"php\";\n this.asyncTranspiling = config['async'] ?? true;\n this.uncamelcaseIdentifiers = config['uncamelcaseIdentifiers'] ?? false;\n this.removeVariableDeclarationForFunctionExpression = config['removeFunctionAssignToVariable'] ?? false;\n this.includeFunctionNameInFunctionExpressionDeclaration = config['includeFunctionNameInFunctionExpressionDeclaration'] ?? false;\n\n this.propRequiresScopeResolutionOperator = ['super'] + (config['ScopeResolutionProps'] ?? []);\n\n this.initConfig();\n\n // user overrides\n this.applyUserOverrides(config);\n\n // const propertyAccessRemoval = config['PropertyAccessRequiresParenthesisRemoval'] ?? [];\n // this.PropertyAccessRequiresParenthesisRemoval.push(...propertyAccessRemoval);\n\n this.AWAIT_WRAPPER_OPEN = config['AWAIT_WRAPPER_OPEN'] ?? \"\\\\React\\\\Async\\\\await(\";\n this.AWAIT_WRAPPER_CLOSE = config['AWAIT_WRAPPER_CLOSE'] ?? \")\";\n }\n\n printAwaitExpression(node, identation) {\n const expression = this.printNode(node.expression, identation);\n\n if (!this.asyncTranspiling) {\n return expression;\n }\n\n return this.AWAIT_WRAPPER_OPEN + expression + this.AWAIT_WRAPPER_CLOSE;\n }\n\n transformIdentifier(node, identifier) {\n if (this.uncamelcaseIdentifiers) {\n identifier = this.unCamelCaseIfNeeded(identifier);\n }\n\n // Get the symbol for the identifier\n const symbol = this.getChecker().getSymbolAtLocation(node);\n\n // Check if the symbol references a function declaration or expression\n const valueDecl = symbol?.valueDeclaration?.resolve();\n if (valueDecl) {\n\n // Check if it's a function (FunctionDeclaration, FunctionExpression, ArrowFunction)\n if (isFunctionDeclaration(valueDecl) || isFunctionExpression(valueDecl) || isArrowFunction(valueDecl)) {\n // Check if the identifier is passed as an argument in a function call\n if (node.parent && isCallExpression(node.parent) && node.parent.arguments.includes(node)) {\n return `'${identifier}'`; // Transpile function reference as string\n }\n }\n }\n\n // below is commented, due to : https://github.com/ccxt/ast-transpiler/pull/15\n //\n // If the identifier is a function parameter (callback), it should remain a variable with `$` prefix\n // if (node.parent && (ts.isParameter(node.parent) || (ts.isCallExpression(node.parent) && ts.isIdentifier(node)))) {\n // return \"$\" + identifier;\n // }\n\n // Default case: prepend $ for variables (non-functions), unless it's a class or constant\n if (!this.startsWithUpperCase(identifier)) {\n return \"$\" + identifier; // Prepend $ for variable names\n }\n\n return identifier;\n }\n\n\n getCustomOperatorIfAny(left, right, operator) {\n const STRING_CONCAT = '.';\n const PLUS_EQUALS_TOKEN = '.=';\n if (operator.kind == SyntaxKind.PlusToken || operator.kind == SyntaxKind.PlusEqualsToken) {\n\n const TOKEN = operator.kind == SyntaxKind.PlusToken ? STRING_CONCAT : PLUS_EQUALS_TOKEN;\n\n if (left.kind == SyntaxKind.StringLiteral || right.kind == SyntaxKind.StringLiteral) {\n return TOKEN;\n }\n\n const leftType = this.getChecker().getTypeAtLocation(left);\n const rightType = this.getChecker().getTypeAtLocation(right);\n\n if (leftType.flags === TypeFlags.String || rightType.flags === TypeFlags.String) {\n return TOKEN;\n }\n if (leftType.flags === TypeFlags.StringLiteral || rightType.flags === TypeFlags.StringLiteral) {\n return TOKEN;\n }\n }\n return undefined;\n }\n\n printLengthProperty(node, identation, name = undefined) {\n const leftSide = this.printNode(node.expression, 0);\n const type = (this.getChecker() as Checker).getTypeAtLocation(node.expression); // eslint-disable-line\n this.warnIfAnyType(node, type.flags, leftSide, \"length\");\n return this.isStringType(type.flags) ? `strlen(${leftSide})` : `count(${leftSide})`;\n }\n\n printPopCall(node, identation, name = undefined) {\n return `array_pop(${name})`;\n }\n\n printReverseCall(node, identation, name = undefined) {\n return `${name} = array_reverse(${name})`;\n }\n\n printShiftCall(node, identation, name = undefined) {\n return `array_shift(${name})`;\n }\n\n printToLowerCaseCall(node, identation, name = undefined) {\n return `strtolower(${name})`;\n }\n\n printToUpperCaseCall(node, identation, name = undefined) {\n return `strtoupper(${name})`;\n }\n\n printToStringCall(node, identation, name = undefined) {\n return `((string) ${name})`;\n }\n\n printArrayIsArrayCall(node, identation, parsedArg = undefined) {\n return `gettype(${parsedArg}) === 'array' && array_is_list(${parsedArg})`;\n }\n\n printObjectKeysCall(node, identation, parsedArg = undefined) {\n return `is_array(${parsedArg}) ? array_keys(${parsedArg}) : array()`;\n }\n\n printObjectValuesCall(node, identation, parsedArg = undefined) {\n return `is_array(${parsedArg}) ? array_values(${parsedArg}) : array()`;\n }\n\n printJsonParseCall(node, identation, parsedArg?) {\n return `json_decode(${parsedArg}, $as_associative_array = true)`;\n }\n\n printJsonStringifyCall(node: any, identation: any, parsedArg?: any) {\n return `json_encode(${parsedArg})`;\n }\n\n printArrayPushCall(node, identation, name = undefined, parsedArg = undefined) {\n return `${name}[] = ${parsedArg}`;\n }\n\n printPromiseAllCall(node, identation, parsedArg = undefined) {\n return `\\\\React\\\\Promise\\\\all(${parsedArg})`;\n }\n\n printMathCeilCall(node, identation, parsedArg = undefined) {\n return `((int) ceil(${parsedArg}))`;\n }\n\n printNumberIsIntegerCall(node, identation, parsedArg?) {\n return `is_int(${parsedArg})`;\n }\n\n printMathRoundCall(node, identation, parsedArg = undefined) {\n return `((int) round(${parsedArg}))`;\n }\n\n printMathFloorCall(node: any, identation: any, parsedArg?: any) {\n return `((int) floor(${parsedArg}))`;\n }\n\n printReplaceCall(node, identation, name = undefined, parsedArg = undefined, parsedArg2 = undefined) {\n return `str_replace(${parsedArg}, ${parsedArg2}, ${name})`;\n }\n\n printReplaceAllCall(node, identation, name = undefined, parsedArg = undefined, parsedArg2 = undefined) {\n return `str_replace(${parsedArg}, ${parsedArg2}, ${name})`;\n }\n\n printIncludesCall(node, identation, name = undefined, parsedArg = undefined) {\n // \"ol\".includes(\"o\") -> str_contains(\"ol\", \"o\") or [12,3,4].includes(3) -> in_array(3, [12,3,4])\n const leftSide = node.expression?.expression;\n const leftSideText = this.printNode(leftSide, 0);\n const type = this.getChecker().getTypeAtLocation(leftSide); // eslint-disable-line\n this.warnIfAnyType(node, type.flags, leftSideText, \"includes\");\n this.warnIfAnyType(node, type.flags, leftSideText, \"includes\");\n if (this.isStringType(type.flags)) {\n return `str_contains(${name}, ${parsedArg})`;\n } else {\n return `in_array(${parsedArg}, ${name})`;\n }\n }\n\n printIndexOfCall(node, identation, name = undefined, parsedArg = undefined) {\n const leftSide = node.expression?.expression;\n const leftSideText = this.printNode(leftSide, 0);\n const type = this.getChecker().getTypeAtLocation(leftSide); // eslint-disable-line\n this.warnIfAnyType(node, type.flags, leftSideText, \"indexOf\");\n if (this.isStringType(type.flags)) {\n return `mb_strpos(${name}, ${parsedArg})`;\n } else {\n return `array_search(${parsedArg}, ${name})`;\n }\n }\n\n printSearchCall(node, identation, name = undefined, parsedArg = undefined) {\n return `mb_strpos(${name}, ${parsedArg})`;\n }\n\n printStartsWithCall(node, identation, name = undefined, parsedArg = undefined) {\n return `str_starts_with(${name}, ${parsedArg})`;\n }\n\n printEndsWithCall(node, identation, name = undefined, parsedArg = undefined) {\n return `str_ends_with(${name}, ${parsedArg})`;\n }\n\n printTrimCall(node, identation, name = undefined) {\n return `trim(${name})`;\n }\n\n printJoinCall(node, identation, name = undefined, parsedArg = undefined) {\n return `implode(${parsedArg}, ${name})`;\n }\n\n printSplitCall(node, identation, name = undefined, parsedArg = undefined) {\n return `explode(${parsedArg}, ${name})`;\n }\n\n printConcatCall(node: any, identation: any, name?: any, parsedArg?: any) {\n return `array_merge(${name}, ${parsedArg})`;\n }\n\n printPadEndCall(node, identation, name, parsedArg, parsedArg2) {\n return `str_pad(${name}, ${parsedArg}, ${parsedArg2}, STR_PAD_RIGHT)`;\n }\n\n printPadStartCall(node, identation, name, parsedArg, parsedArg2) {\n return `str_pad(${name}, ${parsedArg}, ${parsedArg2}, STR_PAD_LEFT)`;\n }\n\n printDateNowCall(node, identation) {\n return \"round(microtime(true) * 1000)\";\n }\n\n printInstanceOfExpression(node, identation) {\n // const left = this.printNode(node.left, 0);\n // const right = this.printNode(node.right, 0);\n const left = node.left.text;\n const right = node.right.text;\n return this.getIden(identation) + \"$\"+left+\" instanceof \"+right+\"\";\n }\n\n printDeleteExpression(node, identation) {\n const expression = this.printNode (node.expression, 0);\n return `unset(${expression})`;\n }\n\n printNewExpression(node, identation) {\n let expression = node.expression?.text;\n expression = expression ? expression : this.printNode(node.expression);\n // JS's built-in `Error` maps to PHP's `Exception` (PHP's `Error` is reserved for internal engine errors)\n if (expression === 'Error') {\n expression = 'Exception';\n }\n const args = node.arguments.map(n => this.printNode(n, identation)).join(\", \");\n const newToken = this.NEW_TOKEN ? this.NEW_TOKEN + \" \" : \"\";\n return newToken + expression + this.LEFT_PARENTHESIS + args + this.RIGHT_PARENTHESIS;\n }\n\n getExceptionalAccessTokenIfAny(node) {\n const leftSide = node.expression.text ?? node.expression.getFullText().trim();\n\n if (!leftSide) {\n return undefined;\n }\n\n if (this.propRequiresScopeResolutionOperator.includes(leftSide)) {\n return \"::\";\n }\n return undefined;\n }\n\n handleTypeOfInsideBinaryExpression(node, identation) {\n const left = node.left;\n const right = node.right.text;\n const op = node.operatorToken.kind;\n const expression = left.expression;\n\n const isDifferentOperator = op === SyntaxKind.ExclamationEqualsEqualsToken || op === SyntaxKind.ExclamationEqualsToken;\n const notOperator = isDifferentOperator ? this.NOT_TOKEN : \"\";\n\n const opComp = isDifferentOperator ? this.EXCLAMATION_EQUALS_EQUALS_TOKEN : this.EQUALS_EQUALS_EQUALS_TOKEN;\n\n switch (right) {\n case \"string\":\n return this.getIden(identation) + notOperator + \"is_string(\" + this.printNode(expression, 0) + \")\";\n case \"number\":\n return this.getIden(identation) + notOperator + \"(is_int(\" + this.printNode(expression, 0) + \") || is_float(\" + this.printNode(expression, 0) + \"))\";\n case \"boolean\":\n return this.getIden(identation) + notOperator + \"is_bool(\" + this.printNode(expression, 0) + \")\";\n case \"object\":\n return this.getIden(identation) + notOperator + \"is_array(\" + this.printNode(expression, 0) + \")\";\n case \"undefined\":\n return this.getIden(identation) + this.printNode(expression, 0) + \" \" + opComp + \" null\";\n }\n\n return undefined;\n\n }\n\n printCustomBinaryExpressionIfAny(node, identation) {\n const left = node.left;\n const right = node.right.text;\n\n const op = node.operatorToken.kind;\n\n if (left.kind === SyntaxKind.TypeOfExpression) {\n // handle typeof operator\n // Example: typeof a === \"string\"\n const typeOfExpression = this.handleTypeOfInsideBinaryExpression(node, identation);\n if (typeOfExpression) {\n return typeOfExpression;\n }\n }\n\n if (op === SyntaxKind.InKeyword) {\n const rightSide = this.printNode(node.right, 0);\n const leftSide = this.printNode(node.left, 0);\n return `${this.getIden(identation)}is_array(${rightSide}) && array_key_exists(${leftSide}, ${rightSide})`;\n }\n\n const prop = node?.left?.expression?.name?.text;\n\n if (prop) {\n const args = left.arguments;\n const parsedArg = (args && args.length > 0) ? this.printNode(args[0], 0): undefined;\n const leftSideOfIndexOf = left.expression.expression; // myString in myString.indexOf\n const leftSide = this.printNode(leftSideOfIndexOf, 0);\n const rightType = this.getChecker().getTypeAtLocation(leftSideOfIndexOf); // type of myString in myString.indexOf (\"b\") >= 0;\n switch(prop) {\n case 'indexOf':\n if (op === SyntaxKind.GreaterThanEqualsToken && right === '0') {\n this.warnIfAnyType(node, rightType.flags,leftSide, \"indexOf\");\n if (this.isStringType(rightType.flags)) {\n return this.getIden(identation) + \"mb_strpos(\" + leftSide + \", \" + parsedArg + \") !== false\";\n } else {\n return this.getIden(identation) + \"in_array(\" + parsedArg + \", \" + leftSide + \")\";\n }\n }\n }\n }\n return undefined;\n }\n\n printFunctionDeclaration(node, identation) {\n let functionDef = this.printFunctionDefinition(node, identation);\n const funcBody = this.printFunctionBody(node, identation);\n functionDef += funcBody;\n\n return this.printNodeCommentsIfAny(node, identation, functionDef);\n }\n\n printFunctionBody(node, identation) {\n\n if (this.asyncTranspiling && this.isAsyncFunction(node)) {\n const blockOpen = this.getBlockOpen(identation);\n const blockClose = this.getBlockClose(identation);\n\n const parsedArgs = node.parameters.map(param => this.printParameter(param, false)).join(\", \");\n const params = parsedArgs ? \" use (\" + parsedArgs + \")\" : \"\";\n\n const bodyStms = [...node.body.statements];\n const firstBodyStm = this.printNode(bodyStms[0], identation+2);\n bodyStms.shift();\n const funcBody = bodyStms.map((s) => this.printNode(s, identation+2)).join(\"\\n\");\n\n // reformat first comment\n const bodyParts = firstBodyStm.split(\"\\n\");\n const commentPart = bodyParts.filter(line => this.isComment(line));\n const isComment = commentPart.length > 0;\n let header = this.getIden(identation+1) + \"return Async\\\\async(function ()\" + params + \" {\\n\";\n if (isComment) {\n const commentPartString = commentPart.map((c) => this.getIden(identation+1) + c.trim()).join(\"\\n\");\n const firstStmNoComment = bodyParts.filter(line => !this.isComment(line)).join(\"\\n\");\n header = commentPartString + \"\\n\" + header + firstStmNoComment + \"\\n\";\n } else {\n header += firstBodyStm + \"\\n\";\n }\n\n const result = header\n + funcBody + \"\\n\"\n + this.getIden(identation+1) + \"}) ();\";\n\n return blockOpen + result + blockClose;\n }\n return super.printFunctionBody(node, identation);\n }\n\n printPropertyAccessModifiers(node) {\n const modifiers = super.printPropertyAccessModifiers(node);\n return modifiers ? modifiers : \"public \"; // default to public\n }\n\n transformLeadingComment(comment) {\n const commentRegex = [\n [ /\\{([\\]\\[\\|a-zA-Z0-9_-]+?)\\}/g, '~$1~' ], // eslint-disable-line -- resolve the \"arrays vs url params\" conflict (both are in {}-brackets)\n [ /\\[([^\\]\\[]*)\\]\\{(@link .*)\\}/g, '~$2 $1~' ], // eslint-disable-line -- docstring item with link\n [ /\\s+\\* @method/g, '' ], // docstring @method\n [ /(\\s+)\\* @description (.*)/g, '$1\\* $2' ], // eslint-disable-line\n [ /\\s+\\* @name .*/g, '' ], // docstring @name\n [ /(\\s+)\\* @returns/g, '$1\\* @return' ], // eslint-disable-line\n [ /\\~([\\]\\[\\|@\\.\\s+\\:\\/#\\-a-zA-Z0-9_-]+?)\\~/g, '{$1}' ], // eslint-disable-line -- resolve the \"arrays vs url params\" conflict (both are in {}-brackets)\n [ /(\\s+ \\* @(param|return) {[^}]*)object([^}]*}.*)/g, '$1array$3' ], // docstring type conversion\n ];\n\n const transformed = regexAll(comment, commentRegex);\n\n return transformed;\n }\n\n initConfig() {\n this.LeftPropertyAccessReplacements = {\n 'this': '$this',\n };\n\n this.RightPropertyAccessReplacements = {\n\n };\n\n this.FullPropertyAccessReplacements = {\n 'Number.MAX_SAFE_INTEGER': 'PHP_INT_MAX',\n 'JSON.stringify': 'json_encode',\n 'console.log': 'var_dump',\n 'process.exit': 'exit',\n 'Math.log': 'log',\n 'Math.abs': 'abs',\n 'Math.floor': '(int) floor',\n 'Math.ceil': '(int) ceil',\n 'Math.round': '(int) round',\n 'Math.pow': 'pow',\n 'Math.min': 'min',\n 'Math.max': 'max',\n // 'Promise.all': '\\\\React\\\\Promise\\\\all',\n };\n\n this.CallExpressionReplacements = {\n 'parseFloat': 'floatval',\n 'parseInt': 'intval',\n };\n\n this.PropertyAccessRequiresParenthesisRemoval = [\n // 'length',\n // 'toString',\n // 'toUpperCase',\n // 'toLowerCase',\n // 'pop',\n // 'reverse',\n // 'shift',\n ];\n }\n\n}\n","import { BaseTranspiler } from \"./baseTranspiler.js\";\nimport { SyntaxKind, type Node, type ParameterDeclaration } from 'typescript/unstable/ast';\nimport { IndexKind, TypeFlags, type Checker, type Symbol as TsSymbol, type UnionType } from 'typescript/unstable/sync';\nimport { isArrayLiteralExpression, isAsExpression, isBinaryExpression, isBlock, isBooleanLiteral, isBreakStatement, isCallExpression, isClassDeclaration, isClassExpression, isClassLikeDeclaration, isContinueStatement, isDeleteExpression, isElementAccessExpression, isExpressionStatement, isForStatement, isFunctionExpression, isIdentifier, isIfStatement, isMethodDeclaration, isNumericLiteral, isObjectLiteralExpression, isParameterDeclaration, isParenthesizedExpression, isPostfixUnaryExpression, isPrefixUnaryExpression, isPropertyAccessExpression, isPropertyDeclaration, isPropertySignatureDeclaration, isReturnStatement, isSourceFile, isSpreadAssignment, isSpreadElement, isStringLiteral, isStringLiteralLikeNode, isThrowStatement, isTypeAssertion, isVariableDeclaration, isWhileStatement } from 'typescript/unstable/ast/is';\nimport { findAncestor, getAllSuperTypeNodes, isFunctionLike } from './tsUtils.js';\n\nconst parserConfig = {\n 'ELSEIF_TOKEN': 'else if',\n 'OBJECT_OPENING': 'new Dictionary() {',\n 'ARRAY_OPENING_TOKEN': 'new List() {',\n 'ARRAY_CLOSING_TOKEN': '}',\n 'PROPERTY_ASSIGNMENT_TOKEN': ',',\n 'VAR_TOKEN': 'object', // object\n 'METHOD_TOKEN': '',\n 'PROPERTY_ASSIGNMENT_OPEN': '{',\n 'PROPERTY_ASSIGNMENT_CLOSE': '}',\n 'SUPER_TOKEN': 'base',\n 'SUPER_CALL_TOKEN': 'base',\n 'FALSY_WRAPPER_OPEN': 'isTrue(',\n 'FALSY_WRAPPER_CLOSE': ')',\n 'COMPARISON_WRAPPER_OPEN' : \"isEqual(\",\n 'COMPARISON_WRAPPER_CLOSE' : \")\",\n 'UKNOWN_PROP_WRAPPER_OPEN': 'this.call(',\n 'UNKOWN_PROP_WRAPPER_CLOSE': ')',\n 'UKNOWN_PROP_ASYNC_WRAPPER_OPEN': 'this.callAsync(',\n 'UNKOWN_PROP_ASYNC_WRAPPER_CLOSE': ')',\n 'DYNAMIC_CALL_OPEN': 'callDynamically(',\n 'EQUALS_EQUALS_WRAPPER_OPEN': 'isEqual(',\n 'EQUALS_EQUALS_WRAPPER_CLOSE': ')',\n 'DIFFERENT_WRAPPER_OPEN': '!isEqual(',\n 'DIFFERENT_WRAPPER_CLOSE': ')',\n 'GREATER_THAN_WRAPPER_OPEN': 'isGreaterThan(',\n 'GREATER_THAN_WRAPPER_CLOSE': ')',\n 'GREATER_THAN_EQUALS_WRAPPER_OPEN': 'isGreaterThanOrEqual(',\n 'GREATER_THAN_EQUALS_WRAPPER_CLOSE': ')',\n 'LESS_THAN_WRAPPER_OPEN': 'isLessThan(',\n 'LESS_THAN_WRAPPER_CLOSE': ')',\n 'LESS_THAN_EQUALS_WRAPPER_OPEN': 'isLessThanOrEqual(',\n 'LESS_THAN_EQUALS_WRAPPER_CLOSE': ')',\n 'PLUS_WRAPPER_OPEN':'add(',\n 'PLUS_WRAPPER_CLOSE':')',\n 'MINUS_WRAPPER_OPEN':'subtract(',\n 'MINUS_WRAPPER_CLOSE':')',\n 'ARRAY_LENGTH_WRAPPER_OPEN': 'getArrayLength(',\n 'ARRAY_LENGTH_WRAPPER_CLOSE': ')',\n 'DIVIDE_WRAPPER_OPEN': 'divide(',\n 'DIVIDE_WRAPPER_CLOSE': ')',\n 'MULTIPLY_WRAPPER_OPEN': 'multiply(',\n 'MULTIPLY_WRAPPER_CLOSE': ')',\n 'INDEXOF_WRAPPER_OPEN': 'getIndexOf(',\n 'INDEXOF_WRAPPER_CLOSE': ')',\n 'MOD_WRAPPER_OPEN': 'mod(',\n 'MOD_WRAPPER_CLOSE': ')',\n 'FUNCTION_TOKEN': '',\n 'INFER_VAR_TYPE': false,\n 'INFER_ARG_TYPE': false,\n};\n\n// C# static type of the value each printed helper returns. A local initialised by\n// one of these already holds that concrete type inside its `object` box, so naming\n// the type at the declaration site keeps the very same runtime value and only\n// refines what the C# compiler knows about it.\n\n// instance-style calls the printer rewrites unconditionally by method name\n// (`x.toUpperCase()` always prints `((string)x).ToUpper()`, whatever `x` is)\nconst CSHARP_METHOD_RETURN_TYPES: { [name: string]: string } = {\n 'toUpperCase': 'string',\n 'toLowerCase': 'string',\n 'toString': 'string',\n 'trim': 'string',\n 'join': 'string',\n 'replace': 'string',\n 'replaceAll': 'string',\n 'split': 'List',\n 'startsWith': 'bool',\n 'endsWith': 'bool',\n 'indexOf': 'int',\n 'search': 'int',\n};\n\n// `Object.keys(x)`, `Math.floor(x)`, ... — matched on the full callee text\nconst CSHARP_STATIC_RETURN_TYPES: { [name: string]: string } = {\n 'Object.keys': 'List',\n 'Object.values': 'List',\n 'Object.entries': 'List',\n 'JSON.stringify': 'string',\n 'Math.floor': 'double',\n 'Math.ceil': 'double',\n 'Math.round': 'double',\n 'Array.isArray': 'bool',\n 'Number.isInteger': 'bool',\n};\n\n// delegate-valued members of the hand-written C# base (cs/ccxt/base/Exchange.Options.cs):\n// `Func<...>` with this many parameters, so `this.(args)` with that arity is a direct\n// delegate invocation. `proxy` is a `string` there — not callable — and stays out.\nconst CSHARP_NATIVE_THIS_DELEGATE_ARITY: { [name: string]: number } = {\n 'proxyUrlCallback': 3,\n 'proxy_url_callback': 3,\n 'httpProxyCallback': 4,\n 'http_proxy_callback': 4,\n 'httpsProxyCallback': 4,\n 'https_proxy_callback': 4,\n 'socksProxyCallback': 3,\n 'socks_proxy_callback': 3,\n};\n\n// base-class helpers whose C# signature is already concrete\nconst CSHARP_THIS_RETURN_TYPES: { [name: string]: string } = {\n 'extend': 'Dictionary',\n 'deepExtend': 'Dictionary',\n 'indexBy': 'Dictionary',\n 'groupBy': 'Dictionary',\n 'milliseconds': 'Int64',\n 'seconds': 'Int64',\n 'microseconds': 'Int64',\n 'uuid': 'string',\n 'hmac': 'string',\n 'capitalize': 'string',\n 'ymdhms': 'string',\n 'yyyymmdd': 'string',\n 'json': 'string',\n 'inArray': 'bool',\n 'valueIsDefined': 'bool',\n // the safe* accessor family: cs/ccxt/base already declares these with a concrete\n // return type (`string? safeString(...)`, `Int64? safeInteger(...)`, `bool? safeBool(...)`,\n // `IDictionary safeDict(...)`, `List safeList(...)`, ...), so a\n // local initialised by one of them already holds that type inside its `object` box\n 'safeString': 'string?',\n 'safeString2': 'string?',\n 'safeStringN': 'string?',\n 'safeStringLower': 'string?',\n 'safeStringLower2': 'string?',\n 'safeStringLowerN': 'string?',\n 'safeStringUpper': 'string?',\n 'safeStringUpper2': 'string?',\n 'safeStringUpperN': 'string?',\n 'safeCurrencyCode': 'string?',\n 'safeInteger': 'Int64?',\n 'safeInteger2': 'Int64?',\n 'safeIntegerN': 'Int64?',\n 'safeIntegerProduct': 'Int64?',\n 'safeFloat': 'double?',\n 'safeFloat2': 'double?',\n 'safeFloatN': 'double?',\n 'safeNumberN': 'double?',\n 'safeBool': 'bool?',\n 'safeBool2': 'bool?',\n 'safeBoolN': 'bool?',\n 'safeDict': 'IDictionary',\n 'safeDict2': 'IDictionary',\n 'safeDictN': 'IDictionary',\n 'safeList': 'List',\n 'safeList2': 'List',\n 'safeListN': 'List',\n};\n\n// helpers whose C# signature is `object` (safeValue, getValue, parseInt, add,\n// slice, safeTimestamp, ...) are deliberately absent above: their box holds a value the printer\n// cannot name, so those locals stay `object`.\n\n// this.(...) base methods whose printed C# signature is a concrete numeric value the\n// tables above do not carry: `int precisionFromString(object)` (Exchange.Number.cs) and\n// `Int64? parseToInt(object)` (Exchange.BaseMethods.cs, retyped by the build layer)\nconst CSHARP_NATIVE_NUMERIC_THIS_KINDS: { [name: string]: string } = {\n 'precisionFromString': 'int',\n 'parseToInt': 'Int64?',\n};\n\n// the safe* accessor names of the table above: a local initialised by one of them gets the\n// extra sink guards of csharpLocalIsSafeToType (list-only methods, hard `(string)` casts,\n// the `+` LEFT operand overload rebinding)\nconst CSHARP_SAFE_ACCESSOR_NAMES = Object.keys(CSHARP_THIS_RETURN_TYPES).filter((name) => name.startsWith('safe'));\n\n// S62: calls whose C# signature is a hand-written `bool` (isTrue, isEqual, isGreaterThan, ...,\n// inOp in cs/ccxt/base/Exchange.TranspileHelpers.cs; emitted for the comparison operators, `in`\n// and TS `isTrue`) are already C# `bool`, so the condition printer's falsy wrapper is the identity.\nconst CSHARP_BOOLEAN_PRINTED_CALLS = [\n 'isTrue', 'isEqual', 'isGreaterThan', 'isGreaterThanOrEqual',\n 'isLessThan', 'isLessThanOrEqual', 'inOp',\n];\n\n// a transpiled parameter or local can literally be named `bool`, which would turn\n// `bool x = ...` into a reference to that value instead of the type. `string` and\n// `object` are already renamed by ReservedKeywordsReplacements.\nconst CSHARP_TYPE_NAMES = [ 'string', 'bool', 'int', 'long', 'Int64', 'double', 'object', 'List', 'IList', 'Dictionary', 'IDictionary', 'var' ];\n\n// joins a receiver's printed text with a literal key in the `key in recv` guard index\nconst GUARD_KEY_SEPARATOR = \"\\u0000\";\n\n// C# kinds a comparison can be printed natively on: the runtime isLessThan family compares two\n// boxes of one kind with the conversions the C# operator applies too. `double` keeps only\n// `>`/`>=` — the helper reads a NaN operand as \"less than\", a native comparison is false — and\n// only meets another `double`: its isEqual accepts an integral double as an integer.\nconst CSHARP_NUMERIC_KINDS = [ 'int', 'Int64', 'double' ];\n\n// numeric kinds a printed call result can carry (with the nullable spellings the safe*\n// accessors and parseToInt use), for the equality path only\nconst CSHARP_NUMERIC_VALUE_KINDS = [ 'int', 'Int64', 'Int64?', 'double', 'double?' ];\n\n// integer kinds the helper normalises to Int64 (normalizeIntIfNeeded), the same widening the\n// C# operator applies to an int next to a long, so a mixed pair prints the identical comparison\nconst CSHARP_INTEGER_KINDS = [ 'int', 'Int64' ];\n\nconst CSHARP_NATIVE_COMPARISON_TOKENS = {\n [SyntaxKind.LessThanToken]: '<',\n [SyntaxKind.GreaterThanToken]: '>',\n [SyntaxKind.LessThanEqualsToken]: '<=',\n [SyntaxKind.GreaterThanEqualsToken]: '>=',\n};\n\n// C# kinds where Math.Min/Max may replace mathMin/mathMax: the helper reads both boxes via\n// Convert.ToDouble and returns an ORIGINAL box, so only integer kinds give the same value in the\n// same box. `double` keeps the helper (Math.Min propagates NaN, and -0/+0 differ).\nconst CSHARP_MINMAX_NATIVE_KINDS = [ 'int', 'Int64' ];\n\n// every binary operator that writes its left operand (typescript6 has no First/LastAssignmentOperator\n// range to test against), used by the element-access loop guards below\nconst CSHARP_ASSIGNMENT_OPERATOR_KINDS = [\n SyntaxKind.EqualsToken,\n SyntaxKind.PlusEqualsToken,\n SyntaxKind.MinusEqualsToken,\n SyntaxKind.AsteriskEqualsToken,\n SyntaxKind.AsteriskAsteriskEqualsToken,\n SyntaxKind.SlashEqualsToken,\n SyntaxKind.PercentEqualsToken,\n SyntaxKind.LessThanLessThanEqualsToken,\n SyntaxKind.GreaterThanGreaterThanEqualsToken,\n SyntaxKind.GreaterThanGreaterThanGreaterThanEqualsToken,\n SyntaxKind.AmpersandEqualsToken,\n SyntaxKind.BarEqualsToken,\n SyntaxKind.CaretEqualsToken,\n SyntaxKind.BarBarEqualsToken,\n SyntaxKind.AmpersandAmpersandEqualsToken,\n SyntaxKind.QuestionQuestionEqualsToken,\n];\n\n// hand-written BaseExchange fields whose C# declaration already is a concrete\n// dictionary/list (cs/ccxt/base/Exchange.Options.cs): a read of the field carries\n// that static type, so its own members (`Count`, `ContainsKey`) replace the helper\nconst CSHARP_NATIVE_FIELDS: { [name: string]: string } = {\n 'options': 'ConcurrentDictionary',\n 'has': 'Dictionary',\n 'features': 'Dictionary',\n 'httpExceptions': 'Dictionary',\n 'markets_by_id': 'IDictionary',\n 'symbols': 'List',\n 'codes': 'List',\n 'ids': 'List',\n};\n\n// hand-written BaseExchange fields declared `object` that always box a dictionary\n// (dict / CustomConcurrentDictionary): the member needs the same\n// `(IDictionary)` cast the transpiled helper body itself applies\nconst CSHARP_OBJECT_DICT_FIELDS = [ 'urls', 'tickers', 'bidsasks', 'orderbooks', 'ohlcvs', 'trades', 'markets', 'currencies', 'currencies_by_id', 'exceptions' ];\n\n// Hand-written BaseExchange / PredictionExchange fields declared as C# reference types: the field\n// holds a reference box, so a null comparison is exactly the isEqual(field, null) branch. A\n// value-typed field keeps the helper — rateLimit is a `double` (its TS number type proves nothing).\nconst CSHARP_REFERENCE_FIELDS_NATIVE = [\n 'id', 'hostname', 'apiKey', 'secret', 'password', 'uid', 'accountId', 'login', 'privateKey',\n 'walletAddress', 'twofa', 'proxy', 'proxyUrl', 'proxy_url', 'proxyUrlCallback',\n 'proxy_url_callback', 'last_http_response', 'markets', 'markets_by_id', 'features', 'tickers',\n 'bidsasks', 'ohlcvs', 'trades', 'orders', 'myTrades', 'positions', 'liquidations', 'balance',\n 'accounts', 'currencies', 'currencies_by_id', 'outcomes', 'outcomes_by_id', 'events',\n 'events_by_slug', 'clients', 'ids', 'tokenBucket',\n];\n\n// hand-written BaseExchange fields declared `bool` (cs/ccxt/base/Exchange.Options.cs, e.g.\n// `public bool newUpdates;` / `public bool verbose { get; set; }`): a `this.` read is\n// already a C# bool, so a condition holding one needs no isTrue wrapper\nconst CSHARP_NATIVE_BOOL_FIELDS = [\n 'alias', 'certified', 'enableRateLimit', 'isSandboxModeEnabled', 'newUpdates', 'pro',\n 'reduceFees', 'reloadingMarkets', 'returnResponseHeaders', 'substituteCommonCurrencyCodes', 'verbose',\n];\n\n// Hand-written BaseExchange fields whose reads print natively although the key may be absent:\n// `has`/`options` are concrete dictionaries; `urls`, `markets`, `exceptions` are `object` boxes\n// that always hold one. The native read tests the key, so a missing key still reads null.\nconst CSHARP_MISSING_KEY_FIELDS_NATIVE = [ 'has', 'options', 'urls', 'markets', 'exceptions' ];\n\n// C# collection types this printer can name whose members replace the helpers\nconst CSHARP_NATIVE_COLLECTION_TYPES = [ 'List', 'IList', 'Dictionary', 'IDictionary' ];\n\n// C# types isEqual's own branches can compare an element with: the box an element read\n// yields is unboxed with `as`, which answers null for every other box\nconst CSHARP_SCALAR_ELEMENT_BOOL = 1;\nconst CSHARP_SCALAR_ELEMENT_STRING = 2;\n\n// C# dictionary types this printer can name on a local\nconst CSHARP_NATIVE_DICTIONARY_TYPES = [ 'Dictionary', 'IDictionary' ];\n\n// the row-receiver family of the cs-08 unit, extended by B-19 to the currency row: a read of a\n// local with one of these names the declared table proves is a dictionary prints natively.\n// Other receivers belong to their own units (cs-09 fields, cs-10 response/result/balance locals)\nconst CSHARP_NATIVE_MARKET_RECEIVERS = [ 'market', 'currency' ];\n\n// Callees hand-written in cs/ccxt/base returning non-nullable `bool` with no TS declaration to read\n// an annotation from: `isEmpty`, `isJsonEncodedObject`, `isBinaryMessage` and Precise's string\n// comparisons. Keyed on printed callee text, so a `callDynamically` rewrite never matches.\nconst CSHARP_BOOL_CALLEES_NATIVE: { [name: string]: boolean } = {\n 'this.isEmpty': true,\n 'this.isJsonEncodedObject': true,\n 'this.isBinaryMessage': true,\n 'Precise.stringGt': true,\n 'Precise.stringGe': true,\n 'Precise.stringLt': true,\n 'Precise.stringLe': true,\n 'Precise.stringEq': true,\n 'Precise.stringEquals': true,\n};\n\n// TS base methods the C# port hand-writes with its own signature: the TS annotation is `boolean`\n// but the C# method bound by `this.(...)` returns something else (`object isDictionary`),\n// so the isTrue wrapper must stay regardless of the annotation.\nconst CSHARP_HANDWRITTEN_CALLEES_NATIVE = [ 'isDictionary' ];\n\n// Declared C# types whose `Count` counts exactly what getArrayLength's IList / ICollection\n// branches count. A prefix test: these are named with element types (`List`,\n// `Dictionary`, ...) and every member of the family carries `Count`.\nconst CSHARP_COUNT_TYPES = [ 'List<', 'IList<', 'Dictionary<', 'IDictionary<', 'ConcurrentDictionary<' ];\n\n// ==== native parseInt / parseFloat / mod / prefix `-x` ====\n// These helpers' answers depend on the runtime type of their boxes. Each emission below replaces\n// the call only where the printer can name the exact value the helper returns; else keep helper.\n\n// the numeric literal spellings this printer re-reads: decimal digits with an optional fraction\n// (a hex or separator literal prints characters the C# compiler would read differently)\nconst CSHARP_DECIMAL_LITERAL = /^[0-9]+(\\.[0-9]+)?$/;\n\n// the C# source of a double literal holding exactly `value`: String() is the shortest\n// round-trip spelling, and a whole number needs a fraction or an exponent to stay a double\nfunction csharpDoubleLiteral(value) {\n if (!Number.isFinite(value)) {\n return undefined;\n }\n const text = String(value);\n return (text.indexOf('.') >= 0 || text.indexOf('e') >= 0) ? text : text + '.0';\n}\n\n// the numeric value of a literal operand: a plain literal or one under a unary minus\nfunction csharpLiteralNumericValue(node) {\n if (isNumericLiteral(node)) {\n return CSHARP_DECIMAL_LITERAL.test(node.text) ? Number(node.text) : undefined;\n }\n if (isPrefixUnaryExpression(node) && (node.operator === SyntaxKind.MinusToken) && isNumericLiteral(node.operand)\n && CSHARP_DECIMAL_LITERAL.test(node.operand.text)) {\n return -Number(node.operand.text);\n }\n return undefined;\n}\n\n// `parseInt()` boxes Convert.ToInt64(Math.Floor(Convert.ToDouble(a))): a digits-only\n// string reads as the same number in every culture, so both readings fold into one Int64 literal\nfunction csharpParseIntLiteralArgument(arg) {\n if (isStringLiteral(arg)) {\n if (!/^[0-9]+$/.test(arg.text)) {\n return undefined; // a sign, a point or an exponent is read with the CURRENT culture\n }\n const value = Number(arg.text);\n return Number.isSafeInteger(value) ? `${value}L` : undefined;\n }\n const numeric = csharpLiteralNumericValue(arg);\n if (numeric === undefined) {\n return undefined;\n }\n const floored = Math.floor(numeric);\n if (!Number.isSafeInteger(floored)) {\n return undefined;\n }\n return (floored < 0) ? `(${floored}L)` : `${floored}L`;\n}\n\n// `parseFloat()` boxes Convert.ToDouble(a, InvariantCulture): a plain decimal string\n// and a numeric literal both read as the nearest double, the value the literal spells\nfunction csharpParseFloatLiteralArgument(arg) {\n if (isStringLiteral(arg)) {\n return CSHARP_DECIMAL_LITERAL.test(arg.text) ? csharpDoubleLiteral(Number(arg.text)) : undefined;\n }\n const numeric = csharpLiteralNumericValue(arg);\n return (numeric === undefined) ? undefined : csharpDoubleLiteral(numeric);\n}\n\n// receivers the market-typed-local unit owns (market/currency rows); this printer's literal-key\n// read rule leaves them to that family and covers every other declared-collection local\nconst CSHARP_MARKET_RECEIVER_NAMES = [ 'market', 'currency' ];\n\n// Parameters of a method whose override chain the ts/src census cleared: every declaration (base\n// member + every override) maps to the same spelling AND every call site in the generated tree\n// passes a compatible argument, so the whole-language build stays green. The three surviving\nconst CSHARP_OVERRIDE_PARAM_TYPES: { [name: string]: { [index: number]: string } } = {\n ethRpc: { 2: 'IList' },\n parsePredictionOpenInterest: { 0: 'IDictionary' },\n signEvmTransaction: { 0: 'IDictionary' },\n};\n\n\n// a leading cast of the printed expression: `(IList)(x)` names the receiver's static type\nconst CSHARP_LENGTH_CAST = /^\\(([A-Za-z_][\\w.]*(?:<[^<>]*(?:<[^<>]*>)?[^<>]*>)?)\\)/;\n\n// U55: declaration types where `isEqual (x, null)` -> `x == null` is the same test: `T?` (`== null`\n// is `!x.HasValue`, the helper's `a == null` guard) and named reference types (reference compare).\n// `object`/`var` and non-nullable scalars are refused (`x == null` won't compile for Int64/bool).\nconst CSHARP_NULL_COMPARISON_REFERENCE_HEADS = [ 'string', 'IDictionary<', 'Dictionary<', 'IList<', 'List<', 'ConcurrentDictionary<', 'ccxt.pro.', 'ArrayCache', 'IOrderBook', 'Future', 'WebSocketClient', 'Delegates' ];\n\nexport class CSharpTranspiler extends BaseTranspiler {\n\n binaryExpressionsWrappers;\n // method node -> 'bool' | 'bool?' | undefined (see csharpBooleanReturnType)\n csharpBooleanReturnTypes = new WeakMap();\n // variable declaration -> getCSharpLocalType result, shared by the condition checks\n csharpLocalTypes = new WeakMap();\n // method node -> `key in recv` guards of that method, keyed by receiver text + key\n csharpGuardIndex = new WeakMap>();\n // optional proof of the concrete C# type of an expression, installed by the embedding build\n // layer for the locals it retypes itself (ccxt: build/csharp-local-types.js); it must\n // describe the same type the declaration is emitted with, or the operator will not compile\n csharpExpressionTypeResolver?: (node) => string | undefined;\n // optional proof of the C# type a LOCAL's declaration was emitted with, installed by the\n // embedding build layer for declarations it retyped itself; the member-access rules read it\n // only after this printer's own declared-local table declined\n csharpDeclaredLocalTypeResolver?: (declaration) => string | undefined;\n // variable declaration -> the concrete C# type this printer named for it\n // (getCSharpLocalType): 'List' / 'Dictionary' / 'string' / ...\n // Only declarations the printer typed itself are kept: the printed ` name = `\n // prefix is final, so every later read of the local is statically that type and its\n // members may replace inOp/getArrayLength\n csharpTypedLocals = new WeakMap();\n // ws handler `message` parameter -> the typed signature this printer prints for it (D-19)\n csharpHandlerMessageTypes = new WeakMap();\n // method declaration -> a static call reference exists (a call binds its arguments)\n csharpHandlerCalled = new WeakMap();\n // class declaration -> the class routes the raw message through a list test\n csharpListRouteClasses = new WeakMap();\n // source file -> method symbol -> a static call reference exists (built once per file: a\n // sticky batch program is shared by every file of the stage, so a program-keyed index\n // would answer for another venue's class)\n csharpHandlerCallIndex = new WeakMap>();\n // parameter node -> the type the printed signature gives it (printParameterType, e.g.\n // `Dict` -> Dictionary), recorded as the signature is printed. Read-only:\n // no printer rule consults it, see csharpPrintedParamType\n csharpParamTypes = new WeakMap();\n // declaration node -> C# type of the local ('' = the printer prints `object`); see\n // csharpStringReceiverType -- the ccxt classifier asks once per string-method receiver\n stringReceiverTypes = new WeakMap();\n // declaration node -> 'bool' | 'bool?' | '' (the printer cannot name it); see\n // csharpConditionOperandType — asked once per condition operand\n conditionOperandTypes = new WeakMap();\n\n constructor(config = {}) {\n config['parser'] = Object.assign ({}, parserConfig, config['parser'] ?? {});\n\n super(config);\n\n this.requiresParameterType = true;\n this.requiresReturnType = true;\n this.asyncTranspiling = true;\n this.implicitAsyncTranspiling = true;\n this.supportsFalsyOrTruthyValues = false;\n this.requiresCallExpressionCast = true;\n this.id = \"C#\";\n\n\n this.initConfig();\n\n // user overrides\n this.applyUserOverrides(config);\n }\n\n initConfig() {\n this.LeftPropertyAccessReplacements = {\n // 'this': '$this',\n };\n\n this.RightPropertyAccessReplacements = {\n 'push': 'Add', // list method\n 'indexOf': 'IndexOf', // list method\n 'toUpperCase': 'ToUpper',\n 'toLowerCase': 'ToLower',\n 'toString': 'ToString',\n };\n\n this.FullPropertyAccessReplacements = {\n 'JSON.parse': 'parseJson', // custom helper method\n 'console.log': 'Console.WriteLine',\n 'Number.MAX_SAFE_INTEGER': 'Int32.MaxValue',\n 'Math.min': 'Math.Min',\n 'Math.max': 'Math.Max',\n 'Math.log': 'Math.Log',\n 'Math.abs': 'Math.Abs',\n // 'Math.ceil': 'Math.Ceiling', // need cast\n // 'Math.round': 'Math.Round', // need to cast\n 'Math.floor': 'Math.Floor',\n 'Math.pow': 'Math.Pow',\n // 'Promise.all': 'Task.WhenAll',\n };\n\n this.CallExpressionReplacements = {\n // \"parseInt\": \"parseINt\",\n // \"parseFloat\": \"float.Parse\",\n };\n\n this.ReservedKeywordsReplacements = {\n 'string': 'str',\n 'object': 'obj',\n 'params': 'parameters',\n 'base': 'bs',\n 'internal': 'intern',\n 'event': 'eventVar',\n 'fixed': 'fixedVar',\n };\n\n this.VariableTypeReplacements = {\n 'string': 'string',\n 'Str': 'string',\n 'number': 'double',\n 'Int': 'Int64',\n 'Num': 'double',\n 'Dict': 'Dictionary',\n 'Strings': 'List',\n 'List': 'List',\n 'boolean': 'bool',\n };\n\n this.ArgTypeReplacements = { ...this.VariableTypeReplacements };\n\n this.binaryExpressionsWrappers = {\n [SyntaxKind.EqualsEqualsToken]: [this.EQUALS_EQUALS_WRAPPER_OPEN, this.EQUALS_EQUALS_WRAPPER_CLOSE],\n [SyntaxKind.EqualsEqualsEqualsToken]: [this.EQUALS_EQUALS_WRAPPER_OPEN, this.EQUALS_EQUALS_WRAPPER_CLOSE],\n [SyntaxKind.ExclamationEqualsToken]: [this.DIFFERENT_WRAPPER_OPEN, this.DIFFERENT_WRAPPER_CLOSE],\n [SyntaxKind.ExclamationEqualsEqualsToken]: [this.DIFFERENT_WRAPPER_OPEN, this.DIFFERENT_WRAPPER_CLOSE],\n [SyntaxKind.GreaterThanToken]: [this.GREATER_THAN_WRAPPER_OPEN, this.GREATER_THAN_WRAPPER_CLOSE],\n [SyntaxKind.GreaterThanEqualsToken]: [this.GREATER_THAN_EQUALS_WRAPPER_OPEN, this.GREATER_THAN_EQUALS_WRAPPER_CLOSE],\n [SyntaxKind.LessThanToken]: [this.LESS_THAN_WRAPPER_OPEN, this.LESS_THAN_WRAPPER_CLOSE],\n [SyntaxKind.LessThanEqualsToken]: [this.LESS_THAN_EQUALS_WRAPPER_OPEN, this.LESS_THAN_EQUALS_WRAPPER_CLOSE],\n [SyntaxKind.PlusToken]: [this.PLUS_WRAPPER_OPEN, this.PLUS_WRAPPER_CLOSE],\n [SyntaxKind.MinusToken]: [this.MINUS_WRAPPER_OPEN, this.MINUS_WRAPPER_CLOSE],\n [SyntaxKind.AsteriskToken]: [this.MULTIPLY_WRAPPER_OPEN, this.MULTIPLY_WRAPPER_CLOSE],\n [SyntaxKind.PercentToken]: [this.MOD_WRAPPER_OPEN, this.MOD_WRAPPER_CLOSE],\n [SyntaxKind.SlashToken]: [this.DIVIDE_WRAPPER_OPEN, this.DIVIDE_WRAPPER_CLOSE],\n };\n }\n\n getBlockOpen(identation){\n return \"\\n\" + this.getIden(identation) + this.BLOCK_OPENING_TOKEN + \"\\n\";\n }\n\n printSuperCallInsideConstructor(node, identation) {\n return \"\"; // csharp does not need super call inside constructor\n }\n\n // method node -> base-class method it overrides (null: none); see getMethodOverride\n csharpMethodOverrides = new WeakMap();\n // class declaration -> member name -> its LAST method of that name (base scan order)\n csharpClassMethodsByName = new WeakMap>();\n\n csharpMethodsByName(classDecl): Map {\n let byName = this.csharpClassMethodsByName.get(classDecl);\n if (byName === undefined) {\n byName = new Map();\n for (const elem of classDecl.members ?? []) {\n if (isMethodDeclaration(elem)) {\n byName.set(elem.name.getText().trim(), elem);\n }\n }\n this.csharpClassMethodsByName.set(classDecl, byName);\n }\n return byName;\n }\n\n // base getMethodOverride rescans every parent member with getText() on each call; the\n // printer asks per method several times, so memoize it (same walk, same result)\n getMethodOverride(node: Node): Node {\n if (node === undefined || !isClassDeclaration(node.parent) || !(node.parent as any).heritageClauses) {\n return undefined;\n }\n const cached = this.csharpMethodOverrides.get(node);\n if (cached !== undefined) {\n return cached ?? undefined;\n }\n let method = undefined;\n let parentClass = getAllSuperTypeNodes(node.parent)[0];\n while (parentClass !== undefined) {\n const parentClassDecl = this.getChecker().getTypeAtLocation(parentClass)?.getSymbol()?.valueDeclaration?.resolve();\n if (parentClassDecl === undefined) {\n this.warn(node, \"Parent class\", \"Parent class not found\");\n method = undefined;\n break;\n }\n method = this.csharpMethodsByName(parentClassDecl).get((node as any).name.text) ?? method;\n parentClass = getAllSuperTypeNodes(parentClassDecl)[0] ?? undefined;\n }\n this.csharpMethodOverrides.set(node, method ?? null);\n return method;\n }\n\n printIdentifier(node) {\n let idValue = node.text ?? node.text;\n\n if (this.ReservedKeywordsReplacements[idValue]) {\n idValue = this.ReservedKeywordsReplacements[idValue];\n }\n\n if (idValue === \"undefined\") {\n return this.UNDEFINED_TOKEN;\n }\n\n // check if it is a class declaration that we need to wrap arounf typeof\n // example: const x = Error -> var x = typeof(Error)\n const type = this.getChecker().getTypeAtLocation(node);\n const symbol = type?.getSymbol();\n if (symbol !== undefined) {\n // const declarations = (this.getChecker().getDeclaredTypeOfSymbol(symbol).getSymbol()?.declarations ?? []).map((d) => d.resolve());\n const decl = (symbol?.declarations ?? []).map((d) => d.resolve());\n let isBuiltIn = undefined;\n if (decl.length > 0) {\n isBuiltIn = decl[0].getSourceFile().fileName.indexOf('typescript') > -1; //very hacky find a better solution later\n }\n\n if (isBuiltIn !== undefined && !isBuiltIn) {\n // const isClassDeclaration = declarations.find(l => l.kind === SyntaxKind.ClassDeclaration);\n const isInsideNewExpression = node?.parent?.kind === SyntaxKind.NewExpression;\n const isInsideCatch = node?.parent?.kind === SyntaxKind.ThrowStatement;\n const isLeftSide = node?.parent?.name === node || (node?.parent?.left === node);\n const isCallOrPropertyAccess = node?.parent?.kind === SyntaxKind.PropertyAccessExpression || node?.parent?.kind === SyntaxKind.ElementAccessExpression;\n if (!isLeftSide && !isCallOrPropertyAccess && !isInsideCatch && !isInsideNewExpression) {\n // return `typeof(${idValue})`; // this is not working as expected\n // for instance\n // const instance = new x();\n // const b = instance;\n // gets transpiled to\n // var instance = typeof(x);\n const symbol = this.getChecker().getSymbolAtLocation(node);\n let isClassDeclaration = false;\n if (symbol) {\n const first = symbol.declarations[0].resolve();\n if (first.kind === SyntaxKind.ClassDeclaration) {\n isClassDeclaration = true;\n }\n if (first.kind === SyntaxKind.ImportSpecifier) {\n const importedSymbol = this.getChecker().getAliasedSymbol(symbol);\n if (importedSymbol?.declarations[0]?.resolve()?.kind === SyntaxKind.ClassDeclaration) {\n isClassDeclaration = true;\n }\n }\n }\n // console.log(node.getText(), 'isClass declaration', isClass);\n if (isClassDeclaration) {\n return `typeof(${idValue})`;\n // this does not work then the class is imported from another file because\n // the type is not resolved correctly and the symbol declaration is simply a importSpecifier\n // we would need to find a way to get the type from the importSpecifier\n // by loading the entire code upon transpiling the ts file\n }\n }\n }\n }\n\n return this.transformIdentifier(node, idValue); // check this later\n }\n\n printConstructorDeclaration (node, identation) {\n const classNode = node.parent;\n const className = this.printNode(classNode.name, 0);\n const args = this.printMethodParameters(node);\n const constructorBody = this.printFunctionBody(node, identation);\n\n // find super call inside constructor and extract params\n let superClause = '';\n node.body?.statements.forEach(statement => {\n if (isExpressionStatement(statement)) {\n const expression = statement.expression;\n if (isCallExpression(expression)) {\n const expressionText = expression.expression.getText().trim();\n if (expressionText === 'super') {\n const superCallParams = expression.arguments.map((a) => {\n return this.printNode(a, identation).trim();\n }).join(\", \");\n superClause = ` : ${this.SUPER_CALL_TOKEN}(${superCallParams})`;\n }\n }\n }\n });\n\n return this.getIden(identation) + className + `(${args})` + superClause + constructorBody;\n }\n\n printDynamicCall(node, identation) {\n const elementAccess = node.expression;\n if (elementAccess?.kind === SyntaxKind.ElementAccessExpression) {\n const parsedArg = node.arguments.map(n => this.printNode(n, identation).trimStart()).join(\", \");\n const target = this.printNode(elementAccess.expression, 0);\n const propName = this.printNode(elementAccess.argumentExpression, 0);\n // always typed as async: the caller cannot tell whether the dynamic target is\n return `((Task)${this.DYNAMIC_CALL_OPEN}${target}, ${propName}, new object[] { ${parsedArg} }))`;\n }\n return undefined;\n }\n\n\n // The C# declared type of an expression's receiver (`request` in `request[\"k\"] = v`), as\n // the consumer's classifier knows it — ccxt's build/csharp-local-types.js overrides this\n // with its scope-aware local map. Undefined on an unpatched printer\n csharpDeclaredReceiverType(node): string | undefined {\n return undefined; // stub to override\n }\n\n // The C# type the printed SIGNATURE gives a parameter (`Dictionary` for `Dict`,\n // `object` when unnamed), recorded while printing so a body use can ask. Read-only: no printer\n // rule consults it; only the consumer's csharpDeclaredReceiverType override changes emission.\n csharpPrintedParamType(receiver): string | undefined {\n const declaration = this.csharpReceiverBinding(receiver);\n if (declaration?.kind !== SyntaxKind.Parameter) {\n return undefined;\n }\n const recorded = this.csharpParamTypes.get(declaration);\n return ((recorded === undefined) || (recorded === '') || (recorded === 'object')) ? undefined : recorded;\n }\n\n // A receiver whose declared C# type the consumer's classifier names as a concrete dictionary:\n // the `((IDictionary)x)` cast around element access is an identity conversion.\n // Gated entirely on the consumer's hook, so an object receiver and untyped runs keep the cast.\n csharpReceiverIsDeclaredDictionary(expression): boolean {\n const declared = this.csharpDeclaredReceiverType(expression);\n return (declared === 'Dictionary') || (declared === 'IDictionary');\n }\n\n // A dict element WRITE (`request[\"k\"] = v`) on a receiver whose *declared* C# type is already a\n // dictionary needs no `((IDictionary)…)` cast: both indexers are the same setter.\n // Gated entirely on csharpDeclaredReceiverType, so object receivers and untyped runs keep the cast.\n csharpDictionaryElementWriteTarget(node): string | undefined {\n const parent = node?.parent;\n // `request[\"k\"] += v` keeps the cast: only the plain assignment was audited\n const isWrite = parent?.kind === SyntaxKind.BinaryExpression\n && parent.operatorToken.kind === SyntaxKind.EqualsToken\n && parent.left === node;\n if (!isWrite || !this.ELEMENT_ACCESS_WRAPPER_OPEN || !this.ELEMENT_ACCESS_WRAPPER_CLOSE) {\n return undefined;\n }\n const { expression, argumentExpression } = node;\n if (!this.csharpReceiverIsDeclaredDictionary(expression)) {\n return undefined;\n }\n // the interface cast also carries the string-key proof; only a string key (or a union\n // holding one, the shape the index-signature key type reports) may stay cast-less\n const keyType = this.getChecker().getTypeAtLocation(argumentExpression);\n const members = (keyType.flags === TypeFlags.Union) ? ((keyType as any).getTypes() ?? [keyType]) : [keyType];\n const stringKey = (keyType.flags === TypeFlags.Any) || members.some((t) => this.isStringType(t.flags));\n if (!stringKey) {\n return undefined;\n }\n const cast = isStringLiteralLikeNode(argumentExpression) ? '' : '(string)';\n return this.printNode(expression, 0) + '[' + cast + this.printNode(argumentExpression, 0) + ']';\n }\n\n printElementAccessExpressionExceptionIfAny(node) {\n // convert this[method] into this.call(method) or this.callAsync(method)\n // if (node?.expression?.kind === SyntaxKind.ThisKeyword) {\n // const isAsyncDecl = node?.parent?.kind === SyntaxKind.AwaitExpression;\n // const open = isAsyncDecl ? this.UKNOWN_PROP_ASYNC_WRAPPER_OPEN : this.UKNOWN_PROP_WRAPPER_OPEN;\n // return open.replace('(', '');\n // }\n }\n\n // reads print getValue(recv, key), which yields null for a missing key; a C# indexer\n // throws instead, so the native form is only emitted where the source guarantees the key\n // is there: a dominating `key in recv` guard, or a receiver local built by a literal that\n // declares the key, or a receiver the declared table proves is a dictionary (the native\n // form then keeps the helper's null-for-a-missing-key result). every other read keeps the\n // helper.\n // the single element-access override, gates strongest (declaration-type) proof first:\n // S21 typed dict WRITE (csharpDictionaryElementWriteTarget), S63 typed dict READ twin\n // (printTypedDictElementAccessIfAny), S14 list-cast (csharpElementAccessReceiverIsList),\n // then the native read form proven from the printed source (#82, csharpNativeElementAccess,\n // see the note above). Every other read keeps the helper; a site no gate names keeps the\n // base printing.\n printElementAccessExpression(node, identation) {\n const native = this.csharpNativeElementAccess(node);\n if (native !== undefined) {\n return native;\n }\n const dictWrite = this.csharpDictionaryElementWriteTarget(node);\n if (dictWrite !== undefined) {\n return dictWrite;\n }\n const typedRead = this.printTypedDictElementAccessIfAny(node);\n if (typedRead !== undefined) {\n return typedRead;\n }\n if (this.csharpElementAccessReceiverIsList(node)) {\n const type = this.getChecker().getTypeAtLocation(node.argumentExpression);\n const isUnion = ((type.flags & TypeFlags.Union) !== 0) && Array.isArray((type as any).getTypes());\n // the base printer's own key dispatch, plus the union spelling the worker\n // handles: a string (or type-less) key is a dictionary element, never a list\n // index, and keeps the IDictionary cast\n const isStringOrUnknownKey = this.isStringType(type.flags)\n || (type.flags === TypeFlags.Any)\n || (isUnion && (type as any).getTypes().some((t) => this.isStringType(t.flags)));\n if (!isStringOrUnknownKey) {\n return `${this.printNode(node.expression, 0)}[Convert.ToInt32(${this.printNode(node.argumentExpression, 0)})]`;\n }\n }\n const listRead = this.csharpListIndexRead(node);\n if (listRead !== undefined) {\n return listRead;\n }\n const keyRead = (this.ELEMENT_ACCESS_WRAPPER_OPEN && !this.printElementAccessExpressionExceptionIfAny(node))\n ? this.csharpHx4IdentifierKeyRead(node.expression, node.argumentExpression) : undefined;\n if (keyRead !== undefined) {\n return keyRead; // hx4 C11\n }\n return super.printElementAccessExpression(node, identation);\n }\n\n csharpNativeElementAccess(node): string | undefined {\n if (!this.ELEMENT_ACCESS_WRAPPER_OPEN || !this.ELEMENT_ACCESS_WRAPPER_CLOSE) {\n return undefined;\n }\n const exception: any = this.printElementAccessExpressionExceptionIfAny(node);\n if (exception) {\n return undefined; // the exception printing wins over the native form\n }\n const { expression, argumentExpression } = node;\n const parent = node.parent;\n const isWrite = parent?.kind === SyntaxKind.BinaryExpression &&\n (parent.operatorToken.kind === SyntaxKind.EqualsToken || parent.operatorToken.kind === SyntaxKind.PlusEqualsToken) &&\n parent.left === node;\n if (isWrite) {\n return undefined; // writes are native already, they are printed with the cast\n }\n const isStringKey = isStringLiteralLikeNode(argumentExpression);\n const isNumberKey = isNumericLiteral(argumentExpression);\n if (!isStringKey && !isNumberKey) {\n return this.csharpLoopIndexListRead(expression, argumentExpression); // counter proven in range by its loop\n }\n const key = (argumentExpression as any).text;\n const builtFromLiteral = this.csharpLiteralDeclaresKey(node, expression, key, isNumberKey);\n const guarded = !builtFromLiteral && this.csharpKeyPresenceGuarded(node, expression, key);\n if (!builtFromLiteral && !guarded) {\n return this.csharpNativeDeclaredDictionaryRead(expression, argumentExpression)\n ?? this.csharpDeclaredLocalResolverRowRead(expression, argumentExpression)\n ?? this.csharpDeclaredCollectionRead(node, expression, argumentExpression, isStringKey, isNumberKey)\n ?? this.csharpProvenDictionaryRead(node, expression, argumentExpression, isStringKey)\n ?? this.csharpMissingKeyFieldRead(expression, argumentExpression, isStringKey);\n }\n const receiver = this.printNode(expression, 0);\n const printedKey = this.printNode(argumentExpression, 0);\n if (isNumberKey) {\n return `((${this.ARRAY_KEYWORD})${receiver})[${printedKey}]`;\n }\n // a receiver the classifier already declared a concrete dictionary keeps its own\n // indexer: the interface cast named the box, never a conversion\n if (this.csharpReceiverIsDeclaredDictionary(expression)) {\n return `${receiver}[${printedKey}]`;\n }\n return `((IDictionary)${receiver})[${printedKey}]`;\n }\n\n // `getValue (market, \"lit\")` / `getValue (currency, \"lit\")` on a row local the declared\n // table proves is a C# dictionary: the native form tests the key, so a missing key still\n // reads null exactly like the helper. An untyped receiver keeps the helper.\n csharpIsMarketRowKeyRead(expression, argumentExpression): boolean {\n return isIdentifier(expression) && isStringLiteralLikeNode(argumentExpression)\n && CSHARP_NATIVE_MARKET_RECEIVERS.indexOf(expression.text as string) >= 0;\n }\n\n csharpNativeDeclaredDictionaryRead(expression, argumentExpression): string | undefined {\n if (!this.csharpIsMarketRowKeyRead(expression, argumentExpression)) {\n return undefined;\n }\n if (this.csharpDeclaredDictionaryType(expression) === undefined) {\n return undefined;\n }\n const receiver = this.printNode(expression, 0);\n const printedKey = this.printNode(argumentExpression, 0);\n return `(${receiver}.ContainsKey(${printedKey}) ? ${receiver}[${printedKey}] : null)`;\n }\n\n // the C# dictionary type the declared table names for a local read, or undefined: the\n // printer's own table, then the build layer's read proof (the row a market/currency builder\n // returned; never null on any path)\n csharpDeclaredDictionaryType(node): string | undefined {\n if (node?.kind !== SyntaxKind.Identifier) {\n return undefined;\n }\n const named = this.csharpTypedLocalType(node) ?? this.csharpExpressionTypeOf(node);\n if (named === undefined || CSHARP_NATIVE_DICTIONARY_TYPES.indexOf(named) < 0) {\n return undefined;\n }\n return named;\n }\n\n // the type the embedding build layer recorded for the declaration behind a read\n // (csharpDeclaredLocalTypeResolver): the declarations it retyped itself, i.e. the parameters\n // and locals whose printed prefix is no longer what the printer's own tables say\n csharpDeclaredLocalResolverType(node): string | undefined {\n if (typeof this.csharpDeclaredLocalTypeResolver !== 'function') {\n return undefined;\n }\n const checker: any = this.checkerOrUndefined();\n if (checker === undefined) {\n return undefined;\n }\n const declaration = checker.getSymbolAtLocation(node)?.valueDeclaration?.resolve();\n if (declaration === undefined) {\n return undefined;\n }\n const recorded = this.csharpDeclaredLocalTypeResolver(declaration);\n return (typeof recorded === 'string') ? recorded : undefined;\n }\n\n // the same read for a receiver only the build layer's declared-local resolver names (a\n // parameter B-17 retyped): its box may still be null, so the read carries the helper's\n // own `value2 == null -> null` branch as a null test\n csharpDeclaredLocalResolverRowRead(expression, argumentExpression): string | undefined {\n if (!this.csharpIsMarketRowKeyRead(expression, argumentExpression)) {\n return undefined;\n }\n const recorded = this.csharpDeclaredLocalResolverType(expression);\n if (recorded === undefined || CSHARP_NATIVE_DICTIONARY_TYPES.indexOf(recorded) < 0) {\n return undefined;\n }\n const receiver = this.printNode(expression, 0);\n const printedKey = this.printNode(argumentExpression, 0);\n return `(${receiver} != null && ${receiver}.ContainsKey(${printedKey}) ? ${receiver}[${printedKey}] : null)`;\n }\n\n // a read of a hand-written BaseExchange dictionary field whose key may be absent: the key\n // test plus the indexer print what the helper computes, so a missing key still reads null\n // (a bare indexer would throw). Any other receiver or a numeric key keeps the helper\n csharpMissingKeyFieldRead(expression, argumentExpression, isStringKey): string | undefined {\n if (!isStringKey) {\n return undefined;\n }\n if (!isPropertyAccessExpression(expression) || expression.expression.kind !== SyntaxKind.ThisKeyword) {\n return undefined;\n }\n const name = expression.name?.text as string;\n if (CSHARP_MISSING_KEY_FIELDS_NATIVE.indexOf(name) < 0) {\n return undefined;\n }\n const field = this.printNode(expression, 0);\n const printedKey = this.printNode(argumentExpression, 0);\n // `urls`/`markets`/`exceptions` are declared `object`: same cast and null-receiver branch as the\n // transpiled helper body (initializeProperties may leave the box null when describe() has no such\n // row). `has`/`options` are concrete dictionaries, never null, so they need no test.\n if (CSHARP_OBJECT_DICT_FIELDS.indexOf(name) >= 0) {\n const receiver = `((IDictionary)${field})`;\n return `(${field} != null && ${receiver}.ContainsKey(${printedKey}) ? ${receiver}[${printedKey}] : null)`;\n }\n return `(${field}.ContainsKey(${printedKey}) ? ${field}[${printedKey}] : null)`;\n }\n\n // A literal-key read on a local whose C# declaration is already a collection: no cast needed, but\n // the indexer throws where GetValue answers null, so the native form carries the helper's key/index\n // and null-receiver tests. Only an Identifier qualifies (its text is read up to three times).\n csharpDeclaredCollectionRead(node, expression, argumentExpression, isStringKey, isNumberKey): string | undefined {\n if (!isIdentifier(expression)) {\n return undefined;\n }\n if (CSHARP_MARKET_RECEIVER_NAMES.indexOf(expression.text as string) >= 0) {\n return undefined;\n }\n const csharpType = this.csharpDeclaredCollectionType(expression);\n if (csharpType === undefined) {\n return undefined;\n }\n if (!this.csharpHx4DeclaredReceiverReadable(node, expression)) {\n return undefined;\n }\n const receiver = this.printNode(expression, 0);\n if (csharpType.indexOf('Dictionary<') >= 0) {\n if (!isStringKey) {\n return undefined; // the helper reads a dictionary key as a string, a literal index has no native twin\n }\n const printedKey = this.printNode(argumentExpression, 0);\n return `(${receiver} != null && ${receiver}.ContainsKey(${printedKey}) ? ${receiver}[${printedKey}] : null)`;\n }\n if (isNumberKey) {\n const index = Number((argumentExpression as any).text);\n if (!Number.isInteger(index) || (index < 0)) {\n return undefined; // the helper throws on a negative index too, but never prints one itself\n }\n return `(${receiver} != null && ${index} < ${receiver}.Count ? ${receiver}[${index}] : null)`;\n }\n return undefined;\n }\n\n // The C# collection type a local read was DECLARED with: printed by this printer, or recorded by\n // embedding build layer for a declaration it retyped (csharpDeclaredLocalTypeResolver). The\n // value-type oracle does not qualify: the declaration may still be `object` and not compile.\n csharpDeclaredCollectionType(expression): string | undefined {\n const named = this.csharpTypedLocalType(expression);\n if (named !== undefined && CSHARP_NATIVE_COLLECTION_TYPES.indexOf(named) >= 0) {\n return named;\n }\n if (this.csharpDeclaredLocalTypeResolver === undefined) {\n return undefined;\n }\n const declaration = this.getChecker().getSymbolAtLocation(expression)?.valueDeclaration?.resolve();\n if (declaration === undefined) {\n return undefined;\n }\n const recorded = this.csharpDeclaredLocalTypeResolver(declaration);\n return (recorded !== undefined && CSHARP_NATIVE_COLLECTION_TYPES.indexOf(recorded) >= 0) ? recorded : undefined;\n }\n\n // A literal-key read on a local still declared `object` but whose box the build layer's value-type\n // oracle (build/csharp-local-types.js) proves a dictionary: the cast makes the read compile, and\n // key test plus null guard return exactly what the helper does. Sibling arms are filtered first.\n csharpProvenDictionaryRead(node, expression, argumentExpression, isStringKey): string | undefined {\n if (!isStringKey || !isIdentifier(expression)) {\n return undefined;\n }\n if (CSHARP_MARKET_RECEIVER_NAMES.indexOf(expression.text as string) >= 0) {\n return undefined;\n }\n if (this.csharpTypedLocalType(expression) !== undefined) {\n return undefined; // the declaration this printer wrote names its own type (see above)\n }\n const proven = this.csharpExpressionTypeOf(expression);\n if (proven === undefined || CSHARP_NATIVE_DICTIONARY_TYPES.indexOf(proven) < 0) {\n return undefined; // only a proven dictionary box has the members the read binds\n }\n const func = this.csharpEnclosingFunction(node);\n if (func === undefined || this.csharpReceiverIsRewritten(func, expression)) {\n return undefined; // a reassigned receiver may hold another box at this read\n }\n const local = this.printNode(expression, 0);\n const receiver = `((IDictionary)${local})`;\n const printedKey = this.printNode(argumentExpression, 0);\n return `(${local} != null && ${receiver}.ContainsKey(${printedKey}) ? ${receiver}[${printedKey}] : null)`;\n }\n\n // the read sits in a branch that a `key in recv` guard admitted: same then-branch as the\n // guard, the else-branch of a negated guard, or after an early-exiting `if (!(key in recv))`\n csharpKeyPresenceGuarded(node, expression, key): boolean {\n const func = this.csharpEnclosingFunction(node);\n if (func === undefined) {\n return false;\n }\n const guards = this.csharpInGuardsOf(func).get(expression.getText() + GUARD_KEY_SEPARATOR + key);\n if (guards === undefined || !this.csharpReceiverIsDictionaryLike(expression, key)) {\n return false;\n }\n if (this.csharpReceiverIsRewritten(func, expression)) {\n return false; // a reassigned receiver is not the object the guard inspected\n }\n if (this.csharpHasKeyRemoval(func, expression, key)) {\n return false; // delete could have removed the guarded key\n }\n return guards.some((guard) => this.csharpGuardAdmitsRead(guard, node));\n }\n\n // `recv[i]` where `i` is the counter of an enclosing `for (...; i < recv.length; ...)`: that\n // condition is the range proof, so the helper's out-of-range null branch is unreachable. Both\n // operands must print as the indexer's C# types (object-element list, `int`); else keep the helper.\n csharpLoopIndexListRead(expression, argumentExpression): string | undefined {\n if (!isIdentifier(expression) || !isIdentifier(argumentExpression)) {\n return undefined;\n }\n const receiverType = this.csharpExpressionTypeOf(expression);\n if (receiverType === undefined || !this.csharpTypeIsList(receiverType)) {\n return undefined;\n }\n if (this.csharpExpressionTypeOf(argumentExpression) !== 'int') {\n return undefined; // a boxed/Int64/double index does not bind the List indexer\n }\n const loop = this.csharpCounterRangeLoop(argumentExpression, expression);\n if (loop === undefined) {\n return undefined;\n }\n if (!this.csharpCounterUnwrittenIn(loop.statement, argumentExpression) ||\n !this.csharpReceiverIntactIn(loop.statement, expression)) {\n return undefined; // the bound the header proved no longer holds at this read\n }\n return `${this.printNode(expression, 0)}[${this.printNode(argumentExpression, 0)}]`;\n }\n\n // the enclosing `for` whose condition is ` < .length` and whose header declares\n // that counter: the condition held on entry to this pass and nothing in between moved off it\n csharpCounterRangeLoop(counter, receiver) {\n let node: any = counter;\n while (node.parent !== undefined) {\n const parent: any = node.parent;\n if (isFunctionLike(parent)) {\n return undefined; // a closure runs when the counter may already have moved on\n }\n if (isForStatement(parent) && this.csharpContains(parent.statement, counter) && this.csharpForBoundsCounter(parent, counter, receiver)) {\n return parent;\n }\n node = parent;\n }\n return undefined;\n }\n\n csharpForBoundsCounter(loop, counter, receiver): boolean {\n const condition = this.csharpUnparenthesized(loop.condition);\n if (condition?.kind !== SyntaxKind.BinaryExpression || condition.operatorToken.kind !== SyntaxKind.LessThanToken) {\n return false;\n }\n const left = this.csharpUnparenthesized(condition.left);\n const right = this.csharpUnparenthesized(condition.right);\n if (!isIdentifier(left) || !isPropertyAccessExpression(right) || right.name?.text !== 'length') {\n return false;\n }\n const receiverExpression = this.csharpUnparenthesized(right.expression);\n if (!isIdentifier(receiverExpression) || !this.csharpCounterStartsAtZero(loop, counter) || !this.csharpCounterAdvances(loop, counter)) {\n return false;\n }\n const declaration = this.getChecker().getSymbolAtLocation(counter)?.valueDeclaration?.resolve();\n const checker = this.getChecker();\n return declaration !== undefined &&\n checker.getSymbolAtLocation(left)?.valueDeclaration?.resolve() === declaration &&\n checker.getSymbolAtLocation(receiverExpression)?.valueDeclaration?.resolve() === checker.getSymbolAtLocation(receiver)?.valueDeclaration?.resolve();\n }\n\n // `for (let i = = 0>; ...)` — a negative start would index below the list\n csharpCounterStartsAtZero(loop, counter): boolean {\n const initializer: any = loop.initializer;\n if (initializer?.kind !== SyntaxKind.VariableDeclarationList || initializer.declarations.length !== 1) {\n return false;\n }\n const declaration: any = initializer.declarations[0];\n if (!isIdentifier(declaration.name) || !isNumericLiteral(declaration.initializer)) {\n return false;\n }\n return Number(declaration.initializer.text) >= 0 && this.getChecker().getSymbolAtLocation(counter)?.valueDeclaration?.resolve() === declaration;\n }\n\n // the header moves the counter forward: a decrement could leave a negative index behind\n csharpCounterAdvances(loop, counter): boolean {\n const declaration = this.getChecker().getSymbolAtLocation(counter)?.valueDeclaration?.resolve();\n const incrementor: any = this.csharpUnparenthesized(loop.incrementor);\n if (incrementor === undefined || declaration === undefined) {\n return false;\n }\n if (incrementor.kind === SyntaxKind.PostfixUnaryExpression || incrementor.kind === SyntaxKind.PrefixUnaryExpression) {\n return incrementor.operator === SyntaxKind.PlusPlusToken &&\n this.getChecker().getSymbolAtLocation(incrementor.operand)?.valueDeclaration?.resolve() === declaration;\n }\n if (incrementor.kind === SyntaxKind.BinaryExpression && incrementor.operatorToken.kind === SyntaxKind.PlusEqualsToken) {\n return this.getChecker().getSymbolAtLocation(incrementor.left)?.valueDeclaration?.resolve() === declaration &&\n isNumericLiteral(incrementor.right) && Number(incrementor.right.text) >= 0;\n }\n return false;\n }\n\n // a write to the counter in the body invalidates the bound the condition proved\n csharpCounterUnwrittenIn(range, counter): boolean {\n const declaration = this.getChecker().getSymbolAtLocation(counter)?.valueDeclaration?.resolve();\n if (declaration === undefined) {\n return false;\n }\n let written = false;\n this.csharpWalkIdentifiers(range, (identifier: any) => {\n if (written || !this.csharpIsSameDeclaration(identifier, declaration)) {\n return;\n }\n const parent: any = identifier.parent;\n if (isBinaryExpression(parent) && parent.left === identifier) {\n written = CSHARP_ASSIGNMENT_OPERATOR_KINDS.indexOf(parent.operatorToken.kind) >= 0;\n } else {\n written = ((isPrefixUnaryExpression(parent) || isPostfixUnaryExpression(parent)) && parent.operand === identifier)\n || isDeleteExpression(parent);\n }\n });\n return !written;\n }\n\n // the condition's `.length` still proves the range only while the list is intact: inside\n // the body the receiver may be read (element reads, its own `.length`) and nothing else\n csharpReceiverIntactIn(range, receiver): boolean {\n const declaration = this.getChecker().getSymbolAtLocation(receiver)?.valueDeclaration?.resolve();\n if (declaration === undefined) {\n return false;\n }\n let intact = true;\n this.csharpWalkIdentifiers(range, (identifier: any) => {\n if (!intact || !this.csharpIsSameDeclaration(identifier, declaration)) {\n return;\n }\n const parent: any = identifier.parent;\n if (isPropertyAccessExpression(parent) && parent.expression === identifier && parent.name?.text === 'length') {\n return;\n }\n if (isElementAccessExpression(parent) && parent.expression === identifier && !this.csharpIsWriteTarget(parent)) {\n return;\n }\n intact = false;\n });\n return intact;\n }\n\n csharpIsSameDeclaration(identifier, declaration): boolean {\n return this.getChecker().getSymbolAtLocation(identifier)?.valueDeclaration?.resolve() === declaration;\n }\n\n csharpWalkIdentifiers(node, visit) {\n if (node === undefined) {\n return;\n }\n if (isIdentifier(node)) {\n visit(node);\n }\n node.forEachChild((child: any) => this.csharpWalkIdentifiers(child, visit));\n }\n\n // `x[i] = v` / `x[i]++` / `delete x[i]` change the receiver in place\n csharpIsWriteTarget(node): boolean {\n let value: any = node;\n while (value.parent !== undefined && isParenthesizedExpression(value.parent)) {\n value = value.parent;\n }\n const parent: any = value.parent;\n if (parent === undefined) {\n return false;\n }\n if (isBinaryExpression(parent) && parent.left === value) {\n return CSHARP_ASSIGNMENT_OPERATOR_KINDS.indexOf(parent.operatorToken.kind) >= 0;\n }\n if ((isPrefixUnaryExpression(parent) || isPostfixUnaryExpression(parent)) && parent.operand === value) {\n return (parent.operator === SyntaxKind.PlusPlusToken) || (parent.operator === SyntaxKind.MinusMinusToken);\n }\n return isDeleteExpression(parent);\n }\n\n csharpUnparenthesized(node) {\n let value: any = node;\n while (value !== undefined && value.kind === SyntaxKind.ParenthesizedExpression) {\n value = value.expression;\n }\n return value;\n }\n\n csharpGuardAdmitsRead(guard, read): boolean {\n const negated = this.csharpGuardIsNegated(guard);\n let statement: any = guard;\n while (statement !== undefined && statement.parent !== undefined) {\n const parent: any = statement.parent;\n if (isIfStatement(parent) && this.csharpContains(parent.expression, guard)) {\n if (!negated && this.csharpContains(parent.thenStatement, read)) {\n return true;\n }\n if (negated && parent.elseStatement !== undefined && this.csharpContains(parent.elseStatement, read)) {\n return true;\n }\n // `if (!(key in recv)) { return/throw/continue; }` then the read after it\n if (negated && this.csharpAlwaysExits(parent.thenStatement) &&\n read.getStart() >= parent.getEnd() && this.csharpContains(parent.parent, read)) {\n return true;\n }\n return false;\n }\n if (isWhileStatement(parent) && this.csharpContains(parent.expression, guard)) {\n return !negated && this.csharpContains(parent.statement, read);\n }\n statement = parent;\n }\n return false;\n }\n\n // `key in recv` guards in the function body, indexed by receiver text + key; nested\n // functions are skipped, their guards cannot dominate a read of the outer function\n csharpInGuardsOf(func): Map {\n const cached = this.csharpGuardIndex.get(func);\n if (cached !== undefined) {\n return cached;\n }\n const index: Map = new Map();\n const collect = (n: any) => {\n if (n !== func && isFunctionLike(n)) {\n return;\n }\n if (isBinaryExpression(n) && n.operatorToken.kind === SyntaxKind.InKeyword) {\n const keyNode: any = n.left;\n if (isStringLiteralLikeNode(keyNode) || isNumericLiteral(keyNode)) {\n const id = n.right.getText() + GUARD_KEY_SEPARATOR + keyNode.text;\n const list = index.get(id);\n if (list === undefined) {\n index.set(id, [ n ]);\n } else {\n list.push(n);\n }\n }\n }\n n.forEachChild(collect);\n };\n collect(func);\n this.csharpGuardIndex.set(func, index);\n return index;\n }\n\n // the read's receiver is a local whose only initializer is a literal that declares the\n // key, and the local is not reassigned or deleted from afterwards\n csharpLiteralDeclaresKey(node, expression, key, isNumberKey): boolean {\n if (!isIdentifier(expression)) {\n return false;\n }\n const symbol: any = this.getChecker().getSymbolAtLocation(expression);\n const declarations: any = (symbol?.declarations ?? []).map((d) => d.resolve());\n if (declarations.length !== 1 || !isVariableDeclaration(declarations[0])) {\n return false;\n }\n const declaration: any = declarations[0];\n if (declaration.initializer === undefined || declaration.getStart() >= node.getStart()) {\n return false;\n }\n const initializer = declaration.initializer;\n let declares = false;\n if (isNumberKey && isArrayLiteralExpression(initializer)) {\n const spread = initializer.elements.some((element: any) => isSpreadElement(element));\n declares = !spread && Number(key) < initializer.elements.length;\n } else if (!isNumberKey && isObjectLiteralExpression(initializer)) {\n declares = this.csharpObjectLiteralDeclaresKey(initializer, key);\n }\n if (!declares) {\n return false;\n }\n const func = this.csharpEnclosingFunction(node);\n return func !== undefined && !this.csharpReceiverIsRewritten(func, expression);\n }\n\n csharpObjectLiteralDeclaresKey(literal, key): boolean {\n for (const property of literal.properties) {\n if (isSpreadAssignment(property)) {\n return false; // spread keys cannot be enumerated\n }\n const name: any = (property as any).name;\n if (name !== undefined && (isIdentifier(name) || isStringLiteralLikeNode(name) || isNumericLiteral(name)) && name.text === key) {\n return true;\n }\n }\n return false;\n }\n\n // the receiver must be a dictionary at runtime for the IDictionary cast to hold; `any`\n // receivers are rejected because the checker cannot tell what the read reaches\n csharpReceiverIsDictionaryLike(expression, key): boolean {\n const type: any = this.getChecker().getTypeAtLocation(expression);\n if (type.flags === TypeFlags.Any || type.flags === TypeFlags.Unknown) {\n return false;\n }\n const checker = this.getChecker();\n return checker.getIndexInfoOfType(type, IndexKind.String) !== undefined ||\n checker.getPropertyOfType(type, key) !== undefined;\n }\n\n // any assignment to the receiver (or to a same-named binding) in the function makes the\n // object the read evaluates unprovable, so the read falls back to the helper\n csharpReceiverIsRewritten(func, expression): boolean {\n const text = expression.getText();\n const name = isIdentifier(expression) ? text : text.split(/[.[]/)[1];\n if (name === undefined) {\n return true;\n }\n let rewritten = false;\n const walk = (n: any) => {\n if (rewritten) {\n return;\n }\n if (isIdentifier(n) && n.text === name) {\n const parent: any = n.parent;\n rewritten = (isBinaryExpression(parent) && parent.left === n)\n || ((isPrefixUnaryExpression(parent) || isPostfixUnaryExpression(parent)) && parent.operand === n)\n || isDeleteExpression(parent);\n }\n n.forEachChild(walk);\n };\n walk(func);\n return rewritten;\n }\n\n // ===== ws handler `message` parameter (batch D, D-19) =====\n // A ws handler `handleX (client: Client, message: Dict)` is reached at runtime either\n // through a dispatch-table entry (`{ \"k\", this.handleX }` -> DynamicInvoker) or a direct\n csharpHandlerMessageType(param): string | undefined {\n if (this.csharpHandlerMessageTypes.has(param)) {\n return this.csharpHandlerMessageTypes.get(param);\n }\n let result: string | undefined = undefined;\n const method: any = param?.parent;\n if (isMethodDeclaration(method) && (method.parameters.length >= 2) && (method.parameters[1] === param)) {\n if ((this.csharpCheckerTypeName(method.parameters[0]) === 'Client') &&\n (this.csharpCheckerTypeName(param) === 'Dict') &&\n (this.getMethodOverride(method) === undefined) &&\n !this.csharpReceiverIsRewritten(method, param.name) &&\n !this.csharpHandlerIsCalled(method) &&\n !this.csharpClassHasListRoute(method)) {\n result = this.ArgTypeReplacements['Dict'] ?? 'Dictionary';\n }\n }\n this.csharpHandlerMessageTypes.set(param, result);\n return result;\n }\n\n // the type name the checker prints for a node's type, or undefined in an in-memory\n // program (no checker answer: the printer keeps its own)\n csharpCheckerTypeName(node): string | undefined {\n if (node === undefined) {\n return undefined;\n }\n try {\n const checker = this.getChecker();\n const type = checker.getTypeAtLocation(node);\n return (type === undefined) ? undefined : checker.typeToString(type);\n } catch (e) {\n return undefined;\n }\n }\n\n csharpEnclosingClass(node): any | undefined {\n let current: any = node?.parent;\n while (current !== undefined) {\n if (isClassDeclaration(current) || isClassExpression(current)) {\n return current;\n }\n current = current.parent;\n }\n return undefined;\n }\n\n // the identifier is the raw `message` parameter of a handler-shaped method (a `Client`\n // first parameter, so `handleMessage` with its `any` annotation included): the class can\n // route that same value through its list arm\n csharpIsHandlerMessageIdentifier(node): boolean {\n if (!isIdentifier(node)) {\n return false;\n }\n try {\n const declaration: any = this.getChecker().getSymbolAtLocation(node)?.valueDeclaration?.resolve();\n if ((declaration === undefined) || !isParameterDeclaration(declaration)) {\n return false;\n }\n const owner: any = declaration.parent;\n return isMethodDeclaration(owner) && (owner.parameters.length >= 2) &&\n (owner.parameters[1] === declaration) && (this.csharpCheckerTypeName(owner.parameters[0]) === 'Client');\n } catch (e) {\n return false;\n }\n }\n\n // a class that tests the message (or another dict parameter) for a list can hand the\n // array itself to a dispatch-table entry (binance `'x@arr'`), so its handlers keep the\n // box; a class testing unrelated lists (an array-typed `symbols` parameter, a field of\n csharpClassHasListRoute(method): boolean {\n const cls = this.csharpEnclosingClass(method);\n if (cls === undefined) {\n return true; // no class, no proof\n }\n const cached = this.csharpListRouteClasses.get(cls);\n if (cached !== undefined) {\n return cached;\n }\n let found = false;\n const walk = (n: any) => {\n if (found) {\n return;\n }\n if (isCallExpression(n) && isPropertyAccessExpression(n.expression) &&\n ((n.expression as any).expression?.text === 'Array') && ((n.expression as any).name?.text === 'isArray')) {\n const argument: any = n.arguments[0];\n if (this.csharpIsHandlerMessageIdentifier(argument)) {\n found = true;\n return;\n }\n }\n n.forEachChild(walk);\n };\n walk(cls);\n this.csharpListRouteClasses.set(cls, found);\n return found;\n }\n\n // a static call reference (`this.handleX (…)`) binds the argument to the printed\n // signature; a method-group value (a dispatch-table entry) does not\n csharpHandlerIsCalled(method): boolean {\n const cached = this.csharpHandlerCalled.get(method);\n if (cached !== undefined) {\n return cached;\n }\n let called = true; // no symbol answer: keep the box\n const cls = this.csharpEnclosingClass(method);\n let file: any;\n try {\n file = method.getSourceFile();\n } catch (e) {\n file = undefined;\n }\n if ((cls !== undefined) && (file !== undefined)) {\n try {\n const symbol = this.getChecker().getSymbolAtLocation(method.name);\n if (symbol !== undefined) {\n called = this.csharpHandlerCallIndexFor(file).get(symbol) === true;\n }\n } catch (e) {\n called = true;\n }\n }\n this.csharpHandlerCalled.set(method, called);\n return called;\n }\n\n // every identifier of the FILE that resolves to one of its classes' own method names,\n // recorded as a call when it is the callee of a call expression; keyed by symbol, so a\n // same-named method of another class never marks this one\n csharpHandlerCallIndexFor(file): Map {\n const cached = this.csharpHandlerCallIndex.get(file);\n if (cached !== undefined) {\n return cached;\n }\n const names = new Set();\n const collect = (n: any) => {\n if (isClassDeclaration(n) || isClassExpression(n)) {\n for (const member of n.members) {\n const name: any = (member as any).name?.text;\n if (isMethodDeclaration(member) && (name !== undefined)) {\n names.add(name);\n }\n }\n }\n n.forEachChild(collect);\n };\n collect(file);\n const index = new Map();\n if (names.size > 0) {\n let checker;\n try {\n checker = this.getChecker();\n } catch (e) {\n checker = undefined;\n }\n if (checker !== undefined) {\n const walk = (n: any) => {\n if (isIdentifier(n) && names.has(n.text as string)) {\n let symbol;\n try {\n symbol = checker.getSymbolAtLocation(n);\n } catch (e) {\n symbol = undefined;\n }\n if (symbol !== undefined) {\n const parent: any = n.parent;\n const isCall = (isPropertyAccessExpression(parent) && (parent.name === n) &&\n isCallExpression(parent.parent) && (parent.parent.expression === parent)) ||\n (isCallExpression(parent) && (parent.expression === n));\n if (isCall) {\n index.set(symbol, true);\n } else if (index.get(symbol) === undefined) {\n index.set(symbol, false);\n }\n }\n }\n n.forEachChild(walk);\n };\n walk(file);\n }\n }\n this.csharpHandlerCallIndex.set(file, index);\n return index;\n }\n\n csharpHasKeyRemoval(func, expression, key): boolean {\n const text = expression.getText();\n let removed = false;\n const walk = (n: any) => {\n if (removed) {\n return;\n }\n if (isDeleteExpression(n) && isElementAccessExpression(n.expression) &&\n n.expression.expression.getText() === text && n.expression.argumentExpression.getText().replace(/['\"]/g, '') === key.replace(/['\"]/g, '')) {\n removed = true;\n }\n n.forEachChild(walk);\n };\n walk(func);\n return removed;\n }\n\n csharpGuardIsNegated(guard): boolean {\n let node: any = guard;\n while (node.parent !== undefined && isParenthesizedExpression(node.parent)) {\n node = node.parent;\n }\n return node.parent !== undefined && isPrefixUnaryExpression(node.parent) &&\n node.parent.operator === SyntaxKind.ExclamationToken;\n }\n\n csharpAlwaysExits(statement): boolean {\n if (statement === undefined) {\n return false;\n }\n const exits = (n: any) => isReturnStatement(n) || isThrowStatement(n) || isContinueStatement(n) || isBreakStatement(n);\n if (exits(statement)) {\n return true;\n }\n if (isBlock(statement) && statement.statements.length > 0) {\n return exits(statement.statements[statement.statements.length - 1]);\n }\n return false;\n }\n\n csharpContains(outer, inner): boolean {\n if (outer === undefined || inner === undefined) {\n return false;\n }\n return inner.getStart() >= outer.getStart() && inner.getEnd() <= outer.getEnd();\n }\n // cs-strict S14: `((List)x)[i] = v` needs no cast when the PRINTED declaration is\n // `List` (identity conversion; not IList, a checked downcast). Type comes via the\n // `csharpLocalTypeOf` hook; `x[i] += v` and reads stay on the base path (third override layer).\n csharpElementAccessReceiverIsList(node) {\n if (node?.kind !== SyntaxKind.ElementAccessExpression) {\n return false;\n }\n const parent = node.parent;\n if (parent?.kind !== SyntaxKind.BinaryExpression || parent.operatorToken?.kind !== SyntaxKind.EqualsToken || parent.left !== node) {\n return false;\n }\n const receiver = node.expression;\n if (receiver?.kind !== SyntaxKind.Identifier) {\n return false;\n }\n const localTypeOf = (this as any).csharpLocalTypeOf;\n return (typeof localTypeOf === 'function') && (localTypeOf.call(this, receiver) === 'List');\n }\n\n // The C# declared type pair of a list index READ (`x[i]`): receiver (`List` /\n // `IList`) and index (`int`). Consumer-installed (build/csharp-local-types.js);\n // undefined by default, so an unpatched printer keeps `getValue (x, i)` for every read.\n csharpListIndexReadTypes(node): { receiver: string, index: string } | undefined {\n return undefined; // stub to override\n }\n\n // `x[i]` read on a list receiver: the helper answers null off the end while the C# indexer throws,\n // so the native read is only emitted where the source proves the index in range. Types come from\n // the consumer hook above, so the untyped emission is byte-identical.\n csharpListIndexRead(node): string | undefined {\n if (node?.kind !== SyntaxKind.ElementAccessExpression) {\n return undefined;\n }\n const { expression, argumentExpression } = node;\n if (expression?.kind !== SyntaxKind.Identifier || argumentExpression?.kind !== SyntaxKind.Identifier) {\n return undefined;\n }\n if (this.csharpIsSetOrAddTarget(node)) {\n return undefined; // element writes print through the cast path\n }\n const types = (typeof this.csharpListIndexReadTypes === 'function') ? this.csharpListIndexReadTypes(node) : undefined;\n if (types?.index !== 'int') {\n return undefined; // only an int index binds the List indexer\n }\n if ((types.receiver !== 'List') && (types.receiver !== 'IList')) {\n return undefined;\n }\n if (!this.csharpIndexIsLoopBounded(node, expression, argumentExpression)) {\n return undefined;\n }\n return this.printNode(expression, 0) + '[' + this.printNode(argumentExpression, 0) + ']';\n }\n\n // the read sits in the body of a `for` that re-tests `index < receiver.length`, both\n // resolved to the very symbols the read uses, and nothing in the body can move either\n csharpIndexIsLoopBounded(read, receiver, index): boolean {\n const receiverSymbol = this.csharpIdentifierSymbol(receiver);\n const indexSymbol = this.csharpIdentifierSymbol(index);\n if (receiverSymbol === undefined || indexSymbol === undefined) {\n return false;\n }\n let node: any = read;\n while (node?.parent !== undefined) {\n const parent: any = node.parent;\n if (isFunctionLike(parent)) {\n return false; // a read under a nested function is not dominated by the condition\n }\n if (isForStatement(parent) && this.csharpForBoundsIndex(parent, read, receiverSymbol, indexSymbol)) {\n return true;\n }\n node = parent;\n }\n return false;\n }\n\n csharpIdentifierSymbol(node): any {\n if (node?.kind !== SyntaxKind.Identifier) {\n return undefined;\n }\n return this.checkerOrUndefined()?.getSymbolAtLocation(node);\n }\n\n csharpForBoundsIndex(forStatement, read, receiverSymbol, indexSymbol): boolean {\n if (!this.csharpContains(forStatement.statement, read)) {\n return false; // the read is in the loop header, not the body\n }\n const condition: any = forStatement.condition;\n if (condition?.kind !== SyntaxKind.BinaryExpression || condition.operatorToken?.kind !== SyntaxKind.LessThanToken) {\n return false;\n }\n const length: any = condition.right;\n if (length?.kind !== SyntaxKind.PropertyAccessExpression || length.name?.text !== 'length') {\n return false;\n }\n if (this.csharpIdentifierSymbol(condition.left) !== indexSymbol) {\n return false;\n }\n if (this.csharpIdentifierSymbol(this.csharpLengthReceiverIdentifier(length.expression)) !== receiverSymbol) {\n return false;\n }\n return !this.csharpIndexBoundIsVoided(forStatement.statement, receiverSymbol, indexSymbol);\n }\n\n // The identifier a `.length` receiver reads through wrappers whose C# print is the bare text:\n // parentheses, and `as T` where printAsExpression does not cast (`any`/`string`/`T[]` print a cast,\n // so the bound would not be the receiver's Count). `(response as List).length` -> `?.Count ?? 0`\n csharpLengthReceiverIdentifier(node): any {\n let current: any = node;\n while (current !== undefined) {\n if (current.kind === SyntaxKind.ParenthesizedExpression) {\n current = current.expression;\n continue;\n }\n if (current.kind === SyntaxKind.AsExpression && current.type !== undefined\n && current.type.kind !== SyntaxKind.AnyKeyword\n && current.type.kind !== SyntaxKind.StringKeyword\n && current.type.kind !== SyntaxKind.ArrayType) {\n current = current.expression;\n continue;\n }\n break;\n }\n return current;\n }\n\n // the condition ran before the body did: a write to the index, or any use of the receiver\n // other than an element access / a property read (a method call, an argument, a bare read —\n // anything that could hand the list to something that shrinks it) voids the bound\n csharpIndexBoundIsVoided(body, receiverSymbol, indexSymbol): boolean {\n let voided = false;\n const visit = (n: any) => {\n if (voided || n === undefined) {\n return;\n }\n if (n.kind === SyntaxKind.Identifier) {\n const symbol = this.csharpIdentifierSymbol(n);\n if (symbol === indexSymbol && this.csharpIdentifierIsWritten(n)) {\n voided = true;\n return;\n }\n if (symbol === receiverSymbol && !this.csharpReceiverUseKeepsBound(n)) {\n voided = true;\n return;\n }\n }\n n.forEachChild(visit);\n };\n body.forEachChild(visit);\n return voided;\n }\n\n // a use that cannot move the value the condition tested: the expression of an element\n // access (`recv[i]`, a read or an element write — neither changes the length) or of a\n // property READ (`recv.Count`); a property write or a call on the receiver is not one\n csharpReceiverUseKeepsBound(node): boolean {\n const parent: any = node.parent;\n if (parent === undefined) {\n return false;\n }\n if (parent.kind === SyntaxKind.ElementAccessExpression && parent.expression === node) {\n return true;\n }\n if (parent.kind === SyntaxKind.PropertyAccessExpression && parent.expression === node) {\n if (this.csharpIdentifierIsWritten(node)) {\n return false; // `recv.length = n`\n }\n const grand: any = parent.parent;\n return !(grand?.kind === SyntaxKind.CallExpression && grand.expression === parent);\n }\n return false;\n }\n\n // the identifier is a write target: `x = v`, `x += v`, `x++` / `x--`, a destructuring\n // element, or a property/element write through it (`x.length = 0`)\n csharpIdentifierIsWritten(node): boolean {\n const parent: any = node.parent;\n if (parent === undefined) {\n return false;\n }\n if (parent.kind === SyntaxKind.BinaryExpression && parent.left === node && this.csharpIsAssignmentOperator(parent.operatorToken.kind)) {\n return true;\n }\n if ((parent.kind === SyntaxKind.PrefixUnaryExpression || parent.kind === SyntaxKind.PostfixUnaryExpression)\n && (parent.operator === SyntaxKind.PlusPlusToken || parent.operator === SyntaxKind.MinusMinusToken)) {\n return true;\n }\n if (parent.kind === SyntaxKind.ArrayLiteralExpression || parent.kind === SyntaxKind.PropertyAccessExpression) {\n const grand: any = parent.parent;\n return grand?.kind === SyntaxKind.BinaryExpression && grand.left === parent && this.csharpIsAssignmentOperator(grand.operatorToken.kind);\n }\n return false;\n }\n\n // the node is the left side of `=` or `+=`\n csharpIsSetOrAddTarget(node): boolean {\n const parent: any = node.parent;\n return parent?.kind === SyntaxKind.BinaryExpression\n && (parent.operatorToken.kind === SyntaxKind.EqualsToken || parent.operatorToken.kind === SyntaxKind.PlusEqualsToken)\n && parent.left === node;\n }\n\n csharpIsAssignmentOperator(kind): boolean {\n return (kind >= SyntaxKind.FirstAssignment) && (kind <= SyntaxKind.LastAssignment);\n }\n\n // S22: an index WRITE (`x[\"k\"] = v`) needs no `((IDictionary)x)` cast when the\n // receiver's printed C# declaration already IS a dictionary. The ccxt classifier\n // (build/csharp-local-types.js) installs this predicate; undefined/false keeps the upstream cast.\n csharpDictionaryIndexWriteNeedsNoCast(node): boolean | undefined {\n return undefined;\n }\n // the consumer's classifier may prove the declared C# type of an element-access receiver\n // (`Dictionary` / `IDictionary`); consumer-installed, so an\n // answer of undefined keeps the untyped emission byte-identical\n csharpElementAccessTypedReceiver(node): string | undefined {\n return undefined;\n }\n\n // `recv[key]` read with a consumer-proven string-keyed dict receiver and a literal key: the typed\n // twin GetValue(IDictionary, string) runs the same dictionary read as the object\n // overload's dict branch without its runtime sniffing. Every other read keeps the wrapper.\n printTypedDictElementAccessIfAny(node) {\n if (this.csharpElementAccessTypedReceiver(node) === undefined) {\n return undefined;\n }\n const { expression, argumentExpression } = node;\n if (!isStringLiteralLikeNode(argumentExpression)) {\n return undefined; // the twin's key parameter is `string`; any other key keeps the object overload\n }\n if (this.csharpIsSetOrAddTarget(node)) {\n return undefined; // a write prints the dictionary element assignment, not this read\n }\n return 'GetValue(' + this.printNode(expression, 0) + ', ' + this.printNode(argumentExpression, 0) + ')';\n }\n\n printWrappedUnknownThisProperty(node) {\n const type = this.getChecker().getResolvedSignature(node);\n if (type?.declaration === undefined) {\n let parsedArguments = node.arguments?.map((a) => this.printNode(a, 0)).join(\", \");\n parsedArguments = parsedArguments ? parsedArguments : \"\";\n const propName = node.expression?.name.text;\n const nativeDelegateCall = this.csharpNativeDelegateCall(node, propName);\n if (nativeDelegateCall !== undefined) {\n return nativeDelegateCall;\n }\n // const isAsyncDecl = true;\n const isAsyncDecl = node?.parent?.kind === SyntaxKind.AwaitExpression;\n // const open = isAsyncDecl ? this.UKNOWN_PROP_ASYNC_WRAPPER_OPEN : this.UKNOWN_PROP_WRAPPER_OPEN;\n // const close = this.UNKOWN_PROP_WRAPPER_CLOSE;\n // return `${open}\"${propName}\"${parsedArguments}${close}`;\n const argsArray = `new object[] { ${parsedArguments} }`;\n const open = this.DYNAMIC_CALL_OPEN;\n let statement = `${open}this, \"${propName}\", ${argsArray})`;\n statement = isAsyncDecl ? `((Task)${statement})` : statement;\n return statement;\n }\n return undefined;\n }\n\n // A `this.(...)` call the checker cannot resolve on a function-valued property is a\n // delegate in the hand-written C# base, which `ResolveMethod` never finds (the helper throws\n // there); matching arity prints the same property invocation directly.\n csharpNativeDelegateCall(node, propName): string | undefined {\n const arity = CSHARP_NATIVE_THIS_DELEGATE_ARITY[propName as string];\n if (arity === undefined) {\n return undefined;\n }\n if (node?.parent?.kind === SyntaxKind.AwaitExpression) {\n return undefined; // the delegate returns object, not a Task\n }\n const args = node.arguments ?? [];\n if (args.length !== arity) {\n return undefined;\n }\n return `this.${propName as string}(${args.map((a) => this.printNode(a, 0)).join(\", \")})`;\n }\n\n printOutOfOrderCallExpressionIfAny(node, identation) {\n if (node.expression.kind === SyntaxKind.PropertyAccessExpression) {\n const expressionText = node.expression.getText().trim();\n const args = node.arguments;\n if (args.length === 1) {\n const parsedArg = this.printNode(args[0], 0);\n switch (expressionText) {\n // case \"JSON.parse\":\n // return `json_decode(${parsedArg}, $as_associative_array = true)`;\n case \"Math.abs\":\n return `Math.Abs(Convert.ToDouble(${parsedArg}))`;\n }\n } else if (args.length === 2)\n {\n const parsedArg1 = this.printNode(args[0], 0);\n const parsedArg2 = this.printNode(args[1], 0);\n switch (expressionText) {\n case \"Math.min\":\n return this.csharpNativeMathMinMax(node, 'Min', parsedArg1, parsedArg2) ?? `mathMin(${parsedArg1}, ${parsedArg2})`;\n case \"Math.max\":\n return this.csharpNativeMathMinMax(node, 'Max', parsedArg1, parsedArg2) ?? `mathMax(${parsedArg1}, ${parsedArg2})`;\n case \"Math.pow\":\n return `Math.Pow(Convert.ToDouble(${parsedArg1}), Convert.ToDouble(${parsedArg2}))`;\n }\n }\n const leftSide = node.expression?.expression;\n const leftSideText = leftSide ? this.printNode(leftSide, 0) : undefined;\n\n // wrap unknown property this.X calls\n if (leftSideText === this.THIS_TOKEN || leftSide.getFullText().indexOf(\"(this as any)\") > -1) { // double check this\n const res = this.printWrappedUnknownThisProperty(node);\n if (res) {\n return res;\n }\n }\n }\n\n // // replace this[method]() calls\n // const thisElementAccess = this.printThisElementAccesssIfNeeded(node, identation);\n // if (thisElementAccess) {\n // return thisElementAccess;\n // }\n\n // handle dynamic calls, this[method](A) or exchange[b] (c) using reflection\n if (node.expression.kind === SyntaxKind.ElementAccessExpression) {\n return this.printDynamicCall(node, identation);\n }\n\n\n return undefined;\n }\n\n handleTypeOfInsideBinaryExpression(node, identation) {\n const left = node.left;\n const right = node.right.text;\n const op = node.operatorToken.kind;\n const expression = left.expression;\n\n const isDifferentOperator = op === SyntaxKind.ExclamationEqualsEqualsToken || op === SyntaxKind.ExclamationEqualsToken;\n const notOperator = isDifferentOperator ? this.NOT_TOKEN : \"\";\n\n const target = this.printNode(expression, 0);\n switch (right) {\n case \"string\":\n return notOperator + `(${target} is string)`;\n case \"number\":\n return notOperator + `(${target} is Int64 || ${target} is int || ${target} is float || ${target} is double)`;\n case \"boolean\":\n return notOperator + `(${target} is bool)`;\n case \"object\":\n return notOperator + `(${target} is IDictionary)`;\n case \"function\":\n return notOperator + `(${target} is Delegate)`;\n }\n\n return undefined;\n\n }\n\n // The C# type of an operand of `==` / `!=` as the printer emits it, or undefined when\n // the printer only knows `object`: an `object` operand takes the reference-comparing\n // `operator ==`, so those keep the isEqual helper.\n csharpEqualityOperandType(node): string | undefined {\n if (node === undefined) {\n return undefined;\n }\n switch (node.kind) {\n case SyntaxKind.NullKeyword:\n return 'null';\n case SyntaxKind.TrueKeyword:\n case SyntaxKind.FalseKeyword:\n return 'bool';\n case SyntaxKind.NumericLiteral:\n return this.csharpNumericLiteralKind(node);\n case SyntaxKind.ParenthesizedExpression:\n return this.csharpEqualityOperandType(node.expression);\n case SyntaxKind.Identifier:\n // printIdentifier prints the `undefined` identifier as null\n if (node.text === 'undefined') {\n return 'null';\n }\n return this.csharpDeclaredTypeOfBinding(node) ?? this.csharpParameterOperandType(node);\n case SyntaxKind.PropertyAccessExpression: {\n const fieldType = this.csharpReferenceFieldType(node);\n return (fieldType === undefined) ? this.csharpTypeOfInitializer(node) : fieldType;\n }\n }\n if (isStringLiteralLikeNode(node)) {\n return 'string';\n }\n return this.csharpTypeOfInitializer(node);\n }\n\n // 'object' for a `this.` read of a hand-written field the table proves a reference box;\n // undefined otherwise. Only printInlineEquality's null branch accepts 'object', so the exact\n // field type is never claimed and the value-equality branches keep the helper.\n csharpReferenceFieldType(node): string | undefined {\n if (!isPropertyAccessExpression(node) || (node.expression?.kind !== SyntaxKind.ThisKeyword)) {\n return undefined;\n }\n const name = node.name?.text as string;\n if (CSHARP_REFERENCE_FIELDS_NATIVE.indexOf(name) < 0) {\n return undefined;\n }\n return this.csharpOperandIsValueTyped(node) ? undefined : 'object';\n }\n\n // the declaration behind an identifier read that is a plain method parameter; a\n // destructured or rest parameter prints a different declaration shape\n csharpParameterDeclaration(node): ParameterDeclaration | undefined {\n const declaration: any = (this.checkerOrUndefined() as any)?.getSymbolAtLocation(node)?.valueDeclaration?.resolve();\n if ((declaration === undefined) || !isParameterDeclaration(declaration)) {\n return undefined;\n }\n if (!isIdentifier(declaration.name) || (declaration.name.text !== node.text) || (declaration.dotDotDotToken !== undefined)) {\n return undefined;\n }\n return declaration;\n }\n\n // `object` for a parameter operand a null comparison compiles on, else undefined. An optional\n // parameter prints `object` / `string` / `Int64?` / `double?` / `bool?`; any other keeps the\n // helper unless its checker type holds no number/boolean member (a reference box).\n csharpParameterOperandType(node): string | undefined {\n const declaration = this.csharpParameterDeclaration(node);\n if (declaration === undefined) {\n return undefined;\n }\n if (this.csharpDeclarationPrintsNullComparable(declaration)) {\n return 'object'; // reference box or nullable value: only the null branch may use it\n }\n return this.csharpOperandIsValueTyped(node) ? undefined : 'object';\n }\n\n // Whether this parameter's printed C# type is a reference or nullable value, so `x == null`\n // compiles and is isEqual's null branch. optionalScalarCsharpType gives a nullable scalar only\n // when optional with no initializer or `= undefined`; required or real-default ones are non-null.\n csharpDeclarationPrintsNullComparable(declaration): boolean {\n const initializer = declaration.initializer;\n const optional = (declaration.questionToken !== undefined) || (initializer !== undefined);\n if (optional && ((initializer === undefined) || ((initializer.kind === SyntaxKind.Identifier) && (initializer.text === 'undefined')))) {\n return true;\n }\n return !this.csharpDeclarationHasValueScalar(declaration);\n }\n\n csharpDeclarationHasValueScalar(declaration): boolean {\n const checker: any = this.checkerOrUndefined();\n if (checker === undefined) {\n return true; // unknown: keep the helper\n }\n return this.csharpTypeHasValueScalar(checker.getTypeAtLocation(declaration));\n }\n\n // A numeric literal prints as an untyped C# constant that adapts to the operand on the\n // other side. isEqual's integer branches round-trip through Convert.ToInt64, which an\n // integer literal beyond 2^53 does not survive, so those stay on the helper.\n csharpNumericLiteralKind(node): string | undefined {\n const value = Number(node.text);\n if (!Number.isFinite(value) || (Number.isInteger(value) && !Number.isSafeInteger(value))) {\n return undefined;\n }\n return 'number';\n }\n\n // the C# type the declaration behind an identifier was printed with ('object' when the\n // printer named none), or undefined when the identifier is not a printed local\n csharpDeclaredTypeOfBinding(node): string | undefined {\n const declaration: any = (this.checkerOrUndefined() as any)?.getSymbolAtLocation(node)?.valueDeclaration?.resolve();\n if (declaration?.kind === SyntaxKind.VariableDeclaration) {\n return this.getCSharpLocalType(declaration);\n }\n if (declaration?.kind === SyntaxKind.BindingElement) {\n return 'var'; // `const [a, b] = ...` prints `var a = ((IList)...)[0]`\n }\n return undefined; // parameters are retyped after printing by the build script\n }\n\n // the C# operator family an operand belongs to: `==` compares two operands of one family\n // by value, exactly like the isEqual branches those types take\n csharpValueEqualityKind(csharpType): string | undefined {\n switch (csharpType) {\n case 'string':\n case 'string?':\n return 'string';\n case 'bool':\n case 'bool?':\n return 'bool';\n case 'double':\n case 'double?':\n return 'double';\n case 'Int64':\n case 'long':\n case 'Int64?':\n case 'long?':\n return 'Int64';\n case 'int':\n case 'int?':\n return 'int';\n case 'number':\n return 'number'; // numeric literal, adapts to the numeric operand it is compared with\n }\n return undefined;\n }\n\n // `x == null` compiles — and matches isEqual — for reference types and nullable value\n // types, but not for a non-nullable value type (double / bool / Int64 / int). Lists,\n // dictionaries, class instances and `var` are references, and are the only types left\n // once csharpValueEqualityKind has claimed the value-typed names above.\n csharpIsNullComparableType(csharpType): boolean {\n if ((csharpType === undefined) || (csharpType === '') || (csharpType === 'null')) {\n return false;\n }\n if (csharpType.endsWith('?')) {\n return true;\n }\n if ((csharpType === 'object') || (csharpType === 'string')) {\n return true;\n }\n return (this.csharpValueEqualityKind(csharpType) === undefined);\n }\n\n // `x == null` compiles and matches isEqual's null branch when x's printed type is a\n // reference box or a nullable value type: the operand table's declared types, an optional\n // parameter, or a box the checker proves holds no number/boolean scalar.\n csharpOperandIsNullComparable(node): boolean {\n const declaration = this.csharpParameterDeclaration(node);\n if ((declaration !== undefined) && this.csharpDeclarationPrintsNullComparable(declaration)) {\n return true;\n }\n return !this.csharpOperandIsValueTyped(node);\n }\n\n // U55: the null-comparison rule's gate, stricter than csharpIsNullComparableType above:\n // only a type the hook names (the emitted declaration's own text) is accepted, `object` /\n // `var` included in the refusal because those are the boxes the classifier did not name.\n csharpNullComparisonTypeIsProvable(csharpType): boolean {\n if ((csharpType === undefined) || (csharpType === '') || (csharpType === 'object') || (csharpType === 'var') || (csharpType === 'null')) {\n return false;\n }\n if (csharpType.endsWith('?')) {\n return true;\n }\n return CSHARP_NULL_COMPARISON_REFERENCE_HEADS.some((head) => csharpType.startsWith(head));\n }\n\n // TypeScript numbers and booleans are C# value types in this port (double / bool /\n // Int64 / int), and the ccxt build script retypes some `object` declarations to exactly\n // those from its own tables (precisionFromString -> int, milliseconds -> Int64,\n // isEmpty -> bool). A null comparison against one of them would not compile, and the\n // printer's `object` cannot rule it out, so these always keep the helper.\n csharpOperandIsValueTyped(node): boolean {\n if (node === undefined) {\n return true;\n }\n const checker: any = this.checkerOrUndefined();\n if (checker === undefined) {\n return true;\n }\n const type = checker.getTypeAtLocation(node);\n return this.csharpTypeHasValueScalar(type);\n }\n\n csharpTypeHasValueScalar(type): boolean {\n if (type === undefined) {\n return true;\n }\n const flags = type.flags;\n if (flags & TypeFlags.Union) {\n const members = type.getTypes?.() ?? [];\n return members.some((member) => this.csharpTypeHasValueScalar(member));\n }\n return (flags & (TypeFlags.Number | TypeFlags.NumberLiteral | TypeFlags.Boolean | TypeFlags.BooleanLiteral)) !== 0;\n }\n\n // `x == \"lit\"` / `x != \"lit\"` prints natively when x is a read of a local whose printed\n // declaration is a C# string: the printer's declared-local table, then the embedding build\n // layer's proof for the declarations it retypes itself (ccxt's csharp-local-types.js).\n csharpDeclaredStringLiteralComparison(left, right, leftText: string, rightText: string, isEquality: boolean): string | undefined {\n const ident = isIdentifier(left) ? left : (isIdentifier(right) ? right : undefined);\n if ((ident === undefined) || !isStringLiteralLikeNode((ident === left) ? right : left)) {\n return undefined;\n }\n const declared = this.csharpDeclaredReadType(ident);\n if ((declared === undefined) || !this.csharpTypeIsStringType(declared)) {\n return undefined;\n }\n return isEquality ? `(${leftText} == ${rightText})` : `(${leftText} != ${rightText})`;\n }\n\n // the C# type the declaration behind a local read was printed with, or undefined: the\n // printer's own declared-local table first, then the embedding build layer's answer for a\n // declaration it retyped after the printer had left it `object`\n csharpDeclaredReadType(node): string | undefined {\n let named;\n try {\n named = this.csharpTypedLocalType(node);\n } catch (e) {\n named = undefined;\n }\n return (named !== undefined) ? named : this.csharpResolvedReadType(node);\n }\n\n // the embedding build layer's string answer for a read, or undefined (no resolver, it threw)\n csharpResolvedReadType(node): string | undefined {\n const resolver = this.csharpExpressionTypeResolver;\n if (typeof resolver !== 'function') {\n return undefined;\n }\n let resolved;\n try {\n resolved = resolver(node);\n } catch (e) {\n return undefined;\n }\n return (typeof resolved === 'string') ? resolved : undefined;\n }\n\n // the declared type of an identifier read, including this printer's own local table\n csharpDeclaredLocalType(node): string | undefined {\n const provided = this.csharpExpressionTypeResolver ? this.csharpExpressionTypeResolver(node) : undefined;\n if (provided !== undefined) {\n return provided;\n }\n const declaration = this.getChecker().getSymbolAtLocation(node)?.valueDeclaration?.resolve();\n if (declaration === undefined || !isVariableDeclaration(declaration) || declaration.name?.kind !== SyntaxKind.Identifier) {\n return undefined;\n }\n if (!this.csharpLocalTypes.has(declaration)) {\n this.csharpLocalTypes.set(declaration, this.getCSharpLocalType(declaration));\n }\n const type = this.csharpLocalTypes.get(declaration);\n return (type === undefined || type === this.VAR_TOKEN) ? undefined : type;\n }\n\n // `a === b` / `a !== b` between two plain reads: a local or parameter prints as a bare\n // name and both operands are read once by the printed expression\n csharpOperandsAreDeclaredReads(left, right): boolean {\n const isRead = (node) => (node?.kind === SyntaxKind.Identifier) && (node.text !== 'undefined');\n return isRead(left) && isRead(right);\n }\n\n // the C# type the embedding build layer declares for a read the printer can only call\n // `object`: that layer retypes the declaration so its recorded type IS the printed one\n csharpDeclaredReadEqualityType(node, printerType: string | undefined): string | undefined {\n if ((printerType !== undefined) && (printerType !== this.VAR_TOKEN) && (printerType !== 'var')) {\n return printerType;\n }\n return this.csharpResolvedReadType(node) ?? printerType;\n }\n\n // `==` / `!=` in place of the isEqual wrapper when both operands are C# values of one\n // family, or one side is null/undefined against a type `== null` compiles for. Both\n // operands are printed once, so neither is evaluated twice.\n printInlineEquality(left, right, leftText: string, rightText: string, isEquality: boolean): string | undefined {\n const stringComparison = this.csharpDeclaredStringLiteralComparison(left, right, leftText, rightText, isEquality);\n if (stringComparison !== undefined) {\n return stringComparison;\n }\n let leftType = this.csharpEqualityOperandType(left);\n let rightType = this.csharpEqualityOperandType(right);\n if (this.csharpOperandsAreDeclaredReads(left, right)) {\n leftType = this.csharpDeclaredReadEqualityType(left, leftType);\n rightType = this.csharpDeclaredReadEqualityType(right, rightType);\n }\n // D-21: an operand the printer could not name (or only named `object`) is not a\n // rejection by itself -- the value branch below re-reads its DECLARED scalar type\n if ((leftType === 'null') || (rightType === 'null')) {\n const [other, otherType, otherText] = (leftType === 'null') ? [right, rightType, rightText] : [left, leftType, leftText];\n if (!this.csharpIsNullComparableType(otherType) || !this.csharpOperandIsNullComparable(other)) {\n return undefined;\n }\n return this.csharpNullComparison(otherText, isEquality);\n }\n // D-21: a read the printer's own tables could only call `object` still has the C# type\n // its emitted DECLARATION carries -- a parameter the build layer's typing pass narrowed,\n // a local retyped to the type of a typed return. The declared-read arm below names it.\n const leftKind = this.csharpValueEqualityKind(leftType);\n const rightKind = this.csharpValueEqualityKind(rightType);\n const leftReadKind = (leftKind !== undefined) ? leftKind : this.csharpDeclaredReadEqualityKind(left, leftType);\n const rightReadKind = (rightKind !== undefined) ? rightKind : this.csharpDeclaredReadEqualityKind(right, rightType);\n if ((leftReadKind === undefined) || (rightReadKind === undefined)) {\n return undefined;\n }\n // mixed numeric kinds are not equal in isEqual: `int` vs `double` takes the\n // `(int)a == (int)b` branch and throws on the boxed double, so only a numeric\n // literal may meet a different numeric type\n const numericKinds = [ 'double', 'Int64', 'int' ];\n const sameKind = (leftReadKind === rightReadKind);\n const literalVsNumeric = ((leftReadKind === 'number') && (numericKinds.indexOf(rightReadKind) >= 0))\n || ((rightReadKind === 'number') && (numericKinds.indexOf(leftReadKind) >= 0));\n if (!sameKind && !literalVsNumeric) {\n return undefined;\n }\n return isEquality ? `(${leftText} == ${rightText})` : `(${leftText} != ${rightText})`;\n }\n\n // the value kind of an operand the printer could only call `object`: the type the read's\n // declaration was PRINTED with (printer table -> build layer's read-type oracle -> the\n // declared-type registry for the declarations its own passes retyped). A collection/class\n csharpDeclaredReadEqualityKind(node, operandType: string | undefined): string | undefined {\n if ((operandType !== undefined) && (operandType !== '') && (operandType !== 'object')) {\n return undefined; // the printer named a non-value C# type: never a value comparison\n }\n if ((node?.kind !== SyntaxKind.Identifier) || (node.text === 'undefined')) {\n return undefined; // parameters of a written body / accesses / calls are other units\n }\n const declared = this.csharpDeclaredReadType(node) ?? this.csharpDeclaredLocalResolverType(node);\n return (declared === undefined) ? undefined : this.csharpValueEqualityKind(declared);\n }\n\n csharpNullComparison(text: string, isEquality: boolean) {\n return isEquality ? `(${text} == null)` : `(${text} != null)`;\n }\n\n // `isEqual(, N)` / `isEqual(N, )` -> `==` / `!=`: the call prints a\n // concrete numeric kind, the literal adapts to it, and the operator matches isEqual's integer and\n // double branches. String/bool/collection calls and every `object` box keep the helper.\n csharpNativeNumericCallEquality(left, right, leftText: string, rightText: string, isEquality: boolean): string | undefined {\n const leftKind = this.csharpNumericCallKind(left);\n const rightKind = this.csharpNumericCallKind(right);\n const leftLiteral = (leftKind === undefined) ? this.csharpIntegerLiteralKind(left) : undefined;\n const rightLiteral = (rightKind === undefined) ? this.csharpIntegerLiteralKind(right) : undefined;\n const callOnLeft = (leftKind !== undefined) && (rightLiteral !== undefined) && this.csharpNumericKindHoldsLiteral(leftKind, rightLiteral);\n const callOnRight = (rightKind !== undefined) && (leftLiteral !== undefined) && this.csharpNumericKindHoldsLiteral(rightKind, leftLiteral);\n if (!callOnLeft && !callOnRight) {\n return undefined;\n }\n // both operands are printed once: the call is not duplicated\n return isEquality ? `(${leftText} == ${rightText})` : `(${leftText} != ${rightText})`;\n }\n\n // The C# value kind of a call operand (or `x.length`) when its printed signature is numeric:\n // `.indexOf`/`.length` (int) and safe* accessors from the printer's tables, `this.()` from\n // CSHARP_NATIVE_NUMERIC_THIS_KINDS. undefined keeps the helper (an `object` box has no kind).\n csharpNumericCallKind(node): string | undefined {\n const expression = node?.expression;\n if ((node?.kind === SyntaxKind.CallExpression)\n && (expression?.kind === SyntaxKind.PropertyAccessExpression)\n && (expression.expression?.kind === SyntaxKind.ThisKeyword)) {\n const named = CSHARP_NATIVE_NUMERIC_THIS_KINDS[expression.name?.text as string];\n // an unresolvable callee prints callDynamically(this, ...), which returns object\n if ((named !== undefined) && this.csharpCalleeResolves(node)) {\n return named;\n }\n }\n const named = this.csharpCallReturnType(node);\n return ((named === undefined) || (CSHARP_NUMERIC_VALUE_KINDS.indexOf(named) < 0)) ? undefined : named;\n }\n\n // The C# kind of an integer literal operand (`N` / `-N`), or undefined when the text is not an\n // integer the literal holds exactly. isEqual round-trips through Convert.ToInt64 and truncates\n // via `(int)a == (int)b`, so only a safe integer literal keeps both comparisons identical.\n csharpIntegerLiteralKind(node): string | undefined {\n let value;\n if (node?.kind === SyntaxKind.PrefixUnaryExpression) {\n if ((node.operator !== SyntaxKind.MinusToken) || (node.operand?.kind !== SyntaxKind.NumericLiteral)) {\n return undefined;\n }\n value = -Number(node.operand.text);\n } else if (node?.kind === SyntaxKind.NumericLiteral) {\n value = Number(node.text);\n } else {\n return undefined;\n }\n if (!Number.isSafeInteger(value)) {\n return undefined;\n }\n return ((value >= -2147483648) && (value <= 2147483647)) ? 'int' : 'long';\n }\n\n // a `long` literal has no implicit conversion to an `int` operand; every other pair\n // converts the literal exactly, which is what isEqual's Convert.ToInt64 /\n // Convert.ToDouble branches do with the same two boxes\n csharpNumericKindHoldsLiteral(callKind: string, literalKind: string): boolean {\n if (callKind === 'int') {\n return literalKind === 'int';\n }\n return (callKind.indexOf('Int64') === 0) || (callKind.indexOf('double') === 0);\n }\n\n // the concrete C# type of an expression the printer can name, or undefined: the embedding\n // build layer's proof wins (it retypes locals the printer leaves `object`), then the\n // printer's own tables and the literals whose C# type is fixed by their text\n csharpExpressionTypeOf(node): string | undefined {\n const provided = this.csharpExpressionTypeResolver ? this.csharpExpressionTypeResolver(node) : undefined;\n if (provided !== undefined) {\n return provided;\n }\n if (isNumericLiteral(node)) {\n const value = Number(node.text);\n // wider literals are typed uint/long/ulong by the C# compiler, keep the helper\n return (Number.isInteger(value) && Math.abs(value) <= 2147483647) ? 'int' : undefined;\n }\n if (isPrefixUnaryExpression(node) && (node.operator === SyntaxKind.MinusToken) && isNumericLiteral(node.operand)) {\n const value = Number(node.operand.text);\n return (Number.isInteger(value) && (value <= 2147483647)) ? 'int' : undefined;\n }\n return this.csharpTypeOfInitializer(node);\n }\n\n csharpOperandIsPlainNumber(operand): boolean {\n const checker: any = this.checkerOrUndefined();\n if (checker === undefined) {\n return false; // in-memory program without a checker\n }\n const flags = checker.getTypeAtLocation(operand)?.flags;\n return (flags === TypeFlags.Number) || (flags === TypeFlags.NumberLiteral);\n }\n\n // `<`, `>`, `<=`, `>=` on two operands whose printed C# kind this printer can name (declaration,\n // literal, known call signature — never the JS type) print natively: the helper applies the same\n // conversions as the C# operator; an int/Int64 pair compares the same. See CSHARP_NUMERIC_KINDS.\n csharpNativeNumericComparison(node, identation): string | undefined {\n const token = CSHARP_NATIVE_COMPARISON_TOKENS[node.operatorToken.kind];\n if (token === undefined) {\n return undefined;\n }\n const leftKind = this.csharpExpressionTypeOf(node.left);\n const rightKind = this.csharpExpressionTypeOf(node.right);\n if ((leftKind === undefined) || (rightKind === undefined)) {\n return undefined;\n }\n const integerPair = (CSHARP_INTEGER_KINDS.indexOf(leftKind) >= 0) && (CSHARP_INTEGER_KINDS.indexOf(rightKind) >= 0);\n if (!integerPair && ((leftKind !== rightKind) || (CSHARP_NUMERIC_KINDS.indexOf(leftKind) < 0))) {\n return undefined;\n }\n if ((leftKind === 'double') && ((token === '<') || (token === '<='))) {\n return undefined;\n }\n const leftText = this.printNode(node.left, 0).trim();\n const rightText = this.printNode(node.right, 0).trim();\n return leftText + ' ' + token + ' ' + rightText;\n }\n\n // `Math.min/max (a, b)`: mathMin/mathMax read both boxes via Convert.ToDouble, return an ORIGINAL\n // one (null if either is null); Math.Min/Max returns one numeric kind. Native only when both are\n // declared integers of the same kind and the checker sees two plain numbers; else keep the helper.\n csharpNativeMathMinMax(node, name: string, parsedArg1: string, parsedArg2: string): string | undefined {\n const args = node.arguments;\n if ((args?.length !== 2) || !this.csharpMinMaxResultIsPlainValue(node)) {\n return undefined;\n }\n const leftKind = this.csharpExpressionTypeOf(args[0]);\n if ((leftKind === undefined) || (leftKind !== this.csharpExpressionTypeOf(args[1])) || (CSHARP_MINMAX_NATIVE_KINDS.indexOf(leftKind) < 0)) {\n return undefined;\n }\n if (!this.csharpOperandIsPlainNumber(args[0]) || !this.csharpOperandIsPlainNumber(args[1])) {\n return undefined;\n }\n return 'Math.' + name + '(' + parsedArg1 + ', ' + parsedArg2 + ')';\n }\n\n // the positions that take the primitive as the helper's box: assignment, argument,\n // dictionary/list value, return and ternary arm all box an int the same way. A receiver, an\n // `as`/`!` wrapper and the printer's hard `(string)` casts (throw / `delete`) do not.\n csharpMinMaxResultIsPlainValue(node): boolean {\n if (this.csharpIsClassThrowArgument(node) || this.csharpIsDeleteKey(node)) {\n return false;\n }\n let parent = node.parent;\n while (parent !== undefined && isParenthesizedExpression(parent)) {\n parent = parent.parent;\n }\n if (parent === undefined) {\n return false;\n }\n if ((isPropertyAccessExpression(parent) || isElementAccessExpression(parent) || isCallExpression(parent)) && parent.expression === node) {\n return false;\n }\n return (parent.kind !== SyntaxKind.AsExpression) && (parent.kind !== SyntaxKind.TypeAssertionExpression) && (parent.kind !== SyntaxKind.NonNullExpression);\n }\n\n // `parseInt(...)` / `parseFloat(...)` print the runtime helper call; the folds below replace\n // it with the exact box the helper returns, everything else falls through to the printer\n printCallExpression(node, identation) {\n const nativeParse = this.csharpNativeParseCall(node);\n if (nativeParse !== undefined) {\n return nativeParse;\n }\n return super.printCallExpression(node, identation);\n }\n\n csharpNativeParseCall(node) {\n if (node?.kind !== SyntaxKind.CallExpression || !isIdentifier(node.expression)) {\n return undefined;\n }\n const callee = node.expression.text as string;\n if ((callee !== 'parseInt') && (callee !== 'parseFloat')) {\n return undefined;\n }\n const args = node.arguments;\n if (args === undefined || args.length !== 1) {\n return undefined;\n }\n if (!this.csharpCalleeIsGlobalFunction(node.expression)) {\n return undefined; // a locally declared function of the same name is not the helper\n }\n const literal = (callee === 'parseInt') ? csharpParseIntLiteralArgument(args[0]) : csharpParseFloatLiteralArgument(args[0]);\n if (literal !== undefined) {\n return literal;\n }\n return this.csharpNativeParseCallOnDeclaredLocal(callee, args[0]);\n }\n\n // the global `parseInt` / `parseFloat` live in the TS lib chain; a declaration anywhere else\n // means the call prints a different function than the runtime helper\n csharpCalleeIsGlobalFunction(node): boolean {\n const checker: any = this.checkerOrUndefined();\n if (checker === undefined) {\n return true; // in-memory program without a checker: the name is all there is\n }\n const declarations = (checker.getSymbolAtLocation(node)?.declarations ?? []).map((d) => d.resolve());\n return declarations.every((declaration) => declaration.getSourceFile().fileName.indexOf('typescript') > -1);\n }\n\n // `parseFloat(x)` / `parseInt(x)` on a local declared numeric: Convert.ToDouble is an identity for\n // `double` and a widening for integer kinds. An Int64 parseInt operand (rounded above 2^53), a\n // double one (NaN/overflow -> null) and nullable or `object` locals (null -> 0) keep the helper.\n csharpNativeParseCallOnDeclaredLocal(callee, arg) {\n if (arg?.kind !== SyntaxKind.Identifier) {\n return undefined;\n }\n const kind = this.csharpExpressionTypeOf(arg);\n if (CSHARP_NUMERIC_KINDS.indexOf(kind) < 0) {\n return undefined;\n }\n const text = this.printNode(arg, 0);\n if (callee === 'parseFloat') {\n return (kind === 'double') ? text : `((double)${text})`;\n }\n return (kind === 'int') ? `((Int64)${text})` : undefined;\n }\n\n // `multiply(N, M)` over two unsigned numeric literals: two integers box the Int64 product\n // (`NL * ML`, the same value while it is a safe integer); otherwise the helper multiplies the\n // doubles and re-boxes an integral product as Int64, so only a fractional product goes native.\n csharpNativeLiteralProduct(left, right): string | undefined {\n if (!isNumericLiteral(left) || !isNumericLiteral(right)) {\n return undefined;\n }\n const leftText = left.text;\n const rightText = right.text;\n if (/^\\d+$/.test(leftText) && /^\\d+$/.test(rightText)) {\n const product = Number(leftText) * Number(rightText);\n return Number.isSafeInteger(product) ? `(${leftText}L * ${rightText}L)` : undefined;\n }\n const decimal = /^\\d+(\\.\\d+)?$/;\n // IsInteger reads the product through Convert.ToDecimal, i.e. rounded to 15 significant digits\n const rounded = Number((Number(leftText) * Number(rightText)).toPrecision(15));\n if (!decimal.test(leftText) || !decimal.test(rightText) || Number.isInteger(rounded)) {\n return undefined;\n }\n return `(${leftText} * ${rightText})`;\n }\n\n // `a % b` prints `mod(a, b)`: the helper takes the double remainder and converts back to Int64. An\n // Int32 dividend with a nonzero integer literal divisor is exact as double, so the native Int64\n // remainder matches. Int64 dividends (rounded above 2^53) and possibly-zero divisors keep helper.\n csharpNativeModExpression(left, right, leftText) {\n if (left?.kind !== SyntaxKind.Identifier) {\n return undefined;\n }\n if (this.csharpExpressionTypeOf(left) !== 'int') {\n return undefined;\n }\n const divisor = csharpLiteralNumericValue(right);\n if ((divisor === undefined) || !Number.isSafeInteger(divisor) || (divisor === 0)) {\n return undefined;\n }\n return `((Int64)${leftText} % ${divisor}L)`;\n }\n\n // `-x` prints `prefixUnaryNeg(ref x)`, whose typed overloads negate in place and return the same\n // box (`a = -a; return a;`): a local declared int / Int64 / double binds one, so the assignment is\n // the identical emission. Every other operand keeps the helper's runtime dispatch and null answer.\n csharpNativeNegatedLocal(operand, leftSide) {\n if (operand?.kind !== SyntaxKind.Identifier) {\n return undefined;\n }\n if (CSHARP_NUMERIC_KINDS.indexOf(this.csharpExpressionTypeOf(operand)) < 0) {\n return undefined;\n }\n return `(${leftSide} = -${leftSide})`;\n }\n\n // The printed receiver whose C# static type is a known collection: a local this printer declared\n // with a concrete type (csharpTypedLocals), or a hand-written BaseExchange field. undefined keeps\n // the runtime helper, since the printer cannot name the operand's type.\n csharpNativeReceiver(node): { text: string, type: string } | undefined {\n if (node?.kind === SyntaxKind.ParenthesizedExpression) {\n const inner = this.csharpNativeReceiver(node.expression);\n return inner === undefined ? undefined : { text: `(${inner.text})`, type: inner.type };\n }\n if (isIdentifier(node)) {\n const named = this.csharpTypedLocalType(node);\n return (named === undefined || CSHARP_NATIVE_COLLECTION_TYPES.indexOf(named) < 0) ? undefined : { text: this.printNode(node, 0), type: named };\n }\n if (isPropertyAccessExpression(node) && node.expression?.kind === SyntaxKind.ThisKeyword) {\n const name = node.name?.text as string;\n if (CSHARP_OBJECT_DICT_FIELDS.indexOf(name) >= 0) {\n // the field is declared `object`; its box is always a dictionary\n return { text: `((IDictionary)${this.printNode(node, 0)})`, type: 'IDictionary' };\n }\n return CSHARP_NATIVE_FIELDS[name] === undefined ? undefined : { text: this.printNode(node, 0), type: CSHARP_NATIVE_FIELDS[name] };\n }\n // a call whose printed C# type this printer already names (Object.keys, this.indexBy,\n // x.split, ...) is a collection too\n const callType = this.csharpCallReturnType(node);\n if (callType !== undefined && CSHARP_NATIVE_COLLECTION_TYPES.indexOf(callType) >= 0) {\n const printed = this.printNode(node, 0);\n return { text: printed.startsWith('new ') ? `(${printed})` : printed, type: callType };\n }\n return undefined;\n }\n\n // the C# types this printer can name on a local whose members replace the helpers:\n // the collection types (Count/ContainsKey) and string (Length/ContainsKey keys)\n csharpTypeIsNative(csharpType: string): boolean {\n return CSHARP_NATIVE_COLLECTION_TYPES.indexOf(csharpType) >= 0 || csharpType.indexOf('string') === 0;\n }\n\n // the C# type this printer declared for a local read, or undefined\n csharpTypedLocalType(node): string | undefined {\n const declaration = this.getChecker().getSymbolAtLocation(node)?.valueDeclaration?.resolve();\n return declaration === undefined ? undefined : this.csharpTypedLocals.get(declaration);\n }\n\n // the member that replaces getArrayLength on a declared C# type: Count counts the same\n // elements the helper's IList / ICollection branches count, Length is its string branch.\n // Any other declared type keeps the helper\n csharpCountMemberOf(csharpType: string): string | undefined {\n if ((csharpType === 'string') || (csharpType === 'string?')) {\n return 'Length';\n }\n return CSHARP_COUNT_TYPES.some((prefix) => csharpType.indexOf(prefix) === 0) ? 'Count' : undefined;\n }\n\n // `getArrayLength(x)` -> `(x?.Count ?? 0)` for a local whose printed declaration carries a C#\n // collection / string type (printer's declared-local table, then build/csharp-local-types.js).\n // The null-conditional is the helper's `null -> 0`; a plain member read would throw instead.\n csharpDeclaredLengthExpression(node): string | undefined {\n // a cast the printer itself printed around the receiver names the type outright, and\n // takes the whole expression as its operand (`(T)x?.Count` would cast the Count), so\n // the printed form is parenthesised before its own member read\n const printed = this.printNode(node, 0).trim();\n const cast = CSHARP_LENGTH_CAST.exec(printed);\n if (cast !== null) {\n const castMember = this.csharpCountMemberOf(cast[1]);\n if (castMember !== undefined) {\n return `(${isIdentifier(node) ? printed : `(${printed})`}?.${castMember} ?? 0)`;\n }\n }\n // `(x as List).length` / `((x)).length`: the printer prints the wrapper as the bare\n // local when it elides the assertion, so the read is still the identifier\n const receiver = this.csharpLengthReceiverIdentifier(node);\n if (receiver === undefined) {\n return undefined;\n }\n const named = this.csharpTypedLocalType(receiver);\n const csharpType = named !== undefined ? named\n : (this.csharpExpressionTypeResolver ? this.csharpExpressionTypeResolver(receiver) : undefined)\n ?? this.csharpLengthReceiverType(receiver);\n const member = csharpType === undefined ? undefined : this.csharpCountMemberOf(csharpType);\n if (member === undefined) {\n return undefined;\n }\n // a wrapper the printer does print (a `((string)x)` cast keeps its assertion) is a\n // different receiver: only the printed-as-identifier shape may take the member read\n const receiverText = this.printNode(receiver, 0);\n if (this.printNode(node, 0).trim() !== receiverText.trim()) {\n return undefined;\n }\n return `(${receiverText}?.${member} ?? 0)`;\n }\n\n // the printed key of ContainsKey must itself be a C# string: a literal, a local this\n // printer declared `string`, a call it types as string, or its own `((string)x)` cast\n csharpNativeStringKey(key): string | undefined {\n if (key?.kind === SyntaxKind.ParenthesizedExpression) {\n return this.csharpNativeStringKey(key.expression);\n }\n if (isStringLiteralLikeNode(key)) {\n return this.printNode(key, 0);\n }\n if (isIdentifier(key)) {\n const named = this.csharpTypedLocalType(key);\n // a non-nullable string local is the printed proof ContainsKey needs (`string?`\n // still needs the checker's string, or a null key would throw where inOp says false)\n if (named === 'string') {\n return this.printNode(key, 0);\n }\n if ((named === undefined) || (named.indexOf('string') !== 0)) {\n return undefined;\n }\n return this.isStringType(this.getChecker().getTypeAtLocation(key).flags) ? this.printNode(key, 0) : undefined;\n }\n if (this.csharpCallReturnType(key) === 'string') {\n // the callee's C# signature is a plain string; the checker proof is the phase-1 gate\n return this.isStringType(this.getChecker().getTypeAtLocation(key).flags) ? this.printNode(key, 0) : undefined;\n }\n const printed = this.printNode(key, 0);\n if (!printed.startsWith('((string)')) {\n return undefined;\n }\n // the cast is the printer's own string view of the value: only a checker-proven\n // string operand may have it (a non-string box would throw where the helper says false)\n return this.isStringType(this.getChecker().getTypeAtLocation(key).flags) ? printed : undefined;\n }\n\n // the checker's view of an `in` / `.length` operand: a dictionary carries a string\n // index signature, an array is the Array reference type. `any` proves nothing\n csharpIsDictionaryType(type): boolean {\n if (type === undefined || this.isAnyType(type.flags)) {\n return false;\n }\n return this.getChecker().getIndexTypeOfType(type, IndexKind.String) !== undefined;\n }\n\n csharpIsArrayType(type): boolean {\n if (type === undefined || this.isAnyType(type.flags)) {\n return false;\n }\n return type?.getSymbol()?.escapedName === 'Array';\n }\n\n // a union of dictionary members and nullish ones (what a `Dict | undefined` signature\n // widens to): a C# reference that happens to be null is a nullish arm, not a scalar one.\n // Any other member (arrays, classes, scalars) keeps the helper\n csharpNullableDictionaryType(type): boolean {\n if (type === undefined || ((type.flags & TypeFlags.Union) === 0)) {\n return false;\n }\n let dictionaries = 0;\n for (const member of (type as UnionType).getTypes() ?? []) {\n if ((member.flags & (TypeFlags.Undefined | TypeFlags.Null)) !== 0) {\n continue;\n }\n if (!this.csharpIsDictionaryType(member)) {\n return false;\n }\n dictionaries++;\n }\n return dictionaries > 0;\n }\n\n // a dictionary whose values are `any` — the shape the transpiled C# boxes as\n // Dictionary. A `Dictionary` / `Dictionary` keeps the\n // helper: the C# cast target is invariant, so `IDictionary` would throw\n csharpIsAnyValuedDictionaryType(type): boolean {\n if (!this.csharpIsDictionaryType(type)) {\n return false;\n }\n const value = this.getChecker().getIndexTypeOfType(type, IndexKind.String);\n return (value !== undefined) && this.isAnyType(value.flags);\n }\n\n // the parameter printFunctionBody gives a `??= new Dictionary()` line\n // (its initializer is an object literal): from the first statement on its box is a\n // dictionary whatever the caller passed, so a null check would be dead code\n csharpDictionaryParamsBag(node): boolean {\n const declaration = this.getChecker().getSymbolAtLocation(node)?.valueDeclaration?.resolve();\n const initializer = (declaration?.kind === SyntaxKind.Parameter) ? (declaration as ParameterDeclaration).initializer : undefined;\n return initializer?.kind === SyntaxKind.ObjectLiteralExpression;\n }\n\n // D2: the name is rewritten before this read, so the box it holds there is not the one its\n // declaration started with (the scan is a name match, so any earlier write bails)\n csharpNameWrittenBefore(node, name: string): boolean {\n const scope = this.csharpEnclosingFunction(node);\n if (scope === undefined) {\n return true;\n }\n let written = false;\n const visit = (n) => {\n if (written || (n.pos >= node.pos)) {\n return;\n }\n if ((n.kind === SyntaxKind.Identifier) && (n.text === name)) {\n const parent = n.parent;\n const assignment = (parent?.kind === SyntaxKind.BinaryExpression) && (parent.left === n);\n const increment = ((parent?.kind === SyntaxKind.PostfixUnaryExpression) || (parent?.kind === SyntaxKind.PrefixUnaryExpression))\n && ((parent.operator === SyntaxKind.PlusPlusToken) || (parent.operator === SyntaxKind.MinusMinusToken));\n if (assignment || increment) {\n written = true;\n return;\n }\n }\n n.forEachChild(visit);\n };\n scope.forEachChild(visit);\n return written;\n }\n\n // The C# dictionary a ContainsKey receiver reads through, or undefined: printer tables, then the\n // build layer's declared-type table, then an `object` parameter proven a dictionary by TS or an\n // emitted `??= new Dictionary()`. That case applies the helper's cast + null test.\n csharpNativeDictionaryReceiver(obj): { text: string, nullTest?: string } | undefined {\n const checker = this.getChecker();\n const type = checker.getTypeAtLocation(obj);\n const nullable = this.csharpNullableDictionaryType(type);\n const receiver = this.csharpNativeReceiver(obj);\n if (receiver !== undefined) {\n // only a dictionary C# type carries ContainsKey (IList keeps the helper)\n if (receiver.type.indexOf('Dictionary<') < 0) {\n return undefined;\n }\n return nullable ? { text: receiver.text, nullTest: receiver.text } : { text: receiver.text };\n }\n // the embedding build layer's declared-type table names the type the local's own\n // declaration carries, so it needs neither the checker proof nor a cast\n const declared = this.csharpExpressionTypeOf(obj);\n if (declared !== undefined) {\n return (declared.indexOf('Dictionary<') >= 0) ? { text: this.printNode(obj, 0) } : undefined;\n }\n // an `object` box: only a parameter of this function (a local may box the hand-written\n // base's own instantiation — `client.futures` is IDictionary — and the\n // printer cannot tell), and only while nothing has rewritten it (D2)\n if (!isIdentifier(obj) || (this.csharpTypedLocalType(obj) !== undefined)) {\n return undefined;\n }\n const name = obj.text as string;\n if (this.csharpNameWrittenBefore(obj, name)) {\n return undefined;\n }\n const declaration = checker.getSymbolAtLocation(obj)?.valueDeclaration?.resolve();\n if (declaration?.kind !== SyntaxKind.Parameter) {\n return undefined; // a local may box a hand-written instantiation the printer cannot name\n }\n const printed = this.printNode(obj, 0);\n const text = `((IDictionary)${printed})`;\n // the params bag: the printer's own `??= new Dictionary()` line made the\n // box a dictionary whatever the caller passed, so no checker proof is needed (and no\n // null test — the line is the first statement of the body)\n if (this.csharpDictionaryParamsBag(obj)) {\n return { text };\n }\n if ((!this.csharpIsDictionaryType(type) && !nullable) || !this.csharpIsAnyValuedDictionaryType(type)) {\n return undefined;\n }\n return { text, nullTest: printed };\n }\n\n // `key in obj` -> `obj.ContainsKey(key)`, only when both the printed key and the printed\n // operand are already C# string / dictionary values. Every other shape keeps the inOp helper\n csharpNativeInExpression(key, obj): string | undefined {\n const printedKey = this.csharpNativeStringKey(key);\n if (printedKey === undefined) {\n return this.csharpDeclaredDictInExpression(key, obj);\n }\n const receiver = this.csharpNativeDictionaryReceiver(obj);\n if (receiver !== undefined) {\n const call = `${receiver.text}.ContainsKey(${printedKey})`;\n return (receiver.nullTest === undefined) ? call : `(${receiver.nullTest} != null && ${call})`;\n }\n // a receiver the embedding build layer retypes AFTER printing: the checker may see\n // `any` on it, so no table above names it (see csharpDeclaredDictInExpression)\n return this.csharpDeclaredDictInExpression(key, obj);\n }\n\n // `key in obj` on a local whose EMITTED declaration is a dictionary the printer cannot name itself\n // (build/csharp-local-types.js retypes it, answers csharpDeclaredDictReceiverType): inOp's dict\n // branch is exactly `obj?.ContainsKey(key) == true` for a key that is already a C# string.\n csharpDeclaredDictInExpression(key, obj): string | undefined {\n if (obj?.kind !== SyntaxKind.Identifier) {\n return undefined;\n }\n const declared = (typeof this.csharpDeclaredDictReceiverType === 'function') ? this.csharpDeclaredDictReceiverType(obj) : undefined;\n if ((declared === undefined) || (declared.indexOf('Dictionary<') < 0)) {\n return undefined;\n }\n const printedKey = this.csharpNativeStringKey(key) ?? this.csharpDeclaredStringKey(key);\n if (printedKey === undefined) {\n return undefined;\n }\n const receiver = this.printNode(obj, 0);\n if (isStringLiteralLikeNode(key)) {\n return `(${receiver}?.ContainsKey(${printedKey}) == true)`;\n }\n // an identifier key may hold null, where a bare ContainsKey throws ArgumentNullException:\n // the helper's own null guard is emitted back. Undefined by default, so an untyped run is\n // byte-identical (a receiver no hook names keeps the helper call).\n if (isIdentifier(key)) {\n return `((${printedKey} != null) && (${receiver}?.ContainsKey(${printedKey}) == true))`;\n }\n return undefined;\n }\n\n // the key of the rule above, when the printer's own tables name no string for it but the\n // embedding build layer's record does (the same hook the isEqual twin reads)\n csharpDeclaredStringKey(key): string | undefined {\n if (key?.kind !== SyntaxKind.Identifier) {\n return undefined;\n }\n const type = (typeof this.csharpLocalTypeOf === 'function') ? this.csharpLocalTypeOf(key) : undefined;\n return ((type === 'string') || (type === 'string?')) ? this.printNode(key, 0) : undefined;\n }\n\n // `x.length` -> `x.Count`, same proof for the checker's array operands; strings keep\n // the `((string)x).Length` branch and every unproven operand keeps getArrayLength\n csharpNativeLengthExpression(expression): string | undefined {\n if (this.csharpIsArrayType(this.getChecker().getTypeAtLocation(expression))) {\n const receiver = this.csharpNativeReceiver(expression);\n if (receiver !== undefined) {\n return `${receiver.text}.Count`;\n }\n }\n return this.csharpDeclaredLengthExpression(expression);\n }\n\n // the C# type of a dictionary element read is `object`: isEqual compares the boxed\n // element, which `as` + the operator reproduce exactly (any other box reads as null,\n // where isEqual also answers false)\n csharpNativeElementLiteralEquality(left, right, leftText: string, rightText: string, isEquality: boolean): string | undefined {\n const elementIsLeft = this.csharpStringKeyedElementAccess(left);\n if (!elementIsLeft && !this.csharpStringKeyedElementAccess(right)) {\n return undefined;\n }\n const [element, literal] = elementIsLeft ? [left, right] : [right, left];\n const isBoolLiteral = (literal.kind === SyntaxKind.TrueKeyword) || (literal.kind === SyntaxKind.FalseKeyword);\n const isStringLiteral = isStringLiteralLikeNode(literal);\n if (!isBoolLiteral && !isStringLiteral) {\n return undefined;\n }\n if (this.csharpDictionaryReceiverType(element.expression) === undefined) {\n return undefined;\n }\n const wanted = isBoolLiteral ? CSHARP_SCALAR_ELEMENT_BOOL : CSHARP_SCALAR_ELEMENT_STRING;\n if ((this.csharpScalarElementKinds(element) & wanted) === 0) {\n return undefined;\n }\n const token = isEquality ? '==' : '!=';\n if (isStringLiteral && this.csharpNumericStringLiteral(literal)) {\n return undefined; // isEqual's double/decimal branches coerce a numeric string\n }\n const cast = isBoolLiteral ? 'bool?' : 'string';\n const castElement = `(${elementIsLeft ? leftText : rightText} as ${cast})`;\n const otherText = elementIsLeft ? rightText : leftText;\n return elementIsLeft ? `(${castElement} ${token} ${otherText})` : `(${otherText} ${token} ${castElement})`;\n }\n\n // `x[\"k\"]` — the element read of a dictionary key this printer prints as getValue(x, \"k\")\n csharpStringKeyedElementAccess(node): boolean {\n return (node?.kind === SyntaxKind.ElementAccessExpression) && isStringLiteralLikeNode(node.argumentExpression);\n }\n\n // isEqual compares a boxed number with a numeric string by converting both, which the\n // string cast of the native form cannot reproduce: a numeric-looking literal stays on\n // the helper (the element proof says the box is a string, and a number box would differ)\n csharpNumericStringLiteral(node): boolean {\n const text = String(node.text).trim();\n return (text !== '') && !isNaN(Number(text));\n }\n\n // the declared C# type of a dictionary receiver: a local the embedding build layer retypes\n // (csharpExpressionTypeResolver) or a hand-written BaseExchange field; undefined keeps the\n // runtime helper, since the printer cannot name the box the key lives in\n csharpDictionaryReceiverType(node): string | undefined {\n const native = this.csharpNativeReceiver(node);\n const declared = (native !== undefined) ? native.type : this.csharpExpressionTypeOf(node);\n if ((declared === undefined) || (declared.indexOf('Dictionary<') < 0)) {\n return undefined;\n }\n return declared;\n }\n\n // the scalar branches isEqual can compare an element with: every member of the element's\n // TypeScript type must be a boolean, a string or undefined, or the helper stays\n csharpScalarElementKinds(node): number {\n try {\n const type = this.getChecker().getTypeAtLocation(node);\n const members = ((type.flags & TypeFlags.Union) !== 0) ? ((type as any).getTypes() ?? []) : [ type ];\n let kinds = 0;\n for (const member of members) {\n const flags = member.flags;\n if (flags & (TypeFlags.Boolean | TypeFlags.BooleanLiteral)) {\n kinds |= CSHARP_SCALAR_ELEMENT_BOOL;\n } else if (flags & (TypeFlags.String | TypeFlags.StringLiteral | TypeFlags.TemplateLiteral)) {\n kinds |= CSHARP_SCALAR_ELEMENT_STRING;\n } else if (!(flags & TypeFlags.Undefined)) {\n return 0;\n }\n }\n return kinds;\n } catch (e) {\n return 0; // in-memory program without a checker\n }\n }\n\n // the C# type the emitted declaration gives a `.length` receiver, or undefined when this\n // printer names none. Installed by build/csharp-local-types.js; undefined by default, so\n // the untyped emission is byte-identical without the override\n csharpLengthReceiverType(expression): string | undefined {\n return undefined;\n }\n\n // `isEqual (x, \"lit\")` -> `x == \"lit\"` (and `!isEqual` -> `!=`) when the operand's emitted\n // declaration is a string: isEqual's string branch is the same ordinal comparison; a null operand\n // is false in both. Gated on csharpLocalTypeOf; an unnamed operand keeps the helper call.\n csharpStringLiteralEquality(op, left, right, leftText: string, rightText: string): string | undefined {\n const equality = (op === SyntaxKind.EqualsEqualsToken) || (op === SyntaxKind.EqualsEqualsEqualsToken);\n const inequality = (op === SyntaxKind.ExclamationEqualsToken) || (op === SyntaxKind.ExclamationEqualsEqualsToken);\n if (!equality && !inequality) {\n return undefined;\n }\n const leftLiteral = isStringLiteral(left);\n const rightLiteral = isStringLiteral(right);\n if (leftLiteral === rightLiteral) {\n return undefined; // exactly one side must be the (never-null) string literal\n }\n const operand = leftLiteral ? right : left;\n if (operand?.kind !== SyntaxKind.Identifier) {\n return undefined;\n }\n const operandType = this.csharpLocalTypeOf(operand);\n if ((operandType !== 'string') && (operandType !== 'string?')) {\n return undefined;\n }\n return `${leftText} ${inequality ? '!=' : '=='} ${rightText}`;\n }\n\n // U55: `isEqual (x, null)` -> `x == null` (`!isEqual` -> `!=`) when the emitted declaration is\n // a typed reference or nullable scalar: the helper's null guards return exactly the C# null test,\n // never reach a typed branch. Gated on csharpNullComparisonTypeOf; unnamed operands keep helper.\n csharpNullLiteralEquality(op, left, right, leftText: string, rightText: string): string | undefined {\n const equality = (op === SyntaxKind.EqualsEqualsToken) || (op === SyntaxKind.EqualsEqualsEqualsToken);\n const inequality = (op === SyntaxKind.ExclamationEqualsToken) || (op === SyntaxKind.ExclamationEqualsEqualsToken);\n if (!equality && !inequality) {\n return undefined;\n }\n const leftNull = this.csharpOperandIsNullLiteral(left);\n const rightNull = this.csharpOperandIsNullLiteral(right);\n if (leftNull === rightNull) {\n return undefined; // exactly one side must be the (never-typed) null literal\n }\n let operand = leftNull ? right : left;\n while (operand?.kind === SyntaxKind.ParenthesizedExpression) {\n operand = operand.expression;\n }\n if (operand?.kind !== SyntaxKind.Identifier) {\n return undefined;\n }\n const operandType = (typeof this.csharpNullComparisonTypeOf === 'function') ? this.csharpNullComparisonTypeOf(operand) : undefined;\n if (!this.csharpNullComparisonTypeIsProvable(operandType)) {\n return undefined;\n }\n return this.csharpNullComparison(leftNull ? rightText : leftText, equality);\n }\n\n // `null` and the `undefined` identifier both print as the C# null literal\n csharpOperandIsNullLiteral(node): boolean {\n return (node?.kind === SyntaxKind.NullKeyword)\n || ((node?.kind === SyntaxKind.Identifier) && (node.text === 'undefined'));\n }\n\n printCustomBinaryExpressionIfAny(node, identation) {\n const left = node.left;\n const right = node.right;\n\n const op = node.operatorToken.kind;\n\n if (left.kind === SyntaxKind.TypeOfExpression) {\n const typeOfExpression = this.handleTypeOfInsideBinaryExpression(node, identation);\n if (typeOfExpression) {\n return typeOfExpression;\n }\n }\n\n // handle: [x,d] = this.method()\n if (op === SyntaxKind.EqualsToken && left.kind === SyntaxKind.ArrayLiteralExpression) {\n const arrayBindingPatternElements = left.elements;\n const parsedArrayBindingElements = arrayBindingPatternElements.map((e) => this.printNode(e, 0));\n const syntheticName = parsedArrayBindingElements.join(\"\") + \"Variable\";\n\n // when the holder's C# type is known (see csharpDestructuringTempType), declare the\n // holder with it and index it directly: `((IList)holder)[i]` names nothing new\n const tempType = this.csharpDestructuringTempType(right);\n const tempExpression = this.printNode(right, 0);\n\n const tempCast = (tempType && this.csharpDestructuringTempNeedsCast(right, tempExpression)) ? `(${tempType})` : '';\n let arrayBindingStatement = tempType ? `${tempType} ${syntheticName} = ${tempCast}${tempExpression};\\n` : `var ${syntheticName} = ${tempExpression};\\n`;\n\n parsedArrayBindingElements.forEach((e, index) => {\n // const type = this.getType(node);\n // const parsedType = this.getTypeFromRawType(type);\n const leftElement = arrayBindingPatternElements[index];\n const leftType = this.getChecker().getTypeAtLocation(leftElement);\n const parsedType = this.getTypeFromRawType(leftType);\n\n const castExp = parsedType ? `(${parsedType})` : \"\";\n\n // const statement = this.getIden(identation) + `${e} = (${castExp}((List)${syntheticName}))[${index}]`;\n const statement = this.getIden(identation) + (tempType ? `${e} = ${syntheticName}[${index}]` : `${e} = ((IList)${syntheticName})[${index}]`);\n if (index < parsedArrayBindingElements.length - 1) {\n arrayBindingStatement += statement + \";\\n\";\n } else {\n // printStatement adds the last ;\n arrayBindingStatement += statement;\n }\n });\n\n return arrayBindingStatement;\n }\n\n if (op === SyntaxKind.InKeyword) {\n const nativeIn = this.csharpNativeInExpression(left, right);\n if (nativeIn !== undefined) {\n return nativeIn;\n }\n return `inOp(${this.printNode(right, 0)}, ${this.printNode(left, 0)})`;\n }\n\n // only print the operands when this op is actually handled here; otherwise\n // the base printBinaryExpression prints them, and doing it eagerly means\n // every unhandled binary expression gets its subtrees printed twice\n if (op === SyntaxKind.PlusEqualsToken || op === SyntaxKind.MinusEqualsToken || op in this.binaryExpressionsWrappers) {\n const nativeComparison = this.csharpNativeNumericComparison(node, identation);\n if (nativeComparison !== undefined) {\n return nativeComparison;\n }\n const leftText = this.printNode(left, 0);\n const rightText = this.printNode(right, 0);\n\n if (op === SyntaxKind.PlusEqualsToken) {\n return `${leftText} = add(${leftText}, ${rightText})`;\n }\n\n if (op === SyntaxKind.MinusEqualsToken) {\n return `${leftText} = subtract(${leftText}, ${rightText})`;\n }\n\n const isEquality = (op === SyntaxKind.EqualsEqualsToken) || (op === SyntaxKind.EqualsEqualsEqualsToken);\n const isDifference = (op === SyntaxKind.ExclamationEqualsToken) || (op === SyntaxKind.ExclamationEqualsEqualsToken);\n if (isEquality || isDifference) {\n // `isEqual (x, \"lit\")` / `!isEqual (x, \"lit\")` over a string-typed operand (S60,\n // csharpStringLiteralEquality) first; anything the hook cannot name falls through to the\n // printed-form inlining below, byte-identically.\n const nativeEquality = this.csharpStringLiteralEquality(op, left, right, leftText, rightText);\n // `isEqual (x, null)` / `!isEqual (x, null)` over a typed-reference or nullable-scalar operand\n // (U55, csharpNullLiteralEquality), the hook-gated null-literal twin of the rule above; anything\n // it cannot name falls through to the printed-form inlining below, byte-identically.\n const native = nativeEquality\n ?? this.csharpNullLiteralEquality(op, left, right, leftText, rightText)\n ?? this.printInlineEquality(left, right, leftText, rightText, isEquality)\n ?? this.csharpNativeElementLiteralEquality(left, right, leftText, rightText, isEquality)\n ?? this.csharpNativeNumericCallEquality(left, right, leftText, rightText, isEquality);\n if (native !== undefined) {\n return native;\n }\n }\n\n if (op === SyntaxKind.PlusToken) {\n // `add (x, y)` -> `(x + y)` when the classifier proves the LEFT operand's emitted declaration is a\n // string (U57): the call binds add(string, string) / add(string, object), exactly this\n // concatenation. Gated on the hook, so an unnamed operand keeps the helper.\n const nativeConcat = this.csharpNativeStringConcat(left, right, leftText, rightText);\n if (nativeConcat !== undefined) {\n return nativeConcat;\n }\n }\n\n if (op === SyntaxKind.AsteriskToken) {\n const nativeProduct = this.csharpNativeLiteralProduct(left, right);\n if (nativeProduct !== undefined) {\n return nativeProduct;\n }\n }\n\n const [open, close] = this.binaryExpressionsWrappers[op];\n if (op === SyntaxKind.PercentToken) {\n const nativeMod = this.csharpNativeModExpression(left, right, leftText);\n if (nativeMod !== undefined) {\n return nativeMod;\n }\n }\n return `${open}${leftText}, ${rightText}${close}`;\n }\n\n // x = y\n // cast y to x type when y is unknown\n // if (op === SyntaxKind.EqualsToken) {\n // const leftType = this.getChecker().getTypeAtLocation(left);\n // const rightType = this.getChecker().getTypeAtLocation(right);\n\n // if (this.isAnyType(rightType.flags) && !this.isAnyType(leftType.flags)) {\n // // const parsedType = this.getTypeFromRawType(leftType);\n // return `${leftText} = ${rightText}`;\n // }\n // }\n\n return undefined;\n }\n\n // castVariableAssignmentIfNeeded(left, right, identation) {\n // const leftType = this.getChecker().getTypeAtLocation(left);\n // const rightType = this.getChecker().getTypeAtLocation(right);\n\n // const leftText = this.printNode(left, 0);\n // const rightText = this.printNode(right, 0);\n\n // if (this.isAnyType(rightType.flags) && !this.isAnyType(leftType.flags)) {\n // const parsedType = this.getTypeFromRawType(leftType);\n // return `${this.getIden(identation)}${leftText} = (${parsedType})${rightText}`;\n // }\n // return undefined;\n // }\n\n // the C# type of a whole-call / whole-property initializer, keyed on the AST so\n // the printer's cast wrappers (`((string)x).ToUpper()`) do not hide the callee\n csharpCallReturnType(initializer): string | undefined {\n if (initializer?.kind === SyntaxKind.PropertyAccessExpression) {\n // `x.length` prints `((string)x).Length` or `getArrayLength(x)`, both int\n return (initializer.name?.text === 'length') ? 'int' : undefined;\n }\n if (initializer?.kind !== SyntaxKind.CallExpression) {\n return undefined;\n }\n const expression = initializer.expression;\n if (expression?.kind !== SyntaxKind.PropertyAccessExpression) {\n return undefined;\n }\n const methodName = expression.name?.text as string;\n const target = expression.expression;\n if (target?.kind === SyntaxKind.ThisKeyword) {\n // the table names the C# signature of the same-name base helper, which the printed\n // call only binds when the printer resolves the callee. An unresolvable one\n // (`this.proxyUrlCallback(...)` — a property holding the function — or a\n // checker-less program) prints `callDynamically(this, \"name\", ...)` instead, and\n // that helper returns `object`: no concrete type may be named for its value\n if (!this.csharpCalleeResolves(initializer)) {\n return undefined;\n }\n return CSHARP_THIS_RETURN_TYPES[methodName];\n }\n if (target?.kind === SyntaxKind.Identifier) {\n return CSHARP_STATIC_RETURN_TYPES[(target.text as string) + '.' + methodName] ?? CSHARP_METHOD_RETURN_TYPES[methodName];\n }\n return CSHARP_METHOD_RETURN_TYPES[methodName];\n }\n\n // mirrors printWrappedUnknownThisProperty: a `this.(...)` call whose callee the\n // checker cannot resolve is printed as `callDynamically(this, \"\", ...)`, whose C#\n // signature returns `object` whatever the name says\n csharpCalleeResolves(node): boolean {\n const checker: any = this.checkerOrUndefined();\n if (checker === undefined) {\n return false;\n }\n return checker.getResolvedSignature(node)?.declaration !== undefined;\n }\n\n // the concrete C# type the initializer already produces, or undefined when the\n // printer cannot name it (this.safeString, getValue, add, parseInt, ... return object)\n csharpTypeOfInitializer(initializer): string | undefined {\n switch (initializer?.kind) {\n case SyntaxKind.StringLiteral:\n case SyntaxKind.NoSubstitutionTemplateLiteral:\n return 'string';\n case SyntaxKind.TrueKeyword:\n case SyntaxKind.FalseKeyword:\n return 'bool';\n case SyntaxKind.PrefixUnaryExpression:\n // `!x` prints `!isTrue(x)`\n return (initializer.operator === SyntaxKind.ExclamationToken) ? 'bool' : undefined;\n case SyntaxKind.ParenthesizedExpression:\n return this.csharpTypeOfInitializer(initializer.expression);\n case SyntaxKind.BinaryExpression: {\n const op = initializer.operatorToken.kind;\n // `a || b` prints `isTrue(a) || isTrue(b)`; the comparison wrappers and\n // `in` all return bool\n switch (op) {\n case SyntaxKind.BarBarToken:\n case SyntaxKind.AmpersandAmpersandToken:\n case SyntaxKind.EqualsEqualsToken:\n case SyntaxKind.EqualsEqualsEqualsToken:\n case SyntaxKind.ExclamationEqualsToken:\n case SyntaxKind.ExclamationEqualsEqualsToken:\n case SyntaxKind.GreaterThanToken:\n case SyntaxKind.GreaterThanEqualsToken:\n case SyntaxKind.LessThanToken:\n case SyntaxKind.LessThanEqualsToken:\n case SyntaxKind.InKeyword:\n return 'bool';\n }\n return undefined;\n }\n }\n return this.csharpCallReturnType(initializer) ?? (this.csharpBoolCallTyped(initializer) ? 'bool' : undefined);\n }\n\n // A `this.(...)` call to a method the enclosing class declares with a plain `bool` return\n // (csharpBooleanReturnType prints that `bool`) hands back an unboxed bool, so a local holding it is\n // `bool`. Base helpers, names the table answers and overloaded families keep their box.\n csharpBoolCallTyped(node): boolean {\n if (node?.kind !== SyntaxKind.CallExpression || !this.csharpIsCheckedBoolean(node)) {\n return false;\n }\n const expression = node.expression;\n if (expression?.kind !== SyntaxKind.PropertyAccessExpression || expression.expression?.kind !== SyntaxKind.ThisKeyword) {\n return false;\n }\n let declaration;\n let checker;\n try {\n checker = this.getChecker();\n declaration = checker.getResolvedSignature(node)?.declaration?.resolve();\n } catch (e) {\n return false;\n }\n if (!isMethodDeclaration(declaration) || (this.csharpBooleanReturnType(declaration) !== 'bool')) {\n return false;\n }\n const owner = findAncestor(declaration, isClassLikeDeclaration);\n if ((owner === undefined) || (owner !== findAncestor(node, isClassLikeDeclaration))) {\n return false;\n }\n return checker.getSymbolAtLocation(declaration.name)?.declarations?.length === 1;\n }\n\n csharpEnclosingFunction(node) {\n let current = node?.parent;\n while (current) {\n switch (current.kind) {\n case SyntaxKind.MethodDeclaration:\n case SyntaxKind.FunctionDeclaration:\n case SyntaxKind.FunctionExpression:\n case SyntaxKind.ArrowFunction:\n case SyntaxKind.Constructor:\n case SyntaxKind.SourceFile:\n return current;\n }\n current = current.parent;\n }\n return undefined;\n }\n\n csharpTypeNameIsShadowed(scope, csharpType: string): boolean {\n const names = csharpType.match(/[A-Za-z_]\\w*/g) ?? [];\n const relevant = names.filter((n) => CSHARP_TYPE_NAMES.indexOf(n) >= 0);\n if (relevant.length === 0 || scope === undefined) {\n return false;\n }\n return this.hasNodeWhere(scope, (n: any) => {\n const isBinding = (n.kind === SyntaxKind.Parameter) || (n.kind === SyntaxKind.VariableDeclaration);\n if (isBinding && (n.name?.kind === SyntaxKind.Identifier)) {\n const printed = this.printNode(n.name, 0);\n if (relevant.indexOf(printed) >= 0) { return true; }\n }\n return false;\n });\n }\n\n // reject the refinement when something downstream needs the local to stay `object`:\n // `x.push(v)` prints `((IList)x).Add(v)` on a value that must be boxed, a\n // later assignment of another concrete type would stop compiling, and `x++` prints\n // `postFixIncrement(ref x)` whose parameter is `ref object`\n csharpLocalIsSafeToType(scope, declaration, varName: string, csharpType: string, safeAccessor = false): boolean {\n if (scope === undefined) {\n return false;\n }\n return !this.hasNodeWhere(scope, (n: any) => {\n if ((n.kind === SyntaxKind.Identifier) && (n.text === varName) && (n !== declaration.name)) {\n const parent = n.parent;\n if (parent?.kind === SyntaxKind.VariableDeclaration && parent.name === n) {\n return; // a sibling block-scoped declaration; it gets its own type\n }\n if ((parent?.kind === SyntaxKind.PostfixUnaryExpression) || (parent?.kind === SyntaxKind.PrefixUnaryExpression)) {\n const op = parent.operator;\n if ((op === SyntaxKind.PlusPlusToken) || (op === SyntaxKind.MinusMinusToken)) {\n return true;\n }\n // prefixUnaryNeg/Plus(ref x) has int / Int64 / double twins only: a\n // nullable or reference local would not bind any overload\n if (safeAccessor && (op !== SyntaxKind.ExclamationToken) && (csharpType !== 'int') && (csharpType !== 'Int64') && (csharpType !== 'double')\n && !this.csharpHx4GuardedNullableNegation(parent, csharpType)) {\n return true;\n }\n }\n if (parent?.kind === SyntaxKind.SpreadElement) {\n return true;\n }\n if (parent?.kind === SyntaxKind.ArrayLiteralExpression\n && parent.parent?.kind === SyntaxKind.BinaryExpression\n && parent.parent.left === parent\n && parent.parent.operatorToken.kind === SyntaxKind.EqualsToken) {\n return true;\n }\n if (parent?.kind === SyntaxKind.PropertyAccessExpression && parent.expression === n) {\n const method = parent.name?.text;\n // these print as `((IList)x).Add(...)` / `x = (x as IList)...`\n if ((method === 'push') || (method === 'reverse') || (method === 'sort')) {\n return true;\n }\n // the remaining list methods print an `((IList)x)` cast too; only\n // a safe* list local can carry one\n if (safeAccessor && !this.csharpTypeIsList(csharpType) && ((method === 'join') || (method === 'shift') || (method === 'pop'))) {\n return true;\n }\n }\n if (safeAccessor) {\n // `const [a, b] = x` prints a `((IList)x)[0]` read\n if (parent?.kind === SyntaxKind.VariableDeclaration && parent.name?.kind === SyntaxKind.ArrayBindingPattern && !this.csharpTypeIsList(csharpType)) {\n return true;\n }\n // `throw new ExchangeError (x)` wraps the argument in a hard `(string)`\n // cast, which only compiles from `object` or a string; `delete obj[x]` prints\n // `.Remove((string)x)`, the same hard cast\n if (!this.csharpTypeIsStringType(csharpType) && (this.csharpIsClassThrowArgument(n) || this.csharpIsDeleteKey(n))) {\n return true;\n }\n }\n if (parent?.kind === SyntaxKind.BinaryExpression && parent.left === n) {\n const op = parent.operatorToken.kind;\n if (op === SyntaxKind.EqualsToken) {\n if (this.csharpTypeOfInitializer(parent.right) !== csharpType) {\n return true;\n }\n } else if ((op >= SyntaxKind.FirstCompoundAssignment) && (op <= SyntaxKind.LastCompoundAssignment)) {\n return true;\n }\n }\n // a `string?` local as the LEFT operand of `+` prints add(, ...): the\n // nullable-to-`string` conversion makes add(string, ...) a better match than\n // add(object, object), which turns a null left into the right operand instead\n // of null (see the same rule in the ccxt cs/ccxt/base comments)\n if (safeAccessor && (csharpType === 'string?') && this.csharpIsLeftPlusOperand(n)) {\n return true;\n }\n }\n return false;\n });\n }\n\n // a `((string)x)` wrapper is redundant as soon as the receiver's static C# type is\n // already string: the cast names the box the value is in, it never changes the value\n\n getCSharpLocalType(declaration): string {\n const csharpType = this.csharpTypeOfInitializer(declaration.initializer);\n if (csharpType === undefined) {\n return this.VAR_TOKEN;\n }\n // the scan matches AST identifiers, so it needs the source name, not the\n // printed one (`string` is renamed to `str` on the way out)\n const sourceName = declaration.name?.text;\n if (sourceName === undefined) {\n return this.VAR_TOKEN;\n }\n const scope = this.csharpEnclosingFunction(declaration);\n const safeAccessor = this.csharpIsSafeAccessorCall(declaration.initializer);\n if (this.csharpTypeNameIsShadowed(scope, csharpType) || !this.csharpLocalIsSafeToType(scope, declaration, sourceName, csharpType, safeAccessor)) {\n return this.VAR_TOKEN;\n }\n return csharpType;\n }\n\n // `this.safeString2 (...)`: the printed call binds the concrete C# signature of the\n // same-name base helper (see CSHARP_THIS_RETURN_TYPES). Used to gate the extra sinks.\n csharpIsSafeAccessorCall(initializer): boolean {\n if (initializer?.kind !== SyntaxKind.CallExpression) {\n return false;\n }\n const expression = initializer.expression;\n if (expression?.kind !== SyntaxKind.PropertyAccessExpression || expression.expression?.kind !== SyntaxKind.ThisKeyword) {\n return false;\n }\n return CSHARP_SAFE_ACCESSOR_NAMES.indexOf(expression.name?.text as string) >= 0;\n }\n\n csharpTypeIsList(csharpType: string): boolean {\n return (csharpType === 'List') || (csharpType === 'IList');\n }\n\n csharpTypeIsStringType(csharpType: string): boolean {\n return (csharpType === 'string') || (csharpType === 'string?');\n }\n\n // `throw new ExchangeError (x)`: the printer wraps the argument in a hard `(string)`\n csharpIsClassThrowArgument(node): boolean {\n let current = node;\n while (current.parent) {\n const parent = current.parent;\n if ((parent.kind === SyntaxKind.ParenthesizedExpression) || (parent.kind === SyntaxKind.AsExpression)) {\n current = parent;\n continue;\n }\n if ((parent.kind === SyntaxKind.NewExpression) && (parent.arguments?.indexOf(current) >= 0)) {\n current = parent;\n continue;\n }\n return parent.kind === SyntaxKind.ThrowStatement;\n }\n return false;\n }\n\n // `delete obj[x]` prints `.Remove((string)x)`\n csharpIsDeleteKey(node): boolean {\n let value = node;\n while (value.parent && ((value.parent.kind === SyntaxKind.ParenthesizedExpression) || (value.parent.kind === SyntaxKind.AsExpression))) {\n value = value.parent;\n }\n const access = value.parent;\n return access?.kind === SyntaxKind.ElementAccessExpression && access.argumentExpression === value && access.parent?.kind === SyntaxKind.DeleteExpression;\n }\n\n // `(x) + y` / `x + y` prints `add(x, y)`: the parentheses keep x's static type\n csharpIsLeftPlusOperand(node): boolean {\n let value = node;\n while (value.parent && (value.parent.kind === SyntaxKind.ParenthesizedExpression)) {\n value = value.parent;\n }\n const parent = value.parent;\n if (parent?.kind !== SyntaxKind.BinaryExpression || parent.left !== value) {\n return false;\n }\n const op = parent.operatorToken.kind;\n return (op === SyntaxKind.PlusToken) || (op === SyntaxKind.PlusEqualsToken);\n }\n // the binding a bare identifier resolves to (a local, a parameter, ...) or undefined\n // for every other receiver shape (`this.x`, a call result, a destructured target)\n csharpReceiverBinding(receiver) {\n if (receiver?.kind !== SyntaxKind.Identifier) {\n return undefined;\n }\n const symbol = (this.getChecker() as Checker).getSymbolAtLocation(receiver);\n return symbol?.valueDeclaration?.resolve();\n }\n\n // The static C# type the emitted declaration gives a string-method receiver, or undefined when the\n // printer cannot name it (parameters, call results, ...). Only printer-typed locals are provable\n // here; the ccxt classifier overrides this hook to add the locals and parameters ITS tables retype.\n csharpStringReceiverType(receiver): string | undefined {\n const declaration = this.csharpReceiverBinding(receiver);\n if (declaration?.kind !== SyntaxKind.VariableDeclaration) {\n return undefined;\n }\n if ((declaration.parent as any)?.declarations?.length !== 1) {\n return undefined; // `object a = ..., b = ...` is printed as one statement\n }\n // memoized: the caller asks per receiver, getCSharpLocalType scans the scope\n const cached = this.stringReceiverTypes.get(declaration);\n if (cached !== undefined) {\n return (cached === '') ? undefined : cached;\n }\n const type = this.getCSharpLocalType(declaration);\n this.stringReceiverTypes.set(declaration, type ?? '');\n return type;\n }\n\n // the receiver of `x.Split/.ToUpper/.ToLower/.Replace/.Trim/.Length`, already printed:\n // bare when its static C# type is a string, wrapped in `((string)...)` otherwise (the\n // untyped emission is unchanged)\n csharpStringMethodReceiver(node, name) {\n const expression = node?.expression;\n const receiver = (node?.kind === SyntaxKind.CallExpression)\n ? ((expression?.kind === SyntaxKind.PropertyAccessExpression) ? expression.expression : undefined)\n : expression;\n const type = this.csharpStringReceiverType(receiver);\n return ((type === 'string') || (type === 'string?')) ? name : `((string)${name})`;\n }\n\n // The declared C# type of the `Variable` holder of a destructuring block, or undefined\n // (keeps a `var` holder read via `((IList)holder)[i]`). The ccxt classifier overrides this\n // for the tuple-returning `handle*AndParams` family: holder is `IList`, read directly.\n csharpDestructuringTempType(initializer): string | undefined {\n return undefined;\n }\n\n // whether the typed holder needs the `(T)` cast on its printed initializer; a consumer that\n // proves the printed call already returns T (or a subtype) answers false\n csharpDestructuringTempNeedsCast(initializer, printedExpression: string): boolean {\n return true;\n }\n\n // `isTrue (x)` is the identity on a C# `bool`, and `x == true` is what it computes for a `bool?`\n // (null -> false), so in a condition the wrapper adds nothing. The hook answers the emitted\n // declaration's type (getCSharpLocalType, plus classifier retypes); unnamed operands keep isTrue.\n csharpConditionOperandType(node) {\n const declaration = this.csharpReceiverBinding(node);\n if (declaration?.kind !== SyntaxKind.VariableDeclaration) {\n return undefined; // a parameter / member read has no declaration this pass retypes\n }\n if ((declaration.parent as any)?.declarations?.length !== 1) {\n return undefined; // `object a = ..., b = ...` is printed as one statement\n }\n // memoized: the caller asks per operand, getCSharpLocalType scans the scope\n const cached = this.conditionOperandTypes.get(declaration);\n if (cached !== undefined) {\n return (cached === '') ? undefined : cached;\n }\n const type = this.getCSharpLocalType(declaration);\n const result = ((type === 'bool') || (type === 'bool?')) ? type : undefined;\n this.conditionOperandTypes.set(declaration, result ?? '');\n return result;\n }\n\n // the native spelling of a condition operand, or undefined when it needs `isTrue`.\n // `!x == true` would parse as `(!x) == true`, so the `bool?` form takes parentheses\n // under the `!` operator; every other allowed position binds `==` tighter already.\n csharpNativeCondition(node, identation) {\n const type = this.csharpConditionOperandType(node);\n if (type === undefined) {\n return undefined;\n }\n const text = this.printNode(node, 0);\n if (type === 'bool') {\n return this.getIden(identation) + text;\n }\n const equalsTrue = text + ' == true';\n const parent = node.parent;\n const negated = (parent?.kind === SyntaxKind.PrefixUnaryExpression) && (parent.operator === SyntaxKind.ExclamationToken);\n return this.getIden(identation) + (negated ? `(${equalsTrue})` : equalsTrue);\n }\n\n // `!x` on the `bool?` the hook names prints `x != true`: exactly `!(x == true)` (null -> true)\n // and the value isTrue computes for the box. A `bool` operand keeps the base `!x`; an operand\n // the hook cannot name keeps `!isTrue(x)` (the untyped emission is untouched).\n csharpNegatedConditionOperand(operand) {\n if (operand?.kind !== SyntaxKind.Identifier) {\n return undefined;\n }\n if (this.csharpConditionOperandType(operand) !== 'bool?') {\n return undefined;\n }\n return `${this.printNode(operand, 0)} != true`;\n }\n\n // only the if / while / && / || / ! condition positions print natively through this gate; the\n // ternary condition has its own hook-driven fold (csharpTernaryConditionOperand, U56) because\n // its operand is a plain value position the base printCondition path never asks about.\n csharpConditionPositionAllowsNative(node) {\n const parent = node?.parent;\n switch (parent?.kind) {\n case SyntaxKind.IfStatement:\n return parent.expression === node;\n case SyntaxKind.WhileStatement:\n return parent.expression === node;\n case SyntaxKind.PrefixUnaryExpression:\n return (parent.operator === SyntaxKind.ExclamationToken) && (parent.operand === node);\n case SyntaxKind.BinaryExpression: {\n const op = parent.operatorToken?.kind;\n return ((op === SyntaxKind.AmpersandAmpersandToken) || (op === SyntaxKind.BarBarToken))\n && ((parent.left === node) || (parent.right === node));\n }\n }\n return false;\n }\n\n printVariableDeclarationList(node,identation) {\n const declaration = node.declarations[0];\n // const name = declaration.name.text;\n\n if (this.removeVariableDeclarationForFunctionExpression && declaration?.initializer && isFunctionExpression(declaration.initializer)) {\n return this.printNode(declaration.initializer, identation).trimEnd();\n }\n // handle array binding : input: const [a,b] = this.method()\n // output: var abVar = this.method; var a = abVar[0]; var b = abVar[1];\n if (declaration?.name.kind === SyntaxKind.ArrayBindingPattern) {\n const arrayBindingPattern = declaration.name;\n const arrayBindingPatternElements = arrayBindingPattern.elements;\n const parsedArrayBindingElements = arrayBindingPatternElements.map((e) => this.printNode(e.name, 0));\n const syntheticName = parsedArrayBindingElements.join(\"\") + \"Variable\";\n\n // typed holder (see csharpDestructuringTempType): same value, read without the re-cast\n const tempType = this.csharpDestructuringTempType(declaration.initializer);\n const tempExpression = this.printNode(declaration.initializer, 0);\n const tempCast = (tempType && this.csharpDestructuringTempNeedsCast(declaration.initializer, tempExpression)) ? `(${tempType})` : '';\n const tempDeclaration = tempType ? `${tempType} ${syntheticName} = ${tempCast}${tempExpression}` : `var ${syntheticName} = ${tempExpression}`;\n\n let arrayBindingStatement = `${this.getIden(identation)}${tempDeclaration};\\n`;\n\n parsedArrayBindingElements.forEach((e, index) => {\n // const type = this.getType(node);\n // const parsedType = this.getTypeFromRawType(type);\n const statement = this.getIden(identation) + `var ${e} = ` + (tempType ? `${syntheticName}[${index}]` : `((IList) ${syntheticName})[${index}]`);\n if (index < parsedArrayBindingElements.length - 1) {\n arrayBindingStatement += statement + \";\\n\";\n } else {\n // printStatement adds the last ;\n arrayBindingStatement += statement;\n }\n });\n\n return arrayBindingStatement;\n }\n\n const isNew = declaration?.initializer && (declaration.initializer.kind === SyntaxKind.NewExpression);\n\n // handle the let id: Str; case (default undefined initialization)\n if (!declaration.initializer) {\n return this.getIden(identation) + 'object ' + this.printNode(declaration.name) + \" = \" + this.UNDEFINED_TOKEN;\n }\n const parsedValue = this.printNode(declaration.initializer, identation).trimStart();\n if (parsedValue === this.UNDEFINED_TOKEN) {\n let specificVarToken = \"object\";\n if (this.INFER_VAR_TYPE) {\n const variableType = this.getChecker().typeToString(this.getChecker().getTypeAtLocation(declaration));\n if (this.VariableTypeReplacements[variableType]) {\n specificVarToken = this.VariableTypeReplacements[variableType] + '?';\n }\n }\n return this.getIden(identation) + specificVarToken + \" \" + this.printNode(declaration.name) + \" = \" + parsedValue;\n }\n const declaredType = isNew ? 'var' : this.getCSharpLocalType(declaration);\n // remember the concrete types this printer declared itself: the printed prefix is\n // final (a host wrapper only rewrites untyped `object = ` declarations), so\n // the local's static type is known at every later read\n if (!isNew && node.declarations.length === 1 && this.csharpTypeIsNative(declaredType)) {\n this.csharpTypedLocals.set(declaration, declaredType);\n }\n return this.getIden(identation) + declaredType + \" \" + this.printNode(declaration.name) + \" = \" + parsedValue;\n }\n\n transformPropertyAcessExpressionIfNeeded(node) {\n const expression = node.expression;\n const leftSide = this.printNode(expression, 0);\n const rightSide = node.name.text;\n\n let rawExpression = undefined;\n\n switch(rightSide) {\n case 'length':\n const type = (this.getChecker() as Checker).getTypeAtLocation(expression); // eslint-disable-line\n this.warnIfAnyType(node, type.flags, leftSide, \"length\");\n // rawExpression = this.isStringType(type.flags) ? `(string${leftSide}).Length` : `(${leftSide}.Cast().ToList()).Count`;\n rawExpression = this.isStringType(type.flags) ? `${this.csharpStringMethodReceiver(node, leftSide)}.Length` : (this.csharpNativeLengthExpression(expression) ?? `${this.ARRAY_LENGTH_WRAPPER_OPEN}${leftSide}${this.ARRAY_LENGTH_WRAPPER_CLOSE}`); // `(${leftSide}.Cast()).ToList().Count`\n break;\n case 'push':\n rawExpression = `((IList)${leftSide}).Add`;\n break;\n // case 'push':\n // rawExpression = `(List${leftSide}).Add`s\n // break;\n }\n return rawExpression;\n }\n\n printCustomDefaultValueIfNeeded(node) {\n if (isArrayLiteralExpression(node) || isObjectLiteralExpression(node) || isStringLiteral(node) || isBooleanLiteral(node)\n || isNumericLiteral(node)) {\n return this.UNDEFINED_TOKEN;\n }\n\n // convert x: number = undefined (invalid) into x = -1 (valid)\n if (node?.text === \"undefined\" && this.getChecker().getTypeAtLocation(node?.parent)?.flags === TypeFlags.Number) {\n // return \"-1\";\n return this.UNDEFINED_TOKEN;\n }\n\n return undefined;\n }\n\n printFunctionBody(node, identation) {\n\n // check if there is any default parameter to initialize\n const funcParams = node.parameters;\n const initParams = [];\n if (funcParams.length > 0) {\n const body = node.body.statements;\n const first = body.length > 0 ? body[0] : [];\n const remaining = body.length > 0 ? body.slice(1): [];\n let firstStatement = this.printNode(first, identation + 1);\n\n const remainingString = remaining.map((statement) => this.printNode(statement, identation + 1)).join(\"\\n\");\n funcParams.forEach((param) => {\n const initializer = param.initializer;\n if (initializer) {\n if (isArrayLiteralExpression(initializer)) {\n initParams.push(`${this.printNode(param.name, 0)} ??= new List();`);\n }\n if (isObjectLiteralExpression(initializer)) {\n initParams.push(`${this.printNode(param.name, 0)} ??= new Dictionary();`);\n }\n if (isNumericLiteral(initializer) || isStringLiteral(initializer) || isBooleanLiteral(initializer)) {\n initParams.push(`${this.printNode(param.name, 0)} ??= ${this.printNode(initializer, 0)};`);\n }\n }\n });\n\n if (initParams.length > 0) {\n const defaultInitializers = initParams.map( l => this.getIden(identation+1) + l ).join(\"\\n\") + \"\\n\";\n const bodyParts = firstStatement.split(\"\\n\");\n const commentPart = bodyParts.filter(line => this.isComment(line));\n const isComment = commentPart.length > 0;\n if (isComment) {\n const commentPartString = commentPart.map((c) => this.getIden(identation+1) + c.trim()).join(\"\\n\");\n const firstStmNoComment = bodyParts.filter(line => !this.isComment(line)).join(\"\\n\");\n firstStatement = commentPartString + \"\\n\" + defaultInitializers + firstStmNoComment;\n } else {\n firstStatement = defaultInitializers + firstStatement;\n }\n }\n const blockOpen = this.getBlockOpen(identation);\n const blockClose = this.getBlockClose(identation);\n firstStatement = remainingString.length > 0 ? firstStatement + \"\\n\" : firstStatement;\n return blockOpen + firstStatement + remainingString + blockClose;\n }\n\n return super.printFunctionBody(node, identation);\n }\n\n printInstanceOfExpression(node, identation) {\n const left = node.left.text;\n const right = node.right.text;\n return this.getIden(identation) + `${left} is ${right}`;\n }\n\n printAsExpression(node, identation) {\n const type = node.type;\n\n if (type.kind === SyntaxKind.AnyKeyword) {\n return `((object)${this.printNode(node.expression, identation)})`;\n }\n\n if (type.kind === SyntaxKind.StringKeyword) {\n return `((string)${this.printNode(node.expression, identation)})`;\n }\n\n if (type.kind === SyntaxKind.ArrayType) {\n if (type.elementType.kind === SyntaxKind.AnyKeyword) {\n return `(IList)(${this.printNode(node.expression, identation)})`;\n }\n if (type.elementType.kind === SyntaxKind.StringKeyword) {\n // ts 'as string[]' is a compile-time-only assertion with no runtime\n // effect, and C# IList is invariant in BOTH directions: a hard\n // (IList) cast throws on the untyped core's List\n // (ccxt cs ws test lane, https://github.com/ccxt/ccxt/actions/runs/31173663316)\n // while a hard (IList) cast throws on genuinely typed\n // List values (starknet typedData via the paradex broker-id\n // leg, https://github.com/ccxt/ccxt/actions/runs/31322911365). The\n // honest emission is the bare expression, like the fallthrough below.\n return this.printNode(node.expression, identation);\n }\n }\n\n return this.printNode(node.expression, identation);\n }\n\n // A parameter of a method that participates in an override relation prints the spelling its\n // base member and every sibling override agree on (CSHARP_OVERRIDE_PARAM_TYPES; D8): C# is\n // invariant on override parameter types, so a half-retyped name is CS0115, while a name the\n printParameterType(node) {\n if (node === undefined || node.kind !== SyntaxKind.Parameter) {\n return super.printParameterType(node);\n }\n const method: any = findAncestor(node, (n) => isMethodDeclaration(n));\n const name = method === undefined || method.name === undefined ? undefined : method.name.getText().trim();\n const row = name === undefined ? undefined : CSHARP_OVERRIDE_PARAM_TYPES[name as string];\n const wanted = row === undefined ? undefined : row[method.parameters.indexOf(node)];\n if (wanted === undefined || this.csharpOverrideParamSpelling(node) !== wanted) {\n return super.printParameterType(node);\n }\n return wanted;\n }\n\n // checker spelling of a parameter the override table covers: a dictionary-shaped type (string\n // index signature, never a class instance or a callable) or an array of any/dictionary cells\n csharpOverrideParamSpelling(node): string | undefined {\n const type = this.getChecker().getTypeAtLocation(node);\n if (type === undefined || !type.isUnionType()) {\n return this.csharpOverrideParamSpellingOfType(type, 1);\n }\n const arms = type.getTypes().filter((m) => !(m.flags & (TypeFlags.Undefined | TypeFlags.Null)));\n return this.csharpOverrideParamSpellingOfType(arms[0], arms.length);\n }\n\n csharpOverrideParamSpellingOfType(type, unionArms = 1): string | undefined {\n if (type === undefined || unionArms !== 1) {\n return undefined;\n }\n if (type.flags & (TypeFlags.TypeParameter | TypeFlags.Any | TypeFlags.Unknown | TypeFlags.EnumLike)) {\n return undefined;\n }\n const checker = this.getChecker();\n if (checker.isArrayType(type) || checker.isTupleType(type)) {\n const el = (checker.getTypeArguments(type) || [])[0];\n if (el === undefined) {\n return undefined;\n }\n if (el.flags & (TypeFlags.Any | TypeFlags.Unknown)) {\n return 'IList';\n }\n return this.csharpOverrideParamSpellingOfType(el) === 'IDictionary' ? 'IList' : undefined;\n }\n if (checker.getIndexTypeOfType(type, IndexKind.String) === undefined) {\n return undefined;\n }\n const declarations = type.getSymbol()?.declarations ? type.getSymbol().declarations.map((d) => d.resolve()) : [];\n if (declarations.some((d) => d.kind === SyntaxKind.ClassDeclaration)) {\n return undefined; // a class instance is not a JSON dictionary\n }\n if (type.getCallSignatures && type.getCallSignatures().length > 0) {\n return undefined; // a callable is not a JSON dictionary\n }\n return 'IDictionary';\n }\n\n printParameter(node, defaultValue = true) {\n const name = this.printNode(node.name, 0);\n const initializer = node.initializer;\n\n const handlerType = this.csharpHandlerMessageType(node);\n if (handlerType !== undefined) {\n // the printed declaration is final, so every read of the parameter is that\n // dictionary and the member reads replace getValue/getArrayLength/inOp\n this.csharpTypedLocals.set(node, handlerType);\n }\n let type = handlerType !== undefined ? handlerType : this.printParameterType(node);\n type = type ? type : \"\";\n this.csharpParamTypes.set(node, type); // see csharpPrintedParamType\n\n if (defaultValue) {\n if (initializer) {\n const customDefaultValue = this.printCustomDefaultValueIfNeeded(initializer);\n const defaultValue = customDefaultValue ? customDefaultValue : this.printNode(initializer, 0);\n type = (defaultValue === \"null\" && type !== \"object\") ? type + \"? \": type + \" \";\n return type + name + this.SPACE_DEFAULT_PARAM + \"=\" + this.SPACE_DEFAULT_PARAM + defaultValue;\n }\n return type + \" \" + name;\n }\n return name;\n }\n\n // getFunctionType for a call site: TS7's getSignatureFromDeclaration panics on a CallExpression\n // (TS6 returned the resolved call signature there), so resolve the call itself\n csharpCallSiteFunctionType(node) {\n const checker = this.getChecker();\n const type = checker.getReturnTypeOfSignature(checker.getResolvedSignature(node));\n const parsedType = this.getTypeFromRawType(type);\n if (parsedType !== this.PROMISE_TYPE_KEYWORD) {\n return parsedType;\n }\n const typeArguments = checker.getTypeArguments(type as any);\n if (typeArguments.length === 0 || (typeArguments.length === 1 && typeArguments[0].flags === TypeFlags.Void)) {\n return this.PROMISE_TYPE_KEYWORD;\n }\n const insideTypes = typeArguments.map((t) => this.getTypeFromRawType(t)).join(\",\");\n return (insideTypes.length > 0) ? `${this.PROMISE_TYPE_KEYWORD}<${insideTypes}>` : undefined;\n }\n\n printArrayLiteralExpression(node) {\n\n let arrayOpen = this.ARRAY_OPENING_TOKEN;\n const elems = node.elements;\n\n const elements = node.elements.map((e) => this.printNode(e)).join(\", \");\n\n // take into consideration list of promises\n if (elems.length > 0) {\n const first = elems[0];\n if (first.kind === SyntaxKind.CallExpression) {\n // const type = this.getChecker().getTypeAtLocation(first);\n let type = this.csharpCallSiteFunctionType(first);\n // const parsedType = this.getTypeFromRawType(type);\n // parsedType === \"Task\" ||\n // to do check this later\n if (type === undefined || elements.indexOf(this.UKNOWN_PROP_ASYNC_WRAPPER_OPEN) > -1) {\n // if (type === undefined) {\n arrayOpen = \"new List {\";\n // }\n // else {\n // arrayOpen = \"new List> {\";\n // }\n } else {\n type = 'object';\n // check this out later\n // if (type === 'Task>') {\n // type = 'Task';\n // }\n // if (type === 'string'){\n // type = 'object';\n // }\n // type =\n arrayOpen = `new List<${type}> {`;\n }\n }\n }\n\n return arrayOpen + elements + this.ARRAY_CLOSING_TOKEN;\n }\n\n // A method declared `: boolean` / `: boolean | undefined` (or an alias of either) returns a\n // C# `bool` / `bool?` instead of `object`. Only non-async methods with an explicit annotation\n // qualify: `undefined`/`null` union members make the result nullable, any other member (or an\n // inferred type) keeps the upstream `object`. The nullable spelling is what keeps a missing\n // key a missing key — plain `bool` would turn it into `false`.\n csharpBooleanReturnType(node): string | undefined {\n if (node?.kind !== SyntaxKind.MethodDeclaration || this.isAsyncFunction(node)) {\n return undefined;\n }\n if (this.csharpBooleanReturnTypes.has(node)) {\n return this.csharpBooleanReturnTypes.get(node);\n }\n let result: string | undefined = undefined;\n if (node.type) {\n const type = this.getChecker().getTypeFromTypeNode(node.type);\n const members = type.isUnionType() ? type.getTypes() : [ type ];\n let nullable = false;\n let sawBoolean = false;\n let sawOther = false;\n for (const member of members) {\n if (member.flags & (TypeFlags.Undefined | TypeFlags.Null)) {\n nullable = true;\n } else if (member.flags & TypeFlags.BooleanLike) {\n sawBoolean = true;\n } else {\n sawOther = true;\n }\n }\n if (sawBoolean && !sawOther) {\n result = nullable ? this.BOOLEAN_KEYWORD + '?' : this.BOOLEAN_KEYWORD;\n }\n } else {\n // an un-annotated override inherits the parent's printed return type\n // (printMethodDefinition), so its returns need the same unboxing\n result = this.csharpBooleanReturnType(this.getMethodOverride(node));\n }\n this.csharpBooleanReturnTypes.set(node, result);\n return result;\n }\n\n printFunctionType(node) {\n const booleanType = this.csharpBooleanReturnType(node);\n if (booleanType !== undefined) {\n return booleanType;\n }\n return super.printFunctionType(node);\n }\n\n // `return x;` inside a bool/bool? method: the printed expression is still the `object`\n // box the rest of the printer produces, so unbox it through `object`. The nullable\n // spelling `(bool?)((object)(x))` accepts null; the non-nullable one needs the\n // null-forgiving `!` on the box (CS8605 under TreatWarningsAsErrors otherwise) — which is\n // exactly the runtime NullReferenceException a `: boolean` method returning null deserves\n printReturnStatement(node, identation) {\n // nearest function-like: a `return` inside an arrow/function expression belongs to\n // that callback, never to the enclosing bool method\n const booleanType = this.csharpBooleanReturnType(findAncestor(node.parent, isFunctionLike));\n if (booleanType === undefined || !node.expression) {\n return super.printReturnStatement(node, identation);\n }\n const leadingComment = this.printLeadingComments(node, identation);\n let trailingComment = this.printTraillingComment(node, identation);\n trailingComment = trailingComment ? \" \" + trailingComment : trailingComment;\n const value = this.printNode(node.expression, identation).trim();\n const forgiving = booleanType.endsWith('?') ? '' : '!';\n return leadingComment + this.getIden(identation) + this.RETURN_TOKEN + ` ((${booleanType})((object)(${value}))${forgiving})` + this.LINE_TERMINATOR + trailingComment;\n }\n\n printMethodDefinition(node, identation) {\n let name = node.name.text;\n name = this.transformMethodNameIfNeeded(name);\n\n let returnType = this.printFunctionType(node);\n\n let modifiers = this.printModifiers(node);\n const defaultAccess = this.METHOD_DEFAULT_ACCESS ? this.METHOD_DEFAULT_ACCESS + \" \": \"\";\n modifiers = modifiers ? modifiers + \" \" : defaultAccess; // tmp check this\n\n modifiers = modifiers.indexOf(\"public\") === -1 && modifiers.indexOf(\"private\") === -1 && modifiers.indexOf(\"protected\") === -1 ? defaultAccess + modifiers : modifiers;\n\n let parsedArgs = undefined;\n // c# only move this elsewhere (csharp transpiler)\n const methodOverride = this.getMethodOverride(node) as any;\n const isOverride = methodOverride !== undefined;\n modifiers = isOverride ? modifiers + \"override \" : modifiers + \"virtual \";\n\n // infer parent return type\n if (isOverride && (returnType === \"object\" || returnType === \"Task\")) {\n returnType = this.printFunctionType(methodOverride);\n }\n\n // ts does not infer parameters types of overriden methods :x , so we need some\n // heuristic here to infer the types\n if (isOverride && node.parameters.length > 0) {\n const first = node.parameters[0];\n const firstType = this.getType(first);\n\n if (firstType === undefined) {\n // use the override version, check this out later\n // parsedArgs = this.printMethodParameters(methodOverride);\n const currentArgs = node.parameters;\n const parentArgs = methodOverride.parameters;\n parsedArgs = parentArgs.map((param, index) => this.printParameteCustomName(param, this.printNode(currentArgs[index].name, 0))).join(\", \");\n }\n }\n\n parsedArgs = parsedArgs ? parsedArgs : this.printMethodParameters(node);\n\n returnType = returnType ? returnType + \" \" : returnType;\n\n const methodToken = this.METHOD_TOKEN ? this.METHOD_TOKEN + \" \" : \"\";\n const methodDef = this.getIden(identation) + modifiers + returnType + methodToken + name\n + \"(\" + parsedArgs + \")\";\n\n return this.printNodeCommentsIfAny(node, identation, methodDef);\n }\n\n // check this out later\n\n printArrayIsArrayCall(node, identation, parsedArg = undefined) {\n return `((${parsedArg} is IList) || (${parsedArg}.GetType().IsGenericType && ${parsedArg}.GetType().GetGenericTypeDefinition().IsAssignableFrom(typeof(List<>))))`;\n }\n\n printObjectKeysCall(node, identation, parsedArg = undefined) {\n // `Object.keys(x)` on a receiver the classifier declared a concrete dictionary: the\n // cast only named the box; `.Keys` is the same collection either way\n if ((node?.arguments?.length === 1) && this.csharpReceiverIsDeclaredDictionary(node.arguments[0])) {\n return `new List(${parsedArg}.Keys)`;\n }\n return `new List(((IDictionary)${parsedArg}).Keys)`;\n }\n\n printObjectValuesCall(node, identation, parsedArg = undefined) {\n if ((node?.arguments?.length === 1) && this.csharpReceiverIsDeclaredDictionary(node.arguments[0])) {\n return `new List(${parsedArg}.Values)`;\n }\n return `new List(((IDictionary)${parsedArg}).Values)`;\n }\n\n printJsonParseCall(node, identation, parsedArg = undefined) {\n return `parseJson(${parsedArg})`;\n }\n\n printJsonStringifyCall(node, identation, parsedArg = undefined) {\n return `json(${parsedArg})`; // make this customizable\n }\n\n printPromiseAllCall(node, identation, parsedArg = undefined) {\n return `promiseAll(${parsedArg})`;\n }\n\n printMathFloorCall(node, identation, parsedArg = undefined) {\n return `(Math.Floor(Double.Parse((${parsedArg}).ToString())))`;\n }\n\n printMathRoundCall(node, identation, parsedArg = undefined) {\n return `Math.Round(Convert.ToDouble(${parsedArg}))`;\n }\n\n printMathCeilCall(node, identation, parsedArg = undefined) {\n return `Math.Ceiling(Convert.ToDouble(${parsedArg}))`;\n }\n\n printNumberIsIntegerCall(node: any, identation: any, parsedArg?: any) {\n return `((${parsedArg} is int) || (${parsedArg} is long) || (${parsedArg} is Int32) || (${parsedArg} is Int64))`;\n }\n\n printArrayPushCall(node, identation, name = undefined, parsedArg = undefined) {\n // `x.push (v)` on a receiver whose printed declaration already IS a list needs no cast:\n // (IList)x is an identity conversion and `.Add` binds the same ICollection.Add.\n // An `object` receiver (and every receiver this printer cannot name) keeps the cast.\n if (this.csharpReceiverIsDeclaredList(node?.expression?.expression)) {\n return `${name}.Add(${parsedArg})`;\n }\n return `((IList)${name}).Add(${parsedArg})`;\n }\n\n // The C# type the emitted declaration gives a local / operand read (`string`, `List`,\n // `Dictionary`, ...), or undefined. Installed by build/csharp-local-types.js, which\n // retypes the declaration AFTER printing. Undefined by default: callers keep the helper form.\n csharpLocalTypeOf(node): string | undefined {\n return undefined;\n }\n\n // U55: the emitted C# type of an identifier operand of a null comparison, installed by\n // build/csharp-local-types.js from the PRINTED declaration lines (retyped after printing, so the\n // printer cannot see it). Undefined by default: every null comparison keeps isEqual unchanged.\n csharpNullComparisonTypeOf(node): string | undefined {\n return undefined;\n }\n\n // `add (x, y)` -> `(x + y)` when the classifier proves the LEFT operand's emitted declaration is a\n // string (U57): add(string, string) / add(string, object) compute exactly C# concatenation, nulls\n // included. Undefined keeps the helper; parenthesised because `+` binds looser in embedded text.\n csharpNativeStringConcat(left, right, leftText: string, rightText: string): string | undefined {\n return undefined;\n }\n\n // The emitted declaration type of a local read the embedding build layer retypes AFTER\n // printing (ccxt: build/csharp-local-types.js): the dict type for the `key in x` rule,\n // undefined for every receiver it does not retype. Undefined by default.\n csharpDeclaredDictReceiverType(node): string | undefined {\n return undefined;\n }\n\n // is this receiver expression, as printed, a local declared List /\n // IList? Only a bare identifier reads the type hook; a parameter (printed\n // `object`), a member read and every composite expression keep the cast.\n csharpReceiverIsDeclaredList(receiver): boolean {\n if (receiver?.kind !== SyntaxKind.Identifier) {\n return false;\n }\n const type = (typeof this.csharpLocalTypeOf === 'function') ? this.csharpLocalTypeOf(receiver) : undefined;\n return (type === 'List') || (type === 'IList');\n }\n\n printIncludesCall(node, identation, name = undefined, parsedArg = undefined) {\n return `${name}.Contains(${parsedArg})`;\n }\n\n // `x.indexOf (y)` prints `x`'s own member when the printer proves the receiver holds a\n // string or a list at this read and can name that C# type; every other receiver keeps the\n // runtime getIndexOf helper, which is the only form that answers -1 for a null box.\n printIndexOfCall(node, identation, name = undefined, parsedArg = undefined) {\n const native = this.csharpNativeIndexOfCall(node, name, parsedArg);\n if (native !== undefined) {\n return native;\n }\n return `${this.INDEXOF_WRAPPER_OPEN}${name}, ${parsedArg}${this.INDEXOF_WRAPPER_CLOSE}`;\n }\n\n // the helper's `(string)` branch spelled natively: `((string)x).IndexOf(needle, Ordinal)` is\n // the ordinal scan TS indexOf performs (not-found stays -1, an empty needle stays 0); a\n // `List` local takes its own IndexOf, a possibly-null box keeps the helper\n csharpNativeIndexOfCall(node, name = undefined, parsedArg = undefined): string | undefined {\n const receiver = node?.expression?.expression;\n if (receiver === undefined || name === undefined) {\n return undefined;\n }\n const declared = this.csharpExpressionTypeOf(receiver);\n if (this.csharpIndexOfReceiverHoldsString(node, receiver, declared)) {\n const needle = this.csharpNativeIndexOfNeedle(node.arguments?.[0], parsedArg);\n if (needle === undefined) {\n return undefined;\n }\n // the helper's own `((string)str)` cast; a cast the printer already emitted is final\n const casted = name.startsWith('((string)') ? name : `((string)${name})`;\n return `${casted}.IndexOf(${needle}, StringComparison.Ordinal)`;\n }\n if ((declared === 'List') || (declared === 'IList')) {\n return `((${declared})${name}).IndexOf(${parsedArg})`;\n }\n // a `string?` local holds a string or null: `?.` answers the helper's -1 for null; the\n // needle is a literal or a local, so skipping its evaluation on null changes nothing\n const key = node.arguments?.[0];\n const plainNeedle = (key !== undefined) && (isStringLiteralLikeNode(key) || isIdentifier(key));\n if ((declared === 'string?') && isIdentifier(receiver) && plainNeedle) {\n const needle = this.csharpNativeIndexOfNeedle(node.arguments?.[0], parsedArg);\n if (needle !== undefined) {\n return `(${name}?.IndexOf(${needle}, StringComparison.Ordinal) ?? -1)`;\n }\n }\n return undefined;\n }\n\n // the receiver is a string the helper would scan and no null can reach the read: a C#\n // `string` declaration, a checker `string`/literal whose own declaration is a plain\n // non-optional `string` (`as string` included), or a value a `!== undefined` test admits\n csharpIndexOfReceiverHoldsString(node, receiver, declared): boolean {\n if (declared === 'string') {\n return true;\n }\n if ((declared !== undefined) && (declared !== 'string?')) {\n return false; // a named C# type that is not a string\n }\n if (!this.csharpIndexOfReceiverIsCheckedString(receiver)) {\n return false;\n }\n return this.csharpNullGuardAdmitsRead(node, receiver) || ((declared === undefined) && this.csharpReceiverDeclaredNonNullString(receiver));\n }\n\n // the checker's view of the receiver: exactly `string` / a string literal. `any` (could box\n // anything) and `string[]` (boxes a List where the helper casts its target) are not\n csharpIndexOfReceiverIsCheckedString(receiver): boolean {\n const checker: any = this.checkerOrUndefined();\n if (checker === undefined) {\n return false; // in-memory program without a checker\n }\n const type = checker.getTypeAtLocation(receiver);\n return this.isStringType(type?.flags);\n }\n\n // the receiver's own declaration says non-optional `string` (params, fields, locals), or the\n // source pinned a string itself (a literal, an `as string` assertion). The `Str` alias and\n // `= undefined` fields hold the undefined the helper answers -1 for: they need the guard\n csharpReceiverDeclaredNonNullString(receiver): boolean {\n const kind = receiver?.kind;\n if ((kind === SyntaxKind.StringLiteral) || (kind === SyntaxKind.NoSubstitutionTemplateLiteral)) {\n return true;\n }\n if (kind === SyntaxKind.ParenthesizedExpression) {\n return this.csharpReceiverDeclaredNonNullString(receiver.expression);\n }\n if ((kind === SyntaxKind.AsExpression) && (receiver.type?.kind === SyntaxKind.StringKeyword)) {\n return true; // the source itself pinned a string here\n }\n const checker: any = this.checkerOrUndefined();\n if (checker === undefined) {\n return false;\n }\n const symbol = checker.getSymbolAtLocation(receiver);\n const declarations: any[] = (symbol?.declarations ?? []).map((d) => d.resolve());\n return (declarations.length > 0) && declarations.every((declaration) => this.csharpDeclarationIsNonNullString(declaration));\n }\n\n csharpDeclarationIsNonNullString(declaration): boolean {\n const annotation: any = declaration?.type;\n if (declaration?.kind === SyntaxKind.Parameter) {\n return (declaration.questionToken === undefined) && (declaration.dotDotDotToken === undefined)\n && ((annotation?.kind === SyntaxKind.StringKeyword) || ((annotation === undefined) && isStringLiteralLikeNode(declaration.initializer)));\n }\n const isField = isPropertyDeclaration(declaration) || isPropertySignatureDeclaration(declaration);\n if (isVariableDeclaration(declaration) || isField) {\n if ((declaration as any).questionToken !== undefined) {\n return false;\n }\n if (annotation !== undefined) {\n // `apiKey: string = undefined` holds undefined until the credentials are set\n return (annotation.kind === SyntaxKind.StringKeyword) && !this.csharpInitializerIsUndefined((declaration as any).initializer);\n }\n return isStringLiteralLikeNode((declaration as any).initializer);\n }\n return false;\n }\n\n csharpInitializerIsUndefined(initializer): boolean {\n return (initializer?.kind === SyntaxKind.NullKeyword)\n || ((initializer?.kind === SyntaxKind.Identifier) && (initializer.text === 'undefined'));\n }\n\n // a `x !== undefined` / `x !== null` (or `!= null`) test in a branch that admits the read:\n // inside the right operand of its `&&`, inside the then-branch of its `if`, or after an\n // early-exiting `if (x === undefined) { return/throw/continue/break }`\n csharpNullGuardAdmitsRead(node, receiver): boolean {\n if (!isIdentifier(receiver)) {\n return false;\n }\n const checker: any = this.checkerOrUndefined();\n if (checker === undefined) {\n return false;\n }\n const symbol = checker.getSymbolAtLocation(receiver);\n if (symbol === undefined) {\n return false;\n }\n const scope = this.csharpEnclosingFunction(node);\n let current: any = node;\n while (current !== undefined) {\n const parent: any = current.parent;\n if (parent === undefined) {\n return false;\n }\n if ((parent.kind === SyntaxKind.BinaryExpression) && (parent.operatorToken.kind === SyntaxKind.AmpersandAmpersandToken)\n && this.csharpContains(parent.right, current) && this.csharpTestIsNonNullCheck(parent.left, symbol, true)) {\n return true;\n }\n if (parent.kind === SyntaxKind.IfStatement) {\n if (this.csharpContains(parent.thenStatement, current) && this.csharpTestIsNonNullCheck(parent.expression, symbol, true)) {\n return true;\n }\n if (this.csharpContains(parent.elseStatement, current) && this.csharpTestIsNonNullCheck(parent.expression, symbol, false)) {\n return true;\n }\n }\n if ((isBlock(parent) || isSourceFile(parent)) && this.csharpEarlyExitNonNullGuarded(parent, current, symbol, scope)) {\n return true;\n }\n if (this.csharpIsFunctionLike(parent)) {\n return false; // a guard outside this function cannot dominate a read inside it\n }\n current = parent;\n }\n return false;\n }\n\n csharpIsFunctionLike(node): boolean {\n switch (node?.kind) {\n case SyntaxKind.MethodDeclaration:\n case SyntaxKind.FunctionDeclaration:\n case SyntaxKind.FunctionExpression:\n case SyntaxKind.ArrowFunction:\n case SyntaxKind.Constructor:\n return true;\n }\n return false;\n }\n\n // `if (x === undefined) { return/throw/... }` (or the same test with an exiting else) in the\n // same block, with no write to x in between: every statement after it runs with x bound\n csharpEarlyExitNonNullGuarded(block, statement, symbol, scope): boolean {\n for (const sibling of block.statements) {\n if (sibling.getStart() >= statement.getStart()) {\n return false;\n }\n if (!isIfStatement(sibling)) {\n continue;\n }\n const exitsOnNull = this.csharpTestIsNonNullCheck(sibling.expression, symbol, false) && this.csharpAlwaysExits(sibling.thenStatement);\n const continuesOnNonNull = this.csharpTestIsNonNullCheck(sibling.expression, symbol, true) && this.csharpAlwaysExits(sibling.elseStatement);\n if ((exitsOnNull || continuesOnNonNull) && !this.csharpReceiverWrittenBetween(scope, sibling.getEnd(), statement.getStart(), symbol)) {\n return true;\n }\n }\n return false;\n }\n\n // the test proves the binding non-null when it evaluates to `truthy`: `x != null`, `x !==\n // undefined` (either operand order), and both sides of an `&&` (a false `||`). Everything\n // else — `any` comparisons, a different binding — proves nothing\n csharpTestIsNonNullCheck(test, symbol, truthy): boolean {\n switch (test?.kind) {\n case SyntaxKind.ParenthesizedExpression:\n return this.csharpTestIsNonNullCheck(test.expression, symbol, truthy);\n case SyntaxKind.PrefixUnaryExpression:\n return (test.operator === SyntaxKind.ExclamationToken) && this.csharpTestIsNonNullCheck(test.operand, symbol, !truthy);\n case SyntaxKind.BinaryExpression: {\n const op = test.operatorToken.kind;\n if (op === SyntaxKind.AmpersandAmpersandToken) {\n return truthy && (this.csharpTestIsNonNullCheck(test.left, symbol, true) || this.csharpTestIsNonNullCheck(test.right, symbol, true));\n }\n if (op === SyntaxKind.BarBarToken) {\n return !truthy && (this.csharpTestIsNonNullCheck(test.left, symbol, false) || this.csharpTestIsNonNullCheck(test.right, symbol, false));\n }\n const inequality = (op === SyntaxKind.ExclamationEqualsToken) || (op === SyntaxKind.ExclamationEqualsEqualsToken);\n const isNullTest = (op === SyntaxKind.EqualsEqualsToken) || (op === SyntaxKind.EqualsEqualsEqualsToken) || inequality;\n if (!isNullTest || (truthy !== inequality)) {\n return false;\n }\n const tested = isIdentifier(test.left) ? test.left : test.right;\n const literal = isIdentifier(test.left) ? test.right : test.left;\n return isIdentifier(tested) && this.csharpInitializerIsUndefined(literal) && this.csharpSameBinding(tested, symbol);\n }\n }\n return false;\n }\n\n csharpSameBinding(node, symbol): boolean {\n try {\n const resolved = this.getChecker().getSymbolAtLocation(node);\n return (resolved !== undefined) && (resolved === symbol);\n } catch (e) {\n return false;\n }\n }\n\n // any write to the same binding inside the window voids a dominance proof\n csharpReceiverWrittenBetween(scope, from: number, to: number, symbol): boolean {\n if (scope === undefined) {\n return true;\n }\n let written = false;\n const visit = (n: any) => {\n if (written || (n.getStart() >= to) || (n.getEnd() <= from)) {\n return;\n }\n if (isIdentifier(n) && this.csharpIsWriteTarget(n) && this.csharpSameBinding(n, symbol)) {\n written = true;\n return;\n }\n n.forEachChild(visit);\n };\n scope.forEachChild(visit);\n return written;\n }\n\n // the C# string the native `IndexOf` takes as its needle: a value the printer types a C#\n // string prints as-is, an `object`-printed operand takes the helper's own `(string)` cast.\n // A value of any other named C# type (number, bool, collection) keeps the helper\n csharpNativeIndexOfNeedle(key, printed = undefined): string | undefined {\n if (key === undefined || printed === undefined) {\n return undefined;\n }\n const keyType = this.csharpExpressionTypeOf(key);\n if (keyType === 'string') {\n return printed;\n }\n return ((keyType === undefined) || (keyType === 'string?')) ? `((string)${printed})` : undefined;\n }\n\n printSearchCall(node, identation, name = undefined, parsedArg = undefined) {\n return `((string)${name}).IndexOf(${parsedArg})`;\n }\n\n printStartsWithCall(node, identation, name = undefined, parsedArg = undefined) {\n return `((string)${name}).StartsWith(((string)${parsedArg}))`;\n }\n\n printEndsWithCall(node, identation, name = undefined, parsedArg = undefined) {\n return `((string)${name}).EndsWith(((string)${parsedArg}))`;\n }\n\n printTrimCall(node, identation, name = undefined) {\n return `${this.csharpStringMethodReceiver(node, name)}.Trim()`;\n }\n\n printJoinCall(node, identation, name = undefined, parsedArg = undefined) {\n return `String.Join(${parsedArg}, ((IList)${name}).ToArray())`;\n }\n\n printSplitCall(node, identation, name = undefined, parsedArg = undefined) {\n return `${this.csharpStringMethodReceiver(node, name)}.Split(new [] {((string)${parsedArg})}, StringSplitOptions.None).ToList()`;\n }\n\n printConcatCall(node, identation, name = undefined, parsedArg = undefined) {\n return `concat(${name}, ${parsedArg})`;\n }\n\n printToFixedCall(node, identation, name = undefined, parsedArg = undefined) {\n return `toFixed(${name}, ${parsedArg})`;\n }\n\n printToStringCall(node, identation, name = undefined) {\n return `((object)${name}).ToString()`;\n }\n\n printToUpperCaseCall(node, identation, name = undefined) {\n return `${this.csharpStringMethodReceiver(node, name)}.ToUpper()`;\n }\n\n printToLowerCaseCall(node, identation, name = undefined) {\n return `${this.csharpStringMethodReceiver(node, name)}.ToLower()`;\n }\n\n printShiftCall(node, identation, name = undefined) {\n return `((IList)${name}).First()`;\n }\n\n printReverseCall(node, identation, name = undefined) {\n return `${name} = (${name} as IList).Reverse().ToList()`;\n }\n\n printPopCall(node, identation, name = undefined) {\n return `((IList)${name}).Last()`;\n }\n\n printSliceCall(node, identation, name = undefined, parsedArg = undefined, parsedArg2 = undefined) {\n const nativeCall = this.csharpNativeSliceCall(node, name);\n if (nativeCall !== undefined) {\n return nativeCall;\n }\n if (parsedArg2 === undefined){\n // return `((string)${name}).Substring((int)${parsedArg})`;\n parsedArg2 = 'null';\n }\n // return `((string)${name})[((int)${parsedArg})..((int)${parsedArg2})]`;\n return `slice(${name}, ${parsedArg}, ${parsedArg2})`;\n }\n\n // `x.slice (a, b)` -> Substring / GetRange when x is a checker-proven string (or a printer-declared\n // `List`) and every bound is an integer literal: JS clamps bounds into [0, length] where C#\n // throws, so literals are clamped with Math.Min / Math.Max. Anything unproven keeps the helper.\n csharpNativeSliceCall(node, name) {\n const args = node?.arguments ?? [];\n if ((args.length < 1) || (args.length > 2)) {\n return undefined;\n }\n const start = this.csharpSliceLiteralBound(args[0]);\n if (start === undefined) {\n return undefined;\n }\n const hasEnd = args.length === 2;\n const end = hasEnd ? this.csharpSliceLiteralBound(args[1]) : undefined;\n if (hasEnd && (end === undefined)) {\n return undefined;\n }\n // x.slice (a, b) prints through this method for the CALL, so the receiver is `.expression.expression`\n const receiver = isPropertyAccessExpression(node?.expression) ? node.expression.expression : undefined;\n if (!this.csharpSliceReceiverIsSideEffectFree(receiver)) {\n return undefined;\n }\n const kind = this.csharpSliceReceiverKind(receiver);\n if (kind === undefined) {\n return undefined;\n }\n const isString = (kind === 'string');\n // `(id as string)` already prints `((string)id)`: a second cast would only add parens\n const cast = (isString && name.startsWith('((string)')) ? name : `((${isString ? 'string' : 'List'})${name})`;\n const length = `${cast}.${isString ? 'Length' : 'Count'}`;\n const from = this.csharpSliceBoundExpression(start, length);\n // the null guard reproduces the helper's null -> null result for a null receiver; the\n // whole emission is parenthesised because a ternary binds looser than the `+` / `+` chain\n // the printer may wrap this call in\n const guard = `(${this.csharpNullComparison(name, true)} ? null : `;\n const method = isString ? 'Substring' : 'GetRange';\n if (!hasEnd) {\n // the open end is the length itself: `Substring (from)` and `GetRange (from, length - from)`\n const open = isString ? `Substring(${from})` : `GetRange(${from}, ${from === '0' ? length : `${length} - ${from}`})`;\n return `${guard}${cast}.${open})`;\n }\n const to = this.csharpSliceBoundExpression(end, length);\n // from <= to is proven per case: 0 is never above a clamp, and two literals clamp\n // monotonically once they keep their order (non-negative, or both counting from the end)\n const ordered = (start === 0) || ((start >= 0) && (end >= 0) && (start <= end)) || ((start < 0) && (end < 0) && (start <= end));\n let count;\n if (from === to) {\n count = '0'; // two bounds that clamp to the same index: an empty result\n } else if (from === '0') {\n count = to; // from 0: the clamped end IS the count\n } else {\n // an inverted pair yields an empty slice in JS, so the count never goes below 0\n count = ordered ? `${to} - ${from}` : `Math.Max(${to} - ${from}, 0)`;\n }\n return `${guard}${cast}.${method}(${from}, ${count}))`;\n }\n\n // Integer value of a slice bound that is an integer literal (`18`, `-64`); anything\n // else (expression, float, exponent, out of int range) keeps the helper — the bounds\n // are clamped with the integer Math.Min / Math.Max of the native form.\n csharpSliceLiteralBound(node) {\n if (node === undefined) {\n return undefined;\n }\n if (isNumericLiteral(node)) {\n const text = String(node.text);\n if ((text.indexOf('.') !== -1) || (text.indexOf('e') !== -1) || (text.indexOf('E') !== -1)) {\n return undefined;\n }\n const value = Number(text);\n return value <= 2147483647 ? value : undefined;\n }\n if (isPrefixUnaryExpression(node) && (node.operator === SyntaxKind.MinusToken)) {\n const inner = this.csharpSliceLiteralBound(node.operand);\n return inner === undefined ? undefined : -inner;\n }\n return undefined;\n }\n\n // JS slice clamps a literal bound into [0, length]: a non-negative bound is min\n // (bound, length), a negative one counts from the end (max (length - |bound|, 0)).\n // `0` stays `0` because the length of a string / list is never negative.\n csharpSliceBoundExpression(value, length) {\n if (value === 0) {\n return '0';\n }\n return value > 0 ? `Math.Min(${value}, ${length})` : `Math.Max(${length} - ${-value}, 0)`;\n }\n\n // The receiver of a native slice: a `List` the printer / build layer declared (the only\n // receiver with GetRange), or a CHECKER-proven string (`string`, a literal, or a union with\n // null / undefined such as ccxt's `Str`); `any`, Dict and every other type keep the helper.\n csharpSliceReceiverKind(expression) {\n // a declared `List` (printer table or the embedding build layer's retype) is the\n // only receiver carrying a native bounding accessor, GetRange\n const declared = (isIdentifier(expression) ? this.csharpTypedLocalType(expression) : undefined) ?? this.csharpExpressionTypeOf(expression);\n if (declared === 'List') {\n return 'list';\n }\n const checker: any = this.checkerOrUndefined();\n if (checker === undefined) {\n return undefined;\n }\n const type = checker.getTypeAtLocation(expression);\n return this.csharpSliceStringType(type) ? 'string' : undefined;\n }\n\n // the checker's string view of a slice receiver: a string type, or a union of string\n // members and nullish ones only. `boolean | string`, `any` and every unproven shape fail\n csharpSliceStringType(type): boolean {\n if (this.isStringType(type?.flags)) {\n return true;\n }\n if (type?.flags !== TypeFlags.Union) {\n return false;\n }\n const members = type.getTypes?.() ?? [];\n return (members.length > 0) && members.every((member) => this.isStringType(member.flags)\n || (member.flags === TypeFlags.Undefined) || (member.flags === TypeFlags.Null));\n }\n\n // True for receivers that read a value without calling anything: `x`, `x.y`, `this.x`,\n // `(x as string)` and parenthesised forms of those. Guards the repeated receiver read —\n // the clamp reads `Length` / `Count` and the call itself reads the receiver again.\n csharpSliceReceiverIsSideEffectFree(expression): boolean {\n if (expression === undefined) {\n return false;\n }\n if (isIdentifier(expression) || (expression.kind === SyntaxKind.ThisKeyword)) {\n return true;\n }\n if (isParenthesizedExpression(expression) || isAsExpression(expression) || isTypeAssertion(expression)\n || isPropertyAccessExpression(expression)) {\n return this.csharpSliceReceiverIsSideEffectFree(expression.expression);\n }\n return false;\n }\n\n printReplaceCall(node, identation, name = undefined, parsedArg = undefined, parsedArg2 = undefined) {\n return `${this.csharpStringMethodReceiver(node, name)}.Replace((string)${parsedArg}, (string)${parsedArg2})`;\n }\n\n printReplaceAllCall(node, identation, name = undefined, parsedArg = undefined, parsedArg2 = undefined) {\n return `${this.csharpStringMethodReceiver(node, name)}.Replace((string)${parsedArg}, (string)${parsedArg2})`;\n }\n\n printPadEndCall(node, identation, name, parsedArg, parsedArg2) {\n return `(${name} as String).PadRight(Convert.ToInt32(${parsedArg}), Convert.ToChar(${parsedArg2}))`;\n }\n\n printPadStartCall(node, identation, name, parsedArg, parsedArg2) {\n return `(${name} as String).PadLeft(Convert.ToInt32(${parsedArg}), Convert.ToChar(${parsedArg2}))`;\n }\n\n printDateNowCall(node, identation) {\n return \"(new DateTimeOffset(DateTime.UtcNow)).ToUnixTimeMilliseconds()\";\n }\n\n printLengthProperty(node, identation, name = undefined) {\n const leftSide = this.printNode(node.expression, 0);\n const type = (this.getChecker() as Checker).getTypeAtLocation(node.expression); // eslint-disable-line\n this.warnIfAnyType(node, type.flags, leftSide, \"length\");\n return this.isStringType(type.flags) ? `${this.csharpStringMethodReceiver(node, leftSide)}.Length` : (this.csharpNativeLengthExpression(node.expression) ?? `${this.ARRAY_LENGTH_WRAPPER_OPEN}${leftSide}${this.ARRAY_LENGTH_WRAPPER_CLOSE}`);\n }\n\n // A for-header incrementor discards the postfix value, so an operand whose printed C# type is `int`\n // takes the native operator: the same unchecked +1 / -1 as the (ref int) helper twin. Any other\n // operand keeps the helper, whose overload set binds an `object` counter.\n csharpNativePostFixIncrement(node): boolean {\n if (node.operand?.kind !== SyntaxKind.Identifier) {\n return false;\n }\n const parent = node.parent;\n if (parent?.kind !== SyntaxKind.ForStatement || parent.incrementor !== node) {\n return false;\n }\n return this.csharpExpressionTypeOf(node.operand) === 'int';\n }\n\n printPostFixUnaryExpression(node, identation) {\n const {operand, operator} = node;\n if (operand.kind === SyntaxKind.NumericLiteral) {\n return super.printPostFixUnaryExpression(node, identation);\n }\n const leftSide = this.printNode(operand, 0);\n const op = this.PostFixOperators[operator]; // todo: handle --\n if (this.csharpNativePostFixIncrement(node)) {\n return `${leftSide}${op}`;\n }\n return (op === '--') ? `postFixDecrement(ref ${leftSide})` : `postFixIncrement(ref ${leftSide})`;\n }\n\n printPrefixUnaryExpression(node, identation) {\n const {operand, operator} = node;\n if (operand.kind === SyntaxKind.NumericLiteral) {\n return super.printPrefixUnaryExpression(node, identation);\n }\n if (operator === SyntaxKind.ExclamationToken) {\n // not branch check falsy/turthy values if needed;\n const nativeNot = this.csharpNegatedConditionOperand(operand);\n if (nativeNot !== undefined) {\n return nativeNot;\n }\n return this.PrefixFixOperators[operator] + this.printCondition(node.operand, 0);\n }\n const leftSide = this.printNode(operand, 0);\n if (operator === SyntaxKind.PlusToken) {\n return `prefixUnaryPlus(ref ${leftSide})`;\n }\n const nativeNegation = this.csharpNativeNegatedLocal(operand, leftSide) ?? this.csharpHx4NativeNegatedNullableLocal(node, leftSide);\n if (nativeNegation !== undefined) {\n return nativeNegation;\n }\n return `prefixUnaryNeg(ref ${leftSide})`;\n }\n\n // `isTrue(x)` is the identity function on a C# bool (`isTrue` returns a bool unchanged),\n // so the wrapper is only needed for values the printer leaves boxed as `object`. Every\n // shape below is rendered as a C# bool by the printer itself; anything else keeps the helper.\n csharpConditionPrintsBool(node): boolean {\n switch (node?.kind) {\n case SyntaxKind.TrueKeyword:\n case SyntaxKind.FalseKeyword:\n return true; // `true` / `false`\n case SyntaxKind.ParenthesizedExpression:\n return this.csharpConditionPrintsBool(node.expression);\n case SyntaxKind.PrefixUnaryExpression:\n // `!x` prints `!isTrue(x)`, and printCondition always returns a bool\n return node.operator === SyntaxKind.ExclamationToken;\n case SyntaxKind.BinaryExpression:\n return this.csharpBinaryExpressionPrintsBool(node);\n case SyntaxKind.Identifier:\n return this.csharpIdentifierPrintsBool(node);\n case SyntaxKind.PropertyAccessExpression:\n return this.csharpFieldPrintsBool(node);\n case SyntaxKind.CallExpression:\n return this.csharpCallPrintsBool(node);\n }\n return false;\n }\n\n // `this.` reads of the hand-written BaseExchange bool fields: the field is declared\n // `bool` there, so a checker-typed plain boolean read is a C# bool the condition can use bare\n csharpFieldPrintsBool(node): boolean {\n if (node.expression?.kind !== SyntaxKind.ThisKeyword) {\n return false;\n }\n return (CSHARP_NATIVE_BOOL_FIELDS.indexOf(node.name?.text as string) >= 0) && this.csharpIsCheckedBoolean(node);\n }\n\n // isEqual / !isEqual / isGreaterThan / ... / inOp all have a C# `bool` signature, a\n // `&&` / `||` prints both operands through printCondition, i.e. as bool themselves, and\n // `x instanceof T` prints the C# type test ` is `, itself a bool\n csharpBinaryExpressionPrintsBool(node): boolean {\n switch (node.operatorToken.kind) {\n case SyntaxKind.EqualsEqualsToken:\n case SyntaxKind.EqualsEqualsEqualsToken:\n case SyntaxKind.ExclamationEqualsToken:\n case SyntaxKind.ExclamationEqualsEqualsToken:\n case SyntaxKind.GreaterThanToken:\n case SyntaxKind.GreaterThanEqualsToken:\n case SyntaxKind.LessThanToken:\n case SyntaxKind.LessThanEqualsToken:\n case SyntaxKind.InKeyword:\n case SyntaxKind.InstanceOfKeyword:\n case SyntaxKind.BarBarToken:\n case SyntaxKind.AmpersandAmpersandToken:\n return true;\n }\n return false;\n }\n\n // the checker sees a value that is exactly boolean; `boolean | undefined` is a\n // TypeFlags.Union here and is therefore rejected (`bool?` is no condition in C#)\n csharpIsCheckedBoolean(node): boolean {\n const type = this.getChecker().getTypeAtLocation(node);\n return ((type?.flags ?? 0) & TypeFlags.BooleanLike) !== 0;\n }\n\n // `bool name = ...` is only declared when getCSharpLocalType resolved that exact\n // declaration to `bool`, so ask the same function: the condition and the declaration\n // cannot disagree. Parameters, members and demoted locals return `object` there. The\n // embedding layer's resolver (ccxt: build/csharp-local-types.js) retypes locals the\n // printer cannot name itself and reports the type the printed declaration carries, so a\n // `bool` there is the same proof for a declaration this printer did not write\n csharpIdentifierPrintsBool(node): boolean {\n if (!this.csharpIsCheckedBoolean(node)) {\n return false;\n }\n if (this.csharpExpressionTypeOf(node) === 'bool') {\n return true;\n }\n const declaration = this.getChecker().getSymbolAtLocation(node)?.valueDeclaration?.resolve();\n if (declaration === undefined || !isVariableDeclaration(declaration) || declaration.name?.kind !== SyntaxKind.Identifier) {\n return false;\n }\n if (!this.csharpLocalTypes.has(declaration)) {\n this.csharpLocalTypes.set(declaration, this.getCSharpLocalType(declaration));\n }\n return this.csharpLocalTypes.get(declaration) === 'bool';\n }\n\n // the printed callee text of a method call the printer can name statically: `this.` and\n // `.`. A deeper receiver (`a.b.c(...)`) or a plain function call stays undefined —\n // the hand-written-callee proof must know exactly which callee the emitted text binds\n csharpCalleeName_Native(node): string | undefined {\n const expression = node?.expression;\n if (expression?.kind !== SyntaxKind.PropertyAccessExpression) {\n return undefined;\n }\n const receiver = expression.expression;\n const name = expression.name?.text as string;\n if (receiver?.kind === SyntaxKind.ThisKeyword) {\n return 'this.' + name;\n }\n if (receiver?.kind === SyntaxKind.Identifier) {\n return (receiver.text as string) + '.' + name;\n }\n return undefined;\n }\n\n // cs-14: `isTrue()` goes bare when the call's own C# signature is non-nullable `bool`: (a)\n // hand-written cs/ccxt/base callees (CSHARP_BOOL_CALLEES_NATIVE), (b) `this.(...)` printed by\n // the same csharpBooleanReturnType. Hand-written overrides and `callDynamically` keep the wrapper.\n csharpBoolCall_Native(node): boolean {\n const callee = this.csharpCalleeName_Native(node);\n if (callee !== undefined && CSHARP_BOOL_CALLEES_NATIVE[callee] === true) {\n return true;\n }\n return this.csharpGeneratedThisCallBoolType_Native(node, callee) === 'bool';\n }\n\n // csharpBooleanReturnType of a generator-printed `this.(...)` callee, else undefined\n csharpGeneratedThisCallBoolType_Native(node, callee: string | undefined): string | undefined {\n if (callee === undefined || callee.indexOf('this.') !== 0) {\n return undefined;\n }\n if (CSHARP_HANDWRITTEN_CALLEES_NATIVE.indexOf(callee.substring('this.'.length)) > -1) {\n return undefined;\n }\n if (!this.csharpCalleeResolves(node)) {\n return undefined;\n }\n const declaration: any = this.getChecker().getResolvedSignature(node)?.declaration?.resolve();\n // a bodiless overload signature (`safeBool (…, defaultValue: boolean): boolean` next to a\n // `boolean | undefined` implementation) states only that overload's type, while C# binds\n // the single implementation: its `bool?` must not lose the wrapper\n if (declaration?.kind !== SyntaxKind.MethodDeclaration || declaration.body === undefined) {\n return undefined;\n }\n return this.csharpBooleanReturnType(declaration);\n }\n\n // calls the printer gives a concrete bool signature (inArray, valueIsDefined, startsWith,\n // Array.isArray, ...); safeBool and friends are `bool?` / `object` and keep the wrapper\n csharpCallPrintsBool(node): boolean {\n return this.csharpIsCheckedBoolean(node) && ((this.csharpCallReturnType(node) === 'bool') || this.csharpBoolCall_Native(node));\n }\n\n // The declared type of an identifier read: build layer's proof first, then this printer's table;\n // `var`/`object` mean \"no type\". `isTrue (x)` answers false for a null box, exactly the lifted\n // `x == true` on a `bool?`. Only reads declared `bool?` qualify; every other shape keeps helper.\n csharpNullableBoolCondition(node): string | undefined {\n let value = node;\n while (value?.kind === SyntaxKind.ParenthesizedExpression) {\n value = value.expression;\n }\n // the resolver arm: a declaration the embedding build layer retyped itself — the parameter/override\n // signatures the typed-param units print: the recorded type IS the emitted\n // declaration's, so a `bool?` parameter is no C# condition either\n const nullable = (value?.kind === SyntaxKind.Identifier)\n ? (this.csharpDeclaredLocalType(value) === 'bool?' || this.csharpDeclaredLocalResolverType(value) === 'bool?')\n : ((value?.kind === SyntaxKind.CallExpression) && this.csharpCallPrintsNullableBool(value));\n return nullable ? `(${this.printNode(value, 0)} == true)` : undefined;\n }\n\n // a call whose printed C# signature is `bool?`: the `bool? safeBool(...)` family of the\n // hand-written base (CSHARP_THIS_RETURN_TYPES, which names that signature), and a\n // `this.(...)` whose TS declaration the generator itself prints — definition and call\n csharpCallPrintsNullableBool(node): boolean {\n if (this.csharpCallReturnType(node) === 'bool?') {\n return true;\n }\n return this.csharpGeneratedThisCallBoolType_Native(node, this.csharpCalleeName_Native(node)) === 'bool?';\n }\n\n // same emission as the base implementation except for the bare-bool branch: the node is\n // printed once and only wrapped in isTrue(...) when the printer did not already render a bool\n //\n // the single `printCondition` override, rules layered strongest-proof-first over the base\n // body (the untyped fallback at the bottom):\n // S61 -- bare `isTrue (x)` in an if / while / && / || / ! condition: the operand is already\n // the `bool` (or `bool?`) the helper computes, so the wrapper adds nothing (the gate is the\n // csharpConditionPositionAllowsNative / csharpNativeCondition pair, never a name shape).\n // S62 -- a condition whose printed text is already a C# `bool` helper call\n // (csharpPrintedConditionIsBoolean) needs no wrapper either; the same identity proven from\n // the printed form rather than from the declaration.\n // #82 -- csharpConditionPrintsBool folds the wrapper on the node shapes the printer itself\n // renders as a bool, with csharpConditionParensIfNeeded keeping the `&&` / `||` precedence.\n printCondition(node, identation) {\n if (this.supportsFalsyOrTruthyValues) {\n return this.printNode(node, identation);\n }\n // can be called from ifs or conditional expressions or binary expressions so might contain the ! operator\n if (node?.kind === SyntaxKind.PrefixUnaryExpression && node.operator === SyntaxKind.ExclamationToken) {\n return this.printPrefixUnaryExpression(node, identation); // avoid infinite recursion\n }\n const nullableBool = this.csharpNullableBoolCondition(node);\n if (nullableBool !== undefined) {\n return `${this.getIden(identation)}${nullableBool}`;\n }\n const native = this.csharpConditionPositionAllowsNative(node) ? this.csharpNativeCondition(node, identation) : undefined;\n if (native !== undefined) {\n return native;\n }\n const printed = this.printNode(node, 0);\n if (this.csharpConditionPrintsBool(node)) {\n return `${this.getIden(identation)}${this.csharpConditionParensIfNeeded(node, printed)}`;\n }\n // `isTrue(X)` is the identity on a printed C# bool (Exchange.TranspileHelpers.cs:\n // `isTrue(object)` returns `(bool)value`, and normalizeIntIfNeeded is a no-op on bools),\n // so the wrapper is dropped when the node already prints as one\n if (this.csharpPrintedConditionIsBoolean(printed)) {\n return `${this.getIden(identation)}${printed}`;\n }\n return `${this.getIden(identation)}${this.FALSY_WRAPPER_OPEN}${printed}${this.FALSY_WRAPPER_CLOSE}`;\n }\n\n // dropping the wrapper exposes the `&&` / `||` / `is` of the node, so the bare text needs its own\n // parentheses where C# binds tighter than the JS it replaces: under `!` (which binds tighter\n // than both), and a `||` that becomes an operand of a `&&` (`(a || b) && c` must not flatten\n // to `a || b && c`). A type test additionally needs them under the `(bool)` cast the\n // conditional-expression printer prepends (`(bool) x is T` would bind as `((bool) x) is T`).\n // Source parentheses, when present, already come out in `printed`.\n csharpConditionParensIfNeeded(node, printed: string): string {\n if (node?.kind !== SyntaxKind.BinaryExpression) {\n return printed;\n }\n const op = node.operatorToken.kind;\n const parent = node.parent;\n const underNot = parent?.kind === SyntaxKind.PrefixUnaryExpression && parent.operator === SyntaxKind.ExclamationToken;\n if (op === SyntaxKind.InstanceOfKeyword) {\n const underCast = parent?.kind === SyntaxKind.ConditionalExpression && parent.condition === node;\n return (underNot || underCast) ? `(${printed})` : printed;\n }\n if (op !== SyntaxKind.BarBarToken && op !== SyntaxKind.AmpersandAmpersandToken) {\n return printed;\n }\n const underAnd = op === SyntaxKind.BarBarToken && parent?.kind === SyntaxKind.BinaryExpression\n && parent.operatorToken.kind === SyntaxKind.AmpersandAmpersandToken;\n return (underNot || underAnd) ? `(${printed})` : printed;\n }\n\n printConditionalExpression(node, identation) {\n const condition = this.printTernaryCondition(node.condition);\n const whenTrue = this.printNode(node.whenTrue, 0);\n const whenFalse = this.printNode(node.whenFalse, 0);\n\n return condition + \" ? \" + whenTrue + \" : \" + whenFalse;\n }\n\n // The ternary condition is a condition position the native gate above never sees: the same hook\n // answer prints natively there — `bool` bare, `bool?` as `x == true` (null -> false), source parens\n // unwrapped. Undefined keeps the base path, so an unnamed operand is unchanged.\n csharpTernaryConditionOperand(node) {\n let operand = node;\n while (operand?.kind === SyntaxKind.ParenthesizedExpression) {\n operand = operand.expression;\n }\n if (operand?.kind !== SyntaxKind.Identifier) {\n return undefined;\n }\n const type = this.csharpConditionOperandType(operand);\n if (type === 'bool') {\n return this.printNode(operand, 0);\n }\n if (type === 'bool?') {\n return `${this.printNode(operand, 0)} == true`;\n }\n return undefined;\n }\n\n // printCondition already yields a C# `bool` (`isTrue(x)` / `!isTrue(x)`), so a `((bool) )`\n // wrapper is a cast on a bool. The hook fold above answers the emitted declaration's type first;\n // anything it cannot name keeps the printer's `bool` fold (getCSharpLocalType) and then `isTrue`.\n printTernaryCondition(node) {\n const native = this.csharpTernaryConditionOperand(node);\n if (native !== undefined) {\n return native;\n }\n if (this.csharpConditionPrintsAsBool(node)) {\n return this.printNode(node, 0);\n }\n return this.printCondition(node, 0);\n }\n\n csharpConditionPrintsAsBool(node): boolean {\n if (node?.kind !== SyntaxKind.Identifier) {\n return false;\n }\n const checker = this.getChecker() as Checker; // eslint-disable-line\n const declaration = checker.getSymbolAtLocation(node)?.valueDeclaration?.resolve();\n if (declaration?.kind !== SyntaxKind.VariableDeclaration) {\n return false;\n }\n return this.getCSharpLocalType(declaration) === 'bool';\n }\n\n // index of the `)` matching the `(` at `start` inside printed C# text, or -1; string\n // and char literals are skipped so a `(` inside a literal cannot shift the depth\n csharpMatchingParenIndex(text: string, start: number): number {\n let depth = 0;\n for (let i = start; i < text.length; i++) {\n const char = text[i];\n if (char === '\"' || char === '\\'') {\n const quote = char;\n i++;\n while (i < text.length) {\n if (text[i] === '\\\\') { i += 2; continue; }\n if (text[i] === quote) { break; }\n i++;\n }\n } else if (char === '(') {\n depth++;\n } else if (char === ')') {\n depth--;\n if (depth === 0) {\n return i;\n }\n }\n }\n return -1;\n }\n\n // S62: a `?` at paren/bracket/brace depth 0 in printed condition text is a C# conditional; its type\n // is the branches' common type (`object`), never `bool`; without this guard the falsy wrapper would\n // be folded into an invalid `if (object)`. `?` inside parens/brackets and in literals is ignored.\n csharpTextHasTopLevelConditional(text: string): boolean {\n let depth = 0;\n for (let i = 0; i < text.length; i++) {\n const char = text[i];\n if (char === '\"' || char === '\\'') {\n const quote = char;\n i++;\n while (i < text.length) {\n if (text[i] === '\\\\') { i += 2; continue; }\n if (text[i] === quote) { break; }\n i++;\n }\n } else if ((char === '(') || (char === '[') || (char === '{')) {\n depth++;\n } else if ((char === ')') || (char === ']') || (char === '}')) {\n depth--;\n } else if ((char === '?') && (depth === 0)) {\n return true;\n }\n }\n return false;\n }\n\n // S62: is this printed condition text already a C# `bool`? Only `isTrue`/`isEqual`/`isGreaterThan\n // (OrEqual)`/`isLessThan(OrEqual)`/`inOp` calls qualify (CSHARP_BOOLEAN_PRINTED_CALLS). A `!`,\n // whole-text parens and `&&`/`||` composites (via the leading operand) keep the property.\n csharpPrintedConditionIsBoolean(text: string): boolean {\n const trimmed = text.trim();\n if (trimmed.length === 0) {\n return false;\n }\n if (this.csharpTextHasTopLevelConditional(trimmed)) {\n return false;\n }\n if (trimmed.startsWith('(') && (this.csharpMatchingParenIndex(trimmed, 0) === trimmed.length - 1)) {\n return this.csharpPrintedConditionIsBoolean(trimmed.substring(1, trimmed.length - 1));\n }\n if (trimmed.startsWith('!')) {\n return this.csharpPrintedConditionIsBoolean(trimmed.substring(1));\n }\n const printedCall = /^([A-Za-z_]\\w*)\\(/.exec(trimmed);\n return (printedCall !== null) && (CSHARP_BOOLEAN_PRINTED_CALLS.indexOf(printedCall[1]) >= 0);\n }\n\n printDeleteExpression(node, identation) {\n const receiver = node.expression.expression;\n const object = this.printNode (receiver, 0);\n const key = this.printNode (node.expression.argumentExpression, 0);\n // same identity as the element write: `Remove` on the declared dictionary is the\n // interface method the cast would bind to\n if (this.csharpReceiverIsDeclaredDictionary(receiver)) {\n return `${object}.Remove((string)${key})`;\n }\n return `((IDictionary)${object}).Remove((string)${key})`;\n }\n\n printNewExpression(node, identation) {\n let expression = node.expression?.text;\n expression = expression ? expression : this.printNode(node.expression);\n // JS's built-in `Error` maps to C#'s `Exception` (C# has no `Error` type in the BCL)\n if (expression === 'Error') {\n expression = 'Exception';\n }\n const args = node.arguments.map(n => this.printNode(n, identation)).join(\", \");\n const newToken = this.NEW_TOKEN ? this.NEW_TOKEN + \" \" : \"\";\n return newToken + expression + this.LEFT_PARENTHESIS + args + this.RIGHT_PARENTHESIS;\n }\n\n printThrowStatement(node, identation) {\n // const expression = this.printNode(node.expression, 0);\n // return this.getIden(node) + this.THROW_TOKEN + \" \" + expression + this.LINE_TERMINATOR;\n if (node.expression.kind === SyntaxKind.Identifier) {\n return this.getIden(identation) + this.THROW_TOKEN + ' ' + this.printNode(node.expression, 0) + this.LINE_TERMINATOR;\n }\n if (node.expression.kind === SyntaxKind.NewExpression) {\n const expression = node.expression;\n // handle throw new Error (Message)\n // and throw new x[a] (message)\n const argumentsExp = expression?.arguments ?? [];\n const parsedArg = argumentsExp.map(n => this.printNode(n, 0)).join(\",\") ?? '';\n const newExpression = this.printNode(expression.expression, 0);\n if (expression.expression.kind === SyntaxKind.Identifier) {\n // handle throw new X\n const id = expression.expression;\n // JS's built-in `Error` maps to C#'s `Exception` (C# has no `Error` type in the BCL)\n const idName = id.text === 'Error' ? 'Exception' : id.text;\n const symbol = this.getChecker().getSymbolAtLocation(expression.expression);\n if (symbol) {\n const declarations = (this.getChecker().getDeclaredTypeOfSymbol(symbol).getSymbol()?.declarations ?? []).map((d) => d.resolve());\n const isClassDeclaration = declarations.find(l => l.kind === SyntaxKind.InterfaceDeclaration || l.kind === SyntaxKind.ClassDeclaration);\n if (isClassDeclaration){\n return this.getIden(identation) + `${this.THROW_TOKEN} ${this.NEW_TOKEN} ${idName} ((string)${parsedArg}) ${this.LINE_TERMINATOR}`;\n } else {\n return this.getIden(identation) + `throwDynamicException(${idName}, ${parsedArg});return null;`;\n }\n }\n return this.getIden(identation) + `${this.THROW_TOKEN} ${this.NEW_TOKEN} ${idName === id.text ? newExpression : idName} (${parsedArg}) ${this.LINE_TERMINATOR}`;\n } else if (expression.expression.kind === SyntaxKind.ElementAccessExpression) {\n return this.getIden(identation) + `throwDynamicException(${newExpression}, ${parsedArg});`;\n }\n return super.printThrowStatement(node, identation);\n }\n // const newToken = this.NEW_TOKEN ? this.NEW_TOKEN + \" \" : \"\";\n // const newExpression = node.expression?.expression?.text;\n // // newExpression = newExpression ? newExpression : this.printNode(node.expression.expression, 0); // new Exception or new exact[string] check this out\n // // const args = node.expression?.arguments.map(n => this.printNode(n, 0)).join(\",\");\n // // const throwExpression = ` ${newToken}${newExpression}${this.LEFT_PARENTHESIS}((string)${args})${this.RIGHT_PARENTHESIS}`;\n // return this.getIden(identation) + this.THROW_TOKEN + throwExpression + this.LINE_TERMINATOR;\n }\n\n printPropertyAccessModifiers(node) {\n let modifiers = this.printModifiers(node);\n if (modifiers === '') {\n modifiers = this.defaultPropertyAccess;\n }\n // add type\n let typeText = 'object';\n if (node.type) {\n typeText = this.getType(node);\n if (!typeText && node.type.kind === SyntaxKind.AnyKeyword) {\n typeText = this.OBJECT_KEYWORD + ' ';\n }\n }\n return modifiers + ' ' + typeText + ' ';\n }\n\n // printLeadingComments(node, identation) {\n // const fullText = this.getSrc().getFullText();\n // const commentsRangeList = ts.getLeadingCommentRanges(fullText, node.pos);\n // const commentsRange = commentsRangeList ? commentsRangeList : undefined;\n // let res = \"\";\n // if (commentsRange) {\n // for (const commentRange of commentsRange) {\n // const commentText = fullText.slice(commentRange.pos, commentRange.end);\n // if (commentText !== undefined) {\n // const formatted = commentText\n // .split(\"\\n\")\n // .map(line=>line.trim())\n // .map(line => !(line.trim().startsWith(\"*\")) ? this.getIden(identation) + line : this.getIden(identation) + \" \" + line) .join(\"\\n\");\n // // res+= this.transformLeadingComment(formatted) + \"\\n\";\n // }\n // }\n // }\n // return res;\n // }\n\n // hx4 C01: a declared C# collection keeps its static type across every write, and the\n // null/ContainsKey/Count test reads the live value, so only an enclosing function is needed\n csharpHx4DeclaredReceiverReadable(node, expression): boolean {\n return this.csharpEnclosingFunction(node) !== undefined && isIdentifier(expression);\n }\n\n // hx4 C11: `x[i]` / `m[k]` with an identifier key on a declared collection or a base dict field.\n // The emission carries GetValue's own null/missing-key/past-the-end tests; a negative index\n // throws in both. Key must be declared `int` (list) or `string`/`string?` (dictionary).\n csharpHx4IdentifierKeyRead(expression, argumentExpression): string | undefined {\n if (!isIdentifier(argumentExpression) || !this.csharpHx4IsPlainRead(argumentExpression.parent)) {\n return undefined;\n }\n const fieldTypes = { 'has': 'Dictionary', 'features': 'Dictionary', 'timeframes': 'Dictionary', 'options': 'ConcurrentDictionary', 'markets': 'IDictionary', 'urls': 'object', 'currencies': 'object' };\n let receiver: string | undefined;\n let csharpType: string | undefined;\n if (isPropertyAccessExpression(expression) && expression.expression.kind === SyntaxKind.ThisKeyword && isIdentifier(expression.name)\n && Object.prototype.hasOwnProperty.call(fieldTypes, expression.name.text as string)) {\n const field = this.printNode(expression, 0);\n csharpType = fieldTypes[expression.name.text as string];\n receiver = (csharpType === 'object') ? `((IDictionary)${field})` : field;\n const key = this.csharpHx4DeclaredKeyType(argumentExpression);\n if (key !== 'string' && key !== 'string?') {\n return undefined;\n }\n const printedKey = this.printNode(argumentExpression, 0);\n return `(${field} != null && ${printedKey} != null && ${receiver}.ContainsKey(${printedKey}) ? ${receiver}[${printedKey}] : null)`;\n }\n if (!isIdentifier(expression) || CSHARP_MARKET_RECEIVER_NAMES.indexOf(expression.text as string) >= 0) {\n return undefined;\n }\n csharpType = this.csharpDeclaredCollectionType(expression);\n if (csharpType === undefined) {\n const printed = (typeof (this as any).csharpPrintedLocalType === 'function') ? (this as any).csharpPrintedLocalType(expression) : undefined;\n csharpType = (CSHARP_NATIVE_COLLECTION_TYPES.indexOf(printed) >= 0) ? printed : undefined;\n }\n if (csharpType === undefined || this.csharpEnclosingFunction(expression) === undefined) {\n return undefined;\n }\n receiver = this.printNode(expression, 0);\n const printedKey = this.printNode(argumentExpression, 0);\n const keyType = this.csharpHx4DeclaredKeyType(argumentExpression);\n if (csharpType.indexOf('Dictionary<') >= 0) {\n if (keyType !== 'string' && keyType !== 'string?') {\n return undefined;\n }\n return `(${receiver} != null && ${printedKey} != null && ${receiver}.ContainsKey(${printedKey}) ? ${receiver}[${printedKey}] : null)`;\n }\n if (keyType !== 'int') {\n return undefined; // Int64/object indices do not bind the List indexer\n }\n return `(${receiver} != null && ${printedKey} < ${receiver}.Count ? ${receiver}[${printedKey}] : null)`;\n }\n\n // a read that is no write target: not the left of any assignment, not ++/--, not delete\n csharpHx4IsPlainRead(node): boolean {\n const parent: any = node?.parent;\n if (parent?.kind === SyntaxKind.BinaryExpression && parent.left === node && this.csharpIsAssignmentOperator(parent.operatorToken.kind)) {\n return false;\n }\n return !isDeleteExpression(parent) && !isPrefixUnaryExpression(parent) && !isPostfixUnaryExpression(parent);\n }\n\n // the C# type the key identifier's emitted declaration carries: the printer's own table, then\n // the build layer's declared-local hook (which retypes for-counters and string locals)\n csharpHx4DeclaredKeyType(key): string | undefined {\n const typed = this.csharpTypedLocalType(key);\n if (typed !== undefined) {\n return typed;\n }\n const printed = (typeof (this as any).csharpPrintedLocalType === 'function') ? (this as any).csharpPrintedLocalType(key) : undefined;\n if (printed !== undefined) {\n return printed;\n }\n return (typeof this.csharpLocalTypeOf === 'function') ? this.csharpLocalTypeOf(key) : undefined;\n }\n\n // hx4 L44: `-x` on a local declared `double?` (a safeNumber read) inside a\n // non-null guard on x (`if (x !== undefined)`, `x !== undefined && ...`, early exit). The guard\n // proves the box is a number, so the local keeps its nullable scalar type and the negation is the\n // helper's own in-place body `(x = -x)` (lifted: x is non-null here). Unguarded reads keep `object`.\n csharpHx4GuardedNullableNegation(node, csharpType: string): boolean {\n if (csharpType !== 'double?') {\n return false;\n }\n if (!isPrefixUnaryExpression(node) || (node.operator !== SyntaxKind.MinusToken) || !isIdentifier(node.operand)) {\n return false;\n }\n return this.csharpNullGuardAdmitsRead(node, node.operand);\n }\n\n // the C# type the local's printed declaration finally carries; an embedding build layer that\n // retypes `object x = ...` after printing overrides this with its own (final) answer\n csharpHx4DeclaredLocalType(declaration): string | undefined {\n return this.getCSharpLocalType(declaration);\n }\n\n csharpHx4NativeNegatedNullableLocal(node, leftSide: string): string | undefined {\n const operand = node.operand;\n if (!isIdentifier(operand)) {\n return undefined;\n }\n // the prefix the declaration printed (`double? x = ...`): the printer's own decision, or the\n // embedding build layer's wrapped one; a declaration list of several bindings prints `object`\n const declaration: any = this.getChecker().getSymbolAtLocation(operand)?.valueDeclaration?.resolve();\n if (!declaration || !isVariableDeclaration(declaration) || (declaration.parent?.declarations?.length !== 1)) {\n return undefined;\n }\n const declared = this.csharpHx4DeclaredLocalType(declaration);\n if (!this.csharpHx4GuardedNullableNegation(node, declared)) {\n return undefined;\n }\n return `(${leftSide} = -${leftSide})`;\n }\n\n}\n\n// if (this.requiresCallExpressionCast) {\n// const parsedTypes = this.getTypesFromCallExpressionParameters(node);\n// const tmpArgs = [];\n// args.forEach((arg, index) => {\n// const parsedType = parsedTypes[index];\n// const cast = parsedType ? `(${parsedType})` : '';\n// tmpArgs.push(cast + this.printNode(arg, identation).trim());\n// });\n// parsedArgs = tmpArgs.join(\",\");\n// } else {\n// parsedArgs = args.map((a) => {\n// return this.printNode(a, identation).trim();\n// }).join(\", \");\n// }\n\n// getTypesFromCallExpressionParameters(node) {\n// const resolvedParams = this.getChecker().getResolvedSignature(node).parameters;\n// const parsedTypes = [];\n// resolvedParams.forEach((p) => {\n// const decl = p.declarations[0];\n// const type = this.getChecker().getTypeAtLocation(decl);\n// const parsedType = this.getTypeFromRawType(type);\n// parsedTypes.push(parsedType);\n// });\n\n// return parsedTypes;\n// }\n\n\n// get class decl node\n// Use the ts.getAllSuperTypeNodes function to get the base classes for the MyClass\n// const baseClasses = ts.getAllSuperTypeNodes(classDeclaration);\n\n// // Create a type checker\n// const typeChecker = ts.createTypeChecker(sourceFile.context.program, sourceFile.context.checker);\n\n// // Get the type of the base class\n// const baseClassType = typeChecker.getTypeAtLocation(baseClasses[0]);\n\n// // Get the class declaration for the base class\n// const baseClassDeclaration = baseClassType.symbol.valueDeclaration;\n\n// console.log(baseClassDeclaration);\n","import { BaseTranspiler } from \"./baseTranspiler.js\";\nimport * as fs from \"fs\";\nimport * as path from \"path\";\nimport { SyntaxKind, getLeadingCommentRanges } from 'typescript/unstable/ast';\nimport { isArrowFunction, isBinaryExpression, isBlock, isBooleanLiteral, isCallExpression, isClassDeclaration as isClassDeclarationNode, isElementAccessExpression, isExpressionStatement, isFunctionDeclaration, isFunctionExpression, isIfStatement, isMethodDeclaration, isReturnStatement, isSourceFile, isStatement as isStatementNode, isThrowStatement, isTryStatement } from 'typescript/unstable/ast/is';\nimport { Checker, IndexKind, SymbolFlags, TypeFlags } from 'typescript/unstable/sync';\nimport type { BinaryExpression, CallExpression, Node, NodeArray, Statement } from 'typescript/unstable/ast';\nimport { getAllSuperTypeNodes, isFunctionLike } from './tsUtils.js';\n\n\nconst GO_ITERATION_STATEMENT_KINDS = new Set([SyntaxKind.ForStatement, SyntaxKind.ForInStatement,\n SyntaxKind.ForOfStatement, SyntaxKind.DoStatement, SyntaxKind.WhileStatement]);\n\nconst parserConfig = {\n 'ELSEIF_TOKEN': 'else if',\n 'OBJECT_OPENING': 'map[string]any{',\n 'ARRAY_OPENING_TOKEN': '[]any{',\n 'ARRAY_CLOSING_TOKEN': '}',\n 'PROPERTY_ASSIGNMENT_TOKEN': ':',\n 'VAR_TOKEN': 'object', // object\n 'METHOD_TOKEN': 'func',\n 'PROPERTY_ASSIGNMENT_OPEN': '',\n 'PROPERTY_ASSIGNMENT_CLOSE': '',\n 'SUPER_TOKEN': 'base',\n 'SUPER_CALL_TOKEN': 'base',\n 'FALSY_WRAPPER_OPEN': 'EvalTruthy(',\n 'FALSY_WRAPPER_CLOSE': ')',\n 'COMPARISON_WRAPPER_OPEN' : \"IsEqual(\",\n 'COMPARISON_WRAPPER_CLOSE' : \")\",\n 'UKNOWN_PROP_WRAPPER_OPEN': 'this.call(',\n 'UNKOWN_PROP_WRAPPER_CLOSE': ')',\n 'UKNOWN_PROP_ASYNC_WRAPPER_OPEN': 'this.callAsync(',\n 'UNKOWN_PROP_ASYNC_WRAPPER_CLOSE': ')',\n 'DYNAMIC_CALL_OPEN': 'callDynamically(',\n 'EQUALS_EQUALS_WRAPPER_OPEN': 'IsEqual(',\n 'EQUALS_EQUALS_WRAPPER_CLOSE': ')',\n 'DIFFERENT_WRAPPER_OPEN': '!IsEqual(',\n 'DIFFERENT_WRAPPER_CLOSE': ')',\n 'GREATER_THAN_WRAPPER_OPEN': 'IsGreaterThan(',\n 'GREATER_THAN_WRAPPER_CLOSE': ')',\n 'GREATER_THAN_EQUALS_WRAPPER_OPEN': 'IsGreaterThanOrEqual(',\n 'GREATER_THAN_EQUALS_WRAPPER_CLOSE': ')',\n 'LESS_THAN_WRAPPER_OPEN': 'IsLessThan(',\n 'LESS_THAN_WRAPPER_CLOSE': ')',\n 'LESS_THAN_EQUALS_WRAPPER_OPEN': 'IsLessThanOrEqual(',\n 'LESS_THAN_EQUALS_WRAPPER_CLOSE': ')',\n 'PLUS_WRAPPER_OPEN':'Add(',\n 'PLUS_WRAPPER_CLOSE':')',\n 'MINUS_WRAPPER_OPEN':'Subtract(',\n 'MINUS_WRAPPER_CLOSE':')',\n 'ARRAY_LENGTH_WRAPPER_OPEN': 'GetArrayLength(',\n 'ARRAY_LENGTH_WRAPPER_CLOSE': ')',\n 'DIVIDE_WRAPPER_OPEN': 'Divide(',\n 'DIVIDE_WRAPPER_CLOSE': ')',\n 'MULTIPLY_WRAPPER_OPEN': 'Multiply(',\n 'MULTIPLY_WRAPPER_CLOSE': ')',\n 'INDEXOF_WRAPPER_OPEN': 'GetIndexOf(',\n 'INDEXOF_WRAPPER_CLOSE': ')',\n 'MOD_WRAPPER_OPEN': 'Mod(',\n 'MOD_WRAPPER_CLOSE': ')',\n 'FUNCTION_TOKEN': 'func',\n 'DEFAULT_RETURN_TYPE': 'any',\n 'BLOCK_OPENING_TOKEN': '{',\n 'DEFAULT_PARAMETER_TYPE': 'any',\n 'LINE_TERMINATOR': '',\n 'CONDITION_OPENING':'',\n 'CONDITION_CLOSE':'',\n 'AWAIT_TOKEN': '',\n 'NULL_TOKEN': 'nil',\n 'UNDEFINED_TOKEN': 'nil',\n 'WHILE_TOKEN': 'for',\n 'ELEMENT_ACCESS_WRAPPER_OPEN': 'GetValue(',\n 'ELEMENT_ACCESS_WRAPPER_CLOSE': ')',\n};\n\n// Go static type of the native emissions the printer itself makes (a stdlib call,\n// or one of its own immediately-called literals). A local that captures one holds\n// that concrete type, exactly like the helper result the emission replaced.\nconst GO_NATIVE_CALL_RETURN_TYPES: { [name: string]: string } = {\n 'strings.Index': 'int',\n};\n\n// `this.`, `this.2` and `this.N` of each accessor family, all typed `goType`\nfunction goSafeAccessorTypes (names: string[], goType: string): { [name: string]: string } {\n return Object.fromEntries(names.flatMap((name) => [ '', '2', 'N' ].map((suffix) => [ 'this.' + name + suffix, goType ])));\n}\n\n// Go static type of the value each base helper returns. A local initialised by\n// one of these already holds that concrete type inside its `any` box, so naming\n// the type at the declaration site keeps the very same runtime value and only\n// refines what the Go compiler knows about it.\nconst GO_HELPER_RETURN_TYPES: { [name: string]: string } = {\n 'GetArrayLength': 'int',\n 'GetLength': 'int',\n // the printInlineArrayLength emission of `.length` on a slice\n 'len': 'int',\n 'GetIndexOf': 'int',\n 'ToString': 'string',\n // hand-written exchange_encode.go helper, a plain Go `string` on its only return path\n 'this.UrlencodeNested': 'string',\n 'ToLower': 'string',\n 'ToUpper': 'string',\n 'JsonStringify': 'string',\n 'Capitalize': 'string',\n 'this.Uuid': 'string',\n 'this.Hmac': 'string',\n 'this.Ymdhms': 'string',\n 'this.Yyyymmdd': 'string',\n 'this.Ymd': 'string',\n 'Split': '[]string',\n 'ObjectKeys': '[]string',\n 'this.Extend': 'map[string]any',\n 'this.DeepExtend': 'map[string]any',\n 'this.Keysort': 'map[string]any',\n 'this.IndexBy': 'map[string]any',\n 'this.GroupBy': 'map[string]any',\n 'this.Milliseconds': 'int64',\n 'this.Seconds': 'int64',\n 'this.Microseconds': 'int64',\n 'ParseInt': 'int64',\n 'MathFloor': 'float64',\n 'MathCeil': 'float64',\n 'MathRound': 'float64',\n 'MathAbs': 'float64',\n 'MathPow': 'float64',\n 'ToFloat64': 'float64',\n 'EvalTruthy': 'bool',\n 'IsEqual': 'bool',\n 'IsGreaterThan': 'bool',\n 'IsLessThan': 'bool',\n 'IsGreaterThanOrEqual': 'bool',\n 'IsLessThanOrEqual': 'bool',\n 'InOp': 'bool',\n 'IsArray': 'bool',\n 'IsString': 'bool',\n 'IsInt': 'bool',\n 'IsBool': 'bool',\n 'IsNumber': 'bool',\n 'IsObject': 'bool',\n 'IsDictionary': 'bool',\n 'StartsWith': 'bool',\n 'EndsWith': 'bool',\n // the native string operations (emitted with a proven Go `string` receiver) return exactly\n // the type of the helper they replace, so a local initialised by one keeps its declared type\n 'strings.Split': '[]string',\n 'strings.Join': 'string',\n 'strings.ToUpper': 'string',\n 'strings.ToLower': 'string',\n 'strings.Replace': 'string',\n 'strings.ReplaceAll': 'string',\n 'strings.HasPrefix': 'bool',\n 'strings.HasSuffix': 'bool',\n 'strconv.FormatInt': 'string',\n 'IsInstance': 'bool',\n 'IsInteger': 'bool',\n 'this.InArray': 'bool',\n 'this.ValueIsDefined': 'bool',\n 'Precise.StringGt': 'bool',\n 'Precise.StringGe': 'bool',\n 'Precise.StringLt': 'bool',\n 'Precise.StringLe': 'bool',\n 'Precise.StringEq': 'bool',\n 'Precise.StringEquals': 'bool',\n // the base Safe* accessors return a typed pointer so that an absent value is a\n // nil pointer, distinct from a present zero value (\"\" / 0 / false)\n ...goSafeAccessorTypes([ 'SafeString', 'SafeStringLower', 'SafeStringUpper' ], '*string'),\n ...goSafeAccessorTypes([ 'SafeInteger', 'SafeIntegerProduct', 'SafeTimestamp' ], '*int64'),\n ...goSafeAccessorTypes([ 'SafeFloat' ], '*float64'),\n // absent flag → nil pointer, present flag → its value, mirroring the string/number accessors\n ...goSafeAccessorTypes([ 'SafeBool' ], '*bool'),\n // SafeDict*/SafeList* stay untyped: the Go accessors return `any` because the value\n // may be a *sync.Map, a Dict or an order-book side, none of which is a map[string]any / []any\n // Precise arithmetic returns a numeric string, or nil when an operand is\n // absent, so it carries the same *string shape as the Safe* string accessors\n ...Object.fromEntries([ 'Mul', 'Div', 'Sub', 'Add', 'Or', 'Max', 'Min', 'Abs', 'Neg', 'Mod' ].map((op) => [ 'Precise.String' + op, '*string' ])),\n};\n\n// helpers whose Go signature is `any` (GetValue, Ternary, Add, SafeValue, ...) are\n// deliberately absent above: their box holds a value the printer cannot name, so\n// those locals stay `any`. A Safe* entry presupposes the matching Go accessor\n// returns that shape (as the hand-written base already does for Str/Int/Float).\n\n// printed calls whose Go result is a JSON decode: map/slice/scalar or nil, never a\n// typed pointer. `this.parseJson` / `this.json` are the hand-written base decoders,\n// `JsonParse` / `ParseJSON` their runtime twins.\nconst GO_JSON_PARSE_CALLS = [ 'Json', 'JsonParse', 'ParseJson', 'ParseJSON' ];\n\n// Hand-written CCXT fields whose Go type is a plain `bool` (go/v4/exchange.go,\n// struct BaseExchange, embedded by every derived exchange). Reading one already\n// yields a Go bool, so a condition on it needs no truthiness helper at all.\nconst GO_BOOL_FIELDS = new Set([\n 'this.Verbose',\n 'this.EnableRateLimit',\n 'this.ReduceFees',\n 'this.SubstituteCommonCurrencyCodes',\n 'this.IsSandboxModeEnabled',\n // `public newUpdates: boolean` in ts/src/base/Exchange.ts; the hand-written\n // struct field is the `NewUpdates bool` read by every WS loop\n 'this.NewUpdates',\n]);\n\n// Hand-written BaseExchange methods (go/v4/exchange.go) whose Go signature returns a\n// plain `bool`, so `EvalTruthy(this.IsEmpty(x))` IS `this.IsEmpty(x)`. InArray,\n// Precise.String* and the retagged generated methods are already in GO_HELPER_RETURN_TYPES.\nconst GO_BOOL_CALL_NAMES_NATIVE = [\n 'this.IsEmpty',\n 'this.IsJsonEncodedObject',\n 'this.IsBinaryMessage',\n];\n// Pointer-returning accessors the ccxt build pass wraps with DerefScalar but that the\n// Go type table above does not name (their printed Go signature is not in it).\nconst GO_DEREF_WRAPPED_CALLS = [ 'NumberToString', 'Parse8601', 'Iso8601' ];\n\n// A printed call the printer cannot type *and* whose Go signature returns `any`\n// can be compared with nil / a string / a bool literal without the helper: the\n// box holds a scalar or nil, never a typed pointer.\nconst GO_ANY_BOX_CALLS = [\n 'GetValue', 'Ternary',\n 'SafeValue', 'this.SafeValue',\n 'SafeDict', 'this.SafeDict',\n 'SafeList', 'this.SafeList',\n 'SafeNumber', 'this.SafeNumber',\n];\n\n// read-only string accessors whose printed Go result is a `*string`. Each one reads\n// its arguments and returns a fresh pointer, so repeating the call in the two halves\n// of a deref comparison returns the same value when every argument is a plain read.\nconst GO_PURE_STRING_ACCESSORS = [\n 'this.SafeString', 'this.SafeString2', 'this.SafeStringN',\n 'this.SafeStringLower', 'this.SafeStringLower2', 'this.SafeStringLowerN',\n 'this.SafeStringUpper', 'this.SafeStringUpper2', 'this.SafeStringUpperN',\n 'this.NumberToString', 'this.SafeCurrencyCode',\n];\n\n// the `*bool` twin of the table above: the accessors whose Go signature returns a\n// pointer that is nil for an absent flag and carries the flag otherwise — the same\n// two states `derefScalar` hands the truthiness helper.\nconst GO_PURE_BOOL_ACCESSORS = [\n 'this.SafeBool', 'this.SafeBool2', 'this.SafeBoolN',\n];\n\n// Pointer types the Go nil test of the runtime helpers reproduces exactly: derefScalar\n// unwraps them to an untyped nil, IsEqual has its own *sync.Map case. Other pointers\n// (*sync.Mutex), map/slice fields and `any` fields flip meaning, so they keep the helper.\nconst GO_NIL_EQUIVALENT_POINTER_TYPES_Native = new Set([\n '*sync.Map', '*string', '*int64', '*float64', '*bool', '*int', '*[]string', '*[]any', '*map[string]any',\n]);\n\n// hand-written BaseExchange fields (go/v4/exchange.go) declared `*sync.Map`\nconst GO_SYNC_MAP_FIELDS = [\n 'Options', 'Markets', 'Markets_by_id', 'MarketsById', 'Currencies', 'Currencies_by_id', 'CurrenciesById',\n 'BaseCurrencies', 'QuoteCurrencies', 'Tickers', 'Orderbooks', 'Transactions',\n];\n\n// Hand-written BaseExchange fields (go/v4/exchange.go, embedded by every exchange\n// class) declared with one of those pointer types, keyed by the printed Go field name;\n// the Go type lives in the hand-written base, not in the TypeScript class.\nconst GO_NILABLE_FIELDS_Typed: { [name: string]: string } = Object.fromEntries(\n [ ...GO_SYNC_MAP_FIELDS, 'Bidsasks' ].map((name) => [ 'this.' + name, '*sync.Map' ]));\n\nconst GO_TYPE_NAMES = [ 'string', 'int', 'int64', 'float64', 'bool', 'any' ];\n\n// `var x any = this.SafeDict(container, key)` may declare the map type: SafeMapTyped reads the same\n// member and returns the map (sync.Map converted), nil when absent or not a map. Emitted only when\n// every later use READS it as a dictionary — a typed nil map is a non-nil interface otherwise.\nconst GO_SAFE_DICT_LOCAL_TYPE = 'map[string]any';\n\n// the hand-written helpers a typed dict local may be handed to as their receiver: each one\n// normalises the argument with derefScalar/GetValue, so a nil map reads exactly like the nil\n// interface the local used to hold\nconst GO_SAFE_DICT_READ_HELPERS = [ 'GetValue', 'InOp', 'ObjectKeys', 'IsDictionary' ];\n\n// `var market any = this.Market(symbol)` / `this.SafeMarket(…)`: the TS return type is the\n// `MarketInterface` interface, so MapTyped returns the same dictionary and the local can be\n// `map[string]any`. Emitted only while every later use READS it as a dictionary (SafeDict scan).\nconst GO_MARKET_LOCAL_TYPE = 'map[string]any';\n\n// the binary operators under which a market/currency local's element read is a pure READ: the\n// element is derefed by the GetValue the element-read printer keeps for these operands\n// (goMarketComparisonElementRead), so `market['swap'] === true` keeps answering exactly what the\nconst GO_MARKET_READ_COMPARISON_OPERATORS = [\n SyntaxKind.EqualsEqualsToken,\n SyntaxKind.ExclamationEqualsToken,\n SyntaxKind.EqualsEqualsEqualsToken,\n SyntaxKind.ExclamationEqualsEqualsToken,\n SyntaxKind.LessThanToken,\n SyntaxKind.GreaterThanToken,\n SyntaxKind.LessThanEqualsToken,\n SyntaxKind.GreaterThanEqualsToken,\n SyntaxKind.AmpersandAmpersandToken,\n SyntaxKind.BarBarToken,\n];\n\n// `var x any = this.SafeList(container, key)` may carry the slice type for the same reason: the\n// accessor returns `any`, so SafeListTyped reads the same member and hands back a []any with the\n// same length and elements (every array kind IsArray admits is converted), nil when the member is\nconst GO_SAFE_LIST_LOCAL_TYPE = '[]any';\n\n// the boundary comment ccxt's base sources (ts/src/base/Exchange.ts, PredictionExchange.ts)\n// carry and build/goTranspiler.ts re-assembles the generated file around\n\n// the Go numeric kinds. `<` `>` `<=` `>=` compile without a conversion only when\n// both operands carry the same one of these\nconst GO_NUMERIC_KINDS = [ 'int', 'int64', 'float64' ];\n\nconst ORDERED_COMPARISON_OPERATORS: { [kind: number]: string } = {\n [SyntaxKind.GreaterThanToken]: '>',\n [SyntaxKind.GreaterThanEqualsToken]: '>=',\n [SyntaxKind.LessThanToken]: '<',\n [SyntaxKind.LessThanEqualsToken]: '<=',\n};\n\n// hand-written BaseExchange fields (go/v4/exchange.go) declared `string`: their Go\n// value is never nil, so `this. + s` matches Add(field, s) exactly. The Go\n// struct field is what decides — a batch-A `Str` TS annotation (`version: Str`)\n// still prints this field as a plain Go string.\nconst GO_STRING_FIELD_NAMES = [ 'Id', 'Name', 'Version', 'Url', 'Hostname', 'UserAgent' ];\n\n// the hand-written SafeString-family methods (go/v4/exchange_safe.go) return a fresh\n// non-nil pointer whenever the call passes a non-nil default: the value branch takes\n// the address of the found string, the default branch the address of ToString(def).\nconst GO_DEFAULTED_SAFE_STRING_ARITY: { [name: string]: number } = {\n 'safeString': 3, 'safeStringLower': 3, 'safeStringUpper': 3,\n 'safeString2': 4, 'safeStringLower2': 4, 'safeStringUpper2': 4,\n 'safeStringN': 3, 'safeStringLowerN': 3, 'safeStringUpperN': 3,\n};\n\n// the default shapes derefScalar leaves non-nil: a literal default is never the absent\n// case, so the method's nil return is unreachable for a call carrying one\nconst GO_NON_NIL_DEFAULT_KINDS = [\n SyntaxKind.StringLiteral, SyntaxKind.NoSubstitutionTemplateLiteral,\n SyntaxKind.NumericLiteral, SyntaxKind.TrueKeyword, SyntaxKind.FalseKeyword,\n];\n\n// the operators that write their left operand: an assignment through any of them may\n// store a nil pointer where the deref proof expected the defaulted call's result\nconst GO_WRITE_OPERATOR_KINDS = [\n SyntaxKind.EqualsToken, SyntaxKind.PlusEqualsToken, SyntaxKind.MinusEqualsToken,\n SyntaxKind.AsteriskEqualsToken, SyntaxKind.SlashEqualsToken, SyntaxKind.PercentEqualsToken,\n];\n\n// hand-written BaseExchange fields (go/v4/exchange.go) declared as a container: an\n// element write on one of them is native code — a map index write, or `Store` for the\n// thread-safe ones, which is exactly what AddElementToObject does for a *sync.Map.\nconst GO_FIELD_CONTAINER_TYPES_NATIVE: { [name: string]: string } = Object.fromEntries([\n ...[\n 'Has', 'Api', 'TransformedApi', 'RequiredCredentials', 'HttpExceptions', 'Timeframes', 'Features',\n 'Exceptions', 'Precision', 'UserAgents', 'TokenBucket', 'CommonCurrencies', 'ProxyDictionaries',\n 'WsClients', 'Clients', 'Limits', 'Fees', 'Status', 'Countries',\n ].map((name) => [ name, 'map[string]any' ]),\n ...GO_SYNC_MAP_FIELDS.map((name) => [ name, '*sync.Map' ]),\n]);\n\n// operator kinds the arithmetic helpers are emitted for\nconst GO_ARITHMETIC_KINDS = [\n SyntaxKind.PlusToken,\n SyntaxKind.MinusToken,\n SyntaxKind.AsteriskToken,\n SyntaxKind.SlashToken,\n SyntaxKind.PercentToken,\n];\n\n// ---------------------------------------------------------------------------------------------\n// Trailing `//` comment alignment (gofmt's tabwriter cells).\n//\n// go/printer separates a trailing comment from the code with a hard tab (`writeCommentPrefix`),\n// so the code text is the last tab-terminated cell of the line. text/tabwriter pads that cell to\n// the widest cell of its column block plus `padding = 1` (gofmt runs with `minwidth = 0`,\n// `padding = 1`, `padchar = ' '`), which is why adjacent statements get their comments aligned\n// and a lone one gets exactly one space. A column block is the run of adjacent lines whose code\n// cell sits in the same column (same indentation); formfeeds terminate all columns, and\n// go/printer emits them between sections: blank and comment-only lines, a change of indentation,\n// each line of a multi-line expression (`binaryExpr` breaks with `newSection = true`) and every\n// statement that follows a multi-line one (`stmtList` breaks with `newSection = true`).\n//\n// The pass below reproduces that padding on the printed text. It is a no-op on text gofmt has\n// already aligned (verified over the whole go/v4 tree) and it never reflows or re-wraps a line.\n// ---------------------------------------------------------------------------------------------\n\n// a line whose code ends like this does not end its statement: the line below it belongs to the\n// same multi-line expression, and go/printer puts a formfeed before it (a new column block)\nconst GO_COMMENT_BREAK_END = /(?:[({[:]|[+\\-*/%&|^<>=!])$/;\n\n// the index just past the `\"`/`'` literal opening at `start` (backslash escapes skipped)\nfunction goSkipQuoted (text: string, start: number): number {\n let i = start + 1;\n while (i < text.length) {\n if (text[i] === '\\\\') {\n i += 2;\n continue;\n }\n if (text[i] === text[start]) {\n return i + 1;\n }\n i += 1;\n }\n return i;\n}\n\n// (opens - closes) of ()[]{} outside strings, so `foo(` (statement continues) and `}` (statement\n// ended before this line) are not mistaken for complete single-line statements\nfunction goBracketBalance (code: string): number {\n let depth = 0;\n let i = 0;\n while (i < code.length) {\n const ch = code[i];\n if ((ch === '\"') || (ch === '\\'')) {\n i = goSkipQuoted (code, i);\n continue;\n }\n if (ch === '`') {\n i += 1;\n while ((i < code.length) && (code[i] !== '`')) {\n i += 1;\n }\n i += 1;\n continue;\n }\n if ((ch === '(') || (ch === '[') || (ch === '{')) {\n depth += 1;\n } else if ((ch === ')') || (ch === ']') || (ch === '}')) {\n depth -= 1;\n }\n i += 1;\n }\n return depth;\n}\n\n// the return type the printer's own immediately-called func literal carries\n// (`func() T { … }()`), or undefined when the text is not one or T is an `any` box\nfunction goFuncLiteralReturnType (value: string): string | undefined {\n const literal = /^func\\(\\) ([\\w.[\\]]*) \\{/.exec(value);\n if ((literal === null) || !value.endsWith('}()') || (literal[1] === 'any')) {\n return undefined;\n }\n return literal[1];\n}\n\n// index of the first `//` outside strings and comments, or -1. The state is carried across lines\n// because `/* */` comments and `-quoted strings can span them (a `//` inside a string literal is\n// data, e.g. the `https://` of an endpoint, and must not be taken for a comment)\nfunction goTrailingCommentIndex (line: string, state: { block: boolean, raw: boolean }): number {\n let i = 0;\n while (i < line.length) {\n const ch = line[i];\n if (state.block) {\n if ((ch === '*') && (line[i + 1] === '/')) {\n state.block = false;\n i += 2;\n continue;\n }\n i += 1;\n continue;\n }\n if (state.raw) {\n if (ch === '`') {\n state.raw = false;\n }\n i += 1;\n continue;\n }\n if (ch === '`') {\n state.raw = true;\n i += 1;\n continue;\n }\n if ((ch === '\"') || (ch === '\\'')) {\n i = goSkipQuoted (line, i);\n continue;\n }\n if ((ch === '/') && (line[i + 1] === '/')) {\n return i;\n }\n if ((ch === '/') && (line[i + 1] === '*')) {\n state.block = true;\n i += 2;\n continue;\n }\n i += 1;\n }\n return -1;\n}\n\n// tabwriter counts runes, not bytes (a multi-byte identifier is one column wide)\nfunction goRuneWidth (text: string): number {\n return [ ...text ].length;\n}\n\nfunction alignGoTrailingComments (content: string): string {\n const lines = content.split ('\\n');\n const entries: { index: number, indent: string, code: string, comment: string }[] = [];\n const state = { 'block': false, 'raw': false };\n for (let index = 0; index < lines.length; index++) {\n const commentIndex = goTrailingCommentIndex (lines[index], state);\n if (commentIndex < 0) {\n continue;\n }\n // the code cell: everything before the comment, without the padding already inside it\n const code = lines[index].slice (0, commentIndex).replace (/[ \\t]+$/, '');\n if (!code.trim ()) {\n continue; // a comment-only line is a section break, it is never a cell\n }\n const indent = code.match (/^[ \\t]*/)[0];\n entries.push ({ 'index': index, indent, code, 'comment': lines[index].slice (commentIndex) });\n }\n // group the lines that share a code column: adjacent, same indentation, and no section break\n // in between (the previous line must end its own statement, and that statement must be a\n // single-line one, or the next statement starts a new section)\n const groups: typeof entries[] = [];\n let group: typeof entries = [];\n for (const entry of entries) {\n const previous = group[group.length - 1];\n const continues = previous\n && (entry.index === previous.index + 1)\n && (entry.indent === previous.indent)\n && (goBracketBalance (previous.code) === 0)\n && !GO_COMMENT_BREAK_END.test (previous.code);\n if (continues) {\n group.push (entry);\n } else {\n if (group.length) {\n groups.push (group);\n }\n group = [ entry ];\n }\n }\n if (group.length) {\n groups.push (group);\n }\n for (const members of groups) {\n let width = 0;\n for (const member of members) {\n width = Math.max (width, goRuneWidth (member.code));\n }\n width += 1; // tabwriter padding\n for (const member of members) {\n const pad = width - goRuneWidth (member.code);\n lines[member.index] = member.code + ' '.repeat (pad) + member.comment;\n }\n }\n return lines.join ('\\n');\n}\n\n// `/^this\\s*\\.\\s*\\s*\\(/` for each name: a call of that method on `this`\nfunction goThisCallPatterns (names: string[]): RegExp[] {\n return names.map((name) => new RegExp('^this\\\\s*\\\\.\\\\s*' + name + '\\\\s*\\\\('));\n}\n\n// the TypeScript accessors whose Go signature this printer knows to be `*string`\n// (GO_HELPER_RETURN_TYPES plus coerced SafeCurrencyCode/SafeSymbol); the textual call-site proof\n// uses them for ts/src sibling files a scoped run's program does not carry.\nconst GO_TS_SRC_STRING_PRODUCERS = goThisCallPatterns([\n 'safeString', 'safeString2', 'safeString3', 'safeStringN', 'safeStringLower', 'safeStringLower2',\n 'safeStringUpper', 'safeStringUpper2', 'safeCurrencyCode', 'safeSymbol',\n]);\n\n// the TS accessors whose Go signature GO_HELPER_RETURN_TYPES already names\n// `map[string]any`, for the same textual sibling-file proof. A map argument is also\n// proven when it is an object literal (its printed Go form is exactly that map) or a\nconst GO_TS_SRC_MAP_PRODUCERS = goThisCallPatterns([ 'extend', 'deepExtend', 'keysort', 'indexBy', 'groupBy' ]);\n\n// the argument texts of a call whose opening parenthesis sits at `open`, or undefined\n// when the parentheses do not balance — an unproven call site must never pass the proof\nfunction goBalancedCallArgs (text: string, open: number): string[] | undefined {\n const args: string[] = [];\n let depth = 0;\n let current = '';\n let quote: string | undefined;\n for (let i = open; i < text.length; i++) {\n const ch = text[i];\n if (quote !== undefined) {\n current += ch;\n if (ch === '\\\\') {\n current += text[i + 1] ?? '';\n i++;\n continue;\n }\n if (ch === quote) {\n quote = undefined;\n }\n continue;\n }\n if ((ch === '\"') || (ch === \"'\") || (ch === '`')) {\n quote = ch;\n current += ch;\n continue;\n }\n if ((ch === '/') && (text[i + 1] === '/')) {\n while ((i < text.length) && (text[i] !== '\\n')) { i++; }\n continue;\n }\n if (ch === '(') {\n depth++;\n if (depth > 1) { current += ch; }\n continue;\n }\n if (ch === ')') {\n depth--;\n if (depth === 0) {\n if (current.trim().length > 0) { args.push (current.trim ()); }\n return args;\n }\n current += ch;\n continue;\n }\n if ((ch === ',') && (depth === 1)) {\n args.push (current.trim ());\n current = '';\n continue;\n }\n current += ch;\n }\n return undefined;\n}\n\nexport {\n alignGoTrailingComments,\n};\n\n// implicit endpoints pass api (['v1', 'private']) and params (a list for batch orders) untyped;\n// exchange overrides of sign/fetch2/request usually omit the base `api: any` annotation\nconst GO_GETARG_EXCLUDED_POSITIONS: { [name: string]: number[] } = {\n 'fetch2': [ 1, 3 ],\n 'request': [ 1, 3 ],\n 'sign': [ 1, 3 ],\n};\n\n// base helpers typed `any[]` that hand back, at this index, the params map they were given\n// (unchanged, omitted or extended: always a map[string]any in Go)\nconst GO_PARAMS_TUPLE_HELPERS: { [name: string]: number } = {\n 'handleUntilOption': 1,\n 'handleNetworkCodeAndParams': 1,\n 'handleWithdrawTagAndParams': 1,\n 'handleTriggerAndParams': 1,\n 'handleTriggerDirectionAndParams': 1,\n 'handlePostOnly': 1,\n 'handleTriggerPricesAndParams': 3,\n};\n\n// receivers that read a nil map exactly like an untyped nil (derefScalar + a missed lookup);\n// IsDictionary and IsEqual answer differently for a nil map, so they are not listed\nconst GO_GETARG_NIL_MAP_READERS = [\n 'GetValue', 'InOp', 'ObjectKeys', 'SafeValue', 'SafeValue2', 'SafeDict', 'SafeList',\n 'SafeString', 'SafeString2', 'SafeStringN', 'SafeStringUpper', 'SafeStringLower',\n 'SafeInteger', 'SafeInteger2', 'SafeNumber', 'SafeNumber2', 'SafeFloat', 'SafeBool', 'SafeTimestamp',\n];\n\nexport class GoTranspiler extends BaseTranspiler {\n\n // scopes are scanned many times per local; walking remote TS7 nodes is costly, so the\n // preorder descendant list is built once per scope (same visit order and early stop)\n goScopeDescendants = new WeakMap();\n goDescendantsOf(scope): any[] {\n let list = this.goScopeDescendants.get(scope);\n if (list === undefined) {\n list = [];\n const out = list;\n const visit = (n: any) => {\n out.push(n);\n n.forEachChild(visit);\n };\n scope.forEachChild(visit);\n this.goScopeDescendants.set(scope, list);\n }\n return list;\n }\n\n hasNodeWhere(scope: Node | undefined, predicate: (n: any) => boolean): boolean {\n if (scope === undefined) {\n return false;\n }\n return this.goDescendantsOf(scope).some(predicate);\n }\n\n binaryExpressionsWrappers;\n wrapThisCalls: boolean;\n wrapCallMethods: string[] = [];\n // inherited method name -> indexes of required params that print `string` on the base and every\n // override (the caller audits all declarations); other callers convert through StringArg\n unifiedStringParams: { [method: string]: number[] } = {};\n // installed by the ccxt build: GetArg alias -> Go types, and the audited consumer table\n CCXT_GO_GETARG_DECLARED_TYPES: any;\n CCXT_GO_GETARG_SAFE_CONSUMERS: any;\n goGetArgTypeCache: WeakMap;\n goGetArgTypeComputing: Set;\n // declarations whose Go local type is being resolved right now (see goLocalStaticType)\n goLocalTypeResolution = new Set();\n // goSelfConcatIsString's answer per non-self leaf node\n goSelfConcatLeafCache = new WeakMap();\n goLocalStaticTypeCache = new WeakMap();\n // binary-expression texts and goNativeArithmetic types, keyed by node + print context, alive only\n // while the outermost binary print/typing runs: operand typing re-prints every nested operator\n goBinaryMemo: Map> | undefined;\n // appended to every async (channel returning) Go method/function name and to each\n // checker-resolved call site of one; '' disables the rename\n asyncMethodSuffix = '';\n // declaring-file patterns whose async methods keep the plain name at call sites (generated\n // endpoint bodies the target language implements itself, e.g. ccxt's ts/src/abstract/)\n asyncSuffixExemptPaths: RegExp[] = [];\n classNameMap: { [key: string]: string };\n DEFAULT_RETURN_TYPE = 'any';\n // suffix of the sibling body method an async trampoline hands its work to\n ASYNC_BODY_SUFFIX = 'Body';\n // gofmt indents every nesting level with exactly one tab; the printer emits the\n // same bytes so the generated tree needs no `gofmt` pass (campaign go-gofmt F01)\n DEFAULT_IDENTATION = \"\\t\";\n // stdlib packages the printed source file references. A Go import must precede the first\n // declaration, so the file-level print (printSourceFileStatements) collects names here and\n // prepends `import \"...\"`. Nested prints keep their own list; memo of goStdlibImportIsPlaceable().\n\n constructor(config = {}) {\n config['parser'] = Object.assign ({}, parserConfig, config['parser'] ?? {});\n\n super(config);\n\n this.requiresParameterType = true;\n this.requiresReturnType = true;\n this.asyncTranspiling = false;\n this.implicitAsyncTranspiling = true;\n this.supportsFalsyOrTruthyValues = false;\n this.requiresCallExpressionCast = true;\n this.wrapThisCalls = false;\n this.id = \"Go\";\n this.className = \"undefined\";\n this.classNameMap = config['classNameMap'] ?? {};\n this.initConfig();\n\n // user overrides\n this.applyUserOverrides(config);\n this.wrapThisCalls = config['wrapThisCalls'] ?? false;\n this.wrapCallMethods = config['wrapCallMethods'] ?? [];\n this.asyncMethodSuffix = config['asyncMethodSuffix'] ?? '';\n this.asyncSuffixExemptPaths = (config['asyncSuffixExemptPaths'] ?? []).map((p) => new RegExp(p));\n this.unifiedStringParams = config['unifiedStringParams'] ?? {};\n }\n\n initConfig() {\n this.LeftPropertyAccessReplacements = {\n // 'this': '$this',\n };\n\n this.RightPropertyAccessReplacements = {\n 'push': 'Add', // list method\n 'indexOf': 'IndexOf', // list method\n 'toUpperCase': 'ToUpper',\n 'toLowerCase': 'ToLower',\n 'toString': 'ToString',\n };\n\n this.FullPropertyAccessReplacements = {\n 'JSON.parse': 'parseJson', // custom helper method\n 'console.log': 'fmt.Println',\n 'Number.MAX_SAFE_INTEGER': 'Int32.MaxValue',\n 'Math.min': 'Math.Min',\n 'Math.max': 'Math.Max',\n 'Math.log': 'Math.Log',\n 'Math.abs': 'Math.Abs',\n // 'Math.ceil': 'Math.Ceiling', // need cast\n // 'Math.round': 'Math.Round', // need to cast\n 'Math.floor': 'Math.Floor',\n 'Math.pow': 'Math.Pow',\n // 'Promise.all': 'Task.WhenAll',\n };\n\n this.CallExpressionReplacements = {\n // \"parseInt\": \"parseINt\",\n // \"parseFloat\": \"float.Parse\",\n };\n\n this.ReservedKeywordsReplacements = {\n // 'string': 'str',\n // 'params': 'parameters',\n 'type': 'typeVar',\n // 'internal': 'intern',\n // 'event': 'eventVar',\n // 'fixed': 'fixedVar',\n };\n\n this.binaryExpressionsWrappers = {\n [SyntaxKind.EqualsEqualsToken]: [this.EQUALS_EQUALS_WRAPPER_OPEN, this.EQUALS_EQUALS_WRAPPER_CLOSE],\n [SyntaxKind.EqualsEqualsEqualsToken]: [this.EQUALS_EQUALS_WRAPPER_OPEN, this.EQUALS_EQUALS_WRAPPER_CLOSE],\n [SyntaxKind.ExclamationEqualsToken]: [this.DIFFERENT_WRAPPER_OPEN, this.DIFFERENT_WRAPPER_CLOSE],\n [SyntaxKind.ExclamationEqualsEqualsToken]: [this.DIFFERENT_WRAPPER_OPEN, this.DIFFERENT_WRAPPER_CLOSE],\n [SyntaxKind.GreaterThanToken]: [this.GREATER_THAN_WRAPPER_OPEN, this.GREATER_THAN_WRAPPER_CLOSE],\n [SyntaxKind.GreaterThanEqualsToken]: [this.GREATER_THAN_EQUALS_WRAPPER_OPEN, this.GREATER_THAN_EQUALS_WRAPPER_CLOSE],\n [SyntaxKind.LessThanToken]: [this.LESS_THAN_WRAPPER_OPEN, this.LESS_THAN_WRAPPER_CLOSE],\n [SyntaxKind.LessThanEqualsToken]: [this.LESS_THAN_EQUALS_WRAPPER_OPEN, this.LESS_THAN_EQUALS_WRAPPER_CLOSE],\n [SyntaxKind.PlusToken]: [this.PLUS_WRAPPER_OPEN, this.PLUS_WRAPPER_CLOSE],\n [SyntaxKind.MinusToken]: [this.MINUS_WRAPPER_OPEN, this.MINUS_WRAPPER_CLOSE],\n [SyntaxKind.AsteriskToken]: [this.MULTIPLY_WRAPPER_OPEN, this.MULTIPLY_WRAPPER_CLOSE],\n [SyntaxKind.PercentToken]: [this.MOD_WRAPPER_OPEN, this.MOD_WRAPPER_CLOSE],\n [SyntaxKind.SlashToken]: [this.DIVIDE_WRAPPER_OPEN, this.DIVIDE_WRAPPER_CLOSE],\n };\n }\n\n // getBlockOpen(identation){\n // return this.getIden(identation) + this.BLOCK_OPENING_TOKEN;\n // }\n\n printSuperCallInsideConstructor(node, identation) {\n return \"\"; // csharp does not need super call inside constructor\n }\n\n printStringLiteral(node) {\n const token = this.STRING_QUOTE_TOKEN;\n let text = node.text;\n if (text in this.StringLiteralReplacements) {\n return this.StringLiteralReplacements[text];\n }\n // skip the replaceAll passes when there is nothing to escape\n // note: single quotes must NOT be escaped — \\' is an invalid escape in Go string literals\n if (/[\\\\\"\\b\\f\\n\\r\\t]/.test(text)) {\n // Preserve real backslashes\n const backslashPlaceholder = \"\\x00\";\n text = text.replaceAll(\"\\\\\", backslashPlaceholder);\n text = text.replaceAll(\"\\b\", \"\\\\b\");\n text = text.replaceAll(\"\\f\", \"\\\\f\");\n text = text.replaceAll(\"\\n\", \"\\\\n\");\n text = text.replaceAll(\"\\r\", \"\\\\r\");\n text = text.replaceAll(\"\\t\", \"\\\\t\");\n text = text.replaceAll(backslashPlaceholder, \"\\\\\\\\\");\n text = text.replaceAll(\"\\\"\", \"\\\\\\\"\");\n }\n return token + text + token;\n }\n\n transformFunctionNameIfNeeded(name): string {\n return this.capitalize(name);\n }\n\n // The cells of one struct field in the shape gofmt's fieldList() prints them: a named\n // field is `Name Type [Tag]` (the name cell — and, when the field carries a tag, the type\n // cell too — is a tab-terminated column cell) and an embedded field is a single cell.\n // printStruct() lays those cells out; printPropertyDeclaration() joins them with spaces.\n getStructFieldCells(node) {\n const name = this.capitalize(this.printNode(node.name, 0));\n let type = 'any';\n if (node.type === undefined) {\n type = 'any';\n } else if (node.type.kind === SyntaxKind.StringKeyword) {\n type = 'string';\n } else if (node.type.kind === SyntaxKind.NumberKeyword) {\n type = 'int';\n } else if (node.type.kind === SyntaxKind.BooleanKeyword || isBooleanLiteral(node)) {\n type = 'bool';\n } else if (node.type.kind === SyntaxKind.ArrayType) {\n type = '[]any';\n }\n const cells = [ name, type ];\n if (node.initializer) {\n // we have to save the value and initialize it later\n let initializer = this.printNode(node.initializer, 0);\n // quick fix\n initializer = initializer.replaceAll('\"', '');\n cells.push(`\\`default:\"${initializer}\"\\``);\n }\n return cells;\n }\n\n printPropertyDeclaration(node, identation) {\n return this.getIden(identation) + this.getStructFieldCells(node).join(' ') + this.LINE_TERMINATOR;\n }\n\n printStruct(node, indentation) {\n\n const rows: string[][] = [];\n // check if we have heritage\n if (node?.heritageClauses?.length > 0) {\n const heritage = node.heritageClauses[0];\n const heritageType = heritage.types[0];\n let heritageEscapedText = heritageType.expression.text;\n if (this.classNameMap[heritageEscapedText]) {\n heritageEscapedText = this.classNameMap[heritageEscapedText];\n }\n // an embedded field has no type cell: it is a single, unterminated cell\n rows.push([ heritageEscapedText ]);\n }\n\n const propDeclarations = node.members.filter(member => member.kind === SyntaxKind.PropertyDeclaration);\n propDeclarations.forEach(member => rows.push(this.getStructFieldCells(member)));\n\n // gofmt lays the fields out with text/tabwriter (go/printer's fieldList): a column\n // block is a run of consecutive fields whose cell in that column is tab-terminated,\n // and every cell of the block is padded with spaces to the widest cell of the block\n // plus one. An embedded field (a single cell) and a field without a tag (its type is\n // the trailing cell) end the block of every column they have no cell in, which is\n // what keeps `Exchange` from widening the `exchangeTyped *ExchangeTyped` column.\n const lines = rows.map((cells, row) => {\n let line = cells[0];\n for (let column = 0; column < cells.length - 1; column++) {\n let width = 0;\n for (let previous = row; previous >= 0 && rows[previous].length > column + 1; previous--) {\n width = Math.max(width, rows[previous][column].length);\n }\n for (let next = row + 1; next < rows.length && rows[next].length > column + 1; next++) {\n width = Math.max(width, rows[next][column].length);\n }\n line += ' '.repeat(width + 1 - cells[column].length) + cells[column + 1];\n }\n return this.getIden(indentation + 1) + line;\n });\n\n // a struct with no fields is `type X struct {\\n}`: no stray blank line before the brace\n const body = lines.length ? '\\n' + lines.join('\\n') + '\\n' : '\\n';\n return `type ${this.className} struct {${body}}`;\n }\n\n printNewStructMethod(node){\n return `\nfunc New${this.capitalize(this.className)}() *${(this.className)} {\n\\tp := &${this.className}{}\n\\tsetDefaults(p)\n\\treturn p\n}\\n`;\n // TO remove `return copies lock value: github.com/ccxt/ccxt/go/v4.bitvavoWs contains github.com/ccxt/ccxt/go/v4.bitvavo contains github.com/ccxt/ccxt/go/v4.Exchange contains sync.Mutex`\n // change the return value to\n //\n // return `\n // func New${this.capitalize(className)}() *${(className)} {\n // p := ${className}{}\n // setDefaults(&p)\n // return &p\n // }\\n`;\n //\n\n }\n\n printClass(node, identation) {\n this.className = node.name.text;\n if (this.classNameMap[this.className]) {\n this.className = this.classNameMap[this.className];\n }\n\n const struct = this.printStruct(node, identation);\n const newMethod = this.printNewStructMethod(node);\n\n const methods = node.members.filter(member => member.kind === SyntaxKind.MethodDeclaration);\n const classMethods = this.joinTopLevelDecls(methods.map(method => this.printMethodDeclaration(method, identation)));\n // const classDefinition = this.printClassDefinition(node, identation);\n\n // const classBody = this.printClassBody(node, identation);\n\n // const classClosing = this.getBlockClose(identation);\n\n // return classDefinition + classBody + classClosing;\n return struct + \"\\n\" + newMethod + \"\\n\" + classMethods;\n }\n\n /**\n * gofmt's declaration-list rule (go/printer nodes.go `declList`): a top-level\n * declaration that carries a doc comment is separated from the previous declaration\n * by exactly one blank line (`min = 2` linebreaks), while a declaration without one\n * keeps the source's own separation (the printer emits members adjacent to the\n * closing brace above them). `printClass` used to join every member with a bare\n * \"\\n\", so a method whose leading `/** ... *` + `/` comment follows the previous\n * method's closing brace came out as `}\\n/**` and gofmt re-inserted the blank line.\n */\n joinTopLevelDecls (decls: string[]): string {\n return decls.map((decl, index) => {\n if (index === 0) {\n return decl;\n }\n return (this.startsWithComment(decl) ? \"\\n\\n\" : \"\\n\") + decl;\n }).join(\"\");\n }\n\n /**\n * True when the emitted declaration text opens with its doc comment - the comment\n * group gofmt attaches to the declaration (`getDoc(d) != nil` in go/printer).\n */\n startsWithComment (decl: string): boolean {\n return this.isComment(decl.split(\"\\n\")[0]);\n }\n\n /**\n * Indent every non-blank line of `lines` by `identation` levels. gofmt trims trailing\n * whitespace, so an indented *blank* line (only the indentation of a blank source\n * line) must stay empty instead of becoming whitespace-only text.\n */\n indentLines (lines: string[], identation: number): string[] {\n return lines.map((line) => line.trim().length === 0 ? \"\" : this.getIden(identation) + line);\n }\n\n printPropertyAccessModifiers (node) {\n return \"\";\n }\n\n printSpreadElement(node, identation) {\n const expression = this.printNode(node.expression, 0);\n return this.getIden(identation) + expression + this.SPREAD_TOKEN;\n }\n\n printMethodDeclaration(node, identation) {\n const methodDef = this.printMethodDefinition(node, identation);\n const isAsync = this.isAsyncFunction(node);\n const funcBody = this.printFunctionBody(node, identation, isAsync);\n if (!isAsync) {\n return methodDef + funcBody;\n }\n return this.printAsyncDeclarationPair(node, identation, methodDef, funcBody, true);\n }\n\n // Trampoline + body pair, see printAsyncTrampolineBlock. A module-scope `async function`\n // has no receiver: its body is a package-level sibling with the same trampoline contract.\n printAsyncDeclarationPair(node, identation, def: string, funcBody: string, isMethod: boolean): string {\n const goName = this.transformMethodNameIfNeeded(node.name.text);\n const bodyName = this.getAsyncBodyName(node, goName);\n const callee = isMethod ? `${this.THIS_TOKEN}.${bodyName}` : bodyName;\n const trampoline = def + this.printAsyncTrampolineBlock(node, identation, callee);\n const receiver = isMethod ? `(${this.THIS_TOKEN} *${this.className}) ` : \"\";\n const bodyDef = `${this.getIden(identation)}func ${receiver}${bodyName}(${this.printAsyncBodyParameters(node)}) ${this.DEFAULT_RETURN_TYPE} `;\n return trampoline + \"\\n\" + bodyDef + funcBody;\n }\n\n printFunctionDeclaration(node, identation) {\n if (isArrowFunction(node)) {\n const parameters = node.parameters.map(param => this.printParameter(param)).join(\", \");\n const body = this.printNode(node.body);\n return `(${parameters}) => ${body}`;\n }\n const isAsync = this.isAsyncFunction(node);\n const functionDef = this.printFunctionDefinition(node, identation);\n const funcBody = this.printFunctionBody(node, identation, isAsync);\n\n // printFunctionDefinition already carries the leading comment\n if (!isAsync) {\n return functionDef + funcBody;\n }\n return this.printAsyncDeclarationPair(node, identation, functionDef, funcBody, false);\n }\n\n /**\n * Name of the sibling *body* method/function an async core hands its work to.\n *\n * `FetchTicker` -> `fetchTickerBody`. Deliberately UNEXPORTED: the body is an\n * implementation detail of the trampoline, so it must not show up on the generated\n * interfaces (ICoreExchange) nor on the typed `*_wrapper.go` facades, and it stays\n * invisible to the reflection based `callInternal`/`callDynamically` dispatch.\n *\n * If that name is already taken by a real declaration (a hand written\n * `fetchTickerBody`), a numeric suffix is appended instead of silently clobbering it.\n */\n getAsyncBodyName(node, goName: string): string {\n const taken = new Set();\n const remember = (raw) => {\n if (!raw) {\n return;\n }\n const name = String(raw);\n taken.add(name);\n try {\n taken.add(this.transformMethodNameIfNeeded(name));\n } catch {\n // a malformed name must never break emission\n }\n };\n try {\n const parent = node?.parent;\n if (parent && isClassDeclarationNode(parent)) {\n parent.members.forEach((member: any) => remember(member?.name?.text));\n } else if (parent && isSourceFile(parent)) {\n parent.statements.forEach((statement: any) => {\n if (isFunctionDeclaration(statement)) {\n remember(statement?.name?.text);\n }\n });\n }\n } catch {\n // a malformed/synthesised node must never break emission\n }\n const base = goName.charAt(0).toLowerCase() + goName.slice(1) + this.ASYNC_BODY_SUFFIX;\n let name = base;\n let suffix = 0;\n while (taken.has(name)) {\n suffix++;\n name = `${base}${suffix}`;\n }\n return name;\n }\n\n /**\n * Parameter list of the body: the channel it must fill, then the original parameters\n * verbatim (including the `optionalArgs ...any` tail), so the trampoline can forward\n * its own arguments unchanged.\n */\n printAsyncBodyParameters(node): string {\n const params = this.printMethodParameters(node);\n const channelParam = `ch chan ${this.DEFAULT_RETURN_TYPE}`;\n return params ? `${channelParam}, ${params}` : channelParam;\n }\n\n /**\n * Arguments the trampoline forwards to its body, matching printMethodParameters:\n * the declared parameters in order, plus the variadic `optionalArgs...` tail when\n * the function has any defaulted parameter.\n */\n printAsyncTrampolineArgs(node): string {\n const args = [];\n let hasOptionalParameter = false;\n (node?.parameters ?? []).forEach((param) => {\n if (param.initializer) {\n hasOptionalParameter = true;\n return;\n }\n args.push(this.printNode(param.name, 0));\n });\n if (hasOptionalParameter) {\n args.push('optionalArgs...');\n }\n return args.join(\", \");\n }\n\n /**\n * The trampoline: an async core hands back a *hot handle*.\n *\n * func (this *Exchange) FetchTicker(symbol any) <-chan any {\n * ch := make(chan any, 1)\n * go this.fetchTickerBody(ch, symbol)\n * return ch\n * }\n *\n * - `ch` is buffered (cap 1): the body's single `ch <- value` never blocks, so a\n * result nobody ever receives still lets the goroutine finish and run\n * `defer close(ch)` (no leak for abandoned calls).\n * - the body runs on its own goroutine, so the call expression returns immediately\n * with work already in flight. That is what makes\n * `const a = this.fetchA (); const b = this.fetchB (); await Promise.all([a,b])`\n * overlap, exactly like the C#/Java ports, with no call-site wrapper.\n * - the result stays UNNAMED (`<-chan any`): `return ch` is the trampoline's only\n * statement and it always runs, because the recover (`defer ReturnPanicError(ch)`)\n * lives on the body, not here.\n */\n printAsyncTrampolineBlock(node, identation, callee: string): string {\n const args = this.printAsyncTrampolineArgs(node);\n const argList = args ? `, ${args}` : \"\";\n return [\n // F04: the signature above ends WITHOUT a trailing space, so the block opener\n // carries the one space before `{` (same contract as getBlockOpen)\n \" {\",\n `${this.getIden(identation + 1)}ch := make(chan ${this.DEFAULT_RETURN_TYPE}, 1)`,\n `${this.getIden(identation + 1)}go ${callee}(ch${argList})`,\n `${this.getIden(identation + 1)}return ch`,\n `${this.getIden(identation)}}`,\n ].join(\"\\n\");\n }\n\n /**\n * Go name of an async (channel returning) declaration: `fetchTicker` -> `FetchTickerAsync`.\n * Empty `asyncMethodSuffix` (the default) keeps the plain name, so the suffix is opt-in.\n */\n printAsyncDeclarationName(node, goName: string): string {\n if (!this.asyncMethodSuffix || !this.isAsyncFunction(node)) {\n return goName;\n }\n return goName + this.asyncMethodSuffix;\n }\n\n /**\n * Resolve the declaration a call/property access refers to and append `asyncMethodSuffix`\n * when it is an async function. Uses the checker, so `this.x()`, `super.x()`, `obj.x()` and\n * bare `x()` all agree with the declaration site. Unresolvable or non-function symbols\n * (properties, `any` receivers, JS builtins) keep the plain name.\n */\n applyAsyncSuffixToCallee(nameNode, goName: string): string {\n if (!this.asyncMethodSuffix || !nameNode) {\n return goName;\n }\n let decls;\n try {\n let symbol = this.getChecker().getSymbolAtLocation(nameNode);\n if (symbol && (symbol.flags & SymbolFlags.Alias)) {\n symbol = this.getChecker().getAliasedSymbol(symbol);\n }\n decls = symbol?.declarations?.map((d) => d.resolve());\n } catch {\n return goName;\n }\n if (!decls || decls.length === 0) {\n return goName;\n }\n // only declarations with a body count: interface/abstract signatures (e.g. implicit API\n // endpoints declared as `foo(params?: {}): Promise;`) are emitted elsewhere, unsuffixed\n const isAsyncDecl = decls.some((d) => (isMethodDeclaration(d) || isFunctionDeclaration(d))\n && d.body !== undefined && this.isAsyncFunction(d) && !this.isAsyncSuffixExempt(d));\n return isAsyncDecl ? goName + this.asyncMethodSuffix : goName;\n }\n\n isAsyncSuffixExempt(decl): boolean {\n if (this.asyncSuffixExemptPaths.length === 0) {\n return false;\n }\n const fileName = String(decl.getSourceFile()?.fileName ?? '').replace(/\\\\/g, '/');\n return this.asyncSuffixExemptPaths.some((re) => re.test(fileName));\n }\n\n printMethodDefinition(node, identation) {\n return this.printGoSignature(node, identation, `(${this.THIS_TOKEN} *${this.className}) `);\n }\n\n printFunctionDefinition(node, identation) {\n return this.printGoSignature(node, identation, \"\");\n }\n\n // F04: `func`, the receiver, the name and the return type are separated by exactly one\n // space, and the signature carries NO trailing space — the block opener (`getBlockOpen`,\n // or `printAsyncTrampolineBlock`) contributes the single space before `{`.\n printGoSignature(node, identation, receiver: string): string {\n const name = this.printAsyncDeclarationName(node, this.transformMethodNameIfNeeded(node.name.text));\n const returnType = this.printFunctionType(node).trim();\n const parsedArgs = this.printMethodParameters(node);\n const methodToken = this.METHOD_TOKEN ? this.METHOD_TOKEN + \" \" : \" \";\n const returnSignature = returnType ? \" \" + returnType : \"\";\n const methodDef = this.getIden(identation) + methodToken + receiver + name + \"(\" + parsedArgs + \")\" + returnSignature;\n return this.printNodeCommentsIfAny(node, identation, methodDef);\n }\n\n printMethodParameters(node) {\n const params = node.parameters.map(param => this.printParameter(param));\n const required = params.filter(param => param !== 'optional');\n if (required.length < params.length) {\n required.push('optionalArgs ...any');\n }\n return required.join(\", \");\n }\n\n printParameter(node, defaultValue = true) {\n const name = this.printNode(node.name, 0);\n const initializer = node.initializer;\n\n const type = this.printParameterType(node);\n\n if (defaultValue && initializer) {\n return 'optional'; // printMethodParameters folds these into `optionalArgs ...any`\n }\n return name + ' ' + type;\n }\n\n printParameterType(node) {\n // B-02: an internal method's parameter that the call-site proof types prints\n // its native Go type; every other parameter keeps the `any` box\n const nativeType = this.goNativeParameterType(node);\n if (nativeType !== undefined) {\n return nativeType;\n }\n return 'any';\n }\n\n printFunctionType(node){\n const typeText = this.getFunctionType(node);\n if (typeText === 'void') {\n return \"\";\n }\n if (typeText === undefined || (typeText !== this.VOID_KEYWORD && typeText !== this.PROMISE_TYPE_KEYWORD)) {\n const res = this.isAsyncFunction(node) ? `<-chan ${this.DEFAULT_RETURN_TYPE}` : this.DEFAULT_RETURN_TYPE;\n this.warn(node, node.name.getText(), \"Function return type not found, will default to: \" + res);\n return res;\n }\n if (typeText === this.PROMISE_TYPE_KEYWORD) {\n return `<-chan any`;\n }\n\n // move any trailing array brackets \"[]\" to directly precede the element type\n if (typeText && typeText.endsWith('[]')) {\n const core = typeText.substring(0, typeText.length - 2); // drop []\n const lastBracketPos = core.lastIndexOf(']');\n if (lastBracketPos !== -1) {\n // insert [] right after the last ']'\n return core.substring(0, lastBracketPos + 1) + '[]' + core.substring(lastBracketPos + 1);\n }\n }\n return typeText;\n }\n\n // true when the printed expression is a single call `Callee(...)` covering the\n // whole string, so its Go type is the callee's return type and nothing else\n isWholePrintedCall(value: string, open: number): boolean {\n let depth = 0;\n let inString = false;\n let escaped = false;\n for (let i = open; i < value.length; i++) {\n const c = value[i];\n if (inString) {\n if (escaped) { escaped = false; }\n else if (c === '\\\\') { escaped = true; }\n else if (c === '\"') { inString = false; }\n continue;\n }\n if (c === '\"') { inString = true; continue; }\n if (c === '(') { depth++; continue; }\n if (c === ')') {\n depth--;\n if (depth === 0) { return i === value.length - 1; }\n }\n }\n return false;\n }\n\n // the concrete Go type the initializer already produces, or undefined when the\n // printer cannot name it (GetValue, Ternary, Add, ... return any)\n goTypeOfInitializer(initializer, printedValue: string): string | undefined {\n // a `.slice(a, b)` this printer inlines to a Go subscript (or its guarded func\n // literal) still holds a string, so its local keeps the type the helper gave it\n if (this.goIsNativeSliceCall(initializer)) {\n return 'string';\n }\n switch (initializer?.kind) {\n case SyntaxKind.StringLiteral:\n case SyntaxKind.NoSubstitutionTemplateLiteral:\n return 'string';\n case SyntaxKind.TrueKeyword:\n case SyntaxKind.FalseKeyword:\n return 'bool';\n case SyntaxKind.ObjectLiteralExpression:\n return 'map[string]any';\n case SyntaxKind.ArrayLiteralExpression:\n return '[]any';\n case SyntaxKind.PrefixUnaryExpression:\n // `!x` prints `!EvalTruthy(x)`\n return (initializer.operator === SyntaxKind.ExclamationToken) ? 'bool' : undefined;\n case SyntaxKind.ParenthesizedExpression:\n return this.goTypeOfInitializer(initializer.expression, printedValue);\n case SyntaxKind.BinaryExpression: {\n // `a || b` prints `EvalTruthy(a) || EvalTruthy(b)`, a Go bool\n const op = initializer.operatorToken.kind;\n if ((op === SyntaxKind.BarBarToken) || (op === SyntaxKind.AmpersandAmpersandToken)) {\n return 'bool';\n }\n // `a === b` prints either `IsEqual(a, b)` or an inlined `(a == b)`;\n // `a < b` prints either `IsLessThan(a, b)` or an inlined `(a < b)`.\n // All of them are Go bools.\n if ((op === SyntaxKind.EqualsEqualsToken) || (op === SyntaxKind.EqualsEqualsEqualsToken)\n || (op === SyntaxKind.ExclamationEqualsToken) || (op === SyntaxKind.ExclamationEqualsEqualsToken)\n || (ORDERED_COMPARISON_OPERATORS[op] !== undefined)) {\n return 'bool';\n }\n // a `+` chain goNativeStringConcat prints as the Go operator is a Go string\n if ((op === SyntaxKind.PlusToken) && (this.goNativeArithmetic(initializer)?.goType === 'string')) {\n return 'string';\n }\n break;\n }\n case SyntaxKind.CallExpression: {\n // `x.toString()` that printToStringCall inlined to the receiver's own text: the\n // declaration then holds that receiver's value, i.e. the same Go string. Every\n // other receiver keeps the helper call, whose own return type is classified below.\n const property = initializer.expression;\n if ((property?.kind === SyntaxKind.PropertyAccessExpression)\n && (property.name?.text === 'toString')\n && (initializer.arguments?.length === 0)\n && ((this.goOperandStaticType(property.expression, printedValue) === 'string')\n || this.goDerefableStringOperand(property.expression))) {\n return 'string';\n }\n break;\n }\n }\n // `const x = (a === b)` prints the wrapping parentheses of the source\n const value = this.goUnwrapPrintedParens(printedValue);\n const open = value.indexOf('(');\n // the printer's own emissions are immediately-called func literals: the native\n // `key in obj` returns a Go bool (no EvalTruthy round-trip), and a ternary whose\n // arms print as one scalar returns that scalar — both name the value natively\n const literalType = goFuncLiteralReturnType(value);\n if ((literalType !== undefined) && (GO_TYPE_NAMES.indexOf(literalType) >= 0)) {\n return literalType;\n }\n // the nil-guarded `indexOf` literal holds the same Go int GetIndexOf returned\n if (value.startsWith('func() int {') && value.endsWith('}()')) {\n return 'int';\n }\n if (open <= 0 || !this.isWholePrintedCall(value, open)) {\n return undefined;\n }\n const callee = value.substring(0, open);\n if (!/^[A-Za-z_][\\w.]*$/.test(callee)) {\n return undefined;\n }\n return GO_NATIVE_CALL_RETURN_TYPES[callee] ?? GO_HELPER_RETURN_TYPES[callee];\n }\n\n // strips the wrapping parentheses the source (or an operand) printed around a\n // whole expression, so the inner text can be classified\n goUnwrapPrintedParens(printedText: string): string {\n let value = (printedText ?? '').trim();\n while (value.startsWith('(') && this.isWholePrintedCall(value, 0)) {\n value = value.substring(1, value.length - 1).trim();\n }\n return value;\n }\n\n // the concrete Go type of a `var x T = ` local, undefined for `any`\n goLocalStaticType(node): string | undefined {\n const declaration: any = this.getChecker().getSymbolAtLocation(node)?.valueDeclaration?.resolve();\n if (declaration?.kind !== SyntaxKind.VariableDeclaration || declaration.initializer === undefined) {\n return undefined;\n }\n if (declaration.parent?.parent?.kind !== SyntaxKind.FirstStatement) {\n return undefined; // declared with `:=`, where the printer annotates nothing\n }\n if (this.goLocalTypeResolution.has(declaration)) {\n return undefined; // the safety scan below prints an expression using this same local\n }\n // only a top-level answer is stable: nested ones see the recursion guard above\n const topLevel = this.goLocalTypeResolution.size === 0;\n if (topLevel && this.goLocalStaticTypeCache.has(declaration)) {\n return this.goLocalStaticTypeCache.get(declaration);\n }\n this.goLocalTypeResolution.add(declaration);\n try {\n const goType = this.getGoLocalType(declaration, this.printNode(declaration.initializer, 0));\n if (topLevel) {\n this.goLocalStaticTypeCache.set(declaration, goType);\n }\n return goType;\n } finally {\n this.goLocalTypeResolution.delete(declaration);\n }\n }\n\n // `x := ` takes the Go type of the printed initializer, and a `for` initializer carries no\n // annotation, so only decidable literal shapes are named: untyped integer constant is `int`,\n // floating-point is `float64`. Integers not fitting `int` and other initializers keep the helper.\n goInferredLocalStaticType(node): string | undefined {\n const checker: any = this.checkerOrUndefined();\n if (checker === undefined) {\n return undefined;\n }\n const declaration = checker.getSymbolAtLocation(node)?.valueDeclaration?.resolve();\n if (declaration?.kind !== SyntaxKind.VariableDeclaration || declaration.initializer === undefined) {\n return undefined;\n }\n const declarationList = declaration.parent;\n if (declarationList?.kind !== SyntaxKind.VariableDeclarationList\n || declarationList.parent?.kind === SyntaxKind.FirstStatement) {\n return undefined; // the `var x = …` form the printer writes a type on\n }\n const kind = this.goNumericLiteralKind(declaration.initializer);\n if ((kind === 'int') && !this.goLiteralFitsKind(declaration.initializer, 'int')) {\n return undefined;\n }\n return kind;\n }\n\n // `this.` read of a hand-written BaseExchange string field\n goStringFieldStaticType(node, printedText: string): string | undefined {\n const match = /^this\\.([A-Za-z_]\\w*)$/.exec(this.goUnwrapPrintedParens(printedText));\n if (match === null || GO_STRING_FIELD_NAMES.indexOf(match[1]) < 0) {\n return undefined;\n }\n // the struct field is a plain Go `string`: a string cannot be nil, so Add's\n // nil branch is unreachable and every read is the same non-nil string\n return 'string';\n }\n\n // a parameter the printer's own signature printer types with a concrete Go scalar:\n // the emitted Go parameter holds that type at every use, so the operator rule can\n // consume it (the typed-param families re-type `Str`/`Int`/`Num` params this way)\n goDeclaredParamStaticType(node): string | undefined {\n const checker: any = this.checkerOrUndefined();\n if (checker === undefined) {\n return undefined;\n }\n const declaration = checker.getSymbolAtLocation(node)?.valueDeclaration?.resolve();\n if (declaration?.kind !== SyntaxKind.Parameter) {\n return undefined;\n }\n // a defaulted parameter bound through `GetArgString` & co. is that Go scalar\n const bound = this.goGetArgParameterType(declaration);\n if ((bound !== undefined) && (GO_TYPE_NAMES.indexOf(bound) >= 0) && ['string', 'int64', 'float64'].includes(bound)) {\n return bound;\n }\n let type;\n try {\n type = this.printParameterType(declaration);\n } catch (e) {\n return undefined;\n }\n if ((typeof type !== 'string') || (type === 'any') || (GO_TYPE_NAMES.indexOf(type) < 0)) {\n return undefined;\n }\n return this.goTypeNameIsShadowed(this.goEnclosingFunction(declaration), type) ? undefined : type;\n }\n\n // a `*string` local prints a nilable Go pointer; it may only be dereferenced\n // where the checker narrowed it to a non-nilable string (a guard that always\n // exits, an `if (x !== undefined)` block). TypeScript `undefined` == Go nil here.\n goNilProvenStringDeref(node): boolean {\n if (node?.kind !== SyntaxKind.Identifier) {\n return false;\n }\n if (this.goDeclaredTypeOfIdentifier(node) !== '*string') {\n return false;\n }\n const checker: any = this.checkerOrUndefined();\n if (checker === undefined) {\n return false;\n }\n const type = checker.getTypeAtLocation(node);\n return (type.flags & TypeFlags.StringLike) !== 0;\n }\n\n // a `*string` local every write of which is a SafeString-family call with a literal\n // default: that Go method can only return a fresh non-nil pointer, so the local may\n // be deref'd even where the checker offers no narrowing. One write of any other\n goDefaultedSafeStringLocal(node): boolean {\n if (node?.kind !== SyntaxKind.Identifier) {\n return false;\n }\n let declaration;\n try {\n declaration = this.getChecker().getSymbolAtLocation(node)?.valueDeclaration?.resolve();\n } catch (e) {\n return false;\n }\n if ((declaration?.kind !== SyntaxKind.VariableDeclaration) || (declaration.name?.kind !== SyntaxKind.Identifier)) {\n return false;\n }\n if (this.goDeclaredTypeOfIdentifier(node) !== '*string') {\n return false;\n }\n if (!this.goDefaultedSafeStringCall(declaration.initializer)) {\n return false;\n }\n const scope = this.goEnclosingFunction(declaration);\n if (scope === undefined) {\n return false;\n }\n const name = declaration.name.text;\n let everyWriteDefaulted = true;\n const visit = (n) => {\n if (!everyWriteDefaulted) {\n return;\n }\n if ((n.kind === SyntaxKind.Identifier) && (n.text === name) && (n !== declaration.name)) {\n const parent: any = n.parent;\n if ((parent?.kind === SyntaxKind.BinaryExpression) && (parent.left === n)\n && (GO_WRITE_OPERATOR_KINDS.indexOf(parent.operatorToken?.kind) >= 0)) {\n everyWriteDefaulted = (parent.operatorToken.kind === SyntaxKind.EqualsToken)\n && this.goDefaultedSafeStringCall(parent.right);\n return;\n }\n if ((parent?.kind === SyntaxKind.PrefixUnaryExpression) || (parent?.kind === SyntaxKind.PostfixUnaryExpression)) {\n everyWriteDefaulted = false;\n return;\n }\n }\n n.forEachChild(visit);\n };\n scope.forEachChild(visit);\n return everyWriteDefaulted;\n }\n\n // a call to one of the hand-written SafeString-family methods that passes enough\n // arguments for the default and whose default is a literal (never the absent case)\n goDefaultedSafeStringCall(node): boolean {\n const call: any = node;\n if (call?.kind !== SyntaxKind.CallExpression) {\n return false;\n }\n const callee: any = call.expression;\n if ((callee?.kind !== SyntaxKind.PropertyAccessExpression) || (callee.expression?.kind !== SyntaxKind.ThisKeyword)) {\n return false;\n }\n const arity = GO_DEFAULTED_SAFE_STRING_ARITY[callee.name?.text];\n if ((arity === undefined) || ((call.arguments?.length ?? 0) < arity)) {\n return false;\n }\n const last: any = call.arguments[call.arguments.length - 1];\n return GO_NON_NIL_DEFAULT_KINDS.indexOf(last?.kind) >= 0;\n }\n\n // a `*string` leaf the concat may deref: the checker narrowed it to a non-nilable\n // string at that use, a local whose every write is a defaulted SafeString-family\n // call, or such a call inline\n goDerefableStringOperand(node): boolean {\n if (this.goNilProvenStringDeref(node)) {\n return true;\n }\n if (node?.kind === SyntaxKind.Identifier) {\n return this.goDefaultedSafeStringLocal(node);\n }\n return this.goDefaultedSafeStringCall(node);\n }\n\n // the printed text of a `+` operand the concat rule may use: the printer's own\n // text for a proven string, or the deref goNativeBinaryText adds for a derefable\n // `*string` leaf. undefined keeps the helper call.\n goStringConcatOperandType(node, printedText: string): string | undefined {\n if (this.goConcatDerefableStringOperand(node)) {\n return 'string';\n }\n return (this.goOperandStaticType(node, printedText) === 'string') ? 'string' : undefined;\n }\n\n // `Add(Add(a, \"lit\"), b)` and every other `+` chain whose leaves are all non-nil\n // Go strings: the runtime Add only ever takes its string branch for those, so the\n // chain prints as the Go operator (`a + \"lit\" + b`). Anything else keeps the call.\n goNativeStringConcat(node, leftText: string, rightText: string): { goType: string, text: string } | undefined {\n if (this.goStringConcatOperandType(node.left, leftText) === undefined\n || this.goStringConcatOperandType(node.right, rightText) === undefined) {\n return undefined;\n }\n return { 'goType': 'string', 'text': this.goNativeBinaryText(node, '+', leftText, rightText) };\n }\n\n // Go static type of an operand's printed form: 'string', 'int', 'int64',\n // 'float64', or 'const-int' / 'const-float' (an untyped literal). undefined when\n // the printer cannot name it — a nilable/`any` operand keeps the helper call.\n goOperandStaticType(node, printedText: string): string | undefined {\n switch (node?.kind) {\n case SyntaxKind.StringLiteral:\n case SyntaxKind.NoSubstitutionTemplateLiteral:\n return 'string';\n case SyntaxKind.NumericLiteral:\n return /^[0-9]+$/.test(node.text) ? 'const-int' : this.goConstFloatStaticType(node);\n case SyntaxKind.ParenthesizedExpression:\n return this.goOperandStaticType(node.expression, this.goUnwrapPrintedParens(printedText));\n case SyntaxKind.BinaryExpression:\n return this.goConstantProductKind(node) ?? this.goNativeArithmeticType(node);\n case SyntaxKind.Identifier:\n return this.goLocalStaticType(node) ?? this.goInferredLocalStaticType(node) ?? this.goDeclaredParamStaticType(node);\n case SyntaxKind.PropertyAccessExpression:\n // `a.length` / `s.replace(...)` print as helper calls, `this.Id` as a field\n return this.goStringFieldStaticType(node, printedText) ?? this.goStringCallStaticType(node, printedText);\n }\n return this.goStringCallStaticType(node, printedText);\n }\n\n // the Go type the printed expression already produces; '*string' / '*int64'\n // helpers box a nilable pointer, so those keep the helper call as well\n goStringCallStaticType(node, printedText: string): string | undefined {\n // the operator needs the printed expression's *static* Go type. A helper whose\n // Go signature returns `any` (GetValue, Ternary, ...) prints an interface box even\n // when a classifier can name the value inside it — that value only becomes\n // typed through an assertion at a declaration, never inline as an operand.\n if (GO_ANY_BOX_CALLS.indexOf(this.goPrintedCallee(printedText)) >= 0) {\n return undefined;\n }\n const goType = this.goTypeOfInitializer(node, printedText);\n return ('string' === goType || 'int' === goType || 'int64' === goType || 'float64' === goType) ? goType : undefined;\n }\n\n // an untyped Go floating-point constant: the helper boxes it as float64 and the\n // compiler converts the operand to float64 the same way\n goConstFloatStaticType(node): string | undefined {\n const text = node?.text;\n if ((typeof text !== 'string') || !/^[0-9][.eE]/.test(text)) {\n return undefined;\n }\n return Number.isFinite(Number(text.replaceAll('_', ''))) ? 'const-float' : undefined;\n }\n\n isNonZeroIntegerLiteral(node): boolean {\n if (node?.kind === SyntaxKind.ParenthesizedExpression) {\n return this.isNonZeroIntegerLiteral(node.expression);\n }\n return node?.kind === SyntaxKind.NumericLiteral && /^[1-9][0-9]*$/.test(node.text);\n }\n\n isNonZeroFloatLiteral(node): boolean {\n if (node?.kind === SyntaxKind.ParenthesizedExpression) {\n return this.isNonZeroFloatLiteral(node.expression);\n }\n return (this.goConstFloatStaticType(node) !== undefined) && (Number(node.text.replaceAll('_', '')) !== 0);\n }\n\n // the exact value of a constant-only integer expression, undefined otherwise. Go folds `a * b`\n // over literals in arbitrary precision, so it must fit `int` and stay exact for the helper's\n // float64 path — the bound the caller checks.\n goConstantIntValue(node): number | undefined {\n if (node?.kind === SyntaxKind.ParenthesizedExpression) {\n return this.goConstantIntValue(node.expression);\n }\n if (node?.kind === SyntaxKind.NumericLiteral) {\n return /^[0-9]+$/.test(node.text) ? Number(node.text) : undefined;\n }\n if (node?.kind !== SyntaxKind.BinaryExpression) {\n return undefined;\n }\n const left = this.goConstantIntValue(node.left);\n const right = (left === undefined) ? undefined : this.goConstantIntValue(node.right);\n if (right === undefined) {\n return undefined;\n }\n switch (node.operatorToken.kind) {\n case SyntaxKind.PlusToken: return left + right;\n case SyntaxKind.MinusToken: return left - right;\n case SyntaxKind.AsteriskToken: return left * right;\n case SyntaxKind.SlashToken: return (right === 0) ? undefined : Math.trunc(left / right);\n case SyntaxKind.PercentToken: return (right === 0) ? undefined : left % right;\n }\n return undefined;\n }\n\n // an arithmetic expression that is the whole initializer of a printed `var x T = ...`: the\n // declared-local table owns that position (naming int64 when its int-kind proof holds, with the\n // forced unbox), so the operator rule leaves the call to it.\n goInsideTypedDeclarationInitializer(node): boolean {\n let current = node;\n while (current !== undefined) {\n const parent = current.parent;\n if (parent?.kind === SyntaxKind.ParenthesizedExpression && (parent.expression === current)) {\n current = parent;\n continue;\n }\n if (parent?.kind === SyntaxKind.BinaryExpression && ((parent.left === current) || (parent.right === current))\n && (GO_ARITHMETIC_KINDS.indexOf(parent.operatorToken.kind) >= 0)) {\n current = parent;\n continue;\n }\n break;\n }\n const declaration = current?.parent;\n if (declaration?.kind !== SyntaxKind.VariableDeclaration || declaration.initializer !== current) {\n return false;\n }\n // the printer annotates `var x T = ...` only; `x := ...` carries the\n // initializer's own type instead\n return declaration.parent?.parent?.kind === SyntaxKind.FirstStatement;\n }\n\n // The bare Go operator must yield what the runtime helper returns (go/v4/exchange_helpers.go):\n // Add keeps int/int64, while Subtract/Multiply/Divide/Mod take an exact int64 path or a float64\n // path, so only the rows below are equivalent.\n goNativeNumericResultType(op, leftType: string, rightType: string, node): string | undefined {\n const isIntKind = (kind: string) => (kind === 'int') || (kind === 'int64') || (kind === 'const-int');\n const isFloatKind = (kind: string) => (kind === 'float64') || (kind === 'const-float');\n const leftNode = node.left;\n const rightNode = node.right;\n const constKinds = ['const-int', 'const-float'];\n if ((op === SyntaxKind.AsteriskToken) && constKinds.includes(leftType) && constKinds.includes(rightType)) {\n // literal products fold as exact Go constants (may differ from the float64 helper in the last bit)\n return this.goNativeConstantProductType(node, leftType, rightType);\n }\n if (isFloatKind(leftType) !== isFloatKind(rightType)) {\n return undefined; // Go has no operator that mixes an int and a float64 operand\n }\n if (isFloatKind(leftType) && isFloatKind(rightType)) {\n // the helper's float path is float64 arithmetic; its integral result boxes\n // as int64, the same normalization Subtract/Multiply/Divide already accept.\n // A constant operand must stay exactly representable: Go folds a constant\n if (op === SyntaxKind.PercentToken) {\n return undefined; // Mod is math.Mod, no Go operator matches it\n }\n if (((leftType === 'const-float') && (rightType === 'const-float'))) {\n return undefined; // only a value the compiler folds exactly would match\n }\n if ((op === SyntaxKind.SlashToken) && !this.isNonZeroFloatLiteral(rightNode)) {\n return undefined; // Divide returns nil on a zero divisor, / gives Inf\n }\n return 'float64';\n }\n if (!isIntKind(leftType) || !isIntKind(rightType)) {\n return undefined; // string / nilable / `any` operand: the helper's nil paths stay\n }\n if ((leftType === 'int64' && rightType === 'int') || (leftType === 'int' && rightType === 'int64')) {\n return undefined; // neither operand is untyped, Go refuses to mix the kinds\n }\n if ((leftType === 'const-int') && (rightType === 'const-int')) {\n // a constant-only expression is folded in arbitrary precision by the Go\n // compiler: require a value both kinds hold exactly, so no `constant\n // overflows int` and the helper's float64 path is exact as well\n const value = this.goConstantIntValue(node);\n if ((value === undefined) || (Math.abs(value) > Number.MAX_SAFE_INTEGER)) {\n return undefined;\n }\n }\n const operands = ((leftType === 'int64') || (rightType === 'int64')) ? 'int64' : 'int';\n if (op === SyntaxKind.PlusToken) {\n // Add keeps its own int/int64 rows: its box carries the operand kind\n return operands;\n }\n if ((op === SyntaxKind.SlashToken) && this.isNonZeroIntegerLiteral(rightNode)) {\n return 'float64'; // JS division: goNativeArithmetic converts the operands to float64\n }\n if ((operands === 'int') && this.goInsideTypedDeclarationInitializer(node)) {\n // the declared-local table names this position int64 when its int-kind\n // proof holds, and the `int` an operator would yield is not that type\n return undefined;\n }\n if (op === SyntaxKind.PercentToken) {\n // Mod is math.Mod over float64: exact for integral operands, but a zero\n // divisor boxes NaN where % panics, so only a literal divisor is decidable\n return this.isNonZeroIntegerLiteral(rightNode) ? operands : undefined;\n }\n if ((op === SyntaxKind.SlashToken) && !this.isNonZeroIntegerLiteral(rightNode)) {\n return undefined; // Divide returns nil on a zero divisor, the operator panics\n }\n // int64 in, int64 out: Subtract goes through ParseInt, Multiply/Mod use reflect Int()\n return operands;\n }\n\n // a literal-only `*` chain is itself an untyped Go constant, so an enclosing product folds too\n goConstantProductKind(node): string | undefined {\n if (node?.kind === SyntaxKind.ParenthesizedExpression) {\n return this.goConstantProductKind(node.expression);\n }\n if (node?.kind === SyntaxKind.NumericLiteral) {\n return /^[0-9]+$/.test(node.text) ? 'const-int' : this.goConstFloatStaticType(node);\n }\n if ((node?.kind !== SyntaxKind.BinaryExpression) || (node.operatorToken.kind !== SyntaxKind.AsteriskToken)) {\n return undefined;\n }\n const left = this.goConstantProductKind(node.left);\n const right = (left === undefined) ? undefined : this.goConstantProductKind(node.right);\n if ((right === undefined) || (this.goNativeConstantProductType(node, left, right) === undefined)) {\n return undefined;\n }\n return ((left === 'const-float') || (right === 'const-float')) ? 'const-float' : 'const-int';\n }\n\n // `2 * 1.67` is an untyped float constant (float64); an integer chain stays an untyped int\n // constant, which a typed `var x int64 = ...` declaration converts, so it is named int64 there.\n goNativeConstantProductType(node, leftType: string, rightType: string): string | undefined {\n if ((leftType === 'const-float') || (rightType === 'const-float')) {\n return 'float64';\n }\n const value = this.goConstantIntValue(node);\n if ((value === undefined) || (Math.abs(value) > Number.MAX_SAFE_INTEGER)) {\n return undefined;\n }\n return this.goInsideTypedDeclarationInitializer(node) ? 'int64' : 'int';\n }\n\n // an operand that is itself a bare operator expression needs parens under a\n // tighter parent operator; a whole helper call is already delimited\n goNativeOperandText(node, printedText: string): string {\n const text = printedText.trim();\n if (node?.kind !== SyntaxKind.BinaryExpression || text.startsWith('(')) {\n return text;\n }\n const open = text.indexOf('(');\n if (open > 0 && this.isWholePrintedCall(text, open)) {\n return text;\n }\n // `a + b` on strings is the only shape that can never sit under a tighter\n // operator, so it is the only one left unwrapped\n return (this.goOperandStaticType(node, text) === 'string') ? text : '(' + text + ')';\n }\n\n // goNativeArithmetic's Go type for an operand (memoized within the enclosing binary print)\n goNativeArithmeticType(node): string | undefined {\n const key = `type|${this.goBinaryContextKey()}`;\n return this.goBinaryMemoized(node, key, () => this.goNativeArithmetic(node)?.goType);\n }\n\n // `Add(a, b)` & co. become the Go operator when both printed operands already\n // hold a concrete Go type the helper would return unchanged; undefined keeps the\n // helper call (nil branches, `any` boxes, strings passed to Subtract, ...).\n goNativeArithmetic(node, leftText = undefined, rightText = undefined): { goType: string, text: string } | undefined {\n const op = node.operatorToken.kind;\n if (GO_ARITHMETIC_KINDS.indexOf(op) < 0) {\n return undefined;\n }\n leftText = leftText ?? this.printNode(node.left, 0);\n rightText = rightText ?? this.printNode(node.right, 0);\n if (op === SyntaxKind.PlusToken) {\n const concat = this.goNativeStringConcat(node, leftText, rightText);\n if (concat !== undefined) {\n return concat;\n }\n }\n const pointerSubtraction = this.goNonNilPointerSubtractionText(node, leftText, rightText);\n if (pointerSubtraction !== undefined) {\n return { 'goType': 'int64', 'text': pointerSubtraction };\n }\n const pointerProduct = this.goNonNilPointerProductText(node, leftText, rightText);\n if (pointerProduct !== undefined) {\n return { 'goType': 'int64', 'text': pointerProduct };\n }\n const pointerDivision = this.goNonNilPointerDivisionText(node, leftText, rightText);\n if (pointerDivision !== undefined) {\n return { 'goType': 'float64', 'text': pointerDivision };\n }\n const leftType = this.goOperandStaticType(node.left, leftText);\n const rightType = this.goOperandStaticType(node.right, rightText);\n if (leftType === undefined || rightType === undefined) {\n return undefined;\n }\n if (leftType === 'string' || rightType === 'string') {\n if (leftType !== 'string' || rightType !== 'string' || op !== SyntaxKind.PlusToken) {\n return undefined; // the other four helpers return nil for strings\n }\n return { 'goType': 'string', 'text': this.goNativeBinaryText(node, '+', leftText, rightText) };\n }\n const widened = this.goNativeIntWideningArithmetic(node, leftType, rightType, leftText, rightText);\n if (widened !== undefined) {\n return widened;\n }\n const goType = this.goNativeNumericResultType(op, leftType, rightType, node);\n if (goType === undefined) {\n return undefined;\n }\n const isIntKind = (kind: string) => (kind === 'int') || (kind === 'int64') || (kind === 'const-int');\n if ((op === SyntaxKind.SlashToken) && isIntKind(leftType) && isIntKind(rightType)) {\n return { goType, 'text': this.goFloatDivisionText(node, leftType, rightType, leftText, rightText) };\n }\n return { goType, 'text': this.goNativeBinaryText(node, this.SupportedKindNames[op], leftText, rightText) };\n }\n\n // `a - b` where each side is a non-nil `*int64` (dereferenced), an int64 value or an int literal and at\n // least one side is a pointer: Subtract's integral result is the same int64 box\n goNonNilPointerSubtractionText(node, leftText: string, rightText: string): string | undefined {\n if (node.operatorToken.kind !== SyntaxKind.MinusToken) {\n return undefined;\n }\n const left = this.goInt64Operand(node.left, leftText);\n const right = (left === undefined) ? undefined : this.goInt64Operand(node.right, rightText);\n if ((right === undefined) || (!left.pointer && !right.pointer)) {\n return undefined;\n }\n return left.text + ' - ' + right.text;\n }\n\n goInt64Operand(node, printedText: string): { pointer: boolean, text: string } | undefined {\n const text = this.goUnwrapPrintedParens(printedText.trim());\n if (node?.kind === SyntaxKind.ParenthesizedExpression) {\n return this.goInt64Operand(node.expression, text);\n }\n if (node?.kind === SyntaxKind.NumericLiteral) {\n return (/^[0-9]+$/.test(node.text) && (Number(node.text) <= Number.MAX_SAFE_INTEGER)) ? { 'pointer': false, text } : undefined;\n }\n if (node?.kind === SyntaxKind.Identifier) {\n if ((this.goDeclaredTypeOfIdentifier(node) === '*int64') && this.goPointerNumberIsNonNil(node)) {\n return { 'pointer': true, 'text': '*' + text };\n }\n return (this.goOperandStaticType(node, text) === 'int64') ? { 'pointer': false, text } : undefined;\n }\n if (this.goDefaultedSafeIntegerCall(node)) {\n return { 'pointer': true, 'text': '*' + text };\n }\n if ((node?.kind === SyntaxKind.CallExpression) && (this.goOperandStaticType(node, text) === 'int64')) {\n return { 'pointer': false, text };\n }\n return undefined;\n }\n\n // `a * b` over the same operands as the subtraction (or a nested int64 product): Multiply's\n // Int-kind branch returns the same wrapping int64 product\n goNonNilPointerProductText(node, leftText: string, rightText: string): string | undefined {\n if (node.operatorToken.kind !== SyntaxKind.AsteriskToken) {\n return undefined;\n }\n const left = this.goInt64ProductOperand(node.left, leftText);\n const right = (left === undefined) ? undefined : this.goInt64ProductOperand(node.right, rightText);\n if ((right === undefined) || (!left.pointer && !right.pointer)) {\n return undefined;\n }\n return left.text + ' * ' + right.text;\n }\n\n goInt64ProductOperand(node, printedText: string): { pointer: boolean, text: string } | undefined {\n let inner = node;\n while (inner?.kind === SyntaxKind.ParenthesizedExpression) {\n inner = inner.expression;\n }\n if ((inner?.kind === SyntaxKind.BinaryExpression) && (this.goNativeArithmeticType(inner) === 'int64')) {\n const text = printedText.trim();\n return { 'pointer': false, 'text': text.startsWith('(') ? text : '(' + text + ')' };\n }\n return this.goInt64Operand(node, printedText);\n }\n\n // this.safeInteger{,2,N} with an integer literal default: the Go method returns &default on every nil path\n goDefaultedSafeIntegerCall(node): boolean {\n if ((node?.kind !== SyntaxKind.CallExpression) || (node.expression?.kind !== SyntaxKind.PropertyAccessExpression)\n || (node.expression.expression?.kind !== SyntaxKind.ThisKeyword)) {\n return false;\n }\n const arity = { 'safeInteger': 3, 'safeInteger2': 4, 'safeIntegerN': 3 }[node.expression.name?.text];\n const last = node.arguments?.[arity - 1];\n return (arity !== undefined) && (node.arguments.length === arity) && (last?.kind === SyntaxKind.NumericLiteral)\n && /^[0-9]+$/.test(last.text);\n }\n\n // `x / N` on a non-nil `*int64` with a nonzero integer literal N, passed whole to Math.floor/ceil/round\n // or parseToInt: those read Divide's int64-when-integral box and the float64 quotient alike\n // (`*float64` keeps the helper: -0 and ±Inf box differently)\n goNonNilPointerDivisionText(node, leftText: string, rightText: string): string | undefined {\n if ((node.operatorToken.kind !== SyntaxKind.SlashToken) || !this.isNonZeroIntegerLiteral(node.right)) {\n return undefined;\n }\n const left = node.left;\n const declared = this.goDeclaredTypeOfIdentifier(left);\n if (declared !== '*int64') {\n return undefined;\n }\n if (!this.goPointerNumberIsNonNil(left) || !this.goDivisionConsumerIgnoresBox(node)) {\n return undefined;\n }\n return 'float64(*' + leftText.trim() + ') / ' + this.goUnwrapPrintedParens(rightText.trim());\n }\n\n // the checker narrowed the identifier to a plain number here, or an enclosing guard tests it\n goPointerNumberIsNonNil(ident): boolean {\n if (this.goHasEnclosingNilGuard(ident)) {\n return true;\n }\n const checker: any = this.checkerOrUndefined();\n if (checker === undefined) {\n return false;\n }\n const type = checker.getTypeAtLocation(ident);\n return (type !== undefined) && ((type.flags & TypeFlags.NumberLike) !== 0);\n }\n\n // the division (through parens) is the only argument of this.parseToInt or Math.floor/ceil/round\n goDivisionConsumerIgnoresBox(node): boolean {\n let child = node;\n let parent = node.parent;\n while (parent?.kind === SyntaxKind.ParenthesizedExpression) {\n child = parent;\n parent = parent.parent;\n }\n if ((parent?.kind !== SyntaxKind.CallExpression) || (parent.arguments?.length !== 1) || (parent.arguments[0] !== child)) {\n return false;\n }\n const callee = parent.expression;\n if (callee?.kind !== SyntaxKind.PropertyAccessExpression) {\n return false;\n }\n const owner = callee.expression;\n const name = callee.name?.text;\n if (owner?.kind === SyntaxKind.ThisKeyword) {\n return name === 'parseToInt';\n }\n return (owner?.kind === SyntaxKind.Identifier) && (owner.text === 'Math') && ['floor', 'ceil', 'round'].includes(name);\n }\n\n // int / int is a float64 division as in JS: typed operands convert, and with two constants\n // the left one does (an untyped constant operand then converts implicitly)\n goFloatDivisionText(node, leftType: string, rightType: string, leftText: string, rightText: string): string {\n const castLeft = (leftType !== 'const-int') || (rightType === 'const-int');\n const castRight = rightType !== 'const-int';\n const cast = (printed: string) => 'float64(' + this.goUnwrapPrintedParens(printed.trim()) + ')';\n const left = castLeft ? cast(leftText) : this.goNativeOperandText(node.left, leftText);\n const right = castRight ? cast(rightText) : this.goNativeOperandText(node.right, rightText);\n return left + ' / ' + right;\n }\n\n // the operator line gofmt prints for a natively emitted arithmetic expression: the\n // blanks follow go/printer's cutoff at the current depth, and a binary operand is\n // re-printed at the expression's own depth (a same-precedence left operand, or the\n // parentheses the printer wraps it in, which undo the one level the operand adds)\n goNativeBinaryText(node, symbol: string, leftText: string, rightText: string): string {\n const operandText = (operand, printed: string) => {\n const isBinary = operand?.kind === SyntaxKind.BinaryExpression;\n const text = isBinary ? this.goWithExprDepth(this.goExprDepth, () => this.printNode(operand, 0)) : printed;\n // a derefable `*string` leaf is the only operand that prints in a different\n // shape than the printer produced: the operator needs its pointee\n const leaf = this.goConcatDerefableStringOperand(operand) ? ('*' + text.trim()) : text;\n return this.goNativeOperandText(operand, leaf);\n };\n const left = operandText(node.left, leftText);\n const right = operandText(node.right, rightText);\n const separator = this.goBinarySeparator(symbol, right, node.left, node.right);\n return left + separator + symbol + separator + right;\n }\n\n // `x += y` prints `x = Add(x, y)`; the compound operator is equivalent while\n // both sides hold a concrete Go type that can never make the helper return nil\n goNativeCompoundAssignment(op, leftNode, leftText: string, rightNode, rightText: string): string | undefined {\n const leftType = this.goOperandStaticType(leftNode, leftText);\n const rightType = this.goOperandStaticType(rightNode, rightText);\n if (leftType === undefined || rightType === undefined) {\n return undefined;\n }\n const isAdd = op === SyntaxKind.PlusEqualsToken;\n const isSubtract = op === SyntaxKind.MinusEqualsToken;\n if (!isAdd && !isSubtract) {\n return undefined;\n }\n const stringAdd = leftType === 'string' && isAdd && rightType === 'string';\n const int64Op = leftType === 'int64' && (rightType === 'int64' || rightType === 'const-int');\n if (!stringAdd && !int64Op) {\n return undefined;\n }\n return `${leftText.trim()} ${isAdd ? '+=' : '-='} ${rightText.trim()}`;\n }\n\n goEnclosingFunction(node) {\n let current = node?.parent;\n while (current) {\n switch (current.kind) {\n case SyntaxKind.MethodDeclaration:\n case SyntaxKind.FunctionDeclaration:\n case SyntaxKind.FunctionExpression:\n case SyntaxKind.ArrowFunction:\n case SyntaxKind.Constructor:\n case SyntaxKind.SourceFile:\n return current;\n }\n current = current.parent;\n }\n return undefined;\n }\n\n // a transpiled parameter or local can literally be named `string`, which would\n // turn `var x string = ...` into a reference to that value instead of the type\n goTypeNameIsShadowed(scope, goType: string): boolean {\n const names = goType.match(/[A-Za-z_]\\w*/g) ?? [];\n const relevant = names.filter((n) => GO_TYPE_NAMES.indexOf(n) >= 0);\n if (relevant.length === 0 || scope === undefined) {\n return false;\n }\n return this.hasNodeWhere(scope, (n: any) => {\n const isBinding = (n.kind === SyntaxKind.Parameter) || (n.kind === SyntaxKind.VariableDeclaration);\n if (isBinding && (n.name?.kind === SyntaxKind.Identifier)) {\n if (relevant.indexOf(n.name.text as string) >= 0) { return true; }\n }\n return false;\n });\n }\n\n // the shape `x.push(v)` that both the native emission and the declaration's safety\n // scan accept: the printed `x = append(x, v)` is a statement, so a value position or\n // a multi-argument/spread call still needs the helper\n goIsNativeAppendShape(receiverNode, pushNode): boolean {\n if (receiverNode?.kind !== SyntaxKind.Identifier) {\n return false;\n }\n if (pushNode?.parent?.kind !== SyntaxKind.ExpressionStatement) {\n return false;\n }\n if ((pushNode.questionDotToken !== undefined) || (pushNode.expression?.questionDotToken !== undefined)) {\n return false;\n }\n const access = pushNode.expression;\n if ((access?.kind !== SyntaxKind.PropertyAccessExpression) || (access.expression !== receiverNode)\n || (access.name?.text !== 'push')) {\n return false;\n }\n const args = pushNode.arguments;\n return (args?.length === 1) && (args[0].kind !== SyntaxKind.SpreadElement);\n }\n\n // `x.push(v)` on a local declared `[]any` prints `x = append(x, v)`; undefined keeps\n // AppendToArray(&x, v). An `any` box keeps the helper: `&x` is a *any there, while a declared\n // []any local would pass a *[]any the helper's parameter does not accept.\n goNativeAppendReceiver(pushNode): string | undefined {\n const receiver = pushNode?.expression?.expression;\n if (!this.goIsNativeAppendShape(receiver, pushNode)) {\n return undefined;\n }\n if (this.goDeclaredTypeOfIdentifier(receiver) !== '[]any') {\n return undefined;\n }\n return this.printNode(receiver, 0);\n }\n\n // reject the refinement when something downstream needs the local to stay `any`:\n // `x.push(v)` prints `AppendToArray(&x, v)` (a *T is not a *any) and a later\n // assignment of a value with another concrete type would stop compiling\n goLocalIsSafeToType(scope, declaration, varName: string, goType: string): boolean {\n if (scope === undefined) {\n return false;\n }\n const safe = !this.hasNodeWhere(scope, (n: any) => {\n if ((n.kind === SyntaxKind.Identifier) && (n.text === varName) && (n !== declaration.name)) {\n const parent = n.parent;\n if (parent?.kind === SyntaxKind.PropertyAccessExpression && parent.expression === n\n && parent.name?.text === 'push') {\n // a []any local appends natively, so its receiver may be typed; every\n // other push shape keeps the helper and with it the box\n if ((goType !== '[]any') || !this.goIsNativeAppendShape(n, parent.parent)) {\n return true;\n }\n }\n if (parent?.kind === SyntaxKind.VariableDeclaration && parent.name === n) {\n return; // a sibling block-scoped declaration; it gets its own type\n }\n if ((parent?.kind === SyntaxKind.PostfixUnaryExpression) || (parent?.kind === SyntaxKind.PrefixUnaryExpression)) {\n const op = parent.operator;\n if ((op === SyntaxKind.PlusPlusToken) || (op === SyntaxKind.MinusMinusToken)) {\n return true;\n }\n }\n if (parent?.kind === SyntaxKind.SpreadElement) {\n return true;\n }\n if (parent?.kind === SyntaxKind.ArrayLiteralExpression\n && parent.parent?.kind === SyntaxKind.BinaryExpression\n && parent.parent.left === parent\n && parent.parent.operatorToken.kind === SyntaxKind.EqualsToken\n && !((goType === 'map[string]any') && this.goGetArgTupleWriteIsDict(declaration, parent.parent.right, parent.elements.indexOf(n)))) {\n return true;\n }\n if (parent?.kind === SyntaxKind.BinaryExpression && parent.left === n) {\n const op = parent.operatorToken.kind;\n if (op === SyntaxKind.EqualsToken) {\n if ((goType === 'string') && this.goSelfConcatWriteIsString(parent.right, varName)) {\n return false;\n }\n if ((this.goTypeOfInitializer(parent.right, this.printNode(parent.right, 0)) !== goType)\n && !((declaration.kind === SyntaxKind.VariableDeclaration) && this.goPointerWriteConversion(parent.right, goType) !== undefined)) {\n return true;\n }\n } else if ((op === SyntaxKind.PlusEqualsToken) && (goType === 'string')\n && (this.goOperandStaticType(parent.right, this.printNode(parent.right, 0)) === 'string')) {\n return false;\n } else if ((op >= SyntaxKind.FirstCompoundAssignment) && (op <= SyntaxKind.LastCompoundAssignment)) {\n return true;\n }\n }\n }\n return false;\n });\n return safe;\n }\n\n // `x = <+ chain>` that reads x itself: only a whole chain prints native (a bare\n // derefable leaf would be assigned as the *string it is)\n goSelfConcatWriteIsString(node, varName: string): boolean {\n while (node?.kind === SyntaxKind.ParenthesizedExpression) {\n node = node.expression;\n }\n if ((node?.kind !== SyntaxKind.BinaryExpression) || (node.operatorToken.kind !== SyntaxKind.PlusToken)) {\n return false;\n }\n const readsSelf = this.hasNodeWhere(node, (n: any) => (n.kind === SyntaxKind.Identifier) && (n.text === varName));\n return readsSelf && this.goSelfConcatIsString(node, varName);\n }\n\n // a `+` chain written back into a `string` local (`x = x + \"&\" + y`, `x += y`): every leaf is\n // the local itself (a Go string by the typing being proven) or a proven non-nil Go string,\n // so the chain prints native and the local only ever holds a string\n goSelfConcatIsString(node, varName: string): boolean {\n while (node?.kind === SyntaxKind.ParenthesizedExpression) {\n node = node.expression;\n }\n if ((node?.kind === SyntaxKind.Identifier) && (node.text === varName)) {\n return true;\n }\n if ((node?.kind === SyntaxKind.BinaryExpression) && (node.operatorToken.kind === SyntaxKind.PlusToken)) {\n return this.goSelfConcatIsString(node.left, varName) && this.goSelfConcatIsString(node.right, varName);\n }\n if (this.hasNodeWhere(node, (n: any) => (n.kind === SyntaxKind.Identifier) && (n.text === varName))) {\n return false;\n }\n const cache = this.goSelfConcatLeafCache;\n if (cache.has(node)) {\n return cache.get(node);\n }\n // an answer computed while another local is being resolved may be the guard's `any`\n const settled = (this.goLocalTypeResolution.size === 0);\n const result = this.goStringConcatOperandType(node, this.printNode(node, 0)) === 'string';\n if (settled) {\n cache.set(node, result);\n }\n return result;\n }\n\n // How a write of another shape reaches a pointer-typed local: 'nil' (undefined/null prints nil),\n // 'wrap' (a Go string becomes SafeStringPtr(v), never nil), or undefined (not convertible).\n // Shared by goLocalIsSafeToType (admission) and goPointerWriteText (emission).\n goPointerWriteConversion(right, goType: string): 'nil' | 'wrap' | undefined {\n while (right?.kind === SyntaxKind.ParenthesizedExpression) {\n right = right.expression;\n }\n if (!['*string', '*int64', '*float64'].includes(goType) || right === undefined) {\n return undefined;\n }\n if ((right.kind === SyntaxKind.NullKeyword) || (right.kind === SyntaxKind.UndefinedKeyword)\n || ((right.kind === SyntaxKind.Identifier) && (right.text === 'undefined'))) {\n return 'nil';\n }\n if ((goType === '*string') && (this.goTypeOfInitializer(right, this.printNode(right, 0)) === 'string')) {\n return 'wrap';\n }\n return undefined;\n }\n\n // `x = \"limit\"` on a *string local prints `x = SafeStringPtr(\"limit\")`; undefined otherwise\n goPointerWriteText(node, identation): string | undefined {\n const { left, right } = node;\n if (left?.kind !== SyntaxKind.Identifier) {\n return undefined;\n }\n const decl: any = this.checkerOrUndefined()?.getSymbolAtLocation(left)?.valueDeclaration?.resolve();\n if (decl?.kind !== SyntaxKind.VariableDeclaration) {\n return undefined;\n }\n const goType = this.goDeclaredTypeOfIdentifier(left);\n if ((goType === undefined) || (this.goPointerWriteConversion(right, goType) !== 'wrap')) {\n return undefined;\n }\n const value = this.goWithExprDepth(this.goExprDepth + 1, () => this.printNode(right, identation)).trim();\n return `${this.printNode(left, 0)} = SafeStringPtr(${value})`;\n }\n\n // the container/key argument nodes of a whole `this.SafeDict(container, key)` call, or undefined\n // for another shape. A third argument is droppable only when it is the empty map literal\n // (`safeDict(x, k, {})`), which no whitelisted read could observe.\n goSafeDictLocalArgs(initializer) {\n return this.goSafeAccessorLocalArgs(initializer, 'safeDict', SyntaxKind.ObjectLiteralExpression, 'properties');\n }\n\n // shared by the dict/list rules: `this.(container, key[, ])`\n goSafeAccessorLocalArgs(initializer, accessor: string, fallbackKind: SyntaxKind, fallbackItems: string) {\n if (initializer?.kind !== SyntaxKind.CallExpression) {\n return undefined;\n }\n const callee: any = initializer.expression;\n if (callee?.kind !== SyntaxKind.PropertyAccessExpression || callee.name?.text !== accessor) {\n return undefined;\n }\n if (callee.expression?.kind !== SyntaxKind.ThisKeyword) {\n return undefined;\n }\n const args = initializer.arguments;\n if (args.length === 3) {\n const fallback = args[2];\n if (fallback?.kind !== fallbackKind || fallback[fallbackItems].length !== 0) {\n return undefined;\n }\n } else if (args.length !== 2) {\n return undefined;\n }\n return { container: args[0], key: args[1] };\n }\n\n // one later use of a dict local: it must read the value as a dictionary, never hand the\n // box out. Only the receiver position of the deref-aware read helpers, the `this.Safe*`\n // accessors and a plain `x[k]` element read qualify.\n goSafeDictUseReadsTheMap(node): boolean {\n const parent: any = node.parent;\n if (parent === undefined) {\n return false;\n }\n switch (parent.kind) {\n case SyntaxKind.ElementAccessExpression: {\n if (parent.expression !== node) {\n return false; // x as an index key\n }\n const grandparent: any = parent.parent;\n if (grandparent?.kind === SyntaxKind.BinaryExpression && grandparent.left === parent) {\n return false; // `x[k] = v` / `x[k] += v` writes into the map\n }\n if ((grandparent?.kind === SyntaxKind.PostfixUnaryExpression) || (grandparent?.kind === SyntaxKind.PrefixUnaryExpression)) {\n return false; // `x[k]++` / `&x[k]`\n }\n if (grandparent?.kind === SyntaxKind.DeleteExpression) {\n return false;\n }\n return true;\n }\n case SyntaxKind.BinaryExpression: {\n // `key in x` prints `InOp(x, key)`: the helper reads the map and answers false for\n // an absent (nil) map, exactly like the nil interface it used to hold\n return (parent.operatorToken?.kind === SyntaxKind.InKeyword) && (parent.right === node);\n }\n case SyntaxKind.CallExpression: {\n if (parent.expression === node) {\n return false; // the local called as a function\n }\n if (parent.arguments.indexOf(node) !== 0) {\n return false; // value position: the box escapes\n }\n const callee = this.goPrintedCallee(this.printNode(parent, 0));\n if (callee === undefined) {\n return false;\n }\n if (GO_SAFE_DICT_READ_HELPERS.indexOf(callee) >= 0) {\n return true;\n }\n return /^(?:this\\.)?Safe[A-Z]/.test(callee) || (callee === 'this.IsDictionary');\n }\n default:\n return false;\n }\n }\n\n // `var x any = this.SafeDict(container, key)` -> `var x map[string]any = SafeMapTyped(...)`:\n // same member read, and every later use reads the local; with the absent case a nil map,\n // GetValue/InOp/ObjectKeys/IsDictionary and Safe* normalise a nil receiver. Else keep the box.\n goSafeDictLocalUnboxCache = new Map();\n\n // memoised, re-entrancy-guarded typing of a `var x T = …` declaration statement; a for-init\n // or any other shape prints `:=`, where the annotation would not appear\n goCachedLocalUnbox(cache: Map, declaration, compute: () => string | undefined): string | undefined {\n if (declaration?.kind !== SyntaxKind.VariableDeclaration || declaration.name?.kind !== SyntaxKind.Identifier) {\n return undefined;\n }\n if (declaration.parent?.parent?.kind !== SyntaxKind.FirstStatement) {\n return undefined;\n }\n if (cache.has(declaration)) {\n return cache.get(declaration);\n }\n cache.set(declaration, undefined); // in-progress guard\n let result: string | undefined;\n try {\n result = compute();\n } finally {\n cache.set(declaration, result);\n }\n return result;\n }\n\n goSafeDictLocalUnbox(declaration): string | undefined {\n return this.goCachedLocalUnbox(this.goSafeDictLocalUnboxCache, declaration, () => this.goSafeDictLocalUnboxUncached(declaration));\n }\n\n // every read of `declaration`'s name inside its function must keep the boxed value's meaning for\n // the local to take a named Go type: a rebinding mixes two values, and a use `readsTheValue`\n // rejects re-boxes the local. `skipUse` drops nodes that are not references at all.\n goDeclaredLocalTypeIfSafe(declaration, goType: string, readsTheValue: (n: any) => boolean, skipUse?: (n: any) => boolean): string | undefined {\n const sourceName = declaration.name.text as string;\n const scope: any = this.goEnclosingFunction(declaration);\n if (scope === undefined) {\n return undefined;\n }\n const unsafe = this.hasNodeWhere(scope, (n: any) => {\n if ((n.kind === SyntaxKind.VariableDeclaration || n.kind === SyntaxKind.Parameter)\n && (n !== declaration) && (n.name?.kind === SyntaxKind.Identifier) && (n.name.text === sourceName)) {\n return true; // a shadowing binding would mix two values under one name\n }\n if ((n.kind !== SyntaxKind.Identifier) || (n.text !== sourceName) || (n === declaration.name)) {\n return false;\n }\n return (skipUse !== undefined && skipUse(n)) ? false : !readsTheValue(n);\n });\n if (unsafe || this.goTypeNameIsShadowed(scope, goType)) {\n return undefined;\n }\n return goType;\n }\n\n goSafeDictLocalUnboxUncached(declaration): string | undefined {\n if (this.goSafeDictLocalArgs(declaration.initializer) === undefined) {\n return undefined;\n }\n return this.goDeclaredLocalTypeIfSafe(declaration, GO_SAFE_DICT_LOCAL_TYPE, (n) => this.goSafeDictUseReadsTheMap(n));\n }\n\n // the initializer a typed dict local is declared with: the accessor call is replaced by the\n // typed reader, which reads the same member (and converts a sync.Map) but names the result\n goSafeDictUnboxValue(declaration, identation: number): string | undefined {\n if (this.goSafeDictLocalUnbox(declaration) !== GO_SAFE_DICT_LOCAL_TYPE) {\n return undefined;\n }\n const args: any = this.goSafeDictLocalArgs(declaration.initializer);\n const container = this.printNode(args.container, identation);\n const key = this.printNode(args.key, 0);\n return `SafeMapTyped(${container}, ${key})`;\n }\n\n // the TypeScript return type proves the boxed value is the market dictionary: the checker reports\n // the `MarketInterface` interface for `this.Market(...)` / `this.SafeMarket(...)` (the `Market`\n // alias is the same interface unioned with undefined). Read from the checker, never a printed name.\n goMarketCallReturnsDict(initializer): boolean {\n if (initializer?.kind !== SyntaxKind.CallExpression) {\n return false;\n }\n const callee: any = initializer.expression;\n if (callee?.kind !== SyntaxKind.PropertyAccessExpression) {\n return false;\n }\n const name = callee.name?.text;\n if (name === undefined) {\n return false;\n }\n const receiver: any = callee.expression;\n const onThis = receiver?.kind === SyntaxKind.ThisKeyword;\n const onDerived = (receiver?.kind === SyntaxKind.PropertyAccessExpression)\n && (receiver.expression?.kind === SyntaxKind.ThisKeyword)\n && (receiver.name?.text === 'DerivedExchange');\n if (!onThis && !onDerived) {\n return false;\n }\n const checker: any = this.checkerOrUndefined();\n if (checker === undefined) {\n return false;\n }\n const type = checker.getTypeAtLocation(initializer);\n if (type === undefined) {\n return false;\n }\n const isMarketInterface = (t) => {\n const names = [ t?.getSymbol()?.name, t?.getAliasSymbol()?.name ];\n return (names.indexOf('MarketInterface') >= 0) || (names.indexOf('CurrencyInterface') >= 0);\n };\n if (isMarketInterface(type)) {\n return true;\n }\n if ((typeof type.isUnionType === 'function') && type.isUnionType()) {\n return type.getTypes().some((t) => isMarketInterface(t));\n }\n return false;\n }\n\n // `var market any = this.Market(symbol)` -> `var market map[string]any = MapTyped(...)`.\n // The box holds the dictionary the checker proved and every later use reads it (SafeDict's scan),\n // so this is a pure refinement. A value position, nil test or map write keeps the box.\n goMarketLocalUnboxCache = new Map();\n\n goMarketLocalUnbox(declaration): string | undefined {\n return this.goCachedLocalUnbox(this.goMarketLocalUnboxCache, declaration, () => this.goMarketLocalUnboxUncached(declaration));\n }\n\n // true when this identifier resolves to the declaration being typed (a property name or a\n // binding of the same name in another scope is not a use of the local). Without checker\n // information the name match stands.\n goIdentifierRefersToDeclaration(node, declaration): boolean {\n const checker: any = this.checkerOrUndefined();\n if (checker === undefined) {\n return true;\n }\n const symbol = checker.getSymbolAtLocation(node);\n if (symbol === undefined) {\n return true;\n }\n const valueDeclaration = symbol.valueDeclaration?.resolve() ?? symbol.declarations?.map((d) => d.resolve())?.[0];\n return (valueDeclaration === undefined) || (valueDeclaration === declaration);\n }\n\n // one later use of the market local: the dictionary read shapes SafeDict proves (element read,\n // `in`, read-helper argument), plus — only when the accessor throws rather than answers absent —\n // a plain argument position, since Go re-boxes the map into the callee's `any` as the box did.\n goMarketUseReadsTheValue(node, throwingAccessor: boolean): boolean {\n if (this.goSafeDictUseReadsTheMap(node)) {\n return true;\n }\n const parent: any = node.parent;\n if ((parent?.kind === SyntaxKind.ElementAccessExpression) && (parent.expression === node) && this.goIsComparedOperand(parent)) {\n return true;\n }\n if (!throwingAccessor) {\n return false;\n }\n return (parent?.kind === SyntaxKind.CallExpression)\n && (parent.expression !== node) && (parent.arguments.indexOf(node) >= 0);\n }\n\n goMarketLocalUnboxUncached(declaration): string | undefined {\n if (!this.goMarketCallReturnsDict(declaration.initializer)) {\n return undefined;\n }\n // the throwing accessors (`this.market`, `this.currency`) panic instead of answering absent, so\n // the boxed result is always a dictionary and passing the local re-boxes the same map into the\n // callee's `any`. The Safe* accessors may answer their own optional argument: read shapes only.\n const accessorName = declaration.initializer.expression?.name?.text;\n const throwingAccessor = (accessorName === 'market') || (accessorName === 'currency');\n // `this.market(…)` carries the same name as the local: a property/method name is not\n // a reference, and neither is a different binding of the same name\n return this.goDeclaredLocalTypeIfSafe(declaration, GO_MARKET_LOCAL_TYPE,\n (n) => this.goMarketUseReadsTheValue(n, throwingAccessor),\n (n) => ((n.parent?.kind === SyntaxKind.PropertyAccessExpression) && (n.parent.name === n))\n || !this.goIdentifierRefersToDeclaration(n, declaration));\n }\n\n // the initializer a typed market local is declared with: the same call, its boxed result\n // converted to the map the checker proved (nil when the call answered a non-map)\n goMarketUnboxValue(declaration, parsedValue: string): string | undefined {\n if (this.goMarketLocalUnbox(declaration) !== GO_MARKET_LOCAL_TYPE) {\n return undefined;\n }\n return `MapTyped(${parsedValue.trimStart()})`;\n }\n\n // the variable declaration an identifier binds to, through the checker (undefined for every\n // other shape) — the market rule resolves its own locals this way, never by printed name\n goDeclarationOfIdentifier(node): any {\n try {\n const symbol = this.getChecker().getSymbolAtLocation(node);\n const declaration = symbol?.valueDeclaration?.resolve() ?? symbol?.declarations?.map((d) => d.resolve())?.[0];\n if (declaration?.kind === SyntaxKind.VariableDeclaration) {\n return declaration;\n }\n } catch (e) {\n return undefined;\n }\n return undefined;\n }\n\n // a compared element of a market/currency local keeps the GetValue helper: its deref is what\n // the boxed local's read used to apply, and a parseMarket may have stored a `*bool`/`*string`\n // under the key. Only the operands the use scan admits this way are affected; every other\n goMarketComparisonElementRead(node): boolean {\n const base: any = node?.expression;\n if (base?.kind !== SyntaxKind.Identifier) {\n return false;\n }\n const declaration = this.goDeclarationOfIdentifier(base);\n if ((declaration === undefined) || (this.goMarketLocalUnbox(declaration) !== GO_MARKET_LOCAL_TYPE)) {\n return false;\n }\n return this.goIsComparedOperand(node);\n }\n\n // `node`, through any parentheses, is an operand of a GO_MARKET_READ_COMPARISON_OPERATORS comparison\n goIsComparedOperand(node): boolean {\n let operand: any = node;\n let above: any = node.parent;\n while (above?.kind === SyntaxKind.ParenthesizedExpression) {\n operand = above;\n above = above.parent;\n }\n return (above?.kind === SyntaxKind.BinaryExpression)\n && ((above.left === operand) || (above.right === operand))\n && (GO_MARKET_READ_COMPARISON_OPERATORS.indexOf(above.operatorToken?.kind) >= 0);\n }\n\n // the container/key argument nodes of a whole `this.SafeList(container, key)` call, or\n // undefined when the initializer is another shape. A third argument is only droppable when\n // it is the empty array literal the TS call sites pass (`safeList(x, k, [])`): the typed\n goSafeListLocalArgs(initializer) {\n return this.goSafeAccessorLocalArgs(initializer, 'safeList', SyntaxKind.ArrayLiteralExpression, 'elements');\n }\n\n // one later use of a list local: it must read the value as a list, never hand the box out.\n // A length read, an element read and the statement-shaped push all answer for a []any what\n // the accessors answered for the box; every other use keeps the box.\n goSafeListUseReadsTheList(node): boolean {\n const parent: any = node.parent;\n if (parent === undefined) {\n return false;\n }\n switch (parent.kind) {\n case SyntaxKind.PropertyAccessExpression: {\n if (parent.expression !== node) {\n return false; // the local as the receiver of a further member\n }\n if (parent.name?.text === 'length') {\n return true; // prints GetArrayLength(x)\n }\n // `x.push(v)` prints `x = append(x, v)` only in the statement shape; every other\n // push keeps AppendToArray(&x, …), whose *any parameter a []any local cannot take\n return (parent.name?.text === 'push') && this.goIsNativeAppendShape(node, parent.parent);\n }\n case SyntaxKind.ElementAccessExpression: {\n if (parent.expression !== node) {\n return false; // the local as the index\n }\n return !this.isGoElementAccessAssignmentTarget(parent); // `x[k] = v` writes through the box\n }\n case SyntaxKind.CallExpression: {\n if (parent.expression === node) {\n return false; // the local called as a function\n }\n if (parent.arguments.indexOf(node) !== 0) {\n return false; // value position: the box escapes\n }\n const callee = this.goPrintedCallee(this.printNode(parent, 0));\n // both accessors read a []any receiver with the very answer they gave the box\n return (callee === 'GetValue') || (callee === 'GetArrayLength');\n }\n default:\n return false;\n }\n }\n\n // `var x any = this.SafeList(container, key)` -> `var x []any = SafeListTyped(container, key)`.\n // SafeListTyped reads the same member and every later use reads it as a list: a nil slice counts\n // 0 and indexes to nil, matching the box's absent case. Anything else keeps the box.\n goSafeListLocalUnboxCache = new Map();\n\n goSafeListLocalUnbox(declaration): string | undefined {\n return this.goCachedLocalUnbox(this.goSafeListLocalUnboxCache, declaration, () => this.goSafeListLocalUnboxUncached(declaration));\n }\n\n goSafeListLocalUnboxUncached(declaration): string | undefined {\n if (this.goSafeListLocalArgs(declaration.initializer) === undefined) {\n return undefined;\n }\n return this.goDeclaredLocalTypeIfSafe(declaration, GO_SAFE_LIST_LOCAL_TYPE, (n) => this.goSafeListUseReadsTheList(n));\n }\n\n // the initializer a typed list local is declared with: the accessor call is replaced by the\n // typed reader, which reads the same member but names the result\n goSafeListUnboxValue(declaration, identation: number): string | undefined {\n if (this.goSafeListLocalUnbox(declaration) !== GO_SAFE_LIST_LOCAL_TYPE) {\n return undefined;\n }\n const args: any = this.goSafeListLocalArgs(declaration.initializer);\n const container = this.printNode(args.container, identation);\n const key = this.printNode(args.key, 0);\n return `SafeListTyped(${container}, ${key})`;\n }\n\n getGoLocalType(declaration, parsedValue: string): string {\n const goType = this.goTypeOfInitializer(declaration.initializer, parsedValue);\n if (goType === undefined) {\n return this.goSafeDictLocalUnbox(declaration) ?? this.goSafeListLocalUnbox(declaration) ?? this.goMarketLocalUnbox(declaration) ?? 'any';\n }\n // the scan matches AST identifiers, so it needs the source name, not the\n // printed one (`type` is renamed to `typeVar` on the way out)\n const sourceName = declaration.name?.text;\n if (sourceName === undefined) {\n return 'any';\n }\n const scope = this.goEnclosingFunction(declaration);\n // outside any nested resolution the verdict depends only on (declaration, goType)\n const stable = (this.goLocalTypeResolution.size <= 1) && (this.goDeclaredTypeInProgress.size === 0);\n const memoKey = goType;\n let perDecl = stable ? this.goLocalSafeVerdicts.get(declaration) : undefined;\n if (perDecl !== undefined && perDecl.has(memoKey)) {\n return perDecl.get(memoKey);\n }\n const result = (this.goTypeNameIsShadowed(scope, goType) || !this.goLocalIsSafeToType(scope, declaration, sourceName, goType)) ? 'any' : goType;\n if (stable) {\n if (perDecl === undefined) {\n perDecl = new Map();\n this.goLocalSafeVerdicts.set(declaration, perDecl);\n }\n perDecl.set(memoKey, result);\n }\n return result;\n }\n goLocalSafeVerdicts = new WeakMap>();\n\n // Typed async receive: an extension that knows the core's channel element type replaces\n // `x := (<-this.FooAsync(..))` + `PanicOnError(x)` with a typed declaration that runs PanicOnError\n // first (same frame and message). The default returns undefined and changes nothing.\n goAwaitReceiveUnbox(awaitNode, printedInitializer: string): { goType: string, wrap: (recv: string) => string } | undefined {\n return undefined;\n }\n\n printVariableDeclarationList(node,identation) {\n const declaration = node.declarations[0];\n // const varToken = this.VAR_TOKEN ? this.VAR_TOKEN + \" \": \"\";\n // const name = declaration.name.text;\n\n if (declaration?.name.kind === SyntaxKind.ArrayBindingPattern) {\n const arrayBindingPattern = declaration.name;\n const arrayBindingPatternElements = arrayBindingPattern.elements;\n const parsedArrayBindingElements = arrayBindingPatternElements.map((e) => this.printNode(e.name, 0));\n const syntheticName = parsedArrayBindingElements.join(\"\") + \"Variable\";\n\n // gofmt drops every redundant statement terminator: Go statements are\n // newline-separated, so the joins below must not emit ';'\n let arrayBindingStatement = `${this.getIden(identation)}${syntheticName} := ${this.printNode(declaration.initializer, 0)}\\n`;\n\n arrayBindingStatement += parsedArrayBindingElements\n .map((e, index) => this.getIden(identation) + `${e} := GetValue(${syntheticName}, ${index})`).join(\"\\n\");\n\n return arrayBindingStatement;\n }\n\n if (declaration?.initializer?.kind=== SyntaxKind.AwaitExpression) {\n const parsedName = this.printNode(declaration.name, 0);\n // the awaited call can carry a multi-line literal argument: printing it at the\n // declaration's own level keeps that literal one level deeper\n const parsedInitializer = this.printNode(declaration.initializer, identation);\n const awaitUnbox = this.goAwaitReceiveUnbox(declaration.initializer, parsedInitializer);\n if (awaitUnbox !== undefined) {\n // the conversion runs PanicOnError first (inside the bracket), so the panic\n // path keeps the same caller, message and stack as the boxed pair below\n return `\n${this.getIden(identation)}var ${parsedName} ${awaitUnbox.goType} = ${awaitUnbox.wrap(parsedInitializer)}`;\n }\n return `\n${this.getIden(identation)}${parsedName} := ${parsedInitializer}\n${this.getIden(identation)}PanicOnError(${parsedName})`;\n\n }\n\n const isNew = declaration.initializer && (declaration.initializer.kind === SyntaxKind.NewExpression);\n\n const parsedValue = (declaration.initializer) ? this.printNode(declaration.initializer, identation) : this.NULL_TOKEN;\n\n if (parsedValue === this.UNDEFINED_TOKEN) {\n return this.getIden(identation) + \"var \" + this.printNode(declaration.name) + \" any = \" + parsedValue;\n }\n\n if (node?.parent?.kind === SyntaxKind.FirstStatement) {\n if (isNew) {\n return this.getIden(identation) + this.printNode(declaration.name) + \" := \" + parsedValue;\n }\n const varName = this.printNode(declaration.name);\n const declaredType = this.getGoLocalType(declaration, parsedValue);\n // a typed dict/list local is declared with the typed reader rather than the `any`\n // accessor, so the declaration compiles against the map/slice type\n const unboxValue = this.goMarketUnboxValue(declaration, parsedValue)\n ?? ((declaredType === GO_SAFE_DICT_LOCAL_TYPE)\n ? this.goSafeDictUnboxValue(declaration, identation)\n : ((declaredType === GO_SAFE_LIST_LOCAL_TYPE) ? this.goSafeListUnboxValue(declaration, identation) : undefined));\n const declaredValue = (unboxValue !== undefined) ? unboxValue : parsedValue.trimStart();\n // an initializer printed at the declaration's own level (parenthesized expression,\n // helper call) carries that indentation; gofmt puts one space after `=`\n const stm = this.getIden(identation) + \"var \" + varName + \" \" + declaredType + \" = \" + declaredValue;\n if (parsedValue.startsWith(\"<-this.callInternal(\")) {\n return `\n${stm}\n${this.getIden(identation)}PanicOnError(${varName})`;\n }\n return stm;\n }\n\n return this.getIden(identation) + this.printNode(declaration.name) + \" := \" + parsedValue.trim();\n }\n\n // printObjectLiteralExpression(node, identation) {\n // const objectCreation = 'make(map[string]any) {';\n // let formattedObjectBody = '{}';\n // if (node.properties?.length > 0) {\n // const objectBody = this.printObjectLiteralBody(node, identation);\n // formattedObjectBody = objectBody ? \"\\n\" + objectBody + \"\\n\" + this.getIden(identation) : objectBody;\n // }\n // // return this.OBJECT_OPENING + formattedObjectBody + this.OBJECT_CLOSING;\n // return objectCreation + formattedObjectBody;\n // }\n\n // printObjectLiteralBody(node, identation) {\n // let objectName = node.parent?.name?.text;\n // if (objectName === undefined) {\n // objectName = \"object\";\n // }\n // const body = node.properties.map((p) => `${this.getIden(identation)}${objectName}[\"${node.properties[0].name.text}\"] = ${p.initializer.text}` ).join(\"\\n\");\n // return body;\n // }\n\n // F09 — gofmt aligns the key/value columns inside multi-line composite literals.\n //\n // go/printer's exprList prints a single-line `key: value` entry as `key:` + vtab, so\n // every consecutive single-line entry of a literal body lands in one text/tabwriter\n // column block: the value starts after the widest key cell of that block (`\"key\":`,\n // the key plus its colon) and one space of padding. An entry whose value spans lines\n // carries no vtab cell, so it ends the block on both sides, exactly like a blank line\n // does. exprList also writes a formfeed — turned into a plain newline by the trimmer,\n // so it never shows up in the output — before an entry that opens a new alignment\n // section: that happens when the entry or its predecessor does not fit on a single\n // line, and when the key size ratio against the geometric mean of the previous key\n // sizes of the section reaches r = 2.5 (or drops to 1/r) while at least one of the\n // two keys is larger than smallSize = 40 bytes; keys of at most 40 bytes always keep\n // the section aligned. A trailing comment is one more tabwriter cell, so comments\n // line up after the widest `value,` cell of the run of consecutive commented entries.\n printObjectLiteralBody(node, identation) {\n // composite literal elements are printed at depth 1 again (go/printer exprList(..., 1, ...));\n // a literal nested in an entry's value is laid out relative to that entry\n const previousLevel = this.goStatementLevel;\n this.goStatementLevel = identation + 1;\n try {\n const entries = node.properties.map((p) => this.goWithExprDepth(1, () => this.printNode(p, identation + 1)));\n return this.alignGoCompositeEntries(entries).join(\"\\n\");\n } finally {\n this.goStatementLevel = previousLevel;\n }\n }\n\n // Applies the gofmt column alignment to already-printed `key: value` entries (the\n // entries must not carry the separating comma). Reused by the hand-written composite\n // literals in ccxt's build/goTranspiler.ts, which do not go through this printer.\n alignGoCompositeEntries(entries) {\n const parsedEntries = entries.map((entry) => this.parseGoCompositeEntry(entry));\n const paddings = this.getGoCompositePaddings(parsedEntries);\n return entries.map((entry, index) => this.renderGoCompositeEntry(entry, parsedEntries[index], paddings[index]));\n }\n\n // ` \"key\": value, // comment` -> the pieces gofmt's tabwriter aligns.\n // Returns undefined for anything that is not a plain `key: value` entry (a spread, a\n // method, a computed key): the caller then leaves that entry alone and ends the block.\n parseGoCompositeEntry(entry) {\n const newlineIndex = entry.indexOf(\"\\n\");\n const firstLine = newlineIndex === -1 ? entry : entry.slice(0, newlineIndex);\n const keyMatch = /^([ \\t]*)(\"(?:[^\"\\\\]|\\\\.)*\"): /.exec(firstLine);\n if (keyMatch === null) {\n return undefined;\n }\n const singleLine = newlineIndex === -1;\n // for a multi-line entry only the trailing comment of its last line matters here\n const tail = singleLine ? entry.slice(keyMatch[0].length) : entry.slice(entry.lastIndexOf(\"\\n\") + 1);\n const commentIndex = this.findGoTrailingCommentStart(tail);\n return {\n 'indent': keyMatch[1],\n 'key': keyMatch[2],\n // nodeSize() measures the printed key; a value that spans lines gets size 0\n 'size': singleLine ? this.getGoByteLength(keyMatch[2]) : 0,\n 'singleLine': singleLine,\n 'value': singleLine ? (commentIndex === -1 ? tail : tail.slice(0, commentIndex)).trimEnd() : undefined,\n 'comment': commentIndex === -1 ? undefined : tail.slice(commentIndex).trimEnd(),\n };\n }\n\n // Index of the trailing comment of a printed line, or -1. `//` or `/*` inside a string\n // or a rune literal (e.g. a \"https://…\" value) is not a comment.\n findGoTrailingCommentStart(line) {\n let quote;\n for (let index = 0; index < line.length; ++index) {\n const character = line[index];\n if (quote !== undefined) {\n if (character === \"\\\\\" && quote !== \"`\") {\n index += 1;\n } else if (character === quote) {\n quote = undefined;\n }\n continue;\n }\n if (character === \"\\\"\" || character === \"`\" || character === \"'\") {\n quote = character;\n } else if (character === \"/\" && (line[index + 1] === \"/\" || line[index + 1] === \"*\")) {\n return index;\n }\n }\n return -1;\n }\n\n // {key, comment} space counts per entry, i.e. the padding gofmt's tabwriter inserts.\n // Only entries that are part of a block get a padding; every other entry is rendered\n // as printed (gofmt leaves single-line and multi-line sections untouched).\n getGoCompositePaddings(parsedEntries) {\n // the sectioning below mirrors go/printer's exprList\n const smallSize = 40;\n const ratio = 2.5;\n const paddings = parsedEntries.map(() => undefined);\n let block = [];\n let previousSize = 0;\n let size = 0;\n let lnSum = 0;\n let count = 0;\n const flushBlock = () => {\n if (block.length === 0) {\n return;\n }\n let keyWidth = 1; // widest key cell of the block + one space of padding\n for (const index of block) {\n keyWidth = Math.max(keyWidth, this.getGoRuneLength(parsedEntries[index].key) + 2);\n }\n for (const index of block) {\n paddings[index] = { 'key': keyWidth - this.getGoRuneLength(parsedEntries[index].key) - 1, 'comment': 1 };\n }\n // the comment column only spans the runs of consecutive commented entries\n let run = [];\n const flushRun = () => {\n if (run.length === 0) {\n return;\n }\n let runWidth = 1; // widest `value,` cell of the run + one space of padding\n for (const index of run) {\n runWidth = Math.max(runWidth, this.getGoRuneLength(parsedEntries[index].value) + 2);\n }\n for (const index of run) {\n paddings[index].comment = runWidth - this.getGoRuneLength(parsedEntries[index].value) - 1;\n }\n run = [];\n };\n for (const index of block) {\n if (parsedEntries[index].comment !== undefined) {\n run.push(index);\n } else {\n flushRun();\n }\n }\n flushRun();\n block = [];\n };\n for (let index = 0; index < parsedEntries.length; ++index) {\n const entry = parsedEntries[index];\n previousSize = size;\n size = entry !== undefined ? entry.size : 0;\n let sectionBreak = true; // exprList's useFF\n if (previousSize > 0 && size > 0) {\n if (count === 0 || (previousSize <= smallSize && size <= smallSize)) {\n sectionBreak = false;\n } else {\n const geomean = this.goExp2ish(lnSum / count);\n const sizeRatio = size / geomean;\n sectionBreak = ratio * sizeRatio <= 1 || ratio <= sizeRatio;\n }\n }\n const alignable = entry !== undefined && entry.singleLine;\n if (index > 0 && sectionBreak) {\n // exprList resets the geometric mean accumulation whenever it starts a\n // new section (a formfeed break is two line breaks, nbreaks > 1), so the\n // ratio below is measured against the current section only\n lnSum = 0;\n count = 0;\n }\n if (!alignable || sectionBreak) {\n flushBlock();\n }\n if (alignable) {\n block.push(index);\n }\n if (size > 0) {\n lnSum += this.goLog2ish(size);\n count += 1;\n }\n }\n flushBlock();\n return paddings;\n }\n\n // go/printer's crude log2/exp2 (math.go log2ish/exp2ish): the geomean must match it bit for\n // bit, a ratio landing on exactly 2.5 decides the section break\n goLog2ish(x: number): number {\n let exponent = x === 0 ? 0 : Math.floor(Math.log2(x)) + 1;\n let fraction = x / Math.pow(2, exponent);\n if (fraction >= 1) { fraction /= 2; exponent += 1; }\n if (fraction < 0.5 && fraction !== 0) { fraction *= 2; exponent -= 1; }\n return exponent + 2 * (fraction - 1);\n }\n\n goExp2ish(x: number): number {\n const n = Math.floor(x);\n return (1 + x - n) * Math.pow(2, n);\n }\n\n renderGoCompositeEntry(entry, parsed, padding) {\n if (parsed === undefined || !parsed.singleLine || padding === undefined) {\n return this.appendGoTrailingComma(entry);\n }\n const comment = parsed.comment === undefined ? \"\" : \" \".repeat(padding.comment) + parsed.comment;\n return parsed.indent + parsed.key + \":\" + \" \".repeat(padding.key) + parsed.value + \",\" + comment;\n }\n\n // gofmt prints the comma of an entry before its trailing comment (`value, // comment`),\n // the entry text carries the comment last, so move the comma in front of it\n appendGoTrailingComma(entry) {\n const newlineIndex = entry.lastIndexOf(\"\\n\");\n const lastLine = newlineIndex === -1 ? entry : entry.slice(newlineIndex + 1);\n const commentIndex = this.findGoTrailingCommentStart(lastLine);\n if (commentIndex === -1) {\n return entry + \",\";\n }\n const offset = entry.length - lastLine.length + commentIndex;\n return entry.slice(0, offset).trimEnd() + \", \" + entry.slice(offset).trimEnd();\n }\n\n // text/tabwriter sizes cells in runes, go/printer's nodeSize counts bytes\n getGoRuneLength(text) {\n return [...text].length;\n }\n\n getGoByteLength(text) {\n let length = 0;\n for (const character of text) {\n const codePoint = character.codePointAt(0);\n length += codePoint < 0x80 ? 1 : codePoint < 0x800 ? 2 : codePoint < 0x10000 ? 3 : 4;\n }\n return length;\n }\n\n printConstructorDeclaration (node, identation) {\n const classNode = node.parent;\n const className = this.printNode(classNode.name, 0);\n const args = this.printMethodParameters(node);\n const constructorBody = this.printFunctionBody(node, identation);\n\n // find super call inside constructor and extract params\n let superCallParams = '';\n let hasSuperCall = false;\n node.body?.statements.forEach(statement => {\n if (isExpressionStatement(statement)) {\n const expression = statement.expression;\n if (isCallExpression(expression)) {\n const expressionText = expression.expression.getText().trim();\n if (expressionText === 'super') {\n hasSuperCall = true;\n superCallParams = expression.arguments.map((a) => {\n return this.printNode(a, identation).trim();\n }).join(\", \");\n }\n }\n }\n });\n\n if (hasSuperCall) {\n return this.getIden(identation) + className +\n `(${args}) : ${this.SUPER_CALL_TOKEN}(${superCallParams})` +\n constructorBody;\n }\n\n return this.getIden(identation) +\n className +\n \"(\" + args + \")\" +\n constructorBody;\n }\n\n printDynamicCall(node, identation) {\n // const isAsync = true; // setting to true for now, because there are some scenarios where we don't know\n const elementAccess = node.expression;\n if (elementAccess?.kind === SyntaxKind.ElementAccessExpression) {\n // the emitted call also carries the property name as its first\n // argument, so a call with arguments is a call with more than one\n // argument and prints them one level deeper\n const argumentDepth = this.goExprDepth + ((node.arguments?.length > 0) ? 1 : 0);\n const parsedArg = node.arguments?.length > 0 ? node.arguments.map(n => this.goWithExprDepth(argumentDepth, () => this.printNode(n, identation).trimStart())).join(\", \") : \"\";\n // const target = this.printNode(elementAccess.expression, 0);\n const propName = this.goWithExprDepth(argumentDepth, () => this.printNode(elementAccess.argumentExpression, 0));\n const argsArray = `${parsedArg}`;\n const open = this.DYNAMIC_CALL_OPEN;\n const statement = `${open}${propName}, ${argsArray})`;\n // statement = isAsync ? `((Task)${statement})` : statement;\n return statement;\n }\n return undefined;\n }\n\n\n printElementAccessExpressionExceptionIfAny(node) {\n // Fix malformed Split(...) element access where the index arg is mistakenly placed\n // inside the Split call. We force the correct pattern: GetValue(Split(str, sep), idx)\n const tsKind = SyntaxKind;\n if (node.expression.kind === tsKind.CallExpression) {\n const callExp = node.expression;\n const calleeText = callExp.expression.getText();\n if (calleeText.endsWith('.split') || calleeText.toLowerCase().includes('split')) {\n // print Split call normally (should already close with ))\n let splitCall = this.printNode(callExp, 0).trim();\n if (!splitCall.endsWith(')')) {\n splitCall += ')';\n }\n const idxArg = this.printNode(node.argumentExpression, 0);\n return `GetValue(${splitCall}, ${idxArg})`;\n }\n }\n // default: no exception\n return undefined;\n }\n\n printWrappedUnknownThisProperty(node, identation = 0) {\n const type = this.getChecker().getResolvedSignature(node);\n if (type?.declaration?.resolve() === undefined) {\n // the emitted call carries the property name as its first argument; arguments\n // print at the call's level so a multi-line literal keeps its nesting\n const argumentDepth = this.goExprDepth + ((node.arguments?.length > 0) ? 1 : 0);\n let parsedArguments = node.arguments?.map((a) => this.goWithExprDepth(argumentDepth, () => this.printNode(a, identation).trimStart())).join(\", \");\n parsedArguments = parsedArguments || \"\";\n const propName = node.expression?.name.text;\n // const isAsyncDecl = true;\n // const isAsyncDecl = node?.parent?.kind === SyntaxKind.AwaitExpression;\n // const isAsyncDecl = false;\n // const open = isAsyncDecl ? this.UKNOWN_PROP_ASYNC_WRAPPER_OPEN : this.UKNOWN_PROP_WRAPPER_OPEN;\n // const close = this.UNKOWN_PROP_WRAPPER_CLOSE;\n // return `${open}\"${propName}\"${parsedArguments}${close}`;\n const argsArray = `${parsedArguments}`;\n const open = this.DYNAMIC_CALL_OPEN;\n const statement = `${open}\"${propName}\", ${argsArray})`;\n return statement;\n }\n return undefined;\n }\n\n transformMethodNameIfNeeded(name: string): string {\n const res = this.unCamelCaseIfNeeded(name);\n return this.capitalize(res);\n }\n\n transformCallExpressionName(name: string, nameNode = undefined) {\n return this.applyAsyncSuffixToCallee(nameNode, this.capitalize(name));\n }\n\n transformPropertyAccessExpressionName(name: string, nameNode = undefined) {\n return this.applyAsyncSuffixToCallee(nameNode, this.capitalize(name));\n }\n\n printOutOfOrderCallExpressionIfAny(node, identation) {\n if (node.expression.kind === SyntaxKind.PropertyAccessExpression) {\n const args = node.arguments;\n\n if (node.expression.expression.kind === SyntaxKind.ThisKeyword) {\n const methodName = this.printNode(node.expression.name, 0);\n if (this.wrapThisCalls || (this.wrapCallMethods.includes(methodName))) {\n const argsParsed = this.goUnifiedStringCallArgs(node, 0, true) ?? args.map((a) => this.printNode(a, 0)).join(\", \");\n return `<-this.callInternal(\"${methodName}\"${(args.length > 0) ? \", \" + argsParsed : \"\"})`;\n }\n }\n\n const expressionText = node.expression.getText().trim();\n if (args.length === 1) {\n const parsedArg = this.printNode(args[0], 0);\n switch (expressionText) {\n // case \"JSON.parse\":\n // return `json_decode(${parsedArg}, $as_associative_array = true)`;\n case \"Math.abs\":\n return `mathAbs(${parsedArg})`;\n }\n } else if (args.length === 2)\n {\n const parsedArg1 = this.printNode(args[0], 0);\n const parsedArg2 = this.printNode(args[1], 0);\n switch (expressionText) {\n case \"Math.min\":\n return `mathMin(${parsedArg1}, ${parsedArg2})`;\n case \"Math.max\":\n return `mathMax(${parsedArg1}, ${parsedArg2})`;\n case \"Math.pow\":\n return `MathPow(${parsedArg1}, ${parsedArg2})`;\n }\n }\n const leftSide = node.expression?.expression;\n const leftSideText = leftSide ? this.printNode(leftSide, 0) : undefined;\n\n // wrap unknown property this.X calls\n if (leftSideText === this.THIS_TOKEN || leftSide.getFullText().indexOf(\"(this as any)\") > -1) { // double check this\n const res = this.printWrappedUnknownThisProperty(node, identation);\n if (res) {\n return res;\n }\n }\n }\n\n // // replace this[method]() calls\n // const thisElementAccess = this.printThisElementAccesssIfNeeded(node, identation);\n // if (thisElementAccess) {\n // return thisElementAccess;\n // }\n\n // handle dynamic calls, this[method](A) or exchange[b] (c) using reflection\n if (node.expression.kind === SyntaxKind.ElementAccessExpression) {\n return this.printDynamicCall(node, identation);\n }\n\n\n return undefined;\n }\n\n // `typeof x === \"\"` checks and the Go predicate helper each maps to\n goTypeOfHelpers = new Map([\n ['string', 'IsString'], ['number', 'IsNumber'], ['boolean', 'IsBool'], ['object', 'IsObject'], ['function', 'IsFunction'],\n ]);\n handleTypeOfInsideBinaryExpression(node, identation) {\n const left = node.left;\n const right = node.right.text;\n const op = node.operatorToken.kind;\n const expression = left.expression;\n\n const isDifferentOperator = op === SyntaxKind.ExclamationEqualsEqualsToken || op === SyntaxKind.ExclamationEqualsToken;\n const notOperator = isDifferentOperator ? this.NOT_TOKEN : \"\";\n\n const target = this.printNode(expression, 0);\n const helper = this.goTypeOfHelpers.get(right);\n return (helper === undefined) ? undefined : notOperator + `${helper}(${target})`;\n\n }\n\n printCustomBinaryExpressionIfAny(node, identation) {\n const left = node.left;\n const right = node.right;\n\n const op = node.operatorToken.kind;\n\n // ---------------------------------------------------------------\n // Array destructuring assignment: [a, b] = foo()\n // Transforms into:\n // __tmpX := foo()\n // a = GetValue(__tmpX, 0)\n // b = GetValue(__tmpX, 1)\n // ---------------------------------------------------------------\n if (op === SyntaxKind.EqualsToken &&\n left.kind === SyntaxKind.ArrayLiteralExpression) {\n // const elems = (left.elements as any[]);\n // const returnRandName = \"retRes\" + this.getLineBasedSuffix(node);\n // const rhs = this.printNode(right, 0);\n\n // // build extraction lines\n // const assignments = elems.map((el, idx) => {\n // const leftName = this.printNode(el, 0);\n // return `${leftName} = GetValue(${returnRandName}, ${idx})`;\n // }).join(`\\n${this.getIden(identation)}`);\n\n // return `${returnRandName} := ${rhs}\\n${this.getIden(identation)}${assignments}`;\n //\n const arrayBindingPatternElements = left.elements;\n const parsedArrayBindingElements = arrayBindingPatternElements.map((e) => this.printNode(e, 0));\n const syntheticName = parsedArrayBindingElements.join(\"\") + \"Variable\";\n\n let arrayBindingStatement = `${syntheticName} := ${this.printNode(right, 0)}\\n`;\n\n parsedArrayBindingElements.forEach((e, index) => {\n\n const statement = this.getIden(identation) + (this.goGetArgBindsDictElement(arrayBindingPatternElements[index], right, index)\n ? `${e} = MapTyped(GetValue(${syntheticName}, ${index}))`\n : `${e} = GetValue(${syntheticName}, ${index})`);\n if (index < parsedArrayBindingElements.length - 1) {\n arrayBindingStatement += statement + \"\\n\";\n } else {\n arrayBindingStatement += statement;\n }\n });\n\n return arrayBindingStatement;\n }\n\n // ---------------------------------------------------------------\n // Go-style setter for element-access assignments: a[b] = v and a[b] += v\n // ---------------------------------------------------------------\n if ((op === SyntaxKind.EqualsToken || op === SyntaxKind.PlusEqualsToken) &&\n left.kind === SyntaxKind.ElementAccessExpression) {\n // Collect base container and all keys (inner-most key is last).\n const keys: any[] = [];\n let baseExpr: any = null;\n let cur: any = left;\n while (isElementAccessExpression(cur)) {\n keys.unshift(cur.argumentExpression); // prepend\n const expr = cur.expression;\n if (!isElementAccessExpression(expr)) {\n baseExpr = expr;\n break;\n }\n cur = expr;\n }\n\n const containerStr = this.printNode(baseExpr, 0);\n const keyStrs = keys.map(k => this.printNode(k, 0));\n\n // the container of a nested `m[\"a\"][\"b\"] = v` write is a plain read of the\n // receiver: a declared map indexes natively and only the `any` steps above\n // it keep the helper (Go refuses to index an `any`)\n const acc = this.goElementWriteChain(baseExpr, containerStr, keys, keyStrs);\n\n const lastKey = keyStrs[keyStrs.length - 1];\n if (op === SyntaxKind.PlusEqualsToken) {\n const rhs = this.printNode(right, 0);\n // For +=, we need to get the current value, add to it, then set it back\n const currentValue = `${this.ELEMENT_ACCESS_WRAPPER_OPEN}${acc}, ${lastKey}${this.ELEMENT_ACCESS_WRAPPER_CLOSE}`;\n const native = (keyStrs.length === 1)\n ? this.printNativeElementAssignment(baseExpr, containerStr, keys[0], lastKey, `Add(${containerStr}[${lastKey}], ${rhs})`, true)\n : undefined;\n return (native !== undefined) ? native : `AddElementToObject(${acc}, ${lastKey}, Add(${currentValue}, ${rhs}))`;\n }\n // the value is printed at the statement's own level so a multi-line object\n // literal (bare, or nested inside a call argument) lands one level deeper with\n // its closing brace at the statement level; the leading indentation is dropped\n const rhs = this.goWithExprDepth(this.goExprDepth + 1, () => this.printNode(right, identation)).trimStart();\n\n // a single key over a receiver the printer typed itself is plain Go\n // indexing; a nested chain goes through GetValue, which is `any`\n // a native `m[k] = v` is a plain assignment, whose value go/printer prints at\n // the statement's own depth rather than inside the helper's argument list\n const nativeRhs = (right.kind === SyntaxKind.BinaryExpression)\n ? this.goWithExprDepth(this.goExprDepth, () => this.printNode(right, identation)).trimStart()\n : rhs;\n const native = (keyStrs.length === 1)\n ? this.printNativeElementAssignment(baseExpr, containerStr, keys[0], lastKey, nativeRhs, false, right)\n : undefined;\n return (native !== undefined) ? native : `AddElementToObject(${acc}, ${lastKey}, ${rhs})`;\n }\n\n if (left.kind === SyntaxKind.TypeOfExpression) {\n const typeOfExpression = this.handleTypeOfInsideBinaryExpression(node, identation);\n if (typeOfExpression) {\n return typeOfExpression;\n }\n }\n\n if (op === SyntaxKind.InKeyword) {\n const dictText = this.printNode(right, 0);\n const keyText = this.printNode(left, 0);\n const inlined = this.printInlineInOp(right, left, dictText, keyText);\n if (inlined !== undefined) {\n return inlined;\n }\n return `InOp(${dictText}, ${keyText})`;\n }\n\n // only print the operands when this op is actually handled here; otherwise\n // the base printBinaryExpression prints them, and doing it eagerly means\n // every unhandled binary expression gets its subtrees printed twice\n if (op === SyntaxKind.PlusEqualsToken || op === SyntaxKind.MinusEqualsToken || op in this.binaryExpressionsWrappers) {\n // both operands end up in the two-argument helper call below (or in the\n // `Add(x, y)` on the right of the compound assignment), i.e. one level\n // deeper than the expression itself\n const operandDepth = this.goExprDepth + 1;\n const leftText = this.goWithExprDepth(operandDepth, () => this.printNode(left, 0));\n const rightText = this.goWithExprDepth(operandDepth, () => this.printNode(right, 0));\n\n const nativeAssignment = this.goNativeCompoundAssignment(op, left, leftText, right, rightText);\n if (nativeAssignment !== undefined) {\n return nativeAssignment;\n }\n\n if (op === SyntaxKind.PlusEqualsToken) {\n return `${leftText} = Add(${leftText}, ${rightText})`;\n }\n\n if (op === SyntaxKind.MinusEqualsToken) {\n return `${leftText} = Subtract(${leftText}, ${rightText})`;\n }\n\n const isEquality = (op === SyntaxKind.EqualsEqualsToken) || (op === SyntaxKind.EqualsEqualsEqualsToken);\n const isDifference = (op === SyntaxKind.ExclamationEqualsToken) || (op === SyntaxKind.ExclamationEqualsEqualsToken);\n if (isEquality || isDifference) {\n const inlined = this.printInlineEquality(left, right, leftText, rightText, isEquality);\n if (inlined !== undefined) {\n return inlined;\n }\n }\n\n if (ORDERED_COMPARISON_OPERATORS[op] !== undefined) {\n const inlined = this.printInlineOrderedComparison(left, right, leftText, rightText, op) ?? this.printG09WideningComparison(left, right, leftText, rightText, op);\n if (inlined !== undefined) {\n return inlined;\n }\n }\n\n const wrapper = this.binaryExpressionsWrappers[op];\n const open = wrapper[0];\n const close = wrapper[1];\n const nativeArithmetic = this.goNativeArithmetic(node, leftText, rightText);\n if (nativeArithmetic !== undefined) {\n return nativeArithmetic.text;\n }\n return `${open}${leftText}, ${rightText}${close}`;\n }\n\n // x = y\n // cast y to x type when y is unknown\n // if (op === SyntaxKind.EqualsToken) {\n // const leftType = this.getChecker().getTypeAtLocation(left);\n // const rightType = this.getChecker().getTypeAtLocation(right);\n\n // if (this.isAnyType(rightType.flags) && !this.isAnyType(leftType.flags)) {\n // // const parsedType = this.getTypeFromRawType(leftType);\n // return `${leftText} = ${rightText}`;\n // }\n // }\n\n return undefined;\n }\n\n // the scalar family the TypeScript type of an operand belongs to: 'string',\n // 'int', 'float', 'bool', 'nil' for the undefined/null literals, or undefined\n // when the type is any/unknown/a union of several families\n goScalarFamily(node): string | undefined {\n // TypeScript narrows `x !== undefined && x === 'v'` to `string`, but the Go\n // local is still the `any` box the declaration printed; when that box holds\n // a *T helper result, `==` against a string is never true in Go\n const checker: any = this.checkerOrUndefined();\n if (node?.kind === SyntaxKind.Identifier && this.goDeclaredTypeOfIdentifier(node) === undefined\n && this.goAnyLocalHoldsPointer(checker.getSymbolAtLocation(node)?.valueDeclaration?.resolve())) {\n return undefined;\n }\n return (checker === undefined) ? undefined : this.goScalarFamilyOfType(checker.getTypeAtLocation(node));\n }\n\n // the scalar family the TypeScript type of an operand belongs to, where a\n // `string | undefined` union still counts as 'string': the Go box holds that\n // scalar or nil, and both `x == nil` and `x == \"lit\"` are then the same\n // predicate as the helper. Numbers are excluded by the caller.\n goScalarFamilyWithNil(node): string | undefined {\n const checker: any = this.checkerOrUndefined();\n return (checker === undefined) ? undefined : this.goScalarFamilyOfType(checker.getTypeAtLocation(node), true);\n }\n\n // true when this operand is a *parameter* boxed as `any` whose TypeScript type is an array or\n // object (`Strings`, `Market`, `NullableDict`, `object[]`, `object`): a Go map/slice, never a\n // pointer, so a nil test needs no helper. Locals may box a nil `*sync.Map`, which is not `== nil`.\n goObjectBoxParameter(node): boolean {\n if (node?.kind !== SyntaxKind.Identifier) {\n return false;\n }\n const checker: any = this.checkerOrUndefined();\n if (checker === undefined) {\n return false;\n }\n if (checker.getSymbolAtLocation(node)?.valueDeclaration?.resolve()?.kind !== SyntaxKind.Parameter) {\n return false;\n }\n return this.goTypeIsNilComparableObject(checker.getTypeAtLocation(node));\n }\n\n // an object type whose Go value is a map/slice, or a union of such a type with\n // undefined/null. `any`, functions and class instances are excluded: their Go\n // value may be an identity-bearing pointer\n goTypeIsNilComparableObject(type): boolean {\n if (type === undefined) {\n return false;\n }\n if (type.flags & TypeFlags.Union) {\n let seen = false;\n for (const member of type.getTypes()) {\n if (member.flags & (TypeFlags.Undefined | TypeFlags.Null | TypeFlags.Void)) {\n continue;\n }\n if (!this.goTypeIsNilComparableObject(member)) {\n return false;\n }\n seen = true;\n }\n return seen;\n }\n if (!(type.flags & (TypeFlags.Object | TypeFlags.NonPrimitive))) {\n return false;\n }\n if (type.getCallSignatures().length > 0 || type.getConstructSignatures().length > 0) {\n return false;\n }\n const declaration = type.getSymbol()?.valueDeclaration?.resolve() ?? type.getSymbol()?.declarations?.map((d) => d.resolve())?.[0];\n return declaration?.kind !== SyntaxKind.ClassDeclaration;\n }\n\n // the callee name of a printed call, e.g. `this.SafeDict(x, 0, {})` → `this.SafeDict`\n goPrintedCallee(printedValue: string): string | undefined {\n let value = printedValue.trim();\n while (value.startsWith('(') && this.isWholePrintedCall(value, 0)) {\n value = value.substring(1, value.length - 1).trim();\n }\n const open = value.indexOf('(');\n if (open <= 0 || !this.isWholePrintedCall(value, open)) {\n return undefined;\n }\n const callee = value.substring(0, open);\n return /^[A-Za-z_][\\w.]*$/.test(callee) ? callee : undefined;\n }\n\n // true when this expression prints to an interface (`any`) box: a parameter, a\n // local the printer left `any`, or one of the helpers whose Go signature returns\n // `any`. A *T / scalar local or call is not a box and keeps its own rule.\n goIsAnyBoxExpression(node, printedText: string): boolean {\n if (node?.kind === SyntaxKind.Identifier) {\n const decl = this.goAnyBoxLocalDeclaration(node);\n const isBinding = (decl?.kind === SyntaxKind.Parameter)\n || (decl?.kind === SyntaxKind.VariableDeclaration);\n if (!isBinding) {\n return false;\n }\n // the printer names a Go type for this local/`:=` initializer, so the\n // value is not behind an interface\n if (this.goDeclaredTypeOfIdentifier(node) !== undefined) {\n return false;\n }\n // an `any` local initialised from a *T helper (`var x any = this.SafeString(…)`)\n // boxes the pointer itself: a nil *string inside `any` is not `== nil` in Go,\n // so only the deref-aware helper compares it correctly\n return !this.goAnyLocalHoldsPointer(decl);\n }\n if (node?.kind === SyntaxKind.CallExpression) {\n if (this.goTypeOfInitializer(node, printedText) !== undefined) {\n return false; // a *T or a scalar the printer can name\n }\n return GO_ANY_BOX_CALLS.indexOf(this.goPrintedCallee(printedText)) >= 0;\n }\n return false;\n }\n\n // an element read prints either a native map[string]any index or the\n // GetValue(container, key) helper call — an `any` box in both cases\n goBoxedElementRead(node, printedText: string): boolean {\n node = this.goUnwrapParenthesizedNode(node);\n if (node?.kind !== SyntaxKind.ElementAccessExpression) {\n return false;\n }\n if (GO_ANY_BOX_CALLS.indexOf(this.goPrintedCallee(printedText)) >= 0) {\n return true; // GetValue(container, key)\n }\n let base = node.expression;\n while (isElementAccessExpression(base)) {\n base = base.expression;\n }\n // the printed base is unknown here: `goIndexableTypeOf` answers on the\n // declared table alone for every shape but a call, which stays a box anyway\n return this.goIndexableTypeOf(base, '') === 'map[string]any';\n }\n\n // true when an `any`-typed local can hold a *T helper result: its initializer or a\n // later `x = …` write is a `this.safeX(…)` call whose Go signature returns a pointer\n goAnyLocalHoldsPointerCache = new Map();\n goAnyLocalHoldsPointer(decl): boolean {\n if (decl?.kind !== SyntaxKind.VariableDeclaration || decl.name?.kind !== SyntaxKind.Identifier) {\n return false;\n }\n if (this.goAnyLocalHoldsPointerCache.has(decl)) {\n return this.goAnyLocalHoldsPointerCache.get(decl);\n }\n // the callee is read from the AST, never printed: printing an operand would\n // re-enter the equality classifier that asks this question\n this.goAnyLocalHoldsPointerCache.set(decl, false);\n let settled = true;\n const isPointerInit = (expr): boolean => {\n expr = this.goUnwrapParenthesizedNode(expr);\n if (expr?.kind === SyntaxKind.ConditionalExpression) {\n return isPointerInit(expr.whenTrue) || isPointerInit(expr.whenFalse);\n }\n if (expr?.kind === SyntaxKind.Identifier) {\n // a copy of a pointer-bound GetArg parameter (or of a local holding one) boxes it\n const source: any = this.checkerOrUndefined()?.getSymbolAtLocation(expr)?.valueDeclaration?.resolve();\n if (source?.kind === SyntaxKind.Parameter) {\n if (this.goGetArgTypeComputing?.has(source)) {\n settled = false;\n return true;\n }\n return String(this.goGetArgParameterType(source) ?? '').startsWith('*');\n }\n const inner = (source !== decl) && this.goAnyLocalHoldsPointer(source);\n settled = settled && ((source === decl) || this.goAnyLocalHoldsPointerCache.has(source));\n return inner;\n }\n const callee = (expr?.kind === SyntaxKind.CallExpression) ? expr.expression : undefined;\n if (callee?.kind !== SyntaxKind.PropertyAccessExpression || callee.expression?.kind !== SyntaxKind.ThisKeyword) {\n return false;\n }\n const name = this.goAstCalleeName(expr);\n const goType = (name === undefined) ? undefined : GO_HELPER_RETURN_TYPES[name];\n return (typeof goType === 'string') && goType.startsWith('*');\n };\n let holds = isPointerInit(decl.initializer);\n if (!holds) {\n const name = decl.name.text;\n const scope = this.goEnclosingFunction(decl);\n const visit = (n) => {\n if (holds) { return; }\n if (n.kind === SyntaxKind.BinaryExpression && n.operatorToken.kind === SyntaxKind.EqualsToken\n && n.left?.kind === SyntaxKind.Identifier && n.left.text === name && isPointerInit(n.right)) {\n holds = true;\n return;\n }\n n.forEachChild(visit);\n };\n if (scope !== undefined) {\n scope.forEachChild(visit);\n }\n }\n if (settled) {\n this.goAnyLocalHoldsPointerCache.set(decl, holds);\n } else {\n this.goAnyLocalHoldsPointerCache.delete(decl);\n }\n return holds;\n }\n\n // the callee name of a call, read from the AST and capitalised the way the\n // printer names Go functions (`this.parseJson` -> `this.ParseJson`). Printing the\n // callee would re-enter the equality classifier that asks this question.\n goAstCalleeName(call): string | undefined {\n const callee = call?.expression;\n if (callee?.kind === SyntaxKind.Identifier) {\n const name = callee.text;\n return (typeof name === 'string' && name.length > 0) ? name.charAt(0).toUpperCase() + name.substring(1) : undefined;\n }\n if (callee?.kind === SyntaxKind.PropertyAccessExpression && callee.expression?.kind === SyntaxKind.ThisKeyword) {\n const name = callee.name?.text;\n return (typeof name === 'string' && name.length > 0) ? 'this.' + name.charAt(0).toUpperCase() + name.substring(1) : undefined;\n }\n return undefined;\n }\n\n // true when every declaration of the awaited callee is a bodyless method signature:\n // TS never implements it, the endpoint generator does, and the Go body is the\n // `<-chan any` wrapper over callEndpointAsync (decoded JSON / \"panic: \" / nil)\n goAwaitedCallIsImplicitEndpoint(expression): boolean {\n const call = this.goUnwrapParenthesizedNode(expression);\n if (call?.kind !== SyntaxKind.CallExpression) {\n return false;\n }\n const callee = call.expression;\n if (callee?.kind !== SyntaxKind.PropertyAccessExpression || callee.expression?.kind !== SyntaxKind.ThisKeyword) {\n return false;\n }\n const nameNode = callee.name;\n if (nameNode?.kind !== SyntaxKind.Identifier) {\n return false;\n }\n const checker: any = this.checkerOrUndefined();\n if (checker === undefined) {\n return false;\n }\n const symbol = checker.getSymbolAtLocation(nameNode);\n const declarations = symbol?.declarations?.map((d) => d.resolve());\n if (!declarations || declarations.length === 0) {\n return false;\n }\n return declarations.every((d) => (d.kind === SyntaxKind.MethodSignature)\n && (d.body === undefined)\n && (d.parent?.kind === SyntaxKind.InterfaceDeclaration));\n }\n\n // true when the printed value of this expression is never a *T whose nil\n // derefScalar folds to nil (nor a *sync.Map): null/undefined, an object/array\n // literal, an endpoint await or a JSON decode. Everything else stays unproven.\n goIsNonPointerValueSource(expr): boolean {\n expr = this.goUnwrapParenthesizedNode(expr);\n if (expr === undefined) {\n return true; // `var x any` never written holds nil\n }\n if (this.goG02NonPointerAccessorSource(expr)) {\n return true;\n }\n switch (expr.kind) {\n case SyntaxKind.NullKeyword:\n return true;\n case SyntaxKind.Identifier:\n return expr.text === 'undefined';\n case SyntaxKind.ObjectLiteralExpression:\n case SyntaxKind.ArrayLiteralExpression:\n return true;\n case SyntaxKind.AwaitExpression:\n return this.goAwaitedCallIsImplicitEndpoint(expr.expression);\n case SyntaxKind.CallExpression: {\n const name = this.goAstCalleeName(expr);\n if (name === undefined) {\n return false;\n }\n return GO_JSON_PARSE_CALLS.indexOf(name.replace(/^this\\./, '')) >= 0;\n }\n }\n return false;\n }\n\n // true when every value written into an `any` local is a non-pointer source: the\n // box holds a container, a scalar or nil, so IsEqual(x, nil) is exactly `x == nil`.\n // A write of any other shape in the enclosing function (D2 scan) keeps the helper\n goAnyLocalHoldsNonPointerCache = new Map();\n goAnyLocalHoldsNonPointer(decl): boolean {\n if (decl?.kind !== SyntaxKind.VariableDeclaration || decl.name?.kind !== SyntaxKind.Identifier) {\n return false;\n }\n if (this.goAnyLocalHoldsNonPointerCache.has(decl)) {\n return this.goAnyLocalHoldsNonPointerCache.get(decl);\n }\n let holds = !this.goAnyLocalHoldsPointer(decl) && this.goIsNonPointerValueSource(decl.initializer);\n if (holds) {\n const name = decl.name.text;\n const scope = this.goEnclosingFunction(decl);\n if (scope === undefined) {\n holds = false;\n } else {\n const visit = (n) => {\n if (!holds) { return; }\n // `[ a, b ] = …` writes a and b through GetValue(, i), so its\n // source is the right-hand side as well\n if (n.kind === SyntaxKind.BinaryExpression && n.operatorToken?.kind === SyntaxKind.EqualsToken\n && this.goAssignmentWritesName(n.left, name)\n && !this.goIsNonPointerValueSource(n.right)) {\n holds = false;\n return;\n }\n n.forEachChild(visit);\n };\n scope.forEachChild(visit);\n }\n }\n this.goAnyLocalHoldsNonPointerCache.set(decl, holds);\n return holds;\n }\n\n // true when this assignment target binds the named local: a plain identifier, or a\n // destructuring element (`[ a, b ] = …` prints GetValue(, i) writes)\n goAssignmentWritesName(left, name): boolean {\n if (left?.kind === SyntaxKind.Identifier) {\n return left.text === name;\n }\n if (left?.kind === SyntaxKind.ArrayLiteralExpression) {\n return left.elements.some((e) => (e?.kind === SyntaxKind.Identifier) && (e.text === name));\n }\n return false;\n }\n\n // the variable declaration an identifier resolves to, when it is one\n goAnyBoxLocalDeclaration(node): any {\n if (node?.kind !== SyntaxKind.Identifier) {\n return undefined;\n }\n const checker: any = this.checkerOrUndefined();\n if (checker === undefined) {\n return undefined;\n }\n const symbol = checker.getSymbolAtLocation(node);\n return symbol?.valueDeclaration?.resolve();\n }\n\n // true when this identifier is a parameter bound by `x := GetArg(optionalArgs, i, default)`:\n // GetArg runs derefScalar and folds a typed nil pointer (and nil []string/[]any) into the untyped\n // default, so the box holds a plain scalar or an untyped nil, never a nil *T.\n goGetArgBoundParameter(node): boolean {\n const decl = this.goAnyBoxLocalDeclaration(node);\n // a parameter without a default keeps the caller's value as-is in a plain `any`\n // parameter, where a *int64 handed over by another method stays a pointer\n if (decl?.kind !== SyntaxKind.Parameter || decl.initializer === undefined) {\n return false;\n }\n // only a method/function body binds its defaulted parameters with GetArg: an arrow\n // function's printed parameters carry no default binding at all\n const owner = decl.parent?.kind;\n if (owner !== SyntaxKind.MethodDeclaration && owner !== SyntaxKind.FunctionDeclaration\n && owner !== SyntaxKind.Constructor) {\n return false;\n }\n return !this.goParameterLaterWritesPointerBox(decl);\n }\n\n // D2 for a GetArg-bound parameter: a later `x = …` write whose printed value is a typed\n // pointer puts a nil *T back in the box, where IsEqual(x, nil) is true but `x == nil` is not\n goParameterLaterWritesPointerBox(decl): boolean {\n const name = (decl?.name?.kind === SyntaxKind.Identifier) ? decl.name.text : undefined;\n if (typeof name !== 'string') {\n return true; // a binding pattern: the write scan cannot follow it\n }\n const scope = this.goEnclosingFunction(decl);\n if (scope === undefined) {\n return true;\n }\n let pointerWrite = false;\n const visit = (n) => {\n if (pointerWrite) {\n return;\n }\n if (n.kind === SyntaxKind.BinaryExpression && n.operatorToken?.kind === SyntaxKind.EqualsToken\n && this.goAssignmentWritesName(n.left, name) && this.goWritePrintsPointerBox(n.right)) {\n pointerWrite = true;\n return;\n }\n n.forEachChild(visit);\n };\n scope.forEachChild(visit);\n return pointerWrite;\n }\n\n // true when the printed value of an assignment's right-hand side is a typed pointer: a\n // `this.safeX(…)`/`this.Parse8601(…)` accessor (GO_HELPER_RETURN_TYPES), an identifier the\n // printer declared `*T`, or a hand-written *sync.Map field. Read from the AST, never printed.\n goWritePrintsPointerBox(expr): boolean {\n expr = this.goUnwrapParenthesizedNode(expr);\n if (expr === undefined) {\n return false;\n }\n if (expr.kind === SyntaxKind.CallExpression) {\n const name = this.goAstCalleeName(expr);\n if (typeof name === 'string') {\n const goType = GO_HELPER_RETURN_TYPES[name];\n if ((typeof goType === 'string') && goType.startsWith('*')) {\n return true;\n }\n // the accessors the ccxt build pass wraps with DerefScalar but the Go type\n // table does not name (`this.NumberToString`, `this.Parse8601`, `this.Iso8601`)\n // return a pointer too, so their write stays unproven\n return GO_DEREF_WRAPPED_CALLS.indexOf(name.replace(/^this\\./, '')) >= 0;\n }\n return false;\n }\n if (expr.kind === SyntaxKind.Identifier) {\n const declared = this.goDeclaredTypeOfIdentifier(expr);\n return (typeof declared === 'string') && declared.startsWith('*');\n }\n if (expr.kind === SyntaxKind.PropertyAccessExpression && expr.expression?.kind === SyntaxKind.ThisKeyword) {\n const fieldType = GO_NILABLE_FIELDS_Typed['this.' + expr.name?.text];\n return (typeof fieldType === 'string') && GO_NIL_EQUIVALENT_POINTER_TYPES_Native.has(fieldType);\n }\n return false;\n }\n\n goScalarFamilyOfType(type, allowNil = false): string | undefined {\n if (type === undefined) {\n return undefined;\n }\n // Str/Int/Num/Bool are nullable aliases of `string | undefined` & friends;\n // their Go representation is still `any`, so they never inline — unless the\n // caller is asking about the value the `any` box holds (allowNil)\n const alias = type.getAliasSymbol()?.escapedName;\n if (!allowNil) {\n switch (alias) {\n case 'Str':\n case 'Int':\n case 'Num':\n case 'Bool':\n return undefined;\n }\n }\n const flags = type.flags;\n if (flags & TypeFlags.Union) {\n const families = new Set();\n for (const member of type.getTypes()) {\n const family = this.goScalarFamilyOfType(member, allowNil);\n if (family === undefined) {\n return undefined;\n }\n // `string | undefined` is `any` in Go, never a bare Go string:\n // one nullable member disqualifies the whole union\n if (family === 'nil') {\n if (allowNil) {\n continue; // the box holds nil for that member\n }\n return undefined;\n }\n families.add(family);\n }\n if (families.size !== 1) {\n return undefined; // `boolean` is `true | false`, so size === 1\n }\n return families.values().next().value;\n }\n if (flags & (TypeFlags.String | TypeFlags.StringLiteral)) {\n return 'string';\n }\n if (flags & (TypeFlags.Number | TypeFlags.NumberLiteral)) {\n return 'number';\n }\n if (flags & (TypeFlags.Boolean | TypeFlags.BooleanLiteral)) {\n return 'bool';\n }\n if (flags & (TypeFlags.Undefined | TypeFlags.Null | TypeFlags.Void)) {\n return 'nil';\n }\n return undefined;\n }\n\n // B-02: a parameter of a nullable ccxt alias (`Str`) prints as the native Go type (`*string`) only\n // when the method is internal (not async/override, no inherited member), every call site passes\n // that type (checker here, textual for siblings), and the body never writes another type (D2).\n goNativeParameterTypeCache = new Map();\n goSameFileCallCache = new Map>>();\n goTsSrcTreeCache = new Map();\n\n goNativeParameterType(param): string | undefined {\n if (param?.kind !== SyntaxKind.Parameter) {\n return undefined;\n }\n if (this.goNativeParameterTypeCache.has(param)) {\n return this.goNativeParameterTypeCache.get(param);\n }\n // the call-site proof prints argument expressions, which can land back here\n this.goNativeParameterTypeCache.set(param, undefined);\n const result = this.goNativeParameterTypeOf(param);\n this.goNativeParameterTypeCache.set(param, result);\n return result;\n }\n\n goNativeParameterTypeOf(param): string | undefined {\n if ((param.initializer !== undefined) || (param.dotDotDotToken !== undefined)) {\n return undefined; // optional/variadic parameters keep the optionalArgs ABI\n }\n if (param.name?.kind !== SyntaxKind.Identifier) {\n return undefined;\n }\n const fn: any = param.parent;\n if ((fn?.kind !== SyntaxKind.MethodDeclaration) || (fn.body === undefined) || (fn.name?.kind !== SyntaxKind.Identifier)) {\n return undefined;\n }\n const parseParam = fn.name.text.startsWith('parse');\n // D-03: a pro handler's frame parameter (`handleX (client: Client, message: Dict)`)\n // is the second family whose call-site proof can name a Go type\n const handlerParam = !parseParam && this.goIsProHandlerMethod(fn);\n if (this.goIsUnifiedStringParameter(fn.name.text, fn.parameters.indexOf(param))) {\n // the table types the base and every override together: a body that breaks it fails the build\n if ((this.goRequiredStringParameterType(param) !== 'string')\n || !this.goLocalIsSafeToType(fn.body, param, param.name.text, 'string')\n || !this.goParameterKeepsNilCompareNative(fn.body, param, 'string')) {\n throw new Error(`unifiedStringParams: ${fn.name.text} parameter ${param.name.text} is not a required string written only as string`);\n }\n return 'string';\n }\n if (this.goMethodKeepsBaseSignature(fn)) {\n return undefined; // inherited/base methods are pinned by the base class and IDerivedExchange\n }\n const index = fn.parameters.indexOf(param);\n if (!parseParam && !handlerParam) {\n // any other exchange-local method: only a non-nullable TS `string` becomes a Go `string`\n // at least one proven caller: an uncalled method's signature is outside API only by accident\n const goType = this.goRequiredStringParameterType(param);\n return ((goType !== undefined) && this.goHasTreeCallSite(fn) && this.goParameterCallSitesPassType(fn, index, goType)\n && this.goLocalIsSafeToType(fn.body, param, param.name.text, goType)\n && this.goParameterKeepsNilCompareNative(fn.body, param, goType)) ? goType : this.g11NativeParameterType(fn, param, index);\n }\n if (this.isAsyncFunction(fn)) {\n return undefined;\n }\n for (const goType of this.goNativeParameterTypeCandidates(param, handlerParam)) {\n if (this.goParameterCallSitesPassType(fn, index, goType)\n && this.goLocalIsSafeToType(fn.body, param, param.name.text, goType)\n && this.goParameterKeepsNilCompareNative(fn.body, param, goType)) {\n return goType;\n }\n }\n return handlerParam ? undefined : this.g11NativeParameterType(fn, param, index);\n }\n\n goIsUnifiedStringParameter(methodName: string, index: number): boolean {\n const indexes = Object.prototype.hasOwnProperty.call(this.unifiedStringParams, methodName) ? this.unifiedStringParams[methodName] : undefined;\n return Array.isArray(indexes) && indexes.includes(index);\n }\n\n // the call arguments of a unified method whose parameter prints `string`: an argument the\n // printer cannot prove a Go string goes through StringArg, which panics on any other value\n goUnifiedStringCallArgs(node, identation, flat = false): string | undefined {\n const callee: any = node.expression;\n const name = (callee?.kind === SyntaxKind.PropertyAccessExpression) ? callee.name?.text : undefined;\n if ((typeof name !== 'string') || !Object.prototype.hasOwnProperty.call(this.unifiedStringParams, name)) {\n return undefined;\n }\n const args = node.arguments ?? [];\n if (args.some((a) => a.kind === SyntaxKind.SpreadElement)) {\n return undefined;\n }\n const depth = this.goExprDepth + ((args.length > 1) ? 1 : 0);\n return args.map((a, i) => {\n const printed = flat ? this.printNode(a, 0) : this.goWithExprDepth(depth, () => this.printNode(a, identation)).trim();\n if (!this.goIsUnifiedStringParameter(name, i) || (this.goPrintedArgType(a) === 'string')) {\n return printed;\n }\n return `StringArg(${printed})`;\n }).join(', ');\n }\n\n // `string` for a parameter whose declared TS type is string (or a string-literal union) with no\n // undefined/null member; a nullable one stays boxed here (callers pass *string or nil)\n goRequiredStringParameterType(param): string | undefined {\n const type = this.checkerOrUndefined()?.getTypeAtLocation(param);\n if (type === undefined) {\n return undefined;\n }\n const parts = ((typeof type.isUnionType === 'function') && type.isUnionType()) ? type.getTypes() : [type];\n return parts.every(p => (p.flags & (TypeFlags.String | TypeFlags.StringLiteral)) !== 0) ? 'string' : undefined;\n }\n\n // The boxed object parameter prints `x === undefined` as a native `x == nil`\n // (goObjectBoxParameter); a parameter the printer typed as a Go map/slice would fall\n // through to IsEqual(x, nil) instead. Both predicates answer false for every value a\n goParameterKeepsNilCompareNative(body, param, goType: string): boolean {\n if (goType === '*string') {\n return true;\n }\n const name = param.name.text;\n let keeps = true;\n const visit = (n) => {\n if (!keeps) {\n return;\n }\n if ((n.kind === SyntaxKind.Identifier) && (n.text === name)) {\n let symbol;\n try {\n symbol = this.getChecker().getSymbolAtLocation(n);\n } catch (e) {\n symbol = undefined;\n }\n const binary: any = n.parent;\n if ((symbol?.valueDeclaration?.resolve() === param) && (binary?.kind === SyntaxKind.BinaryExpression)\n && ((binary.left === n) || (binary.right === n))) {\n const op = binary.operatorToken?.kind;\n if ((op === SyntaxKind.EqualsEqualsToken) || (op === SyntaxKind.EqualsEqualsEqualsToken)\n || (op === SyntaxKind.ExclamationEqualsToken) || (op === SyntaxKind.ExclamationEqualsEqualsToken)) {\n const other: any = (binary.left === n) ? binary.right : binary.left;\n if ((other?.kind === SyntaxKind.NullKeyword)\n || ((other?.kind === SyntaxKind.Identifier) && (other.text === 'undefined'))) {\n keeps = false;\n return;\n }\n }\n }\n }\n n.forEachChild(visit);\n };\n body.forEachChild(visit);\n return keeps;\n }\n\n // ---- D-03: pro handler frame parameters ------------------------------------\n // A `handle*` method of a pro exchange class receives the raw frame from the WS\n // client. When the checker types that parameter as `Dict`, and every call site\n goIsProHandlerMethod(fn): boolean {\n // the main-thread transpile registers the file relative to the repo root\n // (ts/src/pro/.ts) while the batch registers it absolute, so accept both\n const fileName = String(fn.getSourceFile().fileName ?? '');\n if (!(/(^|[\\\\/])ts[\\\\/]src[\\\\/]pro[\\\\/]/.test(fileName))) {\n return false;\n }\n const name = fn.name.text;\n return (name.length > 6) && name.startsWith('handle') && (name[6] === name[6].toUpperCase());\n }\n\n // `Dict` is the checker's structural `{[key: string]: any}`: a string index\n // signature is the proof. Class instances (OrderBook, ArrayCache*, Client, Future),\n // named-member interfaces (Market, Order, Ticker) and arrays carry none of them, so\n goParameterTypeIsDict(type): boolean {\n try {\n return (typeof type.getStringIndexType === 'function') && (type.getStringIndexType() !== undefined);\n } catch (e) {\n return false;\n }\n }\n\n // the Go types the declared TypeScript type can carry. `Dict`/`Market`/`Currency`\n // and the other dict-shaped object types print as the `map[string]any` the Go side\n // builds them from, `List` (= any[]) as its `[]any`; pro `handle*` frames (isHandler)\n goNativeParameterTypeCandidates(param, isHandler = false): string[] {\n const checker: any = this.checkerOrUndefined();\n const type = checker?.getTypeAtLocation(param);\n if (type === undefined) {\n return [];\n }\n let parts = ((typeof type.isUnionType === 'function') && type.isUnionType()) ? type.getTypes().slice() : [type];\n parts = parts.filter(p => !(p.flags & (TypeFlags.Undefined | TypeFlags.Null)));\n if (parts.length !== 1) {\n return [];\n }\n const inner: any = parts[0];\n if (inner.flags & TypeFlags.String) {\n return isHandler ? [] : ['*string'];\n }\n if (isHandler && this.goParameterTypeIsDict(inner)) {\n return ['map[string]any'];\n }\n if (!(inner.flags & TypeFlags.Object)) {\n return [];\n }\n if (checker.isArrayType(inner)) {\n // List / any[]: the element must itself be `any`, or the Go slice would need\n // the narrower element type (`string[]` is a []string the printer does not build)\n const element = checker.getIndexTypeOfType(inner, IndexKind.Number);\n return ((element !== undefined) && (element.flags & (TypeFlags.Any | TypeFlags.Unknown))) ? ['[]any'] : [];\n }\n // Dict / Market / Currency / a structure interface: a plain Go dictionary, never a\n // class instance or a function (goTypeIsNilComparableObject is the printer's own\n // test for exactly those types, used for the boxed nil test above)\n return this.goTypeIsNilComparableObject(inner) ? ['map[string]any'] : [];\n }\n\n // true when the method overrides (or shadows) a member of the class it extends, or carries an\n // explicit `override`: those print the base signature so the generated base classes and\n // IDerivedExchange keep compiling. The abstract base (ts/src/base/**) is never retyped.\n goMethodKeepsBaseSignature(fn): boolean {\n if ((fn.modifiers ?? []).some(m => m.kind === SyntaxKind.OverrideKeyword)) {\n return true;\n }\n if (/(^|\\/)ts\\/src\\/base\\//.test(fn.getSourceFile().fileName)) {\n return true;\n }\n const name = fn.name.text;\n const cls = this.goEnclosingClass(fn);\n if (cls === undefined) {\n return true;\n }\n const extendsClauses = (cls.heritageClauses ?? []).filter(clause => clause.token === SyntaxKind.ExtendsKeyword);\n if (extendsClauses.length === 0) {\n return true; // a root class: the abstract base of the generated tree\n }\n for (const clause of extendsClauses) {\n for (const expr of (clause.types ?? [])) {\n const checker: any = this.checkerOrUndefined();\n const baseType = checker.getTypeAtLocation(expr);\n if (baseType?.getProperty?.(name) !== undefined) {\n return true;\n }\n }\n }\n return false;\n }\n\n goHasTreeCallSite(fn): boolean {\n const name = fn.name.text;\n if (this.goSameFileCallsOf(fn, name).length > 0) {\n return true;\n }\n const tree = this.goTsSrcTree(fn.getSourceFile());\n const myClass = this.goEnclosingClassName(fn);\n return (tree?.callIndex.get(name) ?? []).some(site => this.goTsSrcFileDerivesFrom(tree, site.file, myClass));\n }\n\n // every call site of `fn` in the whole tree must pass exactly `goType` at `index`\n goParameterCallSitesPassType(fn, index: number, goType: string): boolean {\n const name = fn.name.text;\n for (const call of this.goSameFileCallsOf(fn, name)) {\n const arg = call.arguments?.[index];\n if ((arg === undefined) || (arg.kind === SyntaxKind.SpreadElement)) {\n return false;\n }\n if (this.goPrintedArgType(arg) !== goType) {\n return false;\n }\n }\n const tree = this.goTsSrcTree(fn.getSourceFile());\n if (tree !== undefined) {\n const myClass = this.goEnclosingClassName(fn);\n const myFile = tree.relativeOf.get(path.resolve(fn.getSourceFile().fileName));\n for (const site of (tree.callIndex.get(name) ?? [])) {\n if (site.file === myFile) {\n continue; // proven above off the checker\n }\n if (!this.goTsSrcFileDerivesFrom(tree, site.file, myClass)) {\n continue; // a same-named method of another exchange\n }\n const arg = site.args[index];\n if ((arg === undefined) || !this.goTextArgMatchesType(arg, goType, site.file, tree)) {\n return false;\n }\n }\n }\n return true;\n }\n\n goEnclosingClass(fn) {\n let cls = fn.parent;\n while ((cls !== undefined) && (cls.kind !== SyntaxKind.ClassDeclaration) && (cls.kind !== SyntaxKind.ClassExpression)) {\n cls = cls.parent;\n }\n return cls;\n }\n\n goEnclosingClassName(fn): string | undefined {\n const cls = this.goEnclosingClass(fn);\n return (cls?.name?.kind === SyntaxKind.Identifier) ? cls.name.text : undefined;\n }\n\n // the printed Go type of a call-site argument, or undefined when the printer\n // cannot name it (then the call site does not prove anything)\n goPrintedArgType(arg): string | undefined {\n if (arg.kind === SyntaxKind.Identifier) {\n return this.goDeclaredTypeOfIdentifier(arg);\n }\n return this.goTypeOfInitializer(arg, this.printNode(arg, 0));\n }\n\n // every `this.(...)` of this file whose resolved signature is `fn`\n goSameFileCallsOf(fn, name: string): Array {\n const file = fn.getSourceFile();\n let index = this.goSameFileCallCache.get(file);\n if (index === undefined) {\n index = new Map>();\n const visit = (node) => {\n if (node.kind === SyntaxKind.CallExpression) {\n const callee: any = node.expression;\n const calleeName = (callee?.kind === SyntaxKind.PropertyAccessExpression) ? callee.name?.text : undefined;\n if (typeof calleeName === 'string') {\n const list = index.get(calleeName) ?? [];\n list.push(node);\n index.set(calleeName, list);\n }\n }\n node.forEachChild(visit);\n };\n visit(file);\n this.goSameFileCallCache.set(file, index);\n }\n const checker = this.getChecker();\n const result = [];\n for (const call of (index.get(name) ?? [])) {\n let declaration;\n try {\n declaration = checker.getResolvedSignature(call)?.declaration?.resolve();\n } catch (e) {\n declaration = undefined;\n }\n if (declaration === fn) {\n result.push(call);\n }\n }\n return result;\n }\n\n // Lazily read the ts/src tree this file belongs to: the call sites of every\n // `this.x(...)`, each file's text and its class -> base map. A scoped run's\n // program holds one exchange, so the sibling files are only provable textually.\n goTsSrcTree(file): any {\n // drivers pass relative names (`ts/src/x.ts`): resolve so the marker and relativeOf match\n const fileName: string = path.resolve(file.fileName);\n const marker = '/ts/src/';\n const at = fileName.lastIndexOf(marker);\n if (at < 0) {\n return undefined; // in-memory source (tests): no sibling files to prove\n }\n const root = fileName.substring(0, at + marker.length - 1);\n if (!this.goTsSrcTreeCache.has(root)) {\n this.goTsSrcTreeCache.set(root, this.goTsSrcTreeBuild(root));\n }\n return this.goTsSrcTreeCache.get(root);\n }\n\n goTsSrcTreeBuild(root: string) {\n const callIndex = new Map>();\n const fileText = new Map();\n const classBases = new Map();\n const relativeOf = new Map();\n const walk = (dir: string, rel: string) => {\n let entries;\n try {\n entries = fs.readdirSync(dir, { withFileTypes: true });\n } catch (e) {\n return;\n }\n for (const entry of entries) {\n if (entry.isDirectory()) {\n if (entry.name !== 'node_modules') {\n walk(path.join(dir, entry.name), rel + entry.name + '/');\n }\n continue;\n }\n if (!entry.name.endsWith('.ts') || entry.name.endsWith('.d.ts')) {\n continue;\n }\n const relPath = rel + entry.name;\n let text;\n try {\n text = fs.readFileSync(path.join(dir, entry.name), 'utf8');\n } catch (e) {\n continue;\n }\n fileText.set(relPath, text);\n relativeOf.set(path.join(dir, entry.name), relPath);\n const classRe = /\\bclass\\s+([A-Za-z_$][\\w$]*)\\s+extends\\s+([A-Za-z_$][\\w$]*)/g;\n let match;\n while ((match = classRe.exec(text)) !== null) {\n classBases.set(match[1], match[2]);\n }\n const callRe = /this\\s*\\.\\s*([A-Za-z_$][\\w$]*)\\s*\\(/g;\n while ((match = callRe.exec(text)) !== null) {\n const args = goBalancedCallArgs(text, callRe.lastIndex - 1);\n if (args === undefined) {\n continue;\n }\n const list = callIndex.get(match[1]) ?? [];\n list.push({ file: relPath, args });\n callIndex.set(match[1], list);\n }\n }\n };\n walk(root, '');\n return { callIndex, fileText, classBases, relativeOf };\n }\n\n goTsSrcFileDerivesFrom(tree, file: string, className: string | undefined): boolean {\n if (className === undefined) {\n return true; // unknown owner: keep the reference inside the proof\n }\n const text = tree.fileText.get(file);\n if (text === undefined) {\n return true;\n }\n const classRe = /\\bclass\\s+([A-Za-z_$][\\w$]*)/g;\n let match;\n while ((match = classRe.exec(text)) !== null) {\n let current: string | undefined = match[1];\n for (let hops = 0; (hops < 12) && (current !== undefined); hops++) {\n if (current === className) {\n return true;\n }\n current = tree.classBases.get(current);\n }\n }\n return false;\n }\n\n // the textual call-site proof. `*string` is the only pointer-shaped native type\n // with siblings the printer can name from text; a map/slice parameter is proven for\n // the argument shapes whose printed Go form IS that type: the object/array literals\n goTextArgMatchesType(argText: string, goType: string, file: string, tree): boolean {\n let text = (argText ?? '').trim();\n while (text.startsWith('(') && text.endsWith(')')) {\n text = text.substring(1, text.length - 1).trim();\n }\n const isStringProducer = (candidate: string) => GO_TS_SRC_STRING_PRODUCERS.some(rx => rx.test(candidate));\n const localDeclaredFrom = (name: string, accept: (init: string) => boolean) => {\n const fileText = tree.fileText.get(file) ?? '';\n const declRe = new RegExp('(?:const|let|var)\\\\s+' + name + '\\\\s*(?::[^=]*)?=\\\\s*([^;\\\\n]+)');\n const match = declRe.exec(fileText);\n return (match !== null) && accept(match[1].trim());\n };\n if (goType === 'string') {\n return /^(?:'[^'\\\\]*'|\"[^\"\\\\]*\")$/.test(text); // a sibling file proves only a plain literal\n }\n if (goType === '*string') {\n if (isStringProducer(text)) {\n return true;\n }\n const identifier = /^([A-Za-z_$][\\w$]*)$/.exec(text);\n if (identifier !== null) {\n return localDeclaredFrom(identifier[1], isStringProducer);\n }\n }\n if ((goType === 'map[string]any') || (goType === '[]any')) {\n // Only the argument shapes whose printed Go form IS this map/slice: the\n // matching literal and the printer's own map producers. An identifier is\n // deliberately not proven here: this proof reads one file's text, so it\n const isMap = goType === 'map[string]any';\n const literal = isMap ? '{' : '[';\n const producers = isMap ? GO_TS_SRC_MAP_PRODUCERS : [];\n return text.startsWith(literal) || producers.some(rx => rx.test(text));\n }\n return false;\n }\n\n // the Go type this identifier is actually *declared* with, or undefined when it\n // stays `any`. It goes through getGoLocalType, not goTypeOfInitializer, so a\n // declaration the reject filters demoted back to `any` is reported as `any` here\n // too — otherwise we would emit `*x` against an `any` box.\n // A parameter resolves to its declared Go type only when goNativeParameterType\n // proved it (see the B-02 block above); everything else stays `any`.\n //\n // getGoLocalType re-prints every reassignment's right-hand side, and printing a\n // ternary re-enters printCondition, which lands back here: `x = (x === 'a') ? …`\n // would recurse forever. The in-progress set breaks that cycle by answering\n // `any` for the declaration currently being classified, and the cache keeps the\n // per-occurrence cost at one scope scan per declaration.\n goDeclaredTypeCache = new Map();\n goDeclaredTypeInProgress = new Set();\n\n goDeclaredTypeOfIdentifier(node): string | undefined {\n if (node?.kind !== SyntaxKind.Identifier) {\n return undefined;\n }\n const decl: any = this.checkerOrUndefined()?.getSymbolAtLocation(node)?.valueDeclaration?.resolve();\n if (decl === undefined) {\n return undefined;\n }\n if (decl.kind === SyntaxKind.Parameter) {\n // a defaulted parameter bound through a pointer GetArg twin is that pointer at every consumer\n const bound = this.goGetArgParameterType(decl);\n if ((bound !== undefined) && bound.startsWith('*')) {\n return bound;\n }\n // B-02: a parameter the call-site proof typed prints its native Go type\n return this.goNativeParameterType(decl);\n }\n if (decl.kind !== SyntaxKind.VariableDeclaration || decl.initializer === undefined || decl.name?.kind !== SyntaxKind.Identifier) {\n return undefined;\n }\n if (this.goDeclaredTypeCache.has(decl)) {\n return this.goDeclaredTypeCache.get(decl);\n }\n if (this.goDeclaredTypeInProgress.has(decl)) {\n return undefined;\n }\n this.goDeclaredTypeInProgress.add(decl);\n let goType;\n try {\n goType = this.getGoLocalType(decl, this.printNode(decl.initializer, 0));\n } finally {\n this.goDeclaredTypeInProgress.delete(decl);\n }\n const result = (goType === 'any') ? undefined : goType;\n this.goDeclaredTypeCache.set(decl, result);\n return result;\n }\n\n // true when this identifier's Go type is a pointer we can deref (*string / *int64 / …)\n goIsPointerIdentifier(node): boolean {\n const goType = this.goDeclaredTypeOfIdentifier(node);\n return (typeof goType === 'string') && goType.startsWith('*');\n }\n\n // the Go pointer type an *expression* evaluates to, or undefined. Covers both a\n // local declared `var x *string = …` and a direct `this.SafeString(...)` call,\n // whose Go signature returns a pointer even though TypeScript says `string`.\n goPointerTypeOfExpression(node, printedText: string): string | undefined {\n const declared = this.goDeclaredTypeOfIdentifier(node);\n if ((typeof declared === 'string') && declared.startsWith('*')) {\n return declared;\n }\n // a hand-written BaseExchange field, e.g. `this.Markets`: its Go type is the one\n // go/v4/exchange.go declares, and the helpers turn a nil one into a nil\n if (node?.kind === SyntaxKind.PropertyAccessExpression) {\n const fieldType = GO_NILABLE_FIELDS_Typed[printedText];\n if ((typeof fieldType === 'string') && GO_NIL_EQUIVALENT_POINTER_TYPES_Native.has(fieldType)) {\n return fieldType;\n }\n }\n if (node?.kind === SyntaxKind.CallExpression) {\n const goType = this.goTypeOfInitializer(node, printedText);\n if ((typeof goType === 'string') && goType.startsWith('*')) {\n return goType;\n }\n }\n return undefined;\n }\n\n // the concrete Go type a `x[k] = v` receiver is declared with, when the printer\n // can name it: a local it typed itself, or a whole call whose Go return type it\n // knows. Everything else is an `any` box, and indexing an `any` in Go needs a\n // type assertion, so those keep the runtime helper.\n goElementAssignmentContainerType(node, printedText: string): string | undefined {\n const declared = this.goDeclaredTypeOfIdentifier(node);\n if ((declared === 'map[string]any') || (declared === '[]any')) {\n return declared;\n }\n if (node?.kind === SyntaxKind.CallExpression) {\n const known = this.goTypeOfInitializer(node, printedText);\n if ((known === 'map[string]any') || (known === '[]any')) {\n return known;\n }\n }\n return undefined;\n }\n\n // the Go container type of a hand-written `this.` receiver, undefined for every other\n // shape. Generated structs embed BaseExchange, so `this.` is the only property access the\n // field table types — a local or parameter of the same name is a different declaration.\n goFieldContainerTypeNative(node): string | undefined {\n if ((node?.kind !== SyntaxKind.PropertyAccessExpression) || (node.expression?.kind !== SyntaxKind.ThisKeyword)) {\n return undefined;\n }\n const name = node.name?.text;\n if (typeof name !== 'string') {\n return undefined;\n }\n return GO_FIELD_CONTAINER_TYPES_NATIVE[this.transformPropertyAccessExpressionName(name, node.name)];\n }\n\n // the printed key is a Go string when the printer knows it: a string literal, or\n // an identifier declared `string`. Params, GetValue(...) and string concatenation\n // all print as `any`, which Go refuses as a map key.\n goIsStringKeyExpression(node): boolean {\n if ((node.kind === SyntaxKind.StringLiteral) || (node.kind === SyntaxKind.NoSubstitutionTemplateLiteral)) {\n return true;\n }\n return this.goDeclaredTypeOfIdentifier(node) === 'string';\n }\n\n // `[]any` receivers only inline when the index is a literal the slice's own\n // literal initializer covers and nothing rebinds the local: the helper silently\n // ignores an out-of-range index, while Go panics on the assignment.\n goSliceIndexProvablyInRange(node, indexNode): boolean {\n if ((node?.kind !== SyntaxKind.Identifier) || (indexNode?.kind !== SyntaxKind.NumericLiteral)) {\n return false;\n }\n const index = Number(indexNode.text);\n if (!Number.isInteger(index) || (index < 0)) {\n return false;\n }\n const decl: any = this.checkerOrUndefined()?.getSymbolAtLocation(node)?.valueDeclaration?.resolve();\n if (decl === undefined || decl.kind !== SyntaxKind.VariableDeclaration || decl.name?.kind !== SyntaxKind.Identifier) {\n return false;\n }\n const initializer = decl.initializer;\n if ((initializer?.kind !== SyntaxKind.ArrayLiteralExpression) || (initializer.elements.length <= index)) {\n return false;\n }\n return !this.goLocalIsRebound(this.goEnclosingFunction(decl), decl.name);\n }\n\n // true when the local is rebound anywhere in its function; an element write\n // (`x[k] = v`) leaves the local itself bound, so only the slice header is at stake\n goLocalIsRebound(scope, nameNode): boolean {\n if (scope === undefined) {\n return true;\n }\n const name = nameNode.text;\n let rebound = false;\n const visit = (n) => {\n if (rebound) {\n return;\n }\n if ((n.kind === SyntaxKind.Identifier) && (n.text === name) && (n !== nameNode)) {\n if (this.goRebindingTargetOf(n) !== undefined) {\n rebound = true;\n return;\n }\n }\n n.forEachChild(visit);\n };\n visit(scope);\n return rebound;\n }\n\n // walks up from the identifier to the assignment it targets: `x = …` / `x += …` /\n // `[x, y] = …` / `for (x of …)` rebind the local, `x[k] = v` does not\n goRebindingTargetOf(identifier) {\n let node: any = identifier;\n let parent = node.parent;\n while (parent?.kind === SyntaxKind.ArrayLiteralExpression) {\n node = parent;\n parent = parent.parent;\n }\n if ((parent?.kind === SyntaxKind.ForOfStatement) && (parent.initializer === node)) {\n return parent;\n }\n if ((parent?.kind === SyntaxKind.BinaryExpression) && (parent.left === node)) {\n const op = parent.operatorToken.kind;\n if ((op === SyntaxKind.EqualsToken) || ((op >= SyntaxKind.FirstCompoundAssignment) && (op <= SyntaxKind.LastCompoundAssignment))) {\n return parent;\n }\n }\n return undefined;\n }\n\n // native `container[key] = value` when the receiver's Go type is proved by the\n // printer, otherwise undefined and the caller keeps the runtime helper\n printNativeElementAssignment(containerNode, containerStr: string, keyNode, keyStr: string, valueStr: string, compound = false, valueNode?): string | undefined {\n const containerType = this.goElementAssignmentContainerType(containerNode, containerStr);\n const fieldType = this.goFieldContainerTypeNative(containerNode);\n if ((fieldType !== undefined) || (containerType === 'map[string]any')) {\n if (!this.goIsStringKeyExpression(keyNode)) {\n return this.printNativeGuardedPointerKeyAssignment(containerNode, containerStr, containerType, fieldType, keyNode, keyStr, valueStr, compound, valueNode);\n }\n if (fieldType === '*sync.Map') {\n // a `+=` reads the element back through `container[key]`, which a\n // sync.Map has no operator for: that shape keeps the runtime helper\n return compound ? undefined : `${containerStr}.Store(${keyStr}, ${valueStr})`;\n }\n return `${containerStr}[${keyStr}] = ${valueStr}`;\n }\n if ((containerType === '[]any') && this.goSliceIndexProvablyInRange(containerNode, keyNode)) {\n return `${containerStr}[${keyStr}] = ${valueStr}`;\n }\n return undefined;\n }\n\n // `m[*k] = v` for a fresh unshared map local, a nil-guarded *string key and a\n // non-pointer value: exactly the helper's map branch minus its lock and derefs\n printNativeGuardedPointerKeyAssignment(containerNode, containerStr: string, containerType, fieldType, keyNode, keyStr: string, valueStr: string, compound: boolean, valueNode): string | undefined {\n if (compound || (fieldType !== undefined) || (containerType !== 'map[string]any') || (valueNode === undefined)) {\n return undefined;\n }\n if (this.goIsNilGuardedStringPointerKey(keyNode) && this.goIsFreshUnsharedMapLocal(containerNode, containerNode) && this.goIsNonPointerValue(valueNode)) {\n return `${containerStr}[*${keyStr}] = ${valueStr}`;\n }\n return undefined;\n }\n\n // a `*string` local the enclosing control flow proves non-nil: the helper's deref\n // yields the same string key (a nil key would have made it a no-op)\n goIsNilGuardedStringPointerKey(keyNode): boolean {\n return (keyNode?.kind === SyntaxKind.Identifier) && (this.goDeclaredTypeOfIdentifier(keyNode) === '*string')\n && this.goHasEnclosingNilGuard(keyNode);\n }\n\n // a local bound once to an object literal, never read by a nested function and not handed\n // out (anything but `m[k]`) before this write: no other goroutine can hold the map yet\n goIsFreshUnsharedMapLocal(node, writeSite): boolean {\n if (node?.kind !== SyntaxKind.Identifier) {\n return false;\n }\n const decl: any = this.checkerOrUndefined()?.getSymbolAtLocation(node)?.valueDeclaration?.resolve();\n if ((decl?.kind !== SyntaxKind.VariableDeclaration) || (decl.name?.kind !== SyntaxKind.Identifier)\n || (decl.initializer?.kind !== SyntaxKind.ObjectLiteralExpression)) {\n return false;\n }\n const scope = this.goEnclosingFunction(decl);\n if ((scope === undefined) || (scope.kind === SyntaxKind.SourceFile) || this.goLocalIsRebound(scope, decl.name)) {\n return false;\n }\n const symbol = this.checkerOrUndefined()?.getSymbolAtLocation(decl.name);\n let captured = false;\n const visit = (n, nested: boolean) => {\n if (captured) {\n return;\n }\n if ((n.kind === SyntaxKind.Identifier) && (n !== decl.name) && (n.text === decl.name.text)\n && (this.checkerOrUndefined()?.getSymbolAtLocation(n) === symbol)) {\n const receiver = (n.parent?.kind === SyntaxKind.ElementAccessExpression) && (n.parent.expression === n);\n if (nested || (!receiver && this.goUseMayPrecede(n, writeSite, scope))) {\n captured = true;\n }\n return;\n }\n const inner = nested || isFunctionLike(n);\n n.forEachChild((c) => visit(c, inner));\n };\n scope.forEachChild((c) => visit(c, false));\n return !captured;\n }\n\n // the use runs before the write: earlier in the text, or both inside one loop body\n goUseMayPrecede(use, writeSite, scope): boolean {\n if (use.pos < writeSite.pos) {\n return true;\n }\n for (let n = writeSite.parent; (n !== undefined) && (n !== scope); n = n.parent) {\n if (GO_ITERATION_STATEMENT_KINDS.has(n.kind) && (use.pos >= n.pos) && (use.end <= n.end)) {\n return true;\n }\n }\n return false;\n }\n\n // the value's printed Go type is concrete and not a pointer, so the helper's derefScalar\n // leaves it unchanged; an `any` box or a pointer keeps the helper\n goIsNonPointerValue(valueNode): boolean {\n const inner = this.goUnwrapParenthesizedNode(valueNode);\n switch (inner?.kind) {\n case SyntaxKind.StringLiteral:\n case SyntaxKind.NoSubstitutionTemplateLiteral:\n case SyntaxKind.TrueKeyword:\n case SyntaxKind.FalseKeyword:\n case SyntaxKind.ObjectLiteralExpression:\n case SyntaxKind.ArrayLiteralExpression:\n return true;\n }\n if (inner === undefined) {\n return false;\n }\n const goType = this.goPrintedTypeOfExpression(inner, this.printNode(inner, 0));\n return (typeof goType === 'string') && (goType !== 'any') && !goType.startsWith('*');\n }\n\n // the concrete Go type an *expression* is printed as: a local's declared type,\n // the return type of a runtime helper call, or a literal. undefined when the value\n // stays inside an `any` box — a native Go operation on an `any` box would not\n // compile, so every rule below falls back to its helper in that case.\n goPrintedTypeOfExpression(node, printedText: string): string | undefined {\n const inner = (node?.kind === SyntaxKind.ParenthesizedExpression) ? node.expression : node;\n if (inner?.kind === SyntaxKind.Identifier) {\n return this.goDeclaredTypeOfIdentifier(inner);\n }\n return this.goTypeOfInitializer(inner, printedText);\n }\n\n // `x.length` on a value the printer declares as a slice is `len(x)`: Go's len is\n // 0 for a nil slice, exactly like GetArrayLength's `[]T` cases. On a map or an\n // `any` box GetArrayLength answers 0, so only a `[]`-typed value may inline —\n // and only for the slice types the helper itself counts (a []byte would answer 0).\n sliceLengthTypes = [ '[]any', '[]string', '[]int64', '[]float64', '[]bool', '[]int', '[][]any', '[]map[string]any' ];\n\n // hand-written BaseExchange fields (go/v4/exchange.go) whose Go type is one of the\n // slice types above: the struct value is never a nil pointer and len(field) is the\n // very value the helper's type switch returns for it.\n GO_NATIVE_LENGTH_FIELDS = [ 'Symbols' ];\n\n printInlineArrayLength(expression, printedText: string, lengthNode?): string | undefined {\n if (printedText.includes('\\n')) {\n return undefined;\n }\n const goType = this.goPrintedTypeOfExpression(expression, printedText);\n if ((typeof goType === 'string') && this.sliceLengthTypes.indexOf(goType) >= 0) {\n return `len(${printedText})`;\n }\n if (this.goLengthFeedsArithmeticClassifier(lengthNode)) {\n return undefined;\n }\n // a Go `string` counts its bytes in both helpers (GetLength's reflect.String\n // case, GetArrayLength's `case string`), and neither helper's nil/`any` branch\n // is reachable for it; a *string / any box keeps the helper it prints today\n if ((goType === 'string') || (this.goNativeLengthFieldType(printedText) !== undefined)) {\n return `len(${printedText})`;\n }\n return undefined;\n }\n\n // the hand-written struct type of a `this.` read, for fields declared as a slice the\n // length helpers count. Any other type (map / *sync.Map / interface{}) keeps the helper:\n // GetArrayLength answers 0 for those, while len would answer the real count.\n goNativeLengthFieldType(printedText: string): string | undefined {\n const match = /^this\\.([A-Za-z_]\\w*)$/.exec(this.goUnwrapPrintedParens(printedText));\n if (match === null || this.GO_NATIVE_LENGTH_FIELDS.indexOf(match[1]) < 0) {\n return undefined;\n }\n return '[]string';\n }\n\n // true when the `.length` sits inside a `-`, `*`, `/` or `%` chain. The ccxt-side classifier\n // (build/go-local-types.js, CCXT_GO_INT_OPERAND_CALLEES) names `GetArrayLength(`/`GetLength(` an\n // `int` operand, so inlining `len` would declassify the chain's int64 local and `.(int64)` unbox.\n goLengthFeedsArithmeticClassifier(lengthNode): boolean {\n let current = lengthNode?.parent;\n for (let i = 0; (i < 16) && (current !== undefined); i++) {\n if (current.kind === SyntaxKind.BinaryExpression) {\n const op = current.operatorToken?.kind;\n if ((op === SyntaxKind.MinusToken) || (op === SyntaxKind.AsteriskToken)\n || (op === SyntaxKind.SlashToken) || (op === SyntaxKind.PercentToken)) {\n return true;\n }\n }\n switch (current.kind) {\n case SyntaxKind.ExpressionStatement:\n case SyntaxKind.VariableStatement:\n case SyntaxKind.ReturnStatement:\n case SyntaxKind.IfStatement:\n case SyntaxKind.Block:\n case SyntaxKind.ForStatement:\n case SyntaxKind.WhileStatement:\n case SyntaxKind.MethodDeclaration:\n case SyntaxKind.FunctionDeclaration:\n case SyntaxKind.ArrowFunction:\n return false;\n }\n current = current.parent;\n }\n return false;\n }\n\n // Go has no ternary operator. The func literal returns the same branch value the\n // helper would and prints the condition the same way; it evaluates only the branch\n // TypeScript would take, while Ternary receives both already evaluated. Both arms\n // printing as one and the same Go scalar names it (`func() string`), so the literal\n // carries the value itself instead of an `any` box.\n printInlineTernary(condition: string, whenTrue: string, whenFalse: string, resultType: string = undefined): string | undefined {\n if (condition.includes('\\n')) {\n return undefined;\n }\n // go/printer never keeps a func literal whose body holds an `if` on one line, and\n // controlClause() strips the parentheses around the `if` condition; the body sits one\n // level below the statement the literal belongs to, `}()` at the statement's level\n const level = this.goStatementLevel;\n const body = this.getIden(level + 1);\n const branch = this.getIden(level + 2);\n return `func() ${resultType ?? 'any'} {\\n${body}if ${this.goStripControlClauseParens(condition)} {\\n${branch}return ${whenTrue}\\n${body}}\\n${body}return ${whenFalse}\\n${this.getIden(level)}}()`;\n }\n\n // the Go scalar an arm already prints a VALUE of, or undefined while the arm is an `any` box.\n // Only the printed text counts: a literal, a local declared with that type, or a call whose Go\n // signature returns it. A classifier-named box (`Subtract(...)`) cannot be carried by `return`.\n goTernaryArmType(node, printedText: string): string | undefined {\n const text = this.goUnwrapPrintedParens(printedText);\n const inner = (node?.kind === SyntaxKind.ParenthesizedExpression) ? node.expression : node;\n switch (inner?.kind) {\n case SyntaxKind.StringLiteral:\n case SyntaxKind.NoSubstitutionTemplateLiteral:\n return 'string';\n case SyntaxKind.TrueKeyword:\n case SyntaxKind.FalseKeyword:\n return 'bool';\n case SyntaxKind.NumericLiteral:\n // an integer literal is an untyped constant of Go default type `int`; a\n // fraction/exponent makes it a float64 constant\n if (/^[0-9]+$/.test(inner.text)) {\n return 'int';\n }\n return (/^[0-9]*\\.[0-9]+([eE][+-]?[0-9]+)?$/.test(inner.text) || /^[0-9]+[eE][+-]?[0-9]+$/.test(inner.text)) ? 'float64' : undefined;\n case SyntaxKind.Identifier:\n return this.goLocalStaticType(inner); // declared `var x T = …` (never `:=`)\n }\n // a nested ternary prints the printer's own typed literal, whose return type is\n // the arm's type as well\n const literalType = goFuncLiteralReturnType(text);\n if (literalType !== undefined) {\n return literalType;\n }\n const open = text.indexOf('(');\n if (open <= 0 || !this.isWholePrintedCall(text, open)) {\n return undefined;\n }\n const goType = GO_HELPER_RETURN_TYPES[text.substring(0, open)];\n return ((goType === undefined) || goType.startsWith('*')) ? undefined : goType;\n }\n\n // the one Go scalar both arms print as, or undefined when the literal keeps the `any`\n // box: only GO_TYPE_NAMES are nameable, and a pointer/`any` arm (or two different\n // types) is not a type the literal could return\n goTernaryResultType(whenTrueNode, whenTrue: string, whenFalseNode, whenFalse: string): string | undefined {\n const whenTrueType = this.goTernaryArmType(whenTrueNode, whenTrue);\n if ((typeof whenTrueType !== 'string') || (whenTrueType === 'any') || (GO_TYPE_NAMES.indexOf(whenTrueType) < 0)) {\n return undefined;\n }\n return (this.goTernaryArmType(whenFalseNode, whenFalse) === whenTrueType) ? whenTrueType : undefined;\n }\n\n // stripParens() applied to a printed condition text (see goControlClauseParens)\n goStripControlClauseParens(text: string): string {\n for (;;) {\n const inner = this.goEnclosedExpression(text);\n if (inner === undefined) {\n return text;\n }\n text = inner;\n }\n }\n\n // a multi-line branch (a nested ternary, a composite literal) is laid out relative to\n // the `return` statement that holds it: inside the `if` for whenTrue (two levels below\n // the statement), the literal's body for whenFalse (one level)\n goPrintTernaryBranch(node, levels: number) {\n const previousLevel = this.goStatementLevel;\n this.goStatementLevel = previousLevel + levels;\n try {\n return this.goWithExprDepth(1, () => this.printNode(node, 0));\n } finally {\n this.goStatementLevel = previousLevel;\n }\n }\n\n // `key in obj` on a Go map[string]any with a Go string key: the two-value read is a statement,\n // hence the func literal; present-but-nil is ok=true like InOp. A `*string` key derefs, nil\n // answering false. InOp also covers nil/number keys and sync.Map/orderbook receivers: else keep it.\n printInlineInOp(dictNode, keyNode, dictText: string, keyText: string): string | undefined {\n if (dictText.includes('\\n') || keyText.includes('\\n')) {\n return undefined;\n }\n if (this.goPrintedTypeOfExpression(dictNode, dictText) !== 'map[string]any') {\n return undefined;\n }\n if (this.goPrintedTypeOfExpression(keyNode, keyText) !== 'string') {\n // InOp runs derefScalar over both operands: a `*string` key is the pointed-to\n // string, and a nil pointer is a nil key, i.e. false. Only an identifier may be\n // repeated by the guard — any other expression would be evaluated twice.\n if ((keyNode?.kind !== SyntaxKind.Identifier) || (this.goDeclaredTypeOfIdentifier(keyNode) !== '*string')) {\n return undefined;\n }\n const level = this.goStatementLevel;\n const body = this.getIden(level + 1);\n return `func() bool {\\n${body}if ${keyText} == nil {\\n${this.getIden(level + 2)}return false\\n${body}}\\n${body}_, ok := ${dictText}[*${keyText}]\\n${body}return ok\\n${this.getIden(level)}}()`;\n }\n // funcBody() keeps the literal on one line while `func() bool` (11 columns) plus\n // the two statements and their `; ` separator fit in 100 columns\n const read = `_, ok := ${dictText}[${keyText}]`;\n if (11 + read.length + 2 + 'return ok'.length <= 100) {\n return `func() bool { ${read}; return ok }()`;\n }\n const level = this.goStatementLevel;\n return `func() bool {\\n${this.getIden(level + 1)}${read}\\n${this.getIden(level + 1)}return ok\\n${this.getIden(level)}}()`;\n }\n\n // comparison helpers that normalize int/int64/float64 against each other, so a\n // literal operand's Go default type (int) behaves like the int64 OpNeg produces\n comparisonHelpers = [ 'IsEqual', 'IsGreaterThan', 'IsLessThan', 'IsGreaterThanOrEqual', 'IsLessThanOrEqual' ];\n\n // OpNeg boxes `-val.Int()` / `-val.Float()`, i.e. an int64 or a float64, and nil\n // for anything else. `-x` reproduces that exactly only for an operand that already\n // prints as float64/int64; a Go `int` (or an integer literal) boxes as int instead.\n printInlineOpNeg(node, printedText: string): string | undefined {\n if (printedText.includes('\\n')) {\n return undefined;\n }\n const goType = this.goPrintedTypeOfExpression(node.operand, printedText);\n if ((goType === 'float64') || (goType === 'int64')) {\n return `-${printedText}`;\n }\n // a fractional/exponent literal is already a Go float64 constant; an integer\n // literal is only interchangeable where the consumer normalizes the number\n if (/^\\d+(\\.\\d+)?([eE][+-]?\\d+)?$/.test(printedText.trim())) {\n if (printedText.includes('.') || /[eE]/.test(printedText)) {\n return `-${printedText}`;\n }\n const parent = node.parent;\n if (parent?.kind === SyntaxKind.CallExpression) {\n const callee = this.printNode(parent.expression, 0);\n if (this.comparisonHelpers.indexOf(callee) >= 0) {\n return `-${printedText}`;\n }\n }\n // `a > -1` prints as IsGreaterThan(a, …); the relational wrappers all\n // normalise int/int64/float64 the same way the equality helpers do\n if (parent?.kind === SyntaxKind.BinaryExpression) {\n const op = parent.operatorToken.kind;\n if ((op === SyntaxKind.GreaterThanToken) || (op === SyntaxKind.GreaterThanEqualsToken)\n || (op === SyntaxKind.LessThanToken) || (op === SyntaxKind.LessThanEqualsToken)) {\n return `-${printedText}`;\n }\n }\n }\n return undefined;\n }\n\n // JS truthiness of an operand whose Go type the printer knows, expressed with\n // plain Go instead of boxing the value into `EvalTruthy(any)`. Each arm mirrors the\n // matching `EvalTruthy` case exactly, including nil (a nil *T and a nil map are\n // both falsy) — so this is the same predicate, minus the interface round-trip.\n printInlineTruthy(node): string | undefined {\n // every pointer/slice arm below repeats the operand, so only an identifier\n // qualifies; inlining a call would evaluate it twice\n if (node?.kind !== SyntaxKind.Identifier) {\n return undefined;\n }\n const goType = this.goDeclaredTypeOfIdentifier(node);\n if (goType === undefined) {\n return undefined;\n }\n const text = this.printNode(node, 0);\n switch (goType) {\n case 'bool':\n return text;\n case 'string':\n return `(${text} != \"\")`;\n case 'int':\n case 'int64':\n case 'float64':\n return `(${text} != 0)`;\n case '*bool':\n return `(${text} != nil && *${text})`;\n case '*string':\n return `(${text} != nil && *${text} != \"\")`;\n case '*int':\n case '*int64':\n case '*float64':\n return `(${text} != nil && *${text} != 0)`;\n case '[]string':\n case '[]any':\n case 'map[string]any':\n return `(len(${text}) > 0)`;\n }\n return undefined;\n }\n\n // an `any` box the checker proves can only hold a bool or nil — a `boolean`\n // local whose Go declaration stayed `any` (a later write the printer cannot\n // type, e.g. a tuple read) — is what `EvalTruthy` reduces to: nil and `false`\n printInlineBoolBoxTruthy(node): string | undefined {\n if (this.goScalarFamilyWithNil(node) !== 'bool') {\n return undefined;\n }\n let declaration;\n try {\n declaration = this.getChecker().getSymbolAtLocation(node)?.valueDeclaration?.resolve();\n } catch (e) {\n return undefined;\n }\n if (declaration?.kind !== SyntaxKind.VariableDeclaration && !this.goGetArgBoundParameter(node)) {\n return undefined; // a plain parameter keeps the caller's box untouched\n }\n const text = this.printNode(node, 0);\n if (!this.goIsAnyBoxExpression(node, text)) {\n return undefined;\n }\n return `(${text} == true)`;\n }\n\n // `EvalTruthy(this.SafeBool(…))`: the accessor's Go signature returns a `*bool`,\n // nil for an absent flag and the flag otherwise — exactly the two states\n // `derefScalar` hands the helper — so the predicate is `x != nil && *x`.\n printInlineBoolPointerTruthy(node, printedText: string): string | undefined {\n if (node?.kind !== SyntaxKind.CallExpression) {\n return undefined;\n }\n if (GO_PURE_BOOL_ACCESSORS.indexOf(this.goPrintedCallee(printedText) as string) < 0) {\n return undefined;\n }\n // the pointer is dereferenced twice, so every argument has to be a plain read\n if (!node.arguments.every((argument) => this.goIsRepeatSafePointerArgument(argument))) {\n return undefined;\n }\n return `(${printedText} != nil && *${printedText})`;\n }\n\n // an argument the two halves of a pointer deref may read twice: a plain\n // identifier/literal read, or a `this.` read of the exchange instance\n goIsRepeatSafePointerArgument(node): boolean {\n while (node?.kind === SyntaxKind.ParenthesizedExpression) {\n node = node.expression;\n }\n if (this.goIsReadOnlyCallArgument(node)) {\n return true;\n }\n return (node?.kind === SyntaxKind.PropertyAccessExpression)\n && (node.expression?.kind === SyntaxKind.ThisKeyword)\n && (node.name?.kind === SyntaxKind.Identifier);\n }\n\n // the native Go text for a condition operand the printer can type, or undefined\n // when the operand has to go through the truthiness helper. `(x)` is decided on\n // its operand and keeps the source parentheses, so the surrounding operator still\n // parses exactly the same way.\n goNativeCondition(node): string | undefined {\n if (node?.kind === SyntaxKind.Identifier) {\n return this.printInlineTruthy(node) ?? this.printInlineBoolBoxTruthy(node);\n }\n if (node?.kind === SyntaxKind.ParenthesizedExpression) {\n const inner = this.goNativeCondition(node.expression);\n if (inner === undefined) {\n return undefined;\n }\n return (inner.startsWith('(') && this.isWholePrintedCall(inner, 0)) ? inner : `(${inner})`;\n }\n // an expression that already prints a Go `bool` needs no EvalTruthy round-trip:\n // `a || b`, `!x`, `a === b` and the Is*/Precise.String* predicates are all\n // bool-typed, so `EvalTruthy()` is the identity function on them\n const printed = this.printNode(node, 0);\n const pointerTruthy = this.printInlineBoolPointerTruthy(node, printed);\n if (pointerTruthy !== undefined) {\n return pointerTruthy;\n }\n if (this.goTypeOfInitializer(node, printed) === 'bool') {\n return printed;\n }\n // a predicate the printer folds to a constant — IsArray on a proven slice or map —\n // prints a Go bool that the probe above cannot name\n if ((node?.kind === SyntaxKind.CallExpression) && ((printed === 'true') || (printed === 'false'))) {\n return printed;\n }\n if (GO_BOOL_FIELDS.has(printed)) {\n return printed;\n }\n // a hand-written bool-returning base method already prints a Go bool\n const callee = this.goPrintedCallee(printed);\n return (callee !== undefined && GO_BOOL_CALL_NAMES_NATIVE.indexOf(callee) >= 0) ? printed : undefined;\n }\n\n\n // gofmt prints the condition of every `if`/`for`/`switch` through\n // go/printer/nodes.go controlClause() -> stripParens(): the single outermost,\n // fully enclosing parentheses pair is dropped, and the rule applies again to the\n // enclosed expression while that one is parenthesized as well\n // (`if (x == 1) {` -> `if x == 1 {`, `if ((x == 1)) {` -> `if x == 1 {`).\n // Parentheses survive when the enclosed expression holds an unparenthesized\n // composite literal whose type is a type name, because `if T{} == x {` does not\n // parse. The printer emits text instead of an ast.Expr, so stripParens runs over\n // the printed condition text here.\n goControlClauseParens(node, expression: string): string {\n return this.goIsControlClauseCondition(node) ? this.goStripControlClauseParens(expression) : expression;\n }\n\n // the expression inside the outermost parentheses pair of `text`, or undefined\n // when `text` is not one fully enclosing pair or gofmt keeps that pair\n goEnclosedExpression(text: string): string | undefined {\n const trimmed = text.trim();\n if (!trimmed.startsWith('(') || !trimmed.endsWith(')')) {\n return undefined;\n }\n // `(a) && (b)` opens and closes with a parenthesis, but not the same pair\n if (this.goSkipBalanced(trimmed, 0, '(', ')') !== trimmed.length) {\n return undefined;\n }\n const inner = trimmed.substring(1, trimmed.length - 1).trim();\n if (this.goHasTypeNameCompositeLiteral(inner)) {\n return undefined; // stripParens keeps parentheses protecting a literal\n }\n return inner;\n }\n\n // the expression a Go `if`/`for`/`switch` statement tests, the only positions\n // gofmt's controlClause() rewrites\n goIsControlClauseCondition(node): boolean {\n const parent = node?.parent;\n switch (parent?.kind) {\n case SyntaxKind.IfStatement:\n case SyntaxKind.WhileStatement:\n case SyntaxKind.SwitchStatement:\n return parent.expression === node;\n case SyntaxKind.ForStatement:\n return parent.condition === node;\n }\n return false;\n }\n\n // stripParens' ast.Inspect stops at nested parentheses, which protect whatever\n // they enclose, and reports a composite literal whenever its type is a type name\n goHasTypeNameCompositeLiteral(text: string): boolean {\n let index = 0;\n while (index < text.length) {\n const char = text[index];\n if ((char === '\"') || (char === '`') || (char === '\\'')) {\n index = this.goSkipQuoted(text, index);\n continue;\n }\n if ((char === '(') || (char === '{')) {\n if ((char === '{') && this.goCompositeLitHasTypeName(text, index)) {\n return true;\n }\n const next = this.goSkipBalanced(text, index, char, (char === '(') ? ')' : '}');\n if (next < 0) {\n return false; // unbalanced text cannot be inspected any further\n }\n index = next;\n continue;\n }\n index += 1;\n }\n return false;\n }\n\n // `{` opens a composite literal whose type is a type name when the text in front\n // of it is an ident or a selector chain of idents; `map[string]any{` and `[]any{`\n // are type literals and do not count (isTypeName in go/printer/nodes.go)\n goCompositeLitHasTypeName(text: string, braceIndex: number): boolean {\n let start = braceIndex;\n while (start > 0 && /[A-Za-z0-9_.[\\]]/.test(text[start - 1])) {\n start -= 1;\n }\n const typeText = text.substring(start, braceIndex).trim();\n if (['map', 'struct', 'interface', 'func', 'chan'].indexOf(typeText) >= 0) {\n return false;\n }\n return /^[A-Za-z_]\\w*(\\.[A-Za-z_]\\w*)*$/.test(typeText);\n }\n\n // the index right after the bracket closing the one at `start`, or -1 when the\n // brackets are unbalanced (the printer sees statement fragments, not whole files)\n goSkipBalanced(text: string, start: number, open: string, close: string): number {\n let depth = 0;\n let index = start;\n while (index < text.length) {\n const char = text[index];\n if ((char === '\"') || (char === '`') || (char === '\\'')) {\n index = this.goSkipQuoted(text, index);\n continue;\n }\n if (char === open) {\n depth += 1;\n } else if (char === close) {\n depth -= 1;\n if (depth === 0) {\n return index + 1;\n }\n }\n index += 1;\n }\n return -1;\n }\n\n // the index right after the string, rune or raw string literal opening at `start`\n goSkipQuoted(text: string, start: number): number {\n const quote = text[start];\n let index = start + 1;\n while (index < text.length) {\n const char = text[index];\n if ((char === '\\\\') && (quote !== '`')) {\n index += 2;\n continue;\n }\n if (char === quote) {\n return index + 1;\n }\n index += 1;\n }\n return text.length;\n }\n\n // gofmt keeps a comment group that the source separates from the following\n // declaration by a blank line as a free-standing comment; joined to it, it becomes\n // the declaration's doc comment and its indented lines are re-laid out as a code\n // block. The blank line is preserved so the emitted text keeps the source's shape.\n printLeadingComments(node, identation) {\n const printed = super.printLeadingComments(node, identation);\n if (printed.length === 0) {\n return printed;\n }\n const fullText = this.getSrc().getFullText();\n const ranges = getLeadingCommentRanges(fullText, node.pos) ?? [];\n const last = ranges[ranges.length - 1];\n if (last === undefined) {\n return printed;\n }\n const gap = fullText.slice(last.end, node.getStart());\n const detached = (gap.match(/\\n/g) ?? []).length > 1;\n return detached ? printed + \"\\n\" : printed;\n }\n\n // level of the statement being printed: a multi-line composite literal is laid out\n // relative to it (go/printer), whatever level the expression printers hand down\n goStatementLevel = 0;\n\n // stdlib packages this file's native emissions call; printSourceFileStatements turns them\n // into the import declarations the emitted Go needs (an occurrence outside a file print,\n // e.g. the intellisense body, only marks a set that the next file print replaces)\n goFileStdlibImports = new Set();\n\n // gofmt separates a top-level declaration that carries a comment from the previous\n // declaration by a blank line (go/printer declList: min = 2 when the decl has a doc\n // comment); the file members are joined with a bare newline otherwise\n printSourceFileStatements(node, identation): string {\n const outerImports = this.goFileStdlibImports;\n const fileImports = new Set();\n this.goFileStdlibImports = fileImports;\n let body = '';\n try {\n const printed = node.statements.map((m) => this.printNode(m, identation + 1)).filter((st) => st.length > 0);\n body = printed.map((st, index) => (index > 0 && /^\\s*(\\/\\/|\\/\\*)/.test(st)) ? \"\\n\" + st : st).join(\"\\n\") + \"\\n\".repeat(this.NUM_LINES_END_FILE);\n } finally {\n this.goFileStdlibImports = outerImports;\n }\n if (fileImports.size === 0) {\n return body;\n }\n // a native emission needs its stdlib package, and an import declaration must precede\n // every other declaration: the file assembly puts this text right behind the generated\n // header, so the imports lead it (gofmt keeps an import clause before the first decl)\n return [...fileImports].sort().map((path) => `import \"${path}\"`).join(\"\\n\") + \"\\n\\n\" + body;\n }\n\n goBinaryMemoized(node, key: string, compute: () => T): T {\n const outermost = this.goBinaryMemo === undefined;\n const memo = this.goBinaryMemo ??= new Map();\n try {\n let byKey = memo.get(node);\n if (byKey?.has(key)) {\n const cached = byKey.get(key);\n return cached;\n }\n const value = compute();\n if (byKey === undefined) {\n memo.set(node, byKey = new Map());\n }\n byKey.set(key, value);\n return value;\n } finally {\n if (outermost) {\n this.goBinaryMemo = undefined;\n }\n }\n }\n\n // the printer state a binary print reads besides the node: depth, level and the recursion guards\n goBinaryContextKey(): string {\n return `${this.goExprDepth}|${this.goStatementLevel}|${this.goLocalTypeResolution.size}|${this.goDeclaredTypeInProgress.size}`;\n }\n\n goPrintBinaryMemoized(node, identation: number): string {\n const key = `print|${this.goBinaryContextKey()}|${identation}`;\n return this.goBinaryMemoized(node, key, () => this.goControlClauseParens(node, super.printNode(node, identation)));\n }\n\n printNode(node, identation = 0): string {\n if (node !== undefined && isSourceFile(node)) {\n this.className = \"undefined\";\n return this.printSourceFileStatements(node, identation);\n }\n if (node?.kind === SyntaxKind.BinaryExpression && GO_ARITHMETIC_KINDS.indexOf(node.operatorToken.kind) >= 0) {\n return this.goPrintBinaryMemoized(node, identation);\n }\n const isStatement = node !== undefined && isStatementNode(node) && node.kind !== SyntaxKind.Block;\n const previousLevel = this.goStatementLevel;\n if (isStatement) {\n this.goStatementLevel = identation;\n }\n try {\n const printed = super.printNode(node, identation);\n // the if/for/switch conditions go through here (printCondition resolves the\n // bool and the falsy/truthy paths before printing the node's text)\n return this.goControlClauseParens(node, printed);\n } finally {\n this.goStatementLevel = previousLevel;\n }\n }\n\n // composite literal body one level deeper than the statement, closing brace at the\n // statement's level; the leading indentation belongs to the enclosing printer\n printObjectLiteralExpression(node, identation) {\n const level = this.goStatementLevel;\n const objectBody = this.printObjectLiteralBody(node, level);\n const formattedObjectBody = objectBody ? \"\\n\" + objectBody + \"\\n\" + this.getIden(level) : objectBody;\n return this.OBJECT_OPENING + formattedObjectBody + this.OBJECT_CLOSING;\n }\n\n printCondition(node, identation) {\n // `!x` is handled by printPrefixUnaryExpression, which calls back into this\n // method with the operand; let the base class keep that recursion intact\n const native = this.goNativeCondition(node);\n if (native !== undefined) {\n // goNativeCondition prints the operand itself, so the control-clause\n // parens of printNode do not see the parentheses it wraps it in\n return `${this.getIden(identation)}${this.goControlClauseParens(node, native)}`;\n }\n // a native `key in obj` prints as a `func() bool` call, which the type probe\n // above cannot name; it is a Go bool all the same\n const inNode = (node?.kind === SyntaxKind.ParenthesizedExpression) ? node.expression : node;\n if (inNode?.kind === SyntaxKind.BinaryExpression && inNode.operatorToken.kind === SyntaxKind.InKeyword) {\n const inlined = this.printInlineInOp(inNode.right, inNode.left, this.printNode(inNode.right, 0), this.printNode(inNode.left, 0));\n if (inlined !== undefined) {\n const text = (inNode === node) ? inlined : `(${inlined})`;\n return `${this.getIden(identation)}${this.goControlClauseParens(node, text)}`;\n }\n }\n return super.printCondition(node, identation);\n }\n\n // === / !== inlined to plain Go operators when both sides are concrete Go\n // values or real pointers. Everything else — in particular anything that is\n // still `any` in Go — falls through to the existing IsEqual helper.\n // `(a == b || *a == *b)` is rejected: a nil *T panics on the second clause.\n // Go has no implicit numeric conversion: `*limit == length` does not compile\n // when limit is *int64 and length is int, even though TypeScript calls both\n // `number`. Dereferencing is therefore only safe against an untyped constant\n // (a literal, which adapts to the pointee) or an operand of the very same Go\n // type. Anything else — including any `any` operand — keeps IsEqual.\n goDerefComparableWith(ptrNode, ptrText: string, otherNode): boolean {\n const pointee = this.goPointerTypeOfExpression(ptrNode, ptrText)?.substring(1);\n if (pointee === undefined) {\n return false;\n }\n switch (otherNode?.kind) {\n case SyntaxKind.StringLiteral:\n case SyntaxKind.NoSubstitutionTemplateLiteral:\n return pointee === 'string';\n case SyntaxKind.NumericLiteral:\n return (pointee === 'int') || (pointee === 'int64') || (pointee === 'float64');\n case SyntaxKind.TrueKeyword:\n case SyntaxKind.FalseKeyword:\n return pointee === 'bool';\n }\n const otherType = this.goDeclaredTypeOfIdentifier(otherNode);\n return otherType === pointee;\n }\n\n // a node the printer prints as a Go string constant: both literal forms are\n // emitted with the printer's string quote token, so the comparison is a plain\n // Go string comparison\n goIsStringLiteralNode(node): boolean {\n return (node?.kind === SyntaxKind.StringLiteral) || (node?.kind === SyntaxKind.NoSubstitutionTemplateLiteral);\n }\n\n // the deref arms print their operand twice, so it must read the same value both times: an\n // identifier is a plain read, and a string accessor call whose arguments are all\n // identifiers/literals re-reads them (no statement runs between the two evaluations).\n goDerefRepeatableOperand(node, printedText: string): boolean {\n if (node?.kind === SyntaxKind.Identifier) {\n return true;\n }\n if (node?.kind !== SyntaxKind.CallExpression) {\n return false;\n }\n if (GO_PURE_STRING_ACCESSORS.indexOf(this.goPrintedCallee(printedText) as string) < 0) {\n return false;\n }\n return node.arguments.every((argument) => this.goIsReadOnlyCallArgument(argument));\n }\n\n // an argument whose evaluation is a plain read: a value the printer already\n // holds, never a call that could observe or cause a change\n goIsReadOnlyCallArgument(node): boolean {\n switch (this.goUnwrapParenthesizedNode(node)?.kind) {\n case SyntaxKind.Identifier:\n case SyntaxKind.StringLiteral:\n case SyntaxKind.NoSubstitutionTemplateLiteral:\n case SyntaxKind.NumericLiteral:\n case SyntaxKind.TrueKeyword:\n case SyntaxKind.FalseKeyword:\n case SyntaxKind.NullKeyword:\n return true;\n }\n return false;\n }\n\n // true when the Go value of this operand is a bare `string`: a local declared `string`, or a\n // parameter the signature printer emits as `string`. A Go string holds neither nil nor a pointer,\n // so `x == \"lit\"` is exactly IsEqual(x, \"lit\") — the pointer arms never see this type.\n goIsBareStringOperand(node): boolean {\n if (this.goDeclaredTypeOfIdentifier(node) === 'string') {\n return true;\n }\n if (node?.kind !== SyntaxKind.Identifier) {\n return false;\n }\n const checker: any = this.checkerOrUndefined();\n if (checker === undefined) {\n return false;\n }\n const symbol = checker.getSymbolAtLocation(node);\n const declaration = symbol?.valueDeclaration?.resolve();\n if (declaration?.kind !== SyntaxKind.Parameter) {\n return false;\n }\n return this.printParameterType(declaration) === 'string';\n }\n\n printInlineEquality(left, right, leftText: string, rightText: string, isEq: boolean): string | undefined {\n const lPtr = this.goPointerTypeOfExpression(left, leftText) !== undefined;\n const rPtr = this.goPointerTypeOfExpression(right, rightText) !== undefined;\n // the branches below that deref repeat the operand, so they may only be used\n // on an identifier or on one of the read-only string accessors (whose\n // arguments are plain reads); a call that does anything else stays IsEqual\n const lRepeatable = this.goDerefRepeatableOperand(left, leftText);\n const rRepeatable = this.goDerefRepeatableOperand(right, rightText);\n const lFam = this.goScalarFamily(left);\n const rFam = this.goScalarFamily(right);\n if (lFam === 'nil' && rPtr) {\n return isEq ? `(${rightText} == nil)` : `(${rightText} != nil)`;\n }\n if (rFam === 'nil' && lPtr) {\n return isEq ? `(${leftText} == nil)` : `(${leftText} != nil)`;\n }\n if (lPtr && rPtr) {\n const lPointee = this.goPointerTypeOfExpression(left, leftText);\n if (!lRepeatable || !rRepeatable\n || lPointee !== this.goPointerTypeOfExpression(right, rightText)) {\n return undefined; // IsEqual + derefScalar evaluates each side once\n }\n if (isEq) {\n return `(${leftText} == ${rightText} || (${leftText} != nil && ${rightText} != nil && *${leftText} == *${rightText}))`;\n }\n return `(${leftText} != ${rightText} && (${leftText} == nil || ${rightText} == nil || *${leftText} != *${rightText}))`;\n }\n if (lPtr && rFam !== undefined && rFam !== 'nil') {\n if (!lRepeatable || !this.goDerefComparableWith(left, leftText, right)) {\n return undefined;\n }\n return isEq\n ? `(${leftText} != nil && *${leftText} == ${rightText})`\n : `(${leftText} == nil || *${leftText} != ${rightText})`;\n }\n if (rPtr && lFam !== undefined && lFam !== 'nil') {\n if (!rRepeatable || !this.goDerefComparableWith(right, rightText, left)) {\n return undefined;\n }\n return isEq\n ? `(${rightText} != nil && *${rightText} == ${leftText})`\n : `(${rightText} == nil || *${rightText} != ${leftText})`;\n }\n // two definitely-present scalars of the same family: `==` is valid Go and\n // needs no helper. Nullable aliases (Str/Int/Num/Bool) are `any` in Go and\n // returned undefined by goScalarFamily, so they keep IsEqual.\n if (!lPtr && !rPtr && lFam !== undefined && rFam !== undefined\n && lFam !== 'nil' && rFam !== 'nil' && lFam === rFam) {\n return isEq ? `(${leftText} == ${rightText})` : `(${leftText} != ${rightText})`;\n }\n // both operands print as a concrete Go numeric kind (a declared int/int64/float64, or a\n // constant that fits the other side): IsEqual converts to that same kind, never sees nil\n const numericKind = (!lPtr && !rPtr) ? this.goNativeNumericEqualityKind(left, leftText, right, rightText) : undefined;\n if (numericKind !== undefined) {\n return isEq ? `(${leftText} == ${rightText})` : `(${leftText} != ${rightText})`;\n }\n // the declared-local table names `string` for this identifier (or the signature printer emits the\n // parameter as `string`): a `var x string` cannot hold a pointer or nil, so a string-literal\n // comparison equals the helper. A local ever written another type is reported `any` and boxed.\n if (!lPtr && !rPtr) {\n if ((this.goIsBareStringOperand(left) && this.goIsStringLiteralNode(right))\n || (this.goIsBareStringOperand(right) && this.goIsStringLiteralNode(left))) {\n return isEq ? `(${leftText} == ${rightText})` : `(${leftText} != ${rightText})`;\n }\n }\n // an operand the printer boxes into `any` whose TypeScript type proves the box\n // holds a scalar or nil: `x === undefined` and `x === 'lit'` are then the same\n // predicate as the helper, without the interface round-trip. Numbers stay on\n // IsEqual: an `any` box may hold int, int64 or float64, and Go compares those\n // by exact width.\n const lNilFam = this.goScalarFamilyWithNil(left);\n const rNilFam = this.goScalarFamilyWithNil(right);\n const lBox = !lPtr && this.goIsAnyBoxExpression(left, leftText);\n const rBox = !rPtr && this.goIsAnyBoxExpression(right, rightText);\n if (lBox && (rFam === 'nil') && (lNilFam !== undefined) && (lNilFam !== 'number')) {\n return isEq ? `(${leftText} == nil)` : `(${leftText} != nil)`;\n }\n if (rBox && (lFam === 'nil') && (rNilFam !== undefined) && (rNilFam !== 'number')) {\n return isEq ? `(${rightText} == nil)` : `(${rightText} != nil)`;\n }\n // a parameter whose TypeScript type is an array or object (`Strings`, `Market`, `NullableDict`,\n // `object[]`): the Go box holds a map/slice or an untyped nil, not a pointer — GetArg unwraps the\n // typed nil pointers the wrappers pass, so `x == nil` is exactly IsEqual(x, nil)\n const lObjParam = (lNilFam === undefined) && lBox && this.goObjectBoxParameter(left);\n const rObjParam = (rNilFam === undefined) && rBox && this.goObjectBoxParameter(right);\n if (lObjParam && (rFam === 'nil')) {\n return isEq ? `(${leftText} == nil)` : `(${leftText} != nil)`;\n }\n if (rObjParam && (lFam === 'nil')) {\n return isEq ? `(${rightText} == nil)` : `(${rightText} != nil)`;\n }\n // an `any` local the printer cannot type whose every write is a non-pointer\n // source (endpoint await / JSON decode / literal / nil): its box is never a\n // nil *T, so the interface test is the same predicate as the helper\n if (lBox && (rFam === 'nil') && this.goAnyLocalHoldsNonPointer(this.goAnyBoxLocalDeclaration(left))) {\n return isEq ? `(${leftText} == nil)` : `(${leftText} != nil)`;\n }\n if (rBox && (lFam === 'nil') && this.goAnyLocalHoldsNonPointer(this.goAnyBoxLocalDeclaration(right))) {\n return isEq ? `(${rightText} == nil)` : `(${rightText} != nil)`;\n }\n // a parameter with a TypeScript default is bound by `x := GetArg(optionalArgs, i, default)`, which\n // folds a typed nil pointer (and nil []string/[]any) into the untyped default: never a nil *T.\n // Nullable Int/Num aliases are excluded above only because exact-width comparison needs `number`.\n if ((lNilFam === 'number') && (rFam === 'nil') && this.goGetArgBoundParameter(left)) {\n return isEq ? `(${leftText} == nil)` : `(${leftText} != nil)`;\n }\n if ((rNilFam === 'number') && (lFam === 'nil') && this.goGetArgBoundParameter(right)) {\n return isEq ? `(${rightText} == nil)` : `(${rightText} != nil)`;\n }\n // a string or bool literal: only a value of that very type is equal in both\n // predicates, so no numeric or nil member can be compared away\n const isLiteral = (node): boolean => {\n switch (node?.kind) {\n case SyntaxKind.StringLiteral:\n case SyntaxKind.NoSubstitutionTemplateLiteral:\n case SyntaxKind.TrueKeyword:\n case SyntaxKind.FalseKeyword:\n return true;\n }\n return false;\n };\n const literalMatchesBox = (boxFam: string | undefined, litNode, litFam: string | undefined): boolean =>\n ((litFam === 'string') || (litFam === 'bool')) && isLiteral(litNode)\n && ((boxFam === litFam) || (boxFam === undefined));\n if ((lBox && literalMatchesBox(lNilFam, right, rFam)) || (rBox && literalMatchesBox(rNilFam, left, lFam))) {\n return isEq ? `(${leftText} == ${rightText})` : `(${leftText} != ${rightText})`;\n }\n // IsEqual(GetValue(market, \"spot\"), true): the checker proves the read holds\n // a bool or nil (Market.spot), and every other dynamic type is unequal to a\n // Go bool, nil included — the same predicate as the helper\n const isBoolLiteral = (node): boolean =>\n (node?.kind === SyntaxKind.TrueKeyword) || (node?.kind === SyntaxKind.FalseKeyword);\n if ((!lPtr && isBoolLiteral(right) && (this.goScalarFamilyWithNil(left) === 'bool') && this.goBoxedElementRead(left, leftText))\n || (!rPtr && isBoolLiteral(left) && (this.goScalarFamilyWithNil(right) === 'bool') && this.goBoxedElementRead(right, rightText))) {\n return isEq ? `(${leftText} == ${rightText})` : `(${leftText} != ${rightText})`;\n }\n // two boxes of one non-numeric family: both hold that scalar or nil\n if (lBox && rBox && (lNilFam !== undefined) && (lNilFam !== 'number') && (lNilFam === rNilFam)) {\n return isEq ? `(${leftText} == ${rightText})` : `(${leftText} != ${rightText})`;\n }\n return undefined;\n }\n\n // the kind a native `==` compares two numeric operands in; undefined keeps IsEqual. Two\n // constants are left to the helper (nothing to type), as is any mix Go would refuse.\n goNativeNumericEqualityKind(left, leftText: string, right, rightText: string): string | undefined {\n if (this.goIsNumericConstant(left) && this.goIsNumericConstant(right)) {\n return undefined;\n }\n const leftKind = this.goOperandNumericKind(left, leftText);\n const rightKind = this.goOperandNumericKind(right, rightText);\n if ((leftKind === undefined) || (rightKind === undefined)) {\n return undefined;\n }\n return this.goComparisonKind(left, leftKind, right, rightKind);\n }\n\n // the Go numeric kind an operand's static type is, or undefined when it stays\n // `any` (unknown helper result, union, pointer box): only a concrete kind can\n // join a comparison the Go compiler accepts\n goOperandNumericKind(node, printedText: string): string | undefined {\n if (node === undefined) {\n return undefined;\n }\n if (node.kind === SyntaxKind.Identifier) {\n const declared = this.goDeclaredTypeOfIdentifier(node);\n if (declared !== undefined) {\n return (GO_NUMERIC_KINDS.indexOf(declared) >= 0) ? declared : undefined;\n }\n return this.goLiteralTypedLocalKind(node);\n }\n if (this.goIsNumericConstant(node)) {\n return this.goNumericLiteralKind(node);\n }\n if (node.kind === SyntaxKind.ParenthesizedExpression) {\n return this.goOperandNumericKind(node.expression, this.printNode(node.expression, 0));\n }\n const goType = this.goTypeOfInitializer(node, printedText);\n return (goType !== undefined && GO_NUMERIC_KINDS.indexOf(goType) >= 0) ? goType : undefined;\n }\n\n // a local bound by `:=` takes its Go type from the initializer: an untyped\n // integer constant is `int`, a floating-point one is `float64`. A variable\n // statement prints `var x = …` instead, where the printer already\n // decided the type, so only the `:=` form may be trusted here.\n goLiteralTypedLocalKind(node): string | undefined {\n const checker: any = this.checkerOrUndefined();\n if (checker === undefined) {\n return undefined;\n }\n const symbol = checker.getSymbolAtLocation(node);\n const declaration = symbol?.valueDeclaration?.resolve();\n if (declaration?.kind !== SyntaxKind.VariableDeclaration || declaration.initializer === undefined) {\n return undefined;\n }\n const declarationList = declaration.parent;\n if (declarationList?.kind !== SyntaxKind.VariableDeclarationList\n || declarationList.parent?.kind === SyntaxKind.FirstStatement) {\n return undefined;\n }\n return this.goNumericLiteralKind(declaration.initializer);\n }\n\n // an untyped Go constant: the integer forms adopt any numeric kind, the\n // floating-point ones only fit float64. A signed literal is the same constant:\n // the printer writes `-1` as text, never through OpNeg's box.\n goNumericLiteralKind(node): string | undefined {\n if (this.goIsSignedNumericLiteral(node)) {\n return this.goNumericLiteralKind(node.operand);\n }\n const text = node?.text;\n if (text === undefined) {\n return undefined;\n }\n if (/^[0-9][0-9_]*$/.test(text) || /^0[xXoObB][0-9a-fA-F_]+$/.test(text)) {\n return 'int';\n }\n if (/^[0-9][.eE]/.test(text)) {\n return 'float64';\n }\n return undefined;\n }\n\n // `-1` / `+1.5` as written: a sign on a numeric literal, the only prefix-unary\n // shape that reaches a comparison as a constant rather than as OpNeg(...)\n goIsSignedNumericLiteral(node): boolean {\n if (node?.kind !== SyntaxKind.PrefixUnaryExpression) {\n return false;\n }\n if ((node.operator !== SyntaxKind.MinusToken) && (node.operator !== SyntaxKind.PlusToken)) {\n return false;\n }\n return node.operand?.kind === SyntaxKind.NumericLiteral;\n }\n\n // a numeric constant operand: an integer/float literal, with an optional sign\n goIsNumericConstant(node): boolean {\n return (node?.kind === SyntaxKind.NumericLiteral) || this.goIsSignedNumericLiteral(node);\n }\n\n // the constant's value with its sign; NaN for anything but a numeric constant\n goNumericConstantValue(node): number {\n if (this.goIsSignedNumericLiteral(node)) {\n const value = Number(node.operand.text.replaceAll('_', ''));\n return (node.operator === SyntaxKind.MinusToken) ? -value : value;\n }\n if (node?.kind !== SyntaxKind.NumericLiteral) {\n return Number.NaN;\n }\n return Number(node.text.replaceAll('_', ''));\n }\n\n // a constant only joins a comparison when its value is representable in the\n // other operand's kind: `0.5` is not an int, and neither is 1e400 (infinity)\n goLiteralFitsKind(node, kind: string): boolean {\n const value = this.goNumericConstantValue(node);\n if (!Number.isFinite(value)) {\n return false;\n }\n if (kind === 'float64') {\n return true;\n }\n return Number.isInteger(value) && (Math.abs(value) <= 2147483647);\n }\n\n // the kind both operands are compared in, or undefined when Go would need a\n // conversion (two different concrete kinds) or the constant does not fit\n goComparisonKind(left, leftKind: string, right, rightKind: string): string | undefined {\n if (leftKind === rightKind) {\n return leftKind;\n }\n if (this.goIsNumericConstant(left) && !this.goIsNumericConstant(right)) {\n return this.goLiteralFitsKind(left, rightKind) ? rightKind : undefined;\n }\n if (this.goIsNumericConstant(right) && !this.goIsNumericConstant(left)) {\n return this.goLiteralFitsKind(right, leftKind) ? leftKind : undefined;\n }\n return undefined;\n }\n\n // `<` `>` `<=` `>=` between two operands the checker proves to be numbers of the\n // same Go kind is exactly the comparison the helper performs, minus the interface\n // round-trip, so the call carries no information. A `*int64` / `*float64` operand\n // joins them with its deref written out, and the helper's nil predicate with it.\n // Everything else — `any` boxes, mixed kinds, strings — keeps the helper. float64\n // keeps IsLessThan/IsLessThanOrEqual: the helper answers true whenever an operand\n // is NaN while Go (and JS) answer false, and only those two operators differ.\n printInlineOrderedComparison(left, right, leftText: string, rightText: string, op): string | undefined {\n const operator = ORDERED_COMPARISON_OPERATORS[op];\n if (operator === undefined) {\n return undefined;\n }\n const leftPointee = this.goOrderedComparisonPointerKind(left);\n const rightPointee = this.goOrderedComparisonPointerKind(right);\n if ((leftPointee !== undefined) || (rightPointee !== undefined)) {\n return this.printPointerOrderedComparison(left, right, leftText, rightText, operator, leftPointee, rightPointee);\n }\n const leftKind = this.goOperandNumericKind(left, leftText);\n const rightKind = this.goOperandNumericKind(right, rightText);\n if ((leftKind === undefined) || (rightKind === undefined)) {\n return undefined;\n }\n // both operands may additionally be checker-typed numbers; that check is\n // implied by the concrete Go kind above and buys nothing\n const kind = this.goComparisonKind(left, leftKind, right, rightKind);\n if (kind === undefined) {\n return undefined;\n }\n if ((kind === 'float64') && ((operator === '<') || (operator === '<='))) {\n return undefined;\n }\n return `(${leftText} ${operator} ${rightText})`;\n }\n\n // the pointee kind of a `*int64` / `*float64` **identifier** operand. Only a local\n // the printer itself declared as that pointer qualifies: a call would be repeated by\n // the nil test, and an `any` box holds a value the printer cannot name.\n goOrderedComparisonPointerKind(node): string | undefined {\n if (node?.kind !== SyntaxKind.Identifier) {\n return undefined;\n }\n const declared = this.goDeclaredTypeOfIdentifier(node);\n if ((declared !== '*int64') && (declared !== '*float64')) {\n return undefined;\n }\n return declared.substring(1);\n }\n\n // an ordered comparison with a `*int64` / `*float64` operand on at least one side. The helper\n // derefs both sides and answers its own predicate when one is nil, so the native form spells that\n // out; an enclosing `x !== undefined` guard (printed as `x != nil`) removes it for that side.\n printPointerOrderedComparison(left, right, leftText: string, rightText: string, operator: string, leftPointee: string | undefined, rightPointee: string | undefined): string | undefined {\n const leftKind = (leftPointee === undefined) ? this.goOperandNumericKind(left, leftText) : leftPointee;\n const rightKind = (rightPointee === undefined) ? this.goOperandNumericKind(right, rightText) : rightPointee;\n if ((leftKind === undefined) || (rightKind === undefined)) {\n return undefined;\n }\n const kind = this.goComparisonKind(left, leftKind, right, rightKind);\n if (kind === undefined) {\n return undefined;\n }\n // NaN is a float64 to the helper too: `<` / `<=` answer true for it while Go\n // answers false, so those two operators keep the call exactly as phase-1 does\n if ((kind === 'float64') && ((operator === '<') || (operator === '<='))) {\n return undefined;\n }\n const leftNil = (leftPointee !== undefined) && !this.goHasEnclosingNilGuard(left);\n const rightNil = (rightPointee !== undefined) && !this.goHasEnclosingNilGuard(right);\n // a nil test short-circuits the operand on the other side, so that side has to\n // be free of calls for the helper's single evaluation to stay unobservable\n if (leftNil && (rightPointee === undefined) && !this.goIsPureComparisonOperand(right)) {\n return undefined;\n }\n if (rightNil && (leftPointee === undefined) && !this.goIsPureComparisonOperand(left)) {\n return undefined;\n }\n const lv = (leftPointee === undefined) ? leftText : `*${leftText}`;\n const rv = (rightPointee === undefined) ? rightText : `*${rightText}`;\n if (!leftNil && !rightNil) {\n return `(${lv} ${operator} ${rv})`;\n }\n // every arm below answers what the helper answers when a side is nil:\n // `a != nil && b == nil` for `>`/`>=`, `a == nil && b != nil` for `<`/`<=`\n const greater = (operator === '>') || (operator === '>=');\n if (leftNil && !rightNil) {\n return greater ? `(${leftText} != nil && ${lv} ${operator} ${rv})` : `(${leftText} == nil || ${lv} ${operator} ${rv})`;\n }\n if (!leftNil && rightNil) {\n return greater ? `(${rightText} == nil || ${lv} ${operator} ${rv})` : `(${rightText} != nil && ${lv} ${operator} ${rv})`;\n }\n if (operator === '>') {\n return `(${leftText} != nil && (${rightText} == nil || ${lv} > ${rv}))`;\n }\n if (operator === '>=') {\n return `(${rightText} == nil || (${leftText} != nil && ${lv} >= ${rv}))`;\n }\n if (operator === '<') {\n return `(${rightText} != nil && (${leftText} == nil || ${lv} < ${rv}))`;\n }\n return `(${leftText} == nil || (${rightText} != nil && ${lv} <= ${rv}))`;\n }\n\n // `x !== undefined` / `x != null` on that identifier: the printer writes the Go\n // `x != nil` test for it, so an enclosing one proves the pointer present\n goIsNonNilTestOf(node, ident): boolean {\n if (node?.kind !== SyntaxKind.BinaryExpression) {\n return false;\n }\n const op = node.operatorToken?.kind;\n if ((op !== SyntaxKind.ExclamationEqualsToken) && (op !== SyntaxKind.ExclamationEqualsEqualsToken)) {\n return false;\n }\n return (this.goIsSameSymbol(node.left, ident) && this.goIsNilLiteral(node.right))\n || (this.goIsSameSymbol(node.right, ident) && this.goIsNilLiteral(node.left));\n }\n\n // a null/undefined literal, or any expression the checker types as one\n goIsNilLiteral(node): boolean {\n if ((node?.kind === SyntaxKind.NullKeyword) || (node?.kind === SyntaxKind.UndefinedKeyword)) {\n return true;\n }\n return (node?.kind === SyntaxKind.Identifier) && (this.goScalarFamily(node) === 'nil');\n }\n\n goIsSameSymbol(a, b): boolean {\n if ((a?.kind !== SyntaxKind.Identifier) || (b?.kind !== SyntaxKind.Identifier)) {\n return false;\n }\n try {\n const checker = this.getChecker();\n const leftSymbol = checker.getSymbolAtLocation(a);\n return (leftSymbol !== undefined) && (leftSymbol === checker.getSymbolAtLocation(b));\n } catch (e) {\n return false;\n }\n }\n\n // [guarded child, guarding condition] fields of the constructs a nil guard dominates\n goNilGuardFields: { [kind: number]: [string, string] } = {\n [SyntaxKind.IfStatement]: ['thenStatement', 'expression'],\n [SyntaxKind.WhileStatement]: ['statement', 'expression'],\n [SyntaxKind.ForStatement]: ['statement', 'condition'],\n [SyntaxKind.ConditionalExpression]: ['whenTrue', 'condition'],\n };\n\n // true when the enclosing control flow already proves the identifier non-nil at this node: an\n // earlier conjunct of an `&&` chain, or the condition of a wrapping if/loop/ternary containing the\n // node. A local rebound anywhere in its function never counts — the guard may be dead by then.\n goHasEnclosingNilGuard(ident): boolean {\n const checker: any = this.checkerOrUndefined();\n if (checker === undefined) {\n return false;\n }\n const declaration = checker.getSymbolAtLocation(ident)?.valueDeclaration?.resolve();\n if (this.goLocalIsRebound(this.goEnclosingFunction(declaration ?? ident), ident)) {\n return false;\n }\n let child = ident;\n let parent = ident?.parent;\n while (parent !== undefined) {\n const kind = parent.kind;\n if ((kind === SyntaxKind.ParenthesizedExpression) || (kind === SyntaxKind.VariableStatement)\n || (kind === SyntaxKind.ExpressionStatement) || (kind === SyntaxKind.Block)\n || (kind === SyntaxKind.ReturnStatement) || (kind === SyntaxKind.ElementAccessExpression)\n || (kind === SyntaxKind.CallExpression) || (kind === SyntaxKind.PropertyAccessExpression)\n || (kind === SyntaxKind.ObjectLiteralExpression) || (kind === SyntaxKind.PropertyAssignment)\n || (kind === SyntaxKind.ArrayLiteralExpression) || (kind === SyntaxKind.AwaitExpression)\n || (kind === SyntaxKind.CaseClause) || (kind === SyntaxKind.SwitchStatement)\n || (kind === SyntaxKind.DoStatement) || (kind === SyntaxKind.LabeledStatement)) {\n // the guard still dominates everything below such a wrapper\n child = parent;\n parent = parent.parent;\n continue;\n }\n if (kind === SyntaxKind.BinaryExpression) {\n const op = parent.operatorToken?.kind;\n if ((op === SyntaxKind.AmpersandAmpersandToken) && (child === parent.right)\n && this.goConditionProvesNonNil(parent.left, ident)) {\n return true;\n }\n // `a || b` and a left conjunct are evaluated before the guard, so they\n // prove nothing; the guard of an enclosing construct still applies\n child = parent;\n parent = parent.parent;\n continue;\n }\n const guard = this.goNilGuardFields[kind];\n if (guard !== undefined) {\n if ((child === parent[guard[0]]) && this.goConditionProvesNonNil(parent[guard[1]], ident)) {\n return true;\n }\n child = parent;\n parent = parent.parent;\n continue;\n }\n // functions, classes and everything else the scan does not model: the\n // guard cannot be carried across\n return false;\n }\n return false;\n }\n\n // the whole condition, or any conjunct of its `&&` chain, is the non-nil test\n goConditionProvesNonNil(condition, ident): boolean {\n const inner = this.goUnwrapParenthesizedNode(condition);\n if (inner === undefined) {\n return false;\n }\n if (this.goIsNonNilTestOf(inner, ident)) {\n return true;\n }\n if ((inner.kind !== SyntaxKind.BinaryExpression) || (inner.operatorToken?.kind !== SyntaxKind.AmpersandAmpersandToken)) {\n return false;\n }\n return this.goConditionProvesNonNil(inner.left, ident) || this.goConditionProvesNonNil(inner.right, ident);\n }\n\n goUnwrapParenthesizedNode(node) {\n let current = node;\n while (current?.kind === SyntaxKind.ParenthesizedExpression) {\n current = current.expression;\n }\n return current;\n }\n\n // an operand a short-circuit may skip without any observable difference: no calls,\n // no assignments, nothing the helper would have evaluated exactly once\n goIsPureComparisonOperand(node): boolean {\n switch (node?.kind) {\n case SyntaxKind.Identifier:\n case SyntaxKind.NumericLiteral:\n case SyntaxKind.StringLiteral:\n case SyntaxKind.NoSubstitutionTemplateLiteral:\n case SyntaxKind.PropertyAccessExpression:\n return true;\n case SyntaxKind.PrefixUnaryExpression:\n return (node.operator === SyntaxKind.MinusToken) && this.goIsPureComparisonOperand(node.operand);\n case SyntaxKind.ParenthesizedExpression:\n return this.goIsPureComparisonOperand(node.expression);\n }\n return false;\n }\n\n // Go's printer never wraps an already parenthesised expression: gofmt prints a\n // ParenExpr whose child is itself a ParenExpr without its own parentheses\n // (`((x))` prints as `(x)`), because the text it is handed is re-parsed that way.\n // Our output is re-parsed exactly like that, so a source parenthesis around an\n // expression that already prints parenthesised -- an inlined comparison, a nested\n // parenthesised expression, an EvalTruthy(...) arm -- must emit the single pair\n // gofmt keeps instead of doubling it.\n printParenthesizedExpression(node, identation) {\n const expression = node.expression;\n if (expression?.kind === SyntaxKind.AsExpression) {\n // transform (this as any) into this, () and as any are not necessary\n return this.getIden(identation) + this.printNode(expression, 0);\n }\n if (expression?.kind === SyntaxKind.ArrowFunction) {\n // ignore arrowFunctions inside parenthesis\n return \"\";\n }\n // parentheses undo one level of depth (go/printer reduceDepth())\n const printed = this.goWithExprDepth(this.goExprDepth - 1, () => this.printNode(expression, 0));\n if (this.goIsParenthesizedExpression(printed)) {\n return this.getIden(identation) + printed;\n }\n return this.getIden(identation) + this.LEFT_PARENTHESIS + printed + this.RIGHT_PARENTHESIS;\n }\n\n // true when the printed text is exactly one parenthesised expression: its first\n // `(` closes on the last non-space character. Literals and comments are skipped\n // so a parenthesis inside them cannot unbalance the scan.\n goIsParenthesizedExpression(printed: string): boolean {\n const text = printed.trimStart();\n if (text[0] !== '(') {\n return false;\n }\n let depth = 0;\n for (let i = 0; i < text.length; i++) {\n const c = text[i];\n if ((c === '/') && (text[i + 1] === '/')) {\n // a trailing line comment belongs to the statement, not to the expression\n return false;\n }\n if ((c === '/') && (text[i + 1] === '*')) {\n const end = text.indexOf('*/', i + 2);\n if (end < 0) {\n return false;\n }\n i = end + 1;\n continue;\n }\n if ((c === '\"') || (c === '\\'') || (c === '`')) {\n i = this.goSkipGoLiteral(text, i);\n if (i < 0) {\n return false;\n }\n continue;\n }\n if (c === '(') {\n depth += 1;\n } else if (c === ')') {\n depth -= 1;\n if (depth === 0) {\n return text.substring(i + 1).trim().length === 0;\n }\n }\n }\n return false;\n }\n\n // index of the quote closing the Go string/rune literal that starts at `start`, -1 when unterminated\n goSkipGoLiteral(text: string, start: number): number {\n const quote = text[start];\n for (let i = start + 1; i < text.length; i++) {\n const c = text[i];\n if (c === '\\\\') {\n i += 1;\n continue;\n }\n if (c === quote) {\n return i;\n }\n }\n return -1;\n }\n\n // castVariableAssignmentIfNeeded(left, right, identation) {\n // const leftType = this.getChecker().getTypeAtLocation(left);\n // const rightType = this.getChecker().getTypeAtLocation(right);\n\n // const leftText = this.printNode(left, 0);\n // const rightText = this.printNode(right, 0);\n\n // if (this.isAnyType(rightType.flags) && !this.isAnyType(leftType.flags)) {\n // const parsedType = this.getTypeFromRawType(leftType);\n // return `${this.getIden(identation)}${leftText} = (${parsedType})${rightText}`;\n // }\n // return undefined;\n // }\n\n transformPropertyAcessExpressionIfNeeded(node) {\n const expression = node.expression;\n const leftSide = this.printNode(expression, 0);\n const rightSide = node.name.text;\n\n let rawExpression = undefined;\n\n switch(rightSide) {\n case 'length':\n const type = (this.getChecker() as Checker).getTypeAtLocation(expression); // eslint-disable-line\n // this.warnIfAnyType(node, type.flags, leftSide, \"length\");\n // rawExpression = this.isStringType(type.flags) ? `(string${leftSide}).Length` : `(${leftSide}.Cast().ToList()).Count`;\n rawExpression = this.printInlineArrayLength(expression, leftSide, node) ?? this.goHx4G06DerefLength(expression, leftSide, node) ?? (this.isStringType(type.flags) ? `GetLength(${leftSide})` : `${this.ARRAY_LENGTH_WRAPPER_OPEN}${leftSide}${this.ARRAY_LENGTH_WRAPPER_CLOSE}`); // `(${leftSide}.Cast()).ToList().Count`\n break;\n case 'push':\n rawExpression = `((IList)${leftSide}).Add`;\n break;\n // case 'push':\n // rawExpression = `(List${leftSide}).Add`s\n // break;\n }\n return rawExpression;\n }\n\n // The Go type of a GetArg-bound optional local (from the printed default, or the declared type\n // for a nil default), or undefined to keep `any`; the retype needs goLocalIsSafeToType,\n // goParameterKeepsNilCompareNative and goGetArgConsumersAreSafe to agree.\n goGetArgLocalType(body, param, printedDefault: string): string | undefined {\n const method: any = param?.parent;\n const excluded = GO_GETARG_EXCLUDED_POSITIONS[method?.name?.text];\n if ((excluded !== undefined) && excluded.includes(method.parameters.indexOf(param))) {\n return undefined;\n }\n // an explicit `any` annotation admits values of other shapes than the default (api lists),\n // unless it only restates an override of a base parameter the base leaves unannotated\n if ((param?.type?.kind === SyntaxKind.AnyKeyword) && !this.goGetArgBaseParamIsUnannotated(param)) {\n return undefined;\n }\n const shape = (printedDefault ?? '').trim();\n const byDefault = this.goGetArgTypeOfShape(shape);\n if (byDefault !== undefined) {\n // a declared type naming no single Go type (IndexType = number | string) admits other shapes;\n // an admitted `any` restatement binds by its default, as the base does\n if ((param?.type !== undefined) && (param.type.kind !== SyntaxKind.AnyKeyword)\n && !this.goGetArgDeclaredTypeCandidates(param).some((t) => t.replace(/^\\*/, '') === byDefault)) {\n return undefined;\n }\n return this.goGetArgLocalIsSafe(body, param, byDefault) ? byDefault : undefined;\n }\n if ((shape !== 'nil') && (shape !== 'undefined')) {\n return undefined;\n }\n for (const goType of this.goGetArgDeclaredTypeCandidates(param)) {\n if (this.goGetArgLocalIsSafe(body, param, goType, true)) {\n return goType;\n }\n }\n return undefined;\n }\n\n // true when the method overrides a base method whose parameter at the same position has no\n // type annotation and a default of the same syntax kind (the base binds it through its twin)\n goGetArgBaseParamIsUnannotated(param): boolean {\n const method: any = param?.parent;\n const name = method?.name?.text;\n const index = method?.parameters?.indexOf(param) ?? -1;\n const cls: any = method?.parent;\n const checker: any = this.checkerOrUndefined();\n if ((name === undefined) || (index < 0) || (checker === undefined) || (param.initializer === undefined)) {\n return false;\n }\n for (const clause of (cls?.heritageClauses ?? [])) {\n if (clause.token !== SyntaxKind.ExtendsKeyword) {\n continue;\n }\n for (const expr of (clause.types ?? [])) {\n const baseDecl: any = checker.getTypeAtLocation(expr)?.getProperty?.(name)?.valueDeclaration?.resolve();\n const baseParam: any = baseDecl?.parameters?.[index];\n if (baseParam === undefined) {\n return false;\n }\n return (baseParam.type === undefined) && (baseParam.initializer !== undefined)\n && (baseParam.initializer.kind === param.initializer.kind);\n }\n }\n return false;\n }\n\n // a use of a nil-defaulted map local that only reads it: an element read, `k in x`, or the\n // receiver of a helper that treats a nil map like an absent value (no IsDictionary/IsEqual)\n goGetArgNilMapUseOnlyReads(n): boolean {\n const parent: any = n.parent;\n if ((parent?.kind === SyntaxKind.ElementAccessExpression) || (parent?.kind === SyntaxKind.BinaryExpression)) {\n return this.goSafeDictUseReadsTheMap(n);\n }\n if ((parent?.kind !== SyntaxKind.CallExpression) || (parent.arguments.indexOf(n) !== 0)) {\n return false;\n }\n const callee = this.goPrintedCallee(this.printNode(parent, 0));\n return (callee !== undefined) && (GO_GETARG_NIL_MAP_READERS.indexOf(callee.replace(/^this\\./, '')) >= 0);\n }\n\n // a nil []string reads like the absent box: `x.length` / GetArrayLength is 0, `x[i]` (GetValue)\n // is nil, InArray finds nothing, and a defaulted Strings position's GetArg folds it to its default\n goGetArgNilStringSliceUseOnlyReads(n): boolean {\n const parent: any = n.parent;\n if ((parent?.kind === SyntaxKind.PropertyAccessExpression) && (parent.expression === n)) {\n return (parent.name?.text === 'length') && (parent.parent?.kind !== SyntaxKind.CallExpression || parent.parent.expression !== parent)\n && !((parent.parent?.kind === SyntaxKind.BinaryExpression) && (parent.parent.left === parent));\n }\n if (parent?.kind === SyntaxKind.ElementAccessExpression) {\n return this.goSafeDictUseReadsTheMap(n);\n }\n if ((parent?.kind !== SyntaxKind.CallExpression) || (parent.expression === n)) {\n return false;\n }\n const argIndex = parent.arguments.indexOf(n);\n const callee: any = parent.expression;\n if ((callee?.kind === SyntaxKind.PropertyAccessExpression) && (callee.expression?.kind === SyntaxKind.ThisKeyword)\n && (callee.name?.text === 'inArray') && (argIndex === 1)) {\n return true;\n }\n if (!this.goGetArgPositionIsDefaulted(callee, argIndex)) {\n return false;\n }\n let decl: any;\n try {\n decl = this.getChecker().getSymbolAtLocation(callee)?.valueDeclaration?.resolve();\n } catch (e) {\n decl = undefined;\n }\n // the callee binds it as `any` or through GetArgStringSlice, never a []any twin\n const declared = String(decl?.parameters?.[argIndex]?.type?.getText() ?? '').replace(/\\s+/g, ' ');\n return (declared === 'Strings') || (declared === 'string[]');\n }\n\n // the Go type the printed default names, or undefined when it names none\n goGetArgTypeOfShape(shape: string): string | undefined {\n const shapes: [RegExp, string][] = [[/^map\\[string\\]any\\{/, 'map[string]any'], [/^\\[map\\[string\\]any\\]\\{/, '[]map[string]any'],\n [/^\\[\\]string\\{/, '[]string'], [/^\\[\\]any\\{/, '[]any'], [/^\"/, 'string'], [/^(?:true|false)$/, 'bool'], [/^(?:-?[0-9]|math\\.)/, 'int64']];\n return shapes.find(([re]) => re.test(shape))?.[1];\n }\n\n // Go type candidates for a nil-defaulted parameter, in try order: the annotation text\n // (`Int` vs `Num` exist only there), then goNativeParameterTypeCandidates.\n goGetArgDeclaredTypeCandidates(param): string[] {\n const out: string[] = [];\n const declared = (param?.type !== undefined) ? String(param.type.getText()).replace(/\\s+/g, ' ') : undefined;\n const alias: any = this.CCXT_GO_GETARG_DECLARED_TYPES ?? {};\n if ((declared !== undefined) && (alias[declared] !== undefined)) {\n out.push(alias[declared]);\n } else if ((declared !== undefined) && this.goGetArgPrimitiveType(declared) !== undefined) {\n out.push('*' + this.goGetArgPrimitiveType(declared));\n }\n for (const goType of this.goNativeParameterTypeCandidates(param)) {\n if (out.indexOf(goType) < 0) {\n out.push(goType);\n }\n }\n return out;\n }\n\n goGetArgPrimitiveType(declared: string): string | undefined {\n switch (declared) {\n case 'Int': case 'Integer': case 'int': return 'int64';\n case 'Num': case 'number': case 'Float': return 'float64';\n case 'Bool': case 'boolean': return 'bool';\n case 'Str': case 'string': case 'String': return 'string';\n }\n return undefined;\n }\n\n // the twin of a declared Go type (go/v4/exchange_helpers.go); undefined when the twin is\n // missing, in which case the parameter keeps the `any` box (an `any` return must never be\n // assigned to a typed local)\n goGetArgTwinName(goType: string): string | undefined {\n switch (goType) {\n case 'map[string]any': return 'GetArgMap';\n case '[]map[string]any': return 'GetArgMapSlice';\n case '[]string': return 'GetArgStringSlice';\n case '[]any': return 'GetArgAnySlice';\n case 'string': return 'GetArgString';\n case 'bool': return 'GetArgBool';\n case 'int64': return 'GetArgInt64';\n case 'float64': return 'GetArgFloat64';\n case '*string': return 'GetArgStringPtr';\n case '*int64': return 'GetArgInt64Ptr';\n case '*float64': return 'GetArgFloat64Ptr';\n case '*bool': return 'GetArgBoolPtr';\n }\n return undefined;\n }\n\n goGetArgIsValueType(goType: string): boolean {\n return (goType === 'string') || (goType === 'bool') || (goType === 'int64') || (goType === 'float64');\n }\n\n goGetArgLocalIsSafe(body, param, goType: string, nilable = false): boolean {\n const name = param.name.text;\n if (this.goGetArgTwinName(goType) === undefined) {\n return false; // no twin for this type: keep the `any` box\n }\n if (!this.goLocalIsSafeToType(body, param, name, goType)) {\n return false;\n }\n if (this.goGetArgIsValueType(goType)) {\n // `x == nil` does not compile for a Go string/bool/int64/float64: keep the box\n return this.goParameterKeepsNilCompareNative(body, param, goType);\n }\n return this.goGetArgConsumersAreSafe(body, param, goType, nilable);\n }\n\n // Every later use must read the typed local as it read the `any` box: pointers only reach\n // audited deref consumers (fail-closed); containers are the same map/list, and nil-sensitive\n // consumers are tabled as `container` (goGetArgPassesIntoContainerDefault covers call chains).\n goGetArgConsumersAreSafe(body, param, goType: string, nilable: boolean): boolean {\n return this.goGetArgUsesAreSafe(body, param, param.name.text, goType, nilable, new Set());\n }\n\n // `(x === undefined) ? d : x` / `x !== undefined ? x : d`: the arm holding `n` only runs when\n // the same name is not nil, so the copy never boxes a typed nil\n goGetArgArmIsNilGuarded(n: any, cond: any): boolean {\n let test: any = cond.condition;\n while (test?.kind === SyntaxKind.ParenthesizedExpression) {\n test = test.expression;\n }\n if ((test?.kind !== SyntaxKind.BinaryExpression)) {\n return false;\n }\n const isNil = (e: any) => (e?.kind === SyntaxKind.NullKeyword) || ((e?.kind === SyntaxKind.Identifier) && (e.text === 'undefined'));\n const sameName = (e: any) => (e?.kind === SyntaxKind.Identifier) && (e.text === n.text);\n if (!((sameName(test.left) && isNil(test.right)) || (sameName(test.right) && isNil(test.left)))) {\n return false;\n }\n const op = test.operatorToken?.kind;\n const eq = (op === SyntaxKind.EqualsEqualsEqualsToken) || (op === SyntaxKind.EqualsEqualsToken);\n const ne = (op === SyntaxKind.ExclamationEqualsEqualsToken) || (op === SyntaxKind.ExclamationEqualsToken);\n let arm: any = n;\n while (arm.parent !== cond) {\n arm = arm.parent;\n }\n return (eq && (arm === cond.whenFalse)) || (ne && (arm === cond.whenTrue));\n }\n\n // a native int64/float64 arithmetic result boxes the same number its Add/Subtract/... helper form\n // boxed, so it reads like that helper write rather than a value-family write\n goGetArgWriteIsNativeArithmetic(rhs: any): boolean {\n let e: any = rhs;\n while (e?.kind === SyntaxKind.ParenthesizedExpression) {\n e = e.expression;\n }\n const ops = [SyntaxKind.PlusToken, SyntaxKind.MinusToken, SyntaxKind.AsteriskToken, SyntaxKind.SlashToken, SyntaxKind.PercentToken];\n if ((e?.kind !== SyntaxKind.BinaryExpression) || !ops.includes(e.operatorToken?.kind)) {\n return false;\n }\n const goType = this.goNativeArithmeticType(e) ?? this.goConstantProductKind(e);\n return (goType === 'int64') || (goType === 'float64');\n }\n\n // the body-local `r` a copy `let r = x` / `r = x` lands in (the value, not the box, is copied)\n goGetArgCopyTarget(use: any, body: any): any {\n const parent: any = use.parent;\n let target: any;\n if ((parent?.kind === SyntaxKind.VariableDeclaration) && (parent.initializer === use)) {\n target = parent;\n } else if ((parent?.kind === SyntaxKind.BinaryExpression) && (parent.right === use)\n && (parent.operatorToken?.kind === SyntaxKind.EqualsToken) && (parent.left?.kind === SyntaxKind.Identifier)\n && (parent.parent?.kind === SyntaxKind.ExpressionStatement)) {\n try {\n target = this.getChecker().getSymbolAtLocation(parent.left)?.valueDeclaration?.resolve();\n } catch (e) {\n target = undefined;\n }\n }\n if ((target?.kind !== SyntaxKind.VariableDeclaration) || (target.name?.kind !== SyntaxKind.Identifier)) {\n return undefined;\n }\n let inBody = false;\n for (let p: any = target.parent; p !== undefined; p = p.parent) {\n inBody = inBody || (p === body);\n }\n // a value-typed write (`r = \"s\"`) may type the copy as the pointer's value family\n let valueWrite = false;\n const visit = (n: any): void => {\n if (valueWrite) {\n return;\n }\n if ((n.kind === SyntaxKind.BinaryExpression) && (n.operatorToken?.kind === SyntaxKind.EqualsToken)\n && (n.left?.kind === SyntaxKind.Identifier) && (n.left.text === target.name.text)) {\n valueWrite = this.goGetArgIsValueType(String(this.goTypeOfInitializer(n.right, this.printNode(n.right, 0))))\n && !this.goGetArgWriteIsNativeArithmetic(n.right);\n }\n n.forEachChild(visit);\n };\n body.forEachChild(visit);\n return (inBody && !valueWrite) ? target : undefined;\n }\n\n goGetArgUsesAreSafe(body, param, name: string, goType: string, nilable: boolean, seen: Set, boxed = false): boolean {\n seen.add(param);\n const table: any = this.CCXT_GO_GETARG_SAFE_CONSUMERS ?? {};\n const pointer = goType.startsWith('*');\n let safe = true;\n const verdictOf = (callee: string, argIndex: number): string => {\n // the table is keyed by the printed Go callee (`this.market` prints `this.Market`); a\n // pointer is unwrapped by derefScalar, a nil map is not, so only pointers fold the case\n const goName = callee.charAt(0).toUpperCase() + callee.slice(1);\n const entry = table[callee] ?? (pointer ? (table[goName] ?? table[goName + 'Async']) : undefined);\n if (entry === undefined) {\n // a nil-defaulted container may be handed back through `any` as a non-nil typed nil\n return (pointer || nilable) ? 'unknown' : 'deref';\n }\n if (typeof entry === 'string') {\n return entry;\n }\n return entry[String(argIndex)] ?? entry['*'] ?? (pointer ? 'unknown' : 'deref');\n };\n const visit = (n: any): void => {\n if (!safe) {\n return;\n }\n if ((n?.kind === SyntaxKind.Identifier) && (n.text === name)) {\n let symbol;\n try {\n symbol = this.getChecker().getSymbolAtLocation(n);\n } catch (e) {\n symbol = undefined;\n }\n if (symbol?.valueDeclaration?.resolve() === param) {\n const parent: any = n.parent;\n if (parent === param) {\n return; // the parameter's own name is not a use\n }\n if (nilable && (goType === 'map[string]any')) {\n // goLocalIsSafeToType already matched the type of an assigned value\n const assigned = (parent?.kind === SyntaxKind.BinaryExpression) && (parent.left === n)\n && (parent.operatorToken?.kind === SyntaxKind.EqualsToken);\n if (assigned || this.goGetArgNilMapUseOnlyReads(n)) {\n return;\n }\n }\n if (nilable && (goType === '[]string') && this.goGetArgNilStringSliceUseOnlyReads(n)) {\n return;\n }\n if (pointer && (parent?.kind === SyntaxKind.BinaryExpression)) {\n // a write already type-matched by goLocalIsSafeToType, or the key of `x in d` (InOp derefs it)\n const op = parent.operatorToken?.kind;\n if ((parent.left === n) && ((op === SyntaxKind.EqualsToken) || (op === SyntaxKind.InKeyword))) {\n return;\n }\n // `x === 'lit'`: a pointer operand prints nil-guarded native or through IsEqual (derefs)\n const other: any = (parent.left === n) ? parent.right : parent.left;\n const equality = [SyntaxKind.EqualsEqualsEqualsToken, SyntaxKind.ExclamationEqualsEqualsToken].includes(op);\n if (equality && ((other?.kind === SyntaxKind.StringLiteral) || (other?.kind === SyntaxKind.NumericLiteral))) {\n return;\n }\n }\n // a copy (ternary arm, `let r = x`, `r = x`) hands the value to a body local whose\n // own uses must pass the same rules; an `any` alias prints its nil tests via IsEqual,\n // which derefs a nil pointer but not a nil map, so containers need a nil-guarded arm\n let use: any = n;\n let guarded = false;\n while ((use.parent?.kind === SyntaxKind.ParenthesizedExpression)\n || ((use.parent?.kind === SyntaxKind.ConditionalExpression) && (use.parent.condition !== use))) {\n if (use.parent.kind === SyntaxKind.ConditionalExpression) {\n guarded = guarded || this.goGetArgArmIsNilGuarded(n, use.parent);\n }\n use = use.parent;\n }\n const target = (pointer || nilable) ? this.goGetArgCopyTarget(use, body) : undefined;\n if (target !== undefined) {\n if ((!pointer && guarded) || seen.has(target)) {\n return;\n }\n safe = this.goGetArgUsesAreSafe(body, target, target.name.text, goType, nilable, seen, true);\n return;\n }\n if ((use !== n) && (pointer || nilable)) {\n safe = pointer && this.goGetArgPointerStoredAsValue(use, param);\n return;\n }\n // a non-nil container arm hands the same map/list value on (as before copies were followed)\n if (parent?.kind === SyntaxKind.BinaryExpression) {\n const other: any = (parent.left === n) ? parent.right : parent.left;\n const isNullTest = (other?.kind === SyntaxKind.NullKeyword)\n || ((other?.kind === SyntaxKind.Identifier) && (other.text === 'undefined'));\n if (isNullTest) {\n // an `any` alias tests the box through IsEqual: a nil map box is not nil\n safe = pointer || !boxed;\n return;\n // `x == nil` / `x != nil`: native for a pointer and for a container\n // (a nil map compares equal to nil exactly like the untyped nil box\n // did when the value came in untyped); a value type never gets here.\n safe = true;\n return;\n }\n }\n if (parent?.kind === SyntaxKind.CallExpression) {\n const args: any[] = parent.arguments ?? [];\n const argIndex = args.indexOf(n);\n const callee: any = parent.expression;\n let calleeName = (callee?.name !== undefined) ? callee.name.text\n : ((callee?.text !== undefined) ? callee.text : undefined);\n // Math.min / Math.max print as the deref-aware mathMin / mathMax\n if ((callee?.expression?.text === 'Math') && ((calleeName === 'min') || (calleeName === 'max'))) {\n calleeName = 'math' + calleeName.charAt(0).toUpperCase() + calleeName.slice(1);\n }\n if (calleeName === undefined) {\n safe = !pointer && !nilable;\n return;\n }\n const verdict = verdictOf(calleeName, argIndex);\n if ((verdict === 'unsafe') || ((verdict === 'container') && nilable)) {\n safe = false;\n return;\n }\n if ((calleeName === 'IsEqual') && nilable) {\n // IsEqual(x, nil) tests the *box*: an untyped nil answered true, a nil\n // map is not equal to nil\n const other: any = (argIndex === 0) ? args[1] : args[0];\n const otherIsNil = (other === undefined) || (other?.kind === SyntaxKind.NullKeyword)\n || ((other?.kind === SyntaxKind.Identifier) && (other.text === 'undefined'));\n if (otherIsNil) {\n safe = false;\n return;\n }\n }\n // GetArg folds a nil map box to its default, and a defaulted position binds through GetArg or its\n // twins, which deref a pointer and fold a nil one: both read it as absent\n if (verdict === 'unknown') {\n safe = ((nilable && (goType === 'map[string]any')) || pointer) && this.goGetArgPositionIsDefaulted(callee, argIndex);\n return;\n }\n if (nilable && !pointer && this.goGetArgPassesIntoContainerDefault(callee, argIndex)) {\n safe = false;\n return;\n }\n safe = true;\n return;\n }\n if (parent?.kind === SyntaxKind.ExpressionStatement) {\n safe = true; // `_ = x` and other inert statements\n return;\n }\n if (pointer && this.goGetArgPointerStoredAsValue(n, param)) {\n safe = true;\n return;\n }\n if (pointer && this.goGetArgPointerInHelperArithmetic(n)) {\n safe = true;\n return;\n }\n // a bare read hands the local on as `any`: a pointer or a nil-defaulted container would\n // no longer compare equal to nil there, so both keep the box\n safe = !pointer && !nilable;\n return;\n }\n }\n n.forEachChild(visit);\n };\n body.forEachChild(visit);\n return safe;\n }\n\n // `x / 1000`, `x - 1`, `x > 0`: printed through Divide/Subtract/…/IsGreaterThan, which\n // derefScalar both operands at entry (checked on the printed text by the caller's diff)\n goGetArgPointerInHelperArithmetic(n: any): boolean {\n const parent: any = n.parent;\n if (parent?.kind !== SyntaxKind.BinaryExpression) {\n return false;\n }\n const ops = [SyntaxKind.SlashToken, SyntaxKind.MinusToken, SyntaxKind.AsteriskToken, SyntaxKind.PercentToken,\n SyntaxKind.GreaterThanToken, SyntaxKind.LessThanToken, SyntaxKind.GreaterThanEqualsToken, SyntaxKind.LessThanEqualsToken];\n if (!ops.includes(parent.operatorToken?.kind)) {\n return false;\n }\n const printed = this.printNode(parent, 0).trim();\n return /^(?:\\(\\s*)*(?:Divide|Subtract|Multiply|Mod|IsGreaterThan|IsLessThan|IsGreaterThanOrEqual|IsLessThanOrEqual)\\(/.test(printed);\n }\n\n // `request[k] = x` / `{ k: x }`: the pointer lands in an `any` dictionary whose readers\n // (GetValue, Urlencode, Json, IsEqual) derefScalar it; a `*Request` builder returns that\n // dictionary to its caller, so it keeps the box\n goGetArgPointerStoredAsValue(n: any, param: any): boolean {\n const parent: any = n.parent;\n const stored = ((parent?.kind === SyntaxKind.BinaryExpression) && (parent.right === n)\n && (parent.operatorToken?.kind === SyntaxKind.EqualsToken)\n && (parent.left?.kind === SyntaxKind.ElementAccessExpression))\n || ((parent?.kind === SyntaxKind.PropertyAssignment) && (parent.initializer === n));\n let method: any = param?.parent;\n while ((method !== undefined) && !isFunctionLike(method)) {\n method = method.parent;\n }\n const methodName = String(method?.name?.text ?? '');\n return stored && !methodName.endsWith('Request');\n }\n\n // element `index` of a tuple-typed call result is `Dict` (`[T, Dict]`); the Go tuple holds\n // that map, so MapTyped reads the same dictionary back\n goTupleElementIsDict(right: any, index: number): boolean {\n const checker: any = this.checkerOrUndefined();\n if ((checker === undefined) || (index < 0)) {\n return false;\n }\n const expr: any = (right?.kind === SyntaxKind.AwaitExpression) ? right.expression : right;\n if (expr?.kind !== SyntaxKind.CallExpression) {\n return false;\n }\n const type: any = checker.getTypeAtLocation(expr);\n if ((type === undefined) || !checker.isTupleType(type)) {\n return this.goParamsTupleHelperIndex(expr) === index;\n }\n const element: any = checker.getTypeArguments(type)?.[index];\n return (element !== undefined) && !(element.flags & (TypeFlags.Any | TypeFlags.Unknown))\n && this.goParameterTypeIsDict(element);\n }\n\n // `this.handleXxx(…, params, …)` of a base helper typed `any[]` whose element holds the params\n // map it was given after omit/extend; only when that element is the same map-typed local\n goParamsTupleHelperIndex(call: any): number {\n const callee: any = call?.expression;\n if ((callee?.kind !== SyntaxKind.PropertyAccessExpression) || (callee.expression?.kind !== SyntaxKind.ThisKeyword)) {\n return -1;\n }\n const index = GO_PARAMS_TUPLE_HELPERS[callee.name?.text];\n if (index === undefined) {\n return -1;\n }\n const target: any = call.parent?.left?.elements?.[index];\n const passesTarget = (target?.kind === SyntaxKind.Identifier)\n && (call.arguments ?? []).some((a: any) => (a.kind === SyntaxKind.Identifier) && (a.text === target.text));\n return passesTarget ? index : -1;\n }\n\n // the safety check of a map-typed GetArg local: a Dict tuple element written into it is printed\n // through MapTyped once the local is bound as a map (no recursion into goGetArgLocalType)\n goGetArgTupleWriteIsDict(declaration: any, right: any, index: number): boolean {\n return (declaration?.kind === SyntaxKind.Parameter) && (declaration.initializer !== undefined)\n && this.goTupleElementIsDict(right, index);\n }\n\n // `[x, params] = f()` writes a GetArg local bound as map[string]any: unbox the element\n goGetArgBindsDictElement(leftElement: any, right: any, index: number): boolean {\n if ((leftElement?.kind !== SyntaxKind.Identifier) || !this.goTupleElementIsDict(right, index)) {\n return false;\n }\n let decl: any;\n try {\n decl = this.checkerOrUndefined()?.getSymbolAtLocation(leftElement)?.valueDeclaration?.resolve();\n } catch (e) {\n decl = undefined;\n }\n if ((decl?.kind !== SyntaxKind.Parameter) || (decl.initializer === undefined) || (decl.parent?.body === undefined)) {\n return false;\n }\n return this.goGetArgParameterType(decl) === 'map[string]any';\n }\n\n // the Go type a defaulted parameter's GetArg twin binds (undefined: the `any` GetArg); the one\n // predicate shared by the binding line and every consumer's printing\n goGetArgParameterType(decl: any): string | undefined {\n if ((decl?.kind !== SyntaxKind.Parameter) || (decl.initializer === undefined) || (decl.dotDotDotToken !== undefined)\n || (decl.name?.kind !== SyntaxKind.Identifier) || (decl.parent?.body === undefined)\n || ![SyntaxKind.MethodDeclaration, SyntaxKind.FunctionDeclaration].includes(decl.parent.kind)) {\n return undefined;\n }\n this.goGetArgTypeCache ??= new WeakMap();\n if (!this.goGetArgTypeCache.has(decl)) {\n this.goGetArgTypeCache.set(decl, undefined);\n this.goGetArgTypeComputing ??= new Set();\n this.goGetArgTypeComputing.add(decl);\n let goType: string | undefined;\n try {\n goType = this.goGetArgLocalType(decl.parent.body, decl, this.printNode(decl.initializer, 0));\n } finally {\n this.goGetArgTypeComputing.delete(decl);\n }\n this.goGetArgTypeCache.set(decl, (goType !== undefined) && (this.goGetArgTwinName(goType) !== undefined) ? goType : undefined);\n }\n return this.goGetArgTypeCache.get(decl);\n }\n\n // argument `argIndex` of the callee binds a parameter with a TypeScript default (GetArg-bound)\n goGetArgPositionIsDefaulted(callee: any, argIndex: number): boolean {\n if (argIndex < 0) {\n return false;\n }\n let decl: any;\n try {\n decl = this.getChecker().getSymbolAtLocation(callee)?.valueDeclaration?.resolve();\n } catch (e) {\n decl = undefined;\n }\n const kinds = [SyntaxKind.MethodDeclaration, SyntaxKind.FunctionDeclaration];\n const param: any = (decl !== undefined) && kinds.includes(decl.kind) ? decl.parameters?.[argIndex] : undefined;\n return (param?.initializer !== undefined) && (param.dotDotDotToken === undefined);\n }\n\n // the callee's own GetArg with a container default returns def for an untyped nil box but the\n // nil map for a nil map box (nil slices collapse to def), so only map shapes differ\n goGetArgPassesIntoContainerDefault(callee: any, argIndex: number): boolean {\n if (argIndex < 0) {\n return false;\n }\n let symbol;\n try {\n symbol = this.getChecker().getSymbolAtLocation(callee);\n } catch (e) {\n symbol = undefined;\n }\n const decl: any = symbol?.valueDeclaration?.resolve();\n const params: any[] = decl?.parameters ?? [];\n const param: any = params[argIndex];\n const initializer: any = param?.initializer;\n if (initializer === undefined) {\n return false;\n }\n return initializer.kind === SyntaxKind.ObjectLiteralExpression;\n }\n\n printFunctionBody(node, identation, wrapInChannel = false) {\n\n // check if there is any default parameter to initialize\n let functionBody: string;\n const funcParams = node.parameters;\n const initParams = [];\n if (funcParams.length > 0) {\n const body = node.body.statements;\n const first = body.length > 0 ? body[0] : [];\n const remaining = body.length > 0 ? body.slice(1): [];\n let firstStatement = this.printNode(first, identation + 1);\n\n const remainingString = remaining.map((statement) => this.printNode(statement, identation + 1)).join(\"\\n\");\n let offSetIndex = 0;\n funcParams.forEach((param, i) => {\n const initializer = param.initializer;\n if (initializer) {\n const index = i + offSetIndex;\n // index = index < 0 ? 0 : i - 1;\n const paramName = this.printNode(param.name, 0);\n const printedDefault = this.printNode(initializer, 0);\n // a default that names a Go type exactly binds through its typed twin; others keep GetArg (ABI unchanged)\n const goType = this.goGetArgParameterType(param);\n const twinName = (goType !== undefined) ? this.goGetArgTwinName(goType) : undefined;\n if ((goType !== undefined) && (twinName !== undefined)) {\n initParams.push(`var ${paramName} ${goType} = ${twinName}(optionalArgs, ${index}, ${printedDefault})`);\n } else {\n initParams.push(`${paramName} := GetArg(optionalArgs, ${index}, ${printedDefault})`);\n }\n initParams.push(`_ = ${paramName}`);\n } else {\n offSetIndex--;\n }\n });\n\n if (initParams.length > 0) {\n const defaultInitializers = initParams.map( l => this.getIden(identation+1) + l ).join(\"\\n\") + \"\\n\";\n const bodyParts = firstStatement.split(\"\\n\");\n const commentPart = bodyParts.filter(line => this.isComment(line));\n const isComment = commentPart.length > 0;\n if (isComment) {\n // the statement's leading comment must keep the ' * ' continuation-alignment\n // of printLeadingComments: gofmt re-indents a /* */ block to\n // ` * text` (printer.stripCommonPrefix + the tab indent), so a bare\n // trim() here would emit `* text` under the '/**'.\n const commentPartString = commentPart.map((c) => {\n const line = c.trim();\n return this.getIden(identation+1) + (line.startsWith(\"*\") ? \" \" + line : line);\n }).join(\"\\n\");\n const firstStmNoComment = bodyParts.filter(line => !this.isComment(line)).join(\"\\n\");\n firstStatement = commentPartString + \"\\n\" + defaultInitializers + firstStmNoComment;\n } else {\n firstStatement = defaultInitializers + firstStatement;\n }\n }\n const blockOpen = this.getBlockOpen(identation);\n const blockClose = this.getBlockClose(identation);\n firstStatement = remainingString.length > 0 ? firstStatement + \"\\n\" : firstStatement;\n if (!wrapInChannel) {\n functionBody = blockOpen + firstStatement + remainingString + blockClose;\n } else {\n functionBody = firstStatement + remainingString;\n }\n } else {\n if (!wrapInChannel) {\n functionBody = super.printFunctionBody(node, identation);\n } else {\n functionBody = node.body.statements.map(statement => this.printNode(statement, identation + 1)).join(\"\\n\");\n }\n }\n if (wrapInChannel) {\n // return statement might be inside ifs or other complex statements so we still have to replace them manually :(\n // functionBody = functionBody.replace(/(\\s*)return\\s+([^\\n]+\\n?)/g, '$1ch <- $2$1');\n // the body half of the trampoline pair is a flat function body: the statements\n // are already printed at their own level, so no extra indentation level is added here\n const lastLine = functionBody.split(\"\\n\").pop().trim();\n // no trailing return after a return/panic or a conditional that returns in all branches\n const shouldAddLastReturn = !lastLine.startsWith(\"return\") && !lastLine.startsWith(\"panic\")\n && !(node.body && this.blockEndsWithConditionalReturn(node.body.statements));\n\n // This is the *body* half of the trampoline pair (see printAsyncTrampolineBlock):\n //\n // func (this *Exchange) fetchTickerBody(ch chan any, symbol any) any {\n // defer close(ch)\n // defer ReturnPanicError(ch)\n // ch <- ...\n // return nil\n // }\n //\n // It is a plain flat function: the trampoline already `go`es it, so there is no\n // `go func() any {...}()` envelope here, and no channel allocation either — the\n // trampoline owns `ch` and hands it in. The recover lives HERE, on the goroutine\n // that can actually panic, which is why the trampoline's result can stay unnamed.\n const lines = [\n \"{\",\n `${this.getIden(identation + 1)}defer close(ch)`,\n `${this.getIden(identation + 1)}defer ReturnPanicError(ch)`,\n functionBody,\n ];\n if (shouldAddLastReturn) {\n lines.push(this.getIden(identation+1) + \"return nil\");\n }\n lines.push(`${this.getIden(identation)}}`);\n functionBody = lines.join(\"\\n\");\n\n // to do fix this later\n // we can't pass nil to the channel when we just want to\n // return from the try catch, otherwise the channel will close with nil\n // instead of the proper result\n functionBody = functionBody.replaceAll(/(^\\s*)ch\\s<-\\snil\\s+return\\snil(\\s*\\})/gm, \"$1return nil$2\");\n\n }\n\n return functionBody;\n }\n\n printAwaitExpression(node, identation) {\n const expression = this.printNode(node.expression, identation);\n if (expression.startsWith(\"<-\")) {\n return expression;\n }\n return `(<-${expression})`;\n }\n\n printInstanceOfExpression(node: BinaryExpression, identation: number): string {\n const left = this.printNode (node.left);\n const right = this.printNode (node.right);\n return this.getIden(identation) + `IsInstance(${left}, ${right})`;\n }\n\n getLineBasedSuffix(node): string {\n const { line, character } = this.getSrc().getLineAndCharacterOfPosition(node.getStart());\n return `${line}${character}`;\n }\n\n printExpressionStatement(node, identation) {\n\n if (node?.expression?.kind === SyntaxKind.AsExpression) {\n node = node.expression;\n }\n if (node.expression.kind !== SyntaxKind.AwaitExpression) {\n return this.stripWhitespaceOnlyLines (super.printExpressionStatement(node, identation));\n }\n\n const exprStm = this.printNode(node.expression, identation);\n\n // const { line, character } = this.getSrc().getLineAndCharacterOfPosition(node.getStart());\n // console.log(`line: ${line}, character: ${character}`);\n const returnRandName = \"retRes\" + this.getLineBasedSuffix(node);\n\n // const expStatement =this.getIden(identation) + exprStm + this.LINE_TERMINATOR;\n\n // the awaited call's value is discarded here (`await this.loadMarkets();`), so the\n // extension may still name it: `var retResNNN T = MapTyped(PanicOnError(<-...))`\n const stmtUnbox = this.goAwaitReceiveUnbox(node.expression, exprStm);\n const expStatement = (stmtUnbox !== undefined)\n ? `\n${this.getIden(identation)}var ${returnRandName} ${stmtUnbox.goType} = ${stmtUnbox.wrap(exprStm)}`\n // the discarded value needs no local: PanicOnError still surfaces the channel's error\n : `\n${this.getIden(identation)}PanicOnError(${exprStm.trim()})`;\n return this.printNodeCommentsIfAny(node, identation, expStatement);\n }\n\n isInsideAsyncFunction(returnStatementNode) {\n let currentNode = returnStatementNode;\n\n while (currentNode) {\n // Check if the current node is a function or method\n if (isFunctionDeclaration(currentNode) ||\n isFunctionExpression(currentNode) ||\n isArrowFunction(currentNode) ||\n isMethodDeclaration(currentNode)) {\n return this.isAsyncFunction(currentNode);\n }\n // Move up the tree to the parent node\n currentNode = currentNode.parent;\n }\n\n // Return false if no async function or method is found\n return false;\n }\n\n /**\n * Statement that terminates an async (channel returning) function body.\n *\n * The body is the trampoline's sibling method (`go this.fetchTickerBody(ch, ...)`),\n * and the synthetic try/catch closures nest inside it: in both cases `return` leaves\n * a function whose result is a plain `any`, never the channel. The trampoline itself\n * owns the single `return ch`, emitted by printFunctionBody.\n */\n getAsyncReturnStatement(node): string {\n return \"return nil\";\n }\n\n printReturnStatement(node, identation) {\n\n const isAsyncFunction = this.isInsideAsyncFunction(node);\n // if (node?.expression?.kind !== SyntaxKind.AwaitExpression) {\n // return super.printReturnStatement(node, identation);\n // }\n if (!isAsyncFunction) {\n return super.printReturnStatement(node, identation);\n }\n\n const leadingComment = this.printLeadingComments(node, identation);\n let trailingComment = this.printTraillingComment(node, identation);\n trailingComment = trailingComment ? \" \" + trailingComment : trailingComment;\n const exp = node.expression;\n let rightPart = exp ? (' ' + this.printNode(exp, identation)) : '';\n rightPart = rightPart.trim();\n\n // `return nil` only exits the synthetic try/catch closure; at the function's own\n // level the async core has to hand the (named) result channel back instead.\n const returnStatement = this.getAsyncReturnStatement(node);\n\n if (node?.expression?.kind === SyntaxKind.AsExpression) {\n node = node.expression;\n }\n\n if (node?.expression?.kind === SyntaxKind.AwaitExpression) {\n const returnRandName = \"retRes\" + this.getLineBasedSuffix(node.expression);\n // the template's `:= ` already supplies the separator; keep the printed expression\n // flush so the receive reads `retResNNN := (<-this.X())` (gofmt spacing)\n const printedExpr = rightPart;\n rightPart = rightPart ? rightPart + this.LINE_TERMINATOR : this.LINE_TERMINATOR;\n // return leadingComment + this.getIden(identation) + this.RETURN_TOKEN + rightPart + trailingComment;\n // printLeadingComments returns the comment lines with their own indentation and a\n // trailing newline, so the comment is emitted as its own line(s) and the `ch <-`\n // line carries the indentation the comment would otherwise have swallowed.\n const retUnbox = this.goAwaitReceiveUnbox(node.expression, printedExpr);\n if (retUnbox !== undefined) {\n return `\n${this.getIden(identation)}var ${returnRandName} ${retUnbox.goType} = ${retUnbox.wrap(printedExpr)}\n${leadingComment}${this.getIden(identation)}ch <- ${returnRandName}${trailingComment}\n${this.getIden(identation)}${returnStatement}`;\n }\n return `\n${this.getIden(identation)}${returnRandName} := ${rightPart}\n${this.getIden(identation)}PanicOnError(${returnRandName})\n${leadingComment}${this.getIden(identation)}ch <- ${returnRandName}${trailingComment}\n${this.getIden(identation)}${returnStatement}`;\n // ${this.getIden(identation)}return ${returnRandName}`;\n }\n\n if (rightPart.length === 0) {\n return `\\n${this.getIden(identation)}${returnStatement}`;\n }\n\n return `\n${leadingComment}${this.getIden(identation)}ch <- ${rightPart}${trailingComment}\n${this.getIden(identation)}${returnStatement}`;\n // ${this.getIden(identation)}return ${rightPart}`;\n // ${this.getIden(identation)}return ${rightPart}`;\n }\n\n\n printArrayLiteralExpression(node, identation = 0) {\n // elements that span lines (object literals, calls carrying one) need the\n // statement's own level so their bodies land one level deeper\n // …but an element is inline after `{`, so any leading indent a printer prepends is trimmed\n // go/printer prints composite literal elements at depth 1 (exprList(..., 1, ...))\n const elements = node.elements.map((e) => this.goWithExprDepth(1, () => this.printNode(e, identation)).trim()).join(\", \");\n // a list of calls (promises included) always opens as `[]any{`; getFunctionType is kept for its\n // checker side effect (it caches a signature on the call node)\n const first = node.elements[0];\n const arrayOpen = (first?.kind === SyntaxKind.CallExpression) && (this.getFunctionType(first) || true)\n ? '[]any{' : this.ARRAY_OPENING_TOKEN;\n return arrayOpen + elements + this.ARRAY_CLOSING_TOKEN;\n }\n\n printArgsForCallExpression(node, identation) {\n const unified = this.goUnifiedStringCallArgs(node, identation);\n if (unified !== undefined) {\n return unified;\n }\n // go/printer prints the arguments of a call with more than one argument\n // one level deeper than the call itself (nodes.go, CallExpr)\n if (node.arguments && node.arguments.length > 1) {\n return this.goWithExprDepth(this.goExprDepth + 1, () => super.printArgsForCallExpression(node, identation));\n }\n return super.printArgsForCallExpression(node, identation);\n }\n\n // check this out later\n\n // IsArray(v) answers true exactly for the slice types its runtime type switch lists\n // and false for every other box, a nil box included. On an operand whose Go type the\n // printer can name the predicate is that constant.\n isArraySliceTypes = [ '[]any', '[][]any', '[]map[string]any', '[]string', '[]bool',\n '[]int', '[]int8', '[]int16', '[]int32', '[]int64', '[]float32', '[]float64',\n '[]uint', '[]uint8', '[]uint16', '[]uint32', '[]uint64' ];\n\n // the other Go types the printer can name: a map, a string, a bool, a number, or a\n // pointer to a scalar — none of them is a slice the switch matches\n isArrayNonSliceTypes = [ 'map[string]any', 'string', 'bool', 'int', 'int64', 'float64',\n '*string', '*int64', '*float64', '*bool', '*int' ];\n\n // true when the identifier keeps a reference besides this one: the constant fold\n // drops the call's reference to the operand, and Go rejects a local that ends up\n // unused, so an operand without another use keeps the helper\n goIdentifierUsedElsewhere(nameNode): boolean {\n const scope = this.goEnclosingFunction(nameNode);\n if (scope === undefined) {\n return false;\n }\n const name = nameNode.text;\n let used = false;\n const visit = (n) => {\n if (used) {\n return;\n }\n if ((n.kind === SyntaxKind.Identifier) && (n.text === name) && (n !== nameNode)) {\n const parent = n.parent;\n const isDeclarationName = (parent?.kind === SyntaxKind.VariableDeclaration) && (parent.name === n);\n const isPropertyName = (parent?.kind === SyntaxKind.PropertyAccessExpression) && (parent.name === n);\n if (!isDeclarationName && !isPropertyName) {\n used = true;\n return;\n }\n }\n n.forEachChild(visit);\n };\n scope.forEachChild(visit);\n return used;\n }\n\n // the local is printed `any` yet every value that reaches it is a []any: it starts\n // from a slice initializer and no later statement rebinds it (a push only appends\n // to the same slice), so the box holds a []any at every use\n goLocalHoldsOnlyArrays(nameNode): boolean {\n const checker: any = this.checkerOrUndefined();\n if (checker === undefined) {\n return false;\n }\n const symbol = checker.getSymbolAtLocation(nameNode);\n const declaration: any = symbol?.valueDeclaration?.resolve();\n if ((declaration?.kind !== SyntaxKind.VariableDeclaration) || (declaration.initializer === undefined)) {\n return false;\n }\n if (this.goTypeOfInitializer(declaration.initializer, this.printNode(declaration.initializer, 0)) !== '[]any') {\n return false;\n }\n const scope = this.goEnclosingFunction(declaration);\n if (scope === undefined) {\n return false;\n }\n const name = declaration.name.text;\n let safe = true;\n const visit = (n) => {\n if (!safe) {\n return;\n }\n if ((n.kind === SyntaxKind.Identifier) && (n.text === name) && (n !== declaration.name) && (n !== nameNode)) {\n const parent = n.parent;\n if (parent?.kind === SyntaxKind.VariableDeclaration && parent.name === n) {\n return; // a sibling block-scoped declaration; it gets its own type\n }\n if (this.goRebindingTargetOf(n) !== undefined) {\n safe = false; // a rebinding write can box another type\n return;\n }\n }\n n.forEachChild(visit);\n };\n scope.forEachChild(visit);\n return safe;\n }\n\n // native IsArray: a constant for an operand whose Go type the printer proves, and\n // the two-value assertion on an `any` box that only ever holds a []any\n printNativeIsArray(node, parsedArg: string | undefined): string | undefined {\n if ((typeof parsedArg !== 'string') || parsedArg.includes('\\n')) {\n return undefined;\n }\n const argNode = node.arguments?.[0];\n if (argNode?.kind !== SyntaxKind.Identifier) {\n return undefined; // a call operand may have effects and has no declared type\n }\n const goType = this.goPrintedTypeOfExpression(argNode, parsedArg);\n if (goType !== undefined) {\n const isSlice = this.isArraySliceTypes.indexOf(goType) >= 0;\n if (isSlice || (this.isArrayNonSliceTypes.indexOf(goType) >= 0)) {\n return this.goIdentifierUsedElsewhere(argNode) ? (isSlice ? 'true' : 'false') : undefined;\n }\n return undefined;\n }\n if (!this.goLocalHoldsOnlyArrays(argNode)) {\n return undefined;\n }\n // the box only ever holds a []any, so the assertion answers what the type switch\n // would and keeps the operand referenced\n const read = `_, ok := ${parsedArg}.([]any)`;\n if (11 + read.length + 2 + 'return ok'.length <= 100) {\n return `func() bool { ${read}; return ok }()`;\n }\n const level = this.goStatementLevel;\n return `func() bool {\\n${this.getIden(level + 1)}${read}\\n${this.getIden(level + 1)}return ok\\n${this.getIden(level)}}()`;\n }\n\n printArrayIsArrayCall(node, identation, parsedArg = undefined) {\n return this.printNativeIsArray(node, parsedArg) ?? `IsArray(${parsedArg})`;\n }\n\n printObjectKeysCall(node, identation, parsedArg = undefined) {\n return `ObjectKeys(${parsedArg})`;\n }\n\n printObjectValuesCall(node, identation, parsedArg = undefined) {\n return `ObjectValues(${parsedArg})`;\n }\n\n printJsonParseCall(node, identation, parsedArg = undefined) {\n return `JsonParse(${parsedArg})`;\n }\n\n printJsonStringifyCall(node, identation, parsedArg = undefined) {\n return `JsonStringify(${parsedArg})`; // make this customizable\n }\n\n printPromiseAllCall(node, identation, parsedArg = undefined) {\n return `promiseAll(${parsedArg})`;\n }\n\n printMathFloorCall(node, identation, parsedArg = undefined) {\n return `MathFloor(${parsedArg})`;\n }\n\n printMathRoundCall(node, identation, parsedArg = undefined) {\n return `MathRound(${parsedArg})`;\n }\n\n printMathCeilCall(node, identation, parsedArg = undefined) {\n return `MathCeil(${parsedArg})`;\n }\n\n printNumberIsIntegerCall(node: any, identation: any, parsedArg?: any) {\n return `IsInt(${parsedArg})`;\n }\n\n // the base printer prints a method-call argument at the statement's depth; the\n // emitted Go call has two or more arguments, which go/printer lays out one level\n // deeper (a native `a + b` argument then drops its blanks)\n goPrintCallArgument(argument, printedText: string | undefined): string | undefined {\n if (argument?.kind !== SyntaxKind.BinaryExpression || printedText === undefined) {\n return printedText;\n }\n return this.goWithExprDepth(this.goExprDepth + 1, () => this.printNode(argument, 0)).trimStart();\n }\n\n printArrayPushCall(node: CallExpression, identation: number, name: string | undefined = undefined, parsedArg: string | undefined = undefined) {\n let returnValue = '';\n let returnRandName = name;\n parsedArg = this.goPrintCallArgument(node.arguments?.[0], parsedArg);\n // a `[]any` local is the slice itself, so it appends natively\n const nativeReceiver = this.goNativeAppendReceiver(node);\n if (nativeReceiver !== undefined) {\n return `${nativeReceiver} = append(${nativeReceiver}, ${parsedArg})`;\n }\n // a map/slice index or a GetValue box is not addressable: copy it into a local first\n if (name?.startsWith('GetValue') || /[\\])]$/.test(name ?? '')) {\n returnRandName = \"retRes\" + this.getLineBasedSuffix(node);\n returnValue = `${returnRandName} := ${name}\\n${this.getIden(identation)}`;\n }\n return `${returnValue}AppendToArray(&${returnRandName}, ${parsedArg})`;\n // works with:\n // func AppendToArray(slicePtr *any, element any)\n // func AppendToArrayValue(slice any, element any) any\n // func AppendToArraySafe(slice any, element any) any\n }\n\n printIncludesCall(node, identation, name = undefined, parsedArg = undefined) {\n return `Contains(${name}, ${parsedArg})`;\n }\n\n // the Go type an `indexOf` operand is printed as, or undefined for anything Go cannot\n // hand to strings.Index: an `any` box (a parameter, a GetValue/Ternary result), a\n // number, a slice. The receiver and the needle both have to be Go strings\n goIndexOfOperandType(node, printedText: string): string | undefined {\n if (this.goIsAnyBoxExpression(node, printedText)) {\n return undefined;\n }\n if (node?.kind === SyntaxKind.Identifier) {\n return this.goDeclaredTypeOfIdentifier(node);\n }\n if (GO_ANY_BOX_CALLS.indexOf(this.goPrintedCallee(printedText)) >= 0) {\n return undefined;\n }\n return this.goStringCallStaticType(node, printedText) ?? this.goStringFieldStaticType(node, printedText);\n }\n\n // The ccxt writers assemble four outputs from a *slice* of the printer output (base-class files\n // after their TRANSPILED marker, ws cache tests after their first separator), which would cut off\n // the leading file-level import; they keep the helper until their writer adds the import itself.\n goFileKeepsFileLevelImports(): boolean {\n const fileName = this.getSrc()?.fileName ?? '';\n return !/(?:base\\/Exchange(?:\\.nooverloads\\.\\d+)?|base\\/PredictionExchange|base\\/test\\.orderBook|base\\/test\\.cache)\\.ts$/.test(fileName);\n }\n\n // `GetIndexOf(s, t)` is `strings.Index(s, t)` for a receiver declared `string` once `t` is a\n // string too (`target.(string)` succeeds; -1 is both not-found answers); a `*string` receiver\n // answers -1 when nil, reproduced by the nil guard. Slices and `any` boxes keep the helper.\n goNativeIndexOf(node, name, parsedArg): string | undefined {\n if ((typeof name !== 'string') || (typeof parsedArg !== 'string')) {\n return undefined;\n }\n if (name.includes('\\n') || parsedArg.includes('\\n')) {\n return undefined;\n }\n if (!this.goFileKeepsFileLevelImports()) {\n return undefined;\n }\n const receiver = this.goUnwrapPrintedAssertions(node?.expression?.expression);\n const target = this.goUnwrapPrintedAssertions(node?.arguments?.[0]);\n if (this.goIndexOfOperandType(target, parsedArg) !== 'string') {\n return undefined; // a nilable/number needle answers -1 in the helper\n }\n const receiverType = this.goIndexOfOperandType(receiver, name);\n if (receiverType === 'string') {\n this.goFileStdlibImports.add('strings');\n return `strings.Index(${name}, ${parsedArg})`;\n }\n // the literal repeats the identifier, so the receiver is still read exactly once\n if ((receiverType === '*string') && (receiver?.kind === SyntaxKind.Identifier)) {\n this.goFileStdlibImports.add('strings');\n const level = this.goStatementLevel;\n const body = this.getIden(level + 1);\n const inner = this.getIden(level + 2);\n return `func() int {\\n${body}if ${name} == nil {\\n${inner}return -1\\n${body}}\\n${body}return strings.Index(*${name}, ${parsedArg})\\n${this.getIden(level)}}()`;\n }\n return undefined;\n }\n\n printIndexOfCall(node, identation, name = undefined, parsedArg = undefined) {\n const native = this.goHx4G06DerefIndexOf(node, name, parsedArg) ?? this.goNativeIndexOf(node, name, parsedArg);\n if (native !== undefined) {\n return native;\n }\n return `${this.INDEXOF_WRAPPER_OPEN}${name}, ${parsedArg}${this.INDEXOF_WRAPPER_CLOSE}`;\n }\n\n // A native string operation needs every operand to be a Go `string`: a proven one prints as is,\n // a `*string` goDerefableStringOperand proves non-nil prints as its pointee (the helper's nil\n // branch is unreachable). A regex literal is a pattern, never a string: undefined keeps the helper.\n goNativeStringOperandTexts(operands: any[], texts: string[], expected: string[]): string[] | undefined {\n const result: string[] = [];\n for (let i = 0; i < expected.length; i++) {\n const operand = operands[i];\n if (operand === undefined || operand.kind === SyntaxKind.RegularExpressionLiteral) {\n return undefined;\n }\n if (this.goOperandStaticType(operand, texts[i]) === expected[i]) {\n result.push(texts[i]);\n } else if ((expected[i] === 'string') && !texts[i].includes('\\n') && (this.goDerefableStringOperand(operand) || this.goLiteralUnionNarrowedStringDeref(operand))) {\n result.push('*' + texts[i].trim());\n } else {\n return undefined;\n }\n }\n return result;\n }\n\n // `(x as T)` and `(x)` print as `x`, so the operand's own Go type governs the printed receiver\n goUnwrapPrintedAssertions(node) {\n while ((node?.kind === SyntaxKind.AsExpression) || (node?.kind === SyntaxKind.ParenthesizedExpression)) {\n node = node.expression;\n }\n return node;\n }\n\n // the native string call (built from the proven operand texts, `*`-dereferenced where needed) when\n // every operand matches `expected` and the file's stdlib import can be placed (see\n // goStdlibImportIsPlaceable), else the helper call; an unprinted argument keeps the helper\n goNativeStringCallOr(node, texts: string[], expected: string[], nativeCall: (ops: string[]) => string, helperCall: string, unwrapReceiver = false): string {\n const receiver = unwrapReceiver ? this.goUnwrapPrintedAssertions(node.expression?.expression) : node.expression?.expression;\n const operands = [receiver, ...expected.slice(1).map((_, i) => node.arguments?.[i])];\n const ops = texts.slice(1).includes(undefined) ? undefined : this.goNativeStringOperandTexts(operands, texts, expected);\n if ((ops !== undefined) && this.goStdlibImportIsPlaceable()) {\n this.goFileStdlibImports.add('strings');\n return nativeCall(ops);\n }\n return helperCall;\n }\n\n // The native string calls need `import \"strings\"` before the file's first declaration. Every ccxt\n // consumer splices the body at file head, except build/goTranspiler.ts#transpileBaseMethods and\n // #transpilePredictionBaseMethods; those keep the helper until getGoImports(file) declares it.\n goStdlibImportIsPlaceable(): boolean {\n return this.goFileKeepsFileLevelImports();\n }\n\n printStartsWithCall(node, identation, name = undefined, parsedArg = undefined) {\n // `s.startsWith (p)` -> strings.HasPrefix\n return this.goNativeStringCallOr(node, [name, parsedArg], ['string', 'string'],\n (o) => `strings.HasPrefix(${o[0]}, ${o[1]})`, `StartsWith(${name}, ${parsedArg})`);\n }\n\n printEndsWithCall(node, identation, name = undefined, parsedArg = undefined) {\n // `s.endsWith (p)` -> strings.HasSuffix\n return this.goNativeStringCallOr(node, [name, parsedArg], ['string', 'string'],\n (o) => `strings.HasSuffix(${o[0]}, ${o[1]})`, `EndsWith(${name}, ${parsedArg})`);\n }\n\n printTrimCall(node, identation, name = undefined) {\n return `Trim(${name})`;\n }\n\n printJoinCall(node, identation, name = undefined, parsedArg = undefined) {\n // `a.join (sep)` -> strings.Join: only a declared `[]string` receiver can skip the\n // per-element ToString the helper applies to a []any\n return this.goNativeStringCallOr(node, [name, parsedArg], ['[]string', 'string'],\n (o) => `strings.Join(${o[0]}, ${o[1]})`, `Join(${name}, ${parsedArg})`);\n }\n\n printSplitCall(node, identation, name = undefined, parsedArg = undefined) {\n // `s.split (sep)` -> strings.Split, which keeps JS's empty trailing element\n // (\"a,\" -> [\"a\", \"\"]) exactly like the helper's own strings.Split call\n return this.goNativeStringCallOr(node, [name, parsedArg], ['string', 'string'],\n (o) => `strings.Split(${o[0]}, ${o[1]})`, `Split(${name}, ${parsedArg})`);\n }\n\n printToFixedCall(node, identation, name = undefined, parsedArg = undefined) {\n return `toFixed(${name}, ${parsedArg})`;\n }\n\n // ToString is the identity on a Go string (exchange_helpers.go: derefScalar and `case string`\n // return it unchanged), so a receiver declared `string` prints as itself. An `any` box, a\n // *string (derefScalar answers nil) or a float64 keeps the helper's runtime formatting.\n printToStringCall(node, identation, name = undefined) {\n if ((name !== undefined) && (name.indexOf('\\n') < 0)) {\n const receiver = (node?.expression?.kind === SyntaxKind.PropertyAccessExpression)\n ? node.expression.expression\n : undefined;\n if ((receiver !== undefined) && (this.goOperandStaticType(receiver, name) === 'string')) {\n return name;\n }\n // a non-nil `*string`: derefScalar hands ToString the pointee, returned unchanged\n if ((receiver !== undefined) && (this.goDerefableStringOperand(receiver) || this.goLiteralUnionNarrowedStringDeref(receiver))) {\n return '*' + name.trim();\n }\n // an int64 prints its decimal digits in both: the helper's Sprintf(\"%d\") and FormatInt\n if ((receiver !== undefined) && (this.goOperandStaticType(receiver, name) === 'int64') && this.goStdlibImportIsPlaceable()) {\n this.goFileStdlibImports.add('strconv');\n return `strconv.FormatInt(${name}, 10)`;\n }\n }\n return `ToString(${name})`;\n }\n\n printConcatCall(node, identation, name = undefined, parsedArg = undefined) {\n return `Concat(${name}, ${parsedArg})`;\n }\n\n printToUpperCaseCall(node, identation, name = undefined) {\n // `s.toUpperCase ()` -> strings.ToUpper\n return this.goNativeStringCallOr(node, [name], ['string'], (o) => `strings.ToUpper(${o[0]})`, `ToUpper(${name})`, true);\n }\n\n printToLowerCaseCall(node, identation, name = undefined) {\n // `s.toLowerCase ()` -> strings.ToLower\n return this.goNativeStringCallOr(node, [name], ['string'], (o) => `strings.ToLower(${o[0]})`, `ToLower(${name})`, true);\n }\n\n printShiftCall(node, identation, name = undefined) {\n return `Shift(${name})`;\n }\n\n printReverseCall(node, identation, name = undefined) {\n return `Reverse(${name})`;\n }\n\n printPopCall(node, identation, name = undefined) {\n return `Pop(${name}))`;\n }\n\n printAssertCall(node, identation, parsedArgs) {\n return `assert(${parsedArgs})`;\n }\n\n // `x.slice(a)` / `x.slice(a, b)` prints `Slice(x, a, b)`, a JS slice on a string: a\n // negative bound counts from the end, a start-only call clamps its start to 0 and an\n // end past len is clamped to len, where Go's native slicing panics\n goSliceLiteralBound(node): number | undefined {\n if (node?.kind === SyntaxKind.NumericLiteral) {\n const text = node.text;\n if (!/^\\d+$/.test(text)) {\n return undefined;\n }\n const value = Number(text);\n return (value > 2147483647) ? undefined : value;\n }\n if ((node?.kind === SyntaxKind.PrefixUnaryExpression) && (node.operator === SyntaxKind.MinusToken)) {\n const operand = this.goSliceLiteralBound(node.operand);\n return (operand === undefined) ? undefined : -operand;\n }\n return undefined;\n }\n\n // the subscript for a string value, with the helper's own index arithmetic\n goSliceSubscript(value: string, start: number, hasEnd: boolean, end: number | undefined): string {\n const length = `len(${value})`;\n let startText;\n if (start >= 0) {\n startText = `${start}`;\n } else if (hasEnd) {\n startText = `${length} - ${-start}`;\n } else {\n startText = `max(${length} - ${-start}, 0)`;\n }\n if (!hasEnd) {\n return `${value}[${startText}:]`;\n }\n const endText = (end >= 0) ? `min(${end}, ${length})` : `${length} - ${-end}`;\n return `${value}[${startText}:${endText}]`;\n }\n\n // receiver of an inlinable `.slice(...)`: `string` prints a plain subscript and\n // `*string` a nil-guarded one, while anything else (an `any` box) keeps the helper.\n // A TS cast (`(id as string).slice(...)`) prints nothing, so it is transparent here.\n goSliceReceiverType(node): string | undefined {\n let receiverNode = node?.expression?.expression;\n while ((receiverNode?.kind === SyntaxKind.AsExpression) || (receiverNode?.kind === SyntaxKind.NonNullExpression)\n || (receiverNode?.kind === SyntaxKind.ParenthesizedExpression)) {\n receiverNode = receiverNode.expression;\n }\n if (receiverNode?.kind !== SyntaxKind.Identifier) {\n return undefined;\n }\n const goType = this.goPrintedTypeOfExpression(receiverNode, '');\n return ((goType === 'string') || (goType === '*string')) ? goType : undefined;\n }\n\n // the integer-literal bounds of a `.slice(a, b)` call; undefined when a bound is an\n // expression, whose Go value is not provably a non-negative int the subscript could take\n goSliceLiteralBounds(node): { start: number, hasEnd: boolean, end: number } | undefined {\n const args = node?.arguments ?? [];\n const start = this.goSliceLiteralBound(args[0]);\n if (start === undefined) {\n return undefined;\n }\n const hasEnd = args.length > 1;\n const end = hasEnd ? this.goSliceLiteralBound(args[1]) : undefined;\n if (hasEnd && (end === undefined)) {\n return undefined;\n }\n return { start, hasEnd, end };\n }\n\n // true when this `.slice(a, b)` call prints native Go slicing of a string value\n goIsNativeSliceCall(node): boolean {\n if (node?.kind !== SyntaxKind.CallExpression) {\n return false;\n }\n const callee: any = node.expression;\n if ((callee?.kind !== SyntaxKind.PropertyAccessExpression) || (callee.name?.text !== 'slice')) {\n return false;\n }\n if (this.goSliceReceiverType(node) === undefined) {\n return false;\n }\n return this.goSliceLiteralBounds(node) !== undefined;\n }\n\n // `x.slice(a, b)` -> `x[a:b]` when the receiver is a local the printer declares\n // `string` (or `*string`, which keeps the helper's nil -> \"\" branch as a guard) and\n // both bounds are integer literals. Any other bound or receiver keeps the helper.\n printInlineSlice(node, receiverText: string): string | undefined {\n if ((receiverText ?? '').includes('\\n')) {\n return undefined;\n }\n const goType = this.goSliceReceiverType(node);\n if (goType === undefined) {\n return undefined;\n }\n const bounds = this.goSliceLiteralBounds(node);\n if (bounds === undefined) {\n return undefined;\n }\n const { start, hasEnd, end } = bounds;\n if (goType === 'string') {\n return this.goSliceSubscript(receiverText, start, hasEnd, end);\n }\n const level = this.goStatementLevel;\n const body = this.getIden(level + 1);\n const branch = this.getIden(level + 2);\n const subscript = this.goSliceSubscript('str', start, hasEnd, end);\n return `func() string {\\n${body}if ${receiverText} == nil {\\n${branch}return \"\"\\n${body}}\\n${body}str := *${receiverText}\\n${body}return ${subscript}\\n${this.getIden(level)}}()`;\n }\n\n printSliceCall(node, identation, name = undefined, parsedArg = undefined, parsedArg2 = undefined) {\n parsedArg = this.goPrintCallArgument(node.arguments?.[0], parsedArg);\n parsedArg2 = this.goPrintCallArgument(node.arguments?.[1], parsedArg2);\n const nativeSlice = this.printInlineSlice(node, name);\n if (nativeSlice !== undefined) {\n return nativeSlice;\n }\n if (parsedArg2 === undefined){\n parsedArg2 = 'nil';\n }\n return `Slice(${name}, ${parsedArg}, ${parsedArg2})`;\n }\n\n printReplaceCall(node, identation, name = undefined, parsedArg = undefined, parsedArg2 = undefined) {\n // JS `replace` with a *string* pattern replaces the first occurrence only, which the\n // boxed helper (ReplaceAll for every argument) cannot express: with all three operands\n // proven strings, emit the count-1 form and the JS semantics exactly.\n return this.goNativeStringCallOr(node, [name, parsedArg, parsedArg2], ['string', 'string', 'string'],\n (o) => `strings.Replace(${o[0]}, ${o[1]}, ${o[2]}, 1)`, `Replace(${name}, ${parsedArg}, ${parsedArg2})`);\n }\n\n printReplaceAllCall(node, identation, name = undefined, parsedArg = undefined, parsedArg2 = undefined) {\n // `s.replaceAll (a, b)` replaces every occurrence, like the helper\n return this.goNativeStringCallOr(node, [name, parsedArg, parsedArg2], ['string', 'string', 'string'],\n (o) => `strings.ReplaceAll(${o[0]}, ${o[1]}, ${o[2]})`, `Replace(${name}, ${parsedArg}, ${parsedArg2})`);\n }\n\n printPadEndCall(node, identation, name, parsedArg, parsedArg2) {\n return `PadEnd(${name}, ${parsedArg}, ${parsedArg2})`;\n }\n\n printPadStartCall(node, identation, name, parsedArg, parsedArg2) {\n return `PadStart(${name}, ${parsedArg}, ${parsedArg2})`;\n }\n\n printDateNowCall(node, identation) {\n return \"DateNow()\";\n }\n\n printLengthProperty(node, identation, name = undefined) {\n const leftSide = this.printNode(node.expression, 0);\n // const type = (this.getChecker() as Checker).getTypeAtLocation(node.expression); // eslint-disable-line\n // this.warnIfAnyType(node, type.flags, leftSide, \"length\");\n return `GetLength(${leftSide})`;\n }\n\n // printPostFixUnaryExpression(node, identation) {\n // const {operand, operator} = node;\n // if (operand.kind === SyntaxKind.NumericLiteral) {\n // return super.printPostFixUnaryExpression(node, identation);\n // }\n // const leftSide = this.printNode(operand, 0);\n // const op = this.PostFixOperators[operator]; // todo: handle --\n // if (op === '--') {\n // return `postFixDecrement(ref ${leftSide})`;\n // }\n // return `postFixIncrement(ref ${leftSide})`;\n // }\n\n // printPrefixUnaryExpression(node, identation) {\n // const {operand, operator} = node;\n // if (operand.kind === SyntaxKind.NumericLiteral) {\n // return super.printPrefixUnaryExpression(node, identation);\n // }\n // if (operator === SyntaxKind.ExclamationToken) {\n // // not branch check falsy/turthy values if needed;\n // return this.PrefixFixOperators[operator] + this.printCondition(node.operand, 0);\n // }\n // const leftSide = this.printNode(operand, 0);\n // if (operator === SyntaxKind.PlusToken) {\n // return `prefixUnaryPlus(ref ${leftSide})`;\n // } else {\n // return `prefixUnaryNeg(ref ${leftSide})`;\n // }\n // }\n\n printConditionalExpression(node, identation) {\n const condition = this.goWithExprDepth(1, () => this.printCondition(node.condition, 0));\n if (!condition.includes('\\n')) {\n const whenTrue = this.goPrintTernaryBranch(node.whenTrue, 2);\n const whenFalse = this.goPrintTernaryBranch(node.whenFalse, 1);\n const inlined = this.printInlineTernary(condition, whenTrue, whenFalse, this.goTernaryResultType(node.whenTrue, whenTrue, node.whenFalse, whenFalse));\n if (inlined !== undefined) {\n return inlined;\n }\n }\n const whenTrue = this.printNode(node.whenTrue, 0);\n const whenFalse = this.printNode(node.whenFalse, 0);\n return `Ternary(${condition}, ${whenTrue}, ${whenFalse})`;\n }\n\n printDeleteExpression(node, identation) {\n const object = this.printNode (node.expression.expression, 0);\n const key = this.printNode (node.expression.argumentExpression, 0);\n return `Remove(${object}, ${key})`;\n }\n\n printThrowStatement(node, identation) {\n // const expression = this.printNode(node.expression, 0);\n // return this.getIden(node) + this.THROW_TOKEN + \" \" + expression + this.LINE_TERMINATOR;\n if (node.expression.kind === SyntaxKind.Identifier) {\n return this.getIden(identation) + 'panic(' + this.printNode(node.expression, 0) + ')' + this.LINE_TERMINATOR;\n }\n if (node.expression.kind === SyntaxKind.NewExpression) {\n const expression = node.expression;\n // handle throw new Error (Message)\n // and throw new x[a] (message)\n const argumentsExp = expression?.arguments ?? [];\n const parsedArg = argumentsExp.map(n => this.printNode(n, 0)).join(\",\") ?? '';\n const newExpression = this.printNode(expression.expression, 0);\n if (expression.expression.kind === SyntaxKind.Identifier) {\n // handle throw new X\n const id = expression.expression;\n const symbol = this.getChecker().getSymbolAtLocation(expression.expression);\n if (symbol) {\n const declarations = this.getChecker().getDeclaredTypeOfSymbol(symbol).getSymbol()?.declarations?.map((d) => d.resolve()) ?? [];\n const isClassDeclaration = declarations.find(l => l.kind === SyntaxKind.InterfaceDeclaration || l.kind === SyntaxKind.ClassDeclaration);\n if (isClassDeclaration){\n // return this.getIden(identation) + `${this.THROW_TOKEN} ${this.NEW_TOKEN} ${id.text} ((string)${parsedArg}) ${this.LINE_TERMINATOR}`;\n } else {\n // Go has no statement terminator: the two statements go on\n // their own lines (gofmt splits `a; b` exactly like this)\n return this.getIden(identation) + `throwDynamicException(${id.text}, ${parsedArg})\\n${this.getIden(identation)}return nil`;\n }\n }\n return this.getIden(identation) + `panic(${id.text}(${parsedArg}))${this.LINE_TERMINATOR}`;\n } else if (expression.expression.kind === SyntaxKind.ElementAccessExpression) {\n return this.getIden(identation) + `throwDynamicException(${newExpression}, ${parsedArg})`;\n }\n return super.printThrowStatement(node, identation);\n }\n // const newToken = this.NEW_TOKEN ? this.NEW_TOKEN + \" \" : \"\";\n // const newExpression = node.expression?.expression?.text;\n // // newExpression = newExpression ? newExpression : this.printNode(node.expression.expression, 0); // new Exception or new exact[string] check this out\n // // const args = node.expression?.arguments.map(n => this.printNode(n, 0)).join(\",\");\n // // const throwExpression = ` ${newToken}${newExpression}${this.LEFT_PARENTHESIS}((string)${args})${this.RIGHT_PARENTHESIS}`;\n // return this.getIden(identation) + this.THROW_TOKEN + throwExpression + this.LINE_TERMINATOR;\n }\n\n // -----------------------------------------------------------------------\n // gofmt-compatible spacing of the binary expressions this printer emits\n // -----------------------------------------------------------------------\n // go/printer (nodes.go) prints a binary expression with blanks around the\n // operator unless the expression sits deeper than the top level of a\n // statement: binaryExpr() asks cutoff() - which inspects the operator tree\n // through walkBinary() - and drops *both* blanks when the operator\n // precedence is below that cutoff. Level 4/5 operators (`+ - * / % & | ^\n // << >>`) therefore print as `a + b` at the top level but as `a+b`, `a[i+1]`\n // one level down; comparisons and `&&`/`||` (level 3 and below) always keep\n // their blanks.\n //\n // goExprDepth mirrors the depth go/printer tracks over the Go AST it is\n // about to emit: 1 at the start of every statement, +1 for an argument list\n // with more than one argument, +1 for an index expression, +1 for the right\n // operand of a binary expression, -1 inside parentheses (never below 1), and\n // back to 1 for composite literal elements.\n goExprDepth = 1;\n\n goWithExprDepth(depth: number, callback: () => T): T {\n const previous = this.goExprDepth;\n this.goExprDepth = depth < 1 ? 1 : depth;\n try {\n return callback();\n } finally {\n this.goExprDepth = previous;\n }\n }\n\n // go/token precedence of the operators this printer can print natively\n // (5 `* / % << >> & &^`, 4 `+ - | ^`, 3 comparisons, 2 `&&`, 1 `||`)\n goOperatorPrecedence(operator: string): number {\n switch (operator) {\n case '*': case '/': case '%': case '<<': case '>>': case '&': case '&^':\n return 5;\n case '+': case '-': case '|': case '^':\n return 4;\n case '==': case '!=': case '<': case '<=': case '>': case '>=':\n return 3;\n case '&&':\n return 2;\n case '||':\n return 1;\n }\n return 0;\n }\n\n // the operator string a node is printed as when it stays a Go binary\n // expression, or undefined when the node becomes a helper call or is not\n // binary at all - a primary expression, which walkBinary() never looks into\n goNativeBinaryOperator(node): string | undefined {\n if (!node || !isBinaryExpression(node)) {\n return undefined;\n }\n const kind = node.operatorToken.kind;\n if (kind === SyntaxKind.EqualsToken || kind === SyntaxKind.PlusEqualsToken ||\n kind === SyntaxKind.MinusEqualsToken || kind === SyntaxKind.InKeyword ||\n kind === SyntaxKind.InstanceOfKeyword || kind in this.binaryExpressionsWrappers) {\n return undefined;\n }\n const operator = this.SupportedKindNames[kind];\n return this.goOperatorPrecedence(operator) > 0 ? operator : undefined;\n }\n\n // walkBinary(): has4 / has5 / maxProblem of the operator tree that is about\n // to be printed. Operands that stay binary expressions are walked, every\n // other operand is a primary expression and stops the walk - the same\n // boundary go/printer draws for parens and calls.\n goWalkBinary(operator: string, left, right, rightText: string) {\n const precedence = this.goOperatorPrecedence(operator);\n let has4 = precedence === 4;\n let has5 = precedence === 5;\n let maxProblem = 0;\n const walk = (childOperator: string, child) => {\n const info = this.goWalkBinary(childOperator, child.left, child.right, '');\n has4 = has4 || info.has4;\n has5 = has5 || info.has5;\n maxProblem = Math.max(maxProblem, info.maxProblem);\n };\n const leftOperator = this.goNativeBinaryOperator(left);\n if (leftOperator !== undefined && this.goOperatorPrecedence(leftOperator) >= precedence) {\n walk(leftOperator, left);\n }\n const rightOperator = this.goNativeBinaryOperator(right);\n if (rightOperator !== undefined && this.goOperatorPrecedence(rightOperator) > precedence) {\n walk(rightOperator, right);\n } else if (rightOperator === undefined) {\n // `/*`, `&&`, `&^` and the `+ +` / `- -` pairs must keep a blank so\n // that the two tokens cannot glue into a different operator\n const pair = operator + rightText.replace(/^[ \\t]+/, '').slice(0, 1);\n if (pair === '/*' || pair === '&&' || pair === '&^') {\n maxProblem = 5;\n } else if (pair === '++' || pair === '--') {\n maxProblem = Math.max(maxProblem, 4);\n }\n }\n return { has4, has5, maxProblem };\n }\n\n // the separator gofmt puts around a natively printed operator: `' '` keeps\n // the blanks, `''` drops them (go/printer cutoff())\n goBinarySeparator(operator: string, rightText: string, left, right): string {\n const precedence = this.goOperatorPrecedence(operator);\n if (precedence < 4) {\n // level 3 and below always keep both blanks\n return ' ';\n }\n const { has4, has5, maxProblem } = this.goWalkBinary(operator, left, right, rightText);\n let cutoff;\n if (maxProblem > 0) {\n cutoff = maxProblem + 1;\n } else if (has4 && has5) {\n cutoff = this.goExprDepth === 1 ? 5 : 4;\n } else {\n cutoff = this.goExprDepth === 1 ? 6 : 4;\n }\n return precedence < cutoff ? ' ' : '';\n }\n\n printBinaryExpression(node, identation) {\n\n const {left, right, operatorToken} = node;\n\n const customBinaryExp = this.printCustomBinaryExpressionIfAny(node, identation);\n if (customBinaryExp) {\n return customBinaryExp;\n }\n\n if (operatorToken.kind == SyntaxKind.InstanceOfKeyword) {\n return this.printInstanceOfExpression(node, identation);\n }\n\n if (operatorToken.kind === SyntaxKind.EqualsToken) {\n const pointerWrite = this.goPointerWriteText(node, identation);\n if (pointerWrite !== undefined) {\n return pointerWrite;\n }\n // handle test['a'] = 1;\n const elementAccess = left;\n const rightSide = this.goWithExprDepth(this.goExprDepth + 1, () => this.printNode(right, 0));\n if (left.kind === SyntaxKind.ElementAccessExpression) {\n const leftSide = this.printNode(elementAccess.expression, 0);\n const propName = this.printNode(elementAccess.argumentExpression, 0);\n const value = this.goWithExprDepth(this.goExprDepth + 1, () => this.printNode(right, identation)).trimStart();\n const native = this.printNativeElementAssignment(elementAccess.expression, leftSide, elementAccess.argumentExpression, propName, value, false, right);\n if (native !== undefined) {\n return native;\n }\n return `AddElementToObject(${leftSide}, ${propName}, ${value})`;\n }\n\n if (right?.kind === SyntaxKind.AwaitExpression || rightSide.startsWith('<-this.callInternal')) {\n const leftParsed = this.printNode(left, 0);\n // the awaited call can carry a multi-line object literal argument: printing it\n // at the statement's own level keeps that literal one level deeper\n const awaited = (right?.kind === SyntaxKind.AwaitExpression)\n ? this.printNode(right, identation)\n : rightSide;\n return `\n${this.getIden(identation)}${leftParsed} = ${awaited}\n${this.getIden(identation)}PanicOnError(${leftParsed})`;\n }\n }\n\n const op = operatorToken.kind;\n // handle: [x,d] = this.method()\n if (op === SyntaxKind.EqualsToken && left.kind === SyntaxKind.ArrayLiteralExpression) {\n const arrayBindingPatternElements = left.elements;\n const parsedArrayBindingElements = arrayBindingPatternElements.map((e) => this.printNode(e, 0));\n const syntheticName = parsedArrayBindingElements.join(\"\") + \"Variable\";\n\n let arrayBindingStatement = `${syntheticName} := ${this.printNode(right, 0)}\\n`;\n\n parsedArrayBindingElements.forEach((e, index) => {\n // const type = this.getType(node);\n // const parsedType = this.getTypeFromRawType(type);\n const leftElement = arrayBindingPatternElements[index];\n const leftType = this.getChecker().getTypeAtLocation(leftElement);\n const parsedType = this.getTypeFromRawType(leftType);\n\n const castExp = parsedType ? `(${parsedType})` : \"\";\n\n // const statement = this.getIden(identation) + `${e} = (${castExp}((List)${syntheticName}))[${index}]`;\n const statement = this.getIden(identation) + (this.goGetArgBindsDictElement(leftElement, right, index)\n ? `${e} = MapTyped(GetValue(${syntheticName}, ${index}))`\n : `${e} = GetValue(${syntheticName}, ${index})`);\n if (index < parsedArrayBindingElements.length - 1) {\n arrayBindingStatement += statement + \"\\n\";\n } else {\n arrayBindingStatement += statement;\n }\n });\n\n return arrayBindingStatement;\n }\n\n let operator = this.SupportedKindNames[operatorToken.kind];\n\n\n let leftVar = undefined;\n let rightVar = undefined;\n\n // c# wrapper\n if (operatorToken.kind === SyntaxKind.EqualsEqualsToken || operatorToken.kind === SyntaxKind.EqualsEqualsEqualsToken) {\n if (this.COMPARISON_WRAPPER_OPEN) {\n leftVar = this.printNode(left, 0);\n rightVar = this.printNode(right, identation);\n return `${this.COMPARISON_WRAPPER_OPEN}${leftVar}, ${rightVar}${this.COMPARISON_WRAPPER_CLOSE}`;\n }\n }\n\n // check if boolean operators || and && because of the falsy values\n if (operatorToken.kind === SyntaxKind.BarBarToken || operatorToken.kind === SyntaxKind.AmpersandAmpersandToken) {\n leftVar = this.printCondition(left, 0);\n rightVar = this.printCondition(right, identation);\n if (operatorToken.kind === SyntaxKind.AmpersandAmpersandToken) {\n // `x !== undefined && x === 'v'` inlines to `(x != nil) && (x != nil && *x == \"v\")`.\n // The right operand already guards nil, so the left test is provably\n // implied — `go vet` reports it as a redundant and. Dropping it keeps\n // the exact same value (Go && is short-circuiting, both sides pure).\n const collapsed = this.goDropRedundantNilGuard(leftVar.trim(), rightVar.trim());\n if (collapsed !== undefined) {\n return collapsed;\n }\n }\n } else {\n // go/printer prints the left operand of a binary expression at the\n // depth of the parent plus diffPrec() - 0 only when it is a binary\n // expression of the very same precedence - and the right operand one\n // level deeper. An operator that is not binary in Go (the assignment\n // `=`, or a compound assignment) prints both sides at their own level.\n const precedence = this.goOperatorPrecedence(operator);\n if (precedence > 0) {\n const leftOperator = this.goNativeBinaryOperator(left);\n const samePrecedence = leftOperator !== undefined && this.goOperatorPrecedence(leftOperator) === precedence;\n const leftDepth = samePrecedence ? this.goExprDepth : this.goExprDepth + 1;\n leftVar = this.goWithExprDepth(leftDepth, () => this.printNode(left, 0));\n rightVar = this.goWithExprDepth(this.goExprDepth + 1, () => this.printNode(right, identation));\n } else {\n leftVar = this.printNode(left, 0);\n rightVar = this.printNode(right, identation);\n }\n }\n\n const customOperator = this.getCustomOperatorIfAny(left, right, operatorToken);\n\n operator = customOperator ? customOperator : operator;\n\n const separator = this.goBinarySeparator(operator, rightVar.trim(), left, right);\n\n return leftVar + separator + operator + separator + rightVar.trim();\n }\n\n // `(x != nil) && (x != nil && …)` -> `(x != nil && …)`. Only fires when the\n // right operand opens with the very same nil guard the left operand *is*, so\n // the left is implied and dropping it cannot change the result.\n goDropRedundantNilGuard(leftVar: string, rightVar: string): string | undefined {\n const guard = /^\\(([A-Za-z_]\\w*) != nil\\)$/.exec(leftVar);\n if (guard === null) {\n return undefined;\n }\n if (rightVar.startsWith(`(${guard[1]} != nil && `)) {\n return rightVar;\n }\n return undefined;\n }\n\n printTryStatement(node, identation: number) {\n // const tryBody = this.printNode(node.tryBlock, 0);\n\n let tryBody = node.tryBlock.statements.map((s) => {\n return this.printNode(s, identation + 1);\n }).join(\"\\n\");\n tryBody = tryBody.replaceAll(/(\\s*)break\\s*$/gm, \"$1panic(\\\"break\\\")\"); // to do do thing regex-based\n\n // const catchBody = this.printNode(node.catchClause.block, 0);\n const catchBody = node.catchClause.block.statements.map((s) => this.printNode(s, identation + 1)).join(\"\\n\");\n\n const bodyEndsWithReturn = (body: string, statements) => {\n const lines = body.split(\"\\n\").map(l => l.trim()).filter(Boolean);\n const lastLine = lines.length ? lines[lines.length - 1] : \"\";\n return lastLine.startsWith(\"return\") || lastLine.startsWith(\"panic\") || lastLine.startsWith(\"throw new\")\n || this.blockEndsWithConditionalReturn(statements);\n };\n const catchBodyEndsWithReturn = bodyEndsWithReturn(catchBody, node.catchClause.block.statements);\n const tryBodyEndsWithReturn = bodyEndsWithReturn(tryBody, node.tryBlock.statements);\n\n const returNil = \"return nil\";\n const isVoid = this.isInsideVoidFunction(node);\n\n const nodeEndsWithReturn = tryBodyEndsWithReturn && catchBodyEndsWithReturn && !isVoid;\n const errorName = node.catchClause.variableDeclaration.name.text;\n const classPrefix = this.className !== 'undefined' ? `(this *${this.className})` : \"()\";\n const thisWord = this.className !== 'undefined' ? \"this\" : \"\";\n // the printer indents statements with getIden(); the bodies embedded below are\n // re-placed at their own explicit level so the template only carries the levels\n // *inside* the block (the enclosing getIden(identation) lands on every line)\n const catchBodyBlock = this.indentBlock (catchBody, \"\t\t\t\t\t\");\n const tryBodyBlock = this.indentBlock (tryBody, \"\t\t\");\n const catchBlock =`\n{\n\t${nodeEndsWithReturn ? 'ret__ := ' : ''}func${classPrefix} (ret_ any) {\n\t\tdefer func() {\n\t\t\tif ${errorName} := recover(); ${errorName} != nil {\n\t\t\t\tif ${errorName} == \"break\" {\n\t\t\t\t\treturn\n\t\t\t\t}\n\t\t\t\tret_ = func${classPrefix} any {\n\t\t\t\t\t// catch block:\n${catchBodyBlock}\n\t\t\t\t\t${catchBodyEndsWithReturn ? \"\" : returNil}\n\t\t\t\t}(${thisWord})\n\t\t\t}\n\t\t}()\n\t\t// try block:\n${tryBodyBlock}\n\t\t${tryBodyEndsWithReturn ? \"\" : returNil}\n\t}(${thisWord})\n\t${nodeEndsWithReturn\n ? `if ret__ != nil {\n\t\treturn ret__\n\t}\n\treturn nil`\n : ''}\n}`;\n // add identation to every line; a line that is left blank (the conditional\n // entries above emit nothing, and the block opens on a fresh line) stays\n // empty because gofmt trims trailing whitespace\n const indentedBlock = catchBlock.split(\"\\n\")\n .map((line) => line.trim().length ? this.getIden(identation) + line : \"\")\n .join(\"\\n\");\n // const catchCondOpen = this.CONDITION_OPENING ? this.CONDITION_OPENING : \" \";\n\n return indentedBlock;\n }\n\n /**\n * Strip the printer's own leading indentation from every line of a printed\n * statement block so the caller can re-place it at an explicit level. Only the\n * common prefix goes away: relative nesting (one tab per level) is preserved.\n */\n dedentBlock (block: string) {\n const lines = block.split(\"\\n\");\n const indents = lines\n .filter((line) => line.trim().length > 0)\n .map((line) => (line.match(/^[\\t ]*/) as RegExpMatchArray)[0].length);\n const common = indents.length ? Math.min(...indents) : 0;\n return lines.map((line) => line.slice(common)).join(\"\\n\");\n }\n\n /**\n * Re-place a printed statement block at `level` (a run of tabs): the block's own\n * leading indentation is dropped and every non-blank line is prefixed with `level`,\n * so relative nesting (one tab per level) survives the move.\n */\n indentBlock (block: string, level: string) {\n return this.dedentBlock (block)\n .split(\"\\n\")\n .map((line) => line.trim().length ? level + line : \"\")\n .join(\"\\n\");\n }\n\n /**\n * gofmt writes blank lines with no whitespace at all. A multi-line statement template\n * opens on a fresh line, so the inherited `getIden(identation) + ` prefix\n * lands on a line that carries nothing else: drop that prefix instead of leaving a\n * whitespace-only line behind. Only blank lines are touched, never printed content.\n */\n stripWhitespaceOnlyLines (block: string) {\n return block.split(\"\\n\").map((line) => line.trim().length ? line : \"\").join(\"\\n\");\n }\n\n printPrefixUnaryExpression(node, identation) {\n const {operand, operator} = node;\n if (operator === SyntaxKind.ExclamationToken) {\n // not branch check falsy/turthy values if needed;\n return this.getIden(identation) + this.PrefixFixOperators[operator] + this.printCondition(node.operand, 0);\n }\n if (operator === SyntaxKind.MinusToken) {\n const printed = this.printNode(node.operand, 0);\n const inlined = this.printInlineOpNeg(node, printed);\n if (inlined !== undefined) {\n return this.getIden(identation) + inlined;\n }\n return this.getIden(identation) + `OpNeg(${printed})`;\n }\n return this.getIden(identation) + this.PrefixFixOperators[operator] + this.printNode(operand, 0);\n }\n\n printNewExpression(node, identation) {\n let expression = node.expression?.text;\n expression = expression ? expression : this.printNode(node.expression); // new Exception or new exact[string] check this out\n if (node.arguments.length === 0) {\n return `New${this.capitalize(expression)}()`;\n }\n // an argument printer may prepend the statement indent (parenthesised casts do);\n // inside the call the argument is inline, so trim it like printArgsForCallExpression\n const args = node.arguments.map(n => this.printNode(n, identation).trim()).join(\", \");\n if (expression.endsWith('Error')) {\n return expression + this.LEFT_PARENTHESIS + args + this.RIGHT_PARENTHESIS;\n }\n return 'New' + this.capitalize(expression) + this.LEFT_PARENTHESIS + args + this.RIGHT_PARENTHESIS;\n }\n\n /**\n * Override the default element-access printer with a version that walks the\n * entire `x[y][z]` chain and builds a properly nested sequence of helper\n * calls. This removes the root cause of the unbalanced-parenthesis bug\n * without any post-processing or regex hacks.\n */\n // The Go static type of `printed` when the printer can name it as a native Go\n // map or slice, undefined while the value stays boxed in `any` (GetValue,\n // Ternary, a parameter, an untyped struct field). Only initializer shapes the\n // printer itself types — object/array literals, helper calls whose Go return\n // type it knows (GO_HELPER_RETURN_TYPES + the ccxt extension), and locals whose\n // declaration got that same concrete type — are reported.\n goIndexableTypeOf(node, printed: string): string | undefined {\n if (node === undefined) {\n return undefined;\n }\n switch (node.kind) {\n // a type assertion prints as its operand (printAsExpression hands the operand\n // back), so the operand's Go type still governs the read: `(this.fees as Dict)['x']`\n // is the element access on `this.fees`, whose Go type decides the index\n case SyntaxKind.ParenthesizedExpression:\n case SyntaxKind.AsExpression:\n return this.goIndexableTypeOf(node.expression, printed);\n case SyntaxKind.ObjectLiteralExpression:\n return 'map[string]any';\n case SyntaxKind.ArrayLiteralExpression:\n return '[]any';\n case SyntaxKind.CallExpression:\n return this.goTypeOfInitializer(node, printed);\n case SyntaxKind.Identifier:\n return this.goDeclaredTypeOfIdentifier(node) ?? this.g01MapParamType(node);\n }\n return undefined;\n }\n\n // the leftover chain after the first (native) step, still helper-wrapped:\n // `m[\"a\"][\"b\"][\"c\"]` prints `GetValue(GetValue(m[\"a\"], \"b\"), \"c\")`\n goElementAccessChain(containerStr: string, keyStrs: string[]) {\n let acc = containerStr;\n for (let i = 1; i < keyStrs.length; i++) {\n acc = `${this.ELEMENT_ACCESS_WRAPPER_OPEN}${acc}, ${keyStrs[i]}${this.ELEMENT_ACCESS_WRAPPER_CLOSE}`;\n }\n return acc;\n }\n\n // the container of a nested `m[\"a\"][\"b\"] = v` write, for all but the last key: its first step is a\n // plain read, so a receiver typed as a map indexes natively and only `any` steps keep the helper.\n // A missing key or nil map reads nil in both forms; a non-map container is a no-op either way.\n goElementWriteChain(baseExpr, containerStr: string, keyNodes, keyStrs: string[]): string {\n let acc = containerStr;\n let first = 0;\n if ((keyStrs.length > 1) && (this.goIndexableTypeOf(baseExpr, containerStr) === 'map[string]any')\n && this.goKeyIsString(keyNodes[0], keyStrs[0])) {\n acc = `${containerStr}[${keyStrs[0]}]`;\n first = 1;\n }\n for (let i = first; i < keyStrs.length - 1; i++) {\n acc = `${this.ELEMENT_ACCESS_WRAPPER_OPEN}${acc}, ${keyStrs[i]}${this.ELEMENT_ACCESS_WRAPPER_CLOSE}`;\n }\n return acc;\n }\n\n // true when the printed key is a Go string, so `m[key]` reads the map with the\n // same key GetValue resolves for a string operand (GetValue parses a non-string\n // key, which on map[string]any just yields nil)\n goKeyIsString(node, printed: string) {\n if (node === undefined) {\n return false;\n }\n switch (node.kind) {\n case SyntaxKind.StringLiteral:\n case SyntaxKind.NoSubstitutionTemplateLiteral:\n return true;\n case SyntaxKind.ParenthesizedExpression:\n case SyntaxKind.AsExpression:\n return this.goKeyIsString(node.expression, printed);\n case SyntaxKind.Identifier:\n return this.goDeclaredTypeOfIdentifier(node) === 'string';\n case SyntaxKind.CallExpression:\n return this.goTypeOfInitializer(node, printed) === 'string';\n }\n return false;\n }\n\n // true when the printed key is a Safe*-boxed string: an identifier declared `*string`,\n // i.e. a nilable Go pointer. The native read needs GetValue's `*` deref and its nil\n // answer, neither of which an index expression expresses.\n goIsDerefStringKeyExpression(node): boolean {\n return (node?.kind === SyntaxKind.Identifier) && (this.goDeclaredTypeOfIdentifier(node) === '*string');\n }\n\n // the nil-guarded native read of a declared map with a `*string` key, reproducing GetValue's key\n // deref: a nil key reads nil, otherwise the map index (missing key is the `any` nil). gofmt keeps\n // a func literal holding an `if` on its own lines, so the guard sits at the statement's level.\n printNilGuardedMapIndex(containerStr: string, keyStr: string): string {\n const level = this.goStatementLevel;\n const body = this.getIden(level + 1);\n return `func() any {\\n${body}if ${keyStr} == nil {\\n${this.getIden(level + 2)}return nil\\n${body}}\\n${body}return ${containerStr}[*${keyStr}]\\n${this.getIden(level)}}()`;\n }\n\n // true for `this.` — the one property-access shape whose Go type the\n // printer itself cannot name (the fields live in the hand-written Go structs)\n isGoThisPropertyAccessExpression(node) {\n return (node?.kind === SyntaxKind.PropertyAccessExpression)\n && (node.expression?.kind === SyntaxKind.ThisKeyword);\n }\n\n // true when the element access is the target of an assignment: the binary\n // expression printer owns that shape (AddElementToObject / rewritten GetValue\n // chains), a native `x[k]` index there would drop the write\n isGoElementAccessAssignmentTarget(node) {\n const parent = node.parent;\n return (parent?.kind === SyntaxKind.BinaryExpression) && (parent.left === node)\n && ((parent.operatorToken.kind === SyntaxKind.EqualsToken) || (parent.operatorToken.kind === SyntaxKind.PlusEqualsToken));\n }\n\n // the key of a native list read: its printed Go type must be `int` for the guard's two\n // comparisons to compile, and the key expression is printed twice (the bounds test and the\n // index), so a call operand — evaluated twice — is rejected. Every other key keeps GetValue.\n goIntIndexExpression(node): boolean {\n switch (node?.kind) {\n case SyntaxKind.NumericLiteral: {\n const text = `${node.text ?? ''}`;\n return /^\\d+$/.test(text);\n }\n case SyntaxKind.ParenthesizedExpression:\n return this.goIntIndexExpression(node.expression);\n case SyntaxKind.PrefixUnaryExpression:\n return (node.operator === SyntaxKind.MinusToken) && this.goIntIndexExpression(node.operand);\n case SyntaxKind.Identifier:\n return this.goIntOperandIdentifier(node);\n case SyntaxKind.BinaryExpression: {\n const op = node.operatorToken?.kind;\n if ((op === SyntaxKind.PlusToken) || (op === SyntaxKind.MinusToken)\n || (op === SyntaxKind.AsteriskToken) || (op === SyntaxKind.PercentToken)) {\n return this.goIntIndexExpression(node.left) && this.goIntIndexExpression(node.right);\n }\n return false;\n }\n }\n return false;\n }\n\n // true for an identifier the printer emits as a Go int: a local it declared `int`, and a\n // `for (let i = 0; …)` counter, which prints `for i := 0` and is inferred as `int`\n goIntOperandIdentifier(node): boolean {\n if (this.goDeclaredTypeOfIdentifier(node) === 'int') {\n return true;\n }\n const checker: any = this.checkerOrUndefined();\n if (checker === undefined) {\n return false;\n }\n const symbol = checker.getSymbolAtLocation(node);\n const declaration: any = symbol?.valueDeclaration?.resolve();\n if ((declaration?.kind !== SyntaxKind.VariableDeclaration) || (declaration.initializer === undefined)) {\n return false;\n }\n const list: any = declaration.parent;\n const loop: any = list?.parent;\n if ((list?.kind !== SyntaxKind.VariableDeclarationList) || (list.declarations?.length !== 1)\n || (loop?.kind !== SyntaxKind.ForStatement) || (loop.initializer !== list)) {\n return false;\n }\n const text = `${declaration.initializer.text ?? ''}`;\n return (declaration.initializer.kind === SyntaxKind.NumericLiteral) && /^\\d+$/.test(text);\n }\n\n // true when this identifier is a local the printer declared []any because it was unboxed\n // from a `this.SafeList` accessor. Only that family carried the first guarded element read;\n // the declared-type arm below is the D-06 widening.\n goSafeListUnboxIdentifier(node): boolean {\n const checker: any = this.checkerOrUndefined();\n if (checker === undefined) {\n return false;\n }\n const symbol = checker.getSymbolAtLocation(node);\n const declaration: any = symbol?.valueDeclaration?.resolve();\n return (declaration?.kind === SyntaxKind.VariableDeclaration)\n && (this.goSafeListLocalUnbox(declaration) === GO_SAFE_LIST_LOCAL_TYPE);\n }\n\n // true when the identifier's printed Go declaration is a `[]any` slice: the SafeList family\n // above, or any other local/param the declared-type table proved a slice (a slice literal,\n // a `[]any`-returning accessor, a slice param the typed-param family registers). All of them\n goDeclaredListIdentifier(node): boolean {\n return (this.goDeclaredTypeOfIdentifier(node) === GO_SAFE_LIST_LOCAL_TYPE)\n || this.goSafeListUnboxIdentifier(node);\n }\n\n // `x[k]` on a local the printer declared []any is a slice index: GetValue answered nil for an\n // absent index (negative or out of range) and derefs a pointer element, so the native read is\n // the same index behind that guard. Only a key printed as an `int` carries it; every other\n goNativeListElementRead(node, containerStr: string, keyNode, keyStr: string): string | undefined {\n if (containerStr.includes('\\n') || keyStr.includes('\\n')) {\n return undefined;\n }\n if (this.isGoElementAccessAssignmentTarget(node) || !this.goIntIndexExpression(keyNode)) {\n return undefined;\n }\n const level = this.goStatementLevel;\n const body = this.getIden(level + 1);\n return `func() any {\\n${body}if ${keyStr} >= 0 && ${keyStr} < len(${containerStr}) {\\n${this.getIden(level + 2)}return DerefScalar(${containerStr}[${keyStr}])\\n${body}}\\n${body}return nil\\n${this.getIden(level)}}()`;\n }\n\n printElementAccessExpression(node, identation) {\n // Maintain original special-case handling first.\n const special = this.printElementAccessExpressionExceptionIfAny(node);\n if (special) {\n return special;\n }\n\n // Always process element access expressions the same way\n // The binary expression handler will override this for assignments\n\n // For right-side access, build the full nested chain\n const keys: any[] = [];\n let baseExpr = null;\n let current = node as any;\n // Walk down while the *expression* is another ElementAccessExpression.\n while (isElementAccessExpression(current)) {\n keys.unshift(current.argumentExpression); // prepend\n const expr = current.expression;\n if (!isElementAccessExpression(expr)) {\n // Reached the base container.\n baseExpr = expr;\n break;\n }\n current = expr;\n }\n\n // go/printer prints the base of an index expression at depth 1 and the\n // index itself one level deeper; GetValue(base, key) is a two-argument\n // call, so both operands sit one level below the current expression\n const indexDepth = this.goExprDepth + 1;\n const containerStr = this.goWithExprDepth(indexDepth, () => this.printNode(baseExpr, 0));\n const keyStrs = keys.map(k => this.goWithExprDepth(indexDepth, () => this.printNode(k, 0)));\n\n // GetValue(m, \"k\") is a read of a Go map[string]any already: a missing key\n // and a nil element both come back as the `any` nil, so the native index\n // yields the identical value without the helper call\n if (this.goIndexableTypeOf(baseExpr, containerStr) === 'map[string]any') {\n if (this.goKeyIsString(keys[0], keyStrs[0]) && !this.isGoElementAccessAssignmentTarget(node)\n && !this.goMarketComparisonElementRead(node)) {\n return this.goElementAccessChain(`${containerStr}[${keyStrs[0]}]`, keyStrs);\n }\n // a Safe*-boxed string key holds a nilable `*string`, so the read needs the\n // helper's nil answer and deref around the same map index. A multi-line\n // receiver cannot carry the guard's own indentation, so it keeps the helper.\n if (this.goIsDerefStringKeyExpression(keys[0]) && !containerStr.includes('\\n')\n && !this.isGoElementAccessAssignmentTarget(node)) {\n return this.goElementAccessChain(this.printNilGuardedMapIndex(containerStr, keyStrs[0]), keyStrs);\n }\n }\n\n // Now build nested helpers.\n let acc = containerStr;\n keyStrs.forEach(k => {\n acc = `${this.ELEMENT_ACCESS_WRAPPER_OPEN}${acc}, ${k}${this.ELEMENT_ACCESS_WRAPPER_CLOSE}`;\n });\n\n // a local the printer declared []any — either unboxed from a `this.SafeList` accessor or\n // named []any by the declared-type table — is a slice, so an element read with a key it\n // prints as an int is the guarded native index (see goNativeListElementRead)\n if ((baseExpr?.kind === SyntaxKind.Identifier) && this.goDeclaredListIdentifier(baseExpr)) {\n const nativeRead = this.goNativeListElementRead(node, containerStr, keys[0], keyStrs[0]);\n if (nativeRead !== undefined) {\n return this.goElementAccessChain(nativeRead, keyStrs);\n }\n }\n\n return acc;\n }\n\n isInsideVoidFunction(node: Node): boolean {\n for (let cur = node.parent; cur; cur = cur.parent) {\n if (isFunctionLike(cur)) {\n return (cur as any).type === undefined || (cur as any).type.kind === SyntaxKind.VoidKeyword;\n }\n }\n return true; // default-to-void if uncertain\n }\n\n /**\n * Check if a block or statement contains a return statement or throws an error\n */\n hasReturnInBlock(statement: Statement): boolean {\n if (isBlock(statement)) {\n // A sequence of statements returns on all control paths if the last statement returns on all control paths\n if (statement.statements.length === 0) {\n return false;\n }\n return this.hasReturnInBlock(statement.statements[statement.statements.length - 1]);\n } else if (isReturnStatement(statement)) {\n return true;\n } else if (isThrowStatement(statement)) {\n return true;\n } else if (isIfStatement(statement)) {\n // An if statement returns on all control paths if both the \"if\" and \"else\" branches return on all control paths\n const ifHasReturn = this.hasReturnInBlock(statement.thenStatement);\n if (statement.elseStatement) {\n const elseHasReturn = this.hasReturnInBlock(statement.elseStatement);\n return ifHasReturn && elseHasReturn;\n }\n return false; // No else statement, so execution can continue\n } else if (isTryStatement(statement)) {\n // A try statement returns on all control paths if both try and catch blocks return on all control paths\n const tryHasReturn = this.hasReturnInBlock(statement.tryBlock);\n const catchHasReturn = this.hasReturnInBlock(statement.catchClause.block);\n return tryHasReturn && catchHasReturn;\n }\n return false;\n }\n\n /**\n * Check if the last statement in a block is a conditional with returns in all branches\n */\n blockEndsWithConditionalReturn(statements: NodeArray): boolean {\n if (statements.length === 0) {\n return false;\n }\n\n // an if (with an else) or a try returning on every path: hasReturnInBlock's own rules for both\n const lastStatement = statements[statements.length - 1];\n return (isIfStatement(lastStatement) || isTryStatement(lastStatement)) && this.hasReturnInBlock(lastStatement);\n }\n\n // hx4 G01\n // a defaulted parameter bound through GetArgMap is a Go map[string]any; an element read of it\n // indexes natively only where g01ReadOk proves the deref-free read answers what GetValue did\n g01MapParamType(node): string | undefined {\n const checker: any = this.checkerOrUndefined();\n if (checker === undefined) {\n return undefined;\n }\n let decl: any;\n try {\n decl = checker.getSymbolAtLocation(node)?.valueDeclaration?.resolve();\n } catch (e) {\n return undefined;\n }\n if ((decl?.kind !== SyntaxKind.Parameter) || (this.goGetArgParameterType(decl) !== 'map[string]any')) {\n return undefined;\n }\n const access: any = node.parent;\n if ((access?.kind === SyntaxKind.ElementAccessExpression) && (access.expression === node)\n && (this.g01ReadOk(node, access) !== 'map[string]any')) {\n return undefined;\n }\n return 'map[string]any';\n }\n\n // `receiver[k]` may replace GetValue(receiver, k) on a declared map[string]any: literal key, not a\n // compared operand, not an element-write value (the ccxt write pass proves those from the helper\n // spelling), and a market row or a consumer that derefScalars the value as GetValue did\n g01ReadOk(receiver, access): string | undefined {\n if (this.goIsComparedOperand(access) || this.g01IsWriteValue(access) || !this.g01LiteralKey(access.argumentExpression)) {\n return undefined;\n }\n return (this.g01MarketRow(receiver) || this.x02CurrencyRow(receiver) || this.g01DerefConsumer(access)) ? 'map[string]any' : undefined;\n }\n\n // a string literal or a non-negative integer literal key\n g01LiteralKey(key): boolean {\n return (key?.kind === SyntaxKind.StringLiteral) || (key?.kind === SyntaxKind.NoSubstitutionTemplateLiteral)\n || ((key?.kind === SyntaxKind.NumericLiteral) && /^\\d+$/.test(`${key.text ?? ''}`));\n }\n\n // `y[k] = x[\"lit\"]`\n g01IsWriteValue(access): boolean {\n let operand: any = access;\n while (operand.parent?.kind === SyntaxKind.ParenthesizedExpression) {\n operand = operand.parent;\n }\n const parent: any = operand.parent;\n return (parent?.kind === SyntaxKind.BinaryExpression) && (parent.right === operand)\n && (parent.operatorToken?.kind === SyntaxKind.EqualsToken) && (parent.left?.kind === SyntaxKind.ElementAccessExpression);\n }\n\n // a Market-typed local written only by `this.market (…)` (or undefined): that accessor returns\n // MarketTyped rows, whose values derefScalar leaves unchanged. Currency rows can hold *string values.\n g01MarketRow(node): boolean {\n let type: any;\n try {\n type = this.getChecker().getTypeAtLocation(node);\n } catch (e) {\n return false;\n }\n const names = [ type?.aliasSymbol?.name, type?.symbol?.name ];\n if (!names.some((n) => [ 'Market', 'MarketInterface' ].includes(n))) {\n return false;\n }\n const declaration = this.goDeclarationOfIdentifier(node);\n const scope: any = (declaration === undefined) ? undefined : this.goEnclosingFunction(declaration);\n if (scope === undefined) {\n return false;\n }\n const isRow = (v: any) => (v === undefined) || ((v.kind === SyntaxKind.Identifier) && (v.text === 'undefined'))\n || ((v.kind === SyntaxKind.CallExpression) && (v.expression?.kind === SyntaxKind.PropertyAccessExpression)\n && (v.expression.expression?.kind === SyntaxKind.ThisKeyword) && (v.expression.name?.text === 'market'));\n let ok = isRow(declaration.initializer);\n const name = declaration.name?.text;\n const visit = (n: any) => {\n if (!ok) {\n return;\n }\n if ((n.kind === SyntaxKind.BinaryExpression) && (n.left?.kind === SyntaxKind.Identifier) && (n.left.text === name)\n && (n.operatorToken?.kind === SyntaxKind.EqualsToken) && this.goIdentifierRefersToDeclaration(n.left, declaration)) {\n ok = isRow(n.right);\n } else if ((n.kind === SyntaxKind.ArrayLiteralExpression) && (n.parent?.kind === SyntaxKind.BinaryExpression) && (n.parent.left === n)\n && n.elements.some((e: any) => (e.kind === SyntaxKind.Identifier) && (e.text === name))) {\n ok = false;\n }\n n.forEachChild(visit);\n };\n scope.forEachChild(visit);\n return ok;\n }\n\n // the read is the container of an enclosing element read, an operand of `in`, or an argument of a\n // SafeValueN-backed accessor (or safeCurrencyCode): each derefScalars it, so GetValue's deref is redundant\n g01DerefConsumer(access): boolean {\n let operand: any = access;\n while (operand.parent?.kind === SyntaxKind.ParenthesizedExpression) {\n operand = operand.parent;\n }\n const parent: any = operand.parent;\n if ((parent?.kind === SyntaxKind.ElementAccessExpression) && (parent.expression === operand)) {\n return !this.isGoElementAccessAssignmentTarget(parent);\n }\n if ((parent?.kind === SyntaxKind.BinaryExpression) && (parent.operatorToken?.kind === SyntaxKind.InKeyword)) {\n return true;\n }\n const callee: any = parent?.expression;\n return (parent?.kind === SyntaxKind.CallExpression) && (parent.arguments.indexOf(operand) >= 0)\n && (callee?.kind === SyntaxKind.PropertyAccessExpression) && (callee.expression?.kind === SyntaxKind.ThisKeyword)\n && /^(?:safe(?:Value|String|StringLower|StringUpper|Integer|IntegerProduct|Float|Number|Bool|Timestamp|Dict|List)(?:2|N)?|safeCurrencyCode)$/.test(`${callee.name?.text ?? ''}`);\n }\n // hx4 G02\n // base safeValue/safeValue2/safeValueN (SafeValueN derefScalars every hit and its default) and\n // ws cache constructors (non-nil, outside the derefScalar set): never a nil pointer IsEqual folds\n goG02NonPointerAccessorSource(expr): boolean {\n if (expr?.kind === SyntaxKind.ConditionalExpression) {\n return this.goIsNonPointerValueSource(expr.whenTrue) && this.goIsNonPointerValueSource(expr.whenFalse);\n }\n if (expr?.kind === SyntaxKind.NewExpression) {\n const name = (expr.expression?.kind === SyntaxKind.Identifier) ? expr.expression.text : undefined;\n return GO_G02_CACHE_CLASSES.indexOf(name) >= 0;\n }\n if (expr?.kind !== SyntaxKind.CallExpression) {\n return false;\n }\n const callee = expr.expression;\n if (callee?.kind !== SyntaxKind.PropertyAccessExpression || callee.expression?.kind !== SyntaxKind.ThisKeyword\n || callee.name?.kind !== SyntaxKind.Identifier) {\n return false;\n }\n const keys = GO_G02_SAFE_VALUE_KEYS[callee.name.text];\n if (keys === undefined || expr.arguments.length > keys + 1) {\n return false;\n }\n // a default is returned as given (after derefScalar): only a literal is provably not a nil *sync.Map\n if (expr.arguments.length === keys + 1 && !this.goG02LiteralDefault(expr.arguments[keys])) {\n return false;\n }\n const checker: any = this.checkerOrUndefined();\n const declarations = checker?.getSymbolAtLocation(callee.name)?.declarations?.map((d) => d.resolve());\n if (!declarations || declarations.length === 0) {\n return false;\n }\n // an exchange override would print its own Go body: only the base property qualifies\n return declarations.every((d) => /(^|\\/)ts\\/src\\/base\\/Exchange\\.ts$/.test(String(d.getSourceFile()?.fileName ?? '').replace(/\\\\/g, '/')));\n }\n\n goG02LiteralDefault(node): boolean {\n node = this.goUnwrapParenthesizedNode(node);\n switch (node?.kind) {\n case SyntaxKind.NullKeyword:\n case SyntaxKind.StringLiteral:\n case SyntaxKind.NoSubstitutionTemplateLiteral:\n case SyntaxKind.NumericLiteral:\n case SyntaxKind.TrueKeyword:\n case SyntaxKind.FalseKeyword:\n case SyntaxKind.ObjectLiteralExpression:\n case SyntaxKind.ArrayLiteralExpression:\n return true;\n case SyntaxKind.Identifier:\n return node.text === 'undefined';\n }\n return false;\n }\n\n\n\n // hx4 G06\n // a `*string` the checker narrows to string (or whose every write is a defaulted SafeString)\n // is non-nil, so GetLength/GetArrayLength's deref + byte count is `len(*x)`\n goHx4G06DerefLength(expression, printedText: string, lengthNode): string | undefined {\n if ((expression?.kind !== SyntaxKind.Identifier) || (printedText !== expression.text)) {\n return undefined;\n }\n if (this.goLengthFeedsArithmeticClassifier(lengthNode) || !this.goDerefableStringOperand(expression)) {\n return undefined;\n }\n return `len(*${printedText})`;\n }\n\n // GetIndexOf on two operands that are Go strings once a proven-non-nil `*string` is deref'd:\n // both sides reach the helper's `case string` arm, which is strings.Index\n goHx4G06DerefIndexOf(node, name, parsedArg): string | undefined {\n if ((typeof name !== 'string') || (typeof parsedArg !== 'string') || name.includes('\\n') || parsedArg.includes('\\n')) {\n return undefined;\n }\n if (!this.goFileKeepsFileLevelImports() || !this.goStdlibImportIsPlaceable()) {\n return undefined;\n }\n const operands = [ this.goUnwrapPrintedAssertions(node?.expression?.expression), this.goUnwrapPrintedAssertions(node?.arguments?.[0]) ];\n const texts = [ name, parsedArg ];\n if (!operands.some((o) => this.goDerefableStringOperand(o))) {\n return undefined; // plain string pairs and nilable receivers stay with goNativeIndexOf\n }\n const out: string[] = [];\n for (let i = 0; i < 2; i++) {\n const o = operands[i];\n if ((o?.kind === SyntaxKind.Identifier) && (texts[i] === o.text) && this.goDerefableStringOperand(o)) {\n out.push('*' + texts[i]);\n } else if (this.goIndexOfOperandType(o, texts[i]) === 'string') {\n out.push(texts[i]);\n } else {\n return undefined;\n }\n }\n this.goFileStdlibImports.add('strings');\n return `strings.Index(${out[0]}, ${out[1]})`;\n }\n\n\n // hx4 G08\n // a `*string` local the checker narrowed to a union of string literals (`x === 'A' || x === 'B'`):\n // every member is a string, so the Go pointer is non-nil at this read and may be dereferenced\n goLiteralUnionNarrowedStringDeref(node): boolean {\n if ((node?.kind !== SyntaxKind.Identifier) || (this.goDeclaredTypeOfIdentifier(node) !== '*string')) {\n return false;\n }\n const checker: any = this.checkerOrUndefined();\n const type = checker?.getTypeAtLocation(node);\n if ((type === undefined) || ((type.flags & TypeFlags.Union) === 0)) {\n return false;\n }\n const members = type.getTypes?.() ?? [];\n return (members.length > 0) && members.every((member) => (member.flags & TypeFlags.StringLiteral) !== 0);\n }\n // hx4 G09\n // hand-written BaseExchange value fields (go/v4/exchange.go) read as `this.`\n GO_G09_NUMERIC_FIELDS: { [tsName: string]: string } = {\n 'rateLimit': 'float64',\n 'fetchHistoryCacheSize': 'int',\n 'minFundingAddressLength': 'int',\n };\n\n // `this.rateLimit` & co.: only when the checker resolves the property to the base\n // `class Exchange` declaration (a venue redeclaring it prints its own field)\n goG09FieldKind(node): string | undefined {\n node = this.goUnwrapParenthesizedNode(node);\n if ((node?.kind !== SyntaxKind.PropertyAccessExpression) || (node.expression?.kind !== SyntaxKind.ThisKeyword)) {\n return undefined;\n }\n const kind = this.GO_G09_NUMERIC_FIELDS[node.name?.escapedText ?? node.name?.text];\n if (kind === undefined) {\n return undefined;\n }\n const checker: any = this.checkerOrUndefined();\n const declaration: any = checker?.getSymbolAtLocation(node)?.valueDeclaration?.resolve();\n if ((declaration?.kind !== SyntaxKind.PropertyDeclaration) || (declaration.parent?.kind !== SyntaxKind.ClassDeclaration)) {\n return undefined;\n }\n const className = declaration.parent.name?.escapedText ?? declaration.parent.name?.text;\n return (className === 'Exchange') ? kind : undefined;\n }\n\n // [kind, pointer] of one ordered-comparison operand, undefined when unprovable\n goG09OperandKind(node, text: string): [string, boolean] | undefined {\n const pointee = this.goOrderedComparisonPointerKind(node);\n if (pointee !== undefined) {\n return [ pointee, true ];\n }\n const field = this.goG09FieldKind(node);\n if (field !== undefined) {\n return [ field, false ];\n }\n const kind = this.goOperandNumericKind(node, text);\n return (kind === undefined) ? undefined : [ kind, false ];\n }\n\n // Ordered comparisons the phase-1 rule refuses only because the two concrete kinds differ\n // (int vs int64, int/int64 vs float64) or an operand is a typed base field. The helper\n // converts the narrower side exactly like `int64(x)` / `float64(x)`; nil and NaN rules stay.\n printG09WideningComparison(left, right, leftText: string, rightText: string, op): string | undefined {\n const operator = ORDERED_COMPARISON_OPERATORS[op];\n if (operator === undefined) {\n return undefined;\n }\n if (this.goIsNumericConstant(left) && this.goIsNumericConstant(right)) {\n return undefined;\n }\n const l = this.goG09OperandKind(left, leftText);\n const r = this.goG09OperandKind(right, rightText);\n if ((l === undefined) || (r === undefined)) {\n return undefined;\n }\n let kind = this.goComparisonKind(left, l[0], right, r[0]);\n let lv = l[1] ? `*${leftText}` : leftText;\n let rv = r[1] ? `*${rightText}` : rightText;\n if (kind === undefined) {\n if (this.goIsNumericConstant(left) || this.goIsNumericConstant(right)) {\n return undefined;\n }\n kind = ((l[0] === 'float64') || (r[0] === 'float64')) ? 'float64' : 'int64';\n if (l[0] !== kind) {\n lv = `${kind}(${lv})`;\n }\n if (r[0] !== kind) {\n rv = `${kind}(${rv})`;\n }\n }\n if ((kind === 'float64') && ((operator === '<') || (operator === '<='))) {\n return undefined;\n }\n const leftNil = l[1] && !this.goHasEnclosingNilGuard(left);\n const rightNil = r[1] && !this.goHasEnclosingNilGuard(right);\n if ((leftNil && !r[1] && !this.goIsPureComparisonOperand(right))\n || (rightNil && !l[1] && !this.goIsPureComparisonOperand(left))) {\n return undefined;\n }\n const greater = (operator === '>') || (operator === '>=');\n const cmp = `${lv} ${operator} ${rv}`;\n if (!leftNil && !rightNil) {\n return `(${cmp})`;\n }\n if (leftNil && !rightNil) {\n return greater ? `(${leftText} != nil && ${cmp})` : `(${leftText} == nil || ${cmp})`;\n }\n if (!leftNil && rightNil) {\n return greater ? `(${rightText} == nil || ${cmp})` : `(${rightText} != nil && ${cmp})`;\n }\n if (operator === '>') {\n return `(${leftText} != nil && (${rightText} == nil || ${cmp}))`;\n }\n if (operator === '>=') {\n return `(${rightText} == nil || (${leftText} != nil && ${cmp}))`;\n }\n if (operator === '<') {\n return `(${rightText} != nil && (${leftText} == nil || ${cmp}))`;\n }\n return `(${leftText} == nil || (${rightText} != nil && ${cmp}))`;\n }\n\n}\n\n\n// get class decl node\n// Use the getAllSuperTypeNodes function to get the base classes for the MyClass\n// const baseClasses = getAllSuperTypeNodes(classDeclaration);\n\n// // Create a type checker\n// const typeChecker = ts.createTypeChecker(sourceFile.context.program, sourceFile.context.checker);\n\n// // Get the type of the base class\n// const baseClassType = typeChecker.getTypeAtLocation(baseClasses[0]);\n\n// // Get the class declaration for the base class\n// const baseClassDeclaration = baseClassType.symbol.valueDeclaration?.resolve();\n\n// console.log(baseClassDeclaration);\n\n// hx4 G02: key-argument count of the base safeValue family; ws cache classes (Go constructors return a non-nil *T)\nconst GO_G02_SAFE_VALUE_KEYS: { [name: string]: number } = { 'safeValue': 2, 'safeValue2': 3, 'safeValueN': 2 };\nconst GO_G02_CACHE_CLASSES = [ 'ArrayCache', 'ArrayCacheByTimestamp', 'ArrayCacheBySymbolById', 'ArrayCacheBySymbolBySide' ];\n\n// hx4 G04\nexport interface GoTranspiler {\n goNativeIntWideningArithmetic(node, leftType: string, rightType: string, leftText: string, rightText: string): { goType: string, text: string } | undefined;\n}\n// `a - b` / `a * b` / `a + b` with one int64 and one int operand (or an int `- * %N` in a `var` initializer):\n// the helper boxes int64 (Add/Subtract/Mod via the float path, Multiply via reflect Int()); Go refuses\n// the mixed operator, so the int side converts. Exact under the helper's own 2^53 float bound.\nGoTranspiler.prototype.goNativeIntWideningArithmetic = function (node, leftType: string, rightType: string, leftText: string, rightText: string) {\n const op = node.operatorToken.kind;\n const isMod = (op === SyntaxKind.PercentToken) && this.isNonZeroIntegerLiteral(node.right);\n if ((op !== SyntaxKind.MinusToken) && (op !== SyntaxKind.AsteriskToken) && (op !== SyntaxKind.PlusToken) && !isMod) {\n return undefined;\n }\n const mixed = ((leftType === 'int64') && (rightType === 'int')) || ((leftType === 'int') && (rightType === 'int64'));\n // `var x int64 = n - 1` over an `int` local: Subtract/Multiply box int64, so the int side converts\n const intKinds = [ 'int', 'const-int' ];\n const declaredInt64 = (op !== SyntaxKind.PlusToken) && intKinds.includes(leftType) && intKinds.includes(rightType)\n && ((leftType === 'int') || (rightType === 'int')) && this.goInsideTypedDeclarationInitializer(node);\n if ((!mixed || isMod) && !declaredInt64) {\n return undefined;\n }\n const operand = (operandNode, operandType: string, printed: string) => (operandType === 'int')\n ? 'int64(' + this.goUnwrapPrintedParens(printed.trim()) + ')'\n : this.goNativeOperandText(operandNode, printed);\n const left = operand(node.left, leftType, leftText);\n const right = operand(node.right, rightType, rightText);\n const symbol = this.SupportedKindNames[op];\n const separator = this.goBinarySeparator(symbol, right, node.left, node.right);\n return { 'goType': 'int64', 'text': left + separator + symbol + separator + right };\n};\n\nexport interface GoTranspiler {\n goStringLiteralUnionType(type): boolean;\n}\n// `if (x === 'a' || x === 'b')` narrows a `Str` local to a union of string literals: every member\n// is a non-nilable string, so the deref is as safe as for a plain narrowed `string`\nGoTranspiler.prototype.goStringLiteralUnionType = function (type) {\n if ((type === undefined) || ((type.flags & TypeFlags.Union) === 0)) {\n return false;\n }\n const members = type.getTypes();\n return (members.length > 0) && members.every((member) => (member.flags & TypeFlags.StringLike) !== 0);\n};\n\nexport interface GoTranspiler {\n goConcatDerefableStringOperand(node): boolean;\n}\n// the concat rule's `*string` leaf proof: goDerefableStringOperand, or a declared `*string`\n// identifier the checker narrowed to a union of string literals at this use\nGoTranspiler.prototype.goConcatDerefableStringOperand = function (node) {\n if (this.goDerefableStringOperand(node)) {\n return true;\n }\n if ((node?.kind !== SyntaxKind.Identifier) || (this.goDeclaredTypeOfIdentifier(node) !== '*string')) {\n return false;\n }\n const checker: any = this.checkerOrUndefined();\n return (checker !== undefined) && this.goStringLiteralUnionType(checker.getTypeAtLocation(node));\n};\n\n// hx4 X02\nexport interface GoTranspiler {\n x02CurrencyRow(node): boolean;\n}\n// a Currency-typed local written only by `this.currency (…)` / `this.safeCurrency (…)` (or undefined):\n// the ccxt Go runtime returns those through CurrencyTyped, whose values derefScalar leaves unchanged\nGoTranspiler.prototype.x02CurrencyRow = function (node) {\n let type: any;\n try {\n type = this.getChecker().getTypeAtLocation(node);\n } catch (e) {\n return false;\n }\n const named = (t: any) => [ t?.getAliasSymbol?.()?.name, t?.getSymbol?.()?.name ].some((n) => [ 'Currency', 'CurrencyInterface' ].includes(n));\n const members = ((typeof type?.isUnionType === 'function') && type.isUnionType()) ? type.getTypes() : [ type ];\n if (!named(type) && !members.some((t: any) => named(t))) {\n return false;\n }\n const declaration = this.goDeclarationOfIdentifier(node);\n const scope: any = (declaration === undefined) ? undefined : this.goEnclosingFunction(declaration);\n if (scope === undefined) {\n return false;\n }\n const isRow = (v: any) => (v === undefined) || ((v.kind === SyntaxKind.Identifier) && (v.text === 'undefined'))\n || ((v.kind === SyntaxKind.CallExpression) && (v.expression?.kind === SyntaxKind.PropertyAccessExpression)\n && (v.expression.expression?.kind === SyntaxKind.ThisKeyword) && [ 'currency', 'safeCurrency' ].includes(v.expression.name?.text));\n let ok = isRow(declaration.initializer);\n const name = declaration.name?.text;\n const visit = (n: any) => {\n if (!ok) {\n return;\n }\n if ((n.kind === SyntaxKind.BinaryExpression) && (n.left?.kind === SyntaxKind.Identifier) && (n.left.text === name)\n && (n.operatorToken?.kind === SyntaxKind.EqualsToken) && this.goIdentifierRefersToDeclaration(n.left, declaration)) {\n ok = isRow(n.right);\n } else if ((n.kind === SyntaxKind.ArrayLiteralExpression) && (n.parent?.kind === SyntaxKind.BinaryExpression) && (n.parent.left === n)\n && n.elements.some((e: any) => (e.kind === SyntaxKind.Identifier) && (e.text === name))) {\n ok = false;\n }\n n.forEachChild(visit);\n };\n scope.forEachChild(visit);\n return ok;\n};\n\n// hx4 G11\nexport interface GoTranspiler {\n g11NativeParameterType(fn, param, index: number): string | undefined;\n g11ParameterHasNullishDefault(body, param): boolean;\n}\n// A required parameter of a sync exchange-local method whose TS type is `Str`/`string`, `Dict`-shaped or\n// `List`: the Go type every call site passes (`string` first, then *string / map / []any), when the body\n// never writes another type, never nil-tests it and never `??`-defaults it (D2, D5)\nGoTranspiler.prototype.g11NativeParameterType = function (fn, param, index: number) {\n if (this.isAsyncFunction(fn) || !this.goHasTreeCallSite(fn)) {\n return undefined;\n }\n const candidates: string[] = [];\n const type = this.checkerOrUndefined()?.getTypeAtLocation(param);\n if (type !== undefined) {\n const all = ((typeof type.isUnionType === 'function') && type.isUnionType()) ? type.getTypes() : [type];\n const parts = all.filter(p => !(p.flags & (TypeFlags.Undefined | TypeFlags.Null)));\n if ((parts.length > 0) && parts.every(p => (p.flags & (TypeFlags.String | TypeFlags.StringLiteral)) !== 0)) {\n candidates.push('string');\n }\n }\n for (const goType of this.goNativeParameterTypeCandidates(param).concat(this.g13NumericParameterCandidates(param))) {\n if (!candidates.includes(goType)) {\n candidates.push(goType);\n }\n }\n for (const goType of candidates) {\n if (this.goParameterCallSitesPassType(fn, index, goType)\n && this.goLocalIsSafeToType(fn.body, param, param.name.text, goType)\n && (goType.startsWith('*') || this.goParameterKeepsNilCompareNative(fn.body, param, goType))\n && (goType.startsWith('*') || !this.g11ParameterHasNullishDefault(fn.body, param))) {\n return goType;\n }\n }\n return undefined;\n};\n\n// `x ?? d` / `x || d` reads the parameter's absent state, which a non-nilable Go type cannot hold\nGoTranspiler.prototype.g11ParameterHasNullishDefault = function (body, param) {\n const name = param.name.text;\n return this.hasNodeWhere(body, (n: any) => {\n const parent: any = n.parent;\n return (n.kind === SyntaxKind.Identifier) && (n.text === name) && (parent?.kind === SyntaxKind.BinaryExpression)\n && (parent.left === n) && ((parent.operatorToken.kind === SyntaxKind.QuestionQuestionToken)\n || (parent.operatorToken.kind === SyntaxKind.QuestionQuestionEqualsToken));\n });\n};\n\n// hx4 G13\nexport interface GoTranspiler {\n g13NumericParameterCandidates(param): string[];\n}\n// a required `Int` / `Num` / `number` parameter: the pointer Go type the GetArg twins already use\n// for `Int` / `Num` (nil is the absent state); a non-nullable `number` takes the plain value type its callers pass\nGoTranspiler.prototype.g13NumericParameterCandidates = function (param) {\n const declared = (param?.type !== undefined) ? String(param.type.getText()).trim() : undefined;\n switch (declared) {\n case 'Int': return ['*int64'];\n case 'Num': return ['*float64'];\n case 'number': return ['int64', 'float64'];\n }\n return [];\n};\n","import { BaseTranspiler } from \"./baseTranspiler.js\";\nimport { NodeFlags, SyntaxKind, type Expression, type Node } from \"typescript/unstable/ast\";\nimport { isArrayLiteralExpression, isArrowFunction, isAsExpression, isBinaryExpression, isBlock, isBooleanLiteral, isCallExpression, isBreakStatement, isClassDeclaration, isConditionalExpression, isContinueStatement, isElementAccessExpression, isExpressionStatement, isForInStatement, isForOfStatement, isFunctionDeclaration, isFunctionExpression, isIdentifier, isIfStatement, isMethodDeclaration, isNonNullExpression, isNumericLiteral, isObjectLiteralExpression, isParameterDeclaration, isParenthesizedExpression, isPostfixUnaryExpression, isPrefixUnaryExpression, isPropertyAccessExpression, isPropertyAssignment, isReturnStatement, isShorthandPropertyAssignment, isSourceFile, isSpreadAssignment, isSpreadElement, isStringLiteral, isStringLiteralLikeNode, isThrowStatement, isTypeAssertion, isTypeOfExpression, isTypeReferenceNode, isVariableDeclaration, isVariableDeclarationList } from \"typescript/unstable/ast/is\";\nimport { createIdentifier } from \"typescript/unstable/ast/factory\";\nimport { API, ElementFlags, IndexKind, SymbolFlags, TypeFlags, type Checker } from \"typescript/unstable/sync\";\nimport { Logger } from \"./logger.js\";\nimport { getAllSuperTypeNodes, getCombinedNodeFlags, isFunctionLike } from \"./tsUtils.js\";\n\nconst parserConfig = {\n EXTENDS_TOKEN: \"extends\",\n PROMISE_TYPE_KEYWORD: \"java.util.concurrent.CompletableFuture\",\n ARRAY_KEYWORD: \"java.util.List\",\n OBJECT_KEYWORD: \"java.util.Map\",\n STRING_KEYWORD: \"String\",\n BOOLEAN_KEYWORD: \"boolean\",\n DEFAULT_PARAMETER_TYPE: \"Object\",\n DEFAULT_RETURN_TYPE: \"Object\",\n DEFAULT_TYPE: \"Object\",\n ELSEIF_TOKEN: \"else if\",\n // Objects in Java: we'll use double-brace initialization so property puts work\n OBJECT_OPENING: \"new java.util.HashMap() {{\",\n OBJECT_CLOSING: \"}}\",\n // Arrays in Java: emit Arrays.asList(...) wrapped by ArrayList\n ARRAY_OPENING_TOKEN: \"new java.util.ArrayList(java.util.Arrays.asList(\",\n ARRAY_CLOSING_TOKEN: \"))\",\n // For object literal properties we'll emit: put(key, value);\n PROPERTY_ASSIGNMENT_TOKEN: \",\",\n VAR_TOKEN: \"Object\", // Java 10+ local var\n METHOD_TOKEN: \"\",\n PROPERTY_ASSIGNMENT_OPEN: \"put(\",\n PROPERTY_ASSIGNMENT_CLOSE: \");\",\n SUPER_TOKEN: \"super\",\n SUPER_CALL_TOKEN: \"super\",\n FALSY_WRAPPER_OPEN: \"Helpers.isTrue(\",\n FALSY_WRAPPER_CLOSE: \")\",\n COMPARISON_WRAPPER_OPEN: \"Helpers.isEqual(\",\n COMPARISON_WRAPPER_CLOSE: \")\",\n UKNOWN_PROP_WRAPPER_OPEN: \"this.call(\",\n UNKOWN_PROP_WRAPPER_CLOSE: \")\",\n UKNOWN_PROP_ASYNC_WRAPPER_OPEN: \"this.callAsync(\",\n UNKOWN_PROP_ASYNC_WRAPPER_CLOSE: \")\",\n DYNAMIC_CALL_OPEN: \"Helpers.callDynamically(\",\n EQUALS_EQUALS_WRAPPER_OPEN: \"Helpers.isEqual(\",\n EQUALS_EQUALS_WRAPPER_CLOSE: \")\",\n DIFFERENT_WRAPPER_OPEN: \"!Helpers.isEqual(\",\n DIFFERENT_WRAPPER_CLOSE: \")\",\n GREATER_THAN_WRAPPER_OPEN: \"Helpers.isGreaterThan(\",\n GREATER_THAN_WRAPPER_CLOSE: \")\",\n GREATER_THAN_EQUALS_WRAPPER_OPEN: \"Helpers.isGreaterThanOrEqual(\",\n GREATER_THAN_EQUALS_WRAPPER_CLOSE: \")\",\n LESS_THAN_WRAPPER_OPEN: \"Helpers.isLessThan(\",\n LESS_THAN_WRAPPER_CLOSE: \")\",\n LESS_THAN_EQUALS_WRAPPER_OPEN: \"Helpers.isLessThanOrEqual(\",\n LESS_THAN_EQUALS_WRAPPER_CLOSE: \")\",\n PLUS_WRAPPER_OPEN: \"Helpers.add(\",\n PLUS_WRAPPER_CLOSE: \")\",\n MINUS_WRAPPER_OPEN: \"Helpers.subtract(\",\n MINUS_WRAPPER_CLOSE: \")\",\n ARRAY_LENGTH_WRAPPER_OPEN: \"Helpers.getArrayLength(\",\n ARRAY_LENGTH_WRAPPER_CLOSE: \")\",\n DIVIDE_WRAPPER_OPEN: \"Helpers.divide(\",\n DIVIDE_WRAPPER_CLOSE: \")\",\n MULTIPLY_WRAPPER_OPEN: \"Helpers.multiply(\",\n MULTIPLY_WRAPPER_CLOSE: \")\",\n INDEXOF_WRAPPER_OPEN: \"Helpers.getIndexOf(\",\n INDEXOF_WRAPPER_CLOSE: \")\",\n MOD_WRAPPER_OPEN: \"Helpers.mod(\",\n MOD_WRAPPER_CLOSE: \")\",\n FUNCTION_TOKEN: \"\",\n ELEMENT_ACCESS_WRAPPER_OPEN: 'Helpers.GetValue(',\n ELEMENT_ACCESS_WRAPPER_CLOSE: ')',\n INFER_VAR_TYPE: false,\n INFER_ARG_TYPE: false,\n};\n\n// hand-written base methods whose Java declaration carries a concrete numeric return type\n// (BaseExchange.java: `public Long milliseconds()`), so a `this.()` call holds that box on\n// every path. Generated methods print `Object`; only this closed table is an arithmetic anchor.\nconst JAVA_THIS_RETURN_TYPES: { [name: string]: string } = {\n 'milliseconds': 'long',\n};\n\n// source files the table was audited against: the declaration on the base class, or\n// its overload-stripped temp copy (build/stripOverloads.ts). A call resolving anywhere\n// else is a venue override that prints its own signature - not provable.\n// `extend = extend` / `deepExtend = deepExtend` resolve to the base-tier generic helpers\nconst JAVA_FRESH_EXTEND_FILE = /(^|[\\\\/])ts[\\\\/]src[\\\\/]base[\\\\/](functions[\\\\/]generic|Exchange(\\.nooverloads\\.\\d+)?)\\.ts$/;\nconst JAVA_THIS_RETURN_TYPES_BASE_FILE = /(^|[\\\\/])ts[\\\\/]src[\\\\/]base[\\\\/]Exchange(\\.nooverloads\\.\\d+)?\\.ts$/;\n// `milliseconds = milliseconds` (Exchange.ts) mixes in the functions/time.ts helper, so\n// the same call may resolve to the Date.now signature in a typescript lib.d.ts instead.\nconst JAVA_THIS_RETURN_TYPES_LIB_FILE = /(^|[\\\\/])node_modules[\\\\/](?:[^\\\\/]+[\\\\/]node_modules[\\\\/])?typescript6?[\\\\/]lib[\\\\/]lib\\.[^\\\\/]*\\.d\\.ts$/;\n\n// every assignment operator (`=`, `+=`, `??=`, ...) but no comparison (`===`, `!==`, `<=`, `>=`):\n// an element access on the left of one of these is a write site and keeps the base emission\nconst JAVA_ASSIGNMENT_OPERATOR_KINDS: Set = (() => {\n const kinds: any = SyntaxKind;\n const names = Object.keys(kinds).filter((name) => name.endsWith('EqualsToken')\n && !/^Equals|^Exclamation|^LessThan|^GreaterThan/.test(name));\n return new Set(([ 'EqualsToken' ].concat(names)).map((name) => kinds[name]).filter((kind) => kind !== undefined));\n})();\n\n// TS type flags whose Java print is a scalar final class or a primitive: `instanceof\n// java.util.List` is not convertible on those operands, so they keep the helper\nconst JAVA_SCALAR_TYPE_FLAGS: number = TypeFlags.String | TypeFlags.StringLiteral\n | TypeFlags.Number | TypeFlags.NumberLiteral\n | TypeFlags.Boolean | TypeFlags.BooleanLiteral\n | TypeFlags.BigInt | TypeFlags.BigIntLiteral\n | TypeFlags.Enum | TypeFlags.EnumLiteral\n | TypeFlags.ESSymbol | TypeFlags.UniqueESSymbol;\n\n// TS type flags that are never an array (JS `Array.isArray(null)` / `(undefined)` is false)\nconst JAVA_NULLISH_TYPE_FLAGS: number = TypeFlags.Undefined | TypeFlags.Null\n | TypeFlags.Void | TypeFlags.Never;\n\n// hand-written `boolean` fields in the class body of BaseExchange.java / PredictionExchange.java\n// (the half hand-written base files the generated exchanges inherit): a read of one prints a\n// primitive Java boolean, so `this.` IS the wrapper's result.\nconst JAVA_BOOLEAN_BASE_FIELDS = new Set([\n 'this.alias',\n 'this.verbose',\n 'this.validateServerSsl',\n 'this.enableRateLimit',\n 'this.pro',\n 'this.certified',\n 'this.reloadingMarkets',\n 'this.marketsLoaded',\n 'this.reduceFees',\n 'this.substituteCommonCurrencyCodes',\n 'this.isSandboxModeEnabled',\n 'this.returnResponseHeaders',\n 'this.newUpdates',\n 'this.syncSleep',\n // PredictionExchange.java\n 'this.reloadingEvents',\n]);\n\n// hand-written map fields of BaseExchange.java: each value is a java.util.Map, so `this.[k]`\n// is the helper's Map branch. `nullable` marks a field set to null or written from an Object-typed\n// call, so the read keeps the null answer behind a receiver guard.\nconst JAVA_FIELD_TYPES: { [name: string]: { map: boolean, nullable: boolean } } = {\n 'ohlcvs': { map: true, nullable: false },\n 'orderbooks': { map: true, nullable: false },\n 'balance': { map: true, nullable: true },\n 'options': { map: true, nullable: true },\n 'markets': { map: true, nullable: true },\n};\n\n// hand-written base methods declared `public boolean` (BaseExchange.java): a call prints a\n// primitive Java boolean, so a local fed by one holds a Boolean box or null.\nconst JAVA_BOOLEAN_BASE_CALLS = new Set([\n 'valueIsDefined',\n 'inArray',\n 'isEmpty',\n 'isJsonEncodedObject',\n 'isBinaryMessage',\n]);\n\n// operators whose printed Java form is a primitive boolean on every path: the logical ones and\n// every comparison / `in` / `instanceof`-style test the printer lowers to Helpers.isEqual /\n// isGreaterThan / inOp (all declared `public static boolean`) or to a native Java boolean\nconst JAVA_BOOLEAN_OPERATOR_KINDS: Set = (() => {\n const k: any = SyntaxKind;\n return new Set([\n k.AmpersandAmpersandToken,\n k.BarBarToken,\n k.EqualsEqualsToken,\n k.EqualsEqualsEqualsToken,\n k.ExclamationEqualsToken,\n k.ExclamationEqualsEqualsToken,\n k.LessThanToken,\n k.LessThanEqualsToken,\n k.GreaterThanToken,\n k.GreaterThanEqualsToken,\n k.InKeyword,\n k.InstanceOfKeyword,\n ]);\n})();\n\n// the relational `Precise.string*` statics are declared `public static boolean` in the\n// hand-written java/lib/src/main/java/io/github/ccxt/base/Precise.java, so their printed call is\n// already a Java primitive boolean (the String-returning statics are NOT listed here)\nconst JAVA_PRECISE_BOOLEAN_STATICS: Set = new Set([\n 'stringEq', 'stringEquals', 'stringGt', 'stringGe', 'stringLt', 'stringLe',\n]);\n\n// The printer erases TS return annotations to `Object`, so Helpers.isTrue would re-test a value the\n// hand-written Java base (BaseExchange.java, above the transpiled delimiter) already returns as a\n// boolean. Java overrides are covariant, so no generated venue method can widen these returns.\nconst JAVA_THIS_BOOLEAN_METHODS = new Set([\n 'inArray', // public boolean inArray (Object elem, Object list2)\n 'isArray', // public boolean isArray (Object a)\n 'isEmpty', // public boolean isEmpty (Object a)\n 'valueIsDefined', // public boolean valueIsDefined (Object value)\n 'isJsonEncodedObject', // public boolean isJsonEncodedObject (Object str)\n 'isBinaryMessage', // public boolean isBinaryMessage (Object message)\n]);\n\n// The GENERATED boolean accessors (`Object safeBool (...)`) hand the caller's `defaultValue` back\n// untouched when the found value is not a Boolean, so the box is Boolean-or-null only when the\n// default argument is absent or a boolean literal. Value = index of that argument in the call.\nconst JAVA_THIS_BOOLEAN_BOX_METHODS: { [name: string]: number } = {\n 'safeBool': 2,\n 'safeBool2': 3,\n 'safeBoolN': 2,\n};\n\n// the Java spellings a consumer declares a dict local with (import-shortened forms\n// included); every other declared type keeps Helpers.GetValue\nconst JAVA_DECLARED_MAP_TYPES = /^(java\\.util\\.)?(Map|HashMap)\\s*<\\s*String\\s*,\\s*Object\\s*>$/;\n\n// the Java spellings a consumer declares an element-read receiver with when it is a List:\n// the read prints `x.get(i)` / `x.size()` with no cast, because the declaration is the List\nconst JAVA_DECLARED_LIST_TYPES = /^(java\\.util\\.)?(List|ArrayList)\\s*<[^;\\n=]+>$/;\n\n// the Java primitive spellings a declaration can publish: an operand that prints as one\n// cannot take the `instanceof` test a native map read guards with\nconst JAVA_PRIMITIVE_DECLARED_TYPES = new Set(['boolean', 'byte', 'char', 'short', 'int', 'long', 'float', 'double']);\n\n// the numeric declaration types the ccxt-side pass publishes; the boxed ones can hold\n// null, so a native compare guards them first\nconst JAVA_DECLARED_NUMERIC_TYPES: Set =\n new Set(['Integer', 'Long', 'Double', 'int', 'long', 'double']);\n\nconst JAVA_BOXED_NUMERIC_TYPES: Set =\n new Set(['Integer', 'Long', 'Double']);\n\n// receiver node kinds whose printed Java is a primary expression, so the `(String)`\n// checkcast in front of them binds the whole receiver (a native `+` prints its own parens)\nconst JAVA_SPLIT_RECEIVER_KINDS: Set = new Set([\n SyntaxKind.Identifier,\n SyntaxKind.PropertyAccessExpression,\n SyntaxKind.ElementAccessExpression,\n SyntaxKind.CallExpression,\n SyntaxKind.ParenthesizedExpression,\n SyntaxKind.StringLiteral,\n SyntaxKind.NoSubstitutionTemplateLiteral,\n]);\n\n// TS classes/interfaces whose hand-written java counterpart extends java.util.ArrayList\n// (java/lib/.../ws/ArrayCache.java and ws/OrderBookSide.java, plus the IndexedOrderBookSide and\n// Asks/Bids subclasses); every runtime value of these types answers `.length` with the list size\nconst JAVA_LIST_BACKED_TS_CLASSES: Set = new Set([\n 'ArrayCache',\n 'ArrayCacheByTimestamp',\n 'ArrayCacheBySymbolById',\n 'ArrayCacheByOutcomeById',\n 'ArrayCacheBySymbolBySide',\n 'OrderBookSide',\n 'IndexedOrderBookSide',\n 'Asks',\n 'Bids',\n 'IndexedAsks',\n 'IndexedBids',\n 'IOrderBookSide',\n]);\n\n// the Java spelling that lets the printed key go straight to containsKey: the helper only\n// looks a key up when it is a String, and a String-typed operand is one on every path\nconst JAVA_DECLARED_STRING_TYPE = /^(java\\.util\\.)?String$/;\n\n// TS parameter annotations (`Dict`, `Market`, `Currency`, `Str`, `OrderType`/`OrderSide`, `Bool`) print the native Java\n// type on the declaring method. `Int`/`Num` stay `Object`: a TS `number` is an Integer, Long or\n// Double box in generated code, so neither a `Long`/`Double` parameter nor a cast site is provable.\nconst JAVA_NATIVE_PARAMETER_TYPES: { [name: string]: string } = {\n 'Dict': 'java.util.Map',\n 'Market': 'java.util.Map',\n 'Currency': 'java.util.Map',\n 'Str': 'String',\n 'OrderType': 'String',\n 'OrderSide': 'String',\n 'Bool': 'Boolean',\n};\n\n// Java types of default-valued parameters; separate from the fixed-parameter table.\n// `Num`/`Bool`/`Strings` stay Object: widening them changes payload strings or varargs spreading.\nconst JAVA_NATIVE_PARAMETER_TYPES_OPTIONAL: { [name: string]: string } = {\n 'Dict': 'java.util.Map',\n 'Market': 'java.util.Map',\n 'Currency': 'java.util.Map',\n 'Str': 'String',\n 'OrderType': 'String',\n 'OrderSide': 'String',\n 'Int': 'Long',\n 'Strings': 'java.util.List',\n};\n\n// `Strings` (and a `string[]` spelling of the same slot) is typed only on parameters named `symbols`\nconst JAVA_STRINGS_OPTIONAL_PARAMETER_NAMES = new Set(['symbols']);\nconst JAVA_STRING_LIST_TYPE = 'java.util.List';\n// base symbol-list helpers keep their Object slot (hand-written java callers pass Object)\nconst JAVA_STRINGS_EXCLUDED_METHODS = new Set(['marketSymbols', 'marketIds', 'marketsForSymbols', 'getMarketFromSymbols']);\n\n// the aliases above have to come from the shared ts/src/base/types.ts declaration\nconst JAVA_NATIVE_PARAMETER_SOURCE_FILES = /(^|\\/)ts\\/src\\/base\\/types\\.ts$/;\n\n// Parameter positions whose Java signature cannot move to the annotated type even though\n// the base declaration carries it. Java overrides are invariant, so one excluded position\n// boxes every declaration of the name at once.\nconst JAVA_NATIVE_PARAMETER_EXCLUDED_POSITIONS: { [name: string]: number[] } = {\n // implicit endpoints pass fetch2/request/sign params through untyped (arrays for batch orders)\n 'fetch2': [ 3 ],\n // the Exchange tier keeps fetchOrderBook's symbol Object; PredictionExchange overrides must erase alike\n 'fetchOrderBook': [ 0 ],\n 'request': [ 3 ],\n 'sign': [ 3 ],\n 'handleErrors': [ 4 ],\n 'parseOrder': [ 0 ],\n 'parseTrade': [ 0 ],\n 'amountToPrecision': [ 0 ],\n 'client': [ 0 ],\n 'costToPrecision': [ 0 ],\n 'handleOptionAndParams': [ 1 ],\n 'market': [ 0 ],\n 'marketSymbols': [ 1 ],\n 'parseAccount': [ 0 ],\n 'parseMarket': [ 0 ],\n 'parseOrderBook': [ 1 ],\n 'priceToPrecision': [ 0 ],\n 'safeBalance': [ 0 ],\n 'safeOpenInterest': [ 0 ],\n 'safeSymbol': [ 0 ],\n // java/tests/src/main/java/tests/base/TestSafeTicker.java is generated by the\n // --baseTests stage, which the farm's java target never reruns: it calls\n // `exchange.safeTicker()` and cannot be regenerated with a checkcast\n 'safeTicker': [ 0 ],\n 'symbol': [ 0 ],\n 'watch': [ 0, 1 ],\n};\n\n// only the generated tiers carry the annotation: a method declared in ts/src/base/** has a\n// hand-written java counterpart (BaseExchange/Exchange/Helpers/Precise) that keeps `Object`\nconst JAVA_NATIVE_PARAMETER_GENERATED_FILES = /(^|\\/)ts\\/src\\/(?:pro\\/|prediction\\/)?[a-z0-9_]+\\.ts$/;\n\n// the base tier is generated too: the transpiled `BaseExchange` body of\n// ts/src/base/Exchange.ts is spliced into java/lib/.../BaseExchange.java (the hand-written\n// java surface around it is not a class of its own), so its declarations print the\n// the base tiers print only the methods below this line of ts/src/base/(Prediction)Exchange.ts\nconst JAVA_TRANSPILE_DELIMITER = 'METHODS BELOW THIS LINE ARE TRANSPILED FROM TYPESCRIPT';\n// hand-written base methods whose Java runtime declares exactly the TS parameters (no varargs)\nconst JAVA_HANDWRITTEN_FULL_ARITY = new Set(['loadMarkets', 'fetchMarkets', 'fetchCurrencies', 'exceptionMessage']);\nconst JAVA_HANDWRITTEN_TIER_FILES = /(^|\\/)ts\\/src\\/(?:base|static_dependencies)\\//;\nconst JAVA_NATIVE_PARAMETER_BASE_FILES = /(^|[\\\\/])ts[\\\\/]src[\\\\/]base[\\\\/](Prediction)?Exchange(\\.nooverloads[^/]*)?\\.ts$/;\n\n// ===== native RETURN types (D-09) =====\n//\n// The printer declares every generated method `Object` (BaseTranspiler.printFunctionType\nconst JAVA_NATIVE_RETURN_MAP_TYPE = 'java.util.Map';\n\n// the hand-written `public String` producers of the base tier a `this. (...)` return\n// may print: the safeString* family, decimalToPrecision / numberToString (BaseExchange.java)\n// and the string helpers of base/functions/type.ts. Guarded by the resolved signature still\nconst JAVA_STRING_RETURN_BASE_METHODS: Set = new Set([\n 'safeString', 'safeString2', 'safeStringN',\n 'safeStringUpper', 'safeStringUpper2', 'safeStringUpperN',\n 'safeStringLower', 'safeStringLower2', 'safeStringLowerN',\n 'decimalToPrecision', 'numberToString', 'formatNumber', 'implodeParams', 'implodeHostname',\n]);\nconst JAVA_STRING_RETURN_BASE_FILES = /(^|[\\\\/])ts[\\\\/]src[\\\\/]base[\\\\/](?:functions[\\\\/](?:type|time)\\.ts|Exchange(\\.nooverloads[^/]*)?\\.ts)$/;\n\n// prediction venues (ts/src/prediction/.ts) live in their own package: their Java base,\n// PredictionExchange.java, carries the injected Exchange-tier body (javaTranspiler.ts\n// getExchangeTierBody), and the venue chain (abstract/prediction/ -> PredictionExchange ->\nconst JAVA_NATIVE_PARAMETER_PREDICTION_FILES = /(^|\\/)ts\\/src\\/prediction\\/[a-z0-9_]+\\.ts$/;\n\nconst JAVA_BOOLEAN_EXCLUDED_TYPE_FLAGS: number =\n TypeFlags.Any | TypeFlags.Unknown | TypeFlags.Undefined | TypeFlags.Null\n | TypeFlags.Void | TypeFlags.Never | TypeFlags.TypeParameter | TypeFlags.Conditional\n | TypeFlags.Enum | TypeFlags.EnumLiteral;\n\n// the union members a nullable boolean box may hold: `Bool` (`boolean | undefined`) and the\n// `boolean | null` spellings. A member of any other family (`Int`, `Str`, `any`) is a box the\n// isTrue helper tests with its runtime truthiness, so the helper must stay.\nconst JAVA_NULLABLE_BOOLEAN_MEMBER_FLAGS: number =\n TypeFlags.Boolean | TypeFlags.BooleanLiteral | TypeFlags.Undefined | TypeFlags.Null\n | TypeFlags.Void;\n\n// the `handle*Bool` accessors route through safeBool, which returns the caller's default untouched\n// when the found value is not a Boolean, so element 0 of their `[Bool, Dict]` tuple is a\n// Boolean-or-null box. The handleOptionAndParams family returns the raw member and is absent.\nconst JAVA_BOOLEAN_BOX_TUPLE_METHODS = new Set([\n 'handleParamBool',\n 'handleParamBool2',\n 'handleOptionBoolAndParams', // element 0 is checkOptionBool's Boolean-or-null (throws otherwise)\n 'handleOptionBoolAndParams2',\n]);\n\n// the Java printer and its build hooks re-ask the same checker questions about one node,\n// type, symbol or signature; answers are fixed per snapshot, so each is one round trip\nconst JAVA_MEMO_UNDEFINED = Symbol(\"javaMemoUndefined\");\nconst JAVA_MEMOIZED_METHODS = [\"getSignatureFromDeclaration\", \"isArrayType\", \"isTupleType\", \"getAliasedSymbol\", \"getTypeArguments\", \"getDeclaredTypeOfSymbol\", \"getReturnTypeOfSignature\", \"getSymbolOfType\", \"getTypeOfSymbolAtLocation\", \"getSignaturesOfType\", \"typeToString\", \"getTypesOfType\"];\nconst JAVA_TYPE_PREFETCH_KINDS = new Set([SyntaxKind.Identifier, SyntaxKind.BinaryExpression, SyntaxKind.Parameter, SyntaxKind.VariableDeclaration, SyntaxKind.StringLiteral, SyntaxKind.MethodDeclaration, SyntaxKind.PropertyAccessExpression, SyntaxKind.ParenthesizedExpression, SyntaxKind.ElementAccessExpression]);\nconst JAVA_SYMBOL_PREFETCH_KINDS = new Set([SyntaxKind.Identifier]);\n// the first lookup in a source file answers every node of the hot kinds in that file in one\n// array request, skipping nodes the core prefetch already cached; other kinds go one by one\nfunction prefetchByFile(checker: Checker, name: \"getTypeAtLocation\" | \"getSymbolAtLocation\", kinds: Set): void {\n const original = (checker as any)[name] as ((nodes: any) => any) & { has?: (node: Node) => boolean };\n const cache = new WeakMap();\n const done = new WeakSet();\n Object.defineProperty(checker, name, { configurable: true, value: (node: any) => {\n if (Array.isArray(node)) {\n return original(node);\n }\n if (cache.has(node)) {\n return cache.get(node);\n }\n const sf = node.getSourceFile?.();\n if (sf !== undefined && !done.has(sf)) {\n done.add(sf);\n const nodes: Node[] = [];\n const visit = (n: Node) => {\n if (kinds.has(n.kind) && !original.has?.(n)) {\n nodes.push(n);\n }\n n.forEachChild(visit);\n };\n sf.forEachChild(visit);\n if (nodes.length > 0) {\n const results = original(nodes);\n for (let i = 0; i < nodes.length; i++) {\n cache.set(nodes[i], results[i]);\n }\n }\n if (cache.has(node)) {\n return cache.get(node);\n }\n }\n const result = original(node);\n cache.set(node, result);\n return result;\n } });\n}\n\n// getResolvedSignature has no array form: the first lookup in a file pipelines every call\n// expression of that file through one batched request (API#batch over the checker's client)\nfunction prefetchResolvedSignatures(checker: Checker): void {\n const original = checker.getResolvedSignature;\n const client = (checker as any).client;\n if (client === undefined) {\n return;\n }\n const cache = new WeakMap();\n const done = new WeakSet();\n Object.defineProperty(checker, \"getResolvedSignature\", { configurable: true, value: (node: any) => {\n if (cache.has(node)) {\n return cache.get(node);\n }\n const sf = node?.getSourceFile?.();\n if (sf !== undefined && !done.has(sf)) {\n done.add(sf);\n const calls: Node[] = [];\n const visit = (n: Node) => {\n if (n.kind === SyntaxKind.CallExpression && !(original as any).has?.(n)) {\n calls.push(n);\n }\n n.forEachChild(visit);\n };\n sf.forEachChild(visit);\n if (calls.length > 0) {\n const results = API.prototype.batch.call({ client }, ...calls.map((c) => original.gen(c))) as unknown[];\n for (let i = 0; i < calls.length; i++) {\n cache.set(calls[i], results[i]);\n }\n }\n if (cache.has(node)) {\n return cache.get(node);\n }\n }\n const result = original(node);\n cache.set(node, result);\n return result;\n } });\n}\n\nfunction memoizeJavaCheckerCalls(checker: Checker): Checker {\n if ((checker as any).__javaMemoized) {\n return checker;\n }\n Object.defineProperty(checker, \"__javaMemoized\", { value: true });\n prefetchByFile(checker, \"getTypeAtLocation\", JAVA_TYPE_PREFETCH_KINDS);\n prefetchByFile(checker, \"getSymbolAtLocation\", JAVA_SYMBOL_PREFETCH_KINDS);\n prefetchResolvedSignatures(checker);\n for (const name of JAVA_MEMOIZED_METHODS) {\n const original = (checker as any)[name];\n if (typeof original !== \"function\") {\n continue;\n }\n const byFirst = new WeakMap>();\n Object.defineProperty(checker, name, { configurable: true, value: (first: any, ...rest: any[]) => {\n if (first === null || (typeof first !== \"object\" && typeof first !== \"function\") || rest.some((a) => a !== undefined && typeof a === \"object\")) {\n return original(first, ...rest);\n }\n let byRest = byFirst.get(first);\n if (byRest === undefined) {\n byRest = new Map();\n byFirst.set(first, byRest);\n }\n const key = rest.length === 0 ? \"\" : JSON.stringify(rest);\n const cached = byRest.get(key);\n if (cached !== undefined) {\n return cached === JAVA_MEMO_UNDEFINED ? undefined : cached;\n }\n const result = original(first, ...rest);\n byRest.set(key, result === undefined ? JAVA_MEMO_UNDEFINED : result);\n return result;\n } });\n }\n return checker;\n}\n\nexport class JavaTranspiler extends BaseTranspiler {\n\n getChecker(): Checker {\n return memoizeJavaCheckerCalls(super.getChecker());\n }\n\n // override lookups repeat per method on every printed call and hook; the answer is fixed per node\n private methodOverrideCache = new WeakMap();\n getMethodOverride(node: Node): Node {\n if (node === undefined || node === null) {\n return super.getMethodOverride(node);\n }\n const cached = this.methodOverrideCache.get(node);\n if (cached !== undefined) {\n return cached === JAVA_MEMO_UNDEFINED ? undefined : cached;\n }\n const result = this.javaMethodOverrideFromIndex(node);\n this.methodOverrideCache.set(node, result === undefined ? JAVA_MEMO_UNDEFINED : result);\n return result;\n }\n\n // BaseTranspiler.getMethodOverride answered from a per-class ancestor chain of\n // name -> last method maps (the furthest ancestor declaring the name wins, as there)\n private overrideChainCache = new WeakMap[] | null>();\n private javaMethodOverrideFromIndex(node: Node): Node {\n const classDeclaration = node.parent;\n if (!isClassDeclaration(classDeclaration) || !(classDeclaration as any).heritageClauses) {\n return undefined;\n }\n let chain = this.overrideChainCache.get(classDeclaration);\n if (chain === undefined) {\n chain = [];\n let parentClass = getAllSuperTypeNodes(classDeclaration)[0];\n while (parentClass !== undefined) {\n const parentClassDecl = this.getChecker().getTypeAtLocation(parentClass)?.getSymbol()?.valueDeclaration?.resolve();\n if (parentClassDecl === undefined) {\n chain = null; // the base path warns and answers undefined\n break;\n }\n const byName = new Map();\n for (const elem of (parentClassDecl as any).members ?? []) {\n if (isMethodDeclaration(elem)) {\n byName.set(elem.name.getText().trim(), elem);\n }\n }\n chain.push(byName);\n parentClass = getAllSuperTypeNodes(parentClassDecl)[0] ?? undefined;\n }\n this.overrideChainCache.set(classDeclaration, chain);\n }\n if (chain === null) {\n return super.getMethodOverride(node);\n }\n const name = (node as any).name.text;\n let method = undefined;\n for (const byName of chain) {\n method = byName.get(name) ?? method;\n }\n return method;\n }\n\n checkerOrUndefined(): Checker | undefined {\n const checker = super.checkerOrUndefined();\n return checker === undefined ? undefined : memoizeJavaCheckerCalls(checker);\n }\n\n // optional proof of the concrete printed Java type of an expression, installed by the embedding\n // build layer for the locals it retypes (ccxt: build/java-local-types.js); it must match the\n // declared type or the operator will not compile. Only `String` is consumed (native `+` anchor).\n javaExpressionTypeResolver?: (node) => string | undefined;\n\n // the embedding build layer (build/java-local-types.js) installs this: it names the\n // Java type of a local whose printed declaration line it rewrote (`Long`/`Double`).\n // The arithmetic rule reads it for identifier operands only.\n\n countRequiredParameters(declaration) {\n // parameters with no default, no question token and no rest are required positionally\n return (declaration?.parameters ?? [])\n .filter((p) => p.initializer === undefined && p.questionToken === undefined && p.dotDotDotToken === undefined).length;\n }\n\n printArgsForCallExpression(node, identation) {\n const fullArity = this.javaFullArityCallArguments(node.arguments ?? [], node, identation);\n if (fullArity !== undefined) {\n return fullArity;\n }\n let args: readonly any[] = node.arguments ?? [];\n const callee = node.expression;\n const isThisCall = callee?.kind === SyntaxKind.PropertyAccessExpression\n && callee.expression?.kind === SyntaxKind.ThisKeyword;\n if (isThisCall && args.length > 0) {\n const last = args[args.length - 1];\n const isNullish = last.kind === SyntaxKind.NullKeyword\n || (last.kind === SyntaxKind.Identifier && last.text === 'undefined');\n // the trailing nullish may only be dropped when it sits in the OPTIONAL tail\n // of the resolved signature - a required positional parameter passed as an\n // explicit undefined (e.g. dydx signDydxTx) must be kept, otherwise the\n // emitted call breaks arity, see https://github.com/ccxt/ccxt/actions/runs/31321542066\n let inOptionalTail = false;\n if (isNullish) {\n const signature = this.getChecker().getResolvedSignature(node);\n const declaration = signature?.declaration?.resolve();\n if (declaration !== undefined) {\n inOptionalTail = args.length > this.countRequiredParameters(declaration);\n }\n }\n if (isNullish && inOptionalTail) {\n // drop exactly one trailing null/undefined argument: the generated java\n // surface is uniformly (required..., Object... optionals), and a bare\n // trailing null is ambiguous to javac (\"non-varargs call of varargs\n // method with inexact argument type for last parameter\"). Omission is\n // behaviorally identical - both Helpers.getArg and SafeMethods.opt\n // treat a null varargs array and an empty one the same, see\n // https://github.com/ccxt/ccxt/pull/29617 for the warning inventory\n args = args.slice(0, -1);\n }\n }\n return this.javaPrintCallArguments(args, node, identation);\n }\n\n // a call into a method whose fixed parameter prints a native type: generated locals are `Object`,\n // so the argument carries the same checkcast as native map/string reads. The checker proved the\n // argument assignable to the parameter, so the declared type describes the value received.\n javaPrintCallArguments(args, node, identation) {\n const superCore = this.javaSuperCoreCallArguments(args, node, identation);\n if (superCore !== undefined) {\n return superCore;\n }\n const scheduled = this.javaScheduledCallArguments(args, node, identation);\n if (scheduled !== undefined) {\n return scheduled;\n }\n const spawnTypes = this.javaSpawnCallParameterTypes(node);\n const parameterTypes = spawnTypes !== undefined ? spawnTypes : this.javaNativeCallParameterTypes(node);\n return args.map((a, i) => {\n const parsedArg = this.printNode(a, identation).trim();\n const type = parameterTypes[i];\n if (type === undefined || this.javaNativeArgumentAlreadyTyped(a, type)) {\n return parsedArg;\n }\n // the checkcast carries its own parentheses: a bare `(T) cond ? a : b` binds the\n // condition, not the whole argument\n return `(${type}) (${parsedArg})`;\n }).join(\", \");\n }\n\n // the implementation declaration of a resolved method (an overload signature has no body)\n javaMethodImplementation(declaration) {\n if (declaration === undefined || !isMethodDeclaration(declaration)) {\n return undefined;\n }\n if (declaration.body !== undefined) {\n return declaration;\n }\n try {\n const symbol = this.getChecker().getSymbolAtLocation(declaration.name);\n return symbol?.declarations?.map((d) => d.resolve()).find((d) => isMethodDeclaration(d) && d.body !== undefined);\n } catch (e) {\n return undefined;\n }\n }\n\n // a method this printer emits with its single typed signature: hand-written Java declares\n // ts/src/base/** except the base tiers below their transpile delimiter\n javaIsPrintedMethod(method): boolean {\n if (method === undefined || !isMethodDeclaration(method) || method.body === undefined\n || !isClassDeclaration(method.parent)) {\n return false;\n }\n const file = method.getSourceFile();\n const fileName = file.fileName.replace(/\\\\/g, '/');\n if (!/(^|\\/)ts\\/src\\//.test(fileName)) {\n return true;\n }\n if (JAVA_NATIVE_PARAMETER_BASE_FILES.test(fileName)) {\n const delimiter = file.text.indexOf(JAVA_TRANSPILE_DELIMITER);\n return (delimiter >= 0 && method.pos > delimiter)\n || JAVA_HANDWRITTEN_FULL_ARITY.has((method.name as any)?.text);\n }\n // every class outside the hand-written tiers is printed (exchanges, tests, ...)\n return !JAVA_HANDWRITTEN_TIER_FILES.test(fileName);\n }\n\n javaHasOptionalParameter(method): boolean {\n return (method?.parameters ?? []).some((p) => p.initializer !== undefined || p.questionToken !== undefined);\n }\n\n // a call into a printed method with optional parameters passes every parameter: omitted or\n // `undefined` slots take the TS default, fixed slots keep the native checkcast\n javaFullArityCallArguments(args, node, identation): string | undefined {\n const callee = node.expression;\n if (callee?.kind !== SyntaxKind.PropertyAccessExpression\n || callee.expression?.kind === SyntaxKind.SuperKeyword) {\n return undefined;\n }\n let method;\n try {\n method = this.javaMethodImplementation(this.getChecker().getResolvedSignature(node)?.declaration?.resolve())\n ?? this.javaAnyReceiverBaseMethod(callee);\n } catch (e) {\n return undefined;\n }\n return this.javaFullArityArguments(method, args, identation);\n }\n\n // an `any` receiver (the tests' `exchange: any`) compiles against the Java Exchange class:\n // bind the base Exchange method of that name when it is implemented exactly once\n javaAnyReceiverBaseMethod(callee) {\n const type = this.getChecker().getTypeAtLocation(callee.expression);\n if ((type.flags & TypeFlags.Any) === 0) {\n return undefined;\n }\n const methods = this.baseExchangeMethodsByName().get(callee.name?.text as string);\n return methods?.length === 1 ? methods[0] : undefined;\n }\n\n private _baseExchangeMethodsByName = new WeakMap>();\n baseExchangeMethodsByName(): Map {\n const program = this.getProgram();\n const cached = this._baseExchangeMethodsByName.get(program);\n if (cached !== undefined) {\n return cached;\n }\n const names = new Map();\n const fileName = program.getSourceFileNames()\n .find((f) => /(^|[\\\\/])ts[\\\\/]src[\\\\/]base[\\\\/]Exchange\\.ts$/.test(f));\n const file = fileName !== undefined ? program.getSourceFile(fileName) : undefined;\n // the implementations live on BaseExchange; Exchange only adds its own tier, and a name\n // the base class implements binds there (the receiver compiles against BaseExchange)\n for (const className of ['BaseExchange', 'Exchange']) {\n const cls = file?.statements.find((s) => isClassDeclaration(s) && s.name?.text === className) as any;\n const own = new Map();\n for (const member of cls?.members ?? []) {\n if (isMethodDeclaration(member) && member.body !== undefined && isIdentifier(member.name)) {\n own.set(member.name.text, (own.get(member.name.text) ?? []).concat([member]));\n }\n }\n own.forEach((methods, key) => names.has(key) || names.set(key, methods));\n }\n this._baseExchangeMethodsByName.set(program, names);\n return names;\n }\n\n javaFullArityArguments(method, args, identation): string | undefined {\n if (!this.javaIsPrintedMethod(method) || !this.javaHasOptionalParameter(method)) {\n return undefined;\n }\n const params = method.parameters;\n if (args.length > params.length || params.some((p) => p.dotDotDotToken !== undefined)\n || args.some((a) => a.kind === SyntaxKind.SpreadElement)) {\n return undefined;\n }\n const types = this.javaCoreParameterTypes(method);\n return params.map((p, i) => {\n const arg = args[i];\n if (arg === undefined || (p.initializer !== undefined && this.javaIsUndefinedLiteral(arg))) {\n return this.javaCoreDefaultArgument(p, types[i]);\n }\n const printed = this.printNode(arg, identation).trim();\n if (p.initializer !== undefined) {\n return this.javaArgumentHasType(arg, types[i]) || types[i] === 'Object'\n ? (this.javaIsUndefinedLiteral(arg) ? 'null' : printed)\n : this.javaConvertToCoreType(types[i], printed, arg);\n }\n const native = this.javaNativeParameterType(p);\n if (native === undefined || this.javaNativeArgumentAlreadyTyped(arg, native)) {\n return printed;\n }\n return `(${native}) (${printed})`;\n }).join(', ');\n }\n\n javaIsUndefinedLiteral(node): boolean {\n return node?.kind === SyntaxKind.Identifier && node.text === 'undefined';\n }\n\n // `this.spawn(this.m, a..)` / `this.delay(ms, this.m, a..)`: the ccxt post-pass turns the\n // reference into a lambda calling `this.m(a..)`, so those arguments take m's full arity\n javaScheduledCallArguments(args, node, identation): string | undefined {\n const callee = node.expression;\n if (callee?.kind !== SyntaxKind.PropertyAccessExpression\n || callee.expression?.kind !== SyntaxKind.ThisKeyword) {\n return undefined;\n }\n const at = callee.name?.text === 'spawn' ? 0 : (callee.name?.text === 'delay' ? 1 : -1);\n const reference = at >= 0 ? args[at] : undefined;\n if (reference?.kind !== SyntaxKind.PropertyAccessExpression\n || reference.expression?.kind !== SyntaxKind.ThisKeyword) {\n return undefined;\n }\n let method;\n try {\n const symbol = this.getChecker().getSymbolAtLocation(reference.name);\n method = this.javaMethodImplementation(symbol?.valueDeclaration?.resolve() ?? symbol?.declarations?.[0]?.resolve());\n } catch (e) {\n return undefined;\n }\n const forwarded = this.javaFullArityArguments(method, args.slice(at + 1), identation);\n if (forwarded === undefined) {\n return undefined;\n }\n const head = args.slice(0, at + 1).map((a) => this.printNode(a, identation).trim());\n return head.concat(forwarded.length > 0 ? [forwarded] : []).join(', ');\n }\n\n // `super.x(..)` into a split method must bind the typed core: an ancestor bridge re-dispatches\n // through `this`, which lands back in the overriding core (infinite recursion)\n javaSuperCoreCallArguments(args, node, identation): string | undefined {\n const callee = node.expression;\n if (callee?.kind !== SyntaxKind.PropertyAccessExpression\n || callee.expression?.kind !== SyntaxKind.SuperKeyword) {\n return undefined;\n }\n let declaration;\n try {\n declaration = this.javaMethodImplementation(this.getChecker().getResolvedSignature(node)?.declaration?.resolve());\n } catch (e) {\n return undefined;\n }\n if (declaration === undefined || !this.hasDefaultedTail(declaration)) {\n return undefined;\n }\n const params = (declaration as any).parameters;\n if (params.some((p) => p.dotDotDotToken !== undefined)) {\n return undefined;\n }\n if (args.length > params.length) {\n return undefined;\n }\n const types = this.javaCoreParameterTypes(declaration);\n return params.map((p, i) => (i < args.length\n ? (this.javaArgumentHasType(args[i], types[i]) ? this.printNode(args[i], identation).trim()\n : this.javaConvertToCoreType(types[i], this.printNode(args[i], identation).trim(), args[i]))\n : this.javaCoreDefaultArgument(p, types[i]))).join(', ');\n }\n\n // an argument that is a parameter of the enclosing method already printed with this type\n javaArgumentHasType(arg, type: string): boolean {\n if (arg?.kind !== SyntaxKind.Identifier) {\n return false;\n }\n let declaration;\n try {\n declaration = this.getChecker().getSymbolAtLocation(arg)?.valueDeclaration?.resolve();\n } catch (e) {\n return false;\n }\n if (declaration === undefined || !isParameterDeclaration(declaration)) {\n return false;\n }\n const method = declaration.parent;\n if (!isMethodDeclaration(method) && this.ReassignedVars[this.getVarKey(declaration)] && this.isAsyncFunction(method)) {\n return false; // an async function body reads an `Object` copy\n }\n const printed = declaration.initializer !== undefined\n ? (this.hasDefaultedTail(method) ? this.javaOptionalParameterJavaType(declaration) : 'Object')\n : (this.printParameterType(declaration) || 'Object').trim();\n return this.javaErasure(printed) === this.javaErasure(type);\n }\n\n // the printed Java type of every parameter of a split method's typed core\n javaCoreParameterTypes(method): string[] {\n return method.parameters.map((p) => (p.initializer !== undefined\n ? this.javaOptionalParameterJavaType(p)\n : (this.printParameterType(p) || 'Object').trim()));\n }\n\n // an omitted parameter of a typed-core call: its TS default, typed like the front's reader\n javaCoreDefaultArgument(param, type: string): string {\n const initializer = param.initializer;\n // a default that reads other parameters or has effects is applied by the callee\n const value = initializer === undefined || !this.isPureInitializer(initializer) ? 'null' : this.printNode(initializer, 0);\n if (value === 'null') {\n return `(${type}) null`;\n }\n if (type === 'Long' && /^-?\\d+$/.test(value)) {\n return value + 'L';\n }\n if (type === JAVA_STRING_LIST_TYPE && isArrayLiteralExpression(initializer) && initializer.elements.length === 0) {\n return 'new java.util.ArrayList()';\n }\n if (type === 'Object' || (type === 'String' && isStringLiteralLikeNode(initializer))\n || (type === 'java.util.Map' && isObjectLiteralExpression(initializer))) {\n return value;\n }\n return this.javaConvertToCoreType(type, value, initializer);\n }\n\n // a value of any static type converted to a typed-core parameter, with the fronts' semantics\n javaConvertToCoreType(type: string, printed: string, node): string {\n if (node?.kind === SyntaxKind.NullKeyword\n || (node?.kind === SyntaxKind.Identifier && node.text === 'undefined')) {\n return `(${type}) null`;\n }\n if (type === 'Object') {\n return `(Object) (${printed})`;\n }\n if (this.javaLocalDeclaredAs(node, printed, type)) {\n return printed;\n }\n if (type === 'Long') {\n if (/^-?\\d+$/.test(printed) && isNumericLiteral(isPrefixUnaryExpression(node) ? node.operand : node)) {\n return printed + 'L';\n }\n return /^-?\\d+L$/.test(printed) ? printed : `Helpers.toLongOrNull(${printed})`;\n }\n if (type === 'String') {\n return this.javaNativeArgumentAlreadyTyped(node, type) ? printed : `Helpers.toStringArg(${printed})`;\n }\n if (type === 'java.util.Map') {\n return `Helpers.toMapArg(${printed})`;\n }\n if (type === JAVA_STRING_LIST_TYPE) {\n return `Helpers.toStringListArg(${printed})`;\n }\n return `(${type}) (${printed})`;\n }\n\n // an identifier whose final Java declaration (the build layer's table, or a natively typed\n // parameter) is exactly the core type and which prints under its own name: no conversion\n javaLocalDeclaredAs(node, printed: string, type: string): boolean {\n if (node === undefined || !isIdentifier(node) || printed !== node.text) {\n return false;\n }\n const declaration = this.javaDeclarationOfIdentifier(node);\n if (declaration === undefined || !isVariableDeclaration(declaration)) {\n return this.javaArgumentHasType(node, type)\n && (type !== JAVA_STRING_LIST_TYPE || this.javaDeclaredTypeOf(node) === JAVA_STRING_LIST_TYPE);\n }\n const declared = this.javaDeclaredTypeOf(node);\n return declared !== undefined && declared.replace(/\\s+/g, '').replace(/^java\\.util\\./, '')\n === type.replace(/\\s+/g, '').replace(/^java\\.util\\./, '');\n }\n\n // Java erasure of a printed type, for override/bridge comparisons\n javaErasure(type: string): string {\n return type.replace(/<.*>/, '').replace(/^java\\.util\\./, '').trim();\n }\n\n // An override whose typed core differs from an ancestor's (another parameter count, another\n // default position or type) no longer overrides it in Java: a bridge with the ancestor's\n // signature forwards to this method, so base code calling the ancestor core reaches it.\n printOverrideBridges(node, identation): string {\n const ownTypes = this.javaCoreParameterTypes(node);\n const ownKey = ownTypes.map((t) => this.javaErasure(t)).join(',');\n const seen = new Set();\n let out = '';\n let ancestor;\n try {\n ancestor = this.getMethodOverride(node);\n } catch (e) {\n return '';\n }\n while (ancestor !== undefined) {\n if (this.hasDefaultedTail(ancestor)) {\n const ancestorTypes = this.javaCoreParameterTypes(ancestor);\n const key = ancestorTypes.map((t) => this.javaErasure(t)).join(',');\n if (key !== ownKey && !seen.has(key)) {\n seen.add(key);\n out += this.printOverrideBridge(node, ancestor, ancestorTypes, ownTypes, identation);\n }\n }\n try {\n ancestor = this.getMethodOverride(ancestor);\n } catch (e) {\n ancestor = undefined;\n }\n }\n return out;\n }\n\n printOverrideBridge(node, ancestor, ancestorTypes: string[], ownTypes: string[], identation): string {\n const name = this.transformMethodNameIfNeeded(node.name.text);\n const ancestorNames = ancestor.parameters.map((p) => this.printNode(p.name, 0));\n const ancestorDef = this.printMethodDefinition(ancestor, identation,\n () => ancestorTypes.map((t, i) => `${t} ${ancestorNames[i]}`).join(', '));\n const forwarded = node.parameters.map((p, i) => (i < ancestorNames.length\n ? (this.javaErasure(ownTypes[i]) === this.javaErasure(ancestorTypes[i]) ? ancestorNames[i]\n : this.javaConvertToCoreType(ownTypes[i], ancestorNames[i], undefined))\n : this.javaCoreDefaultArgument(p, ownTypes[i]))).join(', ');\n const call = `this.${name}(${forwarded})`;\n const returnOf = (def: string) => def.match(/(?:public|protected|private)\\s+(?:static\\s+)?(.+?)\\s+\\w+\\s*\\(/)?.[1]?.trim() ?? 'Object';\n const returnType = returnOf(ancestorDef);\n const ownReturn = returnOf(this.printMethodDefinition(node, identation, () => ''));\n const body = returnType === 'void' ? `${call};`\n : returnType === ownReturn ? `return ${call};` : `return (${returnType}) (Object) ${call};`;\n return \"\\n\" + ancestorDef + this.getBlockOpen(identation)\n + this.getIden(identation + 1) + body\n + this.getBlockClose(identation);\n }\n\n // `this.spawn(this.someMethod, args...)`: the spawned work executes `this.someMethod(args)`\n // (the ccxt post-pass rewrites the reference into a lambda), so the arguments belong to the\n // referenced method's signature, not to spawn's `...args` - each one carries the checkcast\n javaSpawnCallParameterTypes(node): (string | undefined)[] | undefined {\n const callee = node.expression;\n if (callee?.kind !== SyntaxKind.PropertyAccessExpression\n || callee.expression?.kind !== SyntaxKind.ThisKeyword\n || callee.name?.text !== 'spawn') {\n return undefined;\n }\n const reference = (node.arguments ?? [])[0];\n if (reference?.kind !== SyntaxKind.PropertyAccessExpression\n || reference.expression?.kind !== SyntaxKind.ThisKeyword\n || reference.name?.text === undefined) {\n return undefined;\n }\n let declaration;\n try {\n const symbol = this.getChecker().getSymbolAtLocation(reference.name);\n declaration = symbol?.valueDeclaration?.resolve() ?? symbol?.declarations?.[0]?.resolve();\n } catch (e) {\n return undefined;\n }\n const parameters = (declaration as any)?.parameters;\n if (parameters === undefined) {\n return undefined;\n }\n return (node.arguments ?? []).map((a, i) => {\n if (i === 0) {\n return undefined;\n }\n const param = parameters[i - 1];\n if (param === undefined || !isParameterDeclaration(param)) {\n return undefined;\n }\n return this.javaNativeParameterType(param);\n });\n }\n\n // the argument is a literal (or a String the embedding build layer's resolver proves)\n // and the parameter declares exactly that type, so no cast is needed. Every other\n // argument prints from a local the printer declares `Object`, and needs the checkcast.\n javaNativeArgumentAlreadyTyped(arg, type: string) {\n if (arg.kind === SyntaxKind.NullKeyword) {\n return true;\n }\n // an object literal prints a `HashMap` instance, already a Map\n if (type === JAVA_NATIVE_RETURN_MAP_TYPE && isObjectLiteralExpression(arg)) {\n return true;\n }\n if (type !== 'String') {\n return false;\n }\n if (isStringLiteralLikeNode(arg)) {\n return true;\n }\n return this.javaProvableString(arg);\n }\n\n // the native printed type of each argument position of a call, when the resolved\n // signature declares that parameter natively\n javaNativeCallParameterTypes(node): (string | undefined)[] {\n const checker: any = this.checkerOrUndefined();\n if (checker === undefined) {\n return [];\n }\n const declaration = checker.getResolvedSignature(node)?.declaration?.resolve();\n const parameters = (declaration as any)?.parameters;\n if (parameters === undefined) {\n return [];\n }\n return (node.arguments ?? []).map((a, i) => {\n const param = parameters[i];\n if (param === undefined || !isParameterDeclaration(param)) {\n return undefined;\n }\n return this.javaNativeParameterType(param);\n });\n }\n\n binaryExpressionsWrappers;\n\n varListFromObjectLiterals = {};\n // binary operators whose printed Java is a primitive boolean: Helpers.isEqual (and the\n // negated `!Helpers.isEqual` / `<` / `>` / `<=` / `>=` family), Helpers.inOp,\n // Helpers.isInstance and the native `&&` / `||`\n javaBooleanOperators = Array.from(JAVA_BOOLEAN_OPERATOR_KINDS);\n // Per-function analysis results. Populated by analyzeFinalVars at the start of\n // printFunctionBody and consumed during printing of the same function body.\n usageToFinalName: WeakMap = new WeakMap();\n // Stack of emitted-finalName sets, one entry per enclosing block. Pushed on block\n // entry, popped on exit. Used by buildFinalVarDeclarations to dedup: skip if the\n // finalName is already in scope via any ancestor.\n finalVarScopeStack: Array> = [];\n // Identifiers rewritten in place to their finalXxx name during the current emit.\n // The parsed ts.SourceFile is cached and reused across transpile calls, so the\n // rewrite has to be undone when the emit ends — otherwise a second emit of the\n // same file reads `finalX` where the first read `x`, the symbol no longer\n // resolves, and the hoisted `final Object finalX = x;` declaration is dropped\n // while its usages remain.\n finalVarMutations: Array<{ node: any; text: any; ownGetFullText: boolean; getFullText: any }> = [];\n // Java expression passed as the second supplyAsync argument for async methods.\n // Empty (the default) emits the single-argument, common-pool supplyAsync form.\n asyncExecutor = '';\n // Static method emitted in place of java.util.concurrent.CompletableFuture.supplyAsync\n // for async methods. The callee owns the executor choice, so no second argument is emitted.\n asyncSupplier = '';\n\n constructor(config = {}) {\n config[\"parser\"] = Object.assign({}, parserConfig, config[\"parser\"] ?? {});\n super(config);\n\n this.requiresParameterType = true;\n this.requiresReturnType = true;\n this.asyncTranspiling = true;\n this.implicitAsyncTranspiling = true;\n this.supportsFalsyOrTruthyValues = false;\n this.requiresCallExpressionCast = true;\n this.id = \"Java\";\n\n this.initConfig();\n this.applyUserOverrides(config);\n this.asyncExecutor = config['asyncExecutor'] ?? '';\n this.asyncSupplier = config['asyncSupplier'] ?? '';\n }\n\n initConfig() {\n this.LeftPropertyAccessReplacements = {\n // 'this': '$this',\n };\n\n this.RightPropertyAccessReplacements = {\n // Java list/string methods (lowerCamelCase)\n push: \"add\",\n indexOf: \"indexOf\",\n toUpperCase: \"toUpperCase\",\n toLowerCase: \"toLowerCase\",\n toString: \"toString\",\n };\n\n this.FullPropertyAccessReplacements = {\n \"JSON.parse\": \"parseJson\",\n \"console.log\": \"System.out.println\",\n \"Number.MAX_SAFE_INTEGER\": \"Long.MAX_VALUE\",\n \"Math.min\": \"Math.min\",\n \"Math.max\": \"Math.max\",\n \"Math.log\": \"Math.log\",\n \"Math.abs\": \"Math.abs\",\n \"Math.floor\": \"Math.floor\",\n \"Math.pow\": \"Math.pow\",\n // 'Promise.all' handled via promiseAll wrapper\n };\n\n this.CallExpressionReplacements = {\n 'parseInt': \"Helpers.parseInt\",\n \"parseFloat\": \"Helpers.parseFloat\",\n // Add ad-hoc function call rewrites here if you need them\n };\n\n\n this.ReservedKeywordsReplacements = {\n string: \"str\",\n object: \"obj\",\n params: \"parameters\",\n // base: \"bs\",\n internal: \"intern\",\n event: \"eventVar\",\n fixed: \"fixedVar\",\n final: \"finalVar\",\n native: \"nativeVar\",\n // add Java keywords if you need to avoid collisions (e.g., enum, assert)\n };\n\n this.VariableTypeReplacements = {\n string: \"String\",\n Str: \"String\",\n number: \"double\",\n Int: \"long\",\n Num: \"double\",\n Dict: \"java.util.Map\",\n Strings: \"java.util.List\",\n List: \"java.util.List\",\n boolean: \"boolean\",\n object: \"Object\",\n };\n\n this.ArgTypeReplacements = { ...this.VariableTypeReplacements };\n\n this.binaryExpressionsWrappers = {\n [SyntaxKind.EqualsEqualsToken]: [this.EQUALS_EQUALS_WRAPPER_OPEN, this.EQUALS_EQUALS_WRAPPER_CLOSE],\n [SyntaxKind.EqualsEqualsEqualsToken]: [this.EQUALS_EQUALS_WRAPPER_OPEN, this.EQUALS_EQUALS_WRAPPER_CLOSE],\n [SyntaxKind.ExclamationEqualsToken]: [this.DIFFERENT_WRAPPER_OPEN, this.DIFFERENT_WRAPPER_CLOSE],\n [SyntaxKind.ExclamationEqualsEqualsToken]: [this.DIFFERENT_WRAPPER_OPEN, this.DIFFERENT_WRAPPER_CLOSE],\n [SyntaxKind.GreaterThanToken]: [this.GREATER_THAN_WRAPPER_OPEN, this.GREATER_THAN_WRAPPER_CLOSE],\n [SyntaxKind.GreaterThanEqualsToken]: [this.GREATER_THAN_EQUALS_WRAPPER_OPEN, this.GREATER_THAN_EQUALS_WRAPPER_CLOSE],\n [SyntaxKind.LessThanToken]: [this.LESS_THAN_WRAPPER_OPEN, this.LESS_THAN_WRAPPER_CLOSE],\n [SyntaxKind.LessThanEqualsToken]: [this.LESS_THAN_EQUALS_WRAPPER_OPEN, this.LESS_THAN_EQUALS_WRAPPER_CLOSE],\n [SyntaxKind.PlusToken]: [this.PLUS_WRAPPER_OPEN, this.PLUS_WRAPPER_CLOSE],\n [SyntaxKind.MinusToken]: [this.MINUS_WRAPPER_OPEN, this.MINUS_WRAPPER_CLOSE],\n [SyntaxKind.AsteriskToken]: [this.MULTIPLY_WRAPPER_OPEN, this.MULTIPLY_WRAPPER_CLOSE],\n [SyntaxKind.PercentToken]: [this.MOD_WRAPPER_OPEN, this.MOD_WRAPPER_CLOSE],\n [SyntaxKind.SlashToken]: [this.DIVIDE_WRAPPER_OPEN, this.DIVIDE_WRAPPER_CLOSE],\n };\n }\n\n getBlockOpen(identation) {\n return \"\\n\" + this.getIden(identation) + this.BLOCK_OPENING_TOKEN + \"\\n\";\n }\n\n\n getCustomClassName(node) {\n return this.capitalize(node.name.text);\n }\n\n getClassModifier(node) {\n return \"public \";\n }\n\n printSuperCallInsideConstructor(_node, _identation) {\n // Java allows \"super(...)\" as the first line; we already inject it when needed.\n return \"\";\n }\n\n printNumericLiteral(node) {\n const javaMax = 2147483647;\n const nodeText = node.text;\n if (Number(nodeText) > javaMax && Number.isInteger(Number(nodeText)) && node.text.indexOf('e') === -1) {\n return `${nodeText}L`;\n }\n return node.text;\n }\n\n printIdentifier(node) {\n let idValue = node.text ?? node.text;\n\n if (this.ReservedKeywordsReplacements[idValue]) {\n idValue = this.ReservedKeywordsReplacements[idValue];\n }\n\n if (idValue === \"undefined\") {\n return this.UNDEFINED_TOKEN;\n }\n\n const defaulted = this.javaDefaultedLocalName(node);\n if (defaulted !== undefined) {\n return defaulted;\n }\n\n // keep the same class-reference typeof-guarding logic as your original file,\n // but run the syntactic (parent-position) checks first: they exclude the vast\n // majority of identifiers without paying for a type-checker lookup\n const isInsideNewExpression =\n node?.parent?.kind === SyntaxKind.NewExpression;\n const isInsideCatch =\n node?.parent?.kind === SyntaxKind.ThrowStatement;\n const isLeftSide =\n node?.parent?.name === node || node?.parent?.left === node;\n const isCallOrPropertyAccess =\n node?.parent?.kind === SyntaxKind.PropertyAccessExpression ||\n node?.parent?.kind === SyntaxKind.ElementAccessExpression;\n if (!isLeftSide && !isCallOrPropertyAccess && !isInsideCatch && !isInsideNewExpression) {\n const type = this.getChecker().getTypeAtLocation(node);\n const typeSymbol = type?.getSymbol?.();\n if (typeSymbol !== undefined) {\n const decl = (typeSymbol?.declarations ?? []).map((d) => d.resolve());\n if (decl.length > 0 && decl[0].getSourceFile().fileName.indexOf(\"typescript\") === -1) {\n const symbol = this.getChecker().getSymbolAtLocation(node);\n const first = symbol?.declarations[0]?.resolve();\n const isClassDeclaration = !!symbol && (first.kind === SyntaxKind.ClassDeclaration\n || (first.kind === SyntaxKind.ImportSpecifier\n && this.getChecker().getAliasedSymbol(symbol)?.declarations[0]?.resolve()?.kind === SyntaxKind.ClassDeclaration));\n if (isClassDeclaration) {\n return `${idValue}.class`;\n }\n }\n }\n }\n\n return this.transformIdentifier(node, idValue);\n }\n\n printConstructorDeclaration(node, identation) {\n const classNode = node.parent;\n const className = this.printNode(classNode.name, 0);\n const args = this.printMethodParameters(node);\n const constructorBody = this.printFunctionBody(node, identation);\n\n // find super call inside constructor and extract params\n let superCallParams = \"\";\n let hasSuperCall = false;\n node.body?.statements.forEach((statement) => {\n const expression = isExpressionStatement(statement) ? statement.expression : undefined;\n if (expression && isCallExpression(expression) && expression.expression.getText().trim() === \"super\") {\n hasSuperCall = true;\n superCallParams = expression.arguments.map((a) => this.printNode(a, identation).trim()).join(\", \");\n }\n });\n\n const header = this.getIden(identation) + className + \"(\" + args + \")\";\n // In Java, super(...) must be the first statement inside the body.\n return header + (hasSuperCall ? this.injectLeadingInBody(constructorBody, `super(${superCallParams});`) : constructorBody);\n }\n\n injectLeadingInBody(body, firstLine) {\n // body is \"{\\n ...\\n}\"\n const lines = body.split(\"\\n\");\n if (lines.length >= 2) {\n lines.splice(1, 0, this.getIden(1) + firstLine);\n }\n return lines.join(\"\\n\");\n }\n\n printDynamicCall(node, identation) {\n // Use reflection helper exactly like before; Java runtime should provide callDynamically(Object, String, Object[])\n const elementAccess = node.expression;\n if (elementAccess?.kind === SyntaxKind.ElementAccessExpression) {\n const parsedArg = node.arguments?.map((n) => this.printNode(n, identation).trimStart()).join(\", \") ?? \"\";\n const target = this.printNode(elementAccess.expression, 0);\n const propName = this.printNode(elementAccess.argumentExpression, 0);\n return `${this.DYNAMIC_CALL_OPEN}${target}, ${propName}, new Object[] { ${parsedArg} })`;\n }\n return undefined;\n }\n\n // printElementAccessExpressionExceptionIfAny(node) {\n // const tsKind = ts.SyntaxKind;\n // if (node.expression.kind === tsKind.CallExpression) {\n // const callExp = node.expression;\n // const calleeText = callExp.expression.getText();\n // if (calleeText.endsWith('.split') || calleeText.toLowerCase().includes('split')) {\n // // print Split call normally (should already close with ))\n // let splitCall = this.printNode(callExp, 0).trim();\n // if (!splitCall.endsWith(')')) {\n // splitCall += ')';\n // }\n // const idxArg = this.printNode(node.argumentExpression, 0);\n // return `GetValue(${splitCall}, ${idxArg})`;\n // }\n // }\n // // default: no exception\n // return undefined;\n // }\n\n printWrappedUnknownThisProperty(node) {\n const type = this.getChecker().getResolvedSignature(node);\n if (type?.declaration === undefined) {\n const parsedArguments = node.arguments?.map((a) => this.printNode(a, 0)).join(\", \") || \"\";\n const propName = node.expression?.name.text;\n return `${this.DYNAMIC_CALL_OPEN}this, \"${propName}\", new Object[] { ${parsedArguments} })`;\n }\n return undefined;\n }\n\n printOutOfOrderCallExpressionIfAny(node, identation) {\n if (node.expression.kind === SyntaxKind.Identifier) {\n const callee = node.expression.text;\n if (callee === 'parseInt' || callee === 'parseFloat') {\n const nativeParse = this.printNativeScalarParse(node, callee);\n if (nativeParse !== undefined) {\n return nativeParse;\n }\n }\n }\n if (node.expression.kind === SyntaxKind.PropertyAccessExpression) {\n const expressionText = node.expression.getText().trim();\n const args = node.arguments;\n if (args.length === 1) {\n const parsedArg = this.printNode(args[0], 0);\n switch (expressionText) {\n case \"Math.abs\":\n return `Helpers.mathAbs(Double.parseDouble(${this.javaStringBoxText(args[0], parsedArg)}))`;\n }\n } else if (args.length === 2) {\n const parsedArg1 = this.printNode(args[0], 0);\n const parsedArg2 = this.printNode(args[1], 0);\n switch (expressionText) {\n case \"Math.min\":\n case \"Math.max\": {\n const native = this.printNativeMathMinMax(\n node, args[0], args[1], parsedArg1, parsedArg2, expressionText === \"Math.min\" ? \"min\" : \"max\");\n if (native !== undefined) {\n return native;\n }\n const wrapper = expressionText === \"Math.min\" ? \"Helpers.mathMin(\" : \"Helpers.mathMax(\";\n return `${wrapper}${parsedArg1}, ${parsedArg2})`;\n }\n case \"Math.pow\":\n // both arguments are Double.parseDouble results, so Helpers.mathPow always\n // takes its Number branch and returns the same double java.lang.Math.pow does\n return `Math.pow(Double.parseDouble(${this.javaStringBoxText(args[0], parsedArg1)}), Double.parseDouble(${this.javaStringBoxText(args[1], parsedArg2)}))`;\n }\n }\n const leftSide = node.expression?.expression;\n const leftSideText = leftSide ? this.printNode(leftSide, 0) : undefined;\n\n // wrap unknown property this.X calls\n if (\n leftSideText === this.THIS_TOKEN ||\n leftSide.getFullText().indexOf(\"(this as any)\") > -1\n ) {\n const res = this.printWrappedUnknownThisProperty(node);\n if (res) return res;\n }\n }\n\n // dynamic call: obj[prop](...)\n if (node.expression.kind === SyntaxKind.ElementAccessExpression) {\n return this.printDynamicCall(node, identation);\n }\n\n return undefined;\n }\n\n handleTypeOfInsideBinaryExpression(node, _identation) {\n const left = node.left;\n const right = node.right.text;\n const op = node.operatorToken.kind;\n const expression = left.expression;\n\n const isDifferentOperator =\n op === SyntaxKind.ExclamationEqualsEqualsToken ||\n op === SyntaxKind.ExclamationEqualsToken;\n const notOperator = isDifferentOperator ? this.NOT_TOKEN : \"\";\n\n const target = this.printNode(expression, 0);\n switch (right) {\n case \"string\":\n return `${notOperator}(${target} instanceof String)`;\n case \"number\":\n return `${notOperator}(${target} instanceof Long || ${target} instanceof Integer || ${target} instanceof Float || ${target} instanceof Double)`;\n case \"boolean\":\n return `${notOperator}(${target} instanceof Boolean)`;\n case \"object\":\n return `${notOperator}(${target} instanceof java.util.Map)`;\n case \"function\":\n // no universal Function type in Java; treat as any Method/Callable\n return `${notOperator}(${target} instanceof java.util.concurrent.Callable)`;\n }\n return undefined;\n }\n\n getVarMethodIfAny(node) {\n // should return the name of the method this node belongs to, if any;\n // the raw AST name is enough here — the result is only used as a scoping\n // key, and printNode on an identifier consults the type checker\n let current = node?.parent;\n while (current) {\n if (isMethodDeclaration(current) || isFunctionDeclaration(current)) {\n return String((current.name as any)?.text ?? '');\n }\n current = current.parent;\n }\n return 'outsideAnyMethod';\n }\n\n getVarClassIfAny(node) {\n // should return the name of the class this node belongs to, if any;\n // raw AST name for the same reason as getVarMethodIfAny\n let current = node?.parent;\n while (current) {\n if (isClassDeclaration(current)) {\n return String((current.name as any)?.text ?? '');\n }\n current = current.parent;\n }\n return '';\n }\n\n getVarKey(node) {\n const varName = node?.text ?? node?.name?.text;\n if (!varName) {\n return '';\n }\n return `${this.getVarClassIfAny(node)}-${this.getVarMethodIfAny(node)}-${varName}`;\n }\n\n // Static operand family of one side of an equality, undefined when the checker proves\n // nothing usable. Null/undefined union members are folded away: Objects.equals handles\n // those exactly like the helper, so `string | undefined` still counts as string.\n equalityOperandFamily(type: any): string | undefined {\n if (type === undefined || type === null) {\n return undefined;\n }\n const flags = type.flags;\n if (flags & TypeFlags.Intersection) {\n return undefined;\n }\n if (flags & TypeFlags.Union) {\n // `boolean` is itself the union true|false and carries the Boolean bit\n if (flags & TypeFlags.Boolean) {\n return 'boolean';\n }\n const families = new Set((type.getTypes?.() ?? []).map((t) => this.equalityOperandFamily(t)));\n families.delete(undefined as any);\n families.delete('null');\n return families.size === 1 ? families.values().next().value : undefined;\n }\n if (flags & (TypeFlags.String | TypeFlags.StringLiteral)) {\n return 'string';\n }\n if (flags & (TypeFlags.Boolean | TypeFlags.BooleanLiteral)) {\n return 'boolean';\n }\n if (flags & (TypeFlags.Null | TypeFlags.Undefined | TypeFlags.Void)) {\n return 'null';\n }\n return undefined;\n }\n\n // The null/undefined literal: its Java text is `null`, so Objects.equals(x, null)\n // is literally the identity test Helpers.isEqual performs on that operand.\n isNullishLiteral(node): boolean {\n return node?.kind === SyntaxKind.NullKeyword\n || (node?.kind === SyntaxKind.Identifier && node.text === 'undefined');\n }\n\n // ---- numeric operand kinds (java-15) ----\n // Helpers.isEqual compares numeric operands by value (integers via toLong, Double/Float via\n // toDouble, class mismatch false), so two operands of the SAME kind compare natively.\n\n // the Java kind a decimal numeric literal prints with: integer literal as `N` (int) or `NL` (long),\n // a '.'/exponent literal as a Java double. TypeScript normalizes the literal text (`1e3` -> `1000`,\n // `0x10` -> `16`, `100.0` -> `100`), so node.text is exactly what prints.\n javaEqualityLiteralKind(node) {\n if (!node) {\n return undefined;\n }\n // `-1`: the printer prints the sign in front of the literal, so the value is a Java\n // primitive of the operand's own kind — only an int-range operand keeps it (a long\n // literal would print with its own `L` suffix and the sign would not widen)\n if (node.kind === SyntaxKind.PrefixUnaryExpression && node.operator === SyntaxKind.MinusToken) {\n return this.javaIntegerLiteralKind(node.operand) === 'int' ? 'int' : undefined;\n }\n if (!isNumericLiteral(node)) {\n return undefined;\n }\n return /[.eE]/.test(node.text) ? 'double' : this.javaIntegerLiteralKind(node);\n }\n\n // `x.length` on a checker-proven String/List receiver prints a native int\n // (((String)x).length() / ((List)x).size(), see javaLengthKind). Every other\n // receiver prints Helpers.getArrayLength, whose value is not an int.\n javaNativeLengthKind(node) {\n if (node?.kind !== SyntaxKind.PropertyAccessExpression || node.name.text !== 'length') {\n return undefined;\n }\n return this.javaLengthKind(node.expression) !== undefined ? 'int' : undefined;\n }\n\n // `for (var i = ; ...; i++)`: javac infers a primitive int counter, so\n // every read of it — not only the loop condition the comparison rule sees — is a\n // native int. ++/-- keep it int and the counter cannot hold another box.\n isJavaPrimitiveCounterReference(node) {\n if (!node || node.kind !== SyntaxKind.Identifier) {\n return false;\n }\n const checker = this.getChecker();\n const symbol = checker.getSymbolAtLocation(node);\n const declaration: any = symbol?.valueDeclaration?.resolve() ?? symbol?.declarations?.[0]?.resolve();\n if (!declaration || declaration.kind !== SyntaxKind.VariableDeclaration || !isIdentifier(declaration.name)) {\n return false;\n }\n const list = declaration.parent;\n const forStatement: any = list?.parent;\n if (!list || !forStatement || forStatement.kind !== SyntaxKind.ForStatement || forStatement.initializer !== list) {\n return false;\n }\n if (list.declarations?.length !== 1 || this.javaIntegerLiteralKind(declaration.initializer) === undefined) {\n return false;\n }\n const incrementor = forStatement.incrementor;\n if (!incrementor\n || (incrementor.kind !== SyntaxKind.PostfixUnaryExpression && incrementor.kind !== SyntaxKind.PrefixUnaryExpression)\n || (incrementor.operator !== SyntaxKind.PlusPlusToken && incrementor.operator !== SyntaxKind.MinusMinusToken)\n || incrementor.operand?.kind !== SyntaxKind.Identifier) {\n return false;\n }\n const incrementorSymbol = checker.getSymbolAtLocation(incrementor.operand);\n return incrementorSymbol === undefined || symbol === undefined || incrementorSymbol === symbol;\n }\n\n // the box a printed local carries: the kind of its declaration's initializer, kept\n // only while every write in the declaring function writes the same kind (D2 scan).\n // A `const` declaration has no write to scan.\n javaLocalNumberKind(node, depth) {\n if (!node || node.kind !== SyntaxKind.Identifier) {\n return undefined;\n }\n const symbol = this.getChecker().getSymbolAtLocation(node);\n const declaration: any = symbol?.valueDeclaration?.resolve() ?? symbol?.declarations?.[0]?.resolve();\n if (!declaration || declaration.kind !== SyntaxKind.VariableDeclaration || !isIdentifier(declaration.name)) {\n return undefined;\n }\n const kind = this.javaPrintedNumberKind(declaration.initializer, depth + 1);\n if (kind === undefined) {\n return undefined;\n }\n const isConst = (declaration.parent?.flags & NodeFlags.Const) !== 0;\n if (!isConst && !this.javaWritesKeepNumberKind(declaration, symbol, kind)) {\n return undefined;\n }\n return kind;\n }\n\n // true when every assignment to the symbol inside its function writes the same\n // numeric kind; a compound assignment (`x += 1` prints Helpers.add) changes the box.\n javaWritesKeepNumberKind(declaration, symbol, kind) {\n const owner = this.enclosingFunctionLike(declaration);\n if (owner === undefined) {\n return false;\n }\n let safe = true;\n const visit = (node) => {\n if (!safe) {\n return;\n }\n if (isBinaryExpression(node)) {\n const op = node.operatorToken.kind;\n if (this.isAssignmentOperator(op) && this.expressionReferencesSymbol(node.left, symbol)) {\n if (op !== SyntaxKind.EqualsToken || this.javaPrintedNumberKind(node.right, 0) !== kind) {\n safe = false;\n return;\n }\n }\n } else if ((node.kind === SyntaxKind.ForOfStatement || node.kind === SyntaxKind.ForInStatement)\n && this.expressionReferencesSymbol(node.initializer, symbol)) {\n safe = false;\n return;\n } else if ((isPrefixUnaryExpression(node) || isPostfixUnaryExpression(node))\n && (node.operator === SyntaxKind.PlusPlusToken || node.operator === SyntaxKind.MinusMinusToken)\n && kind !== 'int' && this.expressionReferencesSymbol(node.operand, symbol)) {\n safe = false;\n return;\n }\n node.forEachChild(visit);\n };\n owner.forEachChild(visit);\n return safe;\n }\n\n expressionReferencesSymbol(node, symbol): boolean {\n if (node === undefined || symbol === undefined) {\n return false;\n }\n let found = false;\n const visit = (child) => {\n if (found) {\n return;\n }\n if (child.kind === SyntaxKind.Identifier && this.getChecker().getSymbolAtLocation(child) === symbol) {\n found = true;\n return;\n }\n child.forEachChild(visit);\n };\n visit(node);\n return found;\n }\n\n enclosingFunctionLike(node) {\n let current = node?.parent;\n while (current) {\n if (isFunctionLike(current)) {\n return current;\n }\n current = current.parent;\n }\n return undefined;\n }\n\n // box/primitive kind of an operand the printer prints as a native number, or undefined\n // when the printed value could be any box (a call, a parameter, an `any` local)\n javaPrintedNumberKind(node, depth = 0) {\n const literalKind = this.javaEqualityLiteralKind(node);\n if (literalKind !== undefined) {\n return literalKind;\n }\n const lengthKind = this.javaNativeLengthKind(node);\n if (lengthKind !== undefined) {\n return lengthKind;\n }\n if (this.isJavaPrimitiveCounterReference(node)) {\n return 'int';\n }\n const arithmeticKind = this.javaNativeArithmeticKind(node);\n if (arithmeticKind !== undefined) {\n return arithmeticKind;\n }\n return depth < 2 ? this.javaLocalNumberKind(node, depth) : undefined;\n }\n\n // numeric equality operand: the checker proves a plain number and the printed Java\n // value carries a known kind. Aliases (Int/Num), unions and `any` stay with the\n // helper, like in the arithmetic rule.\n javaEqualityNumberKind(node) {\n if (this.javaScalarFamily(node) !== 'number') {\n return undefined;\n }\n return this.javaPrintedNumberKind(node);\n }\n\n // ==/===/!=/!== become java.util.Objects.equals once the checker proves one operand is\n // a string, a boolean or the null/undefined literal: for those Helpers.isEqual reduces\n // to Objects.equals (value compare, class-strict, no numeric promotion). Two operands\n // the checker types as plain numbers compare natively when their printed Java kinds\n // match (java-15): the helper's numeric paths are the same value compare.\n printNativeEqualityIfProvable(node, leftText: string, rightText: string): string | undefined {\n const op = node.operatorToken.kind;\n const negated = op === SyntaxKind.ExclamationEqualsToken || op === SyntaxKind.ExclamationEqualsEqualsToken;\n if (!negated && op !== SyntaxKind.EqualsEqualsToken && op !== SyntaxKind.EqualsEqualsEqualsToken) {\n return undefined;\n }\n const checker = this.getChecker();\n const leftFamily = this.equalityOperandFamily(checker?.getTypeAtLocation(node.left));\n const rightFamily = this.equalityOperandFamily(checker?.getTypeAtLocation(node.right));\n const leftProved = leftFamily !== undefined && (leftFamily !== 'null' || this.isNullishLiteral(node.left));\n const rightProved = rightFamily !== undefined && (rightFamily !== 'null' || this.isNullishLiteral(node.right));\n const equalCall = `${negated ? '!' : ''}java.util.Objects.equals(${leftText}, ${rightText})`;\n // a declared Java String on either side: a String never equals a non-String, and\n // Objects.equals carries the same null answer, so the class-strict compare is the\n // helper's own String branch for every other operand.\n if (leftProved || rightProved || this.javaDeclaredStringType(node.left) || this.javaDeclaredStringType(node.right)) {\n return equalCall;\n }\n // both operands print a Java numeric primitive (literals, `.length`, index/search results, for\n // counters, native arithmetic): neither can be null, so the operator is the helper's value compare\n // on the two boxes (never a boxed Double, whose equals would separate -0.0).\n if (this.javaOperandPrintsPrimitiveNumber(node.left) && this.javaOperandPrintsPrimitiveNumber(node.right)) {\n return `(${leftText} ${negated ? '!=' : '=='} ${rightText})`;\n }\n // java-15: two checker-typed plain numbers whose printed Java values carry the same\n // kind (two primitives returned above); a box compares with\n // Objects.equals, whose class the kind pins to the box the helper would compare.\n const leftKind = this.javaEqualityNumberKind(node.left);\n const rightKind = this.javaEqualityNumberKind(node.right);\n if (leftKind !== undefined && leftKind === rightKind) {\n // a boxed double compares through Double.equals, which separates -0.0 from 0.0\n // where the helper's toDouble compare does not: doubles stay native only as\n // primitives (there the native operator is the same value compare)\n if (leftKind !== 'double') {\n return equalCall;\n }\n }\n // a numeric operand the pass declared Long/Double/Integer/int/long/double: the box\n // is unboxed by the operator (numeric compare, exactly the helper's toLong/toDouble\n // path) and a boxed declaration is null-tested first, which the helper answers false.\n const leftDeclared = this.javaDeclaredNumericFamily(node.left);\n const rightDeclared = this.javaDeclaredNumericFamily(node.right);\n if (leftDeclared !== undefined || rightDeclared !== undefined) {\n const leftOk = leftDeclared !== undefined || this.javaOperandPrintsPrimitiveNumber(node.left);\n const rightOk = rightDeclared !== undefined || this.javaOperandPrintsPrimitiveNumber(node.right);\n if (leftOk && rightOk) {\n const boxes: string[] = [];\n if (leftDeclared !== undefined && JAVA_BOXED_NUMERIC_TYPES.has(leftDeclared)) {\n boxes.push(leftText);\n }\n if (rightDeclared !== undefined && JAVA_BOXED_NUMERIC_TYPES.has(rightDeclared)) {\n boxes.push(rightText);\n }\n const compare = `${leftText} ${negated ? '!=' : '=='} ${rightText}`;\n if (boxes.length === 0) {\n return `(${compare})`;\n }\n // a boxed declaration can hold null, which the helper answers false for; the\n // negated comparison therefore has to accept the null arm instead of testing it\n return negated\n ? `(${boxes.map((box) => `${box} == null`).join(' || ')} || ${compare})`\n : `(${boxes.map((box) => `${box} != null`).join(' && ')} && ${compare})`;\n }\n }\n return undefined;\n }\n\n // true when the printer prints the operand as a Java primitive (a decimal literal, a\n // native .length/.size(), a for counter or a nested native arithmetic node) rather\n // than as the Object-declared box every other local gets\n javaOperandPrintsPrimitiveNumber(node): boolean {\n return this.javaEqualityLiteralKind(node) !== undefined\n || this.javaNativeLengthKind(node) !== undefined\n || this.isJavaPrimitiveCounterReference(node)\n || this.javaNativeArithmeticKind(node) !== undefined\n // `.length` on a receiver whose Java text the printer does not prove is still\n // the int-returning Helpers.getArrayLength; indexOf/search print int helpers\n || this.javaPrimitiveOperandKind(node) !== undefined;\n }\n\n // the numeric family the pass declared for a local (`Long`/`Double`/`Integer` boxed,\n // `int`/`long`/`double` primitive), undefined when nothing was declared or the declared\n // type is not numeric\n javaDeclaredNumericFamily(expression): string | undefined {\n const type = this.javaDeclaredTypeOf(expression)?.trim();\n return type !== undefined && JAVA_DECLARED_NUMERIC_TYPES.has(type) ? type : undefined;\n }\n\n // `x[k] = v` prints the runtime helper by default. Helpers.addElementToObject\n // exists for receivers the printer cannot type (Lists, arbitrary objects via\n // reflection) and for ConcurrentHashMap null-removal, so the native Map.put is\n // printed only when the checker excludes all of those.\n elementWriteTargetsMap(container, base, keys, value): boolean {\n const lastKey = keys[keys.length - 1];\n if (!isStringLiteral(lastKey) && !this.isJavaStringType(this.getChecker().getTypeAtLocation(lastKey))) {\n return false; // Map.put takes the String key; every other key prints as Object\n }\n if (isPropertyAccessExpression(base) && base.expression.kind === SyntaxKind.ThisKeyword) {\n return false; // field maps are ConcurrentHashMaps (a null value must remove, not put) and other threads read them\n }\n if (this.isPlainHashMapReceiver(container, keys)) {\n return true; // a HashMap the code created holds a null value like the helper does\n }\n // any other Map may be a ConcurrentHashMap, which rejects a null value the helper removes\n return this.isDictionaryType(container) && !this.elementWriteValueMayBeNull(value);\n }\n\n // true unless the checker proves the written value is never null/undefined\n elementWriteValueMayBeNull(value): boolean {\n const checker: any = this.checkerOrUndefined();\n if (checker === undefined || value === undefined) {\n return true;\n }\n const type = checker.getTypeAtLocation(value);\n const parts: any[] = (type.flags & TypeFlags.Union) ? (type.getTypes?.() ?? []) : [type];\n const nullable = TypeFlags.Any | TypeFlags.Unknown | JAVA_NULLISH_TYPE_FLAGS | TypeFlags.TypeParameter;\n return parts.length === 0 || parts.some((t) => (t.flags & nullable) !== 0);\n }\n\n // a key proven by the checker to be a string prints as a java String: the read is\n // the same expression, only the key needs the (String) cast the typed put demands\n elementWriteKeyText(key, keyText: string): string {\n return isStringLiteral(key) ? keyText : `(String)${keyText}`;\n }\n\n // Receivers that are a plain java.util.HashMap at runtime, where \".put\" and the helper's map branch\n // are the same write: a local initialized with an object literal or a call whose every return is\n // such a literal (this.account()). Lists, class instances and ConcurrentHashMaps stay helpers.\n isPlainHashMapReceiver(container, keys: any[]): boolean {\n if (keys.length !== 1 || container === undefined || container.kind !== SyntaxKind.Identifier) {\n return false; // only a direct write on the proven local, no read in between\n }\n const checker: any = this.checkerOrUndefined();\n if (checker === undefined) {\n return false;\n }\n const symbol = checker.getSymbolAtLocation(container);\n const declaration: any = symbol?.valueDeclaration?.resolve() ?? symbol?.declarations?.[0]?.resolve();\n if (!declaration || declaration.kind !== SyntaxKind.VariableDeclaration || !declaration.initializer) {\n return false; // parameters and receivers without an initializer stay the helper\n }\n if (!this.javaFreshHashMapValue(container, declaration.initializer)) {\n return false;\n }\n // every later `x = rhs` must hand the local another fresh map too (D2)\n return !this.javaLocalIsReassigned(container, (rhs) => this.javaFreshHashMapValue(container, rhs));\n }\n\n // a value that is a freshly built HashMap/LinkedHashMap on the Java side\n javaFreshHashMapValue(container, value): boolean {\n const initializer = this.unwrapPrintTransparentExpression(value);\n return initializer !== undefined && (isObjectLiteralExpression(initializer)\n || (isCallExpression(initializer) && this.callAlwaysReturnsPlainHashMap(initializer, 0))\n || (this.javaDeclaredMapReceiver(container) && this.javaFreshExtendMap(initializer)));\n }\n\n // a value whose Java print can never be null: non-null literals and fresh containers\n javaPrintsNonNullValue(node): boolean {\n const value = this.unwrapPrintTransparentExpression(node);\n if (value === undefined) {\n return false;\n }\n return isStringLiteralLikeNode(value) || isNumericLiteral(value)\n || value.kind === SyntaxKind.TrueKeyword || value.kind === SyntaxKind.FalseKeyword\n || isObjectLiteralExpression(value) || isArrayLiteralExpression(value)\n || (isPrefixUnaryExpression(value) && value.operator === SyntaxKind.MinusToken && isNumericLiteral(value.operand));\n }\n\n // `this.extend(..)` / `this.deepExtend(..)` from the base tier hand back a fresh LinkedHashMap\n // when the call has two arguments (Generic.Extend copies both) or ends in an object literal\n // (deepExtend's last Map argument replaces any earlier non-Map box with a new map)\n javaFreshExtendMap(initializer): boolean {\n if (initializer === undefined || !isCallExpression(initializer)\n || !isPropertyAccessExpression(initializer.expression)\n || initializer.expression.expression.kind !== SyntaxKind.ThisKeyword) {\n return false;\n }\n const name = initializer.expression.name.text;\n const args = initializer.arguments;\n const last = args.length > 0 ? this.unwrapPrintTransparentExpression(args[args.length - 1]) : undefined;\n const endsInLiteral = last !== undefined && isObjectLiteralExpression(last);\n if (!((name === 'extend' && (args.length === 2 || endsInLiteral)) || (name === 'deepExtend' && endsInLiteral))) {\n return false;\n }\n const checker: any = this.checkerOrUndefined();\n const fileName = checker?.getResolvedSignature(initializer)?.declaration?.resolve()?.getSourceFile?.()?.fileName;\n return typeof fileName === 'string' && JAVA_FRESH_EXTEND_FILE.test(fileName);\n }\n\n // the bottom container of `x[k1][k2].. = v` when x is a declared Map / List and k1 is not a\n // string literal: the guarded native read of the element-read families (the literal key is\n // printed by the caller's own arm)\n javaDeclaredChainContainerRead(left, keyCount: number): string | undefined {\n let inner = left;\n for (let i = 1; i < keyCount; i++) {\n inner = inner.expression;\n }\n if (inner === undefined || !isElementAccessExpression(inner) || isStringLiteralLikeNode(inner.argumentExpression)) {\n return undefined;\n }\n const declared = this.javaDeclaredTypeOf(inner.expression);\n if (declared === undefined) {\n return undefined;\n }\n if (JAVA_DECLARED_MAP_TYPES.test(declared)) {\n return this.javaDeclaredMapElementRead(inner);\n }\n if (JAVA_DECLARED_LIST_TYPES.test(declared) && this.javaPrimitiveCounterIndex(inner.argumentExpression)) {\n return this.javaDeclaredListElementRead(inner, true);\n }\n return undefined;\n }\n\n unwrapPrintTransparentExpression(node): any {\n let current = node;\n while (current && (isParenthesizedExpression(current)\n || isAsExpression(current)\n || isTypeAssertion(current)\n || current.kind === SyntaxKind.NonNullExpression)) {\n current = current.expression;\n }\n return current;\n }\n\n // Every write of the local in its enclosing function must be the element write\n // itself; an assignment could replace the HashMap with a List or a class instance.\n javaLocalIsReassigned(node, admitsWrite?: (rhs) => boolean): boolean {\n let scope: any = node;\n while (scope && !isFunctionLike(scope) && !isSourceFile(scope)) {\n scope = scope.parent;\n }\n if (!scope) {\n return true;\n }\n const symbol = this.getChecker().getSymbolAtLocation(node);\n let reassigned = false;\n const walk = (current) => {\n if (reassigned || current === undefined) {\n return;\n }\n if (current.kind === SyntaxKind.BinaryExpression\n && current.operatorToken.kind === SyntaxKind.EqualsToken\n && current.left.kind === SyntaxKind.Identifier\n && this.getChecker().getSymbolAtLocation(current.left) === symbol) {\n if (admitsWrite === undefined || !admitsWrite(current.right)) {\n reassigned = true;\n return;\n }\n }\n if (current.kind === SyntaxKind.BinaryExpression\n && current.operatorToken.kind >= SyntaxKind.FirstAssignment && current.operatorToken.kind <= SyntaxKind.LastAssignment\n && !isIdentifier(current.left)\n && !isElementAccessExpression(current.left) && !isPropertyAccessExpression(current.left)\n && this.javaPatternBindsSymbol(current.left, symbol)\n && !this.javaDestructuringHandsBackLocal(current, symbol)) {\n reassigned = true; // destructuring assignment `[x, p] = ..`\n return;\n }\n if (current.kind === SyntaxKind.BinaryExpression\n && current.operatorToken.kind !== SyntaxKind.EqualsToken\n && current.operatorToken.kind >= SyntaxKind.FirstAssignment && current.operatorToken.kind <= SyntaxKind.LastAssignment\n && isIdentifier(current.left)\n && this.getChecker().getSymbolAtLocation(current.left) === symbol) {\n reassigned = true; // compound write (`x ??= ..`)\n return;\n }\n if ((isForOfStatement(current) || isForInStatement(current))\n && isIdentifier(current.initializer)\n && this.getChecker().getSymbolAtLocation(current.initializer) === symbol) {\n reassigned = true;\n return;\n }\n current.forEachChild(walk);\n };\n walk(scope);\n return reassigned;\n }\n\n // `[.., x, ..] = this.m(.., x, ..)` where every return of m is an array literal whose\n // element at x's position is the never-reassigned parameter x was passed to: x keeps its object\n javaDestructuringHandsBackLocal(assignment, symbol): boolean {\n const checker: any = this.getChecker();\n const left = assignment.left;\n const call = this.unwrapPrintTransparentExpression(assignment.right);\n if (!isArrayLiteralExpression(left) || call === undefined || !isCallExpression(call)) {\n return false;\n }\n const index = left.elements.findIndex((e) => isIdentifier(e) && checker.getSymbolAtLocation(e) === symbol);\n if (index < 0 || left.elements.some((e, i) => i !== index && this.javaPatternBindsSymbol(e, symbol))) {\n return false;\n }\n const declaration: any = checker.getResolvedSignature(call)?.declaration?.resolve();\n if (!declaration || !isMethodDeclaration(declaration) || !declaration.body) {\n return false;\n }\n const argIndex = call.arguments.findIndex((a) => isIdentifier(a) && checker.getSymbolAtLocation(a) === symbol);\n const parameter = argIndex >= 0 ? declaration.parameters[argIndex] : undefined;\n if (parameter === undefined || !isIdentifier(parameter.name) || parameter.dotDotDotToken) {\n return false;\n }\n const parameterSymbol = checker.getSymbolAtLocation(parameter.name);\n let returns = 0;\n let proven = true;\n const walk = (n) => {\n if (!proven || n === undefined || (n !== declaration.body && isFunctionLike(n))) {\n return;\n }\n if (isReturnStatement(n)) {\n returns++;\n const value = this.unwrapPrintTransparentExpression(n.expression);\n const element = value !== undefined && isArrayLiteralExpression(value) ? value.elements[index] : undefined;\n proven = element !== undefined && isIdentifier(element) && checker.getSymbolAtLocation(element) === parameterSymbol;\n return;\n }\n n.forEachChild(walk);\n };\n walk(declaration.body);\n if (!proven || returns === 0 || this.javaHandBackVisiting.has(declaration)) {\n return false; // a recursive hand-back chain stays unproven\n }\n this.javaHandBackVisiting.add(declaration);\n try {\n return !this.javaLocalIsReassigned(parameter.name);\n } finally {\n this.javaHandBackVisiting.delete(declaration);\n }\n }\n\n javaHandBackVisiting = new Set();\n\n // true when a destructuring target mentions the symbol anywhere\n javaPatternBindsSymbol(pattern, symbol): boolean {\n let found = false;\n const walk = (n) => {\n if (found || n === undefined) {\n return;\n }\n if (isIdentifier(n) && this.getChecker().getSymbolAtLocation(n) === symbol) {\n found = true;\n return;\n }\n n.forEachChild(walk);\n };\n walk(pattern);\n return found;\n }\n\n // A call whose callee body returns object literals only, so the value it hands\n // back is always a freshly built HashMap on the Java side as well.\n callAlwaysReturnsPlainHashMap(node, depth: number): boolean {\n if (depth > 3) {\n return false;\n }\n const checker: any = this.getChecker();\n let callee: any = this.unwrapPrintTransparentExpression(node.expression);\n if (callee !== undefined && isPropertyAccessExpression(callee)) {\n if (callee.expression.kind !== SyntaxKind.ThisKeyword) {\n return false; // this.() only: another receiver's body is not in this class\n }\n callee = callee.name;\n }\n if (callee === undefined || callee.kind !== SyntaxKind.Identifier) {\n return false;\n }\n let symbol: any;\n try {\n symbol = checker.getSymbolAtLocation(callee);\n } catch (e) {\n return false;\n }\n const declaration: any = symbol?.valueDeclaration?.resolve() ?? symbol?.declarations?.[0]?.resolve();\n if (!declaration || (declaration.kind !== SyntaxKind.MethodDeclaration && declaration.kind !== SyntaxKind.FunctionDeclaration)) {\n return false;\n }\n if (!this.returnTypePrintsAsHashMap(declaration)) {\n return false;\n }\n const body = declaration.body;\n if (!body || !isBlock(body)) {\n return false;\n }\n let plain = true;\n let returns = 0;\n const walk = (current) => {\n if (!plain || current === undefined) {\n return;\n }\n if (isFunctionLike(current) && current !== declaration) {\n return; // a nested closure returns into its own call\n }\n if (isReturnStatement(current)) {\n returns += 1;\n const expression = current.expression;\n if (expression === undefined) {\n plain = false;\n return;\n }\n const value = this.unwrapPrintTransparentExpression(expression);\n if (isObjectLiteralExpression(value)) {\n return;\n }\n if (isCallExpression(value) && this.callAlwaysReturnsPlainHashMap(value, depth + 1)) {\n return;\n }\n plain = false;\n return;\n }\n current.forEachChild(walk);\n };\n walk(body);\n return plain && returns > 0;\n }\n\n // the declared return type must not be a class instance (those print as objects)\n // or an array (those print as Lists), so the object-literal returns above are what\n // the caller can rely on\n returnTypePrintsAsHashMap(declaration): boolean {\n try {\n const checker: any = this.getChecker();\n const signature = checker.getSignatureFromDeclaration(declaration);\n const type: any = signature?.getReturnType();\n if (!type || (type.flags & TypeFlags.Object) === 0) {\n return false;\n }\n if (checker.isArrayType(type) || checker.isTupleType(type)) {\n return false;\n }\n const declarations = (type.getSymbol()?.declarations ?? []).map((d) => d.resolve());\n if (declarations.some((d) => d.kind === SyntaxKind.ClassDeclaration)) {\n return false;\n }\n return type.getCallSignatures().length === 0;\n } catch (e) {\n return false;\n }\n }\n\n isDictionaryType(node): boolean {\n try {\n const checker: any = this.getChecker();\n const type = checker.getTypeAtLocation(node);\n return this.isDictionaryTsType(type, checker, 0);\n } catch (e) {\n return false;\n }\n }\n\n // A TS dictionary (`{ [key: string]: any }`, i.e. ccxt's Dict) is a Map on every\n // print and run path. Arrays, class instances and unknown types are not, so they\n // keep the helper.\n isDictionaryTsType(type: any, checker: any, depth: number): boolean {\n if (!type || depth > 3) {\n return false;\n }\n const flags: any = type.flags;\n if (flags & TypeFlags.Union) {\n const parts: any[] = type.getTypes?.() ?? [];\n return parts.length > 0 && parts.every((t) => this.isDictionaryTsType(t, checker, depth + 1));\n }\n if (!(flags & TypeFlags.Object)) {\n return false;\n }\n try {\n if (checker.isArrayType(type) || checker.isTupleType(type)) {\n return false;\n }\n return checker.getIndexTypeOfType(type, IndexKind.String) !== undefined;\n } catch (e) {\n return false;\n }\n }\n\n // -------------------------------------------------------------------\n // helper removal: native emission when the checker proves the printed\n // operand is a Java numeric primitive / List / Map\n // -------------------------------------------------------------------\n\n // int/long kind of a literal as printNumericLiteral emits it. Fraction and\n // exponent forms are Java doubles and a double can hold NaN, which the\n // comparison helpers order differently (`NaN < x` is true there), so those\n // never become a native comparison.\n javaIntegerLiteralKind(node) {\n if (!node || !isNumericLiteral(node)) {\n return undefined;\n }\n if (/[.eE]/.test(node.text)) {\n return undefined;\n }\n return Number(node.text) > 2147483647 ? 'long' : 'int';\n }\n\n // A rest parameter is a Java varargs array, not a List, so a List cast on it\n // would throw ClassCastException; simple identifier aliases are followed too.\n isVarargsArrayReference(node, depth = 0) {\n if (!node || depth > 4 || node.kind !== SyntaxKind.Identifier) {\n return false;\n }\n const symbol = this.getChecker().getSymbolAtLocation(node);\n const declaration: any = symbol?.valueDeclaration?.resolve() ?? symbol?.declarations?.[0]?.resolve();\n if (!declaration) {\n return false;\n }\n if (declaration.dotDotDotToken !== undefined) {\n return true;\n }\n const initializer = declaration.initializer;\n if (initializer && isIdentifier(initializer)) {\n return this.isVarargsArrayReference(initializer, depth + 1);\n }\n return false;\n }\n\n // checker proof that the value is printed as a java.util.List: TS arrays and\n // tuples become ArrayList, ReadonlyArray only adds a readonly modifier\n isJavaListType(type) {\n if (!type) {\n return false;\n }\n const checker = this.getChecker();\n if (checker.isArrayType(type) || checker.isTupleType(type)) {\n return true;\n }\n return (type as any).isTypeReference?.() === true && (type as any).getTarget().getSymbol()?.escapedName === 'ReadonlyArray';\n }\n\n // `.length` is a Java int for exactly these receivers; every other receiver keeps\n // Helpers.getArrayLength, whose result type is not proven\n javaLengthKind(expression) {\n const type = this.getChecker().getTypeAtLocation(expression);\n if (this.isJavaStringType(type)) {\n return 'String';\n }\n if (this.isJavaListValueType(type) && !this.isVarargsArrayReference(expression)) {\n return 'List';\n }\n // a nullish union member cannot take a bare `.size()`/`.length()`, but the\n // guard below answers 0 for null exactly like the helper, and only a bare\n // identifier keeps the receiver evaluate-once\n if (isIdentifier(expression)) {\n if (this.isJavaNullishUnion(type, (member) => this.isStringType(member.flags))) {\n return 'StringOrNull';\n }\n if (this.isJavaNullishUnion(type, (member) => this.isJavaListValueType(member))\n && !this.isVarargsArrayReference(expression)) {\n return 'ListOrNull';\n }\n }\n return undefined;\n }\n\n // every union member is a List-printing type (TS array/tuple/ReadonlyArray, or an\n // Array-derived class whose hand-written java counterpart is an ArrayList)\n isJavaListValueType(type) {\n if (!type) {\n return false;\n }\n if ((type.flags & TypeFlags.Union) !== 0) {\n return type.getTypes().length > 0 && type.getTypes().every((member) => this.isJavaListValueType(member));\n }\n return this.isJavaListType(type) || this.isJavaListBackedClassType(type);\n }\n\n // TS class/interface whose java counterpart extends java.util.ArrayList:\n // the ws caches (ws/ArrayCache.java) and the order-book sides (ws/OrderBookSide.java)\n isJavaListBackedClassType(type) {\n if (!type || (type.flags & TypeFlags.Object) === 0) {\n return false;\n }\n let current: any = (type as any).isTypeReference?.() ? (type as any).getTarget() : type;\n for (let depth = 0; current && depth < 8; depth++) {\n const name = current.getSymbol?.()?.escapedName;\n if (name !== undefined && JAVA_LIST_BACKED_TS_CLASSES.has(name)) {\n return true;\n }\n const bases: any[] = current.getBaseTypes?.() ?? [];\n current = bases.length > 0 ? ((bases[0] as any).isTypeReference?.() ? (bases[0] as any).getTarget() : bases[0]) : undefined;\n }\n return false;\n }\n\n // union of one accepted member family plus null/undefined: the emitted guard is the\n // helper's answer for the nullish case and the native read otherwise\n isJavaNullishUnion(type, isMember) {\n if (!type || (type.flags & TypeFlags.Union) === 0 || type.getTypes().length === 0) {\n return false;\n }\n return type.getTypes().every((member) => isMember(member)\n || (member.flags & (TypeFlags.Undefined | TypeFlags.Null)) !== 0);\n }\n\n // shared by printLengthProperty and transformPropertyAcessExpressionIfNeeded\n printJavaLength(expression, leftSide) {\n const kind = this.javaLengthKind(expression);\n if (kind !== undefined) {\n const read = kind.startsWith('String') ? `((String)${leftSide}).length()` : `((java.util.List)${leftSide}).size()`;\n return kind.endsWith('OrNull') ? `(${leftSide} == null ? 0 : ${read})` : read;\n }\n // a receiver the embedding pass declared a java.util.List (`List response =\n // (this.someRequest(..)).join()` — a typed list return bound to a local, or a list\n // parameter the pass retyped): the declaration carries the type, so `x.size()` needs\n const declared = this.javaDeclaredTypeOf(expression);\n if (declared !== undefined && JAVA_DECLARED_LIST_TYPES.test(declared)) {\n return `(${leftSide} == null ? 0 : ${leftSide}.size())`;\n }\n return `${this.ARRAY_LENGTH_WRAPPER_OPEN}${leftSide}${this.ARRAY_LENGTH_WRAPPER_CLOSE}`;\n }\n\n // `for (var i = ; ...; i++)`: printForStatement rewrites the\n // Object initializer into `var`, so javac infers a primitive counter there,\n // and only ++/-- writes keep it primitive\n isJavaPrimitiveForCounter(node) {\n if (node.kind !== SyntaxKind.Identifier) {\n return false;\n }\n const comparison = node.parent;\n if (!comparison || comparison.kind !== SyntaxKind.BinaryExpression) {\n return false;\n }\n const forStatement = comparison.parent;\n if (!forStatement || forStatement.kind !== SyntaxKind.ForStatement || forStatement.condition !== comparison) {\n return false;\n }\n const initializer = forStatement.initializer;\n if (!initializer || initializer.kind !== SyntaxKind.VariableDeclarationList) {\n return false;\n }\n const declarations = initializer.declarations ?? [];\n if (declarations.length !== 1) {\n return false;\n }\n const declaration = declarations[0];\n if (!isIdentifier(declaration.name) || declaration.name.text !== node.text) {\n return false;\n }\n if (this.javaIntegerLiteralKind(declaration.initializer) === undefined) {\n return false;\n }\n const counterSymbol = this.getChecker().getSymbolAtLocation(node);\n const declarationSymbol = this.getChecker().getSymbolAtLocation(declaration.name);\n if (counterSymbol !== undefined && declarationSymbol !== undefined && counterSymbol !== declarationSymbol) {\n return false;\n }\n const incrementor = forStatement.incrementor;\n if (!incrementor || incrementor.operand?.kind !== SyntaxKind.Identifier || incrementor.operand.text !== node.text) {\n return false;\n }\n return incrementor.kind === SyntaxKind.PostfixUnaryExpression || incrementor.kind === SyntaxKind.PrefixUnaryExpression;\n }\n\n // Java primitive kind of a comparison operand; undefined keeps the helper. Proof sources: literals\n // (int/long/double) and expressions the printer's own emitter pins: `var` for-counter, `.length`,\n // `x.indexOf(arg)`/`x.search(arg)` (int), Math.round (long), Math.floor/ceil/pow (double).\n javaPrimitiveOperandKind(node) {\n if (node === undefined || node === null) {\n return undefined;\n }\n if (node.kind === SyntaxKind.ParenthesizedExpression) {\n return this.javaPrimitiveOperandKind(node.expression);\n }\n const literalKind = this.javaIntegerLiteralKind(node);\n if (literalKind !== undefined) {\n return literalKind;\n }\n if (this.isJavaFloatLiteral(node)) {\n return 'double';\n }\n if (this.isJavaPrimitiveForCounter(node) || this.javaPrintedIntCounter(node)) {\n return 'int';\n }\n // `-1`: the sign prints in front of an int literal, still a Java int\n if (node.kind === SyntaxKind.PrefixUnaryExpression && node.operator === SyntaxKind.MinusToken\n && this.javaIntegerLiteralKind(node.operand) === 'int') {\n return 'int';\n }\n if (node.kind === SyntaxKind.PropertyAccessExpression && node.name.text === 'length') {\n return 'int';\n }\n if (node.kind === SyntaxKind.CallExpression) {\n return this.javaPrintedCallKind(node);\n }\n // a nested `+ - * /` this printer emits natively is a Java primitive of its kind\n if (node.kind === SyntaxKind.BinaryExpression) {\n return this.javaNativeArithmeticKind(node);\n }\n return undefined;\n }\n\n // a read of a `for (var i = ; ..; i++)` counter anywhere in the loop: javac types it\n // int and no box write reaches it; a capture rename (`finalI`) prints an Object copy instead\n javaPrintedIntCounter(node): boolean {\n return node?.kind === SyntaxKind.Identifier && this.javaIntForCounter(node)\n && this.javaIdentifierPrintsDeclaredName(node);\n }\n\n // fractional / exponent literals print as Java double literals (printNumericLiteral)\n isJavaFloatLiteral(node) {\n if (!node || !isNumericLiteral(node)) {\n return false;\n }\n return !/^0[xXbBoO]/.test(node.text) && /[.eE]/.test(node.text);\n }\n\n // Java kind of a call the printer emits itself, undefined otherwise. Mirrors printIndexOfCall /\n // printSearchCall / printMathRoundCall / printMathFloorCall / printMathCeilCall and Math.pow:\n // x.indexOf(a) / x.search(a) -> int; Math.round(x) -> long; Math.floor/ceil/pow -> double.\n javaPrintedCallKind(node) {\n const callee = node.expression;\n if (callee?.kind !== SyntaxKind.PropertyAccessExpression) {\n return undefined;\n }\n const name = callee.name?.text;\n const argCount = node.arguments?.length ?? 0;\n const onMath = callee.expression?.kind === SyntaxKind.Identifier\n && callee.expression.text === 'Math';\n switch (name) {\n case 'indexOf':\n case 'search':\n // the dispatch routes a 1-argument indexOf/search through the int-returning\n // helpers; a receiver that prints String keeps String.indexOf (int as well)\n return argCount >= 1 ? 'int' : undefined;\n case 'round':\n return onMath && argCount === 1 ? 'long' : undefined;\n case 'floor':\n case 'ceil':\n return onMath && argCount === 1 ? 'double' : undefined;\n case 'pow':\n return onMath && argCount === 2 ? 'double' : undefined;\n }\n return undefined;\n }\n\n // operand usability for `>=` / `<` / `<=`, which route through the helper's isEqual. Two integral\n // operands are always exact; once a double is involved, toLong saturates and BigDecimal throws on\n // ±Infinity, so a double or long is accepted only as a finite literal within ±2^53.\n javaComparisonOperandsAreExact(left, leftKind, right, rightKind) {\n if (leftKind !== 'double' && rightKind !== 'double') {\n return true;\n }\n return this.javaComparisonOperandIsExactAgainstDouble(left, leftKind)\n && this.javaComparisonOperandIsExactAgainstDouble(right, rightKind);\n }\n\n javaComparisonOperandIsExactAgainstDouble(node, kind) {\n if (kind === 'int') {\n return true;\n }\n if ((kind !== 'long' && kind !== 'double') || !isNumericLiteral(node)) {\n return false;\n }\n const text = node.text;\n if (/^[0-9]+$/.test(text)) {\n // the text is what the printer emits, and JS Number() rounds above 2^53 —\n // compare the literal's exact value instead\n return BigInt(text) <= 9007199254740992n;\n }\n const value = Number(text);\n return Number.isFinite(value) && Math.abs(value) <= 9007199254740992;\n }\n\n // checker proof that the value is printed as a java.util.HashMap: TS object\n // shapes (interfaces, object literals, aliases) become HashMaps, while class\n // instances are real Java objects and arrays/unions are not proven here\n isJavaMapType(type) {\n if (!type || (type.flags & TypeFlags.Object) === 0) {\n return false;\n }\n const checker = this.getChecker();\n if (checker.isArrayType(type) || checker.isTupleType(type)) {\n return false;\n }\n if (type.getCallSignatures().length > 0) {\n return false;\n }\n const declarations = (type.getSymbol()?.declarations ?? []).map((d) => d.resolve());\n return !declarations.some((declaration) => declaration.kind === SyntaxKind.ClassDeclaration\n || declaration.getSourceFile().fileName.indexOf('typescript') > -1);\n }\n\n // string keys (plain, literal or a union of literals) print as Java Strings\n isJavaStringType(type) {\n if (!type) {\n return false;\n }\n if (this.isStringType(type.flags)) {\n return true;\n }\n if ((type.flags & TypeFlags.Union) === 0) {\n return false;\n }\n return type.getTypes().every((member) => this.isStringType(member.flags));\n }\n\n // `Dictionary | undefined` (what a no-overload safe* signature widens to): the helper\n // answers false for the nullish arm and the guarded emission keeps exactly that; every\n // non-map member (arrays, classes, scalars) keeps the helper\n isJavaNullableMapType(type) {\n return this.isJavaNullishUnion(type, (member) => this.isJavaMapType(member))\n && ((type as any).getTypes?.() ?? []).some((member) => (member.flags & (TypeFlags.Undefined | TypeFlags.Null)) === 0);\n }\n\n // the guarded emission reads the receiver twice, so it is only printed for an operand\n // that cannot run anything twice: a name or a `this.` field. Everything else (calls,\n // element reads) keeps the helper so the operand is still evaluated once.\n javaRepeatableOperand(node) {\n if (node === undefined) {\n return false;\n }\n if (isIdentifier(node)) {\n return true;\n }\n if (isParenthesizedExpression(node)) {\n return this.javaRepeatableOperand(node.expression);\n }\n return isPropertyAccessExpression(node) && node.expression?.kind === SyntaxKind.ThisKeyword;\n }\n\n // The declared Java type of a local/parameter is known to the pass that rewrites the declaration\n // text (build/java-local-types.js), which records every name it typed here. With no consumer\n // installed the table is empty and every read keeps the helper.\n javaDeclaredTypeOf(expression): string | undefined {\n if (expression === undefined || !isIdentifier(expression)) {\n return undefined;\n }\n const declaration = this.javaDeclarationOfIdentifier(expression);\n if (declaration === undefined || expression.text !== declaration.name?.text) {\n return undefined;\n }\n return this.javaDeclaredTypeOfDeclaration(declaration);\n }\n\n // the declared Java type of a declaration: the embedding build layer names the\n // declarations it retypes itself, and a parameter the printer retypes\n // (javaNativeParameterType) answers for itself, so its element reads go native too\n javaDeclaredTypeOfDeclaration(declaration): string | undefined {\n const resolver = this.javaDeclaredLocalTypeResolver;\n if (resolver !== undefined) {\n let type;\n try {\n type = resolver(declaration);\n } catch (e) {\n type = undefined;\n }\n if (typeof type === 'string' && type.trim().length > 0) {\n return type.trim();\n }\n }\n if (isParameterDeclaration(declaration)) {\n return this.javaNativeParameterType(declaration);\n }\n return undefined;\n }\n\n // The native Java type a parameter prints with when its TS annotation is a base/types.ts alias in\n // JAVA_NATIVE_PARAMETER_TYPES. Fixed parameters of generated-tier methods only, and every\n // declaration up the heritage chain must print the same type: Java overrides are invariant.\n javaNativeParameterType(node): string | undefined {\n if (node === undefined || !isParameterDeclaration(node)\n || node.initializer !== undefined || node.dotDotDotToken !== undefined) {\n return undefined;\n }\n const own = this.javaNativeParameterTypeOf(node);\n const type = own !== undefined ? own : this.javaInheritedParameterType(node);\n if (type === undefined) {\n return undefined;\n }\n // D2: a parameter the enclosing body assigns with a compound operator keeps the box — `url += '/x'`\n // prints `url = Helpers.add(url, ..)`, whose result is an Object. A plain `x = ..` or a\n // destructuring target is cast at the write site instead (javaParameterAssignmentCast).\n if (this.javaParameterIsCompoundAssigned(node)) {\n return undefined;\n }\n try {\n const method: any = node.parent;\n const index = method.parameters.indexOf(node);\n let override = this.getMethodOverride(method);\n if (override === undefined\n && JAVA_NATIVE_PARAMETER_PREDICTION_FILES.test(node.getSourceFile().fileName)\n && method.name !== undefined) {\n // a venue method overriding the Exchange-tier body PredictionExchange.java carries\n // must print that tier parameter's type (D8: Java overrides are invariant)\n const tier = this.exchangeTierMethods().get(method.name.getText().trim());\n if (tier !== undefined && !this.javaParameterPrintsType(tier.parameters?.[index], type)) {\n return undefined;\n }\n }\n while (override !== undefined) {\n const baseParam = (override as any).parameters?.[index];\n if (!this.javaParameterPrintsType(baseParam, type)) {\n return undefined;\n }\n override = this.getMethodOverride(override);\n }\n } catch (e) {\n return undefined; // an unresolvable heritage keeps the box\n }\n return type;\n }\n\n // method declarations (first per name) of the `Exchange` class of ts/src/base/Exchange.ts, read off the\n // program the warp ran on. A prediction venue's method with one of these names overrides\n // the tier body javaTranspiler.ts injects into PredictionExchange.java.\n private _exchangeTierMethods: Map | undefined = undefined;\n exchangeTierMethods(): Map {\n if (this._exchangeTierMethods !== undefined) {\n return this._exchangeTierMethods;\n }\n const names = new Map();\n try {\n const program = this.getProgram();\n const fileName = program.getSourceFileNames().find((f) => JAVA_NATIVE_PARAMETER_BASE_FILES.test(f));\n const file = fileName !== undefined ? program.getSourceFile(fileName) : undefined;\n const collect = (node: Node) => {\n if (isClassDeclaration(node) && node.name?.text === 'Exchange') {\n for (const member of node.members) {\n const key = (member as any).name?.getText().trim();\n if (isMethodDeclaration(member) && key !== undefined && !names.has(key)) {\n names.set(key, member);\n }\n }\n }\n node.forEachChild(collect);\n };\n if (file !== undefined) {\n collect(file);\n }\n } catch (e) {\n // no program yet: the heritage walk above already answered\n }\n this._exchangeTierMethods = names;\n return names;\n }\n\n // the same parameter position of an ancestor declaration prints this native type: its\n // own annotation names it, or - with no annotation of its own - it inherits the same\n // type from a declaration above it, exactly like this one does\n javaParameterPrintsType(baseParam, type: string): boolean {\n if (baseParam === undefined || !isParameterDeclaration(baseParam)\n || baseParam.initializer !== undefined || baseParam.dotDotDotToken !== undefined) {\n return false;\n }\n const own = this.javaNativeParameterTypeOf(baseParam);\n const printed = own !== undefined ? own : this.javaInheritedParameterType(baseParam);\n return printed === type;\n }\n\n // the type a fixed parameter with no annotation of its own inherits: the nearest\n // declaration of the method up the heritage chain that prints a native type. An\n // unannotated root declaration prints `Object`, so nothing is inherited and the whole\n javaInheritedParameterType(node): string | undefined {\n const method = node.parent;\n const index = method?.parameters?.indexOf(node);\n if (method === undefined || index === undefined || index < 0) {\n return undefined;\n }\n let override = this.getMethodOverride(method);\n while (override !== undefined) {\n const baseParam = (override as any).parameters?.[index];\n const type = baseParam === undefined ? undefined : this.javaNativeParameterTypeOf(baseParam);\n if (type !== undefined) {\n return type;\n }\n override = this.getMethodOverride(override);\n }\n return undefined;\n }\n\n // Default-valued parameters are real parameters of the typed core that carries the body;\n // the untyped `Object... optionalArgs` front delegates to it.\n javaOptionalParameterJavaType(node): string {\n return this.javaOptionalParameterType(node) ?? 'Object';\n }\n\n javaOptionalParameterType(node): string | undefined {\n if (node === undefined || !isParameterDeclaration(node)) {\n return undefined;\n }\n if (node.initializer === undefined || node.dotDotDotToken !== undefined) {\n return undefined; // `?` parameters keep today's shape (they print in the fixed prefix)\n }\n const own = this.javaOptionalParameterTypeOf(node);\n if (own === undefined) {\n return undefined;\n }\n // a parameter the body assigns with a compound operator keeps the box (`x += ..` prints\n // Helpers.add(x, ..), an Object result) - the same rule as the fixed-parameter path\n if (this.javaParameterIsCompoundAssigned(node)) {\n return undefined;\n }\n // a list parameter the body `typeof`-probes also accepts other boxes at runtime\n if (own === JAVA_STRING_LIST_TYPE && this.javaParameterIsTypeofTested(node)) {\n return undefined;\n }\n const method: any = node.parent;\n try {\n const index = method.parameters.indexOf(node);\n let override = this.getMethodOverride(method);\n while (override !== undefined) {\n if (!this.javaOptionalParameterFamilyAgrees(method, override, index, own)) {\n return undefined;\n }\n override = this.getMethodOverride(override);\n }\n } catch (e) {\n return undefined; // an unresolvable heritage keeps the box\n }\n return own;\n }\n\n // the annotation proof for an optional parameter (no initializer bail)\n javaOptionalParameterTypeOf(node): string | undefined {\n if (node === undefined || !isParameterDeclaration(node) || node.dotDotDotToken !== undefined) {\n return undefined;\n }\n const method = node.parent;\n if (method === undefined || !isMethodDeclaration(method) || !isClassDeclaration(method.parent)) {\n return undefined;\n }\n if (!JAVA_NATIVE_PARAMETER_BASE_FILES.test(node.getSourceFile().fileName)\n && !JAVA_NATIVE_PARAMETER_GENERATED_FILES.test(node.getSourceFile().fileName)) {\n return undefined; // a hand-written java class declares this method, not the printer\n }\n const checker: any = this.checkerOrUndefined();\n if (checker === undefined) {\n return undefined;\n }\n const type = checker.getTypeAtLocation(node);\n if (type === undefined) {\n return undefined;\n }\n const symbol = this.javaParameterAliasSymbol(node, type, checker);\n const name = symbol?.name;\n const excluded = JAVA_NATIVE_PARAMETER_EXCLUDED_POSITIONS[(method.name as any)?.text];\n if (excluded !== undefined && excluded.includes(method.parameters.indexOf(node))) {\n return undefined;\n }\n if (name === 'Strings' || this.javaIsStringArrayType(checker, type)) {\n const listName = JAVA_STRINGS_OPTIONAL_PARAMETER_NAMES.has((node.name as any)?.text)\n && !JAVA_STRINGS_EXCLUDED_METHODS.has((method.name as any)?.text);\n return listName ? JAVA_STRING_LIST_TYPE : undefined;\n }\n if (name === undefined || JAVA_NATIVE_PARAMETER_TYPES_OPTIONAL[name] === undefined) {\n return undefined;\n }\n const declaration = symbol?.declarations?.[0]?.resolve();\n const fileName = declaration?.getSourceFile?.()?.fileName;\n return JAVA_NATIVE_PARAMETER_SOURCE_FILES.test(fileName ?? '')\n ? JAVA_NATIVE_PARAMETER_TYPES_OPTIONAL[name] : undefined;\n }\n\n // a `string[]` annotation (optionally `| undefined`), the unaliased spelling of `Strings`\n javaIsStringArrayType(checker, type): boolean {\n const members = type.isUnionType?.() ? type.getTypes() : [type];\n let arrays = 0;\n for (const member of members) {\n if (member.flags & (TypeFlags.Undefined | TypeFlags.Null)) {\n continue;\n }\n if (!checker.isArrayType(member)) {\n return false;\n }\n const element = checker.getTypeArguments(member)?.[0];\n if (element === undefined || !(element.flags & TypeFlags.String)) {\n return false;\n }\n arrays++;\n }\n return arrays === 1;\n }\n\n // Java overrides are invariant: every ancestor declaration must match the parameter count,\n // the first default-valued index and this position's type, otherwise the position stays Object.\n javaOptionalParameterFamilyAgrees(method, override, index, type: string): boolean {\n const baseParams = override?.parameters;\n if (baseParams === undefined || baseParams.length !== method.parameters.length) {\n return false;\n }\n if (this.firstDefaultParameterIndex(baseParams) !== this.firstDefaultParameterIndex(method.parameters)) {\n return false;\n }\n const baseParam = baseParams[index];\n if (baseParam === undefined || !isParameterDeclaration(baseParam) || baseParam.dotDotDotToken !== undefined) {\n return false;\n }\n const baseIsOptional = baseParam.initializer !== undefined || baseParam.questionToken !== undefined;\n const ownIsOptional = method.parameters[index].initializer !== undefined\n || method.parameters[index].questionToken !== undefined;\n if (baseIsOptional !== ownIsOptional) {\n return false;\n }\n const baseType = baseIsOptional\n ? this.javaOptionalParameterTypeOf(baseParam)\n : this.javaNativeParameterTypeOf(baseParam);\n return baseType === type;\n }\n\n firstDefaultParameterIndex(params): number {\n for (let i = 0; i < params.length; i++) {\n if (params[i].initializer !== undefined || params[i].questionToken !== undefined) {\n return i;\n }\n }\n return -1;\n }\n\n // a method with >=1 optional parameter prints one typed full signature (callers pass every slot).\n hasDefaultedTail(node): boolean {\n if (node === undefined || !isMethodDeclaration(node)) {\n return false; // constructors and functions keep the optionalArgs unpack\n }\n return this.javaHasOptionalParameter(node);\n }\n\n // a typed default-valued method parameter is written in place, so its writes convert to the declared type\n javaSplitParameterWriteType(node): string | undefined {\n if (node?.initializer === undefined || !this.hasDefaultedTail(node.parent)) {\n return undefined;\n }\n return this.javaOptionalParameterType(node);\n }\n\n // the async body copy of a reassigned default-valued parameter keeps a `List` type;\n // its writes convert like the sync in-place ones (other types keep the `Object` copy)\n javaAsyncParameterLocalType(node): string | undefined {\n if (node?.initializer === undefined || !this.hasDefaultedTail(node.parent) || !this.isAsyncFunction(node.parent)) {\n return undefined;\n }\n const type = this.javaOptionalParameterType(node);\n if (type === 'Long' && !this.javaParameterIsWritten(node)) {\n return type; // a read-only copy of the Long core parameter\n }\n return type === JAVA_STRING_LIST_TYPE ? type : undefined;\n }\n\n // any write to the parameter in its method: assignment (plain or compound), a destructuring\n // target, `++`/`--`, a for-of/in binding\n javaParameterIsWritten(node): boolean {\n const method = node?.parent;\n const checker: any = this.checkerOrUndefined();\n if (method?.body === undefined || checker === undefined) {\n return true;\n }\n const symbol = checker.getSymbolAtLocation(node.name);\n if (symbol === undefined) {\n return true;\n }\n const same = (n) => n !== undefined && isIdentifier(n) && checker.getSymbolAtLocation(n) === symbol;\n let written = false;\n const visit = (n) => {\n if (written) {\n return;\n }\n if (isBinaryExpression(n) && JAVA_ASSIGNMENT_OPERATOR_KINDS.has(n.operatorToken.kind)) {\n const left = n.left;\n if (same(left) || (isArrayLiteralExpression(left) && left.elements.some(same))) {\n written = true;\n return;\n }\n }\n if ((isPrefixUnaryExpression(n) || isPostfixUnaryExpression(n)) && same(n.operand)\n && (n.operator === SyntaxKind.PlusPlusToken || n.operator === SyntaxKind.MinusMinusToken)) {\n written = true;\n return;\n }\n if ((isForOfStatement(n) || isForInStatement(n)) && same(n.initializer)) {\n written = true;\n return;\n }\n n.forEachChild(visit);\n };\n visit(method.body);\n return written;\n }\n\n // a read the enclosing code only reaches with the binding non-null: the right operand of\n // `x !== undefined && ..`, the matching arm of an `if`/`?:` on that test, or any statement\n // after `if (x === undefined) { return/throw/.. }`. Callers require an unwritten binding.\n javaNullGuardAdmitsRead(node): boolean {\n const checker: any = this.checkerOrUndefined();\n const symbol = checker?.getSymbolAtLocation(node);\n if (symbol === undefined) {\n return false;\n }\n let current: any = node;\n while (current.parent !== undefined) {\n const parent: any = current.parent;\n if (isBinaryExpression(parent) && parent.operatorToken.kind === SyntaxKind.AmpersandAmpersandToken\n && parent.right === current && this.javaTestProvesNonNull(parent.left, symbol, true)) {\n return true;\n }\n if (isBinaryExpression(parent) && parent.operatorToken.kind === SyntaxKind.BarBarToken\n && parent.right === current && this.javaTestProvesNonNull(parent.left, symbol, false)) {\n return true;\n }\n if ((isIfStatement(parent) || isConditionalExpression(parent))) {\n const test = isIfStatement(parent) ? parent.expression : parent.condition;\n const whenTrue = isIfStatement(parent) ? parent.thenStatement : parent.whenTrue;\n const whenFalse = isIfStatement(parent) ? parent.elseStatement : parent.whenFalse;\n if ((whenTrue === current && this.javaTestProvesNonNull(test, symbol, true))\n || (whenFalse === current && this.javaTestProvesNonNull(test, symbol, false))) {\n return true;\n }\n }\n if (isBlock(parent)) {\n for (const sibling of parent.statements) {\n if (sibling === current) {\n break;\n }\n if (isIfStatement(sibling)\n && ((this.javaTestProvesNonNull(sibling.expression, symbol, false) && this.javaStatementAlwaysExits(sibling.thenStatement))\n || (this.javaTestProvesNonNull(sibling.expression, symbol, true) && this.javaStatementAlwaysExits(sibling.elseStatement)))) {\n return true;\n }\n }\n }\n current = parent;\n }\n return false;\n }\n\n // `x !== undefined` / `x != null` (either order) proves x non-null when the test is true;\n // `x === undefined` when false; `&&` (true) / `||` (false) prove through either side, `!` flips\n javaTestProvesNonNull(test, symbol, truthy): boolean {\n if (test === undefined) {\n return false;\n }\n if (isParenthesizedExpression(test)) {\n return this.javaTestProvesNonNull(test.expression, symbol, truthy);\n }\n if (isPrefixUnaryExpression(test) && test.operator === SyntaxKind.ExclamationToken) {\n return this.javaTestProvesNonNull(test.operand, symbol, !truthy);\n }\n if (!isBinaryExpression(test)) {\n return false;\n }\n const op = test.operatorToken.kind;\n if (op === SyntaxKind.AmpersandAmpersandToken) {\n return truthy && (this.javaTestProvesNonNull(test.left, symbol, true) || this.javaTestProvesNonNull(test.right, symbol, true));\n }\n if (op === SyntaxKind.BarBarToken) {\n return !truthy && (this.javaTestProvesNonNull(test.left, symbol, false) || this.javaTestProvesNonNull(test.right, symbol, false));\n }\n const inequality = op === SyntaxKind.ExclamationEqualsToken || op === SyntaxKind.ExclamationEqualsEqualsToken;\n const equality = op === SyntaxKind.EqualsEqualsToken || op === SyntaxKind.EqualsEqualsEqualsToken;\n if ((!inequality && !equality) || truthy !== inequality) {\n return false;\n }\n const nullish = (n) => n.kind === SyntaxKind.NullKeyword || (isIdentifier(n) && n.text === 'undefined');\n const tested = nullish(test.right) ? test.left : (nullish(test.left) ? test.right : undefined);\n const checker: any = this.checkerOrUndefined();\n return tested !== undefined && isIdentifier(tested) && checker?.getSymbolAtLocation(tested) === symbol;\n }\n\n javaStatementAlwaysExits(statement): boolean {\n if (statement === undefined) {\n return false;\n }\n const exits = (n) => isReturnStatement(n) || isThrowStatement(n) || isContinueStatement(n) || isBreakStatement(n);\n if (exits(statement)) {\n return true;\n }\n return isBlock(statement) && statement.statements.length > 0 && exits(statement.statements[statement.statements.length - 1]);\n }\n\n // `Long` when the body reads this default-valued `Int` parameter as the core's own Long (the\n // parameter itself or its read-only async copy); undefined otherwise\n javaLongParameterRead(node): boolean {\n if (node === undefined || !isIdentifier(node) || !this.javaIdentifierPrintsDeclaredName(node)\n || !this.javaIdentifierKeepsDeclaredName(node)) {\n return false;\n }\n const declaration = this.javaDeclarationOfIdentifier(node);\n if (declaration === undefined || !isParameterDeclaration(declaration) || declaration.initializer === undefined\n || !this.hasDefaultedTail(declaration.parent)) {\n return false;\n }\n return this.javaOptionalParameterType(declaration) === 'Long' && !this.javaParameterIsWritten(declaration);\n }\n\n // the names the enclosing method body assigns with a compound operator (`x += ..`),\n // by method node; a plain assignment is handled by javaParameterAssignmentCast\n javaMethodAssignedNames: WeakMap> = new WeakMap();\n\n // D-09 memo/cycle guard for javaNativeReturnType (mutually recursive return chains)\n javaReturnTypeCache: WeakMap = new WeakMap();\n javaReturnTypeInProgress: Set = new Set();\n\n javaParameterIsTypeofTested(node): boolean {\n const method = node.parent;\n const name = (node.name as any)?.text;\n // forEachChild stops at the first truthy visit, i.e. the first matching typeof\n const visit = (n: Node): boolean => (isTypeOfExpression(n) && isIdentifier(n.expression) && n.expression.text === name)\n || n.forEachChild(visit) === true;\n return method?.body !== undefined && name !== undefined && method.body.forEachChild(visit) === true;\n }\n\n javaParameterIsCompoundAssigned(node): boolean {\n const method = node.parent;\n const name = (node.name as any)?.text;\n if (method?.body === undefined || name === undefined) {\n return false;\n }\n let assigned = this.javaMethodAssignedNames.get(method);\n if (assigned === undefined) {\n assigned = new Set();\n const collect = (n: Node) => {\n if (isBinaryExpression(n) && n.operatorToken.kind !== SyntaxKind.EqualsToken\n && JAVA_ASSIGNMENT_OPERATOR_KINDS.has(n.operatorToken.kind)) {\n const left = n.left;\n if (isIdentifier(left) && left.text !== undefined) {\n assigned.add(left.text as string);\n }\n }\n n.forEachChild(collect);\n };\n method.body.forEachChild(collect);\n this.javaMethodAssignedNames.set(method, assigned);\n }\n return assigned.has(name as string);\n }\n\n // a write to a parameter this printer declared natively: the right side prints from `Object`\n // locals, so the assignment carries the same checkcast as the call sites. The checker proved the\n // right side assignable to the parameter, so the declared type describes the value received.\n javaParameterAssignmentCast(left, right, identation): string | undefined {\n if (!isIdentifier(left)) {\n return undefined;\n }\n const declaration = this.javaDeclarationOfIdentifier(left);\n if (declaration === undefined || !isParameterDeclaration(declaration) || left.text !== (declaration.name as any)?.text) {\n return undefined;\n }\n const native = this.javaNativeParameterType(declaration) ?? this.javaSplitParameterWriteType(declaration);\n if (native === undefined) {\n return undefined;\n }\n const leftText = this.printNode(left, 0);\n if (this.javaNativeArgumentAlreadyTyped(right, native)) {\n return `${leftText} = ${this.printNode(right, identation)}`;\n }\n if (native === 'Long') {\n return `${leftText} = Helpers.toLongOrNull(${this.printNode(right, identation)})`;\n }\n if (native === JAVA_STRING_LIST_TYPE) {\n return `${leftText} = Helpers.toStringListArg(${this.printNode(right, identation)})`;\n }\n // the checkcast carries its own parentheses: a bare `(T) cond ? a : b` binds the\n // condition, not the whole right side\n return `${leftText} = (${native}) (${this.printNode(right, identation)})`;\n }\n\n // ===== native return types (D-09) =====\n //\n // The native Java return a generated method declaration prints with, when its TS\n javaNativeReturnType(node): string | undefined {\n if (node === undefined || node.kind !== SyntaxKind.MethodDeclaration\n || node.name === undefined || node.type === undefined || node.body === undefined\n || !isClassDeclaration(node.parent)) {\n return undefined;\n }\n if (this.javaReturnTypeInProgress.has(node)) {\n return undefined; // a mutually recursive return chain reads as unproven\n }\n if (this.javaReturnTypeCache.has(node)) {\n return this.javaReturnTypeCache.get(node);\n }\n this.javaReturnTypeInProgress.add(node);\n let result;\n try {\n result = this.javaNativeReturnTypeUncached(node);\n } finally {\n this.javaReturnTypeInProgress.delete(node);\n }\n this.javaReturnTypeCache.set(node, result);\n return result;\n }\n\n javaNativeReturnTypeUncached(node): string | undefined {\n const fileName = node.getSourceFile().fileName;\n const generated = JAVA_NATIVE_PARAMETER_GENERATED_FILES.test(fileName);\n // the printed base tier (below the transpile delimiter) may carry a Boolean return\n // when no venue in the program redeclares the name\n const baseTier = !generated && JAVA_NATIVE_PARAMETER_BASE_FILES.test(fileName) && this.javaIsPrintedMethod(node);\n if ((!generated && !baseTier) || this.isAsyncFunction(node)) {\n return undefined;\n }\n const target = this.javaNativeReturnTypeTarget(node);\n if (target === undefined || (baseTier && target !== 'Boolean')) {\n return undefined;\n }\n // D8: an override prints the base declaration's boxed signature; a Boolean base\n // signature binds every override to Boolean (Java return types are covariant only)\n const ancestor = this.getMethodOverride(node);\n const ancestorBoolean = ancestor !== undefined && this.javaNativeReturnType(ancestor) === 'Boolean';\n if (ancestorBoolean && (target !== 'Boolean' || !this.javaReturnSitesPrintType(node, target)\n || (this.javaMethodReturnsNonNullBoolean(ancestor, 0) && !this.javaMethodReturnsNonNullBoolean(node, 0)))) {\n throw new Error(`java: ${String((node.name as any).text)} overrides a Boolean base method but its returns do not all print Boolean`);\n }\n if (ancestor !== undefined && !ancestorBoolean) {\n return undefined;\n }\n if (!this.javaReturnSitesPrintType(node, target)) {\n return undefined;\n }\n return target;\n }\n\n // a native-Boolean method whose every return prints a primitive Java boolean (never null):\n // a call to it can be a condition as is (unboxing cannot throw)\n javaMethodReturnsNonNullBoolean(method, depth: number): boolean {\n if (method === undefined || depth > 3 || method.body === undefined) {\n return false;\n }\n const name = String((method.name as any)?.text);\n if (this.javaNativeReturnType(method) !== 'Boolean' && !JAVA_THIS_BOOLEAN_METHODS.has(name)) {\n return false;\n }\n let returns = 0;\n let ok = true;\n const scan = (n: Node) => {\n if (!ok || (n !== method && isFunctionLike(n))) {\n return;\n }\n if (isReturnStatement(n)) {\n returns++;\n ok = n.expression !== undefined && this.javaPrintsNonNullBoolean(n.expression, depth);\n return;\n }\n n.forEachChild(scan);\n };\n scan(method.body);\n return ok && returns > 0;\n }\n\n javaPrintsNonNullBoolean(node, depth: number): boolean {\n switch (node?.kind) {\n case SyntaxKind.TrueKeyword:\n case SyntaxKind.FalseKeyword:\n return true;\n case SyntaxKind.ParenthesizedExpression:\n return this.javaPrintsNonNullBoolean(node.expression, depth);\n case SyntaxKind.PrefixUnaryExpression:\n return node.operator === SyntaxKind.ExclamationToken; // prints `!` + a condition\n case SyntaxKind.BinaryExpression:\n return JAVA_BOOLEAN_OPERATOR_KINDS.has(node.operatorToken.kind);\n case SyntaxKind.ConditionalExpression:\n return this.javaPrintsNonNullBoolean(node.whenTrue, depth) && this.javaPrintsNonNullBoolean(node.whenFalse, depth);\n case SyntaxKind.CallExpression:\n return this.javaCallPrintsNonNullBoolean(node, depth + 1);\n }\n return false;\n }\n\n // `this.(...)` resolving to a method proven by javaMethodReturnsNonNullBoolean\n javaCallPrintsNonNullBoolean(node, depth: number): boolean {\n if (this.isArrayIsArrayCall(node) || this.javaPreciseBooleanCall(node) || this.javaStringAffixCall(node)) {\n return true;\n }\n const callee = node.expression;\n if (!isPropertyAccessExpression(callee) || callee.expression.kind !== SyntaxKind.ThisKeyword) {\n return false;\n }\n let declaration;\n try {\n declaration = this.getChecker().getResolvedSignature(node)?.declaration?.resolve();\n } catch (e) {\n return false;\n }\n if (declaration === undefined || declaration.kind !== SyntaxKind.MethodDeclaration) {\n return false;\n }\n if (JAVA_THIS_BOOLEAN_METHODS.has(String(callee.name.text))) {\n return this.javaCallBooleanKind(node) === 'boolean';\n }\n return this.javaMethodReturnsNonNullBoolean(declaration, depth);\n }\n\n javaNativeReturnTypeTarget(node): string | undefined {\n let type;\n try {\n type = this.getChecker().getTypeAtLocation(node.type);\n } catch (e) {\n return undefined;\n }\n if (type === undefined) {\n return undefined;\n }\n const aliasSymbol = (type as any).getAliasSymbol?.();\n if (aliasSymbol !== undefined) {\n const name = aliasSymbol.name;\n const fileName = aliasSymbol.declarations?.[0]?.resolve()?.getSourceFile?.()?.fileName;\n if (fileName !== undefined && JAVA_NATIVE_PARAMETER_SOURCE_FILES.test(fileName) && (name === 'Str' || name === 'Bool')) {\n return name === 'Str' ? 'String' : 'Boolean';\n }\n }\n // a plain (non-alias) string annotation already prints String; the flag proof keeps\n // this rule consistent with the printer's own plain-string handling\n if (type.flags === TypeFlags.String) {\n return 'String';\n }\n // plain `boolean` is the true|false union: the Boolean bit, with no alias (`Bool` is handled above)\n if (aliasSymbol === undefined && (type.flags & TypeFlags.Boolean) !== 0) {\n return 'Boolean';\n }\n return this.isJavaMapStructureType(type) ? JAVA_NATIVE_RETURN_MAP_TYPE : undefined;\n }\n\n // every `return` of the method body (nested functions are separate scopes) prints the\n // target Java type\n javaReturnSitesPrintType(method, target: string): boolean {\n const returns: any[] = [];\n const collect = (n) => {\n if (n === undefined) {\n return;\n }\n if (n !== method && isFunctionLike(n)) {\n return;\n }\n if (isReturnStatement(n)) {\n returns.push(n);\n }\n n.forEachChild(collect);\n };\n collect(method.body);\n if (returns.length === 0) {\n return false;\n }\n return returns.every((r) => r.expression !== undefined\n && this.javaExpressionPrintsType(r.expression, target));\n }\n\n javaExpressionPrintsType(expression, target: string): boolean {\n const node = this.javaUnwrapReturnExpression(expression);\n if (node === undefined) {\n return false;\n }\n if (node.kind === SyntaxKind.NullKeyword) {\n return true; // null is assignable to String / Boolean / Map\n }\n if (isIdentifier(node) && node.text === 'undefined') {\n return true;\n }\n if (node.kind === SyntaxKind.ConditionalExpression) {\n return this.javaExpressionPrintsType(node.whenTrue, target)\n && this.javaExpressionPrintsType(node.whenFalse, target);\n }\n let literal: boolean;\n if (target === JAVA_NATIVE_RETURN_MAP_TYPE) {\n literal = isObjectLiteralExpression(node); // a fresh HashMap literal\n } else if (target === 'String') {\n literal = isStringLiteralLikeNode(node);\n } else if (target === 'Boolean') {\n // the printer's own proof that this expression prints a Java boolean (or a\n // Boolean box): the comparison helpers, `!`, the logical operators, boolean\n // literals and the verified boolean-returning calls\n literal = this.javaPrintsBooleanValue(node, new Set(), 0);\n } else {\n return false;\n }\n return literal\n || this.javaReturnedParameterType(node) === target\n || this.javaReturnedCallType(node) === target\n || (target === 'String' && this.javaStringCallReturn(node));\n }\n\n javaUnwrapReturnExpression(expression) {\n if (expression === undefined) {\n return undefined;\n }\n let node = expression;\n while (node !== undefined && (isParenthesizedExpression(node) || isAsExpression(node)\n || isNonNullExpression(node) || isTypeAssertion(node)\n || node.kind === SyntaxKind.SatisfiesExpression)) {\n node = node.expression;\n }\n return node;\n }\n\n // an identifier bound to a parameter the printer itself declares with the target Java\n // type (javaNativeParameterType: Dict/Market/Currency/Str/Bool annotations)\n javaReturnedParameterType(node): string | undefined {\n if (!isIdentifier(node)) {\n return undefined;\n }\n const declaration = this.javaDeclarationOfIdentifier(node);\n if (declaration === undefined || !isParameterDeclaration(declaration)) {\n return undefined;\n }\n return this.javaNativeParameterType(declaration);\n }\n\n // a `this. (...)` / `super. (...)` return is the callee's native return type\n // (fixpoint over javaNativeReturnType)\n javaReturnedCallType(node): string | undefined {\n if (!isCallExpression(node)) {\n return undefined;\n }\n const callee = node.expression;\n if (!isPropertyAccessExpression(callee)\n || (callee.expression.kind !== SyntaxKind.ThisKeyword\n && !(isIdentifier(callee.expression) && callee.expression.text === 'super'))) {\n return undefined;\n }\n let declaration;\n try {\n declaration = this.getChecker().getResolvedSignature(node)?.declaration?.resolve();\n } catch (e) {\n return undefined;\n }\n if (declaration === undefined || declaration.kind !== SyntaxKind.MethodDeclaration) {\n return undefined;\n }\n return this.javaNativeReturnType(declaration);\n }\n\n // a `this. (...)` return of a hand-written base String producer: the resolved\n // signature must still live in the base tier (a venue override prints its own boxed\n // Object signature)\n javaStringCallReturn(node): boolean {\n if (!isCallExpression(node)) {\n return false;\n }\n const callee = node.expression;\n if (!isPropertyAccessExpression(callee) || callee.expression.kind !== SyntaxKind.ThisKeyword) {\n return false;\n }\n if (!JAVA_STRING_RETURN_BASE_METHODS.has(callee.name.text as string)) {\n return false;\n }\n let declaration;\n try {\n declaration = this.getChecker().getResolvedSignature(node)?.declaration?.resolve();\n } catch (e) {\n return false;\n }\n if (declaration === undefined) {\n return false; // an unresolvable call prints Helpers.callDynamically (Object)\n }\n const fileName = declaration.getSourceFile?.()?.fileName;\n return fileName !== undefined && JAVA_STRING_RETURN_BASE_FILES.test(fileName);\n }\n\n // the alias a parameter's annotation names; `OrderType` ('limit' | 'market' | string) reduces\n // to plain `string` and keeps no aliasSymbol, so read the annotation's type reference instead\n javaParameterAliasSymbol(node, type, checker) {\n const symbol = (type as any).getAliasSymbol?.() ?? (type as any).getSymbol?.();\n if (symbol !== undefined || node.type === undefined || !isTypeReferenceNode(node.type)) {\n return symbol;\n }\n const referenced = checker.getSymbolAtLocation(node.type.typeName);\n const alias = referenced !== undefined && (referenced.flags & SymbolFlags.Alias)\n ? checker.getAliasedSymbol(referenced) : referenced;\n return alias !== undefined && (alias.flags & SymbolFlags.TypeAlias) ? alias : undefined;\n }\n\n // the annotation proof alone, without the heritage check\n javaNativeParameterTypeOf(node): string | undefined {\n if (node === undefined || !isParameterDeclaration(node)\n || node.initializer !== undefined || node.dotDotDotToken !== undefined) {\n return undefined;\n }\n const method = node.parent;\n if (method === undefined || !isMethodDeclaration(method) || !isClassDeclaration(method.parent)) {\n return undefined;\n }\n if (!JAVA_NATIVE_PARAMETER_BASE_FILES.test(node.getSourceFile().fileName)\n && !JAVA_NATIVE_PARAMETER_GENERATED_FILES.test(node.getSourceFile().fileName)) {\n return undefined; // a hand-written java class declares this method, not the printer\n }\n const checker: any = this.checkerOrUndefined();\n if (checker === undefined) {\n return undefined;\n }\n const type = checker.getTypeAtLocation(node);\n if (type === undefined) {\n return undefined;\n }\n const symbol = this.javaParameterAliasSymbol(node, type, checker);\n const name = symbol?.name;\n if (name === undefined || JAVA_NATIVE_PARAMETER_TYPES[name] === undefined) {\n return undefined;\n }\n const excluded = JAVA_NATIVE_PARAMETER_EXCLUDED_POSITIONS[(method.name as any)?.text];\n if (excluded !== undefined && excluded.includes(method.parameters.indexOf(node))) {\n return undefined;\n }\n const declaration = symbol?.declarations?.[0]?.resolve();\n const fileName = declaration?.getSourceFile?.()?.fileName;\n return JAVA_NATIVE_PARAMETER_SOURCE_FILES.test(fileName ?? '') ? JAVA_NATIVE_PARAMETER_TYPES[name] : undefined;\n }\n\n // `k` where the consumer declares k as a Java String: the helper's String branch (the\n // only one that can answer true for a map) is the native lookup, and no null key can\n // reach containsKey\n javaDeclaredStringType(expression) {\n const type = this.javaDeclaredTypeOf(expression);\n return type !== undefined && JAVA_DECLARED_STRING_TYPE.test(type);\n }\n\n printCustomBinaryExpressionIfAny(node, identation) {\n const left = node.left;\n const right = node.right;\n const op = node.operatorToken.kind;\n\n if (left.kind === SyntaxKind.Identifier) {\n this.ReassignedVars[this.getVarKey(left)] = true;\n }\n\n if (left.kind === SyntaxKind.TypeOfExpression) {\n const typeOfExpression = this.handleTypeOfInsideBinaryExpression(\n node,\n identation\n );\n if (typeOfExpression) return typeOfExpression;\n }\n\n // a write to a parameter the printer declared natively casts its right side\n if (op === SyntaxKind.EqualsToken && left.kind === SyntaxKind.Identifier) {\n const assignment = this.javaParameterAssignmentCast(left, right, identation);\n if (assignment !== undefined) {\n return assignment;\n }\n }\n\n // destructuring: [a,b] = this.method()\n if (\n op === SyntaxKind.EqualsToken &&\n left.kind === SyntaxKind.ArrayLiteralExpression\n ) {\n const arrayBindingPatternElements = left.elements;\n const parsedArrayBindingElements = arrayBindingPatternElements.map((e) => {\n this.ReassignedVars[this.getVarKey(e)] = true;\n return this.printNode(e, 0);\n });\n const syntheticName = parsedArrayBindingElements.join(\"\") + \"Variable\";\n\n let arrayBindingStatement =\n `var ${syntheticName} = ${this.printNode(right, 0)};\\n`;\n\n parsedArrayBindingElements.forEach((e, index) => {\n // a destructuring target the printer declares natively carries the cast the\n // synthesized `.get(index)` result needs (a plain `Object` read)\n let elementValue = `((java.util.List) ${syntheticName}).get(${index})`;\n const target = arrayBindingPatternElements[index];\n if (isIdentifier(target)) {\n const declaration = this.javaDeclarationOfIdentifier(target);\n const native = declaration !== undefined && isParameterDeclaration(declaration)\n ? (this.javaNativeParameterType(declaration) ?? this.javaSplitParameterWriteType(declaration)) : undefined;\n if (native === 'Long') {\n elementValue = `Helpers.toLongOrNull(${elementValue})`;\n } else if (native !== undefined) {\n elementValue = `(${native}) ${elementValue}`;\n }\n }\n const terminator = index < parsedArrayBindingElements.length - 1 ? \";\\n\" : \"\";\n arrayBindingStatement += this.getIden(identation) + `${e} = ${elementValue}` + terminator;\n });\n\n return arrayBindingStatement;\n }\n\n // ---------------------------------------------------------------\n // setter for element-access assignments: a[b] = v\n // ---------------------------------------------------------------\n if (op === SyntaxKind.EqualsToken &&\n left.kind === SyntaxKind.ElementAccessExpression) {\n // Collect base container and all keys (inner-most key is last).\n const keys: any[] = [];\n let baseExpr: any = null;\n let cur: any = left;\n while (isElementAccessExpression(cur)) {\n keys.unshift(cur.argumentExpression); // prepend\n const expr = cur.expression;\n if (!isElementAccessExpression(expr)) {\n baseExpr = expr;\n break;\n }\n cur = expr;\n }\n\n const containerStr = this.printNode(baseExpr, 0);\n const keyStrs = keys.map(k => this.printNode(k, 0));\n\n // Build GetValue(GetValue( ... )) chain for all but the last key; the first\n // step reads the receiver itself, so a declared map indexes natively and only\n // the `any` steps above it keep the helper (Go: goElementWriteChain).\n let acc = containerStr;\n let firstKey = 0;\n const chainRead = (keyStrs.length > 1) ? this.javaDeclaredChainContainerRead(left, keys.length) : undefined;\n if ((keyStrs.length > 1) && this.javaDeclaredMapReceiver(baseExpr)\n && isStringLiteralLikeNode(keys[0])) {\n acc = `${containerStr}.get(${keyStrs[0]})`;\n firstKey = 1;\n } else if (chainRead !== undefined) {\n acc = chainRead;\n firstKey = 1;\n } else if (keyStrs.length > 1) {\n // `this.[k1][k2] = v`: the bottom step reads the hand-written base map\n // field natively (JAVA_FIELD_TYPES), every step above it keeps the helper\n const fieldRead = this.javaFieldMapReadText(baseExpr, keys[0]);\n if (fieldRead !== undefined) {\n acc = fieldRead;\n firstKey = 1;\n }\n }\n for (let i = firstKey; i < keyStrs.length - 1; i++) {\n acc = `${this.ELEMENT_ACCESS_WRAPPER_OPEN}${acc}, ${keyStrs[i]}${this.ELEMENT_ACCESS_WRAPPER_CLOSE}`;\n }\n\n const prefixes = \"\";\n\n\n const lastKey = keyStrs[keyStrs.length - 1];\n const rhs = this.printNode(right, 0);\n const keyArg = this.elementWriteKeyText(keys[keys.length - 1], lastKey);\n\n if (this.elementWriteTargetsMap(left.expression, baseExpr, keys, right)) {\n // a receiver declared as a Map already carries the type the put binds on\n const target = (keys.length === 1 && this.javaDeclaredMapReceiver(baseExpr))\n ? acc : `((${this.OBJECT_KEYWORD})${acc})`;\n return `${prefixes}${target}.put(${keyArg}, ${rhs})`;\n }\n // a declared Map local takes a non-null value: the helper's only non-put branch is\n // the ConcurrentHashMap null removal, so the native put is the same write\n if (keys.length === 1 && this.javaDeclaredMapReceiver(baseExpr)\n && (isStringLiteralLikeNode(keys[0]) || this.javaDeclaredStringType(keys[0]))\n && this.javaPrintsNonNullValue(right)) {\n return `${prefixes}${acc}.put(${lastKey}, ${rhs})`;\n }\n if (this.javaHx4MapPutIsNative(baseExpr, keys)) {\n return `${prefixes}${acc}.put(${keyArg}, ${rhs})`;\n }\n\n return `${prefixes}Helpers.addElementToObject(${acc}, ${lastKey}, ${rhs})`;\n }\n\n if (op === SyntaxKind.InKeyword) {\n const objectType = this.getChecker().getTypeAtLocation(right);\n const keyType = this.getChecker().getTypeAtLocation(left);\n const objText = this.printNode(right, 0);\n const keyText = this.printNode(left, 0);\n // A key the checker does not prove a Java String: the helper's map branch and containsKey both\n // answer false for it, and the null test keeps ConcurrentHashMap/TreeMap receivers from throwing\n // on a null key. The key prints once per guard, so it must be a side-effect-free read.\n let guarded: string | undefined;\n if (this.isJavaStringType(keyType) || this.javaDeclaredStringType(left)) {\n guarded = '';\n } else if (this.javaSideEffectFreeReference(left) && !this.javaOperandPrintsPrimitiveNumber(left)\n && !this.isNullishLiteral(left)\n && left.kind !== SyntaxKind.TrueKeyword && left.kind !== SyntaxKind.FalseKeyword) {\n guarded = `${keyText} != null && `;\n }\n const withGuard = (read: string) => (guarded ? `(${guarded}${read})` : read);\n if (guarded !== undefined) {\n // the declaration the pass rewrote already carries the map type (and, for a\n // `this.` field or a retyped local, the surface that names it): no cast needed\n if (this.javaDeclaredMapReceiver(right)) {\n return withGuard(`${objText}.containsKey(${keyText})`);\n }\n if (this.isJavaMapType(objectType)) {\n return withGuard(`((java.util.Map)${objText}).containsKey(${keyText})`);\n }\n // `Dictionary | undefined` (a no-overload safe* signature): the helper answers\n // false for the nullish arm, the guard keeps exactly that\n if (this.isJavaNullableMapType(objectType) && this.javaRepeatableOperand(right)) {\n return `(${objText} != null && ${guarded}((java.util.Map)${objText}).containsKey(${keyText}))`;\n }\n }\n return `Helpers.inOp(${objText}, ${keyText})`;\n }\n\n const hx4J05 = this.printHx4J05ModComparison(left, right, op);\n if (hx4J05 !== undefined) {\n return hx4J05;\n }\n // native comparison when both operands provably print as Java numbers. `>` is exact for every\n // numeric pair (isGreaterThan is a toDouble compare, NaN included); `>=` / `<` / `<=` also go\n // through the helper's isEqual, so they need operands isEqual reproduces exactly.\n if (op === SyntaxKind.LessThanToken || op === SyntaxKind.GreaterThanToken ||\n op === SyntaxKind.LessThanEqualsToken || op === SyntaxKind.GreaterThanEqualsToken) {\n const leftKind = this.javaPrimitiveOperandKind(left);\n const rightKind = this.javaPrimitiveOperandKind(right);\n const orderingSafe = op === SyntaxKind.GreaterThanToken\n || this.javaComparisonOperandsAreExact(left, leftKind, right, rightKind);\n if (leftKind !== undefined && rightKind !== undefined && orderingSafe) {\n return `${this.printNode(left, 0)} ${this.SupportedKindNames[op]} ${this.printNode(right, 0)}`;\n }\n const declaredCompare = this.printDeclaredNumericComparison(left, right, op);\n if (declaredCompare !== undefined) {\n return declaredCompare;\n }\n }\n\n // only print the operands when this op is actually handled here; otherwise\n // the base printBinaryExpression prints them, and doing it eagerly means\n // every unhandled binary expression gets its subtrees printed twice\n if (op === SyntaxKind.PlusEqualsToken || op === SyntaxKind.MinusEqualsToken || op in this.binaryExpressionsWrappers) {\n const leftText = this.printNode(left, 0);\n const rightText = this.printNode(right, 0);\n\n const inlined = this.printInlineHelperArithmetic(left, right, leftText, rightText, op);\n if (inlined !== undefined) {\n return inlined;\n }\n\n\n if (op === SyntaxKind.PlusEqualsToken) {\n return `${leftText} = Helpers.add(${leftText}, ${rightText})`;\n }\n\n if (op === SyntaxKind.MinusEqualsToken) {\n return `${leftText} = Helpers.subtract(${leftText}, ${rightText})`;\n }\n\n const wrapper = this.binaryExpressionsWrappers[op];\n const nativeEquality = this.printNativeEqualityIfProvable(node, leftText, rightText);\n if (nativeEquality !== undefined) {\n return nativeEquality;\n }\n return `${wrapper[0]}${leftText}, ${rightText}${wrapper[1]}`;\n }\n\n return undefined;\n }\n\n\n // dict-shaped values are Map in the Java port: raw HashMap/ConcurrentHashMap\n // or a types.TypedMap view (AbstractMap over the raw payload). Proven by the\n // checker (string index signature, or an interface/alias declared in the base types file).\n // a concrete (non-any, non-union, non-generic) type the structure proofs below can reason about\n javaConcreteStructureType(type) {\n const excludedFlags = TypeFlags.Any | TypeFlags.Unknown | TypeFlags.Union\n | TypeFlags.Intersection | TypeFlags.Undefined | TypeFlags.Null\n | TypeFlags.TypeParameter | TypeFlags.Conditional | TypeFlags.Never;\n return type !== undefined && (type.flags & excludedFlags) === 0;\n }\n\n isJavaMapStructureType(type) {\n if (!this.javaConcreteStructureType(type)) {\n return false;\n }\n const checker = this.getChecker();\n if (checker.isArrayType(type) || checker.isTupleType(type)) {\n return false;\n }\n if (type.getStringIndexType() !== undefined) {\n return true;\n }\n const symbol = (type as any).getAliasSymbol?.() ?? type.getSymbol?.();\n const declaration = symbol?.declarations?.[0]?.resolve();\n const fileName = declaration?.getSourceFile?.()?.fileName;\n return fileName !== undefined && /(^|\\/)ts\\/src\\/base\\/types\\.ts$/.test(fileName);\n }\n\n // tuples are List in the Java port (types.TypedList). Only an index inside the\n // tuple's required elements goes native: .get(i) throws out of range where the helper\n // returns null, so non-tuple array reads (any[], string[], ...) keep the helper.\n isJavaListStructureType(type) {\n return this.javaConcreteStructureType(type) && this.getChecker().isTupleType(type);\n }\n\n tupleRequiredElementCount(type) {\n const flags = ((type as any)?.isTypeReference?.() ? (type as any).getTarget().elementFlags : undefined) ?? (type as any)?.elementFlags ?? [];\n let required = 0;\n for (const flag of flags) {\n if (flag !== ElementFlags.Optional && flag !== ElementFlags.Rest) {\n required++;\n } else {\n break;\n }\n }\n return required;\n }\n\n // non-tuple array reads: the Java representation is java.util.List (the printer maps every\n // array type to one), but neither the receiver nor the index is bounded statically, so the\n // read keeps the helper's null / off-range outcomes.\n isJavaArrayStructureType(type) {\n if (!this.javaConcreteStructureType(type)) {\n return false;\n }\n const checker = this.getChecker();\n if (checker.isTupleType(type)) {\n return false; // handled by the tuple branch, where the bound is provable\n }\n return checker.isArrayType(type);\n }\n\n // the null-safe element read prints its receiver once per guard; only a reference whose\n // printed Java has no side effects (identifier, `this`/`this.field` chain) may repeat it.\n javaSideEffectFreeReference(node) {\n if (node === undefined) {\n return false;\n }\n switch (node.kind) {\n case SyntaxKind.Identifier:\n case SyntaxKind.ThisKeyword:\n return true;\n case SyntaxKind.ParenthesizedExpression:\n case SyntaxKind.PropertyAccessExpression:\n return this.javaSideEffectFreeReference(node.expression);\n default:\n return false;\n }\n }\n\n // receivers whose printed elements the ccxt post-pass types as String FROM the helper call\n // (`x.split(sep)` and string-literal array producers): those locals narrow to String only\n // while the read prints `Helpers.GetValue(`, so their reads keep the helper.\n javaStringElementsReceiver(node) {\n if (!isIdentifier(node)) {\n return false;\n }\n const declaration = this.getChecker().getSymbolAtLocation(node)?.valueDeclaration?.resolve();\n const initializer = declaration !== undefined && isVariableDeclaration(declaration) ? declaration.initializer : undefined;\n if (initializer === undefined) {\n return false;\n }\n if (isCallExpression(initializer) && isPropertyAccessExpression(initializer.expression)) {\n return initializer.expression.name?.text === 'split';\n }\n if (isArrayLiteralExpression(initializer)) {\n return initializer.elements.length > 0 && initializer.elements.every((element) =>\n element.kind === SyntaxKind.StringLiteral\n || element.kind === SyntaxKind.NoSubstitutionTemplateLiteral);\n }\n return false;\n }\n\n isLeftSideOfAssignment(node) {\n const parent = node.parent;\n if (parent?.kind !== SyntaxKind.BinaryExpression || parent.left !== node) {\n return false;\n }\n return JAVA_ASSIGNMENT_OPERATOR_KINDS.has(parent.operatorToken.kind);\n }\n\n // The declared Java type of a local is known to the pass that rewrites the declaration\n // text (build/java-local-types.js): it records every local it typed here. Reads consult\n // it; with no consumer installed the table is empty and every read keeps the helper.\n javaDeclaredLocalTypeResolver: ((declaration: Node) => string | undefined) | undefined;\n\n // the declaration node behind an identifier, when the checker resolves one\n javaDeclarationOfIdentifier(expression) {\n if (expression === undefined || !isIdentifier(expression)) {\n return undefined;\n }\n const checker: any = this.checkerOrUndefined();\n if (checker === undefined) {\n return undefined;\n }\n const symbol = checker.getSymbolAtLocation(expression);\n const declaration = symbol?.valueDeclaration?.resolve() ?? symbol?.declarations?.[0]?.resolve();\n const kind = declaration?.kind;\n return kind === SyntaxKind.VariableDeclaration || kind === SyntaxKind.Parameter ? declaration : undefined;\n }\n\n // `x[\"lit\"]` where the consumer declares x as a Java map: the native read returns the\n // element or null, exactly what the helper's Map branch returns, and the declaration\n // already carries the type, so no cast is needed.\n javaDeclaredMapReceiver(expression) {\n const declaration = this.javaDeclarationOfIdentifier(expression);\n if (declaration === undefined) {\n return false;\n }\n if (expression.text !== declaration.name?.text) {\n return false; // a capture rename prints `final Object finalX = x` (Object)\n }\n const type = this.javaDeclaredTypeOfDeclaration(declaration);\n return type !== undefined && JAVA_DECLARED_MAP_TYPES.test(type);\n }\n\n // `x[i]` where x is a declared java List and i is the int counter of `for (var i = `:\n // GetValue answers null for a null receiver or index outside [0, size) while List.get throws, so\n // the emission carries the same tests. `||` short-circuits over identifiers, so nothing runs twice.\n javaDeclaredListElementRead(node, isCounter) {\n if (node.parent?.kind === SyntaxKind.ExpressionStatement) {\n return undefined; // a bare conditional expression is not a Java statement\n }\n // the ws-tier post-pass types `Object client = Helpers.GetValue(..)` by that exact\n // printed text (build/javaTranspiler.ts postProcessWsJava: `Client client =\n // (Client)Helpers.GetValue(..)`). A native read drops the shape and the checkcast\n if (node.parent?.kind === SyntaxKind.VariableDeclaration\n && (node.parent as any).initializer === node\n && ((node.parent as any).name?.text === 'client')) {\n return undefined;\n }\n const declared = this.javaDeclaredTypeOf(node.expression);\n const declaredList = declared !== undefined && JAVA_DECLARED_LIST_TYPES.test(declared);\n let target;\n let list;\n if (declaredList) {\n target = this.printNode(node.expression, 0);\n list = target;\n } else {\n const type = this.getChecker().getTypeAtLocation(node.expression);\n if (!this.isJavaListValueType(type) || this.isVarargsArrayReference(node.expression)\n || !this.javaSideEffectFreeReference(node.expression)) {\n return undefined;\n }\n target = this.printNode(node.expression, 0);\n list = `((java.util.List)${target})`;\n }\n if (!isCounter && Number(node.argumentExpression.text) > 2147483647) {\n return undefined; // printNumericLiteral would add an `L` suffix List.get cannot take\n }\n if (this.javaStringElementsReceiver(node.expression)) {\n return undefined; // its String consumers are typed from the `Helpers.GetValue(` prefix\n }\n const indexText = this.printNode(node.argumentExpression, 0);\n const lowerBound = isCounter ? `${indexText} < 0 || ` : '';\n return `(${target} == null || ${lowerBound}${indexText} >= ${list}.size() ? null : ${list}.get(${indexText}))`;\n }\n\n // `x[k]` where a consumer declares x a java Map and the key is not a literal: the\n // helper's Map branch is the map accessor behind its own tests — a null receiver, a\n // null key and a key that is not a String all answer null, and a String-keyed map's\n javaDeclaredMapElementRead(node) {\n if (node.parent?.kind === SyntaxKind.ExpressionStatement) {\n return undefined; // a bare conditional expression is not a Java statement\n }\n if (this.printElementAccessExpressionExceptionIfAny(node) !== undefined\n || this.isLeftSideOfAssignment(node)) {\n return undefined;\n }\n if (!this.javaDeclaredMapReceiver(node.expression)) {\n return undefined;\n }\n const key = node.argumentExpression;\n if (!isIdentifier(key) || !this.javaRepeatableOperand(key)) {\n return undefined; // the guard prints the key twice\n }\n const declared = this.javaDeclaredTypeOf(key);\n if (declared !== undefined && JAVA_PRIMITIVE_DECLARED_TYPES.has(declared.trim())) {\n return undefined; // a java primitive cannot take the `instanceof` test\n }\n if (declared === undefined && this.javaOperandPrintsPrimitiveNumber(key)) {\n return undefined;\n }\n let keyType;\n try {\n keyType = this.getChecker().getTypeAtLocation(key);\n } catch (e) {\n return undefined;\n }\n if (keyType === undefined\n || this.getChecker().isArrayType(keyType) || this.getChecker().isTupleType(keyType)) {\n return undefined;\n }\n const target = this.printNode(node.expression, 0);\n const keyText = this.printNode(key, 0);\n if (keyType.getAliasSymbol?.() === undefined && keyType.flags === TypeFlags.String) {\n // a plain `string` key prints a java String; the null test keeps a receiver that\n // aliases a ConcurrentHashMap from throwing on a null the alias admits\n return `(${target} == null || ${keyText} == null ? null : ${target}.get(${keyText}))`;\n }\n return `(${target} == null || !(${keyText} instanceof String) ? null : ${target}.get(${keyText}))`;\n }\n\n // the identifier of a `for (var i = ; …; i++)` counter that still prints as\n // `i`: the JN capture rename prints `finalI`, a `final Object` box, which is not an int\n javaPrimitiveCounterIndex(node) {\n if (!this.isJavaPrimitiveCounterReference(node)) {\n return false;\n }\n const declaration = this.javaDeclarationOfIdentifier(node);\n return declaration !== undefined && node.text === declaration.name?.text;\n }\n\n // `this.[k]` on a hand-written base map field (JAVA_FIELD_TYPES): the helper's Map branch is\n // the native `get`. The helper answers null for a null receiver or key, so both stay guarded; the\n // receiver and key are side-effect free. An unguarded read has no parens so a checkcast binds it.\n javaFieldMapReadText(receiver, key): string | undefined {\n if (receiver === undefined || receiver.kind !== SyntaxKind.PropertyAccessExpression\n || receiver.expression?.kind !== SyntaxKind.ThisKeyword) {\n return undefined;\n }\n const name = receiver.name?.text;\n const field = (typeof name === 'string') ? JAVA_FIELD_TYPES[name] : undefined;\n if (field === undefined || field.map !== true) {\n return this.javaJ02FieldMapReadText(receiver, key);\n }\n const keyText = this.printNode(key, 0);\n let keyGuarded = false;\n const checker: any = this.checkerOrUndefined();\n if (checker === undefined) {\n return undefined;\n }\n const keyType = checker.getTypeAtLocation(key);\n if (!this.isJavaStringType(keyType) && !this.javaDeclaredStringType(key)) {\n // the guard prints the key twice, so only a repeatable operand can take it\n if (!this.javaRepeatableOperand(key)) {\n return undefined;\n }\n keyGuarded = true;\n }\n const target = this.printNode(receiver, 0);\n const read = `((java.util.Map)${target}).get(${keyText})`;\n if (!keyGuarded && field.nullable !== true) {\n return read;\n }\n const receiverGuard = (field.nullable === true) ? `${target} == null ? null : ` : '';\n return `(${keyGuarded ? `${keyText} == null ? null : ` : ''}${receiverGuard}${read})`;\n }\n\n // the read stands only where no exchange-specific override claims the site and the node\n // is not a write target\n javaFieldMapReadIfAllowed(node): string | undefined {\n const read = this.javaFieldMapReadText(node.expression, node.argumentExpression);\n if (read === undefined) {\n return undefined;\n }\n if (this.printElementAccessExpressionExceptionIfAny(node) !== undefined || this.isLeftSideOfAssignment(node)) {\n return undefined;\n }\n return read;\n }\n\n // `x[k]` reads: emit the native container accessor when the checker proves the Java\n // representation of `x`, otherwise return undefined so the base prints Helpers.GetValue.\n printCheckerTypedElementAccessRead(node) {\n const key = node.argumentExpression;\n const isStringKey = isStringLiteralLikeNode(key);\n const isNumberKey = isNumericLiteral(key);\n const isCounterKey = !isStringKey && !isNumberKey && this.javaPrimitiveCounterIndex(key);\n if (!isStringKey && !isNumberKey && !isCounterKey) {\n // a `this.` map read carries its own Java proof (JAVA_FIELD_TYPES): the\n // field declaration the printer cannot see is what makes `k` bind natively\n const field = this.javaFieldMapReadIfAllowed(node);\n if (field !== undefined) {\n return field;\n }\n // a declared map (a local the build layer typed, or a param the printer retypes)\n // is the other proof a non-literal key binds natively\n return this.javaDeclaredMapElementRead(node);\n }\n if (this.printElementAccessExpressionExceptionIfAny(node) !== undefined) {\n return undefined; // an exchange-specific override wins, the base prints it\n }\n if (this.isLeftSideOfAssignment(node)) {\n return undefined;\n }\n const type = this.getChecker().getTypeAtLocation(node.expression);\n if (isStringKey) {\n if (!this.isJavaMapStructureType(type)) {\n if (!this.javaDeclaredMapReceiver(node.expression)) {\n // a literal key on a table field the checker does not type (balance is\n // `any`) still has the field table's Java proof\n return this.javaFieldMapReadIfAllowed(node);\n }\n // the declared local is already a map: the accessor binds with no cast\n return `${this.printNode(node.expression, 0)}.get(${this.printNode(key, 0)})`;\n }\n const target = this.printNode(node.expression, 0);\n return `((java.util.Map)${target}).get(${this.printNode(key, 0)})`;\n }\n if (isCounterKey) {\n // a `var` int loop index on a declared List: the only proof that prints an int\n return this.javaDeclaredListElementRead(node, true);\n }\n const index = Number(key.text);\n if (!Number.isInteger(index) || index < 0) {\n return undefined;\n }\n if (this.isJavaListStructureType(type)) {\n if (index >= this.tupleRequiredElementCount(type)) {\n return undefined;\n }\n const target = this.printNode(node.expression, 0);\n return `((java.util.List)${target}).get(${this.printNode(key, 0)})`;\n }\n if (!this.isJavaArrayStructureType(type)) {\n // the checker leaves the receiver boxed: a declared List still reads natively\n return this.javaDeclaredListElementRead(node, false);\n }\n if (!this.javaSideEffectFreeReference(node.expression) || this.javaStringElementsReceiver(node.expression)) {\n return undefined;\n }\n // `Helpers.GetValue` returns null for a null receiver and off range; List.get\n // throws on both, so the native read carries both guards. `||` short-circuits and\n // the receiver is side-effect free, so it is evaluated as often as before.\n const target = this.printNode(node.expression, 0);\n const list = `((java.util.List)${target})`;\n const keyText = this.printNode(key, 0);\n return `(${target} == null || ${keyText} >= ${list}.size() ? null : ${list}.get(${keyText}))`;\n }\n\n printElementAccessExpression(node, identation) {\n return this.printCheckerTypedElementAccessRead(node) ?? super.printElementAccessExpression(node, identation);\n }\n\n\n // ---- helper-family inlining: `+ - * / += -=` ---------------------------\n // `x + y` normally prints Helpers.add, `- * /` print Helpers.subtract/multiply/\n // divide, and `+=`/`-=` print `x = Helpers.add/subtract(...)`. They print native\n // Java when BOTH operands are checker-typed in the same non-nullable scalar family\n // and the printed operands carry the matching Java kind, so the native expression\n // has the helper's boxed result kind and value on every path.\n\n // the TypeScript scalar family of a binary operand: plain `string`/`number` and\n // their literals only. The nullable aliases (Str/Int/Num/Bool), unions and `any`\n // can hold undefined at runtime, which the helpers absorb.\n javaScalarFamily(node): string | undefined {\n const checker: any = this.checkerOrUndefined();\n if (checker === undefined) {\n return undefined;\n }\n const type = checker.getTypeAtLocation(node);\n if (type === undefined || type.getAliasSymbol?.() !== undefined) {\n return undefined;\n }\n const flags = type.flags;\n if (flags === TypeFlags.String || flags === TypeFlags.StringLiteral) {\n return 'string';\n }\n if (flags === TypeFlags.Number || flags === TypeFlags.NumberLiteral) {\n return 'number';\n }\n return undefined;\n }\n\n // true when the printed Java for this operand is statically a String: a string\n // literal, a nested `+` this rule prints as a native concat, or a form the\n // embedding build layer's javaExpressionTypeResolver names `String` (a local whose\n // emitted declaration is `String = `, a call to a hand-written `public\n // String` runtime method). Java compiles `+` only when at least one operand is\n // statically a String, so a String local anchors the concat like a literal does.\n javaProvableString(node): boolean {\n if (node === undefined) {\n return false;\n }\n switch (node.kind) {\n case SyntaxKind.StringLiteral:\n case SyntaxKind.NoSubstitutionTemplateLiteral:\n return true;\n case SyntaxKind.ParenthesizedExpression:\n return this.javaProvableString(node.expression);\n case SyntaxKind.BinaryExpression:\n return this.javaNativeConcat(node);\n }\n return this.javaResolvedString(node);\n }\n\n // the embedding build layer's proof of the concrete printed Java type of an\n // expression (installed like csharpExpressionTypeResolver); only `String` is\n // consumed here, and a missing resolver proves nothing\n javaResolvedString(node): boolean {\n if (node === undefined || this.javaExpressionTypeResolver === undefined) {\n return false;\n }\n try {\n return this.javaExpressionTypeResolver(node) === 'String';\n } catch (e) {\n return false;\n }\n }\n\n // does this `+` node print as a native concat (both sides plain string, one side a\n // provable String)? Mirrors printInlineHelperArithmetic so callers can reason about\n // the printed text of a nested concat.\n javaNativeConcat(node): boolean {\n if (node?.operatorToken?.kind !== SyntaxKind.PlusToken) {\n return false;\n }\n if (this.javaScalarFamily(node.left) !== 'string' || this.javaScalarFamily(node.right) !== 'string') {\n return false;\n }\n return this.javaProvableString(node.left) || this.javaProvableString(node.right);\n }\n\n // B-13: the `+` / `+=` concat drops the helper when one side's printed Java is\n // provably a String and the other side is an operand Helpers.add's String branch\n // converts exactly like javac's `+` does\n javaStringConcatIsProvable(left, right, leftFamily, rightFamily) {\n const leftProvable = this.javaProvableString(left);\n const rightProvable = this.javaProvableString(right);\n if (leftFamily === 'string' && rightFamily === 'string' && (leftProvable || rightProvable)) {\n return true;\n }\n return (leftProvable && this.javaConcatOtherOperandIsSafe(right))\n || (rightProvable && this.javaConcatOtherOperandIsSafe(left));\n }\n\n // the non-anchor operand of a concat: a value StringBuilder.append and Helpers.add's\n // `String.valueOf` branch turn into the same text. Inlined when it is a printed String, when the\n // checker proves a plain non-nullable `string`, or when the type cannot be a boxed Double.\n javaConcatOtherOperandIsSafe(node) {\n if (node === undefined) {\n return false;\n }\n if (this.javaProvableString(node) || this.javaScalarFamily(node) === 'string') {\n return true;\n }\n return this.javaConcatOperandPrintsAsValue(node) && !this.javaConcatOperandCanBeDouble(node);\n }\n\n // a bare value an infix operator can take without extra parentheses: a ternary,\n // assignment or comma expression printed here would re-parse (`(x + c ? a : b)`),\n // and an optional-chain call prints a guarded shape that is not an operand\n javaConcatOperandPrintsAsValue(node) {\n if (node === undefined) {\n return false;\n }\n if (isParenthesizedExpression(node)) {\n return this.javaConcatOperandPrintsAsValue(node.expression);\n }\n switch (node.kind) {\n case SyntaxKind.Identifier:\n case SyntaxKind.StringLiteral:\n case SyntaxKind.NoSubstitutionTemplateLiteral:\n case SyntaxKind.NumericLiteral:\n case SyntaxKind.TrueKeyword:\n case SyntaxKind.FalseKeyword:\n case SyntaxKind.NullKeyword:\n case SyntaxKind.ThisKeyword:\n case SyntaxKind.NewExpression:\n case SyntaxKind.ArrayLiteralExpression:\n return true;\n case SyntaxKind.PropertyAccessExpression:\n case SyntaxKind.ElementAccessExpression:\n case SyntaxKind.CallExpression:\n return node.questionDotToken === undefined;\n }\n return false;\n }\n\n // a Double operand makes Helpers.add take its `instanceof Double` branch and return a NUMBER, while\n // javac's `+` concatenates, so an operand that can be a boxed Double keeps the helper. Only types\n // that can never hold a number are accepted, plus integer literals that print as a Java `long`.\n javaConcatOperandCanBeDouble(node) {\n if (this.javaProvableNumericKind(node) === 'long') {\n return false;\n }\n const checker: any = this.checkerOrUndefined();\n if (checker === undefined) {\n return true;\n }\n const type = checker.getTypeAtLocation(node);\n if (type === undefined) {\n return true;\n }\n const notNumber = TypeFlags.String | TypeFlags.StringLiteral | TypeFlags.TemplateLiteral\n | TypeFlags.Boolean | TypeFlags.BooleanLiteral | TypeFlags.Object | TypeFlags.Null\n | TypeFlags.Undefined | TypeFlags.Void | TypeFlags.Never;\n const notNumeric = (t) => {\n if (t === undefined || t.flags === 0) {\n return false;\n }\n if (t.isUnionType?.()) {\n return t.getTypes().every(notNumeric);\n }\n return (t.flags & ~notNumber) === 0;\n };\n return !notNumeric(type);\n }\n\n // the Java kind a `this.(...)` call provably prints with (JAVA_THIS_RETURN_TYPES), or\n // undefined. The signature must resolve to the base tier or the Date.now lib signature of the\n // functions/time.ts mixin; a venue override prints its own (usually Object) signature.\n javaThisCallNumericKind(node): string | undefined {\n if (node?.kind !== SyntaxKind.CallExpression) {\n return undefined;\n }\n const callee = node.expression;\n if (callee?.kind !== SyntaxKind.PropertyAccessExpression || callee.expression?.kind !== SyntaxKind.ThisKeyword) {\n return undefined;\n }\n const name = callee.name?.text;\n if (typeof name !== 'string') {\n return undefined;\n }\n const kind = JAVA_THIS_RETURN_TYPES[name];\n if (kind === undefined) {\n return undefined;\n }\n const checker: any = this.checkerOrUndefined();\n const declaration = checker.getResolvedSignature(node)?.declaration?.resolve();\n const fileName = declaration?.getSourceFile?.().fileName;\n if (typeof fileName !== 'string') {\n return undefined;\n }\n if (!JAVA_THIS_RETURN_TYPES_BASE_FILE.test(fileName) && !JAVA_THIS_RETURN_TYPES_LIB_FILE.test(fileName)) {\n return undefined;\n }\n return kind;\n }\n\n // the Java kind a numeric operand provably prints with: decimal integer literal -> 'long',\n // fractional literal -> 'double', a nested native `+ - * /` -> its kind, a local retyped\n // `Long`/`Double` -> that kind. Hex/binary literals, negatives, calls, untyped locals: undefined.\n javaProvableNumericKind(node, allowDeclaredLocals = true): string | undefined {\n if (node === undefined) {\n return undefined;\n }\n if (node.kind === SyntaxKind.ParenthesizedExpression) {\n return this.javaProvableNumericKind(node.expression, allowDeclaredLocals);\n }\n if (isNumericLiteral(node)) {\n const text = node.text;\n if (/^0[xXbBoO]/.test(text)) {\n return undefined;\n }\n return /[.eE]/.test(text) ? 'double' : 'long';\n }\n if (node.kind === SyntaxKind.Identifier) {\n if (this.javaPrintedIntCounter(node)) {\n return 'int';\n }\n if (allowDeclaredLocals && this.javaLongParameterRead(node) && this.javaNullGuardAdmitsRead(node)) {\n return 'long'; // an unwritten Long core parameter behind a null test\n }\n return allowDeclaredLocals ? this.javaDeclaredNumericLocalKind(node) : undefined;\n }\n if (node.kind === SyntaxKind.CallExpression) {\n // hand-written base accessors that box a primitive (`Long milliseconds()`,\n // `int parseTimeframe(..)`) - never null, so they anchor the native arithmetic\n if (this.javaBaseTimeLongCall(node)) {\n return 'long';\n }\n if (this.javaBaseIntCall(node)) {\n return 'int';\n }\n // indexOf/search print int, Math.round a primitive long (javaPrintedCallKind)\n const printed = this.javaPrintedCallKind(node);\n return (printed === 'int' || printed === 'long') ? printed : undefined;\n }\n if (node.kind === SyntaxKind.BinaryExpression) {\n return this.javaNativeArithmeticKind(node, allowDeclaredLocals);\n }\n if (this.javaLengthIntRead(node)) {\n return 'int';\n }\n return undefined;\n }\n\n // a bare identifier the embedding layer declares `Long`/`Double` prints as a boxed numeric, but a\n // null box would NPE where the helpers return null, so the checker must see a plain non-nullable\n // number here (nullable aliases and `any` excluded; a narrowed `number` is a real guard in Java).\n javaDeclaredNumericLocalKind(node): string | undefined {\n if (!this.javaOperandIsNonNullNumber(node) || !this.javaIdentifierKeepsDeclaredName(node)\n || !this.javaIdentifierPrintsDeclaredName(node)) {\n return undefined;\n }\n const declaration = this.javaDeclarationOfIdentifier(node);\n let javaType;\n if (declaration !== undefined) {\n try {\n javaType = this.javaDeclaredTypeOfDeclaration(declaration);\n } catch (e) {\n javaType = undefined;\n }\n }\n if (javaType === undefined && typeof this.javaExpressionTypeResolver === 'function') {\n try {\n javaType = this.javaExpressionTypeResolver(node);\n } catch (e) {\n javaType = undefined;\n }\n }\n return this.javaDeclaredNumericTypeKind(javaType);\n }\n\n // the numeric kind a printed Java declaration type names, or undefined for every other\n // type (`Object`, `String`, a boxed collection)\n javaDeclaredNumericTypeKind(javaType): string | undefined {\n if (javaType === undefined) {\n return undefined;\n }\n const type = String(javaType).replace(/^final\\s+/, '').trim();\n const kinds = new Map([['Long', 'long'], ['long', 'long'], ['Double', 'double'], ['double', 'double'],\n ['Integer', 'int'], ['int', 'int']]);\n return kinds.get(type);\n }\n\n // the use prints the declaration's own name: a local or parameter the printer renamed\n // (the `finalX` object-literal capture, the async parameter wrapper) prints against a\n // different declaration, whose recorded type does not describe it\n javaIdentifierPrintsDeclaredName(node): boolean {\n try {\n return this.printNode(node, 0) === String(node.text);\n } catch (e) {\n return false;\n }\n }\n\n // a use the printer rewrote to its `finalX` anonymous-class capture prints against its\n // own `Object finalX = x;` local, so the recorded type of the declaration no longer\n // holds (`(finalTime - 8L)` on an Object local does not compile)\n javaIdentifierKeepsDeclaredName(node): boolean {\n const checker: any = this.checkerOrUndefined();\n if (checker === undefined) {\n return false;\n }\n const declaration = checker.getSymbolAtLocation(node)?.valueDeclaration?.resolve();\n if (declaration === undefined || (declaration.kind !== SyntaxKind.VariableDeclaration\n && !isParameterDeclaration(declaration))) {\n return false;\n }\n return String(node.text) === String(declaration.name?.text);\n }\n\n // the checker type is the plain non-nullable `number` (TypeFlags.Number/NumberLiteral, no\n // alias): `Int`/`Num`/`any` and unions hold undefined at runtime, which the helpers absorb\n javaOperandIsNonNullNumber(node): boolean {\n const checker: any = this.checkerOrUndefined();\n if (checker === undefined) {\n return false;\n }\n const type = checker.getTypeAtLocation(node);\n return type !== undefined && type.getAliasSymbol?.() === undefined\n && (type.flags === TypeFlags.Number || type.flags === TypeFlags.NumberLiteral);\n }\n\n // the kind of the native arithmetic this rule prints for `+ - * /`, or undefined when\n // the node keeps the helper. Mirrors printInlineHelperArithmetic operand-for-operand\n // so callers can reason about the printed text of a nested arithmetic operand;\n // `allowDeclaredLocals=false` asks for a kind that does not rely on a retyped local\n // anywhere in the subtree (`+` never consumes one — java-13/14 own Add).\n javaNativeArithmeticKind(node, allowDeclaredLocals = true): string | undefined {\n const op = node?.operatorToken?.kind;\n const isPlus = op === SyntaxKind.PlusToken;\n const isMinus = op === SyntaxKind.MinusToken;\n const isMultiply = op === SyntaxKind.AsteriskToken;\n const isDivide = op === SyntaxKind.SlashToken;\n if (!isPlus && !isMinus && !isMultiply && !isDivide) {\n return undefined;\n }\n if (this.javaScalarFamily(node.left) !== 'number' || this.javaScalarFamily(node.right) !== 'number') {\n return undefined;\n }\n if (isMultiply && this.javaLiteralFractionalProduct(node.left, node.right)) {\n return 'double';\n }\n const childAllows = allowDeclaredLocals && !isPlus;\n const leftKind = this.javaProvableNumericKind(node.left, childAllows);\n const rightKind = this.javaProvableNumericKind(node.right, childAllows);\n return this.javaNativeArithmeticPairKind(isPlus, isMultiply, isDivide, leftKind, rightKind);\n }\n\n // `2 * 1.67`: two decimal literals whose IEEE product is finite and fractional. Helpers.multiply\n // re-boxes only an integral product as Long, so a fractional one is the native double product.\n javaLiteralFractionalProduct(left, right): boolean {\n const value = (node) => ((node !== undefined && isNumericLiteral(node) && !/^0[xXbBoO]/.test(node.text)) ? Number(node.text) : undefined);\n const a = value(left);\n const b = value(right);\n if (a === undefined || b === undefined || (!/[.eE]/.test(left.text) && !/[.eE]/.test(right.text))) {\n return false;\n }\n const product = a * b;\n return Number.isFinite(product) && !Number.isInteger(product);\n }\n\n // the native operator kind for a proven pair, or undefined. The helper's branch IS this operator:\n // `/` is always double division; `-` boxes long for long/long and double otherwise; `*` only on\n // long pairs (multiply re-boxes an integral double product as Long); `+` keeps the equal-kind rule.\n javaNativeArithmeticPairKind(isPlus, isMultiply, isDivide, leftKind, rightKind): string | undefined {\n if (leftKind === undefined || rightKind === undefined) {\n return undefined;\n }\n if (isDivide) {\n return 'double';\n }\n const hasDouble = (leftKind === 'double') || (rightKind === 'double');\n if (isMultiply) {\n return hasDouble ? undefined : 'long';\n }\n if (isPlus) {\n return (leftKind === rightKind) ? leftKind : undefined;\n }\n return hasDouble ? 'double' : 'long';\n }\n\n // ---- ordered comparison over declared numeric locals ----\n // Helpers.isGreaterThan answers its own predicate when an operand is null (GT: a != null && b == null;\n // LT = !GT && !EQ; GE = GT || EQ; LE = LT || EQ), so a Long/Integer/Double box compares natively\n // inside that exact null table. `>` is a toDouble compare for every numeric pair; `>= < <=` also go\n // through isEqual, so they stay native only for integral pairs (no NaN / BigDecimal rounding arm).\n\n // 'long' | 'double' for an operand the printer proves: a primitive-printing expression, or an\n // identifier whose printed declaration is a numeric type (boxed = may be null)\n javaComparisonOperand(node): { kind: string, boxed: boolean } | undefined {\n let inner = node;\n while (inner !== undefined && inner.kind === SyntaxKind.ParenthesizedExpression) {\n inner = inner.expression;\n }\n if (inner === undefined) {\n return undefined;\n }\n const primitive = this.javaPrimitiveOperandKind(inner);\n if (primitive !== undefined) {\n return { kind: primitive === 'double' ? 'double' : 'long', boxed: false };\n }\n if (!isIdentifier(inner) || !this.javaIdentifierPrintsDeclaredName(inner)) {\n return undefined;\n }\n if (this.javaLongParameterRead(inner)) {\n return { kind: 'long', boxed: !this.javaNullGuardAdmitsRead(inner) };\n }\n const declared = this.javaDeclaredNumericFamily(inner);\n if (declared === undefined) {\n return undefined;\n }\n const kind = (declared === 'Double' || declared === 'double') ? 'double' : 'long';\n return { kind, boxed: JAVA_BOXED_NUMERIC_TYPES.has(declared) };\n }\n\n printDeclaredNumericComparison(left, right, op): string | undefined {\n const l = this.javaComparisonOperand(left);\n const r = this.javaComparisonOperand(right);\n if (l === undefined || r === undefined) {\n return undefined;\n }\n if (op !== SyntaxKind.GreaterThanToken && (l.kind !== 'long' || r.kind !== 'long')) {\n return undefined;\n }\n const a = this.printNode(left, 0);\n const b = this.printNode(right, 0);\n const cmp = `${a} ${this.SupportedKindNames[op]} ${b}`;\n if (!l.boxed && !r.boxed) {\n return `(${cmp})`; // a guarded Long parameter unboxes like a primitive\n }\n const aNull = `${a} == null`;\n const aSet = `${a} != null`;\n const bNull = `${b} == null`;\n const bSet = `${b} != null`;\n // each arm below is the helper's null table, with the unreachable nulls folded away\n switch (op) {\n case SyntaxKind.GreaterThanToken:\n return `(${[l.boxed ? aSet : undefined, r.boxed ? `(${bNull} || ${cmp})` : cmp].filter((x) => x !== undefined).join(' && ')})`;\n case SyntaxKind.LessThanToken:\n return `(${[r.boxed ? bSet : undefined, l.boxed ? `(${aNull} || ${cmp})` : cmp].filter((x) => x !== undefined).join(' && ')})`;\n case SyntaxKind.GreaterThanEqualsToken:\n return `(${[r.boxed ? bNull : undefined, l.boxed ? `(${aSet} && ${cmp})` : cmp].filter((x) => x !== undefined).join(' || ')})`;\n case SyntaxKind.LessThanEqualsToken:\n return `(${[l.boxed ? aNull : undefined, r.boxed ? `(${bSet} && ${cmp})` : cmp].filter((x) => x !== undefined).join(' || ')})`;\n }\n return undefined;\n }\n\n // ---- widened native add (`+` only) ----\n // Helpers.add normalizes Integer to Long, boxes Long for integral operands and Double otherwise\n // (null in -> null out), so native `+` over proven numeric non-null operands gives the same box.\n\n // `this.milliseconds()` / `this.seconds()`: the hand-written Java declares both `public Long` over\n // a primitive time value, so the box is never null. Only a signature resolving into the base time\n // mixin or the Date.now lib chain qualifies; an unresolved call or venue override keeps the helper.\n javaBaseTimeLongCall(node) {\n const name = this.javaThisCallName(node);\n if (name !== 'milliseconds' && name !== 'seconds') {\n return false;\n }\n const checker: any = this.checkerOrUndefined();\n const declaration = checker.getResolvedSignature(node)?.declaration?.resolve();\n if (declaration === undefined) {\n return false;\n }\n const fileName = declaration.getSourceFile?.()?.fileName ?? '';\n // `milliseconds = now` where `now = Date.now` (ts/src/base/functions/time.ts) resolves\n // to the Date.now signature inside the typescript lib chain; `seconds` is declared\n // in that same base file.\n return /(^|[\\\\/])ts[\\\\/]src[\\\\/]base[\\\\/]functions[\\\\/]time\\.ts$/.test(fileName)\n || /(^|[\\\\/])lib\\.[^\\\\/]*\\.d\\.ts$/.test(fileName);\n }\n\n // `this.parseTimeframe(..)`: the hand-written java BaseExchange declares `public int\n // parseTimeframe(Object)` (java/lib/.../BaseExchange.java:1513) over the primitive-int\n // ts/src/base/functions/misc.ts arrow, so the call is a never-null Java int. A venue's\n javaBaseIntCall(node) {\n if (this.javaThisCallName(node) !== 'parseTimeframe') {\n return false;\n }\n let declaration;\n try {\n declaration = this.getChecker().getResolvedSignature(node)?.declaration?.resolve();\n } catch (e) {\n declaration = undefined;\n }\n if (declaration === undefined) {\n return false;\n }\n const fileName = declaration.getSourceFile?.()?.fileName ?? '';\n return /(^|[\\\\/])ts[\\\\/]src[\\\\/]base[\\\\/]functions[\\\\/]misc\\.ts$/.test(fileName);\n }\n\n // the method name of a `this.(...)` call, or undefined for any other node\n javaThisCallName(node) {\n const callee = node?.kind === SyntaxKind.CallExpression ? node.expression : undefined;\n if (callee?.kind !== SyntaxKind.PropertyAccessExpression || callee.expression.kind !== SyntaxKind.ThisKeyword) {\n return undefined;\n }\n return callee.name?.text;\n }\n\n // `for (var i = ; ...; i++)`: printForStatement rewrites the emitted\n // `Object i = 0` initializer to `var i = 0`, so javac types the counter int. The\n // counter is widened explicitly by javaPrintWidenedOperand, and no `=`/compound\n javaIntForCounter(node) {\n if (node?.kind !== SyntaxKind.Identifier) {\n return false;\n }\n const symbol = this.getChecker().getSymbolAtLocation(node);\n const declaration = symbol?.valueDeclaration?.resolve();\n if (declaration === undefined || !isVariableDeclaration(declaration)) {\n return false;\n }\n const declarationList = declaration.parent;\n if (declarationList === undefined || !isVariableDeclarationList(declarationList)\n || declarationList.declarations.length !== 1) {\n return false;\n }\n const forStatement: any = declarationList.parent;\n if (forStatement === undefined || forStatement.kind !== SyntaxKind.ForStatement\n || forStatement.initializer !== declarationList) {\n return false;\n }\n if (this.javaIntegerLiteralKind(declaration.initializer) !== 'int') {\n return false;\n }\n return this.javaCounterHasNoBoxWrite(node, symbol);\n }\n\n // no `=`/compound assignment anywhere in the enclosing function writes this counter;\n // `++`/`--` keep the primitive int, any other operator would not\n javaCounterHasNoBoxWrite(node, symbol) {\n let scope = node.parent;\n while (scope !== undefined && !isFunctionLike(scope) && scope.kind !== SyntaxKind.SourceFile) {\n scope = scope.parent;\n }\n if (scope === undefined) {\n return false;\n }\n let safe = true;\n const visit = (current) => {\n if (!safe || current === undefined) {\n return;\n }\n if (isIdentifier(current) && this.getChecker().getSymbolAtLocation(current) === symbol) {\n const parent = current.parent;\n if (parent !== undefined && isBinaryExpression(parent) && parent.left === current\n && JAVA_ASSIGNMENT_OPERATOR_KINDS.has(parent.operatorToken.kind)) {\n safe = false;\n return;\n }\n }\n current.forEachChild(visit);\n };\n scope.forEachChild(visit);\n return safe;\n }\n\n // `x.length` on a String/List receiver prints `((String)x).length()` /\n // `((java.util.List)x).size()` — a Java int on every path printJavaLength takes\n javaLengthIntRead(node) {\n if (node?.kind !== SyntaxKind.PropertyAccessExpression || node.name?.text !== 'length') {\n return false;\n }\n return this.javaLengthKind(node.expression) !== undefined;\n }\n\n // the Java numeric kind of one `+` operand: the literal proofs above plus the\n // non-null base-tier Long accessors, primitive int for-counters and String/List\n // length reads. Undefined keeps the helper.\n javaWidenedNumericKind(node) {\n if (node === undefined) {\n return undefined;\n }\n if (node.kind === SyntaxKind.ParenthesizedExpression) {\n return this.javaWidenedNumericKind(node.expression);\n }\n const literalKind = this.javaIntegerLiteralKind(node);\n if (literalKind !== undefined) {\n return literalKind;\n }\n if (isNumericLiteral(node)) {\n // hex/octal/binary literals keep the helper; fractional/exponent literals are\n // Java doubles and can hold NaN, which the helper's arithmetic propagates\n if (/^0[xXbBoO]/.test(node.text)) {\n return undefined;\n }\n return /[.eE]/.test(node.text) ? 'double' : undefined;\n }\n if (this.javaBaseTimeLongCall(node)) {\n return 'long';\n }\n if (this.javaBaseIntCall(node) || this.javaIntForCounter(node) || this.javaLengthIntRead(node)) {\n return 'int';\n }\n if (node.kind === SyntaxKind.Identifier) {\n // a declared numeric local/parameter (the embedding layer's declaration table,\n // or a native parameter type): an Integer declares as integral, and the helper\n // normalized it to Long anyway\n if (this.javaLongParameterRead(node) && this.javaNullGuardAdmitsRead(node)) {\n return 'long';\n }\n return this.javaDeclaredNumericLocalKind(node);\n }\n if (node.kind === SyntaxKind.BinaryExpression && node.operatorToken.kind === SyntaxKind.PlusToken) {\n return this.javaWidenedAddKind(node);\n }\n // a nested `- * /` keeps the printer's own literal rule (java-18's family)\n return this.javaNativeArithmeticKind(node);\n }\n\n // the kind of a nested native `+` this rule prints, or undefined when it keeps the helper\n javaWidenedAddKind(node) {\n const leftKind = this.javaWidenedNumericKind(node.left);\n const rightKind = this.javaWidenedNumericKind(node.right);\n if (leftKind === undefined || rightKind === undefined) {\n return undefined;\n }\n return (leftKind === 'double' || rightKind === 'double') ? 'double' : 'long';\n }\n\n // the native form of a numeric `+`, or undefined to keep Helpers.add\n printWidenedNativeAdd(left, right, leftText, rightText) {\n const leftKind = this.javaWidenedNumericKind(left);\n const rightKind = this.javaWidenedNumericKind(right);\n if (leftKind === undefined || rightKind === undefined) {\n return undefined;\n }\n const resultKind = (leftKind === 'double' || rightKind === 'double') ? 'double' : 'long';\n const leftOperand = this.javaPrintWidenedOperand(leftKind, resultKind, left, leftText);\n const rightOperand = this.javaPrintWidenedOperand(rightKind, resultKind, right, rightText);\n return `(${leftOperand} + ${rightOperand})`;\n }\n\n // an int operand is widened to long explicitly: `i + 1` would box an Integer where\n // Helpers.add hands back a Long, and an all-int sum wraps where the helper's long\n // does not. Integer literals print long; a Double result needs no widening.\n javaPrintWidenedOperand(kind, resultKind, node, text) {\n if (kind === 'double') {\n return text;\n }\n if (kind === 'long' || isNumericLiteral(node)) {\n return this.javaPrintOperandAsLong(node, text);\n }\n if (resultKind === 'long') {\n return `((long) ${text})`;\n }\n return text;\n }\n\n // true when the receiver's printed Java would be a `cond ? a : b` (a parenthesised\n // conditional): those keep the helper so no added line carries a `?`\n javaSplitTernaryReceiver(node): boolean {\n if (node.kind === SyntaxKind.ParenthesizedExpression) {\n return this.javaSplitTernaryReceiver(node.expression);\n }\n return node.kind === SyntaxKind.ConditionalExpression;\n }\n\n // `s.split ()` -> the printer's own TS-array shape around Java's\n // String.split(Pattern.quote(...)): the plain-string receiver makes the helper's\n // String.valueOf/null branch unreachable and the result stays readable as List.\n javaNativeSplitCall(node, name, parsedArg): string | undefined {\n if (node === undefined || name === undefined || parsedArg === undefined) {\n return undefined;\n }\n const callee = node.expression;\n if (callee === undefined || callee.kind !== SyntaxKind.PropertyAccessExpression) {\n return undefined;\n }\n if (callee.name?.text !== 'split' || node.arguments?.length !== 1) {\n return undefined;\n }\n const receiver = callee.expression;\n const separator = node.arguments[0];\n if (receiver === undefined || !JAVA_SPLIT_RECEIVER_KINDS.has(receiver.kind)) {\n return undefined;\n }\n // a conditional receiver keeps the helper: the campaign's diff audit flags every\n // added line that carries a `?`, and such a line never goes native in this family\n if (this.javaSplitTernaryReceiver(receiver)) {\n return undefined;\n }\n // the separator is a literal: Helpers.split String.valueOf()s it and quotes it as\n // a regex, and a literal is the only separator whose printed Java is a String\n if (separator.kind !== SyntaxKind.StringLiteral\n && separator.kind !== SyntaxKind.NoSubstitutionTemplateLiteral) {\n return undefined;\n }\n if (this.javaScalarFamily(receiver) !== 'string') {\n return undefined;\n }\n return `${this.ARRAY_OPENING_TOKEN}((String)${name}).split(java.util.regex.Pattern.quote(${parsedArg}))${this.ARRAY_CLOSING_TOKEN}`;\n }\n\n // integer literals print as Java `int`; the helpers normalize Integer to Long before\n // the arithmetic, so native integer arithmetic is emitted in long to keep the boxed\n // result identical\n javaPrintOperandAsLong(node, text) {\n if (!isNumericLiteral(node) || /[.eE]/.test(node.text)) {\n return text;\n }\n return /L$/.test(text) ? text : text + 'L';\n }\n\n // the native form of a helper-family binary operator, or undefined to keep the helper\n // `for (var i = ; ...; i++)` prints a primitive `var` counter (see\n // isJavaPrimitiveForCounter). Only ++/-- may write it: any other assignment in the\n // loop would print a different kind into the same slot (D2), so the proof bails.\n javaProvableCounterInt(node) {\n if (!node || node.kind !== SyntaxKind.Identifier) {\n return false;\n }\n const symbol = this.getChecker().getSymbolAtLocation(node);\n const declaration: any = symbol?.valueDeclaration?.resolve() ?? symbol?.declarations?.[0]?.resolve();\n if (!declaration || declaration.kind !== SyntaxKind.VariableDeclaration) {\n return false;\n }\n if (this.javaIntegerLiteralKind(declaration.initializer) !== 'int') {\n return false;\n }\n const list = declaration.parent;\n const forStatement: any = list?.parent;\n if (!forStatement || forStatement.kind !== SyntaxKind.ForStatement || forStatement.initializer !== list) {\n return false;\n }\n const incrementor = forStatement.incrementor;\n if (!incrementor || incrementor.operand?.kind !== SyntaxKind.Identifier\n || incrementor.operand.text !== node.text) {\n return false;\n }\n if (incrementor.kind !== SyntaxKind.PostfixUnaryExpression && incrementor.kind !== SyntaxKind.PrefixUnaryExpression) {\n return false;\n }\n const name = node.text;\n let safe = true;\n const scan = (n) => {\n if (!safe || !n || n === incrementor) {\n return;\n }\n if (n.kind === SyntaxKind.BinaryExpression && JAVA_ASSIGNMENT_OPERATOR_KINDS.has(n.operatorToken.kind)\n && n.left?.kind === SyntaxKind.Identifier && n.left.text === name) {\n safe = false;\n return;\n }\n if ((n.kind === SyntaxKind.PostfixUnaryExpression || n.kind === SyntaxKind.PrefixUnaryExpression)\n && n.operand?.kind === SyntaxKind.Identifier && n.operand.text === name) {\n return;\n }\n n.forEachChild(scan);\n };\n scan(forStatement.statement);\n if (!safe) {\n return false;\n }\n // the enclosing function may not write it either\n let enclosing = forStatement.parent;\n while (enclosing && !isFunctionLike(enclosing)) {\n enclosing = enclosing.parent;\n }\n if (enclosing) {\n const body = enclosing.body ?? enclosing;\n const scanOuter = (n) => {\n if (!safe || !n || n === forStatement || isFunctionLike(n)) {\n return;\n }\n if (n.kind === SyntaxKind.BinaryExpression && JAVA_ASSIGNMENT_OPERATOR_KINDS.has(n.operatorToken.kind)\n && n.left?.kind === SyntaxKind.Identifier && n.left.text === name) {\n safe = false;\n return;\n }\n n.forEachChild(scanOuter);\n };\n scanOuter(body);\n }\n return safe;\n }\n\n printInlineHelperArithmetic(left, right, leftText, rightText, op) {\n const isPlus = op === SyntaxKind.PlusToken || op === SyntaxKind.PlusEqualsToken;\n const isMinus = op === SyntaxKind.MinusToken || op === SyntaxKind.MinusEqualsToken;\n const isMultiply = op === SyntaxKind.AsteriskToken;\n const isDivide = op === SyntaxKind.SlashToken;\n const isMod = op === SyntaxKind.PercentToken;\n if (!isPlus && !isMinus && !isMultiply && !isDivide && !isMod) {\n return undefined;\n }\n const leftFamily = this.javaScalarFamily(left);\n const rightFamily = this.javaScalarFamily(right);\n if (isPlus && this.javaStringConcatIsProvable(left, right, leftFamily, rightFamily)) {\n const concat = `(${leftText} + ${rightText})`;\n return op === SyntaxKind.PlusEqualsToken ? `${leftText} = ${concat}` : concat;\n }\n // compound assignments keep the helper: the left side is a local the printer\n // declares Object, so the native operator would not compile\n if (op === SyntaxKind.PlusEqualsToken || op === SyntaxKind.MinusEqualsToken) {\n return undefined;\n }\n // `this.milliseconds() - `: the hand-written base call hands back\n // a Long, and Helpers.subtract's Long - Long branch is plain long arithmetic with\n // the same box (Helpers.java), so the helper drops when the right side is long too\n if (op === SyntaxKind.MinusToken) {\n const anchoredKind = this.javaThisCallNumericKind(left);\n if (anchoredKind === 'long' && this.javaProvableNumericKind(right) === 'long') {\n return `(${leftText} - ${this.javaPrintOperandAsLong(right, rightText)})`;\n }\n }\n if (leftFamily !== 'number' || rightFamily !== 'number') {\n return undefined;\n }\n if (op === SyntaxKind.PlusToken) {\n // the widened rule: literals + the non-null numeric proofs this printer owns\n return this.printWidenedNativeAdd(left, right, leftText, rightText);\n }\n if (isMod) {\n // Helpers.mod normalizes both operands to double and returns their double\n // remainder: the same value once both operands print as a non-null Java number\n if (!this.javaProvableNumericDoubleOperand(left) || !this.javaProvableNumericDoubleOperand(right)) {\n return undefined;\n }\n return `(((double) ${leftText}) % ((double) ${rightText}))`;\n }\n if (isMultiply && this.javaLiteralFractionalProduct(left, right)) {\n return `(${leftText} * ${rightText})`;\n }\n // `+` keeps phase-1's literal-only rule (java-13/14 own Add): its operands must not\n // derive from a retyped local anywhere below\n const childAllows = !isPlus;\n const leftKind = this.javaProvableNumericKind(left, childAllows);\n const rightKind = this.javaProvableNumericKind(right, childAllows);\n const pairKind = this.javaNativeArithmeticPairKind(isPlus, isMultiply, isDivide, leftKind, rightKind);\n if (pairKind === undefined) {\n return undefined;\n }\n if (isDivide) {\n // TS `/` is always float division and Helpers.divide never returns a long\n return `(((double) ${leftText}) / ((double) ${rightText}))`;\n }\n const operator = isPlus ? '+' : (isMinus ? '-' : '*');\n const widenedLeft = this.javaPrintArithmeticOperand(leftKind, left, leftText);\n const widenedRight = this.javaPrintArithmeticOperand(rightKind, right, rightText);\n return `(${widenedLeft} ${operator} ${widenedRight})`;\n }\n\n // an Integer/int operand is widened to long before the operator: Helpers normalizes an\n // Integer to Long first, so the native long arithmetic reproduces both the value (no\n // int-width wrap) and the Long box the helper hands back\n javaPrintArithmeticOperand(kind, node, text) {\n if (kind === 'int') {\n return `((long) ${text})`;\n }\n return this.javaPrintOperandAsLong(node, text);\n }\n\n // Helpers.mathMin/mathMax take Object, tolerate null and return the ORIGINAL box; Math.min/max take\n // primitives, so the native call needs both operands primitive of one family: literals, `for`\n // counters, `.length`/`.size()`, native long arithmetic; the only NaN-free double is a literal.\n javaNativeMathMinMaxOperandKind(node) {\n if (this.javaIntegerLiteralKind(node) !== undefined || this.isJavaPrimitiveForCounter(node)\n || (isPropertyAccessExpression(node) && node.name.text === 'length'\n && this.javaLengthKind(node.expression) !== undefined)) {\n return 'integral';\n }\n if (isNumericLiteral(node)) {\n return this.javaProvableNumericKind(node) === 'double' ? 'double' : undefined;\n }\n return this.javaProvableNumericKind(node) === 'long' ? 'integral' : undefined;\n }\n\n // a primitive has no members, so a receiver position (and the printer's cast wrappers) keep the\n // helper - every other position boxes the primitive exactly like the helper's own box (Jackson,\n // isEqual and toString all read an Integer and a Long the same way)\n javaNativeMathMinMaxResultIsPlainValue(node) {\n let parent = node.parent;\n while (parent !== undefined && isParenthesizedExpression(parent)) {\n parent = parent.parent;\n }\n if (parent === undefined) {\n return false;\n }\n if ((isPropertyAccessExpression(parent) || isElementAccessExpression(parent)\n || isCallExpression(parent)) && parent.expression === node) {\n return false;\n }\n return parent.kind !== SyntaxKind.AsExpression\n && parent.kind !== SyntaxKind.TypeAssertionExpression\n && parent.kind !== SyntaxKind.NonNullExpression;\n }\n\n // the native form of Math.min/Math.max, or undefined to keep the helper\n printNativeMathMinMax(node, left, right, leftText, rightText, name) {\n if (!this.javaNativeMathMinMaxResultIsPlainValue(node)) {\n return undefined;\n }\n const kind = this.javaNativeMathMinMaxOperandKind(left);\n if (kind === undefined || kind !== this.javaNativeMathMinMaxOperandKind(right)) {\n return undefined;\n }\n return `Math.${name}(${leftText}, ${rightText})`;\n }\n\n // ---- helper-family inlining: `parseInt/parseFloat/toString/padStart` ----\n // parseInt catches NumberFormatException into null, parseFloat into 0.0, Helpers.toString maps\n // null to null, Helpers.padStart truncates: native form only where the fallback is unreachable.\n\n // `Helpers.toString(x)` is `x == null ? null : x.toString()`, so `String.valueOf(x)`\n // is exact for every argument that cannot be null. Only a numeric literal or a\n // nested `+ - * /` this rule prints natively qualifies: both are Java primitives.\n javaStringBoxText(node, text) {\n return this.javaProvableNumericKind(node) !== undefined ? `String.valueOf(${text})` : `Helpers.toString(${text})`;\n }\n\n // The runtime uses Long.parseLong (parseInt) / Double.parseDouble (parseFloat) inside a catch; a\n // literal the native parser ACCEPTS cannot reach the catch, so the native call cannot change the\n // answer (parseInt additionally needs the value in long range, else the helper answers null).\n javaScalarParseAccepts(callee, text) {\n if (callee === 'parseInt') {\n if (!/^[+-]?[0-9]+$/.test(text)) {\n return false;\n }\n const value = BigInt(text.replace(/^\\+/, ''));\n return value >= BigInt('-9223372036854775808') && value <= BigInt('9223372036854775807');\n }\n // Double.parseDouble's grammar minus the suffix forms; NaN/Infinity are parsed\n // by both, whitespace and hex floats by neither of the two the same way.\n return /^[+-]?([0-9]+(\\.[0-9]*)?|\\.[0-9]+)([eE][+-]?[0-9]+)?$/.test(text)\n || /^[+-]?Infinity$/.test(text)\n || text === 'NaN';\n }\n\n // `parseInt(x)` / `parseFloat(x)` -> the native parse, or undefined to keep the helper\n printNativeScalarParse(node, callee) {\n const args = node?.arguments;\n if (args === undefined || args.length !== 1 || !isStringLiteral(args[0])) {\n return undefined;\n }\n if (!this.javaScalarParseAccepts(callee, args[0].text)) {\n return undefined;\n }\n const nativeName = callee === 'parseInt' ? 'Long.parseLong' : 'Double.parseDouble';\n return `${nativeName}(${this.printNode(args[0], 0)})`;\n }\n\n // The printed receiver of a `padStart` this rule can inline: already cast (`((String)x)`) by the\n // printer or the ccxt local-typing pass, or the checker proves a plain TS string, so the accessor\n // cast this rule adds cannot fire.\n javaPadStartReceiverText(receiver, name) {\n if (/^\\(+\\(String\\)/.test(name)) {\n return name;\n }\n if (this.javaScalarFamily(receiver) === 'string') {\n return `((String)${name})`;\n }\n return undefined;\n }\n\n // `x.padStart(n, 'c')` with a non-negative integer literal length and single-char literal pad.\n // Helpers.padStart pads then answers the LAST `n` chars, so the native form keeps both halves:\n // String.format builds the pad from an empty `%s` and the >= arm reproduces the truncation.\n printNativePadStart(node, name) {\n const args = node?.arguments;\n if (args === undefined || args.length !== 2 || name === undefined) {\n return undefined;\n }\n if (this.javaIntegerLiteralKind(args[0]) !== 'int' || !/^[0-9]+$/.test(args[0].text)) {\n return undefined;\n }\n if (!isStringLiteral(args[1]) || args[1].text.length === 0) {\n return undefined;\n }\n const receiver = node.expression?.expression;\n if (!this.sideEffectFreeReceiver(receiver)) {\n return undefined;\n }\n const receiverText = this.javaPadStartReceiverText(receiver, name);\n if (receiverText === undefined) {\n return undefined;\n }\n const length = args[0].text;\n const pad = `'${this.javaCharLiteral(args[1].text[0])}'`;\n const lengthCall = `${receiverText}.length()`;\n return `(${lengthCall} >= ${length} ? ${receiverText}.substring(${lengthCall} - ${length})`\n + ` : String.format(\"%\" + (${length} - ${lengthCall}) + \"s\", \"\").replace(' ', ${pad}) + ${receiverText})`;\n }\n\n // one char literal for the `String.format(...).replace(' ', c)` pad, escaped\n javaCharLiteral(character) {\n if (character === \"'\" || character === '\\\\') {\n return `\\\\${character}`;\n }\n return character;\n }\n\n // ---- typed locals for native arithmetic ----\n // A local whose initializer prints as native arithmetic holds a String / Long / Double box, so the\n // declaration carries that type; every other use is scanned first (D2) as it changes resolution.\n\n javaUnwrapParentheses(node) {\n let current = node;\n while (current?.kind === SyntaxKind.ParenthesizedExpression) {\n current = current.expression;\n }\n return current;\n }\n\n // the Java type of the native arithmetic this printer prints for a `+ - * / +=`\n // node, or undefined when the node keeps the helper (its printed value is an\n // Object box). Mirrors printInlineHelperArithmetic operand-for-operand.\n javaNativeArithmeticType(node) {\n const value = this.javaUnwrapParentheses(node);\n if (value?.kind !== SyntaxKind.BinaryExpression) {\n return undefined;\n }\n const op = value.operatorToken.kind;\n if (op === SyntaxKind.PlusToken && this.javaNativeConcat(value)) {\n return 'String';\n }\n if (op === SyntaxKind.PlusEqualsToken) {\n // the inlined `x = (x + y)` shape needs the same operand pair the concat\n // branch of printInlineHelperArithmetic needs\n const isStringPair = this.javaScalarFamily(value.left) === 'string'\n && this.javaScalarFamily(value.right) === 'string'\n && (this.javaProvableString(value.left) || this.javaProvableString(value.right));\n return isStringPair ? 'String' : undefined;\n }\n const kind = this.javaNativeArithmeticKind(value);\n return kind === 'long' ? 'Long' : (kind === 'double' ? 'Double' : undefined);\n }\n\n // the enclosing function-like node: the D2 scan scope of a typed local\n javaEnclosingFunction(node) {\n let current = node?.parent;\n while (current !== undefined) {\n const kind = current.kind;\n if (kind === SyntaxKind.MethodDeclaration || kind === SyntaxKind.FunctionDeclaration\n || kind === SyntaxKind.FunctionExpression || kind === SyntaxKind.ArrowFunction\n || kind === SyntaxKind.GetAccessor || kind === SyntaxKind.SetAccessor\n || kind === SyntaxKind.Constructor) {\n return current;\n }\n current = current.parent;\n }\n return undefined;\n }\n\n // a reassignment may keep the narrowed declaration only when its printed value is the\n // same Java type (the helper's box stays an Object, so it keeps the box)\n javaArithmeticWriteIsSafe(right, javaType) {\n const value = this.javaUnwrapParentheses(right);\n if (value === undefined) {\n return false;\n }\n if (value.kind === SyntaxKind.NullKeyword) {\n return true; // `null` is assignable to every box\n }\n if (value.kind === SyntaxKind.Identifier && value.text === 'undefined') {\n return true;\n }\n return (javaType === 'String' && (value.kind === SyntaxKind.StringLiteral\n || value.kind === SyntaxKind.NoSubstitutionTemplateLiteral))\n || this.javaNativeArithmeticType(value) === javaType;\n }\n\n // the innermost block that scopes a declaration (Java locals live to the end of\n // their block; sibling blocks may reuse the name, nested ones may not)\n javaScopingBlock(node) {\n let current = node?.parent;\n let last = undefined;\n while (current !== undefined) {\n if (current.kind === SyntaxKind.Block || current.kind === SyntaxKind.SourceFile) {\n return current;\n }\n last = current;\n current = current.parent;\n }\n return last;\n }\n\n javaNodeContains(outer, inner) {\n return outer !== undefined && inner !== undefined && outer.pos <= inner.pos && inner.end <= outer.end;\n }\n\n // two same-named bindings may both keep their own printed type only in disjoint\n // blocks: a nested one would already be an illegal Java shadowing of the Object\n // declaration the corpus compiles with\n javaBindingsAreDisjoint(declaration, other) {\n const mine = this.javaScopingBlock(declaration);\n const theirs = this.javaScopingBlock(other);\n if (mine === undefined || theirs === undefined) {\n return false;\n }\n return !this.javaNodeContains(mine, theirs) && !this.javaNodeContains(theirs, mine);\n }\n\n // is this occurrence of the local compatible with the narrowed declaration?\n javaArithmeticLocalUseIsSafe(node, declaration, javaType) {\n const parent = node.parent;\n if (parent === undefined) {\n return false;\n }\n if ((parent.kind === SyntaxKind.PropertyAccessExpression || parent.kind === SyntaxKind.PropertyAssignment)\n && parent.name === node) {\n return true; // a member name, not a use of the local\n }\n if ((parent.kind === SyntaxKind.VariableDeclaration || parent.kind === SyntaxKind.Parameter\n || parent.kind === SyntaxKind.BindingElement) && parent.name === node) {\n // a second binding of the same source name: only a disjoint sibling block may\n // keep its own type (no shadowing of the narrowed declaration)\n return this.javaBindingsAreDisjoint(declaration, parent);\n }\n if (parent.kind === SyntaxKind.PostfixUnaryExpression || parent.kind === SyntaxKind.PrefixUnaryExpression) {\n return false; // ++/--/-x/+x print an unboxing or primitive operator\n }\n if (parent.kind === SyntaxKind.SpreadElement || parent.kind === SyntaxKind.DeleteExpression\n || parent.kind === SyntaxKind.ForOfStatement || parent.kind === SyntaxKind.ForInStatement) {\n return false;\n }\n if (parent.kind === SyntaxKind.TypeOfExpression) {\n // prints \\`x instanceof String\\`, the same test the Object declaration printed\n return javaType === 'String';\n }\n if (parent.kind === SyntaxKind.AsExpression || parent.kind === SyntaxKind.TypeAssertionExpression) {\n // \\`x as string\\` prints the identity ((String) x); any other asserted type\n // prints a cast the narrower declaration cannot satisfy\n return javaType === 'String' && parent.type?.kind === SyntaxKind.StringKeyword;\n }\n if (parent.kind === SyntaxKind.ConditionalExpression) {\n // a numeric arm next to a numeric arm makes the conditional numeric and javac\n // unboxes it (an NPE where the Object declaration carried null)\n return javaType === 'String';\n }\n if (parent.kind === SyntaxKind.ElementAccessExpression && parent.expression === node) {\n const grand = parent.parent;\n if (grand?.kind === SyntaxKind.DeleteExpression) {\n return false;\n }\n if (grand?.kind === SyntaxKind.BinaryExpression && grand.left === parent\n && JAVA_ASSIGNMENT_OPERATOR_KINDS.has(grand.operatorToken.kind)) {\n return false; // `x[k] = v` prints a receiver cast the box cannot satisfy\n }\n }\n if (parent.kind === SyntaxKind.ArrayLiteralExpression) {\n const grand = parent.parent;\n if (grand?.kind === SyntaxKind.BinaryExpression && grand.left === parent\n && JAVA_ASSIGNMENT_OPERATOR_KINDS.has(grand.operatorToken.kind)) {\n return false; // `[x, y] = f()` prints a destructuring write into the local\n }\n }\n if (parent.kind === SyntaxKind.BinaryExpression && parent.left === node) {\n const op = parent.operatorToken.kind;\n if (op === SyntaxKind.EqualsToken) {\n return this.javaArithmeticWriteIsSafe(parent.right, javaType);\n }\n if (op === SyntaxKind.PlusEqualsToken) {\n // `x += y` prints a native `x = (x + y)` or the Object-typed helper\n return this.javaNativeArithmeticType(parent) === javaType;\n }\n if (JAVA_ASSIGNMENT_OPERATOR_KINDS.has(op)) {\n return false; // every other compound assignment writes a helper result\n }\n if (op === SyntaxKind.PlusToken && javaType === 'String') {\n // the overload trap: once the local is String, a printed Helpers.add(local, y)\n // binds add(String, Object) instead of add(Object, Object), and the two\n // diverge for a non-string y. A printed native concat has no helper call.\n return this.javaNativeArithmeticType(parent) === 'String';\n }\n }\n return true;\n }\n\n // D2: the narrowed declaration needs every later use of the local in the enclosing\n // function to still compile and resolve the way the Object declaration did\n javaArithmeticLocalIsSafeToType(scope, declaration, javaType) {\n if (scope === undefined) {\n return false;\n }\n const sourceName = declaration.name.text;\n let safe = true;\n const visit = (n) => {\n if (!safe) {\n return;\n }\n if (n.kind === SyntaxKind.Identifier && n.text === sourceName && n !== declaration.name) {\n if (!this.javaArithmeticLocalUseIsSafe(n, declaration, javaType)) {\n safe = false;\n return;\n }\n }\n n.forEachChild(visit);\n };\n scope.forEachChild(visit);\n return safe;\n }\n\n // the Java type a declaration can carry because its initializer prints as native\n // arithmetic, or undefined to keep the Object declaration\n javaArithmeticLocalType(declaration) {\n if (!isIdentifier(declaration.name) || declaration.initializer === undefined) {\n return undefined;\n }\n const javaType = this.javaNativeArithmeticType(declaration.initializer);\n if (javaType === undefined) {\n return undefined;\n }\n const scope = this.javaEnclosingFunction(declaration);\n return this.javaArithmeticLocalIsSafeToType(scope, declaration, javaType)\n ? javaType : undefined;\n }\n\n // an operand `(double) ` can be applied to without changing what Helpers.mod\n // computes: a numeric literal or a native arithmetic node (javaProvableNumericKind,\n // already printed as a java number) or a primitive int loop counter\n javaProvableNumericDoubleOperand(node) {\n return this.javaProvableNumericKind(node) !== undefined || this.javaProvableCounterInt(node);\n }\n\n getFinalVarName(varName: string): string {\n varName = this.getOriginalVarName(varName);\n if (varName.startsWith('final')) {\n return varName;\n }\n return `final${this.capitalize(varName)}`;\n }\n\n getOriginalVarName(name: string): string {\n if (this.ReservedKeywordsReplacements[name]) {\n name = this.ReservedKeywordsReplacements[name];\n }\n return name;\n }\n\n // Resolves the trio of names used to wrap a reassigned async-method param\n // so the lambda body sees an effectively-final local. We base every name on\n // the keyword-remapped Java identifier — using the raw TS name when remapped\n // (e.g. params -> parameters) makes the wrapper text and the body diverge,\n // because identifier emission already routes through ReservedKeywordsReplacements.\n private getAsyncParamWrapperNames(paramName: string): { sigName: string; snapName: string; localName: string } {\n const javaName = this.getOriginalVarName(paramName);\n return {\n sigName: `${javaName}2`,\n snapName: `${javaName}3`,\n localName: javaName,\n };\n }\n\n private isAssignmentOperator(op: SyntaxKind): boolean {\n return op >= SyntaxKind.FirstAssignment && op <= SyntaxKind.LastAssignment;\n }\n\n private isIncDecOperator(op: SyntaxKind): boolean {\n return op === SyntaxKind.PlusPlusToken || op === SyntaxKind.MinusMinusToken;\n }\n\n // Walk the function body in source order and assign a version-aware finalName to\n // every identifier that appears inside an object literal property and refers to a\n // variable that's reassigned anywhere in this function. Each reassignment bumps the\n // per-variable version counter; usages of the same (var, version) share one finalName.\n //\n // Naming:\n // - If only one version of a var is ever used in object literals, use `final`\n // (matches prior behavior).\n // - If multiple versions are used, name them `final`, `final_2`,\n // `final_3` in source-order of the version they correspond to.\n analyzeFinalVars(fnBody: Node): void {\n this.usageToFinalName = new WeakMap();\n if (!fnBody) return;\n\n // Symbol identity: two identifiers are the same lexical variable iff they\n // resolve to the same declaration. This differentiates e.g. `i` in two\n // sibling for-loops (separate `let i` declarations = separate symbols).\n const symbolIdOf = (n: any): string => {\n try {\n const checker = this.getChecker();\n const sym = checker?.getSymbolAtLocation?.(n);\n const decl = sym?.declarations?.[0]?.resolve() ?? sym?.valueDeclaration?.resolve();\n if (decl) return `s:${decl.pos}:${decl.end}`;\n } catch {\n // checker may be unavailable in some contexts — fall through to name-based id\n }\n return `n:${n.text}`;\n };\n\n // Pass 1 — discover which symbols the printer will treat as reassigned.\n //\n // The printer's `printCustomBinaryExpressionIfAny` sets\n // `ReassignedVars[varKey] = true` for the LEFT identifier of *every*\n // BinaryExpression — not just assignment operators. So `timestamp + '#'`\n // or `x === 5` will both flag `timestamp`/`x` later during emit, even\n // though they're plain reads syntactically. The printer's substitution\n // path then uses ReassignedVars as a fallback trigger for the finalXxx\n // rewrite, so a literal capturing such an identifier ends up referring\n // to `finalTimestamp` even when the analyzer thinks the symbol isn't\n // reassigned.\n //\n // If the analyzer disagrees with the printer here, the printer's\n // fallback substitution uses the un-suffixed base name for *every* use\n // (including in sibling if/else branches), and any environment with\n // ancestor-scope dedup leak will suppress one of the two declarations.\n //\n // Mirror the printer's over-broad heuristic in the analyzer so the\n // version-bump machinery (a5c2036 / ac618b0 / 48a1786) can assign\n // distinct names to sibling and post-block uses.\n const reassignedSyms = new Set();\n const discoverPotentialReassignments = (node: any) => {\n if (!node) return;\n if (node.kind === SyntaxKind.BinaryExpression) {\n if (node.left?.kind === SyntaxKind.Identifier) {\n // Mirror printCustomBinaryExpressionIfAny: any BinaryExpression\n // with an Identifier left flags it, regardless of operator.\n reassignedSyms.add(symbolIdOf(node.left));\n } else if (\n node.operatorToken.kind === SyntaxKind.EqualsToken &&\n node.left?.kind === SyntaxKind.ArrayLiteralExpression\n ) {\n // Tuple destructuring assignment: `[a, b] = expr`. The printer's\n // ArrayLiteralExpression branch in printCustomBinaryExpressionIfAny\n // flags each Identifier element in ReassignedVars, so mirror it\n // here for version-bump coverage.\n for (const elem of node.left.elements ?? []) {\n if (elem?.kind === SyntaxKind.Identifier) {\n reassignedSyms.add(symbolIdOf(elem));\n }\n }\n }\n }\n if ((node.kind === SyntaxKind.PrefixUnaryExpression ||\n node.kind === SyntaxKind.PostfixUnaryExpression) &&\n this.isIncDecOperator(node.operator) &&\n node.operand?.kind === SyntaxKind.Identifier) {\n reassignedSyms.add(symbolIdOf(node.operand));\n }\n // Cross-call / cross-method state leak: ReassignedVars accumulates\n // across transpile calls and earlier-printed methods in the same\n // class+method context, so a var declared `const` in this function\n // body may still be flagged from a prior context. The printer's\n // substitution path consults ReassignedVars as a fallback; if the\n // analyzer disagrees, version-bump can't apply and sibling if/else\n // branches end up with the same base name.\n if (node.kind === SyntaxKind.Identifier) {\n const name = node.text as string | undefined;\n if (name && name !== 'undefined' && !name.startsWith?.('null')) {\n if (this.ReassignedVars[this.getVarKey(node)]) {\n reassignedSyms.add(symbolIdOf(node));\n }\n }\n return;\n }\n node.forEachChild(discoverPotentialReassignments);\n };\n discoverPotentialReassignments(fnBody);\n\n if (reassignedSyms.size === 0) return;\n\n // Pass 2 — walk in source order, producing a stream of reassignment and usage\n // events keyed by symbol. Usages are identifiers that (a) sit inside an\n // object literal property initializer expression, (b) refer to a reassigned symbol.\n type Event =\n | { kind: 'reassign'; sym: string }\n | { kind: 'use'; sym: string; name: string; node: Node };\n const events: Event[] = [];\n\n const visitExprInObjLit = (n: any) => {\n if (!n) return;\n if (n.kind === SyntaxKind.Identifier) {\n const name = n.text as string;\n if (name && name !== 'undefined' && !name.startsWith?.('null')) {\n const sym = symbolIdOf(n);\n if (reassignedSyms.has(sym)) {\n events.push({ kind: 'use', sym, name, node: n });\n }\n }\n return;\n }\n if (n.kind === SyntaxKind.BinaryExpression) {\n visitExprInObjLit(n.left);\n visitExprInObjLit(n.right);\n return;\n }\n if (n.kind === SyntaxKind.ParenthesizedExpression) {\n visitExprInObjLit(n.expression);\n return;\n }\n if (n.kind === SyntaxKind.ConditionalExpression) {\n visitExprInObjLit(n.condition);\n visitExprInObjLit(n.whenTrue);\n visitExprInObjLit(n.whenFalse);\n return;\n }\n if (n.kind === SyntaxKind.CallExpression) {\n n.arguments?.forEach(visitExprInObjLit);\n if (n.expression?.kind === SyntaxKind.PropertyAccessExpression) {\n visitExprInObjLit(n.expression.expression);\n }\n return;\n }\n if (n.kind === SyntaxKind.PrefixUnaryExpression) {\n visitExprInObjLit(n.operand);\n return;\n }\n if (n.kind === SyntaxKind.ElementAccessExpression) {\n let left = n.expression;\n while (left?.kind === SyntaxKind.ElementAccessExpression) {\n left = left.expression;\n }\n visitExprInObjLit(left);\n visitExprInObjLit(n.argumentExpression);\n return;\n }\n if (n.kind === SyntaxKind.ObjectLiteralExpression) {\n n.properties?.forEach((p: any) => {\n if (p.initializer) visitExprInObjLit(p.initializer);\n });\n return;\n }\n // Fallback for any other expression kind (ArrayLiteralExpression,\n // SpreadElement, TemplateExpression, AsExpression, NonNullExpression,\n // PropertyAccessExpression, TypeAssertion, etc.) — descend uniformly\n // so identifiers nested inside `[rawHash]`, `{...x}`, `` `${x}` ``, and\n // so on are still tagged. ObjectLiteralExpression is handled above so\n // it doesn't fall through to the generic descent (which would re-walk\n // the same prop initializers and double-count).\n n.forEachChild(visitExprInObjLit);\n };\n\n const walk = (node: any) => {\n if (!node) return;\n\n if (node.kind === SyntaxKind.BinaryExpression &&\n this.isAssignmentOperator(node.operatorToken.kind)) {\n walk(node.right);\n if (node.left?.kind === SyntaxKind.Identifier) {\n const sym = symbolIdOf(node.left);\n if (reassignedSyms.has(sym)) {\n events.push({ kind: 'reassign', sym });\n }\n } else {\n walk(node.left);\n }\n return;\n }\n\n if ((node.kind === SyntaxKind.PrefixUnaryExpression ||\n node.kind === SyntaxKind.PostfixUnaryExpression) &&\n this.isIncDecOperator(node.operator) &&\n node.operand?.kind === SyntaxKind.Identifier) {\n const sym = symbolIdOf(node.operand);\n if (reassignedSyms.has(sym)) {\n events.push({ kind: 'reassign', sym });\n }\n return;\n }\n\n if (node.kind === SyntaxKind.ObjectLiteralExpression) {\n node.properties?.forEach((prop: any) => {\n if (prop.initializer) {\n visitExprInObjLit(prop.initializer);\n walk(prop.initializer);\n }\n });\n return;\n }\n\n // If/else branches introduce sibling scopes for declarations inside\n // them. Without intervention, the analyzer assigns the same per-symbol\n // version to uses across siblings and to uses after the branch.\n // Java permits sibling-scope name reuse when the inner block has\n // popped, but ancestor-scope dedup in buildFinalVarDeclarations +\n // any scope tracking leak in the consumer environment can suppress\n // the outer declaration, leaving an undeclared reference.\n //\n // The helper below records 'use' events inside a sub-block and emits\n // a phantom reassign on exit for every symbol used inside, so each\n // region gets a distinct per-symbol version → distinct finalXxx name.\n const walkBlockAndBump = (subNode: Node | undefined): Set => {\n const usedInBlock = new Set();\n if (!subNode) return usedInBlock;\n const eventsBefore = events.length;\n walk(subNode);\n for (let i = eventsBefore; i < events.length; i++) {\n const e = events[i];\n if (e.kind === 'use') usedInBlock.add(e.sym);\n }\n for (const sym of usedInBlock) {\n events.push({ kind: 'reassign', sym });\n }\n return usedInBlock;\n };\n\n if (node.kind === SyntaxKind.IfStatement) {\n walk(node.expression);\n walkBlockAndBump(node.thenStatement);\n walkBlockAndBump(node.elseStatement);\n // After walking either branch we've already bumped for every\n // symbol used inside it, so post-if uses naturally land on a\n // version higher than either branch's uses.\n return;\n }\n\n // try / catch / finally: catch is a sibling scope to try; finally\n // executes after both. Treat each block the same way as if/else\n // branches so captures across them get distinct snapshot names.\n if (node.kind === SyntaxKind.TryStatement) {\n walkBlockAndBump(node.tryBlock);\n walkBlockAndBump(node.catchClause?.block);\n walkBlockAndBump(node.finallyBlock);\n return;\n }\n\n node.forEachChild(walk);\n };\n\n walk(fnBody);\n\n // Post-process: compute per-symbol versions and assign final names. The\n // final name is derived from the identifier's text, not the symbol — so\n // two distinct symbols named `i` both get `finalI` (each lives in its own\n // lexical scope, so scope-stack dedup allows both to be emitted).\n const counters = new Map();\n const perSym = new Map }>();\n for (const e of events) {\n if (e.kind === 'reassign') {\n counters.set(e.sym, (counters.get(e.sym) ?? 0) + 1);\n } else {\n const v = counters.get(e.sym) ?? 0;\n if (!perSym.has(e.sym)) perSym.set(e.sym, { name: e.name, byVer: new Map() });\n const entry = perSym.get(e.sym)!;\n if (!entry.byVer.has(v)) entry.byVer.set(v, []);\n entry.byVer.get(v)!.push(e.node);\n }\n }\n\n for (const { name, byVer } of perSym.values()) {\n const versions = [...byVer.keys()].sort((a, b) => a - b);\n const baseName = this.getFinalVarName(name);\n versions.forEach((v, idx) => {\n const finalName = idx === 0 ? baseName : `${baseName}_${idx + 1}`;\n for (const n of byVer.get(v)!) {\n this.usageToFinalName.set(n, finalName);\n }\n });\n }\n }\n\n // Undo every in-place identifier rewrite made during the current emit, newest\n // first so repeated rewrites of one node unwind to the original value.\n restoreFinalVarMutations(): void {\n for (let i = this.finalVarMutations.length - 1; i >= 0; i--) {\n const mutation = this.finalVarMutations[i];\n Object.defineProperty(mutation.node, 'text', { value: mutation.text, configurable: true, writable: true });\n if (mutation.ownGetFullText) {\n mutation.node.getFullText = mutation.getFullText;\n } else {\n delete mutation.node.getFullText;\n }\n }\n this.finalVarMutations = [];\n }\n\n printNode(node, identation = 0): string {\n if (node && node.kind === SyntaxKind.SourceFile) {\n // Everything below influences emitted text and outlives a single\n // transpile call (the transpiler instance and the parsed SourceFile are\n // both reused), so reset it per file: an emit must not be able to tell\n // whether it is the first or the tenth for the same input.\n this.restoreFinalVarMutations();\n this.ReassignedVars = {};\n this.varListFromObjectLiterals = {};\n this.usageToFinalName = new WeakMap();\n this.finalVarScopeStack = [];\n try {\n return super.printNode(node, identation);\n } finally {\n this.restoreFinalVarMutations();\n }\n }\n return super.printNode(node, identation);\n }\n\n // true when a property value reads a local the body reassigns (or the analyzer saw\n // reassigned ahead): a double-brace anonymous class could not capture it\n objectLiteralCapturesReassigned(node): boolean {\n return this.objectLiteralCapturedKeys(node).length > 0;\n }\n\n // ReassignedVars keys of the reassigned locals a literal's property values read\n objectLiteralCapturedKeys(node): string[] {\n const keys: string[] = [];\n const walk = (n) => {\n if (!n) return;\n if (n.kind === SyntaxKind.Identifier) {\n const name = n.text as string | undefined;\n const key = this.getVarKey(n);\n if (name && name !== 'undefined' && !name.startsWith('null') &&\n (this.usageToFinalName.has(n) || this.ReassignedVars[key])) {\n keys.push(key);\n }\n return;\n }\n n.forEachChild(walk);\n };\n for (const prop of node.properties) {\n walk(prop.initializer);\n }\n return keys;\n }\n\n printVariableDeclarationList(node, identation) {\n const declaration = node.declarations[0];\n\n if (\n this.removeVariableDeclarationForFunctionExpression &&\n declaration?.initializer &&\n isFunctionExpression(declaration.initializer)\n ) {\n return this.printNode(declaration.initializer, identation).trimEnd();\n }\n\n // array destructuring in variable declaration\n if (declaration?.name.kind === SyntaxKind.ArrayBindingPattern) {\n const arrayBindingPattern = declaration.name;\n const arrayBindingPatternElements = arrayBindingPattern.elements;\n const parsedArrayBindingElements = arrayBindingPatternElements.map((e) =>\n this.printNode(e.name, 0)\n );\n const syntheticName = parsedArrayBindingElements.join(\"\") + \"Variable\";\n\n const arrayBindingStatement =\n `${this.getIden(identation)}var ${syntheticName} = ${this.printNode(\n declaration.initializer,\n 0\n )};\\n`;\n\n return arrayBindingStatement + parsedArrayBindingElements.map((e, index) =>\n this.getIden(identation) + `var ${e} = ((java.util.List) ${syntheticName}).get(${index})`\n ).join(\";\\n\");\n }\n\n const isNew =\n declaration?.initializer &&\n declaration.initializer.kind === SyntaxKind.NewExpression;\n let varToken = isNew ? \"var \" : this.VAR_TOKEN + \" \";\n if (!isNew) {\n // a native-arithmetic initializer prints a String/Long/Double value: the\n // declaration can name that type instead of Object (D3, scanned by java-31)\n const arithmeticType = this.javaArithmeticLocalType(declaration);\n if (arithmeticType !== undefined) {\n varToken = arithmeticType + \" \";\n }\n }\n\n // handle `let x;`\n if (!declaration.initializer) {\n return (\n this.getIden(identation) +\n \"Object \" +\n this.printNode(declaration.name) +\n \" = \" +\n this.UNDEFINED_TOKEN\n );\n }\n\n const parsedValue = this.printNode(declaration.initializer, identation).trimStart();\n if (parsedValue === this.UNDEFINED_TOKEN) {\n let specificVarToken = \"Object\";\n if (this.INFER_VAR_TYPE) {\n const variableType = this.getChecker().typeToString(\n this.getChecker().getTypeAtLocation(declaration)\n );\n if (this.VariableTypeReplacements[variableType]) {\n specificVarToken = this.VariableTypeReplacements[variableType];\n }\n }\n return (\n this.getIden(identation) +\n specificVarToken +\n \" \" +\n this.printNode(declaration.name) +\n \" = \" +\n parsedValue\n );\n }\n return (\n this.getIden(identation) +\n varToken +\n this.printNode(declaration.name) +\n \" = \" +\n parsedValue\n );\n }\n\n printThisKeyword(node, identation) {\n\n let current = node?.parent;\n while (current) {\n if (current.kind === SyntaxKind.PropertyAssignment &&\n !this.builderObjectLiterals.has(current.parent)) {\n const className = this.currentClassName;\n return `${this.capitalize(className)}.this`;\n }\n current = current?.parent;\n }\n // if this.x() is inside a object a object literal and we need to add the class name\n return this.THIS_TOKEN;\n }\n\n transformPropertyAcessExpressionIfNeeded(node) {\n const expression = node.expression;\n\n const leftSide = this.printNode(expression, 0);\n const rightSide = node.name.text;\n\n let rawExpression = undefined;\n\n switch (rightSide) {\n case \"length\": {\n const type = (this.getChecker() as Checker).getTypeAtLocation(\n expression\n );\n this.warnIfAnyType(node, (type as any).flags, leftSide, \"length\");\n rawExpression = this.printJavaLength(expression, leftSide);\n break;\n }\n case \"push\":\n rawExpression = `((java.util.List)${leftSide}).add`;\n break;\n }\n return rawExpression;\n }\n\n printCustomDefaultValueIfNeeded(node) {\n if (\n isArrayLiteralExpression(node) ||\n isObjectLiteralExpression(node) ||\n isStringLiteral(node) ||\n isBooleanLiteral(node) ||\n isNumericLiteral(node)\n ) {\n return this.UNDEFINED_TOKEN;\n }\n\n if (\n node?.text === \"undefined\" &&\n this.getChecker().getTypeAtLocation(node?.parent)?.flags ===\n TypeFlags.Number\n ) {\n return this.UNDEFINED_TOKEN;\n }\n\n return undefined;\n }\n\n // Unpacks one optional parameter. Native array access replaces Helpers.getArg\n // when the initializer is a pure literal; the null check keeps the helper's\n // contract that a null varargs array reads like an empty one.\n // The expression half is shared with the untyped front, which passes the same value to the\n // typed core as an argument instead of binding a local.\n printOptionalArgExpression(index, initializer) {\n const defaultValue = this.printNode(initializer, 0);\n if (!this.isPureInitializer(initializer)) {\n return `Helpers.getArg(optionalArgs, ${index}, ${defaultValue})`;\n }\n return `optionalArgs != null && optionalArgs.length > ${index} ? optionalArgs[${index}] : ${defaultValue}`;\n }\n\n printOptionalArgInit(paramName, index, initializer) {\n return `Object ${paramName} = ${this.printOptionalArgExpression(index, initializer)};`;\n }\n\n // Pure = evaluating the initializer has no effect and cannot throw, so\n // skipping it when the argument was supplied cannot change behavior.\n isPureInitializer(node) {\n switch (node?.kind) {\n case SyntaxKind.NullKeyword:\n case SyntaxKind.TrueKeyword:\n case SyntaxKind.FalseKeyword:\n case SyntaxKind.StringLiteral:\n case SyntaxKind.NoSubstitutionTemplateLiteral:\n case SyntaxKind.NumericLiteral:\n return true;\n case SyntaxKind.Identifier:\n // `= undefined` prints as null; any other name could be a call result\n return node.text === 'undefined';\n case SyntaxKind.ArrayLiteralExpression:\n return node.elements.every((element) => this.isPureInitializer(element));\n case SyntaxKind.ObjectLiteralExpression:\n return node.properties.every((property) => isPropertyAssignment(property) && this.isPureInitializer(property.initializer));\n case SyntaxKind.ParenthesizedExpression:\n case SyntaxKind.AsExpression:\n case SyntaxKind.TypeAssertionExpression:\n case SyntaxKind.NonNullExpression:\n return this.isPureInitializer(node.expression);\n default:\n return false;\n }\n }\n\n // a literal-defaulted parameter is read as `Objects.requireNonNullElse(x, )`: a dynamic\n // caller pads omitted slots with null, and the parameter stays final with no local copy\n javaDefaultedLocalNames: Map = new Map();\n\n javaDefaultedParameterLocals(node): string[] {\n if (node.body === undefined) {\n return [];\n }\n const types = this.javaCoreParameterTypes(node);\n node.parameters.forEach((param, i) => {\n if (!this.javaIsLiteralDefault(param.initializer) || !isIdentifier(param.name)) {\n return;\n }\n const symbol = this.javaSymbolOf(param.name);\n if (symbol === undefined) {\n return;\n }\n const name = this.printNode(param.name, 0);\n const value = this.javaCoreDefaultArgument(param, types[i]);\n this.javaDefaultedLocalNames.set(symbol, `java.util.Objects.requireNonNullElse(${name}, ${value})`);\n });\n return [];\n }\n\n // a string, number or boolean literal default (null, `undefined` and `{}` / `[]` keep the parameter)\n javaIsLiteralDefault(initializer): boolean {\n let node = initializer;\n while (node !== undefined && (isParenthesizedExpression(node) || isAsExpression(node))) {\n node = node.expression;\n }\n if (node !== undefined && isPrefixUnaryExpression(node) && node.operator === SyntaxKind.MinusToken) {\n node = node.operand;\n }\n return node !== undefined && (isStringLiteralLikeNode(node) || isNumericLiteral(node)\n || node.kind === SyntaxKind.TrueKeyword || node.kind === SyntaxKind.FalseKeyword);\n }\n\n javaDefaultedLocalName(node): string | undefined {\n if (this.javaDefaultedLocalNames.size === 0 || isParameterDeclaration(node.parent)\n || (isPropertyAccessExpression(node.parent) && node.parent.name === node)\n || isPropertyAssignment(node.parent) && node.parent.name === node) {\n return undefined;\n }\n let symbol;\n try {\n symbol = this.getChecker().getSymbolAtLocation(node);\n } catch (e) {\n return undefined;\n }\n return symbol === undefined ? undefined : this.javaDefaultedLocalNames.get(symbol);\n }\n\n printFunctionBody(node, identation) {\n // Save/restore rather than clobber: a nested function re-enters this method\n // and must not destroy the enclosing body's analysis state on the way out.\n const savedVarList = this.varListFromObjectLiterals;\n const savedUsageToFinalName = this.usageToFinalName;\n const savedScopeStack = this.finalVarScopeStack;\n this.varListFromObjectLiterals = {};\n this.analyzeFinalVars(node.body);\n this.finalVarScopeStack = [new Set()];\n const funcParams = node.parameters ?? [];\n const bodyStatements = node.body.statements;\n const isAsync = this.isAsyncFunction(node);\n // a method's default-valued parameters are parameters of its typed signature: no unpack locals\n const splitCore = isMethodDeclaration(node);\n const initParams = splitCore ? this.javaDefaultedParameterLocals(node) : [];\n const processedParts = [];\n try {\n for (let i = 0; i < bodyStatements.length; i++) {\n processedParts.push(this.printNode(bodyStatements[i], identation + 1));\n }\n } finally {\n this.varListFromObjectLiterals = savedVarList;\n this.usageToFinalName = savedUsageToFinalName;\n this.finalVarScopeStack = savedScopeStack;\n }\n let firstStatement = processedParts[0] || '';\n const remainingString = processedParts.slice(1).join(\"\\n\");\n let offSetIndex = 0;\n funcParams.forEach((param, i) => {\n const initializer = param.initializer;\n if (initializer) {\n if (splitCore) {\n if (!this.isPureInitializer(initializer) && !this.javaDefaultedLocalNames.has(this.javaSymbolOf(param.name))) {\n const name = this.printNode(param.name, 0);\n initParams.push(`if (${name} == null) { ${name} = ${this.printNode(initializer, 0)}; }`);\n }\n return; // the value arrives as a parameter of the typed signature\n }\n const index = i + offSetIndex;\n // index = index < 0 ? 0 : i - 1;\n const paramName = this.printNode(param.name, 0);\n initParams.push(this.printOptionalArgInit(paramName, index, initializer));\n } else {\n offSetIndex--;\n }\n });\n\n if (initParams.length > 0) {\n const defaultInitializers =\n initParams.map((l) => this.getIden(identation + 1) + l).join(\"\\n\") +\n \"\\n\";\n const bodyParts = firstStatement.split(\"\\n\");\n const commentPart = bodyParts.filter((line) => this.isComment(line));\n const isComment = commentPart.length > 0;\n if (isComment) {\n const commentPartString = commentPart\n .map((c) => this.getIden(identation + 1) + c.trim())\n .join(\"\\n\");\n const firstStmNoComment = bodyParts\n .filter((line) => !this.isComment(line))\n .join(\"\\n\");\n firstStatement =\n commentPartString + \"\\n\" + defaultInitializers + firstStmNoComment;\n } else {\n firstStatement = defaultInitializers + firstStatement;\n }\n }\n const blockOpen = this.getBlockOpen(identation);\n const blockClose = this.getBlockClose(identation);\n firstStatement = remainingString.length > 0 ? firstStatement + \"\\n\" : firstStatement;\n\n if (isAsync && isMethodDeclaration(node) && this.javaReassignsParameter(node)) {\n // unsupported: a lambda cannot capture a reassigned parameter; the TS source must not reassign it\n const where = `${node.getSourceFile().fileName}:${(node.name as any).text}`;\n this.javaReassigningMethods.push(where);\n const message = `[Java] async method reassigns a parameter (not effectively final, the TS source must use a new local): ${where}`;\n if (this.javaStrictEffectivelyFinal) {\n throw new Error(message);\n }\n Logger.warning(message);\n }\n if (isAsync) {\n const finalWrapperVars = isMethodDeclaration(node) ? '\\n' : this.printFinalOutsideMethodVariableWrappersIfAny(node, identation) + \"\\n\";\n const insideWrappers = isMethodDeclaration(node) ? '\\n' : this.printInsideMethodVariableWrappersIfAny(node, identation + 1) + \"\\n\";\n const body = (firstStatement + remainingString).split(\"\\n\").map(line => this.getIden(identation) + line).join(\"\\n\");\n // Check if last statement is a return — if not, add return null for supplyAsync lambda\n const lastStatement = bodyStatements.length > 1 ? bodyStatements[bodyStatements.length - 1] : (bodyStatements.length > 0 ? bodyStatements[0] : undefined);\n const lastStmtIsReturn = lastStatement && (isReturnStatement(lastStatement) || this.allBranchesTerminate(lastStatement));\n const returnNull = lastStmtIsReturn ? \"\" : (this.getIden(identation + 2) + \"return null;\\n\");\n const supplier = this.asyncSupplier || \"java.util.concurrent.CompletableFuture.supplyAsync\";\n const executorArg = (!this.asyncSupplier && this.asyncExecutor) ? `, ${this.asyncExecutor}` : \"\";\n const asyncBody = this.getIden(identation + 1) + `return ${supplier}(() -> {\\n` +\n insideWrappers +\n body + \"\\n\" +\n returnNull +\n this.getIden(identation + 1) + `}${executorArg});\\n`;\n return blockOpen + finalWrapperVars + asyncBody + blockClose;\n\n }\n return blockOpen + firstStatement + remainingString + blockClose;\n }\n\n printBlock(node, identation, chainBlock = false) {\n // Track per-block scope for final var dedup: same final name must not be\n // declared twice in a single block (Java would error), but may shadow\n // across nested blocks. We push an empty scope on entry and pop on exit.\n const managed = this.finalVarScopeStack.length > 0;\n if (managed) this.finalVarScopeStack.push(new Set());\n try {\n return super.printBlock(node, identation, chainBlock);\n } finally {\n if (managed) this.finalVarScopeStack.pop();\n }\n }\n\n printInstanceOfExpression(node, identation) {\n // const left = node.left.escapedText;\n const right = node.right.text;\n const left = this.printNode(node.left, 0);\n // const right = this.printNode(node.right, 0);\n return this.getIden(identation) + `Helpers.isInstance(${left}, ${right}.class)`;\n }\n\n printAwaitExpression(node, identation) {\n const expression = this.printNode(node.expression, identation);\n return `(${expression}).join()`;\n }\n\n printAsExpression(node, identation) {\n const type = node.type;\n\n if (type.kind === SyntaxKind.AnyKeyword) {\n return `((${this.VariableTypeReplacements['object']})${this.printNode(\n node.expression,\n identation\n )})`;\n }\n\n if (type.kind === SyntaxKind.StringKeyword) {\n return `((String)${this.printNode(node.expression, identation)})`;\n }\n\n if (type.kind === SyntaxKind.ArrayType) {\n const element = type.elementType.kind === SyntaxKind.AnyKeyword ? 'Object'\n : type.elementType.kind === SyntaxKind.StringKeyword ? 'String' : undefined;\n if (element !== undefined) {\n return `(java.util.List<${element}>)(${this.printNode(node.expression, identation)})`;\n }\n }\n\n return this.printNode(node.expression, identation);\n }\n\n // every Java parameter is `Object` (base printParameterType), except the ones whose TS\n // annotation names a native-carriable alias (javaNativeParameterType)\n printParameterType(node) {\n const native = this.javaNativeParameterType(node);\n if (native !== undefined) {\n return native;\n }\n return super.printParameterType(node);\n }\n\n printParameter(node, defaultValue = true) {\n const name = this.printNode(node.name, 0);\n const initializer = node.initializer;\n\n const type = this.printParameterType(node) || \"\";\n\n if (defaultValue) {\n if (initializer) {\n const def = this.printCustomDefaultValueIfNeeded(initializer) || this.printNode(initializer, 0);\n return type + \" \" + name + this.SPACE_DEFAULT_PARAM + \"=\" + this.SPACE_DEFAULT_PARAM + def;\n }\n return type + \" \" + name;\n }\n return name;\n }\n\n // the typed core signature: every parameter prints its Java type, the default-valued ones\n // included (a Java signature cannot carry a default - the front supplies it)\n printCoreMethodParameters(node) {\n return node.parameters.map(param => (param.initializer !== undefined\n ? `${this.javaOptionalParameterJavaType(param)} ${this.printNode(param.name, 0)}`\n : this.printParameter(param))).join(\", \");\n }\n\n // an async method's reassigned parameter prints under sigName (post keyword-remap),\n // freeing the original name for the lambda body to bind\n javaAsyncSignatureParameter(param, isAsyncMethod, printedParam) {\n if (isAsyncMethod && this.ReassignedVars[this.getVarKey(param)]) {\n const { localName, sigName } = this.getAsyncParamWrapperNames(param.name.text);\n return printedParam.replace(localName, sigName);\n }\n return printedParam;\n }\n\n // the async method body writes one of its parameters, or a non-pure default must be applied\n // by an `if (x == null) { x = init; }` inside the lambda (both break effective finality)\n javaReassignsParameter(node): boolean {\n const params = node.parameters ?? [];\n if (params.some((p) => p.initializer !== undefined && !this.isPureInitializer(p.initializer) && this.isAsyncFunction(node))) {\n return true;\n }\n const symbols = new Set();\n params.forEach((p) => {\n const symbol = this.javaSymbolOf(p.name);\n if (symbol !== undefined) {\n symbols.add(symbol);\n }\n });\n return symbols.size > 0 && node.body !== undefined && this.javaWritesSymbol(node.body, symbols);\n }\n\n javaSymbolOf(node): any | undefined {\n return this.getChecker().getSymbolAtLocation(node);\n }\n\n // syntactic walk: assignment targets, ++/--, destructuring targets and for-in/of expression heads\n javaWritesSymbol(node, symbols: Set): boolean {\n if (isBinaryExpression(node)) {\n const op = node.operatorToken.kind;\n if (op >= SyntaxKind.FirstAssignment && op <= SyntaxKind.LastAssignment\n && this.javaTargetWritesSymbol(node.left, symbols, op === SyntaxKind.EqualsToken)) {\n return true;\n }\n } else if ((isPrefixUnaryExpression(node) || isPostfixUnaryExpression(node))\n && (node.operator === SyntaxKind.PlusPlusToken || node.operator === SyntaxKind.MinusMinusToken)\n && this.javaTargetWritesSymbol(node.operand, symbols, false)) {\n return true;\n } else if ((isForInStatement(node) || isForOfStatement(node))\n && !isVariableDeclarationList(node.initializer)\n && this.javaTargetWritesSymbol(node.initializer, symbols, true)) {\n return true;\n }\n return node.forEachChild((child) => this.javaWritesSymbol(child, symbols) || undefined) === true;\n }\n\n javaTargetWritesSymbol(target, symbols: Set, destructuring: boolean): boolean {\n if (isParenthesizedExpression(target) || isNonNullExpression(target) || isAsExpression(target)) {\n return this.javaTargetWritesSymbol(target.expression, symbols, destructuring);\n }\n if (isIdentifier(target)) {\n const symbol = this.javaSymbolOf(target);\n return symbol !== undefined && symbols.has(symbol);\n }\n if (!destructuring) {\n return false;\n }\n if (isArrayLiteralExpression(target)) {\n return target.elements.some((e) => this.javaTargetWritesSymbol(isSpreadElement(e) ? e.expression : e, symbols, true));\n }\n if (isObjectLiteralExpression(target)) {\n return target.properties.some((p) => {\n if (isShorthandPropertyAssignment(p)) {\n return this.javaTargetWritesSymbol(p.name, symbols, true);\n }\n if (isPropertyAssignment(p)) {\n return this.javaTargetWritesSymbol(p.initializer, symbols, true);\n }\n return isSpreadAssignment(p) && this.javaTargetWritesSymbol(p.expression, symbols, true);\n });\n }\n if (isBinaryExpression(target) && target.operatorToken.kind === SyntaxKind.EqualsToken) {\n return this.javaTargetWritesSymbol(target.left, symbols, true); // `[x = 1] = ...` default\n }\n return false;\n }\n\n // `file:method` of every async method whose body reassigns a parameter (unsupported in Java lambdas)\n javaReassigningMethods: string[] = [];\n // the embedding build turns a reassigned async parameter into a hard transpile error\n javaStrictEffectivelyFinal = false;\n\n printMethodParameters(node) {\n const isAsyncMethod = this.isAsyncFunction(node);\n const params = node.parameters.map(param => this.javaAsyncSignatureParameter(param, isAsyncMethod, this.printParameter(param)));\n const hasOptionalParameter = node.parameters.some(p => p.initializer !== undefined || p.questionToken !== undefined);\n if (!hasOptionalParameter) {\n return params.join(\", \");\n }\n const paramsWithOptional = params.filter(param => param.indexOf('=') === -1);\n paramsWithOptional.push('Object... optionalArgs');\n return paramsWithOptional.join(\", \");\n }\n\n printArrayLiteralExpression(node) {\n // For Java: new ArrayList<>(Arrays.asList(elem1, elem2, ...))\n const elements = node.elements.map((e) => this.printNode(e)).join(\", \");\n return `${this.ARRAY_OPENING_TOKEN}${elements}${this.ARRAY_CLOSING_TOKEN}`;\n }\n\n\n printFinalOutsideMethodVariableWrappersIfAny(node, identation) {\n return this.javaAsyncParamWrapperLines(node, identation, (param, isOptionalParam, { sigName, snapName }) => {\n // a default-valued parameter of the split core keeps its type in the\n // snapshot (`final Long since3 = since2;`); the body local stays `Object`\n const snapType = (isOptionalParam && param.initializer !== undefined)\n ? this.javaOptionalParameterJavaType(param) : 'Object';\n return `final ${snapType} ${snapName} = ${sigName};`;\n });\n }\n\n printInsideMethodVariableWrappersIfAny(node, identation) {\n return this.javaAsyncParamWrapperLines(node, identation, (param, _isOptionalParam, { localName, snapName }) =>\n `${this.javaAsyncParameterLocalType(param) ?? 'Object'} ${localName} = ${snapName};`);\n }\n\n // one line per reassigned parameter of an async method (optional ones only in a split core)\n javaAsyncParamWrapperLines(node, identation, printLine) {\n const parameters = node?.parameters;\n const finalVarWrappers = [];\n if (parameters) {\n const isAsyncMethod = this.isAsyncFunction(node);\n const splitCore = this.hasDefaultedTail(node);\n parameters.forEach(param => {\n const isOptionalParam = param.initializer !== undefined || param.questionToken !== undefined;\n if ((!isOptionalParam || splitCore) && isAsyncMethod && this.ReassignedVars[this.getVarKey(param)]) {\n const names = this.getAsyncParamWrapperNames(param.name.text);\n finalVarWrappers.push(this.getIden(identation + 1) + printLine(param, isOptionalParam, names));\n }\n });\n }\n return finalVarWrappers.join(\"\\n\");\n }\n\n printMethodDeclaration(node, identation) {\n const funcBody = this.printFunctionBody(node, identation); // print body first to get var reassignments filled\n // one typed signature: default-valued and `?` parameters are ordinary typed parameters\n let methodDef = this.printMethodDefinition(node, identation, (n) => this.printCoreMethodParameters(n));\n methodDef += funcBody;\n methodDef += this.printOverrideBridges(node, identation);\n\n return methodDef;\n }\n\n printMethodDefinition(node, identation, paramsPrinter = undefined) {\n const name = this.transformMethodNameIfNeeded(node.name.text);\n\n let returnType = this.printFunctionType(node);\n\n // quick fix\n if (returnType === 'java.util.concurrent.CompletableFuture') {\n returnType = 'java.util.concurrent.CompletableFuture';\n }\n\n // D-09: an internal (non-override) generated method whose every return already\n // prints the native type carries it in its signature (see javaNativeReturnType).\n // Only the boxed default is replaced - void/Promise/plain-string stay as printed.\n if (returnType === this.DEFAULT_RETURN_TYPE) {\n const native = this.javaNativeReturnType(node);\n if (native !== undefined) {\n returnType = native;\n }\n }\n\n const modifiers = this.METHOD_DEFAULT_ACCESS ? this.METHOD_DEFAULT_ACCESS + \" \" : \"\";\n const parsedArgs = paramsPrinter ? paramsPrinter(node) : this.printMethodParameters(node);\n\n returnType = returnType ? returnType + \" \" : returnType;\n\n const methodToken = this.METHOD_TOKEN ? this.METHOD_TOKEN + \" \" : \"\";\n const signature = this.getIden(identation) + modifiers + returnType + methodToken + name + \"(\" + parsedArgs + \")\";\n\n return this.printNodeCommentsIfAny(node, identation, signature);\n }\n\n // `Array.isArray(x)` prints `(x instanceof java.util.List)`: false for null, true for a List, same\n // as the helper for every Java-object operand. The helper stays where the operand prints as a Java\n // array (rest parameter: `getClass().isArray()` branch) or a final class not convertible to List.\n printArrayIsArrayCall(node, _identation, parsedArg = undefined) {\n const native = this.printNativeArrayIsArray(node, parsedArg);\n return native === undefined ? `Helpers.isArray(${parsedArg})` : native;\n }\n\n printNativeArrayIsArray(node, parsedArg) {\n const operand: any = node?.arguments?.[0];\n if (operand === undefined || parsedArg === undefined) {\n return undefined;\n }\n // the whole call is the value of an expression statement: a bare `true;`/`false;` is\n // not a Java statement, so that position keeps the helper call\n if (node.parent !== undefined && isExpressionStatement(node.parent)) {\n return undefined;\n }\n // a side-effect-free array literal prints as a fresh ArrayList (never null), so the\n // answer is true without evaluating anything the helper would have to keep\n if (isArrayLiteralExpression(operand)) {\n return this.javaArrayLiteralDropsNothing(operand) ? 'true' : undefined;\n }\n if (!this.javaPrimaryIsArrayOperand(operand)) {\n return undefined;\n }\n const type = this.javaOperandType(operand);\n // a plain identifier of a type that can never hold a List: the helper answers false\n // for null/undefined and for every scalar, and the reference stays untouched\n if (operand.kind === SyntaxKind.Identifier && this.javaNonArrayType(type)) {\n return 'false';\n }\n if (this.isVarargsArrayReference(operand)) {\n return undefined;\n }\n if (this.javaScalarType(type)) {\n return undefined;\n }\n return `(${parsedArg} instanceof java.util.List)`;\n }\n\n // Operand shapes whose print is a primary expression: `instanceof` binds tighter than the\n // low-precedence operators, so a ternary/binary operand would re-parse, and a constructor\n // or cast print can be a final Java class on which `instanceof List` is not convertible.\n javaPrimaryIsArrayOperand(node): boolean {\n const kind = node.kind;\n return kind === SyntaxKind.Identifier\n || kind === SyntaxKind.PropertyAccessExpression\n || kind === SyntaxKind.ElementAccessExpression\n || kind === SyntaxKind.CallExpression;\n }\n\n javaOperandType(operand) {\n return this.checkerOrUndefined()?.getTypeAtLocation(operand);\n }\n\n // literals and identifiers have nothing an array-literal wrapper could skip by dropping\n javaArrayLiteralDropsNothing(node, depth = 0): boolean {\n if (depth > 4) {\n return false;\n }\n return node.elements.every((element) => isStringLiteral(element)\n || isNumericLiteral(element)\n || element.kind === SyntaxKind.TrueKeyword\n || element.kind === SyntaxKind.FalseKeyword\n || element.kind === SyntaxKind.NullKeyword\n || element.kind === SyntaxKind.Identifier\n || (isArrayLiteralExpression(element) && this.javaArrayLiteralDropsNothing(element, depth + 1)));\n }\n\n // types whose Java print is a scalar final class (`instanceof java.util.List` is not\n // convertible on them): the scalar family, and unions made only of scalars/nulls\n javaScalarType(type): boolean {\n return this.javaTypeFlagsOnly(type, JAVA_SCALAR_TYPE_FLAGS);\n }\n\n // types that provably never hold a List: every scalar (Java String/Long/Double/Boolean\n // answer false) and the nullish types (JS Array.isArray(null) is false)\n javaNonArrayType(type): boolean {\n return this.javaTypeFlagsOnly(type, JAVA_SCALAR_TYPE_FLAGS | JAVA_NULLISH_TYPE_FLAGS);\n }\n\n // the type, or every member of its (nested) union, carries one of the mask's flags\n javaTypeFlagsOnly(type, mask: number, depth = 0): boolean {\n if (type === undefined || type === null || depth > 3) {\n return false;\n }\n const flags: any = type.flags;\n if (flags & TypeFlags.Union) {\n const parts: any[] = type.getTypes?.() ?? [];\n return parts.length > 0 && parts.every((part) => this.javaTypeFlagsOnly(part, mask, depth + 1));\n }\n return (flags & mask) !== 0;\n }\n\n // A checker-proven dict prints a Map on every path, so the key copy is native;\n // every other target keeps the helper — shared field maps need its synchronized\n // snapshot, the rest need its instanceof/null fallbacks.\n printObjectKeysCall(node, _identation, parsedArg = undefined) {\n return this.printNativeObjectKeysCall(node) ?? `Helpers.objectKeys(${parsedArg})`;\n }\n\n printNativeObjectKeysCall(node) {\n const argument = node?.arguments?.[0];\n if (argument === undefined || isPropertyAccessExpression(argument)) {\n return undefined;\n }\n // a local the pass declares a Map needs no checkcast: the key copy binds on the\n // declaration's own type, exactly the helper's synchronized map branch\n if (this.javaDeclaredMapReceiver(argument)) {\n return `new java.util.ArrayList(${this.printNode(argument, 0)}.keySet())`;\n }\n const checker: any = this.checkerOrUndefined();\n if (checker === undefined) {\n return undefined;\n }\n const type = checker.getTypeAtLocation(argument);\n if (!this.isJavaMapStructureType(type)) {\n return undefined;\n }\n return `new java.util.ArrayList(((java.util.Map)${this.printNode(argument, 0)}).keySet())`;\n }\n\n printObjectValuesCall(_node, _identation, parsedArg = undefined) {\n return `Helpers.objectValues(${parsedArg})`;\n }\n\n printJsonParseCall(_node, _identation, parsedArg = undefined) {\n return `Helpers.parseJson(${parsedArg})`;\n }\n\n printJsonStringifyCall(_node, _identation, parsedArg = undefined) {\n return `Helpers.json(${parsedArg})`;\n }\n\n // `await Promise.all ([e1, ..., en])` with every element checker-typed `Promise<...>`:\n // CompletableFuture.allOf waits for exactly those, so Helpers.promiseAll's reflective loop adds\n // nothing. Result used -> thenApply collecting values, only for `const` locals (no double runs).\n printNativePromiseAllCall(node) {\n const awaitNode = node?.parent;\n if (awaitNode?.kind !== SyntaxKind.AwaitExpression) {\n return undefined;\n }\n const listNode = node.arguments?.[0];\n if (listNode?.kind !== SyntaxKind.ArrayLiteralExpression) {\n return undefined;\n }\n const elements = listNode.elements as unknown as Expression[];\n const checker = this.getChecker();\n for (const element of elements) {\n if (element.kind === SyntaxKind.SpreadElement\n || !this.isPromiseType(checker.getTypeAtLocation(element))) {\n return undefined;\n }\n }\n const printed = elements.map((element) => this.printNode(element));\n const futureCast = `((${this.PROMISE_TYPE_KEYWORD}) `;\n const casted = printed.map((element) => `${futureCast}${element})`);\n const allOf = `${this.PROMISE_TYPE_KEYWORD}.allOf(${casted.join(\", \")})`;\n if (awaitNode.parent?.kind === SyntaxKind.ExpressionStatement) {\n return allOf;\n }\n if (elements.length === 0\n || !elements.every((element) => this.isConstBoundIdentifier(element))\n || printed.indexOf('promiseAllValue') !== -1) {\n return undefined;\n }\n const collected = casted.map((element) => `${element}.join()`).join(\", \");\n const collectList = `${this.ARRAY_OPENING_TOKEN}${collected}${this.ARRAY_CLOSING_TOKEN}`;\n return `${allOf}.thenApply(promiseAllValue -> ${collectList})`;\n }\n\n // a `const`-bound local is assigned exactly once, so the printed java local is\n // effectively final (a lambda can capture it) and re-reading it joins the same future\n isConstBoundIdentifier(node) {\n if (node.kind !== SyntaxKind.Identifier) {\n return false;\n }\n const declaration = this.getChecker().getSymbolAtLocation(node)?.valueDeclaration?.resolve();\n return declaration?.kind === SyntaxKind.VariableDeclaration\n && (getCombinedNodeFlags(declaration) & NodeFlags.Const) === NodeFlags.Const;\n }\n\n printPromiseAllCall(node, identation, parsedArg = undefined) {\n return this.printNativePromiseAllCall(node) ?? `Helpers.promiseAll(${parsedArg})`;\n }\n\n printMathFloorCall(node, _identation, parsedArg = undefined) {\n return `(Math.floor(Double.parseDouble(${this.javaStringBoxText(node?.arguments?.[0], parsedArg)})))`;\n }\n\n printMathRoundCall(node, _identation, parsedArg = undefined) {\n return `Math.round(Double.parseDouble(${this.javaStringBoxText(node?.arguments?.[0], parsedArg)}))`;\n }\n\n printMathCeilCall(node, _identation, parsedArg = undefined) {\n return `Math.ceil(Double.parseDouble(${this.javaStringBoxText(node?.arguments?.[0], parsedArg)}))`;\n }\n\n printNumberIsIntegerCall(_node, _identation, parsedArg = undefined) {\n return `((${parsedArg} instanceof Integer) || (${parsedArg} instanceof Long))`;\n }\n\n printArrayPushCall(_node, _identation, name = undefined, parsedArg = undefined) {\n return `((java.util.List)${name}).add(${parsedArg})`;\n }\n\n printIncludesCall(_node, _identation, name = undefined, parsedArg = undefined) {\n return `${name}.contains(${parsedArg})`;\n }\n\n // Helpers.getIndexOf(str, target) is List.indexOf for a List receiver, String.indexOf for a String\n // receiver with a String target, -1 otherwise. Locals are `Object`/`var`, so the native call takes\n // the same checkcast as `.length()` / `containsKey`; the target takes one unless a printed String.\n javaNativeIndexOfCall(node, name, parsedArg) {\n if (node === undefined || name === undefined || parsedArg === undefined) {\n return undefined;\n }\n const receiver = node?.expression?.expression;\n if (receiver === undefined) {\n return undefined;\n }\n const checker: any = this.getChecker();\n let receiverType: any;\n try {\n receiverType = checker.getTypeAtLocation(receiver);\n } catch (e) {\n return undefined;\n }\n // a rest parameter is a Java array, not a List: the helper's `instanceof List` test fails there\n // and so must the native call. The wildcard receiver cast is the `.length()` family's and accepts\n // a List of any element type (a `List` cast fails on a `List`-static receiver).\n if (this.isJavaListType(receiverType) && !this.isVarargsArrayReference(receiver)) {\n return `((java.util.List)${name}).indexOf(${parsedArg})`;\n }\n // plain `string` only: the nullable aliases (`Str`) and every union can hold\n // undefined, which the helper absorbs as -1 but String.indexOf has no receiver for\n if (receiverType.getAliasSymbol?.() !== undefined || !this.isStringType(receiverType.flags)) {\n return undefined;\n }\n const arg = node.arguments?.[0];\n if (arg === undefined) {\n return undefined;\n }\n if (this.javaProvableString(arg)) {\n return `((String)${name}).indexOf(${parsedArg})`;\n }\n let argType: any;\n try {\n argType = checker.getTypeAtLocation(arg);\n } catch (e) {\n return undefined;\n }\n // a bare identifier / field target the checker types as a plain string: the cast is\n // the printer's own startsWith/endsWith argument shape\n if (argType.getAliasSymbol?.() === undefined && this.isStringType(argType.flags)\n && (isIdentifier(arg) || isPropertyAccessExpression(arg))) {\n return `((String)${name}).indexOf(((String)${parsedArg}))`;\n }\n return undefined;\n }\n\n printIndexOfCall(node, _identation, name = undefined, parsedArg = undefined) {\n return this.javaNativeIndexOfCall(node, name, parsedArg) ?? this.javaHx4J06NarrowedIndexOf(node, name, parsedArg) ?? `${this.INDEXOF_WRAPPER_OPEN}${name}, ${parsedArg}${this.INDEXOF_WRAPPER_CLOSE}`;\n }\n\n printSearchCall(_node, _identation, name = undefined, parsedArg = undefined) {\n return `((String)${name}).indexOf(${parsedArg})`;\n }\n\n printStartsWithCall(_node, _identation, name = undefined, parsedArg = undefined) {\n return `((String)${name}).startsWith(((String)${parsedArg}))`;\n }\n\n printEndsWithCall(_node, _identation, name = undefined, parsedArg = undefined) {\n return `((String)${name}).endsWith(((String)${parsedArg}))`;\n }\n\n printTrimCall(_node, _identation, name = undefined) {\n return `((String)${name}).trim()`;\n }\n\n printJoinCall(_node, _identation, name = undefined, parsedArg = undefined) {\n // assumes List\n return `String.join((String)${parsedArg}, (java.util.List)${name})`;\n }\n\n printSplitCall(node, _identation, name = undefined, parsedArg = undefined) {\n return this.javaNativeSplitCall(node, name, parsedArg) ?? `Helpers.split(${name}, ${parsedArg})`;\n }\n\n printConcatCall(_node, _identation, name = undefined, parsedArg = undefined) {\n return `Helpers.concat(${name}, ${parsedArg})`;\n }\n\n printToFixedCall(_node, _identation, name = undefined, parsedArg = undefined) {\n return `toFixed(${name}, ${parsedArg})`;\n }\n\n printToStringCall(_node, _identation, name = undefined) {\n return `String.valueOf(${name})`;\n }\n\n printToUpperCaseCall(_node, _identation, name = undefined) {\n return `((String)${name}).toUpperCase()`;\n }\n\n printToLowerCaseCall(_node, _identation, name = undefined) {\n return `((String)${name}).toLowerCase()`;\n }\n\n printShiftCall(_node, _identation, name = undefined) {\n return `((java.util.List)${name}).get(0)`;\n }\n\n printReverseCall(_node, _identation, name = undefined) {\n return `java.util.Collections.reverse((java.util.List)${name})`;\n }\n\n printPopCall(_node, _identation, name = undefined) {\n return `((java.util.List)${name}).get(((java.util.List)${name}).size()-1)`;\n }\n\n printAssertCall(_node, _identation, parsedArgs) {\n return `assert(${parsedArgs})`;\n }\n\n printSliceCall(node, _identation, name = undefined, parsedArg = undefined, parsedArg2 = undefined) {\n const nativeCall = this.nativeSliceCallIfProvable(node, name);\n if (nativeCall !== undefined) {\n return nativeCall;\n }\n if (parsedArg2 === undefined) {\n parsedArg2 = \"null\";\n }\n return `Helpers.slice(${name}, ${parsedArg}, ${parsedArg2})`;\n }\n\n // Integer value of a slice bound that is an integer literal (`18`, `-64`); anything else keeps\n // the helper — the Java helper converts bounds with toInt, and a double cannot be clamped with the\n // integer Math.min/Math.max of the native form.\n javaSliceLiteralBound(node) {\n if (node === undefined) {\n return undefined;\n }\n if (isNumericLiteral(node)) {\n const text = String(node.text);\n if (text.indexOf('.') !== -1 || text.indexOf('e') !== -1 || text.indexOf('E') !== -1) {\n return undefined;\n }\n const value = Number(text);\n return value <= 2147483647 ? value : undefined;\n }\n if (isPrefixUnaryExpression(node) && node.operator === SyntaxKind.MinusToken) {\n const inner = this.javaSliceLiteralBound(node.operand);\n return inner === undefined ? undefined : -inner;\n }\n return undefined;\n }\n\n // JS slice clamps a literal bound into [0, length]: a non-negative bound is min\n // (bound, length), a negative one counts from the end (max (length - |bound|, 0)).\n // `0` stays `0` because the length of a String/List is never negative.\n javaSliceBoundExpression(value, length) {\n if (value === 0) {\n return '0';\n }\n return value > 0 ? `Math.min(${value}, ${length})` : `Math.max(${length} - ${-value}, 0)`;\n }\n\n // `x.slice (a, b)` -> substring/subList when the receiver provably prints as String/List AND every\n // bound is an integer literal: Java throws where JS clamps, so only literal bounds can be clamped.\n // The null guard keeps null -> null and needs a side-effect-free receiver (read up to three times).\n nativeSliceCallIfProvable(node, name) {\n const args = node?.arguments ?? [];\n if (args.length < 1 || args.length > 2) {\n return undefined;\n }\n const start = this.javaSliceLiteralBound(args[0]);\n if (start === undefined) {\n return undefined;\n }\n const hasEnd = args.length === 2;\n const end = hasEnd ? this.javaSliceLiteralBound(args[1]) : undefined;\n if (hasEnd && end === undefined) {\n return undefined;\n }\n const receiverExpression = isPropertyAccessExpression(node?.expression) ? node.expression.expression : undefined;\n if (!this.sideEffectFreeReceiver(receiverExpression)) {\n return undefined;\n }\n let kind: string;\n try {\n const type = this.getChecker().getTypeAtLocation(receiverExpression);\n if (this.isStringType(type.flags)) {\n kind = 'String';\n } else if (this.isJavaListType(type) && !this.isVarargsArrayReference(receiverExpression)) {\n kind = 'List';\n } else {\n return undefined;\n }\n } catch (e) {\n return undefined;\n }\n const cast = kind === 'String' ? `((String)${name})` : `((java.util.List)${name})`;\n const length = kind === 'String' ? `${cast}.length()` : `${cast}.size()`;\n const startText = this.javaSliceBoundExpression(start, length);\n const endText = hasEnd ? this.javaSliceBoundExpression(end, length) : length;\n // from <= to is proven per case: 0 is never above a clamp, an open end is the\n // length, and two literals clamp monotonically once they keep their order\n // (non-negative, or both counting from the end with |start| >= |end|).\n const ordered = start === 0 || !hasEnd\n || (start >= 0 && end >= 0 && start <= end)\n || (start < 0 && end < 0 && start <= end);\n const fromText = ordered ? startText : `Math.min(${startText}, ${endText})`;\n // an inverted pair yields an empty slice in JS, so the substrings collapse to\n // substring (to, to); a one-argument String slice drops the end entirely\n const argumentsText = hasEnd || kind === 'List' ? `${fromText}, ${endText}` : fromText;\n const method = kind === 'String' ? 'substring' : 'subList';\n return `(${name} == null ? null : ${cast}.${method}(${argumentsText}))`;\n }\n\n printReplaceCall(_node, _identation, name = undefined, parsedArg = undefined, parsedArg2 = undefined) {\n return `Helpers.replace((String)${name}, (String)${parsedArg}, (String)${parsedArg2})`;\n }\n\n printReplaceAllCall(node, identation, name = undefined, parsedArg = undefined, parsedArg2 = undefined) {\n // Native when both arguments are plain string literals and the pattern is non-empty: the\n // helper's null / empty-pattern guards cannot fire for them, and `String.replace` is the\n // literal all-occurrences replacement. The null guard on the receiver keeps the helper's\n // null -> null behaviour; it is only emitted for a side-effect-free receiver (identifier\n // or property access), so a double read cannot change semantics.\n const pattern = this.stringLiteralArgument(node?.arguments?.[0]);\n const replacement = this.stringLiteralArgument(node?.arguments?.[1]);\n const receiver = this.sideEffectFreeReceiver(node?.expression);\n if (pattern !== undefined && replacement !== undefined && receiver) {\n return `(${name} == null ? null : ((String)${name}).replace(${pattern}, ${replacement}))`;\n }\n return `Helpers.replaceAll((String)${name}, (String)${parsedArg}, (String)${parsedArg2})`;\n }\n\n // Printed form of a non-empty string-literal argument with no escapes, or undefined when the\n // argument is not a literal, prints with an escape sequence, or is the empty pattern.\n stringLiteralArgument(argument) {\n if (argument === undefined || !isStringLiteral(argument)) {\n return undefined;\n }\n const printed = this.printNode(argument, 0);\n return /^\"[^\"\\\\]+\"$/.test(printed) ? printed : undefined;\n }\n\n // True for receivers that read a value without calling anything: `x`, `x.y`, `this.x`,\n // `(x as string)` and parenthesised forms of those. Guards the double read of the ternary.\n sideEffectFreeReceiver(expression) {\n if (expression === undefined) {\n return false;\n }\n if (isParenthesizedExpression(expression) || isAsExpression(expression) || isTypeAssertion(expression)) {\n return this.sideEffectFreeReceiver(expression.expression);\n }\n if (isIdentifier(expression) || expression.kind === SyntaxKind.ThisKeyword) {\n return true;\n }\n if (isPropertyAccessExpression(expression)) {\n return this.sideEffectFreeReceiver(expression.expression);\n }\n return false;\n }\n\n printPadEndCall(_node, _identation, name, parsedArg, parsedArg2) {\n // You can point this to a runtime helper if you have one\n return `Helpers.padEnd((String)${name}, ((Number)${parsedArg}).intValue(), ((String)${parsedArg2}).charAt(0))`;\n }\n\n printPadStartCall(node, _identation, name, parsedArg, parsedArg2) {\n return this.printNativePadStart(node, name) ?? `Helpers.padStart((String)${name}, ((Number)${parsedArg}).intValue(), ((String)${parsedArg2}).charAt(0))`;\n }\n\n printDateNowCall(_node, _identation) {\n return \"System.currentTimeMillis()\";\n }\n\n printLengthProperty(node, _identation, _name = undefined) {\n const leftSide = this.printNode(node.expression, 0);\n const type = (this.getChecker() as Checker).getTypeAtLocation(node.expression);\n this.warnIfAnyType(node, (type as any).flags, leftSide, \"length\");\n return this.printJavaLength(node.expression, leftSide);\n }\n\n // For ++/--, prefer native Java operators rather than the C# ref-helpers\n printPostFixUnaryExpression(node, identation) {\n const { operand, operator } = node;\n const leftSide = this.printNode(operand, 0);\n return this.PostFixOperators[operator] === \"--\" ? `${leftSide}--` : `${leftSide}++`;\n }\n\n // the identifier declared by a `for (var i = ; ...; i++)` header: the\n // printer writes that initializer as `var`, so javac infers a primitive int and the\n // ++/-- increment keeps it one\n javaPrimitiveCounter(node): boolean {\n if (node?.kind !== SyntaxKind.Identifier) {\n return false;\n }\n const symbol = this.getChecker().getSymbolAtLocation(node);\n const declaration: any = symbol?.valueDeclaration?.resolve() ?? symbol?.declarations?.[0]?.resolve();\n if (declaration === undefined || !isVariableDeclaration(declaration) || !isIdentifier(declaration.name)) {\n return false;\n }\n if (declaration.name.text !== node.text || declaration.initializer === undefined) {\n return false;\n }\n const list: any = declaration.parent;\n if (list?.kind !== SyntaxKind.VariableDeclarationList || list.declarations.length !== 1) {\n return false;\n }\n const forStatement: any = list.parent;\n if (forStatement?.kind !== SyntaxKind.ForStatement || forStatement.initializer !== list) {\n return false;\n }\n if (this.javaIntegerLiteralKind(declaration.initializer) === undefined) {\n return false;\n }\n const incrementor = forStatement.incrementor;\n return incrementor?.kind === SyntaxKind.PostfixUnaryExpression\n && incrementor.operand?.kind === SyntaxKind.Identifier\n && incrementor.operand.text === node.text;\n }\n\n // `-x` prints as the plain Java operator when the operand is already primitive: a decimal literal,\n // a nested native `+ - * /`, a `for (var i = ` counter or a `.length` read.\n // Helpers.opNeg preserves the box and maps null to null, so every boxed local keeps the helper.\n javaNativeNegation(node): boolean {\n if (node === undefined) {\n return false;\n }\n if (node.kind === SyntaxKind.ParenthesizedExpression) {\n return this.javaNativeNegation(node.expression);\n }\n if (isNumericLiteral(node)) {\n return this.javaProvableNumericKind(node) !== undefined;\n }\n if (node.kind === SyntaxKind.BinaryExpression) {\n return this.javaNativeArithmeticKind(node) !== undefined;\n }\n if (this.javaPrimitiveCounter(node)) {\n return true;\n }\n return node.kind === SyntaxKind.PropertyAccessExpression\n && node.name.text === 'length'\n && this.javaLengthKind(node.expression) !== undefined;\n }\n\n printPrefixUnaryExpression(node, identation) {\n const { operand, operator } = node;\n if (operator === SyntaxKind.ExclamationToken) {\n return this.PrefixFixOperators[operator] + this.printCondition(node.operand, 0);\n }\n const leftSide = this.printNode(operand, 0);\n if (operator === SyntaxKind.PlusToken) {\n return `+(${leftSide})`;\n } else if (operator === SyntaxKind.MinusToken) {\n if (this.javaNativeNegation(operand)) {\n return `-${leftSide}`;\n }\n return `Helpers.opNeg(${leftSide})`;\n }\n return super.printPrefixUnaryExpression(node, identation);\n }\n\n javaBooleanCondition(node) {\n if (node.kind === SyntaxKind.ParenthesizedExpression) {\n return this.javaBooleanCondition(node.expression);\n }\n if (node.kind === SyntaxKind.PrefixUnaryExpression) {\n return node.operator === SyntaxKind.ExclamationToken && this.javaBooleanCondition(node.operand);\n }\n if (node.kind !== SyntaxKind.BinaryExpression) {\n return false;\n }\n return this.javaBooleanOperators.includes(node.operatorToken.kind);\n }\n\n // `Precise.(a, b)` resolving to a static of the base `Precise` class: Precise.java\n // declares them `public static boolean`, so the call is a primitive boolean. The receiver name\n // alone is no proof (a shadowing local prints the same text), so the resolution is checked too.\n javaPreciseBooleanCall(node) {\n if (node.kind === SyntaxKind.ParenthesizedExpression) {\n return this.javaPreciseBooleanCall(node.expression);\n }\n // `!` is a boolean too (the negation of a proven boolean)\n if (node.kind === SyntaxKind.PrefixUnaryExpression) {\n return node.operator === SyntaxKind.ExclamationToken && this.javaPreciseBooleanCall(node.operand);\n }\n if (node.kind !== SyntaxKind.CallExpression\n || node.expression.kind !== SyntaxKind.PropertyAccessExpression\n || node.expression.expression.kind !== SyntaxKind.Identifier\n || node.expression.expression.text !== 'Precise'\n || !JAVA_PRECISE_BOOLEAN_STATICS.has(node.expression.name.text)) {\n return false;\n }\n const declaration: any = this.getChecker().getResolvedSignature(node)?.declaration?.resolve();\n if (declaration === undefined\n || declaration.kind !== SyntaxKind.MethodDeclaration\n || declaration.parent?.kind !== SyntaxKind.ClassDeclaration\n || declaration.parent.name?.text !== 'Precise'\n || !declaration.modifiers?.some((modifier) => modifier.kind === SyntaxKind.StaticKeyword)) {\n return false;\n }\n // the relational statics answer a plain boolean (never null), which is what\n // Helpers.isTrue(Boolean) returns unchanged; a union (boolean | undefined) keeps the helper\n return (this.getChecker().getTypeAtLocation(node).flags & TypeFlags.Boolean) !== 0;\n }\n\n // the checker's view of a condition value: BooleanLike is the plain `boolean` (the `boolean |\n // undefined` of an accessor with a default is BooleanLiteral + Undefined and does not qualify),\n // while a union whose every member is boolean/nullish is the nullable box.\n javaBooleanValueKind(node): 'boolean' | 'nullableBoolean' | undefined {\n const type = this.getChecker().getTypeAtLocation(node);\n const flags = type?.flags ?? 0;\n if (flags & TypeFlags.BooleanLike) {\n return 'boolean';\n }\n if ((flags & TypeFlags.Union) === 0) {\n return undefined;\n }\n const members = (type as any).getTypes?.() ?? [];\n const booleanishMembers = TypeFlags.BooleanLike | TypeFlags.Null\n | TypeFlags.Undefined | TypeFlags.Void;\n const allBooleanish = members.length > 0\n && members.every((member) => (((member as any).flags ?? 0) & booleanishMembers) !== 0);\n return allBooleanish ? 'nullableBoolean' : undefined;\n }\n\n // mirrors printWrappedUnknownThisProperty: a `this.(...)` call the checker cannot\n // resolve prints `Helpers.callDynamically(this, \"\", ...)`, whose Java return is Object\n javaCalleeResolves(node): boolean {\n const checker: any = this.checkerOrUndefined();\n if (checker === undefined) {\n return false;\n }\n const signature = checker.getResolvedSignature(node);\n return signature?.declaration !== undefined;\n }\n\n // the boolean the printed Java of a `this.(...)` call already carries, from the\n // hand-written base declarations in JAVA_THIS_BOOLEAN_METHODS / the box proof in\n // JAVA_THIS_BOOLEAN_BOX_METHODS. undefined: not a direct boolean call, keep the wrapper.\n javaCallBooleanKind(node): 'boolean' | 'nullableBoolean' | undefined {\n if (node?.kind !== SyntaxKind.CallExpression) {\n return undefined;\n }\n const callee = node.expression;\n if (callee?.kind !== SyntaxKind.PropertyAccessExpression\n || callee.expression?.kind !== SyntaxKind.ThisKeyword) {\n return undefined;\n }\n const kind = this.javaBooleanValueKind(node);\n if (kind === undefined || !this.javaCalleeResolves(node)) {\n return undefined;\n }\n const name = callee.name?.text as string;\n if (JAVA_THIS_BOOLEAN_METHODS.has(name)) {\n // the hand-written declaration is the only source of the primitive return: a\n // non-base `this.(...)` is a different method, printed `Object`\n return kind === 'boolean' ? 'boolean' : undefined;\n }\n const defaultArgumentIndex = JAVA_THIS_BOOLEAN_BOX_METHODS[name];\n if (defaultArgumentIndex === undefined) {\n return undefined;\n }\n const defaultArgument = node.arguments?.[defaultArgumentIndex];\n // a nullish literal reaches the Java accessor as null (the printer drops a trailing\n // `undefined` in the optional tail), and null is what an absent argument yields\n const defaultIsNullish = defaultArgument === undefined\n || defaultArgument.kind === SyntaxKind.NullKeyword\n || (defaultArgument.kind === SyntaxKind.Identifier && defaultArgument.text === 'undefined');\n const defaultIsBoolean = defaultIsNullish\n || defaultArgument?.kind === SyntaxKind.TrueKeyword\n || defaultArgument?.kind === SyntaxKind.FalseKeyword;\n return defaultIsBoolean ? 'nullableBoolean' : undefined;\n }\n\n // the printer already emits these conditions as Java `boolean` (the comparison helpers,\n // `in`/`instanceof` and the logical operators all return/print primitive boolean), so\n // Helpers.isTrue would only re-test a value the checker proves is boolean\n javaConditionPrintsBoolean(node) {\n let inner = node;\n while (inner.kind === SyntaxKind.ParenthesizedExpression) {\n inner = inner.expression;\n }\n if (inner.kind === SyntaxKind.PrefixUnaryExpression && inner.operator === SyntaxKind.ExclamationToken) {\n return true; // printPrefixUnaryExpression prints `!` + printCondition(operand): a primitive boolean\n }\n if (this.javaBooleanCondition(node)) {\n // TS models `boolean` as the true|false union: the Boolean bit is set on plain\n // boolean and cleared on `boolean | undefined`-style unions, which keep the helper\n return (this.getChecker().getTypeAtLocation(node).flags & TypeFlags.Boolean) !== 0;\n }\n return this.javaPreciseBooleanCall(node);\n }\n\n // the checker proves this expression's TypeScript type is exactly `boolean` (or a boolean\n // literal type): no `any`, no `undefined`/`null` union, no nullable alias\n javaBooleanBoxType(type: any): boolean {\n if (type === undefined) {\n return false;\n }\n if (type.getAliasSymbol?.() !== undefined) {\n return false;\n }\n const flags = type.flags ?? 0;\n if ((flags & JAVA_BOOLEAN_EXCLUDED_TYPE_FLAGS) !== 0) {\n return false;\n }\n return (flags & (TypeFlags.Boolean | TypeFlags.BooleanLiteral)) !== 0;\n }\n\n javaTypeOfNode(node): any {\n return this.checkerOrUndefined()?.getTypeAtLocation(node);\n }\n\n // the DECLARED type of a declaration, not the narrowed type at a use site: TypeScript\n // narrows a `const ok: boolean = true` to the literal `true` and can even reach `never`\n // after a guarding `if (ok) return;`, which says nothing about the box the local holds\n javaTypeOfDeclaration(decl): any {\n if (decl === undefined) {\n return undefined;\n }\n return this.checkerOrUndefined()?.getTypeAtLocation(decl);\n }\n\n // the printed Java of this expression is a primitive `boolean` (or Boolean box): boolean literals,\n // `!`, logical / comparison / `in` operators, `Array.isArray(x)` (Helpers.isArray, `public static\n // boolean`) and hand-written `public boolean` base methods. `seen` breaks `a = b; b = a;` cycles.\n javaPrintsBooleanValue(node, seen: Set, depth = 0): boolean {\n if (node === undefined) {\n return false;\n }\n switch (node.kind) {\n case SyntaxKind.TrueKeyword:\n case SyntaxKind.FalseKeyword:\n return true;\n case SyntaxKind.ParenthesizedExpression:\n case SyntaxKind.AsExpression:\n case SyntaxKind.NonNullExpression:\n return this.javaPrintsBooleanValue(node.expression, seen, depth);\n case SyntaxKind.PrefixUnaryExpression:\n return node.operator === SyntaxKind.ExclamationToken && this.javaPrintsBooleanValue(node.operand, seen, depth);\n case SyntaxKind.BinaryExpression:\n // the comparison and logical operators all print a Java primitive boolean (the\n // helpers they lower to are declared `public static boolean`), whatever the operands\n return JAVA_BOOLEAN_OPERATOR_KINDS.has(node.operatorToken.kind);\n case SyntaxKind.CallExpression:\n return this.javaPrintsBooleanCall(node, seen, depth);\n case SyntaxKind.ConditionalExpression:\n // both branches print a Java boolean value, so the whole `cond ? a : b` does:\n // the printed ternary yields a boolean (or its Boolean box once assigned)\n return this.javaPrintsBooleanValue(node.whenTrue, seen, depth)\n && this.javaPrintsBooleanValue(node.whenFalse, seen, depth);\n case SyntaxKind.PropertyAccessExpression:\n return this.javaBooleanBaseField(node) !== undefined;\n case SyntaxKind.Identifier:\n return this.javaBooleanBoxIdentifier(node, seen) !== undefined;\n }\n return false;\n }\n\n // the Java box of a `this.(...)` call whose generated body returns a boolean on every path:\n // the TS return type is a boolean family and every `return` in the resolved declaration prints a\n // Java boolean or a proven Boolean-or-null box. `depth` and `seen` bound the recursion.\n javaCallReturnsBooleanBox(node, seen: Set, depth: number): boolean {\n if (node?.kind !== SyntaxKind.CallExpression || depth > 2) {\n return false;\n }\n const checker: any = this.checkerOrUndefined();\n if (checker === undefined) {\n return false;\n }\n const declaration = checker.getResolvedSignature(node)?.declaration?.resolve();\n if (declaration === undefined || declaration.kind !== SyntaxKind.MethodDeclaration\n || declaration.body === undefined || seen.has(declaration)) {\n return false;\n }\n if (this.javaBooleanValueKind(node) === undefined) {\n return false; // the call's TS type is not a boolean family (any/undefined-able)\n }\n const callee = node.expression;\n if (!isPropertyAccessExpression(callee) || callee.expression.kind !== SyntaxKind.ThisKeyword) {\n return false; // only a method of this class; a foreign class is not under the printer\n }\n const name = String(callee.name.text);\n if (JAVA_THIS_BOOLEAN_METHODS.has(name) || JAVA_THIS_BOOLEAN_BOX_METHODS[name] !== undefined) {\n return false; // the hand-written base tables are authoritative for these accessors\n }\n const next = new Set(seen);\n next.add(declaration);\n let returns = 0;\n let ok = true;\n const scan = (current: Node) => {\n if (!ok) {\n return;\n }\n if (current !== declaration && isFunctionLike(current)) {\n return; // a nested function's returns are not the method's\n }\n if (isReturnStatement(current)) {\n returns++;\n const expression = current.expression;\n if (expression === undefined || !this.javaPrintsBooleanValue(expression, next, depth + 1)) {\n ok = false;\n return;\n }\n }\n current.forEachChild(scan);\n };\n scan(declaration.body);\n return ok && returns > 0;\n }\n\n // `Array.isArray(x)` prints `Helpers.isArray(x)` (`public static boolean`), the relational\n // Precise statics print `public static boolean` and the hand-written `public boolean` base\n // methods print a primitive boolean. Everything else - including the generated\n javaPrintsBooleanCall(node, seen: Set = new Set(), depth = 0): boolean {\n if (this.isArrayIsArrayCall(node)) {\n return true;\n }\n if (this.javaPreciseBooleanCall(node)) {\n return true;\n }\n if (this.javaStringAffixCall(node)) {\n return true;\n }\n const callee = node.expression;\n if (isPropertyAccessExpression(callee) && callee.expression.kind === SyntaxKind.ThisKeyword\n && JAVA_BOOLEAN_BASE_CALLS.has(String(callee.name.text))) {\n return true;\n }\n return this.javaCallReturnsBooleanBox(node, seen, depth);\n }\n\n // `s.startsWith(x)` / `s.endsWith(x)` on a checker-proven string receiver prints\n // `((String)s).startsWith(..)`, a primitive boolean (String.startsWith/endsWith)\n javaStringAffixCall(node): boolean {\n if (node?.kind !== SyntaxKind.CallExpression || (node.arguments?.length ?? 0) !== 1) {\n return false;\n }\n const callee: any = node.expression;\n if (!isPropertyAccessExpression(callee)) {\n return false;\n }\n const name = String(callee.name.text);\n if (name !== 'startsWith' && name !== 'endsWith') {\n return false;\n }\n const type = this.javaTypeOfNode(callee.expression);\n if (type === undefined || !this.isStringType(type.flags)) {\n return false;\n }\n return /^\\(\\(String\\)[\\s\\S]*\\.(startsWith|endsWith)\\([\\s\\S]*\\)$/.test(this.printNode(node, 0));\n }\n\n isArrayIsArrayCall(node): boolean {\n if (node === undefined || node.kind !== SyntaxKind.CallExpression) {\n return false;\n }\n const callee: any = node.expression;\n return isPropertyAccessExpression(callee)\n && String(callee.name.text) === 'isArray'\n && callee.expression.kind === SyntaxKind.Identifier\n && String((callee.expression as any).text) === 'Array'\n && (node.arguments?.length ?? 0) === 1;\n }\n\n // `this.` read of a hand-written base field declared `boolean`, or undefined. The\n // TsChecker guard keeps a field the hand-written base declares Object (or String) out.\n javaBooleanBaseField(node): string | undefined {\n if (!isPropertyAccessExpression(node) || node.expression.kind !== SyntaxKind.ThisKeyword) {\n return undefined;\n }\n const printed = this.printNode(node, 0);\n if (!JAVA_BOOLEAN_BASE_FIELDS.has(printed)) {\n return undefined;\n }\n const declaration = (this.checkerOrUndefined() as any).getSymbolAtLocation(node.name)?.valueDeclaration?.resolve();\n const type = this.javaTypeOfDeclaration(declaration) ?? this.javaTypeOfNode(node);\n return this.javaBooleanBoxType(type) ? printed : undefined;\n }\n\n // the Java name of an identifier that provably holds a Boolean box or null, so `Helpers.isTrue(x)`\n // IS `Boolean.TRUE.equals(x)`. Proof: the TS type (`boolean`, never `any`/`undefined`-able) plus\n // the D2 write scan: every write in the enclosing function must print a Java boolean value.\n javaBooleanBoxIdentifier(node, seen: Set): string | undefined {\n if (node?.kind !== SyntaxKind.Identifier || seen.has(node)) {\n return undefined;\n }\n const checker: any = this.checkerOrUndefined();\n if (checker === undefined) {\n return undefined;\n }\n const symbol = checker.getSymbolAtLocation(node);\n const decl = symbol?.valueDeclaration?.resolve();\n if (decl === undefined) {\n return undefined;\n }\n // only a local with its own initializer: a parameter (and the `optionalArgs[n]` prologue for an\n // optional one) is an `Object` box its CALLERS fill, so it is not proven boolean; a binding\n // element (`for (const b of ...)`, destructuring) is fed by the container, not a typed value.\n if (decl.kind !== SyntaxKind.VariableDeclaration) {\n return undefined;\n }\n let type;\n try {\n type = this.javaTypeOfDeclaration(decl);\n } catch (e) {\n type = undefined;\n }\n if (!this.javaBooleanBoxType(type)) {\n return undefined;\n }\n if (!this.javaBooleanWritesAreBoxed(symbol, decl, node, seen)) {\n return undefined;\n }\n return this.printNode(node, 0);\n }\n\n // every value written to the symbol prints a Java boolean. The scan runs over the function\n // the DECLARATION lives in (a local can only be written inside it or inside a closure nested\n // in it), so a write in an enclosing scope is never missed.\n javaBooleanWritesAreBoxed(symbol, decl, node, seen: Set): boolean {\n const next = new Set(seen);\n next.add(node);\n return this.javaWritesAreBoxed(symbol, decl, next, (value) => this.javaPrintsBooleanValue(value, next), false);\n }\n\n // shared D2 write scan over the function the declaration lives in: the initializer and every\n // identifier write must pass `accepts`; `tuples` also checks `[ x, params ] = ...` destructures\n javaWritesAreBoxed(symbol, decl, next: Set, accepts: (value: any) => boolean, tuples: boolean): boolean {\n let fn = decl.parent;\n while (fn !== undefined && !isFunctionLike(fn)) {\n fn = fn.parent;\n }\n if (fn === undefined) {\n return false;\n }\n if (decl.initializer !== undefined && !accepts(decl.initializer)) {\n return false;\n }\n let ok = true;\n const scan = (current: Node) => {\n if (!ok) {\n return;\n }\n if ((isForOfStatement(current) || isForInStatement(current))\n && isIdentifier(current.initializer)) {\n // `for (x of list)` re-fills the box from the container\n const loop = (this.checkerOrUndefined() as any).getSymbolAtLocation(current.initializer);\n if (loop === symbol) {\n ok = false;\n return;\n }\n }\n if (isBinaryExpression(current)\n && JAVA_ASSIGNMENT_OPERATOR_KINDS.has(current.operatorToken.kind)) {\n if (isIdentifier(current.left)) {\n const left = (this.checkerOrUndefined() as any).getSymbolAtLocation(current.left);\n if (left === symbol && !accepts(current.right)) {\n ok = false;\n return;\n }\n } else if (tuples && isArrayLiteralExpression(current.left)) {\n // `[ x, params ] = this.handle*Bool (...)` binds element `index`\n const index = current.left.elements.findIndex((element: any) => isIdentifier(element)\n && (this.checkerOrUndefined() as any).getSymbolAtLocation(element) === symbol);\n if (index !== -1 && !this.javaBooleanBoxTupleElement(current.right, index)) {\n ok = false;\n return;\n }\n }\n }\n current.forEachChild(scan);\n };\n scan(fn);\n return ok;\n }\n\n // the declared Java type the ccxt-side declaration chain gave this local/param, via the\n // javaDeclaredLocalTypeResolver hook (build/java-local-types.js): `boolean` prints as the\n // primitive, so the identifier IS the condition; `Boolean` is the nullable box (isTrue = equals).\n javaDeclaredBooleanKind(node): 'boolean' | 'Boolean' | undefined {\n const declaration = this.javaDeclarationOfIdentifier(node);\n if (declaration === undefined || node.text !== declaration.name?.text) {\n return undefined; // a capture rename prints `final Object finalX = x`\n }\n let declared;\n try {\n declared = this.javaDeclaredTypeOfDeclaration(declaration);\n } catch (e) {\n return undefined;\n }\n return declared === 'boolean' || declared === 'Boolean' ? declared : undefined;\n }\n\n // the DECLARED type of the local is a nullable boolean: `Bool` (`boolean | undefined`) or an\n // equivalent union. Every member must be boolean or nullish - an `Int`/`Str`/`any` member can\n // hold a box the isTrue helper tests with its runtime truthiness, so the helper must stay.\n javaNullableBooleanDeclaration(declaration): boolean {\n if (declaration?.kind !== SyntaxKind.VariableDeclaration) {\n return false;\n }\n const type = this.javaTypeOfDeclaration(declaration);\n if (type === undefined) {\n return false;\n }\n const flags: number = type.flags ?? 0;\n if ((flags & (TypeFlags.Any | TypeFlags.Unknown)) !== 0) {\n return false;\n }\n if ((flags & TypeFlags.Boolean) !== 0) {\n return false; // the plain `boolean` is the strict box family's own proof\n }\n if ((flags & TypeFlags.Union) === 0) {\n return false;\n }\n const members: any[] = (type as any).getTypes?.() ?? [];\n if (members.length === 0) {\n return false;\n }\n const booleanish = (member: any) => (((member?.flags ?? 0) & JAVA_NULLABLE_BOOLEAN_MEMBER_FLAGS) !== 0);\n const hasBoolean = members.some((member: any) => (((member?.flags ?? 0) & (TypeFlags.Boolean | TypeFlags.BooleanLiteral)) !== 0));\n return hasBoolean && members.every(booleanish);\n }\n\n // a value the nullable-boolean write scan accepts: a Java boolean value this printer proves, a\n // nullish literal, or a safeBool-family accessor whose other paths return the caller's default\n // (Boolean or null). A Long/Int/String/List box would change what isTrue answers.\n javaPrintsBooleanBoxValue(node, seen: Set): boolean {\n if (node === undefined) {\n return false;\n }\n if (node.kind === SyntaxKind.ParenthesizedExpression || node.kind === SyntaxKind.AsExpression\n || node.kind === SyntaxKind.NonNullExpression) {\n return this.javaPrintsBooleanBoxValue(node.expression, seen);\n }\n if (node.kind === SyntaxKind.NullKeyword) {\n return true;\n }\n if (node.kind === SyntaxKind.Identifier && node.text === 'undefined') {\n return true; // prints null\n }\n if (this.javaPrintsBooleanValue(node, seen)) {\n return true;\n }\n if (node.kind === SyntaxKind.Identifier && this.javaNullableBooleanBoxIdentifier(node, seen) !== undefined) {\n return true; // a local whose declared type is the nullable boolean and every write boxes\n }\n if (node.kind === SyntaxKind.Identifier && this.javaBooleanTupleBindingIdentifier(node, seen) !== undefined) {\n return true;\n }\n if (node.kind === SyntaxKind.CallExpression) {\n return this.javaCallBooleanKind(node) !== undefined;\n }\n return false;\n }\n\n // element `index` of a `[ x, params ] = this.handle*Bool (...)` destructure is a Boolean-or-null\n // box: those accessors return a safeBool result, never the raw member when not a Boolean. The\n // handleOptionAndParams family returns the raw member and is deliberately not a box proof.\n javaBooleanBoxTupleElement(node, index: number): boolean {\n if (node?.kind !== SyntaxKind.CallExpression) {\n return false;\n }\n const callee = node.expression;\n if (!isPropertyAccessExpression(callee) || callee.expression.kind !== SyntaxKind.ThisKeyword) {\n return false;\n }\n const name = String(callee.name.text);\n if (!JAVA_BOOLEAN_BOX_TUPLE_METHODS.has(name)) {\n return false;\n }\n const declaration: any = this.getChecker().getResolvedSignature(node)?.declaration?.resolve();\n if (declaration?.name?.text !== name) {\n return false; // a same-named override is not the base accessor\n }\n return index === 0;\n }\n\n // `const [ x, p ] = this.handle*Bool (...)` binds x to element 0, a Boolean-or-null box; any\n // later identifier or tuple write must also be a proven box (the D2 scan over the function)\n javaBooleanTupleBindingIdentifier(node, seen: Set = new Set()): string | undefined {\n if (node?.kind !== SyntaxKind.Identifier) {\n return undefined;\n }\n const checker: any = this.checkerOrUndefined();\n if (checker === undefined) {\n return undefined;\n }\n const symbol = checker.getSymbolAtLocation(node);\n const element = symbol?.valueDeclaration?.resolve();\n if (element === undefined || element.kind !== SyntaxKind.BindingElement || element.initializer !== undefined\n || element.dotDotDotToken !== undefined || element.name?.text !== node.text || seen.has(element)) {\n return undefined;\n }\n const pattern = element.parent;\n const declaration = pattern?.parent;\n if (pattern?.kind !== SyntaxKind.ArrayBindingPattern || declaration?.kind !== SyntaxKind.VariableDeclaration\n || !this.javaBooleanBoxTupleElement(declaration.initializer, pattern.elements.indexOf(element))) {\n return undefined;\n }\n const next = new Set(seen);\n next.add(element);\n const binding = { initializer: undefined, parent: declaration };\n if (!this.javaWritesAreBoxed(symbol, binding, next, (value) => this.javaPrintsBooleanBoxValue(value, next), true)) {\n return undefined;\n }\n return this.printNode(node, 0);\n }\n\n // the D2 scan over a nullable boolean local: every write prints a Java boolean value or a\n // proven Boolean-or-null box, so no path can leave a truthy non-boolean box in it\n javaBooleanNullableWritesAreBoxed(symbol, declaration, node, seen: Set): boolean {\n const next = new Set(seen);\n next.add(node);\n next.add(declaration); // a write scan that reaches this declaration again stops\n return this.javaWritesAreBoxed(symbol, declaration, next, (value) => this.javaPrintsBooleanBoxValue(value, next), true);\n }\n\n // `Helpers.isTrue(x)` where the DECLARED type of x is a nullable boolean and every write is a\n // proven Boolean-or-null box: `Boolean.TRUE.equals(x)` is exactly what the helper answers on\n // such a box (null and FALSE test false, TRUE tests true)\n javaNullableBooleanBoxIdentifier(node, seen: Set = new Set()): string | undefined {\n if (node?.kind !== SyntaxKind.Identifier) {\n return undefined;\n }\n const checker: any = this.checkerOrUndefined();\n if (checker === undefined) {\n return undefined;\n }\n const symbol = checker.getSymbolAtLocation(node);\n const declaration = symbol?.valueDeclaration?.resolve();\n if (declaration === undefined || declaration.name?.text !== node.text) {\n return undefined;\n }\n if (seen.has(declaration)) {\n return undefined; // a write graph that reaches this declaration again keeps the helper\n }\n if (!this.javaNullableBooleanDeclaration(declaration)) {\n return undefined;\n }\n if (!this.javaBooleanNullableWritesAreBoxed(symbol, declaration, node, seen)) {\n return undefined;\n }\n return this.printNode(node, 0);\n }\n\n // the native Java a falsy wrapper around this condition prints, or undefined to keep\n // `Helpers.isTrue(...)`: a hand-written boolean field prints bare; `Array.isArray(x)` prints\n // `Helpers.isArray(x)` (null -> false like helper); a proven Boolean box: `Boolean.TRUE.equals(x)`\n javaBooleanWrapperFreeCondition(node): string | undefined {\n if (node === undefined) {\n return undefined;\n }\n if (node.kind === SyntaxKind.ParenthesizedExpression) {\n return this.javaBooleanWrapperFreeCondition(node.expression);\n }\n if (this.isArrayIsArrayCall(node)) {\n return `(${this.printNode(node.arguments[0], 0)} instanceof java.util.List)`;\n }\n if (this.javaStringAffixCall(node)) {\n return this.printNode(node, 0);\n }\n const field = this.javaBooleanBaseField(node);\n if (field !== undefined) {\n return field;\n }\n // a `this.(...)` call whose generated body returns a boolean value on every path\n // prints a Boolean box; the bare declarations in JAVA_THIS_BOOLEAN_METHODS are printed\n // native by printCondition and are left to it\n if (node.kind === SyntaxKind.CallExpression && this.javaCallBooleanKind(node) === undefined\n && this.javaCallReturnsBooleanBox(node, new Set(), 0)) {\n return `Boolean.TRUE.equals(${this.printNode(node, 0)})`;\n }\n if (node.kind === SyntaxKind.Identifier) {\n // the ccxt-side declaration chain types a local/param `boolean`/`Boolean` inside\n // javaDeclaredLocalTypeResolver: a primitive declaration IS the condition, a box\n // needs the null-safe TRUE test the helper performs\n const declared = this.javaDeclaredBooleanKind(node);\n if (declared === 'boolean') {\n return this.printNode(node, 0);\n }\n if (declared === 'Boolean') {\n return `Boolean.TRUE.equals(${this.printNode(node, 0)})`;\n }\n }\n const box = this.javaBooleanBoxIdentifier(node, new Set()) ?? this.javaNullableBooleanBoxIdentifier(node)\n ?? this.javaBooleanTupleBindingIdentifier(node);\n return box === undefined ? undefined : `Boolean.TRUE.equals(${box})`;\n }\n\n printCondition(node, identation) {\n if (this.javaConditionPrintsBoolean(node)) {\n return this.getIden(identation) + this.printNode(node, 0);\n }\n let bareCall = node;\n while (bareCall.kind === SyntaxKind.ParenthesizedExpression) {\n bareCall = bareCall.expression;\n }\n if (bareCall.kind === SyntaxKind.CallExpression && this.javaCallPrintsNonNullBoolean(bareCall, 0)) {\n return this.getIden(identation) + this.printNode(node, 0); // a never-null Boolean unboxes safely\n }\n const wrapperFree = this.javaBooleanWrapperFreeCondition(node);\n if (wrapperFree !== undefined) {\n return this.getIden(identation) + wrapperFree;\n }\n const callKind = this.javaCallBooleanKind(bareCall);\n if (callKind === 'boolean') {\n return this.getIden(identation) + this.printNode(node, 0);\n }\n if (callKind === 'nullableBoolean') {\n // Helpers.isTrue(box) on a Boolean-or-null box is Boolean.TRUE.equals(box): null\n // and FALSE test false, TRUE tests true\n return this.getIden(identation) + `Boolean.TRUE.equals(${this.printNode(node, 0)})`;\n }\n return super.printCondition(node, identation);\n }\n\n printConditionalExpression(node, _identation) {\n const condition = this.printCondition(node.condition, 0);\n const whenTrue = this.printNode(node.whenTrue, 0);\n const whenFalse = this.printNode(node.whenFalse, 0);\n return `((${condition})) ? ${whenTrue} : ${whenFalse}`;\n }\n\n printDeleteExpression(node, _identation) {\n const object = this.printNode(node.expression.expression, 0);\n const key = this.printNode(node.expression.argumentExpression, 0);\n return `((java.util.Map)${object}).remove((String)${key})`;\n }\n\n printThrowStatement(node, identation) {\n if (node.expression.kind === SyntaxKind.Identifier) {\n // a bare rethrow (`throw e`) of a caught java.lang.Exception is a checked\n // exception, which the surrounding async lambdas cannot declare - keep\n // unchecked exceptions (ccxt errors extend RuntimeException) as-is and\n // wrap checked ones, preserving the original as the cause\n const name = this.printNode(node.expression, 0);\n return (\n this.getIden(identation) +\n `${this.THROW_TOKEN} (${name} instanceof RuntimeException ? (RuntimeException)${name} : new RuntimeException(${name}))${this.LINE_TERMINATOR}`\n );\n }\n if (node.expression.kind === SyntaxKind.NewExpression) {\n const expression = node.expression;\n const argumentsExp = expression?.arguments ?? [];\n const parsedArg = argumentsExp.map((n) => this.printNode(n, 0)).join(\",\") ?? \"\";\n const newExpression = this.printNode(expression.expression, 0);\n if (expression.expression.kind === SyntaxKind.Identifier) {\n const id = expression.expression;\n // java.lang.Error is a sibling of Exception under Throwable, so\n // `catch (Exception e)` won't catch it. Map JS/TS `Error` to\n // RuntimeException so standard catch blocks work.\n const exceptionName = id.text === \"Error\" ? \"RuntimeException\" : id.text;\n const symbol = this.getChecker().getSymbolAtLocation(expression.expression);\n if (symbol) {\n const declarations =\n (this.getChecker().getDeclaredTypeOfSymbol(symbol).getSymbol()?.declarations ?? []).map((d) => d.resolve());\n const isClassDeclaration = declarations.find(\n (l) =>\n l.kind === SyntaxKind.InterfaceDeclaration ||\n l.kind === SyntaxKind.ClassDeclaration\n );\n if (isClassDeclaration) {\n return (\n this.getIden(identation) +\n `${this.THROW_TOKEN} ${this.NEW_TOKEN} ${exceptionName}((String)${parsedArg}) ${this.LINE_TERMINATOR}`\n );\n } else {\n return (\n this.getIden(identation) +\n `Helpers.throwDynamicException(${exceptionName}, ${parsedArg});return null;`\n );\n }\n }\n return (\n this.getIden(identation) +\n `${this.THROW_TOKEN} ${this.NEW_TOKEN} ${exceptionName}(${parsedArg}) ${this.LINE_TERMINATOR}`\n );\n } else if (expression.expression.kind === SyntaxKind.ElementAccessExpression) {\n return this.getIden(identation) + `Helpers.throwDynamicException(${newExpression}, ${parsedArg});`;\n }\n return super.printThrowStatement(node, identation);\n }\n }\n\n csModifiers = {};\n\n printPropertyAccessModifiers(node) {\n let modifiers = this.printModifiers(node);\n if (modifiers === \"\") {\n modifiers = this.defaultPropertyAccess;\n }\n // add type\n let typeText = \"Object\";\n if (node.type) {\n typeText = this.getType(node);\n if (!typeText) {\n if (node.type.kind === SyntaxKind.AnyKeyword) {\n typeText = this.OBJECT_KEYWORD + \" \";\n }\n }\n }\n return modifiers + \" \" + typeText + \" \";\n }\n\n printModifiers(node) {\n let modifiers = node.modifiers;\n if (modifiers === undefined) {\n return \"\";\n }\n modifiers = modifiers.filter(mod => this.FuncModifiers[mod.kind] && mod.kind !== SyntaxKind.AsyncKeyword);\n return modifiers.map(modifier => this.FuncModifiers[modifier.kind]).join(\" \");\n }\n\n // literals printed as `Helpers.newMap(k, v, ...)` (no anonymous class, so no capture rule)\n builderObjectLiterals: WeakSet = new WeakSet();\n\n printObjectLiteralExpression(node, identation) {\n if (node.properties.length > 0 && node.properties.every((p) => isPropertyAssignment(p)) &&\n this.objectLiteralCapturesReassigned(node)) {\n this.builderObjectLiterals.add(node);\n return this.printObjectLiteralBuilder(node, identation);\n }\n this.builderObjectLiterals.delete(node);\n const objectBody = this.printObjectLiteralBody(node, identation);\n const formattedObjectBody = objectBody ? \"\\n\" + objectBody + \"\\n\" + this.getIden(identation) : objectBody;\n return this.OBJECT_OPENING + formattedObjectBody + this.OBJECT_CLOSING;\n }\n\n printObjectLiteralBuilder(node, identation) {\n // a comparison inside the values must not mark a captured local as reassigned\n // (that flag drives the async-parameter copies and the typed-parameter write casts)\n const keys = this.objectLiteralCapturedKeys(node);\n const saved = keys.map((key) => this.ReassignedVars[key]);\n try {\n return this.printObjectLiteralBuilderText(node, identation);\n } finally {\n keys.forEach((key, i) => {\n if (saved[i] === undefined) {\n delete this.ReassignedVars[key];\n } else {\n this.ReassignedVars[key] = saved[i];\n }\n });\n }\n }\n\n printObjectLiteralBuilderText(node, identation) {\n const props = node.properties;\n const lines = props.map((prop, i) => {\n const name = this.printNode(prop.name, 0);\n const custom = this.printCustomRightSidePropertyAssignment(prop.initializer, identation + 1);\n const value = (custom ? custom : this.printNode(prop.initializer, identation + 1)).trim();\n let comment = this.printTraillingComment(prop, identation + 1);\n comment = comment ? \" \" + comment : \"\";\n const sep = i < props.length - 1 ? \",\" : \"\";\n return this.getIden(identation + 1) + name + \", \" + value + sep + comment;\n });\n return \"Helpers.newMap(\\n\" + lines.join(\"\\n\") + \"\\n\" + this.getIden(identation) + \")\";\n }\n\n printObjectLiteralBody(node, identation) {\n const body = node.properties.map((p) => this.printNode(p, identation+1)).join(\"\\n\");\n // body = body.replaceAll('this.', `${name}.this.`);\n return body;\n }\n\n printForStatement(node, identation) {\n const initializer = this.printNode(node.initializer, 0).replace('Object ', 'var ');\n const condition = this.printNode(node.condition, 0);\n const incrementor = this.printNode(node.incrementor, 0);\n\n const forStm = this.getIden(identation) +\n this.FOR_TOKEN + \" \" +\n this.CONDITION_OPENING +\n initializer + \"; \" + condition + \"; \" + incrementor +\n this.CONDITION_CLOSE +\n this.printBlock(node.statement, identation);\n return this.printNodeCommentsIfAny(node, identation, forStm);\n }\n\n printReturnStatement(node, identation) {\n const leadingComment = this.printLeadingComments(node, identation);\n let trailingComment = this.printTraillingComment(node, identation);\n trailingComment = trailingComment ? \" \" + trailingComment : trailingComment;\n let exp = node.expression;\n if (exp && exp.kind === SyntaxKind.AsExpression && (exp.expression.kind === SyntaxKind.ObjectLiteralExpression || SyntaxKind.CallExpression)) {\n exp = exp.expression; // go over something like return {} as SomeType\n }\n let rightPart = exp ? (' ' + this.printNode(exp, identation)) : '';\n rightPart = rightPart.trim();\n if (!rightPart) {\n // bare return; — check if inside async method (supplyAsync lambda needs return null)\n let parent = node.parent;\n while (parent) {\n if (isFunctionDeclaration(parent) || isMethodDeclaration(parent) || isFunctionExpression(parent) || isArrowFunction(parent)) {\n if (this.isAsyncFunction(parent)) {\n rightPart = 'null';\n }\n break;\n }\n parent = parent.parent;\n }\n }\n rightPart = rightPart ? ' ' + rightPart + this.LINE_TERMINATOR : this.LINE_TERMINATOR;\n return leadingComment + this.getIden(identation) + this.RETURN_TOKEN + rightPart + trailingComment;\n }\n\n private allBranchesTerminate(node: Node): boolean {\n if (isReturnStatement(node) || isThrowStatement(node)) {\n return true;\n }\n if (isBlock(node)) {\n const stmts = node.statements;\n return stmts.length > 0 && this.allBranchesTerminate(stmts[stmts.length - 1]);\n }\n if (isIfStatement(node)) {\n if (!node.elseStatement) {\n return false; // no else: not all paths covered\n }\n return this.allBranchesTerminate(node.thenStatement) && this.allBranchesTerminate(node.elseStatement);\n }\n return false;\n }\n // hx4 J01: `m[k] = v` on a local the printer declared `Map` whose every write is a\n // provably non-concurrent map (fresh literal/extend/omit, or a base safeDict* of non-field data):\n // the helper's map branch is then `m.put(k, v)` (null value included; its CHM removal never applies)\n javaHx4MapPutIsNative(baseExpr, keys: any[]): boolean {\n if (keys.length !== 1 || baseExpr === undefined || !isIdentifier(baseExpr) || !this.javaDeclaredMapReceiver(baseExpr)) {\n return false;\n }\n const key = keys[0];\n if (!isStringLiteralLikeNode(key) && !this.javaDeclaredStringType(key)\n && !this.isJavaStringType(this.getChecker().getTypeAtLocation(key))) {\n return false; // Map.put needs a String key (the helper takes any box)\n }\n const declaration: any = this.javaDeclarationOfIdentifier(baseExpr);\n if (declaration === undefined || declaration.kind !== SyntaxKind.VariableDeclaration || !declaration.initializer) {\n return false; // parameters may carry a caller's ConcurrentHashMap\n }\n const admits = (rhs) => this.javaHx4PlainMapSource(baseExpr, rhs);\n return admits(declaration.initializer) && !this.javaLocalIsReassigned(baseExpr, admits);\n }\n\n javaHx4PlainMapSource(container, value): boolean {\n const node = this.unwrapPrintTransparentExpression(value);\n if (node === undefined) {\n return false;\n }\n if (this.javaFreshHashMapValue(container, node)) {\n return true;\n }\n if (!isCallExpression(node) || !isPropertyAccessExpression(node.expression)\n || node.expression.expression.kind !== SyntaxKind.ThisKeyword) {\n return false;\n }\n const name = node.expression.name.text;\n const fileName = this.checkerOrUndefined()?.getResolvedSignature(node)?.declaration?.resolve()?.getSourceFile?.()?.fileName;\n if (typeof fileName !== 'string' || !JAVA_FRESH_EXTEND_FILE.test(fileName)) {\n return false; // a venue override may return anything\n }\n if (name === 'extend' || name === 'deepExtend' || name === 'omit') {\n return true; // Generic.Extend / deepExtend / Functions.omitMap build a fresh LinkedHashMap (or null)\n }\n if (name === 'safeDict' || name === 'safeDict2' || name === 'safeDictN') {\n // hands back an element of the source or the default: never a field map or a ws client map\n return node.arguments.length > 0 && this.javaHx4NonSharedSource(node.arguments[0], 0)\n && (node.arguments.length < (name === 'safeDict2' ? 4 : 3)\n || this.javaHx4DefaultIsPlain(node.arguments[node.arguments.length - 1]));\n }\n return false;\n }\n\n javaHx4DefaultIsPlain(value): boolean {\n const node = this.unwrapPrintTransparentExpression(value);\n return node !== undefined && (isObjectLiteralExpression(node) || node.kind === SyntaxKind.UndefinedKeyword\n || (isIdentifier(node) && node.text === 'undefined') || node.kind === SyntaxKind.NullKeyword);\n }\n\n // data that can not hold one of the runtime's ConcurrentHashMaps (this. top level, ws client\n // futures/subscriptions/rejections and their entries): a local/param/element chain not rooted at them\n javaHx4NonSharedSource(value, depth: number): boolean {\n const node = this.unwrapPrintTransparentExpression(value);\n if (node === undefined || depth > 40) {\n return false;\n }\n if (isElementAccessExpression(node)) {\n return this.javaHx4NonSharedSource(node.expression, depth + 1);\n }\n if (!isIdentifier(node)) {\n return false;\n }\n const declaration: any = this.javaDeclarationOfIdentifier(node);\n if (declaration === undefined) {\n return false;\n }\n if (declaration.kind === SyntaxKind.Parameter) {\n const type = this.getChecker().getTypeAtLocation(node);\n const text = (type?.getSymbol?.()?.escapedName ?? '') + '';\n return !/Client/.test(text) && !/^(client|subscriptions|futures|rejections)$/.test(node.text);\n }\n const known = this.javaHx4SourceVerdicts.get(declaration);\n if (known !== undefined) {\n return known; // `true` while in progress: a self-referencing write adds no new source\n }\n this.javaHx4SourceVerdicts.set(declaration, true);\n this.javaHx4InProgress.add(declaration);\n const writes: any[] = declaration.initializer ? [declaration.initializer] : [];\n const verdict = !this.javaLocalIsReassigned(node, (rhs) => { writes.push(rhs); return true; })\n && writes.every((w) => this.javaHx4NonSharedValue(w, depth + 1));\n this.javaHx4InProgress.delete(declaration);\n if (verdict && this.javaHx4InProgress.size > 0) {\n this.javaHx4SourceVerdicts.delete(declaration); // leaned on an unfinished verdict: recompute later\n } else {\n this.javaHx4SourceVerdicts.set(declaration, verdict);\n }\n return verdict;\n }\n\n javaHx4SourceVerdicts = new WeakMap();\n javaHx4InProgress = new Set();\n\n // a value expression that never reads a field map or a ws client's maps\n javaHx4NonSharedValue(value, depth: number): boolean {\n let shared = false;\n const walk = (n) => {\n if (shared || n === undefined) {\n return;\n }\n if (isPropertyAccessExpression(n)) {\n const called = n.parent !== undefined && isCallExpression(n.parent) && n.parent.expression === n;\n if ((!called && (n.expression.kind === SyntaxKind.ThisKeyword\n || /^(subscriptions|futures|rejections|hashmap)$/.test(n.name.text)))\n || (called && n.name.text === 'createSafeDictionary')) {\n shared = true;\n return;\n }\n }\n if (n.kind === SyntaxKind.ThisKeyword && !(n.parent !== undefined && isPropertyAccessExpression(n.parent))) {\n shared = true; // `this` handed to a call\n return;\n }\n if (isIdentifier(n) && n !== value && !(n.parent !== undefined && isPropertyAccessExpression(n.parent) && n.parent.name === n)) {\n const declaration: any = this.javaDeclarationOfIdentifier(n);\n if (declaration !== undefined && !this.javaHx4NonSharedSource(n, depth + 1)) {\n shared = true;\n return;\n }\n }\n n.forEachChild(walk);\n };\n walk(value);\n return !shared;\n }\n\n // hx4 J02: `this.[k]` on the J02 base map fields. ConcurrentHashMap.get(null) throws\n // where the helper answers null, so a non-literal key is always null-tested; the receiver can\n // be null too. Key and receiver print twice, so both must be side-effect free.\n javaJ02FieldMapReadText(receiver, key): string | undefined {\n const name = receiver?.name?.text;\n if (typeof name !== 'string' || !Object.prototype.hasOwnProperty.call(JAVA_J02_MAP_FIELDS, name)) {\n return undefined;\n }\n const literal = isStringLiteralLikeNode(key);\n if (!literal && !this.javaRepeatableOperand(key)) {\n return undefined;\n }\n const target = this.printNode(receiver, 0);\n const keyText = this.printNode(key, 0);\n const keyGuard = literal ? '' : `${keyText} == null || `;\n return `(${keyGuard}${target} == null ? null : ((java.util.Map)${target}).get(${keyText}))`;\n }\n\n // hx4 J05\n // `(a % N) M` (N a non-zero integer literal, a an int/long operand, M an int literal): the\n // native mod prints a finite integral double |v| < |N|, where isEqual (IsInteger -> toLong) and\n // isGreaterThan (toDouble) both reduce to the plain double comparison against M.\n javaHx4J05IntegralModOperand(node): boolean {\n while (node !== undefined && node.kind === SyntaxKind.ParenthesizedExpression) {\n node = node.expression;\n }\n if (node === undefined || !isBinaryExpression(node) || node.operatorToken.kind !== SyntaxKind.PercentToken) {\n return false;\n }\n if (this.javaScalarFamily(node.left) !== 'number' || this.javaScalarFamily(node.right) !== 'number') {\n return false;\n }\n const leftKind = this.javaProvableNumericKind(node.left);\n if (leftKind !== 'int' && leftKind !== 'long' && !this.javaProvableCounterInt(node.left)) {\n return false;\n }\n const divisor = node.right;\n if (this.javaIntegerLiteralKind(divisor) !== 'int' || Number(divisor.text) === 0) {\n return false;\n }\n return true;\n }\n\n printHx4J05ModComparison(left, right, op): string | undefined {\n const javaOps = {\n [SyntaxKind.EqualsEqualsToken]: '==', [SyntaxKind.EqualsEqualsEqualsToken]: '==',\n [SyntaxKind.ExclamationEqualsToken]: '!=', [SyntaxKind.ExclamationEqualsEqualsToken]: '!=',\n [SyntaxKind.LessThanToken]: '<', [SyntaxKind.LessThanEqualsToken]: '<=',\n [SyntaxKind.GreaterThanToken]: '>', [SyntaxKind.GreaterThanEqualsToken]: '>=',\n };\n const javaOp = javaOps[op];\n if (javaOp === undefined) {\n return undefined;\n }\n const modLeft = this.javaHx4J05IntegralModOperand(left);\n const modRight = !modLeft && this.javaHx4J05IntegralModOperand(right);\n if (!modLeft && !modRight) {\n return undefined;\n }\n if (this.javaEqualityLiteralKind(modLeft ? right : left) !== 'int') {\n return undefined;\n }\n const leftText = this.printNode(left, 0);\n const rightText = this.printNode(right, 0);\n // only when the mod side printed the native double remainder\n if (!/^\\(+double\\) /.test(modLeft ? leftText : rightText)) {\n return undefined;\n }\n return `(${leftText} ${javaOp} ${rightText})`;\n }\n\n // hx4 J06\n // `x.indexOf(t)` where a string/Str-declared x is narrowed to a union of string literals\n // (`===` tests): x is a non-null String, so String.indexOf is the helper's String arm\n javaHx4J06NarrowedIndexOf(node, name, parsedArg) {\n const receiver = node?.expression?.expression;\n const arg = node?.arguments?.[0];\n if (receiver === undefined || arg === undefined || name === undefined || parsedArg === undefined\n || !isIdentifier(receiver) || this.isVarargsArrayReference(receiver)) {\n return undefined;\n }\n let receiverType: any;\n try {\n receiverType = this.getChecker().getTypeAtLocation(receiver);\n } catch (e) {\n return undefined;\n }\n if (receiverType === undefined || (receiverType.flags & TypeFlags.Union) === 0\n || !receiverType.getTypes().every((member) => this.isStringType(member.flags))) {\n return undefined;\n }\n // a DECLARED literal union is no runtime proof: the declaration must carry plain `string`\n const symbol = this.getChecker().getSymbolAtLocation(receiver);\n const declaration: any = symbol?.valueDeclaration?.resolve?.() ?? symbol?.valueDeclaration;\n let declared: any;\n try {\n declared = declaration?.name === undefined ? undefined : this.getChecker().getTypeAtLocation(declaration.name);\n } catch (e) {\n declared = undefined;\n }\n const declaredMembers: any[] = declared === undefined ? [] : ((declared.flags & TypeFlags.Union) !== 0 ? declared.getTypes() : [declared]);\n if (!declaredMembers.some((member) => member.flags === TypeFlags.String)) {\n return undefined;\n }\n if (this.javaProvableString(arg)) {\n return `((String)${name}).indexOf(${parsedArg})`;\n }\n return undefined;\n }\n}\n\n// hx4 J02\n// more hand-written BaseExchange map fields: every write in BaseExchange.java and ts/src is a\n// HashMap / ConcurrentHashMap / Map-cast or null (markets_by_id = null, urls/fees from describe())\nconst JAVA_J02_MAP_FIELDS: { [name: string]: true } = {\n 'tickers': true,\n 'bidsasks': true,\n 'trades': true,\n 'fees': true,\n 'urls': true,\n 'markets_by_id': true,\n};\n\n// hx4 J09: isTrue / isInstance / toLongOrNull / toStringArg go native on proven operands\nconst HX4_J09_SYNC_BASE_CALLS = new Set([\n 'safeString', 'safeString2', 'safeStringN', 'safeValue', 'safeDict', 'safeInteger', 'json',\n 'throwExactlyMatchedException', 'throwBroadlyMatchedException',\n]);\n\nexport interface JavaTranspiler {\n hx4J09BoxIdentifier(node, seen: Set, depth: number): boolean;\n hx4J09BoxValue(node, seen: Set, depth: number): boolean;\n hx4J09LiteralTupleElement(node, index: number): boolean;\n hx4J09CatchCannotWrap(node): boolean;\n hx4J09CoreArgument(type: string, printed: string, node): string | undefined;\n hx4J09CcxtErrorClass(node): boolean;\n}\n\n// a class declared in ts/src/base/errors.ts: its Java twin extends RuntimeException, so\n// `catchVar instanceof X` compiles against the `Exception` catch parameter\nJavaTranspiler.prototype.hx4J09CcxtErrorClass = function (node): boolean {\n const checker: any = this.checkerOrUndefined();\n let symbol: any;\n try {\n symbol = checker?.getSymbolAtLocation(node);\n if (symbol !== undefined && (symbol.flags & SymbolFlags.Alias)) {\n symbol = checker.getAliasedSymbol(symbol);\n }\n } catch (e) {\n return false;\n }\n const declaration: any = symbol?.declarations?.[0]?.resolve();\n return declaration?.kind === SyntaxKind.ClassDeclaration\n && /(^|[\\\\/])ts[\\\\/]src[\\\\/]base[\\\\/]errors\\.ts$/.test(declaration.getSourceFile?.()?.fileName ?? '');\n};\n\n// a local whose declared TS type is boolean-family and whose every write (D2 scan, tuples\n// included) is a Boolean-or-null box; a write cycle back to a local under proof is accepted\nJavaTranspiler.prototype.hx4J09BoxIdentifier = function (node, seen: Set, depth: number): boolean {\n const checker: any = this.checkerOrUndefined();\n if (checker === undefined || node?.kind !== SyntaxKind.Identifier || depth > 6) {\n return false;\n }\n const symbol = checker.getSymbolAtLocation(node);\n const decl: any = symbol?.valueDeclaration?.resolve();\n if (decl === undefined || decl.name?.text !== node.text) {\n return false;\n }\n if (seen.has(decl)) {\n return true;\n }\n const next = new Set(seen);\n next.add(decl);\n const accepts = (value) => this.hx4J09BoxValue(value, next, depth + 1);\n if (decl.kind === SyntaxKind.BindingElement) {\n const pattern = decl.parent;\n const declaration = pattern?.parent;\n if (decl.initializer !== undefined || decl.dotDotDotToken !== undefined\n || pattern?.kind !== SyntaxKind.ArrayBindingPattern || declaration?.kind !== SyntaxKind.VariableDeclaration) {\n return false;\n }\n const index = pattern.elements.indexOf(decl);\n if (!this.javaBooleanBoxTupleElement(declaration.initializer, index)\n && !this.hx4J09LiteralTupleElement(declaration.initializer, index)) {\n return false;\n }\n return this.javaWritesAreBoxed(symbol, { initializer: undefined, parent: declaration }, next, accepts, true);\n }\n if (decl.kind !== SyntaxKind.VariableDeclaration) {\n return false; // parameters are boxes their callers fill\n }\n let type;\n try {\n type = this.javaTypeOfDeclaration(decl);\n } catch (e) {\n return false;\n }\n if (!this.javaBooleanBoxType(type) && !this.javaNullableBooleanDeclaration(decl)) {\n return false;\n }\n return this.javaWritesAreBoxed(symbol, decl, next, accepts, true);\n};\n\n// a value whose printed Java is a Boolean, boolean or null\nJavaTranspiler.prototype.hx4J09BoxValue = function (node, seen: Set, depth: number): boolean {\n if (node === undefined) {\n return false;\n }\n if (node.kind === SyntaxKind.ParenthesizedExpression || node.kind === SyntaxKind.AsExpression\n || node.kind === SyntaxKind.NonNullExpression) {\n return this.hx4J09BoxValue(node.expression, seen, depth);\n }\n if (node.kind === SyntaxKind.NullKeyword || (node.kind === SyntaxKind.Identifier && node.text === 'undefined')) {\n return true;\n }\n if (node.kind === SyntaxKind.ConditionalExpression) {\n return this.hx4J09BoxValue(node.whenTrue, seen, depth) && this.hx4J09BoxValue(node.whenFalse, seen, depth);\n }\n if (node.kind === SyntaxKind.Identifier) {\n return this.hx4J09BoxIdentifier(node, seen, depth);\n }\n if (this.javaPrintsBooleanValue(node, new Set())) {\n return true;\n }\n if (node.kind !== SyntaxKind.CallExpression) {\n return false;\n }\n if (this.javaCallBooleanKind(node) !== undefined) {\n return true;\n }\n // safeBool* with a non-literal default: the accessor returns a Boolean member or the default\n const callee = node.expression;\n if (!isPropertyAccessExpression(callee) || callee.expression.kind !== SyntaxKind.ThisKeyword) {\n return false;\n }\n const at = JAVA_THIS_BOOLEAN_BOX_METHODS[String(callee.name.text)];\n if (at === undefined || this.javaBooleanValueKind(node) === undefined || !this.javaCalleeResolves(node)) {\n return false;\n }\n const declaration: any = this.getChecker().getResolvedSignature(node)?.declaration?.resolve();\n if (declaration?.name?.text !== callee.name.text\n || !JAVA_THIS_RETURN_TYPES_BASE_FILE.test(declaration.getSourceFile?.()?.fileName ?? '')) {\n return false;\n }\n const fallback = node.arguments?.[at];\n return fallback !== undefined && this.hx4J09BoxValue(fallback, seen, depth);\n};\n\n// element `index` of a base-tier `this.m(..)` whose every return is an array literal with a\n// Java boolean at that position (`handlePostOnly`: `[ true, p ]` / `[ false, p ]`)\nJavaTranspiler.prototype.hx4J09LiteralTupleElement = function (node, index: number): boolean {\n if (node?.kind !== SyntaxKind.CallExpression || index < 0) {\n return false;\n }\n const callee = node.expression;\n if (!isPropertyAccessExpression(callee) || callee.expression.kind !== SyntaxKind.ThisKeyword) {\n return false;\n }\n let declaration: any;\n try {\n declaration = this.getChecker().getResolvedSignature(node)?.declaration?.resolve();\n } catch (e) {\n return false;\n }\n if (declaration?.kind !== SyntaxKind.MethodDeclaration || declaration.body === undefined\n || declaration.name?.text !== callee.name.text\n || !JAVA_THIS_RETURN_TYPES_BASE_FILE.test(declaration.getSourceFile?.()?.fileName ?? '')) {\n return false;\n }\n let returns = 0;\n let ok = true;\n const scan = (current: Node) => {\n if (!ok || (current !== declaration && isFunctionLike(current))) {\n return;\n }\n if (isReturnStatement(current)) {\n returns++;\n const value: any = current.expression;\n if (value === undefined || !isArrayLiteralExpression(value)\n || !this.javaPrintsBooleanValue(value.elements[index], new Set())) {\n ok = false;\n return;\n }\n }\n current.forEachChild(scan);\n };\n scan(declaration.body);\n return ok && returns > 0;\n};\n\n// `e instanceof X` on a catch variable equals Helpers.isInstance (which first unwraps a\n// CompletionException/ExecutionException) when the try block cannot raise a wrapped one:\n// no await, every call a synchronous base-tier accessor/thrower\nJavaTranspiler.prototype.hx4J09CatchCannotWrap = function (node): boolean {\n if (node?.kind !== SyntaxKind.Identifier) {\n return false;\n }\n const checker: any = this.checkerOrUndefined();\n const decl: any = checker?.getSymbolAtLocation(node)?.valueDeclaration?.resolve();\n const clause = decl?.parent;\n const tryStatement = clause?.parent;\n if (decl?.kind !== SyntaxKind.VariableDeclaration || clause?.kind !== SyntaxKind.CatchClause\n || tryStatement?.kind !== SyntaxKind.TryStatement || tryStatement.catchClause !== clause) {\n return false;\n }\n let ok = true;\n const scan = (current: any) => {\n if (!ok) {\n return;\n }\n if (isFunctionLike(current) || current.kind === SyntaxKind.AwaitExpression || current.kind === SyntaxKind.TryStatement) {\n ok = false;\n return;\n }\n if (current.kind === SyntaxKind.CallExpression) {\n const callee = current.expression;\n if (!isPropertyAccessExpression(callee) || callee.expression.kind !== SyntaxKind.ThisKeyword\n || !HX4_J09_SYNC_BASE_CALLS.has(String(callee.name.text))) {\n ok = false;\n return;\n }\n const declaration: any = checker.getResolvedSignature(current)?.declaration?.resolve();\n if (declaration === undefined\n || !JAVA_THIS_RETURN_TYPES_BASE_FILE.test(declaration.getSourceFile?.()?.fileName ?? '')) {\n ok = false;\n return;\n }\n }\n current.forEachChild(scan);\n };\n scan(tryStatement.tryBlock);\n return ok;\n};\n\n// core-argument conversions a declaration already proves: a const `= undefined` local is\n// null; a const `x.length` local the build layer declares Integer widens to the Long slot\nJavaTranspiler.prototype.hx4J09CoreArgument = function (type: string, printed: string, node): string | undefined {\n if (node === undefined || !isIdentifier(node) || printed !== node.text || (type !== 'Long' && type !== 'String')) {\n return undefined;\n }\n const declaration: any = this.javaDeclarationOfIdentifier(node);\n if (declaration === undefined || !isVariableDeclaration(declaration) || (declaration.name as any)?.text !== node.text\n || (getCombinedNodeFlags(declaration) & NodeFlags.Const) === 0) {\n return undefined;\n }\n const initializer = declaration.initializer;\n if (initializer !== undefined && isIdentifier(initializer) && initializer.text === 'undefined') {\n return `(${type}) null`;\n }\n if (type === 'Long' && initializer !== undefined && isPropertyAccessExpression(initializer)\n && initializer.name.text === 'length' && this.javaDeclaredTypeOf(node) === 'Integer') {\n return `((long) ${printed})`;\n }\n return undefined;\n};\n\n{\n const proto: any = JavaTranspiler.prototype;\n const printCondition = proto.printCondition;\n proto.printCondition = function (node, identation) {\n const printed: string = printCondition.call(this, node, identation);\n let inner = node;\n while (inner?.kind === SyntaxKind.ParenthesizedExpression) {\n inner = inner.expression;\n }\n if (inner?.kind === SyntaxKind.Identifier && printed.trimStart().startsWith(this.FALSY_WRAPPER_OPEN)\n && this.hx4J09BoxIdentifier(inner, new Set(), 0)) {\n return this.getIden(identation) + `Boolean.TRUE.equals(${this.printNode(inner, 0)})`;\n }\n return printed;\n };\n const printInstanceOfExpression = proto.printInstanceOfExpression;\n proto.printInstanceOfExpression = function (node, identation) {\n if (node.right?.kind === SyntaxKind.Identifier && this.hx4J09CcxtErrorClass(node.right)\n && this.hx4J09CatchCannotWrap(node.left)) {\n return this.getIden(identation) + `(${this.printNode(node.left, 0)} instanceof ${node.right.text})`;\n }\n return printInstanceOfExpression.call(this, node, identation);\n };\n const javaConvertToCoreType = proto.javaConvertToCoreType;\n proto.javaConvertToCoreType = function (type: string, printed: string, node) {\n return this.hx4J09CoreArgument(type, printed, node) ?? javaConvertToCoreType.call(this, type, printed, node);\n };\n}\n\n// hx4 J15: two declared numeric boxes compare by value, never by reference. Same-class integral\n// boxes take Objects.equals (Helpers.isEqual's null table + toLong compare); a Double on either side\n// compares doubleValue() (isEqual's toDouble: 0.0 == -0.0, NaN != NaN), other integral pairs longValue().\n{\n const proto: any = JavaTranspiler.prototype;\n const printNativeEquality = proto.printNativeEqualityIfProvable;\n proto.printNativeEqualityIfProvable = function (node, leftText: string, rightText: string): string | undefined {\n const op = node?.operatorToken?.kind;\n const negated = op === SyntaxKind.ExclamationEqualsToken || op === SyntaxKind.ExclamationEqualsEqualsToken;\n if (negated || op === SyntaxKind.EqualsEqualsToken || op === SyntaxKind.EqualsEqualsEqualsToken) {\n const left = this.javaDeclaredNumericFamily(node.left);\n const right = this.javaDeclaredNumericFamily(node.right);\n // a declared Boolean: isEqual answers false across classes and by value within Boolean\n const isBool = (n) => String(this.javaDeclaredTypeOf(n) ?? '').trim() === 'Boolean';\n if (isBool(node.left) || isBool(node.right)) {\n return `${negated ? '!' : ''}java.util.Objects.equals(${leftText}, ${rightText})`;\n }\n if (JAVA_BOXED_NUMERIC_TYPES.has(left) && JAVA_BOXED_NUMERIC_TYPES.has(right)) {\n let equal: string;\n if (left === right && left !== 'Double') {\n equal = `java.util.Objects.equals(${leftText}, ${rightText})`;\n } else {\n const unbox = (left === 'Double' || right === 'Double') ? 'doubleValue' : 'longValue';\n equal = `(${leftText} == null ? ${rightText} == null : (${rightText} != null && ${leftText}.${unbox}() == ${rightText}.${unbox}()))`;\n }\n return negated ? `!${equal}` : equal;\n }\n }\n return printNativeEquality.call(this, node, leftText, rightText);\n };\n}\n\n// hx4 J16: an awaited implicit-API call (declared in ts/src/abstract/.ts, body `this.request(..)`)\n// hands back a fresh Jackson parse of the HTTP body: never a field map or a ws client map, whatever\n// its arguments read, so J01's non-shared proof admits it as a put source.\nconst JAVA_J16_IMPLICIT_API_FILE = /(^|[\\\\/])ts[\\\\/]src[\\\\/]abstract[\\\\/][a-z0-9_]+\\.ts$/;\n{\n const proto: any = JavaTranspiler.prototype;\n const nonSharedValue = proto.javaHx4NonSharedValue;\n proto.javaHx4NonSharedValue = function (value, depth: number): boolean {\n return this.javaJ16ImplicitApiResponse(value) || nonSharedValue.call(this, value, depth);\n };\n proto.javaJ16ImplicitApiResponse = function (value): boolean {\n let node = this.unwrapPrintTransparentExpression(value);\n if (node?.kind !== SyntaxKind.AwaitExpression) {\n return false;\n }\n node = this.unwrapPrintTransparentExpression(node.expression);\n if (node === undefined || !isCallExpression(node) || !isPropertyAccessExpression(node.expression)\n || node.expression.expression.kind !== SyntaxKind.ThisKeyword) {\n return false;\n }\n let declaration: any;\n try {\n declaration = this.checkerOrUndefined()?.getResolvedSignature(node)?.declaration?.resolve();\n } catch (e) {\n return false;\n }\n const fileName = declaration?.getSourceFile?.()?.fileName;\n if (typeof fileName !== 'string' || !JAVA_J16_IMPLICIT_API_FILE.test(fileName) || !declaration.body) {\n return false;\n }\n const statements = declaration.body.statements ?? [];\n const ret = statements.length === 1 && isReturnStatement(statements[0]) ? statements[0].expression : undefined;\n return ret !== undefined && isCallExpression(ret) && isPropertyAccessExpression(ret.expression)\n && ret.expression.expression.kind === SyntaxKind.ThisKeyword && ret.expression.name.text === 'request';\n };\n}\n","import { BaseTranspiler } from \"./baseTranspiler.js\";\nimport { NodeFlags, SyntaxKind, type Block, type CallExpression, type Declaration, type Expression, type Identifier, type Node, type NodeArray, type ParameterDeclaration, type SourceFile, type VariableDeclaration } from \"typescript/unstable/ast\";\nimport { isArrayLiteralExpression, isArrowFunction, isAsExpression, isBinaryExpression, isBindingElement, isBlock, isCallExpression, isClassDeclaration, isClassExpression, isConditionalExpression, isDeleteExpression, isElementAccessExpression, isForInStatement, isForOfStatement, isIdentifier, isMethodDeclaration, isNoSubstitutionTemplateLiteral, isNonNullExpression, isNumericLiteral, isObjectLiteralExpression, isParameterDeclaration, isParenthesizedExpression, isPrefixUnaryExpression, isPropertyAccessExpression, isReturnStatement, isShorthandPropertyAssignment, isSourceFile, isStatement, isStringLiteral, isStringLiteralLikeNode, isTypeAssertion, isVariableDeclaration } from \"typescript/unstable/ast/is\";\nimport { IndexKind, ObjectFlags, SignatureKind, SymbolFlags, TypeFlags, type Symbol as TsSymbol, type Type } from \"typescript/unstable/sync\";\nimport { findAncestor, getAllSuperTypeNodes, isFunctionLike, signatureDeclaration, symbolDeclarations, symbolValueDeclaration, typeParts, typeTarget } from \"./tsUtils.js\";\n\nconst parserConfig = {\n 'ELSEIF_TOKEN': 'else if',\n 'OBJECT_OPENING': '{',\n 'OBJECT_CLOSING': '}',\n 'ARRAY_OPENING_TOKEN': 'Value::from(vec![',\n 'ARRAY_CLOSING_TOKEN': '])',\n 'PROPERTY_ASSIGNMENT_TOKEN': ':',\n 'VAR_TOKEN': 'let mut',\n 'METHOD_TOKEN': 'fn',\n 'FUNCTION_TOKEN': 'fn',\n 'PROPERTY_ASSIGNMENT_OPEN': '',\n 'PROPERTY_ASSIGNMENT_CLOSE': '',\n 'SUPER_TOKEN': 'super',\n 'SUPER_CALL_TOKEN': 'super',\n 'FALSY_WRAPPER_OPEN': 'is_true(&',\n 'FALSY_WRAPPER_CLOSE': ')',\n 'COMPARISON_WRAPPER_OPEN': 'is_equal(&',\n 'COMPARISON_WRAPPER_CLOSE': ')',\n 'UKNOWN_PROP_WRAPPER_OPEN': '',\n 'UNKOWN_PROP_WRAPPER_CLOSE': '',\n 'UKNOWN_PROP_ASYNC_WRAPPER_OPEN': '',\n 'UNKOWN_PROP_ASYNC_WRAPPER_CLOSE': '',\n 'DYNAMIC_CALL_OPEN': '',\n 'EQUALS_EQUALS_WRAPPER_OPEN': 'is_equal(&',\n 'EQUALS_EQUALS_WRAPPER_CLOSE': ')',\n 'DIFFERENT_WRAPPER_OPEN': '!is_equal(&',\n 'DIFFERENT_WRAPPER_CLOSE': ')',\n 'GREATER_THAN_WRAPPER_OPEN': 'is_greater_than(&',\n 'GREATER_THAN_WRAPPER_CLOSE': ')',\n 'GREATER_THAN_EQUALS_WRAPPER_OPEN': 'is_greater_than_or_equal(&',\n 'GREATER_THAN_EQUALS_WRAPPER_CLOSE': ')',\n 'LESS_THAN_WRAPPER_OPEN': 'is_less_than(&',\n 'LESS_THAN_WRAPPER_CLOSE': ')',\n 'LESS_THAN_EQUALS_WRAPPER_OPEN': 'is_less_than_or_equal(&',\n 'LESS_THAN_EQUALS_WRAPPER_CLOSE': ')',\n 'PLUS_WRAPPER_OPEN': 'add(&',\n 'PLUS_WRAPPER_CLOSE': ')',\n 'MINUS_WRAPPER_OPEN': 'subtract(&',\n 'MINUS_WRAPPER_CLOSE': ')',\n 'ARRAY_LENGTH_WRAPPER_OPEN': 'get_array_length(&',\n 'ARRAY_LENGTH_WRAPPER_CLOSE': ')',\n 'DIVIDE_WRAPPER_OPEN': 'divide(&',\n 'DIVIDE_WRAPPER_CLOSE': ')',\n 'MULTIPLY_WRAPPER_OPEN': 'multiply(&',\n 'MULTIPLY_WRAPPER_CLOSE': ')',\n 'INDEXOF_WRAPPER_OPEN': 'get_index_of(&',\n 'INDEXOF_WRAPPER_CLOSE': ')',\n 'MOD_WRAPPER_OPEN': 'mod_val(&',\n 'MOD_WRAPPER_CLOSE': ')',\n 'LINE_TERMINATOR': ';',\n 'CONDITION_OPENING': '',\n 'CONDITION_CLOSE': '',\n 'AWAIT_TOKEN': '',\n 'NULL_TOKEN': 'Value::Null',\n 'UNDEFINED_TOKEN': 'Value::Null',\n 'WHILE_TOKEN': 'while',\n 'ELEMENT_ACCESS_WRAPPER_OPEN': 'get_value(&',\n 'ELEMENT_ACCESS_WRAPPER_CLOSE': ')',\n 'DEFAULT_PARAMETER_TYPE': 'Value',\n 'DEFAULT_RETURN_TYPE': 'Value',\n 'BLOCK_OPENING_TOKEN': '{',\n 'TRUE_KEYWORD': 'Value::Bool(true)',\n 'FALSE_KEYWORD': 'Value::Bool(false)',\n};\n\n/** Answer of `RustTranspiler.rustDeclaredLocalTypeResolver` for a local whose\n * value provably holds a `Value::Dict` at every use. */\nexport type RustDeclaredLocalKind = 'dict';\n\n/** One `let x: Value = ` declaration. `kind` is only\n * answered by the resolver when `alwaysDict && stable`. */\nexport interface RustDeclaredDictLocalEntry {\n kind: RustDeclaredLocalKind;\n name: string;\n /** printed callee of the initialiser: a `safe_dict*` name, or `value_map`. */\n source: string;\n /** the `safe_dict*` `optionalArgs` default is itself Dict-proven, so the\n * helper returns a Dict on every path (it returns that default when the\n * key does not hold one). */\n alwaysDict: boolean;\n /** no later write in the enclosing function can change the kind (D2). */\n stable: boolean;\n /** use census: element-access receiver / kind-preserving mutator / anything else. */\n uses: { elementAccess: number, mutHelper: number, other: number };\n declaration: VariableDeclaration;\n start: number;\n}\n\n/** A `Dict`/`List` parameter whose body uses are all printable reads: the\n * printer re-binds the same name to a borrowed container at fn entry\n * (`let x = x.as_map().unwrap_or(&__x_empty);`) so every read is native. */\nexport interface RustParamShadow {\n kind: RustParamShadowKind;\n /** the parameter name; the shadow re-binds it, the `Value` ABI is untouched. */\n name: string;\n declaration: ParameterDeclaration;\n}\n\n/** Shadow kinds: `&IndexMap` / `&Vec` (D-25). */\nexport type RustParamShadowKind = 'map' | 'list';\n\n/** Vocabulary of the parameter-shadow table (`RustTranspiler.rustParamShadowOf`). */\nexport const RUST_PARAM_SHADOWS = {\n MAP: 'map' as RustParamShadowKind,\n LIST: 'list' as RustParamShadowKind,\n /** `this.` reads inlined natively against a shadowed dict param. */\n SAFE_READS: new Set([\n 'safeValue', 'safeString', 'safeInteger', 'safeNumber', 'safeBool',\n 'safeDict', 'safeList',\n ]),\n};\n\n/** Vocabulary of the declared-Dict locals table (see\n * `RustTranspiler.rustDeclaredLocalTypeResolver`). */\nexport const RUST_DECLARED_DICT_LOCALS = {\n /** value the resolver answers for a proven Dict local */\n DICT: 'dict' as RustDeclaredLocalKind,\n /** printed `self.` -> index of its `optionalArgs` parameter.\n * `safe_dict*` returns `optional_args[0]` whenever the key holds a non-Dict. */\n SAFE_CALLEES: {\n safe_dict_k: 2,\n safe_dict: 2,\n safe_dict_n: 2,\n safe_dict2: 3,\n } as Record,\n /** `&mut` receivers whose writes land inside the container, so a Dict local\n * stays a Dict (`add_element_to_object` / `append_to_array` no-op on a\n * non-container, `set_value` / `remove` write a key). */\n KIND_PRESERVING_MUTATORS: new Set([\n 'add_element_to_object', 'append_to_array', 'set_value', 'remove',\n 'get_value_mut',\n ]),\n};\n\n/** `x = ..` / `x += ..` — every token that writes a place. */\nfunction rustIsAssignmentOperator(kind: SyntaxKind): boolean {\n return kind === SyntaxKind.EqualsToken ||\n (kind >= SyntaxKind.PlusEqualsToken && kind <= SyntaxKind.CaretEqualsToken);\n}\n\n/** Preorder (forEachChild order) of a scope's descendants, decoded once: `end[i]` is the index past\n * node i's subtree; `byName` lists identifiers and name-binding declarations per name text. */\ninterface RustScopeIndex {\n nodes: Node[];\n end: number[];\n byName: Map | undefined;\n}\n\nconst RUST_NAME_BINDER_KINDS = new Set([\n SyntaxKind.VariableDeclaration, SyntaxKind.Parameter, SyntaxKind.FunctionDeclaration,\n SyntaxKind.ClassDeclaration, SyntaxKind.PropertyDeclaration, SyntaxKind.FunctionExpression,\n SyntaxKind.ArrowFunction,\n]);\n\nconst RUST_WALK_SKIP = 1;\nconst RUST_WALK_STOP = 2;\n\nfunction rustBuildScopeIndex(scope: Node): RustScopeIndex {\n const nodes: Node[] = [];\n const end: number[] = [];\n const visit = (n: any) => {\n const i = nodes.length;\n nodes.push(n);\n end.push(0);\n n.forEachChild(visit);\n end[i] = nodes.length;\n };\n scope.forEachChild(visit);\n return { nodes, end, byName: undefined };\n}\n\n// name text decoding is the costly part, so the name table is built on first use only\nfunction rustScopeNameTable(index: RustScopeIndex): Map {\n if (index.byName !== undefined) return index.byName;\n const byName = new Map();\n const add = (name: string, i: number) => {\n const list = byName.get(name);\n if (list === undefined) byName.set(name, [i]);\n else if (list[list.length - 1] !== i) list.push(i);\n };\n const nodes: any[] = index.nodes;\n for (let i = 0; i < nodes.length; i++) {\n const n = nodes[i];\n const kind = n.kind;\n if (RUST_NAME_BINDER_KINDS.has(kind) && n.name?.kind === SyntaxKind.Identifier) add(n.name.text, i);\n if (kind === SyntaxKind.Identifier) add(n.text, i);\n }\n index.byName = byName;\n return byName;\n}\n\nexport class RustTranspiler extends BaseTranspiler {\n\n private rustScopeIndexes = new WeakMap();\n\n rustScopeIndex(scope: Node): RustScopeIndex {\n let index = this.rustScopeIndexes.get(scope);\n if (index === undefined) {\n index = rustBuildScopeIndex(scope);\n this.rustScopeIndexes.set(scope, index);\n }\n return index;\n }\n\n /** `scope.forEachChild(visit)` recursion over the cached preorder: `visit` answers\n * RUST_WALK_SKIP to skip the node's subtree, RUST_WALK_STOP to end the walk. */\n rustWalkScope(scope: Node, visit: (n: any) => number | void): void {\n const { nodes, end } = this.rustScopeIndex(scope);\n for (let i = 0; i < nodes.length;) {\n const r = visit(nodes[i]);\n if (r === RUST_WALK_STOP) return;\n i = r === RUST_WALK_SKIP ? end[i] : i + 1;\n }\n }\n\n /** Scope nodes that are an identifier or a name-binding declaration spelled `name`, in walk order. */\n rustScopeNameNodes(scope: Node, name: string): Node[] {\n const index = this.rustScopeIndex(scope);\n return (rustScopeNameTable(index).get(name) ?? []).map((i) => index.nodes[i]);\n }\n\n // node kinds the printer types that the core per-file prefetch leaves to single round trips\n private static readonly RUST_PREFETCH_TYPE_KINDS = new Set([\n SyntaxKind.FalseKeyword, SyntaxKind.TrueKeyword, SyntaxKind.ParenthesizedExpression,\n SyntaxKind.AwaitExpression, SyntaxKind.PrefixUnaryExpression,\n SyntaxKind.BooleanKeyword, SyntaxKind.ObjectKeyword, SyntaxKind.UnionType,\n SyntaxKind.ConditionalExpression, SyntaxKind.AsExpression,\n ]);\n\n /** One bulk getTypeAtLocation for the class's nodes of those kinds, seeding the checker memo. */\n rustPrefetchClassTypes(node: Node): void {\n const getType: any = this.checkerOrUndefined()?.getTypeAtLocation;\n if (getType?.seed === undefined || getType.original === undefined) return;\n const kinds = RustTranspiler.RUST_PREFETCH_TYPE_KINDS;\n const nodes: Node[] = [];\n for (const n of this.rustScopeIndex(node).nodes) {\n if (kinds.has(n.kind) && !getType.has(n)) nodes.push(n);\n }\n if (nodes.length === 0) return;\n let results: unknown[];\n try {\n results = getType.original(nodes);\n } catch (e) {\n return; // the lazy per-node path answers them\n }\n nodes.forEach((n, i) => getType.seed(n, results[i]));\n }\n\n binaryExpressionsWrappers;\n methodSignatures: Record;\n forLoopCounter: number;\n /** The handler `message` parameter a shadow is being printed for (set only\n * while its method body is printed). */\n rustProHandlerShadowParam: ParameterDeclaration | undefined;\n\n constructor(config = {}) {\n config['parser'] = Object.assign({}, parserConfig, config['parser'] ?? {});\n super(config);\n\n this.requiresParameterType = true;\n this.requiresReturnType = false;\n this.asyncTranspiling = true;\n this.supportsFalsyOrTruthyValues = false;\n this.id = \"Rust\";\n this.className = \"undefined\";\n this.methodSignatures = {};\n this.forLoopCounter = 0;\n\n this.initConfig();\n this.applyUserOverrides(config);\n }\n\n initConfig() {\n this.LeftPropertyAccessReplacements = {};\n\n this.RightPropertyAccessReplacements = {};\n\n this.FullPropertyAccessReplacements = {\n 'console.log': 'println_val',\n 'Math.floor': 'math_floor',\n 'Math.ceil': 'math_ceil',\n 'Math.round': 'math_round',\n };\n\n this.CallExpressionReplacements = {};\n\n this.ReservedKeywordsReplacements = {\n 'type': 'type_var',\n 'move': 'move_val',\n 'ref': 'ref_val',\n 'str': 'str_val',\n 'use': 'use_val',\n 'mod': 'mod_kw',\n 'loop': 'loop_val',\n 'match': 'match_val',\n 'where': 'where_val',\n 'final': 'final_val',\n 'box': 'box_val',\n 'become': 'become_val',\n 'priv': 'priv_val',\n 'override': 'override_val',\n 'unsized': 'unsized_val',\n 'async': 'async_val',\n 'await': 'await_val',\n 'try': 'try_val',\n 'abstract': 'abstract_val',\n 'dyn': 'dyn_val',\n 'fn': 'fn_val',\n 'impl': 'impl_val',\n 'pub': 'pub_val',\n 'self': 'self_val',\n 'super': 'super_val',\n 'crate': 'crate_val',\n };\n\n // [fnName, close] — ensureRef adds & to each operand\n this.binaryExpressionsWrappers = {\n [SyntaxKind.EqualsEqualsToken]: ['is_equal(', ')'],\n [SyntaxKind.EqualsEqualsEqualsToken]: ['is_equal(', ')'],\n [SyntaxKind.ExclamationEqualsToken]: ['!is_equal(', ')'],\n [SyntaxKind.ExclamationEqualsEqualsToken]: ['!is_equal(', ')'],\n [SyntaxKind.GreaterThanToken]: ['is_greater_than(', ')'],\n [SyntaxKind.GreaterThanEqualsToken]: ['is_greater_than_or_equal(', ')'],\n [SyntaxKind.LessThanToken]: ['is_less_than(', ')'],\n [SyntaxKind.LessThanEqualsToken]: ['is_less_than_or_equal(', ')'],\n [SyntaxKind.PlusToken]: ['add(', ')'],\n [SyntaxKind.MinusToken]: ['subtract(', ')'],\n [SyntaxKind.AsteriskToken]: ['multiply(', ')'],\n [SyntaxKind.PercentToken]: ['mod_val(', ')'],\n [SyntaxKind.SlashToken]: ['divide(', ')'],\n };\n }\n\n // Escaped Rust string literal for the given TS literal text — shared by\n // the `Value::Str(..)` form and the `&str` key form below.\n quotedStringLiteral(text: string): string {\n // Preserve real backslashes\n const backslashPlaceholder = \"\\x00\";\n text = text.replaceAll(\"\\\\\", backslashPlaceholder);\n text = text.replaceAll(\"\\b\", \"\\\\b\");\n text = text.replaceAll(\"\\f\", \"\\\\f\");\n text = text.replaceAll(\"\\n\", \"\\\\n\");\n text = text.replaceAll(\"\\r\", \"\\\\r\");\n text = text.replaceAll(\"\\t\", \"\\\\t\");\n text = text.replaceAll(backslashPlaceholder, \"\\\\\\\\\");\n text = text.replaceAll('\"', '\\\\\"');\n return `\"${text}\"`;\n }\n\n printStringLiteral(node) {\n const text = node.text;\n if (text in this.StringLiteralReplacements) return this.StringLiteralReplacements[text];\n // `.into()` borrows the `&'static str` into the `Cow` payload — no alloc.\n return `Value::Str(${this.quotedStringLiteral(text)}.into())`;\n }\n\n printNumericLiteral(node) {\n const text = node.text;\n // a decimal point or an exponent makes the literal a float\n if (text.includes('.') || /[eE]/.test(text)) return `Value::Float(${text})`;\n return `Value::Int(${text})`;\n }\n\n printBooleanLiteral(node) {\n return `Value::Bool(${SyntaxKind.TrueKeyword === node.kind})`;\n }\n\n printNullKeyword(node, identation) {\n return 'Value::Null';\n }\n\n // ── native equality emission ────────────────────────────────────────────\n // When the checker proves both operands hold the same primitive payload\n // (string / number / boolean, or one side is a matching literal) the\n // unwrapped payloads are compared with `==`/`!=` instead of is_equal().\n\n // Operators whose printed form is a bare Rust `bool` (not a Value).\n private static readonly BOOL_PRODUCING_OPERATORS = new Set([\n SyntaxKind.EqualsEqualsToken,\n SyntaxKind.EqualsEqualsEqualsToken,\n SyntaxKind.ExclamationEqualsToken,\n SyntaxKind.ExclamationEqualsEqualsToken,\n SyntaxKind.LessThanToken,\n SyntaxKind.LessThanEqualsToken,\n SyntaxKind.GreaterThanToken,\n SyntaxKind.GreaterThanEqualsToken,\n SyntaxKind.AmpersandAmpersandToken,\n SyntaxKind.BarBarToken,\n SyntaxKind.InstanceOfKeyword,\n ]);\n\n // Method names whose Rust helper returns a bare `bool` (not a Value).\n private static readonly BOOL_PRODUCING_CALLS = new Set([\n 'isInteger',\n 'isSafeInteger',\n 'some',\n 'every',\n 'test',\n ]);\n\n // Receiver locals whose element writes may go native (rust-13). `request`\n // is rust-12's family; every other receiver keeps the helper.\n private static readonly RUST_NATIVE_INSERT_RECEIVERS = new Set([\n 'result',\n 'account',\n 'params',\n 'fee',\n ]);\n\n // Scalar book fields the shared order-book store keeps instead of the Dict\n // (value.rs `is_book_meta_key` plus the `cache` replacement write).\n private static readonly RUST_BOOK_META_KEYS = new Set([\n 'timestamp',\n 'datetime',\n 'nonce',\n 'symbol',\n 'checksum',\n 'cache',\n ]);\n\n // `this.` receivers whose Value may be a tagged live handle (order\n // book / cache / ws client / subscriptions snapshot) — these keep the helper\n // so its store write-through stays reachable.\n private static readonly RUST_TAGGED_HANDLE_FIELDS = new Set([\n 'cache',\n 'client',\n 'subscriptions',\n 'orderbook',\n ]);\n\n // Fields the hand-written base keeps as a plain dict: `rust/ccxt-base/src/exchange.rs`\n // initialises each to `Value::Map(HashMap::new())` and never tags it, so an element write\n // is the whole helper even though the TS declaration is `any` (no checker shape to read).\n private static readonly RUST_PLAIN_DICT_FIELDS = new Set([\n 'balance',\n 'orderbooks',\n 'trades',\n 'tickers',\n 'bidsasks',\n 'ohlcvs',\n 'clients',\n 'transactions',\n 'headers',\n 'currencies',\n 'has',\n 'tokenBucket',\n ]);\n\n // Free helpers whose call prints a bare `bool` — an argument position that\n // expects a `Value` has to box them (ccxt's wrapBoolValueArgs set).\n private static readonly RUST_BOOL_VALUE_HELPERS = [\n 'is_equal',\n 'is_true',\n 'is_greater_than',\n 'is_less_than',\n 'is_greater_than_or_equal',\n 'is_less_than_or_equal',\n 'is_array',\n 'is_object',\n 'in_op',\n 'is_number',\n 'is_string',\n ];\n\n // Payload accessor used to compare each primitive kind natively.\n private static readonly PAYLOAD_ACCESSORS = {\n 'string': 'as_str',\n 'number': 'as_f64',\n 'boolean': 'as_bool',\n };\n\n // Primitive kind the checker proves for `type`; a union keeps the kind only\n // when every non-nullable member is that same primitive.\n primitiveKindOfType(type): string {\n if (type === undefined) return undefined;\n const flags = type.flags;\n if (this.isStringType(flags)) return 'string';\n if (flags === TypeFlags.Number || flags === TypeFlags.NumberLiteral) return 'number';\n if (flags === TypeFlags.Boolean || flags === TypeFlags.BooleanLiteral) return 'boolean';\n if (flags & TypeFlags.Union) {\n let kind = undefined;\n for (const member of typeParts(type) ?? []) {\n if (member.flags & (TypeFlags.Undefined | TypeFlags.Null)) {\n continue;\n }\n const memberKind = this.primitiveKindOfType(member);\n if (memberKind === undefined || (kind !== undefined && kind !== memberKind)) return undefined;\n kind = memberKind;\n }\n return kind;\n }\n return undefined;\n }\n\n // Native truthiness of a checker-proved boolean Value: `is_true(&v)` is `v.is_truthy()`\n // (`\"\"`/`0`/`[]`/`{}`/Null are false). When the operand is proven `bool`/`undefined` only,\n // the runtime value is `Value::Bool(..)` or `Value::Null`, so `matches!(v, Value::Bool(true))`.\n\n /** `true` / `false` / `boolean` (a union of BooleanLiteral members too). */\n isBooleanValueType(type: Type | undefined): boolean {\n if (type === undefined) return false;\n if (type.flags & TypeFlags.Union) {\n const members: Type[] = typeParts(type) ?? [];\n return members.length > 0 && members.every((member) => this.isBooleanValueType(member));\n }\n return (type.flags & (TypeFlags.Boolean | TypeFlags.BooleanLiteral)) !== 0;\n }\n\n /** `boolean | undefined`: `undefined`/`null` both print `Value::Null` (false\n * for the helper and for the `matches!` alike), so they may join the union. */\n isBooleanOrUndefinedType(type: Type | undefined): boolean {\n if (type === undefined) return false;\n const members: Type[] = (type.flags & TypeFlags.Union) ? (typeParts(type) ?? []) : [type];\n if (members.length === 0) return false;\n const onlyBooleanOrEmpty = members.every((member) =>\n this.isBooleanValueType(member) ||\n (member.flags & (TypeFlags.Undefined | TypeFlags.Void | TypeFlags.Null)) !== 0);\n return onlyBooleanOrEmpty && members.some((member) => this.isBooleanValueType(member));\n }\n\n /** Operands this unit owns: `safeBool`/`safeBool2`/`safeBoolN` calls (a\n * `Value` in the port) and element accesses (printed as `get_value`). */\n isBooleanValueFamilyOperand(node): boolean {\n const inner = this.unwrapParens(node);\n if (inner === undefined) return false;\n if (isElementAccessExpression(inner)) return true;\n if (isCallExpression(inner)) {\n const name = this.callExpressionName(inner);\n return name === 'safeBool' || name === 'safeBool2' || name === 'safeBoolN';\n }\n return false;\n }\n\n /** The emitted `matches!` is a bare Rust `bool`: it is only valid where the\n * whole enclosing boolean expression already sits in a bool slot. A logical\n * expression stored in a `Value` slot gets its `Value::Bool(..)` box from the\n * ccxt post-passes, which key on the leading helper token the operand would\n * no longer provide. */\n isBareBoolEmissionSafe(node): boolean {\n return this.isBooleanPosition(this.rustClimbLogicalWrappers(node));\n }\n\n /** Outermost ancestor reached through parens, `!` and `&&`/`||`. */\n rustClimbLogicalWrappers(node): any {\n let current: any = node;\n let parent: any = current.parent;\n while (parent !== undefined && (isParenthesizedExpression(parent) ||\n (parent.kind === SyntaxKind.PrefixUnaryExpression && parent.operator === SyntaxKind.ExclamationToken) ||\n (parent.kind === SyntaxKind.BinaryExpression &&\n (parent.operatorToken.kind === SyntaxKind.AmpersandAmpersandToken ||\n parent.operatorToken.kind === SyntaxKind.BarBarToken)))) {\n current = parent;\n parent = parent.parent;\n }\n return current;\n }\n\n // B-26 extends the proof with the printer's own bool-typed sinks: a narrowed `let x: bool = …`\n // (getRustBoolLocalInitializer) and a logical boxed in `Value::Bool(…)`\n // (printCustomBinaryExpressionIfAny) both demand a `bool`, so their operands may print bare.\n rustConditionBoolSlot(node): boolean {\n if (this.isBareBoolEmissionSafe(node)) return true;\n const current = this.rustClimbLogicalWrappers(node);\n // A logical the printer boxes (`Value::Bool()`) for a Value slot.\n const inner = this.unwrapParens(current);\n if (inner !== undefined && inner.kind === SyntaxKind.BinaryExpression &&\n (inner.operatorToken.kind === SyntaxKind.AmpersandAmpersandToken ||\n inner.operatorToken.kind === SyntaxKind.BarBarToken) &&\n (this.hasNativeComparisonOperand(inner.left) || this.hasNativeComparisonOperand(inner.right))) {\n return true;\n }\n // The initializer of a local this printer declares `bool`.\n const declaration: any = current.parent;\n if (declaration === undefined || !isVariableDeclaration(declaration) ||\n declaration.initializer !== current || declaration.name?.kind !== SyntaxKind.Identifier) {\n return false;\n }\n return this.rustNodeIsBoolExpression(declaration.initializer) &&\n this.rustTypeIsBoolean(declaration.initializer) &&\n this.rustLocalUsesAcceptBool(declaration, String(declaration.name.text));\n }\n\n /** Native truthiness text of the operand, or undefined to keep `is_true`. */\n printNativeTruthiness(node): string | undefined {\n if (!this.isBooleanValueFamilyOperand(node) || !this.printsValueExpression(node) ||\n !this.isBooleanOrUndefinedType(this.typeOfNodeIfAny(node)) || !this.isBareBoolEmissionSafe(node)) {\n return undefined;\n }\n return `matches!(${this.printNode(node, 0)}, Value::Bool(true))`;\n }\n\n // Kind of a literal operand whose printed Value variant is exactly known.\n literalKindOfNode(node): string {\n if (node === undefined) return undefined;\n switch (node.kind) {\n case SyntaxKind.StringLiteral: return 'string';\n case SyntaxKind.NumericLiteral: return 'number';\n case SyntaxKind.TrueKeyword:\n case SyntaxKind.FalseKeyword: return 'boolean';\n case SyntaxKind.NullKeyword: return 'null';\n case SyntaxKind.Identifier: return node.text === 'undefined' ? 'null' : undefined;\n }\n return undefined;\n }\n\n // Does printNode() render `node` as a Rust `Value` (and not a bare bool)?\n printsValueExpression(node): boolean {\n if (node === undefined) return false;\n switch (node.kind) {\n case SyntaxKind.ParenthesizedExpression: return this.printsValueExpression(node.expression);\n case SyntaxKind.AwaitExpression: return this.printsValueExpression(node.expression);\n case SyntaxKind.BinaryExpression: return !RustTranspiler.BOOL_PRODUCING_OPERATORS.has(node.operatorToken.kind);\n case SyntaxKind.PrefixUnaryExpression: return node.operator !== SyntaxKind.ExclamationToken;\n case SyntaxKind.CallExpression: return !RustTranspiler.BOOL_PRODUCING_CALLS.has(this.callExpressionName(node));\n case SyntaxKind.Identifier:\n case SyntaxKind.PropertyAccessExpression:\n case SyntaxKind.ElementAccessExpression:\n return !this.isClassInstanceType(this.getChecker().getTypeAtLocation(node));\n case SyntaxKind.StringLiteral:\n case SyntaxKind.NumericLiteral:\n case SyntaxKind.TrueKeyword:\n case SyntaxKind.FalseKeyword:\n case SyntaxKind.NullKeyword:\n case SyntaxKind.ArrayLiteralExpression:\n case SyntaxKind.ObjectLiteralExpression:\n case SyntaxKind.ConditionalExpression:\n return true;\n }\n return false;\n }\n\n // Class instances are emitted as their Rust struct (not a Value), so they\n // can neither be compared to Value::Null nor unwrapped with as_*().\n callExpressionName(node): string {\n const expression = node.expression;\n if (isIdentifier(expression)) return expression.text as string;\n if (isPropertyAccessExpression(expression)) return expression.name.text as string;\n return '';\n }\n\n // Does a string (literal text or literal-type value) parse as a number?\n // is_equal() coerces those against numeric/bool operands, a plain string\n // compare does not.\n textCoercesToNumber(text: string): boolean {\n return /^[+-]?(\\d+\\.?\\d*|\\.\\d+)([eE][+-]?\\d+)?$/.test(text) || /^[+-]?(inf|infinity|nan)$/i.test(text);\n }\n\n // f64 literal text for a numeric literal; undefined when it is not a Rust\n // decimal/float literal (hex/octal/binary fall back to the helper).\n numericLiteralF64Text(node): string {\n const text = node.text;\n if (text.startsWith('0x') || text.startsWith('0o') || text.startsWith('0b')) return undefined;\n if (text.startsWith('.')) return `0${text}`;\n if (text.includes('.') || text.includes('e') || text.includes('E')) return text;\n return `${text}.0`;\n }\n\n // The printer's own proof that a plain read prints as a Rust `Value`: `this.` (every\n // declared field is `Value`) or an identifier bound to a local/param (a local is narrowed to\n // `bool` only when every use is a condition sink — never an is_equal argument).\n rustReadPrintsValue(node): boolean {\n if (node === undefined) return false;\n if (node.kind === SyntaxKind.PropertyAccessExpression && node.expression.kind === SyntaxKind.ThisKeyword) return true;\n if (node.kind !== SyntaxKind.Identifier) return false;\n const symbol: any = this.getChecker().getSymbolAtLocation(node);\n const declarations: any[] = symbolDeclarations(symbol);\n if (declarations.length === 0) return false;\n return declarations.every((declaration) => isParameterDeclaration(declaration)\n || (isVariableDeclaration(declaration)\n && declaration.initializer?.kind !== SyntaxKind.NewExpression));\n }\n\n // Can the checked type only hold a Bool, Null/undefined or a non-numeric\n // string? Then `x.as_bool() == Some(b)` answers exactly what is_equal(x, b)\n // does: its f64 fallback (Str parse / Bool→0|1) can never fire.\n rustBooleanComparableType(type): boolean {\n if (type === undefined) return false;\n if (type.flags & TypeFlags.Union) {\n const members: any[] = typeParts(type) ?? [];\n return members.length > 0 && members.every((member) => this.rustBooleanComparableType(member));\n }\n if (type.flags & (TypeFlags.Boolean | TypeFlags.BooleanLiteral)) return true;\n if (type.flags & (TypeFlags.Undefined | TypeFlags.Null)) return true;\n if (type.flags & TypeFlags.StringLiteral) return !this.textCoercesToNumber(String((type as any).value ?? ''));\n return false;\n }\n\n // Native `==`/`!=` on the unwrapped payload when the checker proves the\n // Value variants line up; undefined keeps the is_equal() helper.\n printNativeEqualityComparison(left, right, op): string {\n const r09 = this.rustR09LengthEquality(left, right, op); if (r09 !== undefined) return r09;\n const r12 = this.rustR12NativeBoolEquality(left, right, op); if (r12 !== undefined) return r12;\n const r13 = this.printRustR13ProvenStrEquality(left, right, op); if (r13 !== undefined) return r13;\n const r20 = this.r20BoolCallEquality(left, right, op); if (r20 !== undefined) return r20;\n const operator = (op === SyntaxKind.EqualsEqualsToken || op === SyntaxKind.EqualsEqualsEqualsToken) ? '==' : '!=';\n const leftLiteral = this.literalKindOfNode(left);\n const rightLiteral = this.literalKindOfNode(right);\n if (leftLiteral !== undefined && rightLiteral !== undefined) return undefined;\n if (leftLiteral !== undefined || rightLiteral !== undefined) {\n const literal = leftLiteral !== undefined ? left : right;\n const literalKind = leftLiteral ?? rightLiteral;\n const other = leftLiteral !== undefined ? right : left;\n if (!this.printsValueExpression(other) && (literalKind !== 'null' || !this.rustReadPrintsValue(other))) return undefined;\n const otherType = this.getChecker().getTypeAtLocation(other);\n const otherKind = this.primitiveKindOfType(otherType);\n const typedStringLocal = this.rustStringLocalIdentifierIsTyped(other);\n if (literalKind === 'null') {\n // Exact for every runtime value: is_equal(x, null) is true only\n // when x is Null, and the derived PartialEq says the same.\n if (typedStringLocal) return `${this.printNode(other, 0)}.${operator === '==' ? 'is_none' : 'is_some'}()`;\n return `${this.printNode(other, 0)} ${operator} Value::Null`;\n }\n if (literalKind === 'string') {\n if (literal.text in this.StringLiteralReplacements) return undefined;\n if (this.textCoercesToNumber(literal.text) && otherKind !== 'string') return undefined;\n const accessor = typedStringLocal ? 'as_deref' : 'as_str';\n return `${this.printNode(other, 0)}.${accessor}() ${operator} Some(${this.quotedStringLiteral(literal.text)})`;\n }\n if (literalKind === 'number') {\n if (otherKind !== 'number') return undefined;\n const text = this.numericLiteralF64Text(literal);\n if (text === undefined) return undefined;\n return `${this.printNode(other, 0)}.as_f64() ${operator} Some(${text})`;\n }\n if (literalKind === 'boolean') {\n if (otherKind !== 'boolean' && !this.rustBooleanComparableType(otherType)) return undefined;\n const value = literal.kind === SyntaxKind.TrueKeyword ? 'true' : 'false';\n return `${this.printNode(other, 0)}.as_bool() ${operator} Some(${value})`;\n }\n return undefined;\n }\n if (!this.printsValueExpression(left) || !this.printsValueExpression(right)) return undefined;\n const leftKind = this.primitiveKindOfType(this.getChecker().getTypeAtLocation(left));\n const rightKind = this.primitiveKindOfType(this.getChecker().getTypeAtLocation(right));\n if (leftKind === undefined || leftKind !== rightKind) return undefined;\n const accessor = RustTranspiler.PAYLOAD_ACCESSORS[leftKind];\n return `${this.printNode(left, 0)}.${accessor}() ${operator} ${this.printNode(right, 0)}.${accessor}()`;\n }\n\n // ── checker-typed helper elimination ─────────────────────────────────\n // Each predicate proves a static TS shape for which the native Rust form\n // is exactly what the runtime helper computes; only then is the helper\n // call dropped, anything unproven keeps the helper.\n\n typeOfNodeIfAny(node: Node): Type | undefined {\n // A transpile without a program/checker (bare snippet) has no types.\n return this.checkerOrUndefined()?.getTypeAtLocation(node);\n }\n\n // Arrays/tuples/strings: `.length` is exactly what `Value::len()` returns.\n // Other shapes (Dict) keep the helper — ArrayCache / OrderBookSide markers\n // hold their length in the marker dict, which get_array_length unwraps.\n isValueLengthType(type: Type | undefined): boolean {\n if (type === undefined) return false;\n if (type.flags & TypeFlags.Union) {\n const parts: Type[] = typeParts(type) ?? [];\n return parts.length > 0 && parts.every((part) => this.isValueLengthType(part));\n }\n // A `null`/`undefined` member boxes as `Value::Null`, whose `len()` is\n // the same number the helper's fallthrough returns for it.\n return (type.flags & (TypeFlags.Undefined | TypeFlags.Null | TypeFlags.Void)) !== 0\n || this.getChecker().isArrayType(type)\n || this.getChecker().isTupleType(type)\n || this.isStringType(type.flags);\n }\n\n printArrayLength(node, identation, leftExpr = undefined) {\n const receiver = leftExpr ?? this.printNode(node.expression, 0);\n if (!this.rustIsOrderBookSide(node.expression) && this.isValueLengthType(this.typeOfNodeIfAny(node.expression))) return `Value::Int(${receiver}.len() as i64)`;\n if (this.r11ProvenListValue(node.expression)) return `${receiver}.as_array().map_or(Value::Int(0), |__a| Value::Int(__a.len() as i64))`;\n return this.r18ArrLength(node, receiver) ?? `get_array_length(&${receiver})`;\n }\n\n /** `orderbook['bids']` / `orderbook.asks` on an `OrderBook`-typed receiver, or a\n * local initialised from one. The WS runtime keeps those sides as marker dicts\n * whose levels live in the side store, so only `get_array_length` / `get_value`\n * reach them — the checker's array type is not the runtime shape. */\n rustIsOrderBookSide(node: Node, depth = 0): boolean {\n const stripped = this.rustStripWrappers(node);\n if (stripped === undefined || depth > 4) return false;\n if (isIdentifier(stripped)) {\n const declaration = this.rustSingleLocalDeclaration(stripped);\n return declaration !== undefined && isVariableDeclaration(declaration)\n && this.rustIsOrderBookSide(declaration.initializer, depth + 1);\n }\n let receiver: Node | undefined;\n let key: string | undefined;\n if (isElementAccessExpression(stripped) && isStringLiteralLikeNode(stripped.argumentExpression)) {\n receiver = stripped.expression;\n key = stripped.argumentExpression.text;\n } else if (isPropertyAccessExpression(stripped)) {\n receiver = stripped.expression;\n key = String(stripped.name.text);\n }\n if (receiver === undefined || (key !== 'bids' && key !== 'asks')) return false;\n const symbol = (this.typeOfNodeIfAny(receiver) as any)?.getSymbol?.();\n return symbol !== undefined && /^(Indexed|Counted)?OrderBook$/.test(symbol.name);\n }\n\n // Native string search / slicing: `x.indexOf(y)` and `x.slice(a, b)` on a checker-proven\n // string receiver print native `str` code. The receiver is a `Value`, so the payload is reached\n // via `as_str()`; a `Value::Null` receiver takes the helper's `-1` / `Value::Null` branch.\n\n /** Literal integer bound of a `slice` call (`3`, `-64`), else undefined. */\n rustSliceLiteralBound(node): number | undefined {\n if (node === undefined) return undefined;\n if (isNumericLiteral(node)) {\n const value = Number(node.text);\n return Number.isSafeInteger(value) ? value : undefined;\n }\n if (isPrefixUnaryExpression(node) && node.operator === SyntaxKind.MinusToken &&\n isNumericLiteral(node.operand)) {\n const value = Number(node.operand.text);\n return Number.isSafeInteger(value) ? -value : undefined;\n }\n return undefined;\n }\n\n // `slice` clamps like JS: a non-negative bound is capped at the length, a\n // negative one counts from the end and is floored at 0.\n rustSliceClampedIndex(value: number): string {\n return value < 0 ? `(__l - ${-value}).max(0)` : `__l.min(${value})`;\n }\n\n // `x.indexOf(\"lit\")` on a proven string receiver: `str::find` is exactly\n // the helper's `Value::Str` arm (byte index, `-1` when absent).\n printNativeStringIndexOf(node, receiverText: string): string | undefined {\n if (node === undefined || !isCallExpression(node) ||\n !isPropertyAccessExpression(node.expression) || node.arguments?.length !== 1) {\n return undefined;\n }\n if (this.primitiveKindOfType(this.typeOfNodeIfAny(node.expression.expression)) !== 'string') return undefined;\n const needle = node.arguments[0];\n if (!isStringLiteral(needle) && !isNoSubstitutionTemplateLiteral(needle)) return undefined;\n if (typeof receiverText !== 'string' || receiverText.includes('\\n')) return undefined;\n const literal = this.escapeRustStringLiteral(needle.text);\n return `Value::Int(${receiverText}.as_str().and_then(|__s| __s.find(\"${literal}\")).map(|__i| __i as i64).unwrap_or(-1))`;\n }\n\n // `x.slice(a)` / `x.slice(a, b)` with literal bounds on a proven string\n // receiver: the helper's char-vector clamps are inlined, so the emission\n // returns the same string (and `Value::Null` for a null receiver).\n printNativeStringSlice(node, receiverText: string): string | undefined {\n if (node === undefined || !isCallExpression(node) ||\n !isPropertyAccessExpression(node.expression)) {\n return undefined;\n }\n const args = node.arguments ?? [];\n if (args.length === 0 || args.length > 2) return undefined;\n if (this.primitiveKindOfType(this.typeOfNodeIfAny(node.expression.expression)) !== 'string') return undefined;\n if (typeof receiverText !== 'string' || receiverText.includes('\\n')) return undefined;\n const start = this.rustSliceLiteralBound(args[0]);\n if (start === undefined) return undefined;\n let end = '__l';\n if (args[1] !== undefined && args[1].kind !== SyntaxKind.NullKeyword && args[1].kind !== SyntaxKind.UndefinedKeyword) {\n const bound = this.rustSliceLiteralBound(args[1]);\n if (bound === undefined) return undefined;\n end = this.rustSliceClampedIndex(bound);\n }\n const begin = this.rustSliceClampedIndex(start);\n return `${receiverText}.as_str().map(|__s| { let __c: Vec = __s.chars().collect();` +\n ` let __l = __c.len() as i64; let __i = ${begin}; let __j = ${end};` +\n ` if __i <= __j { __c[__i as usize..__j as usize].iter().collect::() } else { String::new() } })` +\n `.map(|__s| Value::Str(__s.into())).unwrap_or(Value::Null)`;\n }\n\n // Native value predicates (`Array.isArray` / `typeof … === '…'`): each runtime predicate is a\n // single `matches!` over the `Value` variants, so on a declared `Value` place the call is\n // replaced by that same match — no helper call, operand still read exactly once.\n\n // `matches!` pattern of the runtime predicate, keyed by the `typeof` word.\n private static readonly RUST_TYPE_PREDICATE_PATTERNS: { [key: string]: string } = {\n 'array': 'Value::Arr(_)',\n 'string': 'Value::Str(_)',\n 'number': 'Value::Int(_) | Value::Float(_)',\n 'boolean': 'Value::Bool(_)',\n 'object': 'Value::Dict(_)',\n };\n\n // An identifier bound by a local/param declaration: the printer declares\n // every one of them as `Value`. Imports, classes and function names print\n // as Rust items rather than as values, so they keep the helper.\n isDeclaredValueIdentifier(node): boolean {\n const declarations = symbolDeclarations((this.getChecker() as any).getSymbolAtLocation(node));\n return declarations.length > 0 && declarations.every((d) =>\n isVariableDeclaration(d) || isParameterDeclaration(d) || isBindingElement(d));\n }\n\n // A declared `Value` place: a local/param identifier, or a field/element\n // access rooted at `this` or at such an identifier. Those are the operands\n // whose printed text the helper already borrows as a `Value`.\n isDeclaredValuePlace(node): boolean {\n const inner = this.unwrapParens(node);\n if (inner !== undefined && isIdentifier(inner)) {\n return this.isDeclaredValueIdentifier(inner);\n }\n if (inner !== undefined && (isPropertyAccessExpression(inner) || isElementAccessExpression(inner))) {\n const root = this.unwrapParens(this.valuePlaceRoot(inner));\n return root !== undefined &&\n (root.kind === SyntaxKind.ThisKeyword || this.isDeclaredValueIdentifier(root));\n }\n return false;\n }\n\n valuePlaceRoot(node): any {\n let current: any = node;\n while (isPropertyAccessExpression(current) || isElementAccessExpression(current)) {\n current = current.expression;\n }\n return current;\n }\n\n nativeValuePredicateText(kind: string, operandNode, printedOperand: string): string | undefined {\n const pattern = RustTranspiler.RUST_TYPE_PREDICATE_PATTERNS[kind];\n if (pattern === undefined || operandNode === undefined || printedOperand === undefined ||\n !this.isDeclaredValuePlace(operandNode)) {\n return undefined;\n }\n return `matches!(${this.ensureRef(printedOperand)}, ${pattern})`;\n }\n\n // Object-typed values are Dicts at runtime, so `key in obj` is a plain\n // key lookup. Arrays keep the helper: `in_op` searches them element-wise.\n // A `Dict`/`Dictionary` receiver is a Reference to its index-signature\n // interface, so the class/lib guards — not the Reference flag — decide it.\n isDictShapedType(type: Type | undefined): boolean {\n if (type === undefined) return false;\n if (type.flags & TypeFlags.Union) {\n // `Market | undefined` style aliases: a nullish member carries no\n // value, so only the value-carrying members have to be dict-shaped.\n // `in_op` and the native insert both answer false / no-op on Null.\n const parts: Type[] = typeParts(type) ?? [];\n const valueParts = parts.filter((part) => !this.rustTypeIsNullish(part));\n return parts.length > valueParts.length && valueParts.length > 0\n && valueParts.every((part) => this.isDictShapedType(part));\n }\n const checker = this.getChecker();\n if (!(type.flags & TypeFlags.Object) || type.getCallSignatures().length !== 0\n || checker.isArrayType(type) || checker.isTupleType(type) || checker.isArrayLikeType(type)) {\n return false;\n }\n return !this.isClassInstanceType(type) && !this.isLibDeclaredType(type);\n }\n\n // `\"key\" in obj` → `matches!(&obj, Value::Dict(__d) if __d.contains_key(\"key\"))`\n // In the TS AST `key` is the left operand and `obj` the right one.\n printNativeInOperator(key, obj) {\n if (!isStringLiteral(key) || !this.isDictShapedType(this.typeOfNodeIfAny(obj))) {\n return undefined;\n }\n const keyLiteral = this.rustStringLiteralOf(this.printStringLiteral(key));\n if (keyLiteral === undefined) {\n return undefined;\n }\n const objExpr = this.printNode(obj, 0);\n return `Value::Bool(matches!(&${objExpr}, Value::Dict(__d) if __d.contains_key(${keyLiteral})))`;\n }\n\n // The Rust string literal behind a printed TS string literal — the boxed\n // shapes the printer emits today (`Value::Str(\"k\".to_string())`,\n // `Value::from(\"k\")`) plus a bare `\"k\"` once an arg-shape unit drops the box.\n rustStringLiteralOf(printedKey: string): string | undefined {\n const boxed = printedKey.match(/^(?:Value::Str|Value::from)\\((.+)\\)$/);\n const literal = (boxed ? boxed[1].replace(/\\.(?:to_string|into)\\(\\)$/, '') : printedKey).trim();\n return /^\"(?:[^\"\\\\]|\\\\.)*\"$/.test(literal) ? literal : undefined;\n }\n\n // `X[\"k\"] = v` on a checker-proven plain Dict receiver: mutate the Dict\n // natively. The helper's tag hooks (book meta, ws subscriptions, cache\n // hashmap) only fire on tagged dicts, which a plain object type never is.\n printNativeDictInsert(baseExpr, keyNode, keyText, valueText): string | undefined {\n const receiver = this.rustNativeInsertReceiver(baseExpr);\n if (receiver === undefined || !this.rustReceiverStaysDict(baseExpr, receiver)) {\n return undefined;\n }\n // A bucket read off `cache.hashmap` / client `subscriptions`/`futures` carries a runtime\n // backref: only the helper writes through to the shared store, so keep it.\n if (!receiver.isField && this.rustLocalInitReadsTaggedContainer(baseExpr)) {\n return undefined;\n }\n const keyArg = this.rustNativeInsertKeyArg(receiver, keyNode, keyText);\n if (keyArg === undefined) {\n return undefined;\n }\n const name = receiver.text;\n const value = this.rustPrintedBoolArg(valueText) ? `Value::Bool(${valueText})` : valueText;\n const insert = (val: string) =>\n `if let Value::Dict(__d) = &mut ${name} { std::sync::Arc::make_mut(__d).insert(${keyArg}, ${val}); }`;\n // Any mention of the receiver in the value operand reads it while the\n // write holds the `&mut` — ccxt's splitAddElementBorrowConflicts pass\n // hoists on the same signal, so mirror it with a temp binding.\n const readsReceiver = receiver.isField ? /\\bself\\b/.test(value) : new RegExp(`\\\\b${name}\\\\b`).test(value);\n if (readsReceiver) {\n return `{ let __be_tmp = ${value}; ${insert('__be_tmp')} }`;\n }\n const trimmed = value.trim();\n if (/^[a-zA-Z_][a-zA-Z0-9_]*$/.test(trimmed) && trimmed !== 'self'\n && trimmed !== 'true' && trimmed !== 'false') {\n return insert(`${trimmed}.clone()`);\n }\n return insert(value);\n }\n\n /** The `insert` key argument. A literal becomes `\"k\".into()`; a proven\n * string place becomes `crate::runtime::stringify_param(&k)` — the exact\n * conversion the helper's dict branch applies to a non-string key, and\n * `k.to_string()` for a string one. */\n rustNativeInsertKeyArg(receiver, keyNode, keyText: string): string | undefined {\n if (isStringLiteral(keyNode)) {\n // A book-meta key can only reach the store through a `__book_id`:\n // provable only for receivers the transpiler itself built as plain\n // maps or the hand-written base never tags (fields).\n if (RustTranspiler.RUST_BOOK_META_KEYS.has(keyNode.text) && !receiver.plain) {\n return undefined;\n }\n const keyLiteral = keyText.match(/^Value::Str\\((.+)\\.(?:to_string|into)\\(\\)\\)$/);\n return keyLiteral === null ? undefined : `${keyLiteral[1]}.into()`;\n }\n // Dynamic key: a plain place, never one that reads the receiver (the\n // insert holds its `&mut`). Every other key shape keeps the helper.\n const key = keyText.trim();\n if (!/^[A-Za-z_][A-Za-z0-9_]*$/.test(key)\n || (receiver.isField ? key.includes('self') : new RegExp(`\\\\b${receiver.text}\\\\b`).test(key))) {\n return undefined;\n }\n return `crate::runtime::stringify_param(&${key})`;\n }\n\n // Receivers this unit may write natively: any local whose every path builds\n // a plain `Value::Map` (name-independent — rust-13's four names are the\n // batch-A subset of this proof), any parameter the checker proves is a\n rustNativeInsertReceiver(expr): { text: string, isField: boolean, plain: boolean, nameNode: any } | undefined {\n if (isIdentifier(expr)) {\n const plain = this.rustInsertIdentifierReceiver(expr);\n return plain === undefined ? undefined : { text: expr.text, isField: false, plain, nameNode: expr };\n }\n if (isPropertyAccessExpression(expr) && expr.expression.kind === SyntaxKind.ThisKeyword\n && expr.name?.kind === SyntaxKind.Identifier) {\n return {\n text: `self.${expr.name.text}`, isField: true,\n plain: RustTranspiler.RUST_PLAIN_DICT_FIELDS.has(expr.name.text),\n nameNode: expr.name,\n };\n }\n return undefined;\n }\n\n /** Element-write receiver proof for a local: the batch-A names (rust-13,\n * `plain: false` — the whitelist is not a construction proof) or, for any\n * other name, the dict-shape proof plus a plain-`Value::Map` build on\n * every path (rust-12's proof, read off the checker), or a parameter whose\n * annotation proves a plain dict and whose writes keep that shape. The\n * returned flag is the *by-construction* plainness (literal-init locals,\n * handler tuples, hand-written plain fields) that a book-meta key needs. */\n rustInsertIdentifierReceiver(ident): boolean | undefined {\n const declaration = this.rustSingleLocalDeclaration(ident);\n if (declaration !== undefined && isParameterDeclaration(declaration as any)) {\n // A default value (`params: Dict = {}`) keeps the pre-unit\n // initializer proof — `rustReceiverStaysDict` runs both it and the\n // annotation proof and rejects the site when neither holds.\n if (this.rustParamStaysPlainDict(declaration as ParameterDeclaration)\n || (declaration as ParameterDeclaration).initializer !== undefined) {\n return false;\n }\n } else if (declaration !== undefined && isVariableDeclaration(declaration as any)) {\n if (this.rustInsertReceiverBuildsPlainDict(declaration as VariableDeclaration)) {\n return true;\n }\n // A local the declared-Dict table proves holds a Dict at every use\n // (alwaysDict && stable): the helper's non-dict branches are dead,\n // so only the tag hooks and the insert remain — the key rules of\n if (this.rustDeclaredLocalEntry(ident) !== undefined\n && this.rustDeclaredInitIsTagFree(declaration as VariableDeclaration)) {\n return false;\n }\n }\n if (RustTranspiler.RUST_NATIVE_INSERT_RECEIVERS.has(ident.text)) {\n return false; // rust-13 whitelist: not a construction proof\n }\n return undefined;\n }\n\n /** A literal initializer must carry no runtime tag key; a call initializer\n * is the axiom the declared-Dict table itself rests on. */\n rustDeclaredInitIsTagFree(declaration: VariableDeclaration): boolean {\n const init = this.rustStripWrappers(declaration.initializer);\n return init === undefined || !isObjectLiteralExpression(init) || this.rustPlainDictLiteral(init);\n }\n\n /** Skip `( … )`, `x!` and `x as T` wrappers. */\n rustStripWrappers(node: any): any {\n while (node !== undefined && (isParenthesizedExpression(node) || isNonNullExpression(node) || isAsExpression(node))) {\n node = node.expression;\n }\n return node;\n }\n\n /** The local's single declaration is initialised from a call that reads\n * `x.hashmap` / `x.subscriptions` / `x.futures` — element dicts the runtime\n * tags with a backref so writes reach the shared store, not the COW copy. */\n rustLocalInitReadsTaggedContainer(ident: Identifier): boolean {\n const declaration = this.rustSingleLocalDeclaration(ident);\n if (declaration === undefined || !isVariableDeclaration(declaration)) {\n return false;\n }\n const init = this.rustStripWrappers(declaration.initializer);\n return init !== undefined && isCallExpression(init) && init.arguments.some((arg) => {\n const n = this.rustStripWrappers(arg);\n return n !== undefined && isPropertyAccessExpression(n)\n && RustTranspiler.RUST_TAGGED_CONTAINER_FIELDS.has(n.name.text);\n });\n }\n\n static readonly RUST_TAGGED_CONTAINER_FIELDS = new Set([ 'hashmap', 'subscriptions', 'futures' ]);\n\n /** True when every value the local can hold comes from an object literal:\n * the runtime tags a dict (`__book_id`, `__ws_subs_url`, `__ws_sub_ref`,\n * `__cache_backref`) only on handles its own store builds, so the helper's\n * write-through branches are provably dead and `insert` is the whole\n * helper. A `[ x, params ] = this.handle…(…)` tuple re-assigns the\n * hand-written handler's own dict arguments. */\n rustInsertReceiverBuildsPlainDict(declaration: VariableDeclaration): boolean {\n const name = String((declaration.name as Identifier).text);\n const scope = this.rustEnclosingFunction(declaration);\n if (!this.rustPlainDictLiteral(declaration.initializer) || scope === undefined) {\n return false;\n }\n const declarationSymbol = this.rustSymbolOf(declaration.name as Identifier);\n let plain = true;\n this.rustWalkScope(scope, (n) => {\n if (!plain || !isBinaryExpression(n) || n.operatorToken.kind !== SyntaxKind.EqualsToken) {\n return;\n }\n const left: any = n.left;\n if (isIdentifier(left) && String(left.text) === name\n && (declarationSymbol === undefined || this.rustSymbolOf(left) === declarationSymbol)) {\n plain = this.rustPlainDictLiteral(n.right) || this.rustTypeIsUndefinedish(n.right);\n } else if (isArrayLiteralExpression(left)\n && left.elements.some((e) => isIdentifier(e) && String(e.text) === name)) {\n plain = this.rustHandlerTupleCall(n.right);\n }\n });\n return plain;\n }\n\n /** An object literal with no runtime tag key — the transpiler built it, so\n * it is a fresh plain `Value::Map` on every path. */\n rustPlainDictLiteral(node: Node | undefined): boolean {\n if (node !== undefined && isParenthesizedExpression(node)) {\n return this.rustPlainDictLiteral(node.expression);\n }\n return node !== undefined && isObjectLiteralExpression(node) && node.properties.every((property: any) => {\n const key = property.name;\n if (key === undefined) {\n return false;\n }\n const text = isStringLiteral(key) ? key.text\n : (isIdentifier(key) ? String(key.text) : undefined);\n return text === undefined || !text.startsWith('__');\n });\n }\n\n /** `this.handle…(…)` — the hand-written `handle*AndParams` / `handleUntil…`\n * family; each returns its own request/params dict arguments. */\n rustHandlerTupleCall(node: Node | undefined): boolean {\n const callee: any = node !== undefined && isCallExpression(node) ? node.expression : undefined;\n return callee !== undefined && isPropertyAccessExpression(callee) && callee.expression.kind === SyntaxKind.ThisKeyword\n && callee.name?.kind === SyntaxKind.Identifier && /^handle[A-Z]/.test(callee.name.text);\n }\n\n /** A `null`/`undefined` write leaves the receiver a non-dict, which the\n * emitted `if let Value::Dict` no-ops exactly like the helper. */\n private rustTypeIsUndefinedish(node: Node): boolean {\n if (node.kind === SyntaxKind.NullKeyword || (isIdentifier(node) && node.text === 'undefined')) {\n return true;\n }\n const type = this.typeOfNodeIfAny(node);\n return type !== undefined && (type.flags & (TypeFlags.Undefined | TypeFlags.Null | TypeFlags.Void)) !== 0;\n }\n\n /** The single variable declaration a local identifier binds to, or\n * undefined when the checker cannot answer / the binding is not a local. */\n rustSingleLocalDeclaration(ident: Identifier): VariableDeclaration | ParameterDeclaration | undefined {\n const checker: any = this.checkerOrUndefined();\n if (checker === undefined) {\n return undefined;\n }\n const declarations = symbolDeclarations(checker.getSymbolAtLocation(ident));\n const declaration: any = declarations.length === 1 ? declarations[0] : undefined;\n return declaration !== undefined && (isVariableDeclaration(declaration) || isParameterDeclaration(declaration))\n ? declaration : undefined;\n }\n\n // Dict-shape proof for a write receiver: an object type with no class, array or callable shape\n // — `Dictionary` instantiations count (they resolve to their interface target). A union keeps\n // the proof when every member is a Dict or `undefined` (both untaggable at runtime).\n rustWriteDictShape(type): boolean {\n if (type === undefined) return false;\n if (type.flags & TypeFlags.Union) {\n const parts: any[] = typeParts(type) ?? [];\n return parts.length > 0 && parts.every((part) => this.rustWriteDictShape(part));\n }\n if (type.flags & (TypeFlags.Undefined | TypeFlags.Void)) {\n return true;\n }\n const checker = this.getChecker();\n if (!(type.flags & TypeFlags.Object)\n || checker.isArrayType(type) || checker.isTupleType(type) || checker.isArrayLikeType(type)\n || ((typeTarget(type) ?? type as any).objectFlags & ObjectFlags.Class)) {\n return false;\n }\n return type.getCallSignatures().length === 0 && type.getConstructSignatures().length === 0;\n }\n\n // The receiver is a plain Dict on every path: its declared/initializer type is object-shaped\n // (never a class or array handle), its initializer is not an element read (the get_value COW\n // write-back pass keys on the `&mut ` text), and no write in scope assigns another shape.\n rustReceiverStaysDict(baseExpr, receiver): boolean {\n if (receiver.isField) {\n return this.rustFieldStaysDict(baseExpr, receiver.nameNode.text);\n }\n const ident = baseExpr;\n const declaration: any = this.rustSingleLocalDeclaration(ident);\n if (declaration === undefined) {\n return false;\n }\n // The declared-Dict table is its own proof (alwaysDict && stable, D2):\n // a table local the checker cannot type (an untyped `safe_dict*`\n // default) still stays a Dict at every use.\n if (this.rustDeclaredLocalEntry(ident) !== undefined) {\n return true;\n }\n // A parameter with a default carries the transpiler's own initializer,\n // so it keeps the pre-unit proof; without one only the annotation proof\n // (`Dict`-style params — the B-25 read family) can admit it.\n if (isParameterDeclaration(declaration) && this.rustParamStaysPlainDict(declaration)) {\n return true;\n }\n const name = ident.text;\n const initializer = declaration.initializer;\n const scope = this.rustEnclosingFunction(declaration);\n if (initializer === undefined || isElementAccessExpression(initializer)\n || declaration.name?.kind !== SyntaxKind.Identifier || scope === undefined) {\n return false;\n }\n let safe = this.rustWriteDictShape(this.typeOfNodeIfAny(ident))\n && this.rustWriteDictShape(this.typeOfNodeIfAny(initializer));\n this.rustWalkScope(scope, (n) => {\n if (n !== declaration && this.rustBindsName(n, name)) {\n safe = false; // a second binding of the name in scope — stay boxed\n return RUST_WALK_STOP;\n }\n if (isBinaryExpression(n) && n.operatorToken.kind === SyntaxKind.EqualsToken\n && isIdentifier(n.left) && n.left.text === name\n && !this.rustWriteDictShape(this.typeOfNodeIfAny(n.right))) {\n safe = false;\n return RUST_WALK_STOP;\n }\n });\n return safe;\n }\n\n // `this.` receivers: the field is a plain dict (object-shaped checker type, or held as one\n // by the hand-written base when the TS declaration is `any`) and no `this. = …` in the\n // method assigns another shape. Handle fields (cache/client/subscriptions/order book) are excluded.\n rustFieldStaysDict(baseExpr, fieldName: string): boolean {\n if (RustTranspiler.RUST_TAGGED_HANDLE_FIELDS.has(fieldName)\n || (!this.rustWriteDictShape(this.typeOfNodeIfAny(baseExpr))\n && !RustTranspiler.RUST_PLAIN_DICT_FIELDS.has(fieldName))) {\n return false;\n }\n const scope = this.rustEnclosingFunction(baseExpr);\n if (scope === undefined) {\n return false;\n }\n let safe = true;\n this.rustWalkScope(scope, (n) => {\n if (isBinaryExpression(n) && n.operatorToken.kind === SyntaxKind.EqualsToken\n && isPropertyAccessExpression(n.left) && n.left.expression.kind === SyntaxKind.ThisKeyword\n && n.left.name?.text === fieldName\n && !this.rustWriteDictShape(this.typeOfNodeIfAny(n.right))) {\n safe = false;\n return RUST_WALK_STOP;\n }\n });\n return safe;\n }\n\n // A parameter the checker proves is a plain dict (`Dict`, `Dictionary`,\n // a `Market`-style alias — the proof B-25's native reads use) whose every\n // write in the body keeps that shape: an object literal with no runtime tag\n rustParamStaysPlainDict(declaration: ParameterDeclaration): boolean {\n if (declaration.type === undefined || declaration.name?.kind !== SyntaxKind.Identifier) {\n return false;\n }\n const type = this.getCheckedTypeOf(declaration.type);\n const scope = this.rustEnclosingFunction(declaration);\n if (type === undefined || !this.isProvenMapType(type) || scope === undefined) {\n return false;\n }\n const name = String((declaration.name as Identifier).text);\n let plain = true;\n this.rustWalkScope(scope, (n) => {\n if (isBinaryExpression(n) && rustIsAssignmentOperator(n.operatorToken.kind)\n && isIdentifier(n.left) && n.left.text === name\n && !this.rustPlainDictPreservingRhs(n.right, name)) {\n plain = false;\n return RUST_WALK_STOP;\n }\n if (isBinaryExpression(n) && n.operatorToken.kind === SyntaxKind.EqualsToken\n && isArrayLiteralExpression(n.left)\n && n.left.elements.some((e) => isIdentifier(e) && String((e as Identifier).text) === name)\n && !this.rustHandlerTupleCall(n.right)) {\n plain = false; // a tuple write keeps only the handle-arg family\n return RUST_WALK_STOP;\n }\n });\n return plain;\n }\n\n /** RHS of a write to a plain-dict parameter that keeps the shape. */\n rustPlainDictPreservingRhs(node: Node, name: string): boolean {\n // `this.handle…(…)` returns its own dict arguments (rust-12's proof).\n if (this.rustPlainDictLiteral(node) || this.rustTypeIsUndefinedish(node)\n || (isIdentifier(node) && node.text === name) || this.rustHandlerTupleCall(node)) {\n return true;\n }\n if (isParenthesizedExpression(node) || isNonNullExpression(node) || isAsExpression(node)) {\n return this.rustPlainDictPreservingRhs(node.expression, name);\n }\n if (isConditionalExpression(node)) {\n return this.rustPlainDictPreservingRhs(node.whenTrue, name)\n && this.rustPlainDictPreservingRhs(node.whenFalse, name);\n }\n if (isBinaryExpression(node)\n && (node.operatorToken.kind === SyntaxKind.BarBarToken\n || node.operatorToken.kind === SyntaxKind.QuestionQuestionToken)) {\n return this.rustPlainDictPreservingRhs(node.left, name)\n && this.rustPlainDictPreservingRhs(node.right, name);\n }\n return false;\n }\n\n // Conservative \"argument position expects a Value\" bool test — the same set\n // ccxt's wrapBoolValueArgs pass uses on the helper call's value operand.\n rustPrintedBoolArg(raw: string): boolean {\n let s = raw.trim();\n while (s.startsWith('(') && s.endsWith(')')) {\n let depth = 0;\n let balanced = true;\n for (let k = 0; k < s.length; k++) {\n if (s[k] === '(') depth++;\n else if (s[k] === ')') { depth--; if (depth === 0 && k < s.length - 1) { balanced = false; break; } }\n }\n if (!balanced || depth !== 0) break;\n s = s.slice(1, -1).trim();\n }\n if (s.startsWith('!')) s = s.slice(1).trim();\n return RustTranspiler.RUST_BOOL_VALUE_HELPERS.some(fn => s.startsWith(fn + '('));\n }\n\n // `negate(&Value::Int(n))` is `Value::Int(-n)` (same for Float) — fold the\n // literal so no helper call is needed. Runtime `negate` also coerces\n // strings/bools/floats, so only Int/Float literals can be folded.\n foldNegateLiteral(operandText: string): string | undefined {\n const match = operandText.match(/^Value::(Int|Float)\\((-?)(\\d[\\d_]*(?:\\.\\d+)?(?:[eE][+-]?\\d+)?)\\)$/);\n // leave big literals to the runtime helper\n if (!match || match[3].replaceAll('_', '').replace('.', '').length > 18) {\n return undefined;\n }\n const sign = match[2] === '-' ? '' : '-';\n return `Value::${match[1]}(${sign}${match[3]})`;\n }\n\n // Ensure a & ref prefix — skip only if already a reference\n ensureRef(expr: string): string {\n return expr.startsWith('&') ? expr : `&${expr}`;\n }\n\n // TS `number` / number-literal type proof for a comparison operand. Unions\n // (`number | undefined`) and `any` are rejected — those keep the helper.\n isNumberTyped(node) {\n const type = this.getChecker().getTypeAtLocation(node);\n return type !== undefined && (type.flags & (TypeFlags.Number | TypeFlags.NumberLiteral)) !== 0;\n }\n\n // Positions whose emitted Rust is a native `bool`: if/while/do/for\n // conditions, `? :` conditions, `!` operands and `&&` / `||` operands.\n // Parentheses are transparent.\n isBooleanPosition(node) {\n let current = node;\n let parent = current.parent;\n while (parent !== undefined && isParenthesizedExpression(parent)) {\n current = parent;\n parent = parent.parent;\n }\n if (parent === undefined) {\n return false;\n }\n switch (parent.kind) {\n case SyntaxKind.IfStatement:\n case SyntaxKind.WhileStatement:\n case SyntaxKind.DoStatement:\n return parent.expression === current;\n case SyntaxKind.ForStatement:\n case SyntaxKind.ConditionalExpression:\n return parent.condition === current;\n case SyntaxKind.PrefixUnaryExpression:\n return parent.operator === SyntaxKind.ExclamationToken;\n case SyntaxKind.BinaryExpression:\n return parent.operatorToken.kind === SyntaxKind.AmpersandAmpersandToken ||\n parent.operatorToken.kind === SyntaxKind.BarBarToken;\n }\n return false;\n }\n\n // `is_less_than` & co. compare two `Value`s and answer `false` for\n // non-numbers; with both operands checker-typed numbers the same f64\n // comparison runs natively on `Value::as_f64()` unwraps.\n printNativeNumericComparison(node, operator, leftText, rightText) {\n const unwrap = (text: string) => `${text}.as_f64().unwrap_or(f64::NAN)`;\n const comparison = `${unwrap(leftText)} ${operator} ${unwrap(rightText)}`;\n // Conditions/logical operands already expect a bool; every other\n // position stores the result in a `Value`, so box it as before.\n return this.isBooleanPosition(node) ? comparison : `Value::Bool(${comparison})`;\n }\n\n // How numeric an ordered-comparison operand is: 'definite' (numeric\n // literal / `.length` / `indexOf` — Int/Float at runtime, never Null),\n // 'number' (checker-typed — Int, Float or Null, never a string), undefined.\n rustNumericOperandKind(node): string | undefined {\n const inner = this.orderedComparisonOperand(node);\n // `.length` prints through printArrayLength (`Value::Int(len)` or `get_array_length`),\n // `.indexOf(x)` through printIndexOfCall (`get_index_of`): always `Value::Int`.\n if (inner.kind === SyntaxKind.NumericLiteral\n || (isPropertyAccessExpression(inner) && inner.name.text === 'length')\n || (inner.kind === SyntaxKind.CallExpression && this.callExpressionName(inner) === 'indexOf')) {\n return 'definite';\n }\n return this.isNumberTyped(node) ? 'number' : undefined;\n }\n\n // Parens and `x as T` print as the operand itself (printAsExpression drops\n // the assertion), so the operand's own shape drives the emission.\n orderedComparisonOperand(node) {\n let inner = node;\n while (inner !== undefined && (isParenthesizedExpression(inner) || isAsExpression(inner))) {\n inner = inner.expression;\n }\n return inner;\n }\n\n // Native text for an `is_less_than`-family call, undefined unless the\n // operands prove the helper's answer: one number pins `<`/`>`; `>=`/`<=`\n // OR `is_equal` in (TRUE for two Nulls) and need a 'definite' operand.\n printNativeOrderedComparison(node, op, left, right): string | undefined {\n const operator = RustTranspiler.NATIVE_COMPARISON_OPERATORS[op];\n if (operator === undefined || !this.printsValueExpression(this.orderedComparisonOperand(left)) ||\n !this.printsValueExpression(this.orderedComparisonOperand(right))) {\n return undefined;\n }\n const leftKind = this.rustNumericOperandKind(left);\n const rightKind = this.rustNumericOperandKind(right);\n const ordered = op === SyntaxKind.LessThanToken || op === SyntaxKind.GreaterThanToken;\n const proven = leftKind === 'definite' || rightKind === 'definite' ||\n (ordered\n ? (leftKind !== undefined || rightKind !== undefined)\n : (leftKind === 'number' && rightKind === 'number'));\n if (!proven && !this.rustR16OrderedProven(op, left, right)) {\n return this.r22StrOrderedComparison(node, op, left, right) ?? this.r25NativeLooseOrderedComparison(node, op, left, right);\n }\n return this.printNativeNumericComparison(node, operator, this.printNode(left, 0), this.printNode(right, 0));\n }\n\n // ── native arithmetic (`+ - * /`) ────────────────────────────────────────\n // When the checker proves both operands are numbers (`Int`/`Float` at\n // runtime) or that one is always a string and the other a string or the\n // null the helper stringifies the same way, the helper call is replaced by\n // the arithmetic itself: a 4-arm `Value` match reproducing the helper's\n // Int/Float dispatch, `as_f64()` division, or a `format!` string concat.\n // Anything the checker cannot prove keeps the runtime helper.\n\n // `type` (or every member of a non-empty union) has exactly one of `flags`.\n rustTypeFlagsAll(type: any, flags: Set): boolean {\n if (!type) {\n return false;\n }\n if (type.flags === TypeFlags.Union && Array.isArray(typeParts(type))) {\n return typeParts(type).length > 0 && typeParts(type).every((member: any) => this.rustTypeFlagsAll(member, flags));\n }\n return flags.has(type.flags);\n }\n\n isNumberLikeType(type: any): boolean {\n return this.rustTypeFlagsAll(type, new Set([ TypeFlags.Number, TypeFlags.NumberLiteral ]));\n }\n\n isStringLikeType(type: any): boolean {\n return this.rustTypeFlagsAll(type, new Set([ TypeFlags.String, TypeFlags.StringLiteral ]));\n }\n\n // Types whose runtime value the `add` helper stringifies exactly as `format!` does: a string,\n // or `undefined`/`null` boxed as `Value::Null` (`stringify_simple(Value::Null)` and `Display`\n // both give \"null\"). `any` is absent — the Precise-dict branch has no `Display` equivalent.\n private static readonly RUST_CONCAT_SAFE_FLAGS = new Set([\n TypeFlags.String,\n TypeFlags.StringLiteral,\n TypeFlags.Undefined,\n TypeFlags.Null,\n ]);\n\n isStringOrNullishType(type: any): boolean {\n return this.rustTypeFlagsAll(type, RustTranspiler.RUST_CONCAT_SAFE_FLAGS);\n }\n\n // `Str` (`string | undefined`) operands concatenate natively only against an operand proven\n // ALWAYS a string: the helper then takes its string branch, which `format!` reproduces.\n // Without that anchor (`Str + Str`) the both-null case yields `Value::Null`, not \"nullnull\".\n isNativeStringConcatPair(leftType: any, rightType: any): boolean {\n return this.isStringOrNullishType(leftType) && this.isStringOrNullishType(rightType)\n && (this.isStringLikeType(leftType) || this.isStringLikeType(rightType));\n }\n\n // `(+|-)` with the left operand of `+=`/`-=`: assignment plus the same\n // native emission as the plain binary form.\n printNativeAssignmentArithmetic(op, left, right, leftText, rightText): string | undefined {\n const native = this.printNativeArithmetic(op, left, right, leftText, rightText);\n return native === undefined ? undefined : `${leftText} = ${native}`;\n }\n\n printNativeArithmetic(op, left, right, leftText, rightText): string | undefined {\n if (op === SyntaxKind.PercentToken) return this.printRustNativeMod(left, right, leftText, rightText) ?? this.rustR16NativeArithmetic(op, left, right, leftText, rightText);\n if (op !== SyntaxKind.PlusToken && op !== SyntaxKind.MinusToken &&\n op !== SyntaxKind.AsteriskToken && op !== SyntaxKind.SlashToken) {\n return undefined;\n }\n let leftType, rightType;\n try {\n const checker = this.getChecker();\n leftType = checker.getTypeAtLocation(left);\n rightType = checker.getTypeAtLocation(right);\n } catch (e) {\n return undefined;\n }\n const r09 = this.rustR09NativeAddSubtract(op, left, right, leftType, rightType, leftText, rightText); if (r09 !== undefined) return r09;\n const r16 = this.rustR16NativeArithmetic(op, left, right, leftText, rightText); if (r16 !== undefined) return r16;\n const r20 = this.r20NativeNumericAdd(op, left, right, leftText, rightText); if (r20 !== undefined) return r20;\n if (op === SyntaxKind.PlusToken && (this.isNativeStringConcatPair(leftType, rightType) || this.r17ConcatIsAnchored(left, right, leftType, rightType)\n || this.r22ConcatIsAnchored(left, right, leftType, rightType))) {\n return this.printNativeStringConcat(leftText, rightText);\n }\n if (!this.isNumberLikeType(leftType) || !this.isNumberLikeType(rightType)) {\n return this.r25NativeCoercingArithmetic(op, left, right, leftText, rightText);\n }\n return this.printNativeNumeric(op, leftText, rightText);\n }\n\n printNativeStringConcat(leftText: string, rightText: string): string {\n return `Value::Str(format!(\"{}{}\", ${leftText}, ${rightText}).into())`;\n }\n\n // Both operands are `Int`/`Float` at runtime; `-> Value::Null` covers the\n // `Null`/non-numeric values the same way the helper's fallthrough does.\n // Always parenthesised so it composes under `&`, in argument position and\n // as an operand of another native match.\n printNativeNumeric(op, leftText: string, rightText: string): string {\n const [ left, right ] = [ `(${leftText})`, `(${rightText})` ];\n if (op === SyntaxKind.SlashToken) {\n return `(match (${left}.as_f64(), ${right}.as_f64()) { (Some(x), Some(y)) if y != 0.0 => Value::Float(x / y), _ => Value::Null })`;\n }\n const sign = op === SyntaxKind.PlusToken ? '+' : (op === SyntaxKind.MinusToken ? '-' : '*');\n return `(match (&${left}, &${right}) {` +\n ` (Value::Int(x), Value::Int(y)) => Value::Int(x ${sign} y),` +\n ` (Value::Int(x), Value::Float(y)) => Value::Float(*x as f64 ${sign} *y),` +\n ` (Value::Float(x), Value::Int(y)) => Value::Float(*x ${sign} *y as f64),` +\n ` (Value::Float(x), Value::Float(y)) => Value::Float(x ${sign} y),` +\n ` _ => Value::Null })`;\n }\n\n private static readonly RUST_TYPEOF_HELPERS = new Map([\n ['string', 'is_string'], ['number', 'is_number'], ['boolean', 'is_bool'], ['object', 'is_object'], ['function', 'is_function'],\n ]);\n\n printCustomBinaryExpressionIfAny(node, identation) {\n const { left, right } = node;\n const op = node.operatorToken.kind;\n const isAssign = op === SyntaxKind.EqualsToken;\n // Array destructuring reassignment: [a, b] = expr → bind once, reassign each\n if (isAssign && left.kind === SyntaxKind.ArrayLiteralExpression) {\n const tmpName = '__destr_tmp';\n const rhs = this.printNode(right, 0);\n const nativeList = this.rustNativeListSource(right);\n const assignments = left.elements.map((e, idx) => `${this.printNode(e, 0)} = ${nativeList\n ? this.printNativeListIndex(tmpName, idx) : `get_value(&${tmpName}, &Value::Int(${idx}))`}`).join('; ');\n return `{ let ${tmpName} = ${rhs}; ${assignments}; }`;\n }\n // Element access assignment: a[b] = v → add_element_to_object(&mut a, &b, v)\n if (isAssign && left.kind === SyntaxKind.ElementAccessExpression) {\n const keys: any[] = [];\n let baseExpr: any = left;\n while (isElementAccessExpression(baseExpr)) {\n keys.unshift(baseExpr.argumentExpression);\n baseExpr = baseExpr.expression;\n }\n let acc = `&mut ${this.printNode(baseExpr, 0)}`;\n const keyStrs = keys.map(k => this.printNode(k, 0));\n for (const key of keyStrs.slice(0, -1)) acc = `get_value_mut(${acc}, &${key})`;\n const rhs = this.printNode(right, 0);\n const nativeInsert = keyStrs.length === 1 ? (this.printNativeDictInsert(baseExpr, keys[0], keyStrs[0], rhs) ?? this.rustR01NativeDictInsert(baseExpr, keys[0], keyStrs[0], rhs)) : undefined;\n return nativeInsert ?? `add_element_to_object(${acc}, &${keyStrs[keyStrs.length - 1]}, ${rhs})`;\n }\n // typeof comparisons\n if (left.kind === SyntaxKind.TypeOfExpression) {\n const rightText = right.text;\n const target = this.printNode(left.expression, 0);\n const isDiff = op === SyntaxKind.ExclamationEqualsEqualsToken || op === SyntaxKind.ExclamationEqualsToken;\n const native = this.nativeValuePredicateText(rightText, left.expression, target);\n if (native !== undefined) {\n const negated = isDiff ? `!${native}` : native;\n // Conditions/logical operands expect a bool; other positions store a boxed `Value`.\n return this.isBooleanPosition(node) ? negated : `Value::Bool(${negated})`;\n }\n const helper = RustTranspiler.RUST_TYPEOF_HELPERS.get(rightText);\n if (helper !== undefined) return `${isDiff ? '!' : ''}${helper}(&${target})`;\n }\n // `in` — wrapped as Value so it composes in any context\n if (op === SyntaxKind.InKeyword) {\n const shadow = this.rustParamShadowOf(right);\n return (shadow !== undefined ? this.printShadowInOperator(shadow, left) : undefined)\n ?? this.printNativeInOperator(left, right) ?? this.r18LiteralInOp(left, right) ?? this.r05InOp(left, right)\n ?? `Value::Bool(in_op(&${this.printNode(right, 0)}, &${this.printNode(left, 0)}))`;\n }\n // `+=` / `-=` on regular variables\n if ((op === SyntaxKind.PlusEqualsToken || op === SyntaxKind.MinusEqualsToken) && left.kind !== SyntaxKind.ElementAccessExpression) {\n const isPlus = op === SyntaxKind.PlusEqualsToken;\n const leftText = this.printNode(left, 0);\n const rightText = this.printNode(right, 0);\n return this.printNativeAssignmentArithmetic(isPlus ? SyntaxKind.PlusToken : SyntaxKind.MinusToken, left, right, leftText, rightText)\n ?? `${leftText} = ${isPlus ? 'add' : 'subtract'}(&${leftText}, &${rightText})`;\n }\n // Native equality on unwrapped payloads when the checker proves the variants line up\n // (see printNativeEqualityComparison); the bool is boxed like the other Value helpers.\n if (op === SyntaxKind.EqualsEqualsToken || op === SyntaxKind.EqualsEqualsEqualsToken ||\n op === SyntaxKind.ExclamationEqualsToken || op === SyntaxKind.ExclamationEqualsEqualsToken) {\n const nativeEquality = this.printNativeEqualityComparison(left, right, op);\n if (nativeEquality) return `Value::Bool(${nativeEquality})`;\n }\n // A logical expression with a native-compare operand no longer starts with a bool helper: box it.\n if ((op === SyntaxKind.AmpersandAmpersandToken || op === SyntaxKind.BarBarToken)\n && (this.hasNativeComparisonOperand(left) || this.hasNativeComparisonOperand(right))) {\n return `Value::Bool(${this.printLogicalInBooleanContext(node)})`;\n }\n // Binary wrapper functions (is_equal, add, etc.) - add & to both sides\n if (op in this.binaryExpressionsWrappers) {\n const nativeCompare = RustTranspiler.NATIVE_COMPARISON_OPERATORS[op] !== undefined\n ? this.printNativeOrderedComparison(node, op, left, right) : undefined;\n if (nativeCompare !== undefined) return nativeCompare;\n const [fnName, close] = this.binaryExpressionsWrappers[op];\n const leftText = this.printNode(left, 0);\n const rightText = this.printNode(right, 0);\n return this.printNativeArithmetic(op, left, right, leftText, rightText)\n ?? `${fnName}${this.ensureRef(leftText)}, ${this.ensureRef(rightText)}${close}`;\n }\n return undefined;\n }\n\n printBinaryExpression(node, identation) {\n return this.printCustomBinaryExpressionIfAny(node, identation) || super.printBinaryExpression(node, identation);\n }\n\n // `Date.now()` → runtime helper returning current epoch millis.\n printDateNowCall(node, identation) {\n return 'date_now()';\n }\n\n // `str.padStart(len, pad)` / `str.padEnd(len, pad)` → runtime helpers `(&Value, &Value, &Value)`.\n printPadStartCall(node, identation, name, parsedArg, parsedArg2) {\n return this.printNativeStringPadStart(node, name) ?? `pad_start(${this.ensureRef(name)}, ${this.ensureRef(parsedArg)}, ${this.ensureRef(parsedArg2)})`;\n }\n\n printPadEndCall(node, identation, name, parsedArg, parsedArg2) {\n return `pad_end(${this.ensureRef(name)}, ${this.ensureRef(parsedArg)}, ${this.ensureRef(parsedArg2)})`;\n }\n\n printVariableDeclarationList(node, identation) {\n const declaration = node.declarations[0];\n const indent = this.getIden(identation);\n if (declaration?.name.kind === SyntaxKind.ArrayBindingPattern) {\n const parsedElements = declaration.name.elements.map(e => this.printNode(e.name, 0));\n const syntheticName = parsedElements.join('') + 'Variable';\n const head = `${indent}let mut ${syntheticName} = ${this.printNode(declaration.initializer, 0)};\\n`;\n const nativeList = this.rustNativeListSource(declaration.initializer);\n const lines = parsedElements.map((e, idx) => `${indent}let mut ${e}: Value = ${nativeList\n ? this.printNativeListIndex(syntheticName, idx) : `get_value(&${syntheticName}, &Value::Int(${idx}))`}`);\n return head + lines.join(';\\n');\n }\n const varName = this.printNode(declaration.name, 0);\n if (!declaration.initializer) {\n return `${indent}let mut ${varName}: Value = Value::Null`;\n }\n const parsedValue = this.printNode(declaration.initializer, identation).trim();\n if (declaration.initializer.kind === SyntaxKind.NewExpression) {\n return `${indent}let mut ${varName} = ${parsedValue}`;\n }\n if (node.declarations.length === 1 && this.rustVecLocalIsTyped(declaration)) return `${indent}let mut ${varName}: Vec = Vec::new()`;\n const boolValue = this.getRustBoolLocalInitializer(declaration, parsedValue);\n if (boolValue !== undefined) {\n return `${indent}let mut ${varName}: bool = ${boolValue}`;\n }\n const typedStr = this.rustSafeStringLocalIsTyped(declaration);\n const nativeStr = this.rustNativeStrCalleeKind(declaration.initializer) === 'str';\n if (typedStr) {\n // A native-`Option` callee already carries the payload; `safeString` helpers need the unwrap.\n return `${indent}let mut ${varName}: Option = ${parsedValue}${nativeStr ? '' : '.as_str().map(str::to_owned)'}`;\n }\n // A callee returning `Option` into a boxed local keeps the box.\n return `${indent}let mut ${varName}: Value = ${nativeStr ? this.rustNativeStrValueBox(parsedValue) : parsedValue}`;\n }\n\n // ── native-typed locals ───────────────────────────────────────────────────\n //\n // A local is declared `bool` (instead of `Value`) when its initializer is\n // already a bool-valued Rust expression and every use is a condition sink\n // (`is_true(&x)`) — the one sink that accepts a native bool today.\n //\n // `is_true` is generic over `IsTruthy` (impl for `bool`/`&bool` in\n // runtime.rs); every other sink takes `&Value`, so any other use keeps the\n // local boxed. Bools come in two shapes: helpers whose Rust return type is\n // already `bool` (below), and the printer's own `Value::Bool(...)` box,\n // which the declaration drops at the init site.\n\n private static readonly RUST_BOOL_RESULT_HELPERS = new Set([\n 'is_true', 'is_equal', 'is_greater_than', 'is_greater_than_or_equal',\n 'is_less_than', 'is_less_than_or_equal', 'is_array', 'is_object',\n 'is_string', 'is_number', 'is_bool', 'is_integer', 'is_function',\n 'is_instance', 'starts_with', 'ends_with', 'in_op', 'contains',\n ]);\n\n // Hand-written Rust fns outside `runtime.rs` with a `-> bool` signature, keyed by the TS callee\n // name (verified in `rust/tests/src/tests_support.rs`). A call is already a Rust bool, so the\n // condition printer's `is_true(&…)` wrapper is the identity (`IsTruthy for bool`) and is dropped.\n private static readonly RUST_BOOL_RESULT_CALLEES = new Set([\n 'tickerExceptionNeedsOhlcv',\n ]);\n\n // Call to a hand-written `-> bool` fn: the checker must agree the TS call\n // is boolean-typed and the callee must be in the verified table above.\n rustCallPrintsBool(node): boolean {\n if (node?.kind !== SyntaxKind.CallExpression) {\n return false;\n }\n const callee: any = node.expression;\n const name = callee?.kind === SyntaxKind.Identifier ? callee.text\n : callee?.kind === SyntaxKind.PropertyAccessExpression ? callee.name?.text : undefined;\n return name !== undefined && RustTranspiler.RUST_BOOL_RESULT_CALLEES.has(name) && this.rustTypeIsBoolean(node);\n }\n\n // Index just past the `\"...\"` literal opening at `i` (escapes skipped).\n private rustSkipStringLiteral(text: string, i: number): number {\n for (i++; i < text.length && text[i] !== '\"'; i++) {\n if (text[i] === '\\\\') i++;\n }\n return i;\n }\n\n // `)` spanning the whole printed value → ``. The payload is\n // only reachable this way: the printer prints the value, not its parts.\n peelValueBox(printedValue: string, prefix: string): string | undefined {\n if (!printedValue.startsWith(prefix) || !printedValue.endsWith(')')) {\n return undefined;\n }\n let depth = 0;\n for (let i = prefix.length - 1; i < printedValue.length; i++) {\n const char = printedValue[i];\n if (char === '\"') i = this.rustSkipStringLiteral(printedValue, i);\n else if (char === '(') depth++;\n else if (char === ')' && --depth === 0) {\n return i === printedValue.length - 1 ? printedValue.slice(prefix.length, i) : undefined;\n }\n }\n return undefined;\n }\n\n // `Value::Bool()` spanning the whole expression → ``.\n peelValueBoolBox(printedValue: string): string | undefined {\n return this.peelValueBox(printedValue, 'Value::Bool(');\n }\n\n // `Value::Str()` spanning the whole expression → `` (a String).\n peelValueStrBox(printedValue: string): string | undefined {\n return this.peelValueBox(printedValue, 'Value::Str(');\n }\n\n // `((expr))` → `expr` — a redundant layer kept from the TS source; the\n // right-hand side of a declaration binds the whole expression anyway.\n stripOuterParens(printedValue: string): string {\n let value = printedValue.trim();\n while (value.startsWith('(') && value.endsWith(')')) {\n let depth = 0;\n let closesAtEnd = true;\n for (let i = 0; i < value.length && closesAtEnd; i++) {\n const char = value[i];\n if (char === '\"') i = this.rustSkipStringLiteral(value, i);\n else if (char === '(') depth++;\n else if (char === ')' && --depth === 0 && i !== value.length - 1) closesAtEnd = false;\n }\n if (!closesAtEnd || depth !== 0) break;\n value = value.slice(1, -1).trim();\n }\n return value;\n }\n\n // `is_equal(...)` / `!is_true(...)` / `contains(...)` — bare bool helper calls.\n printedBoolHelperCall(printedValue: string): boolean {\n const stripped = printedValue.startsWith('!') ? printedValue.slice(1).trim() : printedValue;\n const match = /^([a-z_][a-z0-9_]*)\\(/.exec(stripped);\n return match !== null && RustTranspiler.RUST_BOOL_RESULT_HELPERS.has(match[1]);\n }\n\n // Source shapes the printer turns into a bool: comparisons, `&&`/`||`\n // (each operand is is_true-wrapped), `!`, `in`, `instanceof`, true/false.\n rustNodeIsBoolExpression(node): boolean {\n switch (node?.kind) {\n case SyntaxKind.TrueKeyword:\n case SyntaxKind.FalseKeyword:\n return true;\n case SyntaxKind.ParenthesizedExpression:\n return this.rustNodeIsBoolExpression(node.expression);\n case SyntaxKind.PrefixUnaryExpression:\n return node.operator === SyntaxKind.ExclamationToken;\n case SyntaxKind.BinaryExpression: {\n const kind = node.operatorToken.kind;\n return (RustTranspiler as any).COMPARISON_OPS.has(kind) || kind === SyntaxKind.AmpersandAmpersandToken\n || kind === SyntaxKind.BarBarToken || kind === SyntaxKind.InKeyword || kind === SyntaxKind.InstanceOfKeyword;\n }\n }\n return false;\n }\n\n rustTypeIsBoolean(node): boolean {\n try {\n const type = this.getChecker().getTypeAtLocation(node);\n return (type.flags & TypeFlags.BooleanLike) !== 0 || this.getChecker().typeToString(type).trim() === 'boolean';\n } catch (e) {\n return false; // no checker type → keep the boxed form\n }\n }\n\n rustTypeIsString(node): boolean {\n const checker: any = this.checkerOrUndefined();\n // no checker type → keep the boxed form\n return checker !== undefined && this.isStringLikeType(checker.getTypeAtLocation(node));\n }\n\n rustEnclosingFunction(node) {\n for (let current = node?.parent; current; current = current.parent) {\n switch (current.kind) {\n case SyntaxKind.MethodDeclaration:\n case SyntaxKind.FunctionDeclaration:\n case SyntaxKind.FunctionExpression:\n case SyntaxKind.ArrowFunction:\n case SyntaxKind.Constructor:\n case SyntaxKind.SourceFile:\n return current;\n }\n }\n return undefined;\n }\n\n rustBindsName(node, name: string): boolean {\n switch (node?.kind) {\n case SyntaxKind.VariableDeclaration:\n case SyntaxKind.Parameter:\n case SyntaxKind.FunctionDeclaration:\n case SyntaxKind.ClassDeclaration:\n case SyntaxKind.PropertyDeclaration:\n case SyntaxKind.FunctionExpression:\n case SyntaxKind.ArrowFunction:\n return node.name?.kind === SyntaxKind.Identifier && node.name.text === name;\n }\n return false;\n }\n\n // Only these uses compile against a native `bool` local today: `is_true(&x)`\n // (under any depth of `(...)`, `!`, `&&`/`||`), and the condition slot of\n // if/while/for/ternary — all printed is_true-wrapped.\n rustIdentifierUseIsCondition(node): boolean {\n for (let current: any = node, parent: any = node.parent; parent; current = parent, parent = parent.parent) {\n switch (parent.kind) {\n case SyntaxKind.ParenthesizedExpression:\n if (parent.expression !== current) return false;\n break;\n case SyntaxKind.PrefixUnaryExpression:\n if (parent.operator !== SyntaxKind.ExclamationToken || parent.operand !== current) return false;\n break;\n case SyntaxKind.BinaryExpression:\n if (parent.operatorToken.kind !== SyntaxKind.AmpersandAmpersandToken\n && parent.operatorToken.kind !== SyntaxKind.BarBarToken) return false;\n break;\n case SyntaxKind.IfStatement:\n case SyntaxKind.WhileStatement:\n case SyntaxKind.DoStatement:\n return parent.expression === current;\n case SyntaxKind.ForStatement:\n case SyntaxKind.ConditionalExpression:\n return parent.condition === current;\n default:\n return false;\n }\n }\n return false;\n }\n\n // Visits every in-scope use of the local `name` declared by `declaration`: false as soon as the\n // name is re-bound in scope or `acceptUse(identifier)` rejects a use. `skipPropertyNames` leaves\n // `x.foo` / `{ foo }` names out of the uses.\n private rustLocalUsesAll(declaration, name: string, skipPropertyNames: boolean, acceptUse: (n) => boolean): boolean {\n const scope = this.rustEnclosingFunction(declaration);\n if (scope === undefined || name === undefined) {\n return false;\n }\n let safe = true;\n for (const n of this.rustScopeNameNodes(scope, name) as any[]) {\n if (n !== declaration && this.rustBindsName(n, name)) {\n safe = false; // a second binding of the name in scope — stay boxed\n break;\n }\n if (n.kind === SyntaxKind.Identifier && n !== declaration.name\n && !(skipPropertyNames && this.rustIdentifierIsPropertyName(n)) && !acceptUse(n)) {\n safe = false;\n break;\n }\n }\n return safe;\n }\n\n rustLocalUsesAcceptBool(declaration, sourceName: string): boolean {\n return this.rustLocalUsesAll(declaration, sourceName, false, (n) => this.rustIdentifierUseIsCondition(n));\n }\n\n // Typed string locals: `let x: Value = self.safeString(..)` is declared `Option` when\n // the checker proves a string and every use is a native sink (`x.is_none()`, `x.as_deref() ==\n // Some(\"lit\")`). The helper's Value is unwrapped with `.as_str()`; any other sink keeps the box.\n\n private static readonly RUST_STRING_LOCAL_HELPERS = new Set([\n 'safeString', 'safeString2', 'safeStringN',\n 'safeStringLower', 'safeStringLower2', 'safeStringLowerN',\n 'safeStringUpper', 'safeStringUpper2', 'safeStringUpperN',\n ]);\n\n private rustStringLocalDecisions = new Map();\n\n // `let x = this.safeString(..)` / `safeString(..)` — the whole initializer;\n // a call whose callee already returns `Option` (a native-`Str`\n // method) is the same payload without the unwrap.\n rustSafeStringLocalInitializer(declaration): boolean {\n const initializer = declaration.initializer;\n if (declaration.name?.kind !== SyntaxKind.Identifier || initializer?.kind !== SyntaxKind.CallExpression) {\n return false;\n }\n if (this.rustNativeStrCalleeKind(initializer) === 'str') {\n return true;\n }\n const callee = initializer.expression;\n const helpers = RustTranspiler.RUST_STRING_LOCAL_HELPERS;\n if (callee?.kind === SyntaxKind.PropertyAccessExpression) {\n return callee.expression?.kind === SyntaxKind.ThisKeyword && helpers.has(callee.name.text);\n }\n return callee?.kind === SyntaxKind.Identifier && helpers.has(callee.text);\n }\n\n // The two uses that compile against an `Option` local and print\n // natively: `x ==/!= null|undefined` and `x ==/!= \"lit\"`.\n rustStringLocalUseIsNative(node): boolean {\n const parent = node.parent;\n if (parent?.kind !== SyntaxKind.BinaryExpression) {\n return false;\n }\n const op = parent.operatorToken.kind;\n if (op !== SyntaxKind.EqualsEqualsToken && op !== SyntaxKind.EqualsEqualsEqualsToken\n && op !== SyntaxKind.ExclamationEqualsToken && op !== SyntaxKind.ExclamationEqualsEqualsToken) {\n return false;\n }\n const other = parent.left === node ? parent.right : (parent.right === node ? parent.left : undefined);\n if (other === undefined) {\n return false;\n }\n const otherLiteral = this.literalKindOfNode(other);\n // The string-literal compare prints as `.as_deref() == Some(\"lit\")`;\n // the printer's own rejections (replacement tokens) must match.\n return otherLiteral === 'null' || (otherLiteral === 'string' && !(other.text in this.StringLiteralReplacements));\n }\n\n // Every use compiles against `Option`, and at least one native sink\n // consumes it (otherwise the retype buys nothing).\n rustSafeStringLocalIsTyped(declaration): boolean {\n const cached = this.rustStringLocalDecisions.get(declaration);\n if (cached !== undefined) {\n return cached;\n }\n this.rustStringLocalDecisions.set(declaration, false); // re-entrancy guard\n const decision = this.rustSafeStringLocalIsTypedUncached(declaration);\n this.rustStringLocalDecisions.set(declaration, decision);\n return decision;\n }\n\n rustSafeStringLocalIsTypedUncached(declaration): boolean {\n if (!this.rustSafeStringLocalInitializer(declaration)\n || this.primitiveKindOfType(this.typeOfNodeIfAny(declaration.name)) !== 'string') {\n return false;\n }\n let nativeUses = 0;\n const safe = this.rustLocalUsesAll(declaration, declaration.name.text, true,\n (n) => this.rustStringLocalUseIsNative(n) && ++nativeUses > 0);\n return safe && nativeUses > 0;\n }\n\n // `x.foo` / `{ foo: 1 }` — a property name is not a use of the local.\n rustIdentifierIsPropertyName(node): boolean {\n const parent = node.parent;\n switch (parent?.kind) {\n case SyntaxKind.PropertyAccessExpression:\n case SyntaxKind.PropertyAssignment:\n case SyntaxKind.PropertySignature:\n case SyntaxKind.ShorthandPropertyAssignment:\n return parent.name === node;\n }\n return false;\n }\n\n // Is this identifier occurrence bound to a typed string local?\n rustStringLocalIdentifierIsTyped(node): boolean {\n const checker: any = node?.kind === SyntaxKind.Identifier ? this.checkerOrUndefined() : undefined;\n if (checker === undefined) {\n return false;\n }\n const symbol = checker.getSymbolAtLocation(node);\n const declaration = symbolValueDeclaration(symbol) ?? symbolDeclarations(symbol)[0];\n return declaration?.kind === SyntaxKind.VariableDeclaration && this.rustSafeStringLocalIsTyped(declaration);\n }\n\n // `let x = ` → the printed bool expression, or undefined.\n getRustBoolLocalInitializer(declaration, printedValue: string): string | undefined {\n const initializer = declaration.initializer;\n if (initializer === undefined || declaration.name?.kind !== SyntaxKind.Identifier) {\n return undefined;\n }\n const inner = this.stripOuterParens(printedValue);\n const peeled = this.peelValueBoolBox(inner);\n if (peeled === undefined && !this.printedBoolHelperCall(inner) && !this.rustNodeIsBoolExpression(initializer)) {\n return undefined;\n }\n if (!this.rustTypeIsBoolean(initializer) || !this.rustLocalUsesAcceptBool(declaration, declaration.name.text)) {\n return undefined;\n }\n return peeled ?? inner;\n }\n\n // ── native `Option` returns (`: Str` methods) ─────────────────────\n //\n // An internal, non-override, non-async method declared `: Str`\n\n private rustNativeStrReturnDecisions = new WeakMap();\n\n // `ts/src/base/**` — the shared `Exchange` / `PredictionExchange` classes\n // (the transpiler synthesises variants like `.__ExchangeNoOverloads.ts`).\n private static readonly RUST_BASE_TIER_FILE = /ts[\\\\/]src[\\\\/]base[\\\\/]/;\n\n /** `'str'` when the method is emitted `-> Option`, else undefined. */\n rustNativeStrReturnKind(node: Node): string | undefined {\n if (node === undefined || node.kind !== SyntaxKind.MethodDeclaration) {\n return undefined;\n }\n let decision = this.rustNativeStrReturnDecisions.get(node);\n if (decision === undefined) {\n this.rustNativeStrReturnDecisions.set(node, false); // re-entrancy guard\n decision = this.rustNativeStrReturnDecisionUncached(node);\n this.rustNativeStrReturnDecisions.set(node, decision);\n }\n return decision ? 'str' : undefined;\n }\n\n private rustMethodOverrides = new WeakMap();\n private rustClassAncestorTables = new WeakMap[] | null>();\n\n /** Per ancestor class (nearest first): method name -> its LAST declaration; undefined when a\n * parent class does not resolve. */\n private rustAncestorMethodTables(classDecl: Node): Map[] | undefined {\n const cached = this.rustClassAncestorTables.get(classDecl);\n if (cached !== undefined) {\n return cached ?? undefined;\n }\n const chain: Map[] = [];\n let parentClass = getAllSuperTypeNodes(classDecl)[0];\n let ok = true;\n while (parentClass !== undefined) {\n const parentClassDecl = this.getChecker().getTypeAtLocation(parentClass)?.getSymbol()?.valueDeclaration?.resolve();\n if (parentClassDecl === undefined) {\n ok = false;\n break;\n }\n const byName = new Map();\n for (const elem of (parentClassDecl as any).members ?? []) {\n if (isMethodDeclaration(elem)) {\n byName.set(elem.name.getText().trim(), elem);\n }\n }\n chain.push(byName);\n parentClass = getAllSuperTypeNodes(parentClassDecl)[0] ?? undefined;\n }\n this.rustClassAncestorTables.set(classDecl, ok ? chain : null);\n return ok ? chain : undefined;\n }\n\n // base getMethodOverride rescans every parent member (getText) per call; same walk, memoized\n getMethodOverride(node: Node): Node {\n if (node === undefined || !isClassDeclaration(node.parent) || !(node.parent as any).heritageClauses) {\n return undefined;\n }\n const cached = this.rustMethodOverrides.get(node);\n if (cached !== undefined) {\n return cached ?? undefined;\n }\n const chain = this.rustAncestorMethodTables(node.parent);\n let method = undefined;\n if (chain === undefined) {\n this.warn(node, \"Parent class\", \"Parent class not found\");\n } else {\n const name = (node as any).name.text;\n for (const byName of chain) {\n method = byName.get(name) ?? method;\n }\n }\n this.rustMethodOverrides.set(node, method ?? null);\n return method;\n }\n\n private rustNativeStrReturnDecisionUncached(node): boolean {\n // An override's base/trait copy prints `-> Value`. The base classes are hand-tuned across the\n // whole tree: their methods are called from ~every derived file (and the hand-written runtime),\n // where the boxed `Value` ABI is load-bearing. Only per-exchange\n if (node.type === undefined || this.isAsyncFunction(node) || this.getMethodOverride(node) !== undefined\n || RustTranspiler.RUST_BASE_TIER_FILE.test(node.getSourceFile().fileName)) {\n return false;\n }\n let type: Type;\n try {\n type = this.getChecker().getTypeFromTypeNode(node.type);\n } catch (e) {\n return false;\n }\n return this.primitiveKindOfType(type) === 'string' && this.rustStrReturnPathsConvert(node.body);\n }\n\n /** Every `return` of the method's own body converts, and the body's last\n * statement is one of them (so Rust sees no `()`-valued tail the\n * `-> Value` post-passes would have patched with `Value::Null`). */\n rustStrReturnPathsConvert(body: Block): boolean {\n const last = body?.statements[body.statements.length - 1];\n if (last === undefined || !isReturnStatement(last)) {\n return false;\n }\n let ok = true;\n const visit = (n: Node) => {\n if (!ok || (n !== body && isFunctionLike(n))) {\n return; // a nested function keeps the boxed signature\n }\n if (isReturnStatement(n) && !this.rustStrReturnValueConverts(n.expression)) {\n ok = false;\n return;\n }\n n.forEachChild(visit);\n };\n body.forEachChild(visit);\n return ok;\n }\n\n /** A `return` value of a native-`Str` method: a nullish literal, an\n * expression already printing an `Option` (a nested retyped call\n * or a typed string local), or a `Value`-printing expression the checker\n * types `string | undefined`. */\n rustStrReturnValueConverts(expression: Node): boolean {\n const inner = this.unwrapParensNode(expression);\n if (inner === undefined) {\n return false;\n }\n if (this.literalKindOfNode(inner) === 'null' || this.rustStrNativeExpression(inner)) {\n return true;\n }\n return this.printsValueExpression(inner) && this.primitiveKindOfType(this.getCheckedTypeOf(inner)) === 'string';\n }\n\n /** An expression that already prints an `Option` in a `: Str`\n * method's return position. */\n rustStrNativeExpression(expression: Node): boolean {\n const inner = this.unwrapParensNode(expression);\n if (inner !== undefined && isCallExpression(inner)) {\n return this.rustNativeStrCalleeKind(inner) === 'str';\n }\n return inner !== undefined && isIdentifier(inner) && this.rustStringLocalIdentifierIsTyped(inner);\n }\n\n unwrapParensNode(node: Node): Node | undefined {\n let current = node;\n while (current !== undefined && isParenthesizedExpression(current)) {\n current = current.expression;\n }\n return current;\n }\n\n /** The callee declaration behind `self.(..)` when it is emitted\n * `-> Option`; undefined otherwise (no proof → keep the box). */\n // call node -> resolved signature's declaration (null: none); a handle resolve per call is JS-heavy\n private rustCallDeclarations = new WeakMap();\n\n rustNativeStrCalleeKind(node: Node): string | undefined {\n if (node === undefined || node.kind !== SyntaxKind.CallExpression) {\n return undefined;\n }\n let declaration = this.rustCallDeclarations.get(node);\n if (declaration === undefined) {\n try {\n declaration = signatureDeclaration((this.getChecker() as any).getResolvedSignature(node)) ?? null;\n } catch (e) {\n return undefined;\n }\n this.rustCallDeclarations.set(node, declaration);\n }\n return declaration?.kind === SyntaxKind.MethodDeclaration ? this.rustNativeStrReturnKind(declaration) : undefined;\n }\n\n /** `Option` → `Value` (exact inverse of the return conversion). */\n rustNativeStrValueBox(text: string): string {\n return `${text}.map(|__s| Value::Str(__s.into())).unwrap_or(Value::Null)`;\n }\n\n /** True when a call to a native-`Str` callee must be boxed back to a\n * `Value` at this position; the declaration and return printers run the\n * conversion themselves. */\n rustNativeStrCallNeedsBox(node: Node): boolean {\n let current: any = node;\n let parent: any = current.parent;\n while (parent !== undefined && isParenthesizedExpression(parent) && parent.expression === current) {\n current = parent;\n parent = parent.parent;\n }\n if (parent === undefined) {\n return true;\n }\n if (isVariableDeclaration(parent) && parent.initializer === current && isIdentifier(parent.name)) {\n return false; // the declaration printer binds the type / boxes it\n }\n if (isReturnStatement(parent) && parent.expression === current) {\n // only a native-`Str` method's own return printer runs the conversion\n return this.rustNativeStrReturnKind(findAncestor(parent.parent, isFunctionLike) as any) !== 'str';\n }\n return true;\n }\n\n /** Wrap a call text when the callee returns a native `Option`\n * and the position still needs a `Value`. */\n rustBoxNativeStrCallIfNeeded(node: Node, text: string): string {\n return this.rustNativeStrCalleeKind(node) === 'str' && this.rustNativeStrCallNeedsBox(node)\n ? this.rustNativeStrValueBox(text) : text;\n }\n\n // ── declared-Dict locals (`let x: Value = self.safe_dict_k(..)`) ───────────\n //\n // The printer declares non-bool locals `Value`, and the checker types a\n\n private declaredDictLocalsCache: { src: SourceFile, table: Map } | undefined;\n\n /** All `let x: Value = ` declarations of the current\n * source file, keyed by local name in declaration order. */\n rustDeclaredDictLocals(): Map {\n const src = this.getSrc();\n if (this.declaredDictLocalsCache?.src !== src) {\n let table: Map;\n try {\n table = this.collectRustDeclaredDictLocals(src);\n } catch (e) {\n table = new Map(); // no proof -> consumers keep the helper\n }\n this.declaredDictLocalsCache = { src, table };\n }\n return this.declaredDictLocalsCache.table;\n }\n\n /** Printer hook for the helper-removal units: the proven kind of a declared\n * local, or undefined when the local is not proven Dict at every use.\n * Accepts the receiver node of the helper call (identifier, `x['k']` chain,\n * `this.x` chain) or the declaration itself. */\n rustDeclaredLocalTypeResolver(node: Node): RustDeclaredLocalKind | undefined {\n return this.rustDeclaredLocalEntry(node)?.kind;\n }\n\n /** The table entry a use site resolves to (the declaration whose binding the\n * use refers to, proven), or undefined. */\n rustDeclaredLocalEntry(node: Node): RustDeclaredDictLocalEntry | undefined {\n if (node === undefined) return undefined;\n const name = isVariableDeclaration(node) ? (node.name as Identifier).text : this.rootPlaceText(node);\n if (name === undefined) return undefined;\n const entries = this.rustDeclaredDictLocals().get(name);\n if (entries === undefined) return undefined;\n const start = node.getStart();\n const identifier = this.rustDeclaredLocalIdentifier(node);\n const symbol = identifier === undefined ? undefined : this.rustSymbolOf(identifier);\n let best: RustDeclaredDictLocalEntry | undefined;\n for (const entry of entries) {\n if (entry.start > start || !entry.alwaysDict || !entry.stable) continue;\n const scope = this.rustEnclosingFunction(entry.declaration);\n if (scope !== undefined && !this.isNodeInsideNode(node, scope)) continue;\n if (identifier !== undefined) {\n const entrySymbol = this.rustSymbolOf((entry.declaration.name as Identifier));\n if (symbol !== undefined && entrySymbol !== undefined && symbol !== entrySymbol) continue;\n }\n if (best === undefined || entry.start > best.start) best = entry;\n }\n return best;\n }\n\n /** The identifier at the head of a place (`x`, `x['k']`, `this.x` is not a\n * local) — the node the resolver matches against the table. */\n private rustDeclaredLocalIdentifier(node: Node): Identifier | undefined {\n let current: any = node;\n while (current !== undefined && !isIdentifier(current)) {\n if (isElementAccessExpression(current) || isPropertyAccessExpression(current)) {\n if (current.expression.kind === SyntaxKind.ThisKeyword) return undefined;\n } else if (!isParenthesizedExpression(current) && !isNonNullExpression(current)) {\n return undefined;\n }\n current = current.expression;\n }\n return current;\n }\n\n /** Binding symbol of an identifier, or undefined when the checker cannot\n * answer (ByContent probes without a class context, for instance). */\n private rustSymbolOf(node: Identifier): TsSymbol | undefined {\n return this.checkerOrUndefined()?.getSymbolAtLocation(node);\n }\n\n /** True when this identifier is a use of the given declaration's binding.\n * Without a checker answer the callers stay conservative (reject). */\n private rustIdentifierRefersToDeclaration(node: Identifier, declaration: VariableDeclaration): boolean {\n const symbol = this.rustSymbolOf(node);\n return symbol !== undefined && symbol === this.rustSymbolOf(declaration.name as Identifier);\n }\n\n /** Census of the current source file's table, for reports and tests. */\n rustDeclaredDictLocalCensus(): { declarators: number, dict: number, alwaysDict: number, kindUnstable: number, retypeEligible: number } {\n let declarators = 0, dict = 0, alwaysDict = 0, kindUnstable = 0, retypeEligible = 0;\n for (const entries of this.rustDeclaredDictLocals().values()) {\n for (const entry of entries) {\n declarators++;\n if (entry.alwaysDict) alwaysDict++;\n if (entry.alwaysDict && entry.stable) dict++;\n if (entry.alwaysDict && !entry.stable) kindUnstable++;\n // every later use is an element access or a kind-preserving\n // mutator -> the only uses a native declaration has to serve.\n if (entry.alwaysDict && entry.stable && entry.uses.other === 0) retypeEligible++;\n }\n }\n return { declarators, dict, alwaysDict, kindUnstable, retypeEligible };\n }\n\n private collectRustDeclaredDictLocals(src: SourceFile): Map {\n const candidates: { declaration: VariableDeclaration, name: string, source: string, defaultNode: Node | undefined }[] = [];\n this.rustWalkScope(src, (node) => {\n if (isVariableDeclaration(node) && node.initializer !== undefined && node.name.kind === SyntaxKind.Identifier) {\n const info = this.rustDictInitializerInfo(node.initializer);\n if (info !== undefined) {\n candidates.push({ declaration: node, name: String(node.name.text), source: info.source, defaultNode: info.defaultNode });\n }\n }\n });\n candidates.sort((a, b) => a.declaration.getStart() - b.declaration.getStart());\n const table = new Map();\n for (const candidate of candidates) {\n const declaration = candidate.declaration;\n const start = declaration.getStart();\n const alwaysDict = this.rustDictProvenExpression(candidate.defaultNode, table, start);\n const scan = this.rustDictLocalWriteScan(declaration, candidate.name, table);\n const entries = table.get(candidate.name) ?? [];\n entries.push({ kind: RUST_DECLARED_DICT_LOCALS.DICT, name: candidate.name, source: candidate.source,\n alwaysDict, stable: scan.stable, uses: scan.uses, declaration, start });\n table.set(candidate.name, entries);\n }\n return table;\n }\n\n /** The Dict-proven initialiser shape of a declaration, or undefined. */\n private rustDictInitializerInfo(node: Node): { source: string, defaultNode: Node | undefined } | undefined {\n if (isObjectLiteralExpression(node)) {\n return { source: 'value_map', defaultNode: node };\n }\n if (isParenthesizedExpression(node) || isAsExpression(node) || isNonNullExpression(node)) {\n return this.rustDictInitializerInfo(node.expression);\n }\n if (!isCallExpression(node)) return undefined;\n const callee = this.rustSafeDictCallee(node);\n if (callee === undefined) return undefined;\n return { source: callee, defaultNode: node.arguments[RUST_DECLARED_DICT_LOCALS.SAFE_CALLEES[callee]] };\n }\n\n /** Printed `safe_dict*` callee name of `self.(..)`, or undefined. */\n private rustSafeDictCallee(node: CallExpression): string | undefined {\n const expression = node.expression;\n if (!isPropertyAccessExpression(expression) || expression.expression.kind !== SyntaxKind.ThisKeyword) {\n return undefined;\n }\n const printed = this.toSnakeCaseName(expression.name.text);\n return RUST_DECLARED_DICT_LOCALS.SAFE_CALLEES[printed] === undefined ? undefined : printed;\n }\n\n /** True when the expression can only be a Dict at run time: an object\n * literal, a `safe_dict*` call with a Dict-proven default, an element of a\n * one-element literal default, or an already-proven local. */\n private rustDictProvenExpression(node: Node | undefined, table: Map, useStart: number): boolean {\n if (node === undefined) return false;\n if (isObjectLiteralExpression(node)) return true;\n if (isParenthesizedExpression(node) || isAsExpression(node) || isNonNullExpression(node)) {\n return this.rustDictProvenExpression(node.expression, table, useStart);\n }\n if (isArrayLiteralExpression(node)) {\n return node.elements.length === 1 && this.rustDictProvenExpression(node.elements[0], table, useStart);\n }\n if (isIdentifier(node)) {\n const entries = table.get(node.text) ?? [];\n return entries.some((entry) => {\n if (!entry.alwaysDict || entry.start > useStart) return false;\n const scope = this.rustEnclosingFunction(entry.declaration);\n return scope === undefined || this.isNodeInsideNode(node, scope);\n });\n }\n const info = this.rustDictInitializerInfo(node);\n return info !== undefined && this.rustDictProvenExpression(info.defaultNode, table, useStart);\n }\n\n /** D2 scan over the enclosing function: an assignment of a non-Dict-proven\n * value would let the kind change. Every other write path the printer emits\n * for a local is kind-preserving (`x['k'] = v` -> `add_element_to_object`,\n * `x.push(v)` -> `append_to_array`, `delete x[k]` -> `remove`, nested\n * `x['a']['b'] = v` -> `get_value_mut`/`set_value`). A *different* binding of\n * the same name (sibling block, parameter) is not this local and does not\n * count; when the checker cannot separate the two bindings the scan stays\n * conservative and rejects. */\n private rustDictLocalWriteScan(declaration: VariableDeclaration, name: string, table: Map): { stable: boolean, uses: { elementAccess: number, mutHelper: number, other: number } } {\n const uses = { elementAccess: 0, mutHelper: 0, other: 0 };\n let stable = true;\n const scope = this.rustEnclosingFunction(declaration);\n if (scope === undefined) return { stable, uses };\n const declarationSymbol = this.rustSymbolOf(declaration.name as Identifier);\n // every event of the scan is rooted at a node spelled `name`: a re-binding, a use, or the\n // identifier inside an assignment target / for-of-in head (the target's own node is an ancestor)\n for (const node of this.rustScopeNameNodes(scope, name) as any[]) {\n if (node !== declaration && this.rustBindsName(node, name)) {\n const otherSymbol = this.rustSymbolOf((node as any).name);\n if (declarationSymbol === undefined || otherSymbol === undefined || otherSymbol === declarationSymbol) {\n stable = false; // same binding, or the checker cannot tell them apart\n break;\n }\n }\n if (node.kind !== SyntaxKind.Identifier) continue;\n if (node !== declaration.name && this.rustIdentifierRefersToDeclaration(node, declaration)) {\n this.rustDictLocalClassifyUse(node, uses);\n }\n let target: any = node;\n while (target.parent !== undefined && (isParenthesizedExpression(target.parent) || isArrayLiteralExpression(target.parent)\n || isShorthandPropertyAssignment(target.parent) || isObjectLiteralExpression(target.parent))) {\n target = target.parent;\n }\n const holder: any = target.parent;\n if (holder !== undefined && isBinaryExpression(holder) && holder.left === target\n && rustIsAssignmentOperator(holder.operatorToken.kind) &&\n this.rustAssignmentWritesWholeLocal(holder.left, declaration) &&\n !this.rustDictProvenExpression(holder.right, table, declaration.getStart())) {\n stable = false; // the local itself is reassigned a non-Dict value\n break;\n }\n // `for (x of list)` / `for (x in obj)` rebind an existing local.\n if (holder !== undefined && (isForOfStatement(holder) || isForInStatement(holder)) && holder.initializer === target &&\n this.rustAssignmentWritesWholeLocal(holder.initializer, declaration)) {\n stable = false;\n break;\n }\n }\n return { stable, uses };\n }\n\n /** True when this assignment target writes the local ITSELF (`x = ..`,\n * `[x, y] = ..`, `({x} = ..)`), as opposed to a write *into* it\n * (`x['k'] = ..`, kind-preserving). */\n private rustAssignmentWritesWholeLocal(left: Node, declaration: VariableDeclaration): boolean {\n if (isIdentifier(left)) {\n return this.rustIdentifierRefersToDeclaration(left, declaration);\n }\n if (isParenthesizedExpression(left)) {\n return this.rustAssignmentWritesWholeLocal(left.expression, declaration);\n }\n if (isArrayLiteralExpression(left)) {\n return left.elements.some((element) => this.rustAssignmentWritesWholeLocal(element, declaration));\n }\n if (isObjectLiteralExpression(left)) {\n return left.properties.some((property) => {\n if (!isShorthandPropertyAssignment(property)) return false;\n return this.rustAssignmentWritesWholeLocal(property.name, declaration);\n });\n }\n return false;\n }\n\n /** One use of a dict-proven local: an element-access chain (`x['k']`, also\n * the `x['k'] = v` write), a kind-preserving mutator (`x.push(v)`,\n * `delete x[k]`), or something that would need the local to still be a\n * `Value`. */\n private rustDictLocalClassifyUse(node: Node, uses: { elementAccess: number, mutHelper: number, other: number }): void {\n const isAccessOf = (p: any, c: Node) => p !== undefined &&\n (isElementAccessExpression(p) || isPropertyAccessExpression(p)) && p.expression === c;\n let current: any = node;\n const parent: any = current.parent;\n if (isAccessOf(parent, current)) {\n while (isAccessOf(current.parent, current)) current = current.parent;\n if (isElementAccessExpression(current)) uses.elementAccess++;\n else uses.other++; // `x.field` on a dict value\n } else if (parent !== undefined && (isDeleteExpression(parent) || (isCallExpression(parent) &&\n isPropertyAccessExpression(parent.expression) && parent.expression.expression === current &&\n parent.expression.name.text === 'push'))) {\n uses.mutHelper++;\n } else {\n uses.other++;\n }\n }\n\n\n printPropertyDeclaration(node, identation) {\n const name = this.printNode(node.name, 0);\n if (node.initializer) {\n const init = this.printNode(node.initializer, 0);\n return `${this.getIden(identation)}${name}: Value, // default: ${init}`;\n }\n return `${this.getIden(identation)}${name}: Value,`;\n }\n\n // Collect property declarations with their initializers for use in new()\n getStructFields(node): Array<{ name: string, init: string }> {\n return node.members.filter(m => m.kind === SyntaxKind.PropertyDeclaration).map(p => ({\n name: this.printNode(p.name, 0),\n init: p.initializer ? this.printNode(p.initializer, 0) : 'Value::Null',\n }));\n }\n\n printStruct(node, identation) {\n const fieldLines = this.getStructFields(node).map(f => `${this.getIden(identation + 1)}pub ${f.name}: Value,`).join('\\n');\n return `#[derive(Debug, Clone)]\\npub struct ${this.className} {\\n${fieldLines}\\n}`;\n }\n\n printNewMethod(node, identation) {\n const fieldInits = this.getStructFields(node).map(f => `${this.getIden(identation + 2)}${f.name}: ${f.init},`).join('\\n');\n return `\\nimpl ${this.className} {\\n${this.getIden(identation + 1)}pub fn new() -> Self {\\n${this.getIden(identation + 2)}${this.className} {\\n${fieldInits}\\n${this.getIden(identation + 2)}}\\n${this.getIden(identation + 1)}}\\n}`;\n }\n\n printClass(node, identation) {\n this.rustPrefetchClassTypes(node);\n this.className = node.name.text;\n\n // First pass: collect method signatures for optional param handling\n const methods = node.members.filter(m => m.kind === SyntaxKind.MethodDeclaration);\n methods.forEach((method: any) => {\n const requiredCount = method.parameters.filter(p => !p.initializer && !p.questionToken).length;\n if (requiredCount < method.parameters.length) {\n this.methodSignatures[method.name.text] = { requiredCount };\n }\n });\n\n const struct = this.printStruct(node, identation);\n const newMethod = this.printNewMethod(node, identation);\n const classMethods = methods.map(m => this.printMethodDeclaration(m, identation)).join('\\n\\n');\n return struct + newMethod + `\\nimpl ${this.className} {\\n${classMethods}\\n}`;\n }\n\n printMethodDefinition(node, identation) {\n const name = (node.name as any).text;\n const params = node.parameters;\n const requiredParams = params.filter(p => !p.initializer && !p.questionToken);\n let parsedArgs = ['&self', ...requiredParams.map(p => `${this.printNode(p.name, 0)}: Value`)].join(', ');\n if (requiredParams.length < params.length) {\n parsedArgs += ', optional_args: &[Value]';\n }\n const returnType = this.printRustFunctionType(node);\n const retStr = returnType ? ` -> ${returnType}` : '';\n return `${this.getIden(identation + 1)}pub fn ${name}(${parsedArgs})${retStr}`;\n }\n\n printRustFunctionType(node): string {\n // An internal `: Str` method that proves the conversion prints the\n // native `Option` (its returns run the conversion; callers\n // box back where a `Value` is still needed).\n if (this.rustNativeStrReturnKind(node) === 'str') {\n return 'Option';\n }\n try {\n const checker = this.getChecker();\n if (checker.getReturnTypeOfSignature(checker.getSignatureFromDeclaration(node)).flags === TypeFlags.Void) return '';\n } catch (e) {\n // ignore\n }\n return 'Value';\n }\n\n printMethodDeclaration(node, identation) {\n const methodDef = this.printMethodDefinition(node, identation);\n const params = node.parameters;\n const optionalParams = params.filter(p => p.initializer !== undefined || p.questionToken !== undefined);\n\n // Build optional param initializations\n const optionalInits = optionalParams.map((p, idx) => {\n const defaultVal = p.initializer ? this.printNode(p.initializer, 0) : 'Value::Null';\n return `${this.getIden(identation + 2)}let ${this.printNode(p.name, 0)} = get_arg(optional_args, ${idx}, ${defaultVal});\\n`;\n }).join('');\n\n const blockOpen = this.getBlockOpen(identation);\n const blockClose = this.getBlockClose(identation);\n const shadows = this.rustParamShadowLines(node, identation + 2);\n // D-27: a `handle*` method's `message: Dict` param gets a borrowed\n // `&IndexMap` shadow so its `safe_*` reads print natively.\n const shadowPlan = this.rustProHandlerShadowPlan(node, identation);\n const savedShadowParam = this.rustProHandlerShadowParam;\n if (shadowPlan !== undefined) this.rustProHandlerShadowParam = shadowPlan.param;\n const statements = node.body.statements.map(s => this.printNode(s, identation + 2)).join('\\n');\n this.rustProHandlerShadowParam = savedShadowParam;\n const body = blockOpen + optionalInits + shadows + (shadowPlan?.lines ?? '') + statements + blockClose;\n\n return this.printNodeCommentsIfAny(node, identation, methodDef + body);\n }\n\n printFunctionDefinition(node, identation) {\n const name = node.name?.text ?? '';\n const params = node.parameters;\n const parsedArgs = params.map(p => `${this.printNode(p.name, 0)}: Value`).join(', ');\n const returnType = this.printRustFunctionType(node);\n const retStr = returnType ? ` -> ${returnType}` : '';\n return `${this.getIden(identation)}fn ${name}(${parsedArgs})${retStr}`;\n }\n\n printFunctionDeclaration(node, identation) {\n if (isArrowFunction(node)) {\n const parameters = node.parameters.map(p => `${this.printNode(p.name, 0)}: Value`).join(', ');\n const body = this.printNode(node.body);\n return `|${parameters}| ${body}`;\n }\n const funcDef = this.printFunctionDefinition(node, identation);\n const funcBody = super.printFunctionBody(node, identation);\n return this.printNodeCommentsIfAny(node, identation, funcDef + funcBody);\n }\n\n printOutOfOrderCallExpressionIfAny(node, identation) {\n if (node.expression.kind !== SyntaxKind.PropertyAccessExpression) {\n return undefined;\n }\n\n const expr = node.expression;\n const args = node.arguments;\n\n // Handle this.method(...) calls with optional params\n if (expr.expression.kind === SyntaxKind.ThisKeyword) {\n const methodName = expr.name.text;\n const sig = this.methodSignatures[methodName];\n if (sig) {\n const printArgs = (list) => list.map(a => this.printNode(a, 0)).join(', ');\n const requiredArgs = printArgs(args.slice(0, sig.requiredCount));\n const reqPart = requiredArgs ? `${requiredArgs}, ` : '';\n return `self.${methodName}(${reqPart}&[${printArgs(args.slice(sig.requiredCount))}])`;\n }\n }\n\n return undefined;\n }\n\n printCallExpression(node, identation) {\n const expression = node.expression;\n\n // `this.safeString(, 'k')` — the read inlined against\n // the parameter shadow (D-25). Ahead of the optional-arg dispatch below,\n // which prints the call for any callee with optional parameters\n const shadowSafeRead = this.printShadowSafeReadCall(node);\n if (shadowSafeRead !== undefined) return shadowSafeRead;\n\n // D-27: `this.safe_*(message, \"k\")` on a shadowed WS-handler param —\n // the native `.get(\"k\")` match replaces the `safe_*_k` helper call.\n // Checked first: the out-of-order path would print the boxed call for\n const shadowRead = this.printProHandlerShadowRead(node);\n if (shadowRead !== undefined) return shadowRead;\n\n // Handle console.log specially\n if (expression.kind === SyntaxKind.PropertyAccessExpression) {\n const exprText = expression.getText().trim();\n if (exprText === 'console.log') {\n const args = node.arguments;\n if (args.length === 1) {\n const argText = this.printNode(args[0], 0).trim();\n return `println_val(${argText.startsWith('&') ? argText : `&${argText}`})`;\n }\n // Multiple args: print each\n const argParts = Array.from(args).map(a => {\n const t = this.printNode(a, 0).trim();\n return t.startsWith('Value::') || !t.startsWith('&') ? `&${t}` : t;\n }).join(', ');\n return `println_val(${argParts})`;\n }\n }\n\n const outOfOrder = this.printOutOfOrderCallExpressionIfAny(node, identation);\n if (outOfOrder) {\n return this.rustBoxNativeStrCallIfNeeded(node, outOfOrder);\n }\n\n // `parseInt`/`parseFloat` on a checker-proven string: native `str::parse`\n // instead of the runtime helper the ccxt post-pass would emit.\n const nativeParse = this.printNativeParseCall(node);\n if (nativeParse !== undefined) return nativeParse;\n\n // `this.json(v)`: `Exchange::json` is exactly the free `json_stringify`, which takes the value\n // by reference, so the call sites' `.clone()` is dropped. `self.` args keep the method:\n // the post-pass hoisting `self.(…)` out of `&mut self` args ignores a `&self.`.\n if (expression.kind === SyntaxKind.PropertyAccessExpression &&\n expression.expression.kind === SyntaxKind.ThisKeyword &&\n expression.name.text === 'json' && node.arguments.length === 1) {\n const argText = this.printNode(node.arguments[0], 0).trim();\n if (!argText.includes('self.')) {\n const withoutClone = argText.replace(/\\.clone\\(\\)$/, '');\n return `json_stringify(${this.ensureRef(withoutClone)})`;\n }\n }\n\n return this.rustBoxNativeStrCallIfNeeded(node, super.printCallExpression(node, identation));\n }\n\n printThisKeyword(node, identation) {\n return 'self';\n }\n\n // Native string args to the runtime error constructors, audited against\n // rust/ccxt-base/src/exchange_errors.rs: `msg` is `impl ToErrorMessage` (`&str`/`String`/`Value`\n // yield the same string) and `create_error`'s class name is `&str` (bare literal only).\n private static readonly RUST_ERROR_CONSTRUCTOR_ARGS: Record = {\n ...Object.fromEntries((\n 'exchange_error authentication_error permission_denied account_not_enabled account_suspended ' +\n 'arguments_required bad_request bad_symbol operation_rejected no_change margin_mode_already_set ' +\n 'market_closed manual_interaction_needed restricted_location insufficient_funds invalid_address ' +\n 'address_pending invalid_order order_not_found order_not_cached order_immediately_fillable ' +\n 'order_not_fillable duplicate_order_id contract_unavailable not_supported invalid_proxy_settings ' +\n 'exchange_closed_by_user operation_failed network_error d_do_s_protection rate_limit_exceeded ' +\n 'exchange_not_available on_maintenance invalid_nonce checksum_error request_timeout bad_response ' +\n 'null_response cancel_pending unsubscribe_error '\n ).trim().split(' ').map((n) => [n, ['msg']])),\n create_error: ['str', 'msg'],\n };\n\n // A string literal prints as the bare `\"lit\"` (`&str` — no String\n // allocation); a checker-proven string drops the redundant `Value::Str` box.\n printErrorConstructorArg(name: string, index: number, node, identation: number): string {\n const kind = (RustTranspiler as any).RUST_ERROR_CONSTRUCTOR_ARGS[name]?.[index];\n if (kind === undefined) {\n return this.printNode(node, identation);\n }\n if (isStringLiteral(node) && !(node.text in this.StringLiteralReplacements)) {\n return this.quotedStringLiteral(node.text);\n }\n const printed = this.printNode(node, identation).trim();\n if (kind !== 'msg' || !this.rustTypeIsString(node)) {\n return printed;\n }\n const payload = this.peelValueStrBox(printed)\n ?? this.peelValueStrBox(this.stripOuterParens(printed))\n ?? printed;\n // The `Value::Str(..)` box carries the `Cow` conversion; the error\n // ctors take an `impl ToErrorMessage` (String / &str / Value).\n return payload.replace(/\\.into\\(\\)$/, '');\n }\n\n // `BadRequest` → `bad_request`: the class-to-runtime-fn name the ccxt\n // post-pass applies to `X::new(..)` calls.\n rustErrorConstructorName(className: string): string {\n return this.toSnakeCaseName(className);\n }\n\n printNewExpression(node, identation) {\n let expression = node.expression?.text;\n expression = expression ? expression : this.printNode(node.expression);\n // Plain `new Error(msg)` becomes just the message Value so it can be\n // formatted by `panic!(\"{:?}\", ...)` in printThrowStatement.\n if (expression === 'Error') {\n const args = node.arguments.map(a => this.printNode(a, identation)).join(', ');\n return args || 'Value::Null';\n }\n // CCXT exception classes end in \"Error\", \"Required\", \"Found\", etc. and\n // are constructed via `new XError(msg)`. Route them through the runtime\n // error constructors (snake_case fn calls).\n const errorClassPattern = /^(?:[A-Z][a-zA-Z]*(?:Error|Required|Found|Failed|Rejected|Available|Exceeded|Limit|Pending|Funds|Address|Order|Cached|Fillable|Closed|Maintenance|Nonce|Timeout|Response|Settings|User|Supported|Implemented|Denied|Enabled|Suspended|Symbol|Change|Unavailable|Proxy|Set|Needed))$/;\n if (typeof expression === 'string' && errorClassPattern.test(expression)) {\n const snake = this.rustErrorConstructorName(expression);\n const args = node.arguments.map((a, index) => this.printErrorConstructorArg(snake, index, a, identation)).join(', ');\n return `crate::exchange_errors::${snake}(${args})`;\n }\n // Classes the ccxt post-pass routes to the same constructors — their\n // message argument is audited too; every other `X::new(..)` prints as\n // before.\n const args = typeof expression === 'string'\n ? node.arguments.map((a, index) => this.printErrorConstructorArg(this.rustErrorConstructorName(expression), index, a, identation)).join(', ')\n : node.arguments.map(a => this.printNode(a, identation)).join(', ');\n return `${expression}::new(${args})`;\n }\n\n printPropertyAccessExpression(node, identation) {\n const transformedProperty = this.transformPropertyAcessExpressionIfNeeded(node);\n if (transformedProperty) {\n return this.getIden(identation) + transformedProperty;\n }\n\n const rightSide = node.name.text;\n const rawExpression = node.getText().trim();\n\n if (this.FullPropertyAccessReplacements.hasOwnProperty(rawExpression)) { // eslint-disable-line\n return this.FullPropertyAccessReplacements[rawExpression]; // eslint-disable-line\n }\n\n const leftExpr = this.printNode(node.expression, 0);\n\n if (rightSide === 'length') {\n return this.printArrayLength(node, 0, leftExpr);\n }\n\n // Typed field on a checker-proven map local (`x.field`) reads natively;\n // the ccxt post-pass otherwise rewrites it to `get_value(&x, \"field\")`.\n if (isIdentifier(node.name) && this.isShallowValueReceiver(node.expression) &&\n this.isNativeAccessPositionSafe(node) && !this.isNativeWriteTargetBase(node)) {\n const native = this.printNativeMapAccess(leftExpr, node.expression, String(rightSide));\n if (native) return native;\n }\n\n return `${leftExpr}.${rightSide}`;\n }\n\n // ── native container access (`get_value(...)` -> `.get(...)`) ─────────────\n // When the TypeScript checker proves the receiver is a plain Map/List value\n // and the key is a literal, the runtime `get_value` key-marker / `__live_id`\n // paths cannot apply, so the access is emitted natively. Missing keys still\n // fall back to `Value::Null`.\n\n /** Methods whose Rust counterpart takes `&mut self`: a `self.` read in\n * their args must keep the `get_value(...)` shape the ccxt post-pass hoists. */\n static readonly MUT_SELF_METHODS = new Set([\n 'watch', 'watch_multiple', 'fetch_order_book_snapshot', 'un_watch',\n 'client', 'spawn', 'delay', 'fetch_tickers', 'extend', 'fetch',\n 'send_evm_transaction',\n ]);\n\n /** Global parse helpers that go native (`str::parse`) on a proven string arg,\n * keyed to the rust integer/float type their runtime helper parses into. */\n static readonly RUST_PARSE_HELPERS: Record = {\n parseInt: 'i64',\n parseFloat: 'f64',\n };\n\n toSnakeCaseName(name: string): string {\n return name.replace(/([A-Z]+)([A-Z][a-z])/g, '$1_$2').replace(/([a-z\\d])([A-Z])/g, '$1_$2').toLowerCase();\n }\n\n escapeRustStringLiteral(text: string): string {\n return String(text).replace(/\\\\/g, '\\\\\\\\').replace(/\"/g, '\\\\\"')\n .replace(/\\n/g, '\\\\n').replace(/\\r/g, '\\\\r').replace(/\\t/g, '\\\\t');\n }\n\n getCheckedTypeOf(node): Type | undefined {\n return this.checkerOrUndefined()?.getTypeAtLocation(node);\n }\n\n typeSymbolOf(type: Type): TsSymbol | undefined {\n if (type === undefined || type === null) return undefined;\n return type?.getSymbol() ?? type?.getAliasSymbol();\n }\n\n /** Types declared outside ts/src (Date, Response, Array, Promise, …) are never\n * backed by a plain `Value` map in the rust port. */\n isLibDeclaredType(type: Type): boolean {\n const declarations: any[] = symbolDeclarations(this.typeSymbolOf(type));\n return declarations.some(d => {\n const file = d?.getSourceFile?.()?.fileName ?? '';\n return /[\\\\/]lib\\.[^\\\\/]*\\.d\\.ts$/.test(file) || /[\\\\/]node_modules[\\\\/]typescript[\\\\/]/.test(file);\n });\n }\n\n isClassInstanceType(type: Type): boolean {\n if (type === undefined) return false;\n if (type.flags & (TypeFlags.Union | TypeFlags.Intersection)) {\n return (typeParts(type) ?? []).some((member) => this.isClassInstanceType(member));\n }\n const symbol: any = this.typeSymbolOf(type) ?? type.getAliasSymbol();\n if (symbol?.flags & SymbolFlags.Class) return true;\n const declarations: any[] = symbolDeclarations(symbol);\n return declarations.some(d => isClassDeclaration(d) || isClassExpression(d));\n }\n\n hasCallableShape(type: Type): boolean {\n const checker = this.getChecker();\n return checker.getSignaturesOfType(type, SignatureKind.Call).length > 0 ||\n checker.getSignaturesOfType(type, SignatureKind.Construct).length > 0;\n }\n\n isProvenListType(type: Type): boolean {\n if (!(type.flags & TypeFlags.Object)) return false;\n // Tuple references carry the Tuple flag on their target.\n const objectFlags = ((type as any).objectFlags ?? 0) | ((typeTarget(type)?.objectFlags) ?? 0);\n if (objectFlags & ObjectFlags.Tuple) return true;\n const name = (this.typeSymbolOf(type) as any)?.name;\n if (name === 'Array' || name === 'ReadonlyArray') return true;\n const targetName = (this.typeSymbolOf(typeTarget(type)) as any)?.name;\n return targetName === 'Array' || targetName === 'ReadonlyArray';\n }\n\n /** True only for object types the rust port represents as `Value::Dict`\n * (plain interfaces / index-signature / literal types — never classes). */\n isProvenMapType(type: Type): boolean {\n if (type === undefined) return false;\n if (type.flags & TypeFlags.Union) {\n // `Market` / `Currency` / `Order | undefined` style aliases: the runtime value is the dict (or\n // Null), so a map receiver is proven once every value-carrying member is a proven map. An\n // all-dict union without a nullish member stays on the strict path (a class may hide behind it).\n const parts: Type[] = typeParts(type) ?? [];\n const nullish = parts.filter((p) => this.rustTypeIsNullish(p));\n const valueParts = parts.filter((p) => !this.rustTypeIsNullish(p));\n return nullish.length > 0 && valueParts.length > 0 && valueParts.every((p) => this.isProvenMapType(p));\n }\n if (!(type.flags & TypeFlags.Object)) return false;\n if (this.isProvenListType(type)) return false;\n if (this.hasCallableShape(type)) return false;\n if (this.isClassInstanceType(type)) return false;\n if (this.isLibDeclaredType(type)) return false;\n // A named type or a string index signature; a bare `object` proves nothing.\n const hasStringIndex = this.getChecker().getIndexTypeOfType(type, IndexKind.String) !== undefined;\n return hasStringIndex || this.typeSymbolOf(type) !== undefined;\n }\n\n /** `undefined` / `null` / `void` / `never` — a union member that carries no\n * runtime value; `Value::Null` is the only box these ever get. */\n rustTypeIsNullish(type: Type): boolean {\n return type !== undefined && (type.flags & (TypeFlags.Undefined | TypeFlags.Null | TypeFlags.Void | TypeFlags.Never)) !== 0;\n }\n\n isProvenMapExpression(node: Node): boolean {\n return this.isProvenMapType(this.getCheckedTypeOf(node));\n }\n\n isProvenListExpression(node: Node): boolean {\n if (this.rustIsOrderBookSide(node)) return false;\n const type = this.getCheckedTypeOf(node);\n return type !== undefined && this.isProvenListType(type);\n }\n\n /** RHS of a generator destructure that provably holds a `Value::Arr`: the\n * checker-proven list, or a call whose callee returns an array literal on\n * every path. */\n rustNativeListSource(node: Node): boolean {\n return this.isProvenListExpression(node) || this.rustCallReturnsProvenList(node);\n }\n\n /** `x.split(sep)` → the runtime `split`, which yields an array on every\n * path (a non-string receiver gives the empty array, never a dict). */\n rustCallPrintsRuntimeSplit(node: Node): boolean {\n if (!isCallExpression(node) || node.arguments.length === 0) return false;\n const expression: any = node.expression;\n return isPropertyAccessExpression(expression) && expression.expression.kind !== SyntaxKind.ThisKeyword &&\n String(expression.name.text) === 'split';\n }\n\n /** True when the call's value is always a runtime array: the `handle*AndParams`\n * family and its exchange overrides declare `any`, so the checker cannot\n * prove the `[T, Dict]` tuple the body always builds — walk the resolved\n * callee instead. */\n rustCallReturnsProvenList(node: Node): boolean {\n if (!isCallExpression(node)) return false;\n return this.rustProvenListCall(node, new Set());\n }\n\n private rustProvenListCall(node: Node, stack: Set): boolean {\n if (this.rustCallPrintsRuntimeSplit(node)) return true;\n const declaration = this.rustCalleeDeclaration(node);\n return declaration !== undefined && this.rustFunctionReturnsArrayLiteral(declaration, stack);\n }\n\n /** Implementation of a `x.y(..)` call, when the checker resolves one. */\n private rustCalleeDeclaration(node: Node): Node | undefined {\n if (!isCallExpression(node)) return undefined;\n if (!isPropertyAccessExpression((node as any).expression)) return undefined;\n try {\n return signatureDeclaration((this.getChecker() as any).getResolvedSignature(node));\n } catch (e) {\n return undefined;\n }\n }\n\n /** Every `return` in the function's own body builds an array literal, or\n * delegates to a call that does. `throw` and fall-through (the printer's\n * `Value::Null`) read the same through both forms. */\n private rustFunctionReturnsArrayLiteral(declaration: Node, stack: Set): boolean {\n if (stack.has(declaration)) return false;\n const body: any = (declaration as any).body;\n if (body === undefined || !isBlock(body)) return false;\n stack.add(declaration);\n try {\n let returns = 0;\n let all = true;\n const visit = (node: Node) => {\n if (!all) return;\n if (node !== body && isFunctionLike(node)) return; // nested closure\n if (isReturnStatement(node)) {\n returns++;\n const expression: any = node.expression;\n all = expression !== undefined && (isArrayLiteralExpression(expression) ||\n (isCallExpression(expression) && this.rustProvenListCall(expression, stack)) ||\n (isParenthesizedExpression(expression) && isArrayLiteralExpression(expression.expression)));\n return;\n }\n node.forEachChild(visit);\n };\n body.forEachChild(visit);\n return all && returns > 0;\n } finally {\n stack.delete(declaration);\n }\n }\n\n /** Native list-index read of a generator temp (`__destr_tmp.as_array()…`). */\n printNativeListIndex(receiverText: string, index: number): string {\n return `${receiverText}.as_array().and_then(|__arr| __arr.get(${index})).cloned().unwrap_or(Value::Null)`;\n }\n\n /** Native read for one chain level, or undefined to keep `get_value`. */\n printNativeContainerAccess(receiverText: string, receiverNode: Node, keyNode: Node): string | undefined {\n // A shadowed parameter reads through the borrowed container.\n const shadow = this.rustParamShadowOf(receiverNode);\n if (shadow !== undefined) {\n const native = this.printShadowContainerRead(shadow, keyNode);\n if (native !== undefined) return native;\n }\n if (isStringLiteralLikeNode(keyNode)) {\n return this.printNativeMapAccess(receiverText, receiverNode, keyNode.text);\n }\n if (isNumericLiteral(keyNode)) {\n const index = Number(keyNode.text);\n if (!Number.isInteger(index) || index < 0) return undefined;\n if (!this.isProvenListExpression(receiverNode)) return undefined;\n return this.printNativeListIndex(receiverText, index);\n }\n const dictRead = this.printNativeDynamicMapAccess(receiverText, receiverNode, keyNode) ?? this.printNativeThisFieldDynamicMapAccess(receiverText, receiverNode, keyNode)\n ?? this.rustR10DynamicRead(receiverText, receiverNode, keyNode);\n if (dictRead !== undefined) return dictRead;\n // A non-literal index (the `for (let i = 0; …)` counter) into a\n // checker-proven list reads natively too.\n return this.printNativeDynamicListIndex(receiverText, receiverNode, keyNode) ?? this.r14ListArithIndex(receiverText, receiverNode, keyNode);\n }\n\n /** `get_value(&X, &i)` for a checker-proven list `X` and a dynamic integer\n * index local `i`: the runtime's own array branch, spelled natively.\n * `get_value` reaches its array arm for an `Arr` receiver and its default\n * (`Value::Null`) otherwise, so the emitted match reproduces both — an\n * `Int` index by value (a negative or out-of-range index misses), a\n * numeric string by parse, anything else a miss. */\n printNativeDynamicListIndex(receiverText: string, receiverNode: Node, keyNode: Node): string | undefined {\n if (!this.isProvenListExpression(receiverNode)) return undefined;\n if (!this.isRustValueIndexKey(keyNode)) return undefined;\n // The ccxt `writeBackIndexedMutations` pass matches the `let x = get_value(&C, &K)` text to\n // write a mutated `x` back into `C[K]`; native text is invisible to it, so a bind the next\n // statement mutates keeps the helper.\n if (this.isWriteBackBindRead(keyNode.parent)) return undefined;\n const keyText = this.printNode(keyNode, 0).trim();\n // A text that already carries the post-pass `&` is not a place.\n if (!keyText || keyText.startsWith('&')) return undefined;\n return `${receiverText}.as_array().and_then(|__arr| match &${keyText} { Value::Int(__n) => __arr.get(*__n as usize), Value::Str(__s) => __s.parse::().ok().and_then(|__n| __arr.get(__n)), _ => None }).cloned().unwrap_or(Value::Null)`;\n }\n\n /** True when this read initialises a local that the very next statement in\n * the same block mutates (`x['k'] = v` -> `add_element_to_object(&mut x…)`,\n * `x.push(v)` -> `append_to_array(&mut x…)`). */\n isWriteBackBindRead(read: Node): boolean {\n const declaration: any = read === undefined ? undefined : read.parent;\n if (declaration === undefined || !isVariableDeclaration(declaration) || declaration.initializer !== read) return false;\n if (!isIdentifier(declaration.name)) return false;\n const name = String(declaration.name.text);\n let statement: any = declaration;\n while (statement !== undefined && !isStatement(statement)) statement = statement.parent;\n const siblings: any[] = statement?.parent?.statements ?? [];\n const at = siblings.indexOf(statement);\n if (at < 0 || at + 1 >= siblings.length) return false;\n return this.rustStatementMutatesLocal(siblings[at + 1], name);\n }\n\n /** A statement containing a write into a local (`x['k'] = v`, `x.k = v`,\n * `x.push(v)`). */\n rustStatementMutatesLocal(node: Node, name: string): boolean {\n let mutated = false;\n const visit = (n: Node) => {\n if (mutated) return;\n if ((isBinaryExpression(n) && rustIsAssignmentOperator(n.operatorToken.kind) && this.rootPlaceText(n.left) === name) ||\n (isCallExpression(n) && isPropertyAccessExpression(n.expression) &&\n n.expression.name.text === 'push' && this.rootPlaceText(n.expression.expression) === name)) {\n mutated = true;\n return;\n }\n n.forEachChild(visit);\n };\n node.forEachChild(visit);\n return mutated;\n }\n\n /** A dynamic index the printer emits as a `Value` number: a `let x = ` declaration of the same function (the C-style loop counter).\n * Any other shape keeps the helper — the printed local could be a native\n * `i64`/`f64`, which the `Value` match would not compile against. */\n isRustValueIndexKey(node: Node): boolean {\n const current: any = this.rustSkipWrappers(node);\n if (!isIdentifier(current)) return false;\n const type = this.getCheckedTypeOf(current);\n if (type === undefined || !(type.flags & (TypeFlags.Number | TypeFlags.NumberLiteral))) return false;\n const declaration: any = this.rustDeclarationOfIdentifier(current);\n if (declaration === undefined || !isVariableDeclaration(declaration) || declaration.initializer === undefined) return false;\n return isNumericLiteral(this.rustSkipWrappers(declaration.initializer));\n }\n\n /** Strips `( )`, `as T` and `!` wrappers. */\n rustSkipWrappers(node: any): any {\n while (node !== undefined && (isParenthesizedExpression(node) || isAsExpression(node) || isNonNullExpression(node))) node = node.expression;\n return node;\n }\n\n // Typed-parameter dict reads: a checker-proven plain dict param (`Dict`, `Dictionary`,\n // `Market`-style alias) holds the dict or `Value::Null`, so `get_value`'s marker routes cannot\n // fire and the read is `m.get(k)`. The key must be a proven `Str` box so `.as_str()` reproduces it.\n\n /** The parameter declaration behind a receiver when its *annotation* proves\n * a plain dict; undefined otherwise (no proof → keep the helper). */\n rustProvenDictParameter(node: Node): ParameterDeclaration | undefined {\n const declaration: any = this.rustDeclarationOfIdentifier(node);\n if (declaration === undefined || !isParameterDeclaration(declaration)) return undefined;\n if (declaration.type === undefined) return undefined;\n const type = this.getCheckedTypeOf(declaration.type);\n if (type === undefined || !this.isProvenMapType(type)) return undefined;\n // D2: a later write can change the kind.\n return this.rustLocalIsReassigned(declaration, String((declaration.name as any).text)) ? undefined : declaration;\n }\n\n /** `Str` (`string | undefined`) — the key box is `Value::Str` or Null. */\n rustKeyIsProvenString(node: Node): boolean {\n const type = this.getCheckedTypeOf(node);\n if (type === undefined) return false;\n const parts: Type[] = (type.flags & TypeFlags.Union) ? (typeParts(type) ?? []) : [type];\n let strings = 0;\n for (const part of parts) {\n if (part.flags & (TypeFlags.String | TypeFlags.StringLiteral)) {\n strings++;\n continue;\n }\n if (this.rustTypeIsNullish(part)) continue;\n return false;\n }\n return strings > 0;\n }\n\n /** The local/parameter proof of a dynamic-key map read: a parameter whose\n * annotation proves a plain dict (B-25), or any local whose checker type\n * proves a plain map and which nothing in the enclosing function\n * re-assigns (D2). Returns the proven declaration. */\n rustProvenDynamicMapReceiver(node: Node): Declaration | undefined {\n const parameter = this.rustProvenDictParameter(node);\n if (parameter !== undefined) return parameter;\n if (!isIdentifier(node)) return undefined;\n const declaration: any = this.rustDeclarationOfIdentifier(node);\n if (declaration === undefined || !isVariableDeclaration(declaration)) return undefined;\n if (declaration.initializer === undefined) return undefined;\n if (!this.isProvenMapExpression(node)) return undefined;\n if (this.rustLocalIsReassigned(declaration, String(node.text))) return undefined;\n return declaration;\n }\n\n /** The element-access read a key node belongs to (`x[k]`, `x[(k)]`). */\n rustElementReadOfKey(keyNode: Node): Node | undefined {\n let current: any = keyNode;\n while (current !== undefined && (isParenthesizedExpression(current) || isAsExpression(current) || isNonNullExpression(current))) {\n current = current.parent;\n }\n const parent: any = current === undefined ? undefined : current.parent;\n if (parent === undefined || !isElementAccessExpression(parent) || parent.argumentExpression !== current) return undefined;\n return parent;\n }\n\n /** `x[k]` where `x` is a proven-dict parameter and `k` a proven string. */\n printNativeDynamicMapAccess(receiverText: string, receiverNode: Node, keyNode: Node): string | undefined {\n if (this.rustProvenDynamicMapReceiver(receiverNode) === undefined) return undefined;\n if (!this.rustKeyIsProvenString(keyNode)) return undefined;\n // The ccxt `writeBackIndexedMutations` pass matches the\n // `let x = get_value(&C, &K)` text to write a mutated `x` back into\n // `C[K]`; the native text is invisible to it, so a bind the next\n const read = this.rustElementReadOfKey(keyNode);\n if (read !== undefined && this.isWriteBackBindRead(read)) return undefined;\n const keyText = this.printNode(keyNode, 0).trim();\n // A plain place keeps the borrow local; a call/temporary text does not.\n if (!/^[A-Za-z_][A-Za-z0-9_]*$/.test(keyText)) return undefined;\n if (this.rustNodeIsKeyUnsafePlace(keyText)) return undefined;\n return `${receiverText}.as_map().and_then(|__m| ${keyText}.as_str().and_then(|__k| __m.get(__k))).cloned().unwrap_or(Value::Null)`;\n }\n\n /** Keys `get_value` serves from the book store / cache bucket / live\n * snapshot instead of the dict itself — a dynamic read cannot prove the\n * key away, so a place named after one stays boxed. */\n rustNodeIsKeyUnsafePlace(keyText: string): boolean {\n return RustTranspiler.RUST_DICT_LOCAL_UNSAFE_KEYS.has(keyText);\n }\n\n // ── parameter shadows (`let x = x.as_map().unwrap_or(&__x_empty)`) ─────────\n //\n // A `Dict`/`List` parameter holds the container or `Value::Null`, and\n\n private paramShadowCache: { src: SourceFile, tables: Map> } | undefined;\n\n /** Functions whose shadow lines were actually emitted — a read converts\n * only inside one of those (an arrow body prints inline and gets none). */\n private paramShadowEmitted: { src: SourceFile, fns: Set } | undefined;\n\n private rustParamShadowEmittedSet(): Set {\n const src = this.getSrc();\n if (this.paramShadowEmitted === undefined || this.paramShadowEmitted.src !== src) {\n this.paramShadowEmitted = { src, fns: new Set() };\n }\n return this.paramShadowEmitted.fns;\n }\n\n rustParamShadowTables(): Map> {\n const src = this.getSrc();\n if (this.paramShadowCache === undefined || this.paramShadowCache.src !== src) {\n this.paramShadowCache = { src, tables: new Map() };\n }\n return this.paramShadowCache.tables;\n }\n\n /** Emitted shadow lines for a function, or '' when no parameter qualifies.\n * The caller must use this before printing the body statements (it both\n * registers the function as shadowed and computes the lines). */\n rustParamShadowLines(fn: Node, identation: number): string {\n const table = this.rustParamShadowTable(fn);\n if (table.size === 0) return '';\n const idn = this.getIden(identation);\n const lines: string[] = [];\n for (const shadow of table.values()) {\n const empty = `__${shadow.name}_empty`;\n if (this.rustFunctionDeclaresName(fn, empty)) continue;\n const map = shadow.kind === RUST_PARAM_SHADOWS.MAP;\n const accessor = map ? 'as_map' : 'as_array';\n lines.push(`${idn}let ${empty} = ${map ? 'indexmap::IndexMap::new()' : 'Vec::new()'};`);\n lines.push(`${idn}let ${shadow.name} = ${shadow.name}.${accessor}().unwrap_or(&${empty});`);\n }\n if (lines.length === 0) return '';\n this.rustParamShadowEmittedSet().add(fn);\n return lines.join('\\n') + '\\n';\n }\n\n private rustParamShadowTable(fn: Node): Map {\n const tables = this.rustParamShadowTables();\n let table = tables.get(fn);\n if (table === undefined) {\n try {\n table = this.collectRustParamShadows(fn);\n } catch (e) {\n table = new Map(); // no proof -> every read keeps its helper\n }\n tables.set(fn, table);\n }\n return table;\n }\n\n /** The shadow a read receiver resolves to, or undefined (no proof → helper). */\n rustParamShadowOf(node: Node): RustParamShadow | undefined {\n const current: any = this.rustSkipWrappers(node);\n if (current === undefined || !isIdentifier(current)) return undefined;\n const name = String(current.text);\n const declaration = this.rustDeclarationOfIdentifier(current);\n if (declaration === undefined || !isParameterDeclaration(declaration)) return undefined;\n const emitted = this.rustParamShadowEmittedSet();\n let scope: any = current.parent;\n while (scope !== undefined) {\n if (isFunctionLike(scope)) {\n const entry = emitted.has(scope) ? this.rustParamShadowTable(scope).get(name) : undefined;\n if (entry !== undefined && entry.declaration === declaration) return entry;\n }\n scope = scope.parent;\n }\n return undefined;\n }\n\n /** True when the enclosing function already binds this name somewhere. */\n private rustFunctionDeclaresName(fn: Node, name: string): boolean {\n let found = false;\n this.rustWalkScope(fn, (node: Node) => {\n if (isFunctionLike(node)) return RUST_WALK_SKIP; // nested closure: own scope\n if ((isVariableDeclaration(node) || isParameterDeclaration(node)) && isIdentifier(node.name) && node.name.text === name) {\n found = true;\n return RUST_WALK_STOP;\n }\n });\n return found;\n }\n\n private collectRustParamShadows(fn: Node): Map {\n const table = new Map();\n const parameters: any[] = (fn as any).parameters ?? [];\n const body: any = (fn as any).body;\n if (body === undefined) return table;\n for (const param of parameters) {\n if (!isParameterDeclaration(param) || !isIdentifier(param.name)) continue;\n const name = String(param.name.text);\n if (name === 'optional_args') continue;\n if (param.type === undefined) continue;\n const type = this.getCheckedTypeOf(param.type);\n if (type === undefined) continue;\n const kind: RustParamShadowKind | undefined = this.isProvenMapType(type) ? RUST_PARAM_SHADOWS.MAP :\n this.isProvenShadowListType(type) ? RUST_PARAM_SHADOWS.LIST : undefined;\n if (kind === undefined) continue;\n if (this.rustParameterIsClientHandle(param)) continue;\n if (this.rustParamShadowUseCensus(fn, param, kind) === undefined) continue;\n table.set(name, { kind, name, declaration: param });\n }\n return table;\n }\n\n /** A checker-proven array parameter type (`Vec` on the rust side);\n * tuples are excluded (their printed shape is not a plain `Vec`). */\n isProvenShadowListType(type: Type): boolean {\n if (type === undefined) return false;\n if (!(type.flags & TypeFlags.Object)) return false;\n const objectFlags = ((type as any).objectFlags ?? 0) | ((typeTarget(type)?.objectFlags) ?? 0);\n if (objectFlags & ObjectFlags.Tuple) return false;\n if (this.hasCallableShape(type)) return false;\n if (this.isClassInstanceType(type)) return false;\n const name = (this.typeSymbolOf(type) as any)?.name;\n if (name === 'Array' || name === 'ReadonlyArray') return true;\n const targetName = (this.typeSymbolOf(typeTarget(type)) as any)?.name;\n return targetName === 'Array' || targetName === 'ReadonlyArray';\n }\n\n /** Every reference to the parameter must be a printable read, and at least\n * one must exist; anything else (a write, a `Value` pass-through, a Null\n * comparison, a marker key) answers undefined and the parameter keeps its\n * box. */\n private rustParamShadowUseCensus(fn: Node, param: ParameterDeclaration, kind: RustParamShadowKind): { reads: number } | undefined {\n const name = String((param.name as Identifier).text);\n const paramSymbol = this.rustSymbolOf(param.name as Identifier);\n if (paramSymbol === undefined) return undefined;\n let reads = 0;\n let ok = true;\n const visit = (node: Node) => {\n if (!ok) return;\n if (isIdentifier(node) && node.text === name && node !== param.name) {\n if (this.rustSymbolOf(node) !== paramSymbol || !this.rustParamUseIsRead(node, kind)) {\n ok = false;\n return;\n }\n reads++;\n }\n node.forEachChild(visit);\n };\n (fn as any).body.forEachChild(visit);\n return ok && reads > 0 ? { reads } : undefined;\n }\n\n /** One reference of a shadow candidate: true only for a read the shadow can\n * print exactly (same proofs the emitted forms re-check). */\n private rustParamUseIsRead(id: Identifier, kind: RustParamShadowKind): boolean {\n const parent: any = id.parent;\n if (parent === undefined) return false;\n // `x[k]` — element read. Writes (`x[k] = v`, `x[k].push(..)`) and the\n // post-pass write-back binds keep the box.\n if (isElementAccessExpression(parent) && parent.expression === id) {\n if (this.isNativeWriteTargetBase(id)) return false;\n if (!this.isNativeAccessPositionSafe(id)) return false;\n if (this.isWriteBackBindRead(parent)) return false;\n return this.rustShadowKeyIsReadable(parent.argumentExpression, kind);\n }\n // `x.length` — array length read.\n if (isPropertyAccessExpression(parent) && parent.expression === id) {\n return kind === RUST_PARAM_SHADOWS.LIST && String(parent.name.text) === 'length';\n }\n // `'k' in x` / `k in x`.\n if (isBinaryExpression(parent) && parent.operatorToken.kind === SyntaxKind.InKeyword && parent.right === id) {\n if (kind !== RUST_PARAM_SHADOWS.MAP) return false;\n return this.rustShadowKeyIsReadable(parent.left, RUST_PARAM_SHADOWS.MAP);\n }\n // `this.safe(x, 'k'[, default])` — the read families the shadow\n // inlines (literal keys only). Any other call keeps the box.\n if (isCallExpression(parent) && kind === RUST_PARAM_SHADOWS.MAP) {\n if (this.rustShadowSafeCallee(parent) === undefined) return false;\n const args: NodeArray = parent.arguments;\n if (args[0] !== id || args.length < 2 || args.length > 3) return false;\n return this.rustShadowKeyIsLiteral(args[1]);\n }\n return false;\n }\n\n /** A key a shadow read can print: dicts take a bare string literal or a\n * proven-string place, lists a literal non-negative index; the `safe_*`\n * inline takes the literal key form only. Marker-route key names and keys\n * whose text needs escaping are excluded. */\n private rustShadowKeyIsReadable(key: any, kind: RustParamShadowKind): boolean {\n if (key === undefined) return false;\n if (kind === RUST_PARAM_SHADOWS.MAP) {\n if (isStringLiteralLikeNode(key)) return this.rustShadowKeyIsLiteral(key);\n if (isIdentifier(key)) {\n return this.rustKeyIsProvenString(key) && !this.rustNodeIsKeyUnsafePlace(String(key.text));\n }\n return false;\n }\n if (isNumericLiteral(key)) {\n const index = Number(key.text);\n return Number.isInteger(index) && index >= 0;\n }\n return false;\n }\n\n private rustShadowKeyIsLiteral(key: any): boolean {\n if (key === undefined || !isStringLiteralLikeNode(key)) return false;\n const text = String(key.text);\n return this.rustShadowKeyLiteral(text) && !this.rustNodeIsKeyUnsafePlace(text);\n }\n\n /** Keys whose text is safe to inline into a rust string literal. */\n private rustShadowKeyLiteral(text: string): boolean {\n return /^[A-Za-z0-9_./-]*$/.test(text) && text.length > 0;\n }\n\n /** `this.safeString`-style callee of a call, or undefined. */\n private rustShadowSafeCallee(node: CallExpression): string | undefined {\n const callee: any = (node as any).expression;\n if (callee === undefined || !isPropertyAccessExpression(callee)) return undefined;\n if (callee.expression.kind !== SyntaxKind.ThisKeyword) return undefined;\n const name = String(callee.name.text);\n return RUST_PARAM_SHADOWS.SAFE_READS.has(name) ? name : undefined;\n }\n\n /** `x['k']` / `x[i]` / `'k' in x` on a shadowed parameter: the native read,\n * or undefined to keep the helper (the census guarantees it never happens\n * for an emitted shadow). */\n printShadowContainerRead(shadow: RustParamShadow, keyNode: Node): string | undefined {\n const key: any = keyNode;\n if (shadow.kind === RUST_PARAM_SHADOWS.MAP) {\n const k = this.rustShadowMapKey(key);\n if (k === undefined) return undefined;\n return k.literal !== undefined ? `${shadow.name}.get(\"${k.literal}\").cloned().unwrap_or(Value::Null)`\n : `${k.place}.as_str().and_then(|__k| ${shadow.name}.get(__k)).cloned().unwrap_or(Value::Null)`;\n }\n if (isNumericLiteral(key)) {\n const index = Number(key.text);\n if (!Number.isInteger(index) || index < 0) return undefined;\n return `${shadow.name}.get(${index}).cloned().unwrap_or(Value::Null)`;\n }\n return undefined;\n }\n\n /** `'k' in x` on a shadowed dict parameter. */\n printShadowInOperator(shadow: RustParamShadow, keyNode: Node): string | undefined {\n if (shadow.kind !== RUST_PARAM_SHADOWS.MAP) return undefined;\n const k = this.rustShadowMapKey(keyNode);\n if (k === undefined) return undefined;\n return k.literal !== undefined ? `Value::Bool(${shadow.name}.contains_key(\"${k.literal}\"))`\n : `Value::Bool(${k.place}.as_str().map(|__k| ${shadow.name}.contains_key(__k)).unwrap_or(false))`;\n }\n\n /** A shadow dict key: an inlinable literal, or a proven-string plain place. */\n private rustShadowMapKey(key: any): { literal?: string, place?: string } | undefined {\n if (isStringLiteralLikeNode(key)) {\n const text = String(key.text);\n return this.rustShadowKeyLiteral(text) && !this.rustNodeIsKeyUnsafePlace(text) ? { literal: text } : undefined;\n }\n if (!isIdentifier(key) || !this.rustKeyIsProvenString(key) || this.rustNodeIsKeyUnsafePlace(String(key.text))) return undefined;\n const place = this.printNode(key, 0).trim();\n return /^[A-Za-z_][A-Za-z0-9_]*$/.test(place) ? { place } : undefined;\n }\n\n /** `x.length` on a shadowed list parameter — `get_array_length` natively. */\n printShadowLength(shadow: RustParamShadow): string | undefined {\n if (shadow.kind !== RUST_PARAM_SHADOWS.LIST) return undefined;\n return `Value::Int(${shadow.name}.len() as i64)`;\n }\n\n /** `this.safe(x, 'k'[, default])` on a shadowed dict parameter: the\n * runtime helper's exact semantics over `.get(..)`. */\n printShadowSafeReadCall(node: CallExpression): string | undefined {\n const callee = this.rustShadowSafeCallee(node);\n if (callee === undefined) return undefined;\n const args: any[] = (node as any).arguments ?? [];\n if (args.length < 2 || args.length > 3) return undefined;\n const shadow = this.rustParamShadowOf(args[0]);\n if (shadow === undefined || shadow.kind !== RUST_PARAM_SHADOWS.MAP) return undefined;\n const key: any = args[1];\n if (!isStringLiteralLikeNode(key)) return undefined;\n const text = String(key.text);\n if (!this.rustShadowKeyLiteral(text) || this.rustNodeIsKeyUnsafePlace(text)) return undefined;\n const fallback = args.length === 3 ? this.printNode(args[2], 0).trim() : 'Value::Null';\n const get = `${shadow.name}.get(\"${text}\")`;\n // The ccxt post-pass strips the `;` of a statement ending in `};`\n // (`[/\\};(\\s*\\n)/g, '}$1']`), so the match — like the printer's other\n // block-valued expressions — is parenthesized.\n const wrap = (text: string) => `(${text})`;\n switch (callee) {\n case 'safeValue':\n return wrap(`match ${get} { Some(__v) if !matches!(__v, Value::Null) && !matches!(__v, Value::Str(__s) if __s.is_empty()) => __v.clone(), _ => ${fallback} }`);\n case 'safeString':\n return wrap(`match ${get} { Some(Value::Str(__s)) if !__s.is_empty() => Value::Str(__s.clone()), Some(Value::Int(__n)) => Value::Str(__n.to_string().into()), Some(Value::Float(__f)) => Value::Str(__f.to_string().into()), _ => ${fallback} }`);\n case 'safeInteger':\n return wrap(`match ${get} { Some(Value::Int(__n)) => Value::Int(*__n), Some(Value::Float(__f)) => Value::Int(*__f as i64), Some(Value::Str(__s)) => match __s.parse::() { Ok(__n) => Value::Int(__n), Err(_) => match __s.parse::() { Ok(__f) if __f.is_finite() => Value::Int(__f as i64), _ => ${fallback} } }, _ => ${fallback} }`);\n case 'safeNumber':\n return wrap(`match ${get} { Some(Value::Float(__f)) => Value::Float(*__f), Some(Value::Int(__n)) => Value::Float(*__n as f64), Some(Value::Str(__s)) => match __s.parse::() { Ok(__n) => Value::Float(__n), Err(_) => ${fallback} }, _ => ${fallback} }`);\n case 'safeBool':\n return wrap(`match ${get} { Some(Value::Bool(__b)) => Value::Bool(*__b), _ => ${fallback} }`);\n case 'safeDict':\n return wrap(`match ${get} { Some(__v) if matches!(__v, Value::Dict(_)) => __v.clone(), _ => ${fallback} }`);\n case 'safeList':\n return wrap(`match ${get} { Some(__v) if matches!(__v, Value::Arr(_)) => __v.clone(), _ => ${fallback} }`);\n }\n return undefined;\n }\n\n // ── pro-tier WS handler `message` shadow (D-27) ───────────────────────────\n // `handle_x (client: Client, message: Dict)` is dispatched by NAME with\n // `Value` args, so the printed signature keeps `Value`; the annotation still\n\n /** The borrowed view bound by the shadow. */\n private static readonly PRO_HANDLER_SHADOW_NAME = '__pro_message';\n\n /** TS helper name -> emitted match kind. */\n private static readonly PRO_HANDLER_SHADOW_SAFE_READS: Record = {\n 'safeValue': 'value',\n 'safeString': 'string',\n 'safeInteger': 'integer',\n 'safeNumber': 'float',\n 'safeFloat': 'float',\n 'safeDict': 'dict',\n 'safeList': 'list',\n 'safeBool': 'bool',\n };\n\n /** The `message: Dict` parameter of a WS handler method (2nd param of a\n * `handle*` method), undefined when unproven or written (D2). */\n rustProHandlerMessageParam(node: Node): ParameterDeclaration | undefined {\n if (node === undefined || !isMethodDeclaration(node) || node.body === undefined) return undefined;\n const params: any[] = (node.parameters ?? []) as any;\n if (params.length < 2) return undefined;\n const methodName: any = node.name;\n if (methodName === undefined || !/^handle[A-Z]/.test(String(methodName.text ?? ''))) return undefined;\n const param: any = params[1];\n if (param === undefined || !isIdentifier(param.name) || param.type === undefined) return undefined;\n // The ws-handler shape `handle_x (client: Client, message: Dict)`: the\n // message is a required parameter and the first one is the Client\n // class handle. (Base helpers like `handleMarginModeAndParams\n if (param.initializer !== undefined || param.questionToken !== undefined) return undefined;\n const clientParam: any = params[0];\n if (clientParam === undefined || clientParam.type === undefined) return undefined;\n const clientType = this.getCheckedTypeOf(clientParam.type);\n if (clientType === undefined || !this.isClassInstanceType(clientType)) return undefined;\n const type = this.getCheckedTypeOf(param.type);\n if (type === undefined || !this.isProvenMapType(type)) return undefined;\n const name = String(param.name.text);\n return this.rustProHandlerParamIsWritten(param, name) ? undefined : param;\n }\n\n /** D2: a write rooted at the parameter (reassignment, element/property\n * write, a merge/splice onto it) can reshape the dict after the shadow is\n * taken — the shadow is skipped and every read keeps the helper. */\n rustProHandlerParamIsWritten(param: ParameterDeclaration, name: string): boolean {\n if (this.rustLocalIsReassigned(param, name)) return true;\n const scope = this.rustEnclosingFunction(param);\n if (scope === undefined) return true;\n if (this.rustStatementMutatesLocal(scope, name)) return true;\n const merging = ['deepExtend', 'extend', 'addElementToObject', 'remove'];\n let written = false;\n this.rustWalkScope(scope, (n: Node) => {\n if (isCallExpression(n) && n.arguments.length > 0 && isIdentifier(n.arguments[0]) && (n.arguments[0] as any).text === name) {\n const callee: any = n.expression;\n written = merging.includes(isPropertyAccessExpression(callee) ? String(callee.name?.text ?? '') :\n isIdentifier(callee) ? String(callee.text ?? '') : '');\n if (written) return RUST_WALK_STOP;\n }\n });\n return written;\n }\n\n /** Shadow plan for a handler: the parameter plus the two binding lines,\n * present only when some body read actually turns native (no dead shed). */\n rustProHandlerShadowPlan(node: Node, identation: number): { param: ParameterDeclaration, lines: string } | undefined {\n const param = this.rustProHandlerMessageParam(node);\n if (param === undefined) return undefined;\n // a D-25 parameter shadow already rebinds the name to the borrowed map; its reads are native\n if (this.rustParamShadowTable(node).has(String((param.name as any).text))) return undefined;\n const saved = this.rustProHandlerShadowParam;\n this.rustProHandlerShadowParam = param;\n let hasRead = false;\n const scope = this.rustEnclosingFunction(param);\n this.rustWalkScope(scope, (n: Node) => {\n if (isCallExpression(n) && this.printProHandlerShadowRead(n, true) !== undefined) {\n hasRead = true;\n return RUST_WALK_STOP;\n }\n });\n this.rustProHandlerShadowParam = saved;\n if (!hasRead) return undefined;\n const name = String((param.name as any).text);\n const view = RustTranspiler.PRO_HANDLER_SHADOW_NAME;\n const arc = `${view}_arc`;\n const map = 'indexmap::IndexMap';\n const ind = this.getIden(identation + 2);\n const lines =\n `${ind}let ${arc}: std::sync::Arc<${map}> = (match &${name} { Value::Dict(__d) => __d.clone(), _ => std::sync::Arc::new(indexmap::IndexMap::new()) });\\n` +\n `${ind}let ${view}: &${map} = &${arc};\\n`;\n return { param, lines };\n }\n\n /** The `safe_*` call on the shadowed parameter prints as a native\n * `.get(\"k\")` match, or undefined when the call is not one. In `probe`\n * mode the shape is checked without printing (the pre-scan must not print\n * a node twice). */\n printProHandlerShadowRead(node: Node, probe = false): string | undefined {\n const param = this.rustProHandlerShadowParam;\n if (param === undefined || node === undefined || !isCallExpression(node)) return undefined;\n const callee: any = node.expression;\n if (callee === undefined || !isPropertyAccessExpression(callee)) return undefined;\n if (callee.expression.kind !== SyntaxKind.ThisKeyword) return undefined;\n const kind = RustTranspiler.PRO_HANDLER_SHADOW_SAFE_READS[String(callee.name?.text ?? '')];\n if (kind === undefined) return undefined;\n const args: any[] = (node.arguments ?? []) as any;\n if (args.length < 2 || args.length > 3) return undefined;\n const receiver: any = args[0];\n if (receiver === undefined || receiver.kind !== SyntaxKind.Identifier) return undefined;\n if (this.rustDeclarationOfIdentifier(receiver) !== param) return undefined;\n const key: any = args[1];\n if (key === undefined || !isStringLiteral(key)) return undefined;\n const keyText = key.text;\n if (keyText === '' || RustTranspiler.RUST_DICT_LOCAL_UNSAFE_KEYS.has(keyText)) return undefined;\n if (args.length === 3 && !this.rustProHandlerShadowDefaultShape(args[2])) return undefined;\n if (probe) return 'native';\n const dflt = args.length === 3 ? this.rustProHandlerShadowDefault(args[2]) : 'Value::Null';\n if (dflt === undefined) return undefined;\n return this.rustProHandlerShadowReadText(kind, this.escapeRustStringLiteral(keyText), dflt);\n }\n\n /** A miss-arm default the match can hold: absent (`Value::Null`) or a\n * literal; a computed default keeps the helper (its Value is not\n * re-printable inside an arm without re-evaluating it twice). */\n rustProHandlerShadowDefaultShape(node: Node): boolean {\n return node.kind === SyntaxKind.StringLiteral || node.kind === SyntaxKind.NumericLiteral ||\n node.kind === SyntaxKind.TrueKeyword || node.kind === SyntaxKind.FalseKeyword ||\n node.kind === SyntaxKind.NullKeyword || node.kind === SyntaxKind.ArrayLiteralExpression ||\n node.kind === SyntaxKind.ObjectLiteralExpression ||\n (isIdentifier(node) && (node as any).text === 'undefined');\n }\n\n rustProHandlerShadowDefault(node: Node): string | undefined {\n if (!this.rustProHandlerShadowDefaultShape(node)) return undefined;\n const text = this.printNode(node, 0).trim();\n return text === '' ? undefined : text;\n }\n\n /** Exact native form of the runtime `_k` helper: same value kinds, same\n * empty-string-is-missing rule, same default (verified against\n * `exchange_stubs.rs`). `.cloned()` keeps the emitted line clone-free for\n * the ccxt clone-pruning passes; the parenthesised `match` keeps the\n * driver's `};` trailing-block replacement off the statement's `;`. */\n rustProHandlerShadowReadText(kind: string, key: string, dflt: string): string {\n const m = RustTranspiler.PRO_HANDLER_SHADOW_NAME;\n const at = `${m}.get(\"${key}\").cloned()`;\n switch (kind) {\n case 'value':\n return `(match ${at} { Some(Value::Str(__s)) if __s.is_empty() => ${dflt}, Some(__v) => __v, None => ${dflt} })`;\n case 'string':\n return `(match ${at} { Some(Value::Str(__s)) if !__s.is_empty() => Value::Str(__s), Some(Value::Int(__n)) => Value::Str(__n.to_string().into()), Some(Value::Float(__f)) => Value::Str(__f.to_string().into()), _ => ${dflt} })`;\n case 'integer':\n return `(match ${at} { Some(Value::Int(__n)) => Value::Int(__n), Some(Value::Float(__f)) => Value::Int(__f as i64), Some(Value::Str(__s)) if !__s.is_empty() => match __s.parse::() { Ok(__n) => Value::Int(__n), Err(_) => match __s.parse::() { Ok(__f) if __f.is_finite() => Value::Int(__f as i64), _ => ${dflt} } }, _ => ${dflt} })`;\n case 'float':\n return `(match ${at} { Some(Value::Float(__f)) => Value::Float(__f), Some(Value::Int(__n)) => Value::Float(__n as f64), Some(Value::Str(__s)) if !__s.is_empty() => match __s.parse::() { Ok(__f) => Value::Float(__f), Err(_) => ${dflt} }, _ => ${dflt} })`;\n case 'dict':\n return `(match ${at} { Some(__v) if matches!(__v, Value::Dict(_)) => __v, _ => ${dflt} })`;\n case 'list':\n return `(match ${at} { Some(__v) if matches!(__v, Value::Arr(_)) => __v, _ => ${dflt} })`;\n case 'bool':\n return `(match ${at} { Some(__v) if matches!(__v, Value::Bool(_)) => __v, _ => ${dflt} })`;\n }\n return undefined;\n }\n\n printNativeMapAccess(receiverText: string, receiverNode: Node, keyText: string): string | undefined {\n if (!this.isProvenMapExpression(receiverNode) && !this.rustR10LiteralReadOk(receiverNode, keyText)) {\n // Declared-Dict locals read natively too (see the classifier below).\n if (!this.rustIsDeclaredDictLocal(receiverNode)) return undefined;\n if (RustTranspiler.RUST_DICT_LOCAL_UNSAFE_KEYS.has(keyText)) return undefined;\n if (keyText === '' || /^\\d+$/.test(keyText)) return undefined;\n }\n const key = this.escapeRustStringLiteral(keyText);\n return `${receiverText}.as_map().and_then(|__m| __m.get(\"${key}\")).cloned().unwrap_or(Value::Null)`;\n }\n\n // Declared-Dict locals: the checker types many dict-holding locals `any`, losing the proof\n // above, but the declaration still proves a plain dict (object literal, `getArg(.., {})` bag,\n // `this.safeDict`, `extend` onto those, or an element of a map-typed container) at every read.\n\n /** Keys `get_value(_k)` serves from the book store, a cache bucket or a\n * live `__live_id` snapshot instead of from the dict itself: those routes\n * are invisible to a plain map read, so they keep the helper. */\n static readonly RUST_DICT_LOCAL_UNSAFE_KEYS = new Set([\n 'timestamp', 'datetime', 'nonce', 'symbol', 'checksum', 'cache',\n 'hashmap', 'subscriptions', 'futures',\n ]);\n\n rustDeclarationOfIdentifier(node: Node): Declaration | undefined {\n if (!isIdentifier(node)) return undefined;\n try {\n const symbol: any = this.getChecker().getSymbolAtLocation(node);\n return symbolValueDeclaration(symbol);\n } catch (e) {\n return undefined;\n }\n }\n\n /** Initializer shapes that construct or return a plain dict. */\n rustDictProducingInitializer(node: Node | undefined, seen: Set): boolean {\n if (node === undefined || node === null || seen.has(node)) return false;\n seen.add(node);\n if (isObjectLiteralExpression(node)) return true;\n if (isParenthesizedExpression(node) || isAsExpression(node) ||\n isNonNullExpression(node) || isTypeAssertion(node)) {\n return this.rustDictProducingInitializer((node as any).expression, seen);\n }\n if (isIdentifier(node)) {\n const declaration: any = this.rustDeclarationOfIdentifier(node);\n if (declaration === undefined || !isVariableDeclaration(declaration)) return false;\n return this.rustDictProducingInitializer(declaration.initializer, seen);\n }\n if (isElementAccessExpression(node)) {\n // `this.markets[symbol]`: the container's declared element type is\n // what the rust port stores there.\n const containerType = this.getCheckedTypeOf((node as any).expression);\n if (containerType === undefined) return false;\n const elementType = this.getChecker().getIndexTypeOfType(containerType, IndexKind.String);\n return elementType !== undefined && this.isProvenMapType(elementType);\n }\n if (!isCallExpression(node)) return false;\n const callee: any = (node as any).expression;\n if (!isPropertyAccessExpression(callee) || callee.expression.kind !== SyntaxKind.ThisKeyword) {\n return false;\n }\n const name = String(callee.name.text);\n // Readers whose rust counterpart returns the stored dict itself.\n // `this.client(url)` returns the WS client handle Dict the runtime keeps\n // (`Map{url, subscriptions, futures}`), never a class instance.\n if (['safeDict', 'safeMarketStructure', 'market', 'currency', 'safeMarket', 'safeCurrency', 'client'].includes(name)) return true;\n // `extend`/`deepExtend` merge onto their first argument.\n if (name === 'extend' || name === 'deepExtend') {\n return this.rustDictProducingInitializer((node as any).arguments[0], seen);\n }\n return false;\n }\n\n /** D2: the proof holds only while nothing re-assigns the local. */\n rustLocalIsReassigned(declaration: Declaration, name: string): boolean {\n let scope: Node | undefined = declaration;\n while (scope !== undefined && !isFunctionLike(scope) && !isSourceFile(scope)) scope = scope.parent;\n if (scope === undefined) return true;\n // only an identifier spelled `name` can be the assignment's left side\n return this.rustScopeNameNodes(scope, name).some((id: any) => {\n const node: any = id.parent;\n return id.kind === SyntaxKind.Identifier && node !== undefined && isBinaryExpression(node) && node.left === id\n && node.operatorToken.kind >= SyntaxKind.FirstAssignment && node.operatorToken.kind <= SyntaxKind.LastAssignment;\n });\n }\n\n /** True when the receiver is a local declared as (or provably holding) a\n * plain dict — `get_value(_k)` and this read agree on every key the\n * runtime does not route elsewhere. */\n rustIsDeclaredDictLocal(node: Node): boolean {\n const declaration: any = this.rustDeclarationOfIdentifier(node);\n if (declaration === undefined) return false;\n const name = declaration.name?.text;\n if (typeof name !== 'string') return false;\n if (isParameterDeclaration(declaration)) {\n // A `Client`-typed parameter is the WS handle passed to `handle_message`/`handle*`\n // (`ws_client::client_value`): a `Value::Dict{url, subscriptions, futures}` in the port, not\n // the TS class. Its fields are plain map reads.\n if (!this.rustParameterIsClientHandle(declaration) && !this.rustDictProducingInitializer(declaration.initializer, new Set())) return false;\n } else if (isVariableDeclaration(declaration)) {\n if (!this.rustDictProducingInitializer(declaration.initializer, new Set())) return false;\n } else {\n return false;\n }\n return !this.rustLocalIsReassigned(declaration, name);\n }\n\n /** A parameter declared as the ws `Client` class (or a union with it). The\n * class is the default export of `ts/src/base/ws/Client.ts`, so its type\n * symbol is named `default`; the declaration itself carries the name. */\n rustParameterIsClientHandle(declaration: ParameterDeclaration): boolean {\n const named = (type: Type | undefined): boolean => {\n if (type === undefined) return false;\n const symbol: any = this.typeSymbolOf(type);\n const declarations: any[] = symbolDeclarations(symbol);\n return declarations.some((d) => {\n if (!isClassDeclaration(d) || d.name === undefined || d.name.text !== 'Client') return false;\n const file = String(d.getSourceFile().fileName).replace(/\\\\/g, '/');\n return file.endsWith('/ws/Client.ts') || file.endsWith('/ws/Client.d.ts');\n });\n };\n const type = this.getCheckedTypeOf(declaration.name);\n if (named(type)) return true;\n return (typeParts(type) ?? []).some((member: Type) => named(member));\n }\n\n /** Constant string argument of `parseInt`/`parseFloat` folded the way rust's\n * `str::parse` would; undefined when the fold is not obviously exact. */\n foldParsedStringLiteral(name: string, text: string): string | undefined {\n const t = text.trim();\n if (name === 'parseInt') {\n if (!/^[+-]?[0-9]+$/.test(t)) return undefined;\n const value = BigInt(t.replace(/^\\+/, '') || '0');\n if (value < -9223372036854775808n || value > 9223372036854775807n) return undefined;\n return `Value::Int(${value.toString()})`;\n }\n if (!/^[+-]?[0-9]+(?:\\.[0-9]+)?$/.test(t)) return undefined;\n const value = Number(t);\n // `String(value)` must re-read as a rust float literal holding the same f64;\n // `-0` prints as `0`, which would drop the sign the runtime keeps.\n if (!Number.isFinite(value) || Object.is(value, -0)) return undefined;\n if (!/^-?[0-9]+(?:\\.[0-9]+)?$/.test(String(value))) return undefined;\n return `Value::Float(${String(value)})`;\n }\n\n /** `parseInt(x)` / `parseFloat(x)` with a single checker-proven string argument\n * become the runtime helper's own match with native `str::parse`; every other\n * argument shape keeps the helper call the ccxt post-pass rewrites. */\n printNativeParseCall(node: CallExpression): string | undefined {\n const callee = node.expression;\n if (!isIdentifier(callee)) return undefined;\n const name = String(callee.text);\n const helper = RustTranspiler.RUST_PARSE_HELPERS[name];\n if (helper === undefined) return undefined;\n if (node.arguments.length !== 1) return undefined; // radix / unknown arity\n const arg = node.arguments[0];\n const type = this.getCheckedTypeOf(arg);\n if (type === undefined || !this.isStringType(type.flags)) return undefined;\n if (isStringLiteralLikeNode(arg)) {\n const folded = this.foldParsedStringLiteral(name, arg.text);\n if (folded !== undefined) return folded;\n }\n const argText = this.printNode(arg, 0).trim();\n // The post-pass adds the `&`; a text that already carries one is not a place.\n if (!argText || argText.startsWith('&')) return undefined;\n if (helper === 'i64') {\n return `(match &${argText} { Value::Str(__parse_s) => __parse_s.trim().parse::().map(Value::Int).unwrap_or(Value::Null), Value::Int(__parse_n) => Value::Int(*__parse_n), Value::Float(__parse_f) => Value::Int(*__parse_f as i64), _ => Value::Null })`;\n }\n return `(match &${argText} { Value::Str(__parse_s) => __parse_s.trim().parse::().map(Value::Float).unwrap_or(Value::Null), Value::Float(__parse_f) => Value::Float(*__parse_f), Value::Int(__parse_n) => Value::Float(*__parse_n as f64), _ => Value::Null })`;\n }\n\n isNodeInsideNode(node: Node, container: Node): boolean {\n return node.pos >= container.pos && node.end <= container.end;\n }\n\n /** Root place of an access chain (`x` for `x['a']['b']`, `this.balance` for\n * `this.balance['usdt']`), or undefined for a temporary. */\n rootPlaceText(node: Node): string | undefined {\n let current: any = node;\n while (isPropertyAccessExpression(current) || isElementAccessExpression(current) || isParenthesizedExpression(current)) {\n if (!isParenthesizedExpression(current) && current.expression.kind === SyntaxKind.ThisKeyword) return current.getText().trim();\n current = current.expression;\n }\n return current && (isIdentifier(current) || current.kind === SyntaxKind.ThisKeyword) ? current.getText().trim() : undefined;\n }\n\n /** The ccxt post-passes hoist `get_value(...)` reads out of `&mut` calls by\n * matching their text; the native form is invisible to them, so it is only\n * emitted where no such hoist is needed. */\n isNativeAccessPositionSafe(node: Node): boolean {\n const parent = node.parent;\n // `x['k'].push(...)` / `x['k'](...)`: the post-pass rewrites the target.\n if (parent && (isPropertyAccessExpression(parent) || isCallExpression(parent)) && parent.expression === node && !this.r21PureStringMethodReceiver(node)) return false;\n const root = this.rootPlaceText(node);\n for (let current: any = node.parent; current; current = current.parent) {\n if (isStatement(current) || isSourceFile(current) || isFunctionLike(current)) break;\n if (isBinaryExpression(current) && this.isNodeInsideNode(node, current.right)) {\n const op = current.operatorToken.kind;\n const isAssign = op === SyntaxKind.EqualsToken || (op >= SyntaxKind.PlusEqualsToken && op <= SyntaxKind.CaretEqualsToken);\n if (isAssign && root !== undefined && this.rootPlaceText(current.left) === root) return false;\n }\n if (isCallExpression(current) && isPropertyAccessExpression(current.expression) &&\n this.isNodeInsideNode(node, current) && current.arguments.some(a => this.isNodeInsideNode(node, a))) {\n const callee = current.expression;\n // Same-place receiver (`x.push(x[0])`) is rewritten to `&mut x` args.\n if (root !== undefined && this.rootPlaceText(callee.expression) === root) return false;\n // `&mut self.(...)` arg lists are hoisted by the ccxt\n // pass because a `&self` reborrow conflicts with the outer `&mut self`.\n if (callee.expression.kind === SyntaxKind.ThisKeyword &&\n RustTranspiler.MUT_SELF_METHODS.has(this.toSnakeCaseName(String(callee.name.text))) &&\n (root === undefined || root === 'this' || root.startsWith('this.'))) return false;\n }\n }\n return true;\n }\n\n /** Receiver shapes whose printed text is a single `Value` place (`x`, `this.x`). */\n isShallowValueReceiver(node: Node): boolean {\n return isIdentifier(node) || (isPropertyAccessExpression(node) && node.expression.kind === SyntaxKind.ThisKeyword);\n }\n\n /** True when this read is the receiver of an element-access chain that is\n * written (`x['a'] = v`, `x['a']['b'] = v`, `delete x['a']['b']`), or a\n * property write itself (`x.k = v`, `delete x.k`). The ccxt write passes\n * match the `get_value(&…)` / `x.k` text to reach the real container, so a\n * native read would write into a discarded clone. */\n isNativeWriteTargetBase(node: Node): boolean {\n const isWrite = (n: any, target: any) => n !== undefined && (isDeleteExpression(n) ||\n (isBinaryExpression(n) && n.left === target && rustIsAssignmentOperator(n.operatorToken.kind)));\n const parent: any = node.parent;\n if (isWrite(parent, node)) return true;\n if (parent === undefined || !isElementAccessExpression(parent) || parent.expression !== node) return false;\n let current: any = parent;\n while (current.parent !== undefined && isElementAccessExpression(current.parent) && current.parent.expression === current) current = current.parent;\n return isWrite(current.parent, current);\n }\n\n transformPropertyAcessExpressionIfNeeded(node) {\n // Printed here (as before) so the receiver's loop-flag numbering in the\n // generated file matches the pinned baseline for non-length accesses.\n const leftExpr = this.printNode(node.expression, 0);\n if (node.name.text !== 'length') return undefined;\n const shadow = this.rustParamShadowOf(node.expression);\n const native = shadow !== undefined ? this.printShadowLength(shadow) : undefined;\n return native ?? this.printArrayLength(node, 0, leftExpr);\n }\n\n // `crate::value::get_value_k` is `get_value` for a `&str` key — the same\n // dict lookup minus the per-read `Value::Str` allocation. Three literal-key\n // families reach branches only `get_value` has (numeric cache/side indices,\n // the cache `hashmap` bucket, live client `subscriptions`/`futures`) and a\n // `this`/class receiver is not a `Value`, so those keep `get_value`.\n staticKeyLookup(node, container): string | undefined {\n if (!isStringLiteral(node)) return undefined;\n // Test sources keep the allocating form: the test-only post-passes\n // pattern-match `get_value(&…, &Value::Str(…))` call sites.\n const source = (node as any).getSourceFile ? (node as any).getSourceFile().fileName : '';\n if (typeof source === 'string' && /\\/test\\//.test(source)) return undefined;\n if (container.kind === SyntaxKind.ThisKeyword) return undefined;\n const text = node.text;\n if (text === '' || text in this.StringLiteralReplacements) return undefined;\n if (/^\\d+$/.test(text) || text === 'hashmap' || text === 'subscriptions' || text === 'futures') return undefined;\n const checker: any = this.checkerOrUndefined();\n if (checker === undefined) return undefined;\n const type = checker.getTypeAtLocation(container);\n if (type !== undefined && ((type as any).objectFlags & ObjectFlags.Class)) return undefined;\n return this.quotedStringLiteral(text);\n }\n\n printElementAccessExpression(node, identation) {\n const special = this.printElementAccessExpressionExceptionIfAny(node);\n if (special) return special;\n // `obj['x'] = v` is rewritten to `crate::set_value(...)` by a pass that\n // matches the `get_value(&obj, &key)` target shape, so targets keep it.\n // `d['a'].push(v)` lowers to `append_to_array(&mut , v)` and the\n // ccxt pass giving it write-through semantics (`append_to_object_array`)\n // matches `append_to_array(&mut get_value(&` literally, so call/property\n // targets keep the allocating form too: `get_value_k` is invisible to\n // that pass and the append would land on a discarded COW clone.\n const parent = node.parent;\n const keepGetValue = parent !== undefined && (\n (isBinaryExpression(parent) && parent.left === node &&\n parent.operatorToken.kind >= SyntaxKind.FirstAssignment && parent.operatorToken.kind <= SyntaxKind.LastAssignment) ||\n ((isPropertyAccessExpression(parent) || isCallExpression(parent)) && parent.expression === node));\n const chain: any[] = [];\n let current: any = node;\n while (isElementAccessExpression(current)) {\n chain.unshift(current);\n current = current.expression;\n }\n // One checker proof per chain: the emitted text replaces `get_value` only\n // when it is legal at the position the whole chain occupies.\n const nativeAllowed = this.isNativeAccessPositionSafe(node) && !this.isNativeWriteTargetBase(node);\n let acc = this.printNode(current, 0);\n for (const { expression: receiver, argumentExpression: key } of chain) {\n const native = nativeAllowed ? this.printNativeContainerAccess(acc, receiver, key) : undefined;\n const staticKey = native === undefined && !keepGetValue ? this.staticKeyLookup(key, receiver) : undefined;\n acc = native ?? (staticKey !== undefined\n ? `crate::value::get_value_k(&${acc}, ${staticKey})`\n : `get_value(&${acc}, &${this.printNode(key, 0)})`);\n }\n return acc;\n }\n\n printForStatement(node, identation) {\n const idn = this.getIden(identation);\n const idn1 = this.getIden(identation + 1);\n const initStr = node.initializer ? this.printNode(node.initializer, identation + 1) + ';\\n' : '';\n const condStr = node.condition ? this.printComparisonInBooleanContext(node.condition, 0).trim() : 'true';\n const incrStr = node.incrementor ? this.printNode(node.incrementor, 0) : '';\n const statements = node.statement.statements.map(s => this.printNode(s, identation + 1)).join('\\n');\n const body = `{\\n${statements}\\n${idn}}`;\n // A C-style `for` becomes a Rust `while`. The increment must run on\n // every iteration *including* one ended by `continue`, so it is folded\n // into the condition (guarded by a first-iteration flag); at the end of\n // the body a `continue` would skip it and spin the loop forever.\n if (incrStr !== '') {\n const flag = `__for_first_${this.forLoopCounter++}`;\n const cond = `{ if !${flag} { ${incrStr}; } ${flag} = false; ${condStr} }`;\n return `${idn}{\\n${idn1}${initStr}${idn1}let mut ${flag}: bool = true;\\n${idn1}while ${cond} ${body}\\n${idn}}`;\n }\n return `${idn}{\\n${idn1}${initStr}${idn1}while ${condStr} ${body}\\n${idn}}`;\n }\n\n private static readonly COMPARISON_OPS = new Set([\n SyntaxKind.EqualsEqualsToken, SyntaxKind.EqualsEqualsEqualsToken, SyntaxKind.ExclamationEqualsToken, SyntaxKind.ExclamationEqualsEqualsToken,\n SyntaxKind.LessThanToken, SyntaxKind.LessThanEqualsToken, SyntaxKind.GreaterThanToken, SyntaxKind.GreaterThanEqualsToken,\n ]);\n\n // Comparison helpers that can be replaced by a native numeric operator.\n private static readonly NATIVE_COMPARISON_OPERATORS: Record = {\n [SyntaxKind.LessThanToken]: '<', [SyntaxKind.LessThanEqualsToken]: '<=',\n [SyntaxKind.GreaterThanToken]: '>', [SyntaxKind.GreaterThanEqualsToken]: '>=',\n };\n\n isEqualityOp(op): boolean {\n return op === SyntaxKind.EqualsEqualsToken || op === SyntaxKind.EqualsEqualsEqualsToken ||\n op === SyntaxKind.ExclamationEqualsToken || op === SyntaxKind.ExclamationEqualsEqualsToken;\n }\n\n isLogicalOp(op): boolean {\n return op === SyntaxKind.AmpersandAmpersandToken || op === SyntaxKind.BarBarToken;\n }\n\n printCondition(node, identation) {\n const idn = this.getIden(identation);\n if (node.kind === SyntaxKind.BinaryExpression) {\n const opKind = node.operatorToken.kind;\n // Comparison binary expressions already return bool — skip is_true() wrapping\n if (RustTranspiler.COMPARISON_OPS.has(opKind)) return this.printComparisonInBooleanContext(node, identation);\n // Logical &&/|| operands are individually is_true()-wrapped in\n // printBinaryExpression, so the whole expression is already bool —\n // unless one carries a native compare, which needs no is_true().\n if (this.isLogicalOp(opKind)) {\n const native = this.hasNativeComparisonOperand(node.left) || this.hasNativeComparisonOperand(node.right);\n return idn + (native ? this.printLogicalInBooleanContext(node) : this.printNode(node, 0));\n }\n }\n // PrefixUnary ! — delegate to avoid double-wrapping\n if (node.kind === SyntaxKind.PrefixUnaryExpression && node.operator === SyntaxKind.ExclamationToken) {\n return this.printPrefixUnaryExpression(node, identation);\n }\n // A call to a hand-written `-> bool` fn is already a Rust bool.\n if (this.rustCallPrintsBool(node)) return idn + this.printNode(node, 0);\n // Checker-proved boolean Value (safe_bool / get_value): native matches!.\n const nativeTruthiness = this.printNativeTruthiness(node);\n if (nativeTruthiness !== undefined) return idn + nativeTruthiness;\n const r12Truthiness = this.rustR12NativeTruthiness(node); if (r12Truthiness !== undefined) return idn + r12Truthiness;\n // B-26: an operand whose printer emission is already a Rust `bool`.\n const nativeCondition = this.printNativeParenthesizedCondition(node);\n if (nativeCondition !== undefined && this.rustConditionBoolSlot(node)) return idn + nativeCondition;\n const expression = this.printNode(node, 0);\n const peeled = this.peelValueBoolBox(this.stripOuterParens(expression));\n if (peeled !== undefined && this.rustConditionBoolSlot(node) && !this.printedBoolHelperCall(this.stripOuterParens(peeled))) {\n return `${idn}(${peeled})`;\n }\n return `${idn}is_true(&${this.printTruthyArgument(expression)})`;\n }\n\n // B-26: `is_true(&(…)` on an operand the printer already emits as a native Rust `bool` (payload\n // compares, `matches!` predicates, `&&`/`||` of those) is the identity (`IsTruthy for bool`);\n // native text has no helper token, so it is emitted only in a bool slot (`isBareBoolEmissionSafe`).\n\n /** Bool-slot text of a parenthesised native comparison/predicate, else undefined. */\n printNativeParenthesizedCondition(node): string | undefined {\n const inner = this.unwrapParens(node);\n if (inner === undefined || inner === node || inner.kind !== SyntaxKind.BinaryExpression) return undefined;\n const op = inner.operatorToken.kind;\n if (this.isLogicalOp(op)) {\n // Every operand of a logical already prints a bool; keep the wrapper\n // when they are all helper-led (the post-passes key on that token).\n if (!this.hasNativeComparisonOperand(inner.left) && !this.hasNativeComparisonOperand(inner.right)) return undefined;\n return `(${this.printLogicalInBooleanContext(inner)})`;\n }\n if (!RustTranspiler.COMPARISON_OPS.has(op)) return undefined;\n let native: string | undefined;\n if (inner.left.kind === SyntaxKind.TypeOfExpression) {\n // `typeof x === 'string'` prints the same native predicate as `x in obj`.\n native = this.nativeValuePredicateText(inner.right.text, inner.left.expression, this.printNode(inner.left.expression, 0));\n const isDiff = op === SyntaxKind.ExclamationEqualsEqualsToken || op === SyntaxKind.ExclamationEqualsToken;\n if (native !== undefined && isDiff) native = '!' + native;\n } else {\n native = this.isEqualityOp(op) ? this.nativeEqualityText(inner) : this.printNativeOrderedComparison(inner, op, inner.left, inner.right);\n }\n return native === undefined ? undefined : `(${native})`;\n }\n\n // The argument of an `is_true(&…)` sink with the printer's `Value::Bool(…)` box peeled when it\n // spans the whole argument: `IsTruthy for Value` unboxes `Value::Bool(b)` to `b`, so the bool\n // prints bare. `is_true` is the one sink taking a native `bool`; the marker stays for post-passes.\n printTruthyArgument(expression: string): string {\n const inner = this.peelValueBoolBox(this.stripOuterParens(expression));\n // parens kept: `is_true(&a == b)` would re-associate the argument.\n return inner === undefined ? expression : `(${inner})`;\n }\n\n // `assert(, )` — the test harness' `assert` takes a\n // native `bool` (`impl Truthy for bool`), so a whole-argument\n // `Value::Bool(…)` box prints bare there too. The message list is untouched.\n printAssertCall(node, identation, parsedArgs) {\n const [first, rest] = this.splitFirstArgument(parsedArgs);\n const inner = this.peelValueBoolBox(this.stripOuterParens(first));\n return inner === undefined ? `assert(${parsedArgs})` : `assert((${inner})${rest})`;\n }\n\n // Splits an already-printed argument list after its first top-level `,`.\n splitFirstArgument(parsedArgs: string): [string, string] {\n let depth = 0;\n for (let i = 0; i < parsedArgs.length; i++) {\n const char = parsedArgs[i];\n if (char === '\"') {\n for (i++; i < parsedArgs.length && parsedArgs[i] !== '\"'; i++) {\n if (parsedArgs[i] === '\\\\') i++;\n }\n } else if ('([{'.includes(char)) depth++;\n else if (')]}'.includes(char)) depth--;\n else if (char === ',' && depth === 0) return [parsedArgs.slice(0, i), parsedArgs.slice(i)];\n }\n return [parsedArgs, ''];\n }\n\n // Bool-position text for a comparison: the native payload compare (already\n // bool) when the checker proves it, the is_equal() helper otherwise.\n printComparisonInBooleanContext(node, identation) {\n const native = this.nativeEqualityText(node);\n return this.getIden(identation) + (native ? `(${native})` : this.printNode(node, 0));\n }\n\n // Native equality text of `node` (parens unwrapped), if the checker proves it.\n nativeEqualityText(node) {\n const inner = this.unwrapParens(node);\n if (inner === undefined || inner.kind !== SyntaxKind.BinaryExpression || !this.isEqualityOp(inner.operatorToken.kind)) return undefined;\n return this.printNativeEqualityComparison(inner.left, inner.right, inner.operatorToken.kind);\n }\n\n unwrapParens(node) {\n let inner = node;\n while (inner !== undefined && inner.kind === SyntaxKind.ParenthesizedExpression) inner = inner.expression;\n return inner;\n }\n\n // Does `node` carry a native payload compare in a position where the old\n // text started with a bool helper? The post-pass types locals by that token.\n hasNativeComparisonOperand(node) {\n const inner = this.unwrapParens(node);\n if (inner === undefined) return false;\n if (inner.kind === SyntaxKind.PrefixUnaryExpression && inner.operator === SyntaxKind.ExclamationToken) {\n return this.hasNativeComparisonOperand(inner.operand);\n }\n if (this.nativeEqualityText(inner) !== undefined) return true;\n return inner.kind === SyntaxKind.BinaryExpression && this.isLogicalOp(inner.operatorToken.kind) &&\n (this.hasNativeComparisonOperand(inner.left) || this.hasNativeComparisonOperand(inner.right));\n }\n\n // Bare `&&`/`||` text of a logical expression (its operands are bools).\n printLogicalInBooleanContext(node) {\n const token = node.operatorToken.kind === SyntaxKind.AmpersandAmpersandToken ? '&&' : '||';\n return `${this.printCondition(node.left, 0).trim()} ${token} ${this.printCondition(node.right, 0).trim()}`;\n }\n\n printWhileStatement(node, identation) {\n return `${this.getIden(identation)}while ${this.printCondition(node.expression, 0)}${this.printBlock(node.statement, identation)}`;\n }\n\n printIfStatement(node, identation) {\n const elseStatement = node.elseStatement;\n const ifBody = this.printBlock(node.thenStatement, identation, elseStatement !== undefined);\n const head = node.parent.kind === SyntaxKind.IfStatement ? 'else if ' : `${this.getIden(identation)}if `;\n let ifComplete = `${head}${this.printCondition(node.expression, 0)}${ifBody}`;\n if (elseStatement?.kind === SyntaxKind.Block) {\n ifComplete += ` else${this.printBlock(elseStatement, identation)}`;\n } else if (elseStatement?.kind === SyntaxKind.IfStatement) {\n ifComplete += ' ' + this.printIfStatement(elseStatement, identation);\n }\n return this.printNodeCommentsIfAny(node, identation, ifComplete);\n }\n\n printPostFixUnaryExpression(node, identation) {\n const { operand, operator } = node;\n const helper = operator === SyntaxKind.PlusPlusToken ? 'add' : operator === SyntaxKind.MinusMinusToken ? 'subtract' : undefined;\n if (helper === undefined) return super.printPostFixUnaryExpression(node, identation);\n const operandText = this.printNode(operand, 0);\n const native = this.printNativeIncrement(helper === 'add' ? SyntaxKind.PlusToken : SyntaxKind.MinusToken, operand, operandText);\n return `${this.getIden(identation)}${operandText} = ${native ?? `${helper}(&${operandText}, &Value::Int(1))`}`;\n }\n\n // `x++` / `x--` on a checker-typed number: native `+`/`-` with `Value::Int(1)`.\n printNativeIncrement(op, operand, operandText: string): string | undefined {\n try {\n if (!this.isNumberLikeType(this.getChecker().getTypeAtLocation(operand))) return undefined;\n } catch (e) {\n return undefined;\n }\n return this.printNativeNumeric(op, operandText, 'Value::Int(1)');\n }\n\n printPrefixUnaryExpression(node, identation) {\n const { operand, operator } = node;\n const idn = this.getIden(identation);\n if (operator === SyntaxKind.ExclamationToken) return idn + '!' + this.printCondition(operand, 0);\n if (operator !== SyntaxKind.MinusToken) return idn + this.PrefixFixOperators[operator] + this.printNode(operand, 0);\n const operandText = this.printNode(operand, 0);\n return idn + (this.foldNegateLiteral(operandText) ?? this.printRustNativeNegate(operand, operandText) ?? `negate(&${operandText})`);\n }\n\n printObjectLiteralExpression(node, identation) {\n const escapeKey = (s: any): string => String(s).replace(/\\\\/g, '\\\\\\\\').replace(/\"/g, '\\\\\"')\n .replace(/\\n/g, '\\\\n').replace(/\\r/g, '\\\\r').replace(/\\t/g, '\\\\t');\n const idn2 = this.getIden(identation + 2);\n const lines = node.properties.map(p => {\n // Shorthand: { foo } → m.insert(\"foo\", foo.clone());\n if (isShorthandPropertyAssignment(p)) {\n const name = (p.name as Identifier).text;\n return `${idn2}m.insert(\"${escapeKey(name)}\".to_string(), ${name}.clone());`;\n }\n const keyText = isStringLiteral(p.name) ? p.name.text : p.name.text;\n return `${idn2}m.insert(\"${escapeKey(keyText)}\".to_string(), ${this.printNode(p.initializer, 0)});`;\n });\n const idn1 = this.getIden(identation + 1);\n const body = lines.map(l => l + '\\n').join('');\n return `Value::Map({\\n${idn1}let mut m = std::collections::HashMap::new();\\n${body}${idn1}m\\n${this.getIden(identation)}})`;\n }\n\n printArrayLiteralExpression(node, identation) {\n return `Value::from(vec![${node.elements.map(e => this.printNode(e, 0)).join(', ')}])`;\n }\n\n printDeleteExpression(node, identation) {\n return this.r05Delete(node) ?? `remove(&mut ${this.printNode(node.expression.expression, 0)}, &${this.printNode(node.expression.argumentExpression, 0)})`;\n }\n\n printInstanceOfExpression(node, identation) {\n return `${this.getIden(identation)}is_instance(&${this.printNode(node.left, 0)}, &${this.printNode(node.right, 0)})`;\n }\n\n printConditionalExpression(node, identation) {\n const condition = this.printCondition(node.condition, 0);\n const whenTrue = this.printTernaryArm(node.whenTrue);\n const whenFalse = this.printTernaryArm(node.whenFalse);\n // `ternary` is `if cond { a } else { b }` over `Value`; the arms are\n // normalized to `Value`, so the native form matches it and evaluates\n // only the taken arm (TS semantics).\n return `(if ${condition} { ${whenTrue} } else { ${whenFalse} })`;\n }\n\n // Free runtime functions that print as `bool` (not `Value`) — mirror of the\n // Rust pipeline's `ternary()` bool-boxing list.\n private static readonly BOOL_VALUE_PREFIXES = [\n 'is_equal', 'is_true', 'is_greater_than', 'is_less_than',\n 'is_greater_than_or_equal', 'is_less_than_or_equal', 'is_array',\n 'is_object', 'in_op', 'is_number', 'is_string',\n ];\n\n private static isBoolValueExpression(text: string): boolean {\n let value = text.trim();\n while (value.startsWith('(') && value.endsWith(')')) {\n let depth = 0;\n let wrapsWhole = true;\n for (let i = 0; i < value.length && wrapsWhole; i++) {\n if (value[i] === '(') depth++;\n else if (value[i] === ')' && --depth === 0 && i < value.length - 1) wrapsWhole = false;\n }\n if (!wrapsWhole) break;\n value = value.slice(1, -1).trim();\n }\n if (value.startsWith('!')) value = value.slice(1).trim();\n return RustTranspiler.BOOL_VALUE_PREFIXES.some((fn) => value.startsWith(fn + '('));\n }\n\n // An if-expression arm keeps the type `ternary()`'s `Value` parameters gave\n // it: box bool expressions, and clone bare identifiers so the arm does not\n // move a local the caller still uses.\n printTernaryArm(node, identation = 0) {\n const text = this.printNode(node, identation);\n const trimmed = text.trim();\n if (RustTranspiler.isBoolValueExpression(trimmed)) return `Value::Bool(${trimmed})`;\n if (/^[a-zA-Z_][a-zA-Z0-9_]*$/.test(trimmed) && trimmed !== 'self' && trimmed !== 'true' && trimmed !== 'false') return `${trimmed}.clone()`;\n return text;\n }\n\n // Built-in method call overrides\n printArrayIsArrayCall(node, identation, parsedArg = undefined) {\n return `Value::Bool(${this.nativeValuePredicateText('array', node?.arguments?.[0], parsedArg) ?? `is_array(&${parsedArg})`})`;\n }\n\n printObjectKeysCall(node, identation, parsedArg = undefined) {\n return this.r05Enum(node, parsedArg, 'keys') ?? this.r18PredictionEnum(node, parsedArg, 'keys') ?? this.r21BaseEnum(node, parsedArg, 'keys') ?? `object_keys(&${parsedArg})`;\n }\n\n printObjectValuesCall(node, identation, parsedArg = undefined) {\n return this.r05Enum(node, parsedArg, 'values') ?? this.r18PredictionEnum(node, parsedArg, 'values') ?? this.r21BaseEnum(node, parsedArg, 'values') ?? `object_values(&${parsedArg})`;\n }\n\n printJsonParseCall(node, identation, parsedArg = undefined) {\n return `json_parse(&${parsedArg})`;\n }\n\n printJsonStringifyCall(node, identation, parsedArg = undefined) {\n return `json_stringify(&${parsedArg})`;\n }\n\n printMathFloorCall(node, identation, parsedArg = undefined) {\n return this.printRustNativeMathCall(node, 'floor', parsedArg) ?? `math_floor(&${parsedArg})`;\n }\n\n // No `.await` here: `printAwaitExpression` appends it for `await Promise.all(...)`.\n printPromiseAllCall(node, identation, parsedArg = undefined) {\n return `promise_all(&${parsedArg})`;\n }\n\n // Rust uses postfix `.await`; the base transpiler defaults to prefix.\n printAwaitExpression(node, identation) {\n return `${this.printNode(node.expression, identation)}.await`;\n }\n\n printMathRoundCall(node, identation, parsedArg = undefined) {\n return this.printRustNativeMathCall(node, 'round', parsedArg) ?? `math_round(&${parsedArg})`;\n }\n\n printMathCeilCall(node, identation, parsedArg = undefined) {\n return this.printRustNativeMathCall(node, 'ceil', parsedArg) ?? `math_ceil(&${parsedArg})`;\n }\n\n printNumberIsIntegerCall(node, identation, parsedArg = undefined) {\n return `is_integer(&${parsedArg})`;\n }\n\n printArrayPushCall(node, identation, name = undefined, parsedArg = undefined) {\n return this.printRustVecPush(node, name, parsedArg) ?? this.r18ArrPush(node, name, parsedArg) ?? `append_to_array(&mut ${name}, ${parsedArg})`;\n }\n\n printIncludesCall(node, identation, name = undefined, parsedArg = undefined) {\n return `Value::Bool(contains(&${name}, &${parsedArg}))`;\n }\n\n printIndexOfCall(node, identation, name = undefined, parsedArg = undefined) {\n return this.printNativeStringIndexOf(node, name) ?? this.printNativeStringIndexOfString(node, name) ?? this.r30IndexOf(name, parsedArg);\n }\n\n printStartsWithCall(node, identation, name = undefined, parsedArg = undefined) {\n const native = this.printNativeStringAffixTest(node, name, 'starts_with') ?? this.r17PrintAffixTest(node, name, 'starts_with');\n if (native !== undefined) return `Value::Bool(${native})`;\n return `Value::Bool(starts_with(&${name}, &${parsedArg}))`;\n }\n\n printEndsWithCall(node, identation, name = undefined, parsedArg = undefined) {\n const native = this.printNativeStringAffixTest(node, name, 'ends_with') ?? this.r17PrintAffixTest(node, name, 'ends_with');\n if (native !== undefined) return `Value::Bool(${native})`;\n return `Value::Bool(ends_with(&${name}, &${parsedArg}))`;\n }\n\n printTrimCall(node, identation, name = undefined) {\n return this.r17PrintTrim(node, name) ?? `trim(&${name})`;\n }\n\n printJoinCall(node, identation, name = undefined, parsedArg = undefined) {\n return this.r15PrintVecJoin(node) ?? this.printNativeStringJoin(node, name) ?? `join(&${name}, &${parsedArg})`;\n }\n\n printSplitCall(node, identation, name = undefined, parsedArg = undefined) {\n return this.printNativeStringSplit(node, name) ?? this.printRustR13Split(node, name) ?? `split(&${name}, &${parsedArg})`;\n }\n\n printConcatCall(node, identation, name = undefined, parsedArg = undefined) {\n return `concat(${name}.clone(), ${parsedArg}.clone())`;\n }\n\n printToFixedCall(node, identation, name = undefined, parsedArg = undefined) {\n return `to_fixed(&${name}, &${parsedArg})`;\n }\n\n printToStringCall(node, identation, name = undefined) {\n return this.printRustNativeToString(node, name) ?? this.printRustR13ToString(node, name) ?? `to_string_val(&${name})`;\n }\n\n printToUpperCaseCall(node, identation, name = undefined) {\n return this.printNativeStringCase(node, name, 'to_uppercase') ?? this.printRustR13Case(node, name, 'to_uppercase') ?? this.r30Case(name, 'to_uppercase');\n }\n\n printToLowerCaseCall(node, identation, name = undefined) {\n return this.printNativeStringCase(node, name, 'to_lowercase') ?? this.printRustR13Case(node, name, 'to_lowercase') ?? this.r30Case(name, 'to_lowercase');\n }\n\n printShiftCall(node, identation, name = undefined) {\n return `shift(${name}.clone())`;\n }\n\n printReverseCall(node, identation, name = undefined) {\n return `${name} = reverse(${name}.clone())`;\n }\n\n printPopCall(node, identation, name = undefined) {\n return `pop(${name}.clone())`;\n }\n\n printSliceCall(node, identation, name = undefined, parsedArg = undefined, parsedArg2 = undefined) {\n return this.printNativeStringSlice(node, name) ?? this.r30Slice(name, parsedArg, parsedArg2 ?? 'Value::Null');\n }\n\n printReplaceCall(node, identation, name = undefined, parsedArg = undefined, parsedArg2 = undefined) {\n return this.printNativeStringReplace(node, name) ?? this.printRustR13Replace(node, name) ?? this.r17PrintReplace(node, name) ?? `replace_str(&${name}, &${parsedArg}, &${parsedArg2})`;\n }\n\n printReplaceAllCall(node, identation, name = undefined, parsedArg = undefined, parsedArg2 = undefined) {\n return this.printNativeStringReplace(node, name) ?? this.printRustR13Replace(node, name) ?? this.r17PrintReplace(node, name) ?? `replace_all_str(&${name}, &${parsedArg}, &${parsedArg2})`;\n }\n\n // `{}` (Display) renders an ExchangeError as `[Kind] message`; `{:?}` would dump the struct fields.\n printThrowStatement(node, identation) {\n return `${this.getIden(identation)}panic!(\"{}\", ${this.printNode(node.expression, 0)});`;\n }\n\n printTryStatement(node, identation) {\n const body = (block) => block.statements.map(s => this.printNode(s, identation + 1)).join('\\n');\n const rawName = node.catchClause?.variableDeclaration?.name?.text;\n const iden = this.getIden(identation);\n const errorName = rawName ? `_${rawName}` : '_e';\n return `${iden}let _try_result = std::panic::catch_unwind(std::panic::AssertUnwindSafe(|| {\\n${body(node.tryBlock)}\\n${iden}}));\\n` +\n `${iden}if let Err(${errorName}) = _try_result {\\n${body(node.catchClause.block)}\\n${iden}}`;\n }\n\n printReturnStatement(node, identation) {\n const exp = node.expression;\n const idn = this.getIden(identation);\n if (!exp) return `${idn}return;`;\n // `return X;` inside a native-`Option` method: the printed\n // expression is still the `Value` box, so convert it back to the\n // native payload (a nullish literal is the `None` arm).\n const fn: any = findAncestor(node.parent, isFunctionLike);\n if (this.rustNativeStrReturnKind(fn) === 'str' && this.rustStrReturnValueConverts(exp)) {\n if (this.literalKindOfNode(this.unwrapParensNode(exp)) === 'null') return `${idn}return None;`;\n const suffix = this.rustStrNativeExpression(exp) ? '' : '.as_str().map(str::to_owned)';\n return `${idn}return ${this.printNode(exp, 0).trim()}${suffix};`;\n }\n return `${idn}return ${this.printNode(exp, 0).trim()};`;\n }\n\n printBreakStatement(node, identation) {\n return `${this.getIden(identation)}break;`;\n }\n\n printContinueStatement(node, identation) {\n return `${this.getIden(identation)}continue;`;\n }\n\n printConstructorDeclaration(node, identation) {\n return ''; // handled in printNewMethod\n }\n\n printSpreadElement(node, identation) {\n return `${this.getIden(identation)}${this.printNode(node.expression, 0)}`;\n }\n\n // hx4 R01 — native element write on a local the plain-dict proof admits\n // through its write history: `const x = this.account ()`, a `let x = {}` /\n // `let x: Dict = undefined` later reassigned, `[ x, p ] = this.handleUntilOption (…)`.\n\n /** Base-tier methods whose every return is a fresh tag-free object\n * literal (no venue override, no hand-written stub replaces them). */\n private static readonly RUST_R01_PLAIN_DICT_BUILDERS = new Set([ 'account', 'safeLedgerEntry', 'depositWithdrawFee' ]);\n\n /** Base-tier `[Dict, Dict]` tuple helpers that hand back their `request` argument (index 1). */\n private static readonly RUST_R01_REQUEST_TUPLE_HELPERS = new Set([ 'handleUntilOption' ]);\n\n rustR01NativeDictInsert(baseExpr, keyNode, keyText: string, valueText: string): string | undefined {\n if (!isIdentifier(baseExpr) || !this.rustR01LocalStaysPlain(baseExpr)) {\n return undefined;\n }\n // Every write is a fresh literal / builder: the receiver is untagged and\n // a book-meta key needs no `__book_id` guard (`plain: true`).\n const receiver = { text: String(baseExpr.text), isField: false, plain: true, nameNode: baseExpr };\n const keyArg = this.rustNativeInsertKeyArg(receiver, keyNode, keyText);\n if (keyArg === undefined) {\n return undefined;\n }\n const name = receiver.text;\n const value = this.rustPrintedBoolArg(valueText) ? `Value::Bool(${valueText})` : valueText.trim();\n const insert = (val: string) =>\n `if let Value::Dict(__d) = &mut ${name} { std::sync::Arc::make_mut(__d).insert(${keyArg}, ${val}); }`;\n // same operand handling as printNativeDictInsert: hoist a read of the receiver, clone a bare place\n if (new RegExp(`\\\\b${name}\\\\b`).test(value)) {\n return `{ let __be_tmp = ${value}; ${insert('__be_tmp')} }`;\n }\n if (/^[a-zA-Z_][a-zA-Z0-9_]*$/.test(value) && value !== 'self' && value !== 'true' && value !== 'false') {\n return insert(`${value}.clone()`);\n }\n return insert(value);\n }\n\n /** A local (single binding in its function, no closure capture of a write)\n * whose declaration and every write is a plain-dict source or nullish. A\n * nullish value leaves a non-Dict, which `if let Value::Dict` no-ops on\n * exactly like the helper's `_ => {}` arm. */\n rustR01LocalStaysPlain(ident: Identifier, depth = 0): boolean {\n const checker: any = this.checkerOrUndefined();\n const declarations: any[] = checker === undefined ? [] : symbolDeclarations(checker.getSymbolAtLocation(ident));\n const declaration: any = declarations.length === 1 ? declarations[0] : undefined;\n if (declaration === undefined || depth > 4) {\n return false;\n }\n if (declaration.kind === SyntaxKind.BindingElement) {\n return this.rustR01TupleBindingStaysPlain(ident, declaration, depth);\n }\n if (!isVariableDeclaration(declaration) || declaration.name?.kind !== SyntaxKind.Identifier) {\n return false;\n }\n const scope = this.rustEnclosingFunction(declaration);\n if (scope === undefined || isSourceFile(scope) || this.rustEnclosingFunction(ident) !== scope) {\n return false;\n }\n const name = String(ident.text);\n const symbol = this.rustSymbolOf(declaration.name as Identifier);\n if (symbol === undefined) {\n return false;\n }\n if (declaration.initializer !== undefined && !this.rustR01PlainSource(declaration.initializer, name)) {\n return false;\n }\n let plain = true;\n for (const node of this.rustScopeNameNodes(scope, name) as any[]) {\n if (node === declaration) continue;\n if (this.rustBindsName(node, name)) {\n // a sibling block's own `const x` is another binding; only an unresolved one rejects\n if (this.rustSymbolOf(node.name) === undefined) { plain = false; break; }\n continue;\n }\n if (node.kind !== SyntaxKind.Identifier || node === declaration.name || this.rustSymbolOf(node) !== symbol) continue;\n if (this.rustEnclosingFunction(node) !== scope) { plain = false; break; } // captured by a callback\n if (!this.rustR01UseKeepsPlain(node, name)) { plain = false; break; }\n }\n return plain;\n }\n\n /** `const [ x, p ] = this.handleUntilOption (k, r, …)` with `r` itself a\n * plain local: element 0 is `r` handed back, and `x` is never re-written. */\n private rustR01TupleBindingStaysPlain(ident: Identifier, element: any, depth: number): boolean {\n const pattern: any = element.parent;\n const declaration: any = pattern?.parent;\n if (pattern?.kind !== SyntaxKind.ArrayBindingPattern || declaration === undefined || !isVariableDeclaration(declaration)\n || ![0, 1].includes(pattern.elements.indexOf(element)) || element.name?.kind !== SyntaxKind.Identifier\n || element.initializer !== undefined || element.dotDotDotToken !== undefined) {\n return false;\n }\n if (pattern.elements.indexOf(element) === 1 ? !this.r26ParamsSlot(declaration.initializer, undefined, depth) : !this.rustR01TupleHeadIsPlain(declaration.initializer, undefined, depth)) {\n return false;\n }\n const scope = this.rustEnclosingFunction(declaration);\n const name = String(ident.text);\n const symbol = this.rustSymbolOf(element.name);\n if (scope === undefined || symbol === undefined || this.rustEnclosingFunction(ident) !== scope) {\n return false;\n }\n for (const node of this.rustScopeNameNodes(scope, name) as any[]) {\n if (node.kind !== SyntaxKind.Identifier || node === element.name || this.rustSymbolOf(node) !== symbol) continue;\n if (this.rustEnclosingFunction(node) !== scope || !this.rustR01UseKeepsPlain(node, name)) return false;\n }\n return true;\n }\n\n /** The shipped construction proof (literal-built local / handler tuple), read-only. */\n private rustR01ShippedPlain(ident: Identifier): boolean {\n const declaration = this.rustSingleLocalDeclaration(ident);\n return declaration !== undefined && isVariableDeclaration(declaration as any)\n && this.rustInsertReceiverBuildsPlainDict(declaration as VariableDeclaration);\n }\n\n /** A use of the local: reads and element writes keep the box; a direct\n * assignment must store a plain source; any other write shape rejects. */\n private rustR01UseKeepsPlain(node: Node, name: string): boolean {\n let target: any = node;\n while (target.parent !== undefined && (isParenthesizedExpression(target.parent) || isNonNullExpression(target.parent) || isAsExpression(target.parent))) {\n target = target.parent;\n }\n const parent: any = target.parent;\n if (parent === undefined) return true;\n if (isBinaryExpression(parent) && parent.left === target && rustIsAssignmentOperator(parent.operatorToken.kind)) {\n return parent.operatorToken.kind === SyntaxKind.EqualsToken && this.rustR01PlainSource(parent.right, name);\n }\n if (parent.kind === SyntaxKind.ArrayLiteralExpression) {\n const assign: any = parent.parent;\n if (assign !== undefined && isBinaryExpression(assign) && assign.left === parent) {\n return this.rustR01RequestTupleWrite(assign.right, parent.elements.indexOf(target), name);\n }\n }\n // a field of a `let`-bound literal aliasing the local feeds ccxt's\n // writeBackAliasedArrayMutations, which keys on the helper text\n if ((parent.kind === SyntaxKind.PropertyAssignment || parent.kind === SyntaxKind.ShorthandPropertyAssignment)\n && !(parent.kind === SyntaxKind.PropertyAssignment && parent.initializer !== target)) {\n let literal: any = parent.parent;\n while (literal?.parent !== undefined && (isParenthesizedExpression(literal.parent) || isAsExpression(literal.parent))) literal = literal.parent;\n if (literal?.parent === undefined || isVariableDeclaration(literal.parent)) return false;\n }\n if (parent.kind === SyntaxKind.PrefixUnaryExpression || parent.kind === SyntaxKind.PostfixUnaryExpression\n || parent.kind === SyntaxKind.DeleteExpression\n || ((isForOfStatement(parent) || isForInStatement(parent)) && parent.initializer === target)) {\n return false;\n }\n return true;\n }\n\n /** `[ x, … ] = this.handleUntilOption (k, x, …)` — element 0 is the request\n * argument handed back (base-tier implementation, no override). */\n private rustR01RequestTupleWrite(rhs: Node, index: number, name: string): boolean {\n return index === 1 ? this.r26ParamsSlot(rhs, name, 0) : (index === 0 && this.rustR01TupleHeadIsPlain(rhs, name, 0));\n }\n\n /** Element 0 of `this.m (…)` is a plain dict: `m` is the base-tier\n * `handleUntilOption` (returns its `request` argument), or a method of the\n * calling file (Rust calls it statically) whose every `return [ X, … ]`\n * has X a plain literal / plain local, or a parameter whose argument here is. */\n private rustR01TupleHeadIsPlain(rhs: Node, selfName: string | undefined, depth: number): boolean {\n const call: any = this.rustStripWrappers(rhs);\n if (depth > 4 || call === undefined || !isCallExpression(call) || !isPropertyAccessExpression(call.expression)\n || call.expression.expression.kind !== SyntaxKind.ThisKeyword) {\n return false;\n }\n const argPlain = (index: number): boolean => {\n const arg: any = this.rustStripWrappers(call.arguments[index]);\n return arg !== undefined && (this.rustPlainDictLiteral(arg) || (isIdentifier(arg)\n && (String(arg.text) === selfName || this.rustR01LocalStaysPlain(arg, depth + 1) || this.rustR01ShippedPlain(arg))));\n };\n if (RustTranspiler.RUST_R01_REQUEST_TUPLE_HELPERS.has(String(call.expression.name.text))) {\n return this.rustR01CalleeIsBase(call) && argPlain(1);\n }\n let declaration: any;\n try {\n declaration = signatureDeclaration((this.getChecker() as any).getResolvedSignature(call));\n } catch (e) {\n return false;\n }\n if (declaration?.kind !== SyntaxKind.MethodDeclaration || declaration.body === undefined\n || declaration.getSourceFile() !== call.getSourceFile()) {\n return false;\n }\n let plain = true;\n let returns = 0;\n this.rustWalkScope(declaration.body, (n) => {\n if (isArrowFunction(n) || n.kind === SyntaxKind.FunctionExpression) return RUST_WALK_SKIP;\n if (!isReturnStatement(n)) return;\n returns++;\n const tuple: any = this.rustStripWrappers(n.expression);\n const head: any = tuple?.kind === SyntaxKind.ArrayLiteralExpression ? this.rustStripWrappers(tuple.elements[0]) : undefined;\n const param = head !== undefined && isIdentifier(head) ? declaration.parameters.findIndex((p) => p.name?.kind === SyntaxKind.Identifier && String(p.name.text) === String(head.text)) : -1;\n const ok = head !== undefined && (this.rustPlainDictLiteral(head)\n || (param >= 0 ? (this.rustSymbolOf(head) === this.rustSymbolOf(declaration.parameters[param].name) && argPlain(param)\n && this.rustR01ParamUnassigned(declaration, String(head.text)))\n : (isIdentifier(head) && this.rustR01LocalStaysPlain(head, depth + 1))));\n if (!ok) { plain = false; return RUST_WALK_STOP; }\n });\n return plain && returns > 0;\n }\n\n /** A pass-through parameter: never assigned in the method body. */\n private rustR01ParamUnassigned(method: any, name: string): boolean {\n let kept = true;\n this.rustWalkScope(method.body, (n) => {\n if (isBinaryExpression(n) && rustIsAssignmentOperator(n.operatorToken.kind) && isIdentifier(n.left) && String(n.left.text) === name) {\n kept = false;\n return RUST_WALK_STOP;\n }\n });\n return kept;\n }\n\n /** A value that is a fresh plain dict, nullish, or the local itself. */\n rustR01PlainSource(node: Node, name: string): boolean {\n const stripped: any = this.rustStripWrappers(node);\n if (stripped === undefined) return false;\n if (this.rustPlainDictLiteral(stripped) || this.rustTypeIsUndefinedish(stripped)\n || (isIdentifier(stripped) && String(stripped.text) === name)) {\n return true;\n }\n if (isConditionalExpression(stripped)) {\n return this.rustR01PlainSource(stripped.whenTrue, name) && this.rustR01PlainSource(stripped.whenFalse, name);\n }\n if (isCallExpression(stripped) && isPropertyAccessExpression(stripped.expression)\n && stripped.expression.expression.kind === SyntaxKind.ThisKeyword\n && RustTranspiler.RUST_R01_PLAIN_DICT_BUILDERS.has(String(stripped.expression.name.text))) {\n return this.rustR01CalleeIsBase(stripped);\n }\n if (this.rustR12PlainSource(stripped)) return true;\n // `x = this.omit|keysort (x, …)` copies x's own map; `this.extend (…)` builds a\n // fresh map from its dict arguments — plain when each of them is.\n if (isCallExpression(stripped) && isPropertyAccessExpression(stripped.expression)\n && stripped.expression.expression.kind === SyntaxKind.ThisKeyword && stripped.arguments.length > 0\n && this.rustR01CalleeIsBase(stripped)) {\n const callee = String(stripped.expression.name.text);\n const first: any = this.rustStripWrappers(stripped.arguments[0]);\n if (callee === 'omit' || callee === 'keysort') {\n return first !== undefined && isIdentifier(first) && String(first.text) === name;\n }\n if (callee === 'extend') {\n return stripped.arguments.every((a) => this.rustR01PlainSource(a, name));\n }\n }\n return false;\n }\n\n /** The checker resolves the call to the base-tier implementation (a venue\n * override could return anything). */\n private rustR01CalleeIsBase(call: Node): boolean {\n let declaration: any;\n try {\n declaration = signatureDeclaration((this.getChecker() as any).getResolvedSignature(call));\n } catch (e) {\n return false;\n }\n // a method body, or the base function behind an `omit = omit;` property\n return declaration !== undefined && (declaration.body !== undefined || this.r14BaseOverload(declaration))\n && RustTranspiler.RUST_BASE_TIER_FILE.test(String(declaration.getSourceFile().fileName).replace(/\\\\/g, '/'));\n }\n\n // hx4 R02\n // `this.[k]`: a class property whose declared type proves a plain dict is a\n // container struct field (never a book/cache/side/client/live marker dict), so\n // `get_value`'s marker routes cannot fire and the read is `m.get(k)`.\n\n /** The class property declaration behind `this.` when its annotation proves a plain dict. */\n rustProvenDictThisField(node: Node): Declaration | undefined {\n if (!isPropertyAccessExpression(node) || node.expression.kind !== SyntaxKind.ThisKeyword) return undefined;\n let declaration: any;\n try {\n declaration = symbolValueDeclaration(this.getChecker().getSymbolAtLocation(node.name));\n } catch (e) {\n return undefined;\n }\n if (declaration === undefined || declaration.kind !== SyntaxKind.PropertyDeclaration || declaration.type === undefined) return undefined;\n const type = this.getCheckedTypeOf(declaration.type);\n return type !== undefined && this.isProvenMapType(type) ? declaration : undefined;\n }\n\n /** `this.[a]` whose declared field type's element type is itself a plain dict\n * (`Dictionary>`). */\n rustProvenDictThisFieldElement(node: Node): boolean {\n if (!isElementAccessExpression(node)) return false;\n const field: any = this.rustProvenDictThisField(node.expression);\n if (field === undefined) return false;\n const fieldType = this.getCheckedTypeOf(field.type);\n const parts: Type[] = (fieldType.flags & TypeFlags.Union) ? (typeParts(fieldType) ?? []).filter((p) => !this.rustTypeIsNullish(p)) : [fieldType];\n return parts.length === 1 && this.isProvenMapType(this.getChecker().getIndexTypeOfType(parts[0], IndexKind.String));\n }\n\n /** `this.[k]` with a proven-dict field and a proven string key place. */\n printNativeThisFieldDynamicMapAccess(receiverText: string, receiverNode: Node, keyNode: Node): string | undefined {\n if (this.rustProvenDictThisField(receiverNode) === undefined && !this.rustProvenDictThisFieldElement(receiverNode)) return undefined;\n if (!this.rustKeyIsProvenString(keyNode)) return undefined;\n const keyText = this.printNode(keyNode, 0).trim();\n if (!/^[A-Za-z_][A-Za-z0-9_]*$/.test(keyText)) return undefined;\n return `${receiverText}.as_map().and_then(|__m| ${keyText}.as_str().and_then(|__k| __m.get(__k))).cloned().unwrap_or(Value::Null)`;\n }\n\n // hx4 R04 — `const x = []` locals declared `Vec` when every use is a statement\n // `x.push(v)` (native push), `x.length`, `return x` or an argument inside a `return`\n // (boxed once as `Value::from(x)`). Anything else keeps the `Value` box and `append_to_array`.\n private rustVecLocalDecisions = new WeakMap();\n\n rustVecLocalIsTyped(declaration): boolean {\n if (declaration?.kind !== SyntaxKind.VariableDeclaration) return false;\n let decision = this.rustVecLocalDecisions.get(declaration);\n if (decision === undefined) {\n this.rustVecLocalDecisions.set(declaration, false); // re-entrancy guard\n decision = this.rustVecLocalIsTypedUncached(declaration);\n this.rustVecLocalDecisions.set(declaration, decision);\n }\n return decision;\n }\n\n rustVecLocalIsTypedUncached(declaration): boolean {\n const init = declaration.initializer;\n if (declaration.name?.kind !== SyntaxKind.Identifier || init === undefined\n || !isArrayLiteralExpression(init) || init.elements.length !== 0) return false;\n const checker: any = this.checkerOrUndefined();\n const type = checker?.getTypeAtLocation(declaration.name);\n if (type === undefined || !checker.isArrayType(type)) return false;\n const name = String(declaration.name.text);\n const fn = this.rustEnclosingFunction(declaration);\n if (fn === undefined || isSourceFile(fn)) return false;\n // The tests pipeline's text post-passes key on the boxed `Value` local shape.\n const source = declaration.getSourceFile?.()?.fileName;\n if (typeof source === 'string' && /\\/test\\//.test(source)) return false;\n let pushes = 0;\n const safe = this.rustLocalUsesAll(declaration, name, false, (n) => {\n const parent = n.parent;\n if ((isPropertyAccessExpression(parent) && parent.name === n)\n || (parent?.kind === SyntaxKind.PropertyAssignment && parent.name === n)) return true;\n if (this.rustEnclosingFunction(n) !== fn) return false;\n if (isPropertyAccessExpression(parent) && parent.expression === n) {\n const member = String(parent.name.text);\n if (member === 'length') {\n const up = parent.parent;\n return !(isBinaryExpression(up) && up.left === parent && rustIsAssignmentOperator(up.operatorToken.kind))\n && up?.kind !== SyntaxKind.PrefixUnaryExpression && up?.kind !== SyntaxKind.PostfixUnaryExpression;\n }\n if (member === 'push' && this.rustVecPushShape(parent.parent, name)) {\n pushes++;\n return true;\n }\n return this.r15VecJoinUse(parent);\n }\n return this.rustVecValueUse(n, name) || this.r11VecUse(n) || this.r15VecPropertyUse(n);\n });\n return safe && pushes > 0;\n }\n\n // `x.push(v);` as a whole statement, one non-spread argument not naming `x`.\n rustVecPushShape(call, name: string): boolean {\n if (!isCallExpression(call) || call.arguments.length !== 1 || call.parent?.kind !== SyntaxKind.ExpressionStatement) return false;\n const arg = call.arguments[0];\n if (arg.kind === SyntaxKind.SpreadElement) return false;\n let mentions = false;\n const visit = (m) => {\n if (mentions) return;\n if (m.kind === SyntaxKind.Identifier && m.text === name) { mentions = true; return; }\n m.forEachChild?.(visit);\n };\n visit(arg);\n return !mentions;\n }\n\n // `return x` / `return f(.., x, ..)` with `x` named once in the statement: a boxing move.\n // Elsewhere a boxing argument / object-literal value must be the local's last use outside any loop.\n rustVecValueUse(n, name: string): boolean {\n const parent = n.parent;\n if (isReturnStatement(parent)) return true;\n const isArg = isCallExpression(parent) && parent.arguments.some((a) => a === n) && this.rustVecBoxingCallee(parent.expression);\n const isProp = parent?.kind === SyntaxKind.PropertyAssignment && parent.initializer === n;\n if (!isArg && !isProp) return false;\n let statement: any = parent;\n while (statement !== undefined && !isStatement(statement)) statement = statement.parent;\n if (statement === undefined) return false;\n if (!isReturnStatement(statement) && !this.rustVecIsFinalUse(n, name)) return false;\n let count = 0;\n const visit = (m) => {\n if (m.kind === SyntaxKind.Identifier && m.text === name) count++;\n m.forEachChild?.(visit);\n };\n visit(statement);\n return count === 1;\n }\n\n rustVecIsFinalUse(n, name: string): boolean {\n const fn = this.rustEnclosingFunction(n);\n for (let current: any = n.parent; current !== undefined && current !== fn; current = current.parent) {\n switch (current.kind) {\n case SyntaxKind.ForStatement: case SyntaxKind.ForInStatement: case SyntaxKind.ForOfStatement:\n case SyntaxKind.WhileStatement: case SyntaxKind.DoStatement:\n return false;\n }\n }\n const end = n.getEnd?.() ?? n.end;\n return !(this.rustScopeNameNodes(fn, name) as any[]).some((m) => m.kind === SyntaxKind.Identifier && m !== n\n && (m.getStart?.() ?? m.pos) >= end && !this.rustIdentifierIsPropertyName(m));\n }\n\n // `this.m(..)` / `super.m(..)` / `Promise.all(..)`: every argument prints through printNode as a `Value`.\n rustVecBoxingCallee(callee): boolean {\n if (!isPropertyAccessExpression(callee)) return false;\n const receiver: any = callee.expression;\n if (receiver.kind === SyntaxKind.ThisKeyword || receiver.kind === SyntaxKind.SuperKeyword) return true;\n return receiver.kind === SyntaxKind.Identifier && receiver.text === 'Promise' && String(callee.name.text) === 'all';\n }\n\n rustVecLocalDeclarationOf(node): any {\n if (node?.kind !== SyntaxKind.Identifier) return undefined;\n const checker: any = this.checkerOrUndefined();\n const symbol = checker?.getSymbolAtLocation(node);\n const declaration = symbolValueDeclaration(symbol) ?? symbolDeclarations(symbol)[0];\n return declaration !== undefined && declaration.name !== node && this.rustVecLocalIsTyped(declaration) ? declaration : undefined;\n }\n\n printRustVecPush(node, name: string | undefined, parsedArg: string | undefined): string | undefined {\n const receiver = node?.expression?.expression;\n if (name === undefined || parsedArg === undefined || this.rustVecLocalDeclarationOf(receiver) === undefined) return undefined;\n const arg = parsedArg.trim();\n // `append_to_array` takes the value by move; ccxt's post-pass cloned a bare local there.\n const value = /^[a-zA-Z_][a-zA-Z0-9_]*$/.test(arg) && arg !== 'self' && arg !== 'true' && arg !== 'false' ? `${arg}.clone()` : arg;\n return `${name}.push(${value})`;\n }\n\n transformIdentifier(node, identifier) {\n const text = super.transformIdentifier(node, identifier);\n const parent = node?.parent;\n if (parent === undefined || !(isReturnStatement(parent) || (isCallExpression(parent) && parent.arguments.some((a) => a === node)\n && this.rustVecBoxingCallee(parent.expression)) || (parent.kind === SyntaxKind.PropertyAssignment && parent.initializer === node))) return text;\n if (this.rustVecLocalDeclarationOf(node) === undefined) return text;\n return this.rustVecValueUse(node, String(node.text)) ? `Value::from(${text})` : `Value::from(${text}.clone())`;\n }\n\n // hx4 R05 — native IndexMap ops for `k in X`, `delete X[k]`, `Object.keys/values(X)`.\n\n /** Source path of a node (forward slashes). */\n r05Path(node: Node): string {\n const src: any = (node as any)?.getSourceFile?.();\n return typeof src?.fileName === 'string' ? src.fileName.replace(/\\\\/g, '/') : '';\n }\n\n /** Test sources keep the helpers: tests-pipeline post-passes match `in_op(` text. */\n r05IsTest(node: Node): boolean {\n return /\\/test\\//.test(this.r05Path(node));\n }\n\n /** `k in X` with a non-literal key on a dict-shaped receiver: `in_op`'s Dict arm.\n * The Arr arm is the only other `true` path; the dict proof excludes it. */\n r05InOp(key, obj): string | undefined {\n const recv: any = this.rustStripWrappers(obj);\n if (this.r05IsTest(obj) || !this.isShallowValueReceiver(recv) || this.rustParamShadowOf(recv) !== undefined\n || (isPropertyAccessExpression(recv) && RustTranspiler.RUST_TAGGED_CONTAINER_FIELDS.has(String(recv.name.text)))\n || !this.isDictShapedType(this.typeOfNodeIfAny(obj))) {\n return undefined;\n }\n const objExpr = this.printNode(obj, 0).trim();\n const keyExpr = this.printNode(key, 0).trim();\n if (!/^[A-Za-z_][A-Za-z0-9_]*$/.test(keyExpr) || keyExpr === 'self') {\n return undefined; // the key is borrowed beside the receiver: plain locals only\n }\n return `Value::Bool(matches!((&${objExpr}, &${keyExpr}), (Value::Dict(__d), Value::Str(__k)) if __d.contains_key(__k.as_ref())))`;\n }\n\n /** `delete X[k]` on a receiver the native-insert proof admits (never a ws\n * subscriptions snapshot, so `try_ws_subs_remove` is dead): `shift_remove`. */\n r05Delete(node): string | undefined {\n const target: any = node?.expression;\n if (target === undefined || !isElementAccessExpression(target) || this.r05IsTest(node)) {\n return undefined;\n }\n const base: any = target.expression;\n const receiver = this.rustNativeInsertReceiver(base);\n // ws-capable tiers: a local/param may alias a `client.subscriptions` snapshot\n // (live-store route in the helper); admit only fields and literal-built locals.\n const restTier = /\\/ts\\/src\\/[^/]+\\.ts$/.test(this.r05Path(node));\n if (receiver !== undefined && !receiver.isField && !restTier && receiver.plain !== true) {\n return undefined;\n }\n if (receiver === undefined || this.rustParamShadowOf(base) !== undefined\n || !this.rustReceiverStaysDict(base, receiver)\n || (receiver.isField && RustTranspiler.RUST_TAGGED_CONTAINER_FIELDS.has(String(receiver.nameNode.text)))\n || (!receiver.isField && this.rustLocalInitReadsTaggedContainer(base))) {\n return undefined;\n }\n const recv = this.printNode(base, 0).trim();\n const keyNode: any = target.argumentExpression;\n const literal = isStringLiteral(keyNode) ? this.rustStringLiteralOf(this.printNode(keyNode, 0).trim()) : undefined;\n if (literal !== undefined) {\n return `if let Value::Dict(__d) = &mut ${recv} { std::sync::Arc::make_mut(__d).shift_remove(${literal}); }`;\n }\n const keyExpr = this.printNode(keyNode, 0).trim();\n if (!/^[A-Za-z_][A-Za-z0-9_]*$/.test(keyExpr) || keyExpr === 'self' || keyExpr === recv) {\n return undefined;\n }\n return `if let (Value::Dict(__d), Value::Str(__k)) = (&mut ${recv}, &${keyExpr}) { std::sync::Arc::make_mut(__d).shift_remove(__k.as_ref()); }`;\n }\n\n /** `this.` with a declared plain-dict type that is no ws container: the\n * hand-written base builds these maps itself and never tags them. */\n r05UntaggedField(node): boolean {\n return isPropertyAccessExpression(node) && node.expression.kind === SyntaxKind.ThisKeyword\n && !RustTranspiler.RUST_TAGGED_CONTAINER_FIELDS.has(String(node.name.text))\n && !RustTranspiler.RUST_TAGGED_HANDLE_FIELDS.has(String(node.name.text))\n && this.rustProvenDictThisFieldR05(node);\n }\n\n rustProvenDictThisFieldR05(node): boolean {\n let declaration: any;\n try {\n declaration = symbolValueDeclaration(this.getChecker().getSymbolAtLocation(node.name));\n } catch (e) {\n return false;\n }\n if (declaration === undefined || declaration.kind !== SyntaxKind.PropertyDeclaration || declaration.type === undefined) return false;\n const type = this.getCheckedTypeOf(declaration.type);\n return type !== undefined && this.isProvenMapType(type);\n }\n\n /** `Object.keys/values(X)` in REST-tier sources (`ts/src/.ts`): no ws client\n * there, so X never carries the `__ws_subs_url`/`__ws_sub_ref` tags the helper filters. */\n r05Enum(node, parsedArg: string | undefined, kind: 'keys' | 'values'): string | undefined {\n const arg: any = this.rustStripWrappers(node?.arguments?.[0]);\n if (arg === undefined || parsedArg === undefined\n || !(/\\/ts\\/src\\/[^/]+\\.ts$/.test(this.r05Path(node)) || this.r05UntaggedField(arg))\n || !(isIdentifier(arg) || isPropertyAccessExpression(arg) || isElementAccessExpression(arg) || isCallExpression(arg))\n || this.rustParamShadowOf(arg) !== undefined) {\n return undefined;\n }\n const type = this.typeOfNodeIfAny(arg);\n const parts: Type[] = type === undefined ? [] : ((type.flags & TypeFlags.Union) ? (typeParts(type) ?? []) : [type]);\n if (parts.some((p) => this.getChecker().isArrayType(p) || this.getChecker().isTupleType(p)\n || (p.flags & (TypeFlags.StringLike | TypeFlags.NumberLike | TypeFlags.BooleanLike | TypeFlags.BigIntLike)) !== 0)) {\n return undefined; // native-typed locals (bool / Option) have no `as_map`\n }\n const text = parsedArg.trim();\n const recv = /^[A-Za-z_][A-Za-z0-9_.]*$/.test(text) ? text : `(${text})`;\n const body = kind === 'keys' ? '__m.keys().map(|__k| Value::Str(__k.clone().into())).collect()' : '__m.values().cloned().collect()';\n return `Value::Array(${recv}.as_map().map(|__m| ${body}).unwrap_or_default())`;\n }\n\n // hx4 R06: string methods on a checker-proven string receiver print native `str` code. The\n // receiver is a `Value`; `as_str()` reaches the payload and its `None` arm is the helper's\n // non-`Str` branch (Null / false / empty array / -1). Literal operands only, unless noted.\n\n /** Printed receiver usable as a method receiver, else undefined. */\n rustNativeStringReceiver(node, receiverText: string, kind = 'string'): string | undefined {\n if (node === undefined || !isCallExpression(node) || !isPropertyAccessExpression(node.expression)) return undefined;\n if (typeof receiverText !== 'string' || receiverText.includes('\\n') || receiverText.trim().startsWith('&')) return undefined;\n const receiver = node.expression.expression;\n if (receiver.kind === SyntaxKind.ThisKeyword || receiver.kind === SyntaxKind.SuperKeyword) return undefined;\n if (kind === 'string' && this.primitiveKindOfType(this.typeOfNodeIfAny(receiver)) !== 'string') return undefined;\n if (isIdentifier(receiver) && this.rustStringLocalIdentifierIsTyped(receiver)) return undefined;\n const text = receiverText.trim();\n return /^[A-Za-z_][A-Za-z0-9_]*(\\.[A-Za-z_][A-Za-z0-9_]*)*$/.test(text) ? text : `(${text})`;\n }\n\n /** Escaped text of a string-literal argument, else undefined. */\n rustNativeStringLiteralArg(node): string | undefined {\n if (node === undefined || (!isStringLiteral(node) && !isNoSubstitutionTemplateLiteral(node))) return undefined;\n if (node.text in this.StringLiteralReplacements) return undefined;\n return this.escapeRustStringLiteral(node.text);\n }\n\n // `x.toUpperCase()` / `x.toLowerCase()`: the helper's `Value::Str` arm, Null otherwise.\n printNativeStringCase(node, receiverText: string, method: string): string | undefined {\n const receiver = this.rustNativeStringReceiver(node, receiverText);\n if (receiver === undefined || (node.arguments?.length ?? 0) !== 0) return undefined;\n return `${receiver}.as_str().map(|__s| Value::Str(__s.${method}().into())).unwrap_or(Value::Null)`;\n }\n\n // `x.startsWith(\"lit\")` / `x.endsWith(\"lit\")` → a bool (false for a non-`Str` receiver).\n printNativeStringAffixTest(node, receiverText: string, method: string): string | undefined {\n const receiver = this.rustNativeStringReceiver(node, receiverText);\n if (receiver === undefined || node.arguments?.length !== 1) return undefined;\n const literal = this.rustNativeStringLiteralArg(node.arguments[0]);\n if (literal === undefined) return undefined;\n return `${receiver}.as_str().is_some_and(|__s| __s.${method}(\"${literal}\"))`;\n }\n\n // `x.split(\"lit\")`: an array of the parts, the empty array for a non-`Str` receiver.\n printNativeStringSplit(node, receiverText: string): string | undefined {\n const receiver = this.rustNativeStringReceiver(node, receiverText);\n if (receiver === undefined || node.arguments?.length !== 1) return undefined;\n const literal = this.rustNativeStringLiteralArg(node.arguments[0]);\n if (literal === undefined) return undefined;\n return `Value::Array(${receiver}.as_str().map(|__s| __s.split(\"${literal}\").map(|__p| Value::Str(__p.to_string().into())).collect()).unwrap_or_default())`;\n }\n\n // `x.replace(\"a\", \"b\")`: the helper replaces every occurrence (`str::replace`), else the receiver.\n printNativeStringReplace(node, receiverText: string): string | undefined {\n const receiver = this.rustNativeStringReceiver(node, receiverText);\n if (receiver === undefined || node.arguments?.length !== 2) return undefined;\n const from = this.rustNativeStringLiteralArg(node.arguments[0]);\n const to = this.rustNativeStringLiteralArg(node.arguments[1]);\n if (from === undefined || to === undefined) return undefined;\n return `${receiver}.as_str().map(|__s| Value::Str(__s.replace(\"${from}\", \"${to}\").into())).unwrap_or_else(|| ${receiver}.clone())`;\n }\n\n // `x.padStart(N, \"c\")` with a one-char alphanumeric pad: `format!` width counts chars and never\n // truncates, which is the helper's arm for a one-char pad.\n printNativeStringPadStart(node, receiverText: string): string | undefined {\n const receiver = this.rustNativeStringReceiver(node, receiverText);\n if (receiver === undefined || node.arguments?.length !== 2) return undefined;\n const width = this.rustSliceLiteralBound(node.arguments[0]);\n const pad = node.arguments[1];\n if (width === undefined || width < 0 || width > 4096) return undefined;\n if ((!isStringLiteral(pad) && !isNoSubstitutionTemplateLiteral(pad)) || !/^[A-Za-z0-9 ]$/.test(pad.text)) return undefined;\n return `${receiver}.as_str().map(|__s| Value::Str(format!(\"{:${pad.text}>${width}}\", __s).into())).unwrap_or(Value::Null)`;\n }\n\n // `x.indexOf(y)` with a proven-string needle: `-1` when either side is not a `Str` (byte index).\n printNativeStringIndexOfString(node, receiverText: string): string | undefined {\n const receiver = this.rustNativeStringReceiver(node, receiverText);\n if (receiver === undefined || node.arguments?.length !== 1) return undefined;\n const needle = node.arguments[0];\n if (!isIdentifier(needle) || this.primitiveKindOfType(this.typeOfNodeIfAny(needle)) !== 'string') return undefined;\n if (!this.isDeclaredValueIdentifier(needle) || this.rustStringLocalIdentifierIsTyped(needle)) return undefined;\n const needleText = this.printNode(needle, 0).trim();\n if (!/^[A-Za-z_][A-Za-z0-9_]*$/.test(needleText)) return undefined;\n return `Value::Int(${receiver}.as_str().zip(${needleText}.as_str()).and_then(|(__s, __n)| __s.find(__n)).map(|__i| __i as i64).unwrap_or(-1))`;\n }\n\n // `xs.join(\"lit\")` on a `string[]`: `Display` renders `Str`/`Null` like the helper does.\n printNativeStringJoin(node, receiverText: string): string | undefined {\n const receiver = this.rustNativeStringReceiver(node, receiverText, 'array');\n if (receiver === undefined || node.arguments?.length !== 1) return undefined;\n const literal = this.rustNativeStringLiteralArg(node.arguments[0]);\n if (literal === undefined) return undefined;\n const checker: any = this.checkerOrUndefined();\n const type: any = this.typeOfNodeIfAny(node.expression.expression);\n if (checker === undefined || type === undefined || !checker.isArrayType(type)) return undefined;\n const element = checker.getTypeArguments?.(type)?.[0];\n if (this.primitiveKindOfType(element) !== 'string') return undefined;\n return `Value::Str(${receiver}.as_array().map(|__a| __a.iter().map(|__v| __v.to_string()).collect::>().join(\"${literal}\")).unwrap_or_default().into())`;\n }\n\n // hx4 R07 — numeric/string helpers on checker-proven `number` / `string` operands (nullish members\n // allowed: the helper's Null arm is reproduced). Each native form answers exactly what the helper\n // answers for Int/Float/Str/Null boxes; any other operand type keeps the helper.\n rustOperandKind(node): string | undefined {\n try {\n if (node === undefined || !this.printsValueExpression(node)) return undefined;\n return this.primitiveKindOfType(this.typeOfNodeIfAny(node));\n } catch (e) {\n return undefined;\n }\n }\n\n // `x.toString()` on a number/string: `to_string_val` is `stringify_simple`, i.e. `Display`.\n // Typed `Option` receivers have no `Display`, so they keep the helper.\n printRustNativeToString(node, name: string): string | undefined {\n const receiver = node?.expression?.expression;\n const kind = this.rustOperandKind(receiver);\n if (kind !== 'number' && kind !== 'string') return undefined;\n const inner = this.unwrapParensNode(receiver);\n if (inner !== undefined && (this.rustStringLocalIdentifierIsTyped(inner) || this.rustNativeStrCalleeKind(inner) === 'str')) return undefined;\n return `Value::Str(format!(\"{}\", ${name}).into())`;\n }\n\n // `Math.floor|round|ceil(n)`: the helper answers `Float(op(x))` for a numeric box, `Null` otherwise.\n printRustNativeMathCall(node, op: string, parsedArg: string): string | undefined {\n if (this.rustOperandKind(node?.arguments?.[0]) !== 'number') return undefined;\n return `(${parsedArg}).as_f64().map(|__x| Value::Float(__x.${op}())).unwrap_or(Value::Null)`;\n }\n\n // `-n`: Int/Float flip sign in place, a Null box stays Null (helper's fallthrough).\n printRustNativeNegate(operand, operandText: string): string | undefined {\n if (this.rustOperandKind(operand) !== 'number' && this.rustR16NumericKind(operand) === undefined) return undefined;\n return `(match &(${operandText}) { Value::Int(x) => Value::Int(-x), Value::Float(x) => Value::Float(-x), _ => Value::Null })`;\n }\n\n // `a % b` on numbers: Int pair stays Int, any Float widens; a zero divisor or Null answers Null.\n printRustNativeMod(left, right, leftText: string, rightText: string): string | undefined {\n if (this.rustOperandKind(left) !== 'number' || this.rustOperandKind(right) !== 'number') return undefined;\n return `(match (&(${leftText}), &(${rightText})) {` +\n ' (Value::Int(x), Value::Int(y)) if *y != 0 => Value::Int(x % y),' +\n ' (Value::Int(x), Value::Float(y)) if *y != 0.0 => Value::Float(*x as f64 % *y),' +\n ' (Value::Float(x), Value::Int(y)) if *y != 0 => Value::Float(*x % *y as f64),' +\n ' (Value::Float(x), Value::Float(y)) if *y != 0.0 => Value::Float(x % y),' +\n ' _ => Value::Null })';\n }\n\n // hx4 R09 — `.length` always prints `Value::Int` (`get_array_length` / `Value::Int(len)`), so a\n // `.length` read, or a `const` local initialised from one, is a never-null Int whatever its receiver.\n rustR09IsDefiniteInt(node): boolean {\n const inner = this.rustStripWrappers(node);\n if (inner === undefined) return false;\n if (isPropertyAccessExpression(inner)) return String(inner.name.text) === 'length';\n if (!isIdentifier(inner)) return false;\n const declaration: any = this.rustSingleLocalDeclaration(inner);\n if (declaration === undefined || !isVariableDeclaration(declaration) || declaration.name?.kind !== SyntaxKind.Identifier) return false;\n if ((declaration.parent?.flags & NodeFlags.Const) === 0) return false;\n const init = this.rustStripWrappers(declaration.initializer);\n return init !== undefined && isPropertyAccessExpression(init) && String(init.name.text) === 'length';\n }\n\n // Int-only (definite) or checker-proven number (Int/Float/Null) operand that prints a `Value`.\n rustR09NumericOperand(node): string | undefined {\n if (this.rustR09IsDefiniteInt(node)) return 'definite';\n return this.rustOperandKind(node) === 'number' ? 'number' : undefined;\n }\n\n // `a === b` with a definite Int side against a number literal, a number or another definite Int:\n // is_equal compares Int/Float payloads as f64 and Null only equals Null, which `as_f64()` mirrors.\n rustR09LengthEquality(left, right, op): string | undefined {\n if (!this.rustR09IsDefiniteInt(left) && !this.rustR09IsDefiniteInt(right)) return undefined;\n const operator = (op === SyntaxKind.EqualsEqualsToken || op === SyntaxKind.EqualsEqualsEqualsToken) ? '==' : '!=';\n const [ definite, other ] = this.rustR09IsDefiniteInt(left) ? [ left, right ] : [ right, left ];\n if (!this.printsValueExpression(definite)) return undefined;\n const otherInner = this.rustStripWrappers(other);\n if (otherInner !== undefined && otherInner.kind === SyntaxKind.NumericLiteral) {\n const text = this.numericLiteralF64Text(otherInner);\n if (text === undefined) return undefined;\n return `${this.printNode(definite, 0)}.as_f64() ${operator} Some(${text})`;\n }\n if (this.rustR09NumericOperand(other) === undefined) return undefined;\n return `${this.printNode(left, 0)}.as_f64() ${operator} ${this.printNode(right, 0)}.as_f64()`;\n }\n\n // `a + b` / `a - b` with a definite Int operand and a numeric one: the helper's Int/Float dispatch.\n // `s + n` / `n + s` with s a non-null string and n numeric: the helper's string branch, i.e.\n // `stringify_simple` of each side, which equals `Display` for Str/Int/Float/Null.\n rustR09NativeAddSubtract(op, left, right, leftType, rightType, leftText: string, rightText: string): string | undefined {\n if (op !== SyntaxKind.PlusToken && op !== SyntaxKind.MinusToken) return undefined;\n const leftNumeric = this.rustR09NumericOperand(left);\n const rightNumeric = this.rustR09NumericOperand(right);\n if ((leftNumeric === 'definite' && rightNumeric !== undefined) || (rightNumeric === 'definite' && leftNumeric !== undefined)) {\n return this.printNativeNumeric(op, leftText, rightText);\n }\n if (op !== SyntaxKind.PlusToken) return undefined;\n const stringSide = this.isStringLikeType(leftType) && rightNumeric !== undefined ? left\n : (this.isStringLikeType(rightType) && leftNumeric !== undefined ? right : undefined);\n if (stringSide === undefined || !this.printsValueExpression(stringSide)) return undefined;\n const inner = this.unwrapParensNode(stringSide);\n if (inner !== undefined && (this.rustStringLocalIdentifierIsTyped(inner) || this.rustNativeStrCalleeKind(inner) === 'str')) return undefined;\n return this.printNativeStringConcat(leftText, rightText);\n }\n\n // hx4 R10 — native reads on receivers the R01 plain-dict proof admits (tag-free literal /\n // `account ()` / `omit` / `extend` / tuple element 0 locals) and on `Dict`-annotated parameters\n // whose writes keep them plain: no marker route of `get_value` can fire on such a receiver.\n\n /** 'local' for an R01-proven plain-dict local, 'param' for a plain-kept dict parameter. */\n rustR10PlainReceiver(node: Node): 'local' | 'param' | undefined {\n if (node === undefined || !isIdentifier(node) || this.rustParamShadowOf(node) !== undefined) return undefined;\n const declaration: any = this.rustSingleLocalDeclaration(node as Identifier);\n if (declaration !== undefined && isParameterDeclaration(declaration)) {\n if (declaration.type === undefined || declaration.dotDotDotToken !== undefined) return undefined;\n const type = this.getCheckedTypeOf(declaration.type);\n if (type === undefined || !this.isProvenMapType(type)) return undefined;\n return this.rustParamStaysPlainDict(declaration) ? 'param' : undefined;\n }\n try {\n return (this.rustR01LocalStaysPlain(node as Identifier) || this.rustR01ShippedPlain(node as Identifier)) ? 'local' : undefined;\n } catch (e) {\n return undefined;\n }\n }\n\n /** A literal-key read (`x['k']` / `x.k`) on a proven plain receiver. */\n rustR10LiteralReadOk(receiverNode: Node, keyText: string): boolean {\n const kind = this.rustR10PlainReceiver(receiverNode);\n if (kind === undefined || keyText === '') return false;\n if (kind === 'param' && RustTranspiler.RUST_DICT_LOCAL_UNSAFE_KEYS.has(keyText)) return false;\n const read: any = receiverNode.parent;\n return read === undefined || !this.isWriteBackBindRead(read);\n }\n\n /** `x[k]` on a proven plain receiver with a `Value` key place (`string` or `any` typed). */\n rustR10DynamicRead(receiverText: string, receiverNode: Node, keyNode: Node): string | undefined {\n const kind = this.rustR10PlainReceiver(receiverNode);\n if (kind === undefined) return undefined;\n const key: any = this.rustSkipWrappers(keyNode);\n if (key === undefined || !isIdentifier(key) || this.rustStringLocalIdentifierIsTyped(key)) return undefined;\n const type = this.getCheckedTypeOf(key);\n if (type === undefined || !((type.flags & TypeFlags.Any) || this.rustKeyIsProvenString(key))) return undefined;\n const read = this.rustElementReadOfKey(keyNode);\n if (read !== undefined && this.isWriteBackBindRead(read)) return undefined;\n const keyText = this.printNode(keyNode, 0).trim();\n if (!/^[A-Za-z_][A-Za-z0-9_]*$/.test(keyText)) return undefined;\n if (kind === 'param' && this.rustNodeIsKeyUnsafePlace(keyText)) return undefined;\n return `${receiverText}.as_map().and_then(|__m| ${keyText}.as_str().and_then(|__k| __m.get(__k))).cloned().unwrap_or(Value::Null)`;\n }\n\n // hx4 R11 — typed `Vec` locals also admit an argument of a non-`&mut self` `this.m(..)`\n // call that is not the final use (boxed as `Value::from(x.clone())`, the clone the post-pass\n // gave the boxed local) and a plain `x[i]` read with a number index (native `Vec::get`).\n r11VecUse(n): boolean {\n const parent = n.parent;\n if (isCallExpression(parent) && parent.arguments.some((a) => a === n)) {\n const callee: any = parent.expression;\n if (!isPropertyAccessExpression(callee)) return false;\n const kind = callee.expression.kind;\n if (kind !== SyntaxKind.ThisKeyword && kind !== SyntaxKind.SuperKeyword) return false;\n if (RustTranspiler.MUT_SELF_METHODS.has(this.toSnakeCaseName(String(callee.name.text)))) return false;\n let mentions = 0;\n const visit = (m) => { if (m.kind === SyntaxKind.Identifier && m.text === n.text) mentions++; m.forEachChild?.(visit); };\n parent.arguments.forEach(visit);\n if (mentions !== 1) return false;\n return this.rustVecValueUse(n, String(n.text)) || !this.r11LoopBetween(n);\n }\n return isElementAccessExpression(parent) && parent.expression === n && this.r11VecReadShape(parent);\n }\n\n // A loop around the use that does not also hold the declaration: a per-iteration Vec clone\n // would cost O(n) where the boxed local only bumped its Arc.\n r11LoopBetween(n): boolean {\n const declaration = this.rustVecLocalDeclarationOf(n) ?? this.rustSingleLocalDeclaration(n);\n const fn = this.rustEnclosingFunction(n);\n for (let current: any = n.parent; current !== undefined && current !== fn; current = current.parent) {\n if (declaration !== undefined && this.isNodeInsideNode(declaration, current)) return false;\n switch (current.kind) {\n case SyntaxKind.ForStatement: case SyntaxKind.ForInStatement: case SyntaxKind.ForOfStatement:\n case SyntaxKind.WhileStatement: case SyntaxKind.DoStatement:\n return true;\n }\n }\n return false;\n }\n\n // `x[k]` as a plain value read: not a write/delete/++ target, not a chain or call receiver,\n // not a bind the next statement mutates (ccxt's write-back keys on `get_value` text).\n r11VecReadShape(access): boolean {\n const up: any = access.parent;\n if (up === undefined || isDeleteExpression(up) || up.kind === SyntaxKind.PrefixUnaryExpression\n || up.kind === SyntaxKind.PostfixUnaryExpression) return false;\n if (isBinaryExpression(up) && up.left === access && rustIsAssignmentOperator(up.operatorToken.kind)) return false;\n if ((isPropertyAccessExpression(up) || isElementAccessExpression(up) || isCallExpression(up)) && up.expression === access) return false;\n if (this.isWriteBackBindRead(access)) return false;\n const key: any = this.rustStripWrappers(access.argumentExpression);\n if (key === undefined) return false;\n if (isNumericLiteral(key)) return Number.isInteger(Number(key.text)) && Number(key.text) >= 0;\n // a `Value` number counter (`let i = 0`), as for the native dynamic list index\n return this.isRustValueIndexKey(key);\n }\n\n printElementAccessExpressionExceptionIfAny(node) {\n const receiver: any = node?.expression;\n if (receiver?.kind !== SyntaxKind.Identifier || this.rustVecLocalDeclarationOf(receiver) === undefined\n || !this.r11VecReadShape(node)) return super.printElementAccessExpressionExceptionIfAny(node);\n const name = this.printNode(receiver, 0).trim();\n const key: any = this.rustStripWrappers(node.argumentExpression);\n // `get_value`'s array arm: an Int index by `as usize` (negative misses), anything else misses.\n const index = isNumericLiteral(key) ? String(Number(key.text))\n : `(${this.printNode(node.argumentExpression, 0).trim()}).as_i64().map_or(usize::MAX, |__n| __n as usize)`;\n return `${name}.get(${index}).cloned().unwrap_or(Value::Null)`;\n }\n\n // An expression that always holds a `Value::Arr`: a runtime-split / array-literal-returning call,\n // or a never-reassigned local initialised from one (through `const y = x` aliases).\n r11ProvenListValue(node, depth = 0): boolean {\n const inner = this.rustStripWrappers(node);\n if (inner === undefined || depth > 4 || this.rustIsOrderBookSide(inner)) return false;\n if (isCallExpression(inner)) return this.rustCallReturnsProvenList(inner);\n if (!isIdentifier(inner)) return false;\n const declaration: any = this.rustSingleLocalDeclaration(inner);\n if (declaration === undefined || !isVariableDeclaration(declaration) || declaration.initializer === undefined\n || !isIdentifier(declaration.name)) return false;\n if (this.rustLocalIsReassigned(declaration, String(declaration.name.text))) return false;\n return this.r11ProvenListValue(declaration.initializer, depth + 1);\n }\n\n // hx4 R12 — plain-dict sources from base `safeDict*` reads of unshared dicts and same-file\n // sync request builders; native truthiness / bool equality on operands proven `Value::Bool`\n // or `Value::Null` at runtime (bool tuple elements, bool-returning exchange methods).\n\n /** Base-tier bool readers whose Rust form returns `Value::Bool` or `Value::Null`\n * (`safe_bool*` keep only `Value::Bool` or the default; the `check_option_bool` stub). */\n private static readonly RUST_R12_BOOL_READERS: { [name: string]: number } = { safeBool: 2, safeBool2: 3, safeBoolN: 2, checkOptionBool: -1 };\n private static readonly RUST_R12_DICT_READERS: { [name: string]: number } = { safeDict: 2, safeDict2: 3, safeDictN: 2 };\n /** A REST venue file (`ts/src/.ts`): no base / pro / prediction tier. */\n private static readonly RUST_R12_REST_FILE = /ts\\/src\\/[^/]+\\.ts$/;\n\n /** Extra plain-dict write sources (R01 write-history proof), REST venue files only: no\n * runtime tagged handle (book, ws subscription, cache bucket) is reachable there. */\n private rustR12Visiting = new Set();\n\n rustR12PlainSource(node: any, depth = 0): boolean {\n if (depth > 4 || !isCallExpression(node) || !isPropertyAccessExpression(node.expression)\n || node.expression.expression.kind !== SyntaxKind.ThisKeyword\n || !this.r23PlainSourceTier(node)) {\n return false;\n }\n const callee = String(node.expression.name.text);\n const defaultIndex = RustTranspiler.RUST_R12_DICT_READERS[callee];\n if (defaultIndex !== undefined) {\n const fallback: any = this.rustStripWrappers(node.arguments[defaultIndex]);\n return this.rustR01CalleeIsBase(node) && node.arguments.length <= defaultIndex + 1\n && (fallback === undefined || this.rustPlainDictLiteral(fallback) || this.rustTypeIsUndefinedish(fallback))\n && this.rustR12UnsharedDict(node.arguments[0]) && this.r23TierSourceOk(node.arguments[0]);\n }\n if (this.r23FreshCopy(node, depth)) return true;\n return this.rustR12PlainBuilder(node, depth);\n }\n\n /** `this.options`, a parameter, or a const local whose initializer reads no `this` field\n * but `options` and no tagged container (`hashmap`, `subscriptions`, `futures`). */\n rustR12UnsharedDict(arg: any): boolean {\n const node: any = this.rustStripWrappers(arg);\n if (node === undefined) return false;\n if (isPropertyAccessExpression(node) && node.expression.kind === SyntaxKind.ThisKeyword) {\n return String(node.name.text) === 'options';\n }\n if (!isIdentifier(node)) return false;\n const declaration: any = this.rustSingleLocalDeclaration(node);\n if (declaration === undefined) return false;\n // runtime tags live on pro-only fields; a REST method's parameter is caller data\n if (isParameterDeclaration(declaration)) return true;\n if (!isVariableDeclaration(declaration) || (declaration.parent?.flags & NodeFlags.Const) === 0 || declaration.initializer === undefined) return false;\n let clean = true;\n const visit = (n: any) => {\n if (!clean) return;\n if (isPropertyAccessExpression(n)) {\n const field = String(n.name.text);\n const isCallee = isCallExpression(n.parent) && n.parent.expression === n;\n if (RustTranspiler.RUST_TAGGED_CONTAINER_FIELDS.has(field)\n || (n.expression.kind === SyntaxKind.ThisKeyword && !isCallee && field !== 'options')) {\n clean = false;\n return;\n }\n }\n n.forEachChild(visit);\n };\n visit(declaration.initializer);\n return clean;\n }\n\n /** `this.m (…)` on a sync method of the calling file whose every `return` is a plain\n * literal, a plain local, or `this.extend|omit|keysort (plain, …unshared)`. */\n rustR12PlainBuilder(call: any, depth: number): boolean {\n const method: any = this.rustR12MethodImpl(call);\n if (method === undefined || method.getSourceFile() !== call.getSourceFile()\n || (method.modifiers ?? []).some((m: any) => m.kind === SyntaxKind.AsyncKeyword)) {\n return false;\n }\n // a builder whose proof reaches itself again (recursion through locals) proves nothing\n if (this.rustR12Visiting.has(method)) return false;\n this.rustR12Visiting.add(method);\n let plain = true;\n let returns = 0;\n try {\n this.rustWalkScope(method.body, (n) => {\n if (isArrowFunction(n) || n.kind === SyntaxKind.FunctionExpression) return RUST_WALK_SKIP;\n if (!isReturnStatement(n)) return;\n returns++;\n if (!this.rustR12PlainReturn(n.expression, depth)) { plain = false; return RUST_WALK_STOP; }\n });\n } finally {\n this.rustR12Visiting.delete(method);\n }\n return plain && returns > 0;\n }\n\n rustR12PlainReturn(expr: any, depth: number): boolean {\n const node: any = this.rustStripWrappers(expr);\n if (node === undefined) return false;\n const plainHead = (head: any): boolean => {\n const h: any = this.rustStripWrappers(head);\n return h !== undefined && (this.rustPlainDictLiteral(h)\n || (isIdentifier(h) && this.rustR01LocalStaysPlain(h, depth + 1)) || this.rustR12PlainSource(h, depth + 1));\n };\n if (plainHead(node)) return true;\n if (!isCallExpression(node) || !isPropertyAccessExpression(node.expression)\n || node.expression.expression.kind !== SyntaxKind.ThisKeyword || node.arguments.length === 0\n || !this.rustR01CalleeIsBase(node)) {\n return false;\n }\n const callee = String(node.expression.name.text);\n if (callee === 'omit' || callee === 'keysort') return plainHead(node.arguments[0]);\n return callee === 'extend' && plainHead(node.arguments[0])\n && node.arguments.slice(1).every((a) => plainHead(a) || (this.rustR12UnsharedDict(a) && this.r23TierSourceOk(a)));\n }\n\n /** The single bodied method declaration `this.m (…)` resolves to (implementation of an\n * overload set), in the calling file or the base tier. */\n rustR12MethodImpl(call: any): any {\n const checker: any = this.checkerOrUndefined();\n const callee: any = call?.expression;\n if (checker === undefined || !isPropertyAccessExpression(callee) || callee.expression.kind !== SyntaxKind.ThisKeyword) {\n return undefined;\n }\n let declarations: any[];\n try {\n declarations = symbolDeclarations(checker.getSymbolAtLocation(callee.name))\n .filter((d: any) => d.kind === SyntaxKind.MethodDeclaration && d.body !== undefined);\n } catch (e) {\n return undefined;\n }\n // a base-tier caller may dispatch to any venue override\n const callerFile = String(call.getSourceFile().fileName).replace(/\\\\/g, '/');\n if (declarations.length !== 1 || RustTranspiler.RUST_BASE_TIER_FILE.test(callerFile)) return undefined;\n const file = String(declarations[0].getSourceFile().fileName).replace(/\\\\/g, '/');\n return declarations[0].getSourceFile() === call.getSourceFile() || RustTranspiler.RUST_BASE_TIER_FILE.test(file)\n ? declarations[0] : undefined;\n }\n\n /** The expression's Rust value is always `Value::Bool(_)` or `Value::Null`. */\n rustR12BoolValue(expr: any, depth = 0): boolean {\n let node: any = this.rustStripWrappers(expr);\n while (node !== undefined && node.kind === SyntaxKind.AwaitExpression) node = this.rustStripWrappers(node.expression);\n if (node === undefined || depth > 5) return false;\n switch (node.kind) {\n case SyntaxKind.TrueKeyword:\n case SyntaxKind.FalseKeyword:\n case SyntaxKind.NullKeyword:\n return true;\n case SyntaxKind.Identifier:\n return node.text === 'undefined' || this.rustR12BoolLocal(node, depth + 1);\n case SyntaxKind.PrefixUnaryExpression:\n return node.operator === SyntaxKind.ExclamationToken;\n case SyntaxKind.BinaryExpression: {\n const op = node.operatorToken.kind;\n return RustTranspiler.COMPARISON_OPS.has(op) || this.isLogicalOp(op);\n }\n case SyntaxKind.ConditionalExpression:\n return this.rustR12BoolValue(node.whenTrue, depth + 1) && this.rustR12BoolValue(node.whenFalse, depth + 1);\n case SyntaxKind.CallExpression:\n return this.rustR12BoolCall(node, depth);\n }\n return false;\n }\n\n /** A base `safeBool*` with a bool default, `checkOptionBool`, or a method (calling file or\n * base tier) whose every `return` is such a value. */\n rustR12BoolCall(call: any, depth: number): boolean {\n if (!isPropertyAccessExpression(call.expression) || call.expression.expression.kind !== SyntaxKind.ThisKeyword) return false;\n const reader = RustTranspiler.RUST_R12_BOOL_READERS[String(call.expression.name.text)];\n if (reader !== undefined) {\n if (!this.rustR01CalleeIsBase(call)) return false;\n return reader < 0 || call.arguments.length <= reader\n || (call.arguments.length === reader + 1 && this.rustR12BoolValue(call.arguments[reader], depth + 1));\n }\n // at least one return must be a real bool: an all-`undefined` stub proves nothing\n let sawBool = false;\n return this.rustR12EveryReturn(call, depth, (e) => {\n const nullish = this.rustTypeIsUndefinedish(this.rustStripWrappers(e) ?? e);\n sawBool = sawBool || !nullish;\n return nullish || this.rustR12BoolValue(e, depth + 1);\n }) && sawBool;\n }\n\n rustR12EveryReturn(call: any, depth: number, ok: (e: any) => boolean): boolean {\n const method: any = this.rustR12MethodImpl(call);\n if (method === undefined || this.rustR12Visiting.has(method)) return false;\n this.rustR12Visiting.add(method);\n let proven = true;\n let returns = 0;\n try {\n this.rustWalkScope(method.body, (n) => {\n if (isArrowFunction(n) || n.kind === SyntaxKind.FunctionExpression) return RUST_WALK_SKIP;\n if (!isReturnStatement(n)) return;\n returns++;\n if (n.expression === undefined || !ok(n.expression)) { proven = false; return RUST_WALK_STOP; }\n });\n } finally {\n this.rustR12Visiting.delete(method);\n }\n return proven && returns > 0;\n }\n\n /** Element `index` of `this.m (…)`'s tuple is a bool value on every return path. */\n rustR12BoolTupleElement(expr: any, index: number, depth: number): boolean {\n let call: any = this.rustStripWrappers(expr);\n while (call !== undefined && call.kind === SyntaxKind.AwaitExpression) call = this.rustStripWrappers(call.expression);\n if (call === undefined || !isCallExpression(call) || depth > 5) return false;\n return this.rustR12EveryReturn(call, depth, (e) => {\n const tuple: any = this.rustStripWrappers(e);\n if (tuple?.kind === SyntaxKind.ArrayLiteralExpression) {\n const element = tuple.elements[index];\n return element !== undefined && element.kind !== SyntaxKind.SpreadElement && this.rustR12BoolValue(element, depth + 1);\n }\n return this.rustR12BoolTupleElement(tuple, index, depth + 1);\n });\n }\n\n /** A local whose declaration and every write store a bool value. Locals the printer or\n * ccxt's narrowBoolLocals may declare `bool` (bool-expression initializer) are left out. */\n rustR12BoolLocal(ident: any, depth: number): boolean {\n const checker: any = this.checkerOrUndefined();\n if (depth > 5) return false;\n const declarations: any[] = checker === undefined ? [] : symbolDeclarations(checker.getSymbolAtLocation(ident));\n const declaration: any = declarations.length === 1 ? declarations[0] : undefined;\n if (declaration === undefined) return false;\n let nameNode: any;\n let variable: any;\n if (declaration.kind === SyntaxKind.BindingElement) {\n const pattern: any = declaration.parent;\n variable = pattern?.parent;\n if (pattern?.kind !== SyntaxKind.ArrayBindingPattern || variable === undefined || !isVariableDeclaration(variable)\n || declaration.initializer !== undefined || declaration.dotDotDotToken !== undefined\n || declaration.name?.kind !== SyntaxKind.Identifier\n || !this.rustR12BoolTupleElement(variable.initializer, pattern.elements.indexOf(declaration), depth)) {\n return false;\n }\n nameNode = declaration.name;\n } else if (isVariableDeclaration(declaration) && declaration.name?.kind === SyntaxKind.Identifier) {\n const init: any = this.rustStripWrappers(declaration.initializer);\n if (init !== undefined && (this.rustNodeIsBoolExpression(init)\n || !(this.rustTypeIsUndefinedish(init) || (isIdentifier(init) && init.text === 'undefined') || this.rustR12BoolValue(init, depth)))) {\n return false;\n }\n variable = declaration;\n nameNode = declaration.name;\n } else {\n return false;\n }\n const scope = this.rustEnclosingFunction(variable);\n const symbol = this.rustSymbolOf(nameNode);\n const name = String(nameNode.text);\n if (scope === undefined || isSourceFile(scope) || symbol === undefined) return false;\n for (const node of this.rustScopeNameNodes(scope, name) as any[]) {\n if (node.kind !== SyntaxKind.Identifier || node === nameNode || this.rustSymbolOf(node) !== symbol) continue;\n if (this.rustEnclosingFunction(node) !== scope) return false;\n let target: any = node;\n while (target.parent !== undefined && (isParenthesizedExpression(target.parent) || isNonNullExpression(target.parent) || isAsExpression(target.parent))) target = target.parent;\n const parent: any = target.parent;\n if (isBinaryExpression(parent) && parent.left === target && rustIsAssignmentOperator(parent.operatorToken.kind)) {\n if (parent.operatorToken.kind !== SyntaxKind.EqualsToken || this.rustNodeIsBoolExpression(this.rustStripWrappers(parent.right))\n || !this.rustR12BoolValue(parent.right, depth)) return false;\n } else if (parent?.kind === SyntaxKind.ArrayLiteralExpression) {\n const assign: any = parent.parent;\n if (assign !== undefined && isBinaryExpression(assign) && assign.left === parent\n && !this.rustR12BoolTupleElement(assign.right, parent.elements.indexOf(target), depth)) return false;\n } else if ((parent?.kind === SyntaxKind.PrefixUnaryExpression && parent.operator !== SyntaxKind.ExclamationToken) || parent?.kind === SyntaxKind.PostfixUnaryExpression\n || parent?.kind === SyntaxKind.DeleteExpression\n || ((isForOfStatement(parent) || isForInStatement(parent)) && parent.initializer === target)) {\n return false;\n }\n }\n return true;\n }\n\n /** `if (x)` on a local or `this.m (…)` proven a bool value: `x.as_bool() == Some(true)`\n * is `is_true` on `Value::Bool`/`Value::Null`; bool slots only (leading-token boxing). */\n rustR12NativeTruthiness(node: any): string | undefined {\n const inner: any = this.unwrapParens(node);\n if (inner === undefined || (!isIdentifier(inner) && !isCallExpression(inner))\n || !this.printsValueExpression(inner) || !this.isBareBoolEmissionSafe(node)\n || (isCallExpression(inner) && this.rustCallPrintsBool(inner)) || !this.rustR12BoolValue(inner)) {\n return undefined;\n }\n // the text ccxt's is_true post-pass prints for the same proof; `!` needs the parens\n const text = `${this.printNode(inner, 0)}.as_bool() == Some(true)`;\n let current: any = node;\n while (current.parent !== undefined && isParenthesizedExpression(current.parent)) current = current.parent;\n const negated = current.parent?.kind === SyntaxKind.PrefixUnaryExpression && current.parent.operator === SyntaxKind.ExclamationToken;\n return negated ? `(${text})` : text;\n }\n\n /** `x === true|false` with `x` proven a bool value: `is_equal` against a `Value::Bool` is\n * the payload compare there (Null matches neither). */\n rustR12NativeBoolEquality(left: any, right: any, op: any): string | undefined {\n const leftLiteral = left.kind === SyntaxKind.TrueKeyword || left.kind === SyntaxKind.FalseKeyword;\n const rightLiteral = right.kind === SyntaxKind.TrueKeyword || right.kind === SyntaxKind.FalseKeyword;\n if (leftLiteral === rightLiteral) return undefined;\n const [ literal, other ] = leftLiteral ? [ left, right ] : [ right, left ];\n const inner: any = this.unwrapParens(other);\n if (inner === undefined || (!isIdentifier(inner) && !isCallExpression(inner)) || !this.printsValueExpression(inner)\n || (isCallExpression(inner) && this.rustCallPrintsBool(inner)) || !this.rustR12BoolValue(inner)) {\n return undefined;\n }\n const operator = (op === SyntaxKind.EqualsEqualsToken || op === SyntaxKind.EqualsEqualsEqualsToken) ? '==' : '!=';\n return `${this.printNode(inner, 0)}.as_bool() ${operator} Some(${literal.kind === SyntaxKind.TrueKeyword ? 'true' : 'false'})`;\n }\n\n // hx4 R13 — proven-`Str` operands: a `this.safeString*` call (no default or a string-literal\n // default) or a native-`Str` callee re-boxed into `Value`, or a `const`/never-reassigned local\n // initialized from one, can only hold `Value::Str` / `Value::Null`, whatever its TS type says.\n rustR13ProvenStrSource(node): boolean {\n const inner: any = this.unwrapParensNode(node);\n if (inner === undefined || !isCallExpression(inner)) return false;\n if (this.rustNativeStrCalleeKind(inner) === 'str') return true;\n const callee: any = inner.expression;\n if (!isPropertyAccessExpression(callee) || callee.expression.kind !== SyntaxKind.ThisKeyword) return false;\n const name = callee.name.text;\n if (!RustTranspiler.RUST_STRING_LOCAL_HELPERS.has(name)) return false;\n const arity = /N$/.test(name) || !/2$/.test(name) ? 2 : 3;\n const args = inner.arguments ?? [];\n if (args.length === arity) return true;\n return args.length === arity + 1 && (isStringLiteral(args[arity]) || isNoSubstitutionTemplateLiteral(args[arity]));\n }\n\n rustR13ProvenStrIdentifier(node): boolean {\n if (node === undefined || !isIdentifier(node) || this.rustStringLocalIdentifierIsTyped(node)) return false;\n const checker: any = this.checkerOrUndefined();\n const declarations: any[] = checker === undefined ? [] : symbolDeclarations(checker.getSymbolAtLocation(node));\n if (declarations.length !== 1 || !isVariableDeclaration(declarations[0])) return false;\n const declaration: any = declarations[0];\n if (declaration.name?.kind !== SyntaxKind.Identifier || !this.rustR13ProvenStrSource(declaration.initializer)) return false;\n // every later write keeps the proof (D2): only `x = `\n return this.rustLocalUsesAll(declaration, declaration.name.text, true, (n) => {\n if (this.rustR13WriteTarget(n)) return false;\n const parent: any = n.parent;\n if (parent?.kind !== SyntaxKind.BinaryExpression || parent.left !== n) return !(parent?.kind === SyntaxKind.PrefixUnaryExpression || parent?.kind === SyntaxKind.PostfixUnaryExpression) || parent.operator === SyntaxKind.ExclamationToken;\n const op = parent.operatorToken.kind;\n if (op < SyntaxKind.FirstAssignment || op > SyntaxKind.LastAssignment) return true;\n return op === SyntaxKind.EqualsToken && this.rustR13ProvenStrSource(parent.right);\n });\n }\n\n /** A destructuring / for-in-of target: a write the direct-assignment check cannot see. */\n rustR13WriteTarget(node): boolean {\n let current: any = node;\n let parent: any = node.parent;\n while (parent !== undefined && (isArrayLiteralExpression(parent) || isObjectLiteralExpression(parent) || isParenthesizedExpression(parent)\n || parent.kind === SyntaxKind.PropertyAssignment || parent.kind === SyntaxKind.ShorthandPropertyAssignment || parent.kind === SyntaxKind.SpreadElement)) {\n current = parent;\n parent = parent.parent;\n }\n if ((isForOfStatement(parent) || isForInStatement(parent)) && parent.initializer === current) return true;\n return current !== node && isBinaryExpression(parent) && parent.left === current && parent.operatorToken.kind === SyntaxKind.EqualsToken;\n }\n\n /** `x` / `(x as string)` → the identifier under parens / `as`. */\n rustR13PeelCast(node): any {\n let current: any = node;\n while (current !== undefined && (isParenthesizedExpression(current) || isAsExpression(current))) current = current.expression;\n return current;\n }\n\n /** Printed text of an operand that is always `Value::Str` / `Value::Null`, else undefined:\n * a proven-`Str` local, a checker-`string` declared local/param (the R06 needle rule), or\n * `\"lit\" + e` / `e + \"lit\"` (the `add` helper's string branch always yields `Value::Str`). */\n rustR13StrOperand(node, allowChecker: boolean): string | undefined {\n const inner = this.rustR13PeelCast(node);\n if (inner === undefined) return undefined;\n if (isIdentifier(inner)) {\n if (this.rustStringLocalIdentifierIsTyped(inner)) return undefined;\n const proven = this.rustR13ProvenStrIdentifier(inner);\n const checked = allowChecker && this.isDeclaredValueIdentifier(inner)\n && this.primitiveKindOfType(this.typeOfNodeIfAny(inner)) === 'string';\n if (!proven && !checked) return undefined;\n const text = this.printNode(inner, 0).trim();\n return /^[A-Za-z_][A-Za-z0-9_]*$/.test(text) ? text : undefined;\n }\n if (allowChecker && isBinaryExpression(inner) && inner.operatorToken.kind === SyntaxKind.PlusToken\n && (isStringLiteral(inner.left) || isStringLiteral(inner.right))) {\n const text = this.printNode(inner, 0).trim();\n return text.includes('\\n') ? undefined : `(${text})`;\n }\n return undefined;\n }\n\n // `a === b` with both sides proven `Str`/`Null`: `is_equal` is exactly the derived `PartialEq`\n // there (Null==Null, Str by content, Str vs Null false — its f64 fallback needs a number).\n printRustR13ProvenStrEquality(left, right, op): string | undefined {\n if (!this.rustR13ProvenStrIdentifier(this.unwrapParensNode(left)) || !this.rustR13ProvenStrIdentifier(this.unwrapParensNode(right))) return undefined;\n const operator = (op === SyntaxKind.EqualsEqualsToken || op === SyntaxKind.EqualsEqualsEqualsToken) ? '==' : '!=';\n return `${this.printNode(left, 0)} ${operator} ${this.printNode(right, 0)}`;\n }\n\n /** Receiver text when the call's receiver is a proven-`Str` local (R06 covers checker strings). */\n rustR13Receiver(node, receiverText: string): string | undefined {\n if (node === undefined || !isCallExpression(node) || !isPropertyAccessExpression(node.expression)) return undefined;\n const receiver = this.rustR13PeelCast(node.expression.expression);\n if (!this.rustR13ProvenStrIdentifier(receiver)) return undefined;\n const text = (receiverText ?? '').trim();\n return /^[A-Za-z_][A-Za-z0-9_]*$/.test(text) ? text : undefined;\n }\n\n /** R06's checker-string receiver, when it prints as a bare name (it is read twice). */\n rustR13PlainReceiver(node, receiverText: string): string | undefined {\n const receiver = this.rustNativeStringReceiver(node, receiverText);\n return receiver !== undefined && /^[A-Za-z_][A-Za-z0-9_]*$/.test(receiver) ? receiver : undefined;\n }\n\n // `s.replace(p, \"lit\")`: the helper replaces every occurrence when all three are `Str`, else\n // returns the receiver; `p` is a proven/checker string operand.\n printRustR13Replace(node, receiverText: string): string | undefined {\n if (node?.arguments?.length !== 2) return undefined;\n const receiver = this.rustR13Receiver(node, receiverText) ?? this.rustR13PlainReceiver(node, receiverText);\n const to = this.rustNativeStringLiteralArg(node.arguments[1]);\n if (receiver === undefined || to === undefined || this.rustNativeStringLiteralArg(node.arguments[0]) !== undefined) return undefined;\n const from = this.rustR13StrOperand(node.arguments[0], true);\n if (from === undefined) return undefined;\n return `${receiver}.as_str().zip(${from}.as_str()).map(|(__s, __p)| Value::Str(__s.replace(__p, \"${to}\").into())).unwrap_or_else(|| ${receiver}.clone())`;\n }\n\n // `s.split(d)` with a proven/checker string delimiter: the parts, `[]` unless both are `Str`.\n printRustR13Split(node, receiverText: string): string | undefined {\n if (node?.arguments?.length !== 1 || this.rustNativeStringLiteralArg(node.arguments[0]) !== undefined) return undefined;\n const receiver = this.rustR13Receiver(node, receiverText) ?? this.rustR13PlainReceiver(node, receiverText);\n const delim = receiver === undefined ? undefined : this.rustR13StrOperand(node.arguments[0], true);\n if (delim === undefined) return undefined;\n return `Value::Array(${receiver}.as_str().zip(${delim}.as_str()).map(|(__s, __d)| __s.split(__d).map(|__p| Value::Str(__p.to_string().into())).collect()).unwrap_or_default())`;\n }\n\n // `x.toString()` on a proven-`Str` local: `stringify_simple` of `Str`/`Null` is `Display`.\n printRustR13ToString(node, receiverText: string): string | undefined {\n const receiver = this.rustR13Receiver(node, receiverText);\n return receiver === undefined || (node.arguments?.length ?? 0) !== 0 ? undefined : `Value::Str(format!(\"{}\", ${receiver}).into())`;\n }\n\n // `x.toUpperCase()` / `x.toLowerCase()` on a proven-`Str` local (any TS type).\n printRustR13Case(node, receiverText: string, method: string): string | undefined {\n const receiver = this.rustR13Receiver(node, receiverText);\n return receiver === undefined || (node.arguments?.length ?? 0) !== 0 ? undefined : `${receiver}.as_str().map(|__s| Value::Str(__s.${method}().into())).unwrap_or(Value::Null)`;\n }\n\n // hx4 R14 — the R12 plain-dict proof reaches overloaded base readers (`safeDict` declares\n // bodiless overload signatures; the implementation in the same class is what runs).\n\n /** A bodiless overload signature whose class also holds the bodied implementation. */\n r14BaseOverload(declaration: any): boolean {\n if (declaration?.kind !== SyntaxKind.MethodDeclaration || declaration.body !== undefined || !isIdentifier(declaration.name)) return false;\n const name = String(declaration.name.text);\n return (declaration.parent?.members ?? []).some((m: any) => m.kind === SyntaxKind.MethodDeclaration\n && m.body !== undefined && isIdentifier(m.name) && String(m.name.text) === name);\n }\n\n /** `x[a ± b]` on a checker-proven list, each operand a numeric literal, a `Value` loop\n * counter or a `const n = y.length` local: the key prints as a `Value` number, so the\n * list arm of `get_value` (Int index, else miss) is spelled natively. */\n r14ListArithIndex(receiverText: string, receiverNode: Node, keyNode: Node): string | undefined {\n const key: any = this.rustSkipWrappers(keyNode);\n if (!this.isProvenListExpression(receiverNode) || key === undefined || !isBinaryExpression(key)\n || (key.operatorToken.kind !== SyntaxKind.MinusToken && key.operatorToken.kind !== SyntaxKind.PlusToken)\n || !this.r14ValueNumberOperand(key.left) || !this.r14ValueNumberOperand(key.right)) return undefined;\n if (this.isWriteBackBindRead(keyNode.parent)) return undefined;\n const keyText = this.printNode(keyNode, 0).trim();\n if (!keyText || keyText.startsWith('&')) return undefined;\n return `${receiverText}.as_array().and_then(|__arr| match &(${keyText}) { Value::Int(__n) if *__n >= 0 => __arr.get(*__n as usize), _ => None }).cloned().unwrap_or(Value::Null)`;\n }\n\n r14ValueNumberOperand(node: any): boolean {\n const operand: any = this.rustSkipWrappers(node);\n if (operand === undefined) return false;\n if (isNumericLiteral(operand)) return Number.isInteger(Number(operand.text));\n if (!isIdentifier(operand)) return false;\n if (this.isRustValueIndexKey(operand)) return true;\n if (this.rustParamShadowOf(operand) !== undefined || this.rustStringLocalIdentifierIsTyped(operand)) return false;\n const declaration: any = this.rustDeclarationOfIdentifier(operand);\n if (declaration === undefined || !isVariableDeclaration(declaration) || (declaration.parent?.flags & NodeFlags.Const) === 0) return false;\n const init: any = this.rustSkipWrappers(declaration.initializer);\n return init !== undefined && isPropertyAccessExpression(init) && String(init.name.text) === 'length';\n }\n\n // hx4 R15 — `Vec` locals also admit `x.join(\"lit\")` on a `string[]` (native join of the\n // elements' Display text, as the helper's `stringify_simple` prints `Str`/`Null`) and an\n // object-literal property value no push follows (boxed `Value::from(x.clone())`).\n r15VecJoinUse(access): boolean {\n const call: any = access.parent;\n if (!isCallExpression(call) || call.expression !== access || String(access.name.text) !== 'join' || call.arguments.length !== 1) return false;\n if (this.rustNativeStringLiteralArg(call.arguments[0]) === undefined) return false;\n const checker: any = this.checkerOrUndefined();\n const type: any = checker?.getTypeAtLocation(access.expression);\n if (type === undefined || !checker.isArrayType(type)) return false;\n return this.primitiveKindOfType(checker.getTypeArguments?.(type)?.[0]) === 'string';\n }\n\n r15PrintVecJoin(node): string | undefined {\n const access: any = node?.expression;\n if (!isPropertyAccessExpression(access) || !isIdentifier(access.expression)\n || this.rustVecLocalDeclarationOf(access.expression) === undefined || !this.r15VecJoinUse(access)) return undefined;\n const literal = this.rustNativeStringLiteralArg(node.arguments[0]);\n const name = this.printNode(access.expression, 0).trim();\n return `Value::Str(${name}.iter().map(|__v| __v.to_string()).collect::>().join(\"${literal}\").into())`;\n }\n\n // `{ 'k': x }` with `x` named once in the statement, outside any loop the declaration is not in,\n // and no `x.push` after it: the clone is the array's final contents, as the aliased box was.\n r15VecPropertyUse(n): boolean {\n const parent: any = n.parent;\n if (parent?.kind !== SyntaxKind.PropertyAssignment || parent.initializer !== n || this.r11LoopBetween(n)) return false;\n const name = String(n.text);\n let statement: any = parent;\n while (statement !== undefined && !isStatement(statement)) statement = statement.parent;\n if (statement === undefined) return false;\n let count = 0;\n const visit = (m) => { if (m.kind === SyntaxKind.Identifier && m.text === name) count++; m.forEachChild?.(visit); };\n visit(statement);\n if (count !== 1) return false;\n const fn = this.rustEnclosingFunction(n);\n const end = n.getEnd?.() ?? n.end;\n return !(this.rustScopeNameNodes(fn, name) as any[]).some((m) => m.kind === SyntaxKind.Identifier && m !== n\n && (m.getStart?.() ?? m.pos) >= end && isPropertyAccessExpression(m.parent) && m.parent.expression === m\n && String(m.parent.name.text) === 'push');\n }\n // hx4 R16 — numeric operand kinds beyond the checker: 'definite' = always Int/Float (never Null),\n // 'number' = Int/Float/Null. Covers `this.sum` of numbers, numeric same-file method returns,\n // locals whose every write is numeric, and flow-narrowed (guarded non-undefined) number identifiers.\n private rustR16InProgress = new Set();\n private rustR16Assumed = new Set();\n\n rustR16NumericKind(node, depth = 0): string | undefined {\n const inner: any = this.rustStripWrappers(node);\n if (inner === undefined || depth > 8) return undefined;\n if (this.rustR16InProgress.has(inner)) return this.r22AssumedNumericSelf(inner);\n this.rustR16InProgress.add(inner);\n try {\n const structural = this.rustR16StructuralKind(inner, depth);\n if (structural === 'definite') return 'definite';\n if (structural === 'number') return 'number';\n return this.rustOperandKind(inner) === 'number' ? 'number' : undefined;\n } catch (e) {\n return undefined;\n } finally {\n this.rustR16InProgress.delete(inner);\n }\n }\n\n rustR16Combine(kinds: (string | undefined)[]): string | undefined {\n if (kinds.length === 0 || kinds.some((k) => k === undefined)) return undefined;\n return kinds.every((k) => k === 'definite') ? 'definite' : 'number';\n }\n\n rustR16StructuralKind(inner: any, depth: number): string | undefined {\n if (inner.kind === SyntaxKind.NumericLiteral) return 'definite';\n if (isPrefixUnaryExpression(inner) && inner.operator === SyntaxKind.MinusToken && inner.operand.kind === SyntaxKind.NumericLiteral) return 'definite';\n if (this.rustR09IsDefiniteInt(inner)) return 'definite';\n if (isCallExpression(inner) && this.callExpressionName(inner) === 'indexOf') return 'definite';\n if (isBinaryExpression(inner)) {\n const op = inner.operatorToken.kind;\n if (op !== SyntaxKind.PlusToken && op !== SyntaxKind.MinusToken && op !== SyntaxKind.AsteriskToken\n && op !== SyntaxKind.SlashToken && op !== SyntaxKind.PercentToken) return undefined;\n const both = this.rustR16Combine([ this.rustR16NumericKind(inner.left, depth + 1), this.rustR16NumericKind(inner.right, depth + 1) ]);\n // `/` and `%` answer Null for a zero divisor\n return (both === 'definite' && (op === SyntaxKind.SlashToken || op === SyntaxKind.PercentToken)) ? 'number' : both;\n }\n if (isCallExpression(inner)) return this.rustR16CallKind(inner, depth);\n if (isIdentifier(inner)) return this.rustR16IdentifierKind(inner, depth);\n return undefined;\n }\n\n rustR16CallKind(call: any, depth: number): string | undefined {\n const callee = call.expression;\n if (!isPropertyAccessExpression(callee) || callee.expression.kind !== SyntaxKind.ThisKeyword) return undefined;\n if (String(callee.name.text) === 'sum') {\n return this.rustR16Combine(call.arguments.map((a) => this.rustR16NumericKind(a, depth + 1)));\n }\n let declaration: any;\n try {\n declaration = signatureDeclaration((this.getChecker() as any).getResolvedSignature(call));\n } catch (e) {\n return undefined;\n }\n if (declaration?.kind !== SyntaxKind.MethodDeclaration || declaration.body === undefined\n || declaration.getSourceFile() !== call.getSourceFile()) return undefined;\n const kinds: (string | undefined)[] = [];\n const visit = (n: any) => {\n if (n !== declaration && isFunctionLike(n)) return;\n if (isReturnStatement(n)) kinds.push(n.expression === undefined ? undefined : this.rustR16NumericKind(n.expression, depth + 1));\n n.forEachChild?.(visit);\n };\n declaration.body.forEachChild(visit);\n return this.rustR16Combine(kinds) === undefined ? undefined : 'number';\n }\n\n rustR16IdentifierKind(ident: any, depth: number): string | undefined {\n if (this.rustParamShadowOf(ident) !== undefined || !this.printsValueExpression(ident)) return undefined;\n const declaration: any = this.rustSingleLocalDeclaration(ident);\n if (declaration === undefined || declaration.name?.kind !== SyntaxKind.Identifier) return undefined;\n // a guard removed `undefined` from a nullable declaration: the box is Int/Float here\n const here: any = this.typeOfNodeIfAny(ident);\n const declared: any = this.typeOfNodeIfAny(declaration.name);\n if (here !== undefined && declared !== undefined && (here.flags === TypeFlags.Number || here.flags === TypeFlags.NumberLiteral)\n && (declared.flags & TypeFlags.Union) && (typeParts(declared) ?? []).some((t: any) => t.flags & (TypeFlags.Undefined | TypeFlags.Null))\n && !this.rustR16HasWrites(declaration)) {\n return 'definite';\n }\n // an explicit annotation (`let a: any = 1`) declares a polymorphic box: keep the helper\n if (!isVariableDeclaration(declaration) || declaration.initializer === undefined || declaration.type !== undefined) return undefined;\n // inductive: a write reading the local itself (`r = this.sum (r, n)`) assumes it numeric\n if (this.rustR16Assumed.has(declaration)) return 'number';\n this.rustR16Assumed.add(declaration);\n try {\n return this.rustR16WrittenKind(declaration, depth);\n } finally {\n this.rustR16Assumed.delete(declaration);\n }\n }\n\n rustR16WrittenKind(declaration: any, depth: number): string | undefined {\n const kinds: (string | undefined)[] = [ this.rustR16NumericKind(declaration.initializer, depth + 1) ];\n const fn = this.rustEnclosingFunction(declaration);\n if (fn === undefined) return undefined;\n const name = String(declaration.name.text);\n for (const m of this.rustScopeNameNodes(fn, name) as any[]) {\n if (m.kind !== SyntaxKind.Identifier || m === declaration.name) continue;\n const parent: any = m.parent;\n if (isBinaryExpression(parent) && parent.left === m && rustIsAssignmentOperator(parent.operatorToken.kind)) {\n const op = parent.operatorToken.kind;\n const right = this.rustR16NumericKind(parent.right, depth + 1);\n if (op === SyntaxKind.EqualsToken || op === SyntaxKind.PlusEqualsToken || op === SyntaxKind.MinusEqualsToken || op === SyntaxKind.AsteriskEqualsToken) kinds.push(right);\n else if (op === SyntaxKind.SlashEqualsToken || op === SyntaxKind.PercentEqualsToken) kinds.push(right === undefined ? undefined : 'number');\n else kinds.push(undefined);\n } else if ((parent?.kind === SyntaxKind.PrefixUnaryExpression || parent?.kind === SyntaxKind.PostfixUnaryExpression)\n && (parent.operator === SyntaxKind.PlusPlusToken || parent.operator === SyntaxKind.MinusMinusToken)) {\n continue;\n } else if (parent !== undefined && ((isArrayLiteralExpression(parent) && isBinaryExpression(parent.parent) && parent.parent.left === parent)\n || ((isForOfStatement(parent) || isForInStatement(parent)) && parent.initializer === m))) {\n kinds.push(undefined);\n }\n }\n return this.rustR16Combine(kinds);\n }\n\n // No assignment / `++` / `--` names the binding: only control-flow guards narrow it.\n rustR16HasWrites(declaration: any): boolean {\n const fn = isParameterDeclaration(declaration) ? declaration.parent : this.rustEnclosingFunction(declaration);\n if (fn === undefined) return true;\n return (this.rustScopeNameNodes(fn, String(declaration.name.text)) as any[]).some((m) => {\n const parent: any = m.parent;\n if (m.kind !== SyntaxKind.Identifier || m === declaration.name) return false;\n return (isBinaryExpression(parent) && parent.left === m && rustIsAssignmentOperator(parent.operatorToken.kind))\n || parent?.kind === SyntaxKind.PrefixUnaryExpression && (parent.operator === SyntaxKind.PlusPlusToken || parent.operator === SyntaxKind.MinusMinusToken)\n || parent?.kind === SyntaxKind.PostfixUnaryExpression;\n });\n }\n\n // Both sides Int/Float/Null: `<`/`>` are f64 compares with Null false; `<=`/`>=` also OR in\n // `is_equal` (Null == Null), so they need one never-null side.\n rustR16OrderedProven(op, left, right): boolean {\n const l = this.rustR16NumericKind(left);\n const r = this.rustR16NumericKind(right);\n if (l === undefined || r === undefined) return false;\n return op === SyntaxKind.LessThanToken || op === SyntaxKind.GreaterThanToken || l === 'definite' || r === 'definite';\n }\n\n // `a - b` / `a * b` / `a / b` / `a % b` on operands proven Int/Float/Null: the helper's dispatch.\n rustR16NativeArithmetic(op, left, right, leftText: string, rightText: string): string | undefined {\n if (op !== SyntaxKind.MinusToken && op !== SyntaxKind.AsteriskToken && op !== SyntaxKind.SlashToken && op !== SyntaxKind.PercentToken) return undefined;\n if (!this.printsValueExpression(this.rustStripWrappers(left)) || !this.printsValueExpression(this.rustStripWrappers(right))) return undefined;\n if (this.rustR16NumericKind(left) === undefined || this.rustR16NumericKind(right) === undefined) return undefined;\n if (op !== SyntaxKind.PercentToken) return this.printNativeNumeric(op, leftText, rightText);\n return `(match (&(${leftText}), &(${rightText})) {` +\n ' (Value::Int(x), Value::Int(y)) if *y != 0 => Value::Int(x % y),' +\n ' (Value::Int(x), Value::Float(y)) if *y != 0.0 => Value::Float(*x as f64 % *y),' +\n ' (Value::Float(x), Value::Int(y)) if *y != 0 => Value::Float(*x % *y as f64),' +\n ' (Value::Float(x), Value::Float(y)) if *y != 0.0 => Value::Float(x % y),' +\n ' _ => Value::Null })';\n }\n\n // hx4 R17 — string helpers on proven-`Str` operands. `add(a, b)` with one side always a\n // `Value::Str` takes the helper's `string_concat` arm, which is `Display` for every box but a\n // Precise dict (only `new Precise` locals, typed `Precise`), so the other side may be any non-Precise box.\n r17AlwaysStr(node): boolean {\n const inner: any = this.unwrapParensNode(node);\n if (inner === undefined) return false;\n if (isStringLiteral(inner) || isNoSubstitutionTemplateLiteral(inner)) return true;\n if (isBinaryExpression(inner) && inner.operatorToken.kind === SyntaxKind.PlusToken) return this.r17AlwaysStr(inner.left) || this.r17AlwaysStr(inner.right);\n return isCallExpression(inner) && isPropertyAccessExpression(inner.expression) && inner.expression.name.text === 'toString'\n && (inner.arguments?.length ?? 0) === 0 && this.printsValueExpression(inner.expression.expression);\n }\n\n r17ConcatOperandSafe(node, type): boolean {\n if (this.r17AlwaysStr(node)) return true;\n const inner: any = this.unwrapParensNode(node);\n if (!this.printsValueExpression(inner) || this.rustNativeStrCalleeKind(inner) === 'str') return false;\n // typed `String`/`Vec` locals print without a `Value` box\n if (isIdentifier(inner) && (this.rustStringLocalIdentifierIsTyped(inner) || this.rustVecLocalDeclarationOf(inner) !== undefined)) return false;\n const parts: any[] = type === undefined ? [] : ((type.flags & TypeFlags.Union) ? (typeParts(type) ?? []) : [type]);\n return parts.length > 0 && parts.every((t) => String(t?.symbol?.escapedName ?? t?.symbol?.name ?? '') !== 'Precise');\n }\n\n r17ConcatIsAnchored(left, right, leftType, rightType): boolean {\n return (this.r17AlwaysStr(left) && this.r17ConcatOperandSafe(right, rightType))\n || (this.r17AlwaysStr(right) && this.r17ConcatOperandSafe(left, leftType));\n }\n\n /** R06 checker-string or R13 proven-`Str` receiver printed as a plain name / parenthesised. */\n r17Receiver(node, receiverText: string): string | undefined {\n return this.rustNativeStringReceiver(node, receiverText) ?? this.rustR13Receiver(node, receiverText);\n }\n\n // `x.trim()`: the helper's `Str` arm is `str::trim`, Null otherwise.\n r17PrintTrim(node, receiverText: string): string | undefined {\n const receiver = this.r17Receiver(node, receiverText);\n if (receiver === undefined || (node.arguments?.length ?? 0) !== 0) return undefined;\n return `${receiver}.as_str().map(|__s| Value::Str(__s.trim().to_string().into())).unwrap_or(Value::Null)`;\n }\n\n // `x.startsWith(p)` / `x.endsWith(p)` with a proven/checker string operand: false unless both are `Str`.\n r17PrintAffixTest(node, receiverText: string, method: string): string | undefined {\n if (node?.arguments?.length !== 1) return undefined;\n const receiver = this.r17Receiver(node, receiverText);\n const arg = receiver === undefined ? undefined : this.rustR13StrOperand(node.arguments[0], true);\n if (arg === undefined) return undefined;\n return `${receiver}.as_str().zip(${arg}.as_str()).is_some_and(|(__s, __p)| __s.${method}(__p))`;\n }\n\n // `x.replace(p, r)` / `x.replaceAll(p, r)`: both helpers replace every occurrence when all three\n // are `Str`, else return the receiver; `p`/`r` are literals or proven/checker string operands.\n r17PrintReplace(node, receiverText: string): string | undefined {\n if (node?.arguments?.length !== 2) return undefined;\n const receiver = this.r17Receiver(node, receiverText);\n if (receiver === undefined || !/^[A-Za-z_][A-Za-z0-9_.]*$/.test(receiver)) return undefined;\n const operand = (arg) => {\n const literal = this.rustNativeStringLiteralArg(arg);\n return literal !== undefined ? `Value::Str(\"${literal}\".into())` : this.rustR13StrOperand(arg, true);\n };\n const from = operand(node.arguments[0]);\n const to = operand(node.arguments[1]);\n if (from === undefined || to === undefined) return undefined;\n return `match (${receiver}.as_str(), ${from}.as_str(), ${to}.as_str()) { (Some(__s), Some(__p), Some(__r)) => Value::Str(__s.replace(__p, __r).into()), _ => ${receiver}.clone() }`;\n }\n\n // hx4 R18 — collection helpers on locals whose runtime shape is proven: `\"k\" in x` on an R10\n // plain-dict receiver, `Object.keys/values` on one in prediction sources, and `.length` /\n // `.push` on a `Value::Arr`-only local (never a book/cache marker the helpers route).\n\n /** `\"lit\" in x` where x is an R10-proven plain local / plain-kept Dict parameter. */\n r18LiteralInOp(key, obj): string | undefined {\n if (!isStringLiteral(key) || this.r05IsTest(key)) return undefined;\n const recv: any = this.rustStripWrappers(obj);\n if (recv === undefined || !isIdentifier(recv) || this.rustR10PlainReceiver(recv) === undefined) return undefined;\n const keyLiteral = this.rustStringLiteralOf(this.printStringLiteral(key));\n if (keyLiteral === undefined) return undefined;\n return `Value::Bool(matches!(&${this.printNode(recv, 0).trim()}, Value::Dict(__d) if __d.contains_key(${keyLiteral})))`;\n }\n\n /** `Object.keys/values(x)` in `ts/src/prediction/.ts` on an R10-proven plain local. */\n r18PredictionEnum(node, parsedArg: string | undefined, kind: 'keys' | 'values'): string | undefined {\n const arg: any = this.rustStripWrappers(node?.arguments?.[0]);\n if (arg === undefined || parsedArg === undefined || !isIdentifier(arg)\n || !/\\/ts\\/src\\/prediction\\/[^/]+\\.ts$/.test(this.r05Path(node))\n || this.rustR10PlainReceiver(arg) !== 'local') return undefined;\n const body = kind === 'keys' ? '__m.keys().map(|__k| Value::Str(__k.clone().into())).collect()' : '__m.values().cloned().collect()';\n return `Value::Array(${parsedArg.trim()}.as_map().map(|__m| ${body}).unwrap_or_default())`;\n }\n\n /** Base-tier array readers whose result is the stored `Value::Arr` or the default argument. */\n private static readonly RUST_R18_LIST_READERS: { [name: string]: number } = { safeList: 2, safeList2: 3, safeListN: 2 };\n\n /** A source that is a `Value::Arr` or `Value::Null` (both helpers agree with `len()` / a no-op\n * push there): `[...]`, nullish, a runtime `split`, base `toArray`, or a base `safeList*`\n * read whose default is absent, nullish or `[...]`. */\n r18ArrSource(node: any, allowNull: boolean): boolean {\n const n: any = this.rustStripWrappers(node);\n if (n === undefined) return false;\n if (this.r21ArrSource(n)) return true;\n if (isArrayLiteralExpression(n)) return !n.elements.some((e: any) => e.kind === SyntaxKind.SpreadElement);\n if (n.kind === SyntaxKind.NullKeyword || (isIdentifier(n) && String(n.text) === 'undefined')) return allowNull;\n if (this.rustCallPrintsRuntimeSplit(n)) return true;\n if (!isCallExpression(n) || !isPropertyAccessExpression(n.expression) || n.expression.expression.kind !== SyntaxKind.ThisKeyword) return false;\n const callee = String(n.expression.name.text);\n if (callee === 'toArray') return n.arguments.length === 1 && this.rustR01CalleeIsBase(n);\n const index = RustTranspiler.RUST_R18_LIST_READERS[callee];\n if (index === undefined || n.arguments.length > index + 1) return false;\n const fallback: any = this.rustStripWrappers(n.arguments[index]);\n const arrDefault = fallback !== undefined && isArrayLiteralExpression(fallback);\n return (arrDefault || (allowNull && (fallback === undefined || fallback.kind === SyntaxKind.NullKeyword\n || (isIdentifier(fallback) && String(fallback.text) === 'undefined')))) && this.rustR01CalleeIsBase(n);\n }\n\n /** A local whose every write (declaration included) is an `r18ArrSource`, never captured by\n * a closure: its `Value` is a plain `Value::Arr` (the runtime never tags an array). */\n r18ArrLocal(ident: any, allowNull: boolean): boolean {\n if (ident === undefined || !isIdentifier(ident) || this.rustParamShadowOf(ident) !== undefined || this.r05IsTest(ident)) return false;\n const declaration: any = this.rustSingleLocalDeclaration(ident);\n if (declaration === undefined || !isVariableDeclaration(declaration) || !isIdentifier(declaration.name)\n || !this.r18ArrSource(declaration.initializer, allowNull)) return false;\n const scope = this.rustEnclosingFunction(declaration);\n if (scope === undefined || isSourceFile(scope) || this.rustEnclosingFunction(ident) !== scope) return false;\n const name = String(declaration.name.text);\n const symbol = this.rustSymbolOf(declaration.name);\n if (symbol === undefined) return false;\n for (const n of this.rustScopeNameNodes(scope, name) as any[]) {\n if (n.kind !== SyntaxKind.Identifier || n === declaration.name || this.rustSymbolOf(n) !== symbol) continue;\n if (this.rustEnclosingFunction(n) !== scope) return false;\n let target: any = n;\n while (target.parent !== undefined && (isParenthesizedExpression(target.parent) || isNonNullExpression(target.parent) || isAsExpression(target.parent))) target = target.parent;\n const parent: any = target.parent;\n if (parent === undefined) continue;\n // a dict-literal field aliasing the local feeds ccxt's writeBackAliasedArrayMutations (keys on the helper)\n if (parent.kind === SyntaxKind.ShorthandPropertyAssignment || (parent.kind === SyntaxKind.PropertyAssignment && parent.initializer === target)) return false;\n if (isBinaryExpression(parent) && parent.left === target && rustIsAssignmentOperator(parent.operatorToken.kind)) {\n if (parent.operatorToken.kind !== SyntaxKind.EqualsToken || !this.r18ArrSource(parent.right, allowNull)) return false;\n continue;\n }\n if (parent.kind === SyntaxKind.ArrayLiteralExpression && isBinaryExpression(parent.parent) && parent.parent.left === parent) return false;\n if ((parent.kind === SyntaxKind.PrefixUnaryExpression || parent.kind === SyntaxKind.PostfixUnaryExpression)\n && (parent.operator === SyntaxKind.PlusPlusToken || parent.operator === SyntaxKind.MinusMinusToken)) return false;\n }\n return true;\n }\n\n /** `x.length` on an Arr-only local: `get_array_length`'s marker arms need a Dict. */\n r18ArrLength(node, receiver: string): string | undefined {\n const recv: any = this.rustStripWrappers(node?.expression);\n if (!this.r18ArrLocal(recv, true)) return undefined;\n return `Value::Int(${receiver}.len() as i64)`;\n }\n\n /** `x.push(v)` statement on an Arr-only local: `append_to_array`'s cache-push arm needs a Dict. */\n r18ArrPush(node, name: string | undefined, parsedArg: string | undefined): string | undefined {\n const recv: any = node?.expression?.expression;\n if (name === undefined || parsedArg === undefined || node?.arguments?.length !== 1\n || node.arguments[0].kind === SyntaxKind.SpreadElement || node.parent?.kind !== SyntaxKind.ExpressionStatement\n || !this.r18ArrLocal(recv, false) || name.trim() !== this.printNode(recv, 0).trim()) return undefined;\n // the argument is evaluated while `name` is mutably borrowed: it must not read it\n if (!this.rustVecPushShape(node, String(recv.text))) return undefined;\n const arg = parsedArg.trim();\n // `append_to_array` takes the value by move; ccxt's post-pass cloned a bare local there.\n const value = /^[a-zA-Z_][a-zA-Z0-9_]*$/.test(arg) && arg !== 'self' && arg !== 'true' && arg !== 'false' ? `${arg}.clone()` : arg;\n return `if let Value::Arr(__a) = &mut ${name} { std::sync::Arc::make_mut(__a).push(${value}); }`;\n }\n\n // hx4 R20 — `startsWith/endsWith(..) === true|false` compares the runtime fn's bare bool\n // (is_equal of two Bool boxes is the payload compare); `a + b` on R16 numeric kinds is the\n // `add` helper's Int/Float/Null dispatch, the same native match as `-`/`*`.\n r20BoolCallEquality(left, right, op): string | undefined {\n const l: any = this.unwrapParensNode(left);\n const r: any = this.unwrapParensNode(right);\n const isBoolLit = (n: any) => n?.kind === SyntaxKind.TrueKeyword || n?.kind === SyntaxKind.FalseKeyword;\n if (isBoolLit(l) === isBoolLit(r)) return undefined;\n const literal: any = isBoolLit(l) ? l : r;\n const call: any = isBoolLit(l) ? r : l;\n if (!isCallExpression(call) || !isPropertyAccessExpression(call.expression)) return undefined;\n const name = String(call.expression.name.text);\n if ((name !== 'startsWith' && name !== 'endsWith') || call.arguments.length !== 1) return undefined;\n const text = this.printNode(call, 0).trim();\n const fn = name === 'startsWith' ? 'starts_with' : 'ends_with';\n const m = /^Value::Bool\\((.*)\\)$/s.exec(text);\n if (m === null || !m[1].startsWith(`${fn}(`) || !this.r20Balanced(m[1]) || text.includes('\\n')) return undefined;\n const equals = op === SyntaxKind.EqualsEqualsToken || op === SyntaxKind.EqualsEqualsEqualsToken;\n return (literal.kind === SyntaxKind.TrueKeyword) === equals ? m[1] : `!${m[1]}`;\n }\n\n /** `fn(...)` whose first `(` closes at the very end (string literals skipped). */\n r20Balanced(text: string): boolean {\n let depth = 0;\n for (let i = 0; i < text.length; i++) {\n const c = text[i];\n if (c === '\"') { for (i++; i < text.length && text[i] !== '\"'; i++) if (text[i] === '\\\\') i++; continue; }\n if (c === '(') depth++;\n else if (c === ')') { depth--; if (depth === 0 && i !== text.length - 1) return false; }\n }\n return depth === 0 && text.endsWith(')');\n }\n\n r20NativeNumericAdd(op, left, right, leftText: string, rightText: string): string | undefined {\n if (op !== SyntaxKind.PlusToken) return undefined;\n if (!this.printsValueExpression(this.rustStripWrappers(left)) || !this.printsValueExpression(this.rustStripWrappers(right))) return undefined;\n if (this.rustR16NumericKind(left) === undefined || this.rustR16NumericKind(right) === undefined) return undefined;\n return this.printNativeNumeric(op, leftText, rightText);\n }\n\n // hx4 R21 — `Object.keys/values` on an R10-proven plain local in the base tier (the\n // helper's ws-tag filter is a no-op on a map built from literals), and native map reads\n // that are the receiver of a non-mutating string method (`currency['id'].toUpperCase ()`).\n\n /** Base-tier (`ts/src/base/**`) `Object.keys/values(x)` on an R10-proven plain local. */\n r21BaseEnum(node, parsedArg: string | undefined, kind: 'keys' | 'values'): string | undefined {\n const arg: any = this.rustStripWrappers(node?.arguments?.[0]);\n if (arg === undefined || parsedArg === undefined || !isIdentifier(arg)\n || !RustTranspiler.RUST_BASE_TIER_FILE.test(this.r05Path(node))\n || this.rustR10PlainReceiver(arg) !== 'local') return undefined;\n const body = kind === 'keys' ? '__m.keys().map(|__k| Value::Str(__k.clone().into())).collect()' : '__m.values().cloned().collect()';\n return `Value::Array(${parsedArg.trim()}.as_map().map(|__m| ${body}).unwrap_or_default())`;\n }\n\n private static readonly RUST_R21_PURE_STRING_METHODS = new Set([ 'toUpperCase', 'toLowerCase', 'trim', 'startsWith', 'endsWith', 'split' ]);\n\n /** `x['k'].m (…)` with `m` a non-mutating string method on a checker-`string` read: no\n * ccxt pass rewrites that target (only `.push` / calls of the read itself). */\n r21PureStringMethodReceiver(node: any): boolean {\n const access: any = node?.parent;\n const call: any = access?.parent;\n if (!isElementAccessExpression(node) || access === undefined || !isPropertyAccessExpression(access) || access.expression !== node\n || call === undefined || !isCallExpression(call) || call.expression !== access\n || !RustTranspiler.RUST_R21_PURE_STRING_METHODS.has(String(access.name.text))) return false;\n const type = this.typeOfNodeIfAny(node);\n return type !== undefined && (type.flags & TypeFlags.StringLike) !== 0;\n }\n\n /** Locals whose Arr-only proof is in progress (a self-referencing write proves nothing new). */\n private r21ArrVisiting = new Set();\n\n /** More always-`Value::Arr` sources for the R18 proof: base `arrayConcat` (Array on every\n * arm), base `sortBy`/`sortBy2` of an Arr-only local (returns its input's variant), and a\n * plain alias of a non-nullable Arr-only local (COW: the push never reaches the alias). */\n r21ArrSource(n: any): boolean {\n if (isCallExpression(n) && isPropertyAccessExpression(n.expression) && n.expression.expression.kind === SyntaxKind.ThisKeyword) {\n const callee = String(n.expression.name.text);\n if (callee === 'arrayConcat') return n.arguments.length === 2 && this.rustR01CalleeIsBase(n);\n if (callee === 'sortBy' || callee === 'sortBy2') {\n const first: any = this.rustStripWrappers(n.arguments[0]);\n return first !== undefined && isIdentifier(first) && this.rustR01CalleeIsBase(n) && this.r21ArrAlias(first);\n }\n return false;\n }\n return isIdentifier(n) && String(n.text) !== 'undefined' && this.r21ArrAlias(n);\n }\n\n r21ArrAlias(ident: any): boolean {\n const declaration: any = this.rustSingleLocalDeclaration(ident);\n if (declaration === undefined || !isVariableDeclaration(declaration)) return false;\n // the local under proof: its other writes decide\n if (this.r21ArrVisiting.has(declaration)) return true;\n this.r21ArrVisiting.add(declaration);\n try {\n return this.r18ArrLocal(ident, false);\n } finally {\n this.r21ArrVisiting.delete(declaration);\n }\n }\n\n // hx4 R22 — an R16 local re-read inside its own write (`p = p + 4`) is the assumed kind.\n r22AssumedNumericSelf(inner: any): string | undefined {\n if (!isIdentifier(inner)) return undefined;\n const declaration: any = this.rustSingleLocalDeclaration(inner);\n return declaration !== undefined && this.rustR16Assumed.has(declaration) ? 'number' : undefined;\n }\n\n private r22StrVisiting = new Map();\n\n /** Always `Value::Str`: R17 shapes, a `+` chain with such an operand, or an always-Str local. */\n r22AlwaysStr(node: any): boolean {\n const inner: any = this.unwrapParensNode(node);\n if (inner === undefined) return false;\n if (this.r17AlwaysStr(inner)) return true;\n if (isBinaryExpression(inner) && inner.operatorToken.kind === SyntaxKind.PlusToken) return this.r22AlwaysStr(inner.left) || this.r22AlwaysStr(inner.right);\n return isIdentifier(inner) && this.r22AlwaysStrLocal(inner);\n }\n\n /** A plain `Value` local, never captured by a closure, whose every write is always-Str (`x += e`\n * keeps it), or Str|Null (R13 source / nullish) when the checker narrows this read to `string`. */\n r22AlwaysStrLocal(ident: any, allowNull = false): boolean {\n if (this.rustParamShadowOf(ident) !== undefined || this.rustStringLocalIdentifierIsTyped(ident) || this.rustVecLocalDeclarationOf(ident) !== undefined) return false;\n const declaration: any = this.rustSingleLocalDeclaration(ident);\n if (declaration === undefined || !isVariableDeclaration(declaration) || !isIdentifier(declaration.name) || declaration.initializer === undefined) return false;\n // inductive: a cycle back to a local under proof assumes that proof (strict covers lax)\n if (this.r22StrVisiting.has(declaration)) return allowNull || this.r22StrVisiting.get(declaration) === false;\n const fn = this.rustEnclosingFunction(declaration);\n if (fn === undefined) return false;\n const here: any = this.typeOfNodeIfAny(ident);\n const narrowed = allowNull || (here !== undefined && this.isStringLikeType(here));\n const nullish = (e: any) => { const n: any = this.unwrapParensNode(e); return n?.kind === SyntaxKind.NullKeyword || (isIdentifier(n) && String(n.text) === 'undefined'); };\n const local = (e: any) => { const n: any = this.unwrapParensNode(e); return isIdentifier(n) && (this.rustR13ProvenStrIdentifier(n) || this.r22AlwaysStrLocal(n, true)); };\n const source = (e: any) => this.r22AlwaysStr(e) || (narrowed && (nullish(e) || this.rustR13ProvenStrSource(e) || local(e)));\n this.r22StrVisiting.set(declaration, allowNull);\n try {\n if (!source(declaration.initializer)) return false;\n return this.rustLocalUsesAll(declaration, String(declaration.name.text), true, (n: any) => {\n if (this.rustEnclosingFunction(n) !== fn || this.rustR13WriteTarget(n)) return false;\n const parent: any = n.parent;\n if ((parent?.kind === SyntaxKind.PrefixUnaryExpression || parent?.kind === SyntaxKind.PostfixUnaryExpression) && parent.operator !== SyntaxKind.ExclamationToken) return false;\n if (!isBinaryExpression(parent) || parent.left !== n || !rustIsAssignmentOperator(parent.operatorToken.kind)) return true;\n const op = parent.operatorToken.kind;\n return op === SyntaxKind.PlusEqualsToken || (op === SyntaxKind.EqualsToken && source(parent.right));\n });\n } finally {\n this.r22StrVisiting.delete(declaration);\n }\n }\n\n r22ConcatAnchor(node: any): boolean {\n const inner: any = this.unwrapParensNode(node);\n return inner !== undefined && this.printsValueExpression(inner) && this.r22AlwaysStr(inner);\n }\n\n r22ConcatIsAnchored(left, right, leftType, rightType): boolean {\n return (this.r22ConcatAnchor(left) && this.r17ConcatOperandSafe(right, rightType))\n || (this.r22ConcatAnchor(right) && this.r17ConcatOperandSafe(left, leftType));\n }\n\n /** `Option<&str>` text of an operand that is always `Value::Str` / `Value::Null`, else undefined. */\n r22StrOrNullOperand(node: any): string | undefined {\n const inner: any = this.rustStripWrappers(node);\n if (inner === undefined) return undefined;\n if (isStringLiteral(inner)) return inner.text in this.StringLiteralReplacements ? undefined : `Some(${this.quotedStringLiteral(inner.text)})`;\n if (isIdentifier(inner) && this.r22AlwaysStrLocal(inner, true)) {\n const text = this.printNode(inner, 0).trim();\n return /^[A-Za-z_][A-Za-z0-9_]*$/.test(text) ? `${text}.as_str()` : undefined;\n }\n const operand = this.rustR13StrOperand(inner, true);\n return operand === undefined ? undefined : `${operand}.as_str()`;\n }\n\n // `a < b` (`<=`, `>`, `>=`) on Str|Null operands: the helper's f64 parse of both strings, else\n // `str` order; `<=`/`>=` OR in `is_equal` (string equality, Null == Null).\n r22StrOrderedComparison(node, op, left, right): string | undefined {\n const operator = RustTranspiler.NATIVE_COMPARISON_OPERATORS[op];\n const a = this.r22StrOrNullOperand(left);\n const b = a === undefined ? undefined : this.r22StrOrNullOperand(right);\n if (operator === undefined || b === undefined) return undefined;\n const strict = operator.charAt(0);\n const orEqual = operator.length === 2;\n const order = `(match (__x.parse::(), __y.parse::()) { (Ok(__p), Ok(__q)) => __p ${strict} __q, _ => __x ${strict} __y })`;\n const text = `(match (${a}, ${b}) { (Some(__x), Some(__y)) => ${order}${orEqual ? ' || __x == __y' : ''}, ${orEqual ? '(None, None) => true, ' : ''}_ => false })`;\n return this.isBooleanPosition(node) ? text : `Value::Bool(${text})`;\n }\n\n // hx4 R23 — the R12 plain sources (`safeDict*(x, k, {})`, same-file builders, `extend|omit`)\n // also hold in the base tier and pro files, where a tagged handle can only arrive through a\n // parameter: base admits typed plain-dict parameters, pro admits no parameter at all.\n r23Tier(node: Node): 'rest' | 'base' | 'pro' | undefined {\n const path = this.r05Path(node);\n if (RustTranspiler.RUST_R12_REST_FILE.test(path) && /\\/ts\\/src\\/[^/]+\\.ts$/.test(path)) return 'rest';\n if (RustTranspiler.RUST_BASE_TIER_FILE.test(path) && !/\\/base\\/ws\\//.test(path)) return 'base';\n if (/\\/ts\\/src\\/pro\\/[^/]+\\.ts$/.test(path)) return 'pro';\n return undefined;\n }\n\n r23PlainSourceTier(node: Node): boolean {\n return this.r23Tier(node) !== undefined;\n }\n\n /** A copied/read dict argument outside REST: in pro only `this.options` or a proven plain\n * local; in base also a parameter annotated with a plain-dict type (no `any` caller handle). */\n r23TierSourceOk(arg: any): boolean {\n const tier = this.r23Tier(arg);\n if (tier === 'rest') return true;\n const node: any = this.rustStripWrappers(arg);\n if (node === undefined || !isIdentifier(node)) return true;\n const declaration: any = this.rustSingleLocalDeclaration(node);\n // pro: a local read source must itself be proven plain (its root may be a handler parameter)\n if (tier === 'pro') return declaration !== undefined && !isParameterDeclaration(declaration) && this.rustR10PlainReceiver(node) === 'local';\n if (declaration === undefined || !isParameterDeclaration(declaration)) return true;\n if (tier !== 'base' || declaration.type === undefined || declaration.dotDotDotToken !== undefined) return false;\n const type = this.getCheckedTypeOf(declaration.type);\n return type !== undefined && this.isProvenMapType(type) && !this.rustParameterIsClientHandle(declaration);\n }\n\n /** `this.extend (plain, …unshared)` / `this.omit|keysort (plain, …)` called directly\n * (not only as a builder's return): the same fresh-copy proof as `rustR12PlainReturn`. */\n private r23CopyVisiting = new Set();\n\n r23FreshCopy(node: any, depth: number): boolean {\n const callee = String(node.expression.name.text);\n // the R01 -> R12 hop restarts `depth`: a copy reached again through its own local proves nothing\n if ((callee !== 'extend' && callee !== 'omit' && callee !== 'keysort') || this.r23CopyVisiting.has(node)) return false;\n this.r23CopyVisiting.add(node);\n try {\n return this.rustR12PlainReturn(node, depth);\n } finally {\n this.r23CopyVisiting.delete(node);\n }\n }\n\n // hx4 R25 — `a - b` / `a * b` / `a / b` and `a < b` (`<=`, `>`, `>=`) on unproven `Value`s print the\n // helper's own dispatch inline (f64 coercion: Int/Float, Str parse, Bool 1/0; `<=`/`>=` OR in\n // `is_equal`); `a + b` on two Str|Null operands (fields of same-file object literals) is `format!`.\n r25LooseF64(binding: string): string {\n return `(match ${binding} { Value::Int(__n) => Some(*__n as f64), Value::Float(__f) => Some(*__f), Value::Str(__s) => __s.parse::().ok(), Value::Bool(__b) => Some(if *__b { 1.0 } else { 0.0 }), _ => None })`;\n }\n\n r25PlainValueOperand(node: any): boolean {\n const inner: any = this.rustStripWrappers(node);\n if (inner === undefined || !this.printsValueExpression(inner) || this.rustNativeStrCalleeKind(inner) === 'str') return false;\n if (isIdentifier(inner) && this.rustParamShadowOf(inner) !== undefined) return false;\n return !(isIdentifier(inner) && (this.rustStringLocalIdentifierIsTyped(inner) || this.rustVecLocalDeclarationOf(inner) !== undefined));\n }\n\n r25NativeCoercingArithmetic(op, left, right, leftText: string, rightText: string): string | undefined {\n if (op === SyntaxKind.PlusToken) return this.r25NativeStrOrNullConcat(left, right, leftText, rightText);\n if (op !== SyntaxKind.MinusToken && op !== SyntaxKind.AsteriskToken && op !== SyntaxKind.SlashToken) return undefined;\n if (!this.r25PlainValueOperand(left) || !this.r25PlainValueOperand(right)) return undefined;\n const a = this.rustR16NumericKind(left) !== undefined ? '__a.as_f64()' : this.r25LooseF64('__a');\n const b = this.rustR16NumericKind(right) !== undefined ? '__b.as_f64()' : this.r25LooseF64('__b');\n if (op === SyntaxKind.SlashToken) {\n return `(match (&(${leftText}), &(${rightText})) { (__a, __b) => match (${a}, ${b}) { (Some(__x), Some(__y)) if __y != 0.0 => Value::Float(__x / __y), _ => Value::Null } })`;\n }\n const sign = op === SyntaxKind.MinusToken ? '-' : '*';\n return `(match (&(${leftText}), &(${rightText})) { (Value::Int(__x), Value::Int(__y)) => Value::Int(__x ${sign} __y),` +\n ` (__a, __b) => match (${a}, ${b}) { (Some(__x), Some(__y)) => Value::Float(__x ${sign} __y), _ => Value::Null } })`;\n }\n\n // is_less_than / is_greater_than: f64 order when both coerce, else `str` order of two Str;\n // the `-or_equal` forms OR in is_equal (Null==Null, same-variant payload, Int exact, else f64).\n r25NativeLooseOrderedComparison(node, op, left, right): string | undefined {\n const operator = RustTranspiler.NATIVE_COMPARISON_OPERATORS[op];\n if (operator === undefined || !this.r25PlainValueOperand(left) || !this.r25PlainValueOperand(right)) return undefined;\n const strict = operator.charAt(0);\n const p = `(${this.r25LooseF64('__a')}, ${this.r25LooseF64('__b')})`;\n const order = `(match ${p} { (Some(__x), Some(__y)) => __x ${strict} __y, _ => matches!((__a, __b), (Value::Str(__x), Value::Str(__y)) if __x ${strict} __y) })`;\n const equal = ` || (match (__a, __b) { (Value::Null, Value::Null) => true, (Value::Bool(__x), Value::Bool(__y)) => __x == __y, (Value::Str(__x), Value::Str(__y)) => __x == __y,` +\n ` (Value::Int(__x), Value::Int(__y)) => __x == __y, (Value::Float(__x), Value::Float(__y)) => __x == __y, _ => matches!(${p}, (Some(__x), Some(__y)) if __x == __y) })`;\n const text = `(match (&(${this.printNode(left, 0)}), &(${this.printNode(right, 0)})) { (__a, __b) => ${order}${operator.length === 2 ? equal : ''} })`;\n return this.isBooleanPosition(node) ? text : `Value::Bool(${text})`;\n }\n\n // Str+Str / Str+Null take `string_concat` (Display, Null is \"null\"); Null+Null is Null.\n r25NativeStrOrNullConcat(left, right, leftText: string, rightText: string): string | undefined {\n if (!this.r25StrOrNull(left, 0) || !this.r25StrOrNull(right, 0)) return undefined;\n return `(match (&(${leftText}), &(${rightText})) { (Value::Null, Value::Null) => Value::Null, (__a, __b) => Value::Str(format!(\"{}{}\", __a, __b).into()) })`;\n }\n\n r25StrOrNull(node: any, depth: number): boolean {\n const inner: any = this.rustStripWrappers(node);\n if (inner === undefined || depth > 12 || !this.r25PlainValueOperand(inner)) return false;\n if (isStringLiteral(inner) || this.r22AlwaysStr(inner)) return true;\n // `pad_start` / `pad_end` (helper or native form) answer Str or Null\n if (isCallExpression(inner) && isPropertyAccessExpression(inner.expression)\n && (String(inner.expression.name.text) === 'padStart' || String(inner.expression.name.text) === 'padEnd')) return true;\n if (!isElementAccessExpression(inner) || !isStringLiteral(inner.argumentExpression)) return false;\n return this.r25DictFieldStrOrNull(inner.expression, String(inner.argumentExpression.text), depth + 1);\n }\n\n /** Every dict `node` can evaluate to holds `key` as Str/Null or lacks it (a read of a missing key / non-dict is Null). */\n r25DictFieldStrOrNull(node: any, key: string, depth: number): boolean {\n const inner: any = this.rustStripWrappers(node);\n if (inner === undefined || depth > 12) return false;\n if (inner.kind === SyntaxKind.NullKeyword || (isIdentifier(inner) && String(inner.text) === 'undefined')) return true;\n if (isObjectLiteralExpression(inner)) {\n for (const p of inner.properties as any) {\n if (p.kind !== SyntaxKind.PropertyAssignment) return false;\n const name: any = p.name;\n const text = (isStringLiteral(name) || isIdentifier(name)) ? String(name.text) : undefined;\n if (text === undefined) return false;\n if (text === key && !this.r25StrOrNull(p.initializer, depth + 1)) return false;\n }\n return true;\n }\n if (isCallExpression(inner)) return this.r25MethodFieldStrOrNull(inner, key, depth + 1);\n if (!isIdentifier(inner)) return false;\n const declaration: any = this.rustSingleLocalDeclaration(inner);\n if (declaration === undefined || !isVariableDeclaration(declaration) || !isIdentifier(declaration.name)\n || declaration.initializer === undefined || (declaration.parent?.flags & NodeFlags.Const) === 0) return false;\n const fn = this.rustEnclosingFunction(declaration);\n if (fn === undefined) return false;\n // no element write / delete rooted at the local\n for (const m of this.rustScopeNameNodes(fn, String(declaration.name.text)) as any[]) {\n if (m === declaration.name || m.kind !== SyntaxKind.Identifier) continue;\n let top: any = m;\n while (isElementAccessExpression(top.parent) && top.parent.expression === top) top = top.parent;\n if (top === m) continue;\n const parent: any = top.parent;\n if (isDeleteExpression(parent) || (isBinaryExpression(parent) && parent.left === top && rustIsAssignmentOperator(parent.operatorToken.kind))) return false;\n }\n return this.r25DictFieldStrOrNull(declaration.initializer, key, depth + 1);\n }\n\n /** `this.m(..)` resolved to a same-file method with a body whose every return holds `key` as Str/Null. */\n r25MethodFieldStrOrNull(call: any, key: string, depth: number): boolean {\n const callee = call.expression;\n if (!isPropertyAccessExpression(callee) || callee.expression.kind !== SyntaxKind.ThisKeyword) return false;\n let declaration: any;\n try {\n declaration = signatureDeclaration((this.getChecker() as any).getResolvedSignature(call));\n } catch (e) {\n return false;\n }\n if (declaration?.kind !== SyntaxKind.MethodDeclaration || declaration.body === undefined\n || declaration.getSourceFile() !== call.getSourceFile() || RustTranspiler.RUST_BASE_TIER_FILE.test(this.r05Path(call))) return false;\n let ok = true;\n const visit = (n: any) => {\n if (!ok || (n !== declaration && isFunctionLike(n))) return;\n if (isReturnStatement(n) && n.expression !== undefined && !this.r25DictFieldStrOrNull(n.expression, key, depth + 1)) ok = false;\n n.forEachChild?.(visit);\n };\n declaration.body.forEachChild(visit);\n return ok;\n }\n\n // hx4 R26 — tuple slot 1 of the base `handle*AndParams` / `handleParam*` helpers is their\n // params argument or an `omit` copy of it: plain when that argument is a plain source.\n private static readonly R26_PARAMS_SLOT_ARG: { [name: string]: number } = {\n handleOptionAndParams: 0, handleOptionAndParams2: 0, handleOptionStringAndParams: 0, handleOptionStringAndParams2: 0,\n handleOptionBoolAndParams: 0, handleOptionBoolAndParams2: 0, handleOptionIntegerAndParams: 0, handleOptionIntegerAndParams2: 0,\n handleParamString: 0, handleParamString2: 0, handleParamInteger: 0, handleParamInteger2: 0, handleParamBool: 0, handleParamBool2: 0,\n handleNetworkCodeAndParams: 0, handleMarginModeAndParams: 1, handleMarketTypeAndParams: 2, handleSubTypeAndParams: 2,\n handleMaxEntriesPerRequestAndParams: 2,\n };\n\n r26ParamsSlot(rhs: Node, selfName: string | undefined, depth: number): boolean {\n const call: any = this.rustStripWrappers(rhs);\n if (depth > 4 || call === undefined || !isCallExpression(call) || !isPropertyAccessExpression(call.expression)\n || call.expression.expression.kind !== SyntaxKind.ThisKeyword || this.r23Tier(call) === undefined) {\n return false;\n }\n const index = RustTranspiler.R26_PARAMS_SLOT_ARG[String(call.expression.name.text)];\n if (index === undefined || !this.rustR01CalleeIsBase(call)) return false;\n const arg: any = this.rustStripWrappers(call.arguments[index]);\n // an omitted params argument takes the `{}` default\n if (arg === undefined) return call.arguments.length <= index;\n if (this.rustPlainDictLiteral(arg)) return true;\n if (!isIdentifier(arg)) return false;\n if (String(arg.text) === selfName) return true;\n const declaration: any = this.rustSingleLocalDeclaration(arg);\n if (declaration !== undefined && isParameterDeclaration(declaration)) {\n // REST parameters are caller data; base needs a typed non-Client dict; pro rejects\n return this.r23TierSourceOk(arg) && (this.r23Tier(arg) !== 'base' || this.rustParamStaysPlainDict(declaration));\n }\n try {\n return this.rustR10PlainReceiver(arg) === 'local';\n } catch (e) {\n return false;\n }\n }\n\n // hx4 R30 — `slice` / `indexOf` / `toUpperCase` / `toLowerCase` on unproven `Value`s print the\n // runtime helper's own dispatch inline (`runtime.rs` slice/get_index_of/to_upper/to_lower);\n // every operand is evaluated once, in the helper's argument order.\n r30LooseI64(expr: string): string {\n return `(match &(${expr}) { Value::Int(__n) => Some(*__n), Value::Float(__f) => Some(*__f as i64), Value::Str(__s) => __s.parse::().ok(), Value::Bool(__b) => Some(if *__b { 1 } else { 0 }), _ => None })`;\n }\n\n r30SliceArm(variant: string, len: string, take: string, empty: string): string {\n const bound = (b: string) => `if ${b} < 0 { (__l + ${b}).max(0) } else { ${b}.min(__l) }`;\n return `(${variant}, __b, __e) => match (${len}) { __l => match (${bound('__b')}, match __e { None => __l, Some(__k) => ${bound('__k')} }) { (__i, __j) => if __i <= __j { ${take} } else { ${empty} } } }`;\n }\n\n r30Slice(name: string, start: string, end: string): string {\n const str = this.r30SliceArm('Value::Str(__sv)', '__sv.chars().count() as i64',\n 'Value::Str(__sv.chars().skip(__i as usize).take((__j - __i) as usize).collect::().into())', 'Value::Str(String::new().into())');\n const arr = this.r30SliceArm('Value::Arr(__a)', '__a.len() as i64',\n 'Value::Array(__a[__i as usize..__j as usize].to_vec())', 'Value::Array(vec![])');\n return `(match (&(${name}), ${this.r30LooseI64(start)}.unwrap_or(0), ${this.r30LooseI64(end)}) { ${str}, ${arr}, _ => Value::Null })`;\n }\n\n r30IndexOf(name: string, needle: string): string {\n const eq = `match (__it, __nd) { (Value::Null, Value::Null) => true, (Value::Bool(__x), Value::Bool(__y)) => __x == __y, (Value::Str(__x), Value::Str(__y)) => __x == __y, (Value::Int(__x), Value::Int(__y)) => __x == __y, (Value::Float(__x), Value::Float(__y)) => __x == __y, (__p, __q) => match (${this.r25LooseF64('__p')}, ${this.r25LooseF64('__q')}) { (Some(__x), Some(__y)) => __x == __y, _ => false } }`;\n return `(match (&(${name}), &(${needle})) { (Value::Arr(__a), __nd) => Value::Int(__a.iter().position(|__it| ${eq}).map(|__i| __i as i64).unwrap_or(-1)), (Value::Str(__s), Value::Str(__nd)) => Value::Int(__s.find(&**__nd).map(|__i| __i as i64).unwrap_or(-1)), _ => Value::Int(-1) })`;\n }\n\n r30Case(name: string, method: string): string {\n return `(match &(${name}) { Value::Str(__s) => Value::Str(__s.${method}().into()), _ => Value::Null })`;\n }\n}\n","import { BaseTranspiler } from \"./baseTranspiler.js\";\nimport { SyntaxKind } from \"typescript/unstable/ast\";\nimport { isCallExpression, isExpressionStatement } from \"typescript/unstable/ast/is\";\nimport { type Checker } from \"typescript/unstable/sync\";\nimport { isFunctionLike } from \"./tsUtils.js\";\n\nconst parserConfig = {\n 'ELSEIF_TOKEN': 'else if',\n 'OBJECT_OPENING': 'std::unordered_map {',\n 'OBJECT_CLOSING': '}',\n 'ARRAY_OPENING_TOKEN': 'std::vector{',\n 'ARRAY_CLOSING_TOKEN': '}',\n 'PROPERTY_ASSIGNMENT_TOKEN': ',',\n 'VAR_TOKEN': 'std::any', // object\n 'METHOD_TOKEN': '',\n 'PROPERTY_ASSIGNMENT_OPEN': '{',\n 'PROPERTY_ASSIGNMENT_CLOSE': '}',\n 'SUPER_TOKEN': 'base',\n 'SUPER_CALL_TOKEN': 'base',\n 'FALSY_WRAPPER_OPEN': 'isTrue(',\n 'FALSY_WRAPPER_CLOSE': ')',\n 'COMPARISON_WRAPPER_OPEN' : \"isEqual(\",\n 'COMPARISON_WRAPPER_CLOSE' : \")\",\n 'UKNOWN_PROP_WRAPPER_OPEN': 'this.call(',\n 'UNKOWN_PROP_WRAPPER_CLOSE': ')',\n 'UKNOWN_PROP_ASYNC_WRAPPER_OPEN': 'this.callAsync(',\n 'UNKOWN_PROP_ASYNC_WRAPPER_CLOSE': ')',\n 'DYNAMIC_CALL_OPEN': 'callDynamically(',\n 'EQUALS_EQUALS_WRAPPER_OPEN': 'isEqual(',\n 'EQUALS_EQUALS_WRAPPER_CLOSE': ')',\n 'DIFFERENT_WRAPPER_OPEN': '!isEqual(',\n 'DIFFERENT_WRAPPER_CLOSE': ')',\n 'GREATER_THAN_WRAPPER_OPEN': 'isGreaterThan(',\n 'GREATER_THAN_WRAPPER_CLOSE': ')',\n 'GREATER_THAN_EQUALS_WRAPPER_OPEN': 'isGreaterThanOrEqual(',\n 'GREATER_THAN_EQUALS_WRAPPER_CLOSE': ')',\n 'LESS_THAN_WRAPPER_OPEN': 'isLessThan(',\n 'LESS_THAN_WRAPPER_CLOSE': ')',\n 'LESS_THAN_EQUALS_WRAPPER_OPEN': 'isLessThanOrEqual(',\n 'LESS_THAN_EQUALS_WRAPPER_CLOSE': ')',\n 'PLUS_WRAPPER_OPEN':'add(',\n 'PLUS_WRAPPER_CLOSE':')',\n 'MINUS_WRAPPER_OPEN':'subtract(',\n 'MINUS_WRAPPER_CLOSE':')',\n 'ARRAY_LENGTH_WRAPPER_OPEN': 'getArrayLength(',\n 'ARRAY_LENGTH_WRAPPER_CLOSE': ')',\n 'DIVIDE_WRAPPER_OPEN': 'divide(',\n 'DIVIDE_WRAPPER_CLOSE': ')',\n 'MULTIPLY_WRAPPER_OPEN': 'multiply(',\n 'MULTIPLY_WRAPPER_CLOSE': ')',\n 'INDEXOF_WRAPPER_OPEN': 'getIndexOf(',\n 'INDEXOF_WRAPPER_CLOSE': ')',\n 'MOD_WRAPPER_OPEN': 'mod(',\n 'MOD_WRAPPER_CLOSE': ')',\n 'FUNCTION_TOKEN': '',\n 'DEFAULT_PARAMETER_TYPE': 'std::any',\n 'INFER_VAR_TYPE': false,\n 'INFER_ARG_TYPE': false,\n 'UNDEFINED_TOKEN': 'std::any{}',\n // qualified with :: so class methods with the same name never shadow the helper\n 'ELEMENT_ACCESS_WRAPPER_OPEN': '::getValue(',\n 'ELEMENT_ACCESS_WRAPPER_CLOSE': ')',\n 'DEFAULT_RETURN_TYPE': 'std::any',\n 'THIS_TOKEN': 'this',\n 'NEW_TOKEN': '',\n 'CATCH_DECLARATION': 'const std::exception&',\n};\n\nexport class CppTranspiler extends BaseTranspiler {\n\n binaryExpressionsWrappers;\n\n constructor(config = {}) {\n config['parser'] = Object.assign ({}, parserConfig, config['parser'] ?? {});\n\n super(config);\n\n this.requiresParameterType = true;\n this.requiresReturnType = true;\n this.asyncTranspiling = true;\n this.supportsFalsyOrTruthyValues = false;\n this.requiresCallExpressionCast = false;\n this.id = \"c++\";\n\n this.initConfig();\n\n // user overrides\n this.applyUserOverrides(config);\n }\n\n initConfig() {\n this.LeftPropertyAccessReplacements = {\n };\n\n this.RightPropertyAccessReplacements = {\n };\n\n this.FullPropertyAccessReplacements = {\n 'JSON.parse': 'parseJson',\n 'JSON.stringify': 'jsonStringify',\n 'console.log': 'consoleLog',\n 'Number.MAX_SAFE_INTEGER': 'INT_MAX',\n 'Math.min': 'mathMin',\n 'Math.max': 'mathMax',\n 'Math.log': 'mathLog',\n 'Math.abs': 'mathAbs',\n 'Math.floor': 'mathFloor',\n 'Math.pow': 'mathPow',\n };\n\n this.CallExpressionReplacements = {\n };\n\n this.ReservedKeywordsReplacements = {\n 'union': 'unionVar',\n 'char': 'charVar',\n 'default': 'defaultVar',\n 'operator': 'operatorVar',\n 'new': 'newVar',\n 'delete': 'deleteVar',\n 'template': 'templateVar',\n };\n\n this.VariableTypeReplacements = {\n };\n\n this.ArgTypeReplacements = {\n };\n\n this.binaryExpressionsWrappers = {\n [SyntaxKind.EqualsEqualsToken]: [this.EQUALS_EQUALS_WRAPPER_OPEN, this.EQUALS_EQUALS_WRAPPER_CLOSE],\n [SyntaxKind.EqualsEqualsEqualsToken]: [this.EQUALS_EQUALS_WRAPPER_OPEN, this.EQUALS_EQUALS_WRAPPER_CLOSE],\n [SyntaxKind.ExclamationEqualsToken]: [this.DIFFERENT_WRAPPER_OPEN, this.DIFFERENT_WRAPPER_CLOSE],\n [SyntaxKind.ExclamationEqualsEqualsToken]: [this.DIFFERENT_WRAPPER_OPEN, this.DIFFERENT_WRAPPER_CLOSE],\n [SyntaxKind.GreaterThanToken]: [this.GREATER_THAN_WRAPPER_OPEN, this.GREATER_THAN_WRAPPER_CLOSE],\n [SyntaxKind.GreaterThanEqualsToken]: [this.GREATER_THAN_EQUALS_WRAPPER_OPEN, this.GREATER_THAN_EQUALS_WRAPPER_CLOSE],\n [SyntaxKind.LessThanToken]: [this.LESS_THAN_WRAPPER_OPEN, this.LESS_THAN_WRAPPER_CLOSE],\n [SyntaxKind.LessThanEqualsToken]: [this.LESS_THAN_EQUALS_WRAPPER_OPEN, this.LESS_THAN_EQUALS_WRAPPER_CLOSE],\n [SyntaxKind.PlusToken]: [this.PLUS_WRAPPER_OPEN, this.PLUS_WRAPPER_CLOSE],\n [SyntaxKind.MinusToken]: [this.MINUS_WRAPPER_OPEN, this.MINUS_WRAPPER_CLOSE],\n [SyntaxKind.AsteriskToken]: [this.MULTIPLY_WRAPPER_OPEN, this.MULTIPLY_WRAPPER_CLOSE],\n [SyntaxKind.PercentToken]: [this.MOD_WRAPPER_OPEN, this.MOD_WRAPPER_CLOSE],\n [SyntaxKind.SlashToken]: [this.DIVIDE_WRAPPER_OPEN, this.DIVIDE_WRAPPER_CLOSE],\n };\n }\n\n getBlockOpen(identation){\n return \"\\n\" + this.getIden(identation) + this.BLOCK_OPENING_TOKEN + \"\\n\";\n }\n\n printSuperCallInsideConstructor(node, identation) {\n return \"\"; // c++ initializes the base class in the member initializer list\n }\n\n printStringLiteral(node) {\n // wrap in std::string so std::any always holds std::string, never const char*\n return `std::string(${super.printStringLiteral(node)})`;\n }\n\n printClass(node, identation) {\n const classDefinition = this.printClassDefinition(node, identation);\n const classBody = this.printClassBody(node, identation);\n const classClosing = this.getBlockClose(identation);\n return classDefinition + classBody + classClosing + ';';\n }\n\n printClassDefinition(node, identation) {\n const className = node.name.text;\n const heritageClauses = node.heritageClauses;\n\n let classInit = \"\";\n if (heritageClauses !== undefined) {\n const classExtends = heritageClauses[0].types[0].expression.text;\n classInit = this.getIden(identation) + \"class \" + className + \" : public \" + classExtends;\n } else {\n classInit = this.getIden(identation) + \"class \" + className;\n }\n return classInit + \"\\n\" + this.getIden(identation) + this.BLOCK_OPENING_TOKEN + \"\\n\" +\n this.getIden(identation) + \"public:\\n\";\n }\n\n printConstructorDeclaration (node, identation) {\n const classNode = node.parent;\n const className = this.printNode(classNode.name, 0);\n const args = this.printMethodParameters(node);\n const constructorBody = this.printFunctionBody(node, identation);\n\n // find super call inside constructor and extract params\n let superCallParams = '';\n let hasSuperCall = false;\n node.body?.statements.forEach(statement => {\n if (isExpressionStatement(statement)) {\n const expression = statement.expression;\n if (isCallExpression(expression)) {\n const expressionText = expression.expression.getText().trim();\n if (expressionText === 'super') {\n hasSuperCall = true;\n superCallParams = expression.arguments.map((a) => {\n return this.printNode(a, identation).trim();\n }).join(\", \");\n }\n }\n }\n });\n\n if (hasSuperCall) {\n const parentClassName = classNode.heritageClauses[0].types[0].expression.text;\n return this.getIden(identation) + className +\n `(${args}) : ${parentClassName}(${superCallParams})` +\n constructorBody;\n }\n\n return this.getIden(identation) +\n className +\n \"(\" + args + \")\" +\n constructorBody;\n }\n\n printThisElementAccesssIfNeeded(node, identation) {\n return undefined; // dynamic this[method]() calls are not supported yet\n }\n\n printDynamicCall(node, identation) {\n return undefined; // dynamic calls are not supported yet\n }\n\n printAwaitExpression(node, identation) {\n const expression = this.printNode(node.expression, identation);\n if (this.asyncTranspiling) {\n // awaitValue resolves a std::shared_future (or passes a\n // plain value through, like awaiting a non-promise in JS)\n return `awaitValue(${expression})`;\n }\n return expression;\n }\n\n printReturnStatement(node, identation) {\n // a bare `return;` inside an async body must yield a value: the body\n // runs in a lambda returning std::any\n if (this.asyncTranspiling && !node.expression) {\n let fn = node.parent;\n while (fn !== undefined && !isFunctionLike(fn)) {\n fn = fn.parent;\n }\n if (fn !== undefined && this.isAsyncFunction(fn)) {\n return this.getIden(identation) + \"return std::any{}\" + this.LINE_TERMINATOR;\n }\n }\n return super.printReturnStatement(node, identation);\n }\n\n printFunctionBody(node, identation) {\n if (this.asyncTranspiling && this.isAsyncFunction(node)) {\n // run the body on a std::async task so independent calls overlap;\n // sharing the future makes it copyable and thus storable in std::any\n const innerIdentation = identation + 2;\n const bodyStatements = node.body.statements;\n const statements = bodyStatements.map((s) => this.printNode(s, innerIdentation)).join(\"\\n\");\n // the lambda returns std::any, so a body that can flow off the end\n // needs a fallback return\n const lastStatement = bodyStatements.length > 0 ? bodyStatements[bodyStatements.length - 1] : undefined;\n const endsWithReturn = lastStatement !== undefined && lastStatement.kind === SyntaxKind.ReturnStatement;\n const fallbackReturn = endsWithReturn ? \"\" : this.getIden(innerIdentation) + \"return std::any{};\\n\";\n return this.getBlockOpen(identation) +\n this.getIden(identation + 1) + \"return std::async(std::launch::async, [=]() -> std::any {\\n\" +\n (statements ? statements + \"\\n\" : \"\") +\n fallbackReturn +\n this.getIden(identation + 1) + \"}).share();\" +\n this.getBlockClose(identation);\n }\n return super.printFunctionBody(node, identation);\n }\n\n printWrappedUnknownThisProperty(node) {\n return undefined;\n }\n\n printOutOfOrderCallExpressionIfAny(node, identation) {\n if (node.expression.kind === SyntaxKind.PropertyAccessExpression) {\n const expressionText = node.expression.getText().trim();\n const args = node.arguments;\n if (args.length === 1) {\n const parsedArg = this.printNode(args[0], 0);\n switch (expressionText) {\n case \"Math.abs\":\n return `mathAbs(${parsedArg})`;\n }\n } else if (args.length === 2) {\n const parsedArg1 = this.printNode(args[0], 0);\n const parsedArg2 = this.printNode(args[1], 0);\n switch (expressionText) {\n case \"Math.min\":\n return `mathMin(${parsedArg1}, ${parsedArg2})`;\n case \"Math.max\":\n return `mathMax(${parsedArg1}, ${parsedArg2})`;\n case \"Math.pow\":\n return `mathPow(${parsedArg1}, ${parsedArg2})`;\n }\n }\n }\n\n return undefined;\n }\n\n handleTypeOfInsideBinaryExpression(node, identation) {\n const right = node.right.text;\n const op = node.operatorToken.kind;\n const expression = node.left.expression;\n\n const isDifferentOperator = op === SyntaxKind.ExclamationEqualsEqualsToken || op === SyntaxKind.ExclamationEqualsToken;\n const notOperator = isDifferentOperator ? this.NOT_TOKEN : \"\";\n\n const target = this.printNode(expression, 0);\n switch (right) {\n case \"string\":\n return notOperator + `isString(${target})`;\n case \"number\":\n return notOperator + `isNumber(${target})`;\n case \"boolean\":\n return notOperator + `isBool(${target})`;\n case \"object\":\n return notOperator + `isDictionary(${target})`;\n case \"function\":\n return notOperator + `isFunction(${target})`;\n }\n\n return undefined;\n }\n\n printCustomBinaryExpressionIfAny(node, identation) {\n const left = node.left;\n const right = node.right;\n\n const op = node.operatorToken.kind;\n\n if (left.kind === SyntaxKind.TypeOfExpression) {\n const typeOfExpression = this.handleTypeOfInsideBinaryExpression(node, identation);\n if (typeOfExpression) {\n return typeOfExpression;\n }\n }\n\n // handle: [x,d] = this.method()\n if (op === SyntaxKind.EqualsToken && left.kind === SyntaxKind.ArrayLiteralExpression) {\n const arrayBindingPatternElements = left.elements;\n const parsedArrayBindingElements = arrayBindingPatternElements.map((e) => this.printNode(e, 0));\n const syntheticName = parsedArrayBindingElements.join(\"\") + \"Variable\";\n\n let arrayBindingStatement = `std::any ${syntheticName} = ${this.printNode(right, 0)};\\n`;\n\n parsedArrayBindingElements.forEach((e, index) => {\n const statement = this.getIden(identation) + `${e} = ::getValue(${syntheticName}, ${index})`;\n if (index < parsedArrayBindingElements.length - 1) {\n arrayBindingStatement += statement + \";\\n\";\n } else {\n // printStatement adds the last ;\n arrayBindingStatement += statement;\n }\n });\n\n return arrayBindingStatement;\n }\n\n if (op === SyntaxKind.InKeyword) {\n return `inOp(${this.printNode(right, 0)}, ${this.printNode(left, 0)})`;\n }\n\n const leftText = this.printNode(left, 0);\n const rightText = this.printNode(right, 0);\n\n if (op === SyntaxKind.PlusEqualsToken) {\n return `${leftText} = add(${leftText}, ${rightText})`;\n }\n\n if (op === SyntaxKind.MinusEqualsToken) {\n return `${leftText} = subtract(${leftText}, ${rightText})`;\n }\n\n if (op === SyntaxKind.EqualsToken) {\n // handle dict['a'] = 3 and list[0] = 3\n if (left.kind === SyntaxKind.ElementAccessExpression) {\n const elementAccess = left;\n const target = this.printNode(elementAccess.expression, 0);\n const propName = this.printNode(elementAccess.argumentExpression, 0);\n return `::setValue(${target}, ${propName}, ${rightText})`;\n }\n }\n\n if (op in this.binaryExpressionsWrappers) {\n const wrapper = this.binaryExpressionsWrappers[op];\n const open = wrapper[0];\n const close = wrapper[1];\n return `${open}${leftText}, ${rightText}${close}`;\n }\n\n return undefined;\n }\n\n printVariableDeclarationList(node,identation) {\n const declaration = node.declarations[0];\n\n // handle array binding : input: const [a,b] = this.method()\n // output: std::any abVariable = this.method(); std::any a = getValue(abVariable, 0); ...\n if (declaration?.name.kind === SyntaxKind.ArrayBindingPattern) {\n const arrayBindingPattern = declaration.name;\n const arrayBindingPatternElements = arrayBindingPattern.elements;\n const parsedArrayBindingElements = arrayBindingPatternElements.map((e) => this.printNode(e.name, 0));\n const syntheticName = parsedArrayBindingElements.join(\"\") + \"Variable\";\n\n let arrayBindingStatement = `${this.getIden(identation)}std::any ${syntheticName} = ${this.printNode(declaration.initializer, 0)};\\n`;\n\n parsedArrayBindingElements.forEach((e, index) => {\n const statement = this.getIden(identation) + `std::any ${e} = ::getValue(${syntheticName}, ${index})`;\n if (index < parsedArrayBindingElements.length - 1) {\n arrayBindingStatement += statement + \";\\n\";\n } else {\n // printStatement adds the last ;\n arrayBindingStatement += statement;\n }\n });\n\n return arrayBindingStatement;\n }\n\n const isNew = declaration.initializer && (declaration.initializer.kind === SyntaxKind.NewExpression);\n let className = undefined;\n if (isNew) {\n className = declaration.initializer.expression.text;\n }\n const varToken = isNew ? className + ' ' : this.VAR_TOKEN + ' ' ;\n\n // handle default undefined initialization: let id: Str;\n if (declaration.initializer === undefined) {\n return this.getIden(identation) + this.VAR_TOKEN + ' ' + this.printNode(declaration.name) + \" = \" + this.UNDEFINED_TOKEN;\n }\n const parsedValue = this.printNode(declaration.initializer, identation).trimStart();\n return this.getIden(identation) + varToken + this.printNode(declaration.name) + \" = \" + parsedValue;\n }\n\n printFunctionDefinition(node, identation) {\n let name = node.name.text;\n name = this.transformFunctionNameIfNeeded(name);\n\n const parsedArgs = node.parameters.map(param => this.printParameter(param)).join(\", \");\n\n let returnType = this.printFunctionType(node);\n returnType = returnType ? returnType + \" \" : returnType;\n\n const functionDef = this.getIden(identation) + returnType + name\n + \"(\" + parsedArgs + \")\";\n\n return functionDef;\n }\n\n printInstanceOfExpression(node, identation) {\n const left = this.printNode(node.left, 0);\n const right = node.right.text;\n return this.getIden(identation) + `(dynamic_cast(&(${left})) != nullptr)`;\n }\n\n printAsExpression(node, identation) {\n return this.printNode(node.expression, identation);\n }\n\n printParameter(node, defaultValue = true) {\n const name = this.printNode(node.name, 0);\n const initializer = node.initializer;\n\n if (defaultValue) {\n if (initializer) {\n return this.DEFAULT_PARAMETER_TYPE + \" \" + name + this.SPACE_DEFAULT_PARAM + \"=\" + this.SPACE_DEFAULT_PARAM + this.printNode(initializer, 0);\n }\n return this.DEFAULT_PARAMETER_TYPE + \" \" + name;\n }\n return name;\n }\n\n printFunctionType(node){\n if (!this.requiresReturnType) {\n return \"\";\n }\n\n if (this.asyncTranspiling && this.isAsyncFunction(node)) {\n return `std::shared_future<${this.DEFAULT_RETURN_TYPE}>`;\n }\n\n const typeText = this.getFunctionType(node);\n if (typeText === this.VOID_KEYWORD) {\n return this.VOID_KEYWORD;\n }\n return this.DEFAULT_RETURN_TYPE;\n }\n\n printMethodDefinition(node, identation) {\n let name = node.name.text;\n name = this.transformMethodNameIfNeeded(name);\n\n let returnType = this.printFunctionType(node);\n\n const methodOverride = this.getMethodOverride(node) as any;\n const isOverride = methodOverride !== undefined;\n const virtualPrefix = isOverride ? \"\" : \"virtual \";\n const overrideSuffix = isOverride ? \" override\" : \"\";\n\n // keep the overridden method's return type so the signatures match\n if (isOverride) {\n returnType = this.printFunctionType(methodOverride);\n }\n\n const parsedArgs = this.printMethodParameters(node);\n\n returnType = returnType ? returnType + \" \" : returnType;\n\n const methodToken = this.METHOD_TOKEN ? this.METHOD_TOKEN + \" \" : \"\";\n const methodDef = this.getIden(identation) + virtualPrefix + returnType + methodToken + name\n + \"(\" + parsedArgs + \")\" + overrideSuffix;\n\n return this.printNodeCommentsIfAny(node, identation, methodDef);\n }\n\n printPropertyDeclaration(node, identation) {\n const name = this.printNode(node.name, 0);\n if (node.initializer) {\n const initializer = this.printNode(node.initializer, 0);\n return this.getIden(identation) + 'std::any ' + name + \" = \" + initializer + this.LINE_TERMINATOR;\n }\n return this.getIden(identation) + 'std::any ' + name + this.LINE_TERMINATOR;\n }\n\n printArrayLiteralExpression(node) {\n const elements = node.elements.map((e) => {\n return this.printNode(e);\n }).join(\", \");\n return this.ARRAY_OPENING_TOKEN + elements + this.ARRAY_CLOSING_TOKEN;\n }\n\n printArrayIsArrayCall(node, identation, parsedArg = undefined) {\n return `isArray(${parsedArg})`;\n }\n\n printObjectKeysCall(node, identation, parsedArg = undefined) {\n return `getObjectKeys(${parsedArg})`;\n }\n\n printObjectValuesCall(node, identation, parsedArg = undefined) {\n return `getObjectValues(${parsedArg})`;\n }\n\n printJsonParseCall(node, identation, parsedArg = undefined) {\n return `parseJson(${parsedArg})`;\n }\n\n printJsonStringifyCall(node, identation, parsedArg = undefined) {\n return `jsonStringify(${parsedArg})`;\n }\n\n printPromiseAllCall(node, identation, parsedArg = undefined) {\n return `promiseAll(${parsedArg})`;\n }\n\n printMathFloorCall(node, identation, parsedArg = undefined) {\n return `mathFloor(${parsedArg})`;\n }\n\n printMathRoundCall(node, identation, parsedArg = undefined) {\n return `mathRound(${parsedArg})`;\n }\n\n printMathCeilCall(node, identation, parsedArg = undefined) {\n return `mathCeil(${parsedArg})`;\n }\n\n printNumberIsIntegerCall(node: any, identation: any, parsedArg?: any) {\n return `isInteger(${parsedArg})`;\n }\n\n printArrayPushCall(node, identation, name = undefined, parsedArg = undefined) {\n return `arrayPush(${name}, ${parsedArg})`;\n }\n\n printIncludesCall(node, identation, name = undefined, parsedArg = undefined) {\n return `includes(${name}, ${parsedArg})`;\n }\n\n printIndexOfCall(node, identation, name = undefined, parsedArg = undefined) {\n return `${this.INDEXOF_WRAPPER_OPEN}${name}, ${parsedArg}${this.INDEXOF_WRAPPER_CLOSE}`;\n }\n\n printStartsWithCall(node, identation, name = undefined, parsedArg = undefined) {\n return `startsWith(${name}, ${parsedArg})`;\n }\n\n printEndsWithCall(node, identation, name = undefined, parsedArg = undefined) {\n return `endsWith(${name}, ${parsedArg})`;\n }\n\n printTrimCall(node, identation, name = undefined) {\n return `trim(${name})`;\n }\n\n printJoinCall(node, identation, name = undefined, parsedArg = undefined) {\n return `join(${name}, ${parsedArg})`;\n }\n\n printSplitCall(node, identation, name = undefined, parsedArg = undefined) {\n return `split(${name}, ${parsedArg})`;\n }\n\n printConcatCall(node, identation, name = undefined, parsedArg = undefined) {\n return `concat(${name}, ${parsedArg})`;\n }\n\n printToFixedCall(node, identation, name = undefined, parsedArg = undefined) {\n return `toFixed(${name}, ${parsedArg})`;\n }\n\n printToStringCall(node, identation, name = undefined) {\n return `toString(${name})`;\n }\n\n printToUpperCaseCall(node, identation, name = undefined) {\n return `toUpperCase(${name})`;\n }\n\n printToLowerCaseCall(node, identation, name = undefined) {\n return `toLowerCase(${name})`;\n }\n\n printShiftCall(node, identation, name = undefined) {\n return `shift(${name})`;\n }\n\n printReverseCall(node, identation, name = undefined) {\n return `reverse(${name})`;\n }\n\n printPopCall(node, identation, name = undefined) {\n return `pop(${name})`;\n }\n\n printAssertCall(node, identation, parsedArgs) {\n return `assertTrue(${parsedArgs})`;\n }\n\n printSliceCall(node, identation, name = undefined, parsedArg = undefined, parsedArg2 = undefined) {\n if (parsedArg2 === undefined){\n parsedArg2 = this.UNDEFINED_TOKEN;\n }\n return `slice(${name}, ${parsedArg}, ${parsedArg2})`;\n }\n\n printReplaceCall(node, identation, name = undefined, parsedArg = undefined, parsedArg2 = undefined) {\n return `replace(${name}, ${parsedArg}, ${parsedArg2})`;\n }\n\n printReplaceAllCall(node, identation, name = undefined, parsedArg = undefined, parsedArg2 = undefined) {\n return `replaceAll(${name}, ${parsedArg}, ${parsedArg2})`;\n }\n\n printPadEndCall(node, identation, name, parsedArg, parsedArg2) {\n return `padEnd(${name}, ${parsedArg}, ${parsedArg2})`;\n }\n\n printPadStartCall(node, identation, name, parsedArg, parsedArg2) {\n return `padStart(${name}, ${parsedArg}, ${parsedArg2})`;\n }\n\n printDateNowCall(node, identation) {\n return \"getCurrentTimestamp()\";\n }\n\n printLengthProperty(node, identation, name = undefined) {\n const leftSide = this.printNode(node.expression, 0);\n const type = (this.getChecker() as Checker).getTypeAtLocation(node.expression); // eslint-disable-line\n this.warnIfAnyType(node, type.flags, leftSide, \"length\");\n return this.isStringType(type.flags) ? `getStringLength(${leftSide})` : `${this.ARRAY_LENGTH_WRAPPER_OPEN}${leftSide}${this.ARRAY_LENGTH_WRAPPER_CLOSE}`;\n }\n\n printPostFixUnaryExpression(node, identation) {\n const {operand, operator} = node;\n if (operand.kind === SyntaxKind.NumericLiteral) {\n return super.printPostFixUnaryExpression(node, identation);\n }\n const leftSide = this.printNode(operand, 0);\n const op = this.PostFixOperators[operator];\n if (op === '--') {\n return `postFixDecrement(${leftSide})`;\n }\n return `postFixIncrement(${leftSide})`;\n }\n\n printPrefixUnaryExpression(node, identation) {\n const {operand, operator} = node;\n if (operand.kind === SyntaxKind.NumericLiteral) {\n return super.printPrefixUnaryExpression(node, identation);\n }\n if (operator === SyntaxKind.ExclamationToken) {\n // not branch check falsy/truthy values if needed;\n return this.PrefixFixOperators[operator] + this.printCondition(node.operand, 0);\n }\n const leftSide = this.printNode(operand, 0);\n if (operator === SyntaxKind.PlusToken) {\n return `prefixUnaryPlus(${leftSide})`;\n } else {\n return `prefixUnaryNeg(${leftSide})`;\n }\n }\n\n printConditionalExpression(node, identation) {\n const condition = this.printCondition(node.condition, 0);\n const whenTrue = this.printNode(node.whenTrue, 0);\n const whenFalse = this.printNode(node.whenFalse, 0);\n\n // wrap both branches in std::any so the ternary has one common type\n return `(${condition} ? std::any(${whenTrue}) : std::any(${whenFalse}))`;\n }\n\n printDeleteExpression(node, identation) {\n const object = this.printNode (node.expression.expression, 0);\n const key = this.printNode (node.expression.argumentExpression, 0);\n return `deleteKey(${object}, ${key})`;\n }\n\n printThrowStatement(node, identation) {\n if (node.expression.kind === SyntaxKind.Identifier) {\n return this.getIden(identation) + this.THROW_TOKEN + ' ' + this.printNode(node.expression, 0) + this.LINE_TERMINATOR;\n }\n if (node.expression.kind === SyntaxKind.NewExpression) {\n const expression = node.expression;\n // handle throw new Error (message) and throw new x[a] (message)\n const argumentsExp = expression?.arguments ?? [];\n const parsedArg = argumentsExp.map(n => this.printNode(n, 0)).join(\", \") ?? '';\n const newExpression = this.printNode(expression.expression, 0);\n if (expression.expression.kind === SyntaxKind.Identifier) {\n const id = expression.expression;\n const symbol = this.getChecker().getSymbolAtLocation(expression.expression);\n if (symbol) {\n const declarations = (this.getChecker().getDeclaredTypeOfSymbol(symbol).getSymbol()?.declarations ?? []).map((d) => d.resolve());\n const isClassDeclaration = declarations.find(l => l.kind === SyntaxKind.InterfaceDeclaration || l.kind === SyntaxKind.ClassDeclaration);\n if (isClassDeclaration){\n return this.getIden(identation) + `${this.THROW_TOKEN} ${id.text}(toString(${parsedArg}))${this.LINE_TERMINATOR}`;\n }\n return this.getIden(identation) + `throwDynamicException(${id.text}, ${parsedArg})${this.LINE_TERMINATOR}`;\n }\n return this.getIden(identation) + `${this.THROW_TOKEN} ${newExpression}(${parsedArg})${this.LINE_TERMINATOR}`;\n } else if (expression.expression.kind === SyntaxKind.ElementAccessExpression) {\n return this.getIden(identation) + `throwDynamicException(${newExpression}, ${parsedArg})${this.LINE_TERMINATOR}`;\n }\n return super.printThrowStatement(node, identation);\n }\n return super.printThrowStatement(node, identation);\n }\n\n getExceptionalAccessTokenIfAny(node) {\n const leftSide = node.expression;\n const leftSideText = this.printNode(leftSide, 0);\n if (leftSideText === this.THIS_TOKEN) {\n return '->';\n }\n return undefined;\n }\n}\n"]} \ No newline at end of file diff --git a/dist/transpiler.js b/dist/transpiler.js index cc6d4a3d..7cf462e5 100644 --- a/dist/transpiler.js +++ b/dist/transpiler.js @@ -12,7 +12,7 @@ import { symbolValueDeclaration, typeParts, typeTarget -} from "./chunk-VNDHHGGT.js"; +} from "./chunk-WD722H3U.js"; // src/dirname.cjs var require_dirname = __commonJS({ @@ -3248,6 +3248,10 @@ var CSharpTranspiler = class extends BaseTranspiler { if (listRead !== void 0) { return listRead; } + const keyRead = this.ELEMENT_ACCESS_WRAPPER_OPEN && !this.printElementAccessExpressionExceptionIfAny(node) ? this.csharpHx4IdentifierKeyRead(node.expression, node.argumentExpression) : void 0; + if (keyRead !== void 0) { + return keyRead; + } return super.printElementAccessExpression(node, identation); } csharpNativeElementAccess(node) { @@ -3384,8 +3388,7 @@ var CSharpTranspiler = class extends BaseTranspiler { if (csharpType === void 0) { return void 0; } - const func = this.csharpEnclosingFunction(node); - if (func === void 0 || this.csharpReceiverIsRewritten(func, expression)) { + if (!this.csharpHx4DeclaredReceiverReadable(node, expression)) { return void 0; } const receiver = this.printNode(expression, 0); @@ -5512,7 +5515,7 @@ var CSharpTranspiler = class extends BaseTranspiler { if (op === SyntaxKind4.PlusPlusToken || op === SyntaxKind4.MinusMinusToken) { return true; } - if (safeAccessor && op !== SyntaxKind4.ExclamationToken && csharpType !== "int" && csharpType !== "Int64" && csharpType !== "double") { + if (safeAccessor && op !== SyntaxKind4.ExclamationToken && csharpType !== "int" && csharpType !== "Int64" && csharpType !== "double" && !this.csharpHx4GuardedNullableNegation(parent, csharpType)) { return true; } } @@ -6649,7 +6652,7 @@ var CSharpTranspiler = class extends BaseTranspiler { if (operator === SyntaxKind4.PlusToken) { return `prefixUnaryPlus(ref ${leftSide})`; } - const nativeNegation = this.csharpNativeNegatedLocal(operand, leftSide); + const nativeNegation = this.csharpNativeNegatedLocal(operand, leftSide) ?? this.csharpHx4NativeNegatedNullableLocal(node, leftSide); if (nativeNegation !== void 0) { return nativeNegation; } @@ -7076,6 +7079,111 @@ var CSharpTranspiler = class extends BaseTranspiler { // } // return res; // } + // hx4 C01: a declared C# collection keeps its static type across every write, and the + // null/ContainsKey/Count test reads the live value, so only an enclosing function is needed + csharpHx4DeclaredReceiverReadable(node, expression) { + return this.csharpEnclosingFunction(node) !== void 0 && isIdentifier(expression); + } + // hx4 C11: `x[i]` / `m[k]` with an identifier key on a declared collection or a base dict field. + // The emission carries GetValue's own null/missing-key/past-the-end tests; a negative index + // throws in both. Key must be declared `int` (list) or `string`/`string?` (dictionary). + csharpHx4IdentifierKeyRead(expression, argumentExpression) { + if (!isIdentifier(argumentExpression) || !this.csharpHx4IsPlainRead(argumentExpression.parent)) { + return void 0; + } + const fieldTypes = { "has": "Dictionary", "features": "Dictionary", "timeframes": "Dictionary", "options": "ConcurrentDictionary", "markets": "IDictionary", "urls": "object", "currencies": "object" }; + let receiver; + let csharpType; + if (isPropertyAccessExpression(expression) && expression.expression.kind === SyntaxKind4.ThisKeyword && isIdentifier(expression.name) && Object.prototype.hasOwnProperty.call(fieldTypes, expression.name.text)) { + const field = this.printNode(expression, 0); + csharpType = fieldTypes[expression.name.text]; + receiver = csharpType === "object" ? `((IDictionary)${field})` : field; + const key = this.csharpHx4DeclaredKeyType(argumentExpression); + if (key !== "string" && key !== "string?") { + return void 0; + } + const printedKey2 = this.printNode(argumentExpression, 0); + return `(${field} != null && ${printedKey2} != null && ${receiver}.ContainsKey(${printedKey2}) ? ${receiver}[${printedKey2}] : null)`; + } + if (!isIdentifier(expression) || CSHARP_MARKET_RECEIVER_NAMES.indexOf(expression.text) >= 0) { + return void 0; + } + csharpType = this.csharpDeclaredCollectionType(expression); + if (csharpType === void 0) { + const printed = typeof this.csharpPrintedLocalType === "function" ? this.csharpPrintedLocalType(expression) : void 0; + csharpType = CSHARP_NATIVE_COLLECTION_TYPES.indexOf(printed) >= 0 ? printed : void 0; + } + if (csharpType === void 0 || this.csharpEnclosingFunction(expression) === void 0) { + return void 0; + } + receiver = this.printNode(expression, 0); + const printedKey = this.printNode(argumentExpression, 0); + const keyType = this.csharpHx4DeclaredKeyType(argumentExpression); + if (csharpType.indexOf("Dictionary<") >= 0) { + if (keyType !== "string" && keyType !== "string?") { + return void 0; + } + return `(${receiver} != null && ${printedKey} != null && ${receiver}.ContainsKey(${printedKey}) ? ${receiver}[${printedKey}] : null)`; + } + if (keyType !== "int") { + return void 0; + } + return `(${receiver} != null && ${printedKey} < ${receiver}.Count ? ${receiver}[${printedKey}] : null)`; + } + // a read that is no write target: not the left of any assignment, not ++/--, not delete + csharpHx4IsPlainRead(node) { + const parent = node?.parent; + if (parent?.kind === SyntaxKind4.BinaryExpression && parent.left === node && this.csharpIsAssignmentOperator(parent.operatorToken.kind)) { + return false; + } + return !isDeleteExpression(parent) && !isPrefixUnaryExpression(parent) && !isPostfixUnaryExpression(parent); + } + // the C# type the key identifier's emitted declaration carries: the printer's own table, then + // the build layer's declared-local hook (which retypes for-counters and string locals) + csharpHx4DeclaredKeyType(key) { + const typed = this.csharpTypedLocalType(key); + if (typed !== void 0) { + return typed; + } + const printed = typeof this.csharpPrintedLocalType === "function" ? this.csharpPrintedLocalType(key) : void 0; + if (printed !== void 0) { + return printed; + } + return typeof this.csharpLocalTypeOf === "function" ? this.csharpLocalTypeOf(key) : void 0; + } + // hx4 L44: `-x` on a local declared `double?` (a safeNumber read) inside a + // non-null guard on x (`if (x !== undefined)`, `x !== undefined && ...`, early exit). The guard + // proves the box is a number, so the local keeps its nullable scalar type and the negation is the + // helper's own in-place body `(x = -x)` (lifted: x is non-null here). Unguarded reads keep `object`. + csharpHx4GuardedNullableNegation(node, csharpType) { + if (csharpType !== "double?") { + return false; + } + if (!isPrefixUnaryExpression(node) || node.operator !== SyntaxKind4.MinusToken || !isIdentifier(node.operand)) { + return false; + } + return this.csharpNullGuardAdmitsRead(node, node.operand); + } + // the C# type the local's printed declaration finally carries; an embedding build layer that + // retypes `object x = ...` after printing overrides this with its own (final) answer + csharpHx4DeclaredLocalType(declaration) { + return this.getCSharpLocalType(declaration); + } + csharpHx4NativeNegatedNullableLocal(node, leftSide) { + const operand = node.operand; + if (!isIdentifier(operand)) { + return void 0; + } + const declaration = this.getChecker().getSymbolAtLocation(operand)?.valueDeclaration?.resolve(); + if (!declaration || !isVariableDeclaration(declaration) || declaration.parent?.declarations?.length !== 1) { + return void 0; + } + const declared = this.csharpHx4DeclaredLocalType(declaration); + if (!this.csharpHx4GuardedNullableNegation(node, declared)) { + return void 0; + } + return `(${leftSide} = -${leftSide})`; + } }; // src/transpiler.ts @@ -7813,6 +7921,13 @@ var GoTranspiler = class extends BaseTranspiler { // operand of a binary expression, -1 inside parentheses (never below 1), and // back to 1 for composite literal elements. this.goExprDepth = 1; + // hx4 G09 + // hand-written BaseExchange value fields (go/v4/exchange.go) read as `this.` + this.GO_G09_NUMERIC_FIELDS = { + "rateLimit": "float64", + "fetchHistoryCacheSize": "int", + "minFundingAddressLength": "int" + }; this.requiresParameterType = true; this.requiresReturnType = true; this.asyncTranspiling = false; @@ -8590,7 +8705,7 @@ func New${this.capitalize(this.className)}() *${this.className} { // text for a proven string, or the deref goNativeBinaryText adds for a derefable // `*string` leaf. undefined keeps the helper call. goStringConcatOperandType(node, printedText) { - if (this.goDerefableStringOperand(node)) { + if (this.goConcatDerefableStringOperand(node)) { return "string"; } return this.goOperandStaticType(node, printedText) === "string" ? "string" : void 0; @@ -8854,6 +8969,10 @@ func New${this.capitalize(this.className)}() *${this.className} { } return { "goType": "string", "text": this.goNativeBinaryText(node, "+", leftText, rightText) }; } + const widened = this.goNativeIntWideningArithmetic(node, leftType, rightType, leftText, rightText); + if (widened !== void 0) { + return widened; + } const goType = this.goNativeNumericResultType(op, leftType, rightType, node); if (goType === void 0) { return void 0; @@ -9001,7 +9120,7 @@ func New${this.capitalize(this.className)}() *${this.className} { const operandText = (operand, printed) => { const isBinary = operand?.kind === SyntaxKind5.BinaryExpression; const text = isBinary ? this.goWithExprDepth(this.goExprDepth, () => this.printNode(operand, 0)) : printed; - const leaf = this.goDerefableStringOperand(operand) ? "*" + text.trim() : text; + const leaf = this.goConcatDerefableStringOperand(operand) ? "*" + text.trim() : text; return this.goNativeOperandText(operand, leaf); }; const left = operandText(node.left, leftText); @@ -10083,7 +10202,7 @@ ${this.getIden(identation)}PanicOnError(${varName})`; } } if (ORDERED_COMPARISON_OPERATORS[op] !== void 0) { - const inlined = this.printInlineOrderedComparison(left, right, leftText, rightText, op); + const inlined = this.printInlineOrderedComparison(left, right, leftText, rightText, op) ?? this.printG09WideningComparison(left, right, leftText, rightText, op); if (inlined !== void 0) { return inlined; } @@ -10324,6 +10443,9 @@ ${this.getIden(identation)}PanicOnError(${varName})`; if (expr === void 0) { return true; } + if (this.goG02NonPointerAccessorSource(expr)) { + return true; + } switch (expr.kind) { case SyntaxKind5.NullKeyword: return true; @@ -10551,7 +10673,7 @@ ${this.getIden(identation)}PanicOnError(${varName})`; const index = fn.parameters.indexOf(param); if (!parseParam && !handlerParam) { const goType = this.goRequiredStringParameterType(param); - return goType !== void 0 && this.goHasTreeCallSite(fn) && this.goParameterCallSitesPassType(fn, index, goType) && this.goLocalIsSafeToType(fn.body, param, param.name.text, goType) && this.goParameterKeepsNilCompareNative(fn.body, param, goType) ? goType : void 0; + return goType !== void 0 && this.goHasTreeCallSite(fn) && this.goParameterCallSitesPassType(fn, index, goType) && this.goLocalIsSafeToType(fn.body, param, param.name.text, goType) && this.goParameterKeepsNilCompareNative(fn.body, param, goType) ? goType : this.g11NativeParameterType(fn, param, index); } if (this.isAsyncFunction(fn)) { return void 0; @@ -10561,7 +10683,7 @@ ${this.getIden(identation)}PanicOnError(${varName})`; return goType; } } - return void 0; + return handlerParam ? void 0 : this.g11NativeParameterType(fn, param, index); } goIsUnifiedStringParameter(methodName, index) { const indexes = Object.prototype.hasOwnProperty.call(this.unifiedStringParams, methodName) ? this.unifiedStringParams[methodName] : void 0; @@ -12369,7 +12491,7 @@ ${this.getIden(level)}}()`; switch (rightSide) { case "length": const type = this.getChecker().getTypeAtLocation(expression); - rawExpression = this.printInlineArrayLength(expression, leftSide, node) ?? (this.isStringType(type.flags) ? `GetLength(${leftSide})` : `${this.ARRAY_LENGTH_WRAPPER_OPEN}${leftSide}${this.ARRAY_LENGTH_WRAPPER_CLOSE}`); + rawExpression = this.printInlineArrayLength(expression, leftSide, node) ?? this.goHx4G06DerefLength(expression, leftSide, node) ?? (this.isStringType(type.flags) ? `GetLength(${leftSide})` : `${this.ARRAY_LENGTH_WRAPPER_OPEN}${leftSide}${this.ARRAY_LENGTH_WRAPPER_CLOSE}`); break; case "push": rawExpression = `((IList)${leftSide}).Add`; @@ -13341,7 +13463,7 @@ ${this.getIden(level)}}()`; return void 0; } printIndexOfCall(node, identation, name = void 0, parsedArg = void 0) { - const native = this.goNativeIndexOf(node, name, parsedArg); + const native = this.goHx4G06DerefIndexOf(node, name, parsedArg) ?? this.goNativeIndexOf(node, name, parsedArg); if (native !== void 0) { return native; } @@ -13359,7 +13481,7 @@ ${this.getIden(level)}}()`; } if (this.goOperandStaticType(operand, texts[i]) === expected[i]) { result.push(texts[i]); - } else if (expected[i] === "string" && !texts[i].includes("\n") && this.goDerefableStringOperand(operand)) { + } else if (expected[i] === "string" && !texts[i].includes("\n") && (this.goDerefableStringOperand(operand) || this.goLiteralUnionNarrowedStringDeref(operand))) { result.push("*" + texts[i].trim()); } else { return void 0; @@ -13444,7 +13566,7 @@ ${this.getIden(level)}}()`; if (receiver !== void 0 && this.goOperandStaticType(receiver, name) === "string") { return name; } - if (receiver !== void 0 && this.goDerefableStringOperand(receiver)) { + if (receiver !== void 0 && (this.goDerefableStringOperand(receiver) || this.goLiteralUnionNarrowedStringDeref(receiver))) { return "*" + name.trim(); } if (receiver !== void 0 && this.goOperandStaticType(receiver, name) === "int64" && this.goStdlibImportIsPlaceable()) { @@ -14041,7 +14163,7 @@ ${tryBodyBlock} case SyntaxKind5.CallExpression: return this.goTypeOfInitializer(node, printed); case SyntaxKind5.Identifier: - return this.goDeclaredTypeOfIdentifier(node); + return this.goDeclaredTypeOfIdentifier(node) ?? this.g01MapParamType(node); } return void 0; } @@ -14291,6 +14413,416 @@ ${this.getIden(level)}}()`; const lastStatement = statements[statements.length - 1]; return (isIfStatement2(lastStatement) || isTryStatement(lastStatement)) && this.hasReturnInBlock(lastStatement); } + // hx4 G01 + // a defaulted parameter bound through GetArgMap is a Go map[string]any; an element read of it + // indexes natively only where g01ReadOk proves the deref-free read answers what GetValue did + g01MapParamType(node) { + const checker = this.checkerOrUndefined(); + if (checker === void 0) { + return void 0; + } + let decl; + try { + decl = checker.getSymbolAtLocation(node)?.valueDeclaration?.resolve(); + } catch (e) { + return void 0; + } + if (decl?.kind !== SyntaxKind5.Parameter || this.goGetArgParameterType(decl) !== "map[string]any") { + return void 0; + } + const access = node.parent; + if (access?.kind === SyntaxKind5.ElementAccessExpression && access.expression === node && this.g01ReadOk(node, access) !== "map[string]any") { + return void 0; + } + return "map[string]any"; + } + // `receiver[k]` may replace GetValue(receiver, k) on a declared map[string]any: literal key, not a + // compared operand, not an element-write value (the ccxt write pass proves those from the helper + // spelling), and a market row or a consumer that derefScalars the value as GetValue did + g01ReadOk(receiver, access) { + if (this.goIsComparedOperand(access) || this.g01IsWriteValue(access) || !this.g01LiteralKey(access.argumentExpression)) { + return void 0; + } + return this.g01MarketRow(receiver) || this.x02CurrencyRow(receiver) || this.g01DerefConsumer(access) ? "map[string]any" : void 0; + } + // a string literal or a non-negative integer literal key + g01LiteralKey(key) { + return key?.kind === SyntaxKind5.StringLiteral || key?.kind === SyntaxKind5.NoSubstitutionTemplateLiteral || key?.kind === SyntaxKind5.NumericLiteral && /^\d+$/.test(`${key.text ?? ""}`); + } + // `y[k] = x["lit"]` + g01IsWriteValue(access) { + let operand = access; + while (operand.parent?.kind === SyntaxKind5.ParenthesizedExpression) { + operand = operand.parent; + } + const parent = operand.parent; + return parent?.kind === SyntaxKind5.BinaryExpression && parent.right === operand && parent.operatorToken?.kind === SyntaxKind5.EqualsToken && parent.left?.kind === SyntaxKind5.ElementAccessExpression; + } + // a Market-typed local written only by `this.market (…)` (or undefined): that accessor returns + // MarketTyped rows, whose values derefScalar leaves unchanged. Currency rows can hold *string values. + g01MarketRow(node) { + let type; + try { + type = this.getChecker().getTypeAtLocation(node); + } catch (e) { + return false; + } + const names = [type?.aliasSymbol?.name, type?.symbol?.name]; + if (!names.some((n) => ["Market", "MarketInterface"].includes(n))) { + return false; + } + const declaration = this.goDeclarationOfIdentifier(node); + const scope = declaration === void 0 ? void 0 : this.goEnclosingFunction(declaration); + if (scope === void 0) { + return false; + } + const isRow = (v) => v === void 0 || v.kind === SyntaxKind5.Identifier && v.text === "undefined" || v.kind === SyntaxKind5.CallExpression && v.expression?.kind === SyntaxKind5.PropertyAccessExpression && v.expression.expression?.kind === SyntaxKind5.ThisKeyword && v.expression.name?.text === "market"; + let ok = isRow(declaration.initializer); + const name = declaration.name?.text; + const visit = (n) => { + if (!ok) { + return; + } + if (n.kind === SyntaxKind5.BinaryExpression && n.left?.kind === SyntaxKind5.Identifier && n.left.text === name && n.operatorToken?.kind === SyntaxKind5.EqualsToken && this.goIdentifierRefersToDeclaration(n.left, declaration)) { + ok = isRow(n.right); + } else if (n.kind === SyntaxKind5.ArrayLiteralExpression && n.parent?.kind === SyntaxKind5.BinaryExpression && n.parent.left === n && n.elements.some((e) => e.kind === SyntaxKind5.Identifier && e.text === name)) { + ok = false; + } + n.forEachChild(visit); + }; + scope.forEachChild(visit); + return ok; + } + // the read is the container of an enclosing element read, an operand of `in`, or an argument of a + // SafeValueN-backed accessor (or safeCurrencyCode): each derefScalars it, so GetValue's deref is redundant + g01DerefConsumer(access) { + let operand = access; + while (operand.parent?.kind === SyntaxKind5.ParenthesizedExpression) { + operand = operand.parent; + } + const parent = operand.parent; + if (parent?.kind === SyntaxKind5.ElementAccessExpression && parent.expression === operand) { + return !this.isGoElementAccessAssignmentTarget(parent); + } + if (parent?.kind === SyntaxKind5.BinaryExpression && parent.operatorToken?.kind === SyntaxKind5.InKeyword) { + return true; + } + const callee = parent?.expression; + return parent?.kind === SyntaxKind5.CallExpression && parent.arguments.indexOf(operand) >= 0 && callee?.kind === SyntaxKind5.PropertyAccessExpression && callee.expression?.kind === SyntaxKind5.ThisKeyword && /^(?:safe(?:Value|String|StringLower|StringUpper|Integer|IntegerProduct|Float|Number|Bool|Timestamp|Dict|List)(?:2|N)?|safeCurrencyCode)$/.test(`${callee.name?.text ?? ""}`); + } + // hx4 G02 + // base safeValue/safeValue2/safeValueN (SafeValueN derefScalars every hit and its default) and + // ws cache constructors (non-nil, outside the derefScalar set): never a nil pointer IsEqual folds + goG02NonPointerAccessorSource(expr) { + if (expr?.kind === SyntaxKind5.ConditionalExpression) { + return this.goIsNonPointerValueSource(expr.whenTrue) && this.goIsNonPointerValueSource(expr.whenFalse); + } + if (expr?.kind === SyntaxKind5.NewExpression) { + const name = expr.expression?.kind === SyntaxKind5.Identifier ? expr.expression.text : void 0; + return GO_G02_CACHE_CLASSES.indexOf(name) >= 0; + } + if (expr?.kind !== SyntaxKind5.CallExpression) { + return false; + } + const callee = expr.expression; + if (callee?.kind !== SyntaxKind5.PropertyAccessExpression || callee.expression?.kind !== SyntaxKind5.ThisKeyword || callee.name?.kind !== SyntaxKind5.Identifier) { + return false; + } + const keys = GO_G02_SAFE_VALUE_KEYS[callee.name.text]; + if (keys === void 0 || expr.arguments.length > keys + 1) { + return false; + } + if (expr.arguments.length === keys + 1 && !this.goG02LiteralDefault(expr.arguments[keys])) { + return false; + } + const checker = this.checkerOrUndefined(); + const declarations = checker?.getSymbolAtLocation(callee.name)?.declarations?.map((d) => d.resolve()); + if (!declarations || declarations.length === 0) { + return false; + } + return declarations.every((d) => /(^|\/)ts\/src\/base\/Exchange\.ts$/.test(String(d.getSourceFile()?.fileName ?? "").replace(/\\/g, "/"))); + } + goG02LiteralDefault(node) { + node = this.goUnwrapParenthesizedNode(node); + switch (node?.kind) { + case SyntaxKind5.NullKeyword: + case SyntaxKind5.StringLiteral: + case SyntaxKind5.NoSubstitutionTemplateLiteral: + case SyntaxKind5.NumericLiteral: + case SyntaxKind5.TrueKeyword: + case SyntaxKind5.FalseKeyword: + case SyntaxKind5.ObjectLiteralExpression: + case SyntaxKind5.ArrayLiteralExpression: + return true; + case SyntaxKind5.Identifier: + return node.text === "undefined"; + } + return false; + } + // hx4 G06 + // a `*string` the checker narrows to string (or whose every write is a defaulted SafeString) + // is non-nil, so GetLength/GetArrayLength's deref + byte count is `len(*x)` + goHx4G06DerefLength(expression, printedText, lengthNode) { + if (expression?.kind !== SyntaxKind5.Identifier || printedText !== expression.text) { + return void 0; + } + if (this.goLengthFeedsArithmeticClassifier(lengthNode) || !this.goDerefableStringOperand(expression)) { + return void 0; + } + return `len(*${printedText})`; + } + // GetIndexOf on two operands that are Go strings once a proven-non-nil `*string` is deref'd: + // both sides reach the helper's `case string` arm, which is strings.Index + goHx4G06DerefIndexOf(node, name, parsedArg) { + if (typeof name !== "string" || typeof parsedArg !== "string" || name.includes("\n") || parsedArg.includes("\n")) { + return void 0; + } + if (!this.goFileKeepsFileLevelImports() || !this.goStdlibImportIsPlaceable()) { + return void 0; + } + const operands = [this.goUnwrapPrintedAssertions(node?.expression?.expression), this.goUnwrapPrintedAssertions(node?.arguments?.[0])]; + const texts = [name, parsedArg]; + if (!operands.some((o) => this.goDerefableStringOperand(o))) { + return void 0; + } + const out = []; + for (let i = 0; i < 2; i++) { + const o = operands[i]; + if (o?.kind === SyntaxKind5.Identifier && texts[i] === o.text && this.goDerefableStringOperand(o)) { + out.push("*" + texts[i]); + } else if (this.goIndexOfOperandType(o, texts[i]) === "string") { + out.push(texts[i]); + } else { + return void 0; + } + } + this.goFileStdlibImports.add("strings"); + return `strings.Index(${out[0]}, ${out[1]})`; + } + // hx4 G08 + // a `*string` local the checker narrowed to a union of string literals (`x === 'A' || x === 'B'`): + // every member is a string, so the Go pointer is non-nil at this read and may be dereferenced + goLiteralUnionNarrowedStringDeref(node) { + if (node?.kind !== SyntaxKind5.Identifier || this.goDeclaredTypeOfIdentifier(node) !== "*string") { + return false; + } + const checker = this.checkerOrUndefined(); + const type = checker?.getTypeAtLocation(node); + if (type === void 0 || (type.flags & TypeFlags4.Union) === 0) { + return false; + } + const members = type.getTypes?.() ?? []; + return members.length > 0 && members.every((member) => (member.flags & TypeFlags4.StringLiteral) !== 0); + } + // `this.rateLimit` & co.: only when the checker resolves the property to the base + // `class Exchange` declaration (a venue redeclaring it prints its own field) + goG09FieldKind(node) { + node = this.goUnwrapParenthesizedNode(node); + if (node?.kind !== SyntaxKind5.PropertyAccessExpression || node.expression?.kind !== SyntaxKind5.ThisKeyword) { + return void 0; + } + const kind = this.GO_G09_NUMERIC_FIELDS[node.name?.escapedText ?? node.name?.text]; + if (kind === void 0) { + return void 0; + } + const checker = this.checkerOrUndefined(); + const declaration = checker?.getSymbolAtLocation(node)?.valueDeclaration?.resolve(); + if (declaration?.kind !== SyntaxKind5.PropertyDeclaration || declaration.parent?.kind !== SyntaxKind5.ClassDeclaration) { + return void 0; + } + const className = declaration.parent.name?.escapedText ?? declaration.parent.name?.text; + return className === "Exchange" ? kind : void 0; + } + // [kind, pointer] of one ordered-comparison operand, undefined when unprovable + goG09OperandKind(node, text) { + const pointee = this.goOrderedComparisonPointerKind(node); + if (pointee !== void 0) { + return [pointee, true]; + } + const field = this.goG09FieldKind(node); + if (field !== void 0) { + return [field, false]; + } + const kind = this.goOperandNumericKind(node, text); + return kind === void 0 ? void 0 : [kind, false]; + } + // Ordered comparisons the phase-1 rule refuses only because the two concrete kinds differ + // (int vs int64, int/int64 vs float64) or an operand is a typed base field. The helper + // converts the narrower side exactly like `int64(x)` / `float64(x)`; nil and NaN rules stay. + printG09WideningComparison(left, right, leftText, rightText, op) { + const operator = ORDERED_COMPARISON_OPERATORS[op]; + if (operator === void 0) { + return void 0; + } + if (this.goIsNumericConstant(left) && this.goIsNumericConstant(right)) { + return void 0; + } + const l = this.goG09OperandKind(left, leftText); + const r = this.goG09OperandKind(right, rightText); + if (l === void 0 || r === void 0) { + return void 0; + } + let kind = this.goComparisonKind(left, l[0], right, r[0]); + let lv = l[1] ? `*${leftText}` : leftText; + let rv = r[1] ? `*${rightText}` : rightText; + if (kind === void 0) { + if (this.goIsNumericConstant(left) || this.goIsNumericConstant(right)) { + return void 0; + } + kind = l[0] === "float64" || r[0] === "float64" ? "float64" : "int64"; + if (l[0] !== kind) { + lv = `${kind}(${lv})`; + } + if (r[0] !== kind) { + rv = `${kind}(${rv})`; + } + } + if (kind === "float64" && (operator === "<" || operator === "<=")) { + return void 0; + } + const leftNil = l[1] && !this.goHasEnclosingNilGuard(left); + const rightNil = r[1] && !this.goHasEnclosingNilGuard(right); + if (leftNil && !r[1] && !this.goIsPureComparisonOperand(right) || rightNil && !l[1] && !this.goIsPureComparisonOperand(left)) { + return void 0; + } + const greater = operator === ">" || operator === ">="; + const cmp = `${lv} ${operator} ${rv}`; + if (!leftNil && !rightNil) { + return `(${cmp})`; + } + if (leftNil && !rightNil) { + return greater ? `(${leftText} != nil && ${cmp})` : `(${leftText} == nil || ${cmp})`; + } + if (!leftNil && rightNil) { + return greater ? `(${rightText} == nil || ${cmp})` : `(${rightText} != nil && ${cmp})`; + } + if (operator === ">") { + return `(${leftText} != nil && (${rightText} == nil || ${cmp}))`; + } + if (operator === ">=") { + return `(${rightText} == nil || (${leftText} != nil && ${cmp}))`; + } + if (operator === "<") { + return `(${rightText} != nil && (${leftText} == nil || ${cmp}))`; + } + return `(${leftText} == nil || (${rightText} != nil && ${cmp}))`; + } +}; +var GO_G02_SAFE_VALUE_KEYS = { "safeValue": 2, "safeValue2": 3, "safeValueN": 2 }; +var GO_G02_CACHE_CLASSES = ["ArrayCache", "ArrayCacheByTimestamp", "ArrayCacheBySymbolById", "ArrayCacheBySymbolBySide"]; +GoTranspiler.prototype.goNativeIntWideningArithmetic = function(node, leftType, rightType, leftText, rightText) { + const op = node.operatorToken.kind; + const isMod = op === SyntaxKind5.PercentToken && this.isNonZeroIntegerLiteral(node.right); + if (op !== SyntaxKind5.MinusToken && op !== SyntaxKind5.AsteriskToken && op !== SyntaxKind5.PlusToken && !isMod) { + return void 0; + } + const mixed = leftType === "int64" && rightType === "int" || leftType === "int" && rightType === "int64"; + const intKinds = ["int", "const-int"]; + const declaredInt64 = op !== SyntaxKind5.PlusToken && intKinds.includes(leftType) && intKinds.includes(rightType) && (leftType === "int" || rightType === "int") && this.goInsideTypedDeclarationInitializer(node); + if ((!mixed || isMod) && !declaredInt64) { + return void 0; + } + const operand = (operandNode, operandType, printed) => operandType === "int" ? "int64(" + this.goUnwrapPrintedParens(printed.trim()) + ")" : this.goNativeOperandText(operandNode, printed); + const left = operand(node.left, leftType, leftText); + const right = operand(node.right, rightType, rightText); + const symbol = this.SupportedKindNames[op]; + const separator = this.goBinarySeparator(symbol, right, node.left, node.right); + return { "goType": "int64", "text": left + separator + symbol + separator + right }; +}; +GoTranspiler.prototype.goStringLiteralUnionType = function(type) { + if (type === void 0 || (type.flags & TypeFlags4.Union) === 0) { + return false; + } + const members = type.getTypes(); + return members.length > 0 && members.every((member) => (member.flags & TypeFlags4.StringLike) !== 0); +}; +GoTranspiler.prototype.goConcatDerefableStringOperand = function(node) { + if (this.goDerefableStringOperand(node)) { + return true; + } + if (node?.kind !== SyntaxKind5.Identifier || this.goDeclaredTypeOfIdentifier(node) !== "*string") { + return false; + } + const checker = this.checkerOrUndefined(); + return checker !== void 0 && this.goStringLiteralUnionType(checker.getTypeAtLocation(node)); +}; +GoTranspiler.prototype.x02CurrencyRow = function(node) { + let type; + try { + type = this.getChecker().getTypeAtLocation(node); + } catch (e) { + return false; + } + const named = (t) => [t?.getAliasSymbol?.()?.name, t?.getSymbol?.()?.name].some((n) => ["Currency", "CurrencyInterface"].includes(n)); + const members = typeof type?.isUnionType === "function" && type.isUnionType() ? type.getTypes() : [type]; + if (!named(type) && !members.some((t) => named(t))) { + return false; + } + const declaration = this.goDeclarationOfIdentifier(node); + const scope = declaration === void 0 ? void 0 : this.goEnclosingFunction(declaration); + if (scope === void 0) { + return false; + } + const isRow = (v) => v === void 0 || v.kind === SyntaxKind5.Identifier && v.text === "undefined" || v.kind === SyntaxKind5.CallExpression && v.expression?.kind === SyntaxKind5.PropertyAccessExpression && v.expression.expression?.kind === SyntaxKind5.ThisKeyword && ["currency", "safeCurrency"].includes(v.expression.name?.text); + let ok = isRow(declaration.initializer); + const name = declaration.name?.text; + const visit = (n) => { + if (!ok) { + return; + } + if (n.kind === SyntaxKind5.BinaryExpression && n.left?.kind === SyntaxKind5.Identifier && n.left.text === name && n.operatorToken?.kind === SyntaxKind5.EqualsToken && this.goIdentifierRefersToDeclaration(n.left, declaration)) { + ok = isRow(n.right); + } else if (n.kind === SyntaxKind5.ArrayLiteralExpression && n.parent?.kind === SyntaxKind5.BinaryExpression && n.parent.left === n && n.elements.some((e) => e.kind === SyntaxKind5.Identifier && e.text === name)) { + ok = false; + } + n.forEachChild(visit); + }; + scope.forEachChild(visit); + return ok; +}; +GoTranspiler.prototype.g11NativeParameterType = function(fn, param, index) { + if (this.isAsyncFunction(fn) || !this.goHasTreeCallSite(fn)) { + return void 0; + } + const candidates = []; + const type = this.checkerOrUndefined()?.getTypeAtLocation(param); + if (type !== void 0) { + const all = typeof type.isUnionType === "function" && type.isUnionType() ? type.getTypes() : [type]; + const parts = all.filter((p) => !(p.flags & (TypeFlags4.Undefined | TypeFlags4.Null))); + if (parts.length > 0 && parts.every((p) => (p.flags & (TypeFlags4.String | TypeFlags4.StringLiteral)) !== 0)) { + candidates.push("string"); + } + } + for (const goType of this.goNativeParameterTypeCandidates(param).concat(this.g13NumericParameterCandidates(param))) { + if (!candidates.includes(goType)) { + candidates.push(goType); + } + } + for (const goType of candidates) { + if (this.goParameterCallSitesPassType(fn, index, goType) && this.goLocalIsSafeToType(fn.body, param, param.name.text, goType) && (goType.startsWith("*") || this.goParameterKeepsNilCompareNative(fn.body, param, goType)) && (goType.startsWith("*") || !this.g11ParameterHasNullishDefault(fn.body, param))) { + return goType; + } + } + return void 0; +}; +GoTranspiler.prototype.g11ParameterHasNullishDefault = function(body, param) { + const name = param.name.text; + return this.hasNodeWhere(body, (n) => { + const parent = n.parent; + return n.kind === SyntaxKind5.Identifier && n.text === name && parent?.kind === SyntaxKind5.BinaryExpression && parent.left === n && (parent.operatorToken.kind === SyntaxKind5.QuestionQuestionToken || parent.operatorToken.kind === SyntaxKind5.QuestionQuestionEqualsToken); + }); +}; +GoTranspiler.prototype.g13NumericParameterCandidates = function(param) { + const declared = param?.type !== void 0 ? String(param.type.getText()).trim() : void 0; + switch (declared) { + case "Int": + return ["*int64"]; + case "Num": + return ["*float64"]; + case "number": + return ["int64", "float64"]; + } + return []; }; // src/javaTranspiler.ts @@ -14739,6 +15271,8 @@ var JavaTranspiler = class extends BaseTranspiler { this.csModifiers = {}; // literals printed as `Helpers.newMap(k, v, ...)` (no anonymous class, so no capture rule) this.builderObjectLiterals = /* @__PURE__ */ new WeakSet(); + this.javaHx4SourceVerdicts = /* @__PURE__ */ new WeakMap(); + this.javaHx4InProgress = /* @__PURE__ */ new Set(); this.requiresParameterType = true; this.requiresReturnType = true; this.asyncTranspiling = true; @@ -17296,6 +17830,9 @@ var JavaTranspiler = class extends BaseTranspiler { if (keys.length === 1 && this.javaDeclaredMapReceiver(baseExpr) && (isStringLiteralLikeNode3(keys[0]) || this.javaDeclaredStringType(keys[0])) && this.javaPrintsNonNullValue(right)) { return `${prefixes}${acc}.put(${lastKey}, ${rhs})`; } + if (this.javaHx4MapPutIsNative(baseExpr, keys)) { + return `${prefixes}${acc}.put(${keyArg}, ${rhs})`; + } return `${prefixes}Helpers.addElementToObject(${acc}, ${lastKey}, ${rhs})`; } if (op === SyntaxKind6.InKeyword) { @@ -17323,6 +17860,10 @@ var JavaTranspiler = class extends BaseTranspiler { } return `Helpers.inOp(${objText}, ${keyText})`; } + const hx4J05 = this.printHx4J05ModComparison(left, right, op); + if (hx4J05 !== void 0) { + return hx4J05; + } if (op === SyntaxKind6.LessThanToken || op === SyntaxKind6.GreaterThanToken || op === SyntaxKind6.LessThanEqualsToken || op === SyntaxKind6.GreaterThanEqualsToken) { const leftKind = this.javaPrimitiveOperandKind(left); const rightKind = this.javaPrimitiveOperandKind(right); @@ -17578,7 +18119,7 @@ var JavaTranspiler = class extends BaseTranspiler { const name = receiver.name?.text; const field = typeof name === "string" ? JAVA_FIELD_TYPES[name] : void 0; if (field === void 0 || field.map !== true) { - return void 0; + return this.javaJ02FieldMapReadText(receiver, key); } const keyText = this.printNode(key, 0); let keyGuarded = false; @@ -19712,7 +20253,7 @@ var JavaTranspiler = class extends BaseTranspiler { return void 0; } printIndexOfCall(node, _identation, name = void 0, parsedArg = void 0) { - return this.javaNativeIndexOfCall(node, name, parsedArg) ?? `${this.INDEXOF_WRAPPER_OPEN}${name}, ${parsedArg}${this.INDEXOF_WRAPPER_CLOSE}`; + return this.javaNativeIndexOfCall(node, name, parsedArg) ?? this.javaHx4J06NarrowedIndexOf(node, name, parsedArg) ?? `${this.INDEXOF_WRAPPER_OPEN}${name}, ${parsedArg}${this.INDEXOF_WRAPPER_CLOSE}`; } printSearchCall(_node, _identation, name = void 0, parsedArg = void 0) { return `((String)${name}).indexOf(${parsedArg})`; @@ -20698,13 +21239,525 @@ var JavaTranspiler = class extends BaseTranspiler { } return false; } -}; - -// src/rustTranspiler.ts -init_esm_shims(); -import { SyntaxKind as SyntaxKind7 } from "typescript/unstable/ast"; -import { isArrayLiteralExpression as isArrayLiteralExpression4, isArrowFunction as isArrowFunction5, isAsExpression as isAsExpression3, isBinaryExpression as isBinaryExpression5, isBindingElement, isBlock as isBlock4, isCallExpression as isCallExpression6, isClassDeclaration as isClassDeclaration4, isClassExpression as isClassExpression2, isConditionalExpression as isConditionalExpression3, isDeleteExpression as isDeleteExpression2, isElementAccessExpression as isElementAccessExpression4, isForInStatement as isForInStatement2, isForOfStatement as isForOfStatement2, isIdentifier as isIdentifier3, isMethodDeclaration as isMethodDeclaration5, isNoSubstitutionTemplateLiteral, isNonNullExpression as isNonNullExpression2, isNumericLiteral as isNumericLiteral4, isObjectLiteralExpression as isObjectLiteralExpression4, isParameterDeclaration as isParameterDeclaration3, isParenthesizedExpression as isParenthesizedExpression3, isPrefixUnaryExpression as isPrefixUnaryExpression3, isPropertyAccessExpression as isPropertyAccessExpression3, isReturnStatement as isReturnStatement4, isShorthandPropertyAssignment as isShorthandPropertyAssignment2, isSourceFile as isSourceFile5, isStatement, isStringLiteral as isStringLiteral3, isStringLiteralLikeNode as isStringLiteralLikeNode4, isTypeAssertion as isTypeAssertion3, isVariableDeclaration as isVariableDeclaration3 } from "typescript/unstable/ast/is"; -import { IndexKind as IndexKind4, ObjectFlags, SignatureKind as SignatureKind2, SymbolFlags as SymbolFlags3, TypeFlags as TypeFlags6 } from "typescript/unstable/sync"; + // hx4 J01: `m[k] = v` on a local the printer declared `Map` whose every write is a + // provably non-concurrent map (fresh literal/extend/omit, or a base safeDict* of non-field data): + // the helper's map branch is then `m.put(k, v)` (null value included; its CHM removal never applies) + javaHx4MapPutIsNative(baseExpr, keys) { + if (keys.length !== 1 || baseExpr === void 0 || !isIdentifier2(baseExpr) || !this.javaDeclaredMapReceiver(baseExpr)) { + return false; + } + const key = keys[0]; + if (!isStringLiteralLikeNode3(key) && !this.javaDeclaredStringType(key) && !this.isJavaStringType(this.getChecker().getTypeAtLocation(key))) { + return false; + } + const declaration = this.javaDeclarationOfIdentifier(baseExpr); + if (declaration === void 0 || declaration.kind !== SyntaxKind6.VariableDeclaration || !declaration.initializer) { + return false; + } + const admits = (rhs) => this.javaHx4PlainMapSource(baseExpr, rhs); + return admits(declaration.initializer) && !this.javaLocalIsReassigned(baseExpr, admits); + } + javaHx4PlainMapSource(container, value) { + const node = this.unwrapPrintTransparentExpression(value); + if (node === void 0) { + return false; + } + if (this.javaFreshHashMapValue(container, node)) { + return true; + } + if (!isCallExpression5(node) || !isPropertyAccessExpression2(node.expression) || node.expression.expression.kind !== SyntaxKind6.ThisKeyword) { + return false; + } + const name = node.expression.name.text; + const fileName = this.checkerOrUndefined()?.getResolvedSignature(node)?.declaration?.resolve()?.getSourceFile?.()?.fileName; + if (typeof fileName !== "string" || !JAVA_FRESH_EXTEND_FILE.test(fileName)) { + return false; + } + if (name === "extend" || name === "deepExtend" || name === "omit") { + return true; + } + if (name === "safeDict" || name === "safeDict2" || name === "safeDictN") { + return node.arguments.length > 0 && this.javaHx4NonSharedSource(node.arguments[0], 0) && (node.arguments.length < (name === "safeDict2" ? 4 : 3) || this.javaHx4DefaultIsPlain(node.arguments[node.arguments.length - 1])); + } + return false; + } + javaHx4DefaultIsPlain(value) { + const node = this.unwrapPrintTransparentExpression(value); + return node !== void 0 && (isObjectLiteralExpression3(node) || node.kind === SyntaxKind6.UndefinedKeyword || isIdentifier2(node) && node.text === "undefined" || node.kind === SyntaxKind6.NullKeyword); + } + // data that can not hold one of the runtime's ConcurrentHashMaps (this. top level, ws client + // futures/subscriptions/rejections and their entries): a local/param/element chain not rooted at them + javaHx4NonSharedSource(value, depth) { + const node = this.unwrapPrintTransparentExpression(value); + if (node === void 0 || depth > 40) { + return false; + } + if (isElementAccessExpression3(node)) { + return this.javaHx4NonSharedSource(node.expression, depth + 1); + } + if (!isIdentifier2(node)) { + return false; + } + const declaration = this.javaDeclarationOfIdentifier(node); + if (declaration === void 0) { + return false; + } + if (declaration.kind === SyntaxKind6.Parameter) { + const type = this.getChecker().getTypeAtLocation(node); + const text = (type?.getSymbol?.()?.escapedName ?? "") + ""; + return !/Client/.test(text) && !/^(client|subscriptions|futures|rejections)$/.test(node.text); + } + const known = this.javaHx4SourceVerdicts.get(declaration); + if (known !== void 0) { + return known; + } + this.javaHx4SourceVerdicts.set(declaration, true); + this.javaHx4InProgress.add(declaration); + const writes = declaration.initializer ? [declaration.initializer] : []; + const verdict = !this.javaLocalIsReassigned(node, (rhs) => { + writes.push(rhs); + return true; + }) && writes.every((w) => this.javaHx4NonSharedValue(w, depth + 1)); + this.javaHx4InProgress.delete(declaration); + if (verdict && this.javaHx4InProgress.size > 0) { + this.javaHx4SourceVerdicts.delete(declaration); + } else { + this.javaHx4SourceVerdicts.set(declaration, verdict); + } + return verdict; + } + // a value expression that never reads a field map or a ws client's maps + javaHx4NonSharedValue(value, depth) { + let shared = false; + const walk = (n) => { + if (shared || n === void 0) { + return; + } + if (isPropertyAccessExpression2(n)) { + const called = n.parent !== void 0 && isCallExpression5(n.parent) && n.parent.expression === n; + if (!called && (n.expression.kind === SyntaxKind6.ThisKeyword || /^(subscriptions|futures|rejections|hashmap)$/.test(n.name.text)) || called && n.name.text === "createSafeDictionary") { + shared = true; + return; + } + } + if (n.kind === SyntaxKind6.ThisKeyword && !(n.parent !== void 0 && isPropertyAccessExpression2(n.parent))) { + shared = true; + return; + } + if (isIdentifier2(n) && n !== value && !(n.parent !== void 0 && isPropertyAccessExpression2(n.parent) && n.parent.name === n)) { + const declaration = this.javaDeclarationOfIdentifier(n); + if (declaration !== void 0 && !this.javaHx4NonSharedSource(n, depth + 1)) { + shared = true; + return; + } + } + n.forEachChild(walk); + }; + walk(value); + return !shared; + } + // hx4 J02: `this.[k]` on the J02 base map fields. ConcurrentHashMap.get(null) throws + // where the helper answers null, so a non-literal key is always null-tested; the receiver can + // be null too. Key and receiver print twice, so both must be side-effect free. + javaJ02FieldMapReadText(receiver, key) { + const name = receiver?.name?.text; + if (typeof name !== "string" || !Object.prototype.hasOwnProperty.call(JAVA_J02_MAP_FIELDS, name)) { + return void 0; + } + const literal = isStringLiteralLikeNode3(key); + if (!literal && !this.javaRepeatableOperand(key)) { + return void 0; + } + const target = this.printNode(receiver, 0); + const keyText = this.printNode(key, 0); + const keyGuard = literal ? "" : `${keyText} == null || `; + return `(${keyGuard}${target} == null ? null : ((java.util.Map)${target}).get(${keyText}))`; + } + // hx4 J05 + // `(a % N) M` (N a non-zero integer literal, a an int/long operand, M an int literal): the + // native mod prints a finite integral double |v| < |N|, where isEqual (IsInteger -> toLong) and + // isGreaterThan (toDouble) both reduce to the plain double comparison against M. + javaHx4J05IntegralModOperand(node) { + while (node !== void 0 && node.kind === SyntaxKind6.ParenthesizedExpression) { + node = node.expression; + } + if (node === void 0 || !isBinaryExpression4(node) || node.operatorToken.kind !== SyntaxKind6.PercentToken) { + return false; + } + if (this.javaScalarFamily(node.left) !== "number" || this.javaScalarFamily(node.right) !== "number") { + return false; + } + const leftKind = this.javaProvableNumericKind(node.left); + if (leftKind !== "int" && leftKind !== "long" && !this.javaProvableCounterInt(node.left)) { + return false; + } + const divisor = node.right; + if (this.javaIntegerLiteralKind(divisor) !== "int" || Number(divisor.text) === 0) { + return false; + } + return true; + } + printHx4J05ModComparison(left, right, op) { + const javaOps = { + [SyntaxKind6.EqualsEqualsToken]: "==", + [SyntaxKind6.EqualsEqualsEqualsToken]: "==", + [SyntaxKind6.ExclamationEqualsToken]: "!=", + [SyntaxKind6.ExclamationEqualsEqualsToken]: "!=", + [SyntaxKind6.LessThanToken]: "<", + [SyntaxKind6.LessThanEqualsToken]: "<=", + [SyntaxKind6.GreaterThanToken]: ">", + [SyntaxKind6.GreaterThanEqualsToken]: ">=" + }; + const javaOp = javaOps[op]; + if (javaOp === void 0) { + return void 0; + } + const modLeft = this.javaHx4J05IntegralModOperand(left); + const modRight = !modLeft && this.javaHx4J05IntegralModOperand(right); + if (!modLeft && !modRight) { + return void 0; + } + if (this.javaEqualityLiteralKind(modLeft ? right : left) !== "int") { + return void 0; + } + const leftText = this.printNode(left, 0); + const rightText = this.printNode(right, 0); + if (!/^\(+double\) /.test(modLeft ? leftText : rightText)) { + return void 0; + } + return `(${leftText} ${javaOp} ${rightText})`; + } + // hx4 J06 + // `x.indexOf(t)` where a string/Str-declared x is narrowed to a union of string literals + // (`===` tests): x is a non-null String, so String.indexOf is the helper's String arm + javaHx4J06NarrowedIndexOf(node, name, parsedArg) { + const receiver = node?.expression?.expression; + const arg = node?.arguments?.[0]; + if (receiver === void 0 || arg === void 0 || name === void 0 || parsedArg === void 0 || !isIdentifier2(receiver) || this.isVarargsArrayReference(receiver)) { + return void 0; + } + let receiverType; + try { + receiverType = this.getChecker().getTypeAtLocation(receiver); + } catch (e) { + return void 0; + } + if (receiverType === void 0 || (receiverType.flags & TypeFlags5.Union) === 0 || !receiverType.getTypes().every((member) => this.isStringType(member.flags))) { + return void 0; + } + const symbol = this.getChecker().getSymbolAtLocation(receiver); + const declaration = symbol?.valueDeclaration?.resolve?.() ?? symbol?.valueDeclaration; + let declared; + try { + declared = declaration?.name === void 0 ? void 0 : this.getChecker().getTypeAtLocation(declaration.name); + } catch (e) { + declared = void 0; + } + const declaredMembers = declared === void 0 ? [] : (declared.flags & TypeFlags5.Union) !== 0 ? declared.getTypes() : [declared]; + if (!declaredMembers.some((member) => member.flags === TypeFlags5.String)) { + return void 0; + } + if (this.javaProvableString(arg)) { + return `((String)${name}).indexOf(${parsedArg})`; + } + return void 0; + } +}; +var JAVA_J02_MAP_FIELDS = { + "tickers": true, + "bidsasks": true, + "trades": true, + "fees": true, + "urls": true, + "markets_by_id": true +}; +var HX4_J09_SYNC_BASE_CALLS = /* @__PURE__ */ new Set([ + "safeString", + "safeString2", + "safeStringN", + "safeValue", + "safeDict", + "safeInteger", + "json", + "throwExactlyMatchedException", + "throwBroadlyMatchedException" +]); +JavaTranspiler.prototype.hx4J09CcxtErrorClass = function(node) { + const checker = this.checkerOrUndefined(); + let symbol; + try { + symbol = checker?.getSymbolAtLocation(node); + if (symbol !== void 0 && symbol.flags & SymbolFlags2.Alias) { + symbol = checker.getAliasedSymbol(symbol); + } + } catch (e) { + return false; + } + const declaration = symbol?.declarations?.[0]?.resolve(); + return declaration?.kind === SyntaxKind6.ClassDeclaration && /(^|[\\/])ts[\\/]src[\\/]base[\\/]errors\.ts$/.test(declaration.getSourceFile?.()?.fileName ?? ""); +}; +JavaTranspiler.prototype.hx4J09BoxIdentifier = function(node, seen, depth) { + const checker = this.checkerOrUndefined(); + if (checker === void 0 || node?.kind !== SyntaxKind6.Identifier || depth > 6) { + return false; + } + const symbol = checker.getSymbolAtLocation(node); + const decl = symbol?.valueDeclaration?.resolve(); + if (decl === void 0 || decl.name?.text !== node.text) { + return false; + } + if (seen.has(decl)) { + return true; + } + const next = new Set(seen); + next.add(decl); + const accepts = (value) => this.hx4J09BoxValue(value, next, depth + 1); + if (decl.kind === SyntaxKind6.BindingElement) { + const pattern = decl.parent; + const declaration = pattern?.parent; + if (decl.initializer !== void 0 || decl.dotDotDotToken !== void 0 || pattern?.kind !== SyntaxKind6.ArrayBindingPattern || declaration?.kind !== SyntaxKind6.VariableDeclaration) { + return false; + } + const index = pattern.elements.indexOf(decl); + if (!this.javaBooleanBoxTupleElement(declaration.initializer, index) && !this.hx4J09LiteralTupleElement(declaration.initializer, index)) { + return false; + } + return this.javaWritesAreBoxed(symbol, { initializer: void 0, parent: declaration }, next, accepts, true); + } + if (decl.kind !== SyntaxKind6.VariableDeclaration) { + return false; + } + let type; + try { + type = this.javaTypeOfDeclaration(decl); + } catch (e) { + return false; + } + if (!this.javaBooleanBoxType(type) && !this.javaNullableBooleanDeclaration(decl)) { + return false; + } + return this.javaWritesAreBoxed(symbol, decl, next, accepts, true); +}; +JavaTranspiler.prototype.hx4J09BoxValue = function(node, seen, depth) { + if (node === void 0) { + return false; + } + if (node.kind === SyntaxKind6.ParenthesizedExpression || node.kind === SyntaxKind6.AsExpression || node.kind === SyntaxKind6.NonNullExpression) { + return this.hx4J09BoxValue(node.expression, seen, depth); + } + if (node.kind === SyntaxKind6.NullKeyword || node.kind === SyntaxKind6.Identifier && node.text === "undefined") { + return true; + } + if (node.kind === SyntaxKind6.ConditionalExpression) { + return this.hx4J09BoxValue(node.whenTrue, seen, depth) && this.hx4J09BoxValue(node.whenFalse, seen, depth); + } + if (node.kind === SyntaxKind6.Identifier) { + return this.hx4J09BoxIdentifier(node, seen, depth); + } + if (this.javaPrintsBooleanValue(node, /* @__PURE__ */ new Set())) { + return true; + } + if (node.kind !== SyntaxKind6.CallExpression) { + return false; + } + if (this.javaCallBooleanKind(node) !== void 0) { + return true; + } + const callee = node.expression; + if (!isPropertyAccessExpression2(callee) || callee.expression.kind !== SyntaxKind6.ThisKeyword) { + return false; + } + const at = JAVA_THIS_BOOLEAN_BOX_METHODS[String(callee.name.text)]; + if (at === void 0 || this.javaBooleanValueKind(node) === void 0 || !this.javaCalleeResolves(node)) { + return false; + } + const declaration = this.getChecker().getResolvedSignature(node)?.declaration?.resolve(); + if (declaration?.name?.text !== callee.name.text || !JAVA_THIS_RETURN_TYPES_BASE_FILE.test(declaration.getSourceFile?.()?.fileName ?? "")) { + return false; + } + const fallback = node.arguments?.[at]; + return fallback !== void 0 && this.hx4J09BoxValue(fallback, seen, depth); +}; +JavaTranspiler.prototype.hx4J09LiteralTupleElement = function(node, index) { + if (node?.kind !== SyntaxKind6.CallExpression || index < 0) { + return false; + } + const callee = node.expression; + if (!isPropertyAccessExpression2(callee) || callee.expression.kind !== SyntaxKind6.ThisKeyword) { + return false; + } + let declaration; + try { + declaration = this.getChecker().getResolvedSignature(node)?.declaration?.resolve(); + } catch (e) { + return false; + } + if (declaration?.kind !== SyntaxKind6.MethodDeclaration || declaration.body === void 0 || declaration.name?.text !== callee.name.text || !JAVA_THIS_RETURN_TYPES_BASE_FILE.test(declaration.getSourceFile?.()?.fileName ?? "")) { + return false; + } + let returns = 0; + let ok = true; + const scan = (current) => { + if (!ok || current !== declaration && isFunctionLike(current)) { + return; + } + if (isReturnStatement3(current)) { + returns++; + const value = current.expression; + if (value === void 0 || !isArrayLiteralExpression3(value) || !this.javaPrintsBooleanValue(value.elements[index], /* @__PURE__ */ new Set())) { + ok = false; + return; + } + } + current.forEachChild(scan); + }; + scan(declaration.body); + return ok && returns > 0; +}; +JavaTranspiler.prototype.hx4J09CatchCannotWrap = function(node) { + if (node?.kind !== SyntaxKind6.Identifier) { + return false; + } + const checker = this.checkerOrUndefined(); + const decl = checker?.getSymbolAtLocation(node)?.valueDeclaration?.resolve(); + const clause = decl?.parent; + const tryStatement = clause?.parent; + if (decl?.kind !== SyntaxKind6.VariableDeclaration || clause?.kind !== SyntaxKind6.CatchClause || tryStatement?.kind !== SyntaxKind6.TryStatement || tryStatement.catchClause !== clause) { + return false; + } + let ok = true; + const scan = (current) => { + if (!ok) { + return; + } + if (isFunctionLike(current) || current.kind === SyntaxKind6.AwaitExpression || current.kind === SyntaxKind6.TryStatement) { + ok = false; + return; + } + if (current.kind === SyntaxKind6.CallExpression) { + const callee = current.expression; + if (!isPropertyAccessExpression2(callee) || callee.expression.kind !== SyntaxKind6.ThisKeyword || !HX4_J09_SYNC_BASE_CALLS.has(String(callee.name.text))) { + ok = false; + return; + } + const declaration = checker.getResolvedSignature(current)?.declaration?.resolve(); + if (declaration === void 0 || !JAVA_THIS_RETURN_TYPES_BASE_FILE.test(declaration.getSourceFile?.()?.fileName ?? "")) { + ok = false; + return; + } + } + current.forEachChild(scan); + }; + scan(tryStatement.tryBlock); + return ok; +}; +JavaTranspiler.prototype.hx4J09CoreArgument = function(type, printed, node) { + if (node === void 0 || !isIdentifier2(node) || printed !== node.text || type !== "Long" && type !== "String") { + return void 0; + } + const declaration = this.javaDeclarationOfIdentifier(node); + if (declaration === void 0 || !isVariableDeclaration2(declaration) || declaration.name?.text !== node.text || (getCombinedNodeFlags(declaration) & NodeFlags.Const) === 0) { + return void 0; + } + const initializer = declaration.initializer; + if (initializer !== void 0 && isIdentifier2(initializer) && initializer.text === "undefined") { + return `(${type}) null`; + } + if (type === "Long" && initializer !== void 0 && isPropertyAccessExpression2(initializer) && initializer.name.text === "length" && this.javaDeclaredTypeOf(node) === "Integer") { + return `((long) ${printed})`; + } + return void 0; +}; +{ + const proto = JavaTranspiler.prototype; + const printCondition = proto.printCondition; + proto.printCondition = function(node, identation) { + const printed = printCondition.call(this, node, identation); + let inner = node; + while (inner?.kind === SyntaxKind6.ParenthesizedExpression) { + inner = inner.expression; + } + if (inner?.kind === SyntaxKind6.Identifier && printed.trimStart().startsWith(this.FALSY_WRAPPER_OPEN) && this.hx4J09BoxIdentifier(inner, /* @__PURE__ */ new Set(), 0)) { + return this.getIden(identation) + `Boolean.TRUE.equals(${this.printNode(inner, 0)})`; + } + return printed; + }; + const printInstanceOfExpression = proto.printInstanceOfExpression; + proto.printInstanceOfExpression = function(node, identation) { + if (node.right?.kind === SyntaxKind6.Identifier && this.hx4J09CcxtErrorClass(node.right) && this.hx4J09CatchCannotWrap(node.left)) { + return this.getIden(identation) + `(${this.printNode(node.left, 0)} instanceof ${node.right.text})`; + } + return printInstanceOfExpression.call(this, node, identation); + }; + const javaConvertToCoreType = proto.javaConvertToCoreType; + proto.javaConvertToCoreType = function(type, printed, node) { + return this.hx4J09CoreArgument(type, printed, node) ?? javaConvertToCoreType.call(this, type, printed, node); + }; +} +{ + const proto = JavaTranspiler.prototype; + const printNativeEquality = proto.printNativeEqualityIfProvable; + proto.printNativeEqualityIfProvable = function(node, leftText, rightText) { + const op = node?.operatorToken?.kind; + const negated = op === SyntaxKind6.ExclamationEqualsToken || op === SyntaxKind6.ExclamationEqualsEqualsToken; + if (negated || op === SyntaxKind6.EqualsEqualsToken || op === SyntaxKind6.EqualsEqualsEqualsToken) { + const left = this.javaDeclaredNumericFamily(node.left); + const right = this.javaDeclaredNumericFamily(node.right); + const isBool = (n) => String(this.javaDeclaredTypeOf(n) ?? "").trim() === "Boolean"; + if (isBool(node.left) || isBool(node.right)) { + return `${negated ? "!" : ""}java.util.Objects.equals(${leftText}, ${rightText})`; + } + if (JAVA_BOXED_NUMERIC_TYPES.has(left) && JAVA_BOXED_NUMERIC_TYPES.has(right)) { + let equal; + if (left === right && left !== "Double") { + equal = `java.util.Objects.equals(${leftText}, ${rightText})`; + } else { + const unbox = left === "Double" || right === "Double" ? "doubleValue" : "longValue"; + equal = `(${leftText} == null ? ${rightText} == null : (${rightText} != null && ${leftText}.${unbox}() == ${rightText}.${unbox}()))`; + } + return negated ? `!${equal}` : equal; + } + } + return printNativeEquality.call(this, node, leftText, rightText); + }; +} +var JAVA_J16_IMPLICIT_API_FILE = /(^|[\\/])ts[\\/]src[\\/]abstract[\\/][a-z0-9_]+\.ts$/; +{ + const proto = JavaTranspiler.prototype; + const nonSharedValue = proto.javaHx4NonSharedValue; + proto.javaHx4NonSharedValue = function(value, depth) { + return this.javaJ16ImplicitApiResponse(value) || nonSharedValue.call(this, value, depth); + }; + proto.javaJ16ImplicitApiResponse = function(value) { + let node = this.unwrapPrintTransparentExpression(value); + if (node?.kind !== SyntaxKind6.AwaitExpression) { + return false; + } + node = this.unwrapPrintTransparentExpression(node.expression); + if (node === void 0 || !isCallExpression5(node) || !isPropertyAccessExpression2(node.expression) || node.expression.expression.kind !== SyntaxKind6.ThisKeyword) { + return false; + } + let declaration; + try { + declaration = this.checkerOrUndefined()?.getResolvedSignature(node)?.declaration?.resolve(); + } catch (e) { + return false; + } + const fileName = declaration?.getSourceFile?.()?.fileName; + if (typeof fileName !== "string" || !JAVA_J16_IMPLICIT_API_FILE.test(fileName) || !declaration.body) { + return false; + } + const statements = declaration.body.statements ?? []; + const ret = statements.length === 1 && isReturnStatement3(statements[0]) ? statements[0].expression : void 0; + return ret !== void 0 && isCallExpression5(ret) && isPropertyAccessExpression2(ret.expression) && ret.expression.expression.kind === SyntaxKind6.ThisKeyword && ret.expression.name.text === "request"; + }; +} + +// src/rustTranspiler.ts +init_esm_shims(); +import { NodeFlags as NodeFlags2, SyntaxKind as SyntaxKind7 } from "typescript/unstable/ast"; +import { isArrayLiteralExpression as isArrayLiteralExpression4, isArrowFunction as isArrowFunction5, isAsExpression as isAsExpression3, isBinaryExpression as isBinaryExpression5, isBindingElement, isBlock as isBlock4, isCallExpression as isCallExpression6, isClassDeclaration as isClassDeclaration4, isClassExpression as isClassExpression2, isConditionalExpression as isConditionalExpression3, isDeleteExpression as isDeleteExpression2, isElementAccessExpression as isElementAccessExpression4, isForInStatement as isForInStatement2, isForOfStatement as isForOfStatement2, isIdentifier as isIdentifier3, isMethodDeclaration as isMethodDeclaration5, isNoSubstitutionTemplateLiteral, isNonNullExpression as isNonNullExpression2, isNumericLiteral as isNumericLiteral4, isObjectLiteralExpression as isObjectLiteralExpression4, isParameterDeclaration as isParameterDeclaration3, isParenthesizedExpression as isParenthesizedExpression3, isPrefixUnaryExpression as isPrefixUnaryExpression3, isPropertyAccessExpression as isPropertyAccessExpression3, isReturnStatement as isReturnStatement4, isShorthandPropertyAssignment as isShorthandPropertyAssignment2, isSourceFile as isSourceFile5, isStatement, isStringLiteral as isStringLiteral3, isStringLiteralLikeNode as isStringLiteralLikeNode4, isTypeAssertion as isTypeAssertion3, isVariableDeclaration as isVariableDeclaration3 } from "typescript/unstable/ast/is"; +import { IndexKind as IndexKind4, ObjectFlags, SignatureKind as SignatureKind2, SymbolFlags as SymbolFlags3, TypeFlags as TypeFlags6 } from "typescript/unstable/sync"; var parserConfig6 = { "ELSEIF_TOKEN": "else if", "OBJECT_OPENING": "{", @@ -20871,6 +21924,24 @@ var _RustTranspiler = class _RustTranspiler extends BaseTranspiler { * `-> Option`; undefined otherwise (no proof → keep the box). */ // call node -> resolved signature's declaration (null: none); a handle resolve per call is JS-heavy this.rustCallDeclarations = /* @__PURE__ */ new WeakMap(); + // hx4 R04 — `const x = []` locals declared `Vec` when every use is a statement + // `x.push(v)` (native push), `x.length`, `return x` or an argument inside a `return` + // (boxed once as `Value::from(x)`). Anything else keeps the `Value` box and `append_to_array`. + this.rustVecLocalDecisions = /* @__PURE__ */ new WeakMap(); + /** Extra plain-dict write sources (R01 write-history proof), REST venue files only: no + * runtime tagged handle (book, ws subscription, cache bucket) is reachable there. */ + this.rustR12Visiting = /* @__PURE__ */ new Set(); + // hx4 R16 — numeric operand kinds beyond the checker: 'definite' = always Int/Float (never Null), + // 'number' = Int/Float/Null. Covers `this.sum` of numbers, numeric same-file method returns, + // locals whose every write is numeric, and flow-narrowed (guarded non-undefined) number identifiers. + this.rustR16InProgress = /* @__PURE__ */ new Set(); + this.rustR16Assumed = /* @__PURE__ */ new Set(); + /** Locals whose Arr-only proof is in progress (a self-referencing write proves nothing new). */ + this.r21ArrVisiting = /* @__PURE__ */ new Set(); + this.r22StrVisiting = /* @__PURE__ */ new Map(); + /** `this.extend (plain, …unshared)` / `this.omit|keysort (plain, …)` called directly + * (not only as a builder's return): the same fresh-copy proof as `rustR12PlainReturn`. */ + this.r23CopyVisiting = /* @__PURE__ */ new Set(); this.requiresParameterType = true; this.requiresReturnType = false; this.asyncTranspiling = true; @@ -21235,6 +22306,18 @@ var _RustTranspiler = class _RustTranspiler extends BaseTranspiler { // Native `==`/`!=` on the unwrapped payload when the checker proves the // Value variants line up; undefined keeps the is_equal() helper. printNativeEqualityComparison(left, right, op) { + const r09 = this.rustR09LengthEquality(left, right, op); + if (r09 !== void 0) + return r09; + const r12 = this.rustR12NativeBoolEquality(left, right, op); + if (r12 !== void 0) + return r12; + const r13 = this.printRustR13ProvenStrEquality(left, right, op); + if (r13 !== void 0) + return r13; + const r20 = this.r20BoolCallEquality(left, right, op); + if (r20 !== void 0) + return r20; const operator = op === SyntaxKind7.EqualsEqualsToken || op === SyntaxKind7.EqualsEqualsEqualsToken ? "==" : "!="; const leftLiteral = this.literalKindOfNode(left); const rightLiteral = this.literalKindOfNode(right); @@ -21310,7 +22393,9 @@ var _RustTranspiler = class _RustTranspiler extends BaseTranspiler { const receiver = leftExpr ?? this.printNode(node.expression, 0); if (!this.rustIsOrderBookSide(node.expression) && this.isValueLengthType(this.typeOfNodeIfAny(node.expression))) return `Value::Int(${receiver}.len() as i64)`; - return `get_array_length(&${receiver})`; + if (this.r11ProvenListValue(node.expression)) + return `${receiver}.as_array().map_or(Value::Int(0), |__a| Value::Int(__a.len() as i64))`; + return this.r18ArrLength(node, receiver) ?? `get_array_length(&${receiver})`; } /** `orderbook['bids']` / `orderbook.asks` on an `OrderBook`-typed receiver, or a * local initialised from one. The WS runtime keeps those sides as marker dicts @@ -21894,8 +22979,8 @@ var _RustTranspiler = class _RustTranspiler extends BaseTranspiler { const rightKind = this.rustNumericOperandKind(right); const ordered = op === SyntaxKind7.LessThanToken || op === SyntaxKind7.GreaterThanToken; const proven = leftKind === "definite" || rightKind === "definite" || (ordered ? leftKind !== void 0 || rightKind !== void 0 : leftKind === "number" && rightKind === "number"); - if (!proven) { - return void 0; + if (!proven && !this.rustR16OrderedProven(op, left, right)) { + return this.r22StrOrderedComparison(node, op, left, right) ?? this.r25NativeLooseOrderedComparison(node, op, left, right); } return this.printNativeNumericComparison(node, operator, this.printNode(left, 0), this.printNode(right, 0)); } @@ -21938,6 +23023,8 @@ var _RustTranspiler = class _RustTranspiler extends BaseTranspiler { return native === void 0 ? void 0 : `${leftText} = ${native}`; } printNativeArithmetic(op, left, right, leftText, rightText) { + if (op === SyntaxKind7.PercentToken) + return this.printRustNativeMod(left, right, leftText, rightText) ?? this.rustR16NativeArithmetic(op, left, right, leftText, rightText); if (op !== SyntaxKind7.PlusToken && op !== SyntaxKind7.MinusToken && op !== SyntaxKind7.AsteriskToken && op !== SyntaxKind7.SlashToken) { return void 0; } @@ -21949,11 +23036,20 @@ var _RustTranspiler = class _RustTranspiler extends BaseTranspiler { } catch (e) { return void 0; } - if (op === SyntaxKind7.PlusToken && this.isNativeStringConcatPair(leftType, rightType)) { + const r09 = this.rustR09NativeAddSubtract(op, left, right, leftType, rightType, leftText, rightText); + if (r09 !== void 0) + return r09; + const r16 = this.rustR16NativeArithmetic(op, left, right, leftText, rightText); + if (r16 !== void 0) + return r16; + const r20 = this.r20NativeNumericAdd(op, left, right, leftText, rightText); + if (r20 !== void 0) + return r20; + if (op === SyntaxKind7.PlusToken && (this.isNativeStringConcatPair(leftType, rightType) || this.r17ConcatIsAnchored(left, right, leftType, rightType) || this.r22ConcatIsAnchored(left, right, leftType, rightType))) { return this.printNativeStringConcat(leftText, rightText); } if (!this.isNumberLikeType(leftType) || !this.isNumberLikeType(rightType)) { - return void 0; + return this.r25NativeCoercingArithmetic(op, left, right, leftText, rightText); } return this.printNativeNumeric(op, leftText, rightText); } @@ -21995,7 +23091,7 @@ var _RustTranspiler = class _RustTranspiler extends BaseTranspiler { for (const key of keyStrs.slice(0, -1)) acc = `get_value_mut(${acc}, &${key})`; const rhs = this.printNode(right, 0); - const nativeInsert = keyStrs.length === 1 ? this.printNativeDictInsert(baseExpr, keys[0], keyStrs[0], rhs) : void 0; + const nativeInsert = keyStrs.length === 1 ? this.printNativeDictInsert(baseExpr, keys[0], keyStrs[0], rhs) ?? this.rustR01NativeDictInsert(baseExpr, keys[0], keyStrs[0], rhs) : void 0; return nativeInsert ?? `add_element_to_object(${acc}, &${keyStrs[keyStrs.length - 1]}, ${rhs})`; } if (left.kind === SyntaxKind7.TypeOfExpression) { @@ -22013,7 +23109,7 @@ var _RustTranspiler = class _RustTranspiler extends BaseTranspiler { } if (op === SyntaxKind7.InKeyword) { const shadow = this.rustParamShadowOf(right); - return (shadow !== void 0 ? this.printShadowInOperator(shadow, left) : void 0) ?? this.printNativeInOperator(left, right) ?? `Value::Bool(in_op(&${this.printNode(right, 0)}, &${this.printNode(left, 0)}))`; + return (shadow !== void 0 ? this.printShadowInOperator(shadow, left) : void 0) ?? this.printNativeInOperator(left, right) ?? this.r18LiteralInOp(left, right) ?? this.r05InOp(left, right) ?? `Value::Bool(in_op(&${this.printNode(right, 0)}, &${this.printNode(left, 0)}))`; } if ((op === SyntaxKind7.PlusEqualsToken || op === SyntaxKind7.MinusEqualsToken) && left.kind !== SyntaxKind7.ElementAccessExpression) { const isPlus = op === SyntaxKind7.PlusEqualsToken; @@ -22049,7 +23145,7 @@ var _RustTranspiler = class _RustTranspiler extends BaseTranspiler { } // `str.padStart(len, pad)` / `str.padEnd(len, pad)` → runtime helpers `(&Value, &Value, &Value)`. printPadStartCall(node, identation, name, parsedArg, parsedArg2) { - return `pad_start(${this.ensureRef(name)}, ${this.ensureRef(parsedArg)}, ${this.ensureRef(parsedArg2)})`; + return this.printNativeStringPadStart(node, name) ?? `pad_start(${this.ensureRef(name)}, ${this.ensureRef(parsedArg)}, ${this.ensureRef(parsedArg2)})`; } printPadEndCall(node, identation, name, parsedArg, parsedArg2) { return `pad_end(${this.ensureRef(name)}, ${this.ensureRef(parsedArg)}, ${this.ensureRef(parsedArg2)})`; @@ -22074,6 +23170,8 @@ var _RustTranspiler = class _RustTranspiler extends BaseTranspiler { if (declaration.initializer.kind === SyntaxKind7.NewExpression) { return `${indent}let mut ${varName} = ${parsedValue}`; } + if (node.declarations.length === 1 && this.rustVecLocalIsTyped(declaration)) + return `${indent}let mut ${varName}: Vec = Vec::new()`; const boolValue = this.getRustBoolLocalInitializer(declaration, parsedValue); if (boolValue !== void 0) { return `${indent}let mut ${varName}: bool = ${boolValue}`; @@ -23225,10 +24323,10 @@ ${classMethods} return void 0; return this.printNativeListIndex(receiverText, index); } - const dictRead = this.printNativeDynamicMapAccess(receiverText, receiverNode, keyNode); + const dictRead = this.printNativeDynamicMapAccess(receiverText, receiverNode, keyNode) ?? this.printNativeThisFieldDynamicMapAccess(receiverText, receiverNode, keyNode) ?? this.rustR10DynamicRead(receiverText, receiverNode, keyNode); if (dictRead !== void 0) return dictRead; - return this.printNativeDynamicListIndex(receiverText, receiverNode, keyNode); + return this.printNativeDynamicListIndex(receiverText, receiverNode, keyNode) ?? this.r14ListArithIndex(receiverText, receiverNode, keyNode); } /** `get_value(&X, &i)` for a checker-proven list `X` and a dynamic integer * index local `i`: the runtime's own array branch, spelled natively. @@ -23869,7 +24967,7 @@ ${ind}let ${view}: &${map} = &${arc}; return void 0; } printNativeMapAccess(receiverText, receiverNode, keyText) { - if (!this.isProvenMapExpression(receiverNode)) { + if (!this.isProvenMapExpression(receiverNode) && !this.rustR10LiteralReadOk(receiverNode, keyText)) { if (!this.rustIsDeclaredDictLocal(receiverNode)) return void 0; if (_RustTranspiler.RUST_DICT_LOCAL_UNSAFE_KEYS.has(keyText)) @@ -24051,7 +25149,7 @@ ${ind}let ${view}: &${map} = &${arc}; * emitted where no such hoist is needed. */ isNativeAccessPositionSafe(node) { const parent = node.parent; - if (parent && (isPropertyAccessExpression3(parent) || isCallExpression6(parent)) && parent.expression === node) + if (parent && (isPropertyAccessExpression3(parent) || isCallExpression6(parent)) && parent.expression === node && !this.r21PureStringMethodReceiver(node)) return false; const root = this.rootPlaceText(node); for (let current = node.parent; current; current = current.parent) { @@ -24196,6 +25294,9 @@ ${idn}}`; const nativeTruthiness = this.printNativeTruthiness(node); if (nativeTruthiness !== void 0) return idn + nativeTruthiness; + const r12Truthiness = this.rustR12NativeTruthiness(node); + if (r12Truthiness !== void 0) + return idn + r12Truthiness; const nativeCondition = this.printNativeParenthesizedCondition(node); if (nativeCondition !== void 0 && this.rustConditionBoolSlot(node)) return idn + nativeCondition; @@ -24346,7 +25447,7 @@ ${idn}}`; if (operator !== SyntaxKind7.MinusToken) return idn + this.PrefixFixOperators[operator] + this.printNode(operand, 0); const operandText = this.printNode(operand, 0); - return idn + (this.foldNegateLiteral(operandText) ?? `negate(&${operandText})`); + return idn + (this.foldNegateLiteral(operandText) ?? this.printRustNativeNegate(operand, operandText) ?? `negate(&${operandText})`); } printObjectLiteralExpression(node, identation) { const escapeKey = (s) => String(s).replace(/\\/g, "\\\\").replace(/"/g, '\\"').replace(/\n/g, "\\n").replace(/\r/g, "\\r").replace(/\t/g, "\\t"); @@ -24370,7 +25471,7 @@ ${this.getIden(identation)}})`; return `Value::from(vec![${node.elements.map((e) => this.printNode(e, 0)).join(", ")}])`; } printDeleteExpression(node, identation) { - return `remove(&mut ${this.printNode(node.expression.expression, 0)}, &${this.printNode(node.expression.argumentExpression, 0)})`; + return this.r05Delete(node) ?? `remove(&mut ${this.printNode(node.expression.expression, 0)}, &${this.printNode(node.expression.argumentExpression, 0)})`; } printInstanceOfExpression(node, identation) { return `${this.getIden(identation)}is_instance(&${this.printNode(node.left, 0)}, &${this.printNode(node.right, 0)})`; @@ -24417,10 +25518,10 @@ ${this.getIden(identation)}})`; return `Value::Bool(${this.nativeValuePredicateText("array", node?.arguments?.[0], parsedArg) ?? `is_array(&${parsedArg})`})`; } printObjectKeysCall(node, identation, parsedArg = void 0) { - return `object_keys(&${parsedArg})`; + return this.r05Enum(node, parsedArg, "keys") ?? this.r18PredictionEnum(node, parsedArg, "keys") ?? this.r21BaseEnum(node, parsedArg, "keys") ?? `object_keys(&${parsedArg})`; } printObjectValuesCall(node, identation, parsedArg = void 0) { - return `object_values(&${parsedArg})`; + return this.r05Enum(node, parsedArg, "values") ?? this.r18PredictionEnum(node, parsedArg, "values") ?? this.r21BaseEnum(node, parsedArg, "values") ?? `object_values(&${parsedArg})`; } printJsonParseCall(node, identation, parsedArg = void 0) { return `json_parse(&${parsedArg})`; @@ -24429,7 +25530,7 @@ ${this.getIden(identation)}})`; return `json_stringify(&${parsedArg})`; } printMathFloorCall(node, identation, parsedArg = void 0) { - return `math_floor(&${parsedArg})`; + return this.printRustNativeMathCall(node, "floor", parsedArg) ?? `math_floor(&${parsedArg})`; } // No `.await` here: `printAwaitExpression` appends it for `await Promise.all(...)`. printPromiseAllCall(node, identation, parsedArg = void 0) { @@ -24440,37 +25541,43 @@ ${this.getIden(identation)}})`; return `${this.printNode(node.expression, identation)}.await`; } printMathRoundCall(node, identation, parsedArg = void 0) { - return `math_round(&${parsedArg})`; + return this.printRustNativeMathCall(node, "round", parsedArg) ?? `math_round(&${parsedArg})`; } printMathCeilCall(node, identation, parsedArg = void 0) { - return `math_ceil(&${parsedArg})`; + return this.printRustNativeMathCall(node, "ceil", parsedArg) ?? `math_ceil(&${parsedArg})`; } printNumberIsIntegerCall(node, identation, parsedArg = void 0) { return `is_integer(&${parsedArg})`; } printArrayPushCall(node, identation, name = void 0, parsedArg = void 0) { - return `append_to_array(&mut ${name}, ${parsedArg})`; + return this.printRustVecPush(node, name, parsedArg) ?? this.r18ArrPush(node, name, parsedArg) ?? `append_to_array(&mut ${name}, ${parsedArg})`; } printIncludesCall(node, identation, name = void 0, parsedArg = void 0) { return `Value::Bool(contains(&${name}, &${parsedArg}))`; } printIndexOfCall(node, identation, name = void 0, parsedArg = void 0) { - return this.printNativeStringIndexOf(node, name) ?? `get_index_of(&${name}, &${parsedArg})`; + return this.printNativeStringIndexOf(node, name) ?? this.printNativeStringIndexOfString(node, name) ?? this.r30IndexOf(name, parsedArg); } printStartsWithCall(node, identation, name = void 0, parsedArg = void 0) { + const native = this.printNativeStringAffixTest(node, name, "starts_with") ?? this.r17PrintAffixTest(node, name, "starts_with"); + if (native !== void 0) + return `Value::Bool(${native})`; return `Value::Bool(starts_with(&${name}, &${parsedArg}))`; } printEndsWithCall(node, identation, name = void 0, parsedArg = void 0) { + const native = this.printNativeStringAffixTest(node, name, "ends_with") ?? this.r17PrintAffixTest(node, name, "ends_with"); + if (native !== void 0) + return `Value::Bool(${native})`; return `Value::Bool(ends_with(&${name}, &${parsedArg}))`; } printTrimCall(node, identation, name = void 0) { - return `trim(&${name})`; + return this.r17PrintTrim(node, name) ?? `trim(&${name})`; } printJoinCall(node, identation, name = void 0, parsedArg = void 0) { - return `join(&${name}, &${parsedArg})`; + return this.r15PrintVecJoin(node) ?? this.printNativeStringJoin(node, name) ?? `join(&${name}, &${parsedArg})`; } printSplitCall(node, identation, name = void 0, parsedArg = void 0) { - return `split(&${name}, &${parsedArg})`; + return this.printNativeStringSplit(node, name) ?? this.printRustR13Split(node, name) ?? `split(&${name}, &${parsedArg})`; } printConcatCall(node, identation, name = void 0, parsedArg = void 0) { return `concat(${name}.clone(), ${parsedArg}.clone())`; @@ -24479,13 +25586,13 @@ ${this.getIden(identation)}})`; return `to_fixed(&${name}, &${parsedArg})`; } printToStringCall(node, identation, name = void 0) { - return `to_string_val(&${name})`; + return this.printRustNativeToString(node, name) ?? this.printRustR13ToString(node, name) ?? `to_string_val(&${name})`; } printToUpperCaseCall(node, identation, name = void 0) { - return `to_upper(&${name})`; + return this.printNativeStringCase(node, name, "to_uppercase") ?? this.printRustR13Case(node, name, "to_uppercase") ?? this.r30Case(name, "to_uppercase"); } printToLowerCaseCall(node, identation, name = void 0) { - return `to_lower(&${name})`; + return this.printNativeStringCase(node, name, "to_lowercase") ?? this.printRustR13Case(node, name, "to_lowercase") ?? this.r30Case(name, "to_lowercase"); } printShiftCall(node, identation, name = void 0) { return `shift(${name}.clone())`; @@ -24497,13 +25604,13 @@ ${this.getIden(identation)}})`; return `pop(${name}.clone())`; } printSliceCall(node, identation, name = void 0, parsedArg = void 0, parsedArg2 = void 0) { - return this.printNativeStringSlice(node, name) ?? `slice(&${name}, &${parsedArg}, &${parsedArg2 ?? "Value::Null"})`; + return this.printNativeStringSlice(node, name) ?? this.r30Slice(name, parsedArg, parsedArg2 ?? "Value::Null"); } printReplaceCall(node, identation, name = void 0, parsedArg = void 0, parsedArg2 = void 0) { - return `replace_str(&${name}, &${parsedArg}, &${parsedArg2})`; + return this.printNativeStringReplace(node, name) ?? this.printRustR13Replace(node, name) ?? this.r17PrintReplace(node, name) ?? `replace_str(&${name}, &${parsedArg}, &${parsedArg2})`; } printReplaceAllCall(node, identation, name = void 0, parsedArg = void 0, parsedArg2 = void 0) { - return `replace_all_str(&${name}, &${parsedArg}, &${parsedArg2})`; + return this.printNativeStringReplace(node, name) ?? this.printRustR13Replace(node, name) ?? this.r17PrintReplace(node, name) ?? `replace_all_str(&${name}, &${parsedArg}, &${parsedArg2})`; } // `{}` (Display) renders an ExchangeError as `[Kind] message`; `{:?}` would dump the struct fields. printThrowStatement(node, identation) { @@ -24547,27 +25654,2173 @@ ${iden}}`; printSpreadElement(node, identation) { return `${this.getIden(identation)}${this.printNode(node.expression, 0)}`; } -}; -// node kinds the printer types that the core per-file prefetch leaves to single round trips -_RustTranspiler.RUST_PREFETCH_TYPE_KINDS = /* @__PURE__ */ new Set([ - SyntaxKind7.FalseKeyword, - SyntaxKind7.TrueKeyword, - SyntaxKind7.ParenthesizedExpression, - SyntaxKind7.AwaitExpression, - SyntaxKind7.PrefixUnaryExpression, - SyntaxKind7.BooleanKeyword, - SyntaxKind7.ObjectKeyword, - SyntaxKind7.UnionType, - SyntaxKind7.ConditionalExpression, - SyntaxKind7.AsExpression -]); -// ── native equality emission ──────────────────────────────────────────── -// When the checker proves both operands hold the same primitive payload -// (string / number / boolean, or one side is a matching literal) the -// unwrapped payloads are compared with `==`/`!=` instead of is_equal(). -// Operators whose printed form is a bare Rust `bool` (not a Value). -_RustTranspiler.BOOL_PRODUCING_OPERATORS = /* @__PURE__ */ new Set([ - SyntaxKind7.EqualsEqualsToken, + rustR01NativeDictInsert(baseExpr, keyNode, keyText, valueText) { + if (!isIdentifier3(baseExpr) || !this.rustR01LocalStaysPlain(baseExpr)) { + return void 0; + } + const receiver = { text: String(baseExpr.text), isField: false, plain: true, nameNode: baseExpr }; + const keyArg = this.rustNativeInsertKeyArg(receiver, keyNode, keyText); + if (keyArg === void 0) { + return void 0; + } + const name = receiver.text; + const value = this.rustPrintedBoolArg(valueText) ? `Value::Bool(${valueText})` : valueText.trim(); + const insert = (val) => `if let Value::Dict(__d) = &mut ${name} { std::sync::Arc::make_mut(__d).insert(${keyArg}, ${val}); }`; + if (new RegExp(`\\b${name}\\b`).test(value)) { + return `{ let __be_tmp = ${value}; ${insert("__be_tmp")} }`; + } + if (/^[a-zA-Z_][a-zA-Z0-9_]*$/.test(value) && value !== "self" && value !== "true" && value !== "false") { + return insert(`${value}.clone()`); + } + return insert(value); + } + /** A local (single binding in its function, no closure capture of a write) + * whose declaration and every write is a plain-dict source or nullish. A + * nullish value leaves a non-Dict, which `if let Value::Dict` no-ops on + * exactly like the helper's `_ => {}` arm. */ + rustR01LocalStaysPlain(ident, depth = 0) { + const checker = this.checkerOrUndefined(); + const declarations = checker === void 0 ? [] : symbolDeclarations(checker.getSymbolAtLocation(ident)); + const declaration = declarations.length === 1 ? declarations[0] : void 0; + if (declaration === void 0 || depth > 4) { + return false; + } + if (declaration.kind === SyntaxKind7.BindingElement) { + return this.rustR01TupleBindingStaysPlain(ident, declaration, depth); + } + if (!isVariableDeclaration3(declaration) || declaration.name?.kind !== SyntaxKind7.Identifier) { + return false; + } + const scope = this.rustEnclosingFunction(declaration); + if (scope === void 0 || isSourceFile5(scope) || this.rustEnclosingFunction(ident) !== scope) { + return false; + } + const name = String(ident.text); + const symbol = this.rustSymbolOf(declaration.name); + if (symbol === void 0) { + return false; + } + if (declaration.initializer !== void 0 && !this.rustR01PlainSource(declaration.initializer, name)) { + return false; + } + let plain = true; + for (const node of this.rustScopeNameNodes(scope, name)) { + if (node === declaration) + continue; + if (this.rustBindsName(node, name)) { + if (this.rustSymbolOf(node.name) === void 0) { + plain = false; + break; + } + continue; + } + if (node.kind !== SyntaxKind7.Identifier || node === declaration.name || this.rustSymbolOf(node) !== symbol) + continue; + if (this.rustEnclosingFunction(node) !== scope) { + plain = false; + break; + } + if (!this.rustR01UseKeepsPlain(node, name)) { + plain = false; + break; + } + } + return plain; + } + /** `const [ x, p ] = this.handleUntilOption (k, r, …)` with `r` itself a + * plain local: element 0 is `r` handed back, and `x` is never re-written. */ + rustR01TupleBindingStaysPlain(ident, element, depth) { + const pattern = element.parent; + const declaration = pattern?.parent; + if (pattern?.kind !== SyntaxKind7.ArrayBindingPattern || declaration === void 0 || !isVariableDeclaration3(declaration) || ![0, 1].includes(pattern.elements.indexOf(element)) || element.name?.kind !== SyntaxKind7.Identifier || element.initializer !== void 0 || element.dotDotDotToken !== void 0) { + return false; + } + if (pattern.elements.indexOf(element) === 1 ? !this.r26ParamsSlot(declaration.initializer, void 0, depth) : !this.rustR01TupleHeadIsPlain(declaration.initializer, void 0, depth)) { + return false; + } + const scope = this.rustEnclosingFunction(declaration); + const name = String(ident.text); + const symbol = this.rustSymbolOf(element.name); + if (scope === void 0 || symbol === void 0 || this.rustEnclosingFunction(ident) !== scope) { + return false; + } + for (const node of this.rustScopeNameNodes(scope, name)) { + if (node.kind !== SyntaxKind7.Identifier || node === element.name || this.rustSymbolOf(node) !== symbol) + continue; + if (this.rustEnclosingFunction(node) !== scope || !this.rustR01UseKeepsPlain(node, name)) + return false; + } + return true; + } + /** The shipped construction proof (literal-built local / handler tuple), read-only. */ + rustR01ShippedPlain(ident) { + const declaration = this.rustSingleLocalDeclaration(ident); + return declaration !== void 0 && isVariableDeclaration3(declaration) && this.rustInsertReceiverBuildsPlainDict(declaration); + } + /** A use of the local: reads and element writes keep the box; a direct + * assignment must store a plain source; any other write shape rejects. */ + rustR01UseKeepsPlain(node, name) { + let target = node; + while (target.parent !== void 0 && (isParenthesizedExpression3(target.parent) || isNonNullExpression2(target.parent) || isAsExpression3(target.parent))) { + target = target.parent; + } + const parent = target.parent; + if (parent === void 0) + return true; + if (isBinaryExpression5(parent) && parent.left === target && rustIsAssignmentOperator(parent.operatorToken.kind)) { + return parent.operatorToken.kind === SyntaxKind7.EqualsToken && this.rustR01PlainSource(parent.right, name); + } + if (parent.kind === SyntaxKind7.ArrayLiteralExpression) { + const assign = parent.parent; + if (assign !== void 0 && isBinaryExpression5(assign) && assign.left === parent) { + return this.rustR01RequestTupleWrite(assign.right, parent.elements.indexOf(target), name); + } + } + if ((parent.kind === SyntaxKind7.PropertyAssignment || parent.kind === SyntaxKind7.ShorthandPropertyAssignment) && !(parent.kind === SyntaxKind7.PropertyAssignment && parent.initializer !== target)) { + let literal = parent.parent; + while (literal?.parent !== void 0 && (isParenthesizedExpression3(literal.parent) || isAsExpression3(literal.parent))) + literal = literal.parent; + if (literal?.parent === void 0 || isVariableDeclaration3(literal.parent)) + return false; + } + if (parent.kind === SyntaxKind7.PrefixUnaryExpression || parent.kind === SyntaxKind7.PostfixUnaryExpression || parent.kind === SyntaxKind7.DeleteExpression || (isForOfStatement2(parent) || isForInStatement2(parent)) && parent.initializer === target) { + return false; + } + return true; + } + /** `[ x, … ] = this.handleUntilOption (k, x, …)` — element 0 is the request + * argument handed back (base-tier implementation, no override). */ + rustR01RequestTupleWrite(rhs, index, name) { + return index === 1 ? this.r26ParamsSlot(rhs, name, 0) : index === 0 && this.rustR01TupleHeadIsPlain(rhs, name, 0); + } + /** Element 0 of `this.m (…)` is a plain dict: `m` is the base-tier + * `handleUntilOption` (returns its `request` argument), or a method of the + * calling file (Rust calls it statically) whose every `return [ X, … ]` + * has X a plain literal / plain local, or a parameter whose argument here is. */ + rustR01TupleHeadIsPlain(rhs, selfName, depth) { + const call = this.rustStripWrappers(rhs); + if (depth > 4 || call === void 0 || !isCallExpression6(call) || !isPropertyAccessExpression3(call.expression) || call.expression.expression.kind !== SyntaxKind7.ThisKeyword) { + return false; + } + const argPlain = (index) => { + const arg = this.rustStripWrappers(call.arguments[index]); + return arg !== void 0 && (this.rustPlainDictLiteral(arg) || isIdentifier3(arg) && (String(arg.text) === selfName || this.rustR01LocalStaysPlain(arg, depth + 1) || this.rustR01ShippedPlain(arg))); + }; + if (_RustTranspiler.RUST_R01_REQUEST_TUPLE_HELPERS.has(String(call.expression.name.text))) { + return this.rustR01CalleeIsBase(call) && argPlain(1); + } + let declaration; + try { + declaration = signatureDeclaration(this.getChecker().getResolvedSignature(call)); + } catch (e) { + return false; + } + if (declaration?.kind !== SyntaxKind7.MethodDeclaration || declaration.body === void 0 || declaration.getSourceFile() !== call.getSourceFile()) { + return false; + } + let plain = true; + let returns = 0; + this.rustWalkScope(declaration.body, (n) => { + if (isArrowFunction5(n) || n.kind === SyntaxKind7.FunctionExpression) + return RUST_WALK_SKIP; + if (!isReturnStatement4(n)) + return; + returns++; + const tuple = this.rustStripWrappers(n.expression); + const head = tuple?.kind === SyntaxKind7.ArrayLiteralExpression ? this.rustStripWrappers(tuple.elements[0]) : void 0; + const param = head !== void 0 && isIdentifier3(head) ? declaration.parameters.findIndex((p) => p.name?.kind === SyntaxKind7.Identifier && String(p.name.text) === String(head.text)) : -1; + const ok = head !== void 0 && (this.rustPlainDictLiteral(head) || (param >= 0 ? this.rustSymbolOf(head) === this.rustSymbolOf(declaration.parameters[param].name) && argPlain(param) && this.rustR01ParamUnassigned(declaration, String(head.text)) : isIdentifier3(head) && this.rustR01LocalStaysPlain(head, depth + 1))); + if (!ok) { + plain = false; + return RUST_WALK_STOP; + } + }); + return plain && returns > 0; + } + /** A pass-through parameter: never assigned in the method body. */ + rustR01ParamUnassigned(method, name) { + let kept = true; + this.rustWalkScope(method.body, (n) => { + if (isBinaryExpression5(n) && rustIsAssignmentOperator(n.operatorToken.kind) && isIdentifier3(n.left) && String(n.left.text) === name) { + kept = false; + return RUST_WALK_STOP; + } + }); + return kept; + } + /** A value that is a fresh plain dict, nullish, or the local itself. */ + rustR01PlainSource(node, name) { + const stripped = this.rustStripWrappers(node); + if (stripped === void 0) + return false; + if (this.rustPlainDictLiteral(stripped) || this.rustTypeIsUndefinedish(stripped) || isIdentifier3(stripped) && String(stripped.text) === name) { + return true; + } + if (isConditionalExpression3(stripped)) { + return this.rustR01PlainSource(stripped.whenTrue, name) && this.rustR01PlainSource(stripped.whenFalse, name); + } + if (isCallExpression6(stripped) && isPropertyAccessExpression3(stripped.expression) && stripped.expression.expression.kind === SyntaxKind7.ThisKeyword && _RustTranspiler.RUST_R01_PLAIN_DICT_BUILDERS.has(String(stripped.expression.name.text))) { + return this.rustR01CalleeIsBase(stripped); + } + if (this.rustR12PlainSource(stripped)) + return true; + if (isCallExpression6(stripped) && isPropertyAccessExpression3(stripped.expression) && stripped.expression.expression.kind === SyntaxKind7.ThisKeyword && stripped.arguments.length > 0 && this.rustR01CalleeIsBase(stripped)) { + const callee = String(stripped.expression.name.text); + const first = this.rustStripWrappers(stripped.arguments[0]); + if (callee === "omit" || callee === "keysort") { + return first !== void 0 && isIdentifier3(first) && String(first.text) === name; + } + if (callee === "extend") { + return stripped.arguments.every((a) => this.rustR01PlainSource(a, name)); + } + } + return false; + } + /** The checker resolves the call to the base-tier implementation (a venue + * override could return anything). */ + rustR01CalleeIsBase(call) { + let declaration; + try { + declaration = signatureDeclaration(this.getChecker().getResolvedSignature(call)); + } catch (e) { + return false; + } + return declaration !== void 0 && (declaration.body !== void 0 || this.r14BaseOverload(declaration)) && _RustTranspiler.RUST_BASE_TIER_FILE.test(String(declaration.getSourceFile().fileName).replace(/\\/g, "/")); + } + // hx4 R02 + // `this.[k]`: a class property whose declared type proves a plain dict is a + // container struct field (never a book/cache/side/client/live marker dict), so + // `get_value`'s marker routes cannot fire and the read is `m.get(k)`. + /** The class property declaration behind `this.` when its annotation proves a plain dict. */ + rustProvenDictThisField(node) { + if (!isPropertyAccessExpression3(node) || node.expression.kind !== SyntaxKind7.ThisKeyword) + return void 0; + let declaration; + try { + declaration = symbolValueDeclaration(this.getChecker().getSymbolAtLocation(node.name)); + } catch (e) { + return void 0; + } + if (declaration === void 0 || declaration.kind !== SyntaxKind7.PropertyDeclaration || declaration.type === void 0) + return void 0; + const type = this.getCheckedTypeOf(declaration.type); + return type !== void 0 && this.isProvenMapType(type) ? declaration : void 0; + } + /** `this.[a]` whose declared field type's element type is itself a plain dict + * (`Dictionary>`). */ + rustProvenDictThisFieldElement(node) { + if (!isElementAccessExpression4(node)) + return false; + const field = this.rustProvenDictThisField(node.expression); + if (field === void 0) + return false; + const fieldType = this.getCheckedTypeOf(field.type); + const parts = fieldType.flags & TypeFlags6.Union ? (typeParts(fieldType) ?? []).filter((p) => !this.rustTypeIsNullish(p)) : [fieldType]; + return parts.length === 1 && this.isProvenMapType(this.getChecker().getIndexTypeOfType(parts[0], IndexKind4.String)); + } + /** `this.[k]` with a proven-dict field and a proven string key place. */ + printNativeThisFieldDynamicMapAccess(receiverText, receiverNode, keyNode) { + if (this.rustProvenDictThisField(receiverNode) === void 0 && !this.rustProvenDictThisFieldElement(receiverNode)) + return void 0; + if (!this.rustKeyIsProvenString(keyNode)) + return void 0; + const keyText = this.printNode(keyNode, 0).trim(); + if (!/^[A-Za-z_][A-Za-z0-9_]*$/.test(keyText)) + return void 0; + return `${receiverText}.as_map().and_then(|__m| ${keyText}.as_str().and_then(|__k| __m.get(__k))).cloned().unwrap_or(Value::Null)`; + } + rustVecLocalIsTyped(declaration) { + if (declaration?.kind !== SyntaxKind7.VariableDeclaration) + return false; + let decision = this.rustVecLocalDecisions.get(declaration); + if (decision === void 0) { + this.rustVecLocalDecisions.set(declaration, false); + decision = this.rustVecLocalIsTypedUncached(declaration); + this.rustVecLocalDecisions.set(declaration, decision); + } + return decision; + } + rustVecLocalIsTypedUncached(declaration) { + const init = declaration.initializer; + if (declaration.name?.kind !== SyntaxKind7.Identifier || init === void 0 || !isArrayLiteralExpression4(init) || init.elements.length !== 0) + return false; + const checker = this.checkerOrUndefined(); + const type = checker?.getTypeAtLocation(declaration.name); + if (type === void 0 || !checker.isArrayType(type)) + return false; + const name = String(declaration.name.text); + const fn = this.rustEnclosingFunction(declaration); + if (fn === void 0 || isSourceFile5(fn)) + return false; + const source = declaration.getSourceFile?.()?.fileName; + if (typeof source === "string" && /\/test\//.test(source)) + return false; + let pushes = 0; + const safe = this.rustLocalUsesAll(declaration, name, false, (n) => { + const parent = n.parent; + if (isPropertyAccessExpression3(parent) && parent.name === n || parent?.kind === SyntaxKind7.PropertyAssignment && parent.name === n) + return true; + if (this.rustEnclosingFunction(n) !== fn) + return false; + if (isPropertyAccessExpression3(parent) && parent.expression === n) { + const member = String(parent.name.text); + if (member === "length") { + const up = parent.parent; + return !(isBinaryExpression5(up) && up.left === parent && rustIsAssignmentOperator(up.operatorToken.kind)) && up?.kind !== SyntaxKind7.PrefixUnaryExpression && up?.kind !== SyntaxKind7.PostfixUnaryExpression; + } + if (member === "push" && this.rustVecPushShape(parent.parent, name)) { + pushes++; + return true; + } + return this.r15VecJoinUse(parent); + } + return this.rustVecValueUse(n, name) || this.r11VecUse(n) || this.r15VecPropertyUse(n); + }); + return safe && pushes > 0; + } + // `x.push(v);` as a whole statement, one non-spread argument not naming `x`. + rustVecPushShape(call, name) { + if (!isCallExpression6(call) || call.arguments.length !== 1 || call.parent?.kind !== SyntaxKind7.ExpressionStatement) + return false; + const arg = call.arguments[0]; + if (arg.kind === SyntaxKind7.SpreadElement) + return false; + let mentions = false; + const visit = (m) => { + if (mentions) + return; + if (m.kind === SyntaxKind7.Identifier && m.text === name) { + mentions = true; + return; + } + m.forEachChild?.(visit); + }; + visit(arg); + return !mentions; + } + // `return x` / `return f(.., x, ..)` with `x` named once in the statement: a boxing move. + // Elsewhere a boxing argument / object-literal value must be the local's last use outside any loop. + rustVecValueUse(n, name) { + const parent = n.parent; + if (isReturnStatement4(parent)) + return true; + const isArg = isCallExpression6(parent) && parent.arguments.some((a) => a === n) && this.rustVecBoxingCallee(parent.expression); + const isProp = parent?.kind === SyntaxKind7.PropertyAssignment && parent.initializer === n; + if (!isArg && !isProp) + return false; + let statement = parent; + while (statement !== void 0 && !isStatement(statement)) + statement = statement.parent; + if (statement === void 0) + return false; + if (!isReturnStatement4(statement) && !this.rustVecIsFinalUse(n, name)) + return false; + let count = 0; + const visit = (m) => { + if (m.kind === SyntaxKind7.Identifier && m.text === name) + count++; + m.forEachChild?.(visit); + }; + visit(statement); + return count === 1; + } + rustVecIsFinalUse(n, name) { + const fn = this.rustEnclosingFunction(n); + for (let current = n.parent; current !== void 0 && current !== fn; current = current.parent) { + switch (current.kind) { + case SyntaxKind7.ForStatement: + case SyntaxKind7.ForInStatement: + case SyntaxKind7.ForOfStatement: + case SyntaxKind7.WhileStatement: + case SyntaxKind7.DoStatement: + return false; + } + } + const end = n.getEnd?.() ?? n.end; + return !this.rustScopeNameNodes(fn, name).some((m) => m.kind === SyntaxKind7.Identifier && m !== n && (m.getStart?.() ?? m.pos) >= end && !this.rustIdentifierIsPropertyName(m)); + } + // `this.m(..)` / `super.m(..)` / `Promise.all(..)`: every argument prints through printNode as a `Value`. + rustVecBoxingCallee(callee) { + if (!isPropertyAccessExpression3(callee)) + return false; + const receiver = callee.expression; + if (receiver.kind === SyntaxKind7.ThisKeyword || receiver.kind === SyntaxKind7.SuperKeyword) + return true; + return receiver.kind === SyntaxKind7.Identifier && receiver.text === "Promise" && String(callee.name.text) === "all"; + } + rustVecLocalDeclarationOf(node) { + if (node?.kind !== SyntaxKind7.Identifier) + return void 0; + const checker = this.checkerOrUndefined(); + const symbol = checker?.getSymbolAtLocation(node); + const declaration = symbolValueDeclaration(symbol) ?? symbolDeclarations(symbol)[0]; + return declaration !== void 0 && declaration.name !== node && this.rustVecLocalIsTyped(declaration) ? declaration : void 0; + } + printRustVecPush(node, name, parsedArg) { + const receiver = node?.expression?.expression; + if (name === void 0 || parsedArg === void 0 || this.rustVecLocalDeclarationOf(receiver) === void 0) + return void 0; + const arg = parsedArg.trim(); + const value = /^[a-zA-Z_][a-zA-Z0-9_]*$/.test(arg) && arg !== "self" && arg !== "true" && arg !== "false" ? `${arg}.clone()` : arg; + return `${name}.push(${value})`; + } + transformIdentifier(node, identifier) { + const text = super.transformIdentifier(node, identifier); + const parent = node?.parent; + if (parent === void 0 || !(isReturnStatement4(parent) || isCallExpression6(parent) && parent.arguments.some((a) => a === node) && this.rustVecBoxingCallee(parent.expression) || parent.kind === SyntaxKind7.PropertyAssignment && parent.initializer === node)) + return text; + if (this.rustVecLocalDeclarationOf(node) === void 0) + return text; + return this.rustVecValueUse(node, String(node.text)) ? `Value::from(${text})` : `Value::from(${text}.clone())`; + } + // hx4 R05 — native IndexMap ops for `k in X`, `delete X[k]`, `Object.keys/values(X)`. + /** Source path of a node (forward slashes). */ + r05Path(node) { + const src = node?.getSourceFile?.(); + return typeof src?.fileName === "string" ? src.fileName.replace(/\\/g, "/") : ""; + } + /** Test sources keep the helpers: tests-pipeline post-passes match `in_op(` text. */ + r05IsTest(node) { + return /\/test\//.test(this.r05Path(node)); + } + /** `k in X` with a non-literal key on a dict-shaped receiver: `in_op`'s Dict arm. + * The Arr arm is the only other `true` path; the dict proof excludes it. */ + r05InOp(key, obj) { + const recv = this.rustStripWrappers(obj); + if (this.r05IsTest(obj) || !this.isShallowValueReceiver(recv) || this.rustParamShadowOf(recv) !== void 0 || isPropertyAccessExpression3(recv) && _RustTranspiler.RUST_TAGGED_CONTAINER_FIELDS.has(String(recv.name.text)) || !this.isDictShapedType(this.typeOfNodeIfAny(obj))) { + return void 0; + } + const objExpr = this.printNode(obj, 0).trim(); + const keyExpr = this.printNode(key, 0).trim(); + if (!/^[A-Za-z_][A-Za-z0-9_]*$/.test(keyExpr) || keyExpr === "self") { + return void 0; + } + return `Value::Bool(matches!((&${objExpr}, &${keyExpr}), (Value::Dict(__d), Value::Str(__k)) if __d.contains_key(__k.as_ref())))`; + } + /** `delete X[k]` on a receiver the native-insert proof admits (never a ws + * subscriptions snapshot, so `try_ws_subs_remove` is dead): `shift_remove`. */ + r05Delete(node) { + const target = node?.expression; + if (target === void 0 || !isElementAccessExpression4(target) || this.r05IsTest(node)) { + return void 0; + } + const base = target.expression; + const receiver = this.rustNativeInsertReceiver(base); + const restTier = /\/ts\/src\/[^/]+\.ts$/.test(this.r05Path(node)); + if (receiver !== void 0 && !receiver.isField && !restTier && receiver.plain !== true) { + return void 0; + } + if (receiver === void 0 || this.rustParamShadowOf(base) !== void 0 || !this.rustReceiverStaysDict(base, receiver) || receiver.isField && _RustTranspiler.RUST_TAGGED_CONTAINER_FIELDS.has(String(receiver.nameNode.text)) || !receiver.isField && this.rustLocalInitReadsTaggedContainer(base)) { + return void 0; + } + const recv = this.printNode(base, 0).trim(); + const keyNode = target.argumentExpression; + const literal = isStringLiteral3(keyNode) ? this.rustStringLiteralOf(this.printNode(keyNode, 0).trim()) : void 0; + if (literal !== void 0) { + return `if let Value::Dict(__d) = &mut ${recv} { std::sync::Arc::make_mut(__d).shift_remove(${literal}); }`; + } + const keyExpr = this.printNode(keyNode, 0).trim(); + if (!/^[A-Za-z_][A-Za-z0-9_]*$/.test(keyExpr) || keyExpr === "self" || keyExpr === recv) { + return void 0; + } + return `if let (Value::Dict(__d), Value::Str(__k)) = (&mut ${recv}, &${keyExpr}) { std::sync::Arc::make_mut(__d).shift_remove(__k.as_ref()); }`; + } + /** `this.` with a declared plain-dict type that is no ws container: the + * hand-written base builds these maps itself and never tags them. */ + r05UntaggedField(node) { + return isPropertyAccessExpression3(node) && node.expression.kind === SyntaxKind7.ThisKeyword && !_RustTranspiler.RUST_TAGGED_CONTAINER_FIELDS.has(String(node.name.text)) && !_RustTranspiler.RUST_TAGGED_HANDLE_FIELDS.has(String(node.name.text)) && this.rustProvenDictThisFieldR05(node); + } + rustProvenDictThisFieldR05(node) { + let declaration; + try { + declaration = symbolValueDeclaration(this.getChecker().getSymbolAtLocation(node.name)); + } catch (e) { + return false; + } + if (declaration === void 0 || declaration.kind !== SyntaxKind7.PropertyDeclaration || declaration.type === void 0) + return false; + const type = this.getCheckedTypeOf(declaration.type); + return type !== void 0 && this.isProvenMapType(type); + } + /** `Object.keys/values(X)` in REST-tier sources (`ts/src/.ts`): no ws client + * there, so X never carries the `__ws_subs_url`/`__ws_sub_ref` tags the helper filters. */ + r05Enum(node, parsedArg, kind) { + const arg = this.rustStripWrappers(node?.arguments?.[0]); + if (arg === void 0 || parsedArg === void 0 || !(/\/ts\/src\/[^/]+\.ts$/.test(this.r05Path(node)) || this.r05UntaggedField(arg)) || !(isIdentifier3(arg) || isPropertyAccessExpression3(arg) || isElementAccessExpression4(arg) || isCallExpression6(arg)) || this.rustParamShadowOf(arg) !== void 0) { + return void 0; + } + const type = this.typeOfNodeIfAny(arg); + const parts = type === void 0 ? [] : type.flags & TypeFlags6.Union ? typeParts(type) ?? [] : [type]; + if (parts.some((p) => this.getChecker().isArrayType(p) || this.getChecker().isTupleType(p) || (p.flags & (TypeFlags6.StringLike | TypeFlags6.NumberLike | TypeFlags6.BooleanLike | TypeFlags6.BigIntLike)) !== 0)) { + return void 0; + } + const text = parsedArg.trim(); + const recv = /^[A-Za-z_][A-Za-z0-9_.]*$/.test(text) ? text : `(${text})`; + const body = kind === "keys" ? "__m.keys().map(|__k| Value::Str(__k.clone().into())).collect()" : "__m.values().cloned().collect()"; + return `Value::Array(${recv}.as_map().map(|__m| ${body}).unwrap_or_default())`; + } + // hx4 R06: string methods on a checker-proven string receiver print native `str` code. The + // receiver is a `Value`; `as_str()` reaches the payload and its `None` arm is the helper's + // non-`Str` branch (Null / false / empty array / -1). Literal operands only, unless noted. + /** Printed receiver usable as a method receiver, else undefined. */ + rustNativeStringReceiver(node, receiverText, kind = "string") { + if (node === void 0 || !isCallExpression6(node) || !isPropertyAccessExpression3(node.expression)) + return void 0; + if (typeof receiverText !== "string" || receiverText.includes("\n") || receiverText.trim().startsWith("&")) + return void 0; + const receiver = node.expression.expression; + if (receiver.kind === SyntaxKind7.ThisKeyword || receiver.kind === SyntaxKind7.SuperKeyword) + return void 0; + if (kind === "string" && this.primitiveKindOfType(this.typeOfNodeIfAny(receiver)) !== "string") + return void 0; + if (isIdentifier3(receiver) && this.rustStringLocalIdentifierIsTyped(receiver)) + return void 0; + const text = receiverText.trim(); + return /^[A-Za-z_][A-Za-z0-9_]*(\.[A-Za-z_][A-Za-z0-9_]*)*$/.test(text) ? text : `(${text})`; + } + /** Escaped text of a string-literal argument, else undefined. */ + rustNativeStringLiteralArg(node) { + if (node === void 0 || !isStringLiteral3(node) && !isNoSubstitutionTemplateLiteral(node)) + return void 0; + if (node.text in this.StringLiteralReplacements) + return void 0; + return this.escapeRustStringLiteral(node.text); + } + // `x.toUpperCase()` / `x.toLowerCase()`: the helper's `Value::Str` arm, Null otherwise. + printNativeStringCase(node, receiverText, method) { + const receiver = this.rustNativeStringReceiver(node, receiverText); + if (receiver === void 0 || (node.arguments?.length ?? 0) !== 0) + return void 0; + return `${receiver}.as_str().map(|__s| Value::Str(__s.${method}().into())).unwrap_or(Value::Null)`; + } + // `x.startsWith("lit")` / `x.endsWith("lit")` → a bool (false for a non-`Str` receiver). + printNativeStringAffixTest(node, receiverText, method) { + const receiver = this.rustNativeStringReceiver(node, receiverText); + if (receiver === void 0 || node.arguments?.length !== 1) + return void 0; + const literal = this.rustNativeStringLiteralArg(node.arguments[0]); + if (literal === void 0) + return void 0; + return `${receiver}.as_str().is_some_and(|__s| __s.${method}("${literal}"))`; + } + // `x.split("lit")`: an array of the parts, the empty array for a non-`Str` receiver. + printNativeStringSplit(node, receiverText) { + const receiver = this.rustNativeStringReceiver(node, receiverText); + if (receiver === void 0 || node.arguments?.length !== 1) + return void 0; + const literal = this.rustNativeStringLiteralArg(node.arguments[0]); + if (literal === void 0) + return void 0; + return `Value::Array(${receiver}.as_str().map(|__s| __s.split("${literal}").map(|__p| Value::Str(__p.to_string().into())).collect()).unwrap_or_default())`; + } + // `x.replace("a", "b")`: the helper replaces every occurrence (`str::replace`), else the receiver. + printNativeStringReplace(node, receiverText) { + const receiver = this.rustNativeStringReceiver(node, receiverText); + if (receiver === void 0 || node.arguments?.length !== 2) + return void 0; + const from = this.rustNativeStringLiteralArg(node.arguments[0]); + const to = this.rustNativeStringLiteralArg(node.arguments[1]); + if (from === void 0 || to === void 0) + return void 0; + return `${receiver}.as_str().map(|__s| Value::Str(__s.replace("${from}", "${to}").into())).unwrap_or_else(|| ${receiver}.clone())`; + } + // `x.padStart(N, "c")` with a one-char alphanumeric pad: `format!` width counts chars and never + // truncates, which is the helper's arm for a one-char pad. + printNativeStringPadStart(node, receiverText) { + const receiver = this.rustNativeStringReceiver(node, receiverText); + if (receiver === void 0 || node.arguments?.length !== 2) + return void 0; + const width = this.rustSliceLiteralBound(node.arguments[0]); + const pad = node.arguments[1]; + if (width === void 0 || width < 0 || width > 4096) + return void 0; + if (!isStringLiteral3(pad) && !isNoSubstitutionTemplateLiteral(pad) || !/^[A-Za-z0-9 ]$/.test(pad.text)) + return void 0; + return `${receiver}.as_str().map(|__s| Value::Str(format!("{:${pad.text}>${width}}", __s).into())).unwrap_or(Value::Null)`; + } + // `x.indexOf(y)` with a proven-string needle: `-1` when either side is not a `Str` (byte index). + printNativeStringIndexOfString(node, receiverText) { + const receiver = this.rustNativeStringReceiver(node, receiverText); + if (receiver === void 0 || node.arguments?.length !== 1) + return void 0; + const needle = node.arguments[0]; + if (!isIdentifier3(needle) || this.primitiveKindOfType(this.typeOfNodeIfAny(needle)) !== "string") + return void 0; + if (!this.isDeclaredValueIdentifier(needle) || this.rustStringLocalIdentifierIsTyped(needle)) + return void 0; + const needleText = this.printNode(needle, 0).trim(); + if (!/^[A-Za-z_][A-Za-z0-9_]*$/.test(needleText)) + return void 0; + return `Value::Int(${receiver}.as_str().zip(${needleText}.as_str()).and_then(|(__s, __n)| __s.find(__n)).map(|__i| __i as i64).unwrap_or(-1))`; + } + // `xs.join("lit")` on a `string[]`: `Display` renders `Str`/`Null` like the helper does. + printNativeStringJoin(node, receiverText) { + const receiver = this.rustNativeStringReceiver(node, receiverText, "array"); + if (receiver === void 0 || node.arguments?.length !== 1) + return void 0; + const literal = this.rustNativeStringLiteralArg(node.arguments[0]); + if (literal === void 0) + return void 0; + const checker = this.checkerOrUndefined(); + const type = this.typeOfNodeIfAny(node.expression.expression); + if (checker === void 0 || type === void 0 || !checker.isArrayType(type)) + return void 0; + const element = checker.getTypeArguments?.(type)?.[0]; + if (this.primitiveKindOfType(element) !== "string") + return void 0; + return `Value::Str(${receiver}.as_array().map(|__a| __a.iter().map(|__v| __v.to_string()).collect::>().join("${literal}")).unwrap_or_default().into())`; + } + // hx4 R07 — numeric/string helpers on checker-proven `number` / `string` operands (nullish members + // allowed: the helper's Null arm is reproduced). Each native form answers exactly what the helper + // answers for Int/Float/Str/Null boxes; any other operand type keeps the helper. + rustOperandKind(node) { + try { + if (node === void 0 || !this.printsValueExpression(node)) + return void 0; + return this.primitiveKindOfType(this.typeOfNodeIfAny(node)); + } catch (e) { + return void 0; + } + } + // `x.toString()` on a number/string: `to_string_val` is `stringify_simple`, i.e. `Display`. + // Typed `Option` receivers have no `Display`, so they keep the helper. + printRustNativeToString(node, name) { + const receiver = node?.expression?.expression; + const kind = this.rustOperandKind(receiver); + if (kind !== "number" && kind !== "string") + return void 0; + const inner = this.unwrapParensNode(receiver); + if (inner !== void 0 && (this.rustStringLocalIdentifierIsTyped(inner) || this.rustNativeStrCalleeKind(inner) === "str")) + return void 0; + return `Value::Str(format!("{}", ${name}).into())`; + } + // `Math.floor|round|ceil(n)`: the helper answers `Float(op(x))` for a numeric box, `Null` otherwise. + printRustNativeMathCall(node, op, parsedArg) { + if (this.rustOperandKind(node?.arguments?.[0]) !== "number") + return void 0; + return `(${parsedArg}).as_f64().map(|__x| Value::Float(__x.${op}())).unwrap_or(Value::Null)`; + } + // `-n`: Int/Float flip sign in place, a Null box stays Null (helper's fallthrough). + printRustNativeNegate(operand, operandText) { + if (this.rustOperandKind(operand) !== "number" && this.rustR16NumericKind(operand) === void 0) + return void 0; + return `(match &(${operandText}) { Value::Int(x) => Value::Int(-x), Value::Float(x) => Value::Float(-x), _ => Value::Null })`; + } + // `a % b` on numbers: Int pair stays Int, any Float widens; a zero divisor or Null answers Null. + printRustNativeMod(left, right, leftText, rightText) { + if (this.rustOperandKind(left) !== "number" || this.rustOperandKind(right) !== "number") + return void 0; + return `(match (&(${leftText}), &(${rightText})) { (Value::Int(x), Value::Int(y)) if *y != 0 => Value::Int(x % y), (Value::Int(x), Value::Float(y)) if *y != 0.0 => Value::Float(*x as f64 % *y), (Value::Float(x), Value::Int(y)) if *y != 0 => Value::Float(*x % *y as f64), (Value::Float(x), Value::Float(y)) if *y != 0.0 => Value::Float(x % y), _ => Value::Null })`; + } + // hx4 R09 — `.length` always prints `Value::Int` (`get_array_length` / `Value::Int(len)`), so a + // `.length` read, or a `const` local initialised from one, is a never-null Int whatever its receiver. + rustR09IsDefiniteInt(node) { + const inner = this.rustStripWrappers(node); + if (inner === void 0) + return false; + if (isPropertyAccessExpression3(inner)) + return String(inner.name.text) === "length"; + if (!isIdentifier3(inner)) + return false; + const declaration = this.rustSingleLocalDeclaration(inner); + if (declaration === void 0 || !isVariableDeclaration3(declaration) || declaration.name?.kind !== SyntaxKind7.Identifier) + return false; + if ((declaration.parent?.flags & NodeFlags2.Const) === 0) + return false; + const init = this.rustStripWrappers(declaration.initializer); + return init !== void 0 && isPropertyAccessExpression3(init) && String(init.name.text) === "length"; + } + // Int-only (definite) or checker-proven number (Int/Float/Null) operand that prints a `Value`. + rustR09NumericOperand(node) { + if (this.rustR09IsDefiniteInt(node)) + return "definite"; + return this.rustOperandKind(node) === "number" ? "number" : void 0; + } + // `a === b` with a definite Int side against a number literal, a number or another definite Int: + // is_equal compares Int/Float payloads as f64 and Null only equals Null, which `as_f64()` mirrors. + rustR09LengthEquality(left, right, op) { + if (!this.rustR09IsDefiniteInt(left) && !this.rustR09IsDefiniteInt(right)) + return void 0; + const operator = op === SyntaxKind7.EqualsEqualsToken || op === SyntaxKind7.EqualsEqualsEqualsToken ? "==" : "!="; + const [definite, other] = this.rustR09IsDefiniteInt(left) ? [left, right] : [right, left]; + if (!this.printsValueExpression(definite)) + return void 0; + const otherInner = this.rustStripWrappers(other); + if (otherInner !== void 0 && otherInner.kind === SyntaxKind7.NumericLiteral) { + const text = this.numericLiteralF64Text(otherInner); + if (text === void 0) + return void 0; + return `${this.printNode(definite, 0)}.as_f64() ${operator} Some(${text})`; + } + if (this.rustR09NumericOperand(other) === void 0) + return void 0; + return `${this.printNode(left, 0)}.as_f64() ${operator} ${this.printNode(right, 0)}.as_f64()`; + } + // `a + b` / `a - b` with a definite Int operand and a numeric one: the helper's Int/Float dispatch. + // `s + n` / `n + s` with s a non-null string and n numeric: the helper's string branch, i.e. + // `stringify_simple` of each side, which equals `Display` for Str/Int/Float/Null. + rustR09NativeAddSubtract(op, left, right, leftType, rightType, leftText, rightText) { + if (op !== SyntaxKind7.PlusToken && op !== SyntaxKind7.MinusToken) + return void 0; + const leftNumeric = this.rustR09NumericOperand(left); + const rightNumeric = this.rustR09NumericOperand(right); + if (leftNumeric === "definite" && rightNumeric !== void 0 || rightNumeric === "definite" && leftNumeric !== void 0) { + return this.printNativeNumeric(op, leftText, rightText); + } + if (op !== SyntaxKind7.PlusToken) + return void 0; + const stringSide = this.isStringLikeType(leftType) && rightNumeric !== void 0 ? left : this.isStringLikeType(rightType) && leftNumeric !== void 0 ? right : void 0; + if (stringSide === void 0 || !this.printsValueExpression(stringSide)) + return void 0; + const inner = this.unwrapParensNode(stringSide); + if (inner !== void 0 && (this.rustStringLocalIdentifierIsTyped(inner) || this.rustNativeStrCalleeKind(inner) === "str")) + return void 0; + return this.printNativeStringConcat(leftText, rightText); + } + // hx4 R10 — native reads on receivers the R01 plain-dict proof admits (tag-free literal / + // `account ()` / `omit` / `extend` / tuple element 0 locals) and on `Dict`-annotated parameters + // whose writes keep them plain: no marker route of `get_value` can fire on such a receiver. + /** 'local' for an R01-proven plain-dict local, 'param' for a plain-kept dict parameter. */ + rustR10PlainReceiver(node) { + if (node === void 0 || !isIdentifier3(node) || this.rustParamShadowOf(node) !== void 0) + return void 0; + const declaration = this.rustSingleLocalDeclaration(node); + if (declaration !== void 0 && isParameterDeclaration3(declaration)) { + if (declaration.type === void 0 || declaration.dotDotDotToken !== void 0) + return void 0; + const type = this.getCheckedTypeOf(declaration.type); + if (type === void 0 || !this.isProvenMapType(type)) + return void 0; + return this.rustParamStaysPlainDict(declaration) ? "param" : void 0; + } + try { + return this.rustR01LocalStaysPlain(node) || this.rustR01ShippedPlain(node) ? "local" : void 0; + } catch (e) { + return void 0; + } + } + /** A literal-key read (`x['k']` / `x.k`) on a proven plain receiver. */ + rustR10LiteralReadOk(receiverNode, keyText) { + const kind = this.rustR10PlainReceiver(receiverNode); + if (kind === void 0 || keyText === "") + return false; + if (kind === "param" && _RustTranspiler.RUST_DICT_LOCAL_UNSAFE_KEYS.has(keyText)) + return false; + const read = receiverNode.parent; + return read === void 0 || !this.isWriteBackBindRead(read); + } + /** `x[k]` on a proven plain receiver with a `Value` key place (`string` or `any` typed). */ + rustR10DynamicRead(receiverText, receiverNode, keyNode) { + const kind = this.rustR10PlainReceiver(receiverNode); + if (kind === void 0) + return void 0; + const key = this.rustSkipWrappers(keyNode); + if (key === void 0 || !isIdentifier3(key) || this.rustStringLocalIdentifierIsTyped(key)) + return void 0; + const type = this.getCheckedTypeOf(key); + if (type === void 0 || !(type.flags & TypeFlags6.Any || this.rustKeyIsProvenString(key))) + return void 0; + const read = this.rustElementReadOfKey(keyNode); + if (read !== void 0 && this.isWriteBackBindRead(read)) + return void 0; + const keyText = this.printNode(keyNode, 0).trim(); + if (!/^[A-Za-z_][A-Za-z0-9_]*$/.test(keyText)) + return void 0; + if (kind === "param" && this.rustNodeIsKeyUnsafePlace(keyText)) + return void 0; + return `${receiverText}.as_map().and_then(|__m| ${keyText}.as_str().and_then(|__k| __m.get(__k))).cloned().unwrap_or(Value::Null)`; + } + // hx4 R11 — typed `Vec` locals also admit an argument of a non-`&mut self` `this.m(..)` + // call that is not the final use (boxed as `Value::from(x.clone())`, the clone the post-pass + // gave the boxed local) and a plain `x[i]` read with a number index (native `Vec::get`). + r11VecUse(n) { + const parent = n.parent; + if (isCallExpression6(parent) && parent.arguments.some((a) => a === n)) { + const callee = parent.expression; + if (!isPropertyAccessExpression3(callee)) + return false; + const kind = callee.expression.kind; + if (kind !== SyntaxKind7.ThisKeyword && kind !== SyntaxKind7.SuperKeyword) + return false; + if (_RustTranspiler.MUT_SELF_METHODS.has(this.toSnakeCaseName(String(callee.name.text)))) + return false; + let mentions = 0; + const visit = (m) => { + if (m.kind === SyntaxKind7.Identifier && m.text === n.text) + mentions++; + m.forEachChild?.(visit); + }; + parent.arguments.forEach(visit); + if (mentions !== 1) + return false; + return this.rustVecValueUse(n, String(n.text)) || !this.r11LoopBetween(n); + } + return isElementAccessExpression4(parent) && parent.expression === n && this.r11VecReadShape(parent); + } + // A loop around the use that does not also hold the declaration: a per-iteration Vec clone + // would cost O(n) where the boxed local only bumped its Arc. + r11LoopBetween(n) { + const declaration = this.rustVecLocalDeclarationOf(n) ?? this.rustSingleLocalDeclaration(n); + const fn = this.rustEnclosingFunction(n); + for (let current = n.parent; current !== void 0 && current !== fn; current = current.parent) { + if (declaration !== void 0 && this.isNodeInsideNode(declaration, current)) + return false; + switch (current.kind) { + case SyntaxKind7.ForStatement: + case SyntaxKind7.ForInStatement: + case SyntaxKind7.ForOfStatement: + case SyntaxKind7.WhileStatement: + case SyntaxKind7.DoStatement: + return true; + } + } + return false; + } + // `x[k]` as a plain value read: not a write/delete/++ target, not a chain or call receiver, + // not a bind the next statement mutates (ccxt's write-back keys on `get_value` text). + r11VecReadShape(access) { + const up = access.parent; + if (up === void 0 || isDeleteExpression2(up) || up.kind === SyntaxKind7.PrefixUnaryExpression || up.kind === SyntaxKind7.PostfixUnaryExpression) + return false; + if (isBinaryExpression5(up) && up.left === access && rustIsAssignmentOperator(up.operatorToken.kind)) + return false; + if ((isPropertyAccessExpression3(up) || isElementAccessExpression4(up) || isCallExpression6(up)) && up.expression === access) + return false; + if (this.isWriteBackBindRead(access)) + return false; + const key = this.rustStripWrappers(access.argumentExpression); + if (key === void 0) + return false; + if (isNumericLiteral4(key)) + return Number.isInteger(Number(key.text)) && Number(key.text) >= 0; + return this.isRustValueIndexKey(key); + } + printElementAccessExpressionExceptionIfAny(node) { + const receiver = node?.expression; + if (receiver?.kind !== SyntaxKind7.Identifier || this.rustVecLocalDeclarationOf(receiver) === void 0 || !this.r11VecReadShape(node)) + return super.printElementAccessExpressionExceptionIfAny(node); + const name = this.printNode(receiver, 0).trim(); + const key = this.rustStripWrappers(node.argumentExpression); + const index = isNumericLiteral4(key) ? String(Number(key.text)) : `(${this.printNode(node.argumentExpression, 0).trim()}).as_i64().map_or(usize::MAX, |__n| __n as usize)`; + return `${name}.get(${index}).cloned().unwrap_or(Value::Null)`; + } + // An expression that always holds a `Value::Arr`: a runtime-split / array-literal-returning call, + // or a never-reassigned local initialised from one (through `const y = x` aliases). + r11ProvenListValue(node, depth = 0) { + const inner = this.rustStripWrappers(node); + if (inner === void 0 || depth > 4 || this.rustIsOrderBookSide(inner)) + return false; + if (isCallExpression6(inner)) + return this.rustCallReturnsProvenList(inner); + if (!isIdentifier3(inner)) + return false; + const declaration = this.rustSingleLocalDeclaration(inner); + if (declaration === void 0 || !isVariableDeclaration3(declaration) || declaration.initializer === void 0 || !isIdentifier3(declaration.name)) + return false; + if (this.rustLocalIsReassigned(declaration, String(declaration.name.text))) + return false; + return this.r11ProvenListValue(declaration.initializer, depth + 1); + } + rustR12PlainSource(node, depth = 0) { + if (depth > 4 || !isCallExpression6(node) || !isPropertyAccessExpression3(node.expression) || node.expression.expression.kind !== SyntaxKind7.ThisKeyword || !this.r23PlainSourceTier(node)) { + return false; + } + const callee = String(node.expression.name.text); + const defaultIndex = _RustTranspiler.RUST_R12_DICT_READERS[callee]; + if (defaultIndex !== void 0) { + const fallback = this.rustStripWrappers(node.arguments[defaultIndex]); + return this.rustR01CalleeIsBase(node) && node.arguments.length <= defaultIndex + 1 && (fallback === void 0 || this.rustPlainDictLiteral(fallback) || this.rustTypeIsUndefinedish(fallback)) && this.rustR12UnsharedDict(node.arguments[0]) && this.r23TierSourceOk(node.arguments[0]); + } + if (this.r23FreshCopy(node, depth)) + return true; + return this.rustR12PlainBuilder(node, depth); + } + /** `this.options`, a parameter, or a const local whose initializer reads no `this` field + * but `options` and no tagged container (`hashmap`, `subscriptions`, `futures`). */ + rustR12UnsharedDict(arg) { + const node = this.rustStripWrappers(arg); + if (node === void 0) + return false; + if (isPropertyAccessExpression3(node) && node.expression.kind === SyntaxKind7.ThisKeyword) { + return String(node.name.text) === "options"; + } + if (!isIdentifier3(node)) + return false; + const declaration = this.rustSingleLocalDeclaration(node); + if (declaration === void 0) + return false; + if (isParameterDeclaration3(declaration)) + return true; + if (!isVariableDeclaration3(declaration) || (declaration.parent?.flags & NodeFlags2.Const) === 0 || declaration.initializer === void 0) + return false; + let clean = true; + const visit = (n) => { + if (!clean) + return; + if (isPropertyAccessExpression3(n)) { + const field = String(n.name.text); + const isCallee = isCallExpression6(n.parent) && n.parent.expression === n; + if (_RustTranspiler.RUST_TAGGED_CONTAINER_FIELDS.has(field) || n.expression.kind === SyntaxKind7.ThisKeyword && !isCallee && field !== "options") { + clean = false; + return; + } + } + n.forEachChild(visit); + }; + visit(declaration.initializer); + return clean; + } + /** `this.m (…)` on a sync method of the calling file whose every `return` is a plain + * literal, a plain local, or `this.extend|omit|keysort (plain, …unshared)`. */ + rustR12PlainBuilder(call, depth) { + const method = this.rustR12MethodImpl(call); + if (method === void 0 || method.getSourceFile() !== call.getSourceFile() || (method.modifiers ?? []).some((m) => m.kind === SyntaxKind7.AsyncKeyword)) { + return false; + } + if (this.rustR12Visiting.has(method)) + return false; + this.rustR12Visiting.add(method); + let plain = true; + let returns = 0; + try { + this.rustWalkScope(method.body, (n) => { + if (isArrowFunction5(n) || n.kind === SyntaxKind7.FunctionExpression) + return RUST_WALK_SKIP; + if (!isReturnStatement4(n)) + return; + returns++; + if (!this.rustR12PlainReturn(n.expression, depth)) { + plain = false; + return RUST_WALK_STOP; + } + }); + } finally { + this.rustR12Visiting.delete(method); + } + return plain && returns > 0; + } + rustR12PlainReturn(expr, depth) { + const node = this.rustStripWrappers(expr); + if (node === void 0) + return false; + const plainHead = (head) => { + const h = this.rustStripWrappers(head); + return h !== void 0 && (this.rustPlainDictLiteral(h) || isIdentifier3(h) && this.rustR01LocalStaysPlain(h, depth + 1) || this.rustR12PlainSource(h, depth + 1)); + }; + if (plainHead(node)) + return true; + if (!isCallExpression6(node) || !isPropertyAccessExpression3(node.expression) || node.expression.expression.kind !== SyntaxKind7.ThisKeyword || node.arguments.length === 0 || !this.rustR01CalleeIsBase(node)) { + return false; + } + const callee = String(node.expression.name.text); + if (callee === "omit" || callee === "keysort") + return plainHead(node.arguments[0]); + return callee === "extend" && plainHead(node.arguments[0]) && node.arguments.slice(1).every((a) => plainHead(a) || this.rustR12UnsharedDict(a) && this.r23TierSourceOk(a)); + } + /** The single bodied method declaration `this.m (…)` resolves to (implementation of an + * overload set), in the calling file or the base tier. */ + rustR12MethodImpl(call) { + const checker = this.checkerOrUndefined(); + const callee = call?.expression; + if (checker === void 0 || !isPropertyAccessExpression3(callee) || callee.expression.kind !== SyntaxKind7.ThisKeyword) { + return void 0; + } + let declarations; + try { + declarations = symbolDeclarations(checker.getSymbolAtLocation(callee.name)).filter((d) => d.kind === SyntaxKind7.MethodDeclaration && d.body !== void 0); + } catch (e) { + return void 0; + } + const callerFile = String(call.getSourceFile().fileName).replace(/\\/g, "/"); + if (declarations.length !== 1 || _RustTranspiler.RUST_BASE_TIER_FILE.test(callerFile)) + return void 0; + const file = String(declarations[0].getSourceFile().fileName).replace(/\\/g, "/"); + return declarations[0].getSourceFile() === call.getSourceFile() || _RustTranspiler.RUST_BASE_TIER_FILE.test(file) ? declarations[0] : void 0; + } + /** The expression's Rust value is always `Value::Bool(_)` or `Value::Null`. */ + rustR12BoolValue(expr, depth = 0) { + let node = this.rustStripWrappers(expr); + while (node !== void 0 && node.kind === SyntaxKind7.AwaitExpression) + node = this.rustStripWrappers(node.expression); + if (node === void 0 || depth > 5) + return false; + switch (node.kind) { + case SyntaxKind7.TrueKeyword: + case SyntaxKind7.FalseKeyword: + case SyntaxKind7.NullKeyword: + return true; + case SyntaxKind7.Identifier: + return node.text === "undefined" || this.rustR12BoolLocal(node, depth + 1); + case SyntaxKind7.PrefixUnaryExpression: + return node.operator === SyntaxKind7.ExclamationToken; + case SyntaxKind7.BinaryExpression: { + const op = node.operatorToken.kind; + return _RustTranspiler.COMPARISON_OPS.has(op) || this.isLogicalOp(op); + } + case SyntaxKind7.ConditionalExpression: + return this.rustR12BoolValue(node.whenTrue, depth + 1) && this.rustR12BoolValue(node.whenFalse, depth + 1); + case SyntaxKind7.CallExpression: + return this.rustR12BoolCall(node, depth); + } + return false; + } + /** A base `safeBool*` with a bool default, `checkOptionBool`, or a method (calling file or + * base tier) whose every `return` is such a value. */ + rustR12BoolCall(call, depth) { + if (!isPropertyAccessExpression3(call.expression) || call.expression.expression.kind !== SyntaxKind7.ThisKeyword) + return false; + const reader = _RustTranspiler.RUST_R12_BOOL_READERS[String(call.expression.name.text)]; + if (reader !== void 0) { + if (!this.rustR01CalleeIsBase(call)) + return false; + return reader < 0 || call.arguments.length <= reader || call.arguments.length === reader + 1 && this.rustR12BoolValue(call.arguments[reader], depth + 1); + } + let sawBool = false; + return this.rustR12EveryReturn(call, depth, (e) => { + const nullish = this.rustTypeIsUndefinedish(this.rustStripWrappers(e) ?? e); + sawBool = sawBool || !nullish; + return nullish || this.rustR12BoolValue(e, depth + 1); + }) && sawBool; + } + rustR12EveryReturn(call, depth, ok) { + const method = this.rustR12MethodImpl(call); + if (method === void 0 || this.rustR12Visiting.has(method)) + return false; + this.rustR12Visiting.add(method); + let proven = true; + let returns = 0; + try { + this.rustWalkScope(method.body, (n) => { + if (isArrowFunction5(n) || n.kind === SyntaxKind7.FunctionExpression) + return RUST_WALK_SKIP; + if (!isReturnStatement4(n)) + return; + returns++; + if (n.expression === void 0 || !ok(n.expression)) { + proven = false; + return RUST_WALK_STOP; + } + }); + } finally { + this.rustR12Visiting.delete(method); + } + return proven && returns > 0; + } + /** Element `index` of `this.m (…)`'s tuple is a bool value on every return path. */ + rustR12BoolTupleElement(expr, index, depth) { + let call = this.rustStripWrappers(expr); + while (call !== void 0 && call.kind === SyntaxKind7.AwaitExpression) + call = this.rustStripWrappers(call.expression); + if (call === void 0 || !isCallExpression6(call) || depth > 5) + return false; + return this.rustR12EveryReturn(call, depth, (e) => { + const tuple = this.rustStripWrappers(e); + if (tuple?.kind === SyntaxKind7.ArrayLiteralExpression) { + const element = tuple.elements[index]; + return element !== void 0 && element.kind !== SyntaxKind7.SpreadElement && this.rustR12BoolValue(element, depth + 1); + } + return this.rustR12BoolTupleElement(tuple, index, depth + 1); + }); + } + /** A local whose declaration and every write store a bool value. Locals the printer or + * ccxt's narrowBoolLocals may declare `bool` (bool-expression initializer) are left out. */ + rustR12BoolLocal(ident, depth) { + const checker = this.checkerOrUndefined(); + if (depth > 5) + return false; + const declarations = checker === void 0 ? [] : symbolDeclarations(checker.getSymbolAtLocation(ident)); + const declaration = declarations.length === 1 ? declarations[0] : void 0; + if (declaration === void 0) + return false; + let nameNode; + let variable; + if (declaration.kind === SyntaxKind7.BindingElement) { + const pattern = declaration.parent; + variable = pattern?.parent; + if (pattern?.kind !== SyntaxKind7.ArrayBindingPattern || variable === void 0 || !isVariableDeclaration3(variable) || declaration.initializer !== void 0 || declaration.dotDotDotToken !== void 0 || declaration.name?.kind !== SyntaxKind7.Identifier || !this.rustR12BoolTupleElement(variable.initializer, pattern.elements.indexOf(declaration), depth)) { + return false; + } + nameNode = declaration.name; + } else if (isVariableDeclaration3(declaration) && declaration.name?.kind === SyntaxKind7.Identifier) { + const init = this.rustStripWrappers(declaration.initializer); + if (init !== void 0 && (this.rustNodeIsBoolExpression(init) || !(this.rustTypeIsUndefinedish(init) || isIdentifier3(init) && init.text === "undefined" || this.rustR12BoolValue(init, depth)))) { + return false; + } + variable = declaration; + nameNode = declaration.name; + } else { + return false; + } + const scope = this.rustEnclosingFunction(variable); + const symbol = this.rustSymbolOf(nameNode); + const name = String(nameNode.text); + if (scope === void 0 || isSourceFile5(scope) || symbol === void 0) + return false; + for (const node of this.rustScopeNameNodes(scope, name)) { + if (node.kind !== SyntaxKind7.Identifier || node === nameNode || this.rustSymbolOf(node) !== symbol) + continue; + if (this.rustEnclosingFunction(node) !== scope) + return false; + let target = node; + while (target.parent !== void 0 && (isParenthesizedExpression3(target.parent) || isNonNullExpression2(target.parent) || isAsExpression3(target.parent))) + target = target.parent; + const parent = target.parent; + if (isBinaryExpression5(parent) && parent.left === target && rustIsAssignmentOperator(parent.operatorToken.kind)) { + if (parent.operatorToken.kind !== SyntaxKind7.EqualsToken || this.rustNodeIsBoolExpression(this.rustStripWrappers(parent.right)) || !this.rustR12BoolValue(parent.right, depth)) + return false; + } else if (parent?.kind === SyntaxKind7.ArrayLiteralExpression) { + const assign = parent.parent; + if (assign !== void 0 && isBinaryExpression5(assign) && assign.left === parent && !this.rustR12BoolTupleElement(assign.right, parent.elements.indexOf(target), depth)) + return false; + } else if (parent?.kind === SyntaxKind7.PrefixUnaryExpression && parent.operator !== SyntaxKind7.ExclamationToken || parent?.kind === SyntaxKind7.PostfixUnaryExpression || parent?.kind === SyntaxKind7.DeleteExpression || (isForOfStatement2(parent) || isForInStatement2(parent)) && parent.initializer === target) { + return false; + } + } + return true; + } + /** `if (x)` on a local or `this.m (…)` proven a bool value: `x.as_bool() == Some(true)` + * is `is_true` on `Value::Bool`/`Value::Null`; bool slots only (leading-token boxing). */ + rustR12NativeTruthiness(node) { + const inner = this.unwrapParens(node); + if (inner === void 0 || !isIdentifier3(inner) && !isCallExpression6(inner) || !this.printsValueExpression(inner) || !this.isBareBoolEmissionSafe(node) || isCallExpression6(inner) && this.rustCallPrintsBool(inner) || !this.rustR12BoolValue(inner)) { + return void 0; + } + const text = `${this.printNode(inner, 0)}.as_bool() == Some(true)`; + let current = node; + while (current.parent !== void 0 && isParenthesizedExpression3(current.parent)) + current = current.parent; + const negated = current.parent?.kind === SyntaxKind7.PrefixUnaryExpression && current.parent.operator === SyntaxKind7.ExclamationToken; + return negated ? `(${text})` : text; + } + /** `x === true|false` with `x` proven a bool value: `is_equal` against a `Value::Bool` is + * the payload compare there (Null matches neither). */ + rustR12NativeBoolEquality(left, right, op) { + const leftLiteral = left.kind === SyntaxKind7.TrueKeyword || left.kind === SyntaxKind7.FalseKeyword; + const rightLiteral = right.kind === SyntaxKind7.TrueKeyword || right.kind === SyntaxKind7.FalseKeyword; + if (leftLiteral === rightLiteral) + return void 0; + const [literal, other] = leftLiteral ? [left, right] : [right, left]; + const inner = this.unwrapParens(other); + if (inner === void 0 || !isIdentifier3(inner) && !isCallExpression6(inner) || !this.printsValueExpression(inner) || isCallExpression6(inner) && this.rustCallPrintsBool(inner) || !this.rustR12BoolValue(inner)) { + return void 0; + } + const operator = op === SyntaxKind7.EqualsEqualsToken || op === SyntaxKind7.EqualsEqualsEqualsToken ? "==" : "!="; + return `${this.printNode(inner, 0)}.as_bool() ${operator} Some(${literal.kind === SyntaxKind7.TrueKeyword ? "true" : "false"})`; + } + // hx4 R13 — proven-`Str` operands: a `this.safeString*` call (no default or a string-literal + // default) or a native-`Str` callee re-boxed into `Value`, or a `const`/never-reassigned local + // initialized from one, can only hold `Value::Str` / `Value::Null`, whatever its TS type says. + rustR13ProvenStrSource(node) { + const inner = this.unwrapParensNode(node); + if (inner === void 0 || !isCallExpression6(inner)) + return false; + if (this.rustNativeStrCalleeKind(inner) === "str") + return true; + const callee = inner.expression; + if (!isPropertyAccessExpression3(callee) || callee.expression.kind !== SyntaxKind7.ThisKeyword) + return false; + const name = callee.name.text; + if (!_RustTranspiler.RUST_STRING_LOCAL_HELPERS.has(name)) + return false; + const arity = /N$/.test(name) || !/2$/.test(name) ? 2 : 3; + const args = inner.arguments ?? []; + if (args.length === arity) + return true; + return args.length === arity + 1 && (isStringLiteral3(args[arity]) || isNoSubstitutionTemplateLiteral(args[arity])); + } + rustR13ProvenStrIdentifier(node) { + if (node === void 0 || !isIdentifier3(node) || this.rustStringLocalIdentifierIsTyped(node)) + return false; + const checker = this.checkerOrUndefined(); + const declarations = checker === void 0 ? [] : symbolDeclarations(checker.getSymbolAtLocation(node)); + if (declarations.length !== 1 || !isVariableDeclaration3(declarations[0])) + return false; + const declaration = declarations[0]; + if (declaration.name?.kind !== SyntaxKind7.Identifier || !this.rustR13ProvenStrSource(declaration.initializer)) + return false; + return this.rustLocalUsesAll(declaration, declaration.name.text, true, (n) => { + if (this.rustR13WriteTarget(n)) + return false; + const parent = n.parent; + if (parent?.kind !== SyntaxKind7.BinaryExpression || parent.left !== n) + return !(parent?.kind === SyntaxKind7.PrefixUnaryExpression || parent?.kind === SyntaxKind7.PostfixUnaryExpression) || parent.operator === SyntaxKind7.ExclamationToken; + const op = parent.operatorToken.kind; + if (op < SyntaxKind7.FirstAssignment || op > SyntaxKind7.LastAssignment) + return true; + return op === SyntaxKind7.EqualsToken && this.rustR13ProvenStrSource(parent.right); + }); + } + /** A destructuring / for-in-of target: a write the direct-assignment check cannot see. */ + rustR13WriteTarget(node) { + let current = node; + let parent = node.parent; + while (parent !== void 0 && (isArrayLiteralExpression4(parent) || isObjectLiteralExpression4(parent) || isParenthesizedExpression3(parent) || parent.kind === SyntaxKind7.PropertyAssignment || parent.kind === SyntaxKind7.ShorthandPropertyAssignment || parent.kind === SyntaxKind7.SpreadElement)) { + current = parent; + parent = parent.parent; + } + if ((isForOfStatement2(parent) || isForInStatement2(parent)) && parent.initializer === current) + return true; + return current !== node && isBinaryExpression5(parent) && parent.left === current && parent.operatorToken.kind === SyntaxKind7.EqualsToken; + } + /** `x` / `(x as string)` → the identifier under parens / `as`. */ + rustR13PeelCast(node) { + let current = node; + while (current !== void 0 && (isParenthesizedExpression3(current) || isAsExpression3(current))) + current = current.expression; + return current; + } + /** Printed text of an operand that is always `Value::Str` / `Value::Null`, else undefined: + * a proven-`Str` local, a checker-`string` declared local/param (the R06 needle rule), or + * `"lit" + e` / `e + "lit"` (the `add` helper's string branch always yields `Value::Str`). */ + rustR13StrOperand(node, allowChecker) { + const inner = this.rustR13PeelCast(node); + if (inner === void 0) + return void 0; + if (isIdentifier3(inner)) { + if (this.rustStringLocalIdentifierIsTyped(inner)) + return void 0; + const proven = this.rustR13ProvenStrIdentifier(inner); + const checked = allowChecker && this.isDeclaredValueIdentifier(inner) && this.primitiveKindOfType(this.typeOfNodeIfAny(inner)) === "string"; + if (!proven && !checked) + return void 0; + const text = this.printNode(inner, 0).trim(); + return /^[A-Za-z_][A-Za-z0-9_]*$/.test(text) ? text : void 0; + } + if (allowChecker && isBinaryExpression5(inner) && inner.operatorToken.kind === SyntaxKind7.PlusToken && (isStringLiteral3(inner.left) || isStringLiteral3(inner.right))) { + const text = this.printNode(inner, 0).trim(); + return text.includes("\n") ? void 0 : `(${text})`; + } + return void 0; + } + // `a === b` with both sides proven `Str`/`Null`: `is_equal` is exactly the derived `PartialEq` + // there (Null==Null, Str by content, Str vs Null false — its f64 fallback needs a number). + printRustR13ProvenStrEquality(left, right, op) { + if (!this.rustR13ProvenStrIdentifier(this.unwrapParensNode(left)) || !this.rustR13ProvenStrIdentifier(this.unwrapParensNode(right))) + return void 0; + const operator = op === SyntaxKind7.EqualsEqualsToken || op === SyntaxKind7.EqualsEqualsEqualsToken ? "==" : "!="; + return `${this.printNode(left, 0)} ${operator} ${this.printNode(right, 0)}`; + } + /** Receiver text when the call's receiver is a proven-`Str` local (R06 covers checker strings). */ + rustR13Receiver(node, receiverText) { + if (node === void 0 || !isCallExpression6(node) || !isPropertyAccessExpression3(node.expression)) + return void 0; + const receiver = this.rustR13PeelCast(node.expression.expression); + if (!this.rustR13ProvenStrIdentifier(receiver)) + return void 0; + const text = (receiverText ?? "").trim(); + return /^[A-Za-z_][A-Za-z0-9_]*$/.test(text) ? text : void 0; + } + /** R06's checker-string receiver, when it prints as a bare name (it is read twice). */ + rustR13PlainReceiver(node, receiverText) { + const receiver = this.rustNativeStringReceiver(node, receiverText); + return receiver !== void 0 && /^[A-Za-z_][A-Za-z0-9_]*$/.test(receiver) ? receiver : void 0; + } + // `s.replace(p, "lit")`: the helper replaces every occurrence when all three are `Str`, else + // returns the receiver; `p` is a proven/checker string operand. + printRustR13Replace(node, receiverText) { + if (node?.arguments?.length !== 2) + return void 0; + const receiver = this.rustR13Receiver(node, receiverText) ?? this.rustR13PlainReceiver(node, receiverText); + const to = this.rustNativeStringLiteralArg(node.arguments[1]); + if (receiver === void 0 || to === void 0 || this.rustNativeStringLiteralArg(node.arguments[0]) !== void 0) + return void 0; + const from = this.rustR13StrOperand(node.arguments[0], true); + if (from === void 0) + return void 0; + return `${receiver}.as_str().zip(${from}.as_str()).map(|(__s, __p)| Value::Str(__s.replace(__p, "${to}").into())).unwrap_or_else(|| ${receiver}.clone())`; + } + // `s.split(d)` with a proven/checker string delimiter: the parts, `[]` unless both are `Str`. + printRustR13Split(node, receiverText) { + if (node?.arguments?.length !== 1 || this.rustNativeStringLiteralArg(node.arguments[0]) !== void 0) + return void 0; + const receiver = this.rustR13Receiver(node, receiverText) ?? this.rustR13PlainReceiver(node, receiverText); + const delim = receiver === void 0 ? void 0 : this.rustR13StrOperand(node.arguments[0], true); + if (delim === void 0) + return void 0; + return `Value::Array(${receiver}.as_str().zip(${delim}.as_str()).map(|(__s, __d)| __s.split(__d).map(|__p| Value::Str(__p.to_string().into())).collect()).unwrap_or_default())`; + } + // `x.toString()` on a proven-`Str` local: `stringify_simple` of `Str`/`Null` is `Display`. + printRustR13ToString(node, receiverText) { + const receiver = this.rustR13Receiver(node, receiverText); + return receiver === void 0 || (node.arguments?.length ?? 0) !== 0 ? void 0 : `Value::Str(format!("{}", ${receiver}).into())`; + } + // `x.toUpperCase()` / `x.toLowerCase()` on a proven-`Str` local (any TS type). + printRustR13Case(node, receiverText, method) { + const receiver = this.rustR13Receiver(node, receiverText); + return receiver === void 0 || (node.arguments?.length ?? 0) !== 0 ? void 0 : `${receiver}.as_str().map(|__s| Value::Str(__s.${method}().into())).unwrap_or(Value::Null)`; + } + // hx4 R14 — the R12 plain-dict proof reaches overloaded base readers (`safeDict` declares + // bodiless overload signatures; the implementation in the same class is what runs). + /** A bodiless overload signature whose class also holds the bodied implementation. */ + r14BaseOverload(declaration) { + if (declaration?.kind !== SyntaxKind7.MethodDeclaration || declaration.body !== void 0 || !isIdentifier3(declaration.name)) + return false; + const name = String(declaration.name.text); + return (declaration.parent?.members ?? []).some((m) => m.kind === SyntaxKind7.MethodDeclaration && m.body !== void 0 && isIdentifier3(m.name) && String(m.name.text) === name); + } + /** `x[a ± b]` on a checker-proven list, each operand a numeric literal, a `Value` loop + * counter or a `const n = y.length` local: the key prints as a `Value` number, so the + * list arm of `get_value` (Int index, else miss) is spelled natively. */ + r14ListArithIndex(receiverText, receiverNode, keyNode) { + const key = this.rustSkipWrappers(keyNode); + if (!this.isProvenListExpression(receiverNode) || key === void 0 || !isBinaryExpression5(key) || key.operatorToken.kind !== SyntaxKind7.MinusToken && key.operatorToken.kind !== SyntaxKind7.PlusToken || !this.r14ValueNumberOperand(key.left) || !this.r14ValueNumberOperand(key.right)) + return void 0; + if (this.isWriteBackBindRead(keyNode.parent)) + return void 0; + const keyText = this.printNode(keyNode, 0).trim(); + if (!keyText || keyText.startsWith("&")) + return void 0; + return `${receiverText}.as_array().and_then(|__arr| match &(${keyText}) { Value::Int(__n) if *__n >= 0 => __arr.get(*__n as usize), _ => None }).cloned().unwrap_or(Value::Null)`; + } + r14ValueNumberOperand(node) { + const operand = this.rustSkipWrappers(node); + if (operand === void 0) + return false; + if (isNumericLiteral4(operand)) + return Number.isInteger(Number(operand.text)); + if (!isIdentifier3(operand)) + return false; + if (this.isRustValueIndexKey(operand)) + return true; + if (this.rustParamShadowOf(operand) !== void 0 || this.rustStringLocalIdentifierIsTyped(operand)) + return false; + const declaration = this.rustDeclarationOfIdentifier(operand); + if (declaration === void 0 || !isVariableDeclaration3(declaration) || (declaration.parent?.flags & NodeFlags2.Const) === 0) + return false; + const init = this.rustSkipWrappers(declaration.initializer); + return init !== void 0 && isPropertyAccessExpression3(init) && String(init.name.text) === "length"; + } + // hx4 R15 — `Vec` locals also admit `x.join("lit")` on a `string[]` (native join of the + // elements' Display text, as the helper's `stringify_simple` prints `Str`/`Null`) and an + // object-literal property value no push follows (boxed `Value::from(x.clone())`). + r15VecJoinUse(access) { + const call = access.parent; + if (!isCallExpression6(call) || call.expression !== access || String(access.name.text) !== "join" || call.arguments.length !== 1) + return false; + if (this.rustNativeStringLiteralArg(call.arguments[0]) === void 0) + return false; + const checker = this.checkerOrUndefined(); + const type = checker?.getTypeAtLocation(access.expression); + if (type === void 0 || !checker.isArrayType(type)) + return false; + return this.primitiveKindOfType(checker.getTypeArguments?.(type)?.[0]) === "string"; + } + r15PrintVecJoin(node) { + const access = node?.expression; + if (!isPropertyAccessExpression3(access) || !isIdentifier3(access.expression) || this.rustVecLocalDeclarationOf(access.expression) === void 0 || !this.r15VecJoinUse(access)) + return void 0; + const literal = this.rustNativeStringLiteralArg(node.arguments[0]); + const name = this.printNode(access.expression, 0).trim(); + return `Value::Str(${name}.iter().map(|__v| __v.to_string()).collect::>().join("${literal}").into())`; + } + // `{ 'k': x }` with `x` named once in the statement, outside any loop the declaration is not in, + // and no `x.push` after it: the clone is the array's final contents, as the aliased box was. + r15VecPropertyUse(n) { + const parent = n.parent; + if (parent?.kind !== SyntaxKind7.PropertyAssignment || parent.initializer !== n || this.r11LoopBetween(n)) + return false; + const name = String(n.text); + let statement = parent; + while (statement !== void 0 && !isStatement(statement)) + statement = statement.parent; + if (statement === void 0) + return false; + let count = 0; + const visit = (m) => { + if (m.kind === SyntaxKind7.Identifier && m.text === name) + count++; + m.forEachChild?.(visit); + }; + visit(statement); + if (count !== 1) + return false; + const fn = this.rustEnclosingFunction(n); + const end = n.getEnd?.() ?? n.end; + return !this.rustScopeNameNodes(fn, name).some((m) => m.kind === SyntaxKind7.Identifier && m !== n && (m.getStart?.() ?? m.pos) >= end && isPropertyAccessExpression3(m.parent) && m.parent.expression === m && String(m.parent.name.text) === "push"); + } + rustR16NumericKind(node, depth = 0) { + const inner = this.rustStripWrappers(node); + if (inner === void 0 || depth > 8) + return void 0; + if (this.rustR16InProgress.has(inner)) + return this.r22AssumedNumericSelf(inner); + this.rustR16InProgress.add(inner); + try { + const structural = this.rustR16StructuralKind(inner, depth); + if (structural === "definite") + return "definite"; + if (structural === "number") + return "number"; + return this.rustOperandKind(inner) === "number" ? "number" : void 0; + } catch (e) { + return void 0; + } finally { + this.rustR16InProgress.delete(inner); + } + } + rustR16Combine(kinds) { + if (kinds.length === 0 || kinds.some((k) => k === void 0)) + return void 0; + return kinds.every((k) => k === "definite") ? "definite" : "number"; + } + rustR16StructuralKind(inner, depth) { + if (inner.kind === SyntaxKind7.NumericLiteral) + return "definite"; + if (isPrefixUnaryExpression3(inner) && inner.operator === SyntaxKind7.MinusToken && inner.operand.kind === SyntaxKind7.NumericLiteral) + return "definite"; + if (this.rustR09IsDefiniteInt(inner)) + return "definite"; + if (isCallExpression6(inner) && this.callExpressionName(inner) === "indexOf") + return "definite"; + if (isBinaryExpression5(inner)) { + const op = inner.operatorToken.kind; + if (op !== SyntaxKind7.PlusToken && op !== SyntaxKind7.MinusToken && op !== SyntaxKind7.AsteriskToken && op !== SyntaxKind7.SlashToken && op !== SyntaxKind7.PercentToken) + return void 0; + const both = this.rustR16Combine([this.rustR16NumericKind(inner.left, depth + 1), this.rustR16NumericKind(inner.right, depth + 1)]); + return both === "definite" && (op === SyntaxKind7.SlashToken || op === SyntaxKind7.PercentToken) ? "number" : both; + } + if (isCallExpression6(inner)) + return this.rustR16CallKind(inner, depth); + if (isIdentifier3(inner)) + return this.rustR16IdentifierKind(inner, depth); + return void 0; + } + rustR16CallKind(call, depth) { + const callee = call.expression; + if (!isPropertyAccessExpression3(callee) || callee.expression.kind !== SyntaxKind7.ThisKeyword) + return void 0; + if (String(callee.name.text) === "sum") { + return this.rustR16Combine(call.arguments.map((a) => this.rustR16NumericKind(a, depth + 1))); + } + let declaration; + try { + declaration = signatureDeclaration(this.getChecker().getResolvedSignature(call)); + } catch (e) { + return void 0; + } + if (declaration?.kind !== SyntaxKind7.MethodDeclaration || declaration.body === void 0 || declaration.getSourceFile() !== call.getSourceFile()) + return void 0; + const kinds = []; + const visit = (n) => { + if (n !== declaration && isFunctionLike(n)) + return; + if (isReturnStatement4(n)) + kinds.push(n.expression === void 0 ? void 0 : this.rustR16NumericKind(n.expression, depth + 1)); + n.forEachChild?.(visit); + }; + declaration.body.forEachChild(visit); + return this.rustR16Combine(kinds) === void 0 ? void 0 : "number"; + } + rustR16IdentifierKind(ident, depth) { + if (this.rustParamShadowOf(ident) !== void 0 || !this.printsValueExpression(ident)) + return void 0; + const declaration = this.rustSingleLocalDeclaration(ident); + if (declaration === void 0 || declaration.name?.kind !== SyntaxKind7.Identifier) + return void 0; + const here = this.typeOfNodeIfAny(ident); + const declared = this.typeOfNodeIfAny(declaration.name); + if (here !== void 0 && declared !== void 0 && (here.flags === TypeFlags6.Number || here.flags === TypeFlags6.NumberLiteral) && declared.flags & TypeFlags6.Union && (typeParts(declared) ?? []).some((t) => t.flags & (TypeFlags6.Undefined | TypeFlags6.Null)) && !this.rustR16HasWrites(declaration)) { + return "definite"; + } + if (!isVariableDeclaration3(declaration) || declaration.initializer === void 0 || declaration.type !== void 0) + return void 0; + if (this.rustR16Assumed.has(declaration)) + return "number"; + this.rustR16Assumed.add(declaration); + try { + return this.rustR16WrittenKind(declaration, depth); + } finally { + this.rustR16Assumed.delete(declaration); + } + } + rustR16WrittenKind(declaration, depth) { + const kinds = [this.rustR16NumericKind(declaration.initializer, depth + 1)]; + const fn = this.rustEnclosingFunction(declaration); + if (fn === void 0) + return void 0; + const name = String(declaration.name.text); + for (const m of this.rustScopeNameNodes(fn, name)) { + if (m.kind !== SyntaxKind7.Identifier || m === declaration.name) + continue; + const parent = m.parent; + if (isBinaryExpression5(parent) && parent.left === m && rustIsAssignmentOperator(parent.operatorToken.kind)) { + const op = parent.operatorToken.kind; + const right = this.rustR16NumericKind(parent.right, depth + 1); + if (op === SyntaxKind7.EqualsToken || op === SyntaxKind7.PlusEqualsToken || op === SyntaxKind7.MinusEqualsToken || op === SyntaxKind7.AsteriskEqualsToken) + kinds.push(right); + else if (op === SyntaxKind7.SlashEqualsToken || op === SyntaxKind7.PercentEqualsToken) + kinds.push(right === void 0 ? void 0 : "number"); + else + kinds.push(void 0); + } else if ((parent?.kind === SyntaxKind7.PrefixUnaryExpression || parent?.kind === SyntaxKind7.PostfixUnaryExpression) && (parent.operator === SyntaxKind7.PlusPlusToken || parent.operator === SyntaxKind7.MinusMinusToken)) { + continue; + } else if (parent !== void 0 && (isArrayLiteralExpression4(parent) && isBinaryExpression5(parent.parent) && parent.parent.left === parent || (isForOfStatement2(parent) || isForInStatement2(parent)) && parent.initializer === m)) { + kinds.push(void 0); + } + } + return this.rustR16Combine(kinds); + } + // No assignment / `++` / `--` names the binding: only control-flow guards narrow it. + rustR16HasWrites(declaration) { + const fn = isParameterDeclaration3(declaration) ? declaration.parent : this.rustEnclosingFunction(declaration); + if (fn === void 0) + return true; + return this.rustScopeNameNodes(fn, String(declaration.name.text)).some((m) => { + const parent = m.parent; + if (m.kind !== SyntaxKind7.Identifier || m === declaration.name) + return false; + return isBinaryExpression5(parent) && parent.left === m && rustIsAssignmentOperator(parent.operatorToken.kind) || parent?.kind === SyntaxKind7.PrefixUnaryExpression && (parent.operator === SyntaxKind7.PlusPlusToken || parent.operator === SyntaxKind7.MinusMinusToken) || parent?.kind === SyntaxKind7.PostfixUnaryExpression; + }); + } + // Both sides Int/Float/Null: `<`/`>` are f64 compares with Null false; `<=`/`>=` also OR in + // `is_equal` (Null == Null), so they need one never-null side. + rustR16OrderedProven(op, left, right) { + const l = this.rustR16NumericKind(left); + const r = this.rustR16NumericKind(right); + if (l === void 0 || r === void 0) + return false; + return op === SyntaxKind7.LessThanToken || op === SyntaxKind7.GreaterThanToken || l === "definite" || r === "definite"; + } + // `a - b` / `a * b` / `a / b` / `a % b` on operands proven Int/Float/Null: the helper's dispatch. + rustR16NativeArithmetic(op, left, right, leftText, rightText) { + if (op !== SyntaxKind7.MinusToken && op !== SyntaxKind7.AsteriskToken && op !== SyntaxKind7.SlashToken && op !== SyntaxKind7.PercentToken) + return void 0; + if (!this.printsValueExpression(this.rustStripWrappers(left)) || !this.printsValueExpression(this.rustStripWrappers(right))) + return void 0; + if (this.rustR16NumericKind(left) === void 0 || this.rustR16NumericKind(right) === void 0) + return void 0; + if (op !== SyntaxKind7.PercentToken) + return this.printNativeNumeric(op, leftText, rightText); + return `(match (&(${leftText}), &(${rightText})) { (Value::Int(x), Value::Int(y)) if *y != 0 => Value::Int(x % y), (Value::Int(x), Value::Float(y)) if *y != 0.0 => Value::Float(*x as f64 % *y), (Value::Float(x), Value::Int(y)) if *y != 0 => Value::Float(*x % *y as f64), (Value::Float(x), Value::Float(y)) if *y != 0.0 => Value::Float(x % y), _ => Value::Null })`; + } + // hx4 R17 — string helpers on proven-`Str` operands. `add(a, b)` with one side always a + // `Value::Str` takes the helper's `string_concat` arm, which is `Display` for every box but a + // Precise dict (only `new Precise` locals, typed `Precise`), so the other side may be any non-Precise box. + r17AlwaysStr(node) { + const inner = this.unwrapParensNode(node); + if (inner === void 0) + return false; + if (isStringLiteral3(inner) || isNoSubstitutionTemplateLiteral(inner)) + return true; + if (isBinaryExpression5(inner) && inner.operatorToken.kind === SyntaxKind7.PlusToken) + return this.r17AlwaysStr(inner.left) || this.r17AlwaysStr(inner.right); + return isCallExpression6(inner) && isPropertyAccessExpression3(inner.expression) && inner.expression.name.text === "toString" && (inner.arguments?.length ?? 0) === 0 && this.printsValueExpression(inner.expression.expression); + } + r17ConcatOperandSafe(node, type) { + if (this.r17AlwaysStr(node)) + return true; + const inner = this.unwrapParensNode(node); + if (!this.printsValueExpression(inner) || this.rustNativeStrCalleeKind(inner) === "str") + return false; + if (isIdentifier3(inner) && (this.rustStringLocalIdentifierIsTyped(inner) || this.rustVecLocalDeclarationOf(inner) !== void 0)) + return false; + const parts = type === void 0 ? [] : type.flags & TypeFlags6.Union ? typeParts(type) ?? [] : [type]; + return parts.length > 0 && parts.every((t) => String(t?.symbol?.escapedName ?? t?.symbol?.name ?? "") !== "Precise"); + } + r17ConcatIsAnchored(left, right, leftType, rightType) { + return this.r17AlwaysStr(left) && this.r17ConcatOperandSafe(right, rightType) || this.r17AlwaysStr(right) && this.r17ConcatOperandSafe(left, leftType); + } + /** R06 checker-string or R13 proven-`Str` receiver printed as a plain name / parenthesised. */ + r17Receiver(node, receiverText) { + return this.rustNativeStringReceiver(node, receiverText) ?? this.rustR13Receiver(node, receiverText); + } + // `x.trim()`: the helper's `Str` arm is `str::trim`, Null otherwise. + r17PrintTrim(node, receiverText) { + const receiver = this.r17Receiver(node, receiverText); + if (receiver === void 0 || (node.arguments?.length ?? 0) !== 0) + return void 0; + return `${receiver}.as_str().map(|__s| Value::Str(__s.trim().to_string().into())).unwrap_or(Value::Null)`; + } + // `x.startsWith(p)` / `x.endsWith(p)` with a proven/checker string operand: false unless both are `Str`. + r17PrintAffixTest(node, receiverText, method) { + if (node?.arguments?.length !== 1) + return void 0; + const receiver = this.r17Receiver(node, receiverText); + const arg = receiver === void 0 ? void 0 : this.rustR13StrOperand(node.arguments[0], true); + if (arg === void 0) + return void 0; + return `${receiver}.as_str().zip(${arg}.as_str()).is_some_and(|(__s, __p)| __s.${method}(__p))`; + } + // `x.replace(p, r)` / `x.replaceAll(p, r)`: both helpers replace every occurrence when all three + // are `Str`, else return the receiver; `p`/`r` are literals or proven/checker string operands. + r17PrintReplace(node, receiverText) { + if (node?.arguments?.length !== 2) + return void 0; + const receiver = this.r17Receiver(node, receiverText); + if (receiver === void 0 || !/^[A-Za-z_][A-Za-z0-9_.]*$/.test(receiver)) + return void 0; + const operand = (arg) => { + const literal = this.rustNativeStringLiteralArg(arg); + return literal !== void 0 ? `Value::Str("${literal}".into())` : this.rustR13StrOperand(arg, true); + }; + const from = operand(node.arguments[0]); + const to = operand(node.arguments[1]); + if (from === void 0 || to === void 0) + return void 0; + return `match (${receiver}.as_str(), ${from}.as_str(), ${to}.as_str()) { (Some(__s), Some(__p), Some(__r)) => Value::Str(__s.replace(__p, __r).into()), _ => ${receiver}.clone() }`; + } + // hx4 R18 — collection helpers on locals whose runtime shape is proven: `"k" in x` on an R10 + // plain-dict receiver, `Object.keys/values` on one in prediction sources, and `.length` / + // `.push` on a `Value::Arr`-only local (never a book/cache marker the helpers route). + /** `"lit" in x` where x is an R10-proven plain local / plain-kept Dict parameter. */ + r18LiteralInOp(key, obj) { + if (!isStringLiteral3(key) || this.r05IsTest(key)) + return void 0; + const recv = this.rustStripWrappers(obj); + if (recv === void 0 || !isIdentifier3(recv) || this.rustR10PlainReceiver(recv) === void 0) + return void 0; + const keyLiteral = this.rustStringLiteralOf(this.printStringLiteral(key)); + if (keyLiteral === void 0) + return void 0; + return `Value::Bool(matches!(&${this.printNode(recv, 0).trim()}, Value::Dict(__d) if __d.contains_key(${keyLiteral})))`; + } + /** `Object.keys/values(x)` in `ts/src/prediction/.ts` on an R10-proven plain local. */ + r18PredictionEnum(node, parsedArg, kind) { + const arg = this.rustStripWrappers(node?.arguments?.[0]); + if (arg === void 0 || parsedArg === void 0 || !isIdentifier3(arg) || !/\/ts\/src\/prediction\/[^/]+\.ts$/.test(this.r05Path(node)) || this.rustR10PlainReceiver(arg) !== "local") + return void 0; + const body = kind === "keys" ? "__m.keys().map(|__k| Value::Str(__k.clone().into())).collect()" : "__m.values().cloned().collect()"; + return `Value::Array(${parsedArg.trim()}.as_map().map(|__m| ${body}).unwrap_or_default())`; + } + /** A source that is a `Value::Arr` or `Value::Null` (both helpers agree with `len()` / a no-op + * push there): `[...]`, nullish, a runtime `split`, base `toArray`, or a base `safeList*` + * read whose default is absent, nullish or `[...]`. */ + r18ArrSource(node, allowNull) { + const n = this.rustStripWrappers(node); + if (n === void 0) + return false; + if (this.r21ArrSource(n)) + return true; + if (isArrayLiteralExpression4(n)) + return !n.elements.some((e) => e.kind === SyntaxKind7.SpreadElement); + if (n.kind === SyntaxKind7.NullKeyword || isIdentifier3(n) && String(n.text) === "undefined") + return allowNull; + if (this.rustCallPrintsRuntimeSplit(n)) + return true; + if (!isCallExpression6(n) || !isPropertyAccessExpression3(n.expression) || n.expression.expression.kind !== SyntaxKind7.ThisKeyword) + return false; + const callee = String(n.expression.name.text); + if (callee === "toArray") + return n.arguments.length === 1 && this.rustR01CalleeIsBase(n); + const index = _RustTranspiler.RUST_R18_LIST_READERS[callee]; + if (index === void 0 || n.arguments.length > index + 1) + return false; + const fallback = this.rustStripWrappers(n.arguments[index]); + const arrDefault = fallback !== void 0 && isArrayLiteralExpression4(fallback); + return (arrDefault || allowNull && (fallback === void 0 || fallback.kind === SyntaxKind7.NullKeyword || isIdentifier3(fallback) && String(fallback.text) === "undefined")) && this.rustR01CalleeIsBase(n); + } + /** A local whose every write (declaration included) is an `r18ArrSource`, never captured by + * a closure: its `Value` is a plain `Value::Arr` (the runtime never tags an array). */ + r18ArrLocal(ident, allowNull) { + if (ident === void 0 || !isIdentifier3(ident) || this.rustParamShadowOf(ident) !== void 0 || this.r05IsTest(ident)) + return false; + const declaration = this.rustSingleLocalDeclaration(ident); + if (declaration === void 0 || !isVariableDeclaration3(declaration) || !isIdentifier3(declaration.name) || !this.r18ArrSource(declaration.initializer, allowNull)) + return false; + const scope = this.rustEnclosingFunction(declaration); + if (scope === void 0 || isSourceFile5(scope) || this.rustEnclosingFunction(ident) !== scope) + return false; + const name = String(declaration.name.text); + const symbol = this.rustSymbolOf(declaration.name); + if (symbol === void 0) + return false; + for (const n of this.rustScopeNameNodes(scope, name)) { + if (n.kind !== SyntaxKind7.Identifier || n === declaration.name || this.rustSymbolOf(n) !== symbol) + continue; + if (this.rustEnclosingFunction(n) !== scope) + return false; + let target = n; + while (target.parent !== void 0 && (isParenthesizedExpression3(target.parent) || isNonNullExpression2(target.parent) || isAsExpression3(target.parent))) + target = target.parent; + const parent = target.parent; + if (parent === void 0) + continue; + if (parent.kind === SyntaxKind7.ShorthandPropertyAssignment || parent.kind === SyntaxKind7.PropertyAssignment && parent.initializer === target) + return false; + if (isBinaryExpression5(parent) && parent.left === target && rustIsAssignmentOperator(parent.operatorToken.kind)) { + if (parent.operatorToken.kind !== SyntaxKind7.EqualsToken || !this.r18ArrSource(parent.right, allowNull)) + return false; + continue; + } + if (parent.kind === SyntaxKind7.ArrayLiteralExpression && isBinaryExpression5(parent.parent) && parent.parent.left === parent) + return false; + if ((parent.kind === SyntaxKind7.PrefixUnaryExpression || parent.kind === SyntaxKind7.PostfixUnaryExpression) && (parent.operator === SyntaxKind7.PlusPlusToken || parent.operator === SyntaxKind7.MinusMinusToken)) + return false; + } + return true; + } + /** `x.length` on an Arr-only local: `get_array_length`'s marker arms need a Dict. */ + r18ArrLength(node, receiver) { + const recv = this.rustStripWrappers(node?.expression); + if (!this.r18ArrLocal(recv, true)) + return void 0; + return `Value::Int(${receiver}.len() as i64)`; + } + /** `x.push(v)` statement on an Arr-only local: `append_to_array`'s cache-push arm needs a Dict. */ + r18ArrPush(node, name, parsedArg) { + const recv = node?.expression?.expression; + if (name === void 0 || parsedArg === void 0 || node?.arguments?.length !== 1 || node.arguments[0].kind === SyntaxKind7.SpreadElement || node.parent?.kind !== SyntaxKind7.ExpressionStatement || !this.r18ArrLocal(recv, false) || name.trim() !== this.printNode(recv, 0).trim()) + return void 0; + if (!this.rustVecPushShape(node, String(recv.text))) + return void 0; + const arg = parsedArg.trim(); + const value = /^[a-zA-Z_][a-zA-Z0-9_]*$/.test(arg) && arg !== "self" && arg !== "true" && arg !== "false" ? `${arg}.clone()` : arg; + return `if let Value::Arr(__a) = &mut ${name} { std::sync::Arc::make_mut(__a).push(${value}); }`; + } + // hx4 R20 — `startsWith/endsWith(..) === true|false` compares the runtime fn's bare bool + // (is_equal of two Bool boxes is the payload compare); `a + b` on R16 numeric kinds is the + // `add` helper's Int/Float/Null dispatch, the same native match as `-`/`*`. + r20BoolCallEquality(left, right, op) { + const l = this.unwrapParensNode(left); + const r = this.unwrapParensNode(right); + const isBoolLit = (n) => n?.kind === SyntaxKind7.TrueKeyword || n?.kind === SyntaxKind7.FalseKeyword; + if (isBoolLit(l) === isBoolLit(r)) + return void 0; + const literal = isBoolLit(l) ? l : r; + const call = isBoolLit(l) ? r : l; + if (!isCallExpression6(call) || !isPropertyAccessExpression3(call.expression)) + return void 0; + const name = String(call.expression.name.text); + if (name !== "startsWith" && name !== "endsWith" || call.arguments.length !== 1) + return void 0; + const text = this.printNode(call, 0).trim(); + const fn = name === "startsWith" ? "starts_with" : "ends_with"; + const m = /^Value::Bool\((.*)\)$/s.exec(text); + if (m === null || !m[1].startsWith(`${fn}(`) || !this.r20Balanced(m[1]) || text.includes("\n")) + return void 0; + const equals = op === SyntaxKind7.EqualsEqualsToken || op === SyntaxKind7.EqualsEqualsEqualsToken; + return literal.kind === SyntaxKind7.TrueKeyword === equals ? m[1] : `!${m[1]}`; + } + /** `fn(...)` whose first `(` closes at the very end (string literals skipped). */ + r20Balanced(text) { + let depth = 0; + for (let i = 0; i < text.length; i++) { + const c = text[i]; + if (c === '"') { + for (i++; i < text.length && text[i] !== '"'; i++) + if (text[i] === "\\") + i++; + continue; + } + if (c === "(") + depth++; + else if (c === ")") { + depth--; + if (depth === 0 && i !== text.length - 1) + return false; + } + } + return depth === 0 && text.endsWith(")"); + } + r20NativeNumericAdd(op, left, right, leftText, rightText) { + if (op !== SyntaxKind7.PlusToken) + return void 0; + if (!this.printsValueExpression(this.rustStripWrappers(left)) || !this.printsValueExpression(this.rustStripWrappers(right))) + return void 0; + if (this.rustR16NumericKind(left) === void 0 || this.rustR16NumericKind(right) === void 0) + return void 0; + return this.printNativeNumeric(op, leftText, rightText); + } + // hx4 R21 — `Object.keys/values` on an R10-proven plain local in the base tier (the + // helper's ws-tag filter is a no-op on a map built from literals), and native map reads + // that are the receiver of a non-mutating string method (`currency['id'].toUpperCase ()`). + /** Base-tier (`ts/src/base/**`) `Object.keys/values(x)` on an R10-proven plain local. */ + r21BaseEnum(node, parsedArg, kind) { + const arg = this.rustStripWrappers(node?.arguments?.[0]); + if (arg === void 0 || parsedArg === void 0 || !isIdentifier3(arg) || !_RustTranspiler.RUST_BASE_TIER_FILE.test(this.r05Path(node)) || this.rustR10PlainReceiver(arg) !== "local") + return void 0; + const body = kind === "keys" ? "__m.keys().map(|__k| Value::Str(__k.clone().into())).collect()" : "__m.values().cloned().collect()"; + return `Value::Array(${parsedArg.trim()}.as_map().map(|__m| ${body}).unwrap_or_default())`; + } + /** `x['k'].m (…)` with `m` a non-mutating string method on a checker-`string` read: no + * ccxt pass rewrites that target (only `.push` / calls of the read itself). */ + r21PureStringMethodReceiver(node) { + const access = node?.parent; + const call = access?.parent; + if (!isElementAccessExpression4(node) || access === void 0 || !isPropertyAccessExpression3(access) || access.expression !== node || call === void 0 || !isCallExpression6(call) || call.expression !== access || !_RustTranspiler.RUST_R21_PURE_STRING_METHODS.has(String(access.name.text))) + return false; + const type = this.typeOfNodeIfAny(node); + return type !== void 0 && (type.flags & TypeFlags6.StringLike) !== 0; + } + /** More always-`Value::Arr` sources for the R18 proof: base `arrayConcat` (Array on every + * arm), base `sortBy`/`sortBy2` of an Arr-only local (returns its input's variant), and a + * plain alias of a non-nullable Arr-only local (COW: the push never reaches the alias). */ + r21ArrSource(n) { + if (isCallExpression6(n) && isPropertyAccessExpression3(n.expression) && n.expression.expression.kind === SyntaxKind7.ThisKeyword) { + const callee = String(n.expression.name.text); + if (callee === "arrayConcat") + return n.arguments.length === 2 && this.rustR01CalleeIsBase(n); + if (callee === "sortBy" || callee === "sortBy2") { + const first = this.rustStripWrappers(n.arguments[0]); + return first !== void 0 && isIdentifier3(first) && this.rustR01CalleeIsBase(n) && this.r21ArrAlias(first); + } + return false; + } + return isIdentifier3(n) && String(n.text) !== "undefined" && this.r21ArrAlias(n); + } + r21ArrAlias(ident) { + const declaration = this.rustSingleLocalDeclaration(ident); + if (declaration === void 0 || !isVariableDeclaration3(declaration)) + return false; + if (this.r21ArrVisiting.has(declaration)) + return true; + this.r21ArrVisiting.add(declaration); + try { + return this.r18ArrLocal(ident, false); + } finally { + this.r21ArrVisiting.delete(declaration); + } + } + // hx4 R22 — an R16 local re-read inside its own write (`p = p + 4`) is the assumed kind. + r22AssumedNumericSelf(inner) { + if (!isIdentifier3(inner)) + return void 0; + const declaration = this.rustSingleLocalDeclaration(inner); + return declaration !== void 0 && this.rustR16Assumed.has(declaration) ? "number" : void 0; + } + /** Always `Value::Str`: R17 shapes, a `+` chain with such an operand, or an always-Str local. */ + r22AlwaysStr(node) { + const inner = this.unwrapParensNode(node); + if (inner === void 0) + return false; + if (this.r17AlwaysStr(inner)) + return true; + if (isBinaryExpression5(inner) && inner.operatorToken.kind === SyntaxKind7.PlusToken) + return this.r22AlwaysStr(inner.left) || this.r22AlwaysStr(inner.right); + return isIdentifier3(inner) && this.r22AlwaysStrLocal(inner); + } + /** A plain `Value` local, never captured by a closure, whose every write is always-Str (`x += e` + * keeps it), or Str|Null (R13 source / nullish) when the checker narrows this read to `string`. */ + r22AlwaysStrLocal(ident, allowNull = false) { + if (this.rustParamShadowOf(ident) !== void 0 || this.rustStringLocalIdentifierIsTyped(ident) || this.rustVecLocalDeclarationOf(ident) !== void 0) + return false; + const declaration = this.rustSingleLocalDeclaration(ident); + if (declaration === void 0 || !isVariableDeclaration3(declaration) || !isIdentifier3(declaration.name) || declaration.initializer === void 0) + return false; + if (this.r22StrVisiting.has(declaration)) + return allowNull || this.r22StrVisiting.get(declaration) === false; + const fn = this.rustEnclosingFunction(declaration); + if (fn === void 0) + return false; + const here = this.typeOfNodeIfAny(ident); + const narrowed = allowNull || here !== void 0 && this.isStringLikeType(here); + const nullish = (e) => { + const n = this.unwrapParensNode(e); + return n?.kind === SyntaxKind7.NullKeyword || isIdentifier3(n) && String(n.text) === "undefined"; + }; + const local = (e) => { + const n = this.unwrapParensNode(e); + return isIdentifier3(n) && (this.rustR13ProvenStrIdentifier(n) || this.r22AlwaysStrLocal(n, true)); + }; + const source = (e) => this.r22AlwaysStr(e) || narrowed && (nullish(e) || this.rustR13ProvenStrSource(e) || local(e)); + this.r22StrVisiting.set(declaration, allowNull); + try { + if (!source(declaration.initializer)) + return false; + return this.rustLocalUsesAll(declaration, String(declaration.name.text), true, (n) => { + if (this.rustEnclosingFunction(n) !== fn || this.rustR13WriteTarget(n)) + return false; + const parent = n.parent; + if ((parent?.kind === SyntaxKind7.PrefixUnaryExpression || parent?.kind === SyntaxKind7.PostfixUnaryExpression) && parent.operator !== SyntaxKind7.ExclamationToken) + return false; + if (!isBinaryExpression5(parent) || parent.left !== n || !rustIsAssignmentOperator(parent.operatorToken.kind)) + return true; + const op = parent.operatorToken.kind; + return op === SyntaxKind7.PlusEqualsToken || op === SyntaxKind7.EqualsToken && source(parent.right); + }); + } finally { + this.r22StrVisiting.delete(declaration); + } + } + r22ConcatAnchor(node) { + const inner = this.unwrapParensNode(node); + return inner !== void 0 && this.printsValueExpression(inner) && this.r22AlwaysStr(inner); + } + r22ConcatIsAnchored(left, right, leftType, rightType) { + return this.r22ConcatAnchor(left) && this.r17ConcatOperandSafe(right, rightType) || this.r22ConcatAnchor(right) && this.r17ConcatOperandSafe(left, leftType); + } + /** `Option<&str>` text of an operand that is always `Value::Str` / `Value::Null`, else undefined. */ + r22StrOrNullOperand(node) { + const inner = this.rustStripWrappers(node); + if (inner === void 0) + return void 0; + if (isStringLiteral3(inner)) + return inner.text in this.StringLiteralReplacements ? void 0 : `Some(${this.quotedStringLiteral(inner.text)})`; + if (isIdentifier3(inner) && this.r22AlwaysStrLocal(inner, true)) { + const text = this.printNode(inner, 0).trim(); + return /^[A-Za-z_][A-Za-z0-9_]*$/.test(text) ? `${text}.as_str()` : void 0; + } + const operand = this.rustR13StrOperand(inner, true); + return operand === void 0 ? void 0 : `${operand}.as_str()`; + } + // `a < b` (`<=`, `>`, `>=`) on Str|Null operands: the helper's f64 parse of both strings, else + // `str` order; `<=`/`>=` OR in `is_equal` (string equality, Null == Null). + r22StrOrderedComparison(node, op, left, right) { + const operator = _RustTranspiler.NATIVE_COMPARISON_OPERATORS[op]; + const a = this.r22StrOrNullOperand(left); + const b = a === void 0 ? void 0 : this.r22StrOrNullOperand(right); + if (operator === void 0 || b === void 0) + return void 0; + const strict = operator.charAt(0); + const orEqual = operator.length === 2; + const order = `(match (__x.parse::(), __y.parse::()) { (Ok(__p), Ok(__q)) => __p ${strict} __q, _ => __x ${strict} __y })`; + const text = `(match (${a}, ${b}) { (Some(__x), Some(__y)) => ${order}${orEqual ? " || __x == __y" : ""}, ${orEqual ? "(None, None) => true, " : ""}_ => false })`; + return this.isBooleanPosition(node) ? text : `Value::Bool(${text})`; + } + // hx4 R23 — the R12 plain sources (`safeDict*(x, k, {})`, same-file builders, `extend|omit`) + // also hold in the base tier and pro files, where a tagged handle can only arrive through a + // parameter: base admits typed plain-dict parameters, pro admits no parameter at all. + r23Tier(node) { + const path3 = this.r05Path(node); + if (_RustTranspiler.RUST_R12_REST_FILE.test(path3) && /\/ts\/src\/[^/]+\.ts$/.test(path3)) + return "rest"; + if (_RustTranspiler.RUST_BASE_TIER_FILE.test(path3) && !/\/base\/ws\//.test(path3)) + return "base"; + if (/\/ts\/src\/pro\/[^/]+\.ts$/.test(path3)) + return "pro"; + return void 0; + } + r23PlainSourceTier(node) { + return this.r23Tier(node) !== void 0; + } + /** A copied/read dict argument outside REST: in pro only `this.options` or a proven plain + * local; in base also a parameter annotated with a plain-dict type (no `any` caller handle). */ + r23TierSourceOk(arg) { + const tier = this.r23Tier(arg); + if (tier === "rest") + return true; + const node = this.rustStripWrappers(arg); + if (node === void 0 || !isIdentifier3(node)) + return true; + const declaration = this.rustSingleLocalDeclaration(node); + if (tier === "pro") + return declaration !== void 0 && !isParameterDeclaration3(declaration) && this.rustR10PlainReceiver(node) === "local"; + if (declaration === void 0 || !isParameterDeclaration3(declaration)) + return true; + if (tier !== "base" || declaration.type === void 0 || declaration.dotDotDotToken !== void 0) + return false; + const type = this.getCheckedTypeOf(declaration.type); + return type !== void 0 && this.isProvenMapType(type) && !this.rustParameterIsClientHandle(declaration); + } + r23FreshCopy(node, depth) { + const callee = String(node.expression.name.text); + if (callee !== "extend" && callee !== "omit" && callee !== "keysort" || this.r23CopyVisiting.has(node)) + return false; + this.r23CopyVisiting.add(node); + try { + return this.rustR12PlainReturn(node, depth); + } finally { + this.r23CopyVisiting.delete(node); + } + } + // hx4 R25 — `a - b` / `a * b` / `a / b` and `a < b` (`<=`, `>`, `>=`) on unproven `Value`s print the + // helper's own dispatch inline (f64 coercion: Int/Float, Str parse, Bool 1/0; `<=`/`>=` OR in + // `is_equal`); `a + b` on two Str|Null operands (fields of same-file object literals) is `format!`. + r25LooseF64(binding) { + return `(match ${binding} { Value::Int(__n) => Some(*__n as f64), Value::Float(__f) => Some(*__f), Value::Str(__s) => __s.parse::().ok(), Value::Bool(__b) => Some(if *__b { 1.0 } else { 0.0 }), _ => None })`; + } + r25PlainValueOperand(node) { + const inner = this.rustStripWrappers(node); + if (inner === void 0 || !this.printsValueExpression(inner) || this.rustNativeStrCalleeKind(inner) === "str") + return false; + if (isIdentifier3(inner) && this.rustParamShadowOf(inner) !== void 0) + return false; + return !(isIdentifier3(inner) && (this.rustStringLocalIdentifierIsTyped(inner) || this.rustVecLocalDeclarationOf(inner) !== void 0)); + } + r25NativeCoercingArithmetic(op, left, right, leftText, rightText) { + if (op === SyntaxKind7.PlusToken) + return this.r25NativeStrOrNullConcat(left, right, leftText, rightText); + if (op !== SyntaxKind7.MinusToken && op !== SyntaxKind7.AsteriskToken && op !== SyntaxKind7.SlashToken) + return void 0; + if (!this.r25PlainValueOperand(left) || !this.r25PlainValueOperand(right)) + return void 0; + const a = this.rustR16NumericKind(left) !== void 0 ? "__a.as_f64()" : this.r25LooseF64("__a"); + const b = this.rustR16NumericKind(right) !== void 0 ? "__b.as_f64()" : this.r25LooseF64("__b"); + if (op === SyntaxKind7.SlashToken) { + return `(match (&(${leftText}), &(${rightText})) { (__a, __b) => match (${a}, ${b}) { (Some(__x), Some(__y)) if __y != 0.0 => Value::Float(__x / __y), _ => Value::Null } })`; + } + const sign = op === SyntaxKind7.MinusToken ? "-" : "*"; + return `(match (&(${leftText}), &(${rightText})) { (Value::Int(__x), Value::Int(__y)) => Value::Int(__x ${sign} __y), (__a, __b) => match (${a}, ${b}) { (Some(__x), Some(__y)) => Value::Float(__x ${sign} __y), _ => Value::Null } })`; + } + // is_less_than / is_greater_than: f64 order when both coerce, else `str` order of two Str; + // the `-or_equal` forms OR in is_equal (Null==Null, same-variant payload, Int exact, else f64). + r25NativeLooseOrderedComparison(node, op, left, right) { + const operator = _RustTranspiler.NATIVE_COMPARISON_OPERATORS[op]; + if (operator === void 0 || !this.r25PlainValueOperand(left) || !this.r25PlainValueOperand(right)) + return void 0; + const strict = operator.charAt(0); + const p = `(${this.r25LooseF64("__a")}, ${this.r25LooseF64("__b")})`; + const order = `(match ${p} { (Some(__x), Some(__y)) => __x ${strict} __y, _ => matches!((__a, __b), (Value::Str(__x), Value::Str(__y)) if __x ${strict} __y) })`; + const equal = ` || (match (__a, __b) { (Value::Null, Value::Null) => true, (Value::Bool(__x), Value::Bool(__y)) => __x == __y, (Value::Str(__x), Value::Str(__y)) => __x == __y, (Value::Int(__x), Value::Int(__y)) => __x == __y, (Value::Float(__x), Value::Float(__y)) => __x == __y, _ => matches!(${p}, (Some(__x), Some(__y)) if __x == __y) })`; + const text = `(match (&(${this.printNode(left, 0)}), &(${this.printNode(right, 0)})) { (__a, __b) => ${order}${operator.length === 2 ? equal : ""} })`; + return this.isBooleanPosition(node) ? text : `Value::Bool(${text})`; + } + // Str+Str / Str+Null take `string_concat` (Display, Null is "null"); Null+Null is Null. + r25NativeStrOrNullConcat(left, right, leftText, rightText) { + if (!this.r25StrOrNull(left, 0) || !this.r25StrOrNull(right, 0)) + return void 0; + return `(match (&(${leftText}), &(${rightText})) { (Value::Null, Value::Null) => Value::Null, (__a, __b) => Value::Str(format!("{}{}", __a, __b).into()) })`; + } + r25StrOrNull(node, depth) { + const inner = this.rustStripWrappers(node); + if (inner === void 0 || depth > 12 || !this.r25PlainValueOperand(inner)) + return false; + if (isStringLiteral3(inner) || this.r22AlwaysStr(inner)) + return true; + if (isCallExpression6(inner) && isPropertyAccessExpression3(inner.expression) && (String(inner.expression.name.text) === "padStart" || String(inner.expression.name.text) === "padEnd")) + return true; + if (!isElementAccessExpression4(inner) || !isStringLiteral3(inner.argumentExpression)) + return false; + return this.r25DictFieldStrOrNull(inner.expression, String(inner.argumentExpression.text), depth + 1); + } + /** Every dict `node` can evaluate to holds `key` as Str/Null or lacks it (a read of a missing key / non-dict is Null). */ + r25DictFieldStrOrNull(node, key, depth) { + const inner = this.rustStripWrappers(node); + if (inner === void 0 || depth > 12) + return false; + if (inner.kind === SyntaxKind7.NullKeyword || isIdentifier3(inner) && String(inner.text) === "undefined") + return true; + if (isObjectLiteralExpression4(inner)) { + for (const p of inner.properties) { + if (p.kind !== SyntaxKind7.PropertyAssignment) + return false; + const name = p.name; + const text = isStringLiteral3(name) || isIdentifier3(name) ? String(name.text) : void 0; + if (text === void 0) + return false; + if (text === key && !this.r25StrOrNull(p.initializer, depth + 1)) + return false; + } + return true; + } + if (isCallExpression6(inner)) + return this.r25MethodFieldStrOrNull(inner, key, depth + 1); + if (!isIdentifier3(inner)) + return false; + const declaration = this.rustSingleLocalDeclaration(inner); + if (declaration === void 0 || !isVariableDeclaration3(declaration) || !isIdentifier3(declaration.name) || declaration.initializer === void 0 || (declaration.parent?.flags & NodeFlags2.Const) === 0) + return false; + const fn = this.rustEnclosingFunction(declaration); + if (fn === void 0) + return false; + for (const m of this.rustScopeNameNodes(fn, String(declaration.name.text))) { + if (m === declaration.name || m.kind !== SyntaxKind7.Identifier) + continue; + let top = m; + while (isElementAccessExpression4(top.parent) && top.parent.expression === top) + top = top.parent; + if (top === m) + continue; + const parent = top.parent; + if (isDeleteExpression2(parent) || isBinaryExpression5(parent) && parent.left === top && rustIsAssignmentOperator(parent.operatorToken.kind)) + return false; + } + return this.r25DictFieldStrOrNull(declaration.initializer, key, depth + 1); + } + /** `this.m(..)` resolved to a same-file method with a body whose every return holds `key` as Str/Null. */ + r25MethodFieldStrOrNull(call, key, depth) { + const callee = call.expression; + if (!isPropertyAccessExpression3(callee) || callee.expression.kind !== SyntaxKind7.ThisKeyword) + return false; + let declaration; + try { + declaration = signatureDeclaration(this.getChecker().getResolvedSignature(call)); + } catch (e) { + return false; + } + if (declaration?.kind !== SyntaxKind7.MethodDeclaration || declaration.body === void 0 || declaration.getSourceFile() !== call.getSourceFile() || _RustTranspiler.RUST_BASE_TIER_FILE.test(this.r05Path(call))) + return false; + let ok = true; + const visit = (n) => { + if (!ok || n !== declaration && isFunctionLike(n)) + return; + if (isReturnStatement4(n) && n.expression !== void 0 && !this.r25DictFieldStrOrNull(n.expression, key, depth + 1)) + ok = false; + n.forEachChild?.(visit); + }; + declaration.body.forEachChild(visit); + return ok; + } + r26ParamsSlot(rhs, selfName, depth) { + const call = this.rustStripWrappers(rhs); + if (depth > 4 || call === void 0 || !isCallExpression6(call) || !isPropertyAccessExpression3(call.expression) || call.expression.expression.kind !== SyntaxKind7.ThisKeyword || this.r23Tier(call) === void 0) { + return false; + } + const index = _RustTranspiler.R26_PARAMS_SLOT_ARG[String(call.expression.name.text)]; + if (index === void 0 || !this.rustR01CalleeIsBase(call)) + return false; + const arg = this.rustStripWrappers(call.arguments[index]); + if (arg === void 0) + return call.arguments.length <= index; + if (this.rustPlainDictLiteral(arg)) + return true; + if (!isIdentifier3(arg)) + return false; + if (String(arg.text) === selfName) + return true; + const declaration = this.rustSingleLocalDeclaration(arg); + if (declaration !== void 0 && isParameterDeclaration3(declaration)) { + return this.r23TierSourceOk(arg) && (this.r23Tier(arg) !== "base" || this.rustParamStaysPlainDict(declaration)); + } + try { + return this.rustR10PlainReceiver(arg) === "local"; + } catch (e) { + return false; + } + } + // hx4 R30 — `slice` / `indexOf` / `toUpperCase` / `toLowerCase` on unproven `Value`s print the + // runtime helper's own dispatch inline (`runtime.rs` slice/get_index_of/to_upper/to_lower); + // every operand is evaluated once, in the helper's argument order. + r30LooseI64(expr) { + return `(match &(${expr}) { Value::Int(__n) => Some(*__n), Value::Float(__f) => Some(*__f as i64), Value::Str(__s) => __s.parse::().ok(), Value::Bool(__b) => Some(if *__b { 1 } else { 0 }), _ => None })`; + } + r30SliceArm(variant, len, take, empty) { + const bound = (b) => `if ${b} < 0 { (__l + ${b}).max(0) } else { ${b}.min(__l) }`; + return `(${variant}, __b, __e) => match (${len}) { __l => match (${bound("__b")}, match __e { None => __l, Some(__k) => ${bound("__k")} }) { (__i, __j) => if __i <= __j { ${take} } else { ${empty} } } }`; + } + r30Slice(name, start, end) { + const str = this.r30SliceArm( + "Value::Str(__sv)", + "__sv.chars().count() as i64", + "Value::Str(__sv.chars().skip(__i as usize).take((__j - __i) as usize).collect::().into())", + "Value::Str(String::new().into())" + ); + const arr = this.r30SliceArm( + "Value::Arr(__a)", + "__a.len() as i64", + "Value::Array(__a[__i as usize..__j as usize].to_vec())", + "Value::Array(vec![])" + ); + return `(match (&(${name}), ${this.r30LooseI64(start)}.unwrap_or(0), ${this.r30LooseI64(end)}) { ${str}, ${arr}, _ => Value::Null })`; + } + r30IndexOf(name, needle) { + const eq = `match (__it, __nd) { (Value::Null, Value::Null) => true, (Value::Bool(__x), Value::Bool(__y)) => __x == __y, (Value::Str(__x), Value::Str(__y)) => __x == __y, (Value::Int(__x), Value::Int(__y)) => __x == __y, (Value::Float(__x), Value::Float(__y)) => __x == __y, (__p, __q) => match (${this.r25LooseF64("__p")}, ${this.r25LooseF64("__q")}) { (Some(__x), Some(__y)) => __x == __y, _ => false } }`; + return `(match (&(${name}), &(${needle})) { (Value::Arr(__a), __nd) => Value::Int(__a.iter().position(|__it| ${eq}).map(|__i| __i as i64).unwrap_or(-1)), (Value::Str(__s), Value::Str(__nd)) => Value::Int(__s.find(&**__nd).map(|__i| __i as i64).unwrap_or(-1)), _ => Value::Int(-1) })`; + } + r30Case(name, method) { + return `(match &(${name}) { Value::Str(__s) => Value::Str(__s.${method}().into()), _ => Value::Null })`; + } +}; +// node kinds the printer types that the core per-file prefetch leaves to single round trips +_RustTranspiler.RUST_PREFETCH_TYPE_KINDS = /* @__PURE__ */ new Set([ + SyntaxKind7.FalseKeyword, + SyntaxKind7.TrueKeyword, + SyntaxKind7.ParenthesizedExpression, + SyntaxKind7.AwaitExpression, + SyntaxKind7.PrefixUnaryExpression, + SyntaxKind7.BooleanKeyword, + SyntaxKind7.ObjectKeyword, + SyntaxKind7.UnionType, + SyntaxKind7.ConditionalExpression, + SyntaxKind7.AsExpression +]); +// ── native equality emission ──────────────────────────────────────────── +// When the checker proves both operands hold the same primitive payload +// (string / number / boolean, or one side is a matching literal) the +// unwrapped payloads are compared with `==`/`!=` instead of is_equal(). +// Operators whose printed form is a bare Rust `bool` (not a Value). +_RustTranspiler.BOOL_PRODUCING_OPERATORS = /* @__PURE__ */ new Set([ + SyntaxKind7.EqualsEqualsToken, SyntaxKind7.EqualsEqualsEqualsToken, SyntaxKind7.ExclamationEqualsToken, SyntaxKind7.ExclamationEqualsEqualsToken, @@ -24832,6 +28085,49 @@ _RustTranspiler.BOOL_VALUE_PREFIXES = [ "is_number", "is_string" ]; +// hx4 R01 — native element write on a local the plain-dict proof admits +// through its write history: `const x = this.account ()`, a `let x = {}` / +// `let x: Dict = undefined` later reassigned, `[ x, p ] = this.handleUntilOption (…)`. +/** Base-tier methods whose every return is a fresh tag-free object + * literal (no venue override, no hand-written stub replaces them). */ +_RustTranspiler.RUST_R01_PLAIN_DICT_BUILDERS = /* @__PURE__ */ new Set(["account", "safeLedgerEntry", "depositWithdrawFee"]); +/** Base-tier `[Dict, Dict]` tuple helpers that hand back their `request` argument (index 1). */ +_RustTranspiler.RUST_R01_REQUEST_TUPLE_HELPERS = /* @__PURE__ */ new Set(["handleUntilOption"]); +// hx4 R12 — plain-dict sources from base `safeDict*` reads of unshared dicts and same-file +// sync request builders; native truthiness / bool equality on operands proven `Value::Bool` +// or `Value::Null` at runtime (bool tuple elements, bool-returning exchange methods). +/** Base-tier bool readers whose Rust form returns `Value::Bool` or `Value::Null` + * (`safe_bool*` keep only `Value::Bool` or the default; the `check_option_bool` stub). */ +_RustTranspiler.RUST_R12_BOOL_READERS = { safeBool: 2, safeBool2: 3, safeBoolN: 2, checkOptionBool: -1 }; +_RustTranspiler.RUST_R12_DICT_READERS = { safeDict: 2, safeDict2: 3, safeDictN: 2 }; +/** A REST venue file (`ts/src/.ts`): no base / pro / prediction tier. */ +_RustTranspiler.RUST_R12_REST_FILE = /ts\/src\/[^/]+\.ts$/; +/** Base-tier array readers whose result is the stored `Value::Arr` or the default argument. */ +_RustTranspiler.RUST_R18_LIST_READERS = { safeList: 2, safeList2: 3, safeListN: 2 }; +_RustTranspiler.RUST_R21_PURE_STRING_METHODS = /* @__PURE__ */ new Set(["toUpperCase", "toLowerCase", "trim", "startsWith", "endsWith", "split"]); +// hx4 R26 — tuple slot 1 of the base `handle*AndParams` / `handleParam*` helpers is their +// params argument or an `omit` copy of it: plain when that argument is a plain source. +_RustTranspiler.R26_PARAMS_SLOT_ARG = { + handleOptionAndParams: 0, + handleOptionAndParams2: 0, + handleOptionStringAndParams: 0, + handleOptionStringAndParams2: 0, + handleOptionBoolAndParams: 0, + handleOptionBoolAndParams2: 0, + handleOptionIntegerAndParams: 0, + handleOptionIntegerAndParams2: 0, + handleParamString: 0, + handleParamString2: 0, + handleParamInteger: 0, + handleParamInteger2: 0, + handleParamBool: 0, + handleParamBool2: 0, + handleNetworkCodeAndParams: 0, + handleMarginModeAndParams: 1, + handleMarketTypeAndParams: 2, + handleSubTypeAndParams: 2, + handleMaxEntriesPerRequestAndParams: 2 +}; var RustTranspiler = _RustTranspiler; // src/cppTranspiler.ts diff --git a/dist/transpiler.js.map b/dist/transpiler.js.map index ba84ee98..feb988ca 100644 --- a/dist/transpiler.js.map +++ b/dist/transpiler.js.map @@ -1 +1 @@ -{"version":3,"sources":["../src/dirname.cjs","../src/transpiler.ts","../src/pythonTranspiler.ts","../src/baseTranspiler.ts","../src/types.ts","../src/utils.ts","../src/logger.ts","../src/phpTranspiler.ts","../src/csharpTranspiler.ts","../src/goTranspiler.ts","../src/javaTranspiler.ts","../src/rustTranspiler.ts","../src/cppTranspiler.ts"],"sourcesContent":["// https://github.com/kulshekhar/ts-jest/issues/1174\nmodule.exports = __dirname;","import { ScriptTarget, SyntaxKind, type Node, type SourceFile } from \"typescript/unstable/ast\";\nimport { API, CheckFlags, ElementFlags, IndexKind, ObjectFlags, SignatureKind, SymbolFlags, TypeFlags, TypeFormatFlags, type Checker, type CompilerOptions, type Program, type Snapshot } from \"typescript/unstable/sync\";\nimport currentPath from \"./dirname.cjs\";\nimport { PythonTranspiler } from './pythonTranspiler.js';\nimport { PhpTranspiler } from './phpTranspiler.js';\nimport { CSharpTranspiler } from './csharpTranspiler.js';\nimport * as path from \"path\";\nimport * as fs from \"fs\";\nimport { Logger } from './logger.js';\nimport { Languages, TranspilationMode, IFileExport, IFileImport, ITranspiledFile, IInput, ITranspileContext, ITranspileProgramCache } from './types.js';\nimport { GoTranspiler, alignGoTrailingComments } from './goTranspiler.js';\nimport { JavaTranspiler } from './javaTranspiler.js';\nimport { RustTranspiler, RUST_DECLARED_DICT_LOCALS } from './rustTranspiler.js';\nimport type { RustDeclaredDictLocalEntry } from './rustTranspiler.js';\nimport { CppTranspiler } from './cppTranspiler.js';\n\nconst __dirname_mock = currentPath;\n\n// minimal type environment: skip the auto-included @types/* packages (with empty\n// options typescript scans node_modules/@types and pulls every package it finds —\n// 160+ extra files) and replace the default es5+dom lib (lib.dom.d.ts alone is ~8MB)\n// with the es-only lib chain. Neither dom nor @types globals affect transpilation\n// output, but they dominate program creation time (~10x) and make the type\n// environment depend on whatever @types happen to be installed in the host project.\nconst fastCompilerOptions: CompilerOptions = {\n target: ScriptTarget.Latest,\n lib: [\"lib.esnext.d.ts\"],\n types: [],\n};\n\n// the host globals (console, Buffer, setTimeout, ...) previously came from the\n// auto-included @types packages; declare them here so references to them neither\n// produce \"Cannot find name\" diagnostics nor trigger typescript's (very expensive)\n// spelling-suggestion scans while computing those diagnostics\nconst globalsShim = `\ndeclare var require: any;\ndeclare var module: any;\ndeclare var exports: any;\ndeclare var console: any;\ndeclare var process: any;\ndeclare var Buffer: any;\ndeclare var __dirname: string;\ndeclare var __filename: string;\ndeclare var setTimeout: any;\ndeclare var clearTimeout: any;\ndeclare var setInterval: any;\ndeclare var clearInterval: any;\ndeclare var setImmediate: any;\ndeclare var fetch: any;\ndeclare var URL: any;\ndeclare var URLSearchParams: any;\ndeclare var TextEncoder: any;\ndeclare var TextDecoder: any;\ndeclare var crypto: any;\ndeclare var performance: any;\ndeclare var AbortController: any;\ndeclare var WebSocket: any;\ndeclare var atob: any;\ndeclare var btoa: any;\n`;\nconst globalsShimPath = path.resolve(path.join(__dirname_mock, \"__globals-shim.d.ts\"));\n\n// transpiling one file to several languages queries the checker repeatedly for the\n// same nodes (identifiers, binary operands, conditions). Types and symbols are\n// deterministic per (checker, node), so memoize the two hot lookups on the checker\n// instance itself — the caches die with the checker when a new program is created\nconst UNDEFINED_SENTINEL = Symbol(\"undefined\");\n// unary checker queries keyed by a snapshot object (node / type / symbol / signature);\n// the API returns registry-interned objects, so object identity is a stable key\nconst MEMOIZED_UNARY_CHECKER_METHODS = [\n \"getTypeAtLocation\", \"getSymbolAtLocation\", \"getResolvedSignature\", \"getContextualType\",\n \"getSignaturesOfType\", \"getSymbolOfType\", \"getReturnTypeOfSignature\", \"getSignatureFromDeclaration\",\n \"isArrayType\", \"isArrayLikeType\", \"isTupleType\", \"getTypeArguments\", \"getTypeFromTypeNode\",\n \"getDeclaredTypeOfSymbol\", \"getTypeOfSymbol\", \"getAliasedSymbol\", \"getBaseTypeOfLiteralType\",\n \"getApparentType\", \"getPropertiesOfType\", \"getNonNullableType\", \"getIndexInfosOfType\",\n];\nfunction memoizeCheckerCalls(checker: Checker): void {\n if ((checker as any).__astTranspilerMemoized) {\n return;\n }\n (checker as any).__astTranspilerMemoized = true;\n for (const name of MEMOIZED_UNARY_CHECKER_METHODS) {\n memoizeUnaryMethod(checker, name);\n }\n // typeToString(type) with no extra args is the only form worth caching\n memoizeUnaryMethod(checker, \"typeToString\");\n // (type, kind) pairs: a WeakMap per kind\n memoizeBinaryKindMethod(checker, \"getSignaturesOfType\");\n memoizeBinaryKindMethod(checker, \"getIndexTypeOfType\");\n memoizeBinaryKindMethod(checker, \"getIndexInfoOfType\");\n memoizePairMethod(checker, \"getTypeOfSymbolAtLocation\");\n}\n\n// (object, object) pairs, e.g. getTypeOfSymbolAtLocation(symbol, node); seed2 fills it from a prefetch\nfunction memoizePairMethod(owner: object, name: string): void {\n const original = owner[name];\n if (typeof original !== \"function\") {\n return;\n }\n const cache = new WeakMap>();\n const seed2 = (a: object, b: object, value: unknown) => {\n let inner = cache.get(a);\n if (inner === undefined) {\n cache.set(a, inner = new WeakMap());\n }\n inner.set(b, value === undefined ? UNDEFINED_SENTINEL : value);\n };\n const wrapped = function (this: unknown, ...args: unknown[]) {\n const [a, b] = args;\n if (args.length !== 2 || a === null || typeof a !== \"object\" || b === null || typeof b !== \"object\") {\n return original.apply(owner, args);\n }\n const cached = cache.get(a as object)?.get(b as object);\n if (cached !== undefined) {\n return cached === UNDEFINED_SENTINEL ? undefined : cached;\n }\n const result = original.call(owner, a, b);\n seed2(a as object, b as object, result);\n return result;\n };\n (wrapped as any).gen = (original as any).gen;\n (wrapped as any).original = original;\n (wrapped as any).seed2 = seed2;\n Object.defineProperty(owner, name, { configurable: true, value: wrapped });\n}\n\n// the TS7 checker exposes its methods as prototype getters: shadow them on the instance.\n// Only single-object-argument calls are cached; anything else goes straight through.\nfunction memoizeUnaryMethod(owner: object, name: string): void {\n const original = owner[name];\n if (typeof original !== \"function\") {\n return;\n }\n const cache = new WeakMap();\n const wrapped = function (this: unknown, ...args: unknown[]) {\n const key = args[0];\n if (args.length !== 1 || key === null || typeof key !== \"object\" || Array.isArray(key)) {\n return original.apply(owner, args);\n }\n const cached = cache.get(key);\n if (cached !== undefined) {\n return cached === UNDEFINED_SENTINEL ? undefined : cached;\n }\n const result = original.call(owner, key);\n cache.set(key, result === undefined ? UNDEFINED_SENTINEL : result);\n return result;\n };\n (wrapped as any).gen = (original as any).gen;\n (wrapped as any).original = original;\n // prefetch support: seed(key, value) fills the cache; has(key) tells whether it is filled\n (wrapped as any).seed = (key: object, value: unknown) => cache.set(key, value === undefined ? UNDEFINED_SENTINEL : value);\n (wrapped as any).has = (key: object) => cache.has(key);\n Object.defineProperty(owner, name, { configurable: true, value: wrapped });\n}\n\nfunction memoizeBinaryKindMethod(owner: object, name: string): void {\n const unary = owner[name];\n const original = (unary as any)?.original ?? unary;\n if (typeof original !== \"function\") {\n return;\n }\n const caches = new Map>();\n const wrapped = function (this: unknown, ...args: unknown[]) {\n const key = args[0];\n if (args.length === 1) {\n return unary.call(owner, key);\n }\n if (args.length !== 2 || key === null || typeof key !== \"object\" || typeof args[1] !== \"number\") {\n return original.apply(owner, args);\n }\n let cache = caches.get(args[1]);\n if (cache === undefined) {\n caches.set(args[1], cache = new WeakMap());\n }\n const cached = cache.get(key);\n if (cached !== undefined) {\n return cached === UNDEFINED_SENTINEL ? undefined : cached;\n }\n const result = original.call(owner, key, args[1]);\n cache.set(key, result === undefined ? UNDEFINED_SENTINEL : result);\n return result;\n };\n (wrapped as any).gen = (original as any).gen;\n Object.defineProperty(owner, name, { configurable: true, value: wrapped });\n}\n\n// Batch pre-resolve: walk `root` once and resolve, in one round trip per method, the\n// types/symbols of the node kinds the printers ask about, seeding the memo caches above.\n// Results are identical to per-node calls; nodes the printers never ask about only cost payload.\nconst PREFETCH_TYPE_KINDS = new Set([\n SyntaxKind.Identifier, SyntaxKind.PropertyAccessExpression, SyntaxKind.ElementAccessExpression,\n SyntaxKind.CallExpression, SyntaxKind.BinaryExpression, SyntaxKind.StringLiteral, SyntaxKind.TypeReference,\n SyntaxKind.MethodDeclaration, SyntaxKind.AnyKeyword, SyntaxKind.StringKeyword, SyntaxKind.NumberKeyword,\n SyntaxKind.ArrayType, SyntaxKind.NumericLiteral,\n]);\nconst PREFETCH_BATCH = 4096;\nfunction prefetchChecker(checker: Checker, root: Node, options: { types?: boolean, symbols?: boolean, signatures?: boolean } = {}): void {\n const wantTypes = options.types ?? true, wantSymbols = options.symbols ?? true, wantSignatures = options.signatures ?? true;\n const getType = checker.getTypeAtLocation as any, getSymbol = checker.getSymbolAtLocation as any, getSig = checker.getResolvedSignature as any;\n const typeNodes: Node[] = [], symbolNodes: Node[] = [], callNodes: Node[] = [];\n const visit = (node: Node) => {\n const kind = node.kind;\n if (wantTypes && PREFETCH_TYPE_KINDS.has(kind) && !getType.has?.(node)) typeNodes.push(node);\n if (wantSymbols && kind === SyntaxKind.Identifier && !getSymbol.has?.(node)) symbolNodes.push(node);\n if (wantSignatures && kind === SyntaxKind.CallExpression && !getSig.has?.(node)) callNodes.push(node);\n node.forEachChild(visit);\n };\n visit(root);\n const run = (nodes: Node[], fn: any) => {\n if (fn?.seed === undefined || fn.original === undefined) return;\n for (let i = 0; i < nodes.length; i += PREFETCH_BATCH) {\n const chunk = nodes.slice(i, i + PREFETCH_BATCH);\n let results: unknown[];\n try {\n results = fn.original(chunk);\n } catch {\n continue; // leave this chunk to the lazy per-node path\n }\n chunk.forEach((n, j) => fn.seed(n, results[j]));\n }\n };\n run(typeNodes, getType);\n run(symbolNodes, getSymbol);\n // no bulk getResolvedSignature: pipeline the per-call requests through api.batch\n const api = (checker as any).__astTranspilerApi as API | undefined;\n if (callNodes.length > 0 && getSig?.seed !== undefined && api !== undefined && getSig.original?.gen !== undefined) {\n for (let i = 0; i < callNodes.length; i += PREFETCH_BATCH) {\n const chunk = callNodes.slice(i, i + PREFETCH_BATCH);\n const gens = chunk.map((n) => {\n const g = getSig.original.gen(n);\n // a call the checker cannot resolve must not fail the whole batch\n return (function* () { try { return yield* g; } catch { return PREFETCH_FAILED; } })();\n });\n const results = api.batch(...gens) as unknown[];\n chunk.forEach((n, j) => { if (results[j] !== PREFETCH_FAILED) getSig.seed(n, results[j]); });\n }\n }\n if (wantSignatures && api !== undefined) {\n prefetchDeclarationSignatures(checker, api, root);\n }\n}\n\n// Warm the per-declaration chains baseTranspiler walks for every method/function\n// (getFunctionType, getReturnTypeFromMethod) in one pipelined batch per level\nfunction prefetchDeclarationSignatures(checker: Checker, api: API, root: Node): void {\n const getSigDecl = checker.getSignatureFromDeclaration as any;\n const getTypeOfSymbolAtLocation = (checker as any).getTypeOfSymbolAtLocation;\n if (getSigDecl?.seed === undefined || getSigDecl.original?.gen === undefined) return;\n const decls: Node[] = [];\n const visit = (node: Node) => {\n if (node.kind === SyntaxKind.MethodDeclaration || node.kind === SyntaxKind.FunctionDeclaration) decls.push(node);\n node.forEachChild(visit);\n };\n visit(root);\n const safe = (g: Generator) => (function* () { try { return yield* g; } catch { return PREFETCH_FAILED; } })();\n for (let i = 0; i < decls.length; i += PREFETCH_BATCH) {\n const chunk = decls.slice(i, i + PREFETCH_BATCH);\n api.batch(...chunk.map((decl) => safe((function* () {\n const sig = getSigDecl.has(decl) ? getSigDecl(decl) : yield* getSigDecl.original.gen(decl);\n getSigDecl.seed(decl, sig);\n if (sig !== undefined) yield* sig.getReturnType.gen();\n })())));\n // getReturnTypeFromMethod: type -> symbol -> type of symbol at its declaration -> call signatures\n api.batch(...chunk.map((decl) => safe((function* () {\n const type = checker.getTypeAtLocation(decl) as any;\n const symbol = type?.getSymbol?.gen !== undefined ? yield* type.getSymbol.gen() : undefined;\n const location = symbol?.valueDeclaration?.resolve();\n if (location === undefined || getTypeOfSymbolAtLocation?.seed2 === undefined) return;\n const symbolType = yield* getTypeOfSymbolAtLocation.original.gen(symbol, location);\n getTypeOfSymbolAtLocation.seed2(symbol, location, symbolType);\n yield* symbolType.getCallSignatures.gen();\n })())));\n }\n}\nconst PREFETCH_FAILED = Symbol(\"prefetchFailed\");\nconst prefetchedFiles = new WeakSet();\n\n// program-wide diagnostics are identical for every file of a program: fetch them once\ntype ProgramWideDiagnostics = { program: readonly { text: string }[], global: readonly { text: string }[] };\nconst programDiagnosticsCache = new WeakMap();\nfunction getProgramWideDiagnostics(program: Program): ProgramWideDiagnostics {\n let diagnostics = programDiagnosticsCache.get(program);\n if (diagnostics === undefined) {\n diagnostics = { program: program.getProgramDiagnostics(), global: program.getGlobalDiagnostics() };\n programDiagnosticsCache.set(program, diagnostics);\n }\n return diagnostics;\n}\n\n// one TS7 API server per isolate unless a cache brings its own\nlet processApi: API | undefined;\nfunction getApi(cache: ITranspileProgramCache): API {\n cache.api ??= (processApi ??= new API({ cwd: process.cwd() }));\n return cache.api;\n}\n\n// a snapshot with one synthetic program over rootFiles; `files` overlays virtual file contents\nfunction createSnapshotProgram(cache: ITranspileProgramCache, rootFiles: string[], files: Record): [Snapshot, Program, Checker] {\n const snapshot = getApi(cache).createSnapshot({\n fileSystem: { kind: \"layer\", files },\n createPrograms: [{ rootFiles: rootFiles.map((f) => path.resolve(f)), compilerOptions: fastCompilerOptions }],\n });\n const program = snapshot.operation.createdPrograms[0];\n const checker = snapshot.getProjects().find((p) => p.program === program).checker;\n memoizeCheckerCalls(checker);\n (checker as any).__astTranspilerApi = getApi(cache);\n return [snapshot, program, checker];\n}\n\nexport default class Transpiler {\n config;\n pythonTranspiler: PythonTranspiler;\n phpTranspiler: PhpTranspiler;\n csharpTranspiler: CSharpTranspiler;\n goTranspiler: GoTranspiler;\n javaTranspiler: JavaTranspiler;\n rustTranspiler: RustTranspiler;\n cppTranspiler: CppTranspiler;\n // ByPath transpilation cache: parsed SourceFiles (libs + the whole import graph)\n // are reused across createProgram calls — without this every transpile*ByPath call\n // re-parses the full import closure of the target file (~1s+ per file on big repos).\n // Lives in a standalone object so several Transpiler instances on the same thread\n // can be pointed at one cache (see Transpiler.createProgramCache).\n private programCache: ITranspileProgramCache;\n // typescript state of the transpilation in flight, shared with the language printers\n private context: ITranspileContext | undefined;\n // the snapshot behind the current single-file context\n private snapshot: Snapshot | undefined;\n // batch pre-resolve each source file's checker queries before printing it (config.prefetch=false disables)\n prefetch: boolean;\n\n // batch pre-resolve for callers that query the checker themselves (build hooks):\n // one round trip per method for every relevant node under `root`\n static prefetchChecker(checker: Checker, root: Node, options?: { types?: boolean, symbols?: boolean, signatures?: boolean }): void {\n prefetchChecker(checker, root, options);\n }\n\n // A program cache holds parsed typescript SourceFiles and the last program built\n // from them. Hand the same cache to several Transpiler instances to reuse one\n // parse/typecheck of the es lib chain and of every shared import across all of\n // them. Callers that need isolation simply omit it and get a private cache.\n //\n // Same-thread only: these are live V8 objects, so a cache cannot be posted to a\n // worker_threads isolate — give each worker its own long-lived cache instead.\n static createProgramCache(): ITranspileProgramCache {\n return {};\n }\n\n constructor(config = {}, programCache?: ITranspileProgramCache) {\n this.config = config;\n this.programCache = programCache ?? Transpiler.createProgramCache();\n this.prefetch = config[\"prefetch\"] ?? true;\n const phpConfig = config[\"php\"] || {};\n const pythonConfig = config[\"python\"] || {};\n const csharpConfig = config[\"csharp\"] || {};\n const goConfig = config[\"go\"] || {};\n const javaConfig = config[\"java\"] || {};\n const rustConfig = config[\"rust\"] || {};\n const cppConfig = config[\"cpp\"] || {};\n\n if (\"verbose\" in config) {\n Logger.setVerboseMode(Boolean(config['verbose']));\n }\n\n this.pythonTranspiler = new PythonTranspiler(pythonConfig);\n this.phpTranspiler = new PhpTranspiler(phpConfig);\n this.csharpTranspiler = new CSharpTranspiler(csharpConfig);\n this.goTranspiler = new GoTranspiler(goConfig);\n this.javaTranspiler = new JavaTranspiler(javaConfig);\n this.rustTranspiler = new RustTranspiler(rustConfig);\n this.cppTranspiler = new CppTranspiler(cppConfig);\n }\n\n setVerboseMode(verbose: boolean) {\n Logger.setVerboseMode(verbose);\n }\n\n // the cache this instance parses into, to hand to further Transpiler instances\n // that should reuse this one's parsed SourceFiles\n getProgramCache(): ITranspileProgramCache {\n return this.programCache;\n }\n\n // a second Transpiler over the same parsed typescript state, with its own\n // printers and its own transpile context, so both can be driven independently\n // on this thread without either clobbering the other's program\n cloneSharingProgramCache(config = this.config): Transpiler {\n return new Transpiler(config, this.programCache);\n }\n\n // single-file snapshots are released when the next one replaces them; batches own theirs\n private setSnapshotContext(snapshot: Snapshot, program: Program, checker: Checker, fileName: string): ITranspileContext {\n const src = program.getSourceFile(fileName) ?? program.getSourceFile(path.resolve(fileName));\n const previous = this.snapshot;\n this.snapshot = snapshot;\n previous?.dispose();\n return this.setContext({ src, checker, program });\n }\n\n createProgramInMemoryAndSetContext(content): ITranspileContext {\n const inMemoryFilePath = path.resolve(path.join(__dirname_mock, \"__dummy-file.ts\"));\n const [snapshot, program, checker] = createSnapshotProgram(this.programCache, [inMemoryFilePath, globalsShimPath], {\n [inMemoryFilePath]: content,\n [globalsShimPath]: globalsShim,\n });\n return this.setSnapshotContext(snapshot, program, checker, inMemoryFilePath);\n }\n\n createProgramByPathAndSetContext(filePath): ITranspileContext {\n const shared = this.findSharedProgramFile(filePath);\n if (shared !== undefined) {\n return this.setContext(shared);\n }\n const [snapshot, program, checker] = createSnapshotProgram(this.programCache, [filePath, globalsShimPath], { [globalsShimPath]: globalsShim });\n return this.setSnapshotContext(snapshot, program, checker, filePath);\n }\n\n // One snapshot/program for a whole run: later ByPath transpiles of any root (or\n // imported file) of `paths` reuse it instead of building a program per file, as\n // long as the file's text on disk still equals the snapshot's. Replaces any\n // previous shared program; pass [] to drop it.\n setSharedProgram(paths: string[]): void {\n this.programCache.shared?.snapshot.dispose();\n this.programCache.shared = undefined;\n if (paths.length === 0) {\n return;\n }\n const [snapshot, program, checker] = createSnapshotProgram(this.programCache, [...paths, globalsShimPath], { [globalsShimPath]: globalsShim });\n this.programCache.shared = { snapshot, program, checker };\n }\n\n private findSharedProgramFile(filePath: string): ITranspileContext | undefined {\n const shared = this.programCache.shared;\n if (shared === undefined) {\n return undefined;\n }\n const src = shared.program.getSourceFile(path.resolve(filePath));\n if (src === undefined || !fs.existsSync(filePath) || fs.readFileSync(filePath, \"utf8\") !== src.text) {\n return undefined;\n }\n return { src, checker: shared.checker, program: shared.program };\n }\n\n // One program over N root files, so the bind/check work behind the diagnostics\n // pass is paid once for the whole set; files importing each other are fine as\n // separate roots. The batch owns its snapshot until dispose().\n createProgramBatch(paths: string[]): TranspileProgramBatch {\n const [snapshot, program, checker] = createSnapshotProgram(this.programCache, [...paths, globalsShimPath], { [globalsShimPath]: globalsShim });\n return new TranspileProgramBatch(this, snapshot, program, checker);\n }\n\n // the language printers read the typescript state (source file, checker, program)\n // off the context handed to them here, so two Transpiler instances never share\n // state and a nested transpile can restore whatever its caller was working on\n setContext(context: ITranspileContext): ITranspileContext {\n this.context = context;\n this.pythonTranspiler.setContext(context);\n this.phpTranspiler.setContext(context);\n this.csharpTranspiler.setContext(context);\n this.goTranspiler.setContext(context);\n this.javaTranspiler.setContext(context);\n this.rustTranspiler.setContext(context);\n this.cppTranspiler.setContext(context);\n return context;\n }\n\n /** @deprecated renamed to createProgramInMemoryAndSetContext */\n createProgramInMemoryAndSetGlobals(content): ITranspileContext {\n return this.createProgramInMemoryAndSetContext(content);\n }\n\n /** @deprecated renamed to createProgramByPathAndSetContext */\n createProgramByPathAndSetGlobals(path): ITranspileContext {\n return this.createProgramByPathAndSetContext(path);\n }\n\n checkFileDiagnostics(context: ITranspileContext = this.context) {\n // the pass only produces a Logger warning; on TS7 getGlobalDiagnostics forces a\n // whole-program check in tsgo, so skip it when nothing would be printed\n if (!Logger.verbose) {\n return;\n }\n const fileName = context.src.fileName;\n const programWide = getProgramWideDiagnostics(context.program);\n const diagnostics = [\n ...programWide.program,\n ...context.program.getSyntacticDiagnostics(fileName), ...programWide.global,\n ...context.program.getSemanticDiagnostics(fileName),\n ];\n if (diagnostics.length > 0) {\n let errorMessage = \"Errors found in the typescript code. Transpilation might produce invalid results:\\n\";\n diagnostics.forEach( msg => {\n errorMessage+= \" - \" + msg.text + \"\\n\";\n });\n Logger.warning(errorMessage);\n }\n }\n\n transpile(lang: Languages, mode: TranspilationMode, file: string, sync = false, createContext = true, handleImports = true): ITranspiledFile {\n // improve this logic later\n if (createContext) {\n if (mode === TranspilationMode.ByPath) {\n this.createProgramByPathAndSetContext(file);\n } else {\n this.createProgramInMemoryAndSetContext(file);\n }\n\n // check for warnings and errors\n this.checkFileDiagnostics();\n }\n\n const src = this.context.src;\n if (this.prefetch && !prefetchedFiles.has(src)) {\n prefetchedFiles.add(src);\n prefetchChecker(this.context.checker, src);\n }\n\n let transpiledContent = undefined;\n switch(lang) {\n case Languages.Python:\n this.pythonTranspiler.asyncTranspiling = !sync;\n transpiledContent = this.pythonTranspiler.printNode(src, -1);\n this.pythonTranspiler.asyncTranspiling = true; // reset to default\n break;\n case Languages.Php:\n this.phpTranspiler.asyncTranspiling = !sync;\n transpiledContent = this.phpTranspiler.printNode(src, -1);\n this.phpTranspiler.asyncTranspiling = true; // reset to default\n break;\n case Languages.CSharp:\n transpiledContent = this.csharpTranspiler.printNode(src, -1);\n break;\n case Languages.Go:\n // gofmt aligns trailing `//` comments through its tabwriter; the printer has to do\n // that itself so the emitted Go is already gofmt-clean (see alignGoTrailingComments)\n transpiledContent = alignGoTrailingComments (this.goTranspiler.printNode(src, -1));\n break;\n case Languages.Java:\n transpiledContent = this.javaTranspiler.printNode(src, -1);\n break;\n case Languages.Rust:\n transpiledContent = this.rustTranspiler.printNode(src, -1);\n break;\n case Languages.Cpp:\n transpiledContent = this.cppTranspiler.printNode(src, -1);\n break;\n }\n let imports = [];\n let exports = [];\n\n if (handleImports) {\n imports = this.pythonTranspiler.getFileImports(src);\n exports = this.pythonTranspiler.getFileExports(src);\n }\n\n const methodsTypes = this.pythonTranspiler.getMethodTypes(src);\n Logger.success(\"transpilation finished successfully\");\n\n return {\n content: transpiledContent,\n imports,\n exports,\n methodsTypes\n };\n }\n\n transpileDifferentLanguagesGeneric(mode: TranspilationMode, input: IInput[], content: string): ITranspiledFile[] {\n let context: ITranspileContext;\n if (mode === TranspilationMode.ByPath) {\n context = this.createProgramByPathAndSetContext(content);\n } else {\n context = this.createProgramInMemoryAndSetContext(content);\n }\n\n // check for warnings and errors\n this.checkFileDiagnostics(context);\n\n const files = [];\n input.forEach( (inp) => {\n const async = inp.async;\n\n files.push({\n content: this.transpile(inp.language, mode, content, !async, false, false).content\n });\n });\n\n const methodsTypes = this.pythonTranspiler.getMethodTypes(context.src);\n\n const imports = this.pythonTranspiler.getFileImports(context.src);\n const exports = this.pythonTranspiler.getFileExports(context.src);\n\n const output = files.map( (file) => {\n return {\n content: file.content,\n imports,\n exports,\n methodsTypes\n };\n });\n\n return output;\n }\n\n transpileDifferentLanguages(input: any[], content: string): ITranspiledFile[] {\n const config = input.map( (inp) => {\n return {\n language: this.convertStringToLanguageEnum(inp.language),\n async: inp.async\n };\n } );\n return this.transpileDifferentLanguagesGeneric(TranspilationMode.ByContent, config, content);\n }\n\n transpileDifferentLanguagesByPath(input: any[], content: string): ITranspiledFile[] {\n const config = input.map( (inp) => {\n return {\n language: this.convertStringToLanguageEnum(inp.language),\n async: inp.async\n };\n } );\n return this.transpileDifferentLanguagesGeneric(TranspilationMode.ByPath, config, content);\n }\n\n transpilePython(content): ITranspiledFile {\n return this.transpile(Languages.Python, TranspilationMode.ByContent, content, !this.pythonTranspiler.asyncTranspiling);\n }\n\n transpilePythonByPath(path): ITranspiledFile {\n return this.transpile(Languages.Python, TranspilationMode.ByPath, path, !this.pythonTranspiler.asyncTranspiling);\n }\n\n transpilePhp(content): ITranspiledFile {\n return this.transpile(Languages.Php, TranspilationMode.ByContent, content, !this.phpTranspiler.asyncTranspiling);\n }\n\n transpilePhpByPath(path): ITranspiledFile {\n return this.transpile(Languages.Php, TranspilationMode.ByPath, path, !this.phpTranspiler.asyncTranspiling);\n }\n\n transpileCSharp(content): ITranspiledFile {\n return this.transpile(Languages.CSharp, TranspilationMode.ByContent, content);\n }\n\n transpileCSharpByPath(path): ITranspiledFile {\n return this.transpile(Languages.CSharp, TranspilationMode.ByPath, path);\n }\n\n transpileJava(content): ITranspiledFile {\n return this.transpile(Languages.Java, TranspilationMode.ByContent, content);\n }\n\n transpileJavaByPath(path): ITranspiledFile {\n return this.transpile(Languages.Java, TranspilationMode.ByPath, path);\n }\n\n transpileGoByPath(path): ITranspiledFile {\n return this.transpile(Languages.Go, TranspilationMode.ByPath, path);\n }\n\n transpileGo(content): ITranspiledFile {\n return this.transpile(Languages.Go, TranspilationMode.ByContent, content);\n }\n\n transpileRust(content): ITranspiledFile {\n return this.transpile(Languages.Rust, TranspilationMode.ByContent, content);\n }\n\n transpileRustByPath(path): ITranspiledFile {\n return this.transpile(Languages.Rust, TranspilationMode.ByPath, path);\n }\n\n transpileCpp(content): ITranspiledFile {\n return this.transpile(Languages.Cpp, TranspilationMode.ByContent, content);\n }\n\n transpileCppByPath(path): ITranspiledFile {\n return this.transpile(Languages.Cpp, TranspilationMode.ByPath, path);\n }\n\n\n getFileImports(content: string): IFileImport[] {\n const context = this.createProgramInMemoryAndSetContext(content);\n return this.phpTranspiler.getFileImports(context.src);\n }\n\n getFileExports(content: string): IFileExport[] {\n const context = this.createProgramInMemoryAndSetContext(content);\n return this.phpTranspiler.getFileExports(context.src);\n }\n\n setPHPPropResolution(props: string[]) {\n this.phpTranspiler.propRequiresScopeResolutionOperator = props;\n }\n\n setPhpUncamelCaseIdentifiers(uncamelCase: boolean) {\n this.phpTranspiler.uncamelcaseIdentifiers = uncamelCase;\n }\n\n setPythonUncamelCaseIdentifiers(uncamelCase: boolean) {\n this.pythonTranspiler.uncamelcaseIdentifiers = uncamelCase;\n }\n\n setPhpAsyncTranspiling(async: boolean) {\n this.phpTranspiler.asyncTranspiling = async;\n }\n\n setPythonAsyncTranspiling(async: boolean) {\n this.pythonTranspiler.asyncTranspiling = async;\n }\n\n setPythonStringLiteralReplacements(replacements): void {\n this.pythonTranspiler.StringLiteralReplacements = replacements;\n }\n\n convertStringToLanguageEnum(lang: string): Languages {\n switch(lang) {\n case \"python\":\n return Languages.Python;\n case \"php\":\n return Languages.Php;\n case \"csharp\":\n return Languages.CSharp;\n case \"go\":\n return Languages.Go;\n case \"java\":\n return Languages.Java;\n case \"rust\":\n return Languages.Rust;\n case \"cpp\":\n return Languages.Cpp;\n }\n }\n}\n\n// A set of root files compiled as one typescript program, transpiled one at a time.\n// Obtained from Transpiler.createProgramBatch; mirrors the transpile*ByPath methods\n// of the Transpiler it came from, so a caller batches by replacing\n// for (const f of files) transpiler.transpileGoByPath(f)\n// with\n// const batch = transpiler.createProgramBatch(files);\n// for (const f of files) batch.transpileGoByPath(f)\n//\n// A failing file throws out of its own call and leaves the batch usable: the context\n// is rebuilt from the program on every call, so the caller can try/catch per file and\n// keep going. The batch borrows the Transpiler's printers and context, so do not\n// drive that Transpiler through another path while a batch loop is in flight — use\n// cloneSharingProgramCache() for a second, independent driver.\nclass TranspileProgramBatch {\n private readonly transpiler: Transpiler;\n private readonly snapshot: Snapshot;\n private readonly program: Program;\n private readonly checker: Checker;\n\n constructor(transpiler: Transpiler, snapshot: Snapshot, program: Program, checker: Checker) {\n this.transpiler = transpiler;\n this.snapshot = snapshot;\n this.program = program;\n this.checker = checker;\n }\n\n // releases the batch's snapshot on the TS7 server; the batch is unusable afterwards\n dispose(): void {\n this.snapshot.dispose();\n }\n\n getProgram(): Program {\n return this.program;\n }\n\n // point the owning Transpiler at one file of this batch, then run the same\n // diagnostics pass the single-file path runs\n setContextForPath(filePath: string): ITranspileContext {\n const src = this.program.getSourceFile(filePath) ?? this.program.getSourceFile(path.resolve(filePath));\n if (src === undefined) {\n throw new Error(`ast-transpiler: \"${filePath}\" is not a file of this program batch`);\n }\n const context = this.transpiler.setContext({ src, checker: this.checker, program: this.program });\n this.transpiler.checkFileDiagnostics(context);\n return context;\n }\n\n transpileByPath(lang: Languages, filePath: string, sync = false): ITranspiledFile {\n this.setContextForPath(filePath);\n return this.transpiler.transpile(lang, TranspilationMode.ByPath, filePath, sync, false);\n }\n\n transpilePythonByPath(filePath: string): ITranspiledFile {\n return this.transpileByPath(Languages.Python, filePath, !this.transpiler.pythonTranspiler.asyncTranspiling);\n }\n\n transpilePhpByPath(filePath: string): ITranspiledFile {\n return this.transpileByPath(Languages.Php, filePath, !this.transpiler.phpTranspiler.asyncTranspiling);\n }\n\n transpileCSharpByPath(filePath: string): ITranspiledFile {\n return this.transpileByPath(Languages.CSharp, filePath);\n }\n\n transpileGoByPath(filePath: string): ITranspiledFile {\n return this.transpileByPath(Languages.Go, filePath);\n }\n\n transpileJavaByPath(filePath: string): ITranspiledFile {\n return this.transpileByPath(Languages.Java, filePath);\n }\n\n transpileRustByPath(filePath: string): ITranspiledFile {\n return this.transpileByPath(Languages.Rust, filePath);\n }\n\n transpileCppByPath(filePath: string): ITranspiledFile {\n return this.transpileByPath(Languages.Cpp, filePath);\n }\n}\n\nexport {\n Transpiler,\n TranspileProgramBatch,\n // the TS7 flag enums of the typescript the generator runs on, for consumer hooks whose\n // own `typescript` resolution may be an older 7.x lacking them\n CheckFlags, ElementFlags, IndexKind, ObjectFlags, SignatureKind, SymbolFlags, TypeFlags, TypeFormatFlags,\n SyntaxKind,\n // the trailing-comment alignment pass, so a consumer that assembles its own Go files\n // (ccxt build/goTranspiler.ts) can run it on the assembled text as well\n alignGoTrailingComments,\n // the rust declared-Dict locals vocabulary + entry shape (rust-25), so the\n // helper-removal consumers can import them from the package entry\n RUST_DECLARED_DICT_LOCALS,\n};\nexport type { RustDeclaredDictLocalEntry };\n","import { BaseTranspiler } from \"./baseTranspiler.js\";\nimport { regexAll } from \"./utils.js\";\nimport { SyntaxKind } from \"typescript/unstable/ast\";\n\nconst parserConfig = {\n 'STATIC_TOKEN': '', // to do static decorator\n 'PUBLIC_KEYWORD': '',\n 'UNDEFINED_TOKEN': 'None',\n 'IF_TOKEN': 'if',\n 'ELSE_TOKEN': 'else',\n 'ELSEIF_TOKEN': 'elif',\n 'THIS_TOKEN': 'self',\n 'AMPERSTAND_APERSAND_TOKEN': 'and',\n 'BAR_BAR_TOKEN': 'or',\n 'SPACE_DEFAULT_PARAM': '',\n 'BLOCK_OPENING_TOKEN': ':',\n 'BLOCK_CLOSING_TOKEN': '',\n 'SPACE_BEFORE_BLOCK_OPENING': '',\n 'CONDITION_OPENING': '',\n 'CONDITION_CLOSE': '',\n 'TRUE_KEYWORD': 'True',\n 'FALSE_KEYWORD': 'False',\n 'THROW_TOKEN': 'raise',\n 'NOT_TOKEN': 'not ',\n 'PLUS_PLUS_TOKEN': ' += 1',\n 'MINUS_MINUS_TOKEN': ' -= 1',\n 'CONSTRUCTOR_TOKEN': 'def __init__',\n 'SUPER_CALL_TOKEN': 'super().__init__',\n 'PROPERTY_ASSIGNMENT_TOKEN': ':',\n 'FUNCTION_TOKEN': 'def',\n 'SUPER_TOKEN': 'super()',\n 'NEW_TOKEN': '',\n 'STRING_QUOTE_TOKEN': '\\'',\n 'LINE_TERMINATOR': '',\n 'METHOD_TOKEN': 'def',\n 'CATCH_TOKEN': 'except',\n 'CATCH_DECLARATION': 'Exception as',\n 'METHOD_DEFAULT_ACCESS': '',\n 'SPREAD_TOKEN': '*',\n 'NULL_TOKEN': 'None',\n};\nexport class PythonTranspiler extends BaseTranspiler {\n constructor(config = {}) {\n\n config['parser'] = Object.assign ({}, parserConfig, config['parser'] ?? {});\n\n super(config);\n this.id = \"python\";\n\n this.initConfig();\n this.asyncTranspiling = config['async'] ?? true;\n this.uncamelcaseIdentifiers = config['uncamelcaseIdentifiers'] ?? true;\n this.removeVariableDeclarationForFunctionExpression = config['removeVariableDeclarationForFunctionExpression'] ?? true;\n this.includeFunctionNameInFunctionExpressionDeclaration = config['includeFunctionNameInFunctionExpressionDeclaration'] ?? true;\n\n // user overrides\n this.applyUserOverrides(config);\n }\n\n initConfig() {\n this.LeftPropertyAccessReplacements = {\n 'this': 'self'\n };\n this.RightPropertyAccessReplacements = {\n 'push': 'append',\n 'toUpperCase': 'upper',\n 'toLowerCase': 'lower',\n // 'parseFloat': 'float',\n // 'parseInt': 'int',\n 'indexOf': 'find',\n 'padEnd': 'ljust',\n 'padStart': 'rjust'\n };\n this.FullPropertyAccessReplacements = {\n 'console.log': 'print',\n 'JSON.stringify': 'json.dumps',\n 'JSON.parse': 'json.loads',\n 'Math.log': 'math.log',\n 'Math.abs': 'abs',\n 'Math.min': 'min',\n 'Math.max': 'max',\n 'Math.ceil': 'math.ceil',\n 'Math.round': 'math.round',\n 'Math.floor': 'math.floor',\n 'Math.pow': 'math.pow',\n 'process.exit': 'sys.exit',\n 'Number.MAX_SAFE_INTEGER': 'float(\\'inf\\')',\n };\n this.CallExpressionReplacements = {\n 'parseInt': 'int',\n 'parseFloat': 'float',\n };\n\n this.PropertyAccessRequiresParenthesisRemoval = [\n // 'length',\n // 'toString',\n ];\n }\n\n printArrayIsArrayCall(node, identation, parsedArg = undefined) {\n return `isinstance(${parsedArg}, list)`;\n }\n\n printObjectKeysCall(node, identation, parsedArg = undefined) {\n return `list(${parsedArg}.keys())`;\n }\n\n printObjectValuesCall(node, identation, parsedArg = undefined) {\n return `list(${parsedArg}.values())`;\n }\n\n printPromiseAllCall(node, identation, parsedArg) {\n return `asyncio.gather(*${parsedArg})`;\n }\n\n printMathFloorCall(node, identation, parsedArg = undefined) {\n return `int(math.floor(${parsedArg}))`;\n }\n\n printMathCeilCall(node, identation, parsedArg = undefined) {\n return `int(math.ceil(${parsedArg}))`;\n }\n\n printNumberIsIntegerCall(node, identation , parsedArg = undefined) {\n return `isinstance(${parsedArg}, int)`;\n }\n\n printMathRoundCall(node, identation, parsedArg = undefined) {\n return `int(round(${parsedArg}))`;\n }\n\n printIncludesCall(node, identation, name?, parsedArg?) {\n return `${parsedArg} in ${name}`;\n }\n\n printJoinCall(node: any, identation: any, name?: any, parsedArg?: any) {\n return `${parsedArg}.join(${name})`;\n }\n\n printSplitCall(node: any, identation: any, name?: any, parsedArg?: any) {\n return `${name}.split(${parsedArg})`;\n }\n\n printConcatCall(node: any, identation: any, name?: any, parsedArg?: any) {\n return `${name} + ${parsedArg}`;\n }\n\n printPopCall(node: any, identation: any, name?: any) {\n return `${name}.pop()`;\n }\n\n printShiftCall(node: any, identation: any, name?: any) {\n return `${name}.pop(0)`;\n }\n\n printReverseCall(node, identation, name = undefined) {\n return `${name}.reverse()`;\n }\n\n printArrayPushCall(node, identation, name, parsedArg) {\n return `${name}.append(${parsedArg})`;\n }\n\n printToStringCall(node, identation, name = undefined) {\n return `str(${name})`;\n }\n\n printIndexOfCall(node, identation, name = undefined, parsedArg = undefined) {\n return `${name}.find(${parsedArg})`;\n }\n\n printSearchCall(node, identation, name = undefined, parsedArg = undefined) {\n return `${name}.find(${parsedArg})`;\n }\n\n printStartsWithCall(node, identation, name = undefined, parsedArg = undefined) {\n return `${name}.startswith(${parsedArg})`;\n }\n\n printEndsWithCall(node, identation, name = undefined, parsedArg = undefined) {\n return `${name}.endswith(${parsedArg})`;\n }\n\n printPadEndCall(node, identation, name, parsedArg, parsedArg2) {\n return `${name}.ljust(${parsedArg}, ${parsedArg2})`;\n }\n\n printPadStartCall(node, identation, name, parsedArg, parsedArg2) {\n return `${name}.rjust(${parsedArg}, ${parsedArg2})`;\n }\n\n printTrimCall(node, identation, name = undefined) {\n return `${name}.strip()`;\n }\n\n printToUpperCaseCall(node, identation, name = undefined) {\n return `${name}.upper()`;\n }\n\n printToLowerCaseCall(node, identation, name = undefined) {\n return `${name}.lower()`;\n }\n\n printJsonParseCall(node: any, identation: any, parsedArg?: any) {\n return `json.loads(${parsedArg})`;\n }\n\n printJsonStringifyCall(node: any, identation: any, parsedArg?: any) {\n return `json.dumps(${parsedArg})`;\n }\n\n printReplaceCall(node: any, identation: any, name?: any, parsedArg?: any, parsedArg2?: any) {\n return `${name}.replace(${parsedArg}, ${parsedArg2})`;\n }\n\n printReplaceAllCall(node: any, identation: any, name?: any, parsedArg?: any, parsedArg2?: any) {\n return `${name}.replace(${parsedArg}, ${parsedArg2})`;\n }\n\n printElementAccessExpressionExceptionIfAny(node) {\n if (node.expression.kind === SyntaxKind.ThisKeyword) {\n return \"getattr(self, \" + this.printNode(node.argumentExpression, 0) + \")\";\n }\n }\n\n printAssertCall(node, identation, parsedArgs) {\n return `assert ${parsedArgs}`;\n }\n\n printDateNowCall(node, identation) {\n return \"int(time.time() * 1000)\";\n }\n\n\n printForStatement(node, identation) {\n const varName = node.initializer.declarations[0].name.text;\n const initValue = this.printNode(node.initializer.declarations[0].initializer, 0);\n const roofValue = this.printNode(node.condition.right,0);\n\n const forStm = this.getIden(identation) + this.FOR_TOKEN + \" \" + varName + \" in range(\" + initValue + \", \" + roofValue + \"):\\n\" + node.statement.statements.map(st => this.printNode(st, identation+1)).join(\"\\n\");\n return this.printNodeCommentsIfAny(node, identation, forStm);\n }\n\n printPropertyAccessModifiers(node) {\n return \"\"; // no access modifier in python\n }\n\n transformLeadingComment(comment) {\n const commentRegex = [\n [ /(^|\\s)\\/\\//g, '$1#' ], // regular comments\n [ /\\/\\*\\*/, '\\\"\\\"\\\"' ], // eslint-disable-line\n [ / \\*\\//, '\\\"\\\"\\\"' ], // eslint-disable-line\n [ /\\[([^\\[\\]]*)\\]\\{@link (.*)\\}/g, '`$1 <$2>`' ], // eslint-disable-line\n [ /\\s+\\* @method/g, '' ], // docstring @method\n [ /(\\s+) \\* @description (.*)/g, '$1$2' ], // docstring description\n [ /\\s+\\* @name .*/g, '' ], // docstring @name\n [ /(\\s+) \\* @see( .*)/g, '$1see$2' ], // docstring @see\n [ /(\\s+ \\* @(param|returns) {[^}]*)string([^}]*}.*)/g, '$1str$3' ], // docstring type conversion\n [ /(\\s+ \\* @(param|returns) {[^}]*)object([^}]*}.*)/g, '$1dict$3' ], // doctstrubg type conversion\n [ /(\\s+) \\* @returns ([^\\{])/g, '$1:returns: $2' ], // eslint-disable-line\n [ /(\\s+) \\* @returns \\{(.+)\\}/g, '$1:returns $2:' ], // docstring return\n [ /(\\s+ \\* @param \\{[\\]\\[\\|a-zA-Z]+\\} )([a-zA-Z0-9_-]+)\\.([a-zA-Z0-9_-]+) (.*)/g, '$1$2[\\'$3\\'] $4' ], // eslint-disable-line\n [ /(\\s+) \\* @([a-z]+) \\{([\\]\\[a-zA-Z\\|]+)\\} ([a-zA-Z0-9_\\-\\.\\[\\]\\']+)/g, '$1:$2 $3 $4:' ], // eslint-disable-line\n ];\n\n const transformed = regexAll(comment, commentRegex);\n return transformed;\n }\n\n transformTrailingComment(comment) {\n const commentRegex = [\n [ /(^|\\s)\\/\\//g, '$1#' ], // regular comments\n ];\n\n const transformed = regexAll(comment, commentRegex);\n return \" \" + transformed;\n }\n\n transformPropertyAcessExpressionIfNeeded(node: any) {\n const expression = node.expression;\n const leftSide = this.printNode(expression, 0);\n const rightSide = node.name.text;\n\n let rawExpression = undefined;\n\n if (rightSide === \"length\") {\n rawExpression = \"len(\" + leftSide + \")\";\n } else if (rightSide === \"toString\") {\n rawExpression = \"str(\" + leftSide + \")\";\n }\n return rawExpression;\n }\n\n printClassDefinition(node: any, identation: any): string {\n const className = node.name.text;\n const heritageClauses = node.heritageClauses;\n\n let classInit = \"\";\n if (heritageClauses !== undefined) {\n const classExtends = heritageClauses[0].types[0].expression.text;\n classInit = this.getIden(identation) + \"class \" + className + \"(\" + classExtends + \"):\\n\";\n } else {\n classInit = this.getIden(identation) + \"class \" + className + \":\\n\";\n }\n return classInit;\n }\n\n isFunctionOutSideClass(node) {\n return !(node.parent && node.parent.kind === SyntaxKind.ClassDeclaration);\n }\n\n printMethodParameters(node) {\n let parsedArgs = super.printMethodParameters(node);\n const shouldAddSelf = !this.isFunctionOutSideClass(node);\n parsedArgs = shouldAddSelf ? (parsedArgs ? \"self, \" + parsedArgs : \"self\") : parsedArgs;\n return parsedArgs;\n }\n\n printInstanceOfExpression(node, identation) {\n const left = this.printNode(node.left, 0);\n const right = this.printNode(node.right, 0);\n return this.getIden(identation) + `isinstance(${left}, ${right})`;\n }\n\n handleTypeOfInsideBinaryExpression(node, identation) {\n const expression = node.left.expression;\n const right = node.right.text;\n\n const op = node.operatorToken.kind;\n const isDifferentOperator = op === SyntaxKind.ExclamationEqualsEqualsToken || op === SyntaxKind.ExclamationEqualsToken;\n const notOperator = isDifferentOperator ? this.NOT_TOKEN : \"\";\n\n switch (right) {\n case \"string\":\n return this.getIden(identation) + notOperator + \"isinstance(\" + this.printNode(expression, 0) + \", str)\";\n case \"number\":\n return this.getIden(identation) + notOperator + \"isinstance(\" + this.printNode(expression, 0) + \", numbers.Real)\";\n case \"boolean\":\n return this.getIden(identation) + notOperator + \"isinstance(\" + this.printNode(expression, 0) + \", bool)\";\n case \"object\":\n return this.getIden(identation) + notOperator + \"isinstance(\" + this.printNode(expression, 0) + \", dict)\";\n case \"undefined\":\n return this.getIden(identation) + this.printNode(expression, 0) + \" is \" + notOperator + \"None\";\n }\n\n return undefined;\n\n }\n\n printCustomBinaryExpressionIfAny(node, identation) {\n const left = node.left;\n const right = node.right.text;\n\n const op = node.operatorToken.kind;\n\n // Fix E712 comparison: if cond == True -> if cond:\n if ((op === SyntaxKind.EqualsEqualsToken || op === SyntaxKind.EqualsEqualsEqualsToken) && node.right.kind === SyntaxKind.TrueKeyword) {\n return this.getIden(identation) + this.printNode(node.left, 0);\n }\n\n if (left.kind === SyntaxKind.TypeOfExpression) {\n const typeOfExpression = this.handleTypeOfInsideBinaryExpression(node, identation);\n if (typeOfExpression) {\n return typeOfExpression;\n }\n }\n\n const prop = node?.left?.expression?.name?.text;\n\n if (prop) {\n const args = left.arguments;\n const parsedArg = (args && args.length > 0) ? this.printNode(args[0], 0): undefined;\n const leftSideOfIndexOf = left.expression.expression; // myString in myString.indexOf\n const leftSide = this.printNode(leftSideOfIndexOf, 0);\n // const rightType = this.getChecker().getTypeAtLocation(leftSideOfIndexOf); // type of myString in myString.indexOf (\"b\") >= 0;\n\n switch(prop) {\n case 'indexOf':\n if (op === SyntaxKind.GreaterThanEqualsToken && right === '0') {\n return this.getIden(identation) + `${parsedArg} in ${leftSide}`;\n }\n }\n }\n return undefined;\n }\n\n printConditionalExpression(node, identation) {\n const condition = this.printNode(node.condition, 0);\n const whenTrue = this.printNode(node.whenTrue, 0);\n const whenFalse = this.printNode(node.whenFalse, 0);\n\n return this.getIden(identation) + whenTrue + \" if \" + condition + \" else \" + whenFalse;\n }\n\n printDeleteExpression(node, identation) {\n const expression = this.printNode (node.expression);\n return `del ${expression}`;\n }\n\n getCustomOperatorIfAny(left, right, operator) {\n const rightText = right.getText();\n const isUndefined = rightText === \"undefined\";\n if (isUndefined) {\n switch (operator.kind) {\n case SyntaxKind.EqualsEqualsToken:\n return \"is\";\n case SyntaxKind.ExclamationEqualsToken:\n return \"is not\";\n case SyntaxKind.ExclamationEqualsEqualsToken:\n return \"is not\";\n case SyntaxKind.EqualsEqualsEqualsToken:\n return \"is\";\n }\n }\n }\n}\n","import { SyntaxKind, getLeadingCommentRanges, getTrailingCommentRanges, type BinaryExpression, type ClassDeclaration, type Node, type PropertyAccessExpression, type SourceFile } from \"typescript/unstable/ast\";\nimport { isArrayLiteralExpression, isArrowFunction, isAwaitExpression, isBinaryExpression, isBooleanLiteral, isCallExpression, isClassDeclaration, isConditionalExpression, isExportAssignment, isExportDeclaration, isFunctionDeclaration, isFunctionExpression, isImportDeclaration, isMethodDeclaration, isNumericLiteral, isObjectLiteralExpression, isSourceFile, isStringLiteralLikeNode, isVariableStatement } from \"typescript/unstable/ast/is\";\nimport { createAwaitExpression, createParenthesizedExpression, createReturnStatement } from \"typescript/unstable/ast/factory\";\nimport { SignatureKind, TypeFlags, type Checker, type Program } from \"typescript/unstable/sync\";\nimport { findAncestor, getAllSuperTypeNodes, isFunctionLike } from \"./tsUtils.js\";\nimport { IFileImport, IFileExport, TranspilationError, IMethodType, IParameterType, ITranspileContext } from './types.js';\nimport { unCamelCase } from \"./utils.js\";\nimport { Logger } from \"./logger.js\";\nimport { timingSafeEqual } from 'crypto';\n\nconst NO_CONTEXT_ERROR = \"No transpilation context set: the typescript program must be created before printing nodes.\";\n\nclass BaseTranspiler {\n\n NUM_LINES_BETWEEN_CLASS_MEMBERS = 1;\n LINES_BETWEEN_FILE_MEMBERS = 0;\n NUM_LINES_END_FILE = 1;\n SPACE_DEFAULT_PARAM = \" \";\n BLOCK_OPENING_TOKEN = '{';\n BLOCK_CLOSING_TOKEN = '}';\n SPACE_BEFORE_BLOCK_OPENING = ' ';\n CONDITION_OPENING = '(';\n CONDITION_CLOSE = ')';\n DEFAULT_IDENTATION = \" \";\n STRING_QUOTE_TOKEN = '\"';\n UNDEFINED_TOKEN = \"null\";\n NULL_TOKEN = \"null\";\n IF_TOKEN = \"if\";\n ELSE_TOKEN = \"else\";\n ELSEIF_TOKEN = \"else if\";\n THIS_TOKEN = \"this\";\n SLASH_TOKEN = \"/\";\n ASTERISK_TOKEN = \"*\";\n PLUS_TOKEN = \"+\";\n MINUS_TOKEN = \"-\";\n EQUALS_TOKEN = \"=\";\n EQUALS_EQUALS_TOKEN = \"==\";\n EXCLAMATION_EQUALS_TOKEN = \"!=\";\n EXCLAMATION_EQUALS_EQUALS_TOKEN = \"!=\";\n EQUALS_EQUALS_EQUALS_TOKEN = \"==\";\n AMPERSTAND_APERSAND_TOKEN = \"&&\";\n PLUS_EQUALS = \"+=\";\n BAR_BAR_TOKEN = \"||\";\n PERCENT_TOKEN = \"%\";\n RETURN_TOKEN = \"return\";\n OBJECT_OPENING = \"{\";\n OBJECT_CLOSING = \"}\";\n LEFT_PARENTHESIS = \"(\";\n RIGHT_PARENTHESIS = \")\";\n ARRAY_OPENING_TOKEN = \"[\";\n ARRAY_CLOSING_TOKEN = \"]\";\n TRUE_KEYWORD = \"true\";\n FALSE_KEYWORD = \"false\";\n NEW_CORRESPODENT = \"new\";\n THROW_TOKEN = \"throw\";\n AWAIT_TOKEN = \"await\";\n STATIC_TOKEN = \"static\";\n CONTINUE_TOKEN = \"continue\";\n EXTENDS_TOKEN = \":\";\n NOT_TOKEN = \"!\";\n SUPER_TOKEN = \"super\";\n PROPERTY_ACCESS_TOKEN = \".\";\n TRY_TOKEN = \"try\";\n CATCH_TOKEN = \"catch\";\n CATCH_DECLARATION = \"Exception\";\n BREAK_TOKEN = \"break\";\n IN_TOKEN = \"in\";\n LESS_THAN_TOKEN = \"<\";\n GREATER_THAN_TOKEN = \">\";\n GREATER_THAN_EQUALS_TOKEN = \">=\";\n LESS_THAN_EQUALS_TOKEN = \"<=\";\n PLUS_PLUS_TOKEN = \"++\";\n MINUS_MINUS_TOKEN = \"--\";\n CONSTRUCTOR_TOKEN = \"def __init__\";\n SUPER_CALL_TOKEN = \"super().__init__\";\n WHILE_TOKEN = \"while\";\n FOR_TOKEN = \"for\";\n VAR_TOKEN = \"\";\n\n METHOD_DEFAULT_ACCESS = \"public\";\n\n PROPERTY_ASSIGNMENT_TOKEN = \":\";\n PROPERTY_ASSIGNMENT_OPEN = \"\";\n PROPERTY_ASSIGNMENT_CLOSE = \"\";\n\n LINE_TERMINATOR = \";\";\n\n FUNCTION_TOKEN = \"function\";\n METHOD_TOKEN = \"function\";\n ASYNC_TOKEN = \"async\";\n PROMISE_TYPE_KEYWORD = \"Task\";\n\n NEW_TOKEN = \"new\";\n\n STRING_LITERAL_KEYWORD = \"StringLiteral\";\n STRING_KEYWORD = \"string\";\n NUMBER_KEYWORD = \"float\";\n\n PUBLIC_KEYWORD = \"public\";\n PRIVATE_KEYWORD = \"private\";\n VOID_KEYWORD = \"void\";\n BOOLEAN_KEYWORD = \"bool\";\n\n ARRAY_KEYWORD = \"List\";\n OBJECT_KEYWORD = \"Dictionary\";\n INTEGER_KEYWORD = \"int\";\n DEFAULT_RETURN_TYPE = \"object\";\n DEFAULT_PARAMETER_TYPE = \"object\";\n DEFAULT_TYPE = \"object\";\n\n FALSY_WRAPPER_OPEN = \"\";\n FALSY_WRAPPER_CLOSE = \"\";\n\n ELEMENT_ACCESS_WRAPPER_OPEN = \"\";\n ELEMENT_ACCESS_WRAPPER_CLOSE = \"\";\n\n COMPARISON_WRAPPER_OPEN = \"\";\n COMPARISON_WRAPPER_CLOSE = \"\";\n\n UKNOWN_PROP_WRAPPER_OPEN = \"\";\n UNKOWN_PROP_WRAPPER_CLOSE = \"\";\n\n UKNOWN_PROP_ASYNC_WRAPPER_OPEN = \"\";\n UNKOWN_PROP_ASYNC_WRAPPER_CLOSE = \"\";\n\n EQUALS_EQUALS_WRAPPER_OPEN = \"\";\n EQUALS_EQUALS_WRAPPER_CLOSE = \"\";\n\n DIFFERENT_WRAPPER_OPEN = \"\";\n DIFFERENT_WRAPPER_CLOSE = \"\";\n\n GREATER_THAN_WRAPPER_OPEN = \"\";\n GREATER_THAN_WRAPPER_CLOSE = \"\";\n\n LESS_THAN_WRAPPER_OPEN = \"\";\n LESS_THAN_WRAPPER_CLOSE = \"\";\n\n GREATER_THAN_EQUALS_WRAPPER_OPEN = \"\";\n GREATER_THAN_EQUALS_WRAPPER_CLOSE = \"\";\n\n LESS_THAN_EQUALS_WRAPPER_OPEN = \"\";\n LESS_THAN_EQUALS_WRAPPER_CLOSE = \"\";\n\n DIVIDE_WRAPPER_OPEN = \"\";\n DIVIDE_WRAPPER_CLOSE = \"\";\n\n PLUS_WRAPPER_OPEN = \"\";\n PLUS_WRAPPER_CLOSE = \"\";\n\n MINUS_WRAPPER_OPEN = \"\";\n MINUS_WRAPPER_CLOSE = \"\";\n\n MOD_WRAPPER_OPEN = \"\";\n MOD_WRAPPER_CLOSE = \"\";\n\n ARRAY_LENGTH_WRAPPER_OPEN = \"\";\n ARRAY_LENGTH_WRAPPER_CLOSE = \"\";\n\n MULTIPLY_WRAPPER_OPEN = \"\";\n MULTIPLY_WRAPPER_CLOSE = \"\";\n\n INDEXOF_WRAPPER_OPEN = \"\";\n INDEXOF_WRAPPER_CLOSE = \"\";\n\n PARSEINT_WRAPPER_OPEN = \"\";\n PARSEINT_WRAPPER_CLOSE = \"\";\n\n DYNAMIC_CALL_OPEN = \"\";\n\n SPREAD_TOKEN = \"...\";\n\n INFER_VAR_TYPE = false;\n INFER_ARG_TYPE = false;\n\n SupportedKindNames = {};\n PostFixOperators = {};\n PrefixFixOperators = {};\n FunctionDefSupportedKindNames = {};\n\n LeftPropertyAccessReplacements = {};\n RightPropertyAccessReplacements = {};\n FullPropertyAccessReplacements = {};\n StringLiteralReplacements = {};\n\n CallExpressionReplacements = {};\n ReservedKeywordsReplacements = {};\n ReassignedVars = {};\n PropertyAccessRequiresParenthesisRemoval = [];\n VariableTypeReplacements = {};\n ArgTypeReplacements = {};\n\n FuncModifiers = {};\n defaultPropertyAccess = 'public';\n\n currentClassName = \"\";\n className = \"undefined\";\n\n uncamelcaseIdentifiers;\n asyncTranspiling;\n implicitAsyncTranspiling;\n requiresReturnType;\n requiresParameterType;\n supportsFalsyOrTruthyValues;\n requiresCallExpressionCast;\n removeVariableDeclarationForFunctionExpression;\n includeFunctionNameInFunctionExpressionDeclaration;\n id;\n // typescript state for the transpilation currently in flight. Set by the owning\n // Transpiler before it walks the AST, so nothing leaks through process globals.\n context: ITranspileContext | undefined;\n\n constructor(config) {\n Object.assign (this, (config['parser'] || {}));\n this.id = \"base\";\n this.uncamelcaseIdentifiers = false;\n this.requiresReturnType = false;\n this.requiresParameterType = false;\n this.supportsFalsyOrTruthyValues = true;\n this.requiresCallExpressionCast = false;\n this.removeVariableDeclarationForFunctionExpression = true;\n this.includeFunctionNameInFunctionExpressionDeclaration = true;\n this.initOperators();\n }\n\n setContext(context: ITranspileContext | undefined): void {\n this.context = context;\n }\n\n getSrc(): SourceFile {\n if (this.context === undefined) throw new Error(NO_CONTEXT_ERROR);\n return this.context.src;\n }\n\n getChecker(): Checker {\n if (this.context === undefined) throw new Error(NO_CONTEXT_ERROR);\n return this.context.checker;\n }\n\n // the checker when a transpilation context is set, undefined otherwise (an in-memory\n // program without one keeps every helper the checker would have proven away)\n // true when some node under `scope` (excluding `scope` itself) satisfies `predicate`;\n // the walk stops at the first hit and does not descend below it\n hasNodeWhere(scope: Node | undefined, predicate: (n: any) => boolean): boolean {\n if (scope === undefined) {\n return false;\n }\n let found = false;\n const visit = (n: any) => {\n if (found) {\n return;\n }\n if (predicate(n)) {\n found = true;\n return;\n }\n n.forEachChild(visit);\n };\n scope.forEachChild(visit);\n return found;\n }\n\n checkerOrUndefined(): Checker | undefined {\n return this.context?.checker;\n }\n\n getProgram(): Program {\n if (this.context === undefined) throw new Error(NO_CONTEXT_ERROR);\n return this.context.program;\n }\n\n initOperators() {\n this.SupportedKindNames = {\n [SyntaxKind.StringLiteral]: this.STRING_LITERAL_KEYWORD,\n [SyntaxKind.StringKeyword]: this.STRING_KEYWORD,\n // [ts.SyntaxKind.NumberKeyword]: this.NUMBER_KEYWORD,\n [SyntaxKind.NumberKeyword]: this.DEFAULT_TYPE,\n [SyntaxKind.MinusMinusToken]: this.MINUS_MINUS_TOKEN,\n [SyntaxKind.MinusToken]: this.MINUS_TOKEN,\n [SyntaxKind.SlashToken]: this.SLASH_TOKEN,\n [SyntaxKind.AsteriskToken]: this.ASTERISK_TOKEN,\n [SyntaxKind.InKeyword]: this.IN_TOKEN,\n [SyntaxKind.PlusToken]: this.PLUS_TOKEN,\n [SyntaxKind.PercentToken]: this.PERCENT_TOKEN,\n [SyntaxKind.LessThanToken]: this.LESS_THAN_TOKEN,\n [SyntaxKind.LessThanEqualsToken]: this.LESS_THAN_EQUALS_TOKEN,\n [SyntaxKind.GreaterThanToken]: this.GREATER_THAN_TOKEN,\n [SyntaxKind.GreaterThanEqualsToken]: this.GREATER_THAN_EQUALS_TOKEN,\n [SyntaxKind.EqualsEqualsToken]: this.EQUALS_EQUALS_TOKEN,\n [SyntaxKind.EqualsEqualsEqualsToken]: this.EQUALS_EQUALS_EQUALS_TOKEN,\n [SyntaxKind.EqualsToken]: this.EQUALS_TOKEN,\n [SyntaxKind.PlusEqualsToken]: this.PLUS_EQUALS,\n [SyntaxKind.BarBarToken]: this.BAR_BAR_TOKEN,\n [SyntaxKind.AmpersandAmpersandToken]: this.AMPERSTAND_APERSAND_TOKEN,\n [SyntaxKind.ExclamationEqualsEqualsToken]: this.EXCLAMATION_EQUALS_EQUALS_TOKEN,\n [SyntaxKind.ExclamationEqualsToken]: this.EXCLAMATION_EQUALS_TOKEN,\n [SyntaxKind.AsyncKeyword]: this.ASYNC_TOKEN,\n [SyntaxKind.AwaitKeyword]: this.AWAIT_TOKEN,\n [SyntaxKind.StaticKeyword]: this.STATIC_TOKEN,\n [SyntaxKind.PublicKeyword]: this.PUBLIC_KEYWORD,\n [SyntaxKind.PrivateKeyword]: this.PRIVATE_KEYWORD,\n [SyntaxKind.VoidKeyword]: this.VOID_KEYWORD,\n [SyntaxKind.BooleanKeyword]: this.BOOLEAN_KEYWORD,\n };\n\n this.PostFixOperators = {\n [SyntaxKind.PlusPlusToken]: this.PLUS_PLUS_TOKEN,\n [SyntaxKind.MinusMinusToken]: this.MINUS_MINUS_TOKEN,\n };\n\n this.PrefixFixOperators = {\n [SyntaxKind.ExclamationToken]: this.NOT_TOKEN,\n [SyntaxKind.MinusToken]: this.MINUS_TOKEN,\n };\n\n this.FunctionDefSupportedKindNames = {\n [SyntaxKind.StringKeyword]: this.STRING_KEYWORD\n };\n\n this.FuncModifiers = {\n [SyntaxKind.AsyncKeyword]: this.ASYNC_TOKEN,\n [SyntaxKind.PublicKeyword]: this.PUBLIC_KEYWORD,\n [SyntaxKind.PrivateKeyword]: this.PRIVATE_KEYWORD,\n [SyntaxKind.StaticKeyword]: this.STATIC_TOKEN,\n };\n }\n\n capitalize(str: string) {\n return str[0].toUpperCase() + str.slice(1);\n }\n\n applyUserOverrides(config): void {\n this.LeftPropertyAccessReplacements = Object.assign ({}, this.LeftPropertyAccessReplacements, config['LeftPropertyAccessReplacements'] ?? {});\n this.RightPropertyAccessReplacements = Object.assign ({}, this.RightPropertyAccessReplacements, config['RightPropertyAccessReplacements'] ?? {});\n this.FullPropertyAccessReplacements = Object.assign ({}, this.FullPropertyAccessReplacements, config['FullPropertyAccessReplacements'] ?? {});\n this.CallExpressionReplacements = Object.assign ({}, this.CallExpressionReplacements, config['CallExpressionReplacements'] ?? {});\n this.StringLiteralReplacements = Object.assign ({}, this.StringLiteralReplacements, config['StringLiteralReplacements'] ?? {});\n }\n\n getLineAndCharacterOfNode(node): [number,number] {\n const { line, character } =\n this.getSrc().getLineAndCharacterOfPosition(node.getStart());\n return [line + 1,character];\n }\n\n isComment(line: string){\n line = line.trim();\n return line.startsWith(\"//\") || line.startsWith(\"/*\") || line.startsWith(\"*\");\n }\n\n isStringType(flags: TypeFlags) {\n return flags === TypeFlags.String || flags === TypeFlags.StringLiteral;\n }\n\n isAnyType(flags: TypeFlags) {\n return flags === TypeFlags.Any;\n }\n\n warnIfAnyType(node, flags, variable, target) {\n if (this.isAnyType(flags)) {\n const [line, character] = this.getLineAndCharacterOfNode(node);\n Logger.warning(`[${this.id}] Line: ${line} char: ${character}: ${variable} has any type, ${target} might be incorrectly transpiled`);\n }\n }\n\n warn(node, target, message) {\n const [line, character] = this.getLineAndCharacterOfNode(node);\n Logger.warning(`[${this.id}] Line: ${line} char: ${character}: ${target} : ${message}`);\n }\n\n hasAsyncModifier(node) {\n return (node.modifiers ?? []).some(mod => mod.kind === SyntaxKind.AsyncKeyword);\n }\n\n isPromiseType(type) {\n return type !== undefined && this.getTypeFromRawType(type) === this.PROMISE_TYPE_KEYWORD;\n }\n\n isImplicitAsyncFunction(node) {\n // a function declared WITHOUT the `async` keyword that returns a Promise\n // directly, ie: `watchTicker (symbol: string): Promise { return this.watch (...); }`\n // (a common fast-path in JS for pure delegator/pass-through methods);\n // target languages without that distinction transpile it as if it were `async`\n if (!this.implicitAsyncTranspiling || !isFunctionLike(node) || this.hasAsyncModifier(node)) {\n return false;\n }\n const signature = this.getChecker().getSignatureFromDeclaration(node);\n return signature !== undefined && this.isPromiseType(this.getChecker().getReturnTypeOfSignature(signature));\n }\n\n isAsyncFunction(node) {\n return this.hasAsyncModifier(node) || this.isImplicitAsyncFunction(node);\n }\n\n getMethodOverride(node: Node): Node {\n /////\n //// Warning: Only takes into consideration 1 level of heritage\n //// might be costly, try to improve its performance later\n ////\n // Check if the method is a member of a class\n if (node === undefined) {\n return undefined;\n }\n if (!isClassDeclaration(node.parent)) {\n return undefined;\n }\n\n // Get the class declaration\n const classDeclaration = node.parent as ClassDeclaration;\n\n // Check if the class has a base class\n if (!classDeclaration.heritageClauses) {\n return undefined;\n }\n\n let method = undefined;\n\n let parentClass = getAllSuperTypeNodes(node.parent)[0];\n\n while (parentClass !== undefined) {\n const parentClassType = this.getChecker().getTypeAtLocation(parentClass);\n const parentClassDecl = parentClassType?.getSymbol()?.valueDeclaration?.resolve();\n\n if (parentClassDecl === undefined) {\n this.warn(node, \"Parent class\", \"Parent class not found\");\n return undefined;\n }\n\n const parentClassMembers = (parentClassDecl as any).members ?? [];\n\n parentClassMembers.forEach(elem=> {\n if (isMethodDeclaration(elem)) {\n\n const name = elem.name.getText().trim();\n if ((node as any).name.text === name) {\n method = elem;\n }\n }\n });\n\n parentClass = getAllSuperTypeNodes(parentClassDecl)[0] ?? undefined;\n }\n\n\n\n // TODO: Check if the method has the same signature as a method in the base class\n return method;\n }\n\n getIden (num) {\n return this.DEFAULT_IDENTATION.repeat(parseInt(num));\n }\n\n getBlockOpen(identation){\n return this.SPACE_BEFORE_BLOCK_OPENING + this.BLOCK_OPENING_TOKEN + \"\\n\";\n }\n\n getBlockClose(identation, chainBlock = false) {\n\n if (chainBlock) {\n return this.BLOCK_CLOSING_TOKEN ? \"\\n\" + this.getIden(identation) + this.BLOCK_CLOSING_TOKEN + this.SPACE_BEFORE_BLOCK_OPENING : \"\\n\" + this.getIden(identation) + this.BLOCK_CLOSING_TOKEN;\n }\n\n return this.BLOCK_CLOSING_TOKEN ? \"\\n\" + this.getIden(identation) + this.BLOCK_CLOSING_TOKEN : \"\";\n }\n\n startsWithUpperCase(str) {\n return str.charAt(0) === str.charAt(0).toUpperCase();\n }\n\n unCamelCaseIfNeeded(name: string): string {\n\n if (this.uncamelcaseIdentifiers && !this.startsWithUpperCase(name) ) { // avoid snake_case constant (MY_CONSTANT) or exception errors (BadRequestException)\n return unCamelCase(name) ?? name;\n }\n return name;\n }\n\n transformIdentifier(node, identifier) {\n return this.unCamelCaseIfNeeded(identifier);\n }\n\n transformCallExpressionName(name: string, nameNode = undefined) {\n return name;\n }\n\n transformPropertyAccessExpressionName(name: string, nameNode = undefined) {\n return name;\n }\n\n printIdentifier(node) {\n let idValue = node.text ?? node.text;\n\n if (this.ReservedKeywordsReplacements[idValue]) {\n idValue = this.ReservedKeywordsReplacements[idValue];\n }\n\n if (idValue === \"undefined\") {\n return this.UNDEFINED_TOKEN;\n }\n return this.transformIdentifier(node, idValue); // check this later\n }\n\n shouldRemoveParenthesisFromCallExpression(node) {\n if (node.expression.kind === SyntaxKind.PropertyAccessExpression) {\n return this.PropertyAccessRequiresParenthesisRemoval.includes(node.expression.name.text);\n }\n return false;\n }\n\n printInstanceOfExpression(node, identation) {\n // const left = this.printNode(node.left, 0);\n // const right = this.printNode(node.right, 0);\n const left = node.left.text;\n const right = node.right.text;\n return this.getIden(identation) + `${left} instanceof ${right}`;\n }\n\n getCustomOperatorIfAny(left, right, operator) {\n return undefined;\n }\n\n printCustomBinaryExpressionIfAny(node, identation) {\n return undefined; // stub to override\n }\n\n printBinaryExpression(node, identation) {\n\n const {left, right, operatorToken} = node;\n\n const customBinaryExp = this.printCustomBinaryExpressionIfAny(node, identation);\n if (customBinaryExp) {\n return customBinaryExp;\n }\n\n if (operatorToken.kind == SyntaxKind.InstanceOfKeyword) {\n return this.printInstanceOfExpression(node, identation);\n }\n\n let operator = this.SupportedKindNames[operatorToken.kind];\n\n\n let leftVar = undefined;\n let rightVar = undefined;\n\n // c# wrapper\n if (operatorToken.kind === SyntaxKind.EqualsEqualsToken || operatorToken.kind === SyntaxKind.EqualsEqualsEqualsToken) {\n if (this.COMPARISON_WRAPPER_OPEN) {\n leftVar = this.printNode(left, 0);\n rightVar = this.printNode(right, identation);\n return `${this.COMPARISON_WRAPPER_OPEN}${leftVar}, ${rightVar}${this.COMPARISON_WRAPPER_CLOSE}`;\n }\n }\n let prefixes = \"\";\n // check if boolean operators || and && because of the falsy values\n if (operatorToken.kind === SyntaxKind.BarBarToken || operatorToken.kind === SyntaxKind.AmpersandAmpersandToken) {\n leftVar = this.printCondition(left, 0);\n rightVar = this.printCondition(right, identation);\n } else {\n leftVar = this.printNode(left, 0);\n\n\n // if (right.kind === ts.SyntaxKind.ObjectLiteralExpression) {\n prefixes = this.getBinaryExpressionPrefixes(node, identation) ?? \"\";\n // }\n\n rightVar = this.printNode(right, identation);\n }\n\n const customOperator = this.getCustomOperatorIfAny(left, right, operatorToken);\n\n operator = customOperator ? customOperator : operator;\n\n return prefixes + leftVar +\" \"+ operator + \" \" + rightVar.trim();\n }\n\n getBinaryExpressionPrefixes(node, identation) {\n return undefined;\n }\n\n transformPropertyAcessExpressionIfNeeded (node) {\n return undefined;\n }\n\n transformPropertyAcessRightIdentifierIfNeeded (name: string): string {\n return this.unCamelCaseIfNeeded(name);\n }\n\n getExceptionalAccessTokenIfAny(node) {\n return undefined; // stub to override\n }\n\n printLengthProperty(node, identation, name = undefined) {\n return undefined; // stub to override\n }\n\n printPropertyAccessExpression(node, identation) {\n\n const expression = node.expression;\n\n const transformedProperty = this.transformPropertyAcessExpressionIfNeeded(node);\n if (transformedProperty) {\n return this.getIden(identation) + transformedProperty;\n }\n\n let leftSide = node.expression.text;\n let rightSide = node.name.text;\n\n switch (rightSide) {\n case \"length\":\n return this.printLengthProperty(node, identation, leftSide);\n }\n\n let rawExpression = node.getText().trim();\n\n if (this.FullPropertyAccessReplacements.hasOwnProperty(rawExpression)){ // eslint-disable-line\n return this.FullPropertyAccessReplacements[rawExpression]; // eslint-disable-line\n }\n\n leftSide = this.LeftPropertyAccessReplacements.hasOwnProperty(leftSide) ? this.LeftPropertyAccessReplacements[leftSide] : this.printNode(expression, 0); // eslint-disable-line\n\n // checking \"toString\" insde the object will return the builtin toString method :X\n rightSide = this.RightPropertyAccessReplacements.hasOwnProperty(rightSide) ? // eslint-disable-line\n this.RightPropertyAccessReplacements[rightSide] :\n this.transformPropertyAcessRightIdentifierIfNeeded(rightSide) ?? rightSide;\n\n // join together the left and right side again\n const accessToken = this.getExceptionalAccessTokenIfAny(node) ?? this.PROPERTY_ACCESS_TOKEN;\n\n rawExpression = leftSide + accessToken + this.transformPropertyAccessExpressionName(rightSide, node.name);\n\n return rawExpression;\n }\n\n printCustomDefaultValueIfNeeded(node) {\n return undefined;\n }\n\n printParameteCustomName(node, name, defaultValue = true) {\n // useful for when we have to get the parent's method argument type\n const initializer = node.initializer;\n\n let type = this.printParameterType(node);\n type = type ? type + \" \" : \"\";\n\n if (defaultValue) {\n if (initializer) {\n const customDefaultValue = this.printCustomDefaultValueIfNeeded(initializer);\n const defaultValue = customDefaultValue ? customDefaultValue : this.printNode(initializer, 0);\n return type + name + this.SPACE_DEFAULT_PARAM + \"=\" + this.SPACE_DEFAULT_PARAM + defaultValue;\n }\n return type + name;\n }\n return name;\n }\n\n printParameter(node, defaultValue = true) {\n const name = this.printNode(node.name, 0);\n const initializer = node.initializer;\n\n let type = this.printParameterType(node);\n type = type ? type + \" \" : \"\";\n\n if (defaultValue) {\n if (initializer) {\n const customDefaultValue = this.printCustomDefaultValueIfNeeded(initializer);\n const defaultValue = customDefaultValue ? customDefaultValue : this.printNode(initializer, 0);\n if (type) {\n type = (defaultValue === \"null\" && type !== \"object\") ? type + \"? \": type + \" \";\n }\n return type + name + this.SPACE_DEFAULT_PARAM + \"=\" + this.SPACE_DEFAULT_PARAM + defaultValue;\n }\n if (type === \"\") {\n return name;\n }\n return type + \" \" + name;\n }\n return name;\n }\n\n printModifiers(node) {\n let modifiers = node.modifiers ?? [];\n modifiers = modifiers.filter(mod => this.FuncModifiers[mod.kind]);\n\n if (!this.asyncTranspiling) {\n modifiers = modifiers.filter(mod => mod.kind !== SyntaxKind.AsyncKeyword);\n }\n let res = modifiers.map(modifier => this.FuncModifiers[modifier.kind]).join(\" \");\n\n if (this.asyncTranspiling && this.ASYNC_TOKEN && this.isImplicitAsyncFunction(node)) {\n // non-async functions returning a Promise directly are transpiled\n // as if they had been declared `async`\n res = res ? res + \" \" + this.ASYNC_TOKEN : this.ASYNC_TOKEN;\n }\n\n return res;\n }\n\n transformLeadingComment(comment) {\n return comment; // to override\n }\n\n transformTrailingComment(comment) {\n return comment; // to override\n }\n\n printLeadingComments(node, identation) {\n const fullText = this.getSrc().getFullText();\n const commentsRangeList = getLeadingCommentRanges(fullText, node.pos);\n const commentsRange = commentsRangeList ? commentsRangeList : undefined;\n let res = \"\";\n if (commentsRange) {\n for (const commentRange of commentsRange) {\n const commentText = fullText.slice(commentRange.pos, commentRange.end);\n if (commentText !== undefined) {\n const formatted = commentText\n .split(\"\\n\")\n .map(line=>line.trim())\n .map(line => !(line.trim().startsWith(\"*\")) ? this.getIden(identation) + line : this.getIden(identation) + \" \" + line) .join(\"\\n\");\n res+= this.transformLeadingComment(formatted) + \"\\n\";\n }\n }\n }\n return res;\n }\n\n printTraillingComment(node, identation) {\n const fullText = this.getSrc().getFullText();\n const commentsRangeList = getTrailingCommentRanges(fullText, node.end);\n const commentsRange = commentsRangeList ? commentsRangeList : undefined;\n let res = \"\";\n if (commentsRange) {\n for (const commentRange of commentsRange) {\n const commentText = fullText.slice(commentRange.pos, commentRange.end);\n if (commentText !== undefined) {\n res+= \" \" + this.transformTrailingComment(commentText);\n }\n }\n }\n return res;\n }\n\n printNodeCommentsIfAny(node, identation, parsedNode) {\n const leadingComment = this.printLeadingComments(node, identation);\n const trailingComment = this.printTraillingComment(node, identation);\n return leadingComment + parsedNode + trailingComment;\n }\n\n getType(node) {\n // try to get type from declared type, example: x: string = \"foo\"\n const type = node.type;\n if (type) {\n if (type.kind === SyntaxKind.TypeReference) {\n const typeRef = type.typeName.text;\n if (typeRef === \"Promise\") {\n const typeArgs = type.typeArguments.filter(t => t.kind !== SyntaxKind.VoidKeyword);\n const insideTypes = typeArgs.map(type => {\n if (this.SupportedKindNames.hasOwnProperty(type.kind)) { // eslint-disable-line\n return this.SupportedKindNames[type.kind];\n } else {\n return type.text;\n }\n }).join(\",\");\n\n if (insideTypes.length > 0) {\n return `${this.PROMISE_TYPE_KEYWORD}<${insideTypes}>`;\n }\n return this.PROMISE_TYPE_KEYWORD;\n }\n return type.typeName.text;\n } else if (this.SupportedKindNames.hasOwnProperty(type.kind)) { // eslint-disable-line\n return this.SupportedKindNames[type.kind];\n }\n }\n\n // todo: infer from initializer re-think this logic ex: x = 1;\n // can we use the type checker here?\n const initializer = node.initializer;\n if (initializer) {\n if (isArrayLiteralExpression(initializer)) {\n return this.ARRAY_KEYWORD;\n }\n if (isBooleanLiteral(initializer)) {\n return this.BOOLEAN_KEYWORD;\n }\n if (isObjectLiteralExpression(initializer)) {\n return this.OBJECT_KEYWORD;\n }\n if (isNumericLiteral(initializer)) {\n // return this.NUMBER_TYPE_TOKEN;\n // const value = initializer.text;\n // const num = Number(value);\n // if (Number.isInteger(num)) {\n // return this.INTEGER_KEYWORD;\n // }\n // return this.NUMBER_KEYWORD;\n return this.DEFAULT_TYPE; // int and number to object\n }\n if (isStringLiteralLikeNode(initializer)) {\n return this.STRING_KEYWORD;\n }\n }\n return undefined;\n }\n\n getTypeFromRawType(type) {\n // check for primitive types\n if (type.flags === TypeFlags.Any) {\n return undefined;\n }\n if (type.flags === TypeFlags.Void) {\n return this.VOID_KEYWORD;\n }\n if (type.flags === TypeFlags.Number) {\n // return this.NUMBER_KEYWORD;\n return this.DEFAULT_TYPE;\n }\n\n if (type.flags === TypeFlags.String) {\n return this.STRING_KEYWORD;\n }\n // if (type.flags === ts.TypeFlags.Boolean) {\n // return this.BOOLEAN_KEYWORD;\n // }\n\n // check for array or object\n\n if (type?.getSymbol()?.escapedName === 'Array') {\n return this.ARRAY_KEYWORD;\n }\n if (type?.getSymbol()?.escapedName === '__object') {\n return this.OBJECT_KEYWORD;\n }\n\n // check this out, trying to resolve Promise<{}>\n if (type?.getSymbol()?.escapedName === '__type') {\n return this.OBJECT_KEYWORD;\n // return this.DEFAULT_TYPE;\n }\n\n // check for promise type\n\n if (type?.getSymbol()?.escapedName === 'Promise') {\n return this.PROMISE_TYPE_KEYWORD;\n }\n\n // check this out not sure about this\n if (type?.intrinsicName === 'object') {\n return this.OBJECT_KEYWORD;\n }\n if (type?.intrinsicName === 'boolean') {\n return this.BOOLEAN_KEYWORD;\n }\n\n return undefined;\n }\n\n getFunctionType(node, async = true){\n // use type checker to do it here\n const type = this.getChecker().getReturnTypeOfSignature(this.getChecker().getSignatureFromDeclaration(node));\n\n const parsedTtype = this.getTypeFromRawType(type);\n\n if (parsedTtype === this.PROMISE_TYPE_KEYWORD) {\n const resolvedTypeArguments = this.getChecker().getTypeArguments(type as any);\n if (resolvedTypeArguments.length === 0) {\n return this.PROMISE_TYPE_KEYWORD;\n }\n if (resolvedTypeArguments.length === 1 && resolvedTypeArguments[0].flags === TypeFlags.Void) {\n return this.PROMISE_TYPE_KEYWORD;\n }\n\n const insideTypes = resolvedTypeArguments.map(type => this.getTypeFromRawType(type)).join(\",\");\n if (insideTypes.length > 0) {\n if (async) {\n return `${this.PROMISE_TYPE_KEYWORD}<${insideTypes}>`;\n } else {\n return insideTypes;\n }\n }\n return undefined;\n }\n return parsedTtype;\n }\n\n printFunctionBody(node, identation) {\n return this.printBlock(node.body, identation);\n }\n\n printParameterType(node) {\n if (!this.requiresParameterType) {\n return \"\";\n }\n\n if (!this.INFER_ARG_TYPE) {\n return this.DEFAULT_PARAMETER_TYPE;\n }\n\n const type = this.getChecker().typeToString(this.getChecker().getTypeAtLocation(node));\n\n if (this.ArgTypeReplacements[type]) {\n return this.ArgTypeReplacements[type];\n }\n\n return this.DEFAULT_PARAMETER_TYPE;\n }\n\n printFunctionType(node){\n if (!this.requiresReturnType) {\n return \"\";\n }\n\n const typeText = this.getFunctionType(node);\n if (typeText === undefined || (typeText !== this.VOID_KEYWORD && typeText !== this.PROMISE_TYPE_KEYWORD)) {\n // throw new FunctionReturnTypeError(\"Function return type is not supported\");\n let res = \"\";\n if (this.isAsyncFunction(node)) {\n res = `${this.PROMISE_TYPE_KEYWORD}<${this.DEFAULT_RETURN_TYPE}>`;\n } else {\n res = this.DEFAULT_RETURN_TYPE;\n }\n this.warn(node, node.name.getText(), \"Function return type not found, will default to: \" + res);\n return res;\n }\n return typeText;\n }\n\n\n printFunctionDefinition(node, identation) {\n let name = node.name?.text ?? \"\";\n name = this.transformFunctionNameIfNeeded(name);\n\n // const parsedArgs = node.parameters.map(param => this.printParameter(param)).join(\", \");\n const parsedArgs = this.printMethodParameters(node);\n\n let modifiers = this.printModifiers(node);\n modifiers = modifiers ? modifiers + \" \" : modifiers;\n\n let returnType = this.printFunctionType(node);\n // quick fix\n if (returnType === 'java.util.concurrent.CompletableFuture') {\n returnType = 'java.util.concurrent.CompletableFuture';\n }\n\n returnType = returnType ? returnType + \" \" : returnType;\n\n const fnKeyword = this.FUNCTION_TOKEN ? this.FUNCTION_TOKEN + \" \" : \"\";\n if (!fnKeyword && isFunctionDeclaration(node)){\n modifiers = modifiers + \"public \";\n }\n let functionDef = this.getIden(identation) + modifiers + returnType + fnKeyword;\n if (this.includeFunctionNameInFunctionExpressionDeclaration || !isFunctionExpression(node)) {\n functionDef += name;\n }\n functionDef += \"(\" + parsedArgs + \")\";\n\n return functionDef;\n }\n\n transformFunctionNameIfNeeded(name): string {\n return this.unCamelCaseIfNeeded(name);\n }\n\n printFunctionDeclaration(node, identation) {\n if (isArrowFunction(node)) {\n const parameters = node.parameters.map(param => this.printParameter(param)).join(\", \");\n const body = this.printNode(node.body);\n return `(${parameters}) => ${body}`;\n }\n const funcBody = this.printFunctionBody(node, identation);\n let functionDef = this.printFunctionDefinition(node, identation);\n functionDef += funcBody;\n\n return this.printNodeCommentsIfAny(node, identation, functionDef);\n }\n\n printMethodParameters(node) {\n return node.parameters.map(param => this.printParameter(param)).join(\", \");\n }\n\n transformMethodNameIfNeeded(name: string): string {\n return this.unCamelCaseIfNeeded(name);\n }\n\n printMethodDefinition(node, identation) {\n let name = node.name.text;\n name = this.transformMethodNameIfNeeded(name);\n\n let returnType = this.printFunctionType(node);\n\n let modifiers = this.printModifiers(node);\n const defaultAccess = this.METHOD_DEFAULT_ACCESS ? this.METHOD_DEFAULT_ACCESS + \" \": \"\";\n modifiers = modifiers ? modifiers + \" \" : defaultAccess; // tmp check this\n\n const parsedArgs = this.printMethodParameters(node);\n\n returnType = returnType ? returnType + \" \" : returnType;\n\n const methodToken = this.METHOD_TOKEN ? this.METHOD_TOKEN + \" \" : \"\";\n const methodDef = this.getIden(identation) + modifiers + returnType + methodToken + name\n + \"(\" + parsedArgs + \")\";\n\n return this.printNodeCommentsIfAny(node, identation, methodDef);\n }\n\n printMethodDeclaration(node, identation) {\n\n let methodDef = this.printMethodDefinition(node, identation);\n\n const funcBody = this.printFunctionBody(node, identation);\n\n methodDef += funcBody;\n\n return methodDef;\n }\n\n printStringLiteral(node) {\n const token = this.STRING_QUOTE_TOKEN;\n let text = node.text;\n if (text in this.StringLiteralReplacements) {\n return this.StringLiteralReplacements[text];\n }\n // trick to preserve valid backslashes (e.g. \\n, \\t)\n const backslashPlaceholder = \"\\x00\";\n text = text.replaceAll(\"\\\\\", backslashPlaceholder);\n text = text.replaceAll(\"\\b\", \"\\\\b\");\n text = text.replaceAll(\"\\f\", \"\\\\f\");\n text = text.replaceAll(\"\\n\", \"\\\\n\");\n text = text.replaceAll(\"\\r\", \"\\\\r\");\n text = text.replaceAll(\"\\t\", \"\\\\t\");\n text = text.replaceAll(backslashPlaceholder, \"\\\\\\\\\");\n if (token === \"'\") {\n text = text.replaceAll(\"'\", \"\\\\'\"); // escape single quotes\n } else if (token === \"\\\"\") {\n text = text.replaceAll(\"\\\"\", \"\\\\\\\"\"); // escape double quotes\n }\n return token + text + token;\n }\n\n printNumericLiteral(node) {\n return node.text;\n }\n\n printArrayLiteralExpression(node, identation) {\n\n const elements = node.elements.map((e) => {\n return this.printNode(e);\n }).join(\", \");\n return this.ARRAY_OPENING_TOKEN + elements + this.ARRAY_CLOSING_TOKEN;\n }\n\n printVariableDeclarationList(node,identation) {\n const declaration = node.declarations[0];\n const varToken = this.VAR_TOKEN ? this.VAR_TOKEN + \" \": \"\";\n\n if (this.removeVariableDeclarationForFunctionExpression && declaration?.initializer && (isFunctionExpression(declaration.initializer) || isArrowFunction(declaration.initializer))) {\n return this.printNode(declaration.initializer, identation).trimEnd();\n }\n // const name = declaration.name.escapedText;\n const parsedValue = (declaration.initializer) ? this.printNode(declaration.initializer, identation) : this.NULL_TOKEN;\n return this.getIden(identation) + varToken + this.printNode(declaration.name) + \" = \" + parsedValue.trim();\n }\n\n printVariableStatement(node, identation){\n\n if (this.isCJSRequireStatement(node)) {\n return \"\"; // remove cjs imports\n }\n\n const decList = node.declarationList;\n const varStatement = this.printVariableDeclarationList(decList, identation) + this.LINE_TERMINATOR;\n return this.printNodeCommentsIfAny(node, identation, varStatement);\n }\n\n printOutOfOrderCallExpressionIfAny(node, identation) {\n return undefined; // stub to override\n }\n\n printSuperCallInsideConstructor(node, identation) {\n const args = node.arguments;\n\n const parsedArgs = args.map((a) => {\n return this.printNode(a, identation).trim();\n }).join(\",\");\n return this.SUPER_CALL_TOKEN + \"(\" + parsedArgs + \")\";\n }\n\n isBuiltInFunctionCall(node) {\n const symbol = this.getChecker().getSymbolAtLocation(node);\n const isInLibFiles = symbol?.declarations\n ?.some(d => /\\/node_modules\\/(typescript|@typescript\\/typescript-[^/]+)\\/lib\\//.test(d.path))\n ?? false;\n\n\n return isInLibFiles;\n }\n\n getTypesFromCallExpressionParameters(node) {\n const resolvedParams = this.getChecker().getResolvedSignature(node).getParameters();\n const parsedTypes = [];\n resolvedParams.forEach((p) => {\n const decl = p.declarations[0].resolve();\n const type = this.getChecker().getTypeAtLocation(decl);\n const parsedType = this.getTypeFromRawType(type);\n parsedTypes.push(parsedType);\n });\n return parsedTypes;\n }\n\n printArgsForCallExpression(node, identation) {\n const args = node.arguments;\n\n const argsList = args.length > 0 ? args : [];\n const parsedArgs = argsList.map((a) => {\n return this.printNode(a, identation).trim();\n }).join(\", \");\n return parsedArgs;\n }\n\n // builtin functions override\n printArrayIsArrayCall(node, identation, parsedArg = undefined) {\n return undefined; // stub\n }\n\n printObjectKeysCall(node, identation, parsedArg = undefined) {\n return undefined; // stub\n }\n\n printObjectValuesCall(node, identation, parsedArg = undefined) {\n return undefined; // stub\n }\n\n printJsonParseCall(node, identation, parsedArg = undefined) {\n return undefined; // stub\n }\n\n printJsonStringifyCall(node, identation, parsedArg = undefined) {\n return undefined; // stub\n }\n\n\n printPromiseAllCall(node, identation, parsedArg = undefined) {\n return undefined; // stub\n }\n\n printMathFloorCall(node, identation, parsedArg = undefined) {\n return undefined; // stub\n }\n\n printMathRoundCall(node, identation, parsedArg = undefined) {\n return undefined; // stub\n }\n\n printMathCeilCall(node, identation, parsedArg = undefined) {\n return undefined; // stub\n }\n\n printNumberIsIntegerCall(node, identation, parsedArg = undefined) {\n return undefined; // stub\n }\n\n printArrayPushCall(node, identation, name = undefined, parsedArg = undefined) {\n return undefined; // stub\n }\n\n printIncludesCall(node, identation, name = undefined, parsedArg = undefined) {\n return undefined; // stub\n }\n\n printIndexOfCall(node, identation, name = undefined, parsedArg = undefined) {\n return undefined; // stub\n }\n\n printStartsWithCall(node, identation, name = undefined, parsedArg = undefined) {\n return undefined; // stub\n }\n\n printEndsWithCall(node, identation, name = undefined, parsedArg = undefined) {\n return undefined; // stub\n }\n\n printPadEndCall(node, identation, name, parsedArg, parsedArg2) {\n return undefined; // stub\n }\n\n printPadStartCall(node, identation, name, parsedArg, parsedArg2) {\n return undefined; // stub\n }\n\n printTrimCall(node, identation, name = undefined) {\n return undefined; // stub\n }\n\n printJoinCall(node, identation, name = undefined, parsedArg = undefined) {\n return undefined; // stub\n }\n\n printSplitCall(node, identation, name = undefined, parsedArg = undefined) {\n return undefined; // stub\n }\n\n printConcatCall(node, identation, name = undefined, parsedArg = undefined) {\n return undefined; // stub\n }\n\n printToFixedCall(node, identation, name = undefined, parsedArg = undefined) {\n return undefined; // stub\n }\n\n printSearchCall(node, identation, name = undefined, parsedArg = undefined) {\n return undefined; // stub\n }\n\n printSliceCall(node, identation, name = undefined, parsedArg = undefined, parsedArg2 = undefined) {\n return undefined; // stub\n }\n\n printReplaceCall(node, identation, name = undefined, parsedArg = undefined, parsedArg2 = undefined) {\n return undefined; // stub\n }\n\n printReplaceAllCall(node, identation, name = undefined, parsedArg = undefined, parsedArg2 = undefined) {\n return undefined; // stub\n }\n\n printToStringCall(node, identation, name = undefined) {\n return undefined; // stub\n }\n\n printToUpperCaseCall(node, identation, name = undefined) {\n return undefined; // stub\n }\n\n printToLowerCaseCall(node, identation, name = undefined) {\n return undefined; // stub\n }\n\n printShiftCall(node, identation, name = undefined) {\n return undefined; // stub\n }\n\n printReverseCall(node, identation, name = undefined) {\n return undefined; // stub\n }\n\n printPopCall(node, identation, name = undefined) {\n return undefined; // stub\n }\n\n printAssertCall(node, identation, parsedArgs) {\n return `assert(${parsedArgs})`;\n }\n\n printDateNowCall(node, identation) {\n return undefined; // stub\n }\n\n printCallExpression(node, identation) {\n const expression = node.expression;\n\n const parsedArgs = this.printArgsForCallExpression(node, identation);\n\n const removeParenthesis = this.shouldRemoveParenthesisFromCallExpression(node);\n\n const finalExpression = this.printOutOfOrderCallExpressionIfAny(node, identation);\n if (finalExpression) {\n return finalExpression;\n }\n\n // check propertyAccessExpression for built in functions calls like Json.parse\n if (node.expression.kind === SyntaxKind.PropertyAccessExpression) {\n const expressionText = node.expression.getText().trim();\n const args = node.arguments ?? [];\n\n if (args.length === 0) {\n switch(expressionText) {\n case \"Date.now\":\n return this.printDateNowCall(node, identation);\n }\n }\n\n if (args.length === 1) {\n const parsedArg = this.printNode(args[0], 0);\n switch (expressionText) {\n case \"JSON.parse\":\n return this.printJsonParseCall(node, identation, parsedArg);\n case \"JSON.stringify\":\n return this.printJsonStringifyCall(node, identation, parsedArg);\n case \"Array.isArray\":\n return this.printArrayIsArrayCall(node, identation, parsedArg);\n case \"Object.keys\":\n return this.printObjectKeysCall(node, identation, parsedArg);\n case \"Object.values\":\n return this.printObjectValuesCall(node, identation, parsedArg);\n case \"Promise.all\":\n return this.printPromiseAllCall(node, identation, parsedArg);\n case \"Math.round\":\n return this.printMathRoundCall(node, identation, parsedArg);\n case \"Math.floor\":\n return this.printMathFloorCall(node, identation, parsedArg);\n case \"Math.ceil\":\n return this.printMathCeilCall(node, identation, parsedArg);\n case \"Number.isInteger\":\n return this.printNumberIsIntegerCall(node, identation, parsedArg);\n }\n }\n const rightSide = node.expression.name?.text;\n const leftSide = node.expression?.expression;\n\n if (args.length === 0 && rightSide !== undefined && leftSide !== undefined) {\n const parsedLeftSide = this.printNode(leftSide, 0);\n switch (rightSide) {\n case \"toString\":\n return this.printToStringCall(node, identation, parsedLeftSide);\n case \"toUpperCase\":\n return this.printToUpperCaseCall(node, identation, parsedLeftSide);\n case \"toLowerCase\":\n return this.printToLowerCaseCall(node, identation, parsedLeftSide);\n case \"shift\":\n return this.printShiftCall(node, identation, parsedLeftSide);\n case \"pop\":\n return this.printPopCall(node, identation, parsedLeftSide);\n case \"reverse\":\n return this.printReverseCall(node, identation, parsedLeftSide);\n case \"trim\":\n return this.printTrimCall(node, identation, parsedLeftSide);\n }\n }\n\n // handle built in functions like\n\n const arg = args && args.length > 0 ? args[0] : undefined;\n\n if (leftSide && rightSide && arg) {\n const parsedArg = this.printNode(arg, identation).trimStart();\n const secondParsedArg = args[1] ? this.printNode(args[1], identation).trimStart() : undefined;\n const name = this.printNode(leftSide, 0);\n switch(rightSide) {\n case 'push':\n return this.printArrayPushCall(node, identation, name, parsedArg);\n case 'includes':\n return this.printIncludesCall(node, identation, name, parsedArg);\n case 'indexOf':\n return this.printIndexOfCall(node, identation, name, parsedArg);\n case 'join':\n return this.printJoinCall(node, identation, name, parsedArg);\n case 'split':\n return this.printSplitCall(node, identation, name, parsedArg);\n case 'toFixed':\n return this.printToFixedCall(node, identation, name, parsedArg);\n case 'concat':\n return this.printConcatCall(node, identation, name, parsedArg);\n case 'search':\n return this.printSearchCall(node, identation, name, parsedArg);\n case 'endsWith':\n return this.printEndsWithCall(node, identation, name, parsedArg);\n case 'startsWith':\n return this.printStartsWithCall(node, identation, name, parsedArg);\n case 'padEnd':\n return this.printPadEndCall(node, identation, name, parsedArg, secondParsedArg);\n case 'padStart':\n return this.printPadStartCall(node, identation, name, parsedArg, secondParsedArg);\n }\n\n if (args.length === 1 || args.length === 2) {\n const parsedArg2 = args[1] ? this.printNode(args[1], identation).trimStart() : undefined;\n switch(rightSide) {\n case 'slice':\n return this.printSliceCall(node, identation, name, parsedArg, parsedArg2);\n case 'replace':\n return this.printReplaceCall(node, identation, name, parsedArg, parsedArg2);\n case 'replaceAll':\n return this.printReplaceAllCall(node, identation, name, parsedArg, parsedArg2);\n }\n }\n }\n } else {\n // handle functions like assert\n const args = node.arguments ?? [];\n if (args.length === 2) {\n if ( expression.text === \"assert\") {\n return this.printAssertCall(node, identation, parsedArgs);\n }\n if (expression.text === \"padEnd\") {\n // check this\n }\n }\n }\n\n // print super() call inside constructor\n if (expression.kind === SyntaxKind.SuperKeyword) {\n return this.printSuperCallInsideConstructor(node, identation);\n }\n\n let parsedExpression = undefined;\n if (this.CallExpressionReplacements.hasOwnProperty(expression.getText())) { // eslint-disable-line\n parsedExpression = this.CallExpressionReplacements[expression.getText()];\n } else {\n if (expression.kind === SyntaxKind.Identifier) {\n const idValue = expression.text ?? expression.text;\n parsedExpression = this.transformCallExpressionName(this.unCamelCaseIfNeeded(idValue), expression);\n } else {\n parsedExpression = this.printNode(expression, 0);\n }\n }\n\n let parsedCall = parsedExpression;\n if (!removeParenthesis) {\n parsedCall+= \"(\" + parsedArgs + \")\";\n\n }\n return parsedCall;\n }\n\n printClassBody(node, identation) {\n // const parsedMembers = node.members.map(m => this.printNode(m, identation+1));\n\n const parsedMembers = [];\n node.members.forEach( (m, index) => {\n const parsedNode = this.printNode(m, identation+1);\n if (m.kind === SyntaxKind.PropertyDeclaration || index === 0) {\n parsedMembers.push(parsedNode);\n } else {\n parsedMembers.push(\"\\n\".repeat(this.NUM_LINES_BETWEEN_CLASS_MEMBERS) + parsedNode);\n }\n });\n return parsedMembers.join(\"\\n\");\n }\n\n getCustomClassName(node) {\n return node.name.text;\n }\n\n getClassModifier(node) {\n return \"\";\n }\n\n printClassDefinition(node, identation) {\n const className = this.getCustomClassName(node);\n this.currentClassName = className;\n const heritageClauses = node.heritageClauses;\n const classModifier = this.getClassModifier(node);\n\n let classInit = \"\";\n const classOpening = this.getBlockOpen(identation);\n if (heritageClauses !== undefined) {\n const classExtends = heritageClauses[0].types[0].expression.text;\n classInit = this.getIden(identation) + classModifier + \"class \" + className + \" \" + this.EXTENDS_TOKEN + \" \" + classExtends + classOpening;\n } else {\n classInit = this.getIden(identation) + classModifier + \"class \" + className + classOpening;\n }\n return classInit;\n }\n\n printClass(node, identation) {\n\n const classDefinition = this.printClassDefinition(node, identation);\n\n const classBody = this.printClassBody(node, identation);\n\n const classClosing = this.getBlockClose(identation);\n\n return classDefinition + classBody + classClosing;\n }\n\n printConstructorDeclaration (node, identation) {\n const args = this.printMethodParameters(node);\n const constructorBody = this.printFunctionBody(node, identation);\n return this.getIden(identation) +\n this.CONSTRUCTOR_TOKEN +\n \"(\" + args + \")\" +\n constructorBody;\n }\n\n printWhileStatement(node, identation) {\n const loopExpression = node.expression;\n\n const expression = this.printNode(loopExpression, 0);\n\n const whileStm = this.getIden(identation) +\n this.WHILE_TOKEN + \" \" +\n this.CONDITION_OPENING + expression + this.CONDITION_CLOSE +\n this.printBlock(node.statement, identation);\n return this.printNodeCommentsIfAny(node, identation, whileStm);\n }\n\n printForStatement(node, identation) {\n const initializer = this.printNode(node.initializer, 0);\n const condition = this.printNode(node.condition, 0);\n const incrementor = this.printNode(node.incrementor, 0);\n\n const forStm = this.getIden(identation) +\n this.FOR_TOKEN + \" \" +\n this.CONDITION_OPENING +\n initializer + \"; \" + condition + \"; \" + incrementor +\n this.CONDITION_CLOSE +\n this.printBlock(node.statement, identation);\n return this.printNodeCommentsIfAny(node, identation, forStm);\n }\n\n printBreakStatement(node, identation) {\n const breakStm = this.getIden(identation) + this.BREAK_TOKEN + this.LINE_TERMINATOR;\n return this.printNodeCommentsIfAny(node, identation, breakStm);\n }\n\n printPostFixUnaryExpression(node, identation) {\n const {operand, operator} = node;\n return this.getIden(identation) + this.printNode(operand, 0) + this.PostFixOperators[operator];\n }\n\n printPrefixUnaryExpression(node, identation) {\n const {operand, operator} = node;\n if (operator === SyntaxKind.ExclamationToken) {\n // not branch check falsy/turthy values if needed;\n return this.getIden(identation) + this.PrefixFixOperators[operator] + this.printCondition(node.operand, 0);\n }\n return this.getIden(identation) + this.PrefixFixOperators[operator] + this.printNode(operand, 0);\n }\n\n printObjectLiteralBody(node, identation) {\n let body = node.properties.map((p) => this.printNode(p, identation+1)).join(\",\\n\");\n body = body ? body + \",\" : body;\n return body;\n }\n\n printObjectLiteralExpression(node, identation) {\n const objectBody = this.printObjectLiteralBody(node, identation);\n const formattedObjectBody = objectBody ? \"\\n\" + objectBody + \"\\n\" + this.getIden(identation) : objectBody;\n return this.OBJECT_OPENING + formattedObjectBody + this.OBJECT_CLOSING;\n }\n\n printCustomRightSidePropertyAssignment(node, identation): string {\n return undefined; // stub to override\n }\n\n printPropertyAssignment(node, identation) {\n const {name, initializer} = node;\n const nameAsString = this.printNode(name, 0);\n\n const customRightSide = this.printCustomRightSidePropertyAssignment(initializer, identation);\n\n const valueAsString = customRightSide ? customRightSide : this.printNode(initializer, identation);\n\n let trailingComment = this.printTraillingComment(node, identation);\n trailingComment = trailingComment ? \" \" + trailingComment : trailingComment;\n\n const propOpen = this.PROPERTY_ASSIGNMENT_OPEN ? this.PROPERTY_ASSIGNMENT_OPEN + \" \": \"\";\n const propClose = this.PROPERTY_ASSIGNMENT_CLOSE ? \" \" + this.PROPERTY_ASSIGNMENT_CLOSE : \"\";\n\n return this.getIden(identation) +\n propOpen +\n nameAsString +\n this.PROPERTY_ASSIGNMENT_TOKEN + \" \" +\n valueAsString.trim() +\n propClose +\n trailingComment;\n }\n\n printElementAccessExpressionExceptionIfAny(node) {\n return undefined; // stub to override\n }\n\n // index WRITE (`x[\"k\"] = v`) whose receiver the C# classifier already declared as a\n // concrete dictionary: the `((IDictionary)x)` interface cast the C#\n // branch below emits only exists because the TS type says nothing about the printed\n // declaration, so a printer that knows the declared type can drop it. undefined/false\n // keeps the upstream cast (the untyped emission). See csharpTranspiler.ts.\n csharpDictionaryIndexWriteNeedsNoCast(node): boolean | undefined {\n return undefined; // stub to override\n }\n\n printElementAccessExpression(node, identation) {\n // example x['test']\n const {expression, argumentExpression} = node;\n\n const exception = this.printElementAccessExpressionExceptionIfAny(node);\n if (exception) {\n return exception;\n }\n\n // when we want replace x['test'] with getValue(x, 'test') only when in the left side\n // Examples:\n // x[\"a\"] = x[\"b\"] : binary expression\n // const a = x[\"b\"] : variable declaration\n const isLeftSideOfAssignment = node.parent?.kind === SyntaxKind.BinaryExpression &&\n (node.parent.operatorToken.kind === SyntaxKind.EqualsToken || node.parent.operatorToken.kind === SyntaxKind.PlusEqualsToken) &&\n node.parent?.left === node;\n // to do; check nested accesses\n // const newNode = node.parent;\n // we need this loop because we might have x[\"t\"][\"test\"][\"key\"]\n // so the parent of the node might be another ElementAccessExpression and not the binary expression/variable declaration directly\n // to do\n // while (newNode !== undefined && newNode.kind !== ts.SyntaxKind.BinaryExpression) {\n // if (newNode.right === node) {\n // rightSideOfAssignment = true;\n // break;\n // }\n // newNode = newNode.parent;\n // }\n\n const expressionAsString = this.printNode(expression, 0);\n const argumentAsString = this.printNode(argumentExpression, 0);\n\n // c# only\n if (!isLeftSideOfAssignment && this.ELEMENT_ACCESS_WRAPPER_OPEN && this.ELEMENT_ACCESS_WRAPPER_CLOSE) {\n return `${this.ELEMENT_ACCESS_WRAPPER_OPEN}${expressionAsString}, ${argumentAsString}${this.ELEMENT_ACCESS_WRAPPER_CLOSE}`;\n }\n // cast order[\"test\"] to ((Dictionariy)order)[\"test\"] or List\n if (isLeftSideOfAssignment && this.ELEMENT_ACCESS_WRAPPER_OPEN && this.ELEMENT_ACCESS_WRAPPER_CLOSE) {\n const type = this.getChecker().getTypeAtLocation(argumentExpression);\n const isString = this.isStringType(type.flags);\n\n let isUnionString = false; // handle unions later\n if (type.flags === TypeFlags.Union) {\n isUnionString = this.isStringType((type as any).getTypes()[0].flags);\n }\n\n if (isString || isUnionString || type.flags === TypeFlags.Any) { // default to string when unknown\n // to do refactor and move this to the derived classes\n if (this.id === \"C#\") {\n const cast = isStringLiteralLikeNode(argumentExpression) ? \"\" : '(string)';\n // a receiver the C# classifier declared as a concrete dictionary needs no\n // interface cast (see csharpDictionaryIndexWriteNeedsNoCast); the key keeps\n // its own spelling, so only the receiver's cast is dropped\n if (this.csharpDictionaryIndexWriteNeedsNoCast(node)) {\n return `${expressionAsString}[${cast}${argumentAsString}]`;\n }\n return `((IDictionary)${expressionAsString})[${cast}${argumentAsString}]`;\n } else if (this.id === \"Java\") {\n return `((java.util.HashMap)${expressionAsString}).get(${argumentAsString})`;\n }\n // if (this.id === \"Go\") {\n // return `AddElementToObject(${expressionAsString}, ${argumentAsString})`;\n // }\n\n }\n if (this.id === \"C#\") {\n return `((${this.ARRAY_KEYWORD})${expressionAsString})[Convert.ToInt32(${argumentAsString})]`;\n } else if (this.id === \"Java\") {\n return `((java.util.List)${expressionAsString}).get(Helpers.toInt(${argumentAsString}))`;\n }\n\n }\n\n return expressionAsString + \"[\" + argumentAsString + \"]\";\n }\n\n printCondition (node, identation) {\n\n if (this.supportsFalsyOrTruthyValues) {\n // languages like php or python do not need this extra logic\n return this.printNode(node, identation);\n }\n\n // can be called from ifs or conditional expressions or binary expressions so might contain the ! operator\n if (node.kind === SyntaxKind.PrefixUnaryExpression && node.operator === SyntaxKind.ExclamationToken) {\n return this.printPrefixUnaryExpression(node, identation); // avoid infinite recursion\n }\n\n // wrap falsy/truthy expressions unconditionally: printing the node once and\n // wrapping is equivalent to the previous always-true branches, which printed\n // the subtree twice and queried the type checker without using the result\n const expression = `${this.FALSY_WRAPPER_OPEN}${this.printNode(node, 0)}${this.FALSY_WRAPPER_CLOSE}`;\n return `${this.getIden(identation)}${expression}`; // stub to override\n }\n\n\n printIfStatement(node, identation) {\n\n const expression = this.printCondition(node.expression, 0);\n\n const elseExists = node.elseStatement !== undefined;\n const isElseIf = node.parent.kind === SyntaxKind.IfStatement;\n\n const needChainBlock = elseExists;\n const ifBody = this.printBlock(node.thenStatement, identation, needChainBlock);\n\n let ifComplete = this.CONDITION_OPENING + expression + this.CONDITION_CLOSE + ifBody;\n if (isElseIf) {\n ifComplete = this.ELSEIF_TOKEN + \" \" + ifComplete;\n } else {\n ifComplete = this.getIden(identation) + this.IF_TOKEN + \" \" + ifComplete;\n }\n\n const elseStatement = node.elseStatement;\n if (elseStatement?.kind === SyntaxKind.Block) {\n\n const elseBody = this.printBlock(elseStatement, identation);\n\n const elseBlock = this.ELSE_TOKEN + elseBody;\n\n ifComplete += elseBlock;\n\n } else if (elseStatement?.kind === SyntaxKind.IfStatement) {\n const elseBody = this.printIfStatement(elseStatement, identation);\n ifComplete += elseBody;\n }\n return this.printNodeCommentsIfAny(node, identation, ifComplete);\n }\n\n printParenthesizedExpression(node, identation) {\n if (node.expression.kind === SyntaxKind.AsExpression) {\n // transform (this as any) into this, () and as any are not necessary\n return this.getIden(identation) + this.printNode(node.expression, 0);\n }\n if (node.expression.kind === SyntaxKind.ArrowFunction) {\n // ignore arrowFunctions inside parenthesis\n return \"\";\n }\n return this.getIden(identation) + this.LEFT_PARENTHESIS + this.printNode(node.expression, 0) + this.RIGHT_PARENTHESIS;\n }\n\n printBooleanLiteral(node) {\n if (SyntaxKind.TrueKeyword === node.kind) {\n return this.TRUE_KEYWORD;\n }\n return this.FALSE_KEYWORD;\n }\n\n printTryStatement(node, identation) {\n const tryBody = this.printBlock(node.tryBlock, identation, true);\n\n const catchBody = this.printBlock(node.catchClause.block, identation);\n const catchDeclaration = this.CATCH_DECLARATION + \" \" + this.printNode(node.catchClause.variableDeclaration.name, 0);\n\n const catchCondOpen = this.CONDITION_OPENING ? this.CONDITION_OPENING : \" \";\n\n return this.getIden(identation) + this.TRY_TOKEN +\n tryBody +\n this.CATCH_TOKEN + catchCondOpen + catchDeclaration + this.CONDITION_CLOSE +\n catchBody;\n }\n\n printNewExpression(node, identation) {\n let expression = node.expression?.text;\n expression = expression ? expression : this.printNode(node.expression); // new Exception or new exact[string] check this out\n const args = node.arguments.map(n => this.printNode(n, identation)).join(\", \");\n const newToken = this.NEW_TOKEN ? this.NEW_TOKEN + \" \" : \"\";\n return newToken + expression + this.LEFT_PARENTHESIS + args + this.RIGHT_PARENTHESIS;\n }\n\n printThrowStatement(node, identation) {\n const expression = this.printNode(node.expression, 0);\n return this.getIden(identation) + this.THROW_TOKEN + \" \" + expression + this.LINE_TERMINATOR;\n }\n\n printAwaitExpression(node, identation) {\n const expression = this.printNode(node.expression, identation);\n const awaitToken = this.asyncTranspiling ? this.AWAIT_TOKEN + \" \" : \"\";\n return awaitToken + expression;\n }\n\n wrapSyntheticNode(synthetic, original) {\n // give the synthetic wrapper the original node's source range and splice it\n // into the parent chain, so position/type based helpers keep working\n synthetic.pos = original.pos;\n synthetic.end = original.end;\n synthetic.parent = original.parent;\n original.parent = synthetic;\n return synthetic;\n }\n\n wrapImplicitReturnAwait(node) {\n // inside a non-async function transpiled as async (isImplicitAsyncFunction),\n // returned Promises must be awaited to keep the generated code equivalent to\n // the classic `async`/`return await` form: wrap them in a synthetic await\n // expression so every language prints them through its usual await path\n let exp = node.expression;\n if (!exp || isAwaitExpression(exp)\n || !this.isImplicitAsyncFunction(findAncestor(node, isFunctionLike))\n || !this.isPromiseType(this.getChecker().getTypeAtLocation(exp))) {\n return node;\n }\n if (isConditionalExpression(exp) || isBinaryExpression(exp)) {\n // an await-token prefix would change precedence (e.g. `await a ? b : c`)\n exp = this.wrapSyntheticNode(createParenthesizedExpression(exp), exp);\n }\n // TS7 program nodes are read-only: print a synthetic return in place of the original\n const synthetic = this.wrapSyntheticNode(createReturnStatement(undefined), node);\n const awaited = this.wrapSyntheticNode(createAwaitExpression(exp), exp);\n awaited.parent = synthetic;\n Object.defineProperty(synthetic, \"expression\", { value: awaited });\n node.parent = synthetic.parent;\n return synthetic;\n }\n\n printConditionalExpression(node, identation) {\n const condition = this.printCondition(node.condition, identation);\n const whenTrue = this.printNode(node.whenTrue, 0);\n const whenFalse = this.printNode(node.whenFalse, 0);\n\n return condition + \" ? \" + whenTrue + \" : \" + whenFalse;\n }\n\n printAsExpression(node, identation) {\n return this.printNode(node.expression, identation);\n }\n\n getFunctionNodeFromReturn(node) {\n let parent = node.parent;\n while (parent) {\n if (parent.kind === SyntaxKind.FunctionDeclaration || parent.kind === SyntaxKind.MethodDeclaration) {\n return parent;\n }\n parent = parent.parent;\n }\n return undefined;\n }\n\n\n printReturnStatement(node, identation) {\n const leadingComment = this.printLeadingComments(node, identation);\n let trailingComment = this.printTraillingComment(node, identation);\n trailingComment = trailingComment ? \" \" + trailingComment : trailingComment;\n const exp = node.expression;\n let rightPart = exp ? (' ' + this.printNode(exp, identation)) : '';\n rightPart = rightPart.trim();\n\n // cast return type if needed\n // if (false && this.requiresCallExpressionCast) {\n // const functionNode = this.getFunctionNodeFromReturn(node);\n // let functionType = this.getFunctionType(functionNode, false);\n // if (functionType === undefined) {\n // // check the parent method type if any\n // const overrideMethod = this.getMethodOverride(functionNode);\n // if (overrideMethod !== undefined) {\n // functionType = this.getFunctionType(overrideMethod, false);\n // }\n // }\n // if (functionType && exp?.kind !== ts.SyntaxKind.UndefinedKeyword) {\n // rightPart = rightPart ? ' ' + `((${functionType}) (${rightPart}))` + this.LINE_TERMINATOR : this.LINE_TERMINATOR;\n // return leadingComment + this.getIden(identation) + this.RETURN_TOKEN + rightPart + trailingComment;\n // }\n // }\n rightPart = rightPart ? ' ' + rightPart + this.LINE_TERMINATOR : this.LINE_TERMINATOR;\n return leadingComment + this.getIden(identation) + this.RETURN_TOKEN + rightPart + trailingComment;\n }\n\n printArrayBindingPattern(node, identation) {\n const elements = node.elements.map((e) => this.printNode(e.name, identation)).join(\", \");\n return this.getIden(identation) + this.ARRAY_OPENING_TOKEN + elements + this.ARRAY_CLOSING_TOKEN;\n }\n\n printBlock(node, identation, chainBlock = false) {\n const blockOpen = this.getBlockOpen(identation);\n const blockClose = this.getBlockClose(identation, chainBlock);\n const statements = node.statements.map((s) => this.printNode(s, identation+1)).join(\"\\n\");\n\n return blockOpen + statements + blockClose;\n }\n\n printExpressionStatement(node, identation) {\n if (this.isCJSModuleExportsExpressionStatement(node)) {\n return \"\"; // remove module.exports = ...\n }\n\n const expressionStatementPrefixes = this.getExpressionStatementPrefixesIfAny(node, identation) ?? \"\";\n\n const exprStm = this.printNode(node.expression, identation);\n\n // skip empty statements\n if (exprStm.length === 0) {\n return \"\";\n }\n const expStatement = expressionStatementPrefixes + this.getIden(identation) + exprStm + this.LINE_TERMINATOR;\n return this.printNodeCommentsIfAny(node, identation, expStatement);\n }\n\n getExpressionStatementPrefixesIfAny(node, identation) {\n return undefined;\n }\n\n printPropertyDeclaration(node, identation) {\n const modifiers = this.printPropertyAccessModifiers(node);\n const name = this.printNode(node.name, 0);\n if (node.initializer) {\n const initializer = this.printNode(node.initializer, 0);\n return this.getIden(identation) + modifiers + name + \" = \" + initializer + this.LINE_TERMINATOR;\n }\n return this.getIden(identation) + modifiers + name + this.LINE_TERMINATOR;\n }\n\n printPropertyAccessModifiers (node) {\n let modifiers = this.printModifiers(node);\n modifiers = modifiers ? modifiers + \" \" : modifiers;\n return modifiers;\n }\n\n printSpreadElement(node, identation) {\n const expression = this.printNode(node.expression, 0);\n return this.getIden(identation) + this.SPREAD_TOKEN + expression;\n }\n\n printNullKeyword(node, identation){\n return this.getIden(identation) + this.NULL_TOKEN;\n }\n\n printContinueStatement(node, identation){\n return this.getIden(identation) + this.CONTINUE_TOKEN + this.LINE_TERMINATOR;\n }\n\n printDeleteExpression (node, identation) {\n return undefined;\n }\n\n printThisKeyword(node, identation) {\n return this.THIS_TOKEN;\n }\n\n printNode(node, identation = 0): string {\n\n try {\n // dispatch on node.kind directly: every ts.isX predicate used here is a\n // plain kind comparison, and a switch avoids running ~45 predicate calls\n // for nodes that match late (or not at all) in the former if-else chain\n switch (node.kind) {\n case SyntaxKind.ExpressionStatement:\n return this.printExpressionStatement(node, identation);\n case SyntaxKind.Block:\n return this.printBlock(node, identation);\n case SyntaxKind.FunctionDeclaration:\n case SyntaxKind.FunctionExpression:\n case SyntaxKind.ArrowFunction:\n return this.printFunctionDeclaration(node, identation);\n case SyntaxKind.ClassDeclaration:\n return this.printClass(node, identation);\n case SyntaxKind.VariableStatement:\n return this.printVariableStatement(node, identation);\n case SyntaxKind.MethodDeclaration:\n return this.printMethodDeclaration(node, identation);\n case SyntaxKind.StringLiteral:\n return this.printStringLiteral(node);\n case SyntaxKind.NumericLiteral:\n return this.printNumericLiteral(node);\n case SyntaxKind.PropertyAccessExpression:\n return this.printPropertyAccessExpression(node, identation);\n case SyntaxKind.ArrayLiteralExpression:\n return this.printArrayLiteralExpression(node, identation);\n case SyntaxKind.CallExpression:\n return this.printCallExpression(node, identation);\n case SyntaxKind.WhileStatement:\n return this.printWhileStatement(node, identation);\n case SyntaxKind.BinaryExpression:\n return this.printBinaryExpression(node, identation);\n case SyntaxKind.BreakStatement:\n return this.printBreakStatement(node, identation);\n case SyntaxKind.ForStatement:\n return this.printForStatement(node, identation);\n case SyntaxKind.PostfixUnaryExpression:\n return this.printPostFixUnaryExpression(node, identation);\n case SyntaxKind.VariableDeclarationList:\n return this.printVariableDeclarationList(node, identation); // statements are slightly different if inside a for\n case SyntaxKind.ObjectLiteralExpression:\n return this.printObjectLiteralExpression(node, identation);\n case SyntaxKind.PropertyAssignment:\n return this.printPropertyAssignment(node, identation);\n case SyntaxKind.Identifier:\n return this.printIdentifier(node);\n case SyntaxKind.ElementAccessExpression:\n return this.printElementAccessExpression(node, identation);\n case SyntaxKind.IfStatement:\n return this.printIfStatement(node, identation);\n case SyntaxKind.ParenthesizedExpression:\n return this.printParenthesizedExpression(node, identation);\n case SyntaxKind.TrueKeyword:\n case SyntaxKind.FalseKeyword:\n return this.printBooleanLiteral(node);\n case SyntaxKind.ThisKeyword:\n return this.printThisKeyword(node, identation);\n case SyntaxKind.SuperKeyword:\n return this.SUPER_TOKEN;\n case SyntaxKind.TryStatement:\n return this.printTryStatement(node, identation);\n case SyntaxKind.PrefixUnaryExpression:\n return this.printPrefixUnaryExpression(node, identation);\n case SyntaxKind.ThrowStatement:\n return this.printThrowStatement(node, identation);\n case SyntaxKind.NewExpression:\n return this.printNewExpression(node, identation);\n case SyntaxKind.AwaitExpression:\n return this.printAwaitExpression(node, identation);\n case SyntaxKind.ConditionalExpression:\n return this.printConditionalExpression(node, identation);\n case SyntaxKind.AsExpression:\n return this.printAsExpression(node, identation);\n case SyntaxKind.ReturnStatement:\n return this.printReturnStatement(this.wrapImplicitReturnAwait(node), identation);\n case SyntaxKind.ArrayBindingPattern:\n return this.printArrayBindingPattern(node, identation);\n case SyntaxKind.Parameter:\n return this.printParameter(node);\n case SyntaxKind.Constructor:\n return this.printConstructorDeclaration(node, identation);\n case SyntaxKind.PropertyDeclaration:\n return this.printPropertyDeclaration(node, identation);\n case SyntaxKind.SpreadElement:\n return this.printSpreadElement(node, identation);\n case SyntaxKind.NullKeyword:\n return this.printNullKeyword(node, identation);\n case SyntaxKind.ContinueStatement:\n return this.printContinueStatement(node, identation);\n case SyntaxKind.DeleteExpression:\n return this.printDeleteExpression(node, identation);\n }\n\n if (node.statements) {\n if (isSourceFile(node)) {\n // reset the current class name when entering a new file so a\n // class name from a previously transpiled file does not leak\n // into a class-less file (e.g. try/catch wrappers in tests)\n this.className = \"undefined\";\n }\n const transformedStatements = node.statements.map((m)=> {\n return this.printNode(m, identation + 1);\n });\n\n return transformedStatements.filter(st => st.length > 0 ).join(\"\\n\" + \"\\n\".repeat(this.LINES_BETWEEN_FILE_MEMBERS)) + \"\\n\".repeat(this.NUM_LINES_END_FILE);\n }\n return \"\";\n\n } catch (e) {\n if (!(e instanceof TranspilationError)) {\n console.error('[ast-transpiler] underlying error:', e && (e.stack || e.message || e));\n }\n throw new TranspilationError(this.id, (e && (e.messageText ?? e.message)) ?? String(e), node.getFullText(), node.pos, node.end);\n }\n }\n\n getFileESMImports(node): IFileImport[] {\n const result = [];\n const importStatements = node.statements.filter((s) => isImportDeclaration(s));\n importStatements.forEach(node => {\n const importPath = node.moduleSpecifier.text;\n const importClause = node.importClause;\n const namedImports = importClause.namedBindings;\n if (namedImports) {\n if (namedImports.elements) {\n // named imports\n namedImports.elements.forEach((elem) => {\n const name = elem.name.text;\n const fileImport: IFileImport = {\n name,\n path: importPath,\n isDefault: false\n };\n result.push(fileImport);\n });\n } else {\n // namespace import (import * as name from 'path')\n const name = namedImports.name.text;\n const fileImport: IFileImport = {\n name,\n path: importPath,\n isDefault: false\n };\n result.push(fileImport);\n }\n\n } else {\n // default import\n const name = importClause.name.text;\n const fileImport: IFileImport = {\n name,\n path: importPath,\n isDefault: true\n };\n result.push(fileImport);\n }\n });\n return result;\n }\n\n isCJSRequireStatement(node): boolean {\n const dec = node.declarationList.declarations[0];\n return dec.initializer && isCallExpression(dec.initializer) && dec.initializer.expression.getText() === \"require\";\n }\n\n isCJSModuleExportsExpressionStatement(node): boolean {\n if (node.expression && node.expression.kind === SyntaxKind.BinaryExpression ) {\n if (node.expression.left.kind === SyntaxKind.PropertyAccessExpression) {\n const left = node.expression.left as PropertyAccessExpression;\n return left.expression.getText() === \"module\" && left.name.getText() === \"exports\";\n }\n }\n return false;\n }\n\n getCJSImports(node): IFileImport[] {\n const result = [];\n const varStatements = node.statements.filter(s => isVariableStatement(s));\n const decList = varStatements.map(s => s.declarationList);\n const dec = decList.map(d => d.declarations[0]);\n\n dec.forEach(decNode => {\n if (decNode.initializer && decNode.initializer.kind === SyntaxKind.CallExpression) {\n const callExpression = decNode.initializer.expression.getText();\n if (callExpression === \"require\") {\n const isDefault = decNode.name.kind === SyntaxKind.Identifier;\n const importPath = decNode.initializer.arguments[0].text;\n if (isDefault) {\n const name = decNode.name.text;\n const fileImport: IFileImport = {\n name,\n path: importPath,\n isDefault: isDefault\n };\n result.push(fileImport);\n } else {\n const elems = decNode.name.elements;\n elems.forEach(elem => {\n const name = elem.name.text;\n const fileImport: IFileImport = {\n name,\n path: importPath,\n isDefault: false,\n };\n result.push(fileImport);\n });\n }\n }\n }\n });\n\n return result;\n }\n\n getFileImports(node): IFileImport[] {\n const esmImports = this.getFileESMImports(node);\n if (esmImports.length > 0) {\n return esmImports;\n }\n const cjsImports = this.getCJSImports(node);\n return cjsImports;\n }\n\n getESMExports(node): IFileExport[] {\n const result = [];\n const namedExports = node.statements.filter((s) => isExportDeclaration(s));\n const defaultExport = node.statements.filter((s) => isExportAssignment(s));\n\n namedExports.forEach(node => {\n const namedExports = node.exportClause;\n if (namedExports) {\n namedExports.elements.forEach((elem) => {\n const name = elem.name.text;\n const fileExport: IFileExport = {\n name,\n isDefault: false\n };\n result.push(fileExport);\n });\n }\n });\n\n defaultExport.forEach(node => {\n const name = node.expression.getText();\n const fileExport: IFileExport = {\n name,\n isDefault: true\n };\n result.push(fileExport);\n });\n return result;\n }\n\n getCJSExports(node): IFileExport[] {\n const result = [];\n const moduleExports = node.statements.filter(s => this.isCJSModuleExportsExpressionStatement(s)).map(s => s.expression as BinaryExpression);\n\n moduleExports.forEach(node => {\n const right = node.right;\n if (right.kind === SyntaxKind.ObjectLiteralExpression) {\n const props = right.properties;\n props.forEach(prop => {\n const name = prop.name.getText();\n const fileExport: IFileExport = {\n name,\n isDefault: false\n };\n result.push(fileExport);\n });\n }\n if (right.kind === SyntaxKind.Identifier) {\n const name = right.getText();\n const fileExport: IFileExport = {\n name,\n isDefault: true\n };\n result.push(fileExport);\n }\n });\n return result;\n }\n\n getExportDeclarations(node): IFileExport[] {\n // example export default class X\n const result = [];\n const classDeclarations = node.statements.filter((s) => isClassDeclaration(s));\n const functionDeclarations = node.statements.filter((s) => isFunctionDeclaration(s));\n\n const both = classDeclarations.concat(functionDeclarations);\n both.forEach(classNode => {\n const modifiers = classNode.modifiers;\n if (modifiers) {\n const isDefault = modifiers.some((m) => m.kind === SyntaxKind.DefaultKeyword);\n if (isDefault) {\n const name = classNode.name.text;\n const fileExport: IFileExport = {\n name,\n isDefault: true\n };\n result.push(fileExport);\n }\n }\n });\n return result;\n }\n\n getFileExports(node): IFileExport[] {\n const defaultClassAndFunctionsExports = this.getExportDeclarations(node);\n const esmExports = this.getESMExports(node).concat(defaultClassAndFunctionsExports);\n if (esmExports.length > 0) {\n return esmExports;\n }\n return this.getCJSExports(node);\n }\n\n getReturnTypeFromMethod(node): string {\n // first try custom type\n\n const bType = this.getChecker().getTypeAtLocation(node);\n // const func2Symbol = bType.getProperty(\"test1\")!;\n const bSymbol = bType.getSymbol();\n const func2Type = this.getChecker().getTypeOfSymbolAtLocation(bSymbol, bSymbol.valueDeclaration.resolve());\n const func2Signature = this.getChecker().getSignaturesOfType(func2Type, SignatureKind.Call)[0];\n const rawType = func2Signature.getReturnType();\n // const parsed = ts.TypeFlags[rawType.flags];\n // console.log(parsed);\n const res = this.getChecker().typeToString(rawType); // C\n if (res === undefined) {\n const name = node.type?.typeName?.text;\n if (name){\n return name as string;\n }\n }\n return res;\n }\n\n getParameterType(node): IParameterType {\n const isOptional = node.questionToken !== undefined;\n\n const result: IParameterType = {\n name: node.name.getText(),\n isOptional: isOptional,\n type: undefined\n };\n\n if (node.initializer !== undefined) {\n result.initializer = node.initializer.getText();\n }\n\n // first try custom type\n if (node.type === undefined) {\n // does not have a type or uses a initializer\n if (node.initializer !== undefined) {\n const type = this.getChecker().getTypeAtLocation(node.initializer);\n const res = this.getChecker().typeToString(type); // C\n // console.log(\"initializer\", res);\n // result.initializer = node.initializer.text;\n result.type = TypeFlags[type.flags];\n return result;\n }\n }\n\n const name = node.type?.typeName?.text;\n if (name){\n result.type = name as string;\n if (node.initializer !== undefined) {\n result.initializer = node.initializer.text;\n }\n return result;\n }\n\n if (node.type != undefined) {\n const type = this.getChecker().getTypeAtLocation(node.type);\n const res = this.getChecker().typeToString(type); // C\n result.type = res as string;\n return result;\n }\n return result;\n }\n\n getMethodTypes(file): IMethodType[] {\n const result: IMethodType[] = [];\n if (!file.statements) {\n return result;\n }\n const classDeclarations = file.statements.filter((s) => isClassDeclaration(s));\n classDeclarations.forEach((node) => {\n const methods = node.members.filter((m) => isMethodDeclaration(m));\n methods.forEach(m => {\n const isAsync = this.isAsyncFunction(m);\n const name = m.name.getText();\n const returnType = this.getReturnTypeFromMethod(m);\n const parameters = (m as any).parameters;\n // const paramTypes:IParameterType[] = parameters.map((p) => this.getParameterType(p));\n const paramTypes:IParameterType[] = [];\n parameters.forEach((p) => {\n const res = this.getParameterType(p);\n paramTypes.push(res);\n });\n result.push({\n name,\n async:isAsync,\n returnType,\n parameters: paramTypes\n });\n });\n });\n\n return result;\n }\n}\n\nexport {\n BaseTranspiler\n};\n","import { type SourceFile } from \"typescript/unstable/ast\";\nimport { type API, type Checker, type Program, type Snapshot } from \"typescript/unstable/sync\";\n\ninterface IInput {\n language: Languages;\n async: boolean;\n}\n\n// per-transpile typescript state. Holding it in an explicit object (owned by the\n// Transpiler instance and handed to the language printers) instead of process\n// globals keeps concurrent/nested transpilations from clobbering each other.\ninterface ITranspileContext {\n src: SourceFile;\n checker: Checker;\n program: Program;\n}\n\n// The TS7 API server the programs are created on. Shareable between Transpiler\n// instances on the same thread; a worker_threads isolate needs its own.\ninterface ITranspileProgramCache {\n api?: API;\n // the run-wide program set by Transpiler.setSharedProgram\n shared?: { snapshot: Snapshot, program: Program, checker: Checker };\n}\n\n\ninterface IParameterType {\n name: string;\n type: string;\n isOptional: boolean;\n initializer?: string;\n}\n\ninterface IMethodType {\n async: boolean;\n name: string;\n returnType: string;\n parameters: IParameterType[];\n}\n\ninterface IFileImport {\n name: string;\n path: string;\n isDefault: boolean;\n}\n\ninterface IFileExport {\n name: string;\n isDefault: boolean;\n}\n\ninterface ITranspiledFile {\n content: string;\n imports: IFileImport[];\n exports: IFileExport[];\n methodsTypes?: IMethodType[];\n}\n\nenum Languages {\n Python,\n Php,\n CSharp,\n Go,\n Java,\n Rust,\n Cpp\n}\n\nenum TranspilationMode {\n ByPath,\n ByContent\n}\n\n// const TranspilingError = (message) => ({\n// error: new Error(message),\n// code: 'TRANSPILING ERROR'\n// });\n\nclass TranspilationError extends Error {\n constructor (id, message, nodeText, start, end) {\n const parsedMessage = `Lang: ${id} Error: ${message} at ${start}:${end} node: \"${nodeText}\"`;\n super (parsedMessage);\n this.name = 'TranspilationError';\n\n }\n}\n\n// class FunctionReturnTypeError extends TranspilationError {\n// constructor (message) {\n// super (message);\n// this.name = 'FuctionReturnTypeError';\n// }\n// }\n\n// class FunctionArgumentTypeError extends TranspilationError {\n// constructor (message) {\n// super (message);\n// this.name = 'FunctionArgumentTypeError';\n// }\n// }\n\nexport {\n Languages,\n TranspilationMode,\n IFileImport,\n ITranspiledFile,\n IFileExport,\n ITranspileContext,\n ITranspileProgramCache,\n TranspilationError,\n // FunctionReturnTypeError,\n // FunctionArgumentTypeError,\n IInput,\n IMethodType,\n IParameterType\n};","\n\nfunction regexAll (text: string, array: any[]): string {\n for (const i in array) {\n let regex = array[i][0];\n const flags = (typeof regex === 'string') ? 'g' : undefined;\n regex = new RegExp (regex, flags);\n text = text.replace (regex, array[i][1]);\n }\n return text;\n}\n\nfunction unCamelCase (s: string): string | undefined {\n return s.match (/[A-Z]/) ? s.replace (/[a-z0-9][A-Z]/g, x => x[0] + '_' + x[1]).replace(/[A-Z0-9][A-Z0-9][a-z][^$]/g, x => x[0] + '_' + x[1] + x[2] + x[3]).replace(/[a-z][0-9]$/g, x=> x[0] + '_' + x[1]).toLowerCase () : undefined;\n}\n\n// function extend (...args) {\n// Object.assign ({}, ...args);\n// }\n\nexport {\n regexAll,\n unCamelCase,\n};\n","import { green, yellow, red } from \"colorette\";\n\nclass Logger {\n static verbose = true;\n\n // static createInstanceIfNeeded(): void {\n // if (!this._instance) {\n // this._instance = new Logger();\n // }\n // }\n\n static setVerboseMode(verbose: boolean) {\n this.verbose = verbose;\n }\n\n static log(message: string) {\n if (this.verbose) {\n console.log(message);\n }\n }\n\n static success(message: string) {\n this.log(green(`[SUCCESS]: ${message}`));\n }\n\n static warning(message: string) {\n this.log(yellow(`[WARNING]: ${message}`));\n }\n\n static error(message: string) {\n this.log(red(`[ERROR]: ${message}`));\n }\n}\n\nexport {\n Logger\n};\n\n","import { BaseTranspiler } from \"./baseTranspiler.js\";\nimport { SyntaxKind } from \"typescript/unstable/ast\";\nimport { isArrowFunction, isCallExpression, isFunctionDeclaration, isFunctionExpression } from \"typescript/unstable/ast/is\";\nimport { TypeFlags, type Checker } from \"typescript/unstable/sync\";\nimport { unCamelCase, regexAll } from \"./utils.js\";\nimport { Logger } from \"./logger.js\";\n\nconst parserConfig = {\n 'ELSEIF_TOKEN': 'elseif',\n 'THIS_TOKEN': '$this',\n 'PROPERTY_ACCESS_TOKEN': '->',\n 'UNDEFINED_TOKEN': 'null',\n 'NOT_TOKEN': '!',\n 'LINE_TERMINATOR': ';',\n 'ARRAY_OPENING_TOKEN':\"[\",\n 'ARRAY_CLOSING_TOKEN':\"]\",\n 'OBJECT_OPENING':\"array(\",\n 'OBJECT_CLOSING':\")\",\n 'FUNCTION_TOKEN': 'function',\n 'ASYNC_TOKEN': '',\n 'PROPERTY_ASSIGNMENT_TOKEN': ' =>',\n 'NEW_TOKEN': 'new',\n 'THROW_TOKEN': 'throw',\n 'SUPER_TOKEN': 'parent',\n 'CONSTRUCTOR_TOKEN': 'function __construct',\n 'SUPER_CALL_TOKEN': 'parent::__construct',\n 'CATCH_DECLARATION': 'Exception',\n 'CATCH_TOKEN': 'catch',\n 'BLOCK_OPENING_TOKEN' :'{',\n 'BLOCK_CLOSING_TOKEN' :'}',\n 'CONDITION_OPENING' :'(',\n 'CONDITION_CLOSE' :')',\n 'PLUS_PLUS_TOKEN': '++',\n 'MINUS_MINUS_TOKEN': '--',\n 'SPACE_DEFAULT_PARAM': ' ',\n 'EXCLAMATION_EQUALS_EQUALS_TOKEN': '!==',\n 'EQUALS_EQUALS_EQUALS_TOKEN': '===',\n 'STRING_QUOTE_TOKEN': '\\'',\n 'EXTENDS_TOKEN': 'extends',\n};\n\nexport class PhpTranspiler extends BaseTranspiler {\n awaitWrapper;\n propRequiresScopeResolutionOperator: string[];\n AWAIT_WRAPPER_OPEN;\n AWAIT_WRAPPER_CLOSE;\n ASYNC_FUNCTION_WRAPPER_OPEN = \"\";\n constructor(config = {}) {\n\n config['parser'] = Object.assign ({}, parserConfig, config['parser'] ?? {});\n\n super(config);\n this.id = \"php\";\n this.asyncTranspiling = config['async'] ?? true;\n this.uncamelcaseIdentifiers = config['uncamelcaseIdentifiers'] ?? false;\n this.removeVariableDeclarationForFunctionExpression = config['removeFunctionAssignToVariable'] ?? false;\n this.includeFunctionNameInFunctionExpressionDeclaration = config['includeFunctionNameInFunctionExpressionDeclaration'] ?? false;\n\n this.propRequiresScopeResolutionOperator = ['super'] + (config['ScopeResolutionProps'] ?? []);\n\n this.initConfig();\n\n // user overrides\n this.applyUserOverrides(config);\n\n // const propertyAccessRemoval = config['PropertyAccessRequiresParenthesisRemoval'] ?? [];\n // this.PropertyAccessRequiresParenthesisRemoval.push(...propertyAccessRemoval);\n\n this.AWAIT_WRAPPER_OPEN = config['AWAIT_WRAPPER_OPEN'] ?? \"\\\\React\\\\Async\\\\await(\";\n this.AWAIT_WRAPPER_CLOSE = config['AWAIT_WRAPPER_CLOSE'] ?? \")\";\n }\n\n printAwaitExpression(node, identation) {\n const expression = this.printNode(node.expression, identation);\n\n if (!this.asyncTranspiling) {\n return expression;\n }\n\n return this.AWAIT_WRAPPER_OPEN + expression + this.AWAIT_WRAPPER_CLOSE;\n }\n\n transformIdentifier(node, identifier) {\n if (this.uncamelcaseIdentifiers) {\n identifier = this.unCamelCaseIfNeeded(identifier);\n }\n\n // Get the symbol for the identifier\n const symbol = this.getChecker().getSymbolAtLocation(node);\n\n // Check if the symbol references a function declaration or expression\n const valueDecl = symbol?.valueDeclaration?.resolve();\n if (valueDecl) {\n\n // Check if it's a function (FunctionDeclaration, FunctionExpression, ArrowFunction)\n if (isFunctionDeclaration(valueDecl) || isFunctionExpression(valueDecl) || isArrowFunction(valueDecl)) {\n // Check if the identifier is passed as an argument in a function call\n if (node.parent && isCallExpression(node.parent) && node.parent.arguments.includes(node)) {\n return `'${identifier}'`; // Transpile function reference as string\n }\n }\n }\n\n // below is commented, due to : https://github.com/ccxt/ast-transpiler/pull/15\n //\n // If the identifier is a function parameter (callback), it should remain a variable with `$` prefix\n // if (node.parent && (ts.isParameter(node.parent) || (ts.isCallExpression(node.parent) && ts.isIdentifier(node)))) {\n // return \"$\" + identifier;\n // }\n\n // Default case: prepend $ for variables (non-functions), unless it's a class or constant\n if (!this.startsWithUpperCase(identifier)) {\n return \"$\" + identifier; // Prepend $ for variable names\n }\n\n return identifier;\n }\n\n\n getCustomOperatorIfAny(left, right, operator) {\n const STRING_CONCAT = '.';\n const PLUS_EQUALS_TOKEN = '.=';\n if (operator.kind == SyntaxKind.PlusToken || operator.kind == SyntaxKind.PlusEqualsToken) {\n\n const TOKEN = operator.kind == SyntaxKind.PlusToken ? STRING_CONCAT : PLUS_EQUALS_TOKEN;\n\n if (left.kind == SyntaxKind.StringLiteral || right.kind == SyntaxKind.StringLiteral) {\n return TOKEN;\n }\n\n const leftType = this.getChecker().getTypeAtLocation(left);\n const rightType = this.getChecker().getTypeAtLocation(right);\n\n if (leftType.flags === TypeFlags.String || rightType.flags === TypeFlags.String) {\n return TOKEN;\n }\n if (leftType.flags === TypeFlags.StringLiteral || rightType.flags === TypeFlags.StringLiteral) {\n return TOKEN;\n }\n }\n return undefined;\n }\n\n printLengthProperty(node, identation, name = undefined) {\n const leftSide = this.printNode(node.expression, 0);\n const type = (this.getChecker() as Checker).getTypeAtLocation(node.expression); // eslint-disable-line\n this.warnIfAnyType(node, type.flags, leftSide, \"length\");\n return this.isStringType(type.flags) ? `strlen(${leftSide})` : `count(${leftSide})`;\n }\n\n printPopCall(node, identation, name = undefined) {\n return `array_pop(${name})`;\n }\n\n printReverseCall(node, identation, name = undefined) {\n return `${name} = array_reverse(${name})`;\n }\n\n printShiftCall(node, identation, name = undefined) {\n return `array_shift(${name})`;\n }\n\n printToLowerCaseCall(node, identation, name = undefined) {\n return `strtolower(${name})`;\n }\n\n printToUpperCaseCall(node, identation, name = undefined) {\n return `strtoupper(${name})`;\n }\n\n printToStringCall(node, identation, name = undefined) {\n return `((string) ${name})`;\n }\n\n printArrayIsArrayCall(node, identation, parsedArg = undefined) {\n return `gettype(${parsedArg}) === 'array' && array_is_list(${parsedArg})`;\n }\n\n printObjectKeysCall(node, identation, parsedArg = undefined) {\n return `is_array(${parsedArg}) ? array_keys(${parsedArg}) : array()`;\n }\n\n printObjectValuesCall(node, identation, parsedArg = undefined) {\n return `is_array(${parsedArg}) ? array_values(${parsedArg}) : array()`;\n }\n\n printJsonParseCall(node, identation, parsedArg?) {\n return `json_decode(${parsedArg}, $as_associative_array = true)`;\n }\n\n printJsonStringifyCall(node: any, identation: any, parsedArg?: any) {\n return `json_encode(${parsedArg})`;\n }\n\n printArrayPushCall(node, identation, name = undefined, parsedArg = undefined) {\n return `${name}[] = ${parsedArg}`;\n }\n\n printPromiseAllCall(node, identation, parsedArg = undefined) {\n return `\\\\React\\\\Promise\\\\all(${parsedArg})`;\n }\n\n printMathCeilCall(node, identation, parsedArg = undefined) {\n return `((int) ceil(${parsedArg}))`;\n }\n\n printNumberIsIntegerCall(node, identation, parsedArg?) {\n return `is_int(${parsedArg})`;\n }\n\n printMathRoundCall(node, identation, parsedArg = undefined) {\n return `((int) round(${parsedArg}))`;\n }\n\n printMathFloorCall(node: any, identation: any, parsedArg?: any) {\n return `((int) floor(${parsedArg}))`;\n }\n\n printReplaceCall(node, identation, name = undefined, parsedArg = undefined, parsedArg2 = undefined) {\n return `str_replace(${parsedArg}, ${parsedArg2}, ${name})`;\n }\n\n printReplaceAllCall(node, identation, name = undefined, parsedArg = undefined, parsedArg2 = undefined) {\n return `str_replace(${parsedArg}, ${parsedArg2}, ${name})`;\n }\n\n printIncludesCall(node, identation, name = undefined, parsedArg = undefined) {\n // \"ol\".includes(\"o\") -> str_contains(\"ol\", \"o\") or [12,3,4].includes(3) -> in_array(3, [12,3,4])\n const leftSide = node.expression?.expression;\n const leftSideText = this.printNode(leftSide, 0);\n const type = this.getChecker().getTypeAtLocation(leftSide); // eslint-disable-line\n this.warnIfAnyType(node, type.flags, leftSideText, \"includes\");\n this.warnIfAnyType(node, type.flags, leftSideText, \"includes\");\n if (this.isStringType(type.flags)) {\n return `str_contains(${name}, ${parsedArg})`;\n } else {\n return `in_array(${parsedArg}, ${name})`;\n }\n }\n\n printIndexOfCall(node, identation, name = undefined, parsedArg = undefined) {\n const leftSide = node.expression?.expression;\n const leftSideText = this.printNode(leftSide, 0);\n const type = this.getChecker().getTypeAtLocation(leftSide); // eslint-disable-line\n this.warnIfAnyType(node, type.flags, leftSideText, \"indexOf\");\n if (this.isStringType(type.flags)) {\n return `mb_strpos(${name}, ${parsedArg})`;\n } else {\n return `array_search(${parsedArg}, ${name})`;\n }\n }\n\n printSearchCall(node, identation, name = undefined, parsedArg = undefined) {\n return `mb_strpos(${name}, ${parsedArg})`;\n }\n\n printStartsWithCall(node, identation, name = undefined, parsedArg = undefined) {\n return `str_starts_with(${name}, ${parsedArg})`;\n }\n\n printEndsWithCall(node, identation, name = undefined, parsedArg = undefined) {\n return `str_ends_with(${name}, ${parsedArg})`;\n }\n\n printTrimCall(node, identation, name = undefined) {\n return `trim(${name})`;\n }\n\n printJoinCall(node, identation, name = undefined, parsedArg = undefined) {\n return `implode(${parsedArg}, ${name})`;\n }\n\n printSplitCall(node, identation, name = undefined, parsedArg = undefined) {\n return `explode(${parsedArg}, ${name})`;\n }\n\n printConcatCall(node: any, identation: any, name?: any, parsedArg?: any) {\n return `array_merge(${name}, ${parsedArg})`;\n }\n\n printPadEndCall(node, identation, name, parsedArg, parsedArg2) {\n return `str_pad(${name}, ${parsedArg}, ${parsedArg2}, STR_PAD_RIGHT)`;\n }\n\n printPadStartCall(node, identation, name, parsedArg, parsedArg2) {\n return `str_pad(${name}, ${parsedArg}, ${parsedArg2}, STR_PAD_LEFT)`;\n }\n\n printDateNowCall(node, identation) {\n return \"round(microtime(true) * 1000)\";\n }\n\n printInstanceOfExpression(node, identation) {\n // const left = this.printNode(node.left, 0);\n // const right = this.printNode(node.right, 0);\n const left = node.left.text;\n const right = node.right.text;\n return this.getIden(identation) + \"$\"+left+\" instanceof \"+right+\"\";\n }\n\n printDeleteExpression(node, identation) {\n const expression = this.printNode (node.expression, 0);\n return `unset(${expression})`;\n }\n\n printNewExpression(node, identation) {\n let expression = node.expression?.text;\n expression = expression ? expression : this.printNode(node.expression);\n // JS's built-in `Error` maps to PHP's `Exception` (PHP's `Error` is reserved for internal engine errors)\n if (expression === 'Error') {\n expression = 'Exception';\n }\n const args = node.arguments.map(n => this.printNode(n, identation)).join(\", \");\n const newToken = this.NEW_TOKEN ? this.NEW_TOKEN + \" \" : \"\";\n return newToken + expression + this.LEFT_PARENTHESIS + args + this.RIGHT_PARENTHESIS;\n }\n\n getExceptionalAccessTokenIfAny(node) {\n const leftSide = node.expression.text ?? node.expression.getFullText().trim();\n\n if (!leftSide) {\n return undefined;\n }\n\n if (this.propRequiresScopeResolutionOperator.includes(leftSide)) {\n return \"::\";\n }\n return undefined;\n }\n\n handleTypeOfInsideBinaryExpression(node, identation) {\n const left = node.left;\n const right = node.right.text;\n const op = node.operatorToken.kind;\n const expression = left.expression;\n\n const isDifferentOperator = op === SyntaxKind.ExclamationEqualsEqualsToken || op === SyntaxKind.ExclamationEqualsToken;\n const notOperator = isDifferentOperator ? this.NOT_TOKEN : \"\";\n\n const opComp = isDifferentOperator ? this.EXCLAMATION_EQUALS_EQUALS_TOKEN : this.EQUALS_EQUALS_EQUALS_TOKEN;\n\n switch (right) {\n case \"string\":\n return this.getIden(identation) + notOperator + \"is_string(\" + this.printNode(expression, 0) + \")\";\n case \"number\":\n return this.getIden(identation) + notOperator + \"(is_int(\" + this.printNode(expression, 0) + \") || is_float(\" + this.printNode(expression, 0) + \"))\";\n case \"boolean\":\n return this.getIden(identation) + notOperator + \"is_bool(\" + this.printNode(expression, 0) + \")\";\n case \"object\":\n return this.getIden(identation) + notOperator + \"is_array(\" + this.printNode(expression, 0) + \")\";\n case \"undefined\":\n return this.getIden(identation) + this.printNode(expression, 0) + \" \" + opComp + \" null\";\n }\n\n return undefined;\n\n }\n\n printCustomBinaryExpressionIfAny(node, identation) {\n const left = node.left;\n const right = node.right.text;\n\n const op = node.operatorToken.kind;\n\n if (left.kind === SyntaxKind.TypeOfExpression) {\n // handle typeof operator\n // Example: typeof a === \"string\"\n const typeOfExpression = this.handleTypeOfInsideBinaryExpression(node, identation);\n if (typeOfExpression) {\n return typeOfExpression;\n }\n }\n\n if (op === SyntaxKind.InKeyword) {\n const rightSide = this.printNode(node.right, 0);\n const leftSide = this.printNode(node.left, 0);\n return `${this.getIden(identation)}is_array(${rightSide}) && array_key_exists(${leftSide}, ${rightSide})`;\n }\n\n const prop = node?.left?.expression?.name?.text;\n\n if (prop) {\n const args = left.arguments;\n const parsedArg = (args && args.length > 0) ? this.printNode(args[0], 0): undefined;\n const leftSideOfIndexOf = left.expression.expression; // myString in myString.indexOf\n const leftSide = this.printNode(leftSideOfIndexOf, 0);\n const rightType = this.getChecker().getTypeAtLocation(leftSideOfIndexOf); // type of myString in myString.indexOf (\"b\") >= 0;\n switch(prop) {\n case 'indexOf':\n if (op === SyntaxKind.GreaterThanEqualsToken && right === '0') {\n this.warnIfAnyType(node, rightType.flags,leftSide, \"indexOf\");\n if (this.isStringType(rightType.flags)) {\n return this.getIden(identation) + \"mb_strpos(\" + leftSide + \", \" + parsedArg + \") !== false\";\n } else {\n return this.getIden(identation) + \"in_array(\" + parsedArg + \", \" + leftSide + \")\";\n }\n }\n }\n }\n return undefined;\n }\n\n printFunctionDeclaration(node, identation) {\n let functionDef = this.printFunctionDefinition(node, identation);\n const funcBody = this.printFunctionBody(node, identation);\n functionDef += funcBody;\n\n return this.printNodeCommentsIfAny(node, identation, functionDef);\n }\n\n printFunctionBody(node, identation) {\n\n if (this.asyncTranspiling && this.isAsyncFunction(node)) {\n const blockOpen = this.getBlockOpen(identation);\n const blockClose = this.getBlockClose(identation);\n\n const parsedArgs = node.parameters.map(param => this.printParameter(param, false)).join(\", \");\n const params = parsedArgs ? \" use (\" + parsedArgs + \")\" : \"\";\n\n const bodyStms = [...node.body.statements];\n const firstBodyStm = this.printNode(bodyStms[0], identation+2);\n bodyStms.shift();\n const funcBody = bodyStms.map((s) => this.printNode(s, identation+2)).join(\"\\n\");\n\n // reformat first comment\n const bodyParts = firstBodyStm.split(\"\\n\");\n const commentPart = bodyParts.filter(line => this.isComment(line));\n const isComment = commentPart.length > 0;\n let header = this.getIden(identation+1) + \"return Async\\\\async(function ()\" + params + \" {\\n\";\n if (isComment) {\n const commentPartString = commentPart.map((c) => this.getIden(identation+1) + c.trim()).join(\"\\n\");\n const firstStmNoComment = bodyParts.filter(line => !this.isComment(line)).join(\"\\n\");\n header = commentPartString + \"\\n\" + header + firstStmNoComment + \"\\n\";\n } else {\n header += firstBodyStm + \"\\n\";\n }\n\n const result = header\n + funcBody + \"\\n\"\n + this.getIden(identation+1) + \"}) ();\";\n\n return blockOpen + result + blockClose;\n }\n return super.printFunctionBody(node, identation);\n }\n\n printPropertyAccessModifiers(node) {\n const modifiers = super.printPropertyAccessModifiers(node);\n return modifiers ? modifiers : \"public \"; // default to public\n }\n\n transformLeadingComment(comment) {\n const commentRegex = [\n [ /\\{([\\]\\[\\|a-zA-Z0-9_-]+?)\\}/g, '~$1~' ], // eslint-disable-line -- resolve the \"arrays vs url params\" conflict (both are in {}-brackets)\n [ /\\[([^\\]\\[]*)\\]\\{(@link .*)\\}/g, '~$2 $1~' ], // eslint-disable-line -- docstring item with link\n [ /\\s+\\* @method/g, '' ], // docstring @method\n [ /(\\s+)\\* @description (.*)/g, '$1\\* $2' ], // eslint-disable-line\n [ /\\s+\\* @name .*/g, '' ], // docstring @name\n [ /(\\s+)\\* @returns/g, '$1\\* @return' ], // eslint-disable-line\n [ /\\~([\\]\\[\\|@\\.\\s+\\:\\/#\\-a-zA-Z0-9_-]+?)\\~/g, '{$1}' ], // eslint-disable-line -- resolve the \"arrays vs url params\" conflict (both are in {}-brackets)\n [ /(\\s+ \\* @(param|return) {[^}]*)object([^}]*}.*)/g, '$1array$3' ], // docstring type conversion\n ];\n\n const transformed = regexAll(comment, commentRegex);\n\n return transformed;\n }\n\n initConfig() {\n this.LeftPropertyAccessReplacements = {\n 'this': '$this',\n };\n\n this.RightPropertyAccessReplacements = {\n\n };\n\n this.FullPropertyAccessReplacements = {\n 'Number.MAX_SAFE_INTEGER': 'PHP_INT_MAX',\n 'JSON.stringify': 'json_encode',\n 'console.log': 'var_dump',\n 'process.exit': 'exit',\n 'Math.log': 'log',\n 'Math.abs': 'abs',\n 'Math.floor': '(int) floor',\n 'Math.ceil': '(int) ceil',\n 'Math.round': '(int) round',\n 'Math.pow': 'pow',\n 'Math.min': 'min',\n 'Math.max': 'max',\n // 'Promise.all': '\\\\React\\\\Promise\\\\all',\n };\n\n this.CallExpressionReplacements = {\n 'parseFloat': 'floatval',\n 'parseInt': 'intval',\n };\n\n this.PropertyAccessRequiresParenthesisRemoval = [\n // 'length',\n // 'toString',\n // 'toUpperCase',\n // 'toLowerCase',\n // 'pop',\n // 'reverse',\n // 'shift',\n ];\n }\n\n}\n","import { BaseTranspiler } from \"./baseTranspiler.js\";\nimport { SyntaxKind, type Node, type ParameterDeclaration } from 'typescript/unstable/ast';\nimport { IndexKind, TypeFlags, type Checker, type Symbol as TsSymbol, type UnionType } from 'typescript/unstable/sync';\nimport { isArrayLiteralExpression, isAsExpression, isBinaryExpression, isBlock, isBooleanLiteral, isBreakStatement, isCallExpression, isClassDeclaration, isClassExpression, isClassLikeDeclaration, isContinueStatement, isDeleteExpression, isElementAccessExpression, isExpressionStatement, isForStatement, isFunctionExpression, isIdentifier, isIfStatement, isMethodDeclaration, isNumericLiteral, isObjectLiteralExpression, isParameterDeclaration, isParenthesizedExpression, isPostfixUnaryExpression, isPrefixUnaryExpression, isPropertyAccessExpression, isPropertyDeclaration, isPropertySignatureDeclaration, isReturnStatement, isSourceFile, isSpreadAssignment, isSpreadElement, isStringLiteral, isStringLiteralLikeNode, isThrowStatement, isTypeAssertion, isVariableDeclaration, isWhileStatement } from 'typescript/unstable/ast/is';\nimport { findAncestor, getAllSuperTypeNodes, isFunctionLike } from './tsUtils.js';\n\nconst parserConfig = {\n 'ELSEIF_TOKEN': 'else if',\n 'OBJECT_OPENING': 'new Dictionary() {',\n 'ARRAY_OPENING_TOKEN': 'new List() {',\n 'ARRAY_CLOSING_TOKEN': '}',\n 'PROPERTY_ASSIGNMENT_TOKEN': ',',\n 'VAR_TOKEN': 'object', // object\n 'METHOD_TOKEN': '',\n 'PROPERTY_ASSIGNMENT_OPEN': '{',\n 'PROPERTY_ASSIGNMENT_CLOSE': '}',\n 'SUPER_TOKEN': 'base',\n 'SUPER_CALL_TOKEN': 'base',\n 'FALSY_WRAPPER_OPEN': 'isTrue(',\n 'FALSY_WRAPPER_CLOSE': ')',\n 'COMPARISON_WRAPPER_OPEN' : \"isEqual(\",\n 'COMPARISON_WRAPPER_CLOSE' : \")\",\n 'UKNOWN_PROP_WRAPPER_OPEN': 'this.call(',\n 'UNKOWN_PROP_WRAPPER_CLOSE': ')',\n 'UKNOWN_PROP_ASYNC_WRAPPER_OPEN': 'this.callAsync(',\n 'UNKOWN_PROP_ASYNC_WRAPPER_CLOSE': ')',\n 'DYNAMIC_CALL_OPEN': 'callDynamically(',\n 'EQUALS_EQUALS_WRAPPER_OPEN': 'isEqual(',\n 'EQUALS_EQUALS_WRAPPER_CLOSE': ')',\n 'DIFFERENT_WRAPPER_OPEN': '!isEqual(',\n 'DIFFERENT_WRAPPER_CLOSE': ')',\n 'GREATER_THAN_WRAPPER_OPEN': 'isGreaterThan(',\n 'GREATER_THAN_WRAPPER_CLOSE': ')',\n 'GREATER_THAN_EQUALS_WRAPPER_OPEN': 'isGreaterThanOrEqual(',\n 'GREATER_THAN_EQUALS_WRAPPER_CLOSE': ')',\n 'LESS_THAN_WRAPPER_OPEN': 'isLessThan(',\n 'LESS_THAN_WRAPPER_CLOSE': ')',\n 'LESS_THAN_EQUALS_WRAPPER_OPEN': 'isLessThanOrEqual(',\n 'LESS_THAN_EQUALS_WRAPPER_CLOSE': ')',\n 'PLUS_WRAPPER_OPEN':'add(',\n 'PLUS_WRAPPER_CLOSE':')',\n 'MINUS_WRAPPER_OPEN':'subtract(',\n 'MINUS_WRAPPER_CLOSE':')',\n 'ARRAY_LENGTH_WRAPPER_OPEN': 'getArrayLength(',\n 'ARRAY_LENGTH_WRAPPER_CLOSE': ')',\n 'DIVIDE_WRAPPER_OPEN': 'divide(',\n 'DIVIDE_WRAPPER_CLOSE': ')',\n 'MULTIPLY_WRAPPER_OPEN': 'multiply(',\n 'MULTIPLY_WRAPPER_CLOSE': ')',\n 'INDEXOF_WRAPPER_OPEN': 'getIndexOf(',\n 'INDEXOF_WRAPPER_CLOSE': ')',\n 'MOD_WRAPPER_OPEN': 'mod(',\n 'MOD_WRAPPER_CLOSE': ')',\n 'FUNCTION_TOKEN': '',\n 'INFER_VAR_TYPE': false,\n 'INFER_ARG_TYPE': false,\n};\n\n// C# static type of the value each printed helper returns. A local initialised by\n// one of these already holds that concrete type inside its `object` box, so naming\n// the type at the declaration site keeps the very same runtime value and only\n// refines what the C# compiler knows about it.\n\n// instance-style calls the printer rewrites unconditionally by method name\n// (`x.toUpperCase()` always prints `((string)x).ToUpper()`, whatever `x` is)\nconst CSHARP_METHOD_RETURN_TYPES: { [name: string]: string } = {\n 'toUpperCase': 'string',\n 'toLowerCase': 'string',\n 'toString': 'string',\n 'trim': 'string',\n 'join': 'string',\n 'replace': 'string',\n 'replaceAll': 'string',\n 'split': 'List',\n 'startsWith': 'bool',\n 'endsWith': 'bool',\n 'indexOf': 'int',\n 'search': 'int',\n};\n\n// `Object.keys(x)`, `Math.floor(x)`, ... — matched on the full callee text\nconst CSHARP_STATIC_RETURN_TYPES: { [name: string]: string } = {\n 'Object.keys': 'List',\n 'Object.values': 'List',\n 'Object.entries': 'List',\n 'JSON.stringify': 'string',\n 'Math.floor': 'double',\n 'Math.ceil': 'double',\n 'Math.round': 'double',\n 'Array.isArray': 'bool',\n 'Number.isInteger': 'bool',\n};\n\n// delegate-valued members of the hand-written C# base (cs/ccxt/base/Exchange.Options.cs):\n// `Func<...>` with this many parameters, so `this.(args)` with that arity is a direct\n// delegate invocation. `proxy` is a `string` there — not callable — and stays out.\nconst CSHARP_NATIVE_THIS_DELEGATE_ARITY: { [name: string]: number } = {\n 'proxyUrlCallback': 3,\n 'proxy_url_callback': 3,\n 'httpProxyCallback': 4,\n 'http_proxy_callback': 4,\n 'httpsProxyCallback': 4,\n 'https_proxy_callback': 4,\n 'socksProxyCallback': 3,\n 'socks_proxy_callback': 3,\n};\n\n// base-class helpers whose C# signature is already concrete\nconst CSHARP_THIS_RETURN_TYPES: { [name: string]: string } = {\n 'extend': 'Dictionary',\n 'deepExtend': 'Dictionary',\n 'indexBy': 'Dictionary',\n 'groupBy': 'Dictionary',\n 'milliseconds': 'Int64',\n 'seconds': 'Int64',\n 'microseconds': 'Int64',\n 'uuid': 'string',\n 'hmac': 'string',\n 'capitalize': 'string',\n 'ymdhms': 'string',\n 'yyyymmdd': 'string',\n 'json': 'string',\n 'inArray': 'bool',\n 'valueIsDefined': 'bool',\n // the safe* accessor family: cs/ccxt/base already declares these with a concrete\n // return type (`string? safeString(...)`, `Int64? safeInteger(...)`, `bool? safeBool(...)`,\n // `IDictionary safeDict(...)`, `List safeList(...)`, ...), so a\n // local initialised by one of them already holds that type inside its `object` box\n 'safeString': 'string?',\n 'safeString2': 'string?',\n 'safeStringN': 'string?',\n 'safeStringLower': 'string?',\n 'safeStringLower2': 'string?',\n 'safeStringLowerN': 'string?',\n 'safeStringUpper': 'string?',\n 'safeStringUpper2': 'string?',\n 'safeStringUpperN': 'string?',\n 'safeCurrencyCode': 'string?',\n 'safeInteger': 'Int64?',\n 'safeInteger2': 'Int64?',\n 'safeIntegerN': 'Int64?',\n 'safeIntegerProduct': 'Int64?',\n 'safeFloat': 'double?',\n 'safeFloat2': 'double?',\n 'safeFloatN': 'double?',\n 'safeNumberN': 'double?',\n 'safeBool': 'bool?',\n 'safeBool2': 'bool?',\n 'safeBoolN': 'bool?',\n 'safeDict': 'IDictionary',\n 'safeDict2': 'IDictionary',\n 'safeDictN': 'IDictionary',\n 'safeList': 'List',\n 'safeList2': 'List',\n 'safeListN': 'List',\n};\n\n// helpers whose C# signature is `object` (safeValue, getValue, parseInt, add,\n// slice, safeTimestamp, ...) are deliberately absent above: their box holds a value the printer\n// cannot name, so those locals stay `object`.\n\n// this.(...) base methods whose printed C# signature is a concrete numeric value the\n// tables above do not carry: `int precisionFromString(object)` (Exchange.Number.cs) and\n// `Int64? parseToInt(object)` (Exchange.BaseMethods.cs, retyped by the build layer)\nconst CSHARP_NATIVE_NUMERIC_THIS_KINDS: { [name: string]: string } = {\n 'precisionFromString': 'int',\n 'parseToInt': 'Int64?',\n};\n\n// the safe* accessor names of the table above: a local initialised by one of them gets the\n// extra sink guards of csharpLocalIsSafeToType (list-only methods, hard `(string)` casts,\n// the `+` LEFT operand overload rebinding)\nconst CSHARP_SAFE_ACCESSOR_NAMES = Object.keys(CSHARP_THIS_RETURN_TYPES).filter((name) => name.startsWith('safe'));\n\n// S62: calls whose C# signature is a hand-written `bool` (isTrue, isEqual, isGreaterThan, ...,\n// inOp in cs/ccxt/base/Exchange.TranspileHelpers.cs; emitted for the comparison operators, `in`\n// and TS `isTrue`) are already C# `bool`, so the condition printer's falsy wrapper is the identity.\nconst CSHARP_BOOLEAN_PRINTED_CALLS = [\n 'isTrue', 'isEqual', 'isGreaterThan', 'isGreaterThanOrEqual',\n 'isLessThan', 'isLessThanOrEqual', 'inOp',\n];\n\n// a transpiled parameter or local can literally be named `bool`, which would turn\n// `bool x = ...` into a reference to that value instead of the type. `string` and\n// `object` are already renamed by ReservedKeywordsReplacements.\nconst CSHARP_TYPE_NAMES = [ 'string', 'bool', 'int', 'long', 'Int64', 'double', 'object', 'List', 'IList', 'Dictionary', 'IDictionary', 'var' ];\n\n// joins a receiver's printed text with a literal key in the `key in recv` guard index\nconst GUARD_KEY_SEPARATOR = \"\\u0000\";\n\n// C# kinds a comparison can be printed natively on: the runtime isLessThan family compares two\n// boxes of one kind with the conversions the C# operator applies too. `double` keeps only\n// `>`/`>=` — the helper reads a NaN operand as \"less than\", a native comparison is false — and\n// only meets another `double`: its isEqual accepts an integral double as an integer.\nconst CSHARP_NUMERIC_KINDS = [ 'int', 'Int64', 'double' ];\n\n// numeric kinds a printed call result can carry (with the nullable spellings the safe*\n// accessors and parseToInt use), for the equality path only\nconst CSHARP_NUMERIC_VALUE_KINDS = [ 'int', 'Int64', 'Int64?', 'double', 'double?' ];\n\n// integer kinds the helper normalises to Int64 (normalizeIntIfNeeded), the same widening the\n// C# operator applies to an int next to a long, so a mixed pair prints the identical comparison\nconst CSHARP_INTEGER_KINDS = [ 'int', 'Int64' ];\n\nconst CSHARP_NATIVE_COMPARISON_TOKENS = {\n [SyntaxKind.LessThanToken]: '<',\n [SyntaxKind.GreaterThanToken]: '>',\n [SyntaxKind.LessThanEqualsToken]: '<=',\n [SyntaxKind.GreaterThanEqualsToken]: '>=',\n};\n\n// C# kinds where Math.Min/Max may replace mathMin/mathMax: the helper reads both boxes via\n// Convert.ToDouble and returns an ORIGINAL box, so only integer kinds give the same value in the\n// same box. `double` keeps the helper (Math.Min propagates NaN, and -0/+0 differ).\nconst CSHARP_MINMAX_NATIVE_KINDS = [ 'int', 'Int64' ];\n\n// every binary operator that writes its left operand (typescript6 has no First/LastAssignmentOperator\n// range to test against), used by the element-access loop guards below\nconst CSHARP_ASSIGNMENT_OPERATOR_KINDS = [\n SyntaxKind.EqualsToken,\n SyntaxKind.PlusEqualsToken,\n SyntaxKind.MinusEqualsToken,\n SyntaxKind.AsteriskEqualsToken,\n SyntaxKind.AsteriskAsteriskEqualsToken,\n SyntaxKind.SlashEqualsToken,\n SyntaxKind.PercentEqualsToken,\n SyntaxKind.LessThanLessThanEqualsToken,\n SyntaxKind.GreaterThanGreaterThanEqualsToken,\n SyntaxKind.GreaterThanGreaterThanGreaterThanEqualsToken,\n SyntaxKind.AmpersandEqualsToken,\n SyntaxKind.BarEqualsToken,\n SyntaxKind.CaretEqualsToken,\n SyntaxKind.BarBarEqualsToken,\n SyntaxKind.AmpersandAmpersandEqualsToken,\n SyntaxKind.QuestionQuestionEqualsToken,\n];\n\n// hand-written BaseExchange fields whose C# declaration already is a concrete\n// dictionary/list (cs/ccxt/base/Exchange.Options.cs): a read of the field carries\n// that static type, so its own members (`Count`, `ContainsKey`) replace the helper\nconst CSHARP_NATIVE_FIELDS: { [name: string]: string } = {\n 'options': 'ConcurrentDictionary',\n 'has': 'Dictionary',\n 'features': 'Dictionary',\n 'httpExceptions': 'Dictionary',\n 'markets_by_id': 'IDictionary',\n 'symbols': 'List',\n 'codes': 'List',\n 'ids': 'List',\n};\n\n// hand-written BaseExchange fields declared `object` that always box a dictionary\n// (dict / CustomConcurrentDictionary): the member needs the same\n// `(IDictionary)` cast the transpiled helper body itself applies\nconst CSHARP_OBJECT_DICT_FIELDS = [ 'urls', 'tickers', 'bidsasks', 'orderbooks', 'ohlcvs', 'trades', 'markets', 'currencies', 'currencies_by_id', 'exceptions' ];\n\n// Hand-written BaseExchange / PredictionExchange fields declared as C# reference types: the field\n// holds a reference box, so a null comparison is exactly the isEqual(field, null) branch. A\n// value-typed field keeps the helper — rateLimit is a `double` (its TS number type proves nothing).\nconst CSHARP_REFERENCE_FIELDS_NATIVE = [\n 'id', 'hostname', 'apiKey', 'secret', 'password', 'uid', 'accountId', 'login', 'privateKey',\n 'walletAddress', 'twofa', 'proxy', 'proxyUrl', 'proxy_url', 'proxyUrlCallback',\n 'proxy_url_callback', 'last_http_response', 'markets', 'markets_by_id', 'features', 'tickers',\n 'bidsasks', 'ohlcvs', 'trades', 'orders', 'myTrades', 'positions', 'liquidations', 'balance',\n 'accounts', 'currencies', 'currencies_by_id', 'outcomes', 'outcomes_by_id', 'events',\n 'events_by_slug', 'clients', 'ids', 'tokenBucket',\n];\n\n// hand-written BaseExchange fields declared `bool` (cs/ccxt/base/Exchange.Options.cs, e.g.\n// `public bool newUpdates;` / `public bool verbose { get; set; }`): a `this.` read is\n// already a C# bool, so a condition holding one needs no isTrue wrapper\nconst CSHARP_NATIVE_BOOL_FIELDS = [\n 'alias', 'certified', 'enableRateLimit', 'isSandboxModeEnabled', 'newUpdates', 'pro',\n 'reduceFees', 'reloadingMarkets', 'returnResponseHeaders', 'substituteCommonCurrencyCodes', 'verbose',\n];\n\n// Hand-written BaseExchange fields whose reads print natively although the key may be absent:\n// `has`/`options` are concrete dictionaries; `urls`, `markets`, `exceptions` are `object` boxes\n// that always hold one. The native read tests the key, so a missing key still reads null.\nconst CSHARP_MISSING_KEY_FIELDS_NATIVE = [ 'has', 'options', 'urls', 'markets', 'exceptions' ];\n\n// C# collection types this printer can name whose members replace the helpers\nconst CSHARP_NATIVE_COLLECTION_TYPES = [ 'List', 'IList', 'Dictionary', 'IDictionary' ];\n\n// C# types isEqual's own branches can compare an element with: the box an element read\n// yields is unboxed with `as`, which answers null for every other box\nconst CSHARP_SCALAR_ELEMENT_BOOL = 1;\nconst CSHARP_SCALAR_ELEMENT_STRING = 2;\n\n// C# dictionary types this printer can name on a local\nconst CSHARP_NATIVE_DICTIONARY_TYPES = [ 'Dictionary', 'IDictionary' ];\n\n// the row-receiver family of the cs-08 unit, extended by B-19 to the currency row: a read of a\n// local with one of these names the declared table proves is a dictionary prints natively.\n// Other receivers belong to their own units (cs-09 fields, cs-10 response/result/balance locals)\nconst CSHARP_NATIVE_MARKET_RECEIVERS = [ 'market', 'currency' ];\n\n// Callees hand-written in cs/ccxt/base returning non-nullable `bool` with no TS declaration to read\n// an annotation from: `isEmpty`, `isJsonEncodedObject`, `isBinaryMessage` and Precise's string\n// comparisons. Keyed on printed callee text, so a `callDynamically` rewrite never matches.\nconst CSHARP_BOOL_CALLEES_NATIVE: { [name: string]: boolean } = {\n 'this.isEmpty': true,\n 'this.isJsonEncodedObject': true,\n 'this.isBinaryMessage': true,\n 'Precise.stringGt': true,\n 'Precise.stringGe': true,\n 'Precise.stringLt': true,\n 'Precise.stringLe': true,\n 'Precise.stringEq': true,\n 'Precise.stringEquals': true,\n};\n\n// TS base methods the C# port hand-writes with its own signature: the TS annotation is `boolean`\n// but the C# method bound by `this.(...)` returns something else (`object isDictionary`),\n// so the isTrue wrapper must stay regardless of the annotation.\nconst CSHARP_HANDWRITTEN_CALLEES_NATIVE = [ 'isDictionary' ];\n\n// Declared C# types whose `Count` counts exactly what getArrayLength's IList / ICollection\n// branches count. A prefix test: these are named with element types (`List`,\n// `Dictionary`, ...) and every member of the family carries `Count`.\nconst CSHARP_COUNT_TYPES = [ 'List<', 'IList<', 'Dictionary<', 'IDictionary<', 'ConcurrentDictionary<' ];\n\n// ==== native parseInt / parseFloat / mod / prefix `-x` ====\n// These helpers' answers depend on the runtime type of their boxes. Each emission below replaces\n// the call only where the printer can name the exact value the helper returns; else keep helper.\n\n// the numeric literal spellings this printer re-reads: decimal digits with an optional fraction\n// (a hex or separator literal prints characters the C# compiler would read differently)\nconst CSHARP_DECIMAL_LITERAL = /^[0-9]+(\\.[0-9]+)?$/;\n\n// the C# source of a double literal holding exactly `value`: String() is the shortest\n// round-trip spelling, and a whole number needs a fraction or an exponent to stay a double\nfunction csharpDoubleLiteral(value) {\n if (!Number.isFinite(value)) {\n return undefined;\n }\n const text = String(value);\n return (text.indexOf('.') >= 0 || text.indexOf('e') >= 0) ? text : text + '.0';\n}\n\n// the numeric value of a literal operand: a plain literal or one under a unary minus\nfunction csharpLiteralNumericValue(node) {\n if (isNumericLiteral(node)) {\n return CSHARP_DECIMAL_LITERAL.test(node.text) ? Number(node.text) : undefined;\n }\n if (isPrefixUnaryExpression(node) && (node.operator === SyntaxKind.MinusToken) && isNumericLiteral(node.operand)\n && CSHARP_DECIMAL_LITERAL.test(node.operand.text)) {\n return -Number(node.operand.text);\n }\n return undefined;\n}\n\n// `parseInt()` boxes Convert.ToInt64(Math.Floor(Convert.ToDouble(a))): a digits-only\n// string reads as the same number in every culture, so both readings fold into one Int64 literal\nfunction csharpParseIntLiteralArgument(arg) {\n if (isStringLiteral(arg)) {\n if (!/^[0-9]+$/.test(arg.text)) {\n return undefined; // a sign, a point or an exponent is read with the CURRENT culture\n }\n const value = Number(arg.text);\n return Number.isSafeInteger(value) ? `${value}L` : undefined;\n }\n const numeric = csharpLiteralNumericValue(arg);\n if (numeric === undefined) {\n return undefined;\n }\n const floored = Math.floor(numeric);\n if (!Number.isSafeInteger(floored)) {\n return undefined;\n }\n return (floored < 0) ? `(${floored}L)` : `${floored}L`;\n}\n\n// `parseFloat()` boxes Convert.ToDouble(a, InvariantCulture): a plain decimal string\n// and a numeric literal both read as the nearest double, the value the literal spells\nfunction csharpParseFloatLiteralArgument(arg) {\n if (isStringLiteral(arg)) {\n return CSHARP_DECIMAL_LITERAL.test(arg.text) ? csharpDoubleLiteral(Number(arg.text)) : undefined;\n }\n const numeric = csharpLiteralNumericValue(arg);\n return (numeric === undefined) ? undefined : csharpDoubleLiteral(numeric);\n}\n\n// receivers the market-typed-local unit owns (market/currency rows); this printer's literal-key\n// read rule leaves them to that family and covers every other declared-collection local\nconst CSHARP_MARKET_RECEIVER_NAMES = [ 'market', 'currency' ];\n\n// Parameters of a method whose override chain the ts/src census cleared: every declaration (base\n// member + every override) maps to the same spelling AND every call site in the generated tree\n// passes a compatible argument, so the whole-language build stays green. The three surviving\nconst CSHARP_OVERRIDE_PARAM_TYPES: { [name: string]: { [index: number]: string } } = {\n ethRpc: { 2: 'IList' },\n parsePredictionOpenInterest: { 0: 'IDictionary' },\n signEvmTransaction: { 0: 'IDictionary' },\n};\n\n\n// a leading cast of the printed expression: `(IList)(x)` names the receiver's static type\nconst CSHARP_LENGTH_CAST = /^\\(([A-Za-z_][\\w.]*(?:<[^<>]*(?:<[^<>]*>)?[^<>]*>)?)\\)/;\n\n// U55: declaration types where `isEqual (x, null)` -> `x == null` is the same test: `T?` (`== null`\n// is `!x.HasValue`, the helper's `a == null` guard) and named reference types (reference compare).\n// `object`/`var` and non-nullable scalars are refused (`x == null` won't compile for Int64/bool).\nconst CSHARP_NULL_COMPARISON_REFERENCE_HEADS = [ 'string', 'IDictionary<', 'Dictionary<', 'IList<', 'List<', 'ConcurrentDictionary<', 'ccxt.pro.', 'ArrayCache', 'IOrderBook', 'Future', 'WebSocketClient', 'Delegates' ];\n\nexport class CSharpTranspiler extends BaseTranspiler {\n\n binaryExpressionsWrappers;\n // method node -> 'bool' | 'bool?' | undefined (see csharpBooleanReturnType)\n csharpBooleanReturnTypes = new WeakMap();\n // variable declaration -> getCSharpLocalType result, shared by the condition checks\n csharpLocalTypes = new WeakMap();\n // method node -> `key in recv` guards of that method, keyed by receiver text + key\n csharpGuardIndex = new WeakMap>();\n // optional proof of the concrete C# type of an expression, installed by the embedding build\n // layer for the locals it retypes itself (ccxt: build/csharp-local-types.js); it must\n // describe the same type the declaration is emitted with, or the operator will not compile\n csharpExpressionTypeResolver?: (node) => string | undefined;\n // optional proof of the C# type a LOCAL's declaration was emitted with, installed by the\n // embedding build layer for declarations it retyped itself; the member-access rules read it\n // only after this printer's own declared-local table declined\n csharpDeclaredLocalTypeResolver?: (declaration) => string | undefined;\n // variable declaration -> the concrete C# type this printer named for it\n // (getCSharpLocalType): 'List' / 'Dictionary' / 'string' / ...\n // Only declarations the printer typed itself are kept: the printed ` name = `\n // prefix is final, so every later read of the local is statically that type and its\n // members may replace inOp/getArrayLength\n csharpTypedLocals = new WeakMap();\n // ws handler `message` parameter -> the typed signature this printer prints for it (D-19)\n csharpHandlerMessageTypes = new WeakMap();\n // method declaration -> a static call reference exists (a call binds its arguments)\n csharpHandlerCalled = new WeakMap();\n // class declaration -> the class routes the raw message through a list test\n csharpListRouteClasses = new WeakMap();\n // source file -> method symbol -> a static call reference exists (built once per file: a\n // sticky batch program is shared by every file of the stage, so a program-keyed index\n // would answer for another venue's class)\n csharpHandlerCallIndex = new WeakMap>();\n // parameter node -> the type the printed signature gives it (printParameterType, e.g.\n // `Dict` -> Dictionary), recorded as the signature is printed. Read-only:\n // no printer rule consults it, see csharpPrintedParamType\n csharpParamTypes = new WeakMap();\n // declaration node -> C# type of the local ('' = the printer prints `object`); see\n // csharpStringReceiverType -- the ccxt classifier asks once per string-method receiver\n stringReceiverTypes = new WeakMap();\n // declaration node -> 'bool' | 'bool?' | '' (the printer cannot name it); see\n // csharpConditionOperandType — asked once per condition operand\n conditionOperandTypes = new WeakMap();\n\n constructor(config = {}) {\n config['parser'] = Object.assign ({}, parserConfig, config['parser'] ?? {});\n\n super(config);\n\n this.requiresParameterType = true;\n this.requiresReturnType = true;\n this.asyncTranspiling = true;\n this.implicitAsyncTranspiling = true;\n this.supportsFalsyOrTruthyValues = false;\n this.requiresCallExpressionCast = true;\n this.id = \"C#\";\n\n\n this.initConfig();\n\n // user overrides\n this.applyUserOverrides(config);\n }\n\n initConfig() {\n this.LeftPropertyAccessReplacements = {\n // 'this': '$this',\n };\n\n this.RightPropertyAccessReplacements = {\n 'push': 'Add', // list method\n 'indexOf': 'IndexOf', // list method\n 'toUpperCase': 'ToUpper',\n 'toLowerCase': 'ToLower',\n 'toString': 'ToString',\n };\n\n this.FullPropertyAccessReplacements = {\n 'JSON.parse': 'parseJson', // custom helper method\n 'console.log': 'Console.WriteLine',\n 'Number.MAX_SAFE_INTEGER': 'Int32.MaxValue',\n 'Math.min': 'Math.Min',\n 'Math.max': 'Math.Max',\n 'Math.log': 'Math.Log',\n 'Math.abs': 'Math.Abs',\n // 'Math.ceil': 'Math.Ceiling', // need cast\n // 'Math.round': 'Math.Round', // need to cast\n 'Math.floor': 'Math.Floor',\n 'Math.pow': 'Math.Pow',\n // 'Promise.all': 'Task.WhenAll',\n };\n\n this.CallExpressionReplacements = {\n // \"parseInt\": \"parseINt\",\n // \"parseFloat\": \"float.Parse\",\n };\n\n this.ReservedKeywordsReplacements = {\n 'string': 'str',\n 'object': 'obj',\n 'params': 'parameters',\n 'base': 'bs',\n 'internal': 'intern',\n 'event': 'eventVar',\n 'fixed': 'fixedVar',\n };\n\n this.VariableTypeReplacements = {\n 'string': 'string',\n 'Str': 'string',\n 'number': 'double',\n 'Int': 'Int64',\n 'Num': 'double',\n 'Dict': 'Dictionary',\n 'Strings': 'List',\n 'List': 'List',\n 'boolean': 'bool',\n };\n\n this.ArgTypeReplacements = { ...this.VariableTypeReplacements };\n\n this.binaryExpressionsWrappers = {\n [SyntaxKind.EqualsEqualsToken]: [this.EQUALS_EQUALS_WRAPPER_OPEN, this.EQUALS_EQUALS_WRAPPER_CLOSE],\n [SyntaxKind.EqualsEqualsEqualsToken]: [this.EQUALS_EQUALS_WRAPPER_OPEN, this.EQUALS_EQUALS_WRAPPER_CLOSE],\n [SyntaxKind.ExclamationEqualsToken]: [this.DIFFERENT_WRAPPER_OPEN, this.DIFFERENT_WRAPPER_CLOSE],\n [SyntaxKind.ExclamationEqualsEqualsToken]: [this.DIFFERENT_WRAPPER_OPEN, this.DIFFERENT_WRAPPER_CLOSE],\n [SyntaxKind.GreaterThanToken]: [this.GREATER_THAN_WRAPPER_OPEN, this.GREATER_THAN_WRAPPER_CLOSE],\n [SyntaxKind.GreaterThanEqualsToken]: [this.GREATER_THAN_EQUALS_WRAPPER_OPEN, this.GREATER_THAN_EQUALS_WRAPPER_CLOSE],\n [SyntaxKind.LessThanToken]: [this.LESS_THAN_WRAPPER_OPEN, this.LESS_THAN_WRAPPER_CLOSE],\n [SyntaxKind.LessThanEqualsToken]: [this.LESS_THAN_EQUALS_WRAPPER_OPEN, this.LESS_THAN_EQUALS_WRAPPER_CLOSE],\n [SyntaxKind.PlusToken]: [this.PLUS_WRAPPER_OPEN, this.PLUS_WRAPPER_CLOSE],\n [SyntaxKind.MinusToken]: [this.MINUS_WRAPPER_OPEN, this.MINUS_WRAPPER_CLOSE],\n [SyntaxKind.AsteriskToken]: [this.MULTIPLY_WRAPPER_OPEN, this.MULTIPLY_WRAPPER_CLOSE],\n [SyntaxKind.PercentToken]: [this.MOD_WRAPPER_OPEN, this.MOD_WRAPPER_CLOSE],\n [SyntaxKind.SlashToken]: [this.DIVIDE_WRAPPER_OPEN, this.DIVIDE_WRAPPER_CLOSE],\n };\n }\n\n getBlockOpen(identation){\n return \"\\n\" + this.getIden(identation) + this.BLOCK_OPENING_TOKEN + \"\\n\";\n }\n\n printSuperCallInsideConstructor(node, identation) {\n return \"\"; // csharp does not need super call inside constructor\n }\n\n // method node -> base-class method it overrides (null: none); see getMethodOverride\n csharpMethodOverrides = new WeakMap();\n // class declaration -> member name -> its LAST method of that name (base scan order)\n csharpClassMethodsByName = new WeakMap>();\n\n csharpMethodsByName(classDecl): Map {\n let byName = this.csharpClassMethodsByName.get(classDecl);\n if (byName === undefined) {\n byName = new Map();\n for (const elem of classDecl.members ?? []) {\n if (isMethodDeclaration(elem)) {\n byName.set(elem.name.getText().trim(), elem);\n }\n }\n this.csharpClassMethodsByName.set(classDecl, byName);\n }\n return byName;\n }\n\n // base getMethodOverride rescans every parent member with getText() on each call; the\n // printer asks per method several times, so memoize it (same walk, same result)\n getMethodOverride(node: Node): Node {\n if (node === undefined || !isClassDeclaration(node.parent) || !(node.parent as any).heritageClauses) {\n return undefined;\n }\n const cached = this.csharpMethodOverrides.get(node);\n if (cached !== undefined) {\n return cached ?? undefined;\n }\n let method = undefined;\n let parentClass = getAllSuperTypeNodes(node.parent)[0];\n while (parentClass !== undefined) {\n const parentClassDecl = this.getChecker().getTypeAtLocation(parentClass)?.getSymbol()?.valueDeclaration?.resolve();\n if (parentClassDecl === undefined) {\n this.warn(node, \"Parent class\", \"Parent class not found\");\n method = undefined;\n break;\n }\n method = this.csharpMethodsByName(parentClassDecl).get((node as any).name.text) ?? method;\n parentClass = getAllSuperTypeNodes(parentClassDecl)[0] ?? undefined;\n }\n this.csharpMethodOverrides.set(node, method ?? null);\n return method;\n }\n\n printIdentifier(node) {\n let idValue = node.text ?? node.text;\n\n if (this.ReservedKeywordsReplacements[idValue]) {\n idValue = this.ReservedKeywordsReplacements[idValue];\n }\n\n if (idValue === \"undefined\") {\n return this.UNDEFINED_TOKEN;\n }\n\n // check if it is a class declaration that we need to wrap arounf typeof\n // example: const x = Error -> var x = typeof(Error)\n const type = this.getChecker().getTypeAtLocation(node);\n const symbol = type?.getSymbol();\n if (symbol !== undefined) {\n // const declarations = (this.getChecker().getDeclaredTypeOfSymbol(symbol).getSymbol()?.declarations ?? []).map((d) => d.resolve());\n const decl = (symbol?.declarations ?? []).map((d) => d.resolve());\n let isBuiltIn = undefined;\n if (decl.length > 0) {\n isBuiltIn = decl[0].getSourceFile().fileName.indexOf('typescript') > -1; //very hacky find a better solution later\n }\n\n if (isBuiltIn !== undefined && !isBuiltIn) {\n // const isClassDeclaration = declarations.find(l => l.kind === SyntaxKind.ClassDeclaration);\n const isInsideNewExpression = node?.parent?.kind === SyntaxKind.NewExpression;\n const isInsideCatch = node?.parent?.kind === SyntaxKind.ThrowStatement;\n const isLeftSide = node?.parent?.name === node || (node?.parent?.left === node);\n const isCallOrPropertyAccess = node?.parent?.kind === SyntaxKind.PropertyAccessExpression || node?.parent?.kind === SyntaxKind.ElementAccessExpression;\n if (!isLeftSide && !isCallOrPropertyAccess && !isInsideCatch && !isInsideNewExpression) {\n // return `typeof(${idValue})`; // this is not working as expected\n // for instance\n // const instance = new x();\n // const b = instance;\n // gets transpiled to\n // var instance = typeof(x);\n const symbol = this.getChecker().getSymbolAtLocation(node);\n let isClassDeclaration = false;\n if (symbol) {\n const first = symbol.declarations[0].resolve();\n if (first.kind === SyntaxKind.ClassDeclaration) {\n isClassDeclaration = true;\n }\n if (first.kind === SyntaxKind.ImportSpecifier) {\n const importedSymbol = this.getChecker().getAliasedSymbol(symbol);\n if (importedSymbol?.declarations[0]?.resolve()?.kind === SyntaxKind.ClassDeclaration) {\n isClassDeclaration = true;\n }\n }\n }\n // console.log(node.getText(), 'isClass declaration', isClass);\n if (isClassDeclaration) {\n return `typeof(${idValue})`;\n // this does not work then the class is imported from another file because\n // the type is not resolved correctly and the symbol declaration is simply a importSpecifier\n // we would need to find a way to get the type from the importSpecifier\n // by loading the entire code upon transpiling the ts file\n }\n }\n }\n }\n\n return this.transformIdentifier(node, idValue); // check this later\n }\n\n printConstructorDeclaration (node, identation) {\n const classNode = node.parent;\n const className = this.printNode(classNode.name, 0);\n const args = this.printMethodParameters(node);\n const constructorBody = this.printFunctionBody(node, identation);\n\n // find super call inside constructor and extract params\n let superClause = '';\n node.body?.statements.forEach(statement => {\n if (isExpressionStatement(statement)) {\n const expression = statement.expression;\n if (isCallExpression(expression)) {\n const expressionText = expression.expression.getText().trim();\n if (expressionText === 'super') {\n const superCallParams = expression.arguments.map((a) => {\n return this.printNode(a, identation).trim();\n }).join(\", \");\n superClause = ` : ${this.SUPER_CALL_TOKEN}(${superCallParams})`;\n }\n }\n }\n });\n\n return this.getIden(identation) + className + `(${args})` + superClause + constructorBody;\n }\n\n printDynamicCall(node, identation) {\n const elementAccess = node.expression;\n if (elementAccess?.kind === SyntaxKind.ElementAccessExpression) {\n const parsedArg = node.arguments.map(n => this.printNode(n, identation).trimStart()).join(\", \");\n const target = this.printNode(elementAccess.expression, 0);\n const propName = this.printNode(elementAccess.argumentExpression, 0);\n // always typed as async: the caller cannot tell whether the dynamic target is\n return `((Task)${this.DYNAMIC_CALL_OPEN}${target}, ${propName}, new object[] { ${parsedArg} }))`;\n }\n return undefined;\n }\n\n\n // The C# declared type of an expression's receiver (`request` in `request[\"k\"] = v`), as\n // the consumer's classifier knows it — ccxt's build/csharp-local-types.js overrides this\n // with its scope-aware local map. Undefined on an unpatched printer\n csharpDeclaredReceiverType(node): string | undefined {\n return undefined; // stub to override\n }\n\n // The C# type the printed SIGNATURE gives a parameter (`Dictionary` for `Dict`,\n // `object` when unnamed), recorded while printing so a body use can ask. Read-only: no printer\n // rule consults it; only the consumer's csharpDeclaredReceiverType override changes emission.\n csharpPrintedParamType(receiver): string | undefined {\n const declaration = this.csharpReceiverBinding(receiver);\n if (declaration?.kind !== SyntaxKind.Parameter) {\n return undefined;\n }\n const recorded = this.csharpParamTypes.get(declaration);\n return ((recorded === undefined) || (recorded === '') || (recorded === 'object')) ? undefined : recorded;\n }\n\n // A receiver whose declared C# type the consumer's classifier names as a concrete dictionary:\n // the `((IDictionary)x)` cast around element access is an identity conversion.\n // Gated entirely on the consumer's hook, so an object receiver and untyped runs keep the cast.\n csharpReceiverIsDeclaredDictionary(expression): boolean {\n const declared = this.csharpDeclaredReceiverType(expression);\n return (declared === 'Dictionary') || (declared === 'IDictionary');\n }\n\n // A dict element WRITE (`request[\"k\"] = v`) on a receiver whose *declared* C# type is already a\n // dictionary needs no `((IDictionary)…)` cast: both indexers are the same setter.\n // Gated entirely on csharpDeclaredReceiverType, so object receivers and untyped runs keep the cast.\n csharpDictionaryElementWriteTarget(node): string | undefined {\n const parent = node?.parent;\n // `request[\"k\"] += v` keeps the cast: only the plain assignment was audited\n const isWrite = parent?.kind === SyntaxKind.BinaryExpression\n && parent.operatorToken.kind === SyntaxKind.EqualsToken\n && parent.left === node;\n if (!isWrite || !this.ELEMENT_ACCESS_WRAPPER_OPEN || !this.ELEMENT_ACCESS_WRAPPER_CLOSE) {\n return undefined;\n }\n const { expression, argumentExpression } = node;\n if (!this.csharpReceiverIsDeclaredDictionary(expression)) {\n return undefined;\n }\n // the interface cast also carries the string-key proof; only a string key (or a union\n // holding one, the shape the index-signature key type reports) may stay cast-less\n const keyType = this.getChecker().getTypeAtLocation(argumentExpression);\n const members = (keyType.flags === TypeFlags.Union) ? ((keyType as any).getTypes() ?? [keyType]) : [keyType];\n const stringKey = (keyType.flags === TypeFlags.Any) || members.some((t) => this.isStringType(t.flags));\n if (!stringKey) {\n return undefined;\n }\n const cast = isStringLiteralLikeNode(argumentExpression) ? '' : '(string)';\n return this.printNode(expression, 0) + '[' + cast + this.printNode(argumentExpression, 0) + ']';\n }\n\n printElementAccessExpressionExceptionIfAny(node) {\n // convert this[method] into this.call(method) or this.callAsync(method)\n // if (node?.expression?.kind === SyntaxKind.ThisKeyword) {\n // const isAsyncDecl = node?.parent?.kind === SyntaxKind.AwaitExpression;\n // const open = isAsyncDecl ? this.UKNOWN_PROP_ASYNC_WRAPPER_OPEN : this.UKNOWN_PROP_WRAPPER_OPEN;\n // return open.replace('(', '');\n // }\n }\n\n // reads print getValue(recv, key), which yields null for a missing key; a C# indexer\n // throws instead, so the native form is only emitted where the source guarantees the key\n // is there: a dominating `key in recv` guard, or a receiver local built by a literal that\n // declares the key, or a receiver the declared table proves is a dictionary (the native\n // form then keeps the helper's null-for-a-missing-key result). every other read keeps the\n // helper.\n // the single element-access override, gates strongest (declaration-type) proof first:\n // S21 typed dict WRITE (csharpDictionaryElementWriteTarget), S63 typed dict READ twin\n // (printTypedDictElementAccessIfAny), S14 list-cast (csharpElementAccessReceiverIsList),\n // then the native read form proven from the printed source (#82, csharpNativeElementAccess,\n // see the note above). Every other read keeps the helper; a site no gate names keeps the\n // base printing.\n printElementAccessExpression(node, identation) {\n const native = this.csharpNativeElementAccess(node);\n if (native !== undefined) {\n return native;\n }\n const dictWrite = this.csharpDictionaryElementWriteTarget(node);\n if (dictWrite !== undefined) {\n return dictWrite;\n }\n const typedRead = this.printTypedDictElementAccessIfAny(node);\n if (typedRead !== undefined) {\n return typedRead;\n }\n if (this.csharpElementAccessReceiverIsList(node)) {\n const type = this.getChecker().getTypeAtLocation(node.argumentExpression);\n const isUnion = ((type.flags & TypeFlags.Union) !== 0) && Array.isArray((type as any).getTypes());\n // the base printer's own key dispatch, plus the union spelling the worker\n // handles: a string (or type-less) key is a dictionary element, never a list\n // index, and keeps the IDictionary cast\n const isStringOrUnknownKey = this.isStringType(type.flags)\n || (type.flags === TypeFlags.Any)\n || (isUnion && (type as any).getTypes().some((t) => this.isStringType(t.flags)));\n if (!isStringOrUnknownKey) {\n return `${this.printNode(node.expression, 0)}[Convert.ToInt32(${this.printNode(node.argumentExpression, 0)})]`;\n }\n }\n const listRead = this.csharpListIndexRead(node);\n if (listRead !== undefined) {\n return listRead;\n }\n return super.printElementAccessExpression(node, identation);\n }\n\n csharpNativeElementAccess(node): string | undefined {\n if (!this.ELEMENT_ACCESS_WRAPPER_OPEN || !this.ELEMENT_ACCESS_WRAPPER_CLOSE) {\n return undefined;\n }\n const exception: any = this.printElementAccessExpressionExceptionIfAny(node);\n if (exception) {\n return undefined; // the exception printing wins over the native form\n }\n const { expression, argumentExpression } = node;\n const parent = node.parent;\n const isWrite = parent?.kind === SyntaxKind.BinaryExpression &&\n (parent.operatorToken.kind === SyntaxKind.EqualsToken || parent.operatorToken.kind === SyntaxKind.PlusEqualsToken) &&\n parent.left === node;\n if (isWrite) {\n return undefined; // writes are native already, they are printed with the cast\n }\n const isStringKey = isStringLiteralLikeNode(argumentExpression);\n const isNumberKey = isNumericLiteral(argumentExpression);\n if (!isStringKey && !isNumberKey) {\n return this.csharpLoopIndexListRead(expression, argumentExpression); // counter proven in range by its loop\n }\n const key = (argumentExpression as any).text;\n const builtFromLiteral = this.csharpLiteralDeclaresKey(node, expression, key, isNumberKey);\n const guarded = !builtFromLiteral && this.csharpKeyPresenceGuarded(node, expression, key);\n if (!builtFromLiteral && !guarded) {\n return this.csharpNativeDeclaredDictionaryRead(expression, argumentExpression)\n ?? this.csharpDeclaredLocalResolverRowRead(expression, argumentExpression)\n ?? this.csharpDeclaredCollectionRead(node, expression, argumentExpression, isStringKey, isNumberKey)\n ?? this.csharpProvenDictionaryRead(node, expression, argumentExpression, isStringKey)\n ?? this.csharpMissingKeyFieldRead(expression, argumentExpression, isStringKey);\n }\n const receiver = this.printNode(expression, 0);\n const printedKey = this.printNode(argumentExpression, 0);\n if (isNumberKey) {\n return `((${this.ARRAY_KEYWORD})${receiver})[${printedKey}]`;\n }\n // a receiver the classifier already declared a concrete dictionary keeps its own\n // indexer: the interface cast named the box, never a conversion\n if (this.csharpReceiverIsDeclaredDictionary(expression)) {\n return `${receiver}[${printedKey}]`;\n }\n return `((IDictionary)${receiver})[${printedKey}]`;\n }\n\n // `getValue (market, \"lit\")` / `getValue (currency, \"lit\")` on a row local the declared\n // table proves is a C# dictionary: the native form tests the key, so a missing key still\n // reads null exactly like the helper. An untyped receiver keeps the helper.\n csharpIsMarketRowKeyRead(expression, argumentExpression): boolean {\n return isIdentifier(expression) && isStringLiteralLikeNode(argumentExpression)\n && CSHARP_NATIVE_MARKET_RECEIVERS.indexOf(expression.text as string) >= 0;\n }\n\n csharpNativeDeclaredDictionaryRead(expression, argumentExpression): string | undefined {\n if (!this.csharpIsMarketRowKeyRead(expression, argumentExpression)) {\n return undefined;\n }\n if (this.csharpDeclaredDictionaryType(expression) === undefined) {\n return undefined;\n }\n const receiver = this.printNode(expression, 0);\n const printedKey = this.printNode(argumentExpression, 0);\n return `(${receiver}.ContainsKey(${printedKey}) ? ${receiver}[${printedKey}] : null)`;\n }\n\n // the C# dictionary type the declared table names for a local read, or undefined: the\n // printer's own table, then the build layer's read proof (the row a market/currency builder\n // returned; never null on any path)\n csharpDeclaredDictionaryType(node): string | undefined {\n if (node?.kind !== SyntaxKind.Identifier) {\n return undefined;\n }\n const named = this.csharpTypedLocalType(node) ?? this.csharpExpressionTypeOf(node);\n if (named === undefined || CSHARP_NATIVE_DICTIONARY_TYPES.indexOf(named) < 0) {\n return undefined;\n }\n return named;\n }\n\n // the type the embedding build layer recorded for the declaration behind a read\n // (csharpDeclaredLocalTypeResolver): the declarations it retyped itself, i.e. the parameters\n // and locals whose printed prefix is no longer what the printer's own tables say\n csharpDeclaredLocalResolverType(node): string | undefined {\n if (typeof this.csharpDeclaredLocalTypeResolver !== 'function') {\n return undefined;\n }\n const checker: any = this.checkerOrUndefined();\n if (checker === undefined) {\n return undefined;\n }\n const declaration = checker.getSymbolAtLocation(node)?.valueDeclaration?.resolve();\n if (declaration === undefined) {\n return undefined;\n }\n const recorded = this.csharpDeclaredLocalTypeResolver(declaration);\n return (typeof recorded === 'string') ? recorded : undefined;\n }\n\n // the same read for a receiver only the build layer's declared-local resolver names (a\n // parameter B-17 retyped): its box may still be null, so the read carries the helper's\n // own `value2 == null -> null` branch as a null test\n csharpDeclaredLocalResolverRowRead(expression, argumentExpression): string | undefined {\n if (!this.csharpIsMarketRowKeyRead(expression, argumentExpression)) {\n return undefined;\n }\n const recorded = this.csharpDeclaredLocalResolverType(expression);\n if (recorded === undefined || CSHARP_NATIVE_DICTIONARY_TYPES.indexOf(recorded) < 0) {\n return undefined;\n }\n const receiver = this.printNode(expression, 0);\n const printedKey = this.printNode(argumentExpression, 0);\n return `(${receiver} != null && ${receiver}.ContainsKey(${printedKey}) ? ${receiver}[${printedKey}] : null)`;\n }\n\n // a read of a hand-written BaseExchange dictionary field whose key may be absent: the key\n // test plus the indexer print what the helper computes, so a missing key still reads null\n // (a bare indexer would throw). Any other receiver or a numeric key keeps the helper\n csharpMissingKeyFieldRead(expression, argumentExpression, isStringKey): string | undefined {\n if (!isStringKey) {\n return undefined;\n }\n if (!isPropertyAccessExpression(expression) || expression.expression.kind !== SyntaxKind.ThisKeyword) {\n return undefined;\n }\n const name = expression.name?.text as string;\n if (CSHARP_MISSING_KEY_FIELDS_NATIVE.indexOf(name) < 0) {\n return undefined;\n }\n const field = this.printNode(expression, 0);\n const printedKey = this.printNode(argumentExpression, 0);\n // `urls`/`markets`/`exceptions` are declared `object`: same cast and null-receiver branch as the\n // transpiled helper body (initializeProperties may leave the box null when describe() has no such\n // row). `has`/`options` are concrete dictionaries, never null, so they need no test.\n if (CSHARP_OBJECT_DICT_FIELDS.indexOf(name) >= 0) {\n const receiver = `((IDictionary)${field})`;\n return `(${field} != null && ${receiver}.ContainsKey(${printedKey}) ? ${receiver}[${printedKey}] : null)`;\n }\n return `(${field}.ContainsKey(${printedKey}) ? ${field}[${printedKey}] : null)`;\n }\n\n // A literal-key read on a local whose C# declaration is already a collection: no cast needed, but\n // the indexer throws where GetValue answers null, so the native form carries the helper's key/index\n // and null-receiver tests. Only an Identifier qualifies (its text is read up to three times).\n csharpDeclaredCollectionRead(node, expression, argumentExpression, isStringKey, isNumberKey): string | undefined {\n if (!isIdentifier(expression)) {\n return undefined;\n }\n if (CSHARP_MARKET_RECEIVER_NAMES.indexOf(expression.text as string) >= 0) {\n return undefined;\n }\n const csharpType = this.csharpDeclaredCollectionType(expression);\n if (csharpType === undefined) {\n return undefined;\n }\n const func = this.csharpEnclosingFunction(node);\n if (func === undefined || this.csharpReceiverIsRewritten(func, expression)) {\n return undefined; // a reassigned receiver is not the object the declared type describes\n }\n const receiver = this.printNode(expression, 0);\n if (csharpType.indexOf('Dictionary<') >= 0) {\n if (!isStringKey) {\n return undefined; // the helper reads a dictionary key as a string, a literal index has no native twin\n }\n const printedKey = this.printNode(argumentExpression, 0);\n return `(${receiver} != null && ${receiver}.ContainsKey(${printedKey}) ? ${receiver}[${printedKey}] : null)`;\n }\n if (isNumberKey) {\n const index = Number((argumentExpression as any).text);\n if (!Number.isInteger(index) || (index < 0)) {\n return undefined; // the helper throws on a negative index too, but never prints one itself\n }\n return `(${receiver} != null && ${index} < ${receiver}.Count ? ${receiver}[${index}] : null)`;\n }\n return undefined;\n }\n\n // The C# collection type a local read was DECLARED with: printed by this printer, or recorded by\n // embedding build layer for a declaration it retyped (csharpDeclaredLocalTypeResolver). The\n // value-type oracle does not qualify: the declaration may still be `object` and not compile.\n csharpDeclaredCollectionType(expression): string | undefined {\n const named = this.csharpTypedLocalType(expression);\n if (named !== undefined && CSHARP_NATIVE_COLLECTION_TYPES.indexOf(named) >= 0) {\n return named;\n }\n if (this.csharpDeclaredLocalTypeResolver === undefined) {\n return undefined;\n }\n const declaration = this.getChecker().getSymbolAtLocation(expression)?.valueDeclaration?.resolve();\n if (declaration === undefined) {\n return undefined;\n }\n const recorded = this.csharpDeclaredLocalTypeResolver(declaration);\n return (recorded !== undefined && CSHARP_NATIVE_COLLECTION_TYPES.indexOf(recorded) >= 0) ? recorded : undefined;\n }\n\n // A literal-key read on a local still declared `object` but whose box the build layer's value-type\n // oracle (build/csharp-local-types.js) proves a dictionary: the cast makes the read compile, and\n // key test plus null guard return exactly what the helper does. Sibling arms are filtered first.\n csharpProvenDictionaryRead(node, expression, argumentExpression, isStringKey): string | undefined {\n if (!isStringKey || !isIdentifier(expression)) {\n return undefined;\n }\n if (CSHARP_MARKET_RECEIVER_NAMES.indexOf(expression.text as string) >= 0) {\n return undefined;\n }\n if (this.csharpTypedLocalType(expression) !== undefined) {\n return undefined; // the declaration this printer wrote names its own type (see above)\n }\n const proven = this.csharpExpressionTypeOf(expression);\n if (proven === undefined || CSHARP_NATIVE_DICTIONARY_TYPES.indexOf(proven) < 0) {\n return undefined; // only a proven dictionary box has the members the read binds\n }\n const func = this.csharpEnclosingFunction(node);\n if (func === undefined || this.csharpReceiverIsRewritten(func, expression)) {\n return undefined; // a reassigned receiver may hold another box at this read\n }\n const local = this.printNode(expression, 0);\n const receiver = `((IDictionary)${local})`;\n const printedKey = this.printNode(argumentExpression, 0);\n return `(${local} != null && ${receiver}.ContainsKey(${printedKey}) ? ${receiver}[${printedKey}] : null)`;\n }\n\n // the read sits in a branch that a `key in recv` guard admitted: same then-branch as the\n // guard, the else-branch of a negated guard, or after an early-exiting `if (!(key in recv))`\n csharpKeyPresenceGuarded(node, expression, key): boolean {\n const func = this.csharpEnclosingFunction(node);\n if (func === undefined) {\n return false;\n }\n const guards = this.csharpInGuardsOf(func).get(expression.getText() + GUARD_KEY_SEPARATOR + key);\n if (guards === undefined || !this.csharpReceiverIsDictionaryLike(expression, key)) {\n return false;\n }\n if (this.csharpReceiverIsRewritten(func, expression)) {\n return false; // a reassigned receiver is not the object the guard inspected\n }\n if (this.csharpHasKeyRemoval(func, expression, key)) {\n return false; // delete could have removed the guarded key\n }\n return guards.some((guard) => this.csharpGuardAdmitsRead(guard, node));\n }\n\n // `recv[i]` where `i` is the counter of an enclosing `for (...; i < recv.length; ...)`: that\n // condition is the range proof, so the helper's out-of-range null branch is unreachable. Both\n // operands must print as the indexer's C# types (object-element list, `int`); else keep the helper.\n csharpLoopIndexListRead(expression, argumentExpression): string | undefined {\n if (!isIdentifier(expression) || !isIdentifier(argumentExpression)) {\n return undefined;\n }\n const receiverType = this.csharpExpressionTypeOf(expression);\n if (receiverType === undefined || !this.csharpTypeIsList(receiverType)) {\n return undefined;\n }\n if (this.csharpExpressionTypeOf(argumentExpression) !== 'int') {\n return undefined; // a boxed/Int64/double index does not bind the List indexer\n }\n const loop = this.csharpCounterRangeLoop(argumentExpression, expression);\n if (loop === undefined) {\n return undefined;\n }\n if (!this.csharpCounterUnwrittenIn(loop.statement, argumentExpression) ||\n !this.csharpReceiverIntactIn(loop.statement, expression)) {\n return undefined; // the bound the header proved no longer holds at this read\n }\n return `${this.printNode(expression, 0)}[${this.printNode(argumentExpression, 0)}]`;\n }\n\n // the enclosing `for` whose condition is ` < .length` and whose header declares\n // that counter: the condition held on entry to this pass and nothing in between moved off it\n csharpCounterRangeLoop(counter, receiver) {\n let node: any = counter;\n while (node.parent !== undefined) {\n const parent: any = node.parent;\n if (isFunctionLike(parent)) {\n return undefined; // a closure runs when the counter may already have moved on\n }\n if (isForStatement(parent) && this.csharpContains(parent.statement, counter) && this.csharpForBoundsCounter(parent, counter, receiver)) {\n return parent;\n }\n node = parent;\n }\n return undefined;\n }\n\n csharpForBoundsCounter(loop, counter, receiver): boolean {\n const condition = this.csharpUnparenthesized(loop.condition);\n if (condition?.kind !== SyntaxKind.BinaryExpression || condition.operatorToken.kind !== SyntaxKind.LessThanToken) {\n return false;\n }\n const left = this.csharpUnparenthesized(condition.left);\n const right = this.csharpUnparenthesized(condition.right);\n if (!isIdentifier(left) || !isPropertyAccessExpression(right) || right.name?.text !== 'length') {\n return false;\n }\n const receiverExpression = this.csharpUnparenthesized(right.expression);\n if (!isIdentifier(receiverExpression) || !this.csharpCounterStartsAtZero(loop, counter) || !this.csharpCounterAdvances(loop, counter)) {\n return false;\n }\n const declaration = this.getChecker().getSymbolAtLocation(counter)?.valueDeclaration?.resolve();\n const checker = this.getChecker();\n return declaration !== undefined &&\n checker.getSymbolAtLocation(left)?.valueDeclaration?.resolve() === declaration &&\n checker.getSymbolAtLocation(receiverExpression)?.valueDeclaration?.resolve() === checker.getSymbolAtLocation(receiver)?.valueDeclaration?.resolve();\n }\n\n // `for (let i = = 0>; ...)` — a negative start would index below the list\n csharpCounterStartsAtZero(loop, counter): boolean {\n const initializer: any = loop.initializer;\n if (initializer?.kind !== SyntaxKind.VariableDeclarationList || initializer.declarations.length !== 1) {\n return false;\n }\n const declaration: any = initializer.declarations[0];\n if (!isIdentifier(declaration.name) || !isNumericLiteral(declaration.initializer)) {\n return false;\n }\n return Number(declaration.initializer.text) >= 0 && this.getChecker().getSymbolAtLocation(counter)?.valueDeclaration?.resolve() === declaration;\n }\n\n // the header moves the counter forward: a decrement could leave a negative index behind\n csharpCounterAdvances(loop, counter): boolean {\n const declaration = this.getChecker().getSymbolAtLocation(counter)?.valueDeclaration?.resolve();\n const incrementor: any = this.csharpUnparenthesized(loop.incrementor);\n if (incrementor === undefined || declaration === undefined) {\n return false;\n }\n if (incrementor.kind === SyntaxKind.PostfixUnaryExpression || incrementor.kind === SyntaxKind.PrefixUnaryExpression) {\n return incrementor.operator === SyntaxKind.PlusPlusToken &&\n this.getChecker().getSymbolAtLocation(incrementor.operand)?.valueDeclaration?.resolve() === declaration;\n }\n if (incrementor.kind === SyntaxKind.BinaryExpression && incrementor.operatorToken.kind === SyntaxKind.PlusEqualsToken) {\n return this.getChecker().getSymbolAtLocation(incrementor.left)?.valueDeclaration?.resolve() === declaration &&\n isNumericLiteral(incrementor.right) && Number(incrementor.right.text) >= 0;\n }\n return false;\n }\n\n // a write to the counter in the body invalidates the bound the condition proved\n csharpCounterUnwrittenIn(range, counter): boolean {\n const declaration = this.getChecker().getSymbolAtLocation(counter)?.valueDeclaration?.resolve();\n if (declaration === undefined) {\n return false;\n }\n let written = false;\n this.csharpWalkIdentifiers(range, (identifier: any) => {\n if (written || !this.csharpIsSameDeclaration(identifier, declaration)) {\n return;\n }\n const parent: any = identifier.parent;\n if (isBinaryExpression(parent) && parent.left === identifier) {\n written = CSHARP_ASSIGNMENT_OPERATOR_KINDS.indexOf(parent.operatorToken.kind) >= 0;\n } else {\n written = ((isPrefixUnaryExpression(parent) || isPostfixUnaryExpression(parent)) && parent.operand === identifier)\n || isDeleteExpression(parent);\n }\n });\n return !written;\n }\n\n // the condition's `.length` still proves the range only while the list is intact: inside\n // the body the receiver may be read (element reads, its own `.length`) and nothing else\n csharpReceiverIntactIn(range, receiver): boolean {\n const declaration = this.getChecker().getSymbolAtLocation(receiver)?.valueDeclaration?.resolve();\n if (declaration === undefined) {\n return false;\n }\n let intact = true;\n this.csharpWalkIdentifiers(range, (identifier: any) => {\n if (!intact || !this.csharpIsSameDeclaration(identifier, declaration)) {\n return;\n }\n const parent: any = identifier.parent;\n if (isPropertyAccessExpression(parent) && parent.expression === identifier && parent.name?.text === 'length') {\n return;\n }\n if (isElementAccessExpression(parent) && parent.expression === identifier && !this.csharpIsWriteTarget(parent)) {\n return;\n }\n intact = false;\n });\n return intact;\n }\n\n csharpIsSameDeclaration(identifier, declaration): boolean {\n return this.getChecker().getSymbolAtLocation(identifier)?.valueDeclaration?.resolve() === declaration;\n }\n\n csharpWalkIdentifiers(node, visit) {\n if (node === undefined) {\n return;\n }\n if (isIdentifier(node)) {\n visit(node);\n }\n node.forEachChild((child: any) => this.csharpWalkIdentifiers(child, visit));\n }\n\n // `x[i] = v` / `x[i]++` / `delete x[i]` change the receiver in place\n csharpIsWriteTarget(node): boolean {\n let value: any = node;\n while (value.parent !== undefined && isParenthesizedExpression(value.parent)) {\n value = value.parent;\n }\n const parent: any = value.parent;\n if (parent === undefined) {\n return false;\n }\n if (isBinaryExpression(parent) && parent.left === value) {\n return CSHARP_ASSIGNMENT_OPERATOR_KINDS.indexOf(parent.operatorToken.kind) >= 0;\n }\n if ((isPrefixUnaryExpression(parent) || isPostfixUnaryExpression(parent)) && parent.operand === value) {\n return (parent.operator === SyntaxKind.PlusPlusToken) || (parent.operator === SyntaxKind.MinusMinusToken);\n }\n return isDeleteExpression(parent);\n }\n\n csharpUnparenthesized(node) {\n let value: any = node;\n while (value !== undefined && value.kind === SyntaxKind.ParenthesizedExpression) {\n value = value.expression;\n }\n return value;\n }\n\n csharpGuardAdmitsRead(guard, read): boolean {\n const negated = this.csharpGuardIsNegated(guard);\n let statement: any = guard;\n while (statement !== undefined && statement.parent !== undefined) {\n const parent: any = statement.parent;\n if (isIfStatement(parent) && this.csharpContains(parent.expression, guard)) {\n if (!negated && this.csharpContains(parent.thenStatement, read)) {\n return true;\n }\n if (negated && parent.elseStatement !== undefined && this.csharpContains(parent.elseStatement, read)) {\n return true;\n }\n // `if (!(key in recv)) { return/throw/continue; }` then the read after it\n if (negated && this.csharpAlwaysExits(parent.thenStatement) &&\n read.getStart() >= parent.getEnd() && this.csharpContains(parent.parent, read)) {\n return true;\n }\n return false;\n }\n if (isWhileStatement(parent) && this.csharpContains(parent.expression, guard)) {\n return !negated && this.csharpContains(parent.statement, read);\n }\n statement = parent;\n }\n return false;\n }\n\n // `key in recv` guards in the function body, indexed by receiver text + key; nested\n // functions are skipped, their guards cannot dominate a read of the outer function\n csharpInGuardsOf(func): Map {\n const cached = this.csharpGuardIndex.get(func);\n if (cached !== undefined) {\n return cached;\n }\n const index: Map = new Map();\n const collect = (n: any) => {\n if (n !== func && isFunctionLike(n)) {\n return;\n }\n if (isBinaryExpression(n) && n.operatorToken.kind === SyntaxKind.InKeyword) {\n const keyNode: any = n.left;\n if (isStringLiteralLikeNode(keyNode) || isNumericLiteral(keyNode)) {\n const id = n.right.getText() + GUARD_KEY_SEPARATOR + keyNode.text;\n const list = index.get(id);\n if (list === undefined) {\n index.set(id, [ n ]);\n } else {\n list.push(n);\n }\n }\n }\n n.forEachChild(collect);\n };\n collect(func);\n this.csharpGuardIndex.set(func, index);\n return index;\n }\n\n // the read's receiver is a local whose only initializer is a literal that declares the\n // key, and the local is not reassigned or deleted from afterwards\n csharpLiteralDeclaresKey(node, expression, key, isNumberKey): boolean {\n if (!isIdentifier(expression)) {\n return false;\n }\n const symbol: any = this.getChecker().getSymbolAtLocation(expression);\n const declarations: any = (symbol?.declarations ?? []).map((d) => d.resolve());\n if (declarations.length !== 1 || !isVariableDeclaration(declarations[0])) {\n return false;\n }\n const declaration: any = declarations[0];\n if (declaration.initializer === undefined || declaration.getStart() >= node.getStart()) {\n return false;\n }\n const initializer = declaration.initializer;\n let declares = false;\n if (isNumberKey && isArrayLiteralExpression(initializer)) {\n const spread = initializer.elements.some((element: any) => isSpreadElement(element));\n declares = !spread && Number(key) < initializer.elements.length;\n } else if (!isNumberKey && isObjectLiteralExpression(initializer)) {\n declares = this.csharpObjectLiteralDeclaresKey(initializer, key);\n }\n if (!declares) {\n return false;\n }\n const func = this.csharpEnclosingFunction(node);\n return func !== undefined && !this.csharpReceiverIsRewritten(func, expression);\n }\n\n csharpObjectLiteralDeclaresKey(literal, key): boolean {\n for (const property of literal.properties) {\n if (isSpreadAssignment(property)) {\n return false; // spread keys cannot be enumerated\n }\n const name: any = (property as any).name;\n if (name !== undefined && (isIdentifier(name) || isStringLiteralLikeNode(name) || isNumericLiteral(name)) && name.text === key) {\n return true;\n }\n }\n return false;\n }\n\n // the receiver must be a dictionary at runtime for the IDictionary cast to hold; `any`\n // receivers are rejected because the checker cannot tell what the read reaches\n csharpReceiverIsDictionaryLike(expression, key): boolean {\n const type: any = this.getChecker().getTypeAtLocation(expression);\n if (type.flags === TypeFlags.Any || type.flags === TypeFlags.Unknown) {\n return false;\n }\n const checker = this.getChecker();\n return checker.getIndexInfoOfType(type, IndexKind.String) !== undefined ||\n checker.getPropertyOfType(type, key) !== undefined;\n }\n\n // any assignment to the receiver (or to a same-named binding) in the function makes the\n // object the read evaluates unprovable, so the read falls back to the helper\n csharpReceiverIsRewritten(func, expression): boolean {\n const text = expression.getText();\n const name = isIdentifier(expression) ? text : text.split(/[.[]/)[1];\n if (name === undefined) {\n return true;\n }\n let rewritten = false;\n const walk = (n: any) => {\n if (rewritten) {\n return;\n }\n if (isIdentifier(n) && n.text === name) {\n const parent: any = n.parent;\n rewritten = (isBinaryExpression(parent) && parent.left === n)\n || ((isPrefixUnaryExpression(parent) || isPostfixUnaryExpression(parent)) && parent.operand === n)\n || isDeleteExpression(parent);\n }\n n.forEachChild(walk);\n };\n walk(func);\n return rewritten;\n }\n\n // ===== ws handler `message` parameter (batch D, D-19) =====\n // A ws handler `handleX (client: Client, message: Dict)` is reached at runtime either\n // through a dispatch-table entry (`{ \"k\", this.handleX }` -> DynamicInvoker) or a direct\n csharpHandlerMessageType(param): string | undefined {\n if (this.csharpHandlerMessageTypes.has(param)) {\n return this.csharpHandlerMessageTypes.get(param);\n }\n let result: string | undefined = undefined;\n const method: any = param?.parent;\n if (isMethodDeclaration(method) && (method.parameters.length >= 2) && (method.parameters[1] === param)) {\n if ((this.csharpCheckerTypeName(method.parameters[0]) === 'Client') &&\n (this.csharpCheckerTypeName(param) === 'Dict') &&\n (this.getMethodOverride(method) === undefined) &&\n !this.csharpReceiverIsRewritten(method, param.name) &&\n !this.csharpHandlerIsCalled(method) &&\n !this.csharpClassHasListRoute(method)) {\n result = this.ArgTypeReplacements['Dict'] ?? 'Dictionary';\n }\n }\n this.csharpHandlerMessageTypes.set(param, result);\n return result;\n }\n\n // the type name the checker prints for a node's type, or undefined in an in-memory\n // program (no checker answer: the printer keeps its own)\n csharpCheckerTypeName(node): string | undefined {\n if (node === undefined) {\n return undefined;\n }\n try {\n const checker = this.getChecker();\n const type = checker.getTypeAtLocation(node);\n return (type === undefined) ? undefined : checker.typeToString(type);\n } catch (e) {\n return undefined;\n }\n }\n\n csharpEnclosingClass(node): any | undefined {\n let current: any = node?.parent;\n while (current !== undefined) {\n if (isClassDeclaration(current) || isClassExpression(current)) {\n return current;\n }\n current = current.parent;\n }\n return undefined;\n }\n\n // the identifier is the raw `message` parameter of a handler-shaped method (a `Client`\n // first parameter, so `handleMessage` with its `any` annotation included): the class can\n // route that same value through its list arm\n csharpIsHandlerMessageIdentifier(node): boolean {\n if (!isIdentifier(node)) {\n return false;\n }\n try {\n const declaration: any = this.getChecker().getSymbolAtLocation(node)?.valueDeclaration?.resolve();\n if ((declaration === undefined) || !isParameterDeclaration(declaration)) {\n return false;\n }\n const owner: any = declaration.parent;\n return isMethodDeclaration(owner) && (owner.parameters.length >= 2) &&\n (owner.parameters[1] === declaration) && (this.csharpCheckerTypeName(owner.parameters[0]) === 'Client');\n } catch (e) {\n return false;\n }\n }\n\n // a class that tests the message (or another dict parameter) for a list can hand the\n // array itself to a dispatch-table entry (binance `'x@arr'`), so its handlers keep the\n // box; a class testing unrelated lists (an array-typed `symbols` parameter, a field of\n csharpClassHasListRoute(method): boolean {\n const cls = this.csharpEnclosingClass(method);\n if (cls === undefined) {\n return true; // no class, no proof\n }\n const cached = this.csharpListRouteClasses.get(cls);\n if (cached !== undefined) {\n return cached;\n }\n let found = false;\n const walk = (n: any) => {\n if (found) {\n return;\n }\n if (isCallExpression(n) && isPropertyAccessExpression(n.expression) &&\n ((n.expression as any).expression?.text === 'Array') && ((n.expression as any).name?.text === 'isArray')) {\n const argument: any = n.arguments[0];\n if (this.csharpIsHandlerMessageIdentifier(argument)) {\n found = true;\n return;\n }\n }\n n.forEachChild(walk);\n };\n walk(cls);\n this.csharpListRouteClasses.set(cls, found);\n return found;\n }\n\n // a static call reference (`this.handleX (…)`) binds the argument to the printed\n // signature; a method-group value (a dispatch-table entry) does not\n csharpHandlerIsCalled(method): boolean {\n const cached = this.csharpHandlerCalled.get(method);\n if (cached !== undefined) {\n return cached;\n }\n let called = true; // no symbol answer: keep the box\n const cls = this.csharpEnclosingClass(method);\n let file: any;\n try {\n file = method.getSourceFile();\n } catch (e) {\n file = undefined;\n }\n if ((cls !== undefined) && (file !== undefined)) {\n try {\n const symbol = this.getChecker().getSymbolAtLocation(method.name);\n if (symbol !== undefined) {\n called = this.csharpHandlerCallIndexFor(file).get(symbol) === true;\n }\n } catch (e) {\n called = true;\n }\n }\n this.csharpHandlerCalled.set(method, called);\n return called;\n }\n\n // every identifier of the FILE that resolves to one of its classes' own method names,\n // recorded as a call when it is the callee of a call expression; keyed by symbol, so a\n // same-named method of another class never marks this one\n csharpHandlerCallIndexFor(file): Map {\n const cached = this.csharpHandlerCallIndex.get(file);\n if (cached !== undefined) {\n return cached;\n }\n const names = new Set();\n const collect = (n: any) => {\n if (isClassDeclaration(n) || isClassExpression(n)) {\n for (const member of n.members) {\n const name: any = (member as any).name?.text;\n if (isMethodDeclaration(member) && (name !== undefined)) {\n names.add(name);\n }\n }\n }\n n.forEachChild(collect);\n };\n collect(file);\n const index = new Map();\n if (names.size > 0) {\n let checker;\n try {\n checker = this.getChecker();\n } catch (e) {\n checker = undefined;\n }\n if (checker !== undefined) {\n const walk = (n: any) => {\n if (isIdentifier(n) && names.has(n.text as string)) {\n let symbol;\n try {\n symbol = checker.getSymbolAtLocation(n);\n } catch (e) {\n symbol = undefined;\n }\n if (symbol !== undefined) {\n const parent: any = n.parent;\n const isCall = (isPropertyAccessExpression(parent) && (parent.name === n) &&\n isCallExpression(parent.parent) && (parent.parent.expression === parent)) ||\n (isCallExpression(parent) && (parent.expression === n));\n if (isCall) {\n index.set(symbol, true);\n } else if (index.get(symbol) === undefined) {\n index.set(symbol, false);\n }\n }\n }\n n.forEachChild(walk);\n };\n walk(file);\n }\n }\n this.csharpHandlerCallIndex.set(file, index);\n return index;\n }\n\n csharpHasKeyRemoval(func, expression, key): boolean {\n const text = expression.getText();\n let removed = false;\n const walk = (n: any) => {\n if (removed) {\n return;\n }\n if (isDeleteExpression(n) && isElementAccessExpression(n.expression) &&\n n.expression.expression.getText() === text && n.expression.argumentExpression.getText().replace(/['\"]/g, '') === key.replace(/['\"]/g, '')) {\n removed = true;\n }\n n.forEachChild(walk);\n };\n walk(func);\n return removed;\n }\n\n csharpGuardIsNegated(guard): boolean {\n let node: any = guard;\n while (node.parent !== undefined && isParenthesizedExpression(node.parent)) {\n node = node.parent;\n }\n return node.parent !== undefined && isPrefixUnaryExpression(node.parent) &&\n node.parent.operator === SyntaxKind.ExclamationToken;\n }\n\n csharpAlwaysExits(statement): boolean {\n if (statement === undefined) {\n return false;\n }\n const exits = (n: any) => isReturnStatement(n) || isThrowStatement(n) || isContinueStatement(n) || isBreakStatement(n);\n if (exits(statement)) {\n return true;\n }\n if (isBlock(statement) && statement.statements.length > 0) {\n return exits(statement.statements[statement.statements.length - 1]);\n }\n return false;\n }\n\n csharpContains(outer, inner): boolean {\n if (outer === undefined || inner === undefined) {\n return false;\n }\n return inner.getStart() >= outer.getStart() && inner.getEnd() <= outer.getEnd();\n }\n // cs-strict S14: `((List)x)[i] = v` needs no cast when the PRINTED declaration is\n // `List` (identity conversion; not IList, a checked downcast). Type comes via the\n // `csharpLocalTypeOf` hook; `x[i] += v` and reads stay on the base path (third override layer).\n csharpElementAccessReceiverIsList(node) {\n if (node?.kind !== SyntaxKind.ElementAccessExpression) {\n return false;\n }\n const parent = node.parent;\n if (parent?.kind !== SyntaxKind.BinaryExpression || parent.operatorToken?.kind !== SyntaxKind.EqualsToken || parent.left !== node) {\n return false;\n }\n const receiver = node.expression;\n if (receiver?.kind !== SyntaxKind.Identifier) {\n return false;\n }\n const localTypeOf = (this as any).csharpLocalTypeOf;\n return (typeof localTypeOf === 'function') && (localTypeOf.call(this, receiver) === 'List');\n }\n\n // The C# declared type pair of a list index READ (`x[i]`): receiver (`List` /\n // `IList`) and index (`int`). Consumer-installed (build/csharp-local-types.js);\n // undefined by default, so an unpatched printer keeps `getValue (x, i)` for every read.\n csharpListIndexReadTypes(node): { receiver: string, index: string } | undefined {\n return undefined; // stub to override\n }\n\n // `x[i]` read on a list receiver: the helper answers null off the end while the C# indexer throws,\n // so the native read is only emitted where the source proves the index in range. Types come from\n // the consumer hook above, so the untyped emission is byte-identical.\n csharpListIndexRead(node): string | undefined {\n if (node?.kind !== SyntaxKind.ElementAccessExpression) {\n return undefined;\n }\n const { expression, argumentExpression } = node;\n if (expression?.kind !== SyntaxKind.Identifier || argumentExpression?.kind !== SyntaxKind.Identifier) {\n return undefined;\n }\n if (this.csharpIsSetOrAddTarget(node)) {\n return undefined; // element writes print through the cast path\n }\n const types = (typeof this.csharpListIndexReadTypes === 'function') ? this.csharpListIndexReadTypes(node) : undefined;\n if (types?.index !== 'int') {\n return undefined; // only an int index binds the List indexer\n }\n if ((types.receiver !== 'List') && (types.receiver !== 'IList')) {\n return undefined;\n }\n if (!this.csharpIndexIsLoopBounded(node, expression, argumentExpression)) {\n return undefined;\n }\n return this.printNode(expression, 0) + '[' + this.printNode(argumentExpression, 0) + ']';\n }\n\n // the read sits in the body of a `for` that re-tests `index < receiver.length`, both\n // resolved to the very symbols the read uses, and nothing in the body can move either\n csharpIndexIsLoopBounded(read, receiver, index): boolean {\n const receiverSymbol = this.csharpIdentifierSymbol(receiver);\n const indexSymbol = this.csharpIdentifierSymbol(index);\n if (receiverSymbol === undefined || indexSymbol === undefined) {\n return false;\n }\n let node: any = read;\n while (node?.parent !== undefined) {\n const parent: any = node.parent;\n if (isFunctionLike(parent)) {\n return false; // a read under a nested function is not dominated by the condition\n }\n if (isForStatement(parent) && this.csharpForBoundsIndex(parent, read, receiverSymbol, indexSymbol)) {\n return true;\n }\n node = parent;\n }\n return false;\n }\n\n csharpIdentifierSymbol(node): any {\n if (node?.kind !== SyntaxKind.Identifier) {\n return undefined;\n }\n return this.checkerOrUndefined()?.getSymbolAtLocation(node);\n }\n\n csharpForBoundsIndex(forStatement, read, receiverSymbol, indexSymbol): boolean {\n if (!this.csharpContains(forStatement.statement, read)) {\n return false; // the read is in the loop header, not the body\n }\n const condition: any = forStatement.condition;\n if (condition?.kind !== SyntaxKind.BinaryExpression || condition.operatorToken?.kind !== SyntaxKind.LessThanToken) {\n return false;\n }\n const length: any = condition.right;\n if (length?.kind !== SyntaxKind.PropertyAccessExpression || length.name?.text !== 'length') {\n return false;\n }\n if (this.csharpIdentifierSymbol(condition.left) !== indexSymbol) {\n return false;\n }\n if (this.csharpIdentifierSymbol(this.csharpLengthReceiverIdentifier(length.expression)) !== receiverSymbol) {\n return false;\n }\n return !this.csharpIndexBoundIsVoided(forStatement.statement, receiverSymbol, indexSymbol);\n }\n\n // The identifier a `.length` receiver reads through wrappers whose C# print is the bare text:\n // parentheses, and `as T` where printAsExpression does not cast (`any`/`string`/`T[]` print a cast,\n // so the bound would not be the receiver's Count). `(response as List).length` -> `?.Count ?? 0`\n csharpLengthReceiverIdentifier(node): any {\n let current: any = node;\n while (current !== undefined) {\n if (current.kind === SyntaxKind.ParenthesizedExpression) {\n current = current.expression;\n continue;\n }\n if (current.kind === SyntaxKind.AsExpression && current.type !== undefined\n && current.type.kind !== SyntaxKind.AnyKeyword\n && current.type.kind !== SyntaxKind.StringKeyword\n && current.type.kind !== SyntaxKind.ArrayType) {\n current = current.expression;\n continue;\n }\n break;\n }\n return current;\n }\n\n // the condition ran before the body did: a write to the index, or any use of the receiver\n // other than an element access / a property read (a method call, an argument, a bare read —\n // anything that could hand the list to something that shrinks it) voids the bound\n csharpIndexBoundIsVoided(body, receiverSymbol, indexSymbol): boolean {\n let voided = false;\n const visit = (n: any) => {\n if (voided || n === undefined) {\n return;\n }\n if (n.kind === SyntaxKind.Identifier) {\n const symbol = this.csharpIdentifierSymbol(n);\n if (symbol === indexSymbol && this.csharpIdentifierIsWritten(n)) {\n voided = true;\n return;\n }\n if (symbol === receiverSymbol && !this.csharpReceiverUseKeepsBound(n)) {\n voided = true;\n return;\n }\n }\n n.forEachChild(visit);\n };\n body.forEachChild(visit);\n return voided;\n }\n\n // a use that cannot move the value the condition tested: the expression of an element\n // access (`recv[i]`, a read or an element write — neither changes the length) or of a\n // property READ (`recv.Count`); a property write or a call on the receiver is not one\n csharpReceiverUseKeepsBound(node): boolean {\n const parent: any = node.parent;\n if (parent === undefined) {\n return false;\n }\n if (parent.kind === SyntaxKind.ElementAccessExpression && parent.expression === node) {\n return true;\n }\n if (parent.kind === SyntaxKind.PropertyAccessExpression && parent.expression === node) {\n if (this.csharpIdentifierIsWritten(node)) {\n return false; // `recv.length = n`\n }\n const grand: any = parent.parent;\n return !(grand?.kind === SyntaxKind.CallExpression && grand.expression === parent);\n }\n return false;\n }\n\n // the identifier is a write target: `x = v`, `x += v`, `x++` / `x--`, a destructuring\n // element, or a property/element write through it (`x.length = 0`)\n csharpIdentifierIsWritten(node): boolean {\n const parent: any = node.parent;\n if (parent === undefined) {\n return false;\n }\n if (parent.kind === SyntaxKind.BinaryExpression && parent.left === node && this.csharpIsAssignmentOperator(parent.operatorToken.kind)) {\n return true;\n }\n if ((parent.kind === SyntaxKind.PrefixUnaryExpression || parent.kind === SyntaxKind.PostfixUnaryExpression)\n && (parent.operator === SyntaxKind.PlusPlusToken || parent.operator === SyntaxKind.MinusMinusToken)) {\n return true;\n }\n if (parent.kind === SyntaxKind.ArrayLiteralExpression || parent.kind === SyntaxKind.PropertyAccessExpression) {\n const grand: any = parent.parent;\n return grand?.kind === SyntaxKind.BinaryExpression && grand.left === parent && this.csharpIsAssignmentOperator(grand.operatorToken.kind);\n }\n return false;\n }\n\n // the node is the left side of `=` or `+=`\n csharpIsSetOrAddTarget(node): boolean {\n const parent: any = node.parent;\n return parent?.kind === SyntaxKind.BinaryExpression\n && (parent.operatorToken.kind === SyntaxKind.EqualsToken || parent.operatorToken.kind === SyntaxKind.PlusEqualsToken)\n && parent.left === node;\n }\n\n csharpIsAssignmentOperator(kind): boolean {\n return (kind >= SyntaxKind.FirstAssignment) && (kind <= SyntaxKind.LastAssignment);\n }\n\n // S22: an index WRITE (`x[\"k\"] = v`) needs no `((IDictionary)x)` cast when the\n // receiver's printed C# declaration already IS a dictionary. The ccxt classifier\n // (build/csharp-local-types.js) installs this predicate; undefined/false keeps the upstream cast.\n csharpDictionaryIndexWriteNeedsNoCast(node): boolean | undefined {\n return undefined;\n }\n // the consumer's classifier may prove the declared C# type of an element-access receiver\n // (`Dictionary` / `IDictionary`); consumer-installed, so an\n // answer of undefined keeps the untyped emission byte-identical\n csharpElementAccessTypedReceiver(node): string | undefined {\n return undefined;\n }\n\n // `recv[key]` read with a consumer-proven string-keyed dict receiver and a literal key: the typed\n // twin GetValue(IDictionary, string) runs the same dictionary read as the object\n // overload's dict branch without its runtime sniffing. Every other read keeps the wrapper.\n printTypedDictElementAccessIfAny(node) {\n if (this.csharpElementAccessTypedReceiver(node) === undefined) {\n return undefined;\n }\n const { expression, argumentExpression } = node;\n if (!isStringLiteralLikeNode(argumentExpression)) {\n return undefined; // the twin's key parameter is `string`; any other key keeps the object overload\n }\n if (this.csharpIsSetOrAddTarget(node)) {\n return undefined; // a write prints the dictionary element assignment, not this read\n }\n return 'GetValue(' + this.printNode(expression, 0) + ', ' + this.printNode(argumentExpression, 0) + ')';\n }\n\n printWrappedUnknownThisProperty(node) {\n const type = this.getChecker().getResolvedSignature(node);\n if (type?.declaration === undefined) {\n let parsedArguments = node.arguments?.map((a) => this.printNode(a, 0)).join(\", \");\n parsedArguments = parsedArguments ? parsedArguments : \"\";\n const propName = node.expression?.name.text;\n const nativeDelegateCall = this.csharpNativeDelegateCall(node, propName);\n if (nativeDelegateCall !== undefined) {\n return nativeDelegateCall;\n }\n // const isAsyncDecl = true;\n const isAsyncDecl = node?.parent?.kind === SyntaxKind.AwaitExpression;\n // const open = isAsyncDecl ? this.UKNOWN_PROP_ASYNC_WRAPPER_OPEN : this.UKNOWN_PROP_WRAPPER_OPEN;\n // const close = this.UNKOWN_PROP_WRAPPER_CLOSE;\n // return `${open}\"${propName}\"${parsedArguments}${close}`;\n const argsArray = `new object[] { ${parsedArguments} }`;\n const open = this.DYNAMIC_CALL_OPEN;\n let statement = `${open}this, \"${propName}\", ${argsArray})`;\n statement = isAsyncDecl ? `((Task)${statement})` : statement;\n return statement;\n }\n return undefined;\n }\n\n // A `this.(...)` call the checker cannot resolve on a function-valued property is a\n // delegate in the hand-written C# base, which `ResolveMethod` never finds (the helper throws\n // there); matching arity prints the same property invocation directly.\n csharpNativeDelegateCall(node, propName): string | undefined {\n const arity = CSHARP_NATIVE_THIS_DELEGATE_ARITY[propName as string];\n if (arity === undefined) {\n return undefined;\n }\n if (node?.parent?.kind === SyntaxKind.AwaitExpression) {\n return undefined; // the delegate returns object, not a Task\n }\n const args = node.arguments ?? [];\n if (args.length !== arity) {\n return undefined;\n }\n return `this.${propName as string}(${args.map((a) => this.printNode(a, 0)).join(\", \")})`;\n }\n\n printOutOfOrderCallExpressionIfAny(node, identation) {\n if (node.expression.kind === SyntaxKind.PropertyAccessExpression) {\n const expressionText = node.expression.getText().trim();\n const args = node.arguments;\n if (args.length === 1) {\n const parsedArg = this.printNode(args[0], 0);\n switch (expressionText) {\n // case \"JSON.parse\":\n // return `json_decode(${parsedArg}, $as_associative_array = true)`;\n case \"Math.abs\":\n return `Math.Abs(Convert.ToDouble(${parsedArg}))`;\n }\n } else if (args.length === 2)\n {\n const parsedArg1 = this.printNode(args[0], 0);\n const parsedArg2 = this.printNode(args[1], 0);\n switch (expressionText) {\n case \"Math.min\":\n return this.csharpNativeMathMinMax(node, 'Min', parsedArg1, parsedArg2) ?? `mathMin(${parsedArg1}, ${parsedArg2})`;\n case \"Math.max\":\n return this.csharpNativeMathMinMax(node, 'Max', parsedArg1, parsedArg2) ?? `mathMax(${parsedArg1}, ${parsedArg2})`;\n case \"Math.pow\":\n return `Math.Pow(Convert.ToDouble(${parsedArg1}), Convert.ToDouble(${parsedArg2}))`;\n }\n }\n const leftSide = node.expression?.expression;\n const leftSideText = leftSide ? this.printNode(leftSide, 0) : undefined;\n\n // wrap unknown property this.X calls\n if (leftSideText === this.THIS_TOKEN || leftSide.getFullText().indexOf(\"(this as any)\") > -1) { // double check this\n const res = this.printWrappedUnknownThisProperty(node);\n if (res) {\n return res;\n }\n }\n }\n\n // // replace this[method]() calls\n // const thisElementAccess = this.printThisElementAccesssIfNeeded(node, identation);\n // if (thisElementAccess) {\n // return thisElementAccess;\n // }\n\n // handle dynamic calls, this[method](A) or exchange[b] (c) using reflection\n if (node.expression.kind === SyntaxKind.ElementAccessExpression) {\n return this.printDynamicCall(node, identation);\n }\n\n\n return undefined;\n }\n\n handleTypeOfInsideBinaryExpression(node, identation) {\n const left = node.left;\n const right = node.right.text;\n const op = node.operatorToken.kind;\n const expression = left.expression;\n\n const isDifferentOperator = op === SyntaxKind.ExclamationEqualsEqualsToken || op === SyntaxKind.ExclamationEqualsToken;\n const notOperator = isDifferentOperator ? this.NOT_TOKEN : \"\";\n\n const target = this.printNode(expression, 0);\n switch (right) {\n case \"string\":\n return notOperator + `(${target} is string)`;\n case \"number\":\n return notOperator + `(${target} is Int64 || ${target} is int || ${target} is float || ${target} is double)`;\n case \"boolean\":\n return notOperator + `(${target} is bool)`;\n case \"object\":\n return notOperator + `(${target} is IDictionary)`;\n case \"function\":\n return notOperator + `(${target} is Delegate)`;\n }\n\n return undefined;\n\n }\n\n // The C# type of an operand of `==` / `!=` as the printer emits it, or undefined when\n // the printer only knows `object`: an `object` operand takes the reference-comparing\n // `operator ==`, so those keep the isEqual helper.\n csharpEqualityOperandType(node): string | undefined {\n if (node === undefined) {\n return undefined;\n }\n switch (node.kind) {\n case SyntaxKind.NullKeyword:\n return 'null';\n case SyntaxKind.TrueKeyword:\n case SyntaxKind.FalseKeyword:\n return 'bool';\n case SyntaxKind.NumericLiteral:\n return this.csharpNumericLiteralKind(node);\n case SyntaxKind.ParenthesizedExpression:\n return this.csharpEqualityOperandType(node.expression);\n case SyntaxKind.Identifier:\n // printIdentifier prints the `undefined` identifier as null\n if (node.text === 'undefined') {\n return 'null';\n }\n return this.csharpDeclaredTypeOfBinding(node) ?? this.csharpParameterOperandType(node);\n case SyntaxKind.PropertyAccessExpression: {\n const fieldType = this.csharpReferenceFieldType(node);\n return (fieldType === undefined) ? this.csharpTypeOfInitializer(node) : fieldType;\n }\n }\n if (isStringLiteralLikeNode(node)) {\n return 'string';\n }\n return this.csharpTypeOfInitializer(node);\n }\n\n // 'object' for a `this.` read of a hand-written field the table proves a reference box;\n // undefined otherwise. Only printInlineEquality's null branch accepts 'object', so the exact\n // field type is never claimed and the value-equality branches keep the helper.\n csharpReferenceFieldType(node): string | undefined {\n if (!isPropertyAccessExpression(node) || (node.expression?.kind !== SyntaxKind.ThisKeyword)) {\n return undefined;\n }\n const name = node.name?.text as string;\n if (CSHARP_REFERENCE_FIELDS_NATIVE.indexOf(name) < 0) {\n return undefined;\n }\n return this.csharpOperandIsValueTyped(node) ? undefined : 'object';\n }\n\n // the declaration behind an identifier read that is a plain method parameter; a\n // destructured or rest parameter prints a different declaration shape\n csharpParameterDeclaration(node): ParameterDeclaration | undefined {\n const declaration: any = (this.checkerOrUndefined() as any)?.getSymbolAtLocation(node)?.valueDeclaration?.resolve();\n if ((declaration === undefined) || !isParameterDeclaration(declaration)) {\n return undefined;\n }\n if (!isIdentifier(declaration.name) || (declaration.name.text !== node.text) || (declaration.dotDotDotToken !== undefined)) {\n return undefined;\n }\n return declaration;\n }\n\n // `object` for a parameter operand a null comparison compiles on, else undefined. An optional\n // parameter prints `object` / `string` / `Int64?` / `double?` / `bool?`; any other keeps the\n // helper unless its checker type holds no number/boolean member (a reference box).\n csharpParameterOperandType(node): string | undefined {\n const declaration = this.csharpParameterDeclaration(node);\n if (declaration === undefined) {\n return undefined;\n }\n if (this.csharpDeclarationPrintsNullComparable(declaration)) {\n return 'object'; // reference box or nullable value: only the null branch may use it\n }\n return this.csharpOperandIsValueTyped(node) ? undefined : 'object';\n }\n\n // Whether this parameter's printed C# type is a reference or nullable value, so `x == null`\n // compiles and is isEqual's null branch. optionalScalarCsharpType gives a nullable scalar only\n // when optional with no initializer or `= undefined`; required or real-default ones are non-null.\n csharpDeclarationPrintsNullComparable(declaration): boolean {\n const initializer = declaration.initializer;\n const optional = (declaration.questionToken !== undefined) || (initializer !== undefined);\n if (optional && ((initializer === undefined) || ((initializer.kind === SyntaxKind.Identifier) && (initializer.text === 'undefined')))) {\n return true;\n }\n return !this.csharpDeclarationHasValueScalar(declaration);\n }\n\n csharpDeclarationHasValueScalar(declaration): boolean {\n const checker: any = this.checkerOrUndefined();\n if (checker === undefined) {\n return true; // unknown: keep the helper\n }\n return this.csharpTypeHasValueScalar(checker.getTypeAtLocation(declaration));\n }\n\n // A numeric literal prints as an untyped C# constant that adapts to the operand on the\n // other side. isEqual's integer branches round-trip through Convert.ToInt64, which an\n // integer literal beyond 2^53 does not survive, so those stay on the helper.\n csharpNumericLiteralKind(node): string | undefined {\n const value = Number(node.text);\n if (!Number.isFinite(value) || (Number.isInteger(value) && !Number.isSafeInteger(value))) {\n return undefined;\n }\n return 'number';\n }\n\n // the C# type the declaration behind an identifier was printed with ('object' when the\n // printer named none), or undefined when the identifier is not a printed local\n csharpDeclaredTypeOfBinding(node): string | undefined {\n const declaration: any = (this.checkerOrUndefined() as any)?.getSymbolAtLocation(node)?.valueDeclaration?.resolve();\n if (declaration?.kind === SyntaxKind.VariableDeclaration) {\n return this.getCSharpLocalType(declaration);\n }\n if (declaration?.kind === SyntaxKind.BindingElement) {\n return 'var'; // `const [a, b] = ...` prints `var a = ((IList)...)[0]`\n }\n return undefined; // parameters are retyped after printing by the build script\n }\n\n // the C# operator family an operand belongs to: `==` compares two operands of one family\n // by value, exactly like the isEqual branches those types take\n csharpValueEqualityKind(csharpType): string | undefined {\n switch (csharpType) {\n case 'string':\n case 'string?':\n return 'string';\n case 'bool':\n case 'bool?':\n return 'bool';\n case 'double':\n case 'double?':\n return 'double';\n case 'Int64':\n case 'long':\n case 'Int64?':\n case 'long?':\n return 'Int64';\n case 'int':\n case 'int?':\n return 'int';\n case 'number':\n return 'number'; // numeric literal, adapts to the numeric operand it is compared with\n }\n return undefined;\n }\n\n // `x == null` compiles — and matches isEqual — for reference types and nullable value\n // types, but not for a non-nullable value type (double / bool / Int64 / int). Lists,\n // dictionaries, class instances and `var` are references, and are the only types left\n // once csharpValueEqualityKind has claimed the value-typed names above.\n csharpIsNullComparableType(csharpType): boolean {\n if ((csharpType === undefined) || (csharpType === '') || (csharpType === 'null')) {\n return false;\n }\n if (csharpType.endsWith('?')) {\n return true;\n }\n if ((csharpType === 'object') || (csharpType === 'string')) {\n return true;\n }\n return (this.csharpValueEqualityKind(csharpType) === undefined);\n }\n\n // `x == null` compiles and matches isEqual's null branch when x's printed type is a\n // reference box or a nullable value type: the operand table's declared types, an optional\n // parameter, or a box the checker proves holds no number/boolean scalar.\n csharpOperandIsNullComparable(node): boolean {\n const declaration = this.csharpParameterDeclaration(node);\n if ((declaration !== undefined) && this.csharpDeclarationPrintsNullComparable(declaration)) {\n return true;\n }\n return !this.csharpOperandIsValueTyped(node);\n }\n\n // U55: the null-comparison rule's gate, stricter than csharpIsNullComparableType above:\n // only a type the hook names (the emitted declaration's own text) is accepted, `object` /\n // `var` included in the refusal because those are the boxes the classifier did not name.\n csharpNullComparisonTypeIsProvable(csharpType): boolean {\n if ((csharpType === undefined) || (csharpType === '') || (csharpType === 'object') || (csharpType === 'var') || (csharpType === 'null')) {\n return false;\n }\n if (csharpType.endsWith('?')) {\n return true;\n }\n return CSHARP_NULL_COMPARISON_REFERENCE_HEADS.some((head) => csharpType.startsWith(head));\n }\n\n // TypeScript numbers and booleans are C# value types in this port (double / bool /\n // Int64 / int), and the ccxt build script retypes some `object` declarations to exactly\n // those from its own tables (precisionFromString -> int, milliseconds -> Int64,\n // isEmpty -> bool). A null comparison against one of them would not compile, and the\n // printer's `object` cannot rule it out, so these always keep the helper.\n csharpOperandIsValueTyped(node): boolean {\n if (node === undefined) {\n return true;\n }\n const checker: any = this.checkerOrUndefined();\n if (checker === undefined) {\n return true;\n }\n const type = checker.getTypeAtLocation(node);\n return this.csharpTypeHasValueScalar(type);\n }\n\n csharpTypeHasValueScalar(type): boolean {\n if (type === undefined) {\n return true;\n }\n const flags = type.flags;\n if (flags & TypeFlags.Union) {\n const members = type.getTypes?.() ?? [];\n return members.some((member) => this.csharpTypeHasValueScalar(member));\n }\n return (flags & (TypeFlags.Number | TypeFlags.NumberLiteral | TypeFlags.Boolean | TypeFlags.BooleanLiteral)) !== 0;\n }\n\n // `x == \"lit\"` / `x != \"lit\"` prints natively when x is a read of a local whose printed\n // declaration is a C# string: the printer's declared-local table, then the embedding build\n // layer's proof for the declarations it retypes itself (ccxt's csharp-local-types.js).\n csharpDeclaredStringLiteralComparison(left, right, leftText: string, rightText: string, isEquality: boolean): string | undefined {\n const ident = isIdentifier(left) ? left : (isIdentifier(right) ? right : undefined);\n if ((ident === undefined) || !isStringLiteralLikeNode((ident === left) ? right : left)) {\n return undefined;\n }\n const declared = this.csharpDeclaredReadType(ident);\n if ((declared === undefined) || !this.csharpTypeIsStringType(declared)) {\n return undefined;\n }\n return isEquality ? `(${leftText} == ${rightText})` : `(${leftText} != ${rightText})`;\n }\n\n // the C# type the declaration behind a local read was printed with, or undefined: the\n // printer's own declared-local table first, then the embedding build layer's answer for a\n // declaration it retyped after the printer had left it `object`\n csharpDeclaredReadType(node): string | undefined {\n let named;\n try {\n named = this.csharpTypedLocalType(node);\n } catch (e) {\n named = undefined;\n }\n return (named !== undefined) ? named : this.csharpResolvedReadType(node);\n }\n\n // the embedding build layer's string answer for a read, or undefined (no resolver, it threw)\n csharpResolvedReadType(node): string | undefined {\n const resolver = this.csharpExpressionTypeResolver;\n if (typeof resolver !== 'function') {\n return undefined;\n }\n let resolved;\n try {\n resolved = resolver(node);\n } catch (e) {\n return undefined;\n }\n return (typeof resolved === 'string') ? resolved : undefined;\n }\n\n // the declared type of an identifier read, including this printer's own local table\n csharpDeclaredLocalType(node): string | undefined {\n const provided = this.csharpExpressionTypeResolver ? this.csharpExpressionTypeResolver(node) : undefined;\n if (provided !== undefined) {\n return provided;\n }\n const declaration = this.getChecker().getSymbolAtLocation(node)?.valueDeclaration?.resolve();\n if (declaration === undefined || !isVariableDeclaration(declaration) || declaration.name?.kind !== SyntaxKind.Identifier) {\n return undefined;\n }\n if (!this.csharpLocalTypes.has(declaration)) {\n this.csharpLocalTypes.set(declaration, this.getCSharpLocalType(declaration));\n }\n const type = this.csharpLocalTypes.get(declaration);\n return (type === undefined || type === this.VAR_TOKEN) ? undefined : type;\n }\n\n // `a === b` / `a !== b` between two plain reads: a local or parameter prints as a bare\n // name and both operands are read once by the printed expression\n csharpOperandsAreDeclaredReads(left, right): boolean {\n const isRead = (node) => (node?.kind === SyntaxKind.Identifier) && (node.text !== 'undefined');\n return isRead(left) && isRead(right);\n }\n\n // the C# type the embedding build layer declares for a read the printer can only call\n // `object`: that layer retypes the declaration so its recorded type IS the printed one\n csharpDeclaredReadEqualityType(node, printerType: string | undefined): string | undefined {\n if ((printerType !== undefined) && (printerType !== this.VAR_TOKEN) && (printerType !== 'var')) {\n return printerType;\n }\n return this.csharpResolvedReadType(node) ?? printerType;\n }\n\n // `==` / `!=` in place of the isEqual wrapper when both operands are C# values of one\n // family, or one side is null/undefined against a type `== null` compiles for. Both\n // operands are printed once, so neither is evaluated twice.\n printInlineEquality(left, right, leftText: string, rightText: string, isEquality: boolean): string | undefined {\n const stringComparison = this.csharpDeclaredStringLiteralComparison(left, right, leftText, rightText, isEquality);\n if (stringComparison !== undefined) {\n return stringComparison;\n }\n let leftType = this.csharpEqualityOperandType(left);\n let rightType = this.csharpEqualityOperandType(right);\n if (this.csharpOperandsAreDeclaredReads(left, right)) {\n leftType = this.csharpDeclaredReadEqualityType(left, leftType);\n rightType = this.csharpDeclaredReadEqualityType(right, rightType);\n }\n // D-21: an operand the printer could not name (or only named `object`) is not a\n // rejection by itself -- the value branch below re-reads its DECLARED scalar type\n if ((leftType === 'null') || (rightType === 'null')) {\n const [other, otherType, otherText] = (leftType === 'null') ? [right, rightType, rightText] : [left, leftType, leftText];\n if (!this.csharpIsNullComparableType(otherType) || !this.csharpOperandIsNullComparable(other)) {\n return undefined;\n }\n return this.csharpNullComparison(otherText, isEquality);\n }\n // D-21: a read the printer's own tables could only call `object` still has the C# type\n // its emitted DECLARATION carries -- a parameter the build layer's typing pass narrowed,\n // a local retyped to the type of a typed return. The declared-read arm below names it.\n const leftKind = this.csharpValueEqualityKind(leftType);\n const rightKind = this.csharpValueEqualityKind(rightType);\n const leftReadKind = (leftKind !== undefined) ? leftKind : this.csharpDeclaredReadEqualityKind(left, leftType);\n const rightReadKind = (rightKind !== undefined) ? rightKind : this.csharpDeclaredReadEqualityKind(right, rightType);\n if ((leftReadKind === undefined) || (rightReadKind === undefined)) {\n return undefined;\n }\n // mixed numeric kinds are not equal in isEqual: `int` vs `double` takes the\n // `(int)a == (int)b` branch and throws on the boxed double, so only a numeric\n // literal may meet a different numeric type\n const numericKinds = [ 'double', 'Int64', 'int' ];\n const sameKind = (leftReadKind === rightReadKind);\n const literalVsNumeric = ((leftReadKind === 'number') && (numericKinds.indexOf(rightReadKind) >= 0))\n || ((rightReadKind === 'number') && (numericKinds.indexOf(leftReadKind) >= 0));\n if (!sameKind && !literalVsNumeric) {\n return undefined;\n }\n return isEquality ? `(${leftText} == ${rightText})` : `(${leftText} != ${rightText})`;\n }\n\n // the value kind of an operand the printer could only call `object`: the type the read's\n // declaration was PRINTED with (printer table -> build layer's read-type oracle -> the\n // declared-type registry for the declarations its own passes retyped). A collection/class\n csharpDeclaredReadEqualityKind(node, operandType: string | undefined): string | undefined {\n if ((operandType !== undefined) && (operandType !== '') && (operandType !== 'object')) {\n return undefined; // the printer named a non-value C# type: never a value comparison\n }\n if ((node?.kind !== SyntaxKind.Identifier) || (node.text === 'undefined')) {\n return undefined; // parameters of a written body / accesses / calls are other units\n }\n const declared = this.csharpDeclaredReadType(node) ?? this.csharpDeclaredLocalResolverType(node);\n return (declared === undefined) ? undefined : this.csharpValueEqualityKind(declared);\n }\n\n csharpNullComparison(text: string, isEquality: boolean) {\n return isEquality ? `(${text} == null)` : `(${text} != null)`;\n }\n\n // `isEqual(, N)` / `isEqual(N, )` -> `==` / `!=`: the call prints a\n // concrete numeric kind, the literal adapts to it, and the operator matches isEqual's integer and\n // double branches. String/bool/collection calls and every `object` box keep the helper.\n csharpNativeNumericCallEquality(left, right, leftText: string, rightText: string, isEquality: boolean): string | undefined {\n const leftKind = this.csharpNumericCallKind(left);\n const rightKind = this.csharpNumericCallKind(right);\n const leftLiteral = (leftKind === undefined) ? this.csharpIntegerLiteralKind(left) : undefined;\n const rightLiteral = (rightKind === undefined) ? this.csharpIntegerLiteralKind(right) : undefined;\n const callOnLeft = (leftKind !== undefined) && (rightLiteral !== undefined) && this.csharpNumericKindHoldsLiteral(leftKind, rightLiteral);\n const callOnRight = (rightKind !== undefined) && (leftLiteral !== undefined) && this.csharpNumericKindHoldsLiteral(rightKind, leftLiteral);\n if (!callOnLeft && !callOnRight) {\n return undefined;\n }\n // both operands are printed once: the call is not duplicated\n return isEquality ? `(${leftText} == ${rightText})` : `(${leftText} != ${rightText})`;\n }\n\n // The C# value kind of a call operand (or `x.length`) when its printed signature is numeric:\n // `.indexOf`/`.length` (int) and safe* accessors from the printer's tables, `this.()` from\n // CSHARP_NATIVE_NUMERIC_THIS_KINDS. undefined keeps the helper (an `object` box has no kind).\n csharpNumericCallKind(node): string | undefined {\n const expression = node?.expression;\n if ((node?.kind === SyntaxKind.CallExpression)\n && (expression?.kind === SyntaxKind.PropertyAccessExpression)\n && (expression.expression?.kind === SyntaxKind.ThisKeyword)) {\n const named = CSHARP_NATIVE_NUMERIC_THIS_KINDS[expression.name?.text as string];\n // an unresolvable callee prints callDynamically(this, ...), which returns object\n if ((named !== undefined) && this.csharpCalleeResolves(node)) {\n return named;\n }\n }\n const named = this.csharpCallReturnType(node);\n return ((named === undefined) || (CSHARP_NUMERIC_VALUE_KINDS.indexOf(named) < 0)) ? undefined : named;\n }\n\n // The C# kind of an integer literal operand (`N` / `-N`), or undefined when the text is not an\n // integer the literal holds exactly. isEqual round-trips through Convert.ToInt64 and truncates\n // via `(int)a == (int)b`, so only a safe integer literal keeps both comparisons identical.\n csharpIntegerLiteralKind(node): string | undefined {\n let value;\n if (node?.kind === SyntaxKind.PrefixUnaryExpression) {\n if ((node.operator !== SyntaxKind.MinusToken) || (node.operand?.kind !== SyntaxKind.NumericLiteral)) {\n return undefined;\n }\n value = -Number(node.operand.text);\n } else if (node?.kind === SyntaxKind.NumericLiteral) {\n value = Number(node.text);\n } else {\n return undefined;\n }\n if (!Number.isSafeInteger(value)) {\n return undefined;\n }\n return ((value >= -2147483648) && (value <= 2147483647)) ? 'int' : 'long';\n }\n\n // a `long` literal has no implicit conversion to an `int` operand; every other pair\n // converts the literal exactly, which is what isEqual's Convert.ToInt64 /\n // Convert.ToDouble branches do with the same two boxes\n csharpNumericKindHoldsLiteral(callKind: string, literalKind: string): boolean {\n if (callKind === 'int') {\n return literalKind === 'int';\n }\n return (callKind.indexOf('Int64') === 0) || (callKind.indexOf('double') === 0);\n }\n\n // the concrete C# type of an expression the printer can name, or undefined: the embedding\n // build layer's proof wins (it retypes locals the printer leaves `object`), then the\n // printer's own tables and the literals whose C# type is fixed by their text\n csharpExpressionTypeOf(node): string | undefined {\n const provided = this.csharpExpressionTypeResolver ? this.csharpExpressionTypeResolver(node) : undefined;\n if (provided !== undefined) {\n return provided;\n }\n if (isNumericLiteral(node)) {\n const value = Number(node.text);\n // wider literals are typed uint/long/ulong by the C# compiler, keep the helper\n return (Number.isInteger(value) && Math.abs(value) <= 2147483647) ? 'int' : undefined;\n }\n if (isPrefixUnaryExpression(node) && (node.operator === SyntaxKind.MinusToken) && isNumericLiteral(node.operand)) {\n const value = Number(node.operand.text);\n return (Number.isInteger(value) && (value <= 2147483647)) ? 'int' : undefined;\n }\n return this.csharpTypeOfInitializer(node);\n }\n\n csharpOperandIsPlainNumber(operand): boolean {\n const checker: any = this.checkerOrUndefined();\n if (checker === undefined) {\n return false; // in-memory program without a checker\n }\n const flags = checker.getTypeAtLocation(operand)?.flags;\n return (flags === TypeFlags.Number) || (flags === TypeFlags.NumberLiteral);\n }\n\n // `<`, `>`, `<=`, `>=` on two operands whose printed C# kind this printer can name (declaration,\n // literal, known call signature — never the JS type) print natively: the helper applies the same\n // conversions as the C# operator; an int/Int64 pair compares the same. See CSHARP_NUMERIC_KINDS.\n csharpNativeNumericComparison(node, identation): string | undefined {\n const token = CSHARP_NATIVE_COMPARISON_TOKENS[node.operatorToken.kind];\n if (token === undefined) {\n return undefined;\n }\n const leftKind = this.csharpExpressionTypeOf(node.left);\n const rightKind = this.csharpExpressionTypeOf(node.right);\n if ((leftKind === undefined) || (rightKind === undefined)) {\n return undefined;\n }\n const integerPair = (CSHARP_INTEGER_KINDS.indexOf(leftKind) >= 0) && (CSHARP_INTEGER_KINDS.indexOf(rightKind) >= 0);\n if (!integerPair && ((leftKind !== rightKind) || (CSHARP_NUMERIC_KINDS.indexOf(leftKind) < 0))) {\n return undefined;\n }\n if ((leftKind === 'double') && ((token === '<') || (token === '<='))) {\n return undefined;\n }\n const leftText = this.printNode(node.left, 0).trim();\n const rightText = this.printNode(node.right, 0).trim();\n return leftText + ' ' + token + ' ' + rightText;\n }\n\n // `Math.min/max (a, b)`: mathMin/mathMax read both boxes via Convert.ToDouble, return an ORIGINAL\n // one (null if either is null); Math.Min/Max returns one numeric kind. Native only when both are\n // declared integers of the same kind and the checker sees two plain numbers; else keep the helper.\n csharpNativeMathMinMax(node, name: string, parsedArg1: string, parsedArg2: string): string | undefined {\n const args = node.arguments;\n if ((args?.length !== 2) || !this.csharpMinMaxResultIsPlainValue(node)) {\n return undefined;\n }\n const leftKind = this.csharpExpressionTypeOf(args[0]);\n if ((leftKind === undefined) || (leftKind !== this.csharpExpressionTypeOf(args[1])) || (CSHARP_MINMAX_NATIVE_KINDS.indexOf(leftKind) < 0)) {\n return undefined;\n }\n if (!this.csharpOperandIsPlainNumber(args[0]) || !this.csharpOperandIsPlainNumber(args[1])) {\n return undefined;\n }\n return 'Math.' + name + '(' + parsedArg1 + ', ' + parsedArg2 + ')';\n }\n\n // the positions that take the primitive as the helper's box: assignment, argument,\n // dictionary/list value, return and ternary arm all box an int the same way. A receiver, an\n // `as`/`!` wrapper and the printer's hard `(string)` casts (throw / `delete`) do not.\n csharpMinMaxResultIsPlainValue(node): boolean {\n if (this.csharpIsClassThrowArgument(node) || this.csharpIsDeleteKey(node)) {\n return false;\n }\n let parent = node.parent;\n while (parent !== undefined && isParenthesizedExpression(parent)) {\n parent = parent.parent;\n }\n if (parent === undefined) {\n return false;\n }\n if ((isPropertyAccessExpression(parent) || isElementAccessExpression(parent) || isCallExpression(parent)) && parent.expression === node) {\n return false;\n }\n return (parent.kind !== SyntaxKind.AsExpression) && (parent.kind !== SyntaxKind.TypeAssertionExpression) && (parent.kind !== SyntaxKind.NonNullExpression);\n }\n\n // `parseInt(...)` / `parseFloat(...)` print the runtime helper call; the folds below replace\n // it with the exact box the helper returns, everything else falls through to the printer\n printCallExpression(node, identation) {\n const nativeParse = this.csharpNativeParseCall(node);\n if (nativeParse !== undefined) {\n return nativeParse;\n }\n return super.printCallExpression(node, identation);\n }\n\n csharpNativeParseCall(node) {\n if (node?.kind !== SyntaxKind.CallExpression || !isIdentifier(node.expression)) {\n return undefined;\n }\n const callee = node.expression.text as string;\n if ((callee !== 'parseInt') && (callee !== 'parseFloat')) {\n return undefined;\n }\n const args = node.arguments;\n if (args === undefined || args.length !== 1) {\n return undefined;\n }\n if (!this.csharpCalleeIsGlobalFunction(node.expression)) {\n return undefined; // a locally declared function of the same name is not the helper\n }\n const literal = (callee === 'parseInt') ? csharpParseIntLiteralArgument(args[0]) : csharpParseFloatLiteralArgument(args[0]);\n if (literal !== undefined) {\n return literal;\n }\n return this.csharpNativeParseCallOnDeclaredLocal(callee, args[0]);\n }\n\n // the global `parseInt` / `parseFloat` live in the TS lib chain; a declaration anywhere else\n // means the call prints a different function than the runtime helper\n csharpCalleeIsGlobalFunction(node): boolean {\n const checker: any = this.checkerOrUndefined();\n if (checker === undefined) {\n return true; // in-memory program without a checker: the name is all there is\n }\n const declarations = (checker.getSymbolAtLocation(node)?.declarations ?? []).map((d) => d.resolve());\n return declarations.every((declaration) => declaration.getSourceFile().fileName.indexOf('typescript') > -1);\n }\n\n // `parseFloat(x)` / `parseInt(x)` on a local declared numeric: Convert.ToDouble is an identity for\n // `double` and a widening for integer kinds. An Int64 parseInt operand (rounded above 2^53), a\n // double one (NaN/overflow -> null) and nullable or `object` locals (null -> 0) keep the helper.\n csharpNativeParseCallOnDeclaredLocal(callee, arg) {\n if (arg?.kind !== SyntaxKind.Identifier) {\n return undefined;\n }\n const kind = this.csharpExpressionTypeOf(arg);\n if (CSHARP_NUMERIC_KINDS.indexOf(kind) < 0) {\n return undefined;\n }\n const text = this.printNode(arg, 0);\n if (callee === 'parseFloat') {\n return (kind === 'double') ? text : `((double)${text})`;\n }\n return (kind === 'int') ? `((Int64)${text})` : undefined;\n }\n\n // `multiply(N, M)` over two unsigned numeric literals: two integers box the Int64 product\n // (`NL * ML`, the same value while it is a safe integer); otherwise the helper multiplies the\n // doubles and re-boxes an integral product as Int64, so only a fractional product goes native.\n csharpNativeLiteralProduct(left, right): string | undefined {\n if (!isNumericLiteral(left) || !isNumericLiteral(right)) {\n return undefined;\n }\n const leftText = left.text;\n const rightText = right.text;\n if (/^\\d+$/.test(leftText) && /^\\d+$/.test(rightText)) {\n const product = Number(leftText) * Number(rightText);\n return Number.isSafeInteger(product) ? `(${leftText}L * ${rightText}L)` : undefined;\n }\n const decimal = /^\\d+(\\.\\d+)?$/;\n // IsInteger reads the product through Convert.ToDecimal, i.e. rounded to 15 significant digits\n const rounded = Number((Number(leftText) * Number(rightText)).toPrecision(15));\n if (!decimal.test(leftText) || !decimal.test(rightText) || Number.isInteger(rounded)) {\n return undefined;\n }\n return `(${leftText} * ${rightText})`;\n }\n\n // `a % b` prints `mod(a, b)`: the helper takes the double remainder and converts back to Int64. An\n // Int32 dividend with a nonzero integer literal divisor is exact as double, so the native Int64\n // remainder matches. Int64 dividends (rounded above 2^53) and possibly-zero divisors keep helper.\n csharpNativeModExpression(left, right, leftText) {\n if (left?.kind !== SyntaxKind.Identifier) {\n return undefined;\n }\n if (this.csharpExpressionTypeOf(left) !== 'int') {\n return undefined;\n }\n const divisor = csharpLiteralNumericValue(right);\n if ((divisor === undefined) || !Number.isSafeInteger(divisor) || (divisor === 0)) {\n return undefined;\n }\n return `((Int64)${leftText} % ${divisor}L)`;\n }\n\n // `-x` prints `prefixUnaryNeg(ref x)`, whose typed overloads negate in place and return the same\n // box (`a = -a; return a;`): a local declared int / Int64 / double binds one, so the assignment is\n // the identical emission. Every other operand keeps the helper's runtime dispatch and null answer.\n csharpNativeNegatedLocal(operand, leftSide) {\n if (operand?.kind !== SyntaxKind.Identifier) {\n return undefined;\n }\n if (CSHARP_NUMERIC_KINDS.indexOf(this.csharpExpressionTypeOf(operand)) < 0) {\n return undefined;\n }\n return `(${leftSide} = -${leftSide})`;\n }\n\n // The printed receiver whose C# static type is a known collection: a local this printer declared\n // with a concrete type (csharpTypedLocals), or a hand-written BaseExchange field. undefined keeps\n // the runtime helper, since the printer cannot name the operand's type.\n csharpNativeReceiver(node): { text: string, type: string } | undefined {\n if (node?.kind === SyntaxKind.ParenthesizedExpression) {\n const inner = this.csharpNativeReceiver(node.expression);\n return inner === undefined ? undefined : { text: `(${inner.text})`, type: inner.type };\n }\n if (isIdentifier(node)) {\n const named = this.csharpTypedLocalType(node);\n return (named === undefined || CSHARP_NATIVE_COLLECTION_TYPES.indexOf(named) < 0) ? undefined : { text: this.printNode(node, 0), type: named };\n }\n if (isPropertyAccessExpression(node) && node.expression?.kind === SyntaxKind.ThisKeyword) {\n const name = node.name?.text as string;\n if (CSHARP_OBJECT_DICT_FIELDS.indexOf(name) >= 0) {\n // the field is declared `object`; its box is always a dictionary\n return { text: `((IDictionary)${this.printNode(node, 0)})`, type: 'IDictionary' };\n }\n return CSHARP_NATIVE_FIELDS[name] === undefined ? undefined : { text: this.printNode(node, 0), type: CSHARP_NATIVE_FIELDS[name] };\n }\n // a call whose printed C# type this printer already names (Object.keys, this.indexBy,\n // x.split, ...) is a collection too\n const callType = this.csharpCallReturnType(node);\n if (callType !== undefined && CSHARP_NATIVE_COLLECTION_TYPES.indexOf(callType) >= 0) {\n const printed = this.printNode(node, 0);\n return { text: printed.startsWith('new ') ? `(${printed})` : printed, type: callType };\n }\n return undefined;\n }\n\n // the C# types this printer can name on a local whose members replace the helpers:\n // the collection types (Count/ContainsKey) and string (Length/ContainsKey keys)\n csharpTypeIsNative(csharpType: string): boolean {\n return CSHARP_NATIVE_COLLECTION_TYPES.indexOf(csharpType) >= 0 || csharpType.indexOf('string') === 0;\n }\n\n // the C# type this printer declared for a local read, or undefined\n csharpTypedLocalType(node): string | undefined {\n const declaration = this.getChecker().getSymbolAtLocation(node)?.valueDeclaration?.resolve();\n return declaration === undefined ? undefined : this.csharpTypedLocals.get(declaration);\n }\n\n // the member that replaces getArrayLength on a declared C# type: Count counts the same\n // elements the helper's IList / ICollection branches count, Length is its string branch.\n // Any other declared type keeps the helper\n csharpCountMemberOf(csharpType: string): string | undefined {\n if ((csharpType === 'string') || (csharpType === 'string?')) {\n return 'Length';\n }\n return CSHARP_COUNT_TYPES.some((prefix) => csharpType.indexOf(prefix) === 0) ? 'Count' : undefined;\n }\n\n // `getArrayLength(x)` -> `(x?.Count ?? 0)` for a local whose printed declaration carries a C#\n // collection / string type (printer's declared-local table, then build/csharp-local-types.js).\n // The null-conditional is the helper's `null -> 0`; a plain member read would throw instead.\n csharpDeclaredLengthExpression(node): string | undefined {\n // a cast the printer itself printed around the receiver names the type outright, and\n // takes the whole expression as its operand (`(T)x?.Count` would cast the Count), so\n // the printed form is parenthesised before its own member read\n const printed = this.printNode(node, 0).trim();\n const cast = CSHARP_LENGTH_CAST.exec(printed);\n if (cast !== null) {\n const castMember = this.csharpCountMemberOf(cast[1]);\n if (castMember !== undefined) {\n return `(${isIdentifier(node) ? printed : `(${printed})`}?.${castMember} ?? 0)`;\n }\n }\n // `(x as List).length` / `((x)).length`: the printer prints the wrapper as the bare\n // local when it elides the assertion, so the read is still the identifier\n const receiver = this.csharpLengthReceiverIdentifier(node);\n if (receiver === undefined) {\n return undefined;\n }\n const named = this.csharpTypedLocalType(receiver);\n const csharpType = named !== undefined ? named\n : (this.csharpExpressionTypeResolver ? this.csharpExpressionTypeResolver(receiver) : undefined)\n ?? this.csharpLengthReceiverType(receiver);\n const member = csharpType === undefined ? undefined : this.csharpCountMemberOf(csharpType);\n if (member === undefined) {\n return undefined;\n }\n // a wrapper the printer does print (a `((string)x)` cast keeps its assertion) is a\n // different receiver: only the printed-as-identifier shape may take the member read\n const receiverText = this.printNode(receiver, 0);\n if (this.printNode(node, 0).trim() !== receiverText.trim()) {\n return undefined;\n }\n return `(${receiverText}?.${member} ?? 0)`;\n }\n\n // the printed key of ContainsKey must itself be a C# string: a literal, a local this\n // printer declared `string`, a call it types as string, or its own `((string)x)` cast\n csharpNativeStringKey(key): string | undefined {\n if (key?.kind === SyntaxKind.ParenthesizedExpression) {\n return this.csharpNativeStringKey(key.expression);\n }\n if (isStringLiteralLikeNode(key)) {\n return this.printNode(key, 0);\n }\n if (isIdentifier(key)) {\n const named = this.csharpTypedLocalType(key);\n // a non-nullable string local is the printed proof ContainsKey needs (`string?`\n // still needs the checker's string, or a null key would throw where inOp says false)\n if (named === 'string') {\n return this.printNode(key, 0);\n }\n if ((named === undefined) || (named.indexOf('string') !== 0)) {\n return undefined;\n }\n return this.isStringType(this.getChecker().getTypeAtLocation(key).flags) ? this.printNode(key, 0) : undefined;\n }\n if (this.csharpCallReturnType(key) === 'string') {\n // the callee's C# signature is a plain string; the checker proof is the phase-1 gate\n return this.isStringType(this.getChecker().getTypeAtLocation(key).flags) ? this.printNode(key, 0) : undefined;\n }\n const printed = this.printNode(key, 0);\n if (!printed.startsWith('((string)')) {\n return undefined;\n }\n // the cast is the printer's own string view of the value: only a checker-proven\n // string operand may have it (a non-string box would throw where the helper says false)\n return this.isStringType(this.getChecker().getTypeAtLocation(key).flags) ? printed : undefined;\n }\n\n // the checker's view of an `in` / `.length` operand: a dictionary carries a string\n // index signature, an array is the Array reference type. `any` proves nothing\n csharpIsDictionaryType(type): boolean {\n if (type === undefined || this.isAnyType(type.flags)) {\n return false;\n }\n return this.getChecker().getIndexTypeOfType(type, IndexKind.String) !== undefined;\n }\n\n csharpIsArrayType(type): boolean {\n if (type === undefined || this.isAnyType(type.flags)) {\n return false;\n }\n return type?.getSymbol()?.escapedName === 'Array';\n }\n\n // a union of dictionary members and nullish ones (what a `Dict | undefined` signature\n // widens to): a C# reference that happens to be null is a nullish arm, not a scalar one.\n // Any other member (arrays, classes, scalars) keeps the helper\n csharpNullableDictionaryType(type): boolean {\n if (type === undefined || ((type.flags & TypeFlags.Union) === 0)) {\n return false;\n }\n let dictionaries = 0;\n for (const member of (type as UnionType).getTypes() ?? []) {\n if ((member.flags & (TypeFlags.Undefined | TypeFlags.Null)) !== 0) {\n continue;\n }\n if (!this.csharpIsDictionaryType(member)) {\n return false;\n }\n dictionaries++;\n }\n return dictionaries > 0;\n }\n\n // a dictionary whose values are `any` — the shape the transpiled C# boxes as\n // Dictionary. A `Dictionary` / `Dictionary` keeps the\n // helper: the C# cast target is invariant, so `IDictionary` would throw\n csharpIsAnyValuedDictionaryType(type): boolean {\n if (!this.csharpIsDictionaryType(type)) {\n return false;\n }\n const value = this.getChecker().getIndexTypeOfType(type, IndexKind.String);\n return (value !== undefined) && this.isAnyType(value.flags);\n }\n\n // the parameter printFunctionBody gives a `??= new Dictionary()` line\n // (its initializer is an object literal): from the first statement on its box is a\n // dictionary whatever the caller passed, so a null check would be dead code\n csharpDictionaryParamsBag(node): boolean {\n const declaration = this.getChecker().getSymbolAtLocation(node)?.valueDeclaration?.resolve();\n const initializer = (declaration?.kind === SyntaxKind.Parameter) ? (declaration as ParameterDeclaration).initializer : undefined;\n return initializer?.kind === SyntaxKind.ObjectLiteralExpression;\n }\n\n // D2: the name is rewritten before this read, so the box it holds there is not the one its\n // declaration started with (the scan is a name match, so any earlier write bails)\n csharpNameWrittenBefore(node, name: string): boolean {\n const scope = this.csharpEnclosingFunction(node);\n if (scope === undefined) {\n return true;\n }\n let written = false;\n const visit = (n) => {\n if (written || (n.pos >= node.pos)) {\n return;\n }\n if ((n.kind === SyntaxKind.Identifier) && (n.text === name)) {\n const parent = n.parent;\n const assignment = (parent?.kind === SyntaxKind.BinaryExpression) && (parent.left === n);\n const increment = ((parent?.kind === SyntaxKind.PostfixUnaryExpression) || (parent?.kind === SyntaxKind.PrefixUnaryExpression))\n && ((parent.operator === SyntaxKind.PlusPlusToken) || (parent.operator === SyntaxKind.MinusMinusToken));\n if (assignment || increment) {\n written = true;\n return;\n }\n }\n n.forEachChild(visit);\n };\n scope.forEachChild(visit);\n return written;\n }\n\n // The C# dictionary a ContainsKey receiver reads through, or undefined: printer tables, then the\n // build layer's declared-type table, then an `object` parameter proven a dictionary by TS or an\n // emitted `??= new Dictionary()`. That case applies the helper's cast + null test.\n csharpNativeDictionaryReceiver(obj): { text: string, nullTest?: string } | undefined {\n const checker = this.getChecker();\n const type = checker.getTypeAtLocation(obj);\n const nullable = this.csharpNullableDictionaryType(type);\n const receiver = this.csharpNativeReceiver(obj);\n if (receiver !== undefined) {\n // only a dictionary C# type carries ContainsKey (IList keeps the helper)\n if (receiver.type.indexOf('Dictionary<') < 0) {\n return undefined;\n }\n return nullable ? { text: receiver.text, nullTest: receiver.text } : { text: receiver.text };\n }\n // the embedding build layer's declared-type table names the type the local's own\n // declaration carries, so it needs neither the checker proof nor a cast\n const declared = this.csharpExpressionTypeOf(obj);\n if (declared !== undefined) {\n return (declared.indexOf('Dictionary<') >= 0) ? { text: this.printNode(obj, 0) } : undefined;\n }\n // an `object` box: only a parameter of this function (a local may box the hand-written\n // base's own instantiation — `client.futures` is IDictionary — and the\n // printer cannot tell), and only while nothing has rewritten it (D2)\n if (!isIdentifier(obj) || (this.csharpTypedLocalType(obj) !== undefined)) {\n return undefined;\n }\n const name = obj.text as string;\n if (this.csharpNameWrittenBefore(obj, name)) {\n return undefined;\n }\n const declaration = checker.getSymbolAtLocation(obj)?.valueDeclaration?.resolve();\n if (declaration?.kind !== SyntaxKind.Parameter) {\n return undefined; // a local may box a hand-written instantiation the printer cannot name\n }\n const printed = this.printNode(obj, 0);\n const text = `((IDictionary)${printed})`;\n // the params bag: the printer's own `??= new Dictionary()` line made the\n // box a dictionary whatever the caller passed, so no checker proof is needed (and no\n // null test — the line is the first statement of the body)\n if (this.csharpDictionaryParamsBag(obj)) {\n return { text };\n }\n if ((!this.csharpIsDictionaryType(type) && !nullable) || !this.csharpIsAnyValuedDictionaryType(type)) {\n return undefined;\n }\n return { text, nullTest: printed };\n }\n\n // `key in obj` -> `obj.ContainsKey(key)`, only when both the printed key and the printed\n // operand are already C# string / dictionary values. Every other shape keeps the inOp helper\n csharpNativeInExpression(key, obj): string | undefined {\n const printedKey = this.csharpNativeStringKey(key);\n if (printedKey === undefined) {\n return this.csharpDeclaredDictInExpression(key, obj);\n }\n const receiver = this.csharpNativeDictionaryReceiver(obj);\n if (receiver !== undefined) {\n const call = `${receiver.text}.ContainsKey(${printedKey})`;\n return (receiver.nullTest === undefined) ? call : `(${receiver.nullTest} != null && ${call})`;\n }\n // a receiver the embedding build layer retypes AFTER printing: the checker may see\n // `any` on it, so no table above names it (see csharpDeclaredDictInExpression)\n return this.csharpDeclaredDictInExpression(key, obj);\n }\n\n // `key in obj` on a local whose EMITTED declaration is a dictionary the printer cannot name itself\n // (build/csharp-local-types.js retypes it, answers csharpDeclaredDictReceiverType): inOp's dict\n // branch is exactly `obj?.ContainsKey(key) == true` for a key that is already a C# string.\n csharpDeclaredDictInExpression(key, obj): string | undefined {\n if (obj?.kind !== SyntaxKind.Identifier) {\n return undefined;\n }\n const declared = (typeof this.csharpDeclaredDictReceiverType === 'function') ? this.csharpDeclaredDictReceiverType(obj) : undefined;\n if ((declared === undefined) || (declared.indexOf('Dictionary<') < 0)) {\n return undefined;\n }\n const printedKey = this.csharpNativeStringKey(key) ?? this.csharpDeclaredStringKey(key);\n if (printedKey === undefined) {\n return undefined;\n }\n const receiver = this.printNode(obj, 0);\n if (isStringLiteralLikeNode(key)) {\n return `(${receiver}?.ContainsKey(${printedKey}) == true)`;\n }\n // an identifier key may hold null, where a bare ContainsKey throws ArgumentNullException:\n // the helper's own null guard is emitted back. Undefined by default, so an untyped run is\n // byte-identical (a receiver no hook names keeps the helper call).\n if (isIdentifier(key)) {\n return `((${printedKey} != null) && (${receiver}?.ContainsKey(${printedKey}) == true))`;\n }\n return undefined;\n }\n\n // the key of the rule above, when the printer's own tables name no string for it but the\n // embedding build layer's record does (the same hook the isEqual twin reads)\n csharpDeclaredStringKey(key): string | undefined {\n if (key?.kind !== SyntaxKind.Identifier) {\n return undefined;\n }\n const type = (typeof this.csharpLocalTypeOf === 'function') ? this.csharpLocalTypeOf(key) : undefined;\n return ((type === 'string') || (type === 'string?')) ? this.printNode(key, 0) : undefined;\n }\n\n // `x.length` -> `x.Count`, same proof for the checker's array operands; strings keep\n // the `((string)x).Length` branch and every unproven operand keeps getArrayLength\n csharpNativeLengthExpression(expression): string | undefined {\n if (this.csharpIsArrayType(this.getChecker().getTypeAtLocation(expression))) {\n const receiver = this.csharpNativeReceiver(expression);\n if (receiver !== undefined) {\n return `${receiver.text}.Count`;\n }\n }\n return this.csharpDeclaredLengthExpression(expression);\n }\n\n // the C# type of a dictionary element read is `object`: isEqual compares the boxed\n // element, which `as` + the operator reproduce exactly (any other box reads as null,\n // where isEqual also answers false)\n csharpNativeElementLiteralEquality(left, right, leftText: string, rightText: string, isEquality: boolean): string | undefined {\n const elementIsLeft = this.csharpStringKeyedElementAccess(left);\n if (!elementIsLeft && !this.csharpStringKeyedElementAccess(right)) {\n return undefined;\n }\n const [element, literal] = elementIsLeft ? [left, right] : [right, left];\n const isBoolLiteral = (literal.kind === SyntaxKind.TrueKeyword) || (literal.kind === SyntaxKind.FalseKeyword);\n const isStringLiteral = isStringLiteralLikeNode(literal);\n if (!isBoolLiteral && !isStringLiteral) {\n return undefined;\n }\n if (this.csharpDictionaryReceiverType(element.expression) === undefined) {\n return undefined;\n }\n const wanted = isBoolLiteral ? CSHARP_SCALAR_ELEMENT_BOOL : CSHARP_SCALAR_ELEMENT_STRING;\n if ((this.csharpScalarElementKinds(element) & wanted) === 0) {\n return undefined;\n }\n const token = isEquality ? '==' : '!=';\n if (isStringLiteral && this.csharpNumericStringLiteral(literal)) {\n return undefined; // isEqual's double/decimal branches coerce a numeric string\n }\n const cast = isBoolLiteral ? 'bool?' : 'string';\n const castElement = `(${elementIsLeft ? leftText : rightText} as ${cast})`;\n const otherText = elementIsLeft ? rightText : leftText;\n return elementIsLeft ? `(${castElement} ${token} ${otherText})` : `(${otherText} ${token} ${castElement})`;\n }\n\n // `x[\"k\"]` — the element read of a dictionary key this printer prints as getValue(x, \"k\")\n csharpStringKeyedElementAccess(node): boolean {\n return (node?.kind === SyntaxKind.ElementAccessExpression) && isStringLiteralLikeNode(node.argumentExpression);\n }\n\n // isEqual compares a boxed number with a numeric string by converting both, which the\n // string cast of the native form cannot reproduce: a numeric-looking literal stays on\n // the helper (the element proof says the box is a string, and a number box would differ)\n csharpNumericStringLiteral(node): boolean {\n const text = String(node.text).trim();\n return (text !== '') && !isNaN(Number(text));\n }\n\n // the declared C# type of a dictionary receiver: a local the embedding build layer retypes\n // (csharpExpressionTypeResolver) or a hand-written BaseExchange field; undefined keeps the\n // runtime helper, since the printer cannot name the box the key lives in\n csharpDictionaryReceiverType(node): string | undefined {\n const native = this.csharpNativeReceiver(node);\n const declared = (native !== undefined) ? native.type : this.csharpExpressionTypeOf(node);\n if ((declared === undefined) || (declared.indexOf('Dictionary<') < 0)) {\n return undefined;\n }\n return declared;\n }\n\n // the scalar branches isEqual can compare an element with: every member of the element's\n // TypeScript type must be a boolean, a string or undefined, or the helper stays\n csharpScalarElementKinds(node): number {\n try {\n const type = this.getChecker().getTypeAtLocation(node);\n const members = ((type.flags & TypeFlags.Union) !== 0) ? ((type as any).getTypes() ?? []) : [ type ];\n let kinds = 0;\n for (const member of members) {\n const flags = member.flags;\n if (flags & (TypeFlags.Boolean | TypeFlags.BooleanLiteral)) {\n kinds |= CSHARP_SCALAR_ELEMENT_BOOL;\n } else if (flags & (TypeFlags.String | TypeFlags.StringLiteral | TypeFlags.TemplateLiteral)) {\n kinds |= CSHARP_SCALAR_ELEMENT_STRING;\n } else if (!(flags & TypeFlags.Undefined)) {\n return 0;\n }\n }\n return kinds;\n } catch (e) {\n return 0; // in-memory program without a checker\n }\n }\n\n // the C# type the emitted declaration gives a `.length` receiver, or undefined when this\n // printer names none. Installed by build/csharp-local-types.js; undefined by default, so\n // the untyped emission is byte-identical without the override\n csharpLengthReceiverType(expression): string | undefined {\n return undefined;\n }\n\n // `isEqual (x, \"lit\")` -> `x == \"lit\"` (and `!isEqual` -> `!=`) when the operand's emitted\n // declaration is a string: isEqual's string branch is the same ordinal comparison; a null operand\n // is false in both. Gated on csharpLocalTypeOf; an unnamed operand keeps the helper call.\n csharpStringLiteralEquality(op, left, right, leftText: string, rightText: string): string | undefined {\n const equality = (op === SyntaxKind.EqualsEqualsToken) || (op === SyntaxKind.EqualsEqualsEqualsToken);\n const inequality = (op === SyntaxKind.ExclamationEqualsToken) || (op === SyntaxKind.ExclamationEqualsEqualsToken);\n if (!equality && !inequality) {\n return undefined;\n }\n const leftLiteral = isStringLiteral(left);\n const rightLiteral = isStringLiteral(right);\n if (leftLiteral === rightLiteral) {\n return undefined; // exactly one side must be the (never-null) string literal\n }\n const operand = leftLiteral ? right : left;\n if (operand?.kind !== SyntaxKind.Identifier) {\n return undefined;\n }\n const operandType = this.csharpLocalTypeOf(operand);\n if ((operandType !== 'string') && (operandType !== 'string?')) {\n return undefined;\n }\n return `${leftText} ${inequality ? '!=' : '=='} ${rightText}`;\n }\n\n // U55: `isEqual (x, null)` -> `x == null` (`!isEqual` -> `!=`) when the emitted declaration is\n // a typed reference or nullable scalar: the helper's null guards return exactly the C# null test,\n // never reach a typed branch. Gated on csharpNullComparisonTypeOf; unnamed operands keep helper.\n csharpNullLiteralEquality(op, left, right, leftText: string, rightText: string): string | undefined {\n const equality = (op === SyntaxKind.EqualsEqualsToken) || (op === SyntaxKind.EqualsEqualsEqualsToken);\n const inequality = (op === SyntaxKind.ExclamationEqualsToken) || (op === SyntaxKind.ExclamationEqualsEqualsToken);\n if (!equality && !inequality) {\n return undefined;\n }\n const leftNull = this.csharpOperandIsNullLiteral(left);\n const rightNull = this.csharpOperandIsNullLiteral(right);\n if (leftNull === rightNull) {\n return undefined; // exactly one side must be the (never-typed) null literal\n }\n let operand = leftNull ? right : left;\n while (operand?.kind === SyntaxKind.ParenthesizedExpression) {\n operand = operand.expression;\n }\n if (operand?.kind !== SyntaxKind.Identifier) {\n return undefined;\n }\n const operandType = (typeof this.csharpNullComparisonTypeOf === 'function') ? this.csharpNullComparisonTypeOf(operand) : undefined;\n if (!this.csharpNullComparisonTypeIsProvable(operandType)) {\n return undefined;\n }\n return this.csharpNullComparison(leftNull ? rightText : leftText, equality);\n }\n\n // `null` and the `undefined` identifier both print as the C# null literal\n csharpOperandIsNullLiteral(node): boolean {\n return (node?.kind === SyntaxKind.NullKeyword)\n || ((node?.kind === SyntaxKind.Identifier) && (node.text === 'undefined'));\n }\n\n printCustomBinaryExpressionIfAny(node, identation) {\n const left = node.left;\n const right = node.right;\n\n const op = node.operatorToken.kind;\n\n if (left.kind === SyntaxKind.TypeOfExpression) {\n const typeOfExpression = this.handleTypeOfInsideBinaryExpression(node, identation);\n if (typeOfExpression) {\n return typeOfExpression;\n }\n }\n\n // handle: [x,d] = this.method()\n if (op === SyntaxKind.EqualsToken && left.kind === SyntaxKind.ArrayLiteralExpression) {\n const arrayBindingPatternElements = left.elements;\n const parsedArrayBindingElements = arrayBindingPatternElements.map((e) => this.printNode(e, 0));\n const syntheticName = parsedArrayBindingElements.join(\"\") + \"Variable\";\n\n // when the holder's C# type is known (see csharpDestructuringTempType), declare the\n // holder with it and index it directly: `((IList)holder)[i]` names nothing new\n const tempType = this.csharpDestructuringTempType(right);\n const tempExpression = this.printNode(right, 0);\n\n const tempCast = (tempType && this.csharpDestructuringTempNeedsCast(right, tempExpression)) ? `(${tempType})` : '';\n let arrayBindingStatement = tempType ? `${tempType} ${syntheticName} = ${tempCast}${tempExpression};\\n` : `var ${syntheticName} = ${tempExpression};\\n`;\n\n parsedArrayBindingElements.forEach((e, index) => {\n // const type = this.getType(node);\n // const parsedType = this.getTypeFromRawType(type);\n const leftElement = arrayBindingPatternElements[index];\n const leftType = this.getChecker().getTypeAtLocation(leftElement);\n const parsedType = this.getTypeFromRawType(leftType);\n\n const castExp = parsedType ? `(${parsedType})` : \"\";\n\n // const statement = this.getIden(identation) + `${e} = (${castExp}((List)${syntheticName}))[${index}]`;\n const statement = this.getIden(identation) + (tempType ? `${e} = ${syntheticName}[${index}]` : `${e} = ((IList)${syntheticName})[${index}]`);\n if (index < parsedArrayBindingElements.length - 1) {\n arrayBindingStatement += statement + \";\\n\";\n } else {\n // printStatement adds the last ;\n arrayBindingStatement += statement;\n }\n });\n\n return arrayBindingStatement;\n }\n\n if (op === SyntaxKind.InKeyword) {\n const nativeIn = this.csharpNativeInExpression(left, right);\n if (nativeIn !== undefined) {\n return nativeIn;\n }\n return `inOp(${this.printNode(right, 0)}, ${this.printNode(left, 0)})`;\n }\n\n // only print the operands when this op is actually handled here; otherwise\n // the base printBinaryExpression prints them, and doing it eagerly means\n // every unhandled binary expression gets its subtrees printed twice\n if (op === SyntaxKind.PlusEqualsToken || op === SyntaxKind.MinusEqualsToken || op in this.binaryExpressionsWrappers) {\n const nativeComparison = this.csharpNativeNumericComparison(node, identation);\n if (nativeComparison !== undefined) {\n return nativeComparison;\n }\n const leftText = this.printNode(left, 0);\n const rightText = this.printNode(right, 0);\n\n if (op === SyntaxKind.PlusEqualsToken) {\n return `${leftText} = add(${leftText}, ${rightText})`;\n }\n\n if (op === SyntaxKind.MinusEqualsToken) {\n return `${leftText} = subtract(${leftText}, ${rightText})`;\n }\n\n const isEquality = (op === SyntaxKind.EqualsEqualsToken) || (op === SyntaxKind.EqualsEqualsEqualsToken);\n const isDifference = (op === SyntaxKind.ExclamationEqualsToken) || (op === SyntaxKind.ExclamationEqualsEqualsToken);\n if (isEquality || isDifference) {\n // `isEqual (x, \"lit\")` / `!isEqual (x, \"lit\")` over a string-typed operand (S60,\n // csharpStringLiteralEquality) first; anything the hook cannot name falls through to the\n // printed-form inlining below, byte-identically.\n const nativeEquality = this.csharpStringLiteralEquality(op, left, right, leftText, rightText);\n // `isEqual (x, null)` / `!isEqual (x, null)` over a typed-reference or nullable-scalar operand\n // (U55, csharpNullLiteralEquality), the hook-gated null-literal twin of the rule above; anything\n // it cannot name falls through to the printed-form inlining below, byte-identically.\n const native = nativeEquality\n ?? this.csharpNullLiteralEquality(op, left, right, leftText, rightText)\n ?? this.printInlineEquality(left, right, leftText, rightText, isEquality)\n ?? this.csharpNativeElementLiteralEquality(left, right, leftText, rightText, isEquality)\n ?? this.csharpNativeNumericCallEquality(left, right, leftText, rightText, isEquality);\n if (native !== undefined) {\n return native;\n }\n }\n\n if (op === SyntaxKind.PlusToken) {\n // `add (x, y)` -> `(x + y)` when the classifier proves the LEFT operand's emitted declaration is a\n // string (U57): the call binds add(string, string) / add(string, object), exactly this\n // concatenation. Gated on the hook, so an unnamed operand keeps the helper.\n const nativeConcat = this.csharpNativeStringConcat(left, right, leftText, rightText);\n if (nativeConcat !== undefined) {\n return nativeConcat;\n }\n }\n\n if (op === SyntaxKind.AsteriskToken) {\n const nativeProduct = this.csharpNativeLiteralProduct(left, right);\n if (nativeProduct !== undefined) {\n return nativeProduct;\n }\n }\n\n const [open, close] = this.binaryExpressionsWrappers[op];\n if (op === SyntaxKind.PercentToken) {\n const nativeMod = this.csharpNativeModExpression(left, right, leftText);\n if (nativeMod !== undefined) {\n return nativeMod;\n }\n }\n return `${open}${leftText}, ${rightText}${close}`;\n }\n\n // x = y\n // cast y to x type when y is unknown\n // if (op === SyntaxKind.EqualsToken) {\n // const leftType = this.getChecker().getTypeAtLocation(left);\n // const rightType = this.getChecker().getTypeAtLocation(right);\n\n // if (this.isAnyType(rightType.flags) && !this.isAnyType(leftType.flags)) {\n // // const parsedType = this.getTypeFromRawType(leftType);\n // return `${leftText} = ${rightText}`;\n // }\n // }\n\n return undefined;\n }\n\n // castVariableAssignmentIfNeeded(left, right, identation) {\n // const leftType = this.getChecker().getTypeAtLocation(left);\n // const rightType = this.getChecker().getTypeAtLocation(right);\n\n // const leftText = this.printNode(left, 0);\n // const rightText = this.printNode(right, 0);\n\n // if (this.isAnyType(rightType.flags) && !this.isAnyType(leftType.flags)) {\n // const parsedType = this.getTypeFromRawType(leftType);\n // return `${this.getIden(identation)}${leftText} = (${parsedType})${rightText}`;\n // }\n // return undefined;\n // }\n\n // the C# type of a whole-call / whole-property initializer, keyed on the AST so\n // the printer's cast wrappers (`((string)x).ToUpper()`) do not hide the callee\n csharpCallReturnType(initializer): string | undefined {\n if (initializer?.kind === SyntaxKind.PropertyAccessExpression) {\n // `x.length` prints `((string)x).Length` or `getArrayLength(x)`, both int\n return (initializer.name?.text === 'length') ? 'int' : undefined;\n }\n if (initializer?.kind !== SyntaxKind.CallExpression) {\n return undefined;\n }\n const expression = initializer.expression;\n if (expression?.kind !== SyntaxKind.PropertyAccessExpression) {\n return undefined;\n }\n const methodName = expression.name?.text as string;\n const target = expression.expression;\n if (target?.kind === SyntaxKind.ThisKeyword) {\n // the table names the C# signature of the same-name base helper, which the printed\n // call only binds when the printer resolves the callee. An unresolvable one\n // (`this.proxyUrlCallback(...)` — a property holding the function — or a\n // checker-less program) prints `callDynamically(this, \"name\", ...)` instead, and\n // that helper returns `object`: no concrete type may be named for its value\n if (!this.csharpCalleeResolves(initializer)) {\n return undefined;\n }\n return CSHARP_THIS_RETURN_TYPES[methodName];\n }\n if (target?.kind === SyntaxKind.Identifier) {\n return CSHARP_STATIC_RETURN_TYPES[(target.text as string) + '.' + methodName] ?? CSHARP_METHOD_RETURN_TYPES[methodName];\n }\n return CSHARP_METHOD_RETURN_TYPES[methodName];\n }\n\n // mirrors printWrappedUnknownThisProperty: a `this.(...)` call whose callee the\n // checker cannot resolve is printed as `callDynamically(this, \"\", ...)`, whose C#\n // signature returns `object` whatever the name says\n csharpCalleeResolves(node): boolean {\n const checker: any = this.checkerOrUndefined();\n if (checker === undefined) {\n return false;\n }\n return checker.getResolvedSignature(node)?.declaration !== undefined;\n }\n\n // the concrete C# type the initializer already produces, or undefined when the\n // printer cannot name it (this.safeString, getValue, add, parseInt, ... return object)\n csharpTypeOfInitializer(initializer): string | undefined {\n switch (initializer?.kind) {\n case SyntaxKind.StringLiteral:\n case SyntaxKind.NoSubstitutionTemplateLiteral:\n return 'string';\n case SyntaxKind.TrueKeyword:\n case SyntaxKind.FalseKeyword:\n return 'bool';\n case SyntaxKind.PrefixUnaryExpression:\n // `!x` prints `!isTrue(x)`\n return (initializer.operator === SyntaxKind.ExclamationToken) ? 'bool' : undefined;\n case SyntaxKind.ParenthesizedExpression:\n return this.csharpTypeOfInitializer(initializer.expression);\n case SyntaxKind.BinaryExpression: {\n const op = initializer.operatorToken.kind;\n // `a || b` prints `isTrue(a) || isTrue(b)`; the comparison wrappers and\n // `in` all return bool\n switch (op) {\n case SyntaxKind.BarBarToken:\n case SyntaxKind.AmpersandAmpersandToken:\n case SyntaxKind.EqualsEqualsToken:\n case SyntaxKind.EqualsEqualsEqualsToken:\n case SyntaxKind.ExclamationEqualsToken:\n case SyntaxKind.ExclamationEqualsEqualsToken:\n case SyntaxKind.GreaterThanToken:\n case SyntaxKind.GreaterThanEqualsToken:\n case SyntaxKind.LessThanToken:\n case SyntaxKind.LessThanEqualsToken:\n case SyntaxKind.InKeyword:\n return 'bool';\n }\n return undefined;\n }\n }\n return this.csharpCallReturnType(initializer) ?? (this.csharpBoolCallTyped(initializer) ? 'bool' : undefined);\n }\n\n // A `this.(...)` call to a method the enclosing class declares with a plain `bool` return\n // (csharpBooleanReturnType prints that `bool`) hands back an unboxed bool, so a local holding it is\n // `bool`. Base helpers, names the table answers and overloaded families keep their box.\n csharpBoolCallTyped(node): boolean {\n if (node?.kind !== SyntaxKind.CallExpression || !this.csharpIsCheckedBoolean(node)) {\n return false;\n }\n const expression = node.expression;\n if (expression?.kind !== SyntaxKind.PropertyAccessExpression || expression.expression?.kind !== SyntaxKind.ThisKeyword) {\n return false;\n }\n let declaration;\n let checker;\n try {\n checker = this.getChecker();\n declaration = checker.getResolvedSignature(node)?.declaration?.resolve();\n } catch (e) {\n return false;\n }\n if (!isMethodDeclaration(declaration) || (this.csharpBooleanReturnType(declaration) !== 'bool')) {\n return false;\n }\n const owner = findAncestor(declaration, isClassLikeDeclaration);\n if ((owner === undefined) || (owner !== findAncestor(node, isClassLikeDeclaration))) {\n return false;\n }\n return checker.getSymbolAtLocation(declaration.name)?.declarations?.length === 1;\n }\n\n csharpEnclosingFunction(node) {\n let current = node?.parent;\n while (current) {\n switch (current.kind) {\n case SyntaxKind.MethodDeclaration:\n case SyntaxKind.FunctionDeclaration:\n case SyntaxKind.FunctionExpression:\n case SyntaxKind.ArrowFunction:\n case SyntaxKind.Constructor:\n case SyntaxKind.SourceFile:\n return current;\n }\n current = current.parent;\n }\n return undefined;\n }\n\n csharpTypeNameIsShadowed(scope, csharpType: string): boolean {\n const names = csharpType.match(/[A-Za-z_]\\w*/g) ?? [];\n const relevant = names.filter((n) => CSHARP_TYPE_NAMES.indexOf(n) >= 0);\n if (relevant.length === 0 || scope === undefined) {\n return false;\n }\n return this.hasNodeWhere(scope, (n: any) => {\n const isBinding = (n.kind === SyntaxKind.Parameter) || (n.kind === SyntaxKind.VariableDeclaration);\n if (isBinding && (n.name?.kind === SyntaxKind.Identifier)) {\n const printed = this.printNode(n.name, 0);\n if (relevant.indexOf(printed) >= 0) { return true; }\n }\n return false;\n });\n }\n\n // reject the refinement when something downstream needs the local to stay `object`:\n // `x.push(v)` prints `((IList)x).Add(v)` on a value that must be boxed, a\n // later assignment of another concrete type would stop compiling, and `x++` prints\n // `postFixIncrement(ref x)` whose parameter is `ref object`\n csharpLocalIsSafeToType(scope, declaration, varName: string, csharpType: string, safeAccessor = false): boolean {\n if (scope === undefined) {\n return false;\n }\n return !this.hasNodeWhere(scope, (n: any) => {\n if ((n.kind === SyntaxKind.Identifier) && (n.text === varName) && (n !== declaration.name)) {\n const parent = n.parent;\n if (parent?.kind === SyntaxKind.VariableDeclaration && parent.name === n) {\n return; // a sibling block-scoped declaration; it gets its own type\n }\n if ((parent?.kind === SyntaxKind.PostfixUnaryExpression) || (parent?.kind === SyntaxKind.PrefixUnaryExpression)) {\n const op = parent.operator;\n if ((op === SyntaxKind.PlusPlusToken) || (op === SyntaxKind.MinusMinusToken)) {\n return true;\n }\n // prefixUnaryNeg/Plus(ref x) has int / Int64 / double twins only: a\n // nullable or reference local would not bind any overload\n if (safeAccessor && (op !== SyntaxKind.ExclamationToken) && (csharpType !== 'int') && (csharpType !== 'Int64') && (csharpType !== 'double')) {\n return true;\n }\n }\n if (parent?.kind === SyntaxKind.SpreadElement) {\n return true;\n }\n if (parent?.kind === SyntaxKind.ArrayLiteralExpression\n && parent.parent?.kind === SyntaxKind.BinaryExpression\n && parent.parent.left === parent\n && parent.parent.operatorToken.kind === SyntaxKind.EqualsToken) {\n return true;\n }\n if (parent?.kind === SyntaxKind.PropertyAccessExpression && parent.expression === n) {\n const method = parent.name?.text;\n // these print as `((IList)x).Add(...)` / `x = (x as IList)...`\n if ((method === 'push') || (method === 'reverse') || (method === 'sort')) {\n return true;\n }\n // the remaining list methods print an `((IList)x)` cast too; only\n // a safe* list local can carry one\n if (safeAccessor && !this.csharpTypeIsList(csharpType) && ((method === 'join') || (method === 'shift') || (method === 'pop'))) {\n return true;\n }\n }\n if (safeAccessor) {\n // `const [a, b] = x` prints a `((IList)x)[0]` read\n if (parent?.kind === SyntaxKind.VariableDeclaration && parent.name?.kind === SyntaxKind.ArrayBindingPattern && !this.csharpTypeIsList(csharpType)) {\n return true;\n }\n // `throw new ExchangeError (x)` wraps the argument in a hard `(string)`\n // cast, which only compiles from `object` or a string; `delete obj[x]` prints\n // `.Remove((string)x)`, the same hard cast\n if (!this.csharpTypeIsStringType(csharpType) && (this.csharpIsClassThrowArgument(n) || this.csharpIsDeleteKey(n))) {\n return true;\n }\n }\n if (parent?.kind === SyntaxKind.BinaryExpression && parent.left === n) {\n const op = parent.operatorToken.kind;\n if (op === SyntaxKind.EqualsToken) {\n if (this.csharpTypeOfInitializer(parent.right) !== csharpType) {\n return true;\n }\n } else if ((op >= SyntaxKind.FirstCompoundAssignment) && (op <= SyntaxKind.LastCompoundAssignment)) {\n return true;\n }\n }\n // a `string?` local as the LEFT operand of `+` prints add(, ...): the\n // nullable-to-`string` conversion makes add(string, ...) a better match than\n // add(object, object), which turns a null left into the right operand instead\n // of null (see the same rule in the ccxt cs/ccxt/base comments)\n if (safeAccessor && (csharpType === 'string?') && this.csharpIsLeftPlusOperand(n)) {\n return true;\n }\n }\n return false;\n });\n }\n\n // a `((string)x)` wrapper is redundant as soon as the receiver's static C# type is\n // already string: the cast names the box the value is in, it never changes the value\n\n getCSharpLocalType(declaration): string {\n const csharpType = this.csharpTypeOfInitializer(declaration.initializer);\n if (csharpType === undefined) {\n return this.VAR_TOKEN;\n }\n // the scan matches AST identifiers, so it needs the source name, not the\n // printed one (`string` is renamed to `str` on the way out)\n const sourceName = declaration.name?.text;\n if (sourceName === undefined) {\n return this.VAR_TOKEN;\n }\n const scope = this.csharpEnclosingFunction(declaration);\n const safeAccessor = this.csharpIsSafeAccessorCall(declaration.initializer);\n if (this.csharpTypeNameIsShadowed(scope, csharpType) || !this.csharpLocalIsSafeToType(scope, declaration, sourceName, csharpType, safeAccessor)) {\n return this.VAR_TOKEN;\n }\n return csharpType;\n }\n\n // `this.safeString2 (...)`: the printed call binds the concrete C# signature of the\n // same-name base helper (see CSHARP_THIS_RETURN_TYPES). Used to gate the extra sinks.\n csharpIsSafeAccessorCall(initializer): boolean {\n if (initializer?.kind !== SyntaxKind.CallExpression) {\n return false;\n }\n const expression = initializer.expression;\n if (expression?.kind !== SyntaxKind.PropertyAccessExpression || expression.expression?.kind !== SyntaxKind.ThisKeyword) {\n return false;\n }\n return CSHARP_SAFE_ACCESSOR_NAMES.indexOf(expression.name?.text as string) >= 0;\n }\n\n csharpTypeIsList(csharpType: string): boolean {\n return (csharpType === 'List') || (csharpType === 'IList');\n }\n\n csharpTypeIsStringType(csharpType: string): boolean {\n return (csharpType === 'string') || (csharpType === 'string?');\n }\n\n // `throw new ExchangeError (x)`: the printer wraps the argument in a hard `(string)`\n csharpIsClassThrowArgument(node): boolean {\n let current = node;\n while (current.parent) {\n const parent = current.parent;\n if ((parent.kind === SyntaxKind.ParenthesizedExpression) || (parent.kind === SyntaxKind.AsExpression)) {\n current = parent;\n continue;\n }\n if ((parent.kind === SyntaxKind.NewExpression) && (parent.arguments?.indexOf(current) >= 0)) {\n current = parent;\n continue;\n }\n return parent.kind === SyntaxKind.ThrowStatement;\n }\n return false;\n }\n\n // `delete obj[x]` prints `.Remove((string)x)`\n csharpIsDeleteKey(node): boolean {\n let value = node;\n while (value.parent && ((value.parent.kind === SyntaxKind.ParenthesizedExpression) || (value.parent.kind === SyntaxKind.AsExpression))) {\n value = value.parent;\n }\n const access = value.parent;\n return access?.kind === SyntaxKind.ElementAccessExpression && access.argumentExpression === value && access.parent?.kind === SyntaxKind.DeleteExpression;\n }\n\n // `(x) + y` / `x + y` prints `add(x, y)`: the parentheses keep x's static type\n csharpIsLeftPlusOperand(node): boolean {\n let value = node;\n while (value.parent && (value.parent.kind === SyntaxKind.ParenthesizedExpression)) {\n value = value.parent;\n }\n const parent = value.parent;\n if (parent?.kind !== SyntaxKind.BinaryExpression || parent.left !== value) {\n return false;\n }\n const op = parent.operatorToken.kind;\n return (op === SyntaxKind.PlusToken) || (op === SyntaxKind.PlusEqualsToken);\n }\n // the binding a bare identifier resolves to (a local, a parameter, ...) or undefined\n // for every other receiver shape (`this.x`, a call result, a destructured target)\n csharpReceiverBinding(receiver) {\n if (receiver?.kind !== SyntaxKind.Identifier) {\n return undefined;\n }\n const symbol = (this.getChecker() as Checker).getSymbolAtLocation(receiver);\n return symbol?.valueDeclaration?.resolve();\n }\n\n // The static C# type the emitted declaration gives a string-method receiver, or undefined when the\n // printer cannot name it (parameters, call results, ...). Only printer-typed locals are provable\n // here; the ccxt classifier overrides this hook to add the locals and parameters ITS tables retype.\n csharpStringReceiverType(receiver): string | undefined {\n const declaration = this.csharpReceiverBinding(receiver);\n if (declaration?.kind !== SyntaxKind.VariableDeclaration) {\n return undefined;\n }\n if ((declaration.parent as any)?.declarations?.length !== 1) {\n return undefined; // `object a = ..., b = ...` is printed as one statement\n }\n // memoized: the caller asks per receiver, getCSharpLocalType scans the scope\n const cached = this.stringReceiverTypes.get(declaration);\n if (cached !== undefined) {\n return (cached === '') ? undefined : cached;\n }\n const type = this.getCSharpLocalType(declaration);\n this.stringReceiverTypes.set(declaration, type ?? '');\n return type;\n }\n\n // the receiver of `x.Split/.ToUpper/.ToLower/.Replace/.Trim/.Length`, already printed:\n // bare when its static C# type is a string, wrapped in `((string)...)` otherwise (the\n // untyped emission is unchanged)\n csharpStringMethodReceiver(node, name) {\n const expression = node?.expression;\n const receiver = (node?.kind === SyntaxKind.CallExpression)\n ? ((expression?.kind === SyntaxKind.PropertyAccessExpression) ? expression.expression : undefined)\n : expression;\n const type = this.csharpStringReceiverType(receiver);\n return ((type === 'string') || (type === 'string?')) ? name : `((string)${name})`;\n }\n\n // The declared C# type of the `Variable` holder of a destructuring block, or undefined\n // (keeps a `var` holder read via `((IList)holder)[i]`). The ccxt classifier overrides this\n // for the tuple-returning `handle*AndParams` family: holder is `IList`, read directly.\n csharpDestructuringTempType(initializer): string | undefined {\n return undefined;\n }\n\n // whether the typed holder needs the `(T)` cast on its printed initializer; a consumer that\n // proves the printed call already returns T (or a subtype) answers false\n csharpDestructuringTempNeedsCast(initializer, printedExpression: string): boolean {\n return true;\n }\n\n // `isTrue (x)` is the identity on a C# `bool`, and `x == true` is what it computes for a `bool?`\n // (null -> false), so in a condition the wrapper adds nothing. The hook answers the emitted\n // declaration's type (getCSharpLocalType, plus classifier retypes); unnamed operands keep isTrue.\n csharpConditionOperandType(node) {\n const declaration = this.csharpReceiverBinding(node);\n if (declaration?.kind !== SyntaxKind.VariableDeclaration) {\n return undefined; // a parameter / member read has no declaration this pass retypes\n }\n if ((declaration.parent as any)?.declarations?.length !== 1) {\n return undefined; // `object a = ..., b = ...` is printed as one statement\n }\n // memoized: the caller asks per operand, getCSharpLocalType scans the scope\n const cached = this.conditionOperandTypes.get(declaration);\n if (cached !== undefined) {\n return (cached === '') ? undefined : cached;\n }\n const type = this.getCSharpLocalType(declaration);\n const result = ((type === 'bool') || (type === 'bool?')) ? type : undefined;\n this.conditionOperandTypes.set(declaration, result ?? '');\n return result;\n }\n\n // the native spelling of a condition operand, or undefined when it needs `isTrue`.\n // `!x == true` would parse as `(!x) == true`, so the `bool?` form takes parentheses\n // under the `!` operator; every other allowed position binds `==` tighter already.\n csharpNativeCondition(node, identation) {\n const type = this.csharpConditionOperandType(node);\n if (type === undefined) {\n return undefined;\n }\n const text = this.printNode(node, 0);\n if (type === 'bool') {\n return this.getIden(identation) + text;\n }\n const equalsTrue = text + ' == true';\n const parent = node.parent;\n const negated = (parent?.kind === SyntaxKind.PrefixUnaryExpression) && (parent.operator === SyntaxKind.ExclamationToken);\n return this.getIden(identation) + (negated ? `(${equalsTrue})` : equalsTrue);\n }\n\n // `!x` on the `bool?` the hook names prints `x != true`: exactly `!(x == true)` (null -> true)\n // and the value isTrue computes for the box. A `bool` operand keeps the base `!x`; an operand\n // the hook cannot name keeps `!isTrue(x)` (the untyped emission is untouched).\n csharpNegatedConditionOperand(operand) {\n if (operand?.kind !== SyntaxKind.Identifier) {\n return undefined;\n }\n if (this.csharpConditionOperandType(operand) !== 'bool?') {\n return undefined;\n }\n return `${this.printNode(operand, 0)} != true`;\n }\n\n // only the if / while / && / || / ! condition positions print natively through this gate; the\n // ternary condition has its own hook-driven fold (csharpTernaryConditionOperand, U56) because\n // its operand is a plain value position the base printCondition path never asks about.\n csharpConditionPositionAllowsNative(node) {\n const parent = node?.parent;\n switch (parent?.kind) {\n case SyntaxKind.IfStatement:\n return parent.expression === node;\n case SyntaxKind.WhileStatement:\n return parent.expression === node;\n case SyntaxKind.PrefixUnaryExpression:\n return (parent.operator === SyntaxKind.ExclamationToken) && (parent.operand === node);\n case SyntaxKind.BinaryExpression: {\n const op = parent.operatorToken?.kind;\n return ((op === SyntaxKind.AmpersandAmpersandToken) || (op === SyntaxKind.BarBarToken))\n && ((parent.left === node) || (parent.right === node));\n }\n }\n return false;\n }\n\n printVariableDeclarationList(node,identation) {\n const declaration = node.declarations[0];\n // const name = declaration.name.text;\n\n if (this.removeVariableDeclarationForFunctionExpression && declaration?.initializer && isFunctionExpression(declaration.initializer)) {\n return this.printNode(declaration.initializer, identation).trimEnd();\n }\n // handle array binding : input: const [a,b] = this.method()\n // output: var abVar = this.method; var a = abVar[0]; var b = abVar[1];\n if (declaration?.name.kind === SyntaxKind.ArrayBindingPattern) {\n const arrayBindingPattern = declaration.name;\n const arrayBindingPatternElements = arrayBindingPattern.elements;\n const parsedArrayBindingElements = arrayBindingPatternElements.map((e) => this.printNode(e.name, 0));\n const syntheticName = parsedArrayBindingElements.join(\"\") + \"Variable\";\n\n // typed holder (see csharpDestructuringTempType): same value, read without the re-cast\n const tempType = this.csharpDestructuringTempType(declaration.initializer);\n const tempExpression = this.printNode(declaration.initializer, 0);\n const tempCast = (tempType && this.csharpDestructuringTempNeedsCast(declaration.initializer, tempExpression)) ? `(${tempType})` : '';\n const tempDeclaration = tempType ? `${tempType} ${syntheticName} = ${tempCast}${tempExpression}` : `var ${syntheticName} = ${tempExpression}`;\n\n let arrayBindingStatement = `${this.getIden(identation)}${tempDeclaration};\\n`;\n\n parsedArrayBindingElements.forEach((e, index) => {\n // const type = this.getType(node);\n // const parsedType = this.getTypeFromRawType(type);\n const statement = this.getIden(identation) + `var ${e} = ` + (tempType ? `${syntheticName}[${index}]` : `((IList) ${syntheticName})[${index}]`);\n if (index < parsedArrayBindingElements.length - 1) {\n arrayBindingStatement += statement + \";\\n\";\n } else {\n // printStatement adds the last ;\n arrayBindingStatement += statement;\n }\n });\n\n return arrayBindingStatement;\n }\n\n const isNew = declaration?.initializer && (declaration.initializer.kind === SyntaxKind.NewExpression);\n\n // handle the let id: Str; case (default undefined initialization)\n if (!declaration.initializer) {\n return this.getIden(identation) + 'object ' + this.printNode(declaration.name) + \" = \" + this.UNDEFINED_TOKEN;\n }\n const parsedValue = this.printNode(declaration.initializer, identation).trimStart();\n if (parsedValue === this.UNDEFINED_TOKEN) {\n let specificVarToken = \"object\";\n if (this.INFER_VAR_TYPE) {\n const variableType = this.getChecker().typeToString(this.getChecker().getTypeAtLocation(declaration));\n if (this.VariableTypeReplacements[variableType]) {\n specificVarToken = this.VariableTypeReplacements[variableType] + '?';\n }\n }\n return this.getIden(identation) + specificVarToken + \" \" + this.printNode(declaration.name) + \" = \" + parsedValue;\n }\n const declaredType = isNew ? 'var' : this.getCSharpLocalType(declaration);\n // remember the concrete types this printer declared itself: the printed prefix is\n // final (a host wrapper only rewrites untyped `object = ` declarations), so\n // the local's static type is known at every later read\n if (!isNew && node.declarations.length === 1 && this.csharpTypeIsNative(declaredType)) {\n this.csharpTypedLocals.set(declaration, declaredType);\n }\n return this.getIden(identation) + declaredType + \" \" + this.printNode(declaration.name) + \" = \" + parsedValue;\n }\n\n transformPropertyAcessExpressionIfNeeded(node) {\n const expression = node.expression;\n const leftSide = this.printNode(expression, 0);\n const rightSide = node.name.text;\n\n let rawExpression = undefined;\n\n switch(rightSide) {\n case 'length':\n const type = (this.getChecker() as Checker).getTypeAtLocation(expression); // eslint-disable-line\n this.warnIfAnyType(node, type.flags, leftSide, \"length\");\n // rawExpression = this.isStringType(type.flags) ? `(string${leftSide}).Length` : `(${leftSide}.Cast().ToList()).Count`;\n rawExpression = this.isStringType(type.flags) ? `${this.csharpStringMethodReceiver(node, leftSide)}.Length` : (this.csharpNativeLengthExpression(expression) ?? `${this.ARRAY_LENGTH_WRAPPER_OPEN}${leftSide}${this.ARRAY_LENGTH_WRAPPER_CLOSE}`); // `(${leftSide}.Cast()).ToList().Count`\n break;\n case 'push':\n rawExpression = `((IList)${leftSide}).Add`;\n break;\n // case 'push':\n // rawExpression = `(List${leftSide}).Add`s\n // break;\n }\n return rawExpression;\n }\n\n printCustomDefaultValueIfNeeded(node) {\n if (isArrayLiteralExpression(node) || isObjectLiteralExpression(node) || isStringLiteral(node) || isBooleanLiteral(node)\n || isNumericLiteral(node)) {\n return this.UNDEFINED_TOKEN;\n }\n\n // convert x: number = undefined (invalid) into x = -1 (valid)\n if (node?.text === \"undefined\" && this.getChecker().getTypeAtLocation(node?.parent)?.flags === TypeFlags.Number) {\n // return \"-1\";\n return this.UNDEFINED_TOKEN;\n }\n\n return undefined;\n }\n\n printFunctionBody(node, identation) {\n\n // check if there is any default parameter to initialize\n const funcParams = node.parameters;\n const initParams = [];\n if (funcParams.length > 0) {\n const body = node.body.statements;\n const first = body.length > 0 ? body[0] : [];\n const remaining = body.length > 0 ? body.slice(1): [];\n let firstStatement = this.printNode(first, identation + 1);\n\n const remainingString = remaining.map((statement) => this.printNode(statement, identation + 1)).join(\"\\n\");\n funcParams.forEach((param) => {\n const initializer = param.initializer;\n if (initializer) {\n if (isArrayLiteralExpression(initializer)) {\n initParams.push(`${this.printNode(param.name, 0)} ??= new List();`);\n }\n if (isObjectLiteralExpression(initializer)) {\n initParams.push(`${this.printNode(param.name, 0)} ??= new Dictionary();`);\n }\n if (isNumericLiteral(initializer) || isStringLiteral(initializer) || isBooleanLiteral(initializer)) {\n initParams.push(`${this.printNode(param.name, 0)} ??= ${this.printNode(initializer, 0)};`);\n }\n }\n });\n\n if (initParams.length > 0) {\n const defaultInitializers = initParams.map( l => this.getIden(identation+1) + l ).join(\"\\n\") + \"\\n\";\n const bodyParts = firstStatement.split(\"\\n\");\n const commentPart = bodyParts.filter(line => this.isComment(line));\n const isComment = commentPart.length > 0;\n if (isComment) {\n const commentPartString = commentPart.map((c) => this.getIden(identation+1) + c.trim()).join(\"\\n\");\n const firstStmNoComment = bodyParts.filter(line => !this.isComment(line)).join(\"\\n\");\n firstStatement = commentPartString + \"\\n\" + defaultInitializers + firstStmNoComment;\n } else {\n firstStatement = defaultInitializers + firstStatement;\n }\n }\n const blockOpen = this.getBlockOpen(identation);\n const blockClose = this.getBlockClose(identation);\n firstStatement = remainingString.length > 0 ? firstStatement + \"\\n\" : firstStatement;\n return blockOpen + firstStatement + remainingString + blockClose;\n }\n\n return super.printFunctionBody(node, identation);\n }\n\n printInstanceOfExpression(node, identation) {\n const left = node.left.text;\n const right = node.right.text;\n return this.getIden(identation) + `${left} is ${right}`;\n }\n\n printAsExpression(node, identation) {\n const type = node.type;\n\n if (type.kind === SyntaxKind.AnyKeyword) {\n return `((object)${this.printNode(node.expression, identation)})`;\n }\n\n if (type.kind === SyntaxKind.StringKeyword) {\n return `((string)${this.printNode(node.expression, identation)})`;\n }\n\n if (type.kind === SyntaxKind.ArrayType) {\n if (type.elementType.kind === SyntaxKind.AnyKeyword) {\n return `(IList)(${this.printNode(node.expression, identation)})`;\n }\n if (type.elementType.kind === SyntaxKind.StringKeyword) {\n // ts 'as string[]' is a compile-time-only assertion with no runtime\n // effect, and C# IList is invariant in BOTH directions: a hard\n // (IList) cast throws on the untyped core's List\n // (ccxt cs ws test lane, https://github.com/ccxt/ccxt/actions/runs/31173663316)\n // while a hard (IList) cast throws on genuinely typed\n // List values (starknet typedData via the paradex broker-id\n // leg, https://github.com/ccxt/ccxt/actions/runs/31322911365). The\n // honest emission is the bare expression, like the fallthrough below.\n return this.printNode(node.expression, identation);\n }\n }\n\n return this.printNode(node.expression, identation);\n }\n\n // A parameter of a method that participates in an override relation prints the spelling its\n // base member and every sibling override agree on (CSHARP_OVERRIDE_PARAM_TYPES; D8): C# is\n // invariant on override parameter types, so a half-retyped name is CS0115, while a name the\n printParameterType(node) {\n if (node === undefined || node.kind !== SyntaxKind.Parameter) {\n return super.printParameterType(node);\n }\n const method: any = findAncestor(node, (n) => isMethodDeclaration(n));\n const name = method === undefined || method.name === undefined ? undefined : method.name.getText().trim();\n const row = name === undefined ? undefined : CSHARP_OVERRIDE_PARAM_TYPES[name as string];\n const wanted = row === undefined ? undefined : row[method.parameters.indexOf(node)];\n if (wanted === undefined || this.csharpOverrideParamSpelling(node) !== wanted) {\n return super.printParameterType(node);\n }\n return wanted;\n }\n\n // checker spelling of a parameter the override table covers: a dictionary-shaped type (string\n // index signature, never a class instance or a callable) or an array of any/dictionary cells\n csharpOverrideParamSpelling(node): string | undefined {\n const type = this.getChecker().getTypeAtLocation(node);\n if (type === undefined || !type.isUnionType()) {\n return this.csharpOverrideParamSpellingOfType(type, 1);\n }\n const arms = type.getTypes().filter((m) => !(m.flags & (TypeFlags.Undefined | TypeFlags.Null)));\n return this.csharpOverrideParamSpellingOfType(arms[0], arms.length);\n }\n\n csharpOverrideParamSpellingOfType(type, unionArms = 1): string | undefined {\n if (type === undefined || unionArms !== 1) {\n return undefined;\n }\n if (type.flags & (TypeFlags.TypeParameter | TypeFlags.Any | TypeFlags.Unknown | TypeFlags.EnumLike)) {\n return undefined;\n }\n const checker = this.getChecker();\n if (checker.isArrayType(type) || checker.isTupleType(type)) {\n const el = (checker.getTypeArguments(type) || [])[0];\n if (el === undefined) {\n return undefined;\n }\n if (el.flags & (TypeFlags.Any | TypeFlags.Unknown)) {\n return 'IList';\n }\n return this.csharpOverrideParamSpellingOfType(el) === 'IDictionary' ? 'IList' : undefined;\n }\n if (checker.getIndexTypeOfType(type, IndexKind.String) === undefined) {\n return undefined;\n }\n const declarations = type.getSymbol()?.declarations ? type.getSymbol().declarations.map((d) => d.resolve()) : [];\n if (declarations.some((d) => d.kind === SyntaxKind.ClassDeclaration)) {\n return undefined; // a class instance is not a JSON dictionary\n }\n if (type.getCallSignatures && type.getCallSignatures().length > 0) {\n return undefined; // a callable is not a JSON dictionary\n }\n return 'IDictionary';\n }\n\n printParameter(node, defaultValue = true) {\n const name = this.printNode(node.name, 0);\n const initializer = node.initializer;\n\n const handlerType = this.csharpHandlerMessageType(node);\n if (handlerType !== undefined) {\n // the printed declaration is final, so every read of the parameter is that\n // dictionary and the member reads replace getValue/getArrayLength/inOp\n this.csharpTypedLocals.set(node, handlerType);\n }\n let type = handlerType !== undefined ? handlerType : this.printParameterType(node);\n type = type ? type : \"\";\n this.csharpParamTypes.set(node, type); // see csharpPrintedParamType\n\n if (defaultValue) {\n if (initializer) {\n const customDefaultValue = this.printCustomDefaultValueIfNeeded(initializer);\n const defaultValue = customDefaultValue ? customDefaultValue : this.printNode(initializer, 0);\n type = (defaultValue === \"null\" && type !== \"object\") ? type + \"? \": type + \" \";\n return type + name + this.SPACE_DEFAULT_PARAM + \"=\" + this.SPACE_DEFAULT_PARAM + defaultValue;\n }\n return type + \" \" + name;\n }\n return name;\n }\n\n // getFunctionType for a call site: TS7's getSignatureFromDeclaration panics on a CallExpression\n // (TS6 returned the resolved call signature there), so resolve the call itself\n csharpCallSiteFunctionType(node) {\n const checker = this.getChecker();\n const type = checker.getReturnTypeOfSignature(checker.getResolvedSignature(node));\n const parsedType = this.getTypeFromRawType(type);\n if (parsedType !== this.PROMISE_TYPE_KEYWORD) {\n return parsedType;\n }\n const typeArguments = checker.getTypeArguments(type as any);\n if (typeArguments.length === 0 || (typeArguments.length === 1 && typeArguments[0].flags === TypeFlags.Void)) {\n return this.PROMISE_TYPE_KEYWORD;\n }\n const insideTypes = typeArguments.map((t) => this.getTypeFromRawType(t)).join(\",\");\n return (insideTypes.length > 0) ? `${this.PROMISE_TYPE_KEYWORD}<${insideTypes}>` : undefined;\n }\n\n printArrayLiteralExpression(node) {\n\n let arrayOpen = this.ARRAY_OPENING_TOKEN;\n const elems = node.elements;\n\n const elements = node.elements.map((e) => this.printNode(e)).join(\", \");\n\n // take into consideration list of promises\n if (elems.length > 0) {\n const first = elems[0];\n if (first.kind === SyntaxKind.CallExpression) {\n // const type = this.getChecker().getTypeAtLocation(first);\n let type = this.csharpCallSiteFunctionType(first);\n // const parsedType = this.getTypeFromRawType(type);\n // parsedType === \"Task\" ||\n // to do check this later\n if (type === undefined || elements.indexOf(this.UKNOWN_PROP_ASYNC_WRAPPER_OPEN) > -1) {\n // if (type === undefined) {\n arrayOpen = \"new List {\";\n // }\n // else {\n // arrayOpen = \"new List> {\";\n // }\n } else {\n type = 'object';\n // check this out later\n // if (type === 'Task>') {\n // type = 'Task';\n // }\n // if (type === 'string'){\n // type = 'object';\n // }\n // type =\n arrayOpen = `new List<${type}> {`;\n }\n }\n }\n\n return arrayOpen + elements + this.ARRAY_CLOSING_TOKEN;\n }\n\n // A method declared `: boolean` / `: boolean | undefined` (or an alias of either) returns a\n // C# `bool` / `bool?` instead of `object`. Only non-async methods with an explicit annotation\n // qualify: `undefined`/`null` union members make the result nullable, any other member (or an\n // inferred type) keeps the upstream `object`. The nullable spelling is what keeps a missing\n // key a missing key — plain `bool` would turn it into `false`.\n csharpBooleanReturnType(node): string | undefined {\n if (node?.kind !== SyntaxKind.MethodDeclaration || this.isAsyncFunction(node)) {\n return undefined;\n }\n if (this.csharpBooleanReturnTypes.has(node)) {\n return this.csharpBooleanReturnTypes.get(node);\n }\n let result: string | undefined = undefined;\n if (node.type) {\n const type = this.getChecker().getTypeFromTypeNode(node.type);\n const members = type.isUnionType() ? type.getTypes() : [ type ];\n let nullable = false;\n let sawBoolean = false;\n let sawOther = false;\n for (const member of members) {\n if (member.flags & (TypeFlags.Undefined | TypeFlags.Null)) {\n nullable = true;\n } else if (member.flags & TypeFlags.BooleanLike) {\n sawBoolean = true;\n } else {\n sawOther = true;\n }\n }\n if (sawBoolean && !sawOther) {\n result = nullable ? this.BOOLEAN_KEYWORD + '?' : this.BOOLEAN_KEYWORD;\n }\n } else {\n // an un-annotated override inherits the parent's printed return type\n // (printMethodDefinition), so its returns need the same unboxing\n result = this.csharpBooleanReturnType(this.getMethodOverride(node));\n }\n this.csharpBooleanReturnTypes.set(node, result);\n return result;\n }\n\n printFunctionType(node) {\n const booleanType = this.csharpBooleanReturnType(node);\n if (booleanType !== undefined) {\n return booleanType;\n }\n return super.printFunctionType(node);\n }\n\n // `return x;` inside a bool/bool? method: the printed expression is still the `object`\n // box the rest of the printer produces, so unbox it through `object`. The nullable\n // spelling `(bool?)((object)(x))` accepts null; the non-nullable one needs the\n // null-forgiving `!` on the box (CS8605 under TreatWarningsAsErrors otherwise) — which is\n // exactly the runtime NullReferenceException a `: boolean` method returning null deserves\n printReturnStatement(node, identation) {\n // nearest function-like: a `return` inside an arrow/function expression belongs to\n // that callback, never to the enclosing bool method\n const booleanType = this.csharpBooleanReturnType(findAncestor(node.parent, isFunctionLike));\n if (booleanType === undefined || !node.expression) {\n return super.printReturnStatement(node, identation);\n }\n const leadingComment = this.printLeadingComments(node, identation);\n let trailingComment = this.printTraillingComment(node, identation);\n trailingComment = trailingComment ? \" \" + trailingComment : trailingComment;\n const value = this.printNode(node.expression, identation).trim();\n const forgiving = booleanType.endsWith('?') ? '' : '!';\n return leadingComment + this.getIden(identation) + this.RETURN_TOKEN + ` ((${booleanType})((object)(${value}))${forgiving})` + this.LINE_TERMINATOR + trailingComment;\n }\n\n printMethodDefinition(node, identation) {\n let name = node.name.text;\n name = this.transformMethodNameIfNeeded(name);\n\n let returnType = this.printFunctionType(node);\n\n let modifiers = this.printModifiers(node);\n const defaultAccess = this.METHOD_DEFAULT_ACCESS ? this.METHOD_DEFAULT_ACCESS + \" \": \"\";\n modifiers = modifiers ? modifiers + \" \" : defaultAccess; // tmp check this\n\n modifiers = modifiers.indexOf(\"public\") === -1 && modifiers.indexOf(\"private\") === -1 && modifiers.indexOf(\"protected\") === -1 ? defaultAccess + modifiers : modifiers;\n\n let parsedArgs = undefined;\n // c# only move this elsewhere (csharp transpiler)\n const methodOverride = this.getMethodOverride(node) as any;\n const isOverride = methodOverride !== undefined;\n modifiers = isOverride ? modifiers + \"override \" : modifiers + \"virtual \";\n\n // infer parent return type\n if (isOverride && (returnType === \"object\" || returnType === \"Task\")) {\n returnType = this.printFunctionType(methodOverride);\n }\n\n // ts does not infer parameters types of overriden methods :x , so we need some\n // heuristic here to infer the types\n if (isOverride && node.parameters.length > 0) {\n const first = node.parameters[0];\n const firstType = this.getType(first);\n\n if (firstType === undefined) {\n // use the override version, check this out later\n // parsedArgs = this.printMethodParameters(methodOverride);\n const currentArgs = node.parameters;\n const parentArgs = methodOverride.parameters;\n parsedArgs = parentArgs.map((param, index) => this.printParameteCustomName(param, this.printNode(currentArgs[index].name, 0))).join(\", \");\n }\n }\n\n parsedArgs = parsedArgs ? parsedArgs : this.printMethodParameters(node);\n\n returnType = returnType ? returnType + \" \" : returnType;\n\n const methodToken = this.METHOD_TOKEN ? this.METHOD_TOKEN + \" \" : \"\";\n const methodDef = this.getIden(identation) + modifiers + returnType + methodToken + name\n + \"(\" + parsedArgs + \")\";\n\n return this.printNodeCommentsIfAny(node, identation, methodDef);\n }\n\n // check this out later\n\n printArrayIsArrayCall(node, identation, parsedArg = undefined) {\n return `((${parsedArg} is IList) || (${parsedArg}.GetType().IsGenericType && ${parsedArg}.GetType().GetGenericTypeDefinition().IsAssignableFrom(typeof(List<>))))`;\n }\n\n printObjectKeysCall(node, identation, parsedArg = undefined) {\n // `Object.keys(x)` on a receiver the classifier declared a concrete dictionary: the\n // cast only named the box; `.Keys` is the same collection either way\n if ((node?.arguments?.length === 1) && this.csharpReceiverIsDeclaredDictionary(node.arguments[0])) {\n return `new List(${parsedArg}.Keys)`;\n }\n return `new List(((IDictionary)${parsedArg}).Keys)`;\n }\n\n printObjectValuesCall(node, identation, parsedArg = undefined) {\n if ((node?.arguments?.length === 1) && this.csharpReceiverIsDeclaredDictionary(node.arguments[0])) {\n return `new List(${parsedArg}.Values)`;\n }\n return `new List(((IDictionary)${parsedArg}).Values)`;\n }\n\n printJsonParseCall(node, identation, parsedArg = undefined) {\n return `parseJson(${parsedArg})`;\n }\n\n printJsonStringifyCall(node, identation, parsedArg = undefined) {\n return `json(${parsedArg})`; // make this customizable\n }\n\n printPromiseAllCall(node, identation, parsedArg = undefined) {\n return `promiseAll(${parsedArg})`;\n }\n\n printMathFloorCall(node, identation, parsedArg = undefined) {\n return `(Math.Floor(Double.Parse((${parsedArg}).ToString())))`;\n }\n\n printMathRoundCall(node, identation, parsedArg = undefined) {\n return `Math.Round(Convert.ToDouble(${parsedArg}))`;\n }\n\n printMathCeilCall(node, identation, parsedArg = undefined) {\n return `Math.Ceiling(Convert.ToDouble(${parsedArg}))`;\n }\n\n printNumberIsIntegerCall(node: any, identation: any, parsedArg?: any) {\n return `((${parsedArg} is int) || (${parsedArg} is long) || (${parsedArg} is Int32) || (${parsedArg} is Int64))`;\n }\n\n printArrayPushCall(node, identation, name = undefined, parsedArg = undefined) {\n // `x.push (v)` on a receiver whose printed declaration already IS a list needs no cast:\n // (IList)x is an identity conversion and `.Add` binds the same ICollection.Add.\n // An `object` receiver (and every receiver this printer cannot name) keeps the cast.\n if (this.csharpReceiverIsDeclaredList(node?.expression?.expression)) {\n return `${name}.Add(${parsedArg})`;\n }\n return `((IList)${name}).Add(${parsedArg})`;\n }\n\n // The C# type the emitted declaration gives a local / operand read (`string`, `List`,\n // `Dictionary`, ...), or undefined. Installed by build/csharp-local-types.js, which\n // retypes the declaration AFTER printing. Undefined by default: callers keep the helper form.\n csharpLocalTypeOf(node): string | undefined {\n return undefined;\n }\n\n // U55: the emitted C# type of an identifier operand of a null comparison, installed by\n // build/csharp-local-types.js from the PRINTED declaration lines (retyped after printing, so the\n // printer cannot see it). Undefined by default: every null comparison keeps isEqual unchanged.\n csharpNullComparisonTypeOf(node): string | undefined {\n return undefined;\n }\n\n // `add (x, y)` -> `(x + y)` when the classifier proves the LEFT operand's emitted declaration is a\n // string (U57): add(string, string) / add(string, object) compute exactly C# concatenation, nulls\n // included. Undefined keeps the helper; parenthesised because `+` binds looser in embedded text.\n csharpNativeStringConcat(left, right, leftText: string, rightText: string): string | undefined {\n return undefined;\n }\n\n // The emitted declaration type of a local read the embedding build layer retypes AFTER\n // printing (ccxt: build/csharp-local-types.js): the dict type for the `key in x` rule,\n // undefined for every receiver it does not retype. Undefined by default.\n csharpDeclaredDictReceiverType(node): string | undefined {\n return undefined;\n }\n\n // is this receiver expression, as printed, a local declared List /\n // IList? Only a bare identifier reads the type hook; a parameter (printed\n // `object`), a member read and every composite expression keep the cast.\n csharpReceiverIsDeclaredList(receiver): boolean {\n if (receiver?.kind !== SyntaxKind.Identifier) {\n return false;\n }\n const type = (typeof this.csharpLocalTypeOf === 'function') ? this.csharpLocalTypeOf(receiver) : undefined;\n return (type === 'List') || (type === 'IList');\n }\n\n printIncludesCall(node, identation, name = undefined, parsedArg = undefined) {\n return `${name}.Contains(${parsedArg})`;\n }\n\n // `x.indexOf (y)` prints `x`'s own member when the printer proves the receiver holds a\n // string or a list at this read and can name that C# type; every other receiver keeps the\n // runtime getIndexOf helper, which is the only form that answers -1 for a null box.\n printIndexOfCall(node, identation, name = undefined, parsedArg = undefined) {\n const native = this.csharpNativeIndexOfCall(node, name, parsedArg);\n if (native !== undefined) {\n return native;\n }\n return `${this.INDEXOF_WRAPPER_OPEN}${name}, ${parsedArg}${this.INDEXOF_WRAPPER_CLOSE}`;\n }\n\n // the helper's `(string)` branch spelled natively: `((string)x).IndexOf(needle, Ordinal)` is\n // the ordinal scan TS indexOf performs (not-found stays -1, an empty needle stays 0); a\n // `List` local takes its own IndexOf, a possibly-null box keeps the helper\n csharpNativeIndexOfCall(node, name = undefined, parsedArg = undefined): string | undefined {\n const receiver = node?.expression?.expression;\n if (receiver === undefined || name === undefined) {\n return undefined;\n }\n const declared = this.csharpExpressionTypeOf(receiver);\n if (this.csharpIndexOfReceiverHoldsString(node, receiver, declared)) {\n const needle = this.csharpNativeIndexOfNeedle(node.arguments?.[0], parsedArg);\n if (needle === undefined) {\n return undefined;\n }\n // the helper's own `((string)str)` cast; a cast the printer already emitted is final\n const casted = name.startsWith('((string)') ? name : `((string)${name})`;\n return `${casted}.IndexOf(${needle}, StringComparison.Ordinal)`;\n }\n if ((declared === 'List') || (declared === 'IList')) {\n return `((${declared})${name}).IndexOf(${parsedArg})`;\n }\n // a `string?` local holds a string or null: `?.` answers the helper's -1 for null; the\n // needle is a literal or a local, so skipping its evaluation on null changes nothing\n const key = node.arguments?.[0];\n const plainNeedle = (key !== undefined) && (isStringLiteralLikeNode(key) || isIdentifier(key));\n if ((declared === 'string?') && isIdentifier(receiver) && plainNeedle) {\n const needle = this.csharpNativeIndexOfNeedle(node.arguments?.[0], parsedArg);\n if (needle !== undefined) {\n return `(${name}?.IndexOf(${needle}, StringComparison.Ordinal) ?? -1)`;\n }\n }\n return undefined;\n }\n\n // the receiver is a string the helper would scan and no null can reach the read: a C#\n // `string` declaration, a checker `string`/literal whose own declaration is a plain\n // non-optional `string` (`as string` included), or a value a `!== undefined` test admits\n csharpIndexOfReceiverHoldsString(node, receiver, declared): boolean {\n if (declared === 'string') {\n return true;\n }\n if ((declared !== undefined) && (declared !== 'string?')) {\n return false; // a named C# type that is not a string\n }\n if (!this.csharpIndexOfReceiverIsCheckedString(receiver)) {\n return false;\n }\n return this.csharpNullGuardAdmitsRead(node, receiver) || ((declared === undefined) && this.csharpReceiverDeclaredNonNullString(receiver));\n }\n\n // the checker's view of the receiver: exactly `string` / a string literal. `any` (could box\n // anything) and `string[]` (boxes a List where the helper casts its target) are not\n csharpIndexOfReceiverIsCheckedString(receiver): boolean {\n const checker: any = this.checkerOrUndefined();\n if (checker === undefined) {\n return false; // in-memory program without a checker\n }\n const type = checker.getTypeAtLocation(receiver);\n return this.isStringType(type?.flags);\n }\n\n // the receiver's own declaration says non-optional `string` (params, fields, locals), or the\n // source pinned a string itself (a literal, an `as string` assertion). The `Str` alias and\n // `= undefined` fields hold the undefined the helper answers -1 for: they need the guard\n csharpReceiverDeclaredNonNullString(receiver): boolean {\n const kind = receiver?.kind;\n if ((kind === SyntaxKind.StringLiteral) || (kind === SyntaxKind.NoSubstitutionTemplateLiteral)) {\n return true;\n }\n if (kind === SyntaxKind.ParenthesizedExpression) {\n return this.csharpReceiverDeclaredNonNullString(receiver.expression);\n }\n if ((kind === SyntaxKind.AsExpression) && (receiver.type?.kind === SyntaxKind.StringKeyword)) {\n return true; // the source itself pinned a string here\n }\n const checker: any = this.checkerOrUndefined();\n if (checker === undefined) {\n return false;\n }\n const symbol = checker.getSymbolAtLocation(receiver);\n const declarations: any[] = (symbol?.declarations ?? []).map((d) => d.resolve());\n return (declarations.length > 0) && declarations.every((declaration) => this.csharpDeclarationIsNonNullString(declaration));\n }\n\n csharpDeclarationIsNonNullString(declaration): boolean {\n const annotation: any = declaration?.type;\n if (declaration?.kind === SyntaxKind.Parameter) {\n return (declaration.questionToken === undefined) && (declaration.dotDotDotToken === undefined)\n && ((annotation?.kind === SyntaxKind.StringKeyword) || ((annotation === undefined) && isStringLiteralLikeNode(declaration.initializer)));\n }\n const isField = isPropertyDeclaration(declaration) || isPropertySignatureDeclaration(declaration);\n if (isVariableDeclaration(declaration) || isField) {\n if ((declaration as any).questionToken !== undefined) {\n return false;\n }\n if (annotation !== undefined) {\n // `apiKey: string = undefined` holds undefined until the credentials are set\n return (annotation.kind === SyntaxKind.StringKeyword) && !this.csharpInitializerIsUndefined((declaration as any).initializer);\n }\n return isStringLiteralLikeNode((declaration as any).initializer);\n }\n return false;\n }\n\n csharpInitializerIsUndefined(initializer): boolean {\n return (initializer?.kind === SyntaxKind.NullKeyword)\n || ((initializer?.kind === SyntaxKind.Identifier) && (initializer.text === 'undefined'));\n }\n\n // a `x !== undefined` / `x !== null` (or `!= null`) test in a branch that admits the read:\n // inside the right operand of its `&&`, inside the then-branch of its `if`, or after an\n // early-exiting `if (x === undefined) { return/throw/continue/break }`\n csharpNullGuardAdmitsRead(node, receiver): boolean {\n if (!isIdentifier(receiver)) {\n return false;\n }\n const checker: any = this.checkerOrUndefined();\n if (checker === undefined) {\n return false;\n }\n const symbol = checker.getSymbolAtLocation(receiver);\n if (symbol === undefined) {\n return false;\n }\n const scope = this.csharpEnclosingFunction(node);\n let current: any = node;\n while (current !== undefined) {\n const parent: any = current.parent;\n if (parent === undefined) {\n return false;\n }\n if ((parent.kind === SyntaxKind.BinaryExpression) && (parent.operatorToken.kind === SyntaxKind.AmpersandAmpersandToken)\n && this.csharpContains(parent.right, current) && this.csharpTestIsNonNullCheck(parent.left, symbol, true)) {\n return true;\n }\n if (parent.kind === SyntaxKind.IfStatement) {\n if (this.csharpContains(parent.thenStatement, current) && this.csharpTestIsNonNullCheck(parent.expression, symbol, true)) {\n return true;\n }\n if (this.csharpContains(parent.elseStatement, current) && this.csharpTestIsNonNullCheck(parent.expression, symbol, false)) {\n return true;\n }\n }\n if ((isBlock(parent) || isSourceFile(parent)) && this.csharpEarlyExitNonNullGuarded(parent, current, symbol, scope)) {\n return true;\n }\n if (this.csharpIsFunctionLike(parent)) {\n return false; // a guard outside this function cannot dominate a read inside it\n }\n current = parent;\n }\n return false;\n }\n\n csharpIsFunctionLike(node): boolean {\n switch (node?.kind) {\n case SyntaxKind.MethodDeclaration:\n case SyntaxKind.FunctionDeclaration:\n case SyntaxKind.FunctionExpression:\n case SyntaxKind.ArrowFunction:\n case SyntaxKind.Constructor:\n return true;\n }\n return false;\n }\n\n // `if (x === undefined) { return/throw/... }` (or the same test with an exiting else) in the\n // same block, with no write to x in between: every statement after it runs with x bound\n csharpEarlyExitNonNullGuarded(block, statement, symbol, scope): boolean {\n for (const sibling of block.statements) {\n if (sibling.getStart() >= statement.getStart()) {\n return false;\n }\n if (!isIfStatement(sibling)) {\n continue;\n }\n const exitsOnNull = this.csharpTestIsNonNullCheck(sibling.expression, symbol, false) && this.csharpAlwaysExits(sibling.thenStatement);\n const continuesOnNonNull = this.csharpTestIsNonNullCheck(sibling.expression, symbol, true) && this.csharpAlwaysExits(sibling.elseStatement);\n if ((exitsOnNull || continuesOnNonNull) && !this.csharpReceiverWrittenBetween(scope, sibling.getEnd(), statement.getStart(), symbol)) {\n return true;\n }\n }\n return false;\n }\n\n // the test proves the binding non-null when it evaluates to `truthy`: `x != null`, `x !==\n // undefined` (either operand order), and both sides of an `&&` (a false `||`). Everything\n // else — `any` comparisons, a different binding — proves nothing\n csharpTestIsNonNullCheck(test, symbol, truthy): boolean {\n switch (test?.kind) {\n case SyntaxKind.ParenthesizedExpression:\n return this.csharpTestIsNonNullCheck(test.expression, symbol, truthy);\n case SyntaxKind.PrefixUnaryExpression:\n return (test.operator === SyntaxKind.ExclamationToken) && this.csharpTestIsNonNullCheck(test.operand, symbol, !truthy);\n case SyntaxKind.BinaryExpression: {\n const op = test.operatorToken.kind;\n if (op === SyntaxKind.AmpersandAmpersandToken) {\n return truthy && (this.csharpTestIsNonNullCheck(test.left, symbol, true) || this.csharpTestIsNonNullCheck(test.right, symbol, true));\n }\n if (op === SyntaxKind.BarBarToken) {\n return !truthy && (this.csharpTestIsNonNullCheck(test.left, symbol, false) || this.csharpTestIsNonNullCheck(test.right, symbol, false));\n }\n const inequality = (op === SyntaxKind.ExclamationEqualsToken) || (op === SyntaxKind.ExclamationEqualsEqualsToken);\n const isNullTest = (op === SyntaxKind.EqualsEqualsToken) || (op === SyntaxKind.EqualsEqualsEqualsToken) || inequality;\n if (!isNullTest || (truthy !== inequality)) {\n return false;\n }\n const tested = isIdentifier(test.left) ? test.left : test.right;\n const literal = isIdentifier(test.left) ? test.right : test.left;\n return isIdentifier(tested) && this.csharpInitializerIsUndefined(literal) && this.csharpSameBinding(tested, symbol);\n }\n }\n return false;\n }\n\n csharpSameBinding(node, symbol): boolean {\n try {\n const resolved = this.getChecker().getSymbolAtLocation(node);\n return (resolved !== undefined) && (resolved === symbol);\n } catch (e) {\n return false;\n }\n }\n\n // any write to the same binding inside the window voids a dominance proof\n csharpReceiverWrittenBetween(scope, from: number, to: number, symbol): boolean {\n if (scope === undefined) {\n return true;\n }\n let written = false;\n const visit = (n: any) => {\n if (written || (n.getStart() >= to) || (n.getEnd() <= from)) {\n return;\n }\n if (isIdentifier(n) && this.csharpIsWriteTarget(n) && this.csharpSameBinding(n, symbol)) {\n written = true;\n return;\n }\n n.forEachChild(visit);\n };\n scope.forEachChild(visit);\n return written;\n }\n\n // the C# string the native `IndexOf` takes as its needle: a value the printer types a C#\n // string prints as-is, an `object`-printed operand takes the helper's own `(string)` cast.\n // A value of any other named C# type (number, bool, collection) keeps the helper\n csharpNativeIndexOfNeedle(key, printed = undefined): string | undefined {\n if (key === undefined || printed === undefined) {\n return undefined;\n }\n const keyType = this.csharpExpressionTypeOf(key);\n if (keyType === 'string') {\n return printed;\n }\n return ((keyType === undefined) || (keyType === 'string?')) ? `((string)${printed})` : undefined;\n }\n\n printSearchCall(node, identation, name = undefined, parsedArg = undefined) {\n return `((string)${name}).IndexOf(${parsedArg})`;\n }\n\n printStartsWithCall(node, identation, name = undefined, parsedArg = undefined) {\n return `((string)${name}).StartsWith(((string)${parsedArg}))`;\n }\n\n printEndsWithCall(node, identation, name = undefined, parsedArg = undefined) {\n return `((string)${name}).EndsWith(((string)${parsedArg}))`;\n }\n\n printTrimCall(node, identation, name = undefined) {\n return `${this.csharpStringMethodReceiver(node, name)}.Trim()`;\n }\n\n printJoinCall(node, identation, name = undefined, parsedArg = undefined) {\n return `String.Join(${parsedArg}, ((IList)${name}).ToArray())`;\n }\n\n printSplitCall(node, identation, name = undefined, parsedArg = undefined) {\n return `${this.csharpStringMethodReceiver(node, name)}.Split(new [] {((string)${parsedArg})}, StringSplitOptions.None).ToList()`;\n }\n\n printConcatCall(node, identation, name = undefined, parsedArg = undefined) {\n return `concat(${name}, ${parsedArg})`;\n }\n\n printToFixedCall(node, identation, name = undefined, parsedArg = undefined) {\n return `toFixed(${name}, ${parsedArg})`;\n }\n\n printToStringCall(node, identation, name = undefined) {\n return `((object)${name}).ToString()`;\n }\n\n printToUpperCaseCall(node, identation, name = undefined) {\n return `${this.csharpStringMethodReceiver(node, name)}.ToUpper()`;\n }\n\n printToLowerCaseCall(node, identation, name = undefined) {\n return `${this.csharpStringMethodReceiver(node, name)}.ToLower()`;\n }\n\n printShiftCall(node, identation, name = undefined) {\n return `((IList)${name}).First()`;\n }\n\n printReverseCall(node, identation, name = undefined) {\n return `${name} = (${name} as IList).Reverse().ToList()`;\n }\n\n printPopCall(node, identation, name = undefined) {\n return `((IList)${name}).Last()`;\n }\n\n printSliceCall(node, identation, name = undefined, parsedArg = undefined, parsedArg2 = undefined) {\n const nativeCall = this.csharpNativeSliceCall(node, name);\n if (nativeCall !== undefined) {\n return nativeCall;\n }\n if (parsedArg2 === undefined){\n // return `((string)${name}).Substring((int)${parsedArg})`;\n parsedArg2 = 'null';\n }\n // return `((string)${name})[((int)${parsedArg})..((int)${parsedArg2})]`;\n return `slice(${name}, ${parsedArg}, ${parsedArg2})`;\n }\n\n // `x.slice (a, b)` -> Substring / GetRange when x is a checker-proven string (or a printer-declared\n // `List`) and every bound is an integer literal: JS clamps bounds into [0, length] where C#\n // throws, so literals are clamped with Math.Min / Math.Max. Anything unproven keeps the helper.\n csharpNativeSliceCall(node, name) {\n const args = node?.arguments ?? [];\n if ((args.length < 1) || (args.length > 2)) {\n return undefined;\n }\n const start = this.csharpSliceLiteralBound(args[0]);\n if (start === undefined) {\n return undefined;\n }\n const hasEnd = args.length === 2;\n const end = hasEnd ? this.csharpSliceLiteralBound(args[1]) : undefined;\n if (hasEnd && (end === undefined)) {\n return undefined;\n }\n // x.slice (a, b) prints through this method for the CALL, so the receiver is `.expression.expression`\n const receiver = isPropertyAccessExpression(node?.expression) ? node.expression.expression : undefined;\n if (!this.csharpSliceReceiverIsSideEffectFree(receiver)) {\n return undefined;\n }\n const kind = this.csharpSliceReceiverKind(receiver);\n if (kind === undefined) {\n return undefined;\n }\n const isString = (kind === 'string');\n // `(id as string)` already prints `((string)id)`: a second cast would only add parens\n const cast = (isString && name.startsWith('((string)')) ? name : `((${isString ? 'string' : 'List'})${name})`;\n const length = `${cast}.${isString ? 'Length' : 'Count'}`;\n const from = this.csharpSliceBoundExpression(start, length);\n // the null guard reproduces the helper's null -> null result for a null receiver; the\n // whole emission is parenthesised because a ternary binds looser than the `+` / `+` chain\n // the printer may wrap this call in\n const guard = `(${this.csharpNullComparison(name, true)} ? null : `;\n const method = isString ? 'Substring' : 'GetRange';\n if (!hasEnd) {\n // the open end is the length itself: `Substring (from)` and `GetRange (from, length - from)`\n const open = isString ? `Substring(${from})` : `GetRange(${from}, ${from === '0' ? length : `${length} - ${from}`})`;\n return `${guard}${cast}.${open})`;\n }\n const to = this.csharpSliceBoundExpression(end, length);\n // from <= to is proven per case: 0 is never above a clamp, and two literals clamp\n // monotonically once they keep their order (non-negative, or both counting from the end)\n const ordered = (start === 0) || ((start >= 0) && (end >= 0) && (start <= end)) || ((start < 0) && (end < 0) && (start <= end));\n let count;\n if (from === to) {\n count = '0'; // two bounds that clamp to the same index: an empty result\n } else if (from === '0') {\n count = to; // from 0: the clamped end IS the count\n } else {\n // an inverted pair yields an empty slice in JS, so the count never goes below 0\n count = ordered ? `${to} - ${from}` : `Math.Max(${to} - ${from}, 0)`;\n }\n return `${guard}${cast}.${method}(${from}, ${count}))`;\n }\n\n // Integer value of a slice bound that is an integer literal (`18`, `-64`); anything\n // else (expression, float, exponent, out of int range) keeps the helper — the bounds\n // are clamped with the integer Math.Min / Math.Max of the native form.\n csharpSliceLiteralBound(node) {\n if (node === undefined) {\n return undefined;\n }\n if (isNumericLiteral(node)) {\n const text = String(node.text);\n if ((text.indexOf('.') !== -1) || (text.indexOf('e') !== -1) || (text.indexOf('E') !== -1)) {\n return undefined;\n }\n const value = Number(text);\n return value <= 2147483647 ? value : undefined;\n }\n if (isPrefixUnaryExpression(node) && (node.operator === SyntaxKind.MinusToken)) {\n const inner = this.csharpSliceLiteralBound(node.operand);\n return inner === undefined ? undefined : -inner;\n }\n return undefined;\n }\n\n // JS slice clamps a literal bound into [0, length]: a non-negative bound is min\n // (bound, length), a negative one counts from the end (max (length - |bound|, 0)).\n // `0` stays `0` because the length of a string / list is never negative.\n csharpSliceBoundExpression(value, length) {\n if (value === 0) {\n return '0';\n }\n return value > 0 ? `Math.Min(${value}, ${length})` : `Math.Max(${length} - ${-value}, 0)`;\n }\n\n // The receiver of a native slice: a `List` the printer / build layer declared (the only\n // receiver with GetRange), or a CHECKER-proven string (`string`, a literal, or a union with\n // null / undefined such as ccxt's `Str`); `any`, Dict and every other type keep the helper.\n csharpSliceReceiverKind(expression) {\n // a declared `List` (printer table or the embedding build layer's retype) is the\n // only receiver carrying a native bounding accessor, GetRange\n const declared = (isIdentifier(expression) ? this.csharpTypedLocalType(expression) : undefined) ?? this.csharpExpressionTypeOf(expression);\n if (declared === 'List') {\n return 'list';\n }\n const checker: any = this.checkerOrUndefined();\n if (checker === undefined) {\n return undefined;\n }\n const type = checker.getTypeAtLocation(expression);\n return this.csharpSliceStringType(type) ? 'string' : undefined;\n }\n\n // the checker's string view of a slice receiver: a string type, or a union of string\n // members and nullish ones only. `boolean | string`, `any` and every unproven shape fail\n csharpSliceStringType(type): boolean {\n if (this.isStringType(type?.flags)) {\n return true;\n }\n if (type?.flags !== TypeFlags.Union) {\n return false;\n }\n const members = type.getTypes?.() ?? [];\n return (members.length > 0) && members.every((member) => this.isStringType(member.flags)\n || (member.flags === TypeFlags.Undefined) || (member.flags === TypeFlags.Null));\n }\n\n // True for receivers that read a value without calling anything: `x`, `x.y`, `this.x`,\n // `(x as string)` and parenthesised forms of those. Guards the repeated receiver read —\n // the clamp reads `Length` / `Count` and the call itself reads the receiver again.\n csharpSliceReceiverIsSideEffectFree(expression): boolean {\n if (expression === undefined) {\n return false;\n }\n if (isIdentifier(expression) || (expression.kind === SyntaxKind.ThisKeyword)) {\n return true;\n }\n if (isParenthesizedExpression(expression) || isAsExpression(expression) || isTypeAssertion(expression)\n || isPropertyAccessExpression(expression)) {\n return this.csharpSliceReceiverIsSideEffectFree(expression.expression);\n }\n return false;\n }\n\n printReplaceCall(node, identation, name = undefined, parsedArg = undefined, parsedArg2 = undefined) {\n return `${this.csharpStringMethodReceiver(node, name)}.Replace((string)${parsedArg}, (string)${parsedArg2})`;\n }\n\n printReplaceAllCall(node, identation, name = undefined, parsedArg = undefined, parsedArg2 = undefined) {\n return `${this.csharpStringMethodReceiver(node, name)}.Replace((string)${parsedArg}, (string)${parsedArg2})`;\n }\n\n printPadEndCall(node, identation, name, parsedArg, parsedArg2) {\n return `(${name} as String).PadRight(Convert.ToInt32(${parsedArg}), Convert.ToChar(${parsedArg2}))`;\n }\n\n printPadStartCall(node, identation, name, parsedArg, parsedArg2) {\n return `(${name} as String).PadLeft(Convert.ToInt32(${parsedArg}), Convert.ToChar(${parsedArg2}))`;\n }\n\n printDateNowCall(node, identation) {\n return \"(new DateTimeOffset(DateTime.UtcNow)).ToUnixTimeMilliseconds()\";\n }\n\n printLengthProperty(node, identation, name = undefined) {\n const leftSide = this.printNode(node.expression, 0);\n const type = (this.getChecker() as Checker).getTypeAtLocation(node.expression); // eslint-disable-line\n this.warnIfAnyType(node, type.flags, leftSide, \"length\");\n return this.isStringType(type.flags) ? `${this.csharpStringMethodReceiver(node, leftSide)}.Length` : (this.csharpNativeLengthExpression(node.expression) ?? `${this.ARRAY_LENGTH_WRAPPER_OPEN}${leftSide}${this.ARRAY_LENGTH_WRAPPER_CLOSE}`);\n }\n\n // A for-header incrementor discards the postfix value, so an operand whose printed C# type is `int`\n // takes the native operator: the same unchecked +1 / -1 as the (ref int) helper twin. Any other\n // operand keeps the helper, whose overload set binds an `object` counter.\n csharpNativePostFixIncrement(node): boolean {\n if (node.operand?.kind !== SyntaxKind.Identifier) {\n return false;\n }\n const parent = node.parent;\n if (parent?.kind !== SyntaxKind.ForStatement || parent.incrementor !== node) {\n return false;\n }\n return this.csharpExpressionTypeOf(node.operand) === 'int';\n }\n\n printPostFixUnaryExpression(node, identation) {\n const {operand, operator} = node;\n if (operand.kind === SyntaxKind.NumericLiteral) {\n return super.printPostFixUnaryExpression(node, identation);\n }\n const leftSide = this.printNode(operand, 0);\n const op = this.PostFixOperators[operator]; // todo: handle --\n if (this.csharpNativePostFixIncrement(node)) {\n return `${leftSide}${op}`;\n }\n return (op === '--') ? `postFixDecrement(ref ${leftSide})` : `postFixIncrement(ref ${leftSide})`;\n }\n\n printPrefixUnaryExpression(node, identation) {\n const {operand, operator} = node;\n if (operand.kind === SyntaxKind.NumericLiteral) {\n return super.printPrefixUnaryExpression(node, identation);\n }\n if (operator === SyntaxKind.ExclamationToken) {\n // not branch check falsy/turthy values if needed;\n const nativeNot = this.csharpNegatedConditionOperand(operand);\n if (nativeNot !== undefined) {\n return nativeNot;\n }\n return this.PrefixFixOperators[operator] + this.printCondition(node.operand, 0);\n }\n const leftSide = this.printNode(operand, 0);\n if (operator === SyntaxKind.PlusToken) {\n return `prefixUnaryPlus(ref ${leftSide})`;\n }\n const nativeNegation = this.csharpNativeNegatedLocal(operand, leftSide);\n if (nativeNegation !== undefined) {\n return nativeNegation;\n }\n return `prefixUnaryNeg(ref ${leftSide})`;\n }\n\n // `isTrue(x)` is the identity function on a C# bool (`isTrue` returns a bool unchanged),\n // so the wrapper is only needed for values the printer leaves boxed as `object`. Every\n // shape below is rendered as a C# bool by the printer itself; anything else keeps the helper.\n csharpConditionPrintsBool(node): boolean {\n switch (node?.kind) {\n case SyntaxKind.TrueKeyword:\n case SyntaxKind.FalseKeyword:\n return true; // `true` / `false`\n case SyntaxKind.ParenthesizedExpression:\n return this.csharpConditionPrintsBool(node.expression);\n case SyntaxKind.PrefixUnaryExpression:\n // `!x` prints `!isTrue(x)`, and printCondition always returns a bool\n return node.operator === SyntaxKind.ExclamationToken;\n case SyntaxKind.BinaryExpression:\n return this.csharpBinaryExpressionPrintsBool(node);\n case SyntaxKind.Identifier:\n return this.csharpIdentifierPrintsBool(node);\n case SyntaxKind.PropertyAccessExpression:\n return this.csharpFieldPrintsBool(node);\n case SyntaxKind.CallExpression:\n return this.csharpCallPrintsBool(node);\n }\n return false;\n }\n\n // `this.` reads of the hand-written BaseExchange bool fields: the field is declared\n // `bool` there, so a checker-typed plain boolean read is a C# bool the condition can use bare\n csharpFieldPrintsBool(node): boolean {\n if (node.expression?.kind !== SyntaxKind.ThisKeyword) {\n return false;\n }\n return (CSHARP_NATIVE_BOOL_FIELDS.indexOf(node.name?.text as string) >= 0) && this.csharpIsCheckedBoolean(node);\n }\n\n // isEqual / !isEqual / isGreaterThan / ... / inOp all have a C# `bool` signature, a\n // `&&` / `||` prints both operands through printCondition, i.e. as bool themselves, and\n // `x instanceof T` prints the C# type test ` is `, itself a bool\n csharpBinaryExpressionPrintsBool(node): boolean {\n switch (node.operatorToken.kind) {\n case SyntaxKind.EqualsEqualsToken:\n case SyntaxKind.EqualsEqualsEqualsToken:\n case SyntaxKind.ExclamationEqualsToken:\n case SyntaxKind.ExclamationEqualsEqualsToken:\n case SyntaxKind.GreaterThanToken:\n case SyntaxKind.GreaterThanEqualsToken:\n case SyntaxKind.LessThanToken:\n case SyntaxKind.LessThanEqualsToken:\n case SyntaxKind.InKeyword:\n case SyntaxKind.InstanceOfKeyword:\n case SyntaxKind.BarBarToken:\n case SyntaxKind.AmpersandAmpersandToken:\n return true;\n }\n return false;\n }\n\n // the checker sees a value that is exactly boolean; `boolean | undefined` is a\n // TypeFlags.Union here and is therefore rejected (`bool?` is no condition in C#)\n csharpIsCheckedBoolean(node): boolean {\n const type = this.getChecker().getTypeAtLocation(node);\n return ((type?.flags ?? 0) & TypeFlags.BooleanLike) !== 0;\n }\n\n // `bool name = ...` is only declared when getCSharpLocalType resolved that exact\n // declaration to `bool`, so ask the same function: the condition and the declaration\n // cannot disagree. Parameters, members and demoted locals return `object` there. The\n // embedding layer's resolver (ccxt: build/csharp-local-types.js) retypes locals the\n // printer cannot name itself and reports the type the printed declaration carries, so a\n // `bool` there is the same proof for a declaration this printer did not write\n csharpIdentifierPrintsBool(node): boolean {\n if (!this.csharpIsCheckedBoolean(node)) {\n return false;\n }\n if (this.csharpExpressionTypeOf(node) === 'bool') {\n return true;\n }\n const declaration = this.getChecker().getSymbolAtLocation(node)?.valueDeclaration?.resolve();\n if (declaration === undefined || !isVariableDeclaration(declaration) || declaration.name?.kind !== SyntaxKind.Identifier) {\n return false;\n }\n if (!this.csharpLocalTypes.has(declaration)) {\n this.csharpLocalTypes.set(declaration, this.getCSharpLocalType(declaration));\n }\n return this.csharpLocalTypes.get(declaration) === 'bool';\n }\n\n // the printed callee text of a method call the printer can name statically: `this.` and\n // `.`. A deeper receiver (`a.b.c(...)`) or a plain function call stays undefined —\n // the hand-written-callee proof must know exactly which callee the emitted text binds\n csharpCalleeName_Native(node): string | undefined {\n const expression = node?.expression;\n if (expression?.kind !== SyntaxKind.PropertyAccessExpression) {\n return undefined;\n }\n const receiver = expression.expression;\n const name = expression.name?.text as string;\n if (receiver?.kind === SyntaxKind.ThisKeyword) {\n return 'this.' + name;\n }\n if (receiver?.kind === SyntaxKind.Identifier) {\n return (receiver.text as string) + '.' + name;\n }\n return undefined;\n }\n\n // cs-14: `isTrue()` goes bare when the call's own C# signature is non-nullable `bool`: (a)\n // hand-written cs/ccxt/base callees (CSHARP_BOOL_CALLEES_NATIVE), (b) `this.(...)` printed by\n // the same csharpBooleanReturnType. Hand-written overrides and `callDynamically` keep the wrapper.\n csharpBoolCall_Native(node): boolean {\n const callee = this.csharpCalleeName_Native(node);\n if (callee !== undefined && CSHARP_BOOL_CALLEES_NATIVE[callee] === true) {\n return true;\n }\n return this.csharpGeneratedThisCallBoolType_Native(node, callee) === 'bool';\n }\n\n // csharpBooleanReturnType of a generator-printed `this.(...)` callee, else undefined\n csharpGeneratedThisCallBoolType_Native(node, callee: string | undefined): string | undefined {\n if (callee === undefined || callee.indexOf('this.') !== 0) {\n return undefined;\n }\n if (CSHARP_HANDWRITTEN_CALLEES_NATIVE.indexOf(callee.substring('this.'.length)) > -1) {\n return undefined;\n }\n if (!this.csharpCalleeResolves(node)) {\n return undefined;\n }\n const declaration: any = this.getChecker().getResolvedSignature(node)?.declaration?.resolve();\n // a bodiless overload signature (`safeBool (…, defaultValue: boolean): boolean` next to a\n // `boolean | undefined` implementation) states only that overload's type, while C# binds\n // the single implementation: its `bool?` must not lose the wrapper\n if (declaration?.kind !== SyntaxKind.MethodDeclaration || declaration.body === undefined) {\n return undefined;\n }\n return this.csharpBooleanReturnType(declaration);\n }\n\n // calls the printer gives a concrete bool signature (inArray, valueIsDefined, startsWith,\n // Array.isArray, ...); safeBool and friends are `bool?` / `object` and keep the wrapper\n csharpCallPrintsBool(node): boolean {\n return this.csharpIsCheckedBoolean(node) && ((this.csharpCallReturnType(node) === 'bool') || this.csharpBoolCall_Native(node));\n }\n\n // The declared type of an identifier read: build layer's proof first, then this printer's table;\n // `var`/`object` mean \"no type\". `isTrue (x)` answers false for a null box, exactly the lifted\n // `x == true` on a `bool?`. Only reads declared `bool?` qualify; every other shape keeps helper.\n csharpNullableBoolCondition(node): string | undefined {\n let value = node;\n while (value?.kind === SyntaxKind.ParenthesizedExpression) {\n value = value.expression;\n }\n // the resolver arm: a declaration the embedding build layer retyped itself — the parameter/override\n // signatures the typed-param units print: the recorded type IS the emitted\n // declaration's, so a `bool?` parameter is no C# condition either\n const nullable = (value?.kind === SyntaxKind.Identifier)\n ? (this.csharpDeclaredLocalType(value) === 'bool?' || this.csharpDeclaredLocalResolverType(value) === 'bool?')\n : ((value?.kind === SyntaxKind.CallExpression) && this.csharpCallPrintsNullableBool(value));\n return nullable ? `(${this.printNode(value, 0)} == true)` : undefined;\n }\n\n // a call whose printed C# signature is `bool?`: the `bool? safeBool(...)` family of the\n // hand-written base (CSHARP_THIS_RETURN_TYPES, which names that signature), and a\n // `this.(...)` whose TS declaration the generator itself prints — definition and call\n csharpCallPrintsNullableBool(node): boolean {\n if (this.csharpCallReturnType(node) === 'bool?') {\n return true;\n }\n return this.csharpGeneratedThisCallBoolType_Native(node, this.csharpCalleeName_Native(node)) === 'bool?';\n }\n\n // same emission as the base implementation except for the bare-bool branch: the node is\n // printed once and only wrapped in isTrue(...) when the printer did not already render a bool\n //\n // the single `printCondition` override, rules layered strongest-proof-first over the base\n // body (the untyped fallback at the bottom):\n // S61 -- bare `isTrue (x)` in an if / while / && / || / ! condition: the operand is already\n // the `bool` (or `bool?`) the helper computes, so the wrapper adds nothing (the gate is the\n // csharpConditionPositionAllowsNative / csharpNativeCondition pair, never a name shape).\n // S62 -- a condition whose printed text is already a C# `bool` helper call\n // (csharpPrintedConditionIsBoolean) needs no wrapper either; the same identity proven from\n // the printed form rather than from the declaration.\n // #82 -- csharpConditionPrintsBool folds the wrapper on the node shapes the printer itself\n // renders as a bool, with csharpConditionParensIfNeeded keeping the `&&` / `||` precedence.\n printCondition(node, identation) {\n if (this.supportsFalsyOrTruthyValues) {\n return this.printNode(node, identation);\n }\n // can be called from ifs or conditional expressions or binary expressions so might contain the ! operator\n if (node?.kind === SyntaxKind.PrefixUnaryExpression && node.operator === SyntaxKind.ExclamationToken) {\n return this.printPrefixUnaryExpression(node, identation); // avoid infinite recursion\n }\n const nullableBool = this.csharpNullableBoolCondition(node);\n if (nullableBool !== undefined) {\n return `${this.getIden(identation)}${nullableBool}`;\n }\n const native = this.csharpConditionPositionAllowsNative(node) ? this.csharpNativeCondition(node, identation) : undefined;\n if (native !== undefined) {\n return native;\n }\n const printed = this.printNode(node, 0);\n if (this.csharpConditionPrintsBool(node)) {\n return `${this.getIden(identation)}${this.csharpConditionParensIfNeeded(node, printed)}`;\n }\n // `isTrue(X)` is the identity on a printed C# bool (Exchange.TranspileHelpers.cs:\n // `isTrue(object)` returns `(bool)value`, and normalizeIntIfNeeded is a no-op on bools),\n // so the wrapper is dropped when the node already prints as one\n if (this.csharpPrintedConditionIsBoolean(printed)) {\n return `${this.getIden(identation)}${printed}`;\n }\n return `${this.getIden(identation)}${this.FALSY_WRAPPER_OPEN}${printed}${this.FALSY_WRAPPER_CLOSE}`;\n }\n\n // dropping the wrapper exposes the `&&` / `||` / `is` of the node, so the bare text needs its own\n // parentheses where C# binds tighter than the JS it replaces: under `!` (which binds tighter\n // than both), and a `||` that becomes an operand of a `&&` (`(a || b) && c` must not flatten\n // to `a || b && c`). A type test additionally needs them under the `(bool)` cast the\n // conditional-expression printer prepends (`(bool) x is T` would bind as `((bool) x) is T`).\n // Source parentheses, when present, already come out in `printed`.\n csharpConditionParensIfNeeded(node, printed: string): string {\n if (node?.kind !== SyntaxKind.BinaryExpression) {\n return printed;\n }\n const op = node.operatorToken.kind;\n const parent = node.parent;\n const underNot = parent?.kind === SyntaxKind.PrefixUnaryExpression && parent.operator === SyntaxKind.ExclamationToken;\n if (op === SyntaxKind.InstanceOfKeyword) {\n const underCast = parent?.kind === SyntaxKind.ConditionalExpression && parent.condition === node;\n return (underNot || underCast) ? `(${printed})` : printed;\n }\n if (op !== SyntaxKind.BarBarToken && op !== SyntaxKind.AmpersandAmpersandToken) {\n return printed;\n }\n const underAnd = op === SyntaxKind.BarBarToken && parent?.kind === SyntaxKind.BinaryExpression\n && parent.operatorToken.kind === SyntaxKind.AmpersandAmpersandToken;\n return (underNot || underAnd) ? `(${printed})` : printed;\n }\n\n printConditionalExpression(node, identation) {\n const condition = this.printTernaryCondition(node.condition);\n const whenTrue = this.printNode(node.whenTrue, 0);\n const whenFalse = this.printNode(node.whenFalse, 0);\n\n return condition + \" ? \" + whenTrue + \" : \" + whenFalse;\n }\n\n // The ternary condition is a condition position the native gate above never sees: the same hook\n // answer prints natively there — `bool` bare, `bool?` as `x == true` (null -> false), source parens\n // unwrapped. Undefined keeps the base path, so an unnamed operand is unchanged.\n csharpTernaryConditionOperand(node) {\n let operand = node;\n while (operand?.kind === SyntaxKind.ParenthesizedExpression) {\n operand = operand.expression;\n }\n if (operand?.kind !== SyntaxKind.Identifier) {\n return undefined;\n }\n const type = this.csharpConditionOperandType(operand);\n if (type === 'bool') {\n return this.printNode(operand, 0);\n }\n if (type === 'bool?') {\n return `${this.printNode(operand, 0)} == true`;\n }\n return undefined;\n }\n\n // printCondition already yields a C# `bool` (`isTrue(x)` / `!isTrue(x)`), so a `((bool) )`\n // wrapper is a cast on a bool. The hook fold above answers the emitted declaration's type first;\n // anything it cannot name keeps the printer's `bool` fold (getCSharpLocalType) and then `isTrue`.\n printTernaryCondition(node) {\n const native = this.csharpTernaryConditionOperand(node);\n if (native !== undefined) {\n return native;\n }\n if (this.csharpConditionPrintsAsBool(node)) {\n return this.printNode(node, 0);\n }\n return this.printCondition(node, 0);\n }\n\n csharpConditionPrintsAsBool(node): boolean {\n if (node?.kind !== SyntaxKind.Identifier) {\n return false;\n }\n const checker = this.getChecker() as Checker; // eslint-disable-line\n const declaration = checker.getSymbolAtLocation(node)?.valueDeclaration?.resolve();\n if (declaration?.kind !== SyntaxKind.VariableDeclaration) {\n return false;\n }\n return this.getCSharpLocalType(declaration) === 'bool';\n }\n\n // index of the `)` matching the `(` at `start` inside printed C# text, or -1; string\n // and char literals are skipped so a `(` inside a literal cannot shift the depth\n csharpMatchingParenIndex(text: string, start: number): number {\n let depth = 0;\n for (let i = start; i < text.length; i++) {\n const char = text[i];\n if (char === '\"' || char === '\\'') {\n const quote = char;\n i++;\n while (i < text.length) {\n if (text[i] === '\\\\') { i += 2; continue; }\n if (text[i] === quote) { break; }\n i++;\n }\n } else if (char === '(') {\n depth++;\n } else if (char === ')') {\n depth--;\n if (depth === 0) {\n return i;\n }\n }\n }\n return -1;\n }\n\n // S62: a `?` at paren/bracket/brace depth 0 in printed condition text is a C# conditional; its type\n // is the branches' common type (`object`), never `bool`; without this guard the falsy wrapper would\n // be folded into an invalid `if (object)`. `?` inside parens/brackets and in literals is ignored.\n csharpTextHasTopLevelConditional(text: string): boolean {\n let depth = 0;\n for (let i = 0; i < text.length; i++) {\n const char = text[i];\n if (char === '\"' || char === '\\'') {\n const quote = char;\n i++;\n while (i < text.length) {\n if (text[i] === '\\\\') { i += 2; continue; }\n if (text[i] === quote) { break; }\n i++;\n }\n } else if ((char === '(') || (char === '[') || (char === '{')) {\n depth++;\n } else if ((char === ')') || (char === ']') || (char === '}')) {\n depth--;\n } else if ((char === '?') && (depth === 0)) {\n return true;\n }\n }\n return false;\n }\n\n // S62: is this printed condition text already a C# `bool`? Only `isTrue`/`isEqual`/`isGreaterThan\n // (OrEqual)`/`isLessThan(OrEqual)`/`inOp` calls qualify (CSHARP_BOOLEAN_PRINTED_CALLS). A `!`,\n // whole-text parens and `&&`/`||` composites (via the leading operand) keep the property.\n csharpPrintedConditionIsBoolean(text: string): boolean {\n const trimmed = text.trim();\n if (trimmed.length === 0) {\n return false;\n }\n if (this.csharpTextHasTopLevelConditional(trimmed)) {\n return false;\n }\n if (trimmed.startsWith('(') && (this.csharpMatchingParenIndex(trimmed, 0) === trimmed.length - 1)) {\n return this.csharpPrintedConditionIsBoolean(trimmed.substring(1, trimmed.length - 1));\n }\n if (trimmed.startsWith('!')) {\n return this.csharpPrintedConditionIsBoolean(trimmed.substring(1));\n }\n const printedCall = /^([A-Za-z_]\\w*)\\(/.exec(trimmed);\n return (printedCall !== null) && (CSHARP_BOOLEAN_PRINTED_CALLS.indexOf(printedCall[1]) >= 0);\n }\n\n printDeleteExpression(node, identation) {\n const receiver = node.expression.expression;\n const object = this.printNode (receiver, 0);\n const key = this.printNode (node.expression.argumentExpression, 0);\n // same identity as the element write: `Remove` on the declared dictionary is the\n // interface method the cast would bind to\n if (this.csharpReceiverIsDeclaredDictionary(receiver)) {\n return `${object}.Remove((string)${key})`;\n }\n return `((IDictionary)${object}).Remove((string)${key})`;\n }\n\n printNewExpression(node, identation) {\n let expression = node.expression?.text;\n expression = expression ? expression : this.printNode(node.expression);\n // JS's built-in `Error` maps to C#'s `Exception` (C# has no `Error` type in the BCL)\n if (expression === 'Error') {\n expression = 'Exception';\n }\n const args = node.arguments.map(n => this.printNode(n, identation)).join(\", \");\n const newToken = this.NEW_TOKEN ? this.NEW_TOKEN + \" \" : \"\";\n return newToken + expression + this.LEFT_PARENTHESIS + args + this.RIGHT_PARENTHESIS;\n }\n\n printThrowStatement(node, identation) {\n // const expression = this.printNode(node.expression, 0);\n // return this.getIden(node) + this.THROW_TOKEN + \" \" + expression + this.LINE_TERMINATOR;\n if (node.expression.kind === SyntaxKind.Identifier) {\n return this.getIden(identation) + this.THROW_TOKEN + ' ' + this.printNode(node.expression, 0) + this.LINE_TERMINATOR;\n }\n if (node.expression.kind === SyntaxKind.NewExpression) {\n const expression = node.expression;\n // handle throw new Error (Message)\n // and throw new x[a] (message)\n const argumentsExp = expression?.arguments ?? [];\n const parsedArg = argumentsExp.map(n => this.printNode(n, 0)).join(\",\") ?? '';\n const newExpression = this.printNode(expression.expression, 0);\n if (expression.expression.kind === SyntaxKind.Identifier) {\n // handle throw new X\n const id = expression.expression;\n // JS's built-in `Error` maps to C#'s `Exception` (C# has no `Error` type in the BCL)\n const idName = id.text === 'Error' ? 'Exception' : id.text;\n const symbol = this.getChecker().getSymbolAtLocation(expression.expression);\n if (symbol) {\n const declarations = (this.getChecker().getDeclaredTypeOfSymbol(symbol).getSymbol()?.declarations ?? []).map((d) => d.resolve());\n const isClassDeclaration = declarations.find(l => l.kind === SyntaxKind.InterfaceDeclaration || l.kind === SyntaxKind.ClassDeclaration);\n if (isClassDeclaration){\n return this.getIden(identation) + `${this.THROW_TOKEN} ${this.NEW_TOKEN} ${idName} ((string)${parsedArg}) ${this.LINE_TERMINATOR}`;\n } else {\n return this.getIden(identation) + `throwDynamicException(${idName}, ${parsedArg});return null;`;\n }\n }\n return this.getIden(identation) + `${this.THROW_TOKEN} ${this.NEW_TOKEN} ${idName === id.text ? newExpression : idName} (${parsedArg}) ${this.LINE_TERMINATOR}`;\n } else if (expression.expression.kind === SyntaxKind.ElementAccessExpression) {\n return this.getIden(identation) + `throwDynamicException(${newExpression}, ${parsedArg});`;\n }\n return super.printThrowStatement(node, identation);\n }\n // const newToken = this.NEW_TOKEN ? this.NEW_TOKEN + \" \" : \"\";\n // const newExpression = node.expression?.expression?.text;\n // // newExpression = newExpression ? newExpression : this.printNode(node.expression.expression, 0); // new Exception or new exact[string] check this out\n // // const args = node.expression?.arguments.map(n => this.printNode(n, 0)).join(\",\");\n // // const throwExpression = ` ${newToken}${newExpression}${this.LEFT_PARENTHESIS}((string)${args})${this.RIGHT_PARENTHESIS}`;\n // return this.getIden(identation) + this.THROW_TOKEN + throwExpression + this.LINE_TERMINATOR;\n }\n\n printPropertyAccessModifiers(node) {\n let modifiers = this.printModifiers(node);\n if (modifiers === '') {\n modifiers = this.defaultPropertyAccess;\n }\n // add type\n let typeText = 'object';\n if (node.type) {\n typeText = this.getType(node);\n if (!typeText && node.type.kind === SyntaxKind.AnyKeyword) {\n typeText = this.OBJECT_KEYWORD + ' ';\n }\n }\n return modifiers + ' ' + typeText + ' ';\n }\n\n // printLeadingComments(node, identation) {\n // const fullText = this.getSrc().getFullText();\n // const commentsRangeList = ts.getLeadingCommentRanges(fullText, node.pos);\n // const commentsRange = commentsRangeList ? commentsRangeList : undefined;\n // let res = \"\";\n // if (commentsRange) {\n // for (const commentRange of commentsRange) {\n // const commentText = fullText.slice(commentRange.pos, commentRange.end);\n // if (commentText !== undefined) {\n // const formatted = commentText\n // .split(\"\\n\")\n // .map(line=>line.trim())\n // .map(line => !(line.trim().startsWith(\"*\")) ? this.getIden(identation) + line : this.getIden(identation) + \" \" + line) .join(\"\\n\");\n // // res+= this.transformLeadingComment(formatted) + \"\\n\";\n // }\n // }\n // }\n // return res;\n // }\n}\n\n// if (this.requiresCallExpressionCast) {\n// const parsedTypes = this.getTypesFromCallExpressionParameters(node);\n// const tmpArgs = [];\n// args.forEach((arg, index) => {\n// const parsedType = parsedTypes[index];\n// const cast = parsedType ? `(${parsedType})` : '';\n// tmpArgs.push(cast + this.printNode(arg, identation).trim());\n// });\n// parsedArgs = tmpArgs.join(\",\");\n// } else {\n// parsedArgs = args.map((a) => {\n// return this.printNode(a, identation).trim();\n// }).join(\", \");\n// }\n\n// getTypesFromCallExpressionParameters(node) {\n// const resolvedParams = this.getChecker().getResolvedSignature(node).parameters;\n// const parsedTypes = [];\n// resolvedParams.forEach((p) => {\n// const decl = p.declarations[0];\n// const type = this.getChecker().getTypeAtLocation(decl);\n// const parsedType = this.getTypeFromRawType(type);\n// parsedTypes.push(parsedType);\n// });\n\n// return parsedTypes;\n// }\n\n\n// get class decl node\n// Use the ts.getAllSuperTypeNodes function to get the base classes for the MyClass\n// const baseClasses = ts.getAllSuperTypeNodes(classDeclaration);\n\n// // Create a type checker\n// const typeChecker = ts.createTypeChecker(sourceFile.context.program, sourceFile.context.checker);\n\n// // Get the type of the base class\n// const baseClassType = typeChecker.getTypeAtLocation(baseClasses[0]);\n\n// // Get the class declaration for the base class\n// const baseClassDeclaration = baseClassType.symbol.valueDeclaration;\n\n// console.log(baseClassDeclaration);\n","import { BaseTranspiler } from \"./baseTranspiler.js\";\nimport * as fs from \"fs\";\nimport * as path from \"path\";\nimport { SyntaxKind, getLeadingCommentRanges } from 'typescript/unstable/ast';\nimport { isArrowFunction, isBinaryExpression, isBlock, isBooleanLiteral, isCallExpression, isClassDeclaration as isClassDeclarationNode, isElementAccessExpression, isExpressionStatement, isFunctionDeclaration, isFunctionExpression, isIfStatement, isMethodDeclaration, isReturnStatement, isSourceFile, isStatement as isStatementNode, isThrowStatement, isTryStatement } from 'typescript/unstable/ast/is';\nimport { Checker, IndexKind, SymbolFlags, TypeFlags } from 'typescript/unstable/sync';\nimport type { BinaryExpression, CallExpression, Node, NodeArray, Statement } from 'typescript/unstable/ast';\nimport { getAllSuperTypeNodes, isFunctionLike } from './tsUtils.js';\n\n\nconst GO_ITERATION_STATEMENT_KINDS = new Set([SyntaxKind.ForStatement, SyntaxKind.ForInStatement,\n SyntaxKind.ForOfStatement, SyntaxKind.DoStatement, SyntaxKind.WhileStatement]);\n\nconst parserConfig = {\n 'ELSEIF_TOKEN': 'else if',\n 'OBJECT_OPENING': 'map[string]any{',\n 'ARRAY_OPENING_TOKEN': '[]any{',\n 'ARRAY_CLOSING_TOKEN': '}',\n 'PROPERTY_ASSIGNMENT_TOKEN': ':',\n 'VAR_TOKEN': 'object', // object\n 'METHOD_TOKEN': 'func',\n 'PROPERTY_ASSIGNMENT_OPEN': '',\n 'PROPERTY_ASSIGNMENT_CLOSE': '',\n 'SUPER_TOKEN': 'base',\n 'SUPER_CALL_TOKEN': 'base',\n 'FALSY_WRAPPER_OPEN': 'EvalTruthy(',\n 'FALSY_WRAPPER_CLOSE': ')',\n 'COMPARISON_WRAPPER_OPEN' : \"IsEqual(\",\n 'COMPARISON_WRAPPER_CLOSE' : \")\",\n 'UKNOWN_PROP_WRAPPER_OPEN': 'this.call(',\n 'UNKOWN_PROP_WRAPPER_CLOSE': ')',\n 'UKNOWN_PROP_ASYNC_WRAPPER_OPEN': 'this.callAsync(',\n 'UNKOWN_PROP_ASYNC_WRAPPER_CLOSE': ')',\n 'DYNAMIC_CALL_OPEN': 'callDynamically(',\n 'EQUALS_EQUALS_WRAPPER_OPEN': 'IsEqual(',\n 'EQUALS_EQUALS_WRAPPER_CLOSE': ')',\n 'DIFFERENT_WRAPPER_OPEN': '!IsEqual(',\n 'DIFFERENT_WRAPPER_CLOSE': ')',\n 'GREATER_THAN_WRAPPER_OPEN': 'IsGreaterThan(',\n 'GREATER_THAN_WRAPPER_CLOSE': ')',\n 'GREATER_THAN_EQUALS_WRAPPER_OPEN': 'IsGreaterThanOrEqual(',\n 'GREATER_THAN_EQUALS_WRAPPER_CLOSE': ')',\n 'LESS_THAN_WRAPPER_OPEN': 'IsLessThan(',\n 'LESS_THAN_WRAPPER_CLOSE': ')',\n 'LESS_THAN_EQUALS_WRAPPER_OPEN': 'IsLessThanOrEqual(',\n 'LESS_THAN_EQUALS_WRAPPER_CLOSE': ')',\n 'PLUS_WRAPPER_OPEN':'Add(',\n 'PLUS_WRAPPER_CLOSE':')',\n 'MINUS_WRAPPER_OPEN':'Subtract(',\n 'MINUS_WRAPPER_CLOSE':')',\n 'ARRAY_LENGTH_WRAPPER_OPEN': 'GetArrayLength(',\n 'ARRAY_LENGTH_WRAPPER_CLOSE': ')',\n 'DIVIDE_WRAPPER_OPEN': 'Divide(',\n 'DIVIDE_WRAPPER_CLOSE': ')',\n 'MULTIPLY_WRAPPER_OPEN': 'Multiply(',\n 'MULTIPLY_WRAPPER_CLOSE': ')',\n 'INDEXOF_WRAPPER_OPEN': 'GetIndexOf(',\n 'INDEXOF_WRAPPER_CLOSE': ')',\n 'MOD_WRAPPER_OPEN': 'Mod(',\n 'MOD_WRAPPER_CLOSE': ')',\n 'FUNCTION_TOKEN': 'func',\n 'DEFAULT_RETURN_TYPE': 'any',\n 'BLOCK_OPENING_TOKEN': '{',\n 'DEFAULT_PARAMETER_TYPE': 'any',\n 'LINE_TERMINATOR': '',\n 'CONDITION_OPENING':'',\n 'CONDITION_CLOSE':'',\n 'AWAIT_TOKEN': '',\n 'NULL_TOKEN': 'nil',\n 'UNDEFINED_TOKEN': 'nil',\n 'WHILE_TOKEN': 'for',\n 'ELEMENT_ACCESS_WRAPPER_OPEN': 'GetValue(',\n 'ELEMENT_ACCESS_WRAPPER_CLOSE': ')',\n};\n\n// Go static type of the native emissions the printer itself makes (a stdlib call,\n// or one of its own immediately-called literals). A local that captures one holds\n// that concrete type, exactly like the helper result the emission replaced.\nconst GO_NATIVE_CALL_RETURN_TYPES: { [name: string]: string } = {\n 'strings.Index': 'int',\n};\n\n// `this.`, `this.2` and `this.N` of each accessor family, all typed `goType`\nfunction goSafeAccessorTypes (names: string[], goType: string): { [name: string]: string } {\n return Object.fromEntries(names.flatMap((name) => [ '', '2', 'N' ].map((suffix) => [ 'this.' + name + suffix, goType ])));\n}\n\n// Go static type of the value each base helper returns. A local initialised by\n// one of these already holds that concrete type inside its `any` box, so naming\n// the type at the declaration site keeps the very same runtime value and only\n// refines what the Go compiler knows about it.\nconst GO_HELPER_RETURN_TYPES: { [name: string]: string } = {\n 'GetArrayLength': 'int',\n 'GetLength': 'int',\n // the printInlineArrayLength emission of `.length` on a slice\n 'len': 'int',\n 'GetIndexOf': 'int',\n 'ToString': 'string',\n // hand-written exchange_encode.go helper, a plain Go `string` on its only return path\n 'this.UrlencodeNested': 'string',\n 'ToLower': 'string',\n 'ToUpper': 'string',\n 'JsonStringify': 'string',\n 'Capitalize': 'string',\n 'this.Uuid': 'string',\n 'this.Hmac': 'string',\n 'this.Ymdhms': 'string',\n 'this.Yyyymmdd': 'string',\n 'this.Ymd': 'string',\n 'Split': '[]string',\n 'ObjectKeys': '[]string',\n 'this.Extend': 'map[string]any',\n 'this.DeepExtend': 'map[string]any',\n 'this.Keysort': 'map[string]any',\n 'this.IndexBy': 'map[string]any',\n 'this.GroupBy': 'map[string]any',\n 'this.Milliseconds': 'int64',\n 'this.Seconds': 'int64',\n 'this.Microseconds': 'int64',\n 'ParseInt': 'int64',\n 'MathFloor': 'float64',\n 'MathCeil': 'float64',\n 'MathRound': 'float64',\n 'MathAbs': 'float64',\n 'MathPow': 'float64',\n 'ToFloat64': 'float64',\n 'EvalTruthy': 'bool',\n 'IsEqual': 'bool',\n 'IsGreaterThan': 'bool',\n 'IsLessThan': 'bool',\n 'IsGreaterThanOrEqual': 'bool',\n 'IsLessThanOrEqual': 'bool',\n 'InOp': 'bool',\n 'IsArray': 'bool',\n 'IsString': 'bool',\n 'IsInt': 'bool',\n 'IsBool': 'bool',\n 'IsNumber': 'bool',\n 'IsObject': 'bool',\n 'IsDictionary': 'bool',\n 'StartsWith': 'bool',\n 'EndsWith': 'bool',\n // the native string operations (emitted with a proven Go `string` receiver) return exactly\n // the type of the helper they replace, so a local initialised by one keeps its declared type\n 'strings.Split': '[]string',\n 'strings.Join': 'string',\n 'strings.ToUpper': 'string',\n 'strings.ToLower': 'string',\n 'strings.Replace': 'string',\n 'strings.ReplaceAll': 'string',\n 'strings.HasPrefix': 'bool',\n 'strings.HasSuffix': 'bool',\n 'strconv.FormatInt': 'string',\n 'IsInstance': 'bool',\n 'IsInteger': 'bool',\n 'this.InArray': 'bool',\n 'this.ValueIsDefined': 'bool',\n 'Precise.StringGt': 'bool',\n 'Precise.StringGe': 'bool',\n 'Precise.StringLt': 'bool',\n 'Precise.StringLe': 'bool',\n 'Precise.StringEq': 'bool',\n 'Precise.StringEquals': 'bool',\n // the base Safe* accessors return a typed pointer so that an absent value is a\n // nil pointer, distinct from a present zero value (\"\" / 0 / false)\n ...goSafeAccessorTypes([ 'SafeString', 'SafeStringLower', 'SafeStringUpper' ], '*string'),\n ...goSafeAccessorTypes([ 'SafeInteger', 'SafeIntegerProduct', 'SafeTimestamp' ], '*int64'),\n ...goSafeAccessorTypes([ 'SafeFloat' ], '*float64'),\n // absent flag → nil pointer, present flag → its value, mirroring the string/number accessors\n ...goSafeAccessorTypes([ 'SafeBool' ], '*bool'),\n // SafeDict*/SafeList* stay untyped: the Go accessors return `any` because the value\n // may be a *sync.Map, a Dict or an order-book side, none of which is a map[string]any / []any\n // Precise arithmetic returns a numeric string, or nil when an operand is\n // absent, so it carries the same *string shape as the Safe* string accessors\n ...Object.fromEntries([ 'Mul', 'Div', 'Sub', 'Add', 'Or', 'Max', 'Min', 'Abs', 'Neg', 'Mod' ].map((op) => [ 'Precise.String' + op, '*string' ])),\n};\n\n// helpers whose Go signature is `any` (GetValue, Ternary, Add, SafeValue, ...) are\n// deliberately absent above: their box holds a value the printer cannot name, so\n// those locals stay `any`. A Safe* entry presupposes the matching Go accessor\n// returns that shape (as the hand-written base already does for Str/Int/Float).\n\n// printed calls whose Go result is a JSON decode: map/slice/scalar or nil, never a\n// typed pointer. `this.parseJson` / `this.json` are the hand-written base decoders,\n// `JsonParse` / `ParseJSON` their runtime twins.\nconst GO_JSON_PARSE_CALLS = [ 'Json', 'JsonParse', 'ParseJson', 'ParseJSON' ];\n\n// Hand-written CCXT fields whose Go type is a plain `bool` (go/v4/exchange.go,\n// struct BaseExchange, embedded by every derived exchange). Reading one already\n// yields a Go bool, so a condition on it needs no truthiness helper at all.\nconst GO_BOOL_FIELDS = new Set([\n 'this.Verbose',\n 'this.EnableRateLimit',\n 'this.ReduceFees',\n 'this.SubstituteCommonCurrencyCodes',\n 'this.IsSandboxModeEnabled',\n // `public newUpdates: boolean` in ts/src/base/Exchange.ts; the hand-written\n // struct field is the `NewUpdates bool` read by every WS loop\n 'this.NewUpdates',\n]);\n\n// Hand-written BaseExchange methods (go/v4/exchange.go) whose Go signature returns a\n// plain `bool`, so `EvalTruthy(this.IsEmpty(x))` IS `this.IsEmpty(x)`. InArray,\n// Precise.String* and the retagged generated methods are already in GO_HELPER_RETURN_TYPES.\nconst GO_BOOL_CALL_NAMES_NATIVE = [\n 'this.IsEmpty',\n 'this.IsJsonEncodedObject',\n 'this.IsBinaryMessage',\n];\n// Pointer-returning accessors the ccxt build pass wraps with DerefScalar but that the\n// Go type table above does not name (their printed Go signature is not in it).\nconst GO_DEREF_WRAPPED_CALLS = [ 'NumberToString', 'Parse8601', 'Iso8601' ];\n\n// A printed call the printer cannot type *and* whose Go signature returns `any`\n// can be compared with nil / a string / a bool literal without the helper: the\n// box holds a scalar or nil, never a typed pointer.\nconst GO_ANY_BOX_CALLS = [\n 'GetValue', 'Ternary',\n 'SafeValue', 'this.SafeValue',\n 'SafeDict', 'this.SafeDict',\n 'SafeList', 'this.SafeList',\n 'SafeNumber', 'this.SafeNumber',\n];\n\n// read-only string accessors whose printed Go result is a `*string`. Each one reads\n// its arguments and returns a fresh pointer, so repeating the call in the two halves\n// of a deref comparison returns the same value when every argument is a plain read.\nconst GO_PURE_STRING_ACCESSORS = [\n 'this.SafeString', 'this.SafeString2', 'this.SafeStringN',\n 'this.SafeStringLower', 'this.SafeStringLower2', 'this.SafeStringLowerN',\n 'this.SafeStringUpper', 'this.SafeStringUpper2', 'this.SafeStringUpperN',\n 'this.NumberToString', 'this.SafeCurrencyCode',\n];\n\n// the `*bool` twin of the table above: the accessors whose Go signature returns a\n// pointer that is nil for an absent flag and carries the flag otherwise — the same\n// two states `derefScalar` hands the truthiness helper.\nconst GO_PURE_BOOL_ACCESSORS = [\n 'this.SafeBool', 'this.SafeBool2', 'this.SafeBoolN',\n];\n\n// Pointer types the Go nil test of the runtime helpers reproduces exactly: derefScalar\n// unwraps them to an untyped nil, IsEqual has its own *sync.Map case. Other pointers\n// (*sync.Mutex), map/slice fields and `any` fields flip meaning, so they keep the helper.\nconst GO_NIL_EQUIVALENT_POINTER_TYPES_Native = new Set([\n '*sync.Map', '*string', '*int64', '*float64', '*bool', '*int', '*[]string', '*[]any', '*map[string]any',\n]);\n\n// hand-written BaseExchange fields (go/v4/exchange.go) declared `*sync.Map`\nconst GO_SYNC_MAP_FIELDS = [\n 'Options', 'Markets', 'Markets_by_id', 'MarketsById', 'Currencies', 'Currencies_by_id', 'CurrenciesById',\n 'BaseCurrencies', 'QuoteCurrencies', 'Tickers', 'Orderbooks', 'Transactions',\n];\n\n// Hand-written BaseExchange fields (go/v4/exchange.go, embedded by every exchange\n// class) declared with one of those pointer types, keyed by the printed Go field name;\n// the Go type lives in the hand-written base, not in the TypeScript class.\nconst GO_NILABLE_FIELDS_Typed: { [name: string]: string } = Object.fromEntries(\n [ ...GO_SYNC_MAP_FIELDS, 'Bidsasks' ].map((name) => [ 'this.' + name, '*sync.Map' ]));\n\nconst GO_TYPE_NAMES = [ 'string', 'int', 'int64', 'float64', 'bool', 'any' ];\n\n// `var x any = this.SafeDict(container, key)` may declare the map type: SafeMapTyped reads the same\n// member and returns the map (sync.Map converted), nil when absent or not a map. Emitted only when\n// every later use READS it as a dictionary — a typed nil map is a non-nil interface otherwise.\nconst GO_SAFE_DICT_LOCAL_TYPE = 'map[string]any';\n\n// the hand-written helpers a typed dict local may be handed to as their receiver: each one\n// normalises the argument with derefScalar/GetValue, so a nil map reads exactly like the nil\n// interface the local used to hold\nconst GO_SAFE_DICT_READ_HELPERS = [ 'GetValue', 'InOp', 'ObjectKeys', 'IsDictionary' ];\n\n// `var market any = this.Market(symbol)` / `this.SafeMarket(…)`: the TS return type is the\n// `MarketInterface` interface, so MapTyped returns the same dictionary and the local can be\n// `map[string]any`. Emitted only while every later use READS it as a dictionary (SafeDict scan).\nconst GO_MARKET_LOCAL_TYPE = 'map[string]any';\n\n// the binary operators under which a market/currency local's element read is a pure READ: the\n// element is derefed by the GetValue the element-read printer keeps for these operands\n// (goMarketComparisonElementRead), so `market['swap'] === true` keeps answering exactly what the\nconst GO_MARKET_READ_COMPARISON_OPERATORS = [\n SyntaxKind.EqualsEqualsToken,\n SyntaxKind.ExclamationEqualsToken,\n SyntaxKind.EqualsEqualsEqualsToken,\n SyntaxKind.ExclamationEqualsEqualsToken,\n SyntaxKind.LessThanToken,\n SyntaxKind.GreaterThanToken,\n SyntaxKind.LessThanEqualsToken,\n SyntaxKind.GreaterThanEqualsToken,\n SyntaxKind.AmpersandAmpersandToken,\n SyntaxKind.BarBarToken,\n];\n\n// `var x any = this.SafeList(container, key)` may carry the slice type for the same reason: the\n// accessor returns `any`, so SafeListTyped reads the same member and hands back a []any with the\n// same length and elements (every array kind IsArray admits is converted), nil when the member is\nconst GO_SAFE_LIST_LOCAL_TYPE = '[]any';\n\n// the boundary comment ccxt's base sources (ts/src/base/Exchange.ts, PredictionExchange.ts)\n// carry and build/goTranspiler.ts re-assembles the generated file around\n\n// the Go numeric kinds. `<` `>` `<=` `>=` compile without a conversion only when\n// both operands carry the same one of these\nconst GO_NUMERIC_KINDS = [ 'int', 'int64', 'float64' ];\n\nconst ORDERED_COMPARISON_OPERATORS: { [kind: number]: string } = {\n [SyntaxKind.GreaterThanToken]: '>',\n [SyntaxKind.GreaterThanEqualsToken]: '>=',\n [SyntaxKind.LessThanToken]: '<',\n [SyntaxKind.LessThanEqualsToken]: '<=',\n};\n\n// hand-written BaseExchange fields (go/v4/exchange.go) declared `string`: their Go\n// value is never nil, so `this. + s` matches Add(field, s) exactly. The Go\n// struct field is what decides — a batch-A `Str` TS annotation (`version: Str`)\n// still prints this field as a plain Go string.\nconst GO_STRING_FIELD_NAMES = [ 'Id', 'Name', 'Version', 'Url', 'Hostname', 'UserAgent' ];\n\n// the hand-written SafeString-family methods (go/v4/exchange_safe.go) return a fresh\n// non-nil pointer whenever the call passes a non-nil default: the value branch takes\n// the address of the found string, the default branch the address of ToString(def).\nconst GO_DEFAULTED_SAFE_STRING_ARITY: { [name: string]: number } = {\n 'safeString': 3, 'safeStringLower': 3, 'safeStringUpper': 3,\n 'safeString2': 4, 'safeStringLower2': 4, 'safeStringUpper2': 4,\n 'safeStringN': 3, 'safeStringLowerN': 3, 'safeStringUpperN': 3,\n};\n\n// the default shapes derefScalar leaves non-nil: a literal default is never the absent\n// case, so the method's nil return is unreachable for a call carrying one\nconst GO_NON_NIL_DEFAULT_KINDS = [\n SyntaxKind.StringLiteral, SyntaxKind.NoSubstitutionTemplateLiteral,\n SyntaxKind.NumericLiteral, SyntaxKind.TrueKeyword, SyntaxKind.FalseKeyword,\n];\n\n// the operators that write their left operand: an assignment through any of them may\n// store a nil pointer where the deref proof expected the defaulted call's result\nconst GO_WRITE_OPERATOR_KINDS = [\n SyntaxKind.EqualsToken, SyntaxKind.PlusEqualsToken, SyntaxKind.MinusEqualsToken,\n SyntaxKind.AsteriskEqualsToken, SyntaxKind.SlashEqualsToken, SyntaxKind.PercentEqualsToken,\n];\n\n// hand-written BaseExchange fields (go/v4/exchange.go) declared as a container: an\n// element write on one of them is native code — a map index write, or `Store` for the\n// thread-safe ones, which is exactly what AddElementToObject does for a *sync.Map.\nconst GO_FIELD_CONTAINER_TYPES_NATIVE: { [name: string]: string } = Object.fromEntries([\n ...[\n 'Has', 'Api', 'TransformedApi', 'RequiredCredentials', 'HttpExceptions', 'Timeframes', 'Features',\n 'Exceptions', 'Precision', 'UserAgents', 'TokenBucket', 'CommonCurrencies', 'ProxyDictionaries',\n 'WsClients', 'Clients', 'Limits', 'Fees', 'Status', 'Countries',\n ].map((name) => [ name, 'map[string]any' ]),\n ...GO_SYNC_MAP_FIELDS.map((name) => [ name, '*sync.Map' ]),\n]);\n\n// operator kinds the arithmetic helpers are emitted for\nconst GO_ARITHMETIC_KINDS = [\n SyntaxKind.PlusToken,\n SyntaxKind.MinusToken,\n SyntaxKind.AsteriskToken,\n SyntaxKind.SlashToken,\n SyntaxKind.PercentToken,\n];\n\n// ---------------------------------------------------------------------------------------------\n// Trailing `//` comment alignment (gofmt's tabwriter cells).\n//\n// go/printer separates a trailing comment from the code with a hard tab (`writeCommentPrefix`),\n// so the code text is the last tab-terminated cell of the line. text/tabwriter pads that cell to\n// the widest cell of its column block plus `padding = 1` (gofmt runs with `minwidth = 0`,\n// `padding = 1`, `padchar = ' '`), which is why adjacent statements get their comments aligned\n// and a lone one gets exactly one space. A column block is the run of adjacent lines whose code\n// cell sits in the same column (same indentation); formfeeds terminate all columns, and\n// go/printer emits them between sections: blank and comment-only lines, a change of indentation,\n// each line of a multi-line expression (`binaryExpr` breaks with `newSection = true`) and every\n// statement that follows a multi-line one (`stmtList` breaks with `newSection = true`).\n//\n// The pass below reproduces that padding on the printed text. It is a no-op on text gofmt has\n// already aligned (verified over the whole go/v4 tree) and it never reflows or re-wraps a line.\n// ---------------------------------------------------------------------------------------------\n\n// a line whose code ends like this does not end its statement: the line below it belongs to the\n// same multi-line expression, and go/printer puts a formfeed before it (a new column block)\nconst GO_COMMENT_BREAK_END = /(?:[({[:]|[+\\-*/%&|^<>=!])$/;\n\n// the index just past the `\"`/`'` literal opening at `start` (backslash escapes skipped)\nfunction goSkipQuoted (text: string, start: number): number {\n let i = start + 1;\n while (i < text.length) {\n if (text[i] === '\\\\') {\n i += 2;\n continue;\n }\n if (text[i] === text[start]) {\n return i + 1;\n }\n i += 1;\n }\n return i;\n}\n\n// (opens - closes) of ()[]{} outside strings, so `foo(` (statement continues) and `}` (statement\n// ended before this line) are not mistaken for complete single-line statements\nfunction goBracketBalance (code: string): number {\n let depth = 0;\n let i = 0;\n while (i < code.length) {\n const ch = code[i];\n if ((ch === '\"') || (ch === '\\'')) {\n i = goSkipQuoted (code, i);\n continue;\n }\n if (ch === '`') {\n i += 1;\n while ((i < code.length) && (code[i] !== '`')) {\n i += 1;\n }\n i += 1;\n continue;\n }\n if ((ch === '(') || (ch === '[') || (ch === '{')) {\n depth += 1;\n } else if ((ch === ')') || (ch === ']') || (ch === '}')) {\n depth -= 1;\n }\n i += 1;\n }\n return depth;\n}\n\n// the return type the printer's own immediately-called func literal carries\n// (`func() T { … }()`), or undefined when the text is not one or T is an `any` box\nfunction goFuncLiteralReturnType (value: string): string | undefined {\n const literal = /^func\\(\\) ([\\w.[\\]]*) \\{/.exec(value);\n if ((literal === null) || !value.endsWith('}()') || (literal[1] === 'any')) {\n return undefined;\n }\n return literal[1];\n}\n\n// index of the first `//` outside strings and comments, or -1. The state is carried across lines\n// because `/* */` comments and `-quoted strings can span them (a `//` inside a string literal is\n// data, e.g. the `https://` of an endpoint, and must not be taken for a comment)\nfunction goTrailingCommentIndex (line: string, state: { block: boolean, raw: boolean }): number {\n let i = 0;\n while (i < line.length) {\n const ch = line[i];\n if (state.block) {\n if ((ch === '*') && (line[i + 1] === '/')) {\n state.block = false;\n i += 2;\n continue;\n }\n i += 1;\n continue;\n }\n if (state.raw) {\n if (ch === '`') {\n state.raw = false;\n }\n i += 1;\n continue;\n }\n if (ch === '`') {\n state.raw = true;\n i += 1;\n continue;\n }\n if ((ch === '\"') || (ch === '\\'')) {\n i = goSkipQuoted (line, i);\n continue;\n }\n if ((ch === '/') && (line[i + 1] === '/')) {\n return i;\n }\n if ((ch === '/') && (line[i + 1] === '*')) {\n state.block = true;\n i += 2;\n continue;\n }\n i += 1;\n }\n return -1;\n}\n\n// tabwriter counts runes, not bytes (a multi-byte identifier is one column wide)\nfunction goRuneWidth (text: string): number {\n return [ ...text ].length;\n}\n\nfunction alignGoTrailingComments (content: string): string {\n const lines = content.split ('\\n');\n const entries: { index: number, indent: string, code: string, comment: string }[] = [];\n const state = { 'block': false, 'raw': false };\n for (let index = 0; index < lines.length; index++) {\n const commentIndex = goTrailingCommentIndex (lines[index], state);\n if (commentIndex < 0) {\n continue;\n }\n // the code cell: everything before the comment, without the padding already inside it\n const code = lines[index].slice (0, commentIndex).replace (/[ \\t]+$/, '');\n if (!code.trim ()) {\n continue; // a comment-only line is a section break, it is never a cell\n }\n const indent = code.match (/^[ \\t]*/)[0];\n entries.push ({ 'index': index, indent, code, 'comment': lines[index].slice (commentIndex) });\n }\n // group the lines that share a code column: adjacent, same indentation, and no section break\n // in between (the previous line must end its own statement, and that statement must be a\n // single-line one, or the next statement starts a new section)\n const groups: typeof entries[] = [];\n let group: typeof entries = [];\n for (const entry of entries) {\n const previous = group[group.length - 1];\n const continues = previous\n && (entry.index === previous.index + 1)\n && (entry.indent === previous.indent)\n && (goBracketBalance (previous.code) === 0)\n && !GO_COMMENT_BREAK_END.test (previous.code);\n if (continues) {\n group.push (entry);\n } else {\n if (group.length) {\n groups.push (group);\n }\n group = [ entry ];\n }\n }\n if (group.length) {\n groups.push (group);\n }\n for (const members of groups) {\n let width = 0;\n for (const member of members) {\n width = Math.max (width, goRuneWidth (member.code));\n }\n width += 1; // tabwriter padding\n for (const member of members) {\n const pad = width - goRuneWidth (member.code);\n lines[member.index] = member.code + ' '.repeat (pad) + member.comment;\n }\n }\n return lines.join ('\\n');\n}\n\n// `/^this\\s*\\.\\s*\\s*\\(/` for each name: a call of that method on `this`\nfunction goThisCallPatterns (names: string[]): RegExp[] {\n return names.map((name) => new RegExp('^this\\\\s*\\\\.\\\\s*' + name + '\\\\s*\\\\('));\n}\n\n// the TypeScript accessors whose Go signature this printer knows to be `*string`\n// (GO_HELPER_RETURN_TYPES plus coerced SafeCurrencyCode/SafeSymbol); the textual call-site proof\n// uses them for ts/src sibling files a scoped run's program does not carry.\nconst GO_TS_SRC_STRING_PRODUCERS = goThisCallPatterns([\n 'safeString', 'safeString2', 'safeString3', 'safeStringN', 'safeStringLower', 'safeStringLower2',\n 'safeStringUpper', 'safeStringUpper2', 'safeCurrencyCode', 'safeSymbol',\n]);\n\n// the TS accessors whose Go signature GO_HELPER_RETURN_TYPES already names\n// `map[string]any`, for the same textual sibling-file proof. A map argument is also\n// proven when it is an object literal (its printed Go form is exactly that map) or a\nconst GO_TS_SRC_MAP_PRODUCERS = goThisCallPatterns([ 'extend', 'deepExtend', 'keysort', 'indexBy', 'groupBy' ]);\n\n// the argument texts of a call whose opening parenthesis sits at `open`, or undefined\n// when the parentheses do not balance — an unproven call site must never pass the proof\nfunction goBalancedCallArgs (text: string, open: number): string[] | undefined {\n const args: string[] = [];\n let depth = 0;\n let current = '';\n let quote: string | undefined;\n for (let i = open; i < text.length; i++) {\n const ch = text[i];\n if (quote !== undefined) {\n current += ch;\n if (ch === '\\\\') {\n current += text[i + 1] ?? '';\n i++;\n continue;\n }\n if (ch === quote) {\n quote = undefined;\n }\n continue;\n }\n if ((ch === '\"') || (ch === \"'\") || (ch === '`')) {\n quote = ch;\n current += ch;\n continue;\n }\n if ((ch === '/') && (text[i + 1] === '/')) {\n while ((i < text.length) && (text[i] !== '\\n')) { i++; }\n continue;\n }\n if (ch === '(') {\n depth++;\n if (depth > 1) { current += ch; }\n continue;\n }\n if (ch === ')') {\n depth--;\n if (depth === 0) {\n if (current.trim().length > 0) { args.push (current.trim ()); }\n return args;\n }\n current += ch;\n continue;\n }\n if ((ch === ',') && (depth === 1)) {\n args.push (current.trim ());\n current = '';\n continue;\n }\n current += ch;\n }\n return undefined;\n}\n\nexport {\n alignGoTrailingComments,\n};\n\n// implicit endpoints pass api (['v1', 'private']) and params (a list for batch orders) untyped;\n// exchange overrides of sign/fetch2/request usually omit the base `api: any` annotation\nconst GO_GETARG_EXCLUDED_POSITIONS: { [name: string]: number[] } = {\n 'fetch2': [ 1, 3 ],\n 'request': [ 1, 3 ],\n 'sign': [ 1, 3 ],\n};\n\n// base helpers typed `any[]` that hand back, at this index, the params map they were given\n// (unchanged, omitted or extended: always a map[string]any in Go)\nconst GO_PARAMS_TUPLE_HELPERS: { [name: string]: number } = {\n 'handleUntilOption': 1,\n 'handleNetworkCodeAndParams': 1,\n 'handleWithdrawTagAndParams': 1,\n 'handleTriggerAndParams': 1,\n 'handleTriggerDirectionAndParams': 1,\n 'handlePostOnly': 1,\n 'handleTriggerPricesAndParams': 3,\n};\n\n// receivers that read a nil map exactly like an untyped nil (derefScalar + a missed lookup);\n// IsDictionary and IsEqual answer differently for a nil map, so they are not listed\nconst GO_GETARG_NIL_MAP_READERS = [\n 'GetValue', 'InOp', 'ObjectKeys', 'SafeValue', 'SafeValue2', 'SafeDict', 'SafeList',\n 'SafeString', 'SafeString2', 'SafeStringN', 'SafeStringUpper', 'SafeStringLower',\n 'SafeInteger', 'SafeInteger2', 'SafeNumber', 'SafeNumber2', 'SafeFloat', 'SafeBool', 'SafeTimestamp',\n];\n\nexport class GoTranspiler extends BaseTranspiler {\n\n // scopes are scanned many times per local; walking remote TS7 nodes is costly, so the\n // preorder descendant list is built once per scope (same visit order and early stop)\n goScopeDescendants = new WeakMap();\n goDescendantsOf(scope): any[] {\n let list = this.goScopeDescendants.get(scope);\n if (list === undefined) {\n list = [];\n const out = list;\n const visit = (n: any) => {\n out.push(n);\n n.forEachChild(visit);\n };\n scope.forEachChild(visit);\n this.goScopeDescendants.set(scope, list);\n }\n return list;\n }\n\n hasNodeWhere(scope: Node | undefined, predicate: (n: any) => boolean): boolean {\n if (scope === undefined) {\n return false;\n }\n return this.goDescendantsOf(scope).some(predicate);\n }\n\n binaryExpressionsWrappers;\n wrapThisCalls: boolean;\n wrapCallMethods: string[] = [];\n // inherited method name -> indexes of required params that print `string` on the base and every\n // override (the caller audits all declarations); other callers convert through StringArg\n unifiedStringParams: { [method: string]: number[] } = {};\n // installed by the ccxt build: GetArg alias -> Go types, and the audited consumer table\n CCXT_GO_GETARG_DECLARED_TYPES: any;\n CCXT_GO_GETARG_SAFE_CONSUMERS: any;\n goGetArgTypeCache: WeakMap;\n goGetArgTypeComputing: Set;\n // declarations whose Go local type is being resolved right now (see goLocalStaticType)\n goLocalTypeResolution = new Set();\n // goSelfConcatIsString's answer per non-self leaf node\n goSelfConcatLeafCache = new WeakMap();\n goLocalStaticTypeCache = new WeakMap();\n // binary-expression texts and goNativeArithmetic types, keyed by node + print context, alive only\n // while the outermost binary print/typing runs: operand typing re-prints every nested operator\n goBinaryMemo: Map> | undefined;\n // appended to every async (channel returning) Go method/function name and to each\n // checker-resolved call site of one; '' disables the rename\n asyncMethodSuffix = '';\n // declaring-file patterns whose async methods keep the plain name at call sites (generated\n // endpoint bodies the target language implements itself, e.g. ccxt's ts/src/abstract/)\n asyncSuffixExemptPaths: RegExp[] = [];\n classNameMap: { [key: string]: string };\n DEFAULT_RETURN_TYPE = 'any';\n // suffix of the sibling body method an async trampoline hands its work to\n ASYNC_BODY_SUFFIX = 'Body';\n // gofmt indents every nesting level with exactly one tab; the printer emits the\n // same bytes so the generated tree needs no `gofmt` pass (campaign go-gofmt F01)\n DEFAULT_IDENTATION = \"\\t\";\n // stdlib packages the printed source file references. A Go import must precede the first\n // declaration, so the file-level print (printSourceFileStatements) collects names here and\n // prepends `import \"...\"`. Nested prints keep their own list; memo of goStdlibImportIsPlaceable().\n\n constructor(config = {}) {\n config['parser'] = Object.assign ({}, parserConfig, config['parser'] ?? {});\n\n super(config);\n\n this.requiresParameterType = true;\n this.requiresReturnType = true;\n this.asyncTranspiling = false;\n this.implicitAsyncTranspiling = true;\n this.supportsFalsyOrTruthyValues = false;\n this.requiresCallExpressionCast = true;\n this.wrapThisCalls = false;\n this.id = \"Go\";\n this.className = \"undefined\";\n this.classNameMap = config['classNameMap'] ?? {};\n this.initConfig();\n\n // user overrides\n this.applyUserOverrides(config);\n this.wrapThisCalls = config['wrapThisCalls'] ?? false;\n this.wrapCallMethods = config['wrapCallMethods'] ?? [];\n this.asyncMethodSuffix = config['asyncMethodSuffix'] ?? '';\n this.asyncSuffixExemptPaths = (config['asyncSuffixExemptPaths'] ?? []).map((p) => new RegExp(p));\n this.unifiedStringParams = config['unifiedStringParams'] ?? {};\n }\n\n initConfig() {\n this.LeftPropertyAccessReplacements = {\n // 'this': '$this',\n };\n\n this.RightPropertyAccessReplacements = {\n 'push': 'Add', // list method\n 'indexOf': 'IndexOf', // list method\n 'toUpperCase': 'ToUpper',\n 'toLowerCase': 'ToLower',\n 'toString': 'ToString',\n };\n\n this.FullPropertyAccessReplacements = {\n 'JSON.parse': 'parseJson', // custom helper method\n 'console.log': 'fmt.Println',\n 'Number.MAX_SAFE_INTEGER': 'Int32.MaxValue',\n 'Math.min': 'Math.Min',\n 'Math.max': 'Math.Max',\n 'Math.log': 'Math.Log',\n 'Math.abs': 'Math.Abs',\n // 'Math.ceil': 'Math.Ceiling', // need cast\n // 'Math.round': 'Math.Round', // need to cast\n 'Math.floor': 'Math.Floor',\n 'Math.pow': 'Math.Pow',\n // 'Promise.all': 'Task.WhenAll',\n };\n\n this.CallExpressionReplacements = {\n // \"parseInt\": \"parseINt\",\n // \"parseFloat\": \"float.Parse\",\n };\n\n this.ReservedKeywordsReplacements = {\n // 'string': 'str',\n // 'params': 'parameters',\n 'type': 'typeVar',\n // 'internal': 'intern',\n // 'event': 'eventVar',\n // 'fixed': 'fixedVar',\n };\n\n this.binaryExpressionsWrappers = {\n [SyntaxKind.EqualsEqualsToken]: [this.EQUALS_EQUALS_WRAPPER_OPEN, this.EQUALS_EQUALS_WRAPPER_CLOSE],\n [SyntaxKind.EqualsEqualsEqualsToken]: [this.EQUALS_EQUALS_WRAPPER_OPEN, this.EQUALS_EQUALS_WRAPPER_CLOSE],\n [SyntaxKind.ExclamationEqualsToken]: [this.DIFFERENT_WRAPPER_OPEN, this.DIFFERENT_WRAPPER_CLOSE],\n [SyntaxKind.ExclamationEqualsEqualsToken]: [this.DIFFERENT_WRAPPER_OPEN, this.DIFFERENT_WRAPPER_CLOSE],\n [SyntaxKind.GreaterThanToken]: [this.GREATER_THAN_WRAPPER_OPEN, this.GREATER_THAN_WRAPPER_CLOSE],\n [SyntaxKind.GreaterThanEqualsToken]: [this.GREATER_THAN_EQUALS_WRAPPER_OPEN, this.GREATER_THAN_EQUALS_WRAPPER_CLOSE],\n [SyntaxKind.LessThanToken]: [this.LESS_THAN_WRAPPER_OPEN, this.LESS_THAN_WRAPPER_CLOSE],\n [SyntaxKind.LessThanEqualsToken]: [this.LESS_THAN_EQUALS_WRAPPER_OPEN, this.LESS_THAN_EQUALS_WRAPPER_CLOSE],\n [SyntaxKind.PlusToken]: [this.PLUS_WRAPPER_OPEN, this.PLUS_WRAPPER_CLOSE],\n [SyntaxKind.MinusToken]: [this.MINUS_WRAPPER_OPEN, this.MINUS_WRAPPER_CLOSE],\n [SyntaxKind.AsteriskToken]: [this.MULTIPLY_WRAPPER_OPEN, this.MULTIPLY_WRAPPER_CLOSE],\n [SyntaxKind.PercentToken]: [this.MOD_WRAPPER_OPEN, this.MOD_WRAPPER_CLOSE],\n [SyntaxKind.SlashToken]: [this.DIVIDE_WRAPPER_OPEN, this.DIVIDE_WRAPPER_CLOSE],\n };\n }\n\n // getBlockOpen(identation){\n // return this.getIden(identation) + this.BLOCK_OPENING_TOKEN;\n // }\n\n printSuperCallInsideConstructor(node, identation) {\n return \"\"; // csharp does not need super call inside constructor\n }\n\n printStringLiteral(node) {\n const token = this.STRING_QUOTE_TOKEN;\n let text = node.text;\n if (text in this.StringLiteralReplacements) {\n return this.StringLiteralReplacements[text];\n }\n // skip the replaceAll passes when there is nothing to escape\n // note: single quotes must NOT be escaped — \\' is an invalid escape in Go string literals\n if (/[\\\\\"\\b\\f\\n\\r\\t]/.test(text)) {\n // Preserve real backslashes\n const backslashPlaceholder = \"\\x00\";\n text = text.replaceAll(\"\\\\\", backslashPlaceholder);\n text = text.replaceAll(\"\\b\", \"\\\\b\");\n text = text.replaceAll(\"\\f\", \"\\\\f\");\n text = text.replaceAll(\"\\n\", \"\\\\n\");\n text = text.replaceAll(\"\\r\", \"\\\\r\");\n text = text.replaceAll(\"\\t\", \"\\\\t\");\n text = text.replaceAll(backslashPlaceholder, \"\\\\\\\\\");\n text = text.replaceAll(\"\\\"\", \"\\\\\\\"\");\n }\n return token + text + token;\n }\n\n transformFunctionNameIfNeeded(name): string {\n return this.capitalize(name);\n }\n\n // The cells of one struct field in the shape gofmt's fieldList() prints them: a named\n // field is `Name Type [Tag]` (the name cell — and, when the field carries a tag, the type\n // cell too — is a tab-terminated column cell) and an embedded field is a single cell.\n // printStruct() lays those cells out; printPropertyDeclaration() joins them with spaces.\n getStructFieldCells(node) {\n const name = this.capitalize(this.printNode(node.name, 0));\n let type = 'any';\n if (node.type === undefined) {\n type = 'any';\n } else if (node.type.kind === SyntaxKind.StringKeyword) {\n type = 'string';\n } else if (node.type.kind === SyntaxKind.NumberKeyword) {\n type = 'int';\n } else if (node.type.kind === SyntaxKind.BooleanKeyword || isBooleanLiteral(node)) {\n type = 'bool';\n } else if (node.type.kind === SyntaxKind.ArrayType) {\n type = '[]any';\n }\n const cells = [ name, type ];\n if (node.initializer) {\n // we have to save the value and initialize it later\n let initializer = this.printNode(node.initializer, 0);\n // quick fix\n initializer = initializer.replaceAll('\"', '');\n cells.push(`\\`default:\"${initializer}\"\\``);\n }\n return cells;\n }\n\n printPropertyDeclaration(node, identation) {\n return this.getIden(identation) + this.getStructFieldCells(node).join(' ') + this.LINE_TERMINATOR;\n }\n\n printStruct(node, indentation) {\n\n const rows: string[][] = [];\n // check if we have heritage\n if (node?.heritageClauses?.length > 0) {\n const heritage = node.heritageClauses[0];\n const heritageType = heritage.types[0];\n let heritageEscapedText = heritageType.expression.text;\n if (this.classNameMap[heritageEscapedText]) {\n heritageEscapedText = this.classNameMap[heritageEscapedText];\n }\n // an embedded field has no type cell: it is a single, unterminated cell\n rows.push([ heritageEscapedText ]);\n }\n\n const propDeclarations = node.members.filter(member => member.kind === SyntaxKind.PropertyDeclaration);\n propDeclarations.forEach(member => rows.push(this.getStructFieldCells(member)));\n\n // gofmt lays the fields out with text/tabwriter (go/printer's fieldList): a column\n // block is a run of consecutive fields whose cell in that column is tab-terminated,\n // and every cell of the block is padded with spaces to the widest cell of the block\n // plus one. An embedded field (a single cell) and a field without a tag (its type is\n // the trailing cell) end the block of every column they have no cell in, which is\n // what keeps `Exchange` from widening the `exchangeTyped *ExchangeTyped` column.\n const lines = rows.map((cells, row) => {\n let line = cells[0];\n for (let column = 0; column < cells.length - 1; column++) {\n let width = 0;\n for (let previous = row; previous >= 0 && rows[previous].length > column + 1; previous--) {\n width = Math.max(width, rows[previous][column].length);\n }\n for (let next = row + 1; next < rows.length && rows[next].length > column + 1; next++) {\n width = Math.max(width, rows[next][column].length);\n }\n line += ' '.repeat(width + 1 - cells[column].length) + cells[column + 1];\n }\n return this.getIden(indentation + 1) + line;\n });\n\n // a struct with no fields is `type X struct {\\n}`: no stray blank line before the brace\n const body = lines.length ? '\\n' + lines.join('\\n') + '\\n' : '\\n';\n return `type ${this.className} struct {${body}}`;\n }\n\n printNewStructMethod(node){\n return `\nfunc New${this.capitalize(this.className)}() *${(this.className)} {\n\\tp := &${this.className}{}\n\\tsetDefaults(p)\n\\treturn p\n}\\n`;\n // TO remove `return copies lock value: github.com/ccxt/ccxt/go/v4.bitvavoWs contains github.com/ccxt/ccxt/go/v4.bitvavo contains github.com/ccxt/ccxt/go/v4.Exchange contains sync.Mutex`\n // change the return value to\n //\n // return `\n // func New${this.capitalize(className)}() *${(className)} {\n // p := ${className}{}\n // setDefaults(&p)\n // return &p\n // }\\n`;\n //\n\n }\n\n printClass(node, identation) {\n this.className = node.name.text;\n if (this.classNameMap[this.className]) {\n this.className = this.classNameMap[this.className];\n }\n\n const struct = this.printStruct(node, identation);\n const newMethod = this.printNewStructMethod(node);\n\n const methods = node.members.filter(member => member.kind === SyntaxKind.MethodDeclaration);\n const classMethods = this.joinTopLevelDecls(methods.map(method => this.printMethodDeclaration(method, identation)));\n // const classDefinition = this.printClassDefinition(node, identation);\n\n // const classBody = this.printClassBody(node, identation);\n\n // const classClosing = this.getBlockClose(identation);\n\n // return classDefinition + classBody + classClosing;\n return struct + \"\\n\" + newMethod + \"\\n\" + classMethods;\n }\n\n /**\n * gofmt's declaration-list rule (go/printer nodes.go `declList`): a top-level\n * declaration that carries a doc comment is separated from the previous declaration\n * by exactly one blank line (`min = 2` linebreaks), while a declaration without one\n * keeps the source's own separation (the printer emits members adjacent to the\n * closing brace above them). `printClass` used to join every member with a bare\n * \"\\n\", so a method whose leading `/** ... *` + `/` comment follows the previous\n * method's closing brace came out as `}\\n/**` and gofmt re-inserted the blank line.\n */\n joinTopLevelDecls (decls: string[]): string {\n return decls.map((decl, index) => {\n if (index === 0) {\n return decl;\n }\n return (this.startsWithComment(decl) ? \"\\n\\n\" : \"\\n\") + decl;\n }).join(\"\");\n }\n\n /**\n * True when the emitted declaration text opens with its doc comment - the comment\n * group gofmt attaches to the declaration (`getDoc(d) != nil` in go/printer).\n */\n startsWithComment (decl: string): boolean {\n return this.isComment(decl.split(\"\\n\")[0]);\n }\n\n /**\n * Indent every non-blank line of `lines` by `identation` levels. gofmt trims trailing\n * whitespace, so an indented *blank* line (only the indentation of a blank source\n * line) must stay empty instead of becoming whitespace-only text.\n */\n indentLines (lines: string[], identation: number): string[] {\n return lines.map((line) => line.trim().length === 0 ? \"\" : this.getIden(identation) + line);\n }\n\n printPropertyAccessModifiers (node) {\n return \"\";\n }\n\n printSpreadElement(node, identation) {\n const expression = this.printNode(node.expression, 0);\n return this.getIden(identation) + expression + this.SPREAD_TOKEN;\n }\n\n printMethodDeclaration(node, identation) {\n const methodDef = this.printMethodDefinition(node, identation);\n const isAsync = this.isAsyncFunction(node);\n const funcBody = this.printFunctionBody(node, identation, isAsync);\n if (!isAsync) {\n return methodDef + funcBody;\n }\n return this.printAsyncDeclarationPair(node, identation, methodDef, funcBody, true);\n }\n\n // Trampoline + body pair, see printAsyncTrampolineBlock. A module-scope `async function`\n // has no receiver: its body is a package-level sibling with the same trampoline contract.\n printAsyncDeclarationPair(node, identation, def: string, funcBody: string, isMethod: boolean): string {\n const goName = this.transformMethodNameIfNeeded(node.name.text);\n const bodyName = this.getAsyncBodyName(node, goName);\n const callee = isMethod ? `${this.THIS_TOKEN}.${bodyName}` : bodyName;\n const trampoline = def + this.printAsyncTrampolineBlock(node, identation, callee);\n const receiver = isMethod ? `(${this.THIS_TOKEN} *${this.className}) ` : \"\";\n const bodyDef = `${this.getIden(identation)}func ${receiver}${bodyName}(${this.printAsyncBodyParameters(node)}) ${this.DEFAULT_RETURN_TYPE} `;\n return trampoline + \"\\n\" + bodyDef + funcBody;\n }\n\n printFunctionDeclaration(node, identation) {\n if (isArrowFunction(node)) {\n const parameters = node.parameters.map(param => this.printParameter(param)).join(\", \");\n const body = this.printNode(node.body);\n return `(${parameters}) => ${body}`;\n }\n const isAsync = this.isAsyncFunction(node);\n const functionDef = this.printFunctionDefinition(node, identation);\n const funcBody = this.printFunctionBody(node, identation, isAsync);\n\n // printFunctionDefinition already carries the leading comment\n if (!isAsync) {\n return functionDef + funcBody;\n }\n return this.printAsyncDeclarationPair(node, identation, functionDef, funcBody, false);\n }\n\n /**\n * Name of the sibling *body* method/function an async core hands its work to.\n *\n * `FetchTicker` -> `fetchTickerBody`. Deliberately UNEXPORTED: the body is an\n * implementation detail of the trampoline, so it must not show up on the generated\n * interfaces (ICoreExchange) nor on the typed `*_wrapper.go` facades, and it stays\n * invisible to the reflection based `callInternal`/`callDynamically` dispatch.\n *\n * If that name is already taken by a real declaration (a hand written\n * `fetchTickerBody`), a numeric suffix is appended instead of silently clobbering it.\n */\n getAsyncBodyName(node, goName: string): string {\n const taken = new Set();\n const remember = (raw) => {\n if (!raw) {\n return;\n }\n const name = String(raw);\n taken.add(name);\n try {\n taken.add(this.transformMethodNameIfNeeded(name));\n } catch {\n // a malformed name must never break emission\n }\n };\n try {\n const parent = node?.parent;\n if (parent && isClassDeclarationNode(parent)) {\n parent.members.forEach((member: any) => remember(member?.name?.text));\n } else if (parent && isSourceFile(parent)) {\n parent.statements.forEach((statement: any) => {\n if (isFunctionDeclaration(statement)) {\n remember(statement?.name?.text);\n }\n });\n }\n } catch {\n // a malformed/synthesised node must never break emission\n }\n const base = goName.charAt(0).toLowerCase() + goName.slice(1) + this.ASYNC_BODY_SUFFIX;\n let name = base;\n let suffix = 0;\n while (taken.has(name)) {\n suffix++;\n name = `${base}${suffix}`;\n }\n return name;\n }\n\n /**\n * Parameter list of the body: the channel it must fill, then the original parameters\n * verbatim (including the `optionalArgs ...any` tail), so the trampoline can forward\n * its own arguments unchanged.\n */\n printAsyncBodyParameters(node): string {\n const params = this.printMethodParameters(node);\n const channelParam = `ch chan ${this.DEFAULT_RETURN_TYPE}`;\n return params ? `${channelParam}, ${params}` : channelParam;\n }\n\n /**\n * Arguments the trampoline forwards to its body, matching printMethodParameters:\n * the declared parameters in order, plus the variadic `optionalArgs...` tail when\n * the function has any defaulted parameter.\n */\n printAsyncTrampolineArgs(node): string {\n const args = [];\n let hasOptionalParameter = false;\n (node?.parameters ?? []).forEach((param) => {\n if (param.initializer) {\n hasOptionalParameter = true;\n return;\n }\n args.push(this.printNode(param.name, 0));\n });\n if (hasOptionalParameter) {\n args.push('optionalArgs...');\n }\n return args.join(\", \");\n }\n\n /**\n * The trampoline: an async core hands back a *hot handle*.\n *\n * func (this *Exchange) FetchTicker(symbol any) <-chan any {\n * ch := make(chan any, 1)\n * go this.fetchTickerBody(ch, symbol)\n * return ch\n * }\n *\n * - `ch` is buffered (cap 1): the body's single `ch <- value` never blocks, so a\n * result nobody ever receives still lets the goroutine finish and run\n * `defer close(ch)` (no leak for abandoned calls).\n * - the body runs on its own goroutine, so the call expression returns immediately\n * with work already in flight. That is what makes\n * `const a = this.fetchA (); const b = this.fetchB (); await Promise.all([a,b])`\n * overlap, exactly like the C#/Java ports, with no call-site wrapper.\n * - the result stays UNNAMED (`<-chan any`): `return ch` is the trampoline's only\n * statement and it always runs, because the recover (`defer ReturnPanicError(ch)`)\n * lives on the body, not here.\n */\n printAsyncTrampolineBlock(node, identation, callee: string): string {\n const args = this.printAsyncTrampolineArgs(node);\n const argList = args ? `, ${args}` : \"\";\n return [\n // F04: the signature above ends WITHOUT a trailing space, so the block opener\n // carries the one space before `{` (same contract as getBlockOpen)\n \" {\",\n `${this.getIden(identation + 1)}ch := make(chan ${this.DEFAULT_RETURN_TYPE}, 1)`,\n `${this.getIden(identation + 1)}go ${callee}(ch${argList})`,\n `${this.getIden(identation + 1)}return ch`,\n `${this.getIden(identation)}}`,\n ].join(\"\\n\");\n }\n\n /**\n * Go name of an async (channel returning) declaration: `fetchTicker` -> `FetchTickerAsync`.\n * Empty `asyncMethodSuffix` (the default) keeps the plain name, so the suffix is opt-in.\n */\n printAsyncDeclarationName(node, goName: string): string {\n if (!this.asyncMethodSuffix || !this.isAsyncFunction(node)) {\n return goName;\n }\n return goName + this.asyncMethodSuffix;\n }\n\n /**\n * Resolve the declaration a call/property access refers to and append `asyncMethodSuffix`\n * when it is an async function. Uses the checker, so `this.x()`, `super.x()`, `obj.x()` and\n * bare `x()` all agree with the declaration site. Unresolvable or non-function symbols\n * (properties, `any` receivers, JS builtins) keep the plain name.\n */\n applyAsyncSuffixToCallee(nameNode, goName: string): string {\n if (!this.asyncMethodSuffix || !nameNode) {\n return goName;\n }\n let decls;\n try {\n let symbol = this.getChecker().getSymbolAtLocation(nameNode);\n if (symbol && (symbol.flags & SymbolFlags.Alias)) {\n symbol = this.getChecker().getAliasedSymbol(symbol);\n }\n decls = symbol?.declarations?.map((d) => d.resolve());\n } catch {\n return goName;\n }\n if (!decls || decls.length === 0) {\n return goName;\n }\n // only declarations with a body count: interface/abstract signatures (e.g. implicit API\n // endpoints declared as `foo(params?: {}): Promise;`) are emitted elsewhere, unsuffixed\n const isAsyncDecl = decls.some((d) => (isMethodDeclaration(d) || isFunctionDeclaration(d))\n && d.body !== undefined && this.isAsyncFunction(d) && !this.isAsyncSuffixExempt(d));\n return isAsyncDecl ? goName + this.asyncMethodSuffix : goName;\n }\n\n isAsyncSuffixExempt(decl): boolean {\n if (this.asyncSuffixExemptPaths.length === 0) {\n return false;\n }\n const fileName = String(decl.getSourceFile()?.fileName ?? '').replace(/\\\\/g, '/');\n return this.asyncSuffixExemptPaths.some((re) => re.test(fileName));\n }\n\n printMethodDefinition(node, identation) {\n return this.printGoSignature(node, identation, `(${this.THIS_TOKEN} *${this.className}) `);\n }\n\n printFunctionDefinition(node, identation) {\n return this.printGoSignature(node, identation, \"\");\n }\n\n // F04: `func`, the receiver, the name and the return type are separated by exactly one\n // space, and the signature carries NO trailing space — the block opener (`getBlockOpen`,\n // or `printAsyncTrampolineBlock`) contributes the single space before `{`.\n printGoSignature(node, identation, receiver: string): string {\n const name = this.printAsyncDeclarationName(node, this.transformMethodNameIfNeeded(node.name.text));\n const returnType = this.printFunctionType(node).trim();\n const parsedArgs = this.printMethodParameters(node);\n const methodToken = this.METHOD_TOKEN ? this.METHOD_TOKEN + \" \" : \" \";\n const returnSignature = returnType ? \" \" + returnType : \"\";\n const methodDef = this.getIden(identation) + methodToken + receiver + name + \"(\" + parsedArgs + \")\" + returnSignature;\n return this.printNodeCommentsIfAny(node, identation, methodDef);\n }\n\n printMethodParameters(node) {\n const params = node.parameters.map(param => this.printParameter(param));\n const required = params.filter(param => param !== 'optional');\n if (required.length < params.length) {\n required.push('optionalArgs ...any');\n }\n return required.join(\", \");\n }\n\n printParameter(node, defaultValue = true) {\n const name = this.printNode(node.name, 0);\n const initializer = node.initializer;\n\n const type = this.printParameterType(node);\n\n if (defaultValue && initializer) {\n return 'optional'; // printMethodParameters folds these into `optionalArgs ...any`\n }\n return name + ' ' + type;\n }\n\n printParameterType(node) {\n // B-02: an internal method's parameter that the call-site proof types prints\n // its native Go type; every other parameter keeps the `any` box\n const nativeType = this.goNativeParameterType(node);\n if (nativeType !== undefined) {\n return nativeType;\n }\n return 'any';\n }\n\n printFunctionType(node){\n const typeText = this.getFunctionType(node);\n if (typeText === 'void') {\n return \"\";\n }\n if (typeText === undefined || (typeText !== this.VOID_KEYWORD && typeText !== this.PROMISE_TYPE_KEYWORD)) {\n const res = this.isAsyncFunction(node) ? `<-chan ${this.DEFAULT_RETURN_TYPE}` : this.DEFAULT_RETURN_TYPE;\n this.warn(node, node.name.getText(), \"Function return type not found, will default to: \" + res);\n return res;\n }\n if (typeText === this.PROMISE_TYPE_KEYWORD) {\n return `<-chan any`;\n }\n\n // move any trailing array brackets \"[]\" to directly precede the element type\n if (typeText && typeText.endsWith('[]')) {\n const core = typeText.substring(0, typeText.length - 2); // drop []\n const lastBracketPos = core.lastIndexOf(']');\n if (lastBracketPos !== -1) {\n // insert [] right after the last ']'\n return core.substring(0, lastBracketPos + 1) + '[]' + core.substring(lastBracketPos + 1);\n }\n }\n return typeText;\n }\n\n // true when the printed expression is a single call `Callee(...)` covering the\n // whole string, so its Go type is the callee's return type and nothing else\n isWholePrintedCall(value: string, open: number): boolean {\n let depth = 0;\n let inString = false;\n let escaped = false;\n for (let i = open; i < value.length; i++) {\n const c = value[i];\n if (inString) {\n if (escaped) { escaped = false; }\n else if (c === '\\\\') { escaped = true; }\n else if (c === '\"') { inString = false; }\n continue;\n }\n if (c === '\"') { inString = true; continue; }\n if (c === '(') { depth++; continue; }\n if (c === ')') {\n depth--;\n if (depth === 0) { return i === value.length - 1; }\n }\n }\n return false;\n }\n\n // the concrete Go type the initializer already produces, or undefined when the\n // printer cannot name it (GetValue, Ternary, Add, ... return any)\n goTypeOfInitializer(initializer, printedValue: string): string | undefined {\n // a `.slice(a, b)` this printer inlines to a Go subscript (or its guarded func\n // literal) still holds a string, so its local keeps the type the helper gave it\n if (this.goIsNativeSliceCall(initializer)) {\n return 'string';\n }\n switch (initializer?.kind) {\n case SyntaxKind.StringLiteral:\n case SyntaxKind.NoSubstitutionTemplateLiteral:\n return 'string';\n case SyntaxKind.TrueKeyword:\n case SyntaxKind.FalseKeyword:\n return 'bool';\n case SyntaxKind.ObjectLiteralExpression:\n return 'map[string]any';\n case SyntaxKind.ArrayLiteralExpression:\n return '[]any';\n case SyntaxKind.PrefixUnaryExpression:\n // `!x` prints `!EvalTruthy(x)`\n return (initializer.operator === SyntaxKind.ExclamationToken) ? 'bool' : undefined;\n case SyntaxKind.ParenthesizedExpression:\n return this.goTypeOfInitializer(initializer.expression, printedValue);\n case SyntaxKind.BinaryExpression: {\n // `a || b` prints `EvalTruthy(a) || EvalTruthy(b)`, a Go bool\n const op = initializer.operatorToken.kind;\n if ((op === SyntaxKind.BarBarToken) || (op === SyntaxKind.AmpersandAmpersandToken)) {\n return 'bool';\n }\n // `a === b` prints either `IsEqual(a, b)` or an inlined `(a == b)`;\n // `a < b` prints either `IsLessThan(a, b)` or an inlined `(a < b)`.\n // All of them are Go bools.\n if ((op === SyntaxKind.EqualsEqualsToken) || (op === SyntaxKind.EqualsEqualsEqualsToken)\n || (op === SyntaxKind.ExclamationEqualsToken) || (op === SyntaxKind.ExclamationEqualsEqualsToken)\n || (ORDERED_COMPARISON_OPERATORS[op] !== undefined)) {\n return 'bool';\n }\n // a `+` chain goNativeStringConcat prints as the Go operator is a Go string\n if ((op === SyntaxKind.PlusToken) && (this.goNativeArithmetic(initializer)?.goType === 'string')) {\n return 'string';\n }\n break;\n }\n case SyntaxKind.CallExpression: {\n // `x.toString()` that printToStringCall inlined to the receiver's own text: the\n // declaration then holds that receiver's value, i.e. the same Go string. Every\n // other receiver keeps the helper call, whose own return type is classified below.\n const property = initializer.expression;\n if ((property?.kind === SyntaxKind.PropertyAccessExpression)\n && (property.name?.text === 'toString')\n && (initializer.arguments?.length === 0)\n && ((this.goOperandStaticType(property.expression, printedValue) === 'string')\n || this.goDerefableStringOperand(property.expression))) {\n return 'string';\n }\n break;\n }\n }\n // `const x = (a === b)` prints the wrapping parentheses of the source\n const value = this.goUnwrapPrintedParens(printedValue);\n const open = value.indexOf('(');\n // the printer's own emissions are immediately-called func literals: the native\n // `key in obj` returns a Go bool (no EvalTruthy round-trip), and a ternary whose\n // arms print as one scalar returns that scalar — both name the value natively\n const literalType = goFuncLiteralReturnType(value);\n if ((literalType !== undefined) && (GO_TYPE_NAMES.indexOf(literalType) >= 0)) {\n return literalType;\n }\n // the nil-guarded `indexOf` literal holds the same Go int GetIndexOf returned\n if (value.startsWith('func() int {') && value.endsWith('}()')) {\n return 'int';\n }\n if (open <= 0 || !this.isWholePrintedCall(value, open)) {\n return undefined;\n }\n const callee = value.substring(0, open);\n if (!/^[A-Za-z_][\\w.]*$/.test(callee)) {\n return undefined;\n }\n return GO_NATIVE_CALL_RETURN_TYPES[callee] ?? GO_HELPER_RETURN_TYPES[callee];\n }\n\n // strips the wrapping parentheses the source (or an operand) printed around a\n // whole expression, so the inner text can be classified\n goUnwrapPrintedParens(printedText: string): string {\n let value = (printedText ?? '').trim();\n while (value.startsWith('(') && this.isWholePrintedCall(value, 0)) {\n value = value.substring(1, value.length - 1).trim();\n }\n return value;\n }\n\n // the concrete Go type of a `var x T = ` local, undefined for `any`\n goLocalStaticType(node): string | undefined {\n const declaration: any = this.getChecker().getSymbolAtLocation(node)?.valueDeclaration?.resolve();\n if (declaration?.kind !== SyntaxKind.VariableDeclaration || declaration.initializer === undefined) {\n return undefined;\n }\n if (declaration.parent?.parent?.kind !== SyntaxKind.FirstStatement) {\n return undefined; // declared with `:=`, where the printer annotates nothing\n }\n if (this.goLocalTypeResolution.has(declaration)) {\n return undefined; // the safety scan below prints an expression using this same local\n }\n // only a top-level answer is stable: nested ones see the recursion guard above\n const topLevel = this.goLocalTypeResolution.size === 0;\n if (topLevel && this.goLocalStaticTypeCache.has(declaration)) {\n return this.goLocalStaticTypeCache.get(declaration);\n }\n this.goLocalTypeResolution.add(declaration);\n try {\n const goType = this.getGoLocalType(declaration, this.printNode(declaration.initializer, 0));\n if (topLevel) {\n this.goLocalStaticTypeCache.set(declaration, goType);\n }\n return goType;\n } finally {\n this.goLocalTypeResolution.delete(declaration);\n }\n }\n\n // `x := ` takes the Go type of the printed initializer, and a `for` initializer carries no\n // annotation, so only decidable literal shapes are named: untyped integer constant is `int`,\n // floating-point is `float64`. Integers not fitting `int` and other initializers keep the helper.\n goInferredLocalStaticType(node): string | undefined {\n const checker: any = this.checkerOrUndefined();\n if (checker === undefined) {\n return undefined;\n }\n const declaration = checker.getSymbolAtLocation(node)?.valueDeclaration?.resolve();\n if (declaration?.kind !== SyntaxKind.VariableDeclaration || declaration.initializer === undefined) {\n return undefined;\n }\n const declarationList = declaration.parent;\n if (declarationList?.kind !== SyntaxKind.VariableDeclarationList\n || declarationList.parent?.kind === SyntaxKind.FirstStatement) {\n return undefined; // the `var x = …` form the printer writes a type on\n }\n const kind = this.goNumericLiteralKind(declaration.initializer);\n if ((kind === 'int') && !this.goLiteralFitsKind(declaration.initializer, 'int')) {\n return undefined;\n }\n return kind;\n }\n\n // `this.` read of a hand-written BaseExchange string field\n goStringFieldStaticType(node, printedText: string): string | undefined {\n const match = /^this\\.([A-Za-z_]\\w*)$/.exec(this.goUnwrapPrintedParens(printedText));\n if (match === null || GO_STRING_FIELD_NAMES.indexOf(match[1]) < 0) {\n return undefined;\n }\n // the struct field is a plain Go `string`: a string cannot be nil, so Add's\n // nil branch is unreachable and every read is the same non-nil string\n return 'string';\n }\n\n // a parameter the printer's own signature printer types with a concrete Go scalar:\n // the emitted Go parameter holds that type at every use, so the operator rule can\n // consume it (the typed-param families re-type `Str`/`Int`/`Num` params this way)\n goDeclaredParamStaticType(node): string | undefined {\n const checker: any = this.checkerOrUndefined();\n if (checker === undefined) {\n return undefined;\n }\n const declaration = checker.getSymbolAtLocation(node)?.valueDeclaration?.resolve();\n if (declaration?.kind !== SyntaxKind.Parameter) {\n return undefined;\n }\n // a defaulted parameter bound through `GetArgString` & co. is that Go scalar\n const bound = this.goGetArgParameterType(declaration);\n if ((bound !== undefined) && (GO_TYPE_NAMES.indexOf(bound) >= 0) && ['string', 'int64', 'float64'].includes(bound)) {\n return bound;\n }\n let type;\n try {\n type = this.printParameterType(declaration);\n } catch (e) {\n return undefined;\n }\n if ((typeof type !== 'string') || (type === 'any') || (GO_TYPE_NAMES.indexOf(type) < 0)) {\n return undefined;\n }\n return this.goTypeNameIsShadowed(this.goEnclosingFunction(declaration), type) ? undefined : type;\n }\n\n // a `*string` local prints a nilable Go pointer; it may only be dereferenced\n // where the checker narrowed it to a non-nilable string (a guard that always\n // exits, an `if (x !== undefined)` block). TypeScript `undefined` == Go nil here.\n goNilProvenStringDeref(node): boolean {\n if (node?.kind !== SyntaxKind.Identifier) {\n return false;\n }\n if (this.goDeclaredTypeOfIdentifier(node) !== '*string') {\n return false;\n }\n const checker: any = this.checkerOrUndefined();\n if (checker === undefined) {\n return false;\n }\n const type = checker.getTypeAtLocation(node);\n return (type.flags & TypeFlags.StringLike) !== 0;\n }\n\n // a `*string` local every write of which is a SafeString-family call with a literal\n // default: that Go method can only return a fresh non-nil pointer, so the local may\n // be deref'd even where the checker offers no narrowing. One write of any other\n goDefaultedSafeStringLocal(node): boolean {\n if (node?.kind !== SyntaxKind.Identifier) {\n return false;\n }\n let declaration;\n try {\n declaration = this.getChecker().getSymbolAtLocation(node)?.valueDeclaration?.resolve();\n } catch (e) {\n return false;\n }\n if ((declaration?.kind !== SyntaxKind.VariableDeclaration) || (declaration.name?.kind !== SyntaxKind.Identifier)) {\n return false;\n }\n if (this.goDeclaredTypeOfIdentifier(node) !== '*string') {\n return false;\n }\n if (!this.goDefaultedSafeStringCall(declaration.initializer)) {\n return false;\n }\n const scope = this.goEnclosingFunction(declaration);\n if (scope === undefined) {\n return false;\n }\n const name = declaration.name.text;\n let everyWriteDefaulted = true;\n const visit = (n) => {\n if (!everyWriteDefaulted) {\n return;\n }\n if ((n.kind === SyntaxKind.Identifier) && (n.text === name) && (n !== declaration.name)) {\n const parent: any = n.parent;\n if ((parent?.kind === SyntaxKind.BinaryExpression) && (parent.left === n)\n && (GO_WRITE_OPERATOR_KINDS.indexOf(parent.operatorToken?.kind) >= 0)) {\n everyWriteDefaulted = (parent.operatorToken.kind === SyntaxKind.EqualsToken)\n && this.goDefaultedSafeStringCall(parent.right);\n return;\n }\n if ((parent?.kind === SyntaxKind.PrefixUnaryExpression) || (parent?.kind === SyntaxKind.PostfixUnaryExpression)) {\n everyWriteDefaulted = false;\n return;\n }\n }\n n.forEachChild(visit);\n };\n scope.forEachChild(visit);\n return everyWriteDefaulted;\n }\n\n // a call to one of the hand-written SafeString-family methods that passes enough\n // arguments for the default and whose default is a literal (never the absent case)\n goDefaultedSafeStringCall(node): boolean {\n const call: any = node;\n if (call?.kind !== SyntaxKind.CallExpression) {\n return false;\n }\n const callee: any = call.expression;\n if ((callee?.kind !== SyntaxKind.PropertyAccessExpression) || (callee.expression?.kind !== SyntaxKind.ThisKeyword)) {\n return false;\n }\n const arity = GO_DEFAULTED_SAFE_STRING_ARITY[callee.name?.text];\n if ((arity === undefined) || ((call.arguments?.length ?? 0) < arity)) {\n return false;\n }\n const last: any = call.arguments[call.arguments.length - 1];\n return GO_NON_NIL_DEFAULT_KINDS.indexOf(last?.kind) >= 0;\n }\n\n // a `*string` leaf the concat may deref: the checker narrowed it to a non-nilable\n // string at that use, a local whose every write is a defaulted SafeString-family\n // call, or such a call inline\n goDerefableStringOperand(node): boolean {\n if (this.goNilProvenStringDeref(node)) {\n return true;\n }\n if (node?.kind === SyntaxKind.Identifier) {\n return this.goDefaultedSafeStringLocal(node);\n }\n return this.goDefaultedSafeStringCall(node);\n }\n\n // the printed text of a `+` operand the concat rule may use: the printer's own\n // text for a proven string, or the deref goNativeBinaryText adds for a derefable\n // `*string` leaf. undefined keeps the helper call.\n goStringConcatOperandType(node, printedText: string): string | undefined {\n if (this.goDerefableStringOperand(node)) {\n return 'string';\n }\n return (this.goOperandStaticType(node, printedText) === 'string') ? 'string' : undefined;\n }\n\n // `Add(Add(a, \"lit\"), b)` and every other `+` chain whose leaves are all non-nil\n // Go strings: the runtime Add only ever takes its string branch for those, so the\n // chain prints as the Go operator (`a + \"lit\" + b`). Anything else keeps the call.\n goNativeStringConcat(node, leftText: string, rightText: string): { goType: string, text: string } | undefined {\n if (this.goStringConcatOperandType(node.left, leftText) === undefined\n || this.goStringConcatOperandType(node.right, rightText) === undefined) {\n return undefined;\n }\n return { 'goType': 'string', 'text': this.goNativeBinaryText(node, '+', leftText, rightText) };\n }\n\n // Go static type of an operand's printed form: 'string', 'int', 'int64',\n // 'float64', or 'const-int' / 'const-float' (an untyped literal). undefined when\n // the printer cannot name it — a nilable/`any` operand keeps the helper call.\n goOperandStaticType(node, printedText: string): string | undefined {\n switch (node?.kind) {\n case SyntaxKind.StringLiteral:\n case SyntaxKind.NoSubstitutionTemplateLiteral:\n return 'string';\n case SyntaxKind.NumericLiteral:\n return /^[0-9]+$/.test(node.text) ? 'const-int' : this.goConstFloatStaticType(node);\n case SyntaxKind.ParenthesizedExpression:\n return this.goOperandStaticType(node.expression, this.goUnwrapPrintedParens(printedText));\n case SyntaxKind.BinaryExpression:\n return this.goConstantProductKind(node) ?? this.goNativeArithmeticType(node);\n case SyntaxKind.Identifier:\n return this.goLocalStaticType(node) ?? this.goInferredLocalStaticType(node) ?? this.goDeclaredParamStaticType(node);\n case SyntaxKind.PropertyAccessExpression:\n // `a.length` / `s.replace(...)` print as helper calls, `this.Id` as a field\n return this.goStringFieldStaticType(node, printedText) ?? this.goStringCallStaticType(node, printedText);\n }\n return this.goStringCallStaticType(node, printedText);\n }\n\n // the Go type the printed expression already produces; '*string' / '*int64'\n // helpers box a nilable pointer, so those keep the helper call as well\n goStringCallStaticType(node, printedText: string): string | undefined {\n // the operator needs the printed expression's *static* Go type. A helper whose\n // Go signature returns `any` (GetValue, Ternary, ...) prints an interface box even\n // when a classifier can name the value inside it — that value only becomes\n // typed through an assertion at a declaration, never inline as an operand.\n if (GO_ANY_BOX_CALLS.indexOf(this.goPrintedCallee(printedText)) >= 0) {\n return undefined;\n }\n const goType = this.goTypeOfInitializer(node, printedText);\n return ('string' === goType || 'int' === goType || 'int64' === goType || 'float64' === goType) ? goType : undefined;\n }\n\n // an untyped Go floating-point constant: the helper boxes it as float64 and the\n // compiler converts the operand to float64 the same way\n goConstFloatStaticType(node): string | undefined {\n const text = node?.text;\n if ((typeof text !== 'string') || !/^[0-9][.eE]/.test(text)) {\n return undefined;\n }\n return Number.isFinite(Number(text.replaceAll('_', ''))) ? 'const-float' : undefined;\n }\n\n isNonZeroIntegerLiteral(node): boolean {\n if (node?.kind === SyntaxKind.ParenthesizedExpression) {\n return this.isNonZeroIntegerLiteral(node.expression);\n }\n return node?.kind === SyntaxKind.NumericLiteral && /^[1-9][0-9]*$/.test(node.text);\n }\n\n isNonZeroFloatLiteral(node): boolean {\n if (node?.kind === SyntaxKind.ParenthesizedExpression) {\n return this.isNonZeroFloatLiteral(node.expression);\n }\n return (this.goConstFloatStaticType(node) !== undefined) && (Number(node.text.replaceAll('_', '')) !== 0);\n }\n\n // the exact value of a constant-only integer expression, undefined otherwise. Go folds `a * b`\n // over literals in arbitrary precision, so it must fit `int` and stay exact for the helper's\n // float64 path — the bound the caller checks.\n goConstantIntValue(node): number | undefined {\n if (node?.kind === SyntaxKind.ParenthesizedExpression) {\n return this.goConstantIntValue(node.expression);\n }\n if (node?.kind === SyntaxKind.NumericLiteral) {\n return /^[0-9]+$/.test(node.text) ? Number(node.text) : undefined;\n }\n if (node?.kind !== SyntaxKind.BinaryExpression) {\n return undefined;\n }\n const left = this.goConstantIntValue(node.left);\n const right = (left === undefined) ? undefined : this.goConstantIntValue(node.right);\n if (right === undefined) {\n return undefined;\n }\n switch (node.operatorToken.kind) {\n case SyntaxKind.PlusToken: return left + right;\n case SyntaxKind.MinusToken: return left - right;\n case SyntaxKind.AsteriskToken: return left * right;\n case SyntaxKind.SlashToken: return (right === 0) ? undefined : Math.trunc(left / right);\n case SyntaxKind.PercentToken: return (right === 0) ? undefined : left % right;\n }\n return undefined;\n }\n\n // an arithmetic expression that is the whole initializer of a printed `var x T = ...`: the\n // declared-local table owns that position (naming int64 when its int-kind proof holds, with the\n // forced unbox), so the operator rule leaves the call to it.\n goInsideTypedDeclarationInitializer(node): boolean {\n let current = node;\n while (current !== undefined) {\n const parent = current.parent;\n if (parent?.kind === SyntaxKind.ParenthesizedExpression && (parent.expression === current)) {\n current = parent;\n continue;\n }\n if (parent?.kind === SyntaxKind.BinaryExpression && ((parent.left === current) || (parent.right === current))\n && (GO_ARITHMETIC_KINDS.indexOf(parent.operatorToken.kind) >= 0)) {\n current = parent;\n continue;\n }\n break;\n }\n const declaration = current?.parent;\n if (declaration?.kind !== SyntaxKind.VariableDeclaration || declaration.initializer !== current) {\n return false;\n }\n // the printer annotates `var x T = ...` only; `x := ...` carries the\n // initializer's own type instead\n return declaration.parent?.parent?.kind === SyntaxKind.FirstStatement;\n }\n\n // The bare Go operator must yield what the runtime helper returns (go/v4/exchange_helpers.go):\n // Add keeps int/int64, while Subtract/Multiply/Divide/Mod take an exact int64 path or a float64\n // path, so only the rows below are equivalent.\n goNativeNumericResultType(op, leftType: string, rightType: string, node): string | undefined {\n const isIntKind = (kind: string) => (kind === 'int') || (kind === 'int64') || (kind === 'const-int');\n const isFloatKind = (kind: string) => (kind === 'float64') || (kind === 'const-float');\n const leftNode = node.left;\n const rightNode = node.right;\n const constKinds = ['const-int', 'const-float'];\n if ((op === SyntaxKind.AsteriskToken) && constKinds.includes(leftType) && constKinds.includes(rightType)) {\n // literal products fold as exact Go constants (may differ from the float64 helper in the last bit)\n return this.goNativeConstantProductType(node, leftType, rightType);\n }\n if (isFloatKind(leftType) !== isFloatKind(rightType)) {\n return undefined; // Go has no operator that mixes an int and a float64 operand\n }\n if (isFloatKind(leftType) && isFloatKind(rightType)) {\n // the helper's float path is float64 arithmetic; its integral result boxes\n // as int64, the same normalization Subtract/Multiply/Divide already accept.\n // A constant operand must stay exactly representable: Go folds a constant\n if (op === SyntaxKind.PercentToken) {\n return undefined; // Mod is math.Mod, no Go operator matches it\n }\n if (((leftType === 'const-float') && (rightType === 'const-float'))) {\n return undefined; // only a value the compiler folds exactly would match\n }\n if ((op === SyntaxKind.SlashToken) && !this.isNonZeroFloatLiteral(rightNode)) {\n return undefined; // Divide returns nil on a zero divisor, / gives Inf\n }\n return 'float64';\n }\n if (!isIntKind(leftType) || !isIntKind(rightType)) {\n return undefined; // string / nilable / `any` operand: the helper's nil paths stay\n }\n if ((leftType === 'int64' && rightType === 'int') || (leftType === 'int' && rightType === 'int64')) {\n return undefined; // neither operand is untyped, Go refuses to mix the kinds\n }\n if ((leftType === 'const-int') && (rightType === 'const-int')) {\n // a constant-only expression is folded in arbitrary precision by the Go\n // compiler: require a value both kinds hold exactly, so no `constant\n // overflows int` and the helper's float64 path is exact as well\n const value = this.goConstantIntValue(node);\n if ((value === undefined) || (Math.abs(value) > Number.MAX_SAFE_INTEGER)) {\n return undefined;\n }\n }\n const operands = ((leftType === 'int64') || (rightType === 'int64')) ? 'int64' : 'int';\n if (op === SyntaxKind.PlusToken) {\n // Add keeps its own int/int64 rows: its box carries the operand kind\n return operands;\n }\n if ((op === SyntaxKind.SlashToken) && this.isNonZeroIntegerLiteral(rightNode)) {\n return 'float64'; // JS division: goNativeArithmetic converts the operands to float64\n }\n if ((operands === 'int') && this.goInsideTypedDeclarationInitializer(node)) {\n // the declared-local table names this position int64 when its int-kind\n // proof holds, and the `int` an operator would yield is not that type\n return undefined;\n }\n if (op === SyntaxKind.PercentToken) {\n // Mod is math.Mod over float64: exact for integral operands, but a zero\n // divisor boxes NaN where % panics, so only a literal divisor is decidable\n return this.isNonZeroIntegerLiteral(rightNode) ? operands : undefined;\n }\n if ((op === SyntaxKind.SlashToken) && !this.isNonZeroIntegerLiteral(rightNode)) {\n return undefined; // Divide returns nil on a zero divisor, the operator panics\n }\n // int64 in, int64 out: Subtract goes through ParseInt, Multiply/Mod use reflect Int()\n return operands;\n }\n\n // a literal-only `*` chain is itself an untyped Go constant, so an enclosing product folds too\n goConstantProductKind(node): string | undefined {\n if (node?.kind === SyntaxKind.ParenthesizedExpression) {\n return this.goConstantProductKind(node.expression);\n }\n if (node?.kind === SyntaxKind.NumericLiteral) {\n return /^[0-9]+$/.test(node.text) ? 'const-int' : this.goConstFloatStaticType(node);\n }\n if ((node?.kind !== SyntaxKind.BinaryExpression) || (node.operatorToken.kind !== SyntaxKind.AsteriskToken)) {\n return undefined;\n }\n const left = this.goConstantProductKind(node.left);\n const right = (left === undefined) ? undefined : this.goConstantProductKind(node.right);\n if ((right === undefined) || (this.goNativeConstantProductType(node, left, right) === undefined)) {\n return undefined;\n }\n return ((left === 'const-float') || (right === 'const-float')) ? 'const-float' : 'const-int';\n }\n\n // `2 * 1.67` is an untyped float constant (float64); an integer chain stays an untyped int\n // constant, which a typed `var x int64 = ...` declaration converts, so it is named int64 there.\n goNativeConstantProductType(node, leftType: string, rightType: string): string | undefined {\n if ((leftType === 'const-float') || (rightType === 'const-float')) {\n return 'float64';\n }\n const value = this.goConstantIntValue(node);\n if ((value === undefined) || (Math.abs(value) > Number.MAX_SAFE_INTEGER)) {\n return undefined;\n }\n return this.goInsideTypedDeclarationInitializer(node) ? 'int64' : 'int';\n }\n\n // an operand that is itself a bare operator expression needs parens under a\n // tighter parent operator; a whole helper call is already delimited\n goNativeOperandText(node, printedText: string): string {\n const text = printedText.trim();\n if (node?.kind !== SyntaxKind.BinaryExpression || text.startsWith('(')) {\n return text;\n }\n const open = text.indexOf('(');\n if (open > 0 && this.isWholePrintedCall(text, open)) {\n return text;\n }\n // `a + b` on strings is the only shape that can never sit under a tighter\n // operator, so it is the only one left unwrapped\n return (this.goOperandStaticType(node, text) === 'string') ? text : '(' + text + ')';\n }\n\n // goNativeArithmetic's Go type for an operand (memoized within the enclosing binary print)\n goNativeArithmeticType(node): string | undefined {\n const key = `type|${this.goBinaryContextKey()}`;\n return this.goBinaryMemoized(node, key, () => this.goNativeArithmetic(node)?.goType);\n }\n\n // `Add(a, b)` & co. become the Go operator when both printed operands already\n // hold a concrete Go type the helper would return unchanged; undefined keeps the\n // helper call (nil branches, `any` boxes, strings passed to Subtract, ...).\n goNativeArithmetic(node, leftText = undefined, rightText = undefined): { goType: string, text: string } | undefined {\n const op = node.operatorToken.kind;\n if (GO_ARITHMETIC_KINDS.indexOf(op) < 0) {\n return undefined;\n }\n leftText = leftText ?? this.printNode(node.left, 0);\n rightText = rightText ?? this.printNode(node.right, 0);\n if (op === SyntaxKind.PlusToken) {\n const concat = this.goNativeStringConcat(node, leftText, rightText);\n if (concat !== undefined) {\n return concat;\n }\n }\n const pointerSubtraction = this.goNonNilPointerSubtractionText(node, leftText, rightText);\n if (pointerSubtraction !== undefined) {\n return { 'goType': 'int64', 'text': pointerSubtraction };\n }\n const pointerProduct = this.goNonNilPointerProductText(node, leftText, rightText);\n if (pointerProduct !== undefined) {\n return { 'goType': 'int64', 'text': pointerProduct };\n }\n const pointerDivision = this.goNonNilPointerDivisionText(node, leftText, rightText);\n if (pointerDivision !== undefined) {\n return { 'goType': 'float64', 'text': pointerDivision };\n }\n const leftType = this.goOperandStaticType(node.left, leftText);\n const rightType = this.goOperandStaticType(node.right, rightText);\n if (leftType === undefined || rightType === undefined) {\n return undefined;\n }\n if (leftType === 'string' || rightType === 'string') {\n if (leftType !== 'string' || rightType !== 'string' || op !== SyntaxKind.PlusToken) {\n return undefined; // the other four helpers return nil for strings\n }\n return { 'goType': 'string', 'text': this.goNativeBinaryText(node, '+', leftText, rightText) };\n }\n const goType = this.goNativeNumericResultType(op, leftType, rightType, node);\n if (goType === undefined) {\n return undefined;\n }\n const isIntKind = (kind: string) => (kind === 'int') || (kind === 'int64') || (kind === 'const-int');\n if ((op === SyntaxKind.SlashToken) && isIntKind(leftType) && isIntKind(rightType)) {\n return { goType, 'text': this.goFloatDivisionText(node, leftType, rightType, leftText, rightText) };\n }\n return { goType, 'text': this.goNativeBinaryText(node, this.SupportedKindNames[op], leftText, rightText) };\n }\n\n // `a - b` where each side is a non-nil `*int64` (dereferenced), an int64 value or an int literal and at\n // least one side is a pointer: Subtract's integral result is the same int64 box\n goNonNilPointerSubtractionText(node, leftText: string, rightText: string): string | undefined {\n if (node.operatorToken.kind !== SyntaxKind.MinusToken) {\n return undefined;\n }\n const left = this.goInt64Operand(node.left, leftText);\n const right = (left === undefined) ? undefined : this.goInt64Operand(node.right, rightText);\n if ((right === undefined) || (!left.pointer && !right.pointer)) {\n return undefined;\n }\n return left.text + ' - ' + right.text;\n }\n\n goInt64Operand(node, printedText: string): { pointer: boolean, text: string } | undefined {\n const text = this.goUnwrapPrintedParens(printedText.trim());\n if (node?.kind === SyntaxKind.ParenthesizedExpression) {\n return this.goInt64Operand(node.expression, text);\n }\n if (node?.kind === SyntaxKind.NumericLiteral) {\n return (/^[0-9]+$/.test(node.text) && (Number(node.text) <= Number.MAX_SAFE_INTEGER)) ? { 'pointer': false, text } : undefined;\n }\n if (node?.kind === SyntaxKind.Identifier) {\n if ((this.goDeclaredTypeOfIdentifier(node) === '*int64') && this.goPointerNumberIsNonNil(node)) {\n return { 'pointer': true, 'text': '*' + text };\n }\n return (this.goOperandStaticType(node, text) === 'int64') ? { 'pointer': false, text } : undefined;\n }\n if (this.goDefaultedSafeIntegerCall(node)) {\n return { 'pointer': true, 'text': '*' + text };\n }\n if ((node?.kind === SyntaxKind.CallExpression) && (this.goOperandStaticType(node, text) === 'int64')) {\n return { 'pointer': false, text };\n }\n return undefined;\n }\n\n // `a * b` over the same operands as the subtraction (or a nested int64 product): Multiply's\n // Int-kind branch returns the same wrapping int64 product\n goNonNilPointerProductText(node, leftText: string, rightText: string): string | undefined {\n if (node.operatorToken.kind !== SyntaxKind.AsteriskToken) {\n return undefined;\n }\n const left = this.goInt64ProductOperand(node.left, leftText);\n const right = (left === undefined) ? undefined : this.goInt64ProductOperand(node.right, rightText);\n if ((right === undefined) || (!left.pointer && !right.pointer)) {\n return undefined;\n }\n return left.text + ' * ' + right.text;\n }\n\n goInt64ProductOperand(node, printedText: string): { pointer: boolean, text: string } | undefined {\n let inner = node;\n while (inner?.kind === SyntaxKind.ParenthesizedExpression) {\n inner = inner.expression;\n }\n if ((inner?.kind === SyntaxKind.BinaryExpression) && (this.goNativeArithmeticType(inner) === 'int64')) {\n const text = printedText.trim();\n return { 'pointer': false, 'text': text.startsWith('(') ? text : '(' + text + ')' };\n }\n return this.goInt64Operand(node, printedText);\n }\n\n // this.safeInteger{,2,N} with an integer literal default: the Go method returns &default on every nil path\n goDefaultedSafeIntegerCall(node): boolean {\n if ((node?.kind !== SyntaxKind.CallExpression) || (node.expression?.kind !== SyntaxKind.PropertyAccessExpression)\n || (node.expression.expression?.kind !== SyntaxKind.ThisKeyword)) {\n return false;\n }\n const arity = { 'safeInteger': 3, 'safeInteger2': 4, 'safeIntegerN': 3 }[node.expression.name?.text];\n const last = node.arguments?.[arity - 1];\n return (arity !== undefined) && (node.arguments.length === arity) && (last?.kind === SyntaxKind.NumericLiteral)\n && /^[0-9]+$/.test(last.text);\n }\n\n // `x / N` on a non-nil `*int64` with a nonzero integer literal N, passed whole to Math.floor/ceil/round\n // or parseToInt: those read Divide's int64-when-integral box and the float64 quotient alike\n // (`*float64` keeps the helper: -0 and ±Inf box differently)\n goNonNilPointerDivisionText(node, leftText: string, rightText: string): string | undefined {\n if ((node.operatorToken.kind !== SyntaxKind.SlashToken) || !this.isNonZeroIntegerLiteral(node.right)) {\n return undefined;\n }\n const left = node.left;\n const declared = this.goDeclaredTypeOfIdentifier(left);\n if (declared !== '*int64') {\n return undefined;\n }\n if (!this.goPointerNumberIsNonNil(left) || !this.goDivisionConsumerIgnoresBox(node)) {\n return undefined;\n }\n return 'float64(*' + leftText.trim() + ') / ' + this.goUnwrapPrintedParens(rightText.trim());\n }\n\n // the checker narrowed the identifier to a plain number here, or an enclosing guard tests it\n goPointerNumberIsNonNil(ident): boolean {\n if (this.goHasEnclosingNilGuard(ident)) {\n return true;\n }\n const checker: any = this.checkerOrUndefined();\n if (checker === undefined) {\n return false;\n }\n const type = checker.getTypeAtLocation(ident);\n return (type !== undefined) && ((type.flags & TypeFlags.NumberLike) !== 0);\n }\n\n // the division (through parens) is the only argument of this.parseToInt or Math.floor/ceil/round\n goDivisionConsumerIgnoresBox(node): boolean {\n let child = node;\n let parent = node.parent;\n while (parent?.kind === SyntaxKind.ParenthesizedExpression) {\n child = parent;\n parent = parent.parent;\n }\n if ((parent?.kind !== SyntaxKind.CallExpression) || (parent.arguments?.length !== 1) || (parent.arguments[0] !== child)) {\n return false;\n }\n const callee = parent.expression;\n if (callee?.kind !== SyntaxKind.PropertyAccessExpression) {\n return false;\n }\n const owner = callee.expression;\n const name = callee.name?.text;\n if (owner?.kind === SyntaxKind.ThisKeyword) {\n return name === 'parseToInt';\n }\n return (owner?.kind === SyntaxKind.Identifier) && (owner.text === 'Math') && ['floor', 'ceil', 'round'].includes(name);\n }\n\n // int / int is a float64 division as in JS: typed operands convert, and with two constants\n // the left one does (an untyped constant operand then converts implicitly)\n goFloatDivisionText(node, leftType: string, rightType: string, leftText: string, rightText: string): string {\n const castLeft = (leftType !== 'const-int') || (rightType === 'const-int');\n const castRight = rightType !== 'const-int';\n const cast = (printed: string) => 'float64(' + this.goUnwrapPrintedParens(printed.trim()) + ')';\n const left = castLeft ? cast(leftText) : this.goNativeOperandText(node.left, leftText);\n const right = castRight ? cast(rightText) : this.goNativeOperandText(node.right, rightText);\n return left + ' / ' + right;\n }\n\n // the operator line gofmt prints for a natively emitted arithmetic expression: the\n // blanks follow go/printer's cutoff at the current depth, and a binary operand is\n // re-printed at the expression's own depth (a same-precedence left operand, or the\n // parentheses the printer wraps it in, which undo the one level the operand adds)\n goNativeBinaryText(node, symbol: string, leftText: string, rightText: string): string {\n const operandText = (operand, printed: string) => {\n const isBinary = operand?.kind === SyntaxKind.BinaryExpression;\n const text = isBinary ? this.goWithExprDepth(this.goExprDepth, () => this.printNode(operand, 0)) : printed;\n // a derefable `*string` leaf is the only operand that prints in a different\n // shape than the printer produced: the operator needs its pointee\n const leaf = this.goDerefableStringOperand(operand) ? ('*' + text.trim()) : text;\n return this.goNativeOperandText(operand, leaf);\n };\n const left = operandText(node.left, leftText);\n const right = operandText(node.right, rightText);\n const separator = this.goBinarySeparator(symbol, right, node.left, node.right);\n return left + separator + symbol + separator + right;\n }\n\n // `x += y` prints `x = Add(x, y)`; the compound operator is equivalent while\n // both sides hold a concrete Go type that can never make the helper return nil\n goNativeCompoundAssignment(op, leftNode, leftText: string, rightNode, rightText: string): string | undefined {\n const leftType = this.goOperandStaticType(leftNode, leftText);\n const rightType = this.goOperandStaticType(rightNode, rightText);\n if (leftType === undefined || rightType === undefined) {\n return undefined;\n }\n const isAdd = op === SyntaxKind.PlusEqualsToken;\n const isSubtract = op === SyntaxKind.MinusEqualsToken;\n if (!isAdd && !isSubtract) {\n return undefined;\n }\n const stringAdd = leftType === 'string' && isAdd && rightType === 'string';\n const int64Op = leftType === 'int64' && (rightType === 'int64' || rightType === 'const-int');\n if (!stringAdd && !int64Op) {\n return undefined;\n }\n return `${leftText.trim()} ${isAdd ? '+=' : '-='} ${rightText.trim()}`;\n }\n\n goEnclosingFunction(node) {\n let current = node?.parent;\n while (current) {\n switch (current.kind) {\n case SyntaxKind.MethodDeclaration:\n case SyntaxKind.FunctionDeclaration:\n case SyntaxKind.FunctionExpression:\n case SyntaxKind.ArrowFunction:\n case SyntaxKind.Constructor:\n case SyntaxKind.SourceFile:\n return current;\n }\n current = current.parent;\n }\n return undefined;\n }\n\n // a transpiled parameter or local can literally be named `string`, which would\n // turn `var x string = ...` into a reference to that value instead of the type\n goTypeNameIsShadowed(scope, goType: string): boolean {\n const names = goType.match(/[A-Za-z_]\\w*/g) ?? [];\n const relevant = names.filter((n) => GO_TYPE_NAMES.indexOf(n) >= 0);\n if (relevant.length === 0 || scope === undefined) {\n return false;\n }\n return this.hasNodeWhere(scope, (n: any) => {\n const isBinding = (n.kind === SyntaxKind.Parameter) || (n.kind === SyntaxKind.VariableDeclaration);\n if (isBinding && (n.name?.kind === SyntaxKind.Identifier)) {\n if (relevant.indexOf(n.name.text as string) >= 0) { return true; }\n }\n return false;\n });\n }\n\n // the shape `x.push(v)` that both the native emission and the declaration's safety\n // scan accept: the printed `x = append(x, v)` is a statement, so a value position or\n // a multi-argument/spread call still needs the helper\n goIsNativeAppendShape(receiverNode, pushNode): boolean {\n if (receiverNode?.kind !== SyntaxKind.Identifier) {\n return false;\n }\n if (pushNode?.parent?.kind !== SyntaxKind.ExpressionStatement) {\n return false;\n }\n if ((pushNode.questionDotToken !== undefined) || (pushNode.expression?.questionDotToken !== undefined)) {\n return false;\n }\n const access = pushNode.expression;\n if ((access?.kind !== SyntaxKind.PropertyAccessExpression) || (access.expression !== receiverNode)\n || (access.name?.text !== 'push')) {\n return false;\n }\n const args = pushNode.arguments;\n return (args?.length === 1) && (args[0].kind !== SyntaxKind.SpreadElement);\n }\n\n // `x.push(v)` on a local declared `[]any` prints `x = append(x, v)`; undefined keeps\n // AppendToArray(&x, v). An `any` box keeps the helper: `&x` is a *any there, while a declared\n // []any local would pass a *[]any the helper's parameter does not accept.\n goNativeAppendReceiver(pushNode): string | undefined {\n const receiver = pushNode?.expression?.expression;\n if (!this.goIsNativeAppendShape(receiver, pushNode)) {\n return undefined;\n }\n if (this.goDeclaredTypeOfIdentifier(receiver) !== '[]any') {\n return undefined;\n }\n return this.printNode(receiver, 0);\n }\n\n // reject the refinement when something downstream needs the local to stay `any`:\n // `x.push(v)` prints `AppendToArray(&x, v)` (a *T is not a *any) and a later\n // assignment of a value with another concrete type would stop compiling\n goLocalIsSafeToType(scope, declaration, varName: string, goType: string): boolean {\n if (scope === undefined) {\n return false;\n }\n const safe = !this.hasNodeWhere(scope, (n: any) => {\n if ((n.kind === SyntaxKind.Identifier) && (n.text === varName) && (n !== declaration.name)) {\n const parent = n.parent;\n if (parent?.kind === SyntaxKind.PropertyAccessExpression && parent.expression === n\n && parent.name?.text === 'push') {\n // a []any local appends natively, so its receiver may be typed; every\n // other push shape keeps the helper and with it the box\n if ((goType !== '[]any') || !this.goIsNativeAppendShape(n, parent.parent)) {\n return true;\n }\n }\n if (parent?.kind === SyntaxKind.VariableDeclaration && parent.name === n) {\n return; // a sibling block-scoped declaration; it gets its own type\n }\n if ((parent?.kind === SyntaxKind.PostfixUnaryExpression) || (parent?.kind === SyntaxKind.PrefixUnaryExpression)) {\n const op = parent.operator;\n if ((op === SyntaxKind.PlusPlusToken) || (op === SyntaxKind.MinusMinusToken)) {\n return true;\n }\n }\n if (parent?.kind === SyntaxKind.SpreadElement) {\n return true;\n }\n if (parent?.kind === SyntaxKind.ArrayLiteralExpression\n && parent.parent?.kind === SyntaxKind.BinaryExpression\n && parent.parent.left === parent\n && parent.parent.operatorToken.kind === SyntaxKind.EqualsToken\n && !((goType === 'map[string]any') && this.goGetArgTupleWriteIsDict(declaration, parent.parent.right, parent.elements.indexOf(n)))) {\n return true;\n }\n if (parent?.kind === SyntaxKind.BinaryExpression && parent.left === n) {\n const op = parent.operatorToken.kind;\n if (op === SyntaxKind.EqualsToken) {\n if ((goType === 'string') && this.goSelfConcatWriteIsString(parent.right, varName)) {\n return false;\n }\n if ((this.goTypeOfInitializer(parent.right, this.printNode(parent.right, 0)) !== goType)\n && !((declaration.kind === SyntaxKind.VariableDeclaration) && this.goPointerWriteConversion(parent.right, goType) !== undefined)) {\n return true;\n }\n } else if ((op === SyntaxKind.PlusEqualsToken) && (goType === 'string')\n && (this.goOperandStaticType(parent.right, this.printNode(parent.right, 0)) === 'string')) {\n return false;\n } else if ((op >= SyntaxKind.FirstCompoundAssignment) && (op <= SyntaxKind.LastCompoundAssignment)) {\n return true;\n }\n }\n }\n return false;\n });\n return safe;\n }\n\n // `x = <+ chain>` that reads x itself: only a whole chain prints native (a bare\n // derefable leaf would be assigned as the *string it is)\n goSelfConcatWriteIsString(node, varName: string): boolean {\n while (node?.kind === SyntaxKind.ParenthesizedExpression) {\n node = node.expression;\n }\n if ((node?.kind !== SyntaxKind.BinaryExpression) || (node.operatorToken.kind !== SyntaxKind.PlusToken)) {\n return false;\n }\n const readsSelf = this.hasNodeWhere(node, (n: any) => (n.kind === SyntaxKind.Identifier) && (n.text === varName));\n return readsSelf && this.goSelfConcatIsString(node, varName);\n }\n\n // a `+` chain written back into a `string` local (`x = x + \"&\" + y`, `x += y`): every leaf is\n // the local itself (a Go string by the typing being proven) or a proven non-nil Go string,\n // so the chain prints native and the local only ever holds a string\n goSelfConcatIsString(node, varName: string): boolean {\n while (node?.kind === SyntaxKind.ParenthesizedExpression) {\n node = node.expression;\n }\n if ((node?.kind === SyntaxKind.Identifier) && (node.text === varName)) {\n return true;\n }\n if ((node?.kind === SyntaxKind.BinaryExpression) && (node.operatorToken.kind === SyntaxKind.PlusToken)) {\n return this.goSelfConcatIsString(node.left, varName) && this.goSelfConcatIsString(node.right, varName);\n }\n if (this.hasNodeWhere(node, (n: any) => (n.kind === SyntaxKind.Identifier) && (n.text === varName))) {\n return false;\n }\n const cache = this.goSelfConcatLeafCache;\n if (cache.has(node)) {\n return cache.get(node);\n }\n // an answer computed while another local is being resolved may be the guard's `any`\n const settled = (this.goLocalTypeResolution.size === 0);\n const result = this.goStringConcatOperandType(node, this.printNode(node, 0)) === 'string';\n if (settled) {\n cache.set(node, result);\n }\n return result;\n }\n\n // How a write of another shape reaches a pointer-typed local: 'nil' (undefined/null prints nil),\n // 'wrap' (a Go string becomes SafeStringPtr(v), never nil), or undefined (not convertible).\n // Shared by goLocalIsSafeToType (admission) and goPointerWriteText (emission).\n goPointerWriteConversion(right, goType: string): 'nil' | 'wrap' | undefined {\n while (right?.kind === SyntaxKind.ParenthesizedExpression) {\n right = right.expression;\n }\n if (!['*string', '*int64', '*float64'].includes(goType) || right === undefined) {\n return undefined;\n }\n if ((right.kind === SyntaxKind.NullKeyword) || (right.kind === SyntaxKind.UndefinedKeyword)\n || ((right.kind === SyntaxKind.Identifier) && (right.text === 'undefined'))) {\n return 'nil';\n }\n if ((goType === '*string') && (this.goTypeOfInitializer(right, this.printNode(right, 0)) === 'string')) {\n return 'wrap';\n }\n return undefined;\n }\n\n // `x = \"limit\"` on a *string local prints `x = SafeStringPtr(\"limit\")`; undefined otherwise\n goPointerWriteText(node, identation): string | undefined {\n const { left, right } = node;\n if (left?.kind !== SyntaxKind.Identifier) {\n return undefined;\n }\n const decl: any = this.checkerOrUndefined()?.getSymbolAtLocation(left)?.valueDeclaration?.resolve();\n if (decl?.kind !== SyntaxKind.VariableDeclaration) {\n return undefined;\n }\n const goType = this.goDeclaredTypeOfIdentifier(left);\n if ((goType === undefined) || (this.goPointerWriteConversion(right, goType) !== 'wrap')) {\n return undefined;\n }\n const value = this.goWithExprDepth(this.goExprDepth + 1, () => this.printNode(right, identation)).trim();\n return `${this.printNode(left, 0)} = SafeStringPtr(${value})`;\n }\n\n // the container/key argument nodes of a whole `this.SafeDict(container, key)` call, or undefined\n // for another shape. A third argument is droppable only when it is the empty map literal\n // (`safeDict(x, k, {})`), which no whitelisted read could observe.\n goSafeDictLocalArgs(initializer) {\n return this.goSafeAccessorLocalArgs(initializer, 'safeDict', SyntaxKind.ObjectLiteralExpression, 'properties');\n }\n\n // shared by the dict/list rules: `this.(container, key[, ])`\n goSafeAccessorLocalArgs(initializer, accessor: string, fallbackKind: SyntaxKind, fallbackItems: string) {\n if (initializer?.kind !== SyntaxKind.CallExpression) {\n return undefined;\n }\n const callee: any = initializer.expression;\n if (callee?.kind !== SyntaxKind.PropertyAccessExpression || callee.name?.text !== accessor) {\n return undefined;\n }\n if (callee.expression?.kind !== SyntaxKind.ThisKeyword) {\n return undefined;\n }\n const args = initializer.arguments;\n if (args.length === 3) {\n const fallback = args[2];\n if (fallback?.kind !== fallbackKind || fallback[fallbackItems].length !== 0) {\n return undefined;\n }\n } else if (args.length !== 2) {\n return undefined;\n }\n return { container: args[0], key: args[1] };\n }\n\n // one later use of a dict local: it must read the value as a dictionary, never hand the\n // box out. Only the receiver position of the deref-aware read helpers, the `this.Safe*`\n // accessors and a plain `x[k]` element read qualify.\n goSafeDictUseReadsTheMap(node): boolean {\n const parent: any = node.parent;\n if (parent === undefined) {\n return false;\n }\n switch (parent.kind) {\n case SyntaxKind.ElementAccessExpression: {\n if (parent.expression !== node) {\n return false; // x as an index key\n }\n const grandparent: any = parent.parent;\n if (grandparent?.kind === SyntaxKind.BinaryExpression && grandparent.left === parent) {\n return false; // `x[k] = v` / `x[k] += v` writes into the map\n }\n if ((grandparent?.kind === SyntaxKind.PostfixUnaryExpression) || (grandparent?.kind === SyntaxKind.PrefixUnaryExpression)) {\n return false; // `x[k]++` / `&x[k]`\n }\n if (grandparent?.kind === SyntaxKind.DeleteExpression) {\n return false;\n }\n return true;\n }\n case SyntaxKind.BinaryExpression: {\n // `key in x` prints `InOp(x, key)`: the helper reads the map and answers false for\n // an absent (nil) map, exactly like the nil interface it used to hold\n return (parent.operatorToken?.kind === SyntaxKind.InKeyword) && (parent.right === node);\n }\n case SyntaxKind.CallExpression: {\n if (parent.expression === node) {\n return false; // the local called as a function\n }\n if (parent.arguments.indexOf(node) !== 0) {\n return false; // value position: the box escapes\n }\n const callee = this.goPrintedCallee(this.printNode(parent, 0));\n if (callee === undefined) {\n return false;\n }\n if (GO_SAFE_DICT_READ_HELPERS.indexOf(callee) >= 0) {\n return true;\n }\n return /^(?:this\\.)?Safe[A-Z]/.test(callee) || (callee === 'this.IsDictionary');\n }\n default:\n return false;\n }\n }\n\n // `var x any = this.SafeDict(container, key)` -> `var x map[string]any = SafeMapTyped(...)`:\n // same member read, and every later use reads the local; with the absent case a nil map,\n // GetValue/InOp/ObjectKeys/IsDictionary and Safe* normalise a nil receiver. Else keep the box.\n goSafeDictLocalUnboxCache = new Map();\n\n // memoised, re-entrancy-guarded typing of a `var x T = …` declaration statement; a for-init\n // or any other shape prints `:=`, where the annotation would not appear\n goCachedLocalUnbox(cache: Map, declaration, compute: () => string | undefined): string | undefined {\n if (declaration?.kind !== SyntaxKind.VariableDeclaration || declaration.name?.kind !== SyntaxKind.Identifier) {\n return undefined;\n }\n if (declaration.parent?.parent?.kind !== SyntaxKind.FirstStatement) {\n return undefined;\n }\n if (cache.has(declaration)) {\n return cache.get(declaration);\n }\n cache.set(declaration, undefined); // in-progress guard\n let result: string | undefined;\n try {\n result = compute();\n } finally {\n cache.set(declaration, result);\n }\n return result;\n }\n\n goSafeDictLocalUnbox(declaration): string | undefined {\n return this.goCachedLocalUnbox(this.goSafeDictLocalUnboxCache, declaration, () => this.goSafeDictLocalUnboxUncached(declaration));\n }\n\n // every read of `declaration`'s name inside its function must keep the boxed value's meaning for\n // the local to take a named Go type: a rebinding mixes two values, and a use `readsTheValue`\n // rejects re-boxes the local. `skipUse` drops nodes that are not references at all.\n goDeclaredLocalTypeIfSafe(declaration, goType: string, readsTheValue: (n: any) => boolean, skipUse?: (n: any) => boolean): string | undefined {\n const sourceName = declaration.name.text as string;\n const scope: any = this.goEnclosingFunction(declaration);\n if (scope === undefined) {\n return undefined;\n }\n const unsafe = this.hasNodeWhere(scope, (n: any) => {\n if ((n.kind === SyntaxKind.VariableDeclaration || n.kind === SyntaxKind.Parameter)\n && (n !== declaration) && (n.name?.kind === SyntaxKind.Identifier) && (n.name.text === sourceName)) {\n return true; // a shadowing binding would mix two values under one name\n }\n if ((n.kind !== SyntaxKind.Identifier) || (n.text !== sourceName) || (n === declaration.name)) {\n return false;\n }\n return (skipUse !== undefined && skipUse(n)) ? false : !readsTheValue(n);\n });\n if (unsafe || this.goTypeNameIsShadowed(scope, goType)) {\n return undefined;\n }\n return goType;\n }\n\n goSafeDictLocalUnboxUncached(declaration): string | undefined {\n if (this.goSafeDictLocalArgs(declaration.initializer) === undefined) {\n return undefined;\n }\n return this.goDeclaredLocalTypeIfSafe(declaration, GO_SAFE_DICT_LOCAL_TYPE, (n) => this.goSafeDictUseReadsTheMap(n));\n }\n\n // the initializer a typed dict local is declared with: the accessor call is replaced by the\n // typed reader, which reads the same member (and converts a sync.Map) but names the result\n goSafeDictUnboxValue(declaration, identation: number): string | undefined {\n if (this.goSafeDictLocalUnbox(declaration) !== GO_SAFE_DICT_LOCAL_TYPE) {\n return undefined;\n }\n const args: any = this.goSafeDictLocalArgs(declaration.initializer);\n const container = this.printNode(args.container, identation);\n const key = this.printNode(args.key, 0);\n return `SafeMapTyped(${container}, ${key})`;\n }\n\n // the TypeScript return type proves the boxed value is the market dictionary: the checker reports\n // the `MarketInterface` interface for `this.Market(...)` / `this.SafeMarket(...)` (the `Market`\n // alias is the same interface unioned with undefined). Read from the checker, never a printed name.\n goMarketCallReturnsDict(initializer): boolean {\n if (initializer?.kind !== SyntaxKind.CallExpression) {\n return false;\n }\n const callee: any = initializer.expression;\n if (callee?.kind !== SyntaxKind.PropertyAccessExpression) {\n return false;\n }\n const name = callee.name?.text;\n if (name === undefined) {\n return false;\n }\n const receiver: any = callee.expression;\n const onThis = receiver?.kind === SyntaxKind.ThisKeyword;\n const onDerived = (receiver?.kind === SyntaxKind.PropertyAccessExpression)\n && (receiver.expression?.kind === SyntaxKind.ThisKeyword)\n && (receiver.name?.text === 'DerivedExchange');\n if (!onThis && !onDerived) {\n return false;\n }\n const checker: any = this.checkerOrUndefined();\n if (checker === undefined) {\n return false;\n }\n const type = checker.getTypeAtLocation(initializer);\n if (type === undefined) {\n return false;\n }\n const isMarketInterface = (t) => {\n const names = [ t?.getSymbol()?.name, t?.getAliasSymbol()?.name ];\n return (names.indexOf('MarketInterface') >= 0) || (names.indexOf('CurrencyInterface') >= 0);\n };\n if (isMarketInterface(type)) {\n return true;\n }\n if ((typeof type.isUnionType === 'function') && type.isUnionType()) {\n return type.getTypes().some((t) => isMarketInterface(t));\n }\n return false;\n }\n\n // `var market any = this.Market(symbol)` -> `var market map[string]any = MapTyped(...)`.\n // The box holds the dictionary the checker proved and every later use reads it (SafeDict's scan),\n // so this is a pure refinement. A value position, nil test or map write keeps the box.\n goMarketLocalUnboxCache = new Map();\n\n goMarketLocalUnbox(declaration): string | undefined {\n return this.goCachedLocalUnbox(this.goMarketLocalUnboxCache, declaration, () => this.goMarketLocalUnboxUncached(declaration));\n }\n\n // true when this identifier resolves to the declaration being typed (a property name or a\n // binding of the same name in another scope is not a use of the local). Without checker\n // information the name match stands.\n goIdentifierRefersToDeclaration(node, declaration): boolean {\n const checker: any = this.checkerOrUndefined();\n if (checker === undefined) {\n return true;\n }\n const symbol = checker.getSymbolAtLocation(node);\n if (symbol === undefined) {\n return true;\n }\n const valueDeclaration = symbol.valueDeclaration?.resolve() ?? symbol.declarations?.map((d) => d.resolve())?.[0];\n return (valueDeclaration === undefined) || (valueDeclaration === declaration);\n }\n\n // one later use of the market local: the dictionary read shapes SafeDict proves (element read,\n // `in`, read-helper argument), plus — only when the accessor throws rather than answers absent —\n // a plain argument position, since Go re-boxes the map into the callee's `any` as the box did.\n goMarketUseReadsTheValue(node, throwingAccessor: boolean): boolean {\n if (this.goSafeDictUseReadsTheMap(node)) {\n return true;\n }\n const parent: any = node.parent;\n if ((parent?.kind === SyntaxKind.ElementAccessExpression) && (parent.expression === node) && this.goIsComparedOperand(parent)) {\n return true;\n }\n if (!throwingAccessor) {\n return false;\n }\n return (parent?.kind === SyntaxKind.CallExpression)\n && (parent.expression !== node) && (parent.arguments.indexOf(node) >= 0);\n }\n\n goMarketLocalUnboxUncached(declaration): string | undefined {\n if (!this.goMarketCallReturnsDict(declaration.initializer)) {\n return undefined;\n }\n // the throwing accessors (`this.market`, `this.currency`) panic instead of answering absent, so\n // the boxed result is always a dictionary and passing the local re-boxes the same map into the\n // callee's `any`. The Safe* accessors may answer their own optional argument: read shapes only.\n const accessorName = declaration.initializer.expression?.name?.text;\n const throwingAccessor = (accessorName === 'market') || (accessorName === 'currency');\n // `this.market(…)` carries the same name as the local: a property/method name is not\n // a reference, and neither is a different binding of the same name\n return this.goDeclaredLocalTypeIfSafe(declaration, GO_MARKET_LOCAL_TYPE,\n (n) => this.goMarketUseReadsTheValue(n, throwingAccessor),\n (n) => ((n.parent?.kind === SyntaxKind.PropertyAccessExpression) && (n.parent.name === n))\n || !this.goIdentifierRefersToDeclaration(n, declaration));\n }\n\n // the initializer a typed market local is declared with: the same call, its boxed result\n // converted to the map the checker proved (nil when the call answered a non-map)\n goMarketUnboxValue(declaration, parsedValue: string): string | undefined {\n if (this.goMarketLocalUnbox(declaration) !== GO_MARKET_LOCAL_TYPE) {\n return undefined;\n }\n return `MapTyped(${parsedValue.trimStart()})`;\n }\n\n // the variable declaration an identifier binds to, through the checker (undefined for every\n // other shape) — the market rule resolves its own locals this way, never by printed name\n goDeclarationOfIdentifier(node): any {\n try {\n const symbol = this.getChecker().getSymbolAtLocation(node);\n const declaration = symbol?.valueDeclaration?.resolve() ?? symbol?.declarations?.map((d) => d.resolve())?.[0];\n if (declaration?.kind === SyntaxKind.VariableDeclaration) {\n return declaration;\n }\n } catch (e) {\n return undefined;\n }\n return undefined;\n }\n\n // a compared element of a market/currency local keeps the GetValue helper: its deref is what\n // the boxed local's read used to apply, and a parseMarket may have stored a `*bool`/`*string`\n // under the key. Only the operands the use scan admits this way are affected; every other\n goMarketComparisonElementRead(node): boolean {\n const base: any = node?.expression;\n if (base?.kind !== SyntaxKind.Identifier) {\n return false;\n }\n const declaration = this.goDeclarationOfIdentifier(base);\n if ((declaration === undefined) || (this.goMarketLocalUnbox(declaration) !== GO_MARKET_LOCAL_TYPE)) {\n return false;\n }\n return this.goIsComparedOperand(node);\n }\n\n // `node`, through any parentheses, is an operand of a GO_MARKET_READ_COMPARISON_OPERATORS comparison\n goIsComparedOperand(node): boolean {\n let operand: any = node;\n let above: any = node.parent;\n while (above?.kind === SyntaxKind.ParenthesizedExpression) {\n operand = above;\n above = above.parent;\n }\n return (above?.kind === SyntaxKind.BinaryExpression)\n && ((above.left === operand) || (above.right === operand))\n && (GO_MARKET_READ_COMPARISON_OPERATORS.indexOf(above.operatorToken?.kind) >= 0);\n }\n\n // the container/key argument nodes of a whole `this.SafeList(container, key)` call, or\n // undefined when the initializer is another shape. A third argument is only droppable when\n // it is the empty array literal the TS call sites pass (`safeList(x, k, [])`): the typed\n goSafeListLocalArgs(initializer) {\n return this.goSafeAccessorLocalArgs(initializer, 'safeList', SyntaxKind.ArrayLiteralExpression, 'elements');\n }\n\n // one later use of a list local: it must read the value as a list, never hand the box out.\n // A length read, an element read and the statement-shaped push all answer for a []any what\n // the accessors answered for the box; every other use keeps the box.\n goSafeListUseReadsTheList(node): boolean {\n const parent: any = node.parent;\n if (parent === undefined) {\n return false;\n }\n switch (parent.kind) {\n case SyntaxKind.PropertyAccessExpression: {\n if (parent.expression !== node) {\n return false; // the local as the receiver of a further member\n }\n if (parent.name?.text === 'length') {\n return true; // prints GetArrayLength(x)\n }\n // `x.push(v)` prints `x = append(x, v)` only in the statement shape; every other\n // push keeps AppendToArray(&x, …), whose *any parameter a []any local cannot take\n return (parent.name?.text === 'push') && this.goIsNativeAppendShape(node, parent.parent);\n }\n case SyntaxKind.ElementAccessExpression: {\n if (parent.expression !== node) {\n return false; // the local as the index\n }\n return !this.isGoElementAccessAssignmentTarget(parent); // `x[k] = v` writes through the box\n }\n case SyntaxKind.CallExpression: {\n if (parent.expression === node) {\n return false; // the local called as a function\n }\n if (parent.arguments.indexOf(node) !== 0) {\n return false; // value position: the box escapes\n }\n const callee = this.goPrintedCallee(this.printNode(parent, 0));\n // both accessors read a []any receiver with the very answer they gave the box\n return (callee === 'GetValue') || (callee === 'GetArrayLength');\n }\n default:\n return false;\n }\n }\n\n // `var x any = this.SafeList(container, key)` -> `var x []any = SafeListTyped(container, key)`.\n // SafeListTyped reads the same member and every later use reads it as a list: a nil slice counts\n // 0 and indexes to nil, matching the box's absent case. Anything else keeps the box.\n goSafeListLocalUnboxCache = new Map();\n\n goSafeListLocalUnbox(declaration): string | undefined {\n return this.goCachedLocalUnbox(this.goSafeListLocalUnboxCache, declaration, () => this.goSafeListLocalUnboxUncached(declaration));\n }\n\n goSafeListLocalUnboxUncached(declaration): string | undefined {\n if (this.goSafeListLocalArgs(declaration.initializer) === undefined) {\n return undefined;\n }\n return this.goDeclaredLocalTypeIfSafe(declaration, GO_SAFE_LIST_LOCAL_TYPE, (n) => this.goSafeListUseReadsTheList(n));\n }\n\n // the initializer a typed list local is declared with: the accessor call is replaced by the\n // typed reader, which reads the same member but names the result\n goSafeListUnboxValue(declaration, identation: number): string | undefined {\n if (this.goSafeListLocalUnbox(declaration) !== GO_SAFE_LIST_LOCAL_TYPE) {\n return undefined;\n }\n const args: any = this.goSafeListLocalArgs(declaration.initializer);\n const container = this.printNode(args.container, identation);\n const key = this.printNode(args.key, 0);\n return `SafeListTyped(${container}, ${key})`;\n }\n\n getGoLocalType(declaration, parsedValue: string): string {\n const goType = this.goTypeOfInitializer(declaration.initializer, parsedValue);\n if (goType === undefined) {\n return this.goSafeDictLocalUnbox(declaration) ?? this.goSafeListLocalUnbox(declaration) ?? this.goMarketLocalUnbox(declaration) ?? 'any';\n }\n // the scan matches AST identifiers, so it needs the source name, not the\n // printed one (`type` is renamed to `typeVar` on the way out)\n const sourceName = declaration.name?.text;\n if (sourceName === undefined) {\n return 'any';\n }\n const scope = this.goEnclosingFunction(declaration);\n // outside any nested resolution the verdict depends only on (declaration, goType)\n const stable = (this.goLocalTypeResolution.size <= 1) && (this.goDeclaredTypeInProgress.size === 0);\n const memoKey = goType;\n let perDecl = stable ? this.goLocalSafeVerdicts.get(declaration) : undefined;\n if (perDecl !== undefined && perDecl.has(memoKey)) {\n return perDecl.get(memoKey);\n }\n const result = (this.goTypeNameIsShadowed(scope, goType) || !this.goLocalIsSafeToType(scope, declaration, sourceName, goType)) ? 'any' : goType;\n if (stable) {\n if (perDecl === undefined) {\n perDecl = new Map();\n this.goLocalSafeVerdicts.set(declaration, perDecl);\n }\n perDecl.set(memoKey, result);\n }\n return result;\n }\n goLocalSafeVerdicts = new WeakMap>();\n\n // Typed async receive: an extension that knows the core's channel element type replaces\n // `x := (<-this.FooAsync(..))` + `PanicOnError(x)` with a typed declaration that runs PanicOnError\n // first (same frame and message). The default returns undefined and changes nothing.\n goAwaitReceiveUnbox(awaitNode, printedInitializer: string): { goType: string, wrap: (recv: string) => string } | undefined {\n return undefined;\n }\n\n printVariableDeclarationList(node,identation) {\n const declaration = node.declarations[0];\n // const varToken = this.VAR_TOKEN ? this.VAR_TOKEN + \" \": \"\";\n // const name = declaration.name.text;\n\n if (declaration?.name.kind === SyntaxKind.ArrayBindingPattern) {\n const arrayBindingPattern = declaration.name;\n const arrayBindingPatternElements = arrayBindingPattern.elements;\n const parsedArrayBindingElements = arrayBindingPatternElements.map((e) => this.printNode(e.name, 0));\n const syntheticName = parsedArrayBindingElements.join(\"\") + \"Variable\";\n\n // gofmt drops every redundant statement terminator: Go statements are\n // newline-separated, so the joins below must not emit ';'\n let arrayBindingStatement = `${this.getIden(identation)}${syntheticName} := ${this.printNode(declaration.initializer, 0)}\\n`;\n\n arrayBindingStatement += parsedArrayBindingElements\n .map((e, index) => this.getIden(identation) + `${e} := GetValue(${syntheticName}, ${index})`).join(\"\\n\");\n\n return arrayBindingStatement;\n }\n\n if (declaration?.initializer?.kind=== SyntaxKind.AwaitExpression) {\n const parsedName = this.printNode(declaration.name, 0);\n // the awaited call can carry a multi-line literal argument: printing it at the\n // declaration's own level keeps that literal one level deeper\n const parsedInitializer = this.printNode(declaration.initializer, identation);\n const awaitUnbox = this.goAwaitReceiveUnbox(declaration.initializer, parsedInitializer);\n if (awaitUnbox !== undefined) {\n // the conversion runs PanicOnError first (inside the bracket), so the panic\n // path keeps the same caller, message and stack as the boxed pair below\n return `\n${this.getIden(identation)}var ${parsedName} ${awaitUnbox.goType} = ${awaitUnbox.wrap(parsedInitializer)}`;\n }\n return `\n${this.getIden(identation)}${parsedName} := ${parsedInitializer}\n${this.getIden(identation)}PanicOnError(${parsedName})`;\n\n }\n\n const isNew = declaration.initializer && (declaration.initializer.kind === SyntaxKind.NewExpression);\n\n const parsedValue = (declaration.initializer) ? this.printNode(declaration.initializer, identation) : this.NULL_TOKEN;\n\n if (parsedValue === this.UNDEFINED_TOKEN) {\n return this.getIden(identation) + \"var \" + this.printNode(declaration.name) + \" any = \" + parsedValue;\n }\n\n if (node?.parent?.kind === SyntaxKind.FirstStatement) {\n if (isNew) {\n return this.getIden(identation) + this.printNode(declaration.name) + \" := \" + parsedValue;\n }\n const varName = this.printNode(declaration.name);\n const declaredType = this.getGoLocalType(declaration, parsedValue);\n // a typed dict/list local is declared with the typed reader rather than the `any`\n // accessor, so the declaration compiles against the map/slice type\n const unboxValue = this.goMarketUnboxValue(declaration, parsedValue)\n ?? ((declaredType === GO_SAFE_DICT_LOCAL_TYPE)\n ? this.goSafeDictUnboxValue(declaration, identation)\n : ((declaredType === GO_SAFE_LIST_LOCAL_TYPE) ? this.goSafeListUnboxValue(declaration, identation) : undefined));\n const declaredValue = (unboxValue !== undefined) ? unboxValue : parsedValue.trimStart();\n // an initializer printed at the declaration's own level (parenthesized expression,\n // helper call) carries that indentation; gofmt puts one space after `=`\n const stm = this.getIden(identation) + \"var \" + varName + \" \" + declaredType + \" = \" + declaredValue;\n if (parsedValue.startsWith(\"<-this.callInternal(\")) {\n return `\n${stm}\n${this.getIden(identation)}PanicOnError(${varName})`;\n }\n return stm;\n }\n\n return this.getIden(identation) + this.printNode(declaration.name) + \" := \" + parsedValue.trim();\n }\n\n // printObjectLiteralExpression(node, identation) {\n // const objectCreation = 'make(map[string]any) {';\n // let formattedObjectBody = '{}';\n // if (node.properties?.length > 0) {\n // const objectBody = this.printObjectLiteralBody(node, identation);\n // formattedObjectBody = objectBody ? \"\\n\" + objectBody + \"\\n\" + this.getIden(identation) : objectBody;\n // }\n // // return this.OBJECT_OPENING + formattedObjectBody + this.OBJECT_CLOSING;\n // return objectCreation + formattedObjectBody;\n // }\n\n // printObjectLiteralBody(node, identation) {\n // let objectName = node.parent?.name?.text;\n // if (objectName === undefined) {\n // objectName = \"object\";\n // }\n // const body = node.properties.map((p) => `${this.getIden(identation)}${objectName}[\"${node.properties[0].name.text}\"] = ${p.initializer.text}` ).join(\"\\n\");\n // return body;\n // }\n\n // F09 — gofmt aligns the key/value columns inside multi-line composite literals.\n //\n // go/printer's exprList prints a single-line `key: value` entry as `key:` + vtab, so\n // every consecutive single-line entry of a literal body lands in one text/tabwriter\n // column block: the value starts after the widest key cell of that block (`\"key\":`,\n // the key plus its colon) and one space of padding. An entry whose value spans lines\n // carries no vtab cell, so it ends the block on both sides, exactly like a blank line\n // does. exprList also writes a formfeed — turned into a plain newline by the trimmer,\n // so it never shows up in the output — before an entry that opens a new alignment\n // section: that happens when the entry or its predecessor does not fit on a single\n // line, and when the key size ratio against the geometric mean of the previous key\n // sizes of the section reaches r = 2.5 (or drops to 1/r) while at least one of the\n // two keys is larger than smallSize = 40 bytes; keys of at most 40 bytes always keep\n // the section aligned. A trailing comment is one more tabwriter cell, so comments\n // line up after the widest `value,` cell of the run of consecutive commented entries.\n printObjectLiteralBody(node, identation) {\n // composite literal elements are printed at depth 1 again (go/printer exprList(..., 1, ...));\n // a literal nested in an entry's value is laid out relative to that entry\n const previousLevel = this.goStatementLevel;\n this.goStatementLevel = identation + 1;\n try {\n const entries = node.properties.map((p) => this.goWithExprDepth(1, () => this.printNode(p, identation + 1)));\n return this.alignGoCompositeEntries(entries).join(\"\\n\");\n } finally {\n this.goStatementLevel = previousLevel;\n }\n }\n\n // Applies the gofmt column alignment to already-printed `key: value` entries (the\n // entries must not carry the separating comma). Reused by the hand-written composite\n // literals in ccxt's build/goTranspiler.ts, which do not go through this printer.\n alignGoCompositeEntries(entries) {\n const parsedEntries = entries.map((entry) => this.parseGoCompositeEntry(entry));\n const paddings = this.getGoCompositePaddings(parsedEntries);\n return entries.map((entry, index) => this.renderGoCompositeEntry(entry, parsedEntries[index], paddings[index]));\n }\n\n // ` \"key\": value, // comment` -> the pieces gofmt's tabwriter aligns.\n // Returns undefined for anything that is not a plain `key: value` entry (a spread, a\n // method, a computed key): the caller then leaves that entry alone and ends the block.\n parseGoCompositeEntry(entry) {\n const newlineIndex = entry.indexOf(\"\\n\");\n const firstLine = newlineIndex === -1 ? entry : entry.slice(0, newlineIndex);\n const keyMatch = /^([ \\t]*)(\"(?:[^\"\\\\]|\\\\.)*\"): /.exec(firstLine);\n if (keyMatch === null) {\n return undefined;\n }\n const singleLine = newlineIndex === -1;\n // for a multi-line entry only the trailing comment of its last line matters here\n const tail = singleLine ? entry.slice(keyMatch[0].length) : entry.slice(entry.lastIndexOf(\"\\n\") + 1);\n const commentIndex = this.findGoTrailingCommentStart(tail);\n return {\n 'indent': keyMatch[1],\n 'key': keyMatch[2],\n // nodeSize() measures the printed key; a value that spans lines gets size 0\n 'size': singleLine ? this.getGoByteLength(keyMatch[2]) : 0,\n 'singleLine': singleLine,\n 'value': singleLine ? (commentIndex === -1 ? tail : tail.slice(0, commentIndex)).trimEnd() : undefined,\n 'comment': commentIndex === -1 ? undefined : tail.slice(commentIndex).trimEnd(),\n };\n }\n\n // Index of the trailing comment of a printed line, or -1. `//` or `/*` inside a string\n // or a rune literal (e.g. a \"https://…\" value) is not a comment.\n findGoTrailingCommentStart(line) {\n let quote;\n for (let index = 0; index < line.length; ++index) {\n const character = line[index];\n if (quote !== undefined) {\n if (character === \"\\\\\" && quote !== \"`\") {\n index += 1;\n } else if (character === quote) {\n quote = undefined;\n }\n continue;\n }\n if (character === \"\\\"\" || character === \"`\" || character === \"'\") {\n quote = character;\n } else if (character === \"/\" && (line[index + 1] === \"/\" || line[index + 1] === \"*\")) {\n return index;\n }\n }\n return -1;\n }\n\n // {key, comment} space counts per entry, i.e. the padding gofmt's tabwriter inserts.\n // Only entries that are part of a block get a padding; every other entry is rendered\n // as printed (gofmt leaves single-line and multi-line sections untouched).\n getGoCompositePaddings(parsedEntries) {\n // the sectioning below mirrors go/printer's exprList\n const smallSize = 40;\n const ratio = 2.5;\n const paddings = parsedEntries.map(() => undefined);\n let block = [];\n let previousSize = 0;\n let size = 0;\n let lnSum = 0;\n let count = 0;\n const flushBlock = () => {\n if (block.length === 0) {\n return;\n }\n let keyWidth = 1; // widest key cell of the block + one space of padding\n for (const index of block) {\n keyWidth = Math.max(keyWidth, this.getGoRuneLength(parsedEntries[index].key) + 2);\n }\n for (const index of block) {\n paddings[index] = { 'key': keyWidth - this.getGoRuneLength(parsedEntries[index].key) - 1, 'comment': 1 };\n }\n // the comment column only spans the runs of consecutive commented entries\n let run = [];\n const flushRun = () => {\n if (run.length === 0) {\n return;\n }\n let runWidth = 1; // widest `value,` cell of the run + one space of padding\n for (const index of run) {\n runWidth = Math.max(runWidth, this.getGoRuneLength(parsedEntries[index].value) + 2);\n }\n for (const index of run) {\n paddings[index].comment = runWidth - this.getGoRuneLength(parsedEntries[index].value) - 1;\n }\n run = [];\n };\n for (const index of block) {\n if (parsedEntries[index].comment !== undefined) {\n run.push(index);\n } else {\n flushRun();\n }\n }\n flushRun();\n block = [];\n };\n for (let index = 0; index < parsedEntries.length; ++index) {\n const entry = parsedEntries[index];\n previousSize = size;\n size = entry !== undefined ? entry.size : 0;\n let sectionBreak = true; // exprList's useFF\n if (previousSize > 0 && size > 0) {\n if (count === 0 || (previousSize <= smallSize && size <= smallSize)) {\n sectionBreak = false;\n } else {\n const geomean = this.goExp2ish(lnSum / count);\n const sizeRatio = size / geomean;\n sectionBreak = ratio * sizeRatio <= 1 || ratio <= sizeRatio;\n }\n }\n const alignable = entry !== undefined && entry.singleLine;\n if (index > 0 && sectionBreak) {\n // exprList resets the geometric mean accumulation whenever it starts a\n // new section (a formfeed break is two line breaks, nbreaks > 1), so the\n // ratio below is measured against the current section only\n lnSum = 0;\n count = 0;\n }\n if (!alignable || sectionBreak) {\n flushBlock();\n }\n if (alignable) {\n block.push(index);\n }\n if (size > 0) {\n lnSum += this.goLog2ish(size);\n count += 1;\n }\n }\n flushBlock();\n return paddings;\n }\n\n // go/printer's crude log2/exp2 (math.go log2ish/exp2ish): the geomean must match it bit for\n // bit, a ratio landing on exactly 2.5 decides the section break\n goLog2ish(x: number): number {\n let exponent = x === 0 ? 0 : Math.floor(Math.log2(x)) + 1;\n let fraction = x / Math.pow(2, exponent);\n if (fraction >= 1) { fraction /= 2; exponent += 1; }\n if (fraction < 0.5 && fraction !== 0) { fraction *= 2; exponent -= 1; }\n return exponent + 2 * (fraction - 1);\n }\n\n goExp2ish(x: number): number {\n const n = Math.floor(x);\n return (1 + x - n) * Math.pow(2, n);\n }\n\n renderGoCompositeEntry(entry, parsed, padding) {\n if (parsed === undefined || !parsed.singleLine || padding === undefined) {\n return this.appendGoTrailingComma(entry);\n }\n const comment = parsed.comment === undefined ? \"\" : \" \".repeat(padding.comment) + parsed.comment;\n return parsed.indent + parsed.key + \":\" + \" \".repeat(padding.key) + parsed.value + \",\" + comment;\n }\n\n // gofmt prints the comma of an entry before its trailing comment (`value, // comment`),\n // the entry text carries the comment last, so move the comma in front of it\n appendGoTrailingComma(entry) {\n const newlineIndex = entry.lastIndexOf(\"\\n\");\n const lastLine = newlineIndex === -1 ? entry : entry.slice(newlineIndex + 1);\n const commentIndex = this.findGoTrailingCommentStart(lastLine);\n if (commentIndex === -1) {\n return entry + \",\";\n }\n const offset = entry.length - lastLine.length + commentIndex;\n return entry.slice(0, offset).trimEnd() + \", \" + entry.slice(offset).trimEnd();\n }\n\n // text/tabwriter sizes cells in runes, go/printer's nodeSize counts bytes\n getGoRuneLength(text) {\n return [...text].length;\n }\n\n getGoByteLength(text) {\n let length = 0;\n for (const character of text) {\n const codePoint = character.codePointAt(0);\n length += codePoint < 0x80 ? 1 : codePoint < 0x800 ? 2 : codePoint < 0x10000 ? 3 : 4;\n }\n return length;\n }\n\n printConstructorDeclaration (node, identation) {\n const classNode = node.parent;\n const className = this.printNode(classNode.name, 0);\n const args = this.printMethodParameters(node);\n const constructorBody = this.printFunctionBody(node, identation);\n\n // find super call inside constructor and extract params\n let superCallParams = '';\n let hasSuperCall = false;\n node.body?.statements.forEach(statement => {\n if (isExpressionStatement(statement)) {\n const expression = statement.expression;\n if (isCallExpression(expression)) {\n const expressionText = expression.expression.getText().trim();\n if (expressionText === 'super') {\n hasSuperCall = true;\n superCallParams = expression.arguments.map((a) => {\n return this.printNode(a, identation).trim();\n }).join(\", \");\n }\n }\n }\n });\n\n if (hasSuperCall) {\n return this.getIden(identation) + className +\n `(${args}) : ${this.SUPER_CALL_TOKEN}(${superCallParams})` +\n constructorBody;\n }\n\n return this.getIden(identation) +\n className +\n \"(\" + args + \")\" +\n constructorBody;\n }\n\n printDynamicCall(node, identation) {\n // const isAsync = true; // setting to true for now, because there are some scenarios where we don't know\n const elementAccess = node.expression;\n if (elementAccess?.kind === SyntaxKind.ElementAccessExpression) {\n // the emitted call also carries the property name as its first\n // argument, so a call with arguments is a call with more than one\n // argument and prints them one level deeper\n const argumentDepth = this.goExprDepth + ((node.arguments?.length > 0) ? 1 : 0);\n const parsedArg = node.arguments?.length > 0 ? node.arguments.map(n => this.goWithExprDepth(argumentDepth, () => this.printNode(n, identation).trimStart())).join(\", \") : \"\";\n // const target = this.printNode(elementAccess.expression, 0);\n const propName = this.goWithExprDepth(argumentDepth, () => this.printNode(elementAccess.argumentExpression, 0));\n const argsArray = `${parsedArg}`;\n const open = this.DYNAMIC_CALL_OPEN;\n const statement = `${open}${propName}, ${argsArray})`;\n // statement = isAsync ? `((Task)${statement})` : statement;\n return statement;\n }\n return undefined;\n }\n\n\n printElementAccessExpressionExceptionIfAny(node) {\n // Fix malformed Split(...) element access where the index arg is mistakenly placed\n // inside the Split call. We force the correct pattern: GetValue(Split(str, sep), idx)\n const tsKind = SyntaxKind;\n if (node.expression.kind === tsKind.CallExpression) {\n const callExp = node.expression;\n const calleeText = callExp.expression.getText();\n if (calleeText.endsWith('.split') || calleeText.toLowerCase().includes('split')) {\n // print Split call normally (should already close with ))\n let splitCall = this.printNode(callExp, 0).trim();\n if (!splitCall.endsWith(')')) {\n splitCall += ')';\n }\n const idxArg = this.printNode(node.argumentExpression, 0);\n return `GetValue(${splitCall}, ${idxArg})`;\n }\n }\n // default: no exception\n return undefined;\n }\n\n printWrappedUnknownThisProperty(node, identation = 0) {\n const type = this.getChecker().getResolvedSignature(node);\n if (type?.declaration?.resolve() === undefined) {\n // the emitted call carries the property name as its first argument; arguments\n // print at the call's level so a multi-line literal keeps its nesting\n const argumentDepth = this.goExprDepth + ((node.arguments?.length > 0) ? 1 : 0);\n let parsedArguments = node.arguments?.map((a) => this.goWithExprDepth(argumentDepth, () => this.printNode(a, identation).trimStart())).join(\", \");\n parsedArguments = parsedArguments || \"\";\n const propName = node.expression?.name.text;\n // const isAsyncDecl = true;\n // const isAsyncDecl = node?.parent?.kind === SyntaxKind.AwaitExpression;\n // const isAsyncDecl = false;\n // const open = isAsyncDecl ? this.UKNOWN_PROP_ASYNC_WRAPPER_OPEN : this.UKNOWN_PROP_WRAPPER_OPEN;\n // const close = this.UNKOWN_PROP_WRAPPER_CLOSE;\n // return `${open}\"${propName}\"${parsedArguments}${close}`;\n const argsArray = `${parsedArguments}`;\n const open = this.DYNAMIC_CALL_OPEN;\n const statement = `${open}\"${propName}\", ${argsArray})`;\n return statement;\n }\n return undefined;\n }\n\n transformMethodNameIfNeeded(name: string): string {\n const res = this.unCamelCaseIfNeeded(name);\n return this.capitalize(res);\n }\n\n transformCallExpressionName(name: string, nameNode = undefined) {\n return this.applyAsyncSuffixToCallee(nameNode, this.capitalize(name));\n }\n\n transformPropertyAccessExpressionName(name: string, nameNode = undefined) {\n return this.applyAsyncSuffixToCallee(nameNode, this.capitalize(name));\n }\n\n printOutOfOrderCallExpressionIfAny(node, identation) {\n if (node.expression.kind === SyntaxKind.PropertyAccessExpression) {\n const args = node.arguments;\n\n if (node.expression.expression.kind === SyntaxKind.ThisKeyword) {\n const methodName = this.printNode(node.expression.name, 0);\n if (this.wrapThisCalls || (this.wrapCallMethods.includes(methodName))) {\n const argsParsed = this.goUnifiedStringCallArgs(node, 0, true) ?? args.map((a) => this.printNode(a, 0)).join(\", \");\n return `<-this.callInternal(\"${methodName}\"${(args.length > 0) ? \", \" + argsParsed : \"\"})`;\n }\n }\n\n const expressionText = node.expression.getText().trim();\n if (args.length === 1) {\n const parsedArg = this.printNode(args[0], 0);\n switch (expressionText) {\n // case \"JSON.parse\":\n // return `json_decode(${parsedArg}, $as_associative_array = true)`;\n case \"Math.abs\":\n return `mathAbs(${parsedArg})`;\n }\n } else if (args.length === 2)\n {\n const parsedArg1 = this.printNode(args[0], 0);\n const parsedArg2 = this.printNode(args[1], 0);\n switch (expressionText) {\n case \"Math.min\":\n return `mathMin(${parsedArg1}, ${parsedArg2})`;\n case \"Math.max\":\n return `mathMax(${parsedArg1}, ${parsedArg2})`;\n case \"Math.pow\":\n return `MathPow(${parsedArg1}, ${parsedArg2})`;\n }\n }\n const leftSide = node.expression?.expression;\n const leftSideText = leftSide ? this.printNode(leftSide, 0) : undefined;\n\n // wrap unknown property this.X calls\n if (leftSideText === this.THIS_TOKEN || leftSide.getFullText().indexOf(\"(this as any)\") > -1) { // double check this\n const res = this.printWrappedUnknownThisProperty(node, identation);\n if (res) {\n return res;\n }\n }\n }\n\n // // replace this[method]() calls\n // const thisElementAccess = this.printThisElementAccesssIfNeeded(node, identation);\n // if (thisElementAccess) {\n // return thisElementAccess;\n // }\n\n // handle dynamic calls, this[method](A) or exchange[b] (c) using reflection\n if (node.expression.kind === SyntaxKind.ElementAccessExpression) {\n return this.printDynamicCall(node, identation);\n }\n\n\n return undefined;\n }\n\n // `typeof x === \"\"` checks and the Go predicate helper each maps to\n goTypeOfHelpers = new Map([\n ['string', 'IsString'], ['number', 'IsNumber'], ['boolean', 'IsBool'], ['object', 'IsObject'], ['function', 'IsFunction'],\n ]);\n handleTypeOfInsideBinaryExpression(node, identation) {\n const left = node.left;\n const right = node.right.text;\n const op = node.operatorToken.kind;\n const expression = left.expression;\n\n const isDifferentOperator = op === SyntaxKind.ExclamationEqualsEqualsToken || op === SyntaxKind.ExclamationEqualsToken;\n const notOperator = isDifferentOperator ? this.NOT_TOKEN : \"\";\n\n const target = this.printNode(expression, 0);\n const helper = this.goTypeOfHelpers.get(right);\n return (helper === undefined) ? undefined : notOperator + `${helper}(${target})`;\n\n }\n\n printCustomBinaryExpressionIfAny(node, identation) {\n const left = node.left;\n const right = node.right;\n\n const op = node.operatorToken.kind;\n\n // ---------------------------------------------------------------\n // Array destructuring assignment: [a, b] = foo()\n // Transforms into:\n // __tmpX := foo()\n // a = GetValue(__tmpX, 0)\n // b = GetValue(__tmpX, 1)\n // ---------------------------------------------------------------\n if (op === SyntaxKind.EqualsToken &&\n left.kind === SyntaxKind.ArrayLiteralExpression) {\n // const elems = (left.elements as any[]);\n // const returnRandName = \"retRes\" + this.getLineBasedSuffix(node);\n // const rhs = this.printNode(right, 0);\n\n // // build extraction lines\n // const assignments = elems.map((el, idx) => {\n // const leftName = this.printNode(el, 0);\n // return `${leftName} = GetValue(${returnRandName}, ${idx})`;\n // }).join(`\\n${this.getIden(identation)}`);\n\n // return `${returnRandName} := ${rhs}\\n${this.getIden(identation)}${assignments}`;\n //\n const arrayBindingPatternElements = left.elements;\n const parsedArrayBindingElements = arrayBindingPatternElements.map((e) => this.printNode(e, 0));\n const syntheticName = parsedArrayBindingElements.join(\"\") + \"Variable\";\n\n let arrayBindingStatement = `${syntheticName} := ${this.printNode(right, 0)}\\n`;\n\n parsedArrayBindingElements.forEach((e, index) => {\n\n const statement = this.getIden(identation) + (this.goGetArgBindsDictElement(arrayBindingPatternElements[index], right, index)\n ? `${e} = MapTyped(GetValue(${syntheticName}, ${index}))`\n : `${e} = GetValue(${syntheticName}, ${index})`);\n if (index < parsedArrayBindingElements.length - 1) {\n arrayBindingStatement += statement + \"\\n\";\n } else {\n arrayBindingStatement += statement;\n }\n });\n\n return arrayBindingStatement;\n }\n\n // ---------------------------------------------------------------\n // Go-style setter for element-access assignments: a[b] = v and a[b] += v\n // ---------------------------------------------------------------\n if ((op === SyntaxKind.EqualsToken || op === SyntaxKind.PlusEqualsToken) &&\n left.kind === SyntaxKind.ElementAccessExpression) {\n // Collect base container and all keys (inner-most key is last).\n const keys: any[] = [];\n let baseExpr: any = null;\n let cur: any = left;\n while (isElementAccessExpression(cur)) {\n keys.unshift(cur.argumentExpression); // prepend\n const expr = cur.expression;\n if (!isElementAccessExpression(expr)) {\n baseExpr = expr;\n break;\n }\n cur = expr;\n }\n\n const containerStr = this.printNode(baseExpr, 0);\n const keyStrs = keys.map(k => this.printNode(k, 0));\n\n // the container of a nested `m[\"a\"][\"b\"] = v` write is a plain read of the\n // receiver: a declared map indexes natively and only the `any` steps above\n // it keep the helper (Go refuses to index an `any`)\n const acc = this.goElementWriteChain(baseExpr, containerStr, keys, keyStrs);\n\n const lastKey = keyStrs[keyStrs.length - 1];\n if (op === SyntaxKind.PlusEqualsToken) {\n const rhs = this.printNode(right, 0);\n // For +=, we need to get the current value, add to it, then set it back\n const currentValue = `${this.ELEMENT_ACCESS_WRAPPER_OPEN}${acc}, ${lastKey}${this.ELEMENT_ACCESS_WRAPPER_CLOSE}`;\n const native = (keyStrs.length === 1)\n ? this.printNativeElementAssignment(baseExpr, containerStr, keys[0], lastKey, `Add(${containerStr}[${lastKey}], ${rhs})`, true)\n : undefined;\n return (native !== undefined) ? native : `AddElementToObject(${acc}, ${lastKey}, Add(${currentValue}, ${rhs}))`;\n }\n // the value is printed at the statement's own level so a multi-line object\n // literal (bare, or nested inside a call argument) lands one level deeper with\n // its closing brace at the statement level; the leading indentation is dropped\n const rhs = this.goWithExprDepth(this.goExprDepth + 1, () => this.printNode(right, identation)).trimStart();\n\n // a single key over a receiver the printer typed itself is plain Go\n // indexing; a nested chain goes through GetValue, which is `any`\n // a native `m[k] = v` is a plain assignment, whose value go/printer prints at\n // the statement's own depth rather than inside the helper's argument list\n const nativeRhs = (right.kind === SyntaxKind.BinaryExpression)\n ? this.goWithExprDepth(this.goExprDepth, () => this.printNode(right, identation)).trimStart()\n : rhs;\n const native = (keyStrs.length === 1)\n ? this.printNativeElementAssignment(baseExpr, containerStr, keys[0], lastKey, nativeRhs, false, right)\n : undefined;\n return (native !== undefined) ? native : `AddElementToObject(${acc}, ${lastKey}, ${rhs})`;\n }\n\n if (left.kind === SyntaxKind.TypeOfExpression) {\n const typeOfExpression = this.handleTypeOfInsideBinaryExpression(node, identation);\n if (typeOfExpression) {\n return typeOfExpression;\n }\n }\n\n if (op === SyntaxKind.InKeyword) {\n const dictText = this.printNode(right, 0);\n const keyText = this.printNode(left, 0);\n const inlined = this.printInlineInOp(right, left, dictText, keyText);\n if (inlined !== undefined) {\n return inlined;\n }\n return `InOp(${dictText}, ${keyText})`;\n }\n\n // only print the operands when this op is actually handled here; otherwise\n // the base printBinaryExpression prints them, and doing it eagerly means\n // every unhandled binary expression gets its subtrees printed twice\n if (op === SyntaxKind.PlusEqualsToken || op === SyntaxKind.MinusEqualsToken || op in this.binaryExpressionsWrappers) {\n // both operands end up in the two-argument helper call below (or in the\n // `Add(x, y)` on the right of the compound assignment), i.e. one level\n // deeper than the expression itself\n const operandDepth = this.goExprDepth + 1;\n const leftText = this.goWithExprDepth(operandDepth, () => this.printNode(left, 0));\n const rightText = this.goWithExprDepth(operandDepth, () => this.printNode(right, 0));\n\n const nativeAssignment = this.goNativeCompoundAssignment(op, left, leftText, right, rightText);\n if (nativeAssignment !== undefined) {\n return nativeAssignment;\n }\n\n if (op === SyntaxKind.PlusEqualsToken) {\n return `${leftText} = Add(${leftText}, ${rightText})`;\n }\n\n if (op === SyntaxKind.MinusEqualsToken) {\n return `${leftText} = Subtract(${leftText}, ${rightText})`;\n }\n\n const isEquality = (op === SyntaxKind.EqualsEqualsToken) || (op === SyntaxKind.EqualsEqualsEqualsToken);\n const isDifference = (op === SyntaxKind.ExclamationEqualsToken) || (op === SyntaxKind.ExclamationEqualsEqualsToken);\n if (isEquality || isDifference) {\n const inlined = this.printInlineEquality(left, right, leftText, rightText, isEquality);\n if (inlined !== undefined) {\n return inlined;\n }\n }\n\n if (ORDERED_COMPARISON_OPERATORS[op] !== undefined) {\n const inlined = this.printInlineOrderedComparison(left, right, leftText, rightText, op);\n if (inlined !== undefined) {\n return inlined;\n }\n }\n\n const wrapper = this.binaryExpressionsWrappers[op];\n const open = wrapper[0];\n const close = wrapper[1];\n const nativeArithmetic = this.goNativeArithmetic(node, leftText, rightText);\n if (nativeArithmetic !== undefined) {\n return nativeArithmetic.text;\n }\n return `${open}${leftText}, ${rightText}${close}`;\n }\n\n // x = y\n // cast y to x type when y is unknown\n // if (op === SyntaxKind.EqualsToken) {\n // const leftType = this.getChecker().getTypeAtLocation(left);\n // const rightType = this.getChecker().getTypeAtLocation(right);\n\n // if (this.isAnyType(rightType.flags) && !this.isAnyType(leftType.flags)) {\n // // const parsedType = this.getTypeFromRawType(leftType);\n // return `${leftText} = ${rightText}`;\n // }\n // }\n\n return undefined;\n }\n\n // the scalar family the TypeScript type of an operand belongs to: 'string',\n // 'int', 'float', 'bool', 'nil' for the undefined/null literals, or undefined\n // when the type is any/unknown/a union of several families\n goScalarFamily(node): string | undefined {\n // TypeScript narrows `x !== undefined && x === 'v'` to `string`, but the Go\n // local is still the `any` box the declaration printed; when that box holds\n // a *T helper result, `==` against a string is never true in Go\n const checker: any = this.checkerOrUndefined();\n if (node?.kind === SyntaxKind.Identifier && this.goDeclaredTypeOfIdentifier(node) === undefined\n && this.goAnyLocalHoldsPointer(checker.getSymbolAtLocation(node)?.valueDeclaration?.resolve())) {\n return undefined;\n }\n return (checker === undefined) ? undefined : this.goScalarFamilyOfType(checker.getTypeAtLocation(node));\n }\n\n // the scalar family the TypeScript type of an operand belongs to, where a\n // `string | undefined` union still counts as 'string': the Go box holds that\n // scalar or nil, and both `x == nil` and `x == \"lit\"` are then the same\n // predicate as the helper. Numbers are excluded by the caller.\n goScalarFamilyWithNil(node): string | undefined {\n const checker: any = this.checkerOrUndefined();\n return (checker === undefined) ? undefined : this.goScalarFamilyOfType(checker.getTypeAtLocation(node), true);\n }\n\n // true when this operand is a *parameter* boxed as `any` whose TypeScript type is an array or\n // object (`Strings`, `Market`, `NullableDict`, `object[]`, `object`): a Go map/slice, never a\n // pointer, so a nil test needs no helper. Locals may box a nil `*sync.Map`, which is not `== nil`.\n goObjectBoxParameter(node): boolean {\n if (node?.kind !== SyntaxKind.Identifier) {\n return false;\n }\n const checker: any = this.checkerOrUndefined();\n if (checker === undefined) {\n return false;\n }\n if (checker.getSymbolAtLocation(node)?.valueDeclaration?.resolve()?.kind !== SyntaxKind.Parameter) {\n return false;\n }\n return this.goTypeIsNilComparableObject(checker.getTypeAtLocation(node));\n }\n\n // an object type whose Go value is a map/slice, or a union of such a type with\n // undefined/null. `any`, functions and class instances are excluded: their Go\n // value may be an identity-bearing pointer\n goTypeIsNilComparableObject(type): boolean {\n if (type === undefined) {\n return false;\n }\n if (type.flags & TypeFlags.Union) {\n let seen = false;\n for (const member of type.getTypes()) {\n if (member.flags & (TypeFlags.Undefined | TypeFlags.Null | TypeFlags.Void)) {\n continue;\n }\n if (!this.goTypeIsNilComparableObject(member)) {\n return false;\n }\n seen = true;\n }\n return seen;\n }\n if (!(type.flags & (TypeFlags.Object | TypeFlags.NonPrimitive))) {\n return false;\n }\n if (type.getCallSignatures().length > 0 || type.getConstructSignatures().length > 0) {\n return false;\n }\n const declaration = type.getSymbol()?.valueDeclaration?.resolve() ?? type.getSymbol()?.declarations?.map((d) => d.resolve())?.[0];\n return declaration?.kind !== SyntaxKind.ClassDeclaration;\n }\n\n // the callee name of a printed call, e.g. `this.SafeDict(x, 0, {})` → `this.SafeDict`\n goPrintedCallee(printedValue: string): string | undefined {\n let value = printedValue.trim();\n while (value.startsWith('(') && this.isWholePrintedCall(value, 0)) {\n value = value.substring(1, value.length - 1).trim();\n }\n const open = value.indexOf('(');\n if (open <= 0 || !this.isWholePrintedCall(value, open)) {\n return undefined;\n }\n const callee = value.substring(0, open);\n return /^[A-Za-z_][\\w.]*$/.test(callee) ? callee : undefined;\n }\n\n // true when this expression prints to an interface (`any`) box: a parameter, a\n // local the printer left `any`, or one of the helpers whose Go signature returns\n // `any`. A *T / scalar local or call is not a box and keeps its own rule.\n goIsAnyBoxExpression(node, printedText: string): boolean {\n if (node?.kind === SyntaxKind.Identifier) {\n const decl = this.goAnyBoxLocalDeclaration(node);\n const isBinding = (decl?.kind === SyntaxKind.Parameter)\n || (decl?.kind === SyntaxKind.VariableDeclaration);\n if (!isBinding) {\n return false;\n }\n // the printer names a Go type for this local/`:=` initializer, so the\n // value is not behind an interface\n if (this.goDeclaredTypeOfIdentifier(node) !== undefined) {\n return false;\n }\n // an `any` local initialised from a *T helper (`var x any = this.SafeString(…)`)\n // boxes the pointer itself: a nil *string inside `any` is not `== nil` in Go,\n // so only the deref-aware helper compares it correctly\n return !this.goAnyLocalHoldsPointer(decl);\n }\n if (node?.kind === SyntaxKind.CallExpression) {\n if (this.goTypeOfInitializer(node, printedText) !== undefined) {\n return false; // a *T or a scalar the printer can name\n }\n return GO_ANY_BOX_CALLS.indexOf(this.goPrintedCallee(printedText)) >= 0;\n }\n return false;\n }\n\n // an element read prints either a native map[string]any index or the\n // GetValue(container, key) helper call — an `any` box in both cases\n goBoxedElementRead(node, printedText: string): boolean {\n node = this.goUnwrapParenthesizedNode(node);\n if (node?.kind !== SyntaxKind.ElementAccessExpression) {\n return false;\n }\n if (GO_ANY_BOX_CALLS.indexOf(this.goPrintedCallee(printedText)) >= 0) {\n return true; // GetValue(container, key)\n }\n let base = node.expression;\n while (isElementAccessExpression(base)) {\n base = base.expression;\n }\n // the printed base is unknown here: `goIndexableTypeOf` answers on the\n // declared table alone for every shape but a call, which stays a box anyway\n return this.goIndexableTypeOf(base, '') === 'map[string]any';\n }\n\n // true when an `any`-typed local can hold a *T helper result: its initializer or a\n // later `x = …` write is a `this.safeX(…)` call whose Go signature returns a pointer\n goAnyLocalHoldsPointerCache = new Map();\n goAnyLocalHoldsPointer(decl): boolean {\n if (decl?.kind !== SyntaxKind.VariableDeclaration || decl.name?.kind !== SyntaxKind.Identifier) {\n return false;\n }\n if (this.goAnyLocalHoldsPointerCache.has(decl)) {\n return this.goAnyLocalHoldsPointerCache.get(decl);\n }\n // the callee is read from the AST, never printed: printing an operand would\n // re-enter the equality classifier that asks this question\n this.goAnyLocalHoldsPointerCache.set(decl, false);\n let settled = true;\n const isPointerInit = (expr): boolean => {\n expr = this.goUnwrapParenthesizedNode(expr);\n if (expr?.kind === SyntaxKind.ConditionalExpression) {\n return isPointerInit(expr.whenTrue) || isPointerInit(expr.whenFalse);\n }\n if (expr?.kind === SyntaxKind.Identifier) {\n // a copy of a pointer-bound GetArg parameter (or of a local holding one) boxes it\n const source: any = this.checkerOrUndefined()?.getSymbolAtLocation(expr)?.valueDeclaration?.resolve();\n if (source?.kind === SyntaxKind.Parameter) {\n if (this.goGetArgTypeComputing?.has(source)) {\n settled = false;\n return true;\n }\n return String(this.goGetArgParameterType(source) ?? '').startsWith('*');\n }\n const inner = (source !== decl) && this.goAnyLocalHoldsPointer(source);\n settled = settled && ((source === decl) || this.goAnyLocalHoldsPointerCache.has(source));\n return inner;\n }\n const callee = (expr?.kind === SyntaxKind.CallExpression) ? expr.expression : undefined;\n if (callee?.kind !== SyntaxKind.PropertyAccessExpression || callee.expression?.kind !== SyntaxKind.ThisKeyword) {\n return false;\n }\n const name = this.goAstCalleeName(expr);\n const goType = (name === undefined) ? undefined : GO_HELPER_RETURN_TYPES[name];\n return (typeof goType === 'string') && goType.startsWith('*');\n };\n let holds = isPointerInit(decl.initializer);\n if (!holds) {\n const name = decl.name.text;\n const scope = this.goEnclosingFunction(decl);\n const visit = (n) => {\n if (holds) { return; }\n if (n.kind === SyntaxKind.BinaryExpression && n.operatorToken.kind === SyntaxKind.EqualsToken\n && n.left?.kind === SyntaxKind.Identifier && n.left.text === name && isPointerInit(n.right)) {\n holds = true;\n return;\n }\n n.forEachChild(visit);\n };\n if (scope !== undefined) {\n scope.forEachChild(visit);\n }\n }\n if (settled) {\n this.goAnyLocalHoldsPointerCache.set(decl, holds);\n } else {\n this.goAnyLocalHoldsPointerCache.delete(decl);\n }\n return holds;\n }\n\n // the callee name of a call, read from the AST and capitalised the way the\n // printer names Go functions (`this.parseJson` -> `this.ParseJson`). Printing the\n // callee would re-enter the equality classifier that asks this question.\n goAstCalleeName(call): string | undefined {\n const callee = call?.expression;\n if (callee?.kind === SyntaxKind.Identifier) {\n const name = callee.text;\n return (typeof name === 'string' && name.length > 0) ? name.charAt(0).toUpperCase() + name.substring(1) : undefined;\n }\n if (callee?.kind === SyntaxKind.PropertyAccessExpression && callee.expression?.kind === SyntaxKind.ThisKeyword) {\n const name = callee.name?.text;\n return (typeof name === 'string' && name.length > 0) ? 'this.' + name.charAt(0).toUpperCase() + name.substring(1) : undefined;\n }\n return undefined;\n }\n\n // true when every declaration of the awaited callee is a bodyless method signature:\n // TS never implements it, the endpoint generator does, and the Go body is the\n // `<-chan any` wrapper over callEndpointAsync (decoded JSON / \"panic: \" / nil)\n goAwaitedCallIsImplicitEndpoint(expression): boolean {\n const call = this.goUnwrapParenthesizedNode(expression);\n if (call?.kind !== SyntaxKind.CallExpression) {\n return false;\n }\n const callee = call.expression;\n if (callee?.kind !== SyntaxKind.PropertyAccessExpression || callee.expression?.kind !== SyntaxKind.ThisKeyword) {\n return false;\n }\n const nameNode = callee.name;\n if (nameNode?.kind !== SyntaxKind.Identifier) {\n return false;\n }\n const checker: any = this.checkerOrUndefined();\n if (checker === undefined) {\n return false;\n }\n const symbol = checker.getSymbolAtLocation(nameNode);\n const declarations = symbol?.declarations?.map((d) => d.resolve());\n if (!declarations || declarations.length === 0) {\n return false;\n }\n return declarations.every((d) => (d.kind === SyntaxKind.MethodSignature)\n && (d.body === undefined)\n && (d.parent?.kind === SyntaxKind.InterfaceDeclaration));\n }\n\n // true when the printed value of this expression is never a *T whose nil\n // derefScalar folds to nil (nor a *sync.Map): null/undefined, an object/array\n // literal, an endpoint await or a JSON decode. Everything else stays unproven.\n goIsNonPointerValueSource(expr): boolean {\n expr = this.goUnwrapParenthesizedNode(expr);\n if (expr === undefined) {\n return true; // `var x any` never written holds nil\n }\n switch (expr.kind) {\n case SyntaxKind.NullKeyword:\n return true;\n case SyntaxKind.Identifier:\n return expr.text === 'undefined';\n case SyntaxKind.ObjectLiteralExpression:\n case SyntaxKind.ArrayLiteralExpression:\n return true;\n case SyntaxKind.AwaitExpression:\n return this.goAwaitedCallIsImplicitEndpoint(expr.expression);\n case SyntaxKind.CallExpression: {\n const name = this.goAstCalleeName(expr);\n if (name === undefined) {\n return false;\n }\n return GO_JSON_PARSE_CALLS.indexOf(name.replace(/^this\\./, '')) >= 0;\n }\n }\n return false;\n }\n\n // true when every value written into an `any` local is a non-pointer source: the\n // box holds a container, a scalar or nil, so IsEqual(x, nil) is exactly `x == nil`.\n // A write of any other shape in the enclosing function (D2 scan) keeps the helper\n goAnyLocalHoldsNonPointerCache = new Map();\n goAnyLocalHoldsNonPointer(decl): boolean {\n if (decl?.kind !== SyntaxKind.VariableDeclaration || decl.name?.kind !== SyntaxKind.Identifier) {\n return false;\n }\n if (this.goAnyLocalHoldsNonPointerCache.has(decl)) {\n return this.goAnyLocalHoldsNonPointerCache.get(decl);\n }\n let holds = !this.goAnyLocalHoldsPointer(decl) && this.goIsNonPointerValueSource(decl.initializer);\n if (holds) {\n const name = decl.name.text;\n const scope = this.goEnclosingFunction(decl);\n if (scope === undefined) {\n holds = false;\n } else {\n const visit = (n) => {\n if (!holds) { return; }\n // `[ a, b ] = …` writes a and b through GetValue(, i), so its\n // source is the right-hand side as well\n if (n.kind === SyntaxKind.BinaryExpression && n.operatorToken?.kind === SyntaxKind.EqualsToken\n && this.goAssignmentWritesName(n.left, name)\n && !this.goIsNonPointerValueSource(n.right)) {\n holds = false;\n return;\n }\n n.forEachChild(visit);\n };\n scope.forEachChild(visit);\n }\n }\n this.goAnyLocalHoldsNonPointerCache.set(decl, holds);\n return holds;\n }\n\n // true when this assignment target binds the named local: a plain identifier, or a\n // destructuring element (`[ a, b ] = …` prints GetValue(, i) writes)\n goAssignmentWritesName(left, name): boolean {\n if (left?.kind === SyntaxKind.Identifier) {\n return left.text === name;\n }\n if (left?.kind === SyntaxKind.ArrayLiteralExpression) {\n return left.elements.some((e) => (e?.kind === SyntaxKind.Identifier) && (e.text === name));\n }\n return false;\n }\n\n // the variable declaration an identifier resolves to, when it is one\n goAnyBoxLocalDeclaration(node): any {\n if (node?.kind !== SyntaxKind.Identifier) {\n return undefined;\n }\n const checker: any = this.checkerOrUndefined();\n if (checker === undefined) {\n return undefined;\n }\n const symbol = checker.getSymbolAtLocation(node);\n return symbol?.valueDeclaration?.resolve();\n }\n\n // true when this identifier is a parameter bound by `x := GetArg(optionalArgs, i, default)`:\n // GetArg runs derefScalar and folds a typed nil pointer (and nil []string/[]any) into the untyped\n // default, so the box holds a plain scalar or an untyped nil, never a nil *T.\n goGetArgBoundParameter(node): boolean {\n const decl = this.goAnyBoxLocalDeclaration(node);\n // a parameter without a default keeps the caller's value as-is in a plain `any`\n // parameter, where a *int64 handed over by another method stays a pointer\n if (decl?.kind !== SyntaxKind.Parameter || decl.initializer === undefined) {\n return false;\n }\n // only a method/function body binds its defaulted parameters with GetArg: an arrow\n // function's printed parameters carry no default binding at all\n const owner = decl.parent?.kind;\n if (owner !== SyntaxKind.MethodDeclaration && owner !== SyntaxKind.FunctionDeclaration\n && owner !== SyntaxKind.Constructor) {\n return false;\n }\n return !this.goParameterLaterWritesPointerBox(decl);\n }\n\n // D2 for a GetArg-bound parameter: a later `x = …` write whose printed value is a typed\n // pointer puts a nil *T back in the box, where IsEqual(x, nil) is true but `x == nil` is not\n goParameterLaterWritesPointerBox(decl): boolean {\n const name = (decl?.name?.kind === SyntaxKind.Identifier) ? decl.name.text : undefined;\n if (typeof name !== 'string') {\n return true; // a binding pattern: the write scan cannot follow it\n }\n const scope = this.goEnclosingFunction(decl);\n if (scope === undefined) {\n return true;\n }\n let pointerWrite = false;\n const visit = (n) => {\n if (pointerWrite) {\n return;\n }\n if (n.kind === SyntaxKind.BinaryExpression && n.operatorToken?.kind === SyntaxKind.EqualsToken\n && this.goAssignmentWritesName(n.left, name) && this.goWritePrintsPointerBox(n.right)) {\n pointerWrite = true;\n return;\n }\n n.forEachChild(visit);\n };\n scope.forEachChild(visit);\n return pointerWrite;\n }\n\n // true when the printed value of an assignment's right-hand side is a typed pointer: a\n // `this.safeX(…)`/`this.Parse8601(…)` accessor (GO_HELPER_RETURN_TYPES), an identifier the\n // printer declared `*T`, or a hand-written *sync.Map field. Read from the AST, never printed.\n goWritePrintsPointerBox(expr): boolean {\n expr = this.goUnwrapParenthesizedNode(expr);\n if (expr === undefined) {\n return false;\n }\n if (expr.kind === SyntaxKind.CallExpression) {\n const name = this.goAstCalleeName(expr);\n if (typeof name === 'string') {\n const goType = GO_HELPER_RETURN_TYPES[name];\n if ((typeof goType === 'string') && goType.startsWith('*')) {\n return true;\n }\n // the accessors the ccxt build pass wraps with DerefScalar but the Go type\n // table does not name (`this.NumberToString`, `this.Parse8601`, `this.Iso8601`)\n // return a pointer too, so their write stays unproven\n return GO_DEREF_WRAPPED_CALLS.indexOf(name.replace(/^this\\./, '')) >= 0;\n }\n return false;\n }\n if (expr.kind === SyntaxKind.Identifier) {\n const declared = this.goDeclaredTypeOfIdentifier(expr);\n return (typeof declared === 'string') && declared.startsWith('*');\n }\n if (expr.kind === SyntaxKind.PropertyAccessExpression && expr.expression?.kind === SyntaxKind.ThisKeyword) {\n const fieldType = GO_NILABLE_FIELDS_Typed['this.' + expr.name?.text];\n return (typeof fieldType === 'string') && GO_NIL_EQUIVALENT_POINTER_TYPES_Native.has(fieldType);\n }\n return false;\n }\n\n goScalarFamilyOfType(type, allowNil = false): string | undefined {\n if (type === undefined) {\n return undefined;\n }\n // Str/Int/Num/Bool are nullable aliases of `string | undefined` & friends;\n // their Go representation is still `any`, so they never inline — unless the\n // caller is asking about the value the `any` box holds (allowNil)\n const alias = type.getAliasSymbol()?.escapedName;\n if (!allowNil) {\n switch (alias) {\n case 'Str':\n case 'Int':\n case 'Num':\n case 'Bool':\n return undefined;\n }\n }\n const flags = type.flags;\n if (flags & TypeFlags.Union) {\n const families = new Set();\n for (const member of type.getTypes()) {\n const family = this.goScalarFamilyOfType(member, allowNil);\n if (family === undefined) {\n return undefined;\n }\n // `string | undefined` is `any` in Go, never a bare Go string:\n // one nullable member disqualifies the whole union\n if (family === 'nil') {\n if (allowNil) {\n continue; // the box holds nil for that member\n }\n return undefined;\n }\n families.add(family);\n }\n if (families.size !== 1) {\n return undefined; // `boolean` is `true | false`, so size === 1\n }\n return families.values().next().value;\n }\n if (flags & (TypeFlags.String | TypeFlags.StringLiteral)) {\n return 'string';\n }\n if (flags & (TypeFlags.Number | TypeFlags.NumberLiteral)) {\n return 'number';\n }\n if (flags & (TypeFlags.Boolean | TypeFlags.BooleanLiteral)) {\n return 'bool';\n }\n if (flags & (TypeFlags.Undefined | TypeFlags.Null | TypeFlags.Void)) {\n return 'nil';\n }\n return undefined;\n }\n\n // B-02: a parameter of a nullable ccxt alias (`Str`) prints as the native Go type (`*string`) only\n // when the method is internal (not async/override, no inherited member), every call site passes\n // that type (checker here, textual for siblings), and the body never writes another type (D2).\n goNativeParameterTypeCache = new Map();\n goSameFileCallCache = new Map>>();\n goTsSrcTreeCache = new Map();\n\n goNativeParameterType(param): string | undefined {\n if (param?.kind !== SyntaxKind.Parameter) {\n return undefined;\n }\n if (this.goNativeParameterTypeCache.has(param)) {\n return this.goNativeParameterTypeCache.get(param);\n }\n // the call-site proof prints argument expressions, which can land back here\n this.goNativeParameterTypeCache.set(param, undefined);\n const result = this.goNativeParameterTypeOf(param);\n this.goNativeParameterTypeCache.set(param, result);\n return result;\n }\n\n goNativeParameterTypeOf(param): string | undefined {\n if ((param.initializer !== undefined) || (param.dotDotDotToken !== undefined)) {\n return undefined; // optional/variadic parameters keep the optionalArgs ABI\n }\n if (param.name?.kind !== SyntaxKind.Identifier) {\n return undefined;\n }\n const fn: any = param.parent;\n if ((fn?.kind !== SyntaxKind.MethodDeclaration) || (fn.body === undefined) || (fn.name?.kind !== SyntaxKind.Identifier)) {\n return undefined;\n }\n const parseParam = fn.name.text.startsWith('parse');\n // D-03: a pro handler's frame parameter (`handleX (client: Client, message: Dict)`)\n // is the second family whose call-site proof can name a Go type\n const handlerParam = !parseParam && this.goIsProHandlerMethod(fn);\n if (this.goIsUnifiedStringParameter(fn.name.text, fn.parameters.indexOf(param))) {\n // the table types the base and every override together: a body that breaks it fails the build\n if ((this.goRequiredStringParameterType(param) !== 'string')\n || !this.goLocalIsSafeToType(fn.body, param, param.name.text, 'string')\n || !this.goParameterKeepsNilCompareNative(fn.body, param, 'string')) {\n throw new Error(`unifiedStringParams: ${fn.name.text} parameter ${param.name.text} is not a required string written only as string`);\n }\n return 'string';\n }\n if (this.goMethodKeepsBaseSignature(fn)) {\n return undefined; // inherited/base methods are pinned by the base class and IDerivedExchange\n }\n const index = fn.parameters.indexOf(param);\n if (!parseParam && !handlerParam) {\n // any other exchange-local method: only a non-nullable TS `string` becomes a Go `string`\n // at least one proven caller: an uncalled method's signature is outside API only by accident\n const goType = this.goRequiredStringParameterType(param);\n return ((goType !== undefined) && this.goHasTreeCallSite(fn) && this.goParameterCallSitesPassType(fn, index, goType)\n && this.goLocalIsSafeToType(fn.body, param, param.name.text, goType)\n && this.goParameterKeepsNilCompareNative(fn.body, param, goType)) ? goType : undefined;\n }\n if (this.isAsyncFunction(fn)) {\n return undefined;\n }\n for (const goType of this.goNativeParameterTypeCandidates(param, handlerParam)) {\n if (this.goParameterCallSitesPassType(fn, index, goType)\n && this.goLocalIsSafeToType(fn.body, param, param.name.text, goType)\n && this.goParameterKeepsNilCompareNative(fn.body, param, goType)) {\n return goType;\n }\n }\n return undefined;\n }\n\n goIsUnifiedStringParameter(methodName: string, index: number): boolean {\n const indexes = Object.prototype.hasOwnProperty.call(this.unifiedStringParams, methodName) ? this.unifiedStringParams[methodName] : undefined;\n return Array.isArray(indexes) && indexes.includes(index);\n }\n\n // the call arguments of a unified method whose parameter prints `string`: an argument the\n // printer cannot prove a Go string goes through StringArg, which panics on any other value\n goUnifiedStringCallArgs(node, identation, flat = false): string | undefined {\n const callee: any = node.expression;\n const name = (callee?.kind === SyntaxKind.PropertyAccessExpression) ? callee.name?.text : undefined;\n if ((typeof name !== 'string') || !Object.prototype.hasOwnProperty.call(this.unifiedStringParams, name)) {\n return undefined;\n }\n const args = node.arguments ?? [];\n if (args.some((a) => a.kind === SyntaxKind.SpreadElement)) {\n return undefined;\n }\n const depth = this.goExprDepth + ((args.length > 1) ? 1 : 0);\n return args.map((a, i) => {\n const printed = flat ? this.printNode(a, 0) : this.goWithExprDepth(depth, () => this.printNode(a, identation)).trim();\n if (!this.goIsUnifiedStringParameter(name, i) || (this.goPrintedArgType(a) === 'string')) {\n return printed;\n }\n return `StringArg(${printed})`;\n }).join(', ');\n }\n\n // `string` for a parameter whose declared TS type is string (or a string-literal union) with no\n // undefined/null member; a nullable one stays boxed here (callers pass *string or nil)\n goRequiredStringParameterType(param): string | undefined {\n const type = this.checkerOrUndefined()?.getTypeAtLocation(param);\n if (type === undefined) {\n return undefined;\n }\n const parts = ((typeof type.isUnionType === 'function') && type.isUnionType()) ? type.getTypes() : [type];\n return parts.every(p => (p.flags & (TypeFlags.String | TypeFlags.StringLiteral)) !== 0) ? 'string' : undefined;\n }\n\n // The boxed object parameter prints `x === undefined` as a native `x == nil`\n // (goObjectBoxParameter); a parameter the printer typed as a Go map/slice would fall\n // through to IsEqual(x, nil) instead. Both predicates answer false for every value a\n goParameterKeepsNilCompareNative(body, param, goType: string): boolean {\n if (goType === '*string') {\n return true;\n }\n const name = param.name.text;\n let keeps = true;\n const visit = (n) => {\n if (!keeps) {\n return;\n }\n if ((n.kind === SyntaxKind.Identifier) && (n.text === name)) {\n let symbol;\n try {\n symbol = this.getChecker().getSymbolAtLocation(n);\n } catch (e) {\n symbol = undefined;\n }\n const binary: any = n.parent;\n if ((symbol?.valueDeclaration?.resolve() === param) && (binary?.kind === SyntaxKind.BinaryExpression)\n && ((binary.left === n) || (binary.right === n))) {\n const op = binary.operatorToken?.kind;\n if ((op === SyntaxKind.EqualsEqualsToken) || (op === SyntaxKind.EqualsEqualsEqualsToken)\n || (op === SyntaxKind.ExclamationEqualsToken) || (op === SyntaxKind.ExclamationEqualsEqualsToken)) {\n const other: any = (binary.left === n) ? binary.right : binary.left;\n if ((other?.kind === SyntaxKind.NullKeyword)\n || ((other?.kind === SyntaxKind.Identifier) && (other.text === 'undefined'))) {\n keeps = false;\n return;\n }\n }\n }\n }\n n.forEachChild(visit);\n };\n body.forEachChild(visit);\n return keeps;\n }\n\n // ---- D-03: pro handler frame parameters ------------------------------------\n // A `handle*` method of a pro exchange class receives the raw frame from the WS\n // client. When the checker types that parameter as `Dict`, and every call site\n goIsProHandlerMethod(fn): boolean {\n // the main-thread transpile registers the file relative to the repo root\n // (ts/src/pro/.ts) while the batch registers it absolute, so accept both\n const fileName = String(fn.getSourceFile().fileName ?? '');\n if (!(/(^|[\\\\/])ts[\\\\/]src[\\\\/]pro[\\\\/]/.test(fileName))) {\n return false;\n }\n const name = fn.name.text;\n return (name.length > 6) && name.startsWith('handle') && (name[6] === name[6].toUpperCase());\n }\n\n // `Dict` is the checker's structural `{[key: string]: any}`: a string index\n // signature is the proof. Class instances (OrderBook, ArrayCache*, Client, Future),\n // named-member interfaces (Market, Order, Ticker) and arrays carry none of them, so\n goParameterTypeIsDict(type): boolean {\n try {\n return (typeof type.getStringIndexType === 'function') && (type.getStringIndexType() !== undefined);\n } catch (e) {\n return false;\n }\n }\n\n // the Go types the declared TypeScript type can carry. `Dict`/`Market`/`Currency`\n // and the other dict-shaped object types print as the `map[string]any` the Go side\n // builds them from, `List` (= any[]) as its `[]any`; pro `handle*` frames (isHandler)\n goNativeParameterTypeCandidates(param, isHandler = false): string[] {\n const checker: any = this.checkerOrUndefined();\n const type = checker?.getTypeAtLocation(param);\n if (type === undefined) {\n return [];\n }\n let parts = ((typeof type.isUnionType === 'function') && type.isUnionType()) ? type.getTypes().slice() : [type];\n parts = parts.filter(p => !(p.flags & (TypeFlags.Undefined | TypeFlags.Null)));\n if (parts.length !== 1) {\n return [];\n }\n const inner: any = parts[0];\n if (inner.flags & TypeFlags.String) {\n return isHandler ? [] : ['*string'];\n }\n if (isHandler && this.goParameterTypeIsDict(inner)) {\n return ['map[string]any'];\n }\n if (!(inner.flags & TypeFlags.Object)) {\n return [];\n }\n if (checker.isArrayType(inner)) {\n // List / any[]: the element must itself be `any`, or the Go slice would need\n // the narrower element type (`string[]` is a []string the printer does not build)\n const element = checker.getIndexTypeOfType(inner, IndexKind.Number);\n return ((element !== undefined) && (element.flags & (TypeFlags.Any | TypeFlags.Unknown))) ? ['[]any'] : [];\n }\n // Dict / Market / Currency / a structure interface: a plain Go dictionary, never a\n // class instance or a function (goTypeIsNilComparableObject is the printer's own\n // test for exactly those types, used for the boxed nil test above)\n return this.goTypeIsNilComparableObject(inner) ? ['map[string]any'] : [];\n }\n\n // true when the method overrides (or shadows) a member of the class it extends, or carries an\n // explicit `override`: those print the base signature so the generated base classes and\n // IDerivedExchange keep compiling. The abstract base (ts/src/base/**) is never retyped.\n goMethodKeepsBaseSignature(fn): boolean {\n if ((fn.modifiers ?? []).some(m => m.kind === SyntaxKind.OverrideKeyword)) {\n return true;\n }\n if (/(^|\\/)ts\\/src\\/base\\//.test(fn.getSourceFile().fileName)) {\n return true;\n }\n const name = fn.name.text;\n const cls = this.goEnclosingClass(fn);\n if (cls === undefined) {\n return true;\n }\n const extendsClauses = (cls.heritageClauses ?? []).filter(clause => clause.token === SyntaxKind.ExtendsKeyword);\n if (extendsClauses.length === 0) {\n return true; // a root class: the abstract base of the generated tree\n }\n for (const clause of extendsClauses) {\n for (const expr of (clause.types ?? [])) {\n const checker: any = this.checkerOrUndefined();\n const baseType = checker.getTypeAtLocation(expr);\n if (baseType?.getProperty?.(name) !== undefined) {\n return true;\n }\n }\n }\n return false;\n }\n\n goHasTreeCallSite(fn): boolean {\n const name = fn.name.text;\n if (this.goSameFileCallsOf(fn, name).length > 0) {\n return true;\n }\n const tree = this.goTsSrcTree(fn.getSourceFile());\n const myClass = this.goEnclosingClassName(fn);\n return (tree?.callIndex.get(name) ?? []).some(site => this.goTsSrcFileDerivesFrom(tree, site.file, myClass));\n }\n\n // every call site of `fn` in the whole tree must pass exactly `goType` at `index`\n goParameterCallSitesPassType(fn, index: number, goType: string): boolean {\n const name = fn.name.text;\n for (const call of this.goSameFileCallsOf(fn, name)) {\n const arg = call.arguments?.[index];\n if ((arg === undefined) || (arg.kind === SyntaxKind.SpreadElement)) {\n return false;\n }\n if (this.goPrintedArgType(arg) !== goType) {\n return false;\n }\n }\n const tree = this.goTsSrcTree(fn.getSourceFile());\n if (tree !== undefined) {\n const myClass = this.goEnclosingClassName(fn);\n const myFile = tree.relativeOf.get(path.resolve(fn.getSourceFile().fileName));\n for (const site of (tree.callIndex.get(name) ?? [])) {\n if (site.file === myFile) {\n continue; // proven above off the checker\n }\n if (!this.goTsSrcFileDerivesFrom(tree, site.file, myClass)) {\n continue; // a same-named method of another exchange\n }\n const arg = site.args[index];\n if ((arg === undefined) || !this.goTextArgMatchesType(arg, goType, site.file, tree)) {\n return false;\n }\n }\n }\n return true;\n }\n\n goEnclosingClass(fn) {\n let cls = fn.parent;\n while ((cls !== undefined) && (cls.kind !== SyntaxKind.ClassDeclaration) && (cls.kind !== SyntaxKind.ClassExpression)) {\n cls = cls.parent;\n }\n return cls;\n }\n\n goEnclosingClassName(fn): string | undefined {\n const cls = this.goEnclosingClass(fn);\n return (cls?.name?.kind === SyntaxKind.Identifier) ? cls.name.text : undefined;\n }\n\n // the printed Go type of a call-site argument, or undefined when the printer\n // cannot name it (then the call site does not prove anything)\n goPrintedArgType(arg): string | undefined {\n if (arg.kind === SyntaxKind.Identifier) {\n return this.goDeclaredTypeOfIdentifier(arg);\n }\n return this.goTypeOfInitializer(arg, this.printNode(arg, 0));\n }\n\n // every `this.(...)` of this file whose resolved signature is `fn`\n goSameFileCallsOf(fn, name: string): Array {\n const file = fn.getSourceFile();\n let index = this.goSameFileCallCache.get(file);\n if (index === undefined) {\n index = new Map>();\n const visit = (node) => {\n if (node.kind === SyntaxKind.CallExpression) {\n const callee: any = node.expression;\n const calleeName = (callee?.kind === SyntaxKind.PropertyAccessExpression) ? callee.name?.text : undefined;\n if (typeof calleeName === 'string') {\n const list = index.get(calleeName) ?? [];\n list.push(node);\n index.set(calleeName, list);\n }\n }\n node.forEachChild(visit);\n };\n visit(file);\n this.goSameFileCallCache.set(file, index);\n }\n const checker = this.getChecker();\n const result = [];\n for (const call of (index.get(name) ?? [])) {\n let declaration;\n try {\n declaration = checker.getResolvedSignature(call)?.declaration?.resolve();\n } catch (e) {\n declaration = undefined;\n }\n if (declaration === fn) {\n result.push(call);\n }\n }\n return result;\n }\n\n // Lazily read the ts/src tree this file belongs to: the call sites of every\n // `this.x(...)`, each file's text and its class -> base map. A scoped run's\n // program holds one exchange, so the sibling files are only provable textually.\n goTsSrcTree(file): any {\n // drivers pass relative names (`ts/src/x.ts`): resolve so the marker and relativeOf match\n const fileName: string = path.resolve(file.fileName);\n const marker = '/ts/src/';\n const at = fileName.lastIndexOf(marker);\n if (at < 0) {\n return undefined; // in-memory source (tests): no sibling files to prove\n }\n const root = fileName.substring(0, at + marker.length - 1);\n if (!this.goTsSrcTreeCache.has(root)) {\n this.goTsSrcTreeCache.set(root, this.goTsSrcTreeBuild(root));\n }\n return this.goTsSrcTreeCache.get(root);\n }\n\n goTsSrcTreeBuild(root: string) {\n const callIndex = new Map>();\n const fileText = new Map();\n const classBases = new Map();\n const relativeOf = new Map();\n const walk = (dir: string, rel: string) => {\n let entries;\n try {\n entries = fs.readdirSync(dir, { withFileTypes: true });\n } catch (e) {\n return;\n }\n for (const entry of entries) {\n if (entry.isDirectory()) {\n if (entry.name !== 'node_modules') {\n walk(path.join(dir, entry.name), rel + entry.name + '/');\n }\n continue;\n }\n if (!entry.name.endsWith('.ts') || entry.name.endsWith('.d.ts')) {\n continue;\n }\n const relPath = rel + entry.name;\n let text;\n try {\n text = fs.readFileSync(path.join(dir, entry.name), 'utf8');\n } catch (e) {\n continue;\n }\n fileText.set(relPath, text);\n relativeOf.set(path.join(dir, entry.name), relPath);\n const classRe = /\\bclass\\s+([A-Za-z_$][\\w$]*)\\s+extends\\s+([A-Za-z_$][\\w$]*)/g;\n let match;\n while ((match = classRe.exec(text)) !== null) {\n classBases.set(match[1], match[2]);\n }\n const callRe = /this\\s*\\.\\s*([A-Za-z_$][\\w$]*)\\s*\\(/g;\n while ((match = callRe.exec(text)) !== null) {\n const args = goBalancedCallArgs(text, callRe.lastIndex - 1);\n if (args === undefined) {\n continue;\n }\n const list = callIndex.get(match[1]) ?? [];\n list.push({ file: relPath, args });\n callIndex.set(match[1], list);\n }\n }\n };\n walk(root, '');\n return { callIndex, fileText, classBases, relativeOf };\n }\n\n goTsSrcFileDerivesFrom(tree, file: string, className: string | undefined): boolean {\n if (className === undefined) {\n return true; // unknown owner: keep the reference inside the proof\n }\n const text = tree.fileText.get(file);\n if (text === undefined) {\n return true;\n }\n const classRe = /\\bclass\\s+([A-Za-z_$][\\w$]*)/g;\n let match;\n while ((match = classRe.exec(text)) !== null) {\n let current: string | undefined = match[1];\n for (let hops = 0; (hops < 12) && (current !== undefined); hops++) {\n if (current === className) {\n return true;\n }\n current = tree.classBases.get(current);\n }\n }\n return false;\n }\n\n // the textual call-site proof. `*string` is the only pointer-shaped native type\n // with siblings the printer can name from text; a map/slice parameter is proven for\n // the argument shapes whose printed Go form IS that type: the object/array literals\n goTextArgMatchesType(argText: string, goType: string, file: string, tree): boolean {\n let text = (argText ?? '').trim();\n while (text.startsWith('(') && text.endsWith(')')) {\n text = text.substring(1, text.length - 1).trim();\n }\n const isStringProducer = (candidate: string) => GO_TS_SRC_STRING_PRODUCERS.some(rx => rx.test(candidate));\n const localDeclaredFrom = (name: string, accept: (init: string) => boolean) => {\n const fileText = tree.fileText.get(file) ?? '';\n const declRe = new RegExp('(?:const|let|var)\\\\s+' + name + '\\\\s*(?::[^=]*)?=\\\\s*([^;\\\\n]+)');\n const match = declRe.exec(fileText);\n return (match !== null) && accept(match[1].trim());\n };\n if (goType === 'string') {\n return /^(?:'[^'\\\\]*'|\"[^\"\\\\]*\")$/.test(text); // a sibling file proves only a plain literal\n }\n if (goType === '*string') {\n if (isStringProducer(text)) {\n return true;\n }\n const identifier = /^([A-Za-z_$][\\w$]*)$/.exec(text);\n if (identifier !== null) {\n return localDeclaredFrom(identifier[1], isStringProducer);\n }\n }\n if ((goType === 'map[string]any') || (goType === '[]any')) {\n // Only the argument shapes whose printed Go form IS this map/slice: the\n // matching literal and the printer's own map producers. An identifier is\n // deliberately not proven here: this proof reads one file's text, so it\n const isMap = goType === 'map[string]any';\n const literal = isMap ? '{' : '[';\n const producers = isMap ? GO_TS_SRC_MAP_PRODUCERS : [];\n return text.startsWith(literal) || producers.some(rx => rx.test(text));\n }\n return false;\n }\n\n // the Go type this identifier is actually *declared* with, or undefined when it\n // stays `any`. It goes through getGoLocalType, not goTypeOfInitializer, so a\n // declaration the reject filters demoted back to `any` is reported as `any` here\n // too — otherwise we would emit `*x` against an `any` box.\n // A parameter resolves to its declared Go type only when goNativeParameterType\n // proved it (see the B-02 block above); everything else stays `any`.\n //\n // getGoLocalType re-prints every reassignment's right-hand side, and printing a\n // ternary re-enters printCondition, which lands back here: `x = (x === 'a') ? …`\n // would recurse forever. The in-progress set breaks that cycle by answering\n // `any` for the declaration currently being classified, and the cache keeps the\n // per-occurrence cost at one scope scan per declaration.\n goDeclaredTypeCache = new Map();\n goDeclaredTypeInProgress = new Set();\n\n goDeclaredTypeOfIdentifier(node): string | undefined {\n if (node?.kind !== SyntaxKind.Identifier) {\n return undefined;\n }\n const decl: any = this.checkerOrUndefined()?.getSymbolAtLocation(node)?.valueDeclaration?.resolve();\n if (decl === undefined) {\n return undefined;\n }\n if (decl.kind === SyntaxKind.Parameter) {\n // a defaulted parameter bound through a pointer GetArg twin is that pointer at every consumer\n const bound = this.goGetArgParameterType(decl);\n if ((bound !== undefined) && bound.startsWith('*')) {\n return bound;\n }\n // B-02: a parameter the call-site proof typed prints its native Go type\n return this.goNativeParameterType(decl);\n }\n if (decl.kind !== SyntaxKind.VariableDeclaration || decl.initializer === undefined || decl.name?.kind !== SyntaxKind.Identifier) {\n return undefined;\n }\n if (this.goDeclaredTypeCache.has(decl)) {\n return this.goDeclaredTypeCache.get(decl);\n }\n if (this.goDeclaredTypeInProgress.has(decl)) {\n return undefined;\n }\n this.goDeclaredTypeInProgress.add(decl);\n let goType;\n try {\n goType = this.getGoLocalType(decl, this.printNode(decl.initializer, 0));\n } finally {\n this.goDeclaredTypeInProgress.delete(decl);\n }\n const result = (goType === 'any') ? undefined : goType;\n this.goDeclaredTypeCache.set(decl, result);\n return result;\n }\n\n // true when this identifier's Go type is a pointer we can deref (*string / *int64 / …)\n goIsPointerIdentifier(node): boolean {\n const goType = this.goDeclaredTypeOfIdentifier(node);\n return (typeof goType === 'string') && goType.startsWith('*');\n }\n\n // the Go pointer type an *expression* evaluates to, or undefined. Covers both a\n // local declared `var x *string = …` and a direct `this.SafeString(...)` call,\n // whose Go signature returns a pointer even though TypeScript says `string`.\n goPointerTypeOfExpression(node, printedText: string): string | undefined {\n const declared = this.goDeclaredTypeOfIdentifier(node);\n if ((typeof declared === 'string') && declared.startsWith('*')) {\n return declared;\n }\n // a hand-written BaseExchange field, e.g. `this.Markets`: its Go type is the one\n // go/v4/exchange.go declares, and the helpers turn a nil one into a nil\n if (node?.kind === SyntaxKind.PropertyAccessExpression) {\n const fieldType = GO_NILABLE_FIELDS_Typed[printedText];\n if ((typeof fieldType === 'string') && GO_NIL_EQUIVALENT_POINTER_TYPES_Native.has(fieldType)) {\n return fieldType;\n }\n }\n if (node?.kind === SyntaxKind.CallExpression) {\n const goType = this.goTypeOfInitializer(node, printedText);\n if ((typeof goType === 'string') && goType.startsWith('*')) {\n return goType;\n }\n }\n return undefined;\n }\n\n // the concrete Go type a `x[k] = v` receiver is declared with, when the printer\n // can name it: a local it typed itself, or a whole call whose Go return type it\n // knows. Everything else is an `any` box, and indexing an `any` in Go needs a\n // type assertion, so those keep the runtime helper.\n goElementAssignmentContainerType(node, printedText: string): string | undefined {\n const declared = this.goDeclaredTypeOfIdentifier(node);\n if ((declared === 'map[string]any') || (declared === '[]any')) {\n return declared;\n }\n if (node?.kind === SyntaxKind.CallExpression) {\n const known = this.goTypeOfInitializer(node, printedText);\n if ((known === 'map[string]any') || (known === '[]any')) {\n return known;\n }\n }\n return undefined;\n }\n\n // the Go container type of a hand-written `this.` receiver, undefined for every other\n // shape. Generated structs embed BaseExchange, so `this.` is the only property access the\n // field table types — a local or parameter of the same name is a different declaration.\n goFieldContainerTypeNative(node): string | undefined {\n if ((node?.kind !== SyntaxKind.PropertyAccessExpression) || (node.expression?.kind !== SyntaxKind.ThisKeyword)) {\n return undefined;\n }\n const name = node.name?.text;\n if (typeof name !== 'string') {\n return undefined;\n }\n return GO_FIELD_CONTAINER_TYPES_NATIVE[this.transformPropertyAccessExpressionName(name, node.name)];\n }\n\n // the printed key is a Go string when the printer knows it: a string literal, or\n // an identifier declared `string`. Params, GetValue(...) and string concatenation\n // all print as `any`, which Go refuses as a map key.\n goIsStringKeyExpression(node): boolean {\n if ((node.kind === SyntaxKind.StringLiteral) || (node.kind === SyntaxKind.NoSubstitutionTemplateLiteral)) {\n return true;\n }\n return this.goDeclaredTypeOfIdentifier(node) === 'string';\n }\n\n // `[]any` receivers only inline when the index is a literal the slice's own\n // literal initializer covers and nothing rebinds the local: the helper silently\n // ignores an out-of-range index, while Go panics on the assignment.\n goSliceIndexProvablyInRange(node, indexNode): boolean {\n if ((node?.kind !== SyntaxKind.Identifier) || (indexNode?.kind !== SyntaxKind.NumericLiteral)) {\n return false;\n }\n const index = Number(indexNode.text);\n if (!Number.isInteger(index) || (index < 0)) {\n return false;\n }\n const decl: any = this.checkerOrUndefined()?.getSymbolAtLocation(node)?.valueDeclaration?.resolve();\n if (decl === undefined || decl.kind !== SyntaxKind.VariableDeclaration || decl.name?.kind !== SyntaxKind.Identifier) {\n return false;\n }\n const initializer = decl.initializer;\n if ((initializer?.kind !== SyntaxKind.ArrayLiteralExpression) || (initializer.elements.length <= index)) {\n return false;\n }\n return !this.goLocalIsRebound(this.goEnclosingFunction(decl), decl.name);\n }\n\n // true when the local is rebound anywhere in its function; an element write\n // (`x[k] = v`) leaves the local itself bound, so only the slice header is at stake\n goLocalIsRebound(scope, nameNode): boolean {\n if (scope === undefined) {\n return true;\n }\n const name = nameNode.text;\n let rebound = false;\n const visit = (n) => {\n if (rebound) {\n return;\n }\n if ((n.kind === SyntaxKind.Identifier) && (n.text === name) && (n !== nameNode)) {\n if (this.goRebindingTargetOf(n) !== undefined) {\n rebound = true;\n return;\n }\n }\n n.forEachChild(visit);\n };\n visit(scope);\n return rebound;\n }\n\n // walks up from the identifier to the assignment it targets: `x = …` / `x += …` /\n // `[x, y] = …` / `for (x of …)` rebind the local, `x[k] = v` does not\n goRebindingTargetOf(identifier) {\n let node: any = identifier;\n let parent = node.parent;\n while (parent?.kind === SyntaxKind.ArrayLiteralExpression) {\n node = parent;\n parent = parent.parent;\n }\n if ((parent?.kind === SyntaxKind.ForOfStatement) && (parent.initializer === node)) {\n return parent;\n }\n if ((parent?.kind === SyntaxKind.BinaryExpression) && (parent.left === node)) {\n const op = parent.operatorToken.kind;\n if ((op === SyntaxKind.EqualsToken) || ((op >= SyntaxKind.FirstCompoundAssignment) && (op <= SyntaxKind.LastCompoundAssignment))) {\n return parent;\n }\n }\n return undefined;\n }\n\n // native `container[key] = value` when the receiver's Go type is proved by the\n // printer, otherwise undefined and the caller keeps the runtime helper\n printNativeElementAssignment(containerNode, containerStr: string, keyNode, keyStr: string, valueStr: string, compound = false, valueNode?): string | undefined {\n const containerType = this.goElementAssignmentContainerType(containerNode, containerStr);\n const fieldType = this.goFieldContainerTypeNative(containerNode);\n if ((fieldType !== undefined) || (containerType === 'map[string]any')) {\n if (!this.goIsStringKeyExpression(keyNode)) {\n return this.printNativeGuardedPointerKeyAssignment(containerNode, containerStr, containerType, fieldType, keyNode, keyStr, valueStr, compound, valueNode);\n }\n if (fieldType === '*sync.Map') {\n // a `+=` reads the element back through `container[key]`, which a\n // sync.Map has no operator for: that shape keeps the runtime helper\n return compound ? undefined : `${containerStr}.Store(${keyStr}, ${valueStr})`;\n }\n return `${containerStr}[${keyStr}] = ${valueStr}`;\n }\n if ((containerType === '[]any') && this.goSliceIndexProvablyInRange(containerNode, keyNode)) {\n return `${containerStr}[${keyStr}] = ${valueStr}`;\n }\n return undefined;\n }\n\n // `m[*k] = v` for a fresh unshared map local, a nil-guarded *string key and a\n // non-pointer value: exactly the helper's map branch minus its lock and derefs\n printNativeGuardedPointerKeyAssignment(containerNode, containerStr: string, containerType, fieldType, keyNode, keyStr: string, valueStr: string, compound: boolean, valueNode): string | undefined {\n if (compound || (fieldType !== undefined) || (containerType !== 'map[string]any') || (valueNode === undefined)) {\n return undefined;\n }\n if (this.goIsNilGuardedStringPointerKey(keyNode) && this.goIsFreshUnsharedMapLocal(containerNode, containerNode) && this.goIsNonPointerValue(valueNode)) {\n return `${containerStr}[*${keyStr}] = ${valueStr}`;\n }\n return undefined;\n }\n\n // a `*string` local the enclosing control flow proves non-nil: the helper's deref\n // yields the same string key (a nil key would have made it a no-op)\n goIsNilGuardedStringPointerKey(keyNode): boolean {\n return (keyNode?.kind === SyntaxKind.Identifier) && (this.goDeclaredTypeOfIdentifier(keyNode) === '*string')\n && this.goHasEnclosingNilGuard(keyNode);\n }\n\n // a local bound once to an object literal, never read by a nested function and not handed\n // out (anything but `m[k]`) before this write: no other goroutine can hold the map yet\n goIsFreshUnsharedMapLocal(node, writeSite): boolean {\n if (node?.kind !== SyntaxKind.Identifier) {\n return false;\n }\n const decl: any = this.checkerOrUndefined()?.getSymbolAtLocation(node)?.valueDeclaration?.resolve();\n if ((decl?.kind !== SyntaxKind.VariableDeclaration) || (decl.name?.kind !== SyntaxKind.Identifier)\n || (decl.initializer?.kind !== SyntaxKind.ObjectLiteralExpression)) {\n return false;\n }\n const scope = this.goEnclosingFunction(decl);\n if ((scope === undefined) || (scope.kind === SyntaxKind.SourceFile) || this.goLocalIsRebound(scope, decl.name)) {\n return false;\n }\n const symbol = this.checkerOrUndefined()?.getSymbolAtLocation(decl.name);\n let captured = false;\n const visit = (n, nested: boolean) => {\n if (captured) {\n return;\n }\n if ((n.kind === SyntaxKind.Identifier) && (n !== decl.name) && (n.text === decl.name.text)\n && (this.checkerOrUndefined()?.getSymbolAtLocation(n) === symbol)) {\n const receiver = (n.parent?.kind === SyntaxKind.ElementAccessExpression) && (n.parent.expression === n);\n if (nested || (!receiver && this.goUseMayPrecede(n, writeSite, scope))) {\n captured = true;\n }\n return;\n }\n const inner = nested || isFunctionLike(n);\n n.forEachChild((c) => visit(c, inner));\n };\n scope.forEachChild((c) => visit(c, false));\n return !captured;\n }\n\n // the use runs before the write: earlier in the text, or both inside one loop body\n goUseMayPrecede(use, writeSite, scope): boolean {\n if (use.pos < writeSite.pos) {\n return true;\n }\n for (let n = writeSite.parent; (n !== undefined) && (n !== scope); n = n.parent) {\n if (GO_ITERATION_STATEMENT_KINDS.has(n.kind) && (use.pos >= n.pos) && (use.end <= n.end)) {\n return true;\n }\n }\n return false;\n }\n\n // the value's printed Go type is concrete and not a pointer, so the helper's derefScalar\n // leaves it unchanged; an `any` box or a pointer keeps the helper\n goIsNonPointerValue(valueNode): boolean {\n const inner = this.goUnwrapParenthesizedNode(valueNode);\n switch (inner?.kind) {\n case SyntaxKind.StringLiteral:\n case SyntaxKind.NoSubstitutionTemplateLiteral:\n case SyntaxKind.TrueKeyword:\n case SyntaxKind.FalseKeyword:\n case SyntaxKind.ObjectLiteralExpression:\n case SyntaxKind.ArrayLiteralExpression:\n return true;\n }\n if (inner === undefined) {\n return false;\n }\n const goType = this.goPrintedTypeOfExpression(inner, this.printNode(inner, 0));\n return (typeof goType === 'string') && (goType !== 'any') && !goType.startsWith('*');\n }\n\n // the concrete Go type an *expression* is printed as: a local's declared type,\n // the return type of a runtime helper call, or a literal. undefined when the value\n // stays inside an `any` box — a native Go operation on an `any` box would not\n // compile, so every rule below falls back to its helper in that case.\n goPrintedTypeOfExpression(node, printedText: string): string | undefined {\n const inner = (node?.kind === SyntaxKind.ParenthesizedExpression) ? node.expression : node;\n if (inner?.kind === SyntaxKind.Identifier) {\n return this.goDeclaredTypeOfIdentifier(inner);\n }\n return this.goTypeOfInitializer(inner, printedText);\n }\n\n // `x.length` on a value the printer declares as a slice is `len(x)`: Go's len is\n // 0 for a nil slice, exactly like GetArrayLength's `[]T` cases. On a map or an\n // `any` box GetArrayLength answers 0, so only a `[]`-typed value may inline —\n // and only for the slice types the helper itself counts (a []byte would answer 0).\n sliceLengthTypes = [ '[]any', '[]string', '[]int64', '[]float64', '[]bool', '[]int', '[][]any', '[]map[string]any' ];\n\n // hand-written BaseExchange fields (go/v4/exchange.go) whose Go type is one of the\n // slice types above: the struct value is never a nil pointer and len(field) is the\n // very value the helper's type switch returns for it.\n GO_NATIVE_LENGTH_FIELDS = [ 'Symbols' ];\n\n printInlineArrayLength(expression, printedText: string, lengthNode?): string | undefined {\n if (printedText.includes('\\n')) {\n return undefined;\n }\n const goType = this.goPrintedTypeOfExpression(expression, printedText);\n if ((typeof goType === 'string') && this.sliceLengthTypes.indexOf(goType) >= 0) {\n return `len(${printedText})`;\n }\n if (this.goLengthFeedsArithmeticClassifier(lengthNode)) {\n return undefined;\n }\n // a Go `string` counts its bytes in both helpers (GetLength's reflect.String\n // case, GetArrayLength's `case string`), and neither helper's nil/`any` branch\n // is reachable for it; a *string / any box keeps the helper it prints today\n if ((goType === 'string') || (this.goNativeLengthFieldType(printedText) !== undefined)) {\n return `len(${printedText})`;\n }\n return undefined;\n }\n\n // the hand-written struct type of a `this.` read, for fields declared as a slice the\n // length helpers count. Any other type (map / *sync.Map / interface{}) keeps the helper:\n // GetArrayLength answers 0 for those, while len would answer the real count.\n goNativeLengthFieldType(printedText: string): string | undefined {\n const match = /^this\\.([A-Za-z_]\\w*)$/.exec(this.goUnwrapPrintedParens(printedText));\n if (match === null || this.GO_NATIVE_LENGTH_FIELDS.indexOf(match[1]) < 0) {\n return undefined;\n }\n return '[]string';\n }\n\n // true when the `.length` sits inside a `-`, `*`, `/` or `%` chain. The ccxt-side classifier\n // (build/go-local-types.js, CCXT_GO_INT_OPERAND_CALLEES) names `GetArrayLength(`/`GetLength(` an\n // `int` operand, so inlining `len` would declassify the chain's int64 local and `.(int64)` unbox.\n goLengthFeedsArithmeticClassifier(lengthNode): boolean {\n let current = lengthNode?.parent;\n for (let i = 0; (i < 16) && (current !== undefined); i++) {\n if (current.kind === SyntaxKind.BinaryExpression) {\n const op = current.operatorToken?.kind;\n if ((op === SyntaxKind.MinusToken) || (op === SyntaxKind.AsteriskToken)\n || (op === SyntaxKind.SlashToken) || (op === SyntaxKind.PercentToken)) {\n return true;\n }\n }\n switch (current.kind) {\n case SyntaxKind.ExpressionStatement:\n case SyntaxKind.VariableStatement:\n case SyntaxKind.ReturnStatement:\n case SyntaxKind.IfStatement:\n case SyntaxKind.Block:\n case SyntaxKind.ForStatement:\n case SyntaxKind.WhileStatement:\n case SyntaxKind.MethodDeclaration:\n case SyntaxKind.FunctionDeclaration:\n case SyntaxKind.ArrowFunction:\n return false;\n }\n current = current.parent;\n }\n return false;\n }\n\n // Go has no ternary operator. The func literal returns the same branch value the\n // helper would and prints the condition the same way; it evaluates only the branch\n // TypeScript would take, while Ternary receives both already evaluated. Both arms\n // printing as one and the same Go scalar names it (`func() string`), so the literal\n // carries the value itself instead of an `any` box.\n printInlineTernary(condition: string, whenTrue: string, whenFalse: string, resultType: string = undefined): string | undefined {\n if (condition.includes('\\n')) {\n return undefined;\n }\n // go/printer never keeps a func literal whose body holds an `if` on one line, and\n // controlClause() strips the parentheses around the `if` condition; the body sits one\n // level below the statement the literal belongs to, `}()` at the statement's level\n const level = this.goStatementLevel;\n const body = this.getIden(level + 1);\n const branch = this.getIden(level + 2);\n return `func() ${resultType ?? 'any'} {\\n${body}if ${this.goStripControlClauseParens(condition)} {\\n${branch}return ${whenTrue}\\n${body}}\\n${body}return ${whenFalse}\\n${this.getIden(level)}}()`;\n }\n\n // the Go scalar an arm already prints a VALUE of, or undefined while the arm is an `any` box.\n // Only the printed text counts: a literal, a local declared with that type, or a call whose Go\n // signature returns it. A classifier-named box (`Subtract(...)`) cannot be carried by `return`.\n goTernaryArmType(node, printedText: string): string | undefined {\n const text = this.goUnwrapPrintedParens(printedText);\n const inner = (node?.kind === SyntaxKind.ParenthesizedExpression) ? node.expression : node;\n switch (inner?.kind) {\n case SyntaxKind.StringLiteral:\n case SyntaxKind.NoSubstitutionTemplateLiteral:\n return 'string';\n case SyntaxKind.TrueKeyword:\n case SyntaxKind.FalseKeyword:\n return 'bool';\n case SyntaxKind.NumericLiteral:\n // an integer literal is an untyped constant of Go default type `int`; a\n // fraction/exponent makes it a float64 constant\n if (/^[0-9]+$/.test(inner.text)) {\n return 'int';\n }\n return (/^[0-9]*\\.[0-9]+([eE][+-]?[0-9]+)?$/.test(inner.text) || /^[0-9]+[eE][+-]?[0-9]+$/.test(inner.text)) ? 'float64' : undefined;\n case SyntaxKind.Identifier:\n return this.goLocalStaticType(inner); // declared `var x T = …` (never `:=`)\n }\n // a nested ternary prints the printer's own typed literal, whose return type is\n // the arm's type as well\n const literalType = goFuncLiteralReturnType(text);\n if (literalType !== undefined) {\n return literalType;\n }\n const open = text.indexOf('(');\n if (open <= 0 || !this.isWholePrintedCall(text, open)) {\n return undefined;\n }\n const goType = GO_HELPER_RETURN_TYPES[text.substring(0, open)];\n return ((goType === undefined) || goType.startsWith('*')) ? undefined : goType;\n }\n\n // the one Go scalar both arms print as, or undefined when the literal keeps the `any`\n // box: only GO_TYPE_NAMES are nameable, and a pointer/`any` arm (or two different\n // types) is not a type the literal could return\n goTernaryResultType(whenTrueNode, whenTrue: string, whenFalseNode, whenFalse: string): string | undefined {\n const whenTrueType = this.goTernaryArmType(whenTrueNode, whenTrue);\n if ((typeof whenTrueType !== 'string') || (whenTrueType === 'any') || (GO_TYPE_NAMES.indexOf(whenTrueType) < 0)) {\n return undefined;\n }\n return (this.goTernaryArmType(whenFalseNode, whenFalse) === whenTrueType) ? whenTrueType : undefined;\n }\n\n // stripParens() applied to a printed condition text (see goControlClauseParens)\n goStripControlClauseParens(text: string): string {\n for (;;) {\n const inner = this.goEnclosedExpression(text);\n if (inner === undefined) {\n return text;\n }\n text = inner;\n }\n }\n\n // a multi-line branch (a nested ternary, a composite literal) is laid out relative to\n // the `return` statement that holds it: inside the `if` for whenTrue (two levels below\n // the statement), the literal's body for whenFalse (one level)\n goPrintTernaryBranch(node, levels: number) {\n const previousLevel = this.goStatementLevel;\n this.goStatementLevel = previousLevel + levels;\n try {\n return this.goWithExprDepth(1, () => this.printNode(node, 0));\n } finally {\n this.goStatementLevel = previousLevel;\n }\n }\n\n // `key in obj` on a Go map[string]any with a Go string key: the two-value read is a statement,\n // hence the func literal; present-but-nil is ok=true like InOp. A `*string` key derefs, nil\n // answering false. InOp also covers nil/number keys and sync.Map/orderbook receivers: else keep it.\n printInlineInOp(dictNode, keyNode, dictText: string, keyText: string): string | undefined {\n if (dictText.includes('\\n') || keyText.includes('\\n')) {\n return undefined;\n }\n if (this.goPrintedTypeOfExpression(dictNode, dictText) !== 'map[string]any') {\n return undefined;\n }\n if (this.goPrintedTypeOfExpression(keyNode, keyText) !== 'string') {\n // InOp runs derefScalar over both operands: a `*string` key is the pointed-to\n // string, and a nil pointer is a nil key, i.e. false. Only an identifier may be\n // repeated by the guard — any other expression would be evaluated twice.\n if ((keyNode?.kind !== SyntaxKind.Identifier) || (this.goDeclaredTypeOfIdentifier(keyNode) !== '*string')) {\n return undefined;\n }\n const level = this.goStatementLevel;\n const body = this.getIden(level + 1);\n return `func() bool {\\n${body}if ${keyText} == nil {\\n${this.getIden(level + 2)}return false\\n${body}}\\n${body}_, ok := ${dictText}[*${keyText}]\\n${body}return ok\\n${this.getIden(level)}}()`;\n }\n // funcBody() keeps the literal on one line while `func() bool` (11 columns) plus\n // the two statements and their `; ` separator fit in 100 columns\n const read = `_, ok := ${dictText}[${keyText}]`;\n if (11 + read.length + 2 + 'return ok'.length <= 100) {\n return `func() bool { ${read}; return ok }()`;\n }\n const level = this.goStatementLevel;\n return `func() bool {\\n${this.getIden(level + 1)}${read}\\n${this.getIden(level + 1)}return ok\\n${this.getIden(level)}}()`;\n }\n\n // comparison helpers that normalize int/int64/float64 against each other, so a\n // literal operand's Go default type (int) behaves like the int64 OpNeg produces\n comparisonHelpers = [ 'IsEqual', 'IsGreaterThan', 'IsLessThan', 'IsGreaterThanOrEqual', 'IsLessThanOrEqual' ];\n\n // OpNeg boxes `-val.Int()` / `-val.Float()`, i.e. an int64 or a float64, and nil\n // for anything else. `-x` reproduces that exactly only for an operand that already\n // prints as float64/int64; a Go `int` (or an integer literal) boxes as int instead.\n printInlineOpNeg(node, printedText: string): string | undefined {\n if (printedText.includes('\\n')) {\n return undefined;\n }\n const goType = this.goPrintedTypeOfExpression(node.operand, printedText);\n if ((goType === 'float64') || (goType === 'int64')) {\n return `-${printedText}`;\n }\n // a fractional/exponent literal is already a Go float64 constant; an integer\n // literal is only interchangeable where the consumer normalizes the number\n if (/^\\d+(\\.\\d+)?([eE][+-]?\\d+)?$/.test(printedText.trim())) {\n if (printedText.includes('.') || /[eE]/.test(printedText)) {\n return `-${printedText}`;\n }\n const parent = node.parent;\n if (parent?.kind === SyntaxKind.CallExpression) {\n const callee = this.printNode(parent.expression, 0);\n if (this.comparisonHelpers.indexOf(callee) >= 0) {\n return `-${printedText}`;\n }\n }\n // `a > -1` prints as IsGreaterThan(a, …); the relational wrappers all\n // normalise int/int64/float64 the same way the equality helpers do\n if (parent?.kind === SyntaxKind.BinaryExpression) {\n const op = parent.operatorToken.kind;\n if ((op === SyntaxKind.GreaterThanToken) || (op === SyntaxKind.GreaterThanEqualsToken)\n || (op === SyntaxKind.LessThanToken) || (op === SyntaxKind.LessThanEqualsToken)) {\n return `-${printedText}`;\n }\n }\n }\n return undefined;\n }\n\n // JS truthiness of an operand whose Go type the printer knows, expressed with\n // plain Go instead of boxing the value into `EvalTruthy(any)`. Each arm mirrors the\n // matching `EvalTruthy` case exactly, including nil (a nil *T and a nil map are\n // both falsy) — so this is the same predicate, minus the interface round-trip.\n printInlineTruthy(node): string | undefined {\n // every pointer/slice arm below repeats the operand, so only an identifier\n // qualifies; inlining a call would evaluate it twice\n if (node?.kind !== SyntaxKind.Identifier) {\n return undefined;\n }\n const goType = this.goDeclaredTypeOfIdentifier(node);\n if (goType === undefined) {\n return undefined;\n }\n const text = this.printNode(node, 0);\n switch (goType) {\n case 'bool':\n return text;\n case 'string':\n return `(${text} != \"\")`;\n case 'int':\n case 'int64':\n case 'float64':\n return `(${text} != 0)`;\n case '*bool':\n return `(${text} != nil && *${text})`;\n case '*string':\n return `(${text} != nil && *${text} != \"\")`;\n case '*int':\n case '*int64':\n case '*float64':\n return `(${text} != nil && *${text} != 0)`;\n case '[]string':\n case '[]any':\n case 'map[string]any':\n return `(len(${text}) > 0)`;\n }\n return undefined;\n }\n\n // an `any` box the checker proves can only hold a bool or nil — a `boolean`\n // local whose Go declaration stayed `any` (a later write the printer cannot\n // type, e.g. a tuple read) — is what `EvalTruthy` reduces to: nil and `false`\n printInlineBoolBoxTruthy(node): string | undefined {\n if (this.goScalarFamilyWithNil(node) !== 'bool') {\n return undefined;\n }\n let declaration;\n try {\n declaration = this.getChecker().getSymbolAtLocation(node)?.valueDeclaration?.resolve();\n } catch (e) {\n return undefined;\n }\n if (declaration?.kind !== SyntaxKind.VariableDeclaration && !this.goGetArgBoundParameter(node)) {\n return undefined; // a plain parameter keeps the caller's box untouched\n }\n const text = this.printNode(node, 0);\n if (!this.goIsAnyBoxExpression(node, text)) {\n return undefined;\n }\n return `(${text} == true)`;\n }\n\n // `EvalTruthy(this.SafeBool(…))`: the accessor's Go signature returns a `*bool`,\n // nil for an absent flag and the flag otherwise — exactly the two states\n // `derefScalar` hands the helper — so the predicate is `x != nil && *x`.\n printInlineBoolPointerTruthy(node, printedText: string): string | undefined {\n if (node?.kind !== SyntaxKind.CallExpression) {\n return undefined;\n }\n if (GO_PURE_BOOL_ACCESSORS.indexOf(this.goPrintedCallee(printedText) as string) < 0) {\n return undefined;\n }\n // the pointer is dereferenced twice, so every argument has to be a plain read\n if (!node.arguments.every((argument) => this.goIsRepeatSafePointerArgument(argument))) {\n return undefined;\n }\n return `(${printedText} != nil && *${printedText})`;\n }\n\n // an argument the two halves of a pointer deref may read twice: a plain\n // identifier/literal read, or a `this.` read of the exchange instance\n goIsRepeatSafePointerArgument(node): boolean {\n while (node?.kind === SyntaxKind.ParenthesizedExpression) {\n node = node.expression;\n }\n if (this.goIsReadOnlyCallArgument(node)) {\n return true;\n }\n return (node?.kind === SyntaxKind.PropertyAccessExpression)\n && (node.expression?.kind === SyntaxKind.ThisKeyword)\n && (node.name?.kind === SyntaxKind.Identifier);\n }\n\n // the native Go text for a condition operand the printer can type, or undefined\n // when the operand has to go through the truthiness helper. `(x)` is decided on\n // its operand and keeps the source parentheses, so the surrounding operator still\n // parses exactly the same way.\n goNativeCondition(node): string | undefined {\n if (node?.kind === SyntaxKind.Identifier) {\n return this.printInlineTruthy(node) ?? this.printInlineBoolBoxTruthy(node);\n }\n if (node?.kind === SyntaxKind.ParenthesizedExpression) {\n const inner = this.goNativeCondition(node.expression);\n if (inner === undefined) {\n return undefined;\n }\n return (inner.startsWith('(') && this.isWholePrintedCall(inner, 0)) ? inner : `(${inner})`;\n }\n // an expression that already prints a Go `bool` needs no EvalTruthy round-trip:\n // `a || b`, `!x`, `a === b` and the Is*/Precise.String* predicates are all\n // bool-typed, so `EvalTruthy()` is the identity function on them\n const printed = this.printNode(node, 0);\n const pointerTruthy = this.printInlineBoolPointerTruthy(node, printed);\n if (pointerTruthy !== undefined) {\n return pointerTruthy;\n }\n if (this.goTypeOfInitializer(node, printed) === 'bool') {\n return printed;\n }\n // a predicate the printer folds to a constant — IsArray on a proven slice or map —\n // prints a Go bool that the probe above cannot name\n if ((node?.kind === SyntaxKind.CallExpression) && ((printed === 'true') || (printed === 'false'))) {\n return printed;\n }\n if (GO_BOOL_FIELDS.has(printed)) {\n return printed;\n }\n // a hand-written bool-returning base method already prints a Go bool\n const callee = this.goPrintedCallee(printed);\n return (callee !== undefined && GO_BOOL_CALL_NAMES_NATIVE.indexOf(callee) >= 0) ? printed : undefined;\n }\n\n\n // gofmt prints the condition of every `if`/`for`/`switch` through\n // go/printer/nodes.go controlClause() -> stripParens(): the single outermost,\n // fully enclosing parentheses pair is dropped, and the rule applies again to the\n // enclosed expression while that one is parenthesized as well\n // (`if (x == 1) {` -> `if x == 1 {`, `if ((x == 1)) {` -> `if x == 1 {`).\n // Parentheses survive when the enclosed expression holds an unparenthesized\n // composite literal whose type is a type name, because `if T{} == x {` does not\n // parse. The printer emits text instead of an ast.Expr, so stripParens runs over\n // the printed condition text here.\n goControlClauseParens(node, expression: string): string {\n return this.goIsControlClauseCondition(node) ? this.goStripControlClauseParens(expression) : expression;\n }\n\n // the expression inside the outermost parentheses pair of `text`, or undefined\n // when `text` is not one fully enclosing pair or gofmt keeps that pair\n goEnclosedExpression(text: string): string | undefined {\n const trimmed = text.trim();\n if (!trimmed.startsWith('(') || !trimmed.endsWith(')')) {\n return undefined;\n }\n // `(a) && (b)` opens and closes with a parenthesis, but not the same pair\n if (this.goSkipBalanced(trimmed, 0, '(', ')') !== trimmed.length) {\n return undefined;\n }\n const inner = trimmed.substring(1, trimmed.length - 1).trim();\n if (this.goHasTypeNameCompositeLiteral(inner)) {\n return undefined; // stripParens keeps parentheses protecting a literal\n }\n return inner;\n }\n\n // the expression a Go `if`/`for`/`switch` statement tests, the only positions\n // gofmt's controlClause() rewrites\n goIsControlClauseCondition(node): boolean {\n const parent = node?.parent;\n switch (parent?.kind) {\n case SyntaxKind.IfStatement:\n case SyntaxKind.WhileStatement:\n case SyntaxKind.SwitchStatement:\n return parent.expression === node;\n case SyntaxKind.ForStatement:\n return parent.condition === node;\n }\n return false;\n }\n\n // stripParens' ast.Inspect stops at nested parentheses, which protect whatever\n // they enclose, and reports a composite literal whenever its type is a type name\n goHasTypeNameCompositeLiteral(text: string): boolean {\n let index = 0;\n while (index < text.length) {\n const char = text[index];\n if ((char === '\"') || (char === '`') || (char === '\\'')) {\n index = this.goSkipQuoted(text, index);\n continue;\n }\n if ((char === '(') || (char === '{')) {\n if ((char === '{') && this.goCompositeLitHasTypeName(text, index)) {\n return true;\n }\n const next = this.goSkipBalanced(text, index, char, (char === '(') ? ')' : '}');\n if (next < 0) {\n return false; // unbalanced text cannot be inspected any further\n }\n index = next;\n continue;\n }\n index += 1;\n }\n return false;\n }\n\n // `{` opens a composite literal whose type is a type name when the text in front\n // of it is an ident or a selector chain of idents; `map[string]any{` and `[]any{`\n // are type literals and do not count (isTypeName in go/printer/nodes.go)\n goCompositeLitHasTypeName(text: string, braceIndex: number): boolean {\n let start = braceIndex;\n while (start > 0 && /[A-Za-z0-9_.[\\]]/.test(text[start - 1])) {\n start -= 1;\n }\n const typeText = text.substring(start, braceIndex).trim();\n if (['map', 'struct', 'interface', 'func', 'chan'].indexOf(typeText) >= 0) {\n return false;\n }\n return /^[A-Za-z_]\\w*(\\.[A-Za-z_]\\w*)*$/.test(typeText);\n }\n\n // the index right after the bracket closing the one at `start`, or -1 when the\n // brackets are unbalanced (the printer sees statement fragments, not whole files)\n goSkipBalanced(text: string, start: number, open: string, close: string): number {\n let depth = 0;\n let index = start;\n while (index < text.length) {\n const char = text[index];\n if ((char === '\"') || (char === '`') || (char === '\\'')) {\n index = this.goSkipQuoted(text, index);\n continue;\n }\n if (char === open) {\n depth += 1;\n } else if (char === close) {\n depth -= 1;\n if (depth === 0) {\n return index + 1;\n }\n }\n index += 1;\n }\n return -1;\n }\n\n // the index right after the string, rune or raw string literal opening at `start`\n goSkipQuoted(text: string, start: number): number {\n const quote = text[start];\n let index = start + 1;\n while (index < text.length) {\n const char = text[index];\n if ((char === '\\\\') && (quote !== '`')) {\n index += 2;\n continue;\n }\n if (char === quote) {\n return index + 1;\n }\n index += 1;\n }\n return text.length;\n }\n\n // gofmt keeps a comment group that the source separates from the following\n // declaration by a blank line as a free-standing comment; joined to it, it becomes\n // the declaration's doc comment and its indented lines are re-laid out as a code\n // block. The blank line is preserved so the emitted text keeps the source's shape.\n printLeadingComments(node, identation) {\n const printed = super.printLeadingComments(node, identation);\n if (printed.length === 0) {\n return printed;\n }\n const fullText = this.getSrc().getFullText();\n const ranges = getLeadingCommentRanges(fullText, node.pos) ?? [];\n const last = ranges[ranges.length - 1];\n if (last === undefined) {\n return printed;\n }\n const gap = fullText.slice(last.end, node.getStart());\n const detached = (gap.match(/\\n/g) ?? []).length > 1;\n return detached ? printed + \"\\n\" : printed;\n }\n\n // level of the statement being printed: a multi-line composite literal is laid out\n // relative to it (go/printer), whatever level the expression printers hand down\n goStatementLevel = 0;\n\n // stdlib packages this file's native emissions call; printSourceFileStatements turns them\n // into the import declarations the emitted Go needs (an occurrence outside a file print,\n // e.g. the intellisense body, only marks a set that the next file print replaces)\n goFileStdlibImports = new Set();\n\n // gofmt separates a top-level declaration that carries a comment from the previous\n // declaration by a blank line (go/printer declList: min = 2 when the decl has a doc\n // comment); the file members are joined with a bare newline otherwise\n printSourceFileStatements(node, identation): string {\n const outerImports = this.goFileStdlibImports;\n const fileImports = new Set();\n this.goFileStdlibImports = fileImports;\n let body = '';\n try {\n const printed = node.statements.map((m) => this.printNode(m, identation + 1)).filter((st) => st.length > 0);\n body = printed.map((st, index) => (index > 0 && /^\\s*(\\/\\/|\\/\\*)/.test(st)) ? \"\\n\" + st : st).join(\"\\n\") + \"\\n\".repeat(this.NUM_LINES_END_FILE);\n } finally {\n this.goFileStdlibImports = outerImports;\n }\n if (fileImports.size === 0) {\n return body;\n }\n // a native emission needs its stdlib package, and an import declaration must precede\n // every other declaration: the file assembly puts this text right behind the generated\n // header, so the imports lead it (gofmt keeps an import clause before the first decl)\n return [...fileImports].sort().map((path) => `import \"${path}\"`).join(\"\\n\") + \"\\n\\n\" + body;\n }\n\n goBinaryMemoized(node, key: string, compute: () => T): T {\n const outermost = this.goBinaryMemo === undefined;\n const memo = this.goBinaryMemo ??= new Map();\n try {\n let byKey = memo.get(node);\n if (byKey?.has(key)) {\n const cached = byKey.get(key);\n return cached;\n }\n const value = compute();\n if (byKey === undefined) {\n memo.set(node, byKey = new Map());\n }\n byKey.set(key, value);\n return value;\n } finally {\n if (outermost) {\n this.goBinaryMemo = undefined;\n }\n }\n }\n\n // the printer state a binary print reads besides the node: depth, level and the recursion guards\n goBinaryContextKey(): string {\n return `${this.goExprDepth}|${this.goStatementLevel}|${this.goLocalTypeResolution.size}|${this.goDeclaredTypeInProgress.size}`;\n }\n\n goPrintBinaryMemoized(node, identation: number): string {\n const key = `print|${this.goBinaryContextKey()}|${identation}`;\n return this.goBinaryMemoized(node, key, () => this.goControlClauseParens(node, super.printNode(node, identation)));\n }\n\n printNode(node, identation = 0): string {\n if (node !== undefined && isSourceFile(node)) {\n this.className = \"undefined\";\n return this.printSourceFileStatements(node, identation);\n }\n if (node?.kind === SyntaxKind.BinaryExpression && GO_ARITHMETIC_KINDS.indexOf(node.operatorToken.kind) >= 0) {\n return this.goPrintBinaryMemoized(node, identation);\n }\n const isStatement = node !== undefined && isStatementNode(node) && node.kind !== SyntaxKind.Block;\n const previousLevel = this.goStatementLevel;\n if (isStatement) {\n this.goStatementLevel = identation;\n }\n try {\n const printed = super.printNode(node, identation);\n // the if/for/switch conditions go through here (printCondition resolves the\n // bool and the falsy/truthy paths before printing the node's text)\n return this.goControlClauseParens(node, printed);\n } finally {\n this.goStatementLevel = previousLevel;\n }\n }\n\n // composite literal body one level deeper than the statement, closing brace at the\n // statement's level; the leading indentation belongs to the enclosing printer\n printObjectLiteralExpression(node, identation) {\n const level = this.goStatementLevel;\n const objectBody = this.printObjectLiteralBody(node, level);\n const formattedObjectBody = objectBody ? \"\\n\" + objectBody + \"\\n\" + this.getIden(level) : objectBody;\n return this.OBJECT_OPENING + formattedObjectBody + this.OBJECT_CLOSING;\n }\n\n printCondition(node, identation) {\n // `!x` is handled by printPrefixUnaryExpression, which calls back into this\n // method with the operand; let the base class keep that recursion intact\n const native = this.goNativeCondition(node);\n if (native !== undefined) {\n // goNativeCondition prints the operand itself, so the control-clause\n // parens of printNode do not see the parentheses it wraps it in\n return `${this.getIden(identation)}${this.goControlClauseParens(node, native)}`;\n }\n // a native `key in obj` prints as a `func() bool` call, which the type probe\n // above cannot name; it is a Go bool all the same\n const inNode = (node?.kind === SyntaxKind.ParenthesizedExpression) ? node.expression : node;\n if (inNode?.kind === SyntaxKind.BinaryExpression && inNode.operatorToken.kind === SyntaxKind.InKeyword) {\n const inlined = this.printInlineInOp(inNode.right, inNode.left, this.printNode(inNode.right, 0), this.printNode(inNode.left, 0));\n if (inlined !== undefined) {\n const text = (inNode === node) ? inlined : `(${inlined})`;\n return `${this.getIden(identation)}${this.goControlClauseParens(node, text)}`;\n }\n }\n return super.printCondition(node, identation);\n }\n\n // === / !== inlined to plain Go operators when both sides are concrete Go\n // values or real pointers. Everything else — in particular anything that is\n // still `any` in Go — falls through to the existing IsEqual helper.\n // `(a == b || *a == *b)` is rejected: a nil *T panics on the second clause.\n // Go has no implicit numeric conversion: `*limit == length` does not compile\n // when limit is *int64 and length is int, even though TypeScript calls both\n // `number`. Dereferencing is therefore only safe against an untyped constant\n // (a literal, which adapts to the pointee) or an operand of the very same Go\n // type. Anything else — including any `any` operand — keeps IsEqual.\n goDerefComparableWith(ptrNode, ptrText: string, otherNode): boolean {\n const pointee = this.goPointerTypeOfExpression(ptrNode, ptrText)?.substring(1);\n if (pointee === undefined) {\n return false;\n }\n switch (otherNode?.kind) {\n case SyntaxKind.StringLiteral:\n case SyntaxKind.NoSubstitutionTemplateLiteral:\n return pointee === 'string';\n case SyntaxKind.NumericLiteral:\n return (pointee === 'int') || (pointee === 'int64') || (pointee === 'float64');\n case SyntaxKind.TrueKeyword:\n case SyntaxKind.FalseKeyword:\n return pointee === 'bool';\n }\n const otherType = this.goDeclaredTypeOfIdentifier(otherNode);\n return otherType === pointee;\n }\n\n // a node the printer prints as a Go string constant: both literal forms are\n // emitted with the printer's string quote token, so the comparison is a plain\n // Go string comparison\n goIsStringLiteralNode(node): boolean {\n return (node?.kind === SyntaxKind.StringLiteral) || (node?.kind === SyntaxKind.NoSubstitutionTemplateLiteral);\n }\n\n // the deref arms print their operand twice, so it must read the same value both times: an\n // identifier is a plain read, and a string accessor call whose arguments are all\n // identifiers/literals re-reads them (no statement runs between the two evaluations).\n goDerefRepeatableOperand(node, printedText: string): boolean {\n if (node?.kind === SyntaxKind.Identifier) {\n return true;\n }\n if (node?.kind !== SyntaxKind.CallExpression) {\n return false;\n }\n if (GO_PURE_STRING_ACCESSORS.indexOf(this.goPrintedCallee(printedText) as string) < 0) {\n return false;\n }\n return node.arguments.every((argument) => this.goIsReadOnlyCallArgument(argument));\n }\n\n // an argument whose evaluation is a plain read: a value the printer already\n // holds, never a call that could observe or cause a change\n goIsReadOnlyCallArgument(node): boolean {\n switch (this.goUnwrapParenthesizedNode(node)?.kind) {\n case SyntaxKind.Identifier:\n case SyntaxKind.StringLiteral:\n case SyntaxKind.NoSubstitutionTemplateLiteral:\n case SyntaxKind.NumericLiteral:\n case SyntaxKind.TrueKeyword:\n case SyntaxKind.FalseKeyword:\n case SyntaxKind.NullKeyword:\n return true;\n }\n return false;\n }\n\n // true when the Go value of this operand is a bare `string`: a local declared `string`, or a\n // parameter the signature printer emits as `string`. A Go string holds neither nil nor a pointer,\n // so `x == \"lit\"` is exactly IsEqual(x, \"lit\") — the pointer arms never see this type.\n goIsBareStringOperand(node): boolean {\n if (this.goDeclaredTypeOfIdentifier(node) === 'string') {\n return true;\n }\n if (node?.kind !== SyntaxKind.Identifier) {\n return false;\n }\n const checker: any = this.checkerOrUndefined();\n if (checker === undefined) {\n return false;\n }\n const symbol = checker.getSymbolAtLocation(node);\n const declaration = symbol?.valueDeclaration?.resolve();\n if (declaration?.kind !== SyntaxKind.Parameter) {\n return false;\n }\n return this.printParameterType(declaration) === 'string';\n }\n\n printInlineEquality(left, right, leftText: string, rightText: string, isEq: boolean): string | undefined {\n const lPtr = this.goPointerTypeOfExpression(left, leftText) !== undefined;\n const rPtr = this.goPointerTypeOfExpression(right, rightText) !== undefined;\n // the branches below that deref repeat the operand, so they may only be used\n // on an identifier or on one of the read-only string accessors (whose\n // arguments are plain reads); a call that does anything else stays IsEqual\n const lRepeatable = this.goDerefRepeatableOperand(left, leftText);\n const rRepeatable = this.goDerefRepeatableOperand(right, rightText);\n const lFam = this.goScalarFamily(left);\n const rFam = this.goScalarFamily(right);\n if (lFam === 'nil' && rPtr) {\n return isEq ? `(${rightText} == nil)` : `(${rightText} != nil)`;\n }\n if (rFam === 'nil' && lPtr) {\n return isEq ? `(${leftText} == nil)` : `(${leftText} != nil)`;\n }\n if (lPtr && rPtr) {\n const lPointee = this.goPointerTypeOfExpression(left, leftText);\n if (!lRepeatable || !rRepeatable\n || lPointee !== this.goPointerTypeOfExpression(right, rightText)) {\n return undefined; // IsEqual + derefScalar evaluates each side once\n }\n if (isEq) {\n return `(${leftText} == ${rightText} || (${leftText} != nil && ${rightText} != nil && *${leftText} == *${rightText}))`;\n }\n return `(${leftText} != ${rightText} && (${leftText} == nil || ${rightText} == nil || *${leftText} != *${rightText}))`;\n }\n if (lPtr && rFam !== undefined && rFam !== 'nil') {\n if (!lRepeatable || !this.goDerefComparableWith(left, leftText, right)) {\n return undefined;\n }\n return isEq\n ? `(${leftText} != nil && *${leftText} == ${rightText})`\n : `(${leftText} == nil || *${leftText} != ${rightText})`;\n }\n if (rPtr && lFam !== undefined && lFam !== 'nil') {\n if (!rRepeatable || !this.goDerefComparableWith(right, rightText, left)) {\n return undefined;\n }\n return isEq\n ? `(${rightText} != nil && *${rightText} == ${leftText})`\n : `(${rightText} == nil || *${rightText} != ${leftText})`;\n }\n // two definitely-present scalars of the same family: `==` is valid Go and\n // needs no helper. Nullable aliases (Str/Int/Num/Bool) are `any` in Go and\n // returned undefined by goScalarFamily, so they keep IsEqual.\n if (!lPtr && !rPtr && lFam !== undefined && rFam !== undefined\n && lFam !== 'nil' && rFam !== 'nil' && lFam === rFam) {\n return isEq ? `(${leftText} == ${rightText})` : `(${leftText} != ${rightText})`;\n }\n // both operands print as a concrete Go numeric kind (a declared int/int64/float64, or a\n // constant that fits the other side): IsEqual converts to that same kind, never sees nil\n const numericKind = (!lPtr && !rPtr) ? this.goNativeNumericEqualityKind(left, leftText, right, rightText) : undefined;\n if (numericKind !== undefined) {\n return isEq ? `(${leftText} == ${rightText})` : `(${leftText} != ${rightText})`;\n }\n // the declared-local table names `string` for this identifier (or the signature printer emits the\n // parameter as `string`): a `var x string` cannot hold a pointer or nil, so a string-literal\n // comparison equals the helper. A local ever written another type is reported `any` and boxed.\n if (!lPtr && !rPtr) {\n if ((this.goIsBareStringOperand(left) && this.goIsStringLiteralNode(right))\n || (this.goIsBareStringOperand(right) && this.goIsStringLiteralNode(left))) {\n return isEq ? `(${leftText} == ${rightText})` : `(${leftText} != ${rightText})`;\n }\n }\n // an operand the printer boxes into `any` whose TypeScript type proves the box\n // holds a scalar or nil: `x === undefined` and `x === 'lit'` are then the same\n // predicate as the helper, without the interface round-trip. Numbers stay on\n // IsEqual: an `any` box may hold int, int64 or float64, and Go compares those\n // by exact width.\n const lNilFam = this.goScalarFamilyWithNil(left);\n const rNilFam = this.goScalarFamilyWithNil(right);\n const lBox = !lPtr && this.goIsAnyBoxExpression(left, leftText);\n const rBox = !rPtr && this.goIsAnyBoxExpression(right, rightText);\n if (lBox && (rFam === 'nil') && (lNilFam !== undefined) && (lNilFam !== 'number')) {\n return isEq ? `(${leftText} == nil)` : `(${leftText} != nil)`;\n }\n if (rBox && (lFam === 'nil') && (rNilFam !== undefined) && (rNilFam !== 'number')) {\n return isEq ? `(${rightText} == nil)` : `(${rightText} != nil)`;\n }\n // a parameter whose TypeScript type is an array or object (`Strings`, `Market`, `NullableDict`,\n // `object[]`): the Go box holds a map/slice or an untyped nil, not a pointer — GetArg unwraps the\n // typed nil pointers the wrappers pass, so `x == nil` is exactly IsEqual(x, nil)\n const lObjParam = (lNilFam === undefined) && lBox && this.goObjectBoxParameter(left);\n const rObjParam = (rNilFam === undefined) && rBox && this.goObjectBoxParameter(right);\n if (lObjParam && (rFam === 'nil')) {\n return isEq ? `(${leftText} == nil)` : `(${leftText} != nil)`;\n }\n if (rObjParam && (lFam === 'nil')) {\n return isEq ? `(${rightText} == nil)` : `(${rightText} != nil)`;\n }\n // an `any` local the printer cannot type whose every write is a non-pointer\n // source (endpoint await / JSON decode / literal / nil): its box is never a\n // nil *T, so the interface test is the same predicate as the helper\n if (lBox && (rFam === 'nil') && this.goAnyLocalHoldsNonPointer(this.goAnyBoxLocalDeclaration(left))) {\n return isEq ? `(${leftText} == nil)` : `(${leftText} != nil)`;\n }\n if (rBox && (lFam === 'nil') && this.goAnyLocalHoldsNonPointer(this.goAnyBoxLocalDeclaration(right))) {\n return isEq ? `(${rightText} == nil)` : `(${rightText} != nil)`;\n }\n // a parameter with a TypeScript default is bound by `x := GetArg(optionalArgs, i, default)`, which\n // folds a typed nil pointer (and nil []string/[]any) into the untyped default: never a nil *T.\n // Nullable Int/Num aliases are excluded above only because exact-width comparison needs `number`.\n if ((lNilFam === 'number') && (rFam === 'nil') && this.goGetArgBoundParameter(left)) {\n return isEq ? `(${leftText} == nil)` : `(${leftText} != nil)`;\n }\n if ((rNilFam === 'number') && (lFam === 'nil') && this.goGetArgBoundParameter(right)) {\n return isEq ? `(${rightText} == nil)` : `(${rightText} != nil)`;\n }\n // a string or bool literal: only a value of that very type is equal in both\n // predicates, so no numeric or nil member can be compared away\n const isLiteral = (node): boolean => {\n switch (node?.kind) {\n case SyntaxKind.StringLiteral:\n case SyntaxKind.NoSubstitutionTemplateLiteral:\n case SyntaxKind.TrueKeyword:\n case SyntaxKind.FalseKeyword:\n return true;\n }\n return false;\n };\n const literalMatchesBox = (boxFam: string | undefined, litNode, litFam: string | undefined): boolean =>\n ((litFam === 'string') || (litFam === 'bool')) && isLiteral(litNode)\n && ((boxFam === litFam) || (boxFam === undefined));\n if ((lBox && literalMatchesBox(lNilFam, right, rFam)) || (rBox && literalMatchesBox(rNilFam, left, lFam))) {\n return isEq ? `(${leftText} == ${rightText})` : `(${leftText} != ${rightText})`;\n }\n // IsEqual(GetValue(market, \"spot\"), true): the checker proves the read holds\n // a bool or nil (Market.spot), and every other dynamic type is unequal to a\n // Go bool, nil included — the same predicate as the helper\n const isBoolLiteral = (node): boolean =>\n (node?.kind === SyntaxKind.TrueKeyword) || (node?.kind === SyntaxKind.FalseKeyword);\n if ((!lPtr && isBoolLiteral(right) && (this.goScalarFamilyWithNil(left) === 'bool') && this.goBoxedElementRead(left, leftText))\n || (!rPtr && isBoolLiteral(left) && (this.goScalarFamilyWithNil(right) === 'bool') && this.goBoxedElementRead(right, rightText))) {\n return isEq ? `(${leftText} == ${rightText})` : `(${leftText} != ${rightText})`;\n }\n // two boxes of one non-numeric family: both hold that scalar or nil\n if (lBox && rBox && (lNilFam !== undefined) && (lNilFam !== 'number') && (lNilFam === rNilFam)) {\n return isEq ? `(${leftText} == ${rightText})` : `(${leftText} != ${rightText})`;\n }\n return undefined;\n }\n\n // the kind a native `==` compares two numeric operands in; undefined keeps IsEqual. Two\n // constants are left to the helper (nothing to type), as is any mix Go would refuse.\n goNativeNumericEqualityKind(left, leftText: string, right, rightText: string): string | undefined {\n if (this.goIsNumericConstant(left) && this.goIsNumericConstant(right)) {\n return undefined;\n }\n const leftKind = this.goOperandNumericKind(left, leftText);\n const rightKind = this.goOperandNumericKind(right, rightText);\n if ((leftKind === undefined) || (rightKind === undefined)) {\n return undefined;\n }\n return this.goComparisonKind(left, leftKind, right, rightKind);\n }\n\n // the Go numeric kind an operand's static type is, or undefined when it stays\n // `any` (unknown helper result, union, pointer box): only a concrete kind can\n // join a comparison the Go compiler accepts\n goOperandNumericKind(node, printedText: string): string | undefined {\n if (node === undefined) {\n return undefined;\n }\n if (node.kind === SyntaxKind.Identifier) {\n const declared = this.goDeclaredTypeOfIdentifier(node);\n if (declared !== undefined) {\n return (GO_NUMERIC_KINDS.indexOf(declared) >= 0) ? declared : undefined;\n }\n return this.goLiteralTypedLocalKind(node);\n }\n if (this.goIsNumericConstant(node)) {\n return this.goNumericLiteralKind(node);\n }\n if (node.kind === SyntaxKind.ParenthesizedExpression) {\n return this.goOperandNumericKind(node.expression, this.printNode(node.expression, 0));\n }\n const goType = this.goTypeOfInitializer(node, printedText);\n return (goType !== undefined && GO_NUMERIC_KINDS.indexOf(goType) >= 0) ? goType : undefined;\n }\n\n // a local bound by `:=` takes its Go type from the initializer: an untyped\n // integer constant is `int`, a floating-point one is `float64`. A variable\n // statement prints `var x = …` instead, where the printer already\n // decided the type, so only the `:=` form may be trusted here.\n goLiteralTypedLocalKind(node): string | undefined {\n const checker: any = this.checkerOrUndefined();\n if (checker === undefined) {\n return undefined;\n }\n const symbol = checker.getSymbolAtLocation(node);\n const declaration = symbol?.valueDeclaration?.resolve();\n if (declaration?.kind !== SyntaxKind.VariableDeclaration || declaration.initializer === undefined) {\n return undefined;\n }\n const declarationList = declaration.parent;\n if (declarationList?.kind !== SyntaxKind.VariableDeclarationList\n || declarationList.parent?.kind === SyntaxKind.FirstStatement) {\n return undefined;\n }\n return this.goNumericLiteralKind(declaration.initializer);\n }\n\n // an untyped Go constant: the integer forms adopt any numeric kind, the\n // floating-point ones only fit float64. A signed literal is the same constant:\n // the printer writes `-1` as text, never through OpNeg's box.\n goNumericLiteralKind(node): string | undefined {\n if (this.goIsSignedNumericLiteral(node)) {\n return this.goNumericLiteralKind(node.operand);\n }\n const text = node?.text;\n if (text === undefined) {\n return undefined;\n }\n if (/^[0-9][0-9_]*$/.test(text) || /^0[xXoObB][0-9a-fA-F_]+$/.test(text)) {\n return 'int';\n }\n if (/^[0-9][.eE]/.test(text)) {\n return 'float64';\n }\n return undefined;\n }\n\n // `-1` / `+1.5` as written: a sign on a numeric literal, the only prefix-unary\n // shape that reaches a comparison as a constant rather than as OpNeg(...)\n goIsSignedNumericLiteral(node): boolean {\n if (node?.kind !== SyntaxKind.PrefixUnaryExpression) {\n return false;\n }\n if ((node.operator !== SyntaxKind.MinusToken) && (node.operator !== SyntaxKind.PlusToken)) {\n return false;\n }\n return node.operand?.kind === SyntaxKind.NumericLiteral;\n }\n\n // a numeric constant operand: an integer/float literal, with an optional sign\n goIsNumericConstant(node): boolean {\n return (node?.kind === SyntaxKind.NumericLiteral) || this.goIsSignedNumericLiteral(node);\n }\n\n // the constant's value with its sign; NaN for anything but a numeric constant\n goNumericConstantValue(node): number {\n if (this.goIsSignedNumericLiteral(node)) {\n const value = Number(node.operand.text.replaceAll('_', ''));\n return (node.operator === SyntaxKind.MinusToken) ? -value : value;\n }\n if (node?.kind !== SyntaxKind.NumericLiteral) {\n return Number.NaN;\n }\n return Number(node.text.replaceAll('_', ''));\n }\n\n // a constant only joins a comparison when its value is representable in the\n // other operand's kind: `0.5` is not an int, and neither is 1e400 (infinity)\n goLiteralFitsKind(node, kind: string): boolean {\n const value = this.goNumericConstantValue(node);\n if (!Number.isFinite(value)) {\n return false;\n }\n if (kind === 'float64') {\n return true;\n }\n return Number.isInteger(value) && (Math.abs(value) <= 2147483647);\n }\n\n // the kind both operands are compared in, or undefined when Go would need a\n // conversion (two different concrete kinds) or the constant does not fit\n goComparisonKind(left, leftKind: string, right, rightKind: string): string | undefined {\n if (leftKind === rightKind) {\n return leftKind;\n }\n if (this.goIsNumericConstant(left) && !this.goIsNumericConstant(right)) {\n return this.goLiteralFitsKind(left, rightKind) ? rightKind : undefined;\n }\n if (this.goIsNumericConstant(right) && !this.goIsNumericConstant(left)) {\n return this.goLiteralFitsKind(right, leftKind) ? leftKind : undefined;\n }\n return undefined;\n }\n\n // `<` `>` `<=` `>=` between two operands the checker proves to be numbers of the\n // same Go kind is exactly the comparison the helper performs, minus the interface\n // round-trip, so the call carries no information. A `*int64` / `*float64` operand\n // joins them with its deref written out, and the helper's nil predicate with it.\n // Everything else — `any` boxes, mixed kinds, strings — keeps the helper. float64\n // keeps IsLessThan/IsLessThanOrEqual: the helper answers true whenever an operand\n // is NaN while Go (and JS) answer false, and only those two operators differ.\n printInlineOrderedComparison(left, right, leftText: string, rightText: string, op): string | undefined {\n const operator = ORDERED_COMPARISON_OPERATORS[op];\n if (operator === undefined) {\n return undefined;\n }\n const leftPointee = this.goOrderedComparisonPointerKind(left);\n const rightPointee = this.goOrderedComparisonPointerKind(right);\n if ((leftPointee !== undefined) || (rightPointee !== undefined)) {\n return this.printPointerOrderedComparison(left, right, leftText, rightText, operator, leftPointee, rightPointee);\n }\n const leftKind = this.goOperandNumericKind(left, leftText);\n const rightKind = this.goOperandNumericKind(right, rightText);\n if ((leftKind === undefined) || (rightKind === undefined)) {\n return undefined;\n }\n // both operands may additionally be checker-typed numbers; that check is\n // implied by the concrete Go kind above and buys nothing\n const kind = this.goComparisonKind(left, leftKind, right, rightKind);\n if (kind === undefined) {\n return undefined;\n }\n if ((kind === 'float64') && ((operator === '<') || (operator === '<='))) {\n return undefined;\n }\n return `(${leftText} ${operator} ${rightText})`;\n }\n\n // the pointee kind of a `*int64` / `*float64` **identifier** operand. Only a local\n // the printer itself declared as that pointer qualifies: a call would be repeated by\n // the nil test, and an `any` box holds a value the printer cannot name.\n goOrderedComparisonPointerKind(node): string | undefined {\n if (node?.kind !== SyntaxKind.Identifier) {\n return undefined;\n }\n const declared = this.goDeclaredTypeOfIdentifier(node);\n if ((declared !== '*int64') && (declared !== '*float64')) {\n return undefined;\n }\n return declared.substring(1);\n }\n\n // an ordered comparison with a `*int64` / `*float64` operand on at least one side. The helper\n // derefs both sides and answers its own predicate when one is nil, so the native form spells that\n // out; an enclosing `x !== undefined` guard (printed as `x != nil`) removes it for that side.\n printPointerOrderedComparison(left, right, leftText: string, rightText: string, operator: string, leftPointee: string | undefined, rightPointee: string | undefined): string | undefined {\n const leftKind = (leftPointee === undefined) ? this.goOperandNumericKind(left, leftText) : leftPointee;\n const rightKind = (rightPointee === undefined) ? this.goOperandNumericKind(right, rightText) : rightPointee;\n if ((leftKind === undefined) || (rightKind === undefined)) {\n return undefined;\n }\n const kind = this.goComparisonKind(left, leftKind, right, rightKind);\n if (kind === undefined) {\n return undefined;\n }\n // NaN is a float64 to the helper too: `<` / `<=` answer true for it while Go\n // answers false, so those two operators keep the call exactly as phase-1 does\n if ((kind === 'float64') && ((operator === '<') || (operator === '<='))) {\n return undefined;\n }\n const leftNil = (leftPointee !== undefined) && !this.goHasEnclosingNilGuard(left);\n const rightNil = (rightPointee !== undefined) && !this.goHasEnclosingNilGuard(right);\n // a nil test short-circuits the operand on the other side, so that side has to\n // be free of calls for the helper's single evaluation to stay unobservable\n if (leftNil && (rightPointee === undefined) && !this.goIsPureComparisonOperand(right)) {\n return undefined;\n }\n if (rightNil && (leftPointee === undefined) && !this.goIsPureComparisonOperand(left)) {\n return undefined;\n }\n const lv = (leftPointee === undefined) ? leftText : `*${leftText}`;\n const rv = (rightPointee === undefined) ? rightText : `*${rightText}`;\n if (!leftNil && !rightNil) {\n return `(${lv} ${operator} ${rv})`;\n }\n // every arm below answers what the helper answers when a side is nil:\n // `a != nil && b == nil` for `>`/`>=`, `a == nil && b != nil` for `<`/`<=`\n const greater = (operator === '>') || (operator === '>=');\n if (leftNil && !rightNil) {\n return greater ? `(${leftText} != nil && ${lv} ${operator} ${rv})` : `(${leftText} == nil || ${lv} ${operator} ${rv})`;\n }\n if (!leftNil && rightNil) {\n return greater ? `(${rightText} == nil || ${lv} ${operator} ${rv})` : `(${rightText} != nil && ${lv} ${operator} ${rv})`;\n }\n if (operator === '>') {\n return `(${leftText} != nil && (${rightText} == nil || ${lv} > ${rv}))`;\n }\n if (operator === '>=') {\n return `(${rightText} == nil || (${leftText} != nil && ${lv} >= ${rv}))`;\n }\n if (operator === '<') {\n return `(${rightText} != nil && (${leftText} == nil || ${lv} < ${rv}))`;\n }\n return `(${leftText} == nil || (${rightText} != nil && ${lv} <= ${rv}))`;\n }\n\n // `x !== undefined` / `x != null` on that identifier: the printer writes the Go\n // `x != nil` test for it, so an enclosing one proves the pointer present\n goIsNonNilTestOf(node, ident): boolean {\n if (node?.kind !== SyntaxKind.BinaryExpression) {\n return false;\n }\n const op = node.operatorToken?.kind;\n if ((op !== SyntaxKind.ExclamationEqualsToken) && (op !== SyntaxKind.ExclamationEqualsEqualsToken)) {\n return false;\n }\n return (this.goIsSameSymbol(node.left, ident) && this.goIsNilLiteral(node.right))\n || (this.goIsSameSymbol(node.right, ident) && this.goIsNilLiteral(node.left));\n }\n\n // a null/undefined literal, or any expression the checker types as one\n goIsNilLiteral(node): boolean {\n if ((node?.kind === SyntaxKind.NullKeyword) || (node?.kind === SyntaxKind.UndefinedKeyword)) {\n return true;\n }\n return (node?.kind === SyntaxKind.Identifier) && (this.goScalarFamily(node) === 'nil');\n }\n\n goIsSameSymbol(a, b): boolean {\n if ((a?.kind !== SyntaxKind.Identifier) || (b?.kind !== SyntaxKind.Identifier)) {\n return false;\n }\n try {\n const checker = this.getChecker();\n const leftSymbol = checker.getSymbolAtLocation(a);\n return (leftSymbol !== undefined) && (leftSymbol === checker.getSymbolAtLocation(b));\n } catch (e) {\n return false;\n }\n }\n\n // [guarded child, guarding condition] fields of the constructs a nil guard dominates\n goNilGuardFields: { [kind: number]: [string, string] } = {\n [SyntaxKind.IfStatement]: ['thenStatement', 'expression'],\n [SyntaxKind.WhileStatement]: ['statement', 'expression'],\n [SyntaxKind.ForStatement]: ['statement', 'condition'],\n [SyntaxKind.ConditionalExpression]: ['whenTrue', 'condition'],\n };\n\n // true when the enclosing control flow already proves the identifier non-nil at this node: an\n // earlier conjunct of an `&&` chain, or the condition of a wrapping if/loop/ternary containing the\n // node. A local rebound anywhere in its function never counts — the guard may be dead by then.\n goHasEnclosingNilGuard(ident): boolean {\n const checker: any = this.checkerOrUndefined();\n if (checker === undefined) {\n return false;\n }\n const declaration = checker.getSymbolAtLocation(ident)?.valueDeclaration?.resolve();\n if (this.goLocalIsRebound(this.goEnclosingFunction(declaration ?? ident), ident)) {\n return false;\n }\n let child = ident;\n let parent = ident?.parent;\n while (parent !== undefined) {\n const kind = parent.kind;\n if ((kind === SyntaxKind.ParenthesizedExpression) || (kind === SyntaxKind.VariableStatement)\n || (kind === SyntaxKind.ExpressionStatement) || (kind === SyntaxKind.Block)\n || (kind === SyntaxKind.ReturnStatement) || (kind === SyntaxKind.ElementAccessExpression)\n || (kind === SyntaxKind.CallExpression) || (kind === SyntaxKind.PropertyAccessExpression)\n || (kind === SyntaxKind.ObjectLiteralExpression) || (kind === SyntaxKind.PropertyAssignment)\n || (kind === SyntaxKind.ArrayLiteralExpression) || (kind === SyntaxKind.AwaitExpression)\n || (kind === SyntaxKind.CaseClause) || (kind === SyntaxKind.SwitchStatement)\n || (kind === SyntaxKind.DoStatement) || (kind === SyntaxKind.LabeledStatement)) {\n // the guard still dominates everything below such a wrapper\n child = parent;\n parent = parent.parent;\n continue;\n }\n if (kind === SyntaxKind.BinaryExpression) {\n const op = parent.operatorToken?.kind;\n if ((op === SyntaxKind.AmpersandAmpersandToken) && (child === parent.right)\n && this.goConditionProvesNonNil(parent.left, ident)) {\n return true;\n }\n // `a || b` and a left conjunct are evaluated before the guard, so they\n // prove nothing; the guard of an enclosing construct still applies\n child = parent;\n parent = parent.parent;\n continue;\n }\n const guard = this.goNilGuardFields[kind];\n if (guard !== undefined) {\n if ((child === parent[guard[0]]) && this.goConditionProvesNonNil(parent[guard[1]], ident)) {\n return true;\n }\n child = parent;\n parent = parent.parent;\n continue;\n }\n // functions, classes and everything else the scan does not model: the\n // guard cannot be carried across\n return false;\n }\n return false;\n }\n\n // the whole condition, or any conjunct of its `&&` chain, is the non-nil test\n goConditionProvesNonNil(condition, ident): boolean {\n const inner = this.goUnwrapParenthesizedNode(condition);\n if (inner === undefined) {\n return false;\n }\n if (this.goIsNonNilTestOf(inner, ident)) {\n return true;\n }\n if ((inner.kind !== SyntaxKind.BinaryExpression) || (inner.operatorToken?.kind !== SyntaxKind.AmpersandAmpersandToken)) {\n return false;\n }\n return this.goConditionProvesNonNil(inner.left, ident) || this.goConditionProvesNonNil(inner.right, ident);\n }\n\n goUnwrapParenthesizedNode(node) {\n let current = node;\n while (current?.kind === SyntaxKind.ParenthesizedExpression) {\n current = current.expression;\n }\n return current;\n }\n\n // an operand a short-circuit may skip without any observable difference: no calls,\n // no assignments, nothing the helper would have evaluated exactly once\n goIsPureComparisonOperand(node): boolean {\n switch (node?.kind) {\n case SyntaxKind.Identifier:\n case SyntaxKind.NumericLiteral:\n case SyntaxKind.StringLiteral:\n case SyntaxKind.NoSubstitutionTemplateLiteral:\n case SyntaxKind.PropertyAccessExpression:\n return true;\n case SyntaxKind.PrefixUnaryExpression:\n return (node.operator === SyntaxKind.MinusToken) && this.goIsPureComparisonOperand(node.operand);\n case SyntaxKind.ParenthesizedExpression:\n return this.goIsPureComparisonOperand(node.expression);\n }\n return false;\n }\n\n // Go's printer never wraps an already parenthesised expression: gofmt prints a\n // ParenExpr whose child is itself a ParenExpr without its own parentheses\n // (`((x))` prints as `(x)`), because the text it is handed is re-parsed that way.\n // Our output is re-parsed exactly like that, so a source parenthesis around an\n // expression that already prints parenthesised -- an inlined comparison, a nested\n // parenthesised expression, an EvalTruthy(...) arm -- must emit the single pair\n // gofmt keeps instead of doubling it.\n printParenthesizedExpression(node, identation) {\n const expression = node.expression;\n if (expression?.kind === SyntaxKind.AsExpression) {\n // transform (this as any) into this, () and as any are not necessary\n return this.getIden(identation) + this.printNode(expression, 0);\n }\n if (expression?.kind === SyntaxKind.ArrowFunction) {\n // ignore arrowFunctions inside parenthesis\n return \"\";\n }\n // parentheses undo one level of depth (go/printer reduceDepth())\n const printed = this.goWithExprDepth(this.goExprDepth - 1, () => this.printNode(expression, 0));\n if (this.goIsParenthesizedExpression(printed)) {\n return this.getIden(identation) + printed;\n }\n return this.getIden(identation) + this.LEFT_PARENTHESIS + printed + this.RIGHT_PARENTHESIS;\n }\n\n // true when the printed text is exactly one parenthesised expression: its first\n // `(` closes on the last non-space character. Literals and comments are skipped\n // so a parenthesis inside them cannot unbalance the scan.\n goIsParenthesizedExpression(printed: string): boolean {\n const text = printed.trimStart();\n if (text[0] !== '(') {\n return false;\n }\n let depth = 0;\n for (let i = 0; i < text.length; i++) {\n const c = text[i];\n if ((c === '/') && (text[i + 1] === '/')) {\n // a trailing line comment belongs to the statement, not to the expression\n return false;\n }\n if ((c === '/') && (text[i + 1] === '*')) {\n const end = text.indexOf('*/', i + 2);\n if (end < 0) {\n return false;\n }\n i = end + 1;\n continue;\n }\n if ((c === '\"') || (c === '\\'') || (c === '`')) {\n i = this.goSkipGoLiteral(text, i);\n if (i < 0) {\n return false;\n }\n continue;\n }\n if (c === '(') {\n depth += 1;\n } else if (c === ')') {\n depth -= 1;\n if (depth === 0) {\n return text.substring(i + 1).trim().length === 0;\n }\n }\n }\n return false;\n }\n\n // index of the quote closing the Go string/rune literal that starts at `start`, -1 when unterminated\n goSkipGoLiteral(text: string, start: number): number {\n const quote = text[start];\n for (let i = start + 1; i < text.length; i++) {\n const c = text[i];\n if (c === '\\\\') {\n i += 1;\n continue;\n }\n if (c === quote) {\n return i;\n }\n }\n return -1;\n }\n\n // castVariableAssignmentIfNeeded(left, right, identation) {\n // const leftType = this.getChecker().getTypeAtLocation(left);\n // const rightType = this.getChecker().getTypeAtLocation(right);\n\n // const leftText = this.printNode(left, 0);\n // const rightText = this.printNode(right, 0);\n\n // if (this.isAnyType(rightType.flags) && !this.isAnyType(leftType.flags)) {\n // const parsedType = this.getTypeFromRawType(leftType);\n // return `${this.getIden(identation)}${leftText} = (${parsedType})${rightText}`;\n // }\n // return undefined;\n // }\n\n transformPropertyAcessExpressionIfNeeded(node) {\n const expression = node.expression;\n const leftSide = this.printNode(expression, 0);\n const rightSide = node.name.text;\n\n let rawExpression = undefined;\n\n switch(rightSide) {\n case 'length':\n const type = (this.getChecker() as Checker).getTypeAtLocation(expression); // eslint-disable-line\n // this.warnIfAnyType(node, type.flags, leftSide, \"length\");\n // rawExpression = this.isStringType(type.flags) ? `(string${leftSide}).Length` : `(${leftSide}.Cast().ToList()).Count`;\n rawExpression = this.printInlineArrayLength(expression, leftSide, node) ?? (this.isStringType(type.flags) ? `GetLength(${leftSide})` : `${this.ARRAY_LENGTH_WRAPPER_OPEN}${leftSide}${this.ARRAY_LENGTH_WRAPPER_CLOSE}`); // `(${leftSide}.Cast()).ToList().Count`\n break;\n case 'push':\n rawExpression = `((IList)${leftSide}).Add`;\n break;\n // case 'push':\n // rawExpression = `(List${leftSide}).Add`s\n // break;\n }\n return rawExpression;\n }\n\n // The Go type of a GetArg-bound optional local (from the printed default, or the declared type\n // for a nil default), or undefined to keep `any`; the retype needs goLocalIsSafeToType,\n // goParameterKeepsNilCompareNative and goGetArgConsumersAreSafe to agree.\n goGetArgLocalType(body, param, printedDefault: string): string | undefined {\n const method: any = param?.parent;\n const excluded = GO_GETARG_EXCLUDED_POSITIONS[method?.name?.text];\n if ((excluded !== undefined) && excluded.includes(method.parameters.indexOf(param))) {\n return undefined;\n }\n // an explicit `any` annotation admits values of other shapes than the default (api lists),\n // unless it only restates an override of a base parameter the base leaves unannotated\n if ((param?.type?.kind === SyntaxKind.AnyKeyword) && !this.goGetArgBaseParamIsUnannotated(param)) {\n return undefined;\n }\n const shape = (printedDefault ?? '').trim();\n const byDefault = this.goGetArgTypeOfShape(shape);\n if (byDefault !== undefined) {\n // a declared type naming no single Go type (IndexType = number | string) admits other shapes;\n // an admitted `any` restatement binds by its default, as the base does\n if ((param?.type !== undefined) && (param.type.kind !== SyntaxKind.AnyKeyword)\n && !this.goGetArgDeclaredTypeCandidates(param).some((t) => t.replace(/^\\*/, '') === byDefault)) {\n return undefined;\n }\n return this.goGetArgLocalIsSafe(body, param, byDefault) ? byDefault : undefined;\n }\n if ((shape !== 'nil') && (shape !== 'undefined')) {\n return undefined;\n }\n for (const goType of this.goGetArgDeclaredTypeCandidates(param)) {\n if (this.goGetArgLocalIsSafe(body, param, goType, true)) {\n return goType;\n }\n }\n return undefined;\n }\n\n // true when the method overrides a base method whose parameter at the same position has no\n // type annotation and a default of the same syntax kind (the base binds it through its twin)\n goGetArgBaseParamIsUnannotated(param): boolean {\n const method: any = param?.parent;\n const name = method?.name?.text;\n const index = method?.parameters?.indexOf(param) ?? -1;\n const cls: any = method?.parent;\n const checker: any = this.checkerOrUndefined();\n if ((name === undefined) || (index < 0) || (checker === undefined) || (param.initializer === undefined)) {\n return false;\n }\n for (const clause of (cls?.heritageClauses ?? [])) {\n if (clause.token !== SyntaxKind.ExtendsKeyword) {\n continue;\n }\n for (const expr of (clause.types ?? [])) {\n const baseDecl: any = checker.getTypeAtLocation(expr)?.getProperty?.(name)?.valueDeclaration?.resolve();\n const baseParam: any = baseDecl?.parameters?.[index];\n if (baseParam === undefined) {\n return false;\n }\n return (baseParam.type === undefined) && (baseParam.initializer !== undefined)\n && (baseParam.initializer.kind === param.initializer.kind);\n }\n }\n return false;\n }\n\n // a use of a nil-defaulted map local that only reads it: an element read, `k in x`, or the\n // receiver of a helper that treats a nil map like an absent value (no IsDictionary/IsEqual)\n goGetArgNilMapUseOnlyReads(n): boolean {\n const parent: any = n.parent;\n if ((parent?.kind === SyntaxKind.ElementAccessExpression) || (parent?.kind === SyntaxKind.BinaryExpression)) {\n return this.goSafeDictUseReadsTheMap(n);\n }\n if ((parent?.kind !== SyntaxKind.CallExpression) || (parent.arguments.indexOf(n) !== 0)) {\n return false;\n }\n const callee = this.goPrintedCallee(this.printNode(parent, 0));\n return (callee !== undefined) && (GO_GETARG_NIL_MAP_READERS.indexOf(callee.replace(/^this\\./, '')) >= 0);\n }\n\n // a nil []string reads like the absent box: `x.length` / GetArrayLength is 0, `x[i]` (GetValue)\n // is nil, InArray finds nothing, and a defaulted Strings position's GetArg folds it to its default\n goGetArgNilStringSliceUseOnlyReads(n): boolean {\n const parent: any = n.parent;\n if ((parent?.kind === SyntaxKind.PropertyAccessExpression) && (parent.expression === n)) {\n return (parent.name?.text === 'length') && (parent.parent?.kind !== SyntaxKind.CallExpression || parent.parent.expression !== parent)\n && !((parent.parent?.kind === SyntaxKind.BinaryExpression) && (parent.parent.left === parent));\n }\n if (parent?.kind === SyntaxKind.ElementAccessExpression) {\n return this.goSafeDictUseReadsTheMap(n);\n }\n if ((parent?.kind !== SyntaxKind.CallExpression) || (parent.expression === n)) {\n return false;\n }\n const argIndex = parent.arguments.indexOf(n);\n const callee: any = parent.expression;\n if ((callee?.kind === SyntaxKind.PropertyAccessExpression) && (callee.expression?.kind === SyntaxKind.ThisKeyword)\n && (callee.name?.text === 'inArray') && (argIndex === 1)) {\n return true;\n }\n if (!this.goGetArgPositionIsDefaulted(callee, argIndex)) {\n return false;\n }\n let decl: any;\n try {\n decl = this.getChecker().getSymbolAtLocation(callee)?.valueDeclaration?.resolve();\n } catch (e) {\n decl = undefined;\n }\n // the callee binds it as `any` or through GetArgStringSlice, never a []any twin\n const declared = String(decl?.parameters?.[argIndex]?.type?.getText() ?? '').replace(/\\s+/g, ' ');\n return (declared === 'Strings') || (declared === 'string[]');\n }\n\n // the Go type the printed default names, or undefined when it names none\n goGetArgTypeOfShape(shape: string): string | undefined {\n const shapes: [RegExp, string][] = [[/^map\\[string\\]any\\{/, 'map[string]any'], [/^\\[map\\[string\\]any\\]\\{/, '[]map[string]any'],\n [/^\\[\\]string\\{/, '[]string'], [/^\\[\\]any\\{/, '[]any'], [/^\"/, 'string'], [/^(?:true|false)$/, 'bool'], [/^(?:-?[0-9]|math\\.)/, 'int64']];\n return shapes.find(([re]) => re.test(shape))?.[1];\n }\n\n // Go type candidates for a nil-defaulted parameter, in try order: the annotation text\n // (`Int` vs `Num` exist only there), then goNativeParameterTypeCandidates.\n goGetArgDeclaredTypeCandidates(param): string[] {\n const out: string[] = [];\n const declared = (param?.type !== undefined) ? String(param.type.getText()).replace(/\\s+/g, ' ') : undefined;\n const alias: any = this.CCXT_GO_GETARG_DECLARED_TYPES ?? {};\n if ((declared !== undefined) && (alias[declared] !== undefined)) {\n out.push(alias[declared]);\n } else if ((declared !== undefined) && this.goGetArgPrimitiveType(declared) !== undefined) {\n out.push('*' + this.goGetArgPrimitiveType(declared));\n }\n for (const goType of this.goNativeParameterTypeCandidates(param)) {\n if (out.indexOf(goType) < 0) {\n out.push(goType);\n }\n }\n return out;\n }\n\n goGetArgPrimitiveType(declared: string): string | undefined {\n switch (declared) {\n case 'Int': case 'Integer': case 'int': return 'int64';\n case 'Num': case 'number': case 'Float': return 'float64';\n case 'Bool': case 'boolean': return 'bool';\n case 'Str': case 'string': case 'String': return 'string';\n }\n return undefined;\n }\n\n // the twin of a declared Go type (go/v4/exchange_helpers.go); undefined when the twin is\n // missing, in which case the parameter keeps the `any` box (an `any` return must never be\n // assigned to a typed local)\n goGetArgTwinName(goType: string): string | undefined {\n switch (goType) {\n case 'map[string]any': return 'GetArgMap';\n case '[]map[string]any': return 'GetArgMapSlice';\n case '[]string': return 'GetArgStringSlice';\n case '[]any': return 'GetArgAnySlice';\n case 'string': return 'GetArgString';\n case 'bool': return 'GetArgBool';\n case 'int64': return 'GetArgInt64';\n case 'float64': return 'GetArgFloat64';\n case '*string': return 'GetArgStringPtr';\n case '*int64': return 'GetArgInt64Ptr';\n case '*float64': return 'GetArgFloat64Ptr';\n case '*bool': return 'GetArgBoolPtr';\n }\n return undefined;\n }\n\n goGetArgIsValueType(goType: string): boolean {\n return (goType === 'string') || (goType === 'bool') || (goType === 'int64') || (goType === 'float64');\n }\n\n goGetArgLocalIsSafe(body, param, goType: string, nilable = false): boolean {\n const name = param.name.text;\n if (this.goGetArgTwinName(goType) === undefined) {\n return false; // no twin for this type: keep the `any` box\n }\n if (!this.goLocalIsSafeToType(body, param, name, goType)) {\n return false;\n }\n if (this.goGetArgIsValueType(goType)) {\n // `x == nil` does not compile for a Go string/bool/int64/float64: keep the box\n return this.goParameterKeepsNilCompareNative(body, param, goType);\n }\n return this.goGetArgConsumersAreSafe(body, param, goType, nilable);\n }\n\n // Every later use must read the typed local as it read the `any` box: pointers only reach\n // audited deref consumers (fail-closed); containers are the same map/list, and nil-sensitive\n // consumers are tabled as `container` (goGetArgPassesIntoContainerDefault covers call chains).\n goGetArgConsumersAreSafe(body, param, goType: string, nilable: boolean): boolean {\n return this.goGetArgUsesAreSafe(body, param, param.name.text, goType, nilable, new Set());\n }\n\n // `(x === undefined) ? d : x` / `x !== undefined ? x : d`: the arm holding `n` only runs when\n // the same name is not nil, so the copy never boxes a typed nil\n goGetArgArmIsNilGuarded(n: any, cond: any): boolean {\n let test: any = cond.condition;\n while (test?.kind === SyntaxKind.ParenthesizedExpression) {\n test = test.expression;\n }\n if ((test?.kind !== SyntaxKind.BinaryExpression)) {\n return false;\n }\n const isNil = (e: any) => (e?.kind === SyntaxKind.NullKeyword) || ((e?.kind === SyntaxKind.Identifier) && (e.text === 'undefined'));\n const sameName = (e: any) => (e?.kind === SyntaxKind.Identifier) && (e.text === n.text);\n if (!((sameName(test.left) && isNil(test.right)) || (sameName(test.right) && isNil(test.left)))) {\n return false;\n }\n const op = test.operatorToken?.kind;\n const eq = (op === SyntaxKind.EqualsEqualsEqualsToken) || (op === SyntaxKind.EqualsEqualsToken);\n const ne = (op === SyntaxKind.ExclamationEqualsEqualsToken) || (op === SyntaxKind.ExclamationEqualsToken);\n let arm: any = n;\n while (arm.parent !== cond) {\n arm = arm.parent;\n }\n return (eq && (arm === cond.whenFalse)) || (ne && (arm === cond.whenTrue));\n }\n\n // a native int64/float64 arithmetic result boxes the same number its Add/Subtract/... helper form\n // boxed, so it reads like that helper write rather than a value-family write\n goGetArgWriteIsNativeArithmetic(rhs: any): boolean {\n let e: any = rhs;\n while (e?.kind === SyntaxKind.ParenthesizedExpression) {\n e = e.expression;\n }\n const ops = [SyntaxKind.PlusToken, SyntaxKind.MinusToken, SyntaxKind.AsteriskToken, SyntaxKind.SlashToken, SyntaxKind.PercentToken];\n if ((e?.kind !== SyntaxKind.BinaryExpression) || !ops.includes(e.operatorToken?.kind)) {\n return false;\n }\n const goType = this.goNativeArithmeticType(e) ?? this.goConstantProductKind(e);\n return (goType === 'int64') || (goType === 'float64');\n }\n\n // the body-local `r` a copy `let r = x` / `r = x` lands in (the value, not the box, is copied)\n goGetArgCopyTarget(use: any, body: any): any {\n const parent: any = use.parent;\n let target: any;\n if ((parent?.kind === SyntaxKind.VariableDeclaration) && (parent.initializer === use)) {\n target = parent;\n } else if ((parent?.kind === SyntaxKind.BinaryExpression) && (parent.right === use)\n && (parent.operatorToken?.kind === SyntaxKind.EqualsToken) && (parent.left?.kind === SyntaxKind.Identifier)\n && (parent.parent?.kind === SyntaxKind.ExpressionStatement)) {\n try {\n target = this.getChecker().getSymbolAtLocation(parent.left)?.valueDeclaration?.resolve();\n } catch (e) {\n target = undefined;\n }\n }\n if ((target?.kind !== SyntaxKind.VariableDeclaration) || (target.name?.kind !== SyntaxKind.Identifier)) {\n return undefined;\n }\n let inBody = false;\n for (let p: any = target.parent; p !== undefined; p = p.parent) {\n inBody = inBody || (p === body);\n }\n // a value-typed write (`r = \"s\"`) may type the copy as the pointer's value family\n let valueWrite = false;\n const visit = (n: any): void => {\n if (valueWrite) {\n return;\n }\n if ((n.kind === SyntaxKind.BinaryExpression) && (n.operatorToken?.kind === SyntaxKind.EqualsToken)\n && (n.left?.kind === SyntaxKind.Identifier) && (n.left.text === target.name.text)) {\n valueWrite = this.goGetArgIsValueType(String(this.goTypeOfInitializer(n.right, this.printNode(n.right, 0))))\n && !this.goGetArgWriteIsNativeArithmetic(n.right);\n }\n n.forEachChild(visit);\n };\n body.forEachChild(visit);\n return (inBody && !valueWrite) ? target : undefined;\n }\n\n goGetArgUsesAreSafe(body, param, name: string, goType: string, nilable: boolean, seen: Set, boxed = false): boolean {\n seen.add(param);\n const table: any = this.CCXT_GO_GETARG_SAFE_CONSUMERS ?? {};\n const pointer = goType.startsWith('*');\n let safe = true;\n const verdictOf = (callee: string, argIndex: number): string => {\n // the table is keyed by the printed Go callee (`this.market` prints `this.Market`); a\n // pointer is unwrapped by derefScalar, a nil map is not, so only pointers fold the case\n const goName = callee.charAt(0).toUpperCase() + callee.slice(1);\n const entry = table[callee] ?? (pointer ? (table[goName] ?? table[goName + 'Async']) : undefined);\n if (entry === undefined) {\n // a nil-defaulted container may be handed back through `any` as a non-nil typed nil\n return (pointer || nilable) ? 'unknown' : 'deref';\n }\n if (typeof entry === 'string') {\n return entry;\n }\n return entry[String(argIndex)] ?? entry['*'] ?? (pointer ? 'unknown' : 'deref');\n };\n const visit = (n: any): void => {\n if (!safe) {\n return;\n }\n if ((n?.kind === SyntaxKind.Identifier) && (n.text === name)) {\n let symbol;\n try {\n symbol = this.getChecker().getSymbolAtLocation(n);\n } catch (e) {\n symbol = undefined;\n }\n if (symbol?.valueDeclaration?.resolve() === param) {\n const parent: any = n.parent;\n if (parent === param) {\n return; // the parameter's own name is not a use\n }\n if (nilable && (goType === 'map[string]any')) {\n // goLocalIsSafeToType already matched the type of an assigned value\n const assigned = (parent?.kind === SyntaxKind.BinaryExpression) && (parent.left === n)\n && (parent.operatorToken?.kind === SyntaxKind.EqualsToken);\n if (assigned || this.goGetArgNilMapUseOnlyReads(n)) {\n return;\n }\n }\n if (nilable && (goType === '[]string') && this.goGetArgNilStringSliceUseOnlyReads(n)) {\n return;\n }\n if (pointer && (parent?.kind === SyntaxKind.BinaryExpression)) {\n // a write already type-matched by goLocalIsSafeToType, or the key of `x in d` (InOp derefs it)\n const op = parent.operatorToken?.kind;\n if ((parent.left === n) && ((op === SyntaxKind.EqualsToken) || (op === SyntaxKind.InKeyword))) {\n return;\n }\n // `x === 'lit'`: a pointer operand prints nil-guarded native or through IsEqual (derefs)\n const other: any = (parent.left === n) ? parent.right : parent.left;\n const equality = [SyntaxKind.EqualsEqualsEqualsToken, SyntaxKind.ExclamationEqualsEqualsToken].includes(op);\n if (equality && ((other?.kind === SyntaxKind.StringLiteral) || (other?.kind === SyntaxKind.NumericLiteral))) {\n return;\n }\n }\n // a copy (ternary arm, `let r = x`, `r = x`) hands the value to a body local whose\n // own uses must pass the same rules; an `any` alias prints its nil tests via IsEqual,\n // which derefs a nil pointer but not a nil map, so containers need a nil-guarded arm\n let use: any = n;\n let guarded = false;\n while ((use.parent?.kind === SyntaxKind.ParenthesizedExpression)\n || ((use.parent?.kind === SyntaxKind.ConditionalExpression) && (use.parent.condition !== use))) {\n if (use.parent.kind === SyntaxKind.ConditionalExpression) {\n guarded = guarded || this.goGetArgArmIsNilGuarded(n, use.parent);\n }\n use = use.parent;\n }\n const target = (pointer || nilable) ? this.goGetArgCopyTarget(use, body) : undefined;\n if (target !== undefined) {\n if ((!pointer && guarded) || seen.has(target)) {\n return;\n }\n safe = this.goGetArgUsesAreSafe(body, target, target.name.text, goType, nilable, seen, true);\n return;\n }\n if ((use !== n) && (pointer || nilable)) {\n safe = pointer && this.goGetArgPointerStoredAsValue(use, param);\n return;\n }\n // a non-nil container arm hands the same map/list value on (as before copies were followed)\n if (parent?.kind === SyntaxKind.BinaryExpression) {\n const other: any = (parent.left === n) ? parent.right : parent.left;\n const isNullTest = (other?.kind === SyntaxKind.NullKeyword)\n || ((other?.kind === SyntaxKind.Identifier) && (other.text === 'undefined'));\n if (isNullTest) {\n // an `any` alias tests the box through IsEqual: a nil map box is not nil\n safe = pointer || !boxed;\n return;\n // `x == nil` / `x != nil`: native for a pointer and for a container\n // (a nil map compares equal to nil exactly like the untyped nil box\n // did when the value came in untyped); a value type never gets here.\n safe = true;\n return;\n }\n }\n if (parent?.kind === SyntaxKind.CallExpression) {\n const args: any[] = parent.arguments ?? [];\n const argIndex = args.indexOf(n);\n const callee: any = parent.expression;\n let calleeName = (callee?.name !== undefined) ? callee.name.text\n : ((callee?.text !== undefined) ? callee.text : undefined);\n // Math.min / Math.max print as the deref-aware mathMin / mathMax\n if ((callee?.expression?.text === 'Math') && ((calleeName === 'min') || (calleeName === 'max'))) {\n calleeName = 'math' + calleeName.charAt(0).toUpperCase() + calleeName.slice(1);\n }\n if (calleeName === undefined) {\n safe = !pointer && !nilable;\n return;\n }\n const verdict = verdictOf(calleeName, argIndex);\n if ((verdict === 'unsafe') || ((verdict === 'container') && nilable)) {\n safe = false;\n return;\n }\n if ((calleeName === 'IsEqual') && nilable) {\n // IsEqual(x, nil) tests the *box*: an untyped nil answered true, a nil\n // map is not equal to nil\n const other: any = (argIndex === 0) ? args[1] : args[0];\n const otherIsNil = (other === undefined) || (other?.kind === SyntaxKind.NullKeyword)\n || ((other?.kind === SyntaxKind.Identifier) && (other.text === 'undefined'));\n if (otherIsNil) {\n safe = false;\n return;\n }\n }\n // GetArg folds a nil map box to its default, and a defaulted position binds through GetArg or its\n // twins, which deref a pointer and fold a nil one: both read it as absent\n if (verdict === 'unknown') {\n safe = ((nilable && (goType === 'map[string]any')) || pointer) && this.goGetArgPositionIsDefaulted(callee, argIndex);\n return;\n }\n if (nilable && !pointer && this.goGetArgPassesIntoContainerDefault(callee, argIndex)) {\n safe = false;\n return;\n }\n safe = true;\n return;\n }\n if (parent?.kind === SyntaxKind.ExpressionStatement) {\n safe = true; // `_ = x` and other inert statements\n return;\n }\n if (pointer && this.goGetArgPointerStoredAsValue(n, param)) {\n safe = true;\n return;\n }\n if (pointer && this.goGetArgPointerInHelperArithmetic(n)) {\n safe = true;\n return;\n }\n // a bare read hands the local on as `any`: a pointer or a nil-defaulted container would\n // no longer compare equal to nil there, so both keep the box\n safe = !pointer && !nilable;\n return;\n }\n }\n n.forEachChild(visit);\n };\n body.forEachChild(visit);\n return safe;\n }\n\n // `x / 1000`, `x - 1`, `x > 0`: printed through Divide/Subtract/…/IsGreaterThan, which\n // derefScalar both operands at entry (checked on the printed text by the caller's diff)\n goGetArgPointerInHelperArithmetic(n: any): boolean {\n const parent: any = n.parent;\n if (parent?.kind !== SyntaxKind.BinaryExpression) {\n return false;\n }\n const ops = [SyntaxKind.SlashToken, SyntaxKind.MinusToken, SyntaxKind.AsteriskToken, SyntaxKind.PercentToken,\n SyntaxKind.GreaterThanToken, SyntaxKind.LessThanToken, SyntaxKind.GreaterThanEqualsToken, SyntaxKind.LessThanEqualsToken];\n if (!ops.includes(parent.operatorToken?.kind)) {\n return false;\n }\n const printed = this.printNode(parent, 0).trim();\n return /^(?:\\(\\s*)*(?:Divide|Subtract|Multiply|Mod|IsGreaterThan|IsLessThan|IsGreaterThanOrEqual|IsLessThanOrEqual)\\(/.test(printed);\n }\n\n // `request[k] = x` / `{ k: x }`: the pointer lands in an `any` dictionary whose readers\n // (GetValue, Urlencode, Json, IsEqual) derefScalar it; a `*Request` builder returns that\n // dictionary to its caller, so it keeps the box\n goGetArgPointerStoredAsValue(n: any, param: any): boolean {\n const parent: any = n.parent;\n const stored = ((parent?.kind === SyntaxKind.BinaryExpression) && (parent.right === n)\n && (parent.operatorToken?.kind === SyntaxKind.EqualsToken)\n && (parent.left?.kind === SyntaxKind.ElementAccessExpression))\n || ((parent?.kind === SyntaxKind.PropertyAssignment) && (parent.initializer === n));\n let method: any = param?.parent;\n while ((method !== undefined) && !isFunctionLike(method)) {\n method = method.parent;\n }\n const methodName = String(method?.name?.text ?? '');\n return stored && !methodName.endsWith('Request');\n }\n\n // element `index` of a tuple-typed call result is `Dict` (`[T, Dict]`); the Go tuple holds\n // that map, so MapTyped reads the same dictionary back\n goTupleElementIsDict(right: any, index: number): boolean {\n const checker: any = this.checkerOrUndefined();\n if ((checker === undefined) || (index < 0)) {\n return false;\n }\n const expr: any = (right?.kind === SyntaxKind.AwaitExpression) ? right.expression : right;\n if (expr?.kind !== SyntaxKind.CallExpression) {\n return false;\n }\n const type: any = checker.getTypeAtLocation(expr);\n if ((type === undefined) || !checker.isTupleType(type)) {\n return this.goParamsTupleHelperIndex(expr) === index;\n }\n const element: any = checker.getTypeArguments(type)?.[index];\n return (element !== undefined) && !(element.flags & (TypeFlags.Any | TypeFlags.Unknown))\n && this.goParameterTypeIsDict(element);\n }\n\n // `this.handleXxx(…, params, …)` of a base helper typed `any[]` whose element holds the params\n // map it was given after omit/extend; only when that element is the same map-typed local\n goParamsTupleHelperIndex(call: any): number {\n const callee: any = call?.expression;\n if ((callee?.kind !== SyntaxKind.PropertyAccessExpression) || (callee.expression?.kind !== SyntaxKind.ThisKeyword)) {\n return -1;\n }\n const index = GO_PARAMS_TUPLE_HELPERS[callee.name?.text];\n if (index === undefined) {\n return -1;\n }\n const target: any = call.parent?.left?.elements?.[index];\n const passesTarget = (target?.kind === SyntaxKind.Identifier)\n && (call.arguments ?? []).some((a: any) => (a.kind === SyntaxKind.Identifier) && (a.text === target.text));\n return passesTarget ? index : -1;\n }\n\n // the safety check of a map-typed GetArg local: a Dict tuple element written into it is printed\n // through MapTyped once the local is bound as a map (no recursion into goGetArgLocalType)\n goGetArgTupleWriteIsDict(declaration: any, right: any, index: number): boolean {\n return (declaration?.kind === SyntaxKind.Parameter) && (declaration.initializer !== undefined)\n && this.goTupleElementIsDict(right, index);\n }\n\n // `[x, params] = f()` writes a GetArg local bound as map[string]any: unbox the element\n goGetArgBindsDictElement(leftElement: any, right: any, index: number): boolean {\n if ((leftElement?.kind !== SyntaxKind.Identifier) || !this.goTupleElementIsDict(right, index)) {\n return false;\n }\n let decl: any;\n try {\n decl = this.checkerOrUndefined()?.getSymbolAtLocation(leftElement)?.valueDeclaration?.resolve();\n } catch (e) {\n decl = undefined;\n }\n if ((decl?.kind !== SyntaxKind.Parameter) || (decl.initializer === undefined) || (decl.parent?.body === undefined)) {\n return false;\n }\n return this.goGetArgParameterType(decl) === 'map[string]any';\n }\n\n // the Go type a defaulted parameter's GetArg twin binds (undefined: the `any` GetArg); the one\n // predicate shared by the binding line and every consumer's printing\n goGetArgParameterType(decl: any): string | undefined {\n if ((decl?.kind !== SyntaxKind.Parameter) || (decl.initializer === undefined) || (decl.dotDotDotToken !== undefined)\n || (decl.name?.kind !== SyntaxKind.Identifier) || (decl.parent?.body === undefined)\n || ![SyntaxKind.MethodDeclaration, SyntaxKind.FunctionDeclaration].includes(decl.parent.kind)) {\n return undefined;\n }\n this.goGetArgTypeCache ??= new WeakMap();\n if (!this.goGetArgTypeCache.has(decl)) {\n this.goGetArgTypeCache.set(decl, undefined);\n this.goGetArgTypeComputing ??= new Set();\n this.goGetArgTypeComputing.add(decl);\n let goType: string | undefined;\n try {\n goType = this.goGetArgLocalType(decl.parent.body, decl, this.printNode(decl.initializer, 0));\n } finally {\n this.goGetArgTypeComputing.delete(decl);\n }\n this.goGetArgTypeCache.set(decl, (goType !== undefined) && (this.goGetArgTwinName(goType) !== undefined) ? goType : undefined);\n }\n return this.goGetArgTypeCache.get(decl);\n }\n\n // argument `argIndex` of the callee binds a parameter with a TypeScript default (GetArg-bound)\n goGetArgPositionIsDefaulted(callee: any, argIndex: number): boolean {\n if (argIndex < 0) {\n return false;\n }\n let decl: any;\n try {\n decl = this.getChecker().getSymbolAtLocation(callee)?.valueDeclaration?.resolve();\n } catch (e) {\n decl = undefined;\n }\n const kinds = [SyntaxKind.MethodDeclaration, SyntaxKind.FunctionDeclaration];\n const param: any = (decl !== undefined) && kinds.includes(decl.kind) ? decl.parameters?.[argIndex] : undefined;\n return (param?.initializer !== undefined) && (param.dotDotDotToken === undefined);\n }\n\n // the callee's own GetArg with a container default returns def for an untyped nil box but the\n // nil map for a nil map box (nil slices collapse to def), so only map shapes differ\n goGetArgPassesIntoContainerDefault(callee: any, argIndex: number): boolean {\n if (argIndex < 0) {\n return false;\n }\n let symbol;\n try {\n symbol = this.getChecker().getSymbolAtLocation(callee);\n } catch (e) {\n symbol = undefined;\n }\n const decl: any = symbol?.valueDeclaration?.resolve();\n const params: any[] = decl?.parameters ?? [];\n const param: any = params[argIndex];\n const initializer: any = param?.initializer;\n if (initializer === undefined) {\n return false;\n }\n return initializer.kind === SyntaxKind.ObjectLiteralExpression;\n }\n\n printFunctionBody(node, identation, wrapInChannel = false) {\n\n // check if there is any default parameter to initialize\n let functionBody: string;\n const funcParams = node.parameters;\n const initParams = [];\n if (funcParams.length > 0) {\n const body = node.body.statements;\n const first = body.length > 0 ? body[0] : [];\n const remaining = body.length > 0 ? body.slice(1): [];\n let firstStatement = this.printNode(first, identation + 1);\n\n const remainingString = remaining.map((statement) => this.printNode(statement, identation + 1)).join(\"\\n\");\n let offSetIndex = 0;\n funcParams.forEach((param, i) => {\n const initializer = param.initializer;\n if (initializer) {\n const index = i + offSetIndex;\n // index = index < 0 ? 0 : i - 1;\n const paramName = this.printNode(param.name, 0);\n const printedDefault = this.printNode(initializer, 0);\n // a default that names a Go type exactly binds through its typed twin; others keep GetArg (ABI unchanged)\n const goType = this.goGetArgParameterType(param);\n const twinName = (goType !== undefined) ? this.goGetArgTwinName(goType) : undefined;\n if ((goType !== undefined) && (twinName !== undefined)) {\n initParams.push(`var ${paramName} ${goType} = ${twinName}(optionalArgs, ${index}, ${printedDefault})`);\n } else {\n initParams.push(`${paramName} := GetArg(optionalArgs, ${index}, ${printedDefault})`);\n }\n initParams.push(`_ = ${paramName}`);\n } else {\n offSetIndex--;\n }\n });\n\n if (initParams.length > 0) {\n const defaultInitializers = initParams.map( l => this.getIden(identation+1) + l ).join(\"\\n\") + \"\\n\";\n const bodyParts = firstStatement.split(\"\\n\");\n const commentPart = bodyParts.filter(line => this.isComment(line));\n const isComment = commentPart.length > 0;\n if (isComment) {\n // the statement's leading comment must keep the ' * ' continuation-alignment\n // of printLeadingComments: gofmt re-indents a /* */ block to\n // ` * text` (printer.stripCommonPrefix + the tab indent), so a bare\n // trim() here would emit `* text` under the '/**'.\n const commentPartString = commentPart.map((c) => {\n const line = c.trim();\n return this.getIden(identation+1) + (line.startsWith(\"*\") ? \" \" + line : line);\n }).join(\"\\n\");\n const firstStmNoComment = bodyParts.filter(line => !this.isComment(line)).join(\"\\n\");\n firstStatement = commentPartString + \"\\n\" + defaultInitializers + firstStmNoComment;\n } else {\n firstStatement = defaultInitializers + firstStatement;\n }\n }\n const blockOpen = this.getBlockOpen(identation);\n const blockClose = this.getBlockClose(identation);\n firstStatement = remainingString.length > 0 ? firstStatement + \"\\n\" : firstStatement;\n if (!wrapInChannel) {\n functionBody = blockOpen + firstStatement + remainingString + blockClose;\n } else {\n functionBody = firstStatement + remainingString;\n }\n } else {\n if (!wrapInChannel) {\n functionBody = super.printFunctionBody(node, identation);\n } else {\n functionBody = node.body.statements.map(statement => this.printNode(statement, identation + 1)).join(\"\\n\");\n }\n }\n if (wrapInChannel) {\n // return statement might be inside ifs or other complex statements so we still have to replace them manually :(\n // functionBody = functionBody.replace(/(\\s*)return\\s+([^\\n]+\\n?)/g, '$1ch <- $2$1');\n // the body half of the trampoline pair is a flat function body: the statements\n // are already printed at their own level, so no extra indentation level is added here\n const lastLine = functionBody.split(\"\\n\").pop().trim();\n // no trailing return after a return/panic or a conditional that returns in all branches\n const shouldAddLastReturn = !lastLine.startsWith(\"return\") && !lastLine.startsWith(\"panic\")\n && !(node.body && this.blockEndsWithConditionalReturn(node.body.statements));\n\n // This is the *body* half of the trampoline pair (see printAsyncTrampolineBlock):\n //\n // func (this *Exchange) fetchTickerBody(ch chan any, symbol any) any {\n // defer close(ch)\n // defer ReturnPanicError(ch)\n // ch <- ...\n // return nil\n // }\n //\n // It is a plain flat function: the trampoline already `go`es it, so there is no\n // `go func() any {...}()` envelope here, and no channel allocation either — the\n // trampoline owns `ch` and hands it in. The recover lives HERE, on the goroutine\n // that can actually panic, which is why the trampoline's result can stay unnamed.\n const lines = [\n \"{\",\n `${this.getIden(identation + 1)}defer close(ch)`,\n `${this.getIden(identation + 1)}defer ReturnPanicError(ch)`,\n functionBody,\n ];\n if (shouldAddLastReturn) {\n lines.push(this.getIden(identation+1) + \"return nil\");\n }\n lines.push(`${this.getIden(identation)}}`);\n functionBody = lines.join(\"\\n\");\n\n // to do fix this later\n // we can't pass nil to the channel when we just want to\n // return from the try catch, otherwise the channel will close with nil\n // instead of the proper result\n functionBody = functionBody.replaceAll(/(^\\s*)ch\\s<-\\snil\\s+return\\snil(\\s*\\})/gm, \"$1return nil$2\");\n\n }\n\n return functionBody;\n }\n\n printAwaitExpression(node, identation) {\n const expression = this.printNode(node.expression, identation);\n if (expression.startsWith(\"<-\")) {\n return expression;\n }\n return `(<-${expression})`;\n }\n\n printInstanceOfExpression(node: BinaryExpression, identation: number): string {\n const left = this.printNode (node.left);\n const right = this.printNode (node.right);\n return this.getIden(identation) + `IsInstance(${left}, ${right})`;\n }\n\n getLineBasedSuffix(node): string {\n const { line, character } = this.getSrc().getLineAndCharacterOfPosition(node.getStart());\n return `${line}${character}`;\n }\n\n printExpressionStatement(node, identation) {\n\n if (node?.expression?.kind === SyntaxKind.AsExpression) {\n node = node.expression;\n }\n if (node.expression.kind !== SyntaxKind.AwaitExpression) {\n return this.stripWhitespaceOnlyLines (super.printExpressionStatement(node, identation));\n }\n\n const exprStm = this.printNode(node.expression, identation);\n\n // const { line, character } = this.getSrc().getLineAndCharacterOfPosition(node.getStart());\n // console.log(`line: ${line}, character: ${character}`);\n const returnRandName = \"retRes\" + this.getLineBasedSuffix(node);\n\n // const expStatement =this.getIden(identation) + exprStm + this.LINE_TERMINATOR;\n\n // the awaited call's value is discarded here (`await this.loadMarkets();`), so the\n // extension may still name it: `var retResNNN T = MapTyped(PanicOnError(<-...))`\n const stmtUnbox = this.goAwaitReceiveUnbox(node.expression, exprStm);\n const expStatement = (stmtUnbox !== undefined)\n ? `\n${this.getIden(identation)}var ${returnRandName} ${stmtUnbox.goType} = ${stmtUnbox.wrap(exprStm)}`\n // the discarded value needs no local: PanicOnError still surfaces the channel's error\n : `\n${this.getIden(identation)}PanicOnError(${exprStm.trim()})`;\n return this.printNodeCommentsIfAny(node, identation, expStatement);\n }\n\n isInsideAsyncFunction(returnStatementNode) {\n let currentNode = returnStatementNode;\n\n while (currentNode) {\n // Check if the current node is a function or method\n if (isFunctionDeclaration(currentNode) ||\n isFunctionExpression(currentNode) ||\n isArrowFunction(currentNode) ||\n isMethodDeclaration(currentNode)) {\n return this.isAsyncFunction(currentNode);\n }\n // Move up the tree to the parent node\n currentNode = currentNode.parent;\n }\n\n // Return false if no async function or method is found\n return false;\n }\n\n /**\n * Statement that terminates an async (channel returning) function body.\n *\n * The body is the trampoline's sibling method (`go this.fetchTickerBody(ch, ...)`),\n * and the synthetic try/catch closures nest inside it: in both cases `return` leaves\n * a function whose result is a plain `any`, never the channel. The trampoline itself\n * owns the single `return ch`, emitted by printFunctionBody.\n */\n getAsyncReturnStatement(node): string {\n return \"return nil\";\n }\n\n printReturnStatement(node, identation) {\n\n const isAsyncFunction = this.isInsideAsyncFunction(node);\n // if (node?.expression?.kind !== SyntaxKind.AwaitExpression) {\n // return super.printReturnStatement(node, identation);\n // }\n if (!isAsyncFunction) {\n return super.printReturnStatement(node, identation);\n }\n\n const leadingComment = this.printLeadingComments(node, identation);\n let trailingComment = this.printTraillingComment(node, identation);\n trailingComment = trailingComment ? \" \" + trailingComment : trailingComment;\n const exp = node.expression;\n let rightPart = exp ? (' ' + this.printNode(exp, identation)) : '';\n rightPart = rightPart.trim();\n\n // `return nil` only exits the synthetic try/catch closure; at the function's own\n // level the async core has to hand the (named) result channel back instead.\n const returnStatement = this.getAsyncReturnStatement(node);\n\n if (node?.expression?.kind === SyntaxKind.AsExpression) {\n node = node.expression;\n }\n\n if (node?.expression?.kind === SyntaxKind.AwaitExpression) {\n const returnRandName = \"retRes\" + this.getLineBasedSuffix(node.expression);\n // the template's `:= ` already supplies the separator; keep the printed expression\n // flush so the receive reads `retResNNN := (<-this.X())` (gofmt spacing)\n const printedExpr = rightPart;\n rightPart = rightPart ? rightPart + this.LINE_TERMINATOR : this.LINE_TERMINATOR;\n // return leadingComment + this.getIden(identation) + this.RETURN_TOKEN + rightPart + trailingComment;\n // printLeadingComments returns the comment lines with their own indentation and a\n // trailing newline, so the comment is emitted as its own line(s) and the `ch <-`\n // line carries the indentation the comment would otherwise have swallowed.\n const retUnbox = this.goAwaitReceiveUnbox(node.expression, printedExpr);\n if (retUnbox !== undefined) {\n return `\n${this.getIden(identation)}var ${returnRandName} ${retUnbox.goType} = ${retUnbox.wrap(printedExpr)}\n${leadingComment}${this.getIden(identation)}ch <- ${returnRandName}${trailingComment}\n${this.getIden(identation)}${returnStatement}`;\n }\n return `\n${this.getIden(identation)}${returnRandName} := ${rightPart}\n${this.getIden(identation)}PanicOnError(${returnRandName})\n${leadingComment}${this.getIden(identation)}ch <- ${returnRandName}${trailingComment}\n${this.getIden(identation)}${returnStatement}`;\n // ${this.getIden(identation)}return ${returnRandName}`;\n }\n\n if (rightPart.length === 0) {\n return `\\n${this.getIden(identation)}${returnStatement}`;\n }\n\n return `\n${leadingComment}${this.getIden(identation)}ch <- ${rightPart}${trailingComment}\n${this.getIden(identation)}${returnStatement}`;\n // ${this.getIden(identation)}return ${rightPart}`;\n // ${this.getIden(identation)}return ${rightPart}`;\n }\n\n\n printArrayLiteralExpression(node, identation = 0) {\n // elements that span lines (object literals, calls carrying one) need the\n // statement's own level so their bodies land one level deeper\n // …but an element is inline after `{`, so any leading indent a printer prepends is trimmed\n // go/printer prints composite literal elements at depth 1 (exprList(..., 1, ...))\n const elements = node.elements.map((e) => this.goWithExprDepth(1, () => this.printNode(e, identation)).trim()).join(\", \");\n // a list of calls (promises included) always opens as `[]any{`; getFunctionType is kept for its\n // checker side effect (it caches a signature on the call node)\n const first = node.elements[0];\n const arrayOpen = (first?.kind === SyntaxKind.CallExpression) && (this.getFunctionType(first) || true)\n ? '[]any{' : this.ARRAY_OPENING_TOKEN;\n return arrayOpen + elements + this.ARRAY_CLOSING_TOKEN;\n }\n\n printArgsForCallExpression(node, identation) {\n const unified = this.goUnifiedStringCallArgs(node, identation);\n if (unified !== undefined) {\n return unified;\n }\n // go/printer prints the arguments of a call with more than one argument\n // one level deeper than the call itself (nodes.go, CallExpr)\n if (node.arguments && node.arguments.length > 1) {\n return this.goWithExprDepth(this.goExprDepth + 1, () => super.printArgsForCallExpression(node, identation));\n }\n return super.printArgsForCallExpression(node, identation);\n }\n\n // check this out later\n\n // IsArray(v) answers true exactly for the slice types its runtime type switch lists\n // and false for every other box, a nil box included. On an operand whose Go type the\n // printer can name the predicate is that constant.\n isArraySliceTypes = [ '[]any', '[][]any', '[]map[string]any', '[]string', '[]bool',\n '[]int', '[]int8', '[]int16', '[]int32', '[]int64', '[]float32', '[]float64',\n '[]uint', '[]uint8', '[]uint16', '[]uint32', '[]uint64' ];\n\n // the other Go types the printer can name: a map, a string, a bool, a number, or a\n // pointer to a scalar — none of them is a slice the switch matches\n isArrayNonSliceTypes = [ 'map[string]any', 'string', 'bool', 'int', 'int64', 'float64',\n '*string', '*int64', '*float64', '*bool', '*int' ];\n\n // true when the identifier keeps a reference besides this one: the constant fold\n // drops the call's reference to the operand, and Go rejects a local that ends up\n // unused, so an operand without another use keeps the helper\n goIdentifierUsedElsewhere(nameNode): boolean {\n const scope = this.goEnclosingFunction(nameNode);\n if (scope === undefined) {\n return false;\n }\n const name = nameNode.text;\n let used = false;\n const visit = (n) => {\n if (used) {\n return;\n }\n if ((n.kind === SyntaxKind.Identifier) && (n.text === name) && (n !== nameNode)) {\n const parent = n.parent;\n const isDeclarationName = (parent?.kind === SyntaxKind.VariableDeclaration) && (parent.name === n);\n const isPropertyName = (parent?.kind === SyntaxKind.PropertyAccessExpression) && (parent.name === n);\n if (!isDeclarationName && !isPropertyName) {\n used = true;\n return;\n }\n }\n n.forEachChild(visit);\n };\n scope.forEachChild(visit);\n return used;\n }\n\n // the local is printed `any` yet every value that reaches it is a []any: it starts\n // from a slice initializer and no later statement rebinds it (a push only appends\n // to the same slice), so the box holds a []any at every use\n goLocalHoldsOnlyArrays(nameNode): boolean {\n const checker: any = this.checkerOrUndefined();\n if (checker === undefined) {\n return false;\n }\n const symbol = checker.getSymbolAtLocation(nameNode);\n const declaration: any = symbol?.valueDeclaration?.resolve();\n if ((declaration?.kind !== SyntaxKind.VariableDeclaration) || (declaration.initializer === undefined)) {\n return false;\n }\n if (this.goTypeOfInitializer(declaration.initializer, this.printNode(declaration.initializer, 0)) !== '[]any') {\n return false;\n }\n const scope = this.goEnclosingFunction(declaration);\n if (scope === undefined) {\n return false;\n }\n const name = declaration.name.text;\n let safe = true;\n const visit = (n) => {\n if (!safe) {\n return;\n }\n if ((n.kind === SyntaxKind.Identifier) && (n.text === name) && (n !== declaration.name) && (n !== nameNode)) {\n const parent = n.parent;\n if (parent?.kind === SyntaxKind.VariableDeclaration && parent.name === n) {\n return; // a sibling block-scoped declaration; it gets its own type\n }\n if (this.goRebindingTargetOf(n) !== undefined) {\n safe = false; // a rebinding write can box another type\n return;\n }\n }\n n.forEachChild(visit);\n };\n scope.forEachChild(visit);\n return safe;\n }\n\n // native IsArray: a constant for an operand whose Go type the printer proves, and\n // the two-value assertion on an `any` box that only ever holds a []any\n printNativeIsArray(node, parsedArg: string | undefined): string | undefined {\n if ((typeof parsedArg !== 'string') || parsedArg.includes('\\n')) {\n return undefined;\n }\n const argNode = node.arguments?.[0];\n if (argNode?.kind !== SyntaxKind.Identifier) {\n return undefined; // a call operand may have effects and has no declared type\n }\n const goType = this.goPrintedTypeOfExpression(argNode, parsedArg);\n if (goType !== undefined) {\n const isSlice = this.isArraySliceTypes.indexOf(goType) >= 0;\n if (isSlice || (this.isArrayNonSliceTypes.indexOf(goType) >= 0)) {\n return this.goIdentifierUsedElsewhere(argNode) ? (isSlice ? 'true' : 'false') : undefined;\n }\n return undefined;\n }\n if (!this.goLocalHoldsOnlyArrays(argNode)) {\n return undefined;\n }\n // the box only ever holds a []any, so the assertion answers what the type switch\n // would and keeps the operand referenced\n const read = `_, ok := ${parsedArg}.([]any)`;\n if (11 + read.length + 2 + 'return ok'.length <= 100) {\n return `func() bool { ${read}; return ok }()`;\n }\n const level = this.goStatementLevel;\n return `func() bool {\\n${this.getIden(level + 1)}${read}\\n${this.getIden(level + 1)}return ok\\n${this.getIden(level)}}()`;\n }\n\n printArrayIsArrayCall(node, identation, parsedArg = undefined) {\n return this.printNativeIsArray(node, parsedArg) ?? `IsArray(${parsedArg})`;\n }\n\n printObjectKeysCall(node, identation, parsedArg = undefined) {\n return `ObjectKeys(${parsedArg})`;\n }\n\n printObjectValuesCall(node, identation, parsedArg = undefined) {\n return `ObjectValues(${parsedArg})`;\n }\n\n printJsonParseCall(node, identation, parsedArg = undefined) {\n return `JsonParse(${parsedArg})`;\n }\n\n printJsonStringifyCall(node, identation, parsedArg = undefined) {\n return `JsonStringify(${parsedArg})`; // make this customizable\n }\n\n printPromiseAllCall(node, identation, parsedArg = undefined) {\n return `promiseAll(${parsedArg})`;\n }\n\n printMathFloorCall(node, identation, parsedArg = undefined) {\n return `MathFloor(${parsedArg})`;\n }\n\n printMathRoundCall(node, identation, parsedArg = undefined) {\n return `MathRound(${parsedArg})`;\n }\n\n printMathCeilCall(node, identation, parsedArg = undefined) {\n return `MathCeil(${parsedArg})`;\n }\n\n printNumberIsIntegerCall(node: any, identation: any, parsedArg?: any) {\n return `IsInt(${parsedArg})`;\n }\n\n // the base printer prints a method-call argument at the statement's depth; the\n // emitted Go call has two or more arguments, which go/printer lays out one level\n // deeper (a native `a + b` argument then drops its blanks)\n goPrintCallArgument(argument, printedText: string | undefined): string | undefined {\n if (argument?.kind !== SyntaxKind.BinaryExpression || printedText === undefined) {\n return printedText;\n }\n return this.goWithExprDepth(this.goExprDepth + 1, () => this.printNode(argument, 0)).trimStart();\n }\n\n printArrayPushCall(node: CallExpression, identation: number, name: string | undefined = undefined, parsedArg: string | undefined = undefined) {\n let returnValue = '';\n let returnRandName = name;\n parsedArg = this.goPrintCallArgument(node.arguments?.[0], parsedArg);\n // a `[]any` local is the slice itself, so it appends natively\n const nativeReceiver = this.goNativeAppendReceiver(node);\n if (nativeReceiver !== undefined) {\n return `${nativeReceiver} = append(${nativeReceiver}, ${parsedArg})`;\n }\n // a map/slice index or a GetValue box is not addressable: copy it into a local first\n if (name?.startsWith('GetValue') || /[\\])]$/.test(name ?? '')) {\n returnRandName = \"retRes\" + this.getLineBasedSuffix(node);\n returnValue = `${returnRandName} := ${name}\\n${this.getIden(identation)}`;\n }\n return `${returnValue}AppendToArray(&${returnRandName}, ${parsedArg})`;\n // works with:\n // func AppendToArray(slicePtr *any, element any)\n // func AppendToArrayValue(slice any, element any) any\n // func AppendToArraySafe(slice any, element any) any\n }\n\n printIncludesCall(node, identation, name = undefined, parsedArg = undefined) {\n return `Contains(${name}, ${parsedArg})`;\n }\n\n // the Go type an `indexOf` operand is printed as, or undefined for anything Go cannot\n // hand to strings.Index: an `any` box (a parameter, a GetValue/Ternary result), a\n // number, a slice. The receiver and the needle both have to be Go strings\n goIndexOfOperandType(node, printedText: string): string | undefined {\n if (this.goIsAnyBoxExpression(node, printedText)) {\n return undefined;\n }\n if (node?.kind === SyntaxKind.Identifier) {\n return this.goDeclaredTypeOfIdentifier(node);\n }\n if (GO_ANY_BOX_CALLS.indexOf(this.goPrintedCallee(printedText)) >= 0) {\n return undefined;\n }\n return this.goStringCallStaticType(node, printedText) ?? this.goStringFieldStaticType(node, printedText);\n }\n\n // The ccxt writers assemble four outputs from a *slice* of the printer output (base-class files\n // after their TRANSPILED marker, ws cache tests after their first separator), which would cut off\n // the leading file-level import; they keep the helper until their writer adds the import itself.\n goFileKeepsFileLevelImports(): boolean {\n const fileName = this.getSrc()?.fileName ?? '';\n return !/(?:base\\/Exchange(?:\\.nooverloads\\.\\d+)?|base\\/PredictionExchange|base\\/test\\.orderBook|base\\/test\\.cache)\\.ts$/.test(fileName);\n }\n\n // `GetIndexOf(s, t)` is `strings.Index(s, t)` for a receiver declared `string` once `t` is a\n // string too (`target.(string)` succeeds; -1 is both not-found answers); a `*string` receiver\n // answers -1 when nil, reproduced by the nil guard. Slices and `any` boxes keep the helper.\n goNativeIndexOf(node, name, parsedArg): string | undefined {\n if ((typeof name !== 'string') || (typeof parsedArg !== 'string')) {\n return undefined;\n }\n if (name.includes('\\n') || parsedArg.includes('\\n')) {\n return undefined;\n }\n if (!this.goFileKeepsFileLevelImports()) {\n return undefined;\n }\n const receiver = this.goUnwrapPrintedAssertions(node?.expression?.expression);\n const target = this.goUnwrapPrintedAssertions(node?.arguments?.[0]);\n if (this.goIndexOfOperandType(target, parsedArg) !== 'string') {\n return undefined; // a nilable/number needle answers -1 in the helper\n }\n const receiverType = this.goIndexOfOperandType(receiver, name);\n if (receiverType === 'string') {\n this.goFileStdlibImports.add('strings');\n return `strings.Index(${name}, ${parsedArg})`;\n }\n // the literal repeats the identifier, so the receiver is still read exactly once\n if ((receiverType === '*string') && (receiver?.kind === SyntaxKind.Identifier)) {\n this.goFileStdlibImports.add('strings');\n const level = this.goStatementLevel;\n const body = this.getIden(level + 1);\n const inner = this.getIden(level + 2);\n return `func() int {\\n${body}if ${name} == nil {\\n${inner}return -1\\n${body}}\\n${body}return strings.Index(*${name}, ${parsedArg})\\n${this.getIden(level)}}()`;\n }\n return undefined;\n }\n\n printIndexOfCall(node, identation, name = undefined, parsedArg = undefined) {\n const native = this.goNativeIndexOf(node, name, parsedArg);\n if (native !== undefined) {\n return native;\n }\n return `${this.INDEXOF_WRAPPER_OPEN}${name}, ${parsedArg}${this.INDEXOF_WRAPPER_CLOSE}`;\n }\n\n // A native string operation needs every operand to be a Go `string`: a proven one prints as is,\n // a `*string` goDerefableStringOperand proves non-nil prints as its pointee (the helper's nil\n // branch is unreachable). A regex literal is a pattern, never a string: undefined keeps the helper.\n goNativeStringOperandTexts(operands: any[], texts: string[], expected: string[]): string[] | undefined {\n const result: string[] = [];\n for (let i = 0; i < expected.length; i++) {\n const operand = operands[i];\n if (operand === undefined || operand.kind === SyntaxKind.RegularExpressionLiteral) {\n return undefined;\n }\n if (this.goOperandStaticType(operand, texts[i]) === expected[i]) {\n result.push(texts[i]);\n } else if ((expected[i] === 'string') && !texts[i].includes('\\n') && this.goDerefableStringOperand(operand)) {\n result.push('*' + texts[i].trim());\n } else {\n return undefined;\n }\n }\n return result;\n }\n\n // `(x as T)` and `(x)` print as `x`, so the operand's own Go type governs the printed receiver\n goUnwrapPrintedAssertions(node) {\n while ((node?.kind === SyntaxKind.AsExpression) || (node?.kind === SyntaxKind.ParenthesizedExpression)) {\n node = node.expression;\n }\n return node;\n }\n\n // the native string call (built from the proven operand texts, `*`-dereferenced where needed) when\n // every operand matches `expected` and the file's stdlib import can be placed (see\n // goStdlibImportIsPlaceable), else the helper call; an unprinted argument keeps the helper\n goNativeStringCallOr(node, texts: string[], expected: string[], nativeCall: (ops: string[]) => string, helperCall: string, unwrapReceiver = false): string {\n const receiver = unwrapReceiver ? this.goUnwrapPrintedAssertions(node.expression?.expression) : node.expression?.expression;\n const operands = [receiver, ...expected.slice(1).map((_, i) => node.arguments?.[i])];\n const ops = texts.slice(1).includes(undefined) ? undefined : this.goNativeStringOperandTexts(operands, texts, expected);\n if ((ops !== undefined) && this.goStdlibImportIsPlaceable()) {\n this.goFileStdlibImports.add('strings');\n return nativeCall(ops);\n }\n return helperCall;\n }\n\n // The native string calls need `import \"strings\"` before the file's first declaration. Every ccxt\n // consumer splices the body at file head, except build/goTranspiler.ts#transpileBaseMethods and\n // #transpilePredictionBaseMethods; those keep the helper until getGoImports(file) declares it.\n goStdlibImportIsPlaceable(): boolean {\n return this.goFileKeepsFileLevelImports();\n }\n\n printStartsWithCall(node, identation, name = undefined, parsedArg = undefined) {\n // `s.startsWith (p)` -> strings.HasPrefix\n return this.goNativeStringCallOr(node, [name, parsedArg], ['string', 'string'],\n (o) => `strings.HasPrefix(${o[0]}, ${o[1]})`, `StartsWith(${name}, ${parsedArg})`);\n }\n\n printEndsWithCall(node, identation, name = undefined, parsedArg = undefined) {\n // `s.endsWith (p)` -> strings.HasSuffix\n return this.goNativeStringCallOr(node, [name, parsedArg], ['string', 'string'],\n (o) => `strings.HasSuffix(${o[0]}, ${o[1]})`, `EndsWith(${name}, ${parsedArg})`);\n }\n\n printTrimCall(node, identation, name = undefined) {\n return `Trim(${name})`;\n }\n\n printJoinCall(node, identation, name = undefined, parsedArg = undefined) {\n // `a.join (sep)` -> strings.Join: only a declared `[]string` receiver can skip the\n // per-element ToString the helper applies to a []any\n return this.goNativeStringCallOr(node, [name, parsedArg], ['[]string', 'string'],\n (o) => `strings.Join(${o[0]}, ${o[1]})`, `Join(${name}, ${parsedArg})`);\n }\n\n printSplitCall(node, identation, name = undefined, parsedArg = undefined) {\n // `s.split (sep)` -> strings.Split, which keeps JS's empty trailing element\n // (\"a,\" -> [\"a\", \"\"]) exactly like the helper's own strings.Split call\n return this.goNativeStringCallOr(node, [name, parsedArg], ['string', 'string'],\n (o) => `strings.Split(${o[0]}, ${o[1]})`, `Split(${name}, ${parsedArg})`);\n }\n\n printToFixedCall(node, identation, name = undefined, parsedArg = undefined) {\n return `toFixed(${name}, ${parsedArg})`;\n }\n\n // ToString is the identity on a Go string (exchange_helpers.go: derefScalar and `case string`\n // return it unchanged), so a receiver declared `string` prints as itself. An `any` box, a\n // *string (derefScalar answers nil) or a float64 keeps the helper's runtime formatting.\n printToStringCall(node, identation, name = undefined) {\n if ((name !== undefined) && (name.indexOf('\\n') < 0)) {\n const receiver = (node?.expression?.kind === SyntaxKind.PropertyAccessExpression)\n ? node.expression.expression\n : undefined;\n if ((receiver !== undefined) && (this.goOperandStaticType(receiver, name) === 'string')) {\n return name;\n }\n // a non-nil `*string`: derefScalar hands ToString the pointee, returned unchanged\n if ((receiver !== undefined) && this.goDerefableStringOperand(receiver)) {\n return '*' + name.trim();\n }\n // an int64 prints its decimal digits in both: the helper's Sprintf(\"%d\") and FormatInt\n if ((receiver !== undefined) && (this.goOperandStaticType(receiver, name) === 'int64') && this.goStdlibImportIsPlaceable()) {\n this.goFileStdlibImports.add('strconv');\n return `strconv.FormatInt(${name}, 10)`;\n }\n }\n return `ToString(${name})`;\n }\n\n printConcatCall(node, identation, name = undefined, parsedArg = undefined) {\n return `Concat(${name}, ${parsedArg})`;\n }\n\n printToUpperCaseCall(node, identation, name = undefined) {\n // `s.toUpperCase ()` -> strings.ToUpper\n return this.goNativeStringCallOr(node, [name], ['string'], (o) => `strings.ToUpper(${o[0]})`, `ToUpper(${name})`, true);\n }\n\n printToLowerCaseCall(node, identation, name = undefined) {\n // `s.toLowerCase ()` -> strings.ToLower\n return this.goNativeStringCallOr(node, [name], ['string'], (o) => `strings.ToLower(${o[0]})`, `ToLower(${name})`, true);\n }\n\n printShiftCall(node, identation, name = undefined) {\n return `Shift(${name})`;\n }\n\n printReverseCall(node, identation, name = undefined) {\n return `Reverse(${name})`;\n }\n\n printPopCall(node, identation, name = undefined) {\n return `Pop(${name}))`;\n }\n\n printAssertCall(node, identation, parsedArgs) {\n return `assert(${parsedArgs})`;\n }\n\n // `x.slice(a)` / `x.slice(a, b)` prints `Slice(x, a, b)`, a JS slice on a string: a\n // negative bound counts from the end, a start-only call clamps its start to 0 and an\n // end past len is clamped to len, where Go's native slicing panics\n goSliceLiteralBound(node): number | undefined {\n if (node?.kind === SyntaxKind.NumericLiteral) {\n const text = node.text;\n if (!/^\\d+$/.test(text)) {\n return undefined;\n }\n const value = Number(text);\n return (value > 2147483647) ? undefined : value;\n }\n if ((node?.kind === SyntaxKind.PrefixUnaryExpression) && (node.operator === SyntaxKind.MinusToken)) {\n const operand = this.goSliceLiteralBound(node.operand);\n return (operand === undefined) ? undefined : -operand;\n }\n return undefined;\n }\n\n // the subscript for a string value, with the helper's own index arithmetic\n goSliceSubscript(value: string, start: number, hasEnd: boolean, end: number | undefined): string {\n const length = `len(${value})`;\n let startText;\n if (start >= 0) {\n startText = `${start}`;\n } else if (hasEnd) {\n startText = `${length} - ${-start}`;\n } else {\n startText = `max(${length} - ${-start}, 0)`;\n }\n if (!hasEnd) {\n return `${value}[${startText}:]`;\n }\n const endText = (end >= 0) ? `min(${end}, ${length})` : `${length} - ${-end}`;\n return `${value}[${startText}:${endText}]`;\n }\n\n // receiver of an inlinable `.slice(...)`: `string` prints a plain subscript and\n // `*string` a nil-guarded one, while anything else (an `any` box) keeps the helper.\n // A TS cast (`(id as string).slice(...)`) prints nothing, so it is transparent here.\n goSliceReceiverType(node): string | undefined {\n let receiverNode = node?.expression?.expression;\n while ((receiverNode?.kind === SyntaxKind.AsExpression) || (receiverNode?.kind === SyntaxKind.NonNullExpression)\n || (receiverNode?.kind === SyntaxKind.ParenthesizedExpression)) {\n receiverNode = receiverNode.expression;\n }\n if (receiverNode?.kind !== SyntaxKind.Identifier) {\n return undefined;\n }\n const goType = this.goPrintedTypeOfExpression(receiverNode, '');\n return ((goType === 'string') || (goType === '*string')) ? goType : undefined;\n }\n\n // the integer-literal bounds of a `.slice(a, b)` call; undefined when a bound is an\n // expression, whose Go value is not provably a non-negative int the subscript could take\n goSliceLiteralBounds(node): { start: number, hasEnd: boolean, end: number } | undefined {\n const args = node?.arguments ?? [];\n const start = this.goSliceLiteralBound(args[0]);\n if (start === undefined) {\n return undefined;\n }\n const hasEnd = args.length > 1;\n const end = hasEnd ? this.goSliceLiteralBound(args[1]) : undefined;\n if (hasEnd && (end === undefined)) {\n return undefined;\n }\n return { start, hasEnd, end };\n }\n\n // true when this `.slice(a, b)` call prints native Go slicing of a string value\n goIsNativeSliceCall(node): boolean {\n if (node?.kind !== SyntaxKind.CallExpression) {\n return false;\n }\n const callee: any = node.expression;\n if ((callee?.kind !== SyntaxKind.PropertyAccessExpression) || (callee.name?.text !== 'slice')) {\n return false;\n }\n if (this.goSliceReceiverType(node) === undefined) {\n return false;\n }\n return this.goSliceLiteralBounds(node) !== undefined;\n }\n\n // `x.slice(a, b)` -> `x[a:b]` when the receiver is a local the printer declares\n // `string` (or `*string`, which keeps the helper's nil -> \"\" branch as a guard) and\n // both bounds are integer literals. Any other bound or receiver keeps the helper.\n printInlineSlice(node, receiverText: string): string | undefined {\n if ((receiverText ?? '').includes('\\n')) {\n return undefined;\n }\n const goType = this.goSliceReceiverType(node);\n if (goType === undefined) {\n return undefined;\n }\n const bounds = this.goSliceLiteralBounds(node);\n if (bounds === undefined) {\n return undefined;\n }\n const { start, hasEnd, end } = bounds;\n if (goType === 'string') {\n return this.goSliceSubscript(receiverText, start, hasEnd, end);\n }\n const level = this.goStatementLevel;\n const body = this.getIden(level + 1);\n const branch = this.getIden(level + 2);\n const subscript = this.goSliceSubscript('str', start, hasEnd, end);\n return `func() string {\\n${body}if ${receiverText} == nil {\\n${branch}return \"\"\\n${body}}\\n${body}str := *${receiverText}\\n${body}return ${subscript}\\n${this.getIden(level)}}()`;\n }\n\n printSliceCall(node, identation, name = undefined, parsedArg = undefined, parsedArg2 = undefined) {\n parsedArg = this.goPrintCallArgument(node.arguments?.[0], parsedArg);\n parsedArg2 = this.goPrintCallArgument(node.arguments?.[1], parsedArg2);\n const nativeSlice = this.printInlineSlice(node, name);\n if (nativeSlice !== undefined) {\n return nativeSlice;\n }\n if (parsedArg2 === undefined){\n parsedArg2 = 'nil';\n }\n return `Slice(${name}, ${parsedArg}, ${parsedArg2})`;\n }\n\n printReplaceCall(node, identation, name = undefined, parsedArg = undefined, parsedArg2 = undefined) {\n // JS `replace` with a *string* pattern replaces the first occurrence only, which the\n // boxed helper (ReplaceAll for every argument) cannot express: with all three operands\n // proven strings, emit the count-1 form and the JS semantics exactly.\n return this.goNativeStringCallOr(node, [name, parsedArg, parsedArg2], ['string', 'string', 'string'],\n (o) => `strings.Replace(${o[0]}, ${o[1]}, ${o[2]}, 1)`, `Replace(${name}, ${parsedArg}, ${parsedArg2})`);\n }\n\n printReplaceAllCall(node, identation, name = undefined, parsedArg = undefined, parsedArg2 = undefined) {\n // `s.replaceAll (a, b)` replaces every occurrence, like the helper\n return this.goNativeStringCallOr(node, [name, parsedArg, parsedArg2], ['string', 'string', 'string'],\n (o) => `strings.ReplaceAll(${o[0]}, ${o[1]}, ${o[2]})`, `Replace(${name}, ${parsedArg}, ${parsedArg2})`);\n }\n\n printPadEndCall(node, identation, name, parsedArg, parsedArg2) {\n return `PadEnd(${name}, ${parsedArg}, ${parsedArg2})`;\n }\n\n printPadStartCall(node, identation, name, parsedArg, parsedArg2) {\n return `PadStart(${name}, ${parsedArg}, ${parsedArg2})`;\n }\n\n printDateNowCall(node, identation) {\n return \"DateNow()\";\n }\n\n printLengthProperty(node, identation, name = undefined) {\n const leftSide = this.printNode(node.expression, 0);\n // const type = (this.getChecker() as Checker).getTypeAtLocation(node.expression); // eslint-disable-line\n // this.warnIfAnyType(node, type.flags, leftSide, \"length\");\n return `GetLength(${leftSide})`;\n }\n\n // printPostFixUnaryExpression(node, identation) {\n // const {operand, operator} = node;\n // if (operand.kind === SyntaxKind.NumericLiteral) {\n // return super.printPostFixUnaryExpression(node, identation);\n // }\n // const leftSide = this.printNode(operand, 0);\n // const op = this.PostFixOperators[operator]; // todo: handle --\n // if (op === '--') {\n // return `postFixDecrement(ref ${leftSide})`;\n // }\n // return `postFixIncrement(ref ${leftSide})`;\n // }\n\n // printPrefixUnaryExpression(node, identation) {\n // const {operand, operator} = node;\n // if (operand.kind === SyntaxKind.NumericLiteral) {\n // return super.printPrefixUnaryExpression(node, identation);\n // }\n // if (operator === SyntaxKind.ExclamationToken) {\n // // not branch check falsy/turthy values if needed;\n // return this.PrefixFixOperators[operator] + this.printCondition(node.operand, 0);\n // }\n // const leftSide = this.printNode(operand, 0);\n // if (operator === SyntaxKind.PlusToken) {\n // return `prefixUnaryPlus(ref ${leftSide})`;\n // } else {\n // return `prefixUnaryNeg(ref ${leftSide})`;\n // }\n // }\n\n printConditionalExpression(node, identation) {\n const condition = this.goWithExprDepth(1, () => this.printCondition(node.condition, 0));\n if (!condition.includes('\\n')) {\n const whenTrue = this.goPrintTernaryBranch(node.whenTrue, 2);\n const whenFalse = this.goPrintTernaryBranch(node.whenFalse, 1);\n const inlined = this.printInlineTernary(condition, whenTrue, whenFalse, this.goTernaryResultType(node.whenTrue, whenTrue, node.whenFalse, whenFalse));\n if (inlined !== undefined) {\n return inlined;\n }\n }\n const whenTrue = this.printNode(node.whenTrue, 0);\n const whenFalse = this.printNode(node.whenFalse, 0);\n return `Ternary(${condition}, ${whenTrue}, ${whenFalse})`;\n }\n\n printDeleteExpression(node, identation) {\n const object = this.printNode (node.expression.expression, 0);\n const key = this.printNode (node.expression.argumentExpression, 0);\n return `Remove(${object}, ${key})`;\n }\n\n printThrowStatement(node, identation) {\n // const expression = this.printNode(node.expression, 0);\n // return this.getIden(node) + this.THROW_TOKEN + \" \" + expression + this.LINE_TERMINATOR;\n if (node.expression.kind === SyntaxKind.Identifier) {\n return this.getIden(identation) + 'panic(' + this.printNode(node.expression, 0) + ')' + this.LINE_TERMINATOR;\n }\n if (node.expression.kind === SyntaxKind.NewExpression) {\n const expression = node.expression;\n // handle throw new Error (Message)\n // and throw new x[a] (message)\n const argumentsExp = expression?.arguments ?? [];\n const parsedArg = argumentsExp.map(n => this.printNode(n, 0)).join(\",\") ?? '';\n const newExpression = this.printNode(expression.expression, 0);\n if (expression.expression.kind === SyntaxKind.Identifier) {\n // handle throw new X\n const id = expression.expression;\n const symbol = this.getChecker().getSymbolAtLocation(expression.expression);\n if (symbol) {\n const declarations = this.getChecker().getDeclaredTypeOfSymbol(symbol).getSymbol()?.declarations?.map((d) => d.resolve()) ?? [];\n const isClassDeclaration = declarations.find(l => l.kind === SyntaxKind.InterfaceDeclaration || l.kind === SyntaxKind.ClassDeclaration);\n if (isClassDeclaration){\n // return this.getIden(identation) + `${this.THROW_TOKEN} ${this.NEW_TOKEN} ${id.text} ((string)${parsedArg}) ${this.LINE_TERMINATOR}`;\n } else {\n // Go has no statement terminator: the two statements go on\n // their own lines (gofmt splits `a; b` exactly like this)\n return this.getIden(identation) + `throwDynamicException(${id.text}, ${parsedArg})\\n${this.getIden(identation)}return nil`;\n }\n }\n return this.getIden(identation) + `panic(${id.text}(${parsedArg}))${this.LINE_TERMINATOR}`;\n } else if (expression.expression.kind === SyntaxKind.ElementAccessExpression) {\n return this.getIden(identation) + `throwDynamicException(${newExpression}, ${parsedArg})`;\n }\n return super.printThrowStatement(node, identation);\n }\n // const newToken = this.NEW_TOKEN ? this.NEW_TOKEN + \" \" : \"\";\n // const newExpression = node.expression?.expression?.text;\n // // newExpression = newExpression ? newExpression : this.printNode(node.expression.expression, 0); // new Exception or new exact[string] check this out\n // // const args = node.expression?.arguments.map(n => this.printNode(n, 0)).join(\",\");\n // // const throwExpression = ` ${newToken}${newExpression}${this.LEFT_PARENTHESIS}((string)${args})${this.RIGHT_PARENTHESIS}`;\n // return this.getIden(identation) + this.THROW_TOKEN + throwExpression + this.LINE_TERMINATOR;\n }\n\n // -----------------------------------------------------------------------\n // gofmt-compatible spacing of the binary expressions this printer emits\n // -----------------------------------------------------------------------\n // go/printer (nodes.go) prints a binary expression with blanks around the\n // operator unless the expression sits deeper than the top level of a\n // statement: binaryExpr() asks cutoff() - which inspects the operator tree\n // through walkBinary() - and drops *both* blanks when the operator\n // precedence is below that cutoff. Level 4/5 operators (`+ - * / % & | ^\n // << >>`) therefore print as `a + b` at the top level but as `a+b`, `a[i+1]`\n // one level down; comparisons and `&&`/`||` (level 3 and below) always keep\n // their blanks.\n //\n // goExprDepth mirrors the depth go/printer tracks over the Go AST it is\n // about to emit: 1 at the start of every statement, +1 for an argument list\n // with more than one argument, +1 for an index expression, +1 for the right\n // operand of a binary expression, -1 inside parentheses (never below 1), and\n // back to 1 for composite literal elements.\n goExprDepth = 1;\n\n goWithExprDepth(depth: number, callback: () => T): T {\n const previous = this.goExprDepth;\n this.goExprDepth = depth < 1 ? 1 : depth;\n try {\n return callback();\n } finally {\n this.goExprDepth = previous;\n }\n }\n\n // go/token precedence of the operators this printer can print natively\n // (5 `* / % << >> & &^`, 4 `+ - | ^`, 3 comparisons, 2 `&&`, 1 `||`)\n goOperatorPrecedence(operator: string): number {\n switch (operator) {\n case '*': case '/': case '%': case '<<': case '>>': case '&': case '&^':\n return 5;\n case '+': case '-': case '|': case '^':\n return 4;\n case '==': case '!=': case '<': case '<=': case '>': case '>=':\n return 3;\n case '&&':\n return 2;\n case '||':\n return 1;\n }\n return 0;\n }\n\n // the operator string a node is printed as when it stays a Go binary\n // expression, or undefined when the node becomes a helper call or is not\n // binary at all - a primary expression, which walkBinary() never looks into\n goNativeBinaryOperator(node): string | undefined {\n if (!node || !isBinaryExpression(node)) {\n return undefined;\n }\n const kind = node.operatorToken.kind;\n if (kind === SyntaxKind.EqualsToken || kind === SyntaxKind.PlusEqualsToken ||\n kind === SyntaxKind.MinusEqualsToken || kind === SyntaxKind.InKeyword ||\n kind === SyntaxKind.InstanceOfKeyword || kind in this.binaryExpressionsWrappers) {\n return undefined;\n }\n const operator = this.SupportedKindNames[kind];\n return this.goOperatorPrecedence(operator) > 0 ? operator : undefined;\n }\n\n // walkBinary(): has4 / has5 / maxProblem of the operator tree that is about\n // to be printed. Operands that stay binary expressions are walked, every\n // other operand is a primary expression and stops the walk - the same\n // boundary go/printer draws for parens and calls.\n goWalkBinary(operator: string, left, right, rightText: string) {\n const precedence = this.goOperatorPrecedence(operator);\n let has4 = precedence === 4;\n let has5 = precedence === 5;\n let maxProblem = 0;\n const walk = (childOperator: string, child) => {\n const info = this.goWalkBinary(childOperator, child.left, child.right, '');\n has4 = has4 || info.has4;\n has5 = has5 || info.has5;\n maxProblem = Math.max(maxProblem, info.maxProblem);\n };\n const leftOperator = this.goNativeBinaryOperator(left);\n if (leftOperator !== undefined && this.goOperatorPrecedence(leftOperator) >= precedence) {\n walk(leftOperator, left);\n }\n const rightOperator = this.goNativeBinaryOperator(right);\n if (rightOperator !== undefined && this.goOperatorPrecedence(rightOperator) > precedence) {\n walk(rightOperator, right);\n } else if (rightOperator === undefined) {\n // `/*`, `&&`, `&^` and the `+ +` / `- -` pairs must keep a blank so\n // that the two tokens cannot glue into a different operator\n const pair = operator + rightText.replace(/^[ \\t]+/, '').slice(0, 1);\n if (pair === '/*' || pair === '&&' || pair === '&^') {\n maxProblem = 5;\n } else if (pair === '++' || pair === '--') {\n maxProblem = Math.max(maxProblem, 4);\n }\n }\n return { has4, has5, maxProblem };\n }\n\n // the separator gofmt puts around a natively printed operator: `' '` keeps\n // the blanks, `''` drops them (go/printer cutoff())\n goBinarySeparator(operator: string, rightText: string, left, right): string {\n const precedence = this.goOperatorPrecedence(operator);\n if (precedence < 4) {\n // level 3 and below always keep both blanks\n return ' ';\n }\n const { has4, has5, maxProblem } = this.goWalkBinary(operator, left, right, rightText);\n let cutoff;\n if (maxProblem > 0) {\n cutoff = maxProblem + 1;\n } else if (has4 && has5) {\n cutoff = this.goExprDepth === 1 ? 5 : 4;\n } else {\n cutoff = this.goExprDepth === 1 ? 6 : 4;\n }\n return precedence < cutoff ? ' ' : '';\n }\n\n printBinaryExpression(node, identation) {\n\n const {left, right, operatorToken} = node;\n\n const customBinaryExp = this.printCustomBinaryExpressionIfAny(node, identation);\n if (customBinaryExp) {\n return customBinaryExp;\n }\n\n if (operatorToken.kind == SyntaxKind.InstanceOfKeyword) {\n return this.printInstanceOfExpression(node, identation);\n }\n\n if (operatorToken.kind === SyntaxKind.EqualsToken) {\n const pointerWrite = this.goPointerWriteText(node, identation);\n if (pointerWrite !== undefined) {\n return pointerWrite;\n }\n // handle test['a'] = 1;\n const elementAccess = left;\n const rightSide = this.goWithExprDepth(this.goExprDepth + 1, () => this.printNode(right, 0));\n if (left.kind === SyntaxKind.ElementAccessExpression) {\n const leftSide = this.printNode(elementAccess.expression, 0);\n const propName = this.printNode(elementAccess.argumentExpression, 0);\n const value = this.goWithExprDepth(this.goExprDepth + 1, () => this.printNode(right, identation)).trimStart();\n const native = this.printNativeElementAssignment(elementAccess.expression, leftSide, elementAccess.argumentExpression, propName, value, false, right);\n if (native !== undefined) {\n return native;\n }\n return `AddElementToObject(${leftSide}, ${propName}, ${value})`;\n }\n\n if (right?.kind === SyntaxKind.AwaitExpression || rightSide.startsWith('<-this.callInternal')) {\n const leftParsed = this.printNode(left, 0);\n // the awaited call can carry a multi-line object literal argument: printing it\n // at the statement's own level keeps that literal one level deeper\n const awaited = (right?.kind === SyntaxKind.AwaitExpression)\n ? this.printNode(right, identation)\n : rightSide;\n return `\n${this.getIden(identation)}${leftParsed} = ${awaited}\n${this.getIden(identation)}PanicOnError(${leftParsed})`;\n }\n }\n\n const op = operatorToken.kind;\n // handle: [x,d] = this.method()\n if (op === SyntaxKind.EqualsToken && left.kind === SyntaxKind.ArrayLiteralExpression) {\n const arrayBindingPatternElements = left.elements;\n const parsedArrayBindingElements = arrayBindingPatternElements.map((e) => this.printNode(e, 0));\n const syntheticName = parsedArrayBindingElements.join(\"\") + \"Variable\";\n\n let arrayBindingStatement = `${syntheticName} := ${this.printNode(right, 0)}\\n`;\n\n parsedArrayBindingElements.forEach((e, index) => {\n // const type = this.getType(node);\n // const parsedType = this.getTypeFromRawType(type);\n const leftElement = arrayBindingPatternElements[index];\n const leftType = this.getChecker().getTypeAtLocation(leftElement);\n const parsedType = this.getTypeFromRawType(leftType);\n\n const castExp = parsedType ? `(${parsedType})` : \"\";\n\n // const statement = this.getIden(identation) + `${e} = (${castExp}((List)${syntheticName}))[${index}]`;\n const statement = this.getIden(identation) + (this.goGetArgBindsDictElement(leftElement, right, index)\n ? `${e} = MapTyped(GetValue(${syntheticName}, ${index}))`\n : `${e} = GetValue(${syntheticName}, ${index})`);\n if (index < parsedArrayBindingElements.length - 1) {\n arrayBindingStatement += statement + \"\\n\";\n } else {\n arrayBindingStatement += statement;\n }\n });\n\n return arrayBindingStatement;\n }\n\n let operator = this.SupportedKindNames[operatorToken.kind];\n\n\n let leftVar = undefined;\n let rightVar = undefined;\n\n // c# wrapper\n if (operatorToken.kind === SyntaxKind.EqualsEqualsToken || operatorToken.kind === SyntaxKind.EqualsEqualsEqualsToken) {\n if (this.COMPARISON_WRAPPER_OPEN) {\n leftVar = this.printNode(left, 0);\n rightVar = this.printNode(right, identation);\n return `${this.COMPARISON_WRAPPER_OPEN}${leftVar}, ${rightVar}${this.COMPARISON_WRAPPER_CLOSE}`;\n }\n }\n\n // check if boolean operators || and && because of the falsy values\n if (operatorToken.kind === SyntaxKind.BarBarToken || operatorToken.kind === SyntaxKind.AmpersandAmpersandToken) {\n leftVar = this.printCondition(left, 0);\n rightVar = this.printCondition(right, identation);\n if (operatorToken.kind === SyntaxKind.AmpersandAmpersandToken) {\n // `x !== undefined && x === 'v'` inlines to `(x != nil) && (x != nil && *x == \"v\")`.\n // The right operand already guards nil, so the left test is provably\n // implied — `go vet` reports it as a redundant and. Dropping it keeps\n // the exact same value (Go && is short-circuiting, both sides pure).\n const collapsed = this.goDropRedundantNilGuard(leftVar.trim(), rightVar.trim());\n if (collapsed !== undefined) {\n return collapsed;\n }\n }\n } else {\n // go/printer prints the left operand of a binary expression at the\n // depth of the parent plus diffPrec() - 0 only when it is a binary\n // expression of the very same precedence - and the right operand one\n // level deeper. An operator that is not binary in Go (the assignment\n // `=`, or a compound assignment) prints both sides at their own level.\n const precedence = this.goOperatorPrecedence(operator);\n if (precedence > 0) {\n const leftOperator = this.goNativeBinaryOperator(left);\n const samePrecedence = leftOperator !== undefined && this.goOperatorPrecedence(leftOperator) === precedence;\n const leftDepth = samePrecedence ? this.goExprDepth : this.goExprDepth + 1;\n leftVar = this.goWithExprDepth(leftDepth, () => this.printNode(left, 0));\n rightVar = this.goWithExprDepth(this.goExprDepth + 1, () => this.printNode(right, identation));\n } else {\n leftVar = this.printNode(left, 0);\n rightVar = this.printNode(right, identation);\n }\n }\n\n const customOperator = this.getCustomOperatorIfAny(left, right, operatorToken);\n\n operator = customOperator ? customOperator : operator;\n\n const separator = this.goBinarySeparator(operator, rightVar.trim(), left, right);\n\n return leftVar + separator + operator + separator + rightVar.trim();\n }\n\n // `(x != nil) && (x != nil && …)` -> `(x != nil && …)`. Only fires when the\n // right operand opens with the very same nil guard the left operand *is*, so\n // the left is implied and dropping it cannot change the result.\n goDropRedundantNilGuard(leftVar: string, rightVar: string): string | undefined {\n const guard = /^\\(([A-Za-z_]\\w*) != nil\\)$/.exec(leftVar);\n if (guard === null) {\n return undefined;\n }\n if (rightVar.startsWith(`(${guard[1]} != nil && `)) {\n return rightVar;\n }\n return undefined;\n }\n\n printTryStatement(node, identation: number) {\n // const tryBody = this.printNode(node.tryBlock, 0);\n\n let tryBody = node.tryBlock.statements.map((s) => {\n return this.printNode(s, identation + 1);\n }).join(\"\\n\");\n tryBody = tryBody.replaceAll(/(\\s*)break\\s*$/gm, \"$1panic(\\\"break\\\")\"); // to do do thing regex-based\n\n // const catchBody = this.printNode(node.catchClause.block, 0);\n const catchBody = node.catchClause.block.statements.map((s) => this.printNode(s, identation + 1)).join(\"\\n\");\n\n const bodyEndsWithReturn = (body: string, statements) => {\n const lines = body.split(\"\\n\").map(l => l.trim()).filter(Boolean);\n const lastLine = lines.length ? lines[lines.length - 1] : \"\";\n return lastLine.startsWith(\"return\") || lastLine.startsWith(\"panic\") || lastLine.startsWith(\"throw new\")\n || this.blockEndsWithConditionalReturn(statements);\n };\n const catchBodyEndsWithReturn = bodyEndsWithReturn(catchBody, node.catchClause.block.statements);\n const tryBodyEndsWithReturn = bodyEndsWithReturn(tryBody, node.tryBlock.statements);\n\n const returNil = \"return nil\";\n const isVoid = this.isInsideVoidFunction(node);\n\n const nodeEndsWithReturn = tryBodyEndsWithReturn && catchBodyEndsWithReturn && !isVoid;\n const errorName = node.catchClause.variableDeclaration.name.text;\n const classPrefix = this.className !== 'undefined' ? `(this *${this.className})` : \"()\";\n const thisWord = this.className !== 'undefined' ? \"this\" : \"\";\n // the printer indents statements with getIden(); the bodies embedded below are\n // re-placed at their own explicit level so the template only carries the levels\n // *inside* the block (the enclosing getIden(identation) lands on every line)\n const catchBodyBlock = this.indentBlock (catchBody, \"\t\t\t\t\t\");\n const tryBodyBlock = this.indentBlock (tryBody, \"\t\t\");\n const catchBlock =`\n{\n\t${nodeEndsWithReturn ? 'ret__ := ' : ''}func${classPrefix} (ret_ any) {\n\t\tdefer func() {\n\t\t\tif ${errorName} := recover(); ${errorName} != nil {\n\t\t\t\tif ${errorName} == \"break\" {\n\t\t\t\t\treturn\n\t\t\t\t}\n\t\t\t\tret_ = func${classPrefix} any {\n\t\t\t\t\t// catch block:\n${catchBodyBlock}\n\t\t\t\t\t${catchBodyEndsWithReturn ? \"\" : returNil}\n\t\t\t\t}(${thisWord})\n\t\t\t}\n\t\t}()\n\t\t// try block:\n${tryBodyBlock}\n\t\t${tryBodyEndsWithReturn ? \"\" : returNil}\n\t}(${thisWord})\n\t${nodeEndsWithReturn\n ? `if ret__ != nil {\n\t\treturn ret__\n\t}\n\treturn nil`\n : ''}\n}`;\n // add identation to every line; a line that is left blank (the conditional\n // entries above emit nothing, and the block opens on a fresh line) stays\n // empty because gofmt trims trailing whitespace\n const indentedBlock = catchBlock.split(\"\\n\")\n .map((line) => line.trim().length ? this.getIden(identation) + line : \"\")\n .join(\"\\n\");\n // const catchCondOpen = this.CONDITION_OPENING ? this.CONDITION_OPENING : \" \";\n\n return indentedBlock;\n }\n\n /**\n * Strip the printer's own leading indentation from every line of a printed\n * statement block so the caller can re-place it at an explicit level. Only the\n * common prefix goes away: relative nesting (one tab per level) is preserved.\n */\n dedentBlock (block: string) {\n const lines = block.split(\"\\n\");\n const indents = lines\n .filter((line) => line.trim().length > 0)\n .map((line) => (line.match(/^[\\t ]*/) as RegExpMatchArray)[0].length);\n const common = indents.length ? Math.min(...indents) : 0;\n return lines.map((line) => line.slice(common)).join(\"\\n\");\n }\n\n /**\n * Re-place a printed statement block at `level` (a run of tabs): the block's own\n * leading indentation is dropped and every non-blank line is prefixed with `level`,\n * so relative nesting (one tab per level) survives the move.\n */\n indentBlock (block: string, level: string) {\n return this.dedentBlock (block)\n .split(\"\\n\")\n .map((line) => line.trim().length ? level + line : \"\")\n .join(\"\\n\");\n }\n\n /**\n * gofmt writes blank lines with no whitespace at all. A multi-line statement template\n * opens on a fresh line, so the inherited `getIden(identation) + ` prefix\n * lands on a line that carries nothing else: drop that prefix instead of leaving a\n * whitespace-only line behind. Only blank lines are touched, never printed content.\n */\n stripWhitespaceOnlyLines (block: string) {\n return block.split(\"\\n\").map((line) => line.trim().length ? line : \"\").join(\"\\n\");\n }\n\n printPrefixUnaryExpression(node, identation) {\n const {operand, operator} = node;\n if (operator === SyntaxKind.ExclamationToken) {\n // not branch check falsy/turthy values if needed;\n return this.getIden(identation) + this.PrefixFixOperators[operator] + this.printCondition(node.operand, 0);\n }\n if (operator === SyntaxKind.MinusToken) {\n const printed = this.printNode(node.operand, 0);\n const inlined = this.printInlineOpNeg(node, printed);\n if (inlined !== undefined) {\n return this.getIden(identation) + inlined;\n }\n return this.getIden(identation) + `OpNeg(${printed})`;\n }\n return this.getIden(identation) + this.PrefixFixOperators[operator] + this.printNode(operand, 0);\n }\n\n printNewExpression(node, identation) {\n let expression = node.expression?.text;\n expression = expression ? expression : this.printNode(node.expression); // new Exception or new exact[string] check this out\n if (node.arguments.length === 0) {\n return `New${this.capitalize(expression)}()`;\n }\n // an argument printer may prepend the statement indent (parenthesised casts do);\n // inside the call the argument is inline, so trim it like printArgsForCallExpression\n const args = node.arguments.map(n => this.printNode(n, identation).trim()).join(\", \");\n if (expression.endsWith('Error')) {\n return expression + this.LEFT_PARENTHESIS + args + this.RIGHT_PARENTHESIS;\n }\n return 'New' + this.capitalize(expression) + this.LEFT_PARENTHESIS + args + this.RIGHT_PARENTHESIS;\n }\n\n /**\n * Override the default element-access printer with a version that walks the\n * entire `x[y][z]` chain and builds a properly nested sequence of helper\n * calls. This removes the root cause of the unbalanced-parenthesis bug\n * without any post-processing or regex hacks.\n */\n // The Go static type of `printed` when the printer can name it as a native Go\n // map or slice, undefined while the value stays boxed in `any` (GetValue,\n // Ternary, a parameter, an untyped struct field). Only initializer shapes the\n // printer itself types — object/array literals, helper calls whose Go return\n // type it knows (GO_HELPER_RETURN_TYPES + the ccxt extension), and locals whose\n // declaration got that same concrete type — are reported.\n goIndexableTypeOf(node, printed: string): string | undefined {\n if (node === undefined) {\n return undefined;\n }\n switch (node.kind) {\n // a type assertion prints as its operand (printAsExpression hands the operand\n // back), so the operand's Go type still governs the read: `(this.fees as Dict)['x']`\n // is the element access on `this.fees`, whose Go type decides the index\n case SyntaxKind.ParenthesizedExpression:\n case SyntaxKind.AsExpression:\n return this.goIndexableTypeOf(node.expression, printed);\n case SyntaxKind.ObjectLiteralExpression:\n return 'map[string]any';\n case SyntaxKind.ArrayLiteralExpression:\n return '[]any';\n case SyntaxKind.CallExpression:\n return this.goTypeOfInitializer(node, printed);\n case SyntaxKind.Identifier:\n return this.goDeclaredTypeOfIdentifier(node);\n }\n return undefined;\n }\n\n // the leftover chain after the first (native) step, still helper-wrapped:\n // `m[\"a\"][\"b\"][\"c\"]` prints `GetValue(GetValue(m[\"a\"], \"b\"), \"c\")`\n goElementAccessChain(containerStr: string, keyStrs: string[]) {\n let acc = containerStr;\n for (let i = 1; i < keyStrs.length; i++) {\n acc = `${this.ELEMENT_ACCESS_WRAPPER_OPEN}${acc}, ${keyStrs[i]}${this.ELEMENT_ACCESS_WRAPPER_CLOSE}`;\n }\n return acc;\n }\n\n // the container of a nested `m[\"a\"][\"b\"] = v` write, for all but the last key: its first step is a\n // plain read, so a receiver typed as a map indexes natively and only `any` steps keep the helper.\n // A missing key or nil map reads nil in both forms; a non-map container is a no-op either way.\n goElementWriteChain(baseExpr, containerStr: string, keyNodes, keyStrs: string[]): string {\n let acc = containerStr;\n let first = 0;\n if ((keyStrs.length > 1) && (this.goIndexableTypeOf(baseExpr, containerStr) === 'map[string]any')\n && this.goKeyIsString(keyNodes[0], keyStrs[0])) {\n acc = `${containerStr}[${keyStrs[0]}]`;\n first = 1;\n }\n for (let i = first; i < keyStrs.length - 1; i++) {\n acc = `${this.ELEMENT_ACCESS_WRAPPER_OPEN}${acc}, ${keyStrs[i]}${this.ELEMENT_ACCESS_WRAPPER_CLOSE}`;\n }\n return acc;\n }\n\n // true when the printed key is a Go string, so `m[key]` reads the map with the\n // same key GetValue resolves for a string operand (GetValue parses a non-string\n // key, which on map[string]any just yields nil)\n goKeyIsString(node, printed: string) {\n if (node === undefined) {\n return false;\n }\n switch (node.kind) {\n case SyntaxKind.StringLiteral:\n case SyntaxKind.NoSubstitutionTemplateLiteral:\n return true;\n case SyntaxKind.ParenthesizedExpression:\n case SyntaxKind.AsExpression:\n return this.goKeyIsString(node.expression, printed);\n case SyntaxKind.Identifier:\n return this.goDeclaredTypeOfIdentifier(node) === 'string';\n case SyntaxKind.CallExpression:\n return this.goTypeOfInitializer(node, printed) === 'string';\n }\n return false;\n }\n\n // true when the printed key is a Safe*-boxed string: an identifier declared `*string`,\n // i.e. a nilable Go pointer. The native read needs GetValue's `*` deref and its nil\n // answer, neither of which an index expression expresses.\n goIsDerefStringKeyExpression(node): boolean {\n return (node?.kind === SyntaxKind.Identifier) && (this.goDeclaredTypeOfIdentifier(node) === '*string');\n }\n\n // the nil-guarded native read of a declared map with a `*string` key, reproducing GetValue's key\n // deref: a nil key reads nil, otherwise the map index (missing key is the `any` nil). gofmt keeps\n // a func literal holding an `if` on its own lines, so the guard sits at the statement's level.\n printNilGuardedMapIndex(containerStr: string, keyStr: string): string {\n const level = this.goStatementLevel;\n const body = this.getIden(level + 1);\n return `func() any {\\n${body}if ${keyStr} == nil {\\n${this.getIden(level + 2)}return nil\\n${body}}\\n${body}return ${containerStr}[*${keyStr}]\\n${this.getIden(level)}}()`;\n }\n\n // true for `this.` — the one property-access shape whose Go type the\n // printer itself cannot name (the fields live in the hand-written Go structs)\n isGoThisPropertyAccessExpression(node) {\n return (node?.kind === SyntaxKind.PropertyAccessExpression)\n && (node.expression?.kind === SyntaxKind.ThisKeyword);\n }\n\n // true when the element access is the target of an assignment: the binary\n // expression printer owns that shape (AddElementToObject / rewritten GetValue\n // chains), a native `x[k]` index there would drop the write\n isGoElementAccessAssignmentTarget(node) {\n const parent = node.parent;\n return (parent?.kind === SyntaxKind.BinaryExpression) && (parent.left === node)\n && ((parent.operatorToken.kind === SyntaxKind.EqualsToken) || (parent.operatorToken.kind === SyntaxKind.PlusEqualsToken));\n }\n\n // the key of a native list read: its printed Go type must be `int` for the guard's two\n // comparisons to compile, and the key expression is printed twice (the bounds test and the\n // index), so a call operand — evaluated twice — is rejected. Every other key keeps GetValue.\n goIntIndexExpression(node): boolean {\n switch (node?.kind) {\n case SyntaxKind.NumericLiteral: {\n const text = `${node.text ?? ''}`;\n return /^\\d+$/.test(text);\n }\n case SyntaxKind.ParenthesizedExpression:\n return this.goIntIndexExpression(node.expression);\n case SyntaxKind.PrefixUnaryExpression:\n return (node.operator === SyntaxKind.MinusToken) && this.goIntIndexExpression(node.operand);\n case SyntaxKind.Identifier:\n return this.goIntOperandIdentifier(node);\n case SyntaxKind.BinaryExpression: {\n const op = node.operatorToken?.kind;\n if ((op === SyntaxKind.PlusToken) || (op === SyntaxKind.MinusToken)\n || (op === SyntaxKind.AsteriskToken) || (op === SyntaxKind.PercentToken)) {\n return this.goIntIndexExpression(node.left) && this.goIntIndexExpression(node.right);\n }\n return false;\n }\n }\n return false;\n }\n\n // true for an identifier the printer emits as a Go int: a local it declared `int`, and a\n // `for (let i = 0; …)` counter, which prints `for i := 0` and is inferred as `int`\n goIntOperandIdentifier(node): boolean {\n if (this.goDeclaredTypeOfIdentifier(node) === 'int') {\n return true;\n }\n const checker: any = this.checkerOrUndefined();\n if (checker === undefined) {\n return false;\n }\n const symbol = checker.getSymbolAtLocation(node);\n const declaration: any = symbol?.valueDeclaration?.resolve();\n if ((declaration?.kind !== SyntaxKind.VariableDeclaration) || (declaration.initializer === undefined)) {\n return false;\n }\n const list: any = declaration.parent;\n const loop: any = list?.parent;\n if ((list?.kind !== SyntaxKind.VariableDeclarationList) || (list.declarations?.length !== 1)\n || (loop?.kind !== SyntaxKind.ForStatement) || (loop.initializer !== list)) {\n return false;\n }\n const text = `${declaration.initializer.text ?? ''}`;\n return (declaration.initializer.kind === SyntaxKind.NumericLiteral) && /^\\d+$/.test(text);\n }\n\n // true when this identifier is a local the printer declared []any because it was unboxed\n // from a `this.SafeList` accessor. Only that family carried the first guarded element read;\n // the declared-type arm below is the D-06 widening.\n goSafeListUnboxIdentifier(node): boolean {\n const checker: any = this.checkerOrUndefined();\n if (checker === undefined) {\n return false;\n }\n const symbol = checker.getSymbolAtLocation(node);\n const declaration: any = symbol?.valueDeclaration?.resolve();\n return (declaration?.kind === SyntaxKind.VariableDeclaration)\n && (this.goSafeListLocalUnbox(declaration) === GO_SAFE_LIST_LOCAL_TYPE);\n }\n\n // true when the identifier's printed Go declaration is a `[]any` slice: the SafeList family\n // above, or any other local/param the declared-type table proved a slice (a slice literal,\n // a `[]any`-returning accessor, a slice param the typed-param family registers). All of them\n goDeclaredListIdentifier(node): boolean {\n return (this.goDeclaredTypeOfIdentifier(node) === GO_SAFE_LIST_LOCAL_TYPE)\n || this.goSafeListUnboxIdentifier(node);\n }\n\n // `x[k]` on a local the printer declared []any is a slice index: GetValue answered nil for an\n // absent index (negative or out of range) and derefs a pointer element, so the native read is\n // the same index behind that guard. Only a key printed as an `int` carries it; every other\n goNativeListElementRead(node, containerStr: string, keyNode, keyStr: string): string | undefined {\n if (containerStr.includes('\\n') || keyStr.includes('\\n')) {\n return undefined;\n }\n if (this.isGoElementAccessAssignmentTarget(node) || !this.goIntIndexExpression(keyNode)) {\n return undefined;\n }\n const level = this.goStatementLevel;\n const body = this.getIden(level + 1);\n return `func() any {\\n${body}if ${keyStr} >= 0 && ${keyStr} < len(${containerStr}) {\\n${this.getIden(level + 2)}return DerefScalar(${containerStr}[${keyStr}])\\n${body}}\\n${body}return nil\\n${this.getIden(level)}}()`;\n }\n\n printElementAccessExpression(node, identation) {\n // Maintain original special-case handling first.\n const special = this.printElementAccessExpressionExceptionIfAny(node);\n if (special) {\n return special;\n }\n\n // Always process element access expressions the same way\n // The binary expression handler will override this for assignments\n\n // For right-side access, build the full nested chain\n const keys: any[] = [];\n let baseExpr = null;\n let current = node as any;\n // Walk down while the *expression* is another ElementAccessExpression.\n while (isElementAccessExpression(current)) {\n keys.unshift(current.argumentExpression); // prepend\n const expr = current.expression;\n if (!isElementAccessExpression(expr)) {\n // Reached the base container.\n baseExpr = expr;\n break;\n }\n current = expr;\n }\n\n // go/printer prints the base of an index expression at depth 1 and the\n // index itself one level deeper; GetValue(base, key) is a two-argument\n // call, so both operands sit one level below the current expression\n const indexDepth = this.goExprDepth + 1;\n const containerStr = this.goWithExprDepth(indexDepth, () => this.printNode(baseExpr, 0));\n const keyStrs = keys.map(k => this.goWithExprDepth(indexDepth, () => this.printNode(k, 0)));\n\n // GetValue(m, \"k\") is a read of a Go map[string]any already: a missing key\n // and a nil element both come back as the `any` nil, so the native index\n // yields the identical value without the helper call\n if (this.goIndexableTypeOf(baseExpr, containerStr) === 'map[string]any') {\n if (this.goKeyIsString(keys[0], keyStrs[0]) && !this.isGoElementAccessAssignmentTarget(node)\n && !this.goMarketComparisonElementRead(node)) {\n return this.goElementAccessChain(`${containerStr}[${keyStrs[0]}]`, keyStrs);\n }\n // a Safe*-boxed string key holds a nilable `*string`, so the read needs the\n // helper's nil answer and deref around the same map index. A multi-line\n // receiver cannot carry the guard's own indentation, so it keeps the helper.\n if (this.goIsDerefStringKeyExpression(keys[0]) && !containerStr.includes('\\n')\n && !this.isGoElementAccessAssignmentTarget(node)) {\n return this.goElementAccessChain(this.printNilGuardedMapIndex(containerStr, keyStrs[0]), keyStrs);\n }\n }\n\n // Now build nested helpers.\n let acc = containerStr;\n keyStrs.forEach(k => {\n acc = `${this.ELEMENT_ACCESS_WRAPPER_OPEN}${acc}, ${k}${this.ELEMENT_ACCESS_WRAPPER_CLOSE}`;\n });\n\n // a local the printer declared []any — either unboxed from a `this.SafeList` accessor or\n // named []any by the declared-type table — is a slice, so an element read with a key it\n // prints as an int is the guarded native index (see goNativeListElementRead)\n if ((baseExpr?.kind === SyntaxKind.Identifier) && this.goDeclaredListIdentifier(baseExpr)) {\n const nativeRead = this.goNativeListElementRead(node, containerStr, keys[0], keyStrs[0]);\n if (nativeRead !== undefined) {\n return this.goElementAccessChain(nativeRead, keyStrs);\n }\n }\n\n return acc;\n }\n\n isInsideVoidFunction(node: Node): boolean {\n for (let cur = node.parent; cur; cur = cur.parent) {\n if (isFunctionLike(cur)) {\n return (cur as any).type === undefined || (cur as any).type.kind === SyntaxKind.VoidKeyword;\n }\n }\n return true; // default-to-void if uncertain\n }\n\n /**\n * Check if a block or statement contains a return statement or throws an error\n */\n hasReturnInBlock(statement: Statement): boolean {\n if (isBlock(statement)) {\n // A sequence of statements returns on all control paths if the last statement returns on all control paths\n if (statement.statements.length === 0) {\n return false;\n }\n return this.hasReturnInBlock(statement.statements[statement.statements.length - 1]);\n } else if (isReturnStatement(statement)) {\n return true;\n } else if (isThrowStatement(statement)) {\n return true;\n } else if (isIfStatement(statement)) {\n // An if statement returns on all control paths if both the \"if\" and \"else\" branches return on all control paths\n const ifHasReturn = this.hasReturnInBlock(statement.thenStatement);\n if (statement.elseStatement) {\n const elseHasReturn = this.hasReturnInBlock(statement.elseStatement);\n return ifHasReturn && elseHasReturn;\n }\n return false; // No else statement, so execution can continue\n } else if (isTryStatement(statement)) {\n // A try statement returns on all control paths if both try and catch blocks return on all control paths\n const tryHasReturn = this.hasReturnInBlock(statement.tryBlock);\n const catchHasReturn = this.hasReturnInBlock(statement.catchClause.block);\n return tryHasReturn && catchHasReturn;\n }\n return false;\n }\n\n /**\n * Check if the last statement in a block is a conditional with returns in all branches\n */\n blockEndsWithConditionalReturn(statements: NodeArray): boolean {\n if (statements.length === 0) {\n return false;\n }\n\n // an if (with an else) or a try returning on every path: hasReturnInBlock's own rules for both\n const lastStatement = statements[statements.length - 1];\n return (isIfStatement(lastStatement) || isTryStatement(lastStatement)) && this.hasReturnInBlock(lastStatement);\n }\n\n\n}\n\n\n// get class decl node\n// Use the getAllSuperTypeNodes function to get the base classes for the MyClass\n// const baseClasses = getAllSuperTypeNodes(classDeclaration);\n\n// // Create a type checker\n// const typeChecker = ts.createTypeChecker(sourceFile.context.program, sourceFile.context.checker);\n\n// // Get the type of the base class\n// const baseClassType = typeChecker.getTypeAtLocation(baseClasses[0]);\n\n// // Get the class declaration for the base class\n// const baseClassDeclaration = baseClassType.symbol.valueDeclaration?.resolve();\n\n// console.log(baseClassDeclaration);\n\n","import { BaseTranspiler } from \"./baseTranspiler.js\";\nimport { NodeFlags, SyntaxKind, type Expression, type Node } from \"typescript/unstable/ast\";\nimport { isArrayLiteralExpression, isArrowFunction, isAsExpression, isBinaryExpression, isBlock, isBooleanLiteral, isCallExpression, isBreakStatement, isClassDeclaration, isConditionalExpression, isContinueStatement, isElementAccessExpression, isExpressionStatement, isForInStatement, isForOfStatement, isFunctionDeclaration, isFunctionExpression, isIdentifier, isIfStatement, isMethodDeclaration, isNonNullExpression, isNumericLiteral, isObjectLiteralExpression, isParameterDeclaration, isParenthesizedExpression, isPostfixUnaryExpression, isPrefixUnaryExpression, isPropertyAccessExpression, isPropertyAssignment, isReturnStatement, isShorthandPropertyAssignment, isSourceFile, isSpreadAssignment, isSpreadElement, isStringLiteral, isStringLiteralLikeNode, isThrowStatement, isTypeAssertion, isTypeOfExpression, isTypeReferenceNode, isVariableDeclaration, isVariableDeclarationList } from \"typescript/unstable/ast/is\";\nimport { createIdentifier } from \"typescript/unstable/ast/factory\";\nimport { API, ElementFlags, IndexKind, SymbolFlags, TypeFlags, type Checker } from \"typescript/unstable/sync\";\nimport { Logger } from \"./logger.js\";\nimport { getAllSuperTypeNodes, getCombinedNodeFlags, isFunctionLike } from \"./tsUtils.js\";\n\nconst parserConfig = {\n EXTENDS_TOKEN: \"extends\",\n PROMISE_TYPE_KEYWORD: \"java.util.concurrent.CompletableFuture\",\n ARRAY_KEYWORD: \"java.util.List\",\n OBJECT_KEYWORD: \"java.util.Map\",\n STRING_KEYWORD: \"String\",\n BOOLEAN_KEYWORD: \"boolean\",\n DEFAULT_PARAMETER_TYPE: \"Object\",\n DEFAULT_RETURN_TYPE: \"Object\",\n DEFAULT_TYPE: \"Object\",\n ELSEIF_TOKEN: \"else if\",\n // Objects in Java: we'll use double-brace initialization so property puts work\n OBJECT_OPENING: \"new java.util.HashMap() {{\",\n OBJECT_CLOSING: \"}}\",\n // Arrays in Java: emit Arrays.asList(...) wrapped by ArrayList\n ARRAY_OPENING_TOKEN: \"new java.util.ArrayList(java.util.Arrays.asList(\",\n ARRAY_CLOSING_TOKEN: \"))\",\n // For object literal properties we'll emit: put(key, value);\n PROPERTY_ASSIGNMENT_TOKEN: \",\",\n VAR_TOKEN: \"Object\", // Java 10+ local var\n METHOD_TOKEN: \"\",\n PROPERTY_ASSIGNMENT_OPEN: \"put(\",\n PROPERTY_ASSIGNMENT_CLOSE: \");\",\n SUPER_TOKEN: \"super\",\n SUPER_CALL_TOKEN: \"super\",\n FALSY_WRAPPER_OPEN: \"Helpers.isTrue(\",\n FALSY_WRAPPER_CLOSE: \")\",\n COMPARISON_WRAPPER_OPEN: \"Helpers.isEqual(\",\n COMPARISON_WRAPPER_CLOSE: \")\",\n UKNOWN_PROP_WRAPPER_OPEN: \"this.call(\",\n UNKOWN_PROP_WRAPPER_CLOSE: \")\",\n UKNOWN_PROP_ASYNC_WRAPPER_OPEN: \"this.callAsync(\",\n UNKOWN_PROP_ASYNC_WRAPPER_CLOSE: \")\",\n DYNAMIC_CALL_OPEN: \"Helpers.callDynamically(\",\n EQUALS_EQUALS_WRAPPER_OPEN: \"Helpers.isEqual(\",\n EQUALS_EQUALS_WRAPPER_CLOSE: \")\",\n DIFFERENT_WRAPPER_OPEN: \"!Helpers.isEqual(\",\n DIFFERENT_WRAPPER_CLOSE: \")\",\n GREATER_THAN_WRAPPER_OPEN: \"Helpers.isGreaterThan(\",\n GREATER_THAN_WRAPPER_CLOSE: \")\",\n GREATER_THAN_EQUALS_WRAPPER_OPEN: \"Helpers.isGreaterThanOrEqual(\",\n GREATER_THAN_EQUALS_WRAPPER_CLOSE: \")\",\n LESS_THAN_WRAPPER_OPEN: \"Helpers.isLessThan(\",\n LESS_THAN_WRAPPER_CLOSE: \")\",\n LESS_THAN_EQUALS_WRAPPER_OPEN: \"Helpers.isLessThanOrEqual(\",\n LESS_THAN_EQUALS_WRAPPER_CLOSE: \")\",\n PLUS_WRAPPER_OPEN: \"Helpers.add(\",\n PLUS_WRAPPER_CLOSE: \")\",\n MINUS_WRAPPER_OPEN: \"Helpers.subtract(\",\n MINUS_WRAPPER_CLOSE: \")\",\n ARRAY_LENGTH_WRAPPER_OPEN: \"Helpers.getArrayLength(\",\n ARRAY_LENGTH_WRAPPER_CLOSE: \")\",\n DIVIDE_WRAPPER_OPEN: \"Helpers.divide(\",\n DIVIDE_WRAPPER_CLOSE: \")\",\n MULTIPLY_WRAPPER_OPEN: \"Helpers.multiply(\",\n MULTIPLY_WRAPPER_CLOSE: \")\",\n INDEXOF_WRAPPER_OPEN: \"Helpers.getIndexOf(\",\n INDEXOF_WRAPPER_CLOSE: \")\",\n MOD_WRAPPER_OPEN: \"Helpers.mod(\",\n MOD_WRAPPER_CLOSE: \")\",\n FUNCTION_TOKEN: \"\",\n ELEMENT_ACCESS_WRAPPER_OPEN: 'Helpers.GetValue(',\n ELEMENT_ACCESS_WRAPPER_CLOSE: ')',\n INFER_VAR_TYPE: false,\n INFER_ARG_TYPE: false,\n};\n\n// hand-written base methods whose Java declaration carries a concrete numeric return type\n// (BaseExchange.java: `public Long milliseconds()`), so a `this.()` call holds that box on\n// every path. Generated methods print `Object`; only this closed table is an arithmetic anchor.\nconst JAVA_THIS_RETURN_TYPES: { [name: string]: string } = {\n 'milliseconds': 'long',\n};\n\n// source files the table was audited against: the declaration on the base class, or\n// its overload-stripped temp copy (build/stripOverloads.ts). A call resolving anywhere\n// else is a venue override that prints its own signature - not provable.\n// `extend = extend` / `deepExtend = deepExtend` resolve to the base-tier generic helpers\nconst JAVA_FRESH_EXTEND_FILE = /(^|[\\\\/])ts[\\\\/]src[\\\\/]base[\\\\/](functions[\\\\/]generic|Exchange(\\.nooverloads\\.\\d+)?)\\.ts$/;\nconst JAVA_THIS_RETURN_TYPES_BASE_FILE = /(^|[\\\\/])ts[\\\\/]src[\\\\/]base[\\\\/]Exchange(\\.nooverloads\\.\\d+)?\\.ts$/;\n// `milliseconds = milliseconds` (Exchange.ts) mixes in the functions/time.ts helper, so\n// the same call may resolve to the Date.now signature in a typescript lib.d.ts instead.\nconst JAVA_THIS_RETURN_TYPES_LIB_FILE = /(^|[\\\\/])node_modules[\\\\/](?:[^\\\\/]+[\\\\/]node_modules[\\\\/])?typescript6?[\\\\/]lib[\\\\/]lib\\.[^\\\\/]*\\.d\\.ts$/;\n\n// every assignment operator (`=`, `+=`, `??=`, ...) but no comparison (`===`, `!==`, `<=`, `>=`):\n// an element access on the left of one of these is a write site and keeps the base emission\nconst JAVA_ASSIGNMENT_OPERATOR_KINDS: Set = (() => {\n const kinds: any = SyntaxKind;\n const names = Object.keys(kinds).filter((name) => name.endsWith('EqualsToken')\n && !/^Equals|^Exclamation|^LessThan|^GreaterThan/.test(name));\n return new Set(([ 'EqualsToken' ].concat(names)).map((name) => kinds[name]).filter((kind) => kind !== undefined));\n})();\n\n// TS type flags whose Java print is a scalar final class or a primitive: `instanceof\n// java.util.List` is not convertible on those operands, so they keep the helper\nconst JAVA_SCALAR_TYPE_FLAGS: number = TypeFlags.String | TypeFlags.StringLiteral\n | TypeFlags.Number | TypeFlags.NumberLiteral\n | TypeFlags.Boolean | TypeFlags.BooleanLiteral\n | TypeFlags.BigInt | TypeFlags.BigIntLiteral\n | TypeFlags.Enum | TypeFlags.EnumLiteral\n | TypeFlags.ESSymbol | TypeFlags.UniqueESSymbol;\n\n// TS type flags that are never an array (JS `Array.isArray(null)` / `(undefined)` is false)\nconst JAVA_NULLISH_TYPE_FLAGS: number = TypeFlags.Undefined | TypeFlags.Null\n | TypeFlags.Void | TypeFlags.Never;\n\n// hand-written `boolean` fields in the class body of BaseExchange.java / PredictionExchange.java\n// (the half hand-written base files the generated exchanges inherit): a read of one prints a\n// primitive Java boolean, so `this.` IS the wrapper's result.\nconst JAVA_BOOLEAN_BASE_FIELDS = new Set([\n 'this.alias',\n 'this.verbose',\n 'this.validateServerSsl',\n 'this.enableRateLimit',\n 'this.pro',\n 'this.certified',\n 'this.reloadingMarkets',\n 'this.marketsLoaded',\n 'this.reduceFees',\n 'this.substituteCommonCurrencyCodes',\n 'this.isSandboxModeEnabled',\n 'this.returnResponseHeaders',\n 'this.newUpdates',\n 'this.syncSleep',\n // PredictionExchange.java\n 'this.reloadingEvents',\n]);\n\n// hand-written map fields of BaseExchange.java: each value is a java.util.Map, so `this.[k]`\n// is the helper's Map branch. `nullable` marks a field set to null or written from an Object-typed\n// call, so the read keeps the null answer behind a receiver guard.\nconst JAVA_FIELD_TYPES: { [name: string]: { map: boolean, nullable: boolean } } = {\n 'ohlcvs': { map: true, nullable: false },\n 'orderbooks': { map: true, nullable: false },\n 'balance': { map: true, nullable: true },\n 'options': { map: true, nullable: true },\n 'markets': { map: true, nullable: true },\n};\n\n// hand-written base methods declared `public boolean` (BaseExchange.java): a call prints a\n// primitive Java boolean, so a local fed by one holds a Boolean box or null.\nconst JAVA_BOOLEAN_BASE_CALLS = new Set([\n 'valueIsDefined',\n 'inArray',\n 'isEmpty',\n 'isJsonEncodedObject',\n 'isBinaryMessage',\n]);\n\n// operators whose printed Java form is a primitive boolean on every path: the logical ones and\n// every comparison / `in` / `instanceof`-style test the printer lowers to Helpers.isEqual /\n// isGreaterThan / inOp (all declared `public static boolean`) or to a native Java boolean\nconst JAVA_BOOLEAN_OPERATOR_KINDS: Set = (() => {\n const k: any = SyntaxKind;\n return new Set([\n k.AmpersandAmpersandToken,\n k.BarBarToken,\n k.EqualsEqualsToken,\n k.EqualsEqualsEqualsToken,\n k.ExclamationEqualsToken,\n k.ExclamationEqualsEqualsToken,\n k.LessThanToken,\n k.LessThanEqualsToken,\n k.GreaterThanToken,\n k.GreaterThanEqualsToken,\n k.InKeyword,\n k.InstanceOfKeyword,\n ]);\n})();\n\n// the relational `Precise.string*` statics are declared `public static boolean` in the\n// hand-written java/lib/src/main/java/io/github/ccxt/base/Precise.java, so their printed call is\n// already a Java primitive boolean (the String-returning statics are NOT listed here)\nconst JAVA_PRECISE_BOOLEAN_STATICS: Set = new Set([\n 'stringEq', 'stringEquals', 'stringGt', 'stringGe', 'stringLt', 'stringLe',\n]);\n\n// The printer erases TS return annotations to `Object`, so Helpers.isTrue would re-test a value the\n// hand-written Java base (BaseExchange.java, above the transpiled delimiter) already returns as a\n// boolean. Java overrides are covariant, so no generated venue method can widen these returns.\nconst JAVA_THIS_BOOLEAN_METHODS = new Set([\n 'inArray', // public boolean inArray (Object elem, Object list2)\n 'isArray', // public boolean isArray (Object a)\n 'isEmpty', // public boolean isEmpty (Object a)\n 'valueIsDefined', // public boolean valueIsDefined (Object value)\n 'isJsonEncodedObject', // public boolean isJsonEncodedObject (Object str)\n 'isBinaryMessage', // public boolean isBinaryMessage (Object message)\n]);\n\n// The GENERATED boolean accessors (`Object safeBool (...)`) hand the caller's `defaultValue` back\n// untouched when the found value is not a Boolean, so the box is Boolean-or-null only when the\n// default argument is absent or a boolean literal. Value = index of that argument in the call.\nconst JAVA_THIS_BOOLEAN_BOX_METHODS: { [name: string]: number } = {\n 'safeBool': 2,\n 'safeBool2': 3,\n 'safeBoolN': 2,\n};\n\n// the Java spellings a consumer declares a dict local with (import-shortened forms\n// included); every other declared type keeps Helpers.GetValue\nconst JAVA_DECLARED_MAP_TYPES = /^(java\\.util\\.)?(Map|HashMap)\\s*<\\s*String\\s*,\\s*Object\\s*>$/;\n\n// the Java spellings a consumer declares an element-read receiver with when it is a List:\n// the read prints `x.get(i)` / `x.size()` with no cast, because the declaration is the List\nconst JAVA_DECLARED_LIST_TYPES = /^(java\\.util\\.)?(List|ArrayList)\\s*<[^;\\n=]+>$/;\n\n// the Java primitive spellings a declaration can publish: an operand that prints as one\n// cannot take the `instanceof` test a native map read guards with\nconst JAVA_PRIMITIVE_DECLARED_TYPES = new Set(['boolean', 'byte', 'char', 'short', 'int', 'long', 'float', 'double']);\n\n// the numeric declaration types the ccxt-side pass publishes; the boxed ones can hold\n// null, so a native compare guards them first\nconst JAVA_DECLARED_NUMERIC_TYPES: Set =\n new Set(['Integer', 'Long', 'Double', 'int', 'long', 'double']);\n\nconst JAVA_BOXED_NUMERIC_TYPES: Set =\n new Set(['Integer', 'Long', 'Double']);\n\n// receiver node kinds whose printed Java is a primary expression, so the `(String)`\n// checkcast in front of them binds the whole receiver (a native `+` prints its own parens)\nconst JAVA_SPLIT_RECEIVER_KINDS: Set = new Set([\n SyntaxKind.Identifier,\n SyntaxKind.PropertyAccessExpression,\n SyntaxKind.ElementAccessExpression,\n SyntaxKind.CallExpression,\n SyntaxKind.ParenthesizedExpression,\n SyntaxKind.StringLiteral,\n SyntaxKind.NoSubstitutionTemplateLiteral,\n]);\n\n// TS classes/interfaces whose hand-written java counterpart extends java.util.ArrayList\n// (java/lib/.../ws/ArrayCache.java and ws/OrderBookSide.java, plus the IndexedOrderBookSide and\n// Asks/Bids subclasses); every runtime value of these types answers `.length` with the list size\nconst JAVA_LIST_BACKED_TS_CLASSES: Set = new Set([\n 'ArrayCache',\n 'ArrayCacheByTimestamp',\n 'ArrayCacheBySymbolById',\n 'ArrayCacheByOutcomeById',\n 'ArrayCacheBySymbolBySide',\n 'OrderBookSide',\n 'IndexedOrderBookSide',\n 'Asks',\n 'Bids',\n 'IndexedAsks',\n 'IndexedBids',\n 'IOrderBookSide',\n]);\n\n// the Java spelling that lets the printed key go straight to containsKey: the helper only\n// looks a key up when it is a String, and a String-typed operand is one on every path\nconst JAVA_DECLARED_STRING_TYPE = /^(java\\.util\\.)?String$/;\n\n// TS parameter annotations (`Dict`, `Market`, `Currency`, `Str`, `OrderType`/`OrderSide`, `Bool`) print the native Java\n// type on the declaring method. `Int`/`Num` stay `Object`: a TS `number` is an Integer, Long or\n// Double box in generated code, so neither a `Long`/`Double` parameter nor a cast site is provable.\nconst JAVA_NATIVE_PARAMETER_TYPES: { [name: string]: string } = {\n 'Dict': 'java.util.Map',\n 'Market': 'java.util.Map',\n 'Currency': 'java.util.Map',\n 'Str': 'String',\n 'OrderType': 'String',\n 'OrderSide': 'String',\n 'Bool': 'Boolean',\n};\n\n// Java types of default-valued parameters; separate from the fixed-parameter table.\n// `Num`/`Bool`/`Strings` stay Object: widening them changes payload strings or varargs spreading.\nconst JAVA_NATIVE_PARAMETER_TYPES_OPTIONAL: { [name: string]: string } = {\n 'Dict': 'java.util.Map',\n 'Market': 'java.util.Map',\n 'Currency': 'java.util.Map',\n 'Str': 'String',\n 'OrderType': 'String',\n 'OrderSide': 'String',\n 'Int': 'Long',\n 'Strings': 'java.util.List',\n};\n\n// `Strings` (and a `string[]` spelling of the same slot) is typed only on parameters named `symbols`\nconst JAVA_STRINGS_OPTIONAL_PARAMETER_NAMES = new Set(['symbols']);\nconst JAVA_STRING_LIST_TYPE = 'java.util.List';\n// base symbol-list helpers keep their Object slot (hand-written java callers pass Object)\nconst JAVA_STRINGS_EXCLUDED_METHODS = new Set(['marketSymbols', 'marketIds', 'marketsForSymbols', 'getMarketFromSymbols']);\n\n// the aliases above have to come from the shared ts/src/base/types.ts declaration\nconst JAVA_NATIVE_PARAMETER_SOURCE_FILES = /(^|\\/)ts\\/src\\/base\\/types\\.ts$/;\n\n// Parameter positions whose Java signature cannot move to the annotated type even though\n// the base declaration carries it. Java overrides are invariant, so one excluded position\n// boxes every declaration of the name at once.\nconst JAVA_NATIVE_PARAMETER_EXCLUDED_POSITIONS: { [name: string]: number[] } = {\n // implicit endpoints pass fetch2/request/sign params through untyped (arrays for batch orders)\n 'fetch2': [ 3 ],\n // the Exchange tier keeps fetchOrderBook's symbol Object; PredictionExchange overrides must erase alike\n 'fetchOrderBook': [ 0 ],\n 'request': [ 3 ],\n 'sign': [ 3 ],\n 'handleErrors': [ 4 ],\n 'parseOrder': [ 0 ],\n 'parseTrade': [ 0 ],\n 'amountToPrecision': [ 0 ],\n 'client': [ 0 ],\n 'costToPrecision': [ 0 ],\n 'handleOptionAndParams': [ 1 ],\n 'market': [ 0 ],\n 'marketSymbols': [ 1 ],\n 'parseAccount': [ 0 ],\n 'parseMarket': [ 0 ],\n 'parseOrderBook': [ 1 ],\n 'priceToPrecision': [ 0 ],\n 'safeBalance': [ 0 ],\n 'safeOpenInterest': [ 0 ],\n 'safeSymbol': [ 0 ],\n // java/tests/src/main/java/tests/base/TestSafeTicker.java is generated by the\n // --baseTests stage, which the farm's java target never reruns: it calls\n // `exchange.safeTicker()` and cannot be regenerated with a checkcast\n 'safeTicker': [ 0 ],\n 'symbol': [ 0 ],\n 'watch': [ 0, 1 ],\n};\n\n// only the generated tiers carry the annotation: a method declared in ts/src/base/** has a\n// hand-written java counterpart (BaseExchange/Exchange/Helpers/Precise) that keeps `Object`\nconst JAVA_NATIVE_PARAMETER_GENERATED_FILES = /(^|\\/)ts\\/src\\/(?:pro\\/|prediction\\/)?[a-z0-9_]+\\.ts$/;\n\n// the base tier is generated too: the transpiled `BaseExchange` body of\n// ts/src/base/Exchange.ts is spliced into java/lib/.../BaseExchange.java (the hand-written\n// java surface around it is not a class of its own), so its declarations print the\n// the base tiers print only the methods below this line of ts/src/base/(Prediction)Exchange.ts\nconst JAVA_TRANSPILE_DELIMITER = 'METHODS BELOW THIS LINE ARE TRANSPILED FROM TYPESCRIPT';\n// hand-written base methods whose Java runtime declares exactly the TS parameters (no varargs)\nconst JAVA_HANDWRITTEN_FULL_ARITY = new Set(['loadMarkets', 'fetchMarkets', 'fetchCurrencies', 'exceptionMessage']);\nconst JAVA_HANDWRITTEN_TIER_FILES = /(^|\\/)ts\\/src\\/(?:base|static_dependencies)\\//;\nconst JAVA_NATIVE_PARAMETER_BASE_FILES = /(^|[\\\\/])ts[\\\\/]src[\\\\/]base[\\\\/](Prediction)?Exchange(\\.nooverloads[^/]*)?\\.ts$/;\n\n// ===== native RETURN types (D-09) =====\n//\n// The printer declares every generated method `Object` (BaseTranspiler.printFunctionType\nconst JAVA_NATIVE_RETURN_MAP_TYPE = 'java.util.Map';\n\n// the hand-written `public String` producers of the base tier a `this. (...)` return\n// may print: the safeString* family, decimalToPrecision / numberToString (BaseExchange.java)\n// and the string helpers of base/functions/type.ts. Guarded by the resolved signature still\nconst JAVA_STRING_RETURN_BASE_METHODS: Set = new Set([\n 'safeString', 'safeString2', 'safeStringN',\n 'safeStringUpper', 'safeStringUpper2', 'safeStringUpperN',\n 'safeStringLower', 'safeStringLower2', 'safeStringLowerN',\n 'decimalToPrecision', 'numberToString', 'formatNumber', 'implodeParams', 'implodeHostname',\n]);\nconst JAVA_STRING_RETURN_BASE_FILES = /(^|[\\\\/])ts[\\\\/]src[\\\\/]base[\\\\/](?:functions[\\\\/](?:type|time)\\.ts|Exchange(\\.nooverloads[^/]*)?\\.ts)$/;\n\n// prediction venues (ts/src/prediction/.ts) live in their own package: their Java base,\n// PredictionExchange.java, carries the injected Exchange-tier body (javaTranspiler.ts\n// getExchangeTierBody), and the venue chain (abstract/prediction/ -> PredictionExchange ->\nconst JAVA_NATIVE_PARAMETER_PREDICTION_FILES = /(^|\\/)ts\\/src\\/prediction\\/[a-z0-9_]+\\.ts$/;\n\nconst JAVA_BOOLEAN_EXCLUDED_TYPE_FLAGS: number =\n TypeFlags.Any | TypeFlags.Unknown | TypeFlags.Undefined | TypeFlags.Null\n | TypeFlags.Void | TypeFlags.Never | TypeFlags.TypeParameter | TypeFlags.Conditional\n | TypeFlags.Enum | TypeFlags.EnumLiteral;\n\n// the union members a nullable boolean box may hold: `Bool` (`boolean | undefined`) and the\n// `boolean | null` spellings. A member of any other family (`Int`, `Str`, `any`) is a box the\n// isTrue helper tests with its runtime truthiness, so the helper must stay.\nconst JAVA_NULLABLE_BOOLEAN_MEMBER_FLAGS: number =\n TypeFlags.Boolean | TypeFlags.BooleanLiteral | TypeFlags.Undefined | TypeFlags.Null\n | TypeFlags.Void;\n\n// the `handle*Bool` accessors route through safeBool, which returns the caller's default untouched\n// when the found value is not a Boolean, so element 0 of their `[Bool, Dict]` tuple is a\n// Boolean-or-null box. The handleOptionAndParams family returns the raw member and is absent.\nconst JAVA_BOOLEAN_BOX_TUPLE_METHODS = new Set([\n 'handleParamBool',\n 'handleParamBool2',\n 'handleOptionBoolAndParams', // element 0 is checkOptionBool's Boolean-or-null (throws otherwise)\n 'handleOptionBoolAndParams2',\n]);\n\n// the Java printer and its build hooks re-ask the same checker questions about one node,\n// type, symbol or signature; answers are fixed per snapshot, so each is one round trip\nconst JAVA_MEMO_UNDEFINED = Symbol(\"javaMemoUndefined\");\nconst JAVA_MEMOIZED_METHODS = [\"getSignatureFromDeclaration\", \"isArrayType\", \"isTupleType\", \"getAliasedSymbol\", \"getTypeArguments\", \"getDeclaredTypeOfSymbol\", \"getReturnTypeOfSignature\", \"getSymbolOfType\", \"getTypeOfSymbolAtLocation\", \"getSignaturesOfType\", \"typeToString\", \"getTypesOfType\"];\nconst JAVA_TYPE_PREFETCH_KINDS = new Set([SyntaxKind.Identifier, SyntaxKind.BinaryExpression, SyntaxKind.Parameter, SyntaxKind.VariableDeclaration, SyntaxKind.StringLiteral, SyntaxKind.MethodDeclaration, SyntaxKind.PropertyAccessExpression, SyntaxKind.ParenthesizedExpression, SyntaxKind.ElementAccessExpression]);\nconst JAVA_SYMBOL_PREFETCH_KINDS = new Set([SyntaxKind.Identifier]);\n// the first lookup in a source file answers every node of the hot kinds in that file in one\n// array request, skipping nodes the core prefetch already cached; other kinds go one by one\nfunction prefetchByFile(checker: Checker, name: \"getTypeAtLocation\" | \"getSymbolAtLocation\", kinds: Set): void {\n const original = (checker as any)[name] as ((nodes: any) => any) & { has?: (node: Node) => boolean };\n const cache = new WeakMap();\n const done = new WeakSet();\n Object.defineProperty(checker, name, { configurable: true, value: (node: any) => {\n if (Array.isArray(node)) {\n return original(node);\n }\n if (cache.has(node)) {\n return cache.get(node);\n }\n const sf = node.getSourceFile?.();\n if (sf !== undefined && !done.has(sf)) {\n done.add(sf);\n const nodes: Node[] = [];\n const visit = (n: Node) => {\n if (kinds.has(n.kind) && !original.has?.(n)) {\n nodes.push(n);\n }\n n.forEachChild(visit);\n };\n sf.forEachChild(visit);\n if (nodes.length > 0) {\n const results = original(nodes);\n for (let i = 0; i < nodes.length; i++) {\n cache.set(nodes[i], results[i]);\n }\n }\n if (cache.has(node)) {\n return cache.get(node);\n }\n }\n const result = original(node);\n cache.set(node, result);\n return result;\n } });\n}\n\n// getResolvedSignature has no array form: the first lookup in a file pipelines every call\n// expression of that file through one batched request (API#batch over the checker's client)\nfunction prefetchResolvedSignatures(checker: Checker): void {\n const original = checker.getResolvedSignature;\n const client = (checker as any).client;\n if (client === undefined) {\n return;\n }\n const cache = new WeakMap();\n const done = new WeakSet();\n Object.defineProperty(checker, \"getResolvedSignature\", { configurable: true, value: (node: any) => {\n if (cache.has(node)) {\n return cache.get(node);\n }\n const sf = node?.getSourceFile?.();\n if (sf !== undefined && !done.has(sf)) {\n done.add(sf);\n const calls: Node[] = [];\n const visit = (n: Node) => {\n if (n.kind === SyntaxKind.CallExpression && !(original as any).has?.(n)) {\n calls.push(n);\n }\n n.forEachChild(visit);\n };\n sf.forEachChild(visit);\n if (calls.length > 0) {\n const results = API.prototype.batch.call({ client }, ...calls.map((c) => original.gen(c))) as unknown[];\n for (let i = 0; i < calls.length; i++) {\n cache.set(calls[i], results[i]);\n }\n }\n if (cache.has(node)) {\n return cache.get(node);\n }\n }\n const result = original(node);\n cache.set(node, result);\n return result;\n } });\n}\n\nfunction memoizeJavaCheckerCalls(checker: Checker): Checker {\n if ((checker as any).__javaMemoized) {\n return checker;\n }\n Object.defineProperty(checker, \"__javaMemoized\", { value: true });\n prefetchByFile(checker, \"getTypeAtLocation\", JAVA_TYPE_PREFETCH_KINDS);\n prefetchByFile(checker, \"getSymbolAtLocation\", JAVA_SYMBOL_PREFETCH_KINDS);\n prefetchResolvedSignatures(checker);\n for (const name of JAVA_MEMOIZED_METHODS) {\n const original = (checker as any)[name];\n if (typeof original !== \"function\") {\n continue;\n }\n const byFirst = new WeakMap>();\n Object.defineProperty(checker, name, { configurable: true, value: (first: any, ...rest: any[]) => {\n if (first === null || (typeof first !== \"object\" && typeof first !== \"function\") || rest.some((a) => a !== undefined && typeof a === \"object\")) {\n return original(first, ...rest);\n }\n let byRest = byFirst.get(first);\n if (byRest === undefined) {\n byRest = new Map();\n byFirst.set(first, byRest);\n }\n const key = rest.length === 0 ? \"\" : JSON.stringify(rest);\n const cached = byRest.get(key);\n if (cached !== undefined) {\n return cached === JAVA_MEMO_UNDEFINED ? undefined : cached;\n }\n const result = original(first, ...rest);\n byRest.set(key, result === undefined ? JAVA_MEMO_UNDEFINED : result);\n return result;\n } });\n }\n return checker;\n}\n\nexport class JavaTranspiler extends BaseTranspiler {\n\n getChecker(): Checker {\n return memoizeJavaCheckerCalls(super.getChecker());\n }\n\n // override lookups repeat per method on every printed call and hook; the answer is fixed per node\n private methodOverrideCache = new WeakMap();\n getMethodOverride(node: Node): Node {\n if (node === undefined || node === null) {\n return super.getMethodOverride(node);\n }\n const cached = this.methodOverrideCache.get(node);\n if (cached !== undefined) {\n return cached === JAVA_MEMO_UNDEFINED ? undefined : cached;\n }\n const result = this.javaMethodOverrideFromIndex(node);\n this.methodOverrideCache.set(node, result === undefined ? JAVA_MEMO_UNDEFINED : result);\n return result;\n }\n\n // BaseTranspiler.getMethodOverride answered from a per-class ancestor chain of\n // name -> last method maps (the furthest ancestor declaring the name wins, as there)\n private overrideChainCache = new WeakMap[] | null>();\n private javaMethodOverrideFromIndex(node: Node): Node {\n const classDeclaration = node.parent;\n if (!isClassDeclaration(classDeclaration) || !(classDeclaration as any).heritageClauses) {\n return undefined;\n }\n let chain = this.overrideChainCache.get(classDeclaration);\n if (chain === undefined) {\n chain = [];\n let parentClass = getAllSuperTypeNodes(classDeclaration)[0];\n while (parentClass !== undefined) {\n const parentClassDecl = this.getChecker().getTypeAtLocation(parentClass)?.getSymbol()?.valueDeclaration?.resolve();\n if (parentClassDecl === undefined) {\n chain = null; // the base path warns and answers undefined\n break;\n }\n const byName = new Map();\n for (const elem of (parentClassDecl as any).members ?? []) {\n if (isMethodDeclaration(elem)) {\n byName.set(elem.name.getText().trim(), elem);\n }\n }\n chain.push(byName);\n parentClass = getAllSuperTypeNodes(parentClassDecl)[0] ?? undefined;\n }\n this.overrideChainCache.set(classDeclaration, chain);\n }\n if (chain === null) {\n return super.getMethodOverride(node);\n }\n const name = (node as any).name.text;\n let method = undefined;\n for (const byName of chain) {\n method = byName.get(name) ?? method;\n }\n return method;\n }\n\n checkerOrUndefined(): Checker | undefined {\n const checker = super.checkerOrUndefined();\n return checker === undefined ? undefined : memoizeJavaCheckerCalls(checker);\n }\n\n // optional proof of the concrete printed Java type of an expression, installed by the embedding\n // build layer for the locals it retypes (ccxt: build/java-local-types.js); it must match the\n // declared type or the operator will not compile. Only `String` is consumed (native `+` anchor).\n javaExpressionTypeResolver?: (node) => string | undefined;\n\n // the embedding build layer (build/java-local-types.js) installs this: it names the\n // Java type of a local whose printed declaration line it rewrote (`Long`/`Double`).\n // The arithmetic rule reads it for identifier operands only.\n\n countRequiredParameters(declaration) {\n // parameters with no default, no question token and no rest are required positionally\n return (declaration?.parameters ?? [])\n .filter((p) => p.initializer === undefined && p.questionToken === undefined && p.dotDotDotToken === undefined).length;\n }\n\n printArgsForCallExpression(node, identation) {\n const fullArity = this.javaFullArityCallArguments(node.arguments ?? [], node, identation);\n if (fullArity !== undefined) {\n return fullArity;\n }\n let args: readonly any[] = node.arguments ?? [];\n const callee = node.expression;\n const isThisCall = callee?.kind === SyntaxKind.PropertyAccessExpression\n && callee.expression?.kind === SyntaxKind.ThisKeyword;\n if (isThisCall && args.length > 0) {\n const last = args[args.length - 1];\n const isNullish = last.kind === SyntaxKind.NullKeyword\n || (last.kind === SyntaxKind.Identifier && last.text === 'undefined');\n // the trailing nullish may only be dropped when it sits in the OPTIONAL tail\n // of the resolved signature - a required positional parameter passed as an\n // explicit undefined (e.g. dydx signDydxTx) must be kept, otherwise the\n // emitted call breaks arity, see https://github.com/ccxt/ccxt/actions/runs/31321542066\n let inOptionalTail = false;\n if (isNullish) {\n const signature = this.getChecker().getResolvedSignature(node);\n const declaration = signature?.declaration?.resolve();\n if (declaration !== undefined) {\n inOptionalTail = args.length > this.countRequiredParameters(declaration);\n }\n }\n if (isNullish && inOptionalTail) {\n // drop exactly one trailing null/undefined argument: the generated java\n // surface is uniformly (required..., Object... optionals), and a bare\n // trailing null is ambiguous to javac (\"non-varargs call of varargs\n // method with inexact argument type for last parameter\"). Omission is\n // behaviorally identical - both Helpers.getArg and SafeMethods.opt\n // treat a null varargs array and an empty one the same, see\n // https://github.com/ccxt/ccxt/pull/29617 for the warning inventory\n args = args.slice(0, -1);\n }\n }\n return this.javaPrintCallArguments(args, node, identation);\n }\n\n // a call into a method whose fixed parameter prints a native type: generated locals are `Object`,\n // so the argument carries the same checkcast as native map/string reads. The checker proved the\n // argument assignable to the parameter, so the declared type describes the value received.\n javaPrintCallArguments(args, node, identation) {\n const superCore = this.javaSuperCoreCallArguments(args, node, identation);\n if (superCore !== undefined) {\n return superCore;\n }\n const scheduled = this.javaScheduledCallArguments(args, node, identation);\n if (scheduled !== undefined) {\n return scheduled;\n }\n const spawnTypes = this.javaSpawnCallParameterTypes(node);\n const parameterTypes = spawnTypes !== undefined ? spawnTypes : this.javaNativeCallParameterTypes(node);\n return args.map((a, i) => {\n const parsedArg = this.printNode(a, identation).trim();\n const type = parameterTypes[i];\n if (type === undefined || this.javaNativeArgumentAlreadyTyped(a, type)) {\n return parsedArg;\n }\n // the checkcast carries its own parentheses: a bare `(T) cond ? a : b` binds the\n // condition, not the whole argument\n return `(${type}) (${parsedArg})`;\n }).join(\", \");\n }\n\n // the implementation declaration of a resolved method (an overload signature has no body)\n javaMethodImplementation(declaration) {\n if (declaration === undefined || !isMethodDeclaration(declaration)) {\n return undefined;\n }\n if (declaration.body !== undefined) {\n return declaration;\n }\n try {\n const symbol = this.getChecker().getSymbolAtLocation(declaration.name);\n return symbol?.declarations?.map((d) => d.resolve()).find((d) => isMethodDeclaration(d) && d.body !== undefined);\n } catch (e) {\n return undefined;\n }\n }\n\n // a method this printer emits with its single typed signature: hand-written Java declares\n // ts/src/base/** except the base tiers below their transpile delimiter\n javaIsPrintedMethod(method): boolean {\n if (method === undefined || !isMethodDeclaration(method) || method.body === undefined\n || !isClassDeclaration(method.parent)) {\n return false;\n }\n const file = method.getSourceFile();\n const fileName = file.fileName.replace(/\\\\/g, '/');\n if (!/(^|\\/)ts\\/src\\//.test(fileName)) {\n return true;\n }\n if (JAVA_NATIVE_PARAMETER_BASE_FILES.test(fileName)) {\n const delimiter = file.text.indexOf(JAVA_TRANSPILE_DELIMITER);\n return (delimiter >= 0 && method.pos > delimiter)\n || JAVA_HANDWRITTEN_FULL_ARITY.has((method.name as any)?.text);\n }\n // every class outside the hand-written tiers is printed (exchanges, tests, ...)\n return !JAVA_HANDWRITTEN_TIER_FILES.test(fileName);\n }\n\n javaHasOptionalParameter(method): boolean {\n return (method?.parameters ?? []).some((p) => p.initializer !== undefined || p.questionToken !== undefined);\n }\n\n // a call into a printed method with optional parameters passes every parameter: omitted or\n // `undefined` slots take the TS default, fixed slots keep the native checkcast\n javaFullArityCallArguments(args, node, identation): string | undefined {\n const callee = node.expression;\n if (callee?.kind !== SyntaxKind.PropertyAccessExpression\n || callee.expression?.kind === SyntaxKind.SuperKeyword) {\n return undefined;\n }\n let method;\n try {\n method = this.javaMethodImplementation(this.getChecker().getResolvedSignature(node)?.declaration?.resolve())\n ?? this.javaAnyReceiverBaseMethod(callee);\n } catch (e) {\n return undefined;\n }\n return this.javaFullArityArguments(method, args, identation);\n }\n\n // an `any` receiver (the tests' `exchange: any`) compiles against the Java Exchange class:\n // bind the base Exchange method of that name when it is implemented exactly once\n javaAnyReceiverBaseMethod(callee) {\n const type = this.getChecker().getTypeAtLocation(callee.expression);\n if ((type.flags & TypeFlags.Any) === 0) {\n return undefined;\n }\n const methods = this.baseExchangeMethodsByName().get(callee.name?.text as string);\n return methods?.length === 1 ? methods[0] : undefined;\n }\n\n private _baseExchangeMethodsByName = new WeakMap>();\n baseExchangeMethodsByName(): Map {\n const program = this.getProgram();\n const cached = this._baseExchangeMethodsByName.get(program);\n if (cached !== undefined) {\n return cached;\n }\n const names = new Map();\n const fileName = program.getSourceFileNames()\n .find((f) => /(^|[\\\\/])ts[\\\\/]src[\\\\/]base[\\\\/]Exchange\\.ts$/.test(f));\n const file = fileName !== undefined ? program.getSourceFile(fileName) : undefined;\n // the implementations live on BaseExchange; Exchange only adds its own tier, and a name\n // the base class implements binds there (the receiver compiles against BaseExchange)\n for (const className of ['BaseExchange', 'Exchange']) {\n const cls = file?.statements.find((s) => isClassDeclaration(s) && s.name?.text === className) as any;\n const own = new Map();\n for (const member of cls?.members ?? []) {\n if (isMethodDeclaration(member) && member.body !== undefined && isIdentifier(member.name)) {\n own.set(member.name.text, (own.get(member.name.text) ?? []).concat([member]));\n }\n }\n own.forEach((methods, key) => names.has(key) || names.set(key, methods));\n }\n this._baseExchangeMethodsByName.set(program, names);\n return names;\n }\n\n javaFullArityArguments(method, args, identation): string | undefined {\n if (!this.javaIsPrintedMethod(method) || !this.javaHasOptionalParameter(method)) {\n return undefined;\n }\n const params = method.parameters;\n if (args.length > params.length || params.some((p) => p.dotDotDotToken !== undefined)\n || args.some((a) => a.kind === SyntaxKind.SpreadElement)) {\n return undefined;\n }\n const types = this.javaCoreParameterTypes(method);\n return params.map((p, i) => {\n const arg = args[i];\n if (arg === undefined || (p.initializer !== undefined && this.javaIsUndefinedLiteral(arg))) {\n return this.javaCoreDefaultArgument(p, types[i]);\n }\n const printed = this.printNode(arg, identation).trim();\n if (p.initializer !== undefined) {\n return this.javaArgumentHasType(arg, types[i]) || types[i] === 'Object'\n ? (this.javaIsUndefinedLiteral(arg) ? 'null' : printed)\n : this.javaConvertToCoreType(types[i], printed, arg);\n }\n const native = this.javaNativeParameterType(p);\n if (native === undefined || this.javaNativeArgumentAlreadyTyped(arg, native)) {\n return printed;\n }\n return `(${native}) (${printed})`;\n }).join(', ');\n }\n\n javaIsUndefinedLiteral(node): boolean {\n return node?.kind === SyntaxKind.Identifier && node.text === 'undefined';\n }\n\n // `this.spawn(this.m, a..)` / `this.delay(ms, this.m, a..)`: the ccxt post-pass turns the\n // reference into a lambda calling `this.m(a..)`, so those arguments take m's full arity\n javaScheduledCallArguments(args, node, identation): string | undefined {\n const callee = node.expression;\n if (callee?.kind !== SyntaxKind.PropertyAccessExpression\n || callee.expression?.kind !== SyntaxKind.ThisKeyword) {\n return undefined;\n }\n const at = callee.name?.text === 'spawn' ? 0 : (callee.name?.text === 'delay' ? 1 : -1);\n const reference = at >= 0 ? args[at] : undefined;\n if (reference?.kind !== SyntaxKind.PropertyAccessExpression\n || reference.expression?.kind !== SyntaxKind.ThisKeyword) {\n return undefined;\n }\n let method;\n try {\n const symbol = this.getChecker().getSymbolAtLocation(reference.name);\n method = this.javaMethodImplementation(symbol?.valueDeclaration?.resolve() ?? symbol?.declarations?.[0]?.resolve());\n } catch (e) {\n return undefined;\n }\n const forwarded = this.javaFullArityArguments(method, args.slice(at + 1), identation);\n if (forwarded === undefined) {\n return undefined;\n }\n const head = args.slice(0, at + 1).map((a) => this.printNode(a, identation).trim());\n return head.concat(forwarded.length > 0 ? [forwarded] : []).join(', ');\n }\n\n // `super.x(..)` into a split method must bind the typed core: an ancestor bridge re-dispatches\n // through `this`, which lands back in the overriding core (infinite recursion)\n javaSuperCoreCallArguments(args, node, identation): string | undefined {\n const callee = node.expression;\n if (callee?.kind !== SyntaxKind.PropertyAccessExpression\n || callee.expression?.kind !== SyntaxKind.SuperKeyword) {\n return undefined;\n }\n let declaration;\n try {\n declaration = this.javaMethodImplementation(this.getChecker().getResolvedSignature(node)?.declaration?.resolve());\n } catch (e) {\n return undefined;\n }\n if (declaration === undefined || !this.hasDefaultedTail(declaration)) {\n return undefined;\n }\n const params = (declaration as any).parameters;\n if (params.some((p) => p.dotDotDotToken !== undefined)) {\n return undefined;\n }\n if (args.length > params.length) {\n return undefined;\n }\n const types = this.javaCoreParameterTypes(declaration);\n return params.map((p, i) => (i < args.length\n ? (this.javaArgumentHasType(args[i], types[i]) ? this.printNode(args[i], identation).trim()\n : this.javaConvertToCoreType(types[i], this.printNode(args[i], identation).trim(), args[i]))\n : this.javaCoreDefaultArgument(p, types[i]))).join(', ');\n }\n\n // an argument that is a parameter of the enclosing method already printed with this type\n javaArgumentHasType(arg, type: string): boolean {\n if (arg?.kind !== SyntaxKind.Identifier) {\n return false;\n }\n let declaration;\n try {\n declaration = this.getChecker().getSymbolAtLocation(arg)?.valueDeclaration?.resolve();\n } catch (e) {\n return false;\n }\n if (declaration === undefined || !isParameterDeclaration(declaration)) {\n return false;\n }\n const method = declaration.parent;\n if (!isMethodDeclaration(method) && this.ReassignedVars[this.getVarKey(declaration)] && this.isAsyncFunction(method)) {\n return false; // an async function body reads an `Object` copy\n }\n const printed = declaration.initializer !== undefined\n ? (this.hasDefaultedTail(method) ? this.javaOptionalParameterJavaType(declaration) : 'Object')\n : (this.printParameterType(declaration) || 'Object').trim();\n return this.javaErasure(printed) === this.javaErasure(type);\n }\n\n // the printed Java type of every parameter of a split method's typed core\n javaCoreParameterTypes(method): string[] {\n return method.parameters.map((p) => (p.initializer !== undefined\n ? this.javaOptionalParameterJavaType(p)\n : (this.printParameterType(p) || 'Object').trim()));\n }\n\n // an omitted parameter of a typed-core call: its TS default, typed like the front's reader\n javaCoreDefaultArgument(param, type: string): string {\n const initializer = param.initializer;\n // a default that reads other parameters or has effects is applied by the callee\n const value = initializer === undefined || !this.isPureInitializer(initializer) ? 'null' : this.printNode(initializer, 0);\n if (value === 'null') {\n return `(${type}) null`;\n }\n if (type === 'Long' && /^-?\\d+$/.test(value)) {\n return value + 'L';\n }\n if (type === JAVA_STRING_LIST_TYPE && isArrayLiteralExpression(initializer) && initializer.elements.length === 0) {\n return 'new java.util.ArrayList()';\n }\n if (type === 'Object' || (type === 'String' && isStringLiteralLikeNode(initializer))\n || (type === 'java.util.Map' && isObjectLiteralExpression(initializer))) {\n return value;\n }\n return this.javaConvertToCoreType(type, value, initializer);\n }\n\n // a value of any static type converted to a typed-core parameter, with the fronts' semantics\n javaConvertToCoreType(type: string, printed: string, node): string {\n if (node?.kind === SyntaxKind.NullKeyword\n || (node?.kind === SyntaxKind.Identifier && node.text === 'undefined')) {\n return `(${type}) null`;\n }\n if (type === 'Object') {\n return `(Object) (${printed})`;\n }\n if (this.javaLocalDeclaredAs(node, printed, type)) {\n return printed;\n }\n if (type === 'Long') {\n if (/^-?\\d+$/.test(printed) && isNumericLiteral(isPrefixUnaryExpression(node) ? node.operand : node)) {\n return printed + 'L';\n }\n return /^-?\\d+L$/.test(printed) ? printed : `Helpers.toLongOrNull(${printed})`;\n }\n if (type === 'String') {\n return this.javaNativeArgumentAlreadyTyped(node, type) ? printed : `Helpers.toStringArg(${printed})`;\n }\n if (type === 'java.util.Map') {\n return `Helpers.toMapArg(${printed})`;\n }\n if (type === JAVA_STRING_LIST_TYPE) {\n return `Helpers.toStringListArg(${printed})`;\n }\n return `(${type}) (${printed})`;\n }\n\n // an identifier whose final Java declaration (the build layer's table, or a natively typed\n // parameter) is exactly the core type and which prints under its own name: no conversion\n javaLocalDeclaredAs(node, printed: string, type: string): boolean {\n if (node === undefined || !isIdentifier(node) || printed !== node.text) {\n return false;\n }\n const declaration = this.javaDeclarationOfIdentifier(node);\n if (declaration === undefined || !isVariableDeclaration(declaration)) {\n return this.javaArgumentHasType(node, type)\n && (type !== JAVA_STRING_LIST_TYPE || this.javaDeclaredTypeOf(node) === JAVA_STRING_LIST_TYPE);\n }\n const declared = this.javaDeclaredTypeOf(node);\n return declared !== undefined && declared.replace(/\\s+/g, '').replace(/^java\\.util\\./, '')\n === type.replace(/\\s+/g, '').replace(/^java\\.util\\./, '');\n }\n\n // Java erasure of a printed type, for override/bridge comparisons\n javaErasure(type: string): string {\n return type.replace(/<.*>/, '').replace(/^java\\.util\\./, '').trim();\n }\n\n // An override whose typed core differs from an ancestor's (another parameter count, another\n // default position or type) no longer overrides it in Java: a bridge with the ancestor's\n // signature forwards to this method, so base code calling the ancestor core reaches it.\n printOverrideBridges(node, identation): string {\n const ownTypes = this.javaCoreParameterTypes(node);\n const ownKey = ownTypes.map((t) => this.javaErasure(t)).join(',');\n const seen = new Set();\n let out = '';\n let ancestor;\n try {\n ancestor = this.getMethodOverride(node);\n } catch (e) {\n return '';\n }\n while (ancestor !== undefined) {\n if (this.hasDefaultedTail(ancestor)) {\n const ancestorTypes = this.javaCoreParameterTypes(ancestor);\n const key = ancestorTypes.map((t) => this.javaErasure(t)).join(',');\n if (key !== ownKey && !seen.has(key)) {\n seen.add(key);\n out += this.printOverrideBridge(node, ancestor, ancestorTypes, ownTypes, identation);\n }\n }\n try {\n ancestor = this.getMethodOverride(ancestor);\n } catch (e) {\n ancestor = undefined;\n }\n }\n return out;\n }\n\n printOverrideBridge(node, ancestor, ancestorTypes: string[], ownTypes: string[], identation): string {\n const name = this.transformMethodNameIfNeeded(node.name.text);\n const ancestorNames = ancestor.parameters.map((p) => this.printNode(p.name, 0));\n const ancestorDef = this.printMethodDefinition(ancestor, identation,\n () => ancestorTypes.map((t, i) => `${t} ${ancestorNames[i]}`).join(', '));\n const forwarded = node.parameters.map((p, i) => (i < ancestorNames.length\n ? (this.javaErasure(ownTypes[i]) === this.javaErasure(ancestorTypes[i]) ? ancestorNames[i]\n : this.javaConvertToCoreType(ownTypes[i], ancestorNames[i], undefined))\n : this.javaCoreDefaultArgument(p, ownTypes[i]))).join(', ');\n const call = `this.${name}(${forwarded})`;\n const returnOf = (def: string) => def.match(/(?:public|protected|private)\\s+(?:static\\s+)?(.+?)\\s+\\w+\\s*\\(/)?.[1]?.trim() ?? 'Object';\n const returnType = returnOf(ancestorDef);\n const ownReturn = returnOf(this.printMethodDefinition(node, identation, () => ''));\n const body = returnType === 'void' ? `${call};`\n : returnType === ownReturn ? `return ${call};` : `return (${returnType}) (Object) ${call};`;\n return \"\\n\" + ancestorDef + this.getBlockOpen(identation)\n + this.getIden(identation + 1) + body\n + this.getBlockClose(identation);\n }\n\n // `this.spawn(this.someMethod, args...)`: the spawned work executes `this.someMethod(args)`\n // (the ccxt post-pass rewrites the reference into a lambda), so the arguments belong to the\n // referenced method's signature, not to spawn's `...args` - each one carries the checkcast\n javaSpawnCallParameterTypes(node): (string | undefined)[] | undefined {\n const callee = node.expression;\n if (callee?.kind !== SyntaxKind.PropertyAccessExpression\n || callee.expression?.kind !== SyntaxKind.ThisKeyword\n || callee.name?.text !== 'spawn') {\n return undefined;\n }\n const reference = (node.arguments ?? [])[0];\n if (reference?.kind !== SyntaxKind.PropertyAccessExpression\n || reference.expression?.kind !== SyntaxKind.ThisKeyword\n || reference.name?.text === undefined) {\n return undefined;\n }\n let declaration;\n try {\n const symbol = this.getChecker().getSymbolAtLocation(reference.name);\n declaration = symbol?.valueDeclaration?.resolve() ?? symbol?.declarations?.[0]?.resolve();\n } catch (e) {\n return undefined;\n }\n const parameters = (declaration as any)?.parameters;\n if (parameters === undefined) {\n return undefined;\n }\n return (node.arguments ?? []).map((a, i) => {\n if (i === 0) {\n return undefined;\n }\n const param = parameters[i - 1];\n if (param === undefined || !isParameterDeclaration(param)) {\n return undefined;\n }\n return this.javaNativeParameterType(param);\n });\n }\n\n // the argument is a literal (or a String the embedding build layer's resolver proves)\n // and the parameter declares exactly that type, so no cast is needed. Every other\n // argument prints from a local the printer declares `Object`, and needs the checkcast.\n javaNativeArgumentAlreadyTyped(arg, type: string) {\n if (arg.kind === SyntaxKind.NullKeyword) {\n return true;\n }\n // an object literal prints a `HashMap` instance, already a Map\n if (type === JAVA_NATIVE_RETURN_MAP_TYPE && isObjectLiteralExpression(arg)) {\n return true;\n }\n if (type !== 'String') {\n return false;\n }\n if (isStringLiteralLikeNode(arg)) {\n return true;\n }\n return this.javaProvableString(arg);\n }\n\n // the native printed type of each argument position of a call, when the resolved\n // signature declares that parameter natively\n javaNativeCallParameterTypes(node): (string | undefined)[] {\n const checker: any = this.checkerOrUndefined();\n if (checker === undefined) {\n return [];\n }\n const declaration = checker.getResolvedSignature(node)?.declaration?.resolve();\n const parameters = (declaration as any)?.parameters;\n if (parameters === undefined) {\n return [];\n }\n return (node.arguments ?? []).map((a, i) => {\n const param = parameters[i];\n if (param === undefined || !isParameterDeclaration(param)) {\n return undefined;\n }\n return this.javaNativeParameterType(param);\n });\n }\n\n binaryExpressionsWrappers;\n\n varListFromObjectLiterals = {};\n // binary operators whose printed Java is a primitive boolean: Helpers.isEqual (and the\n // negated `!Helpers.isEqual` / `<` / `>` / `<=` / `>=` family), Helpers.inOp,\n // Helpers.isInstance and the native `&&` / `||`\n javaBooleanOperators = Array.from(JAVA_BOOLEAN_OPERATOR_KINDS);\n // Per-function analysis results. Populated by analyzeFinalVars at the start of\n // printFunctionBody and consumed during printing of the same function body.\n usageToFinalName: WeakMap = new WeakMap();\n // Stack of emitted-finalName sets, one entry per enclosing block. Pushed on block\n // entry, popped on exit. Used by buildFinalVarDeclarations to dedup: skip if the\n // finalName is already in scope via any ancestor.\n finalVarScopeStack: Array> = [];\n // Identifiers rewritten in place to their finalXxx name during the current emit.\n // The parsed ts.SourceFile is cached and reused across transpile calls, so the\n // rewrite has to be undone when the emit ends — otherwise a second emit of the\n // same file reads `finalX` where the first read `x`, the symbol no longer\n // resolves, and the hoisted `final Object finalX = x;` declaration is dropped\n // while its usages remain.\n finalVarMutations: Array<{ node: any; text: any; ownGetFullText: boolean; getFullText: any }> = [];\n // Java expression passed as the second supplyAsync argument for async methods.\n // Empty (the default) emits the single-argument, common-pool supplyAsync form.\n asyncExecutor = '';\n // Static method emitted in place of java.util.concurrent.CompletableFuture.supplyAsync\n // for async methods. The callee owns the executor choice, so no second argument is emitted.\n asyncSupplier = '';\n\n constructor(config = {}) {\n config[\"parser\"] = Object.assign({}, parserConfig, config[\"parser\"] ?? {});\n super(config);\n\n this.requiresParameterType = true;\n this.requiresReturnType = true;\n this.asyncTranspiling = true;\n this.implicitAsyncTranspiling = true;\n this.supportsFalsyOrTruthyValues = false;\n this.requiresCallExpressionCast = true;\n this.id = \"Java\";\n\n this.initConfig();\n this.applyUserOverrides(config);\n this.asyncExecutor = config['asyncExecutor'] ?? '';\n this.asyncSupplier = config['asyncSupplier'] ?? '';\n }\n\n initConfig() {\n this.LeftPropertyAccessReplacements = {\n // 'this': '$this',\n };\n\n this.RightPropertyAccessReplacements = {\n // Java list/string methods (lowerCamelCase)\n push: \"add\",\n indexOf: \"indexOf\",\n toUpperCase: \"toUpperCase\",\n toLowerCase: \"toLowerCase\",\n toString: \"toString\",\n };\n\n this.FullPropertyAccessReplacements = {\n \"JSON.parse\": \"parseJson\",\n \"console.log\": \"System.out.println\",\n \"Number.MAX_SAFE_INTEGER\": \"Long.MAX_VALUE\",\n \"Math.min\": \"Math.min\",\n \"Math.max\": \"Math.max\",\n \"Math.log\": \"Math.log\",\n \"Math.abs\": \"Math.abs\",\n \"Math.floor\": \"Math.floor\",\n \"Math.pow\": \"Math.pow\",\n // 'Promise.all' handled via promiseAll wrapper\n };\n\n this.CallExpressionReplacements = {\n 'parseInt': \"Helpers.parseInt\",\n \"parseFloat\": \"Helpers.parseFloat\",\n // Add ad-hoc function call rewrites here if you need them\n };\n\n\n this.ReservedKeywordsReplacements = {\n string: \"str\",\n object: \"obj\",\n params: \"parameters\",\n // base: \"bs\",\n internal: \"intern\",\n event: \"eventVar\",\n fixed: \"fixedVar\",\n final: \"finalVar\",\n native: \"nativeVar\",\n // add Java keywords if you need to avoid collisions (e.g., enum, assert)\n };\n\n this.VariableTypeReplacements = {\n string: \"String\",\n Str: \"String\",\n number: \"double\",\n Int: \"long\",\n Num: \"double\",\n Dict: \"java.util.Map\",\n Strings: \"java.util.List\",\n List: \"java.util.List\",\n boolean: \"boolean\",\n object: \"Object\",\n };\n\n this.ArgTypeReplacements = { ...this.VariableTypeReplacements };\n\n this.binaryExpressionsWrappers = {\n [SyntaxKind.EqualsEqualsToken]: [this.EQUALS_EQUALS_WRAPPER_OPEN, this.EQUALS_EQUALS_WRAPPER_CLOSE],\n [SyntaxKind.EqualsEqualsEqualsToken]: [this.EQUALS_EQUALS_WRAPPER_OPEN, this.EQUALS_EQUALS_WRAPPER_CLOSE],\n [SyntaxKind.ExclamationEqualsToken]: [this.DIFFERENT_WRAPPER_OPEN, this.DIFFERENT_WRAPPER_CLOSE],\n [SyntaxKind.ExclamationEqualsEqualsToken]: [this.DIFFERENT_WRAPPER_OPEN, this.DIFFERENT_WRAPPER_CLOSE],\n [SyntaxKind.GreaterThanToken]: [this.GREATER_THAN_WRAPPER_OPEN, this.GREATER_THAN_WRAPPER_CLOSE],\n [SyntaxKind.GreaterThanEqualsToken]: [this.GREATER_THAN_EQUALS_WRAPPER_OPEN, this.GREATER_THAN_EQUALS_WRAPPER_CLOSE],\n [SyntaxKind.LessThanToken]: [this.LESS_THAN_WRAPPER_OPEN, this.LESS_THAN_WRAPPER_CLOSE],\n [SyntaxKind.LessThanEqualsToken]: [this.LESS_THAN_EQUALS_WRAPPER_OPEN, this.LESS_THAN_EQUALS_WRAPPER_CLOSE],\n [SyntaxKind.PlusToken]: [this.PLUS_WRAPPER_OPEN, this.PLUS_WRAPPER_CLOSE],\n [SyntaxKind.MinusToken]: [this.MINUS_WRAPPER_OPEN, this.MINUS_WRAPPER_CLOSE],\n [SyntaxKind.AsteriskToken]: [this.MULTIPLY_WRAPPER_OPEN, this.MULTIPLY_WRAPPER_CLOSE],\n [SyntaxKind.PercentToken]: [this.MOD_WRAPPER_OPEN, this.MOD_WRAPPER_CLOSE],\n [SyntaxKind.SlashToken]: [this.DIVIDE_WRAPPER_OPEN, this.DIVIDE_WRAPPER_CLOSE],\n };\n }\n\n getBlockOpen(identation) {\n return \"\\n\" + this.getIden(identation) + this.BLOCK_OPENING_TOKEN + \"\\n\";\n }\n\n\n getCustomClassName(node) {\n return this.capitalize(node.name.text);\n }\n\n getClassModifier(node) {\n return \"public \";\n }\n\n printSuperCallInsideConstructor(_node, _identation) {\n // Java allows \"super(...)\" as the first line; we already inject it when needed.\n return \"\";\n }\n\n printNumericLiteral(node) {\n const javaMax = 2147483647;\n const nodeText = node.text;\n if (Number(nodeText) > javaMax && Number.isInteger(Number(nodeText)) && node.text.indexOf('e') === -1) {\n return `${nodeText}L`;\n }\n return node.text;\n }\n\n printIdentifier(node) {\n let idValue = node.text ?? node.text;\n\n if (this.ReservedKeywordsReplacements[idValue]) {\n idValue = this.ReservedKeywordsReplacements[idValue];\n }\n\n if (idValue === \"undefined\") {\n return this.UNDEFINED_TOKEN;\n }\n\n const defaulted = this.javaDefaultedLocalName(node);\n if (defaulted !== undefined) {\n return defaulted;\n }\n\n // keep the same class-reference typeof-guarding logic as your original file,\n // but run the syntactic (parent-position) checks first: they exclude the vast\n // majority of identifiers without paying for a type-checker lookup\n const isInsideNewExpression =\n node?.parent?.kind === SyntaxKind.NewExpression;\n const isInsideCatch =\n node?.parent?.kind === SyntaxKind.ThrowStatement;\n const isLeftSide =\n node?.parent?.name === node || node?.parent?.left === node;\n const isCallOrPropertyAccess =\n node?.parent?.kind === SyntaxKind.PropertyAccessExpression ||\n node?.parent?.kind === SyntaxKind.ElementAccessExpression;\n if (!isLeftSide && !isCallOrPropertyAccess && !isInsideCatch && !isInsideNewExpression) {\n const type = this.getChecker().getTypeAtLocation(node);\n const typeSymbol = type?.getSymbol?.();\n if (typeSymbol !== undefined) {\n const decl = (typeSymbol?.declarations ?? []).map((d) => d.resolve());\n if (decl.length > 0 && decl[0].getSourceFile().fileName.indexOf(\"typescript\") === -1) {\n const symbol = this.getChecker().getSymbolAtLocation(node);\n const first = symbol?.declarations[0]?.resolve();\n const isClassDeclaration = !!symbol && (first.kind === SyntaxKind.ClassDeclaration\n || (first.kind === SyntaxKind.ImportSpecifier\n && this.getChecker().getAliasedSymbol(symbol)?.declarations[0]?.resolve()?.kind === SyntaxKind.ClassDeclaration));\n if (isClassDeclaration) {\n return `${idValue}.class`;\n }\n }\n }\n }\n\n return this.transformIdentifier(node, idValue);\n }\n\n printConstructorDeclaration(node, identation) {\n const classNode = node.parent;\n const className = this.printNode(classNode.name, 0);\n const args = this.printMethodParameters(node);\n const constructorBody = this.printFunctionBody(node, identation);\n\n // find super call inside constructor and extract params\n let superCallParams = \"\";\n let hasSuperCall = false;\n node.body?.statements.forEach((statement) => {\n const expression = isExpressionStatement(statement) ? statement.expression : undefined;\n if (expression && isCallExpression(expression) && expression.expression.getText().trim() === \"super\") {\n hasSuperCall = true;\n superCallParams = expression.arguments.map((a) => this.printNode(a, identation).trim()).join(\", \");\n }\n });\n\n const header = this.getIden(identation) + className + \"(\" + args + \")\";\n // In Java, super(...) must be the first statement inside the body.\n return header + (hasSuperCall ? this.injectLeadingInBody(constructorBody, `super(${superCallParams});`) : constructorBody);\n }\n\n injectLeadingInBody(body, firstLine) {\n // body is \"{\\n ...\\n}\"\n const lines = body.split(\"\\n\");\n if (lines.length >= 2) {\n lines.splice(1, 0, this.getIden(1) + firstLine);\n }\n return lines.join(\"\\n\");\n }\n\n printDynamicCall(node, identation) {\n // Use reflection helper exactly like before; Java runtime should provide callDynamically(Object, String, Object[])\n const elementAccess = node.expression;\n if (elementAccess?.kind === SyntaxKind.ElementAccessExpression) {\n const parsedArg = node.arguments?.map((n) => this.printNode(n, identation).trimStart()).join(\", \") ?? \"\";\n const target = this.printNode(elementAccess.expression, 0);\n const propName = this.printNode(elementAccess.argumentExpression, 0);\n return `${this.DYNAMIC_CALL_OPEN}${target}, ${propName}, new Object[] { ${parsedArg} })`;\n }\n return undefined;\n }\n\n // printElementAccessExpressionExceptionIfAny(node) {\n // const tsKind = ts.SyntaxKind;\n // if (node.expression.kind === tsKind.CallExpression) {\n // const callExp = node.expression;\n // const calleeText = callExp.expression.getText();\n // if (calleeText.endsWith('.split') || calleeText.toLowerCase().includes('split')) {\n // // print Split call normally (should already close with ))\n // let splitCall = this.printNode(callExp, 0).trim();\n // if (!splitCall.endsWith(')')) {\n // splitCall += ')';\n // }\n // const idxArg = this.printNode(node.argumentExpression, 0);\n // return `GetValue(${splitCall}, ${idxArg})`;\n // }\n // }\n // // default: no exception\n // return undefined;\n // }\n\n printWrappedUnknownThisProperty(node) {\n const type = this.getChecker().getResolvedSignature(node);\n if (type?.declaration === undefined) {\n const parsedArguments = node.arguments?.map((a) => this.printNode(a, 0)).join(\", \") || \"\";\n const propName = node.expression?.name.text;\n return `${this.DYNAMIC_CALL_OPEN}this, \"${propName}\", new Object[] { ${parsedArguments} })`;\n }\n return undefined;\n }\n\n printOutOfOrderCallExpressionIfAny(node, identation) {\n if (node.expression.kind === SyntaxKind.Identifier) {\n const callee = node.expression.text;\n if (callee === 'parseInt' || callee === 'parseFloat') {\n const nativeParse = this.printNativeScalarParse(node, callee);\n if (nativeParse !== undefined) {\n return nativeParse;\n }\n }\n }\n if (node.expression.kind === SyntaxKind.PropertyAccessExpression) {\n const expressionText = node.expression.getText().trim();\n const args = node.arguments;\n if (args.length === 1) {\n const parsedArg = this.printNode(args[0], 0);\n switch (expressionText) {\n case \"Math.abs\":\n return `Helpers.mathAbs(Double.parseDouble(${this.javaStringBoxText(args[0], parsedArg)}))`;\n }\n } else if (args.length === 2) {\n const parsedArg1 = this.printNode(args[0], 0);\n const parsedArg2 = this.printNode(args[1], 0);\n switch (expressionText) {\n case \"Math.min\":\n case \"Math.max\": {\n const native = this.printNativeMathMinMax(\n node, args[0], args[1], parsedArg1, parsedArg2, expressionText === \"Math.min\" ? \"min\" : \"max\");\n if (native !== undefined) {\n return native;\n }\n const wrapper = expressionText === \"Math.min\" ? \"Helpers.mathMin(\" : \"Helpers.mathMax(\";\n return `${wrapper}${parsedArg1}, ${parsedArg2})`;\n }\n case \"Math.pow\":\n // both arguments are Double.parseDouble results, so Helpers.mathPow always\n // takes its Number branch and returns the same double java.lang.Math.pow does\n return `Math.pow(Double.parseDouble(${this.javaStringBoxText(args[0], parsedArg1)}), Double.parseDouble(${this.javaStringBoxText(args[1], parsedArg2)}))`;\n }\n }\n const leftSide = node.expression?.expression;\n const leftSideText = leftSide ? this.printNode(leftSide, 0) : undefined;\n\n // wrap unknown property this.X calls\n if (\n leftSideText === this.THIS_TOKEN ||\n leftSide.getFullText().indexOf(\"(this as any)\") > -1\n ) {\n const res = this.printWrappedUnknownThisProperty(node);\n if (res) return res;\n }\n }\n\n // dynamic call: obj[prop](...)\n if (node.expression.kind === SyntaxKind.ElementAccessExpression) {\n return this.printDynamicCall(node, identation);\n }\n\n return undefined;\n }\n\n handleTypeOfInsideBinaryExpression(node, _identation) {\n const left = node.left;\n const right = node.right.text;\n const op = node.operatorToken.kind;\n const expression = left.expression;\n\n const isDifferentOperator =\n op === SyntaxKind.ExclamationEqualsEqualsToken ||\n op === SyntaxKind.ExclamationEqualsToken;\n const notOperator = isDifferentOperator ? this.NOT_TOKEN : \"\";\n\n const target = this.printNode(expression, 0);\n switch (right) {\n case \"string\":\n return `${notOperator}(${target} instanceof String)`;\n case \"number\":\n return `${notOperator}(${target} instanceof Long || ${target} instanceof Integer || ${target} instanceof Float || ${target} instanceof Double)`;\n case \"boolean\":\n return `${notOperator}(${target} instanceof Boolean)`;\n case \"object\":\n return `${notOperator}(${target} instanceof java.util.Map)`;\n case \"function\":\n // no universal Function type in Java; treat as any Method/Callable\n return `${notOperator}(${target} instanceof java.util.concurrent.Callable)`;\n }\n return undefined;\n }\n\n getVarMethodIfAny(node) {\n // should return the name of the method this node belongs to, if any;\n // the raw AST name is enough here — the result is only used as a scoping\n // key, and printNode on an identifier consults the type checker\n let current = node?.parent;\n while (current) {\n if (isMethodDeclaration(current) || isFunctionDeclaration(current)) {\n return String((current.name as any)?.text ?? '');\n }\n current = current.parent;\n }\n return 'outsideAnyMethod';\n }\n\n getVarClassIfAny(node) {\n // should return the name of the class this node belongs to, if any;\n // raw AST name for the same reason as getVarMethodIfAny\n let current = node?.parent;\n while (current) {\n if (isClassDeclaration(current)) {\n return String((current.name as any)?.text ?? '');\n }\n current = current.parent;\n }\n return '';\n }\n\n getVarKey(node) {\n const varName = node?.text ?? node?.name?.text;\n if (!varName) {\n return '';\n }\n return `${this.getVarClassIfAny(node)}-${this.getVarMethodIfAny(node)}-${varName}`;\n }\n\n // Static operand family of one side of an equality, undefined when the checker proves\n // nothing usable. Null/undefined union members are folded away: Objects.equals handles\n // those exactly like the helper, so `string | undefined` still counts as string.\n equalityOperandFamily(type: any): string | undefined {\n if (type === undefined || type === null) {\n return undefined;\n }\n const flags = type.flags;\n if (flags & TypeFlags.Intersection) {\n return undefined;\n }\n if (flags & TypeFlags.Union) {\n // `boolean` is itself the union true|false and carries the Boolean bit\n if (flags & TypeFlags.Boolean) {\n return 'boolean';\n }\n const families = new Set((type.getTypes?.() ?? []).map((t) => this.equalityOperandFamily(t)));\n families.delete(undefined as any);\n families.delete('null');\n return families.size === 1 ? families.values().next().value : undefined;\n }\n if (flags & (TypeFlags.String | TypeFlags.StringLiteral)) {\n return 'string';\n }\n if (flags & (TypeFlags.Boolean | TypeFlags.BooleanLiteral)) {\n return 'boolean';\n }\n if (flags & (TypeFlags.Null | TypeFlags.Undefined | TypeFlags.Void)) {\n return 'null';\n }\n return undefined;\n }\n\n // The null/undefined literal: its Java text is `null`, so Objects.equals(x, null)\n // is literally the identity test Helpers.isEqual performs on that operand.\n isNullishLiteral(node): boolean {\n return node?.kind === SyntaxKind.NullKeyword\n || (node?.kind === SyntaxKind.Identifier && node.text === 'undefined');\n }\n\n // ---- numeric operand kinds (java-15) ----\n // Helpers.isEqual compares numeric operands by value (integers via toLong, Double/Float via\n // toDouble, class mismatch false), so two operands of the SAME kind compare natively.\n\n // the Java kind a decimal numeric literal prints with: integer literal as `N` (int) or `NL` (long),\n // a '.'/exponent literal as a Java double. TypeScript normalizes the literal text (`1e3` -> `1000`,\n // `0x10` -> `16`, `100.0` -> `100`), so node.text is exactly what prints.\n javaEqualityLiteralKind(node) {\n if (!node) {\n return undefined;\n }\n // `-1`: the printer prints the sign in front of the literal, so the value is a Java\n // primitive of the operand's own kind — only an int-range operand keeps it (a long\n // literal would print with its own `L` suffix and the sign would not widen)\n if (node.kind === SyntaxKind.PrefixUnaryExpression && node.operator === SyntaxKind.MinusToken) {\n return this.javaIntegerLiteralKind(node.operand) === 'int' ? 'int' : undefined;\n }\n if (!isNumericLiteral(node)) {\n return undefined;\n }\n return /[.eE]/.test(node.text) ? 'double' : this.javaIntegerLiteralKind(node);\n }\n\n // `x.length` on a checker-proven String/List receiver prints a native int\n // (((String)x).length() / ((List)x).size(), see javaLengthKind). Every other\n // receiver prints Helpers.getArrayLength, whose value is not an int.\n javaNativeLengthKind(node) {\n if (node?.kind !== SyntaxKind.PropertyAccessExpression || node.name.text !== 'length') {\n return undefined;\n }\n return this.javaLengthKind(node.expression) !== undefined ? 'int' : undefined;\n }\n\n // `for (var i = ; ...; i++)`: javac infers a primitive int counter, so\n // every read of it — not only the loop condition the comparison rule sees — is a\n // native int. ++/-- keep it int and the counter cannot hold another box.\n isJavaPrimitiveCounterReference(node) {\n if (!node || node.kind !== SyntaxKind.Identifier) {\n return false;\n }\n const checker = this.getChecker();\n const symbol = checker.getSymbolAtLocation(node);\n const declaration: any = symbol?.valueDeclaration?.resolve() ?? symbol?.declarations?.[0]?.resolve();\n if (!declaration || declaration.kind !== SyntaxKind.VariableDeclaration || !isIdentifier(declaration.name)) {\n return false;\n }\n const list = declaration.parent;\n const forStatement: any = list?.parent;\n if (!list || !forStatement || forStatement.kind !== SyntaxKind.ForStatement || forStatement.initializer !== list) {\n return false;\n }\n if (list.declarations?.length !== 1 || this.javaIntegerLiteralKind(declaration.initializer) === undefined) {\n return false;\n }\n const incrementor = forStatement.incrementor;\n if (!incrementor\n || (incrementor.kind !== SyntaxKind.PostfixUnaryExpression && incrementor.kind !== SyntaxKind.PrefixUnaryExpression)\n || (incrementor.operator !== SyntaxKind.PlusPlusToken && incrementor.operator !== SyntaxKind.MinusMinusToken)\n || incrementor.operand?.kind !== SyntaxKind.Identifier) {\n return false;\n }\n const incrementorSymbol = checker.getSymbolAtLocation(incrementor.operand);\n return incrementorSymbol === undefined || symbol === undefined || incrementorSymbol === symbol;\n }\n\n // the box a printed local carries: the kind of its declaration's initializer, kept\n // only while every write in the declaring function writes the same kind (D2 scan).\n // A `const` declaration has no write to scan.\n javaLocalNumberKind(node, depth) {\n if (!node || node.kind !== SyntaxKind.Identifier) {\n return undefined;\n }\n const symbol = this.getChecker().getSymbolAtLocation(node);\n const declaration: any = symbol?.valueDeclaration?.resolve() ?? symbol?.declarations?.[0]?.resolve();\n if (!declaration || declaration.kind !== SyntaxKind.VariableDeclaration || !isIdentifier(declaration.name)) {\n return undefined;\n }\n const kind = this.javaPrintedNumberKind(declaration.initializer, depth + 1);\n if (kind === undefined) {\n return undefined;\n }\n const isConst = (declaration.parent?.flags & NodeFlags.Const) !== 0;\n if (!isConst && !this.javaWritesKeepNumberKind(declaration, symbol, kind)) {\n return undefined;\n }\n return kind;\n }\n\n // true when every assignment to the symbol inside its function writes the same\n // numeric kind; a compound assignment (`x += 1` prints Helpers.add) changes the box.\n javaWritesKeepNumberKind(declaration, symbol, kind) {\n const owner = this.enclosingFunctionLike(declaration);\n if (owner === undefined) {\n return false;\n }\n let safe = true;\n const visit = (node) => {\n if (!safe) {\n return;\n }\n if (isBinaryExpression(node)) {\n const op = node.operatorToken.kind;\n if (this.isAssignmentOperator(op) && this.expressionReferencesSymbol(node.left, symbol)) {\n if (op !== SyntaxKind.EqualsToken || this.javaPrintedNumberKind(node.right, 0) !== kind) {\n safe = false;\n return;\n }\n }\n } else if ((node.kind === SyntaxKind.ForOfStatement || node.kind === SyntaxKind.ForInStatement)\n && this.expressionReferencesSymbol(node.initializer, symbol)) {\n safe = false;\n return;\n } else if ((isPrefixUnaryExpression(node) || isPostfixUnaryExpression(node))\n && (node.operator === SyntaxKind.PlusPlusToken || node.operator === SyntaxKind.MinusMinusToken)\n && kind !== 'int' && this.expressionReferencesSymbol(node.operand, symbol)) {\n safe = false;\n return;\n }\n node.forEachChild(visit);\n };\n owner.forEachChild(visit);\n return safe;\n }\n\n expressionReferencesSymbol(node, symbol): boolean {\n if (node === undefined || symbol === undefined) {\n return false;\n }\n let found = false;\n const visit = (child) => {\n if (found) {\n return;\n }\n if (child.kind === SyntaxKind.Identifier && this.getChecker().getSymbolAtLocation(child) === symbol) {\n found = true;\n return;\n }\n child.forEachChild(visit);\n };\n visit(node);\n return found;\n }\n\n enclosingFunctionLike(node) {\n let current = node?.parent;\n while (current) {\n if (isFunctionLike(current)) {\n return current;\n }\n current = current.parent;\n }\n return undefined;\n }\n\n // box/primitive kind of an operand the printer prints as a native number, or undefined\n // when the printed value could be any box (a call, a parameter, an `any` local)\n javaPrintedNumberKind(node, depth = 0) {\n const literalKind = this.javaEqualityLiteralKind(node);\n if (literalKind !== undefined) {\n return literalKind;\n }\n const lengthKind = this.javaNativeLengthKind(node);\n if (lengthKind !== undefined) {\n return lengthKind;\n }\n if (this.isJavaPrimitiveCounterReference(node)) {\n return 'int';\n }\n const arithmeticKind = this.javaNativeArithmeticKind(node);\n if (arithmeticKind !== undefined) {\n return arithmeticKind;\n }\n return depth < 2 ? this.javaLocalNumberKind(node, depth) : undefined;\n }\n\n // numeric equality operand: the checker proves a plain number and the printed Java\n // value carries a known kind. Aliases (Int/Num), unions and `any` stay with the\n // helper, like in the arithmetic rule.\n javaEqualityNumberKind(node) {\n if (this.javaScalarFamily(node) !== 'number') {\n return undefined;\n }\n return this.javaPrintedNumberKind(node);\n }\n\n // ==/===/!=/!== become java.util.Objects.equals once the checker proves one operand is\n // a string, a boolean or the null/undefined literal: for those Helpers.isEqual reduces\n // to Objects.equals (value compare, class-strict, no numeric promotion). Two operands\n // the checker types as plain numbers compare natively when their printed Java kinds\n // match (java-15): the helper's numeric paths are the same value compare.\n printNativeEqualityIfProvable(node, leftText: string, rightText: string): string | undefined {\n const op = node.operatorToken.kind;\n const negated = op === SyntaxKind.ExclamationEqualsToken || op === SyntaxKind.ExclamationEqualsEqualsToken;\n if (!negated && op !== SyntaxKind.EqualsEqualsToken && op !== SyntaxKind.EqualsEqualsEqualsToken) {\n return undefined;\n }\n const checker = this.getChecker();\n const leftFamily = this.equalityOperandFamily(checker?.getTypeAtLocation(node.left));\n const rightFamily = this.equalityOperandFamily(checker?.getTypeAtLocation(node.right));\n const leftProved = leftFamily !== undefined && (leftFamily !== 'null' || this.isNullishLiteral(node.left));\n const rightProved = rightFamily !== undefined && (rightFamily !== 'null' || this.isNullishLiteral(node.right));\n const equalCall = `${negated ? '!' : ''}java.util.Objects.equals(${leftText}, ${rightText})`;\n // a declared Java String on either side: a String never equals a non-String, and\n // Objects.equals carries the same null answer, so the class-strict compare is the\n // helper's own String branch for every other operand.\n if (leftProved || rightProved || this.javaDeclaredStringType(node.left) || this.javaDeclaredStringType(node.right)) {\n return equalCall;\n }\n // both operands print a Java numeric primitive (literals, `.length`, index/search results, for\n // counters, native arithmetic): neither can be null, so the operator is the helper's value compare\n // on the two boxes (never a boxed Double, whose equals would separate -0.0).\n if (this.javaOperandPrintsPrimitiveNumber(node.left) && this.javaOperandPrintsPrimitiveNumber(node.right)) {\n return `(${leftText} ${negated ? '!=' : '=='} ${rightText})`;\n }\n // java-15: two checker-typed plain numbers whose printed Java values carry the same\n // kind (two primitives returned above); a box compares with\n // Objects.equals, whose class the kind pins to the box the helper would compare.\n const leftKind = this.javaEqualityNumberKind(node.left);\n const rightKind = this.javaEqualityNumberKind(node.right);\n if (leftKind !== undefined && leftKind === rightKind) {\n // a boxed double compares through Double.equals, which separates -0.0 from 0.0\n // where the helper's toDouble compare does not: doubles stay native only as\n // primitives (there the native operator is the same value compare)\n if (leftKind !== 'double') {\n return equalCall;\n }\n }\n // a numeric operand the pass declared Long/Double/Integer/int/long/double: the box\n // is unboxed by the operator (numeric compare, exactly the helper's toLong/toDouble\n // path) and a boxed declaration is null-tested first, which the helper answers false.\n const leftDeclared = this.javaDeclaredNumericFamily(node.left);\n const rightDeclared = this.javaDeclaredNumericFamily(node.right);\n if (leftDeclared !== undefined || rightDeclared !== undefined) {\n const leftOk = leftDeclared !== undefined || this.javaOperandPrintsPrimitiveNumber(node.left);\n const rightOk = rightDeclared !== undefined || this.javaOperandPrintsPrimitiveNumber(node.right);\n if (leftOk && rightOk) {\n const boxes: string[] = [];\n if (leftDeclared !== undefined && JAVA_BOXED_NUMERIC_TYPES.has(leftDeclared)) {\n boxes.push(leftText);\n }\n if (rightDeclared !== undefined && JAVA_BOXED_NUMERIC_TYPES.has(rightDeclared)) {\n boxes.push(rightText);\n }\n const compare = `${leftText} ${negated ? '!=' : '=='} ${rightText}`;\n if (boxes.length === 0) {\n return `(${compare})`;\n }\n // a boxed declaration can hold null, which the helper answers false for; the\n // negated comparison therefore has to accept the null arm instead of testing it\n return negated\n ? `(${boxes.map((box) => `${box} == null`).join(' || ')} || ${compare})`\n : `(${boxes.map((box) => `${box} != null`).join(' && ')} && ${compare})`;\n }\n }\n return undefined;\n }\n\n // true when the printer prints the operand as a Java primitive (a decimal literal, a\n // native .length/.size(), a for counter or a nested native arithmetic node) rather\n // than as the Object-declared box every other local gets\n javaOperandPrintsPrimitiveNumber(node): boolean {\n return this.javaEqualityLiteralKind(node) !== undefined\n || this.javaNativeLengthKind(node) !== undefined\n || this.isJavaPrimitiveCounterReference(node)\n || this.javaNativeArithmeticKind(node) !== undefined\n // `.length` on a receiver whose Java text the printer does not prove is still\n // the int-returning Helpers.getArrayLength; indexOf/search print int helpers\n || this.javaPrimitiveOperandKind(node) !== undefined;\n }\n\n // the numeric family the pass declared for a local (`Long`/`Double`/`Integer` boxed,\n // `int`/`long`/`double` primitive), undefined when nothing was declared or the declared\n // type is not numeric\n javaDeclaredNumericFamily(expression): string | undefined {\n const type = this.javaDeclaredTypeOf(expression)?.trim();\n return type !== undefined && JAVA_DECLARED_NUMERIC_TYPES.has(type) ? type : undefined;\n }\n\n // `x[k] = v` prints the runtime helper by default. Helpers.addElementToObject\n // exists for receivers the printer cannot type (Lists, arbitrary objects via\n // reflection) and for ConcurrentHashMap null-removal, so the native Map.put is\n // printed only when the checker excludes all of those.\n elementWriteTargetsMap(container, base, keys, value): boolean {\n const lastKey = keys[keys.length - 1];\n if (!isStringLiteral(lastKey) && !this.isJavaStringType(this.getChecker().getTypeAtLocation(lastKey))) {\n return false; // Map.put takes the String key; every other key prints as Object\n }\n if (isPropertyAccessExpression(base) && base.expression.kind === SyntaxKind.ThisKeyword) {\n return false; // field maps are ConcurrentHashMaps (a null value must remove, not put) and other threads read them\n }\n if (this.isPlainHashMapReceiver(container, keys)) {\n return true; // a HashMap the code created holds a null value like the helper does\n }\n // any other Map may be a ConcurrentHashMap, which rejects a null value the helper removes\n return this.isDictionaryType(container) && !this.elementWriteValueMayBeNull(value);\n }\n\n // true unless the checker proves the written value is never null/undefined\n elementWriteValueMayBeNull(value): boolean {\n const checker: any = this.checkerOrUndefined();\n if (checker === undefined || value === undefined) {\n return true;\n }\n const type = checker.getTypeAtLocation(value);\n const parts: any[] = (type.flags & TypeFlags.Union) ? (type.getTypes?.() ?? []) : [type];\n const nullable = TypeFlags.Any | TypeFlags.Unknown | JAVA_NULLISH_TYPE_FLAGS | TypeFlags.TypeParameter;\n return parts.length === 0 || parts.some((t) => (t.flags & nullable) !== 0);\n }\n\n // a key proven by the checker to be a string prints as a java String: the read is\n // the same expression, only the key needs the (String) cast the typed put demands\n elementWriteKeyText(key, keyText: string): string {\n return isStringLiteral(key) ? keyText : `(String)${keyText}`;\n }\n\n // Receivers that are a plain java.util.HashMap at runtime, where \".put\" and the helper's map branch\n // are the same write: a local initialized with an object literal or a call whose every return is\n // such a literal (this.account()). Lists, class instances and ConcurrentHashMaps stay helpers.\n isPlainHashMapReceiver(container, keys: any[]): boolean {\n if (keys.length !== 1 || container === undefined || container.kind !== SyntaxKind.Identifier) {\n return false; // only a direct write on the proven local, no read in between\n }\n const checker: any = this.checkerOrUndefined();\n if (checker === undefined) {\n return false;\n }\n const symbol = checker.getSymbolAtLocation(container);\n const declaration: any = symbol?.valueDeclaration?.resolve() ?? symbol?.declarations?.[0]?.resolve();\n if (!declaration || declaration.kind !== SyntaxKind.VariableDeclaration || !declaration.initializer) {\n return false; // parameters and receivers without an initializer stay the helper\n }\n if (!this.javaFreshHashMapValue(container, declaration.initializer)) {\n return false;\n }\n // every later `x = rhs` must hand the local another fresh map too (D2)\n return !this.javaLocalIsReassigned(container, (rhs) => this.javaFreshHashMapValue(container, rhs));\n }\n\n // a value that is a freshly built HashMap/LinkedHashMap on the Java side\n javaFreshHashMapValue(container, value): boolean {\n const initializer = this.unwrapPrintTransparentExpression(value);\n return initializer !== undefined && (isObjectLiteralExpression(initializer)\n || (isCallExpression(initializer) && this.callAlwaysReturnsPlainHashMap(initializer, 0))\n || (this.javaDeclaredMapReceiver(container) && this.javaFreshExtendMap(initializer)));\n }\n\n // a value whose Java print can never be null: non-null literals and fresh containers\n javaPrintsNonNullValue(node): boolean {\n const value = this.unwrapPrintTransparentExpression(node);\n if (value === undefined) {\n return false;\n }\n return isStringLiteralLikeNode(value) || isNumericLiteral(value)\n || value.kind === SyntaxKind.TrueKeyword || value.kind === SyntaxKind.FalseKeyword\n || isObjectLiteralExpression(value) || isArrayLiteralExpression(value)\n || (isPrefixUnaryExpression(value) && value.operator === SyntaxKind.MinusToken && isNumericLiteral(value.operand));\n }\n\n // `this.extend(..)` / `this.deepExtend(..)` from the base tier hand back a fresh LinkedHashMap\n // when the call has two arguments (Generic.Extend copies both) or ends in an object literal\n // (deepExtend's last Map argument replaces any earlier non-Map box with a new map)\n javaFreshExtendMap(initializer): boolean {\n if (initializer === undefined || !isCallExpression(initializer)\n || !isPropertyAccessExpression(initializer.expression)\n || initializer.expression.expression.kind !== SyntaxKind.ThisKeyword) {\n return false;\n }\n const name = initializer.expression.name.text;\n const args = initializer.arguments;\n const last = args.length > 0 ? this.unwrapPrintTransparentExpression(args[args.length - 1]) : undefined;\n const endsInLiteral = last !== undefined && isObjectLiteralExpression(last);\n if (!((name === 'extend' && (args.length === 2 || endsInLiteral)) || (name === 'deepExtend' && endsInLiteral))) {\n return false;\n }\n const checker: any = this.checkerOrUndefined();\n const fileName = checker?.getResolvedSignature(initializer)?.declaration?.resolve()?.getSourceFile?.()?.fileName;\n return typeof fileName === 'string' && JAVA_FRESH_EXTEND_FILE.test(fileName);\n }\n\n // the bottom container of `x[k1][k2].. = v` when x is a declared Map / List and k1 is not a\n // string literal: the guarded native read of the element-read families (the literal key is\n // printed by the caller's own arm)\n javaDeclaredChainContainerRead(left, keyCount: number): string | undefined {\n let inner = left;\n for (let i = 1; i < keyCount; i++) {\n inner = inner.expression;\n }\n if (inner === undefined || !isElementAccessExpression(inner) || isStringLiteralLikeNode(inner.argumentExpression)) {\n return undefined;\n }\n const declared = this.javaDeclaredTypeOf(inner.expression);\n if (declared === undefined) {\n return undefined;\n }\n if (JAVA_DECLARED_MAP_TYPES.test(declared)) {\n return this.javaDeclaredMapElementRead(inner);\n }\n if (JAVA_DECLARED_LIST_TYPES.test(declared) && this.javaPrimitiveCounterIndex(inner.argumentExpression)) {\n return this.javaDeclaredListElementRead(inner, true);\n }\n return undefined;\n }\n\n unwrapPrintTransparentExpression(node): any {\n let current = node;\n while (current && (isParenthesizedExpression(current)\n || isAsExpression(current)\n || isTypeAssertion(current)\n || current.kind === SyntaxKind.NonNullExpression)) {\n current = current.expression;\n }\n return current;\n }\n\n // Every write of the local in its enclosing function must be the element write\n // itself; an assignment could replace the HashMap with a List or a class instance.\n javaLocalIsReassigned(node, admitsWrite?: (rhs) => boolean): boolean {\n let scope: any = node;\n while (scope && !isFunctionLike(scope) && !isSourceFile(scope)) {\n scope = scope.parent;\n }\n if (!scope) {\n return true;\n }\n const symbol = this.getChecker().getSymbolAtLocation(node);\n let reassigned = false;\n const walk = (current) => {\n if (reassigned || current === undefined) {\n return;\n }\n if (current.kind === SyntaxKind.BinaryExpression\n && current.operatorToken.kind === SyntaxKind.EqualsToken\n && current.left.kind === SyntaxKind.Identifier\n && this.getChecker().getSymbolAtLocation(current.left) === symbol) {\n if (admitsWrite === undefined || !admitsWrite(current.right)) {\n reassigned = true;\n return;\n }\n }\n if (current.kind === SyntaxKind.BinaryExpression\n && current.operatorToken.kind >= SyntaxKind.FirstAssignment && current.operatorToken.kind <= SyntaxKind.LastAssignment\n && !isIdentifier(current.left)\n && !isElementAccessExpression(current.left) && !isPropertyAccessExpression(current.left)\n && this.javaPatternBindsSymbol(current.left, symbol)\n && !this.javaDestructuringHandsBackLocal(current, symbol)) {\n reassigned = true; // destructuring assignment `[x, p] = ..`\n return;\n }\n if (current.kind === SyntaxKind.BinaryExpression\n && current.operatorToken.kind !== SyntaxKind.EqualsToken\n && current.operatorToken.kind >= SyntaxKind.FirstAssignment && current.operatorToken.kind <= SyntaxKind.LastAssignment\n && isIdentifier(current.left)\n && this.getChecker().getSymbolAtLocation(current.left) === symbol) {\n reassigned = true; // compound write (`x ??= ..`)\n return;\n }\n if ((isForOfStatement(current) || isForInStatement(current))\n && isIdentifier(current.initializer)\n && this.getChecker().getSymbolAtLocation(current.initializer) === symbol) {\n reassigned = true;\n return;\n }\n current.forEachChild(walk);\n };\n walk(scope);\n return reassigned;\n }\n\n // `[.., x, ..] = this.m(.., x, ..)` where every return of m is an array literal whose\n // element at x's position is the never-reassigned parameter x was passed to: x keeps its object\n javaDestructuringHandsBackLocal(assignment, symbol): boolean {\n const checker: any = this.getChecker();\n const left = assignment.left;\n const call = this.unwrapPrintTransparentExpression(assignment.right);\n if (!isArrayLiteralExpression(left) || call === undefined || !isCallExpression(call)) {\n return false;\n }\n const index = left.elements.findIndex((e) => isIdentifier(e) && checker.getSymbolAtLocation(e) === symbol);\n if (index < 0 || left.elements.some((e, i) => i !== index && this.javaPatternBindsSymbol(e, symbol))) {\n return false;\n }\n const declaration: any = checker.getResolvedSignature(call)?.declaration?.resolve();\n if (!declaration || !isMethodDeclaration(declaration) || !declaration.body) {\n return false;\n }\n const argIndex = call.arguments.findIndex((a) => isIdentifier(a) && checker.getSymbolAtLocation(a) === symbol);\n const parameter = argIndex >= 0 ? declaration.parameters[argIndex] : undefined;\n if (parameter === undefined || !isIdentifier(parameter.name) || parameter.dotDotDotToken) {\n return false;\n }\n const parameterSymbol = checker.getSymbolAtLocation(parameter.name);\n let returns = 0;\n let proven = true;\n const walk = (n) => {\n if (!proven || n === undefined || (n !== declaration.body && isFunctionLike(n))) {\n return;\n }\n if (isReturnStatement(n)) {\n returns++;\n const value = this.unwrapPrintTransparentExpression(n.expression);\n const element = value !== undefined && isArrayLiteralExpression(value) ? value.elements[index] : undefined;\n proven = element !== undefined && isIdentifier(element) && checker.getSymbolAtLocation(element) === parameterSymbol;\n return;\n }\n n.forEachChild(walk);\n };\n walk(declaration.body);\n if (!proven || returns === 0 || this.javaHandBackVisiting.has(declaration)) {\n return false; // a recursive hand-back chain stays unproven\n }\n this.javaHandBackVisiting.add(declaration);\n try {\n return !this.javaLocalIsReassigned(parameter.name);\n } finally {\n this.javaHandBackVisiting.delete(declaration);\n }\n }\n\n javaHandBackVisiting = new Set();\n\n // true when a destructuring target mentions the symbol anywhere\n javaPatternBindsSymbol(pattern, symbol): boolean {\n let found = false;\n const walk = (n) => {\n if (found || n === undefined) {\n return;\n }\n if (isIdentifier(n) && this.getChecker().getSymbolAtLocation(n) === symbol) {\n found = true;\n return;\n }\n n.forEachChild(walk);\n };\n walk(pattern);\n return found;\n }\n\n // A call whose callee body returns object literals only, so the value it hands\n // back is always a freshly built HashMap on the Java side as well.\n callAlwaysReturnsPlainHashMap(node, depth: number): boolean {\n if (depth > 3) {\n return false;\n }\n const checker: any = this.getChecker();\n let callee: any = this.unwrapPrintTransparentExpression(node.expression);\n if (callee !== undefined && isPropertyAccessExpression(callee)) {\n if (callee.expression.kind !== SyntaxKind.ThisKeyword) {\n return false; // this.() only: another receiver's body is not in this class\n }\n callee = callee.name;\n }\n if (callee === undefined || callee.kind !== SyntaxKind.Identifier) {\n return false;\n }\n let symbol: any;\n try {\n symbol = checker.getSymbolAtLocation(callee);\n } catch (e) {\n return false;\n }\n const declaration: any = symbol?.valueDeclaration?.resolve() ?? symbol?.declarations?.[0]?.resolve();\n if (!declaration || (declaration.kind !== SyntaxKind.MethodDeclaration && declaration.kind !== SyntaxKind.FunctionDeclaration)) {\n return false;\n }\n if (!this.returnTypePrintsAsHashMap(declaration)) {\n return false;\n }\n const body = declaration.body;\n if (!body || !isBlock(body)) {\n return false;\n }\n let plain = true;\n let returns = 0;\n const walk = (current) => {\n if (!plain || current === undefined) {\n return;\n }\n if (isFunctionLike(current) && current !== declaration) {\n return; // a nested closure returns into its own call\n }\n if (isReturnStatement(current)) {\n returns += 1;\n const expression = current.expression;\n if (expression === undefined) {\n plain = false;\n return;\n }\n const value = this.unwrapPrintTransparentExpression(expression);\n if (isObjectLiteralExpression(value)) {\n return;\n }\n if (isCallExpression(value) && this.callAlwaysReturnsPlainHashMap(value, depth + 1)) {\n return;\n }\n plain = false;\n return;\n }\n current.forEachChild(walk);\n };\n walk(body);\n return plain && returns > 0;\n }\n\n // the declared return type must not be a class instance (those print as objects)\n // or an array (those print as Lists), so the object-literal returns above are what\n // the caller can rely on\n returnTypePrintsAsHashMap(declaration): boolean {\n try {\n const checker: any = this.getChecker();\n const signature = checker.getSignatureFromDeclaration(declaration);\n const type: any = signature?.getReturnType();\n if (!type || (type.flags & TypeFlags.Object) === 0) {\n return false;\n }\n if (checker.isArrayType(type) || checker.isTupleType(type)) {\n return false;\n }\n const declarations = (type.getSymbol()?.declarations ?? []).map((d) => d.resolve());\n if (declarations.some((d) => d.kind === SyntaxKind.ClassDeclaration)) {\n return false;\n }\n return type.getCallSignatures().length === 0;\n } catch (e) {\n return false;\n }\n }\n\n isDictionaryType(node): boolean {\n try {\n const checker: any = this.getChecker();\n const type = checker.getTypeAtLocation(node);\n return this.isDictionaryTsType(type, checker, 0);\n } catch (e) {\n return false;\n }\n }\n\n // A TS dictionary (`{ [key: string]: any }`, i.e. ccxt's Dict) is a Map on every\n // print and run path. Arrays, class instances and unknown types are not, so they\n // keep the helper.\n isDictionaryTsType(type: any, checker: any, depth: number): boolean {\n if (!type || depth > 3) {\n return false;\n }\n const flags: any = type.flags;\n if (flags & TypeFlags.Union) {\n const parts: any[] = type.getTypes?.() ?? [];\n return parts.length > 0 && parts.every((t) => this.isDictionaryTsType(t, checker, depth + 1));\n }\n if (!(flags & TypeFlags.Object)) {\n return false;\n }\n try {\n if (checker.isArrayType(type) || checker.isTupleType(type)) {\n return false;\n }\n return checker.getIndexTypeOfType(type, IndexKind.String) !== undefined;\n } catch (e) {\n return false;\n }\n }\n\n // -------------------------------------------------------------------\n // helper removal: native emission when the checker proves the printed\n // operand is a Java numeric primitive / List / Map\n // -------------------------------------------------------------------\n\n // int/long kind of a literal as printNumericLiteral emits it. Fraction and\n // exponent forms are Java doubles and a double can hold NaN, which the\n // comparison helpers order differently (`NaN < x` is true there), so those\n // never become a native comparison.\n javaIntegerLiteralKind(node) {\n if (!node || !isNumericLiteral(node)) {\n return undefined;\n }\n if (/[.eE]/.test(node.text)) {\n return undefined;\n }\n return Number(node.text) > 2147483647 ? 'long' : 'int';\n }\n\n // A rest parameter is a Java varargs array, not a List, so a List cast on it\n // would throw ClassCastException; simple identifier aliases are followed too.\n isVarargsArrayReference(node, depth = 0) {\n if (!node || depth > 4 || node.kind !== SyntaxKind.Identifier) {\n return false;\n }\n const symbol = this.getChecker().getSymbolAtLocation(node);\n const declaration: any = symbol?.valueDeclaration?.resolve() ?? symbol?.declarations?.[0]?.resolve();\n if (!declaration) {\n return false;\n }\n if (declaration.dotDotDotToken !== undefined) {\n return true;\n }\n const initializer = declaration.initializer;\n if (initializer && isIdentifier(initializer)) {\n return this.isVarargsArrayReference(initializer, depth + 1);\n }\n return false;\n }\n\n // checker proof that the value is printed as a java.util.List: TS arrays and\n // tuples become ArrayList, ReadonlyArray only adds a readonly modifier\n isJavaListType(type) {\n if (!type) {\n return false;\n }\n const checker = this.getChecker();\n if (checker.isArrayType(type) || checker.isTupleType(type)) {\n return true;\n }\n return (type as any).isTypeReference?.() === true && (type as any).getTarget().getSymbol()?.escapedName === 'ReadonlyArray';\n }\n\n // `.length` is a Java int for exactly these receivers; every other receiver keeps\n // Helpers.getArrayLength, whose result type is not proven\n javaLengthKind(expression) {\n const type = this.getChecker().getTypeAtLocation(expression);\n if (this.isJavaStringType(type)) {\n return 'String';\n }\n if (this.isJavaListValueType(type) && !this.isVarargsArrayReference(expression)) {\n return 'List';\n }\n // a nullish union member cannot take a bare `.size()`/`.length()`, but the\n // guard below answers 0 for null exactly like the helper, and only a bare\n // identifier keeps the receiver evaluate-once\n if (isIdentifier(expression)) {\n if (this.isJavaNullishUnion(type, (member) => this.isStringType(member.flags))) {\n return 'StringOrNull';\n }\n if (this.isJavaNullishUnion(type, (member) => this.isJavaListValueType(member))\n && !this.isVarargsArrayReference(expression)) {\n return 'ListOrNull';\n }\n }\n return undefined;\n }\n\n // every union member is a List-printing type (TS array/tuple/ReadonlyArray, or an\n // Array-derived class whose hand-written java counterpart is an ArrayList)\n isJavaListValueType(type) {\n if (!type) {\n return false;\n }\n if ((type.flags & TypeFlags.Union) !== 0) {\n return type.getTypes().length > 0 && type.getTypes().every((member) => this.isJavaListValueType(member));\n }\n return this.isJavaListType(type) || this.isJavaListBackedClassType(type);\n }\n\n // TS class/interface whose java counterpart extends java.util.ArrayList:\n // the ws caches (ws/ArrayCache.java) and the order-book sides (ws/OrderBookSide.java)\n isJavaListBackedClassType(type) {\n if (!type || (type.flags & TypeFlags.Object) === 0) {\n return false;\n }\n let current: any = (type as any).isTypeReference?.() ? (type as any).getTarget() : type;\n for (let depth = 0; current && depth < 8; depth++) {\n const name = current.getSymbol?.()?.escapedName;\n if (name !== undefined && JAVA_LIST_BACKED_TS_CLASSES.has(name)) {\n return true;\n }\n const bases: any[] = current.getBaseTypes?.() ?? [];\n current = bases.length > 0 ? ((bases[0] as any).isTypeReference?.() ? (bases[0] as any).getTarget() : bases[0]) : undefined;\n }\n return false;\n }\n\n // union of one accepted member family plus null/undefined: the emitted guard is the\n // helper's answer for the nullish case and the native read otherwise\n isJavaNullishUnion(type, isMember) {\n if (!type || (type.flags & TypeFlags.Union) === 0 || type.getTypes().length === 0) {\n return false;\n }\n return type.getTypes().every((member) => isMember(member)\n || (member.flags & (TypeFlags.Undefined | TypeFlags.Null)) !== 0);\n }\n\n // shared by printLengthProperty and transformPropertyAcessExpressionIfNeeded\n printJavaLength(expression, leftSide) {\n const kind = this.javaLengthKind(expression);\n if (kind !== undefined) {\n const read = kind.startsWith('String') ? `((String)${leftSide}).length()` : `((java.util.List)${leftSide}).size()`;\n return kind.endsWith('OrNull') ? `(${leftSide} == null ? 0 : ${read})` : read;\n }\n // a receiver the embedding pass declared a java.util.List (`List response =\n // (this.someRequest(..)).join()` — a typed list return bound to a local, or a list\n // parameter the pass retyped): the declaration carries the type, so `x.size()` needs\n const declared = this.javaDeclaredTypeOf(expression);\n if (declared !== undefined && JAVA_DECLARED_LIST_TYPES.test(declared)) {\n return `(${leftSide} == null ? 0 : ${leftSide}.size())`;\n }\n return `${this.ARRAY_LENGTH_WRAPPER_OPEN}${leftSide}${this.ARRAY_LENGTH_WRAPPER_CLOSE}`;\n }\n\n // `for (var i = ; ...; i++)`: printForStatement rewrites the\n // Object initializer into `var`, so javac infers a primitive counter there,\n // and only ++/-- writes keep it primitive\n isJavaPrimitiveForCounter(node) {\n if (node.kind !== SyntaxKind.Identifier) {\n return false;\n }\n const comparison = node.parent;\n if (!comparison || comparison.kind !== SyntaxKind.BinaryExpression) {\n return false;\n }\n const forStatement = comparison.parent;\n if (!forStatement || forStatement.kind !== SyntaxKind.ForStatement || forStatement.condition !== comparison) {\n return false;\n }\n const initializer = forStatement.initializer;\n if (!initializer || initializer.kind !== SyntaxKind.VariableDeclarationList) {\n return false;\n }\n const declarations = initializer.declarations ?? [];\n if (declarations.length !== 1) {\n return false;\n }\n const declaration = declarations[0];\n if (!isIdentifier(declaration.name) || declaration.name.text !== node.text) {\n return false;\n }\n if (this.javaIntegerLiteralKind(declaration.initializer) === undefined) {\n return false;\n }\n const counterSymbol = this.getChecker().getSymbolAtLocation(node);\n const declarationSymbol = this.getChecker().getSymbolAtLocation(declaration.name);\n if (counterSymbol !== undefined && declarationSymbol !== undefined && counterSymbol !== declarationSymbol) {\n return false;\n }\n const incrementor = forStatement.incrementor;\n if (!incrementor || incrementor.operand?.kind !== SyntaxKind.Identifier || incrementor.operand.text !== node.text) {\n return false;\n }\n return incrementor.kind === SyntaxKind.PostfixUnaryExpression || incrementor.kind === SyntaxKind.PrefixUnaryExpression;\n }\n\n // Java primitive kind of a comparison operand; undefined keeps the helper. Proof sources: literals\n // (int/long/double) and expressions the printer's own emitter pins: `var` for-counter, `.length`,\n // `x.indexOf(arg)`/`x.search(arg)` (int), Math.round (long), Math.floor/ceil/pow (double).\n javaPrimitiveOperandKind(node) {\n if (node === undefined || node === null) {\n return undefined;\n }\n if (node.kind === SyntaxKind.ParenthesizedExpression) {\n return this.javaPrimitiveOperandKind(node.expression);\n }\n const literalKind = this.javaIntegerLiteralKind(node);\n if (literalKind !== undefined) {\n return literalKind;\n }\n if (this.isJavaFloatLiteral(node)) {\n return 'double';\n }\n if (this.isJavaPrimitiveForCounter(node) || this.javaPrintedIntCounter(node)) {\n return 'int';\n }\n // `-1`: the sign prints in front of an int literal, still a Java int\n if (node.kind === SyntaxKind.PrefixUnaryExpression && node.operator === SyntaxKind.MinusToken\n && this.javaIntegerLiteralKind(node.operand) === 'int') {\n return 'int';\n }\n if (node.kind === SyntaxKind.PropertyAccessExpression && node.name.text === 'length') {\n return 'int';\n }\n if (node.kind === SyntaxKind.CallExpression) {\n return this.javaPrintedCallKind(node);\n }\n // a nested `+ - * /` this printer emits natively is a Java primitive of its kind\n if (node.kind === SyntaxKind.BinaryExpression) {\n return this.javaNativeArithmeticKind(node);\n }\n return undefined;\n }\n\n // a read of a `for (var i = ; ..; i++)` counter anywhere in the loop: javac types it\n // int and no box write reaches it; a capture rename (`finalI`) prints an Object copy instead\n javaPrintedIntCounter(node): boolean {\n return node?.kind === SyntaxKind.Identifier && this.javaIntForCounter(node)\n && this.javaIdentifierPrintsDeclaredName(node);\n }\n\n // fractional / exponent literals print as Java double literals (printNumericLiteral)\n isJavaFloatLiteral(node) {\n if (!node || !isNumericLiteral(node)) {\n return false;\n }\n return !/^0[xXbBoO]/.test(node.text) && /[.eE]/.test(node.text);\n }\n\n // Java kind of a call the printer emits itself, undefined otherwise. Mirrors printIndexOfCall /\n // printSearchCall / printMathRoundCall / printMathFloorCall / printMathCeilCall and Math.pow:\n // x.indexOf(a) / x.search(a) -> int; Math.round(x) -> long; Math.floor/ceil/pow -> double.\n javaPrintedCallKind(node) {\n const callee = node.expression;\n if (callee?.kind !== SyntaxKind.PropertyAccessExpression) {\n return undefined;\n }\n const name = callee.name?.text;\n const argCount = node.arguments?.length ?? 0;\n const onMath = callee.expression?.kind === SyntaxKind.Identifier\n && callee.expression.text === 'Math';\n switch (name) {\n case 'indexOf':\n case 'search':\n // the dispatch routes a 1-argument indexOf/search through the int-returning\n // helpers; a receiver that prints String keeps String.indexOf (int as well)\n return argCount >= 1 ? 'int' : undefined;\n case 'round':\n return onMath && argCount === 1 ? 'long' : undefined;\n case 'floor':\n case 'ceil':\n return onMath && argCount === 1 ? 'double' : undefined;\n case 'pow':\n return onMath && argCount === 2 ? 'double' : undefined;\n }\n return undefined;\n }\n\n // operand usability for `>=` / `<` / `<=`, which route through the helper's isEqual. Two integral\n // operands are always exact; once a double is involved, toLong saturates and BigDecimal throws on\n // ±Infinity, so a double or long is accepted only as a finite literal within ±2^53.\n javaComparisonOperandsAreExact(left, leftKind, right, rightKind) {\n if (leftKind !== 'double' && rightKind !== 'double') {\n return true;\n }\n return this.javaComparisonOperandIsExactAgainstDouble(left, leftKind)\n && this.javaComparisonOperandIsExactAgainstDouble(right, rightKind);\n }\n\n javaComparisonOperandIsExactAgainstDouble(node, kind) {\n if (kind === 'int') {\n return true;\n }\n if ((kind !== 'long' && kind !== 'double') || !isNumericLiteral(node)) {\n return false;\n }\n const text = node.text;\n if (/^[0-9]+$/.test(text)) {\n // the text is what the printer emits, and JS Number() rounds above 2^53 —\n // compare the literal's exact value instead\n return BigInt(text) <= 9007199254740992n;\n }\n const value = Number(text);\n return Number.isFinite(value) && Math.abs(value) <= 9007199254740992;\n }\n\n // checker proof that the value is printed as a java.util.HashMap: TS object\n // shapes (interfaces, object literals, aliases) become HashMaps, while class\n // instances are real Java objects and arrays/unions are not proven here\n isJavaMapType(type) {\n if (!type || (type.flags & TypeFlags.Object) === 0) {\n return false;\n }\n const checker = this.getChecker();\n if (checker.isArrayType(type) || checker.isTupleType(type)) {\n return false;\n }\n if (type.getCallSignatures().length > 0) {\n return false;\n }\n const declarations = (type.getSymbol()?.declarations ?? []).map((d) => d.resolve());\n return !declarations.some((declaration) => declaration.kind === SyntaxKind.ClassDeclaration\n || declaration.getSourceFile().fileName.indexOf('typescript') > -1);\n }\n\n // string keys (plain, literal or a union of literals) print as Java Strings\n isJavaStringType(type) {\n if (!type) {\n return false;\n }\n if (this.isStringType(type.flags)) {\n return true;\n }\n if ((type.flags & TypeFlags.Union) === 0) {\n return false;\n }\n return type.getTypes().every((member) => this.isStringType(member.flags));\n }\n\n // `Dictionary | undefined` (what a no-overload safe* signature widens to): the helper\n // answers false for the nullish arm and the guarded emission keeps exactly that; every\n // non-map member (arrays, classes, scalars) keeps the helper\n isJavaNullableMapType(type) {\n return this.isJavaNullishUnion(type, (member) => this.isJavaMapType(member))\n && ((type as any).getTypes?.() ?? []).some((member) => (member.flags & (TypeFlags.Undefined | TypeFlags.Null)) === 0);\n }\n\n // the guarded emission reads the receiver twice, so it is only printed for an operand\n // that cannot run anything twice: a name or a `this.` field. Everything else (calls,\n // element reads) keeps the helper so the operand is still evaluated once.\n javaRepeatableOperand(node) {\n if (node === undefined) {\n return false;\n }\n if (isIdentifier(node)) {\n return true;\n }\n if (isParenthesizedExpression(node)) {\n return this.javaRepeatableOperand(node.expression);\n }\n return isPropertyAccessExpression(node) && node.expression?.kind === SyntaxKind.ThisKeyword;\n }\n\n // The declared Java type of a local/parameter is known to the pass that rewrites the declaration\n // text (build/java-local-types.js), which records every name it typed here. With no consumer\n // installed the table is empty and every read keeps the helper.\n javaDeclaredTypeOf(expression): string | undefined {\n if (expression === undefined || !isIdentifier(expression)) {\n return undefined;\n }\n const declaration = this.javaDeclarationOfIdentifier(expression);\n if (declaration === undefined || expression.text !== declaration.name?.text) {\n return undefined;\n }\n return this.javaDeclaredTypeOfDeclaration(declaration);\n }\n\n // the declared Java type of a declaration: the embedding build layer names the\n // declarations it retypes itself, and a parameter the printer retypes\n // (javaNativeParameterType) answers for itself, so its element reads go native too\n javaDeclaredTypeOfDeclaration(declaration): string | undefined {\n const resolver = this.javaDeclaredLocalTypeResolver;\n if (resolver !== undefined) {\n let type;\n try {\n type = resolver(declaration);\n } catch (e) {\n type = undefined;\n }\n if (typeof type === 'string' && type.trim().length > 0) {\n return type.trim();\n }\n }\n if (isParameterDeclaration(declaration)) {\n return this.javaNativeParameterType(declaration);\n }\n return undefined;\n }\n\n // The native Java type a parameter prints with when its TS annotation is a base/types.ts alias in\n // JAVA_NATIVE_PARAMETER_TYPES. Fixed parameters of generated-tier methods only, and every\n // declaration up the heritage chain must print the same type: Java overrides are invariant.\n javaNativeParameterType(node): string | undefined {\n if (node === undefined || !isParameterDeclaration(node)\n || node.initializer !== undefined || node.dotDotDotToken !== undefined) {\n return undefined;\n }\n const own = this.javaNativeParameterTypeOf(node);\n const type = own !== undefined ? own : this.javaInheritedParameterType(node);\n if (type === undefined) {\n return undefined;\n }\n // D2: a parameter the enclosing body assigns with a compound operator keeps the box — `url += '/x'`\n // prints `url = Helpers.add(url, ..)`, whose result is an Object. A plain `x = ..` or a\n // destructuring target is cast at the write site instead (javaParameterAssignmentCast).\n if (this.javaParameterIsCompoundAssigned(node)) {\n return undefined;\n }\n try {\n const method: any = node.parent;\n const index = method.parameters.indexOf(node);\n let override = this.getMethodOverride(method);\n if (override === undefined\n && JAVA_NATIVE_PARAMETER_PREDICTION_FILES.test(node.getSourceFile().fileName)\n && method.name !== undefined) {\n // a venue method overriding the Exchange-tier body PredictionExchange.java carries\n // must print that tier parameter's type (D8: Java overrides are invariant)\n const tier = this.exchangeTierMethods().get(method.name.getText().trim());\n if (tier !== undefined && !this.javaParameterPrintsType(tier.parameters?.[index], type)) {\n return undefined;\n }\n }\n while (override !== undefined) {\n const baseParam = (override as any).parameters?.[index];\n if (!this.javaParameterPrintsType(baseParam, type)) {\n return undefined;\n }\n override = this.getMethodOverride(override);\n }\n } catch (e) {\n return undefined; // an unresolvable heritage keeps the box\n }\n return type;\n }\n\n // method declarations (first per name) of the `Exchange` class of ts/src/base/Exchange.ts, read off the\n // program the warp ran on. A prediction venue's method with one of these names overrides\n // the tier body javaTranspiler.ts injects into PredictionExchange.java.\n private _exchangeTierMethods: Map | undefined = undefined;\n exchangeTierMethods(): Map {\n if (this._exchangeTierMethods !== undefined) {\n return this._exchangeTierMethods;\n }\n const names = new Map();\n try {\n const program = this.getProgram();\n const fileName = program.getSourceFileNames().find((f) => JAVA_NATIVE_PARAMETER_BASE_FILES.test(f));\n const file = fileName !== undefined ? program.getSourceFile(fileName) : undefined;\n const collect = (node: Node) => {\n if (isClassDeclaration(node) && node.name?.text === 'Exchange') {\n for (const member of node.members) {\n const key = (member as any).name?.getText().trim();\n if (isMethodDeclaration(member) && key !== undefined && !names.has(key)) {\n names.set(key, member);\n }\n }\n }\n node.forEachChild(collect);\n };\n if (file !== undefined) {\n collect(file);\n }\n } catch (e) {\n // no program yet: the heritage walk above already answered\n }\n this._exchangeTierMethods = names;\n return names;\n }\n\n // the same parameter position of an ancestor declaration prints this native type: its\n // own annotation names it, or - with no annotation of its own - it inherits the same\n // type from a declaration above it, exactly like this one does\n javaParameterPrintsType(baseParam, type: string): boolean {\n if (baseParam === undefined || !isParameterDeclaration(baseParam)\n || baseParam.initializer !== undefined || baseParam.dotDotDotToken !== undefined) {\n return false;\n }\n const own = this.javaNativeParameterTypeOf(baseParam);\n const printed = own !== undefined ? own : this.javaInheritedParameterType(baseParam);\n return printed === type;\n }\n\n // the type a fixed parameter with no annotation of its own inherits: the nearest\n // declaration of the method up the heritage chain that prints a native type. An\n // unannotated root declaration prints `Object`, so nothing is inherited and the whole\n javaInheritedParameterType(node): string | undefined {\n const method = node.parent;\n const index = method?.parameters?.indexOf(node);\n if (method === undefined || index === undefined || index < 0) {\n return undefined;\n }\n let override = this.getMethodOverride(method);\n while (override !== undefined) {\n const baseParam = (override as any).parameters?.[index];\n const type = baseParam === undefined ? undefined : this.javaNativeParameterTypeOf(baseParam);\n if (type !== undefined) {\n return type;\n }\n override = this.getMethodOverride(override);\n }\n return undefined;\n }\n\n // Default-valued parameters are real parameters of the typed core that carries the body;\n // the untyped `Object... optionalArgs` front delegates to it.\n javaOptionalParameterJavaType(node): string {\n return this.javaOptionalParameterType(node) ?? 'Object';\n }\n\n javaOptionalParameterType(node): string | undefined {\n if (node === undefined || !isParameterDeclaration(node)) {\n return undefined;\n }\n if (node.initializer === undefined || node.dotDotDotToken !== undefined) {\n return undefined; // `?` parameters keep today's shape (they print in the fixed prefix)\n }\n const own = this.javaOptionalParameterTypeOf(node);\n if (own === undefined) {\n return undefined;\n }\n // a parameter the body assigns with a compound operator keeps the box (`x += ..` prints\n // Helpers.add(x, ..), an Object result) - the same rule as the fixed-parameter path\n if (this.javaParameterIsCompoundAssigned(node)) {\n return undefined;\n }\n // a list parameter the body `typeof`-probes also accepts other boxes at runtime\n if (own === JAVA_STRING_LIST_TYPE && this.javaParameterIsTypeofTested(node)) {\n return undefined;\n }\n const method: any = node.parent;\n try {\n const index = method.parameters.indexOf(node);\n let override = this.getMethodOverride(method);\n while (override !== undefined) {\n if (!this.javaOptionalParameterFamilyAgrees(method, override, index, own)) {\n return undefined;\n }\n override = this.getMethodOverride(override);\n }\n } catch (e) {\n return undefined; // an unresolvable heritage keeps the box\n }\n return own;\n }\n\n // the annotation proof for an optional parameter (no initializer bail)\n javaOptionalParameterTypeOf(node): string | undefined {\n if (node === undefined || !isParameterDeclaration(node) || node.dotDotDotToken !== undefined) {\n return undefined;\n }\n const method = node.parent;\n if (method === undefined || !isMethodDeclaration(method) || !isClassDeclaration(method.parent)) {\n return undefined;\n }\n if (!JAVA_NATIVE_PARAMETER_BASE_FILES.test(node.getSourceFile().fileName)\n && !JAVA_NATIVE_PARAMETER_GENERATED_FILES.test(node.getSourceFile().fileName)) {\n return undefined; // a hand-written java class declares this method, not the printer\n }\n const checker: any = this.checkerOrUndefined();\n if (checker === undefined) {\n return undefined;\n }\n const type = checker.getTypeAtLocation(node);\n if (type === undefined) {\n return undefined;\n }\n const symbol = this.javaParameterAliasSymbol(node, type, checker);\n const name = symbol?.name;\n const excluded = JAVA_NATIVE_PARAMETER_EXCLUDED_POSITIONS[(method.name as any)?.text];\n if (excluded !== undefined && excluded.includes(method.parameters.indexOf(node))) {\n return undefined;\n }\n if (name === 'Strings' || this.javaIsStringArrayType(checker, type)) {\n const listName = JAVA_STRINGS_OPTIONAL_PARAMETER_NAMES.has((node.name as any)?.text)\n && !JAVA_STRINGS_EXCLUDED_METHODS.has((method.name as any)?.text);\n return listName ? JAVA_STRING_LIST_TYPE : undefined;\n }\n if (name === undefined || JAVA_NATIVE_PARAMETER_TYPES_OPTIONAL[name] === undefined) {\n return undefined;\n }\n const declaration = symbol?.declarations?.[0]?.resolve();\n const fileName = declaration?.getSourceFile?.()?.fileName;\n return JAVA_NATIVE_PARAMETER_SOURCE_FILES.test(fileName ?? '')\n ? JAVA_NATIVE_PARAMETER_TYPES_OPTIONAL[name] : undefined;\n }\n\n // a `string[]` annotation (optionally `| undefined`), the unaliased spelling of `Strings`\n javaIsStringArrayType(checker, type): boolean {\n const members = type.isUnionType?.() ? type.getTypes() : [type];\n let arrays = 0;\n for (const member of members) {\n if (member.flags & (TypeFlags.Undefined | TypeFlags.Null)) {\n continue;\n }\n if (!checker.isArrayType(member)) {\n return false;\n }\n const element = checker.getTypeArguments(member)?.[0];\n if (element === undefined || !(element.flags & TypeFlags.String)) {\n return false;\n }\n arrays++;\n }\n return arrays === 1;\n }\n\n // Java overrides are invariant: every ancestor declaration must match the parameter count,\n // the first default-valued index and this position's type, otherwise the position stays Object.\n javaOptionalParameterFamilyAgrees(method, override, index, type: string): boolean {\n const baseParams = override?.parameters;\n if (baseParams === undefined || baseParams.length !== method.parameters.length) {\n return false;\n }\n if (this.firstDefaultParameterIndex(baseParams) !== this.firstDefaultParameterIndex(method.parameters)) {\n return false;\n }\n const baseParam = baseParams[index];\n if (baseParam === undefined || !isParameterDeclaration(baseParam) || baseParam.dotDotDotToken !== undefined) {\n return false;\n }\n const baseIsOptional = baseParam.initializer !== undefined || baseParam.questionToken !== undefined;\n const ownIsOptional = method.parameters[index].initializer !== undefined\n || method.parameters[index].questionToken !== undefined;\n if (baseIsOptional !== ownIsOptional) {\n return false;\n }\n const baseType = baseIsOptional\n ? this.javaOptionalParameterTypeOf(baseParam)\n : this.javaNativeParameterTypeOf(baseParam);\n return baseType === type;\n }\n\n firstDefaultParameterIndex(params): number {\n for (let i = 0; i < params.length; i++) {\n if (params[i].initializer !== undefined || params[i].questionToken !== undefined) {\n return i;\n }\n }\n return -1;\n }\n\n // a method with >=1 optional parameter prints one typed full signature (callers pass every slot).\n hasDefaultedTail(node): boolean {\n if (node === undefined || !isMethodDeclaration(node)) {\n return false; // constructors and functions keep the optionalArgs unpack\n }\n return this.javaHasOptionalParameter(node);\n }\n\n // a typed default-valued method parameter is written in place, so its writes convert to the declared type\n javaSplitParameterWriteType(node): string | undefined {\n if (node?.initializer === undefined || !this.hasDefaultedTail(node.parent)) {\n return undefined;\n }\n return this.javaOptionalParameterType(node);\n }\n\n // the async body copy of a reassigned default-valued parameter keeps a `List` type;\n // its writes convert like the sync in-place ones (other types keep the `Object` copy)\n javaAsyncParameterLocalType(node): string | undefined {\n if (node?.initializer === undefined || !this.hasDefaultedTail(node.parent) || !this.isAsyncFunction(node.parent)) {\n return undefined;\n }\n const type = this.javaOptionalParameterType(node);\n if (type === 'Long' && !this.javaParameterIsWritten(node)) {\n return type; // a read-only copy of the Long core parameter\n }\n return type === JAVA_STRING_LIST_TYPE ? type : undefined;\n }\n\n // any write to the parameter in its method: assignment (plain or compound), a destructuring\n // target, `++`/`--`, a for-of/in binding\n javaParameterIsWritten(node): boolean {\n const method = node?.parent;\n const checker: any = this.checkerOrUndefined();\n if (method?.body === undefined || checker === undefined) {\n return true;\n }\n const symbol = checker.getSymbolAtLocation(node.name);\n if (symbol === undefined) {\n return true;\n }\n const same = (n) => n !== undefined && isIdentifier(n) && checker.getSymbolAtLocation(n) === symbol;\n let written = false;\n const visit = (n) => {\n if (written) {\n return;\n }\n if (isBinaryExpression(n) && JAVA_ASSIGNMENT_OPERATOR_KINDS.has(n.operatorToken.kind)) {\n const left = n.left;\n if (same(left) || (isArrayLiteralExpression(left) && left.elements.some(same))) {\n written = true;\n return;\n }\n }\n if ((isPrefixUnaryExpression(n) || isPostfixUnaryExpression(n)) && same(n.operand)\n && (n.operator === SyntaxKind.PlusPlusToken || n.operator === SyntaxKind.MinusMinusToken)) {\n written = true;\n return;\n }\n if ((isForOfStatement(n) || isForInStatement(n)) && same(n.initializer)) {\n written = true;\n return;\n }\n n.forEachChild(visit);\n };\n visit(method.body);\n return written;\n }\n\n // a read the enclosing code only reaches with the binding non-null: the right operand of\n // `x !== undefined && ..`, the matching arm of an `if`/`?:` on that test, or any statement\n // after `if (x === undefined) { return/throw/.. }`. Callers require an unwritten binding.\n javaNullGuardAdmitsRead(node): boolean {\n const checker: any = this.checkerOrUndefined();\n const symbol = checker?.getSymbolAtLocation(node);\n if (symbol === undefined) {\n return false;\n }\n let current: any = node;\n while (current.parent !== undefined) {\n const parent: any = current.parent;\n if (isBinaryExpression(parent) && parent.operatorToken.kind === SyntaxKind.AmpersandAmpersandToken\n && parent.right === current && this.javaTestProvesNonNull(parent.left, symbol, true)) {\n return true;\n }\n if (isBinaryExpression(parent) && parent.operatorToken.kind === SyntaxKind.BarBarToken\n && parent.right === current && this.javaTestProvesNonNull(parent.left, symbol, false)) {\n return true;\n }\n if ((isIfStatement(parent) || isConditionalExpression(parent))) {\n const test = isIfStatement(parent) ? parent.expression : parent.condition;\n const whenTrue = isIfStatement(parent) ? parent.thenStatement : parent.whenTrue;\n const whenFalse = isIfStatement(parent) ? parent.elseStatement : parent.whenFalse;\n if ((whenTrue === current && this.javaTestProvesNonNull(test, symbol, true))\n || (whenFalse === current && this.javaTestProvesNonNull(test, symbol, false))) {\n return true;\n }\n }\n if (isBlock(parent)) {\n for (const sibling of parent.statements) {\n if (sibling === current) {\n break;\n }\n if (isIfStatement(sibling)\n && ((this.javaTestProvesNonNull(sibling.expression, symbol, false) && this.javaStatementAlwaysExits(sibling.thenStatement))\n || (this.javaTestProvesNonNull(sibling.expression, symbol, true) && this.javaStatementAlwaysExits(sibling.elseStatement)))) {\n return true;\n }\n }\n }\n current = parent;\n }\n return false;\n }\n\n // `x !== undefined` / `x != null` (either order) proves x non-null when the test is true;\n // `x === undefined` when false; `&&` (true) / `||` (false) prove through either side, `!` flips\n javaTestProvesNonNull(test, symbol, truthy): boolean {\n if (test === undefined) {\n return false;\n }\n if (isParenthesizedExpression(test)) {\n return this.javaTestProvesNonNull(test.expression, symbol, truthy);\n }\n if (isPrefixUnaryExpression(test) && test.operator === SyntaxKind.ExclamationToken) {\n return this.javaTestProvesNonNull(test.operand, symbol, !truthy);\n }\n if (!isBinaryExpression(test)) {\n return false;\n }\n const op = test.operatorToken.kind;\n if (op === SyntaxKind.AmpersandAmpersandToken) {\n return truthy && (this.javaTestProvesNonNull(test.left, symbol, true) || this.javaTestProvesNonNull(test.right, symbol, true));\n }\n if (op === SyntaxKind.BarBarToken) {\n return !truthy && (this.javaTestProvesNonNull(test.left, symbol, false) || this.javaTestProvesNonNull(test.right, symbol, false));\n }\n const inequality = op === SyntaxKind.ExclamationEqualsToken || op === SyntaxKind.ExclamationEqualsEqualsToken;\n const equality = op === SyntaxKind.EqualsEqualsToken || op === SyntaxKind.EqualsEqualsEqualsToken;\n if ((!inequality && !equality) || truthy !== inequality) {\n return false;\n }\n const nullish = (n) => n.kind === SyntaxKind.NullKeyword || (isIdentifier(n) && n.text === 'undefined');\n const tested = nullish(test.right) ? test.left : (nullish(test.left) ? test.right : undefined);\n const checker: any = this.checkerOrUndefined();\n return tested !== undefined && isIdentifier(tested) && checker?.getSymbolAtLocation(tested) === symbol;\n }\n\n javaStatementAlwaysExits(statement): boolean {\n if (statement === undefined) {\n return false;\n }\n const exits = (n) => isReturnStatement(n) || isThrowStatement(n) || isContinueStatement(n) || isBreakStatement(n);\n if (exits(statement)) {\n return true;\n }\n return isBlock(statement) && statement.statements.length > 0 && exits(statement.statements[statement.statements.length - 1]);\n }\n\n // `Long` when the body reads this default-valued `Int` parameter as the core's own Long (the\n // parameter itself or its read-only async copy); undefined otherwise\n javaLongParameterRead(node): boolean {\n if (node === undefined || !isIdentifier(node) || !this.javaIdentifierPrintsDeclaredName(node)\n || !this.javaIdentifierKeepsDeclaredName(node)) {\n return false;\n }\n const declaration = this.javaDeclarationOfIdentifier(node);\n if (declaration === undefined || !isParameterDeclaration(declaration) || declaration.initializer === undefined\n || !this.hasDefaultedTail(declaration.parent)) {\n return false;\n }\n return this.javaOptionalParameterType(declaration) === 'Long' && !this.javaParameterIsWritten(declaration);\n }\n\n // the names the enclosing method body assigns with a compound operator (`x += ..`),\n // by method node; a plain assignment is handled by javaParameterAssignmentCast\n javaMethodAssignedNames: WeakMap> = new WeakMap();\n\n // D-09 memo/cycle guard for javaNativeReturnType (mutually recursive return chains)\n javaReturnTypeCache: WeakMap = new WeakMap();\n javaReturnTypeInProgress: Set = new Set();\n\n javaParameterIsTypeofTested(node): boolean {\n const method = node.parent;\n const name = (node.name as any)?.text;\n // forEachChild stops at the first truthy visit, i.e. the first matching typeof\n const visit = (n: Node): boolean => (isTypeOfExpression(n) && isIdentifier(n.expression) && n.expression.text === name)\n || n.forEachChild(visit) === true;\n return method?.body !== undefined && name !== undefined && method.body.forEachChild(visit) === true;\n }\n\n javaParameterIsCompoundAssigned(node): boolean {\n const method = node.parent;\n const name = (node.name as any)?.text;\n if (method?.body === undefined || name === undefined) {\n return false;\n }\n let assigned = this.javaMethodAssignedNames.get(method);\n if (assigned === undefined) {\n assigned = new Set();\n const collect = (n: Node) => {\n if (isBinaryExpression(n) && n.operatorToken.kind !== SyntaxKind.EqualsToken\n && JAVA_ASSIGNMENT_OPERATOR_KINDS.has(n.operatorToken.kind)) {\n const left = n.left;\n if (isIdentifier(left) && left.text !== undefined) {\n assigned.add(left.text as string);\n }\n }\n n.forEachChild(collect);\n };\n method.body.forEachChild(collect);\n this.javaMethodAssignedNames.set(method, assigned);\n }\n return assigned.has(name as string);\n }\n\n // a write to a parameter this printer declared natively: the right side prints from `Object`\n // locals, so the assignment carries the same checkcast as the call sites. The checker proved the\n // right side assignable to the parameter, so the declared type describes the value received.\n javaParameterAssignmentCast(left, right, identation): string | undefined {\n if (!isIdentifier(left)) {\n return undefined;\n }\n const declaration = this.javaDeclarationOfIdentifier(left);\n if (declaration === undefined || !isParameterDeclaration(declaration) || left.text !== (declaration.name as any)?.text) {\n return undefined;\n }\n const native = this.javaNativeParameterType(declaration) ?? this.javaSplitParameterWriteType(declaration);\n if (native === undefined) {\n return undefined;\n }\n const leftText = this.printNode(left, 0);\n if (this.javaNativeArgumentAlreadyTyped(right, native)) {\n return `${leftText} = ${this.printNode(right, identation)}`;\n }\n if (native === 'Long') {\n return `${leftText} = Helpers.toLongOrNull(${this.printNode(right, identation)})`;\n }\n if (native === JAVA_STRING_LIST_TYPE) {\n return `${leftText} = Helpers.toStringListArg(${this.printNode(right, identation)})`;\n }\n // the checkcast carries its own parentheses: a bare `(T) cond ? a : b` binds the\n // condition, not the whole right side\n return `${leftText} = (${native}) (${this.printNode(right, identation)})`;\n }\n\n // ===== native return types (D-09) =====\n //\n // The native Java return a generated method declaration prints with, when its TS\n javaNativeReturnType(node): string | undefined {\n if (node === undefined || node.kind !== SyntaxKind.MethodDeclaration\n || node.name === undefined || node.type === undefined || node.body === undefined\n || !isClassDeclaration(node.parent)) {\n return undefined;\n }\n if (this.javaReturnTypeInProgress.has(node)) {\n return undefined; // a mutually recursive return chain reads as unproven\n }\n if (this.javaReturnTypeCache.has(node)) {\n return this.javaReturnTypeCache.get(node);\n }\n this.javaReturnTypeInProgress.add(node);\n let result;\n try {\n result = this.javaNativeReturnTypeUncached(node);\n } finally {\n this.javaReturnTypeInProgress.delete(node);\n }\n this.javaReturnTypeCache.set(node, result);\n return result;\n }\n\n javaNativeReturnTypeUncached(node): string | undefined {\n const fileName = node.getSourceFile().fileName;\n const generated = JAVA_NATIVE_PARAMETER_GENERATED_FILES.test(fileName);\n // the printed base tier (below the transpile delimiter) may carry a Boolean return\n // when no venue in the program redeclares the name\n const baseTier = !generated && JAVA_NATIVE_PARAMETER_BASE_FILES.test(fileName) && this.javaIsPrintedMethod(node);\n if ((!generated && !baseTier) || this.isAsyncFunction(node)) {\n return undefined;\n }\n const target = this.javaNativeReturnTypeTarget(node);\n if (target === undefined || (baseTier && target !== 'Boolean')) {\n return undefined;\n }\n // D8: an override prints the base declaration's boxed signature; a Boolean base\n // signature binds every override to Boolean (Java return types are covariant only)\n const ancestor = this.getMethodOverride(node);\n const ancestorBoolean = ancestor !== undefined && this.javaNativeReturnType(ancestor) === 'Boolean';\n if (ancestorBoolean && (target !== 'Boolean' || !this.javaReturnSitesPrintType(node, target)\n || (this.javaMethodReturnsNonNullBoolean(ancestor, 0) && !this.javaMethodReturnsNonNullBoolean(node, 0)))) {\n throw new Error(`java: ${String((node.name as any).text)} overrides a Boolean base method but its returns do not all print Boolean`);\n }\n if (ancestor !== undefined && !ancestorBoolean) {\n return undefined;\n }\n if (!this.javaReturnSitesPrintType(node, target)) {\n return undefined;\n }\n return target;\n }\n\n // a native-Boolean method whose every return prints a primitive Java boolean (never null):\n // a call to it can be a condition as is (unboxing cannot throw)\n javaMethodReturnsNonNullBoolean(method, depth: number): boolean {\n if (method === undefined || depth > 3 || method.body === undefined) {\n return false;\n }\n const name = String((method.name as any)?.text);\n if (this.javaNativeReturnType(method) !== 'Boolean' && !JAVA_THIS_BOOLEAN_METHODS.has(name)) {\n return false;\n }\n let returns = 0;\n let ok = true;\n const scan = (n: Node) => {\n if (!ok || (n !== method && isFunctionLike(n))) {\n return;\n }\n if (isReturnStatement(n)) {\n returns++;\n ok = n.expression !== undefined && this.javaPrintsNonNullBoolean(n.expression, depth);\n return;\n }\n n.forEachChild(scan);\n };\n scan(method.body);\n return ok && returns > 0;\n }\n\n javaPrintsNonNullBoolean(node, depth: number): boolean {\n switch (node?.kind) {\n case SyntaxKind.TrueKeyword:\n case SyntaxKind.FalseKeyword:\n return true;\n case SyntaxKind.ParenthesizedExpression:\n return this.javaPrintsNonNullBoolean(node.expression, depth);\n case SyntaxKind.PrefixUnaryExpression:\n return node.operator === SyntaxKind.ExclamationToken; // prints `!` + a condition\n case SyntaxKind.BinaryExpression:\n return JAVA_BOOLEAN_OPERATOR_KINDS.has(node.operatorToken.kind);\n case SyntaxKind.ConditionalExpression:\n return this.javaPrintsNonNullBoolean(node.whenTrue, depth) && this.javaPrintsNonNullBoolean(node.whenFalse, depth);\n case SyntaxKind.CallExpression:\n return this.javaCallPrintsNonNullBoolean(node, depth + 1);\n }\n return false;\n }\n\n // `this.(...)` resolving to a method proven by javaMethodReturnsNonNullBoolean\n javaCallPrintsNonNullBoolean(node, depth: number): boolean {\n if (this.isArrayIsArrayCall(node) || this.javaPreciseBooleanCall(node) || this.javaStringAffixCall(node)) {\n return true;\n }\n const callee = node.expression;\n if (!isPropertyAccessExpression(callee) || callee.expression.kind !== SyntaxKind.ThisKeyword) {\n return false;\n }\n let declaration;\n try {\n declaration = this.getChecker().getResolvedSignature(node)?.declaration?.resolve();\n } catch (e) {\n return false;\n }\n if (declaration === undefined || declaration.kind !== SyntaxKind.MethodDeclaration) {\n return false;\n }\n if (JAVA_THIS_BOOLEAN_METHODS.has(String(callee.name.text))) {\n return this.javaCallBooleanKind(node) === 'boolean';\n }\n return this.javaMethodReturnsNonNullBoolean(declaration, depth);\n }\n\n javaNativeReturnTypeTarget(node): string | undefined {\n let type;\n try {\n type = this.getChecker().getTypeAtLocation(node.type);\n } catch (e) {\n return undefined;\n }\n if (type === undefined) {\n return undefined;\n }\n const aliasSymbol = (type as any).getAliasSymbol?.();\n if (aliasSymbol !== undefined) {\n const name = aliasSymbol.name;\n const fileName = aliasSymbol.declarations?.[0]?.resolve()?.getSourceFile?.()?.fileName;\n if (fileName !== undefined && JAVA_NATIVE_PARAMETER_SOURCE_FILES.test(fileName) && (name === 'Str' || name === 'Bool')) {\n return name === 'Str' ? 'String' : 'Boolean';\n }\n }\n // a plain (non-alias) string annotation already prints String; the flag proof keeps\n // this rule consistent with the printer's own plain-string handling\n if (type.flags === TypeFlags.String) {\n return 'String';\n }\n // plain `boolean` is the true|false union: the Boolean bit, with no alias (`Bool` is handled above)\n if (aliasSymbol === undefined && (type.flags & TypeFlags.Boolean) !== 0) {\n return 'Boolean';\n }\n return this.isJavaMapStructureType(type) ? JAVA_NATIVE_RETURN_MAP_TYPE : undefined;\n }\n\n // every `return` of the method body (nested functions are separate scopes) prints the\n // target Java type\n javaReturnSitesPrintType(method, target: string): boolean {\n const returns: any[] = [];\n const collect = (n) => {\n if (n === undefined) {\n return;\n }\n if (n !== method && isFunctionLike(n)) {\n return;\n }\n if (isReturnStatement(n)) {\n returns.push(n);\n }\n n.forEachChild(collect);\n };\n collect(method.body);\n if (returns.length === 0) {\n return false;\n }\n return returns.every((r) => r.expression !== undefined\n && this.javaExpressionPrintsType(r.expression, target));\n }\n\n javaExpressionPrintsType(expression, target: string): boolean {\n const node = this.javaUnwrapReturnExpression(expression);\n if (node === undefined) {\n return false;\n }\n if (node.kind === SyntaxKind.NullKeyword) {\n return true; // null is assignable to String / Boolean / Map\n }\n if (isIdentifier(node) && node.text === 'undefined') {\n return true;\n }\n if (node.kind === SyntaxKind.ConditionalExpression) {\n return this.javaExpressionPrintsType(node.whenTrue, target)\n && this.javaExpressionPrintsType(node.whenFalse, target);\n }\n let literal: boolean;\n if (target === JAVA_NATIVE_RETURN_MAP_TYPE) {\n literal = isObjectLiteralExpression(node); // a fresh HashMap literal\n } else if (target === 'String') {\n literal = isStringLiteralLikeNode(node);\n } else if (target === 'Boolean') {\n // the printer's own proof that this expression prints a Java boolean (or a\n // Boolean box): the comparison helpers, `!`, the logical operators, boolean\n // literals and the verified boolean-returning calls\n literal = this.javaPrintsBooleanValue(node, new Set(), 0);\n } else {\n return false;\n }\n return literal\n || this.javaReturnedParameterType(node) === target\n || this.javaReturnedCallType(node) === target\n || (target === 'String' && this.javaStringCallReturn(node));\n }\n\n javaUnwrapReturnExpression(expression) {\n if (expression === undefined) {\n return undefined;\n }\n let node = expression;\n while (node !== undefined && (isParenthesizedExpression(node) || isAsExpression(node)\n || isNonNullExpression(node) || isTypeAssertion(node)\n || node.kind === SyntaxKind.SatisfiesExpression)) {\n node = node.expression;\n }\n return node;\n }\n\n // an identifier bound to a parameter the printer itself declares with the target Java\n // type (javaNativeParameterType: Dict/Market/Currency/Str/Bool annotations)\n javaReturnedParameterType(node): string | undefined {\n if (!isIdentifier(node)) {\n return undefined;\n }\n const declaration = this.javaDeclarationOfIdentifier(node);\n if (declaration === undefined || !isParameterDeclaration(declaration)) {\n return undefined;\n }\n return this.javaNativeParameterType(declaration);\n }\n\n // a `this. (...)` / `super. (...)` return is the callee's native return type\n // (fixpoint over javaNativeReturnType)\n javaReturnedCallType(node): string | undefined {\n if (!isCallExpression(node)) {\n return undefined;\n }\n const callee = node.expression;\n if (!isPropertyAccessExpression(callee)\n || (callee.expression.kind !== SyntaxKind.ThisKeyword\n && !(isIdentifier(callee.expression) && callee.expression.text === 'super'))) {\n return undefined;\n }\n let declaration;\n try {\n declaration = this.getChecker().getResolvedSignature(node)?.declaration?.resolve();\n } catch (e) {\n return undefined;\n }\n if (declaration === undefined || declaration.kind !== SyntaxKind.MethodDeclaration) {\n return undefined;\n }\n return this.javaNativeReturnType(declaration);\n }\n\n // a `this. (...)` return of a hand-written base String producer: the resolved\n // signature must still live in the base tier (a venue override prints its own boxed\n // Object signature)\n javaStringCallReturn(node): boolean {\n if (!isCallExpression(node)) {\n return false;\n }\n const callee = node.expression;\n if (!isPropertyAccessExpression(callee) || callee.expression.kind !== SyntaxKind.ThisKeyword) {\n return false;\n }\n if (!JAVA_STRING_RETURN_BASE_METHODS.has(callee.name.text as string)) {\n return false;\n }\n let declaration;\n try {\n declaration = this.getChecker().getResolvedSignature(node)?.declaration?.resolve();\n } catch (e) {\n return false;\n }\n if (declaration === undefined) {\n return false; // an unresolvable call prints Helpers.callDynamically (Object)\n }\n const fileName = declaration.getSourceFile?.()?.fileName;\n return fileName !== undefined && JAVA_STRING_RETURN_BASE_FILES.test(fileName);\n }\n\n // the alias a parameter's annotation names; `OrderType` ('limit' | 'market' | string) reduces\n // to plain `string` and keeps no aliasSymbol, so read the annotation's type reference instead\n javaParameterAliasSymbol(node, type, checker) {\n const symbol = (type as any).getAliasSymbol?.() ?? (type as any).getSymbol?.();\n if (symbol !== undefined || node.type === undefined || !isTypeReferenceNode(node.type)) {\n return symbol;\n }\n const referenced = checker.getSymbolAtLocation(node.type.typeName);\n const alias = referenced !== undefined && (referenced.flags & SymbolFlags.Alias)\n ? checker.getAliasedSymbol(referenced) : referenced;\n return alias !== undefined && (alias.flags & SymbolFlags.TypeAlias) ? alias : undefined;\n }\n\n // the annotation proof alone, without the heritage check\n javaNativeParameterTypeOf(node): string | undefined {\n if (node === undefined || !isParameterDeclaration(node)\n || node.initializer !== undefined || node.dotDotDotToken !== undefined) {\n return undefined;\n }\n const method = node.parent;\n if (method === undefined || !isMethodDeclaration(method) || !isClassDeclaration(method.parent)) {\n return undefined;\n }\n if (!JAVA_NATIVE_PARAMETER_BASE_FILES.test(node.getSourceFile().fileName)\n && !JAVA_NATIVE_PARAMETER_GENERATED_FILES.test(node.getSourceFile().fileName)) {\n return undefined; // a hand-written java class declares this method, not the printer\n }\n const checker: any = this.checkerOrUndefined();\n if (checker === undefined) {\n return undefined;\n }\n const type = checker.getTypeAtLocation(node);\n if (type === undefined) {\n return undefined;\n }\n const symbol = this.javaParameterAliasSymbol(node, type, checker);\n const name = symbol?.name;\n if (name === undefined || JAVA_NATIVE_PARAMETER_TYPES[name] === undefined) {\n return undefined;\n }\n const excluded = JAVA_NATIVE_PARAMETER_EXCLUDED_POSITIONS[(method.name as any)?.text];\n if (excluded !== undefined && excluded.includes(method.parameters.indexOf(node))) {\n return undefined;\n }\n const declaration = symbol?.declarations?.[0]?.resolve();\n const fileName = declaration?.getSourceFile?.()?.fileName;\n return JAVA_NATIVE_PARAMETER_SOURCE_FILES.test(fileName ?? '') ? JAVA_NATIVE_PARAMETER_TYPES[name] : undefined;\n }\n\n // `k` where the consumer declares k as a Java String: the helper's String branch (the\n // only one that can answer true for a map) is the native lookup, and no null key can\n // reach containsKey\n javaDeclaredStringType(expression) {\n const type = this.javaDeclaredTypeOf(expression);\n return type !== undefined && JAVA_DECLARED_STRING_TYPE.test(type);\n }\n\n printCustomBinaryExpressionIfAny(node, identation) {\n const left = node.left;\n const right = node.right;\n const op = node.operatorToken.kind;\n\n if (left.kind === SyntaxKind.Identifier) {\n this.ReassignedVars[this.getVarKey(left)] = true;\n }\n\n if (left.kind === SyntaxKind.TypeOfExpression) {\n const typeOfExpression = this.handleTypeOfInsideBinaryExpression(\n node,\n identation\n );\n if (typeOfExpression) return typeOfExpression;\n }\n\n // a write to a parameter the printer declared natively casts its right side\n if (op === SyntaxKind.EqualsToken && left.kind === SyntaxKind.Identifier) {\n const assignment = this.javaParameterAssignmentCast(left, right, identation);\n if (assignment !== undefined) {\n return assignment;\n }\n }\n\n // destructuring: [a,b] = this.method()\n if (\n op === SyntaxKind.EqualsToken &&\n left.kind === SyntaxKind.ArrayLiteralExpression\n ) {\n const arrayBindingPatternElements = left.elements;\n const parsedArrayBindingElements = arrayBindingPatternElements.map((e) => {\n this.ReassignedVars[this.getVarKey(e)] = true;\n return this.printNode(e, 0);\n });\n const syntheticName = parsedArrayBindingElements.join(\"\") + \"Variable\";\n\n let arrayBindingStatement =\n `var ${syntheticName} = ${this.printNode(right, 0)};\\n`;\n\n parsedArrayBindingElements.forEach((e, index) => {\n // a destructuring target the printer declares natively carries the cast the\n // synthesized `.get(index)` result needs (a plain `Object` read)\n let elementValue = `((java.util.List) ${syntheticName}).get(${index})`;\n const target = arrayBindingPatternElements[index];\n if (isIdentifier(target)) {\n const declaration = this.javaDeclarationOfIdentifier(target);\n const native = declaration !== undefined && isParameterDeclaration(declaration)\n ? (this.javaNativeParameterType(declaration) ?? this.javaSplitParameterWriteType(declaration)) : undefined;\n if (native === 'Long') {\n elementValue = `Helpers.toLongOrNull(${elementValue})`;\n } else if (native !== undefined) {\n elementValue = `(${native}) ${elementValue}`;\n }\n }\n const terminator = index < parsedArrayBindingElements.length - 1 ? \";\\n\" : \"\";\n arrayBindingStatement += this.getIden(identation) + `${e} = ${elementValue}` + terminator;\n });\n\n return arrayBindingStatement;\n }\n\n // ---------------------------------------------------------------\n // setter for element-access assignments: a[b] = v\n // ---------------------------------------------------------------\n if (op === SyntaxKind.EqualsToken &&\n left.kind === SyntaxKind.ElementAccessExpression) {\n // Collect base container and all keys (inner-most key is last).\n const keys: any[] = [];\n let baseExpr: any = null;\n let cur: any = left;\n while (isElementAccessExpression(cur)) {\n keys.unshift(cur.argumentExpression); // prepend\n const expr = cur.expression;\n if (!isElementAccessExpression(expr)) {\n baseExpr = expr;\n break;\n }\n cur = expr;\n }\n\n const containerStr = this.printNode(baseExpr, 0);\n const keyStrs = keys.map(k => this.printNode(k, 0));\n\n // Build GetValue(GetValue( ... )) chain for all but the last key; the first\n // step reads the receiver itself, so a declared map indexes natively and only\n // the `any` steps above it keep the helper (Go: goElementWriteChain).\n let acc = containerStr;\n let firstKey = 0;\n const chainRead = (keyStrs.length > 1) ? this.javaDeclaredChainContainerRead(left, keys.length) : undefined;\n if ((keyStrs.length > 1) && this.javaDeclaredMapReceiver(baseExpr)\n && isStringLiteralLikeNode(keys[0])) {\n acc = `${containerStr}.get(${keyStrs[0]})`;\n firstKey = 1;\n } else if (chainRead !== undefined) {\n acc = chainRead;\n firstKey = 1;\n } else if (keyStrs.length > 1) {\n // `this.[k1][k2] = v`: the bottom step reads the hand-written base map\n // field natively (JAVA_FIELD_TYPES), every step above it keeps the helper\n const fieldRead = this.javaFieldMapReadText(baseExpr, keys[0]);\n if (fieldRead !== undefined) {\n acc = fieldRead;\n firstKey = 1;\n }\n }\n for (let i = firstKey; i < keyStrs.length - 1; i++) {\n acc = `${this.ELEMENT_ACCESS_WRAPPER_OPEN}${acc}, ${keyStrs[i]}${this.ELEMENT_ACCESS_WRAPPER_CLOSE}`;\n }\n\n const prefixes = \"\";\n\n\n const lastKey = keyStrs[keyStrs.length - 1];\n const rhs = this.printNode(right, 0);\n const keyArg = this.elementWriteKeyText(keys[keys.length - 1], lastKey);\n\n if (this.elementWriteTargetsMap(left.expression, baseExpr, keys, right)) {\n // a receiver declared as a Map already carries the type the put binds on\n const target = (keys.length === 1 && this.javaDeclaredMapReceiver(baseExpr))\n ? acc : `((${this.OBJECT_KEYWORD})${acc})`;\n return `${prefixes}${target}.put(${keyArg}, ${rhs})`;\n }\n // a declared Map local takes a non-null value: the helper's only non-put branch is\n // the ConcurrentHashMap null removal, so the native put is the same write\n if (keys.length === 1 && this.javaDeclaredMapReceiver(baseExpr)\n && (isStringLiteralLikeNode(keys[0]) || this.javaDeclaredStringType(keys[0]))\n && this.javaPrintsNonNullValue(right)) {\n return `${prefixes}${acc}.put(${lastKey}, ${rhs})`;\n }\n\n return `${prefixes}Helpers.addElementToObject(${acc}, ${lastKey}, ${rhs})`;\n }\n\n if (op === SyntaxKind.InKeyword) {\n const objectType = this.getChecker().getTypeAtLocation(right);\n const keyType = this.getChecker().getTypeAtLocation(left);\n const objText = this.printNode(right, 0);\n const keyText = this.printNode(left, 0);\n // A key the checker does not prove a Java String: the helper's map branch and containsKey both\n // answer false for it, and the null test keeps ConcurrentHashMap/TreeMap receivers from throwing\n // on a null key. The key prints once per guard, so it must be a side-effect-free read.\n let guarded: string | undefined;\n if (this.isJavaStringType(keyType) || this.javaDeclaredStringType(left)) {\n guarded = '';\n } else if (this.javaSideEffectFreeReference(left) && !this.javaOperandPrintsPrimitiveNumber(left)\n && !this.isNullishLiteral(left)\n && left.kind !== SyntaxKind.TrueKeyword && left.kind !== SyntaxKind.FalseKeyword) {\n guarded = `${keyText} != null && `;\n }\n const withGuard = (read: string) => (guarded ? `(${guarded}${read})` : read);\n if (guarded !== undefined) {\n // the declaration the pass rewrote already carries the map type (and, for a\n // `this.` field or a retyped local, the surface that names it): no cast needed\n if (this.javaDeclaredMapReceiver(right)) {\n return withGuard(`${objText}.containsKey(${keyText})`);\n }\n if (this.isJavaMapType(objectType)) {\n return withGuard(`((java.util.Map)${objText}).containsKey(${keyText})`);\n }\n // `Dictionary | undefined` (a no-overload safe* signature): the helper answers\n // false for the nullish arm, the guard keeps exactly that\n if (this.isJavaNullableMapType(objectType) && this.javaRepeatableOperand(right)) {\n return `(${objText} != null && ${guarded}((java.util.Map)${objText}).containsKey(${keyText}))`;\n }\n }\n return `Helpers.inOp(${objText}, ${keyText})`;\n }\n\n // native comparison when both operands provably print as Java numbers. `>` is exact for every\n // numeric pair (isGreaterThan is a toDouble compare, NaN included); `>=` / `<` / `<=` also go\n // through the helper's isEqual, so they need operands isEqual reproduces exactly.\n if (op === SyntaxKind.LessThanToken || op === SyntaxKind.GreaterThanToken ||\n op === SyntaxKind.LessThanEqualsToken || op === SyntaxKind.GreaterThanEqualsToken) {\n const leftKind = this.javaPrimitiveOperandKind(left);\n const rightKind = this.javaPrimitiveOperandKind(right);\n const orderingSafe = op === SyntaxKind.GreaterThanToken\n || this.javaComparisonOperandsAreExact(left, leftKind, right, rightKind);\n if (leftKind !== undefined && rightKind !== undefined && orderingSafe) {\n return `${this.printNode(left, 0)} ${this.SupportedKindNames[op]} ${this.printNode(right, 0)}`;\n }\n const declaredCompare = this.printDeclaredNumericComparison(left, right, op);\n if (declaredCompare !== undefined) {\n return declaredCompare;\n }\n }\n\n // only print the operands when this op is actually handled here; otherwise\n // the base printBinaryExpression prints them, and doing it eagerly means\n // every unhandled binary expression gets its subtrees printed twice\n if (op === SyntaxKind.PlusEqualsToken || op === SyntaxKind.MinusEqualsToken || op in this.binaryExpressionsWrappers) {\n const leftText = this.printNode(left, 0);\n const rightText = this.printNode(right, 0);\n\n const inlined = this.printInlineHelperArithmetic(left, right, leftText, rightText, op);\n if (inlined !== undefined) {\n return inlined;\n }\n\n\n if (op === SyntaxKind.PlusEqualsToken) {\n return `${leftText} = Helpers.add(${leftText}, ${rightText})`;\n }\n\n if (op === SyntaxKind.MinusEqualsToken) {\n return `${leftText} = Helpers.subtract(${leftText}, ${rightText})`;\n }\n\n const wrapper = this.binaryExpressionsWrappers[op];\n const nativeEquality = this.printNativeEqualityIfProvable(node, leftText, rightText);\n if (nativeEquality !== undefined) {\n return nativeEquality;\n }\n return `${wrapper[0]}${leftText}, ${rightText}${wrapper[1]}`;\n }\n\n return undefined;\n }\n\n\n // dict-shaped values are Map in the Java port: raw HashMap/ConcurrentHashMap\n // or a types.TypedMap view (AbstractMap over the raw payload). Proven by the\n // checker (string index signature, or an interface/alias declared in the base types file).\n // a concrete (non-any, non-union, non-generic) type the structure proofs below can reason about\n javaConcreteStructureType(type) {\n const excludedFlags = TypeFlags.Any | TypeFlags.Unknown | TypeFlags.Union\n | TypeFlags.Intersection | TypeFlags.Undefined | TypeFlags.Null\n | TypeFlags.TypeParameter | TypeFlags.Conditional | TypeFlags.Never;\n return type !== undefined && (type.flags & excludedFlags) === 0;\n }\n\n isJavaMapStructureType(type) {\n if (!this.javaConcreteStructureType(type)) {\n return false;\n }\n const checker = this.getChecker();\n if (checker.isArrayType(type) || checker.isTupleType(type)) {\n return false;\n }\n if (type.getStringIndexType() !== undefined) {\n return true;\n }\n const symbol = (type as any).getAliasSymbol?.() ?? type.getSymbol?.();\n const declaration = symbol?.declarations?.[0]?.resolve();\n const fileName = declaration?.getSourceFile?.()?.fileName;\n return fileName !== undefined && /(^|\\/)ts\\/src\\/base\\/types\\.ts$/.test(fileName);\n }\n\n // tuples are List in the Java port (types.TypedList). Only an index inside the\n // tuple's required elements goes native: .get(i) throws out of range where the helper\n // returns null, so non-tuple array reads (any[], string[], ...) keep the helper.\n isJavaListStructureType(type) {\n return this.javaConcreteStructureType(type) && this.getChecker().isTupleType(type);\n }\n\n tupleRequiredElementCount(type) {\n const flags = ((type as any)?.isTypeReference?.() ? (type as any).getTarget().elementFlags : undefined) ?? (type as any)?.elementFlags ?? [];\n let required = 0;\n for (const flag of flags) {\n if (flag !== ElementFlags.Optional && flag !== ElementFlags.Rest) {\n required++;\n } else {\n break;\n }\n }\n return required;\n }\n\n // non-tuple array reads: the Java representation is java.util.List (the printer maps every\n // array type to one), but neither the receiver nor the index is bounded statically, so the\n // read keeps the helper's null / off-range outcomes.\n isJavaArrayStructureType(type) {\n if (!this.javaConcreteStructureType(type)) {\n return false;\n }\n const checker = this.getChecker();\n if (checker.isTupleType(type)) {\n return false; // handled by the tuple branch, where the bound is provable\n }\n return checker.isArrayType(type);\n }\n\n // the null-safe element read prints its receiver once per guard; only a reference whose\n // printed Java has no side effects (identifier, `this`/`this.field` chain) may repeat it.\n javaSideEffectFreeReference(node) {\n if (node === undefined) {\n return false;\n }\n switch (node.kind) {\n case SyntaxKind.Identifier:\n case SyntaxKind.ThisKeyword:\n return true;\n case SyntaxKind.ParenthesizedExpression:\n case SyntaxKind.PropertyAccessExpression:\n return this.javaSideEffectFreeReference(node.expression);\n default:\n return false;\n }\n }\n\n // receivers whose printed elements the ccxt post-pass types as String FROM the helper call\n // (`x.split(sep)` and string-literal array producers): those locals narrow to String only\n // while the read prints `Helpers.GetValue(`, so their reads keep the helper.\n javaStringElementsReceiver(node) {\n if (!isIdentifier(node)) {\n return false;\n }\n const declaration = this.getChecker().getSymbolAtLocation(node)?.valueDeclaration?.resolve();\n const initializer = declaration !== undefined && isVariableDeclaration(declaration) ? declaration.initializer : undefined;\n if (initializer === undefined) {\n return false;\n }\n if (isCallExpression(initializer) && isPropertyAccessExpression(initializer.expression)) {\n return initializer.expression.name?.text === 'split';\n }\n if (isArrayLiteralExpression(initializer)) {\n return initializer.elements.length > 0 && initializer.elements.every((element) =>\n element.kind === SyntaxKind.StringLiteral\n || element.kind === SyntaxKind.NoSubstitutionTemplateLiteral);\n }\n return false;\n }\n\n isLeftSideOfAssignment(node) {\n const parent = node.parent;\n if (parent?.kind !== SyntaxKind.BinaryExpression || parent.left !== node) {\n return false;\n }\n return JAVA_ASSIGNMENT_OPERATOR_KINDS.has(parent.operatorToken.kind);\n }\n\n // The declared Java type of a local is known to the pass that rewrites the declaration\n // text (build/java-local-types.js): it records every local it typed here. Reads consult\n // it; with no consumer installed the table is empty and every read keeps the helper.\n javaDeclaredLocalTypeResolver: ((declaration: Node) => string | undefined) | undefined;\n\n // the declaration node behind an identifier, when the checker resolves one\n javaDeclarationOfIdentifier(expression) {\n if (expression === undefined || !isIdentifier(expression)) {\n return undefined;\n }\n const checker: any = this.checkerOrUndefined();\n if (checker === undefined) {\n return undefined;\n }\n const symbol = checker.getSymbolAtLocation(expression);\n const declaration = symbol?.valueDeclaration?.resolve() ?? symbol?.declarations?.[0]?.resolve();\n const kind = declaration?.kind;\n return kind === SyntaxKind.VariableDeclaration || kind === SyntaxKind.Parameter ? declaration : undefined;\n }\n\n // `x[\"lit\"]` where the consumer declares x as a Java map: the native read returns the\n // element or null, exactly what the helper's Map branch returns, and the declaration\n // already carries the type, so no cast is needed.\n javaDeclaredMapReceiver(expression) {\n const declaration = this.javaDeclarationOfIdentifier(expression);\n if (declaration === undefined) {\n return false;\n }\n if (expression.text !== declaration.name?.text) {\n return false; // a capture rename prints `final Object finalX = x` (Object)\n }\n const type = this.javaDeclaredTypeOfDeclaration(declaration);\n return type !== undefined && JAVA_DECLARED_MAP_TYPES.test(type);\n }\n\n // `x[i]` where x is a declared java List and i is the int counter of `for (var i = `:\n // GetValue answers null for a null receiver or index outside [0, size) while List.get throws, so\n // the emission carries the same tests. `||` short-circuits over identifiers, so nothing runs twice.\n javaDeclaredListElementRead(node, isCounter) {\n if (node.parent?.kind === SyntaxKind.ExpressionStatement) {\n return undefined; // a bare conditional expression is not a Java statement\n }\n // the ws-tier post-pass types `Object client = Helpers.GetValue(..)` by that exact\n // printed text (build/javaTranspiler.ts postProcessWsJava: `Client client =\n // (Client)Helpers.GetValue(..)`). A native read drops the shape and the checkcast\n if (node.parent?.kind === SyntaxKind.VariableDeclaration\n && (node.parent as any).initializer === node\n && ((node.parent as any).name?.text === 'client')) {\n return undefined;\n }\n const declared = this.javaDeclaredTypeOf(node.expression);\n const declaredList = declared !== undefined && JAVA_DECLARED_LIST_TYPES.test(declared);\n let target;\n let list;\n if (declaredList) {\n target = this.printNode(node.expression, 0);\n list = target;\n } else {\n const type = this.getChecker().getTypeAtLocation(node.expression);\n if (!this.isJavaListValueType(type) || this.isVarargsArrayReference(node.expression)\n || !this.javaSideEffectFreeReference(node.expression)) {\n return undefined;\n }\n target = this.printNode(node.expression, 0);\n list = `((java.util.List)${target})`;\n }\n if (!isCounter && Number(node.argumentExpression.text) > 2147483647) {\n return undefined; // printNumericLiteral would add an `L` suffix List.get cannot take\n }\n if (this.javaStringElementsReceiver(node.expression)) {\n return undefined; // its String consumers are typed from the `Helpers.GetValue(` prefix\n }\n const indexText = this.printNode(node.argumentExpression, 0);\n const lowerBound = isCounter ? `${indexText} < 0 || ` : '';\n return `(${target} == null || ${lowerBound}${indexText} >= ${list}.size() ? null : ${list}.get(${indexText}))`;\n }\n\n // `x[k]` where a consumer declares x a java Map and the key is not a literal: the\n // helper's Map branch is the map accessor behind its own tests — a null receiver, a\n // null key and a key that is not a String all answer null, and a String-keyed map's\n javaDeclaredMapElementRead(node) {\n if (node.parent?.kind === SyntaxKind.ExpressionStatement) {\n return undefined; // a bare conditional expression is not a Java statement\n }\n if (this.printElementAccessExpressionExceptionIfAny(node) !== undefined\n || this.isLeftSideOfAssignment(node)) {\n return undefined;\n }\n if (!this.javaDeclaredMapReceiver(node.expression)) {\n return undefined;\n }\n const key = node.argumentExpression;\n if (!isIdentifier(key) || !this.javaRepeatableOperand(key)) {\n return undefined; // the guard prints the key twice\n }\n const declared = this.javaDeclaredTypeOf(key);\n if (declared !== undefined && JAVA_PRIMITIVE_DECLARED_TYPES.has(declared.trim())) {\n return undefined; // a java primitive cannot take the `instanceof` test\n }\n if (declared === undefined && this.javaOperandPrintsPrimitiveNumber(key)) {\n return undefined;\n }\n let keyType;\n try {\n keyType = this.getChecker().getTypeAtLocation(key);\n } catch (e) {\n return undefined;\n }\n if (keyType === undefined\n || this.getChecker().isArrayType(keyType) || this.getChecker().isTupleType(keyType)) {\n return undefined;\n }\n const target = this.printNode(node.expression, 0);\n const keyText = this.printNode(key, 0);\n if (keyType.getAliasSymbol?.() === undefined && keyType.flags === TypeFlags.String) {\n // a plain `string` key prints a java String; the null test keeps a receiver that\n // aliases a ConcurrentHashMap from throwing on a null the alias admits\n return `(${target} == null || ${keyText} == null ? null : ${target}.get(${keyText}))`;\n }\n return `(${target} == null || !(${keyText} instanceof String) ? null : ${target}.get(${keyText}))`;\n }\n\n // the identifier of a `for (var i = ; …; i++)` counter that still prints as\n // `i`: the JN capture rename prints `finalI`, a `final Object` box, which is not an int\n javaPrimitiveCounterIndex(node) {\n if (!this.isJavaPrimitiveCounterReference(node)) {\n return false;\n }\n const declaration = this.javaDeclarationOfIdentifier(node);\n return declaration !== undefined && node.text === declaration.name?.text;\n }\n\n // `this.[k]` on a hand-written base map field (JAVA_FIELD_TYPES): the helper's Map branch is\n // the native `get`. The helper answers null for a null receiver or key, so both stay guarded; the\n // receiver and key are side-effect free. An unguarded read has no parens so a checkcast binds it.\n javaFieldMapReadText(receiver, key): string | undefined {\n if (receiver === undefined || receiver.kind !== SyntaxKind.PropertyAccessExpression\n || receiver.expression?.kind !== SyntaxKind.ThisKeyword) {\n return undefined;\n }\n const name = receiver.name?.text;\n const field = (typeof name === 'string') ? JAVA_FIELD_TYPES[name] : undefined;\n if (field === undefined || field.map !== true) {\n return undefined;\n }\n const keyText = this.printNode(key, 0);\n let keyGuarded = false;\n const checker: any = this.checkerOrUndefined();\n if (checker === undefined) {\n return undefined;\n }\n const keyType = checker.getTypeAtLocation(key);\n if (!this.isJavaStringType(keyType) && !this.javaDeclaredStringType(key)) {\n // the guard prints the key twice, so only a repeatable operand can take it\n if (!this.javaRepeatableOperand(key)) {\n return undefined;\n }\n keyGuarded = true;\n }\n const target = this.printNode(receiver, 0);\n const read = `((java.util.Map)${target}).get(${keyText})`;\n if (!keyGuarded && field.nullable !== true) {\n return read;\n }\n const receiverGuard = (field.nullable === true) ? `${target} == null ? null : ` : '';\n return `(${keyGuarded ? `${keyText} == null ? null : ` : ''}${receiverGuard}${read})`;\n }\n\n // the read stands only where no exchange-specific override claims the site and the node\n // is not a write target\n javaFieldMapReadIfAllowed(node): string | undefined {\n const read = this.javaFieldMapReadText(node.expression, node.argumentExpression);\n if (read === undefined) {\n return undefined;\n }\n if (this.printElementAccessExpressionExceptionIfAny(node) !== undefined || this.isLeftSideOfAssignment(node)) {\n return undefined;\n }\n return read;\n }\n\n // `x[k]` reads: emit the native container accessor when the checker proves the Java\n // representation of `x`, otherwise return undefined so the base prints Helpers.GetValue.\n printCheckerTypedElementAccessRead(node) {\n const key = node.argumentExpression;\n const isStringKey = isStringLiteralLikeNode(key);\n const isNumberKey = isNumericLiteral(key);\n const isCounterKey = !isStringKey && !isNumberKey && this.javaPrimitiveCounterIndex(key);\n if (!isStringKey && !isNumberKey && !isCounterKey) {\n // a `this.` map read carries its own Java proof (JAVA_FIELD_TYPES): the\n // field declaration the printer cannot see is what makes `k` bind natively\n const field = this.javaFieldMapReadIfAllowed(node);\n if (field !== undefined) {\n return field;\n }\n // a declared map (a local the build layer typed, or a param the printer retypes)\n // is the other proof a non-literal key binds natively\n return this.javaDeclaredMapElementRead(node);\n }\n if (this.printElementAccessExpressionExceptionIfAny(node) !== undefined) {\n return undefined; // an exchange-specific override wins, the base prints it\n }\n if (this.isLeftSideOfAssignment(node)) {\n return undefined;\n }\n const type = this.getChecker().getTypeAtLocation(node.expression);\n if (isStringKey) {\n if (!this.isJavaMapStructureType(type)) {\n if (!this.javaDeclaredMapReceiver(node.expression)) {\n // a literal key on a table field the checker does not type (balance is\n // `any`) still has the field table's Java proof\n return this.javaFieldMapReadIfAllowed(node);\n }\n // the declared local is already a map: the accessor binds with no cast\n return `${this.printNode(node.expression, 0)}.get(${this.printNode(key, 0)})`;\n }\n const target = this.printNode(node.expression, 0);\n return `((java.util.Map)${target}).get(${this.printNode(key, 0)})`;\n }\n if (isCounterKey) {\n // a `var` int loop index on a declared List: the only proof that prints an int\n return this.javaDeclaredListElementRead(node, true);\n }\n const index = Number(key.text);\n if (!Number.isInteger(index) || index < 0) {\n return undefined;\n }\n if (this.isJavaListStructureType(type)) {\n if (index >= this.tupleRequiredElementCount(type)) {\n return undefined;\n }\n const target = this.printNode(node.expression, 0);\n return `((java.util.List)${target}).get(${this.printNode(key, 0)})`;\n }\n if (!this.isJavaArrayStructureType(type)) {\n // the checker leaves the receiver boxed: a declared List still reads natively\n return this.javaDeclaredListElementRead(node, false);\n }\n if (!this.javaSideEffectFreeReference(node.expression) || this.javaStringElementsReceiver(node.expression)) {\n return undefined;\n }\n // `Helpers.GetValue` returns null for a null receiver and off range; List.get\n // throws on both, so the native read carries both guards. `||` short-circuits and\n // the receiver is side-effect free, so it is evaluated as often as before.\n const target = this.printNode(node.expression, 0);\n const list = `((java.util.List)${target})`;\n const keyText = this.printNode(key, 0);\n return `(${target} == null || ${keyText} >= ${list}.size() ? null : ${list}.get(${keyText}))`;\n }\n\n printElementAccessExpression(node, identation) {\n return this.printCheckerTypedElementAccessRead(node) ?? super.printElementAccessExpression(node, identation);\n }\n\n\n // ---- helper-family inlining: `+ - * / += -=` ---------------------------\n // `x + y` normally prints Helpers.add, `- * /` print Helpers.subtract/multiply/\n // divide, and `+=`/`-=` print `x = Helpers.add/subtract(...)`. They print native\n // Java when BOTH operands are checker-typed in the same non-nullable scalar family\n // and the printed operands carry the matching Java kind, so the native expression\n // has the helper's boxed result kind and value on every path.\n\n // the TypeScript scalar family of a binary operand: plain `string`/`number` and\n // their literals only. The nullable aliases (Str/Int/Num/Bool), unions and `any`\n // can hold undefined at runtime, which the helpers absorb.\n javaScalarFamily(node): string | undefined {\n const checker: any = this.checkerOrUndefined();\n if (checker === undefined) {\n return undefined;\n }\n const type = checker.getTypeAtLocation(node);\n if (type === undefined || type.getAliasSymbol?.() !== undefined) {\n return undefined;\n }\n const flags = type.flags;\n if (flags === TypeFlags.String || flags === TypeFlags.StringLiteral) {\n return 'string';\n }\n if (flags === TypeFlags.Number || flags === TypeFlags.NumberLiteral) {\n return 'number';\n }\n return undefined;\n }\n\n // true when the printed Java for this operand is statically a String: a string\n // literal, a nested `+` this rule prints as a native concat, or a form the\n // embedding build layer's javaExpressionTypeResolver names `String` (a local whose\n // emitted declaration is `String = `, a call to a hand-written `public\n // String` runtime method). Java compiles `+` only when at least one operand is\n // statically a String, so a String local anchors the concat like a literal does.\n javaProvableString(node): boolean {\n if (node === undefined) {\n return false;\n }\n switch (node.kind) {\n case SyntaxKind.StringLiteral:\n case SyntaxKind.NoSubstitutionTemplateLiteral:\n return true;\n case SyntaxKind.ParenthesizedExpression:\n return this.javaProvableString(node.expression);\n case SyntaxKind.BinaryExpression:\n return this.javaNativeConcat(node);\n }\n return this.javaResolvedString(node);\n }\n\n // the embedding build layer's proof of the concrete printed Java type of an\n // expression (installed like csharpExpressionTypeResolver); only `String` is\n // consumed here, and a missing resolver proves nothing\n javaResolvedString(node): boolean {\n if (node === undefined || this.javaExpressionTypeResolver === undefined) {\n return false;\n }\n try {\n return this.javaExpressionTypeResolver(node) === 'String';\n } catch (e) {\n return false;\n }\n }\n\n // does this `+` node print as a native concat (both sides plain string, one side a\n // provable String)? Mirrors printInlineHelperArithmetic so callers can reason about\n // the printed text of a nested concat.\n javaNativeConcat(node): boolean {\n if (node?.operatorToken?.kind !== SyntaxKind.PlusToken) {\n return false;\n }\n if (this.javaScalarFamily(node.left) !== 'string' || this.javaScalarFamily(node.right) !== 'string') {\n return false;\n }\n return this.javaProvableString(node.left) || this.javaProvableString(node.right);\n }\n\n // B-13: the `+` / `+=` concat drops the helper when one side's printed Java is\n // provably a String and the other side is an operand Helpers.add's String branch\n // converts exactly like javac's `+` does\n javaStringConcatIsProvable(left, right, leftFamily, rightFamily) {\n const leftProvable = this.javaProvableString(left);\n const rightProvable = this.javaProvableString(right);\n if (leftFamily === 'string' && rightFamily === 'string' && (leftProvable || rightProvable)) {\n return true;\n }\n return (leftProvable && this.javaConcatOtherOperandIsSafe(right))\n || (rightProvable && this.javaConcatOtherOperandIsSafe(left));\n }\n\n // the non-anchor operand of a concat: a value StringBuilder.append and Helpers.add's\n // `String.valueOf` branch turn into the same text. Inlined when it is a printed String, when the\n // checker proves a plain non-nullable `string`, or when the type cannot be a boxed Double.\n javaConcatOtherOperandIsSafe(node) {\n if (node === undefined) {\n return false;\n }\n if (this.javaProvableString(node) || this.javaScalarFamily(node) === 'string') {\n return true;\n }\n return this.javaConcatOperandPrintsAsValue(node) && !this.javaConcatOperandCanBeDouble(node);\n }\n\n // a bare value an infix operator can take without extra parentheses: a ternary,\n // assignment or comma expression printed here would re-parse (`(x + c ? a : b)`),\n // and an optional-chain call prints a guarded shape that is not an operand\n javaConcatOperandPrintsAsValue(node) {\n if (node === undefined) {\n return false;\n }\n if (isParenthesizedExpression(node)) {\n return this.javaConcatOperandPrintsAsValue(node.expression);\n }\n switch (node.kind) {\n case SyntaxKind.Identifier:\n case SyntaxKind.StringLiteral:\n case SyntaxKind.NoSubstitutionTemplateLiteral:\n case SyntaxKind.NumericLiteral:\n case SyntaxKind.TrueKeyword:\n case SyntaxKind.FalseKeyword:\n case SyntaxKind.NullKeyword:\n case SyntaxKind.ThisKeyword:\n case SyntaxKind.NewExpression:\n case SyntaxKind.ArrayLiteralExpression:\n return true;\n case SyntaxKind.PropertyAccessExpression:\n case SyntaxKind.ElementAccessExpression:\n case SyntaxKind.CallExpression:\n return node.questionDotToken === undefined;\n }\n return false;\n }\n\n // a Double operand makes Helpers.add take its `instanceof Double` branch and return a NUMBER, while\n // javac's `+` concatenates, so an operand that can be a boxed Double keeps the helper. Only types\n // that can never hold a number are accepted, plus integer literals that print as a Java `long`.\n javaConcatOperandCanBeDouble(node) {\n if (this.javaProvableNumericKind(node) === 'long') {\n return false;\n }\n const checker: any = this.checkerOrUndefined();\n if (checker === undefined) {\n return true;\n }\n const type = checker.getTypeAtLocation(node);\n if (type === undefined) {\n return true;\n }\n const notNumber = TypeFlags.String | TypeFlags.StringLiteral | TypeFlags.TemplateLiteral\n | TypeFlags.Boolean | TypeFlags.BooleanLiteral | TypeFlags.Object | TypeFlags.Null\n | TypeFlags.Undefined | TypeFlags.Void | TypeFlags.Never;\n const notNumeric = (t) => {\n if (t === undefined || t.flags === 0) {\n return false;\n }\n if (t.isUnionType?.()) {\n return t.getTypes().every(notNumeric);\n }\n return (t.flags & ~notNumber) === 0;\n };\n return !notNumeric(type);\n }\n\n // the Java kind a `this.(...)` call provably prints with (JAVA_THIS_RETURN_TYPES), or\n // undefined. The signature must resolve to the base tier or the Date.now lib signature of the\n // functions/time.ts mixin; a venue override prints its own (usually Object) signature.\n javaThisCallNumericKind(node): string | undefined {\n if (node?.kind !== SyntaxKind.CallExpression) {\n return undefined;\n }\n const callee = node.expression;\n if (callee?.kind !== SyntaxKind.PropertyAccessExpression || callee.expression?.kind !== SyntaxKind.ThisKeyword) {\n return undefined;\n }\n const name = callee.name?.text;\n if (typeof name !== 'string') {\n return undefined;\n }\n const kind = JAVA_THIS_RETURN_TYPES[name];\n if (kind === undefined) {\n return undefined;\n }\n const checker: any = this.checkerOrUndefined();\n const declaration = checker.getResolvedSignature(node)?.declaration?.resolve();\n const fileName = declaration?.getSourceFile?.().fileName;\n if (typeof fileName !== 'string') {\n return undefined;\n }\n if (!JAVA_THIS_RETURN_TYPES_BASE_FILE.test(fileName) && !JAVA_THIS_RETURN_TYPES_LIB_FILE.test(fileName)) {\n return undefined;\n }\n return kind;\n }\n\n // the Java kind a numeric operand provably prints with: decimal integer literal -> 'long',\n // fractional literal -> 'double', a nested native `+ - * /` -> its kind, a local retyped\n // `Long`/`Double` -> that kind. Hex/binary literals, negatives, calls, untyped locals: undefined.\n javaProvableNumericKind(node, allowDeclaredLocals = true): string | undefined {\n if (node === undefined) {\n return undefined;\n }\n if (node.kind === SyntaxKind.ParenthesizedExpression) {\n return this.javaProvableNumericKind(node.expression, allowDeclaredLocals);\n }\n if (isNumericLiteral(node)) {\n const text = node.text;\n if (/^0[xXbBoO]/.test(text)) {\n return undefined;\n }\n return /[.eE]/.test(text) ? 'double' : 'long';\n }\n if (node.kind === SyntaxKind.Identifier) {\n if (this.javaPrintedIntCounter(node)) {\n return 'int';\n }\n if (allowDeclaredLocals && this.javaLongParameterRead(node) && this.javaNullGuardAdmitsRead(node)) {\n return 'long'; // an unwritten Long core parameter behind a null test\n }\n return allowDeclaredLocals ? this.javaDeclaredNumericLocalKind(node) : undefined;\n }\n if (node.kind === SyntaxKind.CallExpression) {\n // hand-written base accessors that box a primitive (`Long milliseconds()`,\n // `int parseTimeframe(..)`) - never null, so they anchor the native arithmetic\n if (this.javaBaseTimeLongCall(node)) {\n return 'long';\n }\n if (this.javaBaseIntCall(node)) {\n return 'int';\n }\n // indexOf/search print int, Math.round a primitive long (javaPrintedCallKind)\n const printed = this.javaPrintedCallKind(node);\n return (printed === 'int' || printed === 'long') ? printed : undefined;\n }\n if (node.kind === SyntaxKind.BinaryExpression) {\n return this.javaNativeArithmeticKind(node, allowDeclaredLocals);\n }\n if (this.javaLengthIntRead(node)) {\n return 'int';\n }\n return undefined;\n }\n\n // a bare identifier the embedding layer declares `Long`/`Double` prints as a boxed numeric, but a\n // null box would NPE where the helpers return null, so the checker must see a plain non-nullable\n // number here (nullable aliases and `any` excluded; a narrowed `number` is a real guard in Java).\n javaDeclaredNumericLocalKind(node): string | undefined {\n if (!this.javaOperandIsNonNullNumber(node) || !this.javaIdentifierKeepsDeclaredName(node)\n || !this.javaIdentifierPrintsDeclaredName(node)) {\n return undefined;\n }\n const declaration = this.javaDeclarationOfIdentifier(node);\n let javaType;\n if (declaration !== undefined) {\n try {\n javaType = this.javaDeclaredTypeOfDeclaration(declaration);\n } catch (e) {\n javaType = undefined;\n }\n }\n if (javaType === undefined && typeof this.javaExpressionTypeResolver === 'function') {\n try {\n javaType = this.javaExpressionTypeResolver(node);\n } catch (e) {\n javaType = undefined;\n }\n }\n return this.javaDeclaredNumericTypeKind(javaType);\n }\n\n // the numeric kind a printed Java declaration type names, or undefined for every other\n // type (`Object`, `String`, a boxed collection)\n javaDeclaredNumericTypeKind(javaType): string | undefined {\n if (javaType === undefined) {\n return undefined;\n }\n const type = String(javaType).replace(/^final\\s+/, '').trim();\n const kinds = new Map([['Long', 'long'], ['long', 'long'], ['Double', 'double'], ['double', 'double'],\n ['Integer', 'int'], ['int', 'int']]);\n return kinds.get(type);\n }\n\n // the use prints the declaration's own name: a local or parameter the printer renamed\n // (the `finalX` object-literal capture, the async parameter wrapper) prints against a\n // different declaration, whose recorded type does not describe it\n javaIdentifierPrintsDeclaredName(node): boolean {\n try {\n return this.printNode(node, 0) === String(node.text);\n } catch (e) {\n return false;\n }\n }\n\n // a use the printer rewrote to its `finalX` anonymous-class capture prints against its\n // own `Object finalX = x;` local, so the recorded type of the declaration no longer\n // holds (`(finalTime - 8L)` on an Object local does not compile)\n javaIdentifierKeepsDeclaredName(node): boolean {\n const checker: any = this.checkerOrUndefined();\n if (checker === undefined) {\n return false;\n }\n const declaration = checker.getSymbolAtLocation(node)?.valueDeclaration?.resolve();\n if (declaration === undefined || (declaration.kind !== SyntaxKind.VariableDeclaration\n && !isParameterDeclaration(declaration))) {\n return false;\n }\n return String(node.text) === String(declaration.name?.text);\n }\n\n // the checker type is the plain non-nullable `number` (TypeFlags.Number/NumberLiteral, no\n // alias): `Int`/`Num`/`any` and unions hold undefined at runtime, which the helpers absorb\n javaOperandIsNonNullNumber(node): boolean {\n const checker: any = this.checkerOrUndefined();\n if (checker === undefined) {\n return false;\n }\n const type = checker.getTypeAtLocation(node);\n return type !== undefined && type.getAliasSymbol?.() === undefined\n && (type.flags === TypeFlags.Number || type.flags === TypeFlags.NumberLiteral);\n }\n\n // the kind of the native arithmetic this rule prints for `+ - * /`, or undefined when\n // the node keeps the helper. Mirrors printInlineHelperArithmetic operand-for-operand\n // so callers can reason about the printed text of a nested arithmetic operand;\n // `allowDeclaredLocals=false` asks for a kind that does not rely on a retyped local\n // anywhere in the subtree (`+` never consumes one — java-13/14 own Add).\n javaNativeArithmeticKind(node, allowDeclaredLocals = true): string | undefined {\n const op = node?.operatorToken?.kind;\n const isPlus = op === SyntaxKind.PlusToken;\n const isMinus = op === SyntaxKind.MinusToken;\n const isMultiply = op === SyntaxKind.AsteriskToken;\n const isDivide = op === SyntaxKind.SlashToken;\n if (!isPlus && !isMinus && !isMultiply && !isDivide) {\n return undefined;\n }\n if (this.javaScalarFamily(node.left) !== 'number' || this.javaScalarFamily(node.right) !== 'number') {\n return undefined;\n }\n if (isMultiply && this.javaLiteralFractionalProduct(node.left, node.right)) {\n return 'double';\n }\n const childAllows = allowDeclaredLocals && !isPlus;\n const leftKind = this.javaProvableNumericKind(node.left, childAllows);\n const rightKind = this.javaProvableNumericKind(node.right, childAllows);\n return this.javaNativeArithmeticPairKind(isPlus, isMultiply, isDivide, leftKind, rightKind);\n }\n\n // `2 * 1.67`: two decimal literals whose IEEE product is finite and fractional. Helpers.multiply\n // re-boxes only an integral product as Long, so a fractional one is the native double product.\n javaLiteralFractionalProduct(left, right): boolean {\n const value = (node) => ((node !== undefined && isNumericLiteral(node) && !/^0[xXbBoO]/.test(node.text)) ? Number(node.text) : undefined);\n const a = value(left);\n const b = value(right);\n if (a === undefined || b === undefined || (!/[.eE]/.test(left.text) && !/[.eE]/.test(right.text))) {\n return false;\n }\n const product = a * b;\n return Number.isFinite(product) && !Number.isInteger(product);\n }\n\n // the native operator kind for a proven pair, or undefined. The helper's branch IS this operator:\n // `/` is always double division; `-` boxes long for long/long and double otherwise; `*` only on\n // long pairs (multiply re-boxes an integral double product as Long); `+` keeps the equal-kind rule.\n javaNativeArithmeticPairKind(isPlus, isMultiply, isDivide, leftKind, rightKind): string | undefined {\n if (leftKind === undefined || rightKind === undefined) {\n return undefined;\n }\n if (isDivide) {\n return 'double';\n }\n const hasDouble = (leftKind === 'double') || (rightKind === 'double');\n if (isMultiply) {\n return hasDouble ? undefined : 'long';\n }\n if (isPlus) {\n return (leftKind === rightKind) ? leftKind : undefined;\n }\n return hasDouble ? 'double' : 'long';\n }\n\n // ---- ordered comparison over declared numeric locals ----\n // Helpers.isGreaterThan answers its own predicate when an operand is null (GT: a != null && b == null;\n // LT = !GT && !EQ; GE = GT || EQ; LE = LT || EQ), so a Long/Integer/Double box compares natively\n // inside that exact null table. `>` is a toDouble compare for every numeric pair; `>= < <=` also go\n // through isEqual, so they stay native only for integral pairs (no NaN / BigDecimal rounding arm).\n\n // 'long' | 'double' for an operand the printer proves: a primitive-printing expression, or an\n // identifier whose printed declaration is a numeric type (boxed = may be null)\n javaComparisonOperand(node): { kind: string, boxed: boolean } | undefined {\n let inner = node;\n while (inner !== undefined && inner.kind === SyntaxKind.ParenthesizedExpression) {\n inner = inner.expression;\n }\n if (inner === undefined) {\n return undefined;\n }\n const primitive = this.javaPrimitiveOperandKind(inner);\n if (primitive !== undefined) {\n return { kind: primitive === 'double' ? 'double' : 'long', boxed: false };\n }\n if (!isIdentifier(inner) || !this.javaIdentifierPrintsDeclaredName(inner)) {\n return undefined;\n }\n if (this.javaLongParameterRead(inner)) {\n return { kind: 'long', boxed: !this.javaNullGuardAdmitsRead(inner) };\n }\n const declared = this.javaDeclaredNumericFamily(inner);\n if (declared === undefined) {\n return undefined;\n }\n const kind = (declared === 'Double' || declared === 'double') ? 'double' : 'long';\n return { kind, boxed: JAVA_BOXED_NUMERIC_TYPES.has(declared) };\n }\n\n printDeclaredNumericComparison(left, right, op): string | undefined {\n const l = this.javaComparisonOperand(left);\n const r = this.javaComparisonOperand(right);\n if (l === undefined || r === undefined) {\n return undefined;\n }\n if (op !== SyntaxKind.GreaterThanToken && (l.kind !== 'long' || r.kind !== 'long')) {\n return undefined;\n }\n const a = this.printNode(left, 0);\n const b = this.printNode(right, 0);\n const cmp = `${a} ${this.SupportedKindNames[op]} ${b}`;\n if (!l.boxed && !r.boxed) {\n return `(${cmp})`; // a guarded Long parameter unboxes like a primitive\n }\n const aNull = `${a} == null`;\n const aSet = `${a} != null`;\n const bNull = `${b} == null`;\n const bSet = `${b} != null`;\n // each arm below is the helper's null table, with the unreachable nulls folded away\n switch (op) {\n case SyntaxKind.GreaterThanToken:\n return `(${[l.boxed ? aSet : undefined, r.boxed ? `(${bNull} || ${cmp})` : cmp].filter((x) => x !== undefined).join(' && ')})`;\n case SyntaxKind.LessThanToken:\n return `(${[r.boxed ? bSet : undefined, l.boxed ? `(${aNull} || ${cmp})` : cmp].filter((x) => x !== undefined).join(' && ')})`;\n case SyntaxKind.GreaterThanEqualsToken:\n return `(${[r.boxed ? bNull : undefined, l.boxed ? `(${aSet} && ${cmp})` : cmp].filter((x) => x !== undefined).join(' || ')})`;\n case SyntaxKind.LessThanEqualsToken:\n return `(${[l.boxed ? aNull : undefined, r.boxed ? `(${bSet} && ${cmp})` : cmp].filter((x) => x !== undefined).join(' || ')})`;\n }\n return undefined;\n }\n\n // ---- widened native add (`+` only) ----\n // Helpers.add normalizes Integer to Long, boxes Long for integral operands and Double otherwise\n // (null in -> null out), so native `+` over proven numeric non-null operands gives the same box.\n\n // `this.milliseconds()` / `this.seconds()`: the hand-written Java declares both `public Long` over\n // a primitive time value, so the box is never null. Only a signature resolving into the base time\n // mixin or the Date.now lib chain qualifies; an unresolved call or venue override keeps the helper.\n javaBaseTimeLongCall(node) {\n const name = this.javaThisCallName(node);\n if (name !== 'milliseconds' && name !== 'seconds') {\n return false;\n }\n const checker: any = this.checkerOrUndefined();\n const declaration = checker.getResolvedSignature(node)?.declaration?.resolve();\n if (declaration === undefined) {\n return false;\n }\n const fileName = declaration.getSourceFile?.()?.fileName ?? '';\n // `milliseconds = now` where `now = Date.now` (ts/src/base/functions/time.ts) resolves\n // to the Date.now signature inside the typescript lib chain; `seconds` is declared\n // in that same base file.\n return /(^|[\\\\/])ts[\\\\/]src[\\\\/]base[\\\\/]functions[\\\\/]time\\.ts$/.test(fileName)\n || /(^|[\\\\/])lib\\.[^\\\\/]*\\.d\\.ts$/.test(fileName);\n }\n\n // `this.parseTimeframe(..)`: the hand-written java BaseExchange declares `public int\n // parseTimeframe(Object)` (java/lib/.../BaseExchange.java:1513) over the primitive-int\n // ts/src/base/functions/misc.ts arrow, so the call is a never-null Java int. A venue's\n javaBaseIntCall(node) {\n if (this.javaThisCallName(node) !== 'parseTimeframe') {\n return false;\n }\n let declaration;\n try {\n declaration = this.getChecker().getResolvedSignature(node)?.declaration?.resolve();\n } catch (e) {\n declaration = undefined;\n }\n if (declaration === undefined) {\n return false;\n }\n const fileName = declaration.getSourceFile?.()?.fileName ?? '';\n return /(^|[\\\\/])ts[\\\\/]src[\\\\/]base[\\\\/]functions[\\\\/]misc\\.ts$/.test(fileName);\n }\n\n // the method name of a `this.(...)` call, or undefined for any other node\n javaThisCallName(node) {\n const callee = node?.kind === SyntaxKind.CallExpression ? node.expression : undefined;\n if (callee?.kind !== SyntaxKind.PropertyAccessExpression || callee.expression.kind !== SyntaxKind.ThisKeyword) {\n return undefined;\n }\n return callee.name?.text;\n }\n\n // `for (var i = ; ...; i++)`: printForStatement rewrites the emitted\n // `Object i = 0` initializer to `var i = 0`, so javac types the counter int. The\n // counter is widened explicitly by javaPrintWidenedOperand, and no `=`/compound\n javaIntForCounter(node) {\n if (node?.kind !== SyntaxKind.Identifier) {\n return false;\n }\n const symbol = this.getChecker().getSymbolAtLocation(node);\n const declaration = symbol?.valueDeclaration?.resolve();\n if (declaration === undefined || !isVariableDeclaration(declaration)) {\n return false;\n }\n const declarationList = declaration.parent;\n if (declarationList === undefined || !isVariableDeclarationList(declarationList)\n || declarationList.declarations.length !== 1) {\n return false;\n }\n const forStatement: any = declarationList.parent;\n if (forStatement === undefined || forStatement.kind !== SyntaxKind.ForStatement\n || forStatement.initializer !== declarationList) {\n return false;\n }\n if (this.javaIntegerLiteralKind(declaration.initializer) !== 'int') {\n return false;\n }\n return this.javaCounterHasNoBoxWrite(node, symbol);\n }\n\n // no `=`/compound assignment anywhere in the enclosing function writes this counter;\n // `++`/`--` keep the primitive int, any other operator would not\n javaCounterHasNoBoxWrite(node, symbol) {\n let scope = node.parent;\n while (scope !== undefined && !isFunctionLike(scope) && scope.kind !== SyntaxKind.SourceFile) {\n scope = scope.parent;\n }\n if (scope === undefined) {\n return false;\n }\n let safe = true;\n const visit = (current) => {\n if (!safe || current === undefined) {\n return;\n }\n if (isIdentifier(current) && this.getChecker().getSymbolAtLocation(current) === symbol) {\n const parent = current.parent;\n if (parent !== undefined && isBinaryExpression(parent) && parent.left === current\n && JAVA_ASSIGNMENT_OPERATOR_KINDS.has(parent.operatorToken.kind)) {\n safe = false;\n return;\n }\n }\n current.forEachChild(visit);\n };\n scope.forEachChild(visit);\n return safe;\n }\n\n // `x.length` on a String/List receiver prints `((String)x).length()` /\n // `((java.util.List)x).size()` — a Java int on every path printJavaLength takes\n javaLengthIntRead(node) {\n if (node?.kind !== SyntaxKind.PropertyAccessExpression || node.name?.text !== 'length') {\n return false;\n }\n return this.javaLengthKind(node.expression) !== undefined;\n }\n\n // the Java numeric kind of one `+` operand: the literal proofs above plus the\n // non-null base-tier Long accessors, primitive int for-counters and String/List\n // length reads. Undefined keeps the helper.\n javaWidenedNumericKind(node) {\n if (node === undefined) {\n return undefined;\n }\n if (node.kind === SyntaxKind.ParenthesizedExpression) {\n return this.javaWidenedNumericKind(node.expression);\n }\n const literalKind = this.javaIntegerLiteralKind(node);\n if (literalKind !== undefined) {\n return literalKind;\n }\n if (isNumericLiteral(node)) {\n // hex/octal/binary literals keep the helper; fractional/exponent literals are\n // Java doubles and can hold NaN, which the helper's arithmetic propagates\n if (/^0[xXbBoO]/.test(node.text)) {\n return undefined;\n }\n return /[.eE]/.test(node.text) ? 'double' : undefined;\n }\n if (this.javaBaseTimeLongCall(node)) {\n return 'long';\n }\n if (this.javaBaseIntCall(node) || this.javaIntForCounter(node) || this.javaLengthIntRead(node)) {\n return 'int';\n }\n if (node.kind === SyntaxKind.Identifier) {\n // a declared numeric local/parameter (the embedding layer's declaration table,\n // or a native parameter type): an Integer declares as integral, and the helper\n // normalized it to Long anyway\n if (this.javaLongParameterRead(node) && this.javaNullGuardAdmitsRead(node)) {\n return 'long';\n }\n return this.javaDeclaredNumericLocalKind(node);\n }\n if (node.kind === SyntaxKind.BinaryExpression && node.operatorToken.kind === SyntaxKind.PlusToken) {\n return this.javaWidenedAddKind(node);\n }\n // a nested `- * /` keeps the printer's own literal rule (java-18's family)\n return this.javaNativeArithmeticKind(node);\n }\n\n // the kind of a nested native `+` this rule prints, or undefined when it keeps the helper\n javaWidenedAddKind(node) {\n const leftKind = this.javaWidenedNumericKind(node.left);\n const rightKind = this.javaWidenedNumericKind(node.right);\n if (leftKind === undefined || rightKind === undefined) {\n return undefined;\n }\n return (leftKind === 'double' || rightKind === 'double') ? 'double' : 'long';\n }\n\n // the native form of a numeric `+`, or undefined to keep Helpers.add\n printWidenedNativeAdd(left, right, leftText, rightText) {\n const leftKind = this.javaWidenedNumericKind(left);\n const rightKind = this.javaWidenedNumericKind(right);\n if (leftKind === undefined || rightKind === undefined) {\n return undefined;\n }\n const resultKind = (leftKind === 'double' || rightKind === 'double') ? 'double' : 'long';\n const leftOperand = this.javaPrintWidenedOperand(leftKind, resultKind, left, leftText);\n const rightOperand = this.javaPrintWidenedOperand(rightKind, resultKind, right, rightText);\n return `(${leftOperand} + ${rightOperand})`;\n }\n\n // an int operand is widened to long explicitly: `i + 1` would box an Integer where\n // Helpers.add hands back a Long, and an all-int sum wraps where the helper's long\n // does not. Integer literals print long; a Double result needs no widening.\n javaPrintWidenedOperand(kind, resultKind, node, text) {\n if (kind === 'double') {\n return text;\n }\n if (kind === 'long' || isNumericLiteral(node)) {\n return this.javaPrintOperandAsLong(node, text);\n }\n if (resultKind === 'long') {\n return `((long) ${text})`;\n }\n return text;\n }\n\n // true when the receiver's printed Java would be a `cond ? a : b` (a parenthesised\n // conditional): those keep the helper so no added line carries a `?`\n javaSplitTernaryReceiver(node): boolean {\n if (node.kind === SyntaxKind.ParenthesizedExpression) {\n return this.javaSplitTernaryReceiver(node.expression);\n }\n return node.kind === SyntaxKind.ConditionalExpression;\n }\n\n // `s.split ()` -> the printer's own TS-array shape around Java's\n // String.split(Pattern.quote(...)): the plain-string receiver makes the helper's\n // String.valueOf/null branch unreachable and the result stays readable as List.\n javaNativeSplitCall(node, name, parsedArg): string | undefined {\n if (node === undefined || name === undefined || parsedArg === undefined) {\n return undefined;\n }\n const callee = node.expression;\n if (callee === undefined || callee.kind !== SyntaxKind.PropertyAccessExpression) {\n return undefined;\n }\n if (callee.name?.text !== 'split' || node.arguments?.length !== 1) {\n return undefined;\n }\n const receiver = callee.expression;\n const separator = node.arguments[0];\n if (receiver === undefined || !JAVA_SPLIT_RECEIVER_KINDS.has(receiver.kind)) {\n return undefined;\n }\n // a conditional receiver keeps the helper: the campaign's diff audit flags every\n // added line that carries a `?`, and such a line never goes native in this family\n if (this.javaSplitTernaryReceiver(receiver)) {\n return undefined;\n }\n // the separator is a literal: Helpers.split String.valueOf()s it and quotes it as\n // a regex, and a literal is the only separator whose printed Java is a String\n if (separator.kind !== SyntaxKind.StringLiteral\n && separator.kind !== SyntaxKind.NoSubstitutionTemplateLiteral) {\n return undefined;\n }\n if (this.javaScalarFamily(receiver) !== 'string') {\n return undefined;\n }\n return `${this.ARRAY_OPENING_TOKEN}((String)${name}).split(java.util.regex.Pattern.quote(${parsedArg}))${this.ARRAY_CLOSING_TOKEN}`;\n }\n\n // integer literals print as Java `int`; the helpers normalize Integer to Long before\n // the arithmetic, so native integer arithmetic is emitted in long to keep the boxed\n // result identical\n javaPrintOperandAsLong(node, text) {\n if (!isNumericLiteral(node) || /[.eE]/.test(node.text)) {\n return text;\n }\n return /L$/.test(text) ? text : text + 'L';\n }\n\n // the native form of a helper-family binary operator, or undefined to keep the helper\n // `for (var i = ; ...; i++)` prints a primitive `var` counter (see\n // isJavaPrimitiveForCounter). Only ++/-- may write it: any other assignment in the\n // loop would print a different kind into the same slot (D2), so the proof bails.\n javaProvableCounterInt(node) {\n if (!node || node.kind !== SyntaxKind.Identifier) {\n return false;\n }\n const symbol = this.getChecker().getSymbolAtLocation(node);\n const declaration: any = symbol?.valueDeclaration?.resolve() ?? symbol?.declarations?.[0]?.resolve();\n if (!declaration || declaration.kind !== SyntaxKind.VariableDeclaration) {\n return false;\n }\n if (this.javaIntegerLiteralKind(declaration.initializer) !== 'int') {\n return false;\n }\n const list = declaration.parent;\n const forStatement: any = list?.parent;\n if (!forStatement || forStatement.kind !== SyntaxKind.ForStatement || forStatement.initializer !== list) {\n return false;\n }\n const incrementor = forStatement.incrementor;\n if (!incrementor || incrementor.operand?.kind !== SyntaxKind.Identifier\n || incrementor.operand.text !== node.text) {\n return false;\n }\n if (incrementor.kind !== SyntaxKind.PostfixUnaryExpression && incrementor.kind !== SyntaxKind.PrefixUnaryExpression) {\n return false;\n }\n const name = node.text;\n let safe = true;\n const scan = (n) => {\n if (!safe || !n || n === incrementor) {\n return;\n }\n if (n.kind === SyntaxKind.BinaryExpression && JAVA_ASSIGNMENT_OPERATOR_KINDS.has(n.operatorToken.kind)\n && n.left?.kind === SyntaxKind.Identifier && n.left.text === name) {\n safe = false;\n return;\n }\n if ((n.kind === SyntaxKind.PostfixUnaryExpression || n.kind === SyntaxKind.PrefixUnaryExpression)\n && n.operand?.kind === SyntaxKind.Identifier && n.operand.text === name) {\n return;\n }\n n.forEachChild(scan);\n };\n scan(forStatement.statement);\n if (!safe) {\n return false;\n }\n // the enclosing function may not write it either\n let enclosing = forStatement.parent;\n while (enclosing && !isFunctionLike(enclosing)) {\n enclosing = enclosing.parent;\n }\n if (enclosing) {\n const body = enclosing.body ?? enclosing;\n const scanOuter = (n) => {\n if (!safe || !n || n === forStatement || isFunctionLike(n)) {\n return;\n }\n if (n.kind === SyntaxKind.BinaryExpression && JAVA_ASSIGNMENT_OPERATOR_KINDS.has(n.operatorToken.kind)\n && n.left?.kind === SyntaxKind.Identifier && n.left.text === name) {\n safe = false;\n return;\n }\n n.forEachChild(scanOuter);\n };\n scanOuter(body);\n }\n return safe;\n }\n\n printInlineHelperArithmetic(left, right, leftText, rightText, op) {\n const isPlus = op === SyntaxKind.PlusToken || op === SyntaxKind.PlusEqualsToken;\n const isMinus = op === SyntaxKind.MinusToken || op === SyntaxKind.MinusEqualsToken;\n const isMultiply = op === SyntaxKind.AsteriskToken;\n const isDivide = op === SyntaxKind.SlashToken;\n const isMod = op === SyntaxKind.PercentToken;\n if (!isPlus && !isMinus && !isMultiply && !isDivide && !isMod) {\n return undefined;\n }\n const leftFamily = this.javaScalarFamily(left);\n const rightFamily = this.javaScalarFamily(right);\n if (isPlus && this.javaStringConcatIsProvable(left, right, leftFamily, rightFamily)) {\n const concat = `(${leftText} + ${rightText})`;\n return op === SyntaxKind.PlusEqualsToken ? `${leftText} = ${concat}` : concat;\n }\n // compound assignments keep the helper: the left side is a local the printer\n // declares Object, so the native operator would not compile\n if (op === SyntaxKind.PlusEqualsToken || op === SyntaxKind.MinusEqualsToken) {\n return undefined;\n }\n // `this.milliseconds() - `: the hand-written base call hands back\n // a Long, and Helpers.subtract's Long - Long branch is plain long arithmetic with\n // the same box (Helpers.java), so the helper drops when the right side is long too\n if (op === SyntaxKind.MinusToken) {\n const anchoredKind = this.javaThisCallNumericKind(left);\n if (anchoredKind === 'long' && this.javaProvableNumericKind(right) === 'long') {\n return `(${leftText} - ${this.javaPrintOperandAsLong(right, rightText)})`;\n }\n }\n if (leftFamily !== 'number' || rightFamily !== 'number') {\n return undefined;\n }\n if (op === SyntaxKind.PlusToken) {\n // the widened rule: literals + the non-null numeric proofs this printer owns\n return this.printWidenedNativeAdd(left, right, leftText, rightText);\n }\n if (isMod) {\n // Helpers.mod normalizes both operands to double and returns their double\n // remainder: the same value once both operands print as a non-null Java number\n if (!this.javaProvableNumericDoubleOperand(left) || !this.javaProvableNumericDoubleOperand(right)) {\n return undefined;\n }\n return `(((double) ${leftText}) % ((double) ${rightText}))`;\n }\n if (isMultiply && this.javaLiteralFractionalProduct(left, right)) {\n return `(${leftText} * ${rightText})`;\n }\n // `+` keeps phase-1's literal-only rule (java-13/14 own Add): its operands must not\n // derive from a retyped local anywhere below\n const childAllows = !isPlus;\n const leftKind = this.javaProvableNumericKind(left, childAllows);\n const rightKind = this.javaProvableNumericKind(right, childAllows);\n const pairKind = this.javaNativeArithmeticPairKind(isPlus, isMultiply, isDivide, leftKind, rightKind);\n if (pairKind === undefined) {\n return undefined;\n }\n if (isDivide) {\n // TS `/` is always float division and Helpers.divide never returns a long\n return `(((double) ${leftText}) / ((double) ${rightText}))`;\n }\n const operator = isPlus ? '+' : (isMinus ? '-' : '*');\n const widenedLeft = this.javaPrintArithmeticOperand(leftKind, left, leftText);\n const widenedRight = this.javaPrintArithmeticOperand(rightKind, right, rightText);\n return `(${widenedLeft} ${operator} ${widenedRight})`;\n }\n\n // an Integer/int operand is widened to long before the operator: Helpers normalizes an\n // Integer to Long first, so the native long arithmetic reproduces both the value (no\n // int-width wrap) and the Long box the helper hands back\n javaPrintArithmeticOperand(kind, node, text) {\n if (kind === 'int') {\n return `((long) ${text})`;\n }\n return this.javaPrintOperandAsLong(node, text);\n }\n\n // Helpers.mathMin/mathMax take Object, tolerate null and return the ORIGINAL box; Math.min/max take\n // primitives, so the native call needs both operands primitive of one family: literals, `for`\n // counters, `.length`/`.size()`, native long arithmetic; the only NaN-free double is a literal.\n javaNativeMathMinMaxOperandKind(node) {\n if (this.javaIntegerLiteralKind(node) !== undefined || this.isJavaPrimitiveForCounter(node)\n || (isPropertyAccessExpression(node) && node.name.text === 'length'\n && this.javaLengthKind(node.expression) !== undefined)) {\n return 'integral';\n }\n if (isNumericLiteral(node)) {\n return this.javaProvableNumericKind(node) === 'double' ? 'double' : undefined;\n }\n return this.javaProvableNumericKind(node) === 'long' ? 'integral' : undefined;\n }\n\n // a primitive has no members, so a receiver position (and the printer's cast wrappers) keep the\n // helper - every other position boxes the primitive exactly like the helper's own box (Jackson,\n // isEqual and toString all read an Integer and a Long the same way)\n javaNativeMathMinMaxResultIsPlainValue(node) {\n let parent = node.parent;\n while (parent !== undefined && isParenthesizedExpression(parent)) {\n parent = parent.parent;\n }\n if (parent === undefined) {\n return false;\n }\n if ((isPropertyAccessExpression(parent) || isElementAccessExpression(parent)\n || isCallExpression(parent)) && parent.expression === node) {\n return false;\n }\n return parent.kind !== SyntaxKind.AsExpression\n && parent.kind !== SyntaxKind.TypeAssertionExpression\n && parent.kind !== SyntaxKind.NonNullExpression;\n }\n\n // the native form of Math.min/Math.max, or undefined to keep the helper\n printNativeMathMinMax(node, left, right, leftText, rightText, name) {\n if (!this.javaNativeMathMinMaxResultIsPlainValue(node)) {\n return undefined;\n }\n const kind = this.javaNativeMathMinMaxOperandKind(left);\n if (kind === undefined || kind !== this.javaNativeMathMinMaxOperandKind(right)) {\n return undefined;\n }\n return `Math.${name}(${leftText}, ${rightText})`;\n }\n\n // ---- helper-family inlining: `parseInt/parseFloat/toString/padStart` ----\n // parseInt catches NumberFormatException into null, parseFloat into 0.0, Helpers.toString maps\n // null to null, Helpers.padStart truncates: native form only where the fallback is unreachable.\n\n // `Helpers.toString(x)` is `x == null ? null : x.toString()`, so `String.valueOf(x)`\n // is exact for every argument that cannot be null. Only a numeric literal or a\n // nested `+ - * /` this rule prints natively qualifies: both are Java primitives.\n javaStringBoxText(node, text) {\n return this.javaProvableNumericKind(node) !== undefined ? `String.valueOf(${text})` : `Helpers.toString(${text})`;\n }\n\n // The runtime uses Long.parseLong (parseInt) / Double.parseDouble (parseFloat) inside a catch; a\n // literal the native parser ACCEPTS cannot reach the catch, so the native call cannot change the\n // answer (parseInt additionally needs the value in long range, else the helper answers null).\n javaScalarParseAccepts(callee, text) {\n if (callee === 'parseInt') {\n if (!/^[+-]?[0-9]+$/.test(text)) {\n return false;\n }\n const value = BigInt(text.replace(/^\\+/, ''));\n return value >= BigInt('-9223372036854775808') && value <= BigInt('9223372036854775807');\n }\n // Double.parseDouble's grammar minus the suffix forms; NaN/Infinity are parsed\n // by both, whitespace and hex floats by neither of the two the same way.\n return /^[+-]?([0-9]+(\\.[0-9]*)?|\\.[0-9]+)([eE][+-]?[0-9]+)?$/.test(text)\n || /^[+-]?Infinity$/.test(text)\n || text === 'NaN';\n }\n\n // `parseInt(x)` / `parseFloat(x)` -> the native parse, or undefined to keep the helper\n printNativeScalarParse(node, callee) {\n const args = node?.arguments;\n if (args === undefined || args.length !== 1 || !isStringLiteral(args[0])) {\n return undefined;\n }\n if (!this.javaScalarParseAccepts(callee, args[0].text)) {\n return undefined;\n }\n const nativeName = callee === 'parseInt' ? 'Long.parseLong' : 'Double.parseDouble';\n return `${nativeName}(${this.printNode(args[0], 0)})`;\n }\n\n // The printed receiver of a `padStart` this rule can inline: already cast (`((String)x)`) by the\n // printer or the ccxt local-typing pass, or the checker proves a plain TS string, so the accessor\n // cast this rule adds cannot fire.\n javaPadStartReceiverText(receiver, name) {\n if (/^\\(+\\(String\\)/.test(name)) {\n return name;\n }\n if (this.javaScalarFamily(receiver) === 'string') {\n return `((String)${name})`;\n }\n return undefined;\n }\n\n // `x.padStart(n, 'c')` with a non-negative integer literal length and single-char literal pad.\n // Helpers.padStart pads then answers the LAST `n` chars, so the native form keeps both halves:\n // String.format builds the pad from an empty `%s` and the >= arm reproduces the truncation.\n printNativePadStart(node, name) {\n const args = node?.arguments;\n if (args === undefined || args.length !== 2 || name === undefined) {\n return undefined;\n }\n if (this.javaIntegerLiteralKind(args[0]) !== 'int' || !/^[0-9]+$/.test(args[0].text)) {\n return undefined;\n }\n if (!isStringLiteral(args[1]) || args[1].text.length === 0) {\n return undefined;\n }\n const receiver = node.expression?.expression;\n if (!this.sideEffectFreeReceiver(receiver)) {\n return undefined;\n }\n const receiverText = this.javaPadStartReceiverText(receiver, name);\n if (receiverText === undefined) {\n return undefined;\n }\n const length = args[0].text;\n const pad = `'${this.javaCharLiteral(args[1].text[0])}'`;\n const lengthCall = `${receiverText}.length()`;\n return `(${lengthCall} >= ${length} ? ${receiverText}.substring(${lengthCall} - ${length})`\n + ` : String.format(\"%\" + (${length} - ${lengthCall}) + \"s\", \"\").replace(' ', ${pad}) + ${receiverText})`;\n }\n\n // one char literal for the `String.format(...).replace(' ', c)` pad, escaped\n javaCharLiteral(character) {\n if (character === \"'\" || character === '\\\\') {\n return `\\\\${character}`;\n }\n return character;\n }\n\n // ---- typed locals for native arithmetic ----\n // A local whose initializer prints as native arithmetic holds a String / Long / Double box, so the\n // declaration carries that type; every other use is scanned first (D2) as it changes resolution.\n\n javaUnwrapParentheses(node) {\n let current = node;\n while (current?.kind === SyntaxKind.ParenthesizedExpression) {\n current = current.expression;\n }\n return current;\n }\n\n // the Java type of the native arithmetic this printer prints for a `+ - * / +=`\n // node, or undefined when the node keeps the helper (its printed value is an\n // Object box). Mirrors printInlineHelperArithmetic operand-for-operand.\n javaNativeArithmeticType(node) {\n const value = this.javaUnwrapParentheses(node);\n if (value?.kind !== SyntaxKind.BinaryExpression) {\n return undefined;\n }\n const op = value.operatorToken.kind;\n if (op === SyntaxKind.PlusToken && this.javaNativeConcat(value)) {\n return 'String';\n }\n if (op === SyntaxKind.PlusEqualsToken) {\n // the inlined `x = (x + y)` shape needs the same operand pair the concat\n // branch of printInlineHelperArithmetic needs\n const isStringPair = this.javaScalarFamily(value.left) === 'string'\n && this.javaScalarFamily(value.right) === 'string'\n && (this.javaProvableString(value.left) || this.javaProvableString(value.right));\n return isStringPair ? 'String' : undefined;\n }\n const kind = this.javaNativeArithmeticKind(value);\n return kind === 'long' ? 'Long' : (kind === 'double' ? 'Double' : undefined);\n }\n\n // the enclosing function-like node: the D2 scan scope of a typed local\n javaEnclosingFunction(node) {\n let current = node?.parent;\n while (current !== undefined) {\n const kind = current.kind;\n if (kind === SyntaxKind.MethodDeclaration || kind === SyntaxKind.FunctionDeclaration\n || kind === SyntaxKind.FunctionExpression || kind === SyntaxKind.ArrowFunction\n || kind === SyntaxKind.GetAccessor || kind === SyntaxKind.SetAccessor\n || kind === SyntaxKind.Constructor) {\n return current;\n }\n current = current.parent;\n }\n return undefined;\n }\n\n // a reassignment may keep the narrowed declaration only when its printed value is the\n // same Java type (the helper's box stays an Object, so it keeps the box)\n javaArithmeticWriteIsSafe(right, javaType) {\n const value = this.javaUnwrapParentheses(right);\n if (value === undefined) {\n return false;\n }\n if (value.kind === SyntaxKind.NullKeyword) {\n return true; // `null` is assignable to every box\n }\n if (value.kind === SyntaxKind.Identifier && value.text === 'undefined') {\n return true;\n }\n return (javaType === 'String' && (value.kind === SyntaxKind.StringLiteral\n || value.kind === SyntaxKind.NoSubstitutionTemplateLiteral))\n || this.javaNativeArithmeticType(value) === javaType;\n }\n\n // the innermost block that scopes a declaration (Java locals live to the end of\n // their block; sibling blocks may reuse the name, nested ones may not)\n javaScopingBlock(node) {\n let current = node?.parent;\n let last = undefined;\n while (current !== undefined) {\n if (current.kind === SyntaxKind.Block || current.kind === SyntaxKind.SourceFile) {\n return current;\n }\n last = current;\n current = current.parent;\n }\n return last;\n }\n\n javaNodeContains(outer, inner) {\n return outer !== undefined && inner !== undefined && outer.pos <= inner.pos && inner.end <= outer.end;\n }\n\n // two same-named bindings may both keep their own printed type only in disjoint\n // blocks: a nested one would already be an illegal Java shadowing of the Object\n // declaration the corpus compiles with\n javaBindingsAreDisjoint(declaration, other) {\n const mine = this.javaScopingBlock(declaration);\n const theirs = this.javaScopingBlock(other);\n if (mine === undefined || theirs === undefined) {\n return false;\n }\n return !this.javaNodeContains(mine, theirs) && !this.javaNodeContains(theirs, mine);\n }\n\n // is this occurrence of the local compatible with the narrowed declaration?\n javaArithmeticLocalUseIsSafe(node, declaration, javaType) {\n const parent = node.parent;\n if (parent === undefined) {\n return false;\n }\n if ((parent.kind === SyntaxKind.PropertyAccessExpression || parent.kind === SyntaxKind.PropertyAssignment)\n && parent.name === node) {\n return true; // a member name, not a use of the local\n }\n if ((parent.kind === SyntaxKind.VariableDeclaration || parent.kind === SyntaxKind.Parameter\n || parent.kind === SyntaxKind.BindingElement) && parent.name === node) {\n // a second binding of the same source name: only a disjoint sibling block may\n // keep its own type (no shadowing of the narrowed declaration)\n return this.javaBindingsAreDisjoint(declaration, parent);\n }\n if (parent.kind === SyntaxKind.PostfixUnaryExpression || parent.kind === SyntaxKind.PrefixUnaryExpression) {\n return false; // ++/--/-x/+x print an unboxing or primitive operator\n }\n if (parent.kind === SyntaxKind.SpreadElement || parent.kind === SyntaxKind.DeleteExpression\n || parent.kind === SyntaxKind.ForOfStatement || parent.kind === SyntaxKind.ForInStatement) {\n return false;\n }\n if (parent.kind === SyntaxKind.TypeOfExpression) {\n // prints \\`x instanceof String\\`, the same test the Object declaration printed\n return javaType === 'String';\n }\n if (parent.kind === SyntaxKind.AsExpression || parent.kind === SyntaxKind.TypeAssertionExpression) {\n // \\`x as string\\` prints the identity ((String) x); any other asserted type\n // prints a cast the narrower declaration cannot satisfy\n return javaType === 'String' && parent.type?.kind === SyntaxKind.StringKeyword;\n }\n if (parent.kind === SyntaxKind.ConditionalExpression) {\n // a numeric arm next to a numeric arm makes the conditional numeric and javac\n // unboxes it (an NPE where the Object declaration carried null)\n return javaType === 'String';\n }\n if (parent.kind === SyntaxKind.ElementAccessExpression && parent.expression === node) {\n const grand = parent.parent;\n if (grand?.kind === SyntaxKind.DeleteExpression) {\n return false;\n }\n if (grand?.kind === SyntaxKind.BinaryExpression && grand.left === parent\n && JAVA_ASSIGNMENT_OPERATOR_KINDS.has(grand.operatorToken.kind)) {\n return false; // `x[k] = v` prints a receiver cast the box cannot satisfy\n }\n }\n if (parent.kind === SyntaxKind.ArrayLiteralExpression) {\n const grand = parent.parent;\n if (grand?.kind === SyntaxKind.BinaryExpression && grand.left === parent\n && JAVA_ASSIGNMENT_OPERATOR_KINDS.has(grand.operatorToken.kind)) {\n return false; // `[x, y] = f()` prints a destructuring write into the local\n }\n }\n if (parent.kind === SyntaxKind.BinaryExpression && parent.left === node) {\n const op = parent.operatorToken.kind;\n if (op === SyntaxKind.EqualsToken) {\n return this.javaArithmeticWriteIsSafe(parent.right, javaType);\n }\n if (op === SyntaxKind.PlusEqualsToken) {\n // `x += y` prints a native `x = (x + y)` or the Object-typed helper\n return this.javaNativeArithmeticType(parent) === javaType;\n }\n if (JAVA_ASSIGNMENT_OPERATOR_KINDS.has(op)) {\n return false; // every other compound assignment writes a helper result\n }\n if (op === SyntaxKind.PlusToken && javaType === 'String') {\n // the overload trap: once the local is String, a printed Helpers.add(local, y)\n // binds add(String, Object) instead of add(Object, Object), and the two\n // diverge for a non-string y. A printed native concat has no helper call.\n return this.javaNativeArithmeticType(parent) === 'String';\n }\n }\n return true;\n }\n\n // D2: the narrowed declaration needs every later use of the local in the enclosing\n // function to still compile and resolve the way the Object declaration did\n javaArithmeticLocalIsSafeToType(scope, declaration, javaType) {\n if (scope === undefined) {\n return false;\n }\n const sourceName = declaration.name.text;\n let safe = true;\n const visit = (n) => {\n if (!safe) {\n return;\n }\n if (n.kind === SyntaxKind.Identifier && n.text === sourceName && n !== declaration.name) {\n if (!this.javaArithmeticLocalUseIsSafe(n, declaration, javaType)) {\n safe = false;\n return;\n }\n }\n n.forEachChild(visit);\n };\n scope.forEachChild(visit);\n return safe;\n }\n\n // the Java type a declaration can carry because its initializer prints as native\n // arithmetic, or undefined to keep the Object declaration\n javaArithmeticLocalType(declaration) {\n if (!isIdentifier(declaration.name) || declaration.initializer === undefined) {\n return undefined;\n }\n const javaType = this.javaNativeArithmeticType(declaration.initializer);\n if (javaType === undefined) {\n return undefined;\n }\n const scope = this.javaEnclosingFunction(declaration);\n return this.javaArithmeticLocalIsSafeToType(scope, declaration, javaType)\n ? javaType : undefined;\n }\n\n // an operand `(double) ` can be applied to without changing what Helpers.mod\n // computes: a numeric literal or a native arithmetic node (javaProvableNumericKind,\n // already printed as a java number) or a primitive int loop counter\n javaProvableNumericDoubleOperand(node) {\n return this.javaProvableNumericKind(node) !== undefined || this.javaProvableCounterInt(node);\n }\n\n getFinalVarName(varName: string): string {\n varName = this.getOriginalVarName(varName);\n if (varName.startsWith('final')) {\n return varName;\n }\n return `final${this.capitalize(varName)}`;\n }\n\n getOriginalVarName(name: string): string {\n if (this.ReservedKeywordsReplacements[name]) {\n name = this.ReservedKeywordsReplacements[name];\n }\n return name;\n }\n\n // Resolves the trio of names used to wrap a reassigned async-method param\n // so the lambda body sees an effectively-final local. We base every name on\n // the keyword-remapped Java identifier — using the raw TS name when remapped\n // (e.g. params -> parameters) makes the wrapper text and the body diverge,\n // because identifier emission already routes through ReservedKeywordsReplacements.\n private getAsyncParamWrapperNames(paramName: string): { sigName: string; snapName: string; localName: string } {\n const javaName = this.getOriginalVarName(paramName);\n return {\n sigName: `${javaName}2`,\n snapName: `${javaName}3`,\n localName: javaName,\n };\n }\n\n private isAssignmentOperator(op: SyntaxKind): boolean {\n return op >= SyntaxKind.FirstAssignment && op <= SyntaxKind.LastAssignment;\n }\n\n private isIncDecOperator(op: SyntaxKind): boolean {\n return op === SyntaxKind.PlusPlusToken || op === SyntaxKind.MinusMinusToken;\n }\n\n // Walk the function body in source order and assign a version-aware finalName to\n // every identifier that appears inside an object literal property and refers to a\n // variable that's reassigned anywhere in this function. Each reassignment bumps the\n // per-variable version counter; usages of the same (var, version) share one finalName.\n //\n // Naming:\n // - If only one version of a var is ever used in object literals, use `final`\n // (matches prior behavior).\n // - If multiple versions are used, name them `final`, `final_2`,\n // `final_3` in source-order of the version they correspond to.\n analyzeFinalVars(fnBody: Node): void {\n this.usageToFinalName = new WeakMap();\n if (!fnBody) return;\n\n // Symbol identity: two identifiers are the same lexical variable iff they\n // resolve to the same declaration. This differentiates e.g. `i` in two\n // sibling for-loops (separate `let i` declarations = separate symbols).\n const symbolIdOf = (n: any): string => {\n try {\n const checker = this.getChecker();\n const sym = checker?.getSymbolAtLocation?.(n);\n const decl = sym?.declarations?.[0]?.resolve() ?? sym?.valueDeclaration?.resolve();\n if (decl) return `s:${decl.pos}:${decl.end}`;\n } catch {\n // checker may be unavailable in some contexts — fall through to name-based id\n }\n return `n:${n.text}`;\n };\n\n // Pass 1 — discover which symbols the printer will treat as reassigned.\n //\n // The printer's `printCustomBinaryExpressionIfAny` sets\n // `ReassignedVars[varKey] = true` for the LEFT identifier of *every*\n // BinaryExpression — not just assignment operators. So `timestamp + '#'`\n // or `x === 5` will both flag `timestamp`/`x` later during emit, even\n // though they're plain reads syntactically. The printer's substitution\n // path then uses ReassignedVars as a fallback trigger for the finalXxx\n // rewrite, so a literal capturing such an identifier ends up referring\n // to `finalTimestamp` even when the analyzer thinks the symbol isn't\n // reassigned.\n //\n // If the analyzer disagrees with the printer here, the printer's\n // fallback substitution uses the un-suffixed base name for *every* use\n // (including in sibling if/else branches), and any environment with\n // ancestor-scope dedup leak will suppress one of the two declarations.\n //\n // Mirror the printer's over-broad heuristic in the analyzer so the\n // version-bump machinery (a5c2036 / ac618b0 / 48a1786) can assign\n // distinct names to sibling and post-block uses.\n const reassignedSyms = new Set();\n const discoverPotentialReassignments = (node: any) => {\n if (!node) return;\n if (node.kind === SyntaxKind.BinaryExpression) {\n if (node.left?.kind === SyntaxKind.Identifier) {\n // Mirror printCustomBinaryExpressionIfAny: any BinaryExpression\n // with an Identifier left flags it, regardless of operator.\n reassignedSyms.add(symbolIdOf(node.left));\n } else if (\n node.operatorToken.kind === SyntaxKind.EqualsToken &&\n node.left?.kind === SyntaxKind.ArrayLiteralExpression\n ) {\n // Tuple destructuring assignment: `[a, b] = expr`. The printer's\n // ArrayLiteralExpression branch in printCustomBinaryExpressionIfAny\n // flags each Identifier element in ReassignedVars, so mirror it\n // here for version-bump coverage.\n for (const elem of node.left.elements ?? []) {\n if (elem?.kind === SyntaxKind.Identifier) {\n reassignedSyms.add(symbolIdOf(elem));\n }\n }\n }\n }\n if ((node.kind === SyntaxKind.PrefixUnaryExpression ||\n node.kind === SyntaxKind.PostfixUnaryExpression) &&\n this.isIncDecOperator(node.operator) &&\n node.operand?.kind === SyntaxKind.Identifier) {\n reassignedSyms.add(symbolIdOf(node.operand));\n }\n // Cross-call / cross-method state leak: ReassignedVars accumulates\n // across transpile calls and earlier-printed methods in the same\n // class+method context, so a var declared `const` in this function\n // body may still be flagged from a prior context. The printer's\n // substitution path consults ReassignedVars as a fallback; if the\n // analyzer disagrees, version-bump can't apply and sibling if/else\n // branches end up with the same base name.\n if (node.kind === SyntaxKind.Identifier) {\n const name = node.text as string | undefined;\n if (name && name !== 'undefined' && !name.startsWith?.('null')) {\n if (this.ReassignedVars[this.getVarKey(node)]) {\n reassignedSyms.add(symbolIdOf(node));\n }\n }\n return;\n }\n node.forEachChild(discoverPotentialReassignments);\n };\n discoverPotentialReassignments(fnBody);\n\n if (reassignedSyms.size === 0) return;\n\n // Pass 2 — walk in source order, producing a stream of reassignment and usage\n // events keyed by symbol. Usages are identifiers that (a) sit inside an\n // object literal property initializer expression, (b) refer to a reassigned symbol.\n type Event =\n | { kind: 'reassign'; sym: string }\n | { kind: 'use'; sym: string; name: string; node: Node };\n const events: Event[] = [];\n\n const visitExprInObjLit = (n: any) => {\n if (!n) return;\n if (n.kind === SyntaxKind.Identifier) {\n const name = n.text as string;\n if (name && name !== 'undefined' && !name.startsWith?.('null')) {\n const sym = symbolIdOf(n);\n if (reassignedSyms.has(sym)) {\n events.push({ kind: 'use', sym, name, node: n });\n }\n }\n return;\n }\n if (n.kind === SyntaxKind.BinaryExpression) {\n visitExprInObjLit(n.left);\n visitExprInObjLit(n.right);\n return;\n }\n if (n.kind === SyntaxKind.ParenthesizedExpression) {\n visitExprInObjLit(n.expression);\n return;\n }\n if (n.kind === SyntaxKind.ConditionalExpression) {\n visitExprInObjLit(n.condition);\n visitExprInObjLit(n.whenTrue);\n visitExprInObjLit(n.whenFalse);\n return;\n }\n if (n.kind === SyntaxKind.CallExpression) {\n n.arguments?.forEach(visitExprInObjLit);\n if (n.expression?.kind === SyntaxKind.PropertyAccessExpression) {\n visitExprInObjLit(n.expression.expression);\n }\n return;\n }\n if (n.kind === SyntaxKind.PrefixUnaryExpression) {\n visitExprInObjLit(n.operand);\n return;\n }\n if (n.kind === SyntaxKind.ElementAccessExpression) {\n let left = n.expression;\n while (left?.kind === SyntaxKind.ElementAccessExpression) {\n left = left.expression;\n }\n visitExprInObjLit(left);\n visitExprInObjLit(n.argumentExpression);\n return;\n }\n if (n.kind === SyntaxKind.ObjectLiteralExpression) {\n n.properties?.forEach((p: any) => {\n if (p.initializer) visitExprInObjLit(p.initializer);\n });\n return;\n }\n // Fallback for any other expression kind (ArrayLiteralExpression,\n // SpreadElement, TemplateExpression, AsExpression, NonNullExpression,\n // PropertyAccessExpression, TypeAssertion, etc.) — descend uniformly\n // so identifiers nested inside `[rawHash]`, `{...x}`, `` `${x}` ``, and\n // so on are still tagged. ObjectLiteralExpression is handled above so\n // it doesn't fall through to the generic descent (which would re-walk\n // the same prop initializers and double-count).\n n.forEachChild(visitExprInObjLit);\n };\n\n const walk = (node: any) => {\n if (!node) return;\n\n if (node.kind === SyntaxKind.BinaryExpression &&\n this.isAssignmentOperator(node.operatorToken.kind)) {\n walk(node.right);\n if (node.left?.kind === SyntaxKind.Identifier) {\n const sym = symbolIdOf(node.left);\n if (reassignedSyms.has(sym)) {\n events.push({ kind: 'reassign', sym });\n }\n } else {\n walk(node.left);\n }\n return;\n }\n\n if ((node.kind === SyntaxKind.PrefixUnaryExpression ||\n node.kind === SyntaxKind.PostfixUnaryExpression) &&\n this.isIncDecOperator(node.operator) &&\n node.operand?.kind === SyntaxKind.Identifier) {\n const sym = symbolIdOf(node.operand);\n if (reassignedSyms.has(sym)) {\n events.push({ kind: 'reassign', sym });\n }\n return;\n }\n\n if (node.kind === SyntaxKind.ObjectLiteralExpression) {\n node.properties?.forEach((prop: any) => {\n if (prop.initializer) {\n visitExprInObjLit(prop.initializer);\n walk(prop.initializer);\n }\n });\n return;\n }\n\n // If/else branches introduce sibling scopes for declarations inside\n // them. Without intervention, the analyzer assigns the same per-symbol\n // version to uses across siblings and to uses after the branch.\n // Java permits sibling-scope name reuse when the inner block has\n // popped, but ancestor-scope dedup in buildFinalVarDeclarations +\n // any scope tracking leak in the consumer environment can suppress\n // the outer declaration, leaving an undeclared reference.\n //\n // The helper below records 'use' events inside a sub-block and emits\n // a phantom reassign on exit for every symbol used inside, so each\n // region gets a distinct per-symbol version → distinct finalXxx name.\n const walkBlockAndBump = (subNode: Node | undefined): Set => {\n const usedInBlock = new Set();\n if (!subNode) return usedInBlock;\n const eventsBefore = events.length;\n walk(subNode);\n for (let i = eventsBefore; i < events.length; i++) {\n const e = events[i];\n if (e.kind === 'use') usedInBlock.add(e.sym);\n }\n for (const sym of usedInBlock) {\n events.push({ kind: 'reassign', sym });\n }\n return usedInBlock;\n };\n\n if (node.kind === SyntaxKind.IfStatement) {\n walk(node.expression);\n walkBlockAndBump(node.thenStatement);\n walkBlockAndBump(node.elseStatement);\n // After walking either branch we've already bumped for every\n // symbol used inside it, so post-if uses naturally land on a\n // version higher than either branch's uses.\n return;\n }\n\n // try / catch / finally: catch is a sibling scope to try; finally\n // executes after both. Treat each block the same way as if/else\n // branches so captures across them get distinct snapshot names.\n if (node.kind === SyntaxKind.TryStatement) {\n walkBlockAndBump(node.tryBlock);\n walkBlockAndBump(node.catchClause?.block);\n walkBlockAndBump(node.finallyBlock);\n return;\n }\n\n node.forEachChild(walk);\n };\n\n walk(fnBody);\n\n // Post-process: compute per-symbol versions and assign final names. The\n // final name is derived from the identifier's text, not the symbol — so\n // two distinct symbols named `i` both get `finalI` (each lives in its own\n // lexical scope, so scope-stack dedup allows both to be emitted).\n const counters = new Map();\n const perSym = new Map }>();\n for (const e of events) {\n if (e.kind === 'reassign') {\n counters.set(e.sym, (counters.get(e.sym) ?? 0) + 1);\n } else {\n const v = counters.get(e.sym) ?? 0;\n if (!perSym.has(e.sym)) perSym.set(e.sym, { name: e.name, byVer: new Map() });\n const entry = perSym.get(e.sym)!;\n if (!entry.byVer.has(v)) entry.byVer.set(v, []);\n entry.byVer.get(v)!.push(e.node);\n }\n }\n\n for (const { name, byVer } of perSym.values()) {\n const versions = [...byVer.keys()].sort((a, b) => a - b);\n const baseName = this.getFinalVarName(name);\n versions.forEach((v, idx) => {\n const finalName = idx === 0 ? baseName : `${baseName}_${idx + 1}`;\n for (const n of byVer.get(v)!) {\n this.usageToFinalName.set(n, finalName);\n }\n });\n }\n }\n\n // Undo every in-place identifier rewrite made during the current emit, newest\n // first so repeated rewrites of one node unwind to the original value.\n restoreFinalVarMutations(): void {\n for (let i = this.finalVarMutations.length - 1; i >= 0; i--) {\n const mutation = this.finalVarMutations[i];\n Object.defineProperty(mutation.node, 'text', { value: mutation.text, configurable: true, writable: true });\n if (mutation.ownGetFullText) {\n mutation.node.getFullText = mutation.getFullText;\n } else {\n delete mutation.node.getFullText;\n }\n }\n this.finalVarMutations = [];\n }\n\n printNode(node, identation = 0): string {\n if (node && node.kind === SyntaxKind.SourceFile) {\n // Everything below influences emitted text and outlives a single\n // transpile call (the transpiler instance and the parsed SourceFile are\n // both reused), so reset it per file: an emit must not be able to tell\n // whether it is the first or the tenth for the same input.\n this.restoreFinalVarMutations();\n this.ReassignedVars = {};\n this.varListFromObjectLiterals = {};\n this.usageToFinalName = new WeakMap();\n this.finalVarScopeStack = [];\n try {\n return super.printNode(node, identation);\n } finally {\n this.restoreFinalVarMutations();\n }\n }\n return super.printNode(node, identation);\n }\n\n // true when a property value reads a local the body reassigns (or the analyzer saw\n // reassigned ahead): a double-brace anonymous class could not capture it\n objectLiteralCapturesReassigned(node): boolean {\n return this.objectLiteralCapturedKeys(node).length > 0;\n }\n\n // ReassignedVars keys of the reassigned locals a literal's property values read\n objectLiteralCapturedKeys(node): string[] {\n const keys: string[] = [];\n const walk = (n) => {\n if (!n) return;\n if (n.kind === SyntaxKind.Identifier) {\n const name = n.text as string | undefined;\n const key = this.getVarKey(n);\n if (name && name !== 'undefined' && !name.startsWith('null') &&\n (this.usageToFinalName.has(n) || this.ReassignedVars[key])) {\n keys.push(key);\n }\n return;\n }\n n.forEachChild(walk);\n };\n for (const prop of node.properties) {\n walk(prop.initializer);\n }\n return keys;\n }\n\n printVariableDeclarationList(node, identation) {\n const declaration = node.declarations[0];\n\n if (\n this.removeVariableDeclarationForFunctionExpression &&\n declaration?.initializer &&\n isFunctionExpression(declaration.initializer)\n ) {\n return this.printNode(declaration.initializer, identation).trimEnd();\n }\n\n // array destructuring in variable declaration\n if (declaration?.name.kind === SyntaxKind.ArrayBindingPattern) {\n const arrayBindingPattern = declaration.name;\n const arrayBindingPatternElements = arrayBindingPattern.elements;\n const parsedArrayBindingElements = arrayBindingPatternElements.map((e) =>\n this.printNode(e.name, 0)\n );\n const syntheticName = parsedArrayBindingElements.join(\"\") + \"Variable\";\n\n const arrayBindingStatement =\n `${this.getIden(identation)}var ${syntheticName} = ${this.printNode(\n declaration.initializer,\n 0\n )};\\n`;\n\n return arrayBindingStatement + parsedArrayBindingElements.map((e, index) =>\n this.getIden(identation) + `var ${e} = ((java.util.List) ${syntheticName}).get(${index})`\n ).join(\";\\n\");\n }\n\n const isNew =\n declaration?.initializer &&\n declaration.initializer.kind === SyntaxKind.NewExpression;\n let varToken = isNew ? \"var \" : this.VAR_TOKEN + \" \";\n if (!isNew) {\n // a native-arithmetic initializer prints a String/Long/Double value: the\n // declaration can name that type instead of Object (D3, scanned by java-31)\n const arithmeticType = this.javaArithmeticLocalType(declaration);\n if (arithmeticType !== undefined) {\n varToken = arithmeticType + \" \";\n }\n }\n\n // handle `let x;`\n if (!declaration.initializer) {\n return (\n this.getIden(identation) +\n \"Object \" +\n this.printNode(declaration.name) +\n \" = \" +\n this.UNDEFINED_TOKEN\n );\n }\n\n const parsedValue = this.printNode(declaration.initializer, identation).trimStart();\n if (parsedValue === this.UNDEFINED_TOKEN) {\n let specificVarToken = \"Object\";\n if (this.INFER_VAR_TYPE) {\n const variableType = this.getChecker().typeToString(\n this.getChecker().getTypeAtLocation(declaration)\n );\n if (this.VariableTypeReplacements[variableType]) {\n specificVarToken = this.VariableTypeReplacements[variableType];\n }\n }\n return (\n this.getIden(identation) +\n specificVarToken +\n \" \" +\n this.printNode(declaration.name) +\n \" = \" +\n parsedValue\n );\n }\n return (\n this.getIden(identation) +\n varToken +\n this.printNode(declaration.name) +\n \" = \" +\n parsedValue\n );\n }\n\n printThisKeyword(node, identation) {\n\n let current = node?.parent;\n while (current) {\n if (current.kind === SyntaxKind.PropertyAssignment &&\n !this.builderObjectLiterals.has(current.parent)) {\n const className = this.currentClassName;\n return `${this.capitalize(className)}.this`;\n }\n current = current?.parent;\n }\n // if this.x() is inside a object a object literal and we need to add the class name\n return this.THIS_TOKEN;\n }\n\n transformPropertyAcessExpressionIfNeeded(node) {\n const expression = node.expression;\n\n const leftSide = this.printNode(expression, 0);\n const rightSide = node.name.text;\n\n let rawExpression = undefined;\n\n switch (rightSide) {\n case \"length\": {\n const type = (this.getChecker() as Checker).getTypeAtLocation(\n expression\n );\n this.warnIfAnyType(node, (type as any).flags, leftSide, \"length\");\n rawExpression = this.printJavaLength(expression, leftSide);\n break;\n }\n case \"push\":\n rawExpression = `((java.util.List)${leftSide}).add`;\n break;\n }\n return rawExpression;\n }\n\n printCustomDefaultValueIfNeeded(node) {\n if (\n isArrayLiteralExpression(node) ||\n isObjectLiteralExpression(node) ||\n isStringLiteral(node) ||\n isBooleanLiteral(node) ||\n isNumericLiteral(node)\n ) {\n return this.UNDEFINED_TOKEN;\n }\n\n if (\n node?.text === \"undefined\" &&\n this.getChecker().getTypeAtLocation(node?.parent)?.flags ===\n TypeFlags.Number\n ) {\n return this.UNDEFINED_TOKEN;\n }\n\n return undefined;\n }\n\n // Unpacks one optional parameter. Native array access replaces Helpers.getArg\n // when the initializer is a pure literal; the null check keeps the helper's\n // contract that a null varargs array reads like an empty one.\n // The expression half is shared with the untyped front, which passes the same value to the\n // typed core as an argument instead of binding a local.\n printOptionalArgExpression(index, initializer) {\n const defaultValue = this.printNode(initializer, 0);\n if (!this.isPureInitializer(initializer)) {\n return `Helpers.getArg(optionalArgs, ${index}, ${defaultValue})`;\n }\n return `optionalArgs != null && optionalArgs.length > ${index} ? optionalArgs[${index}] : ${defaultValue}`;\n }\n\n printOptionalArgInit(paramName, index, initializer) {\n return `Object ${paramName} = ${this.printOptionalArgExpression(index, initializer)};`;\n }\n\n // Pure = evaluating the initializer has no effect and cannot throw, so\n // skipping it when the argument was supplied cannot change behavior.\n isPureInitializer(node) {\n switch (node?.kind) {\n case SyntaxKind.NullKeyword:\n case SyntaxKind.TrueKeyword:\n case SyntaxKind.FalseKeyword:\n case SyntaxKind.StringLiteral:\n case SyntaxKind.NoSubstitutionTemplateLiteral:\n case SyntaxKind.NumericLiteral:\n return true;\n case SyntaxKind.Identifier:\n // `= undefined` prints as null; any other name could be a call result\n return node.text === 'undefined';\n case SyntaxKind.ArrayLiteralExpression:\n return node.elements.every((element) => this.isPureInitializer(element));\n case SyntaxKind.ObjectLiteralExpression:\n return node.properties.every((property) => isPropertyAssignment(property) && this.isPureInitializer(property.initializer));\n case SyntaxKind.ParenthesizedExpression:\n case SyntaxKind.AsExpression:\n case SyntaxKind.TypeAssertionExpression:\n case SyntaxKind.NonNullExpression:\n return this.isPureInitializer(node.expression);\n default:\n return false;\n }\n }\n\n // a literal-defaulted parameter is read as `Objects.requireNonNullElse(x, )`: a dynamic\n // caller pads omitted slots with null, and the parameter stays final with no local copy\n javaDefaultedLocalNames: Map = new Map();\n\n javaDefaultedParameterLocals(node): string[] {\n if (node.body === undefined) {\n return [];\n }\n const types = this.javaCoreParameterTypes(node);\n node.parameters.forEach((param, i) => {\n if (!this.javaIsLiteralDefault(param.initializer) || !isIdentifier(param.name)) {\n return;\n }\n const symbol = this.javaSymbolOf(param.name);\n if (symbol === undefined) {\n return;\n }\n const name = this.printNode(param.name, 0);\n const value = this.javaCoreDefaultArgument(param, types[i]);\n this.javaDefaultedLocalNames.set(symbol, `java.util.Objects.requireNonNullElse(${name}, ${value})`);\n });\n return [];\n }\n\n // a string, number or boolean literal default (null, `undefined` and `{}` / `[]` keep the parameter)\n javaIsLiteralDefault(initializer): boolean {\n let node = initializer;\n while (node !== undefined && (isParenthesizedExpression(node) || isAsExpression(node))) {\n node = node.expression;\n }\n if (node !== undefined && isPrefixUnaryExpression(node) && node.operator === SyntaxKind.MinusToken) {\n node = node.operand;\n }\n return node !== undefined && (isStringLiteralLikeNode(node) || isNumericLiteral(node)\n || node.kind === SyntaxKind.TrueKeyword || node.kind === SyntaxKind.FalseKeyword);\n }\n\n javaDefaultedLocalName(node): string | undefined {\n if (this.javaDefaultedLocalNames.size === 0 || isParameterDeclaration(node.parent)\n || (isPropertyAccessExpression(node.parent) && node.parent.name === node)\n || isPropertyAssignment(node.parent) && node.parent.name === node) {\n return undefined;\n }\n let symbol;\n try {\n symbol = this.getChecker().getSymbolAtLocation(node);\n } catch (e) {\n return undefined;\n }\n return symbol === undefined ? undefined : this.javaDefaultedLocalNames.get(symbol);\n }\n\n printFunctionBody(node, identation) {\n // Save/restore rather than clobber: a nested function re-enters this method\n // and must not destroy the enclosing body's analysis state on the way out.\n const savedVarList = this.varListFromObjectLiterals;\n const savedUsageToFinalName = this.usageToFinalName;\n const savedScopeStack = this.finalVarScopeStack;\n this.varListFromObjectLiterals = {};\n this.analyzeFinalVars(node.body);\n this.finalVarScopeStack = [new Set()];\n const funcParams = node.parameters ?? [];\n const bodyStatements = node.body.statements;\n const isAsync = this.isAsyncFunction(node);\n // a method's default-valued parameters are parameters of its typed signature: no unpack locals\n const splitCore = isMethodDeclaration(node);\n const initParams = splitCore ? this.javaDefaultedParameterLocals(node) : [];\n const processedParts = [];\n try {\n for (let i = 0; i < bodyStatements.length; i++) {\n processedParts.push(this.printNode(bodyStatements[i], identation + 1));\n }\n } finally {\n this.varListFromObjectLiterals = savedVarList;\n this.usageToFinalName = savedUsageToFinalName;\n this.finalVarScopeStack = savedScopeStack;\n }\n let firstStatement = processedParts[0] || '';\n const remainingString = processedParts.slice(1).join(\"\\n\");\n let offSetIndex = 0;\n funcParams.forEach((param, i) => {\n const initializer = param.initializer;\n if (initializer) {\n if (splitCore) {\n if (!this.isPureInitializer(initializer) && !this.javaDefaultedLocalNames.has(this.javaSymbolOf(param.name))) {\n const name = this.printNode(param.name, 0);\n initParams.push(`if (${name} == null) { ${name} = ${this.printNode(initializer, 0)}; }`);\n }\n return; // the value arrives as a parameter of the typed signature\n }\n const index = i + offSetIndex;\n // index = index < 0 ? 0 : i - 1;\n const paramName = this.printNode(param.name, 0);\n initParams.push(this.printOptionalArgInit(paramName, index, initializer));\n } else {\n offSetIndex--;\n }\n });\n\n if (initParams.length > 0) {\n const defaultInitializers =\n initParams.map((l) => this.getIden(identation + 1) + l).join(\"\\n\") +\n \"\\n\";\n const bodyParts = firstStatement.split(\"\\n\");\n const commentPart = bodyParts.filter((line) => this.isComment(line));\n const isComment = commentPart.length > 0;\n if (isComment) {\n const commentPartString = commentPart\n .map((c) => this.getIden(identation + 1) + c.trim())\n .join(\"\\n\");\n const firstStmNoComment = bodyParts\n .filter((line) => !this.isComment(line))\n .join(\"\\n\");\n firstStatement =\n commentPartString + \"\\n\" + defaultInitializers + firstStmNoComment;\n } else {\n firstStatement = defaultInitializers + firstStatement;\n }\n }\n const blockOpen = this.getBlockOpen(identation);\n const blockClose = this.getBlockClose(identation);\n firstStatement = remainingString.length > 0 ? firstStatement + \"\\n\" : firstStatement;\n\n if (isAsync && isMethodDeclaration(node) && this.javaReassignsParameter(node)) {\n // unsupported: a lambda cannot capture a reassigned parameter; the TS source must not reassign it\n const where = `${node.getSourceFile().fileName}:${(node.name as any).text}`;\n this.javaReassigningMethods.push(where);\n const message = `[Java] async method reassigns a parameter (not effectively final, the TS source must use a new local): ${where}`;\n if (this.javaStrictEffectivelyFinal) {\n throw new Error(message);\n }\n Logger.warning(message);\n }\n if (isAsync) {\n const finalWrapperVars = isMethodDeclaration(node) ? '\\n' : this.printFinalOutsideMethodVariableWrappersIfAny(node, identation) + \"\\n\";\n const insideWrappers = isMethodDeclaration(node) ? '\\n' : this.printInsideMethodVariableWrappersIfAny(node, identation + 1) + \"\\n\";\n const body = (firstStatement + remainingString).split(\"\\n\").map(line => this.getIden(identation) + line).join(\"\\n\");\n // Check if last statement is a return — if not, add return null for supplyAsync lambda\n const lastStatement = bodyStatements.length > 1 ? bodyStatements[bodyStatements.length - 1] : (bodyStatements.length > 0 ? bodyStatements[0] : undefined);\n const lastStmtIsReturn = lastStatement && (isReturnStatement(lastStatement) || this.allBranchesTerminate(lastStatement));\n const returnNull = lastStmtIsReturn ? \"\" : (this.getIden(identation + 2) + \"return null;\\n\");\n const supplier = this.asyncSupplier || \"java.util.concurrent.CompletableFuture.supplyAsync\";\n const executorArg = (!this.asyncSupplier && this.asyncExecutor) ? `, ${this.asyncExecutor}` : \"\";\n const asyncBody = this.getIden(identation + 1) + `return ${supplier}(() -> {\\n` +\n insideWrappers +\n body + \"\\n\" +\n returnNull +\n this.getIden(identation + 1) + `}${executorArg});\\n`;\n return blockOpen + finalWrapperVars + asyncBody + blockClose;\n\n }\n return blockOpen + firstStatement + remainingString + blockClose;\n }\n\n printBlock(node, identation, chainBlock = false) {\n // Track per-block scope for final var dedup: same final name must not be\n // declared twice in a single block (Java would error), but may shadow\n // across nested blocks. We push an empty scope on entry and pop on exit.\n const managed = this.finalVarScopeStack.length > 0;\n if (managed) this.finalVarScopeStack.push(new Set());\n try {\n return super.printBlock(node, identation, chainBlock);\n } finally {\n if (managed) this.finalVarScopeStack.pop();\n }\n }\n\n printInstanceOfExpression(node, identation) {\n // const left = node.left.escapedText;\n const right = node.right.text;\n const left = this.printNode(node.left, 0);\n // const right = this.printNode(node.right, 0);\n return this.getIden(identation) + `Helpers.isInstance(${left}, ${right}.class)`;\n }\n\n printAwaitExpression(node, identation) {\n const expression = this.printNode(node.expression, identation);\n return `(${expression}).join()`;\n }\n\n printAsExpression(node, identation) {\n const type = node.type;\n\n if (type.kind === SyntaxKind.AnyKeyword) {\n return `((${this.VariableTypeReplacements['object']})${this.printNode(\n node.expression,\n identation\n )})`;\n }\n\n if (type.kind === SyntaxKind.StringKeyword) {\n return `((String)${this.printNode(node.expression, identation)})`;\n }\n\n if (type.kind === SyntaxKind.ArrayType) {\n const element = type.elementType.kind === SyntaxKind.AnyKeyword ? 'Object'\n : type.elementType.kind === SyntaxKind.StringKeyword ? 'String' : undefined;\n if (element !== undefined) {\n return `(java.util.List<${element}>)(${this.printNode(node.expression, identation)})`;\n }\n }\n\n return this.printNode(node.expression, identation);\n }\n\n // every Java parameter is `Object` (base printParameterType), except the ones whose TS\n // annotation names a native-carriable alias (javaNativeParameterType)\n printParameterType(node) {\n const native = this.javaNativeParameterType(node);\n if (native !== undefined) {\n return native;\n }\n return super.printParameterType(node);\n }\n\n printParameter(node, defaultValue = true) {\n const name = this.printNode(node.name, 0);\n const initializer = node.initializer;\n\n const type = this.printParameterType(node) || \"\";\n\n if (defaultValue) {\n if (initializer) {\n const def = this.printCustomDefaultValueIfNeeded(initializer) || this.printNode(initializer, 0);\n return type + \" \" + name + this.SPACE_DEFAULT_PARAM + \"=\" + this.SPACE_DEFAULT_PARAM + def;\n }\n return type + \" \" + name;\n }\n return name;\n }\n\n // the typed core signature: every parameter prints its Java type, the default-valued ones\n // included (a Java signature cannot carry a default - the front supplies it)\n printCoreMethodParameters(node) {\n return node.parameters.map(param => (param.initializer !== undefined\n ? `${this.javaOptionalParameterJavaType(param)} ${this.printNode(param.name, 0)}`\n : this.printParameter(param))).join(\", \");\n }\n\n // an async method's reassigned parameter prints under sigName (post keyword-remap),\n // freeing the original name for the lambda body to bind\n javaAsyncSignatureParameter(param, isAsyncMethod, printedParam) {\n if (isAsyncMethod && this.ReassignedVars[this.getVarKey(param)]) {\n const { localName, sigName } = this.getAsyncParamWrapperNames(param.name.text);\n return printedParam.replace(localName, sigName);\n }\n return printedParam;\n }\n\n // the async method body writes one of its parameters, or a non-pure default must be applied\n // by an `if (x == null) { x = init; }` inside the lambda (both break effective finality)\n javaReassignsParameter(node): boolean {\n const params = node.parameters ?? [];\n if (params.some((p) => p.initializer !== undefined && !this.isPureInitializer(p.initializer) && this.isAsyncFunction(node))) {\n return true;\n }\n const symbols = new Set();\n params.forEach((p) => {\n const symbol = this.javaSymbolOf(p.name);\n if (symbol !== undefined) {\n symbols.add(symbol);\n }\n });\n return symbols.size > 0 && node.body !== undefined && this.javaWritesSymbol(node.body, symbols);\n }\n\n javaSymbolOf(node): any | undefined {\n return this.getChecker().getSymbolAtLocation(node);\n }\n\n // syntactic walk: assignment targets, ++/--, destructuring targets and for-in/of expression heads\n javaWritesSymbol(node, symbols: Set): boolean {\n if (isBinaryExpression(node)) {\n const op = node.operatorToken.kind;\n if (op >= SyntaxKind.FirstAssignment && op <= SyntaxKind.LastAssignment\n && this.javaTargetWritesSymbol(node.left, symbols, op === SyntaxKind.EqualsToken)) {\n return true;\n }\n } else if ((isPrefixUnaryExpression(node) || isPostfixUnaryExpression(node))\n && (node.operator === SyntaxKind.PlusPlusToken || node.operator === SyntaxKind.MinusMinusToken)\n && this.javaTargetWritesSymbol(node.operand, symbols, false)) {\n return true;\n } else if ((isForInStatement(node) || isForOfStatement(node))\n && !isVariableDeclarationList(node.initializer)\n && this.javaTargetWritesSymbol(node.initializer, symbols, true)) {\n return true;\n }\n return node.forEachChild((child) => this.javaWritesSymbol(child, symbols) || undefined) === true;\n }\n\n javaTargetWritesSymbol(target, symbols: Set, destructuring: boolean): boolean {\n if (isParenthesizedExpression(target) || isNonNullExpression(target) || isAsExpression(target)) {\n return this.javaTargetWritesSymbol(target.expression, symbols, destructuring);\n }\n if (isIdentifier(target)) {\n const symbol = this.javaSymbolOf(target);\n return symbol !== undefined && symbols.has(symbol);\n }\n if (!destructuring) {\n return false;\n }\n if (isArrayLiteralExpression(target)) {\n return target.elements.some((e) => this.javaTargetWritesSymbol(isSpreadElement(e) ? e.expression : e, symbols, true));\n }\n if (isObjectLiteralExpression(target)) {\n return target.properties.some((p) => {\n if (isShorthandPropertyAssignment(p)) {\n return this.javaTargetWritesSymbol(p.name, symbols, true);\n }\n if (isPropertyAssignment(p)) {\n return this.javaTargetWritesSymbol(p.initializer, symbols, true);\n }\n return isSpreadAssignment(p) && this.javaTargetWritesSymbol(p.expression, symbols, true);\n });\n }\n if (isBinaryExpression(target) && target.operatorToken.kind === SyntaxKind.EqualsToken) {\n return this.javaTargetWritesSymbol(target.left, symbols, true); // `[x = 1] = ...` default\n }\n return false;\n }\n\n // `file:method` of every async method whose body reassigns a parameter (unsupported in Java lambdas)\n javaReassigningMethods: string[] = [];\n // the embedding build turns a reassigned async parameter into a hard transpile error\n javaStrictEffectivelyFinal = false;\n\n printMethodParameters(node) {\n const isAsyncMethod = this.isAsyncFunction(node);\n const params = node.parameters.map(param => this.javaAsyncSignatureParameter(param, isAsyncMethod, this.printParameter(param)));\n const hasOptionalParameter = node.parameters.some(p => p.initializer !== undefined || p.questionToken !== undefined);\n if (!hasOptionalParameter) {\n return params.join(\", \");\n }\n const paramsWithOptional = params.filter(param => param.indexOf('=') === -1);\n paramsWithOptional.push('Object... optionalArgs');\n return paramsWithOptional.join(\", \");\n }\n\n printArrayLiteralExpression(node) {\n // For Java: new ArrayList<>(Arrays.asList(elem1, elem2, ...))\n const elements = node.elements.map((e) => this.printNode(e)).join(\", \");\n return `${this.ARRAY_OPENING_TOKEN}${elements}${this.ARRAY_CLOSING_TOKEN}`;\n }\n\n\n printFinalOutsideMethodVariableWrappersIfAny(node, identation) {\n return this.javaAsyncParamWrapperLines(node, identation, (param, isOptionalParam, { sigName, snapName }) => {\n // a default-valued parameter of the split core keeps its type in the\n // snapshot (`final Long since3 = since2;`); the body local stays `Object`\n const snapType = (isOptionalParam && param.initializer !== undefined)\n ? this.javaOptionalParameterJavaType(param) : 'Object';\n return `final ${snapType} ${snapName} = ${sigName};`;\n });\n }\n\n printInsideMethodVariableWrappersIfAny(node, identation) {\n return this.javaAsyncParamWrapperLines(node, identation, (param, _isOptionalParam, { localName, snapName }) =>\n `${this.javaAsyncParameterLocalType(param) ?? 'Object'} ${localName} = ${snapName};`);\n }\n\n // one line per reassigned parameter of an async method (optional ones only in a split core)\n javaAsyncParamWrapperLines(node, identation, printLine) {\n const parameters = node?.parameters;\n const finalVarWrappers = [];\n if (parameters) {\n const isAsyncMethod = this.isAsyncFunction(node);\n const splitCore = this.hasDefaultedTail(node);\n parameters.forEach(param => {\n const isOptionalParam = param.initializer !== undefined || param.questionToken !== undefined;\n if ((!isOptionalParam || splitCore) && isAsyncMethod && this.ReassignedVars[this.getVarKey(param)]) {\n const names = this.getAsyncParamWrapperNames(param.name.text);\n finalVarWrappers.push(this.getIden(identation + 1) + printLine(param, isOptionalParam, names));\n }\n });\n }\n return finalVarWrappers.join(\"\\n\");\n }\n\n printMethodDeclaration(node, identation) {\n const funcBody = this.printFunctionBody(node, identation); // print body first to get var reassignments filled\n // one typed signature: default-valued and `?` parameters are ordinary typed parameters\n let methodDef = this.printMethodDefinition(node, identation, (n) => this.printCoreMethodParameters(n));\n methodDef += funcBody;\n methodDef += this.printOverrideBridges(node, identation);\n\n return methodDef;\n }\n\n printMethodDefinition(node, identation, paramsPrinter = undefined) {\n const name = this.transformMethodNameIfNeeded(node.name.text);\n\n let returnType = this.printFunctionType(node);\n\n // quick fix\n if (returnType === 'java.util.concurrent.CompletableFuture') {\n returnType = 'java.util.concurrent.CompletableFuture';\n }\n\n // D-09: an internal (non-override) generated method whose every return already\n // prints the native type carries it in its signature (see javaNativeReturnType).\n // Only the boxed default is replaced - void/Promise/plain-string stay as printed.\n if (returnType === this.DEFAULT_RETURN_TYPE) {\n const native = this.javaNativeReturnType(node);\n if (native !== undefined) {\n returnType = native;\n }\n }\n\n const modifiers = this.METHOD_DEFAULT_ACCESS ? this.METHOD_DEFAULT_ACCESS + \" \" : \"\";\n const parsedArgs = paramsPrinter ? paramsPrinter(node) : this.printMethodParameters(node);\n\n returnType = returnType ? returnType + \" \" : returnType;\n\n const methodToken = this.METHOD_TOKEN ? this.METHOD_TOKEN + \" \" : \"\";\n const signature = this.getIden(identation) + modifiers + returnType + methodToken + name + \"(\" + parsedArgs + \")\";\n\n return this.printNodeCommentsIfAny(node, identation, signature);\n }\n\n // `Array.isArray(x)` prints `(x instanceof java.util.List)`: false for null, true for a List, same\n // as the helper for every Java-object operand. The helper stays where the operand prints as a Java\n // array (rest parameter: `getClass().isArray()` branch) or a final class not convertible to List.\n printArrayIsArrayCall(node, _identation, parsedArg = undefined) {\n const native = this.printNativeArrayIsArray(node, parsedArg);\n return native === undefined ? `Helpers.isArray(${parsedArg})` : native;\n }\n\n printNativeArrayIsArray(node, parsedArg) {\n const operand: any = node?.arguments?.[0];\n if (operand === undefined || parsedArg === undefined) {\n return undefined;\n }\n // the whole call is the value of an expression statement: a bare `true;`/`false;` is\n // not a Java statement, so that position keeps the helper call\n if (node.parent !== undefined && isExpressionStatement(node.parent)) {\n return undefined;\n }\n // a side-effect-free array literal prints as a fresh ArrayList (never null), so the\n // answer is true without evaluating anything the helper would have to keep\n if (isArrayLiteralExpression(operand)) {\n return this.javaArrayLiteralDropsNothing(operand) ? 'true' : undefined;\n }\n if (!this.javaPrimaryIsArrayOperand(operand)) {\n return undefined;\n }\n const type = this.javaOperandType(operand);\n // a plain identifier of a type that can never hold a List: the helper answers false\n // for null/undefined and for every scalar, and the reference stays untouched\n if (operand.kind === SyntaxKind.Identifier && this.javaNonArrayType(type)) {\n return 'false';\n }\n if (this.isVarargsArrayReference(operand)) {\n return undefined;\n }\n if (this.javaScalarType(type)) {\n return undefined;\n }\n return `(${parsedArg} instanceof java.util.List)`;\n }\n\n // Operand shapes whose print is a primary expression: `instanceof` binds tighter than the\n // low-precedence operators, so a ternary/binary operand would re-parse, and a constructor\n // or cast print can be a final Java class on which `instanceof List` is not convertible.\n javaPrimaryIsArrayOperand(node): boolean {\n const kind = node.kind;\n return kind === SyntaxKind.Identifier\n || kind === SyntaxKind.PropertyAccessExpression\n || kind === SyntaxKind.ElementAccessExpression\n || kind === SyntaxKind.CallExpression;\n }\n\n javaOperandType(operand) {\n return this.checkerOrUndefined()?.getTypeAtLocation(operand);\n }\n\n // literals and identifiers have nothing an array-literal wrapper could skip by dropping\n javaArrayLiteralDropsNothing(node, depth = 0): boolean {\n if (depth > 4) {\n return false;\n }\n return node.elements.every((element) => isStringLiteral(element)\n || isNumericLiteral(element)\n || element.kind === SyntaxKind.TrueKeyword\n || element.kind === SyntaxKind.FalseKeyword\n || element.kind === SyntaxKind.NullKeyword\n || element.kind === SyntaxKind.Identifier\n || (isArrayLiteralExpression(element) && this.javaArrayLiteralDropsNothing(element, depth + 1)));\n }\n\n // types whose Java print is a scalar final class (`instanceof java.util.List` is not\n // convertible on them): the scalar family, and unions made only of scalars/nulls\n javaScalarType(type): boolean {\n return this.javaTypeFlagsOnly(type, JAVA_SCALAR_TYPE_FLAGS);\n }\n\n // types that provably never hold a List: every scalar (Java String/Long/Double/Boolean\n // answer false) and the nullish types (JS Array.isArray(null) is false)\n javaNonArrayType(type): boolean {\n return this.javaTypeFlagsOnly(type, JAVA_SCALAR_TYPE_FLAGS | JAVA_NULLISH_TYPE_FLAGS);\n }\n\n // the type, or every member of its (nested) union, carries one of the mask's flags\n javaTypeFlagsOnly(type, mask: number, depth = 0): boolean {\n if (type === undefined || type === null || depth > 3) {\n return false;\n }\n const flags: any = type.flags;\n if (flags & TypeFlags.Union) {\n const parts: any[] = type.getTypes?.() ?? [];\n return parts.length > 0 && parts.every((part) => this.javaTypeFlagsOnly(part, mask, depth + 1));\n }\n return (flags & mask) !== 0;\n }\n\n // A checker-proven dict prints a Map on every path, so the key copy is native;\n // every other target keeps the helper — shared field maps need its synchronized\n // snapshot, the rest need its instanceof/null fallbacks.\n printObjectKeysCall(node, _identation, parsedArg = undefined) {\n return this.printNativeObjectKeysCall(node) ?? `Helpers.objectKeys(${parsedArg})`;\n }\n\n printNativeObjectKeysCall(node) {\n const argument = node?.arguments?.[0];\n if (argument === undefined || isPropertyAccessExpression(argument)) {\n return undefined;\n }\n // a local the pass declares a Map needs no checkcast: the key copy binds on the\n // declaration's own type, exactly the helper's synchronized map branch\n if (this.javaDeclaredMapReceiver(argument)) {\n return `new java.util.ArrayList(${this.printNode(argument, 0)}.keySet())`;\n }\n const checker: any = this.checkerOrUndefined();\n if (checker === undefined) {\n return undefined;\n }\n const type = checker.getTypeAtLocation(argument);\n if (!this.isJavaMapStructureType(type)) {\n return undefined;\n }\n return `new java.util.ArrayList(((java.util.Map)${this.printNode(argument, 0)}).keySet())`;\n }\n\n printObjectValuesCall(_node, _identation, parsedArg = undefined) {\n return `Helpers.objectValues(${parsedArg})`;\n }\n\n printJsonParseCall(_node, _identation, parsedArg = undefined) {\n return `Helpers.parseJson(${parsedArg})`;\n }\n\n printJsonStringifyCall(_node, _identation, parsedArg = undefined) {\n return `Helpers.json(${parsedArg})`;\n }\n\n // `await Promise.all ([e1, ..., en])` with every element checker-typed `Promise<...>`:\n // CompletableFuture.allOf waits for exactly those, so Helpers.promiseAll's reflective loop adds\n // nothing. Result used -> thenApply collecting values, only for `const` locals (no double runs).\n printNativePromiseAllCall(node) {\n const awaitNode = node?.parent;\n if (awaitNode?.kind !== SyntaxKind.AwaitExpression) {\n return undefined;\n }\n const listNode = node.arguments?.[0];\n if (listNode?.kind !== SyntaxKind.ArrayLiteralExpression) {\n return undefined;\n }\n const elements = listNode.elements as unknown as Expression[];\n const checker = this.getChecker();\n for (const element of elements) {\n if (element.kind === SyntaxKind.SpreadElement\n || !this.isPromiseType(checker.getTypeAtLocation(element))) {\n return undefined;\n }\n }\n const printed = elements.map((element) => this.printNode(element));\n const futureCast = `((${this.PROMISE_TYPE_KEYWORD}) `;\n const casted = printed.map((element) => `${futureCast}${element})`);\n const allOf = `${this.PROMISE_TYPE_KEYWORD}.allOf(${casted.join(\", \")})`;\n if (awaitNode.parent?.kind === SyntaxKind.ExpressionStatement) {\n return allOf;\n }\n if (elements.length === 0\n || !elements.every((element) => this.isConstBoundIdentifier(element))\n || printed.indexOf('promiseAllValue') !== -1) {\n return undefined;\n }\n const collected = casted.map((element) => `${element}.join()`).join(\", \");\n const collectList = `${this.ARRAY_OPENING_TOKEN}${collected}${this.ARRAY_CLOSING_TOKEN}`;\n return `${allOf}.thenApply(promiseAllValue -> ${collectList})`;\n }\n\n // a `const`-bound local is assigned exactly once, so the printed java local is\n // effectively final (a lambda can capture it) and re-reading it joins the same future\n isConstBoundIdentifier(node) {\n if (node.kind !== SyntaxKind.Identifier) {\n return false;\n }\n const declaration = this.getChecker().getSymbolAtLocation(node)?.valueDeclaration?.resolve();\n return declaration?.kind === SyntaxKind.VariableDeclaration\n && (getCombinedNodeFlags(declaration) & NodeFlags.Const) === NodeFlags.Const;\n }\n\n printPromiseAllCall(node, identation, parsedArg = undefined) {\n return this.printNativePromiseAllCall(node) ?? `Helpers.promiseAll(${parsedArg})`;\n }\n\n printMathFloorCall(node, _identation, parsedArg = undefined) {\n return `(Math.floor(Double.parseDouble(${this.javaStringBoxText(node?.arguments?.[0], parsedArg)})))`;\n }\n\n printMathRoundCall(node, _identation, parsedArg = undefined) {\n return `Math.round(Double.parseDouble(${this.javaStringBoxText(node?.arguments?.[0], parsedArg)}))`;\n }\n\n printMathCeilCall(node, _identation, parsedArg = undefined) {\n return `Math.ceil(Double.parseDouble(${this.javaStringBoxText(node?.arguments?.[0], parsedArg)}))`;\n }\n\n printNumberIsIntegerCall(_node, _identation, parsedArg = undefined) {\n return `((${parsedArg} instanceof Integer) || (${parsedArg} instanceof Long))`;\n }\n\n printArrayPushCall(_node, _identation, name = undefined, parsedArg = undefined) {\n return `((java.util.List)${name}).add(${parsedArg})`;\n }\n\n printIncludesCall(_node, _identation, name = undefined, parsedArg = undefined) {\n return `${name}.contains(${parsedArg})`;\n }\n\n // Helpers.getIndexOf(str, target) is List.indexOf for a List receiver, String.indexOf for a String\n // receiver with a String target, -1 otherwise. Locals are `Object`/`var`, so the native call takes\n // the same checkcast as `.length()` / `containsKey`; the target takes one unless a printed String.\n javaNativeIndexOfCall(node, name, parsedArg) {\n if (node === undefined || name === undefined || parsedArg === undefined) {\n return undefined;\n }\n const receiver = node?.expression?.expression;\n if (receiver === undefined) {\n return undefined;\n }\n const checker: any = this.getChecker();\n let receiverType: any;\n try {\n receiverType = checker.getTypeAtLocation(receiver);\n } catch (e) {\n return undefined;\n }\n // a rest parameter is a Java array, not a List: the helper's `instanceof List` test fails there\n // and so must the native call. The wildcard receiver cast is the `.length()` family's and accepts\n // a List of any element type (a `List` cast fails on a `List`-static receiver).\n if (this.isJavaListType(receiverType) && !this.isVarargsArrayReference(receiver)) {\n return `((java.util.List)${name}).indexOf(${parsedArg})`;\n }\n // plain `string` only: the nullable aliases (`Str`) and every union can hold\n // undefined, which the helper absorbs as -1 but String.indexOf has no receiver for\n if (receiverType.getAliasSymbol?.() !== undefined || !this.isStringType(receiverType.flags)) {\n return undefined;\n }\n const arg = node.arguments?.[0];\n if (arg === undefined) {\n return undefined;\n }\n if (this.javaProvableString(arg)) {\n return `((String)${name}).indexOf(${parsedArg})`;\n }\n let argType: any;\n try {\n argType = checker.getTypeAtLocation(arg);\n } catch (e) {\n return undefined;\n }\n // a bare identifier / field target the checker types as a plain string: the cast is\n // the printer's own startsWith/endsWith argument shape\n if (argType.getAliasSymbol?.() === undefined && this.isStringType(argType.flags)\n && (isIdentifier(arg) || isPropertyAccessExpression(arg))) {\n return `((String)${name}).indexOf(((String)${parsedArg}))`;\n }\n return undefined;\n }\n\n printIndexOfCall(node, _identation, name = undefined, parsedArg = undefined) {\n return this.javaNativeIndexOfCall(node, name, parsedArg) ?? `${this.INDEXOF_WRAPPER_OPEN}${name}, ${parsedArg}${this.INDEXOF_WRAPPER_CLOSE}`;\n }\n\n printSearchCall(_node, _identation, name = undefined, parsedArg = undefined) {\n return `((String)${name}).indexOf(${parsedArg})`;\n }\n\n printStartsWithCall(_node, _identation, name = undefined, parsedArg = undefined) {\n return `((String)${name}).startsWith(((String)${parsedArg}))`;\n }\n\n printEndsWithCall(_node, _identation, name = undefined, parsedArg = undefined) {\n return `((String)${name}).endsWith(((String)${parsedArg}))`;\n }\n\n printTrimCall(_node, _identation, name = undefined) {\n return `((String)${name}).trim()`;\n }\n\n printJoinCall(_node, _identation, name = undefined, parsedArg = undefined) {\n // assumes List\n return `String.join((String)${parsedArg}, (java.util.List)${name})`;\n }\n\n printSplitCall(node, _identation, name = undefined, parsedArg = undefined) {\n return this.javaNativeSplitCall(node, name, parsedArg) ?? `Helpers.split(${name}, ${parsedArg})`;\n }\n\n printConcatCall(_node, _identation, name = undefined, parsedArg = undefined) {\n return `Helpers.concat(${name}, ${parsedArg})`;\n }\n\n printToFixedCall(_node, _identation, name = undefined, parsedArg = undefined) {\n return `toFixed(${name}, ${parsedArg})`;\n }\n\n printToStringCall(_node, _identation, name = undefined) {\n return `String.valueOf(${name})`;\n }\n\n printToUpperCaseCall(_node, _identation, name = undefined) {\n return `((String)${name}).toUpperCase()`;\n }\n\n printToLowerCaseCall(_node, _identation, name = undefined) {\n return `((String)${name}).toLowerCase()`;\n }\n\n printShiftCall(_node, _identation, name = undefined) {\n return `((java.util.List)${name}).get(0)`;\n }\n\n printReverseCall(_node, _identation, name = undefined) {\n return `java.util.Collections.reverse((java.util.List)${name})`;\n }\n\n printPopCall(_node, _identation, name = undefined) {\n return `((java.util.List)${name}).get(((java.util.List)${name}).size()-1)`;\n }\n\n printAssertCall(_node, _identation, parsedArgs) {\n return `assert(${parsedArgs})`;\n }\n\n printSliceCall(node, _identation, name = undefined, parsedArg = undefined, parsedArg2 = undefined) {\n const nativeCall = this.nativeSliceCallIfProvable(node, name);\n if (nativeCall !== undefined) {\n return nativeCall;\n }\n if (parsedArg2 === undefined) {\n parsedArg2 = \"null\";\n }\n return `Helpers.slice(${name}, ${parsedArg}, ${parsedArg2})`;\n }\n\n // Integer value of a slice bound that is an integer literal (`18`, `-64`); anything else keeps\n // the helper — the Java helper converts bounds with toInt, and a double cannot be clamped with the\n // integer Math.min/Math.max of the native form.\n javaSliceLiteralBound(node) {\n if (node === undefined) {\n return undefined;\n }\n if (isNumericLiteral(node)) {\n const text = String(node.text);\n if (text.indexOf('.') !== -1 || text.indexOf('e') !== -1 || text.indexOf('E') !== -1) {\n return undefined;\n }\n const value = Number(text);\n return value <= 2147483647 ? value : undefined;\n }\n if (isPrefixUnaryExpression(node) && node.operator === SyntaxKind.MinusToken) {\n const inner = this.javaSliceLiteralBound(node.operand);\n return inner === undefined ? undefined : -inner;\n }\n return undefined;\n }\n\n // JS slice clamps a literal bound into [0, length]: a non-negative bound is min\n // (bound, length), a negative one counts from the end (max (length - |bound|, 0)).\n // `0` stays `0` because the length of a String/List is never negative.\n javaSliceBoundExpression(value, length) {\n if (value === 0) {\n return '0';\n }\n return value > 0 ? `Math.min(${value}, ${length})` : `Math.max(${length} - ${-value}, 0)`;\n }\n\n // `x.slice (a, b)` -> substring/subList when the receiver provably prints as String/List AND every\n // bound is an integer literal: Java throws where JS clamps, so only literal bounds can be clamped.\n // The null guard keeps null -> null and needs a side-effect-free receiver (read up to three times).\n nativeSliceCallIfProvable(node, name) {\n const args = node?.arguments ?? [];\n if (args.length < 1 || args.length > 2) {\n return undefined;\n }\n const start = this.javaSliceLiteralBound(args[0]);\n if (start === undefined) {\n return undefined;\n }\n const hasEnd = args.length === 2;\n const end = hasEnd ? this.javaSliceLiteralBound(args[1]) : undefined;\n if (hasEnd && end === undefined) {\n return undefined;\n }\n const receiverExpression = isPropertyAccessExpression(node?.expression) ? node.expression.expression : undefined;\n if (!this.sideEffectFreeReceiver(receiverExpression)) {\n return undefined;\n }\n let kind: string;\n try {\n const type = this.getChecker().getTypeAtLocation(receiverExpression);\n if (this.isStringType(type.flags)) {\n kind = 'String';\n } else if (this.isJavaListType(type) && !this.isVarargsArrayReference(receiverExpression)) {\n kind = 'List';\n } else {\n return undefined;\n }\n } catch (e) {\n return undefined;\n }\n const cast = kind === 'String' ? `((String)${name})` : `((java.util.List)${name})`;\n const length = kind === 'String' ? `${cast}.length()` : `${cast}.size()`;\n const startText = this.javaSliceBoundExpression(start, length);\n const endText = hasEnd ? this.javaSliceBoundExpression(end, length) : length;\n // from <= to is proven per case: 0 is never above a clamp, an open end is the\n // length, and two literals clamp monotonically once they keep their order\n // (non-negative, or both counting from the end with |start| >= |end|).\n const ordered = start === 0 || !hasEnd\n || (start >= 0 && end >= 0 && start <= end)\n || (start < 0 && end < 0 && start <= end);\n const fromText = ordered ? startText : `Math.min(${startText}, ${endText})`;\n // an inverted pair yields an empty slice in JS, so the substrings collapse to\n // substring (to, to); a one-argument String slice drops the end entirely\n const argumentsText = hasEnd || kind === 'List' ? `${fromText}, ${endText}` : fromText;\n const method = kind === 'String' ? 'substring' : 'subList';\n return `(${name} == null ? null : ${cast}.${method}(${argumentsText}))`;\n }\n\n printReplaceCall(_node, _identation, name = undefined, parsedArg = undefined, parsedArg2 = undefined) {\n return `Helpers.replace((String)${name}, (String)${parsedArg}, (String)${parsedArg2})`;\n }\n\n printReplaceAllCall(node, identation, name = undefined, parsedArg = undefined, parsedArg2 = undefined) {\n // Native when both arguments are plain string literals and the pattern is non-empty: the\n // helper's null / empty-pattern guards cannot fire for them, and `String.replace` is the\n // literal all-occurrences replacement. The null guard on the receiver keeps the helper's\n // null -> null behaviour; it is only emitted for a side-effect-free receiver (identifier\n // or property access), so a double read cannot change semantics.\n const pattern = this.stringLiteralArgument(node?.arguments?.[0]);\n const replacement = this.stringLiteralArgument(node?.arguments?.[1]);\n const receiver = this.sideEffectFreeReceiver(node?.expression);\n if (pattern !== undefined && replacement !== undefined && receiver) {\n return `(${name} == null ? null : ((String)${name}).replace(${pattern}, ${replacement}))`;\n }\n return `Helpers.replaceAll((String)${name}, (String)${parsedArg}, (String)${parsedArg2})`;\n }\n\n // Printed form of a non-empty string-literal argument with no escapes, or undefined when the\n // argument is not a literal, prints with an escape sequence, or is the empty pattern.\n stringLiteralArgument(argument) {\n if (argument === undefined || !isStringLiteral(argument)) {\n return undefined;\n }\n const printed = this.printNode(argument, 0);\n return /^\"[^\"\\\\]+\"$/.test(printed) ? printed : undefined;\n }\n\n // True for receivers that read a value without calling anything: `x`, `x.y`, `this.x`,\n // `(x as string)` and parenthesised forms of those. Guards the double read of the ternary.\n sideEffectFreeReceiver(expression) {\n if (expression === undefined) {\n return false;\n }\n if (isParenthesizedExpression(expression) || isAsExpression(expression) || isTypeAssertion(expression)) {\n return this.sideEffectFreeReceiver(expression.expression);\n }\n if (isIdentifier(expression) || expression.kind === SyntaxKind.ThisKeyword) {\n return true;\n }\n if (isPropertyAccessExpression(expression)) {\n return this.sideEffectFreeReceiver(expression.expression);\n }\n return false;\n }\n\n printPadEndCall(_node, _identation, name, parsedArg, parsedArg2) {\n // You can point this to a runtime helper if you have one\n return `Helpers.padEnd((String)${name}, ((Number)${parsedArg}).intValue(), ((String)${parsedArg2}).charAt(0))`;\n }\n\n printPadStartCall(node, _identation, name, parsedArg, parsedArg2) {\n return this.printNativePadStart(node, name) ?? `Helpers.padStart((String)${name}, ((Number)${parsedArg}).intValue(), ((String)${parsedArg2}).charAt(0))`;\n }\n\n printDateNowCall(_node, _identation) {\n return \"System.currentTimeMillis()\";\n }\n\n printLengthProperty(node, _identation, _name = undefined) {\n const leftSide = this.printNode(node.expression, 0);\n const type = (this.getChecker() as Checker).getTypeAtLocation(node.expression);\n this.warnIfAnyType(node, (type as any).flags, leftSide, \"length\");\n return this.printJavaLength(node.expression, leftSide);\n }\n\n // For ++/--, prefer native Java operators rather than the C# ref-helpers\n printPostFixUnaryExpression(node, identation) {\n const { operand, operator } = node;\n const leftSide = this.printNode(operand, 0);\n return this.PostFixOperators[operator] === \"--\" ? `${leftSide}--` : `${leftSide}++`;\n }\n\n // the identifier declared by a `for (var i = ; ...; i++)` header: the\n // printer writes that initializer as `var`, so javac infers a primitive int and the\n // ++/-- increment keeps it one\n javaPrimitiveCounter(node): boolean {\n if (node?.kind !== SyntaxKind.Identifier) {\n return false;\n }\n const symbol = this.getChecker().getSymbolAtLocation(node);\n const declaration: any = symbol?.valueDeclaration?.resolve() ?? symbol?.declarations?.[0]?.resolve();\n if (declaration === undefined || !isVariableDeclaration(declaration) || !isIdentifier(declaration.name)) {\n return false;\n }\n if (declaration.name.text !== node.text || declaration.initializer === undefined) {\n return false;\n }\n const list: any = declaration.parent;\n if (list?.kind !== SyntaxKind.VariableDeclarationList || list.declarations.length !== 1) {\n return false;\n }\n const forStatement: any = list.parent;\n if (forStatement?.kind !== SyntaxKind.ForStatement || forStatement.initializer !== list) {\n return false;\n }\n if (this.javaIntegerLiteralKind(declaration.initializer) === undefined) {\n return false;\n }\n const incrementor = forStatement.incrementor;\n return incrementor?.kind === SyntaxKind.PostfixUnaryExpression\n && incrementor.operand?.kind === SyntaxKind.Identifier\n && incrementor.operand.text === node.text;\n }\n\n // `-x` prints as the plain Java operator when the operand is already primitive: a decimal literal,\n // a nested native `+ - * /`, a `for (var i = ` counter or a `.length` read.\n // Helpers.opNeg preserves the box and maps null to null, so every boxed local keeps the helper.\n javaNativeNegation(node): boolean {\n if (node === undefined) {\n return false;\n }\n if (node.kind === SyntaxKind.ParenthesizedExpression) {\n return this.javaNativeNegation(node.expression);\n }\n if (isNumericLiteral(node)) {\n return this.javaProvableNumericKind(node) !== undefined;\n }\n if (node.kind === SyntaxKind.BinaryExpression) {\n return this.javaNativeArithmeticKind(node) !== undefined;\n }\n if (this.javaPrimitiveCounter(node)) {\n return true;\n }\n return node.kind === SyntaxKind.PropertyAccessExpression\n && node.name.text === 'length'\n && this.javaLengthKind(node.expression) !== undefined;\n }\n\n printPrefixUnaryExpression(node, identation) {\n const { operand, operator } = node;\n if (operator === SyntaxKind.ExclamationToken) {\n return this.PrefixFixOperators[operator] + this.printCondition(node.operand, 0);\n }\n const leftSide = this.printNode(operand, 0);\n if (operator === SyntaxKind.PlusToken) {\n return `+(${leftSide})`;\n } else if (operator === SyntaxKind.MinusToken) {\n if (this.javaNativeNegation(operand)) {\n return `-${leftSide}`;\n }\n return `Helpers.opNeg(${leftSide})`;\n }\n return super.printPrefixUnaryExpression(node, identation);\n }\n\n javaBooleanCondition(node) {\n if (node.kind === SyntaxKind.ParenthesizedExpression) {\n return this.javaBooleanCondition(node.expression);\n }\n if (node.kind === SyntaxKind.PrefixUnaryExpression) {\n return node.operator === SyntaxKind.ExclamationToken && this.javaBooleanCondition(node.operand);\n }\n if (node.kind !== SyntaxKind.BinaryExpression) {\n return false;\n }\n return this.javaBooleanOperators.includes(node.operatorToken.kind);\n }\n\n // `Precise.(a, b)` resolving to a static of the base `Precise` class: Precise.java\n // declares them `public static boolean`, so the call is a primitive boolean. The receiver name\n // alone is no proof (a shadowing local prints the same text), so the resolution is checked too.\n javaPreciseBooleanCall(node) {\n if (node.kind === SyntaxKind.ParenthesizedExpression) {\n return this.javaPreciseBooleanCall(node.expression);\n }\n // `!` is a boolean too (the negation of a proven boolean)\n if (node.kind === SyntaxKind.PrefixUnaryExpression) {\n return node.operator === SyntaxKind.ExclamationToken && this.javaPreciseBooleanCall(node.operand);\n }\n if (node.kind !== SyntaxKind.CallExpression\n || node.expression.kind !== SyntaxKind.PropertyAccessExpression\n || node.expression.expression.kind !== SyntaxKind.Identifier\n || node.expression.expression.text !== 'Precise'\n || !JAVA_PRECISE_BOOLEAN_STATICS.has(node.expression.name.text)) {\n return false;\n }\n const declaration: any = this.getChecker().getResolvedSignature(node)?.declaration?.resolve();\n if (declaration === undefined\n || declaration.kind !== SyntaxKind.MethodDeclaration\n || declaration.parent?.kind !== SyntaxKind.ClassDeclaration\n || declaration.parent.name?.text !== 'Precise'\n || !declaration.modifiers?.some((modifier) => modifier.kind === SyntaxKind.StaticKeyword)) {\n return false;\n }\n // the relational statics answer a plain boolean (never null), which is what\n // Helpers.isTrue(Boolean) returns unchanged; a union (boolean | undefined) keeps the helper\n return (this.getChecker().getTypeAtLocation(node).flags & TypeFlags.Boolean) !== 0;\n }\n\n // the checker's view of a condition value: BooleanLike is the plain `boolean` (the `boolean |\n // undefined` of an accessor with a default is BooleanLiteral + Undefined and does not qualify),\n // while a union whose every member is boolean/nullish is the nullable box.\n javaBooleanValueKind(node): 'boolean' | 'nullableBoolean' | undefined {\n const type = this.getChecker().getTypeAtLocation(node);\n const flags = type?.flags ?? 0;\n if (flags & TypeFlags.BooleanLike) {\n return 'boolean';\n }\n if ((flags & TypeFlags.Union) === 0) {\n return undefined;\n }\n const members = (type as any).getTypes?.() ?? [];\n const booleanishMembers = TypeFlags.BooleanLike | TypeFlags.Null\n | TypeFlags.Undefined | TypeFlags.Void;\n const allBooleanish = members.length > 0\n && members.every((member) => (((member as any).flags ?? 0) & booleanishMembers) !== 0);\n return allBooleanish ? 'nullableBoolean' : undefined;\n }\n\n // mirrors printWrappedUnknownThisProperty: a `this.(...)` call the checker cannot\n // resolve prints `Helpers.callDynamically(this, \"\", ...)`, whose Java return is Object\n javaCalleeResolves(node): boolean {\n const checker: any = this.checkerOrUndefined();\n if (checker === undefined) {\n return false;\n }\n const signature = checker.getResolvedSignature(node);\n return signature?.declaration !== undefined;\n }\n\n // the boolean the printed Java of a `this.(...)` call already carries, from the\n // hand-written base declarations in JAVA_THIS_BOOLEAN_METHODS / the box proof in\n // JAVA_THIS_BOOLEAN_BOX_METHODS. undefined: not a direct boolean call, keep the wrapper.\n javaCallBooleanKind(node): 'boolean' | 'nullableBoolean' | undefined {\n if (node?.kind !== SyntaxKind.CallExpression) {\n return undefined;\n }\n const callee = node.expression;\n if (callee?.kind !== SyntaxKind.PropertyAccessExpression\n || callee.expression?.kind !== SyntaxKind.ThisKeyword) {\n return undefined;\n }\n const kind = this.javaBooleanValueKind(node);\n if (kind === undefined || !this.javaCalleeResolves(node)) {\n return undefined;\n }\n const name = callee.name?.text as string;\n if (JAVA_THIS_BOOLEAN_METHODS.has(name)) {\n // the hand-written declaration is the only source of the primitive return: a\n // non-base `this.(...)` is a different method, printed `Object`\n return kind === 'boolean' ? 'boolean' : undefined;\n }\n const defaultArgumentIndex = JAVA_THIS_BOOLEAN_BOX_METHODS[name];\n if (defaultArgumentIndex === undefined) {\n return undefined;\n }\n const defaultArgument = node.arguments?.[defaultArgumentIndex];\n // a nullish literal reaches the Java accessor as null (the printer drops a trailing\n // `undefined` in the optional tail), and null is what an absent argument yields\n const defaultIsNullish = defaultArgument === undefined\n || defaultArgument.kind === SyntaxKind.NullKeyword\n || (defaultArgument.kind === SyntaxKind.Identifier && defaultArgument.text === 'undefined');\n const defaultIsBoolean = defaultIsNullish\n || defaultArgument?.kind === SyntaxKind.TrueKeyword\n || defaultArgument?.kind === SyntaxKind.FalseKeyword;\n return defaultIsBoolean ? 'nullableBoolean' : undefined;\n }\n\n // the printer already emits these conditions as Java `boolean` (the comparison helpers,\n // `in`/`instanceof` and the logical operators all return/print primitive boolean), so\n // Helpers.isTrue would only re-test a value the checker proves is boolean\n javaConditionPrintsBoolean(node) {\n let inner = node;\n while (inner.kind === SyntaxKind.ParenthesizedExpression) {\n inner = inner.expression;\n }\n if (inner.kind === SyntaxKind.PrefixUnaryExpression && inner.operator === SyntaxKind.ExclamationToken) {\n return true; // printPrefixUnaryExpression prints `!` + printCondition(operand): a primitive boolean\n }\n if (this.javaBooleanCondition(node)) {\n // TS models `boolean` as the true|false union: the Boolean bit is set on plain\n // boolean and cleared on `boolean | undefined`-style unions, which keep the helper\n return (this.getChecker().getTypeAtLocation(node).flags & TypeFlags.Boolean) !== 0;\n }\n return this.javaPreciseBooleanCall(node);\n }\n\n // the checker proves this expression's TypeScript type is exactly `boolean` (or a boolean\n // literal type): no `any`, no `undefined`/`null` union, no nullable alias\n javaBooleanBoxType(type: any): boolean {\n if (type === undefined) {\n return false;\n }\n if (type.getAliasSymbol?.() !== undefined) {\n return false;\n }\n const flags = type.flags ?? 0;\n if ((flags & JAVA_BOOLEAN_EXCLUDED_TYPE_FLAGS) !== 0) {\n return false;\n }\n return (flags & (TypeFlags.Boolean | TypeFlags.BooleanLiteral)) !== 0;\n }\n\n javaTypeOfNode(node): any {\n return this.checkerOrUndefined()?.getTypeAtLocation(node);\n }\n\n // the DECLARED type of a declaration, not the narrowed type at a use site: TypeScript\n // narrows a `const ok: boolean = true` to the literal `true` and can even reach `never`\n // after a guarding `if (ok) return;`, which says nothing about the box the local holds\n javaTypeOfDeclaration(decl): any {\n if (decl === undefined) {\n return undefined;\n }\n return this.checkerOrUndefined()?.getTypeAtLocation(decl);\n }\n\n // the printed Java of this expression is a primitive `boolean` (or Boolean box): boolean literals,\n // `!`, logical / comparison / `in` operators, `Array.isArray(x)` (Helpers.isArray, `public static\n // boolean`) and hand-written `public boolean` base methods. `seen` breaks `a = b; b = a;` cycles.\n javaPrintsBooleanValue(node, seen: Set, depth = 0): boolean {\n if (node === undefined) {\n return false;\n }\n switch (node.kind) {\n case SyntaxKind.TrueKeyword:\n case SyntaxKind.FalseKeyword:\n return true;\n case SyntaxKind.ParenthesizedExpression:\n case SyntaxKind.AsExpression:\n case SyntaxKind.NonNullExpression:\n return this.javaPrintsBooleanValue(node.expression, seen, depth);\n case SyntaxKind.PrefixUnaryExpression:\n return node.operator === SyntaxKind.ExclamationToken && this.javaPrintsBooleanValue(node.operand, seen, depth);\n case SyntaxKind.BinaryExpression:\n // the comparison and logical operators all print a Java primitive boolean (the\n // helpers they lower to are declared `public static boolean`), whatever the operands\n return JAVA_BOOLEAN_OPERATOR_KINDS.has(node.operatorToken.kind);\n case SyntaxKind.CallExpression:\n return this.javaPrintsBooleanCall(node, seen, depth);\n case SyntaxKind.ConditionalExpression:\n // both branches print a Java boolean value, so the whole `cond ? a : b` does:\n // the printed ternary yields a boolean (or its Boolean box once assigned)\n return this.javaPrintsBooleanValue(node.whenTrue, seen, depth)\n && this.javaPrintsBooleanValue(node.whenFalse, seen, depth);\n case SyntaxKind.PropertyAccessExpression:\n return this.javaBooleanBaseField(node) !== undefined;\n case SyntaxKind.Identifier:\n return this.javaBooleanBoxIdentifier(node, seen) !== undefined;\n }\n return false;\n }\n\n // the Java box of a `this.(...)` call whose generated body returns a boolean on every path:\n // the TS return type is a boolean family and every `return` in the resolved declaration prints a\n // Java boolean or a proven Boolean-or-null box. `depth` and `seen` bound the recursion.\n javaCallReturnsBooleanBox(node, seen: Set, depth: number): boolean {\n if (node?.kind !== SyntaxKind.CallExpression || depth > 2) {\n return false;\n }\n const checker: any = this.checkerOrUndefined();\n if (checker === undefined) {\n return false;\n }\n const declaration = checker.getResolvedSignature(node)?.declaration?.resolve();\n if (declaration === undefined || declaration.kind !== SyntaxKind.MethodDeclaration\n || declaration.body === undefined || seen.has(declaration)) {\n return false;\n }\n if (this.javaBooleanValueKind(node) === undefined) {\n return false; // the call's TS type is not a boolean family (any/undefined-able)\n }\n const callee = node.expression;\n if (!isPropertyAccessExpression(callee) || callee.expression.kind !== SyntaxKind.ThisKeyword) {\n return false; // only a method of this class; a foreign class is not under the printer\n }\n const name = String(callee.name.text);\n if (JAVA_THIS_BOOLEAN_METHODS.has(name) || JAVA_THIS_BOOLEAN_BOX_METHODS[name] !== undefined) {\n return false; // the hand-written base tables are authoritative for these accessors\n }\n const next = new Set(seen);\n next.add(declaration);\n let returns = 0;\n let ok = true;\n const scan = (current: Node) => {\n if (!ok) {\n return;\n }\n if (current !== declaration && isFunctionLike(current)) {\n return; // a nested function's returns are not the method's\n }\n if (isReturnStatement(current)) {\n returns++;\n const expression = current.expression;\n if (expression === undefined || !this.javaPrintsBooleanValue(expression, next, depth + 1)) {\n ok = false;\n return;\n }\n }\n current.forEachChild(scan);\n };\n scan(declaration.body);\n return ok && returns > 0;\n }\n\n // `Array.isArray(x)` prints `Helpers.isArray(x)` (`public static boolean`), the relational\n // Precise statics print `public static boolean` and the hand-written `public boolean` base\n // methods print a primitive boolean. Everything else - including the generated\n javaPrintsBooleanCall(node, seen: Set = new Set(), depth = 0): boolean {\n if (this.isArrayIsArrayCall(node)) {\n return true;\n }\n if (this.javaPreciseBooleanCall(node)) {\n return true;\n }\n if (this.javaStringAffixCall(node)) {\n return true;\n }\n const callee = node.expression;\n if (isPropertyAccessExpression(callee) && callee.expression.kind === SyntaxKind.ThisKeyword\n && JAVA_BOOLEAN_BASE_CALLS.has(String(callee.name.text))) {\n return true;\n }\n return this.javaCallReturnsBooleanBox(node, seen, depth);\n }\n\n // `s.startsWith(x)` / `s.endsWith(x)` on a checker-proven string receiver prints\n // `((String)s).startsWith(..)`, a primitive boolean (String.startsWith/endsWith)\n javaStringAffixCall(node): boolean {\n if (node?.kind !== SyntaxKind.CallExpression || (node.arguments?.length ?? 0) !== 1) {\n return false;\n }\n const callee: any = node.expression;\n if (!isPropertyAccessExpression(callee)) {\n return false;\n }\n const name = String(callee.name.text);\n if (name !== 'startsWith' && name !== 'endsWith') {\n return false;\n }\n const type = this.javaTypeOfNode(callee.expression);\n if (type === undefined || !this.isStringType(type.flags)) {\n return false;\n }\n return /^\\(\\(String\\)[\\s\\S]*\\.(startsWith|endsWith)\\([\\s\\S]*\\)$/.test(this.printNode(node, 0));\n }\n\n isArrayIsArrayCall(node): boolean {\n if (node === undefined || node.kind !== SyntaxKind.CallExpression) {\n return false;\n }\n const callee: any = node.expression;\n return isPropertyAccessExpression(callee)\n && String(callee.name.text) === 'isArray'\n && callee.expression.kind === SyntaxKind.Identifier\n && String((callee.expression as any).text) === 'Array'\n && (node.arguments?.length ?? 0) === 1;\n }\n\n // `this.` read of a hand-written base field declared `boolean`, or undefined. The\n // TsChecker guard keeps a field the hand-written base declares Object (or String) out.\n javaBooleanBaseField(node): string | undefined {\n if (!isPropertyAccessExpression(node) || node.expression.kind !== SyntaxKind.ThisKeyword) {\n return undefined;\n }\n const printed = this.printNode(node, 0);\n if (!JAVA_BOOLEAN_BASE_FIELDS.has(printed)) {\n return undefined;\n }\n const declaration = (this.checkerOrUndefined() as any).getSymbolAtLocation(node.name)?.valueDeclaration?.resolve();\n const type = this.javaTypeOfDeclaration(declaration) ?? this.javaTypeOfNode(node);\n return this.javaBooleanBoxType(type) ? printed : undefined;\n }\n\n // the Java name of an identifier that provably holds a Boolean box or null, so `Helpers.isTrue(x)`\n // IS `Boolean.TRUE.equals(x)`. Proof: the TS type (`boolean`, never `any`/`undefined`-able) plus\n // the D2 write scan: every write in the enclosing function must print a Java boolean value.\n javaBooleanBoxIdentifier(node, seen: Set): string | undefined {\n if (node?.kind !== SyntaxKind.Identifier || seen.has(node)) {\n return undefined;\n }\n const checker: any = this.checkerOrUndefined();\n if (checker === undefined) {\n return undefined;\n }\n const symbol = checker.getSymbolAtLocation(node);\n const decl = symbol?.valueDeclaration?.resolve();\n if (decl === undefined) {\n return undefined;\n }\n // only a local with its own initializer: a parameter (and the `optionalArgs[n]` prologue for an\n // optional one) is an `Object` box its CALLERS fill, so it is not proven boolean; a binding\n // element (`for (const b of ...)`, destructuring) is fed by the container, not a typed value.\n if (decl.kind !== SyntaxKind.VariableDeclaration) {\n return undefined;\n }\n let type;\n try {\n type = this.javaTypeOfDeclaration(decl);\n } catch (e) {\n type = undefined;\n }\n if (!this.javaBooleanBoxType(type)) {\n return undefined;\n }\n if (!this.javaBooleanWritesAreBoxed(symbol, decl, node, seen)) {\n return undefined;\n }\n return this.printNode(node, 0);\n }\n\n // every value written to the symbol prints a Java boolean. The scan runs over the function\n // the DECLARATION lives in (a local can only be written inside it or inside a closure nested\n // in it), so a write in an enclosing scope is never missed.\n javaBooleanWritesAreBoxed(symbol, decl, node, seen: Set): boolean {\n const next = new Set(seen);\n next.add(node);\n return this.javaWritesAreBoxed(symbol, decl, next, (value) => this.javaPrintsBooleanValue(value, next), false);\n }\n\n // shared D2 write scan over the function the declaration lives in: the initializer and every\n // identifier write must pass `accepts`; `tuples` also checks `[ x, params ] = ...` destructures\n javaWritesAreBoxed(symbol, decl, next: Set, accepts: (value: any) => boolean, tuples: boolean): boolean {\n let fn = decl.parent;\n while (fn !== undefined && !isFunctionLike(fn)) {\n fn = fn.parent;\n }\n if (fn === undefined) {\n return false;\n }\n if (decl.initializer !== undefined && !accepts(decl.initializer)) {\n return false;\n }\n let ok = true;\n const scan = (current: Node) => {\n if (!ok) {\n return;\n }\n if ((isForOfStatement(current) || isForInStatement(current))\n && isIdentifier(current.initializer)) {\n // `for (x of list)` re-fills the box from the container\n const loop = (this.checkerOrUndefined() as any).getSymbolAtLocation(current.initializer);\n if (loop === symbol) {\n ok = false;\n return;\n }\n }\n if (isBinaryExpression(current)\n && JAVA_ASSIGNMENT_OPERATOR_KINDS.has(current.operatorToken.kind)) {\n if (isIdentifier(current.left)) {\n const left = (this.checkerOrUndefined() as any).getSymbolAtLocation(current.left);\n if (left === symbol && !accepts(current.right)) {\n ok = false;\n return;\n }\n } else if (tuples && isArrayLiteralExpression(current.left)) {\n // `[ x, params ] = this.handle*Bool (...)` binds element `index`\n const index = current.left.elements.findIndex((element: any) => isIdentifier(element)\n && (this.checkerOrUndefined() as any).getSymbolAtLocation(element) === symbol);\n if (index !== -1 && !this.javaBooleanBoxTupleElement(current.right, index)) {\n ok = false;\n return;\n }\n }\n }\n current.forEachChild(scan);\n };\n scan(fn);\n return ok;\n }\n\n // the declared Java type the ccxt-side declaration chain gave this local/param, via the\n // javaDeclaredLocalTypeResolver hook (build/java-local-types.js): `boolean` prints as the\n // primitive, so the identifier IS the condition; `Boolean` is the nullable box (isTrue = equals).\n javaDeclaredBooleanKind(node): 'boolean' | 'Boolean' | undefined {\n const declaration = this.javaDeclarationOfIdentifier(node);\n if (declaration === undefined || node.text !== declaration.name?.text) {\n return undefined; // a capture rename prints `final Object finalX = x`\n }\n let declared;\n try {\n declared = this.javaDeclaredTypeOfDeclaration(declaration);\n } catch (e) {\n return undefined;\n }\n return declared === 'boolean' || declared === 'Boolean' ? declared : undefined;\n }\n\n // the DECLARED type of the local is a nullable boolean: `Bool` (`boolean | undefined`) or an\n // equivalent union. Every member must be boolean or nullish - an `Int`/`Str`/`any` member can\n // hold a box the isTrue helper tests with its runtime truthiness, so the helper must stay.\n javaNullableBooleanDeclaration(declaration): boolean {\n if (declaration?.kind !== SyntaxKind.VariableDeclaration) {\n return false;\n }\n const type = this.javaTypeOfDeclaration(declaration);\n if (type === undefined) {\n return false;\n }\n const flags: number = type.flags ?? 0;\n if ((flags & (TypeFlags.Any | TypeFlags.Unknown)) !== 0) {\n return false;\n }\n if ((flags & TypeFlags.Boolean) !== 0) {\n return false; // the plain `boolean` is the strict box family's own proof\n }\n if ((flags & TypeFlags.Union) === 0) {\n return false;\n }\n const members: any[] = (type as any).getTypes?.() ?? [];\n if (members.length === 0) {\n return false;\n }\n const booleanish = (member: any) => (((member?.flags ?? 0) & JAVA_NULLABLE_BOOLEAN_MEMBER_FLAGS) !== 0);\n const hasBoolean = members.some((member: any) => (((member?.flags ?? 0) & (TypeFlags.Boolean | TypeFlags.BooleanLiteral)) !== 0));\n return hasBoolean && members.every(booleanish);\n }\n\n // a value the nullable-boolean write scan accepts: a Java boolean value this printer proves, a\n // nullish literal, or a safeBool-family accessor whose other paths return the caller's default\n // (Boolean or null). A Long/Int/String/List box would change what isTrue answers.\n javaPrintsBooleanBoxValue(node, seen: Set): boolean {\n if (node === undefined) {\n return false;\n }\n if (node.kind === SyntaxKind.ParenthesizedExpression || node.kind === SyntaxKind.AsExpression\n || node.kind === SyntaxKind.NonNullExpression) {\n return this.javaPrintsBooleanBoxValue(node.expression, seen);\n }\n if (node.kind === SyntaxKind.NullKeyword) {\n return true;\n }\n if (node.kind === SyntaxKind.Identifier && node.text === 'undefined') {\n return true; // prints null\n }\n if (this.javaPrintsBooleanValue(node, seen)) {\n return true;\n }\n if (node.kind === SyntaxKind.Identifier && this.javaNullableBooleanBoxIdentifier(node, seen) !== undefined) {\n return true; // a local whose declared type is the nullable boolean and every write boxes\n }\n if (node.kind === SyntaxKind.Identifier && this.javaBooleanTupleBindingIdentifier(node, seen) !== undefined) {\n return true;\n }\n if (node.kind === SyntaxKind.CallExpression) {\n return this.javaCallBooleanKind(node) !== undefined;\n }\n return false;\n }\n\n // element `index` of a `[ x, params ] = this.handle*Bool (...)` destructure is a Boolean-or-null\n // box: those accessors return a safeBool result, never the raw member when not a Boolean. The\n // handleOptionAndParams family returns the raw member and is deliberately not a box proof.\n javaBooleanBoxTupleElement(node, index: number): boolean {\n if (node?.kind !== SyntaxKind.CallExpression) {\n return false;\n }\n const callee = node.expression;\n if (!isPropertyAccessExpression(callee) || callee.expression.kind !== SyntaxKind.ThisKeyword) {\n return false;\n }\n const name = String(callee.name.text);\n if (!JAVA_BOOLEAN_BOX_TUPLE_METHODS.has(name)) {\n return false;\n }\n const declaration: any = this.getChecker().getResolvedSignature(node)?.declaration?.resolve();\n if (declaration?.name?.text !== name) {\n return false; // a same-named override is not the base accessor\n }\n return index === 0;\n }\n\n // `const [ x, p ] = this.handle*Bool (...)` binds x to element 0, a Boolean-or-null box; any\n // later identifier or tuple write must also be a proven box (the D2 scan over the function)\n javaBooleanTupleBindingIdentifier(node, seen: Set = new Set()): string | undefined {\n if (node?.kind !== SyntaxKind.Identifier) {\n return undefined;\n }\n const checker: any = this.checkerOrUndefined();\n if (checker === undefined) {\n return undefined;\n }\n const symbol = checker.getSymbolAtLocation(node);\n const element = symbol?.valueDeclaration?.resolve();\n if (element === undefined || element.kind !== SyntaxKind.BindingElement || element.initializer !== undefined\n || element.dotDotDotToken !== undefined || element.name?.text !== node.text || seen.has(element)) {\n return undefined;\n }\n const pattern = element.parent;\n const declaration = pattern?.parent;\n if (pattern?.kind !== SyntaxKind.ArrayBindingPattern || declaration?.kind !== SyntaxKind.VariableDeclaration\n || !this.javaBooleanBoxTupleElement(declaration.initializer, pattern.elements.indexOf(element))) {\n return undefined;\n }\n const next = new Set(seen);\n next.add(element);\n const binding = { initializer: undefined, parent: declaration };\n if (!this.javaWritesAreBoxed(symbol, binding, next, (value) => this.javaPrintsBooleanBoxValue(value, next), true)) {\n return undefined;\n }\n return this.printNode(node, 0);\n }\n\n // the D2 scan over a nullable boolean local: every write prints a Java boolean value or a\n // proven Boolean-or-null box, so no path can leave a truthy non-boolean box in it\n javaBooleanNullableWritesAreBoxed(symbol, declaration, node, seen: Set): boolean {\n const next = new Set(seen);\n next.add(node);\n next.add(declaration); // a write scan that reaches this declaration again stops\n return this.javaWritesAreBoxed(symbol, declaration, next, (value) => this.javaPrintsBooleanBoxValue(value, next), true);\n }\n\n // `Helpers.isTrue(x)` where the DECLARED type of x is a nullable boolean and every write is a\n // proven Boolean-or-null box: `Boolean.TRUE.equals(x)` is exactly what the helper answers on\n // such a box (null and FALSE test false, TRUE tests true)\n javaNullableBooleanBoxIdentifier(node, seen: Set = new Set()): string | undefined {\n if (node?.kind !== SyntaxKind.Identifier) {\n return undefined;\n }\n const checker: any = this.checkerOrUndefined();\n if (checker === undefined) {\n return undefined;\n }\n const symbol = checker.getSymbolAtLocation(node);\n const declaration = symbol?.valueDeclaration?.resolve();\n if (declaration === undefined || declaration.name?.text !== node.text) {\n return undefined;\n }\n if (seen.has(declaration)) {\n return undefined; // a write graph that reaches this declaration again keeps the helper\n }\n if (!this.javaNullableBooleanDeclaration(declaration)) {\n return undefined;\n }\n if (!this.javaBooleanNullableWritesAreBoxed(symbol, declaration, node, seen)) {\n return undefined;\n }\n return this.printNode(node, 0);\n }\n\n // the native Java a falsy wrapper around this condition prints, or undefined to keep\n // `Helpers.isTrue(...)`: a hand-written boolean field prints bare; `Array.isArray(x)` prints\n // `Helpers.isArray(x)` (null -> false like helper); a proven Boolean box: `Boolean.TRUE.equals(x)`\n javaBooleanWrapperFreeCondition(node): string | undefined {\n if (node === undefined) {\n return undefined;\n }\n if (node.kind === SyntaxKind.ParenthesizedExpression) {\n return this.javaBooleanWrapperFreeCondition(node.expression);\n }\n if (this.isArrayIsArrayCall(node)) {\n return `(${this.printNode(node.arguments[0], 0)} instanceof java.util.List)`;\n }\n if (this.javaStringAffixCall(node)) {\n return this.printNode(node, 0);\n }\n const field = this.javaBooleanBaseField(node);\n if (field !== undefined) {\n return field;\n }\n // a `this.(...)` call whose generated body returns a boolean value on every path\n // prints a Boolean box; the bare declarations in JAVA_THIS_BOOLEAN_METHODS are printed\n // native by printCondition and are left to it\n if (node.kind === SyntaxKind.CallExpression && this.javaCallBooleanKind(node) === undefined\n && this.javaCallReturnsBooleanBox(node, new Set(), 0)) {\n return `Boolean.TRUE.equals(${this.printNode(node, 0)})`;\n }\n if (node.kind === SyntaxKind.Identifier) {\n // the ccxt-side declaration chain types a local/param `boolean`/`Boolean` inside\n // javaDeclaredLocalTypeResolver: a primitive declaration IS the condition, a box\n // needs the null-safe TRUE test the helper performs\n const declared = this.javaDeclaredBooleanKind(node);\n if (declared === 'boolean') {\n return this.printNode(node, 0);\n }\n if (declared === 'Boolean') {\n return `Boolean.TRUE.equals(${this.printNode(node, 0)})`;\n }\n }\n const box = this.javaBooleanBoxIdentifier(node, new Set()) ?? this.javaNullableBooleanBoxIdentifier(node)\n ?? this.javaBooleanTupleBindingIdentifier(node);\n return box === undefined ? undefined : `Boolean.TRUE.equals(${box})`;\n }\n\n printCondition(node, identation) {\n if (this.javaConditionPrintsBoolean(node)) {\n return this.getIden(identation) + this.printNode(node, 0);\n }\n let bareCall = node;\n while (bareCall.kind === SyntaxKind.ParenthesizedExpression) {\n bareCall = bareCall.expression;\n }\n if (bareCall.kind === SyntaxKind.CallExpression && this.javaCallPrintsNonNullBoolean(bareCall, 0)) {\n return this.getIden(identation) + this.printNode(node, 0); // a never-null Boolean unboxes safely\n }\n const wrapperFree = this.javaBooleanWrapperFreeCondition(node);\n if (wrapperFree !== undefined) {\n return this.getIden(identation) + wrapperFree;\n }\n const callKind = this.javaCallBooleanKind(bareCall);\n if (callKind === 'boolean') {\n return this.getIden(identation) + this.printNode(node, 0);\n }\n if (callKind === 'nullableBoolean') {\n // Helpers.isTrue(box) on a Boolean-or-null box is Boolean.TRUE.equals(box): null\n // and FALSE test false, TRUE tests true\n return this.getIden(identation) + `Boolean.TRUE.equals(${this.printNode(node, 0)})`;\n }\n return super.printCondition(node, identation);\n }\n\n printConditionalExpression(node, _identation) {\n const condition = this.printCondition(node.condition, 0);\n const whenTrue = this.printNode(node.whenTrue, 0);\n const whenFalse = this.printNode(node.whenFalse, 0);\n return `((${condition})) ? ${whenTrue} : ${whenFalse}`;\n }\n\n printDeleteExpression(node, _identation) {\n const object = this.printNode(node.expression.expression, 0);\n const key = this.printNode(node.expression.argumentExpression, 0);\n return `((java.util.Map)${object}).remove((String)${key})`;\n }\n\n printThrowStatement(node, identation) {\n if (node.expression.kind === SyntaxKind.Identifier) {\n // a bare rethrow (`throw e`) of a caught java.lang.Exception is a checked\n // exception, which the surrounding async lambdas cannot declare - keep\n // unchecked exceptions (ccxt errors extend RuntimeException) as-is and\n // wrap checked ones, preserving the original as the cause\n const name = this.printNode(node.expression, 0);\n return (\n this.getIden(identation) +\n `${this.THROW_TOKEN} (${name} instanceof RuntimeException ? (RuntimeException)${name} : new RuntimeException(${name}))${this.LINE_TERMINATOR}`\n );\n }\n if (node.expression.kind === SyntaxKind.NewExpression) {\n const expression = node.expression;\n const argumentsExp = expression?.arguments ?? [];\n const parsedArg = argumentsExp.map((n) => this.printNode(n, 0)).join(\",\") ?? \"\";\n const newExpression = this.printNode(expression.expression, 0);\n if (expression.expression.kind === SyntaxKind.Identifier) {\n const id = expression.expression;\n // java.lang.Error is a sibling of Exception under Throwable, so\n // `catch (Exception e)` won't catch it. Map JS/TS `Error` to\n // RuntimeException so standard catch blocks work.\n const exceptionName = id.text === \"Error\" ? \"RuntimeException\" : id.text;\n const symbol = this.getChecker().getSymbolAtLocation(expression.expression);\n if (symbol) {\n const declarations =\n (this.getChecker().getDeclaredTypeOfSymbol(symbol).getSymbol()?.declarations ?? []).map((d) => d.resolve());\n const isClassDeclaration = declarations.find(\n (l) =>\n l.kind === SyntaxKind.InterfaceDeclaration ||\n l.kind === SyntaxKind.ClassDeclaration\n );\n if (isClassDeclaration) {\n return (\n this.getIden(identation) +\n `${this.THROW_TOKEN} ${this.NEW_TOKEN} ${exceptionName}((String)${parsedArg}) ${this.LINE_TERMINATOR}`\n );\n } else {\n return (\n this.getIden(identation) +\n `Helpers.throwDynamicException(${exceptionName}, ${parsedArg});return null;`\n );\n }\n }\n return (\n this.getIden(identation) +\n `${this.THROW_TOKEN} ${this.NEW_TOKEN} ${exceptionName}(${parsedArg}) ${this.LINE_TERMINATOR}`\n );\n } else if (expression.expression.kind === SyntaxKind.ElementAccessExpression) {\n return this.getIden(identation) + `Helpers.throwDynamicException(${newExpression}, ${parsedArg});`;\n }\n return super.printThrowStatement(node, identation);\n }\n }\n\n csModifiers = {};\n\n printPropertyAccessModifiers(node) {\n let modifiers = this.printModifiers(node);\n if (modifiers === \"\") {\n modifiers = this.defaultPropertyAccess;\n }\n // add type\n let typeText = \"Object\";\n if (node.type) {\n typeText = this.getType(node);\n if (!typeText) {\n if (node.type.kind === SyntaxKind.AnyKeyword) {\n typeText = this.OBJECT_KEYWORD + \" \";\n }\n }\n }\n return modifiers + \" \" + typeText + \" \";\n }\n\n printModifiers(node) {\n let modifiers = node.modifiers;\n if (modifiers === undefined) {\n return \"\";\n }\n modifiers = modifiers.filter(mod => this.FuncModifiers[mod.kind] && mod.kind !== SyntaxKind.AsyncKeyword);\n return modifiers.map(modifier => this.FuncModifiers[modifier.kind]).join(\" \");\n }\n\n // literals printed as `Helpers.newMap(k, v, ...)` (no anonymous class, so no capture rule)\n builderObjectLiterals: WeakSet = new WeakSet();\n\n printObjectLiteralExpression(node, identation) {\n if (node.properties.length > 0 && node.properties.every((p) => isPropertyAssignment(p)) &&\n this.objectLiteralCapturesReassigned(node)) {\n this.builderObjectLiterals.add(node);\n return this.printObjectLiteralBuilder(node, identation);\n }\n this.builderObjectLiterals.delete(node);\n const objectBody = this.printObjectLiteralBody(node, identation);\n const formattedObjectBody = objectBody ? \"\\n\" + objectBody + \"\\n\" + this.getIden(identation) : objectBody;\n return this.OBJECT_OPENING + formattedObjectBody + this.OBJECT_CLOSING;\n }\n\n printObjectLiteralBuilder(node, identation) {\n // a comparison inside the values must not mark a captured local as reassigned\n // (that flag drives the async-parameter copies and the typed-parameter write casts)\n const keys = this.objectLiteralCapturedKeys(node);\n const saved = keys.map((key) => this.ReassignedVars[key]);\n try {\n return this.printObjectLiteralBuilderText(node, identation);\n } finally {\n keys.forEach((key, i) => {\n if (saved[i] === undefined) {\n delete this.ReassignedVars[key];\n } else {\n this.ReassignedVars[key] = saved[i];\n }\n });\n }\n }\n\n printObjectLiteralBuilderText(node, identation) {\n const props = node.properties;\n const lines = props.map((prop, i) => {\n const name = this.printNode(prop.name, 0);\n const custom = this.printCustomRightSidePropertyAssignment(prop.initializer, identation + 1);\n const value = (custom ? custom : this.printNode(prop.initializer, identation + 1)).trim();\n let comment = this.printTraillingComment(prop, identation + 1);\n comment = comment ? \" \" + comment : \"\";\n const sep = i < props.length - 1 ? \",\" : \"\";\n return this.getIden(identation + 1) + name + \", \" + value + sep + comment;\n });\n return \"Helpers.newMap(\\n\" + lines.join(\"\\n\") + \"\\n\" + this.getIden(identation) + \")\";\n }\n\n printObjectLiteralBody(node, identation) {\n const body = node.properties.map((p) => this.printNode(p, identation+1)).join(\"\\n\");\n // body = body.replaceAll('this.', `${name}.this.`);\n return body;\n }\n\n printForStatement(node, identation) {\n const initializer = this.printNode(node.initializer, 0).replace('Object ', 'var ');\n const condition = this.printNode(node.condition, 0);\n const incrementor = this.printNode(node.incrementor, 0);\n\n const forStm = this.getIden(identation) +\n this.FOR_TOKEN + \" \" +\n this.CONDITION_OPENING +\n initializer + \"; \" + condition + \"; \" + incrementor +\n this.CONDITION_CLOSE +\n this.printBlock(node.statement, identation);\n return this.printNodeCommentsIfAny(node, identation, forStm);\n }\n\n printReturnStatement(node, identation) {\n const leadingComment = this.printLeadingComments(node, identation);\n let trailingComment = this.printTraillingComment(node, identation);\n trailingComment = trailingComment ? \" \" + trailingComment : trailingComment;\n let exp = node.expression;\n if (exp && exp.kind === SyntaxKind.AsExpression && (exp.expression.kind === SyntaxKind.ObjectLiteralExpression || SyntaxKind.CallExpression)) {\n exp = exp.expression; // go over something like return {} as SomeType\n }\n let rightPart = exp ? (' ' + this.printNode(exp, identation)) : '';\n rightPart = rightPart.trim();\n if (!rightPart) {\n // bare return; — check if inside async method (supplyAsync lambda needs return null)\n let parent = node.parent;\n while (parent) {\n if (isFunctionDeclaration(parent) || isMethodDeclaration(parent) || isFunctionExpression(parent) || isArrowFunction(parent)) {\n if (this.isAsyncFunction(parent)) {\n rightPart = 'null';\n }\n break;\n }\n parent = parent.parent;\n }\n }\n rightPart = rightPart ? ' ' + rightPart + this.LINE_TERMINATOR : this.LINE_TERMINATOR;\n return leadingComment + this.getIden(identation) + this.RETURN_TOKEN + rightPart + trailingComment;\n }\n\n private allBranchesTerminate(node: Node): boolean {\n if (isReturnStatement(node) || isThrowStatement(node)) {\n return true;\n }\n if (isBlock(node)) {\n const stmts = node.statements;\n return stmts.length > 0 && this.allBranchesTerminate(stmts[stmts.length - 1]);\n }\n if (isIfStatement(node)) {\n if (!node.elseStatement) {\n return false; // no else: not all paths covered\n }\n return this.allBranchesTerminate(node.thenStatement) && this.allBranchesTerminate(node.elseStatement);\n }\n return false;\n }\n}\n","import { BaseTranspiler } from \"./baseTranspiler.js\";\nimport { SyntaxKind, type Block, type CallExpression, type Declaration, type Expression, type Identifier, type Node, type NodeArray, type ParameterDeclaration, type SourceFile, type VariableDeclaration } from \"typescript/unstable/ast\";\nimport { isArrayLiteralExpression, isArrowFunction, isAsExpression, isBinaryExpression, isBindingElement, isBlock, isCallExpression, isClassDeclaration, isClassExpression, isConditionalExpression, isDeleteExpression, isElementAccessExpression, isForInStatement, isForOfStatement, isIdentifier, isMethodDeclaration, isNoSubstitutionTemplateLiteral, isNonNullExpression, isNumericLiteral, isObjectLiteralExpression, isParameterDeclaration, isParenthesizedExpression, isPrefixUnaryExpression, isPropertyAccessExpression, isReturnStatement, isShorthandPropertyAssignment, isSourceFile, isStatement, isStringLiteral, isStringLiteralLikeNode, isTypeAssertion, isVariableDeclaration } from \"typescript/unstable/ast/is\";\nimport { IndexKind, ObjectFlags, SignatureKind, SymbolFlags, TypeFlags, type Symbol as TsSymbol, type Type } from \"typescript/unstable/sync\";\nimport { findAncestor, getAllSuperTypeNodes, isFunctionLike, signatureDeclaration, symbolDeclarations, symbolValueDeclaration, typeParts, typeTarget } from \"./tsUtils.js\";\n\nconst parserConfig = {\n 'ELSEIF_TOKEN': 'else if',\n 'OBJECT_OPENING': '{',\n 'OBJECT_CLOSING': '}',\n 'ARRAY_OPENING_TOKEN': 'Value::from(vec![',\n 'ARRAY_CLOSING_TOKEN': '])',\n 'PROPERTY_ASSIGNMENT_TOKEN': ':',\n 'VAR_TOKEN': 'let mut',\n 'METHOD_TOKEN': 'fn',\n 'FUNCTION_TOKEN': 'fn',\n 'PROPERTY_ASSIGNMENT_OPEN': '',\n 'PROPERTY_ASSIGNMENT_CLOSE': '',\n 'SUPER_TOKEN': 'super',\n 'SUPER_CALL_TOKEN': 'super',\n 'FALSY_WRAPPER_OPEN': 'is_true(&',\n 'FALSY_WRAPPER_CLOSE': ')',\n 'COMPARISON_WRAPPER_OPEN': 'is_equal(&',\n 'COMPARISON_WRAPPER_CLOSE': ')',\n 'UKNOWN_PROP_WRAPPER_OPEN': '',\n 'UNKOWN_PROP_WRAPPER_CLOSE': '',\n 'UKNOWN_PROP_ASYNC_WRAPPER_OPEN': '',\n 'UNKOWN_PROP_ASYNC_WRAPPER_CLOSE': '',\n 'DYNAMIC_CALL_OPEN': '',\n 'EQUALS_EQUALS_WRAPPER_OPEN': 'is_equal(&',\n 'EQUALS_EQUALS_WRAPPER_CLOSE': ')',\n 'DIFFERENT_WRAPPER_OPEN': '!is_equal(&',\n 'DIFFERENT_WRAPPER_CLOSE': ')',\n 'GREATER_THAN_WRAPPER_OPEN': 'is_greater_than(&',\n 'GREATER_THAN_WRAPPER_CLOSE': ')',\n 'GREATER_THAN_EQUALS_WRAPPER_OPEN': 'is_greater_than_or_equal(&',\n 'GREATER_THAN_EQUALS_WRAPPER_CLOSE': ')',\n 'LESS_THAN_WRAPPER_OPEN': 'is_less_than(&',\n 'LESS_THAN_WRAPPER_CLOSE': ')',\n 'LESS_THAN_EQUALS_WRAPPER_OPEN': 'is_less_than_or_equal(&',\n 'LESS_THAN_EQUALS_WRAPPER_CLOSE': ')',\n 'PLUS_WRAPPER_OPEN': 'add(&',\n 'PLUS_WRAPPER_CLOSE': ')',\n 'MINUS_WRAPPER_OPEN': 'subtract(&',\n 'MINUS_WRAPPER_CLOSE': ')',\n 'ARRAY_LENGTH_WRAPPER_OPEN': 'get_array_length(&',\n 'ARRAY_LENGTH_WRAPPER_CLOSE': ')',\n 'DIVIDE_WRAPPER_OPEN': 'divide(&',\n 'DIVIDE_WRAPPER_CLOSE': ')',\n 'MULTIPLY_WRAPPER_OPEN': 'multiply(&',\n 'MULTIPLY_WRAPPER_CLOSE': ')',\n 'INDEXOF_WRAPPER_OPEN': 'get_index_of(&',\n 'INDEXOF_WRAPPER_CLOSE': ')',\n 'MOD_WRAPPER_OPEN': 'mod_val(&',\n 'MOD_WRAPPER_CLOSE': ')',\n 'LINE_TERMINATOR': ';',\n 'CONDITION_OPENING': '',\n 'CONDITION_CLOSE': '',\n 'AWAIT_TOKEN': '',\n 'NULL_TOKEN': 'Value::Null',\n 'UNDEFINED_TOKEN': 'Value::Null',\n 'WHILE_TOKEN': 'while',\n 'ELEMENT_ACCESS_WRAPPER_OPEN': 'get_value(&',\n 'ELEMENT_ACCESS_WRAPPER_CLOSE': ')',\n 'DEFAULT_PARAMETER_TYPE': 'Value',\n 'DEFAULT_RETURN_TYPE': 'Value',\n 'BLOCK_OPENING_TOKEN': '{',\n 'TRUE_KEYWORD': 'Value::Bool(true)',\n 'FALSE_KEYWORD': 'Value::Bool(false)',\n};\n\n/** Answer of `RustTranspiler.rustDeclaredLocalTypeResolver` for a local whose\n * value provably holds a `Value::Dict` at every use. */\nexport type RustDeclaredLocalKind = 'dict';\n\n/** One `let x: Value = ` declaration. `kind` is only\n * answered by the resolver when `alwaysDict && stable`. */\nexport interface RustDeclaredDictLocalEntry {\n kind: RustDeclaredLocalKind;\n name: string;\n /** printed callee of the initialiser: a `safe_dict*` name, or `value_map`. */\n source: string;\n /** the `safe_dict*` `optionalArgs` default is itself Dict-proven, so the\n * helper returns a Dict on every path (it returns that default when the\n * key does not hold one). */\n alwaysDict: boolean;\n /** no later write in the enclosing function can change the kind (D2). */\n stable: boolean;\n /** use census: element-access receiver / kind-preserving mutator / anything else. */\n uses: { elementAccess: number, mutHelper: number, other: number };\n declaration: VariableDeclaration;\n start: number;\n}\n\n/** A `Dict`/`List` parameter whose body uses are all printable reads: the\n * printer re-binds the same name to a borrowed container at fn entry\n * (`let x = x.as_map().unwrap_or(&__x_empty);`) so every read is native. */\nexport interface RustParamShadow {\n kind: RustParamShadowKind;\n /** the parameter name; the shadow re-binds it, the `Value` ABI is untouched. */\n name: string;\n declaration: ParameterDeclaration;\n}\n\n/** Shadow kinds: `&IndexMap` / `&Vec` (D-25). */\nexport type RustParamShadowKind = 'map' | 'list';\n\n/** Vocabulary of the parameter-shadow table (`RustTranspiler.rustParamShadowOf`). */\nexport const RUST_PARAM_SHADOWS = {\n MAP: 'map' as RustParamShadowKind,\n LIST: 'list' as RustParamShadowKind,\n /** `this.` reads inlined natively against a shadowed dict param. */\n SAFE_READS: new Set([\n 'safeValue', 'safeString', 'safeInteger', 'safeNumber', 'safeBool',\n 'safeDict', 'safeList',\n ]),\n};\n\n/** Vocabulary of the declared-Dict locals table (see\n * `RustTranspiler.rustDeclaredLocalTypeResolver`). */\nexport const RUST_DECLARED_DICT_LOCALS = {\n /** value the resolver answers for a proven Dict local */\n DICT: 'dict' as RustDeclaredLocalKind,\n /** printed `self.` -> index of its `optionalArgs` parameter.\n * `safe_dict*` returns `optional_args[0]` whenever the key holds a non-Dict. */\n SAFE_CALLEES: {\n safe_dict_k: 2,\n safe_dict: 2,\n safe_dict_n: 2,\n safe_dict2: 3,\n } as Record,\n /** `&mut` receivers whose writes land inside the container, so a Dict local\n * stays a Dict (`add_element_to_object` / `append_to_array` no-op on a\n * non-container, `set_value` / `remove` write a key). */\n KIND_PRESERVING_MUTATORS: new Set([\n 'add_element_to_object', 'append_to_array', 'set_value', 'remove',\n 'get_value_mut',\n ]),\n};\n\n/** `x = ..` / `x += ..` — every token that writes a place. */\nfunction rustIsAssignmentOperator(kind: SyntaxKind): boolean {\n return kind === SyntaxKind.EqualsToken ||\n (kind >= SyntaxKind.PlusEqualsToken && kind <= SyntaxKind.CaretEqualsToken);\n}\n\n/** Preorder (forEachChild order) of a scope's descendants, decoded once: `end[i]` is the index past\n * node i's subtree; `byName` lists identifiers and name-binding declarations per name text. */\ninterface RustScopeIndex {\n nodes: Node[];\n end: number[];\n byName: Map | undefined;\n}\n\nconst RUST_NAME_BINDER_KINDS = new Set([\n SyntaxKind.VariableDeclaration, SyntaxKind.Parameter, SyntaxKind.FunctionDeclaration,\n SyntaxKind.ClassDeclaration, SyntaxKind.PropertyDeclaration, SyntaxKind.FunctionExpression,\n SyntaxKind.ArrowFunction,\n]);\n\nconst RUST_WALK_SKIP = 1;\nconst RUST_WALK_STOP = 2;\n\nfunction rustBuildScopeIndex(scope: Node): RustScopeIndex {\n const nodes: Node[] = [];\n const end: number[] = [];\n const visit = (n: any) => {\n const i = nodes.length;\n nodes.push(n);\n end.push(0);\n n.forEachChild(visit);\n end[i] = nodes.length;\n };\n scope.forEachChild(visit);\n return { nodes, end, byName: undefined };\n}\n\n// name text decoding is the costly part, so the name table is built on first use only\nfunction rustScopeNameTable(index: RustScopeIndex): Map {\n if (index.byName !== undefined) return index.byName;\n const byName = new Map();\n const add = (name: string, i: number) => {\n const list = byName.get(name);\n if (list === undefined) byName.set(name, [i]);\n else if (list[list.length - 1] !== i) list.push(i);\n };\n const nodes: any[] = index.nodes;\n for (let i = 0; i < nodes.length; i++) {\n const n = nodes[i];\n const kind = n.kind;\n if (RUST_NAME_BINDER_KINDS.has(kind) && n.name?.kind === SyntaxKind.Identifier) add(n.name.text, i);\n if (kind === SyntaxKind.Identifier) add(n.text, i);\n }\n index.byName = byName;\n return byName;\n}\n\nexport class RustTranspiler extends BaseTranspiler {\n\n private rustScopeIndexes = new WeakMap();\n\n rustScopeIndex(scope: Node): RustScopeIndex {\n let index = this.rustScopeIndexes.get(scope);\n if (index === undefined) {\n index = rustBuildScopeIndex(scope);\n this.rustScopeIndexes.set(scope, index);\n }\n return index;\n }\n\n /** `scope.forEachChild(visit)` recursion over the cached preorder: `visit` answers\n * RUST_WALK_SKIP to skip the node's subtree, RUST_WALK_STOP to end the walk. */\n rustWalkScope(scope: Node, visit: (n: any) => number | void): void {\n const { nodes, end } = this.rustScopeIndex(scope);\n for (let i = 0; i < nodes.length;) {\n const r = visit(nodes[i]);\n if (r === RUST_WALK_STOP) return;\n i = r === RUST_WALK_SKIP ? end[i] : i + 1;\n }\n }\n\n /** Scope nodes that are an identifier or a name-binding declaration spelled `name`, in walk order. */\n rustScopeNameNodes(scope: Node, name: string): Node[] {\n const index = this.rustScopeIndex(scope);\n return (rustScopeNameTable(index).get(name) ?? []).map((i) => index.nodes[i]);\n }\n\n // node kinds the printer types that the core per-file prefetch leaves to single round trips\n private static readonly RUST_PREFETCH_TYPE_KINDS = new Set([\n SyntaxKind.FalseKeyword, SyntaxKind.TrueKeyword, SyntaxKind.ParenthesizedExpression,\n SyntaxKind.AwaitExpression, SyntaxKind.PrefixUnaryExpression,\n SyntaxKind.BooleanKeyword, SyntaxKind.ObjectKeyword, SyntaxKind.UnionType,\n SyntaxKind.ConditionalExpression, SyntaxKind.AsExpression,\n ]);\n\n /** One bulk getTypeAtLocation for the class's nodes of those kinds, seeding the checker memo. */\n rustPrefetchClassTypes(node: Node): void {\n const getType: any = this.checkerOrUndefined()?.getTypeAtLocation;\n if (getType?.seed === undefined || getType.original === undefined) return;\n const kinds = RustTranspiler.RUST_PREFETCH_TYPE_KINDS;\n const nodes: Node[] = [];\n for (const n of this.rustScopeIndex(node).nodes) {\n if (kinds.has(n.kind) && !getType.has(n)) nodes.push(n);\n }\n if (nodes.length === 0) return;\n let results: unknown[];\n try {\n results = getType.original(nodes);\n } catch (e) {\n return; // the lazy per-node path answers them\n }\n nodes.forEach((n, i) => getType.seed(n, results[i]));\n }\n\n binaryExpressionsWrappers;\n methodSignatures: Record;\n forLoopCounter: number;\n /** The handler `message` parameter a shadow is being printed for (set only\n * while its method body is printed). */\n rustProHandlerShadowParam: ParameterDeclaration | undefined;\n\n constructor(config = {}) {\n config['parser'] = Object.assign({}, parserConfig, config['parser'] ?? {});\n super(config);\n\n this.requiresParameterType = true;\n this.requiresReturnType = false;\n this.asyncTranspiling = true;\n this.supportsFalsyOrTruthyValues = false;\n this.id = \"Rust\";\n this.className = \"undefined\";\n this.methodSignatures = {};\n this.forLoopCounter = 0;\n\n this.initConfig();\n this.applyUserOverrides(config);\n }\n\n initConfig() {\n this.LeftPropertyAccessReplacements = {};\n\n this.RightPropertyAccessReplacements = {};\n\n this.FullPropertyAccessReplacements = {\n 'console.log': 'println_val',\n 'Math.floor': 'math_floor',\n 'Math.ceil': 'math_ceil',\n 'Math.round': 'math_round',\n };\n\n this.CallExpressionReplacements = {};\n\n this.ReservedKeywordsReplacements = {\n 'type': 'type_var',\n 'move': 'move_val',\n 'ref': 'ref_val',\n 'str': 'str_val',\n 'use': 'use_val',\n 'mod': 'mod_kw',\n 'loop': 'loop_val',\n 'match': 'match_val',\n 'where': 'where_val',\n 'final': 'final_val',\n 'box': 'box_val',\n 'become': 'become_val',\n 'priv': 'priv_val',\n 'override': 'override_val',\n 'unsized': 'unsized_val',\n 'async': 'async_val',\n 'await': 'await_val',\n 'try': 'try_val',\n 'abstract': 'abstract_val',\n 'dyn': 'dyn_val',\n 'fn': 'fn_val',\n 'impl': 'impl_val',\n 'pub': 'pub_val',\n 'self': 'self_val',\n 'super': 'super_val',\n 'crate': 'crate_val',\n };\n\n // [fnName, close] — ensureRef adds & to each operand\n this.binaryExpressionsWrappers = {\n [SyntaxKind.EqualsEqualsToken]: ['is_equal(', ')'],\n [SyntaxKind.EqualsEqualsEqualsToken]: ['is_equal(', ')'],\n [SyntaxKind.ExclamationEqualsToken]: ['!is_equal(', ')'],\n [SyntaxKind.ExclamationEqualsEqualsToken]: ['!is_equal(', ')'],\n [SyntaxKind.GreaterThanToken]: ['is_greater_than(', ')'],\n [SyntaxKind.GreaterThanEqualsToken]: ['is_greater_than_or_equal(', ')'],\n [SyntaxKind.LessThanToken]: ['is_less_than(', ')'],\n [SyntaxKind.LessThanEqualsToken]: ['is_less_than_or_equal(', ')'],\n [SyntaxKind.PlusToken]: ['add(', ')'],\n [SyntaxKind.MinusToken]: ['subtract(', ')'],\n [SyntaxKind.AsteriskToken]: ['multiply(', ')'],\n [SyntaxKind.PercentToken]: ['mod_val(', ')'],\n [SyntaxKind.SlashToken]: ['divide(', ')'],\n };\n }\n\n // Escaped Rust string literal for the given TS literal text — shared by\n // the `Value::Str(..)` form and the `&str` key form below.\n quotedStringLiteral(text: string): string {\n // Preserve real backslashes\n const backslashPlaceholder = \"\\x00\";\n text = text.replaceAll(\"\\\\\", backslashPlaceholder);\n text = text.replaceAll(\"\\b\", \"\\\\b\");\n text = text.replaceAll(\"\\f\", \"\\\\f\");\n text = text.replaceAll(\"\\n\", \"\\\\n\");\n text = text.replaceAll(\"\\r\", \"\\\\r\");\n text = text.replaceAll(\"\\t\", \"\\\\t\");\n text = text.replaceAll(backslashPlaceholder, \"\\\\\\\\\");\n text = text.replaceAll('\"', '\\\\\"');\n return `\"${text}\"`;\n }\n\n printStringLiteral(node) {\n const text = node.text;\n if (text in this.StringLiteralReplacements) return this.StringLiteralReplacements[text];\n // `.into()` borrows the `&'static str` into the `Cow` payload — no alloc.\n return `Value::Str(${this.quotedStringLiteral(text)}.into())`;\n }\n\n printNumericLiteral(node) {\n const text = node.text;\n // a decimal point or an exponent makes the literal a float\n if (text.includes('.') || /[eE]/.test(text)) return `Value::Float(${text})`;\n return `Value::Int(${text})`;\n }\n\n printBooleanLiteral(node) {\n return `Value::Bool(${SyntaxKind.TrueKeyword === node.kind})`;\n }\n\n printNullKeyword(node, identation) {\n return 'Value::Null';\n }\n\n // ── native equality emission ────────────────────────────────────────────\n // When the checker proves both operands hold the same primitive payload\n // (string / number / boolean, or one side is a matching literal) the\n // unwrapped payloads are compared with `==`/`!=` instead of is_equal().\n\n // Operators whose printed form is a bare Rust `bool` (not a Value).\n private static readonly BOOL_PRODUCING_OPERATORS = new Set([\n SyntaxKind.EqualsEqualsToken,\n SyntaxKind.EqualsEqualsEqualsToken,\n SyntaxKind.ExclamationEqualsToken,\n SyntaxKind.ExclamationEqualsEqualsToken,\n SyntaxKind.LessThanToken,\n SyntaxKind.LessThanEqualsToken,\n SyntaxKind.GreaterThanToken,\n SyntaxKind.GreaterThanEqualsToken,\n SyntaxKind.AmpersandAmpersandToken,\n SyntaxKind.BarBarToken,\n SyntaxKind.InstanceOfKeyword,\n ]);\n\n // Method names whose Rust helper returns a bare `bool` (not a Value).\n private static readonly BOOL_PRODUCING_CALLS = new Set([\n 'isInteger',\n 'isSafeInteger',\n 'some',\n 'every',\n 'test',\n ]);\n\n // Receiver locals whose element writes may go native (rust-13). `request`\n // is rust-12's family; every other receiver keeps the helper.\n private static readonly RUST_NATIVE_INSERT_RECEIVERS = new Set([\n 'result',\n 'account',\n 'params',\n 'fee',\n ]);\n\n // Scalar book fields the shared order-book store keeps instead of the Dict\n // (value.rs `is_book_meta_key` plus the `cache` replacement write).\n private static readonly RUST_BOOK_META_KEYS = new Set([\n 'timestamp',\n 'datetime',\n 'nonce',\n 'symbol',\n 'checksum',\n 'cache',\n ]);\n\n // `this.` receivers whose Value may be a tagged live handle (order\n // book / cache / ws client / subscriptions snapshot) — these keep the helper\n // so its store write-through stays reachable.\n private static readonly RUST_TAGGED_HANDLE_FIELDS = new Set([\n 'cache',\n 'client',\n 'subscriptions',\n 'orderbook',\n ]);\n\n // Fields the hand-written base keeps as a plain dict: `rust/ccxt-base/src/exchange.rs`\n // initialises each to `Value::Map(HashMap::new())` and never tags it, so an element write\n // is the whole helper even though the TS declaration is `any` (no checker shape to read).\n private static readonly RUST_PLAIN_DICT_FIELDS = new Set([\n 'balance',\n 'orderbooks',\n 'trades',\n 'tickers',\n 'bidsasks',\n 'ohlcvs',\n 'clients',\n 'transactions',\n 'headers',\n 'currencies',\n 'has',\n 'tokenBucket',\n ]);\n\n // Free helpers whose call prints a bare `bool` — an argument position that\n // expects a `Value` has to box them (ccxt's wrapBoolValueArgs set).\n private static readonly RUST_BOOL_VALUE_HELPERS = [\n 'is_equal',\n 'is_true',\n 'is_greater_than',\n 'is_less_than',\n 'is_greater_than_or_equal',\n 'is_less_than_or_equal',\n 'is_array',\n 'is_object',\n 'in_op',\n 'is_number',\n 'is_string',\n ];\n\n // Payload accessor used to compare each primitive kind natively.\n private static readonly PAYLOAD_ACCESSORS = {\n 'string': 'as_str',\n 'number': 'as_f64',\n 'boolean': 'as_bool',\n };\n\n // Primitive kind the checker proves for `type`; a union keeps the kind only\n // when every non-nullable member is that same primitive.\n primitiveKindOfType(type): string {\n if (type === undefined) return undefined;\n const flags = type.flags;\n if (this.isStringType(flags)) return 'string';\n if (flags === TypeFlags.Number || flags === TypeFlags.NumberLiteral) return 'number';\n if (flags === TypeFlags.Boolean || flags === TypeFlags.BooleanLiteral) return 'boolean';\n if (flags & TypeFlags.Union) {\n let kind = undefined;\n for (const member of typeParts(type) ?? []) {\n if (member.flags & (TypeFlags.Undefined | TypeFlags.Null)) {\n continue;\n }\n const memberKind = this.primitiveKindOfType(member);\n if (memberKind === undefined || (kind !== undefined && kind !== memberKind)) return undefined;\n kind = memberKind;\n }\n return kind;\n }\n return undefined;\n }\n\n // Native truthiness of a checker-proved boolean Value: `is_true(&v)` is `v.is_truthy()`\n // (`\"\"`/`0`/`[]`/`{}`/Null are false). When the operand is proven `bool`/`undefined` only,\n // the runtime value is `Value::Bool(..)` or `Value::Null`, so `matches!(v, Value::Bool(true))`.\n\n /** `true` / `false` / `boolean` (a union of BooleanLiteral members too). */\n isBooleanValueType(type: Type | undefined): boolean {\n if (type === undefined) return false;\n if (type.flags & TypeFlags.Union) {\n const members: Type[] = typeParts(type) ?? [];\n return members.length > 0 && members.every((member) => this.isBooleanValueType(member));\n }\n return (type.flags & (TypeFlags.Boolean | TypeFlags.BooleanLiteral)) !== 0;\n }\n\n /** `boolean | undefined`: `undefined`/`null` both print `Value::Null` (false\n * for the helper and for the `matches!` alike), so they may join the union. */\n isBooleanOrUndefinedType(type: Type | undefined): boolean {\n if (type === undefined) return false;\n const members: Type[] = (type.flags & TypeFlags.Union) ? (typeParts(type) ?? []) : [type];\n if (members.length === 0) return false;\n const onlyBooleanOrEmpty = members.every((member) =>\n this.isBooleanValueType(member) ||\n (member.flags & (TypeFlags.Undefined | TypeFlags.Void | TypeFlags.Null)) !== 0);\n return onlyBooleanOrEmpty && members.some((member) => this.isBooleanValueType(member));\n }\n\n /** Operands this unit owns: `safeBool`/`safeBool2`/`safeBoolN` calls (a\n * `Value` in the port) and element accesses (printed as `get_value`). */\n isBooleanValueFamilyOperand(node): boolean {\n const inner = this.unwrapParens(node);\n if (inner === undefined) return false;\n if (isElementAccessExpression(inner)) return true;\n if (isCallExpression(inner)) {\n const name = this.callExpressionName(inner);\n return name === 'safeBool' || name === 'safeBool2' || name === 'safeBoolN';\n }\n return false;\n }\n\n /** The emitted `matches!` is a bare Rust `bool`: it is only valid where the\n * whole enclosing boolean expression already sits in a bool slot. A logical\n * expression stored in a `Value` slot gets its `Value::Bool(..)` box from the\n * ccxt post-passes, which key on the leading helper token the operand would\n * no longer provide. */\n isBareBoolEmissionSafe(node): boolean {\n return this.isBooleanPosition(this.rustClimbLogicalWrappers(node));\n }\n\n /** Outermost ancestor reached through parens, `!` and `&&`/`||`. */\n rustClimbLogicalWrappers(node): any {\n let current: any = node;\n let parent: any = current.parent;\n while (parent !== undefined && (isParenthesizedExpression(parent) ||\n (parent.kind === SyntaxKind.PrefixUnaryExpression && parent.operator === SyntaxKind.ExclamationToken) ||\n (parent.kind === SyntaxKind.BinaryExpression &&\n (parent.operatorToken.kind === SyntaxKind.AmpersandAmpersandToken ||\n parent.operatorToken.kind === SyntaxKind.BarBarToken)))) {\n current = parent;\n parent = parent.parent;\n }\n return current;\n }\n\n // B-26 extends the proof with the printer's own bool-typed sinks: a narrowed `let x: bool = …`\n // (getRustBoolLocalInitializer) and a logical boxed in `Value::Bool(…)`\n // (printCustomBinaryExpressionIfAny) both demand a `bool`, so their operands may print bare.\n rustConditionBoolSlot(node): boolean {\n if (this.isBareBoolEmissionSafe(node)) return true;\n const current = this.rustClimbLogicalWrappers(node);\n // A logical the printer boxes (`Value::Bool()`) for a Value slot.\n const inner = this.unwrapParens(current);\n if (inner !== undefined && inner.kind === SyntaxKind.BinaryExpression &&\n (inner.operatorToken.kind === SyntaxKind.AmpersandAmpersandToken ||\n inner.operatorToken.kind === SyntaxKind.BarBarToken) &&\n (this.hasNativeComparisonOperand(inner.left) || this.hasNativeComparisonOperand(inner.right))) {\n return true;\n }\n // The initializer of a local this printer declares `bool`.\n const declaration: any = current.parent;\n if (declaration === undefined || !isVariableDeclaration(declaration) ||\n declaration.initializer !== current || declaration.name?.kind !== SyntaxKind.Identifier) {\n return false;\n }\n return this.rustNodeIsBoolExpression(declaration.initializer) &&\n this.rustTypeIsBoolean(declaration.initializer) &&\n this.rustLocalUsesAcceptBool(declaration, String(declaration.name.text));\n }\n\n /** Native truthiness text of the operand, or undefined to keep `is_true`. */\n printNativeTruthiness(node): string | undefined {\n if (!this.isBooleanValueFamilyOperand(node) || !this.printsValueExpression(node) ||\n !this.isBooleanOrUndefinedType(this.typeOfNodeIfAny(node)) || !this.isBareBoolEmissionSafe(node)) {\n return undefined;\n }\n return `matches!(${this.printNode(node, 0)}, Value::Bool(true))`;\n }\n\n // Kind of a literal operand whose printed Value variant is exactly known.\n literalKindOfNode(node): string {\n if (node === undefined) return undefined;\n switch (node.kind) {\n case SyntaxKind.StringLiteral: return 'string';\n case SyntaxKind.NumericLiteral: return 'number';\n case SyntaxKind.TrueKeyword:\n case SyntaxKind.FalseKeyword: return 'boolean';\n case SyntaxKind.NullKeyword: return 'null';\n case SyntaxKind.Identifier: return node.text === 'undefined' ? 'null' : undefined;\n }\n return undefined;\n }\n\n // Does printNode() render `node` as a Rust `Value` (and not a bare bool)?\n printsValueExpression(node): boolean {\n if (node === undefined) return false;\n switch (node.kind) {\n case SyntaxKind.ParenthesizedExpression: return this.printsValueExpression(node.expression);\n case SyntaxKind.AwaitExpression: return this.printsValueExpression(node.expression);\n case SyntaxKind.BinaryExpression: return !RustTranspiler.BOOL_PRODUCING_OPERATORS.has(node.operatorToken.kind);\n case SyntaxKind.PrefixUnaryExpression: return node.operator !== SyntaxKind.ExclamationToken;\n case SyntaxKind.CallExpression: return !RustTranspiler.BOOL_PRODUCING_CALLS.has(this.callExpressionName(node));\n case SyntaxKind.Identifier:\n case SyntaxKind.PropertyAccessExpression:\n case SyntaxKind.ElementAccessExpression:\n return !this.isClassInstanceType(this.getChecker().getTypeAtLocation(node));\n case SyntaxKind.StringLiteral:\n case SyntaxKind.NumericLiteral:\n case SyntaxKind.TrueKeyword:\n case SyntaxKind.FalseKeyword:\n case SyntaxKind.NullKeyword:\n case SyntaxKind.ArrayLiteralExpression:\n case SyntaxKind.ObjectLiteralExpression:\n case SyntaxKind.ConditionalExpression:\n return true;\n }\n return false;\n }\n\n // Class instances are emitted as their Rust struct (not a Value), so they\n // can neither be compared to Value::Null nor unwrapped with as_*().\n callExpressionName(node): string {\n const expression = node.expression;\n if (isIdentifier(expression)) return expression.text as string;\n if (isPropertyAccessExpression(expression)) return expression.name.text as string;\n return '';\n }\n\n // Does a string (literal text or literal-type value) parse as a number?\n // is_equal() coerces those against numeric/bool operands, a plain string\n // compare does not.\n textCoercesToNumber(text: string): boolean {\n return /^[+-]?(\\d+\\.?\\d*|\\.\\d+)([eE][+-]?\\d+)?$/.test(text) || /^[+-]?(inf|infinity|nan)$/i.test(text);\n }\n\n // f64 literal text for a numeric literal; undefined when it is not a Rust\n // decimal/float literal (hex/octal/binary fall back to the helper).\n numericLiteralF64Text(node): string {\n const text = node.text;\n if (text.startsWith('0x') || text.startsWith('0o') || text.startsWith('0b')) return undefined;\n if (text.startsWith('.')) return `0${text}`;\n if (text.includes('.') || text.includes('e') || text.includes('E')) return text;\n return `${text}.0`;\n }\n\n // The printer's own proof that a plain read prints as a Rust `Value`: `this.` (every\n // declared field is `Value`) or an identifier bound to a local/param (a local is narrowed to\n // `bool` only when every use is a condition sink — never an is_equal argument).\n rustReadPrintsValue(node): boolean {\n if (node === undefined) return false;\n if (node.kind === SyntaxKind.PropertyAccessExpression && node.expression.kind === SyntaxKind.ThisKeyword) return true;\n if (node.kind !== SyntaxKind.Identifier) return false;\n const symbol: any = this.getChecker().getSymbolAtLocation(node);\n const declarations: any[] = symbolDeclarations(symbol);\n if (declarations.length === 0) return false;\n return declarations.every((declaration) => isParameterDeclaration(declaration)\n || (isVariableDeclaration(declaration)\n && declaration.initializer?.kind !== SyntaxKind.NewExpression));\n }\n\n // Can the checked type only hold a Bool, Null/undefined or a non-numeric\n // string? Then `x.as_bool() == Some(b)` answers exactly what is_equal(x, b)\n // does: its f64 fallback (Str parse / Bool→0|1) can never fire.\n rustBooleanComparableType(type): boolean {\n if (type === undefined) return false;\n if (type.flags & TypeFlags.Union) {\n const members: any[] = typeParts(type) ?? [];\n return members.length > 0 && members.every((member) => this.rustBooleanComparableType(member));\n }\n if (type.flags & (TypeFlags.Boolean | TypeFlags.BooleanLiteral)) return true;\n if (type.flags & (TypeFlags.Undefined | TypeFlags.Null)) return true;\n if (type.flags & TypeFlags.StringLiteral) return !this.textCoercesToNumber(String((type as any).value ?? ''));\n return false;\n }\n\n // Native `==`/`!=` on the unwrapped payload when the checker proves the\n // Value variants line up; undefined keeps the is_equal() helper.\n printNativeEqualityComparison(left, right, op): string {\n const operator = (op === SyntaxKind.EqualsEqualsToken || op === SyntaxKind.EqualsEqualsEqualsToken) ? '==' : '!=';\n const leftLiteral = this.literalKindOfNode(left);\n const rightLiteral = this.literalKindOfNode(right);\n if (leftLiteral !== undefined && rightLiteral !== undefined) return undefined;\n if (leftLiteral !== undefined || rightLiteral !== undefined) {\n const literal = leftLiteral !== undefined ? left : right;\n const literalKind = leftLiteral ?? rightLiteral;\n const other = leftLiteral !== undefined ? right : left;\n if (!this.printsValueExpression(other) && (literalKind !== 'null' || !this.rustReadPrintsValue(other))) return undefined;\n const otherType = this.getChecker().getTypeAtLocation(other);\n const otherKind = this.primitiveKindOfType(otherType);\n const typedStringLocal = this.rustStringLocalIdentifierIsTyped(other);\n if (literalKind === 'null') {\n // Exact for every runtime value: is_equal(x, null) is true only\n // when x is Null, and the derived PartialEq says the same.\n if (typedStringLocal) return `${this.printNode(other, 0)}.${operator === '==' ? 'is_none' : 'is_some'}()`;\n return `${this.printNode(other, 0)} ${operator} Value::Null`;\n }\n if (literalKind === 'string') {\n if (literal.text in this.StringLiteralReplacements) return undefined;\n if (this.textCoercesToNumber(literal.text) && otherKind !== 'string') return undefined;\n const accessor = typedStringLocal ? 'as_deref' : 'as_str';\n return `${this.printNode(other, 0)}.${accessor}() ${operator} Some(${this.quotedStringLiteral(literal.text)})`;\n }\n if (literalKind === 'number') {\n if (otherKind !== 'number') return undefined;\n const text = this.numericLiteralF64Text(literal);\n if (text === undefined) return undefined;\n return `${this.printNode(other, 0)}.as_f64() ${operator} Some(${text})`;\n }\n if (literalKind === 'boolean') {\n if (otherKind !== 'boolean' && !this.rustBooleanComparableType(otherType)) return undefined;\n const value = literal.kind === SyntaxKind.TrueKeyword ? 'true' : 'false';\n return `${this.printNode(other, 0)}.as_bool() ${operator} Some(${value})`;\n }\n return undefined;\n }\n if (!this.printsValueExpression(left) || !this.printsValueExpression(right)) return undefined;\n const leftKind = this.primitiveKindOfType(this.getChecker().getTypeAtLocation(left));\n const rightKind = this.primitiveKindOfType(this.getChecker().getTypeAtLocation(right));\n if (leftKind === undefined || leftKind !== rightKind) return undefined;\n const accessor = RustTranspiler.PAYLOAD_ACCESSORS[leftKind];\n return `${this.printNode(left, 0)}.${accessor}() ${operator} ${this.printNode(right, 0)}.${accessor}()`;\n }\n\n // ── checker-typed helper elimination ─────────────────────────────────\n // Each predicate proves a static TS shape for which the native Rust form\n // is exactly what the runtime helper computes; only then is the helper\n // call dropped, anything unproven keeps the helper.\n\n typeOfNodeIfAny(node: Node): Type | undefined {\n // A transpile without a program/checker (bare snippet) has no types.\n return this.checkerOrUndefined()?.getTypeAtLocation(node);\n }\n\n // Arrays/tuples/strings: `.length` is exactly what `Value::len()` returns.\n // Other shapes (Dict) keep the helper — ArrayCache / OrderBookSide markers\n // hold their length in the marker dict, which get_array_length unwraps.\n isValueLengthType(type: Type | undefined): boolean {\n if (type === undefined) return false;\n if (type.flags & TypeFlags.Union) {\n const parts: Type[] = typeParts(type) ?? [];\n return parts.length > 0 && parts.every((part) => this.isValueLengthType(part));\n }\n // A `null`/`undefined` member boxes as `Value::Null`, whose `len()` is\n // the same number the helper's fallthrough returns for it.\n return (type.flags & (TypeFlags.Undefined | TypeFlags.Null | TypeFlags.Void)) !== 0\n || this.getChecker().isArrayType(type)\n || this.getChecker().isTupleType(type)\n || this.isStringType(type.flags);\n }\n\n printArrayLength(node, identation, leftExpr = undefined) {\n const receiver = leftExpr ?? this.printNode(node.expression, 0);\n if (!this.rustIsOrderBookSide(node.expression) && this.isValueLengthType(this.typeOfNodeIfAny(node.expression))) return `Value::Int(${receiver}.len() as i64)`;\n return `get_array_length(&${receiver})`;\n }\n\n /** `orderbook['bids']` / `orderbook.asks` on an `OrderBook`-typed receiver, or a\n * local initialised from one. The WS runtime keeps those sides as marker dicts\n * whose levels live in the side store, so only `get_array_length` / `get_value`\n * reach them — the checker's array type is not the runtime shape. */\n rustIsOrderBookSide(node: Node, depth = 0): boolean {\n const stripped = this.rustStripWrappers(node);\n if (stripped === undefined || depth > 4) return false;\n if (isIdentifier(stripped)) {\n const declaration = this.rustSingleLocalDeclaration(stripped);\n return declaration !== undefined && isVariableDeclaration(declaration)\n && this.rustIsOrderBookSide(declaration.initializer, depth + 1);\n }\n let receiver: Node | undefined;\n let key: string | undefined;\n if (isElementAccessExpression(stripped) && isStringLiteralLikeNode(stripped.argumentExpression)) {\n receiver = stripped.expression;\n key = stripped.argumentExpression.text;\n } else if (isPropertyAccessExpression(stripped)) {\n receiver = stripped.expression;\n key = String(stripped.name.text);\n }\n if (receiver === undefined || (key !== 'bids' && key !== 'asks')) return false;\n const symbol = (this.typeOfNodeIfAny(receiver) as any)?.getSymbol?.();\n return symbol !== undefined && /^(Indexed|Counted)?OrderBook$/.test(symbol.name);\n }\n\n // Native string search / slicing: `x.indexOf(y)` and `x.slice(a, b)` on a checker-proven\n // string receiver print native `str` code. The receiver is a `Value`, so the payload is reached\n // via `as_str()`; a `Value::Null` receiver takes the helper's `-1` / `Value::Null` branch.\n\n /** Literal integer bound of a `slice` call (`3`, `-64`), else undefined. */\n rustSliceLiteralBound(node): number | undefined {\n if (node === undefined) return undefined;\n if (isNumericLiteral(node)) {\n const value = Number(node.text);\n return Number.isSafeInteger(value) ? value : undefined;\n }\n if (isPrefixUnaryExpression(node) && node.operator === SyntaxKind.MinusToken &&\n isNumericLiteral(node.operand)) {\n const value = Number(node.operand.text);\n return Number.isSafeInteger(value) ? -value : undefined;\n }\n return undefined;\n }\n\n // `slice` clamps like JS: a non-negative bound is capped at the length, a\n // negative one counts from the end and is floored at 0.\n rustSliceClampedIndex(value: number): string {\n return value < 0 ? `(__l - ${-value}).max(0)` : `__l.min(${value})`;\n }\n\n // `x.indexOf(\"lit\")` on a proven string receiver: `str::find` is exactly\n // the helper's `Value::Str` arm (byte index, `-1` when absent).\n printNativeStringIndexOf(node, receiverText: string): string | undefined {\n if (node === undefined || !isCallExpression(node) ||\n !isPropertyAccessExpression(node.expression) || node.arguments?.length !== 1) {\n return undefined;\n }\n if (this.primitiveKindOfType(this.typeOfNodeIfAny(node.expression.expression)) !== 'string') return undefined;\n const needle = node.arguments[0];\n if (!isStringLiteral(needle) && !isNoSubstitutionTemplateLiteral(needle)) return undefined;\n if (typeof receiverText !== 'string' || receiverText.includes('\\n')) return undefined;\n const literal = this.escapeRustStringLiteral(needle.text);\n return `Value::Int(${receiverText}.as_str().and_then(|__s| __s.find(\"${literal}\")).map(|__i| __i as i64).unwrap_or(-1))`;\n }\n\n // `x.slice(a)` / `x.slice(a, b)` with literal bounds on a proven string\n // receiver: the helper's char-vector clamps are inlined, so the emission\n // returns the same string (and `Value::Null` for a null receiver).\n printNativeStringSlice(node, receiverText: string): string | undefined {\n if (node === undefined || !isCallExpression(node) ||\n !isPropertyAccessExpression(node.expression)) {\n return undefined;\n }\n const args = node.arguments ?? [];\n if (args.length === 0 || args.length > 2) return undefined;\n if (this.primitiveKindOfType(this.typeOfNodeIfAny(node.expression.expression)) !== 'string') return undefined;\n if (typeof receiverText !== 'string' || receiverText.includes('\\n')) return undefined;\n const start = this.rustSliceLiteralBound(args[0]);\n if (start === undefined) return undefined;\n let end = '__l';\n if (args[1] !== undefined && args[1].kind !== SyntaxKind.NullKeyword && args[1].kind !== SyntaxKind.UndefinedKeyword) {\n const bound = this.rustSliceLiteralBound(args[1]);\n if (bound === undefined) return undefined;\n end = this.rustSliceClampedIndex(bound);\n }\n const begin = this.rustSliceClampedIndex(start);\n return `${receiverText}.as_str().map(|__s| { let __c: Vec = __s.chars().collect();` +\n ` let __l = __c.len() as i64; let __i = ${begin}; let __j = ${end};` +\n ` if __i <= __j { __c[__i as usize..__j as usize].iter().collect::() } else { String::new() } })` +\n `.map(|__s| Value::Str(__s.into())).unwrap_or(Value::Null)`;\n }\n\n // Native value predicates (`Array.isArray` / `typeof … === '…'`): each runtime predicate is a\n // single `matches!` over the `Value` variants, so on a declared `Value` place the call is\n // replaced by that same match — no helper call, operand still read exactly once.\n\n // `matches!` pattern of the runtime predicate, keyed by the `typeof` word.\n private static readonly RUST_TYPE_PREDICATE_PATTERNS: { [key: string]: string } = {\n 'array': 'Value::Arr(_)',\n 'string': 'Value::Str(_)',\n 'number': 'Value::Int(_) | Value::Float(_)',\n 'boolean': 'Value::Bool(_)',\n 'object': 'Value::Dict(_)',\n };\n\n // An identifier bound by a local/param declaration: the printer declares\n // every one of them as `Value`. Imports, classes and function names print\n // as Rust items rather than as values, so they keep the helper.\n isDeclaredValueIdentifier(node): boolean {\n const declarations = symbolDeclarations((this.getChecker() as any).getSymbolAtLocation(node));\n return declarations.length > 0 && declarations.every((d) =>\n isVariableDeclaration(d) || isParameterDeclaration(d) || isBindingElement(d));\n }\n\n // A declared `Value` place: a local/param identifier, or a field/element\n // access rooted at `this` or at such an identifier. Those are the operands\n // whose printed text the helper already borrows as a `Value`.\n isDeclaredValuePlace(node): boolean {\n const inner = this.unwrapParens(node);\n if (inner !== undefined && isIdentifier(inner)) {\n return this.isDeclaredValueIdentifier(inner);\n }\n if (inner !== undefined && (isPropertyAccessExpression(inner) || isElementAccessExpression(inner))) {\n const root = this.unwrapParens(this.valuePlaceRoot(inner));\n return root !== undefined &&\n (root.kind === SyntaxKind.ThisKeyword || this.isDeclaredValueIdentifier(root));\n }\n return false;\n }\n\n valuePlaceRoot(node): any {\n let current: any = node;\n while (isPropertyAccessExpression(current) || isElementAccessExpression(current)) {\n current = current.expression;\n }\n return current;\n }\n\n nativeValuePredicateText(kind: string, operandNode, printedOperand: string): string | undefined {\n const pattern = RustTranspiler.RUST_TYPE_PREDICATE_PATTERNS[kind];\n if (pattern === undefined || operandNode === undefined || printedOperand === undefined ||\n !this.isDeclaredValuePlace(operandNode)) {\n return undefined;\n }\n return `matches!(${this.ensureRef(printedOperand)}, ${pattern})`;\n }\n\n // Object-typed values are Dicts at runtime, so `key in obj` is a plain\n // key lookup. Arrays keep the helper: `in_op` searches them element-wise.\n // A `Dict`/`Dictionary` receiver is a Reference to its index-signature\n // interface, so the class/lib guards — not the Reference flag — decide it.\n isDictShapedType(type: Type | undefined): boolean {\n if (type === undefined) return false;\n if (type.flags & TypeFlags.Union) {\n // `Market | undefined` style aliases: a nullish member carries no\n // value, so only the value-carrying members have to be dict-shaped.\n // `in_op` and the native insert both answer false / no-op on Null.\n const parts: Type[] = typeParts(type) ?? [];\n const valueParts = parts.filter((part) => !this.rustTypeIsNullish(part));\n return parts.length > valueParts.length && valueParts.length > 0\n && valueParts.every((part) => this.isDictShapedType(part));\n }\n const checker = this.getChecker();\n if (!(type.flags & TypeFlags.Object) || type.getCallSignatures().length !== 0\n || checker.isArrayType(type) || checker.isTupleType(type) || checker.isArrayLikeType(type)) {\n return false;\n }\n return !this.isClassInstanceType(type) && !this.isLibDeclaredType(type);\n }\n\n // `\"key\" in obj` → `matches!(&obj, Value::Dict(__d) if __d.contains_key(\"key\"))`\n // In the TS AST `key` is the left operand and `obj` the right one.\n printNativeInOperator(key, obj) {\n if (!isStringLiteral(key) || !this.isDictShapedType(this.typeOfNodeIfAny(obj))) {\n return undefined;\n }\n const keyLiteral = this.rustStringLiteralOf(this.printStringLiteral(key));\n if (keyLiteral === undefined) {\n return undefined;\n }\n const objExpr = this.printNode(obj, 0);\n return `Value::Bool(matches!(&${objExpr}, Value::Dict(__d) if __d.contains_key(${keyLiteral})))`;\n }\n\n // The Rust string literal behind a printed TS string literal — the boxed\n // shapes the printer emits today (`Value::Str(\"k\".to_string())`,\n // `Value::from(\"k\")`) plus a bare `\"k\"` once an arg-shape unit drops the box.\n rustStringLiteralOf(printedKey: string): string | undefined {\n const boxed = printedKey.match(/^(?:Value::Str|Value::from)\\((.+)\\)$/);\n const literal = (boxed ? boxed[1].replace(/\\.(?:to_string|into)\\(\\)$/, '') : printedKey).trim();\n return /^\"(?:[^\"\\\\]|\\\\.)*\"$/.test(literal) ? literal : undefined;\n }\n\n // `X[\"k\"] = v` on a checker-proven plain Dict receiver: mutate the Dict\n // natively. The helper's tag hooks (book meta, ws subscriptions, cache\n // hashmap) only fire on tagged dicts, which a plain object type never is.\n printNativeDictInsert(baseExpr, keyNode, keyText, valueText): string | undefined {\n const receiver = this.rustNativeInsertReceiver(baseExpr);\n if (receiver === undefined || !this.rustReceiverStaysDict(baseExpr, receiver)) {\n return undefined;\n }\n // A bucket read off `cache.hashmap` / client `subscriptions`/`futures` carries a runtime\n // backref: only the helper writes through to the shared store, so keep it.\n if (!receiver.isField && this.rustLocalInitReadsTaggedContainer(baseExpr)) {\n return undefined;\n }\n const keyArg = this.rustNativeInsertKeyArg(receiver, keyNode, keyText);\n if (keyArg === undefined) {\n return undefined;\n }\n const name = receiver.text;\n const value = this.rustPrintedBoolArg(valueText) ? `Value::Bool(${valueText})` : valueText;\n const insert = (val: string) =>\n `if let Value::Dict(__d) = &mut ${name} { std::sync::Arc::make_mut(__d).insert(${keyArg}, ${val}); }`;\n // Any mention of the receiver in the value operand reads it while the\n // write holds the `&mut` — ccxt's splitAddElementBorrowConflicts pass\n // hoists on the same signal, so mirror it with a temp binding.\n const readsReceiver = receiver.isField ? /\\bself\\b/.test(value) : new RegExp(`\\\\b${name}\\\\b`).test(value);\n if (readsReceiver) {\n return `{ let __be_tmp = ${value}; ${insert('__be_tmp')} }`;\n }\n const trimmed = value.trim();\n if (/^[a-zA-Z_][a-zA-Z0-9_]*$/.test(trimmed) && trimmed !== 'self'\n && trimmed !== 'true' && trimmed !== 'false') {\n return insert(`${trimmed}.clone()`);\n }\n return insert(value);\n }\n\n /** The `insert` key argument. A literal becomes `\"k\".into()`; a proven\n * string place becomes `crate::runtime::stringify_param(&k)` — the exact\n * conversion the helper's dict branch applies to a non-string key, and\n * `k.to_string()` for a string one. */\n rustNativeInsertKeyArg(receiver, keyNode, keyText: string): string | undefined {\n if (isStringLiteral(keyNode)) {\n // A book-meta key can only reach the store through a `__book_id`:\n // provable only for receivers the transpiler itself built as plain\n // maps or the hand-written base never tags (fields).\n if (RustTranspiler.RUST_BOOK_META_KEYS.has(keyNode.text) && !receiver.plain) {\n return undefined;\n }\n const keyLiteral = keyText.match(/^Value::Str\\((.+)\\.(?:to_string|into)\\(\\)\\)$/);\n return keyLiteral === null ? undefined : `${keyLiteral[1]}.into()`;\n }\n // Dynamic key: a plain place, never one that reads the receiver (the\n // insert holds its `&mut`). Every other key shape keeps the helper.\n const key = keyText.trim();\n if (!/^[A-Za-z_][A-Za-z0-9_]*$/.test(key)\n || (receiver.isField ? key.includes('self') : new RegExp(`\\\\b${receiver.text}\\\\b`).test(key))) {\n return undefined;\n }\n return `crate::runtime::stringify_param(&${key})`;\n }\n\n // Receivers this unit may write natively: any local whose every path builds\n // a plain `Value::Map` (name-independent — rust-13's four names are the\n // batch-A subset of this proof), any parameter the checker proves is a\n rustNativeInsertReceiver(expr): { text: string, isField: boolean, plain: boolean, nameNode: any } | undefined {\n if (isIdentifier(expr)) {\n const plain = this.rustInsertIdentifierReceiver(expr);\n return plain === undefined ? undefined : { text: expr.text, isField: false, plain, nameNode: expr };\n }\n if (isPropertyAccessExpression(expr) && expr.expression.kind === SyntaxKind.ThisKeyword\n && expr.name?.kind === SyntaxKind.Identifier) {\n return {\n text: `self.${expr.name.text}`, isField: true,\n plain: RustTranspiler.RUST_PLAIN_DICT_FIELDS.has(expr.name.text),\n nameNode: expr.name,\n };\n }\n return undefined;\n }\n\n /** Element-write receiver proof for a local: the batch-A names (rust-13,\n * `plain: false` — the whitelist is not a construction proof) or, for any\n * other name, the dict-shape proof plus a plain-`Value::Map` build on\n * every path (rust-12's proof, read off the checker), or a parameter whose\n * annotation proves a plain dict and whose writes keep that shape. The\n * returned flag is the *by-construction* plainness (literal-init locals,\n * handler tuples, hand-written plain fields) that a book-meta key needs. */\n rustInsertIdentifierReceiver(ident): boolean | undefined {\n const declaration = this.rustSingleLocalDeclaration(ident);\n if (declaration !== undefined && isParameterDeclaration(declaration as any)) {\n // A default value (`params: Dict = {}`) keeps the pre-unit\n // initializer proof — `rustReceiverStaysDict` runs both it and the\n // annotation proof and rejects the site when neither holds.\n if (this.rustParamStaysPlainDict(declaration as ParameterDeclaration)\n || (declaration as ParameterDeclaration).initializer !== undefined) {\n return false;\n }\n } else if (declaration !== undefined && isVariableDeclaration(declaration as any)) {\n if (this.rustInsertReceiverBuildsPlainDict(declaration as VariableDeclaration)) {\n return true;\n }\n // A local the declared-Dict table proves holds a Dict at every use\n // (alwaysDict && stable): the helper's non-dict branches are dead,\n // so only the tag hooks and the insert remain — the key rules of\n if (this.rustDeclaredLocalEntry(ident) !== undefined\n && this.rustDeclaredInitIsTagFree(declaration as VariableDeclaration)) {\n return false;\n }\n }\n if (RustTranspiler.RUST_NATIVE_INSERT_RECEIVERS.has(ident.text)) {\n return false; // rust-13 whitelist: not a construction proof\n }\n return undefined;\n }\n\n /** A literal initializer must carry no runtime tag key; a call initializer\n * is the axiom the declared-Dict table itself rests on. */\n rustDeclaredInitIsTagFree(declaration: VariableDeclaration): boolean {\n const init = this.rustStripWrappers(declaration.initializer);\n return init === undefined || !isObjectLiteralExpression(init) || this.rustPlainDictLiteral(init);\n }\n\n /** Skip `( … )`, `x!` and `x as T` wrappers. */\n rustStripWrappers(node: any): any {\n while (node !== undefined && (isParenthesizedExpression(node) || isNonNullExpression(node) || isAsExpression(node))) {\n node = node.expression;\n }\n return node;\n }\n\n /** The local's single declaration is initialised from a call that reads\n * `x.hashmap` / `x.subscriptions` / `x.futures` — element dicts the runtime\n * tags with a backref so writes reach the shared store, not the COW copy. */\n rustLocalInitReadsTaggedContainer(ident: Identifier): boolean {\n const declaration = this.rustSingleLocalDeclaration(ident);\n if (declaration === undefined || !isVariableDeclaration(declaration)) {\n return false;\n }\n const init = this.rustStripWrappers(declaration.initializer);\n return init !== undefined && isCallExpression(init) && init.arguments.some((arg) => {\n const n = this.rustStripWrappers(arg);\n return n !== undefined && isPropertyAccessExpression(n)\n && RustTranspiler.RUST_TAGGED_CONTAINER_FIELDS.has(n.name.text);\n });\n }\n\n static readonly RUST_TAGGED_CONTAINER_FIELDS = new Set([ 'hashmap', 'subscriptions', 'futures' ]);\n\n /** True when every value the local can hold comes from an object literal:\n * the runtime tags a dict (`__book_id`, `__ws_subs_url`, `__ws_sub_ref`,\n * `__cache_backref`) only on handles its own store builds, so the helper's\n * write-through branches are provably dead and `insert` is the whole\n * helper. A `[ x, params ] = this.handle…(…)` tuple re-assigns the\n * hand-written handler's own dict arguments. */\n rustInsertReceiverBuildsPlainDict(declaration: VariableDeclaration): boolean {\n const name = String((declaration.name as Identifier).text);\n const scope = this.rustEnclosingFunction(declaration);\n if (!this.rustPlainDictLiteral(declaration.initializer) || scope === undefined) {\n return false;\n }\n const declarationSymbol = this.rustSymbolOf(declaration.name as Identifier);\n let plain = true;\n this.rustWalkScope(scope, (n) => {\n if (!plain || !isBinaryExpression(n) || n.operatorToken.kind !== SyntaxKind.EqualsToken) {\n return;\n }\n const left: any = n.left;\n if (isIdentifier(left) && String(left.text) === name\n && (declarationSymbol === undefined || this.rustSymbolOf(left) === declarationSymbol)) {\n plain = this.rustPlainDictLiteral(n.right) || this.rustTypeIsUndefinedish(n.right);\n } else if (isArrayLiteralExpression(left)\n && left.elements.some((e) => isIdentifier(e) && String(e.text) === name)) {\n plain = this.rustHandlerTupleCall(n.right);\n }\n });\n return plain;\n }\n\n /** An object literal with no runtime tag key — the transpiler built it, so\n * it is a fresh plain `Value::Map` on every path. */\n rustPlainDictLiteral(node: Node | undefined): boolean {\n if (node !== undefined && isParenthesizedExpression(node)) {\n return this.rustPlainDictLiteral(node.expression);\n }\n return node !== undefined && isObjectLiteralExpression(node) && node.properties.every((property: any) => {\n const key = property.name;\n if (key === undefined) {\n return false;\n }\n const text = isStringLiteral(key) ? key.text\n : (isIdentifier(key) ? String(key.text) : undefined);\n return text === undefined || !text.startsWith('__');\n });\n }\n\n /** `this.handle…(…)` — the hand-written `handle*AndParams` / `handleUntil…`\n * family; each returns its own request/params dict arguments. */\n rustHandlerTupleCall(node: Node | undefined): boolean {\n const callee: any = node !== undefined && isCallExpression(node) ? node.expression : undefined;\n return callee !== undefined && isPropertyAccessExpression(callee) && callee.expression.kind === SyntaxKind.ThisKeyword\n && callee.name?.kind === SyntaxKind.Identifier && /^handle[A-Z]/.test(callee.name.text);\n }\n\n /** A `null`/`undefined` write leaves the receiver a non-dict, which the\n * emitted `if let Value::Dict` no-ops exactly like the helper. */\n private rustTypeIsUndefinedish(node: Node): boolean {\n if (node.kind === SyntaxKind.NullKeyword || (isIdentifier(node) && node.text === 'undefined')) {\n return true;\n }\n const type = this.typeOfNodeIfAny(node);\n return type !== undefined && (type.flags & (TypeFlags.Undefined | TypeFlags.Null | TypeFlags.Void)) !== 0;\n }\n\n /** The single variable declaration a local identifier binds to, or\n * undefined when the checker cannot answer / the binding is not a local. */\n rustSingleLocalDeclaration(ident: Identifier): VariableDeclaration | ParameterDeclaration | undefined {\n const checker: any = this.checkerOrUndefined();\n if (checker === undefined) {\n return undefined;\n }\n const declarations = symbolDeclarations(checker.getSymbolAtLocation(ident));\n const declaration: any = declarations.length === 1 ? declarations[0] : undefined;\n return declaration !== undefined && (isVariableDeclaration(declaration) || isParameterDeclaration(declaration))\n ? declaration : undefined;\n }\n\n // Dict-shape proof for a write receiver: an object type with no class, array or callable shape\n // — `Dictionary` instantiations count (they resolve to their interface target). A union keeps\n // the proof when every member is a Dict or `undefined` (both untaggable at runtime).\n rustWriteDictShape(type): boolean {\n if (type === undefined) return false;\n if (type.flags & TypeFlags.Union) {\n const parts: any[] = typeParts(type) ?? [];\n return parts.length > 0 && parts.every((part) => this.rustWriteDictShape(part));\n }\n if (type.flags & (TypeFlags.Undefined | TypeFlags.Void)) {\n return true;\n }\n const checker = this.getChecker();\n if (!(type.flags & TypeFlags.Object)\n || checker.isArrayType(type) || checker.isTupleType(type) || checker.isArrayLikeType(type)\n || ((typeTarget(type) ?? type as any).objectFlags & ObjectFlags.Class)) {\n return false;\n }\n return type.getCallSignatures().length === 0 && type.getConstructSignatures().length === 0;\n }\n\n // The receiver is a plain Dict on every path: its declared/initializer type is object-shaped\n // (never a class or array handle), its initializer is not an element read (the get_value COW\n // write-back pass keys on the `&mut ` text), and no write in scope assigns another shape.\n rustReceiverStaysDict(baseExpr, receiver): boolean {\n if (receiver.isField) {\n return this.rustFieldStaysDict(baseExpr, receiver.nameNode.text);\n }\n const ident = baseExpr;\n const declaration: any = this.rustSingleLocalDeclaration(ident);\n if (declaration === undefined) {\n return false;\n }\n // The declared-Dict table is its own proof (alwaysDict && stable, D2):\n // a table local the checker cannot type (an untyped `safe_dict*`\n // default) still stays a Dict at every use.\n if (this.rustDeclaredLocalEntry(ident) !== undefined) {\n return true;\n }\n // A parameter with a default carries the transpiler's own initializer,\n // so it keeps the pre-unit proof; without one only the annotation proof\n // (`Dict`-style params — the B-25 read family) can admit it.\n if (isParameterDeclaration(declaration) && this.rustParamStaysPlainDict(declaration)) {\n return true;\n }\n const name = ident.text;\n const initializer = declaration.initializer;\n const scope = this.rustEnclosingFunction(declaration);\n if (initializer === undefined || isElementAccessExpression(initializer)\n || declaration.name?.kind !== SyntaxKind.Identifier || scope === undefined) {\n return false;\n }\n let safe = this.rustWriteDictShape(this.typeOfNodeIfAny(ident))\n && this.rustWriteDictShape(this.typeOfNodeIfAny(initializer));\n this.rustWalkScope(scope, (n) => {\n if (n !== declaration && this.rustBindsName(n, name)) {\n safe = false; // a second binding of the name in scope — stay boxed\n return RUST_WALK_STOP;\n }\n if (isBinaryExpression(n) && n.operatorToken.kind === SyntaxKind.EqualsToken\n && isIdentifier(n.left) && n.left.text === name\n && !this.rustWriteDictShape(this.typeOfNodeIfAny(n.right))) {\n safe = false;\n return RUST_WALK_STOP;\n }\n });\n return safe;\n }\n\n // `this.` receivers: the field is a plain dict (object-shaped checker type, or held as one\n // by the hand-written base when the TS declaration is `any`) and no `this. = …` in the\n // method assigns another shape. Handle fields (cache/client/subscriptions/order book) are excluded.\n rustFieldStaysDict(baseExpr, fieldName: string): boolean {\n if (RustTranspiler.RUST_TAGGED_HANDLE_FIELDS.has(fieldName)\n || (!this.rustWriteDictShape(this.typeOfNodeIfAny(baseExpr))\n && !RustTranspiler.RUST_PLAIN_DICT_FIELDS.has(fieldName))) {\n return false;\n }\n const scope = this.rustEnclosingFunction(baseExpr);\n if (scope === undefined) {\n return false;\n }\n let safe = true;\n this.rustWalkScope(scope, (n) => {\n if (isBinaryExpression(n) && n.operatorToken.kind === SyntaxKind.EqualsToken\n && isPropertyAccessExpression(n.left) && n.left.expression.kind === SyntaxKind.ThisKeyword\n && n.left.name?.text === fieldName\n && !this.rustWriteDictShape(this.typeOfNodeIfAny(n.right))) {\n safe = false;\n return RUST_WALK_STOP;\n }\n });\n return safe;\n }\n\n // A parameter the checker proves is a plain dict (`Dict`, `Dictionary`,\n // a `Market`-style alias — the proof B-25's native reads use) whose every\n // write in the body keeps that shape: an object literal with no runtime tag\n rustParamStaysPlainDict(declaration: ParameterDeclaration): boolean {\n if (declaration.type === undefined || declaration.name?.kind !== SyntaxKind.Identifier) {\n return false;\n }\n const type = this.getCheckedTypeOf(declaration.type);\n const scope = this.rustEnclosingFunction(declaration);\n if (type === undefined || !this.isProvenMapType(type) || scope === undefined) {\n return false;\n }\n const name = String((declaration.name as Identifier).text);\n let plain = true;\n this.rustWalkScope(scope, (n) => {\n if (isBinaryExpression(n) && rustIsAssignmentOperator(n.operatorToken.kind)\n && isIdentifier(n.left) && n.left.text === name\n && !this.rustPlainDictPreservingRhs(n.right, name)) {\n plain = false;\n return RUST_WALK_STOP;\n }\n if (isBinaryExpression(n) && n.operatorToken.kind === SyntaxKind.EqualsToken\n && isArrayLiteralExpression(n.left)\n && n.left.elements.some((e) => isIdentifier(e) && String((e as Identifier).text) === name)\n && !this.rustHandlerTupleCall(n.right)) {\n plain = false; // a tuple write keeps only the handle-arg family\n return RUST_WALK_STOP;\n }\n });\n return plain;\n }\n\n /** RHS of a write to a plain-dict parameter that keeps the shape. */\n rustPlainDictPreservingRhs(node: Node, name: string): boolean {\n // `this.handle…(…)` returns its own dict arguments (rust-12's proof).\n if (this.rustPlainDictLiteral(node) || this.rustTypeIsUndefinedish(node)\n || (isIdentifier(node) && node.text === name) || this.rustHandlerTupleCall(node)) {\n return true;\n }\n if (isParenthesizedExpression(node) || isNonNullExpression(node) || isAsExpression(node)) {\n return this.rustPlainDictPreservingRhs(node.expression, name);\n }\n if (isConditionalExpression(node)) {\n return this.rustPlainDictPreservingRhs(node.whenTrue, name)\n && this.rustPlainDictPreservingRhs(node.whenFalse, name);\n }\n if (isBinaryExpression(node)\n && (node.operatorToken.kind === SyntaxKind.BarBarToken\n || node.operatorToken.kind === SyntaxKind.QuestionQuestionToken)) {\n return this.rustPlainDictPreservingRhs(node.left, name)\n && this.rustPlainDictPreservingRhs(node.right, name);\n }\n return false;\n }\n\n // Conservative \"argument position expects a Value\" bool test — the same set\n // ccxt's wrapBoolValueArgs pass uses on the helper call's value operand.\n rustPrintedBoolArg(raw: string): boolean {\n let s = raw.trim();\n while (s.startsWith('(') && s.endsWith(')')) {\n let depth = 0;\n let balanced = true;\n for (let k = 0; k < s.length; k++) {\n if (s[k] === '(') depth++;\n else if (s[k] === ')') { depth--; if (depth === 0 && k < s.length - 1) { balanced = false; break; } }\n }\n if (!balanced || depth !== 0) break;\n s = s.slice(1, -1).trim();\n }\n if (s.startsWith('!')) s = s.slice(1).trim();\n return RustTranspiler.RUST_BOOL_VALUE_HELPERS.some(fn => s.startsWith(fn + '('));\n }\n\n // `negate(&Value::Int(n))` is `Value::Int(-n)` (same for Float) — fold the\n // literal so no helper call is needed. Runtime `negate` also coerces\n // strings/bools/floats, so only Int/Float literals can be folded.\n foldNegateLiteral(operandText: string): string | undefined {\n const match = operandText.match(/^Value::(Int|Float)\\((-?)(\\d[\\d_]*(?:\\.\\d+)?(?:[eE][+-]?\\d+)?)\\)$/);\n // leave big literals to the runtime helper\n if (!match || match[3].replaceAll('_', '').replace('.', '').length > 18) {\n return undefined;\n }\n const sign = match[2] === '-' ? '' : '-';\n return `Value::${match[1]}(${sign}${match[3]})`;\n }\n\n // Ensure a & ref prefix — skip only if already a reference\n ensureRef(expr: string): string {\n return expr.startsWith('&') ? expr : `&${expr}`;\n }\n\n // TS `number` / number-literal type proof for a comparison operand. Unions\n // (`number | undefined`) and `any` are rejected — those keep the helper.\n isNumberTyped(node) {\n const type = this.getChecker().getTypeAtLocation(node);\n return type !== undefined && (type.flags & (TypeFlags.Number | TypeFlags.NumberLiteral)) !== 0;\n }\n\n // Positions whose emitted Rust is a native `bool`: if/while/do/for\n // conditions, `? :` conditions, `!` operands and `&&` / `||` operands.\n // Parentheses are transparent.\n isBooleanPosition(node) {\n let current = node;\n let parent = current.parent;\n while (parent !== undefined && isParenthesizedExpression(parent)) {\n current = parent;\n parent = parent.parent;\n }\n if (parent === undefined) {\n return false;\n }\n switch (parent.kind) {\n case SyntaxKind.IfStatement:\n case SyntaxKind.WhileStatement:\n case SyntaxKind.DoStatement:\n return parent.expression === current;\n case SyntaxKind.ForStatement:\n case SyntaxKind.ConditionalExpression:\n return parent.condition === current;\n case SyntaxKind.PrefixUnaryExpression:\n return parent.operator === SyntaxKind.ExclamationToken;\n case SyntaxKind.BinaryExpression:\n return parent.operatorToken.kind === SyntaxKind.AmpersandAmpersandToken ||\n parent.operatorToken.kind === SyntaxKind.BarBarToken;\n }\n return false;\n }\n\n // `is_less_than` & co. compare two `Value`s and answer `false` for\n // non-numbers; with both operands checker-typed numbers the same f64\n // comparison runs natively on `Value::as_f64()` unwraps.\n printNativeNumericComparison(node, operator, leftText, rightText) {\n const unwrap = (text: string) => `${text}.as_f64().unwrap_or(f64::NAN)`;\n const comparison = `${unwrap(leftText)} ${operator} ${unwrap(rightText)}`;\n // Conditions/logical operands already expect a bool; every other\n // position stores the result in a `Value`, so box it as before.\n return this.isBooleanPosition(node) ? comparison : `Value::Bool(${comparison})`;\n }\n\n // How numeric an ordered-comparison operand is: 'definite' (numeric\n // literal / `.length` / `indexOf` — Int/Float at runtime, never Null),\n // 'number' (checker-typed — Int, Float or Null, never a string), undefined.\n rustNumericOperandKind(node): string | undefined {\n const inner = this.orderedComparisonOperand(node);\n // `.length` prints through printArrayLength (`Value::Int(len)` or `get_array_length`),\n // `.indexOf(x)` through printIndexOfCall (`get_index_of`): always `Value::Int`.\n if (inner.kind === SyntaxKind.NumericLiteral\n || (isPropertyAccessExpression(inner) && inner.name.text === 'length')\n || (inner.kind === SyntaxKind.CallExpression && this.callExpressionName(inner) === 'indexOf')) {\n return 'definite';\n }\n return this.isNumberTyped(node) ? 'number' : undefined;\n }\n\n // Parens and `x as T` print as the operand itself (printAsExpression drops\n // the assertion), so the operand's own shape drives the emission.\n orderedComparisonOperand(node) {\n let inner = node;\n while (inner !== undefined && (isParenthesizedExpression(inner) || isAsExpression(inner))) {\n inner = inner.expression;\n }\n return inner;\n }\n\n // Native text for an `is_less_than`-family call, undefined unless the\n // operands prove the helper's answer: one number pins `<`/`>`; `>=`/`<=`\n // OR `is_equal` in (TRUE for two Nulls) and need a 'definite' operand.\n printNativeOrderedComparison(node, op, left, right): string | undefined {\n const operator = RustTranspiler.NATIVE_COMPARISON_OPERATORS[op];\n if (operator === undefined || !this.printsValueExpression(this.orderedComparisonOperand(left)) ||\n !this.printsValueExpression(this.orderedComparisonOperand(right))) {\n return undefined;\n }\n const leftKind = this.rustNumericOperandKind(left);\n const rightKind = this.rustNumericOperandKind(right);\n const ordered = op === SyntaxKind.LessThanToken || op === SyntaxKind.GreaterThanToken;\n const proven = leftKind === 'definite' || rightKind === 'definite' ||\n (ordered\n ? (leftKind !== undefined || rightKind !== undefined)\n : (leftKind === 'number' && rightKind === 'number'));\n if (!proven) {\n return undefined;\n }\n return this.printNativeNumericComparison(node, operator, this.printNode(left, 0), this.printNode(right, 0));\n }\n\n // ── native arithmetic (`+ - * /`) ────────────────────────────────────────\n // When the checker proves both operands are numbers (`Int`/`Float` at\n // runtime) or that one is always a string and the other a string or the\n // null the helper stringifies the same way, the helper call is replaced by\n // the arithmetic itself: a 4-arm `Value` match reproducing the helper's\n // Int/Float dispatch, `as_f64()` division, or a `format!` string concat.\n // Anything the checker cannot prove keeps the runtime helper.\n\n // `type` (or every member of a non-empty union) has exactly one of `flags`.\n rustTypeFlagsAll(type: any, flags: Set): boolean {\n if (!type) {\n return false;\n }\n if (type.flags === TypeFlags.Union && Array.isArray(typeParts(type))) {\n return typeParts(type).length > 0 && typeParts(type).every((member: any) => this.rustTypeFlagsAll(member, flags));\n }\n return flags.has(type.flags);\n }\n\n isNumberLikeType(type: any): boolean {\n return this.rustTypeFlagsAll(type, new Set([ TypeFlags.Number, TypeFlags.NumberLiteral ]));\n }\n\n isStringLikeType(type: any): boolean {\n return this.rustTypeFlagsAll(type, new Set([ TypeFlags.String, TypeFlags.StringLiteral ]));\n }\n\n // Types whose runtime value the `add` helper stringifies exactly as `format!` does: a string,\n // or `undefined`/`null` boxed as `Value::Null` (`stringify_simple(Value::Null)` and `Display`\n // both give \"null\"). `any` is absent — the Precise-dict branch has no `Display` equivalent.\n private static readonly RUST_CONCAT_SAFE_FLAGS = new Set([\n TypeFlags.String,\n TypeFlags.StringLiteral,\n TypeFlags.Undefined,\n TypeFlags.Null,\n ]);\n\n isStringOrNullishType(type: any): boolean {\n return this.rustTypeFlagsAll(type, RustTranspiler.RUST_CONCAT_SAFE_FLAGS);\n }\n\n // `Str` (`string | undefined`) operands concatenate natively only against an operand proven\n // ALWAYS a string: the helper then takes its string branch, which `format!` reproduces.\n // Without that anchor (`Str + Str`) the both-null case yields `Value::Null`, not \"nullnull\".\n isNativeStringConcatPair(leftType: any, rightType: any): boolean {\n return this.isStringOrNullishType(leftType) && this.isStringOrNullishType(rightType)\n && (this.isStringLikeType(leftType) || this.isStringLikeType(rightType));\n }\n\n // `(+|-)` with the left operand of `+=`/`-=`: assignment plus the same\n // native emission as the plain binary form.\n printNativeAssignmentArithmetic(op, left, right, leftText, rightText): string | undefined {\n const native = this.printNativeArithmetic(op, left, right, leftText, rightText);\n return native === undefined ? undefined : `${leftText} = ${native}`;\n }\n\n printNativeArithmetic(op, left, right, leftText, rightText): string | undefined {\n if (op !== SyntaxKind.PlusToken && op !== SyntaxKind.MinusToken &&\n op !== SyntaxKind.AsteriskToken && op !== SyntaxKind.SlashToken) {\n return undefined;\n }\n let leftType, rightType;\n try {\n const checker = this.getChecker();\n leftType = checker.getTypeAtLocation(left);\n rightType = checker.getTypeAtLocation(right);\n } catch (e) {\n return undefined;\n }\n if (op === SyntaxKind.PlusToken && this.isNativeStringConcatPair(leftType, rightType)) {\n return this.printNativeStringConcat(leftText, rightText);\n }\n if (!this.isNumberLikeType(leftType) || !this.isNumberLikeType(rightType)) {\n return undefined;\n }\n return this.printNativeNumeric(op, leftText, rightText);\n }\n\n printNativeStringConcat(leftText: string, rightText: string): string {\n return `Value::Str(format!(\"{}{}\", ${leftText}, ${rightText}).into())`;\n }\n\n // Both operands are `Int`/`Float` at runtime; `-> Value::Null` covers the\n // `Null`/non-numeric values the same way the helper's fallthrough does.\n // Always parenthesised so it composes under `&`, in argument position and\n // as an operand of another native match.\n printNativeNumeric(op, leftText: string, rightText: string): string {\n const [ left, right ] = [ `(${leftText})`, `(${rightText})` ];\n if (op === SyntaxKind.SlashToken) {\n return `(match (${left}.as_f64(), ${right}.as_f64()) { (Some(x), Some(y)) if y != 0.0 => Value::Float(x / y), _ => Value::Null })`;\n }\n const sign = op === SyntaxKind.PlusToken ? '+' : (op === SyntaxKind.MinusToken ? '-' : '*');\n return `(match (&${left}, &${right}) {` +\n ` (Value::Int(x), Value::Int(y)) => Value::Int(x ${sign} y),` +\n ` (Value::Int(x), Value::Float(y)) => Value::Float(*x as f64 ${sign} *y),` +\n ` (Value::Float(x), Value::Int(y)) => Value::Float(*x ${sign} *y as f64),` +\n ` (Value::Float(x), Value::Float(y)) => Value::Float(x ${sign} y),` +\n ` _ => Value::Null })`;\n }\n\n private static readonly RUST_TYPEOF_HELPERS = new Map([\n ['string', 'is_string'], ['number', 'is_number'], ['boolean', 'is_bool'], ['object', 'is_object'], ['function', 'is_function'],\n ]);\n\n printCustomBinaryExpressionIfAny(node, identation) {\n const { left, right } = node;\n const op = node.operatorToken.kind;\n const isAssign = op === SyntaxKind.EqualsToken;\n // Array destructuring reassignment: [a, b] = expr → bind once, reassign each\n if (isAssign && left.kind === SyntaxKind.ArrayLiteralExpression) {\n const tmpName = '__destr_tmp';\n const rhs = this.printNode(right, 0);\n const nativeList = this.rustNativeListSource(right);\n const assignments = left.elements.map((e, idx) => `${this.printNode(e, 0)} = ${nativeList\n ? this.printNativeListIndex(tmpName, idx) : `get_value(&${tmpName}, &Value::Int(${idx}))`}`).join('; ');\n return `{ let ${tmpName} = ${rhs}; ${assignments}; }`;\n }\n // Element access assignment: a[b] = v → add_element_to_object(&mut a, &b, v)\n if (isAssign && left.kind === SyntaxKind.ElementAccessExpression) {\n const keys: any[] = [];\n let baseExpr: any = left;\n while (isElementAccessExpression(baseExpr)) {\n keys.unshift(baseExpr.argumentExpression);\n baseExpr = baseExpr.expression;\n }\n let acc = `&mut ${this.printNode(baseExpr, 0)}`;\n const keyStrs = keys.map(k => this.printNode(k, 0));\n for (const key of keyStrs.slice(0, -1)) acc = `get_value_mut(${acc}, &${key})`;\n const rhs = this.printNode(right, 0);\n const nativeInsert = keyStrs.length === 1 ? this.printNativeDictInsert(baseExpr, keys[0], keyStrs[0], rhs) : undefined;\n return nativeInsert ?? `add_element_to_object(${acc}, &${keyStrs[keyStrs.length - 1]}, ${rhs})`;\n }\n // typeof comparisons\n if (left.kind === SyntaxKind.TypeOfExpression) {\n const rightText = right.text;\n const target = this.printNode(left.expression, 0);\n const isDiff = op === SyntaxKind.ExclamationEqualsEqualsToken || op === SyntaxKind.ExclamationEqualsToken;\n const native = this.nativeValuePredicateText(rightText, left.expression, target);\n if (native !== undefined) {\n const negated = isDiff ? `!${native}` : native;\n // Conditions/logical operands expect a bool; other positions store a boxed `Value`.\n return this.isBooleanPosition(node) ? negated : `Value::Bool(${negated})`;\n }\n const helper = RustTranspiler.RUST_TYPEOF_HELPERS.get(rightText);\n if (helper !== undefined) return `${isDiff ? '!' : ''}${helper}(&${target})`;\n }\n // `in` — wrapped as Value so it composes in any context\n if (op === SyntaxKind.InKeyword) {\n const shadow = this.rustParamShadowOf(right);\n return (shadow !== undefined ? this.printShadowInOperator(shadow, left) : undefined)\n ?? this.printNativeInOperator(left, right)\n ?? `Value::Bool(in_op(&${this.printNode(right, 0)}, &${this.printNode(left, 0)}))`;\n }\n // `+=` / `-=` on regular variables\n if ((op === SyntaxKind.PlusEqualsToken || op === SyntaxKind.MinusEqualsToken) && left.kind !== SyntaxKind.ElementAccessExpression) {\n const isPlus = op === SyntaxKind.PlusEqualsToken;\n const leftText = this.printNode(left, 0);\n const rightText = this.printNode(right, 0);\n return this.printNativeAssignmentArithmetic(isPlus ? SyntaxKind.PlusToken : SyntaxKind.MinusToken, left, right, leftText, rightText)\n ?? `${leftText} = ${isPlus ? 'add' : 'subtract'}(&${leftText}, &${rightText})`;\n }\n // Native equality on unwrapped payloads when the checker proves the variants line up\n // (see printNativeEqualityComparison); the bool is boxed like the other Value helpers.\n if (op === SyntaxKind.EqualsEqualsToken || op === SyntaxKind.EqualsEqualsEqualsToken ||\n op === SyntaxKind.ExclamationEqualsToken || op === SyntaxKind.ExclamationEqualsEqualsToken) {\n const nativeEquality = this.printNativeEqualityComparison(left, right, op);\n if (nativeEquality) return `Value::Bool(${nativeEquality})`;\n }\n // A logical expression with a native-compare operand no longer starts with a bool helper: box it.\n if ((op === SyntaxKind.AmpersandAmpersandToken || op === SyntaxKind.BarBarToken)\n && (this.hasNativeComparisonOperand(left) || this.hasNativeComparisonOperand(right))) {\n return `Value::Bool(${this.printLogicalInBooleanContext(node)})`;\n }\n // Binary wrapper functions (is_equal, add, etc.) - add & to both sides\n if (op in this.binaryExpressionsWrappers) {\n const nativeCompare = RustTranspiler.NATIVE_COMPARISON_OPERATORS[op] !== undefined\n ? this.printNativeOrderedComparison(node, op, left, right) : undefined;\n if (nativeCompare !== undefined) return nativeCompare;\n const [fnName, close] = this.binaryExpressionsWrappers[op];\n const leftText = this.printNode(left, 0);\n const rightText = this.printNode(right, 0);\n return this.printNativeArithmetic(op, left, right, leftText, rightText)\n ?? `${fnName}${this.ensureRef(leftText)}, ${this.ensureRef(rightText)}${close}`;\n }\n return undefined;\n }\n\n printBinaryExpression(node, identation) {\n return this.printCustomBinaryExpressionIfAny(node, identation) || super.printBinaryExpression(node, identation);\n }\n\n // `Date.now()` → runtime helper returning current epoch millis.\n printDateNowCall(node, identation) {\n return 'date_now()';\n }\n\n // `str.padStart(len, pad)` / `str.padEnd(len, pad)` → runtime helpers `(&Value, &Value, &Value)`.\n printPadStartCall(node, identation, name, parsedArg, parsedArg2) {\n return `pad_start(${this.ensureRef(name)}, ${this.ensureRef(parsedArg)}, ${this.ensureRef(parsedArg2)})`;\n }\n\n printPadEndCall(node, identation, name, parsedArg, parsedArg2) {\n return `pad_end(${this.ensureRef(name)}, ${this.ensureRef(parsedArg)}, ${this.ensureRef(parsedArg2)})`;\n }\n\n printVariableDeclarationList(node, identation) {\n const declaration = node.declarations[0];\n const indent = this.getIden(identation);\n if (declaration?.name.kind === SyntaxKind.ArrayBindingPattern) {\n const parsedElements = declaration.name.elements.map(e => this.printNode(e.name, 0));\n const syntheticName = parsedElements.join('') + 'Variable';\n const head = `${indent}let mut ${syntheticName} = ${this.printNode(declaration.initializer, 0)};\\n`;\n const nativeList = this.rustNativeListSource(declaration.initializer);\n const lines = parsedElements.map((e, idx) => `${indent}let mut ${e}: Value = ${nativeList\n ? this.printNativeListIndex(syntheticName, idx) : `get_value(&${syntheticName}, &Value::Int(${idx}))`}`);\n return head + lines.join(';\\n');\n }\n const varName = this.printNode(declaration.name, 0);\n if (!declaration.initializer) {\n return `${indent}let mut ${varName}: Value = Value::Null`;\n }\n const parsedValue = this.printNode(declaration.initializer, identation).trim();\n if (declaration.initializer.kind === SyntaxKind.NewExpression) {\n return `${indent}let mut ${varName} = ${parsedValue}`;\n }\n const boolValue = this.getRustBoolLocalInitializer(declaration, parsedValue);\n if (boolValue !== undefined) {\n return `${indent}let mut ${varName}: bool = ${boolValue}`;\n }\n const typedStr = this.rustSafeStringLocalIsTyped(declaration);\n const nativeStr = this.rustNativeStrCalleeKind(declaration.initializer) === 'str';\n if (typedStr) {\n // A native-`Option` callee already carries the payload; `safeString` helpers need the unwrap.\n return `${indent}let mut ${varName}: Option = ${parsedValue}${nativeStr ? '' : '.as_str().map(str::to_owned)'}`;\n }\n // A callee returning `Option` into a boxed local keeps the box.\n return `${indent}let mut ${varName}: Value = ${nativeStr ? this.rustNativeStrValueBox(parsedValue) : parsedValue}`;\n }\n\n // ── native-typed locals ───────────────────────────────────────────────────\n //\n // A local is declared `bool` (instead of `Value`) when its initializer is\n // already a bool-valued Rust expression and every use is a condition sink\n // (`is_true(&x)`) — the one sink that accepts a native bool today.\n //\n // `is_true` is generic over `IsTruthy` (impl for `bool`/`&bool` in\n // runtime.rs); every other sink takes `&Value`, so any other use keeps the\n // local boxed. Bools come in two shapes: helpers whose Rust return type is\n // already `bool` (below), and the printer's own `Value::Bool(...)` box,\n // which the declaration drops at the init site.\n\n private static readonly RUST_BOOL_RESULT_HELPERS = new Set([\n 'is_true', 'is_equal', 'is_greater_than', 'is_greater_than_or_equal',\n 'is_less_than', 'is_less_than_or_equal', 'is_array', 'is_object',\n 'is_string', 'is_number', 'is_bool', 'is_integer', 'is_function',\n 'is_instance', 'starts_with', 'ends_with', 'in_op', 'contains',\n ]);\n\n // Hand-written Rust fns outside `runtime.rs` with a `-> bool` signature, keyed by the TS callee\n // name (verified in `rust/tests/src/tests_support.rs`). A call is already a Rust bool, so the\n // condition printer's `is_true(&…)` wrapper is the identity (`IsTruthy for bool`) and is dropped.\n private static readonly RUST_BOOL_RESULT_CALLEES = new Set([\n 'tickerExceptionNeedsOhlcv',\n ]);\n\n // Call to a hand-written `-> bool` fn: the checker must agree the TS call\n // is boolean-typed and the callee must be in the verified table above.\n rustCallPrintsBool(node): boolean {\n if (node?.kind !== SyntaxKind.CallExpression) {\n return false;\n }\n const callee: any = node.expression;\n const name = callee?.kind === SyntaxKind.Identifier ? callee.text\n : callee?.kind === SyntaxKind.PropertyAccessExpression ? callee.name?.text : undefined;\n return name !== undefined && RustTranspiler.RUST_BOOL_RESULT_CALLEES.has(name) && this.rustTypeIsBoolean(node);\n }\n\n // Index just past the `\"...\"` literal opening at `i` (escapes skipped).\n private rustSkipStringLiteral(text: string, i: number): number {\n for (i++; i < text.length && text[i] !== '\"'; i++) {\n if (text[i] === '\\\\') i++;\n }\n return i;\n }\n\n // `)` spanning the whole printed value → ``. The payload is\n // only reachable this way: the printer prints the value, not its parts.\n peelValueBox(printedValue: string, prefix: string): string | undefined {\n if (!printedValue.startsWith(prefix) || !printedValue.endsWith(')')) {\n return undefined;\n }\n let depth = 0;\n for (let i = prefix.length - 1; i < printedValue.length; i++) {\n const char = printedValue[i];\n if (char === '\"') i = this.rustSkipStringLiteral(printedValue, i);\n else if (char === '(') depth++;\n else if (char === ')' && --depth === 0) {\n return i === printedValue.length - 1 ? printedValue.slice(prefix.length, i) : undefined;\n }\n }\n return undefined;\n }\n\n // `Value::Bool()` spanning the whole expression → ``.\n peelValueBoolBox(printedValue: string): string | undefined {\n return this.peelValueBox(printedValue, 'Value::Bool(');\n }\n\n // `Value::Str()` spanning the whole expression → `` (a String).\n peelValueStrBox(printedValue: string): string | undefined {\n return this.peelValueBox(printedValue, 'Value::Str(');\n }\n\n // `((expr))` → `expr` — a redundant layer kept from the TS source; the\n // right-hand side of a declaration binds the whole expression anyway.\n stripOuterParens(printedValue: string): string {\n let value = printedValue.trim();\n while (value.startsWith('(') && value.endsWith(')')) {\n let depth = 0;\n let closesAtEnd = true;\n for (let i = 0; i < value.length && closesAtEnd; i++) {\n const char = value[i];\n if (char === '\"') i = this.rustSkipStringLiteral(value, i);\n else if (char === '(') depth++;\n else if (char === ')' && --depth === 0 && i !== value.length - 1) closesAtEnd = false;\n }\n if (!closesAtEnd || depth !== 0) break;\n value = value.slice(1, -1).trim();\n }\n return value;\n }\n\n // `is_equal(...)` / `!is_true(...)` / `contains(...)` — bare bool helper calls.\n printedBoolHelperCall(printedValue: string): boolean {\n const stripped = printedValue.startsWith('!') ? printedValue.slice(1).trim() : printedValue;\n const match = /^([a-z_][a-z0-9_]*)\\(/.exec(stripped);\n return match !== null && RustTranspiler.RUST_BOOL_RESULT_HELPERS.has(match[1]);\n }\n\n // Source shapes the printer turns into a bool: comparisons, `&&`/`||`\n // (each operand is is_true-wrapped), `!`, `in`, `instanceof`, true/false.\n rustNodeIsBoolExpression(node): boolean {\n switch (node?.kind) {\n case SyntaxKind.TrueKeyword:\n case SyntaxKind.FalseKeyword:\n return true;\n case SyntaxKind.ParenthesizedExpression:\n return this.rustNodeIsBoolExpression(node.expression);\n case SyntaxKind.PrefixUnaryExpression:\n return node.operator === SyntaxKind.ExclamationToken;\n case SyntaxKind.BinaryExpression: {\n const kind = node.operatorToken.kind;\n return (RustTranspiler as any).COMPARISON_OPS.has(kind) || kind === SyntaxKind.AmpersandAmpersandToken\n || kind === SyntaxKind.BarBarToken || kind === SyntaxKind.InKeyword || kind === SyntaxKind.InstanceOfKeyword;\n }\n }\n return false;\n }\n\n rustTypeIsBoolean(node): boolean {\n try {\n const type = this.getChecker().getTypeAtLocation(node);\n return (type.flags & TypeFlags.BooleanLike) !== 0 || this.getChecker().typeToString(type).trim() === 'boolean';\n } catch (e) {\n return false; // no checker type → keep the boxed form\n }\n }\n\n rustTypeIsString(node): boolean {\n const checker: any = this.checkerOrUndefined();\n // no checker type → keep the boxed form\n return checker !== undefined && this.isStringLikeType(checker.getTypeAtLocation(node));\n }\n\n rustEnclosingFunction(node) {\n for (let current = node?.parent; current; current = current.parent) {\n switch (current.kind) {\n case SyntaxKind.MethodDeclaration:\n case SyntaxKind.FunctionDeclaration:\n case SyntaxKind.FunctionExpression:\n case SyntaxKind.ArrowFunction:\n case SyntaxKind.Constructor:\n case SyntaxKind.SourceFile:\n return current;\n }\n }\n return undefined;\n }\n\n rustBindsName(node, name: string): boolean {\n switch (node?.kind) {\n case SyntaxKind.VariableDeclaration:\n case SyntaxKind.Parameter:\n case SyntaxKind.FunctionDeclaration:\n case SyntaxKind.ClassDeclaration:\n case SyntaxKind.PropertyDeclaration:\n case SyntaxKind.FunctionExpression:\n case SyntaxKind.ArrowFunction:\n return node.name?.kind === SyntaxKind.Identifier && node.name.text === name;\n }\n return false;\n }\n\n // Only these uses compile against a native `bool` local today: `is_true(&x)`\n // (under any depth of `(...)`, `!`, `&&`/`||`), and the condition slot of\n // if/while/for/ternary — all printed is_true-wrapped.\n rustIdentifierUseIsCondition(node): boolean {\n for (let current: any = node, parent: any = node.parent; parent; current = parent, parent = parent.parent) {\n switch (parent.kind) {\n case SyntaxKind.ParenthesizedExpression:\n if (parent.expression !== current) return false;\n break;\n case SyntaxKind.PrefixUnaryExpression:\n if (parent.operator !== SyntaxKind.ExclamationToken || parent.operand !== current) return false;\n break;\n case SyntaxKind.BinaryExpression:\n if (parent.operatorToken.kind !== SyntaxKind.AmpersandAmpersandToken\n && parent.operatorToken.kind !== SyntaxKind.BarBarToken) return false;\n break;\n case SyntaxKind.IfStatement:\n case SyntaxKind.WhileStatement:\n case SyntaxKind.DoStatement:\n return parent.expression === current;\n case SyntaxKind.ForStatement:\n case SyntaxKind.ConditionalExpression:\n return parent.condition === current;\n default:\n return false;\n }\n }\n return false;\n }\n\n // Visits every in-scope use of the local `name` declared by `declaration`: false as soon as the\n // name is re-bound in scope or `acceptUse(identifier)` rejects a use. `skipPropertyNames` leaves\n // `x.foo` / `{ foo }` names out of the uses.\n private rustLocalUsesAll(declaration, name: string, skipPropertyNames: boolean, acceptUse: (n) => boolean): boolean {\n const scope = this.rustEnclosingFunction(declaration);\n if (scope === undefined || name === undefined) {\n return false;\n }\n let safe = true;\n for (const n of this.rustScopeNameNodes(scope, name) as any[]) {\n if (n !== declaration && this.rustBindsName(n, name)) {\n safe = false; // a second binding of the name in scope — stay boxed\n break;\n }\n if (n.kind === SyntaxKind.Identifier && n !== declaration.name\n && !(skipPropertyNames && this.rustIdentifierIsPropertyName(n)) && !acceptUse(n)) {\n safe = false;\n break;\n }\n }\n return safe;\n }\n\n rustLocalUsesAcceptBool(declaration, sourceName: string): boolean {\n return this.rustLocalUsesAll(declaration, sourceName, false, (n) => this.rustIdentifierUseIsCondition(n));\n }\n\n // Typed string locals: `let x: Value = self.safeString(..)` is declared `Option` when\n // the checker proves a string and every use is a native sink (`x.is_none()`, `x.as_deref() ==\n // Some(\"lit\")`). The helper's Value is unwrapped with `.as_str()`; any other sink keeps the box.\n\n private static readonly RUST_STRING_LOCAL_HELPERS = new Set([\n 'safeString', 'safeString2', 'safeStringN',\n 'safeStringLower', 'safeStringLower2', 'safeStringLowerN',\n 'safeStringUpper', 'safeStringUpper2', 'safeStringUpperN',\n ]);\n\n private rustStringLocalDecisions = new Map();\n\n // `let x = this.safeString(..)` / `safeString(..)` — the whole initializer;\n // a call whose callee already returns `Option` (a native-`Str`\n // method) is the same payload without the unwrap.\n rustSafeStringLocalInitializer(declaration): boolean {\n const initializer = declaration.initializer;\n if (declaration.name?.kind !== SyntaxKind.Identifier || initializer?.kind !== SyntaxKind.CallExpression) {\n return false;\n }\n if (this.rustNativeStrCalleeKind(initializer) === 'str') {\n return true;\n }\n const callee = initializer.expression;\n const helpers = RustTranspiler.RUST_STRING_LOCAL_HELPERS;\n if (callee?.kind === SyntaxKind.PropertyAccessExpression) {\n return callee.expression?.kind === SyntaxKind.ThisKeyword && helpers.has(callee.name.text);\n }\n return callee?.kind === SyntaxKind.Identifier && helpers.has(callee.text);\n }\n\n // The two uses that compile against an `Option` local and print\n // natively: `x ==/!= null|undefined` and `x ==/!= \"lit\"`.\n rustStringLocalUseIsNative(node): boolean {\n const parent = node.parent;\n if (parent?.kind !== SyntaxKind.BinaryExpression) {\n return false;\n }\n const op = parent.operatorToken.kind;\n if (op !== SyntaxKind.EqualsEqualsToken && op !== SyntaxKind.EqualsEqualsEqualsToken\n && op !== SyntaxKind.ExclamationEqualsToken && op !== SyntaxKind.ExclamationEqualsEqualsToken) {\n return false;\n }\n const other = parent.left === node ? parent.right : (parent.right === node ? parent.left : undefined);\n if (other === undefined) {\n return false;\n }\n const otherLiteral = this.literalKindOfNode(other);\n // The string-literal compare prints as `.as_deref() == Some(\"lit\")`;\n // the printer's own rejections (replacement tokens) must match.\n return otherLiteral === 'null' || (otherLiteral === 'string' && !(other.text in this.StringLiteralReplacements));\n }\n\n // Every use compiles against `Option`, and at least one native sink\n // consumes it (otherwise the retype buys nothing).\n rustSafeStringLocalIsTyped(declaration): boolean {\n const cached = this.rustStringLocalDecisions.get(declaration);\n if (cached !== undefined) {\n return cached;\n }\n this.rustStringLocalDecisions.set(declaration, false); // re-entrancy guard\n const decision = this.rustSafeStringLocalIsTypedUncached(declaration);\n this.rustStringLocalDecisions.set(declaration, decision);\n return decision;\n }\n\n rustSafeStringLocalIsTypedUncached(declaration): boolean {\n if (!this.rustSafeStringLocalInitializer(declaration)\n || this.primitiveKindOfType(this.typeOfNodeIfAny(declaration.name)) !== 'string') {\n return false;\n }\n let nativeUses = 0;\n const safe = this.rustLocalUsesAll(declaration, declaration.name.text, true,\n (n) => this.rustStringLocalUseIsNative(n) && ++nativeUses > 0);\n return safe && nativeUses > 0;\n }\n\n // `x.foo` / `{ foo: 1 }` — a property name is not a use of the local.\n rustIdentifierIsPropertyName(node): boolean {\n const parent = node.parent;\n switch (parent?.kind) {\n case SyntaxKind.PropertyAccessExpression:\n case SyntaxKind.PropertyAssignment:\n case SyntaxKind.PropertySignature:\n case SyntaxKind.ShorthandPropertyAssignment:\n return parent.name === node;\n }\n return false;\n }\n\n // Is this identifier occurrence bound to a typed string local?\n rustStringLocalIdentifierIsTyped(node): boolean {\n const checker: any = node?.kind === SyntaxKind.Identifier ? this.checkerOrUndefined() : undefined;\n if (checker === undefined) {\n return false;\n }\n const symbol = checker.getSymbolAtLocation(node);\n const declaration = symbolValueDeclaration(symbol) ?? symbolDeclarations(symbol)[0];\n return declaration?.kind === SyntaxKind.VariableDeclaration && this.rustSafeStringLocalIsTyped(declaration);\n }\n\n // `let x = ` → the printed bool expression, or undefined.\n getRustBoolLocalInitializer(declaration, printedValue: string): string | undefined {\n const initializer = declaration.initializer;\n if (initializer === undefined || declaration.name?.kind !== SyntaxKind.Identifier) {\n return undefined;\n }\n const inner = this.stripOuterParens(printedValue);\n const peeled = this.peelValueBoolBox(inner);\n if (peeled === undefined && !this.printedBoolHelperCall(inner) && !this.rustNodeIsBoolExpression(initializer)) {\n return undefined;\n }\n if (!this.rustTypeIsBoolean(initializer) || !this.rustLocalUsesAcceptBool(declaration, declaration.name.text)) {\n return undefined;\n }\n return peeled ?? inner;\n }\n\n // ── native `Option` returns (`: Str` methods) ─────────────────────\n //\n // An internal, non-override, non-async method declared `: Str`\n\n private rustNativeStrReturnDecisions = new WeakMap();\n\n // `ts/src/base/**` — the shared `Exchange` / `PredictionExchange` classes\n // (the transpiler synthesises variants like `.__ExchangeNoOverloads.ts`).\n private static readonly RUST_BASE_TIER_FILE = /ts[\\\\/]src[\\\\/]base[\\\\/]/;\n\n /** `'str'` when the method is emitted `-> Option`, else undefined. */\n rustNativeStrReturnKind(node: Node): string | undefined {\n if (node === undefined || node.kind !== SyntaxKind.MethodDeclaration) {\n return undefined;\n }\n let decision = this.rustNativeStrReturnDecisions.get(node);\n if (decision === undefined) {\n this.rustNativeStrReturnDecisions.set(node, false); // re-entrancy guard\n decision = this.rustNativeStrReturnDecisionUncached(node);\n this.rustNativeStrReturnDecisions.set(node, decision);\n }\n return decision ? 'str' : undefined;\n }\n\n private rustMethodOverrides = new WeakMap();\n private rustClassAncestorTables = new WeakMap[] | null>();\n\n /** Per ancestor class (nearest first): method name -> its LAST declaration; undefined when a\n * parent class does not resolve. */\n private rustAncestorMethodTables(classDecl: Node): Map[] | undefined {\n const cached = this.rustClassAncestorTables.get(classDecl);\n if (cached !== undefined) {\n return cached ?? undefined;\n }\n const chain: Map[] = [];\n let parentClass = getAllSuperTypeNodes(classDecl)[0];\n let ok = true;\n while (parentClass !== undefined) {\n const parentClassDecl = this.getChecker().getTypeAtLocation(parentClass)?.getSymbol()?.valueDeclaration?.resolve();\n if (parentClassDecl === undefined) {\n ok = false;\n break;\n }\n const byName = new Map();\n for (const elem of (parentClassDecl as any).members ?? []) {\n if (isMethodDeclaration(elem)) {\n byName.set(elem.name.getText().trim(), elem);\n }\n }\n chain.push(byName);\n parentClass = getAllSuperTypeNodes(parentClassDecl)[0] ?? undefined;\n }\n this.rustClassAncestorTables.set(classDecl, ok ? chain : null);\n return ok ? chain : undefined;\n }\n\n // base getMethodOverride rescans every parent member (getText) per call; same walk, memoized\n getMethodOverride(node: Node): Node {\n if (node === undefined || !isClassDeclaration(node.parent) || !(node.parent as any).heritageClauses) {\n return undefined;\n }\n const cached = this.rustMethodOverrides.get(node);\n if (cached !== undefined) {\n return cached ?? undefined;\n }\n const chain = this.rustAncestorMethodTables(node.parent);\n let method = undefined;\n if (chain === undefined) {\n this.warn(node, \"Parent class\", \"Parent class not found\");\n } else {\n const name = (node as any).name.text;\n for (const byName of chain) {\n method = byName.get(name) ?? method;\n }\n }\n this.rustMethodOverrides.set(node, method ?? null);\n return method;\n }\n\n private rustNativeStrReturnDecisionUncached(node): boolean {\n // An override's base/trait copy prints `-> Value`. The base classes are hand-tuned across the\n // whole tree: their methods are called from ~every derived file (and the hand-written runtime),\n // where the boxed `Value` ABI is load-bearing. Only per-exchange\n if (node.type === undefined || this.isAsyncFunction(node) || this.getMethodOverride(node) !== undefined\n || RustTranspiler.RUST_BASE_TIER_FILE.test(node.getSourceFile().fileName)) {\n return false;\n }\n let type: Type;\n try {\n type = this.getChecker().getTypeFromTypeNode(node.type);\n } catch (e) {\n return false;\n }\n return this.primitiveKindOfType(type) === 'string' && this.rustStrReturnPathsConvert(node.body);\n }\n\n /** Every `return` of the method's own body converts, and the body's last\n * statement is one of them (so Rust sees no `()`-valued tail the\n * `-> Value` post-passes would have patched with `Value::Null`). */\n rustStrReturnPathsConvert(body: Block): boolean {\n const last = body?.statements[body.statements.length - 1];\n if (last === undefined || !isReturnStatement(last)) {\n return false;\n }\n let ok = true;\n const visit = (n: Node) => {\n if (!ok || (n !== body && isFunctionLike(n))) {\n return; // a nested function keeps the boxed signature\n }\n if (isReturnStatement(n) && !this.rustStrReturnValueConverts(n.expression)) {\n ok = false;\n return;\n }\n n.forEachChild(visit);\n };\n body.forEachChild(visit);\n return ok;\n }\n\n /** A `return` value of a native-`Str` method: a nullish literal, an\n * expression already printing an `Option` (a nested retyped call\n * or a typed string local), or a `Value`-printing expression the checker\n * types `string | undefined`. */\n rustStrReturnValueConverts(expression: Node): boolean {\n const inner = this.unwrapParensNode(expression);\n if (inner === undefined) {\n return false;\n }\n if (this.literalKindOfNode(inner) === 'null' || this.rustStrNativeExpression(inner)) {\n return true;\n }\n return this.printsValueExpression(inner) && this.primitiveKindOfType(this.getCheckedTypeOf(inner)) === 'string';\n }\n\n /** An expression that already prints an `Option` in a `: Str`\n * method's return position. */\n rustStrNativeExpression(expression: Node): boolean {\n const inner = this.unwrapParensNode(expression);\n if (inner !== undefined && isCallExpression(inner)) {\n return this.rustNativeStrCalleeKind(inner) === 'str';\n }\n return inner !== undefined && isIdentifier(inner) && this.rustStringLocalIdentifierIsTyped(inner);\n }\n\n unwrapParensNode(node: Node): Node | undefined {\n let current = node;\n while (current !== undefined && isParenthesizedExpression(current)) {\n current = current.expression;\n }\n return current;\n }\n\n /** The callee declaration behind `self.(..)` when it is emitted\n * `-> Option`; undefined otherwise (no proof → keep the box). */\n // call node -> resolved signature's declaration (null: none); a handle resolve per call is JS-heavy\n private rustCallDeclarations = new WeakMap();\n\n rustNativeStrCalleeKind(node: Node): string | undefined {\n if (node === undefined || node.kind !== SyntaxKind.CallExpression) {\n return undefined;\n }\n let declaration = this.rustCallDeclarations.get(node);\n if (declaration === undefined) {\n try {\n declaration = signatureDeclaration((this.getChecker() as any).getResolvedSignature(node)) ?? null;\n } catch (e) {\n return undefined;\n }\n this.rustCallDeclarations.set(node, declaration);\n }\n return declaration?.kind === SyntaxKind.MethodDeclaration ? this.rustNativeStrReturnKind(declaration) : undefined;\n }\n\n /** `Option` → `Value` (exact inverse of the return conversion). */\n rustNativeStrValueBox(text: string): string {\n return `${text}.map(|__s| Value::Str(__s.into())).unwrap_or(Value::Null)`;\n }\n\n /** True when a call to a native-`Str` callee must be boxed back to a\n * `Value` at this position; the declaration and return printers run the\n * conversion themselves. */\n rustNativeStrCallNeedsBox(node: Node): boolean {\n let current: any = node;\n let parent: any = current.parent;\n while (parent !== undefined && isParenthesizedExpression(parent) && parent.expression === current) {\n current = parent;\n parent = parent.parent;\n }\n if (parent === undefined) {\n return true;\n }\n if (isVariableDeclaration(parent) && parent.initializer === current && isIdentifier(parent.name)) {\n return false; // the declaration printer binds the type / boxes it\n }\n if (isReturnStatement(parent) && parent.expression === current) {\n // only a native-`Str` method's own return printer runs the conversion\n return this.rustNativeStrReturnKind(findAncestor(parent.parent, isFunctionLike) as any) !== 'str';\n }\n return true;\n }\n\n /** Wrap a call text when the callee returns a native `Option`\n * and the position still needs a `Value`. */\n rustBoxNativeStrCallIfNeeded(node: Node, text: string): string {\n return this.rustNativeStrCalleeKind(node) === 'str' && this.rustNativeStrCallNeedsBox(node)\n ? this.rustNativeStrValueBox(text) : text;\n }\n\n // ── declared-Dict locals (`let x: Value = self.safe_dict_k(..)`) ───────────\n //\n // The printer declares non-bool locals `Value`, and the checker types a\n\n private declaredDictLocalsCache: { src: SourceFile, table: Map } | undefined;\n\n /** All `let x: Value = ` declarations of the current\n * source file, keyed by local name in declaration order. */\n rustDeclaredDictLocals(): Map {\n const src = this.getSrc();\n if (this.declaredDictLocalsCache?.src !== src) {\n let table: Map;\n try {\n table = this.collectRustDeclaredDictLocals(src);\n } catch (e) {\n table = new Map(); // no proof -> consumers keep the helper\n }\n this.declaredDictLocalsCache = { src, table };\n }\n return this.declaredDictLocalsCache.table;\n }\n\n /** Printer hook for the helper-removal units: the proven kind of a declared\n * local, or undefined when the local is not proven Dict at every use.\n * Accepts the receiver node of the helper call (identifier, `x['k']` chain,\n * `this.x` chain) or the declaration itself. */\n rustDeclaredLocalTypeResolver(node: Node): RustDeclaredLocalKind | undefined {\n return this.rustDeclaredLocalEntry(node)?.kind;\n }\n\n /** The table entry a use site resolves to (the declaration whose binding the\n * use refers to, proven), or undefined. */\n rustDeclaredLocalEntry(node: Node): RustDeclaredDictLocalEntry | undefined {\n if (node === undefined) return undefined;\n const name = isVariableDeclaration(node) ? (node.name as Identifier).text : this.rootPlaceText(node);\n if (name === undefined) return undefined;\n const entries = this.rustDeclaredDictLocals().get(name);\n if (entries === undefined) return undefined;\n const start = node.getStart();\n const identifier = this.rustDeclaredLocalIdentifier(node);\n const symbol = identifier === undefined ? undefined : this.rustSymbolOf(identifier);\n let best: RustDeclaredDictLocalEntry | undefined;\n for (const entry of entries) {\n if (entry.start > start || !entry.alwaysDict || !entry.stable) continue;\n const scope = this.rustEnclosingFunction(entry.declaration);\n if (scope !== undefined && !this.isNodeInsideNode(node, scope)) continue;\n if (identifier !== undefined) {\n const entrySymbol = this.rustSymbolOf((entry.declaration.name as Identifier));\n if (symbol !== undefined && entrySymbol !== undefined && symbol !== entrySymbol) continue;\n }\n if (best === undefined || entry.start > best.start) best = entry;\n }\n return best;\n }\n\n /** The identifier at the head of a place (`x`, `x['k']`, `this.x` is not a\n * local) — the node the resolver matches against the table. */\n private rustDeclaredLocalIdentifier(node: Node): Identifier | undefined {\n let current: any = node;\n while (current !== undefined && !isIdentifier(current)) {\n if (isElementAccessExpression(current) || isPropertyAccessExpression(current)) {\n if (current.expression.kind === SyntaxKind.ThisKeyword) return undefined;\n } else if (!isParenthesizedExpression(current) && !isNonNullExpression(current)) {\n return undefined;\n }\n current = current.expression;\n }\n return current;\n }\n\n /** Binding symbol of an identifier, or undefined when the checker cannot\n * answer (ByContent probes without a class context, for instance). */\n private rustSymbolOf(node: Identifier): TsSymbol | undefined {\n return this.checkerOrUndefined()?.getSymbolAtLocation(node);\n }\n\n /** True when this identifier is a use of the given declaration's binding.\n * Without a checker answer the callers stay conservative (reject). */\n private rustIdentifierRefersToDeclaration(node: Identifier, declaration: VariableDeclaration): boolean {\n const symbol = this.rustSymbolOf(node);\n return symbol !== undefined && symbol === this.rustSymbolOf(declaration.name as Identifier);\n }\n\n /** Census of the current source file's table, for reports and tests. */\n rustDeclaredDictLocalCensus(): { declarators: number, dict: number, alwaysDict: number, kindUnstable: number, retypeEligible: number } {\n let declarators = 0, dict = 0, alwaysDict = 0, kindUnstable = 0, retypeEligible = 0;\n for (const entries of this.rustDeclaredDictLocals().values()) {\n for (const entry of entries) {\n declarators++;\n if (entry.alwaysDict) alwaysDict++;\n if (entry.alwaysDict && entry.stable) dict++;\n if (entry.alwaysDict && !entry.stable) kindUnstable++;\n // every later use is an element access or a kind-preserving\n // mutator -> the only uses a native declaration has to serve.\n if (entry.alwaysDict && entry.stable && entry.uses.other === 0) retypeEligible++;\n }\n }\n return { declarators, dict, alwaysDict, kindUnstable, retypeEligible };\n }\n\n private collectRustDeclaredDictLocals(src: SourceFile): Map {\n const candidates: { declaration: VariableDeclaration, name: string, source: string, defaultNode: Node | undefined }[] = [];\n this.rustWalkScope(src, (node) => {\n if (isVariableDeclaration(node) && node.initializer !== undefined && node.name.kind === SyntaxKind.Identifier) {\n const info = this.rustDictInitializerInfo(node.initializer);\n if (info !== undefined) {\n candidates.push({ declaration: node, name: String(node.name.text), source: info.source, defaultNode: info.defaultNode });\n }\n }\n });\n candidates.sort((a, b) => a.declaration.getStart() - b.declaration.getStart());\n const table = new Map();\n for (const candidate of candidates) {\n const declaration = candidate.declaration;\n const start = declaration.getStart();\n const alwaysDict = this.rustDictProvenExpression(candidate.defaultNode, table, start);\n const scan = this.rustDictLocalWriteScan(declaration, candidate.name, table);\n const entries = table.get(candidate.name) ?? [];\n entries.push({ kind: RUST_DECLARED_DICT_LOCALS.DICT, name: candidate.name, source: candidate.source,\n alwaysDict, stable: scan.stable, uses: scan.uses, declaration, start });\n table.set(candidate.name, entries);\n }\n return table;\n }\n\n /** The Dict-proven initialiser shape of a declaration, or undefined. */\n private rustDictInitializerInfo(node: Node): { source: string, defaultNode: Node | undefined } | undefined {\n if (isObjectLiteralExpression(node)) {\n return { source: 'value_map', defaultNode: node };\n }\n if (isParenthesizedExpression(node) || isAsExpression(node) || isNonNullExpression(node)) {\n return this.rustDictInitializerInfo(node.expression);\n }\n if (!isCallExpression(node)) return undefined;\n const callee = this.rustSafeDictCallee(node);\n if (callee === undefined) return undefined;\n return { source: callee, defaultNode: node.arguments[RUST_DECLARED_DICT_LOCALS.SAFE_CALLEES[callee]] };\n }\n\n /** Printed `safe_dict*` callee name of `self.(..)`, or undefined. */\n private rustSafeDictCallee(node: CallExpression): string | undefined {\n const expression = node.expression;\n if (!isPropertyAccessExpression(expression) || expression.expression.kind !== SyntaxKind.ThisKeyword) {\n return undefined;\n }\n const printed = this.toSnakeCaseName(expression.name.text);\n return RUST_DECLARED_DICT_LOCALS.SAFE_CALLEES[printed] === undefined ? undefined : printed;\n }\n\n /** True when the expression can only be a Dict at run time: an object\n * literal, a `safe_dict*` call with a Dict-proven default, an element of a\n * one-element literal default, or an already-proven local. */\n private rustDictProvenExpression(node: Node | undefined, table: Map, useStart: number): boolean {\n if (node === undefined) return false;\n if (isObjectLiteralExpression(node)) return true;\n if (isParenthesizedExpression(node) || isAsExpression(node) || isNonNullExpression(node)) {\n return this.rustDictProvenExpression(node.expression, table, useStart);\n }\n if (isArrayLiteralExpression(node)) {\n return node.elements.length === 1 && this.rustDictProvenExpression(node.elements[0], table, useStart);\n }\n if (isIdentifier(node)) {\n const entries = table.get(node.text) ?? [];\n return entries.some((entry) => {\n if (!entry.alwaysDict || entry.start > useStart) return false;\n const scope = this.rustEnclosingFunction(entry.declaration);\n return scope === undefined || this.isNodeInsideNode(node, scope);\n });\n }\n const info = this.rustDictInitializerInfo(node);\n return info !== undefined && this.rustDictProvenExpression(info.defaultNode, table, useStart);\n }\n\n /** D2 scan over the enclosing function: an assignment of a non-Dict-proven\n * value would let the kind change. Every other write path the printer emits\n * for a local is kind-preserving (`x['k'] = v` -> `add_element_to_object`,\n * `x.push(v)` -> `append_to_array`, `delete x[k]` -> `remove`, nested\n * `x['a']['b'] = v` -> `get_value_mut`/`set_value`). A *different* binding of\n * the same name (sibling block, parameter) is not this local and does not\n * count; when the checker cannot separate the two bindings the scan stays\n * conservative and rejects. */\n private rustDictLocalWriteScan(declaration: VariableDeclaration, name: string, table: Map): { stable: boolean, uses: { elementAccess: number, mutHelper: number, other: number } } {\n const uses = { elementAccess: 0, mutHelper: 0, other: 0 };\n let stable = true;\n const scope = this.rustEnclosingFunction(declaration);\n if (scope === undefined) return { stable, uses };\n const declarationSymbol = this.rustSymbolOf(declaration.name as Identifier);\n // every event of the scan is rooted at a node spelled `name`: a re-binding, a use, or the\n // identifier inside an assignment target / for-of-in head (the target's own node is an ancestor)\n for (const node of this.rustScopeNameNodes(scope, name) as any[]) {\n if (node !== declaration && this.rustBindsName(node, name)) {\n const otherSymbol = this.rustSymbolOf((node as any).name);\n if (declarationSymbol === undefined || otherSymbol === undefined || otherSymbol === declarationSymbol) {\n stable = false; // same binding, or the checker cannot tell them apart\n break;\n }\n }\n if (node.kind !== SyntaxKind.Identifier) continue;\n if (node !== declaration.name && this.rustIdentifierRefersToDeclaration(node, declaration)) {\n this.rustDictLocalClassifyUse(node, uses);\n }\n let target: any = node;\n while (target.parent !== undefined && (isParenthesizedExpression(target.parent) || isArrayLiteralExpression(target.parent)\n || isShorthandPropertyAssignment(target.parent) || isObjectLiteralExpression(target.parent))) {\n target = target.parent;\n }\n const holder: any = target.parent;\n if (holder !== undefined && isBinaryExpression(holder) && holder.left === target\n && rustIsAssignmentOperator(holder.operatorToken.kind) &&\n this.rustAssignmentWritesWholeLocal(holder.left, declaration) &&\n !this.rustDictProvenExpression(holder.right, table, declaration.getStart())) {\n stable = false; // the local itself is reassigned a non-Dict value\n break;\n }\n // `for (x of list)` / `for (x in obj)` rebind an existing local.\n if (holder !== undefined && (isForOfStatement(holder) || isForInStatement(holder)) && holder.initializer === target &&\n this.rustAssignmentWritesWholeLocal(holder.initializer, declaration)) {\n stable = false;\n break;\n }\n }\n return { stable, uses };\n }\n\n /** True when this assignment target writes the local ITSELF (`x = ..`,\n * `[x, y] = ..`, `({x} = ..)`), as opposed to a write *into* it\n * (`x['k'] = ..`, kind-preserving). */\n private rustAssignmentWritesWholeLocal(left: Node, declaration: VariableDeclaration): boolean {\n if (isIdentifier(left)) {\n return this.rustIdentifierRefersToDeclaration(left, declaration);\n }\n if (isParenthesizedExpression(left)) {\n return this.rustAssignmentWritesWholeLocal(left.expression, declaration);\n }\n if (isArrayLiteralExpression(left)) {\n return left.elements.some((element) => this.rustAssignmentWritesWholeLocal(element, declaration));\n }\n if (isObjectLiteralExpression(left)) {\n return left.properties.some((property) => {\n if (!isShorthandPropertyAssignment(property)) return false;\n return this.rustAssignmentWritesWholeLocal(property.name, declaration);\n });\n }\n return false;\n }\n\n /** One use of a dict-proven local: an element-access chain (`x['k']`, also\n * the `x['k'] = v` write), a kind-preserving mutator (`x.push(v)`,\n * `delete x[k]`), or something that would need the local to still be a\n * `Value`. */\n private rustDictLocalClassifyUse(node: Node, uses: { elementAccess: number, mutHelper: number, other: number }): void {\n const isAccessOf = (p: any, c: Node) => p !== undefined &&\n (isElementAccessExpression(p) || isPropertyAccessExpression(p)) && p.expression === c;\n let current: any = node;\n const parent: any = current.parent;\n if (isAccessOf(parent, current)) {\n while (isAccessOf(current.parent, current)) current = current.parent;\n if (isElementAccessExpression(current)) uses.elementAccess++;\n else uses.other++; // `x.field` on a dict value\n } else if (parent !== undefined && (isDeleteExpression(parent) || (isCallExpression(parent) &&\n isPropertyAccessExpression(parent.expression) && parent.expression.expression === current &&\n parent.expression.name.text === 'push'))) {\n uses.mutHelper++;\n } else {\n uses.other++;\n }\n }\n\n\n printPropertyDeclaration(node, identation) {\n const name = this.printNode(node.name, 0);\n if (node.initializer) {\n const init = this.printNode(node.initializer, 0);\n return `${this.getIden(identation)}${name}: Value, // default: ${init}`;\n }\n return `${this.getIden(identation)}${name}: Value,`;\n }\n\n // Collect property declarations with their initializers for use in new()\n getStructFields(node): Array<{ name: string, init: string }> {\n return node.members.filter(m => m.kind === SyntaxKind.PropertyDeclaration).map(p => ({\n name: this.printNode(p.name, 0),\n init: p.initializer ? this.printNode(p.initializer, 0) : 'Value::Null',\n }));\n }\n\n printStruct(node, identation) {\n const fieldLines = this.getStructFields(node).map(f => `${this.getIden(identation + 1)}pub ${f.name}: Value,`).join('\\n');\n return `#[derive(Debug, Clone)]\\npub struct ${this.className} {\\n${fieldLines}\\n}`;\n }\n\n printNewMethod(node, identation) {\n const fieldInits = this.getStructFields(node).map(f => `${this.getIden(identation + 2)}${f.name}: ${f.init},`).join('\\n');\n return `\\nimpl ${this.className} {\\n${this.getIden(identation + 1)}pub fn new() -> Self {\\n${this.getIden(identation + 2)}${this.className} {\\n${fieldInits}\\n${this.getIden(identation + 2)}}\\n${this.getIden(identation + 1)}}\\n}`;\n }\n\n printClass(node, identation) {\n this.rustPrefetchClassTypes(node);\n this.className = node.name.text;\n\n // First pass: collect method signatures for optional param handling\n const methods = node.members.filter(m => m.kind === SyntaxKind.MethodDeclaration);\n methods.forEach((method: any) => {\n const requiredCount = method.parameters.filter(p => !p.initializer && !p.questionToken).length;\n if (requiredCount < method.parameters.length) {\n this.methodSignatures[method.name.text] = { requiredCount };\n }\n });\n\n const struct = this.printStruct(node, identation);\n const newMethod = this.printNewMethod(node, identation);\n const classMethods = methods.map(m => this.printMethodDeclaration(m, identation)).join('\\n\\n');\n return struct + newMethod + `\\nimpl ${this.className} {\\n${classMethods}\\n}`;\n }\n\n printMethodDefinition(node, identation) {\n const name = (node.name as any).text;\n const params = node.parameters;\n const requiredParams = params.filter(p => !p.initializer && !p.questionToken);\n let parsedArgs = ['&self', ...requiredParams.map(p => `${this.printNode(p.name, 0)}: Value`)].join(', ');\n if (requiredParams.length < params.length) {\n parsedArgs += ', optional_args: &[Value]';\n }\n const returnType = this.printRustFunctionType(node);\n const retStr = returnType ? ` -> ${returnType}` : '';\n return `${this.getIden(identation + 1)}pub fn ${name}(${parsedArgs})${retStr}`;\n }\n\n printRustFunctionType(node): string {\n // An internal `: Str` method that proves the conversion prints the\n // native `Option` (its returns run the conversion; callers\n // box back where a `Value` is still needed).\n if (this.rustNativeStrReturnKind(node) === 'str') {\n return 'Option';\n }\n try {\n const checker = this.getChecker();\n if (checker.getReturnTypeOfSignature(checker.getSignatureFromDeclaration(node)).flags === TypeFlags.Void) return '';\n } catch (e) {\n // ignore\n }\n return 'Value';\n }\n\n printMethodDeclaration(node, identation) {\n const methodDef = this.printMethodDefinition(node, identation);\n const params = node.parameters;\n const optionalParams = params.filter(p => p.initializer !== undefined || p.questionToken !== undefined);\n\n // Build optional param initializations\n const optionalInits = optionalParams.map((p, idx) => {\n const defaultVal = p.initializer ? this.printNode(p.initializer, 0) : 'Value::Null';\n return `${this.getIden(identation + 2)}let ${this.printNode(p.name, 0)} = get_arg(optional_args, ${idx}, ${defaultVal});\\n`;\n }).join('');\n\n const blockOpen = this.getBlockOpen(identation);\n const blockClose = this.getBlockClose(identation);\n const shadows = this.rustParamShadowLines(node, identation + 2);\n // D-27: a `handle*` method's `message: Dict` param gets a borrowed\n // `&IndexMap` shadow so its `safe_*` reads print natively.\n const shadowPlan = this.rustProHandlerShadowPlan(node, identation);\n const savedShadowParam = this.rustProHandlerShadowParam;\n if (shadowPlan !== undefined) this.rustProHandlerShadowParam = shadowPlan.param;\n const statements = node.body.statements.map(s => this.printNode(s, identation + 2)).join('\\n');\n this.rustProHandlerShadowParam = savedShadowParam;\n const body = blockOpen + optionalInits + shadows + (shadowPlan?.lines ?? '') + statements + blockClose;\n\n return this.printNodeCommentsIfAny(node, identation, methodDef + body);\n }\n\n printFunctionDefinition(node, identation) {\n const name = node.name?.text ?? '';\n const params = node.parameters;\n const parsedArgs = params.map(p => `${this.printNode(p.name, 0)}: Value`).join(', ');\n const returnType = this.printRustFunctionType(node);\n const retStr = returnType ? ` -> ${returnType}` : '';\n return `${this.getIden(identation)}fn ${name}(${parsedArgs})${retStr}`;\n }\n\n printFunctionDeclaration(node, identation) {\n if (isArrowFunction(node)) {\n const parameters = node.parameters.map(p => `${this.printNode(p.name, 0)}: Value`).join(', ');\n const body = this.printNode(node.body);\n return `|${parameters}| ${body}`;\n }\n const funcDef = this.printFunctionDefinition(node, identation);\n const funcBody = super.printFunctionBody(node, identation);\n return this.printNodeCommentsIfAny(node, identation, funcDef + funcBody);\n }\n\n printOutOfOrderCallExpressionIfAny(node, identation) {\n if (node.expression.kind !== SyntaxKind.PropertyAccessExpression) {\n return undefined;\n }\n\n const expr = node.expression;\n const args = node.arguments;\n\n // Handle this.method(...) calls with optional params\n if (expr.expression.kind === SyntaxKind.ThisKeyword) {\n const methodName = expr.name.text;\n const sig = this.methodSignatures[methodName];\n if (sig) {\n const printArgs = (list) => list.map(a => this.printNode(a, 0)).join(', ');\n const requiredArgs = printArgs(args.slice(0, sig.requiredCount));\n const reqPart = requiredArgs ? `${requiredArgs}, ` : '';\n return `self.${methodName}(${reqPart}&[${printArgs(args.slice(sig.requiredCount))}])`;\n }\n }\n\n return undefined;\n }\n\n printCallExpression(node, identation) {\n const expression = node.expression;\n\n // `this.safeString(, 'k')` — the read inlined against\n // the parameter shadow (D-25). Ahead of the optional-arg dispatch below,\n // which prints the call for any callee with optional parameters\n const shadowSafeRead = this.printShadowSafeReadCall(node);\n if (shadowSafeRead !== undefined) return shadowSafeRead;\n\n // D-27: `this.safe_*(message, \"k\")` on a shadowed WS-handler param —\n // the native `.get(\"k\")` match replaces the `safe_*_k` helper call.\n // Checked first: the out-of-order path would print the boxed call for\n const shadowRead = this.printProHandlerShadowRead(node);\n if (shadowRead !== undefined) return shadowRead;\n\n // Handle console.log specially\n if (expression.kind === SyntaxKind.PropertyAccessExpression) {\n const exprText = expression.getText().trim();\n if (exprText === 'console.log') {\n const args = node.arguments;\n if (args.length === 1) {\n const argText = this.printNode(args[0], 0).trim();\n return `println_val(${argText.startsWith('&') ? argText : `&${argText}`})`;\n }\n // Multiple args: print each\n const argParts = Array.from(args).map(a => {\n const t = this.printNode(a, 0).trim();\n return t.startsWith('Value::') || !t.startsWith('&') ? `&${t}` : t;\n }).join(', ');\n return `println_val(${argParts})`;\n }\n }\n\n const outOfOrder = this.printOutOfOrderCallExpressionIfAny(node, identation);\n if (outOfOrder) {\n return this.rustBoxNativeStrCallIfNeeded(node, outOfOrder);\n }\n\n // `parseInt`/`parseFloat` on a checker-proven string: native `str::parse`\n // instead of the runtime helper the ccxt post-pass would emit.\n const nativeParse = this.printNativeParseCall(node);\n if (nativeParse !== undefined) return nativeParse;\n\n // `this.json(v)`: `Exchange::json` is exactly the free `json_stringify`, which takes the value\n // by reference, so the call sites' `.clone()` is dropped. `self.` args keep the method:\n // the post-pass hoisting `self.(…)` out of `&mut self` args ignores a `&self.`.\n if (expression.kind === SyntaxKind.PropertyAccessExpression &&\n expression.expression.kind === SyntaxKind.ThisKeyword &&\n expression.name.text === 'json' && node.arguments.length === 1) {\n const argText = this.printNode(node.arguments[0], 0).trim();\n if (!argText.includes('self.')) {\n const withoutClone = argText.replace(/\\.clone\\(\\)$/, '');\n return `json_stringify(${this.ensureRef(withoutClone)})`;\n }\n }\n\n return this.rustBoxNativeStrCallIfNeeded(node, super.printCallExpression(node, identation));\n }\n\n printThisKeyword(node, identation) {\n return 'self';\n }\n\n // Native string args to the runtime error constructors, audited against\n // rust/ccxt-base/src/exchange_errors.rs: `msg` is `impl ToErrorMessage` (`&str`/`String`/`Value`\n // yield the same string) and `create_error`'s class name is `&str` (bare literal only).\n private static readonly RUST_ERROR_CONSTRUCTOR_ARGS: Record = {\n ...Object.fromEntries((\n 'exchange_error authentication_error permission_denied account_not_enabled account_suspended ' +\n 'arguments_required bad_request bad_symbol operation_rejected no_change margin_mode_already_set ' +\n 'market_closed manual_interaction_needed restricted_location insufficient_funds invalid_address ' +\n 'address_pending invalid_order order_not_found order_not_cached order_immediately_fillable ' +\n 'order_not_fillable duplicate_order_id contract_unavailable not_supported invalid_proxy_settings ' +\n 'exchange_closed_by_user operation_failed network_error d_do_s_protection rate_limit_exceeded ' +\n 'exchange_not_available on_maintenance invalid_nonce checksum_error request_timeout bad_response ' +\n 'null_response cancel_pending unsubscribe_error '\n ).trim().split(' ').map((n) => [n, ['msg']])),\n create_error: ['str', 'msg'],\n };\n\n // A string literal prints as the bare `\"lit\"` (`&str` — no String\n // allocation); a checker-proven string drops the redundant `Value::Str` box.\n printErrorConstructorArg(name: string, index: number, node, identation: number): string {\n const kind = (RustTranspiler as any).RUST_ERROR_CONSTRUCTOR_ARGS[name]?.[index];\n if (kind === undefined) {\n return this.printNode(node, identation);\n }\n if (isStringLiteral(node) && !(node.text in this.StringLiteralReplacements)) {\n return this.quotedStringLiteral(node.text);\n }\n const printed = this.printNode(node, identation).trim();\n if (kind !== 'msg' || !this.rustTypeIsString(node)) {\n return printed;\n }\n const payload = this.peelValueStrBox(printed)\n ?? this.peelValueStrBox(this.stripOuterParens(printed))\n ?? printed;\n // The `Value::Str(..)` box carries the `Cow` conversion; the error\n // ctors take an `impl ToErrorMessage` (String / &str / Value).\n return payload.replace(/\\.into\\(\\)$/, '');\n }\n\n // `BadRequest` → `bad_request`: the class-to-runtime-fn name the ccxt\n // post-pass applies to `X::new(..)` calls.\n rustErrorConstructorName(className: string): string {\n return this.toSnakeCaseName(className);\n }\n\n printNewExpression(node, identation) {\n let expression = node.expression?.text;\n expression = expression ? expression : this.printNode(node.expression);\n // Plain `new Error(msg)` becomes just the message Value so it can be\n // formatted by `panic!(\"{:?}\", ...)` in printThrowStatement.\n if (expression === 'Error') {\n const args = node.arguments.map(a => this.printNode(a, identation)).join(', ');\n return args || 'Value::Null';\n }\n // CCXT exception classes end in \"Error\", \"Required\", \"Found\", etc. and\n // are constructed via `new XError(msg)`. Route them through the runtime\n // error constructors (snake_case fn calls).\n const errorClassPattern = /^(?:[A-Z][a-zA-Z]*(?:Error|Required|Found|Failed|Rejected|Available|Exceeded|Limit|Pending|Funds|Address|Order|Cached|Fillable|Closed|Maintenance|Nonce|Timeout|Response|Settings|User|Supported|Implemented|Denied|Enabled|Suspended|Symbol|Change|Unavailable|Proxy|Set|Needed))$/;\n if (typeof expression === 'string' && errorClassPattern.test(expression)) {\n const snake = this.rustErrorConstructorName(expression);\n const args = node.arguments.map((a, index) => this.printErrorConstructorArg(snake, index, a, identation)).join(', ');\n return `crate::exchange_errors::${snake}(${args})`;\n }\n // Classes the ccxt post-pass routes to the same constructors — their\n // message argument is audited too; every other `X::new(..)` prints as\n // before.\n const args = typeof expression === 'string'\n ? node.arguments.map((a, index) => this.printErrorConstructorArg(this.rustErrorConstructorName(expression), index, a, identation)).join(', ')\n : node.arguments.map(a => this.printNode(a, identation)).join(', ');\n return `${expression}::new(${args})`;\n }\n\n printPropertyAccessExpression(node, identation) {\n const transformedProperty = this.transformPropertyAcessExpressionIfNeeded(node);\n if (transformedProperty) {\n return this.getIden(identation) + transformedProperty;\n }\n\n const rightSide = node.name.text;\n const rawExpression = node.getText().trim();\n\n if (this.FullPropertyAccessReplacements.hasOwnProperty(rawExpression)) { // eslint-disable-line\n return this.FullPropertyAccessReplacements[rawExpression]; // eslint-disable-line\n }\n\n const leftExpr = this.printNode(node.expression, 0);\n\n if (rightSide === 'length') {\n return this.printArrayLength(node, 0, leftExpr);\n }\n\n // Typed field on a checker-proven map local (`x.field`) reads natively;\n // the ccxt post-pass otherwise rewrites it to `get_value(&x, \"field\")`.\n if (isIdentifier(node.name) && this.isShallowValueReceiver(node.expression) &&\n this.isNativeAccessPositionSafe(node) && !this.isNativeWriteTargetBase(node)) {\n const native = this.printNativeMapAccess(leftExpr, node.expression, String(rightSide));\n if (native) return native;\n }\n\n return `${leftExpr}.${rightSide}`;\n }\n\n // ── native container access (`get_value(...)` -> `.get(...)`) ─────────────\n // When the TypeScript checker proves the receiver is a plain Map/List value\n // and the key is a literal, the runtime `get_value` key-marker / `__live_id`\n // paths cannot apply, so the access is emitted natively. Missing keys still\n // fall back to `Value::Null`.\n\n /** Methods whose Rust counterpart takes `&mut self`: a `self.` read in\n * their args must keep the `get_value(...)` shape the ccxt post-pass hoists. */\n static readonly MUT_SELF_METHODS = new Set([\n 'watch', 'watch_multiple', 'fetch_order_book_snapshot', 'un_watch',\n 'client', 'spawn', 'delay', 'fetch_tickers', 'extend', 'fetch',\n 'send_evm_transaction',\n ]);\n\n /** Global parse helpers that go native (`str::parse`) on a proven string arg,\n * keyed to the rust integer/float type their runtime helper parses into. */\n static readonly RUST_PARSE_HELPERS: Record = {\n parseInt: 'i64',\n parseFloat: 'f64',\n };\n\n toSnakeCaseName(name: string): string {\n return name.replace(/([A-Z]+)([A-Z][a-z])/g, '$1_$2').replace(/([a-z\\d])([A-Z])/g, '$1_$2').toLowerCase();\n }\n\n escapeRustStringLiteral(text: string): string {\n return String(text).replace(/\\\\/g, '\\\\\\\\').replace(/\"/g, '\\\\\"')\n .replace(/\\n/g, '\\\\n').replace(/\\r/g, '\\\\r').replace(/\\t/g, '\\\\t');\n }\n\n getCheckedTypeOf(node): Type | undefined {\n return this.checkerOrUndefined()?.getTypeAtLocation(node);\n }\n\n typeSymbolOf(type: Type): TsSymbol | undefined {\n if (type === undefined || type === null) return undefined;\n return type?.getSymbol() ?? type?.getAliasSymbol();\n }\n\n /** Types declared outside ts/src (Date, Response, Array, Promise, …) are never\n * backed by a plain `Value` map in the rust port. */\n isLibDeclaredType(type: Type): boolean {\n const declarations: any[] = symbolDeclarations(this.typeSymbolOf(type));\n return declarations.some(d => {\n const file = d?.getSourceFile?.()?.fileName ?? '';\n return /[\\\\/]lib\\.[^\\\\/]*\\.d\\.ts$/.test(file) || /[\\\\/]node_modules[\\\\/]typescript[\\\\/]/.test(file);\n });\n }\n\n isClassInstanceType(type: Type): boolean {\n if (type === undefined) return false;\n if (type.flags & (TypeFlags.Union | TypeFlags.Intersection)) {\n return (typeParts(type) ?? []).some((member) => this.isClassInstanceType(member));\n }\n const symbol: any = this.typeSymbolOf(type) ?? type.getAliasSymbol();\n if (symbol?.flags & SymbolFlags.Class) return true;\n const declarations: any[] = symbolDeclarations(symbol);\n return declarations.some(d => isClassDeclaration(d) || isClassExpression(d));\n }\n\n hasCallableShape(type: Type): boolean {\n const checker = this.getChecker();\n return checker.getSignaturesOfType(type, SignatureKind.Call).length > 0 ||\n checker.getSignaturesOfType(type, SignatureKind.Construct).length > 0;\n }\n\n isProvenListType(type: Type): boolean {\n if (!(type.flags & TypeFlags.Object)) return false;\n // Tuple references carry the Tuple flag on their target.\n const objectFlags = ((type as any).objectFlags ?? 0) | ((typeTarget(type)?.objectFlags) ?? 0);\n if (objectFlags & ObjectFlags.Tuple) return true;\n const name = (this.typeSymbolOf(type) as any)?.name;\n if (name === 'Array' || name === 'ReadonlyArray') return true;\n const targetName = (this.typeSymbolOf(typeTarget(type)) as any)?.name;\n return targetName === 'Array' || targetName === 'ReadonlyArray';\n }\n\n /** True only for object types the rust port represents as `Value::Dict`\n * (plain interfaces / index-signature / literal types — never classes). */\n isProvenMapType(type: Type): boolean {\n if (type === undefined) return false;\n if (type.flags & TypeFlags.Union) {\n // `Market` / `Currency` / `Order | undefined` style aliases: the runtime value is the dict (or\n // Null), so a map receiver is proven once every value-carrying member is a proven map. An\n // all-dict union without a nullish member stays on the strict path (a class may hide behind it).\n const parts: Type[] = typeParts(type) ?? [];\n const nullish = parts.filter((p) => this.rustTypeIsNullish(p));\n const valueParts = parts.filter((p) => !this.rustTypeIsNullish(p));\n return nullish.length > 0 && valueParts.length > 0 && valueParts.every((p) => this.isProvenMapType(p));\n }\n if (!(type.flags & TypeFlags.Object)) return false;\n if (this.isProvenListType(type)) return false;\n if (this.hasCallableShape(type)) return false;\n if (this.isClassInstanceType(type)) return false;\n if (this.isLibDeclaredType(type)) return false;\n // A named type or a string index signature; a bare `object` proves nothing.\n const hasStringIndex = this.getChecker().getIndexTypeOfType(type, IndexKind.String) !== undefined;\n return hasStringIndex || this.typeSymbolOf(type) !== undefined;\n }\n\n /** `undefined` / `null` / `void` / `never` — a union member that carries no\n * runtime value; `Value::Null` is the only box these ever get. */\n rustTypeIsNullish(type: Type): boolean {\n return type !== undefined && (type.flags & (TypeFlags.Undefined | TypeFlags.Null | TypeFlags.Void | TypeFlags.Never)) !== 0;\n }\n\n isProvenMapExpression(node: Node): boolean {\n return this.isProvenMapType(this.getCheckedTypeOf(node));\n }\n\n isProvenListExpression(node: Node): boolean {\n if (this.rustIsOrderBookSide(node)) return false;\n const type = this.getCheckedTypeOf(node);\n return type !== undefined && this.isProvenListType(type);\n }\n\n /** RHS of a generator destructure that provably holds a `Value::Arr`: the\n * checker-proven list, or a call whose callee returns an array literal on\n * every path. */\n rustNativeListSource(node: Node): boolean {\n return this.isProvenListExpression(node) || this.rustCallReturnsProvenList(node);\n }\n\n /** `x.split(sep)` → the runtime `split`, which yields an array on every\n * path (a non-string receiver gives the empty array, never a dict). */\n rustCallPrintsRuntimeSplit(node: Node): boolean {\n if (!isCallExpression(node) || node.arguments.length === 0) return false;\n const expression: any = node.expression;\n return isPropertyAccessExpression(expression) && expression.expression.kind !== SyntaxKind.ThisKeyword &&\n String(expression.name.text) === 'split';\n }\n\n /** True when the call's value is always a runtime array: the `handle*AndParams`\n * family and its exchange overrides declare `any`, so the checker cannot\n * prove the `[T, Dict]` tuple the body always builds — walk the resolved\n * callee instead. */\n rustCallReturnsProvenList(node: Node): boolean {\n if (!isCallExpression(node)) return false;\n return this.rustProvenListCall(node, new Set());\n }\n\n private rustProvenListCall(node: Node, stack: Set): boolean {\n if (this.rustCallPrintsRuntimeSplit(node)) return true;\n const declaration = this.rustCalleeDeclaration(node);\n return declaration !== undefined && this.rustFunctionReturnsArrayLiteral(declaration, stack);\n }\n\n /** Implementation of a `x.y(..)` call, when the checker resolves one. */\n private rustCalleeDeclaration(node: Node): Node | undefined {\n if (!isCallExpression(node)) return undefined;\n if (!isPropertyAccessExpression((node as any).expression)) return undefined;\n try {\n return signatureDeclaration((this.getChecker() as any).getResolvedSignature(node));\n } catch (e) {\n return undefined;\n }\n }\n\n /** Every `return` in the function's own body builds an array literal, or\n * delegates to a call that does. `throw` and fall-through (the printer's\n * `Value::Null`) read the same through both forms. */\n private rustFunctionReturnsArrayLiteral(declaration: Node, stack: Set): boolean {\n if (stack.has(declaration)) return false;\n const body: any = (declaration as any).body;\n if (body === undefined || !isBlock(body)) return false;\n stack.add(declaration);\n try {\n let returns = 0;\n let all = true;\n const visit = (node: Node) => {\n if (!all) return;\n if (node !== body && isFunctionLike(node)) return; // nested closure\n if (isReturnStatement(node)) {\n returns++;\n const expression: any = node.expression;\n all = expression !== undefined && (isArrayLiteralExpression(expression) ||\n (isCallExpression(expression) && this.rustProvenListCall(expression, stack)) ||\n (isParenthesizedExpression(expression) && isArrayLiteralExpression(expression.expression)));\n return;\n }\n node.forEachChild(visit);\n };\n body.forEachChild(visit);\n return all && returns > 0;\n } finally {\n stack.delete(declaration);\n }\n }\n\n /** Native list-index read of a generator temp (`__destr_tmp.as_array()…`). */\n printNativeListIndex(receiverText: string, index: number): string {\n return `${receiverText}.as_array().and_then(|__arr| __arr.get(${index})).cloned().unwrap_or(Value::Null)`;\n }\n\n /** Native read for one chain level, or undefined to keep `get_value`. */\n printNativeContainerAccess(receiverText: string, receiverNode: Node, keyNode: Node): string | undefined {\n // A shadowed parameter reads through the borrowed container.\n const shadow = this.rustParamShadowOf(receiverNode);\n if (shadow !== undefined) {\n const native = this.printShadowContainerRead(shadow, keyNode);\n if (native !== undefined) return native;\n }\n if (isStringLiteralLikeNode(keyNode)) {\n return this.printNativeMapAccess(receiverText, receiverNode, keyNode.text);\n }\n if (isNumericLiteral(keyNode)) {\n const index = Number(keyNode.text);\n if (!Number.isInteger(index) || index < 0) return undefined;\n if (!this.isProvenListExpression(receiverNode)) return undefined;\n return this.printNativeListIndex(receiverText, index);\n }\n const dictRead = this.printNativeDynamicMapAccess(receiverText, receiverNode, keyNode);\n if (dictRead !== undefined) return dictRead;\n // A non-literal index (the `for (let i = 0; …)` counter) into a\n // checker-proven list reads natively too.\n return this.printNativeDynamicListIndex(receiverText, receiverNode, keyNode);\n }\n\n /** `get_value(&X, &i)` for a checker-proven list `X` and a dynamic integer\n * index local `i`: the runtime's own array branch, spelled natively.\n * `get_value` reaches its array arm for an `Arr` receiver and its default\n * (`Value::Null`) otherwise, so the emitted match reproduces both — an\n * `Int` index by value (a negative or out-of-range index misses), a\n * numeric string by parse, anything else a miss. */\n printNativeDynamicListIndex(receiverText: string, receiverNode: Node, keyNode: Node): string | undefined {\n if (!this.isProvenListExpression(receiverNode)) return undefined;\n if (!this.isRustValueIndexKey(keyNode)) return undefined;\n // The ccxt `writeBackIndexedMutations` pass matches the `let x = get_value(&C, &K)` text to\n // write a mutated `x` back into `C[K]`; native text is invisible to it, so a bind the next\n // statement mutates keeps the helper.\n if (this.isWriteBackBindRead(keyNode.parent)) return undefined;\n const keyText = this.printNode(keyNode, 0).trim();\n // A text that already carries the post-pass `&` is not a place.\n if (!keyText || keyText.startsWith('&')) return undefined;\n return `${receiverText}.as_array().and_then(|__arr| match &${keyText} { Value::Int(__n) => __arr.get(*__n as usize), Value::Str(__s) => __s.parse::().ok().and_then(|__n| __arr.get(__n)), _ => None }).cloned().unwrap_or(Value::Null)`;\n }\n\n /** True when this read initialises a local that the very next statement in\n * the same block mutates (`x['k'] = v` -> `add_element_to_object(&mut x…)`,\n * `x.push(v)` -> `append_to_array(&mut x…)`). */\n isWriteBackBindRead(read: Node): boolean {\n const declaration: any = read === undefined ? undefined : read.parent;\n if (declaration === undefined || !isVariableDeclaration(declaration) || declaration.initializer !== read) return false;\n if (!isIdentifier(declaration.name)) return false;\n const name = String(declaration.name.text);\n let statement: any = declaration;\n while (statement !== undefined && !isStatement(statement)) statement = statement.parent;\n const siblings: any[] = statement?.parent?.statements ?? [];\n const at = siblings.indexOf(statement);\n if (at < 0 || at + 1 >= siblings.length) return false;\n return this.rustStatementMutatesLocal(siblings[at + 1], name);\n }\n\n /** A statement containing a write into a local (`x['k'] = v`, `x.k = v`,\n * `x.push(v)`). */\n rustStatementMutatesLocal(node: Node, name: string): boolean {\n let mutated = false;\n const visit = (n: Node) => {\n if (mutated) return;\n if ((isBinaryExpression(n) && rustIsAssignmentOperator(n.operatorToken.kind) && this.rootPlaceText(n.left) === name) ||\n (isCallExpression(n) && isPropertyAccessExpression(n.expression) &&\n n.expression.name.text === 'push' && this.rootPlaceText(n.expression.expression) === name)) {\n mutated = true;\n return;\n }\n n.forEachChild(visit);\n };\n node.forEachChild(visit);\n return mutated;\n }\n\n /** A dynamic index the printer emits as a `Value` number: a `let x = ` declaration of the same function (the C-style loop counter).\n * Any other shape keeps the helper — the printed local could be a native\n * `i64`/`f64`, which the `Value` match would not compile against. */\n isRustValueIndexKey(node: Node): boolean {\n const current: any = this.rustSkipWrappers(node);\n if (!isIdentifier(current)) return false;\n const type = this.getCheckedTypeOf(current);\n if (type === undefined || !(type.flags & (TypeFlags.Number | TypeFlags.NumberLiteral))) return false;\n const declaration: any = this.rustDeclarationOfIdentifier(current);\n if (declaration === undefined || !isVariableDeclaration(declaration) || declaration.initializer === undefined) return false;\n return isNumericLiteral(this.rustSkipWrappers(declaration.initializer));\n }\n\n /** Strips `( )`, `as T` and `!` wrappers. */\n rustSkipWrappers(node: any): any {\n while (node !== undefined && (isParenthesizedExpression(node) || isAsExpression(node) || isNonNullExpression(node))) node = node.expression;\n return node;\n }\n\n // Typed-parameter dict reads: a checker-proven plain dict param (`Dict`, `Dictionary`,\n // `Market`-style alias) holds the dict or `Value::Null`, so `get_value`'s marker routes cannot\n // fire and the read is `m.get(k)`. The key must be a proven `Str` box so `.as_str()` reproduces it.\n\n /** The parameter declaration behind a receiver when its *annotation* proves\n * a plain dict; undefined otherwise (no proof → keep the helper). */\n rustProvenDictParameter(node: Node): ParameterDeclaration | undefined {\n const declaration: any = this.rustDeclarationOfIdentifier(node);\n if (declaration === undefined || !isParameterDeclaration(declaration)) return undefined;\n if (declaration.type === undefined) return undefined;\n const type = this.getCheckedTypeOf(declaration.type);\n if (type === undefined || !this.isProvenMapType(type)) return undefined;\n // D2: a later write can change the kind.\n return this.rustLocalIsReassigned(declaration, String((declaration.name as any).text)) ? undefined : declaration;\n }\n\n /** `Str` (`string | undefined`) — the key box is `Value::Str` or Null. */\n rustKeyIsProvenString(node: Node): boolean {\n const type = this.getCheckedTypeOf(node);\n if (type === undefined) return false;\n const parts: Type[] = (type.flags & TypeFlags.Union) ? (typeParts(type) ?? []) : [type];\n let strings = 0;\n for (const part of parts) {\n if (part.flags & (TypeFlags.String | TypeFlags.StringLiteral)) {\n strings++;\n continue;\n }\n if (this.rustTypeIsNullish(part)) continue;\n return false;\n }\n return strings > 0;\n }\n\n /** The local/parameter proof of a dynamic-key map read: a parameter whose\n * annotation proves a plain dict (B-25), or any local whose checker type\n * proves a plain map and which nothing in the enclosing function\n * re-assigns (D2). Returns the proven declaration. */\n rustProvenDynamicMapReceiver(node: Node): Declaration | undefined {\n const parameter = this.rustProvenDictParameter(node);\n if (parameter !== undefined) return parameter;\n if (!isIdentifier(node)) return undefined;\n const declaration: any = this.rustDeclarationOfIdentifier(node);\n if (declaration === undefined || !isVariableDeclaration(declaration)) return undefined;\n if (declaration.initializer === undefined) return undefined;\n if (!this.isProvenMapExpression(node)) return undefined;\n if (this.rustLocalIsReassigned(declaration, String(node.text))) return undefined;\n return declaration;\n }\n\n /** The element-access read a key node belongs to (`x[k]`, `x[(k)]`). */\n rustElementReadOfKey(keyNode: Node): Node | undefined {\n let current: any = keyNode;\n while (current !== undefined && (isParenthesizedExpression(current) || isAsExpression(current) || isNonNullExpression(current))) {\n current = current.parent;\n }\n const parent: any = current === undefined ? undefined : current.parent;\n if (parent === undefined || !isElementAccessExpression(parent) || parent.argumentExpression !== current) return undefined;\n return parent;\n }\n\n /** `x[k]` where `x` is a proven-dict parameter and `k` a proven string. */\n printNativeDynamicMapAccess(receiverText: string, receiverNode: Node, keyNode: Node): string | undefined {\n if (this.rustProvenDynamicMapReceiver(receiverNode) === undefined) return undefined;\n if (!this.rustKeyIsProvenString(keyNode)) return undefined;\n // The ccxt `writeBackIndexedMutations` pass matches the\n // `let x = get_value(&C, &K)` text to write a mutated `x` back into\n // `C[K]`; the native text is invisible to it, so a bind the next\n const read = this.rustElementReadOfKey(keyNode);\n if (read !== undefined && this.isWriteBackBindRead(read)) return undefined;\n const keyText = this.printNode(keyNode, 0).trim();\n // A plain place keeps the borrow local; a call/temporary text does not.\n if (!/^[A-Za-z_][A-Za-z0-9_]*$/.test(keyText)) return undefined;\n if (this.rustNodeIsKeyUnsafePlace(keyText)) return undefined;\n return `${receiverText}.as_map().and_then(|__m| ${keyText}.as_str().and_then(|__k| __m.get(__k))).cloned().unwrap_or(Value::Null)`;\n }\n\n /** Keys `get_value` serves from the book store / cache bucket / live\n * snapshot instead of the dict itself — a dynamic read cannot prove the\n * key away, so a place named after one stays boxed. */\n rustNodeIsKeyUnsafePlace(keyText: string): boolean {\n return RustTranspiler.RUST_DICT_LOCAL_UNSAFE_KEYS.has(keyText);\n }\n\n // ── parameter shadows (`let x = x.as_map().unwrap_or(&__x_empty)`) ─────────\n //\n // A `Dict`/`List` parameter holds the container or `Value::Null`, and\n\n private paramShadowCache: { src: SourceFile, tables: Map> } | undefined;\n\n /** Functions whose shadow lines were actually emitted — a read converts\n * only inside one of those (an arrow body prints inline and gets none). */\n private paramShadowEmitted: { src: SourceFile, fns: Set } | undefined;\n\n private rustParamShadowEmittedSet(): Set {\n const src = this.getSrc();\n if (this.paramShadowEmitted === undefined || this.paramShadowEmitted.src !== src) {\n this.paramShadowEmitted = { src, fns: new Set() };\n }\n return this.paramShadowEmitted.fns;\n }\n\n rustParamShadowTables(): Map> {\n const src = this.getSrc();\n if (this.paramShadowCache === undefined || this.paramShadowCache.src !== src) {\n this.paramShadowCache = { src, tables: new Map() };\n }\n return this.paramShadowCache.tables;\n }\n\n /** Emitted shadow lines for a function, or '' when no parameter qualifies.\n * The caller must use this before printing the body statements (it both\n * registers the function as shadowed and computes the lines). */\n rustParamShadowLines(fn: Node, identation: number): string {\n const table = this.rustParamShadowTable(fn);\n if (table.size === 0) return '';\n const idn = this.getIden(identation);\n const lines: string[] = [];\n for (const shadow of table.values()) {\n const empty = `__${shadow.name}_empty`;\n if (this.rustFunctionDeclaresName(fn, empty)) continue;\n const map = shadow.kind === RUST_PARAM_SHADOWS.MAP;\n const accessor = map ? 'as_map' : 'as_array';\n lines.push(`${idn}let ${empty} = ${map ? 'indexmap::IndexMap::new()' : 'Vec::new()'};`);\n lines.push(`${idn}let ${shadow.name} = ${shadow.name}.${accessor}().unwrap_or(&${empty});`);\n }\n if (lines.length === 0) return '';\n this.rustParamShadowEmittedSet().add(fn);\n return lines.join('\\n') + '\\n';\n }\n\n private rustParamShadowTable(fn: Node): Map {\n const tables = this.rustParamShadowTables();\n let table = tables.get(fn);\n if (table === undefined) {\n try {\n table = this.collectRustParamShadows(fn);\n } catch (e) {\n table = new Map(); // no proof -> every read keeps its helper\n }\n tables.set(fn, table);\n }\n return table;\n }\n\n /** The shadow a read receiver resolves to, or undefined (no proof → helper). */\n rustParamShadowOf(node: Node): RustParamShadow | undefined {\n const current: any = this.rustSkipWrappers(node);\n if (current === undefined || !isIdentifier(current)) return undefined;\n const name = String(current.text);\n const declaration = this.rustDeclarationOfIdentifier(current);\n if (declaration === undefined || !isParameterDeclaration(declaration)) return undefined;\n const emitted = this.rustParamShadowEmittedSet();\n let scope: any = current.parent;\n while (scope !== undefined) {\n if (isFunctionLike(scope)) {\n const entry = emitted.has(scope) ? this.rustParamShadowTable(scope).get(name) : undefined;\n if (entry !== undefined && entry.declaration === declaration) return entry;\n }\n scope = scope.parent;\n }\n return undefined;\n }\n\n /** True when the enclosing function already binds this name somewhere. */\n private rustFunctionDeclaresName(fn: Node, name: string): boolean {\n let found = false;\n this.rustWalkScope(fn, (node: Node) => {\n if (isFunctionLike(node)) return RUST_WALK_SKIP; // nested closure: own scope\n if ((isVariableDeclaration(node) || isParameterDeclaration(node)) && isIdentifier(node.name) && node.name.text === name) {\n found = true;\n return RUST_WALK_STOP;\n }\n });\n return found;\n }\n\n private collectRustParamShadows(fn: Node): Map {\n const table = new Map();\n const parameters: any[] = (fn as any).parameters ?? [];\n const body: any = (fn as any).body;\n if (body === undefined) return table;\n for (const param of parameters) {\n if (!isParameterDeclaration(param) || !isIdentifier(param.name)) continue;\n const name = String(param.name.text);\n if (name === 'optional_args') continue;\n if (param.type === undefined) continue;\n const type = this.getCheckedTypeOf(param.type);\n if (type === undefined) continue;\n const kind: RustParamShadowKind | undefined = this.isProvenMapType(type) ? RUST_PARAM_SHADOWS.MAP :\n this.isProvenShadowListType(type) ? RUST_PARAM_SHADOWS.LIST : undefined;\n if (kind === undefined) continue;\n if (this.rustParameterIsClientHandle(param)) continue;\n if (this.rustParamShadowUseCensus(fn, param, kind) === undefined) continue;\n table.set(name, { kind, name, declaration: param });\n }\n return table;\n }\n\n /** A checker-proven array parameter type (`Vec` on the rust side);\n * tuples are excluded (their printed shape is not a plain `Vec`). */\n isProvenShadowListType(type: Type): boolean {\n if (type === undefined) return false;\n if (!(type.flags & TypeFlags.Object)) return false;\n const objectFlags = ((type as any).objectFlags ?? 0) | ((typeTarget(type)?.objectFlags) ?? 0);\n if (objectFlags & ObjectFlags.Tuple) return false;\n if (this.hasCallableShape(type)) return false;\n if (this.isClassInstanceType(type)) return false;\n const name = (this.typeSymbolOf(type) as any)?.name;\n if (name === 'Array' || name === 'ReadonlyArray') return true;\n const targetName = (this.typeSymbolOf(typeTarget(type)) as any)?.name;\n return targetName === 'Array' || targetName === 'ReadonlyArray';\n }\n\n /** Every reference to the parameter must be a printable read, and at least\n * one must exist; anything else (a write, a `Value` pass-through, a Null\n * comparison, a marker key) answers undefined and the parameter keeps its\n * box. */\n private rustParamShadowUseCensus(fn: Node, param: ParameterDeclaration, kind: RustParamShadowKind): { reads: number } | undefined {\n const name = String((param.name as Identifier).text);\n const paramSymbol = this.rustSymbolOf(param.name as Identifier);\n if (paramSymbol === undefined) return undefined;\n let reads = 0;\n let ok = true;\n const visit = (node: Node) => {\n if (!ok) return;\n if (isIdentifier(node) && node.text === name && node !== param.name) {\n if (this.rustSymbolOf(node) !== paramSymbol || !this.rustParamUseIsRead(node, kind)) {\n ok = false;\n return;\n }\n reads++;\n }\n node.forEachChild(visit);\n };\n (fn as any).body.forEachChild(visit);\n return ok && reads > 0 ? { reads } : undefined;\n }\n\n /** One reference of a shadow candidate: true only for a read the shadow can\n * print exactly (same proofs the emitted forms re-check). */\n private rustParamUseIsRead(id: Identifier, kind: RustParamShadowKind): boolean {\n const parent: any = id.parent;\n if (parent === undefined) return false;\n // `x[k]` — element read. Writes (`x[k] = v`, `x[k].push(..)`) and the\n // post-pass write-back binds keep the box.\n if (isElementAccessExpression(parent) && parent.expression === id) {\n if (this.isNativeWriteTargetBase(id)) return false;\n if (!this.isNativeAccessPositionSafe(id)) return false;\n if (this.isWriteBackBindRead(parent)) return false;\n return this.rustShadowKeyIsReadable(parent.argumentExpression, kind);\n }\n // `x.length` — array length read.\n if (isPropertyAccessExpression(parent) && parent.expression === id) {\n return kind === RUST_PARAM_SHADOWS.LIST && String(parent.name.text) === 'length';\n }\n // `'k' in x` / `k in x`.\n if (isBinaryExpression(parent) && parent.operatorToken.kind === SyntaxKind.InKeyword && parent.right === id) {\n if (kind !== RUST_PARAM_SHADOWS.MAP) return false;\n return this.rustShadowKeyIsReadable(parent.left, RUST_PARAM_SHADOWS.MAP);\n }\n // `this.safe(x, 'k'[, default])` — the read families the shadow\n // inlines (literal keys only). Any other call keeps the box.\n if (isCallExpression(parent) && kind === RUST_PARAM_SHADOWS.MAP) {\n if (this.rustShadowSafeCallee(parent) === undefined) return false;\n const args: NodeArray = parent.arguments;\n if (args[0] !== id || args.length < 2 || args.length > 3) return false;\n return this.rustShadowKeyIsLiteral(args[1]);\n }\n return false;\n }\n\n /** A key a shadow read can print: dicts take a bare string literal or a\n * proven-string place, lists a literal non-negative index; the `safe_*`\n * inline takes the literal key form only. Marker-route key names and keys\n * whose text needs escaping are excluded. */\n private rustShadowKeyIsReadable(key: any, kind: RustParamShadowKind): boolean {\n if (key === undefined) return false;\n if (kind === RUST_PARAM_SHADOWS.MAP) {\n if (isStringLiteralLikeNode(key)) return this.rustShadowKeyIsLiteral(key);\n if (isIdentifier(key)) {\n return this.rustKeyIsProvenString(key) && !this.rustNodeIsKeyUnsafePlace(String(key.text));\n }\n return false;\n }\n if (isNumericLiteral(key)) {\n const index = Number(key.text);\n return Number.isInteger(index) && index >= 0;\n }\n return false;\n }\n\n private rustShadowKeyIsLiteral(key: any): boolean {\n if (key === undefined || !isStringLiteralLikeNode(key)) return false;\n const text = String(key.text);\n return this.rustShadowKeyLiteral(text) && !this.rustNodeIsKeyUnsafePlace(text);\n }\n\n /** Keys whose text is safe to inline into a rust string literal. */\n private rustShadowKeyLiteral(text: string): boolean {\n return /^[A-Za-z0-9_./-]*$/.test(text) && text.length > 0;\n }\n\n /** `this.safeString`-style callee of a call, or undefined. */\n private rustShadowSafeCallee(node: CallExpression): string | undefined {\n const callee: any = (node as any).expression;\n if (callee === undefined || !isPropertyAccessExpression(callee)) return undefined;\n if (callee.expression.kind !== SyntaxKind.ThisKeyword) return undefined;\n const name = String(callee.name.text);\n return RUST_PARAM_SHADOWS.SAFE_READS.has(name) ? name : undefined;\n }\n\n /** `x['k']` / `x[i]` / `'k' in x` on a shadowed parameter: the native read,\n * or undefined to keep the helper (the census guarantees it never happens\n * for an emitted shadow). */\n printShadowContainerRead(shadow: RustParamShadow, keyNode: Node): string | undefined {\n const key: any = keyNode;\n if (shadow.kind === RUST_PARAM_SHADOWS.MAP) {\n const k = this.rustShadowMapKey(key);\n if (k === undefined) return undefined;\n return k.literal !== undefined ? `${shadow.name}.get(\"${k.literal}\").cloned().unwrap_or(Value::Null)`\n : `${k.place}.as_str().and_then(|__k| ${shadow.name}.get(__k)).cloned().unwrap_or(Value::Null)`;\n }\n if (isNumericLiteral(key)) {\n const index = Number(key.text);\n if (!Number.isInteger(index) || index < 0) return undefined;\n return `${shadow.name}.get(${index}).cloned().unwrap_or(Value::Null)`;\n }\n return undefined;\n }\n\n /** `'k' in x` on a shadowed dict parameter. */\n printShadowInOperator(shadow: RustParamShadow, keyNode: Node): string | undefined {\n if (shadow.kind !== RUST_PARAM_SHADOWS.MAP) return undefined;\n const k = this.rustShadowMapKey(keyNode);\n if (k === undefined) return undefined;\n return k.literal !== undefined ? `Value::Bool(${shadow.name}.contains_key(\"${k.literal}\"))`\n : `Value::Bool(${k.place}.as_str().map(|__k| ${shadow.name}.contains_key(__k)).unwrap_or(false))`;\n }\n\n /** A shadow dict key: an inlinable literal, or a proven-string plain place. */\n private rustShadowMapKey(key: any): { literal?: string, place?: string } | undefined {\n if (isStringLiteralLikeNode(key)) {\n const text = String(key.text);\n return this.rustShadowKeyLiteral(text) && !this.rustNodeIsKeyUnsafePlace(text) ? { literal: text } : undefined;\n }\n if (!isIdentifier(key) || !this.rustKeyIsProvenString(key) || this.rustNodeIsKeyUnsafePlace(String(key.text))) return undefined;\n const place = this.printNode(key, 0).trim();\n return /^[A-Za-z_][A-Za-z0-9_]*$/.test(place) ? { place } : undefined;\n }\n\n /** `x.length` on a shadowed list parameter — `get_array_length` natively. */\n printShadowLength(shadow: RustParamShadow): string | undefined {\n if (shadow.kind !== RUST_PARAM_SHADOWS.LIST) return undefined;\n return `Value::Int(${shadow.name}.len() as i64)`;\n }\n\n /** `this.safe(x, 'k'[, default])` on a shadowed dict parameter: the\n * runtime helper's exact semantics over `.get(..)`. */\n printShadowSafeReadCall(node: CallExpression): string | undefined {\n const callee = this.rustShadowSafeCallee(node);\n if (callee === undefined) return undefined;\n const args: any[] = (node as any).arguments ?? [];\n if (args.length < 2 || args.length > 3) return undefined;\n const shadow = this.rustParamShadowOf(args[0]);\n if (shadow === undefined || shadow.kind !== RUST_PARAM_SHADOWS.MAP) return undefined;\n const key: any = args[1];\n if (!isStringLiteralLikeNode(key)) return undefined;\n const text = String(key.text);\n if (!this.rustShadowKeyLiteral(text) || this.rustNodeIsKeyUnsafePlace(text)) return undefined;\n const fallback = args.length === 3 ? this.printNode(args[2], 0).trim() : 'Value::Null';\n const get = `${shadow.name}.get(\"${text}\")`;\n // The ccxt post-pass strips the `;` of a statement ending in `};`\n // (`[/\\};(\\s*\\n)/g, '}$1']`), so the match — like the printer's other\n // block-valued expressions — is parenthesized.\n const wrap = (text: string) => `(${text})`;\n switch (callee) {\n case 'safeValue':\n return wrap(`match ${get} { Some(__v) if !matches!(__v, Value::Null) && !matches!(__v, Value::Str(__s) if __s.is_empty()) => __v.clone(), _ => ${fallback} }`);\n case 'safeString':\n return wrap(`match ${get} { Some(Value::Str(__s)) if !__s.is_empty() => Value::Str(__s.clone()), Some(Value::Int(__n)) => Value::Str(__n.to_string().into()), Some(Value::Float(__f)) => Value::Str(__f.to_string().into()), _ => ${fallback} }`);\n case 'safeInteger':\n return wrap(`match ${get} { Some(Value::Int(__n)) => Value::Int(*__n), Some(Value::Float(__f)) => Value::Int(*__f as i64), Some(Value::Str(__s)) => match __s.parse::() { Ok(__n) => Value::Int(__n), Err(_) => match __s.parse::() { Ok(__f) if __f.is_finite() => Value::Int(__f as i64), _ => ${fallback} } }, _ => ${fallback} }`);\n case 'safeNumber':\n return wrap(`match ${get} { Some(Value::Float(__f)) => Value::Float(*__f), Some(Value::Int(__n)) => Value::Float(*__n as f64), Some(Value::Str(__s)) => match __s.parse::() { Ok(__n) => Value::Float(__n), Err(_) => ${fallback} }, _ => ${fallback} }`);\n case 'safeBool':\n return wrap(`match ${get} { Some(Value::Bool(__b)) => Value::Bool(*__b), _ => ${fallback} }`);\n case 'safeDict':\n return wrap(`match ${get} { Some(__v) if matches!(__v, Value::Dict(_)) => __v.clone(), _ => ${fallback} }`);\n case 'safeList':\n return wrap(`match ${get} { Some(__v) if matches!(__v, Value::Arr(_)) => __v.clone(), _ => ${fallback} }`);\n }\n return undefined;\n }\n\n // ── pro-tier WS handler `message` shadow (D-27) ───────────────────────────\n // `handle_x (client: Client, message: Dict)` is dispatched by NAME with\n // `Value` args, so the printed signature keeps `Value`; the annotation still\n\n /** The borrowed view bound by the shadow. */\n private static readonly PRO_HANDLER_SHADOW_NAME = '__pro_message';\n\n /** TS helper name -> emitted match kind. */\n private static readonly PRO_HANDLER_SHADOW_SAFE_READS: Record = {\n 'safeValue': 'value',\n 'safeString': 'string',\n 'safeInteger': 'integer',\n 'safeNumber': 'float',\n 'safeFloat': 'float',\n 'safeDict': 'dict',\n 'safeList': 'list',\n 'safeBool': 'bool',\n };\n\n /** The `message: Dict` parameter of a WS handler method (2nd param of a\n * `handle*` method), undefined when unproven or written (D2). */\n rustProHandlerMessageParam(node: Node): ParameterDeclaration | undefined {\n if (node === undefined || !isMethodDeclaration(node) || node.body === undefined) return undefined;\n const params: any[] = (node.parameters ?? []) as any;\n if (params.length < 2) return undefined;\n const methodName: any = node.name;\n if (methodName === undefined || !/^handle[A-Z]/.test(String(methodName.text ?? ''))) return undefined;\n const param: any = params[1];\n if (param === undefined || !isIdentifier(param.name) || param.type === undefined) return undefined;\n // The ws-handler shape `handle_x (client: Client, message: Dict)`: the\n // message is a required parameter and the first one is the Client\n // class handle. (Base helpers like `handleMarginModeAndParams\n if (param.initializer !== undefined || param.questionToken !== undefined) return undefined;\n const clientParam: any = params[0];\n if (clientParam === undefined || clientParam.type === undefined) return undefined;\n const clientType = this.getCheckedTypeOf(clientParam.type);\n if (clientType === undefined || !this.isClassInstanceType(clientType)) return undefined;\n const type = this.getCheckedTypeOf(param.type);\n if (type === undefined || !this.isProvenMapType(type)) return undefined;\n const name = String(param.name.text);\n return this.rustProHandlerParamIsWritten(param, name) ? undefined : param;\n }\n\n /** D2: a write rooted at the parameter (reassignment, element/property\n * write, a merge/splice onto it) can reshape the dict after the shadow is\n * taken — the shadow is skipped and every read keeps the helper. */\n rustProHandlerParamIsWritten(param: ParameterDeclaration, name: string): boolean {\n if (this.rustLocalIsReassigned(param, name)) return true;\n const scope = this.rustEnclosingFunction(param);\n if (scope === undefined) return true;\n if (this.rustStatementMutatesLocal(scope, name)) return true;\n const merging = ['deepExtend', 'extend', 'addElementToObject', 'remove'];\n let written = false;\n this.rustWalkScope(scope, (n: Node) => {\n if (isCallExpression(n) && n.arguments.length > 0 && isIdentifier(n.arguments[0]) && (n.arguments[0] as any).text === name) {\n const callee: any = n.expression;\n written = merging.includes(isPropertyAccessExpression(callee) ? String(callee.name?.text ?? '') :\n isIdentifier(callee) ? String(callee.text ?? '') : '');\n if (written) return RUST_WALK_STOP;\n }\n });\n return written;\n }\n\n /** Shadow plan for a handler: the parameter plus the two binding lines,\n * present only when some body read actually turns native (no dead shed). */\n rustProHandlerShadowPlan(node: Node, identation: number): { param: ParameterDeclaration, lines: string } | undefined {\n const param = this.rustProHandlerMessageParam(node);\n if (param === undefined) return undefined;\n // a D-25 parameter shadow already rebinds the name to the borrowed map; its reads are native\n if (this.rustParamShadowTable(node).has(String((param.name as any).text))) return undefined;\n const saved = this.rustProHandlerShadowParam;\n this.rustProHandlerShadowParam = param;\n let hasRead = false;\n const scope = this.rustEnclosingFunction(param);\n this.rustWalkScope(scope, (n: Node) => {\n if (isCallExpression(n) && this.printProHandlerShadowRead(n, true) !== undefined) {\n hasRead = true;\n return RUST_WALK_STOP;\n }\n });\n this.rustProHandlerShadowParam = saved;\n if (!hasRead) return undefined;\n const name = String((param.name as any).text);\n const view = RustTranspiler.PRO_HANDLER_SHADOW_NAME;\n const arc = `${view}_arc`;\n const map = 'indexmap::IndexMap';\n const ind = this.getIden(identation + 2);\n const lines =\n `${ind}let ${arc}: std::sync::Arc<${map}> = (match &${name} { Value::Dict(__d) => __d.clone(), _ => std::sync::Arc::new(indexmap::IndexMap::new()) });\\n` +\n `${ind}let ${view}: &${map} = &${arc};\\n`;\n return { param, lines };\n }\n\n /** The `safe_*` call on the shadowed parameter prints as a native\n * `.get(\"k\")` match, or undefined when the call is not one. In `probe`\n * mode the shape is checked without printing (the pre-scan must not print\n * a node twice). */\n printProHandlerShadowRead(node: Node, probe = false): string | undefined {\n const param = this.rustProHandlerShadowParam;\n if (param === undefined || node === undefined || !isCallExpression(node)) return undefined;\n const callee: any = node.expression;\n if (callee === undefined || !isPropertyAccessExpression(callee)) return undefined;\n if (callee.expression.kind !== SyntaxKind.ThisKeyword) return undefined;\n const kind = RustTranspiler.PRO_HANDLER_SHADOW_SAFE_READS[String(callee.name?.text ?? '')];\n if (kind === undefined) return undefined;\n const args: any[] = (node.arguments ?? []) as any;\n if (args.length < 2 || args.length > 3) return undefined;\n const receiver: any = args[0];\n if (receiver === undefined || receiver.kind !== SyntaxKind.Identifier) return undefined;\n if (this.rustDeclarationOfIdentifier(receiver) !== param) return undefined;\n const key: any = args[1];\n if (key === undefined || !isStringLiteral(key)) return undefined;\n const keyText = key.text;\n if (keyText === '' || RustTranspiler.RUST_DICT_LOCAL_UNSAFE_KEYS.has(keyText)) return undefined;\n if (args.length === 3 && !this.rustProHandlerShadowDefaultShape(args[2])) return undefined;\n if (probe) return 'native';\n const dflt = args.length === 3 ? this.rustProHandlerShadowDefault(args[2]) : 'Value::Null';\n if (dflt === undefined) return undefined;\n return this.rustProHandlerShadowReadText(kind, this.escapeRustStringLiteral(keyText), dflt);\n }\n\n /** A miss-arm default the match can hold: absent (`Value::Null`) or a\n * literal; a computed default keeps the helper (its Value is not\n * re-printable inside an arm without re-evaluating it twice). */\n rustProHandlerShadowDefaultShape(node: Node): boolean {\n return node.kind === SyntaxKind.StringLiteral || node.kind === SyntaxKind.NumericLiteral ||\n node.kind === SyntaxKind.TrueKeyword || node.kind === SyntaxKind.FalseKeyword ||\n node.kind === SyntaxKind.NullKeyword || node.kind === SyntaxKind.ArrayLiteralExpression ||\n node.kind === SyntaxKind.ObjectLiteralExpression ||\n (isIdentifier(node) && (node as any).text === 'undefined');\n }\n\n rustProHandlerShadowDefault(node: Node): string | undefined {\n if (!this.rustProHandlerShadowDefaultShape(node)) return undefined;\n const text = this.printNode(node, 0).trim();\n return text === '' ? undefined : text;\n }\n\n /** Exact native form of the runtime `_k` helper: same value kinds, same\n * empty-string-is-missing rule, same default (verified against\n * `exchange_stubs.rs`). `.cloned()` keeps the emitted line clone-free for\n * the ccxt clone-pruning passes; the parenthesised `match` keeps the\n * driver's `};` trailing-block replacement off the statement's `;`. */\n rustProHandlerShadowReadText(kind: string, key: string, dflt: string): string {\n const m = RustTranspiler.PRO_HANDLER_SHADOW_NAME;\n const at = `${m}.get(\"${key}\").cloned()`;\n switch (kind) {\n case 'value':\n return `(match ${at} { Some(Value::Str(__s)) if __s.is_empty() => ${dflt}, Some(__v) => __v, None => ${dflt} })`;\n case 'string':\n return `(match ${at} { Some(Value::Str(__s)) if !__s.is_empty() => Value::Str(__s), Some(Value::Int(__n)) => Value::Str(__n.to_string().into()), Some(Value::Float(__f)) => Value::Str(__f.to_string().into()), _ => ${dflt} })`;\n case 'integer':\n return `(match ${at} { Some(Value::Int(__n)) => Value::Int(__n), Some(Value::Float(__f)) => Value::Int(__f as i64), Some(Value::Str(__s)) if !__s.is_empty() => match __s.parse::() { Ok(__n) => Value::Int(__n), Err(_) => match __s.parse::() { Ok(__f) if __f.is_finite() => Value::Int(__f as i64), _ => ${dflt} } }, _ => ${dflt} })`;\n case 'float':\n return `(match ${at} { Some(Value::Float(__f)) => Value::Float(__f), Some(Value::Int(__n)) => Value::Float(__n as f64), Some(Value::Str(__s)) if !__s.is_empty() => match __s.parse::() { Ok(__f) => Value::Float(__f), Err(_) => ${dflt} }, _ => ${dflt} })`;\n case 'dict':\n return `(match ${at} { Some(__v) if matches!(__v, Value::Dict(_)) => __v, _ => ${dflt} })`;\n case 'list':\n return `(match ${at} { Some(__v) if matches!(__v, Value::Arr(_)) => __v, _ => ${dflt} })`;\n case 'bool':\n return `(match ${at} { Some(__v) if matches!(__v, Value::Bool(_)) => __v, _ => ${dflt} })`;\n }\n return undefined;\n }\n\n printNativeMapAccess(receiverText: string, receiverNode: Node, keyText: string): string | undefined {\n if (!this.isProvenMapExpression(receiverNode)) {\n // Declared-Dict locals read natively too (see the classifier below).\n if (!this.rustIsDeclaredDictLocal(receiverNode)) return undefined;\n if (RustTranspiler.RUST_DICT_LOCAL_UNSAFE_KEYS.has(keyText)) return undefined;\n if (keyText === '' || /^\\d+$/.test(keyText)) return undefined;\n }\n const key = this.escapeRustStringLiteral(keyText);\n return `${receiverText}.as_map().and_then(|__m| __m.get(\"${key}\")).cloned().unwrap_or(Value::Null)`;\n }\n\n // Declared-Dict locals: the checker types many dict-holding locals `any`, losing the proof\n // above, but the declaration still proves a plain dict (object literal, `getArg(.., {})` bag,\n // `this.safeDict`, `extend` onto those, or an element of a map-typed container) at every read.\n\n /** Keys `get_value(_k)` serves from the book store, a cache bucket or a\n * live `__live_id` snapshot instead of from the dict itself: those routes\n * are invisible to a plain map read, so they keep the helper. */\n static readonly RUST_DICT_LOCAL_UNSAFE_KEYS = new Set([\n 'timestamp', 'datetime', 'nonce', 'symbol', 'checksum', 'cache',\n 'hashmap', 'subscriptions', 'futures',\n ]);\n\n rustDeclarationOfIdentifier(node: Node): Declaration | undefined {\n if (!isIdentifier(node)) return undefined;\n try {\n const symbol: any = this.getChecker().getSymbolAtLocation(node);\n return symbolValueDeclaration(symbol);\n } catch (e) {\n return undefined;\n }\n }\n\n /** Initializer shapes that construct or return a plain dict. */\n rustDictProducingInitializer(node: Node | undefined, seen: Set): boolean {\n if (node === undefined || node === null || seen.has(node)) return false;\n seen.add(node);\n if (isObjectLiteralExpression(node)) return true;\n if (isParenthesizedExpression(node) || isAsExpression(node) ||\n isNonNullExpression(node) || isTypeAssertion(node)) {\n return this.rustDictProducingInitializer((node as any).expression, seen);\n }\n if (isIdentifier(node)) {\n const declaration: any = this.rustDeclarationOfIdentifier(node);\n if (declaration === undefined || !isVariableDeclaration(declaration)) return false;\n return this.rustDictProducingInitializer(declaration.initializer, seen);\n }\n if (isElementAccessExpression(node)) {\n // `this.markets[symbol]`: the container's declared element type is\n // what the rust port stores there.\n const containerType = this.getCheckedTypeOf((node as any).expression);\n if (containerType === undefined) return false;\n const elementType = this.getChecker().getIndexTypeOfType(containerType, IndexKind.String);\n return elementType !== undefined && this.isProvenMapType(elementType);\n }\n if (!isCallExpression(node)) return false;\n const callee: any = (node as any).expression;\n if (!isPropertyAccessExpression(callee) || callee.expression.kind !== SyntaxKind.ThisKeyword) {\n return false;\n }\n const name = String(callee.name.text);\n // Readers whose rust counterpart returns the stored dict itself.\n // `this.client(url)` returns the WS client handle Dict the runtime keeps\n // (`Map{url, subscriptions, futures}`), never a class instance.\n if (['safeDict', 'safeMarketStructure', 'market', 'currency', 'safeMarket', 'safeCurrency', 'client'].includes(name)) return true;\n // `extend`/`deepExtend` merge onto their first argument.\n if (name === 'extend' || name === 'deepExtend') {\n return this.rustDictProducingInitializer((node as any).arguments[0], seen);\n }\n return false;\n }\n\n /** D2: the proof holds only while nothing re-assigns the local. */\n rustLocalIsReassigned(declaration: Declaration, name: string): boolean {\n let scope: Node | undefined = declaration;\n while (scope !== undefined && !isFunctionLike(scope) && !isSourceFile(scope)) scope = scope.parent;\n if (scope === undefined) return true;\n // only an identifier spelled `name` can be the assignment's left side\n return this.rustScopeNameNodes(scope, name).some((id: any) => {\n const node: any = id.parent;\n return id.kind === SyntaxKind.Identifier && node !== undefined && isBinaryExpression(node) && node.left === id\n && node.operatorToken.kind >= SyntaxKind.FirstAssignment && node.operatorToken.kind <= SyntaxKind.LastAssignment;\n });\n }\n\n /** True when the receiver is a local declared as (or provably holding) a\n * plain dict — `get_value(_k)` and this read agree on every key the\n * runtime does not route elsewhere. */\n rustIsDeclaredDictLocal(node: Node): boolean {\n const declaration: any = this.rustDeclarationOfIdentifier(node);\n if (declaration === undefined) return false;\n const name = declaration.name?.text;\n if (typeof name !== 'string') return false;\n if (isParameterDeclaration(declaration)) {\n // A `Client`-typed parameter is the WS handle passed to `handle_message`/`handle*`\n // (`ws_client::client_value`): a `Value::Dict{url, subscriptions, futures}` in the port, not\n // the TS class. Its fields are plain map reads.\n if (!this.rustParameterIsClientHandle(declaration) && !this.rustDictProducingInitializer(declaration.initializer, new Set())) return false;\n } else if (isVariableDeclaration(declaration)) {\n if (!this.rustDictProducingInitializer(declaration.initializer, new Set())) return false;\n } else {\n return false;\n }\n return !this.rustLocalIsReassigned(declaration, name);\n }\n\n /** A parameter declared as the ws `Client` class (or a union with it). The\n * class is the default export of `ts/src/base/ws/Client.ts`, so its type\n * symbol is named `default`; the declaration itself carries the name. */\n rustParameterIsClientHandle(declaration: ParameterDeclaration): boolean {\n const named = (type: Type | undefined): boolean => {\n if (type === undefined) return false;\n const symbol: any = this.typeSymbolOf(type);\n const declarations: any[] = symbolDeclarations(symbol);\n return declarations.some((d) => {\n if (!isClassDeclaration(d) || d.name === undefined || d.name.text !== 'Client') return false;\n const file = String(d.getSourceFile().fileName).replace(/\\\\/g, '/');\n return file.endsWith('/ws/Client.ts') || file.endsWith('/ws/Client.d.ts');\n });\n };\n const type = this.getCheckedTypeOf(declaration.name);\n if (named(type)) return true;\n return (typeParts(type) ?? []).some((member: Type) => named(member));\n }\n\n /** Constant string argument of `parseInt`/`parseFloat` folded the way rust's\n * `str::parse` would; undefined when the fold is not obviously exact. */\n foldParsedStringLiteral(name: string, text: string): string | undefined {\n const t = text.trim();\n if (name === 'parseInt') {\n if (!/^[+-]?[0-9]+$/.test(t)) return undefined;\n const value = BigInt(t.replace(/^\\+/, '') || '0');\n if (value < -9223372036854775808n || value > 9223372036854775807n) return undefined;\n return `Value::Int(${value.toString()})`;\n }\n if (!/^[+-]?[0-9]+(?:\\.[0-9]+)?$/.test(t)) return undefined;\n const value = Number(t);\n // `String(value)` must re-read as a rust float literal holding the same f64;\n // `-0` prints as `0`, which would drop the sign the runtime keeps.\n if (!Number.isFinite(value) || Object.is(value, -0)) return undefined;\n if (!/^-?[0-9]+(?:\\.[0-9]+)?$/.test(String(value))) return undefined;\n return `Value::Float(${String(value)})`;\n }\n\n /** `parseInt(x)` / `parseFloat(x)` with a single checker-proven string argument\n * become the runtime helper's own match with native `str::parse`; every other\n * argument shape keeps the helper call the ccxt post-pass rewrites. */\n printNativeParseCall(node: CallExpression): string | undefined {\n const callee = node.expression;\n if (!isIdentifier(callee)) return undefined;\n const name = String(callee.text);\n const helper = RustTranspiler.RUST_PARSE_HELPERS[name];\n if (helper === undefined) return undefined;\n if (node.arguments.length !== 1) return undefined; // radix / unknown arity\n const arg = node.arguments[0];\n const type = this.getCheckedTypeOf(arg);\n if (type === undefined || !this.isStringType(type.flags)) return undefined;\n if (isStringLiteralLikeNode(arg)) {\n const folded = this.foldParsedStringLiteral(name, arg.text);\n if (folded !== undefined) return folded;\n }\n const argText = this.printNode(arg, 0).trim();\n // The post-pass adds the `&`; a text that already carries one is not a place.\n if (!argText || argText.startsWith('&')) return undefined;\n if (helper === 'i64') {\n return `(match &${argText} { Value::Str(__parse_s) => __parse_s.trim().parse::().map(Value::Int).unwrap_or(Value::Null), Value::Int(__parse_n) => Value::Int(*__parse_n), Value::Float(__parse_f) => Value::Int(*__parse_f as i64), _ => Value::Null })`;\n }\n return `(match &${argText} { Value::Str(__parse_s) => __parse_s.trim().parse::().map(Value::Float).unwrap_or(Value::Null), Value::Float(__parse_f) => Value::Float(*__parse_f), Value::Int(__parse_n) => Value::Float(*__parse_n as f64), _ => Value::Null })`;\n }\n\n isNodeInsideNode(node: Node, container: Node): boolean {\n return node.pos >= container.pos && node.end <= container.end;\n }\n\n /** Root place of an access chain (`x` for `x['a']['b']`, `this.balance` for\n * `this.balance['usdt']`), or undefined for a temporary. */\n rootPlaceText(node: Node): string | undefined {\n let current: any = node;\n while (isPropertyAccessExpression(current) || isElementAccessExpression(current) || isParenthesizedExpression(current)) {\n if (!isParenthesizedExpression(current) && current.expression.kind === SyntaxKind.ThisKeyword) return current.getText().trim();\n current = current.expression;\n }\n return current && (isIdentifier(current) || current.kind === SyntaxKind.ThisKeyword) ? current.getText().trim() : undefined;\n }\n\n /** The ccxt post-passes hoist `get_value(...)` reads out of `&mut` calls by\n * matching their text; the native form is invisible to them, so it is only\n * emitted where no such hoist is needed. */\n isNativeAccessPositionSafe(node: Node): boolean {\n const parent = node.parent;\n // `x['k'].push(...)` / `x['k'](...)`: the post-pass rewrites the target.\n if (parent && (isPropertyAccessExpression(parent) || isCallExpression(parent)) && parent.expression === node) return false;\n const root = this.rootPlaceText(node);\n for (let current: any = node.parent; current; current = current.parent) {\n if (isStatement(current) || isSourceFile(current) || isFunctionLike(current)) break;\n if (isBinaryExpression(current) && this.isNodeInsideNode(node, current.right)) {\n const op = current.operatorToken.kind;\n const isAssign = op === SyntaxKind.EqualsToken || (op >= SyntaxKind.PlusEqualsToken && op <= SyntaxKind.CaretEqualsToken);\n if (isAssign && root !== undefined && this.rootPlaceText(current.left) === root) return false;\n }\n if (isCallExpression(current) && isPropertyAccessExpression(current.expression) &&\n this.isNodeInsideNode(node, current) && current.arguments.some(a => this.isNodeInsideNode(node, a))) {\n const callee = current.expression;\n // Same-place receiver (`x.push(x[0])`) is rewritten to `&mut x` args.\n if (root !== undefined && this.rootPlaceText(callee.expression) === root) return false;\n // `&mut self.(...)` arg lists are hoisted by the ccxt\n // pass because a `&self` reborrow conflicts with the outer `&mut self`.\n if (callee.expression.kind === SyntaxKind.ThisKeyword &&\n RustTranspiler.MUT_SELF_METHODS.has(this.toSnakeCaseName(String(callee.name.text))) &&\n (root === undefined || root === 'this' || root.startsWith('this.'))) return false;\n }\n }\n return true;\n }\n\n /** Receiver shapes whose printed text is a single `Value` place (`x`, `this.x`). */\n isShallowValueReceiver(node: Node): boolean {\n return isIdentifier(node) || (isPropertyAccessExpression(node) && node.expression.kind === SyntaxKind.ThisKeyword);\n }\n\n /** True when this read is the receiver of an element-access chain that is\n * written (`x['a'] = v`, `x['a']['b'] = v`, `delete x['a']['b']`), or a\n * property write itself (`x.k = v`, `delete x.k`). The ccxt write passes\n * match the `get_value(&…)` / `x.k` text to reach the real container, so a\n * native read would write into a discarded clone. */\n isNativeWriteTargetBase(node: Node): boolean {\n const isWrite = (n: any, target: any) => n !== undefined && (isDeleteExpression(n) ||\n (isBinaryExpression(n) && n.left === target && rustIsAssignmentOperator(n.operatorToken.kind)));\n const parent: any = node.parent;\n if (isWrite(parent, node)) return true;\n if (parent === undefined || !isElementAccessExpression(parent) || parent.expression !== node) return false;\n let current: any = parent;\n while (current.parent !== undefined && isElementAccessExpression(current.parent) && current.parent.expression === current) current = current.parent;\n return isWrite(current.parent, current);\n }\n\n transformPropertyAcessExpressionIfNeeded(node) {\n // Printed here (as before) so the receiver's loop-flag numbering in the\n // generated file matches the pinned baseline for non-length accesses.\n const leftExpr = this.printNode(node.expression, 0);\n if (node.name.text !== 'length') return undefined;\n const shadow = this.rustParamShadowOf(node.expression);\n const native = shadow !== undefined ? this.printShadowLength(shadow) : undefined;\n return native ?? this.printArrayLength(node, 0, leftExpr);\n }\n\n // `crate::value::get_value_k` is `get_value` for a `&str` key — the same\n // dict lookup minus the per-read `Value::Str` allocation. Three literal-key\n // families reach branches only `get_value` has (numeric cache/side indices,\n // the cache `hashmap` bucket, live client `subscriptions`/`futures`) and a\n // `this`/class receiver is not a `Value`, so those keep `get_value`.\n staticKeyLookup(node, container): string | undefined {\n if (!isStringLiteral(node)) return undefined;\n // Test sources keep the allocating form: the test-only post-passes\n // pattern-match `get_value(&…, &Value::Str(…))` call sites.\n const source = (node as any).getSourceFile ? (node as any).getSourceFile().fileName : '';\n if (typeof source === 'string' && /\\/test\\//.test(source)) return undefined;\n if (container.kind === SyntaxKind.ThisKeyword) return undefined;\n const text = node.text;\n if (text === '' || text in this.StringLiteralReplacements) return undefined;\n if (/^\\d+$/.test(text) || text === 'hashmap' || text === 'subscriptions' || text === 'futures') return undefined;\n const checker: any = this.checkerOrUndefined();\n if (checker === undefined) return undefined;\n const type = checker.getTypeAtLocation(container);\n if (type !== undefined && ((type as any).objectFlags & ObjectFlags.Class)) return undefined;\n return this.quotedStringLiteral(text);\n }\n\n printElementAccessExpression(node, identation) {\n const special = this.printElementAccessExpressionExceptionIfAny(node);\n if (special) return special;\n // `obj['x'] = v` is rewritten to `crate::set_value(...)` by a pass that\n // matches the `get_value(&obj, &key)` target shape, so targets keep it.\n // `d['a'].push(v)` lowers to `append_to_array(&mut , v)` and the\n // ccxt pass giving it write-through semantics (`append_to_object_array`)\n // matches `append_to_array(&mut get_value(&` literally, so call/property\n // targets keep the allocating form too: `get_value_k` is invisible to\n // that pass and the append would land on a discarded COW clone.\n const parent = node.parent;\n const keepGetValue = parent !== undefined && (\n (isBinaryExpression(parent) && parent.left === node &&\n parent.operatorToken.kind >= SyntaxKind.FirstAssignment && parent.operatorToken.kind <= SyntaxKind.LastAssignment) ||\n ((isPropertyAccessExpression(parent) || isCallExpression(parent)) && parent.expression === node));\n const chain: any[] = [];\n let current: any = node;\n while (isElementAccessExpression(current)) {\n chain.unshift(current);\n current = current.expression;\n }\n // One checker proof per chain: the emitted text replaces `get_value` only\n // when it is legal at the position the whole chain occupies.\n const nativeAllowed = this.isNativeAccessPositionSafe(node) && !this.isNativeWriteTargetBase(node);\n let acc = this.printNode(current, 0);\n for (const { expression: receiver, argumentExpression: key } of chain) {\n const native = nativeAllowed ? this.printNativeContainerAccess(acc, receiver, key) : undefined;\n const staticKey = native === undefined && !keepGetValue ? this.staticKeyLookup(key, receiver) : undefined;\n acc = native ?? (staticKey !== undefined\n ? `crate::value::get_value_k(&${acc}, ${staticKey})`\n : `get_value(&${acc}, &${this.printNode(key, 0)})`);\n }\n return acc;\n }\n\n printForStatement(node, identation) {\n const idn = this.getIden(identation);\n const idn1 = this.getIden(identation + 1);\n const initStr = node.initializer ? this.printNode(node.initializer, identation + 1) + ';\\n' : '';\n const condStr = node.condition ? this.printComparisonInBooleanContext(node.condition, 0).trim() : 'true';\n const incrStr = node.incrementor ? this.printNode(node.incrementor, 0) : '';\n const statements = node.statement.statements.map(s => this.printNode(s, identation + 1)).join('\\n');\n const body = `{\\n${statements}\\n${idn}}`;\n // A C-style `for` becomes a Rust `while`. The increment must run on\n // every iteration *including* one ended by `continue`, so it is folded\n // into the condition (guarded by a first-iteration flag); at the end of\n // the body a `continue` would skip it and spin the loop forever.\n if (incrStr !== '') {\n const flag = `__for_first_${this.forLoopCounter++}`;\n const cond = `{ if !${flag} { ${incrStr}; } ${flag} = false; ${condStr} }`;\n return `${idn}{\\n${idn1}${initStr}${idn1}let mut ${flag}: bool = true;\\n${idn1}while ${cond} ${body}\\n${idn}}`;\n }\n return `${idn}{\\n${idn1}${initStr}${idn1}while ${condStr} ${body}\\n${idn}}`;\n }\n\n private static readonly COMPARISON_OPS = new Set([\n SyntaxKind.EqualsEqualsToken, SyntaxKind.EqualsEqualsEqualsToken, SyntaxKind.ExclamationEqualsToken, SyntaxKind.ExclamationEqualsEqualsToken,\n SyntaxKind.LessThanToken, SyntaxKind.LessThanEqualsToken, SyntaxKind.GreaterThanToken, SyntaxKind.GreaterThanEqualsToken,\n ]);\n\n // Comparison helpers that can be replaced by a native numeric operator.\n private static readonly NATIVE_COMPARISON_OPERATORS: Record = {\n [SyntaxKind.LessThanToken]: '<', [SyntaxKind.LessThanEqualsToken]: '<=',\n [SyntaxKind.GreaterThanToken]: '>', [SyntaxKind.GreaterThanEqualsToken]: '>=',\n };\n\n isEqualityOp(op): boolean {\n return op === SyntaxKind.EqualsEqualsToken || op === SyntaxKind.EqualsEqualsEqualsToken ||\n op === SyntaxKind.ExclamationEqualsToken || op === SyntaxKind.ExclamationEqualsEqualsToken;\n }\n\n isLogicalOp(op): boolean {\n return op === SyntaxKind.AmpersandAmpersandToken || op === SyntaxKind.BarBarToken;\n }\n\n printCondition(node, identation) {\n const idn = this.getIden(identation);\n if (node.kind === SyntaxKind.BinaryExpression) {\n const opKind = node.operatorToken.kind;\n // Comparison binary expressions already return bool — skip is_true() wrapping\n if (RustTranspiler.COMPARISON_OPS.has(opKind)) return this.printComparisonInBooleanContext(node, identation);\n // Logical &&/|| operands are individually is_true()-wrapped in\n // printBinaryExpression, so the whole expression is already bool —\n // unless one carries a native compare, which needs no is_true().\n if (this.isLogicalOp(opKind)) {\n const native = this.hasNativeComparisonOperand(node.left) || this.hasNativeComparisonOperand(node.right);\n return idn + (native ? this.printLogicalInBooleanContext(node) : this.printNode(node, 0));\n }\n }\n // PrefixUnary ! — delegate to avoid double-wrapping\n if (node.kind === SyntaxKind.PrefixUnaryExpression && node.operator === SyntaxKind.ExclamationToken) {\n return this.printPrefixUnaryExpression(node, identation);\n }\n // A call to a hand-written `-> bool` fn is already a Rust bool.\n if (this.rustCallPrintsBool(node)) return idn + this.printNode(node, 0);\n // Checker-proved boolean Value (safe_bool / get_value): native matches!.\n const nativeTruthiness = this.printNativeTruthiness(node);\n if (nativeTruthiness !== undefined) return idn + nativeTruthiness;\n // B-26: an operand whose printer emission is already a Rust `bool`.\n const nativeCondition = this.printNativeParenthesizedCondition(node);\n if (nativeCondition !== undefined && this.rustConditionBoolSlot(node)) return idn + nativeCondition;\n const expression = this.printNode(node, 0);\n const peeled = this.peelValueBoolBox(this.stripOuterParens(expression));\n if (peeled !== undefined && this.rustConditionBoolSlot(node) && !this.printedBoolHelperCall(this.stripOuterParens(peeled))) {\n return `${idn}(${peeled})`;\n }\n return `${idn}is_true(&${this.printTruthyArgument(expression)})`;\n }\n\n // B-26: `is_true(&(…)` on an operand the printer already emits as a native Rust `bool` (payload\n // compares, `matches!` predicates, `&&`/`||` of those) is the identity (`IsTruthy for bool`);\n // native text has no helper token, so it is emitted only in a bool slot (`isBareBoolEmissionSafe`).\n\n /** Bool-slot text of a parenthesised native comparison/predicate, else undefined. */\n printNativeParenthesizedCondition(node): string | undefined {\n const inner = this.unwrapParens(node);\n if (inner === undefined || inner === node || inner.kind !== SyntaxKind.BinaryExpression) return undefined;\n const op = inner.operatorToken.kind;\n if (this.isLogicalOp(op)) {\n // Every operand of a logical already prints a bool; keep the wrapper\n // when they are all helper-led (the post-passes key on that token).\n if (!this.hasNativeComparisonOperand(inner.left) && !this.hasNativeComparisonOperand(inner.right)) return undefined;\n return `(${this.printLogicalInBooleanContext(inner)})`;\n }\n if (!RustTranspiler.COMPARISON_OPS.has(op)) return undefined;\n let native: string | undefined;\n if (inner.left.kind === SyntaxKind.TypeOfExpression) {\n // `typeof x === 'string'` prints the same native predicate as `x in obj`.\n native = this.nativeValuePredicateText(inner.right.text, inner.left.expression, this.printNode(inner.left.expression, 0));\n const isDiff = op === SyntaxKind.ExclamationEqualsEqualsToken || op === SyntaxKind.ExclamationEqualsToken;\n if (native !== undefined && isDiff) native = '!' + native;\n } else {\n native = this.isEqualityOp(op) ? this.nativeEqualityText(inner) : this.printNativeOrderedComparison(inner, op, inner.left, inner.right);\n }\n return native === undefined ? undefined : `(${native})`;\n }\n\n // The argument of an `is_true(&…)` sink with the printer's `Value::Bool(…)` box peeled when it\n // spans the whole argument: `IsTruthy for Value` unboxes `Value::Bool(b)` to `b`, so the bool\n // prints bare. `is_true` is the one sink taking a native `bool`; the marker stays for post-passes.\n printTruthyArgument(expression: string): string {\n const inner = this.peelValueBoolBox(this.stripOuterParens(expression));\n // parens kept: `is_true(&a == b)` would re-associate the argument.\n return inner === undefined ? expression : `(${inner})`;\n }\n\n // `assert(, )` — the test harness' `assert` takes a\n // native `bool` (`impl Truthy for bool`), so a whole-argument\n // `Value::Bool(…)` box prints bare there too. The message list is untouched.\n printAssertCall(node, identation, parsedArgs) {\n const [first, rest] = this.splitFirstArgument(parsedArgs);\n const inner = this.peelValueBoolBox(this.stripOuterParens(first));\n return inner === undefined ? `assert(${parsedArgs})` : `assert((${inner})${rest})`;\n }\n\n // Splits an already-printed argument list after its first top-level `,`.\n splitFirstArgument(parsedArgs: string): [string, string] {\n let depth = 0;\n for (let i = 0; i < parsedArgs.length; i++) {\n const char = parsedArgs[i];\n if (char === '\"') {\n for (i++; i < parsedArgs.length && parsedArgs[i] !== '\"'; i++) {\n if (parsedArgs[i] === '\\\\') i++;\n }\n } else if ('([{'.includes(char)) depth++;\n else if (')]}'.includes(char)) depth--;\n else if (char === ',' && depth === 0) return [parsedArgs.slice(0, i), parsedArgs.slice(i)];\n }\n return [parsedArgs, ''];\n }\n\n // Bool-position text for a comparison: the native payload compare (already\n // bool) when the checker proves it, the is_equal() helper otherwise.\n printComparisonInBooleanContext(node, identation) {\n const native = this.nativeEqualityText(node);\n return this.getIden(identation) + (native ? `(${native})` : this.printNode(node, 0));\n }\n\n // Native equality text of `node` (parens unwrapped), if the checker proves it.\n nativeEqualityText(node) {\n const inner = this.unwrapParens(node);\n if (inner === undefined || inner.kind !== SyntaxKind.BinaryExpression || !this.isEqualityOp(inner.operatorToken.kind)) return undefined;\n return this.printNativeEqualityComparison(inner.left, inner.right, inner.operatorToken.kind);\n }\n\n unwrapParens(node) {\n let inner = node;\n while (inner !== undefined && inner.kind === SyntaxKind.ParenthesizedExpression) inner = inner.expression;\n return inner;\n }\n\n // Does `node` carry a native payload compare in a position where the old\n // text started with a bool helper? The post-pass types locals by that token.\n hasNativeComparisonOperand(node) {\n const inner = this.unwrapParens(node);\n if (inner === undefined) return false;\n if (inner.kind === SyntaxKind.PrefixUnaryExpression && inner.operator === SyntaxKind.ExclamationToken) {\n return this.hasNativeComparisonOperand(inner.operand);\n }\n if (this.nativeEqualityText(inner) !== undefined) return true;\n return inner.kind === SyntaxKind.BinaryExpression && this.isLogicalOp(inner.operatorToken.kind) &&\n (this.hasNativeComparisonOperand(inner.left) || this.hasNativeComparisonOperand(inner.right));\n }\n\n // Bare `&&`/`||` text of a logical expression (its operands are bools).\n printLogicalInBooleanContext(node) {\n const token = node.operatorToken.kind === SyntaxKind.AmpersandAmpersandToken ? '&&' : '||';\n return `${this.printCondition(node.left, 0).trim()} ${token} ${this.printCondition(node.right, 0).trim()}`;\n }\n\n printWhileStatement(node, identation) {\n return `${this.getIden(identation)}while ${this.printCondition(node.expression, 0)}${this.printBlock(node.statement, identation)}`;\n }\n\n printIfStatement(node, identation) {\n const elseStatement = node.elseStatement;\n const ifBody = this.printBlock(node.thenStatement, identation, elseStatement !== undefined);\n const head = node.parent.kind === SyntaxKind.IfStatement ? 'else if ' : `${this.getIden(identation)}if `;\n let ifComplete = `${head}${this.printCondition(node.expression, 0)}${ifBody}`;\n if (elseStatement?.kind === SyntaxKind.Block) {\n ifComplete += ` else${this.printBlock(elseStatement, identation)}`;\n } else if (elseStatement?.kind === SyntaxKind.IfStatement) {\n ifComplete += ' ' + this.printIfStatement(elseStatement, identation);\n }\n return this.printNodeCommentsIfAny(node, identation, ifComplete);\n }\n\n printPostFixUnaryExpression(node, identation) {\n const { operand, operator } = node;\n const helper = operator === SyntaxKind.PlusPlusToken ? 'add' : operator === SyntaxKind.MinusMinusToken ? 'subtract' : undefined;\n if (helper === undefined) return super.printPostFixUnaryExpression(node, identation);\n const operandText = this.printNode(operand, 0);\n const native = this.printNativeIncrement(helper === 'add' ? SyntaxKind.PlusToken : SyntaxKind.MinusToken, operand, operandText);\n return `${this.getIden(identation)}${operandText} = ${native ?? `${helper}(&${operandText}, &Value::Int(1))`}`;\n }\n\n // `x++` / `x--` on a checker-typed number: native `+`/`-` with `Value::Int(1)`.\n printNativeIncrement(op, operand, operandText: string): string | undefined {\n try {\n if (!this.isNumberLikeType(this.getChecker().getTypeAtLocation(operand))) return undefined;\n } catch (e) {\n return undefined;\n }\n return this.printNativeNumeric(op, operandText, 'Value::Int(1)');\n }\n\n printPrefixUnaryExpression(node, identation) {\n const { operand, operator } = node;\n const idn = this.getIden(identation);\n if (operator === SyntaxKind.ExclamationToken) return idn + '!' + this.printCondition(operand, 0);\n if (operator !== SyntaxKind.MinusToken) return idn + this.PrefixFixOperators[operator] + this.printNode(operand, 0);\n const operandText = this.printNode(operand, 0);\n return idn + (this.foldNegateLiteral(operandText) ?? `negate(&${operandText})`);\n }\n\n printObjectLiteralExpression(node, identation) {\n const escapeKey = (s: any): string => String(s).replace(/\\\\/g, '\\\\\\\\').replace(/\"/g, '\\\\\"')\n .replace(/\\n/g, '\\\\n').replace(/\\r/g, '\\\\r').replace(/\\t/g, '\\\\t');\n const idn2 = this.getIden(identation + 2);\n const lines = node.properties.map(p => {\n // Shorthand: { foo } → m.insert(\"foo\", foo.clone());\n if (isShorthandPropertyAssignment(p)) {\n const name = (p.name as Identifier).text;\n return `${idn2}m.insert(\"${escapeKey(name)}\".to_string(), ${name}.clone());`;\n }\n const keyText = isStringLiteral(p.name) ? p.name.text : p.name.text;\n return `${idn2}m.insert(\"${escapeKey(keyText)}\".to_string(), ${this.printNode(p.initializer, 0)});`;\n });\n const idn1 = this.getIden(identation + 1);\n const body = lines.map(l => l + '\\n').join('');\n return `Value::Map({\\n${idn1}let mut m = std::collections::HashMap::new();\\n${body}${idn1}m\\n${this.getIden(identation)}})`;\n }\n\n printArrayLiteralExpression(node, identation) {\n return `Value::from(vec![${node.elements.map(e => this.printNode(e, 0)).join(', ')}])`;\n }\n\n printDeleteExpression(node, identation) {\n return `remove(&mut ${this.printNode(node.expression.expression, 0)}, &${this.printNode(node.expression.argumentExpression, 0)})`;\n }\n\n printInstanceOfExpression(node, identation) {\n return `${this.getIden(identation)}is_instance(&${this.printNode(node.left, 0)}, &${this.printNode(node.right, 0)})`;\n }\n\n printConditionalExpression(node, identation) {\n const condition = this.printCondition(node.condition, 0);\n const whenTrue = this.printTernaryArm(node.whenTrue);\n const whenFalse = this.printTernaryArm(node.whenFalse);\n // `ternary` is `if cond { a } else { b }` over `Value`; the arms are\n // normalized to `Value`, so the native form matches it and evaluates\n // only the taken arm (TS semantics).\n return `(if ${condition} { ${whenTrue} } else { ${whenFalse} })`;\n }\n\n // Free runtime functions that print as `bool` (not `Value`) — mirror of the\n // Rust pipeline's `ternary()` bool-boxing list.\n private static readonly BOOL_VALUE_PREFIXES = [\n 'is_equal', 'is_true', 'is_greater_than', 'is_less_than',\n 'is_greater_than_or_equal', 'is_less_than_or_equal', 'is_array',\n 'is_object', 'in_op', 'is_number', 'is_string',\n ];\n\n private static isBoolValueExpression(text: string): boolean {\n let value = text.trim();\n while (value.startsWith('(') && value.endsWith(')')) {\n let depth = 0;\n let wrapsWhole = true;\n for (let i = 0; i < value.length && wrapsWhole; i++) {\n if (value[i] === '(') depth++;\n else if (value[i] === ')' && --depth === 0 && i < value.length - 1) wrapsWhole = false;\n }\n if (!wrapsWhole) break;\n value = value.slice(1, -1).trim();\n }\n if (value.startsWith('!')) value = value.slice(1).trim();\n return RustTranspiler.BOOL_VALUE_PREFIXES.some((fn) => value.startsWith(fn + '('));\n }\n\n // An if-expression arm keeps the type `ternary()`'s `Value` parameters gave\n // it: box bool expressions, and clone bare identifiers so the arm does not\n // move a local the caller still uses.\n printTernaryArm(node, identation = 0) {\n const text = this.printNode(node, identation);\n const trimmed = text.trim();\n if (RustTranspiler.isBoolValueExpression(trimmed)) return `Value::Bool(${trimmed})`;\n if (/^[a-zA-Z_][a-zA-Z0-9_]*$/.test(trimmed) && trimmed !== 'self' && trimmed !== 'true' && trimmed !== 'false') return `${trimmed}.clone()`;\n return text;\n }\n\n // Built-in method call overrides\n printArrayIsArrayCall(node, identation, parsedArg = undefined) {\n return `Value::Bool(${this.nativeValuePredicateText('array', node?.arguments?.[0], parsedArg) ?? `is_array(&${parsedArg})`})`;\n }\n\n printObjectKeysCall(node, identation, parsedArg = undefined) {\n return `object_keys(&${parsedArg})`;\n }\n\n printObjectValuesCall(node, identation, parsedArg = undefined) {\n return `object_values(&${parsedArg})`;\n }\n\n printJsonParseCall(node, identation, parsedArg = undefined) {\n return `json_parse(&${parsedArg})`;\n }\n\n printJsonStringifyCall(node, identation, parsedArg = undefined) {\n return `json_stringify(&${parsedArg})`;\n }\n\n printMathFloorCall(node, identation, parsedArg = undefined) {\n return `math_floor(&${parsedArg})`;\n }\n\n // No `.await` here: `printAwaitExpression` appends it for `await Promise.all(...)`.\n printPromiseAllCall(node, identation, parsedArg = undefined) {\n return `promise_all(&${parsedArg})`;\n }\n\n // Rust uses postfix `.await`; the base transpiler defaults to prefix.\n printAwaitExpression(node, identation) {\n return `${this.printNode(node.expression, identation)}.await`;\n }\n\n printMathRoundCall(node, identation, parsedArg = undefined) {\n return `math_round(&${parsedArg})`;\n }\n\n printMathCeilCall(node, identation, parsedArg = undefined) {\n return `math_ceil(&${parsedArg})`;\n }\n\n printNumberIsIntegerCall(node, identation, parsedArg = undefined) {\n return `is_integer(&${parsedArg})`;\n }\n\n printArrayPushCall(node, identation, name = undefined, parsedArg = undefined) {\n return `append_to_array(&mut ${name}, ${parsedArg})`;\n }\n\n printIncludesCall(node, identation, name = undefined, parsedArg = undefined) {\n return `Value::Bool(contains(&${name}, &${parsedArg}))`;\n }\n\n printIndexOfCall(node, identation, name = undefined, parsedArg = undefined) {\n return this.printNativeStringIndexOf(node, name) ?? `get_index_of(&${name}, &${parsedArg})`;\n }\n\n printStartsWithCall(node, identation, name = undefined, parsedArg = undefined) {\n return `Value::Bool(starts_with(&${name}, &${parsedArg}))`;\n }\n\n printEndsWithCall(node, identation, name = undefined, parsedArg = undefined) {\n return `Value::Bool(ends_with(&${name}, &${parsedArg}))`;\n }\n\n printTrimCall(node, identation, name = undefined) {\n return `trim(&${name})`;\n }\n\n printJoinCall(node, identation, name = undefined, parsedArg = undefined) {\n return `join(&${name}, &${parsedArg})`;\n }\n\n printSplitCall(node, identation, name = undefined, parsedArg = undefined) {\n return `split(&${name}, &${parsedArg})`;\n }\n\n printConcatCall(node, identation, name = undefined, parsedArg = undefined) {\n return `concat(${name}.clone(), ${parsedArg}.clone())`;\n }\n\n printToFixedCall(node, identation, name = undefined, parsedArg = undefined) {\n return `to_fixed(&${name}, &${parsedArg})`;\n }\n\n printToStringCall(node, identation, name = undefined) {\n return `to_string_val(&${name})`;\n }\n\n printToUpperCaseCall(node, identation, name = undefined) {\n return `to_upper(&${name})`;\n }\n\n printToLowerCaseCall(node, identation, name = undefined) {\n return `to_lower(&${name})`;\n }\n\n printShiftCall(node, identation, name = undefined) {\n return `shift(${name}.clone())`;\n }\n\n printReverseCall(node, identation, name = undefined) {\n return `${name} = reverse(${name}.clone())`;\n }\n\n printPopCall(node, identation, name = undefined) {\n return `pop(${name}.clone())`;\n }\n\n printSliceCall(node, identation, name = undefined, parsedArg = undefined, parsedArg2 = undefined) {\n return this.printNativeStringSlice(node, name) ?? `slice(&${name}, &${parsedArg}, &${parsedArg2 ?? 'Value::Null'})`;\n }\n\n printReplaceCall(node, identation, name = undefined, parsedArg = undefined, parsedArg2 = undefined) {\n return `replace_str(&${name}, &${parsedArg}, &${parsedArg2})`;\n }\n\n printReplaceAllCall(node, identation, name = undefined, parsedArg = undefined, parsedArg2 = undefined) {\n return `replace_all_str(&${name}, &${parsedArg}, &${parsedArg2})`;\n }\n\n // `{}` (Display) renders an ExchangeError as `[Kind] message`; `{:?}` would dump the struct fields.\n printThrowStatement(node, identation) {\n return `${this.getIden(identation)}panic!(\"{}\", ${this.printNode(node.expression, 0)});`;\n }\n\n printTryStatement(node, identation) {\n const body = (block) => block.statements.map(s => this.printNode(s, identation + 1)).join('\\n');\n const rawName = node.catchClause?.variableDeclaration?.name?.text;\n const iden = this.getIden(identation);\n const errorName = rawName ? `_${rawName}` : '_e';\n return `${iden}let _try_result = std::panic::catch_unwind(std::panic::AssertUnwindSafe(|| {\\n${body(node.tryBlock)}\\n${iden}}));\\n` +\n `${iden}if let Err(${errorName}) = _try_result {\\n${body(node.catchClause.block)}\\n${iden}}`;\n }\n\n printReturnStatement(node, identation) {\n const exp = node.expression;\n const idn = this.getIden(identation);\n if (!exp) return `${idn}return;`;\n // `return X;` inside a native-`Option` method: the printed\n // expression is still the `Value` box, so convert it back to the\n // native payload (a nullish literal is the `None` arm).\n const fn: any = findAncestor(node.parent, isFunctionLike);\n if (this.rustNativeStrReturnKind(fn) === 'str' && this.rustStrReturnValueConverts(exp)) {\n if (this.literalKindOfNode(this.unwrapParensNode(exp)) === 'null') return `${idn}return None;`;\n const suffix = this.rustStrNativeExpression(exp) ? '' : '.as_str().map(str::to_owned)';\n return `${idn}return ${this.printNode(exp, 0).trim()}${suffix};`;\n }\n return `${idn}return ${this.printNode(exp, 0).trim()};`;\n }\n\n printBreakStatement(node, identation) {\n return `${this.getIden(identation)}break;`;\n }\n\n printContinueStatement(node, identation) {\n return `${this.getIden(identation)}continue;`;\n }\n\n printConstructorDeclaration(node, identation) {\n return ''; // handled in printNewMethod\n }\n\n printSpreadElement(node, identation) {\n return `${this.getIden(identation)}${this.printNode(node.expression, 0)}`;\n }\n}\n","import { BaseTranspiler } from \"./baseTranspiler.js\";\nimport { SyntaxKind } from \"typescript/unstable/ast\";\nimport { isCallExpression, isExpressionStatement } from \"typescript/unstable/ast/is\";\nimport { type Checker } from \"typescript/unstable/sync\";\nimport { isFunctionLike } from \"./tsUtils.js\";\n\nconst parserConfig = {\n 'ELSEIF_TOKEN': 'else if',\n 'OBJECT_OPENING': 'std::unordered_map {',\n 'OBJECT_CLOSING': '}',\n 'ARRAY_OPENING_TOKEN': 'std::vector{',\n 'ARRAY_CLOSING_TOKEN': '}',\n 'PROPERTY_ASSIGNMENT_TOKEN': ',',\n 'VAR_TOKEN': 'std::any', // object\n 'METHOD_TOKEN': '',\n 'PROPERTY_ASSIGNMENT_OPEN': '{',\n 'PROPERTY_ASSIGNMENT_CLOSE': '}',\n 'SUPER_TOKEN': 'base',\n 'SUPER_CALL_TOKEN': 'base',\n 'FALSY_WRAPPER_OPEN': 'isTrue(',\n 'FALSY_WRAPPER_CLOSE': ')',\n 'COMPARISON_WRAPPER_OPEN' : \"isEqual(\",\n 'COMPARISON_WRAPPER_CLOSE' : \")\",\n 'UKNOWN_PROP_WRAPPER_OPEN': 'this.call(',\n 'UNKOWN_PROP_WRAPPER_CLOSE': ')',\n 'UKNOWN_PROP_ASYNC_WRAPPER_OPEN': 'this.callAsync(',\n 'UNKOWN_PROP_ASYNC_WRAPPER_CLOSE': ')',\n 'DYNAMIC_CALL_OPEN': 'callDynamically(',\n 'EQUALS_EQUALS_WRAPPER_OPEN': 'isEqual(',\n 'EQUALS_EQUALS_WRAPPER_CLOSE': ')',\n 'DIFFERENT_WRAPPER_OPEN': '!isEqual(',\n 'DIFFERENT_WRAPPER_CLOSE': ')',\n 'GREATER_THAN_WRAPPER_OPEN': 'isGreaterThan(',\n 'GREATER_THAN_WRAPPER_CLOSE': ')',\n 'GREATER_THAN_EQUALS_WRAPPER_OPEN': 'isGreaterThanOrEqual(',\n 'GREATER_THAN_EQUALS_WRAPPER_CLOSE': ')',\n 'LESS_THAN_WRAPPER_OPEN': 'isLessThan(',\n 'LESS_THAN_WRAPPER_CLOSE': ')',\n 'LESS_THAN_EQUALS_WRAPPER_OPEN': 'isLessThanOrEqual(',\n 'LESS_THAN_EQUALS_WRAPPER_CLOSE': ')',\n 'PLUS_WRAPPER_OPEN':'add(',\n 'PLUS_WRAPPER_CLOSE':')',\n 'MINUS_WRAPPER_OPEN':'subtract(',\n 'MINUS_WRAPPER_CLOSE':')',\n 'ARRAY_LENGTH_WRAPPER_OPEN': 'getArrayLength(',\n 'ARRAY_LENGTH_WRAPPER_CLOSE': ')',\n 'DIVIDE_WRAPPER_OPEN': 'divide(',\n 'DIVIDE_WRAPPER_CLOSE': ')',\n 'MULTIPLY_WRAPPER_OPEN': 'multiply(',\n 'MULTIPLY_WRAPPER_CLOSE': ')',\n 'INDEXOF_WRAPPER_OPEN': 'getIndexOf(',\n 'INDEXOF_WRAPPER_CLOSE': ')',\n 'MOD_WRAPPER_OPEN': 'mod(',\n 'MOD_WRAPPER_CLOSE': ')',\n 'FUNCTION_TOKEN': '',\n 'DEFAULT_PARAMETER_TYPE': 'std::any',\n 'INFER_VAR_TYPE': false,\n 'INFER_ARG_TYPE': false,\n 'UNDEFINED_TOKEN': 'std::any{}',\n // qualified with :: so class methods with the same name never shadow the helper\n 'ELEMENT_ACCESS_WRAPPER_OPEN': '::getValue(',\n 'ELEMENT_ACCESS_WRAPPER_CLOSE': ')',\n 'DEFAULT_RETURN_TYPE': 'std::any',\n 'THIS_TOKEN': 'this',\n 'NEW_TOKEN': '',\n 'CATCH_DECLARATION': 'const std::exception&',\n};\n\nexport class CppTranspiler extends BaseTranspiler {\n\n binaryExpressionsWrappers;\n\n constructor(config = {}) {\n config['parser'] = Object.assign ({}, parserConfig, config['parser'] ?? {});\n\n super(config);\n\n this.requiresParameterType = true;\n this.requiresReturnType = true;\n this.asyncTranspiling = true;\n this.supportsFalsyOrTruthyValues = false;\n this.requiresCallExpressionCast = false;\n this.id = \"c++\";\n\n this.initConfig();\n\n // user overrides\n this.applyUserOverrides(config);\n }\n\n initConfig() {\n this.LeftPropertyAccessReplacements = {\n };\n\n this.RightPropertyAccessReplacements = {\n };\n\n this.FullPropertyAccessReplacements = {\n 'JSON.parse': 'parseJson',\n 'JSON.stringify': 'jsonStringify',\n 'console.log': 'consoleLog',\n 'Number.MAX_SAFE_INTEGER': 'INT_MAX',\n 'Math.min': 'mathMin',\n 'Math.max': 'mathMax',\n 'Math.log': 'mathLog',\n 'Math.abs': 'mathAbs',\n 'Math.floor': 'mathFloor',\n 'Math.pow': 'mathPow',\n };\n\n this.CallExpressionReplacements = {\n };\n\n this.ReservedKeywordsReplacements = {\n 'union': 'unionVar',\n 'char': 'charVar',\n 'default': 'defaultVar',\n 'operator': 'operatorVar',\n 'new': 'newVar',\n 'delete': 'deleteVar',\n 'template': 'templateVar',\n };\n\n this.VariableTypeReplacements = {\n };\n\n this.ArgTypeReplacements = {\n };\n\n this.binaryExpressionsWrappers = {\n [SyntaxKind.EqualsEqualsToken]: [this.EQUALS_EQUALS_WRAPPER_OPEN, this.EQUALS_EQUALS_WRAPPER_CLOSE],\n [SyntaxKind.EqualsEqualsEqualsToken]: [this.EQUALS_EQUALS_WRAPPER_OPEN, this.EQUALS_EQUALS_WRAPPER_CLOSE],\n [SyntaxKind.ExclamationEqualsToken]: [this.DIFFERENT_WRAPPER_OPEN, this.DIFFERENT_WRAPPER_CLOSE],\n [SyntaxKind.ExclamationEqualsEqualsToken]: [this.DIFFERENT_WRAPPER_OPEN, this.DIFFERENT_WRAPPER_CLOSE],\n [SyntaxKind.GreaterThanToken]: [this.GREATER_THAN_WRAPPER_OPEN, this.GREATER_THAN_WRAPPER_CLOSE],\n [SyntaxKind.GreaterThanEqualsToken]: [this.GREATER_THAN_EQUALS_WRAPPER_OPEN, this.GREATER_THAN_EQUALS_WRAPPER_CLOSE],\n [SyntaxKind.LessThanToken]: [this.LESS_THAN_WRAPPER_OPEN, this.LESS_THAN_WRAPPER_CLOSE],\n [SyntaxKind.LessThanEqualsToken]: [this.LESS_THAN_EQUALS_WRAPPER_OPEN, this.LESS_THAN_EQUALS_WRAPPER_CLOSE],\n [SyntaxKind.PlusToken]: [this.PLUS_WRAPPER_OPEN, this.PLUS_WRAPPER_CLOSE],\n [SyntaxKind.MinusToken]: [this.MINUS_WRAPPER_OPEN, this.MINUS_WRAPPER_CLOSE],\n [SyntaxKind.AsteriskToken]: [this.MULTIPLY_WRAPPER_OPEN, this.MULTIPLY_WRAPPER_CLOSE],\n [SyntaxKind.PercentToken]: [this.MOD_WRAPPER_OPEN, this.MOD_WRAPPER_CLOSE],\n [SyntaxKind.SlashToken]: [this.DIVIDE_WRAPPER_OPEN, this.DIVIDE_WRAPPER_CLOSE],\n };\n }\n\n getBlockOpen(identation){\n return \"\\n\" + this.getIden(identation) + this.BLOCK_OPENING_TOKEN + \"\\n\";\n }\n\n printSuperCallInsideConstructor(node, identation) {\n return \"\"; // c++ initializes the base class in the member initializer list\n }\n\n printStringLiteral(node) {\n // wrap in std::string so std::any always holds std::string, never const char*\n return `std::string(${super.printStringLiteral(node)})`;\n }\n\n printClass(node, identation) {\n const classDefinition = this.printClassDefinition(node, identation);\n const classBody = this.printClassBody(node, identation);\n const classClosing = this.getBlockClose(identation);\n return classDefinition + classBody + classClosing + ';';\n }\n\n printClassDefinition(node, identation) {\n const className = node.name.text;\n const heritageClauses = node.heritageClauses;\n\n let classInit = \"\";\n if (heritageClauses !== undefined) {\n const classExtends = heritageClauses[0].types[0].expression.text;\n classInit = this.getIden(identation) + \"class \" + className + \" : public \" + classExtends;\n } else {\n classInit = this.getIden(identation) + \"class \" + className;\n }\n return classInit + \"\\n\" + this.getIden(identation) + this.BLOCK_OPENING_TOKEN + \"\\n\" +\n this.getIden(identation) + \"public:\\n\";\n }\n\n printConstructorDeclaration (node, identation) {\n const classNode = node.parent;\n const className = this.printNode(classNode.name, 0);\n const args = this.printMethodParameters(node);\n const constructorBody = this.printFunctionBody(node, identation);\n\n // find super call inside constructor and extract params\n let superCallParams = '';\n let hasSuperCall = false;\n node.body?.statements.forEach(statement => {\n if (isExpressionStatement(statement)) {\n const expression = statement.expression;\n if (isCallExpression(expression)) {\n const expressionText = expression.expression.getText().trim();\n if (expressionText === 'super') {\n hasSuperCall = true;\n superCallParams = expression.arguments.map((a) => {\n return this.printNode(a, identation).trim();\n }).join(\", \");\n }\n }\n }\n });\n\n if (hasSuperCall) {\n const parentClassName = classNode.heritageClauses[0].types[0].expression.text;\n return this.getIden(identation) + className +\n `(${args}) : ${parentClassName}(${superCallParams})` +\n constructorBody;\n }\n\n return this.getIden(identation) +\n className +\n \"(\" + args + \")\" +\n constructorBody;\n }\n\n printThisElementAccesssIfNeeded(node, identation) {\n return undefined; // dynamic this[method]() calls are not supported yet\n }\n\n printDynamicCall(node, identation) {\n return undefined; // dynamic calls are not supported yet\n }\n\n printAwaitExpression(node, identation) {\n const expression = this.printNode(node.expression, identation);\n if (this.asyncTranspiling) {\n // awaitValue resolves a std::shared_future (or passes a\n // plain value through, like awaiting a non-promise in JS)\n return `awaitValue(${expression})`;\n }\n return expression;\n }\n\n printReturnStatement(node, identation) {\n // a bare `return;` inside an async body must yield a value: the body\n // runs in a lambda returning std::any\n if (this.asyncTranspiling && !node.expression) {\n let fn = node.parent;\n while (fn !== undefined && !isFunctionLike(fn)) {\n fn = fn.parent;\n }\n if (fn !== undefined && this.isAsyncFunction(fn)) {\n return this.getIden(identation) + \"return std::any{}\" + this.LINE_TERMINATOR;\n }\n }\n return super.printReturnStatement(node, identation);\n }\n\n printFunctionBody(node, identation) {\n if (this.asyncTranspiling && this.isAsyncFunction(node)) {\n // run the body on a std::async task so independent calls overlap;\n // sharing the future makes it copyable and thus storable in std::any\n const innerIdentation = identation + 2;\n const bodyStatements = node.body.statements;\n const statements = bodyStatements.map((s) => this.printNode(s, innerIdentation)).join(\"\\n\");\n // the lambda returns std::any, so a body that can flow off the end\n // needs a fallback return\n const lastStatement = bodyStatements.length > 0 ? bodyStatements[bodyStatements.length - 1] : undefined;\n const endsWithReturn = lastStatement !== undefined && lastStatement.kind === SyntaxKind.ReturnStatement;\n const fallbackReturn = endsWithReturn ? \"\" : this.getIden(innerIdentation) + \"return std::any{};\\n\";\n return this.getBlockOpen(identation) +\n this.getIden(identation + 1) + \"return std::async(std::launch::async, [=]() -> std::any {\\n\" +\n (statements ? statements + \"\\n\" : \"\") +\n fallbackReturn +\n this.getIden(identation + 1) + \"}).share();\" +\n this.getBlockClose(identation);\n }\n return super.printFunctionBody(node, identation);\n }\n\n printWrappedUnknownThisProperty(node) {\n return undefined;\n }\n\n printOutOfOrderCallExpressionIfAny(node, identation) {\n if (node.expression.kind === SyntaxKind.PropertyAccessExpression) {\n const expressionText = node.expression.getText().trim();\n const args = node.arguments;\n if (args.length === 1) {\n const parsedArg = this.printNode(args[0], 0);\n switch (expressionText) {\n case \"Math.abs\":\n return `mathAbs(${parsedArg})`;\n }\n } else if (args.length === 2) {\n const parsedArg1 = this.printNode(args[0], 0);\n const parsedArg2 = this.printNode(args[1], 0);\n switch (expressionText) {\n case \"Math.min\":\n return `mathMin(${parsedArg1}, ${parsedArg2})`;\n case \"Math.max\":\n return `mathMax(${parsedArg1}, ${parsedArg2})`;\n case \"Math.pow\":\n return `mathPow(${parsedArg1}, ${parsedArg2})`;\n }\n }\n }\n\n return undefined;\n }\n\n handleTypeOfInsideBinaryExpression(node, identation) {\n const right = node.right.text;\n const op = node.operatorToken.kind;\n const expression = node.left.expression;\n\n const isDifferentOperator = op === SyntaxKind.ExclamationEqualsEqualsToken || op === SyntaxKind.ExclamationEqualsToken;\n const notOperator = isDifferentOperator ? this.NOT_TOKEN : \"\";\n\n const target = this.printNode(expression, 0);\n switch (right) {\n case \"string\":\n return notOperator + `isString(${target})`;\n case \"number\":\n return notOperator + `isNumber(${target})`;\n case \"boolean\":\n return notOperator + `isBool(${target})`;\n case \"object\":\n return notOperator + `isDictionary(${target})`;\n case \"function\":\n return notOperator + `isFunction(${target})`;\n }\n\n return undefined;\n }\n\n printCustomBinaryExpressionIfAny(node, identation) {\n const left = node.left;\n const right = node.right;\n\n const op = node.operatorToken.kind;\n\n if (left.kind === SyntaxKind.TypeOfExpression) {\n const typeOfExpression = this.handleTypeOfInsideBinaryExpression(node, identation);\n if (typeOfExpression) {\n return typeOfExpression;\n }\n }\n\n // handle: [x,d] = this.method()\n if (op === SyntaxKind.EqualsToken && left.kind === SyntaxKind.ArrayLiteralExpression) {\n const arrayBindingPatternElements = left.elements;\n const parsedArrayBindingElements = arrayBindingPatternElements.map((e) => this.printNode(e, 0));\n const syntheticName = parsedArrayBindingElements.join(\"\") + \"Variable\";\n\n let arrayBindingStatement = `std::any ${syntheticName} = ${this.printNode(right, 0)};\\n`;\n\n parsedArrayBindingElements.forEach((e, index) => {\n const statement = this.getIden(identation) + `${e} = ::getValue(${syntheticName}, ${index})`;\n if (index < parsedArrayBindingElements.length - 1) {\n arrayBindingStatement += statement + \";\\n\";\n } else {\n // printStatement adds the last ;\n arrayBindingStatement += statement;\n }\n });\n\n return arrayBindingStatement;\n }\n\n if (op === SyntaxKind.InKeyword) {\n return `inOp(${this.printNode(right, 0)}, ${this.printNode(left, 0)})`;\n }\n\n const leftText = this.printNode(left, 0);\n const rightText = this.printNode(right, 0);\n\n if (op === SyntaxKind.PlusEqualsToken) {\n return `${leftText} = add(${leftText}, ${rightText})`;\n }\n\n if (op === SyntaxKind.MinusEqualsToken) {\n return `${leftText} = subtract(${leftText}, ${rightText})`;\n }\n\n if (op === SyntaxKind.EqualsToken) {\n // handle dict['a'] = 3 and list[0] = 3\n if (left.kind === SyntaxKind.ElementAccessExpression) {\n const elementAccess = left;\n const target = this.printNode(elementAccess.expression, 0);\n const propName = this.printNode(elementAccess.argumentExpression, 0);\n return `::setValue(${target}, ${propName}, ${rightText})`;\n }\n }\n\n if (op in this.binaryExpressionsWrappers) {\n const wrapper = this.binaryExpressionsWrappers[op];\n const open = wrapper[0];\n const close = wrapper[1];\n return `${open}${leftText}, ${rightText}${close}`;\n }\n\n return undefined;\n }\n\n printVariableDeclarationList(node,identation) {\n const declaration = node.declarations[0];\n\n // handle array binding : input: const [a,b] = this.method()\n // output: std::any abVariable = this.method(); std::any a = getValue(abVariable, 0); ...\n if (declaration?.name.kind === SyntaxKind.ArrayBindingPattern) {\n const arrayBindingPattern = declaration.name;\n const arrayBindingPatternElements = arrayBindingPattern.elements;\n const parsedArrayBindingElements = arrayBindingPatternElements.map((e) => this.printNode(e.name, 0));\n const syntheticName = parsedArrayBindingElements.join(\"\") + \"Variable\";\n\n let arrayBindingStatement = `${this.getIden(identation)}std::any ${syntheticName} = ${this.printNode(declaration.initializer, 0)};\\n`;\n\n parsedArrayBindingElements.forEach((e, index) => {\n const statement = this.getIden(identation) + `std::any ${e} = ::getValue(${syntheticName}, ${index})`;\n if (index < parsedArrayBindingElements.length - 1) {\n arrayBindingStatement += statement + \";\\n\";\n } else {\n // printStatement adds the last ;\n arrayBindingStatement += statement;\n }\n });\n\n return arrayBindingStatement;\n }\n\n const isNew = declaration.initializer && (declaration.initializer.kind === SyntaxKind.NewExpression);\n let className = undefined;\n if (isNew) {\n className = declaration.initializer.expression.text;\n }\n const varToken = isNew ? className + ' ' : this.VAR_TOKEN + ' ' ;\n\n // handle default undefined initialization: let id: Str;\n if (declaration.initializer === undefined) {\n return this.getIden(identation) + this.VAR_TOKEN + ' ' + this.printNode(declaration.name) + \" = \" + this.UNDEFINED_TOKEN;\n }\n const parsedValue = this.printNode(declaration.initializer, identation).trimStart();\n return this.getIden(identation) + varToken + this.printNode(declaration.name) + \" = \" + parsedValue;\n }\n\n printFunctionDefinition(node, identation) {\n let name = node.name.text;\n name = this.transformFunctionNameIfNeeded(name);\n\n const parsedArgs = node.parameters.map(param => this.printParameter(param)).join(\", \");\n\n let returnType = this.printFunctionType(node);\n returnType = returnType ? returnType + \" \" : returnType;\n\n const functionDef = this.getIden(identation) + returnType + name\n + \"(\" + parsedArgs + \")\";\n\n return functionDef;\n }\n\n printInstanceOfExpression(node, identation) {\n const left = this.printNode(node.left, 0);\n const right = node.right.text;\n return this.getIden(identation) + `(dynamic_cast(&(${left})) != nullptr)`;\n }\n\n printAsExpression(node, identation) {\n return this.printNode(node.expression, identation);\n }\n\n printParameter(node, defaultValue = true) {\n const name = this.printNode(node.name, 0);\n const initializer = node.initializer;\n\n if (defaultValue) {\n if (initializer) {\n return this.DEFAULT_PARAMETER_TYPE + \" \" + name + this.SPACE_DEFAULT_PARAM + \"=\" + this.SPACE_DEFAULT_PARAM + this.printNode(initializer, 0);\n }\n return this.DEFAULT_PARAMETER_TYPE + \" \" + name;\n }\n return name;\n }\n\n printFunctionType(node){\n if (!this.requiresReturnType) {\n return \"\";\n }\n\n if (this.asyncTranspiling && this.isAsyncFunction(node)) {\n return `std::shared_future<${this.DEFAULT_RETURN_TYPE}>`;\n }\n\n const typeText = this.getFunctionType(node);\n if (typeText === this.VOID_KEYWORD) {\n return this.VOID_KEYWORD;\n }\n return this.DEFAULT_RETURN_TYPE;\n }\n\n printMethodDefinition(node, identation) {\n let name = node.name.text;\n name = this.transformMethodNameIfNeeded(name);\n\n let returnType = this.printFunctionType(node);\n\n const methodOverride = this.getMethodOverride(node) as any;\n const isOverride = methodOverride !== undefined;\n const virtualPrefix = isOverride ? \"\" : \"virtual \";\n const overrideSuffix = isOverride ? \" override\" : \"\";\n\n // keep the overridden method's return type so the signatures match\n if (isOverride) {\n returnType = this.printFunctionType(methodOverride);\n }\n\n const parsedArgs = this.printMethodParameters(node);\n\n returnType = returnType ? returnType + \" \" : returnType;\n\n const methodToken = this.METHOD_TOKEN ? this.METHOD_TOKEN + \" \" : \"\";\n const methodDef = this.getIden(identation) + virtualPrefix + returnType + methodToken + name\n + \"(\" + parsedArgs + \")\" + overrideSuffix;\n\n return this.printNodeCommentsIfAny(node, identation, methodDef);\n }\n\n printPropertyDeclaration(node, identation) {\n const name = this.printNode(node.name, 0);\n if (node.initializer) {\n const initializer = this.printNode(node.initializer, 0);\n return this.getIden(identation) + 'std::any ' + name + \" = \" + initializer + this.LINE_TERMINATOR;\n }\n return this.getIden(identation) + 'std::any ' + name + this.LINE_TERMINATOR;\n }\n\n printArrayLiteralExpression(node) {\n const elements = node.elements.map((e) => {\n return this.printNode(e);\n }).join(\", \");\n return this.ARRAY_OPENING_TOKEN + elements + this.ARRAY_CLOSING_TOKEN;\n }\n\n printArrayIsArrayCall(node, identation, parsedArg = undefined) {\n return `isArray(${parsedArg})`;\n }\n\n printObjectKeysCall(node, identation, parsedArg = undefined) {\n return `getObjectKeys(${parsedArg})`;\n }\n\n printObjectValuesCall(node, identation, parsedArg = undefined) {\n return `getObjectValues(${parsedArg})`;\n }\n\n printJsonParseCall(node, identation, parsedArg = undefined) {\n return `parseJson(${parsedArg})`;\n }\n\n printJsonStringifyCall(node, identation, parsedArg = undefined) {\n return `jsonStringify(${parsedArg})`;\n }\n\n printPromiseAllCall(node, identation, parsedArg = undefined) {\n return `promiseAll(${parsedArg})`;\n }\n\n printMathFloorCall(node, identation, parsedArg = undefined) {\n return `mathFloor(${parsedArg})`;\n }\n\n printMathRoundCall(node, identation, parsedArg = undefined) {\n return `mathRound(${parsedArg})`;\n }\n\n printMathCeilCall(node, identation, parsedArg = undefined) {\n return `mathCeil(${parsedArg})`;\n }\n\n printNumberIsIntegerCall(node: any, identation: any, parsedArg?: any) {\n return `isInteger(${parsedArg})`;\n }\n\n printArrayPushCall(node, identation, name = undefined, parsedArg = undefined) {\n return `arrayPush(${name}, ${parsedArg})`;\n }\n\n printIncludesCall(node, identation, name = undefined, parsedArg = undefined) {\n return `includes(${name}, ${parsedArg})`;\n }\n\n printIndexOfCall(node, identation, name = undefined, parsedArg = undefined) {\n return `${this.INDEXOF_WRAPPER_OPEN}${name}, ${parsedArg}${this.INDEXOF_WRAPPER_CLOSE}`;\n }\n\n printStartsWithCall(node, identation, name = undefined, parsedArg = undefined) {\n return `startsWith(${name}, ${parsedArg})`;\n }\n\n printEndsWithCall(node, identation, name = undefined, parsedArg = undefined) {\n return `endsWith(${name}, ${parsedArg})`;\n }\n\n printTrimCall(node, identation, name = undefined) {\n return `trim(${name})`;\n }\n\n printJoinCall(node, identation, name = undefined, parsedArg = undefined) {\n return `join(${name}, ${parsedArg})`;\n }\n\n printSplitCall(node, identation, name = undefined, parsedArg = undefined) {\n return `split(${name}, ${parsedArg})`;\n }\n\n printConcatCall(node, identation, name = undefined, parsedArg = undefined) {\n return `concat(${name}, ${parsedArg})`;\n }\n\n printToFixedCall(node, identation, name = undefined, parsedArg = undefined) {\n return `toFixed(${name}, ${parsedArg})`;\n }\n\n printToStringCall(node, identation, name = undefined) {\n return `toString(${name})`;\n }\n\n printToUpperCaseCall(node, identation, name = undefined) {\n return `toUpperCase(${name})`;\n }\n\n printToLowerCaseCall(node, identation, name = undefined) {\n return `toLowerCase(${name})`;\n }\n\n printShiftCall(node, identation, name = undefined) {\n return `shift(${name})`;\n }\n\n printReverseCall(node, identation, name = undefined) {\n return `reverse(${name})`;\n }\n\n printPopCall(node, identation, name = undefined) {\n return `pop(${name})`;\n }\n\n printAssertCall(node, identation, parsedArgs) {\n return `assertTrue(${parsedArgs})`;\n }\n\n printSliceCall(node, identation, name = undefined, parsedArg = undefined, parsedArg2 = undefined) {\n if (parsedArg2 === undefined){\n parsedArg2 = this.UNDEFINED_TOKEN;\n }\n return `slice(${name}, ${parsedArg}, ${parsedArg2})`;\n }\n\n printReplaceCall(node, identation, name = undefined, parsedArg = undefined, parsedArg2 = undefined) {\n return `replace(${name}, ${parsedArg}, ${parsedArg2})`;\n }\n\n printReplaceAllCall(node, identation, name = undefined, parsedArg = undefined, parsedArg2 = undefined) {\n return `replaceAll(${name}, ${parsedArg}, ${parsedArg2})`;\n }\n\n printPadEndCall(node, identation, name, parsedArg, parsedArg2) {\n return `padEnd(${name}, ${parsedArg}, ${parsedArg2})`;\n }\n\n printPadStartCall(node, identation, name, parsedArg, parsedArg2) {\n return `padStart(${name}, ${parsedArg}, ${parsedArg2})`;\n }\n\n printDateNowCall(node, identation) {\n return \"getCurrentTimestamp()\";\n }\n\n printLengthProperty(node, identation, name = undefined) {\n const leftSide = this.printNode(node.expression, 0);\n const type = (this.getChecker() as Checker).getTypeAtLocation(node.expression); // eslint-disable-line\n this.warnIfAnyType(node, type.flags, leftSide, \"length\");\n return this.isStringType(type.flags) ? `getStringLength(${leftSide})` : `${this.ARRAY_LENGTH_WRAPPER_OPEN}${leftSide}${this.ARRAY_LENGTH_WRAPPER_CLOSE}`;\n }\n\n printPostFixUnaryExpression(node, identation) {\n const {operand, operator} = node;\n if (operand.kind === SyntaxKind.NumericLiteral) {\n return super.printPostFixUnaryExpression(node, identation);\n }\n const leftSide = this.printNode(operand, 0);\n const op = this.PostFixOperators[operator];\n if (op === '--') {\n return `postFixDecrement(${leftSide})`;\n }\n return `postFixIncrement(${leftSide})`;\n }\n\n printPrefixUnaryExpression(node, identation) {\n const {operand, operator} = node;\n if (operand.kind === SyntaxKind.NumericLiteral) {\n return super.printPrefixUnaryExpression(node, identation);\n }\n if (operator === SyntaxKind.ExclamationToken) {\n // not branch check falsy/truthy values if needed;\n return this.PrefixFixOperators[operator] + this.printCondition(node.operand, 0);\n }\n const leftSide = this.printNode(operand, 0);\n if (operator === SyntaxKind.PlusToken) {\n return `prefixUnaryPlus(${leftSide})`;\n } else {\n return `prefixUnaryNeg(${leftSide})`;\n }\n }\n\n printConditionalExpression(node, identation) {\n const condition = this.printCondition(node.condition, 0);\n const whenTrue = this.printNode(node.whenTrue, 0);\n const whenFalse = this.printNode(node.whenFalse, 0);\n\n // wrap both branches in std::any so the ternary has one common type\n return `(${condition} ? std::any(${whenTrue}) : std::any(${whenFalse}))`;\n }\n\n printDeleteExpression(node, identation) {\n const object = this.printNode (node.expression.expression, 0);\n const key = this.printNode (node.expression.argumentExpression, 0);\n return `deleteKey(${object}, ${key})`;\n }\n\n printThrowStatement(node, identation) {\n if (node.expression.kind === SyntaxKind.Identifier) {\n return this.getIden(identation) + this.THROW_TOKEN + ' ' + this.printNode(node.expression, 0) + this.LINE_TERMINATOR;\n }\n if (node.expression.kind === SyntaxKind.NewExpression) {\n const expression = node.expression;\n // handle throw new Error (message) and throw new x[a] (message)\n const argumentsExp = expression?.arguments ?? [];\n const parsedArg = argumentsExp.map(n => this.printNode(n, 0)).join(\", \") ?? '';\n const newExpression = this.printNode(expression.expression, 0);\n if (expression.expression.kind === SyntaxKind.Identifier) {\n const id = expression.expression;\n const symbol = this.getChecker().getSymbolAtLocation(expression.expression);\n if (symbol) {\n const declarations = (this.getChecker().getDeclaredTypeOfSymbol(symbol).getSymbol()?.declarations ?? []).map((d) => d.resolve());\n const isClassDeclaration = declarations.find(l => l.kind === SyntaxKind.InterfaceDeclaration || l.kind === SyntaxKind.ClassDeclaration);\n if (isClassDeclaration){\n return this.getIden(identation) + `${this.THROW_TOKEN} ${id.text}(toString(${parsedArg}))${this.LINE_TERMINATOR}`;\n }\n return this.getIden(identation) + `throwDynamicException(${id.text}, ${parsedArg})${this.LINE_TERMINATOR}`;\n }\n return this.getIden(identation) + `${this.THROW_TOKEN} ${newExpression}(${parsedArg})${this.LINE_TERMINATOR}`;\n } else if (expression.expression.kind === SyntaxKind.ElementAccessExpression) {\n return this.getIden(identation) + `throwDynamicException(${newExpression}, ${parsedArg})${this.LINE_TERMINATOR}`;\n }\n return super.printThrowStatement(node, identation);\n }\n return super.printThrowStatement(node, identation);\n }\n\n getExceptionalAccessTokenIfAny(node) {\n const leftSide = node.expression;\n const leftSideText = this.printNode(leftSide, 0);\n if (leftSideText === this.THIS_TOKEN) {\n return '->';\n }\n return undefined;\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AACA,WAAO,UAAU;AAAA;AAAA;;;ACDjB;AAEA,qBAAwB;AAFxB,SAAS,cAAc,cAAAA,mBAA8C;AACrE,SAAS,OAAAC,MAAK,YAAY,gBAAAC,eAAc,aAAAC,YAAW,eAAAC,cAAa,iBAAAC,gBAAe,eAAAC,cAAa,aAAAC,YAAW,uBAAwF;;;ACD/L;;;ACAA;AAAA,SAAS,YAAY,yBAAyB,gCAAyI;AACvL,SAAS,0BAA0B,iBAAiB,mBAAmB,oBAAoB,kBAAkB,kBAAkB,oBAAoB,yBAAyB,oBAAoB,qBAAqB,uBAAuB,sBAAsB,qBAAqB,qBAAqB,kBAAkB,2BAA2B,cAAc,yBAAyB,2BAA2B;AAC3Z,SAAS,uBAAuB,+BAA+B,6BAA6B;AAC5F,SAAS,eAAe,iBAA6C;;;ACHrE;AA8EA,IAAM,qBAAN,cAAiC,MAAM;AAAA,EACnC,YAAa,IAAI,SAAS,UAAU,OAAO,KAAK;AAC5C,UAAM,gBAAgB,SAAS,EAAE,WAAW,OAAO,OAAO,KAAK,IAAI,GAAG,WAAW,QAAQ;AACzF,UAAO,aAAa;AACpB,SAAK,OAAO;AAAA,EAEhB;AACJ;;;ACrFA;AAEA,SAAS,SAAU,MAAc,OAAsB;AACnD,aAAW,KAAK,OAAO;AACnB,QAAI,QAAQ,MAAM,CAAC,EAAE,CAAC;AACtB,UAAM,QAAS,OAAO,UAAU,WAAY,MAAM;AAClD,YAAQ,IAAI,OAAQ,OAAO,KAAK;AAChC,WAAO,KAAK,QAAS,OAAO,MA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AAK,6BAA+B,QAAQ;AAAA,EACvD;AACJ;","names":["SyntaxKind","API","ElementFlags","IndexKind","ObjectFlags","SignatureKind","SymbolFlags","TypeFlags","defaultValue","type","node","namedExports","SyntaxKind","SyntaxKind","isArrowFunction","isCallExpression","isFunctionDeclaration","isFunctionExpression","TypeFlags","parserConfig","isFunctionDeclaration","isFunctionExpression","isArrowFunction","isCallExpression","SyntaxKind","TypeFlags","SyntaxKind","TypeFlags","isArrayLiteralExpression","isBinaryExpression","isBooleanLiteral","isCallExpression","isClassDeclaration","isFunctionExpression","isMethodDeclaration","isNumericLiteral","isObjectLiteralExpression","isSourceFile","isStringLiteralLikeNode","parserConfig","SyntaxKind","isNumericLiteral","isMethodDeclaration","isClassDeclaration","symbol","isCallExpression","TypeFlags","isStringLiteralLikeNode","isBinaryExpression","isArrayLiteralExpression","isObjectLiteralExpression","named","isStringLiteral","isFunctionExpression","isBooleanLiteral","defaultValue","isSourceFile","path","fs","SyntaxKind","getLeadingCommentRanges","isArrowFunction","isBinaryExpression","isBlock","isBooleanLiteral","isCallExpression","isElementAccessExpression","isExpressionStatement","isFunctionDeclaration","isFunctionExpression","isIfStatement","isMethodDeclaration","isReturnStatement","isSourceFile","isThrowStatement","IndexKind","TypeFlags","SyntaxKind","parserConfig","parserConfig","SyntaxKind","isBooleanLiteral","isArrowFunction","name","isSourceFile","isFunctionDeclaration","isMethodDeclaration","TypeFlags","isExpressionStatement","isCallExpression","isElementAccessExpression","rhs","native","IndexKind","level","getLeadingCommentRanges","path","isStatement","isFunctionExpression","whenTrue","whenFalse","isClassDeclaration","isBinaryExpression","isBlock","isReturnStatement","isThrowStatement","isIfStatement","SyntaxKind","isArrayLiteralExpression","isArrowFunction","isAsExpression","isBinaryExpression","isBlock","isBooleanLiteral","isCallExpression","isBreakStatement","isClassDeclaration","isConditionalExpression","isContinueStatement","isElementAccessExpression","isExpressionStatement","isFunctionDeclaration","isFunctionExpression","isIdentifier","isIfStatement","isMethodDeclaration","isNumericLiteral","isObjectLiteralExpression","isParameterDeclaration","isParenthesizedExpression","isPostfixUnaryExpression","isPrefixUnaryExpression","isPropertyAccessExpression","isReturnStatement","isSourceFile","isSpreadAssignment","isSpreadElement","isStringLiteral","isStringLiteralLikeNode","isThrowStatement","isTypeAssertion","isVariableDeclaration","IndexKind","SymbolFlags","TypeFlags","parserConfig","SyntaxKind","TypeFlags","isClassDeclaration","isMethodDeclaration","isIdentifier","isParameterDeclaration","isArrayLiteralExpression","isStringLiteralLikeNode","isObjectLiteralExpression","isNumericLiteral","isPrefixUnaryExpression","isVariableDeclaration","isExpressionStatement","isCallExpression","isFunctionDeclaration","isBinaryExpression","isPostfixUnaryExpression","isStringLiteral","isPropertyAccessExpression","isElementAccessExpression","isParenthesizedExpression","isAsExpression","isTypeAssertion","isSourceFile","isReturnStatement","isBlock","IndexKind","isIfStatement","isConditionalExpression","isThrowStatement","isContinueStatement","isBreakStatement","SymbolFlags","target","isFunctionExpression","isBooleanLiteral","isSpreadElement","isSpreadAssignment","isArrowFunction","SyntaxKind","isArrayLiteralExpression","isArrowFunction","isAsExpression","isBinaryExpression","isBlock","isCallExpression","isClassDeclaration","isClassExpression","isConditionalExpression","isDeleteExpression","isElementAccessExpression","isForInStatement","isForOfStatement","isIdentifier","isMethodDeclaration","isNonNullExpression","isNumericLiteral","isObjectLiteralExpression","isParameterDeclaration","isParenthesizedExpression","isPrefixUnaryExpression","isPropertyAccessExpression","isReturnStatement","isShorthandPropertyAssignment","isSourceFile","isStringLiteral","isStringLiteralLikeNode","isTypeAssertion","isVariableDeclaration","IndexKind","SignatureKind","SymbolFlags","TypeFlags","parserConfig","SyntaxKind","TypeFlags","isElementAccessExpression","isCallExpression","isParenthesizedExpression","isVariableDeclaration","isIdentifier","isPropertyAccessExpression","isParameterDeclaration","accessor","isStringLiteralLikeNode","isNumericLiteral","isPrefixUnaryExpression","isStringLiteral","isObjectLiteralExpression","isNonNullExpression","isAsExpression","isBinaryExpression","isArrayLiteralExpression","isConditionalExpression","isMethodDeclaration","isClassDeclaration","isReturnStatement","isShorthandPropertyAssignment","isForOfStatement","isForInStatement","isDeleteExpression","isArrowFunction","args","SymbolFlags","isClassExpression","SignatureKind","IndexKind","isBlock","text","isTypeAssertion","isSourceFile","type","value","SyntaxKind","isCallExpression","isExpressionStatement","parserConfig","SyntaxKind","isExpressionStatement","isCallExpression","isClassDeclaration","currentPath","SyntaxKind","API","path"]} \ No newline at end of file +{"version":3,"sources":["../src/dirname.cjs","../src/transpiler.ts","../src/pythonTranspiler.ts","../src/baseTranspiler.ts","../src/types.ts","../src/utils.ts","../src/logger.ts","../src/phpTranspiler.ts","../src/csharpTranspiler.ts","../src/goTranspiler.ts","../src/javaTranspiler.ts","../src/rustTranspiler.ts","../src/cppTranspiler.ts"],"sourcesContent":["// https://github.com/kulshekhar/ts-jest/issues/1174\nmodule.exports = __dirname;","import { ScriptTarget, SyntaxKind, type Node, type SourceFile } from \"typescript/unstable/ast\";\nimport { API, CheckFlags, ElementFlags, IndexKind, ObjectFlags, SignatureKind, SymbolFlags, TypeFlags, TypeFormatFlags, type Checker, type CompilerOptions, type Program, type Snapshot } from \"typescript/unstable/sync\";\nimport currentPath from \"./dirname.cjs\";\nimport { PythonTranspiler } from './pythonTranspiler.js';\nimport { PhpTranspiler } from './phpTranspiler.js';\nimport { CSharpTranspiler } from './csharpTranspiler.js';\nimport * as path from \"path\";\nimport * as fs from \"fs\";\nimport { Logger } from './logger.js';\nimport { Languages, TranspilationMode, IFileExport, IFileImport, ITranspiledFile, IInput, ITranspileContext, ITranspileProgramCache } from './types.js';\nimport { GoTranspiler, alignGoTrailingComments } from './goTranspiler.js';\nimport { JavaTranspiler } from './javaTranspiler.js';\nimport { RustTranspiler, RUST_DECLARED_DICT_LOCALS } from './rustTranspiler.js';\nimport type { RustDeclaredDictLocalEntry } from './rustTranspiler.js';\nimport { CppTranspiler } from './cppTranspiler.js';\n\nconst __dirname_mock = currentPath;\n\n// minimal type environment: skip the auto-included @types/* packages (with empty\n// options typescript scans node_modules/@types and pulls every package it finds —\n// 160+ extra files) and replace the default es5+dom lib (lib.dom.d.ts alone is ~8MB)\n// with the es-only lib chain. Neither dom nor @types globals affect transpilation\n// output, but they dominate program creation time (~10x) and make the type\n// environment depend on whatever @types happen to be installed in the host project.\nconst fastCompilerOptions: CompilerOptions = {\n target: ScriptTarget.Latest,\n lib: [\"lib.esnext.d.ts\"],\n types: [],\n};\n\n// the host globals (console, Buffer, setTimeout, ...) previously came from the\n// auto-included @types packages; declare them here so references to them neither\n// produce \"Cannot find name\" diagnostics nor trigger typescript's (very expensive)\n// spelling-suggestion scans while computing those diagnostics\nconst globalsShim = `\ndeclare var require: any;\ndeclare var module: any;\ndeclare var exports: any;\ndeclare var console: any;\ndeclare var process: any;\ndeclare var Buffer: any;\ndeclare var __dirname: string;\ndeclare var __filename: string;\ndeclare var setTimeout: any;\ndeclare var clearTimeout: any;\ndeclare var setInterval: any;\ndeclare var clearInterval: any;\ndeclare var setImmediate: any;\ndeclare var fetch: any;\ndeclare var URL: any;\ndeclare var URLSearchParams: any;\ndeclare var TextEncoder: any;\ndeclare var TextDecoder: any;\ndeclare var crypto: any;\ndeclare var performance: any;\ndeclare var AbortController: any;\ndeclare var WebSocket: any;\ndeclare var atob: any;\ndeclare var btoa: any;\n`;\nconst globalsShimPath = path.resolve(path.join(__dirname_mock, \"__globals-shim.d.ts\"));\n\n// transpiling one file to several languages queries the checker repeatedly for the\n// same nodes (identifiers, binary operands, conditions). Types and symbols are\n// deterministic per (checker, node), so memoize the two hot lookups on the checker\n// instance itself — the caches die with the checker when a new program is created\nconst UNDEFINED_SENTINEL = Symbol(\"undefined\");\n// unary checker queries keyed by a snapshot object (node / type / symbol / signature);\n// the API returns registry-interned objects, so object identity is a stable key\nconst MEMOIZED_UNARY_CHECKER_METHODS = [\n \"getTypeAtLocation\", \"getSymbolAtLocation\", \"getResolvedSignature\", \"getContextualType\",\n \"getSignaturesOfType\", \"getSymbolOfType\", \"getReturnTypeOfSignature\", \"getSignatureFromDeclaration\",\n \"isArrayType\", \"isArrayLikeType\", \"isTupleType\", \"getTypeArguments\", \"getTypeFromTypeNode\",\n \"getDeclaredTypeOfSymbol\", \"getTypeOfSymbol\", \"getAliasedSymbol\", \"getBaseTypeOfLiteralType\",\n \"getApparentType\", \"getPropertiesOfType\", \"getNonNullableType\", \"getIndexInfosOfType\",\n];\nfunction memoizeCheckerCalls(checker: Checker): void {\n if ((checker as any).__astTranspilerMemoized) {\n return;\n }\n (checker as any).__astTranspilerMemoized = true;\n for (const name of MEMOIZED_UNARY_CHECKER_METHODS) {\n memoizeUnaryMethod(checker, name);\n }\n // typeToString(type) with no extra args is the only form worth caching\n memoizeUnaryMethod(checker, \"typeToString\");\n // (type, kind) pairs: a WeakMap per kind\n memoizeBinaryKindMethod(checker, \"getSignaturesOfType\");\n memoizeBinaryKindMethod(checker, \"getIndexTypeOfType\");\n memoizeBinaryKindMethod(checker, \"getIndexInfoOfType\");\n memoizePairMethod(checker, \"getTypeOfSymbolAtLocation\");\n}\n\n// (object, object) pairs, e.g. getTypeOfSymbolAtLocation(symbol, node); seed2 fills it from a prefetch\nfunction memoizePairMethod(owner: object, name: string): void {\n const original = owner[name];\n if (typeof original !== \"function\") {\n return;\n }\n const cache = new WeakMap>();\n const seed2 = (a: object, b: object, value: unknown) => {\n let inner = cache.get(a);\n if (inner === undefined) {\n cache.set(a, inner = new WeakMap());\n }\n inner.set(b, value === undefined ? UNDEFINED_SENTINEL : value);\n };\n const wrapped = function (this: unknown, ...args: unknown[]) {\n const [a, b] = args;\n if (args.length !== 2 || a === null || typeof a !== \"object\" || b === null || typeof b !== \"object\") {\n return original.apply(owner, args);\n }\n const cached = cache.get(a as object)?.get(b as object);\n if (cached !== undefined) {\n return cached === UNDEFINED_SENTINEL ? undefined : cached;\n }\n const result = original.call(owner, a, b);\n seed2(a as object, b as object, result);\n return result;\n };\n (wrapped as any).gen = (original as any).gen;\n (wrapped as any).original = original;\n (wrapped as any).seed2 = seed2;\n Object.defineProperty(owner, name, { configurable: true, value: wrapped });\n}\n\n// the TS7 checker exposes its methods as prototype getters: shadow them on the instance.\n// Only single-object-argument calls are cached; anything else goes straight through.\nfunction memoizeUnaryMethod(owner: object, name: string): void {\n const original = owner[name];\n if (typeof original !== \"function\") {\n return;\n }\n const cache = new WeakMap();\n const wrapped = function (this: unknown, ...args: unknown[]) {\n const key = args[0];\n if (args.length !== 1 || key === null || typeof key !== \"object\" || Array.isArray(key)) {\n return original.apply(owner, args);\n }\n const cached = cache.get(key);\n if (cached !== undefined) {\n return cached === UNDEFINED_SENTINEL ? undefined : cached;\n }\n const result = original.call(owner, key);\n cache.set(key, result === undefined ? UNDEFINED_SENTINEL : result);\n return result;\n };\n (wrapped as any).gen = (original as any).gen;\n (wrapped as any).original = original;\n // prefetch support: seed(key, value) fills the cache; has(key) tells whether it is filled\n (wrapped as any).seed = (key: object, value: unknown) => cache.set(key, value === undefined ? UNDEFINED_SENTINEL : value);\n (wrapped as any).has = (key: object) => cache.has(key);\n Object.defineProperty(owner, name, { configurable: true, value: wrapped });\n}\n\nfunction memoizeBinaryKindMethod(owner: object, name: string): void {\n const unary = owner[name];\n const original = (unary as any)?.original ?? unary;\n if (typeof original !== \"function\") {\n return;\n }\n const caches = new Map>();\n const wrapped = function (this: unknown, ...args: unknown[]) {\n const key = args[0];\n if (args.length === 1) {\n return unary.call(owner, key);\n }\n if (args.length !== 2 || key === null || typeof key !== \"object\" || typeof args[1] !== \"number\") {\n return original.apply(owner, args);\n }\n let cache = caches.get(args[1]);\n if (cache === undefined) {\n caches.set(args[1], cache = new WeakMap());\n }\n const cached = cache.get(key);\n if (cached !== undefined) {\n return cached === UNDEFINED_SENTINEL ? undefined : cached;\n }\n const result = original.call(owner, key, args[1]);\n cache.set(key, result === undefined ? UNDEFINED_SENTINEL : result);\n return result;\n };\n (wrapped as any).gen = (original as any).gen;\n Object.defineProperty(owner, name, { configurable: true, value: wrapped });\n}\n\n// Batch pre-resolve: walk `root` once and resolve, in one round trip per method, the\n// types/symbols of the node kinds the printers ask about, seeding the memo caches above.\n// Results are identical to per-node calls; nodes the printers never ask about only cost payload.\nconst PREFETCH_TYPE_KINDS = new Set([\n SyntaxKind.Identifier, SyntaxKind.PropertyAccessExpression, SyntaxKind.ElementAccessExpression,\n SyntaxKind.CallExpression, SyntaxKind.BinaryExpression, SyntaxKind.StringLiteral, SyntaxKind.TypeReference,\n SyntaxKind.MethodDeclaration, SyntaxKind.AnyKeyword, SyntaxKind.StringKeyword, SyntaxKind.NumberKeyword,\n SyntaxKind.ArrayType, SyntaxKind.NumericLiteral,\n]);\nconst PREFETCH_BATCH = 4096;\nfunction prefetchChecker(checker: Checker, root: Node, options: { types?: boolean, symbols?: boolean, signatures?: boolean } = {}): void {\n const wantTypes = options.types ?? true, wantSymbols = options.symbols ?? true, wantSignatures = options.signatures ?? true;\n const getType = checker.getTypeAtLocation as any, getSymbol = checker.getSymbolAtLocation as any, getSig = checker.getResolvedSignature as any;\n const typeNodes: Node[] = [], symbolNodes: Node[] = [], callNodes: Node[] = [];\n const visit = (node: Node) => {\n const kind = node.kind;\n if (wantTypes && PREFETCH_TYPE_KINDS.has(kind) && !getType.has?.(node)) typeNodes.push(node);\n if (wantSymbols && kind === SyntaxKind.Identifier && !getSymbol.has?.(node)) symbolNodes.push(node);\n if (wantSignatures && kind === SyntaxKind.CallExpression && !getSig.has?.(node)) callNodes.push(node);\n node.forEachChild(visit);\n };\n visit(root);\n const run = (nodes: Node[], fn: any) => {\n if (fn?.seed === undefined || fn.original === undefined) return;\n for (let i = 0; i < nodes.length; i += PREFETCH_BATCH) {\n const chunk = nodes.slice(i, i + PREFETCH_BATCH);\n let results: unknown[];\n try {\n results = fn.original(chunk);\n } catch {\n continue; // leave this chunk to the lazy per-node path\n }\n chunk.forEach((n, j) => fn.seed(n, results[j]));\n }\n };\n run(typeNodes, getType);\n run(symbolNodes, getSymbol);\n // no bulk getResolvedSignature: pipeline the per-call requests through api.batch\n const api = (checker as any).__astTranspilerApi as API | undefined;\n if (callNodes.length > 0 && getSig?.seed !== undefined && api !== undefined && getSig.original?.gen !== undefined) {\n for (let i = 0; i < callNodes.length; i += PREFETCH_BATCH) {\n const chunk = callNodes.slice(i, i + PREFETCH_BATCH);\n const gens = chunk.map((n) => {\n const g = getSig.original.gen(n);\n // a call the checker cannot resolve must not fail the whole batch\n return (function* () { try { return yield* g; } catch { return PREFETCH_FAILED; } })();\n });\n const results = api.batch(...gens) as unknown[];\n chunk.forEach((n, j) => { if (results[j] !== PREFETCH_FAILED) getSig.seed(n, results[j]); });\n }\n }\n if (wantSignatures && api !== undefined) {\n prefetchDeclarationSignatures(checker, api, root);\n }\n}\n\n// Warm the per-declaration chains baseTranspiler walks for every method/function\n// (getFunctionType, getReturnTypeFromMethod) in one pipelined batch per level\nfunction prefetchDeclarationSignatures(checker: Checker, api: API, root: Node): void {\n const getSigDecl = checker.getSignatureFromDeclaration as any;\n const getTypeOfSymbolAtLocation = (checker as any).getTypeOfSymbolAtLocation;\n if (getSigDecl?.seed === undefined || getSigDecl.original?.gen === undefined) return;\n const decls: Node[] = [];\n const visit = (node: Node) => {\n if (node.kind === SyntaxKind.MethodDeclaration || node.kind === SyntaxKind.FunctionDeclaration) decls.push(node);\n node.forEachChild(visit);\n };\n visit(root);\n const safe = (g: Generator) => (function* () { try { return yield* g; } catch { return PREFETCH_FAILED; } })();\n for (let i = 0; i < decls.length; i += PREFETCH_BATCH) {\n const chunk = decls.slice(i, i + PREFETCH_BATCH);\n api.batch(...chunk.map((decl) => safe((function* () {\n const sig = getSigDecl.has(decl) ? getSigDecl(decl) : yield* getSigDecl.original.gen(decl);\n getSigDecl.seed(decl, sig);\n if (sig !== undefined) yield* sig.getReturnType.gen();\n })())));\n // getReturnTypeFromMethod: type -> symbol -> type of symbol at its declaration -> call signatures\n api.batch(...chunk.map((decl) => safe((function* () {\n const type = checker.getTypeAtLocation(decl) as any;\n const symbol = type?.getSymbol?.gen !== undefined ? yield* type.getSymbol.gen() : undefined;\n const location = symbol?.valueDeclaration?.resolve();\n if (location === undefined || getTypeOfSymbolAtLocation?.seed2 === undefined) return;\n const symbolType = yield* getTypeOfSymbolAtLocation.original.gen(symbol, location);\n getTypeOfSymbolAtLocation.seed2(symbol, location, symbolType);\n yield* symbolType.getCallSignatures.gen();\n })())));\n }\n}\nconst PREFETCH_FAILED = Symbol(\"prefetchFailed\");\nconst prefetchedFiles = new WeakSet();\n\n// program-wide diagnostics are identical for every file of a program: fetch them once\ntype ProgramWideDiagnostics = { program: readonly { text: string }[], global: readonly { text: string }[] };\nconst programDiagnosticsCache = new WeakMap();\nfunction getProgramWideDiagnostics(program: Program): ProgramWideDiagnostics {\n let diagnostics = programDiagnosticsCache.get(program);\n if (diagnostics === undefined) {\n diagnostics = { program: program.getProgramDiagnostics(), global: program.getGlobalDiagnostics() };\n programDiagnosticsCache.set(program, diagnostics);\n }\n return diagnostics;\n}\n\n// one TS7 API server per isolate unless a cache brings its own\nlet processApi: API | undefined;\nfunction getApi(cache: ITranspileProgramCache): API {\n cache.api ??= (processApi ??= new API({ cwd: process.cwd() }));\n return cache.api;\n}\n\n// a snapshot with one synthetic program over rootFiles; `files` overlays virtual file contents\nfunction createSnapshotProgram(cache: ITranspileProgramCache, rootFiles: string[], files: Record): [Snapshot, Program, Checker] {\n const snapshot = getApi(cache).createSnapshot({\n fileSystem: { kind: \"layer\", files },\n createPrograms: [{ rootFiles: rootFiles.map((f) => path.resolve(f)), compilerOptions: fastCompilerOptions }],\n });\n const program = snapshot.operation.createdPrograms[0];\n const checker = snapshot.getProjects().find((p) => p.program === program).checker;\n memoizeCheckerCalls(checker);\n (checker as any).__astTranspilerApi = getApi(cache);\n return [snapshot, program, checker];\n}\n\nexport default class Transpiler {\n config;\n pythonTranspiler: PythonTranspiler;\n phpTranspiler: PhpTranspiler;\n csharpTranspiler: CSharpTranspiler;\n goTranspiler: GoTranspiler;\n javaTranspiler: JavaTranspiler;\n rustTranspiler: RustTranspiler;\n cppTranspiler: CppTranspiler;\n // ByPath transpilation cache: parsed SourceFiles (libs + the whole import graph)\n // are reused across createProgram calls — without this every transpile*ByPath call\n // re-parses the full import closure of the target file (~1s+ per file on big repos).\n // Lives in a standalone object so several Transpiler instances on the same thread\n // can be pointed at one cache (see Transpiler.createProgramCache).\n private programCache: ITranspileProgramCache;\n // typescript state of the transpilation in flight, shared with the language printers\n private context: ITranspileContext | undefined;\n // the snapshot behind the current single-file context\n private snapshot: Snapshot | undefined;\n // batch pre-resolve each source file's checker queries before printing it (config.prefetch=false disables)\n prefetch: boolean;\n\n // batch pre-resolve for callers that query the checker themselves (build hooks):\n // one round trip per method for every relevant node under `root`\n static prefetchChecker(checker: Checker, root: Node, options?: { types?: boolean, symbols?: boolean, signatures?: boolean }): void {\n prefetchChecker(checker, root, options);\n }\n\n // A program cache holds parsed typescript SourceFiles and the last program built\n // from them. Hand the same cache to several Transpiler instances to reuse one\n // parse/typecheck of the es lib chain and of every shared import across all of\n // them. Callers that need isolation simply omit it and get a private cache.\n //\n // Same-thread only: these are live V8 objects, so a cache cannot be posted to a\n // worker_threads isolate — give each worker its own long-lived cache instead.\n static createProgramCache(): ITranspileProgramCache {\n return {};\n }\n\n constructor(config = {}, programCache?: ITranspileProgramCache) {\n this.config = config;\n this.programCache = programCache ?? Transpiler.createProgramCache();\n this.prefetch = config[\"prefetch\"] ?? true;\n const phpConfig = config[\"php\"] || {};\n const pythonConfig = config[\"python\"] || {};\n const csharpConfig = config[\"csharp\"] || {};\n const goConfig = config[\"go\"] || {};\n const javaConfig = config[\"java\"] || {};\n const rustConfig = config[\"rust\"] || {};\n const cppConfig = config[\"cpp\"] || {};\n\n if (\"verbose\" in config) {\n Logger.setVerboseMode(Boolean(config['verbose']));\n }\n\n this.pythonTranspiler = new PythonTranspiler(pythonConfig);\n this.phpTranspiler = new PhpTranspiler(phpConfig);\n this.csharpTranspiler = new CSharpTranspiler(csharpConfig);\n this.goTranspiler = new GoTranspiler(goConfig);\n this.javaTranspiler = new JavaTranspiler(javaConfig);\n this.rustTranspiler = new RustTranspiler(rustConfig);\n this.cppTranspiler = new CppTranspiler(cppConfig);\n }\n\n setVerboseMode(verbose: boolean) {\n Logger.setVerboseMode(verbose);\n }\n\n // the cache this instance parses into, to hand to further Transpiler instances\n // that should reuse this one's parsed SourceFiles\n getProgramCache(): ITranspileProgramCache {\n return this.programCache;\n }\n\n // a second Transpiler over the same parsed typescript state, with its own\n // printers and its own transpile context, so both can be driven independently\n // on this thread without either clobbering the other's program\n cloneSharingProgramCache(config = this.config): Transpiler {\n return new Transpiler(config, this.programCache);\n }\n\n // single-file snapshots are released when the next one replaces them; batches own theirs\n private setSnapshotContext(snapshot: Snapshot, program: Program, checker: Checker, fileName: string): ITranspileContext {\n const src = program.getSourceFile(fileName) ?? program.getSourceFile(path.resolve(fileName));\n const previous = this.snapshot;\n this.snapshot = snapshot;\n previous?.dispose();\n return this.setContext({ src, checker, program });\n }\n\n createProgramInMemoryAndSetContext(content): ITranspileContext {\n const inMemoryFilePath = path.resolve(path.join(__dirname_mock, \"__dummy-file.ts\"));\n const [snapshot, program, checker] = createSnapshotProgram(this.programCache, [inMemoryFilePath, globalsShimPath], {\n [inMemoryFilePath]: content,\n [globalsShimPath]: globalsShim,\n });\n return this.setSnapshotContext(snapshot, program, checker, inMemoryFilePath);\n }\n\n createProgramByPathAndSetContext(filePath): ITranspileContext {\n const shared = this.findSharedProgramFile(filePath);\n if (shared !== undefined) {\n return this.setContext(shared);\n }\n const [snapshot, program, checker] = createSnapshotProgram(this.programCache, [filePath, globalsShimPath], { [globalsShimPath]: globalsShim });\n return this.setSnapshotContext(snapshot, program, checker, filePath);\n }\n\n // One snapshot/program for a whole run: later ByPath transpiles of any root (or\n // imported file) of `paths` reuse it instead of building a program per file, as\n // long as the file's text on disk still equals the snapshot's. Replaces any\n // previous shared program; pass [] to drop it.\n setSharedProgram(paths: string[]): void {\n this.programCache.shared?.snapshot.dispose();\n this.programCache.shared = undefined;\n if (paths.length === 0) {\n return;\n }\n const [snapshot, program, checker] = createSnapshotProgram(this.programCache, [...paths, globalsShimPath], { [globalsShimPath]: globalsShim });\n this.programCache.shared = { snapshot, program, checker };\n }\n\n private findSharedProgramFile(filePath: string): ITranspileContext | undefined {\n const shared = this.programCache.shared;\n if (shared === undefined) {\n return undefined;\n }\n const src = shared.program.getSourceFile(path.resolve(filePath));\n if (src === undefined || !fs.existsSync(filePath) || fs.readFileSync(filePath, \"utf8\") !== src.text) {\n return undefined;\n }\n return { src, checker: shared.checker, program: shared.program };\n }\n\n // One program over N root files, so the bind/check work behind the diagnostics\n // pass is paid once for the whole set; files importing each other are fine as\n // separate roots. The batch owns its snapshot until dispose().\n createProgramBatch(paths: string[]): TranspileProgramBatch {\n const [snapshot, program, checker] = createSnapshotProgram(this.programCache, [...paths, globalsShimPath], { [globalsShimPath]: globalsShim });\n return new TranspileProgramBatch(this, snapshot, program, checker);\n }\n\n // the language printers read the typescript state (source file, checker, program)\n // off the context handed to them here, so two Transpiler instances never share\n // state and a nested transpile can restore whatever its caller was working on\n setContext(context: ITranspileContext): ITranspileContext {\n this.context = context;\n this.pythonTranspiler.setContext(context);\n this.phpTranspiler.setContext(context);\n this.csharpTranspiler.setContext(context);\n this.goTranspiler.setContext(context);\n this.javaTranspiler.setContext(context);\n this.rustTranspiler.setContext(context);\n this.cppTranspiler.setContext(context);\n return context;\n }\n\n /** @deprecated renamed to createProgramInMemoryAndSetContext */\n createProgramInMemoryAndSetGlobals(content): ITranspileContext {\n return this.createProgramInMemoryAndSetContext(content);\n }\n\n /** @deprecated renamed to createProgramByPathAndSetContext */\n createProgramByPathAndSetGlobals(path): ITranspileContext {\n return this.createProgramByPathAndSetContext(path);\n }\n\n checkFileDiagnostics(context: ITranspileContext = this.context) {\n // the pass only produces a Logger warning; on TS7 getGlobalDiagnostics forces a\n // whole-program check in tsgo, so skip it when nothing would be printed\n if (!Logger.verbose) {\n return;\n }\n const fileName = context.src.fileName;\n const programWide = getProgramWideDiagnostics(context.program);\n const diagnostics = [\n ...programWide.program,\n ...context.program.getSyntacticDiagnostics(fileName), ...programWide.global,\n ...context.program.getSemanticDiagnostics(fileName),\n ];\n if (diagnostics.length > 0) {\n let errorMessage = \"Errors found in the typescript code. Transpilation might produce invalid results:\\n\";\n diagnostics.forEach( msg => {\n errorMessage+= \" - \" + msg.text + \"\\n\";\n });\n Logger.warning(errorMessage);\n }\n }\n\n transpile(lang: Languages, mode: TranspilationMode, file: string, sync = false, createContext = true, handleImports = true): ITranspiledFile {\n // improve this logic later\n if (createContext) {\n if (mode === TranspilationMode.ByPath) {\n this.createProgramByPathAndSetContext(file);\n } else {\n this.createProgramInMemoryAndSetContext(file);\n }\n\n // check for warnings and errors\n this.checkFileDiagnostics();\n }\n\n const src = this.context.src;\n if (this.prefetch && !prefetchedFiles.has(src)) {\n prefetchedFiles.add(src);\n prefetchChecker(this.context.checker, src);\n }\n\n let transpiledContent = undefined;\n switch(lang) {\n case Languages.Python:\n this.pythonTranspiler.asyncTranspiling = !sync;\n transpiledContent = this.pythonTranspiler.printNode(src, -1);\n this.pythonTranspiler.asyncTranspiling = true; // reset to default\n break;\n case Languages.Php:\n this.phpTranspiler.asyncTranspiling = !sync;\n transpiledContent = this.phpTranspiler.printNode(src, -1);\n this.phpTranspiler.asyncTranspiling = true; // reset to default\n break;\n case Languages.CSharp:\n transpiledContent = this.csharpTranspiler.printNode(src, -1);\n break;\n case Languages.Go:\n // gofmt aligns trailing `//` comments through its tabwriter; the printer has to do\n // that itself so the emitted Go is already gofmt-clean (see alignGoTrailingComments)\n transpiledContent = alignGoTrailingComments (this.goTranspiler.printNode(src, -1));\n break;\n case Languages.Java:\n transpiledContent = this.javaTranspiler.printNode(src, -1);\n break;\n case Languages.Rust:\n transpiledContent = this.rustTranspiler.printNode(src, -1);\n break;\n case Languages.Cpp:\n transpiledContent = this.cppTranspiler.printNode(src, -1);\n break;\n }\n let imports = [];\n let exports = [];\n\n if (handleImports) {\n imports = this.pythonTranspiler.getFileImports(src);\n exports = this.pythonTranspiler.getFileExports(src);\n }\n\n const methodsTypes = this.pythonTranspiler.getMethodTypes(src);\n Logger.success(\"transpilation finished successfully\");\n\n return {\n content: transpiledContent,\n imports,\n exports,\n methodsTypes\n };\n }\n\n transpileDifferentLanguagesGeneric(mode: TranspilationMode, input: IInput[], content: string): ITranspiledFile[] {\n let context: ITranspileContext;\n if (mode === TranspilationMode.ByPath) {\n context = this.createProgramByPathAndSetContext(content);\n } else {\n context = this.createProgramInMemoryAndSetContext(content);\n }\n\n // check for warnings and errors\n this.checkFileDiagnostics(context);\n\n const files = [];\n input.forEach( (inp) => {\n const async = inp.async;\n\n files.push({\n content: this.transpile(inp.language, mode, content, !async, false, false).content\n });\n });\n\n const methodsTypes = this.pythonTranspiler.getMethodTypes(context.src);\n\n const imports = this.pythonTranspiler.getFileImports(context.src);\n const exports = this.pythonTranspiler.getFileExports(context.src);\n\n const output = files.map( (file) => {\n return {\n content: file.content,\n imports,\n exports,\n methodsTypes\n };\n });\n\n return output;\n }\n\n transpileDifferentLanguages(input: any[], content: string): ITranspiledFile[] {\n const config = input.map( (inp) => {\n return {\n language: this.convertStringToLanguageEnum(inp.language),\n async: inp.async\n };\n } );\n return this.transpileDifferentLanguagesGeneric(TranspilationMode.ByContent, config, content);\n }\n\n transpileDifferentLanguagesByPath(input: any[], content: string): ITranspiledFile[] {\n const config = input.map( (inp) => {\n return {\n language: this.convertStringToLanguageEnum(inp.language),\n async: inp.async\n };\n } );\n return this.transpileDifferentLanguagesGeneric(TranspilationMode.ByPath, config, content);\n }\n\n transpilePython(content): ITranspiledFile {\n return this.transpile(Languages.Python, TranspilationMode.ByContent, content, !this.pythonTranspiler.asyncTranspiling);\n }\n\n transpilePythonByPath(path): ITranspiledFile {\n return this.transpile(Languages.Python, TranspilationMode.ByPath, path, !this.pythonTranspiler.asyncTranspiling);\n }\n\n transpilePhp(content): ITranspiledFile {\n return this.transpile(Languages.Php, TranspilationMode.ByContent, content, !this.phpTranspiler.asyncTranspiling);\n }\n\n transpilePhpByPath(path): ITranspiledFile {\n return this.transpile(Languages.Php, TranspilationMode.ByPath, path, !this.phpTranspiler.asyncTranspiling);\n }\n\n transpileCSharp(content): ITranspiledFile {\n return this.transpile(Languages.CSharp, TranspilationMode.ByContent, content);\n }\n\n transpileCSharpByPath(path): ITranspiledFile {\n return this.transpile(Languages.CSharp, TranspilationMode.ByPath, path);\n }\n\n transpileJava(content): ITranspiledFile {\n return this.transpile(Languages.Java, TranspilationMode.ByContent, content);\n }\n\n transpileJavaByPath(path): ITranspiledFile {\n return this.transpile(Languages.Java, TranspilationMode.ByPath, path);\n }\n\n transpileGoByPath(path): ITranspiledFile {\n return this.transpile(Languages.Go, TranspilationMode.ByPath, path);\n }\n\n transpileGo(content): ITranspiledFile {\n return this.transpile(Languages.Go, TranspilationMode.ByContent, content);\n }\n\n transpileRust(content): ITranspiledFile {\n return this.transpile(Languages.Rust, TranspilationMode.ByContent, content);\n }\n\n transpileRustByPath(path): ITranspiledFile {\n return this.transpile(Languages.Rust, TranspilationMode.ByPath, path);\n }\n\n transpileCpp(content): ITranspiledFile {\n return this.transpile(Languages.Cpp, TranspilationMode.ByContent, content);\n }\n\n transpileCppByPath(path): ITranspiledFile {\n return this.transpile(Languages.Cpp, TranspilationMode.ByPath, path);\n }\n\n\n getFileImports(content: string): IFileImport[] {\n const context = this.createProgramInMemoryAndSetContext(content);\n return this.phpTranspiler.getFileImports(context.src);\n }\n\n getFileExports(content: string): IFileExport[] {\n const context = this.createProgramInMemoryAndSetContext(content);\n return this.phpTranspiler.getFileExports(context.src);\n }\n\n setPHPPropResolution(props: string[]) {\n this.phpTranspiler.propRequiresScopeResolutionOperator = props;\n }\n\n setPhpUncamelCaseIdentifiers(uncamelCase: boolean) {\n this.phpTranspiler.uncamelcaseIdentifiers = uncamelCase;\n }\n\n setPythonUncamelCaseIdentifiers(uncamelCase: boolean) {\n this.pythonTranspiler.uncamelcaseIdentifiers = uncamelCase;\n }\n\n setPhpAsyncTranspiling(async: boolean) {\n this.phpTranspiler.asyncTranspiling = async;\n }\n\n setPythonAsyncTranspiling(async: boolean) {\n this.pythonTranspiler.asyncTranspiling = async;\n }\n\n setPythonStringLiteralReplacements(replacements): void {\n this.pythonTranspiler.StringLiteralReplacements = replacements;\n }\n\n convertStringToLanguageEnum(lang: string): Languages {\n switch(lang) {\n case \"python\":\n return Languages.Python;\n case \"php\":\n return Languages.Php;\n case \"csharp\":\n return Languages.CSharp;\n case \"go\":\n return Languages.Go;\n case \"java\":\n return Languages.Java;\n case \"rust\":\n return Languages.Rust;\n case \"cpp\":\n return Languages.Cpp;\n }\n }\n}\n\n// A set of root files compiled as one typescript program, transpiled one at a time.\n// Obtained from Transpiler.createProgramBatch; mirrors the transpile*ByPath methods\n// of the Transpiler it came from, so a caller batches by replacing\n// for (const f of files) transpiler.transpileGoByPath(f)\n// with\n// const batch = transpiler.createProgramBatch(files);\n// for (const f of files) batch.transpileGoByPath(f)\n//\n// A failing file throws out of its own call and leaves the batch usable: the context\n// is rebuilt from the program on every call, so the caller can try/catch per file and\n// keep going. The batch borrows the Transpiler's printers and context, so do not\n// drive that Transpiler through another path while a batch loop is in flight — use\n// cloneSharingProgramCache() for a second, independent driver.\nclass TranspileProgramBatch {\n private readonly transpiler: Transpiler;\n private readonly snapshot: Snapshot;\n private readonly program: Program;\n private readonly checker: Checker;\n\n constructor(transpiler: Transpiler, snapshot: Snapshot, program: Program, checker: Checker) {\n this.transpiler = transpiler;\n this.snapshot = snapshot;\n this.program = program;\n this.checker = checker;\n }\n\n // releases the batch's snapshot on the TS7 server; the batch is unusable afterwards\n dispose(): void {\n this.snapshot.dispose();\n }\n\n getProgram(): Program {\n return this.program;\n }\n\n // point the owning Transpiler at one file of this batch, then run the same\n // diagnostics pass the single-file path runs\n setContextForPath(filePath: string): ITranspileContext {\n const src = this.program.getSourceFile(filePath) ?? this.program.getSourceFile(path.resolve(filePath));\n if (src === undefined) {\n throw new Error(`ast-transpiler: \"${filePath}\" is not a file of this program batch`);\n }\n const context = this.transpiler.setContext({ src, checker: this.checker, program: this.program });\n this.transpiler.checkFileDiagnostics(context);\n return context;\n }\n\n transpileByPath(lang: Languages, filePath: string, sync = false): ITranspiledFile {\n this.setContextForPath(filePath);\n return this.transpiler.transpile(lang, TranspilationMode.ByPath, filePath, sync, false);\n }\n\n transpilePythonByPath(filePath: string): ITranspiledFile {\n return this.transpileByPath(Languages.Python, filePath, !this.transpiler.pythonTranspiler.asyncTranspiling);\n }\n\n transpilePhpByPath(filePath: string): ITranspiledFile {\n return this.transpileByPath(Languages.Php, filePath, !this.transpiler.phpTranspiler.asyncTranspiling);\n }\n\n transpileCSharpByPath(filePath: string): ITranspiledFile {\n return this.transpileByPath(Languages.CSharp, filePath);\n }\n\n transpileGoByPath(filePath: string): ITranspiledFile {\n return this.transpileByPath(Languages.Go, filePath);\n }\n\n transpileJavaByPath(filePath: string): ITranspiledFile {\n return this.transpileByPath(Languages.Java, filePath);\n }\n\n transpileRustByPath(filePath: string): ITranspiledFile {\n return this.transpileByPath(Languages.Rust, filePath);\n }\n\n transpileCppByPath(filePath: string): ITranspiledFile {\n return this.transpileByPath(Languages.Cpp, filePath);\n }\n}\n\nexport {\n Transpiler,\n TranspileProgramBatch,\n // the TS7 flag enums of the typescript the generator runs on, for consumer hooks whose\n // own `typescript` resolution may be an older 7.x lacking them\n CheckFlags, ElementFlags, IndexKind, ObjectFlags, SignatureKind, SymbolFlags, TypeFlags, TypeFormatFlags,\n SyntaxKind,\n // the trailing-comment alignment pass, so a consumer that assembles its own Go files\n // (ccxt build/goTranspiler.ts) can run it on the assembled text as well\n alignGoTrailingComments,\n // the rust declared-Dict locals vocabulary + entry shape (rust-25), so the\n // helper-removal consumers can import them from the package entry\n RUST_DECLARED_DICT_LOCALS,\n};\nexport type { RustDeclaredDictLocalEntry };\n","import { BaseTranspiler } from \"./baseTranspiler.js\";\nimport { regexAll } from \"./utils.js\";\nimport { SyntaxKind } from \"typescript/unstable/ast\";\n\nconst parserConfig = {\n 'STATIC_TOKEN': '', // to do static decorator\n 'PUBLIC_KEYWORD': '',\n 'UNDEFINED_TOKEN': 'None',\n 'IF_TOKEN': 'if',\n 'ELSE_TOKEN': 'else',\n 'ELSEIF_TOKEN': 'elif',\n 'THIS_TOKEN': 'self',\n 'AMPERSTAND_APERSAND_TOKEN': 'and',\n 'BAR_BAR_TOKEN': 'or',\n 'SPACE_DEFAULT_PARAM': '',\n 'BLOCK_OPENING_TOKEN': ':',\n 'BLOCK_CLOSING_TOKEN': '',\n 'SPACE_BEFORE_BLOCK_OPENING': '',\n 'CONDITION_OPENING': '',\n 'CONDITION_CLOSE': '',\n 'TRUE_KEYWORD': 'True',\n 'FALSE_KEYWORD': 'False',\n 'THROW_TOKEN': 'raise',\n 'NOT_TOKEN': 'not ',\n 'PLUS_PLUS_TOKEN': ' += 1',\n 'MINUS_MINUS_TOKEN': ' -= 1',\n 'CONSTRUCTOR_TOKEN': 'def __init__',\n 'SUPER_CALL_TOKEN': 'super().__init__',\n 'PROPERTY_ASSIGNMENT_TOKEN': ':',\n 'FUNCTION_TOKEN': 'def',\n 'SUPER_TOKEN': 'super()',\n 'NEW_TOKEN': '',\n 'STRING_QUOTE_TOKEN': '\\'',\n 'LINE_TERMINATOR': '',\n 'METHOD_TOKEN': 'def',\n 'CATCH_TOKEN': 'except',\n 'CATCH_DECLARATION': 'Exception as',\n 'METHOD_DEFAULT_ACCESS': '',\n 'SPREAD_TOKEN': '*',\n 'NULL_TOKEN': 'None',\n};\nexport class PythonTranspiler extends BaseTranspiler {\n constructor(config = {}) {\n\n config['parser'] = Object.assign ({}, parserConfig, config['parser'] ?? {});\n\n super(config);\n this.id = \"python\";\n\n this.initConfig();\n this.asyncTranspiling = config['async'] ?? true;\n this.uncamelcaseIdentifiers = config['uncamelcaseIdentifiers'] ?? true;\n this.removeVariableDeclarationForFunctionExpression = config['removeVariableDeclarationForFunctionExpression'] ?? true;\n this.includeFunctionNameInFunctionExpressionDeclaration = config['includeFunctionNameInFunctionExpressionDeclaration'] ?? true;\n\n // user overrides\n this.applyUserOverrides(config);\n }\n\n initConfig() {\n this.LeftPropertyAccessReplacements = {\n 'this': 'self'\n };\n this.RightPropertyAccessReplacements = {\n 'push': 'append',\n 'toUpperCase': 'upper',\n 'toLowerCase': 'lower',\n // 'parseFloat': 'float',\n // 'parseInt': 'int',\n 'indexOf': 'find',\n 'padEnd': 'ljust',\n 'padStart': 'rjust'\n };\n this.FullPropertyAccessReplacements = {\n 'console.log': 'print',\n 'JSON.stringify': 'json.dumps',\n 'JSON.parse': 'json.loads',\n 'Math.log': 'math.log',\n 'Math.abs': 'abs',\n 'Math.min': 'min',\n 'Math.max': 'max',\n 'Math.ceil': 'math.ceil',\n 'Math.round': 'math.round',\n 'Math.floor': 'math.floor',\n 'Math.pow': 'math.pow',\n 'process.exit': 'sys.exit',\n 'Number.MAX_SAFE_INTEGER': 'float(\\'inf\\')',\n };\n this.CallExpressionReplacements = {\n 'parseInt': 'int',\n 'parseFloat': 'float',\n };\n\n this.PropertyAccessRequiresParenthesisRemoval = [\n // 'length',\n // 'toString',\n ];\n }\n\n printArrayIsArrayCall(node, identation, parsedArg = undefined) {\n return `isinstance(${parsedArg}, list)`;\n }\n\n printObjectKeysCall(node, identation, parsedArg = undefined) {\n return `list(${parsedArg}.keys())`;\n }\n\n printObjectValuesCall(node, identation, parsedArg = undefined) {\n return `list(${parsedArg}.values())`;\n }\n\n printPromiseAllCall(node, identation, parsedArg) {\n return `asyncio.gather(*${parsedArg})`;\n }\n\n printMathFloorCall(node, identation, parsedArg = undefined) {\n return `int(math.floor(${parsedArg}))`;\n }\n\n printMathCeilCall(node, identation, parsedArg = undefined) {\n return `int(math.ceil(${parsedArg}))`;\n }\n\n printNumberIsIntegerCall(node, identation , parsedArg = undefined) {\n return `isinstance(${parsedArg}, int)`;\n }\n\n printMathRoundCall(node, identation, parsedArg = undefined) {\n return `int(round(${parsedArg}))`;\n }\n\n printIncludesCall(node, identation, name?, parsedArg?) {\n return `${parsedArg} in ${name}`;\n }\n\n printJoinCall(node: any, identation: any, name?: any, parsedArg?: any) {\n return `${parsedArg}.join(${name})`;\n }\n\n printSplitCall(node: any, identation: any, name?: any, parsedArg?: any) {\n return `${name}.split(${parsedArg})`;\n }\n\n printConcatCall(node: any, identation: any, name?: any, parsedArg?: any) {\n return `${name} + ${parsedArg}`;\n }\n\n printPopCall(node: any, identation: any, name?: any) {\n return `${name}.pop()`;\n }\n\n printShiftCall(node: any, identation: any, name?: any) {\n return `${name}.pop(0)`;\n }\n\n printReverseCall(node, identation, name = undefined) {\n return `${name}.reverse()`;\n }\n\n printArrayPushCall(node, identation, name, parsedArg) {\n return `${name}.append(${parsedArg})`;\n }\n\n printToStringCall(node, identation, name = undefined) {\n return `str(${name})`;\n }\n\n printIndexOfCall(node, identation, name = undefined, parsedArg = undefined) {\n return `${name}.find(${parsedArg})`;\n }\n\n printSearchCall(node, identation, name = undefined, parsedArg = undefined) {\n return `${name}.find(${parsedArg})`;\n }\n\n printStartsWithCall(node, identation, name = undefined, parsedArg = undefined) {\n return `${name}.startswith(${parsedArg})`;\n }\n\n printEndsWithCall(node, identation, name = undefined, parsedArg = undefined) {\n return `${name}.endswith(${parsedArg})`;\n }\n\n printPadEndCall(node, identation, name, parsedArg, parsedArg2) {\n return `${name}.ljust(${parsedArg}, ${parsedArg2})`;\n }\n\n printPadStartCall(node, identation, name, parsedArg, parsedArg2) {\n return `${name}.rjust(${parsedArg}, ${parsedArg2})`;\n }\n\n printTrimCall(node, identation, name = undefined) {\n return `${name}.strip()`;\n }\n\n printToUpperCaseCall(node, identation, name = undefined) {\n return `${name}.upper()`;\n }\n\n printToLowerCaseCall(node, identation, name = undefined) {\n return `${name}.lower()`;\n }\n\n printJsonParseCall(node: any, identation: any, parsedArg?: any) {\n return `json.loads(${parsedArg})`;\n }\n\n printJsonStringifyCall(node: any, identation: any, parsedArg?: any) {\n return `json.dumps(${parsedArg})`;\n }\n\n printReplaceCall(node: any, identation: any, name?: any, parsedArg?: any, parsedArg2?: any) {\n return `${name}.replace(${parsedArg}, ${parsedArg2})`;\n }\n\n printReplaceAllCall(node: any, identation: any, name?: any, parsedArg?: any, parsedArg2?: any) {\n return `${name}.replace(${parsedArg}, ${parsedArg2})`;\n }\n\n printElementAccessExpressionExceptionIfAny(node) {\n if (node.expression.kind === SyntaxKind.ThisKeyword) {\n return \"getattr(self, \" + this.printNode(node.argumentExpression, 0) + \")\";\n }\n }\n\n printAssertCall(node, identation, parsedArgs) {\n return `assert ${parsedArgs}`;\n }\n\n printDateNowCall(node, identation) {\n return \"int(time.time() * 1000)\";\n }\n\n\n printForStatement(node, identation) {\n const varName = node.initializer.declarations[0].name.text;\n const initValue = this.printNode(node.initializer.declarations[0].initializer, 0);\n const roofValue = this.printNode(node.condition.right,0);\n\n const forStm = this.getIden(identation) + this.FOR_TOKEN + \" \" + varName + \" in range(\" + initValue + \", \" + roofValue + \"):\\n\" + node.statement.statements.map(st => this.printNode(st, identation+1)).join(\"\\n\");\n return this.printNodeCommentsIfAny(node, identation, forStm);\n }\n\n printPropertyAccessModifiers(node) {\n return \"\"; // no access modifier in python\n }\n\n transformLeadingComment(comment) {\n const commentRegex = [\n [ /(^|\\s)\\/\\//g, '$1#' ], // regular comments\n [ /\\/\\*\\*/, '\\\"\\\"\\\"' ], // eslint-disable-line\n [ / \\*\\//, '\\\"\\\"\\\"' ], // eslint-disable-line\n [ /\\[([^\\[\\]]*)\\]\\{@link (.*)\\}/g, '`$1 <$2>`' ], // eslint-disable-line\n [ /\\s+\\* @method/g, '' ], // docstring @method\n [ /(\\s+) \\* @description (.*)/g, '$1$2' ], // docstring description\n [ /\\s+\\* @name .*/g, '' ], // docstring @name\n [ /(\\s+) \\* @see( .*)/g, '$1see$2' ], // docstring @see\n [ /(\\s+ \\* @(param|returns) {[^}]*)string([^}]*}.*)/g, '$1str$3' ], // docstring type conversion\n [ /(\\s+ \\* @(param|returns) {[^}]*)object([^}]*}.*)/g, '$1dict$3' ], // doctstrubg type conversion\n [ /(\\s+) \\* @returns ([^\\{])/g, '$1:returns: $2' ], // eslint-disable-line\n [ /(\\s+) \\* @returns \\{(.+)\\}/g, '$1:returns $2:' ], // docstring return\n [ /(\\s+ \\* @param \\{[\\]\\[\\|a-zA-Z]+\\} )([a-zA-Z0-9_-]+)\\.([a-zA-Z0-9_-]+) (.*)/g, '$1$2[\\'$3\\'] $4' ], // eslint-disable-line\n [ /(\\s+) \\* @([a-z]+) \\{([\\]\\[a-zA-Z\\|]+)\\} ([a-zA-Z0-9_\\-\\.\\[\\]\\']+)/g, '$1:$2 $3 $4:' ], // eslint-disable-line\n ];\n\n const transformed = regexAll(comment, commentRegex);\n return transformed;\n }\n\n transformTrailingComment(comment) {\n const commentRegex = [\n [ /(^|\\s)\\/\\//g, '$1#' ], // regular comments\n ];\n\n const transformed = regexAll(comment, commentRegex);\n return \" \" + transformed;\n }\n\n transformPropertyAcessExpressionIfNeeded(node: any) {\n const expression = node.expression;\n const leftSide = this.printNode(expression, 0);\n const rightSide = node.name.text;\n\n let rawExpression = undefined;\n\n if (rightSide === \"length\") {\n rawExpression = \"len(\" + leftSide + \")\";\n } else if (rightSide === \"toString\") {\n rawExpression = \"str(\" + leftSide + \")\";\n }\n return rawExpression;\n }\n\n printClassDefinition(node: any, identation: any): string {\n const className = node.name.text;\n const heritageClauses = node.heritageClauses;\n\n let classInit = \"\";\n if (heritageClauses !== undefined) {\n const classExtends = heritageClauses[0].types[0].expression.text;\n classInit = this.getIden(identation) + \"class \" + className + \"(\" + classExtends + \"):\\n\";\n } else {\n classInit = this.getIden(identation) + \"class \" + className + \":\\n\";\n }\n return classInit;\n }\n\n isFunctionOutSideClass(node) {\n return !(node.parent && node.parent.kind === SyntaxKind.ClassDeclaration);\n }\n\n printMethodParameters(node) {\n let parsedArgs = super.printMethodParameters(node);\n const shouldAddSelf = !this.isFunctionOutSideClass(node);\n parsedArgs = shouldAddSelf ? (parsedArgs ? \"self, \" + parsedArgs : \"self\") : parsedArgs;\n return parsedArgs;\n }\n\n printInstanceOfExpression(node, identation) {\n const left = this.printNode(node.left, 0);\n const right = this.printNode(node.right, 0);\n return this.getIden(identation) + `isinstance(${left}, ${right})`;\n }\n\n handleTypeOfInsideBinaryExpression(node, identation) {\n const expression = node.left.expression;\n const right = node.right.text;\n\n const op = node.operatorToken.kind;\n const isDifferentOperator = op === SyntaxKind.ExclamationEqualsEqualsToken || op === SyntaxKind.ExclamationEqualsToken;\n const notOperator = isDifferentOperator ? this.NOT_TOKEN : \"\";\n\n switch (right) {\n case \"string\":\n return this.getIden(identation) + notOperator + \"isinstance(\" + this.printNode(expression, 0) + \", str)\";\n case \"number\":\n return this.getIden(identation) + notOperator + \"isinstance(\" + this.printNode(expression, 0) + \", numbers.Real)\";\n case \"boolean\":\n return this.getIden(identation) + notOperator + \"isinstance(\" + this.printNode(expression, 0) + \", bool)\";\n case \"object\":\n return this.getIden(identation) + notOperator + \"isinstance(\" + this.printNode(expression, 0) + \", dict)\";\n case \"undefined\":\n return this.getIden(identation) + this.printNode(expression, 0) + \" is \" + notOperator + \"None\";\n }\n\n return undefined;\n\n }\n\n printCustomBinaryExpressionIfAny(node, identation) {\n const left = node.left;\n const right = node.right.text;\n\n const op = node.operatorToken.kind;\n\n // Fix E712 comparison: if cond == True -> if cond:\n if ((op === SyntaxKind.EqualsEqualsToken || op === SyntaxKind.EqualsEqualsEqualsToken) && node.right.kind === SyntaxKind.TrueKeyword) {\n return this.getIden(identation) + this.printNode(node.left, 0);\n }\n\n if (left.kind === SyntaxKind.TypeOfExpression) {\n const typeOfExpression = this.handleTypeOfInsideBinaryExpression(node, identation);\n if (typeOfExpression) {\n return typeOfExpression;\n }\n }\n\n const prop = node?.left?.expression?.name?.text;\n\n if (prop) {\n const args = left.arguments;\n const parsedArg = (args && args.length > 0) ? this.printNode(args[0], 0): undefined;\n const leftSideOfIndexOf = left.expression.expression; // myString in myString.indexOf\n const leftSide = this.printNode(leftSideOfIndexOf, 0);\n // const rightType = this.getChecker().getTypeAtLocation(leftSideOfIndexOf); // type of myString in myString.indexOf (\"b\") >= 0;\n\n switch(prop) {\n case 'indexOf':\n if (op === SyntaxKind.GreaterThanEqualsToken && right === '0') {\n return this.getIden(identation) + `${parsedArg} in ${leftSide}`;\n }\n }\n }\n return undefined;\n }\n\n printConditionalExpression(node, identation) {\n const condition = this.printNode(node.condition, 0);\n const whenTrue = this.printNode(node.whenTrue, 0);\n const whenFalse = this.printNode(node.whenFalse, 0);\n\n return this.getIden(identation) + whenTrue + \" if \" + condition + \" else \" + whenFalse;\n }\n\n printDeleteExpression(node, identation) {\n const expression = this.printNode (node.expression);\n return `del ${expression}`;\n }\n\n getCustomOperatorIfAny(left, right, operator) {\n const rightText = right.getText();\n const isUndefined = rightText === \"undefined\";\n if (isUndefined) {\n switch (operator.kind) {\n case SyntaxKind.EqualsEqualsToken:\n return \"is\";\n case SyntaxKind.ExclamationEqualsToken:\n return \"is not\";\n case SyntaxKind.ExclamationEqualsEqualsToken:\n return \"is not\";\n case SyntaxKind.EqualsEqualsEqualsToken:\n return \"is\";\n }\n }\n }\n}\n","import { SyntaxKind, getLeadingCommentRanges, getTrailingCommentRanges, type BinaryExpression, type ClassDeclaration, type Node, type PropertyAccessExpression, type SourceFile } from \"typescript/unstable/ast\";\nimport { isArrayLiteralExpression, isArrowFunction, isAwaitExpression, isBinaryExpression, isBooleanLiteral, isCallExpression, isClassDeclaration, isConditionalExpression, isExportAssignment, isExportDeclaration, isFunctionDeclaration, isFunctionExpression, isImportDeclaration, isMethodDeclaration, isNumericLiteral, isObjectLiteralExpression, isSourceFile, isStringLiteralLikeNode, isVariableStatement } from \"typescript/unstable/ast/is\";\nimport { createAwaitExpression, createParenthesizedExpression, createReturnStatement } from \"typescript/unstable/ast/factory\";\nimport { SignatureKind, TypeFlags, type Checker, type Program } from \"typescript/unstable/sync\";\nimport { findAncestor, getAllSuperTypeNodes, isFunctionLike } from \"./tsUtils.js\";\nimport { IFileImport, IFileExport, TranspilationError, IMethodType, IParameterType, ITranspileContext } from './types.js';\nimport { unCamelCase } from \"./utils.js\";\nimport { Logger } from \"./logger.js\";\nimport { timingSafeEqual } from 'crypto';\n\nconst NO_CONTEXT_ERROR = \"No transpilation context set: the typescript program must be created before printing nodes.\";\n\nclass BaseTranspiler {\n\n NUM_LINES_BETWEEN_CLASS_MEMBERS = 1;\n LINES_BETWEEN_FILE_MEMBERS = 0;\n NUM_LINES_END_FILE = 1;\n SPACE_DEFAULT_PARAM = \" \";\n BLOCK_OPENING_TOKEN = '{';\n BLOCK_CLOSING_TOKEN = '}';\n SPACE_BEFORE_BLOCK_OPENING = ' ';\n CONDITION_OPENING = '(';\n CONDITION_CLOSE = ')';\n DEFAULT_IDENTATION = \" \";\n STRING_QUOTE_TOKEN = '\"';\n UNDEFINED_TOKEN = \"null\";\n NULL_TOKEN = \"null\";\n IF_TOKEN = \"if\";\n ELSE_TOKEN = \"else\";\n ELSEIF_TOKEN = \"else if\";\n THIS_TOKEN = \"this\";\n SLASH_TOKEN = \"/\";\n ASTERISK_TOKEN = \"*\";\n PLUS_TOKEN = \"+\";\n MINUS_TOKEN = \"-\";\n EQUALS_TOKEN = \"=\";\n EQUALS_EQUALS_TOKEN = \"==\";\n EXCLAMATION_EQUALS_TOKEN = \"!=\";\n EXCLAMATION_EQUALS_EQUALS_TOKEN = \"!=\";\n EQUALS_EQUALS_EQUALS_TOKEN = \"==\";\n AMPERSTAND_APERSAND_TOKEN = \"&&\";\n PLUS_EQUALS = \"+=\";\n BAR_BAR_TOKEN = \"||\";\n PERCENT_TOKEN = \"%\";\n RETURN_TOKEN = \"return\";\n OBJECT_OPENING = \"{\";\n OBJECT_CLOSING = \"}\";\n LEFT_PARENTHESIS = \"(\";\n RIGHT_PARENTHESIS = \")\";\n ARRAY_OPENING_TOKEN = \"[\";\n ARRAY_CLOSING_TOKEN = \"]\";\n TRUE_KEYWORD = \"true\";\n FALSE_KEYWORD = \"false\";\n NEW_CORRESPODENT = \"new\";\n THROW_TOKEN = \"throw\";\n AWAIT_TOKEN = \"await\";\n STATIC_TOKEN = \"static\";\n CONTINUE_TOKEN = \"continue\";\n EXTENDS_TOKEN = \":\";\n NOT_TOKEN = \"!\";\n SUPER_TOKEN = \"super\";\n PROPERTY_ACCESS_TOKEN = \".\";\n TRY_TOKEN = \"try\";\n CATCH_TOKEN = \"catch\";\n CATCH_DECLARATION = \"Exception\";\n BREAK_TOKEN = \"break\";\n IN_TOKEN = \"in\";\n LESS_THAN_TOKEN = \"<\";\n GREATER_THAN_TOKEN = \">\";\n GREATER_THAN_EQUALS_TOKEN = \">=\";\n LESS_THAN_EQUALS_TOKEN = \"<=\";\n PLUS_PLUS_TOKEN = \"++\";\n MINUS_MINUS_TOKEN = \"--\";\n CONSTRUCTOR_TOKEN = \"def __init__\";\n SUPER_CALL_TOKEN = \"super().__init__\";\n WHILE_TOKEN = \"while\";\n FOR_TOKEN = \"for\";\n VAR_TOKEN = \"\";\n\n METHOD_DEFAULT_ACCESS = \"public\";\n\n PROPERTY_ASSIGNMENT_TOKEN = \":\";\n PROPERTY_ASSIGNMENT_OPEN = \"\";\n PROPERTY_ASSIGNMENT_CLOSE = \"\";\n\n LINE_TERMINATOR = \";\";\n\n FUNCTION_TOKEN = \"function\";\n METHOD_TOKEN = \"function\";\n ASYNC_TOKEN = \"async\";\n PROMISE_TYPE_KEYWORD = \"Task\";\n\n NEW_TOKEN = \"new\";\n\n STRING_LITERAL_KEYWORD = \"StringLiteral\";\n STRING_KEYWORD = \"string\";\n NUMBER_KEYWORD = \"float\";\n\n PUBLIC_KEYWORD = \"public\";\n PRIVATE_KEYWORD = \"private\";\n VOID_KEYWORD = \"void\";\n BOOLEAN_KEYWORD = \"bool\";\n\n ARRAY_KEYWORD = \"List\";\n OBJECT_KEYWORD = \"Dictionary\";\n INTEGER_KEYWORD = \"int\";\n DEFAULT_RETURN_TYPE = \"object\";\n DEFAULT_PARAMETER_TYPE = \"object\";\n DEFAULT_TYPE = \"object\";\n\n FALSY_WRAPPER_OPEN = \"\";\n FALSY_WRAPPER_CLOSE = \"\";\n\n ELEMENT_ACCESS_WRAPPER_OPEN = \"\";\n ELEMENT_ACCESS_WRAPPER_CLOSE = \"\";\n\n COMPARISON_WRAPPER_OPEN = \"\";\n COMPARISON_WRAPPER_CLOSE = \"\";\n\n UKNOWN_PROP_WRAPPER_OPEN = \"\";\n UNKOWN_PROP_WRAPPER_CLOSE = \"\";\n\n UKNOWN_PROP_ASYNC_WRAPPER_OPEN = \"\";\n UNKOWN_PROP_ASYNC_WRAPPER_CLOSE = \"\";\n\n EQUALS_EQUALS_WRAPPER_OPEN = \"\";\n EQUALS_EQUALS_WRAPPER_CLOSE = \"\";\n\n DIFFERENT_WRAPPER_OPEN = \"\";\n DIFFERENT_WRAPPER_CLOSE = \"\";\n\n GREATER_THAN_WRAPPER_OPEN = \"\";\n GREATER_THAN_WRAPPER_CLOSE = \"\";\n\n LESS_THAN_WRAPPER_OPEN = \"\";\n LESS_THAN_WRAPPER_CLOSE = \"\";\n\n GREATER_THAN_EQUALS_WRAPPER_OPEN = \"\";\n GREATER_THAN_EQUALS_WRAPPER_CLOSE = \"\";\n\n LESS_THAN_EQUALS_WRAPPER_OPEN = \"\";\n LESS_THAN_EQUALS_WRAPPER_CLOSE = \"\";\n\n DIVIDE_WRAPPER_OPEN = \"\";\n DIVIDE_WRAPPER_CLOSE = \"\";\n\n PLUS_WRAPPER_OPEN = \"\";\n PLUS_WRAPPER_CLOSE = \"\";\n\n MINUS_WRAPPER_OPEN = \"\";\n MINUS_WRAPPER_CLOSE = \"\";\n\n MOD_WRAPPER_OPEN = \"\";\n MOD_WRAPPER_CLOSE = \"\";\n\n ARRAY_LENGTH_WRAPPER_OPEN = \"\";\n ARRAY_LENGTH_WRAPPER_CLOSE = \"\";\n\n MULTIPLY_WRAPPER_OPEN = \"\";\n MULTIPLY_WRAPPER_CLOSE = \"\";\n\n INDEXOF_WRAPPER_OPEN = \"\";\n INDEXOF_WRAPPER_CLOSE = \"\";\n\n PARSEINT_WRAPPER_OPEN = \"\";\n PARSEINT_WRAPPER_CLOSE = \"\";\n\n DYNAMIC_CALL_OPEN = \"\";\n\n SPREAD_TOKEN = \"...\";\n\n INFER_VAR_TYPE = false;\n INFER_ARG_TYPE = false;\n\n SupportedKindNames = {};\n PostFixOperators = {};\n PrefixFixOperators = {};\n FunctionDefSupportedKindNames = {};\n\n LeftPropertyAccessReplacements = {};\n RightPropertyAccessReplacements = {};\n FullPropertyAccessReplacements = {};\n StringLiteralReplacements = {};\n\n CallExpressionReplacements = {};\n ReservedKeywordsReplacements = {};\n ReassignedVars = {};\n PropertyAccessRequiresParenthesisRemoval = [];\n VariableTypeReplacements = {};\n ArgTypeReplacements = {};\n\n FuncModifiers = {};\n defaultPropertyAccess = 'public';\n\n currentClassName = \"\";\n className = \"undefined\";\n\n uncamelcaseIdentifiers;\n asyncTranspiling;\n implicitAsyncTranspiling;\n requiresReturnType;\n requiresParameterType;\n supportsFalsyOrTruthyValues;\n requiresCallExpressionCast;\n removeVariableDeclarationForFunctionExpression;\n includeFunctionNameInFunctionExpressionDeclaration;\n id;\n // typescript state for the transpilation currently in flight. Set by the owning\n // Transpiler before it walks the AST, so nothing leaks through process globals.\n context: ITranspileContext | undefined;\n\n constructor(config) {\n Object.assign (this, (config['parser'] || {}));\n this.id = \"base\";\n this.uncamelcaseIdentifiers = false;\n this.requiresReturnType = false;\n this.requiresParameterType = false;\n this.supportsFalsyOrTruthyValues = true;\n this.requiresCallExpressionCast = false;\n this.removeVariableDeclarationForFunctionExpression = true;\n this.includeFunctionNameInFunctionExpressionDeclaration = true;\n this.initOperators();\n }\n\n setContext(context: ITranspileContext | undefined): void {\n this.context = context;\n }\n\n getSrc(): SourceFile {\n if (this.context === undefined) throw new Error(NO_CONTEXT_ERROR);\n return this.context.src;\n }\n\n getChecker(): Checker {\n if (this.context === undefined) throw new Error(NO_CONTEXT_ERROR);\n return this.context.checker;\n }\n\n // the checker when a transpilation context is set, undefined otherwise (an in-memory\n // program without one keeps every helper the checker would have proven away)\n // true when some node under `scope` (excluding `scope` itself) satisfies `predicate`;\n // the walk stops at the first hit and does not descend below it\n hasNodeWhere(scope: Node | undefined, predicate: (n: any) => boolean): boolean {\n if (scope === undefined) {\n return false;\n }\n let found = false;\n const visit = (n: any) => {\n if (found) {\n return;\n }\n if (predicate(n)) {\n found = true;\n return;\n }\n n.forEachChild(visit);\n };\n scope.forEachChild(visit);\n return found;\n }\n\n checkerOrUndefined(): Checker | undefined {\n return this.context?.checker;\n }\n\n getProgram(): Program {\n if (this.context === undefined) throw new Error(NO_CONTEXT_ERROR);\n return this.context.program;\n }\n\n initOperators() {\n this.SupportedKindNames = {\n [SyntaxKind.StringLiteral]: this.STRING_LITERAL_KEYWORD,\n [SyntaxKind.StringKeyword]: this.STRING_KEYWORD,\n // [ts.SyntaxKind.NumberKeyword]: this.NUMBER_KEYWORD,\n [SyntaxKind.NumberKeyword]: this.DEFAULT_TYPE,\n [SyntaxKind.MinusMinusToken]: this.MINUS_MINUS_TOKEN,\n [SyntaxKind.MinusToken]: this.MINUS_TOKEN,\n [SyntaxKind.SlashToken]: this.SLASH_TOKEN,\n [SyntaxKind.AsteriskToken]: this.ASTERISK_TOKEN,\n [SyntaxKind.InKeyword]: this.IN_TOKEN,\n [SyntaxKind.PlusToken]: this.PLUS_TOKEN,\n [SyntaxKind.PercentToken]: this.PERCENT_TOKEN,\n [SyntaxKind.LessThanToken]: this.LESS_THAN_TOKEN,\n [SyntaxKind.LessThanEqualsToken]: this.LESS_THAN_EQUALS_TOKEN,\n [SyntaxKind.GreaterThanToken]: this.GREATER_THAN_TOKEN,\n [SyntaxKind.GreaterThanEqualsToken]: this.GREATER_THAN_EQUALS_TOKEN,\n [SyntaxKind.EqualsEqualsToken]: this.EQUALS_EQUALS_TOKEN,\n [SyntaxKind.EqualsEqualsEqualsToken]: this.EQUALS_EQUALS_EQUALS_TOKEN,\n [SyntaxKind.EqualsToken]: this.EQUALS_TOKEN,\n [SyntaxKind.PlusEqualsToken]: this.PLUS_EQUALS,\n [SyntaxKind.BarBarToken]: this.BAR_BAR_TOKEN,\n [SyntaxKind.AmpersandAmpersandToken]: this.AMPERSTAND_APERSAND_TOKEN,\n [SyntaxKind.ExclamationEqualsEqualsToken]: this.EXCLAMATION_EQUALS_EQUALS_TOKEN,\n [SyntaxKind.ExclamationEqualsToken]: this.EXCLAMATION_EQUALS_TOKEN,\n [SyntaxKind.AsyncKeyword]: this.ASYNC_TOKEN,\n [SyntaxKind.AwaitKeyword]: this.AWAIT_TOKEN,\n [SyntaxKind.StaticKeyword]: this.STATIC_TOKEN,\n [SyntaxKind.PublicKeyword]: this.PUBLIC_KEYWORD,\n [SyntaxKind.PrivateKeyword]: this.PRIVATE_KEYWORD,\n [SyntaxKind.VoidKeyword]: this.VOID_KEYWORD,\n [SyntaxKind.BooleanKeyword]: this.BOOLEAN_KEYWORD,\n };\n\n this.PostFixOperators = {\n [SyntaxKind.PlusPlusToken]: this.PLUS_PLUS_TOKEN,\n [SyntaxKind.MinusMinusToken]: this.MINUS_MINUS_TOKEN,\n };\n\n this.PrefixFixOperators = {\n [SyntaxKind.ExclamationToken]: this.NOT_TOKEN,\n [SyntaxKind.MinusToken]: this.MINUS_TOKEN,\n };\n\n this.FunctionDefSupportedKindNames = {\n [SyntaxKind.StringKeyword]: this.STRING_KEYWORD\n };\n\n this.FuncModifiers = {\n [SyntaxKind.AsyncKeyword]: this.ASYNC_TOKEN,\n [SyntaxKind.PublicKeyword]: this.PUBLIC_KEYWORD,\n [SyntaxKind.PrivateKeyword]: this.PRIVATE_KEYWORD,\n [SyntaxKind.StaticKeyword]: this.STATIC_TOKEN,\n };\n }\n\n capitalize(str: string) {\n return str[0].toUpperCase() + str.slice(1);\n }\n\n applyUserOverrides(config): void {\n this.LeftPropertyAccessReplacements = Object.assign ({}, this.LeftPropertyAccessReplacements, config['LeftPropertyAccessReplacements'] ?? {});\n this.RightPropertyAccessReplacements = Object.assign ({}, this.RightPropertyAccessReplacements, config['RightPropertyAccessReplacements'] ?? {});\n this.FullPropertyAccessReplacements = Object.assign ({}, this.FullPropertyAccessReplacements, config['FullPropertyAccessReplacements'] ?? {});\n this.CallExpressionReplacements = Object.assign ({}, this.CallExpressionReplacements, config['CallExpressionReplacements'] ?? {});\n this.StringLiteralReplacements = Object.assign ({}, this.StringLiteralReplacements, config['StringLiteralReplacements'] ?? {});\n }\n\n getLineAndCharacterOfNode(node): [number,number] {\n const { line, character } =\n this.getSrc().getLineAndCharacterOfPosition(node.getStart());\n return [line + 1,character];\n }\n\n isComment(line: string){\n line = line.trim();\n return line.startsWith(\"//\") || line.startsWith(\"/*\") || line.startsWith(\"*\");\n }\n\n isStringType(flags: TypeFlags) {\n return flags === TypeFlags.String || flags === TypeFlags.StringLiteral;\n }\n\n isAnyType(flags: TypeFlags) {\n return flags === TypeFlags.Any;\n }\n\n warnIfAnyType(node, flags, variable, target) {\n if (this.isAnyType(flags)) {\n const [line, character] = this.getLineAndCharacterOfNode(node);\n Logger.warning(`[${this.id}] Line: ${line} char: ${character}: ${variable} has any type, ${target} might be incorrectly transpiled`);\n }\n }\n\n warn(node, target, message) {\n const [line, character] = this.getLineAndCharacterOfNode(node);\n Logger.warning(`[${this.id}] Line: ${line} char: ${character}: ${target} : ${message}`);\n }\n\n hasAsyncModifier(node) {\n return (node.modifiers ?? []).some(mod => mod.kind === SyntaxKind.AsyncKeyword);\n }\n\n isPromiseType(type) {\n return type !== undefined && this.getTypeFromRawType(type) === this.PROMISE_TYPE_KEYWORD;\n }\n\n isImplicitAsyncFunction(node) {\n // a function declared WITHOUT the `async` keyword that returns a Promise\n // directly, ie: `watchTicker (symbol: string): Promise { return this.watch (...); }`\n // (a common fast-path in JS for pure delegator/pass-through methods);\n // target languages without that distinction transpile it as if it were `async`\n if (!this.implicitAsyncTranspiling || !isFunctionLike(node) || this.hasAsyncModifier(node)) {\n return false;\n }\n const signature = this.getChecker().getSignatureFromDeclaration(node);\n return signature !== undefined && this.isPromiseType(this.getChecker().getReturnTypeOfSignature(signature));\n }\n\n isAsyncFunction(node) {\n return this.hasAsyncModifier(node) || this.isImplicitAsyncFunction(node);\n }\n\n getMethodOverride(node: Node): Node {\n /////\n //// Warning: Only takes into consideration 1 level of heritage\n //// might be costly, try to improve its performance later\n ////\n // Check if the method is a member of a class\n if (node === undefined) {\n return undefined;\n }\n if (!isClassDeclaration(node.parent)) {\n return undefined;\n }\n\n // Get the class declaration\n const classDeclaration = node.parent as ClassDeclaration;\n\n // Check if the class has a base class\n if (!classDeclaration.heritageClauses) {\n return undefined;\n }\n\n let method = undefined;\n\n let parentClass = getAllSuperTypeNodes(node.parent)[0];\n\n while (parentClass !== undefined) {\n const parentClassType = this.getChecker().getTypeAtLocation(parentClass);\n const parentClassDecl = parentClassType?.getSymbol()?.valueDeclaration?.resolve();\n\n if (parentClassDecl === undefined) {\n this.warn(node, \"Parent class\", \"Parent class not found\");\n return undefined;\n }\n\n const parentClassMembers = (parentClassDecl as any).members ?? [];\n\n parentClassMembers.forEach(elem=> {\n if (isMethodDeclaration(elem)) {\n\n const name = elem.name.getText().trim();\n if ((node as any).name.text === name) {\n method = elem;\n }\n }\n });\n\n parentClass = getAllSuperTypeNodes(parentClassDecl)[0] ?? undefined;\n }\n\n\n\n // TODO: Check if the method has the same signature as a method in the base class\n return method;\n }\n\n getIden (num) {\n return this.DEFAULT_IDENTATION.repeat(parseInt(num));\n }\n\n getBlockOpen(identation){\n return this.SPACE_BEFORE_BLOCK_OPENING + this.BLOCK_OPENING_TOKEN + \"\\n\";\n }\n\n getBlockClose(identation, chainBlock = false) {\n\n if (chainBlock) {\n return this.BLOCK_CLOSING_TOKEN ? \"\\n\" + this.getIden(identation) + this.BLOCK_CLOSING_TOKEN + this.SPACE_BEFORE_BLOCK_OPENING : \"\\n\" + this.getIden(identation) + this.BLOCK_CLOSING_TOKEN;\n }\n\n return this.BLOCK_CLOSING_TOKEN ? \"\\n\" + this.getIden(identation) + this.BLOCK_CLOSING_TOKEN : \"\";\n }\n\n startsWithUpperCase(str) {\n return str.charAt(0) === str.charAt(0).toUpperCase();\n }\n\n unCamelCaseIfNeeded(name: string): string {\n\n if (this.uncamelcaseIdentifiers && !this.startsWithUpperCase(name) ) { // avoid snake_case constant (MY_CONSTANT) or exception errors (BadRequestException)\n return unCamelCase(name) ?? name;\n }\n return name;\n }\n\n transformIdentifier(node, identifier) {\n return this.unCamelCaseIfNeeded(identifier);\n }\n\n transformCallExpressionName(name: string, nameNode = undefined) {\n return name;\n }\n\n transformPropertyAccessExpressionName(name: string, nameNode = undefined) {\n return name;\n }\n\n printIdentifier(node) {\n let idValue = node.text ?? node.text;\n\n if (this.ReservedKeywordsReplacements[idValue]) {\n idValue = this.ReservedKeywordsReplacements[idValue];\n }\n\n if (idValue === \"undefined\") {\n return this.UNDEFINED_TOKEN;\n }\n return this.transformIdentifier(node, idValue); // check this later\n }\n\n shouldRemoveParenthesisFromCallExpression(node) {\n if (node.expression.kind === SyntaxKind.PropertyAccessExpression) {\n return this.PropertyAccessRequiresParenthesisRemoval.includes(node.expression.name.text);\n }\n return false;\n }\n\n printInstanceOfExpression(node, identation) {\n // const left = this.printNode(node.left, 0);\n // const right = this.printNode(node.right, 0);\n const left = node.left.text;\n const right = node.right.text;\n return this.getIden(identation) + `${left} instanceof ${right}`;\n }\n\n getCustomOperatorIfAny(left, right, operator) {\n return undefined;\n }\n\n printCustomBinaryExpressionIfAny(node, identation) {\n return undefined; // stub to override\n }\n\n printBinaryExpression(node, identation) {\n\n const {left, right, operatorToken} = node;\n\n const customBinaryExp = this.printCustomBinaryExpressionIfAny(node, identation);\n if (customBinaryExp) {\n return customBinaryExp;\n }\n\n if (operatorToken.kind == SyntaxKind.InstanceOfKeyword) {\n return this.printInstanceOfExpression(node, identation);\n }\n\n let operator = this.SupportedKindNames[operatorToken.kind];\n\n\n let leftVar = undefined;\n let rightVar = undefined;\n\n // c# wrapper\n if (operatorToken.kind === SyntaxKind.EqualsEqualsToken || operatorToken.kind === SyntaxKind.EqualsEqualsEqualsToken) {\n if (this.COMPARISON_WRAPPER_OPEN) {\n leftVar = this.printNode(left, 0);\n rightVar = this.printNode(right, identation);\n return `${this.COMPARISON_WRAPPER_OPEN}${leftVar}, ${rightVar}${this.COMPARISON_WRAPPER_CLOSE}`;\n }\n }\n let prefixes = \"\";\n // check if boolean operators || and && because of the falsy values\n if (operatorToken.kind === SyntaxKind.BarBarToken || operatorToken.kind === SyntaxKind.AmpersandAmpersandToken) {\n leftVar = this.printCondition(left, 0);\n rightVar = this.printCondition(right, identation);\n } else {\n leftVar = this.printNode(left, 0);\n\n\n // if (right.kind === ts.SyntaxKind.ObjectLiteralExpression) {\n prefixes = this.getBinaryExpressionPrefixes(node, identation) ?? \"\";\n // }\n\n rightVar = this.printNode(right, identation);\n }\n\n const customOperator = this.getCustomOperatorIfAny(left, right, operatorToken);\n\n operator = customOperator ? customOperator : operator;\n\n return prefixes + leftVar +\" \"+ operator + \" \" + rightVar.trim();\n }\n\n getBinaryExpressionPrefixes(node, identation) {\n return undefined;\n }\n\n transformPropertyAcessExpressionIfNeeded (node) {\n return undefined;\n }\n\n transformPropertyAcessRightIdentifierIfNeeded (name: string): string {\n return this.unCamelCaseIfNeeded(name);\n }\n\n getExceptionalAccessTokenIfAny(node) {\n return undefined; // stub to override\n }\n\n printLengthProperty(node, identation, name = undefined) {\n return undefined; // stub to override\n }\n\n printPropertyAccessExpression(node, identation) {\n\n const expression = node.expression;\n\n const transformedProperty = this.transformPropertyAcessExpressionIfNeeded(node);\n if (transformedProperty) {\n return this.getIden(identation) + transformedProperty;\n }\n\n let leftSide = node.expression.text;\n let rightSide = node.name.text;\n\n switch (rightSide) {\n case \"length\":\n return this.printLengthProperty(node, identation, leftSide);\n }\n\n let rawExpression = node.getText().trim();\n\n if (this.FullPropertyAccessReplacements.hasOwnProperty(rawExpression)){ // eslint-disable-line\n return this.FullPropertyAccessReplacements[rawExpression]; // eslint-disable-line\n }\n\n leftSide = this.LeftPropertyAccessReplacements.hasOwnProperty(leftSide) ? this.LeftPropertyAccessReplacements[leftSide] : this.printNode(expression, 0); // eslint-disable-line\n\n // checking \"toString\" insde the object will return the builtin toString method :X\n rightSide = this.RightPropertyAccessReplacements.hasOwnProperty(rightSide) ? // eslint-disable-line\n this.RightPropertyAccessReplacements[rightSide] :\n this.transformPropertyAcessRightIdentifierIfNeeded(rightSide) ?? rightSide;\n\n // join together the left and right side again\n const accessToken = this.getExceptionalAccessTokenIfAny(node) ?? this.PROPERTY_ACCESS_TOKEN;\n\n rawExpression = leftSide + accessToken + this.transformPropertyAccessExpressionName(rightSide, node.name);\n\n return rawExpression;\n }\n\n printCustomDefaultValueIfNeeded(node) {\n return undefined;\n }\n\n printParameteCustomName(node, name, defaultValue = true) {\n // useful for when we have to get the parent's method argument type\n const initializer = node.initializer;\n\n let type = this.printParameterType(node);\n type = type ? type + \" \" : \"\";\n\n if (defaultValue) {\n if (initializer) {\n const customDefaultValue = this.printCustomDefaultValueIfNeeded(initializer);\n const defaultValue = customDefaultValue ? customDefaultValue : this.printNode(initializer, 0);\n return type + name + this.SPACE_DEFAULT_PARAM + \"=\" + this.SPACE_DEFAULT_PARAM + defaultValue;\n }\n return type + name;\n }\n return name;\n }\n\n printParameter(node, defaultValue = true) {\n const name = this.printNode(node.name, 0);\n const initializer = node.initializer;\n\n let type = this.printParameterType(node);\n type = type ? type + \" \" : \"\";\n\n if (defaultValue) {\n if (initializer) {\n const customDefaultValue = this.printCustomDefaultValueIfNeeded(initializer);\n const defaultValue = customDefaultValue ? customDefaultValue : this.printNode(initializer, 0);\n if (type) {\n type = (defaultValue === \"null\" && type !== \"object\") ? type + \"? \": type + \" \";\n }\n return type + name + this.SPACE_DEFAULT_PARAM + \"=\" + this.SPACE_DEFAULT_PARAM + defaultValue;\n }\n if (type === \"\") {\n return name;\n }\n return type + \" \" + name;\n }\n return name;\n }\n\n printModifiers(node) {\n let modifiers = node.modifiers ?? [];\n modifiers = modifiers.filter(mod => this.FuncModifiers[mod.kind]);\n\n if (!this.asyncTranspiling) {\n modifiers = modifiers.filter(mod => mod.kind !== SyntaxKind.AsyncKeyword);\n }\n let res = modifiers.map(modifier => this.FuncModifiers[modifier.kind]).join(\" \");\n\n if (this.asyncTranspiling && this.ASYNC_TOKEN && this.isImplicitAsyncFunction(node)) {\n // non-async functions returning a Promise directly are transpiled\n // as if they had been declared `async`\n res = res ? res + \" \" + this.ASYNC_TOKEN : this.ASYNC_TOKEN;\n }\n\n return res;\n }\n\n transformLeadingComment(comment) {\n return comment; // to override\n }\n\n transformTrailingComment(comment) {\n return comment; // to override\n }\n\n printLeadingComments(node, identation) {\n const fullText = this.getSrc().getFullText();\n const commentsRangeList = getLeadingCommentRanges(fullText, node.pos);\n const commentsRange = commentsRangeList ? commentsRangeList : undefined;\n let res = \"\";\n if (commentsRange) {\n for (const commentRange of commentsRange) {\n const commentText = fullText.slice(commentRange.pos, commentRange.end);\n if (commentText !== undefined) {\n const formatted = commentText\n .split(\"\\n\")\n .map(line=>line.trim())\n .map(line => !(line.trim().startsWith(\"*\")) ? this.getIden(identation) + line : this.getIden(identation) + \" \" + line) .join(\"\\n\");\n res+= this.transformLeadingComment(formatted) + \"\\n\";\n }\n }\n }\n return res;\n }\n\n printTraillingComment(node, identation) {\n const fullText = this.getSrc().getFullText();\n const commentsRangeList = getTrailingCommentRanges(fullText, node.end);\n const commentsRange = commentsRangeList ? commentsRangeList : undefined;\n let res = \"\";\n if (commentsRange) {\n for (const commentRange of commentsRange) {\n const commentText = fullText.slice(commentRange.pos, commentRange.end);\n if (commentText !== undefined) {\n res+= \" \" + this.transformTrailingComment(commentText);\n }\n }\n }\n return res;\n }\n\n printNodeCommentsIfAny(node, identation, parsedNode) {\n const leadingComment = this.printLeadingComments(node, identation);\n const trailingComment = this.printTraillingComment(node, identation);\n return leadingComment + parsedNode + trailingComment;\n }\n\n getType(node) {\n // try to get type from declared type, example: x: string = \"foo\"\n const type = node.type;\n if (type) {\n if (type.kind === SyntaxKind.TypeReference) {\n const typeRef = type.typeName.text;\n if (typeRef === \"Promise\") {\n const typeArgs = type.typeArguments.filter(t => t.kind !== SyntaxKind.VoidKeyword);\n const insideTypes = typeArgs.map(type => {\n if (this.SupportedKindNames.hasOwnProperty(type.kind)) { // eslint-disable-line\n return this.SupportedKindNames[type.kind];\n } else {\n return type.text;\n }\n }).join(\",\");\n\n if (insideTypes.length > 0) {\n return `${this.PROMISE_TYPE_KEYWORD}<${insideTypes}>`;\n }\n return this.PROMISE_TYPE_KEYWORD;\n }\n return type.typeName.text;\n } else if (this.SupportedKindNames.hasOwnProperty(type.kind)) { // eslint-disable-line\n return this.SupportedKindNames[type.kind];\n }\n }\n\n // todo: infer from initializer re-think this logic ex: x = 1;\n // can we use the type checker here?\n const initializer = node.initializer;\n if (initializer) {\n if (isArrayLiteralExpression(initializer)) {\n return this.ARRAY_KEYWORD;\n }\n if (isBooleanLiteral(initializer)) {\n return this.BOOLEAN_KEYWORD;\n }\n if (isObjectLiteralExpression(initializer)) {\n return this.OBJECT_KEYWORD;\n }\n if (isNumericLiteral(initializer)) {\n // return this.NUMBER_TYPE_TOKEN;\n // const value = initializer.text;\n // const num = Number(value);\n // if (Number.isInteger(num)) {\n // return this.INTEGER_KEYWORD;\n // }\n // return this.NUMBER_KEYWORD;\n return this.DEFAULT_TYPE; // int and number to object\n }\n if (isStringLiteralLikeNode(initializer)) {\n return this.STRING_KEYWORD;\n }\n }\n return undefined;\n }\n\n getTypeFromRawType(type) {\n // check for primitive types\n if (type.flags === TypeFlags.Any) {\n return undefined;\n }\n if (type.flags === TypeFlags.Void) {\n return this.VOID_KEYWORD;\n }\n if (type.flags === TypeFlags.Number) {\n // return this.NUMBER_KEYWORD;\n return this.DEFAULT_TYPE;\n }\n\n if (type.flags === TypeFlags.String) {\n return this.STRING_KEYWORD;\n }\n // if (type.flags === ts.TypeFlags.Boolean) {\n // return this.BOOLEAN_KEYWORD;\n // }\n\n // check for array or object\n\n if (type?.getSymbol()?.escapedName === 'Array') {\n return this.ARRAY_KEYWORD;\n }\n if (type?.getSymbol()?.escapedName === '__object') {\n return this.OBJECT_KEYWORD;\n }\n\n // check this out, trying to resolve Promise<{}>\n if (type?.getSymbol()?.escapedName === '__type') {\n return this.OBJECT_KEYWORD;\n // return this.DEFAULT_TYPE;\n }\n\n // check for promise type\n\n if (type?.getSymbol()?.escapedName === 'Promise') {\n return this.PROMISE_TYPE_KEYWORD;\n }\n\n // check this out not sure about this\n if (type?.intrinsicName === 'object') {\n return this.OBJECT_KEYWORD;\n }\n if (type?.intrinsicName === 'boolean') {\n return this.BOOLEAN_KEYWORD;\n }\n\n return undefined;\n }\n\n getFunctionType(node, async = true){\n // use type checker to do it here\n const type = this.getChecker().getReturnTypeOfSignature(this.getChecker().getSignatureFromDeclaration(node));\n\n const parsedTtype = this.getTypeFromRawType(type);\n\n if (parsedTtype === this.PROMISE_TYPE_KEYWORD) {\n const resolvedTypeArguments = this.getChecker().getTypeArguments(type as any);\n if (resolvedTypeArguments.length === 0) {\n return this.PROMISE_TYPE_KEYWORD;\n }\n if (resolvedTypeArguments.length === 1 && resolvedTypeArguments[0].flags === TypeFlags.Void) {\n return this.PROMISE_TYPE_KEYWORD;\n }\n\n const insideTypes = resolvedTypeArguments.map(type => this.getTypeFromRawType(type)).join(\",\");\n if (insideTypes.length > 0) {\n if (async) {\n return `${this.PROMISE_TYPE_KEYWORD}<${insideTypes}>`;\n } else {\n return insideTypes;\n }\n }\n return undefined;\n }\n return parsedTtype;\n }\n\n printFunctionBody(node, identation) {\n return this.printBlock(node.body, identation);\n }\n\n printParameterType(node) {\n if (!this.requiresParameterType) {\n return \"\";\n }\n\n if (!this.INFER_ARG_TYPE) {\n return this.DEFAULT_PARAMETER_TYPE;\n }\n\n const type = this.getChecker().typeToString(this.getChecker().getTypeAtLocation(node));\n\n if (this.ArgTypeReplacements[type]) {\n return this.ArgTypeReplacements[type];\n }\n\n return this.DEFAULT_PARAMETER_TYPE;\n }\n\n printFunctionType(node){\n if (!this.requiresReturnType) {\n return \"\";\n }\n\n const typeText = this.getFunctionType(node);\n if (typeText === undefined || (typeText !== this.VOID_KEYWORD && typeText !== this.PROMISE_TYPE_KEYWORD)) {\n // throw new FunctionReturnTypeError(\"Function return type is not supported\");\n let res = \"\";\n if (this.isAsyncFunction(node)) {\n res = `${this.PROMISE_TYPE_KEYWORD}<${this.DEFAULT_RETURN_TYPE}>`;\n } else {\n res = this.DEFAULT_RETURN_TYPE;\n }\n this.warn(node, node.name.getText(), \"Function return type not found, will default to: \" + res);\n return res;\n }\n return typeText;\n }\n\n\n printFunctionDefinition(node, identation) {\n let name = node.name?.text ?? \"\";\n name = this.transformFunctionNameIfNeeded(name);\n\n // const parsedArgs = node.parameters.map(param => this.printParameter(param)).join(\", \");\n const parsedArgs = this.printMethodParameters(node);\n\n let modifiers = this.printModifiers(node);\n modifiers = modifiers ? modifiers + \" \" : modifiers;\n\n let returnType = this.printFunctionType(node);\n // quick fix\n if (returnType === 'java.util.concurrent.CompletableFuture') {\n returnType = 'java.util.concurrent.CompletableFuture';\n }\n\n returnType = returnType ? returnType + \" \" : returnType;\n\n const fnKeyword = this.FUNCTION_TOKEN ? this.FUNCTION_TOKEN + \" \" : \"\";\n if (!fnKeyword && isFunctionDeclaration(node)){\n modifiers = modifiers + \"public \";\n }\n let functionDef = this.getIden(identation) + modifiers + returnType + fnKeyword;\n if (this.includeFunctionNameInFunctionExpressionDeclaration || !isFunctionExpression(node)) {\n functionDef += name;\n }\n functionDef += \"(\" + parsedArgs + \")\";\n\n return functionDef;\n }\n\n transformFunctionNameIfNeeded(name): string {\n return this.unCamelCaseIfNeeded(name);\n }\n\n printFunctionDeclaration(node, identation) {\n if (isArrowFunction(node)) {\n const parameters = node.parameters.map(param => this.printParameter(param)).join(\", \");\n const body = this.printNode(node.body);\n return `(${parameters}) => ${body}`;\n }\n const funcBody = this.printFunctionBody(node, identation);\n let functionDef = this.printFunctionDefinition(node, identation);\n functionDef += funcBody;\n\n return this.printNodeCommentsIfAny(node, identation, functionDef);\n }\n\n printMethodParameters(node) {\n return node.parameters.map(param => this.printParameter(param)).join(\", \");\n }\n\n transformMethodNameIfNeeded(name: string): string {\n return this.unCamelCaseIfNeeded(name);\n }\n\n printMethodDefinition(node, identation) {\n let name = node.name.text;\n name = this.transformMethodNameIfNeeded(name);\n\n let returnType = this.printFunctionType(node);\n\n let modifiers = this.printModifiers(node);\n const defaultAccess = this.METHOD_DEFAULT_ACCESS ? this.METHOD_DEFAULT_ACCESS + \" \": \"\";\n modifiers = modifiers ? modifiers + \" \" : defaultAccess; // tmp check this\n\n const parsedArgs = this.printMethodParameters(node);\n\n returnType = returnType ? returnType + \" \" : returnType;\n\n const methodToken = this.METHOD_TOKEN ? this.METHOD_TOKEN + \" \" : \"\";\n const methodDef = this.getIden(identation) + modifiers + returnType + methodToken + name\n + \"(\" + parsedArgs + \")\";\n\n return this.printNodeCommentsIfAny(node, identation, methodDef);\n }\n\n printMethodDeclaration(node, identation) {\n\n let methodDef = this.printMethodDefinition(node, identation);\n\n const funcBody = this.printFunctionBody(node, identation);\n\n methodDef += funcBody;\n\n return methodDef;\n }\n\n printStringLiteral(node) {\n const token = this.STRING_QUOTE_TOKEN;\n let text = node.text;\n if (text in this.StringLiteralReplacements) {\n return this.StringLiteralReplacements[text];\n }\n // trick to preserve valid backslashes (e.g. \\n, \\t)\n const backslashPlaceholder = \"\\x00\";\n text = text.replaceAll(\"\\\\\", backslashPlaceholder);\n text = text.replaceAll(\"\\b\", \"\\\\b\");\n text = text.replaceAll(\"\\f\", \"\\\\f\");\n text = text.replaceAll(\"\\n\", \"\\\\n\");\n text = text.replaceAll(\"\\r\", \"\\\\r\");\n text = text.replaceAll(\"\\t\", \"\\\\t\");\n text = text.replaceAll(backslashPlaceholder, \"\\\\\\\\\");\n if (token === \"'\") {\n text = text.replaceAll(\"'\", \"\\\\'\"); // escape single quotes\n } else if (token === \"\\\"\") {\n text = text.replaceAll(\"\\\"\", \"\\\\\\\"\"); // escape double quotes\n }\n return token + text + token;\n }\n\n printNumericLiteral(node) {\n return node.text;\n }\n\n printArrayLiteralExpression(node, identation) {\n\n const elements = node.elements.map((e) => {\n return this.printNode(e);\n }).join(\", \");\n return this.ARRAY_OPENING_TOKEN + elements + this.ARRAY_CLOSING_TOKEN;\n }\n\n printVariableDeclarationList(node,identation) {\n const declaration = node.declarations[0];\n const varToken = this.VAR_TOKEN ? this.VAR_TOKEN + \" \": \"\";\n\n if (this.removeVariableDeclarationForFunctionExpression && declaration?.initializer && (isFunctionExpression(declaration.initializer) || isArrowFunction(declaration.initializer))) {\n return this.printNode(declaration.initializer, identation).trimEnd();\n }\n // const name = declaration.name.escapedText;\n const parsedValue = (declaration.initializer) ? this.printNode(declaration.initializer, identation) : this.NULL_TOKEN;\n return this.getIden(identation) + varToken + this.printNode(declaration.name) + \" = \" + parsedValue.trim();\n }\n\n printVariableStatement(node, identation){\n\n if (this.isCJSRequireStatement(node)) {\n return \"\"; // remove cjs imports\n }\n\n const decList = node.declarationList;\n const varStatement = this.printVariableDeclarationList(decList, identation) + this.LINE_TERMINATOR;\n return this.printNodeCommentsIfAny(node, identation, varStatement);\n }\n\n printOutOfOrderCallExpressionIfAny(node, identation) {\n return undefined; // stub to override\n }\n\n printSuperCallInsideConstructor(node, identation) {\n const args = node.arguments;\n\n const parsedArgs = args.map((a) => {\n return this.printNode(a, identation).trim();\n }).join(\",\");\n return this.SUPER_CALL_TOKEN + \"(\" + parsedArgs + \")\";\n }\n\n isBuiltInFunctionCall(node) {\n const symbol = this.getChecker().getSymbolAtLocation(node);\n const isInLibFiles = symbol?.declarations\n ?.some(d => /\\/node_modules\\/(typescript|@typescript\\/typescript-[^/]+)\\/lib\\//.test(d.path))\n ?? false;\n\n\n return isInLibFiles;\n }\n\n getTypesFromCallExpressionParameters(node) {\n const resolvedParams = this.getChecker().getResolvedSignature(node).getParameters();\n const parsedTypes = [];\n resolvedParams.forEach((p) => {\n const decl = p.declarations[0].resolve();\n const type = this.getChecker().getTypeAtLocation(decl);\n const parsedType = this.getTypeFromRawType(type);\n parsedTypes.push(parsedType);\n });\n return parsedTypes;\n }\n\n printArgsForCallExpression(node, identation) {\n const args = node.arguments;\n\n const argsList = args.length > 0 ? args : [];\n const parsedArgs = argsList.map((a) => {\n return this.printNode(a, identation).trim();\n }).join(\", \");\n return parsedArgs;\n }\n\n // builtin functions override\n printArrayIsArrayCall(node, identation, parsedArg = undefined) {\n return undefined; // stub\n }\n\n printObjectKeysCall(node, identation, parsedArg = undefined) {\n return undefined; // stub\n }\n\n printObjectValuesCall(node, identation, parsedArg = undefined) {\n return undefined; // stub\n }\n\n printJsonParseCall(node, identation, parsedArg = undefined) {\n return undefined; // stub\n }\n\n printJsonStringifyCall(node, identation, parsedArg = undefined) {\n return undefined; // stub\n }\n\n\n printPromiseAllCall(node, identation, parsedArg = undefined) {\n return undefined; // stub\n }\n\n printMathFloorCall(node, identation, parsedArg = undefined) {\n return undefined; // stub\n }\n\n printMathRoundCall(node, identation, parsedArg = undefined) {\n return undefined; // stub\n }\n\n printMathCeilCall(node, identation, parsedArg = undefined) {\n return undefined; // stub\n }\n\n printNumberIsIntegerCall(node, identation, parsedArg = undefined) {\n return undefined; // stub\n }\n\n printArrayPushCall(node, identation, name = undefined, parsedArg = undefined) {\n return undefined; // stub\n }\n\n printIncludesCall(node, identation, name = undefined, parsedArg = undefined) {\n return undefined; // stub\n }\n\n printIndexOfCall(node, identation, name = undefined, parsedArg = undefined) {\n return undefined; // stub\n }\n\n printStartsWithCall(node, identation, name = undefined, parsedArg = undefined) {\n return undefined; // stub\n }\n\n printEndsWithCall(node, identation, name = undefined, parsedArg = undefined) {\n return undefined; // stub\n }\n\n printPadEndCall(node, identation, name, parsedArg, parsedArg2) {\n return undefined; // stub\n }\n\n printPadStartCall(node, identation, name, parsedArg, parsedArg2) {\n return undefined; // stub\n }\n\n printTrimCall(node, identation, name = undefined) {\n return undefined; // stub\n }\n\n printJoinCall(node, identation, name = undefined, parsedArg = undefined) {\n return undefined; // stub\n }\n\n printSplitCall(node, identation, name = undefined, parsedArg = undefined) {\n return undefined; // stub\n }\n\n printConcatCall(node, identation, name = undefined, parsedArg = undefined) {\n return undefined; // stub\n }\n\n printToFixedCall(node, identation, name = undefined, parsedArg = undefined) {\n return undefined; // stub\n }\n\n printSearchCall(node, identation, name = undefined, parsedArg = undefined) {\n return undefined; // stub\n }\n\n printSliceCall(node, identation, name = undefined, parsedArg = undefined, parsedArg2 = undefined) {\n return undefined; // stub\n }\n\n printReplaceCall(node, identation, name = undefined, parsedArg = undefined, parsedArg2 = undefined) {\n return undefined; // stub\n }\n\n printReplaceAllCall(node, identation, name = undefined, parsedArg = undefined, parsedArg2 = undefined) {\n return undefined; // stub\n }\n\n printToStringCall(node, identation, name = undefined) {\n return undefined; // stub\n }\n\n printToUpperCaseCall(node, identation, name = undefined) {\n return undefined; // stub\n }\n\n printToLowerCaseCall(node, identation, name = undefined) {\n return undefined; // stub\n }\n\n printShiftCall(node, identation, name = undefined) {\n return undefined; // stub\n }\n\n printReverseCall(node, identation, name = undefined) {\n return undefined; // stub\n }\n\n printPopCall(node, identation, name = undefined) {\n return undefined; // stub\n }\n\n printAssertCall(node, identation, parsedArgs) {\n return `assert(${parsedArgs})`;\n }\n\n printDateNowCall(node, identation) {\n return undefined; // stub\n }\n\n printCallExpression(node, identation) {\n const expression = node.expression;\n\n const parsedArgs = this.printArgsForCallExpression(node, identation);\n\n const removeParenthesis = this.shouldRemoveParenthesisFromCallExpression(node);\n\n const finalExpression = this.printOutOfOrderCallExpressionIfAny(node, identation);\n if (finalExpression) {\n return finalExpression;\n }\n\n // check propertyAccessExpression for built in functions calls like Json.parse\n if (node.expression.kind === SyntaxKind.PropertyAccessExpression) {\n const expressionText = node.expression.getText().trim();\n const args = node.arguments ?? [];\n\n if (args.length === 0) {\n switch(expressionText) {\n case \"Date.now\":\n return this.printDateNowCall(node, identation);\n }\n }\n\n if (args.length === 1) {\n const parsedArg = this.printNode(args[0], 0);\n switch (expressionText) {\n case \"JSON.parse\":\n return this.printJsonParseCall(node, identation, parsedArg);\n case \"JSON.stringify\":\n return this.printJsonStringifyCall(node, identation, parsedArg);\n case \"Array.isArray\":\n return this.printArrayIsArrayCall(node, identation, parsedArg);\n case \"Object.keys\":\n return this.printObjectKeysCall(node, identation, parsedArg);\n case \"Object.values\":\n return this.printObjectValuesCall(node, identation, parsedArg);\n case \"Promise.all\":\n return this.printPromiseAllCall(node, identation, parsedArg);\n case \"Math.round\":\n return this.printMathRoundCall(node, identation, parsedArg);\n case \"Math.floor\":\n return this.printMathFloorCall(node, identation, parsedArg);\n case \"Math.ceil\":\n return this.printMathCeilCall(node, identation, parsedArg);\n case \"Number.isInteger\":\n return this.printNumberIsIntegerCall(node, identation, parsedArg);\n }\n }\n const rightSide = node.expression.name?.text;\n const leftSide = node.expression?.expression;\n\n if (args.length === 0 && rightSide !== undefined && leftSide !== undefined) {\n const parsedLeftSide = this.printNode(leftSide, 0);\n switch (rightSide) {\n case \"toString\":\n return this.printToStringCall(node, identation, parsedLeftSide);\n case \"toUpperCase\":\n return this.printToUpperCaseCall(node, identation, parsedLeftSide);\n case \"toLowerCase\":\n return this.printToLowerCaseCall(node, identation, parsedLeftSide);\n case \"shift\":\n return this.printShiftCall(node, identation, parsedLeftSide);\n case \"pop\":\n return this.printPopCall(node, identation, parsedLeftSide);\n case \"reverse\":\n return this.printReverseCall(node, identation, parsedLeftSide);\n case \"trim\":\n return this.printTrimCall(node, identation, parsedLeftSide);\n }\n }\n\n // handle built in functions like\n\n const arg = args && args.length > 0 ? args[0] : undefined;\n\n if (leftSide && rightSide && arg) {\n const parsedArg = this.printNode(arg, identation).trimStart();\n const secondParsedArg = args[1] ? this.printNode(args[1], identation).trimStart() : undefined;\n const name = this.printNode(leftSide, 0);\n switch(rightSide) {\n case 'push':\n return this.printArrayPushCall(node, identation, name, parsedArg);\n case 'includes':\n return this.printIncludesCall(node, identation, name, parsedArg);\n case 'indexOf':\n return this.printIndexOfCall(node, identation, name, parsedArg);\n case 'join':\n return this.printJoinCall(node, identation, name, parsedArg);\n case 'split':\n return this.printSplitCall(node, identation, name, parsedArg);\n case 'toFixed':\n return this.printToFixedCall(node, identation, name, parsedArg);\n case 'concat':\n return this.printConcatCall(node, identation, name, parsedArg);\n case 'search':\n return this.printSearchCall(node, identation, name, parsedArg);\n case 'endsWith':\n return this.printEndsWithCall(node, identation, name, parsedArg);\n case 'startsWith':\n return this.printStartsWithCall(node, identation, name, parsedArg);\n case 'padEnd':\n return this.printPadEndCall(node, identation, name, parsedArg, secondParsedArg);\n case 'padStart':\n return this.printPadStartCall(node, identation, name, parsedArg, secondParsedArg);\n }\n\n if (args.length === 1 || args.length === 2) {\n const parsedArg2 = args[1] ? this.printNode(args[1], identation).trimStart() : undefined;\n switch(rightSide) {\n case 'slice':\n return this.printSliceCall(node, identation, name, parsedArg, parsedArg2);\n case 'replace':\n return this.printReplaceCall(node, identation, name, parsedArg, parsedArg2);\n case 'replaceAll':\n return this.printReplaceAllCall(node, identation, name, parsedArg, parsedArg2);\n }\n }\n }\n } else {\n // handle functions like assert\n const args = node.arguments ?? [];\n if (args.length === 2) {\n if ( expression.text === \"assert\") {\n return this.printAssertCall(node, identation, parsedArgs);\n }\n if (expression.text === \"padEnd\") {\n // check this\n }\n }\n }\n\n // print super() call inside constructor\n if (expression.kind === SyntaxKind.SuperKeyword) {\n return this.printSuperCallInsideConstructor(node, identation);\n }\n\n let parsedExpression = undefined;\n if (this.CallExpressionReplacements.hasOwnProperty(expression.getText())) { // eslint-disable-line\n parsedExpression = this.CallExpressionReplacements[expression.getText()];\n } else {\n if (expression.kind === SyntaxKind.Identifier) {\n const idValue = expression.text ?? expression.text;\n parsedExpression = this.transformCallExpressionName(this.unCamelCaseIfNeeded(idValue), expression);\n } else {\n parsedExpression = this.printNode(expression, 0);\n }\n }\n\n let parsedCall = parsedExpression;\n if (!removeParenthesis) {\n parsedCall+= \"(\" + parsedArgs + \")\";\n\n }\n return parsedCall;\n }\n\n printClassBody(node, identation) {\n // const parsedMembers = node.members.map(m => this.printNode(m, identation+1));\n\n const parsedMembers = [];\n node.members.forEach( (m, index) => {\n const parsedNode = this.printNode(m, identation+1);\n if (m.kind === SyntaxKind.PropertyDeclaration || index === 0) {\n parsedMembers.push(parsedNode);\n } else {\n parsedMembers.push(\"\\n\".repeat(this.NUM_LINES_BETWEEN_CLASS_MEMBERS) + parsedNode);\n }\n });\n return parsedMembers.join(\"\\n\");\n }\n\n getCustomClassName(node) {\n return node.name.text;\n }\n\n getClassModifier(node) {\n return \"\";\n }\n\n printClassDefinition(node, identation) {\n const className = this.getCustomClassName(node);\n this.currentClassName = className;\n const heritageClauses = node.heritageClauses;\n const classModifier = this.getClassModifier(node);\n\n let classInit = \"\";\n const classOpening = this.getBlockOpen(identation);\n if (heritageClauses !== undefined) {\n const classExtends = heritageClauses[0].types[0].expression.text;\n classInit = this.getIden(identation) + classModifier + \"class \" + className + \" \" + this.EXTENDS_TOKEN + \" \" + classExtends + classOpening;\n } else {\n classInit = this.getIden(identation) + classModifier + \"class \" + className + classOpening;\n }\n return classInit;\n }\n\n printClass(node, identation) {\n\n const classDefinition = this.printClassDefinition(node, identation);\n\n const classBody = this.printClassBody(node, identation);\n\n const classClosing = this.getBlockClose(identation);\n\n return classDefinition + classBody + classClosing;\n }\n\n printConstructorDeclaration (node, identation) {\n const args = this.printMethodParameters(node);\n const constructorBody = this.printFunctionBody(node, identation);\n return this.getIden(identation) +\n this.CONSTRUCTOR_TOKEN +\n \"(\" + args + \")\" +\n constructorBody;\n }\n\n printWhileStatement(node, identation) {\n const loopExpression = node.expression;\n\n const expression = this.printNode(loopExpression, 0);\n\n const whileStm = this.getIden(identation) +\n this.WHILE_TOKEN + \" \" +\n this.CONDITION_OPENING + expression + this.CONDITION_CLOSE +\n this.printBlock(node.statement, identation);\n return this.printNodeCommentsIfAny(node, identation, whileStm);\n }\n\n printForStatement(node, identation) {\n const initializer = this.printNode(node.initializer, 0);\n const condition = this.printNode(node.condition, 0);\n const incrementor = this.printNode(node.incrementor, 0);\n\n const forStm = this.getIden(identation) +\n this.FOR_TOKEN + \" \" +\n this.CONDITION_OPENING +\n initializer + \"; \" + condition + \"; \" + incrementor +\n this.CONDITION_CLOSE +\n this.printBlock(node.statement, identation);\n return this.printNodeCommentsIfAny(node, identation, forStm);\n }\n\n printBreakStatement(node, identation) {\n const breakStm = this.getIden(identation) + this.BREAK_TOKEN + this.LINE_TERMINATOR;\n return this.printNodeCommentsIfAny(node, identation, breakStm);\n }\n\n printPostFixUnaryExpression(node, identation) {\n const {operand, operator} = node;\n return this.getIden(identation) + this.printNode(operand, 0) + this.PostFixOperators[operator];\n }\n\n printPrefixUnaryExpression(node, identation) {\n const {operand, operator} = node;\n if (operator === SyntaxKind.ExclamationToken) {\n // not branch check falsy/turthy values if needed;\n return this.getIden(identation) + this.PrefixFixOperators[operator] + this.printCondition(node.operand, 0);\n }\n return this.getIden(identation) + this.PrefixFixOperators[operator] + this.printNode(operand, 0);\n }\n\n printObjectLiteralBody(node, identation) {\n let body = node.properties.map((p) => this.printNode(p, identation+1)).join(\",\\n\");\n body = body ? body + \",\" : body;\n return body;\n }\n\n printObjectLiteralExpression(node, identation) {\n const objectBody = this.printObjectLiteralBody(node, identation);\n const formattedObjectBody = objectBody ? \"\\n\" + objectBody + \"\\n\" + this.getIden(identation) : objectBody;\n return this.OBJECT_OPENING + formattedObjectBody + this.OBJECT_CLOSING;\n }\n\n printCustomRightSidePropertyAssignment(node, identation): string {\n return undefined; // stub to override\n }\n\n printPropertyAssignment(node, identation) {\n const {name, initializer} = node;\n const nameAsString = this.printNode(name, 0);\n\n const customRightSide = this.printCustomRightSidePropertyAssignment(initializer, identation);\n\n const valueAsString = customRightSide ? customRightSide : this.printNode(initializer, identation);\n\n let trailingComment = this.printTraillingComment(node, identation);\n trailingComment = trailingComment ? \" \" + trailingComment : trailingComment;\n\n const propOpen = this.PROPERTY_ASSIGNMENT_OPEN ? this.PROPERTY_ASSIGNMENT_OPEN + \" \": \"\";\n const propClose = this.PROPERTY_ASSIGNMENT_CLOSE ? \" \" + this.PROPERTY_ASSIGNMENT_CLOSE : \"\";\n\n return this.getIden(identation) +\n propOpen +\n nameAsString +\n this.PROPERTY_ASSIGNMENT_TOKEN + \" \" +\n valueAsString.trim() +\n propClose +\n trailingComment;\n }\n\n printElementAccessExpressionExceptionIfAny(node) {\n return undefined; // stub to override\n }\n\n // index WRITE (`x[\"k\"] = v`) whose receiver the C# classifier already declared as a\n // concrete dictionary: the `((IDictionary)x)` interface cast the C#\n // branch below emits only exists because the TS type says nothing about the printed\n // declaration, so a printer that knows the declared type can drop it. undefined/false\n // keeps the upstream cast (the untyped emission). See csharpTranspiler.ts.\n csharpDictionaryIndexWriteNeedsNoCast(node): boolean | undefined {\n return undefined; // stub to override\n }\n\n printElementAccessExpression(node, identation) {\n // example x['test']\n const {expression, argumentExpression} = node;\n\n const exception = this.printElementAccessExpressionExceptionIfAny(node);\n if (exception) {\n return exception;\n }\n\n // when we want replace x['test'] with getValue(x, 'test') only when in the left side\n // Examples:\n // x[\"a\"] = x[\"b\"] : binary expression\n // const a = x[\"b\"] : variable declaration\n const isLeftSideOfAssignment = node.parent?.kind === SyntaxKind.BinaryExpression &&\n (node.parent.operatorToken.kind === SyntaxKind.EqualsToken || node.parent.operatorToken.kind === SyntaxKind.PlusEqualsToken) &&\n node.parent?.left === node;\n // to do; check nested accesses\n // const newNode = node.parent;\n // we need this loop because we might have x[\"t\"][\"test\"][\"key\"]\n // so the parent of the node might be another ElementAccessExpression and not the binary expression/variable declaration directly\n // to do\n // while (newNode !== undefined && newNode.kind !== ts.SyntaxKind.BinaryExpression) {\n // if (newNode.right === node) {\n // rightSideOfAssignment = true;\n // break;\n // }\n // newNode = newNode.parent;\n // }\n\n const expressionAsString = this.printNode(expression, 0);\n const argumentAsString = this.printNode(argumentExpression, 0);\n\n // c# only\n if (!isLeftSideOfAssignment && this.ELEMENT_ACCESS_WRAPPER_OPEN && this.ELEMENT_ACCESS_WRAPPER_CLOSE) {\n return `${this.ELEMENT_ACCESS_WRAPPER_OPEN}${expressionAsString}, ${argumentAsString}${this.ELEMENT_ACCESS_WRAPPER_CLOSE}`;\n }\n // cast order[\"test\"] to ((Dictionariy)order)[\"test\"] or List\n if (isLeftSideOfAssignment && this.ELEMENT_ACCESS_WRAPPER_OPEN && this.ELEMENT_ACCESS_WRAPPER_CLOSE) {\n const type = this.getChecker().getTypeAtLocation(argumentExpression);\n const isString = this.isStringType(type.flags);\n\n let isUnionString = false; // handle unions later\n if (type.flags === TypeFlags.Union) {\n isUnionString = this.isStringType((type as any).getTypes()[0].flags);\n }\n\n if (isString || isUnionString || type.flags === TypeFlags.Any) { // default to string when unknown\n // to do refactor and move this to the derived classes\n if (this.id === \"C#\") {\n const cast = isStringLiteralLikeNode(argumentExpression) ? \"\" : '(string)';\n // a receiver the C# classifier declared as a concrete dictionary needs no\n // interface cast (see csharpDictionaryIndexWriteNeedsNoCast); the key keeps\n // its own spelling, so only the receiver's cast is dropped\n if (this.csharpDictionaryIndexWriteNeedsNoCast(node)) {\n return `${expressionAsString}[${cast}${argumentAsString}]`;\n }\n return `((IDictionary)${expressionAsString})[${cast}${argumentAsString}]`;\n } else if (this.id === \"Java\") {\n return `((java.util.HashMap)${expressionAsString}).get(${argumentAsString})`;\n }\n // if (this.id === \"Go\") {\n // return `AddElementToObject(${expressionAsString}, ${argumentAsString})`;\n // }\n\n }\n if (this.id === \"C#\") {\n return `((${this.ARRAY_KEYWORD})${expressionAsString})[Convert.ToInt32(${argumentAsString})]`;\n } else if (this.id === \"Java\") {\n return `((java.util.List)${expressionAsString}).get(Helpers.toInt(${argumentAsString}))`;\n }\n\n }\n\n return expressionAsString + \"[\" + argumentAsString + \"]\";\n }\n\n printCondition (node, identation) {\n\n if (this.supportsFalsyOrTruthyValues) {\n // languages like php or python do not need this extra logic\n return this.printNode(node, identation);\n }\n\n // can be called from ifs or conditional expressions or binary expressions so might contain the ! operator\n if (node.kind === SyntaxKind.PrefixUnaryExpression && node.operator === SyntaxKind.ExclamationToken) {\n return this.printPrefixUnaryExpression(node, identation); // avoid infinite recursion\n }\n\n // wrap falsy/truthy expressions unconditionally: printing the node once and\n // wrapping is equivalent to the previous always-true branches, which printed\n // the subtree twice and queried the type checker without using the result\n const expression = `${this.FALSY_WRAPPER_OPEN}${this.printNode(node, 0)}${this.FALSY_WRAPPER_CLOSE}`;\n return `${this.getIden(identation)}${expression}`; // stub to override\n }\n\n\n printIfStatement(node, identation) {\n\n const expression = this.printCondition(node.expression, 0);\n\n const elseExists = node.elseStatement !== undefined;\n const isElseIf = node.parent.kind === SyntaxKind.IfStatement;\n\n const needChainBlock = elseExists;\n const ifBody = this.printBlock(node.thenStatement, identation, needChainBlock);\n\n let ifComplete = this.CONDITION_OPENING + expression + this.CONDITION_CLOSE + ifBody;\n if (isElseIf) {\n ifComplete = this.ELSEIF_TOKEN + \" \" + ifComplete;\n } else {\n ifComplete = this.getIden(identation) + this.IF_TOKEN + \" \" + ifComplete;\n }\n\n const elseStatement = node.elseStatement;\n if (elseStatement?.kind === SyntaxKind.Block) {\n\n const elseBody = this.printBlock(elseStatement, identation);\n\n const elseBlock = this.ELSE_TOKEN + elseBody;\n\n ifComplete += elseBlock;\n\n } else if (elseStatement?.kind === SyntaxKind.IfStatement) {\n const elseBody = this.printIfStatement(elseStatement, identation);\n ifComplete += elseBody;\n }\n return this.printNodeCommentsIfAny(node, identation, ifComplete);\n }\n\n printParenthesizedExpression(node, identation) {\n if (node.expression.kind === SyntaxKind.AsExpression) {\n // transform (this as any) into this, () and as any are not necessary\n return this.getIden(identation) + this.printNode(node.expression, 0);\n }\n if (node.expression.kind === SyntaxKind.ArrowFunction) {\n // ignore arrowFunctions inside parenthesis\n return \"\";\n }\n return this.getIden(identation) + this.LEFT_PARENTHESIS + this.printNode(node.expression, 0) + this.RIGHT_PARENTHESIS;\n }\n\n printBooleanLiteral(node) {\n if (SyntaxKind.TrueKeyword === node.kind) {\n return this.TRUE_KEYWORD;\n }\n return this.FALSE_KEYWORD;\n }\n\n printTryStatement(node, identation) {\n const tryBody = this.printBlock(node.tryBlock, identation, true);\n\n const catchBody = this.printBlock(node.catchClause.block, identation);\n const catchDeclaration = this.CATCH_DECLARATION + \" \" + this.printNode(node.catchClause.variableDeclaration.name, 0);\n\n const catchCondOpen = this.CONDITION_OPENING ? this.CONDITION_OPENING : \" \";\n\n return this.getIden(identation) + this.TRY_TOKEN +\n tryBody +\n this.CATCH_TOKEN + catchCondOpen + catchDeclaration + this.CONDITION_CLOSE +\n catchBody;\n }\n\n printNewExpression(node, identation) {\n let expression = node.expression?.text;\n expression = expression ? expression : this.printNode(node.expression); // new Exception or new exact[string] check this out\n const args = node.arguments.map(n => this.printNode(n, identation)).join(\", \");\n const newToken = this.NEW_TOKEN ? this.NEW_TOKEN + \" \" : \"\";\n return newToken + expression + this.LEFT_PARENTHESIS + args + this.RIGHT_PARENTHESIS;\n }\n\n printThrowStatement(node, identation) {\n const expression = this.printNode(node.expression, 0);\n return this.getIden(identation) + this.THROW_TOKEN + \" \" + expression + this.LINE_TERMINATOR;\n }\n\n printAwaitExpression(node, identation) {\n const expression = this.printNode(node.expression, identation);\n const awaitToken = this.asyncTranspiling ? this.AWAIT_TOKEN + \" \" : \"\";\n return awaitToken + expression;\n }\n\n wrapSyntheticNode(synthetic, original) {\n // give the synthetic wrapper the original node's source range and splice it\n // into the parent chain, so position/type based helpers keep working\n synthetic.pos = original.pos;\n synthetic.end = original.end;\n synthetic.parent = original.parent;\n original.parent = synthetic;\n return synthetic;\n }\n\n wrapImplicitReturnAwait(node) {\n // inside a non-async function transpiled as async (isImplicitAsyncFunction),\n // returned Promises must be awaited to keep the generated code equivalent to\n // the classic `async`/`return await` form: wrap them in a synthetic await\n // expression so every language prints them through its usual await path\n let exp = node.expression;\n if (!exp || isAwaitExpression(exp)\n || !this.isImplicitAsyncFunction(findAncestor(node, isFunctionLike))\n || !this.isPromiseType(this.getChecker().getTypeAtLocation(exp))) {\n return node;\n }\n if (isConditionalExpression(exp) || isBinaryExpression(exp)) {\n // an await-token prefix would change precedence (e.g. `await a ? b : c`)\n exp = this.wrapSyntheticNode(createParenthesizedExpression(exp), exp);\n }\n // TS7 program nodes are read-only: print a synthetic return in place of the original\n const synthetic = this.wrapSyntheticNode(createReturnStatement(undefined), node);\n const awaited = this.wrapSyntheticNode(createAwaitExpression(exp), exp);\n awaited.parent = synthetic;\n Object.defineProperty(synthetic, \"expression\", { value: awaited });\n node.parent = synthetic.parent;\n return synthetic;\n }\n\n printConditionalExpression(node, identation) {\n const condition = this.printCondition(node.condition, identation);\n const whenTrue = this.printNode(node.whenTrue, 0);\n const whenFalse = this.printNode(node.whenFalse, 0);\n\n return condition + \" ? \" + whenTrue + \" : \" + whenFalse;\n }\n\n printAsExpression(node, identation) {\n return this.printNode(node.expression, identation);\n }\n\n getFunctionNodeFromReturn(node) {\n let parent = node.parent;\n while (parent) {\n if (parent.kind === SyntaxKind.FunctionDeclaration || parent.kind === SyntaxKind.MethodDeclaration) {\n return parent;\n }\n parent = parent.parent;\n }\n return undefined;\n }\n\n\n printReturnStatement(node, identation) {\n const leadingComment = this.printLeadingComments(node, identation);\n let trailingComment = this.printTraillingComment(node, identation);\n trailingComment = trailingComment ? \" \" + trailingComment : trailingComment;\n const exp = node.expression;\n let rightPart = exp ? (' ' + this.printNode(exp, identation)) : '';\n rightPart = rightPart.trim();\n\n // cast return type if needed\n // if (false && this.requiresCallExpressionCast) {\n // const functionNode = this.getFunctionNodeFromReturn(node);\n // let functionType = this.getFunctionType(functionNode, false);\n // if (functionType === undefined) {\n // // check the parent method type if any\n // const overrideMethod = this.getMethodOverride(functionNode);\n // if (overrideMethod !== undefined) {\n // functionType = this.getFunctionType(overrideMethod, false);\n // }\n // }\n // if (functionType && exp?.kind !== ts.SyntaxKind.UndefinedKeyword) {\n // rightPart = rightPart ? ' ' + `((${functionType}) (${rightPart}))` + this.LINE_TERMINATOR : this.LINE_TERMINATOR;\n // return leadingComment + this.getIden(identation) + this.RETURN_TOKEN + rightPart + trailingComment;\n // }\n // }\n rightPart = rightPart ? ' ' + rightPart + this.LINE_TERMINATOR : this.LINE_TERMINATOR;\n return leadingComment + this.getIden(identation) + this.RETURN_TOKEN + rightPart + trailingComment;\n }\n\n printArrayBindingPattern(node, identation) {\n const elements = node.elements.map((e) => this.printNode(e.name, identation)).join(\", \");\n return this.getIden(identation) + this.ARRAY_OPENING_TOKEN + elements + this.ARRAY_CLOSING_TOKEN;\n }\n\n printBlock(node, identation, chainBlock = false) {\n const blockOpen = this.getBlockOpen(identation);\n const blockClose = this.getBlockClose(identation, chainBlock);\n const statements = node.statements.map((s) => this.printNode(s, identation+1)).join(\"\\n\");\n\n return blockOpen + statements + blockClose;\n }\n\n printExpressionStatement(node, identation) {\n if (this.isCJSModuleExportsExpressionStatement(node)) {\n return \"\"; // remove module.exports = ...\n }\n\n const expressionStatementPrefixes = this.getExpressionStatementPrefixesIfAny(node, identation) ?? \"\";\n\n const exprStm = this.printNode(node.expression, identation);\n\n // skip empty statements\n if (exprStm.length === 0) {\n return \"\";\n }\n const expStatement = expressionStatementPrefixes + this.getIden(identation) + exprStm + this.LINE_TERMINATOR;\n return this.printNodeCommentsIfAny(node, identation, expStatement);\n }\n\n getExpressionStatementPrefixesIfAny(node, identation) {\n return undefined;\n }\n\n printPropertyDeclaration(node, identation) {\n const modifiers = this.printPropertyAccessModifiers(node);\n const name = this.printNode(node.name, 0);\n if (node.initializer) {\n const initializer = this.printNode(node.initializer, 0);\n return this.getIden(identation) + modifiers + name + \" = \" + initializer + this.LINE_TERMINATOR;\n }\n return this.getIden(identation) + modifiers + name + this.LINE_TERMINATOR;\n }\n\n printPropertyAccessModifiers (node) {\n let modifiers = this.printModifiers(node);\n modifiers = modifiers ? modifiers + \" \" : modifiers;\n return modifiers;\n }\n\n printSpreadElement(node, identation) {\n const expression = this.printNode(node.expression, 0);\n return this.getIden(identation) + this.SPREAD_TOKEN + expression;\n }\n\n printNullKeyword(node, identation){\n return this.getIden(identation) + this.NULL_TOKEN;\n }\n\n printContinueStatement(node, identation){\n return this.getIden(identation) + this.CONTINUE_TOKEN + this.LINE_TERMINATOR;\n }\n\n printDeleteExpression (node, identation) {\n return undefined;\n }\n\n printThisKeyword(node, identation) {\n return this.THIS_TOKEN;\n }\n\n printNode(node, identation = 0): string {\n\n try {\n // dispatch on node.kind directly: every ts.isX predicate used here is a\n // plain kind comparison, and a switch avoids running ~45 predicate calls\n // for nodes that match late (or not at all) in the former if-else chain\n switch (node.kind) {\n case SyntaxKind.ExpressionStatement:\n return this.printExpressionStatement(node, identation);\n case SyntaxKind.Block:\n return this.printBlock(node, identation);\n case SyntaxKind.FunctionDeclaration:\n case SyntaxKind.FunctionExpression:\n case SyntaxKind.ArrowFunction:\n return this.printFunctionDeclaration(node, identation);\n case SyntaxKind.ClassDeclaration:\n return this.printClass(node, identation);\n case SyntaxKind.VariableStatement:\n return this.printVariableStatement(node, identation);\n case SyntaxKind.MethodDeclaration:\n return this.printMethodDeclaration(node, identation);\n case SyntaxKind.StringLiteral:\n return this.printStringLiteral(node);\n case SyntaxKind.NumericLiteral:\n return this.printNumericLiteral(node);\n case SyntaxKind.PropertyAccessExpression:\n return this.printPropertyAccessExpression(node, identation);\n case SyntaxKind.ArrayLiteralExpression:\n return this.printArrayLiteralExpression(node, identation);\n case SyntaxKind.CallExpression:\n return this.printCallExpression(node, identation);\n case SyntaxKind.WhileStatement:\n return this.printWhileStatement(node, identation);\n case SyntaxKind.BinaryExpression:\n return this.printBinaryExpression(node, identation);\n case SyntaxKind.BreakStatement:\n return this.printBreakStatement(node, identation);\n case SyntaxKind.ForStatement:\n return this.printForStatement(node, identation);\n case SyntaxKind.PostfixUnaryExpression:\n return this.printPostFixUnaryExpression(node, identation);\n case SyntaxKind.VariableDeclarationList:\n return this.printVariableDeclarationList(node, identation); // statements are slightly different if inside a for\n case SyntaxKind.ObjectLiteralExpression:\n return this.printObjectLiteralExpression(node, identation);\n case SyntaxKind.PropertyAssignment:\n return this.printPropertyAssignment(node, identation);\n case SyntaxKind.Identifier:\n return this.printIdentifier(node);\n case SyntaxKind.ElementAccessExpression:\n return this.printElementAccessExpression(node, identation);\n case SyntaxKind.IfStatement:\n return this.printIfStatement(node, identation);\n case SyntaxKind.ParenthesizedExpression:\n return this.printParenthesizedExpression(node, identation);\n case SyntaxKind.TrueKeyword:\n case SyntaxKind.FalseKeyword:\n return this.printBooleanLiteral(node);\n case SyntaxKind.ThisKeyword:\n return this.printThisKeyword(node, identation);\n case SyntaxKind.SuperKeyword:\n return this.SUPER_TOKEN;\n case SyntaxKind.TryStatement:\n return this.printTryStatement(node, identation);\n case SyntaxKind.PrefixUnaryExpression:\n return this.printPrefixUnaryExpression(node, identation);\n case SyntaxKind.ThrowStatement:\n return this.printThrowStatement(node, identation);\n case SyntaxKind.NewExpression:\n return this.printNewExpression(node, identation);\n case SyntaxKind.AwaitExpression:\n return this.printAwaitExpression(node, identation);\n case SyntaxKind.ConditionalExpression:\n return this.printConditionalExpression(node, identation);\n case SyntaxKind.AsExpression:\n return this.printAsExpression(node, identation);\n case SyntaxKind.ReturnStatement:\n return this.printReturnStatement(this.wrapImplicitReturnAwait(node), identation);\n case SyntaxKind.ArrayBindingPattern:\n return this.printArrayBindingPattern(node, identation);\n case SyntaxKind.Parameter:\n return this.printParameter(node);\n case SyntaxKind.Constructor:\n return this.printConstructorDeclaration(node, identation);\n case SyntaxKind.PropertyDeclaration:\n return this.printPropertyDeclaration(node, identation);\n case SyntaxKind.SpreadElement:\n return this.printSpreadElement(node, identation);\n case SyntaxKind.NullKeyword:\n return this.printNullKeyword(node, identation);\n case SyntaxKind.ContinueStatement:\n return this.printContinueStatement(node, identation);\n case SyntaxKind.DeleteExpression:\n return this.printDeleteExpression(node, identation);\n }\n\n if (node.statements) {\n if (isSourceFile(node)) {\n // reset the current class name when entering a new file so a\n // class name from a previously transpiled file does not leak\n // into a class-less file (e.g. try/catch wrappers in tests)\n this.className = \"undefined\";\n }\n const transformedStatements = node.statements.map((m)=> {\n return this.printNode(m, identation + 1);\n });\n\n return transformedStatements.filter(st => st.length > 0 ).join(\"\\n\" + \"\\n\".repeat(this.LINES_BETWEEN_FILE_MEMBERS)) + \"\\n\".repeat(this.NUM_LINES_END_FILE);\n }\n return \"\";\n\n } catch (e) {\n if (!(e instanceof TranspilationError)) {\n console.error('[ast-transpiler] underlying error:', e && (e.stack || e.message || e));\n }\n throw new TranspilationError(this.id, (e && (e.messageText ?? e.message)) ?? String(e), node.getFullText(), node.pos, node.end);\n }\n }\n\n getFileESMImports(node): IFileImport[] {\n const result = [];\n const importStatements = node.statements.filter((s) => isImportDeclaration(s));\n importStatements.forEach(node => {\n const importPath = node.moduleSpecifier.text;\n const importClause = node.importClause;\n const namedImports = importClause.namedBindings;\n if (namedImports) {\n if (namedImports.elements) {\n // named imports\n namedImports.elements.forEach((elem) => {\n const name = elem.name.text;\n const fileImport: IFileImport = {\n name,\n path: importPath,\n isDefault: false\n };\n result.push(fileImport);\n });\n } else {\n // namespace import (import * as name from 'path')\n const name = namedImports.name.text;\n const fileImport: IFileImport = {\n name,\n path: importPath,\n isDefault: false\n };\n result.push(fileImport);\n }\n\n } else {\n // default import\n const name = importClause.name.text;\n const fileImport: IFileImport = {\n name,\n path: importPath,\n isDefault: true\n };\n result.push(fileImport);\n }\n });\n return result;\n }\n\n isCJSRequireStatement(node): boolean {\n const dec = node.declarationList.declarations[0];\n return dec.initializer && isCallExpression(dec.initializer) && dec.initializer.expression.getText() === \"require\";\n }\n\n isCJSModuleExportsExpressionStatement(node): boolean {\n if (node.expression && node.expression.kind === SyntaxKind.BinaryExpression ) {\n if (node.expression.left.kind === SyntaxKind.PropertyAccessExpression) {\n const left = node.expression.left as PropertyAccessExpression;\n return left.expression.getText() === \"module\" && left.name.getText() === \"exports\";\n }\n }\n return false;\n }\n\n getCJSImports(node): IFileImport[] {\n const result = [];\n const varStatements = node.statements.filter(s => isVariableStatement(s));\n const decList = varStatements.map(s => s.declarationList);\n const dec = decList.map(d => d.declarations[0]);\n\n dec.forEach(decNode => {\n if (decNode.initializer && decNode.initializer.kind === SyntaxKind.CallExpression) {\n const callExpression = decNode.initializer.expression.getText();\n if (callExpression === \"require\") {\n const isDefault = decNode.name.kind === SyntaxKind.Identifier;\n const importPath = decNode.initializer.arguments[0].text;\n if (isDefault) {\n const name = decNode.name.text;\n const fileImport: IFileImport = {\n name,\n path: importPath,\n isDefault: isDefault\n };\n result.push(fileImport);\n } else {\n const elems = decNode.name.elements;\n elems.forEach(elem => {\n const name = elem.name.text;\n const fileImport: IFileImport = {\n name,\n path: importPath,\n isDefault: false,\n };\n result.push(fileImport);\n });\n }\n }\n }\n });\n\n return result;\n }\n\n getFileImports(node): IFileImport[] {\n const esmImports = this.getFileESMImports(node);\n if (esmImports.length > 0) {\n return esmImports;\n }\n const cjsImports = this.getCJSImports(node);\n return cjsImports;\n }\n\n getESMExports(node): IFileExport[] {\n const result = [];\n const namedExports = node.statements.filter((s) => isExportDeclaration(s));\n const defaultExport = node.statements.filter((s) => isExportAssignment(s));\n\n namedExports.forEach(node => {\n const namedExports = node.exportClause;\n if (namedExports) {\n namedExports.elements.forEach((elem) => {\n const name = elem.name.text;\n const fileExport: IFileExport = {\n name,\n isDefault: false\n };\n result.push(fileExport);\n });\n }\n });\n\n defaultExport.forEach(node => {\n const name = node.expression.getText();\n const fileExport: IFileExport = {\n name,\n isDefault: true\n };\n result.push(fileExport);\n });\n return result;\n }\n\n getCJSExports(node): IFileExport[] {\n const result = [];\n const moduleExports = node.statements.filter(s => this.isCJSModuleExportsExpressionStatement(s)).map(s => s.expression as BinaryExpression);\n\n moduleExports.forEach(node => {\n const right = node.right;\n if (right.kind === SyntaxKind.ObjectLiteralExpression) {\n const props = right.properties;\n props.forEach(prop => {\n const name = prop.name.getText();\n const fileExport: IFileExport = {\n name,\n isDefault: false\n };\n result.push(fileExport);\n });\n }\n if (right.kind === SyntaxKind.Identifier) {\n const name = right.getText();\n const fileExport: IFileExport = {\n name,\n isDefault: true\n };\n result.push(fileExport);\n }\n });\n return result;\n }\n\n getExportDeclarations(node): IFileExport[] {\n // example export default class X\n const result = [];\n const classDeclarations = node.statements.filter((s) => isClassDeclaration(s));\n const functionDeclarations = node.statements.filter((s) => isFunctionDeclaration(s));\n\n const both = classDeclarations.concat(functionDeclarations);\n both.forEach(classNode => {\n const modifiers = classNode.modifiers;\n if (modifiers) {\n const isDefault = modifiers.some((m) => m.kind === SyntaxKind.DefaultKeyword);\n if (isDefault) {\n const name = classNode.name.text;\n const fileExport: IFileExport = {\n name,\n isDefault: true\n };\n result.push(fileExport);\n }\n }\n });\n return result;\n }\n\n getFileExports(node): IFileExport[] {\n const defaultClassAndFunctionsExports = this.getExportDeclarations(node);\n const esmExports = this.getESMExports(node).concat(defaultClassAndFunctionsExports);\n if (esmExports.length > 0) {\n return esmExports;\n }\n return this.getCJSExports(node);\n }\n\n getReturnTypeFromMethod(node): string {\n // first try custom type\n\n const bType = this.getChecker().getTypeAtLocation(node);\n // const func2Symbol = bType.getProperty(\"test1\")!;\n const bSymbol = bType.getSymbol();\n const func2Type = this.getChecker().getTypeOfSymbolAtLocation(bSymbol, bSymbol.valueDeclaration.resolve());\n const func2Signature = this.getChecker().getSignaturesOfType(func2Type, SignatureKind.Call)[0];\n const rawType = func2Signature.getReturnType();\n // const parsed = ts.TypeFlags[rawType.flags];\n // console.log(parsed);\n const res = this.getChecker().typeToString(rawType); // C\n if (res === undefined) {\n const name = node.type?.typeName?.text;\n if (name){\n return name as string;\n }\n }\n return res;\n }\n\n getParameterType(node): IParameterType {\n const isOptional = node.questionToken !== undefined;\n\n const result: IParameterType = {\n name: node.name.getText(),\n isOptional: isOptional,\n type: undefined\n };\n\n if (node.initializer !== undefined) {\n result.initializer = node.initializer.getText();\n }\n\n // first try custom type\n if (node.type === undefined) {\n // does not have a type or uses a initializer\n if (node.initializer !== undefined) {\n const type = this.getChecker().getTypeAtLocation(node.initializer);\n const res = this.getChecker().typeToString(type); // C\n // console.log(\"initializer\", res);\n // result.initializer = node.initializer.text;\n result.type = TypeFlags[type.flags];\n return result;\n }\n }\n\n const name = node.type?.typeName?.text;\n if (name){\n result.type = name as string;\n if (node.initializer !== undefined) {\n result.initializer = node.initializer.text;\n }\n return result;\n }\n\n if (node.type != undefined) {\n const type = this.getChecker().getTypeAtLocation(node.type);\n const res = this.getChecker().typeToString(type); // C\n result.type = res as string;\n return result;\n }\n return result;\n }\n\n getMethodTypes(file): IMethodType[] {\n const result: IMethodType[] = [];\n if (!file.statements) {\n return result;\n }\n const classDeclarations = file.statements.filter((s) => isClassDeclaration(s));\n classDeclarations.forEach((node) => {\n const methods = node.members.filter((m) => isMethodDeclaration(m));\n methods.forEach(m => {\n const isAsync = this.isAsyncFunction(m);\n const name = m.name.getText();\n const returnType = this.getReturnTypeFromMethod(m);\n const parameters = (m as any).parameters;\n // const paramTypes:IParameterType[] = parameters.map((p) => this.getParameterType(p));\n const paramTypes:IParameterType[] = [];\n parameters.forEach((p) => {\n const res = this.getParameterType(p);\n paramTypes.push(res);\n });\n result.push({\n name,\n async:isAsync,\n returnType,\n parameters: paramTypes\n });\n });\n });\n\n return result;\n }\n}\n\nexport {\n BaseTranspiler\n};\n","import { type SourceFile } from \"typescript/unstable/ast\";\nimport { type API, type Checker, type Program, type Snapshot } from \"typescript/unstable/sync\";\n\ninterface IInput {\n language: Languages;\n async: boolean;\n}\n\n// per-transpile typescript state. Holding it in an explicit object (owned by the\n// Transpiler instance and handed to the language printers) instead of process\n// globals keeps concurrent/nested transpilations from clobbering each other.\ninterface ITranspileContext {\n src: SourceFile;\n checker: Checker;\n program: Program;\n}\n\n// The TS7 API server the programs are created on. Shareable between Transpiler\n// instances on the same thread; a worker_threads isolate needs its own.\ninterface ITranspileProgramCache {\n api?: API;\n // the run-wide program set by Transpiler.setSharedProgram\n shared?: { snapshot: Snapshot, program: Program, checker: Checker };\n}\n\n\ninterface IParameterType {\n name: string;\n type: string;\n isOptional: boolean;\n initializer?: string;\n}\n\ninterface IMethodType {\n async: boolean;\n name: string;\n returnType: string;\n parameters: IParameterType[];\n}\n\ninterface IFileImport {\n name: string;\n path: string;\n isDefault: boolean;\n}\n\ninterface IFileExport {\n name: string;\n isDefault: boolean;\n}\n\ninterface ITranspiledFile {\n content: string;\n imports: IFileImport[];\n exports: IFileExport[];\n methodsTypes?: IMethodType[];\n}\n\nenum Languages {\n Python,\n Php,\n CSharp,\n Go,\n Java,\n Rust,\n Cpp\n}\n\nenum TranspilationMode {\n ByPath,\n ByContent\n}\n\n// const TranspilingError = (message) => ({\n// error: new Error(message),\n// code: 'TRANSPILING ERROR'\n// });\n\nclass TranspilationError extends Error {\n constructor (id, message, nodeText, start, end) {\n const parsedMessage = `Lang: ${id} Error: ${message} at ${start}:${end} node: \"${nodeText}\"`;\n super (parsedMessage);\n this.name = 'TranspilationError';\n\n }\n}\n\n// class FunctionReturnTypeError extends TranspilationError {\n// constructor (message) {\n// super (message);\n// this.name = 'FuctionReturnTypeError';\n// }\n// }\n\n// class FunctionArgumentTypeError extends TranspilationError {\n// constructor (message) {\n// super (message);\n// this.name = 'FunctionArgumentTypeError';\n// }\n// }\n\nexport {\n Languages,\n TranspilationMode,\n IFileImport,\n ITranspiledFile,\n IFileExport,\n ITranspileContext,\n ITranspileProgramCache,\n TranspilationError,\n // FunctionReturnTypeError,\n // FunctionArgumentTypeError,\n IInput,\n IMethodType,\n IParameterType\n};","\n\nfunction regexAll (text: string, array: any[]): string {\n for (const i in array) {\n let regex = array[i][0];\n const flags = (typeof regex === 'string') ? 'g' : undefined;\n regex = new RegExp (regex, flags);\n text = text.replace (regex, array[i][1]);\n }\n return text;\n}\n\nfunction unCamelCase (s: string): string | undefined {\n return s.match (/[A-Z]/) ? s.replace (/[a-z0-9][A-Z]/g, x => x[0] + '_' + x[1]).replace(/[A-Z0-9][A-Z0-9][a-z][^$]/g, x => x[0] + '_' + x[1] + x[2] + x[3]).replace(/[a-z][0-9]$/g, x=> x[0] + '_' + x[1]).toLowerCase () : undefined;\n}\n\n// function extend (...args) {\n// Object.assign ({}, ...args);\n// }\n\nexport {\n regexAll,\n unCamelCase,\n};\n","import { green, yellow, red } from \"colorette\";\n\nclass Logger {\n static verbose = true;\n\n // static createInstanceIfNeeded(): void {\n // if (!this._instance) {\n // this._instance = new Logger();\n // }\n // }\n\n static setVerboseMode(verbose: boolean) {\n this.verbose = verbose;\n }\n\n static log(message: string) {\n if (this.verbose) {\n console.log(message);\n }\n }\n\n static success(message: string) {\n this.log(green(`[SUCCESS]: ${message}`));\n }\n\n static warning(message: string) {\n this.log(yellow(`[WARNING]: ${message}`));\n }\n\n static error(message: string) {\n this.log(red(`[ERROR]: ${message}`));\n }\n}\n\nexport {\n Logger\n};\n\n","import { BaseTranspiler } from \"./baseTranspiler.js\";\nimport { SyntaxKind } from \"typescript/unstable/ast\";\nimport { isArrowFunction, isCallExpression, isFunctionDeclaration, isFunctionExpression } from \"typescript/unstable/ast/is\";\nimport { TypeFlags, type Checker } from \"typescript/unstable/sync\";\nimport { unCamelCase, regexAll } from \"./utils.js\";\nimport { Logger } from \"./logger.js\";\n\nconst parserConfig = {\n 'ELSEIF_TOKEN': 'elseif',\n 'THIS_TOKEN': '$this',\n 'PROPERTY_ACCESS_TOKEN': '->',\n 'UNDEFINED_TOKEN': 'null',\n 'NOT_TOKEN': '!',\n 'LINE_TERMINATOR': ';',\n 'ARRAY_OPENING_TOKEN':\"[\",\n 'ARRAY_CLOSING_TOKEN':\"]\",\n 'OBJECT_OPENING':\"array(\",\n 'OBJECT_CLOSING':\")\",\n 'FUNCTION_TOKEN': 'function',\n 'ASYNC_TOKEN': '',\n 'PROPERTY_ASSIGNMENT_TOKEN': ' =>',\n 'NEW_TOKEN': 'new',\n 'THROW_TOKEN': 'throw',\n 'SUPER_TOKEN': 'parent',\n 'CONSTRUCTOR_TOKEN': 'function __construct',\n 'SUPER_CALL_TOKEN': 'parent::__construct',\n 'CATCH_DECLARATION': 'Exception',\n 'CATCH_TOKEN': 'catch',\n 'BLOCK_OPENING_TOKEN' :'{',\n 'BLOCK_CLOSING_TOKEN' :'}',\n 'CONDITION_OPENING' :'(',\n 'CONDITION_CLOSE' :')',\n 'PLUS_PLUS_TOKEN': '++',\n 'MINUS_MINUS_TOKEN': '--',\n 'SPACE_DEFAULT_PARAM': ' ',\n 'EXCLAMATION_EQUALS_EQUALS_TOKEN': '!==',\n 'EQUALS_EQUALS_EQUALS_TOKEN': '===',\n 'STRING_QUOTE_TOKEN': '\\'',\n 'EXTENDS_TOKEN': 'extends',\n};\n\nexport class PhpTranspiler extends BaseTranspiler {\n awaitWrapper;\n propRequiresScopeResolutionOperator: string[];\n AWAIT_WRAPPER_OPEN;\n AWAIT_WRAPPER_CLOSE;\n ASYNC_FUNCTION_WRAPPER_OPEN = \"\";\n constructor(config = {}) {\n\n config['parser'] = Object.assign ({}, parserConfig, config['parser'] ?? {});\n\n super(config);\n this.id = \"php\";\n this.asyncTranspiling = config['async'] ?? true;\n this.uncamelcaseIdentifiers = config['uncamelcaseIdentifiers'] ?? false;\n this.removeVariableDeclarationForFunctionExpression = config['removeFunctionAssignToVariable'] ?? false;\n this.includeFunctionNameInFunctionExpressionDeclaration = config['includeFunctionNameInFunctionExpressionDeclaration'] ?? false;\n\n this.propRequiresScopeResolutionOperator = ['super'] + (config['ScopeResolutionProps'] ?? []);\n\n this.initConfig();\n\n // user overrides\n this.applyUserOverrides(config);\n\n // const propertyAccessRemoval = config['PropertyAccessRequiresParenthesisRemoval'] ?? [];\n // this.PropertyAccessRequiresParenthesisRemoval.push(...propertyAccessRemoval);\n\n this.AWAIT_WRAPPER_OPEN = config['AWAIT_WRAPPER_OPEN'] ?? \"\\\\React\\\\Async\\\\await(\";\n this.AWAIT_WRAPPER_CLOSE = config['AWAIT_WRAPPER_CLOSE'] ?? \")\";\n }\n\n printAwaitExpression(node, identation) {\n const expression = this.printNode(node.expression, identation);\n\n if (!this.asyncTranspiling) {\n return expression;\n }\n\n return this.AWAIT_WRAPPER_OPEN + expression + this.AWAIT_WRAPPER_CLOSE;\n }\n\n transformIdentifier(node, identifier) {\n if (this.uncamelcaseIdentifiers) {\n identifier = this.unCamelCaseIfNeeded(identifier);\n }\n\n // Get the symbol for the identifier\n const symbol = this.getChecker().getSymbolAtLocation(node);\n\n // Check if the symbol references a function declaration or expression\n const valueDecl = symbol?.valueDeclaration?.resolve();\n if (valueDecl) {\n\n // Check if it's a function (FunctionDeclaration, FunctionExpression, ArrowFunction)\n if (isFunctionDeclaration(valueDecl) || isFunctionExpression(valueDecl) || isArrowFunction(valueDecl)) {\n // Check if the identifier is passed as an argument in a function call\n if (node.parent && isCallExpression(node.parent) && node.parent.arguments.includes(node)) {\n return `'${identifier}'`; // Transpile function reference as string\n }\n }\n }\n\n // below is commented, due to : https://github.com/ccxt/ast-transpiler/pull/15\n //\n // If the identifier is a function parameter (callback), it should remain a variable with `$` prefix\n // if (node.parent && (ts.isParameter(node.parent) || (ts.isCallExpression(node.parent) && ts.isIdentifier(node)))) {\n // return \"$\" + identifier;\n // }\n\n // Default case: prepend $ for variables (non-functions), unless it's a class or constant\n if (!this.startsWithUpperCase(identifier)) {\n return \"$\" + identifier; // Prepend $ for variable names\n }\n\n return identifier;\n }\n\n\n getCustomOperatorIfAny(left, right, operator) {\n const STRING_CONCAT = '.';\n const PLUS_EQUALS_TOKEN = '.=';\n if (operator.kind == SyntaxKind.PlusToken || operator.kind == SyntaxKind.PlusEqualsToken) {\n\n const TOKEN = operator.kind == SyntaxKind.PlusToken ? STRING_CONCAT : PLUS_EQUALS_TOKEN;\n\n if (left.kind == SyntaxKind.StringLiteral || right.kind == SyntaxKind.StringLiteral) {\n return TOKEN;\n }\n\n const leftType = this.getChecker().getTypeAtLocation(left);\n const rightType = this.getChecker().getTypeAtLocation(right);\n\n if (leftType.flags === TypeFlags.String || rightType.flags === TypeFlags.String) {\n return TOKEN;\n }\n if (leftType.flags === TypeFlags.StringLiteral || rightType.flags === TypeFlags.StringLiteral) {\n return TOKEN;\n }\n }\n return undefined;\n }\n\n printLengthProperty(node, identation, name = undefined) {\n const leftSide = this.printNode(node.expression, 0);\n const type = (this.getChecker() as Checker).getTypeAtLocation(node.expression); // eslint-disable-line\n this.warnIfAnyType(node, type.flags, leftSide, \"length\");\n return this.isStringType(type.flags) ? `strlen(${leftSide})` : `count(${leftSide})`;\n }\n\n printPopCall(node, identation, name = undefined) {\n return `array_pop(${name})`;\n }\n\n printReverseCall(node, identation, name = undefined) {\n return `${name} = array_reverse(${name})`;\n }\n\n printShiftCall(node, identation, name = undefined) {\n return `array_shift(${name})`;\n }\n\n printToLowerCaseCall(node, identation, name = undefined) {\n return `strtolower(${name})`;\n }\n\n printToUpperCaseCall(node, identation, name = undefined) {\n return `strtoupper(${name})`;\n }\n\n printToStringCall(node, identation, name = undefined) {\n return `((string) ${name})`;\n }\n\n printArrayIsArrayCall(node, identation, parsedArg = undefined) {\n return `gettype(${parsedArg}) === 'array' && array_is_list(${parsedArg})`;\n }\n\n printObjectKeysCall(node, identation, parsedArg = undefined) {\n return `is_array(${parsedArg}) ? array_keys(${parsedArg}) : array()`;\n }\n\n printObjectValuesCall(node, identation, parsedArg = undefined) {\n return `is_array(${parsedArg}) ? array_values(${parsedArg}) : array()`;\n }\n\n printJsonParseCall(node, identation, parsedArg?) {\n return `json_decode(${parsedArg}, $as_associative_array = true)`;\n }\n\n printJsonStringifyCall(node: any, identation: any, parsedArg?: any) {\n return `json_encode(${parsedArg})`;\n }\n\n printArrayPushCall(node, identation, name = undefined, parsedArg = undefined) {\n return `${name}[] = ${parsedArg}`;\n }\n\n printPromiseAllCall(node, identation, parsedArg = undefined) {\n return `\\\\React\\\\Promise\\\\all(${parsedArg})`;\n }\n\n printMathCeilCall(node, identation, parsedArg = undefined) {\n return `((int) ceil(${parsedArg}))`;\n }\n\n printNumberIsIntegerCall(node, identation, parsedArg?) {\n return `is_int(${parsedArg})`;\n }\n\n printMathRoundCall(node, identation, parsedArg = undefined) {\n return `((int) round(${parsedArg}))`;\n }\n\n printMathFloorCall(node: any, identation: any, parsedArg?: any) {\n return `((int) floor(${parsedArg}))`;\n }\n\n printReplaceCall(node, identation, name = undefined, parsedArg = undefined, parsedArg2 = undefined) {\n return `str_replace(${parsedArg}, ${parsedArg2}, ${name})`;\n }\n\n printReplaceAllCall(node, identation, name = undefined, parsedArg = undefined, parsedArg2 = undefined) {\n return `str_replace(${parsedArg}, ${parsedArg2}, ${name})`;\n }\n\n printIncludesCall(node, identation, name = undefined, parsedArg = undefined) {\n // \"ol\".includes(\"o\") -> str_contains(\"ol\", \"o\") or [12,3,4].includes(3) -> in_array(3, [12,3,4])\n const leftSide = node.expression?.expression;\n const leftSideText = this.printNode(leftSide, 0);\n const type = this.getChecker().getTypeAtLocation(leftSide); // eslint-disable-line\n this.warnIfAnyType(node, type.flags, leftSideText, \"includes\");\n this.warnIfAnyType(node, type.flags, leftSideText, \"includes\");\n if (this.isStringType(type.flags)) {\n return `str_contains(${name}, ${parsedArg})`;\n } else {\n return `in_array(${parsedArg}, ${name})`;\n }\n }\n\n printIndexOfCall(node, identation, name = undefined, parsedArg = undefined) {\n const leftSide = node.expression?.expression;\n const leftSideText = this.printNode(leftSide, 0);\n const type = this.getChecker().getTypeAtLocation(leftSide); // eslint-disable-line\n this.warnIfAnyType(node, type.flags, leftSideText, \"indexOf\");\n if (this.isStringType(type.flags)) {\n return `mb_strpos(${name}, ${parsedArg})`;\n } else {\n return `array_search(${parsedArg}, ${name})`;\n }\n }\n\n printSearchCall(node, identation, name = undefined, parsedArg = undefined) {\n return `mb_strpos(${name}, ${parsedArg})`;\n }\n\n printStartsWithCall(node, identation, name = undefined, parsedArg = undefined) {\n return `str_starts_with(${name}, ${parsedArg})`;\n }\n\n printEndsWithCall(node, identation, name = undefined, parsedArg = undefined) {\n return `str_ends_with(${name}, ${parsedArg})`;\n }\n\n printTrimCall(node, identation, name = undefined) {\n return `trim(${name})`;\n }\n\n printJoinCall(node, identation, name = undefined, parsedArg = undefined) {\n return `implode(${parsedArg}, ${name})`;\n }\n\n printSplitCall(node, identation, name = undefined, parsedArg = undefined) {\n return `explode(${parsedArg}, ${name})`;\n }\n\n printConcatCall(node: any, identation: any, name?: any, parsedArg?: any) {\n return `array_merge(${name}, ${parsedArg})`;\n }\n\n printPadEndCall(node, identation, name, parsedArg, parsedArg2) {\n return `str_pad(${name}, ${parsedArg}, ${parsedArg2}, STR_PAD_RIGHT)`;\n }\n\n printPadStartCall(node, identation, name, parsedArg, parsedArg2) {\n return `str_pad(${name}, ${parsedArg}, ${parsedArg2}, STR_PAD_LEFT)`;\n }\n\n printDateNowCall(node, identation) {\n return \"round(microtime(true) * 1000)\";\n }\n\n printInstanceOfExpression(node, identation) {\n // const left = this.printNode(node.left, 0);\n // const right = this.printNode(node.right, 0);\n const left = node.left.text;\n const right = node.right.text;\n return this.getIden(identation) + \"$\"+left+\" instanceof \"+right+\"\";\n }\n\n printDeleteExpression(node, identation) {\n const expression = this.printNode (node.expression, 0);\n return `unset(${expression})`;\n }\n\n printNewExpression(node, identation) {\n let expression = node.expression?.text;\n expression = expression ? expression : this.printNode(node.expression);\n // JS's built-in `Error` maps to PHP's `Exception` (PHP's `Error` is reserved for internal engine errors)\n if (expression === 'Error') {\n expression = 'Exception';\n }\n const args = node.arguments.map(n => this.printNode(n, identation)).join(\", \");\n const newToken = this.NEW_TOKEN ? this.NEW_TOKEN + \" \" : \"\";\n return newToken + expression + this.LEFT_PARENTHESIS + args + this.RIGHT_PARENTHESIS;\n }\n\n getExceptionalAccessTokenIfAny(node) {\n const leftSide = node.expression.text ?? node.expression.getFullText().trim();\n\n if (!leftSide) {\n return undefined;\n }\n\n if (this.propRequiresScopeResolutionOperator.includes(leftSide)) {\n return \"::\";\n }\n return undefined;\n }\n\n handleTypeOfInsideBinaryExpression(node, identation) {\n const left = node.left;\n const right = node.right.text;\n const op = node.operatorToken.kind;\n const expression = left.expression;\n\n const isDifferentOperator = op === SyntaxKind.ExclamationEqualsEqualsToken || op === SyntaxKind.ExclamationEqualsToken;\n const notOperator = isDifferentOperator ? this.NOT_TOKEN : \"\";\n\n const opComp = isDifferentOperator ? this.EXCLAMATION_EQUALS_EQUALS_TOKEN : this.EQUALS_EQUALS_EQUALS_TOKEN;\n\n switch (right) {\n case \"string\":\n return this.getIden(identation) + notOperator + \"is_string(\" + this.printNode(expression, 0) + \")\";\n case \"number\":\n return this.getIden(identation) + notOperator + \"(is_int(\" + this.printNode(expression, 0) + \") || is_float(\" + this.printNode(expression, 0) + \"))\";\n case \"boolean\":\n return this.getIden(identation) + notOperator + \"is_bool(\" + this.printNode(expression, 0) + \")\";\n case \"object\":\n return this.getIden(identation) + notOperator + \"is_array(\" + this.printNode(expression, 0) + \")\";\n case \"undefined\":\n return this.getIden(identation) + this.printNode(expression, 0) + \" \" + opComp + \" null\";\n }\n\n return undefined;\n\n }\n\n printCustomBinaryExpressionIfAny(node, identation) {\n const left = node.left;\n const right = node.right.text;\n\n const op = node.operatorToken.kind;\n\n if (left.kind === SyntaxKind.TypeOfExpression) {\n // handle typeof operator\n // Example: typeof a === \"string\"\n const typeOfExpression = this.handleTypeOfInsideBinaryExpression(node, identation);\n if (typeOfExpression) {\n return typeOfExpression;\n }\n }\n\n if (op === SyntaxKind.InKeyword) {\n const rightSide = this.printNode(node.right, 0);\n const leftSide = this.printNode(node.left, 0);\n return `${this.getIden(identation)}is_array(${rightSide}) && array_key_exists(${leftSide}, ${rightSide})`;\n }\n\n const prop = node?.left?.expression?.name?.text;\n\n if (prop) {\n const args = left.arguments;\n const parsedArg = (args && args.length > 0) ? this.printNode(args[0], 0): undefined;\n const leftSideOfIndexOf = left.expression.expression; // myString in myString.indexOf\n const leftSide = this.printNode(leftSideOfIndexOf, 0);\n const rightType = this.getChecker().getTypeAtLocation(leftSideOfIndexOf); // type of myString in myString.indexOf (\"b\") >= 0;\n switch(prop) {\n case 'indexOf':\n if (op === SyntaxKind.GreaterThanEqualsToken && right === '0') {\n this.warnIfAnyType(node, rightType.flags,leftSide, \"indexOf\");\n if (this.isStringType(rightType.flags)) {\n return this.getIden(identation) + \"mb_strpos(\" + leftSide + \", \" + parsedArg + \") !== false\";\n } else {\n return this.getIden(identation) + \"in_array(\" + parsedArg + \", \" + leftSide + \")\";\n }\n }\n }\n }\n return undefined;\n }\n\n printFunctionDeclaration(node, identation) {\n let functionDef = this.printFunctionDefinition(node, identation);\n const funcBody = this.printFunctionBody(node, identation);\n functionDef += funcBody;\n\n return this.printNodeCommentsIfAny(node, identation, functionDef);\n }\n\n printFunctionBody(node, identation) {\n\n if (this.asyncTranspiling && this.isAsyncFunction(node)) {\n const blockOpen = this.getBlockOpen(identation);\n const blockClose = this.getBlockClose(identation);\n\n const parsedArgs = node.parameters.map(param => this.printParameter(param, false)).join(\", \");\n const params = parsedArgs ? \" use (\" + parsedArgs + \")\" : \"\";\n\n const bodyStms = [...node.body.statements];\n const firstBodyStm = this.printNode(bodyStms[0], identation+2);\n bodyStms.shift();\n const funcBody = bodyStms.map((s) => this.printNode(s, identation+2)).join(\"\\n\");\n\n // reformat first comment\n const bodyParts = firstBodyStm.split(\"\\n\");\n const commentPart = bodyParts.filter(line => this.isComment(line));\n const isComment = commentPart.length > 0;\n let header = this.getIden(identation+1) + \"return Async\\\\async(function ()\" + params + \" {\\n\";\n if (isComment) {\n const commentPartString = commentPart.map((c) => this.getIden(identation+1) + c.trim()).join(\"\\n\");\n const firstStmNoComment = bodyParts.filter(line => !this.isComment(line)).join(\"\\n\");\n header = commentPartString + \"\\n\" + header + firstStmNoComment + \"\\n\";\n } else {\n header += firstBodyStm + \"\\n\";\n }\n\n const result = header\n + funcBody + \"\\n\"\n + this.getIden(identation+1) + \"}) ();\";\n\n return blockOpen + result + blockClose;\n }\n return super.printFunctionBody(node, identation);\n }\n\n printPropertyAccessModifiers(node) {\n const modifiers = super.printPropertyAccessModifiers(node);\n return modifiers ? modifiers : \"public \"; // default to public\n }\n\n transformLeadingComment(comment) {\n const commentRegex = [\n [ /\\{([\\]\\[\\|a-zA-Z0-9_-]+?)\\}/g, '~$1~' ], // eslint-disable-line -- resolve the \"arrays vs url params\" conflict (both are in {}-brackets)\n [ /\\[([^\\]\\[]*)\\]\\{(@link .*)\\}/g, '~$2 $1~' ], // eslint-disable-line -- docstring item with link\n [ /\\s+\\* @method/g, '' ], // docstring @method\n [ /(\\s+)\\* @description (.*)/g, '$1\\* $2' ], // eslint-disable-line\n [ /\\s+\\* @name .*/g, '' ], // docstring @name\n [ /(\\s+)\\* @returns/g, '$1\\* @return' ], // eslint-disable-line\n [ /\\~([\\]\\[\\|@\\.\\s+\\:\\/#\\-a-zA-Z0-9_-]+?)\\~/g, '{$1}' ], // eslint-disable-line -- resolve the \"arrays vs url params\" conflict (both are in {}-brackets)\n [ /(\\s+ \\* @(param|return) {[^}]*)object([^}]*}.*)/g, '$1array$3' ], // docstring type conversion\n ];\n\n const transformed = regexAll(comment, commentRegex);\n\n return transformed;\n }\n\n initConfig() {\n this.LeftPropertyAccessReplacements = {\n 'this': '$this',\n };\n\n this.RightPropertyAccessReplacements = {\n\n };\n\n this.FullPropertyAccessReplacements = {\n 'Number.MAX_SAFE_INTEGER': 'PHP_INT_MAX',\n 'JSON.stringify': 'json_encode',\n 'console.log': 'var_dump',\n 'process.exit': 'exit',\n 'Math.log': 'log',\n 'Math.abs': 'abs',\n 'Math.floor': '(int) floor',\n 'Math.ceil': '(int) ceil',\n 'Math.round': '(int) round',\n 'Math.pow': 'pow',\n 'Math.min': 'min',\n 'Math.max': 'max',\n // 'Promise.all': '\\\\React\\\\Promise\\\\all',\n };\n\n this.CallExpressionReplacements = {\n 'parseFloat': 'floatval',\n 'parseInt': 'intval',\n };\n\n this.PropertyAccessRequiresParenthesisRemoval = [\n // 'length',\n // 'toString',\n // 'toUpperCase',\n // 'toLowerCase',\n // 'pop',\n // 'reverse',\n // 'shift',\n ];\n }\n\n}\n","import { BaseTranspiler } from \"./baseTranspiler.js\";\nimport { SyntaxKind, type Node, type ParameterDeclaration } from 'typescript/unstable/ast';\nimport { IndexKind, TypeFlags, type Checker, type Symbol as TsSymbol, type UnionType } from 'typescript/unstable/sync';\nimport { isArrayLiteralExpression, isAsExpression, isBinaryExpression, isBlock, isBooleanLiteral, isBreakStatement, isCallExpression, isClassDeclaration, isClassExpression, isClassLikeDeclaration, isContinueStatement, isDeleteExpression, isElementAccessExpression, isExpressionStatement, isForStatement, isFunctionExpression, isIdentifier, isIfStatement, isMethodDeclaration, isNumericLiteral, isObjectLiteralExpression, isParameterDeclaration, isParenthesizedExpression, isPostfixUnaryExpression, isPrefixUnaryExpression, isPropertyAccessExpression, isPropertyDeclaration, isPropertySignatureDeclaration, isReturnStatement, isSourceFile, isSpreadAssignment, isSpreadElement, isStringLiteral, isStringLiteralLikeNode, isThrowStatement, isTypeAssertion, isVariableDeclaration, isWhileStatement } from 'typescript/unstable/ast/is';\nimport { findAncestor, getAllSuperTypeNodes, isFunctionLike } from './tsUtils.js';\n\nconst parserConfig = {\n 'ELSEIF_TOKEN': 'else if',\n 'OBJECT_OPENING': 'new Dictionary() {',\n 'ARRAY_OPENING_TOKEN': 'new List() {',\n 'ARRAY_CLOSING_TOKEN': '}',\n 'PROPERTY_ASSIGNMENT_TOKEN': ',',\n 'VAR_TOKEN': 'object', // object\n 'METHOD_TOKEN': '',\n 'PROPERTY_ASSIGNMENT_OPEN': '{',\n 'PROPERTY_ASSIGNMENT_CLOSE': '}',\n 'SUPER_TOKEN': 'base',\n 'SUPER_CALL_TOKEN': 'base',\n 'FALSY_WRAPPER_OPEN': 'isTrue(',\n 'FALSY_WRAPPER_CLOSE': ')',\n 'COMPARISON_WRAPPER_OPEN' : \"isEqual(\",\n 'COMPARISON_WRAPPER_CLOSE' : \")\",\n 'UKNOWN_PROP_WRAPPER_OPEN': 'this.call(',\n 'UNKOWN_PROP_WRAPPER_CLOSE': ')',\n 'UKNOWN_PROP_ASYNC_WRAPPER_OPEN': 'this.callAsync(',\n 'UNKOWN_PROP_ASYNC_WRAPPER_CLOSE': ')',\n 'DYNAMIC_CALL_OPEN': 'callDynamically(',\n 'EQUALS_EQUALS_WRAPPER_OPEN': 'isEqual(',\n 'EQUALS_EQUALS_WRAPPER_CLOSE': ')',\n 'DIFFERENT_WRAPPER_OPEN': '!isEqual(',\n 'DIFFERENT_WRAPPER_CLOSE': ')',\n 'GREATER_THAN_WRAPPER_OPEN': 'isGreaterThan(',\n 'GREATER_THAN_WRAPPER_CLOSE': ')',\n 'GREATER_THAN_EQUALS_WRAPPER_OPEN': 'isGreaterThanOrEqual(',\n 'GREATER_THAN_EQUALS_WRAPPER_CLOSE': ')',\n 'LESS_THAN_WRAPPER_OPEN': 'isLessThan(',\n 'LESS_THAN_WRAPPER_CLOSE': ')',\n 'LESS_THAN_EQUALS_WRAPPER_OPEN': 'isLessThanOrEqual(',\n 'LESS_THAN_EQUALS_WRAPPER_CLOSE': ')',\n 'PLUS_WRAPPER_OPEN':'add(',\n 'PLUS_WRAPPER_CLOSE':')',\n 'MINUS_WRAPPER_OPEN':'subtract(',\n 'MINUS_WRAPPER_CLOSE':')',\n 'ARRAY_LENGTH_WRAPPER_OPEN': 'getArrayLength(',\n 'ARRAY_LENGTH_WRAPPER_CLOSE': ')',\n 'DIVIDE_WRAPPER_OPEN': 'divide(',\n 'DIVIDE_WRAPPER_CLOSE': ')',\n 'MULTIPLY_WRAPPER_OPEN': 'multiply(',\n 'MULTIPLY_WRAPPER_CLOSE': ')',\n 'INDEXOF_WRAPPER_OPEN': 'getIndexOf(',\n 'INDEXOF_WRAPPER_CLOSE': ')',\n 'MOD_WRAPPER_OPEN': 'mod(',\n 'MOD_WRAPPER_CLOSE': ')',\n 'FUNCTION_TOKEN': '',\n 'INFER_VAR_TYPE': false,\n 'INFER_ARG_TYPE': false,\n};\n\n// C# static type of the value each printed helper returns. A local initialised by\n// one of these already holds that concrete type inside its `object` box, so naming\n// the type at the declaration site keeps the very same runtime value and only\n// refines what the C# compiler knows about it.\n\n// instance-style calls the printer rewrites unconditionally by method name\n// (`x.toUpperCase()` always prints `((string)x).ToUpper()`, whatever `x` is)\nconst CSHARP_METHOD_RETURN_TYPES: { [name: string]: string } = {\n 'toUpperCase': 'string',\n 'toLowerCase': 'string',\n 'toString': 'string',\n 'trim': 'string',\n 'join': 'string',\n 'replace': 'string',\n 'replaceAll': 'string',\n 'split': 'List',\n 'startsWith': 'bool',\n 'endsWith': 'bool',\n 'indexOf': 'int',\n 'search': 'int',\n};\n\n// `Object.keys(x)`, `Math.floor(x)`, ... — matched on the full callee text\nconst CSHARP_STATIC_RETURN_TYPES: { [name: string]: string } = {\n 'Object.keys': 'List',\n 'Object.values': 'List',\n 'Object.entries': 'List',\n 'JSON.stringify': 'string',\n 'Math.floor': 'double',\n 'Math.ceil': 'double',\n 'Math.round': 'double',\n 'Array.isArray': 'bool',\n 'Number.isInteger': 'bool',\n};\n\n// delegate-valued members of the hand-written C# base (cs/ccxt/base/Exchange.Options.cs):\n// `Func<...>` with this many parameters, so `this.(args)` with that arity is a direct\n// delegate invocation. `proxy` is a `string` there — not callable — and stays out.\nconst CSHARP_NATIVE_THIS_DELEGATE_ARITY: { [name: string]: number } = {\n 'proxyUrlCallback': 3,\n 'proxy_url_callback': 3,\n 'httpProxyCallback': 4,\n 'http_proxy_callback': 4,\n 'httpsProxyCallback': 4,\n 'https_proxy_callback': 4,\n 'socksProxyCallback': 3,\n 'socks_proxy_callback': 3,\n};\n\n// base-class helpers whose C# signature is already concrete\nconst CSHARP_THIS_RETURN_TYPES: { [name: string]: string } = {\n 'extend': 'Dictionary',\n 'deepExtend': 'Dictionary',\n 'indexBy': 'Dictionary',\n 'groupBy': 'Dictionary',\n 'milliseconds': 'Int64',\n 'seconds': 'Int64',\n 'microseconds': 'Int64',\n 'uuid': 'string',\n 'hmac': 'string',\n 'capitalize': 'string',\n 'ymdhms': 'string',\n 'yyyymmdd': 'string',\n 'json': 'string',\n 'inArray': 'bool',\n 'valueIsDefined': 'bool',\n // the safe* accessor family: cs/ccxt/base already declares these with a concrete\n // return type (`string? safeString(...)`, `Int64? safeInteger(...)`, `bool? safeBool(...)`,\n // `IDictionary safeDict(...)`, `List safeList(...)`, ...), so a\n // local initialised by one of them already holds that type inside its `object` box\n 'safeString': 'string?',\n 'safeString2': 'string?',\n 'safeStringN': 'string?',\n 'safeStringLower': 'string?',\n 'safeStringLower2': 'string?',\n 'safeStringLowerN': 'string?',\n 'safeStringUpper': 'string?',\n 'safeStringUpper2': 'string?',\n 'safeStringUpperN': 'string?',\n 'safeCurrencyCode': 'string?',\n 'safeInteger': 'Int64?',\n 'safeInteger2': 'Int64?',\n 'safeIntegerN': 'Int64?',\n 'safeIntegerProduct': 'Int64?',\n 'safeFloat': 'double?',\n 'safeFloat2': 'double?',\n 'safeFloatN': 'double?',\n 'safeNumberN': 'double?',\n 'safeBool': 'bool?',\n 'safeBool2': 'bool?',\n 'safeBoolN': 'bool?',\n 'safeDict': 'IDictionary',\n 'safeDict2': 'IDictionary',\n 'safeDictN': 'IDictionary',\n 'safeList': 'List',\n 'safeList2': 'List',\n 'safeListN': 'List',\n};\n\n// helpers whose C# signature is `object` (safeValue, getValue, parseInt, add,\n// slice, safeTimestamp, ...) are deliberately absent above: their box holds a value the printer\n// cannot name, so those locals stay `object`.\n\n// this.(...) base methods whose printed C# signature is a concrete numeric value the\n// tables above do not carry: `int precisionFromString(object)` (Exchange.Number.cs) and\n// `Int64? parseToInt(object)` (Exchange.BaseMethods.cs, retyped by the build layer)\nconst CSHARP_NATIVE_NUMERIC_THIS_KINDS: { [name: string]: string } = {\n 'precisionFromString': 'int',\n 'parseToInt': 'Int64?',\n};\n\n// the safe* accessor names of the table above: a local initialised by one of them gets the\n// extra sink guards of csharpLocalIsSafeToType (list-only methods, hard `(string)` casts,\n// the `+` LEFT operand overload rebinding)\nconst CSHARP_SAFE_ACCESSOR_NAMES = Object.keys(CSHARP_THIS_RETURN_TYPES).filter((name) => name.startsWith('safe'));\n\n// S62: calls whose C# signature is a hand-written `bool` (isTrue, isEqual, isGreaterThan, ...,\n// inOp in cs/ccxt/base/Exchange.TranspileHelpers.cs; emitted for the comparison operators, `in`\n// and TS `isTrue`) are already C# `bool`, so the condition printer's falsy wrapper is the identity.\nconst CSHARP_BOOLEAN_PRINTED_CALLS = [\n 'isTrue', 'isEqual', 'isGreaterThan', 'isGreaterThanOrEqual',\n 'isLessThan', 'isLessThanOrEqual', 'inOp',\n];\n\n// a transpiled parameter or local can literally be named `bool`, which would turn\n// `bool x = ...` into a reference to that value instead of the type. `string` and\n// `object` are already renamed by ReservedKeywordsReplacements.\nconst CSHARP_TYPE_NAMES = [ 'string', 'bool', 'int', 'long', 'Int64', 'double', 'object', 'List', 'IList', 'Dictionary', 'IDictionary', 'var' ];\n\n// joins a receiver's printed text with a literal key in the `key in recv` guard index\nconst GUARD_KEY_SEPARATOR = \"\\u0000\";\n\n// C# kinds a comparison can be printed natively on: the runtime isLessThan family compares two\n// boxes of one kind with the conversions the C# operator applies too. `double` keeps only\n// `>`/`>=` — the helper reads a NaN operand as \"less than\", a native comparison is false — and\n// only meets another `double`: its isEqual accepts an integral double as an integer.\nconst CSHARP_NUMERIC_KINDS = [ 'int', 'Int64', 'double' ];\n\n// numeric kinds a printed call result can carry (with the nullable spellings the safe*\n// accessors and parseToInt use), for the equality path only\nconst CSHARP_NUMERIC_VALUE_KINDS = [ 'int', 'Int64', 'Int64?', 'double', 'double?' ];\n\n// integer kinds the helper normalises to Int64 (normalizeIntIfNeeded), the same widening the\n// C# operator applies to an int next to a long, so a mixed pair prints the identical comparison\nconst CSHARP_INTEGER_KINDS = [ 'int', 'Int64' ];\n\nconst CSHARP_NATIVE_COMPARISON_TOKENS = {\n [SyntaxKind.LessThanToken]: '<',\n [SyntaxKind.GreaterThanToken]: '>',\n [SyntaxKind.LessThanEqualsToken]: '<=',\n [SyntaxKind.GreaterThanEqualsToken]: '>=',\n};\n\n// C# kinds where Math.Min/Max may replace mathMin/mathMax: the helper reads both boxes via\n// Convert.ToDouble and returns an ORIGINAL box, so only integer kinds give the same value in the\n// same box. `double` keeps the helper (Math.Min propagates NaN, and -0/+0 differ).\nconst CSHARP_MINMAX_NATIVE_KINDS = [ 'int', 'Int64' ];\n\n// every binary operator that writes its left operand (typescript6 has no First/LastAssignmentOperator\n// range to test against), used by the element-access loop guards below\nconst CSHARP_ASSIGNMENT_OPERATOR_KINDS = [\n SyntaxKind.EqualsToken,\n SyntaxKind.PlusEqualsToken,\n SyntaxKind.MinusEqualsToken,\n SyntaxKind.AsteriskEqualsToken,\n SyntaxKind.AsteriskAsteriskEqualsToken,\n SyntaxKind.SlashEqualsToken,\n SyntaxKind.PercentEqualsToken,\n SyntaxKind.LessThanLessThanEqualsToken,\n SyntaxKind.GreaterThanGreaterThanEqualsToken,\n SyntaxKind.GreaterThanGreaterThanGreaterThanEqualsToken,\n SyntaxKind.AmpersandEqualsToken,\n SyntaxKind.BarEqualsToken,\n SyntaxKind.CaretEqualsToken,\n SyntaxKind.BarBarEqualsToken,\n SyntaxKind.AmpersandAmpersandEqualsToken,\n SyntaxKind.QuestionQuestionEqualsToken,\n];\n\n// hand-written BaseExchange fields whose C# declaration already is a concrete\n// dictionary/list (cs/ccxt/base/Exchange.Options.cs): a read of the field carries\n// that static type, so its own members (`Count`, `ContainsKey`) replace the helper\nconst CSHARP_NATIVE_FIELDS: { [name: string]: string } = {\n 'options': 'ConcurrentDictionary',\n 'has': 'Dictionary',\n 'features': 'Dictionary',\n 'httpExceptions': 'Dictionary',\n 'markets_by_id': 'IDictionary',\n 'symbols': 'List',\n 'codes': 'List',\n 'ids': 'List',\n};\n\n// hand-written BaseExchange fields declared `object` that always box a dictionary\n// (dict / CustomConcurrentDictionary): the member needs the same\n// `(IDictionary)` cast the transpiled helper body itself applies\nconst CSHARP_OBJECT_DICT_FIELDS = [ 'urls', 'tickers', 'bidsasks', 'orderbooks', 'ohlcvs', 'trades', 'markets', 'currencies', 'currencies_by_id', 'exceptions' ];\n\n// Hand-written BaseExchange / PredictionExchange fields declared as C# reference types: the field\n// holds a reference box, so a null comparison is exactly the isEqual(field, null) branch. A\n// value-typed field keeps the helper — rateLimit is a `double` (its TS number type proves nothing).\nconst CSHARP_REFERENCE_FIELDS_NATIVE = [\n 'id', 'hostname', 'apiKey', 'secret', 'password', 'uid', 'accountId', 'login', 'privateKey',\n 'walletAddress', 'twofa', 'proxy', 'proxyUrl', 'proxy_url', 'proxyUrlCallback',\n 'proxy_url_callback', 'last_http_response', 'markets', 'markets_by_id', 'features', 'tickers',\n 'bidsasks', 'ohlcvs', 'trades', 'orders', 'myTrades', 'positions', 'liquidations', 'balance',\n 'accounts', 'currencies', 'currencies_by_id', 'outcomes', 'outcomes_by_id', 'events',\n 'events_by_slug', 'clients', 'ids', 'tokenBucket',\n];\n\n// hand-written BaseExchange fields declared `bool` (cs/ccxt/base/Exchange.Options.cs, e.g.\n// `public bool newUpdates;` / `public bool verbose { get; set; }`): a `this.` read is\n// already a C# bool, so a condition holding one needs no isTrue wrapper\nconst CSHARP_NATIVE_BOOL_FIELDS = [\n 'alias', 'certified', 'enableRateLimit', 'isSandboxModeEnabled', 'newUpdates', 'pro',\n 'reduceFees', 'reloadingMarkets', 'returnResponseHeaders', 'substituteCommonCurrencyCodes', 'verbose',\n];\n\n// Hand-written BaseExchange fields whose reads print natively although the key may be absent:\n// `has`/`options` are concrete dictionaries; `urls`, `markets`, `exceptions` are `object` boxes\n// that always hold one. The native read tests the key, so a missing key still reads null.\nconst CSHARP_MISSING_KEY_FIELDS_NATIVE = [ 'has', 'options', 'urls', 'markets', 'exceptions' ];\n\n// C# collection types this printer can name whose members replace the helpers\nconst CSHARP_NATIVE_COLLECTION_TYPES = [ 'List', 'IList', 'Dictionary', 'IDictionary' ];\n\n// C# types isEqual's own branches can compare an element with: the box an element read\n// yields is unboxed with `as`, which answers null for every other box\nconst CSHARP_SCALAR_ELEMENT_BOOL = 1;\nconst CSHARP_SCALAR_ELEMENT_STRING = 2;\n\n// C# dictionary types this printer can name on a local\nconst CSHARP_NATIVE_DICTIONARY_TYPES = [ 'Dictionary', 'IDictionary' ];\n\n// the row-receiver family of the cs-08 unit, extended by B-19 to the currency row: a read of a\n// local with one of these names the declared table proves is a dictionary prints natively.\n// Other receivers belong to their own units (cs-09 fields, cs-10 response/result/balance locals)\nconst CSHARP_NATIVE_MARKET_RECEIVERS = [ 'market', 'currency' ];\n\n// Callees hand-written in cs/ccxt/base returning non-nullable `bool` with no TS declaration to read\n// an annotation from: `isEmpty`, `isJsonEncodedObject`, `isBinaryMessage` and Precise's string\n// comparisons. Keyed on printed callee text, so a `callDynamically` rewrite never matches.\nconst CSHARP_BOOL_CALLEES_NATIVE: { [name: string]: boolean } = {\n 'this.isEmpty': true,\n 'this.isJsonEncodedObject': true,\n 'this.isBinaryMessage': true,\n 'Precise.stringGt': true,\n 'Precise.stringGe': true,\n 'Precise.stringLt': true,\n 'Precise.stringLe': true,\n 'Precise.stringEq': true,\n 'Precise.stringEquals': true,\n};\n\n// TS base methods the C# port hand-writes with its own signature: the TS annotation is `boolean`\n// but the C# method bound by `this.(...)` returns something else (`object isDictionary`),\n// so the isTrue wrapper must stay regardless of the annotation.\nconst CSHARP_HANDWRITTEN_CALLEES_NATIVE = [ 'isDictionary' ];\n\n// Declared C# types whose `Count` counts exactly what getArrayLength's IList / ICollection\n// branches count. A prefix test: these are named with element types (`List`,\n// `Dictionary`, ...) and every member of the family carries `Count`.\nconst CSHARP_COUNT_TYPES = [ 'List<', 'IList<', 'Dictionary<', 'IDictionary<', 'ConcurrentDictionary<' ];\n\n// ==== native parseInt / parseFloat / mod / prefix `-x` ====\n// These helpers' answers depend on the runtime type of their boxes. Each emission below replaces\n// the call only where the printer can name the exact value the helper returns; else keep helper.\n\n// the numeric literal spellings this printer re-reads: decimal digits with an optional fraction\n// (a hex or separator literal prints characters the C# compiler would read differently)\nconst CSHARP_DECIMAL_LITERAL = /^[0-9]+(\\.[0-9]+)?$/;\n\n// the C# source of a double literal holding exactly `value`: String() is the shortest\n// round-trip spelling, and a whole number needs a fraction or an exponent to stay a double\nfunction csharpDoubleLiteral(value) {\n if (!Number.isFinite(value)) {\n return undefined;\n }\n const text = String(value);\n return (text.indexOf('.') >= 0 || text.indexOf('e') >= 0) ? text : text + '.0';\n}\n\n// the numeric value of a literal operand: a plain literal or one under a unary minus\nfunction csharpLiteralNumericValue(node) {\n if (isNumericLiteral(node)) {\n return CSHARP_DECIMAL_LITERAL.test(node.text) ? Number(node.text) : undefined;\n }\n if (isPrefixUnaryExpression(node) && (node.operator === SyntaxKind.MinusToken) && isNumericLiteral(node.operand)\n && CSHARP_DECIMAL_LITERAL.test(node.operand.text)) {\n return -Number(node.operand.text);\n }\n return undefined;\n}\n\n// `parseInt()` boxes Convert.ToInt64(Math.Floor(Convert.ToDouble(a))): a digits-only\n// string reads as the same number in every culture, so both readings fold into one Int64 literal\nfunction csharpParseIntLiteralArgument(arg) {\n if (isStringLiteral(arg)) {\n if (!/^[0-9]+$/.test(arg.text)) {\n return undefined; // a sign, a point or an exponent is read with the CURRENT culture\n }\n const value = Number(arg.text);\n return Number.isSafeInteger(value) ? `${value}L` : undefined;\n }\n const numeric = csharpLiteralNumericValue(arg);\n if (numeric === undefined) {\n return undefined;\n }\n const floored = Math.floor(numeric);\n if (!Number.isSafeInteger(floored)) {\n return undefined;\n }\n return (floored < 0) ? `(${floored}L)` : `${floored}L`;\n}\n\n// `parseFloat()` boxes Convert.ToDouble(a, InvariantCulture): a plain decimal string\n// and a numeric literal both read as the nearest double, the value the literal spells\nfunction csharpParseFloatLiteralArgument(arg) {\n if (isStringLiteral(arg)) {\n return CSHARP_DECIMAL_LITERAL.test(arg.text) ? csharpDoubleLiteral(Number(arg.text)) : undefined;\n }\n const numeric = csharpLiteralNumericValue(arg);\n return (numeric === undefined) ? undefined : csharpDoubleLiteral(numeric);\n}\n\n// receivers the market-typed-local unit owns (market/currency rows); this printer's literal-key\n// read rule leaves them to that family and covers every other declared-collection local\nconst CSHARP_MARKET_RECEIVER_NAMES = [ 'market', 'currency' ];\n\n// Parameters of a method whose override chain the ts/src census cleared: every declaration (base\n// member + every override) maps to the same spelling AND every call site in the generated tree\n// passes a compatible argument, so the whole-language build stays green. The three surviving\nconst CSHARP_OVERRIDE_PARAM_TYPES: { [name: string]: { [index: number]: string } } = {\n ethRpc: { 2: 'IList' },\n parsePredictionOpenInterest: { 0: 'IDictionary' },\n signEvmTransaction: { 0: 'IDictionary' },\n};\n\n\n// a leading cast of the printed expression: `(IList)(x)` names the receiver's static type\nconst CSHARP_LENGTH_CAST = /^\\(([A-Za-z_][\\w.]*(?:<[^<>]*(?:<[^<>]*>)?[^<>]*>)?)\\)/;\n\n// U55: declaration types where `isEqual (x, null)` -> `x == null` is the same test: `T?` (`== null`\n// is `!x.HasValue`, the helper's `a == null` guard) and named reference types (reference compare).\n// `object`/`var` and non-nullable scalars are refused (`x == null` won't compile for Int64/bool).\nconst CSHARP_NULL_COMPARISON_REFERENCE_HEADS = [ 'string', 'IDictionary<', 'Dictionary<', 'IList<', 'List<', 'ConcurrentDictionary<', 'ccxt.pro.', 'ArrayCache', 'IOrderBook', 'Future', 'WebSocketClient', 'Delegates' ];\n\nexport class CSharpTranspiler extends BaseTranspiler {\n\n binaryExpressionsWrappers;\n // method node -> 'bool' | 'bool?' | undefined (see csharpBooleanReturnType)\n csharpBooleanReturnTypes = new WeakMap();\n // variable declaration -> getCSharpLocalType result, shared by the condition checks\n csharpLocalTypes = new WeakMap();\n // method node -> `key in recv` guards of that method, keyed by receiver text + key\n csharpGuardIndex = new WeakMap>();\n // optional proof of the concrete C# type of an expression, installed by the embedding build\n // layer for the locals it retypes itself (ccxt: build/csharp-local-types.js); it must\n // describe the same type the declaration is emitted with, or the operator will not compile\n csharpExpressionTypeResolver?: (node) => string | undefined;\n // optional proof of the C# type a LOCAL's declaration was emitted with, installed by the\n // embedding build layer for declarations it retyped itself; the member-access rules read it\n // only after this printer's own declared-local table declined\n csharpDeclaredLocalTypeResolver?: (declaration) => string | undefined;\n // variable declaration -> the concrete C# type this printer named for it\n // (getCSharpLocalType): 'List' / 'Dictionary' / 'string' / ...\n // Only declarations the printer typed itself are kept: the printed ` name = `\n // prefix is final, so every later read of the local is statically that type and its\n // members may replace inOp/getArrayLength\n csharpTypedLocals = new WeakMap();\n // ws handler `message` parameter -> the typed signature this printer prints for it (D-19)\n csharpHandlerMessageTypes = new WeakMap();\n // method declaration -> a static call reference exists (a call binds its arguments)\n csharpHandlerCalled = new WeakMap();\n // class declaration -> the class routes the raw message through a list test\n csharpListRouteClasses = new WeakMap();\n // source file -> method symbol -> a static call reference exists (built once per file: a\n // sticky batch program is shared by every file of the stage, so a program-keyed index\n // would answer for another venue's class)\n csharpHandlerCallIndex = new WeakMap>();\n // parameter node -> the type the printed signature gives it (printParameterType, e.g.\n // `Dict` -> Dictionary), recorded as the signature is printed. Read-only:\n // no printer rule consults it, see csharpPrintedParamType\n csharpParamTypes = new WeakMap();\n // declaration node -> C# type of the local ('' = the printer prints `object`); see\n // csharpStringReceiverType -- the ccxt classifier asks once per string-method receiver\n stringReceiverTypes = new WeakMap();\n // declaration node -> 'bool' | 'bool?' | '' (the printer cannot name it); see\n // csharpConditionOperandType — asked once per condition operand\n conditionOperandTypes = new WeakMap();\n\n constructor(config = {}) {\n config['parser'] = Object.assign ({}, parserConfig, config['parser'] ?? {});\n\n super(config);\n\n this.requiresParameterType = true;\n this.requiresReturnType = true;\n this.asyncTranspiling = true;\n this.implicitAsyncTranspiling = true;\n this.supportsFalsyOrTruthyValues = false;\n this.requiresCallExpressionCast = true;\n this.id = \"C#\";\n\n\n this.initConfig();\n\n // user overrides\n this.applyUserOverrides(config);\n }\n\n initConfig() {\n this.LeftPropertyAccessReplacements = {\n // 'this': '$this',\n };\n\n this.RightPropertyAccessReplacements = {\n 'push': 'Add', // list method\n 'indexOf': 'IndexOf', // list method\n 'toUpperCase': 'ToUpper',\n 'toLowerCase': 'ToLower',\n 'toString': 'ToString',\n };\n\n this.FullPropertyAccessReplacements = {\n 'JSON.parse': 'parseJson', // custom helper method\n 'console.log': 'Console.WriteLine',\n 'Number.MAX_SAFE_INTEGER': 'Int32.MaxValue',\n 'Math.min': 'Math.Min',\n 'Math.max': 'Math.Max',\n 'Math.log': 'Math.Log',\n 'Math.abs': 'Math.Abs',\n // 'Math.ceil': 'Math.Ceiling', // need cast\n // 'Math.round': 'Math.Round', // need to cast\n 'Math.floor': 'Math.Floor',\n 'Math.pow': 'Math.Pow',\n // 'Promise.all': 'Task.WhenAll',\n };\n\n this.CallExpressionReplacements = {\n // \"parseInt\": \"parseINt\",\n // \"parseFloat\": \"float.Parse\",\n };\n\n this.ReservedKeywordsReplacements = {\n 'string': 'str',\n 'object': 'obj',\n 'params': 'parameters',\n 'base': 'bs',\n 'internal': 'intern',\n 'event': 'eventVar',\n 'fixed': 'fixedVar',\n };\n\n this.VariableTypeReplacements = {\n 'string': 'string',\n 'Str': 'string',\n 'number': 'double',\n 'Int': 'Int64',\n 'Num': 'double',\n 'Dict': 'Dictionary',\n 'Strings': 'List',\n 'List': 'List',\n 'boolean': 'bool',\n };\n\n this.ArgTypeReplacements = { ...this.VariableTypeReplacements };\n\n this.binaryExpressionsWrappers = {\n [SyntaxKind.EqualsEqualsToken]: [this.EQUALS_EQUALS_WRAPPER_OPEN, this.EQUALS_EQUALS_WRAPPER_CLOSE],\n [SyntaxKind.EqualsEqualsEqualsToken]: [this.EQUALS_EQUALS_WRAPPER_OPEN, this.EQUALS_EQUALS_WRAPPER_CLOSE],\n [SyntaxKind.ExclamationEqualsToken]: [this.DIFFERENT_WRAPPER_OPEN, this.DIFFERENT_WRAPPER_CLOSE],\n [SyntaxKind.ExclamationEqualsEqualsToken]: [this.DIFFERENT_WRAPPER_OPEN, this.DIFFERENT_WRAPPER_CLOSE],\n [SyntaxKind.GreaterThanToken]: [this.GREATER_THAN_WRAPPER_OPEN, this.GREATER_THAN_WRAPPER_CLOSE],\n [SyntaxKind.GreaterThanEqualsToken]: [this.GREATER_THAN_EQUALS_WRAPPER_OPEN, this.GREATER_THAN_EQUALS_WRAPPER_CLOSE],\n [SyntaxKind.LessThanToken]: [this.LESS_THAN_WRAPPER_OPEN, this.LESS_THAN_WRAPPER_CLOSE],\n [SyntaxKind.LessThanEqualsToken]: [this.LESS_THAN_EQUALS_WRAPPER_OPEN, this.LESS_THAN_EQUALS_WRAPPER_CLOSE],\n [SyntaxKind.PlusToken]: [this.PLUS_WRAPPER_OPEN, this.PLUS_WRAPPER_CLOSE],\n [SyntaxKind.MinusToken]: [this.MINUS_WRAPPER_OPEN, this.MINUS_WRAPPER_CLOSE],\n [SyntaxKind.AsteriskToken]: [this.MULTIPLY_WRAPPER_OPEN, this.MULTIPLY_WRAPPER_CLOSE],\n [SyntaxKind.PercentToken]: [this.MOD_WRAPPER_OPEN, this.MOD_WRAPPER_CLOSE],\n [SyntaxKind.SlashToken]: [this.DIVIDE_WRAPPER_OPEN, this.DIVIDE_WRAPPER_CLOSE],\n };\n }\n\n getBlockOpen(identation){\n return \"\\n\" + this.getIden(identation) + this.BLOCK_OPENING_TOKEN + \"\\n\";\n }\n\n printSuperCallInsideConstructor(node, identation) {\n return \"\"; // csharp does not need super call inside constructor\n }\n\n // method node -> base-class method it overrides (null: none); see getMethodOverride\n csharpMethodOverrides = new WeakMap();\n // class declaration -> member name -> its LAST method of that name (base scan order)\n csharpClassMethodsByName = new WeakMap>();\n\n csharpMethodsByName(classDecl): Map {\n let byName = this.csharpClassMethodsByName.get(classDecl);\n if (byName === undefined) {\n byName = new Map();\n for (const elem of classDecl.members ?? []) {\n if (isMethodDeclaration(elem)) {\n byName.set(elem.name.getText().trim(), elem);\n }\n }\n this.csharpClassMethodsByName.set(classDecl, byName);\n }\n return byName;\n }\n\n // base getMethodOverride rescans every parent member with getText() on each call; the\n // printer asks per method several times, so memoize it (same walk, same result)\n getMethodOverride(node: Node): Node {\n if (node === undefined || !isClassDeclaration(node.parent) || !(node.parent as any).heritageClauses) {\n return undefined;\n }\n const cached = this.csharpMethodOverrides.get(node);\n if (cached !== undefined) {\n return cached ?? undefined;\n }\n let method = undefined;\n let parentClass = getAllSuperTypeNodes(node.parent)[0];\n while (parentClass !== undefined) {\n const parentClassDecl = this.getChecker().getTypeAtLocation(parentClass)?.getSymbol()?.valueDeclaration?.resolve();\n if (parentClassDecl === undefined) {\n this.warn(node, \"Parent class\", \"Parent class not found\");\n method = undefined;\n break;\n }\n method = this.csharpMethodsByName(parentClassDecl).get((node as any).name.text) ?? method;\n parentClass = getAllSuperTypeNodes(parentClassDecl)[0] ?? undefined;\n }\n this.csharpMethodOverrides.set(node, method ?? null);\n return method;\n }\n\n printIdentifier(node) {\n let idValue = node.text ?? node.text;\n\n if (this.ReservedKeywordsReplacements[idValue]) {\n idValue = this.ReservedKeywordsReplacements[idValue];\n }\n\n if (idValue === \"undefined\") {\n return this.UNDEFINED_TOKEN;\n }\n\n // check if it is a class declaration that we need to wrap arounf typeof\n // example: const x = Error -> var x = typeof(Error)\n const type = this.getChecker().getTypeAtLocation(node);\n const symbol = type?.getSymbol();\n if (symbol !== undefined) {\n // const declarations = (this.getChecker().getDeclaredTypeOfSymbol(symbol).getSymbol()?.declarations ?? []).map((d) => d.resolve());\n const decl = (symbol?.declarations ?? []).map((d) => d.resolve());\n let isBuiltIn = undefined;\n if (decl.length > 0) {\n isBuiltIn = decl[0].getSourceFile().fileName.indexOf('typescript') > -1; //very hacky find a better solution later\n }\n\n if (isBuiltIn !== undefined && !isBuiltIn) {\n // const isClassDeclaration = declarations.find(l => l.kind === SyntaxKind.ClassDeclaration);\n const isInsideNewExpression = node?.parent?.kind === SyntaxKind.NewExpression;\n const isInsideCatch = node?.parent?.kind === SyntaxKind.ThrowStatement;\n const isLeftSide = node?.parent?.name === node || (node?.parent?.left === node);\n const isCallOrPropertyAccess = node?.parent?.kind === SyntaxKind.PropertyAccessExpression || node?.parent?.kind === SyntaxKind.ElementAccessExpression;\n if (!isLeftSide && !isCallOrPropertyAccess && !isInsideCatch && !isInsideNewExpression) {\n // return `typeof(${idValue})`; // this is not working as expected\n // for instance\n // const instance = new x();\n // const b = instance;\n // gets transpiled to\n // var instance = typeof(x);\n const symbol = this.getChecker().getSymbolAtLocation(node);\n let isClassDeclaration = false;\n if (symbol) {\n const first = symbol.declarations[0].resolve();\n if (first.kind === SyntaxKind.ClassDeclaration) {\n isClassDeclaration = true;\n }\n if (first.kind === SyntaxKind.ImportSpecifier) {\n const importedSymbol = this.getChecker().getAliasedSymbol(symbol);\n if (importedSymbol?.declarations[0]?.resolve()?.kind === SyntaxKind.ClassDeclaration) {\n isClassDeclaration = true;\n }\n }\n }\n // console.log(node.getText(), 'isClass declaration', isClass);\n if (isClassDeclaration) {\n return `typeof(${idValue})`;\n // this does not work then the class is imported from another file because\n // the type is not resolved correctly and the symbol declaration is simply a importSpecifier\n // we would need to find a way to get the type from the importSpecifier\n // by loading the entire code upon transpiling the ts file\n }\n }\n }\n }\n\n return this.transformIdentifier(node, idValue); // check this later\n }\n\n printConstructorDeclaration (node, identation) {\n const classNode = node.parent;\n const className = this.printNode(classNode.name, 0);\n const args = this.printMethodParameters(node);\n const constructorBody = this.printFunctionBody(node, identation);\n\n // find super call inside constructor and extract params\n let superClause = '';\n node.body?.statements.forEach(statement => {\n if (isExpressionStatement(statement)) {\n const expression = statement.expression;\n if (isCallExpression(expression)) {\n const expressionText = expression.expression.getText().trim();\n if (expressionText === 'super') {\n const superCallParams = expression.arguments.map((a) => {\n return this.printNode(a, identation).trim();\n }).join(\", \");\n superClause = ` : ${this.SUPER_CALL_TOKEN}(${superCallParams})`;\n }\n }\n }\n });\n\n return this.getIden(identation) + className + `(${args})` + superClause + constructorBody;\n }\n\n printDynamicCall(node, identation) {\n const elementAccess = node.expression;\n if (elementAccess?.kind === SyntaxKind.ElementAccessExpression) {\n const parsedArg = node.arguments.map(n => this.printNode(n, identation).trimStart()).join(\", \");\n const target = this.printNode(elementAccess.expression, 0);\n const propName = this.printNode(elementAccess.argumentExpression, 0);\n // always typed as async: the caller cannot tell whether the dynamic target is\n return `((Task)${this.DYNAMIC_CALL_OPEN}${target}, ${propName}, new object[] { ${parsedArg} }))`;\n }\n return undefined;\n }\n\n\n // The C# declared type of an expression's receiver (`request` in `request[\"k\"] = v`), as\n // the consumer's classifier knows it — ccxt's build/csharp-local-types.js overrides this\n // with its scope-aware local map. Undefined on an unpatched printer\n csharpDeclaredReceiverType(node): string | undefined {\n return undefined; // stub to override\n }\n\n // The C# type the printed SIGNATURE gives a parameter (`Dictionary` for `Dict`,\n // `object` when unnamed), recorded while printing so a body use can ask. Read-only: no printer\n // rule consults it; only the consumer's csharpDeclaredReceiverType override changes emission.\n csharpPrintedParamType(receiver): string | undefined {\n const declaration = this.csharpReceiverBinding(receiver);\n if (declaration?.kind !== SyntaxKind.Parameter) {\n return undefined;\n }\n const recorded = this.csharpParamTypes.get(declaration);\n return ((recorded === undefined) || (recorded === '') || (recorded === 'object')) ? undefined : recorded;\n }\n\n // A receiver whose declared C# type the consumer's classifier names as a concrete dictionary:\n // the `((IDictionary)x)` cast around element access is an identity conversion.\n // Gated entirely on the consumer's hook, so an object receiver and untyped runs keep the cast.\n csharpReceiverIsDeclaredDictionary(expression): boolean {\n const declared = this.csharpDeclaredReceiverType(expression);\n return (declared === 'Dictionary') || (declared === 'IDictionary');\n }\n\n // A dict element WRITE (`request[\"k\"] = v`) on a receiver whose *declared* C# type is already a\n // dictionary needs no `((IDictionary)…)` cast: both indexers are the same setter.\n // Gated entirely on csharpDeclaredReceiverType, so object receivers and untyped runs keep the cast.\n csharpDictionaryElementWriteTarget(node): string | undefined {\n const parent = node?.parent;\n // `request[\"k\"] += v` keeps the cast: only the plain assignment was audited\n const isWrite = parent?.kind === SyntaxKind.BinaryExpression\n && parent.operatorToken.kind === SyntaxKind.EqualsToken\n && parent.left === node;\n if (!isWrite || !this.ELEMENT_ACCESS_WRAPPER_OPEN || !this.ELEMENT_ACCESS_WRAPPER_CLOSE) {\n return undefined;\n }\n const { expression, argumentExpression } = node;\n if (!this.csharpReceiverIsDeclaredDictionary(expression)) {\n return undefined;\n }\n // the interface cast also carries the string-key proof; only a string key (or a union\n // holding one, the shape the index-signature key type reports) may stay cast-less\n const keyType = this.getChecker().getTypeAtLocation(argumentExpression);\n const members = (keyType.flags === TypeFlags.Union) ? ((keyType as any).getTypes() ?? [keyType]) : [keyType];\n const stringKey = (keyType.flags === TypeFlags.Any) || members.some((t) => this.isStringType(t.flags));\n if (!stringKey) {\n return undefined;\n }\n const cast = isStringLiteralLikeNode(argumentExpression) ? '' : '(string)';\n return this.printNode(expression, 0) + '[' + cast + this.printNode(argumentExpression, 0) + ']';\n }\n\n printElementAccessExpressionExceptionIfAny(node) {\n // convert this[method] into this.call(method) or this.callAsync(method)\n // if (node?.expression?.kind === SyntaxKind.ThisKeyword) {\n // const isAsyncDecl = node?.parent?.kind === SyntaxKind.AwaitExpression;\n // const open = isAsyncDecl ? this.UKNOWN_PROP_ASYNC_WRAPPER_OPEN : this.UKNOWN_PROP_WRAPPER_OPEN;\n // return open.replace('(', '');\n // }\n }\n\n // reads print getValue(recv, key), which yields null for a missing key; a C# indexer\n // throws instead, so the native form is only emitted where the source guarantees the key\n // is there: a dominating `key in recv` guard, or a receiver local built by a literal that\n // declares the key, or a receiver the declared table proves is a dictionary (the native\n // form then keeps the helper's null-for-a-missing-key result). every other read keeps the\n // helper.\n // the single element-access override, gates strongest (declaration-type) proof first:\n // S21 typed dict WRITE (csharpDictionaryElementWriteTarget), S63 typed dict READ twin\n // (printTypedDictElementAccessIfAny), S14 list-cast (csharpElementAccessReceiverIsList),\n // then the native read form proven from the printed source (#82, csharpNativeElementAccess,\n // see the note above). Every other read keeps the helper; a site no gate names keeps the\n // base printing.\n printElementAccessExpression(node, identation) {\n const native = this.csharpNativeElementAccess(node);\n if (native !== undefined) {\n return native;\n }\n const dictWrite = this.csharpDictionaryElementWriteTarget(node);\n if (dictWrite !== undefined) {\n return dictWrite;\n }\n const typedRead = this.printTypedDictElementAccessIfAny(node);\n if (typedRead !== undefined) {\n return typedRead;\n }\n if (this.csharpElementAccessReceiverIsList(node)) {\n const type = this.getChecker().getTypeAtLocation(node.argumentExpression);\n const isUnion = ((type.flags & TypeFlags.Union) !== 0) && Array.isArray((type as any).getTypes());\n // the base printer's own key dispatch, plus the union spelling the worker\n // handles: a string (or type-less) key is a dictionary element, never a list\n // index, and keeps the IDictionary cast\n const isStringOrUnknownKey = this.isStringType(type.flags)\n || (type.flags === TypeFlags.Any)\n || (isUnion && (type as any).getTypes().some((t) => this.isStringType(t.flags)));\n if (!isStringOrUnknownKey) {\n return `${this.printNode(node.expression, 0)}[Convert.ToInt32(${this.printNode(node.argumentExpression, 0)})]`;\n }\n }\n const listRead = this.csharpListIndexRead(node);\n if (listRead !== undefined) {\n return listRead;\n }\n const keyRead = (this.ELEMENT_ACCESS_WRAPPER_OPEN && !this.printElementAccessExpressionExceptionIfAny(node))\n ? this.csharpHx4IdentifierKeyRead(node.expression, node.argumentExpression) : undefined;\n if (keyRead !== undefined) {\n return keyRead; // hx4 C11\n }\n return super.printElementAccessExpression(node, identation);\n }\n\n csharpNativeElementAccess(node): string | undefined {\n if (!this.ELEMENT_ACCESS_WRAPPER_OPEN || !this.ELEMENT_ACCESS_WRAPPER_CLOSE) {\n return undefined;\n }\n const exception: any = this.printElementAccessExpressionExceptionIfAny(node);\n if (exception) {\n return undefined; // the exception printing wins over the native form\n }\n const { expression, argumentExpression } = node;\n const parent = node.parent;\n const isWrite = parent?.kind === SyntaxKind.BinaryExpression &&\n (parent.operatorToken.kind === SyntaxKind.EqualsToken || parent.operatorToken.kind === SyntaxKind.PlusEqualsToken) &&\n parent.left === node;\n if (isWrite) {\n return undefined; // writes are native already, they are printed with the cast\n }\n const isStringKey = isStringLiteralLikeNode(argumentExpression);\n const isNumberKey = isNumericLiteral(argumentExpression);\n if (!isStringKey && !isNumberKey) {\n return this.csharpLoopIndexListRead(expression, argumentExpression); // counter proven in range by its loop\n }\n const key = (argumentExpression as any).text;\n const builtFromLiteral = this.csharpLiteralDeclaresKey(node, expression, key, isNumberKey);\n const guarded = !builtFromLiteral && this.csharpKeyPresenceGuarded(node, expression, key);\n if (!builtFromLiteral && !guarded) {\n return this.csharpNativeDeclaredDictionaryRead(expression, argumentExpression)\n ?? this.csharpDeclaredLocalResolverRowRead(expression, argumentExpression)\n ?? this.csharpDeclaredCollectionRead(node, expression, argumentExpression, isStringKey, isNumberKey)\n ?? this.csharpProvenDictionaryRead(node, expression, argumentExpression, isStringKey)\n ?? this.csharpMissingKeyFieldRead(expression, argumentExpression, isStringKey);\n }\n const receiver = this.printNode(expression, 0);\n const printedKey = this.printNode(argumentExpression, 0);\n if (isNumberKey) {\n return `((${this.ARRAY_KEYWORD})${receiver})[${printedKey}]`;\n }\n // a receiver the classifier already declared a concrete dictionary keeps its own\n // indexer: the interface cast named the box, never a conversion\n if (this.csharpReceiverIsDeclaredDictionary(expression)) {\n return `${receiver}[${printedKey}]`;\n }\n return `((IDictionary)${receiver})[${printedKey}]`;\n }\n\n // `getValue (market, \"lit\")` / `getValue (currency, \"lit\")` on a row local the declared\n // table proves is a C# dictionary: the native form tests the key, so a missing key still\n // reads null exactly like the helper. An untyped receiver keeps the helper.\n csharpIsMarketRowKeyRead(expression, argumentExpression): boolean {\n return isIdentifier(expression) && isStringLiteralLikeNode(argumentExpression)\n && CSHARP_NATIVE_MARKET_RECEIVERS.indexOf(expression.text as string) >= 0;\n }\n\n csharpNativeDeclaredDictionaryRead(expression, argumentExpression): string | undefined {\n if (!this.csharpIsMarketRowKeyRead(expression, argumentExpression)) {\n return undefined;\n }\n if (this.csharpDeclaredDictionaryType(expression) === undefined) {\n return undefined;\n }\n const receiver = this.printNode(expression, 0);\n const printedKey = this.printNode(argumentExpression, 0);\n return `(${receiver}.ContainsKey(${printedKey}) ? ${receiver}[${printedKey}] : null)`;\n }\n\n // the C# dictionary type the declared table names for a local read, or undefined: the\n // printer's own table, then the build layer's read proof (the row a market/currency builder\n // returned; never null on any path)\n csharpDeclaredDictionaryType(node): string | undefined {\n if (node?.kind !== SyntaxKind.Identifier) {\n return undefined;\n }\n const named = this.csharpTypedLocalType(node) ?? this.csharpExpressionTypeOf(node);\n if (named === undefined || CSHARP_NATIVE_DICTIONARY_TYPES.indexOf(named) < 0) {\n return undefined;\n }\n return named;\n }\n\n // the type the embedding build layer recorded for the declaration behind a read\n // (csharpDeclaredLocalTypeResolver): the declarations it retyped itself, i.e. the parameters\n // and locals whose printed prefix is no longer what the printer's own tables say\n csharpDeclaredLocalResolverType(node): string | undefined {\n if (typeof this.csharpDeclaredLocalTypeResolver !== 'function') {\n return undefined;\n }\n const checker: any = this.checkerOrUndefined();\n if (checker === undefined) {\n return undefined;\n }\n const declaration = checker.getSymbolAtLocation(node)?.valueDeclaration?.resolve();\n if (declaration === undefined) {\n return undefined;\n }\n const recorded = this.csharpDeclaredLocalTypeResolver(declaration);\n return (typeof recorded === 'string') ? recorded : undefined;\n }\n\n // the same read for a receiver only the build layer's declared-local resolver names (a\n // parameter B-17 retyped): its box may still be null, so the read carries the helper's\n // own `value2 == null -> null` branch as a null test\n csharpDeclaredLocalResolverRowRead(expression, argumentExpression): string | undefined {\n if (!this.csharpIsMarketRowKeyRead(expression, argumentExpression)) {\n return undefined;\n }\n const recorded = this.csharpDeclaredLocalResolverType(expression);\n if (recorded === undefined || CSHARP_NATIVE_DICTIONARY_TYPES.indexOf(recorded) < 0) {\n return undefined;\n }\n const receiver = this.printNode(expression, 0);\n const printedKey = this.printNode(argumentExpression, 0);\n return `(${receiver} != null && ${receiver}.ContainsKey(${printedKey}) ? ${receiver}[${printedKey}] : null)`;\n }\n\n // a read of a hand-written BaseExchange dictionary field whose key may be absent: the key\n // test plus the indexer print what the helper computes, so a missing key still reads null\n // (a bare indexer would throw). Any other receiver or a numeric key keeps the helper\n csharpMissingKeyFieldRead(expression, argumentExpression, isStringKey): string | undefined {\n if (!isStringKey) {\n return undefined;\n }\n if (!isPropertyAccessExpression(expression) || expression.expression.kind !== SyntaxKind.ThisKeyword) {\n return undefined;\n }\n const name = expression.name?.text as string;\n if (CSHARP_MISSING_KEY_FIELDS_NATIVE.indexOf(name) < 0) {\n return undefined;\n }\n const field = this.printNode(expression, 0);\n const printedKey = this.printNode(argumentExpression, 0);\n // `urls`/`markets`/`exceptions` are declared `object`: same cast and null-receiver branch as the\n // transpiled helper body (initializeProperties may leave the box null when describe() has no such\n // row). `has`/`options` are concrete dictionaries, never null, so they need no test.\n if (CSHARP_OBJECT_DICT_FIELDS.indexOf(name) >= 0) {\n const receiver = `((IDictionary)${field})`;\n return `(${field} != null && ${receiver}.ContainsKey(${printedKey}) ? ${receiver}[${printedKey}] : null)`;\n }\n return `(${field}.ContainsKey(${printedKey}) ? ${field}[${printedKey}] : null)`;\n }\n\n // A literal-key read on a local whose C# declaration is already a collection: no cast needed, but\n // the indexer throws where GetValue answers null, so the native form carries the helper's key/index\n // and null-receiver tests. Only an Identifier qualifies (its text is read up to three times).\n csharpDeclaredCollectionRead(node, expression, argumentExpression, isStringKey, isNumberKey): string | undefined {\n if (!isIdentifier(expression)) {\n return undefined;\n }\n if (CSHARP_MARKET_RECEIVER_NAMES.indexOf(expression.text as string) >= 0) {\n return undefined;\n }\n const csharpType = this.csharpDeclaredCollectionType(expression);\n if (csharpType === undefined) {\n return undefined;\n }\n if (!this.csharpHx4DeclaredReceiverReadable(node, expression)) {\n return undefined;\n }\n const receiver = this.printNode(expression, 0);\n if (csharpType.indexOf('Dictionary<') >= 0) {\n if (!isStringKey) {\n return undefined; // the helper reads a dictionary key as a string, a literal index has no native twin\n }\n const printedKey = this.printNode(argumentExpression, 0);\n return `(${receiver} != null && ${receiver}.ContainsKey(${printedKey}) ? ${receiver}[${printedKey}] : null)`;\n }\n if (isNumberKey) {\n const index = Number((argumentExpression as any).text);\n if (!Number.isInteger(index) || (index < 0)) {\n return undefined; // the helper throws on a negative index too, but never prints one itself\n }\n return `(${receiver} != null && ${index} < ${receiver}.Count ? ${receiver}[${index}] : null)`;\n }\n return undefined;\n }\n\n // The C# collection type a local read was DECLARED with: printed by this printer, or recorded by\n // embedding build layer for a declaration it retyped (csharpDeclaredLocalTypeResolver). The\n // value-type oracle does not qualify: the declaration may still be `object` and not compile.\n csharpDeclaredCollectionType(expression): string | undefined {\n const named = this.csharpTypedLocalType(expression);\n if (named !== undefined && CSHARP_NATIVE_COLLECTION_TYPES.indexOf(named) >= 0) {\n return named;\n }\n if (this.csharpDeclaredLocalTypeResolver === undefined) {\n return undefined;\n }\n const declaration = this.getChecker().getSymbolAtLocation(expression)?.valueDeclaration?.resolve();\n if (declaration === undefined) {\n return undefined;\n }\n const recorded = this.csharpDeclaredLocalTypeResolver(declaration);\n return (recorded !== undefined && CSHARP_NATIVE_COLLECTION_TYPES.indexOf(recorded) >= 0) ? recorded : undefined;\n }\n\n // A literal-key read on a local still declared `object` but whose box the build layer's value-type\n // oracle (build/csharp-local-types.js) proves a dictionary: the cast makes the read compile, and\n // key test plus null guard return exactly what the helper does. Sibling arms are filtered first.\n csharpProvenDictionaryRead(node, expression, argumentExpression, isStringKey): string | undefined {\n if (!isStringKey || !isIdentifier(expression)) {\n return undefined;\n }\n if (CSHARP_MARKET_RECEIVER_NAMES.indexOf(expression.text as string) >= 0) {\n return undefined;\n }\n if (this.csharpTypedLocalType(expression) !== undefined) {\n return undefined; // the declaration this printer wrote names its own type (see above)\n }\n const proven = this.csharpExpressionTypeOf(expression);\n if (proven === undefined || CSHARP_NATIVE_DICTIONARY_TYPES.indexOf(proven) < 0) {\n return undefined; // only a proven dictionary box has the members the read binds\n }\n const func = this.csharpEnclosingFunction(node);\n if (func === undefined || this.csharpReceiverIsRewritten(func, expression)) {\n return undefined; // a reassigned receiver may hold another box at this read\n }\n const local = this.printNode(expression, 0);\n const receiver = `((IDictionary)${local})`;\n const printedKey = this.printNode(argumentExpression, 0);\n return `(${local} != null && ${receiver}.ContainsKey(${printedKey}) ? ${receiver}[${printedKey}] : null)`;\n }\n\n // the read sits in a branch that a `key in recv` guard admitted: same then-branch as the\n // guard, the else-branch of a negated guard, or after an early-exiting `if (!(key in recv))`\n csharpKeyPresenceGuarded(node, expression, key): boolean {\n const func = this.csharpEnclosingFunction(node);\n if (func === undefined) {\n return false;\n }\n const guards = this.csharpInGuardsOf(func).get(expression.getText() + GUARD_KEY_SEPARATOR + key);\n if (guards === undefined || !this.csharpReceiverIsDictionaryLike(expression, key)) {\n return false;\n }\n if (this.csharpReceiverIsRewritten(func, expression)) {\n return false; // a reassigned receiver is not the object the guard inspected\n }\n if (this.csharpHasKeyRemoval(func, expression, key)) {\n return false; // delete could have removed the guarded key\n }\n return guards.some((guard) => this.csharpGuardAdmitsRead(guard, node));\n }\n\n // `recv[i]` where `i` is the counter of an enclosing `for (...; i < recv.length; ...)`: that\n // condition is the range proof, so the helper's out-of-range null branch is unreachable. Both\n // operands must print as the indexer's C# types (object-element list, `int`); else keep the helper.\n csharpLoopIndexListRead(expression, argumentExpression): string | undefined {\n if (!isIdentifier(expression) || !isIdentifier(argumentExpression)) {\n return undefined;\n }\n const receiverType = this.csharpExpressionTypeOf(expression);\n if (receiverType === undefined || !this.csharpTypeIsList(receiverType)) {\n return undefined;\n }\n if (this.csharpExpressionTypeOf(argumentExpression) !== 'int') {\n return undefined; // a boxed/Int64/double index does not bind the List indexer\n }\n const loop = this.csharpCounterRangeLoop(argumentExpression, expression);\n if (loop === undefined) {\n return undefined;\n }\n if (!this.csharpCounterUnwrittenIn(loop.statement, argumentExpression) ||\n !this.csharpReceiverIntactIn(loop.statement, expression)) {\n return undefined; // the bound the header proved no longer holds at this read\n }\n return `${this.printNode(expression, 0)}[${this.printNode(argumentExpression, 0)}]`;\n }\n\n // the enclosing `for` whose condition is ` < .length` and whose header declares\n // that counter: the condition held on entry to this pass and nothing in between moved off it\n csharpCounterRangeLoop(counter, receiver) {\n let node: any = counter;\n while (node.parent !== undefined) {\n const parent: any = node.parent;\n if (isFunctionLike(parent)) {\n return undefined; // a closure runs when the counter may already have moved on\n }\n if (isForStatement(parent) && this.csharpContains(parent.statement, counter) && this.csharpForBoundsCounter(parent, counter, receiver)) {\n return parent;\n }\n node = parent;\n }\n return undefined;\n }\n\n csharpForBoundsCounter(loop, counter, receiver): boolean {\n const condition = this.csharpUnparenthesized(loop.condition);\n if (condition?.kind !== SyntaxKind.BinaryExpression || condition.operatorToken.kind !== SyntaxKind.LessThanToken) {\n return false;\n }\n const left = this.csharpUnparenthesized(condition.left);\n const right = this.csharpUnparenthesized(condition.right);\n if (!isIdentifier(left) || !isPropertyAccessExpression(right) || right.name?.text !== 'length') {\n return false;\n }\n const receiverExpression = this.csharpUnparenthesized(right.expression);\n if (!isIdentifier(receiverExpression) || !this.csharpCounterStartsAtZero(loop, counter) || !this.csharpCounterAdvances(loop, counter)) {\n return false;\n }\n const declaration = this.getChecker().getSymbolAtLocation(counter)?.valueDeclaration?.resolve();\n const checker = this.getChecker();\n return declaration !== undefined &&\n checker.getSymbolAtLocation(left)?.valueDeclaration?.resolve() === declaration &&\n checker.getSymbolAtLocation(receiverExpression)?.valueDeclaration?.resolve() === checker.getSymbolAtLocation(receiver)?.valueDeclaration?.resolve();\n }\n\n // `for (let i = = 0>; ...)` — a negative start would index below the list\n csharpCounterStartsAtZero(loop, counter): boolean {\n const initializer: any = loop.initializer;\n if (initializer?.kind !== SyntaxKind.VariableDeclarationList || initializer.declarations.length !== 1) {\n return false;\n }\n const declaration: any = initializer.declarations[0];\n if (!isIdentifier(declaration.name) || !isNumericLiteral(declaration.initializer)) {\n return false;\n }\n return Number(declaration.initializer.text) >= 0 && this.getChecker().getSymbolAtLocation(counter)?.valueDeclaration?.resolve() === declaration;\n }\n\n // the header moves the counter forward: a decrement could leave a negative index behind\n csharpCounterAdvances(loop, counter): boolean {\n const declaration = this.getChecker().getSymbolAtLocation(counter)?.valueDeclaration?.resolve();\n const incrementor: any = this.csharpUnparenthesized(loop.incrementor);\n if (incrementor === undefined || declaration === undefined) {\n return false;\n }\n if (incrementor.kind === SyntaxKind.PostfixUnaryExpression || incrementor.kind === SyntaxKind.PrefixUnaryExpression) {\n return incrementor.operator === SyntaxKind.PlusPlusToken &&\n this.getChecker().getSymbolAtLocation(incrementor.operand)?.valueDeclaration?.resolve() === declaration;\n }\n if (incrementor.kind === SyntaxKind.BinaryExpression && incrementor.operatorToken.kind === SyntaxKind.PlusEqualsToken) {\n return this.getChecker().getSymbolAtLocation(incrementor.left)?.valueDeclaration?.resolve() === declaration &&\n isNumericLiteral(incrementor.right) && Number(incrementor.right.text) >= 0;\n }\n return false;\n }\n\n // a write to the counter in the body invalidates the bound the condition proved\n csharpCounterUnwrittenIn(range, counter): boolean {\n const declaration = this.getChecker().getSymbolAtLocation(counter)?.valueDeclaration?.resolve();\n if (declaration === undefined) {\n return false;\n }\n let written = false;\n this.csharpWalkIdentifiers(range, (identifier: any) => {\n if (written || !this.csharpIsSameDeclaration(identifier, declaration)) {\n return;\n }\n const parent: any = identifier.parent;\n if (isBinaryExpression(parent) && parent.left === identifier) {\n written = CSHARP_ASSIGNMENT_OPERATOR_KINDS.indexOf(parent.operatorToken.kind) >= 0;\n } else {\n written = ((isPrefixUnaryExpression(parent) || isPostfixUnaryExpression(parent)) && parent.operand === identifier)\n || isDeleteExpression(parent);\n }\n });\n return !written;\n }\n\n // the condition's `.length` still proves the range only while the list is intact: inside\n // the body the receiver may be read (element reads, its own `.length`) and nothing else\n csharpReceiverIntactIn(range, receiver): boolean {\n const declaration = this.getChecker().getSymbolAtLocation(receiver)?.valueDeclaration?.resolve();\n if (declaration === undefined) {\n return false;\n }\n let intact = true;\n this.csharpWalkIdentifiers(range, (identifier: any) => {\n if (!intact || !this.csharpIsSameDeclaration(identifier, declaration)) {\n return;\n }\n const parent: any = identifier.parent;\n if (isPropertyAccessExpression(parent) && parent.expression === identifier && parent.name?.text === 'length') {\n return;\n }\n if (isElementAccessExpression(parent) && parent.expression === identifier && !this.csharpIsWriteTarget(parent)) {\n return;\n }\n intact = false;\n });\n return intact;\n }\n\n csharpIsSameDeclaration(identifier, declaration): boolean {\n return this.getChecker().getSymbolAtLocation(identifier)?.valueDeclaration?.resolve() === declaration;\n }\n\n csharpWalkIdentifiers(node, visit) {\n if (node === undefined) {\n return;\n }\n if (isIdentifier(node)) {\n visit(node);\n }\n node.forEachChild((child: any) => this.csharpWalkIdentifiers(child, visit));\n }\n\n // `x[i] = v` / `x[i]++` / `delete x[i]` change the receiver in place\n csharpIsWriteTarget(node): boolean {\n let value: any = node;\n while (value.parent !== undefined && isParenthesizedExpression(value.parent)) {\n value = value.parent;\n }\n const parent: any = value.parent;\n if (parent === undefined) {\n return false;\n }\n if (isBinaryExpression(parent) && parent.left === value) {\n return CSHARP_ASSIGNMENT_OPERATOR_KINDS.indexOf(parent.operatorToken.kind) >= 0;\n }\n if ((isPrefixUnaryExpression(parent) || isPostfixUnaryExpression(parent)) && parent.operand === value) {\n return (parent.operator === SyntaxKind.PlusPlusToken) || (parent.operator === SyntaxKind.MinusMinusToken);\n }\n return isDeleteExpression(parent);\n }\n\n csharpUnparenthesized(node) {\n let value: any = node;\n while (value !== undefined && value.kind === SyntaxKind.ParenthesizedExpression) {\n value = value.expression;\n }\n return value;\n }\n\n csharpGuardAdmitsRead(guard, read): boolean {\n const negated = this.csharpGuardIsNegated(guard);\n let statement: any = guard;\n while (statement !== undefined && statement.parent !== undefined) {\n const parent: any = statement.parent;\n if (isIfStatement(parent) && this.csharpContains(parent.expression, guard)) {\n if (!negated && this.csharpContains(parent.thenStatement, read)) {\n return true;\n }\n if (negated && parent.elseStatement !== undefined && this.csharpContains(parent.elseStatement, read)) {\n return true;\n }\n // `if (!(key in recv)) { return/throw/continue; }` then the read after it\n if (negated && this.csharpAlwaysExits(parent.thenStatement) &&\n read.getStart() >= parent.getEnd() && this.csharpContains(parent.parent, read)) {\n return true;\n }\n return false;\n }\n if (isWhileStatement(parent) && this.csharpContains(parent.expression, guard)) {\n return !negated && this.csharpContains(parent.statement, read);\n }\n statement = parent;\n }\n return false;\n }\n\n // `key in recv` guards in the function body, indexed by receiver text + key; nested\n // functions are skipped, their guards cannot dominate a read of the outer function\n csharpInGuardsOf(func): Map {\n const cached = this.csharpGuardIndex.get(func);\n if (cached !== undefined) {\n return cached;\n }\n const index: Map = new Map();\n const collect = (n: any) => {\n if (n !== func && isFunctionLike(n)) {\n return;\n }\n if (isBinaryExpression(n) && n.operatorToken.kind === SyntaxKind.InKeyword) {\n const keyNode: any = n.left;\n if (isStringLiteralLikeNode(keyNode) || isNumericLiteral(keyNode)) {\n const id = n.right.getText() + GUARD_KEY_SEPARATOR + keyNode.text;\n const list = index.get(id);\n if (list === undefined) {\n index.set(id, [ n ]);\n } else {\n list.push(n);\n }\n }\n }\n n.forEachChild(collect);\n };\n collect(func);\n this.csharpGuardIndex.set(func, index);\n return index;\n }\n\n // the read's receiver is a local whose only initializer is a literal that declares the\n // key, and the local is not reassigned or deleted from afterwards\n csharpLiteralDeclaresKey(node, expression, key, isNumberKey): boolean {\n if (!isIdentifier(expression)) {\n return false;\n }\n const symbol: any = this.getChecker().getSymbolAtLocation(expression);\n const declarations: any = (symbol?.declarations ?? []).map((d) => d.resolve());\n if (declarations.length !== 1 || !isVariableDeclaration(declarations[0])) {\n return false;\n }\n const declaration: any = declarations[0];\n if (declaration.initializer === undefined || declaration.getStart() >= node.getStart()) {\n return false;\n }\n const initializer = declaration.initializer;\n let declares = false;\n if (isNumberKey && isArrayLiteralExpression(initializer)) {\n const spread = initializer.elements.some((element: any) => isSpreadElement(element));\n declares = !spread && Number(key) < initializer.elements.length;\n } else if (!isNumberKey && isObjectLiteralExpression(initializer)) {\n declares = this.csharpObjectLiteralDeclaresKey(initializer, key);\n }\n if (!declares) {\n return false;\n }\n const func = this.csharpEnclosingFunction(node);\n return func !== undefined && !this.csharpReceiverIsRewritten(func, expression);\n }\n\n csharpObjectLiteralDeclaresKey(literal, key): boolean {\n for (const property of literal.properties) {\n if (isSpreadAssignment(property)) {\n return false; // spread keys cannot be enumerated\n }\n const name: any = (property as any).name;\n if (name !== undefined && (isIdentifier(name) || isStringLiteralLikeNode(name) || isNumericLiteral(name)) && name.text === key) {\n return true;\n }\n }\n return false;\n }\n\n // the receiver must be a dictionary at runtime for the IDictionary cast to hold; `any`\n // receivers are rejected because the checker cannot tell what the read reaches\n csharpReceiverIsDictionaryLike(expression, key): boolean {\n const type: any = this.getChecker().getTypeAtLocation(expression);\n if (type.flags === TypeFlags.Any || type.flags === TypeFlags.Unknown) {\n return false;\n }\n const checker = this.getChecker();\n return checker.getIndexInfoOfType(type, IndexKind.String) !== undefined ||\n checker.getPropertyOfType(type, key) !== undefined;\n }\n\n // any assignment to the receiver (or to a same-named binding) in the function makes the\n // object the read evaluates unprovable, so the read falls back to the helper\n csharpReceiverIsRewritten(func, expression): boolean {\n const text = expression.getText();\n const name = isIdentifier(expression) ? text : text.split(/[.[]/)[1];\n if (name === undefined) {\n return true;\n }\n let rewritten = false;\n const walk = (n: any) => {\n if (rewritten) {\n return;\n }\n if (isIdentifier(n) && n.text === name) {\n const parent: any = n.parent;\n rewritten = (isBinaryExpression(parent) && parent.left === n)\n || ((isPrefixUnaryExpression(parent) || isPostfixUnaryExpression(parent)) && parent.operand === n)\n || isDeleteExpression(parent);\n }\n n.forEachChild(walk);\n };\n walk(func);\n return rewritten;\n }\n\n // ===== ws handler `message` parameter (batch D, D-19) =====\n // A ws handler `handleX (client: Client, message: Dict)` is reached at runtime either\n // through a dispatch-table entry (`{ \"k\", this.handleX }` -> DynamicInvoker) or a direct\n csharpHandlerMessageType(param): string | undefined {\n if (this.csharpHandlerMessageTypes.has(param)) {\n return this.csharpHandlerMessageTypes.get(param);\n }\n let result: string | undefined = undefined;\n const method: any = param?.parent;\n if (isMethodDeclaration(method) && (method.parameters.length >= 2) && (method.parameters[1] === param)) {\n if ((this.csharpCheckerTypeName(method.parameters[0]) === 'Client') &&\n (this.csharpCheckerTypeName(param) === 'Dict') &&\n (this.getMethodOverride(method) === undefined) &&\n !this.csharpReceiverIsRewritten(method, param.name) &&\n !this.csharpHandlerIsCalled(method) &&\n !this.csharpClassHasListRoute(method)) {\n result = this.ArgTypeReplacements['Dict'] ?? 'Dictionary';\n }\n }\n this.csharpHandlerMessageTypes.set(param, result);\n return result;\n }\n\n // the type name the checker prints for a node's type, or undefined in an in-memory\n // program (no checker answer: the printer keeps its own)\n csharpCheckerTypeName(node): string | undefined {\n if (node === undefined) {\n return undefined;\n }\n try {\n const checker = this.getChecker();\n const type = checker.getTypeAtLocation(node);\n return (type === undefined) ? undefined : checker.typeToString(type);\n } catch (e) {\n return undefined;\n }\n }\n\n csharpEnclosingClass(node): any | undefined {\n let current: any = node?.parent;\n while (current !== undefined) {\n if (isClassDeclaration(current) || isClassExpression(current)) {\n return current;\n }\n current = current.parent;\n }\n return undefined;\n }\n\n // the identifier is the raw `message` parameter of a handler-shaped method (a `Client`\n // first parameter, so `handleMessage` with its `any` annotation included): the class can\n // route that same value through its list arm\n csharpIsHandlerMessageIdentifier(node): boolean {\n if (!isIdentifier(node)) {\n return false;\n }\n try {\n const declaration: any = this.getChecker().getSymbolAtLocation(node)?.valueDeclaration?.resolve();\n if ((declaration === undefined) || !isParameterDeclaration(declaration)) {\n return false;\n }\n const owner: any = declaration.parent;\n return isMethodDeclaration(owner) && (owner.parameters.length >= 2) &&\n (owner.parameters[1] === declaration) && (this.csharpCheckerTypeName(owner.parameters[0]) === 'Client');\n } catch (e) {\n return false;\n }\n }\n\n // a class that tests the message (or another dict parameter) for a list can hand the\n // array itself to a dispatch-table entry (binance `'x@arr'`), so its handlers keep the\n // box; a class testing unrelated lists (an array-typed `symbols` parameter, a field of\n csharpClassHasListRoute(method): boolean {\n const cls = this.csharpEnclosingClass(method);\n if (cls === undefined) {\n return true; // no class, no proof\n }\n const cached = this.csharpListRouteClasses.get(cls);\n if (cached !== undefined) {\n return cached;\n }\n let found = false;\n const walk = (n: any) => {\n if (found) {\n return;\n }\n if (isCallExpression(n) && isPropertyAccessExpression(n.expression) &&\n ((n.expression as any).expression?.text === 'Array') && ((n.expression as any).name?.text === 'isArray')) {\n const argument: any = n.arguments[0];\n if (this.csharpIsHandlerMessageIdentifier(argument)) {\n found = true;\n return;\n }\n }\n n.forEachChild(walk);\n };\n walk(cls);\n this.csharpListRouteClasses.set(cls, found);\n return found;\n }\n\n // a static call reference (`this.handleX (…)`) binds the argument to the printed\n // signature; a method-group value (a dispatch-table entry) does not\n csharpHandlerIsCalled(method): boolean {\n const cached = this.csharpHandlerCalled.get(method);\n if (cached !== undefined) {\n return cached;\n }\n let called = true; // no symbol answer: keep the box\n const cls = this.csharpEnclosingClass(method);\n let file: any;\n try {\n file = method.getSourceFile();\n } catch (e) {\n file = undefined;\n }\n if ((cls !== undefined) && (file !== undefined)) {\n try {\n const symbol = this.getChecker().getSymbolAtLocation(method.name);\n if (symbol !== undefined) {\n called = this.csharpHandlerCallIndexFor(file).get(symbol) === true;\n }\n } catch (e) {\n called = true;\n }\n }\n this.csharpHandlerCalled.set(method, called);\n return called;\n }\n\n // every identifier of the FILE that resolves to one of its classes' own method names,\n // recorded as a call when it is the callee of a call expression; keyed by symbol, so a\n // same-named method of another class never marks this one\n csharpHandlerCallIndexFor(file): Map {\n const cached = this.csharpHandlerCallIndex.get(file);\n if (cached !== undefined) {\n return cached;\n }\n const names = new Set();\n const collect = (n: any) => {\n if (isClassDeclaration(n) || isClassExpression(n)) {\n for (const member of n.members) {\n const name: any = (member as any).name?.text;\n if (isMethodDeclaration(member) && (name !== undefined)) {\n names.add(name);\n }\n }\n }\n n.forEachChild(collect);\n };\n collect(file);\n const index = new Map();\n if (names.size > 0) {\n let checker;\n try {\n checker = this.getChecker();\n } catch (e) {\n checker = undefined;\n }\n if (checker !== undefined) {\n const walk = (n: any) => {\n if (isIdentifier(n) && names.has(n.text as string)) {\n let symbol;\n try {\n symbol = checker.getSymbolAtLocation(n);\n } catch (e) {\n symbol = undefined;\n }\n if (symbol !== undefined) {\n const parent: any = n.parent;\n const isCall = (isPropertyAccessExpression(parent) && (parent.name === n) &&\n isCallExpression(parent.parent) && (parent.parent.expression === parent)) ||\n (isCallExpression(parent) && (parent.expression === n));\n if (isCall) {\n index.set(symbol, true);\n } else if (index.get(symbol) === undefined) {\n index.set(symbol, false);\n }\n }\n }\n n.forEachChild(walk);\n };\n walk(file);\n }\n }\n this.csharpHandlerCallIndex.set(file, index);\n return index;\n }\n\n csharpHasKeyRemoval(func, expression, key): boolean {\n const text = expression.getText();\n let removed = false;\n const walk = (n: any) => {\n if (removed) {\n return;\n }\n if (isDeleteExpression(n) && isElementAccessExpression(n.expression) &&\n n.expression.expression.getText() === text && n.expression.argumentExpression.getText().replace(/['\"]/g, '') === key.replace(/['\"]/g, '')) {\n removed = true;\n }\n n.forEachChild(walk);\n };\n walk(func);\n return removed;\n }\n\n csharpGuardIsNegated(guard): boolean {\n let node: any = guard;\n while (node.parent !== undefined && isParenthesizedExpression(node.parent)) {\n node = node.parent;\n }\n return node.parent !== undefined && isPrefixUnaryExpression(node.parent) &&\n node.parent.operator === SyntaxKind.ExclamationToken;\n }\n\n csharpAlwaysExits(statement): boolean {\n if (statement === undefined) {\n return false;\n }\n const exits = (n: any) => isReturnStatement(n) || isThrowStatement(n) || isContinueStatement(n) || isBreakStatement(n);\n if (exits(statement)) {\n return true;\n }\n if (isBlock(statement) && statement.statements.length > 0) {\n return exits(statement.statements[statement.statements.length - 1]);\n }\n return false;\n }\n\n csharpContains(outer, inner): boolean {\n if (outer === undefined || inner === undefined) {\n return false;\n }\n return inner.getStart() >= outer.getStart() && inner.getEnd() <= outer.getEnd();\n }\n // cs-strict S14: `((List)x)[i] = v` needs no cast when the PRINTED declaration is\n // `List` (identity conversion; not IList, a checked downcast). Type comes via the\n // `csharpLocalTypeOf` hook; `x[i] += v` and reads stay on the base path (third override layer).\n csharpElementAccessReceiverIsList(node) {\n if (node?.kind !== SyntaxKind.ElementAccessExpression) {\n return false;\n }\n const parent = node.parent;\n if (parent?.kind !== SyntaxKind.BinaryExpression || parent.operatorToken?.kind !== SyntaxKind.EqualsToken || parent.left !== node) {\n return false;\n }\n const receiver = node.expression;\n if (receiver?.kind !== SyntaxKind.Identifier) {\n return false;\n }\n const localTypeOf = (this as any).csharpLocalTypeOf;\n return (typeof localTypeOf === 'function') && (localTypeOf.call(this, receiver) === 'List');\n }\n\n // The C# declared type pair of a list index READ (`x[i]`): receiver (`List` /\n // `IList`) and index (`int`). Consumer-installed (build/csharp-local-types.js);\n // undefined by default, so an unpatched printer keeps `getValue (x, i)` for every read.\n csharpListIndexReadTypes(node): { receiver: string, index: string } | undefined {\n return undefined; // stub to override\n }\n\n // `x[i]` read on a list receiver: the helper answers null off the end while the C# indexer throws,\n // so the native read is only emitted where the source proves the index in range. Types come from\n // the consumer hook above, so the untyped emission is byte-identical.\n csharpListIndexRead(node): string | undefined {\n if (node?.kind !== SyntaxKind.ElementAccessExpression) {\n return undefined;\n }\n const { expression, argumentExpression } = node;\n if (expression?.kind !== SyntaxKind.Identifier || argumentExpression?.kind !== SyntaxKind.Identifier) {\n return undefined;\n }\n if (this.csharpIsSetOrAddTarget(node)) {\n return undefined; // element writes print through the cast path\n }\n const types = (typeof this.csharpListIndexReadTypes === 'function') ? this.csharpListIndexReadTypes(node) : undefined;\n if (types?.index !== 'int') {\n return undefined; // only an int index binds the List indexer\n }\n if ((types.receiver !== 'List') && (types.receiver !== 'IList')) {\n return undefined;\n }\n if (!this.csharpIndexIsLoopBounded(node, expression, argumentExpression)) {\n return undefined;\n }\n return this.printNode(expression, 0) + '[' + this.printNode(argumentExpression, 0) + ']';\n }\n\n // the read sits in the body of a `for` that re-tests `index < receiver.length`, both\n // resolved to the very symbols the read uses, and nothing in the body can move either\n csharpIndexIsLoopBounded(read, receiver, index): boolean {\n const receiverSymbol = this.csharpIdentifierSymbol(receiver);\n const indexSymbol = this.csharpIdentifierSymbol(index);\n if (receiverSymbol === undefined || indexSymbol === undefined) {\n return false;\n }\n let node: any = read;\n while (node?.parent !== undefined) {\n const parent: any = node.parent;\n if (isFunctionLike(parent)) {\n return false; // a read under a nested function is not dominated by the condition\n }\n if (isForStatement(parent) && this.csharpForBoundsIndex(parent, read, receiverSymbol, indexSymbol)) {\n return true;\n }\n node = parent;\n }\n return false;\n }\n\n csharpIdentifierSymbol(node): any {\n if (node?.kind !== SyntaxKind.Identifier) {\n return undefined;\n }\n return this.checkerOrUndefined()?.getSymbolAtLocation(node);\n }\n\n csharpForBoundsIndex(forStatement, read, receiverSymbol, indexSymbol): boolean {\n if (!this.csharpContains(forStatement.statement, read)) {\n return false; // the read is in the loop header, not the body\n }\n const condition: any = forStatement.condition;\n if (condition?.kind !== SyntaxKind.BinaryExpression || condition.operatorToken?.kind !== SyntaxKind.LessThanToken) {\n return false;\n }\n const length: any = condition.right;\n if (length?.kind !== SyntaxKind.PropertyAccessExpression || length.name?.text !== 'length') {\n return false;\n }\n if (this.csharpIdentifierSymbol(condition.left) !== indexSymbol) {\n return false;\n }\n if (this.csharpIdentifierSymbol(this.csharpLengthReceiverIdentifier(length.expression)) !== receiverSymbol) {\n return false;\n }\n return !this.csharpIndexBoundIsVoided(forStatement.statement, receiverSymbol, indexSymbol);\n }\n\n // The identifier a `.length` receiver reads through wrappers whose C# print is the bare text:\n // parentheses, and `as T` where printAsExpression does not cast (`any`/`string`/`T[]` print a cast,\n // so the bound would not be the receiver's Count). `(response as List).length` -> `?.Count ?? 0`\n csharpLengthReceiverIdentifier(node): any {\n let current: any = node;\n while (current !== undefined) {\n if (current.kind === SyntaxKind.ParenthesizedExpression) {\n current = current.expression;\n continue;\n }\n if (current.kind === SyntaxKind.AsExpression && current.type !== undefined\n && current.type.kind !== SyntaxKind.AnyKeyword\n && current.type.kind !== SyntaxKind.StringKeyword\n && current.type.kind !== SyntaxKind.ArrayType) {\n current = current.expression;\n continue;\n }\n break;\n }\n return current;\n }\n\n // the condition ran before the body did: a write to the index, or any use of the receiver\n // other than an element access / a property read (a method call, an argument, a bare read —\n // anything that could hand the list to something that shrinks it) voids the bound\n csharpIndexBoundIsVoided(body, receiverSymbol, indexSymbol): boolean {\n let voided = false;\n const visit = (n: any) => {\n if (voided || n === undefined) {\n return;\n }\n if (n.kind === SyntaxKind.Identifier) {\n const symbol = this.csharpIdentifierSymbol(n);\n if (symbol === indexSymbol && this.csharpIdentifierIsWritten(n)) {\n voided = true;\n return;\n }\n if (symbol === receiverSymbol && !this.csharpReceiverUseKeepsBound(n)) {\n voided = true;\n return;\n }\n }\n n.forEachChild(visit);\n };\n body.forEachChild(visit);\n return voided;\n }\n\n // a use that cannot move the value the condition tested: the expression of an element\n // access (`recv[i]`, a read or an element write — neither changes the length) or of a\n // property READ (`recv.Count`); a property write or a call on the receiver is not one\n csharpReceiverUseKeepsBound(node): boolean {\n const parent: any = node.parent;\n if (parent === undefined) {\n return false;\n }\n if (parent.kind === SyntaxKind.ElementAccessExpression && parent.expression === node) {\n return true;\n }\n if (parent.kind === SyntaxKind.PropertyAccessExpression && parent.expression === node) {\n if (this.csharpIdentifierIsWritten(node)) {\n return false; // `recv.length = n`\n }\n const grand: any = parent.parent;\n return !(grand?.kind === SyntaxKind.CallExpression && grand.expression === parent);\n }\n return false;\n }\n\n // the identifier is a write target: `x = v`, `x += v`, `x++` / `x--`, a destructuring\n // element, or a property/element write through it (`x.length = 0`)\n csharpIdentifierIsWritten(node): boolean {\n const parent: any = node.parent;\n if (parent === undefined) {\n return false;\n }\n if (parent.kind === SyntaxKind.BinaryExpression && parent.left === node && this.csharpIsAssignmentOperator(parent.operatorToken.kind)) {\n return true;\n }\n if ((parent.kind === SyntaxKind.PrefixUnaryExpression || parent.kind === SyntaxKind.PostfixUnaryExpression)\n && (parent.operator === SyntaxKind.PlusPlusToken || parent.operator === SyntaxKind.MinusMinusToken)) {\n return true;\n }\n if (parent.kind === SyntaxKind.ArrayLiteralExpression || parent.kind === SyntaxKind.PropertyAccessExpression) {\n const grand: any = parent.parent;\n return grand?.kind === SyntaxKind.BinaryExpression && grand.left === parent && this.csharpIsAssignmentOperator(grand.operatorToken.kind);\n }\n return false;\n }\n\n // the node is the left side of `=` or `+=`\n csharpIsSetOrAddTarget(node): boolean {\n const parent: any = node.parent;\n return parent?.kind === SyntaxKind.BinaryExpression\n && (parent.operatorToken.kind === SyntaxKind.EqualsToken || parent.operatorToken.kind === SyntaxKind.PlusEqualsToken)\n && parent.left === node;\n }\n\n csharpIsAssignmentOperator(kind): boolean {\n return (kind >= SyntaxKind.FirstAssignment) && (kind <= SyntaxKind.LastAssignment);\n }\n\n // S22: an index WRITE (`x[\"k\"] = v`) needs no `((IDictionary)x)` cast when the\n // receiver's printed C# declaration already IS a dictionary. The ccxt classifier\n // (build/csharp-local-types.js) installs this predicate; undefined/false keeps the upstream cast.\n csharpDictionaryIndexWriteNeedsNoCast(node): boolean | undefined {\n return undefined;\n }\n // the consumer's classifier may prove the declared C# type of an element-access receiver\n // (`Dictionary` / `IDictionary`); consumer-installed, so an\n // answer of undefined keeps the untyped emission byte-identical\n csharpElementAccessTypedReceiver(node): string | undefined {\n return undefined;\n }\n\n // `recv[key]` read with a consumer-proven string-keyed dict receiver and a literal key: the typed\n // twin GetValue(IDictionary, string) runs the same dictionary read as the object\n // overload's dict branch without its runtime sniffing. Every other read keeps the wrapper.\n printTypedDictElementAccessIfAny(node) {\n if (this.csharpElementAccessTypedReceiver(node) === undefined) {\n return undefined;\n }\n const { expression, argumentExpression } = node;\n if (!isStringLiteralLikeNode(argumentExpression)) {\n return undefined; // the twin's key parameter is `string`; any other key keeps the object overload\n }\n if (this.csharpIsSetOrAddTarget(node)) {\n return undefined; // a write prints the dictionary element assignment, not this read\n }\n return 'GetValue(' + this.printNode(expression, 0) + ', ' + this.printNode(argumentExpression, 0) + ')';\n }\n\n printWrappedUnknownThisProperty(node) {\n const type = this.getChecker().getResolvedSignature(node);\n if (type?.declaration === undefined) {\n let parsedArguments = node.arguments?.map((a) => this.printNode(a, 0)).join(\", \");\n parsedArguments = parsedArguments ? parsedArguments : \"\";\n const propName = node.expression?.name.text;\n const nativeDelegateCall = this.csharpNativeDelegateCall(node, propName);\n if (nativeDelegateCall !== undefined) {\n return nativeDelegateCall;\n }\n // const isAsyncDecl = true;\n const isAsyncDecl = node?.parent?.kind === SyntaxKind.AwaitExpression;\n // const open = isAsyncDecl ? this.UKNOWN_PROP_ASYNC_WRAPPER_OPEN : this.UKNOWN_PROP_WRAPPER_OPEN;\n // const close = this.UNKOWN_PROP_WRAPPER_CLOSE;\n // return `${open}\"${propName}\"${parsedArguments}${close}`;\n const argsArray = `new object[] { ${parsedArguments} }`;\n const open = this.DYNAMIC_CALL_OPEN;\n let statement = `${open}this, \"${propName}\", ${argsArray})`;\n statement = isAsyncDecl ? `((Task)${statement})` : statement;\n return statement;\n }\n return undefined;\n }\n\n // A `this.(...)` call the checker cannot resolve on a function-valued property is a\n // delegate in the hand-written C# base, which `ResolveMethod` never finds (the helper throws\n // there); matching arity prints the same property invocation directly.\n csharpNativeDelegateCall(node, propName): string | undefined {\n const arity = CSHARP_NATIVE_THIS_DELEGATE_ARITY[propName as string];\n if (arity === undefined) {\n return undefined;\n }\n if (node?.parent?.kind === SyntaxKind.AwaitExpression) {\n return undefined; // the delegate returns object, not a Task\n }\n const args = node.arguments ?? [];\n if (args.length !== arity) {\n return undefined;\n }\n return `this.${propName as string}(${args.map((a) => this.printNode(a, 0)).join(\", \")})`;\n }\n\n printOutOfOrderCallExpressionIfAny(node, identation) {\n if (node.expression.kind === SyntaxKind.PropertyAccessExpression) {\n const expressionText = node.expression.getText().trim();\n const args = node.arguments;\n if (args.length === 1) {\n const parsedArg = this.printNode(args[0], 0);\n switch (expressionText) {\n // case \"JSON.parse\":\n // return `json_decode(${parsedArg}, $as_associative_array = true)`;\n case \"Math.abs\":\n return `Math.Abs(Convert.ToDouble(${parsedArg}))`;\n }\n } else if (args.length === 2)\n {\n const parsedArg1 = this.printNode(args[0], 0);\n const parsedArg2 = this.printNode(args[1], 0);\n switch (expressionText) {\n case \"Math.min\":\n return this.csharpNativeMathMinMax(node, 'Min', parsedArg1, parsedArg2) ?? `mathMin(${parsedArg1}, ${parsedArg2})`;\n case \"Math.max\":\n return this.csharpNativeMathMinMax(node, 'Max', parsedArg1, parsedArg2) ?? `mathMax(${parsedArg1}, ${parsedArg2})`;\n case \"Math.pow\":\n return `Math.Pow(Convert.ToDouble(${parsedArg1}), Convert.ToDouble(${parsedArg2}))`;\n }\n }\n const leftSide = node.expression?.expression;\n const leftSideText = leftSide ? this.printNode(leftSide, 0) : undefined;\n\n // wrap unknown property this.X calls\n if (leftSideText === this.THIS_TOKEN || leftSide.getFullText().indexOf(\"(this as any)\") > -1) { // double check this\n const res = this.printWrappedUnknownThisProperty(node);\n if (res) {\n return res;\n }\n }\n }\n\n // // replace this[method]() calls\n // const thisElementAccess = this.printThisElementAccesssIfNeeded(node, identation);\n // if (thisElementAccess) {\n // return thisElementAccess;\n // }\n\n // handle dynamic calls, this[method](A) or exchange[b] (c) using reflection\n if (node.expression.kind === SyntaxKind.ElementAccessExpression) {\n return this.printDynamicCall(node, identation);\n }\n\n\n return undefined;\n }\n\n handleTypeOfInsideBinaryExpression(node, identation) {\n const left = node.left;\n const right = node.right.text;\n const op = node.operatorToken.kind;\n const expression = left.expression;\n\n const isDifferentOperator = op === SyntaxKind.ExclamationEqualsEqualsToken || op === SyntaxKind.ExclamationEqualsToken;\n const notOperator = isDifferentOperator ? this.NOT_TOKEN : \"\";\n\n const target = this.printNode(expression, 0);\n switch (right) {\n case \"string\":\n return notOperator + `(${target} is string)`;\n case \"number\":\n return notOperator + `(${target} is Int64 || ${target} is int || ${target} is float || ${target} is double)`;\n case \"boolean\":\n return notOperator + `(${target} is bool)`;\n case \"object\":\n return notOperator + `(${target} is IDictionary)`;\n case \"function\":\n return notOperator + `(${target} is Delegate)`;\n }\n\n return undefined;\n\n }\n\n // The C# type of an operand of `==` / `!=` as the printer emits it, or undefined when\n // the printer only knows `object`: an `object` operand takes the reference-comparing\n // `operator ==`, so those keep the isEqual helper.\n csharpEqualityOperandType(node): string | undefined {\n if (node === undefined) {\n return undefined;\n }\n switch (node.kind) {\n case SyntaxKind.NullKeyword:\n return 'null';\n case SyntaxKind.TrueKeyword:\n case SyntaxKind.FalseKeyword:\n return 'bool';\n case SyntaxKind.NumericLiteral:\n return this.csharpNumericLiteralKind(node);\n case SyntaxKind.ParenthesizedExpression:\n return this.csharpEqualityOperandType(node.expression);\n case SyntaxKind.Identifier:\n // printIdentifier prints the `undefined` identifier as null\n if (node.text === 'undefined') {\n return 'null';\n }\n return this.csharpDeclaredTypeOfBinding(node) ?? this.csharpParameterOperandType(node);\n case SyntaxKind.PropertyAccessExpression: {\n const fieldType = this.csharpReferenceFieldType(node);\n return (fieldType === undefined) ? this.csharpTypeOfInitializer(node) : fieldType;\n }\n }\n if (isStringLiteralLikeNode(node)) {\n return 'string';\n }\n return this.csharpTypeOfInitializer(node);\n }\n\n // 'object' for a `this.` read of a hand-written field the table proves a reference box;\n // undefined otherwise. Only printInlineEquality's null branch accepts 'object', so the exact\n // field type is never claimed and the value-equality branches keep the helper.\n csharpReferenceFieldType(node): string | undefined {\n if (!isPropertyAccessExpression(node) || (node.expression?.kind !== SyntaxKind.ThisKeyword)) {\n return undefined;\n }\n const name = node.name?.text as string;\n if (CSHARP_REFERENCE_FIELDS_NATIVE.indexOf(name) < 0) {\n return undefined;\n }\n return this.csharpOperandIsValueTyped(node) ? undefined : 'object';\n }\n\n // the declaration behind an identifier read that is a plain method parameter; a\n // destructured or rest parameter prints a different declaration shape\n csharpParameterDeclaration(node): ParameterDeclaration | undefined {\n const declaration: any = (this.checkerOrUndefined() as any)?.getSymbolAtLocation(node)?.valueDeclaration?.resolve();\n if ((declaration === undefined) || !isParameterDeclaration(declaration)) {\n return undefined;\n }\n if (!isIdentifier(declaration.name) || (declaration.name.text !== node.text) || (declaration.dotDotDotToken !== undefined)) {\n return undefined;\n }\n return declaration;\n }\n\n // `object` for a parameter operand a null comparison compiles on, else undefined. An optional\n // parameter prints `object` / `string` / `Int64?` / `double?` / `bool?`; any other keeps the\n // helper unless its checker type holds no number/boolean member (a reference box).\n csharpParameterOperandType(node): string | undefined {\n const declaration = this.csharpParameterDeclaration(node);\n if (declaration === undefined) {\n return undefined;\n }\n if (this.csharpDeclarationPrintsNullComparable(declaration)) {\n return 'object'; // reference box or nullable value: only the null branch may use it\n }\n return this.csharpOperandIsValueTyped(node) ? undefined : 'object';\n }\n\n // Whether this parameter's printed C# type is a reference or nullable value, so `x == null`\n // compiles and is isEqual's null branch. optionalScalarCsharpType gives a nullable scalar only\n // when optional with no initializer or `= undefined`; required or real-default ones are non-null.\n csharpDeclarationPrintsNullComparable(declaration): boolean {\n const initializer = declaration.initializer;\n const optional = (declaration.questionToken !== undefined) || (initializer !== undefined);\n if (optional && ((initializer === undefined) || ((initializer.kind === SyntaxKind.Identifier) && (initializer.text === 'undefined')))) {\n return true;\n }\n return !this.csharpDeclarationHasValueScalar(declaration);\n }\n\n csharpDeclarationHasValueScalar(declaration): boolean {\n const checker: any = this.checkerOrUndefined();\n if (checker === undefined) {\n return true; // unknown: keep the helper\n }\n return this.csharpTypeHasValueScalar(checker.getTypeAtLocation(declaration));\n }\n\n // A numeric literal prints as an untyped C# constant that adapts to the operand on the\n // other side. isEqual's integer branches round-trip through Convert.ToInt64, which an\n // integer literal beyond 2^53 does not survive, so those stay on the helper.\n csharpNumericLiteralKind(node): string | undefined {\n const value = Number(node.text);\n if (!Number.isFinite(value) || (Number.isInteger(value) && !Number.isSafeInteger(value))) {\n return undefined;\n }\n return 'number';\n }\n\n // the C# type the declaration behind an identifier was printed with ('object' when the\n // printer named none), or undefined when the identifier is not a printed local\n csharpDeclaredTypeOfBinding(node): string | undefined {\n const declaration: any = (this.checkerOrUndefined() as any)?.getSymbolAtLocation(node)?.valueDeclaration?.resolve();\n if (declaration?.kind === SyntaxKind.VariableDeclaration) {\n return this.getCSharpLocalType(declaration);\n }\n if (declaration?.kind === SyntaxKind.BindingElement) {\n return 'var'; // `const [a, b] = ...` prints `var a = ((IList)...)[0]`\n }\n return undefined; // parameters are retyped after printing by the build script\n }\n\n // the C# operator family an operand belongs to: `==` compares two operands of one family\n // by value, exactly like the isEqual branches those types take\n csharpValueEqualityKind(csharpType): string | undefined {\n switch (csharpType) {\n case 'string':\n case 'string?':\n return 'string';\n case 'bool':\n case 'bool?':\n return 'bool';\n case 'double':\n case 'double?':\n return 'double';\n case 'Int64':\n case 'long':\n case 'Int64?':\n case 'long?':\n return 'Int64';\n case 'int':\n case 'int?':\n return 'int';\n case 'number':\n return 'number'; // numeric literal, adapts to the numeric operand it is compared with\n }\n return undefined;\n }\n\n // `x == null` compiles — and matches isEqual — for reference types and nullable value\n // types, but not for a non-nullable value type (double / bool / Int64 / int). Lists,\n // dictionaries, class instances and `var` are references, and are the only types left\n // once csharpValueEqualityKind has claimed the value-typed names above.\n csharpIsNullComparableType(csharpType): boolean {\n if ((csharpType === undefined) || (csharpType === '') || (csharpType === 'null')) {\n return false;\n }\n if (csharpType.endsWith('?')) {\n return true;\n }\n if ((csharpType === 'object') || (csharpType === 'string')) {\n return true;\n }\n return (this.csharpValueEqualityKind(csharpType) === undefined);\n }\n\n // `x == null` compiles and matches isEqual's null branch when x's printed type is a\n // reference box or a nullable value type: the operand table's declared types, an optional\n // parameter, or a box the checker proves holds no number/boolean scalar.\n csharpOperandIsNullComparable(node): boolean {\n const declaration = this.csharpParameterDeclaration(node);\n if ((declaration !== undefined) && this.csharpDeclarationPrintsNullComparable(declaration)) {\n return true;\n }\n return !this.csharpOperandIsValueTyped(node);\n }\n\n // U55: the null-comparison rule's gate, stricter than csharpIsNullComparableType above:\n // only a type the hook names (the emitted declaration's own text) is accepted, `object` /\n // `var` included in the refusal because those are the boxes the classifier did not name.\n csharpNullComparisonTypeIsProvable(csharpType): boolean {\n if ((csharpType === undefined) || (csharpType === '') || (csharpType === 'object') || (csharpType === 'var') || (csharpType === 'null')) {\n return false;\n }\n if (csharpType.endsWith('?')) {\n return true;\n }\n return CSHARP_NULL_COMPARISON_REFERENCE_HEADS.some((head) => csharpType.startsWith(head));\n }\n\n // TypeScript numbers and booleans are C# value types in this port (double / bool /\n // Int64 / int), and the ccxt build script retypes some `object` declarations to exactly\n // those from its own tables (precisionFromString -> int, milliseconds -> Int64,\n // isEmpty -> bool). A null comparison against one of them would not compile, and the\n // printer's `object` cannot rule it out, so these always keep the helper.\n csharpOperandIsValueTyped(node): boolean {\n if (node === undefined) {\n return true;\n }\n const checker: any = this.checkerOrUndefined();\n if (checker === undefined) {\n return true;\n }\n const type = checker.getTypeAtLocation(node);\n return this.csharpTypeHasValueScalar(type);\n }\n\n csharpTypeHasValueScalar(type): boolean {\n if (type === undefined) {\n return true;\n }\n const flags = type.flags;\n if (flags & TypeFlags.Union) {\n const members = type.getTypes?.() ?? [];\n return members.some((member) => this.csharpTypeHasValueScalar(member));\n }\n return (flags & (TypeFlags.Number | TypeFlags.NumberLiteral | TypeFlags.Boolean | TypeFlags.BooleanLiteral)) !== 0;\n }\n\n // `x == \"lit\"` / `x != \"lit\"` prints natively when x is a read of a local whose printed\n // declaration is a C# string: the printer's declared-local table, then the embedding build\n // layer's proof for the declarations it retypes itself (ccxt's csharp-local-types.js).\n csharpDeclaredStringLiteralComparison(left, right, leftText: string, rightText: string, isEquality: boolean): string | undefined {\n const ident = isIdentifier(left) ? left : (isIdentifier(right) ? right : undefined);\n if ((ident === undefined) || !isStringLiteralLikeNode((ident === left) ? right : left)) {\n return undefined;\n }\n const declared = this.csharpDeclaredReadType(ident);\n if ((declared === undefined) || !this.csharpTypeIsStringType(declared)) {\n return undefined;\n }\n return isEquality ? `(${leftText} == ${rightText})` : `(${leftText} != ${rightText})`;\n }\n\n // the C# type the declaration behind a local read was printed with, or undefined: the\n // printer's own declared-local table first, then the embedding build layer's answer for a\n // declaration it retyped after the printer had left it `object`\n csharpDeclaredReadType(node): string | undefined {\n let named;\n try {\n named = this.csharpTypedLocalType(node);\n } catch (e) {\n named = undefined;\n }\n return (named !== undefined) ? named : this.csharpResolvedReadType(node);\n }\n\n // the embedding build layer's string answer for a read, or undefined (no resolver, it threw)\n csharpResolvedReadType(node): string | undefined {\n const resolver = this.csharpExpressionTypeResolver;\n if (typeof resolver !== 'function') {\n return undefined;\n }\n let resolved;\n try {\n resolved = resolver(node);\n } catch (e) {\n return undefined;\n }\n return (typeof resolved === 'string') ? resolved : undefined;\n }\n\n // the declared type of an identifier read, including this printer's own local table\n csharpDeclaredLocalType(node): string | undefined {\n const provided = this.csharpExpressionTypeResolver ? this.csharpExpressionTypeResolver(node) : undefined;\n if (provided !== undefined) {\n return provided;\n }\n const declaration = this.getChecker().getSymbolAtLocation(node)?.valueDeclaration?.resolve();\n if (declaration === undefined || !isVariableDeclaration(declaration) || declaration.name?.kind !== SyntaxKind.Identifier) {\n return undefined;\n }\n if (!this.csharpLocalTypes.has(declaration)) {\n this.csharpLocalTypes.set(declaration, this.getCSharpLocalType(declaration));\n }\n const type = this.csharpLocalTypes.get(declaration);\n return (type === undefined || type === this.VAR_TOKEN) ? undefined : type;\n }\n\n // `a === b` / `a !== b` between two plain reads: a local or parameter prints as a bare\n // name and both operands are read once by the printed expression\n csharpOperandsAreDeclaredReads(left, right): boolean {\n const isRead = (node) => (node?.kind === SyntaxKind.Identifier) && (node.text !== 'undefined');\n return isRead(left) && isRead(right);\n }\n\n // the C# type the embedding build layer declares for a read the printer can only call\n // `object`: that layer retypes the declaration so its recorded type IS the printed one\n csharpDeclaredReadEqualityType(node, printerType: string | undefined): string | undefined {\n if ((printerType !== undefined) && (printerType !== this.VAR_TOKEN) && (printerType !== 'var')) {\n return printerType;\n }\n return this.csharpResolvedReadType(node) ?? printerType;\n }\n\n // `==` / `!=` in place of the isEqual wrapper when both operands are C# values of one\n // family, or one side is null/undefined against a type `== null` compiles for. Both\n // operands are printed once, so neither is evaluated twice.\n printInlineEquality(left, right, leftText: string, rightText: string, isEquality: boolean): string | undefined {\n const stringComparison = this.csharpDeclaredStringLiteralComparison(left, right, leftText, rightText, isEquality);\n if (stringComparison !== undefined) {\n return stringComparison;\n }\n let leftType = this.csharpEqualityOperandType(left);\n let rightType = this.csharpEqualityOperandType(right);\n if (this.csharpOperandsAreDeclaredReads(left, right)) {\n leftType = this.csharpDeclaredReadEqualityType(left, leftType);\n rightType = this.csharpDeclaredReadEqualityType(right, rightType);\n }\n // D-21: an operand the printer could not name (or only named `object`) is not a\n // rejection by itself -- the value branch below re-reads its DECLARED scalar type\n if ((leftType === 'null') || (rightType === 'null')) {\n const [other, otherType, otherText] = (leftType === 'null') ? [right, rightType, rightText] : [left, leftType, leftText];\n if (!this.csharpIsNullComparableType(otherType) || !this.csharpOperandIsNullComparable(other)) {\n return undefined;\n }\n return this.csharpNullComparison(otherText, isEquality);\n }\n // D-21: a read the printer's own tables could only call `object` still has the C# type\n // its emitted DECLARATION carries -- a parameter the build layer's typing pass narrowed,\n // a local retyped to the type of a typed return. The declared-read arm below names it.\n const leftKind = this.csharpValueEqualityKind(leftType);\n const rightKind = this.csharpValueEqualityKind(rightType);\n const leftReadKind = (leftKind !== undefined) ? leftKind : this.csharpDeclaredReadEqualityKind(left, leftType);\n const rightReadKind = (rightKind !== undefined) ? rightKind : this.csharpDeclaredReadEqualityKind(right, rightType);\n if ((leftReadKind === undefined) || (rightReadKind === undefined)) {\n return undefined;\n }\n // mixed numeric kinds are not equal in isEqual: `int` vs `double` takes the\n // `(int)a == (int)b` branch and throws on the boxed double, so only a numeric\n // literal may meet a different numeric type\n const numericKinds = [ 'double', 'Int64', 'int' ];\n const sameKind = (leftReadKind === rightReadKind);\n const literalVsNumeric = ((leftReadKind === 'number') && (numericKinds.indexOf(rightReadKind) >= 0))\n || ((rightReadKind === 'number') && (numericKinds.indexOf(leftReadKind) >= 0));\n if (!sameKind && !literalVsNumeric) {\n return undefined;\n }\n return isEquality ? `(${leftText} == ${rightText})` : `(${leftText} != ${rightText})`;\n }\n\n // the value kind of an operand the printer could only call `object`: the type the read's\n // declaration was PRINTED with (printer table -> build layer's read-type oracle -> the\n // declared-type registry for the declarations its own passes retyped). A collection/class\n csharpDeclaredReadEqualityKind(node, operandType: string | undefined): string | undefined {\n if ((operandType !== undefined) && (operandType !== '') && (operandType !== 'object')) {\n return undefined; // the printer named a non-value C# type: never a value comparison\n }\n if ((node?.kind !== SyntaxKind.Identifier) || (node.text === 'undefined')) {\n return undefined; // parameters of a written body / accesses / calls are other units\n }\n const declared = this.csharpDeclaredReadType(node) ?? this.csharpDeclaredLocalResolverType(node);\n return (declared === undefined) ? undefined : this.csharpValueEqualityKind(declared);\n }\n\n csharpNullComparison(text: string, isEquality: boolean) {\n return isEquality ? `(${text} == null)` : `(${text} != null)`;\n }\n\n // `isEqual(, N)` / `isEqual(N, )` -> `==` / `!=`: the call prints a\n // concrete numeric kind, the literal adapts to it, and the operator matches isEqual's integer and\n // double branches. String/bool/collection calls and every `object` box keep the helper.\n csharpNativeNumericCallEquality(left, right, leftText: string, rightText: string, isEquality: boolean): string | undefined {\n const leftKind = this.csharpNumericCallKind(left);\n const rightKind = this.csharpNumericCallKind(right);\n const leftLiteral = (leftKind === undefined) ? this.csharpIntegerLiteralKind(left) : undefined;\n const rightLiteral = (rightKind === undefined) ? this.csharpIntegerLiteralKind(right) : undefined;\n const callOnLeft = (leftKind !== undefined) && (rightLiteral !== undefined) && this.csharpNumericKindHoldsLiteral(leftKind, rightLiteral);\n const callOnRight = (rightKind !== undefined) && (leftLiteral !== undefined) && this.csharpNumericKindHoldsLiteral(rightKind, leftLiteral);\n if (!callOnLeft && !callOnRight) {\n return undefined;\n }\n // both operands are printed once: the call is not duplicated\n return isEquality ? `(${leftText} == ${rightText})` : `(${leftText} != ${rightText})`;\n }\n\n // The C# value kind of a call operand (or `x.length`) when its printed signature is numeric:\n // `.indexOf`/`.length` (int) and safe* accessors from the printer's tables, `this.()` from\n // CSHARP_NATIVE_NUMERIC_THIS_KINDS. undefined keeps the helper (an `object` box has no kind).\n csharpNumericCallKind(node): string | undefined {\n const expression = node?.expression;\n if ((node?.kind === SyntaxKind.CallExpression)\n && (expression?.kind === SyntaxKind.PropertyAccessExpression)\n && (expression.expression?.kind === SyntaxKind.ThisKeyword)) {\n const named = CSHARP_NATIVE_NUMERIC_THIS_KINDS[expression.name?.text as string];\n // an unresolvable callee prints callDynamically(this, ...), which returns object\n if ((named !== undefined) && this.csharpCalleeResolves(node)) {\n return named;\n }\n }\n const named = this.csharpCallReturnType(node);\n return ((named === undefined) || (CSHARP_NUMERIC_VALUE_KINDS.indexOf(named) < 0)) ? undefined : named;\n }\n\n // The C# kind of an integer literal operand (`N` / `-N`), or undefined when the text is not an\n // integer the literal holds exactly. isEqual round-trips through Convert.ToInt64 and truncates\n // via `(int)a == (int)b`, so only a safe integer literal keeps both comparisons identical.\n csharpIntegerLiteralKind(node): string | undefined {\n let value;\n if (node?.kind === SyntaxKind.PrefixUnaryExpression) {\n if ((node.operator !== SyntaxKind.MinusToken) || (node.operand?.kind !== SyntaxKind.NumericLiteral)) {\n return undefined;\n }\n value = -Number(node.operand.text);\n } else if (node?.kind === SyntaxKind.NumericLiteral) {\n value = Number(node.text);\n } else {\n return undefined;\n }\n if (!Number.isSafeInteger(value)) {\n return undefined;\n }\n return ((value >= -2147483648) && (value <= 2147483647)) ? 'int' : 'long';\n }\n\n // a `long` literal has no implicit conversion to an `int` operand; every other pair\n // converts the literal exactly, which is what isEqual's Convert.ToInt64 /\n // Convert.ToDouble branches do with the same two boxes\n csharpNumericKindHoldsLiteral(callKind: string, literalKind: string): boolean {\n if (callKind === 'int') {\n return literalKind === 'int';\n }\n return (callKind.indexOf('Int64') === 0) || (callKind.indexOf('double') === 0);\n }\n\n // the concrete C# type of an expression the printer can name, or undefined: the embedding\n // build layer's proof wins (it retypes locals the printer leaves `object`), then the\n // printer's own tables and the literals whose C# type is fixed by their text\n csharpExpressionTypeOf(node): string | undefined {\n const provided = this.csharpExpressionTypeResolver ? this.csharpExpressionTypeResolver(node) : undefined;\n if (provided !== undefined) {\n return provided;\n }\n if (isNumericLiteral(node)) {\n const value = Number(node.text);\n // wider literals are typed uint/long/ulong by the C# compiler, keep the helper\n return (Number.isInteger(value) && Math.abs(value) <= 2147483647) ? 'int' : undefined;\n }\n if (isPrefixUnaryExpression(node) && (node.operator === SyntaxKind.MinusToken) && isNumericLiteral(node.operand)) {\n const value = Number(node.operand.text);\n return (Number.isInteger(value) && (value <= 2147483647)) ? 'int' : undefined;\n }\n return this.csharpTypeOfInitializer(node);\n }\n\n csharpOperandIsPlainNumber(operand): boolean {\n const checker: any = this.checkerOrUndefined();\n if (checker === undefined) {\n return false; // in-memory program without a checker\n }\n const flags = checker.getTypeAtLocation(operand)?.flags;\n return (flags === TypeFlags.Number) || (flags === TypeFlags.NumberLiteral);\n }\n\n // `<`, `>`, `<=`, `>=` on two operands whose printed C# kind this printer can name (declaration,\n // literal, known call signature — never the JS type) print natively: the helper applies the same\n // conversions as the C# operator; an int/Int64 pair compares the same. See CSHARP_NUMERIC_KINDS.\n csharpNativeNumericComparison(node, identation): string | undefined {\n const token = CSHARP_NATIVE_COMPARISON_TOKENS[node.operatorToken.kind];\n if (token === undefined) {\n return undefined;\n }\n const leftKind = this.csharpExpressionTypeOf(node.left);\n const rightKind = this.csharpExpressionTypeOf(node.right);\n if ((leftKind === undefined) || (rightKind === undefined)) {\n return undefined;\n }\n const integerPair = (CSHARP_INTEGER_KINDS.indexOf(leftKind) >= 0) && (CSHARP_INTEGER_KINDS.indexOf(rightKind) >= 0);\n if (!integerPair && ((leftKind !== rightKind) || (CSHARP_NUMERIC_KINDS.indexOf(leftKind) < 0))) {\n return undefined;\n }\n if ((leftKind === 'double') && ((token === '<') || (token === '<='))) {\n return undefined;\n }\n const leftText = this.printNode(node.left, 0).trim();\n const rightText = this.printNode(node.right, 0).trim();\n return leftText + ' ' + token + ' ' + rightText;\n }\n\n // `Math.min/max (a, b)`: mathMin/mathMax read both boxes via Convert.ToDouble, return an ORIGINAL\n // one (null if either is null); Math.Min/Max returns one numeric kind. Native only when both are\n // declared integers of the same kind and the checker sees two plain numbers; else keep the helper.\n csharpNativeMathMinMax(node, name: string, parsedArg1: string, parsedArg2: string): string | undefined {\n const args = node.arguments;\n if ((args?.length !== 2) || !this.csharpMinMaxResultIsPlainValue(node)) {\n return undefined;\n }\n const leftKind = this.csharpExpressionTypeOf(args[0]);\n if ((leftKind === undefined) || (leftKind !== this.csharpExpressionTypeOf(args[1])) || (CSHARP_MINMAX_NATIVE_KINDS.indexOf(leftKind) < 0)) {\n return undefined;\n }\n if (!this.csharpOperandIsPlainNumber(args[0]) || !this.csharpOperandIsPlainNumber(args[1])) {\n return undefined;\n }\n return 'Math.' + name + '(' + parsedArg1 + ', ' + parsedArg2 + ')';\n }\n\n // the positions that take the primitive as the helper's box: assignment, argument,\n // dictionary/list value, return and ternary arm all box an int the same way. A receiver, an\n // `as`/`!` wrapper and the printer's hard `(string)` casts (throw / `delete`) do not.\n csharpMinMaxResultIsPlainValue(node): boolean {\n if (this.csharpIsClassThrowArgument(node) || this.csharpIsDeleteKey(node)) {\n return false;\n }\n let parent = node.parent;\n while (parent !== undefined && isParenthesizedExpression(parent)) {\n parent = parent.parent;\n }\n if (parent === undefined) {\n return false;\n }\n if ((isPropertyAccessExpression(parent) || isElementAccessExpression(parent) || isCallExpression(parent)) && parent.expression === node) {\n return false;\n }\n return (parent.kind !== SyntaxKind.AsExpression) && (parent.kind !== SyntaxKind.TypeAssertionExpression) && (parent.kind !== SyntaxKind.NonNullExpression);\n }\n\n // `parseInt(...)` / `parseFloat(...)` print the runtime helper call; the folds below replace\n // it with the exact box the helper returns, everything else falls through to the printer\n printCallExpression(node, identation) {\n const nativeParse = this.csharpNativeParseCall(node);\n if (nativeParse !== undefined) {\n return nativeParse;\n }\n return super.printCallExpression(node, identation);\n }\n\n csharpNativeParseCall(node) {\n if (node?.kind !== SyntaxKind.CallExpression || !isIdentifier(node.expression)) {\n return undefined;\n }\n const callee = node.expression.text as string;\n if ((callee !== 'parseInt') && (callee !== 'parseFloat')) {\n return undefined;\n }\n const args = node.arguments;\n if (args === undefined || args.length !== 1) {\n return undefined;\n }\n if (!this.csharpCalleeIsGlobalFunction(node.expression)) {\n return undefined; // a locally declared function of the same name is not the helper\n }\n const literal = (callee === 'parseInt') ? csharpParseIntLiteralArgument(args[0]) : csharpParseFloatLiteralArgument(args[0]);\n if (literal !== undefined) {\n return literal;\n }\n return this.csharpNativeParseCallOnDeclaredLocal(callee, args[0]);\n }\n\n // the global `parseInt` / `parseFloat` live in the TS lib chain; a declaration anywhere else\n // means the call prints a different function than the runtime helper\n csharpCalleeIsGlobalFunction(node): boolean {\n const checker: any = this.checkerOrUndefined();\n if (checker === undefined) {\n return true; // in-memory program without a checker: the name is all there is\n }\n const declarations = (checker.getSymbolAtLocation(node)?.declarations ?? []).map((d) => d.resolve());\n return declarations.every((declaration) => declaration.getSourceFile().fileName.indexOf('typescript') > -1);\n }\n\n // `parseFloat(x)` / `parseInt(x)` on a local declared numeric: Convert.ToDouble is an identity for\n // `double` and a widening for integer kinds. An Int64 parseInt operand (rounded above 2^53), a\n // double one (NaN/overflow -> null) and nullable or `object` locals (null -> 0) keep the helper.\n csharpNativeParseCallOnDeclaredLocal(callee, arg) {\n if (arg?.kind !== SyntaxKind.Identifier) {\n return undefined;\n }\n const kind = this.csharpExpressionTypeOf(arg);\n if (CSHARP_NUMERIC_KINDS.indexOf(kind) < 0) {\n return undefined;\n }\n const text = this.printNode(arg, 0);\n if (callee === 'parseFloat') {\n return (kind === 'double') ? text : `((double)${text})`;\n }\n return (kind === 'int') ? `((Int64)${text})` : undefined;\n }\n\n // `multiply(N, M)` over two unsigned numeric literals: two integers box the Int64 product\n // (`NL * ML`, the same value while it is a safe integer); otherwise the helper multiplies the\n // doubles and re-boxes an integral product as Int64, so only a fractional product goes native.\n csharpNativeLiteralProduct(left, right): string | undefined {\n if (!isNumericLiteral(left) || !isNumericLiteral(right)) {\n return undefined;\n }\n const leftText = left.text;\n const rightText = right.text;\n if (/^\\d+$/.test(leftText) && /^\\d+$/.test(rightText)) {\n const product = Number(leftText) * Number(rightText);\n return Number.isSafeInteger(product) ? `(${leftText}L * ${rightText}L)` : undefined;\n }\n const decimal = /^\\d+(\\.\\d+)?$/;\n // IsInteger reads the product through Convert.ToDecimal, i.e. rounded to 15 significant digits\n const rounded = Number((Number(leftText) * Number(rightText)).toPrecision(15));\n if (!decimal.test(leftText) || !decimal.test(rightText) || Number.isInteger(rounded)) {\n return undefined;\n }\n return `(${leftText} * ${rightText})`;\n }\n\n // `a % b` prints `mod(a, b)`: the helper takes the double remainder and converts back to Int64. An\n // Int32 dividend with a nonzero integer literal divisor is exact as double, so the native Int64\n // remainder matches. Int64 dividends (rounded above 2^53) and possibly-zero divisors keep helper.\n csharpNativeModExpression(left, right, leftText) {\n if (left?.kind !== SyntaxKind.Identifier) {\n return undefined;\n }\n if (this.csharpExpressionTypeOf(left) !== 'int') {\n return undefined;\n }\n const divisor = csharpLiteralNumericValue(right);\n if ((divisor === undefined) || !Number.isSafeInteger(divisor) || (divisor === 0)) {\n return undefined;\n }\n return `((Int64)${leftText} % ${divisor}L)`;\n }\n\n // `-x` prints `prefixUnaryNeg(ref x)`, whose typed overloads negate in place and return the same\n // box (`a = -a; return a;`): a local declared int / Int64 / double binds one, so the assignment is\n // the identical emission. Every other operand keeps the helper's runtime dispatch and null answer.\n csharpNativeNegatedLocal(operand, leftSide) {\n if (operand?.kind !== SyntaxKind.Identifier) {\n return undefined;\n }\n if (CSHARP_NUMERIC_KINDS.indexOf(this.csharpExpressionTypeOf(operand)) < 0) {\n return undefined;\n }\n return `(${leftSide} = -${leftSide})`;\n }\n\n // The printed receiver whose C# static type is a known collection: a local this printer declared\n // with a concrete type (csharpTypedLocals), or a hand-written BaseExchange field. undefined keeps\n // the runtime helper, since the printer cannot name the operand's type.\n csharpNativeReceiver(node): { text: string, type: string } | undefined {\n if (node?.kind === SyntaxKind.ParenthesizedExpression) {\n const inner = this.csharpNativeReceiver(node.expression);\n return inner === undefined ? undefined : { text: `(${inner.text})`, type: inner.type };\n }\n if (isIdentifier(node)) {\n const named = this.csharpTypedLocalType(node);\n return (named === undefined || CSHARP_NATIVE_COLLECTION_TYPES.indexOf(named) < 0) ? undefined : { text: this.printNode(node, 0), type: named };\n }\n if (isPropertyAccessExpression(node) && node.expression?.kind === SyntaxKind.ThisKeyword) {\n const name = node.name?.text as string;\n if (CSHARP_OBJECT_DICT_FIELDS.indexOf(name) >= 0) {\n // the field is declared `object`; its box is always a dictionary\n return { text: `((IDictionary)${this.printNode(node, 0)})`, type: 'IDictionary' };\n }\n return CSHARP_NATIVE_FIELDS[name] === undefined ? undefined : { text: this.printNode(node, 0), type: CSHARP_NATIVE_FIELDS[name] };\n }\n // a call whose printed C# type this printer already names (Object.keys, this.indexBy,\n // x.split, ...) is a collection too\n const callType = this.csharpCallReturnType(node);\n if (callType !== undefined && CSHARP_NATIVE_COLLECTION_TYPES.indexOf(callType) >= 0) {\n const printed = this.printNode(node, 0);\n return { text: printed.startsWith('new ') ? `(${printed})` : printed, type: callType };\n }\n return undefined;\n }\n\n // the C# types this printer can name on a local whose members replace the helpers:\n // the collection types (Count/ContainsKey) and string (Length/ContainsKey keys)\n csharpTypeIsNative(csharpType: string): boolean {\n return CSHARP_NATIVE_COLLECTION_TYPES.indexOf(csharpType) >= 0 || csharpType.indexOf('string') === 0;\n }\n\n // the C# type this printer declared for a local read, or undefined\n csharpTypedLocalType(node): string | undefined {\n const declaration = this.getChecker().getSymbolAtLocation(node)?.valueDeclaration?.resolve();\n return declaration === undefined ? undefined : this.csharpTypedLocals.get(declaration);\n }\n\n // the member that replaces getArrayLength on a declared C# type: Count counts the same\n // elements the helper's IList / ICollection branches count, Length is its string branch.\n // Any other declared type keeps the helper\n csharpCountMemberOf(csharpType: string): string | undefined {\n if ((csharpType === 'string') || (csharpType === 'string?')) {\n return 'Length';\n }\n return CSHARP_COUNT_TYPES.some((prefix) => csharpType.indexOf(prefix) === 0) ? 'Count' : undefined;\n }\n\n // `getArrayLength(x)` -> `(x?.Count ?? 0)` for a local whose printed declaration carries a C#\n // collection / string type (printer's declared-local table, then build/csharp-local-types.js).\n // The null-conditional is the helper's `null -> 0`; a plain member read would throw instead.\n csharpDeclaredLengthExpression(node): string | undefined {\n // a cast the printer itself printed around the receiver names the type outright, and\n // takes the whole expression as its operand (`(T)x?.Count` would cast the Count), so\n // the printed form is parenthesised before its own member read\n const printed = this.printNode(node, 0).trim();\n const cast = CSHARP_LENGTH_CAST.exec(printed);\n if (cast !== null) {\n const castMember = this.csharpCountMemberOf(cast[1]);\n if (castMember !== undefined) {\n return `(${isIdentifier(node) ? printed : `(${printed})`}?.${castMember} ?? 0)`;\n }\n }\n // `(x as List).length` / `((x)).length`: the printer prints the wrapper as the bare\n // local when it elides the assertion, so the read is still the identifier\n const receiver = this.csharpLengthReceiverIdentifier(node);\n if (receiver === undefined) {\n return undefined;\n }\n const named = this.csharpTypedLocalType(receiver);\n const csharpType = named !== undefined ? named\n : (this.csharpExpressionTypeResolver ? this.csharpExpressionTypeResolver(receiver) : undefined)\n ?? this.csharpLengthReceiverType(receiver);\n const member = csharpType === undefined ? undefined : this.csharpCountMemberOf(csharpType);\n if (member === undefined) {\n return undefined;\n }\n // a wrapper the printer does print (a `((string)x)` cast keeps its assertion) is a\n // different receiver: only the printed-as-identifier shape may take the member read\n const receiverText = this.printNode(receiver, 0);\n if (this.printNode(node, 0).trim() !== receiverText.trim()) {\n return undefined;\n }\n return `(${receiverText}?.${member} ?? 0)`;\n }\n\n // the printed key of ContainsKey must itself be a C# string: a literal, a local this\n // printer declared `string`, a call it types as string, or its own `((string)x)` cast\n csharpNativeStringKey(key): string | undefined {\n if (key?.kind === SyntaxKind.ParenthesizedExpression) {\n return this.csharpNativeStringKey(key.expression);\n }\n if (isStringLiteralLikeNode(key)) {\n return this.printNode(key, 0);\n }\n if (isIdentifier(key)) {\n const named = this.csharpTypedLocalType(key);\n // a non-nullable string local is the printed proof ContainsKey needs (`string?`\n // still needs the checker's string, or a null key would throw where inOp says false)\n if (named === 'string') {\n return this.printNode(key, 0);\n }\n if ((named === undefined) || (named.indexOf('string') !== 0)) {\n return undefined;\n }\n return this.isStringType(this.getChecker().getTypeAtLocation(key).flags) ? this.printNode(key, 0) : undefined;\n }\n if (this.csharpCallReturnType(key) === 'string') {\n // the callee's C# signature is a plain string; the checker proof is the phase-1 gate\n return this.isStringType(this.getChecker().getTypeAtLocation(key).flags) ? this.printNode(key, 0) : undefined;\n }\n const printed = this.printNode(key, 0);\n if (!printed.startsWith('((string)')) {\n return undefined;\n }\n // the cast is the printer's own string view of the value: only a checker-proven\n // string operand may have it (a non-string box would throw where the helper says false)\n return this.isStringType(this.getChecker().getTypeAtLocation(key).flags) ? printed : undefined;\n }\n\n // the checker's view of an `in` / `.length` operand: a dictionary carries a string\n // index signature, an array is the Array reference type. `any` proves nothing\n csharpIsDictionaryType(type): boolean {\n if (type === undefined || this.isAnyType(type.flags)) {\n return false;\n }\n return this.getChecker().getIndexTypeOfType(type, IndexKind.String) !== undefined;\n }\n\n csharpIsArrayType(type): boolean {\n if (type === undefined || this.isAnyType(type.flags)) {\n return false;\n }\n return type?.getSymbol()?.escapedName === 'Array';\n }\n\n // a union of dictionary members and nullish ones (what a `Dict | undefined` signature\n // widens to): a C# reference that happens to be null is a nullish arm, not a scalar one.\n // Any other member (arrays, classes, scalars) keeps the helper\n csharpNullableDictionaryType(type): boolean {\n if (type === undefined || ((type.flags & TypeFlags.Union) === 0)) {\n return false;\n }\n let dictionaries = 0;\n for (const member of (type as UnionType).getTypes() ?? []) {\n if ((member.flags & (TypeFlags.Undefined | TypeFlags.Null)) !== 0) {\n continue;\n }\n if (!this.csharpIsDictionaryType(member)) {\n return false;\n }\n dictionaries++;\n }\n return dictionaries > 0;\n }\n\n // a dictionary whose values are `any` — the shape the transpiled C# boxes as\n // Dictionary. A `Dictionary` / `Dictionary` keeps the\n // helper: the C# cast target is invariant, so `IDictionary` would throw\n csharpIsAnyValuedDictionaryType(type): boolean {\n if (!this.csharpIsDictionaryType(type)) {\n return false;\n }\n const value = this.getChecker().getIndexTypeOfType(type, IndexKind.String);\n return (value !== undefined) && this.isAnyType(value.flags);\n }\n\n // the parameter printFunctionBody gives a `??= new Dictionary()` line\n // (its initializer is an object literal): from the first statement on its box is a\n // dictionary whatever the caller passed, so a null check would be dead code\n csharpDictionaryParamsBag(node): boolean {\n const declaration = this.getChecker().getSymbolAtLocation(node)?.valueDeclaration?.resolve();\n const initializer = (declaration?.kind === SyntaxKind.Parameter) ? (declaration as ParameterDeclaration).initializer : undefined;\n return initializer?.kind === SyntaxKind.ObjectLiteralExpression;\n }\n\n // D2: the name is rewritten before this read, so the box it holds there is not the one its\n // declaration started with (the scan is a name match, so any earlier write bails)\n csharpNameWrittenBefore(node, name: string): boolean {\n const scope = this.csharpEnclosingFunction(node);\n if (scope === undefined) {\n return true;\n }\n let written = false;\n const visit = (n) => {\n if (written || (n.pos >= node.pos)) {\n return;\n }\n if ((n.kind === SyntaxKind.Identifier) && (n.text === name)) {\n const parent = n.parent;\n const assignment = (parent?.kind === SyntaxKind.BinaryExpression) && (parent.left === n);\n const increment = ((parent?.kind === SyntaxKind.PostfixUnaryExpression) || (parent?.kind === SyntaxKind.PrefixUnaryExpression))\n && ((parent.operator === SyntaxKind.PlusPlusToken) || (parent.operator === SyntaxKind.MinusMinusToken));\n if (assignment || increment) {\n written = true;\n return;\n }\n }\n n.forEachChild(visit);\n };\n scope.forEachChild(visit);\n return written;\n }\n\n // The C# dictionary a ContainsKey receiver reads through, or undefined: printer tables, then the\n // build layer's declared-type table, then an `object` parameter proven a dictionary by TS or an\n // emitted `??= new Dictionary()`. That case applies the helper's cast + null test.\n csharpNativeDictionaryReceiver(obj): { text: string, nullTest?: string } | undefined {\n const checker = this.getChecker();\n const type = checker.getTypeAtLocation(obj);\n const nullable = this.csharpNullableDictionaryType(type);\n const receiver = this.csharpNativeReceiver(obj);\n if (receiver !== undefined) {\n // only a dictionary C# type carries ContainsKey (IList keeps the helper)\n if (receiver.type.indexOf('Dictionary<') < 0) {\n return undefined;\n }\n return nullable ? { text: receiver.text, nullTest: receiver.text } : { text: receiver.text };\n }\n // the embedding build layer's declared-type table names the type the local's own\n // declaration carries, so it needs neither the checker proof nor a cast\n const declared = this.csharpExpressionTypeOf(obj);\n if (declared !== undefined) {\n return (declared.indexOf('Dictionary<') >= 0) ? { text: this.printNode(obj, 0) } : undefined;\n }\n // an `object` box: only a parameter of this function (a local may box the hand-written\n // base's own instantiation — `client.futures` is IDictionary — and the\n // printer cannot tell), and only while nothing has rewritten it (D2)\n if (!isIdentifier(obj) || (this.csharpTypedLocalType(obj) !== undefined)) {\n return undefined;\n }\n const name = obj.text as string;\n if (this.csharpNameWrittenBefore(obj, name)) {\n return undefined;\n }\n const declaration = checker.getSymbolAtLocation(obj)?.valueDeclaration?.resolve();\n if (declaration?.kind !== SyntaxKind.Parameter) {\n return undefined; // a local may box a hand-written instantiation the printer cannot name\n }\n const printed = this.printNode(obj, 0);\n const text = `((IDictionary)${printed})`;\n // the params bag: the printer's own `??= new Dictionary()` line made the\n // box a dictionary whatever the caller passed, so no checker proof is needed (and no\n // null test — the line is the first statement of the body)\n if (this.csharpDictionaryParamsBag(obj)) {\n return { text };\n }\n if ((!this.csharpIsDictionaryType(type) && !nullable) || !this.csharpIsAnyValuedDictionaryType(type)) {\n return undefined;\n }\n return { text, nullTest: printed };\n }\n\n // `key in obj` -> `obj.ContainsKey(key)`, only when both the printed key and the printed\n // operand are already C# string / dictionary values. Every other shape keeps the inOp helper\n csharpNativeInExpression(key, obj): string | undefined {\n const printedKey = this.csharpNativeStringKey(key);\n if (printedKey === undefined) {\n return this.csharpDeclaredDictInExpression(key, obj);\n }\n const receiver = this.csharpNativeDictionaryReceiver(obj);\n if (receiver !== undefined) {\n const call = `${receiver.text}.ContainsKey(${printedKey})`;\n return (receiver.nullTest === undefined) ? call : `(${receiver.nullTest} != null && ${call})`;\n }\n // a receiver the embedding build layer retypes AFTER printing: the checker may see\n // `any` on it, so no table above names it (see csharpDeclaredDictInExpression)\n return this.csharpDeclaredDictInExpression(key, obj);\n }\n\n // `key in obj` on a local whose EMITTED declaration is a dictionary the printer cannot name itself\n // (build/csharp-local-types.js retypes it, answers csharpDeclaredDictReceiverType): inOp's dict\n // branch is exactly `obj?.ContainsKey(key) == true` for a key that is already a C# string.\n csharpDeclaredDictInExpression(key, obj): string | undefined {\n if (obj?.kind !== SyntaxKind.Identifier) {\n return undefined;\n }\n const declared = (typeof this.csharpDeclaredDictReceiverType === 'function') ? this.csharpDeclaredDictReceiverType(obj) : undefined;\n if ((declared === undefined) || (declared.indexOf('Dictionary<') < 0)) {\n return undefined;\n }\n const printedKey = this.csharpNativeStringKey(key) ?? this.csharpDeclaredStringKey(key);\n if (printedKey === undefined) {\n return undefined;\n }\n const receiver = this.printNode(obj, 0);\n if (isStringLiteralLikeNode(key)) {\n return `(${receiver}?.ContainsKey(${printedKey}) == true)`;\n }\n // an identifier key may hold null, where a bare ContainsKey throws ArgumentNullException:\n // the helper's own null guard is emitted back. Undefined by default, so an untyped run is\n // byte-identical (a receiver no hook names keeps the helper call).\n if (isIdentifier(key)) {\n return `((${printedKey} != null) && (${receiver}?.ContainsKey(${printedKey}) == true))`;\n }\n return undefined;\n }\n\n // the key of the rule above, when the printer's own tables name no string for it but the\n // embedding build layer's record does (the same hook the isEqual twin reads)\n csharpDeclaredStringKey(key): string | undefined {\n if (key?.kind !== SyntaxKind.Identifier) {\n return undefined;\n }\n const type = (typeof this.csharpLocalTypeOf === 'function') ? this.csharpLocalTypeOf(key) : undefined;\n return ((type === 'string') || (type === 'string?')) ? this.printNode(key, 0) : undefined;\n }\n\n // `x.length` -> `x.Count`, same proof for the checker's array operands; strings keep\n // the `((string)x).Length` branch and every unproven operand keeps getArrayLength\n csharpNativeLengthExpression(expression): string | undefined {\n if (this.csharpIsArrayType(this.getChecker().getTypeAtLocation(expression))) {\n const receiver = this.csharpNativeReceiver(expression);\n if (receiver !== undefined) {\n return `${receiver.text}.Count`;\n }\n }\n return this.csharpDeclaredLengthExpression(expression);\n }\n\n // the C# type of a dictionary element read is `object`: isEqual compares the boxed\n // element, which `as` + the operator reproduce exactly (any other box reads as null,\n // where isEqual also answers false)\n csharpNativeElementLiteralEquality(left, right, leftText: string, rightText: string, isEquality: boolean): string | undefined {\n const elementIsLeft = this.csharpStringKeyedElementAccess(left);\n if (!elementIsLeft && !this.csharpStringKeyedElementAccess(right)) {\n return undefined;\n }\n const [element, literal] = elementIsLeft ? [left, right] : [right, left];\n const isBoolLiteral = (literal.kind === SyntaxKind.TrueKeyword) || (literal.kind === SyntaxKind.FalseKeyword);\n const isStringLiteral = isStringLiteralLikeNode(literal);\n if (!isBoolLiteral && !isStringLiteral) {\n return undefined;\n }\n if (this.csharpDictionaryReceiverType(element.expression) === undefined) {\n return undefined;\n }\n const wanted = isBoolLiteral ? CSHARP_SCALAR_ELEMENT_BOOL : CSHARP_SCALAR_ELEMENT_STRING;\n if ((this.csharpScalarElementKinds(element) & wanted) === 0) {\n return undefined;\n }\n const token = isEquality ? '==' : '!=';\n if (isStringLiteral && this.csharpNumericStringLiteral(literal)) {\n return undefined; // isEqual's double/decimal branches coerce a numeric string\n }\n const cast = isBoolLiteral ? 'bool?' : 'string';\n const castElement = `(${elementIsLeft ? leftText : rightText} as ${cast})`;\n const otherText = elementIsLeft ? rightText : leftText;\n return elementIsLeft ? `(${castElement} ${token} ${otherText})` : `(${otherText} ${token} ${castElement})`;\n }\n\n // `x[\"k\"]` — the element read of a dictionary key this printer prints as getValue(x, \"k\")\n csharpStringKeyedElementAccess(node): boolean {\n return (node?.kind === SyntaxKind.ElementAccessExpression) && isStringLiteralLikeNode(node.argumentExpression);\n }\n\n // isEqual compares a boxed number with a numeric string by converting both, which the\n // string cast of the native form cannot reproduce: a numeric-looking literal stays on\n // the helper (the element proof says the box is a string, and a number box would differ)\n csharpNumericStringLiteral(node): boolean {\n const text = String(node.text).trim();\n return (text !== '') && !isNaN(Number(text));\n }\n\n // the declared C# type of a dictionary receiver: a local the embedding build layer retypes\n // (csharpExpressionTypeResolver) or a hand-written BaseExchange field; undefined keeps the\n // runtime helper, since the printer cannot name the box the key lives in\n csharpDictionaryReceiverType(node): string | undefined {\n const native = this.csharpNativeReceiver(node);\n const declared = (native !== undefined) ? native.type : this.csharpExpressionTypeOf(node);\n if ((declared === undefined) || (declared.indexOf('Dictionary<') < 0)) {\n return undefined;\n }\n return declared;\n }\n\n // the scalar branches isEqual can compare an element with: every member of the element's\n // TypeScript type must be a boolean, a string or undefined, or the helper stays\n csharpScalarElementKinds(node): number {\n try {\n const type = this.getChecker().getTypeAtLocation(node);\n const members = ((type.flags & TypeFlags.Union) !== 0) ? ((type as any).getTypes() ?? []) : [ type ];\n let kinds = 0;\n for (const member of members) {\n const flags = member.flags;\n if (flags & (TypeFlags.Boolean | TypeFlags.BooleanLiteral)) {\n kinds |= CSHARP_SCALAR_ELEMENT_BOOL;\n } else if (flags & (TypeFlags.String | TypeFlags.StringLiteral | TypeFlags.TemplateLiteral)) {\n kinds |= CSHARP_SCALAR_ELEMENT_STRING;\n } else if (!(flags & TypeFlags.Undefined)) {\n return 0;\n }\n }\n return kinds;\n } catch (e) {\n return 0; // in-memory program without a checker\n }\n }\n\n // the C# type the emitted declaration gives a `.length` receiver, or undefined when this\n // printer names none. Installed by build/csharp-local-types.js; undefined by default, so\n // the untyped emission is byte-identical without the override\n csharpLengthReceiverType(expression): string | undefined {\n return undefined;\n }\n\n // `isEqual (x, \"lit\")` -> `x == \"lit\"` (and `!isEqual` -> `!=`) when the operand's emitted\n // declaration is a string: isEqual's string branch is the same ordinal comparison; a null operand\n // is false in both. Gated on csharpLocalTypeOf; an unnamed operand keeps the helper call.\n csharpStringLiteralEquality(op, left, right, leftText: string, rightText: string): string | undefined {\n const equality = (op === SyntaxKind.EqualsEqualsToken) || (op === SyntaxKind.EqualsEqualsEqualsToken);\n const inequality = (op === SyntaxKind.ExclamationEqualsToken) || (op === SyntaxKind.ExclamationEqualsEqualsToken);\n if (!equality && !inequality) {\n return undefined;\n }\n const leftLiteral = isStringLiteral(left);\n const rightLiteral = isStringLiteral(right);\n if (leftLiteral === rightLiteral) {\n return undefined; // exactly one side must be the (never-null) string literal\n }\n const operand = leftLiteral ? right : left;\n if (operand?.kind !== SyntaxKind.Identifier) {\n return undefined;\n }\n const operandType = this.csharpLocalTypeOf(operand);\n if ((operandType !== 'string') && (operandType !== 'string?')) {\n return undefined;\n }\n return `${leftText} ${inequality ? '!=' : '=='} ${rightText}`;\n }\n\n // U55: `isEqual (x, null)` -> `x == null` (`!isEqual` -> `!=`) when the emitted declaration is\n // a typed reference or nullable scalar: the helper's null guards return exactly the C# null test,\n // never reach a typed branch. Gated on csharpNullComparisonTypeOf; unnamed operands keep helper.\n csharpNullLiteralEquality(op, left, right, leftText: string, rightText: string): string | undefined {\n const equality = (op === SyntaxKind.EqualsEqualsToken) || (op === SyntaxKind.EqualsEqualsEqualsToken);\n const inequality = (op === SyntaxKind.ExclamationEqualsToken) || (op === SyntaxKind.ExclamationEqualsEqualsToken);\n if (!equality && !inequality) {\n return undefined;\n }\n const leftNull = this.csharpOperandIsNullLiteral(left);\n const rightNull = this.csharpOperandIsNullLiteral(right);\n if (leftNull === rightNull) {\n return undefined; // exactly one side must be the (never-typed) null literal\n }\n let operand = leftNull ? right : left;\n while (operand?.kind === SyntaxKind.ParenthesizedExpression) {\n operand = operand.expression;\n }\n if (operand?.kind !== SyntaxKind.Identifier) {\n return undefined;\n }\n const operandType = (typeof this.csharpNullComparisonTypeOf === 'function') ? this.csharpNullComparisonTypeOf(operand) : undefined;\n if (!this.csharpNullComparisonTypeIsProvable(operandType)) {\n return undefined;\n }\n return this.csharpNullComparison(leftNull ? rightText : leftText, equality);\n }\n\n // `null` and the `undefined` identifier both print as the C# null literal\n csharpOperandIsNullLiteral(node): boolean {\n return (node?.kind === SyntaxKind.NullKeyword)\n || ((node?.kind === SyntaxKind.Identifier) && (node.text === 'undefined'));\n }\n\n printCustomBinaryExpressionIfAny(node, identation) {\n const left = node.left;\n const right = node.right;\n\n const op = node.operatorToken.kind;\n\n if (left.kind === SyntaxKind.TypeOfExpression) {\n const typeOfExpression = this.handleTypeOfInsideBinaryExpression(node, identation);\n if (typeOfExpression) {\n return typeOfExpression;\n }\n }\n\n // handle: [x,d] = this.method()\n if (op === SyntaxKind.EqualsToken && left.kind === SyntaxKind.ArrayLiteralExpression) {\n const arrayBindingPatternElements = left.elements;\n const parsedArrayBindingElements = arrayBindingPatternElements.map((e) => this.printNode(e, 0));\n const syntheticName = parsedArrayBindingElements.join(\"\") + \"Variable\";\n\n // when the holder's C# type is known (see csharpDestructuringTempType), declare the\n // holder with it and index it directly: `((IList)holder)[i]` names nothing new\n const tempType = this.csharpDestructuringTempType(right);\n const tempExpression = this.printNode(right, 0);\n\n const tempCast = (tempType && this.csharpDestructuringTempNeedsCast(right, tempExpression)) ? `(${tempType})` : '';\n let arrayBindingStatement = tempType ? `${tempType} ${syntheticName} = ${tempCast}${tempExpression};\\n` : `var ${syntheticName} = ${tempExpression};\\n`;\n\n parsedArrayBindingElements.forEach((e, index) => {\n // const type = this.getType(node);\n // const parsedType = this.getTypeFromRawType(type);\n const leftElement = arrayBindingPatternElements[index];\n const leftType = this.getChecker().getTypeAtLocation(leftElement);\n const parsedType = this.getTypeFromRawType(leftType);\n\n const castExp = parsedType ? `(${parsedType})` : \"\";\n\n // const statement = this.getIden(identation) + `${e} = (${castExp}((List)${syntheticName}))[${index}]`;\n const statement = this.getIden(identation) + (tempType ? `${e} = ${syntheticName}[${index}]` : `${e} = ((IList)${syntheticName})[${index}]`);\n if (index < parsedArrayBindingElements.length - 1) {\n arrayBindingStatement += statement + \";\\n\";\n } else {\n // printStatement adds the last ;\n arrayBindingStatement += statement;\n }\n });\n\n return arrayBindingStatement;\n }\n\n if (op === SyntaxKind.InKeyword) {\n const nativeIn = this.csharpNativeInExpression(left, right);\n if (nativeIn !== undefined) {\n return nativeIn;\n }\n return `inOp(${this.printNode(right, 0)}, ${this.printNode(left, 0)})`;\n }\n\n // only print the operands when this op is actually handled here; otherwise\n // the base printBinaryExpression prints them, and doing it eagerly means\n // every unhandled binary expression gets its subtrees printed twice\n if (op === SyntaxKind.PlusEqualsToken || op === SyntaxKind.MinusEqualsToken || op in this.binaryExpressionsWrappers) {\n const nativeComparison = this.csharpNativeNumericComparison(node, identation);\n if (nativeComparison !== undefined) {\n return nativeComparison;\n }\n const leftText = this.printNode(left, 0);\n const rightText = this.printNode(right, 0);\n\n if (op === SyntaxKind.PlusEqualsToken) {\n return `${leftText} = add(${leftText}, ${rightText})`;\n }\n\n if (op === SyntaxKind.MinusEqualsToken) {\n return `${leftText} = subtract(${leftText}, ${rightText})`;\n }\n\n const isEquality = (op === SyntaxKind.EqualsEqualsToken) || (op === SyntaxKind.EqualsEqualsEqualsToken);\n const isDifference = (op === SyntaxKind.ExclamationEqualsToken) || (op === SyntaxKind.ExclamationEqualsEqualsToken);\n if (isEquality || isDifference) {\n // `isEqual (x, \"lit\")` / `!isEqual (x, \"lit\")` over a string-typed operand (S60,\n // csharpStringLiteralEquality) first; anything the hook cannot name falls through to the\n // printed-form inlining below, byte-identically.\n const nativeEquality = this.csharpStringLiteralEquality(op, left, right, leftText, rightText);\n // `isEqual (x, null)` / `!isEqual (x, null)` over a typed-reference or nullable-scalar operand\n // (U55, csharpNullLiteralEquality), the hook-gated null-literal twin of the rule above; anything\n // it cannot name falls through to the printed-form inlining below, byte-identically.\n const native = nativeEquality\n ?? this.csharpNullLiteralEquality(op, left, right, leftText, rightText)\n ?? this.printInlineEquality(left, right, leftText, rightText, isEquality)\n ?? this.csharpNativeElementLiteralEquality(left, right, leftText, rightText, isEquality)\n ?? this.csharpNativeNumericCallEquality(left, right, leftText, rightText, isEquality);\n if (native !== undefined) {\n return native;\n }\n }\n\n if (op === SyntaxKind.PlusToken) {\n // `add (x, y)` -> `(x + y)` when the classifier proves the LEFT operand's emitted declaration is a\n // string (U57): the call binds add(string, string) / add(string, object), exactly this\n // concatenation. Gated on the hook, so an unnamed operand keeps the helper.\n const nativeConcat = this.csharpNativeStringConcat(left, right, leftText, rightText);\n if (nativeConcat !== undefined) {\n return nativeConcat;\n }\n }\n\n if (op === SyntaxKind.AsteriskToken) {\n const nativeProduct = this.csharpNativeLiteralProduct(left, right);\n if (nativeProduct !== undefined) {\n return nativeProduct;\n }\n }\n\n const [open, close] = this.binaryExpressionsWrappers[op];\n if (op === SyntaxKind.PercentToken) {\n const nativeMod = this.csharpNativeModExpression(left, right, leftText);\n if (nativeMod !== undefined) {\n return nativeMod;\n }\n }\n return `${open}${leftText}, ${rightText}${close}`;\n }\n\n // x = y\n // cast y to x type when y is unknown\n // if (op === SyntaxKind.EqualsToken) {\n // const leftType = this.getChecker().getTypeAtLocation(left);\n // const rightType = this.getChecker().getTypeAtLocation(right);\n\n // if (this.isAnyType(rightType.flags) && !this.isAnyType(leftType.flags)) {\n // // const parsedType = this.getTypeFromRawType(leftType);\n // return `${leftText} = ${rightText}`;\n // }\n // }\n\n return undefined;\n }\n\n // castVariableAssignmentIfNeeded(left, right, identation) {\n // const leftType = this.getChecker().getTypeAtLocation(left);\n // const rightType = this.getChecker().getTypeAtLocation(right);\n\n // const leftText = this.printNode(left, 0);\n // const rightText = this.printNode(right, 0);\n\n // if (this.isAnyType(rightType.flags) && !this.isAnyType(leftType.flags)) {\n // const parsedType = this.getTypeFromRawType(leftType);\n // return `${this.getIden(identation)}${leftText} = (${parsedType})${rightText}`;\n // }\n // return undefined;\n // }\n\n // the C# type of a whole-call / whole-property initializer, keyed on the AST so\n // the printer's cast wrappers (`((string)x).ToUpper()`) do not hide the callee\n csharpCallReturnType(initializer): string | undefined {\n if (initializer?.kind === SyntaxKind.PropertyAccessExpression) {\n // `x.length` prints `((string)x).Length` or `getArrayLength(x)`, both int\n return (initializer.name?.text === 'length') ? 'int' : undefined;\n }\n if (initializer?.kind !== SyntaxKind.CallExpression) {\n return undefined;\n }\n const expression = initializer.expression;\n if (expression?.kind !== SyntaxKind.PropertyAccessExpression) {\n return undefined;\n }\n const methodName = expression.name?.text as string;\n const target = expression.expression;\n if (target?.kind === SyntaxKind.ThisKeyword) {\n // the table names the C# signature of the same-name base helper, which the printed\n // call only binds when the printer resolves the callee. An unresolvable one\n // (`this.proxyUrlCallback(...)` — a property holding the function — or a\n // checker-less program) prints `callDynamically(this, \"name\", ...)` instead, and\n // that helper returns `object`: no concrete type may be named for its value\n if (!this.csharpCalleeResolves(initializer)) {\n return undefined;\n }\n return CSHARP_THIS_RETURN_TYPES[methodName];\n }\n if (target?.kind === SyntaxKind.Identifier) {\n return CSHARP_STATIC_RETURN_TYPES[(target.text as string) + '.' + methodName] ?? CSHARP_METHOD_RETURN_TYPES[methodName];\n }\n return CSHARP_METHOD_RETURN_TYPES[methodName];\n }\n\n // mirrors printWrappedUnknownThisProperty: a `this.(...)` call whose callee the\n // checker cannot resolve is printed as `callDynamically(this, \"\", ...)`, whose C#\n // signature returns `object` whatever the name says\n csharpCalleeResolves(node): boolean {\n const checker: any = this.checkerOrUndefined();\n if (checker === undefined) {\n return false;\n }\n return checker.getResolvedSignature(node)?.declaration !== undefined;\n }\n\n // the concrete C# type the initializer already produces, or undefined when the\n // printer cannot name it (this.safeString, getValue, add, parseInt, ... return object)\n csharpTypeOfInitializer(initializer): string | undefined {\n switch (initializer?.kind) {\n case SyntaxKind.StringLiteral:\n case SyntaxKind.NoSubstitutionTemplateLiteral:\n return 'string';\n case SyntaxKind.TrueKeyword:\n case SyntaxKind.FalseKeyword:\n return 'bool';\n case SyntaxKind.PrefixUnaryExpression:\n // `!x` prints `!isTrue(x)`\n return (initializer.operator === SyntaxKind.ExclamationToken) ? 'bool' : undefined;\n case SyntaxKind.ParenthesizedExpression:\n return this.csharpTypeOfInitializer(initializer.expression);\n case SyntaxKind.BinaryExpression: {\n const op = initializer.operatorToken.kind;\n // `a || b` prints `isTrue(a) || isTrue(b)`; the comparison wrappers and\n // `in` all return bool\n switch (op) {\n case SyntaxKind.BarBarToken:\n case SyntaxKind.AmpersandAmpersandToken:\n case SyntaxKind.EqualsEqualsToken:\n case SyntaxKind.EqualsEqualsEqualsToken:\n case SyntaxKind.ExclamationEqualsToken:\n case SyntaxKind.ExclamationEqualsEqualsToken:\n case SyntaxKind.GreaterThanToken:\n case SyntaxKind.GreaterThanEqualsToken:\n case SyntaxKind.LessThanToken:\n case SyntaxKind.LessThanEqualsToken:\n case SyntaxKind.InKeyword:\n return 'bool';\n }\n return undefined;\n }\n }\n return this.csharpCallReturnType(initializer) ?? (this.csharpBoolCallTyped(initializer) ? 'bool' : undefined);\n }\n\n // A `this.(...)` call to a method the enclosing class declares with a plain `bool` return\n // (csharpBooleanReturnType prints that `bool`) hands back an unboxed bool, so a local holding it is\n // `bool`. Base helpers, names the table answers and overloaded families keep their box.\n csharpBoolCallTyped(node): boolean {\n if (node?.kind !== SyntaxKind.CallExpression || !this.csharpIsCheckedBoolean(node)) {\n return false;\n }\n const expression = node.expression;\n if (expression?.kind !== SyntaxKind.PropertyAccessExpression || expression.expression?.kind !== SyntaxKind.ThisKeyword) {\n return false;\n }\n let declaration;\n let checker;\n try {\n checker = this.getChecker();\n declaration = checker.getResolvedSignature(node)?.declaration?.resolve();\n } catch (e) {\n return false;\n }\n if (!isMethodDeclaration(declaration) || (this.csharpBooleanReturnType(declaration) !== 'bool')) {\n return false;\n }\n const owner = findAncestor(declaration, isClassLikeDeclaration);\n if ((owner === undefined) || (owner !== findAncestor(node, isClassLikeDeclaration))) {\n return false;\n }\n return checker.getSymbolAtLocation(declaration.name)?.declarations?.length === 1;\n }\n\n csharpEnclosingFunction(node) {\n let current = node?.parent;\n while (current) {\n switch (current.kind) {\n case SyntaxKind.MethodDeclaration:\n case SyntaxKind.FunctionDeclaration:\n case SyntaxKind.FunctionExpression:\n case SyntaxKind.ArrowFunction:\n case SyntaxKind.Constructor:\n case SyntaxKind.SourceFile:\n return current;\n }\n current = current.parent;\n }\n return undefined;\n }\n\n csharpTypeNameIsShadowed(scope, csharpType: string): boolean {\n const names = csharpType.match(/[A-Za-z_]\\w*/g) ?? [];\n const relevant = names.filter((n) => CSHARP_TYPE_NAMES.indexOf(n) >= 0);\n if (relevant.length === 0 || scope === undefined) {\n return false;\n }\n return this.hasNodeWhere(scope, (n: any) => {\n const isBinding = (n.kind === SyntaxKind.Parameter) || (n.kind === SyntaxKind.VariableDeclaration);\n if (isBinding && (n.name?.kind === SyntaxKind.Identifier)) {\n const printed = this.printNode(n.name, 0);\n if (relevant.indexOf(printed) >= 0) { return true; }\n }\n return false;\n });\n }\n\n // reject the refinement when something downstream needs the local to stay `object`:\n // `x.push(v)` prints `((IList)x).Add(v)` on a value that must be boxed, a\n // later assignment of another concrete type would stop compiling, and `x++` prints\n // `postFixIncrement(ref x)` whose parameter is `ref object`\n csharpLocalIsSafeToType(scope, declaration, varName: string, csharpType: string, safeAccessor = false): boolean {\n if (scope === undefined) {\n return false;\n }\n return !this.hasNodeWhere(scope, (n: any) => {\n if ((n.kind === SyntaxKind.Identifier) && (n.text === varName) && (n !== declaration.name)) {\n const parent = n.parent;\n if (parent?.kind === SyntaxKind.VariableDeclaration && parent.name === n) {\n return; // a sibling block-scoped declaration; it gets its own type\n }\n if ((parent?.kind === SyntaxKind.PostfixUnaryExpression) || (parent?.kind === SyntaxKind.PrefixUnaryExpression)) {\n const op = parent.operator;\n if ((op === SyntaxKind.PlusPlusToken) || (op === SyntaxKind.MinusMinusToken)) {\n return true;\n }\n // prefixUnaryNeg/Plus(ref x) has int / Int64 / double twins only: a\n // nullable or reference local would not bind any overload\n if (safeAccessor && (op !== SyntaxKind.ExclamationToken) && (csharpType !== 'int') && (csharpType !== 'Int64') && (csharpType !== 'double')\n && !this.csharpHx4GuardedNullableNegation(parent, csharpType)) {\n return true;\n }\n }\n if (parent?.kind === SyntaxKind.SpreadElement) {\n return true;\n }\n if (parent?.kind === SyntaxKind.ArrayLiteralExpression\n && parent.parent?.kind === SyntaxKind.BinaryExpression\n && parent.parent.left === parent\n && parent.parent.operatorToken.kind === SyntaxKind.EqualsToken) {\n return true;\n }\n if (parent?.kind === SyntaxKind.PropertyAccessExpression && parent.expression === n) {\n const method = parent.name?.text;\n // these print as `((IList)x).Add(...)` / `x = (x as IList)...`\n if ((method === 'push') || (method === 'reverse') || (method === 'sort')) {\n return true;\n }\n // the remaining list methods print an `((IList)x)` cast too; only\n // a safe* list local can carry one\n if (safeAccessor && !this.csharpTypeIsList(csharpType) && ((method === 'join') || (method === 'shift') || (method === 'pop'))) {\n return true;\n }\n }\n if (safeAccessor) {\n // `const [a, b] = x` prints a `((IList)x)[0]` read\n if (parent?.kind === SyntaxKind.VariableDeclaration && parent.name?.kind === SyntaxKind.ArrayBindingPattern && !this.csharpTypeIsList(csharpType)) {\n return true;\n }\n // `throw new ExchangeError (x)` wraps the argument in a hard `(string)`\n // cast, which only compiles from `object` or a string; `delete obj[x]` prints\n // `.Remove((string)x)`, the same hard cast\n if (!this.csharpTypeIsStringType(csharpType) && (this.csharpIsClassThrowArgument(n) || this.csharpIsDeleteKey(n))) {\n return true;\n }\n }\n if (parent?.kind === SyntaxKind.BinaryExpression && parent.left === n) {\n const op = parent.operatorToken.kind;\n if (op === SyntaxKind.EqualsToken) {\n if (this.csharpTypeOfInitializer(parent.right) !== csharpType) {\n return true;\n }\n } else if ((op >= SyntaxKind.FirstCompoundAssignment) && (op <= SyntaxKind.LastCompoundAssignment)) {\n return true;\n }\n }\n // a `string?` local as the LEFT operand of `+` prints add(, ...): the\n // nullable-to-`string` conversion makes add(string, ...) a better match than\n // add(object, object), which turns a null left into the right operand instead\n // of null (see the same rule in the ccxt cs/ccxt/base comments)\n if (safeAccessor && (csharpType === 'string?') && this.csharpIsLeftPlusOperand(n)) {\n return true;\n }\n }\n return false;\n });\n }\n\n // a `((string)x)` wrapper is redundant as soon as the receiver's static C# type is\n // already string: the cast names the box the value is in, it never changes the value\n\n getCSharpLocalType(declaration): string {\n const csharpType = this.csharpTypeOfInitializer(declaration.initializer);\n if (csharpType === undefined) {\n return this.VAR_TOKEN;\n }\n // the scan matches AST identifiers, so it needs the source name, not the\n // printed one (`string` is renamed to `str` on the way out)\n const sourceName = declaration.name?.text;\n if (sourceName === undefined) {\n return this.VAR_TOKEN;\n }\n const scope = this.csharpEnclosingFunction(declaration);\n const safeAccessor = this.csharpIsSafeAccessorCall(declaration.initializer);\n if (this.csharpTypeNameIsShadowed(scope, csharpType) || !this.csharpLocalIsSafeToType(scope, declaration, sourceName, csharpType, safeAccessor)) {\n return this.VAR_TOKEN;\n }\n return csharpType;\n }\n\n // `this.safeString2 (...)`: the printed call binds the concrete C# signature of the\n // same-name base helper (see CSHARP_THIS_RETURN_TYPES). Used to gate the extra sinks.\n csharpIsSafeAccessorCall(initializer): boolean {\n if (initializer?.kind !== SyntaxKind.CallExpression) {\n return false;\n }\n const expression = initializer.expression;\n if (expression?.kind !== SyntaxKind.PropertyAccessExpression || expression.expression?.kind !== SyntaxKind.ThisKeyword) {\n return false;\n }\n return CSHARP_SAFE_ACCESSOR_NAMES.indexOf(expression.name?.text as string) >= 0;\n }\n\n csharpTypeIsList(csharpType: string): boolean {\n return (csharpType === 'List') || (csharpType === 'IList');\n }\n\n csharpTypeIsStringType(csharpType: string): boolean {\n return (csharpType === 'string') || (csharpType === 'string?');\n }\n\n // `throw new ExchangeError (x)`: the printer wraps the argument in a hard `(string)`\n csharpIsClassThrowArgument(node): boolean {\n let current = node;\n while (current.parent) {\n const parent = current.parent;\n if ((parent.kind === SyntaxKind.ParenthesizedExpression) || (parent.kind === SyntaxKind.AsExpression)) {\n current = parent;\n continue;\n }\n if ((parent.kind === SyntaxKind.NewExpression) && (parent.arguments?.indexOf(current) >= 0)) {\n current = parent;\n continue;\n }\n return parent.kind === SyntaxKind.ThrowStatement;\n }\n return false;\n }\n\n // `delete obj[x]` prints `.Remove((string)x)`\n csharpIsDeleteKey(node): boolean {\n let value = node;\n while (value.parent && ((value.parent.kind === SyntaxKind.ParenthesizedExpression) || (value.parent.kind === SyntaxKind.AsExpression))) {\n value = value.parent;\n }\n const access = value.parent;\n return access?.kind === SyntaxKind.ElementAccessExpression && access.argumentExpression === value && access.parent?.kind === SyntaxKind.DeleteExpression;\n }\n\n // `(x) + y` / `x + y` prints `add(x, y)`: the parentheses keep x's static type\n csharpIsLeftPlusOperand(node): boolean {\n let value = node;\n while (value.parent && (value.parent.kind === SyntaxKind.ParenthesizedExpression)) {\n value = value.parent;\n }\n const parent = value.parent;\n if (parent?.kind !== SyntaxKind.BinaryExpression || parent.left !== value) {\n return false;\n }\n const op = parent.operatorToken.kind;\n return (op === SyntaxKind.PlusToken) || (op === SyntaxKind.PlusEqualsToken);\n }\n // the binding a bare identifier resolves to (a local, a parameter, ...) or undefined\n // for every other receiver shape (`this.x`, a call result, a destructured target)\n csharpReceiverBinding(receiver) {\n if (receiver?.kind !== SyntaxKind.Identifier) {\n return undefined;\n }\n const symbol = (this.getChecker() as Checker).getSymbolAtLocation(receiver);\n return symbol?.valueDeclaration?.resolve();\n }\n\n // The static C# type the emitted declaration gives a string-method receiver, or undefined when the\n // printer cannot name it (parameters, call results, ...). Only printer-typed locals are provable\n // here; the ccxt classifier overrides this hook to add the locals and parameters ITS tables retype.\n csharpStringReceiverType(receiver): string | undefined {\n const declaration = this.csharpReceiverBinding(receiver);\n if (declaration?.kind !== SyntaxKind.VariableDeclaration) {\n return undefined;\n }\n if ((declaration.parent as any)?.declarations?.length !== 1) {\n return undefined; // `object a = ..., b = ...` is printed as one statement\n }\n // memoized: the caller asks per receiver, getCSharpLocalType scans the scope\n const cached = this.stringReceiverTypes.get(declaration);\n if (cached !== undefined) {\n return (cached === '') ? undefined : cached;\n }\n const type = this.getCSharpLocalType(declaration);\n this.stringReceiverTypes.set(declaration, type ?? '');\n return type;\n }\n\n // the receiver of `x.Split/.ToUpper/.ToLower/.Replace/.Trim/.Length`, already printed:\n // bare when its static C# type is a string, wrapped in `((string)...)` otherwise (the\n // untyped emission is unchanged)\n csharpStringMethodReceiver(node, name) {\n const expression = node?.expression;\n const receiver = (node?.kind === SyntaxKind.CallExpression)\n ? ((expression?.kind === SyntaxKind.PropertyAccessExpression) ? expression.expression : undefined)\n : expression;\n const type = this.csharpStringReceiverType(receiver);\n return ((type === 'string') || (type === 'string?')) ? name : `((string)${name})`;\n }\n\n // The declared C# type of the `Variable` holder of a destructuring block, or undefined\n // (keeps a `var` holder read via `((IList)holder)[i]`). The ccxt classifier overrides this\n // for the tuple-returning `handle*AndParams` family: holder is `IList`, read directly.\n csharpDestructuringTempType(initializer): string | undefined {\n return undefined;\n }\n\n // whether the typed holder needs the `(T)` cast on its printed initializer; a consumer that\n // proves the printed call already returns T (or a subtype) answers false\n csharpDestructuringTempNeedsCast(initializer, printedExpression: string): boolean {\n return true;\n }\n\n // `isTrue (x)` is the identity on a C# `bool`, and `x == true` is what it computes for a `bool?`\n // (null -> false), so in a condition the wrapper adds nothing. The hook answers the emitted\n // declaration's type (getCSharpLocalType, plus classifier retypes); unnamed operands keep isTrue.\n csharpConditionOperandType(node) {\n const declaration = this.csharpReceiverBinding(node);\n if (declaration?.kind !== SyntaxKind.VariableDeclaration) {\n return undefined; // a parameter / member read has no declaration this pass retypes\n }\n if ((declaration.parent as any)?.declarations?.length !== 1) {\n return undefined; // `object a = ..., b = ...` is printed as one statement\n }\n // memoized: the caller asks per operand, getCSharpLocalType scans the scope\n const cached = this.conditionOperandTypes.get(declaration);\n if (cached !== undefined) {\n return (cached === '') ? undefined : cached;\n }\n const type = this.getCSharpLocalType(declaration);\n const result = ((type === 'bool') || (type === 'bool?')) ? type : undefined;\n this.conditionOperandTypes.set(declaration, result ?? '');\n return result;\n }\n\n // the native spelling of a condition operand, or undefined when it needs `isTrue`.\n // `!x == true` would parse as `(!x) == true`, so the `bool?` form takes parentheses\n // under the `!` operator; every other allowed position binds `==` tighter already.\n csharpNativeCondition(node, identation) {\n const type = this.csharpConditionOperandType(node);\n if (type === undefined) {\n return undefined;\n }\n const text = this.printNode(node, 0);\n if (type === 'bool') {\n return this.getIden(identation) + text;\n }\n const equalsTrue = text + ' == true';\n const parent = node.parent;\n const negated = (parent?.kind === SyntaxKind.PrefixUnaryExpression) && (parent.operator === SyntaxKind.ExclamationToken);\n return this.getIden(identation) + (negated ? `(${equalsTrue})` : equalsTrue);\n }\n\n // `!x` on the `bool?` the hook names prints `x != true`: exactly `!(x == true)` (null -> true)\n // and the value isTrue computes for the box. A `bool` operand keeps the base `!x`; an operand\n // the hook cannot name keeps `!isTrue(x)` (the untyped emission is untouched).\n csharpNegatedConditionOperand(operand) {\n if (operand?.kind !== SyntaxKind.Identifier) {\n return undefined;\n }\n if (this.csharpConditionOperandType(operand) !== 'bool?') {\n return undefined;\n }\n return `${this.printNode(operand, 0)} != true`;\n }\n\n // only the if / while / && / || / ! condition positions print natively through this gate; the\n // ternary condition has its own hook-driven fold (csharpTernaryConditionOperand, U56) because\n // its operand is a plain value position the base printCondition path never asks about.\n csharpConditionPositionAllowsNative(node) {\n const parent = node?.parent;\n switch (parent?.kind) {\n case SyntaxKind.IfStatement:\n return parent.expression === node;\n case SyntaxKind.WhileStatement:\n return parent.expression === node;\n case SyntaxKind.PrefixUnaryExpression:\n return (parent.operator === SyntaxKind.ExclamationToken) && (parent.operand === node);\n case SyntaxKind.BinaryExpression: {\n const op = parent.operatorToken?.kind;\n return ((op === SyntaxKind.AmpersandAmpersandToken) || (op === SyntaxKind.BarBarToken))\n && ((parent.left === node) || (parent.right === node));\n }\n }\n return false;\n }\n\n printVariableDeclarationList(node,identation) {\n const declaration = node.declarations[0];\n // const name = declaration.name.text;\n\n if (this.removeVariableDeclarationForFunctionExpression && declaration?.initializer && isFunctionExpression(declaration.initializer)) {\n return this.printNode(declaration.initializer, identation).trimEnd();\n }\n // handle array binding : input: const [a,b] = this.method()\n // output: var abVar = this.method; var a = abVar[0]; var b = abVar[1];\n if (declaration?.name.kind === SyntaxKind.ArrayBindingPattern) {\n const arrayBindingPattern = declaration.name;\n const arrayBindingPatternElements = arrayBindingPattern.elements;\n const parsedArrayBindingElements = arrayBindingPatternElements.map((e) => this.printNode(e.name, 0));\n const syntheticName = parsedArrayBindingElements.join(\"\") + \"Variable\";\n\n // typed holder (see csharpDestructuringTempType): same value, read without the re-cast\n const tempType = this.csharpDestructuringTempType(declaration.initializer);\n const tempExpression = this.printNode(declaration.initializer, 0);\n const tempCast = (tempType && this.csharpDestructuringTempNeedsCast(declaration.initializer, tempExpression)) ? `(${tempType})` : '';\n const tempDeclaration = tempType ? `${tempType} ${syntheticName} = ${tempCast}${tempExpression}` : `var ${syntheticName} = ${tempExpression}`;\n\n let arrayBindingStatement = `${this.getIden(identation)}${tempDeclaration};\\n`;\n\n parsedArrayBindingElements.forEach((e, index) => {\n // const type = this.getType(node);\n // const parsedType = this.getTypeFromRawType(type);\n const statement = this.getIden(identation) + `var ${e} = ` + (tempType ? `${syntheticName}[${index}]` : `((IList) ${syntheticName})[${index}]`);\n if (index < parsedArrayBindingElements.length - 1) {\n arrayBindingStatement += statement + \";\\n\";\n } else {\n // printStatement adds the last ;\n arrayBindingStatement += statement;\n }\n });\n\n return arrayBindingStatement;\n }\n\n const isNew = declaration?.initializer && (declaration.initializer.kind === SyntaxKind.NewExpression);\n\n // handle the let id: Str; case (default undefined initialization)\n if (!declaration.initializer) {\n return this.getIden(identation) + 'object ' + this.printNode(declaration.name) + \" = \" + this.UNDEFINED_TOKEN;\n }\n const parsedValue = this.printNode(declaration.initializer, identation).trimStart();\n if (parsedValue === this.UNDEFINED_TOKEN) {\n let specificVarToken = \"object\";\n if (this.INFER_VAR_TYPE) {\n const variableType = this.getChecker().typeToString(this.getChecker().getTypeAtLocation(declaration));\n if (this.VariableTypeReplacements[variableType]) {\n specificVarToken = this.VariableTypeReplacements[variableType] + '?';\n }\n }\n return this.getIden(identation) + specificVarToken + \" \" + this.printNode(declaration.name) + \" = \" + parsedValue;\n }\n const declaredType = isNew ? 'var' : this.getCSharpLocalType(declaration);\n // remember the concrete types this printer declared itself: the printed prefix is\n // final (a host wrapper only rewrites untyped `object = ` declarations), so\n // the local's static type is known at every later read\n if (!isNew && node.declarations.length === 1 && this.csharpTypeIsNative(declaredType)) {\n this.csharpTypedLocals.set(declaration, declaredType);\n }\n return this.getIden(identation) + declaredType + \" \" + this.printNode(declaration.name) + \" = \" + parsedValue;\n }\n\n transformPropertyAcessExpressionIfNeeded(node) {\n const expression = node.expression;\n const leftSide = this.printNode(expression, 0);\n const rightSide = node.name.text;\n\n let rawExpression = undefined;\n\n switch(rightSide) {\n case 'length':\n const type = (this.getChecker() as Checker).getTypeAtLocation(expression); // eslint-disable-line\n this.warnIfAnyType(node, type.flags, leftSide, \"length\");\n // rawExpression = this.isStringType(type.flags) ? `(string${leftSide}).Length` : `(${leftSide}.Cast().ToList()).Count`;\n rawExpression = this.isStringType(type.flags) ? `${this.csharpStringMethodReceiver(node, leftSide)}.Length` : (this.csharpNativeLengthExpression(expression) ?? `${this.ARRAY_LENGTH_WRAPPER_OPEN}${leftSide}${this.ARRAY_LENGTH_WRAPPER_CLOSE}`); // `(${leftSide}.Cast()).ToList().Count`\n break;\n case 'push':\n rawExpression = `((IList)${leftSide}).Add`;\n break;\n // case 'push':\n // rawExpression = `(List${leftSide}).Add`s\n // break;\n }\n return rawExpression;\n }\n\n printCustomDefaultValueIfNeeded(node) {\n if (isArrayLiteralExpression(node) || isObjectLiteralExpression(node) || isStringLiteral(node) || isBooleanLiteral(node)\n || isNumericLiteral(node)) {\n return this.UNDEFINED_TOKEN;\n }\n\n // convert x: number = undefined (invalid) into x = -1 (valid)\n if (node?.text === \"undefined\" && this.getChecker().getTypeAtLocation(node?.parent)?.flags === TypeFlags.Number) {\n // return \"-1\";\n return this.UNDEFINED_TOKEN;\n }\n\n return undefined;\n }\n\n printFunctionBody(node, identation) {\n\n // check if there is any default parameter to initialize\n const funcParams = node.parameters;\n const initParams = [];\n if (funcParams.length > 0) {\n const body = node.body.statements;\n const first = body.length > 0 ? body[0] : [];\n const remaining = body.length > 0 ? body.slice(1): [];\n let firstStatement = this.printNode(first, identation + 1);\n\n const remainingString = remaining.map((statement) => this.printNode(statement, identation + 1)).join(\"\\n\");\n funcParams.forEach((param) => {\n const initializer = param.initializer;\n if (initializer) {\n if (isArrayLiteralExpression(initializer)) {\n initParams.push(`${this.printNode(param.name, 0)} ??= new List();`);\n }\n if (isObjectLiteralExpression(initializer)) {\n initParams.push(`${this.printNode(param.name, 0)} ??= new Dictionary();`);\n }\n if (isNumericLiteral(initializer) || isStringLiteral(initializer) || isBooleanLiteral(initializer)) {\n initParams.push(`${this.printNode(param.name, 0)} ??= ${this.printNode(initializer, 0)};`);\n }\n }\n });\n\n if (initParams.length > 0) {\n const defaultInitializers = initParams.map( l => this.getIden(identation+1) + l ).join(\"\\n\") + \"\\n\";\n const bodyParts = firstStatement.split(\"\\n\");\n const commentPart = bodyParts.filter(line => this.isComment(line));\n const isComment = commentPart.length > 0;\n if (isComment) {\n const commentPartString = commentPart.map((c) => this.getIden(identation+1) + c.trim()).join(\"\\n\");\n const firstStmNoComment = bodyParts.filter(line => !this.isComment(line)).join(\"\\n\");\n firstStatement = commentPartString + \"\\n\" + defaultInitializers + firstStmNoComment;\n } else {\n firstStatement = defaultInitializers + firstStatement;\n }\n }\n const blockOpen = this.getBlockOpen(identation);\n const blockClose = this.getBlockClose(identation);\n firstStatement = remainingString.length > 0 ? firstStatement + \"\\n\" : firstStatement;\n return blockOpen + firstStatement + remainingString + blockClose;\n }\n\n return super.printFunctionBody(node, identation);\n }\n\n printInstanceOfExpression(node, identation) {\n const left = node.left.text;\n const right = node.right.text;\n return this.getIden(identation) + `${left} is ${right}`;\n }\n\n printAsExpression(node, identation) {\n const type = node.type;\n\n if (type.kind === SyntaxKind.AnyKeyword) {\n return `((object)${this.printNode(node.expression, identation)})`;\n }\n\n if (type.kind === SyntaxKind.StringKeyword) {\n return `((string)${this.printNode(node.expression, identation)})`;\n }\n\n if (type.kind === SyntaxKind.ArrayType) {\n if (type.elementType.kind === SyntaxKind.AnyKeyword) {\n return `(IList)(${this.printNode(node.expression, identation)})`;\n }\n if (type.elementType.kind === SyntaxKind.StringKeyword) {\n // ts 'as string[]' is a compile-time-only assertion with no runtime\n // effect, and C# IList is invariant in BOTH directions: a hard\n // (IList) cast throws on the untyped core's List\n // (ccxt cs ws test lane, https://github.com/ccxt/ccxt/actions/runs/31173663316)\n // while a hard (IList) cast throws on genuinely typed\n // List values (starknet typedData via the paradex broker-id\n // leg, https://github.com/ccxt/ccxt/actions/runs/31322911365). The\n // honest emission is the bare expression, like the fallthrough below.\n return this.printNode(node.expression, identation);\n }\n }\n\n return this.printNode(node.expression, identation);\n }\n\n // A parameter of a method that participates in an override relation prints the spelling its\n // base member and every sibling override agree on (CSHARP_OVERRIDE_PARAM_TYPES; D8): C# is\n // invariant on override parameter types, so a half-retyped name is CS0115, while a name the\n printParameterType(node) {\n if (node === undefined || node.kind !== SyntaxKind.Parameter) {\n return super.printParameterType(node);\n }\n const method: any = findAncestor(node, (n) => isMethodDeclaration(n));\n const name = method === undefined || method.name === undefined ? undefined : method.name.getText().trim();\n const row = name === undefined ? undefined : CSHARP_OVERRIDE_PARAM_TYPES[name as string];\n const wanted = row === undefined ? undefined : row[method.parameters.indexOf(node)];\n if (wanted === undefined || this.csharpOverrideParamSpelling(node) !== wanted) {\n return super.printParameterType(node);\n }\n return wanted;\n }\n\n // checker spelling of a parameter the override table covers: a dictionary-shaped type (string\n // index signature, never a class instance or a callable) or an array of any/dictionary cells\n csharpOverrideParamSpelling(node): string | undefined {\n const type = this.getChecker().getTypeAtLocation(node);\n if (type === undefined || !type.isUnionType()) {\n return this.csharpOverrideParamSpellingOfType(type, 1);\n }\n const arms = type.getTypes().filter((m) => !(m.flags & (TypeFlags.Undefined | TypeFlags.Null)));\n return this.csharpOverrideParamSpellingOfType(arms[0], arms.length);\n }\n\n csharpOverrideParamSpellingOfType(type, unionArms = 1): string | undefined {\n if (type === undefined || unionArms !== 1) {\n return undefined;\n }\n if (type.flags & (TypeFlags.TypeParameter | TypeFlags.Any | TypeFlags.Unknown | TypeFlags.EnumLike)) {\n return undefined;\n }\n const checker = this.getChecker();\n if (checker.isArrayType(type) || checker.isTupleType(type)) {\n const el = (checker.getTypeArguments(type) || [])[0];\n if (el === undefined) {\n return undefined;\n }\n if (el.flags & (TypeFlags.Any | TypeFlags.Unknown)) {\n return 'IList';\n }\n return this.csharpOverrideParamSpellingOfType(el) === 'IDictionary' ? 'IList' : undefined;\n }\n if (checker.getIndexTypeOfType(type, IndexKind.String) === undefined) {\n return undefined;\n }\n const declarations = type.getSymbol()?.declarations ? type.getSymbol().declarations.map((d) => d.resolve()) : [];\n if (declarations.some((d) => d.kind === SyntaxKind.ClassDeclaration)) {\n return undefined; // a class instance is not a JSON dictionary\n }\n if (type.getCallSignatures && type.getCallSignatures().length > 0) {\n return undefined; // a callable is not a JSON dictionary\n }\n return 'IDictionary';\n }\n\n printParameter(node, defaultValue = true) {\n const name = this.printNode(node.name, 0);\n const initializer = node.initializer;\n\n const handlerType = this.csharpHandlerMessageType(node);\n if (handlerType !== undefined) {\n // the printed declaration is final, so every read of the parameter is that\n // dictionary and the member reads replace getValue/getArrayLength/inOp\n this.csharpTypedLocals.set(node, handlerType);\n }\n let type = handlerType !== undefined ? handlerType : this.printParameterType(node);\n type = type ? type : \"\";\n this.csharpParamTypes.set(node, type); // see csharpPrintedParamType\n\n if (defaultValue) {\n if (initializer) {\n const customDefaultValue = this.printCustomDefaultValueIfNeeded(initializer);\n const defaultValue = customDefaultValue ? customDefaultValue : this.printNode(initializer, 0);\n type = (defaultValue === \"null\" && type !== \"object\") ? type + \"? \": type + \" \";\n return type + name + this.SPACE_DEFAULT_PARAM + \"=\" + this.SPACE_DEFAULT_PARAM + defaultValue;\n }\n return type + \" \" + name;\n }\n return name;\n }\n\n // getFunctionType for a call site: TS7's getSignatureFromDeclaration panics on a CallExpression\n // (TS6 returned the resolved call signature there), so resolve the call itself\n csharpCallSiteFunctionType(node) {\n const checker = this.getChecker();\n const type = checker.getReturnTypeOfSignature(checker.getResolvedSignature(node));\n const parsedType = this.getTypeFromRawType(type);\n if (parsedType !== this.PROMISE_TYPE_KEYWORD) {\n return parsedType;\n }\n const typeArguments = checker.getTypeArguments(type as any);\n if (typeArguments.length === 0 || (typeArguments.length === 1 && typeArguments[0].flags === TypeFlags.Void)) {\n return this.PROMISE_TYPE_KEYWORD;\n }\n const insideTypes = typeArguments.map((t) => this.getTypeFromRawType(t)).join(\",\");\n return (insideTypes.length > 0) ? `${this.PROMISE_TYPE_KEYWORD}<${insideTypes}>` : undefined;\n }\n\n printArrayLiteralExpression(node) {\n\n let arrayOpen = this.ARRAY_OPENING_TOKEN;\n const elems = node.elements;\n\n const elements = node.elements.map((e) => this.printNode(e)).join(\", \");\n\n // take into consideration list of promises\n if (elems.length > 0) {\n const first = elems[0];\n if (first.kind === SyntaxKind.CallExpression) {\n // const type = this.getChecker().getTypeAtLocation(first);\n let type = this.csharpCallSiteFunctionType(first);\n // const parsedType = this.getTypeFromRawType(type);\n // parsedType === \"Task\" ||\n // to do check this later\n if (type === undefined || elements.indexOf(this.UKNOWN_PROP_ASYNC_WRAPPER_OPEN) > -1) {\n // if (type === undefined) {\n arrayOpen = \"new List {\";\n // }\n // else {\n // arrayOpen = \"new List> {\";\n // }\n } else {\n type = 'object';\n // check this out later\n // if (type === 'Task>') {\n // type = 'Task';\n // }\n // if (type === 'string'){\n // type = 'object';\n // }\n // type =\n arrayOpen = `new List<${type}> {`;\n }\n }\n }\n\n return arrayOpen + elements + this.ARRAY_CLOSING_TOKEN;\n }\n\n // A method declared `: boolean` / `: boolean | undefined` (or an alias of either) returns a\n // C# `bool` / `bool?` instead of `object`. Only non-async methods with an explicit annotation\n // qualify: `undefined`/`null` union members make the result nullable, any other member (or an\n // inferred type) keeps the upstream `object`. The nullable spelling is what keeps a missing\n // key a missing key — plain `bool` would turn it into `false`.\n csharpBooleanReturnType(node): string | undefined {\n if (node?.kind !== SyntaxKind.MethodDeclaration || this.isAsyncFunction(node)) {\n return undefined;\n }\n if (this.csharpBooleanReturnTypes.has(node)) {\n return this.csharpBooleanReturnTypes.get(node);\n }\n let result: string | undefined = undefined;\n if (node.type) {\n const type = this.getChecker().getTypeFromTypeNode(node.type);\n const members = type.isUnionType() ? type.getTypes() : [ type ];\n let nullable = false;\n let sawBoolean = false;\n let sawOther = false;\n for (const member of members) {\n if (member.flags & (TypeFlags.Undefined | TypeFlags.Null)) {\n nullable = true;\n } else if (member.flags & TypeFlags.BooleanLike) {\n sawBoolean = true;\n } else {\n sawOther = true;\n }\n }\n if (sawBoolean && !sawOther) {\n result = nullable ? this.BOOLEAN_KEYWORD + '?' : this.BOOLEAN_KEYWORD;\n }\n } else {\n // an un-annotated override inherits the parent's printed return type\n // (printMethodDefinition), so its returns need the same unboxing\n result = this.csharpBooleanReturnType(this.getMethodOverride(node));\n }\n this.csharpBooleanReturnTypes.set(node, result);\n return result;\n }\n\n printFunctionType(node) {\n const booleanType = this.csharpBooleanReturnType(node);\n if (booleanType !== undefined) {\n return booleanType;\n }\n return super.printFunctionType(node);\n }\n\n // `return x;` inside a bool/bool? method: the printed expression is still the `object`\n // box the rest of the printer produces, so unbox it through `object`. The nullable\n // spelling `(bool?)((object)(x))` accepts null; the non-nullable one needs the\n // null-forgiving `!` on the box (CS8605 under TreatWarningsAsErrors otherwise) — which is\n // exactly the runtime NullReferenceException a `: boolean` method returning null deserves\n printReturnStatement(node, identation) {\n // nearest function-like: a `return` inside an arrow/function expression belongs to\n // that callback, never to the enclosing bool method\n const booleanType = this.csharpBooleanReturnType(findAncestor(node.parent, isFunctionLike));\n if (booleanType === undefined || !node.expression) {\n return super.printReturnStatement(node, identation);\n }\n const leadingComment = this.printLeadingComments(node, identation);\n let trailingComment = this.printTraillingComment(node, identation);\n trailingComment = trailingComment ? \" \" + trailingComment : trailingComment;\n const value = this.printNode(node.expression, identation).trim();\n const forgiving = booleanType.endsWith('?') ? '' : '!';\n return leadingComment + this.getIden(identation) + this.RETURN_TOKEN + ` ((${booleanType})((object)(${value}))${forgiving})` + this.LINE_TERMINATOR + trailingComment;\n }\n\n printMethodDefinition(node, identation) {\n let name = node.name.text;\n name = this.transformMethodNameIfNeeded(name);\n\n let returnType = this.printFunctionType(node);\n\n let modifiers = this.printModifiers(node);\n const defaultAccess = this.METHOD_DEFAULT_ACCESS ? this.METHOD_DEFAULT_ACCESS + \" \": \"\";\n modifiers = modifiers ? modifiers + \" \" : defaultAccess; // tmp check this\n\n modifiers = modifiers.indexOf(\"public\") === -1 && modifiers.indexOf(\"private\") === -1 && modifiers.indexOf(\"protected\") === -1 ? defaultAccess + modifiers : modifiers;\n\n let parsedArgs = undefined;\n // c# only move this elsewhere (csharp transpiler)\n const methodOverride = this.getMethodOverride(node) as any;\n const isOverride = methodOverride !== undefined;\n modifiers = isOverride ? modifiers + \"override \" : modifiers + \"virtual \";\n\n // infer parent return type\n if (isOverride && (returnType === \"object\" || returnType === \"Task\")) {\n returnType = this.printFunctionType(methodOverride);\n }\n\n // ts does not infer parameters types of overriden methods :x , so we need some\n // heuristic here to infer the types\n if (isOverride && node.parameters.length > 0) {\n const first = node.parameters[0];\n const firstType = this.getType(first);\n\n if (firstType === undefined) {\n // use the override version, check this out later\n // parsedArgs = this.printMethodParameters(methodOverride);\n const currentArgs = node.parameters;\n const parentArgs = methodOverride.parameters;\n parsedArgs = parentArgs.map((param, index) => this.printParameteCustomName(param, this.printNode(currentArgs[index].name, 0))).join(\", \");\n }\n }\n\n parsedArgs = parsedArgs ? parsedArgs : this.printMethodParameters(node);\n\n returnType = returnType ? returnType + \" \" : returnType;\n\n const methodToken = this.METHOD_TOKEN ? this.METHOD_TOKEN + \" \" : \"\";\n const methodDef = this.getIden(identation) + modifiers + returnType + methodToken + name\n + \"(\" + parsedArgs + \")\";\n\n return this.printNodeCommentsIfAny(node, identation, methodDef);\n }\n\n // check this out later\n\n printArrayIsArrayCall(node, identation, parsedArg = undefined) {\n return `((${parsedArg} is IList) || (${parsedArg}.GetType().IsGenericType && ${parsedArg}.GetType().GetGenericTypeDefinition().IsAssignableFrom(typeof(List<>))))`;\n }\n\n printObjectKeysCall(node, identation, parsedArg = undefined) {\n // `Object.keys(x)` on a receiver the classifier declared a concrete dictionary: the\n // cast only named the box; `.Keys` is the same collection either way\n if ((node?.arguments?.length === 1) && this.csharpReceiverIsDeclaredDictionary(node.arguments[0])) {\n return `new List(${parsedArg}.Keys)`;\n }\n return `new List(((IDictionary)${parsedArg}).Keys)`;\n }\n\n printObjectValuesCall(node, identation, parsedArg = undefined) {\n if ((node?.arguments?.length === 1) && this.csharpReceiverIsDeclaredDictionary(node.arguments[0])) {\n return `new List(${parsedArg}.Values)`;\n }\n return `new List(((IDictionary)${parsedArg}).Values)`;\n }\n\n printJsonParseCall(node, identation, parsedArg = undefined) {\n return `parseJson(${parsedArg})`;\n }\n\n printJsonStringifyCall(node, identation, parsedArg = undefined) {\n return `json(${parsedArg})`; // make this customizable\n }\n\n printPromiseAllCall(node, identation, parsedArg = undefined) {\n return `promiseAll(${parsedArg})`;\n }\n\n printMathFloorCall(node, identation, parsedArg = undefined) {\n return `(Math.Floor(Double.Parse((${parsedArg}).ToString())))`;\n }\n\n printMathRoundCall(node, identation, parsedArg = undefined) {\n return `Math.Round(Convert.ToDouble(${parsedArg}))`;\n }\n\n printMathCeilCall(node, identation, parsedArg = undefined) {\n return `Math.Ceiling(Convert.ToDouble(${parsedArg}))`;\n }\n\n printNumberIsIntegerCall(node: any, identation: any, parsedArg?: any) {\n return `((${parsedArg} is int) || (${parsedArg} is long) || (${parsedArg} is Int32) || (${parsedArg} is Int64))`;\n }\n\n printArrayPushCall(node, identation, name = undefined, parsedArg = undefined) {\n // `x.push (v)` on a receiver whose printed declaration already IS a list needs no cast:\n // (IList)x is an identity conversion and `.Add` binds the same ICollection.Add.\n // An `object` receiver (and every receiver this printer cannot name) keeps the cast.\n if (this.csharpReceiverIsDeclaredList(node?.expression?.expression)) {\n return `${name}.Add(${parsedArg})`;\n }\n return `((IList)${name}).Add(${parsedArg})`;\n }\n\n // The C# type the emitted declaration gives a local / operand read (`string`, `List`,\n // `Dictionary`, ...), or undefined. Installed by build/csharp-local-types.js, which\n // retypes the declaration AFTER printing. Undefined by default: callers keep the helper form.\n csharpLocalTypeOf(node): string | undefined {\n return undefined;\n }\n\n // U55: the emitted C# type of an identifier operand of a null comparison, installed by\n // build/csharp-local-types.js from the PRINTED declaration lines (retyped after printing, so the\n // printer cannot see it). Undefined by default: every null comparison keeps isEqual unchanged.\n csharpNullComparisonTypeOf(node): string | undefined {\n return undefined;\n }\n\n // `add (x, y)` -> `(x + y)` when the classifier proves the LEFT operand's emitted declaration is a\n // string (U57): add(string, string) / add(string, object) compute exactly C# concatenation, nulls\n // included. Undefined keeps the helper; parenthesised because `+` binds looser in embedded text.\n csharpNativeStringConcat(left, right, leftText: string, rightText: string): string | undefined {\n return undefined;\n }\n\n // The emitted declaration type of a local read the embedding build layer retypes AFTER\n // printing (ccxt: build/csharp-local-types.js): the dict type for the `key in x` rule,\n // undefined for every receiver it does not retype. Undefined by default.\n csharpDeclaredDictReceiverType(node): string | undefined {\n return undefined;\n }\n\n // is this receiver expression, as printed, a local declared List /\n // IList? Only a bare identifier reads the type hook; a parameter (printed\n // `object`), a member read and every composite expression keep the cast.\n csharpReceiverIsDeclaredList(receiver): boolean {\n if (receiver?.kind !== SyntaxKind.Identifier) {\n return false;\n }\n const type = (typeof this.csharpLocalTypeOf === 'function') ? this.csharpLocalTypeOf(receiver) : undefined;\n return (type === 'List') || (type === 'IList');\n }\n\n printIncludesCall(node, identation, name = undefined, parsedArg = undefined) {\n return `${name}.Contains(${parsedArg})`;\n }\n\n // `x.indexOf (y)` prints `x`'s own member when the printer proves the receiver holds a\n // string or a list at this read and can name that C# type; every other receiver keeps the\n // runtime getIndexOf helper, which is the only form that answers -1 for a null box.\n printIndexOfCall(node, identation, name = undefined, parsedArg = undefined) {\n const native = this.csharpNativeIndexOfCall(node, name, parsedArg);\n if (native !== undefined) {\n return native;\n }\n return `${this.INDEXOF_WRAPPER_OPEN}${name}, ${parsedArg}${this.INDEXOF_WRAPPER_CLOSE}`;\n }\n\n // the helper's `(string)` branch spelled natively: `((string)x).IndexOf(needle, Ordinal)` is\n // the ordinal scan TS indexOf performs (not-found stays -1, an empty needle stays 0); a\n // `List` local takes its own IndexOf, a possibly-null box keeps the helper\n csharpNativeIndexOfCall(node, name = undefined, parsedArg = undefined): string | undefined {\n const receiver = node?.expression?.expression;\n if (receiver === undefined || name === undefined) {\n return undefined;\n }\n const declared = this.csharpExpressionTypeOf(receiver);\n if (this.csharpIndexOfReceiverHoldsString(node, receiver, declared)) {\n const needle = this.csharpNativeIndexOfNeedle(node.arguments?.[0], parsedArg);\n if (needle === undefined) {\n return undefined;\n }\n // the helper's own `((string)str)` cast; a cast the printer already emitted is final\n const casted = name.startsWith('((string)') ? name : `((string)${name})`;\n return `${casted}.IndexOf(${needle}, StringComparison.Ordinal)`;\n }\n if ((declared === 'List') || (declared === 'IList')) {\n return `((${declared})${name}).IndexOf(${parsedArg})`;\n }\n // a `string?` local holds a string or null: `?.` answers the helper's -1 for null; the\n // needle is a literal or a local, so skipping its evaluation on null changes nothing\n const key = node.arguments?.[0];\n const plainNeedle = (key !== undefined) && (isStringLiteralLikeNode(key) || isIdentifier(key));\n if ((declared === 'string?') && isIdentifier(receiver) && plainNeedle) {\n const needle = this.csharpNativeIndexOfNeedle(node.arguments?.[0], parsedArg);\n if (needle !== undefined) {\n return `(${name}?.IndexOf(${needle}, StringComparison.Ordinal) ?? -1)`;\n }\n }\n return undefined;\n }\n\n // the receiver is a string the helper would scan and no null can reach the read: a C#\n // `string` declaration, a checker `string`/literal whose own declaration is a plain\n // non-optional `string` (`as string` included), or a value a `!== undefined` test admits\n csharpIndexOfReceiverHoldsString(node, receiver, declared): boolean {\n if (declared === 'string') {\n return true;\n }\n if ((declared !== undefined) && (declared !== 'string?')) {\n return false; // a named C# type that is not a string\n }\n if (!this.csharpIndexOfReceiverIsCheckedString(receiver)) {\n return false;\n }\n return this.csharpNullGuardAdmitsRead(node, receiver) || ((declared === undefined) && this.csharpReceiverDeclaredNonNullString(receiver));\n }\n\n // the checker's view of the receiver: exactly `string` / a string literal. `any` (could box\n // anything) and `string[]` (boxes a List where the helper casts its target) are not\n csharpIndexOfReceiverIsCheckedString(receiver): boolean {\n const checker: any = this.checkerOrUndefined();\n if (checker === undefined) {\n return false; // in-memory program without a checker\n }\n const type = checker.getTypeAtLocation(receiver);\n return this.isStringType(type?.flags);\n }\n\n // the receiver's own declaration says non-optional `string` (params, fields, locals), or the\n // source pinned a string itself (a literal, an `as string` assertion). The `Str` alias and\n // `= undefined` fields hold the undefined the helper answers -1 for: they need the guard\n csharpReceiverDeclaredNonNullString(receiver): boolean {\n const kind = receiver?.kind;\n if ((kind === SyntaxKind.StringLiteral) || (kind === SyntaxKind.NoSubstitutionTemplateLiteral)) {\n return true;\n }\n if (kind === SyntaxKind.ParenthesizedExpression) {\n return this.csharpReceiverDeclaredNonNullString(receiver.expression);\n }\n if ((kind === SyntaxKind.AsExpression) && (receiver.type?.kind === SyntaxKind.StringKeyword)) {\n return true; // the source itself pinned a string here\n }\n const checker: any = this.checkerOrUndefined();\n if (checker === undefined) {\n return false;\n }\n const symbol = checker.getSymbolAtLocation(receiver);\n const declarations: any[] = (symbol?.declarations ?? []).map((d) => d.resolve());\n return (declarations.length > 0) && declarations.every((declaration) => this.csharpDeclarationIsNonNullString(declaration));\n }\n\n csharpDeclarationIsNonNullString(declaration): boolean {\n const annotation: any = declaration?.type;\n if (declaration?.kind === SyntaxKind.Parameter) {\n return (declaration.questionToken === undefined) && (declaration.dotDotDotToken === undefined)\n && ((annotation?.kind === SyntaxKind.StringKeyword) || ((annotation === undefined) && isStringLiteralLikeNode(declaration.initializer)));\n }\n const isField = isPropertyDeclaration(declaration) || isPropertySignatureDeclaration(declaration);\n if (isVariableDeclaration(declaration) || isField) {\n if ((declaration as any).questionToken !== undefined) {\n return false;\n }\n if (annotation !== undefined) {\n // `apiKey: string = undefined` holds undefined until the credentials are set\n return (annotation.kind === SyntaxKind.StringKeyword) && !this.csharpInitializerIsUndefined((declaration as any).initializer);\n }\n return isStringLiteralLikeNode((declaration as any).initializer);\n }\n return false;\n }\n\n csharpInitializerIsUndefined(initializer): boolean {\n return (initializer?.kind === SyntaxKind.NullKeyword)\n || ((initializer?.kind === SyntaxKind.Identifier) && (initializer.text === 'undefined'));\n }\n\n // a `x !== undefined` / `x !== null` (or `!= null`) test in a branch that admits the read:\n // inside the right operand of its `&&`, inside the then-branch of its `if`, or after an\n // early-exiting `if (x === undefined) { return/throw/continue/break }`\n csharpNullGuardAdmitsRead(node, receiver): boolean {\n if (!isIdentifier(receiver)) {\n return false;\n }\n const checker: any = this.checkerOrUndefined();\n if (checker === undefined) {\n return false;\n }\n const symbol = checker.getSymbolAtLocation(receiver);\n if (symbol === undefined) {\n return false;\n }\n const scope = this.csharpEnclosingFunction(node);\n let current: any = node;\n while (current !== undefined) {\n const parent: any = current.parent;\n if (parent === undefined) {\n return false;\n }\n if ((parent.kind === SyntaxKind.BinaryExpression) && (parent.operatorToken.kind === SyntaxKind.AmpersandAmpersandToken)\n && this.csharpContains(parent.right, current) && this.csharpTestIsNonNullCheck(parent.left, symbol, true)) {\n return true;\n }\n if (parent.kind === SyntaxKind.IfStatement) {\n if (this.csharpContains(parent.thenStatement, current) && this.csharpTestIsNonNullCheck(parent.expression, symbol, true)) {\n return true;\n }\n if (this.csharpContains(parent.elseStatement, current) && this.csharpTestIsNonNullCheck(parent.expression, symbol, false)) {\n return true;\n }\n }\n if ((isBlock(parent) || isSourceFile(parent)) && this.csharpEarlyExitNonNullGuarded(parent, current, symbol, scope)) {\n return true;\n }\n if (this.csharpIsFunctionLike(parent)) {\n return false; // a guard outside this function cannot dominate a read inside it\n }\n current = parent;\n }\n return false;\n }\n\n csharpIsFunctionLike(node): boolean {\n switch (node?.kind) {\n case SyntaxKind.MethodDeclaration:\n case SyntaxKind.FunctionDeclaration:\n case SyntaxKind.FunctionExpression:\n case SyntaxKind.ArrowFunction:\n case SyntaxKind.Constructor:\n return true;\n }\n return false;\n }\n\n // `if (x === undefined) { return/throw/... }` (or the same test with an exiting else) in the\n // same block, with no write to x in between: every statement after it runs with x bound\n csharpEarlyExitNonNullGuarded(block, statement, symbol, scope): boolean {\n for (const sibling of block.statements) {\n if (sibling.getStart() >= statement.getStart()) {\n return false;\n }\n if (!isIfStatement(sibling)) {\n continue;\n }\n const exitsOnNull = this.csharpTestIsNonNullCheck(sibling.expression, symbol, false) && this.csharpAlwaysExits(sibling.thenStatement);\n const continuesOnNonNull = this.csharpTestIsNonNullCheck(sibling.expression, symbol, true) && this.csharpAlwaysExits(sibling.elseStatement);\n if ((exitsOnNull || continuesOnNonNull) && !this.csharpReceiverWrittenBetween(scope, sibling.getEnd(), statement.getStart(), symbol)) {\n return true;\n }\n }\n return false;\n }\n\n // the test proves the binding non-null when it evaluates to `truthy`: `x != null`, `x !==\n // undefined` (either operand order), and both sides of an `&&` (a false `||`). Everything\n // else — `any` comparisons, a different binding — proves nothing\n csharpTestIsNonNullCheck(test, symbol, truthy): boolean {\n switch (test?.kind) {\n case SyntaxKind.ParenthesizedExpression:\n return this.csharpTestIsNonNullCheck(test.expression, symbol, truthy);\n case SyntaxKind.PrefixUnaryExpression:\n return (test.operator === SyntaxKind.ExclamationToken) && this.csharpTestIsNonNullCheck(test.operand, symbol, !truthy);\n case SyntaxKind.BinaryExpression: {\n const op = test.operatorToken.kind;\n if (op === SyntaxKind.AmpersandAmpersandToken) {\n return truthy && (this.csharpTestIsNonNullCheck(test.left, symbol, true) || this.csharpTestIsNonNullCheck(test.right, symbol, true));\n }\n if (op === SyntaxKind.BarBarToken) {\n return !truthy && (this.csharpTestIsNonNullCheck(test.left, symbol, false) || this.csharpTestIsNonNullCheck(test.right, symbol, false));\n }\n const inequality = (op === SyntaxKind.ExclamationEqualsToken) || (op === SyntaxKind.ExclamationEqualsEqualsToken);\n const isNullTest = (op === SyntaxKind.EqualsEqualsToken) || (op === SyntaxKind.EqualsEqualsEqualsToken) || inequality;\n if (!isNullTest || (truthy !== inequality)) {\n return false;\n }\n const tested = isIdentifier(test.left) ? test.left : test.right;\n const literal = isIdentifier(test.left) ? test.right : test.left;\n return isIdentifier(tested) && this.csharpInitializerIsUndefined(literal) && this.csharpSameBinding(tested, symbol);\n }\n }\n return false;\n }\n\n csharpSameBinding(node, symbol): boolean {\n try {\n const resolved = this.getChecker().getSymbolAtLocation(node);\n return (resolved !== undefined) && (resolved === symbol);\n } catch (e) {\n return false;\n }\n }\n\n // any write to the same binding inside the window voids a dominance proof\n csharpReceiverWrittenBetween(scope, from: number, to: number, symbol): boolean {\n if (scope === undefined) {\n return true;\n }\n let written = false;\n const visit = (n: any) => {\n if (written || (n.getStart() >= to) || (n.getEnd() <= from)) {\n return;\n }\n if (isIdentifier(n) && this.csharpIsWriteTarget(n) && this.csharpSameBinding(n, symbol)) {\n written = true;\n return;\n }\n n.forEachChild(visit);\n };\n scope.forEachChild(visit);\n return written;\n }\n\n // the C# string the native `IndexOf` takes as its needle: a value the printer types a C#\n // string prints as-is, an `object`-printed operand takes the helper's own `(string)` cast.\n // A value of any other named C# type (number, bool, collection) keeps the helper\n csharpNativeIndexOfNeedle(key, printed = undefined): string | undefined {\n if (key === undefined || printed === undefined) {\n return undefined;\n }\n const keyType = this.csharpExpressionTypeOf(key);\n if (keyType === 'string') {\n return printed;\n }\n return ((keyType === undefined) || (keyType === 'string?')) ? `((string)${printed})` : undefined;\n }\n\n printSearchCall(node, identation, name = undefined, parsedArg = undefined) {\n return `((string)${name}).IndexOf(${parsedArg})`;\n }\n\n printStartsWithCall(node, identation, name = undefined, parsedArg = undefined) {\n return `((string)${name}).StartsWith(((string)${parsedArg}))`;\n }\n\n printEndsWithCall(node, identation, name = undefined, parsedArg = undefined) {\n return `((string)${name}).EndsWith(((string)${parsedArg}))`;\n }\n\n printTrimCall(node, identation, name = undefined) {\n return `${this.csharpStringMethodReceiver(node, name)}.Trim()`;\n }\n\n printJoinCall(node, identation, name = undefined, parsedArg = undefined) {\n return `String.Join(${parsedArg}, ((IList)${name}).ToArray())`;\n }\n\n printSplitCall(node, identation, name = undefined, parsedArg = undefined) {\n return `${this.csharpStringMethodReceiver(node, name)}.Split(new [] {((string)${parsedArg})}, StringSplitOptions.None).ToList()`;\n }\n\n printConcatCall(node, identation, name = undefined, parsedArg = undefined) {\n return `concat(${name}, ${parsedArg})`;\n }\n\n printToFixedCall(node, identation, name = undefined, parsedArg = undefined) {\n return `toFixed(${name}, ${parsedArg})`;\n }\n\n printToStringCall(node, identation, name = undefined) {\n return `((object)${name}).ToString()`;\n }\n\n printToUpperCaseCall(node, identation, name = undefined) {\n return `${this.csharpStringMethodReceiver(node, name)}.ToUpper()`;\n }\n\n printToLowerCaseCall(node, identation, name = undefined) {\n return `${this.csharpStringMethodReceiver(node, name)}.ToLower()`;\n }\n\n printShiftCall(node, identation, name = undefined) {\n return `((IList)${name}).First()`;\n }\n\n printReverseCall(node, identation, name = undefined) {\n return `${name} = (${name} as IList).Reverse().ToList()`;\n }\n\n printPopCall(node, identation, name = undefined) {\n return `((IList)${name}).Last()`;\n }\n\n printSliceCall(node, identation, name = undefined, parsedArg = undefined, parsedArg2 = undefined) {\n const nativeCall = this.csharpNativeSliceCall(node, name);\n if (nativeCall !== undefined) {\n return nativeCall;\n }\n if (parsedArg2 === undefined){\n // return `((string)${name}).Substring((int)${parsedArg})`;\n parsedArg2 = 'null';\n }\n // return `((string)${name})[((int)${parsedArg})..((int)${parsedArg2})]`;\n return `slice(${name}, ${parsedArg}, ${parsedArg2})`;\n }\n\n // `x.slice (a, b)` -> Substring / GetRange when x is a checker-proven string (or a printer-declared\n // `List`) and every bound is an integer literal: JS clamps bounds into [0, length] where C#\n // throws, so literals are clamped with Math.Min / Math.Max. Anything unproven keeps the helper.\n csharpNativeSliceCall(node, name) {\n const args = node?.arguments ?? [];\n if ((args.length < 1) || (args.length > 2)) {\n return undefined;\n }\n const start = this.csharpSliceLiteralBound(args[0]);\n if (start === undefined) {\n return undefined;\n }\n const hasEnd = args.length === 2;\n const end = hasEnd ? this.csharpSliceLiteralBound(args[1]) : undefined;\n if (hasEnd && (end === undefined)) {\n return undefined;\n }\n // x.slice (a, b) prints through this method for the CALL, so the receiver is `.expression.expression`\n const receiver = isPropertyAccessExpression(node?.expression) ? node.expression.expression : undefined;\n if (!this.csharpSliceReceiverIsSideEffectFree(receiver)) {\n return undefined;\n }\n const kind = this.csharpSliceReceiverKind(receiver);\n if (kind === undefined) {\n return undefined;\n }\n const isString = (kind === 'string');\n // `(id as string)` already prints `((string)id)`: a second cast would only add parens\n const cast = (isString && name.startsWith('((string)')) ? name : `((${isString ? 'string' : 'List'})${name})`;\n const length = `${cast}.${isString ? 'Length' : 'Count'}`;\n const from = this.csharpSliceBoundExpression(start, length);\n // the null guard reproduces the helper's null -> null result for a null receiver; the\n // whole emission is parenthesised because a ternary binds looser than the `+` / `+` chain\n // the printer may wrap this call in\n const guard = `(${this.csharpNullComparison(name, true)} ? null : `;\n const method = isString ? 'Substring' : 'GetRange';\n if (!hasEnd) {\n // the open end is the length itself: `Substring (from)` and `GetRange (from, length - from)`\n const open = isString ? `Substring(${from})` : `GetRange(${from}, ${from === '0' ? length : `${length} - ${from}`})`;\n return `${guard}${cast}.${open})`;\n }\n const to = this.csharpSliceBoundExpression(end, length);\n // from <= to is proven per case: 0 is never above a clamp, and two literals clamp\n // monotonically once they keep their order (non-negative, or both counting from the end)\n const ordered = (start === 0) || ((start >= 0) && (end >= 0) && (start <= end)) || ((start < 0) && (end < 0) && (start <= end));\n let count;\n if (from === to) {\n count = '0'; // two bounds that clamp to the same index: an empty result\n } else if (from === '0') {\n count = to; // from 0: the clamped end IS the count\n } else {\n // an inverted pair yields an empty slice in JS, so the count never goes below 0\n count = ordered ? `${to} - ${from}` : `Math.Max(${to} - ${from}, 0)`;\n }\n return `${guard}${cast}.${method}(${from}, ${count}))`;\n }\n\n // Integer value of a slice bound that is an integer literal (`18`, `-64`); anything\n // else (expression, float, exponent, out of int range) keeps the helper — the bounds\n // are clamped with the integer Math.Min / Math.Max of the native form.\n csharpSliceLiteralBound(node) {\n if (node === undefined) {\n return undefined;\n }\n if (isNumericLiteral(node)) {\n const text = String(node.text);\n if ((text.indexOf('.') !== -1) || (text.indexOf('e') !== -1) || (text.indexOf('E') !== -1)) {\n return undefined;\n }\n const value = Number(text);\n return value <= 2147483647 ? value : undefined;\n }\n if (isPrefixUnaryExpression(node) && (node.operator === SyntaxKind.MinusToken)) {\n const inner = this.csharpSliceLiteralBound(node.operand);\n return inner === undefined ? undefined : -inner;\n }\n return undefined;\n }\n\n // JS slice clamps a literal bound into [0, length]: a non-negative bound is min\n // (bound, length), a negative one counts from the end (max (length - |bound|, 0)).\n // `0` stays `0` because the length of a string / list is never negative.\n csharpSliceBoundExpression(value, length) {\n if (value === 0) {\n return '0';\n }\n return value > 0 ? `Math.Min(${value}, ${length})` : `Math.Max(${length} - ${-value}, 0)`;\n }\n\n // The receiver of a native slice: a `List` the printer / build layer declared (the only\n // receiver with GetRange), or a CHECKER-proven string (`string`, a literal, or a union with\n // null / undefined such as ccxt's `Str`); `any`, Dict and every other type keep the helper.\n csharpSliceReceiverKind(expression) {\n // a declared `List` (printer table or the embedding build layer's retype) is the\n // only receiver carrying a native bounding accessor, GetRange\n const declared = (isIdentifier(expression) ? this.csharpTypedLocalType(expression) : undefined) ?? this.csharpExpressionTypeOf(expression);\n if (declared === 'List') {\n return 'list';\n }\n const checker: any = this.checkerOrUndefined();\n if (checker === undefined) {\n return undefined;\n }\n const type = checker.getTypeAtLocation(expression);\n return this.csharpSliceStringType(type) ? 'string' : undefined;\n }\n\n // the checker's string view of a slice receiver: a string type, or a union of string\n // members and nullish ones only. `boolean | string`, `any` and every unproven shape fail\n csharpSliceStringType(type): boolean {\n if (this.isStringType(type?.flags)) {\n return true;\n }\n if (type?.flags !== TypeFlags.Union) {\n return false;\n }\n const members = type.getTypes?.() ?? [];\n return (members.length > 0) && members.every((member) => this.isStringType(member.flags)\n || (member.flags === TypeFlags.Undefined) || (member.flags === TypeFlags.Null));\n }\n\n // True for receivers that read a value without calling anything: `x`, `x.y`, `this.x`,\n // `(x as string)` and parenthesised forms of those. Guards the repeated receiver read —\n // the clamp reads `Length` / `Count` and the call itself reads the receiver again.\n csharpSliceReceiverIsSideEffectFree(expression): boolean {\n if (expression === undefined) {\n return false;\n }\n if (isIdentifier(expression) || (expression.kind === SyntaxKind.ThisKeyword)) {\n return true;\n }\n if (isParenthesizedExpression(expression) || isAsExpression(expression) || isTypeAssertion(expression)\n || isPropertyAccessExpression(expression)) {\n return this.csharpSliceReceiverIsSideEffectFree(expression.expression);\n }\n return false;\n }\n\n printReplaceCall(node, identation, name = undefined, parsedArg = undefined, parsedArg2 = undefined) {\n return `${this.csharpStringMethodReceiver(node, name)}.Replace((string)${parsedArg}, (string)${parsedArg2})`;\n }\n\n printReplaceAllCall(node, identation, name = undefined, parsedArg = undefined, parsedArg2 = undefined) {\n return `${this.csharpStringMethodReceiver(node, name)}.Replace((string)${parsedArg}, (string)${parsedArg2})`;\n }\n\n printPadEndCall(node, identation, name, parsedArg, parsedArg2) {\n return `(${name} as String).PadRight(Convert.ToInt32(${parsedArg}), Convert.ToChar(${parsedArg2}))`;\n }\n\n printPadStartCall(node, identation, name, parsedArg, parsedArg2) {\n return `(${name} as String).PadLeft(Convert.ToInt32(${parsedArg}), Convert.ToChar(${parsedArg2}))`;\n }\n\n printDateNowCall(node, identation) {\n return \"(new DateTimeOffset(DateTime.UtcNow)).ToUnixTimeMilliseconds()\";\n }\n\n printLengthProperty(node, identation, name = undefined) {\n const leftSide = this.printNode(node.expression, 0);\n const type = (this.getChecker() as Checker).getTypeAtLocation(node.expression); // eslint-disable-line\n this.warnIfAnyType(node, type.flags, leftSide, \"length\");\n return this.isStringType(type.flags) ? `${this.csharpStringMethodReceiver(node, leftSide)}.Length` : (this.csharpNativeLengthExpression(node.expression) ?? `${this.ARRAY_LENGTH_WRAPPER_OPEN}${leftSide}${this.ARRAY_LENGTH_WRAPPER_CLOSE}`);\n }\n\n // A for-header incrementor discards the postfix value, so an operand whose printed C# type is `int`\n // takes the native operator: the same unchecked +1 / -1 as the (ref int) helper twin. Any other\n // operand keeps the helper, whose overload set binds an `object` counter.\n csharpNativePostFixIncrement(node): boolean {\n if (node.operand?.kind !== SyntaxKind.Identifier) {\n return false;\n }\n const parent = node.parent;\n if (parent?.kind !== SyntaxKind.ForStatement || parent.incrementor !== node) {\n return false;\n }\n return this.csharpExpressionTypeOf(node.operand) === 'int';\n }\n\n printPostFixUnaryExpression(node, identation) {\n const {operand, operator} = node;\n if (operand.kind === SyntaxKind.NumericLiteral) {\n return super.printPostFixUnaryExpression(node, identation);\n }\n const leftSide = this.printNode(operand, 0);\n const op = this.PostFixOperators[operator]; // todo: handle --\n if (this.csharpNativePostFixIncrement(node)) {\n return `${leftSide}${op}`;\n }\n return (op === '--') ? `postFixDecrement(ref ${leftSide})` : `postFixIncrement(ref ${leftSide})`;\n }\n\n printPrefixUnaryExpression(node, identation) {\n const {operand, operator} = node;\n if (operand.kind === SyntaxKind.NumericLiteral) {\n return super.printPrefixUnaryExpression(node, identation);\n }\n if (operator === SyntaxKind.ExclamationToken) {\n // not branch check falsy/turthy values if needed;\n const nativeNot = this.csharpNegatedConditionOperand(operand);\n if (nativeNot !== undefined) {\n return nativeNot;\n }\n return this.PrefixFixOperators[operator] + this.printCondition(node.operand, 0);\n }\n const leftSide = this.printNode(operand, 0);\n if (operator === SyntaxKind.PlusToken) {\n return `prefixUnaryPlus(ref ${leftSide})`;\n }\n const nativeNegation = this.csharpNativeNegatedLocal(operand, leftSide) ?? this.csharpHx4NativeNegatedNullableLocal(node, leftSide);\n if (nativeNegation !== undefined) {\n return nativeNegation;\n }\n return `prefixUnaryNeg(ref ${leftSide})`;\n }\n\n // `isTrue(x)` is the identity function on a C# bool (`isTrue` returns a bool unchanged),\n // so the wrapper is only needed for values the printer leaves boxed as `object`. Every\n // shape below is rendered as a C# bool by the printer itself; anything else keeps the helper.\n csharpConditionPrintsBool(node): boolean {\n switch (node?.kind) {\n case SyntaxKind.TrueKeyword:\n case SyntaxKind.FalseKeyword:\n return true; // `true` / `false`\n case SyntaxKind.ParenthesizedExpression:\n return this.csharpConditionPrintsBool(node.expression);\n case SyntaxKind.PrefixUnaryExpression:\n // `!x` prints `!isTrue(x)`, and printCondition always returns a bool\n return node.operator === SyntaxKind.ExclamationToken;\n case SyntaxKind.BinaryExpression:\n return this.csharpBinaryExpressionPrintsBool(node);\n case SyntaxKind.Identifier:\n return this.csharpIdentifierPrintsBool(node);\n case SyntaxKind.PropertyAccessExpression:\n return this.csharpFieldPrintsBool(node);\n case SyntaxKind.CallExpression:\n return this.csharpCallPrintsBool(node);\n }\n return false;\n }\n\n // `this.` reads of the hand-written BaseExchange bool fields: the field is declared\n // `bool` there, so a checker-typed plain boolean read is a C# bool the condition can use bare\n csharpFieldPrintsBool(node): boolean {\n if (node.expression?.kind !== SyntaxKind.ThisKeyword) {\n return false;\n }\n return (CSHARP_NATIVE_BOOL_FIELDS.indexOf(node.name?.text as string) >= 0) && this.csharpIsCheckedBoolean(node);\n }\n\n // isEqual / !isEqual / isGreaterThan / ... / inOp all have a C# `bool` signature, a\n // `&&` / `||` prints both operands through printCondition, i.e. as bool themselves, and\n // `x instanceof T` prints the C# type test ` is `, itself a bool\n csharpBinaryExpressionPrintsBool(node): boolean {\n switch (node.operatorToken.kind) {\n case SyntaxKind.EqualsEqualsToken:\n case SyntaxKind.EqualsEqualsEqualsToken:\n case SyntaxKind.ExclamationEqualsToken:\n case SyntaxKind.ExclamationEqualsEqualsToken:\n case SyntaxKind.GreaterThanToken:\n case SyntaxKind.GreaterThanEqualsToken:\n case SyntaxKind.LessThanToken:\n case SyntaxKind.LessThanEqualsToken:\n case SyntaxKind.InKeyword:\n case SyntaxKind.InstanceOfKeyword:\n case SyntaxKind.BarBarToken:\n case SyntaxKind.AmpersandAmpersandToken:\n return true;\n }\n return false;\n }\n\n // the checker sees a value that is exactly boolean; `boolean | undefined` is a\n // TypeFlags.Union here and is therefore rejected (`bool?` is no condition in C#)\n csharpIsCheckedBoolean(node): boolean {\n const type = this.getChecker().getTypeAtLocation(node);\n return ((type?.flags ?? 0) & TypeFlags.BooleanLike) !== 0;\n }\n\n // `bool name = ...` is only declared when getCSharpLocalType resolved that exact\n // declaration to `bool`, so ask the same function: the condition and the declaration\n // cannot disagree. Parameters, members and demoted locals return `object` there. The\n // embedding layer's resolver (ccxt: build/csharp-local-types.js) retypes locals the\n // printer cannot name itself and reports the type the printed declaration carries, so a\n // `bool` there is the same proof for a declaration this printer did not write\n csharpIdentifierPrintsBool(node): boolean {\n if (!this.csharpIsCheckedBoolean(node)) {\n return false;\n }\n if (this.csharpExpressionTypeOf(node) === 'bool') {\n return true;\n }\n const declaration = this.getChecker().getSymbolAtLocation(node)?.valueDeclaration?.resolve();\n if (declaration === undefined || !isVariableDeclaration(declaration) || declaration.name?.kind !== SyntaxKind.Identifier) {\n return false;\n }\n if (!this.csharpLocalTypes.has(declaration)) {\n this.csharpLocalTypes.set(declaration, this.getCSharpLocalType(declaration));\n }\n return this.csharpLocalTypes.get(declaration) === 'bool';\n }\n\n // the printed callee text of a method call the printer can name statically: `this.` and\n // `.`. A deeper receiver (`a.b.c(...)`) or a plain function call stays undefined —\n // the hand-written-callee proof must know exactly which callee the emitted text binds\n csharpCalleeName_Native(node): string | undefined {\n const expression = node?.expression;\n if (expression?.kind !== SyntaxKind.PropertyAccessExpression) {\n return undefined;\n }\n const receiver = expression.expression;\n const name = expression.name?.text as string;\n if (receiver?.kind === SyntaxKind.ThisKeyword) {\n return 'this.' + name;\n }\n if (receiver?.kind === SyntaxKind.Identifier) {\n return (receiver.text as string) + '.' + name;\n }\n return undefined;\n }\n\n // cs-14: `isTrue()` goes bare when the call's own C# signature is non-nullable `bool`: (a)\n // hand-written cs/ccxt/base callees (CSHARP_BOOL_CALLEES_NATIVE), (b) `this.(...)` printed by\n // the same csharpBooleanReturnType. Hand-written overrides and `callDynamically` keep the wrapper.\n csharpBoolCall_Native(node): boolean {\n const callee = this.csharpCalleeName_Native(node);\n if (callee !== undefined && CSHARP_BOOL_CALLEES_NATIVE[callee] === true) {\n return true;\n }\n return this.csharpGeneratedThisCallBoolType_Native(node, callee) === 'bool';\n }\n\n // csharpBooleanReturnType of a generator-printed `this.(...)` callee, else undefined\n csharpGeneratedThisCallBoolType_Native(node, callee: string | undefined): string | undefined {\n if (callee === undefined || callee.indexOf('this.') !== 0) {\n return undefined;\n }\n if (CSHARP_HANDWRITTEN_CALLEES_NATIVE.indexOf(callee.substring('this.'.length)) > -1) {\n return undefined;\n }\n if (!this.csharpCalleeResolves(node)) {\n return undefined;\n }\n const declaration: any = this.getChecker().getResolvedSignature(node)?.declaration?.resolve();\n // a bodiless overload signature (`safeBool (…, defaultValue: boolean): boolean` next to a\n // `boolean | undefined` implementation) states only that overload's type, while C# binds\n // the single implementation: its `bool?` must not lose the wrapper\n if (declaration?.kind !== SyntaxKind.MethodDeclaration || declaration.body === undefined) {\n return undefined;\n }\n return this.csharpBooleanReturnType(declaration);\n }\n\n // calls the printer gives a concrete bool signature (inArray, valueIsDefined, startsWith,\n // Array.isArray, ...); safeBool and friends are `bool?` / `object` and keep the wrapper\n csharpCallPrintsBool(node): boolean {\n return this.csharpIsCheckedBoolean(node) && ((this.csharpCallReturnType(node) === 'bool') || this.csharpBoolCall_Native(node));\n }\n\n // The declared type of an identifier read: build layer's proof first, then this printer's table;\n // `var`/`object` mean \"no type\". `isTrue (x)` answers false for a null box, exactly the lifted\n // `x == true` on a `bool?`. Only reads declared `bool?` qualify; every other shape keeps helper.\n csharpNullableBoolCondition(node): string | undefined {\n let value = node;\n while (value?.kind === SyntaxKind.ParenthesizedExpression) {\n value = value.expression;\n }\n // the resolver arm: a declaration the embedding build layer retyped itself — the parameter/override\n // signatures the typed-param units print: the recorded type IS the emitted\n // declaration's, so a `bool?` parameter is no C# condition either\n const nullable = (value?.kind === SyntaxKind.Identifier)\n ? (this.csharpDeclaredLocalType(value) === 'bool?' || this.csharpDeclaredLocalResolverType(value) === 'bool?')\n : ((value?.kind === SyntaxKind.CallExpression) && this.csharpCallPrintsNullableBool(value));\n return nullable ? `(${this.printNode(value, 0)} == true)` : undefined;\n }\n\n // a call whose printed C# signature is `bool?`: the `bool? safeBool(...)` family of the\n // hand-written base (CSHARP_THIS_RETURN_TYPES, which names that signature), and a\n // `this.(...)` whose TS declaration the generator itself prints — definition and call\n csharpCallPrintsNullableBool(node): boolean {\n if (this.csharpCallReturnType(node) === 'bool?') {\n return true;\n }\n return this.csharpGeneratedThisCallBoolType_Native(node, this.csharpCalleeName_Native(node)) === 'bool?';\n }\n\n // same emission as the base implementation except for the bare-bool branch: the node is\n // printed once and only wrapped in isTrue(...) when the printer did not already render a bool\n //\n // the single `printCondition` override, rules layered strongest-proof-first over the base\n // body (the untyped fallback at the bottom):\n // S61 -- bare `isTrue (x)` in an if / while / && / || / ! condition: the operand is already\n // the `bool` (or `bool?`) the helper computes, so the wrapper adds nothing (the gate is the\n // csharpConditionPositionAllowsNative / csharpNativeCondition pair, never a name shape).\n // S62 -- a condition whose printed text is already a C# `bool` helper call\n // (csharpPrintedConditionIsBoolean) needs no wrapper either; the same identity proven from\n // the printed form rather than from the declaration.\n // #82 -- csharpConditionPrintsBool folds the wrapper on the node shapes the printer itself\n // renders as a bool, with csharpConditionParensIfNeeded keeping the `&&` / `||` precedence.\n printCondition(node, identation) {\n if (this.supportsFalsyOrTruthyValues) {\n return this.printNode(node, identation);\n }\n // can be called from ifs or conditional expressions or binary expressions so might contain the ! operator\n if (node?.kind === SyntaxKind.PrefixUnaryExpression && node.operator === SyntaxKind.ExclamationToken) {\n return this.printPrefixUnaryExpression(node, identation); // avoid infinite recursion\n }\n const nullableBool = this.csharpNullableBoolCondition(node);\n if (nullableBool !== undefined) {\n return `${this.getIden(identation)}${nullableBool}`;\n }\n const native = this.csharpConditionPositionAllowsNative(node) ? this.csharpNativeCondition(node, identation) : undefined;\n if (native !== undefined) {\n return native;\n }\n const printed = this.printNode(node, 0);\n if (this.csharpConditionPrintsBool(node)) {\n return `${this.getIden(identation)}${this.csharpConditionParensIfNeeded(node, printed)}`;\n }\n // `isTrue(X)` is the identity on a printed C# bool (Exchange.TranspileHelpers.cs:\n // `isTrue(object)` returns `(bool)value`, and normalizeIntIfNeeded is a no-op on bools),\n // so the wrapper is dropped when the node already prints as one\n if (this.csharpPrintedConditionIsBoolean(printed)) {\n return `${this.getIden(identation)}${printed}`;\n }\n return `${this.getIden(identation)}${this.FALSY_WRAPPER_OPEN}${printed}${this.FALSY_WRAPPER_CLOSE}`;\n }\n\n // dropping the wrapper exposes the `&&` / `||` / `is` of the node, so the bare text needs its own\n // parentheses where C# binds tighter than the JS it replaces: under `!` (which binds tighter\n // than both), and a `||` that becomes an operand of a `&&` (`(a || b) && c` must not flatten\n // to `a || b && c`). A type test additionally needs them under the `(bool)` cast the\n // conditional-expression printer prepends (`(bool) x is T` would bind as `((bool) x) is T`).\n // Source parentheses, when present, already come out in `printed`.\n csharpConditionParensIfNeeded(node, printed: string): string {\n if (node?.kind !== SyntaxKind.BinaryExpression) {\n return printed;\n }\n const op = node.operatorToken.kind;\n const parent = node.parent;\n const underNot = parent?.kind === SyntaxKind.PrefixUnaryExpression && parent.operator === SyntaxKind.ExclamationToken;\n if (op === SyntaxKind.InstanceOfKeyword) {\n const underCast = parent?.kind === SyntaxKind.ConditionalExpression && parent.condition === node;\n return (underNot || underCast) ? `(${printed})` : printed;\n }\n if (op !== SyntaxKind.BarBarToken && op !== SyntaxKind.AmpersandAmpersandToken) {\n return printed;\n }\n const underAnd = op === SyntaxKind.BarBarToken && parent?.kind === SyntaxKind.BinaryExpression\n && parent.operatorToken.kind === SyntaxKind.AmpersandAmpersandToken;\n return (underNot || underAnd) ? `(${printed})` : printed;\n }\n\n printConditionalExpression(node, identation) {\n const condition = this.printTernaryCondition(node.condition);\n const whenTrue = this.printNode(node.whenTrue, 0);\n const whenFalse = this.printNode(node.whenFalse, 0);\n\n return condition + \" ? \" + whenTrue + \" : \" + whenFalse;\n }\n\n // The ternary condition is a condition position the native gate above never sees: the same hook\n // answer prints natively there — `bool` bare, `bool?` as `x == true` (null -> false), source parens\n // unwrapped. Undefined keeps the base path, so an unnamed operand is unchanged.\n csharpTernaryConditionOperand(node) {\n let operand = node;\n while (operand?.kind === SyntaxKind.ParenthesizedExpression) {\n operand = operand.expression;\n }\n if (operand?.kind !== SyntaxKind.Identifier) {\n return undefined;\n }\n const type = this.csharpConditionOperandType(operand);\n if (type === 'bool') {\n return this.printNode(operand, 0);\n }\n if (type === 'bool?') {\n return `${this.printNode(operand, 0)} == true`;\n }\n return undefined;\n }\n\n // printCondition already yields a C# `bool` (`isTrue(x)` / `!isTrue(x)`), so a `((bool) )`\n // wrapper is a cast on a bool. The hook fold above answers the emitted declaration's type first;\n // anything it cannot name keeps the printer's `bool` fold (getCSharpLocalType) and then `isTrue`.\n printTernaryCondition(node) {\n const native = this.csharpTernaryConditionOperand(node);\n if (native !== undefined) {\n return native;\n }\n if (this.csharpConditionPrintsAsBool(node)) {\n return this.printNode(node, 0);\n }\n return this.printCondition(node, 0);\n }\n\n csharpConditionPrintsAsBool(node): boolean {\n if (node?.kind !== SyntaxKind.Identifier) {\n return false;\n }\n const checker = this.getChecker() as Checker; // eslint-disable-line\n const declaration = checker.getSymbolAtLocation(node)?.valueDeclaration?.resolve();\n if (declaration?.kind !== SyntaxKind.VariableDeclaration) {\n return false;\n }\n return this.getCSharpLocalType(declaration) === 'bool';\n }\n\n // index of the `)` matching the `(` at `start` inside printed C# text, or -1; string\n // and char literals are skipped so a `(` inside a literal cannot shift the depth\n csharpMatchingParenIndex(text: string, start: number): number {\n let depth = 0;\n for (let i = start; i < text.length; i++) {\n const char = text[i];\n if (char === '\"' || char === '\\'') {\n const quote = char;\n i++;\n while (i < text.length) {\n if (text[i] === '\\\\') { i += 2; continue; }\n if (text[i] === quote) { break; }\n i++;\n }\n } else if (char === '(') {\n depth++;\n } else if (char === ')') {\n depth--;\n if (depth === 0) {\n return i;\n }\n }\n }\n return -1;\n }\n\n // S62: a `?` at paren/bracket/brace depth 0 in printed condition text is a C# conditional; its type\n // is the branches' common type (`object`), never `bool`; without this guard the falsy wrapper would\n // be folded into an invalid `if (object)`. `?` inside parens/brackets and in literals is ignored.\n csharpTextHasTopLevelConditional(text: string): boolean {\n let depth = 0;\n for (let i = 0; i < text.length; i++) {\n const char = text[i];\n if (char === '\"' || char === '\\'') {\n const quote = char;\n i++;\n while (i < text.length) {\n if (text[i] === '\\\\') { i += 2; continue; }\n if (text[i] === quote) { break; }\n i++;\n }\n } else if ((char === '(') || (char === '[') || (char === '{')) {\n depth++;\n } else if ((char === ')') || (char === ']') || (char === '}')) {\n depth--;\n } else if ((char === '?') && (depth === 0)) {\n return true;\n }\n }\n return false;\n }\n\n // S62: is this printed condition text already a C# `bool`? Only `isTrue`/`isEqual`/`isGreaterThan\n // (OrEqual)`/`isLessThan(OrEqual)`/`inOp` calls qualify (CSHARP_BOOLEAN_PRINTED_CALLS). A `!`,\n // whole-text parens and `&&`/`||` composites (via the leading operand) keep the property.\n csharpPrintedConditionIsBoolean(text: string): boolean {\n const trimmed = text.trim();\n if (trimmed.length === 0) {\n return false;\n }\n if (this.csharpTextHasTopLevelConditional(trimmed)) {\n return false;\n }\n if (trimmed.startsWith('(') && (this.csharpMatchingParenIndex(trimmed, 0) === trimmed.length - 1)) {\n return this.csharpPrintedConditionIsBoolean(trimmed.substring(1, trimmed.length - 1));\n }\n if (trimmed.startsWith('!')) {\n return this.csharpPrintedConditionIsBoolean(trimmed.substring(1));\n }\n const printedCall = /^([A-Za-z_]\\w*)\\(/.exec(trimmed);\n return (printedCall !== null) && (CSHARP_BOOLEAN_PRINTED_CALLS.indexOf(printedCall[1]) >= 0);\n }\n\n printDeleteExpression(node, identation) {\n const receiver = node.expression.expression;\n const object = this.printNode (receiver, 0);\n const key = this.printNode (node.expression.argumentExpression, 0);\n // same identity as the element write: `Remove` on the declared dictionary is the\n // interface method the cast would bind to\n if (this.csharpReceiverIsDeclaredDictionary(receiver)) {\n return `${object}.Remove((string)${key})`;\n }\n return `((IDictionary)${object}).Remove((string)${key})`;\n }\n\n printNewExpression(node, identation) {\n let expression = node.expression?.text;\n expression = expression ? expression : this.printNode(node.expression);\n // JS's built-in `Error` maps to C#'s `Exception` (C# has no `Error` type in the BCL)\n if (expression === 'Error') {\n expression = 'Exception';\n }\n const args = node.arguments.map(n => this.printNode(n, identation)).join(\", \");\n const newToken = this.NEW_TOKEN ? this.NEW_TOKEN + \" \" : \"\";\n return newToken + expression + this.LEFT_PARENTHESIS + args + this.RIGHT_PARENTHESIS;\n }\n\n printThrowStatement(node, identation) {\n // const expression = this.printNode(node.expression, 0);\n // return this.getIden(node) + this.THROW_TOKEN + \" \" + expression + this.LINE_TERMINATOR;\n if (node.expression.kind === SyntaxKind.Identifier) {\n return this.getIden(identation) + this.THROW_TOKEN + ' ' + this.printNode(node.expression, 0) + this.LINE_TERMINATOR;\n }\n if (node.expression.kind === SyntaxKind.NewExpression) {\n const expression = node.expression;\n // handle throw new Error (Message)\n // and throw new x[a] (message)\n const argumentsExp = expression?.arguments ?? [];\n const parsedArg = argumentsExp.map(n => this.printNode(n, 0)).join(\",\") ?? '';\n const newExpression = this.printNode(expression.expression, 0);\n if (expression.expression.kind === SyntaxKind.Identifier) {\n // handle throw new X\n const id = expression.expression;\n // JS's built-in `Error` maps to C#'s `Exception` (C# has no `Error` type in the BCL)\n const idName = id.text === 'Error' ? 'Exception' : id.text;\n const symbol = this.getChecker().getSymbolAtLocation(expression.expression);\n if (symbol) {\n const declarations = (this.getChecker().getDeclaredTypeOfSymbol(symbol).getSymbol()?.declarations ?? []).map((d) => d.resolve());\n const isClassDeclaration = declarations.find(l => l.kind === SyntaxKind.InterfaceDeclaration || l.kind === SyntaxKind.ClassDeclaration);\n if (isClassDeclaration){\n return this.getIden(identation) + `${this.THROW_TOKEN} ${this.NEW_TOKEN} ${idName} ((string)${parsedArg}) ${this.LINE_TERMINATOR}`;\n } else {\n return this.getIden(identation) + `throwDynamicException(${idName}, ${parsedArg});return null;`;\n }\n }\n return this.getIden(identation) + `${this.THROW_TOKEN} ${this.NEW_TOKEN} ${idName === id.text ? newExpression : idName} (${parsedArg}) ${this.LINE_TERMINATOR}`;\n } else if (expression.expression.kind === SyntaxKind.ElementAccessExpression) {\n return this.getIden(identation) + `throwDynamicException(${newExpression}, ${parsedArg});`;\n }\n return super.printThrowStatement(node, identation);\n }\n // const newToken = this.NEW_TOKEN ? this.NEW_TOKEN + \" \" : \"\";\n // const newExpression = node.expression?.expression?.text;\n // // newExpression = newExpression ? newExpression : this.printNode(node.expression.expression, 0); // new Exception or new exact[string] check this out\n // // const args = node.expression?.arguments.map(n => this.printNode(n, 0)).join(\",\");\n // // const throwExpression = ` ${newToken}${newExpression}${this.LEFT_PARENTHESIS}((string)${args})${this.RIGHT_PARENTHESIS}`;\n // return this.getIden(identation) + this.THROW_TOKEN + throwExpression + this.LINE_TERMINATOR;\n }\n\n printPropertyAccessModifiers(node) {\n let modifiers = this.printModifiers(node);\n if (modifiers === '') {\n modifiers = this.defaultPropertyAccess;\n }\n // add type\n let typeText = 'object';\n if (node.type) {\n typeText = this.getType(node);\n if (!typeText && node.type.kind === SyntaxKind.AnyKeyword) {\n typeText = this.OBJECT_KEYWORD + ' ';\n }\n }\n return modifiers + ' ' + typeText + ' ';\n }\n\n // printLeadingComments(node, identation) {\n // const fullText = this.getSrc().getFullText();\n // const commentsRangeList = ts.getLeadingCommentRanges(fullText, node.pos);\n // const commentsRange = commentsRangeList ? commentsRangeList : undefined;\n // let res = \"\";\n // if (commentsRange) {\n // for (const commentRange of commentsRange) {\n // const commentText = fullText.slice(commentRange.pos, commentRange.end);\n // if (commentText !== undefined) {\n // const formatted = commentText\n // .split(\"\\n\")\n // .map(line=>line.trim())\n // .map(line => !(line.trim().startsWith(\"*\")) ? this.getIden(identation) + line : this.getIden(identation) + \" \" + line) .join(\"\\n\");\n // // res+= this.transformLeadingComment(formatted) + \"\\n\";\n // }\n // }\n // }\n // return res;\n // }\n\n // hx4 C01: a declared C# collection keeps its static type across every write, and the\n // null/ContainsKey/Count test reads the live value, so only an enclosing function is needed\n csharpHx4DeclaredReceiverReadable(node, expression): boolean {\n return this.csharpEnclosingFunction(node) !== undefined && isIdentifier(expression);\n }\n\n // hx4 C11: `x[i]` / `m[k]` with an identifier key on a declared collection or a base dict field.\n // The emission carries GetValue's own null/missing-key/past-the-end tests; a negative index\n // throws in both. Key must be declared `int` (list) or `string`/`string?` (dictionary).\n csharpHx4IdentifierKeyRead(expression, argumentExpression): string | undefined {\n if (!isIdentifier(argumentExpression) || !this.csharpHx4IsPlainRead(argumentExpression.parent)) {\n return undefined;\n }\n const fieldTypes = { 'has': 'Dictionary', 'features': 'Dictionary', 'timeframes': 'Dictionary', 'options': 'ConcurrentDictionary', 'markets': 'IDictionary', 'urls': 'object', 'currencies': 'object' };\n let receiver: string | undefined;\n let csharpType: string | undefined;\n if (isPropertyAccessExpression(expression) && expression.expression.kind === SyntaxKind.ThisKeyword && isIdentifier(expression.name)\n && Object.prototype.hasOwnProperty.call(fieldTypes, expression.name.text as string)) {\n const field = this.printNode(expression, 0);\n csharpType = fieldTypes[expression.name.text as string];\n receiver = (csharpType === 'object') ? `((IDictionary)${field})` : field;\n const key = this.csharpHx4DeclaredKeyType(argumentExpression);\n if (key !== 'string' && key !== 'string?') {\n return undefined;\n }\n const printedKey = this.printNode(argumentExpression, 0);\n return `(${field} != null && ${printedKey} != null && ${receiver}.ContainsKey(${printedKey}) ? ${receiver}[${printedKey}] : null)`;\n }\n if (!isIdentifier(expression) || CSHARP_MARKET_RECEIVER_NAMES.indexOf(expression.text as string) >= 0) {\n return undefined;\n }\n csharpType = this.csharpDeclaredCollectionType(expression);\n if (csharpType === undefined) {\n const printed = (typeof (this as any).csharpPrintedLocalType === 'function') ? (this as any).csharpPrintedLocalType(expression) : undefined;\n csharpType = (CSHARP_NATIVE_COLLECTION_TYPES.indexOf(printed) >= 0) ? printed : undefined;\n }\n if (csharpType === undefined || this.csharpEnclosingFunction(expression) === undefined) {\n return undefined;\n }\n receiver = this.printNode(expression, 0);\n const printedKey = this.printNode(argumentExpression, 0);\n const keyType = this.csharpHx4DeclaredKeyType(argumentExpression);\n if (csharpType.indexOf('Dictionary<') >= 0) {\n if (keyType !== 'string' && keyType !== 'string?') {\n return undefined;\n }\n return `(${receiver} != null && ${printedKey} != null && ${receiver}.ContainsKey(${printedKey}) ? ${receiver}[${printedKey}] : null)`;\n }\n if (keyType !== 'int') {\n return undefined; // Int64/object indices do not bind the List indexer\n }\n return `(${receiver} != null && ${printedKey} < ${receiver}.Count ? ${receiver}[${printedKey}] : null)`;\n }\n\n // a read that is no write target: not the left of any assignment, not ++/--, not delete\n csharpHx4IsPlainRead(node): boolean {\n const parent: any = node?.parent;\n if (parent?.kind === SyntaxKind.BinaryExpression && parent.left === node && this.csharpIsAssignmentOperator(parent.operatorToken.kind)) {\n return false;\n }\n return !isDeleteExpression(parent) && !isPrefixUnaryExpression(parent) && !isPostfixUnaryExpression(parent);\n }\n\n // the C# type the key identifier's emitted declaration carries: the printer's own table, then\n // the build layer's declared-local hook (which retypes for-counters and string locals)\n csharpHx4DeclaredKeyType(key): string | undefined {\n const typed = this.csharpTypedLocalType(key);\n if (typed !== undefined) {\n return typed;\n }\n const printed = (typeof (this as any).csharpPrintedLocalType === 'function') ? (this as any).csharpPrintedLocalType(key) : undefined;\n if (printed !== undefined) {\n return printed;\n }\n return (typeof this.csharpLocalTypeOf === 'function') ? this.csharpLocalTypeOf(key) : undefined;\n }\n\n // hx4 L44: `-x` on a local declared `double?` (a safeNumber read) inside a\n // non-null guard on x (`if (x !== undefined)`, `x !== undefined && ...`, early exit). The guard\n // proves the box is a number, so the local keeps its nullable scalar type and the negation is the\n // helper's own in-place body `(x = -x)` (lifted: x is non-null here). Unguarded reads keep `object`.\n csharpHx4GuardedNullableNegation(node, csharpType: string): boolean {\n if (csharpType !== 'double?') {\n return false;\n }\n if (!isPrefixUnaryExpression(node) || (node.operator !== SyntaxKind.MinusToken) || !isIdentifier(node.operand)) {\n return false;\n }\n return this.csharpNullGuardAdmitsRead(node, node.operand);\n }\n\n // the C# type the local's printed declaration finally carries; an embedding build layer that\n // retypes `object x = ...` after printing overrides this with its own (final) answer\n csharpHx4DeclaredLocalType(declaration): string | undefined {\n return this.getCSharpLocalType(declaration);\n }\n\n csharpHx4NativeNegatedNullableLocal(node, leftSide: string): string | undefined {\n const operand = node.operand;\n if (!isIdentifier(operand)) {\n return undefined;\n }\n // the prefix the declaration printed (`double? x = ...`): the printer's own decision, or the\n // embedding build layer's wrapped one; a declaration list of several bindings prints `object`\n const declaration: any = this.getChecker().getSymbolAtLocation(operand)?.valueDeclaration?.resolve();\n if (!declaration || !isVariableDeclaration(declaration) || (declaration.parent?.declarations?.length !== 1)) {\n return undefined;\n }\n const declared = this.csharpHx4DeclaredLocalType(declaration);\n if (!this.csharpHx4GuardedNullableNegation(node, declared)) {\n return undefined;\n }\n return `(${leftSide} = -${leftSide})`;\n }\n\n}\n\n// if (this.requiresCallExpressionCast) {\n// const parsedTypes = this.getTypesFromCallExpressionParameters(node);\n// const tmpArgs = [];\n// args.forEach((arg, index) => {\n// const parsedType = parsedTypes[index];\n// const cast = parsedType ? `(${parsedType})` : '';\n// tmpArgs.push(cast + this.printNode(arg, identation).trim());\n// });\n// parsedArgs = tmpArgs.join(\",\");\n// } else {\n// parsedArgs = args.map((a) => {\n// return this.printNode(a, identation).trim();\n// }).join(\", \");\n// }\n\n// getTypesFromCallExpressionParameters(node) {\n// const resolvedParams = this.getChecker().getResolvedSignature(node).parameters;\n// const parsedTypes = [];\n// resolvedParams.forEach((p) => {\n// const decl = p.declarations[0];\n// const type = this.getChecker().getTypeAtLocation(decl);\n// const parsedType = this.getTypeFromRawType(type);\n// parsedTypes.push(parsedType);\n// });\n\n// return parsedTypes;\n// }\n\n\n// get class decl node\n// Use the ts.getAllSuperTypeNodes function to get the base classes for the MyClass\n// const baseClasses = ts.getAllSuperTypeNodes(classDeclaration);\n\n// // Create a type checker\n// const typeChecker = ts.createTypeChecker(sourceFile.context.program, sourceFile.context.checker);\n\n// // Get the type of the base class\n// const baseClassType = typeChecker.getTypeAtLocation(baseClasses[0]);\n\n// // Get the class declaration for the base class\n// const baseClassDeclaration = baseClassType.symbol.valueDeclaration;\n\n// console.log(baseClassDeclaration);\n","import { BaseTranspiler } from \"./baseTranspiler.js\";\nimport * as fs from \"fs\";\nimport * as path from \"path\";\nimport { SyntaxKind, getLeadingCommentRanges } from 'typescript/unstable/ast';\nimport { isArrowFunction, isBinaryExpression, isBlock, isBooleanLiteral, isCallExpression, isClassDeclaration as isClassDeclarationNode, isElementAccessExpression, isExpressionStatement, isFunctionDeclaration, isFunctionExpression, isIfStatement, isMethodDeclaration, isReturnStatement, isSourceFile, isStatement as isStatementNode, isThrowStatement, isTryStatement } from 'typescript/unstable/ast/is';\nimport { Checker, IndexKind, SymbolFlags, TypeFlags } from 'typescript/unstable/sync';\nimport type { BinaryExpression, CallExpression, Node, NodeArray, Statement } from 'typescript/unstable/ast';\nimport { getAllSuperTypeNodes, isFunctionLike } from './tsUtils.js';\n\n\nconst GO_ITERATION_STATEMENT_KINDS = new Set([SyntaxKind.ForStatement, SyntaxKind.ForInStatement,\n SyntaxKind.ForOfStatement, SyntaxKind.DoStatement, SyntaxKind.WhileStatement]);\n\nconst parserConfig = {\n 'ELSEIF_TOKEN': 'else if',\n 'OBJECT_OPENING': 'map[string]any{',\n 'ARRAY_OPENING_TOKEN': '[]any{',\n 'ARRAY_CLOSING_TOKEN': '}',\n 'PROPERTY_ASSIGNMENT_TOKEN': ':',\n 'VAR_TOKEN': 'object', // object\n 'METHOD_TOKEN': 'func',\n 'PROPERTY_ASSIGNMENT_OPEN': '',\n 'PROPERTY_ASSIGNMENT_CLOSE': '',\n 'SUPER_TOKEN': 'base',\n 'SUPER_CALL_TOKEN': 'base',\n 'FALSY_WRAPPER_OPEN': 'EvalTruthy(',\n 'FALSY_WRAPPER_CLOSE': ')',\n 'COMPARISON_WRAPPER_OPEN' : \"IsEqual(\",\n 'COMPARISON_WRAPPER_CLOSE' : \")\",\n 'UKNOWN_PROP_WRAPPER_OPEN': 'this.call(',\n 'UNKOWN_PROP_WRAPPER_CLOSE': ')',\n 'UKNOWN_PROP_ASYNC_WRAPPER_OPEN': 'this.callAsync(',\n 'UNKOWN_PROP_ASYNC_WRAPPER_CLOSE': ')',\n 'DYNAMIC_CALL_OPEN': 'callDynamically(',\n 'EQUALS_EQUALS_WRAPPER_OPEN': 'IsEqual(',\n 'EQUALS_EQUALS_WRAPPER_CLOSE': ')',\n 'DIFFERENT_WRAPPER_OPEN': '!IsEqual(',\n 'DIFFERENT_WRAPPER_CLOSE': ')',\n 'GREATER_THAN_WRAPPER_OPEN': 'IsGreaterThan(',\n 'GREATER_THAN_WRAPPER_CLOSE': ')',\n 'GREATER_THAN_EQUALS_WRAPPER_OPEN': 'IsGreaterThanOrEqual(',\n 'GREATER_THAN_EQUALS_WRAPPER_CLOSE': ')',\n 'LESS_THAN_WRAPPER_OPEN': 'IsLessThan(',\n 'LESS_THAN_WRAPPER_CLOSE': ')',\n 'LESS_THAN_EQUALS_WRAPPER_OPEN': 'IsLessThanOrEqual(',\n 'LESS_THAN_EQUALS_WRAPPER_CLOSE': ')',\n 'PLUS_WRAPPER_OPEN':'Add(',\n 'PLUS_WRAPPER_CLOSE':')',\n 'MINUS_WRAPPER_OPEN':'Subtract(',\n 'MINUS_WRAPPER_CLOSE':')',\n 'ARRAY_LENGTH_WRAPPER_OPEN': 'GetArrayLength(',\n 'ARRAY_LENGTH_WRAPPER_CLOSE': ')',\n 'DIVIDE_WRAPPER_OPEN': 'Divide(',\n 'DIVIDE_WRAPPER_CLOSE': ')',\n 'MULTIPLY_WRAPPER_OPEN': 'Multiply(',\n 'MULTIPLY_WRAPPER_CLOSE': ')',\n 'INDEXOF_WRAPPER_OPEN': 'GetIndexOf(',\n 'INDEXOF_WRAPPER_CLOSE': ')',\n 'MOD_WRAPPER_OPEN': 'Mod(',\n 'MOD_WRAPPER_CLOSE': ')',\n 'FUNCTION_TOKEN': 'func',\n 'DEFAULT_RETURN_TYPE': 'any',\n 'BLOCK_OPENING_TOKEN': '{',\n 'DEFAULT_PARAMETER_TYPE': 'any',\n 'LINE_TERMINATOR': '',\n 'CONDITION_OPENING':'',\n 'CONDITION_CLOSE':'',\n 'AWAIT_TOKEN': '',\n 'NULL_TOKEN': 'nil',\n 'UNDEFINED_TOKEN': 'nil',\n 'WHILE_TOKEN': 'for',\n 'ELEMENT_ACCESS_WRAPPER_OPEN': 'GetValue(',\n 'ELEMENT_ACCESS_WRAPPER_CLOSE': ')',\n};\n\n// Go static type of the native emissions the printer itself makes (a stdlib call,\n// or one of its own immediately-called literals). A local that captures one holds\n// that concrete type, exactly like the helper result the emission replaced.\nconst GO_NATIVE_CALL_RETURN_TYPES: { [name: string]: string } = {\n 'strings.Index': 'int',\n};\n\n// `this.`, `this.2` and `this.N` of each accessor family, all typed `goType`\nfunction goSafeAccessorTypes (names: string[], goType: string): { [name: string]: string } {\n return Object.fromEntries(names.flatMap((name) => [ '', '2', 'N' ].map((suffix) => [ 'this.' + name + suffix, goType ])));\n}\n\n// Go static type of the value each base helper returns. A local initialised by\n// one of these already holds that concrete type inside its `any` box, so naming\n// the type at the declaration site keeps the very same runtime value and only\n// refines what the Go compiler knows about it.\nconst GO_HELPER_RETURN_TYPES: { [name: string]: string } = {\n 'GetArrayLength': 'int',\n 'GetLength': 'int',\n // the printInlineArrayLength emission of `.length` on a slice\n 'len': 'int',\n 'GetIndexOf': 'int',\n 'ToString': 'string',\n // hand-written exchange_encode.go helper, a plain Go `string` on its only return path\n 'this.UrlencodeNested': 'string',\n 'ToLower': 'string',\n 'ToUpper': 'string',\n 'JsonStringify': 'string',\n 'Capitalize': 'string',\n 'this.Uuid': 'string',\n 'this.Hmac': 'string',\n 'this.Ymdhms': 'string',\n 'this.Yyyymmdd': 'string',\n 'this.Ymd': 'string',\n 'Split': '[]string',\n 'ObjectKeys': '[]string',\n 'this.Extend': 'map[string]any',\n 'this.DeepExtend': 'map[string]any',\n 'this.Keysort': 'map[string]any',\n 'this.IndexBy': 'map[string]any',\n 'this.GroupBy': 'map[string]any',\n 'this.Milliseconds': 'int64',\n 'this.Seconds': 'int64',\n 'this.Microseconds': 'int64',\n 'ParseInt': 'int64',\n 'MathFloor': 'float64',\n 'MathCeil': 'float64',\n 'MathRound': 'float64',\n 'MathAbs': 'float64',\n 'MathPow': 'float64',\n 'ToFloat64': 'float64',\n 'EvalTruthy': 'bool',\n 'IsEqual': 'bool',\n 'IsGreaterThan': 'bool',\n 'IsLessThan': 'bool',\n 'IsGreaterThanOrEqual': 'bool',\n 'IsLessThanOrEqual': 'bool',\n 'InOp': 'bool',\n 'IsArray': 'bool',\n 'IsString': 'bool',\n 'IsInt': 'bool',\n 'IsBool': 'bool',\n 'IsNumber': 'bool',\n 'IsObject': 'bool',\n 'IsDictionary': 'bool',\n 'StartsWith': 'bool',\n 'EndsWith': 'bool',\n // the native string operations (emitted with a proven Go `string` receiver) return exactly\n // the type of the helper they replace, so a local initialised by one keeps its declared type\n 'strings.Split': '[]string',\n 'strings.Join': 'string',\n 'strings.ToUpper': 'string',\n 'strings.ToLower': 'string',\n 'strings.Replace': 'string',\n 'strings.ReplaceAll': 'string',\n 'strings.HasPrefix': 'bool',\n 'strings.HasSuffix': 'bool',\n 'strconv.FormatInt': 'string',\n 'IsInstance': 'bool',\n 'IsInteger': 'bool',\n 'this.InArray': 'bool',\n 'this.ValueIsDefined': 'bool',\n 'Precise.StringGt': 'bool',\n 'Precise.StringGe': 'bool',\n 'Precise.StringLt': 'bool',\n 'Precise.StringLe': 'bool',\n 'Precise.StringEq': 'bool',\n 'Precise.StringEquals': 'bool',\n // the base Safe* accessors return a typed pointer so that an absent value is a\n // nil pointer, distinct from a present zero value (\"\" / 0 / false)\n ...goSafeAccessorTypes([ 'SafeString', 'SafeStringLower', 'SafeStringUpper' ], '*string'),\n ...goSafeAccessorTypes([ 'SafeInteger', 'SafeIntegerProduct', 'SafeTimestamp' ], '*int64'),\n ...goSafeAccessorTypes([ 'SafeFloat' ], '*float64'),\n // absent flag → nil pointer, present flag → its value, mirroring the string/number accessors\n ...goSafeAccessorTypes([ 'SafeBool' ], '*bool'),\n // SafeDict*/SafeList* stay untyped: the Go accessors return `any` because the value\n // may be a *sync.Map, a Dict or an order-book side, none of which is a map[string]any / []any\n // Precise arithmetic returns a numeric string, or nil when an operand is\n // absent, so it carries the same *string shape as the Safe* string accessors\n ...Object.fromEntries([ 'Mul', 'Div', 'Sub', 'Add', 'Or', 'Max', 'Min', 'Abs', 'Neg', 'Mod' ].map((op) => [ 'Precise.String' + op, '*string' ])),\n};\n\n// helpers whose Go signature is `any` (GetValue, Ternary, Add, SafeValue, ...) are\n// deliberately absent above: their box holds a value the printer cannot name, so\n// those locals stay `any`. A Safe* entry presupposes the matching Go accessor\n// returns that shape (as the hand-written base already does for Str/Int/Float).\n\n// printed calls whose Go result is a JSON decode: map/slice/scalar or nil, never a\n// typed pointer. `this.parseJson` / `this.json` are the hand-written base decoders,\n// `JsonParse` / `ParseJSON` their runtime twins.\nconst GO_JSON_PARSE_CALLS = [ 'Json', 'JsonParse', 'ParseJson', 'ParseJSON' ];\n\n// Hand-written CCXT fields whose Go type is a plain `bool` (go/v4/exchange.go,\n// struct BaseExchange, embedded by every derived exchange). Reading one already\n// yields a Go bool, so a condition on it needs no truthiness helper at all.\nconst GO_BOOL_FIELDS = new Set([\n 'this.Verbose',\n 'this.EnableRateLimit',\n 'this.ReduceFees',\n 'this.SubstituteCommonCurrencyCodes',\n 'this.IsSandboxModeEnabled',\n // `public newUpdates: boolean` in ts/src/base/Exchange.ts; the hand-written\n // struct field is the `NewUpdates bool` read by every WS loop\n 'this.NewUpdates',\n]);\n\n// Hand-written BaseExchange methods (go/v4/exchange.go) whose Go signature returns a\n// plain `bool`, so `EvalTruthy(this.IsEmpty(x))` IS `this.IsEmpty(x)`. InArray,\n// Precise.String* and the retagged generated methods are already in GO_HELPER_RETURN_TYPES.\nconst GO_BOOL_CALL_NAMES_NATIVE = [\n 'this.IsEmpty',\n 'this.IsJsonEncodedObject',\n 'this.IsBinaryMessage',\n];\n// Pointer-returning accessors the ccxt build pass wraps with DerefScalar but that the\n// Go type table above does not name (their printed Go signature is not in it).\nconst GO_DEREF_WRAPPED_CALLS = [ 'NumberToString', 'Parse8601', 'Iso8601' ];\n\n// A printed call the printer cannot type *and* whose Go signature returns `any`\n// can be compared with nil / a string / a bool literal without the helper: the\n// box holds a scalar or nil, never a typed pointer.\nconst GO_ANY_BOX_CALLS = [\n 'GetValue', 'Ternary',\n 'SafeValue', 'this.SafeValue',\n 'SafeDict', 'this.SafeDict',\n 'SafeList', 'this.SafeList',\n 'SafeNumber', 'this.SafeNumber',\n];\n\n// read-only string accessors whose printed Go result is a `*string`. Each one reads\n// its arguments and returns a fresh pointer, so repeating the call in the two halves\n// of a deref comparison returns the same value when every argument is a plain read.\nconst GO_PURE_STRING_ACCESSORS = [\n 'this.SafeString', 'this.SafeString2', 'this.SafeStringN',\n 'this.SafeStringLower', 'this.SafeStringLower2', 'this.SafeStringLowerN',\n 'this.SafeStringUpper', 'this.SafeStringUpper2', 'this.SafeStringUpperN',\n 'this.NumberToString', 'this.SafeCurrencyCode',\n];\n\n// the `*bool` twin of the table above: the accessors whose Go signature returns a\n// pointer that is nil for an absent flag and carries the flag otherwise — the same\n// two states `derefScalar` hands the truthiness helper.\nconst GO_PURE_BOOL_ACCESSORS = [\n 'this.SafeBool', 'this.SafeBool2', 'this.SafeBoolN',\n];\n\n// Pointer types the Go nil test of the runtime helpers reproduces exactly: derefScalar\n// unwraps them to an untyped nil, IsEqual has its own *sync.Map case. Other pointers\n// (*sync.Mutex), map/slice fields and `any` fields flip meaning, so they keep the helper.\nconst GO_NIL_EQUIVALENT_POINTER_TYPES_Native = new Set([\n '*sync.Map', '*string', '*int64', '*float64', '*bool', '*int', '*[]string', '*[]any', '*map[string]any',\n]);\n\n// hand-written BaseExchange fields (go/v4/exchange.go) declared `*sync.Map`\nconst GO_SYNC_MAP_FIELDS = [\n 'Options', 'Markets', 'Markets_by_id', 'MarketsById', 'Currencies', 'Currencies_by_id', 'CurrenciesById',\n 'BaseCurrencies', 'QuoteCurrencies', 'Tickers', 'Orderbooks', 'Transactions',\n];\n\n// Hand-written BaseExchange fields (go/v4/exchange.go, embedded by every exchange\n// class) declared with one of those pointer types, keyed by the printed Go field name;\n// the Go type lives in the hand-written base, not in the TypeScript class.\nconst GO_NILABLE_FIELDS_Typed: { [name: string]: string } = Object.fromEntries(\n [ ...GO_SYNC_MAP_FIELDS, 'Bidsasks' ].map((name) => [ 'this.' + name, '*sync.Map' ]));\n\nconst GO_TYPE_NAMES = [ 'string', 'int', 'int64', 'float64', 'bool', 'any' ];\n\n// `var x any = this.SafeDict(container, key)` may declare the map type: SafeMapTyped reads the same\n// member and returns the map (sync.Map converted), nil when absent or not a map. Emitted only when\n// every later use READS it as a dictionary — a typed nil map is a non-nil interface otherwise.\nconst GO_SAFE_DICT_LOCAL_TYPE = 'map[string]any';\n\n// the hand-written helpers a typed dict local may be handed to as their receiver: each one\n// normalises the argument with derefScalar/GetValue, so a nil map reads exactly like the nil\n// interface the local used to hold\nconst GO_SAFE_DICT_READ_HELPERS = [ 'GetValue', 'InOp', 'ObjectKeys', 'IsDictionary' ];\n\n// `var market any = this.Market(symbol)` / `this.SafeMarket(…)`: the TS return type is the\n// `MarketInterface` interface, so MapTyped returns the same dictionary and the local can be\n// `map[string]any`. Emitted only while every later use READS it as a dictionary (SafeDict scan).\nconst GO_MARKET_LOCAL_TYPE = 'map[string]any';\n\n// the binary operators under which a market/currency local's element read is a pure READ: the\n// element is derefed by the GetValue the element-read printer keeps for these operands\n// (goMarketComparisonElementRead), so `market['swap'] === true` keeps answering exactly what the\nconst GO_MARKET_READ_COMPARISON_OPERATORS = [\n SyntaxKind.EqualsEqualsToken,\n SyntaxKind.ExclamationEqualsToken,\n SyntaxKind.EqualsEqualsEqualsToken,\n SyntaxKind.ExclamationEqualsEqualsToken,\n SyntaxKind.LessThanToken,\n SyntaxKind.GreaterThanToken,\n SyntaxKind.LessThanEqualsToken,\n SyntaxKind.GreaterThanEqualsToken,\n SyntaxKind.AmpersandAmpersandToken,\n SyntaxKind.BarBarToken,\n];\n\n// `var x any = this.SafeList(container, key)` may carry the slice type for the same reason: the\n// accessor returns `any`, so SafeListTyped reads the same member and hands back a []any with the\n// same length and elements (every array kind IsArray admits is converted), nil when the member is\nconst GO_SAFE_LIST_LOCAL_TYPE = '[]any';\n\n// the boundary comment ccxt's base sources (ts/src/base/Exchange.ts, PredictionExchange.ts)\n// carry and build/goTranspiler.ts re-assembles the generated file around\n\n// the Go numeric kinds. `<` `>` `<=` `>=` compile without a conversion only when\n// both operands carry the same one of these\nconst GO_NUMERIC_KINDS = [ 'int', 'int64', 'float64' ];\n\nconst ORDERED_COMPARISON_OPERATORS: { [kind: number]: string } = {\n [SyntaxKind.GreaterThanToken]: '>',\n [SyntaxKind.GreaterThanEqualsToken]: '>=',\n [SyntaxKind.LessThanToken]: '<',\n [SyntaxKind.LessThanEqualsToken]: '<=',\n};\n\n// hand-written BaseExchange fields (go/v4/exchange.go) declared `string`: their Go\n// value is never nil, so `this. + s` matches Add(field, s) exactly. The Go\n// struct field is what decides — a batch-A `Str` TS annotation (`version: Str`)\n// still prints this field as a plain Go string.\nconst GO_STRING_FIELD_NAMES = [ 'Id', 'Name', 'Version', 'Url', 'Hostname', 'UserAgent' ];\n\n// the hand-written SafeString-family methods (go/v4/exchange_safe.go) return a fresh\n// non-nil pointer whenever the call passes a non-nil default: the value branch takes\n// the address of the found string, the default branch the address of ToString(def).\nconst GO_DEFAULTED_SAFE_STRING_ARITY: { [name: string]: number } = {\n 'safeString': 3, 'safeStringLower': 3, 'safeStringUpper': 3,\n 'safeString2': 4, 'safeStringLower2': 4, 'safeStringUpper2': 4,\n 'safeStringN': 3, 'safeStringLowerN': 3, 'safeStringUpperN': 3,\n};\n\n// the default shapes derefScalar leaves non-nil: a literal default is never the absent\n// case, so the method's nil return is unreachable for a call carrying one\nconst GO_NON_NIL_DEFAULT_KINDS = [\n SyntaxKind.StringLiteral, SyntaxKind.NoSubstitutionTemplateLiteral,\n SyntaxKind.NumericLiteral, SyntaxKind.TrueKeyword, SyntaxKind.FalseKeyword,\n];\n\n// the operators that write their left operand: an assignment through any of them may\n// store a nil pointer where the deref proof expected the defaulted call's result\nconst GO_WRITE_OPERATOR_KINDS = [\n SyntaxKind.EqualsToken, SyntaxKind.PlusEqualsToken, SyntaxKind.MinusEqualsToken,\n SyntaxKind.AsteriskEqualsToken, SyntaxKind.SlashEqualsToken, SyntaxKind.PercentEqualsToken,\n];\n\n// hand-written BaseExchange fields (go/v4/exchange.go) declared as a container: an\n// element write on one of them is native code — a map index write, or `Store` for the\n// thread-safe ones, which is exactly what AddElementToObject does for a *sync.Map.\nconst GO_FIELD_CONTAINER_TYPES_NATIVE: { [name: string]: string } = Object.fromEntries([\n ...[\n 'Has', 'Api', 'TransformedApi', 'RequiredCredentials', 'HttpExceptions', 'Timeframes', 'Features',\n 'Exceptions', 'Precision', 'UserAgents', 'TokenBucket', 'CommonCurrencies', 'ProxyDictionaries',\n 'WsClients', 'Clients', 'Limits', 'Fees', 'Status', 'Countries',\n ].map((name) => [ name, 'map[string]any' ]),\n ...GO_SYNC_MAP_FIELDS.map((name) => [ name, '*sync.Map' ]),\n]);\n\n// operator kinds the arithmetic helpers are emitted for\nconst GO_ARITHMETIC_KINDS = [\n SyntaxKind.PlusToken,\n SyntaxKind.MinusToken,\n SyntaxKind.AsteriskToken,\n SyntaxKind.SlashToken,\n SyntaxKind.PercentToken,\n];\n\n// ---------------------------------------------------------------------------------------------\n// Trailing `//` comment alignment (gofmt's tabwriter cells).\n//\n// go/printer separates a trailing comment from the code with a hard tab (`writeCommentPrefix`),\n// so the code text is the last tab-terminated cell of the line. text/tabwriter pads that cell to\n// the widest cell of its column block plus `padding = 1` (gofmt runs with `minwidth = 0`,\n// `padding = 1`, `padchar = ' '`), which is why adjacent statements get their comments aligned\n// and a lone one gets exactly one space. A column block is the run of adjacent lines whose code\n// cell sits in the same column (same indentation); formfeeds terminate all columns, and\n// go/printer emits them between sections: blank and comment-only lines, a change of indentation,\n// each line of a multi-line expression (`binaryExpr` breaks with `newSection = true`) and every\n// statement that follows a multi-line one (`stmtList` breaks with `newSection = true`).\n//\n// The pass below reproduces that padding on the printed text. It is a no-op on text gofmt has\n// already aligned (verified over the whole go/v4 tree) and it never reflows or re-wraps a line.\n// ---------------------------------------------------------------------------------------------\n\n// a line whose code ends like this does not end its statement: the line below it belongs to the\n// same multi-line expression, and go/printer puts a formfeed before it (a new column block)\nconst GO_COMMENT_BREAK_END = /(?:[({[:]|[+\\-*/%&|^<>=!])$/;\n\n// the index just past the `\"`/`'` literal opening at `start` (backslash escapes skipped)\nfunction goSkipQuoted (text: string, start: number): number {\n let i = start + 1;\n while (i < text.length) {\n if (text[i] === '\\\\') {\n i += 2;\n continue;\n }\n if (text[i] === text[start]) {\n return i + 1;\n }\n i += 1;\n }\n return i;\n}\n\n// (opens - closes) of ()[]{} outside strings, so `foo(` (statement continues) and `}` (statement\n// ended before this line) are not mistaken for complete single-line statements\nfunction goBracketBalance (code: string): number {\n let depth = 0;\n let i = 0;\n while (i < code.length) {\n const ch = code[i];\n if ((ch === '\"') || (ch === '\\'')) {\n i = goSkipQuoted (code, i);\n continue;\n }\n if (ch === '`') {\n i += 1;\n while ((i < code.length) && (code[i] !== '`')) {\n i += 1;\n }\n i += 1;\n continue;\n }\n if ((ch === '(') || (ch === '[') || (ch === '{')) {\n depth += 1;\n } else if ((ch === ')') || (ch === ']') || (ch === '}')) {\n depth -= 1;\n }\n i += 1;\n }\n return depth;\n}\n\n// the return type the printer's own immediately-called func literal carries\n// (`func() T { … }()`), or undefined when the text is not one or T is an `any` box\nfunction goFuncLiteralReturnType (value: string): string | undefined {\n const literal = /^func\\(\\) ([\\w.[\\]]*) \\{/.exec(value);\n if ((literal === null) || !value.endsWith('}()') || (literal[1] === 'any')) {\n return undefined;\n }\n return literal[1];\n}\n\n// index of the first `//` outside strings and comments, or -1. The state is carried across lines\n// because `/* */` comments and `-quoted strings can span them (a `//` inside a string literal is\n// data, e.g. the `https://` of an endpoint, and must not be taken for a comment)\nfunction goTrailingCommentIndex (line: string, state: { block: boolean, raw: boolean }): number {\n let i = 0;\n while (i < line.length) {\n const ch = line[i];\n if (state.block) {\n if ((ch === '*') && (line[i + 1] === '/')) {\n state.block = false;\n i += 2;\n continue;\n }\n i += 1;\n continue;\n }\n if (state.raw) {\n if (ch === '`') {\n state.raw = false;\n }\n i += 1;\n continue;\n }\n if (ch === '`') {\n state.raw = true;\n i += 1;\n continue;\n }\n if ((ch === '\"') || (ch === '\\'')) {\n i = goSkipQuoted (line, i);\n continue;\n }\n if ((ch === '/') && (line[i + 1] === '/')) {\n return i;\n }\n if ((ch === '/') && (line[i + 1] === '*')) {\n state.block = true;\n i += 2;\n continue;\n }\n i += 1;\n }\n return -1;\n}\n\n// tabwriter counts runes, not bytes (a multi-byte identifier is one column wide)\nfunction goRuneWidth (text: string): number {\n return [ ...text ].length;\n}\n\nfunction alignGoTrailingComments (content: string): string {\n const lines = content.split ('\\n');\n const entries: { index: number, indent: string, code: string, comment: string }[] = [];\n const state = { 'block': false, 'raw': false };\n for (let index = 0; index < lines.length; index++) {\n const commentIndex = goTrailingCommentIndex (lines[index], state);\n if (commentIndex < 0) {\n continue;\n }\n // the code cell: everything before the comment, without the padding already inside it\n const code = lines[index].slice (0, commentIndex).replace (/[ \\t]+$/, '');\n if (!code.trim ()) {\n continue; // a comment-only line is a section break, it is never a cell\n }\n const indent = code.match (/^[ \\t]*/)[0];\n entries.push ({ 'index': index, indent, code, 'comment': lines[index].slice (commentIndex) });\n }\n // group the lines that share a code column: adjacent, same indentation, and no section break\n // in between (the previous line must end its own statement, and that statement must be a\n // single-line one, or the next statement starts a new section)\n const groups: typeof entries[] = [];\n let group: typeof entries = [];\n for (const entry of entries) {\n const previous = group[group.length - 1];\n const continues = previous\n && (entry.index === previous.index + 1)\n && (entry.indent === previous.indent)\n && (goBracketBalance (previous.code) === 0)\n && !GO_COMMENT_BREAK_END.test (previous.code);\n if (continues) {\n group.push (entry);\n } else {\n if (group.length) {\n groups.push (group);\n }\n group = [ entry ];\n }\n }\n if (group.length) {\n groups.push (group);\n }\n for (const members of groups) {\n let width = 0;\n for (const member of members) {\n width = Math.max (width, goRuneWidth (member.code));\n }\n width += 1; // tabwriter padding\n for (const member of members) {\n const pad = width - goRuneWidth (member.code);\n lines[member.index] = member.code + ' '.repeat (pad) + member.comment;\n }\n }\n return lines.join ('\\n');\n}\n\n// `/^this\\s*\\.\\s*\\s*\\(/` for each name: a call of that method on `this`\nfunction goThisCallPatterns (names: string[]): RegExp[] {\n return names.map((name) => new RegExp('^this\\\\s*\\\\.\\\\s*' + name + '\\\\s*\\\\('));\n}\n\n// the TypeScript accessors whose Go signature this printer knows to be `*string`\n// (GO_HELPER_RETURN_TYPES plus coerced SafeCurrencyCode/SafeSymbol); the textual call-site proof\n// uses them for ts/src sibling files a scoped run's program does not carry.\nconst GO_TS_SRC_STRING_PRODUCERS = goThisCallPatterns([\n 'safeString', 'safeString2', 'safeString3', 'safeStringN', 'safeStringLower', 'safeStringLower2',\n 'safeStringUpper', 'safeStringUpper2', 'safeCurrencyCode', 'safeSymbol',\n]);\n\n// the TS accessors whose Go signature GO_HELPER_RETURN_TYPES already names\n// `map[string]any`, for the same textual sibling-file proof. A map argument is also\n// proven when it is an object literal (its printed Go form is exactly that map) or a\nconst GO_TS_SRC_MAP_PRODUCERS = goThisCallPatterns([ 'extend', 'deepExtend', 'keysort', 'indexBy', 'groupBy' ]);\n\n// the argument texts of a call whose opening parenthesis sits at `open`, or undefined\n// when the parentheses do not balance — an unproven call site must never pass the proof\nfunction goBalancedCallArgs (text: string, open: number): string[] | undefined {\n const args: string[] = [];\n let depth = 0;\n let current = '';\n let quote: string | undefined;\n for (let i = open; i < text.length; i++) {\n const ch = text[i];\n if (quote !== undefined) {\n current += ch;\n if (ch === '\\\\') {\n current += text[i + 1] ?? '';\n i++;\n continue;\n }\n if (ch === quote) {\n quote = undefined;\n }\n continue;\n }\n if ((ch === '\"') || (ch === \"'\") || (ch === '`')) {\n quote = ch;\n current += ch;\n continue;\n }\n if ((ch === '/') && (text[i + 1] === '/')) {\n while ((i < text.length) && (text[i] !== '\\n')) { i++; }\n continue;\n }\n if (ch === '(') {\n depth++;\n if (depth > 1) { current += ch; }\n continue;\n }\n if (ch === ')') {\n depth--;\n if (depth === 0) {\n if (current.trim().length > 0) { args.push (current.trim ()); }\n return args;\n }\n current += ch;\n continue;\n }\n if ((ch === ',') && (depth === 1)) {\n args.push (current.trim ());\n current = '';\n continue;\n }\n current += ch;\n }\n return undefined;\n}\n\nexport {\n alignGoTrailingComments,\n};\n\n// implicit endpoints pass api (['v1', 'private']) and params (a list for batch orders) untyped;\n// exchange overrides of sign/fetch2/request usually omit the base `api: any` annotation\nconst GO_GETARG_EXCLUDED_POSITIONS: { [name: string]: number[] } = {\n 'fetch2': [ 1, 3 ],\n 'request': [ 1, 3 ],\n 'sign': [ 1, 3 ],\n};\n\n// base helpers typed `any[]` that hand back, at this index, the params map they were given\n// (unchanged, omitted or extended: always a map[string]any in Go)\nconst GO_PARAMS_TUPLE_HELPERS: { [name: string]: number } = {\n 'handleUntilOption': 1,\n 'handleNetworkCodeAndParams': 1,\n 'handleWithdrawTagAndParams': 1,\n 'handleTriggerAndParams': 1,\n 'handleTriggerDirectionAndParams': 1,\n 'handlePostOnly': 1,\n 'handleTriggerPricesAndParams': 3,\n};\n\n// receivers that read a nil map exactly like an untyped nil (derefScalar + a missed lookup);\n// IsDictionary and IsEqual answer differently for a nil map, so they are not listed\nconst GO_GETARG_NIL_MAP_READERS = [\n 'GetValue', 'InOp', 'ObjectKeys', 'SafeValue', 'SafeValue2', 'SafeDict', 'SafeList',\n 'SafeString', 'SafeString2', 'SafeStringN', 'SafeStringUpper', 'SafeStringLower',\n 'SafeInteger', 'SafeInteger2', 'SafeNumber', 'SafeNumber2', 'SafeFloat', 'SafeBool', 'SafeTimestamp',\n];\n\nexport class GoTranspiler extends BaseTranspiler {\n\n // scopes are scanned many times per local; walking remote TS7 nodes is costly, so the\n // preorder descendant list is built once per scope (same visit order and early stop)\n goScopeDescendants = new WeakMap();\n goDescendantsOf(scope): any[] {\n let list = this.goScopeDescendants.get(scope);\n if (list === undefined) {\n list = [];\n const out = list;\n const visit = (n: any) => {\n out.push(n);\n n.forEachChild(visit);\n };\n scope.forEachChild(visit);\n this.goScopeDescendants.set(scope, list);\n }\n return list;\n }\n\n hasNodeWhere(scope: Node | undefined, predicate: (n: any) => boolean): boolean {\n if (scope === undefined) {\n return false;\n }\n return this.goDescendantsOf(scope).some(predicate);\n }\n\n binaryExpressionsWrappers;\n wrapThisCalls: boolean;\n wrapCallMethods: string[] = [];\n // inherited method name -> indexes of required params that print `string` on the base and every\n // override (the caller audits all declarations); other callers convert through StringArg\n unifiedStringParams: { [method: string]: number[] } = {};\n // installed by the ccxt build: GetArg alias -> Go types, and the audited consumer table\n CCXT_GO_GETARG_DECLARED_TYPES: any;\n CCXT_GO_GETARG_SAFE_CONSUMERS: any;\n goGetArgTypeCache: WeakMap;\n goGetArgTypeComputing: Set;\n // declarations whose Go local type is being resolved right now (see goLocalStaticType)\n goLocalTypeResolution = new Set();\n // goSelfConcatIsString's answer per non-self leaf node\n goSelfConcatLeafCache = new WeakMap();\n goLocalStaticTypeCache = new WeakMap();\n // binary-expression texts and goNativeArithmetic types, keyed by node + print context, alive only\n // while the outermost binary print/typing runs: operand typing re-prints every nested operator\n goBinaryMemo: Map> | undefined;\n // appended to every async (channel returning) Go method/function name and to each\n // checker-resolved call site of one; '' disables the rename\n asyncMethodSuffix = '';\n // declaring-file patterns whose async methods keep the plain name at call sites (generated\n // endpoint bodies the target language implements itself, e.g. ccxt's ts/src/abstract/)\n asyncSuffixExemptPaths: RegExp[] = [];\n classNameMap: { [key: string]: string };\n DEFAULT_RETURN_TYPE = 'any';\n // suffix of the sibling body method an async trampoline hands its work to\n ASYNC_BODY_SUFFIX = 'Body';\n // gofmt indents every nesting level with exactly one tab; the printer emits the\n // same bytes so the generated tree needs no `gofmt` pass (campaign go-gofmt F01)\n DEFAULT_IDENTATION = \"\\t\";\n // stdlib packages the printed source file references. A Go import must precede the first\n // declaration, so the file-level print (printSourceFileStatements) collects names here and\n // prepends `import \"...\"`. Nested prints keep their own list; memo of goStdlibImportIsPlaceable().\n\n constructor(config = {}) {\n config['parser'] = Object.assign ({}, parserConfig, config['parser'] ?? {});\n\n super(config);\n\n this.requiresParameterType = true;\n this.requiresReturnType = true;\n this.asyncTranspiling = false;\n this.implicitAsyncTranspiling = true;\n this.supportsFalsyOrTruthyValues = false;\n this.requiresCallExpressionCast = true;\n this.wrapThisCalls = false;\n this.id = \"Go\";\n this.className = \"undefined\";\n this.classNameMap = config['classNameMap'] ?? {};\n this.initConfig();\n\n // user overrides\n this.applyUserOverrides(config);\n this.wrapThisCalls = config['wrapThisCalls'] ?? false;\n this.wrapCallMethods = config['wrapCallMethods'] ?? [];\n this.asyncMethodSuffix = config['asyncMethodSuffix'] ?? '';\n this.asyncSuffixExemptPaths = (config['asyncSuffixExemptPaths'] ?? []).map((p) => new RegExp(p));\n this.unifiedStringParams = config['unifiedStringParams'] ?? {};\n }\n\n initConfig() {\n this.LeftPropertyAccessReplacements = {\n // 'this': '$this',\n };\n\n this.RightPropertyAccessReplacements = {\n 'push': 'Add', // list method\n 'indexOf': 'IndexOf', // list method\n 'toUpperCase': 'ToUpper',\n 'toLowerCase': 'ToLower',\n 'toString': 'ToString',\n };\n\n this.FullPropertyAccessReplacements = {\n 'JSON.parse': 'parseJson', // custom helper method\n 'console.log': 'fmt.Println',\n 'Number.MAX_SAFE_INTEGER': 'Int32.MaxValue',\n 'Math.min': 'Math.Min',\n 'Math.max': 'Math.Max',\n 'Math.log': 'Math.Log',\n 'Math.abs': 'Math.Abs',\n // 'Math.ceil': 'Math.Ceiling', // need cast\n // 'Math.round': 'Math.Round', // need to cast\n 'Math.floor': 'Math.Floor',\n 'Math.pow': 'Math.Pow',\n // 'Promise.all': 'Task.WhenAll',\n };\n\n this.CallExpressionReplacements = {\n // \"parseInt\": \"parseINt\",\n // \"parseFloat\": \"float.Parse\",\n };\n\n this.ReservedKeywordsReplacements = {\n // 'string': 'str',\n // 'params': 'parameters',\n 'type': 'typeVar',\n // 'internal': 'intern',\n // 'event': 'eventVar',\n // 'fixed': 'fixedVar',\n };\n\n this.binaryExpressionsWrappers = {\n [SyntaxKind.EqualsEqualsToken]: [this.EQUALS_EQUALS_WRAPPER_OPEN, this.EQUALS_EQUALS_WRAPPER_CLOSE],\n [SyntaxKind.EqualsEqualsEqualsToken]: [this.EQUALS_EQUALS_WRAPPER_OPEN, this.EQUALS_EQUALS_WRAPPER_CLOSE],\n [SyntaxKind.ExclamationEqualsToken]: [this.DIFFERENT_WRAPPER_OPEN, this.DIFFERENT_WRAPPER_CLOSE],\n [SyntaxKind.ExclamationEqualsEqualsToken]: [this.DIFFERENT_WRAPPER_OPEN, this.DIFFERENT_WRAPPER_CLOSE],\n [SyntaxKind.GreaterThanToken]: [this.GREATER_THAN_WRAPPER_OPEN, this.GREATER_THAN_WRAPPER_CLOSE],\n [SyntaxKind.GreaterThanEqualsToken]: [this.GREATER_THAN_EQUALS_WRAPPER_OPEN, this.GREATER_THAN_EQUALS_WRAPPER_CLOSE],\n [SyntaxKind.LessThanToken]: [this.LESS_THAN_WRAPPER_OPEN, this.LESS_THAN_WRAPPER_CLOSE],\n [SyntaxKind.LessThanEqualsToken]: [this.LESS_THAN_EQUALS_WRAPPER_OPEN, this.LESS_THAN_EQUALS_WRAPPER_CLOSE],\n [SyntaxKind.PlusToken]: [this.PLUS_WRAPPER_OPEN, this.PLUS_WRAPPER_CLOSE],\n [SyntaxKind.MinusToken]: [this.MINUS_WRAPPER_OPEN, this.MINUS_WRAPPER_CLOSE],\n [SyntaxKind.AsteriskToken]: [this.MULTIPLY_WRAPPER_OPEN, this.MULTIPLY_WRAPPER_CLOSE],\n [SyntaxKind.PercentToken]: [this.MOD_WRAPPER_OPEN, this.MOD_WRAPPER_CLOSE],\n [SyntaxKind.SlashToken]: [this.DIVIDE_WRAPPER_OPEN, this.DIVIDE_WRAPPER_CLOSE],\n };\n }\n\n // getBlockOpen(identation){\n // return this.getIden(identation) + this.BLOCK_OPENING_TOKEN;\n // }\n\n printSuperCallInsideConstructor(node, identation) {\n return \"\"; // csharp does not need super call inside constructor\n }\n\n printStringLiteral(node) {\n const token = this.STRING_QUOTE_TOKEN;\n let text = node.text;\n if (text in this.StringLiteralReplacements) {\n return this.StringLiteralReplacements[text];\n }\n // skip the replaceAll passes when there is nothing to escape\n // note: single quotes must NOT be escaped — \\' is an invalid escape in Go string literals\n if (/[\\\\\"\\b\\f\\n\\r\\t]/.test(text)) {\n // Preserve real backslashes\n const backslashPlaceholder = \"\\x00\";\n text = text.replaceAll(\"\\\\\", backslashPlaceholder);\n text = text.replaceAll(\"\\b\", \"\\\\b\");\n text = text.replaceAll(\"\\f\", \"\\\\f\");\n text = text.replaceAll(\"\\n\", \"\\\\n\");\n text = text.replaceAll(\"\\r\", \"\\\\r\");\n text = text.replaceAll(\"\\t\", \"\\\\t\");\n text = text.replaceAll(backslashPlaceholder, \"\\\\\\\\\");\n text = text.replaceAll(\"\\\"\", \"\\\\\\\"\");\n }\n return token + text + token;\n }\n\n transformFunctionNameIfNeeded(name): string {\n return this.capitalize(name);\n }\n\n // The cells of one struct field in the shape gofmt's fieldList() prints them: a named\n // field is `Name Type [Tag]` (the name cell — and, when the field carries a tag, the type\n // cell too — is a tab-terminated column cell) and an embedded field is a single cell.\n // printStruct() lays those cells out; printPropertyDeclaration() joins them with spaces.\n getStructFieldCells(node) {\n const name = this.capitalize(this.printNode(node.name, 0));\n let type = 'any';\n if (node.type === undefined) {\n type = 'any';\n } else if (node.type.kind === SyntaxKind.StringKeyword) {\n type = 'string';\n } else if (node.type.kind === SyntaxKind.NumberKeyword) {\n type = 'int';\n } else if (node.type.kind === SyntaxKind.BooleanKeyword || isBooleanLiteral(node)) {\n type = 'bool';\n } else if (node.type.kind === SyntaxKind.ArrayType) {\n type = '[]any';\n }\n const cells = [ name, type ];\n if (node.initializer) {\n // we have to save the value and initialize it later\n let initializer = this.printNode(node.initializer, 0);\n // quick fix\n initializer = initializer.replaceAll('\"', '');\n cells.push(`\\`default:\"${initializer}\"\\``);\n }\n return cells;\n }\n\n printPropertyDeclaration(node, identation) {\n return this.getIden(identation) + this.getStructFieldCells(node).join(' ') + this.LINE_TERMINATOR;\n }\n\n printStruct(node, indentation) {\n\n const rows: string[][] = [];\n // check if we have heritage\n if (node?.heritageClauses?.length > 0) {\n const heritage = node.heritageClauses[0];\n const heritageType = heritage.types[0];\n let heritageEscapedText = heritageType.expression.text;\n if (this.classNameMap[heritageEscapedText]) {\n heritageEscapedText = this.classNameMap[heritageEscapedText];\n }\n // an embedded field has no type cell: it is a single, unterminated cell\n rows.push([ heritageEscapedText ]);\n }\n\n const propDeclarations = node.members.filter(member => member.kind === SyntaxKind.PropertyDeclaration);\n propDeclarations.forEach(member => rows.push(this.getStructFieldCells(member)));\n\n // gofmt lays the fields out with text/tabwriter (go/printer's fieldList): a column\n // block is a run of consecutive fields whose cell in that column is tab-terminated,\n // and every cell of the block is padded with spaces to the widest cell of the block\n // plus one. An embedded field (a single cell) and a field without a tag (its type is\n // the trailing cell) end the block of every column they have no cell in, which is\n // what keeps `Exchange` from widening the `exchangeTyped *ExchangeTyped` column.\n const lines = rows.map((cells, row) => {\n let line = cells[0];\n for (let column = 0; column < cells.length - 1; column++) {\n let width = 0;\n for (let previous = row; previous >= 0 && rows[previous].length > column + 1; previous--) {\n width = Math.max(width, rows[previous][column].length);\n }\n for (let next = row + 1; next < rows.length && rows[next].length > column + 1; next++) {\n width = Math.max(width, rows[next][column].length);\n }\n line += ' '.repeat(width + 1 - cells[column].length) + cells[column + 1];\n }\n return this.getIden(indentation + 1) + line;\n });\n\n // a struct with no fields is `type X struct {\\n}`: no stray blank line before the brace\n const body = lines.length ? '\\n' + lines.join('\\n') + '\\n' : '\\n';\n return `type ${this.className} struct {${body}}`;\n }\n\n printNewStructMethod(node){\n return `\nfunc New${this.capitalize(this.className)}() *${(this.className)} {\n\\tp := &${this.className}{}\n\\tsetDefaults(p)\n\\treturn p\n}\\n`;\n // TO remove `return copies lock value: github.com/ccxt/ccxt/go/v4.bitvavoWs contains github.com/ccxt/ccxt/go/v4.bitvavo contains github.com/ccxt/ccxt/go/v4.Exchange contains sync.Mutex`\n // change the return value to\n //\n // return `\n // func New${this.capitalize(className)}() *${(className)} {\n // p := ${className}{}\n // setDefaults(&p)\n // return &p\n // }\\n`;\n //\n\n }\n\n printClass(node, identation) {\n this.className = node.name.text;\n if (this.classNameMap[this.className]) {\n this.className = this.classNameMap[this.className];\n }\n\n const struct = this.printStruct(node, identation);\n const newMethod = this.printNewStructMethod(node);\n\n const methods = node.members.filter(member => member.kind === SyntaxKind.MethodDeclaration);\n const classMethods = this.joinTopLevelDecls(methods.map(method => this.printMethodDeclaration(method, identation)));\n // const classDefinition = this.printClassDefinition(node, identation);\n\n // const classBody = this.printClassBody(node, identation);\n\n // const classClosing = this.getBlockClose(identation);\n\n // return classDefinition + classBody + classClosing;\n return struct + \"\\n\" + newMethod + \"\\n\" + classMethods;\n }\n\n /**\n * gofmt's declaration-list rule (go/printer nodes.go `declList`): a top-level\n * declaration that carries a doc comment is separated from the previous declaration\n * by exactly one blank line (`min = 2` linebreaks), while a declaration without one\n * keeps the source's own separation (the printer emits members adjacent to the\n * closing brace above them). `printClass` used to join every member with a bare\n * \"\\n\", so a method whose leading `/** ... *` + `/` comment follows the previous\n * method's closing brace came out as `}\\n/**` and gofmt re-inserted the blank line.\n */\n joinTopLevelDecls (decls: string[]): string {\n return decls.map((decl, index) => {\n if (index === 0) {\n return decl;\n }\n return (this.startsWithComment(decl) ? \"\\n\\n\" : \"\\n\") + decl;\n }).join(\"\");\n }\n\n /**\n * True when the emitted declaration text opens with its doc comment - the comment\n * group gofmt attaches to the declaration (`getDoc(d) != nil` in go/printer).\n */\n startsWithComment (decl: string): boolean {\n return this.isComment(decl.split(\"\\n\")[0]);\n }\n\n /**\n * Indent every non-blank line of `lines` by `identation` levels. gofmt trims trailing\n * whitespace, so an indented *blank* line (only the indentation of a blank source\n * line) must stay empty instead of becoming whitespace-only text.\n */\n indentLines (lines: string[], identation: number): string[] {\n return lines.map((line) => line.trim().length === 0 ? \"\" : this.getIden(identation) + line);\n }\n\n printPropertyAccessModifiers (node) {\n return \"\";\n }\n\n printSpreadElement(node, identation) {\n const expression = this.printNode(node.expression, 0);\n return this.getIden(identation) + expression + this.SPREAD_TOKEN;\n }\n\n printMethodDeclaration(node, identation) {\n const methodDef = this.printMethodDefinition(node, identation);\n const isAsync = this.isAsyncFunction(node);\n const funcBody = this.printFunctionBody(node, identation, isAsync);\n if (!isAsync) {\n return methodDef + funcBody;\n }\n return this.printAsyncDeclarationPair(node, identation, methodDef, funcBody, true);\n }\n\n // Trampoline + body pair, see printAsyncTrampolineBlock. A module-scope `async function`\n // has no receiver: its body is a package-level sibling with the same trampoline contract.\n printAsyncDeclarationPair(node, identation, def: string, funcBody: string, isMethod: boolean): string {\n const goName = this.transformMethodNameIfNeeded(node.name.text);\n const bodyName = this.getAsyncBodyName(node, goName);\n const callee = isMethod ? `${this.THIS_TOKEN}.${bodyName}` : bodyName;\n const trampoline = def + this.printAsyncTrampolineBlock(node, identation, callee);\n const receiver = isMethod ? `(${this.THIS_TOKEN} *${this.className}) ` : \"\";\n const bodyDef = `${this.getIden(identation)}func ${receiver}${bodyName}(${this.printAsyncBodyParameters(node)}) ${this.DEFAULT_RETURN_TYPE} `;\n return trampoline + \"\\n\" + bodyDef + funcBody;\n }\n\n printFunctionDeclaration(node, identation) {\n if (isArrowFunction(node)) {\n const parameters = node.parameters.map(param => this.printParameter(param)).join(\", \");\n const body = this.printNode(node.body);\n return `(${parameters}) => ${body}`;\n }\n const isAsync = this.isAsyncFunction(node);\n const functionDef = this.printFunctionDefinition(node, identation);\n const funcBody = this.printFunctionBody(node, identation, isAsync);\n\n // printFunctionDefinition already carries the leading comment\n if (!isAsync) {\n return functionDef + funcBody;\n }\n return this.printAsyncDeclarationPair(node, identation, functionDef, funcBody, false);\n }\n\n /**\n * Name of the sibling *body* method/function an async core hands its work to.\n *\n * `FetchTicker` -> `fetchTickerBody`. Deliberately UNEXPORTED: the body is an\n * implementation detail of the trampoline, so it must not show up on the generated\n * interfaces (ICoreExchange) nor on the typed `*_wrapper.go` facades, and it stays\n * invisible to the reflection based `callInternal`/`callDynamically` dispatch.\n *\n * If that name is already taken by a real declaration (a hand written\n * `fetchTickerBody`), a numeric suffix is appended instead of silently clobbering it.\n */\n getAsyncBodyName(node, goName: string): string {\n const taken = new Set();\n const remember = (raw) => {\n if (!raw) {\n return;\n }\n const name = String(raw);\n taken.add(name);\n try {\n taken.add(this.transformMethodNameIfNeeded(name));\n } catch {\n // a malformed name must never break emission\n }\n };\n try {\n const parent = node?.parent;\n if (parent && isClassDeclarationNode(parent)) {\n parent.members.forEach((member: any) => remember(member?.name?.text));\n } else if (parent && isSourceFile(parent)) {\n parent.statements.forEach((statement: any) => {\n if (isFunctionDeclaration(statement)) {\n remember(statement?.name?.text);\n }\n });\n }\n } catch {\n // a malformed/synthesised node must never break emission\n }\n const base = goName.charAt(0).toLowerCase() + goName.slice(1) + this.ASYNC_BODY_SUFFIX;\n let name = base;\n let suffix = 0;\n while (taken.has(name)) {\n suffix++;\n name = `${base}${suffix}`;\n }\n return name;\n }\n\n /**\n * Parameter list of the body: the channel it must fill, then the original parameters\n * verbatim (including the `optionalArgs ...any` tail), so the trampoline can forward\n * its own arguments unchanged.\n */\n printAsyncBodyParameters(node): string {\n const params = this.printMethodParameters(node);\n const channelParam = `ch chan ${this.DEFAULT_RETURN_TYPE}`;\n return params ? `${channelParam}, ${params}` : channelParam;\n }\n\n /**\n * Arguments the trampoline forwards to its body, matching printMethodParameters:\n * the declared parameters in order, plus the variadic `optionalArgs...` tail when\n * the function has any defaulted parameter.\n */\n printAsyncTrampolineArgs(node): string {\n const args = [];\n let hasOptionalParameter = false;\n (node?.parameters ?? []).forEach((param) => {\n if (param.initializer) {\n hasOptionalParameter = true;\n return;\n }\n args.push(this.printNode(param.name, 0));\n });\n if (hasOptionalParameter) {\n args.push('optionalArgs...');\n }\n return args.join(\", \");\n }\n\n /**\n * The trampoline: an async core hands back a *hot handle*.\n *\n * func (this *Exchange) FetchTicker(symbol any) <-chan any {\n * ch := make(chan any, 1)\n * go this.fetchTickerBody(ch, symbol)\n * return ch\n * }\n *\n * - `ch` is buffered (cap 1): the body's single `ch <- value` never blocks, so a\n * result nobody ever receives still lets the goroutine finish and run\n * `defer close(ch)` (no leak for abandoned calls).\n * - the body runs on its own goroutine, so the call expression returns immediately\n * with work already in flight. That is what makes\n * `const a = this.fetchA (); const b = this.fetchB (); await Promise.all([a,b])`\n * overlap, exactly like the C#/Java ports, with no call-site wrapper.\n * - the result stays UNNAMED (`<-chan any`): `return ch` is the trampoline's only\n * statement and it always runs, because the recover (`defer ReturnPanicError(ch)`)\n * lives on the body, not here.\n */\n printAsyncTrampolineBlock(node, identation, callee: string): string {\n const args = this.printAsyncTrampolineArgs(node);\n const argList = args ? `, ${args}` : \"\";\n return [\n // F04: the signature above ends WITHOUT a trailing space, so the block opener\n // carries the one space before `{` (same contract as getBlockOpen)\n \" {\",\n `${this.getIden(identation + 1)}ch := make(chan ${this.DEFAULT_RETURN_TYPE}, 1)`,\n `${this.getIden(identation + 1)}go ${callee}(ch${argList})`,\n `${this.getIden(identation + 1)}return ch`,\n `${this.getIden(identation)}}`,\n ].join(\"\\n\");\n }\n\n /**\n * Go name of an async (channel returning) declaration: `fetchTicker` -> `FetchTickerAsync`.\n * Empty `asyncMethodSuffix` (the default) keeps the plain name, so the suffix is opt-in.\n */\n printAsyncDeclarationName(node, goName: string): string {\n if (!this.asyncMethodSuffix || !this.isAsyncFunction(node)) {\n return goName;\n }\n return goName + this.asyncMethodSuffix;\n }\n\n /**\n * Resolve the declaration a call/property access refers to and append `asyncMethodSuffix`\n * when it is an async function. Uses the checker, so `this.x()`, `super.x()`, `obj.x()` and\n * bare `x()` all agree with the declaration site. Unresolvable or non-function symbols\n * (properties, `any` receivers, JS builtins) keep the plain name.\n */\n applyAsyncSuffixToCallee(nameNode, goName: string): string {\n if (!this.asyncMethodSuffix || !nameNode) {\n return goName;\n }\n let decls;\n try {\n let symbol = this.getChecker().getSymbolAtLocation(nameNode);\n if (symbol && (symbol.flags & SymbolFlags.Alias)) {\n symbol = this.getChecker().getAliasedSymbol(symbol);\n }\n decls = symbol?.declarations?.map((d) => d.resolve());\n } catch {\n return goName;\n }\n if (!decls || decls.length === 0) {\n return goName;\n }\n // only declarations with a body count: interface/abstract signatures (e.g. implicit API\n // endpoints declared as `foo(params?: {}): Promise;`) are emitted elsewhere, unsuffixed\n const isAsyncDecl = decls.some((d) => (isMethodDeclaration(d) || isFunctionDeclaration(d))\n && d.body !== undefined && this.isAsyncFunction(d) && !this.isAsyncSuffixExempt(d));\n return isAsyncDecl ? goName + this.asyncMethodSuffix : goName;\n }\n\n isAsyncSuffixExempt(decl): boolean {\n if (this.asyncSuffixExemptPaths.length === 0) {\n return false;\n }\n const fileName = String(decl.getSourceFile()?.fileName ?? '').replace(/\\\\/g, '/');\n return this.asyncSuffixExemptPaths.some((re) => re.test(fileName));\n }\n\n printMethodDefinition(node, identation) {\n return this.printGoSignature(node, identation, `(${this.THIS_TOKEN} *${this.className}) `);\n }\n\n printFunctionDefinition(node, identation) {\n return this.printGoSignature(node, identation, \"\");\n }\n\n // F04: `func`, the receiver, the name and the return type are separated by exactly one\n // space, and the signature carries NO trailing space — the block opener (`getBlockOpen`,\n // or `printAsyncTrampolineBlock`) contributes the single space before `{`.\n printGoSignature(node, identation, receiver: string): string {\n const name = this.printAsyncDeclarationName(node, this.transformMethodNameIfNeeded(node.name.text));\n const returnType = this.printFunctionType(node).trim();\n const parsedArgs = this.printMethodParameters(node);\n const methodToken = this.METHOD_TOKEN ? this.METHOD_TOKEN + \" \" : \" \";\n const returnSignature = returnType ? \" \" + returnType : \"\";\n const methodDef = this.getIden(identation) + methodToken + receiver + name + \"(\" + parsedArgs + \")\" + returnSignature;\n return this.printNodeCommentsIfAny(node, identation, methodDef);\n }\n\n printMethodParameters(node) {\n const params = node.parameters.map(param => this.printParameter(param));\n const required = params.filter(param => param !== 'optional');\n if (required.length < params.length) {\n required.push('optionalArgs ...any');\n }\n return required.join(\", \");\n }\n\n printParameter(node, defaultValue = true) {\n const name = this.printNode(node.name, 0);\n const initializer = node.initializer;\n\n const type = this.printParameterType(node);\n\n if (defaultValue && initializer) {\n return 'optional'; // printMethodParameters folds these into `optionalArgs ...any`\n }\n return name + ' ' + type;\n }\n\n printParameterType(node) {\n // B-02: an internal method's parameter that the call-site proof types prints\n // its native Go type; every other parameter keeps the `any` box\n const nativeType = this.goNativeParameterType(node);\n if (nativeType !== undefined) {\n return nativeType;\n }\n return 'any';\n }\n\n printFunctionType(node){\n const typeText = this.getFunctionType(node);\n if (typeText === 'void') {\n return \"\";\n }\n if (typeText === undefined || (typeText !== this.VOID_KEYWORD && typeText !== this.PROMISE_TYPE_KEYWORD)) {\n const res = this.isAsyncFunction(node) ? `<-chan ${this.DEFAULT_RETURN_TYPE}` : this.DEFAULT_RETURN_TYPE;\n this.warn(node, node.name.getText(), \"Function return type not found, will default to: \" + res);\n return res;\n }\n if (typeText === this.PROMISE_TYPE_KEYWORD) {\n return `<-chan any`;\n }\n\n // move any trailing array brackets \"[]\" to directly precede the element type\n if (typeText && typeText.endsWith('[]')) {\n const core = typeText.substring(0, typeText.length - 2); // drop []\n const lastBracketPos = core.lastIndexOf(']');\n if (lastBracketPos !== -1) {\n // insert [] right after the last ']'\n return core.substring(0, lastBracketPos + 1) + '[]' + core.substring(lastBracketPos + 1);\n }\n }\n return typeText;\n }\n\n // true when the printed expression is a single call `Callee(...)` covering the\n // whole string, so its Go type is the callee's return type and nothing else\n isWholePrintedCall(value: string, open: number): boolean {\n let depth = 0;\n let inString = false;\n let escaped = false;\n for (let i = open; i < value.length; i++) {\n const c = value[i];\n if (inString) {\n if (escaped) { escaped = false; }\n else if (c === '\\\\') { escaped = true; }\n else if (c === '\"') { inString = false; }\n continue;\n }\n if (c === '\"') { inString = true; continue; }\n if (c === '(') { depth++; continue; }\n if (c === ')') {\n depth--;\n if (depth === 0) { return i === value.length - 1; }\n }\n }\n return false;\n }\n\n // the concrete Go type the initializer already produces, or undefined when the\n // printer cannot name it (GetValue, Ternary, Add, ... return any)\n goTypeOfInitializer(initializer, printedValue: string): string | undefined {\n // a `.slice(a, b)` this printer inlines to a Go subscript (or its guarded func\n // literal) still holds a string, so its local keeps the type the helper gave it\n if (this.goIsNativeSliceCall(initializer)) {\n return 'string';\n }\n switch (initializer?.kind) {\n case SyntaxKind.StringLiteral:\n case SyntaxKind.NoSubstitutionTemplateLiteral:\n return 'string';\n case SyntaxKind.TrueKeyword:\n case SyntaxKind.FalseKeyword:\n return 'bool';\n case SyntaxKind.ObjectLiteralExpression:\n return 'map[string]any';\n case SyntaxKind.ArrayLiteralExpression:\n return '[]any';\n case SyntaxKind.PrefixUnaryExpression:\n // `!x` prints `!EvalTruthy(x)`\n return (initializer.operator === SyntaxKind.ExclamationToken) ? 'bool' : undefined;\n case SyntaxKind.ParenthesizedExpression:\n return this.goTypeOfInitializer(initializer.expression, printedValue);\n case SyntaxKind.BinaryExpression: {\n // `a || b` prints `EvalTruthy(a) || EvalTruthy(b)`, a Go bool\n const op = initializer.operatorToken.kind;\n if ((op === SyntaxKind.BarBarToken) || (op === SyntaxKind.AmpersandAmpersandToken)) {\n return 'bool';\n }\n // `a === b` prints either `IsEqual(a, b)` or an inlined `(a == b)`;\n // `a < b` prints either `IsLessThan(a, b)` or an inlined `(a < b)`.\n // All of them are Go bools.\n if ((op === SyntaxKind.EqualsEqualsToken) || (op === SyntaxKind.EqualsEqualsEqualsToken)\n || (op === SyntaxKind.ExclamationEqualsToken) || (op === SyntaxKind.ExclamationEqualsEqualsToken)\n || (ORDERED_COMPARISON_OPERATORS[op] !== undefined)) {\n return 'bool';\n }\n // a `+` chain goNativeStringConcat prints as the Go operator is a Go string\n if ((op === SyntaxKind.PlusToken) && (this.goNativeArithmetic(initializer)?.goType === 'string')) {\n return 'string';\n }\n break;\n }\n case SyntaxKind.CallExpression: {\n // `x.toString()` that printToStringCall inlined to the receiver's own text: the\n // declaration then holds that receiver's value, i.e. the same Go string. Every\n // other receiver keeps the helper call, whose own return type is classified below.\n const property = initializer.expression;\n if ((property?.kind === SyntaxKind.PropertyAccessExpression)\n && (property.name?.text === 'toString')\n && (initializer.arguments?.length === 0)\n && ((this.goOperandStaticType(property.expression, printedValue) === 'string')\n || this.goDerefableStringOperand(property.expression))) {\n return 'string';\n }\n break;\n }\n }\n // `const x = (a === b)` prints the wrapping parentheses of the source\n const value = this.goUnwrapPrintedParens(printedValue);\n const open = value.indexOf('(');\n // the printer's own emissions are immediately-called func literals: the native\n // `key in obj` returns a Go bool (no EvalTruthy round-trip), and a ternary whose\n // arms print as one scalar returns that scalar — both name the value natively\n const literalType = goFuncLiteralReturnType(value);\n if ((literalType !== undefined) && (GO_TYPE_NAMES.indexOf(literalType) >= 0)) {\n return literalType;\n }\n // the nil-guarded `indexOf` literal holds the same Go int GetIndexOf returned\n if (value.startsWith('func() int {') && value.endsWith('}()')) {\n return 'int';\n }\n if (open <= 0 || !this.isWholePrintedCall(value, open)) {\n return undefined;\n }\n const callee = value.substring(0, open);\n if (!/^[A-Za-z_][\\w.]*$/.test(callee)) {\n return undefined;\n }\n return GO_NATIVE_CALL_RETURN_TYPES[callee] ?? GO_HELPER_RETURN_TYPES[callee];\n }\n\n // strips the wrapping parentheses the source (or an operand) printed around a\n // whole expression, so the inner text can be classified\n goUnwrapPrintedParens(printedText: string): string {\n let value = (printedText ?? '').trim();\n while (value.startsWith('(') && this.isWholePrintedCall(value, 0)) {\n value = value.substring(1, value.length - 1).trim();\n }\n return value;\n }\n\n // the concrete Go type of a `var x T = ` local, undefined for `any`\n goLocalStaticType(node): string | undefined {\n const declaration: any = this.getChecker().getSymbolAtLocation(node)?.valueDeclaration?.resolve();\n if (declaration?.kind !== SyntaxKind.VariableDeclaration || declaration.initializer === undefined) {\n return undefined;\n }\n if (declaration.parent?.parent?.kind !== SyntaxKind.FirstStatement) {\n return undefined; // declared with `:=`, where the printer annotates nothing\n }\n if (this.goLocalTypeResolution.has(declaration)) {\n return undefined; // the safety scan below prints an expression using this same local\n }\n // only a top-level answer is stable: nested ones see the recursion guard above\n const topLevel = this.goLocalTypeResolution.size === 0;\n if (topLevel && this.goLocalStaticTypeCache.has(declaration)) {\n return this.goLocalStaticTypeCache.get(declaration);\n }\n this.goLocalTypeResolution.add(declaration);\n try {\n const goType = this.getGoLocalType(declaration, this.printNode(declaration.initializer, 0));\n if (topLevel) {\n this.goLocalStaticTypeCache.set(declaration, goType);\n }\n return goType;\n } finally {\n this.goLocalTypeResolution.delete(declaration);\n }\n }\n\n // `x := ` takes the Go type of the printed initializer, and a `for` initializer carries no\n // annotation, so only decidable literal shapes are named: untyped integer constant is `int`,\n // floating-point is `float64`. Integers not fitting `int` and other initializers keep the helper.\n goInferredLocalStaticType(node): string | undefined {\n const checker: any = this.checkerOrUndefined();\n if (checker === undefined) {\n return undefined;\n }\n const declaration = checker.getSymbolAtLocation(node)?.valueDeclaration?.resolve();\n if (declaration?.kind !== SyntaxKind.VariableDeclaration || declaration.initializer === undefined) {\n return undefined;\n }\n const declarationList = declaration.parent;\n if (declarationList?.kind !== SyntaxKind.VariableDeclarationList\n || declarationList.parent?.kind === SyntaxKind.FirstStatement) {\n return undefined; // the `var x = …` form the printer writes a type on\n }\n const kind = this.goNumericLiteralKind(declaration.initializer);\n if ((kind === 'int') && !this.goLiteralFitsKind(declaration.initializer, 'int')) {\n return undefined;\n }\n return kind;\n }\n\n // `this.` read of a hand-written BaseExchange string field\n goStringFieldStaticType(node, printedText: string): string | undefined {\n const match = /^this\\.([A-Za-z_]\\w*)$/.exec(this.goUnwrapPrintedParens(printedText));\n if (match === null || GO_STRING_FIELD_NAMES.indexOf(match[1]) < 0) {\n return undefined;\n }\n // the struct field is a plain Go `string`: a string cannot be nil, so Add's\n // nil branch is unreachable and every read is the same non-nil string\n return 'string';\n }\n\n // a parameter the printer's own signature printer types with a concrete Go scalar:\n // the emitted Go parameter holds that type at every use, so the operator rule can\n // consume it (the typed-param families re-type `Str`/`Int`/`Num` params this way)\n goDeclaredParamStaticType(node): string | undefined {\n const checker: any = this.checkerOrUndefined();\n if (checker === undefined) {\n return undefined;\n }\n const declaration = checker.getSymbolAtLocation(node)?.valueDeclaration?.resolve();\n if (declaration?.kind !== SyntaxKind.Parameter) {\n return undefined;\n }\n // a defaulted parameter bound through `GetArgString` & co. is that Go scalar\n const bound = this.goGetArgParameterType(declaration);\n if ((bound !== undefined) && (GO_TYPE_NAMES.indexOf(bound) >= 0) && ['string', 'int64', 'float64'].includes(bound)) {\n return bound;\n }\n let type;\n try {\n type = this.printParameterType(declaration);\n } catch (e) {\n return undefined;\n }\n if ((typeof type !== 'string') || (type === 'any') || (GO_TYPE_NAMES.indexOf(type) < 0)) {\n return undefined;\n }\n return this.goTypeNameIsShadowed(this.goEnclosingFunction(declaration), type) ? undefined : type;\n }\n\n // a `*string` local prints a nilable Go pointer; it may only be dereferenced\n // where the checker narrowed it to a non-nilable string (a guard that always\n // exits, an `if (x !== undefined)` block). TypeScript `undefined` == Go nil here.\n goNilProvenStringDeref(node): boolean {\n if (node?.kind !== SyntaxKind.Identifier) {\n return false;\n }\n if (this.goDeclaredTypeOfIdentifier(node) !== '*string') {\n return false;\n }\n const checker: any = this.checkerOrUndefined();\n if (checker === undefined) {\n return false;\n }\n const type = checker.getTypeAtLocation(node);\n return (type.flags & TypeFlags.StringLike) !== 0;\n }\n\n // a `*string` local every write of which is a SafeString-family call with a literal\n // default: that Go method can only return a fresh non-nil pointer, so the local may\n // be deref'd even where the checker offers no narrowing. One write of any other\n goDefaultedSafeStringLocal(node): boolean {\n if (node?.kind !== SyntaxKind.Identifier) {\n return false;\n }\n let declaration;\n try {\n declaration = this.getChecker().getSymbolAtLocation(node)?.valueDeclaration?.resolve();\n } catch (e) {\n return false;\n }\n if ((declaration?.kind !== SyntaxKind.VariableDeclaration) || (declaration.name?.kind !== SyntaxKind.Identifier)) {\n return false;\n }\n if (this.goDeclaredTypeOfIdentifier(node) !== '*string') {\n return false;\n }\n if (!this.goDefaultedSafeStringCall(declaration.initializer)) {\n return false;\n }\n const scope = this.goEnclosingFunction(declaration);\n if (scope === undefined) {\n return false;\n }\n const name = declaration.name.text;\n let everyWriteDefaulted = true;\n const visit = (n) => {\n if (!everyWriteDefaulted) {\n return;\n }\n if ((n.kind === SyntaxKind.Identifier) && (n.text === name) && (n !== declaration.name)) {\n const parent: any = n.parent;\n if ((parent?.kind === SyntaxKind.BinaryExpression) && (parent.left === n)\n && (GO_WRITE_OPERATOR_KINDS.indexOf(parent.operatorToken?.kind) >= 0)) {\n everyWriteDefaulted = (parent.operatorToken.kind === SyntaxKind.EqualsToken)\n && this.goDefaultedSafeStringCall(parent.right);\n return;\n }\n if ((parent?.kind === SyntaxKind.PrefixUnaryExpression) || (parent?.kind === SyntaxKind.PostfixUnaryExpression)) {\n everyWriteDefaulted = false;\n return;\n }\n }\n n.forEachChild(visit);\n };\n scope.forEachChild(visit);\n return everyWriteDefaulted;\n }\n\n // a call to one of the hand-written SafeString-family methods that passes enough\n // arguments for the default and whose default is a literal (never the absent case)\n goDefaultedSafeStringCall(node): boolean {\n const call: any = node;\n if (call?.kind !== SyntaxKind.CallExpression) {\n return false;\n }\n const callee: any = call.expression;\n if ((callee?.kind !== SyntaxKind.PropertyAccessExpression) || (callee.expression?.kind !== SyntaxKind.ThisKeyword)) {\n return false;\n }\n const arity = GO_DEFAULTED_SAFE_STRING_ARITY[callee.name?.text];\n if ((arity === undefined) || ((call.arguments?.length ?? 0) < arity)) {\n return false;\n }\n const last: any = call.arguments[call.arguments.length - 1];\n return GO_NON_NIL_DEFAULT_KINDS.indexOf(last?.kind) >= 0;\n }\n\n // a `*string` leaf the concat may deref: the checker narrowed it to a non-nilable\n // string at that use, a local whose every write is a defaulted SafeString-family\n // call, or such a call inline\n goDerefableStringOperand(node): boolean {\n if (this.goNilProvenStringDeref(node)) {\n return true;\n }\n if (node?.kind === SyntaxKind.Identifier) {\n return this.goDefaultedSafeStringLocal(node);\n }\n return this.goDefaultedSafeStringCall(node);\n }\n\n // the printed text of a `+` operand the concat rule may use: the printer's own\n // text for a proven string, or the deref goNativeBinaryText adds for a derefable\n // `*string` leaf. undefined keeps the helper call.\n goStringConcatOperandType(node, printedText: string): string | undefined {\n if (this.goConcatDerefableStringOperand(node)) {\n return 'string';\n }\n return (this.goOperandStaticType(node, printedText) === 'string') ? 'string' : undefined;\n }\n\n // `Add(Add(a, \"lit\"), b)` and every other `+` chain whose leaves are all non-nil\n // Go strings: the runtime Add only ever takes its string branch for those, so the\n // chain prints as the Go operator (`a + \"lit\" + b`). Anything else keeps the call.\n goNativeStringConcat(node, leftText: string, rightText: string): { goType: string, text: string } | undefined {\n if (this.goStringConcatOperandType(node.left, leftText) === undefined\n || this.goStringConcatOperandType(node.right, rightText) === undefined) {\n return undefined;\n }\n return { 'goType': 'string', 'text': this.goNativeBinaryText(node, '+', leftText, rightText) };\n }\n\n // Go static type of an operand's printed form: 'string', 'int', 'int64',\n // 'float64', or 'const-int' / 'const-float' (an untyped literal). undefined when\n // the printer cannot name it — a nilable/`any` operand keeps the helper call.\n goOperandStaticType(node, printedText: string): string | undefined {\n switch (node?.kind) {\n case SyntaxKind.StringLiteral:\n case SyntaxKind.NoSubstitutionTemplateLiteral:\n return 'string';\n case SyntaxKind.NumericLiteral:\n return /^[0-9]+$/.test(node.text) ? 'const-int' : this.goConstFloatStaticType(node);\n case SyntaxKind.ParenthesizedExpression:\n return this.goOperandStaticType(node.expression, this.goUnwrapPrintedParens(printedText));\n case SyntaxKind.BinaryExpression:\n return this.goConstantProductKind(node) ?? this.goNativeArithmeticType(node);\n case SyntaxKind.Identifier:\n return this.goLocalStaticType(node) ?? this.goInferredLocalStaticType(node) ?? this.goDeclaredParamStaticType(node);\n case SyntaxKind.PropertyAccessExpression:\n // `a.length` / `s.replace(...)` print as helper calls, `this.Id` as a field\n return this.goStringFieldStaticType(node, printedText) ?? this.goStringCallStaticType(node, printedText);\n }\n return this.goStringCallStaticType(node, printedText);\n }\n\n // the Go type the printed expression already produces; '*string' / '*int64'\n // helpers box a nilable pointer, so those keep the helper call as well\n goStringCallStaticType(node, printedText: string): string | undefined {\n // the operator needs the printed expression's *static* Go type. A helper whose\n // Go signature returns `any` (GetValue, Ternary, ...) prints an interface box even\n // when a classifier can name the value inside it — that value only becomes\n // typed through an assertion at a declaration, never inline as an operand.\n if (GO_ANY_BOX_CALLS.indexOf(this.goPrintedCallee(printedText)) >= 0) {\n return undefined;\n }\n const goType = this.goTypeOfInitializer(node, printedText);\n return ('string' === goType || 'int' === goType || 'int64' === goType || 'float64' === goType) ? goType : undefined;\n }\n\n // an untyped Go floating-point constant: the helper boxes it as float64 and the\n // compiler converts the operand to float64 the same way\n goConstFloatStaticType(node): string | undefined {\n const text = node?.text;\n if ((typeof text !== 'string') || !/^[0-9][.eE]/.test(text)) {\n return undefined;\n }\n return Number.isFinite(Number(text.replaceAll('_', ''))) ? 'const-float' : undefined;\n }\n\n isNonZeroIntegerLiteral(node): boolean {\n if (node?.kind === SyntaxKind.ParenthesizedExpression) {\n return this.isNonZeroIntegerLiteral(node.expression);\n }\n return node?.kind === SyntaxKind.NumericLiteral && /^[1-9][0-9]*$/.test(node.text);\n }\n\n isNonZeroFloatLiteral(node): boolean {\n if (node?.kind === SyntaxKind.ParenthesizedExpression) {\n return this.isNonZeroFloatLiteral(node.expression);\n }\n return (this.goConstFloatStaticType(node) !== undefined) && (Number(node.text.replaceAll('_', '')) !== 0);\n }\n\n // the exact value of a constant-only integer expression, undefined otherwise. Go folds `a * b`\n // over literals in arbitrary precision, so it must fit `int` and stay exact for the helper's\n // float64 path — the bound the caller checks.\n goConstantIntValue(node): number | undefined {\n if (node?.kind === SyntaxKind.ParenthesizedExpression) {\n return this.goConstantIntValue(node.expression);\n }\n if (node?.kind === SyntaxKind.NumericLiteral) {\n return /^[0-9]+$/.test(node.text) ? Number(node.text) : undefined;\n }\n if (node?.kind !== SyntaxKind.BinaryExpression) {\n return undefined;\n }\n const left = this.goConstantIntValue(node.left);\n const right = (left === undefined) ? undefined : this.goConstantIntValue(node.right);\n if (right === undefined) {\n return undefined;\n }\n switch (node.operatorToken.kind) {\n case SyntaxKind.PlusToken: return left + right;\n case SyntaxKind.MinusToken: return left - right;\n case SyntaxKind.AsteriskToken: return left * right;\n case SyntaxKind.SlashToken: return (right === 0) ? undefined : Math.trunc(left / right);\n case SyntaxKind.PercentToken: return (right === 0) ? undefined : left % right;\n }\n return undefined;\n }\n\n // an arithmetic expression that is the whole initializer of a printed `var x T = ...`: the\n // declared-local table owns that position (naming int64 when its int-kind proof holds, with the\n // forced unbox), so the operator rule leaves the call to it.\n goInsideTypedDeclarationInitializer(node): boolean {\n let current = node;\n while (current !== undefined) {\n const parent = current.parent;\n if (parent?.kind === SyntaxKind.ParenthesizedExpression && (parent.expression === current)) {\n current = parent;\n continue;\n }\n if (parent?.kind === SyntaxKind.BinaryExpression && ((parent.left === current) || (parent.right === current))\n && (GO_ARITHMETIC_KINDS.indexOf(parent.operatorToken.kind) >= 0)) {\n current = parent;\n continue;\n }\n break;\n }\n const declaration = current?.parent;\n if (declaration?.kind !== SyntaxKind.VariableDeclaration || declaration.initializer !== current) {\n return false;\n }\n // the printer annotates `var x T = ...` only; `x := ...` carries the\n // initializer's own type instead\n return declaration.parent?.parent?.kind === SyntaxKind.FirstStatement;\n }\n\n // The bare Go operator must yield what the runtime helper returns (go/v4/exchange_helpers.go):\n // Add keeps int/int64, while Subtract/Multiply/Divide/Mod take an exact int64 path or a float64\n // path, so only the rows below are equivalent.\n goNativeNumericResultType(op, leftType: string, rightType: string, node): string | undefined {\n const isIntKind = (kind: string) => (kind === 'int') || (kind === 'int64') || (kind === 'const-int');\n const isFloatKind = (kind: string) => (kind === 'float64') || (kind === 'const-float');\n const leftNode = node.left;\n const rightNode = node.right;\n const constKinds = ['const-int', 'const-float'];\n if ((op === SyntaxKind.AsteriskToken) && constKinds.includes(leftType) && constKinds.includes(rightType)) {\n // literal products fold as exact Go constants (may differ from the float64 helper in the last bit)\n return this.goNativeConstantProductType(node, leftType, rightType);\n }\n if (isFloatKind(leftType) !== isFloatKind(rightType)) {\n return undefined; // Go has no operator that mixes an int and a float64 operand\n }\n if (isFloatKind(leftType) && isFloatKind(rightType)) {\n // the helper's float path is float64 arithmetic; its integral result boxes\n // as int64, the same normalization Subtract/Multiply/Divide already accept.\n // A constant operand must stay exactly representable: Go folds a constant\n if (op === SyntaxKind.PercentToken) {\n return undefined; // Mod is math.Mod, no Go operator matches it\n }\n if (((leftType === 'const-float') && (rightType === 'const-float'))) {\n return undefined; // only a value the compiler folds exactly would match\n }\n if ((op === SyntaxKind.SlashToken) && !this.isNonZeroFloatLiteral(rightNode)) {\n return undefined; // Divide returns nil on a zero divisor, / gives Inf\n }\n return 'float64';\n }\n if (!isIntKind(leftType) || !isIntKind(rightType)) {\n return undefined; // string / nilable / `any` operand: the helper's nil paths stay\n }\n if ((leftType === 'int64' && rightType === 'int') || (leftType === 'int' && rightType === 'int64')) {\n return undefined; // neither operand is untyped, Go refuses to mix the kinds\n }\n if ((leftType === 'const-int') && (rightType === 'const-int')) {\n // a constant-only expression is folded in arbitrary precision by the Go\n // compiler: require a value both kinds hold exactly, so no `constant\n // overflows int` and the helper's float64 path is exact as well\n const value = this.goConstantIntValue(node);\n if ((value === undefined) || (Math.abs(value) > Number.MAX_SAFE_INTEGER)) {\n return undefined;\n }\n }\n const operands = ((leftType === 'int64') || (rightType === 'int64')) ? 'int64' : 'int';\n if (op === SyntaxKind.PlusToken) {\n // Add keeps its own int/int64 rows: its box carries the operand kind\n return operands;\n }\n if ((op === SyntaxKind.SlashToken) && this.isNonZeroIntegerLiteral(rightNode)) {\n return 'float64'; // JS division: goNativeArithmetic converts the operands to float64\n }\n if ((operands === 'int') && this.goInsideTypedDeclarationInitializer(node)) {\n // the declared-local table names this position int64 when its int-kind\n // proof holds, and the `int` an operator would yield is not that type\n return undefined;\n }\n if (op === SyntaxKind.PercentToken) {\n // Mod is math.Mod over float64: exact for integral operands, but a zero\n // divisor boxes NaN where % panics, so only a literal divisor is decidable\n return this.isNonZeroIntegerLiteral(rightNode) ? operands : undefined;\n }\n if ((op === SyntaxKind.SlashToken) && !this.isNonZeroIntegerLiteral(rightNode)) {\n return undefined; // Divide returns nil on a zero divisor, the operator panics\n }\n // int64 in, int64 out: Subtract goes through ParseInt, Multiply/Mod use reflect Int()\n return operands;\n }\n\n // a literal-only `*` chain is itself an untyped Go constant, so an enclosing product folds too\n goConstantProductKind(node): string | undefined {\n if (node?.kind === SyntaxKind.ParenthesizedExpression) {\n return this.goConstantProductKind(node.expression);\n }\n if (node?.kind === SyntaxKind.NumericLiteral) {\n return /^[0-9]+$/.test(node.text) ? 'const-int' : this.goConstFloatStaticType(node);\n }\n if ((node?.kind !== SyntaxKind.BinaryExpression) || (node.operatorToken.kind !== SyntaxKind.AsteriskToken)) {\n return undefined;\n }\n const left = this.goConstantProductKind(node.left);\n const right = (left === undefined) ? undefined : this.goConstantProductKind(node.right);\n if ((right === undefined) || (this.goNativeConstantProductType(node, left, right) === undefined)) {\n return undefined;\n }\n return ((left === 'const-float') || (right === 'const-float')) ? 'const-float' : 'const-int';\n }\n\n // `2 * 1.67` is an untyped float constant (float64); an integer chain stays an untyped int\n // constant, which a typed `var x int64 = ...` declaration converts, so it is named int64 there.\n goNativeConstantProductType(node, leftType: string, rightType: string): string | undefined {\n if ((leftType === 'const-float') || (rightType === 'const-float')) {\n return 'float64';\n }\n const value = this.goConstantIntValue(node);\n if ((value === undefined) || (Math.abs(value) > Number.MAX_SAFE_INTEGER)) {\n return undefined;\n }\n return this.goInsideTypedDeclarationInitializer(node) ? 'int64' : 'int';\n }\n\n // an operand that is itself a bare operator expression needs parens under a\n // tighter parent operator; a whole helper call is already delimited\n goNativeOperandText(node, printedText: string): string {\n const text = printedText.trim();\n if (node?.kind !== SyntaxKind.BinaryExpression || text.startsWith('(')) {\n return text;\n }\n const open = text.indexOf('(');\n if (open > 0 && this.isWholePrintedCall(text, open)) {\n return text;\n }\n // `a + b` on strings is the only shape that can never sit under a tighter\n // operator, so it is the only one left unwrapped\n return (this.goOperandStaticType(node, text) === 'string') ? text : '(' + text + ')';\n }\n\n // goNativeArithmetic's Go type for an operand (memoized within the enclosing binary print)\n goNativeArithmeticType(node): string | undefined {\n const key = `type|${this.goBinaryContextKey()}`;\n return this.goBinaryMemoized(node, key, () => this.goNativeArithmetic(node)?.goType);\n }\n\n // `Add(a, b)` & co. become the Go operator when both printed operands already\n // hold a concrete Go type the helper would return unchanged; undefined keeps the\n // helper call (nil branches, `any` boxes, strings passed to Subtract, ...).\n goNativeArithmetic(node, leftText = undefined, rightText = undefined): { goType: string, text: string } | undefined {\n const op = node.operatorToken.kind;\n if (GO_ARITHMETIC_KINDS.indexOf(op) < 0) {\n return undefined;\n }\n leftText = leftText ?? this.printNode(node.left, 0);\n rightText = rightText ?? this.printNode(node.right, 0);\n if (op === SyntaxKind.PlusToken) {\n const concat = this.goNativeStringConcat(node, leftText, rightText);\n if (concat !== undefined) {\n return concat;\n }\n }\n const pointerSubtraction = this.goNonNilPointerSubtractionText(node, leftText, rightText);\n if (pointerSubtraction !== undefined) {\n return { 'goType': 'int64', 'text': pointerSubtraction };\n }\n const pointerProduct = this.goNonNilPointerProductText(node, leftText, rightText);\n if (pointerProduct !== undefined) {\n return { 'goType': 'int64', 'text': pointerProduct };\n }\n const pointerDivision = this.goNonNilPointerDivisionText(node, leftText, rightText);\n if (pointerDivision !== undefined) {\n return { 'goType': 'float64', 'text': pointerDivision };\n }\n const leftType = this.goOperandStaticType(node.left, leftText);\n const rightType = this.goOperandStaticType(node.right, rightText);\n if (leftType === undefined || rightType === undefined) {\n return undefined;\n }\n if (leftType === 'string' || rightType === 'string') {\n if (leftType !== 'string' || rightType !== 'string' || op !== SyntaxKind.PlusToken) {\n return undefined; // the other four helpers return nil for strings\n }\n return { 'goType': 'string', 'text': this.goNativeBinaryText(node, '+', leftText, rightText) };\n }\n const widened = this.goNativeIntWideningArithmetic(node, leftType, rightType, leftText, rightText);\n if (widened !== undefined) {\n return widened;\n }\n const goType = this.goNativeNumericResultType(op, leftType, rightType, node);\n if (goType === undefined) {\n return undefined;\n }\n const isIntKind = (kind: string) => (kind === 'int') || (kind === 'int64') || (kind === 'const-int');\n if ((op === SyntaxKind.SlashToken) && isIntKind(leftType) && isIntKind(rightType)) {\n return { goType, 'text': this.goFloatDivisionText(node, leftType, rightType, leftText, rightText) };\n }\n return { goType, 'text': this.goNativeBinaryText(node, this.SupportedKindNames[op], leftText, rightText) };\n }\n\n // `a - b` where each side is a non-nil `*int64` (dereferenced), an int64 value or an int literal and at\n // least one side is a pointer: Subtract's integral result is the same int64 box\n goNonNilPointerSubtractionText(node, leftText: string, rightText: string): string | undefined {\n if (node.operatorToken.kind !== SyntaxKind.MinusToken) {\n return undefined;\n }\n const left = this.goInt64Operand(node.left, leftText);\n const right = (left === undefined) ? undefined : this.goInt64Operand(node.right, rightText);\n if ((right === undefined) || (!left.pointer && !right.pointer)) {\n return undefined;\n }\n return left.text + ' - ' + right.text;\n }\n\n goInt64Operand(node, printedText: string): { pointer: boolean, text: string } | undefined {\n const text = this.goUnwrapPrintedParens(printedText.trim());\n if (node?.kind === SyntaxKind.ParenthesizedExpression) {\n return this.goInt64Operand(node.expression, text);\n }\n if (node?.kind === SyntaxKind.NumericLiteral) {\n return (/^[0-9]+$/.test(node.text) && (Number(node.text) <= Number.MAX_SAFE_INTEGER)) ? { 'pointer': false, text } : undefined;\n }\n if (node?.kind === SyntaxKind.Identifier) {\n if ((this.goDeclaredTypeOfIdentifier(node) === '*int64') && this.goPointerNumberIsNonNil(node)) {\n return { 'pointer': true, 'text': '*' + text };\n }\n return (this.goOperandStaticType(node, text) === 'int64') ? { 'pointer': false, text } : undefined;\n }\n if (this.goDefaultedSafeIntegerCall(node)) {\n return { 'pointer': true, 'text': '*' + text };\n }\n if ((node?.kind === SyntaxKind.CallExpression) && (this.goOperandStaticType(node, text) === 'int64')) {\n return { 'pointer': false, text };\n }\n return undefined;\n }\n\n // `a * b` over the same operands as the subtraction (or a nested int64 product): Multiply's\n // Int-kind branch returns the same wrapping int64 product\n goNonNilPointerProductText(node, leftText: string, rightText: string): string | undefined {\n if (node.operatorToken.kind !== SyntaxKind.AsteriskToken) {\n return undefined;\n }\n const left = this.goInt64ProductOperand(node.left, leftText);\n const right = (left === undefined) ? undefined : this.goInt64ProductOperand(node.right, rightText);\n if ((right === undefined) || (!left.pointer && !right.pointer)) {\n return undefined;\n }\n return left.text + ' * ' + right.text;\n }\n\n goInt64ProductOperand(node, printedText: string): { pointer: boolean, text: string } | undefined {\n let inner = node;\n while (inner?.kind === SyntaxKind.ParenthesizedExpression) {\n inner = inner.expression;\n }\n if ((inner?.kind === SyntaxKind.BinaryExpression) && (this.goNativeArithmeticType(inner) === 'int64')) {\n const text = printedText.trim();\n return { 'pointer': false, 'text': text.startsWith('(') ? text : '(' + text + ')' };\n }\n return this.goInt64Operand(node, printedText);\n }\n\n // this.safeInteger{,2,N} with an integer literal default: the Go method returns &default on every nil path\n goDefaultedSafeIntegerCall(node): boolean {\n if ((node?.kind !== SyntaxKind.CallExpression) || (node.expression?.kind !== SyntaxKind.PropertyAccessExpression)\n || (node.expression.expression?.kind !== SyntaxKind.ThisKeyword)) {\n return false;\n }\n const arity = { 'safeInteger': 3, 'safeInteger2': 4, 'safeIntegerN': 3 }[node.expression.name?.text];\n const last = node.arguments?.[arity - 1];\n return (arity !== undefined) && (node.arguments.length === arity) && (last?.kind === SyntaxKind.NumericLiteral)\n && /^[0-9]+$/.test(last.text);\n }\n\n // `x / N` on a non-nil `*int64` with a nonzero integer literal N, passed whole to Math.floor/ceil/round\n // or parseToInt: those read Divide's int64-when-integral box and the float64 quotient alike\n // (`*float64` keeps the helper: -0 and ±Inf box differently)\n goNonNilPointerDivisionText(node, leftText: string, rightText: string): string | undefined {\n if ((node.operatorToken.kind !== SyntaxKind.SlashToken) || !this.isNonZeroIntegerLiteral(node.right)) {\n return undefined;\n }\n const left = node.left;\n const declared = this.goDeclaredTypeOfIdentifier(left);\n if (declared !== '*int64') {\n return undefined;\n }\n if (!this.goPointerNumberIsNonNil(left) || !this.goDivisionConsumerIgnoresBox(node)) {\n return undefined;\n }\n return 'float64(*' + leftText.trim() + ') / ' + this.goUnwrapPrintedParens(rightText.trim());\n }\n\n // the checker narrowed the identifier to a plain number here, or an enclosing guard tests it\n goPointerNumberIsNonNil(ident): boolean {\n if (this.goHasEnclosingNilGuard(ident)) {\n return true;\n }\n const checker: any = this.checkerOrUndefined();\n if (checker === undefined) {\n return false;\n }\n const type = checker.getTypeAtLocation(ident);\n return (type !== undefined) && ((type.flags & TypeFlags.NumberLike) !== 0);\n }\n\n // the division (through parens) is the only argument of this.parseToInt or Math.floor/ceil/round\n goDivisionConsumerIgnoresBox(node): boolean {\n let child = node;\n let parent = node.parent;\n while (parent?.kind === SyntaxKind.ParenthesizedExpression) {\n child = parent;\n parent = parent.parent;\n }\n if ((parent?.kind !== SyntaxKind.CallExpression) || (parent.arguments?.length !== 1) || (parent.arguments[0] !== child)) {\n return false;\n }\n const callee = parent.expression;\n if (callee?.kind !== SyntaxKind.PropertyAccessExpression) {\n return false;\n }\n const owner = callee.expression;\n const name = callee.name?.text;\n if (owner?.kind === SyntaxKind.ThisKeyword) {\n return name === 'parseToInt';\n }\n return (owner?.kind === SyntaxKind.Identifier) && (owner.text === 'Math') && ['floor', 'ceil', 'round'].includes(name);\n }\n\n // int / int is a float64 division as in JS: typed operands convert, and with two constants\n // the left one does (an untyped constant operand then converts implicitly)\n goFloatDivisionText(node, leftType: string, rightType: string, leftText: string, rightText: string): string {\n const castLeft = (leftType !== 'const-int') || (rightType === 'const-int');\n const castRight = rightType !== 'const-int';\n const cast = (printed: string) => 'float64(' + this.goUnwrapPrintedParens(printed.trim()) + ')';\n const left = castLeft ? cast(leftText) : this.goNativeOperandText(node.left, leftText);\n const right = castRight ? cast(rightText) : this.goNativeOperandText(node.right, rightText);\n return left + ' / ' + right;\n }\n\n // the operator line gofmt prints for a natively emitted arithmetic expression: the\n // blanks follow go/printer's cutoff at the current depth, and a binary operand is\n // re-printed at the expression's own depth (a same-precedence left operand, or the\n // parentheses the printer wraps it in, which undo the one level the operand adds)\n goNativeBinaryText(node, symbol: string, leftText: string, rightText: string): string {\n const operandText = (operand, printed: string) => {\n const isBinary = operand?.kind === SyntaxKind.BinaryExpression;\n const text = isBinary ? this.goWithExprDepth(this.goExprDepth, () => this.printNode(operand, 0)) : printed;\n // a derefable `*string` leaf is the only operand that prints in a different\n // shape than the printer produced: the operator needs its pointee\n const leaf = this.goConcatDerefableStringOperand(operand) ? ('*' + text.trim()) : text;\n return this.goNativeOperandText(operand, leaf);\n };\n const left = operandText(node.left, leftText);\n const right = operandText(node.right, rightText);\n const separator = this.goBinarySeparator(symbol, right, node.left, node.right);\n return left + separator + symbol + separator + right;\n }\n\n // `x += y` prints `x = Add(x, y)`; the compound operator is equivalent while\n // both sides hold a concrete Go type that can never make the helper return nil\n goNativeCompoundAssignment(op, leftNode, leftText: string, rightNode, rightText: string): string | undefined {\n const leftType = this.goOperandStaticType(leftNode, leftText);\n const rightType = this.goOperandStaticType(rightNode, rightText);\n if (leftType === undefined || rightType === undefined) {\n return undefined;\n }\n const isAdd = op === SyntaxKind.PlusEqualsToken;\n const isSubtract = op === SyntaxKind.MinusEqualsToken;\n if (!isAdd && !isSubtract) {\n return undefined;\n }\n const stringAdd = leftType === 'string' && isAdd && rightType === 'string';\n const int64Op = leftType === 'int64' && (rightType === 'int64' || rightType === 'const-int');\n if (!stringAdd && !int64Op) {\n return undefined;\n }\n return `${leftText.trim()} ${isAdd ? '+=' : '-='} ${rightText.trim()}`;\n }\n\n goEnclosingFunction(node) {\n let current = node?.parent;\n while (current) {\n switch (current.kind) {\n case SyntaxKind.MethodDeclaration:\n case SyntaxKind.FunctionDeclaration:\n case SyntaxKind.FunctionExpression:\n case SyntaxKind.ArrowFunction:\n case SyntaxKind.Constructor:\n case SyntaxKind.SourceFile:\n return current;\n }\n current = current.parent;\n }\n return undefined;\n }\n\n // a transpiled parameter or local can literally be named `string`, which would\n // turn `var x string = ...` into a reference to that value instead of the type\n goTypeNameIsShadowed(scope, goType: string): boolean {\n const names = goType.match(/[A-Za-z_]\\w*/g) ?? [];\n const relevant = names.filter((n) => GO_TYPE_NAMES.indexOf(n) >= 0);\n if (relevant.length === 0 || scope === undefined) {\n return false;\n }\n return this.hasNodeWhere(scope, (n: any) => {\n const isBinding = (n.kind === SyntaxKind.Parameter) || (n.kind === SyntaxKind.VariableDeclaration);\n if (isBinding && (n.name?.kind === SyntaxKind.Identifier)) {\n if (relevant.indexOf(n.name.text as string) >= 0) { return true; }\n }\n return false;\n });\n }\n\n // the shape `x.push(v)` that both the native emission and the declaration's safety\n // scan accept: the printed `x = append(x, v)` is a statement, so a value position or\n // a multi-argument/spread call still needs the helper\n goIsNativeAppendShape(receiverNode, pushNode): boolean {\n if (receiverNode?.kind !== SyntaxKind.Identifier) {\n return false;\n }\n if (pushNode?.parent?.kind !== SyntaxKind.ExpressionStatement) {\n return false;\n }\n if ((pushNode.questionDotToken !== undefined) || (pushNode.expression?.questionDotToken !== undefined)) {\n return false;\n }\n const access = pushNode.expression;\n if ((access?.kind !== SyntaxKind.PropertyAccessExpression) || (access.expression !== receiverNode)\n || (access.name?.text !== 'push')) {\n return false;\n }\n const args = pushNode.arguments;\n return (args?.length === 1) && (args[0].kind !== SyntaxKind.SpreadElement);\n }\n\n // `x.push(v)` on a local declared `[]any` prints `x = append(x, v)`; undefined keeps\n // AppendToArray(&x, v). An `any` box keeps the helper: `&x` is a *any there, while a declared\n // []any local would pass a *[]any the helper's parameter does not accept.\n goNativeAppendReceiver(pushNode): string | undefined {\n const receiver = pushNode?.expression?.expression;\n if (!this.goIsNativeAppendShape(receiver, pushNode)) {\n return undefined;\n }\n if (this.goDeclaredTypeOfIdentifier(receiver) !== '[]any') {\n return undefined;\n }\n return this.printNode(receiver, 0);\n }\n\n // reject the refinement when something downstream needs the local to stay `any`:\n // `x.push(v)` prints `AppendToArray(&x, v)` (a *T is not a *any) and a later\n // assignment of a value with another concrete type would stop compiling\n goLocalIsSafeToType(scope, declaration, varName: string, goType: string): boolean {\n if (scope === undefined) {\n return false;\n }\n const safe = !this.hasNodeWhere(scope, (n: any) => {\n if ((n.kind === SyntaxKind.Identifier) && (n.text === varName) && (n !== declaration.name)) {\n const parent = n.parent;\n if (parent?.kind === SyntaxKind.PropertyAccessExpression && parent.expression === n\n && parent.name?.text === 'push') {\n // a []any local appends natively, so its receiver may be typed; every\n // other push shape keeps the helper and with it the box\n if ((goType !== '[]any') || !this.goIsNativeAppendShape(n, parent.parent)) {\n return true;\n }\n }\n if (parent?.kind === SyntaxKind.VariableDeclaration && parent.name === n) {\n return; // a sibling block-scoped declaration; it gets its own type\n }\n if ((parent?.kind === SyntaxKind.PostfixUnaryExpression) || (parent?.kind === SyntaxKind.PrefixUnaryExpression)) {\n const op = parent.operator;\n if ((op === SyntaxKind.PlusPlusToken) || (op === SyntaxKind.MinusMinusToken)) {\n return true;\n }\n }\n if (parent?.kind === SyntaxKind.SpreadElement) {\n return true;\n }\n if (parent?.kind === SyntaxKind.ArrayLiteralExpression\n && parent.parent?.kind === SyntaxKind.BinaryExpression\n && parent.parent.left === parent\n && parent.parent.operatorToken.kind === SyntaxKind.EqualsToken\n && !((goType === 'map[string]any') && this.goGetArgTupleWriteIsDict(declaration, parent.parent.right, parent.elements.indexOf(n)))) {\n return true;\n }\n if (parent?.kind === SyntaxKind.BinaryExpression && parent.left === n) {\n const op = parent.operatorToken.kind;\n if (op === SyntaxKind.EqualsToken) {\n if ((goType === 'string') && this.goSelfConcatWriteIsString(parent.right, varName)) {\n return false;\n }\n if ((this.goTypeOfInitializer(parent.right, this.printNode(parent.right, 0)) !== goType)\n && !((declaration.kind === SyntaxKind.VariableDeclaration) && this.goPointerWriteConversion(parent.right, goType) !== undefined)) {\n return true;\n }\n } else if ((op === SyntaxKind.PlusEqualsToken) && (goType === 'string')\n && (this.goOperandStaticType(parent.right, this.printNode(parent.right, 0)) === 'string')) {\n return false;\n } else if ((op >= SyntaxKind.FirstCompoundAssignment) && (op <= SyntaxKind.LastCompoundAssignment)) {\n return true;\n }\n }\n }\n return false;\n });\n return safe;\n }\n\n // `x = <+ chain>` that reads x itself: only a whole chain prints native (a bare\n // derefable leaf would be assigned as the *string it is)\n goSelfConcatWriteIsString(node, varName: string): boolean {\n while (node?.kind === SyntaxKind.ParenthesizedExpression) {\n node = node.expression;\n }\n if ((node?.kind !== SyntaxKind.BinaryExpression) || (node.operatorToken.kind !== SyntaxKind.PlusToken)) {\n return false;\n }\n const readsSelf = this.hasNodeWhere(node, (n: any) => (n.kind === SyntaxKind.Identifier) && (n.text === varName));\n return readsSelf && this.goSelfConcatIsString(node, varName);\n }\n\n // a `+` chain written back into a `string` local (`x = x + \"&\" + y`, `x += y`): every leaf is\n // the local itself (a Go string by the typing being proven) or a proven non-nil Go string,\n // so the chain prints native and the local only ever holds a string\n goSelfConcatIsString(node, varName: string): boolean {\n while (node?.kind === SyntaxKind.ParenthesizedExpression) {\n node = node.expression;\n }\n if ((node?.kind === SyntaxKind.Identifier) && (node.text === varName)) {\n return true;\n }\n if ((node?.kind === SyntaxKind.BinaryExpression) && (node.operatorToken.kind === SyntaxKind.PlusToken)) {\n return this.goSelfConcatIsString(node.left, varName) && this.goSelfConcatIsString(node.right, varName);\n }\n if (this.hasNodeWhere(node, (n: any) => (n.kind === SyntaxKind.Identifier) && (n.text === varName))) {\n return false;\n }\n const cache = this.goSelfConcatLeafCache;\n if (cache.has(node)) {\n return cache.get(node);\n }\n // an answer computed while another local is being resolved may be the guard's `any`\n const settled = (this.goLocalTypeResolution.size === 0);\n const result = this.goStringConcatOperandType(node, this.printNode(node, 0)) === 'string';\n if (settled) {\n cache.set(node, result);\n }\n return result;\n }\n\n // How a write of another shape reaches a pointer-typed local: 'nil' (undefined/null prints nil),\n // 'wrap' (a Go string becomes SafeStringPtr(v), never nil), or undefined (not convertible).\n // Shared by goLocalIsSafeToType (admission) and goPointerWriteText (emission).\n goPointerWriteConversion(right, goType: string): 'nil' | 'wrap' | undefined {\n while (right?.kind === SyntaxKind.ParenthesizedExpression) {\n right = right.expression;\n }\n if (!['*string', '*int64', '*float64'].includes(goType) || right === undefined) {\n return undefined;\n }\n if ((right.kind === SyntaxKind.NullKeyword) || (right.kind === SyntaxKind.UndefinedKeyword)\n || ((right.kind === SyntaxKind.Identifier) && (right.text === 'undefined'))) {\n return 'nil';\n }\n if ((goType === '*string') && (this.goTypeOfInitializer(right, this.printNode(right, 0)) === 'string')) {\n return 'wrap';\n }\n return undefined;\n }\n\n // `x = \"limit\"` on a *string local prints `x = SafeStringPtr(\"limit\")`; undefined otherwise\n goPointerWriteText(node, identation): string | undefined {\n const { left, right } = node;\n if (left?.kind !== SyntaxKind.Identifier) {\n return undefined;\n }\n const decl: any = this.checkerOrUndefined()?.getSymbolAtLocation(left)?.valueDeclaration?.resolve();\n if (decl?.kind !== SyntaxKind.VariableDeclaration) {\n return undefined;\n }\n const goType = this.goDeclaredTypeOfIdentifier(left);\n if ((goType === undefined) || (this.goPointerWriteConversion(right, goType) !== 'wrap')) {\n return undefined;\n }\n const value = this.goWithExprDepth(this.goExprDepth + 1, () => this.printNode(right, identation)).trim();\n return `${this.printNode(left, 0)} = SafeStringPtr(${value})`;\n }\n\n // the container/key argument nodes of a whole `this.SafeDict(container, key)` call, or undefined\n // for another shape. A third argument is droppable only when it is the empty map literal\n // (`safeDict(x, k, {})`), which no whitelisted read could observe.\n goSafeDictLocalArgs(initializer) {\n return this.goSafeAccessorLocalArgs(initializer, 'safeDict', SyntaxKind.ObjectLiteralExpression, 'properties');\n }\n\n // shared by the dict/list rules: `this.(container, key[, ])`\n goSafeAccessorLocalArgs(initializer, accessor: string, fallbackKind: SyntaxKind, fallbackItems: string) {\n if (initializer?.kind !== SyntaxKind.CallExpression) {\n return undefined;\n }\n const callee: any = initializer.expression;\n if (callee?.kind !== SyntaxKind.PropertyAccessExpression || callee.name?.text !== accessor) {\n return undefined;\n }\n if (callee.expression?.kind !== SyntaxKind.ThisKeyword) {\n return undefined;\n }\n const args = initializer.arguments;\n if (args.length === 3) {\n const fallback = args[2];\n if (fallback?.kind !== fallbackKind || fallback[fallbackItems].length !== 0) {\n return undefined;\n }\n } else if (args.length !== 2) {\n return undefined;\n }\n return { container: args[0], key: args[1] };\n }\n\n // one later use of a dict local: it must read the value as a dictionary, never hand the\n // box out. Only the receiver position of the deref-aware read helpers, the `this.Safe*`\n // accessors and a plain `x[k]` element read qualify.\n goSafeDictUseReadsTheMap(node): boolean {\n const parent: any = node.parent;\n if (parent === undefined) {\n return false;\n }\n switch (parent.kind) {\n case SyntaxKind.ElementAccessExpression: {\n if (parent.expression !== node) {\n return false; // x as an index key\n }\n const grandparent: any = parent.parent;\n if (grandparent?.kind === SyntaxKind.BinaryExpression && grandparent.left === parent) {\n return false; // `x[k] = v` / `x[k] += v` writes into the map\n }\n if ((grandparent?.kind === SyntaxKind.PostfixUnaryExpression) || (grandparent?.kind === SyntaxKind.PrefixUnaryExpression)) {\n return false; // `x[k]++` / `&x[k]`\n }\n if (grandparent?.kind === SyntaxKind.DeleteExpression) {\n return false;\n }\n return true;\n }\n case SyntaxKind.BinaryExpression: {\n // `key in x` prints `InOp(x, key)`: the helper reads the map and answers false for\n // an absent (nil) map, exactly like the nil interface it used to hold\n return (parent.operatorToken?.kind === SyntaxKind.InKeyword) && (parent.right === node);\n }\n case SyntaxKind.CallExpression: {\n if (parent.expression === node) {\n return false; // the local called as a function\n }\n if (parent.arguments.indexOf(node) !== 0) {\n return false; // value position: the box escapes\n }\n const callee = this.goPrintedCallee(this.printNode(parent, 0));\n if (callee === undefined) {\n return false;\n }\n if (GO_SAFE_DICT_READ_HELPERS.indexOf(callee) >= 0) {\n return true;\n }\n return /^(?:this\\.)?Safe[A-Z]/.test(callee) || (callee === 'this.IsDictionary');\n }\n default:\n return false;\n }\n }\n\n // `var x any = this.SafeDict(container, key)` -> `var x map[string]any = SafeMapTyped(...)`:\n // same member read, and every later use reads the local; with the absent case a nil map,\n // GetValue/InOp/ObjectKeys/IsDictionary and Safe* normalise a nil receiver. Else keep the box.\n goSafeDictLocalUnboxCache = new Map();\n\n // memoised, re-entrancy-guarded typing of a `var x T = …` declaration statement; a for-init\n // or any other shape prints `:=`, where the annotation would not appear\n goCachedLocalUnbox(cache: Map, declaration, compute: () => string | undefined): string | undefined {\n if (declaration?.kind !== SyntaxKind.VariableDeclaration || declaration.name?.kind !== SyntaxKind.Identifier) {\n return undefined;\n }\n if (declaration.parent?.parent?.kind !== SyntaxKind.FirstStatement) {\n return undefined;\n }\n if (cache.has(declaration)) {\n return cache.get(declaration);\n }\n cache.set(declaration, undefined); // in-progress guard\n let result: string | undefined;\n try {\n result = compute();\n } finally {\n cache.set(declaration, result);\n }\n return result;\n }\n\n goSafeDictLocalUnbox(declaration): string | undefined {\n return this.goCachedLocalUnbox(this.goSafeDictLocalUnboxCache, declaration, () => this.goSafeDictLocalUnboxUncached(declaration));\n }\n\n // every read of `declaration`'s name inside its function must keep the boxed value's meaning for\n // the local to take a named Go type: a rebinding mixes two values, and a use `readsTheValue`\n // rejects re-boxes the local. `skipUse` drops nodes that are not references at all.\n goDeclaredLocalTypeIfSafe(declaration, goType: string, readsTheValue: (n: any) => boolean, skipUse?: (n: any) => boolean): string | undefined {\n const sourceName = declaration.name.text as string;\n const scope: any = this.goEnclosingFunction(declaration);\n if (scope === undefined) {\n return undefined;\n }\n const unsafe = this.hasNodeWhere(scope, (n: any) => {\n if ((n.kind === SyntaxKind.VariableDeclaration || n.kind === SyntaxKind.Parameter)\n && (n !== declaration) && (n.name?.kind === SyntaxKind.Identifier) && (n.name.text === sourceName)) {\n return true; // a shadowing binding would mix two values under one name\n }\n if ((n.kind !== SyntaxKind.Identifier) || (n.text !== sourceName) || (n === declaration.name)) {\n return false;\n }\n return (skipUse !== undefined && skipUse(n)) ? false : !readsTheValue(n);\n });\n if (unsafe || this.goTypeNameIsShadowed(scope, goType)) {\n return undefined;\n }\n return goType;\n }\n\n goSafeDictLocalUnboxUncached(declaration): string | undefined {\n if (this.goSafeDictLocalArgs(declaration.initializer) === undefined) {\n return undefined;\n }\n return this.goDeclaredLocalTypeIfSafe(declaration, GO_SAFE_DICT_LOCAL_TYPE, (n) => this.goSafeDictUseReadsTheMap(n));\n }\n\n // the initializer a typed dict local is declared with: the accessor call is replaced by the\n // typed reader, which reads the same member (and converts a sync.Map) but names the result\n goSafeDictUnboxValue(declaration, identation: number): string | undefined {\n if (this.goSafeDictLocalUnbox(declaration) !== GO_SAFE_DICT_LOCAL_TYPE) {\n return undefined;\n }\n const args: any = this.goSafeDictLocalArgs(declaration.initializer);\n const container = this.printNode(args.container, identation);\n const key = this.printNode(args.key, 0);\n return `SafeMapTyped(${container}, ${key})`;\n }\n\n // the TypeScript return type proves the boxed value is the market dictionary: the checker reports\n // the `MarketInterface` interface for `this.Market(...)` / `this.SafeMarket(...)` (the `Market`\n // alias is the same interface unioned with undefined). Read from the checker, never a printed name.\n goMarketCallReturnsDict(initializer): boolean {\n if (initializer?.kind !== SyntaxKind.CallExpression) {\n return false;\n }\n const callee: any = initializer.expression;\n if (callee?.kind !== SyntaxKind.PropertyAccessExpression) {\n return false;\n }\n const name = callee.name?.text;\n if (name === undefined) {\n return false;\n }\n const receiver: any = callee.expression;\n const onThis = receiver?.kind === SyntaxKind.ThisKeyword;\n const onDerived = (receiver?.kind === SyntaxKind.PropertyAccessExpression)\n && (receiver.expression?.kind === SyntaxKind.ThisKeyword)\n && (receiver.name?.text === 'DerivedExchange');\n if (!onThis && !onDerived) {\n return false;\n }\n const checker: any = this.checkerOrUndefined();\n if (checker === undefined) {\n return false;\n }\n const type = checker.getTypeAtLocation(initializer);\n if (type === undefined) {\n return false;\n }\n const isMarketInterface = (t) => {\n const names = [ t?.getSymbol()?.name, t?.getAliasSymbol()?.name ];\n return (names.indexOf('MarketInterface') >= 0) || (names.indexOf('CurrencyInterface') >= 0);\n };\n if (isMarketInterface(type)) {\n return true;\n }\n if ((typeof type.isUnionType === 'function') && type.isUnionType()) {\n return type.getTypes().some((t) => isMarketInterface(t));\n }\n return false;\n }\n\n // `var market any = this.Market(symbol)` -> `var market map[string]any = MapTyped(...)`.\n // The box holds the dictionary the checker proved and every later use reads it (SafeDict's scan),\n // so this is a pure refinement. A value position, nil test or map write keeps the box.\n goMarketLocalUnboxCache = new Map();\n\n goMarketLocalUnbox(declaration): string | undefined {\n return this.goCachedLocalUnbox(this.goMarketLocalUnboxCache, declaration, () => this.goMarketLocalUnboxUncached(declaration));\n }\n\n // true when this identifier resolves to the declaration being typed (a property name or a\n // binding of the same name in another scope is not a use of the local). Without checker\n // information the name match stands.\n goIdentifierRefersToDeclaration(node, declaration): boolean {\n const checker: any = this.checkerOrUndefined();\n if (checker === undefined) {\n return true;\n }\n const symbol = checker.getSymbolAtLocation(node);\n if (symbol === undefined) {\n return true;\n }\n const valueDeclaration = symbol.valueDeclaration?.resolve() ?? symbol.declarations?.map((d) => d.resolve())?.[0];\n return (valueDeclaration === undefined) || (valueDeclaration === declaration);\n }\n\n // one later use of the market local: the dictionary read shapes SafeDict proves (element read,\n // `in`, read-helper argument), plus — only when the accessor throws rather than answers absent —\n // a plain argument position, since Go re-boxes the map into the callee's `any` as the box did.\n goMarketUseReadsTheValue(node, throwingAccessor: boolean): boolean {\n if (this.goSafeDictUseReadsTheMap(node)) {\n return true;\n }\n const parent: any = node.parent;\n if ((parent?.kind === SyntaxKind.ElementAccessExpression) && (parent.expression === node) && this.goIsComparedOperand(parent)) {\n return true;\n }\n if (!throwingAccessor) {\n return false;\n }\n return (parent?.kind === SyntaxKind.CallExpression)\n && (parent.expression !== node) && (parent.arguments.indexOf(node) >= 0);\n }\n\n goMarketLocalUnboxUncached(declaration): string | undefined {\n if (!this.goMarketCallReturnsDict(declaration.initializer)) {\n return undefined;\n }\n // the throwing accessors (`this.market`, `this.currency`) panic instead of answering absent, so\n // the boxed result is always a dictionary and passing the local re-boxes the same map into the\n // callee's `any`. The Safe* accessors may answer their own optional argument: read shapes only.\n const accessorName = declaration.initializer.expression?.name?.text;\n const throwingAccessor = (accessorName === 'market') || (accessorName === 'currency');\n // `this.market(…)` carries the same name as the local: a property/method name is not\n // a reference, and neither is a different binding of the same name\n return this.goDeclaredLocalTypeIfSafe(declaration, GO_MARKET_LOCAL_TYPE,\n (n) => this.goMarketUseReadsTheValue(n, throwingAccessor),\n (n) => ((n.parent?.kind === SyntaxKind.PropertyAccessExpression) && (n.parent.name === n))\n || !this.goIdentifierRefersToDeclaration(n, declaration));\n }\n\n // the initializer a typed market local is declared with: the same call, its boxed result\n // converted to the map the checker proved (nil when the call answered a non-map)\n goMarketUnboxValue(declaration, parsedValue: string): string | undefined {\n if (this.goMarketLocalUnbox(declaration) !== GO_MARKET_LOCAL_TYPE) {\n return undefined;\n }\n return `MapTyped(${parsedValue.trimStart()})`;\n }\n\n // the variable declaration an identifier binds to, through the checker (undefined for every\n // other shape) — the market rule resolves its own locals this way, never by printed name\n goDeclarationOfIdentifier(node): any {\n try {\n const symbol = this.getChecker().getSymbolAtLocation(node);\n const declaration = symbol?.valueDeclaration?.resolve() ?? symbol?.declarations?.map((d) => d.resolve())?.[0];\n if (declaration?.kind === SyntaxKind.VariableDeclaration) {\n return declaration;\n }\n } catch (e) {\n return undefined;\n }\n return undefined;\n }\n\n // a compared element of a market/currency local keeps the GetValue helper: its deref is what\n // the boxed local's read used to apply, and a parseMarket may have stored a `*bool`/`*string`\n // under the key. Only the operands the use scan admits this way are affected; every other\n goMarketComparisonElementRead(node): boolean {\n const base: any = node?.expression;\n if (base?.kind !== SyntaxKind.Identifier) {\n return false;\n }\n const declaration = this.goDeclarationOfIdentifier(base);\n if ((declaration === undefined) || (this.goMarketLocalUnbox(declaration) !== GO_MARKET_LOCAL_TYPE)) {\n return false;\n }\n return this.goIsComparedOperand(node);\n }\n\n // `node`, through any parentheses, is an operand of a GO_MARKET_READ_COMPARISON_OPERATORS comparison\n goIsComparedOperand(node): boolean {\n let operand: any = node;\n let above: any = node.parent;\n while (above?.kind === SyntaxKind.ParenthesizedExpression) {\n operand = above;\n above = above.parent;\n }\n return (above?.kind === SyntaxKind.BinaryExpression)\n && ((above.left === operand) || (above.right === operand))\n && (GO_MARKET_READ_COMPARISON_OPERATORS.indexOf(above.operatorToken?.kind) >= 0);\n }\n\n // the container/key argument nodes of a whole `this.SafeList(container, key)` call, or\n // undefined when the initializer is another shape. A third argument is only droppable when\n // it is the empty array literal the TS call sites pass (`safeList(x, k, [])`): the typed\n goSafeListLocalArgs(initializer) {\n return this.goSafeAccessorLocalArgs(initializer, 'safeList', SyntaxKind.ArrayLiteralExpression, 'elements');\n }\n\n // one later use of a list local: it must read the value as a list, never hand the box out.\n // A length read, an element read and the statement-shaped push all answer for a []any what\n // the accessors answered for the box; every other use keeps the box.\n goSafeListUseReadsTheList(node): boolean {\n const parent: any = node.parent;\n if (parent === undefined) {\n return false;\n }\n switch (parent.kind) {\n case SyntaxKind.PropertyAccessExpression: {\n if (parent.expression !== node) {\n return false; // the local as the receiver of a further member\n }\n if (parent.name?.text === 'length') {\n return true; // prints GetArrayLength(x)\n }\n // `x.push(v)` prints `x = append(x, v)` only in the statement shape; every other\n // push keeps AppendToArray(&x, …), whose *any parameter a []any local cannot take\n return (parent.name?.text === 'push') && this.goIsNativeAppendShape(node, parent.parent);\n }\n case SyntaxKind.ElementAccessExpression: {\n if (parent.expression !== node) {\n return false; // the local as the index\n }\n return !this.isGoElementAccessAssignmentTarget(parent); // `x[k] = v` writes through the box\n }\n case SyntaxKind.CallExpression: {\n if (parent.expression === node) {\n return false; // the local called as a function\n }\n if (parent.arguments.indexOf(node) !== 0) {\n return false; // value position: the box escapes\n }\n const callee = this.goPrintedCallee(this.printNode(parent, 0));\n // both accessors read a []any receiver with the very answer they gave the box\n return (callee === 'GetValue') || (callee === 'GetArrayLength');\n }\n default:\n return false;\n }\n }\n\n // `var x any = this.SafeList(container, key)` -> `var x []any = SafeListTyped(container, key)`.\n // SafeListTyped reads the same member and every later use reads it as a list: a nil slice counts\n // 0 and indexes to nil, matching the box's absent case. Anything else keeps the box.\n goSafeListLocalUnboxCache = new Map();\n\n goSafeListLocalUnbox(declaration): string | undefined {\n return this.goCachedLocalUnbox(this.goSafeListLocalUnboxCache, declaration, () => this.goSafeListLocalUnboxUncached(declaration));\n }\n\n goSafeListLocalUnboxUncached(declaration): string | undefined {\n if (this.goSafeListLocalArgs(declaration.initializer) === undefined) {\n return undefined;\n }\n return this.goDeclaredLocalTypeIfSafe(declaration, GO_SAFE_LIST_LOCAL_TYPE, (n) => this.goSafeListUseReadsTheList(n));\n }\n\n // the initializer a typed list local is declared with: the accessor call is replaced by the\n // typed reader, which reads the same member but names the result\n goSafeListUnboxValue(declaration, identation: number): string | undefined {\n if (this.goSafeListLocalUnbox(declaration) !== GO_SAFE_LIST_LOCAL_TYPE) {\n return undefined;\n }\n const args: any = this.goSafeListLocalArgs(declaration.initializer);\n const container = this.printNode(args.container, identation);\n const key = this.printNode(args.key, 0);\n return `SafeListTyped(${container}, ${key})`;\n }\n\n getGoLocalType(declaration, parsedValue: string): string {\n const goType = this.goTypeOfInitializer(declaration.initializer, parsedValue);\n if (goType === undefined) {\n return this.goSafeDictLocalUnbox(declaration) ?? this.goSafeListLocalUnbox(declaration) ?? this.goMarketLocalUnbox(declaration) ?? 'any';\n }\n // the scan matches AST identifiers, so it needs the source name, not the\n // printed one (`type` is renamed to `typeVar` on the way out)\n const sourceName = declaration.name?.text;\n if (sourceName === undefined) {\n return 'any';\n }\n const scope = this.goEnclosingFunction(declaration);\n // outside any nested resolution the verdict depends only on (declaration, goType)\n const stable = (this.goLocalTypeResolution.size <= 1) && (this.goDeclaredTypeInProgress.size === 0);\n const memoKey = goType;\n let perDecl = stable ? this.goLocalSafeVerdicts.get(declaration) : undefined;\n if (perDecl !== undefined && perDecl.has(memoKey)) {\n return perDecl.get(memoKey);\n }\n const result = (this.goTypeNameIsShadowed(scope, goType) || !this.goLocalIsSafeToType(scope, declaration, sourceName, goType)) ? 'any' : goType;\n if (stable) {\n if (perDecl === undefined) {\n perDecl = new Map();\n this.goLocalSafeVerdicts.set(declaration, perDecl);\n }\n perDecl.set(memoKey, result);\n }\n return result;\n }\n goLocalSafeVerdicts = new WeakMap>();\n\n // Typed async receive: an extension that knows the core's channel element type replaces\n // `x := (<-this.FooAsync(..))` + `PanicOnError(x)` with a typed declaration that runs PanicOnError\n // first (same frame and message). The default returns undefined and changes nothing.\n goAwaitReceiveUnbox(awaitNode, printedInitializer: string): { goType: string, wrap: (recv: string) => string } | undefined {\n return undefined;\n }\n\n printVariableDeclarationList(node,identation) {\n const declaration = node.declarations[0];\n // const varToken = this.VAR_TOKEN ? this.VAR_TOKEN + \" \": \"\";\n // const name = declaration.name.text;\n\n if (declaration?.name.kind === SyntaxKind.ArrayBindingPattern) {\n const arrayBindingPattern = declaration.name;\n const arrayBindingPatternElements = arrayBindingPattern.elements;\n const parsedArrayBindingElements = arrayBindingPatternElements.map((e) => this.printNode(e.name, 0));\n const syntheticName = parsedArrayBindingElements.join(\"\") + \"Variable\";\n\n // gofmt drops every redundant statement terminator: Go statements are\n // newline-separated, so the joins below must not emit ';'\n let arrayBindingStatement = `${this.getIden(identation)}${syntheticName} := ${this.printNode(declaration.initializer, 0)}\\n`;\n\n arrayBindingStatement += parsedArrayBindingElements\n .map((e, index) => this.getIden(identation) + `${e} := GetValue(${syntheticName}, ${index})`).join(\"\\n\");\n\n return arrayBindingStatement;\n }\n\n if (declaration?.initializer?.kind=== SyntaxKind.AwaitExpression) {\n const parsedName = this.printNode(declaration.name, 0);\n // the awaited call can carry a multi-line literal argument: printing it at the\n // declaration's own level keeps that literal one level deeper\n const parsedInitializer = this.printNode(declaration.initializer, identation);\n const awaitUnbox = this.goAwaitReceiveUnbox(declaration.initializer, parsedInitializer);\n if (awaitUnbox !== undefined) {\n // the conversion runs PanicOnError first (inside the bracket), so the panic\n // path keeps the same caller, message and stack as the boxed pair below\n return `\n${this.getIden(identation)}var ${parsedName} ${awaitUnbox.goType} = ${awaitUnbox.wrap(parsedInitializer)}`;\n }\n return `\n${this.getIden(identation)}${parsedName} := ${parsedInitializer}\n${this.getIden(identation)}PanicOnError(${parsedName})`;\n\n }\n\n const isNew = declaration.initializer && (declaration.initializer.kind === SyntaxKind.NewExpression);\n\n const parsedValue = (declaration.initializer) ? this.printNode(declaration.initializer, identation) : this.NULL_TOKEN;\n\n if (parsedValue === this.UNDEFINED_TOKEN) {\n return this.getIden(identation) + \"var \" + this.printNode(declaration.name) + \" any = \" + parsedValue;\n }\n\n if (node?.parent?.kind === SyntaxKind.FirstStatement) {\n if (isNew) {\n return this.getIden(identation) + this.printNode(declaration.name) + \" := \" + parsedValue;\n }\n const varName = this.printNode(declaration.name);\n const declaredType = this.getGoLocalType(declaration, parsedValue);\n // a typed dict/list local is declared with the typed reader rather than the `any`\n // accessor, so the declaration compiles against the map/slice type\n const unboxValue = this.goMarketUnboxValue(declaration, parsedValue)\n ?? ((declaredType === GO_SAFE_DICT_LOCAL_TYPE)\n ? this.goSafeDictUnboxValue(declaration, identation)\n : ((declaredType === GO_SAFE_LIST_LOCAL_TYPE) ? this.goSafeListUnboxValue(declaration, identation) : undefined));\n const declaredValue = (unboxValue !== undefined) ? unboxValue : parsedValue.trimStart();\n // an initializer printed at the declaration's own level (parenthesized expression,\n // helper call) carries that indentation; gofmt puts one space after `=`\n const stm = this.getIden(identation) + \"var \" + varName + \" \" + declaredType + \" = \" + declaredValue;\n if (parsedValue.startsWith(\"<-this.callInternal(\")) {\n return `\n${stm}\n${this.getIden(identation)}PanicOnError(${varName})`;\n }\n return stm;\n }\n\n return this.getIden(identation) + this.printNode(declaration.name) + \" := \" + parsedValue.trim();\n }\n\n // printObjectLiteralExpression(node, identation) {\n // const objectCreation = 'make(map[string]any) {';\n // let formattedObjectBody = '{}';\n // if (node.properties?.length > 0) {\n // const objectBody = this.printObjectLiteralBody(node, identation);\n // formattedObjectBody = objectBody ? \"\\n\" + objectBody + \"\\n\" + this.getIden(identation) : objectBody;\n // }\n // // return this.OBJECT_OPENING + formattedObjectBody + this.OBJECT_CLOSING;\n // return objectCreation + formattedObjectBody;\n // }\n\n // printObjectLiteralBody(node, identation) {\n // let objectName = node.parent?.name?.text;\n // if (objectName === undefined) {\n // objectName = \"object\";\n // }\n // const body = node.properties.map((p) => `${this.getIden(identation)}${objectName}[\"${node.properties[0].name.text}\"] = ${p.initializer.text}` ).join(\"\\n\");\n // return body;\n // }\n\n // F09 — gofmt aligns the key/value columns inside multi-line composite literals.\n //\n // go/printer's exprList prints a single-line `key: value` entry as `key:` + vtab, so\n // every consecutive single-line entry of a literal body lands in one text/tabwriter\n // column block: the value starts after the widest key cell of that block (`\"key\":`,\n // the key plus its colon) and one space of padding. An entry whose value spans lines\n // carries no vtab cell, so it ends the block on both sides, exactly like a blank line\n // does. exprList also writes a formfeed — turned into a plain newline by the trimmer,\n // so it never shows up in the output — before an entry that opens a new alignment\n // section: that happens when the entry or its predecessor does not fit on a single\n // line, and when the key size ratio against the geometric mean of the previous key\n // sizes of the section reaches r = 2.5 (or drops to 1/r) while at least one of the\n // two keys is larger than smallSize = 40 bytes; keys of at most 40 bytes always keep\n // the section aligned. A trailing comment is one more tabwriter cell, so comments\n // line up after the widest `value,` cell of the run of consecutive commented entries.\n printObjectLiteralBody(node, identation) {\n // composite literal elements are printed at depth 1 again (go/printer exprList(..., 1, ...));\n // a literal nested in an entry's value is laid out relative to that entry\n const previousLevel = this.goStatementLevel;\n this.goStatementLevel = identation + 1;\n try {\n const entries = node.properties.map((p) => this.goWithExprDepth(1, () => this.printNode(p, identation + 1)));\n return this.alignGoCompositeEntries(entries).join(\"\\n\");\n } finally {\n this.goStatementLevel = previousLevel;\n }\n }\n\n // Applies the gofmt column alignment to already-printed `key: value` entries (the\n // entries must not carry the separating comma). Reused by the hand-written composite\n // literals in ccxt's build/goTranspiler.ts, which do not go through this printer.\n alignGoCompositeEntries(entries) {\n const parsedEntries = entries.map((entry) => this.parseGoCompositeEntry(entry));\n const paddings = this.getGoCompositePaddings(parsedEntries);\n return entries.map((entry, index) => this.renderGoCompositeEntry(entry, parsedEntries[index], paddings[index]));\n }\n\n // ` \"key\": value, // comment` -> the pieces gofmt's tabwriter aligns.\n // Returns undefined for anything that is not a plain `key: value` entry (a spread, a\n // method, a computed key): the caller then leaves that entry alone and ends the block.\n parseGoCompositeEntry(entry) {\n const newlineIndex = entry.indexOf(\"\\n\");\n const firstLine = newlineIndex === -1 ? entry : entry.slice(0, newlineIndex);\n const keyMatch = /^([ \\t]*)(\"(?:[^\"\\\\]|\\\\.)*\"): /.exec(firstLine);\n if (keyMatch === null) {\n return undefined;\n }\n const singleLine = newlineIndex === -1;\n // for a multi-line entry only the trailing comment of its last line matters here\n const tail = singleLine ? entry.slice(keyMatch[0].length) : entry.slice(entry.lastIndexOf(\"\\n\") + 1);\n const commentIndex = this.findGoTrailingCommentStart(tail);\n return {\n 'indent': keyMatch[1],\n 'key': keyMatch[2],\n // nodeSize() measures the printed key; a value that spans lines gets size 0\n 'size': singleLine ? this.getGoByteLength(keyMatch[2]) : 0,\n 'singleLine': singleLine,\n 'value': singleLine ? (commentIndex === -1 ? tail : tail.slice(0, commentIndex)).trimEnd() : undefined,\n 'comment': commentIndex === -1 ? undefined : tail.slice(commentIndex).trimEnd(),\n };\n }\n\n // Index of the trailing comment of a printed line, or -1. `//` or `/*` inside a string\n // or a rune literal (e.g. a \"https://…\" value) is not a comment.\n findGoTrailingCommentStart(line) {\n let quote;\n for (let index = 0; index < line.length; ++index) {\n const character = line[index];\n if (quote !== undefined) {\n if (character === \"\\\\\" && quote !== \"`\") {\n index += 1;\n } else if (character === quote) {\n quote = undefined;\n }\n continue;\n }\n if (character === \"\\\"\" || character === \"`\" || character === \"'\") {\n quote = character;\n } else if (character === \"/\" && (line[index + 1] === \"/\" || line[index + 1] === \"*\")) {\n return index;\n }\n }\n return -1;\n }\n\n // {key, comment} space counts per entry, i.e. the padding gofmt's tabwriter inserts.\n // Only entries that are part of a block get a padding; every other entry is rendered\n // as printed (gofmt leaves single-line and multi-line sections untouched).\n getGoCompositePaddings(parsedEntries) {\n // the sectioning below mirrors go/printer's exprList\n const smallSize = 40;\n const ratio = 2.5;\n const paddings = parsedEntries.map(() => undefined);\n let block = [];\n let previousSize = 0;\n let size = 0;\n let lnSum = 0;\n let count = 0;\n const flushBlock = () => {\n if (block.length === 0) {\n return;\n }\n let keyWidth = 1; // widest key cell of the block + one space of padding\n for (const index of block) {\n keyWidth = Math.max(keyWidth, this.getGoRuneLength(parsedEntries[index].key) + 2);\n }\n for (const index of block) {\n paddings[index] = { 'key': keyWidth - this.getGoRuneLength(parsedEntries[index].key) - 1, 'comment': 1 };\n }\n // the comment column only spans the runs of consecutive commented entries\n let run = [];\n const flushRun = () => {\n if (run.length === 0) {\n return;\n }\n let runWidth = 1; // widest `value,` cell of the run + one space of padding\n for (const index of run) {\n runWidth = Math.max(runWidth, this.getGoRuneLength(parsedEntries[index].value) + 2);\n }\n for (const index of run) {\n paddings[index].comment = runWidth - this.getGoRuneLength(parsedEntries[index].value) - 1;\n }\n run = [];\n };\n for (const index of block) {\n if (parsedEntries[index].comment !== undefined) {\n run.push(index);\n } else {\n flushRun();\n }\n }\n flushRun();\n block = [];\n };\n for (let index = 0; index < parsedEntries.length; ++index) {\n const entry = parsedEntries[index];\n previousSize = size;\n size = entry !== undefined ? entry.size : 0;\n let sectionBreak = true; // exprList's useFF\n if (previousSize > 0 && size > 0) {\n if (count === 0 || (previousSize <= smallSize && size <= smallSize)) {\n sectionBreak = false;\n } else {\n const geomean = this.goExp2ish(lnSum / count);\n const sizeRatio = size / geomean;\n sectionBreak = ratio * sizeRatio <= 1 || ratio <= sizeRatio;\n }\n }\n const alignable = entry !== undefined && entry.singleLine;\n if (index > 0 && sectionBreak) {\n // exprList resets the geometric mean accumulation whenever it starts a\n // new section (a formfeed break is two line breaks, nbreaks > 1), so the\n // ratio below is measured against the current section only\n lnSum = 0;\n count = 0;\n }\n if (!alignable || sectionBreak) {\n flushBlock();\n }\n if (alignable) {\n block.push(index);\n }\n if (size > 0) {\n lnSum += this.goLog2ish(size);\n count += 1;\n }\n }\n flushBlock();\n return paddings;\n }\n\n // go/printer's crude log2/exp2 (math.go log2ish/exp2ish): the geomean must match it bit for\n // bit, a ratio landing on exactly 2.5 decides the section break\n goLog2ish(x: number): number {\n let exponent = x === 0 ? 0 : Math.floor(Math.log2(x)) + 1;\n let fraction = x / Math.pow(2, exponent);\n if (fraction >= 1) { fraction /= 2; exponent += 1; }\n if (fraction < 0.5 && fraction !== 0) { fraction *= 2; exponent -= 1; }\n return exponent + 2 * (fraction - 1);\n }\n\n goExp2ish(x: number): number {\n const n = Math.floor(x);\n return (1 + x - n) * Math.pow(2, n);\n }\n\n renderGoCompositeEntry(entry, parsed, padding) {\n if (parsed === undefined || !parsed.singleLine || padding === undefined) {\n return this.appendGoTrailingComma(entry);\n }\n const comment = parsed.comment === undefined ? \"\" : \" \".repeat(padding.comment) + parsed.comment;\n return parsed.indent + parsed.key + \":\" + \" \".repeat(padding.key) + parsed.value + \",\" + comment;\n }\n\n // gofmt prints the comma of an entry before its trailing comment (`value, // comment`),\n // the entry text carries the comment last, so move the comma in front of it\n appendGoTrailingComma(entry) {\n const newlineIndex = entry.lastIndexOf(\"\\n\");\n const lastLine = newlineIndex === -1 ? entry : entry.slice(newlineIndex + 1);\n const commentIndex = this.findGoTrailingCommentStart(lastLine);\n if (commentIndex === -1) {\n return entry + \",\";\n }\n const offset = entry.length - lastLine.length + commentIndex;\n return entry.slice(0, offset).trimEnd() + \", \" + entry.slice(offset).trimEnd();\n }\n\n // text/tabwriter sizes cells in runes, go/printer's nodeSize counts bytes\n getGoRuneLength(text) {\n return [...text].length;\n }\n\n getGoByteLength(text) {\n let length = 0;\n for (const character of text) {\n const codePoint = character.codePointAt(0);\n length += codePoint < 0x80 ? 1 : codePoint < 0x800 ? 2 : codePoint < 0x10000 ? 3 : 4;\n }\n return length;\n }\n\n printConstructorDeclaration (node, identation) {\n const classNode = node.parent;\n const className = this.printNode(classNode.name, 0);\n const args = this.printMethodParameters(node);\n const constructorBody = this.printFunctionBody(node, identation);\n\n // find super call inside constructor and extract params\n let superCallParams = '';\n let hasSuperCall = false;\n node.body?.statements.forEach(statement => {\n if (isExpressionStatement(statement)) {\n const expression = statement.expression;\n if (isCallExpression(expression)) {\n const expressionText = expression.expression.getText().trim();\n if (expressionText === 'super') {\n hasSuperCall = true;\n superCallParams = expression.arguments.map((a) => {\n return this.printNode(a, identation).trim();\n }).join(\", \");\n }\n }\n }\n });\n\n if (hasSuperCall) {\n return this.getIden(identation) + className +\n `(${args}) : ${this.SUPER_CALL_TOKEN}(${superCallParams})` +\n constructorBody;\n }\n\n return this.getIden(identation) +\n className +\n \"(\" + args + \")\" +\n constructorBody;\n }\n\n printDynamicCall(node, identation) {\n // const isAsync = true; // setting to true for now, because there are some scenarios where we don't know\n const elementAccess = node.expression;\n if (elementAccess?.kind === SyntaxKind.ElementAccessExpression) {\n // the emitted call also carries the property name as its first\n // argument, so a call with arguments is a call with more than one\n // argument and prints them one level deeper\n const argumentDepth = this.goExprDepth + ((node.arguments?.length > 0) ? 1 : 0);\n const parsedArg = node.arguments?.length > 0 ? node.arguments.map(n => this.goWithExprDepth(argumentDepth, () => this.printNode(n, identation).trimStart())).join(\", \") : \"\";\n // const target = this.printNode(elementAccess.expression, 0);\n const propName = this.goWithExprDepth(argumentDepth, () => this.printNode(elementAccess.argumentExpression, 0));\n const argsArray = `${parsedArg}`;\n const open = this.DYNAMIC_CALL_OPEN;\n const statement = `${open}${propName}, ${argsArray})`;\n // statement = isAsync ? `((Task)${statement})` : statement;\n return statement;\n }\n return undefined;\n }\n\n\n printElementAccessExpressionExceptionIfAny(node) {\n // Fix malformed Split(...) element access where the index arg is mistakenly placed\n // inside the Split call. We force the correct pattern: GetValue(Split(str, sep), idx)\n const tsKind = SyntaxKind;\n if (node.expression.kind === tsKind.CallExpression) {\n const callExp = node.expression;\n const calleeText = callExp.expression.getText();\n if (calleeText.endsWith('.split') || calleeText.toLowerCase().includes('split')) {\n // print Split call normally (should already close with ))\n let splitCall = this.printNode(callExp, 0).trim();\n if (!splitCall.endsWith(')')) {\n splitCall += ')';\n }\n const idxArg = this.printNode(node.argumentExpression, 0);\n return `GetValue(${splitCall}, ${idxArg})`;\n }\n }\n // default: no exception\n return undefined;\n }\n\n printWrappedUnknownThisProperty(node, identation = 0) {\n const type = this.getChecker().getResolvedSignature(node);\n if (type?.declaration?.resolve() === undefined) {\n // the emitted call carries the property name as its first argument; arguments\n // print at the call's level so a multi-line literal keeps its nesting\n const argumentDepth = this.goExprDepth + ((node.arguments?.length > 0) ? 1 : 0);\n let parsedArguments = node.arguments?.map((a) => this.goWithExprDepth(argumentDepth, () => this.printNode(a, identation).trimStart())).join(\", \");\n parsedArguments = parsedArguments || \"\";\n const propName = node.expression?.name.text;\n // const isAsyncDecl = true;\n // const isAsyncDecl = node?.parent?.kind === SyntaxKind.AwaitExpression;\n // const isAsyncDecl = false;\n // const open = isAsyncDecl ? this.UKNOWN_PROP_ASYNC_WRAPPER_OPEN : this.UKNOWN_PROP_WRAPPER_OPEN;\n // const close = this.UNKOWN_PROP_WRAPPER_CLOSE;\n // return `${open}\"${propName}\"${parsedArguments}${close}`;\n const argsArray = `${parsedArguments}`;\n const open = this.DYNAMIC_CALL_OPEN;\n const statement = `${open}\"${propName}\", ${argsArray})`;\n return statement;\n }\n return undefined;\n }\n\n transformMethodNameIfNeeded(name: string): string {\n const res = this.unCamelCaseIfNeeded(name);\n return this.capitalize(res);\n }\n\n transformCallExpressionName(name: string, nameNode = undefined) {\n return this.applyAsyncSuffixToCallee(nameNode, this.capitalize(name));\n }\n\n transformPropertyAccessExpressionName(name: string, nameNode = undefined) {\n return this.applyAsyncSuffixToCallee(nameNode, this.capitalize(name));\n }\n\n printOutOfOrderCallExpressionIfAny(node, identation) {\n if (node.expression.kind === SyntaxKind.PropertyAccessExpression) {\n const args = node.arguments;\n\n if (node.expression.expression.kind === SyntaxKind.ThisKeyword) {\n const methodName = this.printNode(node.expression.name, 0);\n if (this.wrapThisCalls || (this.wrapCallMethods.includes(methodName))) {\n const argsParsed = this.goUnifiedStringCallArgs(node, 0, true) ?? args.map((a) => this.printNode(a, 0)).join(\", \");\n return `<-this.callInternal(\"${methodName}\"${(args.length > 0) ? \", \" + argsParsed : \"\"})`;\n }\n }\n\n const expressionText = node.expression.getText().trim();\n if (args.length === 1) {\n const parsedArg = this.printNode(args[0], 0);\n switch (expressionText) {\n // case \"JSON.parse\":\n // return `json_decode(${parsedArg}, $as_associative_array = true)`;\n case \"Math.abs\":\n return `mathAbs(${parsedArg})`;\n }\n } else if (args.length === 2)\n {\n const parsedArg1 = this.printNode(args[0], 0);\n const parsedArg2 = this.printNode(args[1], 0);\n switch (expressionText) {\n case \"Math.min\":\n return `mathMin(${parsedArg1}, ${parsedArg2})`;\n case \"Math.max\":\n return `mathMax(${parsedArg1}, ${parsedArg2})`;\n case \"Math.pow\":\n return `MathPow(${parsedArg1}, ${parsedArg2})`;\n }\n }\n const leftSide = node.expression?.expression;\n const leftSideText = leftSide ? this.printNode(leftSide, 0) : undefined;\n\n // wrap unknown property this.X calls\n if (leftSideText === this.THIS_TOKEN || leftSide.getFullText().indexOf(\"(this as any)\") > -1) { // double check this\n const res = this.printWrappedUnknownThisProperty(node, identation);\n if (res) {\n return res;\n }\n }\n }\n\n // // replace this[method]() calls\n // const thisElementAccess = this.printThisElementAccesssIfNeeded(node, identation);\n // if (thisElementAccess) {\n // return thisElementAccess;\n // }\n\n // handle dynamic calls, this[method](A) or exchange[b] (c) using reflection\n if (node.expression.kind === SyntaxKind.ElementAccessExpression) {\n return this.printDynamicCall(node, identation);\n }\n\n\n return undefined;\n }\n\n // `typeof x === \"\"` checks and the Go predicate helper each maps to\n goTypeOfHelpers = new Map([\n ['string', 'IsString'], ['number', 'IsNumber'], ['boolean', 'IsBool'], ['object', 'IsObject'], ['function', 'IsFunction'],\n ]);\n handleTypeOfInsideBinaryExpression(node, identation) {\n const left = node.left;\n const right = node.right.text;\n const op = node.operatorToken.kind;\n const expression = left.expression;\n\n const isDifferentOperator = op === SyntaxKind.ExclamationEqualsEqualsToken || op === SyntaxKind.ExclamationEqualsToken;\n const notOperator = isDifferentOperator ? this.NOT_TOKEN : \"\";\n\n const target = this.printNode(expression, 0);\n const helper = this.goTypeOfHelpers.get(right);\n return (helper === undefined) ? undefined : notOperator + `${helper}(${target})`;\n\n }\n\n printCustomBinaryExpressionIfAny(node, identation) {\n const left = node.left;\n const right = node.right;\n\n const op = node.operatorToken.kind;\n\n // ---------------------------------------------------------------\n // Array destructuring assignment: [a, b] = foo()\n // Transforms into:\n // __tmpX := foo()\n // a = GetValue(__tmpX, 0)\n // b = GetValue(__tmpX, 1)\n // ---------------------------------------------------------------\n if (op === SyntaxKind.EqualsToken &&\n left.kind === SyntaxKind.ArrayLiteralExpression) {\n // const elems = (left.elements as any[]);\n // const returnRandName = \"retRes\" + this.getLineBasedSuffix(node);\n // const rhs = this.printNode(right, 0);\n\n // // build extraction lines\n // const assignments = elems.map((el, idx) => {\n // const leftName = this.printNode(el, 0);\n // return `${leftName} = GetValue(${returnRandName}, ${idx})`;\n // }).join(`\\n${this.getIden(identation)}`);\n\n // return `${returnRandName} := ${rhs}\\n${this.getIden(identation)}${assignments}`;\n //\n const arrayBindingPatternElements = left.elements;\n const parsedArrayBindingElements = arrayBindingPatternElements.map((e) => this.printNode(e, 0));\n const syntheticName = parsedArrayBindingElements.join(\"\") + \"Variable\";\n\n let arrayBindingStatement = `${syntheticName} := ${this.printNode(right, 0)}\\n`;\n\n parsedArrayBindingElements.forEach((e, index) => {\n\n const statement = this.getIden(identation) + (this.goGetArgBindsDictElement(arrayBindingPatternElements[index], right, index)\n ? `${e} = MapTyped(GetValue(${syntheticName}, ${index}))`\n : `${e} = GetValue(${syntheticName}, ${index})`);\n if (index < parsedArrayBindingElements.length - 1) {\n arrayBindingStatement += statement + \"\\n\";\n } else {\n arrayBindingStatement += statement;\n }\n });\n\n return arrayBindingStatement;\n }\n\n // ---------------------------------------------------------------\n // Go-style setter for element-access assignments: a[b] = v and a[b] += v\n // ---------------------------------------------------------------\n if ((op === SyntaxKind.EqualsToken || op === SyntaxKind.PlusEqualsToken) &&\n left.kind === SyntaxKind.ElementAccessExpression) {\n // Collect base container and all keys (inner-most key is last).\n const keys: any[] = [];\n let baseExpr: any = null;\n let cur: any = left;\n while (isElementAccessExpression(cur)) {\n keys.unshift(cur.argumentExpression); // prepend\n const expr = cur.expression;\n if (!isElementAccessExpression(expr)) {\n baseExpr = expr;\n break;\n }\n cur = expr;\n }\n\n const containerStr = this.printNode(baseExpr, 0);\n const keyStrs = keys.map(k => this.printNode(k, 0));\n\n // the container of a nested `m[\"a\"][\"b\"] = v` write is a plain read of the\n // receiver: a declared map indexes natively and only the `any` steps above\n // it keep the helper (Go refuses to index an `any`)\n const acc = this.goElementWriteChain(baseExpr, containerStr, keys, keyStrs);\n\n const lastKey = keyStrs[keyStrs.length - 1];\n if (op === SyntaxKind.PlusEqualsToken) {\n const rhs = this.printNode(right, 0);\n // For +=, we need to get the current value, add to it, then set it back\n const currentValue = `${this.ELEMENT_ACCESS_WRAPPER_OPEN}${acc}, ${lastKey}${this.ELEMENT_ACCESS_WRAPPER_CLOSE}`;\n const native = (keyStrs.length === 1)\n ? this.printNativeElementAssignment(baseExpr, containerStr, keys[0], lastKey, `Add(${containerStr}[${lastKey}], ${rhs})`, true)\n : undefined;\n return (native !== undefined) ? native : `AddElementToObject(${acc}, ${lastKey}, Add(${currentValue}, ${rhs}))`;\n }\n // the value is printed at the statement's own level so a multi-line object\n // literal (bare, or nested inside a call argument) lands one level deeper with\n // its closing brace at the statement level; the leading indentation is dropped\n const rhs = this.goWithExprDepth(this.goExprDepth + 1, () => this.printNode(right, identation)).trimStart();\n\n // a single key over a receiver the printer typed itself is plain Go\n // indexing; a nested chain goes through GetValue, which is `any`\n // a native `m[k] = v` is a plain assignment, whose value go/printer prints at\n // the statement's own depth rather than inside the helper's argument list\n const nativeRhs = (right.kind === SyntaxKind.BinaryExpression)\n ? this.goWithExprDepth(this.goExprDepth, () => this.printNode(right, identation)).trimStart()\n : rhs;\n const native = (keyStrs.length === 1)\n ? this.printNativeElementAssignment(baseExpr, containerStr, keys[0], lastKey, nativeRhs, false, right)\n : undefined;\n return (native !== undefined) ? native : `AddElementToObject(${acc}, ${lastKey}, ${rhs})`;\n }\n\n if (left.kind === SyntaxKind.TypeOfExpression) {\n const typeOfExpression = this.handleTypeOfInsideBinaryExpression(node, identation);\n if (typeOfExpression) {\n return typeOfExpression;\n }\n }\n\n if (op === SyntaxKind.InKeyword) {\n const dictText = this.printNode(right, 0);\n const keyText = this.printNode(left, 0);\n const inlined = this.printInlineInOp(right, left, dictText, keyText);\n if (inlined !== undefined) {\n return inlined;\n }\n return `InOp(${dictText}, ${keyText})`;\n }\n\n // only print the operands when this op is actually handled here; otherwise\n // the base printBinaryExpression prints them, and doing it eagerly means\n // every unhandled binary expression gets its subtrees printed twice\n if (op === SyntaxKind.PlusEqualsToken || op === SyntaxKind.MinusEqualsToken || op in this.binaryExpressionsWrappers) {\n // both operands end up in the two-argument helper call below (or in the\n // `Add(x, y)` on the right of the compound assignment), i.e. one level\n // deeper than the expression itself\n const operandDepth = this.goExprDepth + 1;\n const leftText = this.goWithExprDepth(operandDepth, () => this.printNode(left, 0));\n const rightText = this.goWithExprDepth(operandDepth, () => this.printNode(right, 0));\n\n const nativeAssignment = this.goNativeCompoundAssignment(op, left, leftText, right, rightText);\n if (nativeAssignment !== undefined) {\n return nativeAssignment;\n }\n\n if (op === SyntaxKind.PlusEqualsToken) {\n return `${leftText} = Add(${leftText}, ${rightText})`;\n }\n\n if (op === SyntaxKind.MinusEqualsToken) {\n return `${leftText} = Subtract(${leftText}, ${rightText})`;\n }\n\n const isEquality = (op === SyntaxKind.EqualsEqualsToken) || (op === SyntaxKind.EqualsEqualsEqualsToken);\n const isDifference = (op === SyntaxKind.ExclamationEqualsToken) || (op === SyntaxKind.ExclamationEqualsEqualsToken);\n if (isEquality || isDifference) {\n const inlined = this.printInlineEquality(left, right, leftText, rightText, isEquality);\n if (inlined !== undefined) {\n return inlined;\n }\n }\n\n if (ORDERED_COMPARISON_OPERATORS[op] !== undefined) {\n const inlined = this.printInlineOrderedComparison(left, right, leftText, rightText, op) ?? this.printG09WideningComparison(left, right, leftText, rightText, op);\n if (inlined !== undefined) {\n return inlined;\n }\n }\n\n const wrapper = this.binaryExpressionsWrappers[op];\n const open = wrapper[0];\n const close = wrapper[1];\n const nativeArithmetic = this.goNativeArithmetic(node, leftText, rightText);\n if (nativeArithmetic !== undefined) {\n return nativeArithmetic.text;\n }\n return `${open}${leftText}, ${rightText}${close}`;\n }\n\n // x = y\n // cast y to x type when y is unknown\n // if (op === SyntaxKind.EqualsToken) {\n // const leftType = this.getChecker().getTypeAtLocation(left);\n // const rightType = this.getChecker().getTypeAtLocation(right);\n\n // if (this.isAnyType(rightType.flags) && !this.isAnyType(leftType.flags)) {\n // // const parsedType = this.getTypeFromRawType(leftType);\n // return `${leftText} = ${rightText}`;\n // }\n // }\n\n return undefined;\n }\n\n // the scalar family the TypeScript type of an operand belongs to: 'string',\n // 'int', 'float', 'bool', 'nil' for the undefined/null literals, or undefined\n // when the type is any/unknown/a union of several families\n goScalarFamily(node): string | undefined {\n // TypeScript narrows `x !== undefined && x === 'v'` to `string`, but the Go\n // local is still the `any` box the declaration printed; when that box holds\n // a *T helper result, `==` against a string is never true in Go\n const checker: any = this.checkerOrUndefined();\n if (node?.kind === SyntaxKind.Identifier && this.goDeclaredTypeOfIdentifier(node) === undefined\n && this.goAnyLocalHoldsPointer(checker.getSymbolAtLocation(node)?.valueDeclaration?.resolve())) {\n return undefined;\n }\n return (checker === undefined) ? undefined : this.goScalarFamilyOfType(checker.getTypeAtLocation(node));\n }\n\n // the scalar family the TypeScript type of an operand belongs to, where a\n // `string | undefined` union still counts as 'string': the Go box holds that\n // scalar or nil, and both `x == nil` and `x == \"lit\"` are then the same\n // predicate as the helper. Numbers are excluded by the caller.\n goScalarFamilyWithNil(node): string | undefined {\n const checker: any = this.checkerOrUndefined();\n return (checker === undefined) ? undefined : this.goScalarFamilyOfType(checker.getTypeAtLocation(node), true);\n }\n\n // true when this operand is a *parameter* boxed as `any` whose TypeScript type is an array or\n // object (`Strings`, `Market`, `NullableDict`, `object[]`, `object`): a Go map/slice, never a\n // pointer, so a nil test needs no helper. Locals may box a nil `*sync.Map`, which is not `== nil`.\n goObjectBoxParameter(node): boolean {\n if (node?.kind !== SyntaxKind.Identifier) {\n return false;\n }\n const checker: any = this.checkerOrUndefined();\n if (checker === undefined) {\n return false;\n }\n if (checker.getSymbolAtLocation(node)?.valueDeclaration?.resolve()?.kind !== SyntaxKind.Parameter) {\n return false;\n }\n return this.goTypeIsNilComparableObject(checker.getTypeAtLocation(node));\n }\n\n // an object type whose Go value is a map/slice, or a union of such a type with\n // undefined/null. `any`, functions and class instances are excluded: their Go\n // value may be an identity-bearing pointer\n goTypeIsNilComparableObject(type): boolean {\n if (type === undefined) {\n return false;\n }\n if (type.flags & TypeFlags.Union) {\n let seen = false;\n for (const member of type.getTypes()) {\n if (member.flags & (TypeFlags.Undefined | TypeFlags.Null | TypeFlags.Void)) {\n continue;\n }\n if (!this.goTypeIsNilComparableObject(member)) {\n return false;\n }\n seen = true;\n }\n return seen;\n }\n if (!(type.flags & (TypeFlags.Object | TypeFlags.NonPrimitive))) {\n return false;\n }\n if (type.getCallSignatures().length > 0 || type.getConstructSignatures().length > 0) {\n return false;\n }\n const declaration = type.getSymbol()?.valueDeclaration?.resolve() ?? type.getSymbol()?.declarations?.map((d) => d.resolve())?.[0];\n return declaration?.kind !== SyntaxKind.ClassDeclaration;\n }\n\n // the callee name of a printed call, e.g. `this.SafeDict(x, 0, {})` → `this.SafeDict`\n goPrintedCallee(printedValue: string): string | undefined {\n let value = printedValue.trim();\n while (value.startsWith('(') && this.isWholePrintedCall(value, 0)) {\n value = value.substring(1, value.length - 1).trim();\n }\n const open = value.indexOf('(');\n if (open <= 0 || !this.isWholePrintedCall(value, open)) {\n return undefined;\n }\n const callee = value.substring(0, open);\n return /^[A-Za-z_][\\w.]*$/.test(callee) ? callee : undefined;\n }\n\n // true when this expression prints to an interface (`any`) box: a parameter, a\n // local the printer left `any`, or one of the helpers whose Go signature returns\n // `any`. A *T / scalar local or call is not a box and keeps its own rule.\n goIsAnyBoxExpression(node, printedText: string): boolean {\n if (node?.kind === SyntaxKind.Identifier) {\n const decl = this.goAnyBoxLocalDeclaration(node);\n const isBinding = (decl?.kind === SyntaxKind.Parameter)\n || (decl?.kind === SyntaxKind.VariableDeclaration);\n if (!isBinding) {\n return false;\n }\n // the printer names a Go type for this local/`:=` initializer, so the\n // value is not behind an interface\n if (this.goDeclaredTypeOfIdentifier(node) !== undefined) {\n return false;\n }\n // an `any` local initialised from a *T helper (`var x any = this.SafeString(…)`)\n // boxes the pointer itself: a nil *string inside `any` is not `== nil` in Go,\n // so only the deref-aware helper compares it correctly\n return !this.goAnyLocalHoldsPointer(decl);\n }\n if (node?.kind === SyntaxKind.CallExpression) {\n if (this.goTypeOfInitializer(node, printedText) !== undefined) {\n return false; // a *T or a scalar the printer can name\n }\n return GO_ANY_BOX_CALLS.indexOf(this.goPrintedCallee(printedText)) >= 0;\n }\n return false;\n }\n\n // an element read prints either a native map[string]any index or the\n // GetValue(container, key) helper call — an `any` box in both cases\n goBoxedElementRead(node, printedText: string): boolean {\n node = this.goUnwrapParenthesizedNode(node);\n if (node?.kind !== SyntaxKind.ElementAccessExpression) {\n return false;\n }\n if (GO_ANY_BOX_CALLS.indexOf(this.goPrintedCallee(printedText)) >= 0) {\n return true; // GetValue(container, key)\n }\n let base = node.expression;\n while (isElementAccessExpression(base)) {\n base = base.expression;\n }\n // the printed base is unknown here: `goIndexableTypeOf` answers on the\n // declared table alone for every shape but a call, which stays a box anyway\n return this.goIndexableTypeOf(base, '') === 'map[string]any';\n }\n\n // true when an `any`-typed local can hold a *T helper result: its initializer or a\n // later `x = …` write is a `this.safeX(…)` call whose Go signature returns a pointer\n goAnyLocalHoldsPointerCache = new Map();\n goAnyLocalHoldsPointer(decl): boolean {\n if (decl?.kind !== SyntaxKind.VariableDeclaration || decl.name?.kind !== SyntaxKind.Identifier) {\n return false;\n }\n if (this.goAnyLocalHoldsPointerCache.has(decl)) {\n return this.goAnyLocalHoldsPointerCache.get(decl);\n }\n // the callee is read from the AST, never printed: printing an operand would\n // re-enter the equality classifier that asks this question\n this.goAnyLocalHoldsPointerCache.set(decl, false);\n let settled = true;\n const isPointerInit = (expr): boolean => {\n expr = this.goUnwrapParenthesizedNode(expr);\n if (expr?.kind === SyntaxKind.ConditionalExpression) {\n return isPointerInit(expr.whenTrue) || isPointerInit(expr.whenFalse);\n }\n if (expr?.kind === SyntaxKind.Identifier) {\n // a copy of a pointer-bound GetArg parameter (or of a local holding one) boxes it\n const source: any = this.checkerOrUndefined()?.getSymbolAtLocation(expr)?.valueDeclaration?.resolve();\n if (source?.kind === SyntaxKind.Parameter) {\n if (this.goGetArgTypeComputing?.has(source)) {\n settled = false;\n return true;\n }\n return String(this.goGetArgParameterType(source) ?? '').startsWith('*');\n }\n const inner = (source !== decl) && this.goAnyLocalHoldsPointer(source);\n settled = settled && ((source === decl) || this.goAnyLocalHoldsPointerCache.has(source));\n return inner;\n }\n const callee = (expr?.kind === SyntaxKind.CallExpression) ? expr.expression : undefined;\n if (callee?.kind !== SyntaxKind.PropertyAccessExpression || callee.expression?.kind !== SyntaxKind.ThisKeyword) {\n return false;\n }\n const name = this.goAstCalleeName(expr);\n const goType = (name === undefined) ? undefined : GO_HELPER_RETURN_TYPES[name];\n return (typeof goType === 'string') && goType.startsWith('*');\n };\n let holds = isPointerInit(decl.initializer);\n if (!holds) {\n const name = decl.name.text;\n const scope = this.goEnclosingFunction(decl);\n const visit = (n) => {\n if (holds) { return; }\n if (n.kind === SyntaxKind.BinaryExpression && n.operatorToken.kind === SyntaxKind.EqualsToken\n && n.left?.kind === SyntaxKind.Identifier && n.left.text === name && isPointerInit(n.right)) {\n holds = true;\n return;\n }\n n.forEachChild(visit);\n };\n if (scope !== undefined) {\n scope.forEachChild(visit);\n }\n }\n if (settled) {\n this.goAnyLocalHoldsPointerCache.set(decl, holds);\n } else {\n this.goAnyLocalHoldsPointerCache.delete(decl);\n }\n return holds;\n }\n\n // the callee name of a call, read from the AST and capitalised the way the\n // printer names Go functions (`this.parseJson` -> `this.ParseJson`). Printing the\n // callee would re-enter the equality classifier that asks this question.\n goAstCalleeName(call): string | undefined {\n const callee = call?.expression;\n if (callee?.kind === SyntaxKind.Identifier) {\n const name = callee.text;\n return (typeof name === 'string' && name.length > 0) ? name.charAt(0).toUpperCase() + name.substring(1) : undefined;\n }\n if (callee?.kind === SyntaxKind.PropertyAccessExpression && callee.expression?.kind === SyntaxKind.ThisKeyword) {\n const name = callee.name?.text;\n return (typeof name === 'string' && name.length > 0) ? 'this.' + name.charAt(0).toUpperCase() + name.substring(1) : undefined;\n }\n return undefined;\n }\n\n // true when every declaration of the awaited callee is a bodyless method signature:\n // TS never implements it, the endpoint generator does, and the Go body is the\n // `<-chan any` wrapper over callEndpointAsync (decoded JSON / \"panic: \" / nil)\n goAwaitedCallIsImplicitEndpoint(expression): boolean {\n const call = this.goUnwrapParenthesizedNode(expression);\n if (call?.kind !== SyntaxKind.CallExpression) {\n return false;\n }\n const callee = call.expression;\n if (callee?.kind !== SyntaxKind.PropertyAccessExpression || callee.expression?.kind !== SyntaxKind.ThisKeyword) {\n return false;\n }\n const nameNode = callee.name;\n if (nameNode?.kind !== SyntaxKind.Identifier) {\n return false;\n }\n const checker: any = this.checkerOrUndefined();\n if (checker === undefined) {\n return false;\n }\n const symbol = checker.getSymbolAtLocation(nameNode);\n const declarations = symbol?.declarations?.map((d) => d.resolve());\n if (!declarations || declarations.length === 0) {\n return false;\n }\n return declarations.every((d) => (d.kind === SyntaxKind.MethodSignature)\n && (d.body === undefined)\n && (d.parent?.kind === SyntaxKind.InterfaceDeclaration));\n }\n\n // true when the printed value of this expression is never a *T whose nil\n // derefScalar folds to nil (nor a *sync.Map): null/undefined, an object/array\n // literal, an endpoint await or a JSON decode. Everything else stays unproven.\n goIsNonPointerValueSource(expr): boolean {\n expr = this.goUnwrapParenthesizedNode(expr);\n if (expr === undefined) {\n return true; // `var x any` never written holds nil\n }\n if (this.goG02NonPointerAccessorSource(expr)) {\n return true;\n }\n switch (expr.kind) {\n case SyntaxKind.NullKeyword:\n return true;\n case SyntaxKind.Identifier:\n return expr.text === 'undefined';\n case SyntaxKind.ObjectLiteralExpression:\n case SyntaxKind.ArrayLiteralExpression:\n return true;\n case SyntaxKind.AwaitExpression:\n return this.goAwaitedCallIsImplicitEndpoint(expr.expression);\n case SyntaxKind.CallExpression: {\n const name = this.goAstCalleeName(expr);\n if (name === undefined) {\n return false;\n }\n return GO_JSON_PARSE_CALLS.indexOf(name.replace(/^this\\./, '')) >= 0;\n }\n }\n return false;\n }\n\n // true when every value written into an `any` local is a non-pointer source: the\n // box holds a container, a scalar or nil, so IsEqual(x, nil) is exactly `x == nil`.\n // A write of any other shape in the enclosing function (D2 scan) keeps the helper\n goAnyLocalHoldsNonPointerCache = new Map();\n goAnyLocalHoldsNonPointer(decl): boolean {\n if (decl?.kind !== SyntaxKind.VariableDeclaration || decl.name?.kind !== SyntaxKind.Identifier) {\n return false;\n }\n if (this.goAnyLocalHoldsNonPointerCache.has(decl)) {\n return this.goAnyLocalHoldsNonPointerCache.get(decl);\n }\n let holds = !this.goAnyLocalHoldsPointer(decl) && this.goIsNonPointerValueSource(decl.initializer);\n if (holds) {\n const name = decl.name.text;\n const scope = this.goEnclosingFunction(decl);\n if (scope === undefined) {\n holds = false;\n } else {\n const visit = (n) => {\n if (!holds) { return; }\n // `[ a, b ] = …` writes a and b through GetValue(, i), so its\n // source is the right-hand side as well\n if (n.kind === SyntaxKind.BinaryExpression && n.operatorToken?.kind === SyntaxKind.EqualsToken\n && this.goAssignmentWritesName(n.left, name)\n && !this.goIsNonPointerValueSource(n.right)) {\n holds = false;\n return;\n }\n n.forEachChild(visit);\n };\n scope.forEachChild(visit);\n }\n }\n this.goAnyLocalHoldsNonPointerCache.set(decl, holds);\n return holds;\n }\n\n // true when this assignment target binds the named local: a plain identifier, or a\n // destructuring element (`[ a, b ] = …` prints GetValue(, i) writes)\n goAssignmentWritesName(left, name): boolean {\n if (left?.kind === SyntaxKind.Identifier) {\n return left.text === name;\n }\n if (left?.kind === SyntaxKind.ArrayLiteralExpression) {\n return left.elements.some((e) => (e?.kind === SyntaxKind.Identifier) && (e.text === name));\n }\n return false;\n }\n\n // the variable declaration an identifier resolves to, when it is one\n goAnyBoxLocalDeclaration(node): any {\n if (node?.kind !== SyntaxKind.Identifier) {\n return undefined;\n }\n const checker: any = this.checkerOrUndefined();\n if (checker === undefined) {\n return undefined;\n }\n const symbol = checker.getSymbolAtLocation(node);\n return symbol?.valueDeclaration?.resolve();\n }\n\n // true when this identifier is a parameter bound by `x := GetArg(optionalArgs, i, default)`:\n // GetArg runs derefScalar and folds a typed nil pointer (and nil []string/[]any) into the untyped\n // default, so the box holds a plain scalar or an untyped nil, never a nil *T.\n goGetArgBoundParameter(node): boolean {\n const decl = this.goAnyBoxLocalDeclaration(node);\n // a parameter without a default keeps the caller's value as-is in a plain `any`\n // parameter, where a *int64 handed over by another method stays a pointer\n if (decl?.kind !== SyntaxKind.Parameter || decl.initializer === undefined) {\n return false;\n }\n // only a method/function body binds its defaulted parameters with GetArg: an arrow\n // function's printed parameters carry no default binding at all\n const owner = decl.parent?.kind;\n if (owner !== SyntaxKind.MethodDeclaration && owner !== SyntaxKind.FunctionDeclaration\n && owner !== SyntaxKind.Constructor) {\n return false;\n }\n return !this.goParameterLaterWritesPointerBox(decl);\n }\n\n // D2 for a GetArg-bound parameter: a later `x = …` write whose printed value is a typed\n // pointer puts a nil *T back in the box, where IsEqual(x, nil) is true but `x == nil` is not\n goParameterLaterWritesPointerBox(decl): boolean {\n const name = (decl?.name?.kind === SyntaxKind.Identifier) ? decl.name.text : undefined;\n if (typeof name !== 'string') {\n return true; // a binding pattern: the write scan cannot follow it\n }\n const scope = this.goEnclosingFunction(decl);\n if (scope === undefined) {\n return true;\n }\n let pointerWrite = false;\n const visit = (n) => {\n if (pointerWrite) {\n return;\n }\n if (n.kind === SyntaxKind.BinaryExpression && n.operatorToken?.kind === SyntaxKind.EqualsToken\n && this.goAssignmentWritesName(n.left, name) && this.goWritePrintsPointerBox(n.right)) {\n pointerWrite = true;\n return;\n }\n n.forEachChild(visit);\n };\n scope.forEachChild(visit);\n return pointerWrite;\n }\n\n // true when the printed value of an assignment's right-hand side is a typed pointer: a\n // `this.safeX(…)`/`this.Parse8601(…)` accessor (GO_HELPER_RETURN_TYPES), an identifier the\n // printer declared `*T`, or a hand-written *sync.Map field. Read from the AST, never printed.\n goWritePrintsPointerBox(expr): boolean {\n expr = this.goUnwrapParenthesizedNode(expr);\n if (expr === undefined) {\n return false;\n }\n if (expr.kind === SyntaxKind.CallExpression) {\n const name = this.goAstCalleeName(expr);\n if (typeof name === 'string') {\n const goType = GO_HELPER_RETURN_TYPES[name];\n if ((typeof goType === 'string') && goType.startsWith('*')) {\n return true;\n }\n // the accessors the ccxt build pass wraps with DerefScalar but the Go type\n // table does not name (`this.NumberToString`, `this.Parse8601`, `this.Iso8601`)\n // return a pointer too, so their write stays unproven\n return GO_DEREF_WRAPPED_CALLS.indexOf(name.replace(/^this\\./, '')) >= 0;\n }\n return false;\n }\n if (expr.kind === SyntaxKind.Identifier) {\n const declared = this.goDeclaredTypeOfIdentifier(expr);\n return (typeof declared === 'string') && declared.startsWith('*');\n }\n if (expr.kind === SyntaxKind.PropertyAccessExpression && expr.expression?.kind === SyntaxKind.ThisKeyword) {\n const fieldType = GO_NILABLE_FIELDS_Typed['this.' + expr.name?.text];\n return (typeof fieldType === 'string') && GO_NIL_EQUIVALENT_POINTER_TYPES_Native.has(fieldType);\n }\n return false;\n }\n\n goScalarFamilyOfType(type, allowNil = false): string | undefined {\n if (type === undefined) {\n return undefined;\n }\n // Str/Int/Num/Bool are nullable aliases of `string | undefined` & friends;\n // their Go representation is still `any`, so they never inline — unless the\n // caller is asking about the value the `any` box holds (allowNil)\n const alias = type.getAliasSymbol()?.escapedName;\n if (!allowNil) {\n switch (alias) {\n case 'Str':\n case 'Int':\n case 'Num':\n case 'Bool':\n return undefined;\n }\n }\n const flags = type.flags;\n if (flags & TypeFlags.Union) {\n const families = new Set();\n for (const member of type.getTypes()) {\n const family = this.goScalarFamilyOfType(member, allowNil);\n if (family === undefined) {\n return undefined;\n }\n // `string | undefined` is `any` in Go, never a bare Go string:\n // one nullable member disqualifies the whole union\n if (family === 'nil') {\n if (allowNil) {\n continue; // the box holds nil for that member\n }\n return undefined;\n }\n families.add(family);\n }\n if (families.size !== 1) {\n return undefined; // `boolean` is `true | false`, so size === 1\n }\n return families.values().next().value;\n }\n if (flags & (TypeFlags.String | TypeFlags.StringLiteral)) {\n return 'string';\n }\n if (flags & (TypeFlags.Number | TypeFlags.NumberLiteral)) {\n return 'number';\n }\n if (flags & (TypeFlags.Boolean | TypeFlags.BooleanLiteral)) {\n return 'bool';\n }\n if (flags & (TypeFlags.Undefined | TypeFlags.Null | TypeFlags.Void)) {\n return 'nil';\n }\n return undefined;\n }\n\n // B-02: a parameter of a nullable ccxt alias (`Str`) prints as the native Go type (`*string`) only\n // when the method is internal (not async/override, no inherited member), every call site passes\n // that type (checker here, textual for siblings), and the body never writes another type (D2).\n goNativeParameterTypeCache = new Map();\n goSameFileCallCache = new Map>>();\n goTsSrcTreeCache = new Map();\n\n goNativeParameterType(param): string | undefined {\n if (param?.kind !== SyntaxKind.Parameter) {\n return undefined;\n }\n if (this.goNativeParameterTypeCache.has(param)) {\n return this.goNativeParameterTypeCache.get(param);\n }\n // the call-site proof prints argument expressions, which can land back here\n this.goNativeParameterTypeCache.set(param, undefined);\n const result = this.goNativeParameterTypeOf(param);\n this.goNativeParameterTypeCache.set(param, result);\n return result;\n }\n\n goNativeParameterTypeOf(param): string | undefined {\n if ((param.initializer !== undefined) || (param.dotDotDotToken !== undefined)) {\n return undefined; // optional/variadic parameters keep the optionalArgs ABI\n }\n if (param.name?.kind !== SyntaxKind.Identifier) {\n return undefined;\n }\n const fn: any = param.parent;\n if ((fn?.kind !== SyntaxKind.MethodDeclaration) || (fn.body === undefined) || (fn.name?.kind !== SyntaxKind.Identifier)) {\n return undefined;\n }\n const parseParam = fn.name.text.startsWith('parse');\n // D-03: a pro handler's frame parameter (`handleX (client: Client, message: Dict)`)\n // is the second family whose call-site proof can name a Go type\n const handlerParam = !parseParam && this.goIsProHandlerMethod(fn);\n if (this.goIsUnifiedStringParameter(fn.name.text, fn.parameters.indexOf(param))) {\n // the table types the base and every override together: a body that breaks it fails the build\n if ((this.goRequiredStringParameterType(param) !== 'string')\n || !this.goLocalIsSafeToType(fn.body, param, param.name.text, 'string')\n || !this.goParameterKeepsNilCompareNative(fn.body, param, 'string')) {\n throw new Error(`unifiedStringParams: ${fn.name.text} parameter ${param.name.text} is not a required string written only as string`);\n }\n return 'string';\n }\n if (this.goMethodKeepsBaseSignature(fn)) {\n return undefined; // inherited/base methods are pinned by the base class and IDerivedExchange\n }\n const index = fn.parameters.indexOf(param);\n if (!parseParam && !handlerParam) {\n // any other exchange-local method: only a non-nullable TS `string` becomes a Go `string`\n // at least one proven caller: an uncalled method's signature is outside API only by accident\n const goType = this.goRequiredStringParameterType(param);\n return ((goType !== undefined) && this.goHasTreeCallSite(fn) && this.goParameterCallSitesPassType(fn, index, goType)\n && this.goLocalIsSafeToType(fn.body, param, param.name.text, goType)\n && this.goParameterKeepsNilCompareNative(fn.body, param, goType)) ? goType : this.g11NativeParameterType(fn, param, index);\n }\n if (this.isAsyncFunction(fn)) {\n return undefined;\n }\n for (const goType of this.goNativeParameterTypeCandidates(param, handlerParam)) {\n if (this.goParameterCallSitesPassType(fn, index, goType)\n && this.goLocalIsSafeToType(fn.body, param, param.name.text, goType)\n && this.goParameterKeepsNilCompareNative(fn.body, param, goType)) {\n return goType;\n }\n }\n return handlerParam ? undefined : this.g11NativeParameterType(fn, param, index);\n }\n\n goIsUnifiedStringParameter(methodName: string, index: number): boolean {\n const indexes = Object.prototype.hasOwnProperty.call(this.unifiedStringParams, methodName) ? this.unifiedStringParams[methodName] : undefined;\n return Array.isArray(indexes) && indexes.includes(index);\n }\n\n // the call arguments of a unified method whose parameter prints `string`: an argument the\n // printer cannot prove a Go string goes through StringArg, which panics on any other value\n goUnifiedStringCallArgs(node, identation, flat = false): string | undefined {\n const callee: any = node.expression;\n const name = (callee?.kind === SyntaxKind.PropertyAccessExpression) ? callee.name?.text : undefined;\n if ((typeof name !== 'string') || !Object.prototype.hasOwnProperty.call(this.unifiedStringParams, name)) {\n return undefined;\n }\n const args = node.arguments ?? [];\n if (args.some((a) => a.kind === SyntaxKind.SpreadElement)) {\n return undefined;\n }\n const depth = this.goExprDepth + ((args.length > 1) ? 1 : 0);\n return args.map((a, i) => {\n const printed = flat ? this.printNode(a, 0) : this.goWithExprDepth(depth, () => this.printNode(a, identation)).trim();\n if (!this.goIsUnifiedStringParameter(name, i) || (this.goPrintedArgType(a) === 'string')) {\n return printed;\n }\n return `StringArg(${printed})`;\n }).join(', ');\n }\n\n // `string` for a parameter whose declared TS type is string (or a string-literal union) with no\n // undefined/null member; a nullable one stays boxed here (callers pass *string or nil)\n goRequiredStringParameterType(param): string | undefined {\n const type = this.checkerOrUndefined()?.getTypeAtLocation(param);\n if (type === undefined) {\n return undefined;\n }\n const parts = ((typeof type.isUnionType === 'function') && type.isUnionType()) ? type.getTypes() : [type];\n return parts.every(p => (p.flags & (TypeFlags.String | TypeFlags.StringLiteral)) !== 0) ? 'string' : undefined;\n }\n\n // The boxed object parameter prints `x === undefined` as a native `x == nil`\n // (goObjectBoxParameter); a parameter the printer typed as a Go map/slice would fall\n // through to IsEqual(x, nil) instead. Both predicates answer false for every value a\n goParameterKeepsNilCompareNative(body, param, goType: string): boolean {\n if (goType === '*string') {\n return true;\n }\n const name = param.name.text;\n let keeps = true;\n const visit = (n) => {\n if (!keeps) {\n return;\n }\n if ((n.kind === SyntaxKind.Identifier) && (n.text === name)) {\n let symbol;\n try {\n symbol = this.getChecker().getSymbolAtLocation(n);\n } catch (e) {\n symbol = undefined;\n }\n const binary: any = n.parent;\n if ((symbol?.valueDeclaration?.resolve() === param) && (binary?.kind === SyntaxKind.BinaryExpression)\n && ((binary.left === n) || (binary.right === n))) {\n const op = binary.operatorToken?.kind;\n if ((op === SyntaxKind.EqualsEqualsToken) || (op === SyntaxKind.EqualsEqualsEqualsToken)\n || (op === SyntaxKind.ExclamationEqualsToken) || (op === SyntaxKind.ExclamationEqualsEqualsToken)) {\n const other: any = (binary.left === n) ? binary.right : binary.left;\n if ((other?.kind === SyntaxKind.NullKeyword)\n || ((other?.kind === SyntaxKind.Identifier) && (other.text === 'undefined'))) {\n keeps = false;\n return;\n }\n }\n }\n }\n n.forEachChild(visit);\n };\n body.forEachChild(visit);\n return keeps;\n }\n\n // ---- D-03: pro handler frame parameters ------------------------------------\n // A `handle*` method of a pro exchange class receives the raw frame from the WS\n // client. When the checker types that parameter as `Dict`, and every call site\n goIsProHandlerMethod(fn): boolean {\n // the main-thread transpile registers the file relative to the repo root\n // (ts/src/pro/.ts) while the batch registers it absolute, so accept both\n const fileName = String(fn.getSourceFile().fileName ?? '');\n if (!(/(^|[\\\\/])ts[\\\\/]src[\\\\/]pro[\\\\/]/.test(fileName))) {\n return false;\n }\n const name = fn.name.text;\n return (name.length > 6) && name.startsWith('handle') && (name[6] === name[6].toUpperCase());\n }\n\n // `Dict` is the checker's structural `{[key: string]: any}`: a string index\n // signature is the proof. Class instances (OrderBook, ArrayCache*, Client, Future),\n // named-member interfaces (Market, Order, Ticker) and arrays carry none of them, so\n goParameterTypeIsDict(type): boolean {\n try {\n return (typeof type.getStringIndexType === 'function') && (type.getStringIndexType() !== undefined);\n } catch (e) {\n return false;\n }\n }\n\n // the Go types the declared TypeScript type can carry. `Dict`/`Market`/`Currency`\n // and the other dict-shaped object types print as the `map[string]any` the Go side\n // builds them from, `List` (= any[]) as its `[]any`; pro `handle*` frames (isHandler)\n goNativeParameterTypeCandidates(param, isHandler = false): string[] {\n const checker: any = this.checkerOrUndefined();\n const type = checker?.getTypeAtLocation(param);\n if (type === undefined) {\n return [];\n }\n let parts = ((typeof type.isUnionType === 'function') && type.isUnionType()) ? type.getTypes().slice() : [type];\n parts = parts.filter(p => !(p.flags & (TypeFlags.Undefined | TypeFlags.Null)));\n if (parts.length !== 1) {\n return [];\n }\n const inner: any = parts[0];\n if (inner.flags & TypeFlags.String) {\n return isHandler ? [] : ['*string'];\n }\n if (isHandler && this.goParameterTypeIsDict(inner)) {\n return ['map[string]any'];\n }\n if (!(inner.flags & TypeFlags.Object)) {\n return [];\n }\n if (checker.isArrayType(inner)) {\n // List / any[]: the element must itself be `any`, or the Go slice would need\n // the narrower element type (`string[]` is a []string the printer does not build)\n const element = checker.getIndexTypeOfType(inner, IndexKind.Number);\n return ((element !== undefined) && (element.flags & (TypeFlags.Any | TypeFlags.Unknown))) ? ['[]any'] : [];\n }\n // Dict / Market / Currency / a structure interface: a plain Go dictionary, never a\n // class instance or a function (goTypeIsNilComparableObject is the printer's own\n // test for exactly those types, used for the boxed nil test above)\n return this.goTypeIsNilComparableObject(inner) ? ['map[string]any'] : [];\n }\n\n // true when the method overrides (or shadows) a member of the class it extends, or carries an\n // explicit `override`: those print the base signature so the generated base classes and\n // IDerivedExchange keep compiling. The abstract base (ts/src/base/**) is never retyped.\n goMethodKeepsBaseSignature(fn): boolean {\n if ((fn.modifiers ?? []).some(m => m.kind === SyntaxKind.OverrideKeyword)) {\n return true;\n }\n if (/(^|\\/)ts\\/src\\/base\\//.test(fn.getSourceFile().fileName)) {\n return true;\n }\n const name = fn.name.text;\n const cls = this.goEnclosingClass(fn);\n if (cls === undefined) {\n return true;\n }\n const extendsClauses = (cls.heritageClauses ?? []).filter(clause => clause.token === SyntaxKind.ExtendsKeyword);\n if (extendsClauses.length === 0) {\n return true; // a root class: the abstract base of the generated tree\n }\n for (const clause of extendsClauses) {\n for (const expr of (clause.types ?? [])) {\n const checker: any = this.checkerOrUndefined();\n const baseType = checker.getTypeAtLocation(expr);\n if (baseType?.getProperty?.(name) !== undefined) {\n return true;\n }\n }\n }\n return false;\n }\n\n goHasTreeCallSite(fn): boolean {\n const name = fn.name.text;\n if (this.goSameFileCallsOf(fn, name).length > 0) {\n return true;\n }\n const tree = this.goTsSrcTree(fn.getSourceFile());\n const myClass = this.goEnclosingClassName(fn);\n return (tree?.callIndex.get(name) ?? []).some(site => this.goTsSrcFileDerivesFrom(tree, site.file, myClass));\n }\n\n // every call site of `fn` in the whole tree must pass exactly `goType` at `index`\n goParameterCallSitesPassType(fn, index: number, goType: string): boolean {\n const name = fn.name.text;\n for (const call of this.goSameFileCallsOf(fn, name)) {\n const arg = call.arguments?.[index];\n if ((arg === undefined) || (arg.kind === SyntaxKind.SpreadElement)) {\n return false;\n }\n if (this.goPrintedArgType(arg) !== goType) {\n return false;\n }\n }\n const tree = this.goTsSrcTree(fn.getSourceFile());\n if (tree !== undefined) {\n const myClass = this.goEnclosingClassName(fn);\n const myFile = tree.relativeOf.get(path.resolve(fn.getSourceFile().fileName));\n for (const site of (tree.callIndex.get(name) ?? [])) {\n if (site.file === myFile) {\n continue; // proven above off the checker\n }\n if (!this.goTsSrcFileDerivesFrom(tree, site.file, myClass)) {\n continue; // a same-named method of another exchange\n }\n const arg = site.args[index];\n if ((arg === undefined) || !this.goTextArgMatchesType(arg, goType, site.file, tree)) {\n return false;\n }\n }\n }\n return true;\n }\n\n goEnclosingClass(fn) {\n let cls = fn.parent;\n while ((cls !== undefined) && (cls.kind !== SyntaxKind.ClassDeclaration) && (cls.kind !== SyntaxKind.ClassExpression)) {\n cls = cls.parent;\n }\n return cls;\n }\n\n goEnclosingClassName(fn): string | undefined {\n const cls = this.goEnclosingClass(fn);\n return (cls?.name?.kind === SyntaxKind.Identifier) ? cls.name.text : undefined;\n }\n\n // the printed Go type of a call-site argument, or undefined when the printer\n // cannot name it (then the call site does not prove anything)\n goPrintedArgType(arg): string | undefined {\n if (arg.kind === SyntaxKind.Identifier) {\n return this.goDeclaredTypeOfIdentifier(arg);\n }\n return this.goTypeOfInitializer(arg, this.printNode(arg, 0));\n }\n\n // every `this.(...)` of this file whose resolved signature is `fn`\n goSameFileCallsOf(fn, name: string): Array {\n const file = fn.getSourceFile();\n let index = this.goSameFileCallCache.get(file);\n if (index === undefined) {\n index = new Map>();\n const visit = (node) => {\n if (node.kind === SyntaxKind.CallExpression) {\n const callee: any = node.expression;\n const calleeName = (callee?.kind === SyntaxKind.PropertyAccessExpression) ? callee.name?.text : undefined;\n if (typeof calleeName === 'string') {\n const list = index.get(calleeName) ?? [];\n list.push(node);\n index.set(calleeName, list);\n }\n }\n node.forEachChild(visit);\n };\n visit(file);\n this.goSameFileCallCache.set(file, index);\n }\n const checker = this.getChecker();\n const result = [];\n for (const call of (index.get(name) ?? [])) {\n let declaration;\n try {\n declaration = checker.getResolvedSignature(call)?.declaration?.resolve();\n } catch (e) {\n declaration = undefined;\n }\n if (declaration === fn) {\n result.push(call);\n }\n }\n return result;\n }\n\n // Lazily read the ts/src tree this file belongs to: the call sites of every\n // `this.x(...)`, each file's text and its class -> base map. A scoped run's\n // program holds one exchange, so the sibling files are only provable textually.\n goTsSrcTree(file): any {\n // drivers pass relative names (`ts/src/x.ts`): resolve so the marker and relativeOf match\n const fileName: string = path.resolve(file.fileName);\n const marker = '/ts/src/';\n const at = fileName.lastIndexOf(marker);\n if (at < 0) {\n return undefined; // in-memory source (tests): no sibling files to prove\n }\n const root = fileName.substring(0, at + marker.length - 1);\n if (!this.goTsSrcTreeCache.has(root)) {\n this.goTsSrcTreeCache.set(root, this.goTsSrcTreeBuild(root));\n }\n return this.goTsSrcTreeCache.get(root);\n }\n\n goTsSrcTreeBuild(root: string) {\n const callIndex = new Map>();\n const fileText = new Map();\n const classBases = new Map();\n const relativeOf = new Map();\n const walk = (dir: string, rel: string) => {\n let entries;\n try {\n entries = fs.readdirSync(dir, { withFileTypes: true });\n } catch (e) {\n return;\n }\n for (const entry of entries) {\n if (entry.isDirectory()) {\n if (entry.name !== 'node_modules') {\n walk(path.join(dir, entry.name), rel + entry.name + '/');\n }\n continue;\n }\n if (!entry.name.endsWith('.ts') || entry.name.endsWith('.d.ts')) {\n continue;\n }\n const relPath = rel + entry.name;\n let text;\n try {\n text = fs.readFileSync(path.join(dir, entry.name), 'utf8');\n } catch (e) {\n continue;\n }\n fileText.set(relPath, text);\n relativeOf.set(path.join(dir, entry.name), relPath);\n const classRe = /\\bclass\\s+([A-Za-z_$][\\w$]*)\\s+extends\\s+([A-Za-z_$][\\w$]*)/g;\n let match;\n while ((match = classRe.exec(text)) !== null) {\n classBases.set(match[1], match[2]);\n }\n const callRe = /this\\s*\\.\\s*([A-Za-z_$][\\w$]*)\\s*\\(/g;\n while ((match = callRe.exec(text)) !== null) {\n const args = goBalancedCallArgs(text, callRe.lastIndex - 1);\n if (args === undefined) {\n continue;\n }\n const list = callIndex.get(match[1]) ?? [];\n list.push({ file: relPath, args });\n callIndex.set(match[1], list);\n }\n }\n };\n walk(root, '');\n return { callIndex, fileText, classBases, relativeOf };\n }\n\n goTsSrcFileDerivesFrom(tree, file: string, className: string | undefined): boolean {\n if (className === undefined) {\n return true; // unknown owner: keep the reference inside the proof\n }\n const text = tree.fileText.get(file);\n if (text === undefined) {\n return true;\n }\n const classRe = /\\bclass\\s+([A-Za-z_$][\\w$]*)/g;\n let match;\n while ((match = classRe.exec(text)) !== null) {\n let current: string | undefined = match[1];\n for (let hops = 0; (hops < 12) && (current !== undefined); hops++) {\n if (current === className) {\n return true;\n }\n current = tree.classBases.get(current);\n }\n }\n return false;\n }\n\n // the textual call-site proof. `*string` is the only pointer-shaped native type\n // with siblings the printer can name from text; a map/slice parameter is proven for\n // the argument shapes whose printed Go form IS that type: the object/array literals\n goTextArgMatchesType(argText: string, goType: string, file: string, tree): boolean {\n let text = (argText ?? '').trim();\n while (text.startsWith('(') && text.endsWith(')')) {\n text = text.substring(1, text.length - 1).trim();\n }\n const isStringProducer = (candidate: string) => GO_TS_SRC_STRING_PRODUCERS.some(rx => rx.test(candidate));\n const localDeclaredFrom = (name: string, accept: (init: string) => boolean) => {\n const fileText = tree.fileText.get(file) ?? '';\n const declRe = new RegExp('(?:const|let|var)\\\\s+' + name + '\\\\s*(?::[^=]*)?=\\\\s*([^;\\\\n]+)');\n const match = declRe.exec(fileText);\n return (match !== null) && accept(match[1].trim());\n };\n if (goType === 'string') {\n return /^(?:'[^'\\\\]*'|\"[^\"\\\\]*\")$/.test(text); // a sibling file proves only a plain literal\n }\n if (goType === '*string') {\n if (isStringProducer(text)) {\n return true;\n }\n const identifier = /^([A-Za-z_$][\\w$]*)$/.exec(text);\n if (identifier !== null) {\n return localDeclaredFrom(identifier[1], isStringProducer);\n }\n }\n if ((goType === 'map[string]any') || (goType === '[]any')) {\n // Only the argument shapes whose printed Go form IS this map/slice: the\n // matching literal and the printer's own map producers. An identifier is\n // deliberately not proven here: this proof reads one file's text, so it\n const isMap = goType === 'map[string]any';\n const literal = isMap ? '{' : '[';\n const producers = isMap ? GO_TS_SRC_MAP_PRODUCERS : [];\n return text.startsWith(literal) || producers.some(rx => rx.test(text));\n }\n return false;\n }\n\n // the Go type this identifier is actually *declared* with, or undefined when it\n // stays `any`. It goes through getGoLocalType, not goTypeOfInitializer, so a\n // declaration the reject filters demoted back to `any` is reported as `any` here\n // too — otherwise we would emit `*x` against an `any` box.\n // A parameter resolves to its declared Go type only when goNativeParameterType\n // proved it (see the B-02 block above); everything else stays `any`.\n //\n // getGoLocalType re-prints every reassignment's right-hand side, and printing a\n // ternary re-enters printCondition, which lands back here: `x = (x === 'a') ? …`\n // would recurse forever. The in-progress set breaks that cycle by answering\n // `any` for the declaration currently being classified, and the cache keeps the\n // per-occurrence cost at one scope scan per declaration.\n goDeclaredTypeCache = new Map();\n goDeclaredTypeInProgress = new Set();\n\n goDeclaredTypeOfIdentifier(node): string | undefined {\n if (node?.kind !== SyntaxKind.Identifier) {\n return undefined;\n }\n const decl: any = this.checkerOrUndefined()?.getSymbolAtLocation(node)?.valueDeclaration?.resolve();\n if (decl === undefined) {\n return undefined;\n }\n if (decl.kind === SyntaxKind.Parameter) {\n // a defaulted parameter bound through a pointer GetArg twin is that pointer at every consumer\n const bound = this.goGetArgParameterType(decl);\n if ((bound !== undefined) && bound.startsWith('*')) {\n return bound;\n }\n // B-02: a parameter the call-site proof typed prints its native Go type\n return this.goNativeParameterType(decl);\n }\n if (decl.kind !== SyntaxKind.VariableDeclaration || decl.initializer === undefined || decl.name?.kind !== SyntaxKind.Identifier) {\n return undefined;\n }\n if (this.goDeclaredTypeCache.has(decl)) {\n return this.goDeclaredTypeCache.get(decl);\n }\n if (this.goDeclaredTypeInProgress.has(decl)) {\n return undefined;\n }\n this.goDeclaredTypeInProgress.add(decl);\n let goType;\n try {\n goType = this.getGoLocalType(decl, this.printNode(decl.initializer, 0));\n } finally {\n this.goDeclaredTypeInProgress.delete(decl);\n }\n const result = (goType === 'any') ? undefined : goType;\n this.goDeclaredTypeCache.set(decl, result);\n return result;\n }\n\n // true when this identifier's Go type is a pointer we can deref (*string / *int64 / …)\n goIsPointerIdentifier(node): boolean {\n const goType = this.goDeclaredTypeOfIdentifier(node);\n return (typeof goType === 'string') && goType.startsWith('*');\n }\n\n // the Go pointer type an *expression* evaluates to, or undefined. Covers both a\n // local declared `var x *string = …` and a direct `this.SafeString(...)` call,\n // whose Go signature returns a pointer even though TypeScript says `string`.\n goPointerTypeOfExpression(node, printedText: string): string | undefined {\n const declared = this.goDeclaredTypeOfIdentifier(node);\n if ((typeof declared === 'string') && declared.startsWith('*')) {\n return declared;\n }\n // a hand-written BaseExchange field, e.g. `this.Markets`: its Go type is the one\n // go/v4/exchange.go declares, and the helpers turn a nil one into a nil\n if (node?.kind === SyntaxKind.PropertyAccessExpression) {\n const fieldType = GO_NILABLE_FIELDS_Typed[printedText];\n if ((typeof fieldType === 'string') && GO_NIL_EQUIVALENT_POINTER_TYPES_Native.has(fieldType)) {\n return fieldType;\n }\n }\n if (node?.kind === SyntaxKind.CallExpression) {\n const goType = this.goTypeOfInitializer(node, printedText);\n if ((typeof goType === 'string') && goType.startsWith('*')) {\n return goType;\n }\n }\n return undefined;\n }\n\n // the concrete Go type a `x[k] = v` receiver is declared with, when the printer\n // can name it: a local it typed itself, or a whole call whose Go return type it\n // knows. Everything else is an `any` box, and indexing an `any` in Go needs a\n // type assertion, so those keep the runtime helper.\n goElementAssignmentContainerType(node, printedText: string): string | undefined {\n const declared = this.goDeclaredTypeOfIdentifier(node);\n if ((declared === 'map[string]any') || (declared === '[]any')) {\n return declared;\n }\n if (node?.kind === SyntaxKind.CallExpression) {\n const known = this.goTypeOfInitializer(node, printedText);\n if ((known === 'map[string]any') || (known === '[]any')) {\n return known;\n }\n }\n return undefined;\n }\n\n // the Go container type of a hand-written `this.` receiver, undefined for every other\n // shape. Generated structs embed BaseExchange, so `this.` is the only property access the\n // field table types — a local or parameter of the same name is a different declaration.\n goFieldContainerTypeNative(node): string | undefined {\n if ((node?.kind !== SyntaxKind.PropertyAccessExpression) || (node.expression?.kind !== SyntaxKind.ThisKeyword)) {\n return undefined;\n }\n const name = node.name?.text;\n if (typeof name !== 'string') {\n return undefined;\n }\n return GO_FIELD_CONTAINER_TYPES_NATIVE[this.transformPropertyAccessExpressionName(name, node.name)];\n }\n\n // the printed key is a Go string when the printer knows it: a string literal, or\n // an identifier declared `string`. Params, GetValue(...) and string concatenation\n // all print as `any`, which Go refuses as a map key.\n goIsStringKeyExpression(node): boolean {\n if ((node.kind === SyntaxKind.StringLiteral) || (node.kind === SyntaxKind.NoSubstitutionTemplateLiteral)) {\n return true;\n }\n return this.goDeclaredTypeOfIdentifier(node) === 'string';\n }\n\n // `[]any` receivers only inline when the index is a literal the slice's own\n // literal initializer covers and nothing rebinds the local: the helper silently\n // ignores an out-of-range index, while Go panics on the assignment.\n goSliceIndexProvablyInRange(node, indexNode): boolean {\n if ((node?.kind !== SyntaxKind.Identifier) || (indexNode?.kind !== SyntaxKind.NumericLiteral)) {\n return false;\n }\n const index = Number(indexNode.text);\n if (!Number.isInteger(index) || (index < 0)) {\n return false;\n }\n const decl: any = this.checkerOrUndefined()?.getSymbolAtLocation(node)?.valueDeclaration?.resolve();\n if (decl === undefined || decl.kind !== SyntaxKind.VariableDeclaration || decl.name?.kind !== SyntaxKind.Identifier) {\n return false;\n }\n const initializer = decl.initializer;\n if ((initializer?.kind !== SyntaxKind.ArrayLiteralExpression) || (initializer.elements.length <= index)) {\n return false;\n }\n return !this.goLocalIsRebound(this.goEnclosingFunction(decl), decl.name);\n }\n\n // true when the local is rebound anywhere in its function; an element write\n // (`x[k] = v`) leaves the local itself bound, so only the slice header is at stake\n goLocalIsRebound(scope, nameNode): boolean {\n if (scope === undefined) {\n return true;\n }\n const name = nameNode.text;\n let rebound = false;\n const visit = (n) => {\n if (rebound) {\n return;\n }\n if ((n.kind === SyntaxKind.Identifier) && (n.text === name) && (n !== nameNode)) {\n if (this.goRebindingTargetOf(n) !== undefined) {\n rebound = true;\n return;\n }\n }\n n.forEachChild(visit);\n };\n visit(scope);\n return rebound;\n }\n\n // walks up from the identifier to the assignment it targets: `x = …` / `x += …` /\n // `[x, y] = …` / `for (x of …)` rebind the local, `x[k] = v` does not\n goRebindingTargetOf(identifier) {\n let node: any = identifier;\n let parent = node.parent;\n while (parent?.kind === SyntaxKind.ArrayLiteralExpression) {\n node = parent;\n parent = parent.parent;\n }\n if ((parent?.kind === SyntaxKind.ForOfStatement) && (parent.initializer === node)) {\n return parent;\n }\n if ((parent?.kind === SyntaxKind.BinaryExpression) && (parent.left === node)) {\n const op = parent.operatorToken.kind;\n if ((op === SyntaxKind.EqualsToken) || ((op >= SyntaxKind.FirstCompoundAssignment) && (op <= SyntaxKind.LastCompoundAssignment))) {\n return parent;\n }\n }\n return undefined;\n }\n\n // native `container[key] = value` when the receiver's Go type is proved by the\n // printer, otherwise undefined and the caller keeps the runtime helper\n printNativeElementAssignment(containerNode, containerStr: string, keyNode, keyStr: string, valueStr: string, compound = false, valueNode?): string | undefined {\n const containerType = this.goElementAssignmentContainerType(containerNode, containerStr);\n const fieldType = this.goFieldContainerTypeNative(containerNode);\n if ((fieldType !== undefined) || (containerType === 'map[string]any')) {\n if (!this.goIsStringKeyExpression(keyNode)) {\n return this.printNativeGuardedPointerKeyAssignment(containerNode, containerStr, containerType, fieldType, keyNode, keyStr, valueStr, compound, valueNode);\n }\n if (fieldType === '*sync.Map') {\n // a `+=` reads the element back through `container[key]`, which a\n // sync.Map has no operator for: that shape keeps the runtime helper\n return compound ? undefined : `${containerStr}.Store(${keyStr}, ${valueStr})`;\n }\n return `${containerStr}[${keyStr}] = ${valueStr}`;\n }\n if ((containerType === '[]any') && this.goSliceIndexProvablyInRange(containerNode, keyNode)) {\n return `${containerStr}[${keyStr}] = ${valueStr}`;\n }\n return undefined;\n }\n\n // `m[*k] = v` for a fresh unshared map local, a nil-guarded *string key and a\n // non-pointer value: exactly the helper's map branch minus its lock and derefs\n printNativeGuardedPointerKeyAssignment(containerNode, containerStr: string, containerType, fieldType, keyNode, keyStr: string, valueStr: string, compound: boolean, valueNode): string | undefined {\n if (compound || (fieldType !== undefined) || (containerType !== 'map[string]any') || (valueNode === undefined)) {\n return undefined;\n }\n if (this.goIsNilGuardedStringPointerKey(keyNode) && this.goIsFreshUnsharedMapLocal(containerNode, containerNode) && this.goIsNonPointerValue(valueNode)) {\n return `${containerStr}[*${keyStr}] = ${valueStr}`;\n }\n return undefined;\n }\n\n // a `*string` local the enclosing control flow proves non-nil: the helper's deref\n // yields the same string key (a nil key would have made it a no-op)\n goIsNilGuardedStringPointerKey(keyNode): boolean {\n return (keyNode?.kind === SyntaxKind.Identifier) && (this.goDeclaredTypeOfIdentifier(keyNode) === '*string')\n && this.goHasEnclosingNilGuard(keyNode);\n }\n\n // a local bound once to an object literal, never read by a nested function and not handed\n // out (anything but `m[k]`) before this write: no other goroutine can hold the map yet\n goIsFreshUnsharedMapLocal(node, writeSite): boolean {\n if (node?.kind !== SyntaxKind.Identifier) {\n return false;\n }\n const decl: any = this.checkerOrUndefined()?.getSymbolAtLocation(node)?.valueDeclaration?.resolve();\n if ((decl?.kind !== SyntaxKind.VariableDeclaration) || (decl.name?.kind !== SyntaxKind.Identifier)\n || (decl.initializer?.kind !== SyntaxKind.ObjectLiteralExpression)) {\n return false;\n }\n const scope = this.goEnclosingFunction(decl);\n if ((scope === undefined) || (scope.kind === SyntaxKind.SourceFile) || this.goLocalIsRebound(scope, decl.name)) {\n return false;\n }\n const symbol = this.checkerOrUndefined()?.getSymbolAtLocation(decl.name);\n let captured = false;\n const visit = (n, nested: boolean) => {\n if (captured) {\n return;\n }\n if ((n.kind === SyntaxKind.Identifier) && (n !== decl.name) && (n.text === decl.name.text)\n && (this.checkerOrUndefined()?.getSymbolAtLocation(n) === symbol)) {\n const receiver = (n.parent?.kind === SyntaxKind.ElementAccessExpression) && (n.parent.expression === n);\n if (nested || (!receiver && this.goUseMayPrecede(n, writeSite, scope))) {\n captured = true;\n }\n return;\n }\n const inner = nested || isFunctionLike(n);\n n.forEachChild((c) => visit(c, inner));\n };\n scope.forEachChild((c) => visit(c, false));\n return !captured;\n }\n\n // the use runs before the write: earlier in the text, or both inside one loop body\n goUseMayPrecede(use, writeSite, scope): boolean {\n if (use.pos < writeSite.pos) {\n return true;\n }\n for (let n = writeSite.parent; (n !== undefined) && (n !== scope); n = n.parent) {\n if (GO_ITERATION_STATEMENT_KINDS.has(n.kind) && (use.pos >= n.pos) && (use.end <= n.end)) {\n return true;\n }\n }\n return false;\n }\n\n // the value's printed Go type is concrete and not a pointer, so the helper's derefScalar\n // leaves it unchanged; an `any` box or a pointer keeps the helper\n goIsNonPointerValue(valueNode): boolean {\n const inner = this.goUnwrapParenthesizedNode(valueNode);\n switch (inner?.kind) {\n case SyntaxKind.StringLiteral:\n case SyntaxKind.NoSubstitutionTemplateLiteral:\n case SyntaxKind.TrueKeyword:\n case SyntaxKind.FalseKeyword:\n case SyntaxKind.ObjectLiteralExpression:\n case SyntaxKind.ArrayLiteralExpression:\n return true;\n }\n if (inner === undefined) {\n return false;\n }\n const goType = this.goPrintedTypeOfExpression(inner, this.printNode(inner, 0));\n return (typeof goType === 'string') && (goType !== 'any') && !goType.startsWith('*');\n }\n\n // the concrete Go type an *expression* is printed as: a local's declared type,\n // the return type of a runtime helper call, or a literal. undefined when the value\n // stays inside an `any` box — a native Go operation on an `any` box would not\n // compile, so every rule below falls back to its helper in that case.\n goPrintedTypeOfExpression(node, printedText: string): string | undefined {\n const inner = (node?.kind === SyntaxKind.ParenthesizedExpression) ? node.expression : node;\n if (inner?.kind === SyntaxKind.Identifier) {\n return this.goDeclaredTypeOfIdentifier(inner);\n }\n return this.goTypeOfInitializer(inner, printedText);\n }\n\n // `x.length` on a value the printer declares as a slice is `len(x)`: Go's len is\n // 0 for a nil slice, exactly like GetArrayLength's `[]T` cases. On a map or an\n // `any` box GetArrayLength answers 0, so only a `[]`-typed value may inline —\n // and only for the slice types the helper itself counts (a []byte would answer 0).\n sliceLengthTypes = [ '[]any', '[]string', '[]int64', '[]float64', '[]bool', '[]int', '[][]any', '[]map[string]any' ];\n\n // hand-written BaseExchange fields (go/v4/exchange.go) whose Go type is one of the\n // slice types above: the struct value is never a nil pointer and len(field) is the\n // very value the helper's type switch returns for it.\n GO_NATIVE_LENGTH_FIELDS = [ 'Symbols' ];\n\n printInlineArrayLength(expression, printedText: string, lengthNode?): string | undefined {\n if (printedText.includes('\\n')) {\n return undefined;\n }\n const goType = this.goPrintedTypeOfExpression(expression, printedText);\n if ((typeof goType === 'string') && this.sliceLengthTypes.indexOf(goType) >= 0) {\n return `len(${printedText})`;\n }\n if (this.goLengthFeedsArithmeticClassifier(lengthNode)) {\n return undefined;\n }\n // a Go `string` counts its bytes in both helpers (GetLength's reflect.String\n // case, GetArrayLength's `case string`), and neither helper's nil/`any` branch\n // is reachable for it; a *string / any box keeps the helper it prints today\n if ((goType === 'string') || (this.goNativeLengthFieldType(printedText) !== undefined)) {\n return `len(${printedText})`;\n }\n return undefined;\n }\n\n // the hand-written struct type of a `this.` read, for fields declared as a slice the\n // length helpers count. Any other type (map / *sync.Map / interface{}) keeps the helper:\n // GetArrayLength answers 0 for those, while len would answer the real count.\n goNativeLengthFieldType(printedText: string): string | undefined {\n const match = /^this\\.([A-Za-z_]\\w*)$/.exec(this.goUnwrapPrintedParens(printedText));\n if (match === null || this.GO_NATIVE_LENGTH_FIELDS.indexOf(match[1]) < 0) {\n return undefined;\n }\n return '[]string';\n }\n\n // true when the `.length` sits inside a `-`, `*`, `/` or `%` chain. The ccxt-side classifier\n // (build/go-local-types.js, CCXT_GO_INT_OPERAND_CALLEES) names `GetArrayLength(`/`GetLength(` an\n // `int` operand, so inlining `len` would declassify the chain's int64 local and `.(int64)` unbox.\n goLengthFeedsArithmeticClassifier(lengthNode): boolean {\n let current = lengthNode?.parent;\n for (let i = 0; (i < 16) && (current !== undefined); i++) {\n if (current.kind === SyntaxKind.BinaryExpression) {\n const op = current.operatorToken?.kind;\n if ((op === SyntaxKind.MinusToken) || (op === SyntaxKind.AsteriskToken)\n || (op === SyntaxKind.SlashToken) || (op === SyntaxKind.PercentToken)) {\n return true;\n }\n }\n switch (current.kind) {\n case SyntaxKind.ExpressionStatement:\n case SyntaxKind.VariableStatement:\n case SyntaxKind.ReturnStatement:\n case SyntaxKind.IfStatement:\n case SyntaxKind.Block:\n case SyntaxKind.ForStatement:\n case SyntaxKind.WhileStatement:\n case SyntaxKind.MethodDeclaration:\n case SyntaxKind.FunctionDeclaration:\n case SyntaxKind.ArrowFunction:\n return false;\n }\n current = current.parent;\n }\n return false;\n }\n\n // Go has no ternary operator. The func literal returns the same branch value the\n // helper would and prints the condition the same way; it evaluates only the branch\n // TypeScript would take, while Ternary receives both already evaluated. Both arms\n // printing as one and the same Go scalar names it (`func() string`), so the literal\n // carries the value itself instead of an `any` box.\n printInlineTernary(condition: string, whenTrue: string, whenFalse: string, resultType: string = undefined): string | undefined {\n if (condition.includes('\\n')) {\n return undefined;\n }\n // go/printer never keeps a func literal whose body holds an `if` on one line, and\n // controlClause() strips the parentheses around the `if` condition; the body sits one\n // level below the statement the literal belongs to, `}()` at the statement's level\n const level = this.goStatementLevel;\n const body = this.getIden(level + 1);\n const branch = this.getIden(level + 2);\n return `func() ${resultType ?? 'any'} {\\n${body}if ${this.goStripControlClauseParens(condition)} {\\n${branch}return ${whenTrue}\\n${body}}\\n${body}return ${whenFalse}\\n${this.getIden(level)}}()`;\n }\n\n // the Go scalar an arm already prints a VALUE of, or undefined while the arm is an `any` box.\n // Only the printed text counts: a literal, a local declared with that type, or a call whose Go\n // signature returns it. A classifier-named box (`Subtract(...)`) cannot be carried by `return`.\n goTernaryArmType(node, printedText: string): string | undefined {\n const text = this.goUnwrapPrintedParens(printedText);\n const inner = (node?.kind === SyntaxKind.ParenthesizedExpression) ? node.expression : node;\n switch (inner?.kind) {\n case SyntaxKind.StringLiteral:\n case SyntaxKind.NoSubstitutionTemplateLiteral:\n return 'string';\n case SyntaxKind.TrueKeyword:\n case SyntaxKind.FalseKeyword:\n return 'bool';\n case SyntaxKind.NumericLiteral:\n // an integer literal is an untyped constant of Go default type `int`; a\n // fraction/exponent makes it a float64 constant\n if (/^[0-9]+$/.test(inner.text)) {\n return 'int';\n }\n return (/^[0-9]*\\.[0-9]+([eE][+-]?[0-9]+)?$/.test(inner.text) || /^[0-9]+[eE][+-]?[0-9]+$/.test(inner.text)) ? 'float64' : undefined;\n case SyntaxKind.Identifier:\n return this.goLocalStaticType(inner); // declared `var x T = …` (never `:=`)\n }\n // a nested ternary prints the printer's own typed literal, whose return type is\n // the arm's type as well\n const literalType = goFuncLiteralReturnType(text);\n if (literalType !== undefined) {\n return literalType;\n }\n const open = text.indexOf('(');\n if (open <= 0 || !this.isWholePrintedCall(text, open)) {\n return undefined;\n }\n const goType = GO_HELPER_RETURN_TYPES[text.substring(0, open)];\n return ((goType === undefined) || goType.startsWith('*')) ? undefined : goType;\n }\n\n // the one Go scalar both arms print as, or undefined when the literal keeps the `any`\n // box: only GO_TYPE_NAMES are nameable, and a pointer/`any` arm (or two different\n // types) is not a type the literal could return\n goTernaryResultType(whenTrueNode, whenTrue: string, whenFalseNode, whenFalse: string): string | undefined {\n const whenTrueType = this.goTernaryArmType(whenTrueNode, whenTrue);\n if ((typeof whenTrueType !== 'string') || (whenTrueType === 'any') || (GO_TYPE_NAMES.indexOf(whenTrueType) < 0)) {\n return undefined;\n }\n return (this.goTernaryArmType(whenFalseNode, whenFalse) === whenTrueType) ? whenTrueType : undefined;\n }\n\n // stripParens() applied to a printed condition text (see goControlClauseParens)\n goStripControlClauseParens(text: string): string {\n for (;;) {\n const inner = this.goEnclosedExpression(text);\n if (inner === undefined) {\n return text;\n }\n text = inner;\n }\n }\n\n // a multi-line branch (a nested ternary, a composite literal) is laid out relative to\n // the `return` statement that holds it: inside the `if` for whenTrue (two levels below\n // the statement), the literal's body for whenFalse (one level)\n goPrintTernaryBranch(node, levels: number) {\n const previousLevel = this.goStatementLevel;\n this.goStatementLevel = previousLevel + levels;\n try {\n return this.goWithExprDepth(1, () => this.printNode(node, 0));\n } finally {\n this.goStatementLevel = previousLevel;\n }\n }\n\n // `key in obj` on a Go map[string]any with a Go string key: the two-value read is a statement,\n // hence the func literal; present-but-nil is ok=true like InOp. A `*string` key derefs, nil\n // answering false. InOp also covers nil/number keys and sync.Map/orderbook receivers: else keep it.\n printInlineInOp(dictNode, keyNode, dictText: string, keyText: string): string | undefined {\n if (dictText.includes('\\n') || keyText.includes('\\n')) {\n return undefined;\n }\n if (this.goPrintedTypeOfExpression(dictNode, dictText) !== 'map[string]any') {\n return undefined;\n }\n if (this.goPrintedTypeOfExpression(keyNode, keyText) !== 'string') {\n // InOp runs derefScalar over both operands: a `*string` key is the pointed-to\n // string, and a nil pointer is a nil key, i.e. false. Only an identifier may be\n // repeated by the guard — any other expression would be evaluated twice.\n if ((keyNode?.kind !== SyntaxKind.Identifier) || (this.goDeclaredTypeOfIdentifier(keyNode) !== '*string')) {\n return undefined;\n }\n const level = this.goStatementLevel;\n const body = this.getIden(level + 1);\n return `func() bool {\\n${body}if ${keyText} == nil {\\n${this.getIden(level + 2)}return false\\n${body}}\\n${body}_, ok := ${dictText}[*${keyText}]\\n${body}return ok\\n${this.getIden(level)}}()`;\n }\n // funcBody() keeps the literal on one line while `func() bool` (11 columns) plus\n // the two statements and their `; ` separator fit in 100 columns\n const read = `_, ok := ${dictText}[${keyText}]`;\n if (11 + read.length + 2 + 'return ok'.length <= 100) {\n return `func() bool { ${read}; return ok }()`;\n }\n const level = this.goStatementLevel;\n return `func() bool {\\n${this.getIden(level + 1)}${read}\\n${this.getIden(level + 1)}return ok\\n${this.getIden(level)}}()`;\n }\n\n // comparison helpers that normalize int/int64/float64 against each other, so a\n // literal operand's Go default type (int) behaves like the int64 OpNeg produces\n comparisonHelpers = [ 'IsEqual', 'IsGreaterThan', 'IsLessThan', 'IsGreaterThanOrEqual', 'IsLessThanOrEqual' ];\n\n // OpNeg boxes `-val.Int()` / `-val.Float()`, i.e. an int64 or a float64, and nil\n // for anything else. `-x` reproduces that exactly only for an operand that already\n // prints as float64/int64; a Go `int` (or an integer literal) boxes as int instead.\n printInlineOpNeg(node, printedText: string): string | undefined {\n if (printedText.includes('\\n')) {\n return undefined;\n }\n const goType = this.goPrintedTypeOfExpression(node.operand, printedText);\n if ((goType === 'float64') || (goType === 'int64')) {\n return `-${printedText}`;\n }\n // a fractional/exponent literal is already a Go float64 constant; an integer\n // literal is only interchangeable where the consumer normalizes the number\n if (/^\\d+(\\.\\d+)?([eE][+-]?\\d+)?$/.test(printedText.trim())) {\n if (printedText.includes('.') || /[eE]/.test(printedText)) {\n return `-${printedText}`;\n }\n const parent = node.parent;\n if (parent?.kind === SyntaxKind.CallExpression) {\n const callee = this.printNode(parent.expression, 0);\n if (this.comparisonHelpers.indexOf(callee) >= 0) {\n return `-${printedText}`;\n }\n }\n // `a > -1` prints as IsGreaterThan(a, …); the relational wrappers all\n // normalise int/int64/float64 the same way the equality helpers do\n if (parent?.kind === SyntaxKind.BinaryExpression) {\n const op = parent.operatorToken.kind;\n if ((op === SyntaxKind.GreaterThanToken) || (op === SyntaxKind.GreaterThanEqualsToken)\n || (op === SyntaxKind.LessThanToken) || (op === SyntaxKind.LessThanEqualsToken)) {\n return `-${printedText}`;\n }\n }\n }\n return undefined;\n }\n\n // JS truthiness of an operand whose Go type the printer knows, expressed with\n // plain Go instead of boxing the value into `EvalTruthy(any)`. Each arm mirrors the\n // matching `EvalTruthy` case exactly, including nil (a nil *T and a nil map are\n // both falsy) — so this is the same predicate, minus the interface round-trip.\n printInlineTruthy(node): string | undefined {\n // every pointer/slice arm below repeats the operand, so only an identifier\n // qualifies; inlining a call would evaluate it twice\n if (node?.kind !== SyntaxKind.Identifier) {\n return undefined;\n }\n const goType = this.goDeclaredTypeOfIdentifier(node);\n if (goType === undefined) {\n return undefined;\n }\n const text = this.printNode(node, 0);\n switch (goType) {\n case 'bool':\n return text;\n case 'string':\n return `(${text} != \"\")`;\n case 'int':\n case 'int64':\n case 'float64':\n return `(${text} != 0)`;\n case '*bool':\n return `(${text} != nil && *${text})`;\n case '*string':\n return `(${text} != nil && *${text} != \"\")`;\n case '*int':\n case '*int64':\n case '*float64':\n return `(${text} != nil && *${text} != 0)`;\n case '[]string':\n case '[]any':\n case 'map[string]any':\n return `(len(${text}) > 0)`;\n }\n return undefined;\n }\n\n // an `any` box the checker proves can only hold a bool or nil — a `boolean`\n // local whose Go declaration stayed `any` (a later write the printer cannot\n // type, e.g. a tuple read) — is what `EvalTruthy` reduces to: nil and `false`\n printInlineBoolBoxTruthy(node): string | undefined {\n if (this.goScalarFamilyWithNil(node) !== 'bool') {\n return undefined;\n }\n let declaration;\n try {\n declaration = this.getChecker().getSymbolAtLocation(node)?.valueDeclaration?.resolve();\n } catch (e) {\n return undefined;\n }\n if (declaration?.kind !== SyntaxKind.VariableDeclaration && !this.goGetArgBoundParameter(node)) {\n return undefined; // a plain parameter keeps the caller's box untouched\n }\n const text = this.printNode(node, 0);\n if (!this.goIsAnyBoxExpression(node, text)) {\n return undefined;\n }\n return `(${text} == true)`;\n }\n\n // `EvalTruthy(this.SafeBool(…))`: the accessor's Go signature returns a `*bool`,\n // nil for an absent flag and the flag otherwise — exactly the two states\n // `derefScalar` hands the helper — so the predicate is `x != nil && *x`.\n printInlineBoolPointerTruthy(node, printedText: string): string | undefined {\n if (node?.kind !== SyntaxKind.CallExpression) {\n return undefined;\n }\n if (GO_PURE_BOOL_ACCESSORS.indexOf(this.goPrintedCallee(printedText) as string) < 0) {\n return undefined;\n }\n // the pointer is dereferenced twice, so every argument has to be a plain read\n if (!node.arguments.every((argument) => this.goIsRepeatSafePointerArgument(argument))) {\n return undefined;\n }\n return `(${printedText} != nil && *${printedText})`;\n }\n\n // an argument the two halves of a pointer deref may read twice: a plain\n // identifier/literal read, or a `this.` read of the exchange instance\n goIsRepeatSafePointerArgument(node): boolean {\n while (node?.kind === SyntaxKind.ParenthesizedExpression) {\n node = node.expression;\n }\n if (this.goIsReadOnlyCallArgument(node)) {\n return true;\n }\n return (node?.kind === SyntaxKind.PropertyAccessExpression)\n && (node.expression?.kind === SyntaxKind.ThisKeyword)\n && (node.name?.kind === SyntaxKind.Identifier);\n }\n\n // the native Go text for a condition operand the printer can type, or undefined\n // when the operand has to go through the truthiness helper. `(x)` is decided on\n // its operand and keeps the source parentheses, so the surrounding operator still\n // parses exactly the same way.\n goNativeCondition(node): string | undefined {\n if (node?.kind === SyntaxKind.Identifier) {\n return this.printInlineTruthy(node) ?? this.printInlineBoolBoxTruthy(node);\n }\n if (node?.kind === SyntaxKind.ParenthesizedExpression) {\n const inner = this.goNativeCondition(node.expression);\n if (inner === undefined) {\n return undefined;\n }\n return (inner.startsWith('(') && this.isWholePrintedCall(inner, 0)) ? inner : `(${inner})`;\n }\n // an expression that already prints a Go `bool` needs no EvalTruthy round-trip:\n // `a || b`, `!x`, `a === b` and the Is*/Precise.String* predicates are all\n // bool-typed, so `EvalTruthy()` is the identity function on them\n const printed = this.printNode(node, 0);\n const pointerTruthy = this.printInlineBoolPointerTruthy(node, printed);\n if (pointerTruthy !== undefined) {\n return pointerTruthy;\n }\n if (this.goTypeOfInitializer(node, printed) === 'bool') {\n return printed;\n }\n // a predicate the printer folds to a constant — IsArray on a proven slice or map —\n // prints a Go bool that the probe above cannot name\n if ((node?.kind === SyntaxKind.CallExpression) && ((printed === 'true') || (printed === 'false'))) {\n return printed;\n }\n if (GO_BOOL_FIELDS.has(printed)) {\n return printed;\n }\n // a hand-written bool-returning base method already prints a Go bool\n const callee = this.goPrintedCallee(printed);\n return (callee !== undefined && GO_BOOL_CALL_NAMES_NATIVE.indexOf(callee) >= 0) ? printed : undefined;\n }\n\n\n // gofmt prints the condition of every `if`/`for`/`switch` through\n // go/printer/nodes.go controlClause() -> stripParens(): the single outermost,\n // fully enclosing parentheses pair is dropped, and the rule applies again to the\n // enclosed expression while that one is parenthesized as well\n // (`if (x == 1) {` -> `if x == 1 {`, `if ((x == 1)) {` -> `if x == 1 {`).\n // Parentheses survive when the enclosed expression holds an unparenthesized\n // composite literal whose type is a type name, because `if T{} == x {` does not\n // parse. The printer emits text instead of an ast.Expr, so stripParens runs over\n // the printed condition text here.\n goControlClauseParens(node, expression: string): string {\n return this.goIsControlClauseCondition(node) ? this.goStripControlClauseParens(expression) : expression;\n }\n\n // the expression inside the outermost parentheses pair of `text`, or undefined\n // when `text` is not one fully enclosing pair or gofmt keeps that pair\n goEnclosedExpression(text: string): string | undefined {\n const trimmed = text.trim();\n if (!trimmed.startsWith('(') || !trimmed.endsWith(')')) {\n return undefined;\n }\n // `(a) && (b)` opens and closes with a parenthesis, but not the same pair\n if (this.goSkipBalanced(trimmed, 0, '(', ')') !== trimmed.length) {\n return undefined;\n }\n const inner = trimmed.substring(1, trimmed.length - 1).trim();\n if (this.goHasTypeNameCompositeLiteral(inner)) {\n return undefined; // stripParens keeps parentheses protecting a literal\n }\n return inner;\n }\n\n // the expression a Go `if`/`for`/`switch` statement tests, the only positions\n // gofmt's controlClause() rewrites\n goIsControlClauseCondition(node): boolean {\n const parent = node?.parent;\n switch (parent?.kind) {\n case SyntaxKind.IfStatement:\n case SyntaxKind.WhileStatement:\n case SyntaxKind.SwitchStatement:\n return parent.expression === node;\n case SyntaxKind.ForStatement:\n return parent.condition === node;\n }\n return false;\n }\n\n // stripParens' ast.Inspect stops at nested parentheses, which protect whatever\n // they enclose, and reports a composite literal whenever its type is a type name\n goHasTypeNameCompositeLiteral(text: string): boolean {\n let index = 0;\n while (index < text.length) {\n const char = text[index];\n if ((char === '\"') || (char === '`') || (char === '\\'')) {\n index = this.goSkipQuoted(text, index);\n continue;\n }\n if ((char === '(') || (char === '{')) {\n if ((char === '{') && this.goCompositeLitHasTypeName(text, index)) {\n return true;\n }\n const next = this.goSkipBalanced(text, index, char, (char === '(') ? ')' : '}');\n if (next < 0) {\n return false; // unbalanced text cannot be inspected any further\n }\n index = next;\n continue;\n }\n index += 1;\n }\n return false;\n }\n\n // `{` opens a composite literal whose type is a type name when the text in front\n // of it is an ident or a selector chain of idents; `map[string]any{` and `[]any{`\n // are type literals and do not count (isTypeName in go/printer/nodes.go)\n goCompositeLitHasTypeName(text: string, braceIndex: number): boolean {\n let start = braceIndex;\n while (start > 0 && /[A-Za-z0-9_.[\\]]/.test(text[start - 1])) {\n start -= 1;\n }\n const typeText = text.substring(start, braceIndex).trim();\n if (['map', 'struct', 'interface', 'func', 'chan'].indexOf(typeText) >= 0) {\n return false;\n }\n return /^[A-Za-z_]\\w*(\\.[A-Za-z_]\\w*)*$/.test(typeText);\n }\n\n // the index right after the bracket closing the one at `start`, or -1 when the\n // brackets are unbalanced (the printer sees statement fragments, not whole files)\n goSkipBalanced(text: string, start: number, open: string, close: string): number {\n let depth = 0;\n let index = start;\n while (index < text.length) {\n const char = text[index];\n if ((char === '\"') || (char === '`') || (char === '\\'')) {\n index = this.goSkipQuoted(text, index);\n continue;\n }\n if (char === open) {\n depth += 1;\n } else if (char === close) {\n depth -= 1;\n if (depth === 0) {\n return index + 1;\n }\n }\n index += 1;\n }\n return -1;\n }\n\n // the index right after the string, rune or raw string literal opening at `start`\n goSkipQuoted(text: string, start: number): number {\n const quote = text[start];\n let index = start + 1;\n while (index < text.length) {\n const char = text[index];\n if ((char === '\\\\') && (quote !== '`')) {\n index += 2;\n continue;\n }\n if (char === quote) {\n return index + 1;\n }\n index += 1;\n }\n return text.length;\n }\n\n // gofmt keeps a comment group that the source separates from the following\n // declaration by a blank line as a free-standing comment; joined to it, it becomes\n // the declaration's doc comment and its indented lines are re-laid out as a code\n // block. The blank line is preserved so the emitted text keeps the source's shape.\n printLeadingComments(node, identation) {\n const printed = super.printLeadingComments(node, identation);\n if (printed.length === 0) {\n return printed;\n }\n const fullText = this.getSrc().getFullText();\n const ranges = getLeadingCommentRanges(fullText, node.pos) ?? [];\n const last = ranges[ranges.length - 1];\n if (last === undefined) {\n return printed;\n }\n const gap = fullText.slice(last.end, node.getStart());\n const detached = (gap.match(/\\n/g) ?? []).length > 1;\n return detached ? printed + \"\\n\" : printed;\n }\n\n // level of the statement being printed: a multi-line composite literal is laid out\n // relative to it (go/printer), whatever level the expression printers hand down\n goStatementLevel = 0;\n\n // stdlib packages this file's native emissions call; printSourceFileStatements turns them\n // into the import declarations the emitted Go needs (an occurrence outside a file print,\n // e.g. the intellisense body, only marks a set that the next file print replaces)\n goFileStdlibImports = new Set();\n\n // gofmt separates a top-level declaration that carries a comment from the previous\n // declaration by a blank line (go/printer declList: min = 2 when the decl has a doc\n // comment); the file members are joined with a bare newline otherwise\n printSourceFileStatements(node, identation): string {\n const outerImports = this.goFileStdlibImports;\n const fileImports = new Set();\n this.goFileStdlibImports = fileImports;\n let body = '';\n try {\n const printed = node.statements.map((m) => this.printNode(m, identation + 1)).filter((st) => st.length > 0);\n body = printed.map((st, index) => (index > 0 && /^\\s*(\\/\\/|\\/\\*)/.test(st)) ? \"\\n\" + st : st).join(\"\\n\") + \"\\n\".repeat(this.NUM_LINES_END_FILE);\n } finally {\n this.goFileStdlibImports = outerImports;\n }\n if (fileImports.size === 0) {\n return body;\n }\n // a native emission needs its stdlib package, and an import declaration must precede\n // every other declaration: the file assembly puts this text right behind the generated\n // header, so the imports lead it (gofmt keeps an import clause before the first decl)\n return [...fileImports].sort().map((path) => `import \"${path}\"`).join(\"\\n\") + \"\\n\\n\" + body;\n }\n\n goBinaryMemoized(node, key: string, compute: () => T): T {\n const outermost = this.goBinaryMemo === undefined;\n const memo = this.goBinaryMemo ??= new Map();\n try {\n let byKey = memo.get(node);\n if (byKey?.has(key)) {\n const cached = byKey.get(key);\n return cached;\n }\n const value = compute();\n if (byKey === undefined) {\n memo.set(node, byKey = new Map());\n }\n byKey.set(key, value);\n return value;\n } finally {\n if (outermost) {\n this.goBinaryMemo = undefined;\n }\n }\n }\n\n // the printer state a binary print reads besides the node: depth, level and the recursion guards\n goBinaryContextKey(): string {\n return `${this.goExprDepth}|${this.goStatementLevel}|${this.goLocalTypeResolution.size}|${this.goDeclaredTypeInProgress.size}`;\n }\n\n goPrintBinaryMemoized(node, identation: number): string {\n const key = `print|${this.goBinaryContextKey()}|${identation}`;\n return this.goBinaryMemoized(node, key, () => this.goControlClauseParens(node, super.printNode(node, identation)));\n }\n\n printNode(node, identation = 0): string {\n if (node !== undefined && isSourceFile(node)) {\n this.className = \"undefined\";\n return this.printSourceFileStatements(node, identation);\n }\n if (node?.kind === SyntaxKind.BinaryExpression && GO_ARITHMETIC_KINDS.indexOf(node.operatorToken.kind) >= 0) {\n return this.goPrintBinaryMemoized(node, identation);\n }\n const isStatement = node !== undefined && isStatementNode(node) && node.kind !== SyntaxKind.Block;\n const previousLevel = this.goStatementLevel;\n if (isStatement) {\n this.goStatementLevel = identation;\n }\n try {\n const printed = super.printNode(node, identation);\n // the if/for/switch conditions go through here (printCondition resolves the\n // bool and the falsy/truthy paths before printing the node's text)\n return this.goControlClauseParens(node, printed);\n } finally {\n this.goStatementLevel = previousLevel;\n }\n }\n\n // composite literal body one level deeper than the statement, closing brace at the\n // statement's level; the leading indentation belongs to the enclosing printer\n printObjectLiteralExpression(node, identation) {\n const level = this.goStatementLevel;\n const objectBody = this.printObjectLiteralBody(node, level);\n const formattedObjectBody = objectBody ? \"\\n\" + objectBody + \"\\n\" + this.getIden(level) : objectBody;\n return this.OBJECT_OPENING + formattedObjectBody + this.OBJECT_CLOSING;\n }\n\n printCondition(node, identation) {\n // `!x` is handled by printPrefixUnaryExpression, which calls back into this\n // method with the operand; let the base class keep that recursion intact\n const native = this.goNativeCondition(node);\n if (native !== undefined) {\n // goNativeCondition prints the operand itself, so the control-clause\n // parens of printNode do not see the parentheses it wraps it in\n return `${this.getIden(identation)}${this.goControlClauseParens(node, native)}`;\n }\n // a native `key in obj` prints as a `func() bool` call, which the type probe\n // above cannot name; it is a Go bool all the same\n const inNode = (node?.kind === SyntaxKind.ParenthesizedExpression) ? node.expression : node;\n if (inNode?.kind === SyntaxKind.BinaryExpression && inNode.operatorToken.kind === SyntaxKind.InKeyword) {\n const inlined = this.printInlineInOp(inNode.right, inNode.left, this.printNode(inNode.right, 0), this.printNode(inNode.left, 0));\n if (inlined !== undefined) {\n const text = (inNode === node) ? inlined : `(${inlined})`;\n return `${this.getIden(identation)}${this.goControlClauseParens(node, text)}`;\n }\n }\n return super.printCondition(node, identation);\n }\n\n // === / !== inlined to plain Go operators when both sides are concrete Go\n // values or real pointers. Everything else — in particular anything that is\n // still `any` in Go — falls through to the existing IsEqual helper.\n // `(a == b || *a == *b)` is rejected: a nil *T panics on the second clause.\n // Go has no implicit numeric conversion: `*limit == length` does not compile\n // when limit is *int64 and length is int, even though TypeScript calls both\n // `number`. Dereferencing is therefore only safe against an untyped constant\n // (a literal, which adapts to the pointee) or an operand of the very same Go\n // type. Anything else — including any `any` operand — keeps IsEqual.\n goDerefComparableWith(ptrNode, ptrText: string, otherNode): boolean {\n const pointee = this.goPointerTypeOfExpression(ptrNode, ptrText)?.substring(1);\n if (pointee === undefined) {\n return false;\n }\n switch (otherNode?.kind) {\n case SyntaxKind.StringLiteral:\n case SyntaxKind.NoSubstitutionTemplateLiteral:\n return pointee === 'string';\n case SyntaxKind.NumericLiteral:\n return (pointee === 'int') || (pointee === 'int64') || (pointee === 'float64');\n case SyntaxKind.TrueKeyword:\n case SyntaxKind.FalseKeyword:\n return pointee === 'bool';\n }\n const otherType = this.goDeclaredTypeOfIdentifier(otherNode);\n return otherType === pointee;\n }\n\n // a node the printer prints as a Go string constant: both literal forms are\n // emitted with the printer's string quote token, so the comparison is a plain\n // Go string comparison\n goIsStringLiteralNode(node): boolean {\n return (node?.kind === SyntaxKind.StringLiteral) || (node?.kind === SyntaxKind.NoSubstitutionTemplateLiteral);\n }\n\n // the deref arms print their operand twice, so it must read the same value both times: an\n // identifier is a plain read, and a string accessor call whose arguments are all\n // identifiers/literals re-reads them (no statement runs between the two evaluations).\n goDerefRepeatableOperand(node, printedText: string): boolean {\n if (node?.kind === SyntaxKind.Identifier) {\n return true;\n }\n if (node?.kind !== SyntaxKind.CallExpression) {\n return false;\n }\n if (GO_PURE_STRING_ACCESSORS.indexOf(this.goPrintedCallee(printedText) as string) < 0) {\n return false;\n }\n return node.arguments.every((argument) => this.goIsReadOnlyCallArgument(argument));\n }\n\n // an argument whose evaluation is a plain read: a value the printer already\n // holds, never a call that could observe or cause a change\n goIsReadOnlyCallArgument(node): boolean {\n switch (this.goUnwrapParenthesizedNode(node)?.kind) {\n case SyntaxKind.Identifier:\n case SyntaxKind.StringLiteral:\n case SyntaxKind.NoSubstitutionTemplateLiteral:\n case SyntaxKind.NumericLiteral:\n case SyntaxKind.TrueKeyword:\n case SyntaxKind.FalseKeyword:\n case SyntaxKind.NullKeyword:\n return true;\n }\n return false;\n }\n\n // true when the Go value of this operand is a bare `string`: a local declared `string`, or a\n // parameter the signature printer emits as `string`. A Go string holds neither nil nor a pointer,\n // so `x == \"lit\"` is exactly IsEqual(x, \"lit\") — the pointer arms never see this type.\n goIsBareStringOperand(node): boolean {\n if (this.goDeclaredTypeOfIdentifier(node) === 'string') {\n return true;\n }\n if (node?.kind !== SyntaxKind.Identifier) {\n return false;\n }\n const checker: any = this.checkerOrUndefined();\n if (checker === undefined) {\n return false;\n }\n const symbol = checker.getSymbolAtLocation(node);\n const declaration = symbol?.valueDeclaration?.resolve();\n if (declaration?.kind !== SyntaxKind.Parameter) {\n return false;\n }\n return this.printParameterType(declaration) === 'string';\n }\n\n printInlineEquality(left, right, leftText: string, rightText: string, isEq: boolean): string | undefined {\n const lPtr = this.goPointerTypeOfExpression(left, leftText) !== undefined;\n const rPtr = this.goPointerTypeOfExpression(right, rightText) !== undefined;\n // the branches below that deref repeat the operand, so they may only be used\n // on an identifier or on one of the read-only string accessors (whose\n // arguments are plain reads); a call that does anything else stays IsEqual\n const lRepeatable = this.goDerefRepeatableOperand(left, leftText);\n const rRepeatable = this.goDerefRepeatableOperand(right, rightText);\n const lFam = this.goScalarFamily(left);\n const rFam = this.goScalarFamily(right);\n if (lFam === 'nil' && rPtr) {\n return isEq ? `(${rightText} == nil)` : `(${rightText} != nil)`;\n }\n if (rFam === 'nil' && lPtr) {\n return isEq ? `(${leftText} == nil)` : `(${leftText} != nil)`;\n }\n if (lPtr && rPtr) {\n const lPointee = this.goPointerTypeOfExpression(left, leftText);\n if (!lRepeatable || !rRepeatable\n || lPointee !== this.goPointerTypeOfExpression(right, rightText)) {\n return undefined; // IsEqual + derefScalar evaluates each side once\n }\n if (isEq) {\n return `(${leftText} == ${rightText} || (${leftText} != nil && ${rightText} != nil && *${leftText} == *${rightText}))`;\n }\n return `(${leftText} != ${rightText} && (${leftText} == nil || ${rightText} == nil || *${leftText} != *${rightText}))`;\n }\n if (lPtr && rFam !== undefined && rFam !== 'nil') {\n if (!lRepeatable || !this.goDerefComparableWith(left, leftText, right)) {\n return undefined;\n }\n return isEq\n ? `(${leftText} != nil && *${leftText} == ${rightText})`\n : `(${leftText} == nil || *${leftText} != ${rightText})`;\n }\n if (rPtr && lFam !== undefined && lFam !== 'nil') {\n if (!rRepeatable || !this.goDerefComparableWith(right, rightText, left)) {\n return undefined;\n }\n return isEq\n ? `(${rightText} != nil && *${rightText} == ${leftText})`\n : `(${rightText} == nil || *${rightText} != ${leftText})`;\n }\n // two definitely-present scalars of the same family: `==` is valid Go and\n // needs no helper. Nullable aliases (Str/Int/Num/Bool) are `any` in Go and\n // returned undefined by goScalarFamily, so they keep IsEqual.\n if (!lPtr && !rPtr && lFam !== undefined && rFam !== undefined\n && lFam !== 'nil' && rFam !== 'nil' && lFam === rFam) {\n return isEq ? `(${leftText} == ${rightText})` : `(${leftText} != ${rightText})`;\n }\n // both operands print as a concrete Go numeric kind (a declared int/int64/float64, or a\n // constant that fits the other side): IsEqual converts to that same kind, never sees nil\n const numericKind = (!lPtr && !rPtr) ? this.goNativeNumericEqualityKind(left, leftText, right, rightText) : undefined;\n if (numericKind !== undefined) {\n return isEq ? `(${leftText} == ${rightText})` : `(${leftText} != ${rightText})`;\n }\n // the declared-local table names `string` for this identifier (or the signature printer emits the\n // parameter as `string`): a `var x string` cannot hold a pointer or nil, so a string-literal\n // comparison equals the helper. A local ever written another type is reported `any` and boxed.\n if (!lPtr && !rPtr) {\n if ((this.goIsBareStringOperand(left) && this.goIsStringLiteralNode(right))\n || (this.goIsBareStringOperand(right) && this.goIsStringLiteralNode(left))) {\n return isEq ? `(${leftText} == ${rightText})` : `(${leftText} != ${rightText})`;\n }\n }\n // an operand the printer boxes into `any` whose TypeScript type proves the box\n // holds a scalar or nil: `x === undefined` and `x === 'lit'` are then the same\n // predicate as the helper, without the interface round-trip. Numbers stay on\n // IsEqual: an `any` box may hold int, int64 or float64, and Go compares those\n // by exact width.\n const lNilFam = this.goScalarFamilyWithNil(left);\n const rNilFam = this.goScalarFamilyWithNil(right);\n const lBox = !lPtr && this.goIsAnyBoxExpression(left, leftText);\n const rBox = !rPtr && this.goIsAnyBoxExpression(right, rightText);\n if (lBox && (rFam === 'nil') && (lNilFam !== undefined) && (lNilFam !== 'number')) {\n return isEq ? `(${leftText} == nil)` : `(${leftText} != nil)`;\n }\n if (rBox && (lFam === 'nil') && (rNilFam !== undefined) && (rNilFam !== 'number')) {\n return isEq ? `(${rightText} == nil)` : `(${rightText} != nil)`;\n }\n // a parameter whose TypeScript type is an array or object (`Strings`, `Market`, `NullableDict`,\n // `object[]`): the Go box holds a map/slice or an untyped nil, not a pointer — GetArg unwraps the\n // typed nil pointers the wrappers pass, so `x == nil` is exactly IsEqual(x, nil)\n const lObjParam = (lNilFam === undefined) && lBox && this.goObjectBoxParameter(left);\n const rObjParam = (rNilFam === undefined) && rBox && this.goObjectBoxParameter(right);\n if (lObjParam && (rFam === 'nil')) {\n return isEq ? `(${leftText} == nil)` : `(${leftText} != nil)`;\n }\n if (rObjParam && (lFam === 'nil')) {\n return isEq ? `(${rightText} == nil)` : `(${rightText} != nil)`;\n }\n // an `any` local the printer cannot type whose every write is a non-pointer\n // source (endpoint await / JSON decode / literal / nil): its box is never a\n // nil *T, so the interface test is the same predicate as the helper\n if (lBox && (rFam === 'nil') && this.goAnyLocalHoldsNonPointer(this.goAnyBoxLocalDeclaration(left))) {\n return isEq ? `(${leftText} == nil)` : `(${leftText} != nil)`;\n }\n if (rBox && (lFam === 'nil') && this.goAnyLocalHoldsNonPointer(this.goAnyBoxLocalDeclaration(right))) {\n return isEq ? `(${rightText} == nil)` : `(${rightText} != nil)`;\n }\n // a parameter with a TypeScript default is bound by `x := GetArg(optionalArgs, i, default)`, which\n // folds a typed nil pointer (and nil []string/[]any) into the untyped default: never a nil *T.\n // Nullable Int/Num aliases are excluded above only because exact-width comparison needs `number`.\n if ((lNilFam === 'number') && (rFam === 'nil') && this.goGetArgBoundParameter(left)) {\n return isEq ? `(${leftText} == nil)` : `(${leftText} != nil)`;\n }\n if ((rNilFam === 'number') && (lFam === 'nil') && this.goGetArgBoundParameter(right)) {\n return isEq ? `(${rightText} == nil)` : `(${rightText} != nil)`;\n }\n // a string or bool literal: only a value of that very type is equal in both\n // predicates, so no numeric or nil member can be compared away\n const isLiteral = (node): boolean => {\n switch (node?.kind) {\n case SyntaxKind.StringLiteral:\n case SyntaxKind.NoSubstitutionTemplateLiteral:\n case SyntaxKind.TrueKeyword:\n case SyntaxKind.FalseKeyword:\n return true;\n }\n return false;\n };\n const literalMatchesBox = (boxFam: string | undefined, litNode, litFam: string | undefined): boolean =>\n ((litFam === 'string') || (litFam === 'bool')) && isLiteral(litNode)\n && ((boxFam === litFam) || (boxFam === undefined));\n if ((lBox && literalMatchesBox(lNilFam, right, rFam)) || (rBox && literalMatchesBox(rNilFam, left, lFam))) {\n return isEq ? `(${leftText} == ${rightText})` : `(${leftText} != ${rightText})`;\n }\n // IsEqual(GetValue(market, \"spot\"), true): the checker proves the read holds\n // a bool or nil (Market.spot), and every other dynamic type is unequal to a\n // Go bool, nil included — the same predicate as the helper\n const isBoolLiteral = (node): boolean =>\n (node?.kind === SyntaxKind.TrueKeyword) || (node?.kind === SyntaxKind.FalseKeyword);\n if ((!lPtr && isBoolLiteral(right) && (this.goScalarFamilyWithNil(left) === 'bool') && this.goBoxedElementRead(left, leftText))\n || (!rPtr && isBoolLiteral(left) && (this.goScalarFamilyWithNil(right) === 'bool') && this.goBoxedElementRead(right, rightText))) {\n return isEq ? `(${leftText} == ${rightText})` : `(${leftText} != ${rightText})`;\n }\n // two boxes of one non-numeric family: both hold that scalar or nil\n if (lBox && rBox && (lNilFam !== undefined) && (lNilFam !== 'number') && (lNilFam === rNilFam)) {\n return isEq ? `(${leftText} == ${rightText})` : `(${leftText} != ${rightText})`;\n }\n return undefined;\n }\n\n // the kind a native `==` compares two numeric operands in; undefined keeps IsEqual. Two\n // constants are left to the helper (nothing to type), as is any mix Go would refuse.\n goNativeNumericEqualityKind(left, leftText: string, right, rightText: string): string | undefined {\n if (this.goIsNumericConstant(left) && this.goIsNumericConstant(right)) {\n return undefined;\n }\n const leftKind = this.goOperandNumericKind(left, leftText);\n const rightKind = this.goOperandNumericKind(right, rightText);\n if ((leftKind === undefined) || (rightKind === undefined)) {\n return undefined;\n }\n return this.goComparisonKind(left, leftKind, right, rightKind);\n }\n\n // the Go numeric kind an operand's static type is, or undefined when it stays\n // `any` (unknown helper result, union, pointer box): only a concrete kind can\n // join a comparison the Go compiler accepts\n goOperandNumericKind(node, printedText: string): string | undefined {\n if (node === undefined) {\n return undefined;\n }\n if (node.kind === SyntaxKind.Identifier) {\n const declared = this.goDeclaredTypeOfIdentifier(node);\n if (declared !== undefined) {\n return (GO_NUMERIC_KINDS.indexOf(declared) >= 0) ? declared : undefined;\n }\n return this.goLiteralTypedLocalKind(node);\n }\n if (this.goIsNumericConstant(node)) {\n return this.goNumericLiteralKind(node);\n }\n if (node.kind === SyntaxKind.ParenthesizedExpression) {\n return this.goOperandNumericKind(node.expression, this.printNode(node.expression, 0));\n }\n const goType = this.goTypeOfInitializer(node, printedText);\n return (goType !== undefined && GO_NUMERIC_KINDS.indexOf(goType) >= 0) ? goType : undefined;\n }\n\n // a local bound by `:=` takes its Go type from the initializer: an untyped\n // integer constant is `int`, a floating-point one is `float64`. A variable\n // statement prints `var x = …` instead, where the printer already\n // decided the type, so only the `:=` form may be trusted here.\n goLiteralTypedLocalKind(node): string | undefined {\n const checker: any = this.checkerOrUndefined();\n if (checker === undefined) {\n return undefined;\n }\n const symbol = checker.getSymbolAtLocation(node);\n const declaration = symbol?.valueDeclaration?.resolve();\n if (declaration?.kind !== SyntaxKind.VariableDeclaration || declaration.initializer === undefined) {\n return undefined;\n }\n const declarationList = declaration.parent;\n if (declarationList?.kind !== SyntaxKind.VariableDeclarationList\n || declarationList.parent?.kind === SyntaxKind.FirstStatement) {\n return undefined;\n }\n return this.goNumericLiteralKind(declaration.initializer);\n }\n\n // an untyped Go constant: the integer forms adopt any numeric kind, the\n // floating-point ones only fit float64. A signed literal is the same constant:\n // the printer writes `-1` as text, never through OpNeg's box.\n goNumericLiteralKind(node): string | undefined {\n if (this.goIsSignedNumericLiteral(node)) {\n return this.goNumericLiteralKind(node.operand);\n }\n const text = node?.text;\n if (text === undefined) {\n return undefined;\n }\n if (/^[0-9][0-9_]*$/.test(text) || /^0[xXoObB][0-9a-fA-F_]+$/.test(text)) {\n return 'int';\n }\n if (/^[0-9][.eE]/.test(text)) {\n return 'float64';\n }\n return undefined;\n }\n\n // `-1` / `+1.5` as written: a sign on a numeric literal, the only prefix-unary\n // shape that reaches a comparison as a constant rather than as OpNeg(...)\n goIsSignedNumericLiteral(node): boolean {\n if (node?.kind !== SyntaxKind.PrefixUnaryExpression) {\n return false;\n }\n if ((node.operator !== SyntaxKind.MinusToken) && (node.operator !== SyntaxKind.PlusToken)) {\n return false;\n }\n return node.operand?.kind === SyntaxKind.NumericLiteral;\n }\n\n // a numeric constant operand: an integer/float literal, with an optional sign\n goIsNumericConstant(node): boolean {\n return (node?.kind === SyntaxKind.NumericLiteral) || this.goIsSignedNumericLiteral(node);\n }\n\n // the constant's value with its sign; NaN for anything but a numeric constant\n goNumericConstantValue(node): number {\n if (this.goIsSignedNumericLiteral(node)) {\n const value = Number(node.operand.text.replaceAll('_', ''));\n return (node.operator === SyntaxKind.MinusToken) ? -value : value;\n }\n if (node?.kind !== SyntaxKind.NumericLiteral) {\n return Number.NaN;\n }\n return Number(node.text.replaceAll('_', ''));\n }\n\n // a constant only joins a comparison when its value is representable in the\n // other operand's kind: `0.5` is not an int, and neither is 1e400 (infinity)\n goLiteralFitsKind(node, kind: string): boolean {\n const value = this.goNumericConstantValue(node);\n if (!Number.isFinite(value)) {\n return false;\n }\n if (kind === 'float64') {\n return true;\n }\n return Number.isInteger(value) && (Math.abs(value) <= 2147483647);\n }\n\n // the kind both operands are compared in, or undefined when Go would need a\n // conversion (two different concrete kinds) or the constant does not fit\n goComparisonKind(left, leftKind: string, right, rightKind: string): string | undefined {\n if (leftKind === rightKind) {\n return leftKind;\n }\n if (this.goIsNumericConstant(left) && !this.goIsNumericConstant(right)) {\n return this.goLiteralFitsKind(left, rightKind) ? rightKind : undefined;\n }\n if (this.goIsNumericConstant(right) && !this.goIsNumericConstant(left)) {\n return this.goLiteralFitsKind(right, leftKind) ? leftKind : undefined;\n }\n return undefined;\n }\n\n // `<` `>` `<=` `>=` between two operands the checker proves to be numbers of the\n // same Go kind is exactly the comparison the helper performs, minus the interface\n // round-trip, so the call carries no information. A `*int64` / `*float64` operand\n // joins them with its deref written out, and the helper's nil predicate with it.\n // Everything else — `any` boxes, mixed kinds, strings — keeps the helper. float64\n // keeps IsLessThan/IsLessThanOrEqual: the helper answers true whenever an operand\n // is NaN while Go (and JS) answer false, and only those two operators differ.\n printInlineOrderedComparison(left, right, leftText: string, rightText: string, op): string | undefined {\n const operator = ORDERED_COMPARISON_OPERATORS[op];\n if (operator === undefined) {\n return undefined;\n }\n const leftPointee = this.goOrderedComparisonPointerKind(left);\n const rightPointee = this.goOrderedComparisonPointerKind(right);\n if ((leftPointee !== undefined) || (rightPointee !== undefined)) {\n return this.printPointerOrderedComparison(left, right, leftText, rightText, operator, leftPointee, rightPointee);\n }\n const leftKind = this.goOperandNumericKind(left, leftText);\n const rightKind = this.goOperandNumericKind(right, rightText);\n if ((leftKind === undefined) || (rightKind === undefined)) {\n return undefined;\n }\n // both operands may additionally be checker-typed numbers; that check is\n // implied by the concrete Go kind above and buys nothing\n const kind = this.goComparisonKind(left, leftKind, right, rightKind);\n if (kind === undefined) {\n return undefined;\n }\n if ((kind === 'float64') && ((operator === '<') || (operator === '<='))) {\n return undefined;\n }\n return `(${leftText} ${operator} ${rightText})`;\n }\n\n // the pointee kind of a `*int64` / `*float64` **identifier** operand. Only a local\n // the printer itself declared as that pointer qualifies: a call would be repeated by\n // the nil test, and an `any` box holds a value the printer cannot name.\n goOrderedComparisonPointerKind(node): string | undefined {\n if (node?.kind !== SyntaxKind.Identifier) {\n return undefined;\n }\n const declared = this.goDeclaredTypeOfIdentifier(node);\n if ((declared !== '*int64') && (declared !== '*float64')) {\n return undefined;\n }\n return declared.substring(1);\n }\n\n // an ordered comparison with a `*int64` / `*float64` operand on at least one side. The helper\n // derefs both sides and answers its own predicate when one is nil, so the native form spells that\n // out; an enclosing `x !== undefined` guard (printed as `x != nil`) removes it for that side.\n printPointerOrderedComparison(left, right, leftText: string, rightText: string, operator: string, leftPointee: string | undefined, rightPointee: string | undefined): string | undefined {\n const leftKind = (leftPointee === undefined) ? this.goOperandNumericKind(left, leftText) : leftPointee;\n const rightKind = (rightPointee === undefined) ? this.goOperandNumericKind(right, rightText) : rightPointee;\n if ((leftKind === undefined) || (rightKind === undefined)) {\n return undefined;\n }\n const kind = this.goComparisonKind(left, leftKind, right, rightKind);\n if (kind === undefined) {\n return undefined;\n }\n // NaN is a float64 to the helper too: `<` / `<=` answer true for it while Go\n // answers false, so those two operators keep the call exactly as phase-1 does\n if ((kind === 'float64') && ((operator === '<') || (operator === '<='))) {\n return undefined;\n }\n const leftNil = (leftPointee !== undefined) && !this.goHasEnclosingNilGuard(left);\n const rightNil = (rightPointee !== undefined) && !this.goHasEnclosingNilGuard(right);\n // a nil test short-circuits the operand on the other side, so that side has to\n // be free of calls for the helper's single evaluation to stay unobservable\n if (leftNil && (rightPointee === undefined) && !this.goIsPureComparisonOperand(right)) {\n return undefined;\n }\n if (rightNil && (leftPointee === undefined) && !this.goIsPureComparisonOperand(left)) {\n return undefined;\n }\n const lv = (leftPointee === undefined) ? leftText : `*${leftText}`;\n const rv = (rightPointee === undefined) ? rightText : `*${rightText}`;\n if (!leftNil && !rightNil) {\n return `(${lv} ${operator} ${rv})`;\n }\n // every arm below answers what the helper answers when a side is nil:\n // `a != nil && b == nil` for `>`/`>=`, `a == nil && b != nil` for `<`/`<=`\n const greater = (operator === '>') || (operator === '>=');\n if (leftNil && !rightNil) {\n return greater ? `(${leftText} != nil && ${lv} ${operator} ${rv})` : `(${leftText} == nil || ${lv} ${operator} ${rv})`;\n }\n if (!leftNil && rightNil) {\n return greater ? `(${rightText} == nil || ${lv} ${operator} ${rv})` : `(${rightText} != nil && ${lv} ${operator} ${rv})`;\n }\n if (operator === '>') {\n return `(${leftText} != nil && (${rightText} == nil || ${lv} > ${rv}))`;\n }\n if (operator === '>=') {\n return `(${rightText} == nil || (${leftText} != nil && ${lv} >= ${rv}))`;\n }\n if (operator === '<') {\n return `(${rightText} != nil && (${leftText} == nil || ${lv} < ${rv}))`;\n }\n return `(${leftText} == nil || (${rightText} != nil && ${lv} <= ${rv}))`;\n }\n\n // `x !== undefined` / `x != null` on that identifier: the printer writes the Go\n // `x != nil` test for it, so an enclosing one proves the pointer present\n goIsNonNilTestOf(node, ident): boolean {\n if (node?.kind !== SyntaxKind.BinaryExpression) {\n return false;\n }\n const op = node.operatorToken?.kind;\n if ((op !== SyntaxKind.ExclamationEqualsToken) && (op !== SyntaxKind.ExclamationEqualsEqualsToken)) {\n return false;\n }\n return (this.goIsSameSymbol(node.left, ident) && this.goIsNilLiteral(node.right))\n || (this.goIsSameSymbol(node.right, ident) && this.goIsNilLiteral(node.left));\n }\n\n // a null/undefined literal, or any expression the checker types as one\n goIsNilLiteral(node): boolean {\n if ((node?.kind === SyntaxKind.NullKeyword) || (node?.kind === SyntaxKind.UndefinedKeyword)) {\n return true;\n }\n return (node?.kind === SyntaxKind.Identifier) && (this.goScalarFamily(node) === 'nil');\n }\n\n goIsSameSymbol(a, b): boolean {\n if ((a?.kind !== SyntaxKind.Identifier) || (b?.kind !== SyntaxKind.Identifier)) {\n return false;\n }\n try {\n const checker = this.getChecker();\n const leftSymbol = checker.getSymbolAtLocation(a);\n return (leftSymbol !== undefined) && (leftSymbol === checker.getSymbolAtLocation(b));\n } catch (e) {\n return false;\n }\n }\n\n // [guarded child, guarding condition] fields of the constructs a nil guard dominates\n goNilGuardFields: { [kind: number]: [string, string] } = {\n [SyntaxKind.IfStatement]: ['thenStatement', 'expression'],\n [SyntaxKind.WhileStatement]: ['statement', 'expression'],\n [SyntaxKind.ForStatement]: ['statement', 'condition'],\n [SyntaxKind.ConditionalExpression]: ['whenTrue', 'condition'],\n };\n\n // true when the enclosing control flow already proves the identifier non-nil at this node: an\n // earlier conjunct of an `&&` chain, or the condition of a wrapping if/loop/ternary containing the\n // node. A local rebound anywhere in its function never counts — the guard may be dead by then.\n goHasEnclosingNilGuard(ident): boolean {\n const checker: any = this.checkerOrUndefined();\n if (checker === undefined) {\n return false;\n }\n const declaration = checker.getSymbolAtLocation(ident)?.valueDeclaration?.resolve();\n if (this.goLocalIsRebound(this.goEnclosingFunction(declaration ?? ident), ident)) {\n return false;\n }\n let child = ident;\n let parent = ident?.parent;\n while (parent !== undefined) {\n const kind = parent.kind;\n if ((kind === SyntaxKind.ParenthesizedExpression) || (kind === SyntaxKind.VariableStatement)\n || (kind === SyntaxKind.ExpressionStatement) || (kind === SyntaxKind.Block)\n || (kind === SyntaxKind.ReturnStatement) || (kind === SyntaxKind.ElementAccessExpression)\n || (kind === SyntaxKind.CallExpression) || (kind === SyntaxKind.PropertyAccessExpression)\n || (kind === SyntaxKind.ObjectLiteralExpression) || (kind === SyntaxKind.PropertyAssignment)\n || (kind === SyntaxKind.ArrayLiteralExpression) || (kind === SyntaxKind.AwaitExpression)\n || (kind === SyntaxKind.CaseClause) || (kind === SyntaxKind.SwitchStatement)\n || (kind === SyntaxKind.DoStatement) || (kind === SyntaxKind.LabeledStatement)) {\n // the guard still dominates everything below such a wrapper\n child = parent;\n parent = parent.parent;\n continue;\n }\n if (kind === SyntaxKind.BinaryExpression) {\n const op = parent.operatorToken?.kind;\n if ((op === SyntaxKind.AmpersandAmpersandToken) && (child === parent.right)\n && this.goConditionProvesNonNil(parent.left, ident)) {\n return true;\n }\n // `a || b` and a left conjunct are evaluated before the guard, so they\n // prove nothing; the guard of an enclosing construct still applies\n child = parent;\n parent = parent.parent;\n continue;\n }\n const guard = this.goNilGuardFields[kind];\n if (guard !== undefined) {\n if ((child === parent[guard[0]]) && this.goConditionProvesNonNil(parent[guard[1]], ident)) {\n return true;\n }\n child = parent;\n parent = parent.parent;\n continue;\n }\n // functions, classes and everything else the scan does not model: the\n // guard cannot be carried across\n return false;\n }\n return false;\n }\n\n // the whole condition, or any conjunct of its `&&` chain, is the non-nil test\n goConditionProvesNonNil(condition, ident): boolean {\n const inner = this.goUnwrapParenthesizedNode(condition);\n if (inner === undefined) {\n return false;\n }\n if (this.goIsNonNilTestOf(inner, ident)) {\n return true;\n }\n if ((inner.kind !== SyntaxKind.BinaryExpression) || (inner.operatorToken?.kind !== SyntaxKind.AmpersandAmpersandToken)) {\n return false;\n }\n return this.goConditionProvesNonNil(inner.left, ident) || this.goConditionProvesNonNil(inner.right, ident);\n }\n\n goUnwrapParenthesizedNode(node) {\n let current = node;\n while (current?.kind === SyntaxKind.ParenthesizedExpression) {\n current = current.expression;\n }\n return current;\n }\n\n // an operand a short-circuit may skip without any observable difference: no calls,\n // no assignments, nothing the helper would have evaluated exactly once\n goIsPureComparisonOperand(node): boolean {\n switch (node?.kind) {\n case SyntaxKind.Identifier:\n case SyntaxKind.NumericLiteral:\n case SyntaxKind.StringLiteral:\n case SyntaxKind.NoSubstitutionTemplateLiteral:\n case SyntaxKind.PropertyAccessExpression:\n return true;\n case SyntaxKind.PrefixUnaryExpression:\n return (node.operator === SyntaxKind.MinusToken) && this.goIsPureComparisonOperand(node.operand);\n case SyntaxKind.ParenthesizedExpression:\n return this.goIsPureComparisonOperand(node.expression);\n }\n return false;\n }\n\n // Go's printer never wraps an already parenthesised expression: gofmt prints a\n // ParenExpr whose child is itself a ParenExpr without its own parentheses\n // (`((x))` prints as `(x)`), because the text it is handed is re-parsed that way.\n // Our output is re-parsed exactly like that, so a source parenthesis around an\n // expression that already prints parenthesised -- an inlined comparison, a nested\n // parenthesised expression, an EvalTruthy(...) arm -- must emit the single pair\n // gofmt keeps instead of doubling it.\n printParenthesizedExpression(node, identation) {\n const expression = node.expression;\n if (expression?.kind === SyntaxKind.AsExpression) {\n // transform (this as any) into this, () and as any are not necessary\n return this.getIden(identation) + this.printNode(expression, 0);\n }\n if (expression?.kind === SyntaxKind.ArrowFunction) {\n // ignore arrowFunctions inside parenthesis\n return \"\";\n }\n // parentheses undo one level of depth (go/printer reduceDepth())\n const printed = this.goWithExprDepth(this.goExprDepth - 1, () => this.printNode(expression, 0));\n if (this.goIsParenthesizedExpression(printed)) {\n return this.getIden(identation) + printed;\n }\n return this.getIden(identation) + this.LEFT_PARENTHESIS + printed + this.RIGHT_PARENTHESIS;\n }\n\n // true when the printed text is exactly one parenthesised expression: its first\n // `(` closes on the last non-space character. Literals and comments are skipped\n // so a parenthesis inside them cannot unbalance the scan.\n goIsParenthesizedExpression(printed: string): boolean {\n const text = printed.trimStart();\n if (text[0] !== '(') {\n return false;\n }\n let depth = 0;\n for (let i = 0; i < text.length; i++) {\n const c = text[i];\n if ((c === '/') && (text[i + 1] === '/')) {\n // a trailing line comment belongs to the statement, not to the expression\n return false;\n }\n if ((c === '/') && (text[i + 1] === '*')) {\n const end = text.indexOf('*/', i + 2);\n if (end < 0) {\n return false;\n }\n i = end + 1;\n continue;\n }\n if ((c === '\"') || (c === '\\'') || (c === '`')) {\n i = this.goSkipGoLiteral(text, i);\n if (i < 0) {\n return false;\n }\n continue;\n }\n if (c === '(') {\n depth += 1;\n } else if (c === ')') {\n depth -= 1;\n if (depth === 0) {\n return text.substring(i + 1).trim().length === 0;\n }\n }\n }\n return false;\n }\n\n // index of the quote closing the Go string/rune literal that starts at `start`, -1 when unterminated\n goSkipGoLiteral(text: string, start: number): number {\n const quote = text[start];\n for (let i = start + 1; i < text.length; i++) {\n const c = text[i];\n if (c === '\\\\') {\n i += 1;\n continue;\n }\n if (c === quote) {\n return i;\n }\n }\n return -1;\n }\n\n // castVariableAssignmentIfNeeded(left, right, identation) {\n // const leftType = this.getChecker().getTypeAtLocation(left);\n // const rightType = this.getChecker().getTypeAtLocation(right);\n\n // const leftText = this.printNode(left, 0);\n // const rightText = this.printNode(right, 0);\n\n // if (this.isAnyType(rightType.flags) && !this.isAnyType(leftType.flags)) {\n // const parsedType = this.getTypeFromRawType(leftType);\n // return `${this.getIden(identation)}${leftText} = (${parsedType})${rightText}`;\n // }\n // return undefined;\n // }\n\n transformPropertyAcessExpressionIfNeeded(node) {\n const expression = node.expression;\n const leftSide = this.printNode(expression, 0);\n const rightSide = node.name.text;\n\n let rawExpression = undefined;\n\n switch(rightSide) {\n case 'length':\n const type = (this.getChecker() as Checker).getTypeAtLocation(expression); // eslint-disable-line\n // this.warnIfAnyType(node, type.flags, leftSide, \"length\");\n // rawExpression = this.isStringType(type.flags) ? `(string${leftSide}).Length` : `(${leftSide}.Cast().ToList()).Count`;\n rawExpression = this.printInlineArrayLength(expression, leftSide, node) ?? this.goHx4G06DerefLength(expression, leftSide, node) ?? (this.isStringType(type.flags) ? `GetLength(${leftSide})` : `${this.ARRAY_LENGTH_WRAPPER_OPEN}${leftSide}${this.ARRAY_LENGTH_WRAPPER_CLOSE}`); // `(${leftSide}.Cast()).ToList().Count`\n break;\n case 'push':\n rawExpression = `((IList)${leftSide}).Add`;\n break;\n // case 'push':\n // rawExpression = `(List${leftSide}).Add`s\n // break;\n }\n return rawExpression;\n }\n\n // The Go type of a GetArg-bound optional local (from the printed default, or the declared type\n // for a nil default), or undefined to keep `any`; the retype needs goLocalIsSafeToType,\n // goParameterKeepsNilCompareNative and goGetArgConsumersAreSafe to agree.\n goGetArgLocalType(body, param, printedDefault: string): string | undefined {\n const method: any = param?.parent;\n const excluded = GO_GETARG_EXCLUDED_POSITIONS[method?.name?.text];\n if ((excluded !== undefined) && excluded.includes(method.parameters.indexOf(param))) {\n return undefined;\n }\n // an explicit `any` annotation admits values of other shapes than the default (api lists),\n // unless it only restates an override of a base parameter the base leaves unannotated\n if ((param?.type?.kind === SyntaxKind.AnyKeyword) && !this.goGetArgBaseParamIsUnannotated(param)) {\n return undefined;\n }\n const shape = (printedDefault ?? '').trim();\n const byDefault = this.goGetArgTypeOfShape(shape);\n if (byDefault !== undefined) {\n // a declared type naming no single Go type (IndexType = number | string) admits other shapes;\n // an admitted `any` restatement binds by its default, as the base does\n if ((param?.type !== undefined) && (param.type.kind !== SyntaxKind.AnyKeyword)\n && !this.goGetArgDeclaredTypeCandidates(param).some((t) => t.replace(/^\\*/, '') === byDefault)) {\n return undefined;\n }\n return this.goGetArgLocalIsSafe(body, param, byDefault) ? byDefault : undefined;\n }\n if ((shape !== 'nil') && (shape !== 'undefined')) {\n return undefined;\n }\n for (const goType of this.goGetArgDeclaredTypeCandidates(param)) {\n if (this.goGetArgLocalIsSafe(body, param, goType, true)) {\n return goType;\n }\n }\n return undefined;\n }\n\n // true when the method overrides a base method whose parameter at the same position has no\n // type annotation and a default of the same syntax kind (the base binds it through its twin)\n goGetArgBaseParamIsUnannotated(param): boolean {\n const method: any = param?.parent;\n const name = method?.name?.text;\n const index = method?.parameters?.indexOf(param) ?? -1;\n const cls: any = method?.parent;\n const checker: any = this.checkerOrUndefined();\n if ((name === undefined) || (index < 0) || (checker === undefined) || (param.initializer === undefined)) {\n return false;\n }\n for (const clause of (cls?.heritageClauses ?? [])) {\n if (clause.token !== SyntaxKind.ExtendsKeyword) {\n continue;\n }\n for (const expr of (clause.types ?? [])) {\n const baseDecl: any = checker.getTypeAtLocation(expr)?.getProperty?.(name)?.valueDeclaration?.resolve();\n const baseParam: any = baseDecl?.parameters?.[index];\n if (baseParam === undefined) {\n return false;\n }\n return (baseParam.type === undefined) && (baseParam.initializer !== undefined)\n && (baseParam.initializer.kind === param.initializer.kind);\n }\n }\n return false;\n }\n\n // a use of a nil-defaulted map local that only reads it: an element read, `k in x`, or the\n // receiver of a helper that treats a nil map like an absent value (no IsDictionary/IsEqual)\n goGetArgNilMapUseOnlyReads(n): boolean {\n const parent: any = n.parent;\n if ((parent?.kind === SyntaxKind.ElementAccessExpression) || (parent?.kind === SyntaxKind.BinaryExpression)) {\n return this.goSafeDictUseReadsTheMap(n);\n }\n if ((parent?.kind !== SyntaxKind.CallExpression) || (parent.arguments.indexOf(n) !== 0)) {\n return false;\n }\n const callee = this.goPrintedCallee(this.printNode(parent, 0));\n return (callee !== undefined) && (GO_GETARG_NIL_MAP_READERS.indexOf(callee.replace(/^this\\./, '')) >= 0);\n }\n\n // a nil []string reads like the absent box: `x.length` / GetArrayLength is 0, `x[i]` (GetValue)\n // is nil, InArray finds nothing, and a defaulted Strings position's GetArg folds it to its default\n goGetArgNilStringSliceUseOnlyReads(n): boolean {\n const parent: any = n.parent;\n if ((parent?.kind === SyntaxKind.PropertyAccessExpression) && (parent.expression === n)) {\n return (parent.name?.text === 'length') && (parent.parent?.kind !== SyntaxKind.CallExpression || parent.parent.expression !== parent)\n && !((parent.parent?.kind === SyntaxKind.BinaryExpression) && (parent.parent.left === parent));\n }\n if (parent?.kind === SyntaxKind.ElementAccessExpression) {\n return this.goSafeDictUseReadsTheMap(n);\n }\n if ((parent?.kind !== SyntaxKind.CallExpression) || (parent.expression === n)) {\n return false;\n }\n const argIndex = parent.arguments.indexOf(n);\n const callee: any = parent.expression;\n if ((callee?.kind === SyntaxKind.PropertyAccessExpression) && (callee.expression?.kind === SyntaxKind.ThisKeyword)\n && (callee.name?.text === 'inArray') && (argIndex === 1)) {\n return true;\n }\n if (!this.goGetArgPositionIsDefaulted(callee, argIndex)) {\n return false;\n }\n let decl: any;\n try {\n decl = this.getChecker().getSymbolAtLocation(callee)?.valueDeclaration?.resolve();\n } catch (e) {\n decl = undefined;\n }\n // the callee binds it as `any` or through GetArgStringSlice, never a []any twin\n const declared = String(decl?.parameters?.[argIndex]?.type?.getText() ?? '').replace(/\\s+/g, ' ');\n return (declared === 'Strings') || (declared === 'string[]');\n }\n\n // the Go type the printed default names, or undefined when it names none\n goGetArgTypeOfShape(shape: string): string | undefined {\n const shapes: [RegExp, string][] = [[/^map\\[string\\]any\\{/, 'map[string]any'], [/^\\[map\\[string\\]any\\]\\{/, '[]map[string]any'],\n [/^\\[\\]string\\{/, '[]string'], [/^\\[\\]any\\{/, '[]any'], [/^\"/, 'string'], [/^(?:true|false)$/, 'bool'], [/^(?:-?[0-9]|math\\.)/, 'int64']];\n return shapes.find(([re]) => re.test(shape))?.[1];\n }\n\n // Go type candidates for a nil-defaulted parameter, in try order: the annotation text\n // (`Int` vs `Num` exist only there), then goNativeParameterTypeCandidates.\n goGetArgDeclaredTypeCandidates(param): string[] {\n const out: string[] = [];\n const declared = (param?.type !== undefined) ? String(param.type.getText()).replace(/\\s+/g, ' ') : undefined;\n const alias: any = this.CCXT_GO_GETARG_DECLARED_TYPES ?? {};\n if ((declared !== undefined) && (alias[declared] !== undefined)) {\n out.push(alias[declared]);\n } else if ((declared !== undefined) && this.goGetArgPrimitiveType(declared) !== undefined) {\n out.push('*' + this.goGetArgPrimitiveType(declared));\n }\n for (const goType of this.goNativeParameterTypeCandidates(param)) {\n if (out.indexOf(goType) < 0) {\n out.push(goType);\n }\n }\n return out;\n }\n\n goGetArgPrimitiveType(declared: string): string | undefined {\n switch (declared) {\n case 'Int': case 'Integer': case 'int': return 'int64';\n case 'Num': case 'number': case 'Float': return 'float64';\n case 'Bool': case 'boolean': return 'bool';\n case 'Str': case 'string': case 'String': return 'string';\n }\n return undefined;\n }\n\n // the twin of a declared Go type (go/v4/exchange_helpers.go); undefined when the twin is\n // missing, in which case the parameter keeps the `any` box (an `any` return must never be\n // assigned to a typed local)\n goGetArgTwinName(goType: string): string | undefined {\n switch (goType) {\n case 'map[string]any': return 'GetArgMap';\n case '[]map[string]any': return 'GetArgMapSlice';\n case '[]string': return 'GetArgStringSlice';\n case '[]any': return 'GetArgAnySlice';\n case 'string': return 'GetArgString';\n case 'bool': return 'GetArgBool';\n case 'int64': return 'GetArgInt64';\n case 'float64': return 'GetArgFloat64';\n case '*string': return 'GetArgStringPtr';\n case '*int64': return 'GetArgInt64Ptr';\n case '*float64': return 'GetArgFloat64Ptr';\n case '*bool': return 'GetArgBoolPtr';\n }\n return undefined;\n }\n\n goGetArgIsValueType(goType: string): boolean {\n return (goType === 'string') || (goType === 'bool') || (goType === 'int64') || (goType === 'float64');\n }\n\n goGetArgLocalIsSafe(body, param, goType: string, nilable = false): boolean {\n const name = param.name.text;\n if (this.goGetArgTwinName(goType) === undefined) {\n return false; // no twin for this type: keep the `any` box\n }\n if (!this.goLocalIsSafeToType(body, param, name, goType)) {\n return false;\n }\n if (this.goGetArgIsValueType(goType)) {\n // `x == nil` does not compile for a Go string/bool/int64/float64: keep the box\n return this.goParameterKeepsNilCompareNative(body, param, goType);\n }\n return this.goGetArgConsumersAreSafe(body, param, goType, nilable);\n }\n\n // Every later use must read the typed local as it read the `any` box: pointers only reach\n // audited deref consumers (fail-closed); containers are the same map/list, and nil-sensitive\n // consumers are tabled as `container` (goGetArgPassesIntoContainerDefault covers call chains).\n goGetArgConsumersAreSafe(body, param, goType: string, nilable: boolean): boolean {\n return this.goGetArgUsesAreSafe(body, param, param.name.text, goType, nilable, new Set());\n }\n\n // `(x === undefined) ? d : x` / `x !== undefined ? x : d`: the arm holding `n` only runs when\n // the same name is not nil, so the copy never boxes a typed nil\n goGetArgArmIsNilGuarded(n: any, cond: any): boolean {\n let test: any = cond.condition;\n while (test?.kind === SyntaxKind.ParenthesizedExpression) {\n test = test.expression;\n }\n if ((test?.kind !== SyntaxKind.BinaryExpression)) {\n return false;\n }\n const isNil = (e: any) => (e?.kind === SyntaxKind.NullKeyword) || ((e?.kind === SyntaxKind.Identifier) && (e.text === 'undefined'));\n const sameName = (e: any) => (e?.kind === SyntaxKind.Identifier) && (e.text === n.text);\n if (!((sameName(test.left) && isNil(test.right)) || (sameName(test.right) && isNil(test.left)))) {\n return false;\n }\n const op = test.operatorToken?.kind;\n const eq = (op === SyntaxKind.EqualsEqualsEqualsToken) || (op === SyntaxKind.EqualsEqualsToken);\n const ne = (op === SyntaxKind.ExclamationEqualsEqualsToken) || (op === SyntaxKind.ExclamationEqualsToken);\n let arm: any = n;\n while (arm.parent !== cond) {\n arm = arm.parent;\n }\n return (eq && (arm === cond.whenFalse)) || (ne && (arm === cond.whenTrue));\n }\n\n // a native int64/float64 arithmetic result boxes the same number its Add/Subtract/... helper form\n // boxed, so it reads like that helper write rather than a value-family write\n goGetArgWriteIsNativeArithmetic(rhs: any): boolean {\n let e: any = rhs;\n while (e?.kind === SyntaxKind.ParenthesizedExpression) {\n e = e.expression;\n }\n const ops = [SyntaxKind.PlusToken, SyntaxKind.MinusToken, SyntaxKind.AsteriskToken, SyntaxKind.SlashToken, SyntaxKind.PercentToken];\n if ((e?.kind !== SyntaxKind.BinaryExpression) || !ops.includes(e.operatorToken?.kind)) {\n return false;\n }\n const goType = this.goNativeArithmeticType(e) ?? this.goConstantProductKind(e);\n return (goType === 'int64') || (goType === 'float64');\n }\n\n // the body-local `r` a copy `let r = x` / `r = x` lands in (the value, not the box, is copied)\n goGetArgCopyTarget(use: any, body: any): any {\n const parent: any = use.parent;\n let target: any;\n if ((parent?.kind === SyntaxKind.VariableDeclaration) && (parent.initializer === use)) {\n target = parent;\n } else if ((parent?.kind === SyntaxKind.BinaryExpression) && (parent.right === use)\n && (parent.operatorToken?.kind === SyntaxKind.EqualsToken) && (parent.left?.kind === SyntaxKind.Identifier)\n && (parent.parent?.kind === SyntaxKind.ExpressionStatement)) {\n try {\n target = this.getChecker().getSymbolAtLocation(parent.left)?.valueDeclaration?.resolve();\n } catch (e) {\n target = undefined;\n }\n }\n if ((target?.kind !== SyntaxKind.VariableDeclaration) || (target.name?.kind !== SyntaxKind.Identifier)) {\n return undefined;\n }\n let inBody = false;\n for (let p: any = target.parent; p !== undefined; p = p.parent) {\n inBody = inBody || (p === body);\n }\n // a value-typed write (`r = \"s\"`) may type the copy as the pointer's value family\n let valueWrite = false;\n const visit = (n: any): void => {\n if (valueWrite) {\n return;\n }\n if ((n.kind === SyntaxKind.BinaryExpression) && (n.operatorToken?.kind === SyntaxKind.EqualsToken)\n && (n.left?.kind === SyntaxKind.Identifier) && (n.left.text === target.name.text)) {\n valueWrite = this.goGetArgIsValueType(String(this.goTypeOfInitializer(n.right, this.printNode(n.right, 0))))\n && !this.goGetArgWriteIsNativeArithmetic(n.right);\n }\n n.forEachChild(visit);\n };\n body.forEachChild(visit);\n return (inBody && !valueWrite) ? target : undefined;\n }\n\n goGetArgUsesAreSafe(body, param, name: string, goType: string, nilable: boolean, seen: Set, boxed = false): boolean {\n seen.add(param);\n const table: any = this.CCXT_GO_GETARG_SAFE_CONSUMERS ?? {};\n const pointer = goType.startsWith('*');\n let safe = true;\n const verdictOf = (callee: string, argIndex: number): string => {\n // the table is keyed by the printed Go callee (`this.market` prints `this.Market`); a\n // pointer is unwrapped by derefScalar, a nil map is not, so only pointers fold the case\n const goName = callee.charAt(0).toUpperCase() + callee.slice(1);\n const entry = table[callee] ?? (pointer ? (table[goName] ?? table[goName + 'Async']) : undefined);\n if (entry === undefined) {\n // a nil-defaulted container may be handed back through `any` as a non-nil typed nil\n return (pointer || nilable) ? 'unknown' : 'deref';\n }\n if (typeof entry === 'string') {\n return entry;\n }\n return entry[String(argIndex)] ?? entry['*'] ?? (pointer ? 'unknown' : 'deref');\n };\n const visit = (n: any): void => {\n if (!safe) {\n return;\n }\n if ((n?.kind === SyntaxKind.Identifier) && (n.text === name)) {\n let symbol;\n try {\n symbol = this.getChecker().getSymbolAtLocation(n);\n } catch (e) {\n symbol = undefined;\n }\n if (symbol?.valueDeclaration?.resolve() === param) {\n const parent: any = n.parent;\n if (parent === param) {\n return; // the parameter's own name is not a use\n }\n if (nilable && (goType === 'map[string]any')) {\n // goLocalIsSafeToType already matched the type of an assigned value\n const assigned = (parent?.kind === SyntaxKind.BinaryExpression) && (parent.left === n)\n && (parent.operatorToken?.kind === SyntaxKind.EqualsToken);\n if (assigned || this.goGetArgNilMapUseOnlyReads(n)) {\n return;\n }\n }\n if (nilable && (goType === '[]string') && this.goGetArgNilStringSliceUseOnlyReads(n)) {\n return;\n }\n if (pointer && (parent?.kind === SyntaxKind.BinaryExpression)) {\n // a write already type-matched by goLocalIsSafeToType, or the key of `x in d` (InOp derefs it)\n const op = parent.operatorToken?.kind;\n if ((parent.left === n) && ((op === SyntaxKind.EqualsToken) || (op === SyntaxKind.InKeyword))) {\n return;\n }\n // `x === 'lit'`: a pointer operand prints nil-guarded native or through IsEqual (derefs)\n const other: any = (parent.left === n) ? parent.right : parent.left;\n const equality = [SyntaxKind.EqualsEqualsEqualsToken, SyntaxKind.ExclamationEqualsEqualsToken].includes(op);\n if (equality && ((other?.kind === SyntaxKind.StringLiteral) || (other?.kind === SyntaxKind.NumericLiteral))) {\n return;\n }\n }\n // a copy (ternary arm, `let r = x`, `r = x`) hands the value to a body local whose\n // own uses must pass the same rules; an `any` alias prints its nil tests via IsEqual,\n // which derefs a nil pointer but not a nil map, so containers need a nil-guarded arm\n let use: any = n;\n let guarded = false;\n while ((use.parent?.kind === SyntaxKind.ParenthesizedExpression)\n || ((use.parent?.kind === SyntaxKind.ConditionalExpression) && (use.parent.condition !== use))) {\n if (use.parent.kind === SyntaxKind.ConditionalExpression) {\n guarded = guarded || this.goGetArgArmIsNilGuarded(n, use.parent);\n }\n use = use.parent;\n }\n const target = (pointer || nilable) ? this.goGetArgCopyTarget(use, body) : undefined;\n if (target !== undefined) {\n if ((!pointer && guarded) || seen.has(target)) {\n return;\n }\n safe = this.goGetArgUsesAreSafe(body, target, target.name.text, goType, nilable, seen, true);\n return;\n }\n if ((use !== n) && (pointer || nilable)) {\n safe = pointer && this.goGetArgPointerStoredAsValue(use, param);\n return;\n }\n // a non-nil container arm hands the same map/list value on (as before copies were followed)\n if (parent?.kind === SyntaxKind.BinaryExpression) {\n const other: any = (parent.left === n) ? parent.right : parent.left;\n const isNullTest = (other?.kind === SyntaxKind.NullKeyword)\n || ((other?.kind === SyntaxKind.Identifier) && (other.text === 'undefined'));\n if (isNullTest) {\n // an `any` alias tests the box through IsEqual: a nil map box is not nil\n safe = pointer || !boxed;\n return;\n // `x == nil` / `x != nil`: native for a pointer and for a container\n // (a nil map compares equal to nil exactly like the untyped nil box\n // did when the value came in untyped); a value type never gets here.\n safe = true;\n return;\n }\n }\n if (parent?.kind === SyntaxKind.CallExpression) {\n const args: any[] = parent.arguments ?? [];\n const argIndex = args.indexOf(n);\n const callee: any = parent.expression;\n let calleeName = (callee?.name !== undefined) ? callee.name.text\n : ((callee?.text !== undefined) ? callee.text : undefined);\n // Math.min / Math.max print as the deref-aware mathMin / mathMax\n if ((callee?.expression?.text === 'Math') && ((calleeName === 'min') || (calleeName === 'max'))) {\n calleeName = 'math' + calleeName.charAt(0).toUpperCase() + calleeName.slice(1);\n }\n if (calleeName === undefined) {\n safe = !pointer && !nilable;\n return;\n }\n const verdict = verdictOf(calleeName, argIndex);\n if ((verdict === 'unsafe') || ((verdict === 'container') && nilable)) {\n safe = false;\n return;\n }\n if ((calleeName === 'IsEqual') && nilable) {\n // IsEqual(x, nil) tests the *box*: an untyped nil answered true, a nil\n // map is not equal to nil\n const other: any = (argIndex === 0) ? args[1] : args[0];\n const otherIsNil = (other === undefined) || (other?.kind === SyntaxKind.NullKeyword)\n || ((other?.kind === SyntaxKind.Identifier) && (other.text === 'undefined'));\n if (otherIsNil) {\n safe = false;\n return;\n }\n }\n // GetArg folds a nil map box to its default, and a defaulted position binds through GetArg or its\n // twins, which deref a pointer and fold a nil one: both read it as absent\n if (verdict === 'unknown') {\n safe = ((nilable && (goType === 'map[string]any')) || pointer) && this.goGetArgPositionIsDefaulted(callee, argIndex);\n return;\n }\n if (nilable && !pointer && this.goGetArgPassesIntoContainerDefault(callee, argIndex)) {\n safe = false;\n return;\n }\n safe = true;\n return;\n }\n if (parent?.kind === SyntaxKind.ExpressionStatement) {\n safe = true; // `_ = x` and other inert statements\n return;\n }\n if (pointer && this.goGetArgPointerStoredAsValue(n, param)) {\n safe = true;\n return;\n }\n if (pointer && this.goGetArgPointerInHelperArithmetic(n)) {\n safe = true;\n return;\n }\n // a bare read hands the local on as `any`: a pointer or a nil-defaulted container would\n // no longer compare equal to nil there, so both keep the box\n safe = !pointer && !nilable;\n return;\n }\n }\n n.forEachChild(visit);\n };\n body.forEachChild(visit);\n return safe;\n }\n\n // `x / 1000`, `x - 1`, `x > 0`: printed through Divide/Subtract/…/IsGreaterThan, which\n // derefScalar both operands at entry (checked on the printed text by the caller's diff)\n goGetArgPointerInHelperArithmetic(n: any): boolean {\n const parent: any = n.parent;\n if (parent?.kind !== SyntaxKind.BinaryExpression) {\n return false;\n }\n const ops = [SyntaxKind.SlashToken, SyntaxKind.MinusToken, SyntaxKind.AsteriskToken, SyntaxKind.PercentToken,\n SyntaxKind.GreaterThanToken, SyntaxKind.LessThanToken, SyntaxKind.GreaterThanEqualsToken, SyntaxKind.LessThanEqualsToken];\n if (!ops.includes(parent.operatorToken?.kind)) {\n return false;\n }\n const printed = this.printNode(parent, 0).trim();\n return /^(?:\\(\\s*)*(?:Divide|Subtract|Multiply|Mod|IsGreaterThan|IsLessThan|IsGreaterThanOrEqual|IsLessThanOrEqual)\\(/.test(printed);\n }\n\n // `request[k] = x` / `{ k: x }`: the pointer lands in an `any` dictionary whose readers\n // (GetValue, Urlencode, Json, IsEqual) derefScalar it; a `*Request` builder returns that\n // dictionary to its caller, so it keeps the box\n goGetArgPointerStoredAsValue(n: any, param: any): boolean {\n const parent: any = n.parent;\n const stored = ((parent?.kind === SyntaxKind.BinaryExpression) && (parent.right === n)\n && (parent.operatorToken?.kind === SyntaxKind.EqualsToken)\n && (parent.left?.kind === SyntaxKind.ElementAccessExpression))\n || ((parent?.kind === SyntaxKind.PropertyAssignment) && (parent.initializer === n));\n let method: any = param?.parent;\n while ((method !== undefined) && !isFunctionLike(method)) {\n method = method.parent;\n }\n const methodName = String(method?.name?.text ?? '');\n return stored && !methodName.endsWith('Request');\n }\n\n // element `index` of a tuple-typed call result is `Dict` (`[T, Dict]`); the Go tuple holds\n // that map, so MapTyped reads the same dictionary back\n goTupleElementIsDict(right: any, index: number): boolean {\n const checker: any = this.checkerOrUndefined();\n if ((checker === undefined) || (index < 0)) {\n return false;\n }\n const expr: any = (right?.kind === SyntaxKind.AwaitExpression) ? right.expression : right;\n if (expr?.kind !== SyntaxKind.CallExpression) {\n return false;\n }\n const type: any = checker.getTypeAtLocation(expr);\n if ((type === undefined) || !checker.isTupleType(type)) {\n return this.goParamsTupleHelperIndex(expr) === index;\n }\n const element: any = checker.getTypeArguments(type)?.[index];\n return (element !== undefined) && !(element.flags & (TypeFlags.Any | TypeFlags.Unknown))\n && this.goParameterTypeIsDict(element);\n }\n\n // `this.handleXxx(…, params, …)` of a base helper typed `any[]` whose element holds the params\n // map it was given after omit/extend; only when that element is the same map-typed local\n goParamsTupleHelperIndex(call: any): number {\n const callee: any = call?.expression;\n if ((callee?.kind !== SyntaxKind.PropertyAccessExpression) || (callee.expression?.kind !== SyntaxKind.ThisKeyword)) {\n return -1;\n }\n const index = GO_PARAMS_TUPLE_HELPERS[callee.name?.text];\n if (index === undefined) {\n return -1;\n }\n const target: any = call.parent?.left?.elements?.[index];\n const passesTarget = (target?.kind === SyntaxKind.Identifier)\n && (call.arguments ?? []).some((a: any) => (a.kind === SyntaxKind.Identifier) && (a.text === target.text));\n return passesTarget ? index : -1;\n }\n\n // the safety check of a map-typed GetArg local: a Dict tuple element written into it is printed\n // through MapTyped once the local is bound as a map (no recursion into goGetArgLocalType)\n goGetArgTupleWriteIsDict(declaration: any, right: any, index: number): boolean {\n return (declaration?.kind === SyntaxKind.Parameter) && (declaration.initializer !== undefined)\n && this.goTupleElementIsDict(right, index);\n }\n\n // `[x, params] = f()` writes a GetArg local bound as map[string]any: unbox the element\n goGetArgBindsDictElement(leftElement: any, right: any, index: number): boolean {\n if ((leftElement?.kind !== SyntaxKind.Identifier) || !this.goTupleElementIsDict(right, index)) {\n return false;\n }\n let decl: any;\n try {\n decl = this.checkerOrUndefined()?.getSymbolAtLocation(leftElement)?.valueDeclaration?.resolve();\n } catch (e) {\n decl = undefined;\n }\n if ((decl?.kind !== SyntaxKind.Parameter) || (decl.initializer === undefined) || (decl.parent?.body === undefined)) {\n return false;\n }\n return this.goGetArgParameterType(decl) === 'map[string]any';\n }\n\n // the Go type a defaulted parameter's GetArg twin binds (undefined: the `any` GetArg); the one\n // predicate shared by the binding line and every consumer's printing\n goGetArgParameterType(decl: any): string | undefined {\n if ((decl?.kind !== SyntaxKind.Parameter) || (decl.initializer === undefined) || (decl.dotDotDotToken !== undefined)\n || (decl.name?.kind !== SyntaxKind.Identifier) || (decl.parent?.body === undefined)\n || ![SyntaxKind.MethodDeclaration, SyntaxKind.FunctionDeclaration].includes(decl.parent.kind)) {\n return undefined;\n }\n this.goGetArgTypeCache ??= new WeakMap();\n if (!this.goGetArgTypeCache.has(decl)) {\n this.goGetArgTypeCache.set(decl, undefined);\n this.goGetArgTypeComputing ??= new Set();\n this.goGetArgTypeComputing.add(decl);\n let goType: string | undefined;\n try {\n goType = this.goGetArgLocalType(decl.parent.body, decl, this.printNode(decl.initializer, 0));\n } finally {\n this.goGetArgTypeComputing.delete(decl);\n }\n this.goGetArgTypeCache.set(decl, (goType !== undefined) && (this.goGetArgTwinName(goType) !== undefined) ? goType : undefined);\n }\n return this.goGetArgTypeCache.get(decl);\n }\n\n // argument `argIndex` of the callee binds a parameter with a TypeScript default (GetArg-bound)\n goGetArgPositionIsDefaulted(callee: any, argIndex: number): boolean {\n if (argIndex < 0) {\n return false;\n }\n let decl: any;\n try {\n decl = this.getChecker().getSymbolAtLocation(callee)?.valueDeclaration?.resolve();\n } catch (e) {\n decl = undefined;\n }\n const kinds = [SyntaxKind.MethodDeclaration, SyntaxKind.FunctionDeclaration];\n const param: any = (decl !== undefined) && kinds.includes(decl.kind) ? decl.parameters?.[argIndex] : undefined;\n return (param?.initializer !== undefined) && (param.dotDotDotToken === undefined);\n }\n\n // the callee's own GetArg with a container default returns def for an untyped nil box but the\n // nil map for a nil map box (nil slices collapse to def), so only map shapes differ\n goGetArgPassesIntoContainerDefault(callee: any, argIndex: number): boolean {\n if (argIndex < 0) {\n return false;\n }\n let symbol;\n try {\n symbol = this.getChecker().getSymbolAtLocation(callee);\n } catch (e) {\n symbol = undefined;\n }\n const decl: any = symbol?.valueDeclaration?.resolve();\n const params: any[] = decl?.parameters ?? [];\n const param: any = params[argIndex];\n const initializer: any = param?.initializer;\n if (initializer === undefined) {\n return false;\n }\n return initializer.kind === SyntaxKind.ObjectLiteralExpression;\n }\n\n printFunctionBody(node, identation, wrapInChannel = false) {\n\n // check if there is any default parameter to initialize\n let functionBody: string;\n const funcParams = node.parameters;\n const initParams = [];\n if (funcParams.length > 0) {\n const body = node.body.statements;\n const first = body.length > 0 ? body[0] : [];\n const remaining = body.length > 0 ? body.slice(1): [];\n let firstStatement = this.printNode(first, identation + 1);\n\n const remainingString = remaining.map((statement) => this.printNode(statement, identation + 1)).join(\"\\n\");\n let offSetIndex = 0;\n funcParams.forEach((param, i) => {\n const initializer = param.initializer;\n if (initializer) {\n const index = i + offSetIndex;\n // index = index < 0 ? 0 : i - 1;\n const paramName = this.printNode(param.name, 0);\n const printedDefault = this.printNode(initializer, 0);\n // a default that names a Go type exactly binds through its typed twin; others keep GetArg (ABI unchanged)\n const goType = this.goGetArgParameterType(param);\n const twinName = (goType !== undefined) ? this.goGetArgTwinName(goType) : undefined;\n if ((goType !== undefined) && (twinName !== undefined)) {\n initParams.push(`var ${paramName} ${goType} = ${twinName}(optionalArgs, ${index}, ${printedDefault})`);\n } else {\n initParams.push(`${paramName} := GetArg(optionalArgs, ${index}, ${printedDefault})`);\n }\n initParams.push(`_ = ${paramName}`);\n } else {\n offSetIndex--;\n }\n });\n\n if (initParams.length > 0) {\n const defaultInitializers = initParams.map( l => this.getIden(identation+1) + l ).join(\"\\n\") + \"\\n\";\n const bodyParts = firstStatement.split(\"\\n\");\n const commentPart = bodyParts.filter(line => this.isComment(line));\n const isComment = commentPart.length > 0;\n if (isComment) {\n // the statement's leading comment must keep the ' * ' continuation-alignment\n // of printLeadingComments: gofmt re-indents a /* */ block to\n // ` * text` (printer.stripCommonPrefix + the tab indent), so a bare\n // trim() here would emit `* text` under the '/**'.\n const commentPartString = commentPart.map((c) => {\n const line = c.trim();\n return this.getIden(identation+1) + (line.startsWith(\"*\") ? \" \" + line : line);\n }).join(\"\\n\");\n const firstStmNoComment = bodyParts.filter(line => !this.isComment(line)).join(\"\\n\");\n firstStatement = commentPartString + \"\\n\" + defaultInitializers + firstStmNoComment;\n } else {\n firstStatement = defaultInitializers + firstStatement;\n }\n }\n const blockOpen = this.getBlockOpen(identation);\n const blockClose = this.getBlockClose(identation);\n firstStatement = remainingString.length > 0 ? firstStatement + \"\\n\" : firstStatement;\n if (!wrapInChannel) {\n functionBody = blockOpen + firstStatement + remainingString + blockClose;\n } else {\n functionBody = firstStatement + remainingString;\n }\n } else {\n if (!wrapInChannel) {\n functionBody = super.printFunctionBody(node, identation);\n } else {\n functionBody = node.body.statements.map(statement => this.printNode(statement, identation + 1)).join(\"\\n\");\n }\n }\n if (wrapInChannel) {\n // return statement might be inside ifs or other complex statements so we still have to replace them manually :(\n // functionBody = functionBody.replace(/(\\s*)return\\s+([^\\n]+\\n?)/g, '$1ch <- $2$1');\n // the body half of the trampoline pair is a flat function body: the statements\n // are already printed at their own level, so no extra indentation level is added here\n const lastLine = functionBody.split(\"\\n\").pop().trim();\n // no trailing return after a return/panic or a conditional that returns in all branches\n const shouldAddLastReturn = !lastLine.startsWith(\"return\") && !lastLine.startsWith(\"panic\")\n && !(node.body && this.blockEndsWithConditionalReturn(node.body.statements));\n\n // This is the *body* half of the trampoline pair (see printAsyncTrampolineBlock):\n //\n // func (this *Exchange) fetchTickerBody(ch chan any, symbol any) any {\n // defer close(ch)\n // defer ReturnPanicError(ch)\n // ch <- ...\n // return nil\n // }\n //\n // It is a plain flat function: the trampoline already `go`es it, so there is no\n // `go func() any {...}()` envelope here, and no channel allocation either — the\n // trampoline owns `ch` and hands it in. The recover lives HERE, on the goroutine\n // that can actually panic, which is why the trampoline's result can stay unnamed.\n const lines = [\n \"{\",\n `${this.getIden(identation + 1)}defer close(ch)`,\n `${this.getIden(identation + 1)}defer ReturnPanicError(ch)`,\n functionBody,\n ];\n if (shouldAddLastReturn) {\n lines.push(this.getIden(identation+1) + \"return nil\");\n }\n lines.push(`${this.getIden(identation)}}`);\n functionBody = lines.join(\"\\n\");\n\n // to do fix this later\n // we can't pass nil to the channel when we just want to\n // return from the try catch, otherwise the channel will close with nil\n // instead of the proper result\n functionBody = functionBody.replaceAll(/(^\\s*)ch\\s<-\\snil\\s+return\\snil(\\s*\\})/gm, \"$1return nil$2\");\n\n }\n\n return functionBody;\n }\n\n printAwaitExpression(node, identation) {\n const expression = this.printNode(node.expression, identation);\n if (expression.startsWith(\"<-\")) {\n return expression;\n }\n return `(<-${expression})`;\n }\n\n printInstanceOfExpression(node: BinaryExpression, identation: number): string {\n const left = this.printNode (node.left);\n const right = this.printNode (node.right);\n return this.getIden(identation) + `IsInstance(${left}, ${right})`;\n }\n\n getLineBasedSuffix(node): string {\n const { line, character } = this.getSrc().getLineAndCharacterOfPosition(node.getStart());\n return `${line}${character}`;\n }\n\n printExpressionStatement(node, identation) {\n\n if (node?.expression?.kind === SyntaxKind.AsExpression) {\n node = node.expression;\n }\n if (node.expression.kind !== SyntaxKind.AwaitExpression) {\n return this.stripWhitespaceOnlyLines (super.printExpressionStatement(node, identation));\n }\n\n const exprStm = this.printNode(node.expression, identation);\n\n // const { line, character } = this.getSrc().getLineAndCharacterOfPosition(node.getStart());\n // console.log(`line: ${line}, character: ${character}`);\n const returnRandName = \"retRes\" + this.getLineBasedSuffix(node);\n\n // const expStatement =this.getIden(identation) + exprStm + this.LINE_TERMINATOR;\n\n // the awaited call's value is discarded here (`await this.loadMarkets();`), so the\n // extension may still name it: `var retResNNN T = MapTyped(PanicOnError(<-...))`\n const stmtUnbox = this.goAwaitReceiveUnbox(node.expression, exprStm);\n const expStatement = (stmtUnbox !== undefined)\n ? `\n${this.getIden(identation)}var ${returnRandName} ${stmtUnbox.goType} = ${stmtUnbox.wrap(exprStm)}`\n // the discarded value needs no local: PanicOnError still surfaces the channel's error\n : `\n${this.getIden(identation)}PanicOnError(${exprStm.trim()})`;\n return this.printNodeCommentsIfAny(node, identation, expStatement);\n }\n\n isInsideAsyncFunction(returnStatementNode) {\n let currentNode = returnStatementNode;\n\n while (currentNode) {\n // Check if the current node is a function or method\n if (isFunctionDeclaration(currentNode) ||\n isFunctionExpression(currentNode) ||\n isArrowFunction(currentNode) ||\n isMethodDeclaration(currentNode)) {\n return this.isAsyncFunction(currentNode);\n }\n // Move up the tree to the parent node\n currentNode = currentNode.parent;\n }\n\n // Return false if no async function or method is found\n return false;\n }\n\n /**\n * Statement that terminates an async (channel returning) function body.\n *\n * The body is the trampoline's sibling method (`go this.fetchTickerBody(ch, ...)`),\n * and the synthetic try/catch closures nest inside it: in both cases `return` leaves\n * a function whose result is a plain `any`, never the channel. The trampoline itself\n * owns the single `return ch`, emitted by printFunctionBody.\n */\n getAsyncReturnStatement(node): string {\n return \"return nil\";\n }\n\n printReturnStatement(node, identation) {\n\n const isAsyncFunction = this.isInsideAsyncFunction(node);\n // if (node?.expression?.kind !== SyntaxKind.AwaitExpression) {\n // return super.printReturnStatement(node, identation);\n // }\n if (!isAsyncFunction) {\n return super.printReturnStatement(node, identation);\n }\n\n const leadingComment = this.printLeadingComments(node, identation);\n let trailingComment = this.printTraillingComment(node, identation);\n trailingComment = trailingComment ? \" \" + trailingComment : trailingComment;\n const exp = node.expression;\n let rightPart = exp ? (' ' + this.printNode(exp, identation)) : '';\n rightPart = rightPart.trim();\n\n // `return nil` only exits the synthetic try/catch closure; at the function's own\n // level the async core has to hand the (named) result channel back instead.\n const returnStatement = this.getAsyncReturnStatement(node);\n\n if (node?.expression?.kind === SyntaxKind.AsExpression) {\n node = node.expression;\n }\n\n if (node?.expression?.kind === SyntaxKind.AwaitExpression) {\n const returnRandName = \"retRes\" + this.getLineBasedSuffix(node.expression);\n // the template's `:= ` already supplies the separator; keep the printed expression\n // flush so the receive reads `retResNNN := (<-this.X())` (gofmt spacing)\n const printedExpr = rightPart;\n rightPart = rightPart ? rightPart + this.LINE_TERMINATOR : this.LINE_TERMINATOR;\n // return leadingComment + this.getIden(identation) + this.RETURN_TOKEN + rightPart + trailingComment;\n // printLeadingComments returns the comment lines with their own indentation and a\n // trailing newline, so the comment is emitted as its own line(s) and the `ch <-`\n // line carries the indentation the comment would otherwise have swallowed.\n const retUnbox = this.goAwaitReceiveUnbox(node.expression, printedExpr);\n if (retUnbox !== undefined) {\n return `\n${this.getIden(identation)}var ${returnRandName} ${retUnbox.goType} = ${retUnbox.wrap(printedExpr)}\n${leadingComment}${this.getIden(identation)}ch <- ${returnRandName}${trailingComment}\n${this.getIden(identation)}${returnStatement}`;\n }\n return `\n${this.getIden(identation)}${returnRandName} := ${rightPart}\n${this.getIden(identation)}PanicOnError(${returnRandName})\n${leadingComment}${this.getIden(identation)}ch <- ${returnRandName}${trailingComment}\n${this.getIden(identation)}${returnStatement}`;\n // ${this.getIden(identation)}return ${returnRandName}`;\n }\n\n if (rightPart.length === 0) {\n return `\\n${this.getIden(identation)}${returnStatement}`;\n }\n\n return `\n${leadingComment}${this.getIden(identation)}ch <- ${rightPart}${trailingComment}\n${this.getIden(identation)}${returnStatement}`;\n // ${this.getIden(identation)}return ${rightPart}`;\n // ${this.getIden(identation)}return ${rightPart}`;\n }\n\n\n printArrayLiteralExpression(node, identation = 0) {\n // elements that span lines (object literals, calls carrying one) need the\n // statement's own level so their bodies land one level deeper\n // …but an element is inline after `{`, so any leading indent a printer prepends is trimmed\n // go/printer prints composite literal elements at depth 1 (exprList(..., 1, ...))\n const elements = node.elements.map((e) => this.goWithExprDepth(1, () => this.printNode(e, identation)).trim()).join(\", \");\n // a list of calls (promises included) always opens as `[]any{`; getFunctionType is kept for its\n // checker side effect (it caches a signature on the call node)\n const first = node.elements[0];\n const arrayOpen = (first?.kind === SyntaxKind.CallExpression) && (this.getFunctionType(first) || true)\n ? '[]any{' : this.ARRAY_OPENING_TOKEN;\n return arrayOpen + elements + this.ARRAY_CLOSING_TOKEN;\n }\n\n printArgsForCallExpression(node, identation) {\n const unified = this.goUnifiedStringCallArgs(node, identation);\n if (unified !== undefined) {\n return unified;\n }\n // go/printer prints the arguments of a call with more than one argument\n // one level deeper than the call itself (nodes.go, CallExpr)\n if (node.arguments && node.arguments.length > 1) {\n return this.goWithExprDepth(this.goExprDepth + 1, () => super.printArgsForCallExpression(node, identation));\n }\n return super.printArgsForCallExpression(node, identation);\n }\n\n // check this out later\n\n // IsArray(v) answers true exactly for the slice types its runtime type switch lists\n // and false for every other box, a nil box included. On an operand whose Go type the\n // printer can name the predicate is that constant.\n isArraySliceTypes = [ '[]any', '[][]any', '[]map[string]any', '[]string', '[]bool',\n '[]int', '[]int8', '[]int16', '[]int32', '[]int64', '[]float32', '[]float64',\n '[]uint', '[]uint8', '[]uint16', '[]uint32', '[]uint64' ];\n\n // the other Go types the printer can name: a map, a string, a bool, a number, or a\n // pointer to a scalar — none of them is a slice the switch matches\n isArrayNonSliceTypes = [ 'map[string]any', 'string', 'bool', 'int', 'int64', 'float64',\n '*string', '*int64', '*float64', '*bool', '*int' ];\n\n // true when the identifier keeps a reference besides this one: the constant fold\n // drops the call's reference to the operand, and Go rejects a local that ends up\n // unused, so an operand without another use keeps the helper\n goIdentifierUsedElsewhere(nameNode): boolean {\n const scope = this.goEnclosingFunction(nameNode);\n if (scope === undefined) {\n return false;\n }\n const name = nameNode.text;\n let used = false;\n const visit = (n) => {\n if (used) {\n return;\n }\n if ((n.kind === SyntaxKind.Identifier) && (n.text === name) && (n !== nameNode)) {\n const parent = n.parent;\n const isDeclarationName = (parent?.kind === SyntaxKind.VariableDeclaration) && (parent.name === n);\n const isPropertyName = (parent?.kind === SyntaxKind.PropertyAccessExpression) && (parent.name === n);\n if (!isDeclarationName && !isPropertyName) {\n used = true;\n return;\n }\n }\n n.forEachChild(visit);\n };\n scope.forEachChild(visit);\n return used;\n }\n\n // the local is printed `any` yet every value that reaches it is a []any: it starts\n // from a slice initializer and no later statement rebinds it (a push only appends\n // to the same slice), so the box holds a []any at every use\n goLocalHoldsOnlyArrays(nameNode): boolean {\n const checker: any = this.checkerOrUndefined();\n if (checker === undefined) {\n return false;\n }\n const symbol = checker.getSymbolAtLocation(nameNode);\n const declaration: any = symbol?.valueDeclaration?.resolve();\n if ((declaration?.kind !== SyntaxKind.VariableDeclaration) || (declaration.initializer === undefined)) {\n return false;\n }\n if (this.goTypeOfInitializer(declaration.initializer, this.printNode(declaration.initializer, 0)) !== '[]any') {\n return false;\n }\n const scope = this.goEnclosingFunction(declaration);\n if (scope === undefined) {\n return false;\n }\n const name = declaration.name.text;\n let safe = true;\n const visit = (n) => {\n if (!safe) {\n return;\n }\n if ((n.kind === SyntaxKind.Identifier) && (n.text === name) && (n !== declaration.name) && (n !== nameNode)) {\n const parent = n.parent;\n if (parent?.kind === SyntaxKind.VariableDeclaration && parent.name === n) {\n return; // a sibling block-scoped declaration; it gets its own type\n }\n if (this.goRebindingTargetOf(n) !== undefined) {\n safe = false; // a rebinding write can box another type\n return;\n }\n }\n n.forEachChild(visit);\n };\n scope.forEachChild(visit);\n return safe;\n }\n\n // native IsArray: a constant for an operand whose Go type the printer proves, and\n // the two-value assertion on an `any` box that only ever holds a []any\n printNativeIsArray(node, parsedArg: string | undefined): string | undefined {\n if ((typeof parsedArg !== 'string') || parsedArg.includes('\\n')) {\n return undefined;\n }\n const argNode = node.arguments?.[0];\n if (argNode?.kind !== SyntaxKind.Identifier) {\n return undefined; // a call operand may have effects and has no declared type\n }\n const goType = this.goPrintedTypeOfExpression(argNode, parsedArg);\n if (goType !== undefined) {\n const isSlice = this.isArraySliceTypes.indexOf(goType) >= 0;\n if (isSlice || (this.isArrayNonSliceTypes.indexOf(goType) >= 0)) {\n return this.goIdentifierUsedElsewhere(argNode) ? (isSlice ? 'true' : 'false') : undefined;\n }\n return undefined;\n }\n if (!this.goLocalHoldsOnlyArrays(argNode)) {\n return undefined;\n }\n // the box only ever holds a []any, so the assertion answers what the type switch\n // would and keeps the operand referenced\n const read = `_, ok := ${parsedArg}.([]any)`;\n if (11 + read.length + 2 + 'return ok'.length <= 100) {\n return `func() bool { ${read}; return ok }()`;\n }\n const level = this.goStatementLevel;\n return `func() bool {\\n${this.getIden(level + 1)}${read}\\n${this.getIden(level + 1)}return ok\\n${this.getIden(level)}}()`;\n }\n\n printArrayIsArrayCall(node, identation, parsedArg = undefined) {\n return this.printNativeIsArray(node, parsedArg) ?? `IsArray(${parsedArg})`;\n }\n\n printObjectKeysCall(node, identation, parsedArg = undefined) {\n return `ObjectKeys(${parsedArg})`;\n }\n\n printObjectValuesCall(node, identation, parsedArg = undefined) {\n return `ObjectValues(${parsedArg})`;\n }\n\n printJsonParseCall(node, identation, parsedArg = undefined) {\n return `JsonParse(${parsedArg})`;\n }\n\n printJsonStringifyCall(node, identation, parsedArg = undefined) {\n return `JsonStringify(${parsedArg})`; // make this customizable\n }\n\n printPromiseAllCall(node, identation, parsedArg = undefined) {\n return `promiseAll(${parsedArg})`;\n }\n\n printMathFloorCall(node, identation, parsedArg = undefined) {\n return `MathFloor(${parsedArg})`;\n }\n\n printMathRoundCall(node, identation, parsedArg = undefined) {\n return `MathRound(${parsedArg})`;\n }\n\n printMathCeilCall(node, identation, parsedArg = undefined) {\n return `MathCeil(${parsedArg})`;\n }\n\n printNumberIsIntegerCall(node: any, identation: any, parsedArg?: any) {\n return `IsInt(${parsedArg})`;\n }\n\n // the base printer prints a method-call argument at the statement's depth; the\n // emitted Go call has two or more arguments, which go/printer lays out one level\n // deeper (a native `a + b` argument then drops its blanks)\n goPrintCallArgument(argument, printedText: string | undefined): string | undefined {\n if (argument?.kind !== SyntaxKind.BinaryExpression || printedText === undefined) {\n return printedText;\n }\n return this.goWithExprDepth(this.goExprDepth + 1, () => this.printNode(argument, 0)).trimStart();\n }\n\n printArrayPushCall(node: CallExpression, identation: number, name: string | undefined = undefined, parsedArg: string | undefined = undefined) {\n let returnValue = '';\n let returnRandName = name;\n parsedArg = this.goPrintCallArgument(node.arguments?.[0], parsedArg);\n // a `[]any` local is the slice itself, so it appends natively\n const nativeReceiver = this.goNativeAppendReceiver(node);\n if (nativeReceiver !== undefined) {\n return `${nativeReceiver} = append(${nativeReceiver}, ${parsedArg})`;\n }\n // a map/slice index or a GetValue box is not addressable: copy it into a local first\n if (name?.startsWith('GetValue') || /[\\])]$/.test(name ?? '')) {\n returnRandName = \"retRes\" + this.getLineBasedSuffix(node);\n returnValue = `${returnRandName} := ${name}\\n${this.getIden(identation)}`;\n }\n return `${returnValue}AppendToArray(&${returnRandName}, ${parsedArg})`;\n // works with:\n // func AppendToArray(slicePtr *any, element any)\n // func AppendToArrayValue(slice any, element any) any\n // func AppendToArraySafe(slice any, element any) any\n }\n\n printIncludesCall(node, identation, name = undefined, parsedArg = undefined) {\n return `Contains(${name}, ${parsedArg})`;\n }\n\n // the Go type an `indexOf` operand is printed as, or undefined for anything Go cannot\n // hand to strings.Index: an `any` box (a parameter, a GetValue/Ternary result), a\n // number, a slice. The receiver and the needle both have to be Go strings\n goIndexOfOperandType(node, printedText: string): string | undefined {\n if (this.goIsAnyBoxExpression(node, printedText)) {\n return undefined;\n }\n if (node?.kind === SyntaxKind.Identifier) {\n return this.goDeclaredTypeOfIdentifier(node);\n }\n if (GO_ANY_BOX_CALLS.indexOf(this.goPrintedCallee(printedText)) >= 0) {\n return undefined;\n }\n return this.goStringCallStaticType(node, printedText) ?? this.goStringFieldStaticType(node, printedText);\n }\n\n // The ccxt writers assemble four outputs from a *slice* of the printer output (base-class files\n // after their TRANSPILED marker, ws cache tests after their first separator), which would cut off\n // the leading file-level import; they keep the helper until their writer adds the import itself.\n goFileKeepsFileLevelImports(): boolean {\n const fileName = this.getSrc()?.fileName ?? '';\n return !/(?:base\\/Exchange(?:\\.nooverloads\\.\\d+)?|base\\/PredictionExchange|base\\/test\\.orderBook|base\\/test\\.cache)\\.ts$/.test(fileName);\n }\n\n // `GetIndexOf(s, t)` is `strings.Index(s, t)` for a receiver declared `string` once `t` is a\n // string too (`target.(string)` succeeds; -1 is both not-found answers); a `*string` receiver\n // answers -1 when nil, reproduced by the nil guard. Slices and `any` boxes keep the helper.\n goNativeIndexOf(node, name, parsedArg): string | undefined {\n if ((typeof name !== 'string') || (typeof parsedArg !== 'string')) {\n return undefined;\n }\n if (name.includes('\\n') || parsedArg.includes('\\n')) {\n return undefined;\n }\n if (!this.goFileKeepsFileLevelImports()) {\n return undefined;\n }\n const receiver = this.goUnwrapPrintedAssertions(node?.expression?.expression);\n const target = this.goUnwrapPrintedAssertions(node?.arguments?.[0]);\n if (this.goIndexOfOperandType(target, parsedArg) !== 'string') {\n return undefined; // a nilable/number needle answers -1 in the helper\n }\n const receiverType = this.goIndexOfOperandType(receiver, name);\n if (receiverType === 'string') {\n this.goFileStdlibImports.add('strings');\n return `strings.Index(${name}, ${parsedArg})`;\n }\n // the literal repeats the identifier, so the receiver is still read exactly once\n if ((receiverType === '*string') && (receiver?.kind === SyntaxKind.Identifier)) {\n this.goFileStdlibImports.add('strings');\n const level = this.goStatementLevel;\n const body = this.getIden(level + 1);\n const inner = this.getIden(level + 2);\n return `func() int {\\n${body}if ${name} == nil {\\n${inner}return -1\\n${body}}\\n${body}return strings.Index(*${name}, ${parsedArg})\\n${this.getIden(level)}}()`;\n }\n return undefined;\n }\n\n printIndexOfCall(node, identation, name = undefined, parsedArg = undefined) {\n const native = this.goHx4G06DerefIndexOf(node, name, parsedArg) ?? this.goNativeIndexOf(node, name, parsedArg);\n if (native !== undefined) {\n return native;\n }\n return `${this.INDEXOF_WRAPPER_OPEN}${name}, ${parsedArg}${this.INDEXOF_WRAPPER_CLOSE}`;\n }\n\n // A native string operation needs every operand to be a Go `string`: a proven one prints as is,\n // a `*string` goDerefableStringOperand proves non-nil prints as its pointee (the helper's nil\n // branch is unreachable). A regex literal is a pattern, never a string: undefined keeps the helper.\n goNativeStringOperandTexts(operands: any[], texts: string[], expected: string[]): string[] | undefined {\n const result: string[] = [];\n for (let i = 0; i < expected.length; i++) {\n const operand = operands[i];\n if (operand === undefined || operand.kind === SyntaxKind.RegularExpressionLiteral) {\n return undefined;\n }\n if (this.goOperandStaticType(operand, texts[i]) === expected[i]) {\n result.push(texts[i]);\n } else if ((expected[i] === 'string') && !texts[i].includes('\\n') && (this.goDerefableStringOperand(operand) || this.goLiteralUnionNarrowedStringDeref(operand))) {\n result.push('*' + texts[i].trim());\n } else {\n return undefined;\n }\n }\n return result;\n }\n\n // `(x as T)` and `(x)` print as `x`, so the operand's own Go type governs the printed receiver\n goUnwrapPrintedAssertions(node) {\n while ((node?.kind === SyntaxKind.AsExpression) || (node?.kind === SyntaxKind.ParenthesizedExpression)) {\n node = node.expression;\n }\n return node;\n }\n\n // the native string call (built from the proven operand texts, `*`-dereferenced where needed) when\n // every operand matches `expected` and the file's stdlib import can be placed (see\n // goStdlibImportIsPlaceable), else the helper call; an unprinted argument keeps the helper\n goNativeStringCallOr(node, texts: string[], expected: string[], nativeCall: (ops: string[]) => string, helperCall: string, unwrapReceiver = false): string {\n const receiver = unwrapReceiver ? this.goUnwrapPrintedAssertions(node.expression?.expression) : node.expression?.expression;\n const operands = [receiver, ...expected.slice(1).map((_, i) => node.arguments?.[i])];\n const ops = texts.slice(1).includes(undefined) ? undefined : this.goNativeStringOperandTexts(operands, texts, expected);\n if ((ops !== undefined) && this.goStdlibImportIsPlaceable()) {\n this.goFileStdlibImports.add('strings');\n return nativeCall(ops);\n }\n return helperCall;\n }\n\n // The native string calls need `import \"strings\"` before the file's first declaration. Every ccxt\n // consumer splices the body at file head, except build/goTranspiler.ts#transpileBaseMethods and\n // #transpilePredictionBaseMethods; those keep the helper until getGoImports(file) declares it.\n goStdlibImportIsPlaceable(): boolean {\n return this.goFileKeepsFileLevelImports();\n }\n\n printStartsWithCall(node, identation, name = undefined, parsedArg = undefined) {\n // `s.startsWith (p)` -> strings.HasPrefix\n return this.goNativeStringCallOr(node, [name, parsedArg], ['string', 'string'],\n (o) => `strings.HasPrefix(${o[0]}, ${o[1]})`, `StartsWith(${name}, ${parsedArg})`);\n }\n\n printEndsWithCall(node, identation, name = undefined, parsedArg = undefined) {\n // `s.endsWith (p)` -> strings.HasSuffix\n return this.goNativeStringCallOr(node, [name, parsedArg], ['string', 'string'],\n (o) => `strings.HasSuffix(${o[0]}, ${o[1]})`, `EndsWith(${name}, ${parsedArg})`);\n }\n\n printTrimCall(node, identation, name = undefined) {\n return `Trim(${name})`;\n }\n\n printJoinCall(node, identation, name = undefined, parsedArg = undefined) {\n // `a.join (sep)` -> strings.Join: only a declared `[]string` receiver can skip the\n // per-element ToString the helper applies to a []any\n return this.goNativeStringCallOr(node, [name, parsedArg], ['[]string', 'string'],\n (o) => `strings.Join(${o[0]}, ${o[1]})`, `Join(${name}, ${parsedArg})`);\n }\n\n printSplitCall(node, identation, name = undefined, parsedArg = undefined) {\n // `s.split (sep)` -> strings.Split, which keeps JS's empty trailing element\n // (\"a,\" -> [\"a\", \"\"]) exactly like the helper's own strings.Split call\n return this.goNativeStringCallOr(node, [name, parsedArg], ['string', 'string'],\n (o) => `strings.Split(${o[0]}, ${o[1]})`, `Split(${name}, ${parsedArg})`);\n }\n\n printToFixedCall(node, identation, name = undefined, parsedArg = undefined) {\n return `toFixed(${name}, ${parsedArg})`;\n }\n\n // ToString is the identity on a Go string (exchange_helpers.go: derefScalar and `case string`\n // return it unchanged), so a receiver declared `string` prints as itself. An `any` box, a\n // *string (derefScalar answers nil) or a float64 keeps the helper's runtime formatting.\n printToStringCall(node, identation, name = undefined) {\n if ((name !== undefined) && (name.indexOf('\\n') < 0)) {\n const receiver = (node?.expression?.kind === SyntaxKind.PropertyAccessExpression)\n ? node.expression.expression\n : undefined;\n if ((receiver !== undefined) && (this.goOperandStaticType(receiver, name) === 'string')) {\n return name;\n }\n // a non-nil `*string`: derefScalar hands ToString the pointee, returned unchanged\n if ((receiver !== undefined) && (this.goDerefableStringOperand(receiver) || this.goLiteralUnionNarrowedStringDeref(receiver))) {\n return '*' + name.trim();\n }\n // an int64 prints its decimal digits in both: the helper's Sprintf(\"%d\") and FormatInt\n if ((receiver !== undefined) && (this.goOperandStaticType(receiver, name) === 'int64') && this.goStdlibImportIsPlaceable()) {\n this.goFileStdlibImports.add('strconv');\n return `strconv.FormatInt(${name}, 10)`;\n }\n }\n return `ToString(${name})`;\n }\n\n printConcatCall(node, identation, name = undefined, parsedArg = undefined) {\n return `Concat(${name}, ${parsedArg})`;\n }\n\n printToUpperCaseCall(node, identation, name = undefined) {\n // `s.toUpperCase ()` -> strings.ToUpper\n return this.goNativeStringCallOr(node, [name], ['string'], (o) => `strings.ToUpper(${o[0]})`, `ToUpper(${name})`, true);\n }\n\n printToLowerCaseCall(node, identation, name = undefined) {\n // `s.toLowerCase ()` -> strings.ToLower\n return this.goNativeStringCallOr(node, [name], ['string'], (o) => `strings.ToLower(${o[0]})`, `ToLower(${name})`, true);\n }\n\n printShiftCall(node, identation, name = undefined) {\n return `Shift(${name})`;\n }\n\n printReverseCall(node, identation, name = undefined) {\n return `Reverse(${name})`;\n }\n\n printPopCall(node, identation, name = undefined) {\n return `Pop(${name}))`;\n }\n\n printAssertCall(node, identation, parsedArgs) {\n return `assert(${parsedArgs})`;\n }\n\n // `x.slice(a)` / `x.slice(a, b)` prints `Slice(x, a, b)`, a JS slice on a string: a\n // negative bound counts from the end, a start-only call clamps its start to 0 and an\n // end past len is clamped to len, where Go's native slicing panics\n goSliceLiteralBound(node): number | undefined {\n if (node?.kind === SyntaxKind.NumericLiteral) {\n const text = node.text;\n if (!/^\\d+$/.test(text)) {\n return undefined;\n }\n const value = Number(text);\n return (value > 2147483647) ? undefined : value;\n }\n if ((node?.kind === SyntaxKind.PrefixUnaryExpression) && (node.operator === SyntaxKind.MinusToken)) {\n const operand = this.goSliceLiteralBound(node.operand);\n return (operand === undefined) ? undefined : -operand;\n }\n return undefined;\n }\n\n // the subscript for a string value, with the helper's own index arithmetic\n goSliceSubscript(value: string, start: number, hasEnd: boolean, end: number | undefined): string {\n const length = `len(${value})`;\n let startText;\n if (start >= 0) {\n startText = `${start}`;\n } else if (hasEnd) {\n startText = `${length} - ${-start}`;\n } else {\n startText = `max(${length} - ${-start}, 0)`;\n }\n if (!hasEnd) {\n return `${value}[${startText}:]`;\n }\n const endText = (end >= 0) ? `min(${end}, ${length})` : `${length} - ${-end}`;\n return `${value}[${startText}:${endText}]`;\n }\n\n // receiver of an inlinable `.slice(...)`: `string` prints a plain subscript and\n // `*string` a nil-guarded one, while anything else (an `any` box) keeps the helper.\n // A TS cast (`(id as string).slice(...)`) prints nothing, so it is transparent here.\n goSliceReceiverType(node): string | undefined {\n let receiverNode = node?.expression?.expression;\n while ((receiverNode?.kind === SyntaxKind.AsExpression) || (receiverNode?.kind === SyntaxKind.NonNullExpression)\n || (receiverNode?.kind === SyntaxKind.ParenthesizedExpression)) {\n receiverNode = receiverNode.expression;\n }\n if (receiverNode?.kind !== SyntaxKind.Identifier) {\n return undefined;\n }\n const goType = this.goPrintedTypeOfExpression(receiverNode, '');\n return ((goType === 'string') || (goType === '*string')) ? goType : undefined;\n }\n\n // the integer-literal bounds of a `.slice(a, b)` call; undefined when a bound is an\n // expression, whose Go value is not provably a non-negative int the subscript could take\n goSliceLiteralBounds(node): { start: number, hasEnd: boolean, end: number } | undefined {\n const args = node?.arguments ?? [];\n const start = this.goSliceLiteralBound(args[0]);\n if (start === undefined) {\n return undefined;\n }\n const hasEnd = args.length > 1;\n const end = hasEnd ? this.goSliceLiteralBound(args[1]) : undefined;\n if (hasEnd && (end === undefined)) {\n return undefined;\n }\n return { start, hasEnd, end };\n }\n\n // true when this `.slice(a, b)` call prints native Go slicing of a string value\n goIsNativeSliceCall(node): boolean {\n if (node?.kind !== SyntaxKind.CallExpression) {\n return false;\n }\n const callee: any = node.expression;\n if ((callee?.kind !== SyntaxKind.PropertyAccessExpression) || (callee.name?.text !== 'slice')) {\n return false;\n }\n if (this.goSliceReceiverType(node) === undefined) {\n return false;\n }\n return this.goSliceLiteralBounds(node) !== undefined;\n }\n\n // `x.slice(a, b)` -> `x[a:b]` when the receiver is a local the printer declares\n // `string` (or `*string`, which keeps the helper's nil -> \"\" branch as a guard) and\n // both bounds are integer literals. Any other bound or receiver keeps the helper.\n printInlineSlice(node, receiverText: string): string | undefined {\n if ((receiverText ?? '').includes('\\n')) {\n return undefined;\n }\n const goType = this.goSliceReceiverType(node);\n if (goType === undefined) {\n return undefined;\n }\n const bounds = this.goSliceLiteralBounds(node);\n if (bounds === undefined) {\n return undefined;\n }\n const { start, hasEnd, end } = bounds;\n if (goType === 'string') {\n return this.goSliceSubscript(receiverText, start, hasEnd, end);\n }\n const level = this.goStatementLevel;\n const body = this.getIden(level + 1);\n const branch = this.getIden(level + 2);\n const subscript = this.goSliceSubscript('str', start, hasEnd, end);\n return `func() string {\\n${body}if ${receiverText} == nil {\\n${branch}return \"\"\\n${body}}\\n${body}str := *${receiverText}\\n${body}return ${subscript}\\n${this.getIden(level)}}()`;\n }\n\n printSliceCall(node, identation, name = undefined, parsedArg = undefined, parsedArg2 = undefined) {\n parsedArg = this.goPrintCallArgument(node.arguments?.[0], parsedArg);\n parsedArg2 = this.goPrintCallArgument(node.arguments?.[1], parsedArg2);\n const nativeSlice = this.printInlineSlice(node, name);\n if (nativeSlice !== undefined) {\n return nativeSlice;\n }\n if (parsedArg2 === undefined){\n parsedArg2 = 'nil';\n }\n return `Slice(${name}, ${parsedArg}, ${parsedArg2})`;\n }\n\n printReplaceCall(node, identation, name = undefined, parsedArg = undefined, parsedArg2 = undefined) {\n // JS `replace` with a *string* pattern replaces the first occurrence only, which the\n // boxed helper (ReplaceAll for every argument) cannot express: with all three operands\n // proven strings, emit the count-1 form and the JS semantics exactly.\n return this.goNativeStringCallOr(node, [name, parsedArg, parsedArg2], ['string', 'string', 'string'],\n (o) => `strings.Replace(${o[0]}, ${o[1]}, ${o[2]}, 1)`, `Replace(${name}, ${parsedArg}, ${parsedArg2})`);\n }\n\n printReplaceAllCall(node, identation, name = undefined, parsedArg = undefined, parsedArg2 = undefined) {\n // `s.replaceAll (a, b)` replaces every occurrence, like the helper\n return this.goNativeStringCallOr(node, [name, parsedArg, parsedArg2], ['string', 'string', 'string'],\n (o) => `strings.ReplaceAll(${o[0]}, ${o[1]}, ${o[2]})`, `Replace(${name}, ${parsedArg}, ${parsedArg2})`);\n }\n\n printPadEndCall(node, identation, name, parsedArg, parsedArg2) {\n return `PadEnd(${name}, ${parsedArg}, ${parsedArg2})`;\n }\n\n printPadStartCall(node, identation, name, parsedArg, parsedArg2) {\n return `PadStart(${name}, ${parsedArg}, ${parsedArg2})`;\n }\n\n printDateNowCall(node, identation) {\n return \"DateNow()\";\n }\n\n printLengthProperty(node, identation, name = undefined) {\n const leftSide = this.printNode(node.expression, 0);\n // const type = (this.getChecker() as Checker).getTypeAtLocation(node.expression); // eslint-disable-line\n // this.warnIfAnyType(node, type.flags, leftSide, \"length\");\n return `GetLength(${leftSide})`;\n }\n\n // printPostFixUnaryExpression(node, identation) {\n // const {operand, operator} = node;\n // if (operand.kind === SyntaxKind.NumericLiteral) {\n // return super.printPostFixUnaryExpression(node, identation);\n // }\n // const leftSide = this.printNode(operand, 0);\n // const op = this.PostFixOperators[operator]; // todo: handle --\n // if (op === '--') {\n // return `postFixDecrement(ref ${leftSide})`;\n // }\n // return `postFixIncrement(ref ${leftSide})`;\n // }\n\n // printPrefixUnaryExpression(node, identation) {\n // const {operand, operator} = node;\n // if (operand.kind === SyntaxKind.NumericLiteral) {\n // return super.printPrefixUnaryExpression(node, identation);\n // }\n // if (operator === SyntaxKind.ExclamationToken) {\n // // not branch check falsy/turthy values if needed;\n // return this.PrefixFixOperators[operator] + this.printCondition(node.operand, 0);\n // }\n // const leftSide = this.printNode(operand, 0);\n // if (operator === SyntaxKind.PlusToken) {\n // return `prefixUnaryPlus(ref ${leftSide})`;\n // } else {\n // return `prefixUnaryNeg(ref ${leftSide})`;\n // }\n // }\n\n printConditionalExpression(node, identation) {\n const condition = this.goWithExprDepth(1, () => this.printCondition(node.condition, 0));\n if (!condition.includes('\\n')) {\n const whenTrue = this.goPrintTernaryBranch(node.whenTrue, 2);\n const whenFalse = this.goPrintTernaryBranch(node.whenFalse, 1);\n const inlined = this.printInlineTernary(condition, whenTrue, whenFalse, this.goTernaryResultType(node.whenTrue, whenTrue, node.whenFalse, whenFalse));\n if (inlined !== undefined) {\n return inlined;\n }\n }\n const whenTrue = this.printNode(node.whenTrue, 0);\n const whenFalse = this.printNode(node.whenFalse, 0);\n return `Ternary(${condition}, ${whenTrue}, ${whenFalse})`;\n }\n\n printDeleteExpression(node, identation) {\n const object = this.printNode (node.expression.expression, 0);\n const key = this.printNode (node.expression.argumentExpression, 0);\n return `Remove(${object}, ${key})`;\n }\n\n printThrowStatement(node, identation) {\n // const expression = this.printNode(node.expression, 0);\n // return this.getIden(node) + this.THROW_TOKEN + \" \" + expression + this.LINE_TERMINATOR;\n if (node.expression.kind === SyntaxKind.Identifier) {\n return this.getIden(identation) + 'panic(' + this.printNode(node.expression, 0) + ')' + this.LINE_TERMINATOR;\n }\n if (node.expression.kind === SyntaxKind.NewExpression) {\n const expression = node.expression;\n // handle throw new Error (Message)\n // and throw new x[a] (message)\n const argumentsExp = expression?.arguments ?? [];\n const parsedArg = argumentsExp.map(n => this.printNode(n, 0)).join(\",\") ?? '';\n const newExpression = this.printNode(expression.expression, 0);\n if (expression.expression.kind === SyntaxKind.Identifier) {\n // handle throw new X\n const id = expression.expression;\n const symbol = this.getChecker().getSymbolAtLocation(expression.expression);\n if (symbol) {\n const declarations = this.getChecker().getDeclaredTypeOfSymbol(symbol).getSymbol()?.declarations?.map((d) => d.resolve()) ?? [];\n const isClassDeclaration = declarations.find(l => l.kind === SyntaxKind.InterfaceDeclaration || l.kind === SyntaxKind.ClassDeclaration);\n if (isClassDeclaration){\n // return this.getIden(identation) + `${this.THROW_TOKEN} ${this.NEW_TOKEN} ${id.text} ((string)${parsedArg}) ${this.LINE_TERMINATOR}`;\n } else {\n // Go has no statement terminator: the two statements go on\n // their own lines (gofmt splits `a; b` exactly like this)\n return this.getIden(identation) + `throwDynamicException(${id.text}, ${parsedArg})\\n${this.getIden(identation)}return nil`;\n }\n }\n return this.getIden(identation) + `panic(${id.text}(${parsedArg}))${this.LINE_TERMINATOR}`;\n } else if (expression.expression.kind === SyntaxKind.ElementAccessExpression) {\n return this.getIden(identation) + `throwDynamicException(${newExpression}, ${parsedArg})`;\n }\n return super.printThrowStatement(node, identation);\n }\n // const newToken = this.NEW_TOKEN ? this.NEW_TOKEN + \" \" : \"\";\n // const newExpression = node.expression?.expression?.text;\n // // newExpression = newExpression ? newExpression : this.printNode(node.expression.expression, 0); // new Exception or new exact[string] check this out\n // // const args = node.expression?.arguments.map(n => this.printNode(n, 0)).join(\",\");\n // // const throwExpression = ` ${newToken}${newExpression}${this.LEFT_PARENTHESIS}((string)${args})${this.RIGHT_PARENTHESIS}`;\n // return this.getIden(identation) + this.THROW_TOKEN + throwExpression + this.LINE_TERMINATOR;\n }\n\n // -----------------------------------------------------------------------\n // gofmt-compatible spacing of the binary expressions this printer emits\n // -----------------------------------------------------------------------\n // go/printer (nodes.go) prints a binary expression with blanks around the\n // operator unless the expression sits deeper than the top level of a\n // statement: binaryExpr() asks cutoff() - which inspects the operator tree\n // through walkBinary() - and drops *both* blanks when the operator\n // precedence is below that cutoff. Level 4/5 operators (`+ - * / % & | ^\n // << >>`) therefore print as `a + b` at the top level but as `a+b`, `a[i+1]`\n // one level down; comparisons and `&&`/`||` (level 3 and below) always keep\n // their blanks.\n //\n // goExprDepth mirrors the depth go/printer tracks over the Go AST it is\n // about to emit: 1 at the start of every statement, +1 for an argument list\n // with more than one argument, +1 for an index expression, +1 for the right\n // operand of a binary expression, -1 inside parentheses (never below 1), and\n // back to 1 for composite literal elements.\n goExprDepth = 1;\n\n goWithExprDepth(depth: number, callback: () => T): T {\n const previous = this.goExprDepth;\n this.goExprDepth = depth < 1 ? 1 : depth;\n try {\n return callback();\n } finally {\n this.goExprDepth = previous;\n }\n }\n\n // go/token precedence of the operators this printer can print natively\n // (5 `* / % << >> & &^`, 4 `+ - | ^`, 3 comparisons, 2 `&&`, 1 `||`)\n goOperatorPrecedence(operator: string): number {\n switch (operator) {\n case '*': case '/': case '%': case '<<': case '>>': case '&': case '&^':\n return 5;\n case '+': case '-': case '|': case '^':\n return 4;\n case '==': case '!=': case '<': case '<=': case '>': case '>=':\n return 3;\n case '&&':\n return 2;\n case '||':\n return 1;\n }\n return 0;\n }\n\n // the operator string a node is printed as when it stays a Go binary\n // expression, or undefined when the node becomes a helper call or is not\n // binary at all - a primary expression, which walkBinary() never looks into\n goNativeBinaryOperator(node): string | undefined {\n if (!node || !isBinaryExpression(node)) {\n return undefined;\n }\n const kind = node.operatorToken.kind;\n if (kind === SyntaxKind.EqualsToken || kind === SyntaxKind.PlusEqualsToken ||\n kind === SyntaxKind.MinusEqualsToken || kind === SyntaxKind.InKeyword ||\n kind === SyntaxKind.InstanceOfKeyword || kind in this.binaryExpressionsWrappers) {\n return undefined;\n }\n const operator = this.SupportedKindNames[kind];\n return this.goOperatorPrecedence(operator) > 0 ? operator : undefined;\n }\n\n // walkBinary(): has4 / has5 / maxProblem of the operator tree that is about\n // to be printed. Operands that stay binary expressions are walked, every\n // other operand is a primary expression and stops the walk - the same\n // boundary go/printer draws for parens and calls.\n goWalkBinary(operator: string, left, right, rightText: string) {\n const precedence = this.goOperatorPrecedence(operator);\n let has4 = precedence === 4;\n let has5 = precedence === 5;\n let maxProblem = 0;\n const walk = (childOperator: string, child) => {\n const info = this.goWalkBinary(childOperator, child.left, child.right, '');\n has4 = has4 || info.has4;\n has5 = has5 || info.has5;\n maxProblem = Math.max(maxProblem, info.maxProblem);\n };\n const leftOperator = this.goNativeBinaryOperator(left);\n if (leftOperator !== undefined && this.goOperatorPrecedence(leftOperator) >= precedence) {\n walk(leftOperator, left);\n }\n const rightOperator = this.goNativeBinaryOperator(right);\n if (rightOperator !== undefined && this.goOperatorPrecedence(rightOperator) > precedence) {\n walk(rightOperator, right);\n } else if (rightOperator === undefined) {\n // `/*`, `&&`, `&^` and the `+ +` / `- -` pairs must keep a blank so\n // that the two tokens cannot glue into a different operator\n const pair = operator + rightText.replace(/^[ \\t]+/, '').slice(0, 1);\n if (pair === '/*' || pair === '&&' || pair === '&^') {\n maxProblem = 5;\n } else if (pair === '++' || pair === '--') {\n maxProblem = Math.max(maxProblem, 4);\n }\n }\n return { has4, has5, maxProblem };\n }\n\n // the separator gofmt puts around a natively printed operator: `' '` keeps\n // the blanks, `''` drops them (go/printer cutoff())\n goBinarySeparator(operator: string, rightText: string, left, right): string {\n const precedence = this.goOperatorPrecedence(operator);\n if (precedence < 4) {\n // level 3 and below always keep both blanks\n return ' ';\n }\n const { has4, has5, maxProblem } = this.goWalkBinary(operator, left, right, rightText);\n let cutoff;\n if (maxProblem > 0) {\n cutoff = maxProblem + 1;\n } else if (has4 && has5) {\n cutoff = this.goExprDepth === 1 ? 5 : 4;\n } else {\n cutoff = this.goExprDepth === 1 ? 6 : 4;\n }\n return precedence < cutoff ? ' ' : '';\n }\n\n printBinaryExpression(node, identation) {\n\n const {left, right, operatorToken} = node;\n\n const customBinaryExp = this.printCustomBinaryExpressionIfAny(node, identation);\n if (customBinaryExp) {\n return customBinaryExp;\n }\n\n if (operatorToken.kind == SyntaxKind.InstanceOfKeyword) {\n return this.printInstanceOfExpression(node, identation);\n }\n\n if (operatorToken.kind === SyntaxKind.EqualsToken) {\n const pointerWrite = this.goPointerWriteText(node, identation);\n if (pointerWrite !== undefined) {\n return pointerWrite;\n }\n // handle test['a'] = 1;\n const elementAccess = left;\n const rightSide = this.goWithExprDepth(this.goExprDepth + 1, () => this.printNode(right, 0));\n if (left.kind === SyntaxKind.ElementAccessExpression) {\n const leftSide = this.printNode(elementAccess.expression, 0);\n const propName = this.printNode(elementAccess.argumentExpression, 0);\n const value = this.goWithExprDepth(this.goExprDepth + 1, () => this.printNode(right, identation)).trimStart();\n const native = this.printNativeElementAssignment(elementAccess.expression, leftSide, elementAccess.argumentExpression, propName, value, false, right);\n if (native !== undefined) {\n return native;\n }\n return `AddElementToObject(${leftSide}, ${propName}, ${value})`;\n }\n\n if (right?.kind === SyntaxKind.AwaitExpression || rightSide.startsWith('<-this.callInternal')) {\n const leftParsed = this.printNode(left, 0);\n // the awaited call can carry a multi-line object literal argument: printing it\n // at the statement's own level keeps that literal one level deeper\n const awaited = (right?.kind === SyntaxKind.AwaitExpression)\n ? this.printNode(right, identation)\n : rightSide;\n return `\n${this.getIden(identation)}${leftParsed} = ${awaited}\n${this.getIden(identation)}PanicOnError(${leftParsed})`;\n }\n }\n\n const op = operatorToken.kind;\n // handle: [x,d] = this.method()\n if (op === SyntaxKind.EqualsToken && left.kind === SyntaxKind.ArrayLiteralExpression) {\n const arrayBindingPatternElements = left.elements;\n const parsedArrayBindingElements = arrayBindingPatternElements.map((e) => this.printNode(e, 0));\n const syntheticName = parsedArrayBindingElements.join(\"\") + \"Variable\";\n\n let arrayBindingStatement = `${syntheticName} := ${this.printNode(right, 0)}\\n`;\n\n parsedArrayBindingElements.forEach((e, index) => {\n // const type = this.getType(node);\n // const parsedType = this.getTypeFromRawType(type);\n const leftElement = arrayBindingPatternElements[index];\n const leftType = this.getChecker().getTypeAtLocation(leftElement);\n const parsedType = this.getTypeFromRawType(leftType);\n\n const castExp = parsedType ? `(${parsedType})` : \"\";\n\n // const statement = this.getIden(identation) + `${e} = (${castExp}((List)${syntheticName}))[${index}]`;\n const statement = this.getIden(identation) + (this.goGetArgBindsDictElement(leftElement, right, index)\n ? `${e} = MapTyped(GetValue(${syntheticName}, ${index}))`\n : `${e} = GetValue(${syntheticName}, ${index})`);\n if (index < parsedArrayBindingElements.length - 1) {\n arrayBindingStatement += statement + \"\\n\";\n } else {\n arrayBindingStatement += statement;\n }\n });\n\n return arrayBindingStatement;\n }\n\n let operator = this.SupportedKindNames[operatorToken.kind];\n\n\n let leftVar = undefined;\n let rightVar = undefined;\n\n // c# wrapper\n if (operatorToken.kind === SyntaxKind.EqualsEqualsToken || operatorToken.kind === SyntaxKind.EqualsEqualsEqualsToken) {\n if (this.COMPARISON_WRAPPER_OPEN) {\n leftVar = this.printNode(left, 0);\n rightVar = this.printNode(right, identation);\n return `${this.COMPARISON_WRAPPER_OPEN}${leftVar}, ${rightVar}${this.COMPARISON_WRAPPER_CLOSE}`;\n }\n }\n\n // check if boolean operators || and && because of the falsy values\n if (operatorToken.kind === SyntaxKind.BarBarToken || operatorToken.kind === SyntaxKind.AmpersandAmpersandToken) {\n leftVar = this.printCondition(left, 0);\n rightVar = this.printCondition(right, identation);\n if (operatorToken.kind === SyntaxKind.AmpersandAmpersandToken) {\n // `x !== undefined && x === 'v'` inlines to `(x != nil) && (x != nil && *x == \"v\")`.\n // The right operand already guards nil, so the left test is provably\n // implied — `go vet` reports it as a redundant and. Dropping it keeps\n // the exact same value (Go && is short-circuiting, both sides pure).\n const collapsed = this.goDropRedundantNilGuard(leftVar.trim(), rightVar.trim());\n if (collapsed !== undefined) {\n return collapsed;\n }\n }\n } else {\n // go/printer prints the left operand of a binary expression at the\n // depth of the parent plus diffPrec() - 0 only when it is a binary\n // expression of the very same precedence - and the right operand one\n // level deeper. An operator that is not binary in Go (the assignment\n // `=`, or a compound assignment) prints both sides at their own level.\n const precedence = this.goOperatorPrecedence(operator);\n if (precedence > 0) {\n const leftOperator = this.goNativeBinaryOperator(left);\n const samePrecedence = leftOperator !== undefined && this.goOperatorPrecedence(leftOperator) === precedence;\n const leftDepth = samePrecedence ? this.goExprDepth : this.goExprDepth + 1;\n leftVar = this.goWithExprDepth(leftDepth, () => this.printNode(left, 0));\n rightVar = this.goWithExprDepth(this.goExprDepth + 1, () => this.printNode(right, identation));\n } else {\n leftVar = this.printNode(left, 0);\n rightVar = this.printNode(right, identation);\n }\n }\n\n const customOperator = this.getCustomOperatorIfAny(left, right, operatorToken);\n\n operator = customOperator ? customOperator : operator;\n\n const separator = this.goBinarySeparator(operator, rightVar.trim(), left, right);\n\n return leftVar + separator + operator + separator + rightVar.trim();\n }\n\n // `(x != nil) && (x != nil && …)` -> `(x != nil && …)`. Only fires when the\n // right operand opens with the very same nil guard the left operand *is*, so\n // the left is implied and dropping it cannot change the result.\n goDropRedundantNilGuard(leftVar: string, rightVar: string): string | undefined {\n const guard = /^\\(([A-Za-z_]\\w*) != nil\\)$/.exec(leftVar);\n if (guard === null) {\n return undefined;\n }\n if (rightVar.startsWith(`(${guard[1]} != nil && `)) {\n return rightVar;\n }\n return undefined;\n }\n\n printTryStatement(node, identation: number) {\n // const tryBody = this.printNode(node.tryBlock, 0);\n\n let tryBody = node.tryBlock.statements.map((s) => {\n return this.printNode(s, identation + 1);\n }).join(\"\\n\");\n tryBody = tryBody.replaceAll(/(\\s*)break\\s*$/gm, \"$1panic(\\\"break\\\")\"); // to do do thing regex-based\n\n // const catchBody = this.printNode(node.catchClause.block, 0);\n const catchBody = node.catchClause.block.statements.map((s) => this.printNode(s, identation + 1)).join(\"\\n\");\n\n const bodyEndsWithReturn = (body: string, statements) => {\n const lines = body.split(\"\\n\").map(l => l.trim()).filter(Boolean);\n const lastLine = lines.length ? lines[lines.length - 1] : \"\";\n return lastLine.startsWith(\"return\") || lastLine.startsWith(\"panic\") || lastLine.startsWith(\"throw new\")\n || this.blockEndsWithConditionalReturn(statements);\n };\n const catchBodyEndsWithReturn = bodyEndsWithReturn(catchBody, node.catchClause.block.statements);\n const tryBodyEndsWithReturn = bodyEndsWithReturn(tryBody, node.tryBlock.statements);\n\n const returNil = \"return nil\";\n const isVoid = this.isInsideVoidFunction(node);\n\n const nodeEndsWithReturn = tryBodyEndsWithReturn && catchBodyEndsWithReturn && !isVoid;\n const errorName = node.catchClause.variableDeclaration.name.text;\n const classPrefix = this.className !== 'undefined' ? `(this *${this.className})` : \"()\";\n const thisWord = this.className !== 'undefined' ? \"this\" : \"\";\n // the printer indents statements with getIden(); the bodies embedded below are\n // re-placed at their own explicit level so the template only carries the levels\n // *inside* the block (the enclosing getIden(identation) lands on every line)\n const catchBodyBlock = this.indentBlock (catchBody, \"\t\t\t\t\t\");\n const tryBodyBlock = this.indentBlock (tryBody, \"\t\t\");\n const catchBlock =`\n{\n\t${nodeEndsWithReturn ? 'ret__ := ' : ''}func${classPrefix} (ret_ any) {\n\t\tdefer func() {\n\t\t\tif ${errorName} := recover(); ${errorName} != nil {\n\t\t\t\tif ${errorName} == \"break\" {\n\t\t\t\t\treturn\n\t\t\t\t}\n\t\t\t\tret_ = func${classPrefix} any {\n\t\t\t\t\t// catch block:\n${catchBodyBlock}\n\t\t\t\t\t${catchBodyEndsWithReturn ? \"\" : returNil}\n\t\t\t\t}(${thisWord})\n\t\t\t}\n\t\t}()\n\t\t// try block:\n${tryBodyBlock}\n\t\t${tryBodyEndsWithReturn ? \"\" : returNil}\n\t}(${thisWord})\n\t${nodeEndsWithReturn\n ? `if ret__ != nil {\n\t\treturn ret__\n\t}\n\treturn nil`\n : ''}\n}`;\n // add identation to every line; a line that is left blank (the conditional\n // entries above emit nothing, and the block opens on a fresh line) stays\n // empty because gofmt trims trailing whitespace\n const indentedBlock = catchBlock.split(\"\\n\")\n .map((line) => line.trim().length ? this.getIden(identation) + line : \"\")\n .join(\"\\n\");\n // const catchCondOpen = this.CONDITION_OPENING ? this.CONDITION_OPENING : \" \";\n\n return indentedBlock;\n }\n\n /**\n * Strip the printer's own leading indentation from every line of a printed\n * statement block so the caller can re-place it at an explicit level. Only the\n * common prefix goes away: relative nesting (one tab per level) is preserved.\n */\n dedentBlock (block: string) {\n const lines = block.split(\"\\n\");\n const indents = lines\n .filter((line) => line.trim().length > 0)\n .map((line) => (line.match(/^[\\t ]*/) as RegExpMatchArray)[0].length);\n const common = indents.length ? Math.min(...indents) : 0;\n return lines.map((line) => line.slice(common)).join(\"\\n\");\n }\n\n /**\n * Re-place a printed statement block at `level` (a run of tabs): the block's own\n * leading indentation is dropped and every non-blank line is prefixed with `level`,\n * so relative nesting (one tab per level) survives the move.\n */\n indentBlock (block: string, level: string) {\n return this.dedentBlock (block)\n .split(\"\\n\")\n .map((line) => line.trim().length ? level + line : \"\")\n .join(\"\\n\");\n }\n\n /**\n * gofmt writes blank lines with no whitespace at all. A multi-line statement template\n * opens on a fresh line, so the inherited `getIden(identation) + ` prefix\n * lands on a line that carries nothing else: drop that prefix instead of leaving a\n * whitespace-only line behind. Only blank lines are touched, never printed content.\n */\n stripWhitespaceOnlyLines (block: string) {\n return block.split(\"\\n\").map((line) => line.trim().length ? line : \"\").join(\"\\n\");\n }\n\n printPrefixUnaryExpression(node, identation) {\n const {operand, operator} = node;\n if (operator === SyntaxKind.ExclamationToken) {\n // not branch check falsy/turthy values if needed;\n return this.getIden(identation) + this.PrefixFixOperators[operator] + this.printCondition(node.operand, 0);\n }\n if (operator === SyntaxKind.MinusToken) {\n const printed = this.printNode(node.operand, 0);\n const inlined = this.printInlineOpNeg(node, printed);\n if (inlined !== undefined) {\n return this.getIden(identation) + inlined;\n }\n return this.getIden(identation) + `OpNeg(${printed})`;\n }\n return this.getIden(identation) + this.PrefixFixOperators[operator] + this.printNode(operand, 0);\n }\n\n printNewExpression(node, identation) {\n let expression = node.expression?.text;\n expression = expression ? expression : this.printNode(node.expression); // new Exception or new exact[string] check this out\n if (node.arguments.length === 0) {\n return `New${this.capitalize(expression)}()`;\n }\n // an argument printer may prepend the statement indent (parenthesised casts do);\n // inside the call the argument is inline, so trim it like printArgsForCallExpression\n const args = node.arguments.map(n => this.printNode(n, identation).trim()).join(\", \");\n if (expression.endsWith('Error')) {\n return expression + this.LEFT_PARENTHESIS + args + this.RIGHT_PARENTHESIS;\n }\n return 'New' + this.capitalize(expression) + this.LEFT_PARENTHESIS + args + this.RIGHT_PARENTHESIS;\n }\n\n /**\n * Override the default element-access printer with a version that walks the\n * entire `x[y][z]` chain and builds a properly nested sequence of helper\n * calls. This removes the root cause of the unbalanced-parenthesis bug\n * without any post-processing or regex hacks.\n */\n // The Go static type of `printed` when the printer can name it as a native Go\n // map or slice, undefined while the value stays boxed in `any` (GetValue,\n // Ternary, a parameter, an untyped struct field). Only initializer shapes the\n // printer itself types — object/array literals, helper calls whose Go return\n // type it knows (GO_HELPER_RETURN_TYPES + the ccxt extension), and locals whose\n // declaration got that same concrete type — are reported.\n goIndexableTypeOf(node, printed: string): string | undefined {\n if (node === undefined) {\n return undefined;\n }\n switch (node.kind) {\n // a type assertion prints as its operand (printAsExpression hands the operand\n // back), so the operand's Go type still governs the read: `(this.fees as Dict)['x']`\n // is the element access on `this.fees`, whose Go type decides the index\n case SyntaxKind.ParenthesizedExpression:\n case SyntaxKind.AsExpression:\n return this.goIndexableTypeOf(node.expression, printed);\n case SyntaxKind.ObjectLiteralExpression:\n return 'map[string]any';\n case SyntaxKind.ArrayLiteralExpression:\n return '[]any';\n case SyntaxKind.CallExpression:\n return this.goTypeOfInitializer(node, printed);\n case SyntaxKind.Identifier:\n return this.goDeclaredTypeOfIdentifier(node) ?? this.g01MapParamType(node);\n }\n return undefined;\n }\n\n // the leftover chain after the first (native) step, still helper-wrapped:\n // `m[\"a\"][\"b\"][\"c\"]` prints `GetValue(GetValue(m[\"a\"], \"b\"), \"c\")`\n goElementAccessChain(containerStr: string, keyStrs: string[]) {\n let acc = containerStr;\n for (let i = 1; i < keyStrs.length; i++) {\n acc = `${this.ELEMENT_ACCESS_WRAPPER_OPEN}${acc}, ${keyStrs[i]}${this.ELEMENT_ACCESS_WRAPPER_CLOSE}`;\n }\n return acc;\n }\n\n // the container of a nested `m[\"a\"][\"b\"] = v` write, for all but the last key: its first step is a\n // plain read, so a receiver typed as a map indexes natively and only `any` steps keep the helper.\n // A missing key or nil map reads nil in both forms; a non-map container is a no-op either way.\n goElementWriteChain(baseExpr, containerStr: string, keyNodes, keyStrs: string[]): string {\n let acc = containerStr;\n let first = 0;\n if ((keyStrs.length > 1) && (this.goIndexableTypeOf(baseExpr, containerStr) === 'map[string]any')\n && this.goKeyIsString(keyNodes[0], keyStrs[0])) {\n acc = `${containerStr}[${keyStrs[0]}]`;\n first = 1;\n }\n for (let i = first; i < keyStrs.length - 1; i++) {\n acc = `${this.ELEMENT_ACCESS_WRAPPER_OPEN}${acc}, ${keyStrs[i]}${this.ELEMENT_ACCESS_WRAPPER_CLOSE}`;\n }\n return acc;\n }\n\n // true when the printed key is a Go string, so `m[key]` reads the map with the\n // same key GetValue resolves for a string operand (GetValue parses a non-string\n // key, which on map[string]any just yields nil)\n goKeyIsString(node, printed: string) {\n if (node === undefined) {\n return false;\n }\n switch (node.kind) {\n case SyntaxKind.StringLiteral:\n case SyntaxKind.NoSubstitutionTemplateLiteral:\n return true;\n case SyntaxKind.ParenthesizedExpression:\n case SyntaxKind.AsExpression:\n return this.goKeyIsString(node.expression, printed);\n case SyntaxKind.Identifier:\n return this.goDeclaredTypeOfIdentifier(node) === 'string';\n case SyntaxKind.CallExpression:\n return this.goTypeOfInitializer(node, printed) === 'string';\n }\n return false;\n }\n\n // true when the printed key is a Safe*-boxed string: an identifier declared `*string`,\n // i.e. a nilable Go pointer. The native read needs GetValue's `*` deref and its nil\n // answer, neither of which an index expression expresses.\n goIsDerefStringKeyExpression(node): boolean {\n return (node?.kind === SyntaxKind.Identifier) && (this.goDeclaredTypeOfIdentifier(node) === '*string');\n }\n\n // the nil-guarded native read of a declared map with a `*string` key, reproducing GetValue's key\n // deref: a nil key reads nil, otherwise the map index (missing key is the `any` nil). gofmt keeps\n // a func literal holding an `if` on its own lines, so the guard sits at the statement's level.\n printNilGuardedMapIndex(containerStr: string, keyStr: string): string {\n const level = this.goStatementLevel;\n const body = this.getIden(level + 1);\n return `func() any {\\n${body}if ${keyStr} == nil {\\n${this.getIden(level + 2)}return nil\\n${body}}\\n${body}return ${containerStr}[*${keyStr}]\\n${this.getIden(level)}}()`;\n }\n\n // true for `this.` — the one property-access shape whose Go type the\n // printer itself cannot name (the fields live in the hand-written Go structs)\n isGoThisPropertyAccessExpression(node) {\n return (node?.kind === SyntaxKind.PropertyAccessExpression)\n && (node.expression?.kind === SyntaxKind.ThisKeyword);\n }\n\n // true when the element access is the target of an assignment: the binary\n // expression printer owns that shape (AddElementToObject / rewritten GetValue\n // chains), a native `x[k]` index there would drop the write\n isGoElementAccessAssignmentTarget(node) {\n const parent = node.parent;\n return (parent?.kind === SyntaxKind.BinaryExpression) && (parent.left === node)\n && ((parent.operatorToken.kind === SyntaxKind.EqualsToken) || (parent.operatorToken.kind === SyntaxKind.PlusEqualsToken));\n }\n\n // the key of a native list read: its printed Go type must be `int` for the guard's two\n // comparisons to compile, and the key expression is printed twice (the bounds test and the\n // index), so a call operand — evaluated twice — is rejected. Every other key keeps GetValue.\n goIntIndexExpression(node): boolean {\n switch (node?.kind) {\n case SyntaxKind.NumericLiteral: {\n const text = `${node.text ?? ''}`;\n return /^\\d+$/.test(text);\n }\n case SyntaxKind.ParenthesizedExpression:\n return this.goIntIndexExpression(node.expression);\n case SyntaxKind.PrefixUnaryExpression:\n return (node.operator === SyntaxKind.MinusToken) && this.goIntIndexExpression(node.operand);\n case SyntaxKind.Identifier:\n return this.goIntOperandIdentifier(node);\n case SyntaxKind.BinaryExpression: {\n const op = node.operatorToken?.kind;\n if ((op === SyntaxKind.PlusToken) || (op === SyntaxKind.MinusToken)\n || (op === SyntaxKind.AsteriskToken) || (op === SyntaxKind.PercentToken)) {\n return this.goIntIndexExpression(node.left) && this.goIntIndexExpression(node.right);\n }\n return false;\n }\n }\n return false;\n }\n\n // true for an identifier the printer emits as a Go int: a local it declared `int`, and a\n // `for (let i = 0; …)` counter, which prints `for i := 0` and is inferred as `int`\n goIntOperandIdentifier(node): boolean {\n if (this.goDeclaredTypeOfIdentifier(node) === 'int') {\n return true;\n }\n const checker: any = this.checkerOrUndefined();\n if (checker === undefined) {\n return false;\n }\n const symbol = checker.getSymbolAtLocation(node);\n const declaration: any = symbol?.valueDeclaration?.resolve();\n if ((declaration?.kind !== SyntaxKind.VariableDeclaration) || (declaration.initializer === undefined)) {\n return false;\n }\n const list: any = declaration.parent;\n const loop: any = list?.parent;\n if ((list?.kind !== SyntaxKind.VariableDeclarationList) || (list.declarations?.length !== 1)\n || (loop?.kind !== SyntaxKind.ForStatement) || (loop.initializer !== list)) {\n return false;\n }\n const text = `${declaration.initializer.text ?? ''}`;\n return (declaration.initializer.kind === SyntaxKind.NumericLiteral) && /^\\d+$/.test(text);\n }\n\n // true when this identifier is a local the printer declared []any because it was unboxed\n // from a `this.SafeList` accessor. Only that family carried the first guarded element read;\n // the declared-type arm below is the D-06 widening.\n goSafeListUnboxIdentifier(node): boolean {\n const checker: any = this.checkerOrUndefined();\n if (checker === undefined) {\n return false;\n }\n const symbol = checker.getSymbolAtLocation(node);\n const declaration: any = symbol?.valueDeclaration?.resolve();\n return (declaration?.kind === SyntaxKind.VariableDeclaration)\n && (this.goSafeListLocalUnbox(declaration) === GO_SAFE_LIST_LOCAL_TYPE);\n }\n\n // true when the identifier's printed Go declaration is a `[]any` slice: the SafeList family\n // above, or any other local/param the declared-type table proved a slice (a slice literal,\n // a `[]any`-returning accessor, a slice param the typed-param family registers). All of them\n goDeclaredListIdentifier(node): boolean {\n return (this.goDeclaredTypeOfIdentifier(node) === GO_SAFE_LIST_LOCAL_TYPE)\n || this.goSafeListUnboxIdentifier(node);\n }\n\n // `x[k]` on a local the printer declared []any is a slice index: GetValue answered nil for an\n // absent index (negative or out of range) and derefs a pointer element, so the native read is\n // the same index behind that guard. Only a key printed as an `int` carries it; every other\n goNativeListElementRead(node, containerStr: string, keyNode, keyStr: string): string | undefined {\n if (containerStr.includes('\\n') || keyStr.includes('\\n')) {\n return undefined;\n }\n if (this.isGoElementAccessAssignmentTarget(node) || !this.goIntIndexExpression(keyNode)) {\n return undefined;\n }\n const level = this.goStatementLevel;\n const body = this.getIden(level + 1);\n return `func() any {\\n${body}if ${keyStr} >= 0 && ${keyStr} < len(${containerStr}) {\\n${this.getIden(level + 2)}return DerefScalar(${containerStr}[${keyStr}])\\n${body}}\\n${body}return nil\\n${this.getIden(level)}}()`;\n }\n\n printElementAccessExpression(node, identation) {\n // Maintain original special-case handling first.\n const special = this.printElementAccessExpressionExceptionIfAny(node);\n if (special) {\n return special;\n }\n\n // Always process element access expressions the same way\n // The binary expression handler will override this for assignments\n\n // For right-side access, build the full nested chain\n const keys: any[] = [];\n let baseExpr = null;\n let current = node as any;\n // Walk down while the *expression* is another ElementAccessExpression.\n while (isElementAccessExpression(current)) {\n keys.unshift(current.argumentExpression); // prepend\n const expr = current.expression;\n if (!isElementAccessExpression(expr)) {\n // Reached the base container.\n baseExpr = expr;\n break;\n }\n current = expr;\n }\n\n // go/printer prints the base of an index expression at depth 1 and the\n // index itself one level deeper; GetValue(base, key) is a two-argument\n // call, so both operands sit one level below the current expression\n const indexDepth = this.goExprDepth + 1;\n const containerStr = this.goWithExprDepth(indexDepth, () => this.printNode(baseExpr, 0));\n const keyStrs = keys.map(k => this.goWithExprDepth(indexDepth, () => this.printNode(k, 0)));\n\n // GetValue(m, \"k\") is a read of a Go map[string]any already: a missing key\n // and a nil element both come back as the `any` nil, so the native index\n // yields the identical value without the helper call\n if (this.goIndexableTypeOf(baseExpr, containerStr) === 'map[string]any') {\n if (this.goKeyIsString(keys[0], keyStrs[0]) && !this.isGoElementAccessAssignmentTarget(node)\n && !this.goMarketComparisonElementRead(node)) {\n return this.goElementAccessChain(`${containerStr}[${keyStrs[0]}]`, keyStrs);\n }\n // a Safe*-boxed string key holds a nilable `*string`, so the read needs the\n // helper's nil answer and deref around the same map index. A multi-line\n // receiver cannot carry the guard's own indentation, so it keeps the helper.\n if (this.goIsDerefStringKeyExpression(keys[0]) && !containerStr.includes('\\n')\n && !this.isGoElementAccessAssignmentTarget(node)) {\n return this.goElementAccessChain(this.printNilGuardedMapIndex(containerStr, keyStrs[0]), keyStrs);\n }\n }\n\n // Now build nested helpers.\n let acc = containerStr;\n keyStrs.forEach(k => {\n acc = `${this.ELEMENT_ACCESS_WRAPPER_OPEN}${acc}, ${k}${this.ELEMENT_ACCESS_WRAPPER_CLOSE}`;\n });\n\n // a local the printer declared []any — either unboxed from a `this.SafeList` accessor or\n // named []any by the declared-type table — is a slice, so an element read with a key it\n // prints as an int is the guarded native index (see goNativeListElementRead)\n if ((baseExpr?.kind === SyntaxKind.Identifier) && this.goDeclaredListIdentifier(baseExpr)) {\n const nativeRead = this.goNativeListElementRead(node, containerStr, keys[0], keyStrs[0]);\n if (nativeRead !== undefined) {\n return this.goElementAccessChain(nativeRead, keyStrs);\n }\n }\n\n return acc;\n }\n\n isInsideVoidFunction(node: Node): boolean {\n for (let cur = node.parent; cur; cur = cur.parent) {\n if (isFunctionLike(cur)) {\n return (cur as any).type === undefined || (cur as any).type.kind === SyntaxKind.VoidKeyword;\n }\n }\n return true; // default-to-void if uncertain\n }\n\n /**\n * Check if a block or statement contains a return statement or throws an error\n */\n hasReturnInBlock(statement: Statement): boolean {\n if (isBlock(statement)) {\n // A sequence of statements returns on all control paths if the last statement returns on all control paths\n if (statement.statements.length === 0) {\n return false;\n }\n return this.hasReturnInBlock(statement.statements[statement.statements.length - 1]);\n } else if (isReturnStatement(statement)) {\n return true;\n } else if (isThrowStatement(statement)) {\n return true;\n } else if (isIfStatement(statement)) {\n // An if statement returns on all control paths if both the \"if\" and \"else\" branches return on all control paths\n const ifHasReturn = this.hasReturnInBlock(statement.thenStatement);\n if (statement.elseStatement) {\n const elseHasReturn = this.hasReturnInBlock(statement.elseStatement);\n return ifHasReturn && elseHasReturn;\n }\n return false; // No else statement, so execution can continue\n } else if (isTryStatement(statement)) {\n // A try statement returns on all control paths if both try and catch blocks return on all control paths\n const tryHasReturn = this.hasReturnInBlock(statement.tryBlock);\n const catchHasReturn = this.hasReturnInBlock(statement.catchClause.block);\n return tryHasReturn && catchHasReturn;\n }\n return false;\n }\n\n /**\n * Check if the last statement in a block is a conditional with returns in all branches\n */\n blockEndsWithConditionalReturn(statements: NodeArray): boolean {\n if (statements.length === 0) {\n return false;\n }\n\n // an if (with an else) or a try returning on every path: hasReturnInBlock's own rules for both\n const lastStatement = statements[statements.length - 1];\n return (isIfStatement(lastStatement) || isTryStatement(lastStatement)) && this.hasReturnInBlock(lastStatement);\n }\n\n // hx4 G01\n // a defaulted parameter bound through GetArgMap is a Go map[string]any; an element read of it\n // indexes natively only where g01ReadOk proves the deref-free read answers what GetValue did\n g01MapParamType(node): string | undefined {\n const checker: any = this.checkerOrUndefined();\n if (checker === undefined) {\n return undefined;\n }\n let decl: any;\n try {\n decl = checker.getSymbolAtLocation(node)?.valueDeclaration?.resolve();\n } catch (e) {\n return undefined;\n }\n if ((decl?.kind !== SyntaxKind.Parameter) || (this.goGetArgParameterType(decl) !== 'map[string]any')) {\n return undefined;\n }\n const access: any = node.parent;\n if ((access?.kind === SyntaxKind.ElementAccessExpression) && (access.expression === node)\n && (this.g01ReadOk(node, access) !== 'map[string]any')) {\n return undefined;\n }\n return 'map[string]any';\n }\n\n // `receiver[k]` may replace GetValue(receiver, k) on a declared map[string]any: literal key, not a\n // compared operand, not an element-write value (the ccxt write pass proves those from the helper\n // spelling), and a market row or a consumer that derefScalars the value as GetValue did\n g01ReadOk(receiver, access): string | undefined {\n if (this.goIsComparedOperand(access) || this.g01IsWriteValue(access) || !this.g01LiteralKey(access.argumentExpression)) {\n return undefined;\n }\n return (this.g01MarketRow(receiver) || this.x02CurrencyRow(receiver) || this.g01DerefConsumer(access)) ? 'map[string]any' : undefined;\n }\n\n // a string literal or a non-negative integer literal key\n g01LiteralKey(key): boolean {\n return (key?.kind === SyntaxKind.StringLiteral) || (key?.kind === SyntaxKind.NoSubstitutionTemplateLiteral)\n || ((key?.kind === SyntaxKind.NumericLiteral) && /^\\d+$/.test(`${key.text ?? ''}`));\n }\n\n // `y[k] = x[\"lit\"]`\n g01IsWriteValue(access): boolean {\n let operand: any = access;\n while (operand.parent?.kind === SyntaxKind.ParenthesizedExpression) {\n operand = operand.parent;\n }\n const parent: any = operand.parent;\n return (parent?.kind === SyntaxKind.BinaryExpression) && (parent.right === operand)\n && (parent.operatorToken?.kind === SyntaxKind.EqualsToken) && (parent.left?.kind === SyntaxKind.ElementAccessExpression);\n }\n\n // a Market-typed local written only by `this.market (…)` (or undefined): that accessor returns\n // MarketTyped rows, whose values derefScalar leaves unchanged. Currency rows can hold *string values.\n g01MarketRow(node): boolean {\n let type: any;\n try {\n type = this.getChecker().getTypeAtLocation(node);\n } catch (e) {\n return false;\n }\n const names = [ type?.aliasSymbol?.name, type?.symbol?.name ];\n if (!names.some((n) => [ 'Market', 'MarketInterface' ].includes(n))) {\n return false;\n }\n const declaration = this.goDeclarationOfIdentifier(node);\n const scope: any = (declaration === undefined) ? undefined : this.goEnclosingFunction(declaration);\n if (scope === undefined) {\n return false;\n }\n const isRow = (v: any) => (v === undefined) || ((v.kind === SyntaxKind.Identifier) && (v.text === 'undefined'))\n || ((v.kind === SyntaxKind.CallExpression) && (v.expression?.kind === SyntaxKind.PropertyAccessExpression)\n && (v.expression.expression?.kind === SyntaxKind.ThisKeyword) && (v.expression.name?.text === 'market'));\n let ok = isRow(declaration.initializer);\n const name = declaration.name?.text;\n const visit = (n: any) => {\n if (!ok) {\n return;\n }\n if ((n.kind === SyntaxKind.BinaryExpression) && (n.left?.kind === SyntaxKind.Identifier) && (n.left.text === name)\n && (n.operatorToken?.kind === SyntaxKind.EqualsToken) && this.goIdentifierRefersToDeclaration(n.left, declaration)) {\n ok = isRow(n.right);\n } else if ((n.kind === SyntaxKind.ArrayLiteralExpression) && (n.parent?.kind === SyntaxKind.BinaryExpression) && (n.parent.left === n)\n && n.elements.some((e: any) => (e.kind === SyntaxKind.Identifier) && (e.text === name))) {\n ok = false;\n }\n n.forEachChild(visit);\n };\n scope.forEachChild(visit);\n return ok;\n }\n\n // the read is the container of an enclosing element read, an operand of `in`, or an argument of a\n // SafeValueN-backed accessor (or safeCurrencyCode): each derefScalars it, so GetValue's deref is redundant\n g01DerefConsumer(access): boolean {\n let operand: any = access;\n while (operand.parent?.kind === SyntaxKind.ParenthesizedExpression) {\n operand = operand.parent;\n }\n const parent: any = operand.parent;\n if ((parent?.kind === SyntaxKind.ElementAccessExpression) && (parent.expression === operand)) {\n return !this.isGoElementAccessAssignmentTarget(parent);\n }\n if ((parent?.kind === SyntaxKind.BinaryExpression) && (parent.operatorToken?.kind === SyntaxKind.InKeyword)) {\n return true;\n }\n const callee: any = parent?.expression;\n return (parent?.kind === SyntaxKind.CallExpression) && (parent.arguments.indexOf(operand) >= 0)\n && (callee?.kind === SyntaxKind.PropertyAccessExpression) && (callee.expression?.kind === SyntaxKind.ThisKeyword)\n && /^(?:safe(?:Value|String|StringLower|StringUpper|Integer|IntegerProduct|Float|Number|Bool|Timestamp|Dict|List)(?:2|N)?|safeCurrencyCode)$/.test(`${callee.name?.text ?? ''}`);\n }\n // hx4 G02\n // base safeValue/safeValue2/safeValueN (SafeValueN derefScalars every hit and its default) and\n // ws cache constructors (non-nil, outside the derefScalar set): never a nil pointer IsEqual folds\n goG02NonPointerAccessorSource(expr): boolean {\n if (expr?.kind === SyntaxKind.ConditionalExpression) {\n return this.goIsNonPointerValueSource(expr.whenTrue) && this.goIsNonPointerValueSource(expr.whenFalse);\n }\n if (expr?.kind === SyntaxKind.NewExpression) {\n const name = (expr.expression?.kind === SyntaxKind.Identifier) ? expr.expression.text : undefined;\n return GO_G02_CACHE_CLASSES.indexOf(name) >= 0;\n }\n if (expr?.kind !== SyntaxKind.CallExpression) {\n return false;\n }\n const callee = expr.expression;\n if (callee?.kind !== SyntaxKind.PropertyAccessExpression || callee.expression?.kind !== SyntaxKind.ThisKeyword\n || callee.name?.kind !== SyntaxKind.Identifier) {\n return false;\n }\n const keys = GO_G02_SAFE_VALUE_KEYS[callee.name.text];\n if (keys === undefined || expr.arguments.length > keys + 1) {\n return false;\n }\n // a default is returned as given (after derefScalar): only a literal is provably not a nil *sync.Map\n if (expr.arguments.length === keys + 1 && !this.goG02LiteralDefault(expr.arguments[keys])) {\n return false;\n }\n const checker: any = this.checkerOrUndefined();\n const declarations = checker?.getSymbolAtLocation(callee.name)?.declarations?.map((d) => d.resolve());\n if (!declarations || declarations.length === 0) {\n return false;\n }\n // an exchange override would print its own Go body: only the base property qualifies\n return declarations.every((d) => /(^|\\/)ts\\/src\\/base\\/Exchange\\.ts$/.test(String(d.getSourceFile()?.fileName ?? '').replace(/\\\\/g, '/')));\n }\n\n goG02LiteralDefault(node): boolean {\n node = this.goUnwrapParenthesizedNode(node);\n switch (node?.kind) {\n case SyntaxKind.NullKeyword:\n case SyntaxKind.StringLiteral:\n case SyntaxKind.NoSubstitutionTemplateLiteral:\n case SyntaxKind.NumericLiteral:\n case SyntaxKind.TrueKeyword:\n case SyntaxKind.FalseKeyword:\n case SyntaxKind.ObjectLiteralExpression:\n case SyntaxKind.ArrayLiteralExpression:\n return true;\n case SyntaxKind.Identifier:\n return node.text === 'undefined';\n }\n return false;\n }\n\n\n\n // hx4 G06\n // a `*string` the checker narrows to string (or whose every write is a defaulted SafeString)\n // is non-nil, so GetLength/GetArrayLength's deref + byte count is `len(*x)`\n goHx4G06DerefLength(expression, printedText: string, lengthNode): string | undefined {\n if ((expression?.kind !== SyntaxKind.Identifier) || (printedText !== expression.text)) {\n return undefined;\n }\n if (this.goLengthFeedsArithmeticClassifier(lengthNode) || !this.goDerefableStringOperand(expression)) {\n return undefined;\n }\n return `len(*${printedText})`;\n }\n\n // GetIndexOf on two operands that are Go strings once a proven-non-nil `*string` is deref'd:\n // both sides reach the helper's `case string` arm, which is strings.Index\n goHx4G06DerefIndexOf(node, name, parsedArg): string | undefined {\n if ((typeof name !== 'string') || (typeof parsedArg !== 'string') || name.includes('\\n') || parsedArg.includes('\\n')) {\n return undefined;\n }\n if (!this.goFileKeepsFileLevelImports() || !this.goStdlibImportIsPlaceable()) {\n return undefined;\n }\n const operands = [ this.goUnwrapPrintedAssertions(node?.expression?.expression), this.goUnwrapPrintedAssertions(node?.arguments?.[0]) ];\n const texts = [ name, parsedArg ];\n if (!operands.some((o) => this.goDerefableStringOperand(o))) {\n return undefined; // plain string pairs and nilable receivers stay with goNativeIndexOf\n }\n const out: string[] = [];\n for (let i = 0; i < 2; i++) {\n const o = operands[i];\n if ((o?.kind === SyntaxKind.Identifier) && (texts[i] === o.text) && this.goDerefableStringOperand(o)) {\n out.push('*' + texts[i]);\n } else if (this.goIndexOfOperandType(o, texts[i]) === 'string') {\n out.push(texts[i]);\n } else {\n return undefined;\n }\n }\n this.goFileStdlibImports.add('strings');\n return `strings.Index(${out[0]}, ${out[1]})`;\n }\n\n\n // hx4 G08\n // a `*string` local the checker narrowed to a union of string literals (`x === 'A' || x === 'B'`):\n // every member is a string, so the Go pointer is non-nil at this read and may be dereferenced\n goLiteralUnionNarrowedStringDeref(node): boolean {\n if ((node?.kind !== SyntaxKind.Identifier) || (this.goDeclaredTypeOfIdentifier(node) !== '*string')) {\n return false;\n }\n const checker: any = this.checkerOrUndefined();\n const type = checker?.getTypeAtLocation(node);\n if ((type === undefined) || ((type.flags & TypeFlags.Union) === 0)) {\n return false;\n }\n const members = type.getTypes?.() ?? [];\n return (members.length > 0) && members.every((member) => (member.flags & TypeFlags.StringLiteral) !== 0);\n }\n // hx4 G09\n // hand-written BaseExchange value fields (go/v4/exchange.go) read as `this.`\n GO_G09_NUMERIC_FIELDS: { [tsName: string]: string } = {\n 'rateLimit': 'float64',\n 'fetchHistoryCacheSize': 'int',\n 'minFundingAddressLength': 'int',\n };\n\n // `this.rateLimit` & co.: only when the checker resolves the property to the base\n // `class Exchange` declaration (a venue redeclaring it prints its own field)\n goG09FieldKind(node): string | undefined {\n node = this.goUnwrapParenthesizedNode(node);\n if ((node?.kind !== SyntaxKind.PropertyAccessExpression) || (node.expression?.kind !== SyntaxKind.ThisKeyword)) {\n return undefined;\n }\n const kind = this.GO_G09_NUMERIC_FIELDS[node.name?.escapedText ?? node.name?.text];\n if (kind === undefined) {\n return undefined;\n }\n const checker: any = this.checkerOrUndefined();\n const declaration: any = checker?.getSymbolAtLocation(node)?.valueDeclaration?.resolve();\n if ((declaration?.kind !== SyntaxKind.PropertyDeclaration) || (declaration.parent?.kind !== SyntaxKind.ClassDeclaration)) {\n return undefined;\n }\n const className = declaration.parent.name?.escapedText ?? declaration.parent.name?.text;\n return (className === 'Exchange') ? kind : undefined;\n }\n\n // [kind, pointer] of one ordered-comparison operand, undefined when unprovable\n goG09OperandKind(node, text: string): [string, boolean] | undefined {\n const pointee = this.goOrderedComparisonPointerKind(node);\n if (pointee !== undefined) {\n return [ pointee, true ];\n }\n const field = this.goG09FieldKind(node);\n if (field !== undefined) {\n return [ field, false ];\n }\n const kind = this.goOperandNumericKind(node, text);\n return (kind === undefined) ? undefined : [ kind, false ];\n }\n\n // Ordered comparisons the phase-1 rule refuses only because the two concrete kinds differ\n // (int vs int64, int/int64 vs float64) or an operand is a typed base field. The helper\n // converts the narrower side exactly like `int64(x)` / `float64(x)`; nil and NaN rules stay.\n printG09WideningComparison(left, right, leftText: string, rightText: string, op): string | undefined {\n const operator = ORDERED_COMPARISON_OPERATORS[op];\n if (operator === undefined) {\n return undefined;\n }\n if (this.goIsNumericConstant(left) && this.goIsNumericConstant(right)) {\n return undefined;\n }\n const l = this.goG09OperandKind(left, leftText);\n const r = this.goG09OperandKind(right, rightText);\n if ((l === undefined) || (r === undefined)) {\n return undefined;\n }\n let kind = this.goComparisonKind(left, l[0], right, r[0]);\n let lv = l[1] ? `*${leftText}` : leftText;\n let rv = r[1] ? `*${rightText}` : rightText;\n if (kind === undefined) {\n if (this.goIsNumericConstant(left) || this.goIsNumericConstant(right)) {\n return undefined;\n }\n kind = ((l[0] === 'float64') || (r[0] === 'float64')) ? 'float64' : 'int64';\n if (l[0] !== kind) {\n lv = `${kind}(${lv})`;\n }\n if (r[0] !== kind) {\n rv = `${kind}(${rv})`;\n }\n }\n if ((kind === 'float64') && ((operator === '<') || (operator === '<='))) {\n return undefined;\n }\n const leftNil = l[1] && !this.goHasEnclosingNilGuard(left);\n const rightNil = r[1] && !this.goHasEnclosingNilGuard(right);\n if ((leftNil && !r[1] && !this.goIsPureComparisonOperand(right))\n || (rightNil && !l[1] && !this.goIsPureComparisonOperand(left))) {\n return undefined;\n }\n const greater = (operator === '>') || (operator === '>=');\n const cmp = `${lv} ${operator} ${rv}`;\n if (!leftNil && !rightNil) {\n return `(${cmp})`;\n }\n if (leftNil && !rightNil) {\n return greater ? `(${leftText} != nil && ${cmp})` : `(${leftText} == nil || ${cmp})`;\n }\n if (!leftNil && rightNil) {\n return greater ? `(${rightText} == nil || ${cmp})` : `(${rightText} != nil && ${cmp})`;\n }\n if (operator === '>') {\n return `(${leftText} != nil && (${rightText} == nil || ${cmp}))`;\n }\n if (operator === '>=') {\n return `(${rightText} == nil || (${leftText} != nil && ${cmp}))`;\n }\n if (operator === '<') {\n return `(${rightText} != nil && (${leftText} == nil || ${cmp}))`;\n }\n return `(${leftText} == nil || (${rightText} != nil && ${cmp}))`;\n }\n\n}\n\n\n// get class decl node\n// Use the getAllSuperTypeNodes function to get the base classes for the MyClass\n// const baseClasses = getAllSuperTypeNodes(classDeclaration);\n\n// // Create a type checker\n// const typeChecker = ts.createTypeChecker(sourceFile.context.program, sourceFile.context.checker);\n\n// // Get the type of the base class\n// const baseClassType = typeChecker.getTypeAtLocation(baseClasses[0]);\n\n// // Get the class declaration for the base class\n// const baseClassDeclaration = baseClassType.symbol.valueDeclaration?.resolve();\n\n// console.log(baseClassDeclaration);\n\n// hx4 G02: key-argument count of the base safeValue family; ws cache classes (Go constructors return a non-nil *T)\nconst GO_G02_SAFE_VALUE_KEYS: { [name: string]: number } = { 'safeValue': 2, 'safeValue2': 3, 'safeValueN': 2 };\nconst GO_G02_CACHE_CLASSES = [ 'ArrayCache', 'ArrayCacheByTimestamp', 'ArrayCacheBySymbolById', 'ArrayCacheBySymbolBySide' ];\n\n// hx4 G04\nexport interface GoTranspiler {\n goNativeIntWideningArithmetic(node, leftType: string, rightType: string, leftText: string, rightText: string): { goType: string, text: string } | undefined;\n}\n// `a - b` / `a * b` / `a + b` with one int64 and one int operand (or an int `- * %N` in a `var` initializer):\n// the helper boxes int64 (Add/Subtract/Mod via the float path, Multiply via reflect Int()); Go refuses\n// the mixed operator, so the int side converts. Exact under the helper's own 2^53 float bound.\nGoTranspiler.prototype.goNativeIntWideningArithmetic = function (node, leftType: string, rightType: string, leftText: string, rightText: string) {\n const op = node.operatorToken.kind;\n const isMod = (op === SyntaxKind.PercentToken) && this.isNonZeroIntegerLiteral(node.right);\n if ((op !== SyntaxKind.MinusToken) && (op !== SyntaxKind.AsteriskToken) && (op !== SyntaxKind.PlusToken) && !isMod) {\n return undefined;\n }\n const mixed = ((leftType === 'int64') && (rightType === 'int')) || ((leftType === 'int') && (rightType === 'int64'));\n // `var x int64 = n - 1` over an `int` local: Subtract/Multiply box int64, so the int side converts\n const intKinds = [ 'int', 'const-int' ];\n const declaredInt64 = (op !== SyntaxKind.PlusToken) && intKinds.includes(leftType) && intKinds.includes(rightType)\n && ((leftType === 'int') || (rightType === 'int')) && this.goInsideTypedDeclarationInitializer(node);\n if ((!mixed || isMod) && !declaredInt64) {\n return undefined;\n }\n const operand = (operandNode, operandType: string, printed: string) => (operandType === 'int')\n ? 'int64(' + this.goUnwrapPrintedParens(printed.trim()) + ')'\n : this.goNativeOperandText(operandNode, printed);\n const left = operand(node.left, leftType, leftText);\n const right = operand(node.right, rightType, rightText);\n const symbol = this.SupportedKindNames[op];\n const separator = this.goBinarySeparator(symbol, right, node.left, node.right);\n return { 'goType': 'int64', 'text': left + separator + symbol + separator + right };\n};\n\nexport interface GoTranspiler {\n goStringLiteralUnionType(type): boolean;\n}\n// `if (x === 'a' || x === 'b')` narrows a `Str` local to a union of string literals: every member\n// is a non-nilable string, so the deref is as safe as for a plain narrowed `string`\nGoTranspiler.prototype.goStringLiteralUnionType = function (type) {\n if ((type === undefined) || ((type.flags & TypeFlags.Union) === 0)) {\n return false;\n }\n const members = type.getTypes();\n return (members.length > 0) && members.every((member) => (member.flags & TypeFlags.StringLike) !== 0);\n};\n\nexport interface GoTranspiler {\n goConcatDerefableStringOperand(node): boolean;\n}\n// the concat rule's `*string` leaf proof: goDerefableStringOperand, or a declared `*string`\n// identifier the checker narrowed to a union of string literals at this use\nGoTranspiler.prototype.goConcatDerefableStringOperand = function (node) {\n if (this.goDerefableStringOperand(node)) {\n return true;\n }\n if ((node?.kind !== SyntaxKind.Identifier) || (this.goDeclaredTypeOfIdentifier(node) !== '*string')) {\n return false;\n }\n const checker: any = this.checkerOrUndefined();\n return (checker !== undefined) && this.goStringLiteralUnionType(checker.getTypeAtLocation(node));\n};\n\n// hx4 X02\nexport interface GoTranspiler {\n x02CurrencyRow(node): boolean;\n}\n// a Currency-typed local written only by `this.currency (…)` / `this.safeCurrency (…)` (or undefined):\n// the ccxt Go runtime returns those through CurrencyTyped, whose values derefScalar leaves unchanged\nGoTranspiler.prototype.x02CurrencyRow = function (node) {\n let type: any;\n try {\n type = this.getChecker().getTypeAtLocation(node);\n } catch (e) {\n return false;\n }\n const named = (t: any) => [ t?.getAliasSymbol?.()?.name, t?.getSymbol?.()?.name ].some((n) => [ 'Currency', 'CurrencyInterface' ].includes(n));\n const members = ((typeof type?.isUnionType === 'function') && type.isUnionType()) ? type.getTypes() : [ type ];\n if (!named(type) && !members.some((t: any) => named(t))) {\n return false;\n }\n const declaration = this.goDeclarationOfIdentifier(node);\n const scope: any = (declaration === undefined) ? undefined : this.goEnclosingFunction(declaration);\n if (scope === undefined) {\n return false;\n }\n const isRow = (v: any) => (v === undefined) || ((v.kind === SyntaxKind.Identifier) && (v.text === 'undefined'))\n || ((v.kind === SyntaxKind.CallExpression) && (v.expression?.kind === SyntaxKind.PropertyAccessExpression)\n && (v.expression.expression?.kind === SyntaxKind.ThisKeyword) && [ 'currency', 'safeCurrency' ].includes(v.expression.name?.text));\n let ok = isRow(declaration.initializer);\n const name = declaration.name?.text;\n const visit = (n: any) => {\n if (!ok) {\n return;\n }\n if ((n.kind === SyntaxKind.BinaryExpression) && (n.left?.kind === SyntaxKind.Identifier) && (n.left.text === name)\n && (n.operatorToken?.kind === SyntaxKind.EqualsToken) && this.goIdentifierRefersToDeclaration(n.left, declaration)) {\n ok = isRow(n.right);\n } else if ((n.kind === SyntaxKind.ArrayLiteralExpression) && (n.parent?.kind === SyntaxKind.BinaryExpression) && (n.parent.left === n)\n && n.elements.some((e: any) => (e.kind === SyntaxKind.Identifier) && (e.text === name))) {\n ok = false;\n }\n n.forEachChild(visit);\n };\n scope.forEachChild(visit);\n return ok;\n};\n\n// hx4 G11\nexport interface GoTranspiler {\n g11NativeParameterType(fn, param, index: number): string | undefined;\n g11ParameterHasNullishDefault(body, param): boolean;\n}\n// A required parameter of a sync exchange-local method whose TS type is `Str`/`string`, `Dict`-shaped or\n// `List`: the Go type every call site passes (`string` first, then *string / map / []any), when the body\n// never writes another type, never nil-tests it and never `??`-defaults it (D2, D5)\nGoTranspiler.prototype.g11NativeParameterType = function (fn, param, index: number) {\n if (this.isAsyncFunction(fn) || !this.goHasTreeCallSite(fn)) {\n return undefined;\n }\n const candidates: string[] = [];\n const type = this.checkerOrUndefined()?.getTypeAtLocation(param);\n if (type !== undefined) {\n const all = ((typeof type.isUnionType === 'function') && type.isUnionType()) ? type.getTypes() : [type];\n const parts = all.filter(p => !(p.flags & (TypeFlags.Undefined | TypeFlags.Null)));\n if ((parts.length > 0) && parts.every(p => (p.flags & (TypeFlags.String | TypeFlags.StringLiteral)) !== 0)) {\n candidates.push('string');\n }\n }\n for (const goType of this.goNativeParameterTypeCandidates(param).concat(this.g13NumericParameterCandidates(param))) {\n if (!candidates.includes(goType)) {\n candidates.push(goType);\n }\n }\n for (const goType of candidates) {\n if (this.goParameterCallSitesPassType(fn, index, goType)\n && this.goLocalIsSafeToType(fn.body, param, param.name.text, goType)\n && (goType.startsWith('*') || this.goParameterKeepsNilCompareNative(fn.body, param, goType))\n && (goType.startsWith('*') || !this.g11ParameterHasNullishDefault(fn.body, param))) {\n return goType;\n }\n }\n return undefined;\n};\n\n// `x ?? d` / `x || d` reads the parameter's absent state, which a non-nilable Go type cannot hold\nGoTranspiler.prototype.g11ParameterHasNullishDefault = function (body, param) {\n const name = param.name.text;\n return this.hasNodeWhere(body, (n: any) => {\n const parent: any = n.parent;\n return (n.kind === SyntaxKind.Identifier) && (n.text === name) && (parent?.kind === SyntaxKind.BinaryExpression)\n && (parent.left === n) && ((parent.operatorToken.kind === SyntaxKind.QuestionQuestionToken)\n || (parent.operatorToken.kind === SyntaxKind.QuestionQuestionEqualsToken));\n });\n};\n\n// hx4 G13\nexport interface GoTranspiler {\n g13NumericParameterCandidates(param): string[];\n}\n// a required `Int` / `Num` / `number` parameter: the pointer Go type the GetArg twins already use\n// for `Int` / `Num` (nil is the absent state); a non-nullable `number` takes the plain value type its callers pass\nGoTranspiler.prototype.g13NumericParameterCandidates = function (param) {\n const declared = (param?.type !== undefined) ? String(param.type.getText()).trim() : undefined;\n switch (declared) {\n case 'Int': return ['*int64'];\n case 'Num': return ['*float64'];\n case 'number': return ['int64', 'float64'];\n }\n return [];\n};\n","import { BaseTranspiler } from \"./baseTranspiler.js\";\nimport { NodeFlags, SyntaxKind, type Expression, type Node } from \"typescript/unstable/ast\";\nimport { isArrayLiteralExpression, isArrowFunction, isAsExpression, isBinaryExpression, isBlock, isBooleanLiteral, isCallExpression, isBreakStatement, isClassDeclaration, isConditionalExpression, isContinueStatement, isElementAccessExpression, isExpressionStatement, isForInStatement, isForOfStatement, isFunctionDeclaration, isFunctionExpression, isIdentifier, isIfStatement, isMethodDeclaration, isNonNullExpression, isNumericLiteral, isObjectLiteralExpression, isParameterDeclaration, isParenthesizedExpression, isPostfixUnaryExpression, isPrefixUnaryExpression, isPropertyAccessExpression, isPropertyAssignment, isReturnStatement, isShorthandPropertyAssignment, isSourceFile, isSpreadAssignment, isSpreadElement, isStringLiteral, isStringLiteralLikeNode, isThrowStatement, isTypeAssertion, isTypeOfExpression, isTypeReferenceNode, isVariableDeclaration, isVariableDeclarationList } from \"typescript/unstable/ast/is\";\nimport { createIdentifier } from \"typescript/unstable/ast/factory\";\nimport { API, ElementFlags, IndexKind, SymbolFlags, TypeFlags, type Checker } from \"typescript/unstable/sync\";\nimport { Logger } from \"./logger.js\";\nimport { getAllSuperTypeNodes, getCombinedNodeFlags, isFunctionLike } from \"./tsUtils.js\";\n\nconst parserConfig = {\n EXTENDS_TOKEN: \"extends\",\n PROMISE_TYPE_KEYWORD: \"java.util.concurrent.CompletableFuture\",\n ARRAY_KEYWORD: \"java.util.List\",\n OBJECT_KEYWORD: \"java.util.Map\",\n STRING_KEYWORD: \"String\",\n BOOLEAN_KEYWORD: \"boolean\",\n DEFAULT_PARAMETER_TYPE: \"Object\",\n DEFAULT_RETURN_TYPE: \"Object\",\n DEFAULT_TYPE: \"Object\",\n ELSEIF_TOKEN: \"else if\",\n // Objects in Java: we'll use double-brace initialization so property puts work\n OBJECT_OPENING: \"new java.util.HashMap() {{\",\n OBJECT_CLOSING: \"}}\",\n // Arrays in Java: emit Arrays.asList(...) wrapped by ArrayList\n ARRAY_OPENING_TOKEN: \"new java.util.ArrayList(java.util.Arrays.asList(\",\n ARRAY_CLOSING_TOKEN: \"))\",\n // For object literal properties we'll emit: put(key, value);\n PROPERTY_ASSIGNMENT_TOKEN: \",\",\n VAR_TOKEN: \"Object\", // Java 10+ local var\n METHOD_TOKEN: \"\",\n PROPERTY_ASSIGNMENT_OPEN: \"put(\",\n PROPERTY_ASSIGNMENT_CLOSE: \");\",\n SUPER_TOKEN: \"super\",\n SUPER_CALL_TOKEN: \"super\",\n FALSY_WRAPPER_OPEN: \"Helpers.isTrue(\",\n FALSY_WRAPPER_CLOSE: \")\",\n COMPARISON_WRAPPER_OPEN: \"Helpers.isEqual(\",\n COMPARISON_WRAPPER_CLOSE: \")\",\n UKNOWN_PROP_WRAPPER_OPEN: \"this.call(\",\n UNKOWN_PROP_WRAPPER_CLOSE: \")\",\n UKNOWN_PROP_ASYNC_WRAPPER_OPEN: \"this.callAsync(\",\n UNKOWN_PROP_ASYNC_WRAPPER_CLOSE: \")\",\n DYNAMIC_CALL_OPEN: \"Helpers.callDynamically(\",\n EQUALS_EQUALS_WRAPPER_OPEN: \"Helpers.isEqual(\",\n EQUALS_EQUALS_WRAPPER_CLOSE: \")\",\n DIFFERENT_WRAPPER_OPEN: \"!Helpers.isEqual(\",\n DIFFERENT_WRAPPER_CLOSE: \")\",\n GREATER_THAN_WRAPPER_OPEN: \"Helpers.isGreaterThan(\",\n GREATER_THAN_WRAPPER_CLOSE: \")\",\n GREATER_THAN_EQUALS_WRAPPER_OPEN: \"Helpers.isGreaterThanOrEqual(\",\n GREATER_THAN_EQUALS_WRAPPER_CLOSE: \")\",\n LESS_THAN_WRAPPER_OPEN: \"Helpers.isLessThan(\",\n LESS_THAN_WRAPPER_CLOSE: \")\",\n LESS_THAN_EQUALS_WRAPPER_OPEN: \"Helpers.isLessThanOrEqual(\",\n LESS_THAN_EQUALS_WRAPPER_CLOSE: \")\",\n PLUS_WRAPPER_OPEN: \"Helpers.add(\",\n PLUS_WRAPPER_CLOSE: \")\",\n MINUS_WRAPPER_OPEN: \"Helpers.subtract(\",\n MINUS_WRAPPER_CLOSE: \")\",\n ARRAY_LENGTH_WRAPPER_OPEN: \"Helpers.getArrayLength(\",\n ARRAY_LENGTH_WRAPPER_CLOSE: \")\",\n DIVIDE_WRAPPER_OPEN: \"Helpers.divide(\",\n DIVIDE_WRAPPER_CLOSE: \")\",\n MULTIPLY_WRAPPER_OPEN: \"Helpers.multiply(\",\n MULTIPLY_WRAPPER_CLOSE: \")\",\n INDEXOF_WRAPPER_OPEN: \"Helpers.getIndexOf(\",\n INDEXOF_WRAPPER_CLOSE: \")\",\n MOD_WRAPPER_OPEN: \"Helpers.mod(\",\n MOD_WRAPPER_CLOSE: \")\",\n FUNCTION_TOKEN: \"\",\n ELEMENT_ACCESS_WRAPPER_OPEN: 'Helpers.GetValue(',\n ELEMENT_ACCESS_WRAPPER_CLOSE: ')',\n INFER_VAR_TYPE: false,\n INFER_ARG_TYPE: false,\n};\n\n// hand-written base methods whose Java declaration carries a concrete numeric return type\n// (BaseExchange.java: `public Long milliseconds()`), so a `this.()` call holds that box on\n// every path. Generated methods print `Object`; only this closed table is an arithmetic anchor.\nconst JAVA_THIS_RETURN_TYPES: { [name: string]: string } = {\n 'milliseconds': 'long',\n};\n\n// source files the table was audited against: the declaration on the base class, or\n// its overload-stripped temp copy (build/stripOverloads.ts). A call resolving anywhere\n// else is a venue override that prints its own signature - not provable.\n// `extend = extend` / `deepExtend = deepExtend` resolve to the base-tier generic helpers\nconst JAVA_FRESH_EXTEND_FILE = /(^|[\\\\/])ts[\\\\/]src[\\\\/]base[\\\\/](functions[\\\\/]generic|Exchange(\\.nooverloads\\.\\d+)?)\\.ts$/;\nconst JAVA_THIS_RETURN_TYPES_BASE_FILE = /(^|[\\\\/])ts[\\\\/]src[\\\\/]base[\\\\/]Exchange(\\.nooverloads\\.\\d+)?\\.ts$/;\n// `milliseconds = milliseconds` (Exchange.ts) mixes in the functions/time.ts helper, so\n// the same call may resolve to the Date.now signature in a typescript lib.d.ts instead.\nconst JAVA_THIS_RETURN_TYPES_LIB_FILE = /(^|[\\\\/])node_modules[\\\\/](?:[^\\\\/]+[\\\\/]node_modules[\\\\/])?typescript6?[\\\\/]lib[\\\\/]lib\\.[^\\\\/]*\\.d\\.ts$/;\n\n// every assignment operator (`=`, `+=`, `??=`, ...) but no comparison (`===`, `!==`, `<=`, `>=`):\n// an element access on the left of one of these is a write site and keeps the base emission\nconst JAVA_ASSIGNMENT_OPERATOR_KINDS: Set = (() => {\n const kinds: any = SyntaxKind;\n const names = Object.keys(kinds).filter((name) => name.endsWith('EqualsToken')\n && !/^Equals|^Exclamation|^LessThan|^GreaterThan/.test(name));\n return new Set(([ 'EqualsToken' ].concat(names)).map((name) => kinds[name]).filter((kind) => kind !== undefined));\n})();\n\n// TS type flags whose Java print is a scalar final class or a primitive: `instanceof\n// java.util.List` is not convertible on those operands, so they keep the helper\nconst JAVA_SCALAR_TYPE_FLAGS: number = TypeFlags.String | TypeFlags.StringLiteral\n | TypeFlags.Number | TypeFlags.NumberLiteral\n | TypeFlags.Boolean | TypeFlags.BooleanLiteral\n | TypeFlags.BigInt | TypeFlags.BigIntLiteral\n | TypeFlags.Enum | TypeFlags.EnumLiteral\n | TypeFlags.ESSymbol | TypeFlags.UniqueESSymbol;\n\n// TS type flags that are never an array (JS `Array.isArray(null)` / `(undefined)` is false)\nconst JAVA_NULLISH_TYPE_FLAGS: number = TypeFlags.Undefined | TypeFlags.Null\n | TypeFlags.Void | TypeFlags.Never;\n\n// hand-written `boolean` fields in the class body of BaseExchange.java / PredictionExchange.java\n// (the half hand-written base files the generated exchanges inherit): a read of one prints a\n// primitive Java boolean, so `this.` IS the wrapper's result.\nconst JAVA_BOOLEAN_BASE_FIELDS = new Set([\n 'this.alias',\n 'this.verbose',\n 'this.validateServerSsl',\n 'this.enableRateLimit',\n 'this.pro',\n 'this.certified',\n 'this.reloadingMarkets',\n 'this.marketsLoaded',\n 'this.reduceFees',\n 'this.substituteCommonCurrencyCodes',\n 'this.isSandboxModeEnabled',\n 'this.returnResponseHeaders',\n 'this.newUpdates',\n 'this.syncSleep',\n // PredictionExchange.java\n 'this.reloadingEvents',\n]);\n\n// hand-written map fields of BaseExchange.java: each value is a java.util.Map, so `this.[k]`\n// is the helper's Map branch. `nullable` marks a field set to null or written from an Object-typed\n// call, so the read keeps the null answer behind a receiver guard.\nconst JAVA_FIELD_TYPES: { [name: string]: { map: boolean, nullable: boolean } } = {\n 'ohlcvs': { map: true, nullable: false },\n 'orderbooks': { map: true, nullable: false },\n 'balance': { map: true, nullable: true },\n 'options': { map: true, nullable: true },\n 'markets': { map: true, nullable: true },\n};\n\n// hand-written base methods declared `public boolean` (BaseExchange.java): a call prints a\n// primitive Java boolean, so a local fed by one holds a Boolean box or null.\nconst JAVA_BOOLEAN_BASE_CALLS = new Set([\n 'valueIsDefined',\n 'inArray',\n 'isEmpty',\n 'isJsonEncodedObject',\n 'isBinaryMessage',\n]);\n\n// operators whose printed Java form is a primitive boolean on every path: the logical ones and\n// every comparison / `in` / `instanceof`-style test the printer lowers to Helpers.isEqual /\n// isGreaterThan / inOp (all declared `public static boolean`) or to a native Java boolean\nconst JAVA_BOOLEAN_OPERATOR_KINDS: Set = (() => {\n const k: any = SyntaxKind;\n return new Set([\n k.AmpersandAmpersandToken,\n k.BarBarToken,\n k.EqualsEqualsToken,\n k.EqualsEqualsEqualsToken,\n k.ExclamationEqualsToken,\n k.ExclamationEqualsEqualsToken,\n k.LessThanToken,\n k.LessThanEqualsToken,\n k.GreaterThanToken,\n k.GreaterThanEqualsToken,\n k.InKeyword,\n k.InstanceOfKeyword,\n ]);\n})();\n\n// the relational `Precise.string*` statics are declared `public static boolean` in the\n// hand-written java/lib/src/main/java/io/github/ccxt/base/Precise.java, so their printed call is\n// already a Java primitive boolean (the String-returning statics are NOT listed here)\nconst JAVA_PRECISE_BOOLEAN_STATICS: Set = new Set([\n 'stringEq', 'stringEquals', 'stringGt', 'stringGe', 'stringLt', 'stringLe',\n]);\n\n// The printer erases TS return annotations to `Object`, so Helpers.isTrue would re-test a value the\n// hand-written Java base (BaseExchange.java, above the transpiled delimiter) already returns as a\n// boolean. Java overrides are covariant, so no generated venue method can widen these returns.\nconst JAVA_THIS_BOOLEAN_METHODS = new Set([\n 'inArray', // public boolean inArray (Object elem, Object list2)\n 'isArray', // public boolean isArray (Object a)\n 'isEmpty', // public boolean isEmpty (Object a)\n 'valueIsDefined', // public boolean valueIsDefined (Object value)\n 'isJsonEncodedObject', // public boolean isJsonEncodedObject (Object str)\n 'isBinaryMessage', // public boolean isBinaryMessage (Object message)\n]);\n\n// The GENERATED boolean accessors (`Object safeBool (...)`) hand the caller's `defaultValue` back\n// untouched when the found value is not a Boolean, so the box is Boolean-or-null only when the\n// default argument is absent or a boolean literal. Value = index of that argument in the call.\nconst JAVA_THIS_BOOLEAN_BOX_METHODS: { [name: string]: number } = {\n 'safeBool': 2,\n 'safeBool2': 3,\n 'safeBoolN': 2,\n};\n\n// the Java spellings a consumer declares a dict local with (import-shortened forms\n// included); every other declared type keeps Helpers.GetValue\nconst JAVA_DECLARED_MAP_TYPES = /^(java\\.util\\.)?(Map|HashMap)\\s*<\\s*String\\s*,\\s*Object\\s*>$/;\n\n// the Java spellings a consumer declares an element-read receiver with when it is a List:\n// the read prints `x.get(i)` / `x.size()` with no cast, because the declaration is the List\nconst JAVA_DECLARED_LIST_TYPES = /^(java\\.util\\.)?(List|ArrayList)\\s*<[^;\\n=]+>$/;\n\n// the Java primitive spellings a declaration can publish: an operand that prints as one\n// cannot take the `instanceof` test a native map read guards with\nconst JAVA_PRIMITIVE_DECLARED_TYPES = new Set(['boolean', 'byte', 'char', 'short', 'int', 'long', 'float', 'double']);\n\n// the numeric declaration types the ccxt-side pass publishes; the boxed ones can hold\n// null, so a native compare guards them first\nconst JAVA_DECLARED_NUMERIC_TYPES: Set =\n new Set(['Integer', 'Long', 'Double', 'int', 'long', 'double']);\n\nconst JAVA_BOXED_NUMERIC_TYPES: Set =\n new Set(['Integer', 'Long', 'Double']);\n\n// receiver node kinds whose printed Java is a primary expression, so the `(String)`\n// checkcast in front of them binds the whole receiver (a native `+` prints its own parens)\nconst JAVA_SPLIT_RECEIVER_KINDS: Set = new Set([\n SyntaxKind.Identifier,\n SyntaxKind.PropertyAccessExpression,\n SyntaxKind.ElementAccessExpression,\n SyntaxKind.CallExpression,\n SyntaxKind.ParenthesizedExpression,\n SyntaxKind.StringLiteral,\n SyntaxKind.NoSubstitutionTemplateLiteral,\n]);\n\n// TS classes/interfaces whose hand-written java counterpart extends java.util.ArrayList\n// (java/lib/.../ws/ArrayCache.java and ws/OrderBookSide.java, plus the IndexedOrderBookSide and\n// Asks/Bids subclasses); every runtime value of these types answers `.length` with the list size\nconst JAVA_LIST_BACKED_TS_CLASSES: Set = new Set([\n 'ArrayCache',\n 'ArrayCacheByTimestamp',\n 'ArrayCacheBySymbolById',\n 'ArrayCacheByOutcomeById',\n 'ArrayCacheBySymbolBySide',\n 'OrderBookSide',\n 'IndexedOrderBookSide',\n 'Asks',\n 'Bids',\n 'IndexedAsks',\n 'IndexedBids',\n 'IOrderBookSide',\n]);\n\n// the Java spelling that lets the printed key go straight to containsKey: the helper only\n// looks a key up when it is a String, and a String-typed operand is one on every path\nconst JAVA_DECLARED_STRING_TYPE = /^(java\\.util\\.)?String$/;\n\n// TS parameter annotations (`Dict`, `Market`, `Currency`, `Str`, `OrderType`/`OrderSide`, `Bool`) print the native Java\n// type on the declaring method. `Int`/`Num` stay `Object`: a TS `number` is an Integer, Long or\n// Double box in generated code, so neither a `Long`/`Double` parameter nor a cast site is provable.\nconst JAVA_NATIVE_PARAMETER_TYPES: { [name: string]: string } = {\n 'Dict': 'java.util.Map',\n 'Market': 'java.util.Map',\n 'Currency': 'java.util.Map',\n 'Str': 'String',\n 'OrderType': 'String',\n 'OrderSide': 'String',\n 'Bool': 'Boolean',\n};\n\n// Java types of default-valued parameters; separate from the fixed-parameter table.\n// `Num`/`Bool`/`Strings` stay Object: widening them changes payload strings or varargs spreading.\nconst JAVA_NATIVE_PARAMETER_TYPES_OPTIONAL: { [name: string]: string } = {\n 'Dict': 'java.util.Map',\n 'Market': 'java.util.Map',\n 'Currency': 'java.util.Map',\n 'Str': 'String',\n 'OrderType': 'String',\n 'OrderSide': 'String',\n 'Int': 'Long',\n 'Strings': 'java.util.List',\n};\n\n// `Strings` (and a `string[]` spelling of the same slot) is typed only on parameters named `symbols`\nconst JAVA_STRINGS_OPTIONAL_PARAMETER_NAMES = new Set(['symbols']);\nconst JAVA_STRING_LIST_TYPE = 'java.util.List';\n// base symbol-list helpers keep their Object slot (hand-written java callers pass Object)\nconst JAVA_STRINGS_EXCLUDED_METHODS = new Set(['marketSymbols', 'marketIds', 'marketsForSymbols', 'getMarketFromSymbols']);\n\n// the aliases above have to come from the shared ts/src/base/types.ts declaration\nconst JAVA_NATIVE_PARAMETER_SOURCE_FILES = /(^|\\/)ts\\/src\\/base\\/types\\.ts$/;\n\n// Parameter positions whose Java signature cannot move to the annotated type even though\n// the base declaration carries it. Java overrides are invariant, so one excluded position\n// boxes every declaration of the name at once.\nconst JAVA_NATIVE_PARAMETER_EXCLUDED_POSITIONS: { [name: string]: number[] } = {\n // implicit endpoints pass fetch2/request/sign params through untyped (arrays for batch orders)\n 'fetch2': [ 3 ],\n // the Exchange tier keeps fetchOrderBook's symbol Object; PredictionExchange overrides must erase alike\n 'fetchOrderBook': [ 0 ],\n 'request': [ 3 ],\n 'sign': [ 3 ],\n 'handleErrors': [ 4 ],\n 'parseOrder': [ 0 ],\n 'parseTrade': [ 0 ],\n 'amountToPrecision': [ 0 ],\n 'client': [ 0 ],\n 'costToPrecision': [ 0 ],\n 'handleOptionAndParams': [ 1 ],\n 'market': [ 0 ],\n 'marketSymbols': [ 1 ],\n 'parseAccount': [ 0 ],\n 'parseMarket': [ 0 ],\n 'parseOrderBook': [ 1 ],\n 'priceToPrecision': [ 0 ],\n 'safeBalance': [ 0 ],\n 'safeOpenInterest': [ 0 ],\n 'safeSymbol': [ 0 ],\n // java/tests/src/main/java/tests/base/TestSafeTicker.java is generated by the\n // --baseTests stage, which the farm's java target never reruns: it calls\n // `exchange.safeTicker()` and cannot be regenerated with a checkcast\n 'safeTicker': [ 0 ],\n 'symbol': [ 0 ],\n 'watch': [ 0, 1 ],\n};\n\n// only the generated tiers carry the annotation: a method declared in ts/src/base/** has a\n// hand-written java counterpart (BaseExchange/Exchange/Helpers/Precise) that keeps `Object`\nconst JAVA_NATIVE_PARAMETER_GENERATED_FILES = /(^|\\/)ts\\/src\\/(?:pro\\/|prediction\\/)?[a-z0-9_]+\\.ts$/;\n\n// the base tier is generated too: the transpiled `BaseExchange` body of\n// ts/src/base/Exchange.ts is spliced into java/lib/.../BaseExchange.java (the hand-written\n// java surface around it is not a class of its own), so its declarations print the\n// the base tiers print only the methods below this line of ts/src/base/(Prediction)Exchange.ts\nconst JAVA_TRANSPILE_DELIMITER = 'METHODS BELOW THIS LINE ARE TRANSPILED FROM TYPESCRIPT';\n// hand-written base methods whose Java runtime declares exactly the TS parameters (no varargs)\nconst JAVA_HANDWRITTEN_FULL_ARITY = new Set(['loadMarkets', 'fetchMarkets', 'fetchCurrencies', 'exceptionMessage']);\nconst JAVA_HANDWRITTEN_TIER_FILES = /(^|\\/)ts\\/src\\/(?:base|static_dependencies)\\//;\nconst JAVA_NATIVE_PARAMETER_BASE_FILES = /(^|[\\\\/])ts[\\\\/]src[\\\\/]base[\\\\/](Prediction)?Exchange(\\.nooverloads[^/]*)?\\.ts$/;\n\n// ===== native RETURN types (D-09) =====\n//\n// The printer declares every generated method `Object` (BaseTranspiler.printFunctionType\nconst JAVA_NATIVE_RETURN_MAP_TYPE = 'java.util.Map';\n\n// the hand-written `public String` producers of the base tier a `this. (...)` return\n// may print: the safeString* family, decimalToPrecision / numberToString (BaseExchange.java)\n// and the string helpers of base/functions/type.ts. Guarded by the resolved signature still\nconst JAVA_STRING_RETURN_BASE_METHODS: Set = new Set([\n 'safeString', 'safeString2', 'safeStringN',\n 'safeStringUpper', 'safeStringUpper2', 'safeStringUpperN',\n 'safeStringLower', 'safeStringLower2', 'safeStringLowerN',\n 'decimalToPrecision', 'numberToString', 'formatNumber', 'implodeParams', 'implodeHostname',\n]);\nconst JAVA_STRING_RETURN_BASE_FILES = /(^|[\\\\/])ts[\\\\/]src[\\\\/]base[\\\\/](?:functions[\\\\/](?:type|time)\\.ts|Exchange(\\.nooverloads[^/]*)?\\.ts)$/;\n\n// prediction venues (ts/src/prediction/.ts) live in their own package: their Java base,\n// PredictionExchange.java, carries the injected Exchange-tier body (javaTranspiler.ts\n// getExchangeTierBody), and the venue chain (abstract/prediction/ -> PredictionExchange ->\nconst JAVA_NATIVE_PARAMETER_PREDICTION_FILES = /(^|\\/)ts\\/src\\/prediction\\/[a-z0-9_]+\\.ts$/;\n\nconst JAVA_BOOLEAN_EXCLUDED_TYPE_FLAGS: number =\n TypeFlags.Any | TypeFlags.Unknown | TypeFlags.Undefined | TypeFlags.Null\n | TypeFlags.Void | TypeFlags.Never | TypeFlags.TypeParameter | TypeFlags.Conditional\n | TypeFlags.Enum | TypeFlags.EnumLiteral;\n\n// the union members a nullable boolean box may hold: `Bool` (`boolean | undefined`) and the\n// `boolean | null` spellings. A member of any other family (`Int`, `Str`, `any`) is a box the\n// isTrue helper tests with its runtime truthiness, so the helper must stay.\nconst JAVA_NULLABLE_BOOLEAN_MEMBER_FLAGS: number =\n TypeFlags.Boolean | TypeFlags.BooleanLiteral | TypeFlags.Undefined | TypeFlags.Null\n | TypeFlags.Void;\n\n// the `handle*Bool` accessors route through safeBool, which returns the caller's default untouched\n// when the found value is not a Boolean, so element 0 of their `[Bool, Dict]` tuple is a\n// Boolean-or-null box. The handleOptionAndParams family returns the raw member and is absent.\nconst JAVA_BOOLEAN_BOX_TUPLE_METHODS = new Set([\n 'handleParamBool',\n 'handleParamBool2',\n 'handleOptionBoolAndParams', // element 0 is checkOptionBool's Boolean-or-null (throws otherwise)\n 'handleOptionBoolAndParams2',\n]);\n\n// the Java printer and its build hooks re-ask the same checker questions about one node,\n// type, symbol or signature; answers are fixed per snapshot, so each is one round trip\nconst JAVA_MEMO_UNDEFINED = Symbol(\"javaMemoUndefined\");\nconst JAVA_MEMOIZED_METHODS = [\"getSignatureFromDeclaration\", \"isArrayType\", \"isTupleType\", \"getAliasedSymbol\", \"getTypeArguments\", \"getDeclaredTypeOfSymbol\", \"getReturnTypeOfSignature\", \"getSymbolOfType\", \"getTypeOfSymbolAtLocation\", \"getSignaturesOfType\", \"typeToString\", \"getTypesOfType\"];\nconst JAVA_TYPE_PREFETCH_KINDS = new Set([SyntaxKind.Identifier, SyntaxKind.BinaryExpression, SyntaxKind.Parameter, SyntaxKind.VariableDeclaration, SyntaxKind.StringLiteral, SyntaxKind.MethodDeclaration, SyntaxKind.PropertyAccessExpression, SyntaxKind.ParenthesizedExpression, SyntaxKind.ElementAccessExpression]);\nconst JAVA_SYMBOL_PREFETCH_KINDS = new Set([SyntaxKind.Identifier]);\n// the first lookup in a source file answers every node of the hot kinds in that file in one\n// array request, skipping nodes the core prefetch already cached; other kinds go one by one\nfunction prefetchByFile(checker: Checker, name: \"getTypeAtLocation\" | \"getSymbolAtLocation\", kinds: Set): void {\n const original = (checker as any)[name] as ((nodes: any) => any) & { has?: (node: Node) => boolean };\n const cache = new WeakMap();\n const done = new WeakSet();\n Object.defineProperty(checker, name, { configurable: true, value: (node: any) => {\n if (Array.isArray(node)) {\n return original(node);\n }\n if (cache.has(node)) {\n return cache.get(node);\n }\n const sf = node.getSourceFile?.();\n if (sf !== undefined && !done.has(sf)) {\n done.add(sf);\n const nodes: Node[] = [];\n const visit = (n: Node) => {\n if (kinds.has(n.kind) && !original.has?.(n)) {\n nodes.push(n);\n }\n n.forEachChild(visit);\n };\n sf.forEachChild(visit);\n if (nodes.length > 0) {\n const results = original(nodes);\n for (let i = 0; i < nodes.length; i++) {\n cache.set(nodes[i], results[i]);\n }\n }\n if (cache.has(node)) {\n return cache.get(node);\n }\n }\n const result = original(node);\n cache.set(node, result);\n return result;\n } });\n}\n\n// getResolvedSignature has no array form: the first lookup in a file pipelines every call\n// expression of that file through one batched request (API#batch over the checker's client)\nfunction prefetchResolvedSignatures(checker: Checker): void {\n const original = checker.getResolvedSignature;\n const client = (checker as any).client;\n if (client === undefined) {\n return;\n }\n const cache = new WeakMap();\n const done = new WeakSet();\n Object.defineProperty(checker, \"getResolvedSignature\", { configurable: true, value: (node: any) => {\n if (cache.has(node)) {\n return cache.get(node);\n }\n const sf = node?.getSourceFile?.();\n if (sf !== undefined && !done.has(sf)) {\n done.add(sf);\n const calls: Node[] = [];\n const visit = (n: Node) => {\n if (n.kind === SyntaxKind.CallExpression && !(original as any).has?.(n)) {\n calls.push(n);\n }\n n.forEachChild(visit);\n };\n sf.forEachChild(visit);\n if (calls.length > 0) {\n const results = API.prototype.batch.call({ client }, ...calls.map((c) => original.gen(c))) as unknown[];\n for (let i = 0; i < calls.length; i++) {\n cache.set(calls[i], results[i]);\n }\n }\n if (cache.has(node)) {\n return cache.get(node);\n }\n }\n const result = original(node);\n cache.set(node, result);\n return result;\n } });\n}\n\nfunction memoizeJavaCheckerCalls(checker: Checker): Checker {\n if ((checker as any).__javaMemoized) {\n return checker;\n }\n Object.defineProperty(checker, \"__javaMemoized\", { value: true });\n prefetchByFile(checker, \"getTypeAtLocation\", JAVA_TYPE_PREFETCH_KINDS);\n prefetchByFile(checker, \"getSymbolAtLocation\", JAVA_SYMBOL_PREFETCH_KINDS);\n prefetchResolvedSignatures(checker);\n for (const name of JAVA_MEMOIZED_METHODS) {\n const original = (checker as any)[name];\n if (typeof original !== \"function\") {\n continue;\n }\n const byFirst = new WeakMap>();\n Object.defineProperty(checker, name, { configurable: true, value: (first: any, ...rest: any[]) => {\n if (first === null || (typeof first !== \"object\" && typeof first !== \"function\") || rest.some((a) => a !== undefined && typeof a === \"object\")) {\n return original(first, ...rest);\n }\n let byRest = byFirst.get(first);\n if (byRest === undefined) {\n byRest = new Map();\n byFirst.set(first, byRest);\n }\n const key = rest.length === 0 ? \"\" : JSON.stringify(rest);\n const cached = byRest.get(key);\n if (cached !== undefined) {\n return cached === JAVA_MEMO_UNDEFINED ? undefined : cached;\n }\n const result = original(first, ...rest);\n byRest.set(key, result === undefined ? JAVA_MEMO_UNDEFINED : result);\n return result;\n } });\n }\n return checker;\n}\n\nexport class JavaTranspiler extends BaseTranspiler {\n\n getChecker(): Checker {\n return memoizeJavaCheckerCalls(super.getChecker());\n }\n\n // override lookups repeat per method on every printed call and hook; the answer is fixed per node\n private methodOverrideCache = new WeakMap();\n getMethodOverride(node: Node): Node {\n if (node === undefined || node === null) {\n return super.getMethodOverride(node);\n }\n const cached = this.methodOverrideCache.get(node);\n if (cached !== undefined) {\n return cached === JAVA_MEMO_UNDEFINED ? undefined : cached;\n }\n const result = this.javaMethodOverrideFromIndex(node);\n this.methodOverrideCache.set(node, result === undefined ? JAVA_MEMO_UNDEFINED : result);\n return result;\n }\n\n // BaseTranspiler.getMethodOverride answered from a per-class ancestor chain of\n // name -> last method maps (the furthest ancestor declaring the name wins, as there)\n private overrideChainCache = new WeakMap[] | null>();\n private javaMethodOverrideFromIndex(node: Node): Node {\n const classDeclaration = node.parent;\n if (!isClassDeclaration(classDeclaration) || !(classDeclaration as any).heritageClauses) {\n return undefined;\n }\n let chain = this.overrideChainCache.get(classDeclaration);\n if (chain === undefined) {\n chain = [];\n let parentClass = getAllSuperTypeNodes(classDeclaration)[0];\n while (parentClass !== undefined) {\n const parentClassDecl = this.getChecker().getTypeAtLocation(parentClass)?.getSymbol()?.valueDeclaration?.resolve();\n if (parentClassDecl === undefined) {\n chain = null; // the base path warns and answers undefined\n break;\n }\n const byName = new Map();\n for (const elem of (parentClassDecl as any).members ?? []) {\n if (isMethodDeclaration(elem)) {\n byName.set(elem.name.getText().trim(), elem);\n }\n }\n chain.push(byName);\n parentClass = getAllSuperTypeNodes(parentClassDecl)[0] ?? undefined;\n }\n this.overrideChainCache.set(classDeclaration, chain);\n }\n if (chain === null) {\n return super.getMethodOverride(node);\n }\n const name = (node as any).name.text;\n let method = undefined;\n for (const byName of chain) {\n method = byName.get(name) ?? method;\n }\n return method;\n }\n\n checkerOrUndefined(): Checker | undefined {\n const checker = super.checkerOrUndefined();\n return checker === undefined ? undefined : memoizeJavaCheckerCalls(checker);\n }\n\n // optional proof of the concrete printed Java type of an expression, installed by the embedding\n // build layer for the locals it retypes (ccxt: build/java-local-types.js); it must match the\n // declared type or the operator will not compile. Only `String` is consumed (native `+` anchor).\n javaExpressionTypeResolver?: (node) => string | undefined;\n\n // the embedding build layer (build/java-local-types.js) installs this: it names the\n // Java type of a local whose printed declaration line it rewrote (`Long`/`Double`).\n // The arithmetic rule reads it for identifier operands only.\n\n countRequiredParameters(declaration) {\n // parameters with no default, no question token and no rest are required positionally\n return (declaration?.parameters ?? [])\n .filter((p) => p.initializer === undefined && p.questionToken === undefined && p.dotDotDotToken === undefined).length;\n }\n\n printArgsForCallExpression(node, identation) {\n const fullArity = this.javaFullArityCallArguments(node.arguments ?? [], node, identation);\n if (fullArity !== undefined) {\n return fullArity;\n }\n let args: readonly any[] = node.arguments ?? [];\n const callee = node.expression;\n const isThisCall = callee?.kind === SyntaxKind.PropertyAccessExpression\n && callee.expression?.kind === SyntaxKind.ThisKeyword;\n if (isThisCall && args.length > 0) {\n const last = args[args.length - 1];\n const isNullish = last.kind === SyntaxKind.NullKeyword\n || (last.kind === SyntaxKind.Identifier && last.text === 'undefined');\n // the trailing nullish may only be dropped when it sits in the OPTIONAL tail\n // of the resolved signature - a required positional parameter passed as an\n // explicit undefined (e.g. dydx signDydxTx) must be kept, otherwise the\n // emitted call breaks arity, see https://github.com/ccxt/ccxt/actions/runs/31321542066\n let inOptionalTail = false;\n if (isNullish) {\n const signature = this.getChecker().getResolvedSignature(node);\n const declaration = signature?.declaration?.resolve();\n if (declaration !== undefined) {\n inOptionalTail = args.length > this.countRequiredParameters(declaration);\n }\n }\n if (isNullish && inOptionalTail) {\n // drop exactly one trailing null/undefined argument: the generated java\n // surface is uniformly (required..., Object... optionals), and a bare\n // trailing null is ambiguous to javac (\"non-varargs call of varargs\n // method with inexact argument type for last parameter\"). Omission is\n // behaviorally identical - both Helpers.getArg and SafeMethods.opt\n // treat a null varargs array and an empty one the same, see\n // https://github.com/ccxt/ccxt/pull/29617 for the warning inventory\n args = args.slice(0, -1);\n }\n }\n return this.javaPrintCallArguments(args, node, identation);\n }\n\n // a call into a method whose fixed parameter prints a native type: generated locals are `Object`,\n // so the argument carries the same checkcast as native map/string reads. The checker proved the\n // argument assignable to the parameter, so the declared type describes the value received.\n javaPrintCallArguments(args, node, identation) {\n const superCore = this.javaSuperCoreCallArguments(args, node, identation);\n if (superCore !== undefined) {\n return superCore;\n }\n const scheduled = this.javaScheduledCallArguments(args, node, identation);\n if (scheduled !== undefined) {\n return scheduled;\n }\n const spawnTypes = this.javaSpawnCallParameterTypes(node);\n const parameterTypes = spawnTypes !== undefined ? spawnTypes : this.javaNativeCallParameterTypes(node);\n return args.map((a, i) => {\n const parsedArg = this.printNode(a, identation).trim();\n const type = parameterTypes[i];\n if (type === undefined || this.javaNativeArgumentAlreadyTyped(a, type)) {\n return parsedArg;\n }\n // the checkcast carries its own parentheses: a bare `(T) cond ? a : b` binds the\n // condition, not the whole argument\n return `(${type}) (${parsedArg})`;\n }).join(\", \");\n }\n\n // the implementation declaration of a resolved method (an overload signature has no body)\n javaMethodImplementation(declaration) {\n if (declaration === undefined || !isMethodDeclaration(declaration)) {\n return undefined;\n }\n if (declaration.body !== undefined) {\n return declaration;\n }\n try {\n const symbol = this.getChecker().getSymbolAtLocation(declaration.name);\n return symbol?.declarations?.map((d) => d.resolve()).find((d) => isMethodDeclaration(d) && d.body !== undefined);\n } catch (e) {\n return undefined;\n }\n }\n\n // a method this printer emits with its single typed signature: hand-written Java declares\n // ts/src/base/** except the base tiers below their transpile delimiter\n javaIsPrintedMethod(method): boolean {\n if (method === undefined || !isMethodDeclaration(method) || method.body === undefined\n || !isClassDeclaration(method.parent)) {\n return false;\n }\n const file = method.getSourceFile();\n const fileName = file.fileName.replace(/\\\\/g, '/');\n if (!/(^|\\/)ts\\/src\\//.test(fileName)) {\n return true;\n }\n if (JAVA_NATIVE_PARAMETER_BASE_FILES.test(fileName)) {\n const delimiter = file.text.indexOf(JAVA_TRANSPILE_DELIMITER);\n return (delimiter >= 0 && method.pos > delimiter)\n || JAVA_HANDWRITTEN_FULL_ARITY.has((method.name as any)?.text);\n }\n // every class outside the hand-written tiers is printed (exchanges, tests, ...)\n return !JAVA_HANDWRITTEN_TIER_FILES.test(fileName);\n }\n\n javaHasOptionalParameter(method): boolean {\n return (method?.parameters ?? []).some((p) => p.initializer !== undefined || p.questionToken !== undefined);\n }\n\n // a call into a printed method with optional parameters passes every parameter: omitted or\n // `undefined` slots take the TS default, fixed slots keep the native checkcast\n javaFullArityCallArguments(args, node, identation): string | undefined {\n const callee = node.expression;\n if (callee?.kind !== SyntaxKind.PropertyAccessExpression\n || callee.expression?.kind === SyntaxKind.SuperKeyword) {\n return undefined;\n }\n let method;\n try {\n method = this.javaMethodImplementation(this.getChecker().getResolvedSignature(node)?.declaration?.resolve())\n ?? this.javaAnyReceiverBaseMethod(callee);\n } catch (e) {\n return undefined;\n }\n return this.javaFullArityArguments(method, args, identation);\n }\n\n // an `any` receiver (the tests' `exchange: any`) compiles against the Java Exchange class:\n // bind the base Exchange method of that name when it is implemented exactly once\n javaAnyReceiverBaseMethod(callee) {\n const type = this.getChecker().getTypeAtLocation(callee.expression);\n if ((type.flags & TypeFlags.Any) === 0) {\n return undefined;\n }\n const methods = this.baseExchangeMethodsByName().get(callee.name?.text as string);\n return methods?.length === 1 ? methods[0] : undefined;\n }\n\n private _baseExchangeMethodsByName = new WeakMap>();\n baseExchangeMethodsByName(): Map {\n const program = this.getProgram();\n const cached = this._baseExchangeMethodsByName.get(program);\n if (cached !== undefined) {\n return cached;\n }\n const names = new Map();\n const fileName = program.getSourceFileNames()\n .find((f) => /(^|[\\\\/])ts[\\\\/]src[\\\\/]base[\\\\/]Exchange\\.ts$/.test(f));\n const file = fileName !== undefined ? program.getSourceFile(fileName) : undefined;\n // the implementations live on BaseExchange; Exchange only adds its own tier, and a name\n // the base class implements binds there (the receiver compiles against BaseExchange)\n for (const className of ['BaseExchange', 'Exchange']) {\n const cls = file?.statements.find((s) => isClassDeclaration(s) && s.name?.text === className) as any;\n const own = new Map();\n for (const member of cls?.members ?? []) {\n if (isMethodDeclaration(member) && member.body !== undefined && isIdentifier(member.name)) {\n own.set(member.name.text, (own.get(member.name.text) ?? []).concat([member]));\n }\n }\n own.forEach((methods, key) => names.has(key) || names.set(key, methods));\n }\n this._baseExchangeMethodsByName.set(program, names);\n return names;\n }\n\n javaFullArityArguments(method, args, identation): string | undefined {\n if (!this.javaIsPrintedMethod(method) || !this.javaHasOptionalParameter(method)) {\n return undefined;\n }\n const params = method.parameters;\n if (args.length > params.length || params.some((p) => p.dotDotDotToken !== undefined)\n || args.some((a) => a.kind === SyntaxKind.SpreadElement)) {\n return undefined;\n }\n const types = this.javaCoreParameterTypes(method);\n return params.map((p, i) => {\n const arg = args[i];\n if (arg === undefined || (p.initializer !== undefined && this.javaIsUndefinedLiteral(arg))) {\n return this.javaCoreDefaultArgument(p, types[i]);\n }\n const printed = this.printNode(arg, identation).trim();\n if (p.initializer !== undefined) {\n return this.javaArgumentHasType(arg, types[i]) || types[i] === 'Object'\n ? (this.javaIsUndefinedLiteral(arg) ? 'null' : printed)\n : this.javaConvertToCoreType(types[i], printed, arg);\n }\n const native = this.javaNativeParameterType(p);\n if (native === undefined || this.javaNativeArgumentAlreadyTyped(arg, native)) {\n return printed;\n }\n return `(${native}) (${printed})`;\n }).join(', ');\n }\n\n javaIsUndefinedLiteral(node): boolean {\n return node?.kind === SyntaxKind.Identifier && node.text === 'undefined';\n }\n\n // `this.spawn(this.m, a..)` / `this.delay(ms, this.m, a..)`: the ccxt post-pass turns the\n // reference into a lambda calling `this.m(a..)`, so those arguments take m's full arity\n javaScheduledCallArguments(args, node, identation): string | undefined {\n const callee = node.expression;\n if (callee?.kind !== SyntaxKind.PropertyAccessExpression\n || callee.expression?.kind !== SyntaxKind.ThisKeyword) {\n return undefined;\n }\n const at = callee.name?.text === 'spawn' ? 0 : (callee.name?.text === 'delay' ? 1 : -1);\n const reference = at >= 0 ? args[at] : undefined;\n if (reference?.kind !== SyntaxKind.PropertyAccessExpression\n || reference.expression?.kind !== SyntaxKind.ThisKeyword) {\n return undefined;\n }\n let method;\n try {\n const symbol = this.getChecker().getSymbolAtLocation(reference.name);\n method = this.javaMethodImplementation(symbol?.valueDeclaration?.resolve() ?? symbol?.declarations?.[0]?.resolve());\n } catch (e) {\n return undefined;\n }\n const forwarded = this.javaFullArityArguments(method, args.slice(at + 1), identation);\n if (forwarded === undefined) {\n return undefined;\n }\n const head = args.slice(0, at + 1).map((a) => this.printNode(a, identation).trim());\n return head.concat(forwarded.length > 0 ? [forwarded] : []).join(', ');\n }\n\n // `super.x(..)` into a split method must bind the typed core: an ancestor bridge re-dispatches\n // through `this`, which lands back in the overriding core (infinite recursion)\n javaSuperCoreCallArguments(args, node, identation): string | undefined {\n const callee = node.expression;\n if (callee?.kind !== SyntaxKind.PropertyAccessExpression\n || callee.expression?.kind !== SyntaxKind.SuperKeyword) {\n return undefined;\n }\n let declaration;\n try {\n declaration = this.javaMethodImplementation(this.getChecker().getResolvedSignature(node)?.declaration?.resolve());\n } catch (e) {\n return undefined;\n }\n if (declaration === undefined || !this.hasDefaultedTail(declaration)) {\n return undefined;\n }\n const params = (declaration as any).parameters;\n if (params.some((p) => p.dotDotDotToken !== undefined)) {\n return undefined;\n }\n if (args.length > params.length) {\n return undefined;\n }\n const types = this.javaCoreParameterTypes(declaration);\n return params.map((p, i) => (i < args.length\n ? (this.javaArgumentHasType(args[i], types[i]) ? this.printNode(args[i], identation).trim()\n : this.javaConvertToCoreType(types[i], this.printNode(args[i], identation).trim(), args[i]))\n : this.javaCoreDefaultArgument(p, types[i]))).join(', ');\n }\n\n // an argument that is a parameter of the enclosing method already printed with this type\n javaArgumentHasType(arg, type: string): boolean {\n if (arg?.kind !== SyntaxKind.Identifier) {\n return false;\n }\n let declaration;\n try {\n declaration = this.getChecker().getSymbolAtLocation(arg)?.valueDeclaration?.resolve();\n } catch (e) {\n return false;\n }\n if (declaration === undefined || !isParameterDeclaration(declaration)) {\n return false;\n }\n const method = declaration.parent;\n if (!isMethodDeclaration(method) && this.ReassignedVars[this.getVarKey(declaration)] && this.isAsyncFunction(method)) {\n return false; // an async function body reads an `Object` copy\n }\n const printed = declaration.initializer !== undefined\n ? (this.hasDefaultedTail(method) ? this.javaOptionalParameterJavaType(declaration) : 'Object')\n : (this.printParameterType(declaration) || 'Object').trim();\n return this.javaErasure(printed) === this.javaErasure(type);\n }\n\n // the printed Java type of every parameter of a split method's typed core\n javaCoreParameterTypes(method): string[] {\n return method.parameters.map((p) => (p.initializer !== undefined\n ? this.javaOptionalParameterJavaType(p)\n : (this.printParameterType(p) || 'Object').trim()));\n }\n\n // an omitted parameter of a typed-core call: its TS default, typed like the front's reader\n javaCoreDefaultArgument(param, type: string): string {\n const initializer = param.initializer;\n // a default that reads other parameters or has effects is applied by the callee\n const value = initializer === undefined || !this.isPureInitializer(initializer) ? 'null' : this.printNode(initializer, 0);\n if (value === 'null') {\n return `(${type}) null`;\n }\n if (type === 'Long' && /^-?\\d+$/.test(value)) {\n return value + 'L';\n }\n if (type === JAVA_STRING_LIST_TYPE && isArrayLiteralExpression(initializer) && initializer.elements.length === 0) {\n return 'new java.util.ArrayList()';\n }\n if (type === 'Object' || (type === 'String' && isStringLiteralLikeNode(initializer))\n || (type === 'java.util.Map' && isObjectLiteralExpression(initializer))) {\n return value;\n }\n return this.javaConvertToCoreType(type, value, initializer);\n }\n\n // a value of any static type converted to a typed-core parameter, with the fronts' semantics\n javaConvertToCoreType(type: string, printed: string, node): string {\n if (node?.kind === SyntaxKind.NullKeyword\n || (node?.kind === SyntaxKind.Identifier && node.text === 'undefined')) {\n return `(${type}) null`;\n }\n if (type === 'Object') {\n return `(Object) (${printed})`;\n }\n if (this.javaLocalDeclaredAs(node, printed, type)) {\n return printed;\n }\n if (type === 'Long') {\n if (/^-?\\d+$/.test(printed) && isNumericLiteral(isPrefixUnaryExpression(node) ? node.operand : node)) {\n return printed + 'L';\n }\n return /^-?\\d+L$/.test(printed) ? printed : `Helpers.toLongOrNull(${printed})`;\n }\n if (type === 'String') {\n return this.javaNativeArgumentAlreadyTyped(node, type) ? printed : `Helpers.toStringArg(${printed})`;\n }\n if (type === 'java.util.Map') {\n return `Helpers.toMapArg(${printed})`;\n }\n if (type === JAVA_STRING_LIST_TYPE) {\n return `Helpers.toStringListArg(${printed})`;\n }\n return `(${type}) (${printed})`;\n }\n\n // an identifier whose final Java declaration (the build layer's table, or a natively typed\n // parameter) is exactly the core type and which prints under its own name: no conversion\n javaLocalDeclaredAs(node, printed: string, type: string): boolean {\n if (node === undefined || !isIdentifier(node) || printed !== node.text) {\n return false;\n }\n const declaration = this.javaDeclarationOfIdentifier(node);\n if (declaration === undefined || !isVariableDeclaration(declaration)) {\n return this.javaArgumentHasType(node, type)\n && (type !== JAVA_STRING_LIST_TYPE || this.javaDeclaredTypeOf(node) === JAVA_STRING_LIST_TYPE);\n }\n const declared = this.javaDeclaredTypeOf(node);\n return declared !== undefined && declared.replace(/\\s+/g, '').replace(/^java\\.util\\./, '')\n === type.replace(/\\s+/g, '').replace(/^java\\.util\\./, '');\n }\n\n // Java erasure of a printed type, for override/bridge comparisons\n javaErasure(type: string): string {\n return type.replace(/<.*>/, '').replace(/^java\\.util\\./, '').trim();\n }\n\n // An override whose typed core differs from an ancestor's (another parameter count, another\n // default position or type) no longer overrides it in Java: a bridge with the ancestor's\n // signature forwards to this method, so base code calling the ancestor core reaches it.\n printOverrideBridges(node, identation): string {\n const ownTypes = this.javaCoreParameterTypes(node);\n const ownKey = ownTypes.map((t) => this.javaErasure(t)).join(',');\n const seen = new Set();\n let out = '';\n let ancestor;\n try {\n ancestor = this.getMethodOverride(node);\n } catch (e) {\n return '';\n }\n while (ancestor !== undefined) {\n if (this.hasDefaultedTail(ancestor)) {\n const ancestorTypes = this.javaCoreParameterTypes(ancestor);\n const key = ancestorTypes.map((t) => this.javaErasure(t)).join(',');\n if (key !== ownKey && !seen.has(key)) {\n seen.add(key);\n out += this.printOverrideBridge(node, ancestor, ancestorTypes, ownTypes, identation);\n }\n }\n try {\n ancestor = this.getMethodOverride(ancestor);\n } catch (e) {\n ancestor = undefined;\n }\n }\n return out;\n }\n\n printOverrideBridge(node, ancestor, ancestorTypes: string[], ownTypes: string[], identation): string {\n const name = this.transformMethodNameIfNeeded(node.name.text);\n const ancestorNames = ancestor.parameters.map((p) => this.printNode(p.name, 0));\n const ancestorDef = this.printMethodDefinition(ancestor, identation,\n () => ancestorTypes.map((t, i) => `${t} ${ancestorNames[i]}`).join(', '));\n const forwarded = node.parameters.map((p, i) => (i < ancestorNames.length\n ? (this.javaErasure(ownTypes[i]) === this.javaErasure(ancestorTypes[i]) ? ancestorNames[i]\n : this.javaConvertToCoreType(ownTypes[i], ancestorNames[i], undefined))\n : this.javaCoreDefaultArgument(p, ownTypes[i]))).join(', ');\n const call = `this.${name}(${forwarded})`;\n const returnOf = (def: string) => def.match(/(?:public|protected|private)\\s+(?:static\\s+)?(.+?)\\s+\\w+\\s*\\(/)?.[1]?.trim() ?? 'Object';\n const returnType = returnOf(ancestorDef);\n const ownReturn = returnOf(this.printMethodDefinition(node, identation, () => ''));\n const body = returnType === 'void' ? `${call};`\n : returnType === ownReturn ? `return ${call};` : `return (${returnType}) (Object) ${call};`;\n return \"\\n\" + ancestorDef + this.getBlockOpen(identation)\n + this.getIden(identation + 1) + body\n + this.getBlockClose(identation);\n }\n\n // `this.spawn(this.someMethod, args...)`: the spawned work executes `this.someMethod(args)`\n // (the ccxt post-pass rewrites the reference into a lambda), so the arguments belong to the\n // referenced method's signature, not to spawn's `...args` - each one carries the checkcast\n javaSpawnCallParameterTypes(node): (string | undefined)[] | undefined {\n const callee = node.expression;\n if (callee?.kind !== SyntaxKind.PropertyAccessExpression\n || callee.expression?.kind !== SyntaxKind.ThisKeyword\n || callee.name?.text !== 'spawn') {\n return undefined;\n }\n const reference = (node.arguments ?? [])[0];\n if (reference?.kind !== SyntaxKind.PropertyAccessExpression\n || reference.expression?.kind !== SyntaxKind.ThisKeyword\n || reference.name?.text === undefined) {\n return undefined;\n }\n let declaration;\n try {\n const symbol = this.getChecker().getSymbolAtLocation(reference.name);\n declaration = symbol?.valueDeclaration?.resolve() ?? symbol?.declarations?.[0]?.resolve();\n } catch (e) {\n return undefined;\n }\n const parameters = (declaration as any)?.parameters;\n if (parameters === undefined) {\n return undefined;\n }\n return (node.arguments ?? []).map((a, i) => {\n if (i === 0) {\n return undefined;\n }\n const param = parameters[i - 1];\n if (param === undefined || !isParameterDeclaration(param)) {\n return undefined;\n }\n return this.javaNativeParameterType(param);\n });\n }\n\n // the argument is a literal (or a String the embedding build layer's resolver proves)\n // and the parameter declares exactly that type, so no cast is needed. Every other\n // argument prints from a local the printer declares `Object`, and needs the checkcast.\n javaNativeArgumentAlreadyTyped(arg, type: string) {\n if (arg.kind === SyntaxKind.NullKeyword) {\n return true;\n }\n // an object literal prints a `HashMap` instance, already a Map\n if (type === JAVA_NATIVE_RETURN_MAP_TYPE && isObjectLiteralExpression(arg)) {\n return true;\n }\n if (type !== 'String') {\n return false;\n }\n if (isStringLiteralLikeNode(arg)) {\n return true;\n }\n return this.javaProvableString(arg);\n }\n\n // the native printed type of each argument position of a call, when the resolved\n // signature declares that parameter natively\n javaNativeCallParameterTypes(node): (string | undefined)[] {\n const checker: any = this.checkerOrUndefined();\n if (checker === undefined) {\n return [];\n }\n const declaration = checker.getResolvedSignature(node)?.declaration?.resolve();\n const parameters = (declaration as any)?.parameters;\n if (parameters === undefined) {\n return [];\n }\n return (node.arguments ?? []).map((a, i) => {\n const param = parameters[i];\n if (param === undefined || !isParameterDeclaration(param)) {\n return undefined;\n }\n return this.javaNativeParameterType(param);\n });\n }\n\n binaryExpressionsWrappers;\n\n varListFromObjectLiterals = {};\n // binary operators whose printed Java is a primitive boolean: Helpers.isEqual (and the\n // negated `!Helpers.isEqual` / `<` / `>` / `<=` / `>=` family), Helpers.inOp,\n // Helpers.isInstance and the native `&&` / `||`\n javaBooleanOperators = Array.from(JAVA_BOOLEAN_OPERATOR_KINDS);\n // Per-function analysis results. Populated by analyzeFinalVars at the start of\n // printFunctionBody and consumed during printing of the same function body.\n usageToFinalName: WeakMap = new WeakMap();\n // Stack of emitted-finalName sets, one entry per enclosing block. Pushed on block\n // entry, popped on exit. Used by buildFinalVarDeclarations to dedup: skip if the\n // finalName is already in scope via any ancestor.\n finalVarScopeStack: Array> = [];\n // Identifiers rewritten in place to their finalXxx name during the current emit.\n // The parsed ts.SourceFile is cached and reused across transpile calls, so the\n // rewrite has to be undone when the emit ends — otherwise a second emit of the\n // same file reads `finalX` where the first read `x`, the symbol no longer\n // resolves, and the hoisted `final Object finalX = x;` declaration is dropped\n // while its usages remain.\n finalVarMutations: Array<{ node: any; text: any; ownGetFullText: boolean; getFullText: any }> = [];\n // Java expression passed as the second supplyAsync argument for async methods.\n // Empty (the default) emits the single-argument, common-pool supplyAsync form.\n asyncExecutor = '';\n // Static method emitted in place of java.util.concurrent.CompletableFuture.supplyAsync\n // for async methods. The callee owns the executor choice, so no second argument is emitted.\n asyncSupplier = '';\n\n constructor(config = {}) {\n config[\"parser\"] = Object.assign({}, parserConfig, config[\"parser\"] ?? {});\n super(config);\n\n this.requiresParameterType = true;\n this.requiresReturnType = true;\n this.asyncTranspiling = true;\n this.implicitAsyncTranspiling = true;\n this.supportsFalsyOrTruthyValues = false;\n this.requiresCallExpressionCast = true;\n this.id = \"Java\";\n\n this.initConfig();\n this.applyUserOverrides(config);\n this.asyncExecutor = config['asyncExecutor'] ?? '';\n this.asyncSupplier = config['asyncSupplier'] ?? '';\n }\n\n initConfig() {\n this.LeftPropertyAccessReplacements = {\n // 'this': '$this',\n };\n\n this.RightPropertyAccessReplacements = {\n // Java list/string methods (lowerCamelCase)\n push: \"add\",\n indexOf: \"indexOf\",\n toUpperCase: \"toUpperCase\",\n toLowerCase: \"toLowerCase\",\n toString: \"toString\",\n };\n\n this.FullPropertyAccessReplacements = {\n \"JSON.parse\": \"parseJson\",\n \"console.log\": \"System.out.println\",\n \"Number.MAX_SAFE_INTEGER\": \"Long.MAX_VALUE\",\n \"Math.min\": \"Math.min\",\n \"Math.max\": \"Math.max\",\n \"Math.log\": \"Math.log\",\n \"Math.abs\": \"Math.abs\",\n \"Math.floor\": \"Math.floor\",\n \"Math.pow\": \"Math.pow\",\n // 'Promise.all' handled via promiseAll wrapper\n };\n\n this.CallExpressionReplacements = {\n 'parseInt': \"Helpers.parseInt\",\n \"parseFloat\": \"Helpers.parseFloat\",\n // Add ad-hoc function call rewrites here if you need them\n };\n\n\n this.ReservedKeywordsReplacements = {\n string: \"str\",\n object: \"obj\",\n params: \"parameters\",\n // base: \"bs\",\n internal: \"intern\",\n event: \"eventVar\",\n fixed: \"fixedVar\",\n final: \"finalVar\",\n native: \"nativeVar\",\n // add Java keywords if you need to avoid collisions (e.g., enum, assert)\n };\n\n this.VariableTypeReplacements = {\n string: \"String\",\n Str: \"String\",\n number: \"double\",\n Int: \"long\",\n Num: \"double\",\n Dict: \"java.util.Map\",\n Strings: \"java.util.List\",\n List: \"java.util.List\",\n boolean: \"boolean\",\n object: \"Object\",\n };\n\n this.ArgTypeReplacements = { ...this.VariableTypeReplacements };\n\n this.binaryExpressionsWrappers = {\n [SyntaxKind.EqualsEqualsToken]: [this.EQUALS_EQUALS_WRAPPER_OPEN, this.EQUALS_EQUALS_WRAPPER_CLOSE],\n [SyntaxKind.EqualsEqualsEqualsToken]: [this.EQUALS_EQUALS_WRAPPER_OPEN, this.EQUALS_EQUALS_WRAPPER_CLOSE],\n [SyntaxKind.ExclamationEqualsToken]: [this.DIFFERENT_WRAPPER_OPEN, this.DIFFERENT_WRAPPER_CLOSE],\n [SyntaxKind.ExclamationEqualsEqualsToken]: [this.DIFFERENT_WRAPPER_OPEN, this.DIFFERENT_WRAPPER_CLOSE],\n [SyntaxKind.GreaterThanToken]: [this.GREATER_THAN_WRAPPER_OPEN, this.GREATER_THAN_WRAPPER_CLOSE],\n [SyntaxKind.GreaterThanEqualsToken]: [this.GREATER_THAN_EQUALS_WRAPPER_OPEN, this.GREATER_THAN_EQUALS_WRAPPER_CLOSE],\n [SyntaxKind.LessThanToken]: [this.LESS_THAN_WRAPPER_OPEN, this.LESS_THAN_WRAPPER_CLOSE],\n [SyntaxKind.LessThanEqualsToken]: [this.LESS_THAN_EQUALS_WRAPPER_OPEN, this.LESS_THAN_EQUALS_WRAPPER_CLOSE],\n [SyntaxKind.PlusToken]: [this.PLUS_WRAPPER_OPEN, this.PLUS_WRAPPER_CLOSE],\n [SyntaxKind.MinusToken]: [this.MINUS_WRAPPER_OPEN, this.MINUS_WRAPPER_CLOSE],\n [SyntaxKind.AsteriskToken]: [this.MULTIPLY_WRAPPER_OPEN, this.MULTIPLY_WRAPPER_CLOSE],\n [SyntaxKind.PercentToken]: [this.MOD_WRAPPER_OPEN, this.MOD_WRAPPER_CLOSE],\n [SyntaxKind.SlashToken]: [this.DIVIDE_WRAPPER_OPEN, this.DIVIDE_WRAPPER_CLOSE],\n };\n }\n\n getBlockOpen(identation) {\n return \"\\n\" + this.getIden(identation) + this.BLOCK_OPENING_TOKEN + \"\\n\";\n }\n\n\n getCustomClassName(node) {\n return this.capitalize(node.name.text);\n }\n\n getClassModifier(node) {\n return \"public \";\n }\n\n printSuperCallInsideConstructor(_node, _identation) {\n // Java allows \"super(...)\" as the first line; we already inject it when needed.\n return \"\";\n }\n\n printNumericLiteral(node) {\n const javaMax = 2147483647;\n const nodeText = node.text;\n if (Number(nodeText) > javaMax && Number.isInteger(Number(nodeText)) && node.text.indexOf('e') === -1) {\n return `${nodeText}L`;\n }\n return node.text;\n }\n\n printIdentifier(node) {\n let idValue = node.text ?? node.text;\n\n if (this.ReservedKeywordsReplacements[idValue]) {\n idValue = this.ReservedKeywordsReplacements[idValue];\n }\n\n if (idValue === \"undefined\") {\n return this.UNDEFINED_TOKEN;\n }\n\n const defaulted = this.javaDefaultedLocalName(node);\n if (defaulted !== undefined) {\n return defaulted;\n }\n\n // keep the same class-reference typeof-guarding logic as your original file,\n // but run the syntactic (parent-position) checks first: they exclude the vast\n // majority of identifiers without paying for a type-checker lookup\n const isInsideNewExpression =\n node?.parent?.kind === SyntaxKind.NewExpression;\n const isInsideCatch =\n node?.parent?.kind === SyntaxKind.ThrowStatement;\n const isLeftSide =\n node?.parent?.name === node || node?.parent?.left === node;\n const isCallOrPropertyAccess =\n node?.parent?.kind === SyntaxKind.PropertyAccessExpression ||\n node?.parent?.kind === SyntaxKind.ElementAccessExpression;\n if (!isLeftSide && !isCallOrPropertyAccess && !isInsideCatch && !isInsideNewExpression) {\n const type = this.getChecker().getTypeAtLocation(node);\n const typeSymbol = type?.getSymbol?.();\n if (typeSymbol !== undefined) {\n const decl = (typeSymbol?.declarations ?? []).map((d) => d.resolve());\n if (decl.length > 0 && decl[0].getSourceFile().fileName.indexOf(\"typescript\") === -1) {\n const symbol = this.getChecker().getSymbolAtLocation(node);\n const first = symbol?.declarations[0]?.resolve();\n const isClassDeclaration = !!symbol && (first.kind === SyntaxKind.ClassDeclaration\n || (first.kind === SyntaxKind.ImportSpecifier\n && this.getChecker().getAliasedSymbol(symbol)?.declarations[0]?.resolve()?.kind === SyntaxKind.ClassDeclaration));\n if (isClassDeclaration) {\n return `${idValue}.class`;\n }\n }\n }\n }\n\n return this.transformIdentifier(node, idValue);\n }\n\n printConstructorDeclaration(node, identation) {\n const classNode = node.parent;\n const className = this.printNode(classNode.name, 0);\n const args = this.printMethodParameters(node);\n const constructorBody = this.printFunctionBody(node, identation);\n\n // find super call inside constructor and extract params\n let superCallParams = \"\";\n let hasSuperCall = false;\n node.body?.statements.forEach((statement) => {\n const expression = isExpressionStatement(statement) ? statement.expression : undefined;\n if (expression && isCallExpression(expression) && expression.expression.getText().trim() === \"super\") {\n hasSuperCall = true;\n superCallParams = expression.arguments.map((a) => this.printNode(a, identation).trim()).join(\", \");\n }\n });\n\n const header = this.getIden(identation) + className + \"(\" + args + \")\";\n // In Java, super(...) must be the first statement inside the body.\n return header + (hasSuperCall ? this.injectLeadingInBody(constructorBody, `super(${superCallParams});`) : constructorBody);\n }\n\n injectLeadingInBody(body, firstLine) {\n // body is \"{\\n ...\\n}\"\n const lines = body.split(\"\\n\");\n if (lines.length >= 2) {\n lines.splice(1, 0, this.getIden(1) + firstLine);\n }\n return lines.join(\"\\n\");\n }\n\n printDynamicCall(node, identation) {\n // Use reflection helper exactly like before; Java runtime should provide callDynamically(Object, String, Object[])\n const elementAccess = node.expression;\n if (elementAccess?.kind === SyntaxKind.ElementAccessExpression) {\n const parsedArg = node.arguments?.map((n) => this.printNode(n, identation).trimStart()).join(\", \") ?? \"\";\n const target = this.printNode(elementAccess.expression, 0);\n const propName = this.printNode(elementAccess.argumentExpression, 0);\n return `${this.DYNAMIC_CALL_OPEN}${target}, ${propName}, new Object[] { ${parsedArg} })`;\n }\n return undefined;\n }\n\n // printElementAccessExpressionExceptionIfAny(node) {\n // const tsKind = ts.SyntaxKind;\n // if (node.expression.kind === tsKind.CallExpression) {\n // const callExp = node.expression;\n // const calleeText = callExp.expression.getText();\n // if (calleeText.endsWith('.split') || calleeText.toLowerCase().includes('split')) {\n // // print Split call normally (should already close with ))\n // let splitCall = this.printNode(callExp, 0).trim();\n // if (!splitCall.endsWith(')')) {\n // splitCall += ')';\n // }\n // const idxArg = this.printNode(node.argumentExpression, 0);\n // return `GetValue(${splitCall}, ${idxArg})`;\n // }\n // }\n // // default: no exception\n // return undefined;\n // }\n\n printWrappedUnknownThisProperty(node) {\n const type = this.getChecker().getResolvedSignature(node);\n if (type?.declaration === undefined) {\n const parsedArguments = node.arguments?.map((a) => this.printNode(a, 0)).join(\", \") || \"\";\n const propName = node.expression?.name.text;\n return `${this.DYNAMIC_CALL_OPEN}this, \"${propName}\", new Object[] { ${parsedArguments} })`;\n }\n return undefined;\n }\n\n printOutOfOrderCallExpressionIfAny(node, identation) {\n if (node.expression.kind === SyntaxKind.Identifier) {\n const callee = node.expression.text;\n if (callee === 'parseInt' || callee === 'parseFloat') {\n const nativeParse = this.printNativeScalarParse(node, callee);\n if (nativeParse !== undefined) {\n return nativeParse;\n }\n }\n }\n if (node.expression.kind === SyntaxKind.PropertyAccessExpression) {\n const expressionText = node.expression.getText().trim();\n const args = node.arguments;\n if (args.length === 1) {\n const parsedArg = this.printNode(args[0], 0);\n switch (expressionText) {\n case \"Math.abs\":\n return `Helpers.mathAbs(Double.parseDouble(${this.javaStringBoxText(args[0], parsedArg)}))`;\n }\n } else if (args.length === 2) {\n const parsedArg1 = this.printNode(args[0], 0);\n const parsedArg2 = this.printNode(args[1], 0);\n switch (expressionText) {\n case \"Math.min\":\n case \"Math.max\": {\n const native = this.printNativeMathMinMax(\n node, args[0], args[1], parsedArg1, parsedArg2, expressionText === \"Math.min\" ? \"min\" : \"max\");\n if (native !== undefined) {\n return native;\n }\n const wrapper = expressionText === \"Math.min\" ? \"Helpers.mathMin(\" : \"Helpers.mathMax(\";\n return `${wrapper}${parsedArg1}, ${parsedArg2})`;\n }\n case \"Math.pow\":\n // both arguments are Double.parseDouble results, so Helpers.mathPow always\n // takes its Number branch and returns the same double java.lang.Math.pow does\n return `Math.pow(Double.parseDouble(${this.javaStringBoxText(args[0], parsedArg1)}), Double.parseDouble(${this.javaStringBoxText(args[1], parsedArg2)}))`;\n }\n }\n const leftSide = node.expression?.expression;\n const leftSideText = leftSide ? this.printNode(leftSide, 0) : undefined;\n\n // wrap unknown property this.X calls\n if (\n leftSideText === this.THIS_TOKEN ||\n leftSide.getFullText().indexOf(\"(this as any)\") > -1\n ) {\n const res = this.printWrappedUnknownThisProperty(node);\n if (res) return res;\n }\n }\n\n // dynamic call: obj[prop](...)\n if (node.expression.kind === SyntaxKind.ElementAccessExpression) {\n return this.printDynamicCall(node, identation);\n }\n\n return undefined;\n }\n\n handleTypeOfInsideBinaryExpression(node, _identation) {\n const left = node.left;\n const right = node.right.text;\n const op = node.operatorToken.kind;\n const expression = left.expression;\n\n const isDifferentOperator =\n op === SyntaxKind.ExclamationEqualsEqualsToken ||\n op === SyntaxKind.ExclamationEqualsToken;\n const notOperator = isDifferentOperator ? this.NOT_TOKEN : \"\";\n\n const target = this.printNode(expression, 0);\n switch (right) {\n case \"string\":\n return `${notOperator}(${target} instanceof String)`;\n case \"number\":\n return `${notOperator}(${target} instanceof Long || ${target} instanceof Integer || ${target} instanceof Float || ${target} instanceof Double)`;\n case \"boolean\":\n return `${notOperator}(${target} instanceof Boolean)`;\n case \"object\":\n return `${notOperator}(${target} instanceof java.util.Map)`;\n case \"function\":\n // no universal Function type in Java; treat as any Method/Callable\n return `${notOperator}(${target} instanceof java.util.concurrent.Callable)`;\n }\n return undefined;\n }\n\n getVarMethodIfAny(node) {\n // should return the name of the method this node belongs to, if any;\n // the raw AST name is enough here — the result is only used as a scoping\n // key, and printNode on an identifier consults the type checker\n let current = node?.parent;\n while (current) {\n if (isMethodDeclaration(current) || isFunctionDeclaration(current)) {\n return String((current.name as any)?.text ?? '');\n }\n current = current.parent;\n }\n return 'outsideAnyMethod';\n }\n\n getVarClassIfAny(node) {\n // should return the name of the class this node belongs to, if any;\n // raw AST name for the same reason as getVarMethodIfAny\n let current = node?.parent;\n while (current) {\n if (isClassDeclaration(current)) {\n return String((current.name as any)?.text ?? '');\n }\n current = current.parent;\n }\n return '';\n }\n\n getVarKey(node) {\n const varName = node?.text ?? node?.name?.text;\n if (!varName) {\n return '';\n }\n return `${this.getVarClassIfAny(node)}-${this.getVarMethodIfAny(node)}-${varName}`;\n }\n\n // Static operand family of one side of an equality, undefined when the checker proves\n // nothing usable. Null/undefined union members are folded away: Objects.equals handles\n // those exactly like the helper, so `string | undefined` still counts as string.\n equalityOperandFamily(type: any): string | undefined {\n if (type === undefined || type === null) {\n return undefined;\n }\n const flags = type.flags;\n if (flags & TypeFlags.Intersection) {\n return undefined;\n }\n if (flags & TypeFlags.Union) {\n // `boolean` is itself the union true|false and carries the Boolean bit\n if (flags & TypeFlags.Boolean) {\n return 'boolean';\n }\n const families = new Set((type.getTypes?.() ?? []).map((t) => this.equalityOperandFamily(t)));\n families.delete(undefined as any);\n families.delete('null');\n return families.size === 1 ? families.values().next().value : undefined;\n }\n if (flags & (TypeFlags.String | TypeFlags.StringLiteral)) {\n return 'string';\n }\n if (flags & (TypeFlags.Boolean | TypeFlags.BooleanLiteral)) {\n return 'boolean';\n }\n if (flags & (TypeFlags.Null | TypeFlags.Undefined | TypeFlags.Void)) {\n return 'null';\n }\n return undefined;\n }\n\n // The null/undefined literal: its Java text is `null`, so Objects.equals(x, null)\n // is literally the identity test Helpers.isEqual performs on that operand.\n isNullishLiteral(node): boolean {\n return node?.kind === SyntaxKind.NullKeyword\n || (node?.kind === SyntaxKind.Identifier && node.text === 'undefined');\n }\n\n // ---- numeric operand kinds (java-15) ----\n // Helpers.isEqual compares numeric operands by value (integers via toLong, Double/Float via\n // toDouble, class mismatch false), so two operands of the SAME kind compare natively.\n\n // the Java kind a decimal numeric literal prints with: integer literal as `N` (int) or `NL` (long),\n // a '.'/exponent literal as a Java double. TypeScript normalizes the literal text (`1e3` -> `1000`,\n // `0x10` -> `16`, `100.0` -> `100`), so node.text is exactly what prints.\n javaEqualityLiteralKind(node) {\n if (!node) {\n return undefined;\n }\n // `-1`: the printer prints the sign in front of the literal, so the value is a Java\n // primitive of the operand's own kind — only an int-range operand keeps it (a long\n // literal would print with its own `L` suffix and the sign would not widen)\n if (node.kind === SyntaxKind.PrefixUnaryExpression && node.operator === SyntaxKind.MinusToken) {\n return this.javaIntegerLiteralKind(node.operand) === 'int' ? 'int' : undefined;\n }\n if (!isNumericLiteral(node)) {\n return undefined;\n }\n return /[.eE]/.test(node.text) ? 'double' : this.javaIntegerLiteralKind(node);\n }\n\n // `x.length` on a checker-proven String/List receiver prints a native int\n // (((String)x).length() / ((List)x).size(), see javaLengthKind). Every other\n // receiver prints Helpers.getArrayLength, whose value is not an int.\n javaNativeLengthKind(node) {\n if (node?.kind !== SyntaxKind.PropertyAccessExpression || node.name.text !== 'length') {\n return undefined;\n }\n return this.javaLengthKind(node.expression) !== undefined ? 'int' : undefined;\n }\n\n // `for (var i = ; ...; i++)`: javac infers a primitive int counter, so\n // every read of it — not only the loop condition the comparison rule sees — is a\n // native int. ++/-- keep it int and the counter cannot hold another box.\n isJavaPrimitiveCounterReference(node) {\n if (!node || node.kind !== SyntaxKind.Identifier) {\n return false;\n }\n const checker = this.getChecker();\n const symbol = checker.getSymbolAtLocation(node);\n const declaration: any = symbol?.valueDeclaration?.resolve() ?? symbol?.declarations?.[0]?.resolve();\n if (!declaration || declaration.kind !== SyntaxKind.VariableDeclaration || !isIdentifier(declaration.name)) {\n return false;\n }\n const list = declaration.parent;\n const forStatement: any = list?.parent;\n if (!list || !forStatement || forStatement.kind !== SyntaxKind.ForStatement || forStatement.initializer !== list) {\n return false;\n }\n if (list.declarations?.length !== 1 || this.javaIntegerLiteralKind(declaration.initializer) === undefined) {\n return false;\n }\n const incrementor = forStatement.incrementor;\n if (!incrementor\n || (incrementor.kind !== SyntaxKind.PostfixUnaryExpression && incrementor.kind !== SyntaxKind.PrefixUnaryExpression)\n || (incrementor.operator !== SyntaxKind.PlusPlusToken && incrementor.operator !== SyntaxKind.MinusMinusToken)\n || incrementor.operand?.kind !== SyntaxKind.Identifier) {\n return false;\n }\n const incrementorSymbol = checker.getSymbolAtLocation(incrementor.operand);\n return incrementorSymbol === undefined || symbol === undefined || incrementorSymbol === symbol;\n }\n\n // the box a printed local carries: the kind of its declaration's initializer, kept\n // only while every write in the declaring function writes the same kind (D2 scan).\n // A `const` declaration has no write to scan.\n javaLocalNumberKind(node, depth) {\n if (!node || node.kind !== SyntaxKind.Identifier) {\n return undefined;\n }\n const symbol = this.getChecker().getSymbolAtLocation(node);\n const declaration: any = symbol?.valueDeclaration?.resolve() ?? symbol?.declarations?.[0]?.resolve();\n if (!declaration || declaration.kind !== SyntaxKind.VariableDeclaration || !isIdentifier(declaration.name)) {\n return undefined;\n }\n const kind = this.javaPrintedNumberKind(declaration.initializer, depth + 1);\n if (kind === undefined) {\n return undefined;\n }\n const isConst = (declaration.parent?.flags & NodeFlags.Const) !== 0;\n if (!isConst && !this.javaWritesKeepNumberKind(declaration, symbol, kind)) {\n return undefined;\n }\n return kind;\n }\n\n // true when every assignment to the symbol inside its function writes the same\n // numeric kind; a compound assignment (`x += 1` prints Helpers.add) changes the box.\n javaWritesKeepNumberKind(declaration, symbol, kind) {\n const owner = this.enclosingFunctionLike(declaration);\n if (owner === undefined) {\n return false;\n }\n let safe = true;\n const visit = (node) => {\n if (!safe) {\n return;\n }\n if (isBinaryExpression(node)) {\n const op = node.operatorToken.kind;\n if (this.isAssignmentOperator(op) && this.expressionReferencesSymbol(node.left, symbol)) {\n if (op !== SyntaxKind.EqualsToken || this.javaPrintedNumberKind(node.right, 0) !== kind) {\n safe = false;\n return;\n }\n }\n } else if ((node.kind === SyntaxKind.ForOfStatement || node.kind === SyntaxKind.ForInStatement)\n && this.expressionReferencesSymbol(node.initializer, symbol)) {\n safe = false;\n return;\n } else if ((isPrefixUnaryExpression(node) || isPostfixUnaryExpression(node))\n && (node.operator === SyntaxKind.PlusPlusToken || node.operator === SyntaxKind.MinusMinusToken)\n && kind !== 'int' && this.expressionReferencesSymbol(node.operand, symbol)) {\n safe = false;\n return;\n }\n node.forEachChild(visit);\n };\n owner.forEachChild(visit);\n return safe;\n }\n\n expressionReferencesSymbol(node, symbol): boolean {\n if (node === undefined || symbol === undefined) {\n return false;\n }\n let found = false;\n const visit = (child) => {\n if (found) {\n return;\n }\n if (child.kind === SyntaxKind.Identifier && this.getChecker().getSymbolAtLocation(child) === symbol) {\n found = true;\n return;\n }\n child.forEachChild(visit);\n };\n visit(node);\n return found;\n }\n\n enclosingFunctionLike(node) {\n let current = node?.parent;\n while (current) {\n if (isFunctionLike(current)) {\n return current;\n }\n current = current.parent;\n }\n return undefined;\n }\n\n // box/primitive kind of an operand the printer prints as a native number, or undefined\n // when the printed value could be any box (a call, a parameter, an `any` local)\n javaPrintedNumberKind(node, depth = 0) {\n const literalKind = this.javaEqualityLiteralKind(node);\n if (literalKind !== undefined) {\n return literalKind;\n }\n const lengthKind = this.javaNativeLengthKind(node);\n if (lengthKind !== undefined) {\n return lengthKind;\n }\n if (this.isJavaPrimitiveCounterReference(node)) {\n return 'int';\n }\n const arithmeticKind = this.javaNativeArithmeticKind(node);\n if (arithmeticKind !== undefined) {\n return arithmeticKind;\n }\n return depth < 2 ? this.javaLocalNumberKind(node, depth) : undefined;\n }\n\n // numeric equality operand: the checker proves a plain number and the printed Java\n // value carries a known kind. Aliases (Int/Num), unions and `any` stay with the\n // helper, like in the arithmetic rule.\n javaEqualityNumberKind(node) {\n if (this.javaScalarFamily(node) !== 'number') {\n return undefined;\n }\n return this.javaPrintedNumberKind(node);\n }\n\n // ==/===/!=/!== become java.util.Objects.equals once the checker proves one operand is\n // a string, a boolean or the null/undefined literal: for those Helpers.isEqual reduces\n // to Objects.equals (value compare, class-strict, no numeric promotion). Two operands\n // the checker types as plain numbers compare natively when their printed Java kinds\n // match (java-15): the helper's numeric paths are the same value compare.\n printNativeEqualityIfProvable(node, leftText: string, rightText: string): string | undefined {\n const op = node.operatorToken.kind;\n const negated = op === SyntaxKind.ExclamationEqualsToken || op === SyntaxKind.ExclamationEqualsEqualsToken;\n if (!negated && op !== SyntaxKind.EqualsEqualsToken && op !== SyntaxKind.EqualsEqualsEqualsToken) {\n return undefined;\n }\n const checker = this.getChecker();\n const leftFamily = this.equalityOperandFamily(checker?.getTypeAtLocation(node.left));\n const rightFamily = this.equalityOperandFamily(checker?.getTypeAtLocation(node.right));\n const leftProved = leftFamily !== undefined && (leftFamily !== 'null' || this.isNullishLiteral(node.left));\n const rightProved = rightFamily !== undefined && (rightFamily !== 'null' || this.isNullishLiteral(node.right));\n const equalCall = `${negated ? '!' : ''}java.util.Objects.equals(${leftText}, ${rightText})`;\n // a declared Java String on either side: a String never equals a non-String, and\n // Objects.equals carries the same null answer, so the class-strict compare is the\n // helper's own String branch for every other operand.\n if (leftProved || rightProved || this.javaDeclaredStringType(node.left) || this.javaDeclaredStringType(node.right)) {\n return equalCall;\n }\n // both operands print a Java numeric primitive (literals, `.length`, index/search results, for\n // counters, native arithmetic): neither can be null, so the operator is the helper's value compare\n // on the two boxes (never a boxed Double, whose equals would separate -0.0).\n if (this.javaOperandPrintsPrimitiveNumber(node.left) && this.javaOperandPrintsPrimitiveNumber(node.right)) {\n return `(${leftText} ${negated ? '!=' : '=='} ${rightText})`;\n }\n // java-15: two checker-typed plain numbers whose printed Java values carry the same\n // kind (two primitives returned above); a box compares with\n // Objects.equals, whose class the kind pins to the box the helper would compare.\n const leftKind = this.javaEqualityNumberKind(node.left);\n const rightKind = this.javaEqualityNumberKind(node.right);\n if (leftKind !== undefined && leftKind === rightKind) {\n // a boxed double compares through Double.equals, which separates -0.0 from 0.0\n // where the helper's toDouble compare does not: doubles stay native only as\n // primitives (there the native operator is the same value compare)\n if (leftKind !== 'double') {\n return equalCall;\n }\n }\n // a numeric operand the pass declared Long/Double/Integer/int/long/double: the box\n // is unboxed by the operator (numeric compare, exactly the helper's toLong/toDouble\n // path) and a boxed declaration is null-tested first, which the helper answers false.\n const leftDeclared = this.javaDeclaredNumericFamily(node.left);\n const rightDeclared = this.javaDeclaredNumericFamily(node.right);\n if (leftDeclared !== undefined || rightDeclared !== undefined) {\n const leftOk = leftDeclared !== undefined || this.javaOperandPrintsPrimitiveNumber(node.left);\n const rightOk = rightDeclared !== undefined || this.javaOperandPrintsPrimitiveNumber(node.right);\n if (leftOk && rightOk) {\n const boxes: string[] = [];\n if (leftDeclared !== undefined && JAVA_BOXED_NUMERIC_TYPES.has(leftDeclared)) {\n boxes.push(leftText);\n }\n if (rightDeclared !== undefined && JAVA_BOXED_NUMERIC_TYPES.has(rightDeclared)) {\n boxes.push(rightText);\n }\n const compare = `${leftText} ${negated ? '!=' : '=='} ${rightText}`;\n if (boxes.length === 0) {\n return `(${compare})`;\n }\n // a boxed declaration can hold null, which the helper answers false for; the\n // negated comparison therefore has to accept the null arm instead of testing it\n return negated\n ? `(${boxes.map((box) => `${box} == null`).join(' || ')} || ${compare})`\n : `(${boxes.map((box) => `${box} != null`).join(' && ')} && ${compare})`;\n }\n }\n return undefined;\n }\n\n // true when the printer prints the operand as a Java primitive (a decimal literal, a\n // native .length/.size(), a for counter or a nested native arithmetic node) rather\n // than as the Object-declared box every other local gets\n javaOperandPrintsPrimitiveNumber(node): boolean {\n return this.javaEqualityLiteralKind(node) !== undefined\n || this.javaNativeLengthKind(node) !== undefined\n || this.isJavaPrimitiveCounterReference(node)\n || this.javaNativeArithmeticKind(node) !== undefined\n // `.length` on a receiver whose Java text the printer does not prove is still\n // the int-returning Helpers.getArrayLength; indexOf/search print int helpers\n || this.javaPrimitiveOperandKind(node) !== undefined;\n }\n\n // the numeric family the pass declared for a local (`Long`/`Double`/`Integer` boxed,\n // `int`/`long`/`double` primitive), undefined when nothing was declared or the declared\n // type is not numeric\n javaDeclaredNumericFamily(expression): string | undefined {\n const type = this.javaDeclaredTypeOf(expression)?.trim();\n return type !== undefined && JAVA_DECLARED_NUMERIC_TYPES.has(type) ? type : undefined;\n }\n\n // `x[k] = v` prints the runtime helper by default. Helpers.addElementToObject\n // exists for receivers the printer cannot type (Lists, arbitrary objects via\n // reflection) and for ConcurrentHashMap null-removal, so the native Map.put is\n // printed only when the checker excludes all of those.\n elementWriteTargetsMap(container, base, keys, value): boolean {\n const lastKey = keys[keys.length - 1];\n if (!isStringLiteral(lastKey) && !this.isJavaStringType(this.getChecker().getTypeAtLocation(lastKey))) {\n return false; // Map.put takes the String key; every other key prints as Object\n }\n if (isPropertyAccessExpression(base) && base.expression.kind === SyntaxKind.ThisKeyword) {\n return false; // field maps are ConcurrentHashMaps (a null value must remove, not put) and other threads read them\n }\n if (this.isPlainHashMapReceiver(container, keys)) {\n return true; // a HashMap the code created holds a null value like the helper does\n }\n // any other Map may be a ConcurrentHashMap, which rejects a null value the helper removes\n return this.isDictionaryType(container) && !this.elementWriteValueMayBeNull(value);\n }\n\n // true unless the checker proves the written value is never null/undefined\n elementWriteValueMayBeNull(value): boolean {\n const checker: any = this.checkerOrUndefined();\n if (checker === undefined || value === undefined) {\n return true;\n }\n const type = checker.getTypeAtLocation(value);\n const parts: any[] = (type.flags & TypeFlags.Union) ? (type.getTypes?.() ?? []) : [type];\n const nullable = TypeFlags.Any | TypeFlags.Unknown | JAVA_NULLISH_TYPE_FLAGS | TypeFlags.TypeParameter;\n return parts.length === 0 || parts.some((t) => (t.flags & nullable) !== 0);\n }\n\n // a key proven by the checker to be a string prints as a java String: the read is\n // the same expression, only the key needs the (String) cast the typed put demands\n elementWriteKeyText(key, keyText: string): string {\n return isStringLiteral(key) ? keyText : `(String)${keyText}`;\n }\n\n // Receivers that are a plain java.util.HashMap at runtime, where \".put\" and the helper's map branch\n // are the same write: a local initialized with an object literal or a call whose every return is\n // such a literal (this.account()). Lists, class instances and ConcurrentHashMaps stay helpers.\n isPlainHashMapReceiver(container, keys: any[]): boolean {\n if (keys.length !== 1 || container === undefined || container.kind !== SyntaxKind.Identifier) {\n return false; // only a direct write on the proven local, no read in between\n }\n const checker: any = this.checkerOrUndefined();\n if (checker === undefined) {\n return false;\n }\n const symbol = checker.getSymbolAtLocation(container);\n const declaration: any = symbol?.valueDeclaration?.resolve() ?? symbol?.declarations?.[0]?.resolve();\n if (!declaration || declaration.kind !== SyntaxKind.VariableDeclaration || !declaration.initializer) {\n return false; // parameters and receivers without an initializer stay the helper\n }\n if (!this.javaFreshHashMapValue(container, declaration.initializer)) {\n return false;\n }\n // every later `x = rhs` must hand the local another fresh map too (D2)\n return !this.javaLocalIsReassigned(container, (rhs) => this.javaFreshHashMapValue(container, rhs));\n }\n\n // a value that is a freshly built HashMap/LinkedHashMap on the Java side\n javaFreshHashMapValue(container, value): boolean {\n const initializer = this.unwrapPrintTransparentExpression(value);\n return initializer !== undefined && (isObjectLiteralExpression(initializer)\n || (isCallExpression(initializer) && this.callAlwaysReturnsPlainHashMap(initializer, 0))\n || (this.javaDeclaredMapReceiver(container) && this.javaFreshExtendMap(initializer)));\n }\n\n // a value whose Java print can never be null: non-null literals and fresh containers\n javaPrintsNonNullValue(node): boolean {\n const value = this.unwrapPrintTransparentExpression(node);\n if (value === undefined) {\n return false;\n }\n return isStringLiteralLikeNode(value) || isNumericLiteral(value)\n || value.kind === SyntaxKind.TrueKeyword || value.kind === SyntaxKind.FalseKeyword\n || isObjectLiteralExpression(value) || isArrayLiteralExpression(value)\n || (isPrefixUnaryExpression(value) && value.operator === SyntaxKind.MinusToken && isNumericLiteral(value.operand));\n }\n\n // `this.extend(..)` / `this.deepExtend(..)` from the base tier hand back a fresh LinkedHashMap\n // when the call has two arguments (Generic.Extend copies both) or ends in an object literal\n // (deepExtend's last Map argument replaces any earlier non-Map box with a new map)\n javaFreshExtendMap(initializer): boolean {\n if (initializer === undefined || !isCallExpression(initializer)\n || !isPropertyAccessExpression(initializer.expression)\n || initializer.expression.expression.kind !== SyntaxKind.ThisKeyword) {\n return false;\n }\n const name = initializer.expression.name.text;\n const args = initializer.arguments;\n const last = args.length > 0 ? this.unwrapPrintTransparentExpression(args[args.length - 1]) : undefined;\n const endsInLiteral = last !== undefined && isObjectLiteralExpression(last);\n if (!((name === 'extend' && (args.length === 2 || endsInLiteral)) || (name === 'deepExtend' && endsInLiteral))) {\n return false;\n }\n const checker: any = this.checkerOrUndefined();\n const fileName = checker?.getResolvedSignature(initializer)?.declaration?.resolve()?.getSourceFile?.()?.fileName;\n return typeof fileName === 'string' && JAVA_FRESH_EXTEND_FILE.test(fileName);\n }\n\n // the bottom container of `x[k1][k2].. = v` when x is a declared Map / List and k1 is not a\n // string literal: the guarded native read of the element-read families (the literal key is\n // printed by the caller's own arm)\n javaDeclaredChainContainerRead(left, keyCount: number): string | undefined {\n let inner = left;\n for (let i = 1; i < keyCount; i++) {\n inner = inner.expression;\n }\n if (inner === undefined || !isElementAccessExpression(inner) || isStringLiteralLikeNode(inner.argumentExpression)) {\n return undefined;\n }\n const declared = this.javaDeclaredTypeOf(inner.expression);\n if (declared === undefined) {\n return undefined;\n }\n if (JAVA_DECLARED_MAP_TYPES.test(declared)) {\n return this.javaDeclaredMapElementRead(inner);\n }\n if (JAVA_DECLARED_LIST_TYPES.test(declared) && this.javaPrimitiveCounterIndex(inner.argumentExpression)) {\n return this.javaDeclaredListElementRead(inner, true);\n }\n return undefined;\n }\n\n unwrapPrintTransparentExpression(node): any {\n let current = node;\n while (current && (isParenthesizedExpression(current)\n || isAsExpression(current)\n || isTypeAssertion(current)\n || current.kind === SyntaxKind.NonNullExpression)) {\n current = current.expression;\n }\n return current;\n }\n\n // Every write of the local in its enclosing function must be the element write\n // itself; an assignment could replace the HashMap with a List or a class instance.\n javaLocalIsReassigned(node, admitsWrite?: (rhs) => boolean): boolean {\n let scope: any = node;\n while (scope && !isFunctionLike(scope) && !isSourceFile(scope)) {\n scope = scope.parent;\n }\n if (!scope) {\n return true;\n }\n const symbol = this.getChecker().getSymbolAtLocation(node);\n let reassigned = false;\n const walk = (current) => {\n if (reassigned || current === undefined) {\n return;\n }\n if (current.kind === SyntaxKind.BinaryExpression\n && current.operatorToken.kind === SyntaxKind.EqualsToken\n && current.left.kind === SyntaxKind.Identifier\n && this.getChecker().getSymbolAtLocation(current.left) === symbol) {\n if (admitsWrite === undefined || !admitsWrite(current.right)) {\n reassigned = true;\n return;\n }\n }\n if (current.kind === SyntaxKind.BinaryExpression\n && current.operatorToken.kind >= SyntaxKind.FirstAssignment && current.operatorToken.kind <= SyntaxKind.LastAssignment\n && !isIdentifier(current.left)\n && !isElementAccessExpression(current.left) && !isPropertyAccessExpression(current.left)\n && this.javaPatternBindsSymbol(current.left, symbol)\n && !this.javaDestructuringHandsBackLocal(current, symbol)) {\n reassigned = true; // destructuring assignment `[x, p] = ..`\n return;\n }\n if (current.kind === SyntaxKind.BinaryExpression\n && current.operatorToken.kind !== SyntaxKind.EqualsToken\n && current.operatorToken.kind >= SyntaxKind.FirstAssignment && current.operatorToken.kind <= SyntaxKind.LastAssignment\n && isIdentifier(current.left)\n && this.getChecker().getSymbolAtLocation(current.left) === symbol) {\n reassigned = true; // compound write (`x ??= ..`)\n return;\n }\n if ((isForOfStatement(current) || isForInStatement(current))\n && isIdentifier(current.initializer)\n && this.getChecker().getSymbolAtLocation(current.initializer) === symbol) {\n reassigned = true;\n return;\n }\n current.forEachChild(walk);\n };\n walk(scope);\n return reassigned;\n }\n\n // `[.., x, ..] = this.m(.., x, ..)` where every return of m is an array literal whose\n // element at x's position is the never-reassigned parameter x was passed to: x keeps its object\n javaDestructuringHandsBackLocal(assignment, symbol): boolean {\n const checker: any = this.getChecker();\n const left = assignment.left;\n const call = this.unwrapPrintTransparentExpression(assignment.right);\n if (!isArrayLiteralExpression(left) || call === undefined || !isCallExpression(call)) {\n return false;\n }\n const index = left.elements.findIndex((e) => isIdentifier(e) && checker.getSymbolAtLocation(e) === symbol);\n if (index < 0 || left.elements.some((e, i) => i !== index && this.javaPatternBindsSymbol(e, symbol))) {\n return false;\n }\n const declaration: any = checker.getResolvedSignature(call)?.declaration?.resolve();\n if (!declaration || !isMethodDeclaration(declaration) || !declaration.body) {\n return false;\n }\n const argIndex = call.arguments.findIndex((a) => isIdentifier(a) && checker.getSymbolAtLocation(a) === symbol);\n const parameter = argIndex >= 0 ? declaration.parameters[argIndex] : undefined;\n if (parameter === undefined || !isIdentifier(parameter.name) || parameter.dotDotDotToken) {\n return false;\n }\n const parameterSymbol = checker.getSymbolAtLocation(parameter.name);\n let returns = 0;\n let proven = true;\n const walk = (n) => {\n if (!proven || n === undefined || (n !== declaration.body && isFunctionLike(n))) {\n return;\n }\n if (isReturnStatement(n)) {\n returns++;\n const value = this.unwrapPrintTransparentExpression(n.expression);\n const element = value !== undefined && isArrayLiteralExpression(value) ? value.elements[index] : undefined;\n proven = element !== undefined && isIdentifier(element) && checker.getSymbolAtLocation(element) === parameterSymbol;\n return;\n }\n n.forEachChild(walk);\n };\n walk(declaration.body);\n if (!proven || returns === 0 || this.javaHandBackVisiting.has(declaration)) {\n return false; // a recursive hand-back chain stays unproven\n }\n this.javaHandBackVisiting.add(declaration);\n try {\n return !this.javaLocalIsReassigned(parameter.name);\n } finally {\n this.javaHandBackVisiting.delete(declaration);\n }\n }\n\n javaHandBackVisiting = new Set();\n\n // true when a destructuring target mentions the symbol anywhere\n javaPatternBindsSymbol(pattern, symbol): boolean {\n let found = false;\n const walk = (n) => {\n if (found || n === undefined) {\n return;\n }\n if (isIdentifier(n) && this.getChecker().getSymbolAtLocation(n) === symbol) {\n found = true;\n return;\n }\n n.forEachChild(walk);\n };\n walk(pattern);\n return found;\n }\n\n // A call whose callee body returns object literals only, so the value it hands\n // back is always a freshly built HashMap on the Java side as well.\n callAlwaysReturnsPlainHashMap(node, depth: number): boolean {\n if (depth > 3) {\n return false;\n }\n const checker: any = this.getChecker();\n let callee: any = this.unwrapPrintTransparentExpression(node.expression);\n if (callee !== undefined && isPropertyAccessExpression(callee)) {\n if (callee.expression.kind !== SyntaxKind.ThisKeyword) {\n return false; // this.() only: another receiver's body is not in this class\n }\n callee = callee.name;\n }\n if (callee === undefined || callee.kind !== SyntaxKind.Identifier) {\n return false;\n }\n let symbol: any;\n try {\n symbol = checker.getSymbolAtLocation(callee);\n } catch (e) {\n return false;\n }\n const declaration: any = symbol?.valueDeclaration?.resolve() ?? symbol?.declarations?.[0]?.resolve();\n if (!declaration || (declaration.kind !== SyntaxKind.MethodDeclaration && declaration.kind !== SyntaxKind.FunctionDeclaration)) {\n return false;\n }\n if (!this.returnTypePrintsAsHashMap(declaration)) {\n return false;\n }\n const body = declaration.body;\n if (!body || !isBlock(body)) {\n return false;\n }\n let plain = true;\n let returns = 0;\n const walk = (current) => {\n if (!plain || current === undefined) {\n return;\n }\n if (isFunctionLike(current) && current !== declaration) {\n return; // a nested closure returns into its own call\n }\n if (isReturnStatement(current)) {\n returns += 1;\n const expression = current.expression;\n if (expression === undefined) {\n plain = false;\n return;\n }\n const value = this.unwrapPrintTransparentExpression(expression);\n if (isObjectLiteralExpression(value)) {\n return;\n }\n if (isCallExpression(value) && this.callAlwaysReturnsPlainHashMap(value, depth + 1)) {\n return;\n }\n plain = false;\n return;\n }\n current.forEachChild(walk);\n };\n walk(body);\n return plain && returns > 0;\n }\n\n // the declared return type must not be a class instance (those print as objects)\n // or an array (those print as Lists), so the object-literal returns above are what\n // the caller can rely on\n returnTypePrintsAsHashMap(declaration): boolean {\n try {\n const checker: any = this.getChecker();\n const signature = checker.getSignatureFromDeclaration(declaration);\n const type: any = signature?.getReturnType();\n if (!type || (type.flags & TypeFlags.Object) === 0) {\n return false;\n }\n if (checker.isArrayType(type) || checker.isTupleType(type)) {\n return false;\n }\n const declarations = (type.getSymbol()?.declarations ?? []).map((d) => d.resolve());\n if (declarations.some((d) => d.kind === SyntaxKind.ClassDeclaration)) {\n return false;\n }\n return type.getCallSignatures().length === 0;\n } catch (e) {\n return false;\n }\n }\n\n isDictionaryType(node): boolean {\n try {\n const checker: any = this.getChecker();\n const type = checker.getTypeAtLocation(node);\n return this.isDictionaryTsType(type, checker, 0);\n } catch (e) {\n return false;\n }\n }\n\n // A TS dictionary (`{ [key: string]: any }`, i.e. ccxt's Dict) is a Map on every\n // print and run path. Arrays, class instances and unknown types are not, so they\n // keep the helper.\n isDictionaryTsType(type: any, checker: any, depth: number): boolean {\n if (!type || depth > 3) {\n return false;\n }\n const flags: any = type.flags;\n if (flags & TypeFlags.Union) {\n const parts: any[] = type.getTypes?.() ?? [];\n return parts.length > 0 && parts.every((t) => this.isDictionaryTsType(t, checker, depth + 1));\n }\n if (!(flags & TypeFlags.Object)) {\n return false;\n }\n try {\n if (checker.isArrayType(type) || checker.isTupleType(type)) {\n return false;\n }\n return checker.getIndexTypeOfType(type, IndexKind.String) !== undefined;\n } catch (e) {\n return false;\n }\n }\n\n // -------------------------------------------------------------------\n // helper removal: native emission when the checker proves the printed\n // operand is a Java numeric primitive / List / Map\n // -------------------------------------------------------------------\n\n // int/long kind of a literal as printNumericLiteral emits it. Fraction and\n // exponent forms are Java doubles and a double can hold NaN, which the\n // comparison helpers order differently (`NaN < x` is true there), so those\n // never become a native comparison.\n javaIntegerLiteralKind(node) {\n if (!node || !isNumericLiteral(node)) {\n return undefined;\n }\n if (/[.eE]/.test(node.text)) {\n return undefined;\n }\n return Number(node.text) > 2147483647 ? 'long' : 'int';\n }\n\n // A rest parameter is a Java varargs array, not a List, so a List cast on it\n // would throw ClassCastException; simple identifier aliases are followed too.\n isVarargsArrayReference(node, depth = 0) {\n if (!node || depth > 4 || node.kind !== SyntaxKind.Identifier) {\n return false;\n }\n const symbol = this.getChecker().getSymbolAtLocation(node);\n const declaration: any = symbol?.valueDeclaration?.resolve() ?? symbol?.declarations?.[0]?.resolve();\n if (!declaration) {\n return false;\n }\n if (declaration.dotDotDotToken !== undefined) {\n return true;\n }\n const initializer = declaration.initializer;\n if (initializer && isIdentifier(initializer)) {\n return this.isVarargsArrayReference(initializer, depth + 1);\n }\n return false;\n }\n\n // checker proof that the value is printed as a java.util.List: TS arrays and\n // tuples become ArrayList, ReadonlyArray only adds a readonly modifier\n isJavaListType(type) {\n if (!type) {\n return false;\n }\n const checker = this.getChecker();\n if (checker.isArrayType(type) || checker.isTupleType(type)) {\n return true;\n }\n return (type as any).isTypeReference?.() === true && (type as any).getTarget().getSymbol()?.escapedName === 'ReadonlyArray';\n }\n\n // `.length` is a Java int for exactly these receivers; every other receiver keeps\n // Helpers.getArrayLength, whose result type is not proven\n javaLengthKind(expression) {\n const type = this.getChecker().getTypeAtLocation(expression);\n if (this.isJavaStringType(type)) {\n return 'String';\n }\n if (this.isJavaListValueType(type) && !this.isVarargsArrayReference(expression)) {\n return 'List';\n }\n // a nullish union member cannot take a bare `.size()`/`.length()`, but the\n // guard below answers 0 for null exactly like the helper, and only a bare\n // identifier keeps the receiver evaluate-once\n if (isIdentifier(expression)) {\n if (this.isJavaNullishUnion(type, (member) => this.isStringType(member.flags))) {\n return 'StringOrNull';\n }\n if (this.isJavaNullishUnion(type, (member) => this.isJavaListValueType(member))\n && !this.isVarargsArrayReference(expression)) {\n return 'ListOrNull';\n }\n }\n return undefined;\n }\n\n // every union member is a List-printing type (TS array/tuple/ReadonlyArray, or an\n // Array-derived class whose hand-written java counterpart is an ArrayList)\n isJavaListValueType(type) {\n if (!type) {\n return false;\n }\n if ((type.flags & TypeFlags.Union) !== 0) {\n return type.getTypes().length > 0 && type.getTypes().every((member) => this.isJavaListValueType(member));\n }\n return this.isJavaListType(type) || this.isJavaListBackedClassType(type);\n }\n\n // TS class/interface whose java counterpart extends java.util.ArrayList:\n // the ws caches (ws/ArrayCache.java) and the order-book sides (ws/OrderBookSide.java)\n isJavaListBackedClassType(type) {\n if (!type || (type.flags & TypeFlags.Object) === 0) {\n return false;\n }\n let current: any = (type as any).isTypeReference?.() ? (type as any).getTarget() : type;\n for (let depth = 0; current && depth < 8; depth++) {\n const name = current.getSymbol?.()?.escapedName;\n if (name !== undefined && JAVA_LIST_BACKED_TS_CLASSES.has(name)) {\n return true;\n }\n const bases: any[] = current.getBaseTypes?.() ?? [];\n current = bases.length > 0 ? ((bases[0] as any).isTypeReference?.() ? (bases[0] as any).getTarget() : bases[0]) : undefined;\n }\n return false;\n }\n\n // union of one accepted member family plus null/undefined: the emitted guard is the\n // helper's answer for the nullish case and the native read otherwise\n isJavaNullishUnion(type, isMember) {\n if (!type || (type.flags & TypeFlags.Union) === 0 || type.getTypes().length === 0) {\n return false;\n }\n return type.getTypes().every((member) => isMember(member)\n || (member.flags & (TypeFlags.Undefined | TypeFlags.Null)) !== 0);\n }\n\n // shared by printLengthProperty and transformPropertyAcessExpressionIfNeeded\n printJavaLength(expression, leftSide) {\n const kind = this.javaLengthKind(expression);\n if (kind !== undefined) {\n const read = kind.startsWith('String') ? `((String)${leftSide}).length()` : `((java.util.List)${leftSide}).size()`;\n return kind.endsWith('OrNull') ? `(${leftSide} == null ? 0 : ${read})` : read;\n }\n // a receiver the embedding pass declared a java.util.List (`List response =\n // (this.someRequest(..)).join()` — a typed list return bound to a local, or a list\n // parameter the pass retyped): the declaration carries the type, so `x.size()` needs\n const declared = this.javaDeclaredTypeOf(expression);\n if (declared !== undefined && JAVA_DECLARED_LIST_TYPES.test(declared)) {\n return `(${leftSide} == null ? 0 : ${leftSide}.size())`;\n }\n return `${this.ARRAY_LENGTH_WRAPPER_OPEN}${leftSide}${this.ARRAY_LENGTH_WRAPPER_CLOSE}`;\n }\n\n // `for (var i = ; ...; i++)`: printForStatement rewrites the\n // Object initializer into `var`, so javac infers a primitive counter there,\n // and only ++/-- writes keep it primitive\n isJavaPrimitiveForCounter(node) {\n if (node.kind !== SyntaxKind.Identifier) {\n return false;\n }\n const comparison = node.parent;\n if (!comparison || comparison.kind !== SyntaxKind.BinaryExpression) {\n return false;\n }\n const forStatement = comparison.parent;\n if (!forStatement || forStatement.kind !== SyntaxKind.ForStatement || forStatement.condition !== comparison) {\n return false;\n }\n const initializer = forStatement.initializer;\n if (!initializer || initializer.kind !== SyntaxKind.VariableDeclarationList) {\n return false;\n }\n const declarations = initializer.declarations ?? [];\n if (declarations.length !== 1) {\n return false;\n }\n const declaration = declarations[0];\n if (!isIdentifier(declaration.name) || declaration.name.text !== node.text) {\n return false;\n }\n if (this.javaIntegerLiteralKind(declaration.initializer) === undefined) {\n return false;\n }\n const counterSymbol = this.getChecker().getSymbolAtLocation(node);\n const declarationSymbol = this.getChecker().getSymbolAtLocation(declaration.name);\n if (counterSymbol !== undefined && declarationSymbol !== undefined && counterSymbol !== declarationSymbol) {\n return false;\n }\n const incrementor = forStatement.incrementor;\n if (!incrementor || incrementor.operand?.kind !== SyntaxKind.Identifier || incrementor.operand.text !== node.text) {\n return false;\n }\n return incrementor.kind === SyntaxKind.PostfixUnaryExpression || incrementor.kind === SyntaxKind.PrefixUnaryExpression;\n }\n\n // Java primitive kind of a comparison operand; undefined keeps the helper. Proof sources: literals\n // (int/long/double) and expressions the printer's own emitter pins: `var` for-counter, `.length`,\n // `x.indexOf(arg)`/`x.search(arg)` (int), Math.round (long), Math.floor/ceil/pow (double).\n javaPrimitiveOperandKind(node) {\n if (node === undefined || node === null) {\n return undefined;\n }\n if (node.kind === SyntaxKind.ParenthesizedExpression) {\n return this.javaPrimitiveOperandKind(node.expression);\n }\n const literalKind = this.javaIntegerLiteralKind(node);\n if (literalKind !== undefined) {\n return literalKind;\n }\n if (this.isJavaFloatLiteral(node)) {\n return 'double';\n }\n if (this.isJavaPrimitiveForCounter(node) || this.javaPrintedIntCounter(node)) {\n return 'int';\n }\n // `-1`: the sign prints in front of an int literal, still a Java int\n if (node.kind === SyntaxKind.PrefixUnaryExpression && node.operator === SyntaxKind.MinusToken\n && this.javaIntegerLiteralKind(node.operand) === 'int') {\n return 'int';\n }\n if (node.kind === SyntaxKind.PropertyAccessExpression && node.name.text === 'length') {\n return 'int';\n }\n if (node.kind === SyntaxKind.CallExpression) {\n return this.javaPrintedCallKind(node);\n }\n // a nested `+ - * /` this printer emits natively is a Java primitive of its kind\n if (node.kind === SyntaxKind.BinaryExpression) {\n return this.javaNativeArithmeticKind(node);\n }\n return undefined;\n }\n\n // a read of a `for (var i = ; ..; i++)` counter anywhere in the loop: javac types it\n // int and no box write reaches it; a capture rename (`finalI`) prints an Object copy instead\n javaPrintedIntCounter(node): boolean {\n return node?.kind === SyntaxKind.Identifier && this.javaIntForCounter(node)\n && this.javaIdentifierPrintsDeclaredName(node);\n }\n\n // fractional / exponent literals print as Java double literals (printNumericLiteral)\n isJavaFloatLiteral(node) {\n if (!node || !isNumericLiteral(node)) {\n return false;\n }\n return !/^0[xXbBoO]/.test(node.text) && /[.eE]/.test(node.text);\n }\n\n // Java kind of a call the printer emits itself, undefined otherwise. Mirrors printIndexOfCall /\n // printSearchCall / printMathRoundCall / printMathFloorCall / printMathCeilCall and Math.pow:\n // x.indexOf(a) / x.search(a) -> int; Math.round(x) -> long; Math.floor/ceil/pow -> double.\n javaPrintedCallKind(node) {\n const callee = node.expression;\n if (callee?.kind !== SyntaxKind.PropertyAccessExpression) {\n return undefined;\n }\n const name = callee.name?.text;\n const argCount = node.arguments?.length ?? 0;\n const onMath = callee.expression?.kind === SyntaxKind.Identifier\n && callee.expression.text === 'Math';\n switch (name) {\n case 'indexOf':\n case 'search':\n // the dispatch routes a 1-argument indexOf/search through the int-returning\n // helpers; a receiver that prints String keeps String.indexOf (int as well)\n return argCount >= 1 ? 'int' : undefined;\n case 'round':\n return onMath && argCount === 1 ? 'long' : undefined;\n case 'floor':\n case 'ceil':\n return onMath && argCount === 1 ? 'double' : undefined;\n case 'pow':\n return onMath && argCount === 2 ? 'double' : undefined;\n }\n return undefined;\n }\n\n // operand usability for `>=` / `<` / `<=`, which route through the helper's isEqual. Two integral\n // operands are always exact; once a double is involved, toLong saturates and BigDecimal throws on\n // ±Infinity, so a double or long is accepted only as a finite literal within ±2^53.\n javaComparisonOperandsAreExact(left, leftKind, right, rightKind) {\n if (leftKind !== 'double' && rightKind !== 'double') {\n return true;\n }\n return this.javaComparisonOperandIsExactAgainstDouble(left, leftKind)\n && this.javaComparisonOperandIsExactAgainstDouble(right, rightKind);\n }\n\n javaComparisonOperandIsExactAgainstDouble(node, kind) {\n if (kind === 'int') {\n return true;\n }\n if ((kind !== 'long' && kind !== 'double') || !isNumericLiteral(node)) {\n return false;\n }\n const text = node.text;\n if (/^[0-9]+$/.test(text)) {\n // the text is what the printer emits, and JS Number() rounds above 2^53 —\n // compare the literal's exact value instead\n return BigInt(text) <= 9007199254740992n;\n }\n const value = Number(text);\n return Number.isFinite(value) && Math.abs(value) <= 9007199254740992;\n }\n\n // checker proof that the value is printed as a java.util.HashMap: TS object\n // shapes (interfaces, object literals, aliases) become HashMaps, while class\n // instances are real Java objects and arrays/unions are not proven here\n isJavaMapType(type) {\n if (!type || (type.flags & TypeFlags.Object) === 0) {\n return false;\n }\n const checker = this.getChecker();\n if (checker.isArrayType(type) || checker.isTupleType(type)) {\n return false;\n }\n if (type.getCallSignatures().length > 0) {\n return false;\n }\n const declarations = (type.getSymbol()?.declarations ?? []).map((d) => d.resolve());\n return !declarations.some((declaration) => declaration.kind === SyntaxKind.ClassDeclaration\n || declaration.getSourceFile().fileName.indexOf('typescript') > -1);\n }\n\n // string keys (plain, literal or a union of literals) print as Java Strings\n isJavaStringType(type) {\n if (!type) {\n return false;\n }\n if (this.isStringType(type.flags)) {\n return true;\n }\n if ((type.flags & TypeFlags.Union) === 0) {\n return false;\n }\n return type.getTypes().every((member) => this.isStringType(member.flags));\n }\n\n // `Dictionary | undefined` (what a no-overload safe* signature widens to): the helper\n // answers false for the nullish arm and the guarded emission keeps exactly that; every\n // non-map member (arrays, classes, scalars) keeps the helper\n isJavaNullableMapType(type) {\n return this.isJavaNullishUnion(type, (member) => this.isJavaMapType(member))\n && ((type as any).getTypes?.() ?? []).some((member) => (member.flags & (TypeFlags.Undefined | TypeFlags.Null)) === 0);\n }\n\n // the guarded emission reads the receiver twice, so it is only printed for an operand\n // that cannot run anything twice: a name or a `this.` field. Everything else (calls,\n // element reads) keeps the helper so the operand is still evaluated once.\n javaRepeatableOperand(node) {\n if (node === undefined) {\n return false;\n }\n if (isIdentifier(node)) {\n return true;\n }\n if (isParenthesizedExpression(node)) {\n return this.javaRepeatableOperand(node.expression);\n }\n return isPropertyAccessExpression(node) && node.expression?.kind === SyntaxKind.ThisKeyword;\n }\n\n // The declared Java type of a local/parameter is known to the pass that rewrites the declaration\n // text (build/java-local-types.js), which records every name it typed here. With no consumer\n // installed the table is empty and every read keeps the helper.\n javaDeclaredTypeOf(expression): string | undefined {\n if (expression === undefined || !isIdentifier(expression)) {\n return undefined;\n }\n const declaration = this.javaDeclarationOfIdentifier(expression);\n if (declaration === undefined || expression.text !== declaration.name?.text) {\n return undefined;\n }\n return this.javaDeclaredTypeOfDeclaration(declaration);\n }\n\n // the declared Java type of a declaration: the embedding build layer names the\n // declarations it retypes itself, and a parameter the printer retypes\n // (javaNativeParameterType) answers for itself, so its element reads go native too\n javaDeclaredTypeOfDeclaration(declaration): string | undefined {\n const resolver = this.javaDeclaredLocalTypeResolver;\n if (resolver !== undefined) {\n let type;\n try {\n type = resolver(declaration);\n } catch (e) {\n type = undefined;\n }\n if (typeof type === 'string' && type.trim().length > 0) {\n return type.trim();\n }\n }\n if (isParameterDeclaration(declaration)) {\n return this.javaNativeParameterType(declaration);\n }\n return undefined;\n }\n\n // The native Java type a parameter prints with when its TS annotation is a base/types.ts alias in\n // JAVA_NATIVE_PARAMETER_TYPES. Fixed parameters of generated-tier methods only, and every\n // declaration up the heritage chain must print the same type: Java overrides are invariant.\n javaNativeParameterType(node): string | undefined {\n if (node === undefined || !isParameterDeclaration(node)\n || node.initializer !== undefined || node.dotDotDotToken !== undefined) {\n return undefined;\n }\n const own = this.javaNativeParameterTypeOf(node);\n const type = own !== undefined ? own : this.javaInheritedParameterType(node);\n if (type === undefined) {\n return undefined;\n }\n // D2: a parameter the enclosing body assigns with a compound operator keeps the box — `url += '/x'`\n // prints `url = Helpers.add(url, ..)`, whose result is an Object. A plain `x = ..` or a\n // destructuring target is cast at the write site instead (javaParameterAssignmentCast).\n if (this.javaParameterIsCompoundAssigned(node)) {\n return undefined;\n }\n try {\n const method: any = node.parent;\n const index = method.parameters.indexOf(node);\n let override = this.getMethodOverride(method);\n if (override === undefined\n && JAVA_NATIVE_PARAMETER_PREDICTION_FILES.test(node.getSourceFile().fileName)\n && method.name !== undefined) {\n // a venue method overriding the Exchange-tier body PredictionExchange.java carries\n // must print that tier parameter's type (D8: Java overrides are invariant)\n const tier = this.exchangeTierMethods().get(method.name.getText().trim());\n if (tier !== undefined && !this.javaParameterPrintsType(tier.parameters?.[index], type)) {\n return undefined;\n }\n }\n while (override !== undefined) {\n const baseParam = (override as any).parameters?.[index];\n if (!this.javaParameterPrintsType(baseParam, type)) {\n return undefined;\n }\n override = this.getMethodOverride(override);\n }\n } catch (e) {\n return undefined; // an unresolvable heritage keeps the box\n }\n return type;\n }\n\n // method declarations (first per name) of the `Exchange` class of ts/src/base/Exchange.ts, read off the\n // program the warp ran on. A prediction venue's method with one of these names overrides\n // the tier body javaTranspiler.ts injects into PredictionExchange.java.\n private _exchangeTierMethods: Map | undefined = undefined;\n exchangeTierMethods(): Map {\n if (this._exchangeTierMethods !== undefined) {\n return this._exchangeTierMethods;\n }\n const names = new Map();\n try {\n const program = this.getProgram();\n const fileName = program.getSourceFileNames().find((f) => JAVA_NATIVE_PARAMETER_BASE_FILES.test(f));\n const file = fileName !== undefined ? program.getSourceFile(fileName) : undefined;\n const collect = (node: Node) => {\n if (isClassDeclaration(node) && node.name?.text === 'Exchange') {\n for (const member of node.members) {\n const key = (member as any).name?.getText().trim();\n if (isMethodDeclaration(member) && key !== undefined && !names.has(key)) {\n names.set(key, member);\n }\n }\n }\n node.forEachChild(collect);\n };\n if (file !== undefined) {\n collect(file);\n }\n } catch (e) {\n // no program yet: the heritage walk above already answered\n }\n this._exchangeTierMethods = names;\n return names;\n }\n\n // the same parameter position of an ancestor declaration prints this native type: its\n // own annotation names it, or - with no annotation of its own - it inherits the same\n // type from a declaration above it, exactly like this one does\n javaParameterPrintsType(baseParam, type: string): boolean {\n if (baseParam === undefined || !isParameterDeclaration(baseParam)\n || baseParam.initializer !== undefined || baseParam.dotDotDotToken !== undefined) {\n return false;\n }\n const own = this.javaNativeParameterTypeOf(baseParam);\n const printed = own !== undefined ? own : this.javaInheritedParameterType(baseParam);\n return printed === type;\n }\n\n // the type a fixed parameter with no annotation of its own inherits: the nearest\n // declaration of the method up the heritage chain that prints a native type. An\n // unannotated root declaration prints `Object`, so nothing is inherited and the whole\n javaInheritedParameterType(node): string | undefined {\n const method = node.parent;\n const index = method?.parameters?.indexOf(node);\n if (method === undefined || index === undefined || index < 0) {\n return undefined;\n }\n let override = this.getMethodOverride(method);\n while (override !== undefined) {\n const baseParam = (override as any).parameters?.[index];\n const type = baseParam === undefined ? undefined : this.javaNativeParameterTypeOf(baseParam);\n if (type !== undefined) {\n return type;\n }\n override = this.getMethodOverride(override);\n }\n return undefined;\n }\n\n // Default-valued parameters are real parameters of the typed core that carries the body;\n // the untyped `Object... optionalArgs` front delegates to it.\n javaOptionalParameterJavaType(node): string {\n return this.javaOptionalParameterType(node) ?? 'Object';\n }\n\n javaOptionalParameterType(node): string | undefined {\n if (node === undefined || !isParameterDeclaration(node)) {\n return undefined;\n }\n if (node.initializer === undefined || node.dotDotDotToken !== undefined) {\n return undefined; // `?` parameters keep today's shape (they print in the fixed prefix)\n }\n const own = this.javaOptionalParameterTypeOf(node);\n if (own === undefined) {\n return undefined;\n }\n // a parameter the body assigns with a compound operator keeps the box (`x += ..` prints\n // Helpers.add(x, ..), an Object result) - the same rule as the fixed-parameter path\n if (this.javaParameterIsCompoundAssigned(node)) {\n return undefined;\n }\n // a list parameter the body `typeof`-probes also accepts other boxes at runtime\n if (own === JAVA_STRING_LIST_TYPE && this.javaParameterIsTypeofTested(node)) {\n return undefined;\n }\n const method: any = node.parent;\n try {\n const index = method.parameters.indexOf(node);\n let override = this.getMethodOverride(method);\n while (override !== undefined) {\n if (!this.javaOptionalParameterFamilyAgrees(method, override, index, own)) {\n return undefined;\n }\n override = this.getMethodOverride(override);\n }\n } catch (e) {\n return undefined; // an unresolvable heritage keeps the box\n }\n return own;\n }\n\n // the annotation proof for an optional parameter (no initializer bail)\n javaOptionalParameterTypeOf(node): string | undefined {\n if (node === undefined || !isParameterDeclaration(node) || node.dotDotDotToken !== undefined) {\n return undefined;\n }\n const method = node.parent;\n if (method === undefined || !isMethodDeclaration(method) || !isClassDeclaration(method.parent)) {\n return undefined;\n }\n if (!JAVA_NATIVE_PARAMETER_BASE_FILES.test(node.getSourceFile().fileName)\n && !JAVA_NATIVE_PARAMETER_GENERATED_FILES.test(node.getSourceFile().fileName)) {\n return undefined; // a hand-written java class declares this method, not the printer\n }\n const checker: any = this.checkerOrUndefined();\n if (checker === undefined) {\n return undefined;\n }\n const type = checker.getTypeAtLocation(node);\n if (type === undefined) {\n return undefined;\n }\n const symbol = this.javaParameterAliasSymbol(node, type, checker);\n const name = symbol?.name;\n const excluded = JAVA_NATIVE_PARAMETER_EXCLUDED_POSITIONS[(method.name as any)?.text];\n if (excluded !== undefined && excluded.includes(method.parameters.indexOf(node))) {\n return undefined;\n }\n if (name === 'Strings' || this.javaIsStringArrayType(checker, type)) {\n const listName = JAVA_STRINGS_OPTIONAL_PARAMETER_NAMES.has((node.name as any)?.text)\n && !JAVA_STRINGS_EXCLUDED_METHODS.has((method.name as any)?.text);\n return listName ? JAVA_STRING_LIST_TYPE : undefined;\n }\n if (name === undefined || JAVA_NATIVE_PARAMETER_TYPES_OPTIONAL[name] === undefined) {\n return undefined;\n }\n const declaration = symbol?.declarations?.[0]?.resolve();\n const fileName = declaration?.getSourceFile?.()?.fileName;\n return JAVA_NATIVE_PARAMETER_SOURCE_FILES.test(fileName ?? '')\n ? JAVA_NATIVE_PARAMETER_TYPES_OPTIONAL[name] : undefined;\n }\n\n // a `string[]` annotation (optionally `| undefined`), the unaliased spelling of `Strings`\n javaIsStringArrayType(checker, type): boolean {\n const members = type.isUnionType?.() ? type.getTypes() : [type];\n let arrays = 0;\n for (const member of members) {\n if (member.flags & (TypeFlags.Undefined | TypeFlags.Null)) {\n continue;\n }\n if (!checker.isArrayType(member)) {\n return false;\n }\n const element = checker.getTypeArguments(member)?.[0];\n if (element === undefined || !(element.flags & TypeFlags.String)) {\n return false;\n }\n arrays++;\n }\n return arrays === 1;\n }\n\n // Java overrides are invariant: every ancestor declaration must match the parameter count,\n // the first default-valued index and this position's type, otherwise the position stays Object.\n javaOptionalParameterFamilyAgrees(method, override, index, type: string): boolean {\n const baseParams = override?.parameters;\n if (baseParams === undefined || baseParams.length !== method.parameters.length) {\n return false;\n }\n if (this.firstDefaultParameterIndex(baseParams) !== this.firstDefaultParameterIndex(method.parameters)) {\n return false;\n }\n const baseParam = baseParams[index];\n if (baseParam === undefined || !isParameterDeclaration(baseParam) || baseParam.dotDotDotToken !== undefined) {\n return false;\n }\n const baseIsOptional = baseParam.initializer !== undefined || baseParam.questionToken !== undefined;\n const ownIsOptional = method.parameters[index].initializer !== undefined\n || method.parameters[index].questionToken !== undefined;\n if (baseIsOptional !== ownIsOptional) {\n return false;\n }\n const baseType = baseIsOptional\n ? this.javaOptionalParameterTypeOf(baseParam)\n : this.javaNativeParameterTypeOf(baseParam);\n return baseType === type;\n }\n\n firstDefaultParameterIndex(params): number {\n for (let i = 0; i < params.length; i++) {\n if (params[i].initializer !== undefined || params[i].questionToken !== undefined) {\n return i;\n }\n }\n return -1;\n }\n\n // a method with >=1 optional parameter prints one typed full signature (callers pass every slot).\n hasDefaultedTail(node): boolean {\n if (node === undefined || !isMethodDeclaration(node)) {\n return false; // constructors and functions keep the optionalArgs unpack\n }\n return this.javaHasOptionalParameter(node);\n }\n\n // a typed default-valued method parameter is written in place, so its writes convert to the declared type\n javaSplitParameterWriteType(node): string | undefined {\n if (node?.initializer === undefined || !this.hasDefaultedTail(node.parent)) {\n return undefined;\n }\n return this.javaOptionalParameterType(node);\n }\n\n // the async body copy of a reassigned default-valued parameter keeps a `List` type;\n // its writes convert like the sync in-place ones (other types keep the `Object` copy)\n javaAsyncParameterLocalType(node): string | undefined {\n if (node?.initializer === undefined || !this.hasDefaultedTail(node.parent) || !this.isAsyncFunction(node.parent)) {\n return undefined;\n }\n const type = this.javaOptionalParameterType(node);\n if (type === 'Long' && !this.javaParameterIsWritten(node)) {\n return type; // a read-only copy of the Long core parameter\n }\n return type === JAVA_STRING_LIST_TYPE ? type : undefined;\n }\n\n // any write to the parameter in its method: assignment (plain or compound), a destructuring\n // target, `++`/`--`, a for-of/in binding\n javaParameterIsWritten(node): boolean {\n const method = node?.parent;\n const checker: any = this.checkerOrUndefined();\n if (method?.body === undefined || checker === undefined) {\n return true;\n }\n const symbol = checker.getSymbolAtLocation(node.name);\n if (symbol === undefined) {\n return true;\n }\n const same = (n) => n !== undefined && isIdentifier(n) && checker.getSymbolAtLocation(n) === symbol;\n let written = false;\n const visit = (n) => {\n if (written) {\n return;\n }\n if (isBinaryExpression(n) && JAVA_ASSIGNMENT_OPERATOR_KINDS.has(n.operatorToken.kind)) {\n const left = n.left;\n if (same(left) || (isArrayLiteralExpression(left) && left.elements.some(same))) {\n written = true;\n return;\n }\n }\n if ((isPrefixUnaryExpression(n) || isPostfixUnaryExpression(n)) && same(n.operand)\n && (n.operator === SyntaxKind.PlusPlusToken || n.operator === SyntaxKind.MinusMinusToken)) {\n written = true;\n return;\n }\n if ((isForOfStatement(n) || isForInStatement(n)) && same(n.initializer)) {\n written = true;\n return;\n }\n n.forEachChild(visit);\n };\n visit(method.body);\n return written;\n }\n\n // a read the enclosing code only reaches with the binding non-null: the right operand of\n // `x !== undefined && ..`, the matching arm of an `if`/`?:` on that test, or any statement\n // after `if (x === undefined) { return/throw/.. }`. Callers require an unwritten binding.\n javaNullGuardAdmitsRead(node): boolean {\n const checker: any = this.checkerOrUndefined();\n const symbol = checker?.getSymbolAtLocation(node);\n if (symbol === undefined) {\n return false;\n }\n let current: any = node;\n while (current.parent !== undefined) {\n const parent: any = current.parent;\n if (isBinaryExpression(parent) && parent.operatorToken.kind === SyntaxKind.AmpersandAmpersandToken\n && parent.right === current && this.javaTestProvesNonNull(parent.left, symbol, true)) {\n return true;\n }\n if (isBinaryExpression(parent) && parent.operatorToken.kind === SyntaxKind.BarBarToken\n && parent.right === current && this.javaTestProvesNonNull(parent.left, symbol, false)) {\n return true;\n }\n if ((isIfStatement(parent) || isConditionalExpression(parent))) {\n const test = isIfStatement(parent) ? parent.expression : parent.condition;\n const whenTrue = isIfStatement(parent) ? parent.thenStatement : parent.whenTrue;\n const whenFalse = isIfStatement(parent) ? parent.elseStatement : parent.whenFalse;\n if ((whenTrue === current && this.javaTestProvesNonNull(test, symbol, true))\n || (whenFalse === current && this.javaTestProvesNonNull(test, symbol, false))) {\n return true;\n }\n }\n if (isBlock(parent)) {\n for (const sibling of parent.statements) {\n if (sibling === current) {\n break;\n }\n if (isIfStatement(sibling)\n && ((this.javaTestProvesNonNull(sibling.expression, symbol, false) && this.javaStatementAlwaysExits(sibling.thenStatement))\n || (this.javaTestProvesNonNull(sibling.expression, symbol, true) && this.javaStatementAlwaysExits(sibling.elseStatement)))) {\n return true;\n }\n }\n }\n current = parent;\n }\n return false;\n }\n\n // `x !== undefined` / `x != null` (either order) proves x non-null when the test is true;\n // `x === undefined` when false; `&&` (true) / `||` (false) prove through either side, `!` flips\n javaTestProvesNonNull(test, symbol, truthy): boolean {\n if (test === undefined) {\n return false;\n }\n if (isParenthesizedExpression(test)) {\n return this.javaTestProvesNonNull(test.expression, symbol, truthy);\n }\n if (isPrefixUnaryExpression(test) && test.operator === SyntaxKind.ExclamationToken) {\n return this.javaTestProvesNonNull(test.operand, symbol, !truthy);\n }\n if (!isBinaryExpression(test)) {\n return false;\n }\n const op = test.operatorToken.kind;\n if (op === SyntaxKind.AmpersandAmpersandToken) {\n return truthy && (this.javaTestProvesNonNull(test.left, symbol, true) || this.javaTestProvesNonNull(test.right, symbol, true));\n }\n if (op === SyntaxKind.BarBarToken) {\n return !truthy && (this.javaTestProvesNonNull(test.left, symbol, false) || this.javaTestProvesNonNull(test.right, symbol, false));\n }\n const inequality = op === SyntaxKind.ExclamationEqualsToken || op === SyntaxKind.ExclamationEqualsEqualsToken;\n const equality = op === SyntaxKind.EqualsEqualsToken || op === SyntaxKind.EqualsEqualsEqualsToken;\n if ((!inequality && !equality) || truthy !== inequality) {\n return false;\n }\n const nullish = (n) => n.kind === SyntaxKind.NullKeyword || (isIdentifier(n) && n.text === 'undefined');\n const tested = nullish(test.right) ? test.left : (nullish(test.left) ? test.right : undefined);\n const checker: any = this.checkerOrUndefined();\n return tested !== undefined && isIdentifier(tested) && checker?.getSymbolAtLocation(tested) === symbol;\n }\n\n javaStatementAlwaysExits(statement): boolean {\n if (statement === undefined) {\n return false;\n }\n const exits = (n) => isReturnStatement(n) || isThrowStatement(n) || isContinueStatement(n) || isBreakStatement(n);\n if (exits(statement)) {\n return true;\n }\n return isBlock(statement) && statement.statements.length > 0 && exits(statement.statements[statement.statements.length - 1]);\n }\n\n // `Long` when the body reads this default-valued `Int` parameter as the core's own Long (the\n // parameter itself or its read-only async copy); undefined otherwise\n javaLongParameterRead(node): boolean {\n if (node === undefined || !isIdentifier(node) || !this.javaIdentifierPrintsDeclaredName(node)\n || !this.javaIdentifierKeepsDeclaredName(node)) {\n return false;\n }\n const declaration = this.javaDeclarationOfIdentifier(node);\n if (declaration === undefined || !isParameterDeclaration(declaration) || declaration.initializer === undefined\n || !this.hasDefaultedTail(declaration.parent)) {\n return false;\n }\n return this.javaOptionalParameterType(declaration) === 'Long' && !this.javaParameterIsWritten(declaration);\n }\n\n // the names the enclosing method body assigns with a compound operator (`x += ..`),\n // by method node; a plain assignment is handled by javaParameterAssignmentCast\n javaMethodAssignedNames: WeakMap> = new WeakMap();\n\n // D-09 memo/cycle guard for javaNativeReturnType (mutually recursive return chains)\n javaReturnTypeCache: WeakMap = new WeakMap();\n javaReturnTypeInProgress: Set = new Set();\n\n javaParameterIsTypeofTested(node): boolean {\n const method = node.parent;\n const name = (node.name as any)?.text;\n // forEachChild stops at the first truthy visit, i.e. the first matching typeof\n const visit = (n: Node): boolean => (isTypeOfExpression(n) && isIdentifier(n.expression) && n.expression.text === name)\n || n.forEachChild(visit) === true;\n return method?.body !== undefined && name !== undefined && method.body.forEachChild(visit) === true;\n }\n\n javaParameterIsCompoundAssigned(node): boolean {\n const method = node.parent;\n const name = (node.name as any)?.text;\n if (method?.body === undefined || name === undefined) {\n return false;\n }\n let assigned = this.javaMethodAssignedNames.get(method);\n if (assigned === undefined) {\n assigned = new Set();\n const collect = (n: Node) => {\n if (isBinaryExpression(n) && n.operatorToken.kind !== SyntaxKind.EqualsToken\n && JAVA_ASSIGNMENT_OPERATOR_KINDS.has(n.operatorToken.kind)) {\n const left = n.left;\n if (isIdentifier(left) && left.text !== undefined) {\n assigned.add(left.text as string);\n }\n }\n n.forEachChild(collect);\n };\n method.body.forEachChild(collect);\n this.javaMethodAssignedNames.set(method, assigned);\n }\n return assigned.has(name as string);\n }\n\n // a write to a parameter this printer declared natively: the right side prints from `Object`\n // locals, so the assignment carries the same checkcast as the call sites. The checker proved the\n // right side assignable to the parameter, so the declared type describes the value received.\n javaParameterAssignmentCast(left, right, identation): string | undefined {\n if (!isIdentifier(left)) {\n return undefined;\n }\n const declaration = this.javaDeclarationOfIdentifier(left);\n if (declaration === undefined || !isParameterDeclaration(declaration) || left.text !== (declaration.name as any)?.text) {\n return undefined;\n }\n const native = this.javaNativeParameterType(declaration) ?? this.javaSplitParameterWriteType(declaration);\n if (native === undefined) {\n return undefined;\n }\n const leftText = this.printNode(left, 0);\n if (this.javaNativeArgumentAlreadyTyped(right, native)) {\n return `${leftText} = ${this.printNode(right, identation)}`;\n }\n if (native === 'Long') {\n return `${leftText} = Helpers.toLongOrNull(${this.printNode(right, identation)})`;\n }\n if (native === JAVA_STRING_LIST_TYPE) {\n return `${leftText} = Helpers.toStringListArg(${this.printNode(right, identation)})`;\n }\n // the checkcast carries its own parentheses: a bare `(T) cond ? a : b` binds the\n // condition, not the whole right side\n return `${leftText} = (${native}) (${this.printNode(right, identation)})`;\n }\n\n // ===== native return types (D-09) =====\n //\n // The native Java return a generated method declaration prints with, when its TS\n javaNativeReturnType(node): string | undefined {\n if (node === undefined || node.kind !== SyntaxKind.MethodDeclaration\n || node.name === undefined || node.type === undefined || node.body === undefined\n || !isClassDeclaration(node.parent)) {\n return undefined;\n }\n if (this.javaReturnTypeInProgress.has(node)) {\n return undefined; // a mutually recursive return chain reads as unproven\n }\n if (this.javaReturnTypeCache.has(node)) {\n return this.javaReturnTypeCache.get(node);\n }\n this.javaReturnTypeInProgress.add(node);\n let result;\n try {\n result = this.javaNativeReturnTypeUncached(node);\n } finally {\n this.javaReturnTypeInProgress.delete(node);\n }\n this.javaReturnTypeCache.set(node, result);\n return result;\n }\n\n javaNativeReturnTypeUncached(node): string | undefined {\n const fileName = node.getSourceFile().fileName;\n const generated = JAVA_NATIVE_PARAMETER_GENERATED_FILES.test(fileName);\n // the printed base tier (below the transpile delimiter) may carry a Boolean return\n // when no venue in the program redeclares the name\n const baseTier = !generated && JAVA_NATIVE_PARAMETER_BASE_FILES.test(fileName) && this.javaIsPrintedMethod(node);\n if ((!generated && !baseTier) || this.isAsyncFunction(node)) {\n return undefined;\n }\n const target = this.javaNativeReturnTypeTarget(node);\n if (target === undefined || (baseTier && target !== 'Boolean')) {\n return undefined;\n }\n // D8: an override prints the base declaration's boxed signature; a Boolean base\n // signature binds every override to Boolean (Java return types are covariant only)\n const ancestor = this.getMethodOverride(node);\n const ancestorBoolean = ancestor !== undefined && this.javaNativeReturnType(ancestor) === 'Boolean';\n if (ancestorBoolean && (target !== 'Boolean' || !this.javaReturnSitesPrintType(node, target)\n || (this.javaMethodReturnsNonNullBoolean(ancestor, 0) && !this.javaMethodReturnsNonNullBoolean(node, 0)))) {\n throw new Error(`java: ${String((node.name as any).text)} overrides a Boolean base method but its returns do not all print Boolean`);\n }\n if (ancestor !== undefined && !ancestorBoolean) {\n return undefined;\n }\n if (!this.javaReturnSitesPrintType(node, target)) {\n return undefined;\n }\n return target;\n }\n\n // a native-Boolean method whose every return prints a primitive Java boolean (never null):\n // a call to it can be a condition as is (unboxing cannot throw)\n javaMethodReturnsNonNullBoolean(method, depth: number): boolean {\n if (method === undefined || depth > 3 || method.body === undefined) {\n return false;\n }\n const name = String((method.name as any)?.text);\n if (this.javaNativeReturnType(method) !== 'Boolean' && !JAVA_THIS_BOOLEAN_METHODS.has(name)) {\n return false;\n }\n let returns = 0;\n let ok = true;\n const scan = (n: Node) => {\n if (!ok || (n !== method && isFunctionLike(n))) {\n return;\n }\n if (isReturnStatement(n)) {\n returns++;\n ok = n.expression !== undefined && this.javaPrintsNonNullBoolean(n.expression, depth);\n return;\n }\n n.forEachChild(scan);\n };\n scan(method.body);\n return ok && returns > 0;\n }\n\n javaPrintsNonNullBoolean(node, depth: number): boolean {\n switch (node?.kind) {\n case SyntaxKind.TrueKeyword:\n case SyntaxKind.FalseKeyword:\n return true;\n case SyntaxKind.ParenthesizedExpression:\n return this.javaPrintsNonNullBoolean(node.expression, depth);\n case SyntaxKind.PrefixUnaryExpression:\n return node.operator === SyntaxKind.ExclamationToken; // prints `!` + a condition\n case SyntaxKind.BinaryExpression:\n return JAVA_BOOLEAN_OPERATOR_KINDS.has(node.operatorToken.kind);\n case SyntaxKind.ConditionalExpression:\n return this.javaPrintsNonNullBoolean(node.whenTrue, depth) && this.javaPrintsNonNullBoolean(node.whenFalse, depth);\n case SyntaxKind.CallExpression:\n return this.javaCallPrintsNonNullBoolean(node, depth + 1);\n }\n return false;\n }\n\n // `this.(...)` resolving to a method proven by javaMethodReturnsNonNullBoolean\n javaCallPrintsNonNullBoolean(node, depth: number): boolean {\n if (this.isArrayIsArrayCall(node) || this.javaPreciseBooleanCall(node) || this.javaStringAffixCall(node)) {\n return true;\n }\n const callee = node.expression;\n if (!isPropertyAccessExpression(callee) || callee.expression.kind !== SyntaxKind.ThisKeyword) {\n return false;\n }\n let declaration;\n try {\n declaration = this.getChecker().getResolvedSignature(node)?.declaration?.resolve();\n } catch (e) {\n return false;\n }\n if (declaration === undefined || declaration.kind !== SyntaxKind.MethodDeclaration) {\n return false;\n }\n if (JAVA_THIS_BOOLEAN_METHODS.has(String(callee.name.text))) {\n return this.javaCallBooleanKind(node) === 'boolean';\n }\n return this.javaMethodReturnsNonNullBoolean(declaration, depth);\n }\n\n javaNativeReturnTypeTarget(node): string | undefined {\n let type;\n try {\n type = this.getChecker().getTypeAtLocation(node.type);\n } catch (e) {\n return undefined;\n }\n if (type === undefined) {\n return undefined;\n }\n const aliasSymbol = (type as any).getAliasSymbol?.();\n if (aliasSymbol !== undefined) {\n const name = aliasSymbol.name;\n const fileName = aliasSymbol.declarations?.[0]?.resolve()?.getSourceFile?.()?.fileName;\n if (fileName !== undefined && JAVA_NATIVE_PARAMETER_SOURCE_FILES.test(fileName) && (name === 'Str' || name === 'Bool')) {\n return name === 'Str' ? 'String' : 'Boolean';\n }\n }\n // a plain (non-alias) string annotation already prints String; the flag proof keeps\n // this rule consistent with the printer's own plain-string handling\n if (type.flags === TypeFlags.String) {\n return 'String';\n }\n // plain `boolean` is the true|false union: the Boolean bit, with no alias (`Bool` is handled above)\n if (aliasSymbol === undefined && (type.flags & TypeFlags.Boolean) !== 0) {\n return 'Boolean';\n }\n return this.isJavaMapStructureType(type) ? JAVA_NATIVE_RETURN_MAP_TYPE : undefined;\n }\n\n // every `return` of the method body (nested functions are separate scopes) prints the\n // target Java type\n javaReturnSitesPrintType(method, target: string): boolean {\n const returns: any[] = [];\n const collect = (n) => {\n if (n === undefined) {\n return;\n }\n if (n !== method && isFunctionLike(n)) {\n return;\n }\n if (isReturnStatement(n)) {\n returns.push(n);\n }\n n.forEachChild(collect);\n };\n collect(method.body);\n if (returns.length === 0) {\n return false;\n }\n return returns.every((r) => r.expression !== undefined\n && this.javaExpressionPrintsType(r.expression, target));\n }\n\n javaExpressionPrintsType(expression, target: string): boolean {\n const node = this.javaUnwrapReturnExpression(expression);\n if (node === undefined) {\n return false;\n }\n if (node.kind === SyntaxKind.NullKeyword) {\n return true; // null is assignable to String / Boolean / Map\n }\n if (isIdentifier(node) && node.text === 'undefined') {\n return true;\n }\n if (node.kind === SyntaxKind.ConditionalExpression) {\n return this.javaExpressionPrintsType(node.whenTrue, target)\n && this.javaExpressionPrintsType(node.whenFalse, target);\n }\n let literal: boolean;\n if (target === JAVA_NATIVE_RETURN_MAP_TYPE) {\n literal = isObjectLiteralExpression(node); // a fresh HashMap literal\n } else if (target === 'String') {\n literal = isStringLiteralLikeNode(node);\n } else if (target === 'Boolean') {\n // the printer's own proof that this expression prints a Java boolean (or a\n // Boolean box): the comparison helpers, `!`, the logical operators, boolean\n // literals and the verified boolean-returning calls\n literal = this.javaPrintsBooleanValue(node, new Set(), 0);\n } else {\n return false;\n }\n return literal\n || this.javaReturnedParameterType(node) === target\n || this.javaReturnedCallType(node) === target\n || (target === 'String' && this.javaStringCallReturn(node));\n }\n\n javaUnwrapReturnExpression(expression) {\n if (expression === undefined) {\n return undefined;\n }\n let node = expression;\n while (node !== undefined && (isParenthesizedExpression(node) || isAsExpression(node)\n || isNonNullExpression(node) || isTypeAssertion(node)\n || node.kind === SyntaxKind.SatisfiesExpression)) {\n node = node.expression;\n }\n return node;\n }\n\n // an identifier bound to a parameter the printer itself declares with the target Java\n // type (javaNativeParameterType: Dict/Market/Currency/Str/Bool annotations)\n javaReturnedParameterType(node): string | undefined {\n if (!isIdentifier(node)) {\n return undefined;\n }\n const declaration = this.javaDeclarationOfIdentifier(node);\n if (declaration === undefined || !isParameterDeclaration(declaration)) {\n return undefined;\n }\n return this.javaNativeParameterType(declaration);\n }\n\n // a `this. (...)` / `super. (...)` return is the callee's native return type\n // (fixpoint over javaNativeReturnType)\n javaReturnedCallType(node): string | undefined {\n if (!isCallExpression(node)) {\n return undefined;\n }\n const callee = node.expression;\n if (!isPropertyAccessExpression(callee)\n || (callee.expression.kind !== SyntaxKind.ThisKeyword\n && !(isIdentifier(callee.expression) && callee.expression.text === 'super'))) {\n return undefined;\n }\n let declaration;\n try {\n declaration = this.getChecker().getResolvedSignature(node)?.declaration?.resolve();\n } catch (e) {\n return undefined;\n }\n if (declaration === undefined || declaration.kind !== SyntaxKind.MethodDeclaration) {\n return undefined;\n }\n return this.javaNativeReturnType(declaration);\n }\n\n // a `this. (...)` return of a hand-written base String producer: the resolved\n // signature must still live in the base tier (a venue override prints its own boxed\n // Object signature)\n javaStringCallReturn(node): boolean {\n if (!isCallExpression(node)) {\n return false;\n }\n const callee = node.expression;\n if (!isPropertyAccessExpression(callee) || callee.expression.kind !== SyntaxKind.ThisKeyword) {\n return false;\n }\n if (!JAVA_STRING_RETURN_BASE_METHODS.has(callee.name.text as string)) {\n return false;\n }\n let declaration;\n try {\n declaration = this.getChecker().getResolvedSignature(node)?.declaration?.resolve();\n } catch (e) {\n return false;\n }\n if (declaration === undefined) {\n return false; // an unresolvable call prints Helpers.callDynamically (Object)\n }\n const fileName = declaration.getSourceFile?.()?.fileName;\n return fileName !== undefined && JAVA_STRING_RETURN_BASE_FILES.test(fileName);\n }\n\n // the alias a parameter's annotation names; `OrderType` ('limit' | 'market' | string) reduces\n // to plain `string` and keeps no aliasSymbol, so read the annotation's type reference instead\n javaParameterAliasSymbol(node, type, checker) {\n const symbol = (type as any).getAliasSymbol?.() ?? (type as any).getSymbol?.();\n if (symbol !== undefined || node.type === undefined || !isTypeReferenceNode(node.type)) {\n return symbol;\n }\n const referenced = checker.getSymbolAtLocation(node.type.typeName);\n const alias = referenced !== undefined && (referenced.flags & SymbolFlags.Alias)\n ? checker.getAliasedSymbol(referenced) : referenced;\n return alias !== undefined && (alias.flags & SymbolFlags.TypeAlias) ? alias : undefined;\n }\n\n // the annotation proof alone, without the heritage check\n javaNativeParameterTypeOf(node): string | undefined {\n if (node === undefined || !isParameterDeclaration(node)\n || node.initializer !== undefined || node.dotDotDotToken !== undefined) {\n return undefined;\n }\n const method = node.parent;\n if (method === undefined || !isMethodDeclaration(method) || !isClassDeclaration(method.parent)) {\n return undefined;\n }\n if (!JAVA_NATIVE_PARAMETER_BASE_FILES.test(node.getSourceFile().fileName)\n && !JAVA_NATIVE_PARAMETER_GENERATED_FILES.test(node.getSourceFile().fileName)) {\n return undefined; // a hand-written java class declares this method, not the printer\n }\n const checker: any = this.checkerOrUndefined();\n if (checker === undefined) {\n return undefined;\n }\n const type = checker.getTypeAtLocation(node);\n if (type === undefined) {\n return undefined;\n }\n const symbol = this.javaParameterAliasSymbol(node, type, checker);\n const name = symbol?.name;\n if (name === undefined || JAVA_NATIVE_PARAMETER_TYPES[name] === undefined) {\n return undefined;\n }\n const excluded = JAVA_NATIVE_PARAMETER_EXCLUDED_POSITIONS[(method.name as any)?.text];\n if (excluded !== undefined && excluded.includes(method.parameters.indexOf(node))) {\n return undefined;\n }\n const declaration = symbol?.declarations?.[0]?.resolve();\n const fileName = declaration?.getSourceFile?.()?.fileName;\n return JAVA_NATIVE_PARAMETER_SOURCE_FILES.test(fileName ?? '') ? JAVA_NATIVE_PARAMETER_TYPES[name] : undefined;\n }\n\n // `k` where the consumer declares k as a Java String: the helper's String branch (the\n // only one that can answer true for a map) is the native lookup, and no null key can\n // reach containsKey\n javaDeclaredStringType(expression) {\n const type = this.javaDeclaredTypeOf(expression);\n return type !== undefined && JAVA_DECLARED_STRING_TYPE.test(type);\n }\n\n printCustomBinaryExpressionIfAny(node, identation) {\n const left = node.left;\n const right = node.right;\n const op = node.operatorToken.kind;\n\n if (left.kind === SyntaxKind.Identifier) {\n this.ReassignedVars[this.getVarKey(left)] = true;\n }\n\n if (left.kind === SyntaxKind.TypeOfExpression) {\n const typeOfExpression = this.handleTypeOfInsideBinaryExpression(\n node,\n identation\n );\n if (typeOfExpression) return typeOfExpression;\n }\n\n // a write to a parameter the printer declared natively casts its right side\n if (op === SyntaxKind.EqualsToken && left.kind === SyntaxKind.Identifier) {\n const assignment = this.javaParameterAssignmentCast(left, right, identation);\n if (assignment !== undefined) {\n return assignment;\n }\n }\n\n // destructuring: [a,b] = this.method()\n if (\n op === SyntaxKind.EqualsToken &&\n left.kind === SyntaxKind.ArrayLiteralExpression\n ) {\n const arrayBindingPatternElements = left.elements;\n const parsedArrayBindingElements = arrayBindingPatternElements.map((e) => {\n this.ReassignedVars[this.getVarKey(e)] = true;\n return this.printNode(e, 0);\n });\n const syntheticName = parsedArrayBindingElements.join(\"\") + \"Variable\";\n\n let arrayBindingStatement =\n `var ${syntheticName} = ${this.printNode(right, 0)};\\n`;\n\n parsedArrayBindingElements.forEach((e, index) => {\n // a destructuring target the printer declares natively carries the cast the\n // synthesized `.get(index)` result needs (a plain `Object` read)\n let elementValue = `((java.util.List) ${syntheticName}).get(${index})`;\n const target = arrayBindingPatternElements[index];\n if (isIdentifier(target)) {\n const declaration = this.javaDeclarationOfIdentifier(target);\n const native = declaration !== undefined && isParameterDeclaration(declaration)\n ? (this.javaNativeParameterType(declaration) ?? this.javaSplitParameterWriteType(declaration)) : undefined;\n if (native === 'Long') {\n elementValue = `Helpers.toLongOrNull(${elementValue})`;\n } else if (native !== undefined) {\n elementValue = `(${native}) ${elementValue}`;\n }\n }\n const terminator = index < parsedArrayBindingElements.length - 1 ? \";\\n\" : \"\";\n arrayBindingStatement += this.getIden(identation) + `${e} = ${elementValue}` + terminator;\n });\n\n return arrayBindingStatement;\n }\n\n // ---------------------------------------------------------------\n // setter for element-access assignments: a[b] = v\n // ---------------------------------------------------------------\n if (op === SyntaxKind.EqualsToken &&\n left.kind === SyntaxKind.ElementAccessExpression) {\n // Collect base container and all keys (inner-most key is last).\n const keys: any[] = [];\n let baseExpr: any = null;\n let cur: any = left;\n while (isElementAccessExpression(cur)) {\n keys.unshift(cur.argumentExpression); // prepend\n const expr = cur.expression;\n if (!isElementAccessExpression(expr)) {\n baseExpr = expr;\n break;\n }\n cur = expr;\n }\n\n const containerStr = this.printNode(baseExpr, 0);\n const keyStrs = keys.map(k => this.printNode(k, 0));\n\n // Build GetValue(GetValue( ... )) chain for all but the last key; the first\n // step reads the receiver itself, so a declared map indexes natively and only\n // the `any` steps above it keep the helper (Go: goElementWriteChain).\n let acc = containerStr;\n let firstKey = 0;\n const chainRead = (keyStrs.length > 1) ? this.javaDeclaredChainContainerRead(left, keys.length) : undefined;\n if ((keyStrs.length > 1) && this.javaDeclaredMapReceiver(baseExpr)\n && isStringLiteralLikeNode(keys[0])) {\n acc = `${containerStr}.get(${keyStrs[0]})`;\n firstKey = 1;\n } else if (chainRead !== undefined) {\n acc = chainRead;\n firstKey = 1;\n } else if (keyStrs.length > 1) {\n // `this.[k1][k2] = v`: the bottom step reads the hand-written base map\n // field natively (JAVA_FIELD_TYPES), every step above it keeps the helper\n const fieldRead = this.javaFieldMapReadText(baseExpr, keys[0]);\n if (fieldRead !== undefined) {\n acc = fieldRead;\n firstKey = 1;\n }\n }\n for (let i = firstKey; i < keyStrs.length - 1; i++) {\n acc = `${this.ELEMENT_ACCESS_WRAPPER_OPEN}${acc}, ${keyStrs[i]}${this.ELEMENT_ACCESS_WRAPPER_CLOSE}`;\n }\n\n const prefixes = \"\";\n\n\n const lastKey = keyStrs[keyStrs.length - 1];\n const rhs = this.printNode(right, 0);\n const keyArg = this.elementWriteKeyText(keys[keys.length - 1], lastKey);\n\n if (this.elementWriteTargetsMap(left.expression, baseExpr, keys, right)) {\n // a receiver declared as a Map already carries the type the put binds on\n const target = (keys.length === 1 && this.javaDeclaredMapReceiver(baseExpr))\n ? acc : `((${this.OBJECT_KEYWORD})${acc})`;\n return `${prefixes}${target}.put(${keyArg}, ${rhs})`;\n }\n // a declared Map local takes a non-null value: the helper's only non-put branch is\n // the ConcurrentHashMap null removal, so the native put is the same write\n if (keys.length === 1 && this.javaDeclaredMapReceiver(baseExpr)\n && (isStringLiteralLikeNode(keys[0]) || this.javaDeclaredStringType(keys[0]))\n && this.javaPrintsNonNullValue(right)) {\n return `${prefixes}${acc}.put(${lastKey}, ${rhs})`;\n }\n if (this.javaHx4MapPutIsNative(baseExpr, keys)) {\n return `${prefixes}${acc}.put(${keyArg}, ${rhs})`;\n }\n\n return `${prefixes}Helpers.addElementToObject(${acc}, ${lastKey}, ${rhs})`;\n }\n\n if (op === SyntaxKind.InKeyword) {\n const objectType = this.getChecker().getTypeAtLocation(right);\n const keyType = this.getChecker().getTypeAtLocation(left);\n const objText = this.printNode(right, 0);\n const keyText = this.printNode(left, 0);\n // A key the checker does not prove a Java String: the helper's map branch and containsKey both\n // answer false for it, and the null test keeps ConcurrentHashMap/TreeMap receivers from throwing\n // on a null key. The key prints once per guard, so it must be a side-effect-free read.\n let guarded: string | undefined;\n if (this.isJavaStringType(keyType) || this.javaDeclaredStringType(left)) {\n guarded = '';\n } else if (this.javaSideEffectFreeReference(left) && !this.javaOperandPrintsPrimitiveNumber(left)\n && !this.isNullishLiteral(left)\n && left.kind !== SyntaxKind.TrueKeyword && left.kind !== SyntaxKind.FalseKeyword) {\n guarded = `${keyText} != null && `;\n }\n const withGuard = (read: string) => (guarded ? `(${guarded}${read})` : read);\n if (guarded !== undefined) {\n // the declaration the pass rewrote already carries the map type (and, for a\n // `this.` field or a retyped local, the surface that names it): no cast needed\n if (this.javaDeclaredMapReceiver(right)) {\n return withGuard(`${objText}.containsKey(${keyText})`);\n }\n if (this.isJavaMapType(objectType)) {\n return withGuard(`((java.util.Map)${objText}).containsKey(${keyText})`);\n }\n // `Dictionary | undefined` (a no-overload safe* signature): the helper answers\n // false for the nullish arm, the guard keeps exactly that\n if (this.isJavaNullableMapType(objectType) && this.javaRepeatableOperand(right)) {\n return `(${objText} != null && ${guarded}((java.util.Map)${objText}).containsKey(${keyText}))`;\n }\n }\n return `Helpers.inOp(${objText}, ${keyText})`;\n }\n\n const hx4J05 = this.printHx4J05ModComparison(left, right, op);\n if (hx4J05 !== undefined) {\n return hx4J05;\n }\n // native comparison when both operands provably print as Java numbers. `>` is exact for every\n // numeric pair (isGreaterThan is a toDouble compare, NaN included); `>=` / `<` / `<=` also go\n // through the helper's isEqual, so they need operands isEqual reproduces exactly.\n if (op === SyntaxKind.LessThanToken || op === SyntaxKind.GreaterThanToken ||\n op === SyntaxKind.LessThanEqualsToken || op === SyntaxKind.GreaterThanEqualsToken) {\n const leftKind = this.javaPrimitiveOperandKind(left);\n const rightKind = this.javaPrimitiveOperandKind(right);\n const orderingSafe = op === SyntaxKind.GreaterThanToken\n || this.javaComparisonOperandsAreExact(left, leftKind, right, rightKind);\n if (leftKind !== undefined && rightKind !== undefined && orderingSafe) {\n return `${this.printNode(left, 0)} ${this.SupportedKindNames[op]} ${this.printNode(right, 0)}`;\n }\n const declaredCompare = this.printDeclaredNumericComparison(left, right, op);\n if (declaredCompare !== undefined) {\n return declaredCompare;\n }\n }\n\n // only print the operands when this op is actually handled here; otherwise\n // the base printBinaryExpression prints them, and doing it eagerly means\n // every unhandled binary expression gets its subtrees printed twice\n if (op === SyntaxKind.PlusEqualsToken || op === SyntaxKind.MinusEqualsToken || op in this.binaryExpressionsWrappers) {\n const leftText = this.printNode(left, 0);\n const rightText = this.printNode(right, 0);\n\n const inlined = this.printInlineHelperArithmetic(left, right, leftText, rightText, op);\n if (inlined !== undefined) {\n return inlined;\n }\n\n\n if (op === SyntaxKind.PlusEqualsToken) {\n return `${leftText} = Helpers.add(${leftText}, ${rightText})`;\n }\n\n if (op === SyntaxKind.MinusEqualsToken) {\n return `${leftText} = Helpers.subtract(${leftText}, ${rightText})`;\n }\n\n const wrapper = this.binaryExpressionsWrappers[op];\n const nativeEquality = this.printNativeEqualityIfProvable(node, leftText, rightText);\n if (nativeEquality !== undefined) {\n return nativeEquality;\n }\n return `${wrapper[0]}${leftText}, ${rightText}${wrapper[1]}`;\n }\n\n return undefined;\n }\n\n\n // dict-shaped values are Map in the Java port: raw HashMap/ConcurrentHashMap\n // or a types.TypedMap view (AbstractMap over the raw payload). Proven by the\n // checker (string index signature, or an interface/alias declared in the base types file).\n // a concrete (non-any, non-union, non-generic) type the structure proofs below can reason about\n javaConcreteStructureType(type) {\n const excludedFlags = TypeFlags.Any | TypeFlags.Unknown | TypeFlags.Union\n | TypeFlags.Intersection | TypeFlags.Undefined | TypeFlags.Null\n | TypeFlags.TypeParameter | TypeFlags.Conditional | TypeFlags.Never;\n return type !== undefined && (type.flags & excludedFlags) === 0;\n }\n\n isJavaMapStructureType(type) {\n if (!this.javaConcreteStructureType(type)) {\n return false;\n }\n const checker = this.getChecker();\n if (checker.isArrayType(type) || checker.isTupleType(type)) {\n return false;\n }\n if (type.getStringIndexType() !== undefined) {\n return true;\n }\n const symbol = (type as any).getAliasSymbol?.() ?? type.getSymbol?.();\n const declaration = symbol?.declarations?.[0]?.resolve();\n const fileName = declaration?.getSourceFile?.()?.fileName;\n return fileName !== undefined && /(^|\\/)ts\\/src\\/base\\/types\\.ts$/.test(fileName);\n }\n\n // tuples are List in the Java port (types.TypedList). Only an index inside the\n // tuple's required elements goes native: .get(i) throws out of range where the helper\n // returns null, so non-tuple array reads (any[], string[], ...) keep the helper.\n isJavaListStructureType(type) {\n return this.javaConcreteStructureType(type) && this.getChecker().isTupleType(type);\n }\n\n tupleRequiredElementCount(type) {\n const flags = ((type as any)?.isTypeReference?.() ? (type as any).getTarget().elementFlags : undefined) ?? (type as any)?.elementFlags ?? [];\n let required = 0;\n for (const flag of flags) {\n if (flag !== ElementFlags.Optional && flag !== ElementFlags.Rest) {\n required++;\n } else {\n break;\n }\n }\n return required;\n }\n\n // non-tuple array reads: the Java representation is java.util.List (the printer maps every\n // array type to one), but neither the receiver nor the index is bounded statically, so the\n // read keeps the helper's null / off-range outcomes.\n isJavaArrayStructureType(type) {\n if (!this.javaConcreteStructureType(type)) {\n return false;\n }\n const checker = this.getChecker();\n if (checker.isTupleType(type)) {\n return false; // handled by the tuple branch, where the bound is provable\n }\n return checker.isArrayType(type);\n }\n\n // the null-safe element read prints its receiver once per guard; only a reference whose\n // printed Java has no side effects (identifier, `this`/`this.field` chain) may repeat it.\n javaSideEffectFreeReference(node) {\n if (node === undefined) {\n return false;\n }\n switch (node.kind) {\n case SyntaxKind.Identifier:\n case SyntaxKind.ThisKeyword:\n return true;\n case SyntaxKind.ParenthesizedExpression:\n case SyntaxKind.PropertyAccessExpression:\n return this.javaSideEffectFreeReference(node.expression);\n default:\n return false;\n }\n }\n\n // receivers whose printed elements the ccxt post-pass types as String FROM the helper call\n // (`x.split(sep)` and string-literal array producers): those locals narrow to String only\n // while the read prints `Helpers.GetValue(`, so their reads keep the helper.\n javaStringElementsReceiver(node) {\n if (!isIdentifier(node)) {\n return false;\n }\n const declaration = this.getChecker().getSymbolAtLocation(node)?.valueDeclaration?.resolve();\n const initializer = declaration !== undefined && isVariableDeclaration(declaration) ? declaration.initializer : undefined;\n if (initializer === undefined) {\n return false;\n }\n if (isCallExpression(initializer) && isPropertyAccessExpression(initializer.expression)) {\n return initializer.expression.name?.text === 'split';\n }\n if (isArrayLiteralExpression(initializer)) {\n return initializer.elements.length > 0 && initializer.elements.every((element) =>\n element.kind === SyntaxKind.StringLiteral\n || element.kind === SyntaxKind.NoSubstitutionTemplateLiteral);\n }\n return false;\n }\n\n isLeftSideOfAssignment(node) {\n const parent = node.parent;\n if (parent?.kind !== SyntaxKind.BinaryExpression || parent.left !== node) {\n return false;\n }\n return JAVA_ASSIGNMENT_OPERATOR_KINDS.has(parent.operatorToken.kind);\n }\n\n // The declared Java type of a local is known to the pass that rewrites the declaration\n // text (build/java-local-types.js): it records every local it typed here. Reads consult\n // it; with no consumer installed the table is empty and every read keeps the helper.\n javaDeclaredLocalTypeResolver: ((declaration: Node) => string | undefined) | undefined;\n\n // the declaration node behind an identifier, when the checker resolves one\n javaDeclarationOfIdentifier(expression) {\n if (expression === undefined || !isIdentifier(expression)) {\n return undefined;\n }\n const checker: any = this.checkerOrUndefined();\n if (checker === undefined) {\n return undefined;\n }\n const symbol = checker.getSymbolAtLocation(expression);\n const declaration = symbol?.valueDeclaration?.resolve() ?? symbol?.declarations?.[0]?.resolve();\n const kind = declaration?.kind;\n return kind === SyntaxKind.VariableDeclaration || kind === SyntaxKind.Parameter ? declaration : undefined;\n }\n\n // `x[\"lit\"]` where the consumer declares x as a Java map: the native read returns the\n // element or null, exactly what the helper's Map branch returns, and the declaration\n // already carries the type, so no cast is needed.\n javaDeclaredMapReceiver(expression) {\n const declaration = this.javaDeclarationOfIdentifier(expression);\n if (declaration === undefined) {\n return false;\n }\n if (expression.text !== declaration.name?.text) {\n return false; // a capture rename prints `final Object finalX = x` (Object)\n }\n const type = this.javaDeclaredTypeOfDeclaration(declaration);\n return type !== undefined && JAVA_DECLARED_MAP_TYPES.test(type);\n }\n\n // `x[i]` where x is a declared java List and i is the int counter of `for (var i = `:\n // GetValue answers null for a null receiver or index outside [0, size) while List.get throws, so\n // the emission carries the same tests. `||` short-circuits over identifiers, so nothing runs twice.\n javaDeclaredListElementRead(node, isCounter) {\n if (node.parent?.kind === SyntaxKind.ExpressionStatement) {\n return undefined; // a bare conditional expression is not a Java statement\n }\n // the ws-tier post-pass types `Object client = Helpers.GetValue(..)` by that exact\n // printed text (build/javaTranspiler.ts postProcessWsJava: `Client client =\n // (Client)Helpers.GetValue(..)`). A native read drops the shape and the checkcast\n if (node.parent?.kind === SyntaxKind.VariableDeclaration\n && (node.parent as any).initializer === node\n && ((node.parent as any).name?.text === 'client')) {\n return undefined;\n }\n const declared = this.javaDeclaredTypeOf(node.expression);\n const declaredList = declared !== undefined && JAVA_DECLARED_LIST_TYPES.test(declared);\n let target;\n let list;\n if (declaredList) {\n target = this.printNode(node.expression, 0);\n list = target;\n } else {\n const type = this.getChecker().getTypeAtLocation(node.expression);\n if (!this.isJavaListValueType(type) || this.isVarargsArrayReference(node.expression)\n || !this.javaSideEffectFreeReference(node.expression)) {\n return undefined;\n }\n target = this.printNode(node.expression, 0);\n list = `((java.util.List)${target})`;\n }\n if (!isCounter && Number(node.argumentExpression.text) > 2147483647) {\n return undefined; // printNumericLiteral would add an `L` suffix List.get cannot take\n }\n if (this.javaStringElementsReceiver(node.expression)) {\n return undefined; // its String consumers are typed from the `Helpers.GetValue(` prefix\n }\n const indexText = this.printNode(node.argumentExpression, 0);\n const lowerBound = isCounter ? `${indexText} < 0 || ` : '';\n return `(${target} == null || ${lowerBound}${indexText} >= ${list}.size() ? null : ${list}.get(${indexText}))`;\n }\n\n // `x[k]` where a consumer declares x a java Map and the key is not a literal: the\n // helper's Map branch is the map accessor behind its own tests — a null receiver, a\n // null key and a key that is not a String all answer null, and a String-keyed map's\n javaDeclaredMapElementRead(node) {\n if (node.parent?.kind === SyntaxKind.ExpressionStatement) {\n return undefined; // a bare conditional expression is not a Java statement\n }\n if (this.printElementAccessExpressionExceptionIfAny(node) !== undefined\n || this.isLeftSideOfAssignment(node)) {\n return undefined;\n }\n if (!this.javaDeclaredMapReceiver(node.expression)) {\n return undefined;\n }\n const key = node.argumentExpression;\n if (!isIdentifier(key) || !this.javaRepeatableOperand(key)) {\n return undefined; // the guard prints the key twice\n }\n const declared = this.javaDeclaredTypeOf(key);\n if (declared !== undefined && JAVA_PRIMITIVE_DECLARED_TYPES.has(declared.trim())) {\n return undefined; // a java primitive cannot take the `instanceof` test\n }\n if (declared === undefined && this.javaOperandPrintsPrimitiveNumber(key)) {\n return undefined;\n }\n let keyType;\n try {\n keyType = this.getChecker().getTypeAtLocation(key);\n } catch (e) {\n return undefined;\n }\n if (keyType === undefined\n || this.getChecker().isArrayType(keyType) || this.getChecker().isTupleType(keyType)) {\n return undefined;\n }\n const target = this.printNode(node.expression, 0);\n const keyText = this.printNode(key, 0);\n if (keyType.getAliasSymbol?.() === undefined && keyType.flags === TypeFlags.String) {\n // a plain `string` key prints a java String; the null test keeps a receiver that\n // aliases a ConcurrentHashMap from throwing on a null the alias admits\n return `(${target} == null || ${keyText} == null ? null : ${target}.get(${keyText}))`;\n }\n return `(${target} == null || !(${keyText} instanceof String) ? null : ${target}.get(${keyText}))`;\n }\n\n // the identifier of a `for (var i = ; …; i++)` counter that still prints as\n // `i`: the JN capture rename prints `finalI`, a `final Object` box, which is not an int\n javaPrimitiveCounterIndex(node) {\n if (!this.isJavaPrimitiveCounterReference(node)) {\n return false;\n }\n const declaration = this.javaDeclarationOfIdentifier(node);\n return declaration !== undefined && node.text === declaration.name?.text;\n }\n\n // `this.[k]` on a hand-written base map field (JAVA_FIELD_TYPES): the helper's Map branch is\n // the native `get`. The helper answers null for a null receiver or key, so both stay guarded; the\n // receiver and key are side-effect free. An unguarded read has no parens so a checkcast binds it.\n javaFieldMapReadText(receiver, key): string | undefined {\n if (receiver === undefined || receiver.kind !== SyntaxKind.PropertyAccessExpression\n || receiver.expression?.kind !== SyntaxKind.ThisKeyword) {\n return undefined;\n }\n const name = receiver.name?.text;\n const field = (typeof name === 'string') ? JAVA_FIELD_TYPES[name] : undefined;\n if (field === undefined || field.map !== true) {\n return this.javaJ02FieldMapReadText(receiver, key);\n }\n const keyText = this.printNode(key, 0);\n let keyGuarded = false;\n const checker: any = this.checkerOrUndefined();\n if (checker === undefined) {\n return undefined;\n }\n const keyType = checker.getTypeAtLocation(key);\n if (!this.isJavaStringType(keyType) && !this.javaDeclaredStringType(key)) {\n // the guard prints the key twice, so only a repeatable operand can take it\n if (!this.javaRepeatableOperand(key)) {\n return undefined;\n }\n keyGuarded = true;\n }\n const target = this.printNode(receiver, 0);\n const read = `((java.util.Map)${target}).get(${keyText})`;\n if (!keyGuarded && field.nullable !== true) {\n return read;\n }\n const receiverGuard = (field.nullable === true) ? `${target} == null ? null : ` : '';\n return `(${keyGuarded ? `${keyText} == null ? null : ` : ''}${receiverGuard}${read})`;\n }\n\n // the read stands only where no exchange-specific override claims the site and the node\n // is not a write target\n javaFieldMapReadIfAllowed(node): string | undefined {\n const read = this.javaFieldMapReadText(node.expression, node.argumentExpression);\n if (read === undefined) {\n return undefined;\n }\n if (this.printElementAccessExpressionExceptionIfAny(node) !== undefined || this.isLeftSideOfAssignment(node)) {\n return undefined;\n }\n return read;\n }\n\n // `x[k]` reads: emit the native container accessor when the checker proves the Java\n // representation of `x`, otherwise return undefined so the base prints Helpers.GetValue.\n printCheckerTypedElementAccessRead(node) {\n const key = node.argumentExpression;\n const isStringKey = isStringLiteralLikeNode(key);\n const isNumberKey = isNumericLiteral(key);\n const isCounterKey = !isStringKey && !isNumberKey && this.javaPrimitiveCounterIndex(key);\n if (!isStringKey && !isNumberKey && !isCounterKey) {\n // a `this.` map read carries its own Java proof (JAVA_FIELD_TYPES): the\n // field declaration the printer cannot see is what makes `k` bind natively\n const field = this.javaFieldMapReadIfAllowed(node);\n if (field !== undefined) {\n return field;\n }\n // a declared map (a local the build layer typed, or a param the printer retypes)\n // is the other proof a non-literal key binds natively\n return this.javaDeclaredMapElementRead(node);\n }\n if (this.printElementAccessExpressionExceptionIfAny(node) !== undefined) {\n return undefined; // an exchange-specific override wins, the base prints it\n }\n if (this.isLeftSideOfAssignment(node)) {\n return undefined;\n }\n const type = this.getChecker().getTypeAtLocation(node.expression);\n if (isStringKey) {\n if (!this.isJavaMapStructureType(type)) {\n if (!this.javaDeclaredMapReceiver(node.expression)) {\n // a literal key on a table field the checker does not type (balance is\n // `any`) still has the field table's Java proof\n return this.javaFieldMapReadIfAllowed(node);\n }\n // the declared local is already a map: the accessor binds with no cast\n return `${this.printNode(node.expression, 0)}.get(${this.printNode(key, 0)})`;\n }\n const target = this.printNode(node.expression, 0);\n return `((java.util.Map)${target}).get(${this.printNode(key, 0)})`;\n }\n if (isCounterKey) {\n // a `var` int loop index on a declared List: the only proof that prints an int\n return this.javaDeclaredListElementRead(node, true);\n }\n const index = Number(key.text);\n if (!Number.isInteger(index) || index < 0) {\n return undefined;\n }\n if (this.isJavaListStructureType(type)) {\n if (index >= this.tupleRequiredElementCount(type)) {\n return undefined;\n }\n const target = this.printNode(node.expression, 0);\n return `((java.util.List)${target}).get(${this.printNode(key, 0)})`;\n }\n if (!this.isJavaArrayStructureType(type)) {\n // the checker leaves the receiver boxed: a declared List still reads natively\n return this.javaDeclaredListElementRead(node, false);\n }\n if (!this.javaSideEffectFreeReference(node.expression) || this.javaStringElementsReceiver(node.expression)) {\n return undefined;\n }\n // `Helpers.GetValue` returns null for a null receiver and off range; List.get\n // throws on both, so the native read carries both guards. `||` short-circuits and\n // the receiver is side-effect free, so it is evaluated as often as before.\n const target = this.printNode(node.expression, 0);\n const list = `((java.util.List)${target})`;\n const keyText = this.printNode(key, 0);\n return `(${target} == null || ${keyText} >= ${list}.size() ? null : ${list}.get(${keyText}))`;\n }\n\n printElementAccessExpression(node, identation) {\n return this.printCheckerTypedElementAccessRead(node) ?? super.printElementAccessExpression(node, identation);\n }\n\n\n // ---- helper-family inlining: `+ - * / += -=` ---------------------------\n // `x + y` normally prints Helpers.add, `- * /` print Helpers.subtract/multiply/\n // divide, and `+=`/`-=` print `x = Helpers.add/subtract(...)`. They print native\n // Java when BOTH operands are checker-typed in the same non-nullable scalar family\n // and the printed operands carry the matching Java kind, so the native expression\n // has the helper's boxed result kind and value on every path.\n\n // the TypeScript scalar family of a binary operand: plain `string`/`number` and\n // their literals only. The nullable aliases (Str/Int/Num/Bool), unions and `any`\n // can hold undefined at runtime, which the helpers absorb.\n javaScalarFamily(node): string | undefined {\n const checker: any = this.checkerOrUndefined();\n if (checker === undefined) {\n return undefined;\n }\n const type = checker.getTypeAtLocation(node);\n if (type === undefined || type.getAliasSymbol?.() !== undefined) {\n return undefined;\n }\n const flags = type.flags;\n if (flags === TypeFlags.String || flags === TypeFlags.StringLiteral) {\n return 'string';\n }\n if (flags === TypeFlags.Number || flags === TypeFlags.NumberLiteral) {\n return 'number';\n }\n return undefined;\n }\n\n // true when the printed Java for this operand is statically a String: a string\n // literal, a nested `+` this rule prints as a native concat, or a form the\n // embedding build layer's javaExpressionTypeResolver names `String` (a local whose\n // emitted declaration is `String = `, a call to a hand-written `public\n // String` runtime method). Java compiles `+` only when at least one operand is\n // statically a String, so a String local anchors the concat like a literal does.\n javaProvableString(node): boolean {\n if (node === undefined) {\n return false;\n }\n switch (node.kind) {\n case SyntaxKind.StringLiteral:\n case SyntaxKind.NoSubstitutionTemplateLiteral:\n return true;\n case SyntaxKind.ParenthesizedExpression:\n return this.javaProvableString(node.expression);\n case SyntaxKind.BinaryExpression:\n return this.javaNativeConcat(node);\n }\n return this.javaResolvedString(node);\n }\n\n // the embedding build layer's proof of the concrete printed Java type of an\n // expression (installed like csharpExpressionTypeResolver); only `String` is\n // consumed here, and a missing resolver proves nothing\n javaResolvedString(node): boolean {\n if (node === undefined || this.javaExpressionTypeResolver === undefined) {\n return false;\n }\n try {\n return this.javaExpressionTypeResolver(node) === 'String';\n } catch (e) {\n return false;\n }\n }\n\n // does this `+` node print as a native concat (both sides plain string, one side a\n // provable String)? Mirrors printInlineHelperArithmetic so callers can reason about\n // the printed text of a nested concat.\n javaNativeConcat(node): boolean {\n if (node?.operatorToken?.kind !== SyntaxKind.PlusToken) {\n return false;\n }\n if (this.javaScalarFamily(node.left) !== 'string' || this.javaScalarFamily(node.right) !== 'string') {\n return false;\n }\n return this.javaProvableString(node.left) || this.javaProvableString(node.right);\n }\n\n // B-13: the `+` / `+=` concat drops the helper when one side's printed Java is\n // provably a String and the other side is an operand Helpers.add's String branch\n // converts exactly like javac's `+` does\n javaStringConcatIsProvable(left, right, leftFamily, rightFamily) {\n const leftProvable = this.javaProvableString(left);\n const rightProvable = this.javaProvableString(right);\n if (leftFamily === 'string' && rightFamily === 'string' && (leftProvable || rightProvable)) {\n return true;\n }\n return (leftProvable && this.javaConcatOtherOperandIsSafe(right))\n || (rightProvable && this.javaConcatOtherOperandIsSafe(left));\n }\n\n // the non-anchor operand of a concat: a value StringBuilder.append and Helpers.add's\n // `String.valueOf` branch turn into the same text. Inlined when it is a printed String, when the\n // checker proves a plain non-nullable `string`, or when the type cannot be a boxed Double.\n javaConcatOtherOperandIsSafe(node) {\n if (node === undefined) {\n return false;\n }\n if (this.javaProvableString(node) || this.javaScalarFamily(node) === 'string') {\n return true;\n }\n return this.javaConcatOperandPrintsAsValue(node) && !this.javaConcatOperandCanBeDouble(node);\n }\n\n // a bare value an infix operator can take without extra parentheses: a ternary,\n // assignment or comma expression printed here would re-parse (`(x + c ? a : b)`),\n // and an optional-chain call prints a guarded shape that is not an operand\n javaConcatOperandPrintsAsValue(node) {\n if (node === undefined) {\n return false;\n }\n if (isParenthesizedExpression(node)) {\n return this.javaConcatOperandPrintsAsValue(node.expression);\n }\n switch (node.kind) {\n case SyntaxKind.Identifier:\n case SyntaxKind.StringLiteral:\n case SyntaxKind.NoSubstitutionTemplateLiteral:\n case SyntaxKind.NumericLiteral:\n case SyntaxKind.TrueKeyword:\n case SyntaxKind.FalseKeyword:\n case SyntaxKind.NullKeyword:\n case SyntaxKind.ThisKeyword:\n case SyntaxKind.NewExpression:\n case SyntaxKind.ArrayLiteralExpression:\n return true;\n case SyntaxKind.PropertyAccessExpression:\n case SyntaxKind.ElementAccessExpression:\n case SyntaxKind.CallExpression:\n return node.questionDotToken === undefined;\n }\n return false;\n }\n\n // a Double operand makes Helpers.add take its `instanceof Double` branch and return a NUMBER, while\n // javac's `+` concatenates, so an operand that can be a boxed Double keeps the helper. Only types\n // that can never hold a number are accepted, plus integer literals that print as a Java `long`.\n javaConcatOperandCanBeDouble(node) {\n if (this.javaProvableNumericKind(node) === 'long') {\n return false;\n }\n const checker: any = this.checkerOrUndefined();\n if (checker === undefined) {\n return true;\n }\n const type = checker.getTypeAtLocation(node);\n if (type === undefined) {\n return true;\n }\n const notNumber = TypeFlags.String | TypeFlags.StringLiteral | TypeFlags.TemplateLiteral\n | TypeFlags.Boolean | TypeFlags.BooleanLiteral | TypeFlags.Object | TypeFlags.Null\n | TypeFlags.Undefined | TypeFlags.Void | TypeFlags.Never;\n const notNumeric = (t) => {\n if (t === undefined || t.flags === 0) {\n return false;\n }\n if (t.isUnionType?.()) {\n return t.getTypes().every(notNumeric);\n }\n return (t.flags & ~notNumber) === 0;\n };\n return !notNumeric(type);\n }\n\n // the Java kind a `this.(...)` call provably prints with (JAVA_THIS_RETURN_TYPES), or\n // undefined. The signature must resolve to the base tier or the Date.now lib signature of the\n // functions/time.ts mixin; a venue override prints its own (usually Object) signature.\n javaThisCallNumericKind(node): string | undefined {\n if (node?.kind !== SyntaxKind.CallExpression) {\n return undefined;\n }\n const callee = node.expression;\n if (callee?.kind !== SyntaxKind.PropertyAccessExpression || callee.expression?.kind !== SyntaxKind.ThisKeyword) {\n return undefined;\n }\n const name = callee.name?.text;\n if (typeof name !== 'string') {\n return undefined;\n }\n const kind = JAVA_THIS_RETURN_TYPES[name];\n if (kind === undefined) {\n return undefined;\n }\n const checker: any = this.checkerOrUndefined();\n const declaration = checker.getResolvedSignature(node)?.declaration?.resolve();\n const fileName = declaration?.getSourceFile?.().fileName;\n if (typeof fileName !== 'string') {\n return undefined;\n }\n if (!JAVA_THIS_RETURN_TYPES_BASE_FILE.test(fileName) && !JAVA_THIS_RETURN_TYPES_LIB_FILE.test(fileName)) {\n return undefined;\n }\n return kind;\n }\n\n // the Java kind a numeric operand provably prints with: decimal integer literal -> 'long',\n // fractional literal -> 'double', a nested native `+ - * /` -> its kind, a local retyped\n // `Long`/`Double` -> that kind. Hex/binary literals, negatives, calls, untyped locals: undefined.\n javaProvableNumericKind(node, allowDeclaredLocals = true): string | undefined {\n if (node === undefined) {\n return undefined;\n }\n if (node.kind === SyntaxKind.ParenthesizedExpression) {\n return this.javaProvableNumericKind(node.expression, allowDeclaredLocals);\n }\n if (isNumericLiteral(node)) {\n const text = node.text;\n if (/^0[xXbBoO]/.test(text)) {\n return undefined;\n }\n return /[.eE]/.test(text) ? 'double' : 'long';\n }\n if (node.kind === SyntaxKind.Identifier) {\n if (this.javaPrintedIntCounter(node)) {\n return 'int';\n }\n if (allowDeclaredLocals && this.javaLongParameterRead(node) && this.javaNullGuardAdmitsRead(node)) {\n return 'long'; // an unwritten Long core parameter behind a null test\n }\n return allowDeclaredLocals ? this.javaDeclaredNumericLocalKind(node) : undefined;\n }\n if (node.kind === SyntaxKind.CallExpression) {\n // hand-written base accessors that box a primitive (`Long milliseconds()`,\n // `int parseTimeframe(..)`) - never null, so they anchor the native arithmetic\n if (this.javaBaseTimeLongCall(node)) {\n return 'long';\n }\n if (this.javaBaseIntCall(node)) {\n return 'int';\n }\n // indexOf/search print int, Math.round a primitive long (javaPrintedCallKind)\n const printed = this.javaPrintedCallKind(node);\n return (printed === 'int' || printed === 'long') ? printed : undefined;\n }\n if (node.kind === SyntaxKind.BinaryExpression) {\n return this.javaNativeArithmeticKind(node, allowDeclaredLocals);\n }\n if (this.javaLengthIntRead(node)) {\n return 'int';\n }\n return undefined;\n }\n\n // a bare identifier the embedding layer declares `Long`/`Double` prints as a boxed numeric, but a\n // null box would NPE where the helpers return null, so the checker must see a plain non-nullable\n // number here (nullable aliases and `any` excluded; a narrowed `number` is a real guard in Java).\n javaDeclaredNumericLocalKind(node): string | undefined {\n if (!this.javaOperandIsNonNullNumber(node) || !this.javaIdentifierKeepsDeclaredName(node)\n || !this.javaIdentifierPrintsDeclaredName(node)) {\n return undefined;\n }\n const declaration = this.javaDeclarationOfIdentifier(node);\n let javaType;\n if (declaration !== undefined) {\n try {\n javaType = this.javaDeclaredTypeOfDeclaration(declaration);\n } catch (e) {\n javaType = undefined;\n }\n }\n if (javaType === undefined && typeof this.javaExpressionTypeResolver === 'function') {\n try {\n javaType = this.javaExpressionTypeResolver(node);\n } catch (e) {\n javaType = undefined;\n }\n }\n return this.javaDeclaredNumericTypeKind(javaType);\n }\n\n // the numeric kind a printed Java declaration type names, or undefined for every other\n // type (`Object`, `String`, a boxed collection)\n javaDeclaredNumericTypeKind(javaType): string | undefined {\n if (javaType === undefined) {\n return undefined;\n }\n const type = String(javaType).replace(/^final\\s+/, '').trim();\n const kinds = new Map([['Long', 'long'], ['long', 'long'], ['Double', 'double'], ['double', 'double'],\n ['Integer', 'int'], ['int', 'int']]);\n return kinds.get(type);\n }\n\n // the use prints the declaration's own name: a local or parameter the printer renamed\n // (the `finalX` object-literal capture, the async parameter wrapper) prints against a\n // different declaration, whose recorded type does not describe it\n javaIdentifierPrintsDeclaredName(node): boolean {\n try {\n return this.printNode(node, 0) === String(node.text);\n } catch (e) {\n return false;\n }\n }\n\n // a use the printer rewrote to its `finalX` anonymous-class capture prints against its\n // own `Object finalX = x;` local, so the recorded type of the declaration no longer\n // holds (`(finalTime - 8L)` on an Object local does not compile)\n javaIdentifierKeepsDeclaredName(node): boolean {\n const checker: any = this.checkerOrUndefined();\n if (checker === undefined) {\n return false;\n }\n const declaration = checker.getSymbolAtLocation(node)?.valueDeclaration?.resolve();\n if (declaration === undefined || (declaration.kind !== SyntaxKind.VariableDeclaration\n && !isParameterDeclaration(declaration))) {\n return false;\n }\n return String(node.text) === String(declaration.name?.text);\n }\n\n // the checker type is the plain non-nullable `number` (TypeFlags.Number/NumberLiteral, no\n // alias): `Int`/`Num`/`any` and unions hold undefined at runtime, which the helpers absorb\n javaOperandIsNonNullNumber(node): boolean {\n const checker: any = this.checkerOrUndefined();\n if (checker === undefined) {\n return false;\n }\n const type = checker.getTypeAtLocation(node);\n return type !== undefined && type.getAliasSymbol?.() === undefined\n && (type.flags === TypeFlags.Number || type.flags === TypeFlags.NumberLiteral);\n }\n\n // the kind of the native arithmetic this rule prints for `+ - * /`, or undefined when\n // the node keeps the helper. Mirrors printInlineHelperArithmetic operand-for-operand\n // so callers can reason about the printed text of a nested arithmetic operand;\n // `allowDeclaredLocals=false` asks for a kind that does not rely on a retyped local\n // anywhere in the subtree (`+` never consumes one — java-13/14 own Add).\n javaNativeArithmeticKind(node, allowDeclaredLocals = true): string | undefined {\n const op = node?.operatorToken?.kind;\n const isPlus = op === SyntaxKind.PlusToken;\n const isMinus = op === SyntaxKind.MinusToken;\n const isMultiply = op === SyntaxKind.AsteriskToken;\n const isDivide = op === SyntaxKind.SlashToken;\n if (!isPlus && !isMinus && !isMultiply && !isDivide) {\n return undefined;\n }\n if (this.javaScalarFamily(node.left) !== 'number' || this.javaScalarFamily(node.right) !== 'number') {\n return undefined;\n }\n if (isMultiply && this.javaLiteralFractionalProduct(node.left, node.right)) {\n return 'double';\n }\n const childAllows = allowDeclaredLocals && !isPlus;\n const leftKind = this.javaProvableNumericKind(node.left, childAllows);\n const rightKind = this.javaProvableNumericKind(node.right, childAllows);\n return this.javaNativeArithmeticPairKind(isPlus, isMultiply, isDivide, leftKind, rightKind);\n }\n\n // `2 * 1.67`: two decimal literals whose IEEE product is finite and fractional. Helpers.multiply\n // re-boxes only an integral product as Long, so a fractional one is the native double product.\n javaLiteralFractionalProduct(left, right): boolean {\n const value = (node) => ((node !== undefined && isNumericLiteral(node) && !/^0[xXbBoO]/.test(node.text)) ? Number(node.text) : undefined);\n const a = value(left);\n const b = value(right);\n if (a === undefined || b === undefined || (!/[.eE]/.test(left.text) && !/[.eE]/.test(right.text))) {\n return false;\n }\n const product = a * b;\n return Number.isFinite(product) && !Number.isInteger(product);\n }\n\n // the native operator kind for a proven pair, or undefined. The helper's branch IS this operator:\n // `/` is always double division; `-` boxes long for long/long and double otherwise; `*` only on\n // long pairs (multiply re-boxes an integral double product as Long); `+` keeps the equal-kind rule.\n javaNativeArithmeticPairKind(isPlus, isMultiply, isDivide, leftKind, rightKind): string | undefined {\n if (leftKind === undefined || rightKind === undefined) {\n return undefined;\n }\n if (isDivide) {\n return 'double';\n }\n const hasDouble = (leftKind === 'double') || (rightKind === 'double');\n if (isMultiply) {\n return hasDouble ? undefined : 'long';\n }\n if (isPlus) {\n return (leftKind === rightKind) ? leftKind : undefined;\n }\n return hasDouble ? 'double' : 'long';\n }\n\n // ---- ordered comparison over declared numeric locals ----\n // Helpers.isGreaterThan answers its own predicate when an operand is null (GT: a != null && b == null;\n // LT = !GT && !EQ; GE = GT || EQ; LE = LT || EQ), so a Long/Integer/Double box compares natively\n // inside that exact null table. `>` is a toDouble compare for every numeric pair; `>= < <=` also go\n // through isEqual, so they stay native only for integral pairs (no NaN / BigDecimal rounding arm).\n\n // 'long' | 'double' for an operand the printer proves: a primitive-printing expression, or an\n // identifier whose printed declaration is a numeric type (boxed = may be null)\n javaComparisonOperand(node): { kind: string, boxed: boolean } | undefined {\n let inner = node;\n while (inner !== undefined && inner.kind === SyntaxKind.ParenthesizedExpression) {\n inner = inner.expression;\n }\n if (inner === undefined) {\n return undefined;\n }\n const primitive = this.javaPrimitiveOperandKind(inner);\n if (primitive !== undefined) {\n return { kind: primitive === 'double' ? 'double' : 'long', boxed: false };\n }\n if (!isIdentifier(inner) || !this.javaIdentifierPrintsDeclaredName(inner)) {\n return undefined;\n }\n if (this.javaLongParameterRead(inner)) {\n return { kind: 'long', boxed: !this.javaNullGuardAdmitsRead(inner) };\n }\n const declared = this.javaDeclaredNumericFamily(inner);\n if (declared === undefined) {\n return undefined;\n }\n const kind = (declared === 'Double' || declared === 'double') ? 'double' : 'long';\n return { kind, boxed: JAVA_BOXED_NUMERIC_TYPES.has(declared) };\n }\n\n printDeclaredNumericComparison(left, right, op): string | undefined {\n const l = this.javaComparisonOperand(left);\n const r = this.javaComparisonOperand(right);\n if (l === undefined || r === undefined) {\n return undefined;\n }\n if (op !== SyntaxKind.GreaterThanToken && (l.kind !== 'long' || r.kind !== 'long')) {\n return undefined;\n }\n const a = this.printNode(left, 0);\n const b = this.printNode(right, 0);\n const cmp = `${a} ${this.SupportedKindNames[op]} ${b}`;\n if (!l.boxed && !r.boxed) {\n return `(${cmp})`; // a guarded Long parameter unboxes like a primitive\n }\n const aNull = `${a} == null`;\n const aSet = `${a} != null`;\n const bNull = `${b} == null`;\n const bSet = `${b} != null`;\n // each arm below is the helper's null table, with the unreachable nulls folded away\n switch (op) {\n case SyntaxKind.GreaterThanToken:\n return `(${[l.boxed ? aSet : undefined, r.boxed ? `(${bNull} || ${cmp})` : cmp].filter((x) => x !== undefined).join(' && ')})`;\n case SyntaxKind.LessThanToken:\n return `(${[r.boxed ? bSet : undefined, l.boxed ? `(${aNull} || ${cmp})` : cmp].filter((x) => x !== undefined).join(' && ')})`;\n case SyntaxKind.GreaterThanEqualsToken:\n return `(${[r.boxed ? bNull : undefined, l.boxed ? `(${aSet} && ${cmp})` : cmp].filter((x) => x !== undefined).join(' || ')})`;\n case SyntaxKind.LessThanEqualsToken:\n return `(${[l.boxed ? aNull : undefined, r.boxed ? `(${bSet} && ${cmp})` : cmp].filter((x) => x !== undefined).join(' || ')})`;\n }\n return undefined;\n }\n\n // ---- widened native add (`+` only) ----\n // Helpers.add normalizes Integer to Long, boxes Long for integral operands and Double otherwise\n // (null in -> null out), so native `+` over proven numeric non-null operands gives the same box.\n\n // `this.milliseconds()` / `this.seconds()`: the hand-written Java declares both `public Long` over\n // a primitive time value, so the box is never null. Only a signature resolving into the base time\n // mixin or the Date.now lib chain qualifies; an unresolved call or venue override keeps the helper.\n javaBaseTimeLongCall(node) {\n const name = this.javaThisCallName(node);\n if (name !== 'milliseconds' && name !== 'seconds') {\n return false;\n }\n const checker: any = this.checkerOrUndefined();\n const declaration = checker.getResolvedSignature(node)?.declaration?.resolve();\n if (declaration === undefined) {\n return false;\n }\n const fileName = declaration.getSourceFile?.()?.fileName ?? '';\n // `milliseconds = now` where `now = Date.now` (ts/src/base/functions/time.ts) resolves\n // to the Date.now signature inside the typescript lib chain; `seconds` is declared\n // in that same base file.\n return /(^|[\\\\/])ts[\\\\/]src[\\\\/]base[\\\\/]functions[\\\\/]time\\.ts$/.test(fileName)\n || /(^|[\\\\/])lib\\.[^\\\\/]*\\.d\\.ts$/.test(fileName);\n }\n\n // `this.parseTimeframe(..)`: the hand-written java BaseExchange declares `public int\n // parseTimeframe(Object)` (java/lib/.../BaseExchange.java:1513) over the primitive-int\n // ts/src/base/functions/misc.ts arrow, so the call is a never-null Java int. A venue's\n javaBaseIntCall(node) {\n if (this.javaThisCallName(node) !== 'parseTimeframe') {\n return false;\n }\n let declaration;\n try {\n declaration = this.getChecker().getResolvedSignature(node)?.declaration?.resolve();\n } catch (e) {\n declaration = undefined;\n }\n if (declaration === undefined) {\n return false;\n }\n const fileName = declaration.getSourceFile?.()?.fileName ?? '';\n return /(^|[\\\\/])ts[\\\\/]src[\\\\/]base[\\\\/]functions[\\\\/]misc\\.ts$/.test(fileName);\n }\n\n // the method name of a `this.(...)` call, or undefined for any other node\n javaThisCallName(node) {\n const callee = node?.kind === SyntaxKind.CallExpression ? node.expression : undefined;\n if (callee?.kind !== SyntaxKind.PropertyAccessExpression || callee.expression.kind !== SyntaxKind.ThisKeyword) {\n return undefined;\n }\n return callee.name?.text;\n }\n\n // `for (var i = ; ...; i++)`: printForStatement rewrites the emitted\n // `Object i = 0` initializer to `var i = 0`, so javac types the counter int. The\n // counter is widened explicitly by javaPrintWidenedOperand, and no `=`/compound\n javaIntForCounter(node) {\n if (node?.kind !== SyntaxKind.Identifier) {\n return false;\n }\n const symbol = this.getChecker().getSymbolAtLocation(node);\n const declaration = symbol?.valueDeclaration?.resolve();\n if (declaration === undefined || !isVariableDeclaration(declaration)) {\n return false;\n }\n const declarationList = declaration.parent;\n if (declarationList === undefined || !isVariableDeclarationList(declarationList)\n || declarationList.declarations.length !== 1) {\n return false;\n }\n const forStatement: any = declarationList.parent;\n if (forStatement === undefined || forStatement.kind !== SyntaxKind.ForStatement\n || forStatement.initializer !== declarationList) {\n return false;\n }\n if (this.javaIntegerLiteralKind(declaration.initializer) !== 'int') {\n return false;\n }\n return this.javaCounterHasNoBoxWrite(node, symbol);\n }\n\n // no `=`/compound assignment anywhere in the enclosing function writes this counter;\n // `++`/`--` keep the primitive int, any other operator would not\n javaCounterHasNoBoxWrite(node, symbol) {\n let scope = node.parent;\n while (scope !== undefined && !isFunctionLike(scope) && scope.kind !== SyntaxKind.SourceFile) {\n scope = scope.parent;\n }\n if (scope === undefined) {\n return false;\n }\n let safe = true;\n const visit = (current) => {\n if (!safe || current === undefined) {\n return;\n }\n if (isIdentifier(current) && this.getChecker().getSymbolAtLocation(current) === symbol) {\n const parent = current.parent;\n if (parent !== undefined && isBinaryExpression(parent) && parent.left === current\n && JAVA_ASSIGNMENT_OPERATOR_KINDS.has(parent.operatorToken.kind)) {\n safe = false;\n return;\n }\n }\n current.forEachChild(visit);\n };\n scope.forEachChild(visit);\n return safe;\n }\n\n // `x.length` on a String/List receiver prints `((String)x).length()` /\n // `((java.util.List)x).size()` — a Java int on every path printJavaLength takes\n javaLengthIntRead(node) {\n if (node?.kind !== SyntaxKind.PropertyAccessExpression || node.name?.text !== 'length') {\n return false;\n }\n return this.javaLengthKind(node.expression) !== undefined;\n }\n\n // the Java numeric kind of one `+` operand: the literal proofs above plus the\n // non-null base-tier Long accessors, primitive int for-counters and String/List\n // length reads. Undefined keeps the helper.\n javaWidenedNumericKind(node) {\n if (node === undefined) {\n return undefined;\n }\n if (node.kind === SyntaxKind.ParenthesizedExpression) {\n return this.javaWidenedNumericKind(node.expression);\n }\n const literalKind = this.javaIntegerLiteralKind(node);\n if (literalKind !== undefined) {\n return literalKind;\n }\n if (isNumericLiteral(node)) {\n // hex/octal/binary literals keep the helper; fractional/exponent literals are\n // Java doubles and can hold NaN, which the helper's arithmetic propagates\n if (/^0[xXbBoO]/.test(node.text)) {\n return undefined;\n }\n return /[.eE]/.test(node.text) ? 'double' : undefined;\n }\n if (this.javaBaseTimeLongCall(node)) {\n return 'long';\n }\n if (this.javaBaseIntCall(node) || this.javaIntForCounter(node) || this.javaLengthIntRead(node)) {\n return 'int';\n }\n if (node.kind === SyntaxKind.Identifier) {\n // a declared numeric local/parameter (the embedding layer's declaration table,\n // or a native parameter type): an Integer declares as integral, and the helper\n // normalized it to Long anyway\n if (this.javaLongParameterRead(node) && this.javaNullGuardAdmitsRead(node)) {\n return 'long';\n }\n return this.javaDeclaredNumericLocalKind(node);\n }\n if (node.kind === SyntaxKind.BinaryExpression && node.operatorToken.kind === SyntaxKind.PlusToken) {\n return this.javaWidenedAddKind(node);\n }\n // a nested `- * /` keeps the printer's own literal rule (java-18's family)\n return this.javaNativeArithmeticKind(node);\n }\n\n // the kind of a nested native `+` this rule prints, or undefined when it keeps the helper\n javaWidenedAddKind(node) {\n const leftKind = this.javaWidenedNumericKind(node.left);\n const rightKind = this.javaWidenedNumericKind(node.right);\n if (leftKind === undefined || rightKind === undefined) {\n return undefined;\n }\n return (leftKind === 'double' || rightKind === 'double') ? 'double' : 'long';\n }\n\n // the native form of a numeric `+`, or undefined to keep Helpers.add\n printWidenedNativeAdd(left, right, leftText, rightText) {\n const leftKind = this.javaWidenedNumericKind(left);\n const rightKind = this.javaWidenedNumericKind(right);\n if (leftKind === undefined || rightKind === undefined) {\n return undefined;\n }\n const resultKind = (leftKind === 'double' || rightKind === 'double') ? 'double' : 'long';\n const leftOperand = this.javaPrintWidenedOperand(leftKind, resultKind, left, leftText);\n const rightOperand = this.javaPrintWidenedOperand(rightKind, resultKind, right, rightText);\n return `(${leftOperand} + ${rightOperand})`;\n }\n\n // an int operand is widened to long explicitly: `i + 1` would box an Integer where\n // Helpers.add hands back a Long, and an all-int sum wraps where the helper's long\n // does not. Integer literals print long; a Double result needs no widening.\n javaPrintWidenedOperand(kind, resultKind, node, text) {\n if (kind === 'double') {\n return text;\n }\n if (kind === 'long' || isNumericLiteral(node)) {\n return this.javaPrintOperandAsLong(node, text);\n }\n if (resultKind === 'long') {\n return `((long) ${text})`;\n }\n return text;\n }\n\n // true when the receiver's printed Java would be a `cond ? a : b` (a parenthesised\n // conditional): those keep the helper so no added line carries a `?`\n javaSplitTernaryReceiver(node): boolean {\n if (node.kind === SyntaxKind.ParenthesizedExpression) {\n return this.javaSplitTernaryReceiver(node.expression);\n }\n return node.kind === SyntaxKind.ConditionalExpression;\n }\n\n // `s.split ()` -> the printer's own TS-array shape around Java's\n // String.split(Pattern.quote(...)): the plain-string receiver makes the helper's\n // String.valueOf/null branch unreachable and the result stays readable as List.\n javaNativeSplitCall(node, name, parsedArg): string | undefined {\n if (node === undefined || name === undefined || parsedArg === undefined) {\n return undefined;\n }\n const callee = node.expression;\n if (callee === undefined || callee.kind !== SyntaxKind.PropertyAccessExpression) {\n return undefined;\n }\n if (callee.name?.text !== 'split' || node.arguments?.length !== 1) {\n return undefined;\n }\n const receiver = callee.expression;\n const separator = node.arguments[0];\n if (receiver === undefined || !JAVA_SPLIT_RECEIVER_KINDS.has(receiver.kind)) {\n return undefined;\n }\n // a conditional receiver keeps the helper: the campaign's diff audit flags every\n // added line that carries a `?`, and such a line never goes native in this family\n if (this.javaSplitTernaryReceiver(receiver)) {\n return undefined;\n }\n // the separator is a literal: Helpers.split String.valueOf()s it and quotes it as\n // a regex, and a literal is the only separator whose printed Java is a String\n if (separator.kind !== SyntaxKind.StringLiteral\n && separator.kind !== SyntaxKind.NoSubstitutionTemplateLiteral) {\n return undefined;\n }\n if (this.javaScalarFamily(receiver) !== 'string') {\n return undefined;\n }\n return `${this.ARRAY_OPENING_TOKEN}((String)${name}).split(java.util.regex.Pattern.quote(${parsedArg}))${this.ARRAY_CLOSING_TOKEN}`;\n }\n\n // integer literals print as Java `int`; the helpers normalize Integer to Long before\n // the arithmetic, so native integer arithmetic is emitted in long to keep the boxed\n // result identical\n javaPrintOperandAsLong(node, text) {\n if (!isNumericLiteral(node) || /[.eE]/.test(node.text)) {\n return text;\n }\n return /L$/.test(text) ? text : text + 'L';\n }\n\n // the native form of a helper-family binary operator, or undefined to keep the helper\n // `for (var i = ; ...; i++)` prints a primitive `var` counter (see\n // isJavaPrimitiveForCounter). Only ++/-- may write it: any other assignment in the\n // loop would print a different kind into the same slot (D2), so the proof bails.\n javaProvableCounterInt(node) {\n if (!node || node.kind !== SyntaxKind.Identifier) {\n return false;\n }\n const symbol = this.getChecker().getSymbolAtLocation(node);\n const declaration: any = symbol?.valueDeclaration?.resolve() ?? symbol?.declarations?.[0]?.resolve();\n if (!declaration || declaration.kind !== SyntaxKind.VariableDeclaration) {\n return false;\n }\n if (this.javaIntegerLiteralKind(declaration.initializer) !== 'int') {\n return false;\n }\n const list = declaration.parent;\n const forStatement: any = list?.parent;\n if (!forStatement || forStatement.kind !== SyntaxKind.ForStatement || forStatement.initializer !== list) {\n return false;\n }\n const incrementor = forStatement.incrementor;\n if (!incrementor || incrementor.operand?.kind !== SyntaxKind.Identifier\n || incrementor.operand.text !== node.text) {\n return false;\n }\n if (incrementor.kind !== SyntaxKind.PostfixUnaryExpression && incrementor.kind !== SyntaxKind.PrefixUnaryExpression) {\n return false;\n }\n const name = node.text;\n let safe = true;\n const scan = (n) => {\n if (!safe || !n || n === incrementor) {\n return;\n }\n if (n.kind === SyntaxKind.BinaryExpression && JAVA_ASSIGNMENT_OPERATOR_KINDS.has(n.operatorToken.kind)\n && n.left?.kind === SyntaxKind.Identifier && n.left.text === name) {\n safe = false;\n return;\n }\n if ((n.kind === SyntaxKind.PostfixUnaryExpression || n.kind === SyntaxKind.PrefixUnaryExpression)\n && n.operand?.kind === SyntaxKind.Identifier && n.operand.text === name) {\n return;\n }\n n.forEachChild(scan);\n };\n scan(forStatement.statement);\n if (!safe) {\n return false;\n }\n // the enclosing function may not write it either\n let enclosing = forStatement.parent;\n while (enclosing && !isFunctionLike(enclosing)) {\n enclosing = enclosing.parent;\n }\n if (enclosing) {\n const body = enclosing.body ?? enclosing;\n const scanOuter = (n) => {\n if (!safe || !n || n === forStatement || isFunctionLike(n)) {\n return;\n }\n if (n.kind === SyntaxKind.BinaryExpression && JAVA_ASSIGNMENT_OPERATOR_KINDS.has(n.operatorToken.kind)\n && n.left?.kind === SyntaxKind.Identifier && n.left.text === name) {\n safe = false;\n return;\n }\n n.forEachChild(scanOuter);\n };\n scanOuter(body);\n }\n return safe;\n }\n\n printInlineHelperArithmetic(left, right, leftText, rightText, op) {\n const isPlus = op === SyntaxKind.PlusToken || op === SyntaxKind.PlusEqualsToken;\n const isMinus = op === SyntaxKind.MinusToken || op === SyntaxKind.MinusEqualsToken;\n const isMultiply = op === SyntaxKind.AsteriskToken;\n const isDivide = op === SyntaxKind.SlashToken;\n const isMod = op === SyntaxKind.PercentToken;\n if (!isPlus && !isMinus && !isMultiply && !isDivide && !isMod) {\n return undefined;\n }\n const leftFamily = this.javaScalarFamily(left);\n const rightFamily = this.javaScalarFamily(right);\n if (isPlus && this.javaStringConcatIsProvable(left, right, leftFamily, rightFamily)) {\n const concat = `(${leftText} + ${rightText})`;\n return op === SyntaxKind.PlusEqualsToken ? `${leftText} = ${concat}` : concat;\n }\n // compound assignments keep the helper: the left side is a local the printer\n // declares Object, so the native operator would not compile\n if (op === SyntaxKind.PlusEqualsToken || op === SyntaxKind.MinusEqualsToken) {\n return undefined;\n }\n // `this.milliseconds() - `: the hand-written base call hands back\n // a Long, and Helpers.subtract's Long - Long branch is plain long arithmetic with\n // the same box (Helpers.java), so the helper drops when the right side is long too\n if (op === SyntaxKind.MinusToken) {\n const anchoredKind = this.javaThisCallNumericKind(left);\n if (anchoredKind === 'long' && this.javaProvableNumericKind(right) === 'long') {\n return `(${leftText} - ${this.javaPrintOperandAsLong(right, rightText)})`;\n }\n }\n if (leftFamily !== 'number' || rightFamily !== 'number') {\n return undefined;\n }\n if (op === SyntaxKind.PlusToken) {\n // the widened rule: literals + the non-null numeric proofs this printer owns\n return this.printWidenedNativeAdd(left, right, leftText, rightText);\n }\n if (isMod) {\n // Helpers.mod normalizes both operands to double and returns their double\n // remainder: the same value once both operands print as a non-null Java number\n if (!this.javaProvableNumericDoubleOperand(left) || !this.javaProvableNumericDoubleOperand(right)) {\n return undefined;\n }\n return `(((double) ${leftText}) % ((double) ${rightText}))`;\n }\n if (isMultiply && this.javaLiteralFractionalProduct(left, right)) {\n return `(${leftText} * ${rightText})`;\n }\n // `+` keeps phase-1's literal-only rule (java-13/14 own Add): its operands must not\n // derive from a retyped local anywhere below\n const childAllows = !isPlus;\n const leftKind = this.javaProvableNumericKind(left, childAllows);\n const rightKind = this.javaProvableNumericKind(right, childAllows);\n const pairKind = this.javaNativeArithmeticPairKind(isPlus, isMultiply, isDivide, leftKind, rightKind);\n if (pairKind === undefined) {\n return undefined;\n }\n if (isDivide) {\n // TS `/` is always float division and Helpers.divide never returns a long\n return `(((double) ${leftText}) / ((double) ${rightText}))`;\n }\n const operator = isPlus ? '+' : (isMinus ? '-' : '*');\n const widenedLeft = this.javaPrintArithmeticOperand(leftKind, left, leftText);\n const widenedRight = this.javaPrintArithmeticOperand(rightKind, right, rightText);\n return `(${widenedLeft} ${operator} ${widenedRight})`;\n }\n\n // an Integer/int operand is widened to long before the operator: Helpers normalizes an\n // Integer to Long first, so the native long arithmetic reproduces both the value (no\n // int-width wrap) and the Long box the helper hands back\n javaPrintArithmeticOperand(kind, node, text) {\n if (kind === 'int') {\n return `((long) ${text})`;\n }\n return this.javaPrintOperandAsLong(node, text);\n }\n\n // Helpers.mathMin/mathMax take Object, tolerate null and return the ORIGINAL box; Math.min/max take\n // primitives, so the native call needs both operands primitive of one family: literals, `for`\n // counters, `.length`/`.size()`, native long arithmetic; the only NaN-free double is a literal.\n javaNativeMathMinMaxOperandKind(node) {\n if (this.javaIntegerLiteralKind(node) !== undefined || this.isJavaPrimitiveForCounter(node)\n || (isPropertyAccessExpression(node) && node.name.text === 'length'\n && this.javaLengthKind(node.expression) !== undefined)) {\n return 'integral';\n }\n if (isNumericLiteral(node)) {\n return this.javaProvableNumericKind(node) === 'double' ? 'double' : undefined;\n }\n return this.javaProvableNumericKind(node) === 'long' ? 'integral' : undefined;\n }\n\n // a primitive has no members, so a receiver position (and the printer's cast wrappers) keep the\n // helper - every other position boxes the primitive exactly like the helper's own box (Jackson,\n // isEqual and toString all read an Integer and a Long the same way)\n javaNativeMathMinMaxResultIsPlainValue(node) {\n let parent = node.parent;\n while (parent !== undefined && isParenthesizedExpression(parent)) {\n parent = parent.parent;\n }\n if (parent === undefined) {\n return false;\n }\n if ((isPropertyAccessExpression(parent) || isElementAccessExpression(parent)\n || isCallExpression(parent)) && parent.expression === node) {\n return false;\n }\n return parent.kind !== SyntaxKind.AsExpression\n && parent.kind !== SyntaxKind.TypeAssertionExpression\n && parent.kind !== SyntaxKind.NonNullExpression;\n }\n\n // the native form of Math.min/Math.max, or undefined to keep the helper\n printNativeMathMinMax(node, left, right, leftText, rightText, name) {\n if (!this.javaNativeMathMinMaxResultIsPlainValue(node)) {\n return undefined;\n }\n const kind = this.javaNativeMathMinMaxOperandKind(left);\n if (kind === undefined || kind !== this.javaNativeMathMinMaxOperandKind(right)) {\n return undefined;\n }\n return `Math.${name}(${leftText}, ${rightText})`;\n }\n\n // ---- helper-family inlining: `parseInt/parseFloat/toString/padStart` ----\n // parseInt catches NumberFormatException into null, parseFloat into 0.0, Helpers.toString maps\n // null to null, Helpers.padStart truncates: native form only where the fallback is unreachable.\n\n // `Helpers.toString(x)` is `x == null ? null : x.toString()`, so `String.valueOf(x)`\n // is exact for every argument that cannot be null. Only a numeric literal or a\n // nested `+ - * /` this rule prints natively qualifies: both are Java primitives.\n javaStringBoxText(node, text) {\n return this.javaProvableNumericKind(node) !== undefined ? `String.valueOf(${text})` : `Helpers.toString(${text})`;\n }\n\n // The runtime uses Long.parseLong (parseInt) / Double.parseDouble (parseFloat) inside a catch; a\n // literal the native parser ACCEPTS cannot reach the catch, so the native call cannot change the\n // answer (parseInt additionally needs the value in long range, else the helper answers null).\n javaScalarParseAccepts(callee, text) {\n if (callee === 'parseInt') {\n if (!/^[+-]?[0-9]+$/.test(text)) {\n return false;\n }\n const value = BigInt(text.replace(/^\\+/, ''));\n return value >= BigInt('-9223372036854775808') && value <= BigInt('9223372036854775807');\n }\n // Double.parseDouble's grammar minus the suffix forms; NaN/Infinity are parsed\n // by both, whitespace and hex floats by neither of the two the same way.\n return /^[+-]?([0-9]+(\\.[0-9]*)?|\\.[0-9]+)([eE][+-]?[0-9]+)?$/.test(text)\n || /^[+-]?Infinity$/.test(text)\n || text === 'NaN';\n }\n\n // `parseInt(x)` / `parseFloat(x)` -> the native parse, or undefined to keep the helper\n printNativeScalarParse(node, callee) {\n const args = node?.arguments;\n if (args === undefined || args.length !== 1 || !isStringLiteral(args[0])) {\n return undefined;\n }\n if (!this.javaScalarParseAccepts(callee, args[0].text)) {\n return undefined;\n }\n const nativeName = callee === 'parseInt' ? 'Long.parseLong' : 'Double.parseDouble';\n return `${nativeName}(${this.printNode(args[0], 0)})`;\n }\n\n // The printed receiver of a `padStart` this rule can inline: already cast (`((String)x)`) by the\n // printer or the ccxt local-typing pass, or the checker proves a plain TS string, so the accessor\n // cast this rule adds cannot fire.\n javaPadStartReceiverText(receiver, name) {\n if (/^\\(+\\(String\\)/.test(name)) {\n return name;\n }\n if (this.javaScalarFamily(receiver) === 'string') {\n return `((String)${name})`;\n }\n return undefined;\n }\n\n // `x.padStart(n, 'c')` with a non-negative integer literal length and single-char literal pad.\n // Helpers.padStart pads then answers the LAST `n` chars, so the native form keeps both halves:\n // String.format builds the pad from an empty `%s` and the >= arm reproduces the truncation.\n printNativePadStart(node, name) {\n const args = node?.arguments;\n if (args === undefined || args.length !== 2 || name === undefined) {\n return undefined;\n }\n if (this.javaIntegerLiteralKind(args[0]) !== 'int' || !/^[0-9]+$/.test(args[0].text)) {\n return undefined;\n }\n if (!isStringLiteral(args[1]) || args[1].text.length === 0) {\n return undefined;\n }\n const receiver = node.expression?.expression;\n if (!this.sideEffectFreeReceiver(receiver)) {\n return undefined;\n }\n const receiverText = this.javaPadStartReceiverText(receiver, name);\n if (receiverText === undefined) {\n return undefined;\n }\n const length = args[0].text;\n const pad = `'${this.javaCharLiteral(args[1].text[0])}'`;\n const lengthCall = `${receiverText}.length()`;\n return `(${lengthCall} >= ${length} ? ${receiverText}.substring(${lengthCall} - ${length})`\n + ` : String.format(\"%\" + (${length} - ${lengthCall}) + \"s\", \"\").replace(' ', ${pad}) + ${receiverText})`;\n }\n\n // one char literal for the `String.format(...).replace(' ', c)` pad, escaped\n javaCharLiteral(character) {\n if (character === \"'\" || character === '\\\\') {\n return `\\\\${character}`;\n }\n return character;\n }\n\n // ---- typed locals for native arithmetic ----\n // A local whose initializer prints as native arithmetic holds a String / Long / Double box, so the\n // declaration carries that type; every other use is scanned first (D2) as it changes resolution.\n\n javaUnwrapParentheses(node) {\n let current = node;\n while (current?.kind === SyntaxKind.ParenthesizedExpression) {\n current = current.expression;\n }\n return current;\n }\n\n // the Java type of the native arithmetic this printer prints for a `+ - * / +=`\n // node, or undefined when the node keeps the helper (its printed value is an\n // Object box). Mirrors printInlineHelperArithmetic operand-for-operand.\n javaNativeArithmeticType(node) {\n const value = this.javaUnwrapParentheses(node);\n if (value?.kind !== SyntaxKind.BinaryExpression) {\n return undefined;\n }\n const op = value.operatorToken.kind;\n if (op === SyntaxKind.PlusToken && this.javaNativeConcat(value)) {\n return 'String';\n }\n if (op === SyntaxKind.PlusEqualsToken) {\n // the inlined `x = (x + y)` shape needs the same operand pair the concat\n // branch of printInlineHelperArithmetic needs\n const isStringPair = this.javaScalarFamily(value.left) === 'string'\n && this.javaScalarFamily(value.right) === 'string'\n && (this.javaProvableString(value.left) || this.javaProvableString(value.right));\n return isStringPair ? 'String' : undefined;\n }\n const kind = this.javaNativeArithmeticKind(value);\n return kind === 'long' ? 'Long' : (kind === 'double' ? 'Double' : undefined);\n }\n\n // the enclosing function-like node: the D2 scan scope of a typed local\n javaEnclosingFunction(node) {\n let current = node?.parent;\n while (current !== undefined) {\n const kind = current.kind;\n if (kind === SyntaxKind.MethodDeclaration || kind === SyntaxKind.FunctionDeclaration\n || kind === SyntaxKind.FunctionExpression || kind === SyntaxKind.ArrowFunction\n || kind === SyntaxKind.GetAccessor || kind === SyntaxKind.SetAccessor\n || kind === SyntaxKind.Constructor) {\n return current;\n }\n current = current.parent;\n }\n return undefined;\n }\n\n // a reassignment may keep the narrowed declaration only when its printed value is the\n // same Java type (the helper's box stays an Object, so it keeps the box)\n javaArithmeticWriteIsSafe(right, javaType) {\n const value = this.javaUnwrapParentheses(right);\n if (value === undefined) {\n return false;\n }\n if (value.kind === SyntaxKind.NullKeyword) {\n return true; // `null` is assignable to every box\n }\n if (value.kind === SyntaxKind.Identifier && value.text === 'undefined') {\n return true;\n }\n return (javaType === 'String' && (value.kind === SyntaxKind.StringLiteral\n || value.kind === SyntaxKind.NoSubstitutionTemplateLiteral))\n || this.javaNativeArithmeticType(value) === javaType;\n }\n\n // the innermost block that scopes a declaration (Java locals live to the end of\n // their block; sibling blocks may reuse the name, nested ones may not)\n javaScopingBlock(node) {\n let current = node?.parent;\n let last = undefined;\n while (current !== undefined) {\n if (current.kind === SyntaxKind.Block || current.kind === SyntaxKind.SourceFile) {\n return current;\n }\n last = current;\n current = current.parent;\n }\n return last;\n }\n\n javaNodeContains(outer, inner) {\n return outer !== undefined && inner !== undefined && outer.pos <= inner.pos && inner.end <= outer.end;\n }\n\n // two same-named bindings may both keep their own printed type only in disjoint\n // blocks: a nested one would already be an illegal Java shadowing of the Object\n // declaration the corpus compiles with\n javaBindingsAreDisjoint(declaration, other) {\n const mine = this.javaScopingBlock(declaration);\n const theirs = this.javaScopingBlock(other);\n if (mine === undefined || theirs === undefined) {\n return false;\n }\n return !this.javaNodeContains(mine, theirs) && !this.javaNodeContains(theirs, mine);\n }\n\n // is this occurrence of the local compatible with the narrowed declaration?\n javaArithmeticLocalUseIsSafe(node, declaration, javaType) {\n const parent = node.parent;\n if (parent === undefined) {\n return false;\n }\n if ((parent.kind === SyntaxKind.PropertyAccessExpression || parent.kind === SyntaxKind.PropertyAssignment)\n && parent.name === node) {\n return true; // a member name, not a use of the local\n }\n if ((parent.kind === SyntaxKind.VariableDeclaration || parent.kind === SyntaxKind.Parameter\n || parent.kind === SyntaxKind.BindingElement) && parent.name === node) {\n // a second binding of the same source name: only a disjoint sibling block may\n // keep its own type (no shadowing of the narrowed declaration)\n return this.javaBindingsAreDisjoint(declaration, parent);\n }\n if (parent.kind === SyntaxKind.PostfixUnaryExpression || parent.kind === SyntaxKind.PrefixUnaryExpression) {\n return false; // ++/--/-x/+x print an unboxing or primitive operator\n }\n if (parent.kind === SyntaxKind.SpreadElement || parent.kind === SyntaxKind.DeleteExpression\n || parent.kind === SyntaxKind.ForOfStatement || parent.kind === SyntaxKind.ForInStatement) {\n return false;\n }\n if (parent.kind === SyntaxKind.TypeOfExpression) {\n // prints \\`x instanceof String\\`, the same test the Object declaration printed\n return javaType === 'String';\n }\n if (parent.kind === SyntaxKind.AsExpression || parent.kind === SyntaxKind.TypeAssertionExpression) {\n // \\`x as string\\` prints the identity ((String) x); any other asserted type\n // prints a cast the narrower declaration cannot satisfy\n return javaType === 'String' && parent.type?.kind === SyntaxKind.StringKeyword;\n }\n if (parent.kind === SyntaxKind.ConditionalExpression) {\n // a numeric arm next to a numeric arm makes the conditional numeric and javac\n // unboxes it (an NPE where the Object declaration carried null)\n return javaType === 'String';\n }\n if (parent.kind === SyntaxKind.ElementAccessExpression && parent.expression === node) {\n const grand = parent.parent;\n if (grand?.kind === SyntaxKind.DeleteExpression) {\n return false;\n }\n if (grand?.kind === SyntaxKind.BinaryExpression && grand.left === parent\n && JAVA_ASSIGNMENT_OPERATOR_KINDS.has(grand.operatorToken.kind)) {\n return false; // `x[k] = v` prints a receiver cast the box cannot satisfy\n }\n }\n if (parent.kind === SyntaxKind.ArrayLiteralExpression) {\n const grand = parent.parent;\n if (grand?.kind === SyntaxKind.BinaryExpression && grand.left === parent\n && JAVA_ASSIGNMENT_OPERATOR_KINDS.has(grand.operatorToken.kind)) {\n return false; // `[x, y] = f()` prints a destructuring write into the local\n }\n }\n if (parent.kind === SyntaxKind.BinaryExpression && parent.left === node) {\n const op = parent.operatorToken.kind;\n if (op === SyntaxKind.EqualsToken) {\n return this.javaArithmeticWriteIsSafe(parent.right, javaType);\n }\n if (op === SyntaxKind.PlusEqualsToken) {\n // `x += y` prints a native `x = (x + y)` or the Object-typed helper\n return this.javaNativeArithmeticType(parent) === javaType;\n }\n if (JAVA_ASSIGNMENT_OPERATOR_KINDS.has(op)) {\n return false; // every other compound assignment writes a helper result\n }\n if (op === SyntaxKind.PlusToken && javaType === 'String') {\n // the overload trap: once the local is String, a printed Helpers.add(local, y)\n // binds add(String, Object) instead of add(Object, Object), and the two\n // diverge for a non-string y. A printed native concat has no helper call.\n return this.javaNativeArithmeticType(parent) === 'String';\n }\n }\n return true;\n }\n\n // D2: the narrowed declaration needs every later use of the local in the enclosing\n // function to still compile and resolve the way the Object declaration did\n javaArithmeticLocalIsSafeToType(scope, declaration, javaType) {\n if (scope === undefined) {\n return false;\n }\n const sourceName = declaration.name.text;\n let safe = true;\n const visit = (n) => {\n if (!safe) {\n return;\n }\n if (n.kind === SyntaxKind.Identifier && n.text === sourceName && n !== declaration.name) {\n if (!this.javaArithmeticLocalUseIsSafe(n, declaration, javaType)) {\n safe = false;\n return;\n }\n }\n n.forEachChild(visit);\n };\n scope.forEachChild(visit);\n return safe;\n }\n\n // the Java type a declaration can carry because its initializer prints as native\n // arithmetic, or undefined to keep the Object declaration\n javaArithmeticLocalType(declaration) {\n if (!isIdentifier(declaration.name) || declaration.initializer === undefined) {\n return undefined;\n }\n const javaType = this.javaNativeArithmeticType(declaration.initializer);\n if (javaType === undefined) {\n return undefined;\n }\n const scope = this.javaEnclosingFunction(declaration);\n return this.javaArithmeticLocalIsSafeToType(scope, declaration, javaType)\n ? javaType : undefined;\n }\n\n // an operand `(double) ` can be applied to without changing what Helpers.mod\n // computes: a numeric literal or a native arithmetic node (javaProvableNumericKind,\n // already printed as a java number) or a primitive int loop counter\n javaProvableNumericDoubleOperand(node) {\n return this.javaProvableNumericKind(node) !== undefined || this.javaProvableCounterInt(node);\n }\n\n getFinalVarName(varName: string): string {\n varName = this.getOriginalVarName(varName);\n if (varName.startsWith('final')) {\n return varName;\n }\n return `final${this.capitalize(varName)}`;\n }\n\n getOriginalVarName(name: string): string {\n if (this.ReservedKeywordsReplacements[name]) {\n name = this.ReservedKeywordsReplacements[name];\n }\n return name;\n }\n\n // Resolves the trio of names used to wrap a reassigned async-method param\n // so the lambda body sees an effectively-final local. We base every name on\n // the keyword-remapped Java identifier — using the raw TS name when remapped\n // (e.g. params -> parameters) makes the wrapper text and the body diverge,\n // because identifier emission already routes through ReservedKeywordsReplacements.\n private getAsyncParamWrapperNames(paramName: string): { sigName: string; snapName: string; localName: string } {\n const javaName = this.getOriginalVarName(paramName);\n return {\n sigName: `${javaName}2`,\n snapName: `${javaName}3`,\n localName: javaName,\n };\n }\n\n private isAssignmentOperator(op: SyntaxKind): boolean {\n return op >= SyntaxKind.FirstAssignment && op <= SyntaxKind.LastAssignment;\n }\n\n private isIncDecOperator(op: SyntaxKind): boolean {\n return op === SyntaxKind.PlusPlusToken || op === SyntaxKind.MinusMinusToken;\n }\n\n // Walk the function body in source order and assign a version-aware finalName to\n // every identifier that appears inside an object literal property and refers to a\n // variable that's reassigned anywhere in this function. Each reassignment bumps the\n // per-variable version counter; usages of the same (var, version) share one finalName.\n //\n // Naming:\n // - If only one version of a var is ever used in object literals, use `final`\n // (matches prior behavior).\n // - If multiple versions are used, name them `final`, `final_2`,\n // `final_3` in source-order of the version they correspond to.\n analyzeFinalVars(fnBody: Node): void {\n this.usageToFinalName = new WeakMap();\n if (!fnBody) return;\n\n // Symbol identity: two identifiers are the same lexical variable iff they\n // resolve to the same declaration. This differentiates e.g. `i` in two\n // sibling for-loops (separate `let i` declarations = separate symbols).\n const symbolIdOf = (n: any): string => {\n try {\n const checker = this.getChecker();\n const sym = checker?.getSymbolAtLocation?.(n);\n const decl = sym?.declarations?.[0]?.resolve() ?? sym?.valueDeclaration?.resolve();\n if (decl) return `s:${decl.pos}:${decl.end}`;\n } catch {\n // checker may be unavailable in some contexts — fall through to name-based id\n }\n return `n:${n.text}`;\n };\n\n // Pass 1 — discover which symbols the printer will treat as reassigned.\n //\n // The printer's `printCustomBinaryExpressionIfAny` sets\n // `ReassignedVars[varKey] = true` for the LEFT identifier of *every*\n // BinaryExpression — not just assignment operators. So `timestamp + '#'`\n // or `x === 5` will both flag `timestamp`/`x` later during emit, even\n // though they're plain reads syntactically. The printer's substitution\n // path then uses ReassignedVars as a fallback trigger for the finalXxx\n // rewrite, so a literal capturing such an identifier ends up referring\n // to `finalTimestamp` even when the analyzer thinks the symbol isn't\n // reassigned.\n //\n // If the analyzer disagrees with the printer here, the printer's\n // fallback substitution uses the un-suffixed base name for *every* use\n // (including in sibling if/else branches), and any environment with\n // ancestor-scope dedup leak will suppress one of the two declarations.\n //\n // Mirror the printer's over-broad heuristic in the analyzer so the\n // version-bump machinery (a5c2036 / ac618b0 / 48a1786) can assign\n // distinct names to sibling and post-block uses.\n const reassignedSyms = new Set();\n const discoverPotentialReassignments = (node: any) => {\n if (!node) return;\n if (node.kind === SyntaxKind.BinaryExpression) {\n if (node.left?.kind === SyntaxKind.Identifier) {\n // Mirror printCustomBinaryExpressionIfAny: any BinaryExpression\n // with an Identifier left flags it, regardless of operator.\n reassignedSyms.add(symbolIdOf(node.left));\n } else if (\n node.operatorToken.kind === SyntaxKind.EqualsToken &&\n node.left?.kind === SyntaxKind.ArrayLiteralExpression\n ) {\n // Tuple destructuring assignment: `[a, b] = expr`. The printer's\n // ArrayLiteralExpression branch in printCustomBinaryExpressionIfAny\n // flags each Identifier element in ReassignedVars, so mirror it\n // here for version-bump coverage.\n for (const elem of node.left.elements ?? []) {\n if (elem?.kind === SyntaxKind.Identifier) {\n reassignedSyms.add(symbolIdOf(elem));\n }\n }\n }\n }\n if ((node.kind === SyntaxKind.PrefixUnaryExpression ||\n node.kind === SyntaxKind.PostfixUnaryExpression) &&\n this.isIncDecOperator(node.operator) &&\n node.operand?.kind === SyntaxKind.Identifier) {\n reassignedSyms.add(symbolIdOf(node.operand));\n }\n // Cross-call / cross-method state leak: ReassignedVars accumulates\n // across transpile calls and earlier-printed methods in the same\n // class+method context, so a var declared `const` in this function\n // body may still be flagged from a prior context. The printer's\n // substitution path consults ReassignedVars as a fallback; if the\n // analyzer disagrees, version-bump can't apply and sibling if/else\n // branches end up with the same base name.\n if (node.kind === SyntaxKind.Identifier) {\n const name = node.text as string | undefined;\n if (name && name !== 'undefined' && !name.startsWith?.('null')) {\n if (this.ReassignedVars[this.getVarKey(node)]) {\n reassignedSyms.add(symbolIdOf(node));\n }\n }\n return;\n }\n node.forEachChild(discoverPotentialReassignments);\n };\n discoverPotentialReassignments(fnBody);\n\n if (reassignedSyms.size === 0) return;\n\n // Pass 2 — walk in source order, producing a stream of reassignment and usage\n // events keyed by symbol. Usages are identifiers that (a) sit inside an\n // object literal property initializer expression, (b) refer to a reassigned symbol.\n type Event =\n | { kind: 'reassign'; sym: string }\n | { kind: 'use'; sym: string; name: string; node: Node };\n const events: Event[] = [];\n\n const visitExprInObjLit = (n: any) => {\n if (!n) return;\n if (n.kind === SyntaxKind.Identifier) {\n const name = n.text as string;\n if (name && name !== 'undefined' && !name.startsWith?.('null')) {\n const sym = symbolIdOf(n);\n if (reassignedSyms.has(sym)) {\n events.push({ kind: 'use', sym, name, node: n });\n }\n }\n return;\n }\n if (n.kind === SyntaxKind.BinaryExpression) {\n visitExprInObjLit(n.left);\n visitExprInObjLit(n.right);\n return;\n }\n if (n.kind === SyntaxKind.ParenthesizedExpression) {\n visitExprInObjLit(n.expression);\n return;\n }\n if (n.kind === SyntaxKind.ConditionalExpression) {\n visitExprInObjLit(n.condition);\n visitExprInObjLit(n.whenTrue);\n visitExprInObjLit(n.whenFalse);\n return;\n }\n if (n.kind === SyntaxKind.CallExpression) {\n n.arguments?.forEach(visitExprInObjLit);\n if (n.expression?.kind === SyntaxKind.PropertyAccessExpression) {\n visitExprInObjLit(n.expression.expression);\n }\n return;\n }\n if (n.kind === SyntaxKind.PrefixUnaryExpression) {\n visitExprInObjLit(n.operand);\n return;\n }\n if (n.kind === SyntaxKind.ElementAccessExpression) {\n let left = n.expression;\n while (left?.kind === SyntaxKind.ElementAccessExpression) {\n left = left.expression;\n }\n visitExprInObjLit(left);\n visitExprInObjLit(n.argumentExpression);\n return;\n }\n if (n.kind === SyntaxKind.ObjectLiteralExpression) {\n n.properties?.forEach((p: any) => {\n if (p.initializer) visitExprInObjLit(p.initializer);\n });\n return;\n }\n // Fallback for any other expression kind (ArrayLiteralExpression,\n // SpreadElement, TemplateExpression, AsExpression, NonNullExpression,\n // PropertyAccessExpression, TypeAssertion, etc.) — descend uniformly\n // so identifiers nested inside `[rawHash]`, `{...x}`, `` `${x}` ``, and\n // so on are still tagged. ObjectLiteralExpression is handled above so\n // it doesn't fall through to the generic descent (which would re-walk\n // the same prop initializers and double-count).\n n.forEachChild(visitExprInObjLit);\n };\n\n const walk = (node: any) => {\n if (!node) return;\n\n if (node.kind === SyntaxKind.BinaryExpression &&\n this.isAssignmentOperator(node.operatorToken.kind)) {\n walk(node.right);\n if (node.left?.kind === SyntaxKind.Identifier) {\n const sym = symbolIdOf(node.left);\n if (reassignedSyms.has(sym)) {\n events.push({ kind: 'reassign', sym });\n }\n } else {\n walk(node.left);\n }\n return;\n }\n\n if ((node.kind === SyntaxKind.PrefixUnaryExpression ||\n node.kind === SyntaxKind.PostfixUnaryExpression) &&\n this.isIncDecOperator(node.operator) &&\n node.operand?.kind === SyntaxKind.Identifier) {\n const sym = symbolIdOf(node.operand);\n if (reassignedSyms.has(sym)) {\n events.push({ kind: 'reassign', sym });\n }\n return;\n }\n\n if (node.kind === SyntaxKind.ObjectLiteralExpression) {\n node.properties?.forEach((prop: any) => {\n if (prop.initializer) {\n visitExprInObjLit(prop.initializer);\n walk(prop.initializer);\n }\n });\n return;\n }\n\n // If/else branches introduce sibling scopes for declarations inside\n // them. Without intervention, the analyzer assigns the same per-symbol\n // version to uses across siblings and to uses after the branch.\n // Java permits sibling-scope name reuse when the inner block has\n // popped, but ancestor-scope dedup in buildFinalVarDeclarations +\n // any scope tracking leak in the consumer environment can suppress\n // the outer declaration, leaving an undeclared reference.\n //\n // The helper below records 'use' events inside a sub-block and emits\n // a phantom reassign on exit for every symbol used inside, so each\n // region gets a distinct per-symbol version → distinct finalXxx name.\n const walkBlockAndBump = (subNode: Node | undefined): Set => {\n const usedInBlock = new Set();\n if (!subNode) return usedInBlock;\n const eventsBefore = events.length;\n walk(subNode);\n for (let i = eventsBefore; i < events.length; i++) {\n const e = events[i];\n if (e.kind === 'use') usedInBlock.add(e.sym);\n }\n for (const sym of usedInBlock) {\n events.push({ kind: 'reassign', sym });\n }\n return usedInBlock;\n };\n\n if (node.kind === SyntaxKind.IfStatement) {\n walk(node.expression);\n walkBlockAndBump(node.thenStatement);\n walkBlockAndBump(node.elseStatement);\n // After walking either branch we've already bumped for every\n // symbol used inside it, so post-if uses naturally land on a\n // version higher than either branch's uses.\n return;\n }\n\n // try / catch / finally: catch is a sibling scope to try; finally\n // executes after both. Treat each block the same way as if/else\n // branches so captures across them get distinct snapshot names.\n if (node.kind === SyntaxKind.TryStatement) {\n walkBlockAndBump(node.tryBlock);\n walkBlockAndBump(node.catchClause?.block);\n walkBlockAndBump(node.finallyBlock);\n return;\n }\n\n node.forEachChild(walk);\n };\n\n walk(fnBody);\n\n // Post-process: compute per-symbol versions and assign final names. The\n // final name is derived from the identifier's text, not the symbol — so\n // two distinct symbols named `i` both get `finalI` (each lives in its own\n // lexical scope, so scope-stack dedup allows both to be emitted).\n const counters = new Map();\n const perSym = new Map }>();\n for (const e of events) {\n if (e.kind === 'reassign') {\n counters.set(e.sym, (counters.get(e.sym) ?? 0) + 1);\n } else {\n const v = counters.get(e.sym) ?? 0;\n if (!perSym.has(e.sym)) perSym.set(e.sym, { name: e.name, byVer: new Map() });\n const entry = perSym.get(e.sym)!;\n if (!entry.byVer.has(v)) entry.byVer.set(v, []);\n entry.byVer.get(v)!.push(e.node);\n }\n }\n\n for (const { name, byVer } of perSym.values()) {\n const versions = [...byVer.keys()].sort((a, b) => a - b);\n const baseName = this.getFinalVarName(name);\n versions.forEach((v, idx) => {\n const finalName = idx === 0 ? baseName : `${baseName}_${idx + 1}`;\n for (const n of byVer.get(v)!) {\n this.usageToFinalName.set(n, finalName);\n }\n });\n }\n }\n\n // Undo every in-place identifier rewrite made during the current emit, newest\n // first so repeated rewrites of one node unwind to the original value.\n restoreFinalVarMutations(): void {\n for (let i = this.finalVarMutations.length - 1; i >= 0; i--) {\n const mutation = this.finalVarMutations[i];\n Object.defineProperty(mutation.node, 'text', { value: mutation.text, configurable: true, writable: true });\n if (mutation.ownGetFullText) {\n mutation.node.getFullText = mutation.getFullText;\n } else {\n delete mutation.node.getFullText;\n }\n }\n this.finalVarMutations = [];\n }\n\n printNode(node, identation = 0): string {\n if (node && node.kind === SyntaxKind.SourceFile) {\n // Everything below influences emitted text and outlives a single\n // transpile call (the transpiler instance and the parsed SourceFile are\n // both reused), so reset it per file: an emit must not be able to tell\n // whether it is the first or the tenth for the same input.\n this.restoreFinalVarMutations();\n this.ReassignedVars = {};\n this.varListFromObjectLiterals = {};\n this.usageToFinalName = new WeakMap();\n this.finalVarScopeStack = [];\n try {\n return super.printNode(node, identation);\n } finally {\n this.restoreFinalVarMutations();\n }\n }\n return super.printNode(node, identation);\n }\n\n // true when a property value reads a local the body reassigns (or the analyzer saw\n // reassigned ahead): a double-brace anonymous class could not capture it\n objectLiteralCapturesReassigned(node): boolean {\n return this.objectLiteralCapturedKeys(node).length > 0;\n }\n\n // ReassignedVars keys of the reassigned locals a literal's property values read\n objectLiteralCapturedKeys(node): string[] {\n const keys: string[] = [];\n const walk = (n) => {\n if (!n) return;\n if (n.kind === SyntaxKind.Identifier) {\n const name = n.text as string | undefined;\n const key = this.getVarKey(n);\n if (name && name !== 'undefined' && !name.startsWith('null') &&\n (this.usageToFinalName.has(n) || this.ReassignedVars[key])) {\n keys.push(key);\n }\n return;\n }\n n.forEachChild(walk);\n };\n for (const prop of node.properties) {\n walk(prop.initializer);\n }\n return keys;\n }\n\n printVariableDeclarationList(node, identation) {\n const declaration = node.declarations[0];\n\n if (\n this.removeVariableDeclarationForFunctionExpression &&\n declaration?.initializer &&\n isFunctionExpression(declaration.initializer)\n ) {\n return this.printNode(declaration.initializer, identation).trimEnd();\n }\n\n // array destructuring in variable declaration\n if (declaration?.name.kind === SyntaxKind.ArrayBindingPattern) {\n const arrayBindingPattern = declaration.name;\n const arrayBindingPatternElements = arrayBindingPattern.elements;\n const parsedArrayBindingElements = arrayBindingPatternElements.map((e) =>\n this.printNode(e.name, 0)\n );\n const syntheticName = parsedArrayBindingElements.join(\"\") + \"Variable\";\n\n const arrayBindingStatement =\n `${this.getIden(identation)}var ${syntheticName} = ${this.printNode(\n declaration.initializer,\n 0\n )};\\n`;\n\n return arrayBindingStatement + parsedArrayBindingElements.map((e, index) =>\n this.getIden(identation) + `var ${e} = ((java.util.List) ${syntheticName}).get(${index})`\n ).join(\";\\n\");\n }\n\n const isNew =\n declaration?.initializer &&\n declaration.initializer.kind === SyntaxKind.NewExpression;\n let varToken = isNew ? \"var \" : this.VAR_TOKEN + \" \";\n if (!isNew) {\n // a native-arithmetic initializer prints a String/Long/Double value: the\n // declaration can name that type instead of Object (D3, scanned by java-31)\n const arithmeticType = this.javaArithmeticLocalType(declaration);\n if (arithmeticType !== undefined) {\n varToken = arithmeticType + \" \";\n }\n }\n\n // handle `let x;`\n if (!declaration.initializer) {\n return (\n this.getIden(identation) +\n \"Object \" +\n this.printNode(declaration.name) +\n \" = \" +\n this.UNDEFINED_TOKEN\n );\n }\n\n const parsedValue = this.printNode(declaration.initializer, identation).trimStart();\n if (parsedValue === this.UNDEFINED_TOKEN) {\n let specificVarToken = \"Object\";\n if (this.INFER_VAR_TYPE) {\n const variableType = this.getChecker().typeToString(\n this.getChecker().getTypeAtLocation(declaration)\n );\n if (this.VariableTypeReplacements[variableType]) {\n specificVarToken = this.VariableTypeReplacements[variableType];\n }\n }\n return (\n this.getIden(identation) +\n specificVarToken +\n \" \" +\n this.printNode(declaration.name) +\n \" = \" +\n parsedValue\n );\n }\n return (\n this.getIden(identation) +\n varToken +\n this.printNode(declaration.name) +\n \" = \" +\n parsedValue\n );\n }\n\n printThisKeyword(node, identation) {\n\n let current = node?.parent;\n while (current) {\n if (current.kind === SyntaxKind.PropertyAssignment &&\n !this.builderObjectLiterals.has(current.parent)) {\n const className = this.currentClassName;\n return `${this.capitalize(className)}.this`;\n }\n current = current?.parent;\n }\n // if this.x() is inside a object a object literal and we need to add the class name\n return this.THIS_TOKEN;\n }\n\n transformPropertyAcessExpressionIfNeeded(node) {\n const expression = node.expression;\n\n const leftSide = this.printNode(expression, 0);\n const rightSide = node.name.text;\n\n let rawExpression = undefined;\n\n switch (rightSide) {\n case \"length\": {\n const type = (this.getChecker() as Checker).getTypeAtLocation(\n expression\n );\n this.warnIfAnyType(node, (type as any).flags, leftSide, \"length\");\n rawExpression = this.printJavaLength(expression, leftSide);\n break;\n }\n case \"push\":\n rawExpression = `((java.util.List)${leftSide}).add`;\n break;\n }\n return rawExpression;\n }\n\n printCustomDefaultValueIfNeeded(node) {\n if (\n isArrayLiteralExpression(node) ||\n isObjectLiteralExpression(node) ||\n isStringLiteral(node) ||\n isBooleanLiteral(node) ||\n isNumericLiteral(node)\n ) {\n return this.UNDEFINED_TOKEN;\n }\n\n if (\n node?.text === \"undefined\" &&\n this.getChecker().getTypeAtLocation(node?.parent)?.flags ===\n TypeFlags.Number\n ) {\n return this.UNDEFINED_TOKEN;\n }\n\n return undefined;\n }\n\n // Unpacks one optional parameter. Native array access replaces Helpers.getArg\n // when the initializer is a pure literal; the null check keeps the helper's\n // contract that a null varargs array reads like an empty one.\n // The expression half is shared with the untyped front, which passes the same value to the\n // typed core as an argument instead of binding a local.\n printOptionalArgExpression(index, initializer) {\n const defaultValue = this.printNode(initializer, 0);\n if (!this.isPureInitializer(initializer)) {\n return `Helpers.getArg(optionalArgs, ${index}, ${defaultValue})`;\n }\n return `optionalArgs != null && optionalArgs.length > ${index} ? optionalArgs[${index}] : ${defaultValue}`;\n }\n\n printOptionalArgInit(paramName, index, initializer) {\n return `Object ${paramName} = ${this.printOptionalArgExpression(index, initializer)};`;\n }\n\n // Pure = evaluating the initializer has no effect and cannot throw, so\n // skipping it when the argument was supplied cannot change behavior.\n isPureInitializer(node) {\n switch (node?.kind) {\n case SyntaxKind.NullKeyword:\n case SyntaxKind.TrueKeyword:\n case SyntaxKind.FalseKeyword:\n case SyntaxKind.StringLiteral:\n case SyntaxKind.NoSubstitutionTemplateLiteral:\n case SyntaxKind.NumericLiteral:\n return true;\n case SyntaxKind.Identifier:\n // `= undefined` prints as null; any other name could be a call result\n return node.text === 'undefined';\n case SyntaxKind.ArrayLiteralExpression:\n return node.elements.every((element) => this.isPureInitializer(element));\n case SyntaxKind.ObjectLiteralExpression:\n return node.properties.every((property) => isPropertyAssignment(property) && this.isPureInitializer(property.initializer));\n case SyntaxKind.ParenthesizedExpression:\n case SyntaxKind.AsExpression:\n case SyntaxKind.TypeAssertionExpression:\n case SyntaxKind.NonNullExpression:\n return this.isPureInitializer(node.expression);\n default:\n return false;\n }\n }\n\n // a literal-defaulted parameter is read as `Objects.requireNonNullElse(x, )`: a dynamic\n // caller pads omitted slots with null, and the parameter stays final with no local copy\n javaDefaultedLocalNames: Map = new Map();\n\n javaDefaultedParameterLocals(node): string[] {\n if (node.body === undefined) {\n return [];\n }\n const types = this.javaCoreParameterTypes(node);\n node.parameters.forEach((param, i) => {\n if (!this.javaIsLiteralDefault(param.initializer) || !isIdentifier(param.name)) {\n return;\n }\n const symbol = this.javaSymbolOf(param.name);\n if (symbol === undefined) {\n return;\n }\n const name = this.printNode(param.name, 0);\n const value = this.javaCoreDefaultArgument(param, types[i]);\n this.javaDefaultedLocalNames.set(symbol, `java.util.Objects.requireNonNullElse(${name}, ${value})`);\n });\n return [];\n }\n\n // a string, number or boolean literal default (null, `undefined` and `{}` / `[]` keep the parameter)\n javaIsLiteralDefault(initializer): boolean {\n let node = initializer;\n while (node !== undefined && (isParenthesizedExpression(node) || isAsExpression(node))) {\n node = node.expression;\n }\n if (node !== undefined && isPrefixUnaryExpression(node) && node.operator === SyntaxKind.MinusToken) {\n node = node.operand;\n }\n return node !== undefined && (isStringLiteralLikeNode(node) || isNumericLiteral(node)\n || node.kind === SyntaxKind.TrueKeyword || node.kind === SyntaxKind.FalseKeyword);\n }\n\n javaDefaultedLocalName(node): string | undefined {\n if (this.javaDefaultedLocalNames.size === 0 || isParameterDeclaration(node.parent)\n || (isPropertyAccessExpression(node.parent) && node.parent.name === node)\n || isPropertyAssignment(node.parent) && node.parent.name === node) {\n return undefined;\n }\n let symbol;\n try {\n symbol = this.getChecker().getSymbolAtLocation(node);\n } catch (e) {\n return undefined;\n }\n return symbol === undefined ? undefined : this.javaDefaultedLocalNames.get(symbol);\n }\n\n printFunctionBody(node, identation) {\n // Save/restore rather than clobber: a nested function re-enters this method\n // and must not destroy the enclosing body's analysis state on the way out.\n const savedVarList = this.varListFromObjectLiterals;\n const savedUsageToFinalName = this.usageToFinalName;\n const savedScopeStack = this.finalVarScopeStack;\n this.varListFromObjectLiterals = {};\n this.analyzeFinalVars(node.body);\n this.finalVarScopeStack = [new Set()];\n const funcParams = node.parameters ?? [];\n const bodyStatements = node.body.statements;\n const isAsync = this.isAsyncFunction(node);\n // a method's default-valued parameters are parameters of its typed signature: no unpack locals\n const splitCore = isMethodDeclaration(node);\n const initParams = splitCore ? this.javaDefaultedParameterLocals(node) : [];\n const processedParts = [];\n try {\n for (let i = 0; i < bodyStatements.length; i++) {\n processedParts.push(this.printNode(bodyStatements[i], identation + 1));\n }\n } finally {\n this.varListFromObjectLiterals = savedVarList;\n this.usageToFinalName = savedUsageToFinalName;\n this.finalVarScopeStack = savedScopeStack;\n }\n let firstStatement = processedParts[0] || '';\n const remainingString = processedParts.slice(1).join(\"\\n\");\n let offSetIndex = 0;\n funcParams.forEach((param, i) => {\n const initializer = param.initializer;\n if (initializer) {\n if (splitCore) {\n if (!this.isPureInitializer(initializer) && !this.javaDefaultedLocalNames.has(this.javaSymbolOf(param.name))) {\n const name = this.printNode(param.name, 0);\n initParams.push(`if (${name} == null) { ${name} = ${this.printNode(initializer, 0)}; }`);\n }\n return; // the value arrives as a parameter of the typed signature\n }\n const index = i + offSetIndex;\n // index = index < 0 ? 0 : i - 1;\n const paramName = this.printNode(param.name, 0);\n initParams.push(this.printOptionalArgInit(paramName, index, initializer));\n } else {\n offSetIndex--;\n }\n });\n\n if (initParams.length > 0) {\n const defaultInitializers =\n initParams.map((l) => this.getIden(identation + 1) + l).join(\"\\n\") +\n \"\\n\";\n const bodyParts = firstStatement.split(\"\\n\");\n const commentPart = bodyParts.filter((line) => this.isComment(line));\n const isComment = commentPart.length > 0;\n if (isComment) {\n const commentPartString = commentPart\n .map((c) => this.getIden(identation + 1) + c.trim())\n .join(\"\\n\");\n const firstStmNoComment = bodyParts\n .filter((line) => !this.isComment(line))\n .join(\"\\n\");\n firstStatement =\n commentPartString + \"\\n\" + defaultInitializers + firstStmNoComment;\n } else {\n firstStatement = defaultInitializers + firstStatement;\n }\n }\n const blockOpen = this.getBlockOpen(identation);\n const blockClose = this.getBlockClose(identation);\n firstStatement = remainingString.length > 0 ? firstStatement + \"\\n\" : firstStatement;\n\n if (isAsync && isMethodDeclaration(node) && this.javaReassignsParameter(node)) {\n // unsupported: a lambda cannot capture a reassigned parameter; the TS source must not reassign it\n const where = `${node.getSourceFile().fileName}:${(node.name as any).text}`;\n this.javaReassigningMethods.push(where);\n const message = `[Java] async method reassigns a parameter (not effectively final, the TS source must use a new local): ${where}`;\n if (this.javaStrictEffectivelyFinal) {\n throw new Error(message);\n }\n Logger.warning(message);\n }\n if (isAsync) {\n const finalWrapperVars = isMethodDeclaration(node) ? '\\n' : this.printFinalOutsideMethodVariableWrappersIfAny(node, identation) + \"\\n\";\n const insideWrappers = isMethodDeclaration(node) ? '\\n' : this.printInsideMethodVariableWrappersIfAny(node, identation + 1) + \"\\n\";\n const body = (firstStatement + remainingString).split(\"\\n\").map(line => this.getIden(identation) + line).join(\"\\n\");\n // Check if last statement is a return — if not, add return null for supplyAsync lambda\n const lastStatement = bodyStatements.length > 1 ? bodyStatements[bodyStatements.length - 1] : (bodyStatements.length > 0 ? bodyStatements[0] : undefined);\n const lastStmtIsReturn = lastStatement && (isReturnStatement(lastStatement) || this.allBranchesTerminate(lastStatement));\n const returnNull = lastStmtIsReturn ? \"\" : (this.getIden(identation + 2) + \"return null;\\n\");\n const supplier = this.asyncSupplier || \"java.util.concurrent.CompletableFuture.supplyAsync\";\n const executorArg = (!this.asyncSupplier && this.asyncExecutor) ? `, ${this.asyncExecutor}` : \"\";\n const asyncBody = this.getIden(identation + 1) + `return ${supplier}(() -> {\\n` +\n insideWrappers +\n body + \"\\n\" +\n returnNull +\n this.getIden(identation + 1) + `}${executorArg});\\n`;\n return blockOpen + finalWrapperVars + asyncBody + blockClose;\n\n }\n return blockOpen + firstStatement + remainingString + blockClose;\n }\n\n printBlock(node, identation, chainBlock = false) {\n // Track per-block scope for final var dedup: same final name must not be\n // declared twice in a single block (Java would error), but may shadow\n // across nested blocks. We push an empty scope on entry and pop on exit.\n const managed = this.finalVarScopeStack.length > 0;\n if (managed) this.finalVarScopeStack.push(new Set());\n try {\n return super.printBlock(node, identation, chainBlock);\n } finally {\n if (managed) this.finalVarScopeStack.pop();\n }\n }\n\n printInstanceOfExpression(node, identation) {\n // const left = node.left.escapedText;\n const right = node.right.text;\n const left = this.printNode(node.left, 0);\n // const right = this.printNode(node.right, 0);\n return this.getIden(identation) + `Helpers.isInstance(${left}, ${right}.class)`;\n }\n\n printAwaitExpression(node, identation) {\n const expression = this.printNode(node.expression, identation);\n return `(${expression}).join()`;\n }\n\n printAsExpression(node, identation) {\n const type = node.type;\n\n if (type.kind === SyntaxKind.AnyKeyword) {\n return `((${this.VariableTypeReplacements['object']})${this.printNode(\n node.expression,\n identation\n )})`;\n }\n\n if (type.kind === SyntaxKind.StringKeyword) {\n return `((String)${this.printNode(node.expression, identation)})`;\n }\n\n if (type.kind === SyntaxKind.ArrayType) {\n const element = type.elementType.kind === SyntaxKind.AnyKeyword ? 'Object'\n : type.elementType.kind === SyntaxKind.StringKeyword ? 'String' : undefined;\n if (element !== undefined) {\n return `(java.util.List<${element}>)(${this.printNode(node.expression, identation)})`;\n }\n }\n\n return this.printNode(node.expression, identation);\n }\n\n // every Java parameter is `Object` (base printParameterType), except the ones whose TS\n // annotation names a native-carriable alias (javaNativeParameterType)\n printParameterType(node) {\n const native = this.javaNativeParameterType(node);\n if (native !== undefined) {\n return native;\n }\n return super.printParameterType(node);\n }\n\n printParameter(node, defaultValue = true) {\n const name = this.printNode(node.name, 0);\n const initializer = node.initializer;\n\n const type = this.printParameterType(node) || \"\";\n\n if (defaultValue) {\n if (initializer) {\n const def = this.printCustomDefaultValueIfNeeded(initializer) || this.printNode(initializer, 0);\n return type + \" \" + name + this.SPACE_DEFAULT_PARAM + \"=\" + this.SPACE_DEFAULT_PARAM + def;\n }\n return type + \" \" + name;\n }\n return name;\n }\n\n // the typed core signature: every parameter prints its Java type, the default-valued ones\n // included (a Java signature cannot carry a default - the front supplies it)\n printCoreMethodParameters(node) {\n return node.parameters.map(param => (param.initializer !== undefined\n ? `${this.javaOptionalParameterJavaType(param)} ${this.printNode(param.name, 0)}`\n : this.printParameter(param))).join(\", \");\n }\n\n // an async method's reassigned parameter prints under sigName (post keyword-remap),\n // freeing the original name for the lambda body to bind\n javaAsyncSignatureParameter(param, isAsyncMethod, printedParam) {\n if (isAsyncMethod && this.ReassignedVars[this.getVarKey(param)]) {\n const { localName, sigName } = this.getAsyncParamWrapperNames(param.name.text);\n return printedParam.replace(localName, sigName);\n }\n return printedParam;\n }\n\n // the async method body writes one of its parameters, or a non-pure default must be applied\n // by an `if (x == null) { x = init; }` inside the lambda (both break effective finality)\n javaReassignsParameter(node): boolean {\n const params = node.parameters ?? [];\n if (params.some((p) => p.initializer !== undefined && !this.isPureInitializer(p.initializer) && this.isAsyncFunction(node))) {\n return true;\n }\n const symbols = new Set();\n params.forEach((p) => {\n const symbol = this.javaSymbolOf(p.name);\n if (symbol !== undefined) {\n symbols.add(symbol);\n }\n });\n return symbols.size > 0 && node.body !== undefined && this.javaWritesSymbol(node.body, symbols);\n }\n\n javaSymbolOf(node): any | undefined {\n return this.getChecker().getSymbolAtLocation(node);\n }\n\n // syntactic walk: assignment targets, ++/--, destructuring targets and for-in/of expression heads\n javaWritesSymbol(node, symbols: Set): boolean {\n if (isBinaryExpression(node)) {\n const op = node.operatorToken.kind;\n if (op >= SyntaxKind.FirstAssignment && op <= SyntaxKind.LastAssignment\n && this.javaTargetWritesSymbol(node.left, symbols, op === SyntaxKind.EqualsToken)) {\n return true;\n }\n } else if ((isPrefixUnaryExpression(node) || isPostfixUnaryExpression(node))\n && (node.operator === SyntaxKind.PlusPlusToken || node.operator === SyntaxKind.MinusMinusToken)\n && this.javaTargetWritesSymbol(node.operand, symbols, false)) {\n return true;\n } else if ((isForInStatement(node) || isForOfStatement(node))\n && !isVariableDeclarationList(node.initializer)\n && this.javaTargetWritesSymbol(node.initializer, symbols, true)) {\n return true;\n }\n return node.forEachChild((child) => this.javaWritesSymbol(child, symbols) || undefined) === true;\n }\n\n javaTargetWritesSymbol(target, symbols: Set, destructuring: boolean): boolean {\n if (isParenthesizedExpression(target) || isNonNullExpression(target) || isAsExpression(target)) {\n return this.javaTargetWritesSymbol(target.expression, symbols, destructuring);\n }\n if (isIdentifier(target)) {\n const symbol = this.javaSymbolOf(target);\n return symbol !== undefined && symbols.has(symbol);\n }\n if (!destructuring) {\n return false;\n }\n if (isArrayLiteralExpression(target)) {\n return target.elements.some((e) => this.javaTargetWritesSymbol(isSpreadElement(e) ? e.expression : e, symbols, true));\n }\n if (isObjectLiteralExpression(target)) {\n return target.properties.some((p) => {\n if (isShorthandPropertyAssignment(p)) {\n return this.javaTargetWritesSymbol(p.name, symbols, true);\n }\n if (isPropertyAssignment(p)) {\n return this.javaTargetWritesSymbol(p.initializer, symbols, true);\n }\n return isSpreadAssignment(p) && this.javaTargetWritesSymbol(p.expression, symbols, true);\n });\n }\n if (isBinaryExpression(target) && target.operatorToken.kind === SyntaxKind.EqualsToken) {\n return this.javaTargetWritesSymbol(target.left, symbols, true); // `[x = 1] = ...` default\n }\n return false;\n }\n\n // `file:method` of every async method whose body reassigns a parameter (unsupported in Java lambdas)\n javaReassigningMethods: string[] = [];\n // the embedding build turns a reassigned async parameter into a hard transpile error\n javaStrictEffectivelyFinal = false;\n\n printMethodParameters(node) {\n const isAsyncMethod = this.isAsyncFunction(node);\n const params = node.parameters.map(param => this.javaAsyncSignatureParameter(param, isAsyncMethod, this.printParameter(param)));\n const hasOptionalParameter = node.parameters.some(p => p.initializer !== undefined || p.questionToken !== undefined);\n if (!hasOptionalParameter) {\n return params.join(\", \");\n }\n const paramsWithOptional = params.filter(param => param.indexOf('=') === -1);\n paramsWithOptional.push('Object... optionalArgs');\n return paramsWithOptional.join(\", \");\n }\n\n printArrayLiteralExpression(node) {\n // For Java: new ArrayList<>(Arrays.asList(elem1, elem2, ...))\n const elements = node.elements.map((e) => this.printNode(e)).join(\", \");\n return `${this.ARRAY_OPENING_TOKEN}${elements}${this.ARRAY_CLOSING_TOKEN}`;\n }\n\n\n printFinalOutsideMethodVariableWrappersIfAny(node, identation) {\n return this.javaAsyncParamWrapperLines(node, identation, (param, isOptionalParam, { sigName, snapName }) => {\n // a default-valued parameter of the split core keeps its type in the\n // snapshot (`final Long since3 = since2;`); the body local stays `Object`\n const snapType = (isOptionalParam && param.initializer !== undefined)\n ? this.javaOptionalParameterJavaType(param) : 'Object';\n return `final ${snapType} ${snapName} = ${sigName};`;\n });\n }\n\n printInsideMethodVariableWrappersIfAny(node, identation) {\n return this.javaAsyncParamWrapperLines(node, identation, (param, _isOptionalParam, { localName, snapName }) =>\n `${this.javaAsyncParameterLocalType(param) ?? 'Object'} ${localName} = ${snapName};`);\n }\n\n // one line per reassigned parameter of an async method (optional ones only in a split core)\n javaAsyncParamWrapperLines(node, identation, printLine) {\n const parameters = node?.parameters;\n const finalVarWrappers = [];\n if (parameters) {\n const isAsyncMethod = this.isAsyncFunction(node);\n const splitCore = this.hasDefaultedTail(node);\n parameters.forEach(param => {\n const isOptionalParam = param.initializer !== undefined || param.questionToken !== undefined;\n if ((!isOptionalParam || splitCore) && isAsyncMethod && this.ReassignedVars[this.getVarKey(param)]) {\n const names = this.getAsyncParamWrapperNames(param.name.text);\n finalVarWrappers.push(this.getIden(identation + 1) + printLine(param, isOptionalParam, names));\n }\n });\n }\n return finalVarWrappers.join(\"\\n\");\n }\n\n printMethodDeclaration(node, identation) {\n const funcBody = this.printFunctionBody(node, identation); // print body first to get var reassignments filled\n // one typed signature: default-valued and `?` parameters are ordinary typed parameters\n let methodDef = this.printMethodDefinition(node, identation, (n) => this.printCoreMethodParameters(n));\n methodDef += funcBody;\n methodDef += this.printOverrideBridges(node, identation);\n\n return methodDef;\n }\n\n printMethodDefinition(node, identation, paramsPrinter = undefined) {\n const name = this.transformMethodNameIfNeeded(node.name.text);\n\n let returnType = this.printFunctionType(node);\n\n // quick fix\n if (returnType === 'java.util.concurrent.CompletableFuture') {\n returnType = 'java.util.concurrent.CompletableFuture';\n }\n\n // D-09: an internal (non-override) generated method whose every return already\n // prints the native type carries it in its signature (see javaNativeReturnType).\n // Only the boxed default is replaced - void/Promise/plain-string stay as printed.\n if (returnType === this.DEFAULT_RETURN_TYPE) {\n const native = this.javaNativeReturnType(node);\n if (native !== undefined) {\n returnType = native;\n }\n }\n\n const modifiers = this.METHOD_DEFAULT_ACCESS ? this.METHOD_DEFAULT_ACCESS + \" \" : \"\";\n const parsedArgs = paramsPrinter ? paramsPrinter(node) : this.printMethodParameters(node);\n\n returnType = returnType ? returnType + \" \" : returnType;\n\n const methodToken = this.METHOD_TOKEN ? this.METHOD_TOKEN + \" \" : \"\";\n const signature = this.getIden(identation) + modifiers + returnType + methodToken + name + \"(\" + parsedArgs + \")\";\n\n return this.printNodeCommentsIfAny(node, identation, signature);\n }\n\n // `Array.isArray(x)` prints `(x instanceof java.util.List)`: false for null, true for a List, same\n // as the helper for every Java-object operand. The helper stays where the operand prints as a Java\n // array (rest parameter: `getClass().isArray()` branch) or a final class not convertible to List.\n printArrayIsArrayCall(node, _identation, parsedArg = undefined) {\n const native = this.printNativeArrayIsArray(node, parsedArg);\n return native === undefined ? `Helpers.isArray(${parsedArg})` : native;\n }\n\n printNativeArrayIsArray(node, parsedArg) {\n const operand: any = node?.arguments?.[0];\n if (operand === undefined || parsedArg === undefined) {\n return undefined;\n }\n // the whole call is the value of an expression statement: a bare `true;`/`false;` is\n // not a Java statement, so that position keeps the helper call\n if (node.parent !== undefined && isExpressionStatement(node.parent)) {\n return undefined;\n }\n // a side-effect-free array literal prints as a fresh ArrayList (never null), so the\n // answer is true without evaluating anything the helper would have to keep\n if (isArrayLiteralExpression(operand)) {\n return this.javaArrayLiteralDropsNothing(operand) ? 'true' : undefined;\n }\n if (!this.javaPrimaryIsArrayOperand(operand)) {\n return undefined;\n }\n const type = this.javaOperandType(operand);\n // a plain identifier of a type that can never hold a List: the helper answers false\n // for null/undefined and for every scalar, and the reference stays untouched\n if (operand.kind === SyntaxKind.Identifier && this.javaNonArrayType(type)) {\n return 'false';\n }\n if (this.isVarargsArrayReference(operand)) {\n return undefined;\n }\n if (this.javaScalarType(type)) {\n return undefined;\n }\n return `(${parsedArg} instanceof java.util.List)`;\n }\n\n // Operand shapes whose print is a primary expression: `instanceof` binds tighter than the\n // low-precedence operators, so a ternary/binary operand would re-parse, and a constructor\n // or cast print can be a final Java class on which `instanceof List` is not convertible.\n javaPrimaryIsArrayOperand(node): boolean {\n const kind = node.kind;\n return kind === SyntaxKind.Identifier\n || kind === SyntaxKind.PropertyAccessExpression\n || kind === SyntaxKind.ElementAccessExpression\n || kind === SyntaxKind.CallExpression;\n }\n\n javaOperandType(operand) {\n return this.checkerOrUndefined()?.getTypeAtLocation(operand);\n }\n\n // literals and identifiers have nothing an array-literal wrapper could skip by dropping\n javaArrayLiteralDropsNothing(node, depth = 0): boolean {\n if (depth > 4) {\n return false;\n }\n return node.elements.every((element) => isStringLiteral(element)\n || isNumericLiteral(element)\n || element.kind === SyntaxKind.TrueKeyword\n || element.kind === SyntaxKind.FalseKeyword\n || element.kind === SyntaxKind.NullKeyword\n || element.kind === SyntaxKind.Identifier\n || (isArrayLiteralExpression(element) && this.javaArrayLiteralDropsNothing(element, depth + 1)));\n }\n\n // types whose Java print is a scalar final class (`instanceof java.util.List` is not\n // convertible on them): the scalar family, and unions made only of scalars/nulls\n javaScalarType(type): boolean {\n return this.javaTypeFlagsOnly(type, JAVA_SCALAR_TYPE_FLAGS);\n }\n\n // types that provably never hold a List: every scalar (Java String/Long/Double/Boolean\n // answer false) and the nullish types (JS Array.isArray(null) is false)\n javaNonArrayType(type): boolean {\n return this.javaTypeFlagsOnly(type, JAVA_SCALAR_TYPE_FLAGS | JAVA_NULLISH_TYPE_FLAGS);\n }\n\n // the type, or every member of its (nested) union, carries one of the mask's flags\n javaTypeFlagsOnly(type, mask: number, depth = 0): boolean {\n if (type === undefined || type === null || depth > 3) {\n return false;\n }\n const flags: any = type.flags;\n if (flags & TypeFlags.Union) {\n const parts: any[] = type.getTypes?.() ?? [];\n return parts.length > 0 && parts.every((part) => this.javaTypeFlagsOnly(part, mask, depth + 1));\n }\n return (flags & mask) !== 0;\n }\n\n // A checker-proven dict prints a Map on every path, so the key copy is native;\n // every other target keeps the helper — shared field maps need its synchronized\n // snapshot, the rest need its instanceof/null fallbacks.\n printObjectKeysCall(node, _identation, parsedArg = undefined) {\n return this.printNativeObjectKeysCall(node) ?? `Helpers.objectKeys(${parsedArg})`;\n }\n\n printNativeObjectKeysCall(node) {\n const argument = node?.arguments?.[0];\n if (argument === undefined || isPropertyAccessExpression(argument)) {\n return undefined;\n }\n // a local the pass declares a Map needs no checkcast: the key copy binds on the\n // declaration's own type, exactly the helper's synchronized map branch\n if (this.javaDeclaredMapReceiver(argument)) {\n return `new java.util.ArrayList(${this.printNode(argument, 0)}.keySet())`;\n }\n const checker: any = this.checkerOrUndefined();\n if (checker === undefined) {\n return undefined;\n }\n const type = checker.getTypeAtLocation(argument);\n if (!this.isJavaMapStructureType(type)) {\n return undefined;\n }\n return `new java.util.ArrayList(((java.util.Map)${this.printNode(argument, 0)}).keySet())`;\n }\n\n printObjectValuesCall(_node, _identation, parsedArg = undefined) {\n return `Helpers.objectValues(${parsedArg})`;\n }\n\n printJsonParseCall(_node, _identation, parsedArg = undefined) {\n return `Helpers.parseJson(${parsedArg})`;\n }\n\n printJsonStringifyCall(_node, _identation, parsedArg = undefined) {\n return `Helpers.json(${parsedArg})`;\n }\n\n // `await Promise.all ([e1, ..., en])` with every element checker-typed `Promise<...>`:\n // CompletableFuture.allOf waits for exactly those, so Helpers.promiseAll's reflective loop adds\n // nothing. Result used -> thenApply collecting values, only for `const` locals (no double runs).\n printNativePromiseAllCall(node) {\n const awaitNode = node?.parent;\n if (awaitNode?.kind !== SyntaxKind.AwaitExpression) {\n return undefined;\n }\n const listNode = node.arguments?.[0];\n if (listNode?.kind !== SyntaxKind.ArrayLiteralExpression) {\n return undefined;\n }\n const elements = listNode.elements as unknown as Expression[];\n const checker = this.getChecker();\n for (const element of elements) {\n if (element.kind === SyntaxKind.SpreadElement\n || !this.isPromiseType(checker.getTypeAtLocation(element))) {\n return undefined;\n }\n }\n const printed = elements.map((element) => this.printNode(element));\n const futureCast = `((${this.PROMISE_TYPE_KEYWORD}) `;\n const casted = printed.map((element) => `${futureCast}${element})`);\n const allOf = `${this.PROMISE_TYPE_KEYWORD}.allOf(${casted.join(\", \")})`;\n if (awaitNode.parent?.kind === SyntaxKind.ExpressionStatement) {\n return allOf;\n }\n if (elements.length === 0\n || !elements.every((element) => this.isConstBoundIdentifier(element))\n || printed.indexOf('promiseAllValue') !== -1) {\n return undefined;\n }\n const collected = casted.map((element) => `${element}.join()`).join(\", \");\n const collectList = `${this.ARRAY_OPENING_TOKEN}${collected}${this.ARRAY_CLOSING_TOKEN}`;\n return `${allOf}.thenApply(promiseAllValue -> ${collectList})`;\n }\n\n // a `const`-bound local is assigned exactly once, so the printed java local is\n // effectively final (a lambda can capture it) and re-reading it joins the same future\n isConstBoundIdentifier(node) {\n if (node.kind !== SyntaxKind.Identifier) {\n return false;\n }\n const declaration = this.getChecker().getSymbolAtLocation(node)?.valueDeclaration?.resolve();\n return declaration?.kind === SyntaxKind.VariableDeclaration\n && (getCombinedNodeFlags(declaration) & NodeFlags.Const) === NodeFlags.Const;\n }\n\n printPromiseAllCall(node, identation, parsedArg = undefined) {\n return this.printNativePromiseAllCall(node) ?? `Helpers.promiseAll(${parsedArg})`;\n }\n\n printMathFloorCall(node, _identation, parsedArg = undefined) {\n return `(Math.floor(Double.parseDouble(${this.javaStringBoxText(node?.arguments?.[0], parsedArg)})))`;\n }\n\n printMathRoundCall(node, _identation, parsedArg = undefined) {\n return `Math.round(Double.parseDouble(${this.javaStringBoxText(node?.arguments?.[0], parsedArg)}))`;\n }\n\n printMathCeilCall(node, _identation, parsedArg = undefined) {\n return `Math.ceil(Double.parseDouble(${this.javaStringBoxText(node?.arguments?.[0], parsedArg)}))`;\n }\n\n printNumberIsIntegerCall(_node, _identation, parsedArg = undefined) {\n return `((${parsedArg} instanceof Integer) || (${parsedArg} instanceof Long))`;\n }\n\n printArrayPushCall(_node, _identation, name = undefined, parsedArg = undefined) {\n return `((java.util.List)${name}).add(${parsedArg})`;\n }\n\n printIncludesCall(_node, _identation, name = undefined, parsedArg = undefined) {\n return `${name}.contains(${parsedArg})`;\n }\n\n // Helpers.getIndexOf(str, target) is List.indexOf for a List receiver, String.indexOf for a String\n // receiver with a String target, -1 otherwise. Locals are `Object`/`var`, so the native call takes\n // the same checkcast as `.length()` / `containsKey`; the target takes one unless a printed String.\n javaNativeIndexOfCall(node, name, parsedArg) {\n if (node === undefined || name === undefined || parsedArg === undefined) {\n return undefined;\n }\n const receiver = node?.expression?.expression;\n if (receiver === undefined) {\n return undefined;\n }\n const checker: any = this.getChecker();\n let receiverType: any;\n try {\n receiverType = checker.getTypeAtLocation(receiver);\n } catch (e) {\n return undefined;\n }\n // a rest parameter is a Java array, not a List: the helper's `instanceof List` test fails there\n // and so must the native call. The wildcard receiver cast is the `.length()` family's and accepts\n // a List of any element type (a `List` cast fails on a `List`-static receiver).\n if (this.isJavaListType(receiverType) && !this.isVarargsArrayReference(receiver)) {\n return `((java.util.List)${name}).indexOf(${parsedArg})`;\n }\n // plain `string` only: the nullable aliases (`Str`) and every union can hold\n // undefined, which the helper absorbs as -1 but String.indexOf has no receiver for\n if (receiverType.getAliasSymbol?.() !== undefined || !this.isStringType(receiverType.flags)) {\n return undefined;\n }\n const arg = node.arguments?.[0];\n if (arg === undefined) {\n return undefined;\n }\n if (this.javaProvableString(arg)) {\n return `((String)${name}).indexOf(${parsedArg})`;\n }\n let argType: any;\n try {\n argType = checker.getTypeAtLocation(arg);\n } catch (e) {\n return undefined;\n }\n // a bare identifier / field target the checker types as a plain string: the cast is\n // the printer's own startsWith/endsWith argument shape\n if (argType.getAliasSymbol?.() === undefined && this.isStringType(argType.flags)\n && (isIdentifier(arg) || isPropertyAccessExpression(arg))) {\n return `((String)${name}).indexOf(((String)${parsedArg}))`;\n }\n return undefined;\n }\n\n printIndexOfCall(node, _identation, name = undefined, parsedArg = undefined) {\n return this.javaNativeIndexOfCall(node, name, parsedArg) ?? this.javaHx4J06NarrowedIndexOf(node, name, parsedArg) ?? `${this.INDEXOF_WRAPPER_OPEN}${name}, ${parsedArg}${this.INDEXOF_WRAPPER_CLOSE}`;\n }\n\n printSearchCall(_node, _identation, name = undefined, parsedArg = undefined) {\n return `((String)${name}).indexOf(${parsedArg})`;\n }\n\n printStartsWithCall(_node, _identation, name = undefined, parsedArg = undefined) {\n return `((String)${name}).startsWith(((String)${parsedArg}))`;\n }\n\n printEndsWithCall(_node, _identation, name = undefined, parsedArg = undefined) {\n return `((String)${name}).endsWith(((String)${parsedArg}))`;\n }\n\n printTrimCall(_node, _identation, name = undefined) {\n return `((String)${name}).trim()`;\n }\n\n printJoinCall(_node, _identation, name = undefined, parsedArg = undefined) {\n // assumes List\n return `String.join((String)${parsedArg}, (java.util.List)${name})`;\n }\n\n printSplitCall(node, _identation, name = undefined, parsedArg = undefined) {\n return this.javaNativeSplitCall(node, name, parsedArg) ?? `Helpers.split(${name}, ${parsedArg})`;\n }\n\n printConcatCall(_node, _identation, name = undefined, parsedArg = undefined) {\n return `Helpers.concat(${name}, ${parsedArg})`;\n }\n\n printToFixedCall(_node, _identation, name = undefined, parsedArg = undefined) {\n return `toFixed(${name}, ${parsedArg})`;\n }\n\n printToStringCall(_node, _identation, name = undefined) {\n return `String.valueOf(${name})`;\n }\n\n printToUpperCaseCall(_node, _identation, name = undefined) {\n return `((String)${name}).toUpperCase()`;\n }\n\n printToLowerCaseCall(_node, _identation, name = undefined) {\n return `((String)${name}).toLowerCase()`;\n }\n\n printShiftCall(_node, _identation, name = undefined) {\n return `((java.util.List)${name}).get(0)`;\n }\n\n printReverseCall(_node, _identation, name = undefined) {\n return `java.util.Collections.reverse((java.util.List)${name})`;\n }\n\n printPopCall(_node, _identation, name = undefined) {\n return `((java.util.List)${name}).get(((java.util.List)${name}).size()-1)`;\n }\n\n printAssertCall(_node, _identation, parsedArgs) {\n return `assert(${parsedArgs})`;\n }\n\n printSliceCall(node, _identation, name = undefined, parsedArg = undefined, parsedArg2 = undefined) {\n const nativeCall = this.nativeSliceCallIfProvable(node, name);\n if (nativeCall !== undefined) {\n return nativeCall;\n }\n if (parsedArg2 === undefined) {\n parsedArg2 = \"null\";\n }\n return `Helpers.slice(${name}, ${parsedArg}, ${parsedArg2})`;\n }\n\n // Integer value of a slice bound that is an integer literal (`18`, `-64`); anything else keeps\n // the helper — the Java helper converts bounds with toInt, and a double cannot be clamped with the\n // integer Math.min/Math.max of the native form.\n javaSliceLiteralBound(node) {\n if (node === undefined) {\n return undefined;\n }\n if (isNumericLiteral(node)) {\n const text = String(node.text);\n if (text.indexOf('.') !== -1 || text.indexOf('e') !== -1 || text.indexOf('E') !== -1) {\n return undefined;\n }\n const value = Number(text);\n return value <= 2147483647 ? value : undefined;\n }\n if (isPrefixUnaryExpression(node) && node.operator === SyntaxKind.MinusToken) {\n const inner = this.javaSliceLiteralBound(node.operand);\n return inner === undefined ? undefined : -inner;\n }\n return undefined;\n }\n\n // JS slice clamps a literal bound into [0, length]: a non-negative bound is min\n // (bound, length), a negative one counts from the end (max (length - |bound|, 0)).\n // `0` stays `0` because the length of a String/List is never negative.\n javaSliceBoundExpression(value, length) {\n if (value === 0) {\n return '0';\n }\n return value > 0 ? `Math.min(${value}, ${length})` : `Math.max(${length} - ${-value}, 0)`;\n }\n\n // `x.slice (a, b)` -> substring/subList when the receiver provably prints as String/List AND every\n // bound is an integer literal: Java throws where JS clamps, so only literal bounds can be clamped.\n // The null guard keeps null -> null and needs a side-effect-free receiver (read up to three times).\n nativeSliceCallIfProvable(node, name) {\n const args = node?.arguments ?? [];\n if (args.length < 1 || args.length > 2) {\n return undefined;\n }\n const start = this.javaSliceLiteralBound(args[0]);\n if (start === undefined) {\n return undefined;\n }\n const hasEnd = args.length === 2;\n const end = hasEnd ? this.javaSliceLiteralBound(args[1]) : undefined;\n if (hasEnd && end === undefined) {\n return undefined;\n }\n const receiverExpression = isPropertyAccessExpression(node?.expression) ? node.expression.expression : undefined;\n if (!this.sideEffectFreeReceiver(receiverExpression)) {\n return undefined;\n }\n let kind: string;\n try {\n const type = this.getChecker().getTypeAtLocation(receiverExpression);\n if (this.isStringType(type.flags)) {\n kind = 'String';\n } else if (this.isJavaListType(type) && !this.isVarargsArrayReference(receiverExpression)) {\n kind = 'List';\n } else {\n return undefined;\n }\n } catch (e) {\n return undefined;\n }\n const cast = kind === 'String' ? `((String)${name})` : `((java.util.List)${name})`;\n const length = kind === 'String' ? `${cast}.length()` : `${cast}.size()`;\n const startText = this.javaSliceBoundExpression(start, length);\n const endText = hasEnd ? this.javaSliceBoundExpression(end, length) : length;\n // from <= to is proven per case: 0 is never above a clamp, an open end is the\n // length, and two literals clamp monotonically once they keep their order\n // (non-negative, or both counting from the end with |start| >= |end|).\n const ordered = start === 0 || !hasEnd\n || (start >= 0 && end >= 0 && start <= end)\n || (start < 0 && end < 0 && start <= end);\n const fromText = ordered ? startText : `Math.min(${startText}, ${endText})`;\n // an inverted pair yields an empty slice in JS, so the substrings collapse to\n // substring (to, to); a one-argument String slice drops the end entirely\n const argumentsText = hasEnd || kind === 'List' ? `${fromText}, ${endText}` : fromText;\n const method = kind === 'String' ? 'substring' : 'subList';\n return `(${name} == null ? null : ${cast}.${method}(${argumentsText}))`;\n }\n\n printReplaceCall(_node, _identation, name = undefined, parsedArg = undefined, parsedArg2 = undefined) {\n return `Helpers.replace((String)${name}, (String)${parsedArg}, (String)${parsedArg2})`;\n }\n\n printReplaceAllCall(node, identation, name = undefined, parsedArg = undefined, parsedArg2 = undefined) {\n // Native when both arguments are plain string literals and the pattern is non-empty: the\n // helper's null / empty-pattern guards cannot fire for them, and `String.replace` is the\n // literal all-occurrences replacement. The null guard on the receiver keeps the helper's\n // null -> null behaviour; it is only emitted for a side-effect-free receiver (identifier\n // or property access), so a double read cannot change semantics.\n const pattern = this.stringLiteralArgument(node?.arguments?.[0]);\n const replacement = this.stringLiteralArgument(node?.arguments?.[1]);\n const receiver = this.sideEffectFreeReceiver(node?.expression);\n if (pattern !== undefined && replacement !== undefined && receiver) {\n return `(${name} == null ? null : ((String)${name}).replace(${pattern}, ${replacement}))`;\n }\n return `Helpers.replaceAll((String)${name}, (String)${parsedArg}, (String)${parsedArg2})`;\n }\n\n // Printed form of a non-empty string-literal argument with no escapes, or undefined when the\n // argument is not a literal, prints with an escape sequence, or is the empty pattern.\n stringLiteralArgument(argument) {\n if (argument === undefined || !isStringLiteral(argument)) {\n return undefined;\n }\n const printed = this.printNode(argument, 0);\n return /^\"[^\"\\\\]+\"$/.test(printed) ? printed : undefined;\n }\n\n // True for receivers that read a value without calling anything: `x`, `x.y`, `this.x`,\n // `(x as string)` and parenthesised forms of those. Guards the double read of the ternary.\n sideEffectFreeReceiver(expression) {\n if (expression === undefined) {\n return false;\n }\n if (isParenthesizedExpression(expression) || isAsExpression(expression) || isTypeAssertion(expression)) {\n return this.sideEffectFreeReceiver(expression.expression);\n }\n if (isIdentifier(expression) || expression.kind === SyntaxKind.ThisKeyword) {\n return true;\n }\n if (isPropertyAccessExpression(expression)) {\n return this.sideEffectFreeReceiver(expression.expression);\n }\n return false;\n }\n\n printPadEndCall(_node, _identation, name, parsedArg, parsedArg2) {\n // You can point this to a runtime helper if you have one\n return `Helpers.padEnd((String)${name}, ((Number)${parsedArg}).intValue(), ((String)${parsedArg2}).charAt(0))`;\n }\n\n printPadStartCall(node, _identation, name, parsedArg, parsedArg2) {\n return this.printNativePadStart(node, name) ?? `Helpers.padStart((String)${name}, ((Number)${parsedArg}).intValue(), ((String)${parsedArg2}).charAt(0))`;\n }\n\n printDateNowCall(_node, _identation) {\n return \"System.currentTimeMillis()\";\n }\n\n printLengthProperty(node, _identation, _name = undefined) {\n const leftSide = this.printNode(node.expression, 0);\n const type = (this.getChecker() as Checker).getTypeAtLocation(node.expression);\n this.warnIfAnyType(node, (type as any).flags, leftSide, \"length\");\n return this.printJavaLength(node.expression, leftSide);\n }\n\n // For ++/--, prefer native Java operators rather than the C# ref-helpers\n printPostFixUnaryExpression(node, identation) {\n const { operand, operator } = node;\n const leftSide = this.printNode(operand, 0);\n return this.PostFixOperators[operator] === \"--\" ? `${leftSide}--` : `${leftSide}++`;\n }\n\n // the identifier declared by a `for (var i = ; ...; i++)` header: the\n // printer writes that initializer as `var`, so javac infers a primitive int and the\n // ++/-- increment keeps it one\n javaPrimitiveCounter(node): boolean {\n if (node?.kind !== SyntaxKind.Identifier) {\n return false;\n }\n const symbol = this.getChecker().getSymbolAtLocation(node);\n const declaration: any = symbol?.valueDeclaration?.resolve() ?? symbol?.declarations?.[0]?.resolve();\n if (declaration === undefined || !isVariableDeclaration(declaration) || !isIdentifier(declaration.name)) {\n return false;\n }\n if (declaration.name.text !== node.text || declaration.initializer === undefined) {\n return false;\n }\n const list: any = declaration.parent;\n if (list?.kind !== SyntaxKind.VariableDeclarationList || list.declarations.length !== 1) {\n return false;\n }\n const forStatement: any = list.parent;\n if (forStatement?.kind !== SyntaxKind.ForStatement || forStatement.initializer !== list) {\n return false;\n }\n if (this.javaIntegerLiteralKind(declaration.initializer) === undefined) {\n return false;\n }\n const incrementor = forStatement.incrementor;\n return incrementor?.kind === SyntaxKind.PostfixUnaryExpression\n && incrementor.operand?.kind === SyntaxKind.Identifier\n && incrementor.operand.text === node.text;\n }\n\n // `-x` prints as the plain Java operator when the operand is already primitive: a decimal literal,\n // a nested native `+ - * /`, a `for (var i = ` counter or a `.length` read.\n // Helpers.opNeg preserves the box and maps null to null, so every boxed local keeps the helper.\n javaNativeNegation(node): boolean {\n if (node === undefined) {\n return false;\n }\n if (node.kind === SyntaxKind.ParenthesizedExpression) {\n return this.javaNativeNegation(node.expression);\n }\n if (isNumericLiteral(node)) {\n return this.javaProvableNumericKind(node) !== undefined;\n }\n if (node.kind === SyntaxKind.BinaryExpression) {\n return this.javaNativeArithmeticKind(node) !== undefined;\n }\n if (this.javaPrimitiveCounter(node)) {\n return true;\n }\n return node.kind === SyntaxKind.PropertyAccessExpression\n && node.name.text === 'length'\n && this.javaLengthKind(node.expression) !== undefined;\n }\n\n printPrefixUnaryExpression(node, identation) {\n const { operand, operator } = node;\n if (operator === SyntaxKind.ExclamationToken) {\n return this.PrefixFixOperators[operator] + this.printCondition(node.operand, 0);\n }\n const leftSide = this.printNode(operand, 0);\n if (operator === SyntaxKind.PlusToken) {\n return `+(${leftSide})`;\n } else if (operator === SyntaxKind.MinusToken) {\n if (this.javaNativeNegation(operand)) {\n return `-${leftSide}`;\n }\n return `Helpers.opNeg(${leftSide})`;\n }\n return super.printPrefixUnaryExpression(node, identation);\n }\n\n javaBooleanCondition(node) {\n if (node.kind === SyntaxKind.ParenthesizedExpression) {\n return this.javaBooleanCondition(node.expression);\n }\n if (node.kind === SyntaxKind.PrefixUnaryExpression) {\n return node.operator === SyntaxKind.ExclamationToken && this.javaBooleanCondition(node.operand);\n }\n if (node.kind !== SyntaxKind.BinaryExpression) {\n return false;\n }\n return this.javaBooleanOperators.includes(node.operatorToken.kind);\n }\n\n // `Precise.(a, b)` resolving to a static of the base `Precise` class: Precise.java\n // declares them `public static boolean`, so the call is a primitive boolean. The receiver name\n // alone is no proof (a shadowing local prints the same text), so the resolution is checked too.\n javaPreciseBooleanCall(node) {\n if (node.kind === SyntaxKind.ParenthesizedExpression) {\n return this.javaPreciseBooleanCall(node.expression);\n }\n // `!` is a boolean too (the negation of a proven boolean)\n if (node.kind === SyntaxKind.PrefixUnaryExpression) {\n return node.operator === SyntaxKind.ExclamationToken && this.javaPreciseBooleanCall(node.operand);\n }\n if (node.kind !== SyntaxKind.CallExpression\n || node.expression.kind !== SyntaxKind.PropertyAccessExpression\n || node.expression.expression.kind !== SyntaxKind.Identifier\n || node.expression.expression.text !== 'Precise'\n || !JAVA_PRECISE_BOOLEAN_STATICS.has(node.expression.name.text)) {\n return false;\n }\n const declaration: any = this.getChecker().getResolvedSignature(node)?.declaration?.resolve();\n if (declaration === undefined\n || declaration.kind !== SyntaxKind.MethodDeclaration\n || declaration.parent?.kind !== SyntaxKind.ClassDeclaration\n || declaration.parent.name?.text !== 'Precise'\n || !declaration.modifiers?.some((modifier) => modifier.kind === SyntaxKind.StaticKeyword)) {\n return false;\n }\n // the relational statics answer a plain boolean (never null), which is what\n // Helpers.isTrue(Boolean) returns unchanged; a union (boolean | undefined) keeps the helper\n return (this.getChecker().getTypeAtLocation(node).flags & TypeFlags.Boolean) !== 0;\n }\n\n // the checker's view of a condition value: BooleanLike is the plain `boolean` (the `boolean |\n // undefined` of an accessor with a default is BooleanLiteral + Undefined and does not qualify),\n // while a union whose every member is boolean/nullish is the nullable box.\n javaBooleanValueKind(node): 'boolean' | 'nullableBoolean' | undefined {\n const type = this.getChecker().getTypeAtLocation(node);\n const flags = type?.flags ?? 0;\n if (flags & TypeFlags.BooleanLike) {\n return 'boolean';\n }\n if ((flags & TypeFlags.Union) === 0) {\n return undefined;\n }\n const members = (type as any).getTypes?.() ?? [];\n const booleanishMembers = TypeFlags.BooleanLike | TypeFlags.Null\n | TypeFlags.Undefined | TypeFlags.Void;\n const allBooleanish = members.length > 0\n && members.every((member) => (((member as any).flags ?? 0) & booleanishMembers) !== 0);\n return allBooleanish ? 'nullableBoolean' : undefined;\n }\n\n // mirrors printWrappedUnknownThisProperty: a `this.(...)` call the checker cannot\n // resolve prints `Helpers.callDynamically(this, \"\", ...)`, whose Java return is Object\n javaCalleeResolves(node): boolean {\n const checker: any = this.checkerOrUndefined();\n if (checker === undefined) {\n return false;\n }\n const signature = checker.getResolvedSignature(node);\n return signature?.declaration !== undefined;\n }\n\n // the boolean the printed Java of a `this.(...)` call already carries, from the\n // hand-written base declarations in JAVA_THIS_BOOLEAN_METHODS / the box proof in\n // JAVA_THIS_BOOLEAN_BOX_METHODS. undefined: not a direct boolean call, keep the wrapper.\n javaCallBooleanKind(node): 'boolean' | 'nullableBoolean' | undefined {\n if (node?.kind !== SyntaxKind.CallExpression) {\n return undefined;\n }\n const callee = node.expression;\n if (callee?.kind !== SyntaxKind.PropertyAccessExpression\n || callee.expression?.kind !== SyntaxKind.ThisKeyword) {\n return undefined;\n }\n const kind = this.javaBooleanValueKind(node);\n if (kind === undefined || !this.javaCalleeResolves(node)) {\n return undefined;\n }\n const name = callee.name?.text as string;\n if (JAVA_THIS_BOOLEAN_METHODS.has(name)) {\n // the hand-written declaration is the only source of the primitive return: a\n // non-base `this.(...)` is a different method, printed `Object`\n return kind === 'boolean' ? 'boolean' : undefined;\n }\n const defaultArgumentIndex = JAVA_THIS_BOOLEAN_BOX_METHODS[name];\n if (defaultArgumentIndex === undefined) {\n return undefined;\n }\n const defaultArgument = node.arguments?.[defaultArgumentIndex];\n // a nullish literal reaches the Java accessor as null (the printer drops a trailing\n // `undefined` in the optional tail), and null is what an absent argument yields\n const defaultIsNullish = defaultArgument === undefined\n || defaultArgument.kind === SyntaxKind.NullKeyword\n || (defaultArgument.kind === SyntaxKind.Identifier && defaultArgument.text === 'undefined');\n const defaultIsBoolean = defaultIsNullish\n || defaultArgument?.kind === SyntaxKind.TrueKeyword\n || defaultArgument?.kind === SyntaxKind.FalseKeyword;\n return defaultIsBoolean ? 'nullableBoolean' : undefined;\n }\n\n // the printer already emits these conditions as Java `boolean` (the comparison helpers,\n // `in`/`instanceof` and the logical operators all return/print primitive boolean), so\n // Helpers.isTrue would only re-test a value the checker proves is boolean\n javaConditionPrintsBoolean(node) {\n let inner = node;\n while (inner.kind === SyntaxKind.ParenthesizedExpression) {\n inner = inner.expression;\n }\n if (inner.kind === SyntaxKind.PrefixUnaryExpression && inner.operator === SyntaxKind.ExclamationToken) {\n return true; // printPrefixUnaryExpression prints `!` + printCondition(operand): a primitive boolean\n }\n if (this.javaBooleanCondition(node)) {\n // TS models `boolean` as the true|false union: the Boolean bit is set on plain\n // boolean and cleared on `boolean | undefined`-style unions, which keep the helper\n return (this.getChecker().getTypeAtLocation(node).flags & TypeFlags.Boolean) !== 0;\n }\n return this.javaPreciseBooleanCall(node);\n }\n\n // the checker proves this expression's TypeScript type is exactly `boolean` (or a boolean\n // literal type): no `any`, no `undefined`/`null` union, no nullable alias\n javaBooleanBoxType(type: any): boolean {\n if (type === undefined) {\n return false;\n }\n if (type.getAliasSymbol?.() !== undefined) {\n return false;\n }\n const flags = type.flags ?? 0;\n if ((flags & JAVA_BOOLEAN_EXCLUDED_TYPE_FLAGS) !== 0) {\n return false;\n }\n return (flags & (TypeFlags.Boolean | TypeFlags.BooleanLiteral)) !== 0;\n }\n\n javaTypeOfNode(node): any {\n return this.checkerOrUndefined()?.getTypeAtLocation(node);\n }\n\n // the DECLARED type of a declaration, not the narrowed type at a use site: TypeScript\n // narrows a `const ok: boolean = true` to the literal `true` and can even reach `never`\n // after a guarding `if (ok) return;`, which says nothing about the box the local holds\n javaTypeOfDeclaration(decl): any {\n if (decl === undefined) {\n return undefined;\n }\n return this.checkerOrUndefined()?.getTypeAtLocation(decl);\n }\n\n // the printed Java of this expression is a primitive `boolean` (or Boolean box): boolean literals,\n // `!`, logical / comparison / `in` operators, `Array.isArray(x)` (Helpers.isArray, `public static\n // boolean`) and hand-written `public boolean` base methods. `seen` breaks `a = b; b = a;` cycles.\n javaPrintsBooleanValue(node, seen: Set, depth = 0): boolean {\n if (node === undefined) {\n return false;\n }\n switch (node.kind) {\n case SyntaxKind.TrueKeyword:\n case SyntaxKind.FalseKeyword:\n return true;\n case SyntaxKind.ParenthesizedExpression:\n case SyntaxKind.AsExpression:\n case SyntaxKind.NonNullExpression:\n return this.javaPrintsBooleanValue(node.expression, seen, depth);\n case SyntaxKind.PrefixUnaryExpression:\n return node.operator === SyntaxKind.ExclamationToken && this.javaPrintsBooleanValue(node.operand, seen, depth);\n case SyntaxKind.BinaryExpression:\n // the comparison and logical operators all print a Java primitive boolean (the\n // helpers they lower to are declared `public static boolean`), whatever the operands\n return JAVA_BOOLEAN_OPERATOR_KINDS.has(node.operatorToken.kind);\n case SyntaxKind.CallExpression:\n return this.javaPrintsBooleanCall(node, seen, depth);\n case SyntaxKind.ConditionalExpression:\n // both branches print a Java boolean value, so the whole `cond ? a : b` does:\n // the printed ternary yields a boolean (or its Boolean box once assigned)\n return this.javaPrintsBooleanValue(node.whenTrue, seen, depth)\n && this.javaPrintsBooleanValue(node.whenFalse, seen, depth);\n case SyntaxKind.PropertyAccessExpression:\n return this.javaBooleanBaseField(node) !== undefined;\n case SyntaxKind.Identifier:\n return this.javaBooleanBoxIdentifier(node, seen) !== undefined;\n }\n return false;\n }\n\n // the Java box of a `this.(...)` call whose generated body returns a boolean on every path:\n // the TS return type is a boolean family and every `return` in the resolved declaration prints a\n // Java boolean or a proven Boolean-or-null box. `depth` and `seen` bound the recursion.\n javaCallReturnsBooleanBox(node, seen: Set, depth: number): boolean {\n if (node?.kind !== SyntaxKind.CallExpression || depth > 2) {\n return false;\n }\n const checker: any = this.checkerOrUndefined();\n if (checker === undefined) {\n return false;\n }\n const declaration = checker.getResolvedSignature(node)?.declaration?.resolve();\n if (declaration === undefined || declaration.kind !== SyntaxKind.MethodDeclaration\n || declaration.body === undefined || seen.has(declaration)) {\n return false;\n }\n if (this.javaBooleanValueKind(node) === undefined) {\n return false; // the call's TS type is not a boolean family (any/undefined-able)\n }\n const callee = node.expression;\n if (!isPropertyAccessExpression(callee) || callee.expression.kind !== SyntaxKind.ThisKeyword) {\n return false; // only a method of this class; a foreign class is not under the printer\n }\n const name = String(callee.name.text);\n if (JAVA_THIS_BOOLEAN_METHODS.has(name) || JAVA_THIS_BOOLEAN_BOX_METHODS[name] !== undefined) {\n return false; // the hand-written base tables are authoritative for these accessors\n }\n const next = new Set(seen);\n next.add(declaration);\n let returns = 0;\n let ok = true;\n const scan = (current: Node) => {\n if (!ok) {\n return;\n }\n if (current !== declaration && isFunctionLike(current)) {\n return; // a nested function's returns are not the method's\n }\n if (isReturnStatement(current)) {\n returns++;\n const expression = current.expression;\n if (expression === undefined || !this.javaPrintsBooleanValue(expression, next, depth + 1)) {\n ok = false;\n return;\n }\n }\n current.forEachChild(scan);\n };\n scan(declaration.body);\n return ok && returns > 0;\n }\n\n // `Array.isArray(x)` prints `Helpers.isArray(x)` (`public static boolean`), the relational\n // Precise statics print `public static boolean` and the hand-written `public boolean` base\n // methods print a primitive boolean. Everything else - including the generated\n javaPrintsBooleanCall(node, seen: Set = new Set(), depth = 0): boolean {\n if (this.isArrayIsArrayCall(node)) {\n return true;\n }\n if (this.javaPreciseBooleanCall(node)) {\n return true;\n }\n if (this.javaStringAffixCall(node)) {\n return true;\n }\n const callee = node.expression;\n if (isPropertyAccessExpression(callee) && callee.expression.kind === SyntaxKind.ThisKeyword\n && JAVA_BOOLEAN_BASE_CALLS.has(String(callee.name.text))) {\n return true;\n }\n return this.javaCallReturnsBooleanBox(node, seen, depth);\n }\n\n // `s.startsWith(x)` / `s.endsWith(x)` on a checker-proven string receiver prints\n // `((String)s).startsWith(..)`, a primitive boolean (String.startsWith/endsWith)\n javaStringAffixCall(node): boolean {\n if (node?.kind !== SyntaxKind.CallExpression || (node.arguments?.length ?? 0) !== 1) {\n return false;\n }\n const callee: any = node.expression;\n if (!isPropertyAccessExpression(callee)) {\n return false;\n }\n const name = String(callee.name.text);\n if (name !== 'startsWith' && name !== 'endsWith') {\n return false;\n }\n const type = this.javaTypeOfNode(callee.expression);\n if (type === undefined || !this.isStringType(type.flags)) {\n return false;\n }\n return /^\\(\\(String\\)[\\s\\S]*\\.(startsWith|endsWith)\\([\\s\\S]*\\)$/.test(this.printNode(node, 0));\n }\n\n isArrayIsArrayCall(node): boolean {\n if (node === undefined || node.kind !== SyntaxKind.CallExpression) {\n return false;\n }\n const callee: any = node.expression;\n return isPropertyAccessExpression(callee)\n && String(callee.name.text) === 'isArray'\n && callee.expression.kind === SyntaxKind.Identifier\n && String((callee.expression as any).text) === 'Array'\n && (node.arguments?.length ?? 0) === 1;\n }\n\n // `this.` read of a hand-written base field declared `boolean`, or undefined. The\n // TsChecker guard keeps a field the hand-written base declares Object (or String) out.\n javaBooleanBaseField(node): string | undefined {\n if (!isPropertyAccessExpression(node) || node.expression.kind !== SyntaxKind.ThisKeyword) {\n return undefined;\n }\n const printed = this.printNode(node, 0);\n if (!JAVA_BOOLEAN_BASE_FIELDS.has(printed)) {\n return undefined;\n }\n const declaration = (this.checkerOrUndefined() as any).getSymbolAtLocation(node.name)?.valueDeclaration?.resolve();\n const type = this.javaTypeOfDeclaration(declaration) ?? this.javaTypeOfNode(node);\n return this.javaBooleanBoxType(type) ? printed : undefined;\n }\n\n // the Java name of an identifier that provably holds a Boolean box or null, so `Helpers.isTrue(x)`\n // IS `Boolean.TRUE.equals(x)`. Proof: the TS type (`boolean`, never `any`/`undefined`-able) plus\n // the D2 write scan: every write in the enclosing function must print a Java boolean value.\n javaBooleanBoxIdentifier(node, seen: Set): string | undefined {\n if (node?.kind !== SyntaxKind.Identifier || seen.has(node)) {\n return undefined;\n }\n const checker: any = this.checkerOrUndefined();\n if (checker === undefined) {\n return undefined;\n }\n const symbol = checker.getSymbolAtLocation(node);\n const decl = symbol?.valueDeclaration?.resolve();\n if (decl === undefined) {\n return undefined;\n }\n // only a local with its own initializer: a parameter (and the `optionalArgs[n]` prologue for an\n // optional one) is an `Object` box its CALLERS fill, so it is not proven boolean; a binding\n // element (`for (const b of ...)`, destructuring) is fed by the container, not a typed value.\n if (decl.kind !== SyntaxKind.VariableDeclaration) {\n return undefined;\n }\n let type;\n try {\n type = this.javaTypeOfDeclaration(decl);\n } catch (e) {\n type = undefined;\n }\n if (!this.javaBooleanBoxType(type)) {\n return undefined;\n }\n if (!this.javaBooleanWritesAreBoxed(symbol, decl, node, seen)) {\n return undefined;\n }\n return this.printNode(node, 0);\n }\n\n // every value written to the symbol prints a Java boolean. The scan runs over the function\n // the DECLARATION lives in (a local can only be written inside it or inside a closure nested\n // in it), so a write in an enclosing scope is never missed.\n javaBooleanWritesAreBoxed(symbol, decl, node, seen: Set): boolean {\n const next = new Set(seen);\n next.add(node);\n return this.javaWritesAreBoxed(symbol, decl, next, (value) => this.javaPrintsBooleanValue(value, next), false);\n }\n\n // shared D2 write scan over the function the declaration lives in: the initializer and every\n // identifier write must pass `accepts`; `tuples` also checks `[ x, params ] = ...` destructures\n javaWritesAreBoxed(symbol, decl, next: Set, accepts: (value: any) => boolean, tuples: boolean): boolean {\n let fn = decl.parent;\n while (fn !== undefined && !isFunctionLike(fn)) {\n fn = fn.parent;\n }\n if (fn === undefined) {\n return false;\n }\n if (decl.initializer !== undefined && !accepts(decl.initializer)) {\n return false;\n }\n let ok = true;\n const scan = (current: Node) => {\n if (!ok) {\n return;\n }\n if ((isForOfStatement(current) || isForInStatement(current))\n && isIdentifier(current.initializer)) {\n // `for (x of list)` re-fills the box from the container\n const loop = (this.checkerOrUndefined() as any).getSymbolAtLocation(current.initializer);\n if (loop === symbol) {\n ok = false;\n return;\n }\n }\n if (isBinaryExpression(current)\n && JAVA_ASSIGNMENT_OPERATOR_KINDS.has(current.operatorToken.kind)) {\n if (isIdentifier(current.left)) {\n const left = (this.checkerOrUndefined() as any).getSymbolAtLocation(current.left);\n if (left === symbol && !accepts(current.right)) {\n ok = false;\n return;\n }\n } else if (tuples && isArrayLiteralExpression(current.left)) {\n // `[ x, params ] = this.handle*Bool (...)` binds element `index`\n const index = current.left.elements.findIndex((element: any) => isIdentifier(element)\n && (this.checkerOrUndefined() as any).getSymbolAtLocation(element) === symbol);\n if (index !== -1 && !this.javaBooleanBoxTupleElement(current.right, index)) {\n ok = false;\n return;\n }\n }\n }\n current.forEachChild(scan);\n };\n scan(fn);\n return ok;\n }\n\n // the declared Java type the ccxt-side declaration chain gave this local/param, via the\n // javaDeclaredLocalTypeResolver hook (build/java-local-types.js): `boolean` prints as the\n // primitive, so the identifier IS the condition; `Boolean` is the nullable box (isTrue = equals).\n javaDeclaredBooleanKind(node): 'boolean' | 'Boolean' | undefined {\n const declaration = this.javaDeclarationOfIdentifier(node);\n if (declaration === undefined || node.text !== declaration.name?.text) {\n return undefined; // a capture rename prints `final Object finalX = x`\n }\n let declared;\n try {\n declared = this.javaDeclaredTypeOfDeclaration(declaration);\n } catch (e) {\n return undefined;\n }\n return declared === 'boolean' || declared === 'Boolean' ? declared : undefined;\n }\n\n // the DECLARED type of the local is a nullable boolean: `Bool` (`boolean | undefined`) or an\n // equivalent union. Every member must be boolean or nullish - an `Int`/`Str`/`any` member can\n // hold a box the isTrue helper tests with its runtime truthiness, so the helper must stay.\n javaNullableBooleanDeclaration(declaration): boolean {\n if (declaration?.kind !== SyntaxKind.VariableDeclaration) {\n return false;\n }\n const type = this.javaTypeOfDeclaration(declaration);\n if (type === undefined) {\n return false;\n }\n const flags: number = type.flags ?? 0;\n if ((flags & (TypeFlags.Any | TypeFlags.Unknown)) !== 0) {\n return false;\n }\n if ((flags & TypeFlags.Boolean) !== 0) {\n return false; // the plain `boolean` is the strict box family's own proof\n }\n if ((flags & TypeFlags.Union) === 0) {\n return false;\n }\n const members: any[] = (type as any).getTypes?.() ?? [];\n if (members.length === 0) {\n return false;\n }\n const booleanish = (member: any) => (((member?.flags ?? 0) & JAVA_NULLABLE_BOOLEAN_MEMBER_FLAGS) !== 0);\n const hasBoolean = members.some((member: any) => (((member?.flags ?? 0) & (TypeFlags.Boolean | TypeFlags.BooleanLiteral)) !== 0));\n return hasBoolean && members.every(booleanish);\n }\n\n // a value the nullable-boolean write scan accepts: a Java boolean value this printer proves, a\n // nullish literal, or a safeBool-family accessor whose other paths return the caller's default\n // (Boolean or null). A Long/Int/String/List box would change what isTrue answers.\n javaPrintsBooleanBoxValue(node, seen: Set): boolean {\n if (node === undefined) {\n return false;\n }\n if (node.kind === SyntaxKind.ParenthesizedExpression || node.kind === SyntaxKind.AsExpression\n || node.kind === SyntaxKind.NonNullExpression) {\n return this.javaPrintsBooleanBoxValue(node.expression, seen);\n }\n if (node.kind === SyntaxKind.NullKeyword) {\n return true;\n }\n if (node.kind === SyntaxKind.Identifier && node.text === 'undefined') {\n return true; // prints null\n }\n if (this.javaPrintsBooleanValue(node, seen)) {\n return true;\n }\n if (node.kind === SyntaxKind.Identifier && this.javaNullableBooleanBoxIdentifier(node, seen) !== undefined) {\n return true; // a local whose declared type is the nullable boolean and every write boxes\n }\n if (node.kind === SyntaxKind.Identifier && this.javaBooleanTupleBindingIdentifier(node, seen) !== undefined) {\n return true;\n }\n if (node.kind === SyntaxKind.CallExpression) {\n return this.javaCallBooleanKind(node) !== undefined;\n }\n return false;\n }\n\n // element `index` of a `[ x, params ] = this.handle*Bool (...)` destructure is a Boolean-or-null\n // box: those accessors return a safeBool result, never the raw member when not a Boolean. The\n // handleOptionAndParams family returns the raw member and is deliberately not a box proof.\n javaBooleanBoxTupleElement(node, index: number): boolean {\n if (node?.kind !== SyntaxKind.CallExpression) {\n return false;\n }\n const callee = node.expression;\n if (!isPropertyAccessExpression(callee) || callee.expression.kind !== SyntaxKind.ThisKeyword) {\n return false;\n }\n const name = String(callee.name.text);\n if (!JAVA_BOOLEAN_BOX_TUPLE_METHODS.has(name)) {\n return false;\n }\n const declaration: any = this.getChecker().getResolvedSignature(node)?.declaration?.resolve();\n if (declaration?.name?.text !== name) {\n return false; // a same-named override is not the base accessor\n }\n return index === 0;\n }\n\n // `const [ x, p ] = this.handle*Bool (...)` binds x to element 0, a Boolean-or-null box; any\n // later identifier or tuple write must also be a proven box (the D2 scan over the function)\n javaBooleanTupleBindingIdentifier(node, seen: Set = new Set()): string | undefined {\n if (node?.kind !== SyntaxKind.Identifier) {\n return undefined;\n }\n const checker: any = this.checkerOrUndefined();\n if (checker === undefined) {\n return undefined;\n }\n const symbol = checker.getSymbolAtLocation(node);\n const element = symbol?.valueDeclaration?.resolve();\n if (element === undefined || element.kind !== SyntaxKind.BindingElement || element.initializer !== undefined\n || element.dotDotDotToken !== undefined || element.name?.text !== node.text || seen.has(element)) {\n return undefined;\n }\n const pattern = element.parent;\n const declaration = pattern?.parent;\n if (pattern?.kind !== SyntaxKind.ArrayBindingPattern || declaration?.kind !== SyntaxKind.VariableDeclaration\n || !this.javaBooleanBoxTupleElement(declaration.initializer, pattern.elements.indexOf(element))) {\n return undefined;\n }\n const next = new Set(seen);\n next.add(element);\n const binding = { initializer: undefined, parent: declaration };\n if (!this.javaWritesAreBoxed(symbol, binding, next, (value) => this.javaPrintsBooleanBoxValue(value, next), true)) {\n return undefined;\n }\n return this.printNode(node, 0);\n }\n\n // the D2 scan over a nullable boolean local: every write prints a Java boolean value or a\n // proven Boolean-or-null box, so no path can leave a truthy non-boolean box in it\n javaBooleanNullableWritesAreBoxed(symbol, declaration, node, seen: Set): boolean {\n const next = new Set(seen);\n next.add(node);\n next.add(declaration); // a write scan that reaches this declaration again stops\n return this.javaWritesAreBoxed(symbol, declaration, next, (value) => this.javaPrintsBooleanBoxValue(value, next), true);\n }\n\n // `Helpers.isTrue(x)` where the DECLARED type of x is a nullable boolean and every write is a\n // proven Boolean-or-null box: `Boolean.TRUE.equals(x)` is exactly what the helper answers on\n // such a box (null and FALSE test false, TRUE tests true)\n javaNullableBooleanBoxIdentifier(node, seen: Set = new Set()): string | undefined {\n if (node?.kind !== SyntaxKind.Identifier) {\n return undefined;\n }\n const checker: any = this.checkerOrUndefined();\n if (checker === undefined) {\n return undefined;\n }\n const symbol = checker.getSymbolAtLocation(node);\n const declaration = symbol?.valueDeclaration?.resolve();\n if (declaration === undefined || declaration.name?.text !== node.text) {\n return undefined;\n }\n if (seen.has(declaration)) {\n return undefined; // a write graph that reaches this declaration again keeps the helper\n }\n if (!this.javaNullableBooleanDeclaration(declaration)) {\n return undefined;\n }\n if (!this.javaBooleanNullableWritesAreBoxed(symbol, declaration, node, seen)) {\n return undefined;\n }\n return this.printNode(node, 0);\n }\n\n // the native Java a falsy wrapper around this condition prints, or undefined to keep\n // `Helpers.isTrue(...)`: a hand-written boolean field prints bare; `Array.isArray(x)` prints\n // `Helpers.isArray(x)` (null -> false like helper); a proven Boolean box: `Boolean.TRUE.equals(x)`\n javaBooleanWrapperFreeCondition(node): string | undefined {\n if (node === undefined) {\n return undefined;\n }\n if (node.kind === SyntaxKind.ParenthesizedExpression) {\n return this.javaBooleanWrapperFreeCondition(node.expression);\n }\n if (this.isArrayIsArrayCall(node)) {\n return `(${this.printNode(node.arguments[0], 0)} instanceof java.util.List)`;\n }\n if (this.javaStringAffixCall(node)) {\n return this.printNode(node, 0);\n }\n const field = this.javaBooleanBaseField(node);\n if (field !== undefined) {\n return field;\n }\n // a `this.(...)` call whose generated body returns a boolean value on every path\n // prints a Boolean box; the bare declarations in JAVA_THIS_BOOLEAN_METHODS are printed\n // native by printCondition and are left to it\n if (node.kind === SyntaxKind.CallExpression && this.javaCallBooleanKind(node) === undefined\n && this.javaCallReturnsBooleanBox(node, new Set(), 0)) {\n return `Boolean.TRUE.equals(${this.printNode(node, 0)})`;\n }\n if (node.kind === SyntaxKind.Identifier) {\n // the ccxt-side declaration chain types a local/param `boolean`/`Boolean` inside\n // javaDeclaredLocalTypeResolver: a primitive declaration IS the condition, a box\n // needs the null-safe TRUE test the helper performs\n const declared = this.javaDeclaredBooleanKind(node);\n if (declared === 'boolean') {\n return this.printNode(node, 0);\n }\n if (declared === 'Boolean') {\n return `Boolean.TRUE.equals(${this.printNode(node, 0)})`;\n }\n }\n const box = this.javaBooleanBoxIdentifier(node, new Set()) ?? this.javaNullableBooleanBoxIdentifier(node)\n ?? this.javaBooleanTupleBindingIdentifier(node);\n return box === undefined ? undefined : `Boolean.TRUE.equals(${box})`;\n }\n\n printCondition(node, identation) {\n if (this.javaConditionPrintsBoolean(node)) {\n return this.getIden(identation) + this.printNode(node, 0);\n }\n let bareCall = node;\n while (bareCall.kind === SyntaxKind.ParenthesizedExpression) {\n bareCall = bareCall.expression;\n }\n if (bareCall.kind === SyntaxKind.CallExpression && this.javaCallPrintsNonNullBoolean(bareCall, 0)) {\n return this.getIden(identation) + this.printNode(node, 0); // a never-null Boolean unboxes safely\n }\n const wrapperFree = this.javaBooleanWrapperFreeCondition(node);\n if (wrapperFree !== undefined) {\n return this.getIden(identation) + wrapperFree;\n }\n const callKind = this.javaCallBooleanKind(bareCall);\n if (callKind === 'boolean') {\n return this.getIden(identation) + this.printNode(node, 0);\n }\n if (callKind === 'nullableBoolean') {\n // Helpers.isTrue(box) on a Boolean-or-null box is Boolean.TRUE.equals(box): null\n // and FALSE test false, TRUE tests true\n return this.getIden(identation) + `Boolean.TRUE.equals(${this.printNode(node, 0)})`;\n }\n return super.printCondition(node, identation);\n }\n\n printConditionalExpression(node, _identation) {\n const condition = this.printCondition(node.condition, 0);\n const whenTrue = this.printNode(node.whenTrue, 0);\n const whenFalse = this.printNode(node.whenFalse, 0);\n return `((${condition})) ? ${whenTrue} : ${whenFalse}`;\n }\n\n printDeleteExpression(node, _identation) {\n const object = this.printNode(node.expression.expression, 0);\n const key = this.printNode(node.expression.argumentExpression, 0);\n return `((java.util.Map)${object}).remove((String)${key})`;\n }\n\n printThrowStatement(node, identation) {\n if (node.expression.kind === SyntaxKind.Identifier) {\n // a bare rethrow (`throw e`) of a caught java.lang.Exception is a checked\n // exception, which the surrounding async lambdas cannot declare - keep\n // unchecked exceptions (ccxt errors extend RuntimeException) as-is and\n // wrap checked ones, preserving the original as the cause\n const name = this.printNode(node.expression, 0);\n return (\n this.getIden(identation) +\n `${this.THROW_TOKEN} (${name} instanceof RuntimeException ? (RuntimeException)${name} : new RuntimeException(${name}))${this.LINE_TERMINATOR}`\n );\n }\n if (node.expression.kind === SyntaxKind.NewExpression) {\n const expression = node.expression;\n const argumentsExp = expression?.arguments ?? [];\n const parsedArg = argumentsExp.map((n) => this.printNode(n, 0)).join(\",\") ?? \"\";\n const newExpression = this.printNode(expression.expression, 0);\n if (expression.expression.kind === SyntaxKind.Identifier) {\n const id = expression.expression;\n // java.lang.Error is a sibling of Exception under Throwable, so\n // `catch (Exception e)` won't catch it. Map JS/TS `Error` to\n // RuntimeException so standard catch blocks work.\n const exceptionName = id.text === \"Error\" ? \"RuntimeException\" : id.text;\n const symbol = this.getChecker().getSymbolAtLocation(expression.expression);\n if (symbol) {\n const declarations =\n (this.getChecker().getDeclaredTypeOfSymbol(symbol).getSymbol()?.declarations ?? []).map((d) => d.resolve());\n const isClassDeclaration = declarations.find(\n (l) =>\n l.kind === SyntaxKind.InterfaceDeclaration ||\n l.kind === SyntaxKind.ClassDeclaration\n );\n if (isClassDeclaration) {\n return (\n this.getIden(identation) +\n `${this.THROW_TOKEN} ${this.NEW_TOKEN} ${exceptionName}((String)${parsedArg}) ${this.LINE_TERMINATOR}`\n );\n } else {\n return (\n this.getIden(identation) +\n `Helpers.throwDynamicException(${exceptionName}, ${parsedArg});return null;`\n );\n }\n }\n return (\n this.getIden(identation) +\n `${this.THROW_TOKEN} ${this.NEW_TOKEN} ${exceptionName}(${parsedArg}) ${this.LINE_TERMINATOR}`\n );\n } else if (expression.expression.kind === SyntaxKind.ElementAccessExpression) {\n return this.getIden(identation) + `Helpers.throwDynamicException(${newExpression}, ${parsedArg});`;\n }\n return super.printThrowStatement(node, identation);\n }\n }\n\n csModifiers = {};\n\n printPropertyAccessModifiers(node) {\n let modifiers = this.printModifiers(node);\n if (modifiers === \"\") {\n modifiers = this.defaultPropertyAccess;\n }\n // add type\n let typeText = \"Object\";\n if (node.type) {\n typeText = this.getType(node);\n if (!typeText) {\n if (node.type.kind === SyntaxKind.AnyKeyword) {\n typeText = this.OBJECT_KEYWORD + \" \";\n }\n }\n }\n return modifiers + \" \" + typeText + \" \";\n }\n\n printModifiers(node) {\n let modifiers = node.modifiers;\n if (modifiers === undefined) {\n return \"\";\n }\n modifiers = modifiers.filter(mod => this.FuncModifiers[mod.kind] && mod.kind !== SyntaxKind.AsyncKeyword);\n return modifiers.map(modifier => this.FuncModifiers[modifier.kind]).join(\" \");\n }\n\n // literals printed as `Helpers.newMap(k, v, ...)` (no anonymous class, so no capture rule)\n builderObjectLiterals: WeakSet = new WeakSet();\n\n printObjectLiteralExpression(node, identation) {\n if (node.properties.length > 0 && node.properties.every((p) => isPropertyAssignment(p)) &&\n this.objectLiteralCapturesReassigned(node)) {\n this.builderObjectLiterals.add(node);\n return this.printObjectLiteralBuilder(node, identation);\n }\n this.builderObjectLiterals.delete(node);\n const objectBody = this.printObjectLiteralBody(node, identation);\n const formattedObjectBody = objectBody ? \"\\n\" + objectBody + \"\\n\" + this.getIden(identation) : objectBody;\n return this.OBJECT_OPENING + formattedObjectBody + this.OBJECT_CLOSING;\n }\n\n printObjectLiteralBuilder(node, identation) {\n // a comparison inside the values must not mark a captured local as reassigned\n // (that flag drives the async-parameter copies and the typed-parameter write casts)\n const keys = this.objectLiteralCapturedKeys(node);\n const saved = keys.map((key) => this.ReassignedVars[key]);\n try {\n return this.printObjectLiteralBuilderText(node, identation);\n } finally {\n keys.forEach((key, i) => {\n if (saved[i] === undefined) {\n delete this.ReassignedVars[key];\n } else {\n this.ReassignedVars[key] = saved[i];\n }\n });\n }\n }\n\n printObjectLiteralBuilderText(node, identation) {\n const props = node.properties;\n const lines = props.map((prop, i) => {\n const name = this.printNode(prop.name, 0);\n const custom = this.printCustomRightSidePropertyAssignment(prop.initializer, identation + 1);\n const value = (custom ? custom : this.printNode(prop.initializer, identation + 1)).trim();\n let comment = this.printTraillingComment(prop, identation + 1);\n comment = comment ? \" \" + comment : \"\";\n const sep = i < props.length - 1 ? \",\" : \"\";\n return this.getIden(identation + 1) + name + \", \" + value + sep + comment;\n });\n return \"Helpers.newMap(\\n\" + lines.join(\"\\n\") + \"\\n\" + this.getIden(identation) + \")\";\n }\n\n printObjectLiteralBody(node, identation) {\n const body = node.properties.map((p) => this.printNode(p, identation+1)).join(\"\\n\");\n // body = body.replaceAll('this.', `${name}.this.`);\n return body;\n }\n\n printForStatement(node, identation) {\n const initializer = this.printNode(node.initializer, 0).replace('Object ', 'var ');\n const condition = this.printNode(node.condition, 0);\n const incrementor = this.printNode(node.incrementor, 0);\n\n const forStm = this.getIden(identation) +\n this.FOR_TOKEN + \" \" +\n this.CONDITION_OPENING +\n initializer + \"; \" + condition + \"; \" + incrementor +\n this.CONDITION_CLOSE +\n this.printBlock(node.statement, identation);\n return this.printNodeCommentsIfAny(node, identation, forStm);\n }\n\n printReturnStatement(node, identation) {\n const leadingComment = this.printLeadingComments(node, identation);\n let trailingComment = this.printTraillingComment(node, identation);\n trailingComment = trailingComment ? \" \" + trailingComment : trailingComment;\n let exp = node.expression;\n if (exp && exp.kind === SyntaxKind.AsExpression && (exp.expression.kind === SyntaxKind.ObjectLiteralExpression || SyntaxKind.CallExpression)) {\n exp = exp.expression; // go over something like return {} as SomeType\n }\n let rightPart = exp ? (' ' + this.printNode(exp, identation)) : '';\n rightPart = rightPart.trim();\n if (!rightPart) {\n // bare return; — check if inside async method (supplyAsync lambda needs return null)\n let parent = node.parent;\n while (parent) {\n if (isFunctionDeclaration(parent) || isMethodDeclaration(parent) || isFunctionExpression(parent) || isArrowFunction(parent)) {\n if (this.isAsyncFunction(parent)) {\n rightPart = 'null';\n }\n break;\n }\n parent = parent.parent;\n }\n }\n rightPart = rightPart ? ' ' + rightPart + this.LINE_TERMINATOR : this.LINE_TERMINATOR;\n return leadingComment + this.getIden(identation) + this.RETURN_TOKEN + rightPart + trailingComment;\n }\n\n private allBranchesTerminate(node: Node): boolean {\n if (isReturnStatement(node) || isThrowStatement(node)) {\n return true;\n }\n if (isBlock(node)) {\n const stmts = node.statements;\n return stmts.length > 0 && this.allBranchesTerminate(stmts[stmts.length - 1]);\n }\n if (isIfStatement(node)) {\n if (!node.elseStatement) {\n return false; // no else: not all paths covered\n }\n return this.allBranchesTerminate(node.thenStatement) && this.allBranchesTerminate(node.elseStatement);\n }\n return false;\n }\n // hx4 J01: `m[k] = v` on a local the printer declared `Map` whose every write is a\n // provably non-concurrent map (fresh literal/extend/omit, or a base safeDict* of non-field data):\n // the helper's map branch is then `m.put(k, v)` (null value included; its CHM removal never applies)\n javaHx4MapPutIsNative(baseExpr, keys: any[]): boolean {\n if (keys.length !== 1 || baseExpr === undefined || !isIdentifier(baseExpr) || !this.javaDeclaredMapReceiver(baseExpr)) {\n return false;\n }\n const key = keys[0];\n if (!isStringLiteralLikeNode(key) && !this.javaDeclaredStringType(key)\n && !this.isJavaStringType(this.getChecker().getTypeAtLocation(key))) {\n return false; // Map.put needs a String key (the helper takes any box)\n }\n const declaration: any = this.javaDeclarationOfIdentifier(baseExpr);\n if (declaration === undefined || declaration.kind !== SyntaxKind.VariableDeclaration || !declaration.initializer) {\n return false; // parameters may carry a caller's ConcurrentHashMap\n }\n const admits = (rhs) => this.javaHx4PlainMapSource(baseExpr, rhs);\n return admits(declaration.initializer) && !this.javaLocalIsReassigned(baseExpr, admits);\n }\n\n javaHx4PlainMapSource(container, value): boolean {\n const node = this.unwrapPrintTransparentExpression(value);\n if (node === undefined) {\n return false;\n }\n if (this.javaFreshHashMapValue(container, node)) {\n return true;\n }\n if (!isCallExpression(node) || !isPropertyAccessExpression(node.expression)\n || node.expression.expression.kind !== SyntaxKind.ThisKeyword) {\n return false;\n }\n const name = node.expression.name.text;\n const fileName = this.checkerOrUndefined()?.getResolvedSignature(node)?.declaration?.resolve()?.getSourceFile?.()?.fileName;\n if (typeof fileName !== 'string' || !JAVA_FRESH_EXTEND_FILE.test(fileName)) {\n return false; // a venue override may return anything\n }\n if (name === 'extend' || name === 'deepExtend' || name === 'omit') {\n return true; // Generic.Extend / deepExtend / Functions.omitMap build a fresh LinkedHashMap (or null)\n }\n if (name === 'safeDict' || name === 'safeDict2' || name === 'safeDictN') {\n // hands back an element of the source or the default: never a field map or a ws client map\n return node.arguments.length > 0 && this.javaHx4NonSharedSource(node.arguments[0], 0)\n && (node.arguments.length < (name === 'safeDict2' ? 4 : 3)\n || this.javaHx4DefaultIsPlain(node.arguments[node.arguments.length - 1]));\n }\n return false;\n }\n\n javaHx4DefaultIsPlain(value): boolean {\n const node = this.unwrapPrintTransparentExpression(value);\n return node !== undefined && (isObjectLiteralExpression(node) || node.kind === SyntaxKind.UndefinedKeyword\n || (isIdentifier(node) && node.text === 'undefined') || node.kind === SyntaxKind.NullKeyword);\n }\n\n // data that can not hold one of the runtime's ConcurrentHashMaps (this. top level, ws client\n // futures/subscriptions/rejections and their entries): a local/param/element chain not rooted at them\n javaHx4NonSharedSource(value, depth: number): boolean {\n const node = this.unwrapPrintTransparentExpression(value);\n if (node === undefined || depth > 40) {\n return false;\n }\n if (isElementAccessExpression(node)) {\n return this.javaHx4NonSharedSource(node.expression, depth + 1);\n }\n if (!isIdentifier(node)) {\n return false;\n }\n const declaration: any = this.javaDeclarationOfIdentifier(node);\n if (declaration === undefined) {\n return false;\n }\n if (declaration.kind === SyntaxKind.Parameter) {\n const type = this.getChecker().getTypeAtLocation(node);\n const text = (type?.getSymbol?.()?.escapedName ?? '') + '';\n return !/Client/.test(text) && !/^(client|subscriptions|futures|rejections)$/.test(node.text);\n }\n const known = this.javaHx4SourceVerdicts.get(declaration);\n if (known !== undefined) {\n return known; // `true` while in progress: a self-referencing write adds no new source\n }\n this.javaHx4SourceVerdicts.set(declaration, true);\n this.javaHx4InProgress.add(declaration);\n const writes: any[] = declaration.initializer ? [declaration.initializer] : [];\n const verdict = !this.javaLocalIsReassigned(node, (rhs) => { writes.push(rhs); return true; })\n && writes.every((w) => this.javaHx4NonSharedValue(w, depth + 1));\n this.javaHx4InProgress.delete(declaration);\n if (verdict && this.javaHx4InProgress.size > 0) {\n this.javaHx4SourceVerdicts.delete(declaration); // leaned on an unfinished verdict: recompute later\n } else {\n this.javaHx4SourceVerdicts.set(declaration, verdict);\n }\n return verdict;\n }\n\n javaHx4SourceVerdicts = new WeakMap();\n javaHx4InProgress = new Set();\n\n // a value expression that never reads a field map or a ws client's maps\n javaHx4NonSharedValue(value, depth: number): boolean {\n let shared = false;\n const walk = (n) => {\n if (shared || n === undefined) {\n return;\n }\n if (isPropertyAccessExpression(n)) {\n const called = n.parent !== undefined && isCallExpression(n.parent) && n.parent.expression === n;\n if ((!called && (n.expression.kind === SyntaxKind.ThisKeyword\n || /^(subscriptions|futures|rejections|hashmap)$/.test(n.name.text)))\n || (called && n.name.text === 'createSafeDictionary')) {\n shared = true;\n return;\n }\n }\n if (n.kind === SyntaxKind.ThisKeyword && !(n.parent !== undefined && isPropertyAccessExpression(n.parent))) {\n shared = true; // `this` handed to a call\n return;\n }\n if (isIdentifier(n) && n !== value && !(n.parent !== undefined && isPropertyAccessExpression(n.parent) && n.parent.name === n)) {\n const declaration: any = this.javaDeclarationOfIdentifier(n);\n if (declaration !== undefined && !this.javaHx4NonSharedSource(n, depth + 1)) {\n shared = true;\n return;\n }\n }\n n.forEachChild(walk);\n };\n walk(value);\n return !shared;\n }\n\n // hx4 J02: `this.[k]` on the J02 base map fields. ConcurrentHashMap.get(null) throws\n // where the helper answers null, so a non-literal key is always null-tested; the receiver can\n // be null too. Key and receiver print twice, so both must be side-effect free.\n javaJ02FieldMapReadText(receiver, key): string | undefined {\n const name = receiver?.name?.text;\n if (typeof name !== 'string' || !Object.prototype.hasOwnProperty.call(JAVA_J02_MAP_FIELDS, name)) {\n return undefined;\n }\n const literal = isStringLiteralLikeNode(key);\n if (!literal && !this.javaRepeatableOperand(key)) {\n return undefined;\n }\n const target = this.printNode(receiver, 0);\n const keyText = this.printNode(key, 0);\n const keyGuard = literal ? '' : `${keyText} == null || `;\n return `(${keyGuard}${target} == null ? null : ((java.util.Map)${target}).get(${keyText}))`;\n }\n\n // hx4 J05\n // `(a % N) M` (N a non-zero integer literal, a an int/long operand, M an int literal): the\n // native mod prints a finite integral double |v| < |N|, where isEqual (IsInteger -> toLong) and\n // isGreaterThan (toDouble) both reduce to the plain double comparison against M.\n javaHx4J05IntegralModOperand(node): boolean {\n while (node !== undefined && node.kind === SyntaxKind.ParenthesizedExpression) {\n node = node.expression;\n }\n if (node === undefined || !isBinaryExpression(node) || node.operatorToken.kind !== SyntaxKind.PercentToken) {\n return false;\n }\n if (this.javaScalarFamily(node.left) !== 'number' || this.javaScalarFamily(node.right) !== 'number') {\n return false;\n }\n const leftKind = this.javaProvableNumericKind(node.left);\n if (leftKind !== 'int' && leftKind !== 'long' && !this.javaProvableCounterInt(node.left)) {\n return false;\n }\n const divisor = node.right;\n if (this.javaIntegerLiteralKind(divisor) !== 'int' || Number(divisor.text) === 0) {\n return false;\n }\n return true;\n }\n\n printHx4J05ModComparison(left, right, op): string | undefined {\n const javaOps = {\n [SyntaxKind.EqualsEqualsToken]: '==', [SyntaxKind.EqualsEqualsEqualsToken]: '==',\n [SyntaxKind.ExclamationEqualsToken]: '!=', [SyntaxKind.ExclamationEqualsEqualsToken]: '!=',\n [SyntaxKind.LessThanToken]: '<', [SyntaxKind.LessThanEqualsToken]: '<=',\n [SyntaxKind.GreaterThanToken]: '>', [SyntaxKind.GreaterThanEqualsToken]: '>=',\n };\n const javaOp = javaOps[op];\n if (javaOp === undefined) {\n return undefined;\n }\n const modLeft = this.javaHx4J05IntegralModOperand(left);\n const modRight = !modLeft && this.javaHx4J05IntegralModOperand(right);\n if (!modLeft && !modRight) {\n return undefined;\n }\n if (this.javaEqualityLiteralKind(modLeft ? right : left) !== 'int') {\n return undefined;\n }\n const leftText = this.printNode(left, 0);\n const rightText = this.printNode(right, 0);\n // only when the mod side printed the native double remainder\n if (!/^\\(+double\\) /.test(modLeft ? leftText : rightText)) {\n return undefined;\n }\n return `(${leftText} ${javaOp} ${rightText})`;\n }\n\n // hx4 J06\n // `x.indexOf(t)` where a string/Str-declared x is narrowed to a union of string literals\n // (`===` tests): x is a non-null String, so String.indexOf is the helper's String arm\n javaHx4J06NarrowedIndexOf(node, name, parsedArg) {\n const receiver = node?.expression?.expression;\n const arg = node?.arguments?.[0];\n if (receiver === undefined || arg === undefined || name === undefined || parsedArg === undefined\n || !isIdentifier(receiver) || this.isVarargsArrayReference(receiver)) {\n return undefined;\n }\n let receiverType: any;\n try {\n receiverType = this.getChecker().getTypeAtLocation(receiver);\n } catch (e) {\n return undefined;\n }\n if (receiverType === undefined || (receiverType.flags & TypeFlags.Union) === 0\n || !receiverType.getTypes().every((member) => this.isStringType(member.flags))) {\n return undefined;\n }\n // a DECLARED literal union is no runtime proof: the declaration must carry plain `string`\n const symbol = this.getChecker().getSymbolAtLocation(receiver);\n const declaration: any = symbol?.valueDeclaration?.resolve?.() ?? symbol?.valueDeclaration;\n let declared: any;\n try {\n declared = declaration?.name === undefined ? undefined : this.getChecker().getTypeAtLocation(declaration.name);\n } catch (e) {\n declared = undefined;\n }\n const declaredMembers: any[] = declared === undefined ? [] : ((declared.flags & TypeFlags.Union) !== 0 ? declared.getTypes() : [declared]);\n if (!declaredMembers.some((member) => member.flags === TypeFlags.String)) {\n return undefined;\n }\n if (this.javaProvableString(arg)) {\n return `((String)${name}).indexOf(${parsedArg})`;\n }\n return undefined;\n }\n}\n\n// hx4 J02\n// more hand-written BaseExchange map fields: every write in BaseExchange.java and ts/src is a\n// HashMap / ConcurrentHashMap / Map-cast or null (markets_by_id = null, urls/fees from describe())\nconst JAVA_J02_MAP_FIELDS: { [name: string]: true } = {\n 'tickers': true,\n 'bidsasks': true,\n 'trades': true,\n 'fees': true,\n 'urls': true,\n 'markets_by_id': true,\n};\n\n// hx4 J09: isTrue / isInstance / toLongOrNull / toStringArg go native on proven operands\nconst HX4_J09_SYNC_BASE_CALLS = new Set([\n 'safeString', 'safeString2', 'safeStringN', 'safeValue', 'safeDict', 'safeInteger', 'json',\n 'throwExactlyMatchedException', 'throwBroadlyMatchedException',\n]);\n\nexport interface JavaTranspiler {\n hx4J09BoxIdentifier(node, seen: Set, depth: number): boolean;\n hx4J09BoxValue(node, seen: Set, depth: number): boolean;\n hx4J09LiteralTupleElement(node, index: number): boolean;\n hx4J09CatchCannotWrap(node): boolean;\n hx4J09CoreArgument(type: string, printed: string, node): string | undefined;\n hx4J09CcxtErrorClass(node): boolean;\n}\n\n// a class declared in ts/src/base/errors.ts: its Java twin extends RuntimeException, so\n// `catchVar instanceof X` compiles against the `Exception` catch parameter\nJavaTranspiler.prototype.hx4J09CcxtErrorClass = function (node): boolean {\n const checker: any = this.checkerOrUndefined();\n let symbol: any;\n try {\n symbol = checker?.getSymbolAtLocation(node);\n if (symbol !== undefined && (symbol.flags & SymbolFlags.Alias)) {\n symbol = checker.getAliasedSymbol(symbol);\n }\n } catch (e) {\n return false;\n }\n const declaration: any = symbol?.declarations?.[0]?.resolve();\n return declaration?.kind === SyntaxKind.ClassDeclaration\n && /(^|[\\\\/])ts[\\\\/]src[\\\\/]base[\\\\/]errors\\.ts$/.test(declaration.getSourceFile?.()?.fileName ?? '');\n};\n\n// a local whose declared TS type is boolean-family and whose every write (D2 scan, tuples\n// included) is a Boolean-or-null box; a write cycle back to a local under proof is accepted\nJavaTranspiler.prototype.hx4J09BoxIdentifier = function (node, seen: Set, depth: number): boolean {\n const checker: any = this.checkerOrUndefined();\n if (checker === undefined || node?.kind !== SyntaxKind.Identifier || depth > 6) {\n return false;\n }\n const symbol = checker.getSymbolAtLocation(node);\n const decl: any = symbol?.valueDeclaration?.resolve();\n if (decl === undefined || decl.name?.text !== node.text) {\n return false;\n }\n if (seen.has(decl)) {\n return true;\n }\n const next = new Set(seen);\n next.add(decl);\n const accepts = (value) => this.hx4J09BoxValue(value, next, depth + 1);\n if (decl.kind === SyntaxKind.BindingElement) {\n const pattern = decl.parent;\n const declaration = pattern?.parent;\n if (decl.initializer !== undefined || decl.dotDotDotToken !== undefined\n || pattern?.kind !== SyntaxKind.ArrayBindingPattern || declaration?.kind !== SyntaxKind.VariableDeclaration) {\n return false;\n }\n const index = pattern.elements.indexOf(decl);\n if (!this.javaBooleanBoxTupleElement(declaration.initializer, index)\n && !this.hx4J09LiteralTupleElement(declaration.initializer, index)) {\n return false;\n }\n return this.javaWritesAreBoxed(symbol, { initializer: undefined, parent: declaration }, next, accepts, true);\n }\n if (decl.kind !== SyntaxKind.VariableDeclaration) {\n return false; // parameters are boxes their callers fill\n }\n let type;\n try {\n type = this.javaTypeOfDeclaration(decl);\n } catch (e) {\n return false;\n }\n if (!this.javaBooleanBoxType(type) && !this.javaNullableBooleanDeclaration(decl)) {\n return false;\n }\n return this.javaWritesAreBoxed(symbol, decl, next, accepts, true);\n};\n\n// a value whose printed Java is a Boolean, boolean or null\nJavaTranspiler.prototype.hx4J09BoxValue = function (node, seen: Set, depth: number): boolean {\n if (node === undefined) {\n return false;\n }\n if (node.kind === SyntaxKind.ParenthesizedExpression || node.kind === SyntaxKind.AsExpression\n || node.kind === SyntaxKind.NonNullExpression) {\n return this.hx4J09BoxValue(node.expression, seen, depth);\n }\n if (node.kind === SyntaxKind.NullKeyword || (node.kind === SyntaxKind.Identifier && node.text === 'undefined')) {\n return true;\n }\n if (node.kind === SyntaxKind.ConditionalExpression) {\n return this.hx4J09BoxValue(node.whenTrue, seen, depth) && this.hx4J09BoxValue(node.whenFalse, seen, depth);\n }\n if (node.kind === SyntaxKind.Identifier) {\n return this.hx4J09BoxIdentifier(node, seen, depth);\n }\n if (this.javaPrintsBooleanValue(node, new Set())) {\n return true;\n }\n if (node.kind !== SyntaxKind.CallExpression) {\n return false;\n }\n if (this.javaCallBooleanKind(node) !== undefined) {\n return true;\n }\n // safeBool* with a non-literal default: the accessor returns a Boolean member or the default\n const callee = node.expression;\n if (!isPropertyAccessExpression(callee) || callee.expression.kind !== SyntaxKind.ThisKeyword) {\n return false;\n }\n const at = JAVA_THIS_BOOLEAN_BOX_METHODS[String(callee.name.text)];\n if (at === undefined || this.javaBooleanValueKind(node) === undefined || !this.javaCalleeResolves(node)) {\n return false;\n }\n const declaration: any = this.getChecker().getResolvedSignature(node)?.declaration?.resolve();\n if (declaration?.name?.text !== callee.name.text\n || !JAVA_THIS_RETURN_TYPES_BASE_FILE.test(declaration.getSourceFile?.()?.fileName ?? '')) {\n return false;\n }\n const fallback = node.arguments?.[at];\n return fallback !== undefined && this.hx4J09BoxValue(fallback, seen, depth);\n};\n\n// element `index` of a base-tier `this.m(..)` whose every return is an array literal with a\n// Java boolean at that position (`handlePostOnly`: `[ true, p ]` / `[ false, p ]`)\nJavaTranspiler.prototype.hx4J09LiteralTupleElement = function (node, index: number): boolean {\n if (node?.kind !== SyntaxKind.CallExpression || index < 0) {\n return false;\n }\n const callee = node.expression;\n if (!isPropertyAccessExpression(callee) || callee.expression.kind !== SyntaxKind.ThisKeyword) {\n return false;\n }\n let declaration: any;\n try {\n declaration = this.getChecker().getResolvedSignature(node)?.declaration?.resolve();\n } catch (e) {\n return false;\n }\n if (declaration?.kind !== SyntaxKind.MethodDeclaration || declaration.body === undefined\n || declaration.name?.text !== callee.name.text\n || !JAVA_THIS_RETURN_TYPES_BASE_FILE.test(declaration.getSourceFile?.()?.fileName ?? '')) {\n return false;\n }\n let returns = 0;\n let ok = true;\n const scan = (current: Node) => {\n if (!ok || (current !== declaration && isFunctionLike(current))) {\n return;\n }\n if (isReturnStatement(current)) {\n returns++;\n const value: any = current.expression;\n if (value === undefined || !isArrayLiteralExpression(value)\n || !this.javaPrintsBooleanValue(value.elements[index], new Set())) {\n ok = false;\n return;\n }\n }\n current.forEachChild(scan);\n };\n scan(declaration.body);\n return ok && returns > 0;\n};\n\n// `e instanceof X` on a catch variable equals Helpers.isInstance (which first unwraps a\n// CompletionException/ExecutionException) when the try block cannot raise a wrapped one:\n// no await, every call a synchronous base-tier accessor/thrower\nJavaTranspiler.prototype.hx4J09CatchCannotWrap = function (node): boolean {\n if (node?.kind !== SyntaxKind.Identifier) {\n return false;\n }\n const checker: any = this.checkerOrUndefined();\n const decl: any = checker?.getSymbolAtLocation(node)?.valueDeclaration?.resolve();\n const clause = decl?.parent;\n const tryStatement = clause?.parent;\n if (decl?.kind !== SyntaxKind.VariableDeclaration || clause?.kind !== SyntaxKind.CatchClause\n || tryStatement?.kind !== SyntaxKind.TryStatement || tryStatement.catchClause !== clause) {\n return false;\n }\n let ok = true;\n const scan = (current: any) => {\n if (!ok) {\n return;\n }\n if (isFunctionLike(current) || current.kind === SyntaxKind.AwaitExpression || current.kind === SyntaxKind.TryStatement) {\n ok = false;\n return;\n }\n if (current.kind === SyntaxKind.CallExpression) {\n const callee = current.expression;\n if (!isPropertyAccessExpression(callee) || callee.expression.kind !== SyntaxKind.ThisKeyword\n || !HX4_J09_SYNC_BASE_CALLS.has(String(callee.name.text))) {\n ok = false;\n return;\n }\n const declaration: any = checker.getResolvedSignature(current)?.declaration?.resolve();\n if (declaration === undefined\n || !JAVA_THIS_RETURN_TYPES_BASE_FILE.test(declaration.getSourceFile?.()?.fileName ?? '')) {\n ok = false;\n return;\n }\n }\n current.forEachChild(scan);\n };\n scan(tryStatement.tryBlock);\n return ok;\n};\n\n// core-argument conversions a declaration already proves: a const `= undefined` local is\n// null; a const `x.length` local the build layer declares Integer widens to the Long slot\nJavaTranspiler.prototype.hx4J09CoreArgument = function (type: string, printed: string, node): string | undefined {\n if (node === undefined || !isIdentifier(node) || printed !== node.text || (type !== 'Long' && type !== 'String')) {\n return undefined;\n }\n const declaration: any = this.javaDeclarationOfIdentifier(node);\n if (declaration === undefined || !isVariableDeclaration(declaration) || (declaration.name as any)?.text !== node.text\n || (getCombinedNodeFlags(declaration) & NodeFlags.Const) === 0) {\n return undefined;\n }\n const initializer = declaration.initializer;\n if (initializer !== undefined && isIdentifier(initializer) && initializer.text === 'undefined') {\n return `(${type}) null`;\n }\n if (type === 'Long' && initializer !== undefined && isPropertyAccessExpression(initializer)\n && initializer.name.text === 'length' && this.javaDeclaredTypeOf(node) === 'Integer') {\n return `((long) ${printed})`;\n }\n return undefined;\n};\n\n{\n const proto: any = JavaTranspiler.prototype;\n const printCondition = proto.printCondition;\n proto.printCondition = function (node, identation) {\n const printed: string = printCondition.call(this, node, identation);\n let inner = node;\n while (inner?.kind === SyntaxKind.ParenthesizedExpression) {\n inner = inner.expression;\n }\n if (inner?.kind === SyntaxKind.Identifier && printed.trimStart().startsWith(this.FALSY_WRAPPER_OPEN)\n && this.hx4J09BoxIdentifier(inner, new Set(), 0)) {\n return this.getIden(identation) + `Boolean.TRUE.equals(${this.printNode(inner, 0)})`;\n }\n return printed;\n };\n const printInstanceOfExpression = proto.printInstanceOfExpression;\n proto.printInstanceOfExpression = function (node, identation) {\n if (node.right?.kind === SyntaxKind.Identifier && this.hx4J09CcxtErrorClass(node.right)\n && this.hx4J09CatchCannotWrap(node.left)) {\n return this.getIden(identation) + `(${this.printNode(node.left, 0)} instanceof ${node.right.text})`;\n }\n return printInstanceOfExpression.call(this, node, identation);\n };\n const javaConvertToCoreType = proto.javaConvertToCoreType;\n proto.javaConvertToCoreType = function (type: string, printed: string, node) {\n return this.hx4J09CoreArgument(type, printed, node) ?? javaConvertToCoreType.call(this, type, printed, node);\n };\n}\n\n// hx4 J15: two declared numeric boxes compare by value, never by reference. Same-class integral\n// boxes take Objects.equals (Helpers.isEqual's null table + toLong compare); a Double on either side\n// compares doubleValue() (isEqual's toDouble: 0.0 == -0.0, NaN != NaN), other integral pairs longValue().\n{\n const proto: any = JavaTranspiler.prototype;\n const printNativeEquality = proto.printNativeEqualityIfProvable;\n proto.printNativeEqualityIfProvable = function (node, leftText: string, rightText: string): string | undefined {\n const op = node?.operatorToken?.kind;\n const negated = op === SyntaxKind.ExclamationEqualsToken || op === SyntaxKind.ExclamationEqualsEqualsToken;\n if (negated || op === SyntaxKind.EqualsEqualsToken || op === SyntaxKind.EqualsEqualsEqualsToken) {\n const left = this.javaDeclaredNumericFamily(node.left);\n const right = this.javaDeclaredNumericFamily(node.right);\n // a declared Boolean: isEqual answers false across classes and by value within Boolean\n const isBool = (n) => String(this.javaDeclaredTypeOf(n) ?? '').trim() === 'Boolean';\n if (isBool(node.left) || isBool(node.right)) {\n return `${negated ? '!' : ''}java.util.Objects.equals(${leftText}, ${rightText})`;\n }\n if (JAVA_BOXED_NUMERIC_TYPES.has(left) && JAVA_BOXED_NUMERIC_TYPES.has(right)) {\n let equal: string;\n if (left === right && left !== 'Double') {\n equal = `java.util.Objects.equals(${leftText}, ${rightText})`;\n } else {\n const unbox = (left === 'Double' || right === 'Double') ? 'doubleValue' : 'longValue';\n equal = `(${leftText} == null ? ${rightText} == null : (${rightText} != null && ${leftText}.${unbox}() == ${rightText}.${unbox}()))`;\n }\n return negated ? `!${equal}` : equal;\n }\n }\n return printNativeEquality.call(this, node, leftText, rightText);\n };\n}\n\n// hx4 J16: an awaited implicit-API call (declared in ts/src/abstract/.ts, body `this.request(..)`)\n// hands back a fresh Jackson parse of the HTTP body: never a field map or a ws client map, whatever\n// its arguments read, so J01's non-shared proof admits it as a put source.\nconst JAVA_J16_IMPLICIT_API_FILE = /(^|[\\\\/])ts[\\\\/]src[\\\\/]abstract[\\\\/][a-z0-9_]+\\.ts$/;\n{\n const proto: any = JavaTranspiler.prototype;\n const nonSharedValue = proto.javaHx4NonSharedValue;\n proto.javaHx4NonSharedValue = function (value, depth: number): boolean {\n return this.javaJ16ImplicitApiResponse(value) || nonSharedValue.call(this, value, depth);\n };\n proto.javaJ16ImplicitApiResponse = function (value): boolean {\n let node = this.unwrapPrintTransparentExpression(value);\n if (node?.kind !== SyntaxKind.AwaitExpression) {\n return false;\n }\n node = this.unwrapPrintTransparentExpression(node.expression);\n if (node === undefined || !isCallExpression(node) || !isPropertyAccessExpression(node.expression)\n || node.expression.expression.kind !== SyntaxKind.ThisKeyword) {\n return false;\n }\n let declaration: any;\n try {\n declaration = this.checkerOrUndefined()?.getResolvedSignature(node)?.declaration?.resolve();\n } catch (e) {\n return false;\n }\n const fileName = declaration?.getSourceFile?.()?.fileName;\n if (typeof fileName !== 'string' || !JAVA_J16_IMPLICIT_API_FILE.test(fileName) || !declaration.body) {\n return false;\n }\n const statements = declaration.body.statements ?? [];\n const ret = statements.length === 1 && isReturnStatement(statements[0]) ? statements[0].expression : undefined;\n return ret !== undefined && isCallExpression(ret) && isPropertyAccessExpression(ret.expression)\n && ret.expression.expression.kind === SyntaxKind.ThisKeyword && ret.expression.name.text === 'request';\n };\n}\n","import { BaseTranspiler } from \"./baseTranspiler.js\";\nimport { NodeFlags, SyntaxKind, type Block, type CallExpression, type Declaration, type Expression, type Identifier, type Node, type NodeArray, type ParameterDeclaration, type SourceFile, type VariableDeclaration } from \"typescript/unstable/ast\";\nimport { isArrayLiteralExpression, isArrowFunction, isAsExpression, isBinaryExpression, isBindingElement, isBlock, isCallExpression, isClassDeclaration, isClassExpression, isConditionalExpression, isDeleteExpression, isElementAccessExpression, isForInStatement, isForOfStatement, isIdentifier, isMethodDeclaration, isNoSubstitutionTemplateLiteral, isNonNullExpression, isNumericLiteral, isObjectLiteralExpression, isParameterDeclaration, isParenthesizedExpression, isPrefixUnaryExpression, isPropertyAccessExpression, isReturnStatement, isShorthandPropertyAssignment, isSourceFile, isStatement, isStringLiteral, isStringLiteralLikeNode, isTypeAssertion, isVariableDeclaration } from \"typescript/unstable/ast/is\";\nimport { IndexKind, ObjectFlags, SignatureKind, SymbolFlags, TypeFlags, type Symbol as TsSymbol, type Type } from \"typescript/unstable/sync\";\nimport { findAncestor, getAllSuperTypeNodes, isFunctionLike, signatureDeclaration, symbolDeclarations, symbolValueDeclaration, typeParts, typeTarget } from \"./tsUtils.js\";\n\nconst parserConfig = {\n 'ELSEIF_TOKEN': 'else if',\n 'OBJECT_OPENING': '{',\n 'OBJECT_CLOSING': '}',\n 'ARRAY_OPENING_TOKEN': 'Value::from(vec![',\n 'ARRAY_CLOSING_TOKEN': '])',\n 'PROPERTY_ASSIGNMENT_TOKEN': ':',\n 'VAR_TOKEN': 'let mut',\n 'METHOD_TOKEN': 'fn',\n 'FUNCTION_TOKEN': 'fn',\n 'PROPERTY_ASSIGNMENT_OPEN': '',\n 'PROPERTY_ASSIGNMENT_CLOSE': '',\n 'SUPER_TOKEN': 'super',\n 'SUPER_CALL_TOKEN': 'super',\n 'FALSY_WRAPPER_OPEN': 'is_true(&',\n 'FALSY_WRAPPER_CLOSE': ')',\n 'COMPARISON_WRAPPER_OPEN': 'is_equal(&',\n 'COMPARISON_WRAPPER_CLOSE': ')',\n 'UKNOWN_PROP_WRAPPER_OPEN': '',\n 'UNKOWN_PROP_WRAPPER_CLOSE': '',\n 'UKNOWN_PROP_ASYNC_WRAPPER_OPEN': '',\n 'UNKOWN_PROP_ASYNC_WRAPPER_CLOSE': '',\n 'DYNAMIC_CALL_OPEN': '',\n 'EQUALS_EQUALS_WRAPPER_OPEN': 'is_equal(&',\n 'EQUALS_EQUALS_WRAPPER_CLOSE': ')',\n 'DIFFERENT_WRAPPER_OPEN': '!is_equal(&',\n 'DIFFERENT_WRAPPER_CLOSE': ')',\n 'GREATER_THAN_WRAPPER_OPEN': 'is_greater_than(&',\n 'GREATER_THAN_WRAPPER_CLOSE': ')',\n 'GREATER_THAN_EQUALS_WRAPPER_OPEN': 'is_greater_than_or_equal(&',\n 'GREATER_THAN_EQUALS_WRAPPER_CLOSE': ')',\n 'LESS_THAN_WRAPPER_OPEN': 'is_less_than(&',\n 'LESS_THAN_WRAPPER_CLOSE': ')',\n 'LESS_THAN_EQUALS_WRAPPER_OPEN': 'is_less_than_or_equal(&',\n 'LESS_THAN_EQUALS_WRAPPER_CLOSE': ')',\n 'PLUS_WRAPPER_OPEN': 'add(&',\n 'PLUS_WRAPPER_CLOSE': ')',\n 'MINUS_WRAPPER_OPEN': 'subtract(&',\n 'MINUS_WRAPPER_CLOSE': ')',\n 'ARRAY_LENGTH_WRAPPER_OPEN': 'get_array_length(&',\n 'ARRAY_LENGTH_WRAPPER_CLOSE': ')',\n 'DIVIDE_WRAPPER_OPEN': 'divide(&',\n 'DIVIDE_WRAPPER_CLOSE': ')',\n 'MULTIPLY_WRAPPER_OPEN': 'multiply(&',\n 'MULTIPLY_WRAPPER_CLOSE': ')',\n 'INDEXOF_WRAPPER_OPEN': 'get_index_of(&',\n 'INDEXOF_WRAPPER_CLOSE': ')',\n 'MOD_WRAPPER_OPEN': 'mod_val(&',\n 'MOD_WRAPPER_CLOSE': ')',\n 'LINE_TERMINATOR': ';',\n 'CONDITION_OPENING': '',\n 'CONDITION_CLOSE': '',\n 'AWAIT_TOKEN': '',\n 'NULL_TOKEN': 'Value::Null',\n 'UNDEFINED_TOKEN': 'Value::Null',\n 'WHILE_TOKEN': 'while',\n 'ELEMENT_ACCESS_WRAPPER_OPEN': 'get_value(&',\n 'ELEMENT_ACCESS_WRAPPER_CLOSE': ')',\n 'DEFAULT_PARAMETER_TYPE': 'Value',\n 'DEFAULT_RETURN_TYPE': 'Value',\n 'BLOCK_OPENING_TOKEN': '{',\n 'TRUE_KEYWORD': 'Value::Bool(true)',\n 'FALSE_KEYWORD': 'Value::Bool(false)',\n};\n\n/** Answer of `RustTranspiler.rustDeclaredLocalTypeResolver` for a local whose\n * value provably holds a `Value::Dict` at every use. */\nexport type RustDeclaredLocalKind = 'dict';\n\n/** One `let x: Value = ` declaration. `kind` is only\n * answered by the resolver when `alwaysDict && stable`. */\nexport interface RustDeclaredDictLocalEntry {\n kind: RustDeclaredLocalKind;\n name: string;\n /** printed callee of the initialiser: a `safe_dict*` name, or `value_map`. */\n source: string;\n /** the `safe_dict*` `optionalArgs` default is itself Dict-proven, so the\n * helper returns a Dict on every path (it returns that default when the\n * key does not hold one). */\n alwaysDict: boolean;\n /** no later write in the enclosing function can change the kind (D2). */\n stable: boolean;\n /** use census: element-access receiver / kind-preserving mutator / anything else. */\n uses: { elementAccess: number, mutHelper: number, other: number };\n declaration: VariableDeclaration;\n start: number;\n}\n\n/** A `Dict`/`List` parameter whose body uses are all printable reads: the\n * printer re-binds the same name to a borrowed container at fn entry\n * (`let x = x.as_map().unwrap_or(&__x_empty);`) so every read is native. */\nexport interface RustParamShadow {\n kind: RustParamShadowKind;\n /** the parameter name; the shadow re-binds it, the `Value` ABI is untouched. */\n name: string;\n declaration: ParameterDeclaration;\n}\n\n/** Shadow kinds: `&IndexMap` / `&Vec` (D-25). */\nexport type RustParamShadowKind = 'map' | 'list';\n\n/** Vocabulary of the parameter-shadow table (`RustTranspiler.rustParamShadowOf`). */\nexport const RUST_PARAM_SHADOWS = {\n MAP: 'map' as RustParamShadowKind,\n LIST: 'list' as RustParamShadowKind,\n /** `this.` reads inlined natively against a shadowed dict param. */\n SAFE_READS: new Set([\n 'safeValue', 'safeString', 'safeInteger', 'safeNumber', 'safeBool',\n 'safeDict', 'safeList',\n ]),\n};\n\n/** Vocabulary of the declared-Dict locals table (see\n * `RustTranspiler.rustDeclaredLocalTypeResolver`). */\nexport const RUST_DECLARED_DICT_LOCALS = {\n /** value the resolver answers for a proven Dict local */\n DICT: 'dict' as RustDeclaredLocalKind,\n /** printed `self.` -> index of its `optionalArgs` parameter.\n * `safe_dict*` returns `optional_args[0]` whenever the key holds a non-Dict. */\n SAFE_CALLEES: {\n safe_dict_k: 2,\n safe_dict: 2,\n safe_dict_n: 2,\n safe_dict2: 3,\n } as Record,\n /** `&mut` receivers whose writes land inside the container, so a Dict local\n * stays a Dict (`add_element_to_object` / `append_to_array` no-op on a\n * non-container, `set_value` / `remove` write a key). */\n KIND_PRESERVING_MUTATORS: new Set([\n 'add_element_to_object', 'append_to_array', 'set_value', 'remove',\n 'get_value_mut',\n ]),\n};\n\n/** `x = ..` / `x += ..` — every token that writes a place. */\nfunction rustIsAssignmentOperator(kind: SyntaxKind): boolean {\n return kind === SyntaxKind.EqualsToken ||\n (kind >= SyntaxKind.PlusEqualsToken && kind <= SyntaxKind.CaretEqualsToken);\n}\n\n/** Preorder (forEachChild order) of a scope's descendants, decoded once: `end[i]` is the index past\n * node i's subtree; `byName` lists identifiers and name-binding declarations per name text. */\ninterface RustScopeIndex {\n nodes: Node[];\n end: number[];\n byName: Map | undefined;\n}\n\nconst RUST_NAME_BINDER_KINDS = new Set([\n SyntaxKind.VariableDeclaration, SyntaxKind.Parameter, SyntaxKind.FunctionDeclaration,\n SyntaxKind.ClassDeclaration, SyntaxKind.PropertyDeclaration, SyntaxKind.FunctionExpression,\n SyntaxKind.ArrowFunction,\n]);\n\nconst RUST_WALK_SKIP = 1;\nconst RUST_WALK_STOP = 2;\n\nfunction rustBuildScopeIndex(scope: Node): RustScopeIndex {\n const nodes: Node[] = [];\n const end: number[] = [];\n const visit = (n: any) => {\n const i = nodes.length;\n nodes.push(n);\n end.push(0);\n n.forEachChild(visit);\n end[i] = nodes.length;\n };\n scope.forEachChild(visit);\n return { nodes, end, byName: undefined };\n}\n\n// name text decoding is the costly part, so the name table is built on first use only\nfunction rustScopeNameTable(index: RustScopeIndex): Map {\n if (index.byName !== undefined) return index.byName;\n const byName = new Map();\n const add = (name: string, i: number) => {\n const list = byName.get(name);\n if (list === undefined) byName.set(name, [i]);\n else if (list[list.length - 1] !== i) list.push(i);\n };\n const nodes: any[] = index.nodes;\n for (let i = 0; i < nodes.length; i++) {\n const n = nodes[i];\n const kind = n.kind;\n if (RUST_NAME_BINDER_KINDS.has(kind) && n.name?.kind === SyntaxKind.Identifier) add(n.name.text, i);\n if (kind === SyntaxKind.Identifier) add(n.text, i);\n }\n index.byName = byName;\n return byName;\n}\n\nexport class RustTranspiler extends BaseTranspiler {\n\n private rustScopeIndexes = new WeakMap();\n\n rustScopeIndex(scope: Node): RustScopeIndex {\n let index = this.rustScopeIndexes.get(scope);\n if (index === undefined) {\n index = rustBuildScopeIndex(scope);\n this.rustScopeIndexes.set(scope, index);\n }\n return index;\n }\n\n /** `scope.forEachChild(visit)` recursion over the cached preorder: `visit` answers\n * RUST_WALK_SKIP to skip the node's subtree, RUST_WALK_STOP to end the walk. */\n rustWalkScope(scope: Node, visit: (n: any) => number | void): void {\n const { nodes, end } = this.rustScopeIndex(scope);\n for (let i = 0; i < nodes.length;) {\n const r = visit(nodes[i]);\n if (r === RUST_WALK_STOP) return;\n i = r === RUST_WALK_SKIP ? end[i] : i + 1;\n }\n }\n\n /** Scope nodes that are an identifier or a name-binding declaration spelled `name`, in walk order. */\n rustScopeNameNodes(scope: Node, name: string): Node[] {\n const index = this.rustScopeIndex(scope);\n return (rustScopeNameTable(index).get(name) ?? []).map((i) => index.nodes[i]);\n }\n\n // node kinds the printer types that the core per-file prefetch leaves to single round trips\n private static readonly RUST_PREFETCH_TYPE_KINDS = new Set([\n SyntaxKind.FalseKeyword, SyntaxKind.TrueKeyword, SyntaxKind.ParenthesizedExpression,\n SyntaxKind.AwaitExpression, SyntaxKind.PrefixUnaryExpression,\n SyntaxKind.BooleanKeyword, SyntaxKind.ObjectKeyword, SyntaxKind.UnionType,\n SyntaxKind.ConditionalExpression, SyntaxKind.AsExpression,\n ]);\n\n /** One bulk getTypeAtLocation for the class's nodes of those kinds, seeding the checker memo. */\n rustPrefetchClassTypes(node: Node): void {\n const getType: any = this.checkerOrUndefined()?.getTypeAtLocation;\n if (getType?.seed === undefined || getType.original === undefined) return;\n const kinds = RustTranspiler.RUST_PREFETCH_TYPE_KINDS;\n const nodes: Node[] = [];\n for (const n of this.rustScopeIndex(node).nodes) {\n if (kinds.has(n.kind) && !getType.has(n)) nodes.push(n);\n }\n if (nodes.length === 0) return;\n let results: unknown[];\n try {\n results = getType.original(nodes);\n } catch (e) {\n return; // the lazy per-node path answers them\n }\n nodes.forEach((n, i) => getType.seed(n, results[i]));\n }\n\n binaryExpressionsWrappers;\n methodSignatures: Record;\n forLoopCounter: number;\n /** The handler `message` parameter a shadow is being printed for (set only\n * while its method body is printed). */\n rustProHandlerShadowParam: ParameterDeclaration | undefined;\n\n constructor(config = {}) {\n config['parser'] = Object.assign({}, parserConfig, config['parser'] ?? {});\n super(config);\n\n this.requiresParameterType = true;\n this.requiresReturnType = false;\n this.asyncTranspiling = true;\n this.supportsFalsyOrTruthyValues = false;\n this.id = \"Rust\";\n this.className = \"undefined\";\n this.methodSignatures = {};\n this.forLoopCounter = 0;\n\n this.initConfig();\n this.applyUserOverrides(config);\n }\n\n initConfig() {\n this.LeftPropertyAccessReplacements = {};\n\n this.RightPropertyAccessReplacements = {};\n\n this.FullPropertyAccessReplacements = {\n 'console.log': 'println_val',\n 'Math.floor': 'math_floor',\n 'Math.ceil': 'math_ceil',\n 'Math.round': 'math_round',\n };\n\n this.CallExpressionReplacements = {};\n\n this.ReservedKeywordsReplacements = {\n 'type': 'type_var',\n 'move': 'move_val',\n 'ref': 'ref_val',\n 'str': 'str_val',\n 'use': 'use_val',\n 'mod': 'mod_kw',\n 'loop': 'loop_val',\n 'match': 'match_val',\n 'where': 'where_val',\n 'final': 'final_val',\n 'box': 'box_val',\n 'become': 'become_val',\n 'priv': 'priv_val',\n 'override': 'override_val',\n 'unsized': 'unsized_val',\n 'async': 'async_val',\n 'await': 'await_val',\n 'try': 'try_val',\n 'abstract': 'abstract_val',\n 'dyn': 'dyn_val',\n 'fn': 'fn_val',\n 'impl': 'impl_val',\n 'pub': 'pub_val',\n 'self': 'self_val',\n 'super': 'super_val',\n 'crate': 'crate_val',\n };\n\n // [fnName, close] — ensureRef adds & to each operand\n this.binaryExpressionsWrappers = {\n [SyntaxKind.EqualsEqualsToken]: ['is_equal(', ')'],\n [SyntaxKind.EqualsEqualsEqualsToken]: ['is_equal(', ')'],\n [SyntaxKind.ExclamationEqualsToken]: ['!is_equal(', ')'],\n [SyntaxKind.ExclamationEqualsEqualsToken]: ['!is_equal(', ')'],\n [SyntaxKind.GreaterThanToken]: ['is_greater_than(', ')'],\n [SyntaxKind.GreaterThanEqualsToken]: ['is_greater_than_or_equal(', ')'],\n [SyntaxKind.LessThanToken]: ['is_less_than(', ')'],\n [SyntaxKind.LessThanEqualsToken]: ['is_less_than_or_equal(', ')'],\n [SyntaxKind.PlusToken]: ['add(', ')'],\n [SyntaxKind.MinusToken]: ['subtract(', ')'],\n [SyntaxKind.AsteriskToken]: ['multiply(', ')'],\n [SyntaxKind.PercentToken]: ['mod_val(', ')'],\n [SyntaxKind.SlashToken]: ['divide(', ')'],\n };\n }\n\n // Escaped Rust string literal for the given TS literal text — shared by\n // the `Value::Str(..)` form and the `&str` key form below.\n quotedStringLiteral(text: string): string {\n // Preserve real backslashes\n const backslashPlaceholder = \"\\x00\";\n text = text.replaceAll(\"\\\\\", backslashPlaceholder);\n text = text.replaceAll(\"\\b\", \"\\\\b\");\n text = text.replaceAll(\"\\f\", \"\\\\f\");\n text = text.replaceAll(\"\\n\", \"\\\\n\");\n text = text.replaceAll(\"\\r\", \"\\\\r\");\n text = text.replaceAll(\"\\t\", \"\\\\t\");\n text = text.replaceAll(backslashPlaceholder, \"\\\\\\\\\");\n text = text.replaceAll('\"', '\\\\\"');\n return `\"${text}\"`;\n }\n\n printStringLiteral(node) {\n const text = node.text;\n if (text in this.StringLiteralReplacements) return this.StringLiteralReplacements[text];\n // `.into()` borrows the `&'static str` into the `Cow` payload — no alloc.\n return `Value::Str(${this.quotedStringLiteral(text)}.into())`;\n }\n\n printNumericLiteral(node) {\n const text = node.text;\n // a decimal point or an exponent makes the literal a float\n if (text.includes('.') || /[eE]/.test(text)) return `Value::Float(${text})`;\n return `Value::Int(${text})`;\n }\n\n printBooleanLiteral(node) {\n return `Value::Bool(${SyntaxKind.TrueKeyword === node.kind})`;\n }\n\n printNullKeyword(node, identation) {\n return 'Value::Null';\n }\n\n // ── native equality emission ────────────────────────────────────────────\n // When the checker proves both operands hold the same primitive payload\n // (string / number / boolean, or one side is a matching literal) the\n // unwrapped payloads are compared with `==`/`!=` instead of is_equal().\n\n // Operators whose printed form is a bare Rust `bool` (not a Value).\n private static readonly BOOL_PRODUCING_OPERATORS = new Set([\n SyntaxKind.EqualsEqualsToken,\n SyntaxKind.EqualsEqualsEqualsToken,\n SyntaxKind.ExclamationEqualsToken,\n SyntaxKind.ExclamationEqualsEqualsToken,\n SyntaxKind.LessThanToken,\n SyntaxKind.LessThanEqualsToken,\n SyntaxKind.GreaterThanToken,\n SyntaxKind.GreaterThanEqualsToken,\n SyntaxKind.AmpersandAmpersandToken,\n SyntaxKind.BarBarToken,\n SyntaxKind.InstanceOfKeyword,\n ]);\n\n // Method names whose Rust helper returns a bare `bool` (not a Value).\n private static readonly BOOL_PRODUCING_CALLS = new Set([\n 'isInteger',\n 'isSafeInteger',\n 'some',\n 'every',\n 'test',\n ]);\n\n // Receiver locals whose element writes may go native (rust-13). `request`\n // is rust-12's family; every other receiver keeps the helper.\n private static readonly RUST_NATIVE_INSERT_RECEIVERS = new Set([\n 'result',\n 'account',\n 'params',\n 'fee',\n ]);\n\n // Scalar book fields the shared order-book store keeps instead of the Dict\n // (value.rs `is_book_meta_key` plus the `cache` replacement write).\n private static readonly RUST_BOOK_META_KEYS = new Set([\n 'timestamp',\n 'datetime',\n 'nonce',\n 'symbol',\n 'checksum',\n 'cache',\n ]);\n\n // `this.` receivers whose Value may be a tagged live handle (order\n // book / cache / ws client / subscriptions snapshot) — these keep the helper\n // so its store write-through stays reachable.\n private static readonly RUST_TAGGED_HANDLE_FIELDS = new Set([\n 'cache',\n 'client',\n 'subscriptions',\n 'orderbook',\n ]);\n\n // Fields the hand-written base keeps as a plain dict: `rust/ccxt-base/src/exchange.rs`\n // initialises each to `Value::Map(HashMap::new())` and never tags it, so an element write\n // is the whole helper even though the TS declaration is `any` (no checker shape to read).\n private static readonly RUST_PLAIN_DICT_FIELDS = new Set([\n 'balance',\n 'orderbooks',\n 'trades',\n 'tickers',\n 'bidsasks',\n 'ohlcvs',\n 'clients',\n 'transactions',\n 'headers',\n 'currencies',\n 'has',\n 'tokenBucket',\n ]);\n\n // Free helpers whose call prints a bare `bool` — an argument position that\n // expects a `Value` has to box them (ccxt's wrapBoolValueArgs set).\n private static readonly RUST_BOOL_VALUE_HELPERS = [\n 'is_equal',\n 'is_true',\n 'is_greater_than',\n 'is_less_than',\n 'is_greater_than_or_equal',\n 'is_less_than_or_equal',\n 'is_array',\n 'is_object',\n 'in_op',\n 'is_number',\n 'is_string',\n ];\n\n // Payload accessor used to compare each primitive kind natively.\n private static readonly PAYLOAD_ACCESSORS = {\n 'string': 'as_str',\n 'number': 'as_f64',\n 'boolean': 'as_bool',\n };\n\n // Primitive kind the checker proves for `type`; a union keeps the kind only\n // when every non-nullable member is that same primitive.\n primitiveKindOfType(type): string {\n if (type === undefined) return undefined;\n const flags = type.flags;\n if (this.isStringType(flags)) return 'string';\n if (flags === TypeFlags.Number || flags === TypeFlags.NumberLiteral) return 'number';\n if (flags === TypeFlags.Boolean || flags === TypeFlags.BooleanLiteral) return 'boolean';\n if (flags & TypeFlags.Union) {\n let kind = undefined;\n for (const member of typeParts(type) ?? []) {\n if (member.flags & (TypeFlags.Undefined | TypeFlags.Null)) {\n continue;\n }\n const memberKind = this.primitiveKindOfType(member);\n if (memberKind === undefined || (kind !== undefined && kind !== memberKind)) return undefined;\n kind = memberKind;\n }\n return kind;\n }\n return undefined;\n }\n\n // Native truthiness of a checker-proved boolean Value: `is_true(&v)` is `v.is_truthy()`\n // (`\"\"`/`0`/`[]`/`{}`/Null are false). When the operand is proven `bool`/`undefined` only,\n // the runtime value is `Value::Bool(..)` or `Value::Null`, so `matches!(v, Value::Bool(true))`.\n\n /** `true` / `false` / `boolean` (a union of BooleanLiteral members too). */\n isBooleanValueType(type: Type | undefined): boolean {\n if (type === undefined) return false;\n if (type.flags & TypeFlags.Union) {\n const members: Type[] = typeParts(type) ?? [];\n return members.length > 0 && members.every((member) => this.isBooleanValueType(member));\n }\n return (type.flags & (TypeFlags.Boolean | TypeFlags.BooleanLiteral)) !== 0;\n }\n\n /** `boolean | undefined`: `undefined`/`null` both print `Value::Null` (false\n * for the helper and for the `matches!` alike), so they may join the union. */\n isBooleanOrUndefinedType(type: Type | undefined): boolean {\n if (type === undefined) return false;\n const members: Type[] = (type.flags & TypeFlags.Union) ? (typeParts(type) ?? []) : [type];\n if (members.length === 0) return false;\n const onlyBooleanOrEmpty = members.every((member) =>\n this.isBooleanValueType(member) ||\n (member.flags & (TypeFlags.Undefined | TypeFlags.Void | TypeFlags.Null)) !== 0);\n return onlyBooleanOrEmpty && members.some((member) => this.isBooleanValueType(member));\n }\n\n /** Operands this unit owns: `safeBool`/`safeBool2`/`safeBoolN` calls (a\n * `Value` in the port) and element accesses (printed as `get_value`). */\n isBooleanValueFamilyOperand(node): boolean {\n const inner = this.unwrapParens(node);\n if (inner === undefined) return false;\n if (isElementAccessExpression(inner)) return true;\n if (isCallExpression(inner)) {\n const name = this.callExpressionName(inner);\n return name === 'safeBool' || name === 'safeBool2' || name === 'safeBoolN';\n }\n return false;\n }\n\n /** The emitted `matches!` is a bare Rust `bool`: it is only valid where the\n * whole enclosing boolean expression already sits in a bool slot. A logical\n * expression stored in a `Value` slot gets its `Value::Bool(..)` box from the\n * ccxt post-passes, which key on the leading helper token the operand would\n * no longer provide. */\n isBareBoolEmissionSafe(node): boolean {\n return this.isBooleanPosition(this.rustClimbLogicalWrappers(node));\n }\n\n /** Outermost ancestor reached through parens, `!` and `&&`/`||`. */\n rustClimbLogicalWrappers(node): any {\n let current: any = node;\n let parent: any = current.parent;\n while (parent !== undefined && (isParenthesizedExpression(parent) ||\n (parent.kind === SyntaxKind.PrefixUnaryExpression && parent.operator === SyntaxKind.ExclamationToken) ||\n (parent.kind === SyntaxKind.BinaryExpression &&\n (parent.operatorToken.kind === SyntaxKind.AmpersandAmpersandToken ||\n parent.operatorToken.kind === SyntaxKind.BarBarToken)))) {\n current = parent;\n parent = parent.parent;\n }\n return current;\n }\n\n // B-26 extends the proof with the printer's own bool-typed sinks: a narrowed `let x: bool = …`\n // (getRustBoolLocalInitializer) and a logical boxed in `Value::Bool(…)`\n // (printCustomBinaryExpressionIfAny) both demand a `bool`, so their operands may print bare.\n rustConditionBoolSlot(node): boolean {\n if (this.isBareBoolEmissionSafe(node)) return true;\n const current = this.rustClimbLogicalWrappers(node);\n // A logical the printer boxes (`Value::Bool()`) for a Value slot.\n const inner = this.unwrapParens(current);\n if (inner !== undefined && inner.kind === SyntaxKind.BinaryExpression &&\n (inner.operatorToken.kind === SyntaxKind.AmpersandAmpersandToken ||\n inner.operatorToken.kind === SyntaxKind.BarBarToken) &&\n (this.hasNativeComparisonOperand(inner.left) || this.hasNativeComparisonOperand(inner.right))) {\n return true;\n }\n // The initializer of a local this printer declares `bool`.\n const declaration: any = current.parent;\n if (declaration === undefined || !isVariableDeclaration(declaration) ||\n declaration.initializer !== current || declaration.name?.kind !== SyntaxKind.Identifier) {\n return false;\n }\n return this.rustNodeIsBoolExpression(declaration.initializer) &&\n this.rustTypeIsBoolean(declaration.initializer) &&\n this.rustLocalUsesAcceptBool(declaration, String(declaration.name.text));\n }\n\n /** Native truthiness text of the operand, or undefined to keep `is_true`. */\n printNativeTruthiness(node): string | undefined {\n if (!this.isBooleanValueFamilyOperand(node) || !this.printsValueExpression(node) ||\n !this.isBooleanOrUndefinedType(this.typeOfNodeIfAny(node)) || !this.isBareBoolEmissionSafe(node)) {\n return undefined;\n }\n return `matches!(${this.printNode(node, 0)}, Value::Bool(true))`;\n }\n\n // Kind of a literal operand whose printed Value variant is exactly known.\n literalKindOfNode(node): string {\n if (node === undefined) return undefined;\n switch (node.kind) {\n case SyntaxKind.StringLiteral: return 'string';\n case SyntaxKind.NumericLiteral: return 'number';\n case SyntaxKind.TrueKeyword:\n case SyntaxKind.FalseKeyword: return 'boolean';\n case SyntaxKind.NullKeyword: return 'null';\n case SyntaxKind.Identifier: return node.text === 'undefined' ? 'null' : undefined;\n }\n return undefined;\n }\n\n // Does printNode() render `node` as a Rust `Value` (and not a bare bool)?\n printsValueExpression(node): boolean {\n if (node === undefined) return false;\n switch (node.kind) {\n case SyntaxKind.ParenthesizedExpression: return this.printsValueExpression(node.expression);\n case SyntaxKind.AwaitExpression: return this.printsValueExpression(node.expression);\n case SyntaxKind.BinaryExpression: return !RustTranspiler.BOOL_PRODUCING_OPERATORS.has(node.operatorToken.kind);\n case SyntaxKind.PrefixUnaryExpression: return node.operator !== SyntaxKind.ExclamationToken;\n case SyntaxKind.CallExpression: return !RustTranspiler.BOOL_PRODUCING_CALLS.has(this.callExpressionName(node));\n case SyntaxKind.Identifier:\n case SyntaxKind.PropertyAccessExpression:\n case SyntaxKind.ElementAccessExpression:\n return !this.isClassInstanceType(this.getChecker().getTypeAtLocation(node));\n case SyntaxKind.StringLiteral:\n case SyntaxKind.NumericLiteral:\n case SyntaxKind.TrueKeyword:\n case SyntaxKind.FalseKeyword:\n case SyntaxKind.NullKeyword:\n case SyntaxKind.ArrayLiteralExpression:\n case SyntaxKind.ObjectLiteralExpression:\n case SyntaxKind.ConditionalExpression:\n return true;\n }\n return false;\n }\n\n // Class instances are emitted as their Rust struct (not a Value), so they\n // can neither be compared to Value::Null nor unwrapped with as_*().\n callExpressionName(node): string {\n const expression = node.expression;\n if (isIdentifier(expression)) return expression.text as string;\n if (isPropertyAccessExpression(expression)) return expression.name.text as string;\n return '';\n }\n\n // Does a string (literal text or literal-type value) parse as a number?\n // is_equal() coerces those against numeric/bool operands, a plain string\n // compare does not.\n textCoercesToNumber(text: string): boolean {\n return /^[+-]?(\\d+\\.?\\d*|\\.\\d+)([eE][+-]?\\d+)?$/.test(text) || /^[+-]?(inf|infinity|nan)$/i.test(text);\n }\n\n // f64 literal text for a numeric literal; undefined when it is not a Rust\n // decimal/float literal (hex/octal/binary fall back to the helper).\n numericLiteralF64Text(node): string {\n const text = node.text;\n if (text.startsWith('0x') || text.startsWith('0o') || text.startsWith('0b')) return undefined;\n if (text.startsWith('.')) return `0${text}`;\n if (text.includes('.') || text.includes('e') || text.includes('E')) return text;\n return `${text}.0`;\n }\n\n // The printer's own proof that a plain read prints as a Rust `Value`: `this.` (every\n // declared field is `Value`) or an identifier bound to a local/param (a local is narrowed to\n // `bool` only when every use is a condition sink — never an is_equal argument).\n rustReadPrintsValue(node): boolean {\n if (node === undefined) return false;\n if (node.kind === SyntaxKind.PropertyAccessExpression && node.expression.kind === SyntaxKind.ThisKeyword) return true;\n if (node.kind !== SyntaxKind.Identifier) return false;\n const symbol: any = this.getChecker().getSymbolAtLocation(node);\n const declarations: any[] = symbolDeclarations(symbol);\n if (declarations.length === 0) return false;\n return declarations.every((declaration) => isParameterDeclaration(declaration)\n || (isVariableDeclaration(declaration)\n && declaration.initializer?.kind !== SyntaxKind.NewExpression));\n }\n\n // Can the checked type only hold a Bool, Null/undefined or a non-numeric\n // string? Then `x.as_bool() == Some(b)` answers exactly what is_equal(x, b)\n // does: its f64 fallback (Str parse / Bool→0|1) can never fire.\n rustBooleanComparableType(type): boolean {\n if (type === undefined) return false;\n if (type.flags & TypeFlags.Union) {\n const members: any[] = typeParts(type) ?? [];\n return members.length > 0 && members.every((member) => this.rustBooleanComparableType(member));\n }\n if (type.flags & (TypeFlags.Boolean | TypeFlags.BooleanLiteral)) return true;\n if (type.flags & (TypeFlags.Undefined | TypeFlags.Null)) return true;\n if (type.flags & TypeFlags.StringLiteral) return !this.textCoercesToNumber(String((type as any).value ?? ''));\n return false;\n }\n\n // Native `==`/`!=` on the unwrapped payload when the checker proves the\n // Value variants line up; undefined keeps the is_equal() helper.\n printNativeEqualityComparison(left, right, op): string {\n const r09 = this.rustR09LengthEquality(left, right, op); if (r09 !== undefined) return r09;\n const r12 = this.rustR12NativeBoolEquality(left, right, op); if (r12 !== undefined) return r12;\n const r13 = this.printRustR13ProvenStrEquality(left, right, op); if (r13 !== undefined) return r13;\n const r20 = this.r20BoolCallEquality(left, right, op); if (r20 !== undefined) return r20;\n const operator = (op === SyntaxKind.EqualsEqualsToken || op === SyntaxKind.EqualsEqualsEqualsToken) ? '==' : '!=';\n const leftLiteral = this.literalKindOfNode(left);\n const rightLiteral = this.literalKindOfNode(right);\n if (leftLiteral !== undefined && rightLiteral !== undefined) return undefined;\n if (leftLiteral !== undefined || rightLiteral !== undefined) {\n const literal = leftLiteral !== undefined ? left : right;\n const literalKind = leftLiteral ?? rightLiteral;\n const other = leftLiteral !== undefined ? right : left;\n if (!this.printsValueExpression(other) && (literalKind !== 'null' || !this.rustReadPrintsValue(other))) return undefined;\n const otherType = this.getChecker().getTypeAtLocation(other);\n const otherKind = this.primitiveKindOfType(otherType);\n const typedStringLocal = this.rustStringLocalIdentifierIsTyped(other);\n if (literalKind === 'null') {\n // Exact for every runtime value: is_equal(x, null) is true only\n // when x is Null, and the derived PartialEq says the same.\n if (typedStringLocal) return `${this.printNode(other, 0)}.${operator === '==' ? 'is_none' : 'is_some'}()`;\n return `${this.printNode(other, 0)} ${operator} Value::Null`;\n }\n if (literalKind === 'string') {\n if (literal.text in this.StringLiteralReplacements) return undefined;\n if (this.textCoercesToNumber(literal.text) && otherKind !== 'string') return undefined;\n const accessor = typedStringLocal ? 'as_deref' : 'as_str';\n return `${this.printNode(other, 0)}.${accessor}() ${operator} Some(${this.quotedStringLiteral(literal.text)})`;\n }\n if (literalKind === 'number') {\n if (otherKind !== 'number') return undefined;\n const text = this.numericLiteralF64Text(literal);\n if (text === undefined) return undefined;\n return `${this.printNode(other, 0)}.as_f64() ${operator} Some(${text})`;\n }\n if (literalKind === 'boolean') {\n if (otherKind !== 'boolean' && !this.rustBooleanComparableType(otherType)) return undefined;\n const value = literal.kind === SyntaxKind.TrueKeyword ? 'true' : 'false';\n return `${this.printNode(other, 0)}.as_bool() ${operator} Some(${value})`;\n }\n return undefined;\n }\n if (!this.printsValueExpression(left) || !this.printsValueExpression(right)) return undefined;\n const leftKind = this.primitiveKindOfType(this.getChecker().getTypeAtLocation(left));\n const rightKind = this.primitiveKindOfType(this.getChecker().getTypeAtLocation(right));\n if (leftKind === undefined || leftKind !== rightKind) return undefined;\n const accessor = RustTranspiler.PAYLOAD_ACCESSORS[leftKind];\n return `${this.printNode(left, 0)}.${accessor}() ${operator} ${this.printNode(right, 0)}.${accessor}()`;\n }\n\n // ── checker-typed helper elimination ─────────────────────────────────\n // Each predicate proves a static TS shape for which the native Rust form\n // is exactly what the runtime helper computes; only then is the helper\n // call dropped, anything unproven keeps the helper.\n\n typeOfNodeIfAny(node: Node): Type | undefined {\n // A transpile without a program/checker (bare snippet) has no types.\n return this.checkerOrUndefined()?.getTypeAtLocation(node);\n }\n\n // Arrays/tuples/strings: `.length` is exactly what `Value::len()` returns.\n // Other shapes (Dict) keep the helper — ArrayCache / OrderBookSide markers\n // hold their length in the marker dict, which get_array_length unwraps.\n isValueLengthType(type: Type | undefined): boolean {\n if (type === undefined) return false;\n if (type.flags & TypeFlags.Union) {\n const parts: Type[] = typeParts(type) ?? [];\n return parts.length > 0 && parts.every((part) => this.isValueLengthType(part));\n }\n // A `null`/`undefined` member boxes as `Value::Null`, whose `len()` is\n // the same number the helper's fallthrough returns for it.\n return (type.flags & (TypeFlags.Undefined | TypeFlags.Null | TypeFlags.Void)) !== 0\n || this.getChecker().isArrayType(type)\n || this.getChecker().isTupleType(type)\n || this.isStringType(type.flags);\n }\n\n printArrayLength(node, identation, leftExpr = undefined) {\n const receiver = leftExpr ?? this.printNode(node.expression, 0);\n if (!this.rustIsOrderBookSide(node.expression) && this.isValueLengthType(this.typeOfNodeIfAny(node.expression))) return `Value::Int(${receiver}.len() as i64)`;\n if (this.r11ProvenListValue(node.expression)) return `${receiver}.as_array().map_or(Value::Int(0), |__a| Value::Int(__a.len() as i64))`;\n return this.r18ArrLength(node, receiver) ?? `get_array_length(&${receiver})`;\n }\n\n /** `orderbook['bids']` / `orderbook.asks` on an `OrderBook`-typed receiver, or a\n * local initialised from one. The WS runtime keeps those sides as marker dicts\n * whose levels live in the side store, so only `get_array_length` / `get_value`\n * reach them — the checker's array type is not the runtime shape. */\n rustIsOrderBookSide(node: Node, depth = 0): boolean {\n const stripped = this.rustStripWrappers(node);\n if (stripped === undefined || depth > 4) return false;\n if (isIdentifier(stripped)) {\n const declaration = this.rustSingleLocalDeclaration(stripped);\n return declaration !== undefined && isVariableDeclaration(declaration)\n && this.rustIsOrderBookSide(declaration.initializer, depth + 1);\n }\n let receiver: Node | undefined;\n let key: string | undefined;\n if (isElementAccessExpression(stripped) && isStringLiteralLikeNode(stripped.argumentExpression)) {\n receiver = stripped.expression;\n key = stripped.argumentExpression.text;\n } else if (isPropertyAccessExpression(stripped)) {\n receiver = stripped.expression;\n key = String(stripped.name.text);\n }\n if (receiver === undefined || (key !== 'bids' && key !== 'asks')) return false;\n const symbol = (this.typeOfNodeIfAny(receiver) as any)?.getSymbol?.();\n return symbol !== undefined && /^(Indexed|Counted)?OrderBook$/.test(symbol.name);\n }\n\n // Native string search / slicing: `x.indexOf(y)` and `x.slice(a, b)` on a checker-proven\n // string receiver print native `str` code. The receiver is a `Value`, so the payload is reached\n // via `as_str()`; a `Value::Null` receiver takes the helper's `-1` / `Value::Null` branch.\n\n /** Literal integer bound of a `slice` call (`3`, `-64`), else undefined. */\n rustSliceLiteralBound(node): number | undefined {\n if (node === undefined) return undefined;\n if (isNumericLiteral(node)) {\n const value = Number(node.text);\n return Number.isSafeInteger(value) ? value : undefined;\n }\n if (isPrefixUnaryExpression(node) && node.operator === SyntaxKind.MinusToken &&\n isNumericLiteral(node.operand)) {\n const value = Number(node.operand.text);\n return Number.isSafeInteger(value) ? -value : undefined;\n }\n return undefined;\n }\n\n // `slice` clamps like JS: a non-negative bound is capped at the length, a\n // negative one counts from the end and is floored at 0.\n rustSliceClampedIndex(value: number): string {\n return value < 0 ? `(__l - ${-value}).max(0)` : `__l.min(${value})`;\n }\n\n // `x.indexOf(\"lit\")` on a proven string receiver: `str::find` is exactly\n // the helper's `Value::Str` arm (byte index, `-1` when absent).\n printNativeStringIndexOf(node, receiverText: string): string | undefined {\n if (node === undefined || !isCallExpression(node) ||\n !isPropertyAccessExpression(node.expression) || node.arguments?.length !== 1) {\n return undefined;\n }\n if (this.primitiveKindOfType(this.typeOfNodeIfAny(node.expression.expression)) !== 'string') return undefined;\n const needle = node.arguments[0];\n if (!isStringLiteral(needle) && !isNoSubstitutionTemplateLiteral(needle)) return undefined;\n if (typeof receiverText !== 'string' || receiverText.includes('\\n')) return undefined;\n const literal = this.escapeRustStringLiteral(needle.text);\n return `Value::Int(${receiverText}.as_str().and_then(|__s| __s.find(\"${literal}\")).map(|__i| __i as i64).unwrap_or(-1))`;\n }\n\n // `x.slice(a)` / `x.slice(a, b)` with literal bounds on a proven string\n // receiver: the helper's char-vector clamps are inlined, so the emission\n // returns the same string (and `Value::Null` for a null receiver).\n printNativeStringSlice(node, receiverText: string): string | undefined {\n if (node === undefined || !isCallExpression(node) ||\n !isPropertyAccessExpression(node.expression)) {\n return undefined;\n }\n const args = node.arguments ?? [];\n if (args.length === 0 || args.length > 2) return undefined;\n if (this.primitiveKindOfType(this.typeOfNodeIfAny(node.expression.expression)) !== 'string') return undefined;\n if (typeof receiverText !== 'string' || receiverText.includes('\\n')) return undefined;\n const start = this.rustSliceLiteralBound(args[0]);\n if (start === undefined) return undefined;\n let end = '__l';\n if (args[1] !== undefined && args[1].kind !== SyntaxKind.NullKeyword && args[1].kind !== SyntaxKind.UndefinedKeyword) {\n const bound = this.rustSliceLiteralBound(args[1]);\n if (bound === undefined) return undefined;\n end = this.rustSliceClampedIndex(bound);\n }\n const begin = this.rustSliceClampedIndex(start);\n return `${receiverText}.as_str().map(|__s| { let __c: Vec = __s.chars().collect();` +\n ` let __l = __c.len() as i64; let __i = ${begin}; let __j = ${end};` +\n ` if __i <= __j { __c[__i as usize..__j as usize].iter().collect::() } else { String::new() } })` +\n `.map(|__s| Value::Str(__s.into())).unwrap_or(Value::Null)`;\n }\n\n // Native value predicates (`Array.isArray` / `typeof … === '…'`): each runtime predicate is a\n // single `matches!` over the `Value` variants, so on a declared `Value` place the call is\n // replaced by that same match — no helper call, operand still read exactly once.\n\n // `matches!` pattern of the runtime predicate, keyed by the `typeof` word.\n private static readonly RUST_TYPE_PREDICATE_PATTERNS: { [key: string]: string } = {\n 'array': 'Value::Arr(_)',\n 'string': 'Value::Str(_)',\n 'number': 'Value::Int(_) | Value::Float(_)',\n 'boolean': 'Value::Bool(_)',\n 'object': 'Value::Dict(_)',\n };\n\n // An identifier bound by a local/param declaration: the printer declares\n // every one of them as `Value`. Imports, classes and function names print\n // as Rust items rather than as values, so they keep the helper.\n isDeclaredValueIdentifier(node): boolean {\n const declarations = symbolDeclarations((this.getChecker() as any).getSymbolAtLocation(node));\n return declarations.length > 0 && declarations.every((d) =>\n isVariableDeclaration(d) || isParameterDeclaration(d) || isBindingElement(d));\n }\n\n // A declared `Value` place: a local/param identifier, or a field/element\n // access rooted at `this` or at such an identifier. Those are the operands\n // whose printed text the helper already borrows as a `Value`.\n isDeclaredValuePlace(node): boolean {\n const inner = this.unwrapParens(node);\n if (inner !== undefined && isIdentifier(inner)) {\n return this.isDeclaredValueIdentifier(inner);\n }\n if (inner !== undefined && (isPropertyAccessExpression(inner) || isElementAccessExpression(inner))) {\n const root = this.unwrapParens(this.valuePlaceRoot(inner));\n return root !== undefined &&\n (root.kind === SyntaxKind.ThisKeyword || this.isDeclaredValueIdentifier(root));\n }\n return false;\n }\n\n valuePlaceRoot(node): any {\n let current: any = node;\n while (isPropertyAccessExpression(current) || isElementAccessExpression(current)) {\n current = current.expression;\n }\n return current;\n }\n\n nativeValuePredicateText(kind: string, operandNode, printedOperand: string): string | undefined {\n const pattern = RustTranspiler.RUST_TYPE_PREDICATE_PATTERNS[kind];\n if (pattern === undefined || operandNode === undefined || printedOperand === undefined ||\n !this.isDeclaredValuePlace(operandNode)) {\n return undefined;\n }\n return `matches!(${this.ensureRef(printedOperand)}, ${pattern})`;\n }\n\n // Object-typed values are Dicts at runtime, so `key in obj` is a plain\n // key lookup. Arrays keep the helper: `in_op` searches them element-wise.\n // A `Dict`/`Dictionary` receiver is a Reference to its index-signature\n // interface, so the class/lib guards — not the Reference flag — decide it.\n isDictShapedType(type: Type | undefined): boolean {\n if (type === undefined) return false;\n if (type.flags & TypeFlags.Union) {\n // `Market | undefined` style aliases: a nullish member carries no\n // value, so only the value-carrying members have to be dict-shaped.\n // `in_op` and the native insert both answer false / no-op on Null.\n const parts: Type[] = typeParts(type) ?? [];\n const valueParts = parts.filter((part) => !this.rustTypeIsNullish(part));\n return parts.length > valueParts.length && valueParts.length > 0\n && valueParts.every((part) => this.isDictShapedType(part));\n }\n const checker = this.getChecker();\n if (!(type.flags & TypeFlags.Object) || type.getCallSignatures().length !== 0\n || checker.isArrayType(type) || checker.isTupleType(type) || checker.isArrayLikeType(type)) {\n return false;\n }\n return !this.isClassInstanceType(type) && !this.isLibDeclaredType(type);\n }\n\n // `\"key\" in obj` → `matches!(&obj, Value::Dict(__d) if __d.contains_key(\"key\"))`\n // In the TS AST `key` is the left operand and `obj` the right one.\n printNativeInOperator(key, obj) {\n if (!isStringLiteral(key) || !this.isDictShapedType(this.typeOfNodeIfAny(obj))) {\n return undefined;\n }\n const keyLiteral = this.rustStringLiteralOf(this.printStringLiteral(key));\n if (keyLiteral === undefined) {\n return undefined;\n }\n const objExpr = this.printNode(obj, 0);\n return `Value::Bool(matches!(&${objExpr}, Value::Dict(__d) if __d.contains_key(${keyLiteral})))`;\n }\n\n // The Rust string literal behind a printed TS string literal — the boxed\n // shapes the printer emits today (`Value::Str(\"k\".to_string())`,\n // `Value::from(\"k\")`) plus a bare `\"k\"` once an arg-shape unit drops the box.\n rustStringLiteralOf(printedKey: string): string | undefined {\n const boxed = printedKey.match(/^(?:Value::Str|Value::from)\\((.+)\\)$/);\n const literal = (boxed ? boxed[1].replace(/\\.(?:to_string|into)\\(\\)$/, '') : printedKey).trim();\n return /^\"(?:[^\"\\\\]|\\\\.)*\"$/.test(literal) ? literal : undefined;\n }\n\n // `X[\"k\"] = v` on a checker-proven plain Dict receiver: mutate the Dict\n // natively. The helper's tag hooks (book meta, ws subscriptions, cache\n // hashmap) only fire on tagged dicts, which a plain object type never is.\n printNativeDictInsert(baseExpr, keyNode, keyText, valueText): string | undefined {\n const receiver = this.rustNativeInsertReceiver(baseExpr);\n if (receiver === undefined || !this.rustReceiverStaysDict(baseExpr, receiver)) {\n return undefined;\n }\n // A bucket read off `cache.hashmap` / client `subscriptions`/`futures` carries a runtime\n // backref: only the helper writes through to the shared store, so keep it.\n if (!receiver.isField && this.rustLocalInitReadsTaggedContainer(baseExpr)) {\n return undefined;\n }\n const keyArg = this.rustNativeInsertKeyArg(receiver, keyNode, keyText);\n if (keyArg === undefined) {\n return undefined;\n }\n const name = receiver.text;\n const value = this.rustPrintedBoolArg(valueText) ? `Value::Bool(${valueText})` : valueText;\n const insert = (val: string) =>\n `if let Value::Dict(__d) = &mut ${name} { std::sync::Arc::make_mut(__d).insert(${keyArg}, ${val}); }`;\n // Any mention of the receiver in the value operand reads it while the\n // write holds the `&mut` — ccxt's splitAddElementBorrowConflicts pass\n // hoists on the same signal, so mirror it with a temp binding.\n const readsReceiver = receiver.isField ? /\\bself\\b/.test(value) : new RegExp(`\\\\b${name}\\\\b`).test(value);\n if (readsReceiver) {\n return `{ let __be_tmp = ${value}; ${insert('__be_tmp')} }`;\n }\n const trimmed = value.trim();\n if (/^[a-zA-Z_][a-zA-Z0-9_]*$/.test(trimmed) && trimmed !== 'self'\n && trimmed !== 'true' && trimmed !== 'false') {\n return insert(`${trimmed}.clone()`);\n }\n return insert(value);\n }\n\n /** The `insert` key argument. A literal becomes `\"k\".into()`; a proven\n * string place becomes `crate::runtime::stringify_param(&k)` — the exact\n * conversion the helper's dict branch applies to a non-string key, and\n * `k.to_string()` for a string one. */\n rustNativeInsertKeyArg(receiver, keyNode, keyText: string): string | undefined {\n if (isStringLiteral(keyNode)) {\n // A book-meta key can only reach the store through a `__book_id`:\n // provable only for receivers the transpiler itself built as plain\n // maps or the hand-written base never tags (fields).\n if (RustTranspiler.RUST_BOOK_META_KEYS.has(keyNode.text) && !receiver.plain) {\n return undefined;\n }\n const keyLiteral = keyText.match(/^Value::Str\\((.+)\\.(?:to_string|into)\\(\\)\\)$/);\n return keyLiteral === null ? undefined : `${keyLiteral[1]}.into()`;\n }\n // Dynamic key: a plain place, never one that reads the receiver (the\n // insert holds its `&mut`). Every other key shape keeps the helper.\n const key = keyText.trim();\n if (!/^[A-Za-z_][A-Za-z0-9_]*$/.test(key)\n || (receiver.isField ? key.includes('self') : new RegExp(`\\\\b${receiver.text}\\\\b`).test(key))) {\n return undefined;\n }\n return `crate::runtime::stringify_param(&${key})`;\n }\n\n // Receivers this unit may write natively: any local whose every path builds\n // a plain `Value::Map` (name-independent — rust-13's four names are the\n // batch-A subset of this proof), any parameter the checker proves is a\n rustNativeInsertReceiver(expr): { text: string, isField: boolean, plain: boolean, nameNode: any } | undefined {\n if (isIdentifier(expr)) {\n const plain = this.rustInsertIdentifierReceiver(expr);\n return plain === undefined ? undefined : { text: expr.text, isField: false, plain, nameNode: expr };\n }\n if (isPropertyAccessExpression(expr) && expr.expression.kind === SyntaxKind.ThisKeyword\n && expr.name?.kind === SyntaxKind.Identifier) {\n return {\n text: `self.${expr.name.text}`, isField: true,\n plain: RustTranspiler.RUST_PLAIN_DICT_FIELDS.has(expr.name.text),\n nameNode: expr.name,\n };\n }\n return undefined;\n }\n\n /** Element-write receiver proof for a local: the batch-A names (rust-13,\n * `plain: false` — the whitelist is not a construction proof) or, for any\n * other name, the dict-shape proof plus a plain-`Value::Map` build on\n * every path (rust-12's proof, read off the checker), or a parameter whose\n * annotation proves a plain dict and whose writes keep that shape. The\n * returned flag is the *by-construction* plainness (literal-init locals,\n * handler tuples, hand-written plain fields) that a book-meta key needs. */\n rustInsertIdentifierReceiver(ident): boolean | undefined {\n const declaration = this.rustSingleLocalDeclaration(ident);\n if (declaration !== undefined && isParameterDeclaration(declaration as any)) {\n // A default value (`params: Dict = {}`) keeps the pre-unit\n // initializer proof — `rustReceiverStaysDict` runs both it and the\n // annotation proof and rejects the site when neither holds.\n if (this.rustParamStaysPlainDict(declaration as ParameterDeclaration)\n || (declaration as ParameterDeclaration).initializer !== undefined) {\n return false;\n }\n } else if (declaration !== undefined && isVariableDeclaration(declaration as any)) {\n if (this.rustInsertReceiverBuildsPlainDict(declaration as VariableDeclaration)) {\n return true;\n }\n // A local the declared-Dict table proves holds a Dict at every use\n // (alwaysDict && stable): the helper's non-dict branches are dead,\n // so only the tag hooks and the insert remain — the key rules of\n if (this.rustDeclaredLocalEntry(ident) !== undefined\n && this.rustDeclaredInitIsTagFree(declaration as VariableDeclaration)) {\n return false;\n }\n }\n if (RustTranspiler.RUST_NATIVE_INSERT_RECEIVERS.has(ident.text)) {\n return false; // rust-13 whitelist: not a construction proof\n }\n return undefined;\n }\n\n /** A literal initializer must carry no runtime tag key; a call initializer\n * is the axiom the declared-Dict table itself rests on. */\n rustDeclaredInitIsTagFree(declaration: VariableDeclaration): boolean {\n const init = this.rustStripWrappers(declaration.initializer);\n return init === undefined || !isObjectLiteralExpression(init) || this.rustPlainDictLiteral(init);\n }\n\n /** Skip `( … )`, `x!` and `x as T` wrappers. */\n rustStripWrappers(node: any): any {\n while (node !== undefined && (isParenthesizedExpression(node) || isNonNullExpression(node) || isAsExpression(node))) {\n node = node.expression;\n }\n return node;\n }\n\n /** The local's single declaration is initialised from a call that reads\n * `x.hashmap` / `x.subscriptions` / `x.futures` — element dicts the runtime\n * tags with a backref so writes reach the shared store, not the COW copy. */\n rustLocalInitReadsTaggedContainer(ident: Identifier): boolean {\n const declaration = this.rustSingleLocalDeclaration(ident);\n if (declaration === undefined || !isVariableDeclaration(declaration)) {\n return false;\n }\n const init = this.rustStripWrappers(declaration.initializer);\n return init !== undefined && isCallExpression(init) && init.arguments.some((arg) => {\n const n = this.rustStripWrappers(arg);\n return n !== undefined && isPropertyAccessExpression(n)\n && RustTranspiler.RUST_TAGGED_CONTAINER_FIELDS.has(n.name.text);\n });\n }\n\n static readonly RUST_TAGGED_CONTAINER_FIELDS = new Set([ 'hashmap', 'subscriptions', 'futures' ]);\n\n /** True when every value the local can hold comes from an object literal:\n * the runtime tags a dict (`__book_id`, `__ws_subs_url`, `__ws_sub_ref`,\n * `__cache_backref`) only on handles its own store builds, so the helper's\n * write-through branches are provably dead and `insert` is the whole\n * helper. A `[ x, params ] = this.handle…(…)` tuple re-assigns the\n * hand-written handler's own dict arguments. */\n rustInsertReceiverBuildsPlainDict(declaration: VariableDeclaration): boolean {\n const name = String((declaration.name as Identifier).text);\n const scope = this.rustEnclosingFunction(declaration);\n if (!this.rustPlainDictLiteral(declaration.initializer) || scope === undefined) {\n return false;\n }\n const declarationSymbol = this.rustSymbolOf(declaration.name as Identifier);\n let plain = true;\n this.rustWalkScope(scope, (n) => {\n if (!plain || !isBinaryExpression(n) || n.operatorToken.kind !== SyntaxKind.EqualsToken) {\n return;\n }\n const left: any = n.left;\n if (isIdentifier(left) && String(left.text) === name\n && (declarationSymbol === undefined || this.rustSymbolOf(left) === declarationSymbol)) {\n plain = this.rustPlainDictLiteral(n.right) || this.rustTypeIsUndefinedish(n.right);\n } else if (isArrayLiteralExpression(left)\n && left.elements.some((e) => isIdentifier(e) && String(e.text) === name)) {\n plain = this.rustHandlerTupleCall(n.right);\n }\n });\n return plain;\n }\n\n /** An object literal with no runtime tag key — the transpiler built it, so\n * it is a fresh plain `Value::Map` on every path. */\n rustPlainDictLiteral(node: Node | undefined): boolean {\n if (node !== undefined && isParenthesizedExpression(node)) {\n return this.rustPlainDictLiteral(node.expression);\n }\n return node !== undefined && isObjectLiteralExpression(node) && node.properties.every((property: any) => {\n const key = property.name;\n if (key === undefined) {\n return false;\n }\n const text = isStringLiteral(key) ? key.text\n : (isIdentifier(key) ? String(key.text) : undefined);\n return text === undefined || !text.startsWith('__');\n });\n }\n\n /** `this.handle…(…)` — the hand-written `handle*AndParams` / `handleUntil…`\n * family; each returns its own request/params dict arguments. */\n rustHandlerTupleCall(node: Node | undefined): boolean {\n const callee: any = node !== undefined && isCallExpression(node) ? node.expression : undefined;\n return callee !== undefined && isPropertyAccessExpression(callee) && callee.expression.kind === SyntaxKind.ThisKeyword\n && callee.name?.kind === SyntaxKind.Identifier && /^handle[A-Z]/.test(callee.name.text);\n }\n\n /** A `null`/`undefined` write leaves the receiver a non-dict, which the\n * emitted `if let Value::Dict` no-ops exactly like the helper. */\n private rustTypeIsUndefinedish(node: Node): boolean {\n if (node.kind === SyntaxKind.NullKeyword || (isIdentifier(node) && node.text === 'undefined')) {\n return true;\n }\n const type = this.typeOfNodeIfAny(node);\n return type !== undefined && (type.flags & (TypeFlags.Undefined | TypeFlags.Null | TypeFlags.Void)) !== 0;\n }\n\n /** The single variable declaration a local identifier binds to, or\n * undefined when the checker cannot answer / the binding is not a local. */\n rustSingleLocalDeclaration(ident: Identifier): VariableDeclaration | ParameterDeclaration | undefined {\n const checker: any = this.checkerOrUndefined();\n if (checker === undefined) {\n return undefined;\n }\n const declarations = symbolDeclarations(checker.getSymbolAtLocation(ident));\n const declaration: any = declarations.length === 1 ? declarations[0] : undefined;\n return declaration !== undefined && (isVariableDeclaration(declaration) || isParameterDeclaration(declaration))\n ? declaration : undefined;\n }\n\n // Dict-shape proof for a write receiver: an object type with no class, array or callable shape\n // — `Dictionary` instantiations count (they resolve to their interface target). A union keeps\n // the proof when every member is a Dict or `undefined` (both untaggable at runtime).\n rustWriteDictShape(type): boolean {\n if (type === undefined) return false;\n if (type.flags & TypeFlags.Union) {\n const parts: any[] = typeParts(type) ?? [];\n return parts.length > 0 && parts.every((part) => this.rustWriteDictShape(part));\n }\n if (type.flags & (TypeFlags.Undefined | TypeFlags.Void)) {\n return true;\n }\n const checker = this.getChecker();\n if (!(type.flags & TypeFlags.Object)\n || checker.isArrayType(type) || checker.isTupleType(type) || checker.isArrayLikeType(type)\n || ((typeTarget(type) ?? type as any).objectFlags & ObjectFlags.Class)) {\n return false;\n }\n return type.getCallSignatures().length === 0 && type.getConstructSignatures().length === 0;\n }\n\n // The receiver is a plain Dict on every path: its declared/initializer type is object-shaped\n // (never a class or array handle), its initializer is not an element read (the get_value COW\n // write-back pass keys on the `&mut ` text), and no write in scope assigns another shape.\n rustReceiverStaysDict(baseExpr, receiver): boolean {\n if (receiver.isField) {\n return this.rustFieldStaysDict(baseExpr, receiver.nameNode.text);\n }\n const ident = baseExpr;\n const declaration: any = this.rustSingleLocalDeclaration(ident);\n if (declaration === undefined) {\n return false;\n }\n // The declared-Dict table is its own proof (alwaysDict && stable, D2):\n // a table local the checker cannot type (an untyped `safe_dict*`\n // default) still stays a Dict at every use.\n if (this.rustDeclaredLocalEntry(ident) !== undefined) {\n return true;\n }\n // A parameter with a default carries the transpiler's own initializer,\n // so it keeps the pre-unit proof; without one only the annotation proof\n // (`Dict`-style params — the B-25 read family) can admit it.\n if (isParameterDeclaration(declaration) && this.rustParamStaysPlainDict(declaration)) {\n return true;\n }\n const name = ident.text;\n const initializer = declaration.initializer;\n const scope = this.rustEnclosingFunction(declaration);\n if (initializer === undefined || isElementAccessExpression(initializer)\n || declaration.name?.kind !== SyntaxKind.Identifier || scope === undefined) {\n return false;\n }\n let safe = this.rustWriteDictShape(this.typeOfNodeIfAny(ident))\n && this.rustWriteDictShape(this.typeOfNodeIfAny(initializer));\n this.rustWalkScope(scope, (n) => {\n if (n !== declaration && this.rustBindsName(n, name)) {\n safe = false; // a second binding of the name in scope — stay boxed\n return RUST_WALK_STOP;\n }\n if (isBinaryExpression(n) && n.operatorToken.kind === SyntaxKind.EqualsToken\n && isIdentifier(n.left) && n.left.text === name\n && !this.rustWriteDictShape(this.typeOfNodeIfAny(n.right))) {\n safe = false;\n return RUST_WALK_STOP;\n }\n });\n return safe;\n }\n\n // `this.` receivers: the field is a plain dict (object-shaped checker type, or held as one\n // by the hand-written base when the TS declaration is `any`) and no `this. = …` in the\n // method assigns another shape. Handle fields (cache/client/subscriptions/order book) are excluded.\n rustFieldStaysDict(baseExpr, fieldName: string): boolean {\n if (RustTranspiler.RUST_TAGGED_HANDLE_FIELDS.has(fieldName)\n || (!this.rustWriteDictShape(this.typeOfNodeIfAny(baseExpr))\n && !RustTranspiler.RUST_PLAIN_DICT_FIELDS.has(fieldName))) {\n return false;\n }\n const scope = this.rustEnclosingFunction(baseExpr);\n if (scope === undefined) {\n return false;\n }\n let safe = true;\n this.rustWalkScope(scope, (n) => {\n if (isBinaryExpression(n) && n.operatorToken.kind === SyntaxKind.EqualsToken\n && isPropertyAccessExpression(n.left) && n.left.expression.kind === SyntaxKind.ThisKeyword\n && n.left.name?.text === fieldName\n && !this.rustWriteDictShape(this.typeOfNodeIfAny(n.right))) {\n safe = false;\n return RUST_WALK_STOP;\n }\n });\n return safe;\n }\n\n // A parameter the checker proves is a plain dict (`Dict`, `Dictionary`,\n // a `Market`-style alias — the proof B-25's native reads use) whose every\n // write in the body keeps that shape: an object literal with no runtime tag\n rustParamStaysPlainDict(declaration: ParameterDeclaration): boolean {\n if (declaration.type === undefined || declaration.name?.kind !== SyntaxKind.Identifier) {\n return false;\n }\n const type = this.getCheckedTypeOf(declaration.type);\n const scope = this.rustEnclosingFunction(declaration);\n if (type === undefined || !this.isProvenMapType(type) || scope === undefined) {\n return false;\n }\n const name = String((declaration.name as Identifier).text);\n let plain = true;\n this.rustWalkScope(scope, (n) => {\n if (isBinaryExpression(n) && rustIsAssignmentOperator(n.operatorToken.kind)\n && isIdentifier(n.left) && n.left.text === name\n && !this.rustPlainDictPreservingRhs(n.right, name)) {\n plain = false;\n return RUST_WALK_STOP;\n }\n if (isBinaryExpression(n) && n.operatorToken.kind === SyntaxKind.EqualsToken\n && isArrayLiteralExpression(n.left)\n && n.left.elements.some((e) => isIdentifier(e) && String((e as Identifier).text) === name)\n && !this.rustHandlerTupleCall(n.right)) {\n plain = false; // a tuple write keeps only the handle-arg family\n return RUST_WALK_STOP;\n }\n });\n return plain;\n }\n\n /** RHS of a write to a plain-dict parameter that keeps the shape. */\n rustPlainDictPreservingRhs(node: Node, name: string): boolean {\n // `this.handle…(…)` returns its own dict arguments (rust-12's proof).\n if (this.rustPlainDictLiteral(node) || this.rustTypeIsUndefinedish(node)\n || (isIdentifier(node) && node.text === name) || this.rustHandlerTupleCall(node)) {\n return true;\n }\n if (isParenthesizedExpression(node) || isNonNullExpression(node) || isAsExpression(node)) {\n return this.rustPlainDictPreservingRhs(node.expression, name);\n }\n if (isConditionalExpression(node)) {\n return this.rustPlainDictPreservingRhs(node.whenTrue, name)\n && this.rustPlainDictPreservingRhs(node.whenFalse, name);\n }\n if (isBinaryExpression(node)\n && (node.operatorToken.kind === SyntaxKind.BarBarToken\n || node.operatorToken.kind === SyntaxKind.QuestionQuestionToken)) {\n return this.rustPlainDictPreservingRhs(node.left, name)\n && this.rustPlainDictPreservingRhs(node.right, name);\n }\n return false;\n }\n\n // Conservative \"argument position expects a Value\" bool test — the same set\n // ccxt's wrapBoolValueArgs pass uses on the helper call's value operand.\n rustPrintedBoolArg(raw: string): boolean {\n let s = raw.trim();\n while (s.startsWith('(') && s.endsWith(')')) {\n let depth = 0;\n let balanced = true;\n for (let k = 0; k < s.length; k++) {\n if (s[k] === '(') depth++;\n else if (s[k] === ')') { depth--; if (depth === 0 && k < s.length - 1) { balanced = false; break; } }\n }\n if (!balanced || depth !== 0) break;\n s = s.slice(1, -1).trim();\n }\n if (s.startsWith('!')) s = s.slice(1).trim();\n return RustTranspiler.RUST_BOOL_VALUE_HELPERS.some(fn => s.startsWith(fn + '('));\n }\n\n // `negate(&Value::Int(n))` is `Value::Int(-n)` (same for Float) — fold the\n // literal so no helper call is needed. Runtime `negate` also coerces\n // strings/bools/floats, so only Int/Float literals can be folded.\n foldNegateLiteral(operandText: string): string | undefined {\n const match = operandText.match(/^Value::(Int|Float)\\((-?)(\\d[\\d_]*(?:\\.\\d+)?(?:[eE][+-]?\\d+)?)\\)$/);\n // leave big literals to the runtime helper\n if (!match || match[3].replaceAll('_', '').replace('.', '').length > 18) {\n return undefined;\n }\n const sign = match[2] === '-' ? '' : '-';\n return `Value::${match[1]}(${sign}${match[3]})`;\n }\n\n // Ensure a & ref prefix — skip only if already a reference\n ensureRef(expr: string): string {\n return expr.startsWith('&') ? expr : `&${expr}`;\n }\n\n // TS `number` / number-literal type proof for a comparison operand. Unions\n // (`number | undefined`) and `any` are rejected — those keep the helper.\n isNumberTyped(node) {\n const type = this.getChecker().getTypeAtLocation(node);\n return type !== undefined && (type.flags & (TypeFlags.Number | TypeFlags.NumberLiteral)) !== 0;\n }\n\n // Positions whose emitted Rust is a native `bool`: if/while/do/for\n // conditions, `? :` conditions, `!` operands and `&&` / `||` operands.\n // Parentheses are transparent.\n isBooleanPosition(node) {\n let current = node;\n let parent = current.parent;\n while (parent !== undefined && isParenthesizedExpression(parent)) {\n current = parent;\n parent = parent.parent;\n }\n if (parent === undefined) {\n return false;\n }\n switch (parent.kind) {\n case SyntaxKind.IfStatement:\n case SyntaxKind.WhileStatement:\n case SyntaxKind.DoStatement:\n return parent.expression === current;\n case SyntaxKind.ForStatement:\n case SyntaxKind.ConditionalExpression:\n return parent.condition === current;\n case SyntaxKind.PrefixUnaryExpression:\n return parent.operator === SyntaxKind.ExclamationToken;\n case SyntaxKind.BinaryExpression:\n return parent.operatorToken.kind === SyntaxKind.AmpersandAmpersandToken ||\n parent.operatorToken.kind === SyntaxKind.BarBarToken;\n }\n return false;\n }\n\n // `is_less_than` & co. compare two `Value`s and answer `false` for\n // non-numbers; with both operands checker-typed numbers the same f64\n // comparison runs natively on `Value::as_f64()` unwraps.\n printNativeNumericComparison(node, operator, leftText, rightText) {\n const unwrap = (text: string) => `${text}.as_f64().unwrap_or(f64::NAN)`;\n const comparison = `${unwrap(leftText)} ${operator} ${unwrap(rightText)}`;\n // Conditions/logical operands already expect a bool; every other\n // position stores the result in a `Value`, so box it as before.\n return this.isBooleanPosition(node) ? comparison : `Value::Bool(${comparison})`;\n }\n\n // How numeric an ordered-comparison operand is: 'definite' (numeric\n // literal / `.length` / `indexOf` — Int/Float at runtime, never Null),\n // 'number' (checker-typed — Int, Float or Null, never a string), undefined.\n rustNumericOperandKind(node): string | undefined {\n const inner = this.orderedComparisonOperand(node);\n // `.length` prints through printArrayLength (`Value::Int(len)` or `get_array_length`),\n // `.indexOf(x)` through printIndexOfCall (`get_index_of`): always `Value::Int`.\n if (inner.kind === SyntaxKind.NumericLiteral\n || (isPropertyAccessExpression(inner) && inner.name.text === 'length')\n || (inner.kind === SyntaxKind.CallExpression && this.callExpressionName(inner) === 'indexOf')) {\n return 'definite';\n }\n return this.isNumberTyped(node) ? 'number' : undefined;\n }\n\n // Parens and `x as T` print as the operand itself (printAsExpression drops\n // the assertion), so the operand's own shape drives the emission.\n orderedComparisonOperand(node) {\n let inner = node;\n while (inner !== undefined && (isParenthesizedExpression(inner) || isAsExpression(inner))) {\n inner = inner.expression;\n }\n return inner;\n }\n\n // Native text for an `is_less_than`-family call, undefined unless the\n // operands prove the helper's answer: one number pins `<`/`>`; `>=`/`<=`\n // OR `is_equal` in (TRUE for two Nulls) and need a 'definite' operand.\n printNativeOrderedComparison(node, op, left, right): string | undefined {\n const operator = RustTranspiler.NATIVE_COMPARISON_OPERATORS[op];\n if (operator === undefined || !this.printsValueExpression(this.orderedComparisonOperand(left)) ||\n !this.printsValueExpression(this.orderedComparisonOperand(right))) {\n return undefined;\n }\n const leftKind = this.rustNumericOperandKind(left);\n const rightKind = this.rustNumericOperandKind(right);\n const ordered = op === SyntaxKind.LessThanToken || op === SyntaxKind.GreaterThanToken;\n const proven = leftKind === 'definite' || rightKind === 'definite' ||\n (ordered\n ? (leftKind !== undefined || rightKind !== undefined)\n : (leftKind === 'number' && rightKind === 'number'));\n if (!proven && !this.rustR16OrderedProven(op, left, right)) {\n return this.r22StrOrderedComparison(node, op, left, right) ?? this.r25NativeLooseOrderedComparison(node, op, left, right);\n }\n return this.printNativeNumericComparison(node, operator, this.printNode(left, 0), this.printNode(right, 0));\n }\n\n // ── native arithmetic (`+ - * /`) ────────────────────────────────────────\n // When the checker proves both operands are numbers (`Int`/`Float` at\n // runtime) or that one is always a string and the other a string or the\n // null the helper stringifies the same way, the helper call is replaced by\n // the arithmetic itself: a 4-arm `Value` match reproducing the helper's\n // Int/Float dispatch, `as_f64()` division, or a `format!` string concat.\n // Anything the checker cannot prove keeps the runtime helper.\n\n // `type` (or every member of a non-empty union) has exactly one of `flags`.\n rustTypeFlagsAll(type: any, flags: Set): boolean {\n if (!type) {\n return false;\n }\n if (type.flags === TypeFlags.Union && Array.isArray(typeParts(type))) {\n return typeParts(type).length > 0 && typeParts(type).every((member: any) => this.rustTypeFlagsAll(member, flags));\n }\n return flags.has(type.flags);\n }\n\n isNumberLikeType(type: any): boolean {\n return this.rustTypeFlagsAll(type, new Set([ TypeFlags.Number, TypeFlags.NumberLiteral ]));\n }\n\n isStringLikeType(type: any): boolean {\n return this.rustTypeFlagsAll(type, new Set([ TypeFlags.String, TypeFlags.StringLiteral ]));\n }\n\n // Types whose runtime value the `add` helper stringifies exactly as `format!` does: a string,\n // or `undefined`/`null` boxed as `Value::Null` (`stringify_simple(Value::Null)` and `Display`\n // both give \"null\"). `any` is absent — the Precise-dict branch has no `Display` equivalent.\n private static readonly RUST_CONCAT_SAFE_FLAGS = new Set([\n TypeFlags.String,\n TypeFlags.StringLiteral,\n TypeFlags.Undefined,\n TypeFlags.Null,\n ]);\n\n isStringOrNullishType(type: any): boolean {\n return this.rustTypeFlagsAll(type, RustTranspiler.RUST_CONCAT_SAFE_FLAGS);\n }\n\n // `Str` (`string | undefined`) operands concatenate natively only against an operand proven\n // ALWAYS a string: the helper then takes its string branch, which `format!` reproduces.\n // Without that anchor (`Str + Str`) the both-null case yields `Value::Null`, not \"nullnull\".\n isNativeStringConcatPair(leftType: any, rightType: any): boolean {\n return this.isStringOrNullishType(leftType) && this.isStringOrNullishType(rightType)\n && (this.isStringLikeType(leftType) || this.isStringLikeType(rightType));\n }\n\n // `(+|-)` with the left operand of `+=`/`-=`: assignment plus the same\n // native emission as the plain binary form.\n printNativeAssignmentArithmetic(op, left, right, leftText, rightText): string | undefined {\n const native = this.printNativeArithmetic(op, left, right, leftText, rightText);\n return native === undefined ? undefined : `${leftText} = ${native}`;\n }\n\n printNativeArithmetic(op, left, right, leftText, rightText): string | undefined {\n if (op === SyntaxKind.PercentToken) return this.printRustNativeMod(left, right, leftText, rightText) ?? this.rustR16NativeArithmetic(op, left, right, leftText, rightText);\n if (op !== SyntaxKind.PlusToken && op !== SyntaxKind.MinusToken &&\n op !== SyntaxKind.AsteriskToken && op !== SyntaxKind.SlashToken) {\n return undefined;\n }\n let leftType, rightType;\n try {\n const checker = this.getChecker();\n leftType = checker.getTypeAtLocation(left);\n rightType = checker.getTypeAtLocation(right);\n } catch (e) {\n return undefined;\n }\n const r09 = this.rustR09NativeAddSubtract(op, left, right, leftType, rightType, leftText, rightText); if (r09 !== undefined) return r09;\n const r16 = this.rustR16NativeArithmetic(op, left, right, leftText, rightText); if (r16 !== undefined) return r16;\n const r20 = this.r20NativeNumericAdd(op, left, right, leftText, rightText); if (r20 !== undefined) return r20;\n if (op === SyntaxKind.PlusToken && (this.isNativeStringConcatPair(leftType, rightType) || this.r17ConcatIsAnchored(left, right, leftType, rightType)\n || this.r22ConcatIsAnchored(left, right, leftType, rightType))) {\n return this.printNativeStringConcat(leftText, rightText);\n }\n if (!this.isNumberLikeType(leftType) || !this.isNumberLikeType(rightType)) {\n return this.r25NativeCoercingArithmetic(op, left, right, leftText, rightText);\n }\n return this.printNativeNumeric(op, leftText, rightText);\n }\n\n printNativeStringConcat(leftText: string, rightText: string): string {\n return `Value::Str(format!(\"{}{}\", ${leftText}, ${rightText}).into())`;\n }\n\n // Both operands are `Int`/`Float` at runtime; `-> Value::Null` covers the\n // `Null`/non-numeric values the same way the helper's fallthrough does.\n // Always parenthesised so it composes under `&`, in argument position and\n // as an operand of another native match.\n printNativeNumeric(op, leftText: string, rightText: string): string {\n const [ left, right ] = [ `(${leftText})`, `(${rightText})` ];\n if (op === SyntaxKind.SlashToken) {\n return `(match (${left}.as_f64(), ${right}.as_f64()) { (Some(x), Some(y)) if y != 0.0 => Value::Float(x / y), _ => Value::Null })`;\n }\n const sign = op === SyntaxKind.PlusToken ? '+' : (op === SyntaxKind.MinusToken ? '-' : '*');\n return `(match (&${left}, &${right}) {` +\n ` (Value::Int(x), Value::Int(y)) => Value::Int(x ${sign} y),` +\n ` (Value::Int(x), Value::Float(y)) => Value::Float(*x as f64 ${sign} *y),` +\n ` (Value::Float(x), Value::Int(y)) => Value::Float(*x ${sign} *y as f64),` +\n ` (Value::Float(x), Value::Float(y)) => Value::Float(x ${sign} y),` +\n ` _ => Value::Null })`;\n }\n\n private static readonly RUST_TYPEOF_HELPERS = new Map([\n ['string', 'is_string'], ['number', 'is_number'], ['boolean', 'is_bool'], ['object', 'is_object'], ['function', 'is_function'],\n ]);\n\n printCustomBinaryExpressionIfAny(node, identation) {\n const { left, right } = node;\n const op = node.operatorToken.kind;\n const isAssign = op === SyntaxKind.EqualsToken;\n // Array destructuring reassignment: [a, b] = expr → bind once, reassign each\n if (isAssign && left.kind === SyntaxKind.ArrayLiteralExpression) {\n const tmpName = '__destr_tmp';\n const rhs = this.printNode(right, 0);\n const nativeList = this.rustNativeListSource(right);\n const assignments = left.elements.map((e, idx) => `${this.printNode(e, 0)} = ${nativeList\n ? this.printNativeListIndex(tmpName, idx) : `get_value(&${tmpName}, &Value::Int(${idx}))`}`).join('; ');\n return `{ let ${tmpName} = ${rhs}; ${assignments}; }`;\n }\n // Element access assignment: a[b] = v → add_element_to_object(&mut a, &b, v)\n if (isAssign && left.kind === SyntaxKind.ElementAccessExpression) {\n const keys: any[] = [];\n let baseExpr: any = left;\n while (isElementAccessExpression(baseExpr)) {\n keys.unshift(baseExpr.argumentExpression);\n baseExpr = baseExpr.expression;\n }\n let acc = `&mut ${this.printNode(baseExpr, 0)}`;\n const keyStrs = keys.map(k => this.printNode(k, 0));\n for (const key of keyStrs.slice(0, -1)) acc = `get_value_mut(${acc}, &${key})`;\n const rhs = this.printNode(right, 0);\n const nativeInsert = keyStrs.length === 1 ? (this.printNativeDictInsert(baseExpr, keys[0], keyStrs[0], rhs) ?? this.rustR01NativeDictInsert(baseExpr, keys[0], keyStrs[0], rhs)) : undefined;\n return nativeInsert ?? `add_element_to_object(${acc}, &${keyStrs[keyStrs.length - 1]}, ${rhs})`;\n }\n // typeof comparisons\n if (left.kind === SyntaxKind.TypeOfExpression) {\n const rightText = right.text;\n const target = this.printNode(left.expression, 0);\n const isDiff = op === SyntaxKind.ExclamationEqualsEqualsToken || op === SyntaxKind.ExclamationEqualsToken;\n const native = this.nativeValuePredicateText(rightText, left.expression, target);\n if (native !== undefined) {\n const negated = isDiff ? `!${native}` : native;\n // Conditions/logical operands expect a bool; other positions store a boxed `Value`.\n return this.isBooleanPosition(node) ? negated : `Value::Bool(${negated})`;\n }\n const helper = RustTranspiler.RUST_TYPEOF_HELPERS.get(rightText);\n if (helper !== undefined) return `${isDiff ? '!' : ''}${helper}(&${target})`;\n }\n // `in` — wrapped as Value so it composes in any context\n if (op === SyntaxKind.InKeyword) {\n const shadow = this.rustParamShadowOf(right);\n return (shadow !== undefined ? this.printShadowInOperator(shadow, left) : undefined)\n ?? this.printNativeInOperator(left, right) ?? this.r18LiteralInOp(left, right) ?? this.r05InOp(left, right)\n ?? `Value::Bool(in_op(&${this.printNode(right, 0)}, &${this.printNode(left, 0)}))`;\n }\n // `+=` / `-=` on regular variables\n if ((op === SyntaxKind.PlusEqualsToken || op === SyntaxKind.MinusEqualsToken) && left.kind !== SyntaxKind.ElementAccessExpression) {\n const isPlus = op === SyntaxKind.PlusEqualsToken;\n const leftText = this.printNode(left, 0);\n const rightText = this.printNode(right, 0);\n return this.printNativeAssignmentArithmetic(isPlus ? SyntaxKind.PlusToken : SyntaxKind.MinusToken, left, right, leftText, rightText)\n ?? `${leftText} = ${isPlus ? 'add' : 'subtract'}(&${leftText}, &${rightText})`;\n }\n // Native equality on unwrapped payloads when the checker proves the variants line up\n // (see printNativeEqualityComparison); the bool is boxed like the other Value helpers.\n if (op === SyntaxKind.EqualsEqualsToken || op === SyntaxKind.EqualsEqualsEqualsToken ||\n op === SyntaxKind.ExclamationEqualsToken || op === SyntaxKind.ExclamationEqualsEqualsToken) {\n const nativeEquality = this.printNativeEqualityComparison(left, right, op);\n if (nativeEquality) return `Value::Bool(${nativeEquality})`;\n }\n // A logical expression with a native-compare operand no longer starts with a bool helper: box it.\n if ((op === SyntaxKind.AmpersandAmpersandToken || op === SyntaxKind.BarBarToken)\n && (this.hasNativeComparisonOperand(left) || this.hasNativeComparisonOperand(right))) {\n return `Value::Bool(${this.printLogicalInBooleanContext(node)})`;\n }\n // Binary wrapper functions (is_equal, add, etc.) - add & to both sides\n if (op in this.binaryExpressionsWrappers) {\n const nativeCompare = RustTranspiler.NATIVE_COMPARISON_OPERATORS[op] !== undefined\n ? this.printNativeOrderedComparison(node, op, left, right) : undefined;\n if (nativeCompare !== undefined) return nativeCompare;\n const [fnName, close] = this.binaryExpressionsWrappers[op];\n const leftText = this.printNode(left, 0);\n const rightText = this.printNode(right, 0);\n return this.printNativeArithmetic(op, left, right, leftText, rightText)\n ?? `${fnName}${this.ensureRef(leftText)}, ${this.ensureRef(rightText)}${close}`;\n }\n return undefined;\n }\n\n printBinaryExpression(node, identation) {\n return this.printCustomBinaryExpressionIfAny(node, identation) || super.printBinaryExpression(node, identation);\n }\n\n // `Date.now()` → runtime helper returning current epoch millis.\n printDateNowCall(node, identation) {\n return 'date_now()';\n }\n\n // `str.padStart(len, pad)` / `str.padEnd(len, pad)` → runtime helpers `(&Value, &Value, &Value)`.\n printPadStartCall(node, identation, name, parsedArg, parsedArg2) {\n return this.printNativeStringPadStart(node, name) ?? `pad_start(${this.ensureRef(name)}, ${this.ensureRef(parsedArg)}, ${this.ensureRef(parsedArg2)})`;\n }\n\n printPadEndCall(node, identation, name, parsedArg, parsedArg2) {\n return `pad_end(${this.ensureRef(name)}, ${this.ensureRef(parsedArg)}, ${this.ensureRef(parsedArg2)})`;\n }\n\n printVariableDeclarationList(node, identation) {\n const declaration = node.declarations[0];\n const indent = this.getIden(identation);\n if (declaration?.name.kind === SyntaxKind.ArrayBindingPattern) {\n const parsedElements = declaration.name.elements.map(e => this.printNode(e.name, 0));\n const syntheticName = parsedElements.join('') + 'Variable';\n const head = `${indent}let mut ${syntheticName} = ${this.printNode(declaration.initializer, 0)};\\n`;\n const nativeList = this.rustNativeListSource(declaration.initializer);\n const lines = parsedElements.map((e, idx) => `${indent}let mut ${e}: Value = ${nativeList\n ? this.printNativeListIndex(syntheticName, idx) : `get_value(&${syntheticName}, &Value::Int(${idx}))`}`);\n return head + lines.join(';\\n');\n }\n const varName = this.printNode(declaration.name, 0);\n if (!declaration.initializer) {\n return `${indent}let mut ${varName}: Value = Value::Null`;\n }\n const parsedValue = this.printNode(declaration.initializer, identation).trim();\n if (declaration.initializer.kind === SyntaxKind.NewExpression) {\n return `${indent}let mut ${varName} = ${parsedValue}`;\n }\n if (node.declarations.length === 1 && this.rustVecLocalIsTyped(declaration)) return `${indent}let mut ${varName}: Vec = Vec::new()`;\n const boolValue = this.getRustBoolLocalInitializer(declaration, parsedValue);\n if (boolValue !== undefined) {\n return `${indent}let mut ${varName}: bool = ${boolValue}`;\n }\n const typedStr = this.rustSafeStringLocalIsTyped(declaration);\n const nativeStr = this.rustNativeStrCalleeKind(declaration.initializer) === 'str';\n if (typedStr) {\n // A native-`Option` callee already carries the payload; `safeString` helpers need the unwrap.\n return `${indent}let mut ${varName}: Option = ${parsedValue}${nativeStr ? '' : '.as_str().map(str::to_owned)'}`;\n }\n // A callee returning `Option` into a boxed local keeps the box.\n return `${indent}let mut ${varName}: Value = ${nativeStr ? this.rustNativeStrValueBox(parsedValue) : parsedValue}`;\n }\n\n // ── native-typed locals ───────────────────────────────────────────────────\n //\n // A local is declared `bool` (instead of `Value`) when its initializer is\n // already a bool-valued Rust expression and every use is a condition sink\n // (`is_true(&x)`) — the one sink that accepts a native bool today.\n //\n // `is_true` is generic over `IsTruthy` (impl for `bool`/`&bool` in\n // runtime.rs); every other sink takes `&Value`, so any other use keeps the\n // local boxed. Bools come in two shapes: helpers whose Rust return type is\n // already `bool` (below), and the printer's own `Value::Bool(...)` box,\n // which the declaration drops at the init site.\n\n private static readonly RUST_BOOL_RESULT_HELPERS = new Set([\n 'is_true', 'is_equal', 'is_greater_than', 'is_greater_than_or_equal',\n 'is_less_than', 'is_less_than_or_equal', 'is_array', 'is_object',\n 'is_string', 'is_number', 'is_bool', 'is_integer', 'is_function',\n 'is_instance', 'starts_with', 'ends_with', 'in_op', 'contains',\n ]);\n\n // Hand-written Rust fns outside `runtime.rs` with a `-> bool` signature, keyed by the TS callee\n // name (verified in `rust/tests/src/tests_support.rs`). A call is already a Rust bool, so the\n // condition printer's `is_true(&…)` wrapper is the identity (`IsTruthy for bool`) and is dropped.\n private static readonly RUST_BOOL_RESULT_CALLEES = new Set([\n 'tickerExceptionNeedsOhlcv',\n ]);\n\n // Call to a hand-written `-> bool` fn: the checker must agree the TS call\n // is boolean-typed and the callee must be in the verified table above.\n rustCallPrintsBool(node): boolean {\n if (node?.kind !== SyntaxKind.CallExpression) {\n return false;\n }\n const callee: any = node.expression;\n const name = callee?.kind === SyntaxKind.Identifier ? callee.text\n : callee?.kind === SyntaxKind.PropertyAccessExpression ? callee.name?.text : undefined;\n return name !== undefined && RustTranspiler.RUST_BOOL_RESULT_CALLEES.has(name) && this.rustTypeIsBoolean(node);\n }\n\n // Index just past the `\"...\"` literal opening at `i` (escapes skipped).\n private rustSkipStringLiteral(text: string, i: number): number {\n for (i++; i < text.length && text[i] !== '\"'; i++) {\n if (text[i] === '\\\\') i++;\n }\n return i;\n }\n\n // `)` spanning the whole printed value → ``. The payload is\n // only reachable this way: the printer prints the value, not its parts.\n peelValueBox(printedValue: string, prefix: string): string | undefined {\n if (!printedValue.startsWith(prefix) || !printedValue.endsWith(')')) {\n return undefined;\n }\n let depth = 0;\n for (let i = prefix.length - 1; i < printedValue.length; i++) {\n const char = printedValue[i];\n if (char === '\"') i = this.rustSkipStringLiteral(printedValue, i);\n else if (char === '(') depth++;\n else if (char === ')' && --depth === 0) {\n return i === printedValue.length - 1 ? printedValue.slice(prefix.length, i) : undefined;\n }\n }\n return undefined;\n }\n\n // `Value::Bool()` spanning the whole expression → ``.\n peelValueBoolBox(printedValue: string): string | undefined {\n return this.peelValueBox(printedValue, 'Value::Bool(');\n }\n\n // `Value::Str()` spanning the whole expression → `` (a String).\n peelValueStrBox(printedValue: string): string | undefined {\n return this.peelValueBox(printedValue, 'Value::Str(');\n }\n\n // `((expr))` → `expr` — a redundant layer kept from the TS source; the\n // right-hand side of a declaration binds the whole expression anyway.\n stripOuterParens(printedValue: string): string {\n let value = printedValue.trim();\n while (value.startsWith('(') && value.endsWith(')')) {\n let depth = 0;\n let closesAtEnd = true;\n for (let i = 0; i < value.length && closesAtEnd; i++) {\n const char = value[i];\n if (char === '\"') i = this.rustSkipStringLiteral(value, i);\n else if (char === '(') depth++;\n else if (char === ')' && --depth === 0 && i !== value.length - 1) closesAtEnd = false;\n }\n if (!closesAtEnd || depth !== 0) break;\n value = value.slice(1, -1).trim();\n }\n return value;\n }\n\n // `is_equal(...)` / `!is_true(...)` / `contains(...)` — bare bool helper calls.\n printedBoolHelperCall(printedValue: string): boolean {\n const stripped = printedValue.startsWith('!') ? printedValue.slice(1).trim() : printedValue;\n const match = /^([a-z_][a-z0-9_]*)\\(/.exec(stripped);\n return match !== null && RustTranspiler.RUST_BOOL_RESULT_HELPERS.has(match[1]);\n }\n\n // Source shapes the printer turns into a bool: comparisons, `&&`/`||`\n // (each operand is is_true-wrapped), `!`, `in`, `instanceof`, true/false.\n rustNodeIsBoolExpression(node): boolean {\n switch (node?.kind) {\n case SyntaxKind.TrueKeyword:\n case SyntaxKind.FalseKeyword:\n return true;\n case SyntaxKind.ParenthesizedExpression:\n return this.rustNodeIsBoolExpression(node.expression);\n case SyntaxKind.PrefixUnaryExpression:\n return node.operator === SyntaxKind.ExclamationToken;\n case SyntaxKind.BinaryExpression: {\n const kind = node.operatorToken.kind;\n return (RustTranspiler as any).COMPARISON_OPS.has(kind) || kind === SyntaxKind.AmpersandAmpersandToken\n || kind === SyntaxKind.BarBarToken || kind === SyntaxKind.InKeyword || kind === SyntaxKind.InstanceOfKeyword;\n }\n }\n return false;\n }\n\n rustTypeIsBoolean(node): boolean {\n try {\n const type = this.getChecker().getTypeAtLocation(node);\n return (type.flags & TypeFlags.BooleanLike) !== 0 || this.getChecker().typeToString(type).trim() === 'boolean';\n } catch (e) {\n return false; // no checker type → keep the boxed form\n }\n }\n\n rustTypeIsString(node): boolean {\n const checker: any = this.checkerOrUndefined();\n // no checker type → keep the boxed form\n return checker !== undefined && this.isStringLikeType(checker.getTypeAtLocation(node));\n }\n\n rustEnclosingFunction(node) {\n for (let current = node?.parent; current; current = current.parent) {\n switch (current.kind) {\n case SyntaxKind.MethodDeclaration:\n case SyntaxKind.FunctionDeclaration:\n case SyntaxKind.FunctionExpression:\n case SyntaxKind.ArrowFunction:\n case SyntaxKind.Constructor:\n case SyntaxKind.SourceFile:\n return current;\n }\n }\n return undefined;\n }\n\n rustBindsName(node, name: string): boolean {\n switch (node?.kind) {\n case SyntaxKind.VariableDeclaration:\n case SyntaxKind.Parameter:\n case SyntaxKind.FunctionDeclaration:\n case SyntaxKind.ClassDeclaration:\n case SyntaxKind.PropertyDeclaration:\n case SyntaxKind.FunctionExpression:\n case SyntaxKind.ArrowFunction:\n return node.name?.kind === SyntaxKind.Identifier && node.name.text === name;\n }\n return false;\n }\n\n // Only these uses compile against a native `bool` local today: `is_true(&x)`\n // (under any depth of `(...)`, `!`, `&&`/`||`), and the condition slot of\n // if/while/for/ternary — all printed is_true-wrapped.\n rustIdentifierUseIsCondition(node): boolean {\n for (let current: any = node, parent: any = node.parent; parent; current = parent, parent = parent.parent) {\n switch (parent.kind) {\n case SyntaxKind.ParenthesizedExpression:\n if (parent.expression !== current) return false;\n break;\n case SyntaxKind.PrefixUnaryExpression:\n if (parent.operator !== SyntaxKind.ExclamationToken || parent.operand !== current) return false;\n break;\n case SyntaxKind.BinaryExpression:\n if (parent.operatorToken.kind !== SyntaxKind.AmpersandAmpersandToken\n && parent.operatorToken.kind !== SyntaxKind.BarBarToken) return false;\n break;\n case SyntaxKind.IfStatement:\n case SyntaxKind.WhileStatement:\n case SyntaxKind.DoStatement:\n return parent.expression === current;\n case SyntaxKind.ForStatement:\n case SyntaxKind.ConditionalExpression:\n return parent.condition === current;\n default:\n return false;\n }\n }\n return false;\n }\n\n // Visits every in-scope use of the local `name` declared by `declaration`: false as soon as the\n // name is re-bound in scope or `acceptUse(identifier)` rejects a use. `skipPropertyNames` leaves\n // `x.foo` / `{ foo }` names out of the uses.\n private rustLocalUsesAll(declaration, name: string, skipPropertyNames: boolean, acceptUse: (n) => boolean): boolean {\n const scope = this.rustEnclosingFunction(declaration);\n if (scope === undefined || name === undefined) {\n return false;\n }\n let safe = true;\n for (const n of this.rustScopeNameNodes(scope, name) as any[]) {\n if (n !== declaration && this.rustBindsName(n, name)) {\n safe = false; // a second binding of the name in scope — stay boxed\n break;\n }\n if (n.kind === SyntaxKind.Identifier && n !== declaration.name\n && !(skipPropertyNames && this.rustIdentifierIsPropertyName(n)) && !acceptUse(n)) {\n safe = false;\n break;\n }\n }\n return safe;\n }\n\n rustLocalUsesAcceptBool(declaration, sourceName: string): boolean {\n return this.rustLocalUsesAll(declaration, sourceName, false, (n) => this.rustIdentifierUseIsCondition(n));\n }\n\n // Typed string locals: `let x: Value = self.safeString(..)` is declared `Option` when\n // the checker proves a string and every use is a native sink (`x.is_none()`, `x.as_deref() ==\n // Some(\"lit\")`). The helper's Value is unwrapped with `.as_str()`; any other sink keeps the box.\n\n private static readonly RUST_STRING_LOCAL_HELPERS = new Set([\n 'safeString', 'safeString2', 'safeStringN',\n 'safeStringLower', 'safeStringLower2', 'safeStringLowerN',\n 'safeStringUpper', 'safeStringUpper2', 'safeStringUpperN',\n ]);\n\n private rustStringLocalDecisions = new Map();\n\n // `let x = this.safeString(..)` / `safeString(..)` — the whole initializer;\n // a call whose callee already returns `Option` (a native-`Str`\n // method) is the same payload without the unwrap.\n rustSafeStringLocalInitializer(declaration): boolean {\n const initializer = declaration.initializer;\n if (declaration.name?.kind !== SyntaxKind.Identifier || initializer?.kind !== SyntaxKind.CallExpression) {\n return false;\n }\n if (this.rustNativeStrCalleeKind(initializer) === 'str') {\n return true;\n }\n const callee = initializer.expression;\n const helpers = RustTranspiler.RUST_STRING_LOCAL_HELPERS;\n if (callee?.kind === SyntaxKind.PropertyAccessExpression) {\n return callee.expression?.kind === SyntaxKind.ThisKeyword && helpers.has(callee.name.text);\n }\n return callee?.kind === SyntaxKind.Identifier && helpers.has(callee.text);\n }\n\n // The two uses that compile against an `Option` local and print\n // natively: `x ==/!= null|undefined` and `x ==/!= \"lit\"`.\n rustStringLocalUseIsNative(node): boolean {\n const parent = node.parent;\n if (parent?.kind !== SyntaxKind.BinaryExpression) {\n return false;\n }\n const op = parent.operatorToken.kind;\n if (op !== SyntaxKind.EqualsEqualsToken && op !== SyntaxKind.EqualsEqualsEqualsToken\n && op !== SyntaxKind.ExclamationEqualsToken && op !== SyntaxKind.ExclamationEqualsEqualsToken) {\n return false;\n }\n const other = parent.left === node ? parent.right : (parent.right === node ? parent.left : undefined);\n if (other === undefined) {\n return false;\n }\n const otherLiteral = this.literalKindOfNode(other);\n // The string-literal compare prints as `.as_deref() == Some(\"lit\")`;\n // the printer's own rejections (replacement tokens) must match.\n return otherLiteral === 'null' || (otherLiteral === 'string' && !(other.text in this.StringLiteralReplacements));\n }\n\n // Every use compiles against `Option`, and at least one native sink\n // consumes it (otherwise the retype buys nothing).\n rustSafeStringLocalIsTyped(declaration): boolean {\n const cached = this.rustStringLocalDecisions.get(declaration);\n if (cached !== undefined) {\n return cached;\n }\n this.rustStringLocalDecisions.set(declaration, false); // re-entrancy guard\n const decision = this.rustSafeStringLocalIsTypedUncached(declaration);\n this.rustStringLocalDecisions.set(declaration, decision);\n return decision;\n }\n\n rustSafeStringLocalIsTypedUncached(declaration): boolean {\n if (!this.rustSafeStringLocalInitializer(declaration)\n || this.primitiveKindOfType(this.typeOfNodeIfAny(declaration.name)) !== 'string') {\n return false;\n }\n let nativeUses = 0;\n const safe = this.rustLocalUsesAll(declaration, declaration.name.text, true,\n (n) => this.rustStringLocalUseIsNative(n) && ++nativeUses > 0);\n return safe && nativeUses > 0;\n }\n\n // `x.foo` / `{ foo: 1 }` — a property name is not a use of the local.\n rustIdentifierIsPropertyName(node): boolean {\n const parent = node.parent;\n switch (parent?.kind) {\n case SyntaxKind.PropertyAccessExpression:\n case SyntaxKind.PropertyAssignment:\n case SyntaxKind.PropertySignature:\n case SyntaxKind.ShorthandPropertyAssignment:\n return parent.name === node;\n }\n return false;\n }\n\n // Is this identifier occurrence bound to a typed string local?\n rustStringLocalIdentifierIsTyped(node): boolean {\n const checker: any = node?.kind === SyntaxKind.Identifier ? this.checkerOrUndefined() : undefined;\n if (checker === undefined) {\n return false;\n }\n const symbol = checker.getSymbolAtLocation(node);\n const declaration = symbolValueDeclaration(symbol) ?? symbolDeclarations(symbol)[0];\n return declaration?.kind === SyntaxKind.VariableDeclaration && this.rustSafeStringLocalIsTyped(declaration);\n }\n\n // `let x = ` → the printed bool expression, or undefined.\n getRustBoolLocalInitializer(declaration, printedValue: string): string | undefined {\n const initializer = declaration.initializer;\n if (initializer === undefined || declaration.name?.kind !== SyntaxKind.Identifier) {\n return undefined;\n }\n const inner = this.stripOuterParens(printedValue);\n const peeled = this.peelValueBoolBox(inner);\n if (peeled === undefined && !this.printedBoolHelperCall(inner) && !this.rustNodeIsBoolExpression(initializer)) {\n return undefined;\n }\n if (!this.rustTypeIsBoolean(initializer) || !this.rustLocalUsesAcceptBool(declaration, declaration.name.text)) {\n return undefined;\n }\n return peeled ?? inner;\n }\n\n // ── native `Option` returns (`: Str` methods) ─────────────────────\n //\n // An internal, non-override, non-async method declared `: Str`\n\n private rustNativeStrReturnDecisions = new WeakMap();\n\n // `ts/src/base/**` — the shared `Exchange` / `PredictionExchange` classes\n // (the transpiler synthesises variants like `.__ExchangeNoOverloads.ts`).\n private static readonly RUST_BASE_TIER_FILE = /ts[\\\\/]src[\\\\/]base[\\\\/]/;\n\n /** `'str'` when the method is emitted `-> Option`, else undefined. */\n rustNativeStrReturnKind(node: Node): string | undefined {\n if (node === undefined || node.kind !== SyntaxKind.MethodDeclaration) {\n return undefined;\n }\n let decision = this.rustNativeStrReturnDecisions.get(node);\n if (decision === undefined) {\n this.rustNativeStrReturnDecisions.set(node, false); // re-entrancy guard\n decision = this.rustNativeStrReturnDecisionUncached(node);\n this.rustNativeStrReturnDecisions.set(node, decision);\n }\n return decision ? 'str' : undefined;\n }\n\n private rustMethodOverrides = new WeakMap();\n private rustClassAncestorTables = new WeakMap[] | null>();\n\n /** Per ancestor class (nearest first): method name -> its LAST declaration; undefined when a\n * parent class does not resolve. */\n private rustAncestorMethodTables(classDecl: Node): Map[] | undefined {\n const cached = this.rustClassAncestorTables.get(classDecl);\n if (cached !== undefined) {\n return cached ?? undefined;\n }\n const chain: Map[] = [];\n let parentClass = getAllSuperTypeNodes(classDecl)[0];\n let ok = true;\n while (parentClass !== undefined) {\n const parentClassDecl = this.getChecker().getTypeAtLocation(parentClass)?.getSymbol()?.valueDeclaration?.resolve();\n if (parentClassDecl === undefined) {\n ok = false;\n break;\n }\n const byName = new Map();\n for (const elem of (parentClassDecl as any).members ?? []) {\n if (isMethodDeclaration(elem)) {\n byName.set(elem.name.getText().trim(), elem);\n }\n }\n chain.push(byName);\n parentClass = getAllSuperTypeNodes(parentClassDecl)[0] ?? undefined;\n }\n this.rustClassAncestorTables.set(classDecl, ok ? chain : null);\n return ok ? chain : undefined;\n }\n\n // base getMethodOverride rescans every parent member (getText) per call; same walk, memoized\n getMethodOverride(node: Node): Node {\n if (node === undefined || !isClassDeclaration(node.parent) || !(node.parent as any).heritageClauses) {\n return undefined;\n }\n const cached = this.rustMethodOverrides.get(node);\n if (cached !== undefined) {\n return cached ?? undefined;\n }\n const chain = this.rustAncestorMethodTables(node.parent);\n let method = undefined;\n if (chain === undefined) {\n this.warn(node, \"Parent class\", \"Parent class not found\");\n } else {\n const name = (node as any).name.text;\n for (const byName of chain) {\n method = byName.get(name) ?? method;\n }\n }\n this.rustMethodOverrides.set(node, method ?? null);\n return method;\n }\n\n private rustNativeStrReturnDecisionUncached(node): boolean {\n // An override's base/trait copy prints `-> Value`. The base classes are hand-tuned across the\n // whole tree: their methods are called from ~every derived file (and the hand-written runtime),\n // where the boxed `Value` ABI is load-bearing. Only per-exchange\n if (node.type === undefined || this.isAsyncFunction(node) || this.getMethodOverride(node) !== undefined\n || RustTranspiler.RUST_BASE_TIER_FILE.test(node.getSourceFile().fileName)) {\n return false;\n }\n let type: Type;\n try {\n type = this.getChecker().getTypeFromTypeNode(node.type);\n } catch (e) {\n return false;\n }\n return this.primitiveKindOfType(type) === 'string' && this.rustStrReturnPathsConvert(node.body);\n }\n\n /** Every `return` of the method's own body converts, and the body's last\n * statement is one of them (so Rust sees no `()`-valued tail the\n * `-> Value` post-passes would have patched with `Value::Null`). */\n rustStrReturnPathsConvert(body: Block): boolean {\n const last = body?.statements[body.statements.length - 1];\n if (last === undefined || !isReturnStatement(last)) {\n return false;\n }\n let ok = true;\n const visit = (n: Node) => {\n if (!ok || (n !== body && isFunctionLike(n))) {\n return; // a nested function keeps the boxed signature\n }\n if (isReturnStatement(n) && !this.rustStrReturnValueConverts(n.expression)) {\n ok = false;\n return;\n }\n n.forEachChild(visit);\n };\n body.forEachChild(visit);\n return ok;\n }\n\n /** A `return` value of a native-`Str` method: a nullish literal, an\n * expression already printing an `Option` (a nested retyped call\n * or a typed string local), or a `Value`-printing expression the checker\n * types `string | undefined`. */\n rustStrReturnValueConverts(expression: Node): boolean {\n const inner = this.unwrapParensNode(expression);\n if (inner === undefined) {\n return false;\n }\n if (this.literalKindOfNode(inner) === 'null' || this.rustStrNativeExpression(inner)) {\n return true;\n }\n return this.printsValueExpression(inner) && this.primitiveKindOfType(this.getCheckedTypeOf(inner)) === 'string';\n }\n\n /** An expression that already prints an `Option` in a `: Str`\n * method's return position. */\n rustStrNativeExpression(expression: Node): boolean {\n const inner = this.unwrapParensNode(expression);\n if (inner !== undefined && isCallExpression(inner)) {\n return this.rustNativeStrCalleeKind(inner) === 'str';\n }\n return inner !== undefined && isIdentifier(inner) && this.rustStringLocalIdentifierIsTyped(inner);\n }\n\n unwrapParensNode(node: Node): Node | undefined {\n let current = node;\n while (current !== undefined && isParenthesizedExpression(current)) {\n current = current.expression;\n }\n return current;\n }\n\n /** The callee declaration behind `self.(..)` when it is emitted\n * `-> Option`; undefined otherwise (no proof → keep the box). */\n // call node -> resolved signature's declaration (null: none); a handle resolve per call is JS-heavy\n private rustCallDeclarations = new WeakMap();\n\n rustNativeStrCalleeKind(node: Node): string | undefined {\n if (node === undefined || node.kind !== SyntaxKind.CallExpression) {\n return undefined;\n }\n let declaration = this.rustCallDeclarations.get(node);\n if (declaration === undefined) {\n try {\n declaration = signatureDeclaration((this.getChecker() as any).getResolvedSignature(node)) ?? null;\n } catch (e) {\n return undefined;\n }\n this.rustCallDeclarations.set(node, declaration);\n }\n return declaration?.kind === SyntaxKind.MethodDeclaration ? this.rustNativeStrReturnKind(declaration) : undefined;\n }\n\n /** `Option` → `Value` (exact inverse of the return conversion). */\n rustNativeStrValueBox(text: string): string {\n return `${text}.map(|__s| Value::Str(__s.into())).unwrap_or(Value::Null)`;\n }\n\n /** True when a call to a native-`Str` callee must be boxed back to a\n * `Value` at this position; the declaration and return printers run the\n * conversion themselves. */\n rustNativeStrCallNeedsBox(node: Node): boolean {\n let current: any = node;\n let parent: any = current.parent;\n while (parent !== undefined && isParenthesizedExpression(parent) && parent.expression === current) {\n current = parent;\n parent = parent.parent;\n }\n if (parent === undefined) {\n return true;\n }\n if (isVariableDeclaration(parent) && parent.initializer === current && isIdentifier(parent.name)) {\n return false; // the declaration printer binds the type / boxes it\n }\n if (isReturnStatement(parent) && parent.expression === current) {\n // only a native-`Str` method's own return printer runs the conversion\n return this.rustNativeStrReturnKind(findAncestor(parent.parent, isFunctionLike) as any) !== 'str';\n }\n return true;\n }\n\n /** Wrap a call text when the callee returns a native `Option`\n * and the position still needs a `Value`. */\n rustBoxNativeStrCallIfNeeded(node: Node, text: string): string {\n return this.rustNativeStrCalleeKind(node) === 'str' && this.rustNativeStrCallNeedsBox(node)\n ? this.rustNativeStrValueBox(text) : text;\n }\n\n // ── declared-Dict locals (`let x: Value = self.safe_dict_k(..)`) ───────────\n //\n // The printer declares non-bool locals `Value`, and the checker types a\n\n private declaredDictLocalsCache: { src: SourceFile, table: Map } | undefined;\n\n /** All `let x: Value = ` declarations of the current\n * source file, keyed by local name in declaration order. */\n rustDeclaredDictLocals(): Map {\n const src = this.getSrc();\n if (this.declaredDictLocalsCache?.src !== src) {\n let table: Map;\n try {\n table = this.collectRustDeclaredDictLocals(src);\n } catch (e) {\n table = new Map(); // no proof -> consumers keep the helper\n }\n this.declaredDictLocalsCache = { src, table };\n }\n return this.declaredDictLocalsCache.table;\n }\n\n /** Printer hook for the helper-removal units: the proven kind of a declared\n * local, or undefined when the local is not proven Dict at every use.\n * Accepts the receiver node of the helper call (identifier, `x['k']` chain,\n * `this.x` chain) or the declaration itself. */\n rustDeclaredLocalTypeResolver(node: Node): RustDeclaredLocalKind | undefined {\n return this.rustDeclaredLocalEntry(node)?.kind;\n }\n\n /** The table entry a use site resolves to (the declaration whose binding the\n * use refers to, proven), or undefined. */\n rustDeclaredLocalEntry(node: Node): RustDeclaredDictLocalEntry | undefined {\n if (node === undefined) return undefined;\n const name = isVariableDeclaration(node) ? (node.name as Identifier).text : this.rootPlaceText(node);\n if (name === undefined) return undefined;\n const entries = this.rustDeclaredDictLocals().get(name);\n if (entries === undefined) return undefined;\n const start = node.getStart();\n const identifier = this.rustDeclaredLocalIdentifier(node);\n const symbol = identifier === undefined ? undefined : this.rustSymbolOf(identifier);\n let best: RustDeclaredDictLocalEntry | undefined;\n for (const entry of entries) {\n if (entry.start > start || !entry.alwaysDict || !entry.stable) continue;\n const scope = this.rustEnclosingFunction(entry.declaration);\n if (scope !== undefined && !this.isNodeInsideNode(node, scope)) continue;\n if (identifier !== undefined) {\n const entrySymbol = this.rustSymbolOf((entry.declaration.name as Identifier));\n if (symbol !== undefined && entrySymbol !== undefined && symbol !== entrySymbol) continue;\n }\n if (best === undefined || entry.start > best.start) best = entry;\n }\n return best;\n }\n\n /** The identifier at the head of a place (`x`, `x['k']`, `this.x` is not a\n * local) — the node the resolver matches against the table. */\n private rustDeclaredLocalIdentifier(node: Node): Identifier | undefined {\n let current: any = node;\n while (current !== undefined && !isIdentifier(current)) {\n if (isElementAccessExpression(current) || isPropertyAccessExpression(current)) {\n if (current.expression.kind === SyntaxKind.ThisKeyword) return undefined;\n } else if (!isParenthesizedExpression(current) && !isNonNullExpression(current)) {\n return undefined;\n }\n current = current.expression;\n }\n return current;\n }\n\n /** Binding symbol of an identifier, or undefined when the checker cannot\n * answer (ByContent probes without a class context, for instance). */\n private rustSymbolOf(node: Identifier): TsSymbol | undefined {\n return this.checkerOrUndefined()?.getSymbolAtLocation(node);\n }\n\n /** True when this identifier is a use of the given declaration's binding.\n * Without a checker answer the callers stay conservative (reject). */\n private rustIdentifierRefersToDeclaration(node: Identifier, declaration: VariableDeclaration): boolean {\n const symbol = this.rustSymbolOf(node);\n return symbol !== undefined && symbol === this.rustSymbolOf(declaration.name as Identifier);\n }\n\n /** Census of the current source file's table, for reports and tests. */\n rustDeclaredDictLocalCensus(): { declarators: number, dict: number, alwaysDict: number, kindUnstable: number, retypeEligible: number } {\n let declarators = 0, dict = 0, alwaysDict = 0, kindUnstable = 0, retypeEligible = 0;\n for (const entries of this.rustDeclaredDictLocals().values()) {\n for (const entry of entries) {\n declarators++;\n if (entry.alwaysDict) alwaysDict++;\n if (entry.alwaysDict && entry.stable) dict++;\n if (entry.alwaysDict && !entry.stable) kindUnstable++;\n // every later use is an element access or a kind-preserving\n // mutator -> the only uses a native declaration has to serve.\n if (entry.alwaysDict && entry.stable && entry.uses.other === 0) retypeEligible++;\n }\n }\n return { declarators, dict, alwaysDict, kindUnstable, retypeEligible };\n }\n\n private collectRustDeclaredDictLocals(src: SourceFile): Map {\n const candidates: { declaration: VariableDeclaration, name: string, source: string, defaultNode: Node | undefined }[] = [];\n this.rustWalkScope(src, (node) => {\n if (isVariableDeclaration(node) && node.initializer !== undefined && node.name.kind === SyntaxKind.Identifier) {\n const info = this.rustDictInitializerInfo(node.initializer);\n if (info !== undefined) {\n candidates.push({ declaration: node, name: String(node.name.text), source: info.source, defaultNode: info.defaultNode });\n }\n }\n });\n candidates.sort((a, b) => a.declaration.getStart() - b.declaration.getStart());\n const table = new Map();\n for (const candidate of candidates) {\n const declaration = candidate.declaration;\n const start = declaration.getStart();\n const alwaysDict = this.rustDictProvenExpression(candidate.defaultNode, table, start);\n const scan = this.rustDictLocalWriteScan(declaration, candidate.name, table);\n const entries = table.get(candidate.name) ?? [];\n entries.push({ kind: RUST_DECLARED_DICT_LOCALS.DICT, name: candidate.name, source: candidate.source,\n alwaysDict, stable: scan.stable, uses: scan.uses, declaration, start });\n table.set(candidate.name, entries);\n }\n return table;\n }\n\n /** The Dict-proven initialiser shape of a declaration, or undefined. */\n private rustDictInitializerInfo(node: Node): { source: string, defaultNode: Node | undefined } | undefined {\n if (isObjectLiteralExpression(node)) {\n return { source: 'value_map', defaultNode: node };\n }\n if (isParenthesizedExpression(node) || isAsExpression(node) || isNonNullExpression(node)) {\n return this.rustDictInitializerInfo(node.expression);\n }\n if (!isCallExpression(node)) return undefined;\n const callee = this.rustSafeDictCallee(node);\n if (callee === undefined) return undefined;\n return { source: callee, defaultNode: node.arguments[RUST_DECLARED_DICT_LOCALS.SAFE_CALLEES[callee]] };\n }\n\n /** Printed `safe_dict*` callee name of `self.(..)`, or undefined. */\n private rustSafeDictCallee(node: CallExpression): string | undefined {\n const expression = node.expression;\n if (!isPropertyAccessExpression(expression) || expression.expression.kind !== SyntaxKind.ThisKeyword) {\n return undefined;\n }\n const printed = this.toSnakeCaseName(expression.name.text);\n return RUST_DECLARED_DICT_LOCALS.SAFE_CALLEES[printed] === undefined ? undefined : printed;\n }\n\n /** True when the expression can only be a Dict at run time: an object\n * literal, a `safe_dict*` call with a Dict-proven default, an element of a\n * one-element literal default, or an already-proven local. */\n private rustDictProvenExpression(node: Node | undefined, table: Map, useStart: number): boolean {\n if (node === undefined) return false;\n if (isObjectLiteralExpression(node)) return true;\n if (isParenthesizedExpression(node) || isAsExpression(node) || isNonNullExpression(node)) {\n return this.rustDictProvenExpression(node.expression, table, useStart);\n }\n if (isArrayLiteralExpression(node)) {\n return node.elements.length === 1 && this.rustDictProvenExpression(node.elements[0], table, useStart);\n }\n if (isIdentifier(node)) {\n const entries = table.get(node.text) ?? [];\n return entries.some((entry) => {\n if (!entry.alwaysDict || entry.start > useStart) return false;\n const scope = this.rustEnclosingFunction(entry.declaration);\n return scope === undefined || this.isNodeInsideNode(node, scope);\n });\n }\n const info = this.rustDictInitializerInfo(node);\n return info !== undefined && this.rustDictProvenExpression(info.defaultNode, table, useStart);\n }\n\n /** D2 scan over the enclosing function: an assignment of a non-Dict-proven\n * value would let the kind change. Every other write path the printer emits\n * for a local is kind-preserving (`x['k'] = v` -> `add_element_to_object`,\n * `x.push(v)` -> `append_to_array`, `delete x[k]` -> `remove`, nested\n * `x['a']['b'] = v` -> `get_value_mut`/`set_value`). A *different* binding of\n * the same name (sibling block, parameter) is not this local and does not\n * count; when the checker cannot separate the two bindings the scan stays\n * conservative and rejects. */\n private rustDictLocalWriteScan(declaration: VariableDeclaration, name: string, table: Map): { stable: boolean, uses: { elementAccess: number, mutHelper: number, other: number } } {\n const uses = { elementAccess: 0, mutHelper: 0, other: 0 };\n let stable = true;\n const scope = this.rustEnclosingFunction(declaration);\n if (scope === undefined) return { stable, uses };\n const declarationSymbol = this.rustSymbolOf(declaration.name as Identifier);\n // every event of the scan is rooted at a node spelled `name`: a re-binding, a use, or the\n // identifier inside an assignment target / for-of-in head (the target's own node is an ancestor)\n for (const node of this.rustScopeNameNodes(scope, name) as any[]) {\n if (node !== declaration && this.rustBindsName(node, name)) {\n const otherSymbol = this.rustSymbolOf((node as any).name);\n if (declarationSymbol === undefined || otherSymbol === undefined || otherSymbol === declarationSymbol) {\n stable = false; // same binding, or the checker cannot tell them apart\n break;\n }\n }\n if (node.kind !== SyntaxKind.Identifier) continue;\n if (node !== declaration.name && this.rustIdentifierRefersToDeclaration(node, declaration)) {\n this.rustDictLocalClassifyUse(node, uses);\n }\n let target: any = node;\n while (target.parent !== undefined && (isParenthesizedExpression(target.parent) || isArrayLiteralExpression(target.parent)\n || isShorthandPropertyAssignment(target.parent) || isObjectLiteralExpression(target.parent))) {\n target = target.parent;\n }\n const holder: any = target.parent;\n if (holder !== undefined && isBinaryExpression(holder) && holder.left === target\n && rustIsAssignmentOperator(holder.operatorToken.kind) &&\n this.rustAssignmentWritesWholeLocal(holder.left, declaration) &&\n !this.rustDictProvenExpression(holder.right, table, declaration.getStart())) {\n stable = false; // the local itself is reassigned a non-Dict value\n break;\n }\n // `for (x of list)` / `for (x in obj)` rebind an existing local.\n if (holder !== undefined && (isForOfStatement(holder) || isForInStatement(holder)) && holder.initializer === target &&\n this.rustAssignmentWritesWholeLocal(holder.initializer, declaration)) {\n stable = false;\n break;\n }\n }\n return { stable, uses };\n }\n\n /** True when this assignment target writes the local ITSELF (`x = ..`,\n * `[x, y] = ..`, `({x} = ..)`), as opposed to a write *into* it\n * (`x['k'] = ..`, kind-preserving). */\n private rustAssignmentWritesWholeLocal(left: Node, declaration: VariableDeclaration): boolean {\n if (isIdentifier(left)) {\n return this.rustIdentifierRefersToDeclaration(left, declaration);\n }\n if (isParenthesizedExpression(left)) {\n return this.rustAssignmentWritesWholeLocal(left.expression, declaration);\n }\n if (isArrayLiteralExpression(left)) {\n return left.elements.some((element) => this.rustAssignmentWritesWholeLocal(element, declaration));\n }\n if (isObjectLiteralExpression(left)) {\n return left.properties.some((property) => {\n if (!isShorthandPropertyAssignment(property)) return false;\n return this.rustAssignmentWritesWholeLocal(property.name, declaration);\n });\n }\n return false;\n }\n\n /** One use of a dict-proven local: an element-access chain (`x['k']`, also\n * the `x['k'] = v` write), a kind-preserving mutator (`x.push(v)`,\n * `delete x[k]`), or something that would need the local to still be a\n * `Value`. */\n private rustDictLocalClassifyUse(node: Node, uses: { elementAccess: number, mutHelper: number, other: number }): void {\n const isAccessOf = (p: any, c: Node) => p !== undefined &&\n (isElementAccessExpression(p) || isPropertyAccessExpression(p)) && p.expression === c;\n let current: any = node;\n const parent: any = current.parent;\n if (isAccessOf(parent, current)) {\n while (isAccessOf(current.parent, current)) current = current.parent;\n if (isElementAccessExpression(current)) uses.elementAccess++;\n else uses.other++; // `x.field` on a dict value\n } else if (parent !== undefined && (isDeleteExpression(parent) || (isCallExpression(parent) &&\n isPropertyAccessExpression(parent.expression) && parent.expression.expression === current &&\n parent.expression.name.text === 'push'))) {\n uses.mutHelper++;\n } else {\n uses.other++;\n }\n }\n\n\n printPropertyDeclaration(node, identation) {\n const name = this.printNode(node.name, 0);\n if (node.initializer) {\n const init = this.printNode(node.initializer, 0);\n return `${this.getIden(identation)}${name}: Value, // default: ${init}`;\n }\n return `${this.getIden(identation)}${name}: Value,`;\n }\n\n // Collect property declarations with their initializers for use in new()\n getStructFields(node): Array<{ name: string, init: string }> {\n return node.members.filter(m => m.kind === SyntaxKind.PropertyDeclaration).map(p => ({\n name: this.printNode(p.name, 0),\n init: p.initializer ? this.printNode(p.initializer, 0) : 'Value::Null',\n }));\n }\n\n printStruct(node, identation) {\n const fieldLines = this.getStructFields(node).map(f => `${this.getIden(identation + 1)}pub ${f.name}: Value,`).join('\\n');\n return `#[derive(Debug, Clone)]\\npub struct ${this.className} {\\n${fieldLines}\\n}`;\n }\n\n printNewMethod(node, identation) {\n const fieldInits = this.getStructFields(node).map(f => `${this.getIden(identation + 2)}${f.name}: ${f.init},`).join('\\n');\n return `\\nimpl ${this.className} {\\n${this.getIden(identation + 1)}pub fn new() -> Self {\\n${this.getIden(identation + 2)}${this.className} {\\n${fieldInits}\\n${this.getIden(identation + 2)}}\\n${this.getIden(identation + 1)}}\\n}`;\n }\n\n printClass(node, identation) {\n this.rustPrefetchClassTypes(node);\n this.className = node.name.text;\n\n // First pass: collect method signatures for optional param handling\n const methods = node.members.filter(m => m.kind === SyntaxKind.MethodDeclaration);\n methods.forEach((method: any) => {\n const requiredCount = method.parameters.filter(p => !p.initializer && !p.questionToken).length;\n if (requiredCount < method.parameters.length) {\n this.methodSignatures[method.name.text] = { requiredCount };\n }\n });\n\n const struct = this.printStruct(node, identation);\n const newMethod = this.printNewMethod(node, identation);\n const classMethods = methods.map(m => this.printMethodDeclaration(m, identation)).join('\\n\\n');\n return struct + newMethod + `\\nimpl ${this.className} {\\n${classMethods}\\n}`;\n }\n\n printMethodDefinition(node, identation) {\n const name = (node.name as any).text;\n const params = node.parameters;\n const requiredParams = params.filter(p => !p.initializer && !p.questionToken);\n let parsedArgs = ['&self', ...requiredParams.map(p => `${this.printNode(p.name, 0)}: Value`)].join(', ');\n if (requiredParams.length < params.length) {\n parsedArgs += ', optional_args: &[Value]';\n }\n const returnType = this.printRustFunctionType(node);\n const retStr = returnType ? ` -> ${returnType}` : '';\n return `${this.getIden(identation + 1)}pub fn ${name}(${parsedArgs})${retStr}`;\n }\n\n printRustFunctionType(node): string {\n // An internal `: Str` method that proves the conversion prints the\n // native `Option` (its returns run the conversion; callers\n // box back where a `Value` is still needed).\n if (this.rustNativeStrReturnKind(node) === 'str') {\n return 'Option';\n }\n try {\n const checker = this.getChecker();\n if (checker.getReturnTypeOfSignature(checker.getSignatureFromDeclaration(node)).flags === TypeFlags.Void) return '';\n } catch (e) {\n // ignore\n }\n return 'Value';\n }\n\n printMethodDeclaration(node, identation) {\n const methodDef = this.printMethodDefinition(node, identation);\n const params = node.parameters;\n const optionalParams = params.filter(p => p.initializer !== undefined || p.questionToken !== undefined);\n\n // Build optional param initializations\n const optionalInits = optionalParams.map((p, idx) => {\n const defaultVal = p.initializer ? this.printNode(p.initializer, 0) : 'Value::Null';\n return `${this.getIden(identation + 2)}let ${this.printNode(p.name, 0)} = get_arg(optional_args, ${idx}, ${defaultVal});\\n`;\n }).join('');\n\n const blockOpen = this.getBlockOpen(identation);\n const blockClose = this.getBlockClose(identation);\n const shadows = this.rustParamShadowLines(node, identation + 2);\n // D-27: a `handle*` method's `message: Dict` param gets a borrowed\n // `&IndexMap` shadow so its `safe_*` reads print natively.\n const shadowPlan = this.rustProHandlerShadowPlan(node, identation);\n const savedShadowParam = this.rustProHandlerShadowParam;\n if (shadowPlan !== undefined) this.rustProHandlerShadowParam = shadowPlan.param;\n const statements = node.body.statements.map(s => this.printNode(s, identation + 2)).join('\\n');\n this.rustProHandlerShadowParam = savedShadowParam;\n const body = blockOpen + optionalInits + shadows + (shadowPlan?.lines ?? '') + statements + blockClose;\n\n return this.printNodeCommentsIfAny(node, identation, methodDef + body);\n }\n\n printFunctionDefinition(node, identation) {\n const name = node.name?.text ?? '';\n const params = node.parameters;\n const parsedArgs = params.map(p => `${this.printNode(p.name, 0)}: Value`).join(', ');\n const returnType = this.printRustFunctionType(node);\n const retStr = returnType ? ` -> ${returnType}` : '';\n return `${this.getIden(identation)}fn ${name}(${parsedArgs})${retStr}`;\n }\n\n printFunctionDeclaration(node, identation) {\n if (isArrowFunction(node)) {\n const parameters = node.parameters.map(p => `${this.printNode(p.name, 0)}: Value`).join(', ');\n const body = this.printNode(node.body);\n return `|${parameters}| ${body}`;\n }\n const funcDef = this.printFunctionDefinition(node, identation);\n const funcBody = super.printFunctionBody(node, identation);\n return this.printNodeCommentsIfAny(node, identation, funcDef + funcBody);\n }\n\n printOutOfOrderCallExpressionIfAny(node, identation) {\n if (node.expression.kind !== SyntaxKind.PropertyAccessExpression) {\n return undefined;\n }\n\n const expr = node.expression;\n const args = node.arguments;\n\n // Handle this.method(...) calls with optional params\n if (expr.expression.kind === SyntaxKind.ThisKeyword) {\n const methodName = expr.name.text;\n const sig = this.methodSignatures[methodName];\n if (sig) {\n const printArgs = (list) => list.map(a => this.printNode(a, 0)).join(', ');\n const requiredArgs = printArgs(args.slice(0, sig.requiredCount));\n const reqPart = requiredArgs ? `${requiredArgs}, ` : '';\n return `self.${methodName}(${reqPart}&[${printArgs(args.slice(sig.requiredCount))}])`;\n }\n }\n\n return undefined;\n }\n\n printCallExpression(node, identation) {\n const expression = node.expression;\n\n // `this.safeString(, 'k')` — the read inlined against\n // the parameter shadow (D-25). Ahead of the optional-arg dispatch below,\n // which prints the call for any callee with optional parameters\n const shadowSafeRead = this.printShadowSafeReadCall(node);\n if (shadowSafeRead !== undefined) return shadowSafeRead;\n\n // D-27: `this.safe_*(message, \"k\")` on a shadowed WS-handler param —\n // the native `.get(\"k\")` match replaces the `safe_*_k` helper call.\n // Checked first: the out-of-order path would print the boxed call for\n const shadowRead = this.printProHandlerShadowRead(node);\n if (shadowRead !== undefined) return shadowRead;\n\n // Handle console.log specially\n if (expression.kind === SyntaxKind.PropertyAccessExpression) {\n const exprText = expression.getText().trim();\n if (exprText === 'console.log') {\n const args = node.arguments;\n if (args.length === 1) {\n const argText = this.printNode(args[0], 0).trim();\n return `println_val(${argText.startsWith('&') ? argText : `&${argText}`})`;\n }\n // Multiple args: print each\n const argParts = Array.from(args).map(a => {\n const t = this.printNode(a, 0).trim();\n return t.startsWith('Value::') || !t.startsWith('&') ? `&${t}` : t;\n }).join(', ');\n return `println_val(${argParts})`;\n }\n }\n\n const outOfOrder = this.printOutOfOrderCallExpressionIfAny(node, identation);\n if (outOfOrder) {\n return this.rustBoxNativeStrCallIfNeeded(node, outOfOrder);\n }\n\n // `parseInt`/`parseFloat` on a checker-proven string: native `str::parse`\n // instead of the runtime helper the ccxt post-pass would emit.\n const nativeParse = this.printNativeParseCall(node);\n if (nativeParse !== undefined) return nativeParse;\n\n // `this.json(v)`: `Exchange::json` is exactly the free `json_stringify`, which takes the value\n // by reference, so the call sites' `.clone()` is dropped. `self.` args keep the method:\n // the post-pass hoisting `self.(…)` out of `&mut self` args ignores a `&self.`.\n if (expression.kind === SyntaxKind.PropertyAccessExpression &&\n expression.expression.kind === SyntaxKind.ThisKeyword &&\n expression.name.text === 'json' && node.arguments.length === 1) {\n const argText = this.printNode(node.arguments[0], 0).trim();\n if (!argText.includes('self.')) {\n const withoutClone = argText.replace(/\\.clone\\(\\)$/, '');\n return `json_stringify(${this.ensureRef(withoutClone)})`;\n }\n }\n\n return this.rustBoxNativeStrCallIfNeeded(node, super.printCallExpression(node, identation));\n }\n\n printThisKeyword(node, identation) {\n return 'self';\n }\n\n // Native string args to the runtime error constructors, audited against\n // rust/ccxt-base/src/exchange_errors.rs: `msg` is `impl ToErrorMessage` (`&str`/`String`/`Value`\n // yield the same string) and `create_error`'s class name is `&str` (bare literal only).\n private static readonly RUST_ERROR_CONSTRUCTOR_ARGS: Record = {\n ...Object.fromEntries((\n 'exchange_error authentication_error permission_denied account_not_enabled account_suspended ' +\n 'arguments_required bad_request bad_symbol operation_rejected no_change margin_mode_already_set ' +\n 'market_closed manual_interaction_needed restricted_location insufficient_funds invalid_address ' +\n 'address_pending invalid_order order_not_found order_not_cached order_immediately_fillable ' +\n 'order_not_fillable duplicate_order_id contract_unavailable not_supported invalid_proxy_settings ' +\n 'exchange_closed_by_user operation_failed network_error d_do_s_protection rate_limit_exceeded ' +\n 'exchange_not_available on_maintenance invalid_nonce checksum_error request_timeout bad_response ' +\n 'null_response cancel_pending unsubscribe_error '\n ).trim().split(' ').map((n) => [n, ['msg']])),\n create_error: ['str', 'msg'],\n };\n\n // A string literal prints as the bare `\"lit\"` (`&str` — no String\n // allocation); a checker-proven string drops the redundant `Value::Str` box.\n printErrorConstructorArg(name: string, index: number, node, identation: number): string {\n const kind = (RustTranspiler as any).RUST_ERROR_CONSTRUCTOR_ARGS[name]?.[index];\n if (kind === undefined) {\n return this.printNode(node, identation);\n }\n if (isStringLiteral(node) && !(node.text in this.StringLiteralReplacements)) {\n return this.quotedStringLiteral(node.text);\n }\n const printed = this.printNode(node, identation).trim();\n if (kind !== 'msg' || !this.rustTypeIsString(node)) {\n return printed;\n }\n const payload = this.peelValueStrBox(printed)\n ?? this.peelValueStrBox(this.stripOuterParens(printed))\n ?? printed;\n // The `Value::Str(..)` box carries the `Cow` conversion; the error\n // ctors take an `impl ToErrorMessage` (String / &str / Value).\n return payload.replace(/\\.into\\(\\)$/, '');\n }\n\n // `BadRequest` → `bad_request`: the class-to-runtime-fn name the ccxt\n // post-pass applies to `X::new(..)` calls.\n rustErrorConstructorName(className: string): string {\n return this.toSnakeCaseName(className);\n }\n\n printNewExpression(node, identation) {\n let expression = node.expression?.text;\n expression = expression ? expression : this.printNode(node.expression);\n // Plain `new Error(msg)` becomes just the message Value so it can be\n // formatted by `panic!(\"{:?}\", ...)` in printThrowStatement.\n if (expression === 'Error') {\n const args = node.arguments.map(a => this.printNode(a, identation)).join(', ');\n return args || 'Value::Null';\n }\n // CCXT exception classes end in \"Error\", \"Required\", \"Found\", etc. and\n // are constructed via `new XError(msg)`. Route them through the runtime\n // error constructors (snake_case fn calls).\n const errorClassPattern = /^(?:[A-Z][a-zA-Z]*(?:Error|Required|Found|Failed|Rejected|Available|Exceeded|Limit|Pending|Funds|Address|Order|Cached|Fillable|Closed|Maintenance|Nonce|Timeout|Response|Settings|User|Supported|Implemented|Denied|Enabled|Suspended|Symbol|Change|Unavailable|Proxy|Set|Needed))$/;\n if (typeof expression === 'string' && errorClassPattern.test(expression)) {\n const snake = this.rustErrorConstructorName(expression);\n const args = node.arguments.map((a, index) => this.printErrorConstructorArg(snake, index, a, identation)).join(', ');\n return `crate::exchange_errors::${snake}(${args})`;\n }\n // Classes the ccxt post-pass routes to the same constructors — their\n // message argument is audited too; every other `X::new(..)` prints as\n // before.\n const args = typeof expression === 'string'\n ? node.arguments.map((a, index) => this.printErrorConstructorArg(this.rustErrorConstructorName(expression), index, a, identation)).join(', ')\n : node.arguments.map(a => this.printNode(a, identation)).join(', ');\n return `${expression}::new(${args})`;\n }\n\n printPropertyAccessExpression(node, identation) {\n const transformedProperty = this.transformPropertyAcessExpressionIfNeeded(node);\n if (transformedProperty) {\n return this.getIden(identation) + transformedProperty;\n }\n\n const rightSide = node.name.text;\n const rawExpression = node.getText().trim();\n\n if (this.FullPropertyAccessReplacements.hasOwnProperty(rawExpression)) { // eslint-disable-line\n return this.FullPropertyAccessReplacements[rawExpression]; // eslint-disable-line\n }\n\n const leftExpr = this.printNode(node.expression, 0);\n\n if (rightSide === 'length') {\n return this.printArrayLength(node, 0, leftExpr);\n }\n\n // Typed field on a checker-proven map local (`x.field`) reads natively;\n // the ccxt post-pass otherwise rewrites it to `get_value(&x, \"field\")`.\n if (isIdentifier(node.name) && this.isShallowValueReceiver(node.expression) &&\n this.isNativeAccessPositionSafe(node) && !this.isNativeWriteTargetBase(node)) {\n const native = this.printNativeMapAccess(leftExpr, node.expression, String(rightSide));\n if (native) return native;\n }\n\n return `${leftExpr}.${rightSide}`;\n }\n\n // ── native container access (`get_value(...)` -> `.get(...)`) ─────────────\n // When the TypeScript checker proves the receiver is a plain Map/List value\n // and the key is a literal, the runtime `get_value` key-marker / `__live_id`\n // paths cannot apply, so the access is emitted natively. Missing keys still\n // fall back to `Value::Null`.\n\n /** Methods whose Rust counterpart takes `&mut self`: a `self.` read in\n * their args must keep the `get_value(...)` shape the ccxt post-pass hoists. */\n static readonly MUT_SELF_METHODS = new Set([\n 'watch', 'watch_multiple', 'fetch_order_book_snapshot', 'un_watch',\n 'client', 'spawn', 'delay', 'fetch_tickers', 'extend', 'fetch',\n 'send_evm_transaction',\n ]);\n\n /** Global parse helpers that go native (`str::parse`) on a proven string arg,\n * keyed to the rust integer/float type their runtime helper parses into. */\n static readonly RUST_PARSE_HELPERS: Record = {\n parseInt: 'i64',\n parseFloat: 'f64',\n };\n\n toSnakeCaseName(name: string): string {\n return name.replace(/([A-Z]+)([A-Z][a-z])/g, '$1_$2').replace(/([a-z\\d])([A-Z])/g, '$1_$2').toLowerCase();\n }\n\n escapeRustStringLiteral(text: string): string {\n return String(text).replace(/\\\\/g, '\\\\\\\\').replace(/\"/g, '\\\\\"')\n .replace(/\\n/g, '\\\\n').replace(/\\r/g, '\\\\r').replace(/\\t/g, '\\\\t');\n }\n\n getCheckedTypeOf(node): Type | undefined {\n return this.checkerOrUndefined()?.getTypeAtLocation(node);\n }\n\n typeSymbolOf(type: Type): TsSymbol | undefined {\n if (type === undefined || type === null) return undefined;\n return type?.getSymbol() ?? type?.getAliasSymbol();\n }\n\n /** Types declared outside ts/src (Date, Response, Array, Promise, …) are never\n * backed by a plain `Value` map in the rust port. */\n isLibDeclaredType(type: Type): boolean {\n const declarations: any[] = symbolDeclarations(this.typeSymbolOf(type));\n return declarations.some(d => {\n const file = d?.getSourceFile?.()?.fileName ?? '';\n return /[\\\\/]lib\\.[^\\\\/]*\\.d\\.ts$/.test(file) || /[\\\\/]node_modules[\\\\/]typescript[\\\\/]/.test(file);\n });\n }\n\n isClassInstanceType(type: Type): boolean {\n if (type === undefined) return false;\n if (type.flags & (TypeFlags.Union | TypeFlags.Intersection)) {\n return (typeParts(type) ?? []).some((member) => this.isClassInstanceType(member));\n }\n const symbol: any = this.typeSymbolOf(type) ?? type.getAliasSymbol();\n if (symbol?.flags & SymbolFlags.Class) return true;\n const declarations: any[] = symbolDeclarations(symbol);\n return declarations.some(d => isClassDeclaration(d) || isClassExpression(d));\n }\n\n hasCallableShape(type: Type): boolean {\n const checker = this.getChecker();\n return checker.getSignaturesOfType(type, SignatureKind.Call).length > 0 ||\n checker.getSignaturesOfType(type, SignatureKind.Construct).length > 0;\n }\n\n isProvenListType(type: Type): boolean {\n if (!(type.flags & TypeFlags.Object)) return false;\n // Tuple references carry the Tuple flag on their target.\n const objectFlags = ((type as any).objectFlags ?? 0) | ((typeTarget(type)?.objectFlags) ?? 0);\n if (objectFlags & ObjectFlags.Tuple) return true;\n const name = (this.typeSymbolOf(type) as any)?.name;\n if (name === 'Array' || name === 'ReadonlyArray') return true;\n const targetName = (this.typeSymbolOf(typeTarget(type)) as any)?.name;\n return targetName === 'Array' || targetName === 'ReadonlyArray';\n }\n\n /** True only for object types the rust port represents as `Value::Dict`\n * (plain interfaces / index-signature / literal types — never classes). */\n isProvenMapType(type: Type): boolean {\n if (type === undefined) return false;\n if (type.flags & TypeFlags.Union) {\n // `Market` / `Currency` / `Order | undefined` style aliases: the runtime value is the dict (or\n // Null), so a map receiver is proven once every value-carrying member is a proven map. An\n // all-dict union without a nullish member stays on the strict path (a class may hide behind it).\n const parts: Type[] = typeParts(type) ?? [];\n const nullish = parts.filter((p) => this.rustTypeIsNullish(p));\n const valueParts = parts.filter((p) => !this.rustTypeIsNullish(p));\n return nullish.length > 0 && valueParts.length > 0 && valueParts.every((p) => this.isProvenMapType(p));\n }\n if (!(type.flags & TypeFlags.Object)) return false;\n if (this.isProvenListType(type)) return false;\n if (this.hasCallableShape(type)) return false;\n if (this.isClassInstanceType(type)) return false;\n if (this.isLibDeclaredType(type)) return false;\n // A named type or a string index signature; a bare `object` proves nothing.\n const hasStringIndex = this.getChecker().getIndexTypeOfType(type, IndexKind.String) !== undefined;\n return hasStringIndex || this.typeSymbolOf(type) !== undefined;\n }\n\n /** `undefined` / `null` / `void` / `never` — a union member that carries no\n * runtime value; `Value::Null` is the only box these ever get. */\n rustTypeIsNullish(type: Type): boolean {\n return type !== undefined && (type.flags & (TypeFlags.Undefined | TypeFlags.Null | TypeFlags.Void | TypeFlags.Never)) !== 0;\n }\n\n isProvenMapExpression(node: Node): boolean {\n return this.isProvenMapType(this.getCheckedTypeOf(node));\n }\n\n isProvenListExpression(node: Node): boolean {\n if (this.rustIsOrderBookSide(node)) return false;\n const type = this.getCheckedTypeOf(node);\n return type !== undefined && this.isProvenListType(type);\n }\n\n /** RHS of a generator destructure that provably holds a `Value::Arr`: the\n * checker-proven list, or a call whose callee returns an array literal on\n * every path. */\n rustNativeListSource(node: Node): boolean {\n return this.isProvenListExpression(node) || this.rustCallReturnsProvenList(node);\n }\n\n /** `x.split(sep)` → the runtime `split`, which yields an array on every\n * path (a non-string receiver gives the empty array, never a dict). */\n rustCallPrintsRuntimeSplit(node: Node): boolean {\n if (!isCallExpression(node) || node.arguments.length === 0) return false;\n const expression: any = node.expression;\n return isPropertyAccessExpression(expression) && expression.expression.kind !== SyntaxKind.ThisKeyword &&\n String(expression.name.text) === 'split';\n }\n\n /** True when the call's value is always a runtime array: the `handle*AndParams`\n * family and its exchange overrides declare `any`, so the checker cannot\n * prove the `[T, Dict]` tuple the body always builds — walk the resolved\n * callee instead. */\n rustCallReturnsProvenList(node: Node): boolean {\n if (!isCallExpression(node)) return false;\n return this.rustProvenListCall(node, new Set());\n }\n\n private rustProvenListCall(node: Node, stack: Set): boolean {\n if (this.rustCallPrintsRuntimeSplit(node)) return true;\n const declaration = this.rustCalleeDeclaration(node);\n return declaration !== undefined && this.rustFunctionReturnsArrayLiteral(declaration, stack);\n }\n\n /** Implementation of a `x.y(..)` call, when the checker resolves one. */\n private rustCalleeDeclaration(node: Node): Node | undefined {\n if (!isCallExpression(node)) return undefined;\n if (!isPropertyAccessExpression((node as any).expression)) return undefined;\n try {\n return signatureDeclaration((this.getChecker() as any).getResolvedSignature(node));\n } catch (e) {\n return undefined;\n }\n }\n\n /** Every `return` in the function's own body builds an array literal, or\n * delegates to a call that does. `throw` and fall-through (the printer's\n * `Value::Null`) read the same through both forms. */\n private rustFunctionReturnsArrayLiteral(declaration: Node, stack: Set): boolean {\n if (stack.has(declaration)) return false;\n const body: any = (declaration as any).body;\n if (body === undefined || !isBlock(body)) return false;\n stack.add(declaration);\n try {\n let returns = 0;\n let all = true;\n const visit = (node: Node) => {\n if (!all) return;\n if (node !== body && isFunctionLike(node)) return; // nested closure\n if (isReturnStatement(node)) {\n returns++;\n const expression: any = node.expression;\n all = expression !== undefined && (isArrayLiteralExpression(expression) ||\n (isCallExpression(expression) && this.rustProvenListCall(expression, stack)) ||\n (isParenthesizedExpression(expression) && isArrayLiteralExpression(expression.expression)));\n return;\n }\n node.forEachChild(visit);\n };\n body.forEachChild(visit);\n return all && returns > 0;\n } finally {\n stack.delete(declaration);\n }\n }\n\n /** Native list-index read of a generator temp (`__destr_tmp.as_array()…`). */\n printNativeListIndex(receiverText: string, index: number): string {\n return `${receiverText}.as_array().and_then(|__arr| __arr.get(${index})).cloned().unwrap_or(Value::Null)`;\n }\n\n /** Native read for one chain level, or undefined to keep `get_value`. */\n printNativeContainerAccess(receiverText: string, receiverNode: Node, keyNode: Node): string | undefined {\n // A shadowed parameter reads through the borrowed container.\n const shadow = this.rustParamShadowOf(receiverNode);\n if (shadow !== undefined) {\n const native = this.printShadowContainerRead(shadow, keyNode);\n if (native !== undefined) return native;\n }\n if (isStringLiteralLikeNode(keyNode)) {\n return this.printNativeMapAccess(receiverText, receiverNode, keyNode.text);\n }\n if (isNumericLiteral(keyNode)) {\n const index = Number(keyNode.text);\n if (!Number.isInteger(index) || index < 0) return undefined;\n if (!this.isProvenListExpression(receiverNode)) return undefined;\n return this.printNativeListIndex(receiverText, index);\n }\n const dictRead = this.printNativeDynamicMapAccess(receiverText, receiverNode, keyNode) ?? this.printNativeThisFieldDynamicMapAccess(receiverText, receiverNode, keyNode)\n ?? this.rustR10DynamicRead(receiverText, receiverNode, keyNode);\n if (dictRead !== undefined) return dictRead;\n // A non-literal index (the `for (let i = 0; …)` counter) into a\n // checker-proven list reads natively too.\n return this.printNativeDynamicListIndex(receiverText, receiverNode, keyNode) ?? this.r14ListArithIndex(receiverText, receiverNode, keyNode);\n }\n\n /** `get_value(&X, &i)` for a checker-proven list `X` and a dynamic integer\n * index local `i`: the runtime's own array branch, spelled natively.\n * `get_value` reaches its array arm for an `Arr` receiver and its default\n * (`Value::Null`) otherwise, so the emitted match reproduces both — an\n * `Int` index by value (a negative or out-of-range index misses), a\n * numeric string by parse, anything else a miss. */\n printNativeDynamicListIndex(receiverText: string, receiverNode: Node, keyNode: Node): string | undefined {\n if (!this.isProvenListExpression(receiverNode)) return undefined;\n if (!this.isRustValueIndexKey(keyNode)) return undefined;\n // The ccxt `writeBackIndexedMutations` pass matches the `let x = get_value(&C, &K)` text to\n // write a mutated `x` back into `C[K]`; native text is invisible to it, so a bind the next\n // statement mutates keeps the helper.\n if (this.isWriteBackBindRead(keyNode.parent)) return undefined;\n const keyText = this.printNode(keyNode, 0).trim();\n // A text that already carries the post-pass `&` is not a place.\n if (!keyText || keyText.startsWith('&')) return undefined;\n return `${receiverText}.as_array().and_then(|__arr| match &${keyText} { Value::Int(__n) => __arr.get(*__n as usize), Value::Str(__s) => __s.parse::().ok().and_then(|__n| __arr.get(__n)), _ => None }).cloned().unwrap_or(Value::Null)`;\n }\n\n /** True when this read initialises a local that the very next statement in\n * the same block mutates (`x['k'] = v` -> `add_element_to_object(&mut x…)`,\n * `x.push(v)` -> `append_to_array(&mut x…)`). */\n isWriteBackBindRead(read: Node): boolean {\n const declaration: any = read === undefined ? undefined : read.parent;\n if (declaration === undefined || !isVariableDeclaration(declaration) || declaration.initializer !== read) return false;\n if (!isIdentifier(declaration.name)) return false;\n const name = String(declaration.name.text);\n let statement: any = declaration;\n while (statement !== undefined && !isStatement(statement)) statement = statement.parent;\n const siblings: any[] = statement?.parent?.statements ?? [];\n const at = siblings.indexOf(statement);\n if (at < 0 || at + 1 >= siblings.length) return false;\n return this.rustStatementMutatesLocal(siblings[at + 1], name);\n }\n\n /** A statement containing a write into a local (`x['k'] = v`, `x.k = v`,\n * `x.push(v)`). */\n rustStatementMutatesLocal(node: Node, name: string): boolean {\n let mutated = false;\n const visit = (n: Node) => {\n if (mutated) return;\n if ((isBinaryExpression(n) && rustIsAssignmentOperator(n.operatorToken.kind) && this.rootPlaceText(n.left) === name) ||\n (isCallExpression(n) && isPropertyAccessExpression(n.expression) &&\n n.expression.name.text === 'push' && this.rootPlaceText(n.expression.expression) === name)) {\n mutated = true;\n return;\n }\n n.forEachChild(visit);\n };\n node.forEachChild(visit);\n return mutated;\n }\n\n /** A dynamic index the printer emits as a `Value` number: a `let x = ` declaration of the same function (the C-style loop counter).\n * Any other shape keeps the helper — the printed local could be a native\n * `i64`/`f64`, which the `Value` match would not compile against. */\n isRustValueIndexKey(node: Node): boolean {\n const current: any = this.rustSkipWrappers(node);\n if (!isIdentifier(current)) return false;\n const type = this.getCheckedTypeOf(current);\n if (type === undefined || !(type.flags & (TypeFlags.Number | TypeFlags.NumberLiteral))) return false;\n const declaration: any = this.rustDeclarationOfIdentifier(current);\n if (declaration === undefined || !isVariableDeclaration(declaration) || declaration.initializer === undefined) return false;\n return isNumericLiteral(this.rustSkipWrappers(declaration.initializer));\n }\n\n /** Strips `( )`, `as T` and `!` wrappers. */\n rustSkipWrappers(node: any): any {\n while (node !== undefined && (isParenthesizedExpression(node) || isAsExpression(node) || isNonNullExpression(node))) node = node.expression;\n return node;\n }\n\n // Typed-parameter dict reads: a checker-proven plain dict param (`Dict`, `Dictionary`,\n // `Market`-style alias) holds the dict or `Value::Null`, so `get_value`'s marker routes cannot\n // fire and the read is `m.get(k)`. The key must be a proven `Str` box so `.as_str()` reproduces it.\n\n /** The parameter declaration behind a receiver when its *annotation* proves\n * a plain dict; undefined otherwise (no proof → keep the helper). */\n rustProvenDictParameter(node: Node): ParameterDeclaration | undefined {\n const declaration: any = this.rustDeclarationOfIdentifier(node);\n if (declaration === undefined || !isParameterDeclaration(declaration)) return undefined;\n if (declaration.type === undefined) return undefined;\n const type = this.getCheckedTypeOf(declaration.type);\n if (type === undefined || !this.isProvenMapType(type)) return undefined;\n // D2: a later write can change the kind.\n return this.rustLocalIsReassigned(declaration, String((declaration.name as any).text)) ? undefined : declaration;\n }\n\n /** `Str` (`string | undefined`) — the key box is `Value::Str` or Null. */\n rustKeyIsProvenString(node: Node): boolean {\n const type = this.getCheckedTypeOf(node);\n if (type === undefined) return false;\n const parts: Type[] = (type.flags & TypeFlags.Union) ? (typeParts(type) ?? []) : [type];\n let strings = 0;\n for (const part of parts) {\n if (part.flags & (TypeFlags.String | TypeFlags.StringLiteral)) {\n strings++;\n continue;\n }\n if (this.rustTypeIsNullish(part)) continue;\n return false;\n }\n return strings > 0;\n }\n\n /** The local/parameter proof of a dynamic-key map read: a parameter whose\n * annotation proves a plain dict (B-25), or any local whose checker type\n * proves a plain map and which nothing in the enclosing function\n * re-assigns (D2). Returns the proven declaration. */\n rustProvenDynamicMapReceiver(node: Node): Declaration | undefined {\n const parameter = this.rustProvenDictParameter(node);\n if (parameter !== undefined) return parameter;\n if (!isIdentifier(node)) return undefined;\n const declaration: any = this.rustDeclarationOfIdentifier(node);\n if (declaration === undefined || !isVariableDeclaration(declaration)) return undefined;\n if (declaration.initializer === undefined) return undefined;\n if (!this.isProvenMapExpression(node)) return undefined;\n if (this.rustLocalIsReassigned(declaration, String(node.text))) return undefined;\n return declaration;\n }\n\n /** The element-access read a key node belongs to (`x[k]`, `x[(k)]`). */\n rustElementReadOfKey(keyNode: Node): Node | undefined {\n let current: any = keyNode;\n while (current !== undefined && (isParenthesizedExpression(current) || isAsExpression(current) || isNonNullExpression(current))) {\n current = current.parent;\n }\n const parent: any = current === undefined ? undefined : current.parent;\n if (parent === undefined || !isElementAccessExpression(parent) || parent.argumentExpression !== current) return undefined;\n return parent;\n }\n\n /** `x[k]` where `x` is a proven-dict parameter and `k` a proven string. */\n printNativeDynamicMapAccess(receiverText: string, receiverNode: Node, keyNode: Node): string | undefined {\n if (this.rustProvenDynamicMapReceiver(receiverNode) === undefined) return undefined;\n if (!this.rustKeyIsProvenString(keyNode)) return undefined;\n // The ccxt `writeBackIndexedMutations` pass matches the\n // `let x = get_value(&C, &K)` text to write a mutated `x` back into\n // `C[K]`; the native text is invisible to it, so a bind the next\n const read = this.rustElementReadOfKey(keyNode);\n if (read !== undefined && this.isWriteBackBindRead(read)) return undefined;\n const keyText = this.printNode(keyNode, 0).trim();\n // A plain place keeps the borrow local; a call/temporary text does not.\n if (!/^[A-Za-z_][A-Za-z0-9_]*$/.test(keyText)) return undefined;\n if (this.rustNodeIsKeyUnsafePlace(keyText)) return undefined;\n return `${receiverText}.as_map().and_then(|__m| ${keyText}.as_str().and_then(|__k| __m.get(__k))).cloned().unwrap_or(Value::Null)`;\n }\n\n /** Keys `get_value` serves from the book store / cache bucket / live\n * snapshot instead of the dict itself — a dynamic read cannot prove the\n * key away, so a place named after one stays boxed. */\n rustNodeIsKeyUnsafePlace(keyText: string): boolean {\n return RustTranspiler.RUST_DICT_LOCAL_UNSAFE_KEYS.has(keyText);\n }\n\n // ── parameter shadows (`let x = x.as_map().unwrap_or(&__x_empty)`) ─────────\n //\n // A `Dict`/`List` parameter holds the container or `Value::Null`, and\n\n private paramShadowCache: { src: SourceFile, tables: Map> } | undefined;\n\n /** Functions whose shadow lines were actually emitted — a read converts\n * only inside one of those (an arrow body prints inline and gets none). */\n private paramShadowEmitted: { src: SourceFile, fns: Set } | undefined;\n\n private rustParamShadowEmittedSet(): Set {\n const src = this.getSrc();\n if (this.paramShadowEmitted === undefined || this.paramShadowEmitted.src !== src) {\n this.paramShadowEmitted = { src, fns: new Set() };\n }\n return this.paramShadowEmitted.fns;\n }\n\n rustParamShadowTables(): Map> {\n const src = this.getSrc();\n if (this.paramShadowCache === undefined || this.paramShadowCache.src !== src) {\n this.paramShadowCache = { src, tables: new Map() };\n }\n return this.paramShadowCache.tables;\n }\n\n /** Emitted shadow lines for a function, or '' when no parameter qualifies.\n * The caller must use this before printing the body statements (it both\n * registers the function as shadowed and computes the lines). */\n rustParamShadowLines(fn: Node, identation: number): string {\n const table = this.rustParamShadowTable(fn);\n if (table.size === 0) return '';\n const idn = this.getIden(identation);\n const lines: string[] = [];\n for (const shadow of table.values()) {\n const empty = `__${shadow.name}_empty`;\n if (this.rustFunctionDeclaresName(fn, empty)) continue;\n const map = shadow.kind === RUST_PARAM_SHADOWS.MAP;\n const accessor = map ? 'as_map' : 'as_array';\n lines.push(`${idn}let ${empty} = ${map ? 'indexmap::IndexMap::new()' : 'Vec::new()'};`);\n lines.push(`${idn}let ${shadow.name} = ${shadow.name}.${accessor}().unwrap_or(&${empty});`);\n }\n if (lines.length === 0) return '';\n this.rustParamShadowEmittedSet().add(fn);\n return lines.join('\\n') + '\\n';\n }\n\n private rustParamShadowTable(fn: Node): Map {\n const tables = this.rustParamShadowTables();\n let table = tables.get(fn);\n if (table === undefined) {\n try {\n table = this.collectRustParamShadows(fn);\n } catch (e) {\n table = new Map(); // no proof -> every read keeps its helper\n }\n tables.set(fn, table);\n }\n return table;\n }\n\n /** The shadow a read receiver resolves to, or undefined (no proof → helper). */\n rustParamShadowOf(node: Node): RustParamShadow | undefined {\n const current: any = this.rustSkipWrappers(node);\n if (current === undefined || !isIdentifier(current)) return undefined;\n const name = String(current.text);\n const declaration = this.rustDeclarationOfIdentifier(current);\n if (declaration === undefined || !isParameterDeclaration(declaration)) return undefined;\n const emitted = this.rustParamShadowEmittedSet();\n let scope: any = current.parent;\n while (scope !== undefined) {\n if (isFunctionLike(scope)) {\n const entry = emitted.has(scope) ? this.rustParamShadowTable(scope).get(name) : undefined;\n if (entry !== undefined && entry.declaration === declaration) return entry;\n }\n scope = scope.parent;\n }\n return undefined;\n }\n\n /** True when the enclosing function already binds this name somewhere. */\n private rustFunctionDeclaresName(fn: Node, name: string): boolean {\n let found = false;\n this.rustWalkScope(fn, (node: Node) => {\n if (isFunctionLike(node)) return RUST_WALK_SKIP; // nested closure: own scope\n if ((isVariableDeclaration(node) || isParameterDeclaration(node)) && isIdentifier(node.name) && node.name.text === name) {\n found = true;\n return RUST_WALK_STOP;\n }\n });\n return found;\n }\n\n private collectRustParamShadows(fn: Node): Map {\n const table = new Map();\n const parameters: any[] = (fn as any).parameters ?? [];\n const body: any = (fn as any).body;\n if (body === undefined) return table;\n for (const param of parameters) {\n if (!isParameterDeclaration(param) || !isIdentifier(param.name)) continue;\n const name = String(param.name.text);\n if (name === 'optional_args') continue;\n if (param.type === undefined) continue;\n const type = this.getCheckedTypeOf(param.type);\n if (type === undefined) continue;\n const kind: RustParamShadowKind | undefined = this.isProvenMapType(type) ? RUST_PARAM_SHADOWS.MAP :\n this.isProvenShadowListType(type) ? RUST_PARAM_SHADOWS.LIST : undefined;\n if (kind === undefined) continue;\n if (this.rustParameterIsClientHandle(param)) continue;\n if (this.rustParamShadowUseCensus(fn, param, kind) === undefined) continue;\n table.set(name, { kind, name, declaration: param });\n }\n return table;\n }\n\n /** A checker-proven array parameter type (`Vec` on the rust side);\n * tuples are excluded (their printed shape is not a plain `Vec`). */\n isProvenShadowListType(type: Type): boolean {\n if (type === undefined) return false;\n if (!(type.flags & TypeFlags.Object)) return false;\n const objectFlags = ((type as any).objectFlags ?? 0) | ((typeTarget(type)?.objectFlags) ?? 0);\n if (objectFlags & ObjectFlags.Tuple) return false;\n if (this.hasCallableShape(type)) return false;\n if (this.isClassInstanceType(type)) return false;\n const name = (this.typeSymbolOf(type) as any)?.name;\n if (name === 'Array' || name === 'ReadonlyArray') return true;\n const targetName = (this.typeSymbolOf(typeTarget(type)) as any)?.name;\n return targetName === 'Array' || targetName === 'ReadonlyArray';\n }\n\n /** Every reference to the parameter must be a printable read, and at least\n * one must exist; anything else (a write, a `Value` pass-through, a Null\n * comparison, a marker key) answers undefined and the parameter keeps its\n * box. */\n private rustParamShadowUseCensus(fn: Node, param: ParameterDeclaration, kind: RustParamShadowKind): { reads: number } | undefined {\n const name = String((param.name as Identifier).text);\n const paramSymbol = this.rustSymbolOf(param.name as Identifier);\n if (paramSymbol === undefined) return undefined;\n let reads = 0;\n let ok = true;\n const visit = (node: Node) => {\n if (!ok) return;\n if (isIdentifier(node) && node.text === name && node !== param.name) {\n if (this.rustSymbolOf(node) !== paramSymbol || !this.rustParamUseIsRead(node, kind)) {\n ok = false;\n return;\n }\n reads++;\n }\n node.forEachChild(visit);\n };\n (fn as any).body.forEachChild(visit);\n return ok && reads > 0 ? { reads } : undefined;\n }\n\n /** One reference of a shadow candidate: true only for a read the shadow can\n * print exactly (same proofs the emitted forms re-check). */\n private rustParamUseIsRead(id: Identifier, kind: RustParamShadowKind): boolean {\n const parent: any = id.parent;\n if (parent === undefined) return false;\n // `x[k]` — element read. Writes (`x[k] = v`, `x[k].push(..)`) and the\n // post-pass write-back binds keep the box.\n if (isElementAccessExpression(parent) && parent.expression === id) {\n if (this.isNativeWriteTargetBase(id)) return false;\n if (!this.isNativeAccessPositionSafe(id)) return false;\n if (this.isWriteBackBindRead(parent)) return false;\n return this.rustShadowKeyIsReadable(parent.argumentExpression, kind);\n }\n // `x.length` — array length read.\n if (isPropertyAccessExpression(parent) && parent.expression === id) {\n return kind === RUST_PARAM_SHADOWS.LIST && String(parent.name.text) === 'length';\n }\n // `'k' in x` / `k in x`.\n if (isBinaryExpression(parent) && parent.operatorToken.kind === SyntaxKind.InKeyword && parent.right === id) {\n if (kind !== RUST_PARAM_SHADOWS.MAP) return false;\n return this.rustShadowKeyIsReadable(parent.left, RUST_PARAM_SHADOWS.MAP);\n }\n // `this.safe(x, 'k'[, default])` — the read families the shadow\n // inlines (literal keys only). Any other call keeps the box.\n if (isCallExpression(parent) && kind === RUST_PARAM_SHADOWS.MAP) {\n if (this.rustShadowSafeCallee(parent) === undefined) return false;\n const args: NodeArray = parent.arguments;\n if (args[0] !== id || args.length < 2 || args.length > 3) return false;\n return this.rustShadowKeyIsLiteral(args[1]);\n }\n return false;\n }\n\n /** A key a shadow read can print: dicts take a bare string literal or a\n * proven-string place, lists a literal non-negative index; the `safe_*`\n * inline takes the literal key form only. Marker-route key names and keys\n * whose text needs escaping are excluded. */\n private rustShadowKeyIsReadable(key: any, kind: RustParamShadowKind): boolean {\n if (key === undefined) return false;\n if (kind === RUST_PARAM_SHADOWS.MAP) {\n if (isStringLiteralLikeNode(key)) return this.rustShadowKeyIsLiteral(key);\n if (isIdentifier(key)) {\n return this.rustKeyIsProvenString(key) && !this.rustNodeIsKeyUnsafePlace(String(key.text));\n }\n return false;\n }\n if (isNumericLiteral(key)) {\n const index = Number(key.text);\n return Number.isInteger(index) && index >= 0;\n }\n return false;\n }\n\n private rustShadowKeyIsLiteral(key: any): boolean {\n if (key === undefined || !isStringLiteralLikeNode(key)) return false;\n const text = String(key.text);\n return this.rustShadowKeyLiteral(text) && !this.rustNodeIsKeyUnsafePlace(text);\n }\n\n /** Keys whose text is safe to inline into a rust string literal. */\n private rustShadowKeyLiteral(text: string): boolean {\n return /^[A-Za-z0-9_./-]*$/.test(text) && text.length > 0;\n }\n\n /** `this.safeString`-style callee of a call, or undefined. */\n private rustShadowSafeCallee(node: CallExpression): string | undefined {\n const callee: any = (node as any).expression;\n if (callee === undefined || !isPropertyAccessExpression(callee)) return undefined;\n if (callee.expression.kind !== SyntaxKind.ThisKeyword) return undefined;\n const name = String(callee.name.text);\n return RUST_PARAM_SHADOWS.SAFE_READS.has(name) ? name : undefined;\n }\n\n /** `x['k']` / `x[i]` / `'k' in x` on a shadowed parameter: the native read,\n * or undefined to keep the helper (the census guarantees it never happens\n * for an emitted shadow). */\n printShadowContainerRead(shadow: RustParamShadow, keyNode: Node): string | undefined {\n const key: any = keyNode;\n if (shadow.kind === RUST_PARAM_SHADOWS.MAP) {\n const k = this.rustShadowMapKey(key);\n if (k === undefined) return undefined;\n return k.literal !== undefined ? `${shadow.name}.get(\"${k.literal}\").cloned().unwrap_or(Value::Null)`\n : `${k.place}.as_str().and_then(|__k| ${shadow.name}.get(__k)).cloned().unwrap_or(Value::Null)`;\n }\n if (isNumericLiteral(key)) {\n const index = Number(key.text);\n if (!Number.isInteger(index) || index < 0) return undefined;\n return `${shadow.name}.get(${index}).cloned().unwrap_or(Value::Null)`;\n }\n return undefined;\n }\n\n /** `'k' in x` on a shadowed dict parameter. */\n printShadowInOperator(shadow: RustParamShadow, keyNode: Node): string | undefined {\n if (shadow.kind !== RUST_PARAM_SHADOWS.MAP) return undefined;\n const k = this.rustShadowMapKey(keyNode);\n if (k === undefined) return undefined;\n return k.literal !== undefined ? `Value::Bool(${shadow.name}.contains_key(\"${k.literal}\"))`\n : `Value::Bool(${k.place}.as_str().map(|__k| ${shadow.name}.contains_key(__k)).unwrap_or(false))`;\n }\n\n /** A shadow dict key: an inlinable literal, or a proven-string plain place. */\n private rustShadowMapKey(key: any): { literal?: string, place?: string } | undefined {\n if (isStringLiteralLikeNode(key)) {\n const text = String(key.text);\n return this.rustShadowKeyLiteral(text) && !this.rustNodeIsKeyUnsafePlace(text) ? { literal: text } : undefined;\n }\n if (!isIdentifier(key) || !this.rustKeyIsProvenString(key) || this.rustNodeIsKeyUnsafePlace(String(key.text))) return undefined;\n const place = this.printNode(key, 0).trim();\n return /^[A-Za-z_][A-Za-z0-9_]*$/.test(place) ? { place } : undefined;\n }\n\n /** `x.length` on a shadowed list parameter — `get_array_length` natively. */\n printShadowLength(shadow: RustParamShadow): string | undefined {\n if (shadow.kind !== RUST_PARAM_SHADOWS.LIST) return undefined;\n return `Value::Int(${shadow.name}.len() as i64)`;\n }\n\n /** `this.safe(x, 'k'[, default])` on a shadowed dict parameter: the\n * runtime helper's exact semantics over `.get(..)`. */\n printShadowSafeReadCall(node: CallExpression): string | undefined {\n const callee = this.rustShadowSafeCallee(node);\n if (callee === undefined) return undefined;\n const args: any[] = (node as any).arguments ?? [];\n if (args.length < 2 || args.length > 3) return undefined;\n const shadow = this.rustParamShadowOf(args[0]);\n if (shadow === undefined || shadow.kind !== RUST_PARAM_SHADOWS.MAP) return undefined;\n const key: any = args[1];\n if (!isStringLiteralLikeNode(key)) return undefined;\n const text = String(key.text);\n if (!this.rustShadowKeyLiteral(text) || this.rustNodeIsKeyUnsafePlace(text)) return undefined;\n const fallback = args.length === 3 ? this.printNode(args[2], 0).trim() : 'Value::Null';\n const get = `${shadow.name}.get(\"${text}\")`;\n // The ccxt post-pass strips the `;` of a statement ending in `};`\n // (`[/\\};(\\s*\\n)/g, '}$1']`), so the match — like the printer's other\n // block-valued expressions — is parenthesized.\n const wrap = (text: string) => `(${text})`;\n switch (callee) {\n case 'safeValue':\n return wrap(`match ${get} { Some(__v) if !matches!(__v, Value::Null) && !matches!(__v, Value::Str(__s) if __s.is_empty()) => __v.clone(), _ => ${fallback} }`);\n case 'safeString':\n return wrap(`match ${get} { Some(Value::Str(__s)) if !__s.is_empty() => Value::Str(__s.clone()), Some(Value::Int(__n)) => Value::Str(__n.to_string().into()), Some(Value::Float(__f)) => Value::Str(__f.to_string().into()), _ => ${fallback} }`);\n case 'safeInteger':\n return wrap(`match ${get} { Some(Value::Int(__n)) => Value::Int(*__n), Some(Value::Float(__f)) => Value::Int(*__f as i64), Some(Value::Str(__s)) => match __s.parse::() { Ok(__n) => Value::Int(__n), Err(_) => match __s.parse::() { Ok(__f) if __f.is_finite() => Value::Int(__f as i64), _ => ${fallback} } }, _ => ${fallback} }`);\n case 'safeNumber':\n return wrap(`match ${get} { Some(Value::Float(__f)) => Value::Float(*__f), Some(Value::Int(__n)) => Value::Float(*__n as f64), Some(Value::Str(__s)) => match __s.parse::() { Ok(__n) => Value::Float(__n), Err(_) => ${fallback} }, _ => ${fallback} }`);\n case 'safeBool':\n return wrap(`match ${get} { Some(Value::Bool(__b)) => Value::Bool(*__b), _ => ${fallback} }`);\n case 'safeDict':\n return wrap(`match ${get} { Some(__v) if matches!(__v, Value::Dict(_)) => __v.clone(), _ => ${fallback} }`);\n case 'safeList':\n return wrap(`match ${get} { Some(__v) if matches!(__v, Value::Arr(_)) => __v.clone(), _ => ${fallback} }`);\n }\n return undefined;\n }\n\n // ── pro-tier WS handler `message` shadow (D-27) ───────────────────────────\n // `handle_x (client: Client, message: Dict)` is dispatched by NAME with\n // `Value` args, so the printed signature keeps `Value`; the annotation still\n\n /** The borrowed view bound by the shadow. */\n private static readonly PRO_HANDLER_SHADOW_NAME = '__pro_message';\n\n /** TS helper name -> emitted match kind. */\n private static readonly PRO_HANDLER_SHADOW_SAFE_READS: Record = {\n 'safeValue': 'value',\n 'safeString': 'string',\n 'safeInteger': 'integer',\n 'safeNumber': 'float',\n 'safeFloat': 'float',\n 'safeDict': 'dict',\n 'safeList': 'list',\n 'safeBool': 'bool',\n };\n\n /** The `message: Dict` parameter of a WS handler method (2nd param of a\n * `handle*` method), undefined when unproven or written (D2). */\n rustProHandlerMessageParam(node: Node): ParameterDeclaration | undefined {\n if (node === undefined || !isMethodDeclaration(node) || node.body === undefined) return undefined;\n const params: any[] = (node.parameters ?? []) as any;\n if (params.length < 2) return undefined;\n const methodName: any = node.name;\n if (methodName === undefined || !/^handle[A-Z]/.test(String(methodName.text ?? ''))) return undefined;\n const param: any = params[1];\n if (param === undefined || !isIdentifier(param.name) || param.type === undefined) return undefined;\n // The ws-handler shape `handle_x (client: Client, message: Dict)`: the\n // message is a required parameter and the first one is the Client\n // class handle. (Base helpers like `handleMarginModeAndParams\n if (param.initializer !== undefined || param.questionToken !== undefined) return undefined;\n const clientParam: any = params[0];\n if (clientParam === undefined || clientParam.type === undefined) return undefined;\n const clientType = this.getCheckedTypeOf(clientParam.type);\n if (clientType === undefined || !this.isClassInstanceType(clientType)) return undefined;\n const type = this.getCheckedTypeOf(param.type);\n if (type === undefined || !this.isProvenMapType(type)) return undefined;\n const name = String(param.name.text);\n return this.rustProHandlerParamIsWritten(param, name) ? undefined : param;\n }\n\n /** D2: a write rooted at the parameter (reassignment, element/property\n * write, a merge/splice onto it) can reshape the dict after the shadow is\n * taken — the shadow is skipped and every read keeps the helper. */\n rustProHandlerParamIsWritten(param: ParameterDeclaration, name: string): boolean {\n if (this.rustLocalIsReassigned(param, name)) return true;\n const scope = this.rustEnclosingFunction(param);\n if (scope === undefined) return true;\n if (this.rustStatementMutatesLocal(scope, name)) return true;\n const merging = ['deepExtend', 'extend', 'addElementToObject', 'remove'];\n let written = false;\n this.rustWalkScope(scope, (n: Node) => {\n if (isCallExpression(n) && n.arguments.length > 0 && isIdentifier(n.arguments[0]) && (n.arguments[0] as any).text === name) {\n const callee: any = n.expression;\n written = merging.includes(isPropertyAccessExpression(callee) ? String(callee.name?.text ?? '') :\n isIdentifier(callee) ? String(callee.text ?? '') : '');\n if (written) return RUST_WALK_STOP;\n }\n });\n return written;\n }\n\n /** Shadow plan for a handler: the parameter plus the two binding lines,\n * present only when some body read actually turns native (no dead shed). */\n rustProHandlerShadowPlan(node: Node, identation: number): { param: ParameterDeclaration, lines: string } | undefined {\n const param = this.rustProHandlerMessageParam(node);\n if (param === undefined) return undefined;\n // a D-25 parameter shadow already rebinds the name to the borrowed map; its reads are native\n if (this.rustParamShadowTable(node).has(String((param.name as any).text))) return undefined;\n const saved = this.rustProHandlerShadowParam;\n this.rustProHandlerShadowParam = param;\n let hasRead = false;\n const scope = this.rustEnclosingFunction(param);\n this.rustWalkScope(scope, (n: Node) => {\n if (isCallExpression(n) && this.printProHandlerShadowRead(n, true) !== undefined) {\n hasRead = true;\n return RUST_WALK_STOP;\n }\n });\n this.rustProHandlerShadowParam = saved;\n if (!hasRead) return undefined;\n const name = String((param.name as any).text);\n const view = RustTranspiler.PRO_HANDLER_SHADOW_NAME;\n const arc = `${view}_arc`;\n const map = 'indexmap::IndexMap';\n const ind = this.getIden(identation + 2);\n const lines =\n `${ind}let ${arc}: std::sync::Arc<${map}> = (match &${name} { Value::Dict(__d) => __d.clone(), _ => std::sync::Arc::new(indexmap::IndexMap::new()) });\\n` +\n `${ind}let ${view}: &${map} = &${arc};\\n`;\n return { param, lines };\n }\n\n /** The `safe_*` call on the shadowed parameter prints as a native\n * `.get(\"k\")` match, or undefined when the call is not one. In `probe`\n * mode the shape is checked without printing (the pre-scan must not print\n * a node twice). */\n printProHandlerShadowRead(node: Node, probe = false): string | undefined {\n const param = this.rustProHandlerShadowParam;\n if (param === undefined || node === undefined || !isCallExpression(node)) return undefined;\n const callee: any = node.expression;\n if (callee === undefined || !isPropertyAccessExpression(callee)) return undefined;\n if (callee.expression.kind !== SyntaxKind.ThisKeyword) return undefined;\n const kind = RustTranspiler.PRO_HANDLER_SHADOW_SAFE_READS[String(callee.name?.text ?? '')];\n if (kind === undefined) return undefined;\n const args: any[] = (node.arguments ?? []) as any;\n if (args.length < 2 || args.length > 3) return undefined;\n const receiver: any = args[0];\n if (receiver === undefined || receiver.kind !== SyntaxKind.Identifier) return undefined;\n if (this.rustDeclarationOfIdentifier(receiver) !== param) return undefined;\n const key: any = args[1];\n if (key === undefined || !isStringLiteral(key)) return undefined;\n const keyText = key.text;\n if (keyText === '' || RustTranspiler.RUST_DICT_LOCAL_UNSAFE_KEYS.has(keyText)) return undefined;\n if (args.length === 3 && !this.rustProHandlerShadowDefaultShape(args[2])) return undefined;\n if (probe) return 'native';\n const dflt = args.length === 3 ? this.rustProHandlerShadowDefault(args[2]) : 'Value::Null';\n if (dflt === undefined) return undefined;\n return this.rustProHandlerShadowReadText(kind, this.escapeRustStringLiteral(keyText), dflt);\n }\n\n /** A miss-arm default the match can hold: absent (`Value::Null`) or a\n * literal; a computed default keeps the helper (its Value is not\n * re-printable inside an arm without re-evaluating it twice). */\n rustProHandlerShadowDefaultShape(node: Node): boolean {\n return node.kind === SyntaxKind.StringLiteral || node.kind === SyntaxKind.NumericLiteral ||\n node.kind === SyntaxKind.TrueKeyword || node.kind === SyntaxKind.FalseKeyword ||\n node.kind === SyntaxKind.NullKeyword || node.kind === SyntaxKind.ArrayLiteralExpression ||\n node.kind === SyntaxKind.ObjectLiteralExpression ||\n (isIdentifier(node) && (node as any).text === 'undefined');\n }\n\n rustProHandlerShadowDefault(node: Node): string | undefined {\n if (!this.rustProHandlerShadowDefaultShape(node)) return undefined;\n const text = this.printNode(node, 0).trim();\n return text === '' ? undefined : text;\n }\n\n /** Exact native form of the runtime `_k` helper: same value kinds, same\n * empty-string-is-missing rule, same default (verified against\n * `exchange_stubs.rs`). `.cloned()` keeps the emitted line clone-free for\n * the ccxt clone-pruning passes; the parenthesised `match` keeps the\n * driver's `};` trailing-block replacement off the statement's `;`. */\n rustProHandlerShadowReadText(kind: string, key: string, dflt: string): string {\n const m = RustTranspiler.PRO_HANDLER_SHADOW_NAME;\n const at = `${m}.get(\"${key}\").cloned()`;\n switch (kind) {\n case 'value':\n return `(match ${at} { Some(Value::Str(__s)) if __s.is_empty() => ${dflt}, Some(__v) => __v, None => ${dflt} })`;\n case 'string':\n return `(match ${at} { Some(Value::Str(__s)) if !__s.is_empty() => Value::Str(__s), Some(Value::Int(__n)) => Value::Str(__n.to_string().into()), Some(Value::Float(__f)) => Value::Str(__f.to_string().into()), _ => ${dflt} })`;\n case 'integer':\n return `(match ${at} { Some(Value::Int(__n)) => Value::Int(__n), Some(Value::Float(__f)) => Value::Int(__f as i64), Some(Value::Str(__s)) if !__s.is_empty() => match __s.parse::() { Ok(__n) => Value::Int(__n), Err(_) => match __s.parse::() { Ok(__f) if __f.is_finite() => Value::Int(__f as i64), _ => ${dflt} } }, _ => ${dflt} })`;\n case 'float':\n return `(match ${at} { Some(Value::Float(__f)) => Value::Float(__f), Some(Value::Int(__n)) => Value::Float(__n as f64), Some(Value::Str(__s)) if !__s.is_empty() => match __s.parse::() { Ok(__f) => Value::Float(__f), Err(_) => ${dflt} }, _ => ${dflt} })`;\n case 'dict':\n return `(match ${at} { Some(__v) if matches!(__v, Value::Dict(_)) => __v, _ => ${dflt} })`;\n case 'list':\n return `(match ${at} { Some(__v) if matches!(__v, Value::Arr(_)) => __v, _ => ${dflt} })`;\n case 'bool':\n return `(match ${at} { Some(__v) if matches!(__v, Value::Bool(_)) => __v, _ => ${dflt} })`;\n }\n return undefined;\n }\n\n printNativeMapAccess(receiverText: string, receiverNode: Node, keyText: string): string | undefined {\n if (!this.isProvenMapExpression(receiverNode) && !this.rustR10LiteralReadOk(receiverNode, keyText)) {\n // Declared-Dict locals read natively too (see the classifier below).\n if (!this.rustIsDeclaredDictLocal(receiverNode)) return undefined;\n if (RustTranspiler.RUST_DICT_LOCAL_UNSAFE_KEYS.has(keyText)) return undefined;\n if (keyText === '' || /^\\d+$/.test(keyText)) return undefined;\n }\n const key = this.escapeRustStringLiteral(keyText);\n return `${receiverText}.as_map().and_then(|__m| __m.get(\"${key}\")).cloned().unwrap_or(Value::Null)`;\n }\n\n // Declared-Dict locals: the checker types many dict-holding locals `any`, losing the proof\n // above, but the declaration still proves a plain dict (object literal, `getArg(.., {})` bag,\n // `this.safeDict`, `extend` onto those, or an element of a map-typed container) at every read.\n\n /** Keys `get_value(_k)` serves from the book store, a cache bucket or a\n * live `__live_id` snapshot instead of from the dict itself: those routes\n * are invisible to a plain map read, so they keep the helper. */\n static readonly RUST_DICT_LOCAL_UNSAFE_KEYS = new Set([\n 'timestamp', 'datetime', 'nonce', 'symbol', 'checksum', 'cache',\n 'hashmap', 'subscriptions', 'futures',\n ]);\n\n rustDeclarationOfIdentifier(node: Node): Declaration | undefined {\n if (!isIdentifier(node)) return undefined;\n try {\n const symbol: any = this.getChecker().getSymbolAtLocation(node);\n return symbolValueDeclaration(symbol);\n } catch (e) {\n return undefined;\n }\n }\n\n /** Initializer shapes that construct or return a plain dict. */\n rustDictProducingInitializer(node: Node | undefined, seen: Set): boolean {\n if (node === undefined || node === null || seen.has(node)) return false;\n seen.add(node);\n if (isObjectLiteralExpression(node)) return true;\n if (isParenthesizedExpression(node) || isAsExpression(node) ||\n isNonNullExpression(node) || isTypeAssertion(node)) {\n return this.rustDictProducingInitializer((node as any).expression, seen);\n }\n if (isIdentifier(node)) {\n const declaration: any = this.rustDeclarationOfIdentifier(node);\n if (declaration === undefined || !isVariableDeclaration(declaration)) return false;\n return this.rustDictProducingInitializer(declaration.initializer, seen);\n }\n if (isElementAccessExpression(node)) {\n // `this.markets[symbol]`: the container's declared element type is\n // what the rust port stores there.\n const containerType = this.getCheckedTypeOf((node as any).expression);\n if (containerType === undefined) return false;\n const elementType = this.getChecker().getIndexTypeOfType(containerType, IndexKind.String);\n return elementType !== undefined && this.isProvenMapType(elementType);\n }\n if (!isCallExpression(node)) return false;\n const callee: any = (node as any).expression;\n if (!isPropertyAccessExpression(callee) || callee.expression.kind !== SyntaxKind.ThisKeyword) {\n return false;\n }\n const name = String(callee.name.text);\n // Readers whose rust counterpart returns the stored dict itself.\n // `this.client(url)` returns the WS client handle Dict the runtime keeps\n // (`Map{url, subscriptions, futures}`), never a class instance.\n if (['safeDict', 'safeMarketStructure', 'market', 'currency', 'safeMarket', 'safeCurrency', 'client'].includes(name)) return true;\n // `extend`/`deepExtend` merge onto their first argument.\n if (name === 'extend' || name === 'deepExtend') {\n return this.rustDictProducingInitializer((node as any).arguments[0], seen);\n }\n return false;\n }\n\n /** D2: the proof holds only while nothing re-assigns the local. */\n rustLocalIsReassigned(declaration: Declaration, name: string): boolean {\n let scope: Node | undefined = declaration;\n while (scope !== undefined && !isFunctionLike(scope) && !isSourceFile(scope)) scope = scope.parent;\n if (scope === undefined) return true;\n // only an identifier spelled `name` can be the assignment's left side\n return this.rustScopeNameNodes(scope, name).some((id: any) => {\n const node: any = id.parent;\n return id.kind === SyntaxKind.Identifier && node !== undefined && isBinaryExpression(node) && node.left === id\n && node.operatorToken.kind >= SyntaxKind.FirstAssignment && node.operatorToken.kind <= SyntaxKind.LastAssignment;\n });\n }\n\n /** True when the receiver is a local declared as (or provably holding) a\n * plain dict — `get_value(_k)` and this read agree on every key the\n * runtime does not route elsewhere. */\n rustIsDeclaredDictLocal(node: Node): boolean {\n const declaration: any = this.rustDeclarationOfIdentifier(node);\n if (declaration === undefined) return false;\n const name = declaration.name?.text;\n if (typeof name !== 'string') return false;\n if (isParameterDeclaration(declaration)) {\n // A `Client`-typed parameter is the WS handle passed to `handle_message`/`handle*`\n // (`ws_client::client_value`): a `Value::Dict{url, subscriptions, futures}` in the port, not\n // the TS class. Its fields are plain map reads.\n if (!this.rustParameterIsClientHandle(declaration) && !this.rustDictProducingInitializer(declaration.initializer, new Set())) return false;\n } else if (isVariableDeclaration(declaration)) {\n if (!this.rustDictProducingInitializer(declaration.initializer, new Set())) return false;\n } else {\n return false;\n }\n return !this.rustLocalIsReassigned(declaration, name);\n }\n\n /** A parameter declared as the ws `Client` class (or a union with it). The\n * class is the default export of `ts/src/base/ws/Client.ts`, so its type\n * symbol is named `default`; the declaration itself carries the name. */\n rustParameterIsClientHandle(declaration: ParameterDeclaration): boolean {\n const named = (type: Type | undefined): boolean => {\n if (type === undefined) return false;\n const symbol: any = this.typeSymbolOf(type);\n const declarations: any[] = symbolDeclarations(symbol);\n return declarations.some((d) => {\n if (!isClassDeclaration(d) || d.name === undefined || d.name.text !== 'Client') return false;\n const file = String(d.getSourceFile().fileName).replace(/\\\\/g, '/');\n return file.endsWith('/ws/Client.ts') || file.endsWith('/ws/Client.d.ts');\n });\n };\n const type = this.getCheckedTypeOf(declaration.name);\n if (named(type)) return true;\n return (typeParts(type) ?? []).some((member: Type) => named(member));\n }\n\n /** Constant string argument of `parseInt`/`parseFloat` folded the way rust's\n * `str::parse` would; undefined when the fold is not obviously exact. */\n foldParsedStringLiteral(name: string, text: string): string | undefined {\n const t = text.trim();\n if (name === 'parseInt') {\n if (!/^[+-]?[0-9]+$/.test(t)) return undefined;\n const value = BigInt(t.replace(/^\\+/, '') || '0');\n if (value < -9223372036854775808n || value > 9223372036854775807n) return undefined;\n return `Value::Int(${value.toString()})`;\n }\n if (!/^[+-]?[0-9]+(?:\\.[0-9]+)?$/.test(t)) return undefined;\n const value = Number(t);\n // `String(value)` must re-read as a rust float literal holding the same f64;\n // `-0` prints as `0`, which would drop the sign the runtime keeps.\n if (!Number.isFinite(value) || Object.is(value, -0)) return undefined;\n if (!/^-?[0-9]+(?:\\.[0-9]+)?$/.test(String(value))) return undefined;\n return `Value::Float(${String(value)})`;\n }\n\n /** `parseInt(x)` / `parseFloat(x)` with a single checker-proven string argument\n * become the runtime helper's own match with native `str::parse`; every other\n * argument shape keeps the helper call the ccxt post-pass rewrites. */\n printNativeParseCall(node: CallExpression): string | undefined {\n const callee = node.expression;\n if (!isIdentifier(callee)) return undefined;\n const name = String(callee.text);\n const helper = RustTranspiler.RUST_PARSE_HELPERS[name];\n if (helper === undefined) return undefined;\n if (node.arguments.length !== 1) return undefined; // radix / unknown arity\n const arg = node.arguments[0];\n const type = this.getCheckedTypeOf(arg);\n if (type === undefined || !this.isStringType(type.flags)) return undefined;\n if (isStringLiteralLikeNode(arg)) {\n const folded = this.foldParsedStringLiteral(name, arg.text);\n if (folded !== undefined) return folded;\n }\n const argText = this.printNode(arg, 0).trim();\n // The post-pass adds the `&`; a text that already carries one is not a place.\n if (!argText || argText.startsWith('&')) return undefined;\n if (helper === 'i64') {\n return `(match &${argText} { Value::Str(__parse_s) => __parse_s.trim().parse::().map(Value::Int).unwrap_or(Value::Null), Value::Int(__parse_n) => Value::Int(*__parse_n), Value::Float(__parse_f) => Value::Int(*__parse_f as i64), _ => Value::Null })`;\n }\n return `(match &${argText} { Value::Str(__parse_s) => __parse_s.trim().parse::().map(Value::Float).unwrap_or(Value::Null), Value::Float(__parse_f) => Value::Float(*__parse_f), Value::Int(__parse_n) => Value::Float(*__parse_n as f64), _ => Value::Null })`;\n }\n\n isNodeInsideNode(node: Node, container: Node): boolean {\n return node.pos >= container.pos && node.end <= container.end;\n }\n\n /** Root place of an access chain (`x` for `x['a']['b']`, `this.balance` for\n * `this.balance['usdt']`), or undefined for a temporary. */\n rootPlaceText(node: Node): string | undefined {\n let current: any = node;\n while (isPropertyAccessExpression(current) || isElementAccessExpression(current) || isParenthesizedExpression(current)) {\n if (!isParenthesizedExpression(current) && current.expression.kind === SyntaxKind.ThisKeyword) return current.getText().trim();\n current = current.expression;\n }\n return current && (isIdentifier(current) || current.kind === SyntaxKind.ThisKeyword) ? current.getText().trim() : undefined;\n }\n\n /** The ccxt post-passes hoist `get_value(...)` reads out of `&mut` calls by\n * matching their text; the native form is invisible to them, so it is only\n * emitted where no such hoist is needed. */\n isNativeAccessPositionSafe(node: Node): boolean {\n const parent = node.parent;\n // `x['k'].push(...)` / `x['k'](...)`: the post-pass rewrites the target.\n if (parent && (isPropertyAccessExpression(parent) || isCallExpression(parent)) && parent.expression === node && !this.r21PureStringMethodReceiver(node)) return false;\n const root = this.rootPlaceText(node);\n for (let current: any = node.parent; current; current = current.parent) {\n if (isStatement(current) || isSourceFile(current) || isFunctionLike(current)) break;\n if (isBinaryExpression(current) && this.isNodeInsideNode(node, current.right)) {\n const op = current.operatorToken.kind;\n const isAssign = op === SyntaxKind.EqualsToken || (op >= SyntaxKind.PlusEqualsToken && op <= SyntaxKind.CaretEqualsToken);\n if (isAssign && root !== undefined && this.rootPlaceText(current.left) === root) return false;\n }\n if (isCallExpression(current) && isPropertyAccessExpression(current.expression) &&\n this.isNodeInsideNode(node, current) && current.arguments.some(a => this.isNodeInsideNode(node, a))) {\n const callee = current.expression;\n // Same-place receiver (`x.push(x[0])`) is rewritten to `&mut x` args.\n if (root !== undefined && this.rootPlaceText(callee.expression) === root) return false;\n // `&mut self.(...)` arg lists are hoisted by the ccxt\n // pass because a `&self` reborrow conflicts with the outer `&mut self`.\n if (callee.expression.kind === SyntaxKind.ThisKeyword &&\n RustTranspiler.MUT_SELF_METHODS.has(this.toSnakeCaseName(String(callee.name.text))) &&\n (root === undefined || root === 'this' || root.startsWith('this.'))) return false;\n }\n }\n return true;\n }\n\n /** Receiver shapes whose printed text is a single `Value` place (`x`, `this.x`). */\n isShallowValueReceiver(node: Node): boolean {\n return isIdentifier(node) || (isPropertyAccessExpression(node) && node.expression.kind === SyntaxKind.ThisKeyword);\n }\n\n /** True when this read is the receiver of an element-access chain that is\n * written (`x['a'] = v`, `x['a']['b'] = v`, `delete x['a']['b']`), or a\n * property write itself (`x.k = v`, `delete x.k`). The ccxt write passes\n * match the `get_value(&…)` / `x.k` text to reach the real container, so a\n * native read would write into a discarded clone. */\n isNativeWriteTargetBase(node: Node): boolean {\n const isWrite = (n: any, target: any) => n !== undefined && (isDeleteExpression(n) ||\n (isBinaryExpression(n) && n.left === target && rustIsAssignmentOperator(n.operatorToken.kind)));\n const parent: any = node.parent;\n if (isWrite(parent, node)) return true;\n if (parent === undefined || !isElementAccessExpression(parent) || parent.expression !== node) return false;\n let current: any = parent;\n while (current.parent !== undefined && isElementAccessExpression(current.parent) && current.parent.expression === current) current = current.parent;\n return isWrite(current.parent, current);\n }\n\n transformPropertyAcessExpressionIfNeeded(node) {\n // Printed here (as before) so the receiver's loop-flag numbering in the\n // generated file matches the pinned baseline for non-length accesses.\n const leftExpr = this.printNode(node.expression, 0);\n if (node.name.text !== 'length') return undefined;\n const shadow = this.rustParamShadowOf(node.expression);\n const native = shadow !== undefined ? this.printShadowLength(shadow) : undefined;\n return native ?? this.printArrayLength(node, 0, leftExpr);\n }\n\n // `crate::value::get_value_k` is `get_value` for a `&str` key — the same\n // dict lookup minus the per-read `Value::Str` allocation. Three literal-key\n // families reach branches only `get_value` has (numeric cache/side indices,\n // the cache `hashmap` bucket, live client `subscriptions`/`futures`) and a\n // `this`/class receiver is not a `Value`, so those keep `get_value`.\n staticKeyLookup(node, container): string | undefined {\n if (!isStringLiteral(node)) return undefined;\n // Test sources keep the allocating form: the test-only post-passes\n // pattern-match `get_value(&…, &Value::Str(…))` call sites.\n const source = (node as any).getSourceFile ? (node as any).getSourceFile().fileName : '';\n if (typeof source === 'string' && /\\/test\\//.test(source)) return undefined;\n if (container.kind === SyntaxKind.ThisKeyword) return undefined;\n const text = node.text;\n if (text === '' || text in this.StringLiteralReplacements) return undefined;\n if (/^\\d+$/.test(text) || text === 'hashmap' || text === 'subscriptions' || text === 'futures') return undefined;\n const checker: any = this.checkerOrUndefined();\n if (checker === undefined) return undefined;\n const type = checker.getTypeAtLocation(container);\n if (type !== undefined && ((type as any).objectFlags & ObjectFlags.Class)) return undefined;\n return this.quotedStringLiteral(text);\n }\n\n printElementAccessExpression(node, identation) {\n const special = this.printElementAccessExpressionExceptionIfAny(node);\n if (special) return special;\n // `obj['x'] = v` is rewritten to `crate::set_value(...)` by a pass that\n // matches the `get_value(&obj, &key)` target shape, so targets keep it.\n // `d['a'].push(v)` lowers to `append_to_array(&mut , v)` and the\n // ccxt pass giving it write-through semantics (`append_to_object_array`)\n // matches `append_to_array(&mut get_value(&` literally, so call/property\n // targets keep the allocating form too: `get_value_k` is invisible to\n // that pass and the append would land on a discarded COW clone.\n const parent = node.parent;\n const keepGetValue = parent !== undefined && (\n (isBinaryExpression(parent) && parent.left === node &&\n parent.operatorToken.kind >= SyntaxKind.FirstAssignment && parent.operatorToken.kind <= SyntaxKind.LastAssignment) ||\n ((isPropertyAccessExpression(parent) || isCallExpression(parent)) && parent.expression === node));\n const chain: any[] = [];\n let current: any = node;\n while (isElementAccessExpression(current)) {\n chain.unshift(current);\n current = current.expression;\n }\n // One checker proof per chain: the emitted text replaces `get_value` only\n // when it is legal at the position the whole chain occupies.\n const nativeAllowed = this.isNativeAccessPositionSafe(node) && !this.isNativeWriteTargetBase(node);\n let acc = this.printNode(current, 0);\n for (const { expression: receiver, argumentExpression: key } of chain) {\n const native = nativeAllowed ? this.printNativeContainerAccess(acc, receiver, key) : undefined;\n const staticKey = native === undefined && !keepGetValue ? this.staticKeyLookup(key, receiver) : undefined;\n acc = native ?? (staticKey !== undefined\n ? `crate::value::get_value_k(&${acc}, ${staticKey})`\n : `get_value(&${acc}, &${this.printNode(key, 0)})`);\n }\n return acc;\n }\n\n printForStatement(node, identation) {\n const idn = this.getIden(identation);\n const idn1 = this.getIden(identation + 1);\n const initStr = node.initializer ? this.printNode(node.initializer, identation + 1) + ';\\n' : '';\n const condStr = node.condition ? this.printComparisonInBooleanContext(node.condition, 0).trim() : 'true';\n const incrStr = node.incrementor ? this.printNode(node.incrementor, 0) : '';\n const statements = node.statement.statements.map(s => this.printNode(s, identation + 1)).join('\\n');\n const body = `{\\n${statements}\\n${idn}}`;\n // A C-style `for` becomes a Rust `while`. The increment must run on\n // every iteration *including* one ended by `continue`, so it is folded\n // into the condition (guarded by a first-iteration flag); at the end of\n // the body a `continue` would skip it and spin the loop forever.\n if (incrStr !== '') {\n const flag = `__for_first_${this.forLoopCounter++}`;\n const cond = `{ if !${flag} { ${incrStr}; } ${flag} = false; ${condStr} }`;\n return `${idn}{\\n${idn1}${initStr}${idn1}let mut ${flag}: bool = true;\\n${idn1}while ${cond} ${body}\\n${idn}}`;\n }\n return `${idn}{\\n${idn1}${initStr}${idn1}while ${condStr} ${body}\\n${idn}}`;\n }\n\n private static readonly COMPARISON_OPS = new Set([\n SyntaxKind.EqualsEqualsToken, SyntaxKind.EqualsEqualsEqualsToken, SyntaxKind.ExclamationEqualsToken, SyntaxKind.ExclamationEqualsEqualsToken,\n SyntaxKind.LessThanToken, SyntaxKind.LessThanEqualsToken, SyntaxKind.GreaterThanToken, SyntaxKind.GreaterThanEqualsToken,\n ]);\n\n // Comparison helpers that can be replaced by a native numeric operator.\n private static readonly NATIVE_COMPARISON_OPERATORS: Record = {\n [SyntaxKind.LessThanToken]: '<', [SyntaxKind.LessThanEqualsToken]: '<=',\n [SyntaxKind.GreaterThanToken]: '>', [SyntaxKind.GreaterThanEqualsToken]: '>=',\n };\n\n isEqualityOp(op): boolean {\n return op === SyntaxKind.EqualsEqualsToken || op === SyntaxKind.EqualsEqualsEqualsToken ||\n op === SyntaxKind.ExclamationEqualsToken || op === SyntaxKind.ExclamationEqualsEqualsToken;\n }\n\n isLogicalOp(op): boolean {\n return op === SyntaxKind.AmpersandAmpersandToken || op === SyntaxKind.BarBarToken;\n }\n\n printCondition(node, identation) {\n const idn = this.getIden(identation);\n if (node.kind === SyntaxKind.BinaryExpression) {\n const opKind = node.operatorToken.kind;\n // Comparison binary expressions already return bool — skip is_true() wrapping\n if (RustTranspiler.COMPARISON_OPS.has(opKind)) return this.printComparisonInBooleanContext(node, identation);\n // Logical &&/|| operands are individually is_true()-wrapped in\n // printBinaryExpression, so the whole expression is already bool —\n // unless one carries a native compare, which needs no is_true().\n if (this.isLogicalOp(opKind)) {\n const native = this.hasNativeComparisonOperand(node.left) || this.hasNativeComparisonOperand(node.right);\n return idn + (native ? this.printLogicalInBooleanContext(node) : this.printNode(node, 0));\n }\n }\n // PrefixUnary ! — delegate to avoid double-wrapping\n if (node.kind === SyntaxKind.PrefixUnaryExpression && node.operator === SyntaxKind.ExclamationToken) {\n return this.printPrefixUnaryExpression(node, identation);\n }\n // A call to a hand-written `-> bool` fn is already a Rust bool.\n if (this.rustCallPrintsBool(node)) return idn + this.printNode(node, 0);\n // Checker-proved boolean Value (safe_bool / get_value): native matches!.\n const nativeTruthiness = this.printNativeTruthiness(node);\n if (nativeTruthiness !== undefined) return idn + nativeTruthiness;\n const r12Truthiness = this.rustR12NativeTruthiness(node); if (r12Truthiness !== undefined) return idn + r12Truthiness;\n // B-26: an operand whose printer emission is already a Rust `bool`.\n const nativeCondition = this.printNativeParenthesizedCondition(node);\n if (nativeCondition !== undefined && this.rustConditionBoolSlot(node)) return idn + nativeCondition;\n const expression = this.printNode(node, 0);\n const peeled = this.peelValueBoolBox(this.stripOuterParens(expression));\n if (peeled !== undefined && this.rustConditionBoolSlot(node) && !this.printedBoolHelperCall(this.stripOuterParens(peeled))) {\n return `${idn}(${peeled})`;\n }\n return `${idn}is_true(&${this.printTruthyArgument(expression)})`;\n }\n\n // B-26: `is_true(&(…)` on an operand the printer already emits as a native Rust `bool` (payload\n // compares, `matches!` predicates, `&&`/`||` of those) is the identity (`IsTruthy for bool`);\n // native text has no helper token, so it is emitted only in a bool slot (`isBareBoolEmissionSafe`).\n\n /** Bool-slot text of a parenthesised native comparison/predicate, else undefined. */\n printNativeParenthesizedCondition(node): string | undefined {\n const inner = this.unwrapParens(node);\n if (inner === undefined || inner === node || inner.kind !== SyntaxKind.BinaryExpression) return undefined;\n const op = inner.operatorToken.kind;\n if (this.isLogicalOp(op)) {\n // Every operand of a logical already prints a bool; keep the wrapper\n // when they are all helper-led (the post-passes key on that token).\n if (!this.hasNativeComparisonOperand(inner.left) && !this.hasNativeComparisonOperand(inner.right)) return undefined;\n return `(${this.printLogicalInBooleanContext(inner)})`;\n }\n if (!RustTranspiler.COMPARISON_OPS.has(op)) return undefined;\n let native: string | undefined;\n if (inner.left.kind === SyntaxKind.TypeOfExpression) {\n // `typeof x === 'string'` prints the same native predicate as `x in obj`.\n native = this.nativeValuePredicateText(inner.right.text, inner.left.expression, this.printNode(inner.left.expression, 0));\n const isDiff = op === SyntaxKind.ExclamationEqualsEqualsToken || op === SyntaxKind.ExclamationEqualsToken;\n if (native !== undefined && isDiff) native = '!' + native;\n } else {\n native = this.isEqualityOp(op) ? this.nativeEqualityText(inner) : this.printNativeOrderedComparison(inner, op, inner.left, inner.right);\n }\n return native === undefined ? undefined : `(${native})`;\n }\n\n // The argument of an `is_true(&…)` sink with the printer's `Value::Bool(…)` box peeled when it\n // spans the whole argument: `IsTruthy for Value` unboxes `Value::Bool(b)` to `b`, so the bool\n // prints bare. `is_true` is the one sink taking a native `bool`; the marker stays for post-passes.\n printTruthyArgument(expression: string): string {\n const inner = this.peelValueBoolBox(this.stripOuterParens(expression));\n // parens kept: `is_true(&a == b)` would re-associate the argument.\n return inner === undefined ? expression : `(${inner})`;\n }\n\n // `assert(, )` — the test harness' `assert` takes a\n // native `bool` (`impl Truthy for bool`), so a whole-argument\n // `Value::Bool(…)` box prints bare there too. The message list is untouched.\n printAssertCall(node, identation, parsedArgs) {\n const [first, rest] = this.splitFirstArgument(parsedArgs);\n const inner = this.peelValueBoolBox(this.stripOuterParens(first));\n return inner === undefined ? `assert(${parsedArgs})` : `assert((${inner})${rest})`;\n }\n\n // Splits an already-printed argument list after its first top-level `,`.\n splitFirstArgument(parsedArgs: string): [string, string] {\n let depth = 0;\n for (let i = 0; i < parsedArgs.length; i++) {\n const char = parsedArgs[i];\n if (char === '\"') {\n for (i++; i < parsedArgs.length && parsedArgs[i] !== '\"'; i++) {\n if (parsedArgs[i] === '\\\\') i++;\n }\n } else if ('([{'.includes(char)) depth++;\n else if (')]}'.includes(char)) depth--;\n else if (char === ',' && depth === 0) return [parsedArgs.slice(0, i), parsedArgs.slice(i)];\n }\n return [parsedArgs, ''];\n }\n\n // Bool-position text for a comparison: the native payload compare (already\n // bool) when the checker proves it, the is_equal() helper otherwise.\n printComparisonInBooleanContext(node, identation) {\n const native = this.nativeEqualityText(node);\n return this.getIden(identation) + (native ? `(${native})` : this.printNode(node, 0));\n }\n\n // Native equality text of `node` (parens unwrapped), if the checker proves it.\n nativeEqualityText(node) {\n const inner = this.unwrapParens(node);\n if (inner === undefined || inner.kind !== SyntaxKind.BinaryExpression || !this.isEqualityOp(inner.operatorToken.kind)) return undefined;\n return this.printNativeEqualityComparison(inner.left, inner.right, inner.operatorToken.kind);\n }\n\n unwrapParens(node) {\n let inner = node;\n while (inner !== undefined && inner.kind === SyntaxKind.ParenthesizedExpression) inner = inner.expression;\n return inner;\n }\n\n // Does `node` carry a native payload compare in a position where the old\n // text started with a bool helper? The post-pass types locals by that token.\n hasNativeComparisonOperand(node) {\n const inner = this.unwrapParens(node);\n if (inner === undefined) return false;\n if (inner.kind === SyntaxKind.PrefixUnaryExpression && inner.operator === SyntaxKind.ExclamationToken) {\n return this.hasNativeComparisonOperand(inner.operand);\n }\n if (this.nativeEqualityText(inner) !== undefined) return true;\n return inner.kind === SyntaxKind.BinaryExpression && this.isLogicalOp(inner.operatorToken.kind) &&\n (this.hasNativeComparisonOperand(inner.left) || this.hasNativeComparisonOperand(inner.right));\n }\n\n // Bare `&&`/`||` text of a logical expression (its operands are bools).\n printLogicalInBooleanContext(node) {\n const token = node.operatorToken.kind === SyntaxKind.AmpersandAmpersandToken ? '&&' : '||';\n return `${this.printCondition(node.left, 0).trim()} ${token} ${this.printCondition(node.right, 0).trim()}`;\n }\n\n printWhileStatement(node, identation) {\n return `${this.getIden(identation)}while ${this.printCondition(node.expression, 0)}${this.printBlock(node.statement, identation)}`;\n }\n\n printIfStatement(node, identation) {\n const elseStatement = node.elseStatement;\n const ifBody = this.printBlock(node.thenStatement, identation, elseStatement !== undefined);\n const head = node.parent.kind === SyntaxKind.IfStatement ? 'else if ' : `${this.getIden(identation)}if `;\n let ifComplete = `${head}${this.printCondition(node.expression, 0)}${ifBody}`;\n if (elseStatement?.kind === SyntaxKind.Block) {\n ifComplete += ` else${this.printBlock(elseStatement, identation)}`;\n } else if (elseStatement?.kind === SyntaxKind.IfStatement) {\n ifComplete += ' ' + this.printIfStatement(elseStatement, identation);\n }\n return this.printNodeCommentsIfAny(node, identation, ifComplete);\n }\n\n printPostFixUnaryExpression(node, identation) {\n const { operand, operator } = node;\n const helper = operator === SyntaxKind.PlusPlusToken ? 'add' : operator === SyntaxKind.MinusMinusToken ? 'subtract' : undefined;\n if (helper === undefined) return super.printPostFixUnaryExpression(node, identation);\n const operandText = this.printNode(operand, 0);\n const native = this.printNativeIncrement(helper === 'add' ? SyntaxKind.PlusToken : SyntaxKind.MinusToken, operand, operandText);\n return `${this.getIden(identation)}${operandText} = ${native ?? `${helper}(&${operandText}, &Value::Int(1))`}`;\n }\n\n // `x++` / `x--` on a checker-typed number: native `+`/`-` with `Value::Int(1)`.\n printNativeIncrement(op, operand, operandText: string): string | undefined {\n try {\n if (!this.isNumberLikeType(this.getChecker().getTypeAtLocation(operand))) return undefined;\n } catch (e) {\n return undefined;\n }\n return this.printNativeNumeric(op, operandText, 'Value::Int(1)');\n }\n\n printPrefixUnaryExpression(node, identation) {\n const { operand, operator } = node;\n const idn = this.getIden(identation);\n if (operator === SyntaxKind.ExclamationToken) return idn + '!' + this.printCondition(operand, 0);\n if (operator !== SyntaxKind.MinusToken) return idn + this.PrefixFixOperators[operator] + this.printNode(operand, 0);\n const operandText = this.printNode(operand, 0);\n return idn + (this.foldNegateLiteral(operandText) ?? this.printRustNativeNegate(operand, operandText) ?? `negate(&${operandText})`);\n }\n\n printObjectLiteralExpression(node, identation) {\n const escapeKey = (s: any): string => String(s).replace(/\\\\/g, '\\\\\\\\').replace(/\"/g, '\\\\\"')\n .replace(/\\n/g, '\\\\n').replace(/\\r/g, '\\\\r').replace(/\\t/g, '\\\\t');\n const idn2 = this.getIden(identation + 2);\n const lines = node.properties.map(p => {\n // Shorthand: { foo } → m.insert(\"foo\", foo.clone());\n if (isShorthandPropertyAssignment(p)) {\n const name = (p.name as Identifier).text;\n return `${idn2}m.insert(\"${escapeKey(name)}\".to_string(), ${name}.clone());`;\n }\n const keyText = isStringLiteral(p.name) ? p.name.text : p.name.text;\n return `${idn2}m.insert(\"${escapeKey(keyText)}\".to_string(), ${this.printNode(p.initializer, 0)});`;\n });\n const idn1 = this.getIden(identation + 1);\n const body = lines.map(l => l + '\\n').join('');\n return `Value::Map({\\n${idn1}let mut m = std::collections::HashMap::new();\\n${body}${idn1}m\\n${this.getIden(identation)}})`;\n }\n\n printArrayLiteralExpression(node, identation) {\n return `Value::from(vec![${node.elements.map(e => this.printNode(e, 0)).join(', ')}])`;\n }\n\n printDeleteExpression(node, identation) {\n return this.r05Delete(node) ?? `remove(&mut ${this.printNode(node.expression.expression, 0)}, &${this.printNode(node.expression.argumentExpression, 0)})`;\n }\n\n printInstanceOfExpression(node, identation) {\n return `${this.getIden(identation)}is_instance(&${this.printNode(node.left, 0)}, &${this.printNode(node.right, 0)})`;\n }\n\n printConditionalExpression(node, identation) {\n const condition = this.printCondition(node.condition, 0);\n const whenTrue = this.printTernaryArm(node.whenTrue);\n const whenFalse = this.printTernaryArm(node.whenFalse);\n // `ternary` is `if cond { a } else { b }` over `Value`; the arms are\n // normalized to `Value`, so the native form matches it and evaluates\n // only the taken arm (TS semantics).\n return `(if ${condition} { ${whenTrue} } else { ${whenFalse} })`;\n }\n\n // Free runtime functions that print as `bool` (not `Value`) — mirror of the\n // Rust pipeline's `ternary()` bool-boxing list.\n private static readonly BOOL_VALUE_PREFIXES = [\n 'is_equal', 'is_true', 'is_greater_than', 'is_less_than',\n 'is_greater_than_or_equal', 'is_less_than_or_equal', 'is_array',\n 'is_object', 'in_op', 'is_number', 'is_string',\n ];\n\n private static isBoolValueExpression(text: string): boolean {\n let value = text.trim();\n while (value.startsWith('(') && value.endsWith(')')) {\n let depth = 0;\n let wrapsWhole = true;\n for (let i = 0; i < value.length && wrapsWhole; i++) {\n if (value[i] === '(') depth++;\n else if (value[i] === ')' && --depth === 0 && i < value.length - 1) wrapsWhole = false;\n }\n if (!wrapsWhole) break;\n value = value.slice(1, -1).trim();\n }\n if (value.startsWith('!')) value = value.slice(1).trim();\n return RustTranspiler.BOOL_VALUE_PREFIXES.some((fn) => value.startsWith(fn + '('));\n }\n\n // An if-expression arm keeps the type `ternary()`'s `Value` parameters gave\n // it: box bool expressions, and clone bare identifiers so the arm does not\n // move a local the caller still uses.\n printTernaryArm(node, identation = 0) {\n const text = this.printNode(node, identation);\n const trimmed = text.trim();\n if (RustTranspiler.isBoolValueExpression(trimmed)) return `Value::Bool(${trimmed})`;\n if (/^[a-zA-Z_][a-zA-Z0-9_]*$/.test(trimmed) && trimmed !== 'self' && trimmed !== 'true' && trimmed !== 'false') return `${trimmed}.clone()`;\n return text;\n }\n\n // Built-in method call overrides\n printArrayIsArrayCall(node, identation, parsedArg = undefined) {\n return `Value::Bool(${this.nativeValuePredicateText('array', node?.arguments?.[0], parsedArg) ?? `is_array(&${parsedArg})`})`;\n }\n\n printObjectKeysCall(node, identation, parsedArg = undefined) {\n return this.r05Enum(node, parsedArg, 'keys') ?? this.r18PredictionEnum(node, parsedArg, 'keys') ?? this.r21BaseEnum(node, parsedArg, 'keys') ?? `object_keys(&${parsedArg})`;\n }\n\n printObjectValuesCall(node, identation, parsedArg = undefined) {\n return this.r05Enum(node, parsedArg, 'values') ?? this.r18PredictionEnum(node, parsedArg, 'values') ?? this.r21BaseEnum(node, parsedArg, 'values') ?? `object_values(&${parsedArg})`;\n }\n\n printJsonParseCall(node, identation, parsedArg = undefined) {\n return `json_parse(&${parsedArg})`;\n }\n\n printJsonStringifyCall(node, identation, parsedArg = undefined) {\n return `json_stringify(&${parsedArg})`;\n }\n\n printMathFloorCall(node, identation, parsedArg = undefined) {\n return this.printRustNativeMathCall(node, 'floor', parsedArg) ?? `math_floor(&${parsedArg})`;\n }\n\n // No `.await` here: `printAwaitExpression` appends it for `await Promise.all(...)`.\n printPromiseAllCall(node, identation, parsedArg = undefined) {\n return `promise_all(&${parsedArg})`;\n }\n\n // Rust uses postfix `.await`; the base transpiler defaults to prefix.\n printAwaitExpression(node, identation) {\n return `${this.printNode(node.expression, identation)}.await`;\n }\n\n printMathRoundCall(node, identation, parsedArg = undefined) {\n return this.printRustNativeMathCall(node, 'round', parsedArg) ?? `math_round(&${parsedArg})`;\n }\n\n printMathCeilCall(node, identation, parsedArg = undefined) {\n return this.printRustNativeMathCall(node, 'ceil', parsedArg) ?? `math_ceil(&${parsedArg})`;\n }\n\n printNumberIsIntegerCall(node, identation, parsedArg = undefined) {\n return `is_integer(&${parsedArg})`;\n }\n\n printArrayPushCall(node, identation, name = undefined, parsedArg = undefined) {\n return this.printRustVecPush(node, name, parsedArg) ?? this.r18ArrPush(node, name, parsedArg) ?? `append_to_array(&mut ${name}, ${parsedArg})`;\n }\n\n printIncludesCall(node, identation, name = undefined, parsedArg = undefined) {\n return `Value::Bool(contains(&${name}, &${parsedArg}))`;\n }\n\n printIndexOfCall(node, identation, name = undefined, parsedArg = undefined) {\n return this.printNativeStringIndexOf(node, name) ?? this.printNativeStringIndexOfString(node, name) ?? this.r30IndexOf(name, parsedArg);\n }\n\n printStartsWithCall(node, identation, name = undefined, parsedArg = undefined) {\n const native = this.printNativeStringAffixTest(node, name, 'starts_with') ?? this.r17PrintAffixTest(node, name, 'starts_with');\n if (native !== undefined) return `Value::Bool(${native})`;\n return `Value::Bool(starts_with(&${name}, &${parsedArg}))`;\n }\n\n printEndsWithCall(node, identation, name = undefined, parsedArg = undefined) {\n const native = this.printNativeStringAffixTest(node, name, 'ends_with') ?? this.r17PrintAffixTest(node, name, 'ends_with');\n if (native !== undefined) return `Value::Bool(${native})`;\n return `Value::Bool(ends_with(&${name}, &${parsedArg}))`;\n }\n\n printTrimCall(node, identation, name = undefined) {\n return this.r17PrintTrim(node, name) ?? `trim(&${name})`;\n }\n\n printJoinCall(node, identation, name = undefined, parsedArg = undefined) {\n return this.r15PrintVecJoin(node) ?? this.printNativeStringJoin(node, name) ?? `join(&${name}, &${parsedArg})`;\n }\n\n printSplitCall(node, identation, name = undefined, parsedArg = undefined) {\n return this.printNativeStringSplit(node, name) ?? this.printRustR13Split(node, name) ?? `split(&${name}, &${parsedArg})`;\n }\n\n printConcatCall(node, identation, name = undefined, parsedArg = undefined) {\n return `concat(${name}.clone(), ${parsedArg}.clone())`;\n }\n\n printToFixedCall(node, identation, name = undefined, parsedArg = undefined) {\n return `to_fixed(&${name}, &${parsedArg})`;\n }\n\n printToStringCall(node, identation, name = undefined) {\n return this.printRustNativeToString(node, name) ?? this.printRustR13ToString(node, name) ?? `to_string_val(&${name})`;\n }\n\n printToUpperCaseCall(node, identation, name = undefined) {\n return this.printNativeStringCase(node, name, 'to_uppercase') ?? this.printRustR13Case(node, name, 'to_uppercase') ?? this.r30Case(name, 'to_uppercase');\n }\n\n printToLowerCaseCall(node, identation, name = undefined) {\n return this.printNativeStringCase(node, name, 'to_lowercase') ?? this.printRustR13Case(node, name, 'to_lowercase') ?? this.r30Case(name, 'to_lowercase');\n }\n\n printShiftCall(node, identation, name = undefined) {\n return `shift(${name}.clone())`;\n }\n\n printReverseCall(node, identation, name = undefined) {\n return `${name} = reverse(${name}.clone())`;\n }\n\n printPopCall(node, identation, name = undefined) {\n return `pop(${name}.clone())`;\n }\n\n printSliceCall(node, identation, name = undefined, parsedArg = undefined, parsedArg2 = undefined) {\n return this.printNativeStringSlice(node, name) ?? this.r30Slice(name, parsedArg, parsedArg2 ?? 'Value::Null');\n }\n\n printReplaceCall(node, identation, name = undefined, parsedArg = undefined, parsedArg2 = undefined) {\n return this.printNativeStringReplace(node, name) ?? this.printRustR13Replace(node, name) ?? this.r17PrintReplace(node, name) ?? `replace_str(&${name}, &${parsedArg}, &${parsedArg2})`;\n }\n\n printReplaceAllCall(node, identation, name = undefined, parsedArg = undefined, parsedArg2 = undefined) {\n return this.printNativeStringReplace(node, name) ?? this.printRustR13Replace(node, name) ?? this.r17PrintReplace(node, name) ?? `replace_all_str(&${name}, &${parsedArg}, &${parsedArg2})`;\n }\n\n // `{}` (Display) renders an ExchangeError as `[Kind] message`; `{:?}` would dump the struct fields.\n printThrowStatement(node, identation) {\n return `${this.getIden(identation)}panic!(\"{}\", ${this.printNode(node.expression, 0)});`;\n }\n\n printTryStatement(node, identation) {\n const body = (block) => block.statements.map(s => this.printNode(s, identation + 1)).join('\\n');\n const rawName = node.catchClause?.variableDeclaration?.name?.text;\n const iden = this.getIden(identation);\n const errorName = rawName ? `_${rawName}` : '_e';\n return `${iden}let _try_result = std::panic::catch_unwind(std::panic::AssertUnwindSafe(|| {\\n${body(node.tryBlock)}\\n${iden}}));\\n` +\n `${iden}if let Err(${errorName}) = _try_result {\\n${body(node.catchClause.block)}\\n${iden}}`;\n }\n\n printReturnStatement(node, identation) {\n const exp = node.expression;\n const idn = this.getIden(identation);\n if (!exp) return `${idn}return;`;\n // `return X;` inside a native-`Option` method: the printed\n // expression is still the `Value` box, so convert it back to the\n // native payload (a nullish literal is the `None` arm).\n const fn: any = findAncestor(node.parent, isFunctionLike);\n if (this.rustNativeStrReturnKind(fn) === 'str' && this.rustStrReturnValueConverts(exp)) {\n if (this.literalKindOfNode(this.unwrapParensNode(exp)) === 'null') return `${idn}return None;`;\n const suffix = this.rustStrNativeExpression(exp) ? '' : '.as_str().map(str::to_owned)';\n return `${idn}return ${this.printNode(exp, 0).trim()}${suffix};`;\n }\n return `${idn}return ${this.printNode(exp, 0).trim()};`;\n }\n\n printBreakStatement(node, identation) {\n return `${this.getIden(identation)}break;`;\n }\n\n printContinueStatement(node, identation) {\n return `${this.getIden(identation)}continue;`;\n }\n\n printConstructorDeclaration(node, identation) {\n return ''; // handled in printNewMethod\n }\n\n printSpreadElement(node, identation) {\n return `${this.getIden(identation)}${this.printNode(node.expression, 0)}`;\n }\n\n // hx4 R01 — native element write on a local the plain-dict proof admits\n // through its write history: `const x = this.account ()`, a `let x = {}` /\n // `let x: Dict = undefined` later reassigned, `[ x, p ] = this.handleUntilOption (…)`.\n\n /** Base-tier methods whose every return is a fresh tag-free object\n * literal (no venue override, no hand-written stub replaces them). */\n private static readonly RUST_R01_PLAIN_DICT_BUILDERS = new Set([ 'account', 'safeLedgerEntry', 'depositWithdrawFee' ]);\n\n /** Base-tier `[Dict, Dict]` tuple helpers that hand back their `request` argument (index 1). */\n private static readonly RUST_R01_REQUEST_TUPLE_HELPERS = new Set([ 'handleUntilOption' ]);\n\n rustR01NativeDictInsert(baseExpr, keyNode, keyText: string, valueText: string): string | undefined {\n if (!isIdentifier(baseExpr) || !this.rustR01LocalStaysPlain(baseExpr)) {\n return undefined;\n }\n // Every write is a fresh literal / builder: the receiver is untagged and\n // a book-meta key needs no `__book_id` guard (`plain: true`).\n const receiver = { text: String(baseExpr.text), isField: false, plain: true, nameNode: baseExpr };\n const keyArg = this.rustNativeInsertKeyArg(receiver, keyNode, keyText);\n if (keyArg === undefined) {\n return undefined;\n }\n const name = receiver.text;\n const value = this.rustPrintedBoolArg(valueText) ? `Value::Bool(${valueText})` : valueText.trim();\n const insert = (val: string) =>\n `if let Value::Dict(__d) = &mut ${name} { std::sync::Arc::make_mut(__d).insert(${keyArg}, ${val}); }`;\n // same operand handling as printNativeDictInsert: hoist a read of the receiver, clone a bare place\n if (new RegExp(`\\\\b${name}\\\\b`).test(value)) {\n return `{ let __be_tmp = ${value}; ${insert('__be_tmp')} }`;\n }\n if (/^[a-zA-Z_][a-zA-Z0-9_]*$/.test(value) && value !== 'self' && value !== 'true' && value !== 'false') {\n return insert(`${value}.clone()`);\n }\n return insert(value);\n }\n\n /** A local (single binding in its function, no closure capture of a write)\n * whose declaration and every write is a plain-dict source or nullish. A\n * nullish value leaves a non-Dict, which `if let Value::Dict` no-ops on\n * exactly like the helper's `_ => {}` arm. */\n rustR01LocalStaysPlain(ident: Identifier, depth = 0): boolean {\n const checker: any = this.checkerOrUndefined();\n const declarations: any[] = checker === undefined ? [] : symbolDeclarations(checker.getSymbolAtLocation(ident));\n const declaration: any = declarations.length === 1 ? declarations[0] : undefined;\n if (declaration === undefined || depth > 4) {\n return false;\n }\n if (declaration.kind === SyntaxKind.BindingElement) {\n return this.rustR01TupleBindingStaysPlain(ident, declaration, depth);\n }\n if (!isVariableDeclaration(declaration) || declaration.name?.kind !== SyntaxKind.Identifier) {\n return false;\n }\n const scope = this.rustEnclosingFunction(declaration);\n if (scope === undefined || isSourceFile(scope) || this.rustEnclosingFunction(ident) !== scope) {\n return false;\n }\n const name = String(ident.text);\n const symbol = this.rustSymbolOf(declaration.name as Identifier);\n if (symbol === undefined) {\n return false;\n }\n if (declaration.initializer !== undefined && !this.rustR01PlainSource(declaration.initializer, name)) {\n return false;\n }\n let plain = true;\n for (const node of this.rustScopeNameNodes(scope, name) as any[]) {\n if (node === declaration) continue;\n if (this.rustBindsName(node, name)) {\n // a sibling block's own `const x` is another binding; only an unresolved one rejects\n if (this.rustSymbolOf(node.name) === undefined) { plain = false; break; }\n continue;\n }\n if (node.kind !== SyntaxKind.Identifier || node === declaration.name || this.rustSymbolOf(node) !== symbol) continue;\n if (this.rustEnclosingFunction(node) !== scope) { plain = false; break; } // captured by a callback\n if (!this.rustR01UseKeepsPlain(node, name)) { plain = false; break; }\n }\n return plain;\n }\n\n /** `const [ x, p ] = this.handleUntilOption (k, r, …)` with `r` itself a\n * plain local: element 0 is `r` handed back, and `x` is never re-written. */\n private rustR01TupleBindingStaysPlain(ident: Identifier, element: any, depth: number): boolean {\n const pattern: any = element.parent;\n const declaration: any = pattern?.parent;\n if (pattern?.kind !== SyntaxKind.ArrayBindingPattern || declaration === undefined || !isVariableDeclaration(declaration)\n || ![0, 1].includes(pattern.elements.indexOf(element)) || element.name?.kind !== SyntaxKind.Identifier\n || element.initializer !== undefined || element.dotDotDotToken !== undefined) {\n return false;\n }\n if (pattern.elements.indexOf(element) === 1 ? !this.r26ParamsSlot(declaration.initializer, undefined, depth) : !this.rustR01TupleHeadIsPlain(declaration.initializer, undefined, depth)) {\n return false;\n }\n const scope = this.rustEnclosingFunction(declaration);\n const name = String(ident.text);\n const symbol = this.rustSymbolOf(element.name);\n if (scope === undefined || symbol === undefined || this.rustEnclosingFunction(ident) !== scope) {\n return false;\n }\n for (const node of this.rustScopeNameNodes(scope, name) as any[]) {\n if (node.kind !== SyntaxKind.Identifier || node === element.name || this.rustSymbolOf(node) !== symbol) continue;\n if (this.rustEnclosingFunction(node) !== scope || !this.rustR01UseKeepsPlain(node, name)) return false;\n }\n return true;\n }\n\n /** The shipped construction proof (literal-built local / handler tuple), read-only. */\n private rustR01ShippedPlain(ident: Identifier): boolean {\n const declaration = this.rustSingleLocalDeclaration(ident);\n return declaration !== undefined && isVariableDeclaration(declaration as any)\n && this.rustInsertReceiverBuildsPlainDict(declaration as VariableDeclaration);\n }\n\n /** A use of the local: reads and element writes keep the box; a direct\n * assignment must store a plain source; any other write shape rejects. */\n private rustR01UseKeepsPlain(node: Node, name: string): boolean {\n let target: any = node;\n while (target.parent !== undefined && (isParenthesizedExpression(target.parent) || isNonNullExpression(target.parent) || isAsExpression(target.parent))) {\n target = target.parent;\n }\n const parent: any = target.parent;\n if (parent === undefined) return true;\n if (isBinaryExpression(parent) && parent.left === target && rustIsAssignmentOperator(parent.operatorToken.kind)) {\n return parent.operatorToken.kind === SyntaxKind.EqualsToken && this.rustR01PlainSource(parent.right, name);\n }\n if (parent.kind === SyntaxKind.ArrayLiteralExpression) {\n const assign: any = parent.parent;\n if (assign !== undefined && isBinaryExpression(assign) && assign.left === parent) {\n return this.rustR01RequestTupleWrite(assign.right, parent.elements.indexOf(target), name);\n }\n }\n // a field of a `let`-bound literal aliasing the local feeds ccxt's\n // writeBackAliasedArrayMutations, which keys on the helper text\n if ((parent.kind === SyntaxKind.PropertyAssignment || parent.kind === SyntaxKind.ShorthandPropertyAssignment)\n && !(parent.kind === SyntaxKind.PropertyAssignment && parent.initializer !== target)) {\n let literal: any = parent.parent;\n while (literal?.parent !== undefined && (isParenthesizedExpression(literal.parent) || isAsExpression(literal.parent))) literal = literal.parent;\n if (literal?.parent === undefined || isVariableDeclaration(literal.parent)) return false;\n }\n if (parent.kind === SyntaxKind.PrefixUnaryExpression || parent.kind === SyntaxKind.PostfixUnaryExpression\n || parent.kind === SyntaxKind.DeleteExpression\n || ((isForOfStatement(parent) || isForInStatement(parent)) && parent.initializer === target)) {\n return false;\n }\n return true;\n }\n\n /** `[ x, … ] = this.handleUntilOption (k, x, …)` — element 0 is the request\n * argument handed back (base-tier implementation, no override). */\n private rustR01RequestTupleWrite(rhs: Node, index: number, name: string): boolean {\n return index === 1 ? this.r26ParamsSlot(rhs, name, 0) : (index === 0 && this.rustR01TupleHeadIsPlain(rhs, name, 0));\n }\n\n /** Element 0 of `this.m (…)` is a plain dict: `m` is the base-tier\n * `handleUntilOption` (returns its `request` argument), or a method of the\n * calling file (Rust calls it statically) whose every `return [ X, … ]`\n * has X a plain literal / plain local, or a parameter whose argument here is. */\n private rustR01TupleHeadIsPlain(rhs: Node, selfName: string | undefined, depth: number): boolean {\n const call: any = this.rustStripWrappers(rhs);\n if (depth > 4 || call === undefined || !isCallExpression(call) || !isPropertyAccessExpression(call.expression)\n || call.expression.expression.kind !== SyntaxKind.ThisKeyword) {\n return false;\n }\n const argPlain = (index: number): boolean => {\n const arg: any = this.rustStripWrappers(call.arguments[index]);\n return arg !== undefined && (this.rustPlainDictLiteral(arg) || (isIdentifier(arg)\n && (String(arg.text) === selfName || this.rustR01LocalStaysPlain(arg, depth + 1) || this.rustR01ShippedPlain(arg))));\n };\n if (RustTranspiler.RUST_R01_REQUEST_TUPLE_HELPERS.has(String(call.expression.name.text))) {\n return this.rustR01CalleeIsBase(call) && argPlain(1);\n }\n let declaration: any;\n try {\n declaration = signatureDeclaration((this.getChecker() as any).getResolvedSignature(call));\n } catch (e) {\n return false;\n }\n if (declaration?.kind !== SyntaxKind.MethodDeclaration || declaration.body === undefined\n || declaration.getSourceFile() !== call.getSourceFile()) {\n return false;\n }\n let plain = true;\n let returns = 0;\n this.rustWalkScope(declaration.body, (n) => {\n if (isArrowFunction(n) || n.kind === SyntaxKind.FunctionExpression) return RUST_WALK_SKIP;\n if (!isReturnStatement(n)) return;\n returns++;\n const tuple: any = this.rustStripWrappers(n.expression);\n const head: any = tuple?.kind === SyntaxKind.ArrayLiteralExpression ? this.rustStripWrappers(tuple.elements[0]) : undefined;\n const param = head !== undefined && isIdentifier(head) ? declaration.parameters.findIndex((p) => p.name?.kind === SyntaxKind.Identifier && String(p.name.text) === String(head.text)) : -1;\n const ok = head !== undefined && (this.rustPlainDictLiteral(head)\n || (param >= 0 ? (this.rustSymbolOf(head) === this.rustSymbolOf(declaration.parameters[param].name) && argPlain(param)\n && this.rustR01ParamUnassigned(declaration, String(head.text)))\n : (isIdentifier(head) && this.rustR01LocalStaysPlain(head, depth + 1))));\n if (!ok) { plain = false; return RUST_WALK_STOP; }\n });\n return plain && returns > 0;\n }\n\n /** A pass-through parameter: never assigned in the method body. */\n private rustR01ParamUnassigned(method: any, name: string): boolean {\n let kept = true;\n this.rustWalkScope(method.body, (n) => {\n if (isBinaryExpression(n) && rustIsAssignmentOperator(n.operatorToken.kind) && isIdentifier(n.left) && String(n.left.text) === name) {\n kept = false;\n return RUST_WALK_STOP;\n }\n });\n return kept;\n }\n\n /** A value that is a fresh plain dict, nullish, or the local itself. */\n rustR01PlainSource(node: Node, name: string): boolean {\n const stripped: any = this.rustStripWrappers(node);\n if (stripped === undefined) return false;\n if (this.rustPlainDictLiteral(stripped) || this.rustTypeIsUndefinedish(stripped)\n || (isIdentifier(stripped) && String(stripped.text) === name)) {\n return true;\n }\n if (isConditionalExpression(stripped)) {\n return this.rustR01PlainSource(stripped.whenTrue, name) && this.rustR01PlainSource(stripped.whenFalse, name);\n }\n if (isCallExpression(stripped) && isPropertyAccessExpression(stripped.expression)\n && stripped.expression.expression.kind === SyntaxKind.ThisKeyword\n && RustTranspiler.RUST_R01_PLAIN_DICT_BUILDERS.has(String(stripped.expression.name.text))) {\n return this.rustR01CalleeIsBase(stripped);\n }\n if (this.rustR12PlainSource(stripped)) return true;\n // `x = this.omit|keysort (x, …)` copies x's own map; `this.extend (…)` builds a\n // fresh map from its dict arguments — plain when each of them is.\n if (isCallExpression(stripped) && isPropertyAccessExpression(stripped.expression)\n && stripped.expression.expression.kind === SyntaxKind.ThisKeyword && stripped.arguments.length > 0\n && this.rustR01CalleeIsBase(stripped)) {\n const callee = String(stripped.expression.name.text);\n const first: any = this.rustStripWrappers(stripped.arguments[0]);\n if (callee === 'omit' || callee === 'keysort') {\n return first !== undefined && isIdentifier(first) && String(first.text) === name;\n }\n if (callee === 'extend') {\n return stripped.arguments.every((a) => this.rustR01PlainSource(a, name));\n }\n }\n return false;\n }\n\n /** The checker resolves the call to the base-tier implementation (a venue\n * override could return anything). */\n private rustR01CalleeIsBase(call: Node): boolean {\n let declaration: any;\n try {\n declaration = signatureDeclaration((this.getChecker() as any).getResolvedSignature(call));\n } catch (e) {\n return false;\n }\n // a method body, or the base function behind an `omit = omit;` property\n return declaration !== undefined && (declaration.body !== undefined || this.r14BaseOverload(declaration))\n && RustTranspiler.RUST_BASE_TIER_FILE.test(String(declaration.getSourceFile().fileName).replace(/\\\\/g, '/'));\n }\n\n // hx4 R02\n // `this.[k]`: a class property whose declared type proves a plain dict is a\n // container struct field (never a book/cache/side/client/live marker dict), so\n // `get_value`'s marker routes cannot fire and the read is `m.get(k)`.\n\n /** The class property declaration behind `this.` when its annotation proves a plain dict. */\n rustProvenDictThisField(node: Node): Declaration | undefined {\n if (!isPropertyAccessExpression(node) || node.expression.kind !== SyntaxKind.ThisKeyword) return undefined;\n let declaration: any;\n try {\n declaration = symbolValueDeclaration(this.getChecker().getSymbolAtLocation(node.name));\n } catch (e) {\n return undefined;\n }\n if (declaration === undefined || declaration.kind !== SyntaxKind.PropertyDeclaration || declaration.type === undefined) return undefined;\n const type = this.getCheckedTypeOf(declaration.type);\n return type !== undefined && this.isProvenMapType(type) ? declaration : undefined;\n }\n\n /** `this.[a]` whose declared field type's element type is itself a plain dict\n * (`Dictionary>`). */\n rustProvenDictThisFieldElement(node: Node): boolean {\n if (!isElementAccessExpression(node)) return false;\n const field: any = this.rustProvenDictThisField(node.expression);\n if (field === undefined) return false;\n const fieldType = this.getCheckedTypeOf(field.type);\n const parts: Type[] = (fieldType.flags & TypeFlags.Union) ? (typeParts(fieldType) ?? []).filter((p) => !this.rustTypeIsNullish(p)) : [fieldType];\n return parts.length === 1 && this.isProvenMapType(this.getChecker().getIndexTypeOfType(parts[0], IndexKind.String));\n }\n\n /** `this.[k]` with a proven-dict field and a proven string key place. */\n printNativeThisFieldDynamicMapAccess(receiverText: string, receiverNode: Node, keyNode: Node): string | undefined {\n if (this.rustProvenDictThisField(receiverNode) === undefined && !this.rustProvenDictThisFieldElement(receiverNode)) return undefined;\n if (!this.rustKeyIsProvenString(keyNode)) return undefined;\n const keyText = this.printNode(keyNode, 0).trim();\n if (!/^[A-Za-z_][A-Za-z0-9_]*$/.test(keyText)) return undefined;\n return `${receiverText}.as_map().and_then(|__m| ${keyText}.as_str().and_then(|__k| __m.get(__k))).cloned().unwrap_or(Value::Null)`;\n }\n\n // hx4 R04 — `const x = []` locals declared `Vec` when every use is a statement\n // `x.push(v)` (native push), `x.length`, `return x` or an argument inside a `return`\n // (boxed once as `Value::from(x)`). Anything else keeps the `Value` box and `append_to_array`.\n private rustVecLocalDecisions = new WeakMap();\n\n rustVecLocalIsTyped(declaration): boolean {\n if (declaration?.kind !== SyntaxKind.VariableDeclaration) return false;\n let decision = this.rustVecLocalDecisions.get(declaration);\n if (decision === undefined) {\n this.rustVecLocalDecisions.set(declaration, false); // re-entrancy guard\n decision = this.rustVecLocalIsTypedUncached(declaration);\n this.rustVecLocalDecisions.set(declaration, decision);\n }\n return decision;\n }\n\n rustVecLocalIsTypedUncached(declaration): boolean {\n const init = declaration.initializer;\n if (declaration.name?.kind !== SyntaxKind.Identifier || init === undefined\n || !isArrayLiteralExpression(init) || init.elements.length !== 0) return false;\n const checker: any = this.checkerOrUndefined();\n const type = checker?.getTypeAtLocation(declaration.name);\n if (type === undefined || !checker.isArrayType(type)) return false;\n const name = String(declaration.name.text);\n const fn = this.rustEnclosingFunction(declaration);\n if (fn === undefined || isSourceFile(fn)) return false;\n // The tests pipeline's text post-passes key on the boxed `Value` local shape.\n const source = declaration.getSourceFile?.()?.fileName;\n if (typeof source === 'string' && /\\/test\\//.test(source)) return false;\n let pushes = 0;\n const safe = this.rustLocalUsesAll(declaration, name, false, (n) => {\n const parent = n.parent;\n if ((isPropertyAccessExpression(parent) && parent.name === n)\n || (parent?.kind === SyntaxKind.PropertyAssignment && parent.name === n)) return true;\n if (this.rustEnclosingFunction(n) !== fn) return false;\n if (isPropertyAccessExpression(parent) && parent.expression === n) {\n const member = String(parent.name.text);\n if (member === 'length') {\n const up = parent.parent;\n return !(isBinaryExpression(up) && up.left === parent && rustIsAssignmentOperator(up.operatorToken.kind))\n && up?.kind !== SyntaxKind.PrefixUnaryExpression && up?.kind !== SyntaxKind.PostfixUnaryExpression;\n }\n if (member === 'push' && this.rustVecPushShape(parent.parent, name)) {\n pushes++;\n return true;\n }\n return this.r15VecJoinUse(parent);\n }\n return this.rustVecValueUse(n, name) || this.r11VecUse(n) || this.r15VecPropertyUse(n);\n });\n return safe && pushes > 0;\n }\n\n // `x.push(v);` as a whole statement, one non-spread argument not naming `x`.\n rustVecPushShape(call, name: string): boolean {\n if (!isCallExpression(call) || call.arguments.length !== 1 || call.parent?.kind !== SyntaxKind.ExpressionStatement) return false;\n const arg = call.arguments[0];\n if (arg.kind === SyntaxKind.SpreadElement) return false;\n let mentions = false;\n const visit = (m) => {\n if (mentions) return;\n if (m.kind === SyntaxKind.Identifier && m.text === name) { mentions = true; return; }\n m.forEachChild?.(visit);\n };\n visit(arg);\n return !mentions;\n }\n\n // `return x` / `return f(.., x, ..)` with `x` named once in the statement: a boxing move.\n // Elsewhere a boxing argument / object-literal value must be the local's last use outside any loop.\n rustVecValueUse(n, name: string): boolean {\n const parent = n.parent;\n if (isReturnStatement(parent)) return true;\n const isArg = isCallExpression(parent) && parent.arguments.some((a) => a === n) && this.rustVecBoxingCallee(parent.expression);\n const isProp = parent?.kind === SyntaxKind.PropertyAssignment && parent.initializer === n;\n if (!isArg && !isProp) return false;\n let statement: any = parent;\n while (statement !== undefined && !isStatement(statement)) statement = statement.parent;\n if (statement === undefined) return false;\n if (!isReturnStatement(statement) && !this.rustVecIsFinalUse(n, name)) return false;\n let count = 0;\n const visit = (m) => {\n if (m.kind === SyntaxKind.Identifier && m.text === name) count++;\n m.forEachChild?.(visit);\n };\n visit(statement);\n return count === 1;\n }\n\n rustVecIsFinalUse(n, name: string): boolean {\n const fn = this.rustEnclosingFunction(n);\n for (let current: any = n.parent; current !== undefined && current !== fn; current = current.parent) {\n switch (current.kind) {\n case SyntaxKind.ForStatement: case SyntaxKind.ForInStatement: case SyntaxKind.ForOfStatement:\n case SyntaxKind.WhileStatement: case SyntaxKind.DoStatement:\n return false;\n }\n }\n const end = n.getEnd?.() ?? n.end;\n return !(this.rustScopeNameNodes(fn, name) as any[]).some((m) => m.kind === SyntaxKind.Identifier && m !== n\n && (m.getStart?.() ?? m.pos) >= end && !this.rustIdentifierIsPropertyName(m));\n }\n\n // `this.m(..)` / `super.m(..)` / `Promise.all(..)`: every argument prints through printNode as a `Value`.\n rustVecBoxingCallee(callee): boolean {\n if (!isPropertyAccessExpression(callee)) return false;\n const receiver: any = callee.expression;\n if (receiver.kind === SyntaxKind.ThisKeyword || receiver.kind === SyntaxKind.SuperKeyword) return true;\n return receiver.kind === SyntaxKind.Identifier && receiver.text === 'Promise' && String(callee.name.text) === 'all';\n }\n\n rustVecLocalDeclarationOf(node): any {\n if (node?.kind !== SyntaxKind.Identifier) return undefined;\n const checker: any = this.checkerOrUndefined();\n const symbol = checker?.getSymbolAtLocation(node);\n const declaration = symbolValueDeclaration(symbol) ?? symbolDeclarations(symbol)[0];\n return declaration !== undefined && declaration.name !== node && this.rustVecLocalIsTyped(declaration) ? declaration : undefined;\n }\n\n printRustVecPush(node, name: string | undefined, parsedArg: string | undefined): string | undefined {\n const receiver = node?.expression?.expression;\n if (name === undefined || parsedArg === undefined || this.rustVecLocalDeclarationOf(receiver) === undefined) return undefined;\n const arg = parsedArg.trim();\n // `append_to_array` takes the value by move; ccxt's post-pass cloned a bare local there.\n const value = /^[a-zA-Z_][a-zA-Z0-9_]*$/.test(arg) && arg !== 'self' && arg !== 'true' && arg !== 'false' ? `${arg}.clone()` : arg;\n return `${name}.push(${value})`;\n }\n\n transformIdentifier(node, identifier) {\n const text = super.transformIdentifier(node, identifier);\n const parent = node?.parent;\n if (parent === undefined || !(isReturnStatement(parent) || (isCallExpression(parent) && parent.arguments.some((a) => a === node)\n && this.rustVecBoxingCallee(parent.expression)) || (parent.kind === SyntaxKind.PropertyAssignment && parent.initializer === node))) return text;\n if (this.rustVecLocalDeclarationOf(node) === undefined) return text;\n return this.rustVecValueUse(node, String(node.text)) ? `Value::from(${text})` : `Value::from(${text}.clone())`;\n }\n\n // hx4 R05 — native IndexMap ops for `k in X`, `delete X[k]`, `Object.keys/values(X)`.\n\n /** Source path of a node (forward slashes). */\n r05Path(node: Node): string {\n const src: any = (node as any)?.getSourceFile?.();\n return typeof src?.fileName === 'string' ? src.fileName.replace(/\\\\/g, '/') : '';\n }\n\n /** Test sources keep the helpers: tests-pipeline post-passes match `in_op(` text. */\n r05IsTest(node: Node): boolean {\n return /\\/test\\//.test(this.r05Path(node));\n }\n\n /** `k in X` with a non-literal key on a dict-shaped receiver: `in_op`'s Dict arm.\n * The Arr arm is the only other `true` path; the dict proof excludes it. */\n r05InOp(key, obj): string | undefined {\n const recv: any = this.rustStripWrappers(obj);\n if (this.r05IsTest(obj) || !this.isShallowValueReceiver(recv) || this.rustParamShadowOf(recv) !== undefined\n || (isPropertyAccessExpression(recv) && RustTranspiler.RUST_TAGGED_CONTAINER_FIELDS.has(String(recv.name.text)))\n || !this.isDictShapedType(this.typeOfNodeIfAny(obj))) {\n return undefined;\n }\n const objExpr = this.printNode(obj, 0).trim();\n const keyExpr = this.printNode(key, 0).trim();\n if (!/^[A-Za-z_][A-Za-z0-9_]*$/.test(keyExpr) || keyExpr === 'self') {\n return undefined; // the key is borrowed beside the receiver: plain locals only\n }\n return `Value::Bool(matches!((&${objExpr}, &${keyExpr}), (Value::Dict(__d), Value::Str(__k)) if __d.contains_key(__k.as_ref())))`;\n }\n\n /** `delete X[k]` on a receiver the native-insert proof admits (never a ws\n * subscriptions snapshot, so `try_ws_subs_remove` is dead): `shift_remove`. */\n r05Delete(node): string | undefined {\n const target: any = node?.expression;\n if (target === undefined || !isElementAccessExpression(target) || this.r05IsTest(node)) {\n return undefined;\n }\n const base: any = target.expression;\n const receiver = this.rustNativeInsertReceiver(base);\n // ws-capable tiers: a local/param may alias a `client.subscriptions` snapshot\n // (live-store route in the helper); admit only fields and literal-built locals.\n const restTier = /\\/ts\\/src\\/[^/]+\\.ts$/.test(this.r05Path(node));\n if (receiver !== undefined && !receiver.isField && !restTier && receiver.plain !== true) {\n return undefined;\n }\n if (receiver === undefined || this.rustParamShadowOf(base) !== undefined\n || !this.rustReceiverStaysDict(base, receiver)\n || (receiver.isField && RustTranspiler.RUST_TAGGED_CONTAINER_FIELDS.has(String(receiver.nameNode.text)))\n || (!receiver.isField && this.rustLocalInitReadsTaggedContainer(base))) {\n return undefined;\n }\n const recv = this.printNode(base, 0).trim();\n const keyNode: any = target.argumentExpression;\n const literal = isStringLiteral(keyNode) ? this.rustStringLiteralOf(this.printNode(keyNode, 0).trim()) : undefined;\n if (literal !== undefined) {\n return `if let Value::Dict(__d) = &mut ${recv} { std::sync::Arc::make_mut(__d).shift_remove(${literal}); }`;\n }\n const keyExpr = this.printNode(keyNode, 0).trim();\n if (!/^[A-Za-z_][A-Za-z0-9_]*$/.test(keyExpr) || keyExpr === 'self' || keyExpr === recv) {\n return undefined;\n }\n return `if let (Value::Dict(__d), Value::Str(__k)) = (&mut ${recv}, &${keyExpr}) { std::sync::Arc::make_mut(__d).shift_remove(__k.as_ref()); }`;\n }\n\n /** `this.` with a declared plain-dict type that is no ws container: the\n * hand-written base builds these maps itself and never tags them. */\n r05UntaggedField(node): boolean {\n return isPropertyAccessExpression(node) && node.expression.kind === SyntaxKind.ThisKeyword\n && !RustTranspiler.RUST_TAGGED_CONTAINER_FIELDS.has(String(node.name.text))\n && !RustTranspiler.RUST_TAGGED_HANDLE_FIELDS.has(String(node.name.text))\n && this.rustProvenDictThisFieldR05(node);\n }\n\n rustProvenDictThisFieldR05(node): boolean {\n let declaration: any;\n try {\n declaration = symbolValueDeclaration(this.getChecker().getSymbolAtLocation(node.name));\n } catch (e) {\n return false;\n }\n if (declaration === undefined || declaration.kind !== SyntaxKind.PropertyDeclaration || declaration.type === undefined) return false;\n const type = this.getCheckedTypeOf(declaration.type);\n return type !== undefined && this.isProvenMapType(type);\n }\n\n /** `Object.keys/values(X)` in REST-tier sources (`ts/src/.ts`): no ws client\n * there, so X never carries the `__ws_subs_url`/`__ws_sub_ref` tags the helper filters. */\n r05Enum(node, parsedArg: string | undefined, kind: 'keys' | 'values'): string | undefined {\n const arg: any = this.rustStripWrappers(node?.arguments?.[0]);\n if (arg === undefined || parsedArg === undefined\n || !(/\\/ts\\/src\\/[^/]+\\.ts$/.test(this.r05Path(node)) || this.r05UntaggedField(arg))\n || !(isIdentifier(arg) || isPropertyAccessExpression(arg) || isElementAccessExpression(arg) || isCallExpression(arg))\n || this.rustParamShadowOf(arg) !== undefined) {\n return undefined;\n }\n const type = this.typeOfNodeIfAny(arg);\n const parts: Type[] = type === undefined ? [] : ((type.flags & TypeFlags.Union) ? (typeParts(type) ?? []) : [type]);\n if (parts.some((p) => this.getChecker().isArrayType(p) || this.getChecker().isTupleType(p)\n || (p.flags & (TypeFlags.StringLike | TypeFlags.NumberLike | TypeFlags.BooleanLike | TypeFlags.BigIntLike)) !== 0)) {\n return undefined; // native-typed locals (bool / Option) have no `as_map`\n }\n const text = parsedArg.trim();\n const recv = /^[A-Za-z_][A-Za-z0-9_.]*$/.test(text) ? text : `(${text})`;\n const body = kind === 'keys' ? '__m.keys().map(|__k| Value::Str(__k.clone().into())).collect()' : '__m.values().cloned().collect()';\n return `Value::Array(${recv}.as_map().map(|__m| ${body}).unwrap_or_default())`;\n }\n\n // hx4 R06: string methods on a checker-proven string receiver print native `str` code. The\n // receiver is a `Value`; `as_str()` reaches the payload and its `None` arm is the helper's\n // non-`Str` branch (Null / false / empty array / -1). Literal operands only, unless noted.\n\n /** Printed receiver usable as a method receiver, else undefined. */\n rustNativeStringReceiver(node, receiverText: string, kind = 'string'): string | undefined {\n if (node === undefined || !isCallExpression(node) || !isPropertyAccessExpression(node.expression)) return undefined;\n if (typeof receiverText !== 'string' || receiverText.includes('\\n') || receiverText.trim().startsWith('&')) return undefined;\n const receiver = node.expression.expression;\n if (receiver.kind === SyntaxKind.ThisKeyword || receiver.kind === SyntaxKind.SuperKeyword) return undefined;\n if (kind === 'string' && this.primitiveKindOfType(this.typeOfNodeIfAny(receiver)) !== 'string') return undefined;\n if (isIdentifier(receiver) && this.rustStringLocalIdentifierIsTyped(receiver)) return undefined;\n const text = receiverText.trim();\n return /^[A-Za-z_][A-Za-z0-9_]*(\\.[A-Za-z_][A-Za-z0-9_]*)*$/.test(text) ? text : `(${text})`;\n }\n\n /** Escaped text of a string-literal argument, else undefined. */\n rustNativeStringLiteralArg(node): string | undefined {\n if (node === undefined || (!isStringLiteral(node) && !isNoSubstitutionTemplateLiteral(node))) return undefined;\n if (node.text in this.StringLiteralReplacements) return undefined;\n return this.escapeRustStringLiteral(node.text);\n }\n\n // `x.toUpperCase()` / `x.toLowerCase()`: the helper's `Value::Str` arm, Null otherwise.\n printNativeStringCase(node, receiverText: string, method: string): string | undefined {\n const receiver = this.rustNativeStringReceiver(node, receiverText);\n if (receiver === undefined || (node.arguments?.length ?? 0) !== 0) return undefined;\n return `${receiver}.as_str().map(|__s| Value::Str(__s.${method}().into())).unwrap_or(Value::Null)`;\n }\n\n // `x.startsWith(\"lit\")` / `x.endsWith(\"lit\")` → a bool (false for a non-`Str` receiver).\n printNativeStringAffixTest(node, receiverText: string, method: string): string | undefined {\n const receiver = this.rustNativeStringReceiver(node, receiverText);\n if (receiver === undefined || node.arguments?.length !== 1) return undefined;\n const literal = this.rustNativeStringLiteralArg(node.arguments[0]);\n if (literal === undefined) return undefined;\n return `${receiver}.as_str().is_some_and(|__s| __s.${method}(\"${literal}\"))`;\n }\n\n // `x.split(\"lit\")`: an array of the parts, the empty array for a non-`Str` receiver.\n printNativeStringSplit(node, receiverText: string): string | undefined {\n const receiver = this.rustNativeStringReceiver(node, receiverText);\n if (receiver === undefined || node.arguments?.length !== 1) return undefined;\n const literal = this.rustNativeStringLiteralArg(node.arguments[0]);\n if (literal === undefined) return undefined;\n return `Value::Array(${receiver}.as_str().map(|__s| __s.split(\"${literal}\").map(|__p| Value::Str(__p.to_string().into())).collect()).unwrap_or_default())`;\n }\n\n // `x.replace(\"a\", \"b\")`: the helper replaces every occurrence (`str::replace`), else the receiver.\n printNativeStringReplace(node, receiverText: string): string | undefined {\n const receiver = this.rustNativeStringReceiver(node, receiverText);\n if (receiver === undefined || node.arguments?.length !== 2) return undefined;\n const from = this.rustNativeStringLiteralArg(node.arguments[0]);\n const to = this.rustNativeStringLiteralArg(node.arguments[1]);\n if (from === undefined || to === undefined) return undefined;\n return `${receiver}.as_str().map(|__s| Value::Str(__s.replace(\"${from}\", \"${to}\").into())).unwrap_or_else(|| ${receiver}.clone())`;\n }\n\n // `x.padStart(N, \"c\")` with a one-char alphanumeric pad: `format!` width counts chars and never\n // truncates, which is the helper's arm for a one-char pad.\n printNativeStringPadStart(node, receiverText: string): string | undefined {\n const receiver = this.rustNativeStringReceiver(node, receiverText);\n if (receiver === undefined || node.arguments?.length !== 2) return undefined;\n const width = this.rustSliceLiteralBound(node.arguments[0]);\n const pad = node.arguments[1];\n if (width === undefined || width < 0 || width > 4096) return undefined;\n if ((!isStringLiteral(pad) && !isNoSubstitutionTemplateLiteral(pad)) || !/^[A-Za-z0-9 ]$/.test(pad.text)) return undefined;\n return `${receiver}.as_str().map(|__s| Value::Str(format!(\"{:${pad.text}>${width}}\", __s).into())).unwrap_or(Value::Null)`;\n }\n\n // `x.indexOf(y)` with a proven-string needle: `-1` when either side is not a `Str` (byte index).\n printNativeStringIndexOfString(node, receiverText: string): string | undefined {\n const receiver = this.rustNativeStringReceiver(node, receiverText);\n if (receiver === undefined || node.arguments?.length !== 1) return undefined;\n const needle = node.arguments[0];\n if (!isIdentifier(needle) || this.primitiveKindOfType(this.typeOfNodeIfAny(needle)) !== 'string') return undefined;\n if (!this.isDeclaredValueIdentifier(needle) || this.rustStringLocalIdentifierIsTyped(needle)) return undefined;\n const needleText = this.printNode(needle, 0).trim();\n if (!/^[A-Za-z_][A-Za-z0-9_]*$/.test(needleText)) return undefined;\n return `Value::Int(${receiver}.as_str().zip(${needleText}.as_str()).and_then(|(__s, __n)| __s.find(__n)).map(|__i| __i as i64).unwrap_or(-1))`;\n }\n\n // `xs.join(\"lit\")` on a `string[]`: `Display` renders `Str`/`Null` like the helper does.\n printNativeStringJoin(node, receiverText: string): string | undefined {\n const receiver = this.rustNativeStringReceiver(node, receiverText, 'array');\n if (receiver === undefined || node.arguments?.length !== 1) return undefined;\n const literal = this.rustNativeStringLiteralArg(node.arguments[0]);\n if (literal === undefined) return undefined;\n const checker: any = this.checkerOrUndefined();\n const type: any = this.typeOfNodeIfAny(node.expression.expression);\n if (checker === undefined || type === undefined || !checker.isArrayType(type)) return undefined;\n const element = checker.getTypeArguments?.(type)?.[0];\n if (this.primitiveKindOfType(element) !== 'string') return undefined;\n return `Value::Str(${receiver}.as_array().map(|__a| __a.iter().map(|__v| __v.to_string()).collect::>().join(\"${literal}\")).unwrap_or_default().into())`;\n }\n\n // hx4 R07 — numeric/string helpers on checker-proven `number` / `string` operands (nullish members\n // allowed: the helper's Null arm is reproduced). Each native form answers exactly what the helper\n // answers for Int/Float/Str/Null boxes; any other operand type keeps the helper.\n rustOperandKind(node): string | undefined {\n try {\n if (node === undefined || !this.printsValueExpression(node)) return undefined;\n return this.primitiveKindOfType(this.typeOfNodeIfAny(node));\n } catch (e) {\n return undefined;\n }\n }\n\n // `x.toString()` on a number/string: `to_string_val` is `stringify_simple`, i.e. `Display`.\n // Typed `Option` receivers have no `Display`, so they keep the helper.\n printRustNativeToString(node, name: string): string | undefined {\n const receiver = node?.expression?.expression;\n const kind = this.rustOperandKind(receiver);\n if (kind !== 'number' && kind !== 'string') return undefined;\n const inner = this.unwrapParensNode(receiver);\n if (inner !== undefined && (this.rustStringLocalIdentifierIsTyped(inner) || this.rustNativeStrCalleeKind(inner) === 'str')) return undefined;\n return `Value::Str(format!(\"{}\", ${name}).into())`;\n }\n\n // `Math.floor|round|ceil(n)`: the helper answers `Float(op(x))` for a numeric box, `Null` otherwise.\n printRustNativeMathCall(node, op: string, parsedArg: string): string | undefined {\n if (this.rustOperandKind(node?.arguments?.[0]) !== 'number') return undefined;\n return `(${parsedArg}).as_f64().map(|__x| Value::Float(__x.${op}())).unwrap_or(Value::Null)`;\n }\n\n // `-n`: Int/Float flip sign in place, a Null box stays Null (helper's fallthrough).\n printRustNativeNegate(operand, operandText: string): string | undefined {\n if (this.rustOperandKind(operand) !== 'number' && this.rustR16NumericKind(operand) === undefined) return undefined;\n return `(match &(${operandText}) { Value::Int(x) => Value::Int(-x), Value::Float(x) => Value::Float(-x), _ => Value::Null })`;\n }\n\n // `a % b` on numbers: Int pair stays Int, any Float widens; a zero divisor or Null answers Null.\n printRustNativeMod(left, right, leftText: string, rightText: string): string | undefined {\n if (this.rustOperandKind(left) !== 'number' || this.rustOperandKind(right) !== 'number') return undefined;\n return `(match (&(${leftText}), &(${rightText})) {` +\n ' (Value::Int(x), Value::Int(y)) if *y != 0 => Value::Int(x % y),' +\n ' (Value::Int(x), Value::Float(y)) if *y != 0.0 => Value::Float(*x as f64 % *y),' +\n ' (Value::Float(x), Value::Int(y)) if *y != 0 => Value::Float(*x % *y as f64),' +\n ' (Value::Float(x), Value::Float(y)) if *y != 0.0 => Value::Float(x % y),' +\n ' _ => Value::Null })';\n }\n\n // hx4 R09 — `.length` always prints `Value::Int` (`get_array_length` / `Value::Int(len)`), so a\n // `.length` read, or a `const` local initialised from one, is a never-null Int whatever its receiver.\n rustR09IsDefiniteInt(node): boolean {\n const inner = this.rustStripWrappers(node);\n if (inner === undefined) return false;\n if (isPropertyAccessExpression(inner)) return String(inner.name.text) === 'length';\n if (!isIdentifier(inner)) return false;\n const declaration: any = this.rustSingleLocalDeclaration(inner);\n if (declaration === undefined || !isVariableDeclaration(declaration) || declaration.name?.kind !== SyntaxKind.Identifier) return false;\n if ((declaration.parent?.flags & NodeFlags.Const) === 0) return false;\n const init = this.rustStripWrappers(declaration.initializer);\n return init !== undefined && isPropertyAccessExpression(init) && String(init.name.text) === 'length';\n }\n\n // Int-only (definite) or checker-proven number (Int/Float/Null) operand that prints a `Value`.\n rustR09NumericOperand(node): string | undefined {\n if (this.rustR09IsDefiniteInt(node)) return 'definite';\n return this.rustOperandKind(node) === 'number' ? 'number' : undefined;\n }\n\n // `a === b` with a definite Int side against a number literal, a number or another definite Int:\n // is_equal compares Int/Float payloads as f64 and Null only equals Null, which `as_f64()` mirrors.\n rustR09LengthEquality(left, right, op): string | undefined {\n if (!this.rustR09IsDefiniteInt(left) && !this.rustR09IsDefiniteInt(right)) return undefined;\n const operator = (op === SyntaxKind.EqualsEqualsToken || op === SyntaxKind.EqualsEqualsEqualsToken) ? '==' : '!=';\n const [ definite, other ] = this.rustR09IsDefiniteInt(left) ? [ left, right ] : [ right, left ];\n if (!this.printsValueExpression(definite)) return undefined;\n const otherInner = this.rustStripWrappers(other);\n if (otherInner !== undefined && otherInner.kind === SyntaxKind.NumericLiteral) {\n const text = this.numericLiteralF64Text(otherInner);\n if (text === undefined) return undefined;\n return `${this.printNode(definite, 0)}.as_f64() ${operator} Some(${text})`;\n }\n if (this.rustR09NumericOperand(other) === undefined) return undefined;\n return `${this.printNode(left, 0)}.as_f64() ${operator} ${this.printNode(right, 0)}.as_f64()`;\n }\n\n // `a + b` / `a - b` with a definite Int operand and a numeric one: the helper's Int/Float dispatch.\n // `s + n` / `n + s` with s a non-null string and n numeric: the helper's string branch, i.e.\n // `stringify_simple` of each side, which equals `Display` for Str/Int/Float/Null.\n rustR09NativeAddSubtract(op, left, right, leftType, rightType, leftText: string, rightText: string): string | undefined {\n if (op !== SyntaxKind.PlusToken && op !== SyntaxKind.MinusToken) return undefined;\n const leftNumeric = this.rustR09NumericOperand(left);\n const rightNumeric = this.rustR09NumericOperand(right);\n if ((leftNumeric === 'definite' && rightNumeric !== undefined) || (rightNumeric === 'definite' && leftNumeric !== undefined)) {\n return this.printNativeNumeric(op, leftText, rightText);\n }\n if (op !== SyntaxKind.PlusToken) return undefined;\n const stringSide = this.isStringLikeType(leftType) && rightNumeric !== undefined ? left\n : (this.isStringLikeType(rightType) && leftNumeric !== undefined ? right : undefined);\n if (stringSide === undefined || !this.printsValueExpression(stringSide)) return undefined;\n const inner = this.unwrapParensNode(stringSide);\n if (inner !== undefined && (this.rustStringLocalIdentifierIsTyped(inner) || this.rustNativeStrCalleeKind(inner) === 'str')) return undefined;\n return this.printNativeStringConcat(leftText, rightText);\n }\n\n // hx4 R10 — native reads on receivers the R01 plain-dict proof admits (tag-free literal /\n // `account ()` / `omit` / `extend` / tuple element 0 locals) and on `Dict`-annotated parameters\n // whose writes keep them plain: no marker route of `get_value` can fire on such a receiver.\n\n /** 'local' for an R01-proven plain-dict local, 'param' for a plain-kept dict parameter. */\n rustR10PlainReceiver(node: Node): 'local' | 'param' | undefined {\n if (node === undefined || !isIdentifier(node) || this.rustParamShadowOf(node) !== undefined) return undefined;\n const declaration: any = this.rustSingleLocalDeclaration(node as Identifier);\n if (declaration !== undefined && isParameterDeclaration(declaration)) {\n if (declaration.type === undefined || declaration.dotDotDotToken !== undefined) return undefined;\n const type = this.getCheckedTypeOf(declaration.type);\n if (type === undefined || !this.isProvenMapType(type)) return undefined;\n return this.rustParamStaysPlainDict(declaration) ? 'param' : undefined;\n }\n try {\n return (this.rustR01LocalStaysPlain(node as Identifier) || this.rustR01ShippedPlain(node as Identifier)) ? 'local' : undefined;\n } catch (e) {\n return undefined;\n }\n }\n\n /** A literal-key read (`x['k']` / `x.k`) on a proven plain receiver. */\n rustR10LiteralReadOk(receiverNode: Node, keyText: string): boolean {\n const kind = this.rustR10PlainReceiver(receiverNode);\n if (kind === undefined || keyText === '') return false;\n if (kind === 'param' && RustTranspiler.RUST_DICT_LOCAL_UNSAFE_KEYS.has(keyText)) return false;\n const read: any = receiverNode.parent;\n return read === undefined || !this.isWriteBackBindRead(read);\n }\n\n /** `x[k]` on a proven plain receiver with a `Value` key place (`string` or `any` typed). */\n rustR10DynamicRead(receiverText: string, receiverNode: Node, keyNode: Node): string | undefined {\n const kind = this.rustR10PlainReceiver(receiverNode);\n if (kind === undefined) return undefined;\n const key: any = this.rustSkipWrappers(keyNode);\n if (key === undefined || !isIdentifier(key) || this.rustStringLocalIdentifierIsTyped(key)) return undefined;\n const type = this.getCheckedTypeOf(key);\n if (type === undefined || !((type.flags & TypeFlags.Any) || this.rustKeyIsProvenString(key))) return undefined;\n const read = this.rustElementReadOfKey(keyNode);\n if (read !== undefined && this.isWriteBackBindRead(read)) return undefined;\n const keyText = this.printNode(keyNode, 0).trim();\n if (!/^[A-Za-z_][A-Za-z0-9_]*$/.test(keyText)) return undefined;\n if (kind === 'param' && this.rustNodeIsKeyUnsafePlace(keyText)) return undefined;\n return `${receiverText}.as_map().and_then(|__m| ${keyText}.as_str().and_then(|__k| __m.get(__k))).cloned().unwrap_or(Value::Null)`;\n }\n\n // hx4 R11 — typed `Vec` locals also admit an argument of a non-`&mut self` `this.m(..)`\n // call that is not the final use (boxed as `Value::from(x.clone())`, the clone the post-pass\n // gave the boxed local) and a plain `x[i]` read with a number index (native `Vec::get`).\n r11VecUse(n): boolean {\n const parent = n.parent;\n if (isCallExpression(parent) && parent.arguments.some((a) => a === n)) {\n const callee: any = parent.expression;\n if (!isPropertyAccessExpression(callee)) return false;\n const kind = callee.expression.kind;\n if (kind !== SyntaxKind.ThisKeyword && kind !== SyntaxKind.SuperKeyword) return false;\n if (RustTranspiler.MUT_SELF_METHODS.has(this.toSnakeCaseName(String(callee.name.text)))) return false;\n let mentions = 0;\n const visit = (m) => { if (m.kind === SyntaxKind.Identifier && m.text === n.text) mentions++; m.forEachChild?.(visit); };\n parent.arguments.forEach(visit);\n if (mentions !== 1) return false;\n return this.rustVecValueUse(n, String(n.text)) || !this.r11LoopBetween(n);\n }\n return isElementAccessExpression(parent) && parent.expression === n && this.r11VecReadShape(parent);\n }\n\n // A loop around the use that does not also hold the declaration: a per-iteration Vec clone\n // would cost O(n) where the boxed local only bumped its Arc.\n r11LoopBetween(n): boolean {\n const declaration = this.rustVecLocalDeclarationOf(n) ?? this.rustSingleLocalDeclaration(n);\n const fn = this.rustEnclosingFunction(n);\n for (let current: any = n.parent; current !== undefined && current !== fn; current = current.parent) {\n if (declaration !== undefined && this.isNodeInsideNode(declaration, current)) return false;\n switch (current.kind) {\n case SyntaxKind.ForStatement: case SyntaxKind.ForInStatement: case SyntaxKind.ForOfStatement:\n case SyntaxKind.WhileStatement: case SyntaxKind.DoStatement:\n return true;\n }\n }\n return false;\n }\n\n // `x[k]` as a plain value read: not a write/delete/++ target, not a chain or call receiver,\n // not a bind the next statement mutates (ccxt's write-back keys on `get_value` text).\n r11VecReadShape(access): boolean {\n const up: any = access.parent;\n if (up === undefined || isDeleteExpression(up) || up.kind === SyntaxKind.PrefixUnaryExpression\n || up.kind === SyntaxKind.PostfixUnaryExpression) return false;\n if (isBinaryExpression(up) && up.left === access && rustIsAssignmentOperator(up.operatorToken.kind)) return false;\n if ((isPropertyAccessExpression(up) || isElementAccessExpression(up) || isCallExpression(up)) && up.expression === access) return false;\n if (this.isWriteBackBindRead(access)) return false;\n const key: any = this.rustStripWrappers(access.argumentExpression);\n if (key === undefined) return false;\n if (isNumericLiteral(key)) return Number.isInteger(Number(key.text)) && Number(key.text) >= 0;\n // a `Value` number counter (`let i = 0`), as for the native dynamic list index\n return this.isRustValueIndexKey(key);\n }\n\n printElementAccessExpressionExceptionIfAny(node) {\n const receiver: any = node?.expression;\n if (receiver?.kind !== SyntaxKind.Identifier || this.rustVecLocalDeclarationOf(receiver) === undefined\n || !this.r11VecReadShape(node)) return super.printElementAccessExpressionExceptionIfAny(node);\n const name = this.printNode(receiver, 0).trim();\n const key: any = this.rustStripWrappers(node.argumentExpression);\n // `get_value`'s array arm: an Int index by `as usize` (negative misses), anything else misses.\n const index = isNumericLiteral(key) ? String(Number(key.text))\n : `(${this.printNode(node.argumentExpression, 0).trim()}).as_i64().map_or(usize::MAX, |__n| __n as usize)`;\n return `${name}.get(${index}).cloned().unwrap_or(Value::Null)`;\n }\n\n // An expression that always holds a `Value::Arr`: a runtime-split / array-literal-returning call,\n // or a never-reassigned local initialised from one (through `const y = x` aliases).\n r11ProvenListValue(node, depth = 0): boolean {\n const inner = this.rustStripWrappers(node);\n if (inner === undefined || depth > 4 || this.rustIsOrderBookSide(inner)) return false;\n if (isCallExpression(inner)) return this.rustCallReturnsProvenList(inner);\n if (!isIdentifier(inner)) return false;\n const declaration: any = this.rustSingleLocalDeclaration(inner);\n if (declaration === undefined || !isVariableDeclaration(declaration) || declaration.initializer === undefined\n || !isIdentifier(declaration.name)) return false;\n if (this.rustLocalIsReassigned(declaration, String(declaration.name.text))) return false;\n return this.r11ProvenListValue(declaration.initializer, depth + 1);\n }\n\n // hx4 R12 — plain-dict sources from base `safeDict*` reads of unshared dicts and same-file\n // sync request builders; native truthiness / bool equality on operands proven `Value::Bool`\n // or `Value::Null` at runtime (bool tuple elements, bool-returning exchange methods).\n\n /** Base-tier bool readers whose Rust form returns `Value::Bool` or `Value::Null`\n * (`safe_bool*` keep only `Value::Bool` or the default; the `check_option_bool` stub). */\n private static readonly RUST_R12_BOOL_READERS: { [name: string]: number } = { safeBool: 2, safeBool2: 3, safeBoolN: 2, checkOptionBool: -1 };\n private static readonly RUST_R12_DICT_READERS: { [name: string]: number } = { safeDict: 2, safeDict2: 3, safeDictN: 2 };\n /** A REST venue file (`ts/src/.ts`): no base / pro / prediction tier. */\n private static readonly RUST_R12_REST_FILE = /ts\\/src\\/[^/]+\\.ts$/;\n\n /** Extra plain-dict write sources (R01 write-history proof), REST venue files only: no\n * runtime tagged handle (book, ws subscription, cache bucket) is reachable there. */\n private rustR12Visiting = new Set();\n\n rustR12PlainSource(node: any, depth = 0): boolean {\n if (depth > 4 || !isCallExpression(node) || !isPropertyAccessExpression(node.expression)\n || node.expression.expression.kind !== SyntaxKind.ThisKeyword\n || !this.r23PlainSourceTier(node)) {\n return false;\n }\n const callee = String(node.expression.name.text);\n const defaultIndex = RustTranspiler.RUST_R12_DICT_READERS[callee];\n if (defaultIndex !== undefined) {\n const fallback: any = this.rustStripWrappers(node.arguments[defaultIndex]);\n return this.rustR01CalleeIsBase(node) && node.arguments.length <= defaultIndex + 1\n && (fallback === undefined || this.rustPlainDictLiteral(fallback) || this.rustTypeIsUndefinedish(fallback))\n && this.rustR12UnsharedDict(node.arguments[0]) && this.r23TierSourceOk(node.arguments[0]);\n }\n if (this.r23FreshCopy(node, depth)) return true;\n return this.rustR12PlainBuilder(node, depth);\n }\n\n /** `this.options`, a parameter, or a const local whose initializer reads no `this` field\n * but `options` and no tagged container (`hashmap`, `subscriptions`, `futures`). */\n rustR12UnsharedDict(arg: any): boolean {\n const node: any = this.rustStripWrappers(arg);\n if (node === undefined) return false;\n if (isPropertyAccessExpression(node) && node.expression.kind === SyntaxKind.ThisKeyword) {\n return String(node.name.text) === 'options';\n }\n if (!isIdentifier(node)) return false;\n const declaration: any = this.rustSingleLocalDeclaration(node);\n if (declaration === undefined) return false;\n // runtime tags live on pro-only fields; a REST method's parameter is caller data\n if (isParameterDeclaration(declaration)) return true;\n if (!isVariableDeclaration(declaration) || (declaration.parent?.flags & NodeFlags.Const) === 0 || declaration.initializer === undefined) return false;\n let clean = true;\n const visit = (n: any) => {\n if (!clean) return;\n if (isPropertyAccessExpression(n)) {\n const field = String(n.name.text);\n const isCallee = isCallExpression(n.parent) && n.parent.expression === n;\n if (RustTranspiler.RUST_TAGGED_CONTAINER_FIELDS.has(field)\n || (n.expression.kind === SyntaxKind.ThisKeyword && !isCallee && field !== 'options')) {\n clean = false;\n return;\n }\n }\n n.forEachChild(visit);\n };\n visit(declaration.initializer);\n return clean;\n }\n\n /** `this.m (…)` on a sync method of the calling file whose every `return` is a plain\n * literal, a plain local, or `this.extend|omit|keysort (plain, …unshared)`. */\n rustR12PlainBuilder(call: any, depth: number): boolean {\n const method: any = this.rustR12MethodImpl(call);\n if (method === undefined || method.getSourceFile() !== call.getSourceFile()\n || (method.modifiers ?? []).some((m: any) => m.kind === SyntaxKind.AsyncKeyword)) {\n return false;\n }\n // a builder whose proof reaches itself again (recursion through locals) proves nothing\n if (this.rustR12Visiting.has(method)) return false;\n this.rustR12Visiting.add(method);\n let plain = true;\n let returns = 0;\n try {\n this.rustWalkScope(method.body, (n) => {\n if (isArrowFunction(n) || n.kind === SyntaxKind.FunctionExpression) return RUST_WALK_SKIP;\n if (!isReturnStatement(n)) return;\n returns++;\n if (!this.rustR12PlainReturn(n.expression, depth)) { plain = false; return RUST_WALK_STOP; }\n });\n } finally {\n this.rustR12Visiting.delete(method);\n }\n return plain && returns > 0;\n }\n\n rustR12PlainReturn(expr: any, depth: number): boolean {\n const node: any = this.rustStripWrappers(expr);\n if (node === undefined) return false;\n const plainHead = (head: any): boolean => {\n const h: any = this.rustStripWrappers(head);\n return h !== undefined && (this.rustPlainDictLiteral(h)\n || (isIdentifier(h) && this.rustR01LocalStaysPlain(h, depth + 1)) || this.rustR12PlainSource(h, depth + 1));\n };\n if (plainHead(node)) return true;\n if (!isCallExpression(node) || !isPropertyAccessExpression(node.expression)\n || node.expression.expression.kind !== SyntaxKind.ThisKeyword || node.arguments.length === 0\n || !this.rustR01CalleeIsBase(node)) {\n return false;\n }\n const callee = String(node.expression.name.text);\n if (callee === 'omit' || callee === 'keysort') return plainHead(node.arguments[0]);\n return callee === 'extend' && plainHead(node.arguments[0])\n && node.arguments.slice(1).every((a) => plainHead(a) || (this.rustR12UnsharedDict(a) && this.r23TierSourceOk(a)));\n }\n\n /** The single bodied method declaration `this.m (…)` resolves to (implementation of an\n * overload set), in the calling file or the base tier. */\n rustR12MethodImpl(call: any): any {\n const checker: any = this.checkerOrUndefined();\n const callee: any = call?.expression;\n if (checker === undefined || !isPropertyAccessExpression(callee) || callee.expression.kind !== SyntaxKind.ThisKeyword) {\n return undefined;\n }\n let declarations: any[];\n try {\n declarations = symbolDeclarations(checker.getSymbolAtLocation(callee.name))\n .filter((d: any) => d.kind === SyntaxKind.MethodDeclaration && d.body !== undefined);\n } catch (e) {\n return undefined;\n }\n // a base-tier caller may dispatch to any venue override\n const callerFile = String(call.getSourceFile().fileName).replace(/\\\\/g, '/');\n if (declarations.length !== 1 || RustTranspiler.RUST_BASE_TIER_FILE.test(callerFile)) return undefined;\n const file = String(declarations[0].getSourceFile().fileName).replace(/\\\\/g, '/');\n return declarations[0].getSourceFile() === call.getSourceFile() || RustTranspiler.RUST_BASE_TIER_FILE.test(file)\n ? declarations[0] : undefined;\n }\n\n /** The expression's Rust value is always `Value::Bool(_)` or `Value::Null`. */\n rustR12BoolValue(expr: any, depth = 0): boolean {\n let node: any = this.rustStripWrappers(expr);\n while (node !== undefined && node.kind === SyntaxKind.AwaitExpression) node = this.rustStripWrappers(node.expression);\n if (node === undefined || depth > 5) return false;\n switch (node.kind) {\n case SyntaxKind.TrueKeyword:\n case SyntaxKind.FalseKeyword:\n case SyntaxKind.NullKeyword:\n return true;\n case SyntaxKind.Identifier:\n return node.text === 'undefined' || this.rustR12BoolLocal(node, depth + 1);\n case SyntaxKind.PrefixUnaryExpression:\n return node.operator === SyntaxKind.ExclamationToken;\n case SyntaxKind.BinaryExpression: {\n const op = node.operatorToken.kind;\n return RustTranspiler.COMPARISON_OPS.has(op) || this.isLogicalOp(op);\n }\n case SyntaxKind.ConditionalExpression:\n return this.rustR12BoolValue(node.whenTrue, depth + 1) && this.rustR12BoolValue(node.whenFalse, depth + 1);\n case SyntaxKind.CallExpression:\n return this.rustR12BoolCall(node, depth);\n }\n return false;\n }\n\n /** A base `safeBool*` with a bool default, `checkOptionBool`, or a method (calling file or\n * base tier) whose every `return` is such a value. */\n rustR12BoolCall(call: any, depth: number): boolean {\n if (!isPropertyAccessExpression(call.expression) || call.expression.expression.kind !== SyntaxKind.ThisKeyword) return false;\n const reader = RustTranspiler.RUST_R12_BOOL_READERS[String(call.expression.name.text)];\n if (reader !== undefined) {\n if (!this.rustR01CalleeIsBase(call)) return false;\n return reader < 0 || call.arguments.length <= reader\n || (call.arguments.length === reader + 1 && this.rustR12BoolValue(call.arguments[reader], depth + 1));\n }\n // at least one return must be a real bool: an all-`undefined` stub proves nothing\n let sawBool = false;\n return this.rustR12EveryReturn(call, depth, (e) => {\n const nullish = this.rustTypeIsUndefinedish(this.rustStripWrappers(e) ?? e);\n sawBool = sawBool || !nullish;\n return nullish || this.rustR12BoolValue(e, depth + 1);\n }) && sawBool;\n }\n\n rustR12EveryReturn(call: any, depth: number, ok: (e: any) => boolean): boolean {\n const method: any = this.rustR12MethodImpl(call);\n if (method === undefined || this.rustR12Visiting.has(method)) return false;\n this.rustR12Visiting.add(method);\n let proven = true;\n let returns = 0;\n try {\n this.rustWalkScope(method.body, (n) => {\n if (isArrowFunction(n) || n.kind === SyntaxKind.FunctionExpression) return RUST_WALK_SKIP;\n if (!isReturnStatement(n)) return;\n returns++;\n if (n.expression === undefined || !ok(n.expression)) { proven = false; return RUST_WALK_STOP; }\n });\n } finally {\n this.rustR12Visiting.delete(method);\n }\n return proven && returns > 0;\n }\n\n /** Element `index` of `this.m (…)`'s tuple is a bool value on every return path. */\n rustR12BoolTupleElement(expr: any, index: number, depth: number): boolean {\n let call: any = this.rustStripWrappers(expr);\n while (call !== undefined && call.kind === SyntaxKind.AwaitExpression) call = this.rustStripWrappers(call.expression);\n if (call === undefined || !isCallExpression(call) || depth > 5) return false;\n return this.rustR12EveryReturn(call, depth, (e) => {\n const tuple: any = this.rustStripWrappers(e);\n if (tuple?.kind === SyntaxKind.ArrayLiteralExpression) {\n const element = tuple.elements[index];\n return element !== undefined && element.kind !== SyntaxKind.SpreadElement && this.rustR12BoolValue(element, depth + 1);\n }\n return this.rustR12BoolTupleElement(tuple, index, depth + 1);\n });\n }\n\n /** A local whose declaration and every write store a bool value. Locals the printer or\n * ccxt's narrowBoolLocals may declare `bool` (bool-expression initializer) are left out. */\n rustR12BoolLocal(ident: any, depth: number): boolean {\n const checker: any = this.checkerOrUndefined();\n if (depth > 5) return false;\n const declarations: any[] = checker === undefined ? [] : symbolDeclarations(checker.getSymbolAtLocation(ident));\n const declaration: any = declarations.length === 1 ? declarations[0] : undefined;\n if (declaration === undefined) return false;\n let nameNode: any;\n let variable: any;\n if (declaration.kind === SyntaxKind.BindingElement) {\n const pattern: any = declaration.parent;\n variable = pattern?.parent;\n if (pattern?.kind !== SyntaxKind.ArrayBindingPattern || variable === undefined || !isVariableDeclaration(variable)\n || declaration.initializer !== undefined || declaration.dotDotDotToken !== undefined\n || declaration.name?.kind !== SyntaxKind.Identifier\n || !this.rustR12BoolTupleElement(variable.initializer, pattern.elements.indexOf(declaration), depth)) {\n return false;\n }\n nameNode = declaration.name;\n } else if (isVariableDeclaration(declaration) && declaration.name?.kind === SyntaxKind.Identifier) {\n const init: any = this.rustStripWrappers(declaration.initializer);\n if (init !== undefined && (this.rustNodeIsBoolExpression(init)\n || !(this.rustTypeIsUndefinedish(init) || (isIdentifier(init) && init.text === 'undefined') || this.rustR12BoolValue(init, depth)))) {\n return false;\n }\n variable = declaration;\n nameNode = declaration.name;\n } else {\n return false;\n }\n const scope = this.rustEnclosingFunction(variable);\n const symbol = this.rustSymbolOf(nameNode);\n const name = String(nameNode.text);\n if (scope === undefined || isSourceFile(scope) || symbol === undefined) return false;\n for (const node of this.rustScopeNameNodes(scope, name) as any[]) {\n if (node.kind !== SyntaxKind.Identifier || node === nameNode || this.rustSymbolOf(node) !== symbol) continue;\n if (this.rustEnclosingFunction(node) !== scope) return false;\n let target: any = node;\n while (target.parent !== undefined && (isParenthesizedExpression(target.parent) || isNonNullExpression(target.parent) || isAsExpression(target.parent))) target = target.parent;\n const parent: any = target.parent;\n if (isBinaryExpression(parent) && parent.left === target && rustIsAssignmentOperator(parent.operatorToken.kind)) {\n if (parent.operatorToken.kind !== SyntaxKind.EqualsToken || this.rustNodeIsBoolExpression(this.rustStripWrappers(parent.right))\n || !this.rustR12BoolValue(parent.right, depth)) return false;\n } else if (parent?.kind === SyntaxKind.ArrayLiteralExpression) {\n const assign: any = parent.parent;\n if (assign !== undefined && isBinaryExpression(assign) && assign.left === parent\n && !this.rustR12BoolTupleElement(assign.right, parent.elements.indexOf(target), depth)) return false;\n } else if ((parent?.kind === SyntaxKind.PrefixUnaryExpression && parent.operator !== SyntaxKind.ExclamationToken) || parent?.kind === SyntaxKind.PostfixUnaryExpression\n || parent?.kind === SyntaxKind.DeleteExpression\n || ((isForOfStatement(parent) || isForInStatement(parent)) && parent.initializer === target)) {\n return false;\n }\n }\n return true;\n }\n\n /** `if (x)` on a local or `this.m (…)` proven a bool value: `x.as_bool() == Some(true)`\n * is `is_true` on `Value::Bool`/`Value::Null`; bool slots only (leading-token boxing). */\n rustR12NativeTruthiness(node: any): string | undefined {\n const inner: any = this.unwrapParens(node);\n if (inner === undefined || (!isIdentifier(inner) && !isCallExpression(inner))\n || !this.printsValueExpression(inner) || !this.isBareBoolEmissionSafe(node)\n || (isCallExpression(inner) && this.rustCallPrintsBool(inner)) || !this.rustR12BoolValue(inner)) {\n return undefined;\n }\n // the text ccxt's is_true post-pass prints for the same proof; `!` needs the parens\n const text = `${this.printNode(inner, 0)}.as_bool() == Some(true)`;\n let current: any = node;\n while (current.parent !== undefined && isParenthesizedExpression(current.parent)) current = current.parent;\n const negated = current.parent?.kind === SyntaxKind.PrefixUnaryExpression && current.parent.operator === SyntaxKind.ExclamationToken;\n return negated ? `(${text})` : text;\n }\n\n /** `x === true|false` with `x` proven a bool value: `is_equal` against a `Value::Bool` is\n * the payload compare there (Null matches neither). */\n rustR12NativeBoolEquality(left: any, right: any, op: any): string | undefined {\n const leftLiteral = left.kind === SyntaxKind.TrueKeyword || left.kind === SyntaxKind.FalseKeyword;\n const rightLiteral = right.kind === SyntaxKind.TrueKeyword || right.kind === SyntaxKind.FalseKeyword;\n if (leftLiteral === rightLiteral) return undefined;\n const [ literal, other ] = leftLiteral ? [ left, right ] : [ right, left ];\n const inner: any = this.unwrapParens(other);\n if (inner === undefined || (!isIdentifier(inner) && !isCallExpression(inner)) || !this.printsValueExpression(inner)\n || (isCallExpression(inner) && this.rustCallPrintsBool(inner)) || !this.rustR12BoolValue(inner)) {\n return undefined;\n }\n const operator = (op === SyntaxKind.EqualsEqualsToken || op === SyntaxKind.EqualsEqualsEqualsToken) ? '==' : '!=';\n return `${this.printNode(inner, 0)}.as_bool() ${operator} Some(${literal.kind === SyntaxKind.TrueKeyword ? 'true' : 'false'})`;\n }\n\n // hx4 R13 — proven-`Str` operands: a `this.safeString*` call (no default or a string-literal\n // default) or a native-`Str` callee re-boxed into `Value`, or a `const`/never-reassigned local\n // initialized from one, can only hold `Value::Str` / `Value::Null`, whatever its TS type says.\n rustR13ProvenStrSource(node): boolean {\n const inner: any = this.unwrapParensNode(node);\n if (inner === undefined || !isCallExpression(inner)) return false;\n if (this.rustNativeStrCalleeKind(inner) === 'str') return true;\n const callee: any = inner.expression;\n if (!isPropertyAccessExpression(callee) || callee.expression.kind !== SyntaxKind.ThisKeyword) return false;\n const name = callee.name.text;\n if (!RustTranspiler.RUST_STRING_LOCAL_HELPERS.has(name)) return false;\n const arity = /N$/.test(name) || !/2$/.test(name) ? 2 : 3;\n const args = inner.arguments ?? [];\n if (args.length === arity) return true;\n return args.length === arity + 1 && (isStringLiteral(args[arity]) || isNoSubstitutionTemplateLiteral(args[arity]));\n }\n\n rustR13ProvenStrIdentifier(node): boolean {\n if (node === undefined || !isIdentifier(node) || this.rustStringLocalIdentifierIsTyped(node)) return false;\n const checker: any = this.checkerOrUndefined();\n const declarations: any[] = checker === undefined ? [] : symbolDeclarations(checker.getSymbolAtLocation(node));\n if (declarations.length !== 1 || !isVariableDeclaration(declarations[0])) return false;\n const declaration: any = declarations[0];\n if (declaration.name?.kind !== SyntaxKind.Identifier || !this.rustR13ProvenStrSource(declaration.initializer)) return false;\n // every later write keeps the proof (D2): only `x = `\n return this.rustLocalUsesAll(declaration, declaration.name.text, true, (n) => {\n if (this.rustR13WriteTarget(n)) return false;\n const parent: any = n.parent;\n if (parent?.kind !== SyntaxKind.BinaryExpression || parent.left !== n) return !(parent?.kind === SyntaxKind.PrefixUnaryExpression || parent?.kind === SyntaxKind.PostfixUnaryExpression) || parent.operator === SyntaxKind.ExclamationToken;\n const op = parent.operatorToken.kind;\n if (op < SyntaxKind.FirstAssignment || op > SyntaxKind.LastAssignment) return true;\n return op === SyntaxKind.EqualsToken && this.rustR13ProvenStrSource(parent.right);\n });\n }\n\n /** A destructuring / for-in-of target: a write the direct-assignment check cannot see. */\n rustR13WriteTarget(node): boolean {\n let current: any = node;\n let parent: any = node.parent;\n while (parent !== undefined && (isArrayLiteralExpression(parent) || isObjectLiteralExpression(parent) || isParenthesizedExpression(parent)\n || parent.kind === SyntaxKind.PropertyAssignment || parent.kind === SyntaxKind.ShorthandPropertyAssignment || parent.kind === SyntaxKind.SpreadElement)) {\n current = parent;\n parent = parent.parent;\n }\n if ((isForOfStatement(parent) || isForInStatement(parent)) && parent.initializer === current) return true;\n return current !== node && isBinaryExpression(parent) && parent.left === current && parent.operatorToken.kind === SyntaxKind.EqualsToken;\n }\n\n /** `x` / `(x as string)` → the identifier under parens / `as`. */\n rustR13PeelCast(node): any {\n let current: any = node;\n while (current !== undefined && (isParenthesizedExpression(current) || isAsExpression(current))) current = current.expression;\n return current;\n }\n\n /** Printed text of an operand that is always `Value::Str` / `Value::Null`, else undefined:\n * a proven-`Str` local, a checker-`string` declared local/param (the R06 needle rule), or\n * `\"lit\" + e` / `e + \"lit\"` (the `add` helper's string branch always yields `Value::Str`). */\n rustR13StrOperand(node, allowChecker: boolean): string | undefined {\n const inner = this.rustR13PeelCast(node);\n if (inner === undefined) return undefined;\n if (isIdentifier(inner)) {\n if (this.rustStringLocalIdentifierIsTyped(inner)) return undefined;\n const proven = this.rustR13ProvenStrIdentifier(inner);\n const checked = allowChecker && this.isDeclaredValueIdentifier(inner)\n && this.primitiveKindOfType(this.typeOfNodeIfAny(inner)) === 'string';\n if (!proven && !checked) return undefined;\n const text = this.printNode(inner, 0).trim();\n return /^[A-Za-z_][A-Za-z0-9_]*$/.test(text) ? text : undefined;\n }\n if (allowChecker && isBinaryExpression(inner) && inner.operatorToken.kind === SyntaxKind.PlusToken\n && (isStringLiteral(inner.left) || isStringLiteral(inner.right))) {\n const text = this.printNode(inner, 0).trim();\n return text.includes('\\n') ? undefined : `(${text})`;\n }\n return undefined;\n }\n\n // `a === b` with both sides proven `Str`/`Null`: `is_equal` is exactly the derived `PartialEq`\n // there (Null==Null, Str by content, Str vs Null false — its f64 fallback needs a number).\n printRustR13ProvenStrEquality(left, right, op): string | undefined {\n if (!this.rustR13ProvenStrIdentifier(this.unwrapParensNode(left)) || !this.rustR13ProvenStrIdentifier(this.unwrapParensNode(right))) return undefined;\n const operator = (op === SyntaxKind.EqualsEqualsToken || op === SyntaxKind.EqualsEqualsEqualsToken) ? '==' : '!=';\n return `${this.printNode(left, 0)} ${operator} ${this.printNode(right, 0)}`;\n }\n\n /** Receiver text when the call's receiver is a proven-`Str` local (R06 covers checker strings). */\n rustR13Receiver(node, receiverText: string): string | undefined {\n if (node === undefined || !isCallExpression(node) || !isPropertyAccessExpression(node.expression)) return undefined;\n const receiver = this.rustR13PeelCast(node.expression.expression);\n if (!this.rustR13ProvenStrIdentifier(receiver)) return undefined;\n const text = (receiverText ?? '').trim();\n return /^[A-Za-z_][A-Za-z0-9_]*$/.test(text) ? text : undefined;\n }\n\n /** R06's checker-string receiver, when it prints as a bare name (it is read twice). */\n rustR13PlainReceiver(node, receiverText: string): string | undefined {\n const receiver = this.rustNativeStringReceiver(node, receiverText);\n return receiver !== undefined && /^[A-Za-z_][A-Za-z0-9_]*$/.test(receiver) ? receiver : undefined;\n }\n\n // `s.replace(p, \"lit\")`: the helper replaces every occurrence when all three are `Str`, else\n // returns the receiver; `p` is a proven/checker string operand.\n printRustR13Replace(node, receiverText: string): string | undefined {\n if (node?.arguments?.length !== 2) return undefined;\n const receiver = this.rustR13Receiver(node, receiverText) ?? this.rustR13PlainReceiver(node, receiverText);\n const to = this.rustNativeStringLiteralArg(node.arguments[1]);\n if (receiver === undefined || to === undefined || this.rustNativeStringLiteralArg(node.arguments[0]) !== undefined) return undefined;\n const from = this.rustR13StrOperand(node.arguments[0], true);\n if (from === undefined) return undefined;\n return `${receiver}.as_str().zip(${from}.as_str()).map(|(__s, __p)| Value::Str(__s.replace(__p, \"${to}\").into())).unwrap_or_else(|| ${receiver}.clone())`;\n }\n\n // `s.split(d)` with a proven/checker string delimiter: the parts, `[]` unless both are `Str`.\n printRustR13Split(node, receiverText: string): string | undefined {\n if (node?.arguments?.length !== 1 || this.rustNativeStringLiteralArg(node.arguments[0]) !== undefined) return undefined;\n const receiver = this.rustR13Receiver(node, receiverText) ?? this.rustR13PlainReceiver(node, receiverText);\n const delim = receiver === undefined ? undefined : this.rustR13StrOperand(node.arguments[0], true);\n if (delim === undefined) return undefined;\n return `Value::Array(${receiver}.as_str().zip(${delim}.as_str()).map(|(__s, __d)| __s.split(__d).map(|__p| Value::Str(__p.to_string().into())).collect()).unwrap_or_default())`;\n }\n\n // `x.toString()` on a proven-`Str` local: `stringify_simple` of `Str`/`Null` is `Display`.\n printRustR13ToString(node, receiverText: string): string | undefined {\n const receiver = this.rustR13Receiver(node, receiverText);\n return receiver === undefined || (node.arguments?.length ?? 0) !== 0 ? undefined : `Value::Str(format!(\"{}\", ${receiver}).into())`;\n }\n\n // `x.toUpperCase()` / `x.toLowerCase()` on a proven-`Str` local (any TS type).\n printRustR13Case(node, receiverText: string, method: string): string | undefined {\n const receiver = this.rustR13Receiver(node, receiverText);\n return receiver === undefined || (node.arguments?.length ?? 0) !== 0 ? undefined : `${receiver}.as_str().map(|__s| Value::Str(__s.${method}().into())).unwrap_or(Value::Null)`;\n }\n\n // hx4 R14 — the R12 plain-dict proof reaches overloaded base readers (`safeDict` declares\n // bodiless overload signatures; the implementation in the same class is what runs).\n\n /** A bodiless overload signature whose class also holds the bodied implementation. */\n r14BaseOverload(declaration: any): boolean {\n if (declaration?.kind !== SyntaxKind.MethodDeclaration || declaration.body !== undefined || !isIdentifier(declaration.name)) return false;\n const name = String(declaration.name.text);\n return (declaration.parent?.members ?? []).some((m: any) => m.kind === SyntaxKind.MethodDeclaration\n && m.body !== undefined && isIdentifier(m.name) && String(m.name.text) === name);\n }\n\n /** `x[a ± b]` on a checker-proven list, each operand a numeric literal, a `Value` loop\n * counter or a `const n = y.length` local: the key prints as a `Value` number, so the\n * list arm of `get_value` (Int index, else miss) is spelled natively. */\n r14ListArithIndex(receiverText: string, receiverNode: Node, keyNode: Node): string | undefined {\n const key: any = this.rustSkipWrappers(keyNode);\n if (!this.isProvenListExpression(receiverNode) || key === undefined || !isBinaryExpression(key)\n || (key.operatorToken.kind !== SyntaxKind.MinusToken && key.operatorToken.kind !== SyntaxKind.PlusToken)\n || !this.r14ValueNumberOperand(key.left) || !this.r14ValueNumberOperand(key.right)) return undefined;\n if (this.isWriteBackBindRead(keyNode.parent)) return undefined;\n const keyText = this.printNode(keyNode, 0).trim();\n if (!keyText || keyText.startsWith('&')) return undefined;\n return `${receiverText}.as_array().and_then(|__arr| match &(${keyText}) { Value::Int(__n) if *__n >= 0 => __arr.get(*__n as usize), _ => None }).cloned().unwrap_or(Value::Null)`;\n }\n\n r14ValueNumberOperand(node: any): boolean {\n const operand: any = this.rustSkipWrappers(node);\n if (operand === undefined) return false;\n if (isNumericLiteral(operand)) return Number.isInteger(Number(operand.text));\n if (!isIdentifier(operand)) return false;\n if (this.isRustValueIndexKey(operand)) return true;\n if (this.rustParamShadowOf(operand) !== undefined || this.rustStringLocalIdentifierIsTyped(operand)) return false;\n const declaration: any = this.rustDeclarationOfIdentifier(operand);\n if (declaration === undefined || !isVariableDeclaration(declaration) || (declaration.parent?.flags & NodeFlags.Const) === 0) return false;\n const init: any = this.rustSkipWrappers(declaration.initializer);\n return init !== undefined && isPropertyAccessExpression(init) && String(init.name.text) === 'length';\n }\n\n // hx4 R15 — `Vec` locals also admit `x.join(\"lit\")` on a `string[]` (native join of the\n // elements' Display text, as the helper's `stringify_simple` prints `Str`/`Null`) and an\n // object-literal property value no push follows (boxed `Value::from(x.clone())`).\n r15VecJoinUse(access): boolean {\n const call: any = access.parent;\n if (!isCallExpression(call) || call.expression !== access || String(access.name.text) !== 'join' || call.arguments.length !== 1) return false;\n if (this.rustNativeStringLiteralArg(call.arguments[0]) === undefined) return false;\n const checker: any = this.checkerOrUndefined();\n const type: any = checker?.getTypeAtLocation(access.expression);\n if (type === undefined || !checker.isArrayType(type)) return false;\n return this.primitiveKindOfType(checker.getTypeArguments?.(type)?.[0]) === 'string';\n }\n\n r15PrintVecJoin(node): string | undefined {\n const access: any = node?.expression;\n if (!isPropertyAccessExpression(access) || !isIdentifier(access.expression)\n || this.rustVecLocalDeclarationOf(access.expression) === undefined || !this.r15VecJoinUse(access)) return undefined;\n const literal = this.rustNativeStringLiteralArg(node.arguments[0]);\n const name = this.printNode(access.expression, 0).trim();\n return `Value::Str(${name}.iter().map(|__v| __v.to_string()).collect::>().join(\"${literal}\").into())`;\n }\n\n // `{ 'k': x }` with `x` named once in the statement, outside any loop the declaration is not in,\n // and no `x.push` after it: the clone is the array's final contents, as the aliased box was.\n r15VecPropertyUse(n): boolean {\n const parent: any = n.parent;\n if (parent?.kind !== SyntaxKind.PropertyAssignment || parent.initializer !== n || this.r11LoopBetween(n)) return false;\n const name = String(n.text);\n let statement: any = parent;\n while (statement !== undefined && !isStatement(statement)) statement = statement.parent;\n if (statement === undefined) return false;\n let count = 0;\n const visit = (m) => { if (m.kind === SyntaxKind.Identifier && m.text === name) count++; m.forEachChild?.(visit); };\n visit(statement);\n if (count !== 1) return false;\n const fn = this.rustEnclosingFunction(n);\n const end = n.getEnd?.() ?? n.end;\n return !(this.rustScopeNameNodes(fn, name) as any[]).some((m) => m.kind === SyntaxKind.Identifier && m !== n\n && (m.getStart?.() ?? m.pos) >= end && isPropertyAccessExpression(m.parent) && m.parent.expression === m\n && String(m.parent.name.text) === 'push');\n }\n // hx4 R16 — numeric operand kinds beyond the checker: 'definite' = always Int/Float (never Null),\n // 'number' = Int/Float/Null. Covers `this.sum` of numbers, numeric same-file method returns,\n // locals whose every write is numeric, and flow-narrowed (guarded non-undefined) number identifiers.\n private rustR16InProgress = new Set();\n private rustR16Assumed = new Set();\n\n rustR16NumericKind(node, depth = 0): string | undefined {\n const inner: any = this.rustStripWrappers(node);\n if (inner === undefined || depth > 8) return undefined;\n if (this.rustR16InProgress.has(inner)) return this.r22AssumedNumericSelf(inner);\n this.rustR16InProgress.add(inner);\n try {\n const structural = this.rustR16StructuralKind(inner, depth);\n if (structural === 'definite') return 'definite';\n if (structural === 'number') return 'number';\n return this.rustOperandKind(inner) === 'number' ? 'number' : undefined;\n } catch (e) {\n return undefined;\n } finally {\n this.rustR16InProgress.delete(inner);\n }\n }\n\n rustR16Combine(kinds: (string | undefined)[]): string | undefined {\n if (kinds.length === 0 || kinds.some((k) => k === undefined)) return undefined;\n return kinds.every((k) => k === 'definite') ? 'definite' : 'number';\n }\n\n rustR16StructuralKind(inner: any, depth: number): string | undefined {\n if (inner.kind === SyntaxKind.NumericLiteral) return 'definite';\n if (isPrefixUnaryExpression(inner) && inner.operator === SyntaxKind.MinusToken && inner.operand.kind === SyntaxKind.NumericLiteral) return 'definite';\n if (this.rustR09IsDefiniteInt(inner)) return 'definite';\n if (isCallExpression(inner) && this.callExpressionName(inner) === 'indexOf') return 'definite';\n if (isBinaryExpression(inner)) {\n const op = inner.operatorToken.kind;\n if (op !== SyntaxKind.PlusToken && op !== SyntaxKind.MinusToken && op !== SyntaxKind.AsteriskToken\n && op !== SyntaxKind.SlashToken && op !== SyntaxKind.PercentToken) return undefined;\n const both = this.rustR16Combine([ this.rustR16NumericKind(inner.left, depth + 1), this.rustR16NumericKind(inner.right, depth + 1) ]);\n // `/` and `%` answer Null for a zero divisor\n return (both === 'definite' && (op === SyntaxKind.SlashToken || op === SyntaxKind.PercentToken)) ? 'number' : both;\n }\n if (isCallExpression(inner)) return this.rustR16CallKind(inner, depth);\n if (isIdentifier(inner)) return this.rustR16IdentifierKind(inner, depth);\n return undefined;\n }\n\n rustR16CallKind(call: any, depth: number): string | undefined {\n const callee = call.expression;\n if (!isPropertyAccessExpression(callee) || callee.expression.kind !== SyntaxKind.ThisKeyword) return undefined;\n if (String(callee.name.text) === 'sum') {\n return this.rustR16Combine(call.arguments.map((a) => this.rustR16NumericKind(a, depth + 1)));\n }\n let declaration: any;\n try {\n declaration = signatureDeclaration((this.getChecker() as any).getResolvedSignature(call));\n } catch (e) {\n return undefined;\n }\n if (declaration?.kind !== SyntaxKind.MethodDeclaration || declaration.body === undefined\n || declaration.getSourceFile() !== call.getSourceFile()) return undefined;\n const kinds: (string | undefined)[] = [];\n const visit = (n: any) => {\n if (n !== declaration && isFunctionLike(n)) return;\n if (isReturnStatement(n)) kinds.push(n.expression === undefined ? undefined : this.rustR16NumericKind(n.expression, depth + 1));\n n.forEachChild?.(visit);\n };\n declaration.body.forEachChild(visit);\n return this.rustR16Combine(kinds) === undefined ? undefined : 'number';\n }\n\n rustR16IdentifierKind(ident: any, depth: number): string | undefined {\n if (this.rustParamShadowOf(ident) !== undefined || !this.printsValueExpression(ident)) return undefined;\n const declaration: any = this.rustSingleLocalDeclaration(ident);\n if (declaration === undefined || declaration.name?.kind !== SyntaxKind.Identifier) return undefined;\n // a guard removed `undefined` from a nullable declaration: the box is Int/Float here\n const here: any = this.typeOfNodeIfAny(ident);\n const declared: any = this.typeOfNodeIfAny(declaration.name);\n if (here !== undefined && declared !== undefined && (here.flags === TypeFlags.Number || here.flags === TypeFlags.NumberLiteral)\n && (declared.flags & TypeFlags.Union) && (typeParts(declared) ?? []).some((t: any) => t.flags & (TypeFlags.Undefined | TypeFlags.Null))\n && !this.rustR16HasWrites(declaration)) {\n return 'definite';\n }\n // an explicit annotation (`let a: any = 1`) declares a polymorphic box: keep the helper\n if (!isVariableDeclaration(declaration) || declaration.initializer === undefined || declaration.type !== undefined) return undefined;\n // inductive: a write reading the local itself (`r = this.sum (r, n)`) assumes it numeric\n if (this.rustR16Assumed.has(declaration)) return 'number';\n this.rustR16Assumed.add(declaration);\n try {\n return this.rustR16WrittenKind(declaration, depth);\n } finally {\n this.rustR16Assumed.delete(declaration);\n }\n }\n\n rustR16WrittenKind(declaration: any, depth: number): string | undefined {\n const kinds: (string | undefined)[] = [ this.rustR16NumericKind(declaration.initializer, depth + 1) ];\n const fn = this.rustEnclosingFunction(declaration);\n if (fn === undefined) return undefined;\n const name = String(declaration.name.text);\n for (const m of this.rustScopeNameNodes(fn, name) as any[]) {\n if (m.kind !== SyntaxKind.Identifier || m === declaration.name) continue;\n const parent: any = m.parent;\n if (isBinaryExpression(parent) && parent.left === m && rustIsAssignmentOperator(parent.operatorToken.kind)) {\n const op = parent.operatorToken.kind;\n const right = this.rustR16NumericKind(parent.right, depth + 1);\n if (op === SyntaxKind.EqualsToken || op === SyntaxKind.PlusEqualsToken || op === SyntaxKind.MinusEqualsToken || op === SyntaxKind.AsteriskEqualsToken) kinds.push(right);\n else if (op === SyntaxKind.SlashEqualsToken || op === SyntaxKind.PercentEqualsToken) kinds.push(right === undefined ? undefined : 'number');\n else kinds.push(undefined);\n } else if ((parent?.kind === SyntaxKind.PrefixUnaryExpression || parent?.kind === SyntaxKind.PostfixUnaryExpression)\n && (parent.operator === SyntaxKind.PlusPlusToken || parent.operator === SyntaxKind.MinusMinusToken)) {\n continue;\n } else if (parent !== undefined && ((isArrayLiteralExpression(parent) && isBinaryExpression(parent.parent) && parent.parent.left === parent)\n || ((isForOfStatement(parent) || isForInStatement(parent)) && parent.initializer === m))) {\n kinds.push(undefined);\n }\n }\n return this.rustR16Combine(kinds);\n }\n\n // No assignment / `++` / `--` names the binding: only control-flow guards narrow it.\n rustR16HasWrites(declaration: any): boolean {\n const fn = isParameterDeclaration(declaration) ? declaration.parent : this.rustEnclosingFunction(declaration);\n if (fn === undefined) return true;\n return (this.rustScopeNameNodes(fn, String(declaration.name.text)) as any[]).some((m) => {\n const parent: any = m.parent;\n if (m.kind !== SyntaxKind.Identifier || m === declaration.name) return false;\n return (isBinaryExpression(parent) && parent.left === m && rustIsAssignmentOperator(parent.operatorToken.kind))\n || parent?.kind === SyntaxKind.PrefixUnaryExpression && (parent.operator === SyntaxKind.PlusPlusToken || parent.operator === SyntaxKind.MinusMinusToken)\n || parent?.kind === SyntaxKind.PostfixUnaryExpression;\n });\n }\n\n // Both sides Int/Float/Null: `<`/`>` are f64 compares with Null false; `<=`/`>=` also OR in\n // `is_equal` (Null == Null), so they need one never-null side.\n rustR16OrderedProven(op, left, right): boolean {\n const l = this.rustR16NumericKind(left);\n const r = this.rustR16NumericKind(right);\n if (l === undefined || r === undefined) return false;\n return op === SyntaxKind.LessThanToken || op === SyntaxKind.GreaterThanToken || l === 'definite' || r === 'definite';\n }\n\n // `a - b` / `a * b` / `a / b` / `a % b` on operands proven Int/Float/Null: the helper's dispatch.\n rustR16NativeArithmetic(op, left, right, leftText: string, rightText: string): string | undefined {\n if (op !== SyntaxKind.MinusToken && op !== SyntaxKind.AsteriskToken && op !== SyntaxKind.SlashToken && op !== SyntaxKind.PercentToken) return undefined;\n if (!this.printsValueExpression(this.rustStripWrappers(left)) || !this.printsValueExpression(this.rustStripWrappers(right))) return undefined;\n if (this.rustR16NumericKind(left) === undefined || this.rustR16NumericKind(right) === undefined) return undefined;\n if (op !== SyntaxKind.PercentToken) return this.printNativeNumeric(op, leftText, rightText);\n return `(match (&(${leftText}), &(${rightText})) {` +\n ' (Value::Int(x), Value::Int(y)) if *y != 0 => Value::Int(x % y),' +\n ' (Value::Int(x), Value::Float(y)) if *y != 0.0 => Value::Float(*x as f64 % *y),' +\n ' (Value::Float(x), Value::Int(y)) if *y != 0 => Value::Float(*x % *y as f64),' +\n ' (Value::Float(x), Value::Float(y)) if *y != 0.0 => Value::Float(x % y),' +\n ' _ => Value::Null })';\n }\n\n // hx4 R17 — string helpers on proven-`Str` operands. `add(a, b)` with one side always a\n // `Value::Str` takes the helper's `string_concat` arm, which is `Display` for every box but a\n // Precise dict (only `new Precise` locals, typed `Precise`), so the other side may be any non-Precise box.\n r17AlwaysStr(node): boolean {\n const inner: any = this.unwrapParensNode(node);\n if (inner === undefined) return false;\n if (isStringLiteral(inner) || isNoSubstitutionTemplateLiteral(inner)) return true;\n if (isBinaryExpression(inner) && inner.operatorToken.kind === SyntaxKind.PlusToken) return this.r17AlwaysStr(inner.left) || this.r17AlwaysStr(inner.right);\n return isCallExpression(inner) && isPropertyAccessExpression(inner.expression) && inner.expression.name.text === 'toString'\n && (inner.arguments?.length ?? 0) === 0 && this.printsValueExpression(inner.expression.expression);\n }\n\n r17ConcatOperandSafe(node, type): boolean {\n if (this.r17AlwaysStr(node)) return true;\n const inner: any = this.unwrapParensNode(node);\n if (!this.printsValueExpression(inner) || this.rustNativeStrCalleeKind(inner) === 'str') return false;\n // typed `String`/`Vec` locals print without a `Value` box\n if (isIdentifier(inner) && (this.rustStringLocalIdentifierIsTyped(inner) || this.rustVecLocalDeclarationOf(inner) !== undefined)) return false;\n const parts: any[] = type === undefined ? [] : ((type.flags & TypeFlags.Union) ? (typeParts(type) ?? []) : [type]);\n return parts.length > 0 && parts.every((t) => String(t?.symbol?.escapedName ?? t?.symbol?.name ?? '') !== 'Precise');\n }\n\n r17ConcatIsAnchored(left, right, leftType, rightType): boolean {\n return (this.r17AlwaysStr(left) && this.r17ConcatOperandSafe(right, rightType))\n || (this.r17AlwaysStr(right) && this.r17ConcatOperandSafe(left, leftType));\n }\n\n /** R06 checker-string or R13 proven-`Str` receiver printed as a plain name / parenthesised. */\n r17Receiver(node, receiverText: string): string | undefined {\n return this.rustNativeStringReceiver(node, receiverText) ?? this.rustR13Receiver(node, receiverText);\n }\n\n // `x.trim()`: the helper's `Str` arm is `str::trim`, Null otherwise.\n r17PrintTrim(node, receiverText: string): string | undefined {\n const receiver = this.r17Receiver(node, receiverText);\n if (receiver === undefined || (node.arguments?.length ?? 0) !== 0) return undefined;\n return `${receiver}.as_str().map(|__s| Value::Str(__s.trim().to_string().into())).unwrap_or(Value::Null)`;\n }\n\n // `x.startsWith(p)` / `x.endsWith(p)` with a proven/checker string operand: false unless both are `Str`.\n r17PrintAffixTest(node, receiverText: string, method: string): string | undefined {\n if (node?.arguments?.length !== 1) return undefined;\n const receiver = this.r17Receiver(node, receiverText);\n const arg = receiver === undefined ? undefined : this.rustR13StrOperand(node.arguments[0], true);\n if (arg === undefined) return undefined;\n return `${receiver}.as_str().zip(${arg}.as_str()).is_some_and(|(__s, __p)| __s.${method}(__p))`;\n }\n\n // `x.replace(p, r)` / `x.replaceAll(p, r)`: both helpers replace every occurrence when all three\n // are `Str`, else return the receiver; `p`/`r` are literals or proven/checker string operands.\n r17PrintReplace(node, receiverText: string): string | undefined {\n if (node?.arguments?.length !== 2) return undefined;\n const receiver = this.r17Receiver(node, receiverText);\n if (receiver === undefined || !/^[A-Za-z_][A-Za-z0-9_.]*$/.test(receiver)) return undefined;\n const operand = (arg) => {\n const literal = this.rustNativeStringLiteralArg(arg);\n return literal !== undefined ? `Value::Str(\"${literal}\".into())` : this.rustR13StrOperand(arg, true);\n };\n const from = operand(node.arguments[0]);\n const to = operand(node.arguments[1]);\n if (from === undefined || to === undefined) return undefined;\n return `match (${receiver}.as_str(), ${from}.as_str(), ${to}.as_str()) { (Some(__s), Some(__p), Some(__r)) => Value::Str(__s.replace(__p, __r).into()), _ => ${receiver}.clone() }`;\n }\n\n // hx4 R18 — collection helpers on locals whose runtime shape is proven: `\"k\" in x` on an R10\n // plain-dict receiver, `Object.keys/values` on one in prediction sources, and `.length` /\n // `.push` on a `Value::Arr`-only local (never a book/cache marker the helpers route).\n\n /** `\"lit\" in x` where x is an R10-proven plain local / plain-kept Dict parameter. */\n r18LiteralInOp(key, obj): string | undefined {\n if (!isStringLiteral(key) || this.r05IsTest(key)) return undefined;\n const recv: any = this.rustStripWrappers(obj);\n if (recv === undefined || !isIdentifier(recv) || this.rustR10PlainReceiver(recv) === undefined) return undefined;\n const keyLiteral = this.rustStringLiteralOf(this.printStringLiteral(key));\n if (keyLiteral === undefined) return undefined;\n return `Value::Bool(matches!(&${this.printNode(recv, 0).trim()}, Value::Dict(__d) if __d.contains_key(${keyLiteral})))`;\n }\n\n /** `Object.keys/values(x)` in `ts/src/prediction/.ts` on an R10-proven plain local. */\n r18PredictionEnum(node, parsedArg: string | undefined, kind: 'keys' | 'values'): string | undefined {\n const arg: any = this.rustStripWrappers(node?.arguments?.[0]);\n if (arg === undefined || parsedArg === undefined || !isIdentifier(arg)\n || !/\\/ts\\/src\\/prediction\\/[^/]+\\.ts$/.test(this.r05Path(node))\n || this.rustR10PlainReceiver(arg) !== 'local') return undefined;\n const body = kind === 'keys' ? '__m.keys().map(|__k| Value::Str(__k.clone().into())).collect()' : '__m.values().cloned().collect()';\n return `Value::Array(${parsedArg.trim()}.as_map().map(|__m| ${body}).unwrap_or_default())`;\n }\n\n /** Base-tier array readers whose result is the stored `Value::Arr` or the default argument. */\n private static readonly RUST_R18_LIST_READERS: { [name: string]: number } = { safeList: 2, safeList2: 3, safeListN: 2 };\n\n /** A source that is a `Value::Arr` or `Value::Null` (both helpers agree with `len()` / a no-op\n * push there): `[...]`, nullish, a runtime `split`, base `toArray`, or a base `safeList*`\n * read whose default is absent, nullish or `[...]`. */\n r18ArrSource(node: any, allowNull: boolean): boolean {\n const n: any = this.rustStripWrappers(node);\n if (n === undefined) return false;\n if (this.r21ArrSource(n)) return true;\n if (isArrayLiteralExpression(n)) return !n.elements.some((e: any) => e.kind === SyntaxKind.SpreadElement);\n if (n.kind === SyntaxKind.NullKeyword || (isIdentifier(n) && String(n.text) === 'undefined')) return allowNull;\n if (this.rustCallPrintsRuntimeSplit(n)) return true;\n if (!isCallExpression(n) || !isPropertyAccessExpression(n.expression) || n.expression.expression.kind !== SyntaxKind.ThisKeyword) return false;\n const callee = String(n.expression.name.text);\n if (callee === 'toArray') return n.arguments.length === 1 && this.rustR01CalleeIsBase(n);\n const index = RustTranspiler.RUST_R18_LIST_READERS[callee];\n if (index === undefined || n.arguments.length > index + 1) return false;\n const fallback: any = this.rustStripWrappers(n.arguments[index]);\n const arrDefault = fallback !== undefined && isArrayLiteralExpression(fallback);\n return (arrDefault || (allowNull && (fallback === undefined || fallback.kind === SyntaxKind.NullKeyword\n || (isIdentifier(fallback) && String(fallback.text) === 'undefined')))) && this.rustR01CalleeIsBase(n);\n }\n\n /** A local whose every write (declaration included) is an `r18ArrSource`, never captured by\n * a closure: its `Value` is a plain `Value::Arr` (the runtime never tags an array). */\n r18ArrLocal(ident: any, allowNull: boolean): boolean {\n if (ident === undefined || !isIdentifier(ident) || this.rustParamShadowOf(ident) !== undefined || this.r05IsTest(ident)) return false;\n const declaration: any = this.rustSingleLocalDeclaration(ident);\n if (declaration === undefined || !isVariableDeclaration(declaration) || !isIdentifier(declaration.name)\n || !this.r18ArrSource(declaration.initializer, allowNull)) return false;\n const scope = this.rustEnclosingFunction(declaration);\n if (scope === undefined || isSourceFile(scope) || this.rustEnclosingFunction(ident) !== scope) return false;\n const name = String(declaration.name.text);\n const symbol = this.rustSymbolOf(declaration.name);\n if (symbol === undefined) return false;\n for (const n of this.rustScopeNameNodes(scope, name) as any[]) {\n if (n.kind !== SyntaxKind.Identifier || n === declaration.name || this.rustSymbolOf(n) !== symbol) continue;\n if (this.rustEnclosingFunction(n) !== scope) return false;\n let target: any = n;\n while (target.parent !== undefined && (isParenthesizedExpression(target.parent) || isNonNullExpression(target.parent) || isAsExpression(target.parent))) target = target.parent;\n const parent: any = target.parent;\n if (parent === undefined) continue;\n // a dict-literal field aliasing the local feeds ccxt's writeBackAliasedArrayMutations (keys on the helper)\n if (parent.kind === SyntaxKind.ShorthandPropertyAssignment || (parent.kind === SyntaxKind.PropertyAssignment && parent.initializer === target)) return false;\n if (isBinaryExpression(parent) && parent.left === target && rustIsAssignmentOperator(parent.operatorToken.kind)) {\n if (parent.operatorToken.kind !== SyntaxKind.EqualsToken || !this.r18ArrSource(parent.right, allowNull)) return false;\n continue;\n }\n if (parent.kind === SyntaxKind.ArrayLiteralExpression && isBinaryExpression(parent.parent) && parent.parent.left === parent) return false;\n if ((parent.kind === SyntaxKind.PrefixUnaryExpression || parent.kind === SyntaxKind.PostfixUnaryExpression)\n && (parent.operator === SyntaxKind.PlusPlusToken || parent.operator === SyntaxKind.MinusMinusToken)) return false;\n }\n return true;\n }\n\n /** `x.length` on an Arr-only local: `get_array_length`'s marker arms need a Dict. */\n r18ArrLength(node, receiver: string): string | undefined {\n const recv: any = this.rustStripWrappers(node?.expression);\n if (!this.r18ArrLocal(recv, true)) return undefined;\n return `Value::Int(${receiver}.len() as i64)`;\n }\n\n /** `x.push(v)` statement on an Arr-only local: `append_to_array`'s cache-push arm needs a Dict. */\n r18ArrPush(node, name: string | undefined, parsedArg: string | undefined): string | undefined {\n const recv: any = node?.expression?.expression;\n if (name === undefined || parsedArg === undefined || node?.arguments?.length !== 1\n || node.arguments[0].kind === SyntaxKind.SpreadElement || node.parent?.kind !== SyntaxKind.ExpressionStatement\n || !this.r18ArrLocal(recv, false) || name.trim() !== this.printNode(recv, 0).trim()) return undefined;\n // the argument is evaluated while `name` is mutably borrowed: it must not read it\n if (!this.rustVecPushShape(node, String(recv.text))) return undefined;\n const arg = parsedArg.trim();\n // `append_to_array` takes the value by move; ccxt's post-pass cloned a bare local there.\n const value = /^[a-zA-Z_][a-zA-Z0-9_]*$/.test(arg) && arg !== 'self' && arg !== 'true' && arg !== 'false' ? `${arg}.clone()` : arg;\n return `if let Value::Arr(__a) = &mut ${name} { std::sync::Arc::make_mut(__a).push(${value}); }`;\n }\n\n // hx4 R20 — `startsWith/endsWith(..) === true|false` compares the runtime fn's bare bool\n // (is_equal of two Bool boxes is the payload compare); `a + b` on R16 numeric kinds is the\n // `add` helper's Int/Float/Null dispatch, the same native match as `-`/`*`.\n r20BoolCallEquality(left, right, op): string | undefined {\n const l: any = this.unwrapParensNode(left);\n const r: any = this.unwrapParensNode(right);\n const isBoolLit = (n: any) => n?.kind === SyntaxKind.TrueKeyword || n?.kind === SyntaxKind.FalseKeyword;\n if (isBoolLit(l) === isBoolLit(r)) return undefined;\n const literal: any = isBoolLit(l) ? l : r;\n const call: any = isBoolLit(l) ? r : l;\n if (!isCallExpression(call) || !isPropertyAccessExpression(call.expression)) return undefined;\n const name = String(call.expression.name.text);\n if ((name !== 'startsWith' && name !== 'endsWith') || call.arguments.length !== 1) return undefined;\n const text = this.printNode(call, 0).trim();\n const fn = name === 'startsWith' ? 'starts_with' : 'ends_with';\n const m = /^Value::Bool\\((.*)\\)$/s.exec(text);\n if (m === null || !m[1].startsWith(`${fn}(`) || !this.r20Balanced(m[1]) || text.includes('\\n')) return undefined;\n const equals = op === SyntaxKind.EqualsEqualsToken || op === SyntaxKind.EqualsEqualsEqualsToken;\n return (literal.kind === SyntaxKind.TrueKeyword) === equals ? m[1] : `!${m[1]}`;\n }\n\n /** `fn(...)` whose first `(` closes at the very end (string literals skipped). */\n r20Balanced(text: string): boolean {\n let depth = 0;\n for (let i = 0; i < text.length; i++) {\n const c = text[i];\n if (c === '\"') { for (i++; i < text.length && text[i] !== '\"'; i++) if (text[i] === '\\\\') i++; continue; }\n if (c === '(') depth++;\n else if (c === ')') { depth--; if (depth === 0 && i !== text.length - 1) return false; }\n }\n return depth === 0 && text.endsWith(')');\n }\n\n r20NativeNumericAdd(op, left, right, leftText: string, rightText: string): string | undefined {\n if (op !== SyntaxKind.PlusToken) return undefined;\n if (!this.printsValueExpression(this.rustStripWrappers(left)) || !this.printsValueExpression(this.rustStripWrappers(right))) return undefined;\n if (this.rustR16NumericKind(left) === undefined || this.rustR16NumericKind(right) === undefined) return undefined;\n return this.printNativeNumeric(op, leftText, rightText);\n }\n\n // hx4 R21 — `Object.keys/values` on an R10-proven plain local in the base tier (the\n // helper's ws-tag filter is a no-op on a map built from literals), and native map reads\n // that are the receiver of a non-mutating string method (`currency['id'].toUpperCase ()`).\n\n /** Base-tier (`ts/src/base/**`) `Object.keys/values(x)` on an R10-proven plain local. */\n r21BaseEnum(node, parsedArg: string | undefined, kind: 'keys' | 'values'): string | undefined {\n const arg: any = this.rustStripWrappers(node?.arguments?.[0]);\n if (arg === undefined || parsedArg === undefined || !isIdentifier(arg)\n || !RustTranspiler.RUST_BASE_TIER_FILE.test(this.r05Path(node))\n || this.rustR10PlainReceiver(arg) !== 'local') return undefined;\n const body = kind === 'keys' ? '__m.keys().map(|__k| Value::Str(__k.clone().into())).collect()' : '__m.values().cloned().collect()';\n return `Value::Array(${parsedArg.trim()}.as_map().map(|__m| ${body}).unwrap_or_default())`;\n }\n\n private static readonly RUST_R21_PURE_STRING_METHODS = new Set([ 'toUpperCase', 'toLowerCase', 'trim', 'startsWith', 'endsWith', 'split' ]);\n\n /** `x['k'].m (…)` with `m` a non-mutating string method on a checker-`string` read: no\n * ccxt pass rewrites that target (only `.push` / calls of the read itself). */\n r21PureStringMethodReceiver(node: any): boolean {\n const access: any = node?.parent;\n const call: any = access?.parent;\n if (!isElementAccessExpression(node) || access === undefined || !isPropertyAccessExpression(access) || access.expression !== node\n || call === undefined || !isCallExpression(call) || call.expression !== access\n || !RustTranspiler.RUST_R21_PURE_STRING_METHODS.has(String(access.name.text))) return false;\n const type = this.typeOfNodeIfAny(node);\n return type !== undefined && (type.flags & TypeFlags.StringLike) !== 0;\n }\n\n /** Locals whose Arr-only proof is in progress (a self-referencing write proves nothing new). */\n private r21ArrVisiting = new Set();\n\n /** More always-`Value::Arr` sources for the R18 proof: base `arrayConcat` (Array on every\n * arm), base `sortBy`/`sortBy2` of an Arr-only local (returns its input's variant), and a\n * plain alias of a non-nullable Arr-only local (COW: the push never reaches the alias). */\n r21ArrSource(n: any): boolean {\n if (isCallExpression(n) && isPropertyAccessExpression(n.expression) && n.expression.expression.kind === SyntaxKind.ThisKeyword) {\n const callee = String(n.expression.name.text);\n if (callee === 'arrayConcat') return n.arguments.length === 2 && this.rustR01CalleeIsBase(n);\n if (callee === 'sortBy' || callee === 'sortBy2') {\n const first: any = this.rustStripWrappers(n.arguments[0]);\n return first !== undefined && isIdentifier(first) && this.rustR01CalleeIsBase(n) && this.r21ArrAlias(first);\n }\n return false;\n }\n return isIdentifier(n) && String(n.text) !== 'undefined' && this.r21ArrAlias(n);\n }\n\n r21ArrAlias(ident: any): boolean {\n const declaration: any = this.rustSingleLocalDeclaration(ident);\n if (declaration === undefined || !isVariableDeclaration(declaration)) return false;\n // the local under proof: its other writes decide\n if (this.r21ArrVisiting.has(declaration)) return true;\n this.r21ArrVisiting.add(declaration);\n try {\n return this.r18ArrLocal(ident, false);\n } finally {\n this.r21ArrVisiting.delete(declaration);\n }\n }\n\n // hx4 R22 — an R16 local re-read inside its own write (`p = p + 4`) is the assumed kind.\n r22AssumedNumericSelf(inner: any): string | undefined {\n if (!isIdentifier(inner)) return undefined;\n const declaration: any = this.rustSingleLocalDeclaration(inner);\n return declaration !== undefined && this.rustR16Assumed.has(declaration) ? 'number' : undefined;\n }\n\n private r22StrVisiting = new Map();\n\n /** Always `Value::Str`: R17 shapes, a `+` chain with such an operand, or an always-Str local. */\n r22AlwaysStr(node: any): boolean {\n const inner: any = this.unwrapParensNode(node);\n if (inner === undefined) return false;\n if (this.r17AlwaysStr(inner)) return true;\n if (isBinaryExpression(inner) && inner.operatorToken.kind === SyntaxKind.PlusToken) return this.r22AlwaysStr(inner.left) || this.r22AlwaysStr(inner.right);\n return isIdentifier(inner) && this.r22AlwaysStrLocal(inner);\n }\n\n /** A plain `Value` local, never captured by a closure, whose every write is always-Str (`x += e`\n * keeps it), or Str|Null (R13 source / nullish) when the checker narrows this read to `string`. */\n r22AlwaysStrLocal(ident: any, allowNull = false): boolean {\n if (this.rustParamShadowOf(ident) !== undefined || this.rustStringLocalIdentifierIsTyped(ident) || this.rustVecLocalDeclarationOf(ident) !== undefined) return false;\n const declaration: any = this.rustSingleLocalDeclaration(ident);\n if (declaration === undefined || !isVariableDeclaration(declaration) || !isIdentifier(declaration.name) || declaration.initializer === undefined) return false;\n // inductive: a cycle back to a local under proof assumes that proof (strict covers lax)\n if (this.r22StrVisiting.has(declaration)) return allowNull || this.r22StrVisiting.get(declaration) === false;\n const fn = this.rustEnclosingFunction(declaration);\n if (fn === undefined) return false;\n const here: any = this.typeOfNodeIfAny(ident);\n const narrowed = allowNull || (here !== undefined && this.isStringLikeType(here));\n const nullish = (e: any) => { const n: any = this.unwrapParensNode(e); return n?.kind === SyntaxKind.NullKeyword || (isIdentifier(n) && String(n.text) === 'undefined'); };\n const local = (e: any) => { const n: any = this.unwrapParensNode(e); return isIdentifier(n) && (this.rustR13ProvenStrIdentifier(n) || this.r22AlwaysStrLocal(n, true)); };\n const source = (e: any) => this.r22AlwaysStr(e) || (narrowed && (nullish(e) || this.rustR13ProvenStrSource(e) || local(e)));\n this.r22StrVisiting.set(declaration, allowNull);\n try {\n if (!source(declaration.initializer)) return false;\n return this.rustLocalUsesAll(declaration, String(declaration.name.text), true, (n: any) => {\n if (this.rustEnclosingFunction(n) !== fn || this.rustR13WriteTarget(n)) return false;\n const parent: any = n.parent;\n if ((parent?.kind === SyntaxKind.PrefixUnaryExpression || parent?.kind === SyntaxKind.PostfixUnaryExpression) && parent.operator !== SyntaxKind.ExclamationToken) return false;\n if (!isBinaryExpression(parent) || parent.left !== n || !rustIsAssignmentOperator(parent.operatorToken.kind)) return true;\n const op = parent.operatorToken.kind;\n return op === SyntaxKind.PlusEqualsToken || (op === SyntaxKind.EqualsToken && source(parent.right));\n });\n } finally {\n this.r22StrVisiting.delete(declaration);\n }\n }\n\n r22ConcatAnchor(node: any): boolean {\n const inner: any = this.unwrapParensNode(node);\n return inner !== undefined && this.printsValueExpression(inner) && this.r22AlwaysStr(inner);\n }\n\n r22ConcatIsAnchored(left, right, leftType, rightType): boolean {\n return (this.r22ConcatAnchor(left) && this.r17ConcatOperandSafe(right, rightType))\n || (this.r22ConcatAnchor(right) && this.r17ConcatOperandSafe(left, leftType));\n }\n\n /** `Option<&str>` text of an operand that is always `Value::Str` / `Value::Null`, else undefined. */\n r22StrOrNullOperand(node: any): string | undefined {\n const inner: any = this.rustStripWrappers(node);\n if (inner === undefined) return undefined;\n if (isStringLiteral(inner)) return inner.text in this.StringLiteralReplacements ? undefined : `Some(${this.quotedStringLiteral(inner.text)})`;\n if (isIdentifier(inner) && this.r22AlwaysStrLocal(inner, true)) {\n const text = this.printNode(inner, 0).trim();\n return /^[A-Za-z_][A-Za-z0-9_]*$/.test(text) ? `${text}.as_str()` : undefined;\n }\n const operand = this.rustR13StrOperand(inner, true);\n return operand === undefined ? undefined : `${operand}.as_str()`;\n }\n\n // `a < b` (`<=`, `>`, `>=`) on Str|Null operands: the helper's f64 parse of both strings, else\n // `str` order; `<=`/`>=` OR in `is_equal` (string equality, Null == Null).\n r22StrOrderedComparison(node, op, left, right): string | undefined {\n const operator = RustTranspiler.NATIVE_COMPARISON_OPERATORS[op];\n const a = this.r22StrOrNullOperand(left);\n const b = a === undefined ? undefined : this.r22StrOrNullOperand(right);\n if (operator === undefined || b === undefined) return undefined;\n const strict = operator.charAt(0);\n const orEqual = operator.length === 2;\n const order = `(match (__x.parse::(), __y.parse::()) { (Ok(__p), Ok(__q)) => __p ${strict} __q, _ => __x ${strict} __y })`;\n const text = `(match (${a}, ${b}) { (Some(__x), Some(__y)) => ${order}${orEqual ? ' || __x == __y' : ''}, ${orEqual ? '(None, None) => true, ' : ''}_ => false })`;\n return this.isBooleanPosition(node) ? text : `Value::Bool(${text})`;\n }\n\n // hx4 R23 — the R12 plain sources (`safeDict*(x, k, {})`, same-file builders, `extend|omit`)\n // also hold in the base tier and pro files, where a tagged handle can only arrive through a\n // parameter: base admits typed plain-dict parameters, pro admits no parameter at all.\n r23Tier(node: Node): 'rest' | 'base' | 'pro' | undefined {\n const path = this.r05Path(node);\n if (RustTranspiler.RUST_R12_REST_FILE.test(path) && /\\/ts\\/src\\/[^/]+\\.ts$/.test(path)) return 'rest';\n if (RustTranspiler.RUST_BASE_TIER_FILE.test(path) && !/\\/base\\/ws\\//.test(path)) return 'base';\n if (/\\/ts\\/src\\/pro\\/[^/]+\\.ts$/.test(path)) return 'pro';\n return undefined;\n }\n\n r23PlainSourceTier(node: Node): boolean {\n return this.r23Tier(node) !== undefined;\n }\n\n /** A copied/read dict argument outside REST: in pro only `this.options` or a proven plain\n * local; in base also a parameter annotated with a plain-dict type (no `any` caller handle). */\n r23TierSourceOk(arg: any): boolean {\n const tier = this.r23Tier(arg);\n if (tier === 'rest') return true;\n const node: any = this.rustStripWrappers(arg);\n if (node === undefined || !isIdentifier(node)) return true;\n const declaration: any = this.rustSingleLocalDeclaration(node);\n // pro: a local read source must itself be proven plain (its root may be a handler parameter)\n if (tier === 'pro') return declaration !== undefined && !isParameterDeclaration(declaration) && this.rustR10PlainReceiver(node) === 'local';\n if (declaration === undefined || !isParameterDeclaration(declaration)) return true;\n if (tier !== 'base' || declaration.type === undefined || declaration.dotDotDotToken !== undefined) return false;\n const type = this.getCheckedTypeOf(declaration.type);\n return type !== undefined && this.isProvenMapType(type) && !this.rustParameterIsClientHandle(declaration);\n }\n\n /** `this.extend (plain, …unshared)` / `this.omit|keysort (plain, …)` called directly\n * (not only as a builder's return): the same fresh-copy proof as `rustR12PlainReturn`. */\n private r23CopyVisiting = new Set();\n\n r23FreshCopy(node: any, depth: number): boolean {\n const callee = String(node.expression.name.text);\n // the R01 -> R12 hop restarts `depth`: a copy reached again through its own local proves nothing\n if ((callee !== 'extend' && callee !== 'omit' && callee !== 'keysort') || this.r23CopyVisiting.has(node)) return false;\n this.r23CopyVisiting.add(node);\n try {\n return this.rustR12PlainReturn(node, depth);\n } finally {\n this.r23CopyVisiting.delete(node);\n }\n }\n\n // hx4 R25 — `a - b` / `a * b` / `a / b` and `a < b` (`<=`, `>`, `>=`) on unproven `Value`s print the\n // helper's own dispatch inline (f64 coercion: Int/Float, Str parse, Bool 1/0; `<=`/`>=` OR in\n // `is_equal`); `a + b` on two Str|Null operands (fields of same-file object literals) is `format!`.\n r25LooseF64(binding: string): string {\n return `(match ${binding} { Value::Int(__n) => Some(*__n as f64), Value::Float(__f) => Some(*__f), Value::Str(__s) => __s.parse::().ok(), Value::Bool(__b) => Some(if *__b { 1.0 } else { 0.0 }), _ => None })`;\n }\n\n r25PlainValueOperand(node: any): boolean {\n const inner: any = this.rustStripWrappers(node);\n if (inner === undefined || !this.printsValueExpression(inner) || this.rustNativeStrCalleeKind(inner) === 'str') return false;\n if (isIdentifier(inner) && this.rustParamShadowOf(inner) !== undefined) return false;\n return !(isIdentifier(inner) && (this.rustStringLocalIdentifierIsTyped(inner) || this.rustVecLocalDeclarationOf(inner) !== undefined));\n }\n\n r25NativeCoercingArithmetic(op, left, right, leftText: string, rightText: string): string | undefined {\n if (op === SyntaxKind.PlusToken) return this.r25NativeStrOrNullConcat(left, right, leftText, rightText);\n if (op !== SyntaxKind.MinusToken && op !== SyntaxKind.AsteriskToken && op !== SyntaxKind.SlashToken) return undefined;\n if (!this.r25PlainValueOperand(left) || !this.r25PlainValueOperand(right)) return undefined;\n const a = this.rustR16NumericKind(left) !== undefined ? '__a.as_f64()' : this.r25LooseF64('__a');\n const b = this.rustR16NumericKind(right) !== undefined ? '__b.as_f64()' : this.r25LooseF64('__b');\n if (op === SyntaxKind.SlashToken) {\n return `(match (&(${leftText}), &(${rightText})) { (__a, __b) => match (${a}, ${b}) { (Some(__x), Some(__y)) if __y != 0.0 => Value::Float(__x / __y), _ => Value::Null } })`;\n }\n const sign = op === SyntaxKind.MinusToken ? '-' : '*';\n return `(match (&(${leftText}), &(${rightText})) { (Value::Int(__x), Value::Int(__y)) => Value::Int(__x ${sign} __y),` +\n ` (__a, __b) => match (${a}, ${b}) { (Some(__x), Some(__y)) => Value::Float(__x ${sign} __y), _ => Value::Null } })`;\n }\n\n // is_less_than / is_greater_than: f64 order when both coerce, else `str` order of two Str;\n // the `-or_equal` forms OR in is_equal (Null==Null, same-variant payload, Int exact, else f64).\n r25NativeLooseOrderedComparison(node, op, left, right): string | undefined {\n const operator = RustTranspiler.NATIVE_COMPARISON_OPERATORS[op];\n if (operator === undefined || !this.r25PlainValueOperand(left) || !this.r25PlainValueOperand(right)) return undefined;\n const strict = operator.charAt(0);\n const p = `(${this.r25LooseF64('__a')}, ${this.r25LooseF64('__b')})`;\n const order = `(match ${p} { (Some(__x), Some(__y)) => __x ${strict} __y, _ => matches!((__a, __b), (Value::Str(__x), Value::Str(__y)) if __x ${strict} __y) })`;\n const equal = ` || (match (__a, __b) { (Value::Null, Value::Null) => true, (Value::Bool(__x), Value::Bool(__y)) => __x == __y, (Value::Str(__x), Value::Str(__y)) => __x == __y,` +\n ` (Value::Int(__x), Value::Int(__y)) => __x == __y, (Value::Float(__x), Value::Float(__y)) => __x == __y, _ => matches!(${p}, (Some(__x), Some(__y)) if __x == __y) })`;\n const text = `(match (&(${this.printNode(left, 0)}), &(${this.printNode(right, 0)})) { (__a, __b) => ${order}${operator.length === 2 ? equal : ''} })`;\n return this.isBooleanPosition(node) ? text : `Value::Bool(${text})`;\n }\n\n // Str+Str / Str+Null take `string_concat` (Display, Null is \"null\"); Null+Null is Null.\n r25NativeStrOrNullConcat(left, right, leftText: string, rightText: string): string | undefined {\n if (!this.r25StrOrNull(left, 0) || !this.r25StrOrNull(right, 0)) return undefined;\n return `(match (&(${leftText}), &(${rightText})) { (Value::Null, Value::Null) => Value::Null, (__a, __b) => Value::Str(format!(\"{}{}\", __a, __b).into()) })`;\n }\n\n r25StrOrNull(node: any, depth: number): boolean {\n const inner: any = this.rustStripWrappers(node);\n if (inner === undefined || depth > 12 || !this.r25PlainValueOperand(inner)) return false;\n if (isStringLiteral(inner) || this.r22AlwaysStr(inner)) return true;\n // `pad_start` / `pad_end` (helper or native form) answer Str or Null\n if (isCallExpression(inner) && isPropertyAccessExpression(inner.expression)\n && (String(inner.expression.name.text) === 'padStart' || String(inner.expression.name.text) === 'padEnd')) return true;\n if (!isElementAccessExpression(inner) || !isStringLiteral(inner.argumentExpression)) return false;\n return this.r25DictFieldStrOrNull(inner.expression, String(inner.argumentExpression.text), depth + 1);\n }\n\n /** Every dict `node` can evaluate to holds `key` as Str/Null or lacks it (a read of a missing key / non-dict is Null). */\n r25DictFieldStrOrNull(node: any, key: string, depth: number): boolean {\n const inner: any = this.rustStripWrappers(node);\n if (inner === undefined || depth > 12) return false;\n if (inner.kind === SyntaxKind.NullKeyword || (isIdentifier(inner) && String(inner.text) === 'undefined')) return true;\n if (isObjectLiteralExpression(inner)) {\n for (const p of inner.properties as any) {\n if (p.kind !== SyntaxKind.PropertyAssignment) return false;\n const name: any = p.name;\n const text = (isStringLiteral(name) || isIdentifier(name)) ? String(name.text) : undefined;\n if (text === undefined) return false;\n if (text === key && !this.r25StrOrNull(p.initializer, depth + 1)) return false;\n }\n return true;\n }\n if (isCallExpression(inner)) return this.r25MethodFieldStrOrNull(inner, key, depth + 1);\n if (!isIdentifier(inner)) return false;\n const declaration: any = this.rustSingleLocalDeclaration(inner);\n if (declaration === undefined || !isVariableDeclaration(declaration) || !isIdentifier(declaration.name)\n || declaration.initializer === undefined || (declaration.parent?.flags & NodeFlags.Const) === 0) return false;\n const fn = this.rustEnclosingFunction(declaration);\n if (fn === undefined) return false;\n // no element write / delete rooted at the local\n for (const m of this.rustScopeNameNodes(fn, String(declaration.name.text)) as any[]) {\n if (m === declaration.name || m.kind !== SyntaxKind.Identifier) continue;\n let top: any = m;\n while (isElementAccessExpression(top.parent) && top.parent.expression === top) top = top.parent;\n if (top === m) continue;\n const parent: any = top.parent;\n if (isDeleteExpression(parent) || (isBinaryExpression(parent) && parent.left === top && rustIsAssignmentOperator(parent.operatorToken.kind))) return false;\n }\n return this.r25DictFieldStrOrNull(declaration.initializer, key, depth + 1);\n }\n\n /** `this.m(..)` resolved to a same-file method with a body whose every return holds `key` as Str/Null. */\n r25MethodFieldStrOrNull(call: any, key: string, depth: number): boolean {\n const callee = call.expression;\n if (!isPropertyAccessExpression(callee) || callee.expression.kind !== SyntaxKind.ThisKeyword) return false;\n let declaration: any;\n try {\n declaration = signatureDeclaration((this.getChecker() as any).getResolvedSignature(call));\n } catch (e) {\n return false;\n }\n if (declaration?.kind !== SyntaxKind.MethodDeclaration || declaration.body === undefined\n || declaration.getSourceFile() !== call.getSourceFile() || RustTranspiler.RUST_BASE_TIER_FILE.test(this.r05Path(call))) return false;\n let ok = true;\n const visit = (n: any) => {\n if (!ok || (n !== declaration && isFunctionLike(n))) return;\n if (isReturnStatement(n) && n.expression !== undefined && !this.r25DictFieldStrOrNull(n.expression, key, depth + 1)) ok = false;\n n.forEachChild?.(visit);\n };\n declaration.body.forEachChild(visit);\n return ok;\n }\n\n // hx4 R26 — tuple slot 1 of the base `handle*AndParams` / `handleParam*` helpers is their\n // params argument or an `omit` copy of it: plain when that argument is a plain source.\n private static readonly R26_PARAMS_SLOT_ARG: { [name: string]: number } = {\n handleOptionAndParams: 0, handleOptionAndParams2: 0, handleOptionStringAndParams: 0, handleOptionStringAndParams2: 0,\n handleOptionBoolAndParams: 0, handleOptionBoolAndParams2: 0, handleOptionIntegerAndParams: 0, handleOptionIntegerAndParams2: 0,\n handleParamString: 0, handleParamString2: 0, handleParamInteger: 0, handleParamInteger2: 0, handleParamBool: 0, handleParamBool2: 0,\n handleNetworkCodeAndParams: 0, handleMarginModeAndParams: 1, handleMarketTypeAndParams: 2, handleSubTypeAndParams: 2,\n handleMaxEntriesPerRequestAndParams: 2,\n };\n\n r26ParamsSlot(rhs: Node, selfName: string | undefined, depth: number): boolean {\n const call: any = this.rustStripWrappers(rhs);\n if (depth > 4 || call === undefined || !isCallExpression(call) || !isPropertyAccessExpression(call.expression)\n || call.expression.expression.kind !== SyntaxKind.ThisKeyword || this.r23Tier(call) === undefined) {\n return false;\n }\n const index = RustTranspiler.R26_PARAMS_SLOT_ARG[String(call.expression.name.text)];\n if (index === undefined || !this.rustR01CalleeIsBase(call)) return false;\n const arg: any = this.rustStripWrappers(call.arguments[index]);\n // an omitted params argument takes the `{}` default\n if (arg === undefined) return call.arguments.length <= index;\n if (this.rustPlainDictLiteral(arg)) return true;\n if (!isIdentifier(arg)) return false;\n if (String(arg.text) === selfName) return true;\n const declaration: any = this.rustSingleLocalDeclaration(arg);\n if (declaration !== undefined && isParameterDeclaration(declaration)) {\n // REST parameters are caller data; base needs a typed non-Client dict; pro rejects\n return this.r23TierSourceOk(arg) && (this.r23Tier(arg) !== 'base' || this.rustParamStaysPlainDict(declaration));\n }\n try {\n return this.rustR10PlainReceiver(arg) === 'local';\n } catch (e) {\n return false;\n }\n }\n\n // hx4 R30 — `slice` / `indexOf` / `toUpperCase` / `toLowerCase` on unproven `Value`s print the\n // runtime helper's own dispatch inline (`runtime.rs` slice/get_index_of/to_upper/to_lower);\n // every operand is evaluated once, in the helper's argument order.\n r30LooseI64(expr: string): string {\n return `(match &(${expr}) { Value::Int(__n) => Some(*__n), Value::Float(__f) => Some(*__f as i64), Value::Str(__s) => __s.parse::().ok(), Value::Bool(__b) => Some(if *__b { 1 } else { 0 }), _ => None })`;\n }\n\n r30SliceArm(variant: string, len: string, take: string, empty: string): string {\n const bound = (b: string) => `if ${b} < 0 { (__l + ${b}).max(0) } else { ${b}.min(__l) }`;\n return `(${variant}, __b, __e) => match (${len}) { __l => match (${bound('__b')}, match __e { None => __l, Some(__k) => ${bound('__k')} }) { (__i, __j) => if __i <= __j { ${take} } else { ${empty} } } }`;\n }\n\n r30Slice(name: string, start: string, end: string): string {\n const str = this.r30SliceArm('Value::Str(__sv)', '__sv.chars().count() as i64',\n 'Value::Str(__sv.chars().skip(__i as usize).take((__j - __i) as usize).collect::().into())', 'Value::Str(String::new().into())');\n const arr = this.r30SliceArm('Value::Arr(__a)', '__a.len() as i64',\n 'Value::Array(__a[__i as usize..__j as usize].to_vec())', 'Value::Array(vec![])');\n return `(match (&(${name}), ${this.r30LooseI64(start)}.unwrap_or(0), ${this.r30LooseI64(end)}) { ${str}, ${arr}, _ => Value::Null })`;\n }\n\n r30IndexOf(name: string, needle: string): string {\n const eq = `match (__it, __nd) { (Value::Null, Value::Null) => true, (Value::Bool(__x), Value::Bool(__y)) => __x == __y, (Value::Str(__x), Value::Str(__y)) => __x == __y, (Value::Int(__x), Value::Int(__y)) => __x == __y, (Value::Float(__x), Value::Float(__y)) => __x == __y, (__p, __q) => match (${this.r25LooseF64('__p')}, ${this.r25LooseF64('__q')}) { (Some(__x), Some(__y)) => __x == __y, _ => false } }`;\n return `(match (&(${name}), &(${needle})) { (Value::Arr(__a), __nd) => Value::Int(__a.iter().position(|__it| ${eq}).map(|__i| __i as i64).unwrap_or(-1)), (Value::Str(__s), Value::Str(__nd)) => Value::Int(__s.find(&**__nd).map(|__i| __i as i64).unwrap_or(-1)), _ => Value::Int(-1) })`;\n }\n\n r30Case(name: string, method: string): string {\n return `(match &(${name}) { Value::Str(__s) => Value::Str(__s.${method}().into()), _ => Value::Null })`;\n }\n}\n","import { BaseTranspiler } from \"./baseTranspiler.js\";\nimport { SyntaxKind } from \"typescript/unstable/ast\";\nimport { isCallExpression, isExpressionStatement } from \"typescript/unstable/ast/is\";\nimport { type Checker } from \"typescript/unstable/sync\";\nimport { isFunctionLike } from \"./tsUtils.js\";\n\nconst parserConfig = {\n 'ELSEIF_TOKEN': 'else if',\n 'OBJECT_OPENING': 'std::unordered_map {',\n 'OBJECT_CLOSING': '}',\n 'ARRAY_OPENING_TOKEN': 'std::vector{',\n 'ARRAY_CLOSING_TOKEN': '}',\n 'PROPERTY_ASSIGNMENT_TOKEN': ',',\n 'VAR_TOKEN': 'std::any', // object\n 'METHOD_TOKEN': '',\n 'PROPERTY_ASSIGNMENT_OPEN': '{',\n 'PROPERTY_ASSIGNMENT_CLOSE': '}',\n 'SUPER_TOKEN': 'base',\n 'SUPER_CALL_TOKEN': 'base',\n 'FALSY_WRAPPER_OPEN': 'isTrue(',\n 'FALSY_WRAPPER_CLOSE': ')',\n 'COMPARISON_WRAPPER_OPEN' : \"isEqual(\",\n 'COMPARISON_WRAPPER_CLOSE' : \")\",\n 'UKNOWN_PROP_WRAPPER_OPEN': 'this.call(',\n 'UNKOWN_PROP_WRAPPER_CLOSE': ')',\n 'UKNOWN_PROP_ASYNC_WRAPPER_OPEN': 'this.callAsync(',\n 'UNKOWN_PROP_ASYNC_WRAPPER_CLOSE': ')',\n 'DYNAMIC_CALL_OPEN': 'callDynamically(',\n 'EQUALS_EQUALS_WRAPPER_OPEN': 'isEqual(',\n 'EQUALS_EQUALS_WRAPPER_CLOSE': ')',\n 'DIFFERENT_WRAPPER_OPEN': '!isEqual(',\n 'DIFFERENT_WRAPPER_CLOSE': ')',\n 'GREATER_THAN_WRAPPER_OPEN': 'isGreaterThan(',\n 'GREATER_THAN_WRAPPER_CLOSE': ')',\n 'GREATER_THAN_EQUALS_WRAPPER_OPEN': 'isGreaterThanOrEqual(',\n 'GREATER_THAN_EQUALS_WRAPPER_CLOSE': ')',\n 'LESS_THAN_WRAPPER_OPEN': 'isLessThan(',\n 'LESS_THAN_WRAPPER_CLOSE': ')',\n 'LESS_THAN_EQUALS_WRAPPER_OPEN': 'isLessThanOrEqual(',\n 'LESS_THAN_EQUALS_WRAPPER_CLOSE': ')',\n 'PLUS_WRAPPER_OPEN':'add(',\n 'PLUS_WRAPPER_CLOSE':')',\n 'MINUS_WRAPPER_OPEN':'subtract(',\n 'MINUS_WRAPPER_CLOSE':')',\n 'ARRAY_LENGTH_WRAPPER_OPEN': 'getArrayLength(',\n 'ARRAY_LENGTH_WRAPPER_CLOSE': ')',\n 'DIVIDE_WRAPPER_OPEN': 'divide(',\n 'DIVIDE_WRAPPER_CLOSE': ')',\n 'MULTIPLY_WRAPPER_OPEN': 'multiply(',\n 'MULTIPLY_WRAPPER_CLOSE': ')',\n 'INDEXOF_WRAPPER_OPEN': 'getIndexOf(',\n 'INDEXOF_WRAPPER_CLOSE': ')',\n 'MOD_WRAPPER_OPEN': 'mod(',\n 'MOD_WRAPPER_CLOSE': ')',\n 'FUNCTION_TOKEN': '',\n 'DEFAULT_PARAMETER_TYPE': 'std::any',\n 'INFER_VAR_TYPE': false,\n 'INFER_ARG_TYPE': false,\n 'UNDEFINED_TOKEN': 'std::any{}',\n // qualified with :: so class methods with the same name never shadow the helper\n 'ELEMENT_ACCESS_WRAPPER_OPEN': '::getValue(',\n 'ELEMENT_ACCESS_WRAPPER_CLOSE': ')',\n 'DEFAULT_RETURN_TYPE': 'std::any',\n 'THIS_TOKEN': 'this',\n 'NEW_TOKEN': '',\n 'CATCH_DECLARATION': 'const std::exception&',\n};\n\nexport class CppTranspiler extends BaseTranspiler {\n\n binaryExpressionsWrappers;\n\n constructor(config = {}) {\n config['parser'] = Object.assign ({}, parserConfig, config['parser'] ?? {});\n\n super(config);\n\n this.requiresParameterType = true;\n this.requiresReturnType = true;\n this.asyncTranspiling = true;\n this.supportsFalsyOrTruthyValues = false;\n this.requiresCallExpressionCast = false;\n this.id = \"c++\";\n\n this.initConfig();\n\n // user overrides\n this.applyUserOverrides(config);\n }\n\n initConfig() {\n this.LeftPropertyAccessReplacements = {\n };\n\n this.RightPropertyAccessReplacements = {\n };\n\n this.FullPropertyAccessReplacements = {\n 'JSON.parse': 'parseJson',\n 'JSON.stringify': 'jsonStringify',\n 'console.log': 'consoleLog',\n 'Number.MAX_SAFE_INTEGER': 'INT_MAX',\n 'Math.min': 'mathMin',\n 'Math.max': 'mathMax',\n 'Math.log': 'mathLog',\n 'Math.abs': 'mathAbs',\n 'Math.floor': 'mathFloor',\n 'Math.pow': 'mathPow',\n };\n\n this.CallExpressionReplacements = {\n };\n\n this.ReservedKeywordsReplacements = {\n 'union': 'unionVar',\n 'char': 'charVar',\n 'default': 'defaultVar',\n 'operator': 'operatorVar',\n 'new': 'newVar',\n 'delete': 'deleteVar',\n 'template': 'templateVar',\n };\n\n this.VariableTypeReplacements = {\n };\n\n this.ArgTypeReplacements = {\n };\n\n this.binaryExpressionsWrappers = {\n [SyntaxKind.EqualsEqualsToken]: [this.EQUALS_EQUALS_WRAPPER_OPEN, this.EQUALS_EQUALS_WRAPPER_CLOSE],\n [SyntaxKind.EqualsEqualsEqualsToken]: [this.EQUALS_EQUALS_WRAPPER_OPEN, this.EQUALS_EQUALS_WRAPPER_CLOSE],\n [SyntaxKind.ExclamationEqualsToken]: [this.DIFFERENT_WRAPPER_OPEN, this.DIFFERENT_WRAPPER_CLOSE],\n [SyntaxKind.ExclamationEqualsEqualsToken]: [this.DIFFERENT_WRAPPER_OPEN, this.DIFFERENT_WRAPPER_CLOSE],\n [SyntaxKind.GreaterThanToken]: [this.GREATER_THAN_WRAPPER_OPEN, this.GREATER_THAN_WRAPPER_CLOSE],\n [SyntaxKind.GreaterThanEqualsToken]: [this.GREATER_THAN_EQUALS_WRAPPER_OPEN, this.GREATER_THAN_EQUALS_WRAPPER_CLOSE],\n [SyntaxKind.LessThanToken]: [this.LESS_THAN_WRAPPER_OPEN, this.LESS_THAN_WRAPPER_CLOSE],\n [SyntaxKind.LessThanEqualsToken]: [this.LESS_THAN_EQUALS_WRAPPER_OPEN, this.LESS_THAN_EQUALS_WRAPPER_CLOSE],\n [SyntaxKind.PlusToken]: [this.PLUS_WRAPPER_OPEN, this.PLUS_WRAPPER_CLOSE],\n [SyntaxKind.MinusToken]: [this.MINUS_WRAPPER_OPEN, this.MINUS_WRAPPER_CLOSE],\n [SyntaxKind.AsteriskToken]: [this.MULTIPLY_WRAPPER_OPEN, this.MULTIPLY_WRAPPER_CLOSE],\n [SyntaxKind.PercentToken]: [this.MOD_WRAPPER_OPEN, this.MOD_WRAPPER_CLOSE],\n [SyntaxKind.SlashToken]: [this.DIVIDE_WRAPPER_OPEN, this.DIVIDE_WRAPPER_CLOSE],\n };\n }\n\n getBlockOpen(identation){\n return \"\\n\" + this.getIden(identation) + this.BLOCK_OPENING_TOKEN + \"\\n\";\n }\n\n printSuperCallInsideConstructor(node, identation) {\n return \"\"; // c++ initializes the base class in the member initializer list\n }\n\n printStringLiteral(node) {\n // wrap in std::string so std::any always holds std::string, never const char*\n return `std::string(${super.printStringLiteral(node)})`;\n }\n\n printClass(node, identation) {\n const classDefinition = this.printClassDefinition(node, identation);\n const classBody = this.printClassBody(node, identation);\n const classClosing = this.getBlockClose(identation);\n return classDefinition + classBody + classClosing + ';';\n }\n\n printClassDefinition(node, identation) {\n const className = node.name.text;\n const heritageClauses = node.heritageClauses;\n\n let classInit = \"\";\n if (heritageClauses !== undefined) {\n const classExtends = heritageClauses[0].types[0].expression.text;\n classInit = this.getIden(identation) + \"class \" + className + \" : public \" + classExtends;\n } else {\n classInit = this.getIden(identation) + \"class \" + className;\n }\n return classInit + \"\\n\" + this.getIden(identation) + this.BLOCK_OPENING_TOKEN + \"\\n\" +\n this.getIden(identation) + \"public:\\n\";\n }\n\n printConstructorDeclaration (node, identation) {\n const classNode = node.parent;\n const className = this.printNode(classNode.name, 0);\n const args = this.printMethodParameters(node);\n const constructorBody = this.printFunctionBody(node, identation);\n\n // find super call inside constructor and extract params\n let superCallParams = '';\n let hasSuperCall = false;\n node.body?.statements.forEach(statement => {\n if (isExpressionStatement(statement)) {\n const expression = statement.expression;\n if (isCallExpression(expression)) {\n const expressionText = expression.expression.getText().trim();\n if (expressionText === 'super') {\n hasSuperCall = true;\n superCallParams = expression.arguments.map((a) => {\n return this.printNode(a, identation).trim();\n }).join(\", \");\n }\n }\n }\n });\n\n if (hasSuperCall) {\n const parentClassName = classNode.heritageClauses[0].types[0].expression.text;\n return this.getIden(identation) + className +\n `(${args}) : ${parentClassName}(${superCallParams})` +\n constructorBody;\n }\n\n return this.getIden(identation) +\n className +\n \"(\" + args + \")\" +\n constructorBody;\n }\n\n printThisElementAccesssIfNeeded(node, identation) {\n return undefined; // dynamic this[method]() calls are not supported yet\n }\n\n printDynamicCall(node, identation) {\n return undefined; // dynamic calls are not supported yet\n }\n\n printAwaitExpression(node, identation) {\n const expression = this.printNode(node.expression, identation);\n if (this.asyncTranspiling) {\n // awaitValue resolves a std::shared_future (or passes a\n // plain value through, like awaiting a non-promise in JS)\n return `awaitValue(${expression})`;\n }\n return expression;\n }\n\n printReturnStatement(node, identation) {\n // a bare `return;` inside an async body must yield a value: the body\n // runs in a lambda returning std::any\n if (this.asyncTranspiling && !node.expression) {\n let fn = node.parent;\n while (fn !== undefined && !isFunctionLike(fn)) {\n fn = fn.parent;\n }\n if (fn !== undefined && this.isAsyncFunction(fn)) {\n return this.getIden(identation) + \"return std::any{}\" + this.LINE_TERMINATOR;\n }\n }\n return super.printReturnStatement(node, identation);\n }\n\n printFunctionBody(node, identation) {\n if (this.asyncTranspiling && this.isAsyncFunction(node)) {\n // run the body on a std::async task so independent calls overlap;\n // sharing the future makes it copyable and thus storable in std::any\n const innerIdentation = identation + 2;\n const bodyStatements = node.body.statements;\n const statements = bodyStatements.map((s) => this.printNode(s, innerIdentation)).join(\"\\n\");\n // the lambda returns std::any, so a body that can flow off the end\n // needs a fallback return\n const lastStatement = bodyStatements.length > 0 ? bodyStatements[bodyStatements.length - 1] : undefined;\n const endsWithReturn = lastStatement !== undefined && lastStatement.kind === SyntaxKind.ReturnStatement;\n const fallbackReturn = endsWithReturn ? \"\" : this.getIden(innerIdentation) + \"return std::any{};\\n\";\n return this.getBlockOpen(identation) +\n this.getIden(identation + 1) + \"return std::async(std::launch::async, [=]() -> std::any {\\n\" +\n (statements ? statements + \"\\n\" : \"\") +\n fallbackReturn +\n this.getIden(identation + 1) + \"}).share();\" +\n this.getBlockClose(identation);\n }\n return super.printFunctionBody(node, identation);\n }\n\n printWrappedUnknownThisProperty(node) {\n return undefined;\n }\n\n printOutOfOrderCallExpressionIfAny(node, identation) {\n if (node.expression.kind === SyntaxKind.PropertyAccessExpression) {\n const expressionText = node.expression.getText().trim();\n const args = node.arguments;\n if (args.length === 1) {\n const parsedArg = this.printNode(args[0], 0);\n switch (expressionText) {\n case \"Math.abs\":\n return `mathAbs(${parsedArg})`;\n }\n } else if (args.length === 2) {\n const parsedArg1 = this.printNode(args[0], 0);\n const parsedArg2 = this.printNode(args[1], 0);\n switch (expressionText) {\n case \"Math.min\":\n return `mathMin(${parsedArg1}, ${parsedArg2})`;\n case \"Math.max\":\n return `mathMax(${parsedArg1}, ${parsedArg2})`;\n case \"Math.pow\":\n return `mathPow(${parsedArg1}, ${parsedArg2})`;\n }\n }\n }\n\n return undefined;\n }\n\n handleTypeOfInsideBinaryExpression(node, identation) {\n const right = node.right.text;\n const op = node.operatorToken.kind;\n const expression = node.left.expression;\n\n const isDifferentOperator = op === SyntaxKind.ExclamationEqualsEqualsToken || op === SyntaxKind.ExclamationEqualsToken;\n const notOperator = isDifferentOperator ? this.NOT_TOKEN : \"\";\n\n const target = this.printNode(expression, 0);\n switch (right) {\n case \"string\":\n return notOperator + `isString(${target})`;\n case \"number\":\n return notOperator + `isNumber(${target})`;\n case \"boolean\":\n return notOperator + `isBool(${target})`;\n case \"object\":\n return notOperator + `isDictionary(${target})`;\n case \"function\":\n return notOperator + `isFunction(${target})`;\n }\n\n return undefined;\n }\n\n printCustomBinaryExpressionIfAny(node, identation) {\n const left = node.left;\n const right = node.right;\n\n const op = node.operatorToken.kind;\n\n if (left.kind === SyntaxKind.TypeOfExpression) {\n const typeOfExpression = this.handleTypeOfInsideBinaryExpression(node, identation);\n if (typeOfExpression) {\n return typeOfExpression;\n }\n }\n\n // handle: [x,d] = this.method()\n if (op === SyntaxKind.EqualsToken && left.kind === SyntaxKind.ArrayLiteralExpression) {\n const arrayBindingPatternElements = left.elements;\n const parsedArrayBindingElements = arrayBindingPatternElements.map((e) => this.printNode(e, 0));\n const syntheticName = parsedArrayBindingElements.join(\"\") + \"Variable\";\n\n let arrayBindingStatement = `std::any ${syntheticName} = ${this.printNode(right, 0)};\\n`;\n\n parsedArrayBindingElements.forEach((e, index) => {\n const statement = this.getIden(identation) + `${e} = ::getValue(${syntheticName}, ${index})`;\n if (index < parsedArrayBindingElements.length - 1) {\n arrayBindingStatement += statement + \";\\n\";\n } else {\n // printStatement adds the last ;\n arrayBindingStatement += statement;\n }\n });\n\n return arrayBindingStatement;\n }\n\n if (op === SyntaxKind.InKeyword) {\n return `inOp(${this.printNode(right, 0)}, ${this.printNode(left, 0)})`;\n }\n\n const leftText = this.printNode(left, 0);\n const rightText = this.printNode(right, 0);\n\n if (op === SyntaxKind.PlusEqualsToken) {\n return `${leftText} = add(${leftText}, ${rightText})`;\n }\n\n if (op === SyntaxKind.MinusEqualsToken) {\n return `${leftText} = subtract(${leftText}, ${rightText})`;\n }\n\n if (op === SyntaxKind.EqualsToken) {\n // handle dict['a'] = 3 and list[0] = 3\n if (left.kind === SyntaxKind.ElementAccessExpression) {\n const elementAccess = left;\n const target = this.printNode(elementAccess.expression, 0);\n const propName = this.printNode(elementAccess.argumentExpression, 0);\n return `::setValue(${target}, ${propName}, ${rightText})`;\n }\n }\n\n if (op in this.binaryExpressionsWrappers) {\n const wrapper = this.binaryExpressionsWrappers[op];\n const open = wrapper[0];\n const close = wrapper[1];\n return `${open}${leftText}, ${rightText}${close}`;\n }\n\n return undefined;\n }\n\n printVariableDeclarationList(node,identation) {\n const declaration = node.declarations[0];\n\n // handle array binding : input: const [a,b] = this.method()\n // output: std::any abVariable = this.method(); std::any a = getValue(abVariable, 0); ...\n if (declaration?.name.kind === SyntaxKind.ArrayBindingPattern) {\n const arrayBindingPattern = declaration.name;\n const arrayBindingPatternElements = arrayBindingPattern.elements;\n const parsedArrayBindingElements = arrayBindingPatternElements.map((e) => this.printNode(e.name, 0));\n const syntheticName = parsedArrayBindingElements.join(\"\") + \"Variable\";\n\n let arrayBindingStatement = `${this.getIden(identation)}std::any ${syntheticName} = ${this.printNode(declaration.initializer, 0)};\\n`;\n\n parsedArrayBindingElements.forEach((e, index) => {\n const statement = this.getIden(identation) + `std::any ${e} = ::getValue(${syntheticName}, ${index})`;\n if (index < parsedArrayBindingElements.length - 1) {\n arrayBindingStatement += statement + \";\\n\";\n } else {\n // printStatement adds the last ;\n arrayBindingStatement += statement;\n }\n });\n\n return arrayBindingStatement;\n }\n\n const isNew = declaration.initializer && (declaration.initializer.kind === SyntaxKind.NewExpression);\n let className = undefined;\n if (isNew) {\n className = declaration.initializer.expression.text;\n }\n const varToken = isNew ? className + ' ' : this.VAR_TOKEN + ' ' ;\n\n // handle default undefined initialization: let id: Str;\n if (declaration.initializer === undefined) {\n return this.getIden(identation) + this.VAR_TOKEN + ' ' + this.printNode(declaration.name) + \" = \" + this.UNDEFINED_TOKEN;\n }\n const parsedValue = this.printNode(declaration.initializer, identation).trimStart();\n return this.getIden(identation) + varToken + this.printNode(declaration.name) + \" = \" + parsedValue;\n }\n\n printFunctionDefinition(node, identation) {\n let name = node.name.text;\n name = this.transformFunctionNameIfNeeded(name);\n\n const parsedArgs = node.parameters.map(param => this.printParameter(param)).join(\", \");\n\n let returnType = this.printFunctionType(node);\n returnType = returnType ? returnType + \" \" : returnType;\n\n const functionDef = this.getIden(identation) + returnType + name\n + \"(\" + parsedArgs + \")\";\n\n return functionDef;\n }\n\n printInstanceOfExpression(node, identation) {\n const left = this.printNode(node.left, 0);\n const right = node.right.text;\n return this.getIden(identation) + `(dynamic_cast(&(${left})) != nullptr)`;\n }\n\n printAsExpression(node, identation) {\n return this.printNode(node.expression, identation);\n }\n\n printParameter(node, defaultValue = true) {\n const name = this.printNode(node.name, 0);\n const initializer = node.initializer;\n\n if (defaultValue) {\n if (initializer) {\n return this.DEFAULT_PARAMETER_TYPE + \" \" + name + this.SPACE_DEFAULT_PARAM + \"=\" + this.SPACE_DEFAULT_PARAM + this.printNode(initializer, 0);\n }\n return this.DEFAULT_PARAMETER_TYPE + \" \" + name;\n }\n return name;\n }\n\n printFunctionType(node){\n if (!this.requiresReturnType) {\n return \"\";\n }\n\n if (this.asyncTranspiling && this.isAsyncFunction(node)) {\n return `std::shared_future<${this.DEFAULT_RETURN_TYPE}>`;\n }\n\n const typeText = this.getFunctionType(node);\n if (typeText === this.VOID_KEYWORD) {\n return this.VOID_KEYWORD;\n }\n return this.DEFAULT_RETURN_TYPE;\n }\n\n printMethodDefinition(node, identation) {\n let name = node.name.text;\n name = this.transformMethodNameIfNeeded(name);\n\n let returnType = this.printFunctionType(node);\n\n const methodOverride = this.getMethodOverride(node) as any;\n const isOverride = methodOverride !== undefined;\n const virtualPrefix = isOverride ? \"\" : \"virtual \";\n const overrideSuffix = isOverride ? \" override\" : \"\";\n\n // keep the overridden method's return type so the signatures match\n if (isOverride) {\n returnType = this.printFunctionType(methodOverride);\n }\n\n const parsedArgs = this.printMethodParameters(node);\n\n returnType = returnType ? returnType + \" \" : returnType;\n\n const methodToken = this.METHOD_TOKEN ? this.METHOD_TOKEN + \" \" : \"\";\n const methodDef = this.getIden(identation) + virtualPrefix + returnType + methodToken + name\n + \"(\" + parsedArgs + \")\" + overrideSuffix;\n\n return this.printNodeCommentsIfAny(node, identation, methodDef);\n }\n\n printPropertyDeclaration(node, identation) {\n const name = this.printNode(node.name, 0);\n if (node.initializer) {\n const initializer = this.printNode(node.initializer, 0);\n return this.getIden(identation) + 'std::any ' + name + \" = \" + initializer + this.LINE_TERMINATOR;\n }\n return this.getIden(identation) + 'std::any ' + name + this.LINE_TERMINATOR;\n }\n\n printArrayLiteralExpression(node) {\n const elements = node.elements.map((e) => {\n return this.printNode(e);\n }).join(\", \");\n return this.ARRAY_OPENING_TOKEN + elements + this.ARRAY_CLOSING_TOKEN;\n }\n\n printArrayIsArrayCall(node, identation, parsedArg = undefined) {\n return `isArray(${parsedArg})`;\n }\n\n printObjectKeysCall(node, identation, parsedArg = undefined) {\n return `getObjectKeys(${parsedArg})`;\n }\n\n printObjectValuesCall(node, identation, parsedArg = undefined) {\n return `getObjectValues(${parsedArg})`;\n }\n\n printJsonParseCall(node, identation, parsedArg = undefined) {\n return `parseJson(${parsedArg})`;\n }\n\n printJsonStringifyCall(node, identation, parsedArg = undefined) {\n return `jsonStringify(${parsedArg})`;\n }\n\n printPromiseAllCall(node, identation, parsedArg = undefined) {\n return `promiseAll(${parsedArg})`;\n }\n\n printMathFloorCall(node, identation, parsedArg = undefined) {\n return `mathFloor(${parsedArg})`;\n }\n\n printMathRoundCall(node, identation, parsedArg = undefined) {\n return `mathRound(${parsedArg})`;\n }\n\n printMathCeilCall(node, identation, parsedArg = undefined) {\n return `mathCeil(${parsedArg})`;\n }\n\n printNumberIsIntegerCall(node: any, identation: any, parsedArg?: any) {\n return `isInteger(${parsedArg})`;\n }\n\n printArrayPushCall(node, identation, name = undefined, parsedArg = undefined) {\n return `arrayPush(${name}, ${parsedArg})`;\n }\n\n printIncludesCall(node, identation, name = undefined, parsedArg = undefined) {\n return `includes(${name}, ${parsedArg})`;\n }\n\n printIndexOfCall(node, identation, name = undefined, parsedArg = undefined) {\n return `${this.INDEXOF_WRAPPER_OPEN}${name}, ${parsedArg}${this.INDEXOF_WRAPPER_CLOSE}`;\n }\n\n printStartsWithCall(node, identation, name = undefined, parsedArg = undefined) {\n return `startsWith(${name}, ${parsedArg})`;\n }\n\n printEndsWithCall(node, identation, name = undefined, parsedArg = undefined) {\n return `endsWith(${name}, ${parsedArg})`;\n }\n\n printTrimCall(node, identation, name = undefined) {\n return `trim(${name})`;\n }\n\n printJoinCall(node, identation, name = undefined, parsedArg = undefined) {\n return `join(${name}, ${parsedArg})`;\n }\n\n printSplitCall(node, identation, name = undefined, parsedArg = undefined) {\n return `split(${name}, ${parsedArg})`;\n }\n\n printConcatCall(node, identation, name = undefined, parsedArg = undefined) {\n return `concat(${name}, ${parsedArg})`;\n }\n\n printToFixedCall(node, identation, name = undefined, parsedArg = undefined) {\n return `toFixed(${name}, ${parsedArg})`;\n }\n\n printToStringCall(node, identation, name = undefined) {\n return `toString(${name})`;\n }\n\n printToUpperCaseCall(node, identation, name = undefined) {\n return `toUpperCase(${name})`;\n }\n\n printToLowerCaseCall(node, identation, name = undefined) {\n return `toLowerCase(${name})`;\n }\n\n printShiftCall(node, identation, name = undefined) {\n return `shift(${name})`;\n }\n\n printReverseCall(node, identation, name = undefined) {\n return `reverse(${name})`;\n }\n\n printPopCall(node, identation, name = undefined) {\n return `pop(${name})`;\n }\n\n printAssertCall(node, identation, parsedArgs) {\n return `assertTrue(${parsedArgs})`;\n }\n\n printSliceCall(node, identation, name = undefined, parsedArg = undefined, parsedArg2 = undefined) {\n if (parsedArg2 === undefined){\n parsedArg2 = this.UNDEFINED_TOKEN;\n }\n return `slice(${name}, ${parsedArg}, ${parsedArg2})`;\n }\n\n printReplaceCall(node, identation, name = undefined, parsedArg = undefined, parsedArg2 = undefined) {\n return `replace(${name}, ${parsedArg}, ${parsedArg2})`;\n }\n\n printReplaceAllCall(node, identation, name = undefined, parsedArg = undefined, parsedArg2 = undefined) {\n return `replaceAll(${name}, ${parsedArg}, ${parsedArg2})`;\n }\n\n printPadEndCall(node, identation, name, parsedArg, parsedArg2) {\n return `padEnd(${name}, ${parsedArg}, ${parsedArg2})`;\n }\n\n printPadStartCall(node, identation, name, parsedArg, parsedArg2) {\n return `padStart(${name}, ${parsedArg}, ${parsedArg2})`;\n }\n\n printDateNowCall(node, identation) {\n return \"getCurrentTimestamp()\";\n }\n\n printLengthProperty(node, identation, name = undefined) {\n const leftSide = this.printNode(node.expression, 0);\n const type = (this.getChecker() as Checker).getTypeAtLocation(node.expression); // eslint-disable-line\n this.warnIfAnyType(node, type.flags, leftSide, \"length\");\n return this.isStringType(type.flags) ? `getStringLength(${leftSide})` : `${this.ARRAY_LENGTH_WRAPPER_OPEN}${leftSide}${this.ARRAY_LENGTH_WRAPPER_CLOSE}`;\n }\n\n printPostFixUnaryExpression(node, identation) {\n const {operand, operator} = node;\n if (operand.kind === SyntaxKind.NumericLiteral) {\n return super.printPostFixUnaryExpression(node, identation);\n }\n const leftSide = this.printNode(operand, 0);\n const op = this.PostFixOperators[operator];\n if (op === '--') {\n return `postFixDecrement(${leftSide})`;\n }\n return `postFixIncrement(${leftSide})`;\n }\n\n printPrefixUnaryExpression(node, identation) {\n const {operand, operator} = node;\n if (operand.kind === SyntaxKind.NumericLiteral) {\n return super.printPrefixUnaryExpression(node, identation);\n }\n if (operator === SyntaxKind.ExclamationToken) {\n // not branch check falsy/truthy values if needed;\n return this.PrefixFixOperators[operator] + this.printCondition(node.operand, 0);\n }\n const leftSide = this.printNode(operand, 0);\n if (operator === SyntaxKind.PlusToken) {\n return `prefixUnaryPlus(${leftSide})`;\n } else {\n return `prefixUnaryNeg(${leftSide})`;\n }\n }\n\n printConditionalExpression(node, identation) {\n const condition = this.printCondition(node.condition, 0);\n const whenTrue = this.printNode(node.whenTrue, 0);\n const whenFalse = this.printNode(node.whenFalse, 0);\n\n // wrap both branches in std::any so the ternary has one common type\n return `(${condition} ? std::any(${whenTrue}) : std::any(${whenFalse}))`;\n }\n\n printDeleteExpression(node, identation) {\n const object = this.printNode (node.expression.expression, 0);\n const key = this.printNode (node.expression.argumentExpression, 0);\n return `deleteKey(${object}, ${key})`;\n }\n\n printThrowStatement(node, identation) {\n if (node.expression.kind === SyntaxKind.Identifier) {\n return this.getIden(identation) + this.THROW_TOKEN + ' ' + this.printNode(node.expression, 0) + this.LINE_TERMINATOR;\n }\n if (node.expression.kind === SyntaxKind.NewExpression) {\n const expression = node.expression;\n // handle throw new Error (message) and throw new x[a] (message)\n const argumentsExp = expression?.arguments ?? [];\n const parsedArg = argumentsExp.map(n => this.printNode(n, 0)).join(\", \") ?? '';\n const newExpression = this.printNode(expression.expression, 0);\n if (expression.expression.kind === SyntaxKind.Identifier) {\n const id = expression.expression;\n const symbol = this.getChecker().getSymbolAtLocation(expression.expression);\n if (symbol) {\n const declarations = (this.getChecker().getDeclaredTypeOfSymbol(symbol).getSymbol()?.declarations ?? []).map((d) => d.resolve());\n const isClassDeclaration = declarations.find(l => l.kind === SyntaxKind.InterfaceDeclaration || l.kind === SyntaxKind.ClassDeclaration);\n if (isClassDeclaration){\n return this.getIden(identation) + `${this.THROW_TOKEN} ${id.text}(toString(${parsedArg}))${this.LINE_TERMINATOR}`;\n }\n return this.getIden(identation) + `throwDynamicException(${id.text}, ${parsedArg})${this.LINE_TERMINATOR}`;\n }\n return this.getIden(identation) + `${this.THROW_TOKEN} ${newExpression}(${parsedArg})${this.LINE_TERMINATOR}`;\n } else if (expression.expression.kind === SyntaxKind.ElementAccessExpression) {\n return this.getIden(identation) + `throwDynamicException(${newExpression}, ${parsedArg})${this.LINE_TERMINATOR}`;\n }\n return super.printThrowStatement(node, identation);\n }\n return super.printThrowStatement(node, identation);\n }\n\n getExceptionalAccessTokenIfAny(node) {\n const leftSide = node.expression;\n const leftSideText = this.printNode(leftSide, 0);\n if (leftSideText === this.THIS_TOKEN) {\n return '->';\n }\n return undefined;\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AACA,WAAO,UAAU;AAAA;AAAA;;;ACDjB;AAEA,qBAAwB;AAFxB,SAAS,cAAc,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K,QAAQ,cAAc,QAAQ,KAAK,KAAK,QAAQ,cAAmB,cAAQ,QAAQ,CAAC;AACrG,QAAI,QAAQ,QAAW;AACnB,YAAM,IAAI,MAAM,oBAAoB,QAAQ,uCAAuC;AAAA,IACvF;AACA,UAAM,UAAU,KAAK,WAAW,WAAW,EAAE,KAAK,SAAS,KAAK,SAAS,SAAS,KAAK,QAAQ,CAAC;AAChG,SAAK,WAAW,qBAAqB,OAAO;AAC5C,WAAO;AAAA,EACX;AAAA,EAEA,gBAAgB,MAAiB,UAAkB,OAAO,OAAwB;AAC9E,SAAK,kBAAkB,QAAQ;AAC/B,WAAO,KAAK,WAAW,UAAU,sBAAgC,UAAU,MAAM,KAAK;AAAA,EAC1F;AAAA,EAEA,sBAAsB,UAAmC;AACrD,WAAO,KAAK,gCAAkC,UAAU,CAAC,KAAK,WAAW,iBAAiB,gBAAgB;AAAA,EAC9G;AAAA,EAEA,mBAAmB,UAAmC;AAClD,WAAO,KAAK,6BAA+B,UAAU,CAAC,KAAK,WAAW,cAAc,gBAAgB;AAAA,EACxG;AAAA,EAEA,sBAAsB,UAAmC;AACrD,WAAO,KAAK,gCAAkC,QAAQ;AAAA,EAC1D;AAAA,EAEA,kBAAkB,UAAmC;AACjD,WAAO,KAAK,4BAA8B,QAAQ;AAAA,EACtD;AAAA,EAEA,oBAAoB,UAAmC;AACnD,WAAO,KAAK,8BAAgC,QAAQ;AAAA,EACxD;AAAA,EAEA,oBAAoB,UAAmC;AACnD,WAAO,KAAK,8BAAgC,QAAQ;AAAA,EACxD;AAAA,EAEA,mBAAmB,UAAmC;AAClD,WAAO,KAAK,6BAA+B,QAAQ;AAAA,EACvD;AACJ;","names":["SyntaxKind","API","ElementFlags","IndexKind","ObjectFlags","SignatureKind","SymbolFlags","TypeFlags","defaultValue","type","node","namedExports","SyntaxKind","SyntaxKind","isArrowFunction","isCallExpression","isFunctionDeclaration","isFunctionExpression","TypeFlags","parserConfig","isFunctionDeclaration","isFunctionExpression","isArrowFunction","isCallExpression","SyntaxKind","TypeFlags","SyntaxKind","TypeFlags","isArrayLiteralExpression","isBinaryExpression","isBooleanLiteral","isCallExpression","isClassDeclaration","isFunctionExpression","isMethodDeclaration","isNumericLiteral","isObjectLiteralExpression","isSourceFile","isStringLiteralLikeNode","parserConfig","SyntaxKind","isNumericLiteral","isMethodDeclaration","isClassDeclaration","symbol","isCallExpression","TypeFlags","isStringLiteralLikeNode","isBinaryExpression","isArrayLiteralExpression","isObjectLiteralExpression","named","isStringLiteral","isFunctionExpression","isBooleanLiteral","defaultValue","isSourceFile","printedKey","path","fs","SyntaxKind","getLeadingCommentRanges","isArrowFunction","isBinaryExpression","isBlock","isBooleanLiteral","isCallExpression","isElementAccessExpression","isExpressionStatement","isFunctionDeclaration","isFunctionExpression","isIfStatement","isMethodDeclaration","isReturnStatement","isSourceFile","isThrowStatement","IndexKind","TypeFlags","SyntaxKind","parserConfig","parserConfig","SyntaxKind","isBooleanLiteral","isArrowFunction","name","isSourceFile","isFunctionDeclaration","isMethodDeclaration","TypeFlags","isExpressionStatement","isCallExpression","isElementAccessExpression","rhs","native","IndexKind","level","getLeadingCommentRanges","path","isStatement","isFunctionExpression","whenTrue","whenFalse","isClassDeclaration","isBinaryExpression","isBlock","isReturnStatement","isThrowStatement","isIfStatement","SyntaxKind","isArrayLiteralExpression","isArrowFunction","isAsExpression","isBinaryExpression","isBlock","isBooleanLiteral","isCallExpression","isBreakStatement","isClassDeclaration","isConditionalExpression","isContinueStatement","isElementAccessExpression","isExpressionStatement","isFunctionDeclaration","isFunctionExpression","isIdentifier","isIfStatement","isMethodDeclaration","isNumericLiteral","isObjectLiteralExpression","isParameterDeclaration","isParenthesizedExpression","isPostfixUnaryExpression","isPrefixUnaryExpression","isPropertyAccessExpression","isReturnStatement","isSourceFile","isSpreadAssignment","isSpreadElement","isStringLiteral","isStringLiteralLikeNode","isThrowStatement","isTypeAssertion","isVariableDeclaration","IndexKind","SymbolFlags","TypeFlags","parserConfig","SyntaxKind","TypeFlags","isClassDeclaration","isMethodDeclaration","isIdentifier","isParameterDeclaration","isArrayLiteralExpression","isStringLiteralLikeNode","isObjectLiteralExpression","isNumericLiteral","isPrefixUnaryExpression","isVariableDeclaration","isExpressionStatement","isCallExpression","isFunctionDeclaration","isBinaryExpression","isPostfixUnaryExpression","isStringLiteral","isPropertyAccessExpression","isElementAccessExpression","isParenthesizedExpression","isAsExpression","isTypeAssertion","isSourceFile","isReturnStatement","isBlock","IndexKind","isIfStatement","isConditionalExpression","isThrowStatement","isContinueStatement","isBreakStatement","SymbolFlags","target","isFunctionExpression","isBooleanLiteral","isSpreadElement","isSpreadAssignment","isArrowFunction","NodeFlags","SyntaxKind","isArrayLiteralExpression","isArrowFunction","isAsExpression","isBinaryExpression","isBlock","isCallExpression","isClassDeclaration","isClassExpression","isConditionalExpression","isDeleteExpression","isElementAccessExpression","isForInStatement","isForOfStatement","isIdentifier","isMethodDeclaration","isNonNullExpression","isNumericLiteral","isObjectLiteralExpression","isParameterDeclaration","isParenthesizedExpression","isPrefixUnaryExpression","isPropertyAccessExpression","isReturnStatement","isShorthandPropertyAssignment","isSourceFile","isStringLiteral","isStringLiteralLikeNode","isTypeAssertion","isVariableDeclaration","IndexKind","SignatureKind","SymbolFlags","TypeFlags","parserConfig","SyntaxKind","TypeFlags","isElementAccessExpression","isCallExpression","isParenthesizedExpression","isVariableDeclaration","isIdentifier","isPropertyAccessExpression","isParameterDeclaration","accessor","isStringLiteralLikeNode","isNumericLiteral","isPrefixUnaryExpression","isStringLiteral","isObjectLiteralExpression","isNonNullExpression","isAsExpression","isBinaryExpression","isArrayLiteralExpression","isConditionalExpression","isMethodDeclaration","isClassDeclaration","isReturnStatement","isShorthandPropertyAssignment","isForOfStatement","isForInStatement","isDeleteExpression","isArrowFunction","args","SymbolFlags","isClassExpression","SignatureKind","IndexKind","isBlock","text","isTypeAssertion","isSourceFile","type","value","NodeFlags","path","SyntaxKind","isCallExpression","isExpressionStatement","parserConfig","SyntaxKind","isExpressionStatement","isCallExpression","isClassDeclaration","currentPath","SyntaxKind","API","path"]} \ No newline at end of file diff --git a/dist/tsUtils.cjs b/dist/tsUtils.cjs index 93125bae..35c32a03 100644 --- a/dist/tsUtils.cjs +++ b/dist/tsUtils.cjs @@ -13,7 +13,7 @@ -var _chunk4FDYB2TTcjs = require('./chunk-4FDYB2TT.cjs'); +var _chunkUBXMRIM6cjs = require('./chunk-UBXMRIM6.cjs'); @@ -29,5 +29,5 @@ var _chunk4FDYB2TTcjs = require('./chunk-4FDYB2TT.cjs'); -exports.ModifierFlags = _chunk4FDYB2TTcjs.ModifierFlags; exports.canHaveModifiers = _chunk4FDYB2TTcjs.canHaveModifiers; exports.findAncestor = _chunk4FDYB2TTcjs.findAncestor; exports.getAllSuperTypeNodes = _chunk4FDYB2TTcjs.getAllSuperTypeNodes; exports.getCombinedNodeFlags = _chunk4FDYB2TTcjs.getCombinedNodeFlags; exports.getModifiers = _chunk4FDYB2TTcjs.getModifiers; exports.isClassLike = _chunk4FDYB2TTcjs.isClassLike; exports.isFunctionLike = _chunk4FDYB2TTcjs.isFunctionLike; exports.isStringLiteralLike = _chunk4FDYB2TTcjs.isStringLiteralLike; exports.signatureDeclaration = _chunk4FDYB2TTcjs.signatureDeclaration; exports.symbolDeclarations = _chunk4FDYB2TTcjs.symbolDeclarations; exports.symbolValueDeclaration = _chunk4FDYB2TTcjs.symbolValueDeclaration; exports.typeParts = _chunk4FDYB2TTcjs.typeParts; exports.typeTarget = _chunk4FDYB2TTcjs.typeTarget; +exports.ModifierFlags = _chunkUBXMRIM6cjs.ModifierFlags; exports.canHaveModifiers = _chunkUBXMRIM6cjs.canHaveModifiers; exports.findAncestor = _chunkUBXMRIM6cjs.findAncestor; exports.getAllSuperTypeNodes = _chunkUBXMRIM6cjs.getAllSuperTypeNodes; exports.getCombinedNodeFlags = _chunkUBXMRIM6cjs.getCombinedNodeFlags; exports.getModifiers = _chunkUBXMRIM6cjs.getModifiers; exports.isClassLike = _chunkUBXMRIM6cjs.isClassLike; exports.isFunctionLike = _chunkUBXMRIM6cjs.isFunctionLike; exports.isStringLiteralLike = _chunkUBXMRIM6cjs.isStringLiteralLike; exports.signatureDeclaration = _chunkUBXMRIM6cjs.signatureDeclaration; exports.symbolDeclarations = _chunkUBXMRIM6cjs.symbolDeclarations; exports.symbolValueDeclaration = _chunkUBXMRIM6cjs.symbolValueDeclaration; exports.typeParts = _chunkUBXMRIM6cjs.typeParts; exports.typeTarget = _chunkUBXMRIM6cjs.typeTarget; //# sourceMappingURL=tsUtils.cjs.map \ No newline at end of file diff --git a/dist/tsUtils.js b/dist/tsUtils.js index 047cd28e..f9557260 100644 --- a/dist/tsUtils.js +++ b/dist/tsUtils.js @@ -13,7 +13,7 @@ import { symbolValueDeclaration, typeParts, typeTarget -} from "./chunk-VNDHHGGT.js"; +} from "./chunk-WD722H3U.js"; export { ModifierFlags, canHaveModifiers, diff --git a/src/csharpTranspiler.ts b/src/csharpTranspiler.ts index 39568267..00fb526b 100644 --- a/src/csharpTranspiler.ts +++ b/src/csharpTranspiler.ts @@ -804,6 +804,11 @@ export class CSharpTranspiler extends BaseTranspiler { if (listRead !== undefined) { return listRead; } + const keyRead = (this.ELEMENT_ACCESS_WRAPPER_OPEN && !this.printElementAccessExpressionExceptionIfAny(node)) + ? this.csharpHx4IdentifierKeyRead(node.expression, node.argumentExpression) : undefined; + if (keyRead !== undefined) { + return keyRead; // hx4 C11 + } return super.printElementAccessExpression(node, identation); } @@ -960,9 +965,8 @@ export class CSharpTranspiler extends BaseTranspiler { if (csharpType === undefined) { return undefined; } - const func = this.csharpEnclosingFunction(node); - if (func === undefined || this.csharpReceiverIsRewritten(func, expression)) { - return undefined; // a reassigned receiver is not the object the declared type describes + if (!this.csharpHx4DeclaredReceiverReadable(node, expression)) { + return undefined; } const receiver = this.printNode(expression, 0); if (csharpType.indexOf('Dictionary<') >= 0) { @@ -3372,7 +3376,8 @@ export class CSharpTranspiler extends BaseTranspiler { } // prefixUnaryNeg/Plus(ref x) has int / Int64 / double twins only: a // nullable or reference local would not bind any overload - if (safeAccessor && (op !== SyntaxKind.ExclamationToken) && (csharpType !== 'int') && (csharpType !== 'Int64') && (csharpType !== 'double')) { + if (safeAccessor && (op !== SyntaxKind.ExclamationToken) && (csharpType !== 'int') && (csharpType !== 'Int64') && (csharpType !== 'double') + && !this.csharpHx4GuardedNullableNegation(parent, csharpType)) { return true; } } @@ -4745,7 +4750,7 @@ export class CSharpTranspiler extends BaseTranspiler { if (operator === SyntaxKind.PlusToken) { return `prefixUnaryPlus(ref ${leftSide})`; } - const nativeNegation = this.csharpNativeNegatedLocal(operand, leftSide); + const nativeNegation = this.csharpNativeNegatedLocal(operand, leftSide) ?? this.csharpHx4NativeNegatedNullableLocal(node, leftSide); if (nativeNegation !== undefined) { return nativeNegation; } @@ -5218,6 +5223,122 @@ export class CSharpTranspiler extends BaseTranspiler { // } // return res; // } + + // hx4 C01: a declared C# collection keeps its static type across every write, and the + // null/ContainsKey/Count test reads the live value, so only an enclosing function is needed + csharpHx4DeclaredReceiverReadable(node, expression): boolean { + return this.csharpEnclosingFunction(node) !== undefined && isIdentifier(expression); + } + + // hx4 C11: `x[i]` / `m[k]` with an identifier key on a declared collection or a base dict field. + // The emission carries GetValue's own null/missing-key/past-the-end tests; a negative index + // throws in both. Key must be declared `int` (list) or `string`/`string?` (dictionary). + csharpHx4IdentifierKeyRead(expression, argumentExpression): string | undefined { + if (!isIdentifier(argumentExpression) || !this.csharpHx4IsPlainRead(argumentExpression.parent)) { + return undefined; + } + const fieldTypes = { 'has': 'Dictionary', 'features': 'Dictionary', 'timeframes': 'Dictionary', 'options': 'ConcurrentDictionary', 'markets': 'IDictionary', 'urls': 'object', 'currencies': 'object' }; + let receiver: string | undefined; + let csharpType: string | undefined; + if (isPropertyAccessExpression(expression) && expression.expression.kind === SyntaxKind.ThisKeyword && isIdentifier(expression.name) + && Object.prototype.hasOwnProperty.call(fieldTypes, expression.name.text as string)) { + const field = this.printNode(expression, 0); + csharpType = fieldTypes[expression.name.text as string]; + receiver = (csharpType === 'object') ? `((IDictionary)${field})` : field; + const key = this.csharpHx4DeclaredKeyType(argumentExpression); + if (key !== 'string' && key !== 'string?') { + return undefined; + } + const printedKey = this.printNode(argumentExpression, 0); + return `(${field} != null && ${printedKey} != null && ${receiver}.ContainsKey(${printedKey}) ? ${receiver}[${printedKey}] : null)`; + } + if (!isIdentifier(expression) || CSHARP_MARKET_RECEIVER_NAMES.indexOf(expression.text as string) >= 0) { + return undefined; + } + csharpType = this.csharpDeclaredCollectionType(expression); + if (csharpType === undefined) { + const printed = (typeof (this as any).csharpPrintedLocalType === 'function') ? (this as any).csharpPrintedLocalType(expression) : undefined; + csharpType = (CSHARP_NATIVE_COLLECTION_TYPES.indexOf(printed) >= 0) ? printed : undefined; + } + if (csharpType === undefined || this.csharpEnclosingFunction(expression) === undefined) { + return undefined; + } + receiver = this.printNode(expression, 0); + const printedKey = this.printNode(argumentExpression, 0); + const keyType = this.csharpHx4DeclaredKeyType(argumentExpression); + if (csharpType.indexOf('Dictionary<') >= 0) { + if (keyType !== 'string' && keyType !== 'string?') { + return undefined; + } + return `(${receiver} != null && ${printedKey} != null && ${receiver}.ContainsKey(${printedKey}) ? ${receiver}[${printedKey}] : null)`; + } + if (keyType !== 'int') { + return undefined; // Int64/object indices do not bind the List indexer + } + return `(${receiver} != null && ${printedKey} < ${receiver}.Count ? ${receiver}[${printedKey}] : null)`; + } + + // a read that is no write target: not the left of any assignment, not ++/--, not delete + csharpHx4IsPlainRead(node): boolean { + const parent: any = node?.parent; + if (parent?.kind === SyntaxKind.BinaryExpression && parent.left === node && this.csharpIsAssignmentOperator(parent.operatorToken.kind)) { + return false; + } + return !isDeleteExpression(parent) && !isPrefixUnaryExpression(parent) && !isPostfixUnaryExpression(parent); + } + + // the C# type the key identifier's emitted declaration carries: the printer's own table, then + // the build layer's declared-local hook (which retypes for-counters and string locals) + csharpHx4DeclaredKeyType(key): string | undefined { + const typed = this.csharpTypedLocalType(key); + if (typed !== undefined) { + return typed; + } + const printed = (typeof (this as any).csharpPrintedLocalType === 'function') ? (this as any).csharpPrintedLocalType(key) : undefined; + if (printed !== undefined) { + return printed; + } + return (typeof this.csharpLocalTypeOf === 'function') ? this.csharpLocalTypeOf(key) : undefined; + } + + // hx4 L44: `-x` on a local declared `double?` (a safeNumber read) inside a + // non-null guard on x (`if (x !== undefined)`, `x !== undefined && ...`, early exit). The guard + // proves the box is a number, so the local keeps its nullable scalar type and the negation is the + // helper's own in-place body `(x = -x)` (lifted: x is non-null here). Unguarded reads keep `object`. + csharpHx4GuardedNullableNegation(node, csharpType: string): boolean { + if (csharpType !== 'double?') { + return false; + } + if (!isPrefixUnaryExpression(node) || (node.operator !== SyntaxKind.MinusToken) || !isIdentifier(node.operand)) { + return false; + } + return this.csharpNullGuardAdmitsRead(node, node.operand); + } + + // the C# type the local's printed declaration finally carries; an embedding build layer that + // retypes `object x = ...` after printing overrides this with its own (final) answer + csharpHx4DeclaredLocalType(declaration): string | undefined { + return this.getCSharpLocalType(declaration); + } + + csharpHx4NativeNegatedNullableLocal(node, leftSide: string): string | undefined { + const operand = node.operand; + if (!isIdentifier(operand)) { + return undefined; + } + // the prefix the declaration printed (`double? x = ...`): the printer's own decision, or the + // embedding build layer's wrapped one; a declaration list of several bindings prints `object` + const declaration: any = this.getChecker().getSymbolAtLocation(operand)?.valueDeclaration?.resolve(); + if (!declaration || !isVariableDeclaration(declaration) || (declaration.parent?.declarations?.length !== 1)) { + return undefined; + } + const declared = this.csharpHx4DeclaredLocalType(declaration); + if (!this.csharpHx4GuardedNullableNegation(node, declared)) { + return undefined; + } + return `(${leftSide} = -${leftSide})`; + } + } // if (this.requiresCallExpressionCast) { diff --git a/src/goTranspiler.ts b/src/goTranspiler.ts index 5fb1a4f9..c07d48ba 100644 --- a/src/goTranspiler.ts +++ b/src/goTranspiler.ts @@ -1586,7 +1586,7 @@ func New${this.capitalize(this.className)}() *${(this.className)} { // text for a proven string, or the deref goNativeBinaryText adds for a derefable // `*string` leaf. undefined keeps the helper call. goStringConcatOperandType(node, printedText: string): string | undefined { - if (this.goDerefableStringOperand(node)) { + if (this.goConcatDerefableStringOperand(node)) { return 'string'; } return (this.goOperandStaticType(node, printedText) === 'string') ? 'string' : undefined; @@ -1883,6 +1883,10 @@ func New${this.capitalize(this.className)}() *${(this.className)} { } return { 'goType': 'string', 'text': this.goNativeBinaryText(node, '+', leftText, rightText) }; } + const widened = this.goNativeIntWideningArithmetic(node, leftType, rightType, leftText, rightText); + if (widened !== undefined) { + return widened; + } const goType = this.goNativeNumericResultType(op, leftType, rightType, node); if (goType === undefined) { return undefined; @@ -2044,7 +2048,7 @@ func New${this.capitalize(this.className)}() *${(this.className)} { const text = isBinary ? this.goWithExprDepth(this.goExprDepth, () => this.printNode(operand, 0)) : printed; // a derefable `*string` leaf is the only operand that prints in a different // shape than the printer produced: the operator needs its pointee - const leaf = this.goDerefableStringOperand(operand) ? ('*' + text.trim()) : text; + const leaf = this.goConcatDerefableStringOperand(operand) ? ('*' + text.trim()) : text; return this.goNativeOperandText(operand, leaf); }; const left = operandText(node.left, leftText); @@ -3375,7 +3379,7 @@ ${this.getIden(identation)}PanicOnError(${varName})`; } if (ORDERED_COMPARISON_OPERATORS[op] !== undefined) { - const inlined = this.printInlineOrderedComparison(left, right, leftText, rightText, op); + const inlined = this.printInlineOrderedComparison(left, right, leftText, rightText, op) ?? this.printG09WideningComparison(left, right, leftText, rightText, op); if (inlined !== undefined) { return inlined; } @@ -3660,6 +3664,9 @@ ${this.getIden(identation)}PanicOnError(${varName})`; if (expr === undefined) { return true; // `var x any` never written holds nil } + if (this.goG02NonPointerAccessorSource(expr)) { + return true; + } switch (expr.kind) { case SyntaxKind.NullKeyword: return true; @@ -3933,7 +3940,7 @@ ${this.getIden(identation)}PanicOnError(${varName})`; const goType = this.goRequiredStringParameterType(param); return ((goType !== undefined) && this.goHasTreeCallSite(fn) && this.goParameterCallSitesPassType(fn, index, goType) && this.goLocalIsSafeToType(fn.body, param, param.name.text, goType) - && this.goParameterKeepsNilCompareNative(fn.body, param, goType)) ? goType : undefined; + && this.goParameterKeepsNilCompareNative(fn.body, param, goType)) ? goType : this.g11NativeParameterType(fn, param, index); } if (this.isAsyncFunction(fn)) { return undefined; @@ -3945,7 +3952,7 @@ ${this.getIden(identation)}PanicOnError(${varName})`; return goType; } } - return undefined; + return handlerParam ? undefined : this.g11NativeParameterType(fn, param, index); } goIsUnifiedStringParameter(methodName: string, index: number): boolean { @@ -6023,7 +6030,7 @@ ${this.getIden(identation)}PanicOnError(${varName})`; const type = (this.getChecker() as Checker).getTypeAtLocation(expression); // eslint-disable-line // this.warnIfAnyType(node, type.flags, leftSide, "length"); // rawExpression = this.isStringType(type.flags) ? `(string${leftSide}).Length` : `(${leftSide}.Cast().ToList()).Count`; - rawExpression = this.printInlineArrayLength(expression, leftSide, node) ?? (this.isStringType(type.flags) ? `GetLength(${leftSide})` : `${this.ARRAY_LENGTH_WRAPPER_OPEN}${leftSide}${this.ARRAY_LENGTH_WRAPPER_CLOSE}`); // `(${leftSide}.Cast()).ToList().Count` + rawExpression = this.printInlineArrayLength(expression, leftSide, node) ?? this.goHx4G06DerefLength(expression, leftSide, node) ?? (this.isStringType(type.flags) ? `GetLength(${leftSide})` : `${this.ARRAY_LENGTH_WRAPPER_OPEN}${leftSide}${this.ARRAY_LENGTH_WRAPPER_CLOSE}`); // `(${leftSide}.Cast()).ToList().Count` break; case 'push': rawExpression = `((IList)${leftSide}).Add`; @@ -7165,7 +7172,7 @@ ${this.getIden(identation)}${returnStatement}`; } printIndexOfCall(node, identation, name = undefined, parsedArg = undefined) { - const native = this.goNativeIndexOf(node, name, parsedArg); + const native = this.goHx4G06DerefIndexOf(node, name, parsedArg) ?? this.goNativeIndexOf(node, name, parsedArg); if (native !== undefined) { return native; } @@ -7184,7 +7191,7 @@ ${this.getIden(identation)}${returnStatement}`; } if (this.goOperandStaticType(operand, texts[i]) === expected[i]) { result.push(texts[i]); - } else if ((expected[i] === 'string') && !texts[i].includes('\n') && this.goDerefableStringOperand(operand)) { + } else if ((expected[i] === 'string') && !texts[i].includes('\n') && (this.goDerefableStringOperand(operand) || this.goLiteralUnionNarrowedStringDeref(operand))) { result.push('*' + texts[i].trim()); } else { return undefined; @@ -7268,7 +7275,7 @@ ${this.getIden(identation)}${returnStatement}`; return name; } // a non-nil `*string`: derefScalar hands ToString the pointee, returned unchanged - if ((receiver !== undefined) && this.goDerefableStringOperand(receiver)) { + if ((receiver !== undefined) && (this.goDerefableStringOperand(receiver) || this.goLiteralUnionNarrowedStringDeref(receiver))) { return '*' + name.trim(); } // an int64 prints its decimal digits in both: the helper's Sprintf("%d") and FormatInt @@ -7993,7 +8000,7 @@ ${tryBodyBlock} case SyntaxKind.CallExpression: return this.goTypeOfInitializer(node, printed); case SyntaxKind.Identifier: - return this.goDeclaredTypeOfIdentifier(node); + return this.goDeclaredTypeOfIdentifier(node) ?? this.g01MapParamType(node); } return undefined; } @@ -8290,6 +8297,335 @@ ${tryBodyBlock} return (isIfStatement(lastStatement) || isTryStatement(lastStatement)) && this.hasReturnInBlock(lastStatement); } + // hx4 G01 + // a defaulted parameter bound through GetArgMap is a Go map[string]any; an element read of it + // indexes natively only where g01ReadOk proves the deref-free read answers what GetValue did + g01MapParamType(node): string | undefined { + const checker: any = this.checkerOrUndefined(); + if (checker === undefined) { + return undefined; + } + let decl: any; + try { + decl = checker.getSymbolAtLocation(node)?.valueDeclaration?.resolve(); + } catch (e) { + return undefined; + } + if ((decl?.kind !== SyntaxKind.Parameter) || (this.goGetArgParameterType(decl) !== 'map[string]any')) { + return undefined; + } + const access: any = node.parent; + if ((access?.kind === SyntaxKind.ElementAccessExpression) && (access.expression === node) + && (this.g01ReadOk(node, access) !== 'map[string]any')) { + return undefined; + } + return 'map[string]any'; + } + + // `receiver[k]` may replace GetValue(receiver, k) on a declared map[string]any: literal key, not a + // compared operand, not an element-write value (the ccxt write pass proves those from the helper + // spelling), and a market row or a consumer that derefScalars the value as GetValue did + g01ReadOk(receiver, access): string | undefined { + if (this.goIsComparedOperand(access) || this.g01IsWriteValue(access) || !this.g01LiteralKey(access.argumentExpression)) { + return undefined; + } + return (this.g01MarketRow(receiver) || this.x02CurrencyRow(receiver) || this.g01DerefConsumer(access)) ? 'map[string]any' : undefined; + } + + // a string literal or a non-negative integer literal key + g01LiteralKey(key): boolean { + return (key?.kind === SyntaxKind.StringLiteral) || (key?.kind === SyntaxKind.NoSubstitutionTemplateLiteral) + || ((key?.kind === SyntaxKind.NumericLiteral) && /^\d+$/.test(`${key.text ?? ''}`)); + } + + // `y[k] = x["lit"]` + g01IsWriteValue(access): boolean { + let operand: any = access; + while (operand.parent?.kind === SyntaxKind.ParenthesizedExpression) { + operand = operand.parent; + } + const parent: any = operand.parent; + return (parent?.kind === SyntaxKind.BinaryExpression) && (parent.right === operand) + && (parent.operatorToken?.kind === SyntaxKind.EqualsToken) && (parent.left?.kind === SyntaxKind.ElementAccessExpression); + } + + // a Market-typed local written only by `this.market (…)` (or undefined): that accessor returns + // MarketTyped rows, whose values derefScalar leaves unchanged. Currency rows can hold *string values. + g01MarketRow(node): boolean { + let type: any; + try { + type = this.getChecker().getTypeAtLocation(node); + } catch (e) { + return false; + } + const names = [ type?.aliasSymbol?.name, type?.symbol?.name ]; + if (!names.some((n) => [ 'Market', 'MarketInterface' ].includes(n))) { + return false; + } + const declaration = this.goDeclarationOfIdentifier(node); + const scope: any = (declaration === undefined) ? undefined : this.goEnclosingFunction(declaration); + if (scope === undefined) { + return false; + } + const isRow = (v: any) => (v === undefined) || ((v.kind === SyntaxKind.Identifier) && (v.text === 'undefined')) + || ((v.kind === SyntaxKind.CallExpression) && (v.expression?.kind === SyntaxKind.PropertyAccessExpression) + && (v.expression.expression?.kind === SyntaxKind.ThisKeyword) && (v.expression.name?.text === 'market')); + let ok = isRow(declaration.initializer); + const name = declaration.name?.text; + const visit = (n: any) => { + if (!ok) { + return; + } + if ((n.kind === SyntaxKind.BinaryExpression) && (n.left?.kind === SyntaxKind.Identifier) && (n.left.text === name) + && (n.operatorToken?.kind === SyntaxKind.EqualsToken) && this.goIdentifierRefersToDeclaration(n.left, declaration)) { + ok = isRow(n.right); + } else if ((n.kind === SyntaxKind.ArrayLiteralExpression) && (n.parent?.kind === SyntaxKind.BinaryExpression) && (n.parent.left === n) + && n.elements.some((e: any) => (e.kind === SyntaxKind.Identifier) && (e.text === name))) { + ok = false; + } + n.forEachChild(visit); + }; + scope.forEachChild(visit); + return ok; + } + + // the read is the container of an enclosing element read, an operand of `in`, or an argument of a + // SafeValueN-backed accessor (or safeCurrencyCode): each derefScalars it, so GetValue's deref is redundant + g01DerefConsumer(access): boolean { + let operand: any = access; + while (operand.parent?.kind === SyntaxKind.ParenthesizedExpression) { + operand = operand.parent; + } + const parent: any = operand.parent; + if ((parent?.kind === SyntaxKind.ElementAccessExpression) && (parent.expression === operand)) { + return !this.isGoElementAccessAssignmentTarget(parent); + } + if ((parent?.kind === SyntaxKind.BinaryExpression) && (parent.operatorToken?.kind === SyntaxKind.InKeyword)) { + return true; + } + const callee: any = parent?.expression; + return (parent?.kind === SyntaxKind.CallExpression) && (parent.arguments.indexOf(operand) >= 0) + && (callee?.kind === SyntaxKind.PropertyAccessExpression) && (callee.expression?.kind === SyntaxKind.ThisKeyword) + && /^(?:safe(?:Value|String|StringLower|StringUpper|Integer|IntegerProduct|Float|Number|Bool|Timestamp|Dict|List)(?:2|N)?|safeCurrencyCode)$/.test(`${callee.name?.text ?? ''}`); + } + // hx4 G02 + // base safeValue/safeValue2/safeValueN (SafeValueN derefScalars every hit and its default) and + // ws cache constructors (non-nil, outside the derefScalar set): never a nil pointer IsEqual folds + goG02NonPointerAccessorSource(expr): boolean { + if (expr?.kind === SyntaxKind.ConditionalExpression) { + return this.goIsNonPointerValueSource(expr.whenTrue) && this.goIsNonPointerValueSource(expr.whenFalse); + } + if (expr?.kind === SyntaxKind.NewExpression) { + const name = (expr.expression?.kind === SyntaxKind.Identifier) ? expr.expression.text : undefined; + return GO_G02_CACHE_CLASSES.indexOf(name) >= 0; + } + if (expr?.kind !== SyntaxKind.CallExpression) { + return false; + } + const callee = expr.expression; + if (callee?.kind !== SyntaxKind.PropertyAccessExpression || callee.expression?.kind !== SyntaxKind.ThisKeyword + || callee.name?.kind !== SyntaxKind.Identifier) { + return false; + } + const keys = GO_G02_SAFE_VALUE_KEYS[callee.name.text]; + if (keys === undefined || expr.arguments.length > keys + 1) { + return false; + } + // a default is returned as given (after derefScalar): only a literal is provably not a nil *sync.Map + if (expr.arguments.length === keys + 1 && !this.goG02LiteralDefault(expr.arguments[keys])) { + return false; + } + const checker: any = this.checkerOrUndefined(); + const declarations = checker?.getSymbolAtLocation(callee.name)?.declarations?.map((d) => d.resolve()); + if (!declarations || declarations.length === 0) { + return false; + } + // an exchange override would print its own Go body: only the base property qualifies + return declarations.every((d) => /(^|\/)ts\/src\/base\/Exchange\.ts$/.test(String(d.getSourceFile()?.fileName ?? '').replace(/\\/g, '/'))); + } + + goG02LiteralDefault(node): boolean { + node = this.goUnwrapParenthesizedNode(node); + switch (node?.kind) { + case SyntaxKind.NullKeyword: + case SyntaxKind.StringLiteral: + case SyntaxKind.NoSubstitutionTemplateLiteral: + case SyntaxKind.NumericLiteral: + case SyntaxKind.TrueKeyword: + case SyntaxKind.FalseKeyword: + case SyntaxKind.ObjectLiteralExpression: + case SyntaxKind.ArrayLiteralExpression: + return true; + case SyntaxKind.Identifier: + return node.text === 'undefined'; + } + return false; + } + + + + // hx4 G06 + // a `*string` the checker narrows to string (or whose every write is a defaulted SafeString) + // is non-nil, so GetLength/GetArrayLength's deref + byte count is `len(*x)` + goHx4G06DerefLength(expression, printedText: string, lengthNode): string | undefined { + if ((expression?.kind !== SyntaxKind.Identifier) || (printedText !== expression.text)) { + return undefined; + } + if (this.goLengthFeedsArithmeticClassifier(lengthNode) || !this.goDerefableStringOperand(expression)) { + return undefined; + } + return `len(*${printedText})`; + } + + // GetIndexOf on two operands that are Go strings once a proven-non-nil `*string` is deref'd: + // both sides reach the helper's `case string` arm, which is strings.Index + goHx4G06DerefIndexOf(node, name, parsedArg): string | undefined { + if ((typeof name !== 'string') || (typeof parsedArg !== 'string') || name.includes('\n') || parsedArg.includes('\n')) { + return undefined; + } + if (!this.goFileKeepsFileLevelImports() || !this.goStdlibImportIsPlaceable()) { + return undefined; + } + const operands = [ this.goUnwrapPrintedAssertions(node?.expression?.expression), this.goUnwrapPrintedAssertions(node?.arguments?.[0]) ]; + const texts = [ name, parsedArg ]; + if (!operands.some((o) => this.goDerefableStringOperand(o))) { + return undefined; // plain string pairs and nilable receivers stay with goNativeIndexOf + } + const out: string[] = []; + for (let i = 0; i < 2; i++) { + const o = operands[i]; + if ((o?.kind === SyntaxKind.Identifier) && (texts[i] === o.text) && this.goDerefableStringOperand(o)) { + out.push('*' + texts[i]); + } else if (this.goIndexOfOperandType(o, texts[i]) === 'string') { + out.push(texts[i]); + } else { + return undefined; + } + } + this.goFileStdlibImports.add('strings'); + return `strings.Index(${out[0]}, ${out[1]})`; + } + + + // hx4 G08 + // a `*string` local the checker narrowed to a union of string literals (`x === 'A' || x === 'B'`): + // every member is a string, so the Go pointer is non-nil at this read and may be dereferenced + goLiteralUnionNarrowedStringDeref(node): boolean { + if ((node?.kind !== SyntaxKind.Identifier) || (this.goDeclaredTypeOfIdentifier(node) !== '*string')) { + return false; + } + const checker: any = this.checkerOrUndefined(); + const type = checker?.getTypeAtLocation(node); + if ((type === undefined) || ((type.flags & TypeFlags.Union) === 0)) { + return false; + } + const members = type.getTypes?.() ?? []; + return (members.length > 0) && members.every((member) => (member.flags & TypeFlags.StringLiteral) !== 0); + } + // hx4 G09 + // hand-written BaseExchange value fields (go/v4/exchange.go) read as `this.` + GO_G09_NUMERIC_FIELDS: { [tsName: string]: string } = { + 'rateLimit': 'float64', + 'fetchHistoryCacheSize': 'int', + 'minFundingAddressLength': 'int', + }; + + // `this.rateLimit` & co.: only when the checker resolves the property to the base + // `class Exchange` declaration (a venue redeclaring it prints its own field) + goG09FieldKind(node): string | undefined { + node = this.goUnwrapParenthesizedNode(node); + if ((node?.kind !== SyntaxKind.PropertyAccessExpression) || (node.expression?.kind !== SyntaxKind.ThisKeyword)) { + return undefined; + } + const kind = this.GO_G09_NUMERIC_FIELDS[node.name?.escapedText ?? node.name?.text]; + if (kind === undefined) { + return undefined; + } + const checker: any = this.checkerOrUndefined(); + const declaration: any = checker?.getSymbolAtLocation(node)?.valueDeclaration?.resolve(); + if ((declaration?.kind !== SyntaxKind.PropertyDeclaration) || (declaration.parent?.kind !== SyntaxKind.ClassDeclaration)) { + return undefined; + } + const className = declaration.parent.name?.escapedText ?? declaration.parent.name?.text; + return (className === 'Exchange') ? kind : undefined; + } + + // [kind, pointer] of one ordered-comparison operand, undefined when unprovable + goG09OperandKind(node, text: string): [string, boolean] | undefined { + const pointee = this.goOrderedComparisonPointerKind(node); + if (pointee !== undefined) { + return [ pointee, true ]; + } + const field = this.goG09FieldKind(node); + if (field !== undefined) { + return [ field, false ]; + } + const kind = this.goOperandNumericKind(node, text); + return (kind === undefined) ? undefined : [ kind, false ]; + } + + // Ordered comparisons the phase-1 rule refuses only because the two concrete kinds differ + // (int vs int64, int/int64 vs float64) or an operand is a typed base field. The helper + // converts the narrower side exactly like `int64(x)` / `float64(x)`; nil and NaN rules stay. + printG09WideningComparison(left, right, leftText: string, rightText: string, op): string | undefined { + const operator = ORDERED_COMPARISON_OPERATORS[op]; + if (operator === undefined) { + return undefined; + } + if (this.goIsNumericConstant(left) && this.goIsNumericConstant(right)) { + return undefined; + } + const l = this.goG09OperandKind(left, leftText); + const r = this.goG09OperandKind(right, rightText); + if ((l === undefined) || (r === undefined)) { + return undefined; + } + let kind = this.goComparisonKind(left, l[0], right, r[0]); + let lv = l[1] ? `*${leftText}` : leftText; + let rv = r[1] ? `*${rightText}` : rightText; + if (kind === undefined) { + if (this.goIsNumericConstant(left) || this.goIsNumericConstant(right)) { + return undefined; + } + kind = ((l[0] === 'float64') || (r[0] === 'float64')) ? 'float64' : 'int64'; + if (l[0] !== kind) { + lv = `${kind}(${lv})`; + } + if (r[0] !== kind) { + rv = `${kind}(${rv})`; + } + } + if ((kind === 'float64') && ((operator === '<') || (operator === '<='))) { + return undefined; + } + const leftNil = l[1] && !this.goHasEnclosingNilGuard(left); + const rightNil = r[1] && !this.goHasEnclosingNilGuard(right); + if ((leftNil && !r[1] && !this.goIsPureComparisonOperand(right)) + || (rightNil && !l[1] && !this.goIsPureComparisonOperand(left))) { + return undefined; + } + const greater = (operator === '>') || (operator === '>='); + const cmp = `${lv} ${operator} ${rv}`; + if (!leftNil && !rightNil) { + return `(${cmp})`; + } + if (leftNil && !rightNil) { + return greater ? `(${leftText} != nil && ${cmp})` : `(${leftText} == nil || ${cmp})`; + } + if (!leftNil && rightNil) { + return greater ? `(${rightText} == nil || ${cmp})` : `(${rightText} != nil && ${cmp})`; + } + if (operator === '>') { + return `(${leftText} != nil && (${rightText} == nil || ${cmp}))`; + } + if (operator === '>=') { + return `(${rightText} == nil || (${leftText} != nil && ${cmp}))`; + } + if (operator === '<') { + return `(${rightText} != nil && (${leftText} == nil || ${cmp}))`; + } + return `(${leftText} == nil || (${rightText} != nil && ${cmp}))`; + } } @@ -8309,3 +8645,175 @@ ${tryBodyBlock} // console.log(baseClassDeclaration); +// hx4 G02: key-argument count of the base safeValue family; ws cache classes (Go constructors return a non-nil *T) +const GO_G02_SAFE_VALUE_KEYS: { [name: string]: number } = { 'safeValue': 2, 'safeValue2': 3, 'safeValueN': 2 }; +const GO_G02_CACHE_CLASSES = [ 'ArrayCache', 'ArrayCacheByTimestamp', 'ArrayCacheBySymbolById', 'ArrayCacheBySymbolBySide' ]; + +// hx4 G04 +export interface GoTranspiler { + goNativeIntWideningArithmetic(node, leftType: string, rightType: string, leftText: string, rightText: string): { goType: string, text: string } | undefined; +} +// `a - b` / `a * b` / `a + b` with one int64 and one int operand (or an int `- * %N` in a `var` initializer): +// the helper boxes int64 (Add/Subtract/Mod via the float path, Multiply via reflect Int()); Go refuses +// the mixed operator, so the int side converts. Exact under the helper's own 2^53 float bound. +GoTranspiler.prototype.goNativeIntWideningArithmetic = function (node, leftType: string, rightType: string, leftText: string, rightText: string) { + const op = node.operatorToken.kind; + const isMod = (op === SyntaxKind.PercentToken) && this.isNonZeroIntegerLiteral(node.right); + if ((op !== SyntaxKind.MinusToken) && (op !== SyntaxKind.AsteriskToken) && (op !== SyntaxKind.PlusToken) && !isMod) { + return undefined; + } + const mixed = ((leftType === 'int64') && (rightType === 'int')) || ((leftType === 'int') && (rightType === 'int64')); + // `var x int64 = n - 1` over an `int` local: Subtract/Multiply box int64, so the int side converts + const intKinds = [ 'int', 'const-int' ]; + const declaredInt64 = (op !== SyntaxKind.PlusToken) && intKinds.includes(leftType) && intKinds.includes(rightType) + && ((leftType === 'int') || (rightType === 'int')) && this.goInsideTypedDeclarationInitializer(node); + if ((!mixed || isMod) && !declaredInt64) { + return undefined; + } + const operand = (operandNode, operandType: string, printed: string) => (operandType === 'int') + ? 'int64(' + this.goUnwrapPrintedParens(printed.trim()) + ')' + : this.goNativeOperandText(operandNode, printed); + const left = operand(node.left, leftType, leftText); + const right = operand(node.right, rightType, rightText); + const symbol = this.SupportedKindNames[op]; + const separator = this.goBinarySeparator(symbol, right, node.left, node.right); + return { 'goType': 'int64', 'text': left + separator + symbol + separator + right }; +}; + +export interface GoTranspiler { + goStringLiteralUnionType(type): boolean; +} +// `if (x === 'a' || x === 'b')` narrows a `Str` local to a union of string literals: every member +// is a non-nilable string, so the deref is as safe as for a plain narrowed `string` +GoTranspiler.prototype.goStringLiteralUnionType = function (type) { + if ((type === undefined) || ((type.flags & TypeFlags.Union) === 0)) { + return false; + } + const members = type.getTypes(); + return (members.length > 0) && members.every((member) => (member.flags & TypeFlags.StringLike) !== 0); +}; + +export interface GoTranspiler { + goConcatDerefableStringOperand(node): boolean; +} +// the concat rule's `*string` leaf proof: goDerefableStringOperand, or a declared `*string` +// identifier the checker narrowed to a union of string literals at this use +GoTranspiler.prototype.goConcatDerefableStringOperand = function (node) { + if (this.goDerefableStringOperand(node)) { + return true; + } + if ((node?.kind !== SyntaxKind.Identifier) || (this.goDeclaredTypeOfIdentifier(node) !== '*string')) { + return false; + } + const checker: any = this.checkerOrUndefined(); + return (checker !== undefined) && this.goStringLiteralUnionType(checker.getTypeAtLocation(node)); +}; + +// hx4 X02 +export interface GoTranspiler { + x02CurrencyRow(node): boolean; +} +// a Currency-typed local written only by `this.currency (…)` / `this.safeCurrency (…)` (or undefined): +// the ccxt Go runtime returns those through CurrencyTyped, whose values derefScalar leaves unchanged +GoTranspiler.prototype.x02CurrencyRow = function (node) { + let type: any; + try { + type = this.getChecker().getTypeAtLocation(node); + } catch (e) { + return false; + } + const named = (t: any) => [ t?.getAliasSymbol?.()?.name, t?.getSymbol?.()?.name ].some((n) => [ 'Currency', 'CurrencyInterface' ].includes(n)); + const members = ((typeof type?.isUnionType === 'function') && type.isUnionType()) ? type.getTypes() : [ type ]; + if (!named(type) && !members.some((t: any) => named(t))) { + return false; + } + const declaration = this.goDeclarationOfIdentifier(node); + const scope: any = (declaration === undefined) ? undefined : this.goEnclosingFunction(declaration); + if (scope === undefined) { + return false; + } + const isRow = (v: any) => (v === undefined) || ((v.kind === SyntaxKind.Identifier) && (v.text === 'undefined')) + || ((v.kind === SyntaxKind.CallExpression) && (v.expression?.kind === SyntaxKind.PropertyAccessExpression) + && (v.expression.expression?.kind === SyntaxKind.ThisKeyword) && [ 'currency', 'safeCurrency' ].includes(v.expression.name?.text)); + let ok = isRow(declaration.initializer); + const name = declaration.name?.text; + const visit = (n: any) => { + if (!ok) { + return; + } + if ((n.kind === SyntaxKind.BinaryExpression) && (n.left?.kind === SyntaxKind.Identifier) && (n.left.text === name) + && (n.operatorToken?.kind === SyntaxKind.EqualsToken) && this.goIdentifierRefersToDeclaration(n.left, declaration)) { + ok = isRow(n.right); + } else if ((n.kind === SyntaxKind.ArrayLiteralExpression) && (n.parent?.kind === SyntaxKind.BinaryExpression) && (n.parent.left === n) + && n.elements.some((e: any) => (e.kind === SyntaxKind.Identifier) && (e.text === name))) { + ok = false; + } + n.forEachChild(visit); + }; + scope.forEachChild(visit); + return ok; +}; + +// hx4 G11 +export interface GoTranspiler { + g11NativeParameterType(fn, param, index: number): string | undefined; + g11ParameterHasNullishDefault(body, param): boolean; +} +// A required parameter of a sync exchange-local method whose TS type is `Str`/`string`, `Dict`-shaped or +// `List`: the Go type every call site passes (`string` first, then *string / map / []any), when the body +// never writes another type, never nil-tests it and never `??`-defaults it (D2, D5) +GoTranspiler.prototype.g11NativeParameterType = function (fn, param, index: number) { + if (this.isAsyncFunction(fn) || !this.goHasTreeCallSite(fn)) { + return undefined; + } + const candidates: string[] = []; + const type = this.checkerOrUndefined()?.getTypeAtLocation(param); + if (type !== undefined) { + const all = ((typeof type.isUnionType === 'function') && type.isUnionType()) ? type.getTypes() : [type]; + const parts = all.filter(p => !(p.flags & (TypeFlags.Undefined | TypeFlags.Null))); + if ((parts.length > 0) && parts.every(p => (p.flags & (TypeFlags.String | TypeFlags.StringLiteral)) !== 0)) { + candidates.push('string'); + } + } + for (const goType of this.goNativeParameterTypeCandidates(param).concat(this.g13NumericParameterCandidates(param))) { + if (!candidates.includes(goType)) { + candidates.push(goType); + } + } + for (const goType of candidates) { + if (this.goParameterCallSitesPassType(fn, index, goType) + && this.goLocalIsSafeToType(fn.body, param, param.name.text, goType) + && (goType.startsWith('*') || this.goParameterKeepsNilCompareNative(fn.body, param, goType)) + && (goType.startsWith('*') || !this.g11ParameterHasNullishDefault(fn.body, param))) { + return goType; + } + } + return undefined; +}; + +// `x ?? d` / `x || d` reads the parameter's absent state, which a non-nilable Go type cannot hold +GoTranspiler.prototype.g11ParameterHasNullishDefault = function (body, param) { + const name = param.name.text; + return this.hasNodeWhere(body, (n: any) => { + const parent: any = n.parent; + return (n.kind === SyntaxKind.Identifier) && (n.text === name) && (parent?.kind === SyntaxKind.BinaryExpression) + && (parent.left === n) && ((parent.operatorToken.kind === SyntaxKind.QuestionQuestionToken) + || (parent.operatorToken.kind === SyntaxKind.QuestionQuestionEqualsToken)); + }); +}; + +// hx4 G13 +export interface GoTranspiler { + g13NumericParameterCandidates(param): string[]; +} +// a required `Int` / `Num` / `number` parameter: the pointer Go type the GetArg twins already use +// for `Int` / `Num` (nil is the absent state); a non-nullable `number` takes the plain value type its callers pass +GoTranspiler.prototype.g13NumericParameterCandidates = function (param) { + const declared = (param?.type !== undefined) ? String(param.type.getText()).trim() : undefined; + switch (declared) { + case 'Int': return ['*int64']; + case 'Num': return ['*float64']; + case 'number': return ['int64', 'float64']; + } + return []; +}; diff --git a/src/javaTranspiler.ts b/src/javaTranspiler.ts index ea7c2320..9c1e4162 100644 --- a/src/javaTranspiler.ts +++ b/src/javaTranspiler.ts @@ -3532,6 +3532,9 @@ export class JavaTranspiler extends BaseTranspiler { && this.javaPrintsNonNullValue(right)) { return `${prefixes}${acc}.put(${lastKey}, ${rhs})`; } + if (this.javaHx4MapPutIsNative(baseExpr, keys)) { + return `${prefixes}${acc}.put(${keyArg}, ${rhs})`; + } return `${prefixes}Helpers.addElementToObject(${acc}, ${lastKey}, ${rhs})`; } @@ -3571,6 +3574,10 @@ export class JavaTranspiler extends BaseTranspiler { return `Helpers.inOp(${objText}, ${keyText})`; } + const hx4J05 = this.printHx4J05ModComparison(left, right, op); + if (hx4J05 !== undefined) { + return hx4J05; + } // native comparison when both operands provably print as Java numbers. `>` is exact for every // numeric pair (isGreaterThan is a toDouble compare, NaN included); `>=` / `<` / `<=` also go // through the helper's isEqual, so they need operands isEqual reproduces exactly. @@ -3876,7 +3883,7 @@ export class JavaTranspiler extends BaseTranspiler { const name = receiver.name?.text; const field = (typeof name === 'string') ? JAVA_FIELD_TYPES[name] : undefined; if (field === undefined || field.map !== true) { - return undefined; + return this.javaJ02FieldMapReadText(receiver, key); } const keyText = this.printNode(key, 0); let keyGuarded = false; @@ -6466,7 +6473,7 @@ export class JavaTranspiler extends BaseTranspiler { } printIndexOfCall(node, _identation, name = undefined, parsedArg = undefined) { - return this.javaNativeIndexOfCall(node, name, parsedArg) ?? `${this.INDEXOF_WRAPPER_OPEN}${name}, ${parsedArg}${this.INDEXOF_WRAPPER_CLOSE}`; + return this.javaNativeIndexOfCall(node, name, parsedArg) ?? this.javaHx4J06NarrowedIndexOf(node, name, parsedArg) ?? `${this.INDEXOF_WRAPPER_OPEN}${name}, ${parsedArg}${this.INDEXOF_WRAPPER_CLOSE}`; } printSearchCall(_node, _identation, name = undefined, parsedArg = undefined) { @@ -7635,4 +7642,587 @@ export class JavaTranspiler extends BaseTranspiler { } return false; } + // hx4 J01: `m[k] = v` on a local the printer declared `Map` whose every write is a + // provably non-concurrent map (fresh literal/extend/omit, or a base safeDict* of non-field data): + // the helper's map branch is then `m.put(k, v)` (null value included; its CHM removal never applies) + javaHx4MapPutIsNative(baseExpr, keys: any[]): boolean { + if (keys.length !== 1 || baseExpr === undefined || !isIdentifier(baseExpr) || !this.javaDeclaredMapReceiver(baseExpr)) { + return false; + } + const key = keys[0]; + if (!isStringLiteralLikeNode(key) && !this.javaDeclaredStringType(key) + && !this.isJavaStringType(this.getChecker().getTypeAtLocation(key))) { + return false; // Map.put needs a String key (the helper takes any box) + } + const declaration: any = this.javaDeclarationOfIdentifier(baseExpr); + if (declaration === undefined || declaration.kind !== SyntaxKind.VariableDeclaration || !declaration.initializer) { + return false; // parameters may carry a caller's ConcurrentHashMap + } + const admits = (rhs) => this.javaHx4PlainMapSource(baseExpr, rhs); + return admits(declaration.initializer) && !this.javaLocalIsReassigned(baseExpr, admits); + } + + javaHx4PlainMapSource(container, value): boolean { + const node = this.unwrapPrintTransparentExpression(value); + if (node === undefined) { + return false; + } + if (this.javaFreshHashMapValue(container, node)) { + return true; + } + if (!isCallExpression(node) || !isPropertyAccessExpression(node.expression) + || node.expression.expression.kind !== SyntaxKind.ThisKeyword) { + return false; + } + const name = node.expression.name.text; + const fileName = this.checkerOrUndefined()?.getResolvedSignature(node)?.declaration?.resolve()?.getSourceFile?.()?.fileName; + if (typeof fileName !== 'string' || !JAVA_FRESH_EXTEND_FILE.test(fileName)) { + return false; // a venue override may return anything + } + if (name === 'extend' || name === 'deepExtend' || name === 'omit') { + return true; // Generic.Extend / deepExtend / Functions.omitMap build a fresh LinkedHashMap (or null) + } + if (name === 'safeDict' || name === 'safeDict2' || name === 'safeDictN') { + // hands back an element of the source or the default: never a field map or a ws client map + return node.arguments.length > 0 && this.javaHx4NonSharedSource(node.arguments[0], 0) + && (node.arguments.length < (name === 'safeDict2' ? 4 : 3) + || this.javaHx4DefaultIsPlain(node.arguments[node.arguments.length - 1])); + } + return false; + } + + javaHx4DefaultIsPlain(value): boolean { + const node = this.unwrapPrintTransparentExpression(value); + return node !== undefined && (isObjectLiteralExpression(node) || node.kind === SyntaxKind.UndefinedKeyword + || (isIdentifier(node) && node.text === 'undefined') || node.kind === SyntaxKind.NullKeyword); + } + + // data that can not hold one of the runtime's ConcurrentHashMaps (this. top level, ws client + // futures/subscriptions/rejections and their entries): a local/param/element chain not rooted at them + javaHx4NonSharedSource(value, depth: number): boolean { + const node = this.unwrapPrintTransparentExpression(value); + if (node === undefined || depth > 40) { + return false; + } + if (isElementAccessExpression(node)) { + return this.javaHx4NonSharedSource(node.expression, depth + 1); + } + if (!isIdentifier(node)) { + return false; + } + const declaration: any = this.javaDeclarationOfIdentifier(node); + if (declaration === undefined) { + return false; + } + if (declaration.kind === SyntaxKind.Parameter) { + const type = this.getChecker().getTypeAtLocation(node); + const text = (type?.getSymbol?.()?.escapedName ?? '') + ''; + return !/Client/.test(text) && !/^(client|subscriptions|futures|rejections)$/.test(node.text); + } + const known = this.javaHx4SourceVerdicts.get(declaration); + if (known !== undefined) { + return known; // `true` while in progress: a self-referencing write adds no new source + } + this.javaHx4SourceVerdicts.set(declaration, true); + this.javaHx4InProgress.add(declaration); + const writes: any[] = declaration.initializer ? [declaration.initializer] : []; + const verdict = !this.javaLocalIsReassigned(node, (rhs) => { writes.push(rhs); return true; }) + && writes.every((w) => this.javaHx4NonSharedValue(w, depth + 1)); + this.javaHx4InProgress.delete(declaration); + if (verdict && this.javaHx4InProgress.size > 0) { + this.javaHx4SourceVerdicts.delete(declaration); // leaned on an unfinished verdict: recompute later + } else { + this.javaHx4SourceVerdicts.set(declaration, verdict); + } + return verdict; + } + + javaHx4SourceVerdicts = new WeakMap(); + javaHx4InProgress = new Set(); + + // a value expression that never reads a field map or a ws client's maps + javaHx4NonSharedValue(value, depth: number): boolean { + let shared = false; + const walk = (n) => { + if (shared || n === undefined) { + return; + } + if (isPropertyAccessExpression(n)) { + const called = n.parent !== undefined && isCallExpression(n.parent) && n.parent.expression === n; + if ((!called && (n.expression.kind === SyntaxKind.ThisKeyword + || /^(subscriptions|futures|rejections|hashmap)$/.test(n.name.text))) + || (called && n.name.text === 'createSafeDictionary')) { + shared = true; + return; + } + } + if (n.kind === SyntaxKind.ThisKeyword && !(n.parent !== undefined && isPropertyAccessExpression(n.parent))) { + shared = true; // `this` handed to a call + return; + } + if (isIdentifier(n) && n !== value && !(n.parent !== undefined && isPropertyAccessExpression(n.parent) && n.parent.name === n)) { + const declaration: any = this.javaDeclarationOfIdentifier(n); + if (declaration !== undefined && !this.javaHx4NonSharedSource(n, depth + 1)) { + shared = true; + return; + } + } + n.forEachChild(walk); + }; + walk(value); + return !shared; + } + + // hx4 J02: `this.[k]` on the J02 base map fields. ConcurrentHashMap.get(null) throws + // where the helper answers null, so a non-literal key is always null-tested; the receiver can + // be null too. Key and receiver print twice, so both must be side-effect free. + javaJ02FieldMapReadText(receiver, key): string | undefined { + const name = receiver?.name?.text; + if (typeof name !== 'string' || !Object.prototype.hasOwnProperty.call(JAVA_J02_MAP_FIELDS, name)) { + return undefined; + } + const literal = isStringLiteralLikeNode(key); + if (!literal && !this.javaRepeatableOperand(key)) { + return undefined; + } + const target = this.printNode(receiver, 0); + const keyText = this.printNode(key, 0); + const keyGuard = literal ? '' : `${keyText} == null || `; + return `(${keyGuard}${target} == null ? null : ((java.util.Map)${target}).get(${keyText}))`; + } + + // hx4 J05 + // `(a % N) M` (N a non-zero integer literal, a an int/long operand, M an int literal): the + // native mod prints a finite integral double |v| < |N|, where isEqual (IsInteger -> toLong) and + // isGreaterThan (toDouble) both reduce to the plain double comparison against M. + javaHx4J05IntegralModOperand(node): boolean { + while (node !== undefined && node.kind === SyntaxKind.ParenthesizedExpression) { + node = node.expression; + } + if (node === undefined || !isBinaryExpression(node) || node.operatorToken.kind !== SyntaxKind.PercentToken) { + return false; + } + if (this.javaScalarFamily(node.left) !== 'number' || this.javaScalarFamily(node.right) !== 'number') { + return false; + } + const leftKind = this.javaProvableNumericKind(node.left); + if (leftKind !== 'int' && leftKind !== 'long' && !this.javaProvableCounterInt(node.left)) { + return false; + } + const divisor = node.right; + if (this.javaIntegerLiteralKind(divisor) !== 'int' || Number(divisor.text) === 0) { + return false; + } + return true; + } + + printHx4J05ModComparison(left, right, op): string | undefined { + const javaOps = { + [SyntaxKind.EqualsEqualsToken]: '==', [SyntaxKind.EqualsEqualsEqualsToken]: '==', + [SyntaxKind.ExclamationEqualsToken]: '!=', [SyntaxKind.ExclamationEqualsEqualsToken]: '!=', + [SyntaxKind.LessThanToken]: '<', [SyntaxKind.LessThanEqualsToken]: '<=', + [SyntaxKind.GreaterThanToken]: '>', [SyntaxKind.GreaterThanEqualsToken]: '>=', + }; + const javaOp = javaOps[op]; + if (javaOp === undefined) { + return undefined; + } + const modLeft = this.javaHx4J05IntegralModOperand(left); + const modRight = !modLeft && this.javaHx4J05IntegralModOperand(right); + if (!modLeft && !modRight) { + return undefined; + } + if (this.javaEqualityLiteralKind(modLeft ? right : left) !== 'int') { + return undefined; + } + const leftText = this.printNode(left, 0); + const rightText = this.printNode(right, 0); + // only when the mod side printed the native double remainder + if (!/^\(+double\) /.test(modLeft ? leftText : rightText)) { + return undefined; + } + return `(${leftText} ${javaOp} ${rightText})`; + } + + // hx4 J06 + // `x.indexOf(t)` where a string/Str-declared x is narrowed to a union of string literals + // (`===` tests): x is a non-null String, so String.indexOf is the helper's String arm + javaHx4J06NarrowedIndexOf(node, name, parsedArg) { + const receiver = node?.expression?.expression; + const arg = node?.arguments?.[0]; + if (receiver === undefined || arg === undefined || name === undefined || parsedArg === undefined + || !isIdentifier(receiver) || this.isVarargsArrayReference(receiver)) { + return undefined; + } + let receiverType: any; + try { + receiverType = this.getChecker().getTypeAtLocation(receiver); + } catch (e) { + return undefined; + } + if (receiverType === undefined || (receiverType.flags & TypeFlags.Union) === 0 + || !receiverType.getTypes().every((member) => this.isStringType(member.flags))) { + return undefined; + } + // a DECLARED literal union is no runtime proof: the declaration must carry plain `string` + const symbol = this.getChecker().getSymbolAtLocation(receiver); + const declaration: any = symbol?.valueDeclaration?.resolve?.() ?? symbol?.valueDeclaration; + let declared: any; + try { + declared = declaration?.name === undefined ? undefined : this.getChecker().getTypeAtLocation(declaration.name); + } catch (e) { + declared = undefined; + } + const declaredMembers: any[] = declared === undefined ? [] : ((declared.flags & TypeFlags.Union) !== 0 ? declared.getTypes() : [declared]); + if (!declaredMembers.some((member) => member.flags === TypeFlags.String)) { + return undefined; + } + if (this.javaProvableString(arg)) { + return `((String)${name}).indexOf(${parsedArg})`; + } + return undefined; + } +} + +// hx4 J02 +// more hand-written BaseExchange map fields: every write in BaseExchange.java and ts/src is a +// HashMap / ConcurrentHashMap / Map-cast or null (markets_by_id = null, urls/fees from describe()) +const JAVA_J02_MAP_FIELDS: { [name: string]: true } = { + 'tickers': true, + 'bidsasks': true, + 'trades': true, + 'fees': true, + 'urls': true, + 'markets_by_id': true, +}; + +// hx4 J09: isTrue / isInstance / toLongOrNull / toStringArg go native on proven operands +const HX4_J09_SYNC_BASE_CALLS = new Set([ + 'safeString', 'safeString2', 'safeStringN', 'safeValue', 'safeDict', 'safeInteger', 'json', + 'throwExactlyMatchedException', 'throwBroadlyMatchedException', +]); + +export interface JavaTranspiler { + hx4J09BoxIdentifier(node, seen: Set, depth: number): boolean; + hx4J09BoxValue(node, seen: Set, depth: number): boolean; + hx4J09LiteralTupleElement(node, index: number): boolean; + hx4J09CatchCannotWrap(node): boolean; + hx4J09CoreArgument(type: string, printed: string, node): string | undefined; + hx4J09CcxtErrorClass(node): boolean; +} + +// a class declared in ts/src/base/errors.ts: its Java twin extends RuntimeException, so +// `catchVar instanceof X` compiles against the `Exception` catch parameter +JavaTranspiler.prototype.hx4J09CcxtErrorClass = function (node): boolean { + const checker: any = this.checkerOrUndefined(); + let symbol: any; + try { + symbol = checker?.getSymbolAtLocation(node); + if (symbol !== undefined && (symbol.flags & SymbolFlags.Alias)) { + symbol = checker.getAliasedSymbol(symbol); + } + } catch (e) { + return false; + } + const declaration: any = symbol?.declarations?.[0]?.resolve(); + return declaration?.kind === SyntaxKind.ClassDeclaration + && /(^|[\\/])ts[\\/]src[\\/]base[\\/]errors\.ts$/.test(declaration.getSourceFile?.()?.fileName ?? ''); +}; + +// a local whose declared TS type is boolean-family and whose every write (D2 scan, tuples +// included) is a Boolean-or-null box; a write cycle back to a local under proof is accepted +JavaTranspiler.prototype.hx4J09BoxIdentifier = function (node, seen: Set, depth: number): boolean { + const checker: any = this.checkerOrUndefined(); + if (checker === undefined || node?.kind !== SyntaxKind.Identifier || depth > 6) { + return false; + } + const symbol = checker.getSymbolAtLocation(node); + const decl: any = symbol?.valueDeclaration?.resolve(); + if (decl === undefined || decl.name?.text !== node.text) { + return false; + } + if (seen.has(decl)) { + return true; + } + const next = new Set(seen); + next.add(decl); + const accepts = (value) => this.hx4J09BoxValue(value, next, depth + 1); + if (decl.kind === SyntaxKind.BindingElement) { + const pattern = decl.parent; + const declaration = pattern?.parent; + if (decl.initializer !== undefined || decl.dotDotDotToken !== undefined + || pattern?.kind !== SyntaxKind.ArrayBindingPattern || declaration?.kind !== SyntaxKind.VariableDeclaration) { + return false; + } + const index = pattern.elements.indexOf(decl); + if (!this.javaBooleanBoxTupleElement(declaration.initializer, index) + && !this.hx4J09LiteralTupleElement(declaration.initializer, index)) { + return false; + } + return this.javaWritesAreBoxed(symbol, { initializer: undefined, parent: declaration }, next, accepts, true); + } + if (decl.kind !== SyntaxKind.VariableDeclaration) { + return false; // parameters are boxes their callers fill + } + let type; + try { + type = this.javaTypeOfDeclaration(decl); + } catch (e) { + return false; + } + if (!this.javaBooleanBoxType(type) && !this.javaNullableBooleanDeclaration(decl)) { + return false; + } + return this.javaWritesAreBoxed(symbol, decl, next, accepts, true); +}; + +// a value whose printed Java is a Boolean, boolean or null +JavaTranspiler.prototype.hx4J09BoxValue = function (node, seen: Set, depth: number): boolean { + if (node === undefined) { + return false; + } + if (node.kind === SyntaxKind.ParenthesizedExpression || node.kind === SyntaxKind.AsExpression + || node.kind === SyntaxKind.NonNullExpression) { + return this.hx4J09BoxValue(node.expression, seen, depth); + } + if (node.kind === SyntaxKind.NullKeyword || (node.kind === SyntaxKind.Identifier && node.text === 'undefined')) { + return true; + } + if (node.kind === SyntaxKind.ConditionalExpression) { + return this.hx4J09BoxValue(node.whenTrue, seen, depth) && this.hx4J09BoxValue(node.whenFalse, seen, depth); + } + if (node.kind === SyntaxKind.Identifier) { + return this.hx4J09BoxIdentifier(node, seen, depth); + } + if (this.javaPrintsBooleanValue(node, new Set())) { + return true; + } + if (node.kind !== SyntaxKind.CallExpression) { + return false; + } + if (this.javaCallBooleanKind(node) !== undefined) { + return true; + } + // safeBool* with a non-literal default: the accessor returns a Boolean member or the default + const callee = node.expression; + if (!isPropertyAccessExpression(callee) || callee.expression.kind !== SyntaxKind.ThisKeyword) { + return false; + } + const at = JAVA_THIS_BOOLEAN_BOX_METHODS[String(callee.name.text)]; + if (at === undefined || this.javaBooleanValueKind(node) === undefined || !this.javaCalleeResolves(node)) { + return false; + } + const declaration: any = this.getChecker().getResolvedSignature(node)?.declaration?.resolve(); + if (declaration?.name?.text !== callee.name.text + || !JAVA_THIS_RETURN_TYPES_BASE_FILE.test(declaration.getSourceFile?.()?.fileName ?? '')) { + return false; + } + const fallback = node.arguments?.[at]; + return fallback !== undefined && this.hx4J09BoxValue(fallback, seen, depth); +}; + +// element `index` of a base-tier `this.m(..)` whose every return is an array literal with a +// Java boolean at that position (`handlePostOnly`: `[ true, p ]` / `[ false, p ]`) +JavaTranspiler.prototype.hx4J09LiteralTupleElement = function (node, index: number): boolean { + if (node?.kind !== SyntaxKind.CallExpression || index < 0) { + return false; + } + const callee = node.expression; + if (!isPropertyAccessExpression(callee) || callee.expression.kind !== SyntaxKind.ThisKeyword) { + return false; + } + let declaration: any; + try { + declaration = this.getChecker().getResolvedSignature(node)?.declaration?.resolve(); + } catch (e) { + return false; + } + if (declaration?.kind !== SyntaxKind.MethodDeclaration || declaration.body === undefined + || declaration.name?.text !== callee.name.text + || !JAVA_THIS_RETURN_TYPES_BASE_FILE.test(declaration.getSourceFile?.()?.fileName ?? '')) { + return false; + } + let returns = 0; + let ok = true; + const scan = (current: Node) => { + if (!ok || (current !== declaration && isFunctionLike(current))) { + return; + } + if (isReturnStatement(current)) { + returns++; + const value: any = current.expression; + if (value === undefined || !isArrayLiteralExpression(value) + || !this.javaPrintsBooleanValue(value.elements[index], new Set())) { + ok = false; + return; + } + } + current.forEachChild(scan); + }; + scan(declaration.body); + return ok && returns > 0; +}; + +// `e instanceof X` on a catch variable equals Helpers.isInstance (which first unwraps a +// CompletionException/ExecutionException) when the try block cannot raise a wrapped one: +// no await, every call a synchronous base-tier accessor/thrower +JavaTranspiler.prototype.hx4J09CatchCannotWrap = function (node): boolean { + if (node?.kind !== SyntaxKind.Identifier) { + return false; + } + const checker: any = this.checkerOrUndefined(); + const decl: any = checker?.getSymbolAtLocation(node)?.valueDeclaration?.resolve(); + const clause = decl?.parent; + const tryStatement = clause?.parent; + if (decl?.kind !== SyntaxKind.VariableDeclaration || clause?.kind !== SyntaxKind.CatchClause + || tryStatement?.kind !== SyntaxKind.TryStatement || tryStatement.catchClause !== clause) { + return false; + } + let ok = true; + const scan = (current: any) => { + if (!ok) { + return; + } + if (isFunctionLike(current) || current.kind === SyntaxKind.AwaitExpression || current.kind === SyntaxKind.TryStatement) { + ok = false; + return; + } + if (current.kind === SyntaxKind.CallExpression) { + const callee = current.expression; + if (!isPropertyAccessExpression(callee) || callee.expression.kind !== SyntaxKind.ThisKeyword + || !HX4_J09_SYNC_BASE_CALLS.has(String(callee.name.text))) { + ok = false; + return; + } + const declaration: any = checker.getResolvedSignature(current)?.declaration?.resolve(); + if (declaration === undefined + || !JAVA_THIS_RETURN_TYPES_BASE_FILE.test(declaration.getSourceFile?.()?.fileName ?? '')) { + ok = false; + return; + } + } + current.forEachChild(scan); + }; + scan(tryStatement.tryBlock); + return ok; +}; + +// core-argument conversions a declaration already proves: a const `= undefined` local is +// null; a const `x.length` local the build layer declares Integer widens to the Long slot +JavaTranspiler.prototype.hx4J09CoreArgument = function (type: string, printed: string, node): string | undefined { + if (node === undefined || !isIdentifier(node) || printed !== node.text || (type !== 'Long' && type !== 'String')) { + return undefined; + } + const declaration: any = this.javaDeclarationOfIdentifier(node); + if (declaration === undefined || !isVariableDeclaration(declaration) || (declaration.name as any)?.text !== node.text + || (getCombinedNodeFlags(declaration) & NodeFlags.Const) === 0) { + return undefined; + } + const initializer = declaration.initializer; + if (initializer !== undefined && isIdentifier(initializer) && initializer.text === 'undefined') { + return `(${type}) null`; + } + if (type === 'Long' && initializer !== undefined && isPropertyAccessExpression(initializer) + && initializer.name.text === 'length' && this.javaDeclaredTypeOf(node) === 'Integer') { + return `((long) ${printed})`; + } + return undefined; +}; + +{ + const proto: any = JavaTranspiler.prototype; + const printCondition = proto.printCondition; + proto.printCondition = function (node, identation) { + const printed: string = printCondition.call(this, node, identation); + let inner = node; + while (inner?.kind === SyntaxKind.ParenthesizedExpression) { + inner = inner.expression; + } + if (inner?.kind === SyntaxKind.Identifier && printed.trimStart().startsWith(this.FALSY_WRAPPER_OPEN) + && this.hx4J09BoxIdentifier(inner, new Set(), 0)) { + return this.getIden(identation) + `Boolean.TRUE.equals(${this.printNode(inner, 0)})`; + } + return printed; + }; + const printInstanceOfExpression = proto.printInstanceOfExpression; + proto.printInstanceOfExpression = function (node, identation) { + if (node.right?.kind === SyntaxKind.Identifier && this.hx4J09CcxtErrorClass(node.right) + && this.hx4J09CatchCannotWrap(node.left)) { + return this.getIden(identation) + `(${this.printNode(node.left, 0)} instanceof ${node.right.text})`; + } + return printInstanceOfExpression.call(this, node, identation); + }; + const javaConvertToCoreType = proto.javaConvertToCoreType; + proto.javaConvertToCoreType = function (type: string, printed: string, node) { + return this.hx4J09CoreArgument(type, printed, node) ?? javaConvertToCoreType.call(this, type, printed, node); + }; +} + +// hx4 J15: two declared numeric boxes compare by value, never by reference. Same-class integral +// boxes take Objects.equals (Helpers.isEqual's null table + toLong compare); a Double on either side +// compares doubleValue() (isEqual's toDouble: 0.0 == -0.0, NaN != NaN), other integral pairs longValue(). +{ + const proto: any = JavaTranspiler.prototype; + const printNativeEquality = proto.printNativeEqualityIfProvable; + proto.printNativeEqualityIfProvable = function (node, leftText: string, rightText: string): string | undefined { + const op = node?.operatorToken?.kind; + const negated = op === SyntaxKind.ExclamationEqualsToken || op === SyntaxKind.ExclamationEqualsEqualsToken; + if (negated || op === SyntaxKind.EqualsEqualsToken || op === SyntaxKind.EqualsEqualsEqualsToken) { + const left = this.javaDeclaredNumericFamily(node.left); + const right = this.javaDeclaredNumericFamily(node.right); + // a declared Boolean: isEqual answers false across classes and by value within Boolean + const isBool = (n) => String(this.javaDeclaredTypeOf(n) ?? '').trim() === 'Boolean'; + if (isBool(node.left) || isBool(node.right)) { + return `${negated ? '!' : ''}java.util.Objects.equals(${leftText}, ${rightText})`; + } + if (JAVA_BOXED_NUMERIC_TYPES.has(left) && JAVA_BOXED_NUMERIC_TYPES.has(right)) { + let equal: string; + if (left === right && left !== 'Double') { + equal = `java.util.Objects.equals(${leftText}, ${rightText})`; + } else { + const unbox = (left === 'Double' || right === 'Double') ? 'doubleValue' : 'longValue'; + equal = `(${leftText} == null ? ${rightText} == null : (${rightText} != null && ${leftText}.${unbox}() == ${rightText}.${unbox}()))`; + } + return negated ? `!${equal}` : equal; + } + } + return printNativeEquality.call(this, node, leftText, rightText); + }; +} + +// hx4 J16: an awaited implicit-API call (declared in ts/src/abstract/.ts, body `this.request(..)`) +// hands back a fresh Jackson parse of the HTTP body: never a field map or a ws client map, whatever +// its arguments read, so J01's non-shared proof admits it as a put source. +const JAVA_J16_IMPLICIT_API_FILE = /(^|[\\/])ts[\\/]src[\\/]abstract[\\/][a-z0-9_]+\.ts$/; +{ + const proto: any = JavaTranspiler.prototype; + const nonSharedValue = proto.javaHx4NonSharedValue; + proto.javaHx4NonSharedValue = function (value, depth: number): boolean { + return this.javaJ16ImplicitApiResponse(value) || nonSharedValue.call(this, value, depth); + }; + proto.javaJ16ImplicitApiResponse = function (value): boolean { + let node = this.unwrapPrintTransparentExpression(value); + if (node?.kind !== SyntaxKind.AwaitExpression) { + return false; + } + node = this.unwrapPrintTransparentExpression(node.expression); + if (node === undefined || !isCallExpression(node) || !isPropertyAccessExpression(node.expression) + || node.expression.expression.kind !== SyntaxKind.ThisKeyword) { + return false; + } + let declaration: any; + try { + declaration = this.checkerOrUndefined()?.getResolvedSignature(node)?.declaration?.resolve(); + } catch (e) { + return false; + } + const fileName = declaration?.getSourceFile?.()?.fileName; + if (typeof fileName !== 'string' || !JAVA_J16_IMPLICIT_API_FILE.test(fileName) || !declaration.body) { + return false; + } + const statements = declaration.body.statements ?? []; + const ret = statements.length === 1 && isReturnStatement(statements[0]) ? statements[0].expression : undefined; + return ret !== undefined && isCallExpression(ret) && isPropertyAccessExpression(ret.expression) + && ret.expression.expression.kind === SyntaxKind.ThisKeyword && ret.expression.name.text === 'request'; + }; } diff --git a/src/rustTranspiler.ts b/src/rustTranspiler.ts index 1ee428e4..22e9b6e5 100644 --- a/src/rustTranspiler.ts +++ b/src/rustTranspiler.ts @@ -1,5 +1,5 @@ import { BaseTranspiler } from "./baseTranspiler.js"; -import { SyntaxKind, type Block, type CallExpression, type Declaration, type Expression, type Identifier, type Node, type NodeArray, type ParameterDeclaration, type SourceFile, type VariableDeclaration } from "typescript/unstable/ast"; +import { NodeFlags, SyntaxKind, type Block, type CallExpression, type Declaration, type Expression, type Identifier, type Node, type NodeArray, type ParameterDeclaration, type SourceFile, type VariableDeclaration } from "typescript/unstable/ast"; import { isArrayLiteralExpression, isArrowFunction, isAsExpression, isBinaryExpression, isBindingElement, isBlock, isCallExpression, isClassDeclaration, isClassExpression, isConditionalExpression, isDeleteExpression, isElementAccessExpression, isForInStatement, isForOfStatement, isIdentifier, isMethodDeclaration, isNoSubstitutionTemplateLiteral, isNonNullExpression, isNumericLiteral, isObjectLiteralExpression, isParameterDeclaration, isParenthesizedExpression, isPrefixUnaryExpression, isPropertyAccessExpression, isReturnStatement, isShorthandPropertyAssignment, isSourceFile, isStatement, isStringLiteral, isStringLiteralLikeNode, isTypeAssertion, isVariableDeclaration } from "typescript/unstable/ast/is"; import { IndexKind, ObjectFlags, SignatureKind, SymbolFlags, TypeFlags, type Symbol as TsSymbol, type Type } from "typescript/unstable/sync"; import { findAncestor, getAllSuperTypeNodes, isFunctionLike, signatureDeclaration, symbolDeclarations, symbolValueDeclaration, typeParts, typeTarget } from "./tsUtils.js"; @@ -694,6 +694,10 @@ export class RustTranspiler extends BaseTranspiler { // Native `==`/`!=` on the unwrapped payload when the checker proves the // Value variants line up; undefined keeps the is_equal() helper. printNativeEqualityComparison(left, right, op): string { + const r09 = this.rustR09LengthEquality(left, right, op); if (r09 !== undefined) return r09; + const r12 = this.rustR12NativeBoolEquality(left, right, op); if (r12 !== undefined) return r12; + const r13 = this.printRustR13ProvenStrEquality(left, right, op); if (r13 !== undefined) return r13; + const r20 = this.r20BoolCallEquality(left, right, op); if (r20 !== undefined) return r20; const operator = (op === SyntaxKind.EqualsEqualsToken || op === SyntaxKind.EqualsEqualsEqualsToken) ? '==' : '!='; const leftLiteral = this.literalKindOfNode(left); const rightLiteral = this.literalKindOfNode(right); @@ -769,7 +773,8 @@ export class RustTranspiler extends BaseTranspiler { printArrayLength(node, identation, leftExpr = undefined) { const receiver = leftExpr ?? this.printNode(node.expression, 0); if (!this.rustIsOrderBookSide(node.expression) && this.isValueLengthType(this.typeOfNodeIfAny(node.expression))) return `Value::Int(${receiver}.len() as i64)`; - return `get_array_length(&${receiver})`; + if (this.r11ProvenListValue(node.expression)) return `${receiver}.as_array().map_or(Value::Int(0), |__a| Value::Int(__a.len() as i64))`; + return this.r18ArrLength(node, receiver) ?? `get_array_length(&${receiver})`; } /** `orderbook['bids']` / `orderbook.asks` on an `OrderBook`-typed receiver, or a @@ -1467,8 +1472,8 @@ export class RustTranspiler extends BaseTranspiler { (ordered ? (leftKind !== undefined || rightKind !== undefined) : (leftKind === 'number' && rightKind === 'number')); - if (!proven) { - return undefined; + if (!proven && !this.rustR16OrderedProven(op, left, right)) { + return this.r22StrOrderedComparison(node, op, left, right) ?? this.r25NativeLooseOrderedComparison(node, op, left, right); } return this.printNativeNumericComparison(node, operator, this.printNode(left, 0), this.printNode(right, 0)); } @@ -1530,6 +1535,7 @@ export class RustTranspiler extends BaseTranspiler { } printNativeArithmetic(op, left, right, leftText, rightText): string | undefined { + if (op === SyntaxKind.PercentToken) return this.printRustNativeMod(left, right, leftText, rightText) ?? this.rustR16NativeArithmetic(op, left, right, leftText, rightText); if (op !== SyntaxKind.PlusToken && op !== SyntaxKind.MinusToken && op !== SyntaxKind.AsteriskToken && op !== SyntaxKind.SlashToken) { return undefined; @@ -1542,11 +1548,15 @@ export class RustTranspiler extends BaseTranspiler { } catch (e) { return undefined; } - if (op === SyntaxKind.PlusToken && this.isNativeStringConcatPair(leftType, rightType)) { + const r09 = this.rustR09NativeAddSubtract(op, left, right, leftType, rightType, leftText, rightText); if (r09 !== undefined) return r09; + const r16 = this.rustR16NativeArithmetic(op, left, right, leftText, rightText); if (r16 !== undefined) return r16; + const r20 = this.r20NativeNumericAdd(op, left, right, leftText, rightText); if (r20 !== undefined) return r20; + if (op === SyntaxKind.PlusToken && (this.isNativeStringConcatPair(leftType, rightType) || this.r17ConcatIsAnchored(left, right, leftType, rightType) + || this.r22ConcatIsAnchored(left, right, leftType, rightType))) { return this.printNativeStringConcat(leftText, rightText); } if (!this.isNumberLikeType(leftType) || !this.isNumberLikeType(rightType)) { - return undefined; + return this.r25NativeCoercingArithmetic(op, left, right, leftText, rightText); } return this.printNativeNumeric(op, leftText, rightText); } @@ -1602,7 +1612,7 @@ export class RustTranspiler extends BaseTranspiler { const keyStrs = keys.map(k => this.printNode(k, 0)); for (const key of keyStrs.slice(0, -1)) acc = `get_value_mut(${acc}, &${key})`; const rhs = this.printNode(right, 0); - const nativeInsert = keyStrs.length === 1 ? this.printNativeDictInsert(baseExpr, keys[0], keyStrs[0], rhs) : undefined; + const nativeInsert = keyStrs.length === 1 ? (this.printNativeDictInsert(baseExpr, keys[0], keyStrs[0], rhs) ?? this.rustR01NativeDictInsert(baseExpr, keys[0], keyStrs[0], rhs)) : undefined; return nativeInsert ?? `add_element_to_object(${acc}, &${keyStrs[keyStrs.length - 1]}, ${rhs})`; } // typeof comparisons @@ -1623,7 +1633,7 @@ export class RustTranspiler extends BaseTranspiler { if (op === SyntaxKind.InKeyword) { const shadow = this.rustParamShadowOf(right); return (shadow !== undefined ? this.printShadowInOperator(shadow, left) : undefined) - ?? this.printNativeInOperator(left, right) + ?? this.printNativeInOperator(left, right) ?? this.r18LiteralInOp(left, right) ?? this.r05InOp(left, right) ?? `Value::Bool(in_op(&${this.printNode(right, 0)}, &${this.printNode(left, 0)}))`; } // `+=` / `-=` on regular variables @@ -1671,7 +1681,7 @@ export class RustTranspiler extends BaseTranspiler { // `str.padStart(len, pad)` / `str.padEnd(len, pad)` → runtime helpers `(&Value, &Value, &Value)`. printPadStartCall(node, identation, name, parsedArg, parsedArg2) { - return `pad_start(${this.ensureRef(name)}, ${this.ensureRef(parsedArg)}, ${this.ensureRef(parsedArg2)})`; + return this.printNativeStringPadStart(node, name) ?? `pad_start(${this.ensureRef(name)}, ${this.ensureRef(parsedArg)}, ${this.ensureRef(parsedArg2)})`; } printPadEndCall(node, identation, name, parsedArg, parsedArg2) { @@ -1698,6 +1708,7 @@ export class RustTranspiler extends BaseTranspiler { if (declaration.initializer.kind === SyntaxKind.NewExpression) { return `${indent}let mut ${varName} = ${parsedValue}`; } + if (node.declarations.length === 1 && this.rustVecLocalIsTyped(declaration)) return `${indent}let mut ${varName}: Vec = Vec::new()`; const boolValue = this.getRustBoolLocalInitializer(declaration, parsedValue); if (boolValue !== undefined) { return `${indent}let mut ${varName}: bool = ${boolValue}`; @@ -3048,11 +3059,12 @@ export class RustTranspiler extends BaseTranspiler { if (!this.isProvenListExpression(receiverNode)) return undefined; return this.printNativeListIndex(receiverText, index); } - const dictRead = this.printNativeDynamicMapAccess(receiverText, receiverNode, keyNode); + const dictRead = this.printNativeDynamicMapAccess(receiverText, receiverNode, keyNode) ?? this.printNativeThisFieldDynamicMapAccess(receiverText, receiverNode, keyNode) + ?? this.rustR10DynamicRead(receiverText, receiverNode, keyNode); if (dictRead !== undefined) return dictRead; // A non-literal index (the `for (let i = 0; …)` counter) into a // checker-proven list reads natively too. - return this.printNativeDynamicListIndex(receiverText, receiverNode, keyNode); + return this.printNativeDynamicListIndex(receiverText, receiverNode, keyNode) ?? this.r14ListArithIndex(receiverText, receiverNode, keyNode); } /** `get_value(&X, &i)` for a checker-proven list `X` and a dynamic integer @@ -3689,7 +3701,7 @@ export class RustTranspiler extends BaseTranspiler { } printNativeMapAccess(receiverText: string, receiverNode: Node, keyText: string): string | undefined { - if (!this.isProvenMapExpression(receiverNode)) { + if (!this.isProvenMapExpression(receiverNode) && !this.rustR10LiteralReadOk(receiverNode, keyText)) { // Declared-Dict locals read natively too (see the classifier below). if (!this.rustIsDeclaredDictLocal(receiverNode)) return undefined; if (RustTranspiler.RUST_DICT_LOCAL_UNSAFE_KEYS.has(keyText)) return undefined; @@ -3879,7 +3891,7 @@ export class RustTranspiler extends BaseTranspiler { isNativeAccessPositionSafe(node: Node): boolean { const parent = node.parent; // `x['k'].push(...)` / `x['k'](...)`: the post-pass rewrites the target. - if (parent && (isPropertyAccessExpression(parent) || isCallExpression(parent)) && parent.expression === node) return false; + if (parent && (isPropertyAccessExpression(parent) || isCallExpression(parent)) && parent.expression === node && !this.r21PureStringMethodReceiver(node)) return false; const root = this.rootPlaceText(node); for (let current: any = node.parent; current; current = current.parent) { if (isStatement(current) || isSourceFile(current) || isFunctionLike(current)) break; @@ -4054,6 +4066,7 @@ export class RustTranspiler extends BaseTranspiler { // Checker-proved boolean Value (safe_bool / get_value): native matches!. const nativeTruthiness = this.printNativeTruthiness(node); if (nativeTruthiness !== undefined) return idn + nativeTruthiness; + const r12Truthiness = this.rustR12NativeTruthiness(node); if (r12Truthiness !== undefined) return idn + r12Truthiness; // B-26: an operand whose printer emission is already a Rust `bool`. const nativeCondition = this.printNativeParenthesizedCondition(node); if (nativeCondition !== undefined && this.rustConditionBoolSlot(node)) return idn + nativeCondition; @@ -4208,7 +4221,7 @@ export class RustTranspiler extends BaseTranspiler { if (operator === SyntaxKind.ExclamationToken) return idn + '!' + this.printCondition(operand, 0); if (operator !== SyntaxKind.MinusToken) return idn + this.PrefixFixOperators[operator] + this.printNode(operand, 0); const operandText = this.printNode(operand, 0); - return idn + (this.foldNegateLiteral(operandText) ?? `negate(&${operandText})`); + return idn + (this.foldNegateLiteral(operandText) ?? this.printRustNativeNegate(operand, operandText) ?? `negate(&${operandText})`); } printObjectLiteralExpression(node, identation) { @@ -4234,7 +4247,7 @@ export class RustTranspiler extends BaseTranspiler { } printDeleteExpression(node, identation) { - return `remove(&mut ${this.printNode(node.expression.expression, 0)}, &${this.printNode(node.expression.argumentExpression, 0)})`; + return this.r05Delete(node) ?? `remove(&mut ${this.printNode(node.expression.expression, 0)}, &${this.printNode(node.expression.argumentExpression, 0)})`; } printInstanceOfExpression(node, identation) { @@ -4292,11 +4305,11 @@ export class RustTranspiler extends BaseTranspiler { } printObjectKeysCall(node, identation, parsedArg = undefined) { - return `object_keys(&${parsedArg})`; + return this.r05Enum(node, parsedArg, 'keys') ?? this.r18PredictionEnum(node, parsedArg, 'keys') ?? this.r21BaseEnum(node, parsedArg, 'keys') ?? `object_keys(&${parsedArg})`; } printObjectValuesCall(node, identation, parsedArg = undefined) { - return `object_values(&${parsedArg})`; + return this.r05Enum(node, parsedArg, 'values') ?? this.r18PredictionEnum(node, parsedArg, 'values') ?? this.r21BaseEnum(node, parsedArg, 'values') ?? `object_values(&${parsedArg})`; } printJsonParseCall(node, identation, parsedArg = undefined) { @@ -4308,7 +4321,7 @@ export class RustTranspiler extends BaseTranspiler { } printMathFloorCall(node, identation, parsedArg = undefined) { - return `math_floor(&${parsedArg})`; + return this.printRustNativeMathCall(node, 'floor', parsedArg) ?? `math_floor(&${parsedArg})`; } // No `.await` here: `printAwaitExpression` appends it for `await Promise.all(...)`. @@ -4322,11 +4335,11 @@ export class RustTranspiler extends BaseTranspiler { } printMathRoundCall(node, identation, parsedArg = undefined) { - return `math_round(&${parsedArg})`; + return this.printRustNativeMathCall(node, 'round', parsedArg) ?? `math_round(&${parsedArg})`; } printMathCeilCall(node, identation, parsedArg = undefined) { - return `math_ceil(&${parsedArg})`; + return this.printRustNativeMathCall(node, 'ceil', parsedArg) ?? `math_ceil(&${parsedArg})`; } printNumberIsIntegerCall(node, identation, parsedArg = undefined) { @@ -4334,7 +4347,7 @@ export class RustTranspiler extends BaseTranspiler { } printArrayPushCall(node, identation, name = undefined, parsedArg = undefined) { - return `append_to_array(&mut ${name}, ${parsedArg})`; + return this.printRustVecPush(node, name, parsedArg) ?? this.r18ArrPush(node, name, parsedArg) ?? `append_to_array(&mut ${name}, ${parsedArg})`; } printIncludesCall(node, identation, name = undefined, parsedArg = undefined) { @@ -4342,27 +4355,31 @@ export class RustTranspiler extends BaseTranspiler { } printIndexOfCall(node, identation, name = undefined, parsedArg = undefined) { - return this.printNativeStringIndexOf(node, name) ?? `get_index_of(&${name}, &${parsedArg})`; + return this.printNativeStringIndexOf(node, name) ?? this.printNativeStringIndexOfString(node, name) ?? this.r30IndexOf(name, parsedArg); } printStartsWithCall(node, identation, name = undefined, parsedArg = undefined) { + const native = this.printNativeStringAffixTest(node, name, 'starts_with') ?? this.r17PrintAffixTest(node, name, 'starts_with'); + if (native !== undefined) return `Value::Bool(${native})`; return `Value::Bool(starts_with(&${name}, &${parsedArg}))`; } printEndsWithCall(node, identation, name = undefined, parsedArg = undefined) { + const native = this.printNativeStringAffixTest(node, name, 'ends_with') ?? this.r17PrintAffixTest(node, name, 'ends_with'); + if (native !== undefined) return `Value::Bool(${native})`; return `Value::Bool(ends_with(&${name}, &${parsedArg}))`; } printTrimCall(node, identation, name = undefined) { - return `trim(&${name})`; + return this.r17PrintTrim(node, name) ?? `trim(&${name})`; } printJoinCall(node, identation, name = undefined, parsedArg = undefined) { - return `join(&${name}, &${parsedArg})`; + return this.r15PrintVecJoin(node) ?? this.printNativeStringJoin(node, name) ?? `join(&${name}, &${parsedArg})`; } printSplitCall(node, identation, name = undefined, parsedArg = undefined) { - return `split(&${name}, &${parsedArg})`; + return this.printNativeStringSplit(node, name) ?? this.printRustR13Split(node, name) ?? `split(&${name}, &${parsedArg})`; } printConcatCall(node, identation, name = undefined, parsedArg = undefined) { @@ -4374,15 +4391,15 @@ export class RustTranspiler extends BaseTranspiler { } printToStringCall(node, identation, name = undefined) { - return `to_string_val(&${name})`; + return this.printRustNativeToString(node, name) ?? this.printRustR13ToString(node, name) ?? `to_string_val(&${name})`; } printToUpperCaseCall(node, identation, name = undefined) { - return `to_upper(&${name})`; + return this.printNativeStringCase(node, name, 'to_uppercase') ?? this.printRustR13Case(node, name, 'to_uppercase') ?? this.r30Case(name, 'to_uppercase'); } printToLowerCaseCall(node, identation, name = undefined) { - return `to_lower(&${name})`; + return this.printNativeStringCase(node, name, 'to_lowercase') ?? this.printRustR13Case(node, name, 'to_lowercase') ?? this.r30Case(name, 'to_lowercase'); } printShiftCall(node, identation, name = undefined) { @@ -4398,15 +4415,15 @@ export class RustTranspiler extends BaseTranspiler { } printSliceCall(node, identation, name = undefined, parsedArg = undefined, parsedArg2 = undefined) { - return this.printNativeStringSlice(node, name) ?? `slice(&${name}, &${parsedArg}, &${parsedArg2 ?? 'Value::Null'})`; + return this.printNativeStringSlice(node, name) ?? this.r30Slice(name, parsedArg, parsedArg2 ?? 'Value::Null'); } printReplaceCall(node, identation, name = undefined, parsedArg = undefined, parsedArg2 = undefined) { - return `replace_str(&${name}, &${parsedArg}, &${parsedArg2})`; + return this.printNativeStringReplace(node, name) ?? this.printRustR13Replace(node, name) ?? this.r17PrintReplace(node, name) ?? `replace_str(&${name}, &${parsedArg}, &${parsedArg2})`; } printReplaceAllCall(node, identation, name = undefined, parsedArg = undefined, parsedArg2 = undefined) { - return `replace_all_str(&${name}, &${parsedArg}, &${parsedArg2})`; + return this.printNativeStringReplace(node, name) ?? this.printRustR13Replace(node, name) ?? this.r17PrintReplace(node, name) ?? `replace_all_str(&${name}, &${parsedArg}, &${parsedArg2})`; } // `{}` (Display) renders an ExchangeError as `[Kind] message`; `{:?}` would dump the struct fields. @@ -4454,4 +4471,2117 @@ export class RustTranspiler extends BaseTranspiler { printSpreadElement(node, identation) { return `${this.getIden(identation)}${this.printNode(node.expression, 0)}`; } + + // hx4 R01 — native element write on a local the plain-dict proof admits + // through its write history: `const x = this.account ()`, a `let x = {}` / + // `let x: Dict = undefined` later reassigned, `[ x, p ] = this.handleUntilOption (…)`. + + /** Base-tier methods whose every return is a fresh tag-free object + * literal (no venue override, no hand-written stub replaces them). */ + private static readonly RUST_R01_PLAIN_DICT_BUILDERS = new Set([ 'account', 'safeLedgerEntry', 'depositWithdrawFee' ]); + + /** Base-tier `[Dict, Dict]` tuple helpers that hand back their `request` argument (index 1). */ + private static readonly RUST_R01_REQUEST_TUPLE_HELPERS = new Set([ 'handleUntilOption' ]); + + rustR01NativeDictInsert(baseExpr, keyNode, keyText: string, valueText: string): string | undefined { + if (!isIdentifier(baseExpr) || !this.rustR01LocalStaysPlain(baseExpr)) { + return undefined; + } + // Every write is a fresh literal / builder: the receiver is untagged and + // a book-meta key needs no `__book_id` guard (`plain: true`). + const receiver = { text: String(baseExpr.text), isField: false, plain: true, nameNode: baseExpr }; + const keyArg = this.rustNativeInsertKeyArg(receiver, keyNode, keyText); + if (keyArg === undefined) { + return undefined; + } + const name = receiver.text; + const value = this.rustPrintedBoolArg(valueText) ? `Value::Bool(${valueText})` : valueText.trim(); + const insert = (val: string) => + `if let Value::Dict(__d) = &mut ${name} { std::sync::Arc::make_mut(__d).insert(${keyArg}, ${val}); }`; + // same operand handling as printNativeDictInsert: hoist a read of the receiver, clone a bare place + if (new RegExp(`\\b${name}\\b`).test(value)) { + return `{ let __be_tmp = ${value}; ${insert('__be_tmp')} }`; + } + if (/^[a-zA-Z_][a-zA-Z0-9_]*$/.test(value) && value !== 'self' && value !== 'true' && value !== 'false') { + return insert(`${value}.clone()`); + } + return insert(value); + } + + /** A local (single binding in its function, no closure capture of a write) + * whose declaration and every write is a plain-dict source or nullish. A + * nullish value leaves a non-Dict, which `if let Value::Dict` no-ops on + * exactly like the helper's `_ => {}` arm. */ + rustR01LocalStaysPlain(ident: Identifier, depth = 0): boolean { + const checker: any = this.checkerOrUndefined(); + const declarations: any[] = checker === undefined ? [] : symbolDeclarations(checker.getSymbolAtLocation(ident)); + const declaration: any = declarations.length === 1 ? declarations[0] : undefined; + if (declaration === undefined || depth > 4) { + return false; + } + if (declaration.kind === SyntaxKind.BindingElement) { + return this.rustR01TupleBindingStaysPlain(ident, declaration, depth); + } + if (!isVariableDeclaration(declaration) || declaration.name?.kind !== SyntaxKind.Identifier) { + return false; + } + const scope = this.rustEnclosingFunction(declaration); + if (scope === undefined || isSourceFile(scope) || this.rustEnclosingFunction(ident) !== scope) { + return false; + } + const name = String(ident.text); + const symbol = this.rustSymbolOf(declaration.name as Identifier); + if (symbol === undefined) { + return false; + } + if (declaration.initializer !== undefined && !this.rustR01PlainSource(declaration.initializer, name)) { + return false; + } + let plain = true; + for (const node of this.rustScopeNameNodes(scope, name) as any[]) { + if (node === declaration) continue; + if (this.rustBindsName(node, name)) { + // a sibling block's own `const x` is another binding; only an unresolved one rejects + if (this.rustSymbolOf(node.name) === undefined) { plain = false; break; } + continue; + } + if (node.kind !== SyntaxKind.Identifier || node === declaration.name || this.rustSymbolOf(node) !== symbol) continue; + if (this.rustEnclosingFunction(node) !== scope) { plain = false; break; } // captured by a callback + if (!this.rustR01UseKeepsPlain(node, name)) { plain = false; break; } + } + return plain; + } + + /** `const [ x, p ] = this.handleUntilOption (k, r, …)` with `r` itself a + * plain local: element 0 is `r` handed back, and `x` is never re-written. */ + private rustR01TupleBindingStaysPlain(ident: Identifier, element: any, depth: number): boolean { + const pattern: any = element.parent; + const declaration: any = pattern?.parent; + if (pattern?.kind !== SyntaxKind.ArrayBindingPattern || declaration === undefined || !isVariableDeclaration(declaration) + || ![0, 1].includes(pattern.elements.indexOf(element)) || element.name?.kind !== SyntaxKind.Identifier + || element.initializer !== undefined || element.dotDotDotToken !== undefined) { + return false; + } + if (pattern.elements.indexOf(element) === 1 ? !this.r26ParamsSlot(declaration.initializer, undefined, depth) : !this.rustR01TupleHeadIsPlain(declaration.initializer, undefined, depth)) { + return false; + } + const scope = this.rustEnclosingFunction(declaration); + const name = String(ident.text); + const symbol = this.rustSymbolOf(element.name); + if (scope === undefined || symbol === undefined || this.rustEnclosingFunction(ident) !== scope) { + return false; + } + for (const node of this.rustScopeNameNodes(scope, name) as any[]) { + if (node.kind !== SyntaxKind.Identifier || node === element.name || this.rustSymbolOf(node) !== symbol) continue; + if (this.rustEnclosingFunction(node) !== scope || !this.rustR01UseKeepsPlain(node, name)) return false; + } + return true; + } + + /** The shipped construction proof (literal-built local / handler tuple), read-only. */ + private rustR01ShippedPlain(ident: Identifier): boolean { + const declaration = this.rustSingleLocalDeclaration(ident); + return declaration !== undefined && isVariableDeclaration(declaration as any) + && this.rustInsertReceiverBuildsPlainDict(declaration as VariableDeclaration); + } + + /** A use of the local: reads and element writes keep the box; a direct + * assignment must store a plain source; any other write shape rejects. */ + private rustR01UseKeepsPlain(node: Node, name: string): boolean { + let target: any = node; + while (target.parent !== undefined && (isParenthesizedExpression(target.parent) || isNonNullExpression(target.parent) || isAsExpression(target.parent))) { + target = target.parent; + } + const parent: any = target.parent; + if (parent === undefined) return true; + if (isBinaryExpression(parent) && parent.left === target && rustIsAssignmentOperator(parent.operatorToken.kind)) { + return parent.operatorToken.kind === SyntaxKind.EqualsToken && this.rustR01PlainSource(parent.right, name); + } + if (parent.kind === SyntaxKind.ArrayLiteralExpression) { + const assign: any = parent.parent; + if (assign !== undefined && isBinaryExpression(assign) && assign.left === parent) { + return this.rustR01RequestTupleWrite(assign.right, parent.elements.indexOf(target), name); + } + } + // a field of a `let`-bound literal aliasing the local feeds ccxt's + // writeBackAliasedArrayMutations, which keys on the helper text + if ((parent.kind === SyntaxKind.PropertyAssignment || parent.kind === SyntaxKind.ShorthandPropertyAssignment) + && !(parent.kind === SyntaxKind.PropertyAssignment && parent.initializer !== target)) { + let literal: any = parent.parent; + while (literal?.parent !== undefined && (isParenthesizedExpression(literal.parent) || isAsExpression(literal.parent))) literal = literal.parent; + if (literal?.parent === undefined || isVariableDeclaration(literal.parent)) return false; + } + if (parent.kind === SyntaxKind.PrefixUnaryExpression || parent.kind === SyntaxKind.PostfixUnaryExpression + || parent.kind === SyntaxKind.DeleteExpression + || ((isForOfStatement(parent) || isForInStatement(parent)) && parent.initializer === target)) { + return false; + } + return true; + } + + /** `[ x, … ] = this.handleUntilOption (k, x, …)` — element 0 is the request + * argument handed back (base-tier implementation, no override). */ + private rustR01RequestTupleWrite(rhs: Node, index: number, name: string): boolean { + return index === 1 ? this.r26ParamsSlot(rhs, name, 0) : (index === 0 && this.rustR01TupleHeadIsPlain(rhs, name, 0)); + } + + /** Element 0 of `this.m (…)` is a plain dict: `m` is the base-tier + * `handleUntilOption` (returns its `request` argument), or a method of the + * calling file (Rust calls it statically) whose every `return [ X, … ]` + * has X a plain literal / plain local, or a parameter whose argument here is. */ + private rustR01TupleHeadIsPlain(rhs: Node, selfName: string | undefined, depth: number): boolean { + const call: any = this.rustStripWrappers(rhs); + if (depth > 4 || call === undefined || !isCallExpression(call) || !isPropertyAccessExpression(call.expression) + || call.expression.expression.kind !== SyntaxKind.ThisKeyword) { + return false; + } + const argPlain = (index: number): boolean => { + const arg: any = this.rustStripWrappers(call.arguments[index]); + return arg !== undefined && (this.rustPlainDictLiteral(arg) || (isIdentifier(arg) + && (String(arg.text) === selfName || this.rustR01LocalStaysPlain(arg, depth + 1) || this.rustR01ShippedPlain(arg)))); + }; + if (RustTranspiler.RUST_R01_REQUEST_TUPLE_HELPERS.has(String(call.expression.name.text))) { + return this.rustR01CalleeIsBase(call) && argPlain(1); + } + let declaration: any; + try { + declaration = signatureDeclaration((this.getChecker() as any).getResolvedSignature(call)); + } catch (e) { + return false; + } + if (declaration?.kind !== SyntaxKind.MethodDeclaration || declaration.body === undefined + || declaration.getSourceFile() !== call.getSourceFile()) { + return false; + } + let plain = true; + let returns = 0; + this.rustWalkScope(declaration.body, (n) => { + if (isArrowFunction(n) || n.kind === SyntaxKind.FunctionExpression) return RUST_WALK_SKIP; + if (!isReturnStatement(n)) return; + returns++; + const tuple: any = this.rustStripWrappers(n.expression); + const head: any = tuple?.kind === SyntaxKind.ArrayLiteralExpression ? this.rustStripWrappers(tuple.elements[0]) : undefined; + const param = head !== undefined && isIdentifier(head) ? declaration.parameters.findIndex((p) => p.name?.kind === SyntaxKind.Identifier && String(p.name.text) === String(head.text)) : -1; + const ok = head !== undefined && (this.rustPlainDictLiteral(head) + || (param >= 0 ? (this.rustSymbolOf(head) === this.rustSymbolOf(declaration.parameters[param].name) && argPlain(param) + && this.rustR01ParamUnassigned(declaration, String(head.text))) + : (isIdentifier(head) && this.rustR01LocalStaysPlain(head, depth + 1)))); + if (!ok) { plain = false; return RUST_WALK_STOP; } + }); + return plain && returns > 0; + } + + /** A pass-through parameter: never assigned in the method body. */ + private rustR01ParamUnassigned(method: any, name: string): boolean { + let kept = true; + this.rustWalkScope(method.body, (n) => { + if (isBinaryExpression(n) && rustIsAssignmentOperator(n.operatorToken.kind) && isIdentifier(n.left) && String(n.left.text) === name) { + kept = false; + return RUST_WALK_STOP; + } + }); + return kept; + } + + /** A value that is a fresh plain dict, nullish, or the local itself. */ + rustR01PlainSource(node: Node, name: string): boolean { + const stripped: any = this.rustStripWrappers(node); + if (stripped === undefined) return false; + if (this.rustPlainDictLiteral(stripped) || this.rustTypeIsUndefinedish(stripped) + || (isIdentifier(stripped) && String(stripped.text) === name)) { + return true; + } + if (isConditionalExpression(stripped)) { + return this.rustR01PlainSource(stripped.whenTrue, name) && this.rustR01PlainSource(stripped.whenFalse, name); + } + if (isCallExpression(stripped) && isPropertyAccessExpression(stripped.expression) + && stripped.expression.expression.kind === SyntaxKind.ThisKeyword + && RustTranspiler.RUST_R01_PLAIN_DICT_BUILDERS.has(String(stripped.expression.name.text))) { + return this.rustR01CalleeIsBase(stripped); + } + if (this.rustR12PlainSource(stripped)) return true; + // `x = this.omit|keysort (x, …)` copies x's own map; `this.extend (…)` builds a + // fresh map from its dict arguments — plain when each of them is. + if (isCallExpression(stripped) && isPropertyAccessExpression(stripped.expression) + && stripped.expression.expression.kind === SyntaxKind.ThisKeyword && stripped.arguments.length > 0 + && this.rustR01CalleeIsBase(stripped)) { + const callee = String(stripped.expression.name.text); + const first: any = this.rustStripWrappers(stripped.arguments[0]); + if (callee === 'omit' || callee === 'keysort') { + return first !== undefined && isIdentifier(first) && String(first.text) === name; + } + if (callee === 'extend') { + return stripped.arguments.every((a) => this.rustR01PlainSource(a, name)); + } + } + return false; + } + + /** The checker resolves the call to the base-tier implementation (a venue + * override could return anything). */ + private rustR01CalleeIsBase(call: Node): boolean { + let declaration: any; + try { + declaration = signatureDeclaration((this.getChecker() as any).getResolvedSignature(call)); + } catch (e) { + return false; + } + // a method body, or the base function behind an `omit = omit;` property + return declaration !== undefined && (declaration.body !== undefined || this.r14BaseOverload(declaration)) + && RustTranspiler.RUST_BASE_TIER_FILE.test(String(declaration.getSourceFile().fileName).replace(/\\/g, '/')); + } + + // hx4 R02 + // `this.[k]`: a class property whose declared type proves a plain dict is a + // container struct field (never a book/cache/side/client/live marker dict), so + // `get_value`'s marker routes cannot fire and the read is `m.get(k)`. + + /** The class property declaration behind `this.` when its annotation proves a plain dict. */ + rustProvenDictThisField(node: Node): Declaration | undefined { + if (!isPropertyAccessExpression(node) || node.expression.kind !== SyntaxKind.ThisKeyword) return undefined; + let declaration: any; + try { + declaration = symbolValueDeclaration(this.getChecker().getSymbolAtLocation(node.name)); + } catch (e) { + return undefined; + } + if (declaration === undefined || declaration.kind !== SyntaxKind.PropertyDeclaration || declaration.type === undefined) return undefined; + const type = this.getCheckedTypeOf(declaration.type); + return type !== undefined && this.isProvenMapType(type) ? declaration : undefined; + } + + /** `this.[a]` whose declared field type's element type is itself a plain dict + * (`Dictionary>`). */ + rustProvenDictThisFieldElement(node: Node): boolean { + if (!isElementAccessExpression(node)) return false; + const field: any = this.rustProvenDictThisField(node.expression); + if (field === undefined) return false; + const fieldType = this.getCheckedTypeOf(field.type); + const parts: Type[] = (fieldType.flags & TypeFlags.Union) ? (typeParts(fieldType) ?? []).filter((p) => !this.rustTypeIsNullish(p)) : [fieldType]; + return parts.length === 1 && this.isProvenMapType(this.getChecker().getIndexTypeOfType(parts[0], IndexKind.String)); + } + + /** `this.[k]` with a proven-dict field and a proven string key place. */ + printNativeThisFieldDynamicMapAccess(receiverText: string, receiverNode: Node, keyNode: Node): string | undefined { + if (this.rustProvenDictThisField(receiverNode) === undefined && !this.rustProvenDictThisFieldElement(receiverNode)) return undefined; + if (!this.rustKeyIsProvenString(keyNode)) return undefined; + const keyText = this.printNode(keyNode, 0).trim(); + if (!/^[A-Za-z_][A-Za-z0-9_]*$/.test(keyText)) return undefined; + return `${receiverText}.as_map().and_then(|__m| ${keyText}.as_str().and_then(|__k| __m.get(__k))).cloned().unwrap_or(Value::Null)`; + } + + // hx4 R04 — `const x = []` locals declared `Vec` when every use is a statement + // `x.push(v)` (native push), `x.length`, `return x` or an argument inside a `return` + // (boxed once as `Value::from(x)`). Anything else keeps the `Value` box and `append_to_array`. + private rustVecLocalDecisions = new WeakMap(); + + rustVecLocalIsTyped(declaration): boolean { + if (declaration?.kind !== SyntaxKind.VariableDeclaration) return false; + let decision = this.rustVecLocalDecisions.get(declaration); + if (decision === undefined) { + this.rustVecLocalDecisions.set(declaration, false); // re-entrancy guard + decision = this.rustVecLocalIsTypedUncached(declaration); + this.rustVecLocalDecisions.set(declaration, decision); + } + return decision; + } + + rustVecLocalIsTypedUncached(declaration): boolean { + const init = declaration.initializer; + if (declaration.name?.kind !== SyntaxKind.Identifier || init === undefined + || !isArrayLiteralExpression(init) || init.elements.length !== 0) return false; + const checker: any = this.checkerOrUndefined(); + const type = checker?.getTypeAtLocation(declaration.name); + if (type === undefined || !checker.isArrayType(type)) return false; + const name = String(declaration.name.text); + const fn = this.rustEnclosingFunction(declaration); + if (fn === undefined || isSourceFile(fn)) return false; + // The tests pipeline's text post-passes key on the boxed `Value` local shape. + const source = declaration.getSourceFile?.()?.fileName; + if (typeof source === 'string' && /\/test\//.test(source)) return false; + let pushes = 0; + const safe = this.rustLocalUsesAll(declaration, name, false, (n) => { + const parent = n.parent; + if ((isPropertyAccessExpression(parent) && parent.name === n) + || (parent?.kind === SyntaxKind.PropertyAssignment && parent.name === n)) return true; + if (this.rustEnclosingFunction(n) !== fn) return false; + if (isPropertyAccessExpression(parent) && parent.expression === n) { + const member = String(parent.name.text); + if (member === 'length') { + const up = parent.parent; + return !(isBinaryExpression(up) && up.left === parent && rustIsAssignmentOperator(up.operatorToken.kind)) + && up?.kind !== SyntaxKind.PrefixUnaryExpression && up?.kind !== SyntaxKind.PostfixUnaryExpression; + } + if (member === 'push' && this.rustVecPushShape(parent.parent, name)) { + pushes++; + return true; + } + return this.r15VecJoinUse(parent); + } + return this.rustVecValueUse(n, name) || this.r11VecUse(n) || this.r15VecPropertyUse(n); + }); + return safe && pushes > 0; + } + + // `x.push(v);` as a whole statement, one non-spread argument not naming `x`. + rustVecPushShape(call, name: string): boolean { + if (!isCallExpression(call) || call.arguments.length !== 1 || call.parent?.kind !== SyntaxKind.ExpressionStatement) return false; + const arg = call.arguments[0]; + if (arg.kind === SyntaxKind.SpreadElement) return false; + let mentions = false; + const visit = (m) => { + if (mentions) return; + if (m.kind === SyntaxKind.Identifier && m.text === name) { mentions = true; return; } + m.forEachChild?.(visit); + }; + visit(arg); + return !mentions; + } + + // `return x` / `return f(.., x, ..)` with `x` named once in the statement: a boxing move. + // Elsewhere a boxing argument / object-literal value must be the local's last use outside any loop. + rustVecValueUse(n, name: string): boolean { + const parent = n.parent; + if (isReturnStatement(parent)) return true; + const isArg = isCallExpression(parent) && parent.arguments.some((a) => a === n) && this.rustVecBoxingCallee(parent.expression); + const isProp = parent?.kind === SyntaxKind.PropertyAssignment && parent.initializer === n; + if (!isArg && !isProp) return false; + let statement: any = parent; + while (statement !== undefined && !isStatement(statement)) statement = statement.parent; + if (statement === undefined) return false; + if (!isReturnStatement(statement) && !this.rustVecIsFinalUse(n, name)) return false; + let count = 0; + const visit = (m) => { + if (m.kind === SyntaxKind.Identifier && m.text === name) count++; + m.forEachChild?.(visit); + }; + visit(statement); + return count === 1; + } + + rustVecIsFinalUse(n, name: string): boolean { + const fn = this.rustEnclosingFunction(n); + for (let current: any = n.parent; current !== undefined && current !== fn; current = current.parent) { + switch (current.kind) { + case SyntaxKind.ForStatement: case SyntaxKind.ForInStatement: case SyntaxKind.ForOfStatement: + case SyntaxKind.WhileStatement: case SyntaxKind.DoStatement: + return false; + } + } + const end = n.getEnd?.() ?? n.end; + return !(this.rustScopeNameNodes(fn, name) as any[]).some((m) => m.kind === SyntaxKind.Identifier && m !== n + && (m.getStart?.() ?? m.pos) >= end && !this.rustIdentifierIsPropertyName(m)); + } + + // `this.m(..)` / `super.m(..)` / `Promise.all(..)`: every argument prints through printNode as a `Value`. + rustVecBoxingCallee(callee): boolean { + if (!isPropertyAccessExpression(callee)) return false; + const receiver: any = callee.expression; + if (receiver.kind === SyntaxKind.ThisKeyword || receiver.kind === SyntaxKind.SuperKeyword) return true; + return receiver.kind === SyntaxKind.Identifier && receiver.text === 'Promise' && String(callee.name.text) === 'all'; + } + + rustVecLocalDeclarationOf(node): any { + if (node?.kind !== SyntaxKind.Identifier) return undefined; + const checker: any = this.checkerOrUndefined(); + const symbol = checker?.getSymbolAtLocation(node); + const declaration = symbolValueDeclaration(symbol) ?? symbolDeclarations(symbol)[0]; + return declaration !== undefined && declaration.name !== node && this.rustVecLocalIsTyped(declaration) ? declaration : undefined; + } + + printRustVecPush(node, name: string | undefined, parsedArg: string | undefined): string | undefined { + const receiver = node?.expression?.expression; + if (name === undefined || parsedArg === undefined || this.rustVecLocalDeclarationOf(receiver) === undefined) return undefined; + const arg = parsedArg.trim(); + // `append_to_array` takes the value by move; ccxt's post-pass cloned a bare local there. + const value = /^[a-zA-Z_][a-zA-Z0-9_]*$/.test(arg) && arg !== 'self' && arg !== 'true' && arg !== 'false' ? `${arg}.clone()` : arg; + return `${name}.push(${value})`; + } + + transformIdentifier(node, identifier) { + const text = super.transformIdentifier(node, identifier); + const parent = node?.parent; + if (parent === undefined || !(isReturnStatement(parent) || (isCallExpression(parent) && parent.arguments.some((a) => a === node) + && this.rustVecBoxingCallee(parent.expression)) || (parent.kind === SyntaxKind.PropertyAssignment && parent.initializer === node))) return text; + if (this.rustVecLocalDeclarationOf(node) === undefined) return text; + return this.rustVecValueUse(node, String(node.text)) ? `Value::from(${text})` : `Value::from(${text}.clone())`; + } + + // hx4 R05 — native IndexMap ops for `k in X`, `delete X[k]`, `Object.keys/values(X)`. + + /** Source path of a node (forward slashes). */ + r05Path(node: Node): string { + const src: any = (node as any)?.getSourceFile?.(); + return typeof src?.fileName === 'string' ? src.fileName.replace(/\\/g, '/') : ''; + } + + /** Test sources keep the helpers: tests-pipeline post-passes match `in_op(` text. */ + r05IsTest(node: Node): boolean { + return /\/test\//.test(this.r05Path(node)); + } + + /** `k in X` with a non-literal key on a dict-shaped receiver: `in_op`'s Dict arm. + * The Arr arm is the only other `true` path; the dict proof excludes it. */ + r05InOp(key, obj): string | undefined { + const recv: any = this.rustStripWrappers(obj); + if (this.r05IsTest(obj) || !this.isShallowValueReceiver(recv) || this.rustParamShadowOf(recv) !== undefined + || (isPropertyAccessExpression(recv) && RustTranspiler.RUST_TAGGED_CONTAINER_FIELDS.has(String(recv.name.text))) + || !this.isDictShapedType(this.typeOfNodeIfAny(obj))) { + return undefined; + } + const objExpr = this.printNode(obj, 0).trim(); + const keyExpr = this.printNode(key, 0).trim(); + if (!/^[A-Za-z_][A-Za-z0-9_]*$/.test(keyExpr) || keyExpr === 'self') { + return undefined; // the key is borrowed beside the receiver: plain locals only + } + return `Value::Bool(matches!((&${objExpr}, &${keyExpr}), (Value::Dict(__d), Value::Str(__k)) if __d.contains_key(__k.as_ref())))`; + } + + /** `delete X[k]` on a receiver the native-insert proof admits (never a ws + * subscriptions snapshot, so `try_ws_subs_remove` is dead): `shift_remove`. */ + r05Delete(node): string | undefined { + const target: any = node?.expression; + if (target === undefined || !isElementAccessExpression(target) || this.r05IsTest(node)) { + return undefined; + } + const base: any = target.expression; + const receiver = this.rustNativeInsertReceiver(base); + // ws-capable tiers: a local/param may alias a `client.subscriptions` snapshot + // (live-store route in the helper); admit only fields and literal-built locals. + const restTier = /\/ts\/src\/[^/]+\.ts$/.test(this.r05Path(node)); + if (receiver !== undefined && !receiver.isField && !restTier && receiver.plain !== true) { + return undefined; + } + if (receiver === undefined || this.rustParamShadowOf(base) !== undefined + || !this.rustReceiverStaysDict(base, receiver) + || (receiver.isField && RustTranspiler.RUST_TAGGED_CONTAINER_FIELDS.has(String(receiver.nameNode.text))) + || (!receiver.isField && this.rustLocalInitReadsTaggedContainer(base))) { + return undefined; + } + const recv = this.printNode(base, 0).trim(); + const keyNode: any = target.argumentExpression; + const literal = isStringLiteral(keyNode) ? this.rustStringLiteralOf(this.printNode(keyNode, 0).trim()) : undefined; + if (literal !== undefined) { + return `if let Value::Dict(__d) = &mut ${recv} { std::sync::Arc::make_mut(__d).shift_remove(${literal}); }`; + } + const keyExpr = this.printNode(keyNode, 0).trim(); + if (!/^[A-Za-z_][A-Za-z0-9_]*$/.test(keyExpr) || keyExpr === 'self' || keyExpr === recv) { + return undefined; + } + return `if let (Value::Dict(__d), Value::Str(__k)) = (&mut ${recv}, &${keyExpr}) { std::sync::Arc::make_mut(__d).shift_remove(__k.as_ref()); }`; + } + + /** `this.` with a declared plain-dict type that is no ws container: the + * hand-written base builds these maps itself and never tags them. */ + r05UntaggedField(node): boolean { + return isPropertyAccessExpression(node) && node.expression.kind === SyntaxKind.ThisKeyword + && !RustTranspiler.RUST_TAGGED_CONTAINER_FIELDS.has(String(node.name.text)) + && !RustTranspiler.RUST_TAGGED_HANDLE_FIELDS.has(String(node.name.text)) + && this.rustProvenDictThisFieldR05(node); + } + + rustProvenDictThisFieldR05(node): boolean { + let declaration: any; + try { + declaration = symbolValueDeclaration(this.getChecker().getSymbolAtLocation(node.name)); + } catch (e) { + return false; + } + if (declaration === undefined || declaration.kind !== SyntaxKind.PropertyDeclaration || declaration.type === undefined) return false; + const type = this.getCheckedTypeOf(declaration.type); + return type !== undefined && this.isProvenMapType(type); + } + + /** `Object.keys/values(X)` in REST-tier sources (`ts/src/.ts`): no ws client + * there, so X never carries the `__ws_subs_url`/`__ws_sub_ref` tags the helper filters. */ + r05Enum(node, parsedArg: string | undefined, kind: 'keys' | 'values'): string | undefined { + const arg: any = this.rustStripWrappers(node?.arguments?.[0]); + if (arg === undefined || parsedArg === undefined + || !(/\/ts\/src\/[^/]+\.ts$/.test(this.r05Path(node)) || this.r05UntaggedField(arg)) + || !(isIdentifier(arg) || isPropertyAccessExpression(arg) || isElementAccessExpression(arg) || isCallExpression(arg)) + || this.rustParamShadowOf(arg) !== undefined) { + return undefined; + } + const type = this.typeOfNodeIfAny(arg); + const parts: Type[] = type === undefined ? [] : ((type.flags & TypeFlags.Union) ? (typeParts(type) ?? []) : [type]); + if (parts.some((p) => this.getChecker().isArrayType(p) || this.getChecker().isTupleType(p) + || (p.flags & (TypeFlags.StringLike | TypeFlags.NumberLike | TypeFlags.BooleanLike | TypeFlags.BigIntLike)) !== 0)) { + return undefined; // native-typed locals (bool / Option) have no `as_map` + } + const text = parsedArg.trim(); + const recv = /^[A-Za-z_][A-Za-z0-9_.]*$/.test(text) ? text : `(${text})`; + const body = kind === 'keys' ? '__m.keys().map(|__k| Value::Str(__k.clone().into())).collect()' : '__m.values().cloned().collect()'; + return `Value::Array(${recv}.as_map().map(|__m| ${body}).unwrap_or_default())`; + } + + // hx4 R06: string methods on a checker-proven string receiver print native `str` code. The + // receiver is a `Value`; `as_str()` reaches the payload and its `None` arm is the helper's + // non-`Str` branch (Null / false / empty array / -1). Literal operands only, unless noted. + + /** Printed receiver usable as a method receiver, else undefined. */ + rustNativeStringReceiver(node, receiverText: string, kind = 'string'): string | undefined { + if (node === undefined || !isCallExpression(node) || !isPropertyAccessExpression(node.expression)) return undefined; + if (typeof receiverText !== 'string' || receiverText.includes('\n') || receiverText.trim().startsWith('&')) return undefined; + const receiver = node.expression.expression; + if (receiver.kind === SyntaxKind.ThisKeyword || receiver.kind === SyntaxKind.SuperKeyword) return undefined; + if (kind === 'string' && this.primitiveKindOfType(this.typeOfNodeIfAny(receiver)) !== 'string') return undefined; + if (isIdentifier(receiver) && this.rustStringLocalIdentifierIsTyped(receiver)) return undefined; + const text = receiverText.trim(); + return /^[A-Za-z_][A-Za-z0-9_]*(\.[A-Za-z_][A-Za-z0-9_]*)*$/.test(text) ? text : `(${text})`; + } + + /** Escaped text of a string-literal argument, else undefined. */ + rustNativeStringLiteralArg(node): string | undefined { + if (node === undefined || (!isStringLiteral(node) && !isNoSubstitutionTemplateLiteral(node))) return undefined; + if (node.text in this.StringLiteralReplacements) return undefined; + return this.escapeRustStringLiteral(node.text); + } + + // `x.toUpperCase()` / `x.toLowerCase()`: the helper's `Value::Str` arm, Null otherwise. + printNativeStringCase(node, receiverText: string, method: string): string | undefined { + const receiver = this.rustNativeStringReceiver(node, receiverText); + if (receiver === undefined || (node.arguments?.length ?? 0) !== 0) return undefined; + return `${receiver}.as_str().map(|__s| Value::Str(__s.${method}().into())).unwrap_or(Value::Null)`; + } + + // `x.startsWith("lit")` / `x.endsWith("lit")` → a bool (false for a non-`Str` receiver). + printNativeStringAffixTest(node, receiverText: string, method: string): string | undefined { + const receiver = this.rustNativeStringReceiver(node, receiverText); + if (receiver === undefined || node.arguments?.length !== 1) return undefined; + const literal = this.rustNativeStringLiteralArg(node.arguments[0]); + if (literal === undefined) return undefined; + return `${receiver}.as_str().is_some_and(|__s| __s.${method}("${literal}"))`; + } + + // `x.split("lit")`: an array of the parts, the empty array for a non-`Str` receiver. + printNativeStringSplit(node, receiverText: string): string | undefined { + const receiver = this.rustNativeStringReceiver(node, receiverText); + if (receiver === undefined || node.arguments?.length !== 1) return undefined; + const literal = this.rustNativeStringLiteralArg(node.arguments[0]); + if (literal === undefined) return undefined; + return `Value::Array(${receiver}.as_str().map(|__s| __s.split("${literal}").map(|__p| Value::Str(__p.to_string().into())).collect()).unwrap_or_default())`; + } + + // `x.replace("a", "b")`: the helper replaces every occurrence (`str::replace`), else the receiver. + printNativeStringReplace(node, receiverText: string): string | undefined { + const receiver = this.rustNativeStringReceiver(node, receiverText); + if (receiver === undefined || node.arguments?.length !== 2) return undefined; + const from = this.rustNativeStringLiteralArg(node.arguments[0]); + const to = this.rustNativeStringLiteralArg(node.arguments[1]); + if (from === undefined || to === undefined) return undefined; + return `${receiver}.as_str().map(|__s| Value::Str(__s.replace("${from}", "${to}").into())).unwrap_or_else(|| ${receiver}.clone())`; + } + + // `x.padStart(N, "c")` with a one-char alphanumeric pad: `format!` width counts chars and never + // truncates, which is the helper's arm for a one-char pad. + printNativeStringPadStart(node, receiverText: string): string | undefined { + const receiver = this.rustNativeStringReceiver(node, receiverText); + if (receiver === undefined || node.arguments?.length !== 2) return undefined; + const width = this.rustSliceLiteralBound(node.arguments[0]); + const pad = node.arguments[1]; + if (width === undefined || width < 0 || width > 4096) return undefined; + if ((!isStringLiteral(pad) && !isNoSubstitutionTemplateLiteral(pad)) || !/^[A-Za-z0-9 ]$/.test(pad.text)) return undefined; + return `${receiver}.as_str().map(|__s| Value::Str(format!("{:${pad.text}>${width}}", __s).into())).unwrap_or(Value::Null)`; + } + + // `x.indexOf(y)` with a proven-string needle: `-1` when either side is not a `Str` (byte index). + printNativeStringIndexOfString(node, receiverText: string): string | undefined { + const receiver = this.rustNativeStringReceiver(node, receiverText); + if (receiver === undefined || node.arguments?.length !== 1) return undefined; + const needle = node.arguments[0]; + if (!isIdentifier(needle) || this.primitiveKindOfType(this.typeOfNodeIfAny(needle)) !== 'string') return undefined; + if (!this.isDeclaredValueIdentifier(needle) || this.rustStringLocalIdentifierIsTyped(needle)) return undefined; + const needleText = this.printNode(needle, 0).trim(); + if (!/^[A-Za-z_][A-Za-z0-9_]*$/.test(needleText)) return undefined; + return `Value::Int(${receiver}.as_str().zip(${needleText}.as_str()).and_then(|(__s, __n)| __s.find(__n)).map(|__i| __i as i64).unwrap_or(-1))`; + } + + // `xs.join("lit")` on a `string[]`: `Display` renders `Str`/`Null` like the helper does. + printNativeStringJoin(node, receiverText: string): string | undefined { + const receiver = this.rustNativeStringReceiver(node, receiverText, 'array'); + if (receiver === undefined || node.arguments?.length !== 1) return undefined; + const literal = this.rustNativeStringLiteralArg(node.arguments[0]); + if (literal === undefined) return undefined; + const checker: any = this.checkerOrUndefined(); + const type: any = this.typeOfNodeIfAny(node.expression.expression); + if (checker === undefined || type === undefined || !checker.isArrayType(type)) return undefined; + const element = checker.getTypeArguments?.(type)?.[0]; + if (this.primitiveKindOfType(element) !== 'string') return undefined; + return `Value::Str(${receiver}.as_array().map(|__a| __a.iter().map(|__v| __v.to_string()).collect::>().join("${literal}")).unwrap_or_default().into())`; + } + + // hx4 R07 — numeric/string helpers on checker-proven `number` / `string` operands (nullish members + // allowed: the helper's Null arm is reproduced). Each native form answers exactly what the helper + // answers for Int/Float/Str/Null boxes; any other operand type keeps the helper. + rustOperandKind(node): string | undefined { + try { + if (node === undefined || !this.printsValueExpression(node)) return undefined; + return this.primitiveKindOfType(this.typeOfNodeIfAny(node)); + } catch (e) { + return undefined; + } + } + + // `x.toString()` on a number/string: `to_string_val` is `stringify_simple`, i.e. `Display`. + // Typed `Option` receivers have no `Display`, so they keep the helper. + printRustNativeToString(node, name: string): string | undefined { + const receiver = node?.expression?.expression; + const kind = this.rustOperandKind(receiver); + if (kind !== 'number' && kind !== 'string') return undefined; + const inner = this.unwrapParensNode(receiver); + if (inner !== undefined && (this.rustStringLocalIdentifierIsTyped(inner) || this.rustNativeStrCalleeKind(inner) === 'str')) return undefined; + return `Value::Str(format!("{}", ${name}).into())`; + } + + // `Math.floor|round|ceil(n)`: the helper answers `Float(op(x))` for a numeric box, `Null` otherwise. + printRustNativeMathCall(node, op: string, parsedArg: string): string | undefined { + if (this.rustOperandKind(node?.arguments?.[0]) !== 'number') return undefined; + return `(${parsedArg}).as_f64().map(|__x| Value::Float(__x.${op}())).unwrap_or(Value::Null)`; + } + + // `-n`: Int/Float flip sign in place, a Null box stays Null (helper's fallthrough). + printRustNativeNegate(operand, operandText: string): string | undefined { + if (this.rustOperandKind(operand) !== 'number' && this.rustR16NumericKind(operand) === undefined) return undefined; + return `(match &(${operandText}) { Value::Int(x) => Value::Int(-x), Value::Float(x) => Value::Float(-x), _ => Value::Null })`; + } + + // `a % b` on numbers: Int pair stays Int, any Float widens; a zero divisor or Null answers Null. + printRustNativeMod(left, right, leftText: string, rightText: string): string | undefined { + if (this.rustOperandKind(left) !== 'number' || this.rustOperandKind(right) !== 'number') return undefined; + return `(match (&(${leftText}), &(${rightText})) {` + + ' (Value::Int(x), Value::Int(y)) if *y != 0 => Value::Int(x % y),' + + ' (Value::Int(x), Value::Float(y)) if *y != 0.0 => Value::Float(*x as f64 % *y),' + + ' (Value::Float(x), Value::Int(y)) if *y != 0 => Value::Float(*x % *y as f64),' + + ' (Value::Float(x), Value::Float(y)) if *y != 0.0 => Value::Float(x % y),' + + ' _ => Value::Null })'; + } + + // hx4 R09 — `.length` always prints `Value::Int` (`get_array_length` / `Value::Int(len)`), so a + // `.length` read, or a `const` local initialised from one, is a never-null Int whatever its receiver. + rustR09IsDefiniteInt(node): boolean { + const inner = this.rustStripWrappers(node); + if (inner === undefined) return false; + if (isPropertyAccessExpression(inner)) return String(inner.name.text) === 'length'; + if (!isIdentifier(inner)) return false; + const declaration: any = this.rustSingleLocalDeclaration(inner); + if (declaration === undefined || !isVariableDeclaration(declaration) || declaration.name?.kind !== SyntaxKind.Identifier) return false; + if ((declaration.parent?.flags & NodeFlags.Const) === 0) return false; + const init = this.rustStripWrappers(declaration.initializer); + return init !== undefined && isPropertyAccessExpression(init) && String(init.name.text) === 'length'; + } + + // Int-only (definite) or checker-proven number (Int/Float/Null) operand that prints a `Value`. + rustR09NumericOperand(node): string | undefined { + if (this.rustR09IsDefiniteInt(node)) return 'definite'; + return this.rustOperandKind(node) === 'number' ? 'number' : undefined; + } + + // `a === b` with a definite Int side against a number literal, a number or another definite Int: + // is_equal compares Int/Float payloads as f64 and Null only equals Null, which `as_f64()` mirrors. + rustR09LengthEquality(left, right, op): string | undefined { + if (!this.rustR09IsDefiniteInt(left) && !this.rustR09IsDefiniteInt(right)) return undefined; + const operator = (op === SyntaxKind.EqualsEqualsToken || op === SyntaxKind.EqualsEqualsEqualsToken) ? '==' : '!='; + const [ definite, other ] = this.rustR09IsDefiniteInt(left) ? [ left, right ] : [ right, left ]; + if (!this.printsValueExpression(definite)) return undefined; + const otherInner = this.rustStripWrappers(other); + if (otherInner !== undefined && otherInner.kind === SyntaxKind.NumericLiteral) { + const text = this.numericLiteralF64Text(otherInner); + if (text === undefined) return undefined; + return `${this.printNode(definite, 0)}.as_f64() ${operator} Some(${text})`; + } + if (this.rustR09NumericOperand(other) === undefined) return undefined; + return `${this.printNode(left, 0)}.as_f64() ${operator} ${this.printNode(right, 0)}.as_f64()`; + } + + // `a + b` / `a - b` with a definite Int operand and a numeric one: the helper's Int/Float dispatch. + // `s + n` / `n + s` with s a non-null string and n numeric: the helper's string branch, i.e. + // `stringify_simple` of each side, which equals `Display` for Str/Int/Float/Null. + rustR09NativeAddSubtract(op, left, right, leftType, rightType, leftText: string, rightText: string): string | undefined { + if (op !== SyntaxKind.PlusToken && op !== SyntaxKind.MinusToken) return undefined; + const leftNumeric = this.rustR09NumericOperand(left); + const rightNumeric = this.rustR09NumericOperand(right); + if ((leftNumeric === 'definite' && rightNumeric !== undefined) || (rightNumeric === 'definite' && leftNumeric !== undefined)) { + return this.printNativeNumeric(op, leftText, rightText); + } + if (op !== SyntaxKind.PlusToken) return undefined; + const stringSide = this.isStringLikeType(leftType) && rightNumeric !== undefined ? left + : (this.isStringLikeType(rightType) && leftNumeric !== undefined ? right : undefined); + if (stringSide === undefined || !this.printsValueExpression(stringSide)) return undefined; + const inner = this.unwrapParensNode(stringSide); + if (inner !== undefined && (this.rustStringLocalIdentifierIsTyped(inner) || this.rustNativeStrCalleeKind(inner) === 'str')) return undefined; + return this.printNativeStringConcat(leftText, rightText); + } + + // hx4 R10 — native reads on receivers the R01 plain-dict proof admits (tag-free literal / + // `account ()` / `omit` / `extend` / tuple element 0 locals) and on `Dict`-annotated parameters + // whose writes keep them plain: no marker route of `get_value` can fire on such a receiver. + + /** 'local' for an R01-proven plain-dict local, 'param' for a plain-kept dict parameter. */ + rustR10PlainReceiver(node: Node): 'local' | 'param' | undefined { + if (node === undefined || !isIdentifier(node) || this.rustParamShadowOf(node) !== undefined) return undefined; + const declaration: any = this.rustSingleLocalDeclaration(node as Identifier); + if (declaration !== undefined && isParameterDeclaration(declaration)) { + if (declaration.type === undefined || declaration.dotDotDotToken !== undefined) return undefined; + const type = this.getCheckedTypeOf(declaration.type); + if (type === undefined || !this.isProvenMapType(type)) return undefined; + return this.rustParamStaysPlainDict(declaration) ? 'param' : undefined; + } + try { + return (this.rustR01LocalStaysPlain(node as Identifier) || this.rustR01ShippedPlain(node as Identifier)) ? 'local' : undefined; + } catch (e) { + return undefined; + } + } + + /** A literal-key read (`x['k']` / `x.k`) on a proven plain receiver. */ + rustR10LiteralReadOk(receiverNode: Node, keyText: string): boolean { + const kind = this.rustR10PlainReceiver(receiverNode); + if (kind === undefined || keyText === '') return false; + if (kind === 'param' && RustTranspiler.RUST_DICT_LOCAL_UNSAFE_KEYS.has(keyText)) return false; + const read: any = receiverNode.parent; + return read === undefined || !this.isWriteBackBindRead(read); + } + + /** `x[k]` on a proven plain receiver with a `Value` key place (`string` or `any` typed). */ + rustR10DynamicRead(receiverText: string, receiverNode: Node, keyNode: Node): string | undefined { + const kind = this.rustR10PlainReceiver(receiverNode); + if (kind === undefined) return undefined; + const key: any = this.rustSkipWrappers(keyNode); + if (key === undefined || !isIdentifier(key) || this.rustStringLocalIdentifierIsTyped(key)) return undefined; + const type = this.getCheckedTypeOf(key); + if (type === undefined || !((type.flags & TypeFlags.Any) || this.rustKeyIsProvenString(key))) return undefined; + const read = this.rustElementReadOfKey(keyNode); + if (read !== undefined && this.isWriteBackBindRead(read)) return undefined; + const keyText = this.printNode(keyNode, 0).trim(); + if (!/^[A-Za-z_][A-Za-z0-9_]*$/.test(keyText)) return undefined; + if (kind === 'param' && this.rustNodeIsKeyUnsafePlace(keyText)) return undefined; + return `${receiverText}.as_map().and_then(|__m| ${keyText}.as_str().and_then(|__k| __m.get(__k))).cloned().unwrap_or(Value::Null)`; + } + + // hx4 R11 — typed `Vec` locals also admit an argument of a non-`&mut self` `this.m(..)` + // call that is not the final use (boxed as `Value::from(x.clone())`, the clone the post-pass + // gave the boxed local) and a plain `x[i]` read with a number index (native `Vec::get`). + r11VecUse(n): boolean { + const parent = n.parent; + if (isCallExpression(parent) && parent.arguments.some((a) => a === n)) { + const callee: any = parent.expression; + if (!isPropertyAccessExpression(callee)) return false; + const kind = callee.expression.kind; + if (kind !== SyntaxKind.ThisKeyword && kind !== SyntaxKind.SuperKeyword) return false; + if (RustTranspiler.MUT_SELF_METHODS.has(this.toSnakeCaseName(String(callee.name.text)))) return false; + let mentions = 0; + const visit = (m) => { if (m.kind === SyntaxKind.Identifier && m.text === n.text) mentions++; m.forEachChild?.(visit); }; + parent.arguments.forEach(visit); + if (mentions !== 1) return false; + return this.rustVecValueUse(n, String(n.text)) || !this.r11LoopBetween(n); + } + return isElementAccessExpression(parent) && parent.expression === n && this.r11VecReadShape(parent); + } + + // A loop around the use that does not also hold the declaration: a per-iteration Vec clone + // would cost O(n) where the boxed local only bumped its Arc. + r11LoopBetween(n): boolean { + const declaration = this.rustVecLocalDeclarationOf(n) ?? this.rustSingleLocalDeclaration(n); + const fn = this.rustEnclosingFunction(n); + for (let current: any = n.parent; current !== undefined && current !== fn; current = current.parent) { + if (declaration !== undefined && this.isNodeInsideNode(declaration, current)) return false; + switch (current.kind) { + case SyntaxKind.ForStatement: case SyntaxKind.ForInStatement: case SyntaxKind.ForOfStatement: + case SyntaxKind.WhileStatement: case SyntaxKind.DoStatement: + return true; + } + } + return false; + } + + // `x[k]` as a plain value read: not a write/delete/++ target, not a chain or call receiver, + // not a bind the next statement mutates (ccxt's write-back keys on `get_value` text). + r11VecReadShape(access): boolean { + const up: any = access.parent; + if (up === undefined || isDeleteExpression(up) || up.kind === SyntaxKind.PrefixUnaryExpression + || up.kind === SyntaxKind.PostfixUnaryExpression) return false; + if (isBinaryExpression(up) && up.left === access && rustIsAssignmentOperator(up.operatorToken.kind)) return false; + if ((isPropertyAccessExpression(up) || isElementAccessExpression(up) || isCallExpression(up)) && up.expression === access) return false; + if (this.isWriteBackBindRead(access)) return false; + const key: any = this.rustStripWrappers(access.argumentExpression); + if (key === undefined) return false; + if (isNumericLiteral(key)) return Number.isInteger(Number(key.text)) && Number(key.text) >= 0; + // a `Value` number counter (`let i = 0`), as for the native dynamic list index + return this.isRustValueIndexKey(key); + } + + printElementAccessExpressionExceptionIfAny(node) { + const receiver: any = node?.expression; + if (receiver?.kind !== SyntaxKind.Identifier || this.rustVecLocalDeclarationOf(receiver) === undefined + || !this.r11VecReadShape(node)) return super.printElementAccessExpressionExceptionIfAny(node); + const name = this.printNode(receiver, 0).trim(); + const key: any = this.rustStripWrappers(node.argumentExpression); + // `get_value`'s array arm: an Int index by `as usize` (negative misses), anything else misses. + const index = isNumericLiteral(key) ? String(Number(key.text)) + : `(${this.printNode(node.argumentExpression, 0).trim()}).as_i64().map_or(usize::MAX, |__n| __n as usize)`; + return `${name}.get(${index}).cloned().unwrap_or(Value::Null)`; + } + + // An expression that always holds a `Value::Arr`: a runtime-split / array-literal-returning call, + // or a never-reassigned local initialised from one (through `const y = x` aliases). + r11ProvenListValue(node, depth = 0): boolean { + const inner = this.rustStripWrappers(node); + if (inner === undefined || depth > 4 || this.rustIsOrderBookSide(inner)) return false; + if (isCallExpression(inner)) return this.rustCallReturnsProvenList(inner); + if (!isIdentifier(inner)) return false; + const declaration: any = this.rustSingleLocalDeclaration(inner); + if (declaration === undefined || !isVariableDeclaration(declaration) || declaration.initializer === undefined + || !isIdentifier(declaration.name)) return false; + if (this.rustLocalIsReassigned(declaration, String(declaration.name.text))) return false; + return this.r11ProvenListValue(declaration.initializer, depth + 1); + } + + // hx4 R12 — plain-dict sources from base `safeDict*` reads of unshared dicts and same-file + // sync request builders; native truthiness / bool equality on operands proven `Value::Bool` + // or `Value::Null` at runtime (bool tuple elements, bool-returning exchange methods). + + /** Base-tier bool readers whose Rust form returns `Value::Bool` or `Value::Null` + * (`safe_bool*` keep only `Value::Bool` or the default; the `check_option_bool` stub). */ + private static readonly RUST_R12_BOOL_READERS: { [name: string]: number } = { safeBool: 2, safeBool2: 3, safeBoolN: 2, checkOptionBool: -1 }; + private static readonly RUST_R12_DICT_READERS: { [name: string]: number } = { safeDict: 2, safeDict2: 3, safeDictN: 2 }; + /** A REST venue file (`ts/src/.ts`): no base / pro / prediction tier. */ + private static readonly RUST_R12_REST_FILE = /ts\/src\/[^/]+\.ts$/; + + /** Extra plain-dict write sources (R01 write-history proof), REST venue files only: no + * runtime tagged handle (book, ws subscription, cache bucket) is reachable there. */ + private rustR12Visiting = new Set(); + + rustR12PlainSource(node: any, depth = 0): boolean { + if (depth > 4 || !isCallExpression(node) || !isPropertyAccessExpression(node.expression) + || node.expression.expression.kind !== SyntaxKind.ThisKeyword + || !this.r23PlainSourceTier(node)) { + return false; + } + const callee = String(node.expression.name.text); + const defaultIndex = RustTranspiler.RUST_R12_DICT_READERS[callee]; + if (defaultIndex !== undefined) { + const fallback: any = this.rustStripWrappers(node.arguments[defaultIndex]); + return this.rustR01CalleeIsBase(node) && node.arguments.length <= defaultIndex + 1 + && (fallback === undefined || this.rustPlainDictLiteral(fallback) || this.rustTypeIsUndefinedish(fallback)) + && this.rustR12UnsharedDict(node.arguments[0]) && this.r23TierSourceOk(node.arguments[0]); + } + if (this.r23FreshCopy(node, depth)) return true; + return this.rustR12PlainBuilder(node, depth); + } + + /** `this.options`, a parameter, or a const local whose initializer reads no `this` field + * but `options` and no tagged container (`hashmap`, `subscriptions`, `futures`). */ + rustR12UnsharedDict(arg: any): boolean { + const node: any = this.rustStripWrappers(arg); + if (node === undefined) return false; + if (isPropertyAccessExpression(node) && node.expression.kind === SyntaxKind.ThisKeyword) { + return String(node.name.text) === 'options'; + } + if (!isIdentifier(node)) return false; + const declaration: any = this.rustSingleLocalDeclaration(node); + if (declaration === undefined) return false; + // runtime tags live on pro-only fields; a REST method's parameter is caller data + if (isParameterDeclaration(declaration)) return true; + if (!isVariableDeclaration(declaration) || (declaration.parent?.flags & NodeFlags.Const) === 0 || declaration.initializer === undefined) return false; + let clean = true; + const visit = (n: any) => { + if (!clean) return; + if (isPropertyAccessExpression(n)) { + const field = String(n.name.text); + const isCallee = isCallExpression(n.parent) && n.parent.expression === n; + if (RustTranspiler.RUST_TAGGED_CONTAINER_FIELDS.has(field) + || (n.expression.kind === SyntaxKind.ThisKeyword && !isCallee && field !== 'options')) { + clean = false; + return; + } + } + n.forEachChild(visit); + }; + visit(declaration.initializer); + return clean; + } + + /** `this.m (…)` on a sync method of the calling file whose every `return` is a plain + * literal, a plain local, or `this.extend|omit|keysort (plain, …unshared)`. */ + rustR12PlainBuilder(call: any, depth: number): boolean { + const method: any = this.rustR12MethodImpl(call); + if (method === undefined || method.getSourceFile() !== call.getSourceFile() + || (method.modifiers ?? []).some((m: any) => m.kind === SyntaxKind.AsyncKeyword)) { + return false; + } + // a builder whose proof reaches itself again (recursion through locals) proves nothing + if (this.rustR12Visiting.has(method)) return false; + this.rustR12Visiting.add(method); + let plain = true; + let returns = 0; + try { + this.rustWalkScope(method.body, (n) => { + if (isArrowFunction(n) || n.kind === SyntaxKind.FunctionExpression) return RUST_WALK_SKIP; + if (!isReturnStatement(n)) return; + returns++; + if (!this.rustR12PlainReturn(n.expression, depth)) { plain = false; return RUST_WALK_STOP; } + }); + } finally { + this.rustR12Visiting.delete(method); + } + return plain && returns > 0; + } + + rustR12PlainReturn(expr: any, depth: number): boolean { + const node: any = this.rustStripWrappers(expr); + if (node === undefined) return false; + const plainHead = (head: any): boolean => { + const h: any = this.rustStripWrappers(head); + return h !== undefined && (this.rustPlainDictLiteral(h) + || (isIdentifier(h) && this.rustR01LocalStaysPlain(h, depth + 1)) || this.rustR12PlainSource(h, depth + 1)); + }; + if (plainHead(node)) return true; + if (!isCallExpression(node) || !isPropertyAccessExpression(node.expression) + || node.expression.expression.kind !== SyntaxKind.ThisKeyword || node.arguments.length === 0 + || !this.rustR01CalleeIsBase(node)) { + return false; + } + const callee = String(node.expression.name.text); + if (callee === 'omit' || callee === 'keysort') return plainHead(node.arguments[0]); + return callee === 'extend' && plainHead(node.arguments[0]) + && node.arguments.slice(1).every((a) => plainHead(a) || (this.rustR12UnsharedDict(a) && this.r23TierSourceOk(a))); + } + + /** The single bodied method declaration `this.m (…)` resolves to (implementation of an + * overload set), in the calling file or the base tier. */ + rustR12MethodImpl(call: any): any { + const checker: any = this.checkerOrUndefined(); + const callee: any = call?.expression; + if (checker === undefined || !isPropertyAccessExpression(callee) || callee.expression.kind !== SyntaxKind.ThisKeyword) { + return undefined; + } + let declarations: any[]; + try { + declarations = symbolDeclarations(checker.getSymbolAtLocation(callee.name)) + .filter((d: any) => d.kind === SyntaxKind.MethodDeclaration && d.body !== undefined); + } catch (e) { + return undefined; + } + // a base-tier caller may dispatch to any venue override + const callerFile = String(call.getSourceFile().fileName).replace(/\\/g, '/'); + if (declarations.length !== 1 || RustTranspiler.RUST_BASE_TIER_FILE.test(callerFile)) return undefined; + const file = String(declarations[0].getSourceFile().fileName).replace(/\\/g, '/'); + return declarations[0].getSourceFile() === call.getSourceFile() || RustTranspiler.RUST_BASE_TIER_FILE.test(file) + ? declarations[0] : undefined; + } + + /** The expression's Rust value is always `Value::Bool(_)` or `Value::Null`. */ + rustR12BoolValue(expr: any, depth = 0): boolean { + let node: any = this.rustStripWrappers(expr); + while (node !== undefined && node.kind === SyntaxKind.AwaitExpression) node = this.rustStripWrappers(node.expression); + if (node === undefined || depth > 5) return false; + switch (node.kind) { + case SyntaxKind.TrueKeyword: + case SyntaxKind.FalseKeyword: + case SyntaxKind.NullKeyword: + return true; + case SyntaxKind.Identifier: + return node.text === 'undefined' || this.rustR12BoolLocal(node, depth + 1); + case SyntaxKind.PrefixUnaryExpression: + return node.operator === SyntaxKind.ExclamationToken; + case SyntaxKind.BinaryExpression: { + const op = node.operatorToken.kind; + return RustTranspiler.COMPARISON_OPS.has(op) || this.isLogicalOp(op); + } + case SyntaxKind.ConditionalExpression: + return this.rustR12BoolValue(node.whenTrue, depth + 1) && this.rustR12BoolValue(node.whenFalse, depth + 1); + case SyntaxKind.CallExpression: + return this.rustR12BoolCall(node, depth); + } + return false; + } + + /** A base `safeBool*` with a bool default, `checkOptionBool`, or a method (calling file or + * base tier) whose every `return` is such a value. */ + rustR12BoolCall(call: any, depth: number): boolean { + if (!isPropertyAccessExpression(call.expression) || call.expression.expression.kind !== SyntaxKind.ThisKeyword) return false; + const reader = RustTranspiler.RUST_R12_BOOL_READERS[String(call.expression.name.text)]; + if (reader !== undefined) { + if (!this.rustR01CalleeIsBase(call)) return false; + return reader < 0 || call.arguments.length <= reader + || (call.arguments.length === reader + 1 && this.rustR12BoolValue(call.arguments[reader], depth + 1)); + } + // at least one return must be a real bool: an all-`undefined` stub proves nothing + let sawBool = false; + return this.rustR12EveryReturn(call, depth, (e) => { + const nullish = this.rustTypeIsUndefinedish(this.rustStripWrappers(e) ?? e); + sawBool = sawBool || !nullish; + return nullish || this.rustR12BoolValue(e, depth + 1); + }) && sawBool; + } + + rustR12EveryReturn(call: any, depth: number, ok: (e: any) => boolean): boolean { + const method: any = this.rustR12MethodImpl(call); + if (method === undefined || this.rustR12Visiting.has(method)) return false; + this.rustR12Visiting.add(method); + let proven = true; + let returns = 0; + try { + this.rustWalkScope(method.body, (n) => { + if (isArrowFunction(n) || n.kind === SyntaxKind.FunctionExpression) return RUST_WALK_SKIP; + if (!isReturnStatement(n)) return; + returns++; + if (n.expression === undefined || !ok(n.expression)) { proven = false; return RUST_WALK_STOP; } + }); + } finally { + this.rustR12Visiting.delete(method); + } + return proven && returns > 0; + } + + /** Element `index` of `this.m (…)`'s tuple is a bool value on every return path. */ + rustR12BoolTupleElement(expr: any, index: number, depth: number): boolean { + let call: any = this.rustStripWrappers(expr); + while (call !== undefined && call.kind === SyntaxKind.AwaitExpression) call = this.rustStripWrappers(call.expression); + if (call === undefined || !isCallExpression(call) || depth > 5) return false; + return this.rustR12EveryReturn(call, depth, (e) => { + const tuple: any = this.rustStripWrappers(e); + if (tuple?.kind === SyntaxKind.ArrayLiteralExpression) { + const element = tuple.elements[index]; + return element !== undefined && element.kind !== SyntaxKind.SpreadElement && this.rustR12BoolValue(element, depth + 1); + } + return this.rustR12BoolTupleElement(tuple, index, depth + 1); + }); + } + + /** A local whose declaration and every write store a bool value. Locals the printer or + * ccxt's narrowBoolLocals may declare `bool` (bool-expression initializer) are left out. */ + rustR12BoolLocal(ident: any, depth: number): boolean { + const checker: any = this.checkerOrUndefined(); + if (depth > 5) return false; + const declarations: any[] = checker === undefined ? [] : symbolDeclarations(checker.getSymbolAtLocation(ident)); + const declaration: any = declarations.length === 1 ? declarations[0] : undefined; + if (declaration === undefined) return false; + let nameNode: any; + let variable: any; + if (declaration.kind === SyntaxKind.BindingElement) { + const pattern: any = declaration.parent; + variable = pattern?.parent; + if (pattern?.kind !== SyntaxKind.ArrayBindingPattern || variable === undefined || !isVariableDeclaration(variable) + || declaration.initializer !== undefined || declaration.dotDotDotToken !== undefined + || declaration.name?.kind !== SyntaxKind.Identifier + || !this.rustR12BoolTupleElement(variable.initializer, pattern.elements.indexOf(declaration), depth)) { + return false; + } + nameNode = declaration.name; + } else if (isVariableDeclaration(declaration) && declaration.name?.kind === SyntaxKind.Identifier) { + const init: any = this.rustStripWrappers(declaration.initializer); + if (init !== undefined && (this.rustNodeIsBoolExpression(init) + || !(this.rustTypeIsUndefinedish(init) || (isIdentifier(init) && init.text === 'undefined') || this.rustR12BoolValue(init, depth)))) { + return false; + } + variable = declaration; + nameNode = declaration.name; + } else { + return false; + } + const scope = this.rustEnclosingFunction(variable); + const symbol = this.rustSymbolOf(nameNode); + const name = String(nameNode.text); + if (scope === undefined || isSourceFile(scope) || symbol === undefined) return false; + for (const node of this.rustScopeNameNodes(scope, name) as any[]) { + if (node.kind !== SyntaxKind.Identifier || node === nameNode || this.rustSymbolOf(node) !== symbol) continue; + if (this.rustEnclosingFunction(node) !== scope) return false; + let target: any = node; + while (target.parent !== undefined && (isParenthesizedExpression(target.parent) || isNonNullExpression(target.parent) || isAsExpression(target.parent))) target = target.parent; + const parent: any = target.parent; + if (isBinaryExpression(parent) && parent.left === target && rustIsAssignmentOperator(parent.operatorToken.kind)) { + if (parent.operatorToken.kind !== SyntaxKind.EqualsToken || this.rustNodeIsBoolExpression(this.rustStripWrappers(parent.right)) + || !this.rustR12BoolValue(parent.right, depth)) return false; + } else if (parent?.kind === SyntaxKind.ArrayLiteralExpression) { + const assign: any = parent.parent; + if (assign !== undefined && isBinaryExpression(assign) && assign.left === parent + && !this.rustR12BoolTupleElement(assign.right, parent.elements.indexOf(target), depth)) return false; + } else if ((parent?.kind === SyntaxKind.PrefixUnaryExpression && parent.operator !== SyntaxKind.ExclamationToken) || parent?.kind === SyntaxKind.PostfixUnaryExpression + || parent?.kind === SyntaxKind.DeleteExpression + || ((isForOfStatement(parent) || isForInStatement(parent)) && parent.initializer === target)) { + return false; + } + } + return true; + } + + /** `if (x)` on a local or `this.m (…)` proven a bool value: `x.as_bool() == Some(true)` + * is `is_true` on `Value::Bool`/`Value::Null`; bool slots only (leading-token boxing). */ + rustR12NativeTruthiness(node: any): string | undefined { + const inner: any = this.unwrapParens(node); + if (inner === undefined || (!isIdentifier(inner) && !isCallExpression(inner)) + || !this.printsValueExpression(inner) || !this.isBareBoolEmissionSafe(node) + || (isCallExpression(inner) && this.rustCallPrintsBool(inner)) || !this.rustR12BoolValue(inner)) { + return undefined; + } + // the text ccxt's is_true post-pass prints for the same proof; `!` needs the parens + const text = `${this.printNode(inner, 0)}.as_bool() == Some(true)`; + let current: any = node; + while (current.parent !== undefined && isParenthesizedExpression(current.parent)) current = current.parent; + const negated = current.parent?.kind === SyntaxKind.PrefixUnaryExpression && current.parent.operator === SyntaxKind.ExclamationToken; + return negated ? `(${text})` : text; + } + + /** `x === true|false` with `x` proven a bool value: `is_equal` against a `Value::Bool` is + * the payload compare there (Null matches neither). */ + rustR12NativeBoolEquality(left: any, right: any, op: any): string | undefined { + const leftLiteral = left.kind === SyntaxKind.TrueKeyword || left.kind === SyntaxKind.FalseKeyword; + const rightLiteral = right.kind === SyntaxKind.TrueKeyword || right.kind === SyntaxKind.FalseKeyword; + if (leftLiteral === rightLiteral) return undefined; + const [ literal, other ] = leftLiteral ? [ left, right ] : [ right, left ]; + const inner: any = this.unwrapParens(other); + if (inner === undefined || (!isIdentifier(inner) && !isCallExpression(inner)) || !this.printsValueExpression(inner) + || (isCallExpression(inner) && this.rustCallPrintsBool(inner)) || !this.rustR12BoolValue(inner)) { + return undefined; + } + const operator = (op === SyntaxKind.EqualsEqualsToken || op === SyntaxKind.EqualsEqualsEqualsToken) ? '==' : '!='; + return `${this.printNode(inner, 0)}.as_bool() ${operator} Some(${literal.kind === SyntaxKind.TrueKeyword ? 'true' : 'false'})`; + } + + // hx4 R13 — proven-`Str` operands: a `this.safeString*` call (no default or a string-literal + // default) or a native-`Str` callee re-boxed into `Value`, or a `const`/never-reassigned local + // initialized from one, can only hold `Value::Str` / `Value::Null`, whatever its TS type says. + rustR13ProvenStrSource(node): boolean { + const inner: any = this.unwrapParensNode(node); + if (inner === undefined || !isCallExpression(inner)) return false; + if (this.rustNativeStrCalleeKind(inner) === 'str') return true; + const callee: any = inner.expression; + if (!isPropertyAccessExpression(callee) || callee.expression.kind !== SyntaxKind.ThisKeyword) return false; + const name = callee.name.text; + if (!RustTranspiler.RUST_STRING_LOCAL_HELPERS.has(name)) return false; + const arity = /N$/.test(name) || !/2$/.test(name) ? 2 : 3; + const args = inner.arguments ?? []; + if (args.length === arity) return true; + return args.length === arity + 1 && (isStringLiteral(args[arity]) || isNoSubstitutionTemplateLiteral(args[arity])); + } + + rustR13ProvenStrIdentifier(node): boolean { + if (node === undefined || !isIdentifier(node) || this.rustStringLocalIdentifierIsTyped(node)) return false; + const checker: any = this.checkerOrUndefined(); + const declarations: any[] = checker === undefined ? [] : symbolDeclarations(checker.getSymbolAtLocation(node)); + if (declarations.length !== 1 || !isVariableDeclaration(declarations[0])) return false; + const declaration: any = declarations[0]; + if (declaration.name?.kind !== SyntaxKind.Identifier || !this.rustR13ProvenStrSource(declaration.initializer)) return false; + // every later write keeps the proof (D2): only `x = ` + return this.rustLocalUsesAll(declaration, declaration.name.text, true, (n) => { + if (this.rustR13WriteTarget(n)) return false; + const parent: any = n.parent; + if (parent?.kind !== SyntaxKind.BinaryExpression || parent.left !== n) return !(parent?.kind === SyntaxKind.PrefixUnaryExpression || parent?.kind === SyntaxKind.PostfixUnaryExpression) || parent.operator === SyntaxKind.ExclamationToken; + const op = parent.operatorToken.kind; + if (op < SyntaxKind.FirstAssignment || op > SyntaxKind.LastAssignment) return true; + return op === SyntaxKind.EqualsToken && this.rustR13ProvenStrSource(parent.right); + }); + } + + /** A destructuring / for-in-of target: a write the direct-assignment check cannot see. */ + rustR13WriteTarget(node): boolean { + let current: any = node; + let parent: any = node.parent; + while (parent !== undefined && (isArrayLiteralExpression(parent) || isObjectLiteralExpression(parent) || isParenthesizedExpression(parent) + || parent.kind === SyntaxKind.PropertyAssignment || parent.kind === SyntaxKind.ShorthandPropertyAssignment || parent.kind === SyntaxKind.SpreadElement)) { + current = parent; + parent = parent.parent; + } + if ((isForOfStatement(parent) || isForInStatement(parent)) && parent.initializer === current) return true; + return current !== node && isBinaryExpression(parent) && parent.left === current && parent.operatorToken.kind === SyntaxKind.EqualsToken; + } + + /** `x` / `(x as string)` → the identifier under parens / `as`. */ + rustR13PeelCast(node): any { + let current: any = node; + while (current !== undefined && (isParenthesizedExpression(current) || isAsExpression(current))) current = current.expression; + return current; + } + + /** Printed text of an operand that is always `Value::Str` / `Value::Null`, else undefined: + * a proven-`Str` local, a checker-`string` declared local/param (the R06 needle rule), or + * `"lit" + e` / `e + "lit"` (the `add` helper's string branch always yields `Value::Str`). */ + rustR13StrOperand(node, allowChecker: boolean): string | undefined { + const inner = this.rustR13PeelCast(node); + if (inner === undefined) return undefined; + if (isIdentifier(inner)) { + if (this.rustStringLocalIdentifierIsTyped(inner)) return undefined; + const proven = this.rustR13ProvenStrIdentifier(inner); + const checked = allowChecker && this.isDeclaredValueIdentifier(inner) + && this.primitiveKindOfType(this.typeOfNodeIfAny(inner)) === 'string'; + if (!proven && !checked) return undefined; + const text = this.printNode(inner, 0).trim(); + return /^[A-Za-z_][A-Za-z0-9_]*$/.test(text) ? text : undefined; + } + if (allowChecker && isBinaryExpression(inner) && inner.operatorToken.kind === SyntaxKind.PlusToken + && (isStringLiteral(inner.left) || isStringLiteral(inner.right))) { + const text = this.printNode(inner, 0).trim(); + return text.includes('\n') ? undefined : `(${text})`; + } + return undefined; + } + + // `a === b` with both sides proven `Str`/`Null`: `is_equal` is exactly the derived `PartialEq` + // there (Null==Null, Str by content, Str vs Null false — its f64 fallback needs a number). + printRustR13ProvenStrEquality(left, right, op): string | undefined { + if (!this.rustR13ProvenStrIdentifier(this.unwrapParensNode(left)) || !this.rustR13ProvenStrIdentifier(this.unwrapParensNode(right))) return undefined; + const operator = (op === SyntaxKind.EqualsEqualsToken || op === SyntaxKind.EqualsEqualsEqualsToken) ? '==' : '!='; + return `${this.printNode(left, 0)} ${operator} ${this.printNode(right, 0)}`; + } + + /** Receiver text when the call's receiver is a proven-`Str` local (R06 covers checker strings). */ + rustR13Receiver(node, receiverText: string): string | undefined { + if (node === undefined || !isCallExpression(node) || !isPropertyAccessExpression(node.expression)) return undefined; + const receiver = this.rustR13PeelCast(node.expression.expression); + if (!this.rustR13ProvenStrIdentifier(receiver)) return undefined; + const text = (receiverText ?? '').trim(); + return /^[A-Za-z_][A-Za-z0-9_]*$/.test(text) ? text : undefined; + } + + /** R06's checker-string receiver, when it prints as a bare name (it is read twice). */ + rustR13PlainReceiver(node, receiverText: string): string | undefined { + const receiver = this.rustNativeStringReceiver(node, receiverText); + return receiver !== undefined && /^[A-Za-z_][A-Za-z0-9_]*$/.test(receiver) ? receiver : undefined; + } + + // `s.replace(p, "lit")`: the helper replaces every occurrence when all three are `Str`, else + // returns the receiver; `p` is a proven/checker string operand. + printRustR13Replace(node, receiverText: string): string | undefined { + if (node?.arguments?.length !== 2) return undefined; + const receiver = this.rustR13Receiver(node, receiverText) ?? this.rustR13PlainReceiver(node, receiverText); + const to = this.rustNativeStringLiteralArg(node.arguments[1]); + if (receiver === undefined || to === undefined || this.rustNativeStringLiteralArg(node.arguments[0]) !== undefined) return undefined; + const from = this.rustR13StrOperand(node.arguments[0], true); + if (from === undefined) return undefined; + return `${receiver}.as_str().zip(${from}.as_str()).map(|(__s, __p)| Value::Str(__s.replace(__p, "${to}").into())).unwrap_or_else(|| ${receiver}.clone())`; + } + + // `s.split(d)` with a proven/checker string delimiter: the parts, `[]` unless both are `Str`. + printRustR13Split(node, receiverText: string): string | undefined { + if (node?.arguments?.length !== 1 || this.rustNativeStringLiteralArg(node.arguments[0]) !== undefined) return undefined; + const receiver = this.rustR13Receiver(node, receiverText) ?? this.rustR13PlainReceiver(node, receiverText); + const delim = receiver === undefined ? undefined : this.rustR13StrOperand(node.arguments[0], true); + if (delim === undefined) return undefined; + return `Value::Array(${receiver}.as_str().zip(${delim}.as_str()).map(|(__s, __d)| __s.split(__d).map(|__p| Value::Str(__p.to_string().into())).collect()).unwrap_or_default())`; + } + + // `x.toString()` on a proven-`Str` local: `stringify_simple` of `Str`/`Null` is `Display`. + printRustR13ToString(node, receiverText: string): string | undefined { + const receiver = this.rustR13Receiver(node, receiverText); + return receiver === undefined || (node.arguments?.length ?? 0) !== 0 ? undefined : `Value::Str(format!("{}", ${receiver}).into())`; + } + + // `x.toUpperCase()` / `x.toLowerCase()` on a proven-`Str` local (any TS type). + printRustR13Case(node, receiverText: string, method: string): string | undefined { + const receiver = this.rustR13Receiver(node, receiverText); + return receiver === undefined || (node.arguments?.length ?? 0) !== 0 ? undefined : `${receiver}.as_str().map(|__s| Value::Str(__s.${method}().into())).unwrap_or(Value::Null)`; + } + + // hx4 R14 — the R12 plain-dict proof reaches overloaded base readers (`safeDict` declares + // bodiless overload signatures; the implementation in the same class is what runs). + + /** A bodiless overload signature whose class also holds the bodied implementation. */ + r14BaseOverload(declaration: any): boolean { + if (declaration?.kind !== SyntaxKind.MethodDeclaration || declaration.body !== undefined || !isIdentifier(declaration.name)) return false; + const name = String(declaration.name.text); + return (declaration.parent?.members ?? []).some((m: any) => m.kind === SyntaxKind.MethodDeclaration + && m.body !== undefined && isIdentifier(m.name) && String(m.name.text) === name); + } + + /** `x[a ± b]` on a checker-proven list, each operand a numeric literal, a `Value` loop + * counter or a `const n = y.length` local: the key prints as a `Value` number, so the + * list arm of `get_value` (Int index, else miss) is spelled natively. */ + r14ListArithIndex(receiverText: string, receiverNode: Node, keyNode: Node): string | undefined { + const key: any = this.rustSkipWrappers(keyNode); + if (!this.isProvenListExpression(receiverNode) || key === undefined || !isBinaryExpression(key) + || (key.operatorToken.kind !== SyntaxKind.MinusToken && key.operatorToken.kind !== SyntaxKind.PlusToken) + || !this.r14ValueNumberOperand(key.left) || !this.r14ValueNumberOperand(key.right)) return undefined; + if (this.isWriteBackBindRead(keyNode.parent)) return undefined; + const keyText = this.printNode(keyNode, 0).trim(); + if (!keyText || keyText.startsWith('&')) return undefined; + return `${receiverText}.as_array().and_then(|__arr| match &(${keyText}) { Value::Int(__n) if *__n >= 0 => __arr.get(*__n as usize), _ => None }).cloned().unwrap_or(Value::Null)`; + } + + r14ValueNumberOperand(node: any): boolean { + const operand: any = this.rustSkipWrappers(node); + if (operand === undefined) return false; + if (isNumericLiteral(operand)) return Number.isInteger(Number(operand.text)); + if (!isIdentifier(operand)) return false; + if (this.isRustValueIndexKey(operand)) return true; + if (this.rustParamShadowOf(operand) !== undefined || this.rustStringLocalIdentifierIsTyped(operand)) return false; + const declaration: any = this.rustDeclarationOfIdentifier(operand); + if (declaration === undefined || !isVariableDeclaration(declaration) || (declaration.parent?.flags & NodeFlags.Const) === 0) return false; + const init: any = this.rustSkipWrappers(declaration.initializer); + return init !== undefined && isPropertyAccessExpression(init) && String(init.name.text) === 'length'; + } + + // hx4 R15 — `Vec` locals also admit `x.join("lit")` on a `string[]` (native join of the + // elements' Display text, as the helper's `stringify_simple` prints `Str`/`Null`) and an + // object-literal property value no push follows (boxed `Value::from(x.clone())`). + r15VecJoinUse(access): boolean { + const call: any = access.parent; + if (!isCallExpression(call) || call.expression !== access || String(access.name.text) !== 'join' || call.arguments.length !== 1) return false; + if (this.rustNativeStringLiteralArg(call.arguments[0]) === undefined) return false; + const checker: any = this.checkerOrUndefined(); + const type: any = checker?.getTypeAtLocation(access.expression); + if (type === undefined || !checker.isArrayType(type)) return false; + return this.primitiveKindOfType(checker.getTypeArguments?.(type)?.[0]) === 'string'; + } + + r15PrintVecJoin(node): string | undefined { + const access: any = node?.expression; + if (!isPropertyAccessExpression(access) || !isIdentifier(access.expression) + || this.rustVecLocalDeclarationOf(access.expression) === undefined || !this.r15VecJoinUse(access)) return undefined; + const literal = this.rustNativeStringLiteralArg(node.arguments[0]); + const name = this.printNode(access.expression, 0).trim(); + return `Value::Str(${name}.iter().map(|__v| __v.to_string()).collect::>().join("${literal}").into())`; + } + + // `{ 'k': x }` with `x` named once in the statement, outside any loop the declaration is not in, + // and no `x.push` after it: the clone is the array's final contents, as the aliased box was. + r15VecPropertyUse(n): boolean { + const parent: any = n.parent; + if (parent?.kind !== SyntaxKind.PropertyAssignment || parent.initializer !== n || this.r11LoopBetween(n)) return false; + const name = String(n.text); + let statement: any = parent; + while (statement !== undefined && !isStatement(statement)) statement = statement.parent; + if (statement === undefined) return false; + let count = 0; + const visit = (m) => { if (m.kind === SyntaxKind.Identifier && m.text === name) count++; m.forEachChild?.(visit); }; + visit(statement); + if (count !== 1) return false; + const fn = this.rustEnclosingFunction(n); + const end = n.getEnd?.() ?? n.end; + return !(this.rustScopeNameNodes(fn, name) as any[]).some((m) => m.kind === SyntaxKind.Identifier && m !== n + && (m.getStart?.() ?? m.pos) >= end && isPropertyAccessExpression(m.parent) && m.parent.expression === m + && String(m.parent.name.text) === 'push'); + } + // hx4 R16 — numeric operand kinds beyond the checker: 'definite' = always Int/Float (never Null), + // 'number' = Int/Float/Null. Covers `this.sum` of numbers, numeric same-file method returns, + // locals whose every write is numeric, and flow-narrowed (guarded non-undefined) number identifiers. + private rustR16InProgress = new Set(); + private rustR16Assumed = new Set(); + + rustR16NumericKind(node, depth = 0): string | undefined { + const inner: any = this.rustStripWrappers(node); + if (inner === undefined || depth > 8) return undefined; + if (this.rustR16InProgress.has(inner)) return this.r22AssumedNumericSelf(inner); + this.rustR16InProgress.add(inner); + try { + const structural = this.rustR16StructuralKind(inner, depth); + if (structural === 'definite') return 'definite'; + if (structural === 'number') return 'number'; + return this.rustOperandKind(inner) === 'number' ? 'number' : undefined; + } catch (e) { + return undefined; + } finally { + this.rustR16InProgress.delete(inner); + } + } + + rustR16Combine(kinds: (string | undefined)[]): string | undefined { + if (kinds.length === 0 || kinds.some((k) => k === undefined)) return undefined; + return kinds.every((k) => k === 'definite') ? 'definite' : 'number'; + } + + rustR16StructuralKind(inner: any, depth: number): string | undefined { + if (inner.kind === SyntaxKind.NumericLiteral) return 'definite'; + if (isPrefixUnaryExpression(inner) && inner.operator === SyntaxKind.MinusToken && inner.operand.kind === SyntaxKind.NumericLiteral) return 'definite'; + if (this.rustR09IsDefiniteInt(inner)) return 'definite'; + if (isCallExpression(inner) && this.callExpressionName(inner) === 'indexOf') return 'definite'; + if (isBinaryExpression(inner)) { + const op = inner.operatorToken.kind; + if (op !== SyntaxKind.PlusToken && op !== SyntaxKind.MinusToken && op !== SyntaxKind.AsteriskToken + && op !== SyntaxKind.SlashToken && op !== SyntaxKind.PercentToken) return undefined; + const both = this.rustR16Combine([ this.rustR16NumericKind(inner.left, depth + 1), this.rustR16NumericKind(inner.right, depth + 1) ]); + // `/` and `%` answer Null for a zero divisor + return (both === 'definite' && (op === SyntaxKind.SlashToken || op === SyntaxKind.PercentToken)) ? 'number' : both; + } + if (isCallExpression(inner)) return this.rustR16CallKind(inner, depth); + if (isIdentifier(inner)) return this.rustR16IdentifierKind(inner, depth); + return undefined; + } + + rustR16CallKind(call: any, depth: number): string | undefined { + const callee = call.expression; + if (!isPropertyAccessExpression(callee) || callee.expression.kind !== SyntaxKind.ThisKeyword) return undefined; + if (String(callee.name.text) === 'sum') { + return this.rustR16Combine(call.arguments.map((a) => this.rustR16NumericKind(a, depth + 1))); + } + let declaration: any; + try { + declaration = signatureDeclaration((this.getChecker() as any).getResolvedSignature(call)); + } catch (e) { + return undefined; + } + if (declaration?.kind !== SyntaxKind.MethodDeclaration || declaration.body === undefined + || declaration.getSourceFile() !== call.getSourceFile()) return undefined; + const kinds: (string | undefined)[] = []; + const visit = (n: any) => { + if (n !== declaration && isFunctionLike(n)) return; + if (isReturnStatement(n)) kinds.push(n.expression === undefined ? undefined : this.rustR16NumericKind(n.expression, depth + 1)); + n.forEachChild?.(visit); + }; + declaration.body.forEachChild(visit); + return this.rustR16Combine(kinds) === undefined ? undefined : 'number'; + } + + rustR16IdentifierKind(ident: any, depth: number): string | undefined { + if (this.rustParamShadowOf(ident) !== undefined || !this.printsValueExpression(ident)) return undefined; + const declaration: any = this.rustSingleLocalDeclaration(ident); + if (declaration === undefined || declaration.name?.kind !== SyntaxKind.Identifier) return undefined; + // a guard removed `undefined` from a nullable declaration: the box is Int/Float here + const here: any = this.typeOfNodeIfAny(ident); + const declared: any = this.typeOfNodeIfAny(declaration.name); + if (here !== undefined && declared !== undefined && (here.flags === TypeFlags.Number || here.flags === TypeFlags.NumberLiteral) + && (declared.flags & TypeFlags.Union) && (typeParts(declared) ?? []).some((t: any) => t.flags & (TypeFlags.Undefined | TypeFlags.Null)) + && !this.rustR16HasWrites(declaration)) { + return 'definite'; + } + // an explicit annotation (`let a: any = 1`) declares a polymorphic box: keep the helper + if (!isVariableDeclaration(declaration) || declaration.initializer === undefined || declaration.type !== undefined) return undefined; + // inductive: a write reading the local itself (`r = this.sum (r, n)`) assumes it numeric + if (this.rustR16Assumed.has(declaration)) return 'number'; + this.rustR16Assumed.add(declaration); + try { + return this.rustR16WrittenKind(declaration, depth); + } finally { + this.rustR16Assumed.delete(declaration); + } + } + + rustR16WrittenKind(declaration: any, depth: number): string | undefined { + const kinds: (string | undefined)[] = [ this.rustR16NumericKind(declaration.initializer, depth + 1) ]; + const fn = this.rustEnclosingFunction(declaration); + if (fn === undefined) return undefined; + const name = String(declaration.name.text); + for (const m of this.rustScopeNameNodes(fn, name) as any[]) { + if (m.kind !== SyntaxKind.Identifier || m === declaration.name) continue; + const parent: any = m.parent; + if (isBinaryExpression(parent) && parent.left === m && rustIsAssignmentOperator(parent.operatorToken.kind)) { + const op = parent.operatorToken.kind; + const right = this.rustR16NumericKind(parent.right, depth + 1); + if (op === SyntaxKind.EqualsToken || op === SyntaxKind.PlusEqualsToken || op === SyntaxKind.MinusEqualsToken || op === SyntaxKind.AsteriskEqualsToken) kinds.push(right); + else if (op === SyntaxKind.SlashEqualsToken || op === SyntaxKind.PercentEqualsToken) kinds.push(right === undefined ? undefined : 'number'); + else kinds.push(undefined); + } else if ((parent?.kind === SyntaxKind.PrefixUnaryExpression || parent?.kind === SyntaxKind.PostfixUnaryExpression) + && (parent.operator === SyntaxKind.PlusPlusToken || parent.operator === SyntaxKind.MinusMinusToken)) { + continue; + } else if (parent !== undefined && ((isArrayLiteralExpression(parent) && isBinaryExpression(parent.parent) && parent.parent.left === parent) + || ((isForOfStatement(parent) || isForInStatement(parent)) && parent.initializer === m))) { + kinds.push(undefined); + } + } + return this.rustR16Combine(kinds); + } + + // No assignment / `++` / `--` names the binding: only control-flow guards narrow it. + rustR16HasWrites(declaration: any): boolean { + const fn = isParameterDeclaration(declaration) ? declaration.parent : this.rustEnclosingFunction(declaration); + if (fn === undefined) return true; + return (this.rustScopeNameNodes(fn, String(declaration.name.text)) as any[]).some((m) => { + const parent: any = m.parent; + if (m.kind !== SyntaxKind.Identifier || m === declaration.name) return false; + return (isBinaryExpression(parent) && parent.left === m && rustIsAssignmentOperator(parent.operatorToken.kind)) + || parent?.kind === SyntaxKind.PrefixUnaryExpression && (parent.operator === SyntaxKind.PlusPlusToken || parent.operator === SyntaxKind.MinusMinusToken) + || parent?.kind === SyntaxKind.PostfixUnaryExpression; + }); + } + + // Both sides Int/Float/Null: `<`/`>` are f64 compares with Null false; `<=`/`>=` also OR in + // `is_equal` (Null == Null), so they need one never-null side. + rustR16OrderedProven(op, left, right): boolean { + const l = this.rustR16NumericKind(left); + const r = this.rustR16NumericKind(right); + if (l === undefined || r === undefined) return false; + return op === SyntaxKind.LessThanToken || op === SyntaxKind.GreaterThanToken || l === 'definite' || r === 'definite'; + } + + // `a - b` / `a * b` / `a / b` / `a % b` on operands proven Int/Float/Null: the helper's dispatch. + rustR16NativeArithmetic(op, left, right, leftText: string, rightText: string): string | undefined { + if (op !== SyntaxKind.MinusToken && op !== SyntaxKind.AsteriskToken && op !== SyntaxKind.SlashToken && op !== SyntaxKind.PercentToken) return undefined; + if (!this.printsValueExpression(this.rustStripWrappers(left)) || !this.printsValueExpression(this.rustStripWrappers(right))) return undefined; + if (this.rustR16NumericKind(left) === undefined || this.rustR16NumericKind(right) === undefined) return undefined; + if (op !== SyntaxKind.PercentToken) return this.printNativeNumeric(op, leftText, rightText); + return `(match (&(${leftText}), &(${rightText})) {` + + ' (Value::Int(x), Value::Int(y)) if *y != 0 => Value::Int(x % y),' + + ' (Value::Int(x), Value::Float(y)) if *y != 0.0 => Value::Float(*x as f64 % *y),' + + ' (Value::Float(x), Value::Int(y)) if *y != 0 => Value::Float(*x % *y as f64),' + + ' (Value::Float(x), Value::Float(y)) if *y != 0.0 => Value::Float(x % y),' + + ' _ => Value::Null })'; + } + + // hx4 R17 — string helpers on proven-`Str` operands. `add(a, b)` with one side always a + // `Value::Str` takes the helper's `string_concat` arm, which is `Display` for every box but a + // Precise dict (only `new Precise` locals, typed `Precise`), so the other side may be any non-Precise box. + r17AlwaysStr(node): boolean { + const inner: any = this.unwrapParensNode(node); + if (inner === undefined) return false; + if (isStringLiteral(inner) || isNoSubstitutionTemplateLiteral(inner)) return true; + if (isBinaryExpression(inner) && inner.operatorToken.kind === SyntaxKind.PlusToken) return this.r17AlwaysStr(inner.left) || this.r17AlwaysStr(inner.right); + return isCallExpression(inner) && isPropertyAccessExpression(inner.expression) && inner.expression.name.text === 'toString' + && (inner.arguments?.length ?? 0) === 0 && this.printsValueExpression(inner.expression.expression); + } + + r17ConcatOperandSafe(node, type): boolean { + if (this.r17AlwaysStr(node)) return true; + const inner: any = this.unwrapParensNode(node); + if (!this.printsValueExpression(inner) || this.rustNativeStrCalleeKind(inner) === 'str') return false; + // typed `String`/`Vec` locals print without a `Value` box + if (isIdentifier(inner) && (this.rustStringLocalIdentifierIsTyped(inner) || this.rustVecLocalDeclarationOf(inner) !== undefined)) return false; + const parts: any[] = type === undefined ? [] : ((type.flags & TypeFlags.Union) ? (typeParts(type) ?? []) : [type]); + return parts.length > 0 && parts.every((t) => String(t?.symbol?.escapedName ?? t?.symbol?.name ?? '') !== 'Precise'); + } + + r17ConcatIsAnchored(left, right, leftType, rightType): boolean { + return (this.r17AlwaysStr(left) && this.r17ConcatOperandSafe(right, rightType)) + || (this.r17AlwaysStr(right) && this.r17ConcatOperandSafe(left, leftType)); + } + + /** R06 checker-string or R13 proven-`Str` receiver printed as a plain name / parenthesised. */ + r17Receiver(node, receiverText: string): string | undefined { + return this.rustNativeStringReceiver(node, receiverText) ?? this.rustR13Receiver(node, receiverText); + } + + // `x.trim()`: the helper's `Str` arm is `str::trim`, Null otherwise. + r17PrintTrim(node, receiverText: string): string | undefined { + const receiver = this.r17Receiver(node, receiverText); + if (receiver === undefined || (node.arguments?.length ?? 0) !== 0) return undefined; + return `${receiver}.as_str().map(|__s| Value::Str(__s.trim().to_string().into())).unwrap_or(Value::Null)`; + } + + // `x.startsWith(p)` / `x.endsWith(p)` with a proven/checker string operand: false unless both are `Str`. + r17PrintAffixTest(node, receiverText: string, method: string): string | undefined { + if (node?.arguments?.length !== 1) return undefined; + const receiver = this.r17Receiver(node, receiverText); + const arg = receiver === undefined ? undefined : this.rustR13StrOperand(node.arguments[0], true); + if (arg === undefined) return undefined; + return `${receiver}.as_str().zip(${arg}.as_str()).is_some_and(|(__s, __p)| __s.${method}(__p))`; + } + + // `x.replace(p, r)` / `x.replaceAll(p, r)`: both helpers replace every occurrence when all three + // are `Str`, else return the receiver; `p`/`r` are literals or proven/checker string operands. + r17PrintReplace(node, receiverText: string): string | undefined { + if (node?.arguments?.length !== 2) return undefined; + const receiver = this.r17Receiver(node, receiverText); + if (receiver === undefined || !/^[A-Za-z_][A-Za-z0-9_.]*$/.test(receiver)) return undefined; + const operand = (arg) => { + const literal = this.rustNativeStringLiteralArg(arg); + return literal !== undefined ? `Value::Str("${literal}".into())` : this.rustR13StrOperand(arg, true); + }; + const from = operand(node.arguments[0]); + const to = operand(node.arguments[1]); + if (from === undefined || to === undefined) return undefined; + return `match (${receiver}.as_str(), ${from}.as_str(), ${to}.as_str()) { (Some(__s), Some(__p), Some(__r)) => Value::Str(__s.replace(__p, __r).into()), _ => ${receiver}.clone() }`; + } + + // hx4 R18 — collection helpers on locals whose runtime shape is proven: `"k" in x` on an R10 + // plain-dict receiver, `Object.keys/values` on one in prediction sources, and `.length` / + // `.push` on a `Value::Arr`-only local (never a book/cache marker the helpers route). + + /** `"lit" in x` where x is an R10-proven plain local / plain-kept Dict parameter. */ + r18LiteralInOp(key, obj): string | undefined { + if (!isStringLiteral(key) || this.r05IsTest(key)) return undefined; + const recv: any = this.rustStripWrappers(obj); + if (recv === undefined || !isIdentifier(recv) || this.rustR10PlainReceiver(recv) === undefined) return undefined; + const keyLiteral = this.rustStringLiteralOf(this.printStringLiteral(key)); + if (keyLiteral === undefined) return undefined; + return `Value::Bool(matches!(&${this.printNode(recv, 0).trim()}, Value::Dict(__d) if __d.contains_key(${keyLiteral})))`; + } + + /** `Object.keys/values(x)` in `ts/src/prediction/.ts` on an R10-proven plain local. */ + r18PredictionEnum(node, parsedArg: string | undefined, kind: 'keys' | 'values'): string | undefined { + const arg: any = this.rustStripWrappers(node?.arguments?.[0]); + if (arg === undefined || parsedArg === undefined || !isIdentifier(arg) + || !/\/ts\/src\/prediction\/[^/]+\.ts$/.test(this.r05Path(node)) + || this.rustR10PlainReceiver(arg) !== 'local') return undefined; + const body = kind === 'keys' ? '__m.keys().map(|__k| Value::Str(__k.clone().into())).collect()' : '__m.values().cloned().collect()'; + return `Value::Array(${parsedArg.trim()}.as_map().map(|__m| ${body}).unwrap_or_default())`; + } + + /** Base-tier array readers whose result is the stored `Value::Arr` or the default argument. */ + private static readonly RUST_R18_LIST_READERS: { [name: string]: number } = { safeList: 2, safeList2: 3, safeListN: 2 }; + + /** A source that is a `Value::Arr` or `Value::Null` (both helpers agree with `len()` / a no-op + * push there): `[...]`, nullish, a runtime `split`, base `toArray`, or a base `safeList*` + * read whose default is absent, nullish or `[...]`. */ + r18ArrSource(node: any, allowNull: boolean): boolean { + const n: any = this.rustStripWrappers(node); + if (n === undefined) return false; + if (this.r21ArrSource(n)) return true; + if (isArrayLiteralExpression(n)) return !n.elements.some((e: any) => e.kind === SyntaxKind.SpreadElement); + if (n.kind === SyntaxKind.NullKeyword || (isIdentifier(n) && String(n.text) === 'undefined')) return allowNull; + if (this.rustCallPrintsRuntimeSplit(n)) return true; + if (!isCallExpression(n) || !isPropertyAccessExpression(n.expression) || n.expression.expression.kind !== SyntaxKind.ThisKeyword) return false; + const callee = String(n.expression.name.text); + if (callee === 'toArray') return n.arguments.length === 1 && this.rustR01CalleeIsBase(n); + const index = RustTranspiler.RUST_R18_LIST_READERS[callee]; + if (index === undefined || n.arguments.length > index + 1) return false; + const fallback: any = this.rustStripWrappers(n.arguments[index]); + const arrDefault = fallback !== undefined && isArrayLiteralExpression(fallback); + return (arrDefault || (allowNull && (fallback === undefined || fallback.kind === SyntaxKind.NullKeyword + || (isIdentifier(fallback) && String(fallback.text) === 'undefined')))) && this.rustR01CalleeIsBase(n); + } + + /** A local whose every write (declaration included) is an `r18ArrSource`, never captured by + * a closure: its `Value` is a plain `Value::Arr` (the runtime never tags an array). */ + r18ArrLocal(ident: any, allowNull: boolean): boolean { + if (ident === undefined || !isIdentifier(ident) || this.rustParamShadowOf(ident) !== undefined || this.r05IsTest(ident)) return false; + const declaration: any = this.rustSingleLocalDeclaration(ident); + if (declaration === undefined || !isVariableDeclaration(declaration) || !isIdentifier(declaration.name) + || !this.r18ArrSource(declaration.initializer, allowNull)) return false; + const scope = this.rustEnclosingFunction(declaration); + if (scope === undefined || isSourceFile(scope) || this.rustEnclosingFunction(ident) !== scope) return false; + const name = String(declaration.name.text); + const symbol = this.rustSymbolOf(declaration.name); + if (symbol === undefined) return false; + for (const n of this.rustScopeNameNodes(scope, name) as any[]) { + if (n.kind !== SyntaxKind.Identifier || n === declaration.name || this.rustSymbolOf(n) !== symbol) continue; + if (this.rustEnclosingFunction(n) !== scope) return false; + let target: any = n; + while (target.parent !== undefined && (isParenthesizedExpression(target.parent) || isNonNullExpression(target.parent) || isAsExpression(target.parent))) target = target.parent; + const parent: any = target.parent; + if (parent === undefined) continue; + // a dict-literal field aliasing the local feeds ccxt's writeBackAliasedArrayMutations (keys on the helper) + if (parent.kind === SyntaxKind.ShorthandPropertyAssignment || (parent.kind === SyntaxKind.PropertyAssignment && parent.initializer === target)) return false; + if (isBinaryExpression(parent) && parent.left === target && rustIsAssignmentOperator(parent.operatorToken.kind)) { + if (parent.operatorToken.kind !== SyntaxKind.EqualsToken || !this.r18ArrSource(parent.right, allowNull)) return false; + continue; + } + if (parent.kind === SyntaxKind.ArrayLiteralExpression && isBinaryExpression(parent.parent) && parent.parent.left === parent) return false; + if ((parent.kind === SyntaxKind.PrefixUnaryExpression || parent.kind === SyntaxKind.PostfixUnaryExpression) + && (parent.operator === SyntaxKind.PlusPlusToken || parent.operator === SyntaxKind.MinusMinusToken)) return false; + } + return true; + } + + /** `x.length` on an Arr-only local: `get_array_length`'s marker arms need a Dict. */ + r18ArrLength(node, receiver: string): string | undefined { + const recv: any = this.rustStripWrappers(node?.expression); + if (!this.r18ArrLocal(recv, true)) return undefined; + return `Value::Int(${receiver}.len() as i64)`; + } + + /** `x.push(v)` statement on an Arr-only local: `append_to_array`'s cache-push arm needs a Dict. */ + r18ArrPush(node, name: string | undefined, parsedArg: string | undefined): string | undefined { + const recv: any = node?.expression?.expression; + if (name === undefined || parsedArg === undefined || node?.arguments?.length !== 1 + || node.arguments[0].kind === SyntaxKind.SpreadElement || node.parent?.kind !== SyntaxKind.ExpressionStatement + || !this.r18ArrLocal(recv, false) || name.trim() !== this.printNode(recv, 0).trim()) return undefined; + // the argument is evaluated while `name` is mutably borrowed: it must not read it + if (!this.rustVecPushShape(node, String(recv.text))) return undefined; + const arg = parsedArg.trim(); + // `append_to_array` takes the value by move; ccxt's post-pass cloned a bare local there. + const value = /^[a-zA-Z_][a-zA-Z0-9_]*$/.test(arg) && arg !== 'self' && arg !== 'true' && arg !== 'false' ? `${arg}.clone()` : arg; + return `if let Value::Arr(__a) = &mut ${name} { std::sync::Arc::make_mut(__a).push(${value}); }`; + } + + // hx4 R20 — `startsWith/endsWith(..) === true|false` compares the runtime fn's bare bool + // (is_equal of two Bool boxes is the payload compare); `a + b` on R16 numeric kinds is the + // `add` helper's Int/Float/Null dispatch, the same native match as `-`/`*`. + r20BoolCallEquality(left, right, op): string | undefined { + const l: any = this.unwrapParensNode(left); + const r: any = this.unwrapParensNode(right); + const isBoolLit = (n: any) => n?.kind === SyntaxKind.TrueKeyword || n?.kind === SyntaxKind.FalseKeyword; + if (isBoolLit(l) === isBoolLit(r)) return undefined; + const literal: any = isBoolLit(l) ? l : r; + const call: any = isBoolLit(l) ? r : l; + if (!isCallExpression(call) || !isPropertyAccessExpression(call.expression)) return undefined; + const name = String(call.expression.name.text); + if ((name !== 'startsWith' && name !== 'endsWith') || call.arguments.length !== 1) return undefined; + const text = this.printNode(call, 0).trim(); + const fn = name === 'startsWith' ? 'starts_with' : 'ends_with'; + const m = /^Value::Bool\((.*)\)$/s.exec(text); + if (m === null || !m[1].startsWith(`${fn}(`) || !this.r20Balanced(m[1]) || text.includes('\n')) return undefined; + const equals = op === SyntaxKind.EqualsEqualsToken || op === SyntaxKind.EqualsEqualsEqualsToken; + return (literal.kind === SyntaxKind.TrueKeyword) === equals ? m[1] : `!${m[1]}`; + } + + /** `fn(...)` whose first `(` closes at the very end (string literals skipped). */ + r20Balanced(text: string): boolean { + let depth = 0; + for (let i = 0; i < text.length; i++) { + const c = text[i]; + if (c === '"') { for (i++; i < text.length && text[i] !== '"'; i++) if (text[i] === '\\') i++; continue; } + if (c === '(') depth++; + else if (c === ')') { depth--; if (depth === 0 && i !== text.length - 1) return false; } + } + return depth === 0 && text.endsWith(')'); + } + + r20NativeNumericAdd(op, left, right, leftText: string, rightText: string): string | undefined { + if (op !== SyntaxKind.PlusToken) return undefined; + if (!this.printsValueExpression(this.rustStripWrappers(left)) || !this.printsValueExpression(this.rustStripWrappers(right))) return undefined; + if (this.rustR16NumericKind(left) === undefined || this.rustR16NumericKind(right) === undefined) return undefined; + return this.printNativeNumeric(op, leftText, rightText); + } + + // hx4 R21 — `Object.keys/values` on an R10-proven plain local in the base tier (the + // helper's ws-tag filter is a no-op on a map built from literals), and native map reads + // that are the receiver of a non-mutating string method (`currency['id'].toUpperCase ()`). + + /** Base-tier (`ts/src/base/**`) `Object.keys/values(x)` on an R10-proven plain local. */ + r21BaseEnum(node, parsedArg: string | undefined, kind: 'keys' | 'values'): string | undefined { + const arg: any = this.rustStripWrappers(node?.arguments?.[0]); + if (arg === undefined || parsedArg === undefined || !isIdentifier(arg) + || !RustTranspiler.RUST_BASE_TIER_FILE.test(this.r05Path(node)) + || this.rustR10PlainReceiver(arg) !== 'local') return undefined; + const body = kind === 'keys' ? '__m.keys().map(|__k| Value::Str(__k.clone().into())).collect()' : '__m.values().cloned().collect()'; + return `Value::Array(${parsedArg.trim()}.as_map().map(|__m| ${body}).unwrap_or_default())`; + } + + private static readonly RUST_R21_PURE_STRING_METHODS = new Set([ 'toUpperCase', 'toLowerCase', 'trim', 'startsWith', 'endsWith', 'split' ]); + + /** `x['k'].m (…)` with `m` a non-mutating string method on a checker-`string` read: no + * ccxt pass rewrites that target (only `.push` / calls of the read itself). */ + r21PureStringMethodReceiver(node: any): boolean { + const access: any = node?.parent; + const call: any = access?.parent; + if (!isElementAccessExpression(node) || access === undefined || !isPropertyAccessExpression(access) || access.expression !== node + || call === undefined || !isCallExpression(call) || call.expression !== access + || !RustTranspiler.RUST_R21_PURE_STRING_METHODS.has(String(access.name.text))) return false; + const type = this.typeOfNodeIfAny(node); + return type !== undefined && (type.flags & TypeFlags.StringLike) !== 0; + } + + /** Locals whose Arr-only proof is in progress (a self-referencing write proves nothing new). */ + private r21ArrVisiting = new Set(); + + /** More always-`Value::Arr` sources for the R18 proof: base `arrayConcat` (Array on every + * arm), base `sortBy`/`sortBy2` of an Arr-only local (returns its input's variant), and a + * plain alias of a non-nullable Arr-only local (COW: the push never reaches the alias). */ + r21ArrSource(n: any): boolean { + if (isCallExpression(n) && isPropertyAccessExpression(n.expression) && n.expression.expression.kind === SyntaxKind.ThisKeyword) { + const callee = String(n.expression.name.text); + if (callee === 'arrayConcat') return n.arguments.length === 2 && this.rustR01CalleeIsBase(n); + if (callee === 'sortBy' || callee === 'sortBy2') { + const first: any = this.rustStripWrappers(n.arguments[0]); + return first !== undefined && isIdentifier(first) && this.rustR01CalleeIsBase(n) && this.r21ArrAlias(first); + } + return false; + } + return isIdentifier(n) && String(n.text) !== 'undefined' && this.r21ArrAlias(n); + } + + r21ArrAlias(ident: any): boolean { + const declaration: any = this.rustSingleLocalDeclaration(ident); + if (declaration === undefined || !isVariableDeclaration(declaration)) return false; + // the local under proof: its other writes decide + if (this.r21ArrVisiting.has(declaration)) return true; + this.r21ArrVisiting.add(declaration); + try { + return this.r18ArrLocal(ident, false); + } finally { + this.r21ArrVisiting.delete(declaration); + } + } + + // hx4 R22 — an R16 local re-read inside its own write (`p = p + 4`) is the assumed kind. + r22AssumedNumericSelf(inner: any): string | undefined { + if (!isIdentifier(inner)) return undefined; + const declaration: any = this.rustSingleLocalDeclaration(inner); + return declaration !== undefined && this.rustR16Assumed.has(declaration) ? 'number' : undefined; + } + + private r22StrVisiting = new Map(); + + /** Always `Value::Str`: R17 shapes, a `+` chain with such an operand, or an always-Str local. */ + r22AlwaysStr(node: any): boolean { + const inner: any = this.unwrapParensNode(node); + if (inner === undefined) return false; + if (this.r17AlwaysStr(inner)) return true; + if (isBinaryExpression(inner) && inner.operatorToken.kind === SyntaxKind.PlusToken) return this.r22AlwaysStr(inner.left) || this.r22AlwaysStr(inner.right); + return isIdentifier(inner) && this.r22AlwaysStrLocal(inner); + } + + /** A plain `Value` local, never captured by a closure, whose every write is always-Str (`x += e` + * keeps it), or Str|Null (R13 source / nullish) when the checker narrows this read to `string`. */ + r22AlwaysStrLocal(ident: any, allowNull = false): boolean { + if (this.rustParamShadowOf(ident) !== undefined || this.rustStringLocalIdentifierIsTyped(ident) || this.rustVecLocalDeclarationOf(ident) !== undefined) return false; + const declaration: any = this.rustSingleLocalDeclaration(ident); + if (declaration === undefined || !isVariableDeclaration(declaration) || !isIdentifier(declaration.name) || declaration.initializer === undefined) return false; + // inductive: a cycle back to a local under proof assumes that proof (strict covers lax) + if (this.r22StrVisiting.has(declaration)) return allowNull || this.r22StrVisiting.get(declaration) === false; + const fn = this.rustEnclosingFunction(declaration); + if (fn === undefined) return false; + const here: any = this.typeOfNodeIfAny(ident); + const narrowed = allowNull || (here !== undefined && this.isStringLikeType(here)); + const nullish = (e: any) => { const n: any = this.unwrapParensNode(e); return n?.kind === SyntaxKind.NullKeyword || (isIdentifier(n) && String(n.text) === 'undefined'); }; + const local = (e: any) => { const n: any = this.unwrapParensNode(e); return isIdentifier(n) && (this.rustR13ProvenStrIdentifier(n) || this.r22AlwaysStrLocal(n, true)); }; + const source = (e: any) => this.r22AlwaysStr(e) || (narrowed && (nullish(e) || this.rustR13ProvenStrSource(e) || local(e))); + this.r22StrVisiting.set(declaration, allowNull); + try { + if (!source(declaration.initializer)) return false; + return this.rustLocalUsesAll(declaration, String(declaration.name.text), true, (n: any) => { + if (this.rustEnclosingFunction(n) !== fn || this.rustR13WriteTarget(n)) return false; + const parent: any = n.parent; + if ((parent?.kind === SyntaxKind.PrefixUnaryExpression || parent?.kind === SyntaxKind.PostfixUnaryExpression) && parent.operator !== SyntaxKind.ExclamationToken) return false; + if (!isBinaryExpression(parent) || parent.left !== n || !rustIsAssignmentOperator(parent.operatorToken.kind)) return true; + const op = parent.operatorToken.kind; + return op === SyntaxKind.PlusEqualsToken || (op === SyntaxKind.EqualsToken && source(parent.right)); + }); + } finally { + this.r22StrVisiting.delete(declaration); + } + } + + r22ConcatAnchor(node: any): boolean { + const inner: any = this.unwrapParensNode(node); + return inner !== undefined && this.printsValueExpression(inner) && this.r22AlwaysStr(inner); + } + + r22ConcatIsAnchored(left, right, leftType, rightType): boolean { + return (this.r22ConcatAnchor(left) && this.r17ConcatOperandSafe(right, rightType)) + || (this.r22ConcatAnchor(right) && this.r17ConcatOperandSafe(left, leftType)); + } + + /** `Option<&str>` text of an operand that is always `Value::Str` / `Value::Null`, else undefined. */ + r22StrOrNullOperand(node: any): string | undefined { + const inner: any = this.rustStripWrappers(node); + if (inner === undefined) return undefined; + if (isStringLiteral(inner)) return inner.text in this.StringLiteralReplacements ? undefined : `Some(${this.quotedStringLiteral(inner.text)})`; + if (isIdentifier(inner) && this.r22AlwaysStrLocal(inner, true)) { + const text = this.printNode(inner, 0).trim(); + return /^[A-Za-z_][A-Za-z0-9_]*$/.test(text) ? `${text}.as_str()` : undefined; + } + const operand = this.rustR13StrOperand(inner, true); + return operand === undefined ? undefined : `${operand}.as_str()`; + } + + // `a < b` (`<=`, `>`, `>=`) on Str|Null operands: the helper's f64 parse of both strings, else + // `str` order; `<=`/`>=` OR in `is_equal` (string equality, Null == Null). + r22StrOrderedComparison(node, op, left, right): string | undefined { + const operator = RustTranspiler.NATIVE_COMPARISON_OPERATORS[op]; + const a = this.r22StrOrNullOperand(left); + const b = a === undefined ? undefined : this.r22StrOrNullOperand(right); + if (operator === undefined || b === undefined) return undefined; + const strict = operator.charAt(0); + const orEqual = operator.length === 2; + const order = `(match (__x.parse::(), __y.parse::()) { (Ok(__p), Ok(__q)) => __p ${strict} __q, _ => __x ${strict} __y })`; + const text = `(match (${a}, ${b}) { (Some(__x), Some(__y)) => ${order}${orEqual ? ' || __x == __y' : ''}, ${orEqual ? '(None, None) => true, ' : ''}_ => false })`; + return this.isBooleanPosition(node) ? text : `Value::Bool(${text})`; + } + + // hx4 R23 — the R12 plain sources (`safeDict*(x, k, {})`, same-file builders, `extend|omit`) + // also hold in the base tier and pro files, where a tagged handle can only arrive through a + // parameter: base admits typed plain-dict parameters, pro admits no parameter at all. + r23Tier(node: Node): 'rest' | 'base' | 'pro' | undefined { + const path = this.r05Path(node); + if (RustTranspiler.RUST_R12_REST_FILE.test(path) && /\/ts\/src\/[^/]+\.ts$/.test(path)) return 'rest'; + if (RustTranspiler.RUST_BASE_TIER_FILE.test(path) && !/\/base\/ws\//.test(path)) return 'base'; + if (/\/ts\/src\/pro\/[^/]+\.ts$/.test(path)) return 'pro'; + return undefined; + } + + r23PlainSourceTier(node: Node): boolean { + return this.r23Tier(node) !== undefined; + } + + /** A copied/read dict argument outside REST: in pro only `this.options` or a proven plain + * local; in base also a parameter annotated with a plain-dict type (no `any` caller handle). */ + r23TierSourceOk(arg: any): boolean { + const tier = this.r23Tier(arg); + if (tier === 'rest') return true; + const node: any = this.rustStripWrappers(arg); + if (node === undefined || !isIdentifier(node)) return true; + const declaration: any = this.rustSingleLocalDeclaration(node); + // pro: a local read source must itself be proven plain (its root may be a handler parameter) + if (tier === 'pro') return declaration !== undefined && !isParameterDeclaration(declaration) && this.rustR10PlainReceiver(node) === 'local'; + if (declaration === undefined || !isParameterDeclaration(declaration)) return true; + if (tier !== 'base' || declaration.type === undefined || declaration.dotDotDotToken !== undefined) return false; + const type = this.getCheckedTypeOf(declaration.type); + return type !== undefined && this.isProvenMapType(type) && !this.rustParameterIsClientHandle(declaration); + } + + /** `this.extend (plain, …unshared)` / `this.omit|keysort (plain, …)` called directly + * (not only as a builder's return): the same fresh-copy proof as `rustR12PlainReturn`. */ + private r23CopyVisiting = new Set(); + + r23FreshCopy(node: any, depth: number): boolean { + const callee = String(node.expression.name.text); + // the R01 -> R12 hop restarts `depth`: a copy reached again through its own local proves nothing + if ((callee !== 'extend' && callee !== 'omit' && callee !== 'keysort') || this.r23CopyVisiting.has(node)) return false; + this.r23CopyVisiting.add(node); + try { + return this.rustR12PlainReturn(node, depth); + } finally { + this.r23CopyVisiting.delete(node); + } + } + + // hx4 R25 — `a - b` / `a * b` / `a / b` and `a < b` (`<=`, `>`, `>=`) on unproven `Value`s print the + // helper's own dispatch inline (f64 coercion: Int/Float, Str parse, Bool 1/0; `<=`/`>=` OR in + // `is_equal`); `a + b` on two Str|Null operands (fields of same-file object literals) is `format!`. + r25LooseF64(binding: string): string { + return `(match ${binding} { Value::Int(__n) => Some(*__n as f64), Value::Float(__f) => Some(*__f), Value::Str(__s) => __s.parse::().ok(), Value::Bool(__b) => Some(if *__b { 1.0 } else { 0.0 }), _ => None })`; + } + + r25PlainValueOperand(node: any): boolean { + const inner: any = this.rustStripWrappers(node); + if (inner === undefined || !this.printsValueExpression(inner) || this.rustNativeStrCalleeKind(inner) === 'str') return false; + if (isIdentifier(inner) && this.rustParamShadowOf(inner) !== undefined) return false; + return !(isIdentifier(inner) && (this.rustStringLocalIdentifierIsTyped(inner) || this.rustVecLocalDeclarationOf(inner) !== undefined)); + } + + r25NativeCoercingArithmetic(op, left, right, leftText: string, rightText: string): string | undefined { + if (op === SyntaxKind.PlusToken) return this.r25NativeStrOrNullConcat(left, right, leftText, rightText); + if (op !== SyntaxKind.MinusToken && op !== SyntaxKind.AsteriskToken && op !== SyntaxKind.SlashToken) return undefined; + if (!this.r25PlainValueOperand(left) || !this.r25PlainValueOperand(right)) return undefined; + const a = this.rustR16NumericKind(left) !== undefined ? '__a.as_f64()' : this.r25LooseF64('__a'); + const b = this.rustR16NumericKind(right) !== undefined ? '__b.as_f64()' : this.r25LooseF64('__b'); + if (op === SyntaxKind.SlashToken) { + return `(match (&(${leftText}), &(${rightText})) { (__a, __b) => match (${a}, ${b}) { (Some(__x), Some(__y)) if __y != 0.0 => Value::Float(__x / __y), _ => Value::Null } })`; + } + const sign = op === SyntaxKind.MinusToken ? '-' : '*'; + return `(match (&(${leftText}), &(${rightText})) { (Value::Int(__x), Value::Int(__y)) => Value::Int(__x ${sign} __y),` + + ` (__a, __b) => match (${a}, ${b}) { (Some(__x), Some(__y)) => Value::Float(__x ${sign} __y), _ => Value::Null } })`; + } + + // is_less_than / is_greater_than: f64 order when both coerce, else `str` order of two Str; + // the `-or_equal` forms OR in is_equal (Null==Null, same-variant payload, Int exact, else f64). + r25NativeLooseOrderedComparison(node, op, left, right): string | undefined { + const operator = RustTranspiler.NATIVE_COMPARISON_OPERATORS[op]; + if (operator === undefined || !this.r25PlainValueOperand(left) || !this.r25PlainValueOperand(right)) return undefined; + const strict = operator.charAt(0); + const p = `(${this.r25LooseF64('__a')}, ${this.r25LooseF64('__b')})`; + const order = `(match ${p} { (Some(__x), Some(__y)) => __x ${strict} __y, _ => matches!((__a, __b), (Value::Str(__x), Value::Str(__y)) if __x ${strict} __y) })`; + const equal = ` || (match (__a, __b) { (Value::Null, Value::Null) => true, (Value::Bool(__x), Value::Bool(__y)) => __x == __y, (Value::Str(__x), Value::Str(__y)) => __x == __y,` + + ` (Value::Int(__x), Value::Int(__y)) => __x == __y, (Value::Float(__x), Value::Float(__y)) => __x == __y, _ => matches!(${p}, (Some(__x), Some(__y)) if __x == __y) })`; + const text = `(match (&(${this.printNode(left, 0)}), &(${this.printNode(right, 0)})) { (__a, __b) => ${order}${operator.length === 2 ? equal : ''} })`; + return this.isBooleanPosition(node) ? text : `Value::Bool(${text})`; + } + + // Str+Str / Str+Null take `string_concat` (Display, Null is "null"); Null+Null is Null. + r25NativeStrOrNullConcat(left, right, leftText: string, rightText: string): string | undefined { + if (!this.r25StrOrNull(left, 0) || !this.r25StrOrNull(right, 0)) return undefined; + return `(match (&(${leftText}), &(${rightText})) { (Value::Null, Value::Null) => Value::Null, (__a, __b) => Value::Str(format!("{}{}", __a, __b).into()) })`; + } + + r25StrOrNull(node: any, depth: number): boolean { + const inner: any = this.rustStripWrappers(node); + if (inner === undefined || depth > 12 || !this.r25PlainValueOperand(inner)) return false; + if (isStringLiteral(inner) || this.r22AlwaysStr(inner)) return true; + // `pad_start` / `pad_end` (helper or native form) answer Str or Null + if (isCallExpression(inner) && isPropertyAccessExpression(inner.expression) + && (String(inner.expression.name.text) === 'padStart' || String(inner.expression.name.text) === 'padEnd')) return true; + if (!isElementAccessExpression(inner) || !isStringLiteral(inner.argumentExpression)) return false; + return this.r25DictFieldStrOrNull(inner.expression, String(inner.argumentExpression.text), depth + 1); + } + + /** Every dict `node` can evaluate to holds `key` as Str/Null or lacks it (a read of a missing key / non-dict is Null). */ + r25DictFieldStrOrNull(node: any, key: string, depth: number): boolean { + const inner: any = this.rustStripWrappers(node); + if (inner === undefined || depth > 12) return false; + if (inner.kind === SyntaxKind.NullKeyword || (isIdentifier(inner) && String(inner.text) === 'undefined')) return true; + if (isObjectLiteralExpression(inner)) { + for (const p of inner.properties as any) { + if (p.kind !== SyntaxKind.PropertyAssignment) return false; + const name: any = p.name; + const text = (isStringLiteral(name) || isIdentifier(name)) ? String(name.text) : undefined; + if (text === undefined) return false; + if (text === key && !this.r25StrOrNull(p.initializer, depth + 1)) return false; + } + return true; + } + if (isCallExpression(inner)) return this.r25MethodFieldStrOrNull(inner, key, depth + 1); + if (!isIdentifier(inner)) return false; + const declaration: any = this.rustSingleLocalDeclaration(inner); + if (declaration === undefined || !isVariableDeclaration(declaration) || !isIdentifier(declaration.name) + || declaration.initializer === undefined || (declaration.parent?.flags & NodeFlags.Const) === 0) return false; + const fn = this.rustEnclosingFunction(declaration); + if (fn === undefined) return false; + // no element write / delete rooted at the local + for (const m of this.rustScopeNameNodes(fn, String(declaration.name.text)) as any[]) { + if (m === declaration.name || m.kind !== SyntaxKind.Identifier) continue; + let top: any = m; + while (isElementAccessExpression(top.parent) && top.parent.expression === top) top = top.parent; + if (top === m) continue; + const parent: any = top.parent; + if (isDeleteExpression(parent) || (isBinaryExpression(parent) && parent.left === top && rustIsAssignmentOperator(parent.operatorToken.kind))) return false; + } + return this.r25DictFieldStrOrNull(declaration.initializer, key, depth + 1); + } + + /** `this.m(..)` resolved to a same-file method with a body whose every return holds `key` as Str/Null. */ + r25MethodFieldStrOrNull(call: any, key: string, depth: number): boolean { + const callee = call.expression; + if (!isPropertyAccessExpression(callee) || callee.expression.kind !== SyntaxKind.ThisKeyword) return false; + let declaration: any; + try { + declaration = signatureDeclaration((this.getChecker() as any).getResolvedSignature(call)); + } catch (e) { + return false; + } + if (declaration?.kind !== SyntaxKind.MethodDeclaration || declaration.body === undefined + || declaration.getSourceFile() !== call.getSourceFile() || RustTranspiler.RUST_BASE_TIER_FILE.test(this.r05Path(call))) return false; + let ok = true; + const visit = (n: any) => { + if (!ok || (n !== declaration && isFunctionLike(n))) return; + if (isReturnStatement(n) && n.expression !== undefined && !this.r25DictFieldStrOrNull(n.expression, key, depth + 1)) ok = false; + n.forEachChild?.(visit); + }; + declaration.body.forEachChild(visit); + return ok; + } + + // hx4 R26 — tuple slot 1 of the base `handle*AndParams` / `handleParam*` helpers is their + // params argument or an `omit` copy of it: plain when that argument is a plain source. + private static readonly R26_PARAMS_SLOT_ARG: { [name: string]: number } = { + handleOptionAndParams: 0, handleOptionAndParams2: 0, handleOptionStringAndParams: 0, handleOptionStringAndParams2: 0, + handleOptionBoolAndParams: 0, handleOptionBoolAndParams2: 0, handleOptionIntegerAndParams: 0, handleOptionIntegerAndParams2: 0, + handleParamString: 0, handleParamString2: 0, handleParamInteger: 0, handleParamInteger2: 0, handleParamBool: 0, handleParamBool2: 0, + handleNetworkCodeAndParams: 0, handleMarginModeAndParams: 1, handleMarketTypeAndParams: 2, handleSubTypeAndParams: 2, + handleMaxEntriesPerRequestAndParams: 2, + }; + + r26ParamsSlot(rhs: Node, selfName: string | undefined, depth: number): boolean { + const call: any = this.rustStripWrappers(rhs); + if (depth > 4 || call === undefined || !isCallExpression(call) || !isPropertyAccessExpression(call.expression) + || call.expression.expression.kind !== SyntaxKind.ThisKeyword || this.r23Tier(call) === undefined) { + return false; + } + const index = RustTranspiler.R26_PARAMS_SLOT_ARG[String(call.expression.name.text)]; + if (index === undefined || !this.rustR01CalleeIsBase(call)) return false; + const arg: any = this.rustStripWrappers(call.arguments[index]); + // an omitted params argument takes the `{}` default + if (arg === undefined) return call.arguments.length <= index; + if (this.rustPlainDictLiteral(arg)) return true; + if (!isIdentifier(arg)) return false; + if (String(arg.text) === selfName) return true; + const declaration: any = this.rustSingleLocalDeclaration(arg); + if (declaration !== undefined && isParameterDeclaration(declaration)) { + // REST parameters are caller data; base needs a typed non-Client dict; pro rejects + return this.r23TierSourceOk(arg) && (this.r23Tier(arg) !== 'base' || this.rustParamStaysPlainDict(declaration)); + } + try { + return this.rustR10PlainReceiver(arg) === 'local'; + } catch (e) { + return false; + } + } + + // hx4 R30 — `slice` / `indexOf` / `toUpperCase` / `toLowerCase` on unproven `Value`s print the + // runtime helper's own dispatch inline (`runtime.rs` slice/get_index_of/to_upper/to_lower); + // every operand is evaluated once, in the helper's argument order. + r30LooseI64(expr: string): string { + return `(match &(${expr}) { Value::Int(__n) => Some(*__n), Value::Float(__f) => Some(*__f as i64), Value::Str(__s) => __s.parse::().ok(), Value::Bool(__b) => Some(if *__b { 1 } else { 0 }), _ => None })`; + } + + r30SliceArm(variant: string, len: string, take: string, empty: string): string { + const bound = (b: string) => `if ${b} < 0 { (__l + ${b}).max(0) } else { ${b}.min(__l) }`; + return `(${variant}, __b, __e) => match (${len}) { __l => match (${bound('__b')}, match __e { None => __l, Some(__k) => ${bound('__k')} }) { (__i, __j) => if __i <= __j { ${take} } else { ${empty} } } }`; + } + + r30Slice(name: string, start: string, end: string): string { + const str = this.r30SliceArm('Value::Str(__sv)', '__sv.chars().count() as i64', + 'Value::Str(__sv.chars().skip(__i as usize).take((__j - __i) as usize).collect::().into())', 'Value::Str(String::new().into())'); + const arr = this.r30SliceArm('Value::Arr(__a)', '__a.len() as i64', + 'Value::Array(__a[__i as usize..__j as usize].to_vec())', 'Value::Array(vec![])'); + return `(match (&(${name}), ${this.r30LooseI64(start)}.unwrap_or(0), ${this.r30LooseI64(end)}) { ${str}, ${arr}, _ => Value::Null })`; + } + + r30IndexOf(name: string, needle: string): string { + const eq = `match (__it, __nd) { (Value::Null, Value::Null) => true, (Value::Bool(__x), Value::Bool(__y)) => __x == __y, (Value::Str(__x), Value::Str(__y)) => __x == __y, (Value::Int(__x), Value::Int(__y)) => __x == __y, (Value::Float(__x), Value::Float(__y)) => __x == __y, (__p, __q) => match (${this.r25LooseF64('__p')}, ${this.r25LooseF64('__q')}) { (Some(__x), Some(__y)) => __x == __y, _ => false } }`; + return `(match (&(${name}), &(${needle})) { (Value::Arr(__a), __nd) => Value::Int(__a.iter().position(|__it| ${eq}).map(|__i| __i as i64).unwrap_or(-1)), (Value::Str(__s), Value::Str(__nd)) => Value::Int(__s.find(&**__nd).map(|__i| __i as i64).unwrap_or(-1)), _ => Value::Int(-1) })`; + } + + r30Case(name: string, method: string): string { + return `(match &(${name}) { Value::Str(__s) => Value::Str(__s.${method}().into()), _ => Value::Null })`; + } } diff --git a/tests/csharpTranspiler.test.ts b/tests/csharpTranspiler.test.ts index 2e2ea787..0eae95a9 100644 --- a/tests/csharpTranspiler.test.ts +++ b/tests/csharpTranspiler.test.ts @@ -1768,6 +1768,64 @@ describe('csharp typed body locals', () => { expect(output).toContain('object code = (currency != null && currency.ContainsKey("code") ? currency["code"] : null);'); expect(output).not.toContain('getValue(currency, "code")'); }); + test('hx4 C01: a null-tested declared collection still reads natively', () => { + const printer: any = (transpiler as any).csharpTranspiler; + const previous = printer.csharpDeclaredLocalTypeResolver; + printer.csharpDeclaredLocalTypeResolver = (declaration: any) => (declaration?.name?.text === 'row') ? 'Dictionary' : ((declaration?.name?.text === 'items') ? 'List' : undefined); + const output = transpiler.transpileCSharp( + "class Exchange {\n" + + " main(row: any, items: any, other: any) {\n" + + " if (row === undefined || items === undefined) {\n" + + " return undefined;\n" + + " }\n" + + " const code = row['code'];\n" + + " const first = items[0];\n" + + " const last = items[-1];\n" + + " const id = other['id'];\n" + + " return [ code, first, last, id ];\n" + + " }\n" + + "}").content; + printer.csharpDeclaredLocalTypeResolver = previous; + expect(output).toContain('object code = (row != null && row.ContainsKey("code") ? row["code"] : null);'); + expect(output).toContain('object first = (items != null && 0 < items.Count ? items[0] : null);'); + expect(output).toContain('object last = getValue(items, -1);'); + expect(output).toContain('object id = getValue(other, "id");'); + }); + test('hx4 C11: identifier keys on declared collections and base dict fields read natively', () => { + const printer: any = (transpiler as any).csharpTranspiler; + const previous = printer.csharpDeclaredLocalTypeResolver; + const previousLocal = printer.csharpLocalTypeOf; + printer.csharpDeclaredLocalTypeResolver = (declaration: any) => (declaration?.name?.text === 'row') ? 'Dictionary' : ((declaration?.name?.text === 'items') ? 'List' : undefined); + printer.csharpLocalTypeOf = (node: any) => (node?.text === 'key') ? 'string?' : ((node?.text === 'big') ? 'Int64' : ((node?.text === 'i') ? 'int' : undefined)); + const output = transpiler.transpileCSharp( + "class Exchange {\n" + + " has: any; urls: any; timeframes: any;\n" + + " main(row: any, items: any, other: any, key: any, big: any, k2: any) {\n" + + " const out = [];\n" + + " for (let i = 0; i < 3; i++) {\n" + + " out.push (items[i]);\n" + + " }\n" + + " const a = row[key];\n" + + " const b = this.has[key];\n" + + " const c = this.urls[key];\n" + + " const d = other[key];\n" + + " const e = items[big];\n" + + " const f = row[k2];\n" + + " const g = this.timeframes[k2];\n" + + " return [ out, a, b, c, d, e, f, g ];\n" + + " }\n" + + "}").content; + printer.csharpDeclaredLocalTypeResolver = previous; + printer.csharpLocalTypeOf = previousLocal; + expect(output).toContain('(items != null && i < items.Count ? items[i] : null)'); + expect(output).toContain('object a = (row != null && key != null && row.ContainsKey(key) ? row[key] : null);'); + expect(output).toContain('object b = (this.has != null && key != null && this.has.ContainsKey(key) ? this.has[key] : null);'); + expect(output).toContain('object c = (this.urls != null && key != null && ((IDictionary)this.urls).ContainsKey(key) ? ((IDictionary)this.urls)[key] : null);'); + expect(output).toContain('object d = getValue(other, key);'); + expect(output).toContain('object e = getValue(items, big);'); + expect(output).toContain('object f = getValue(row, k2);'); + expect(output).toContain('object g = getValue(this.timeframes, k2);'); + }); test('a non-dictionary declared-local resolver answer keeps getValue', () => { const printer: any = (transpiler as any).csharpTranspiler; const previous = printer.csharpDeclaredLocalTypeResolver; @@ -5914,3 +5972,41 @@ describe('U59 list index reads bounded by the enclosing for', () => { }); }); + +// hx4 L44 +describe('hx4 L44 guarded nullable negation', () => { + const transpiler = new Transpiler({}); + const cls = (body: string) => + "class Exchange {\n" + + " safeNumberN(a, b) { return a; }\n" + + " main(item) {\n" + body + " }\n" + + "}"; + test('if-guarded double? local keeps its type and negates in place', () => { + const output = transpiler.transpileCSharp(cls( + " const amount = this.safeNumberN(item, ['amount']);\n" + + " let r = amount;\n" + + " if (amount !== undefined) {\n" + + " r = -amount;\n" + + " }\n" + + " return r;\n")).content; + expect(output).toContain('double? amount = this.safeNumberN('); + expect(output).toContain('r = (amount = -amount);'); + expect(output).not.toContain('prefixUnaryNeg'); + }); + test('&&-guarded double? local negates in place', () => { + const output = transpiler.transpileCSharp(cls( + " const amount = this.safeNumberN(item, ['amount']);\n" + + " const x = (amount !== undefined) && this.safeNumberN(-amount, []);\n" + + " return x;\n")).content; + expect(output).toContain('double? amount = this.safeNumberN('); + expect(output).toContain('(amount = -amount)'); + expect(output).not.toContain('prefixUnaryNeg'); + }); + test('unguarded negation keeps object + helper', () => { + const output = transpiler.transpileCSharp(cls( + " const amount = this.safeNumberN(item, ['amount']);\n" + + " return -amount;\n")).content; + expect(output).toContain('object amount = this.safeNumberN('); + expect(output).toContain('prefixUnaryNeg(ref amount)'); + }); +}); diff --git a/tests/files/input/hx4r01/ts/src/base/Exchange.ts b/tests/files/input/hx4r01/ts/src/base/Exchange.ts new file mode 100644 index 00000000..ef1332b0 --- /dev/null +++ b/tests/files/input/hx4r01/ts/src/base/Exchange.ts @@ -0,0 +1,17 @@ +export interface Dict { [key: string]: any } +export interface BalanceAccount { free: string | undefined, used: string | undefined, total: string | undefined } +const omit = (x: Dict | undefined, ...args: any) => x; +const extend = (...args: any[]) => Object.assign ({}, ...args); +export default class Exchange { + omit = omit; + extend = extend; + account (): BalanceAccount { + return { 'free': undefined, 'used': undefined, 'total': undefined }; + } + handleUntilOption (key: string, request: Dict, params: Dict, multiplier: number = 1): [Dict, Dict] { + return [ request, params ]; + } + parseOrder (order: Dict): Dict { + return order; + } +} diff --git a/tests/files/input/hx4r01/ts/src/venue.ts b/tests/files/input/hx4r01/ts/src/venue.ts new file mode 100644 index 00000000..155afb2a --- /dev/null +++ b/tests/files/input/hx4r01/ts/src/venue.ts @@ -0,0 +1,80 @@ +import Exchange from './base/Exchange.js'; +import type { Dict } from './base/Exchange.js'; +export default class venue extends Exchange { + fetchBalance (params: Dict = {}) { + if (params['a'] !== undefined) { + const account = this.account (); + account['free'] = '1'; + return account; + } + const account = this.account (); + account['used'] = '0'; + return account; + } + sign (params: Dict = {}) { + let headers: Dict = undefined; + if (params['x'] !== undefined) { + headers = { 'A': 'b' }; + headers['Content-Type'] = 'application/json'; + } + return { 'url': '', 'headers': headers }; + } + signAliased (params: Dict = {}) { + let aliased: Dict = undefined; + if (params['x'] !== undefined) { + aliased = { 'A': 'b' }; + aliased['Content-Type'] = 'application/json'; + } + const req = { 'headers': aliased }; + return req; + } + fetchOHLCV (params: Dict = {}) { + const request: Dict = {}; + const [ requestUntil, paramsUntil ] = this.handleUntilOption ('endTime', request, params); + requestUntil['interval'] = '1m'; + return [ requestUntil, paramsUntil ]; + } + fetchOrder (params: Dict = {}) { + const order = this.parseOrder (params); + order['status'] = 'open'; + let mixed: Dict = {}; + mixed = this.parseOrder (params); + mixed['k'] = 1; + const captured = this.account (); + const f = () => { captured['free'] = '2'; }; + return [ order, mixed, f ]; + } + prepareRequest (market: Dict = undefined, params: Dict = {}): [Dict, Dict] { + const request: Dict = {}; + if (market !== undefined) { + request['contract'] = market['id']; + return [ request, this.omit (params, 'settle') ]; + } + return [ request, params ]; + } + passThrough (params: Dict = {}): [Dict, Dict] { + return [ params, params ]; + } + fetchPositions (params: Dict = {}) { + const [ request, query ] = this.prepareRequest (undefined, params); + request['settle'] = 'usdt'; + const [ echoed, rest ] = this.passThrough (params); + echoed['x'] = 1; + return [ request, query, echoed, rest ]; + } + createOrder (params: Dict = {}) { + let request: Dict = { 'a': 1 }; + request = this.omit (request, 'a'); + request['b'] = 2; + let merged: Dict = {}; + merged = this.extend (merged, { 'c': 3 }); + merged['d'] = 4; + let foreign: Dict = {}; + foreign = this.omit (params, 'x'); + foreign['e'] = 5; + let extended: Dict = {}; + extended = this.extend (params, {}); + extended['f'] = 6; + return [ request, merged, foreign, extended ]; + } +} diff --git a/tests/files/input/hx4r05/ts/src/pro/venue.ts b/tests/files/input/hx4r05/ts/src/pro/venue.ts new file mode 100644 index 00000000..f62274fa --- /dev/null +++ b/tests/files/input/hx4r05/ts/src/pro/venue.ts @@ -0,0 +1,22 @@ +interface Dictionary { [key: string]: T } +type Dict = Dictionary; +class Client { subscriptions: Dictionary = {}; futures: Dictionary = {}; } + +export default class venuews { + orderbooks: Dictionary = {}; + + handle (client: Client, symbol: string, messageHash: string, subscription: Dict) { + if (symbol in this.orderbooks) { + delete this.orderbooks[symbol]; + } + if (messageHash in client.subscriptions) { + delete client.subscriptions[messageHash]; + } + const subs = client.subscriptions; + delete subs[messageHash]; + delete subscription[symbol]; + const plain = { 'k': 1 }; + delete plain['k']; + return Object.keys (this.orderbooks); + } +} diff --git a/tests/files/input/hx4r05/ts/src/venue.ts b/tests/files/input/hx4r05/ts/src/venue.ts new file mode 100644 index 00000000..4e817221 --- /dev/null +++ b/tests/files/input/hx4r05/ts/src/venue.ts @@ -0,0 +1,35 @@ +interface Dictionary { [key: string]: T } +type Dict = Dictionary; +type Str = string | undefined; + +export default class venue { + balance: Dict = {}; + tickers: Dictionary = {}; + + omit (x, k) { return x; } + + sign (path: string, params: Dict = {}) { + const query = this.omit (params, 'a'); + let url = path; + if (Object.keys (query).length) { + url = url + '?'; + } + const values = Object.values (this.tickers); + const flag = true; + return [ url, values, Object.keys (flag) ]; + } + + clean (symbol: Str, code: string) { + if (code in this.balance) { + delete this.balance[code]; + } + const request = { 'a': 1, 'b': 2 }; + delete request['a']; + const response: any = this.omit ({}, 'x'); + delete response['x']; + if (code in response) { + return 1; + } + return request; + } +} diff --git a/tests/files/input/hx4r10/ts/src/base/Exchange.ts b/tests/files/input/hx4r10/ts/src/base/Exchange.ts new file mode 100644 index 00000000..ef1332b0 --- /dev/null +++ b/tests/files/input/hx4r10/ts/src/base/Exchange.ts @@ -0,0 +1,17 @@ +export interface Dict { [key: string]: any } +export interface BalanceAccount { free: string | undefined, used: string | undefined, total: string | undefined } +const omit = (x: Dict | undefined, ...args: any) => x; +const extend = (...args: any[]) => Object.assign ({}, ...args); +export default class Exchange { + omit = omit; + extend = extend; + account (): BalanceAccount { + return { 'free': undefined, 'used': undefined, 'total': undefined }; + } + handleUntilOption (key: string, request: Dict, params: Dict, multiplier: number = 1): [Dict, Dict] { + return [ request, params ]; + } + parseOrder (order: Dict): Dict { + return order; + } +} diff --git a/tests/files/input/hx4r10/ts/src/venue.ts b/tests/files/input/hx4r10/ts/src/venue.ts new file mode 100644 index 00000000..de6fada8 --- /dev/null +++ b/tests/files/input/hx4r10/ts/src/venue.ts @@ -0,0 +1,50 @@ +import Exchange from './base/Exchange.js'; +import type { Dict } from './base/Exchange.js'; +export default class venue extends Exchange { + readParams (params: Dict) { + const copied = this.parseOrder (params); + const keys = this.sortKeys (params); + const out = [ copied ]; + for (let i = 0; i < keys.length; i++) { + const key = keys[i]; + const value = params[key]; + out.push (value); + } + return out; + } + sortKeys (x): any { + return Object.keys (x); + } + readLocal (code) { + let result = undefined; + result = { 'a': 1 }; + const viaCode = result[code]; + const viaLit = result['a']; + return [ viaCode, viaLit ]; + } + readAccount (code) { + const account = this.account (); + const free = account['free']; + return [ free, account[code] ]; + } + readTuple (params: Dict = {}) { + const request: Dict = {}; + const [ requestUntil, paramsUntil ] = this.handleUntilOption ('endTime', request, params); + const interval = requestUntil['interval']; + return [ interval, paramsUntil ]; + } + readReassignedParam (params: Dict, key) { + params = this.parseOrder (params); + return params[key]; + } + readUnsafeKey (params: Dict) { + return params['timestamp']; + } + readParsed (params: Dict, key) { + const order = this.parseOrder (params); + return order[key]; + } + readNumericKey (params: Dict, n: number) { + return params[n]; + } +} diff --git a/tests/files/input/hx4r12/ts/src/base/Exchange.ts b/tests/files/input/hx4r12/ts/src/base/Exchange.ts new file mode 100644 index 00000000..134ffe85 --- /dev/null +++ b/tests/files/input/hx4r12/ts/src/base/Exchange.ts @@ -0,0 +1,37 @@ +export interface Dict { [key: string]: any } +export type Bool = boolean | undefined; +const omit = (x: Dict | undefined, ...args: any) => x; +const extend = (...args: any[]) => Object.assign ({}, ...args); +export default class Exchange { + options: Dict = {}; + omit = omit; + extend = extend; + safeValue (d: any, k: any, dflt: any = undefined): any { + return d === undefined ? dflt : d[k]; + } + safeDict (d: any, k: any, dflt: Dict = undefined): Dict { + const v = this.safeValue (d, k); + return (typeof v === 'object') ? v : dflt; + } + safeBool (d: any, k: any, dflt: Bool = undefined): Bool { + const v = this.safeValue (d, k); + return (typeof v === 'boolean') ? v : dflt; + } + checkOptionBool (methodName: string, optionName: string, value: any): Bool { + if (value === undefined) { + return undefined; + } + return value === true; + } + handleOptionBoolAndParams (params: Dict, methodName: string, optionName: string, defaultValue: Bool = undefined): [Bool, Dict] { + const value = this.safeValue (params, optionName, defaultValue); + return [ this.checkOptionBool (methodName, optionName, value), params ]; + } + handleTriggerAndParams (params: any): any[] { + const isTrigger = this.safeBool (params, 'trigger'); + return [ isTrigger, params ]; + } + handleOptionAndParams (params: Dict, methodName: string, optionName: string, defaultValue: any = undefined): [any, Dict] { + return [ this.safeValue (params, optionName, defaultValue), params ]; + } +} diff --git a/tests/files/input/hx4r12/ts/src/venue.ts b/tests/files/input/hx4r12/ts/src/venue.ts new file mode 100644 index 00000000..2c6681fc --- /dev/null +++ b/tests/files/input/hx4r12/ts/src/venue.ts @@ -0,0 +1,75 @@ +import Exchange from './base/Exchange.js'; +import type { Dict } from './base/Exchange.js'; +export default class venue extends Exchange { + fetchStatus (response: Dict) { + const data = this.safeDict (response, 'data', {}); + data['status'] = 'ok'; + const bare = this.safeDict (response, 'data'); + bare['a'] = 1; + const nonPlainDefault = this.safeDict (response, 'data', response); + nonPlainDefault['b'] = 2; + const fromOptions = this.safeDict (this.options, 'fetchStatus', {}); + fromOptions['c'] = 3; + const fromField = this.safeDict (this.markets, 'x', {}); + fromField['d'] = 4; + return [ data, bare, nonPlainDefault, fromOptions, fromField ]; + } + markets: Dict = {}; + createOrderRequest (symbol: string, params: Dict = {}): Dict { + const request: Dict = { 'symbol': symbol }; + if (symbol === 'x') { + return { 'a': 1 }; + } + return this.extend (request, params); + } + asyncBuilder (params: Dict = {}): Promise { + return undefined; + } + parseThing (params: Dict = {}): Dict { + return params; + } + createOrder (symbol: string, params: Dict = {}) { + const request = this.createOrderRequest (symbol, params); + request['clientOid'] = '1'; + const parsed = this.parseThing (params); + parsed['x'] = 1; + return [ request, parsed ]; + } + isUnifiedEnabled (): any[] { + const a = this.safeBool (this.options, 'a'); + if (a === undefined) { + return [ false, true ]; + } + return [ a, this.safeBool (this.options, 'b', false) ]; + } + isConditionalOrder (params: Dict = {}): boolean { + return this.safeValue (params, 'triggerPrice') !== undefined; + } + looseFlag (params: Dict = {}): boolean { + return this.safeValue (params, 'flag'); + } + fetchBalance (params: Dict = {}) { + const [ enableUnifiedMargin, enableUnifiedAccount ] = this.isUnifiedEnabled (); + const isUnified = (enableUnifiedMargin === true) || (enableUnifiedAccount === true); + const [ paginate, rest ] = this.handleOptionBoolAndParams (params, 'fetchBalance', 'paginate', false); + if (paginate) { + return rest; + } + let isTrigger = undefined; + [ isTrigger, params ] = this.handleTriggerAndParams (params); + if (isTrigger) { + return params; + } + if (!this.isConditionalOrder (params)) { + return params; + } + if (this.looseFlag (params)) { + return params; + } + const [ loose, rest2 ] = this.handleOptionAndParams (params, 'fetchBalance', 'loose'); + if (loose) { + return rest2; + } + return isUnified; + } +} diff --git a/tests/files/input/hx4r14/ts/src/base/Exchange.ts b/tests/files/input/hx4r14/ts/src/base/Exchange.ts new file mode 100644 index 00000000..1a71e9b2 --- /dev/null +++ b/tests/files/input/hx4r14/ts/src/base/Exchange.ts @@ -0,0 +1,47 @@ +export interface Dict { [key: string]: any } +export type Bool = boolean | undefined; +const omit = (x: Dict | undefined, ...args: any) => x; +const extend = (...args: any[]) => Object.assign ({}, ...args); +export default class Exchange { + options: Dict = {}; + omit = omit; + extend = extend; + safeValue (d: any, k: any, dflt: any = undefined): any { + return d === undefined ? dflt : d[k]; + } + safeDict (d: any, k: any, dflt: Dict): Dict; + safeDict (d: any, k: any, dflt?: Dict): Dict | undefined; + safeDict (d: any, k: any, dflt: Dict = undefined): Dict | undefined { + const v = this.safeValue (d, k); + return (typeof v === 'object') ? v : dflt; + } + safeList (d: any, k: any, dflt: any[]): any[]; + safeList (d: any, k: any, dflt?: any[]): any[] | undefined; + safeList (d: any, k: any, dflt: any[] = undefined): any[] | undefined { + const v = this.safeValue (d, k); + return Array.isArray (v) ? v : dflt; + } + safeBool (d: any, k: any, dflt: boolean): boolean; + safeBool (d: any, k: any, dflt?: Bool): Bool; + safeBool (d: any, k: any, dflt: Bool = undefined): Bool { + const v = this.safeValue (d, k); + return (typeof v === 'boolean') ? v : dflt; + } + checkOptionBool (methodName: string, optionName: string, value: any): Bool { + if (value === undefined) { + return undefined; + } + return value === true; + } + handleOptionBoolAndParams (params: Dict, methodName: string, optionName: string, defaultValue: Bool = undefined): [Bool, Dict] { + const value = this.safeValue (params, optionName, defaultValue); + return [ this.checkOptionBool (methodName, optionName, value), params ]; + } + handleTriggerAndParams (params: any): any[] { + const isTrigger = this.safeBool (params, 'trigger'); + return [ isTrigger, params ]; + } + handleOptionAndParams (params: Dict, methodName: string, optionName: string, defaultValue: any = undefined): [any, Dict] { + return [ this.safeValue (params, optionName, defaultValue), params ]; + } +} diff --git a/tests/files/input/hx4r14/ts/src/venue.ts b/tests/files/input/hx4r14/ts/src/venue.ts new file mode 100644 index 00000000..78df6373 --- /dev/null +++ b/tests/files/input/hx4r14/ts/src/venue.ts @@ -0,0 +1,53 @@ +import Exchange from './base/Exchange.js'; +import type { Dict } from './base/Exchange.js'; +export default class venue extends Exchange { + async privatePostLedgers (params: Dict = {}): Promise { + return {}; + } + async fetchLedger (params: Dict = {}) { + const response = await this.privatePostLedgers (params); + const ledger = this.safeDict (response, 'ledger', {}); + const keys = Object.keys (ledger); + const items = []; + for (let i = 0; i < keys.length; i++) { + const key = keys[i]; + const value = ledger[key]; + value['id'] = key; + items.push (value); + } + return items; + } + findAlt (id: any) { + const byAlt = this.safeDict (this.options, 'byAlt', {}); + if (id in byAlt) { + const found = byAlt[id]; + return found; + } + const loose = this.safeDict (this.options, 'loose', this.options); + if (id in loose) { + return loose[id]; + } + return undefined; + } + flagged (params: Dict = {}) { + const flag = this.safeBool (params, 'flag', false); + if (flag) { + return 1; + } + return 0; + } + lastOf (order: Dict) { + const trades = this.safeList (order, 'trades', []); + const numTrades = trades.length; + let last = undefined; + if (numTrades > 0) { + last = trades[numTrades - 1]; + } + for (let i = 1; i < numTrades; i++) { + const prev = trades[i - 1]; + last = this.extend (prev, last); + } + const k = this.safeValue (order, 'k'); + return [ last, trades[k - 1] ]; + } +} diff --git a/tests/files/input/hx4r15/ts/src/base/Exchange.ts b/tests/files/input/hx4r15/ts/src/base/Exchange.ts new file mode 100644 index 00000000..134ffe85 --- /dev/null +++ b/tests/files/input/hx4r15/ts/src/base/Exchange.ts @@ -0,0 +1,37 @@ +export interface Dict { [key: string]: any } +export type Bool = boolean | undefined; +const omit = (x: Dict | undefined, ...args: any) => x; +const extend = (...args: any[]) => Object.assign ({}, ...args); +export default class Exchange { + options: Dict = {}; + omit = omit; + extend = extend; + safeValue (d: any, k: any, dflt: any = undefined): any { + return d === undefined ? dflt : d[k]; + } + safeDict (d: any, k: any, dflt: Dict = undefined): Dict { + const v = this.safeValue (d, k); + return (typeof v === 'object') ? v : dflt; + } + safeBool (d: any, k: any, dflt: Bool = undefined): Bool { + const v = this.safeValue (d, k); + return (typeof v === 'boolean') ? v : dflt; + } + checkOptionBool (methodName: string, optionName: string, value: any): Bool { + if (value === undefined) { + return undefined; + } + return value === true; + } + handleOptionBoolAndParams (params: Dict, methodName: string, optionName: string, defaultValue: Bool = undefined): [Bool, Dict] { + const value = this.safeValue (params, optionName, defaultValue); + return [ this.checkOptionBool (methodName, optionName, value), params ]; + } + handleTriggerAndParams (params: any): any[] { + const isTrigger = this.safeBool (params, 'trigger'); + return [ isTrigger, params ]; + } + handleOptionAndParams (params: Dict, methodName: string, optionName: string, defaultValue: any = undefined): [any, Dict] { + return [ this.safeValue (params, optionName, defaultValue), params ]; + } +} diff --git a/tests/files/input/hx4r15/ts/src/venue.ts b/tests/files/input/hx4r15/ts/src/venue.ts new file mode 100644 index 00000000..e29521b3 --- /dev/null +++ b/tests/files/input/hx4r15/ts/src/venue.ts @@ -0,0 +1,80 @@ +import Exchange from './base/Exchange.js'; +import type { Dict, Bool, List } from './base/Exchange.js'; +export default class venue extends Exchange { + a1 (params: Dict = {}, symbol: string = undefined) { + let stock = undefined; + let paramsStock = undefined; + [ stock, paramsStock ] = this.handleOptionBoolAndParams (params, 'x', 'stock', false); + if (symbol !== undefined) { + stock = this.safeBool (params, 'stock', false); + } else if (!stock) { + throw new Error ('x'); + } + return paramsStock; + } + a2 (params: Dict = {}, other: any = undefined) { + let fees: Bool = undefined; + let rest = undefined; + [ fees, rest ] = this.handleOptionBoolAndParams (params, 'x', 'fees', true); + fees = fees && other; + if (fees) { + return rest; + } + return params; + } + a3 (params: Dict = {}) { + let isPm = undefined; + [ isPm, params ] = this.handleOptionBoolAndParams (params, 'x', 'pm', false); + if (isPm || (params['t'] === 'papi')) { + return 1; + } + return 2; + } + a4 (ids: string[], params: Dict = {}) { + const args: string[] = []; + const hashes: string[] = []; + const request: Dict = { 'method': 'SUB', 'params': args }; + for (let i = 0; i < ids.length; i++) { + args.push (ids[i] + '@t'); + hashes.push ('t:' + ids[i]); + } + return this.extend (request, { 'h': hashes }); + } + a5 (ids: string[]) { + const out: string[] = []; + for (let i = 0; i < ids.length; i++) { + out.push (ids[i]); + } + const req: Dict = { 'ids': out.join (',') }; + return req; + } + a6 (ids: string[]) { + const out: string[] = []; + for (let i = 0; i < ids.length; i++) { + out.push (ids[i]); + } + const first: Dict = { 'ids': out }; + const second: Dict = { 'more': out }; + return [ first, second ]; + } + a7 (ids: string[]) { + const late: string[] = []; + const req: Dict = { 'late': late }; + late.push ('x'); + return req; + } + a8 (ids: any[]) { + const loose: any[] = []; + loose.push (ids[0]); + return loose.join (','); + } + a9 (ids: string[]) { + const looped: string[] = []; + looped.push ('a'); + const reqs: Dict[] = []; + for (let i = 0; i < ids.length; i++) { + reqs.push ({ 'k': looped }); + } + return reqs; + } +} diff --git a/tests/files/input/hx4r18/ts/src/base/Exchange.ts b/tests/files/input/hx4r18/ts/src/base/Exchange.ts new file mode 100644 index 00000000..6688108b --- /dev/null +++ b/tests/files/input/hx4r18/ts/src/base/Exchange.ts @@ -0,0 +1,20 @@ +export interface Dict { [key: string]: any } +const omit = (x: Dict | undefined, ...args: any) => x; +const toArray = (object: Dict | any[] | undefined) => Object.values (object); +export default class Exchange { + options: Dict = {}; + omit = omit; + toArray = toArray; + safeValue (d: any, k: any, dflt: any = undefined): any { + return d === undefined ? dflt : d[k]; + } + safeList (d: any, k: any, dflt: any[]): any[]; + safeList (d: any, k: any, dflt?: any[]): any[] | undefined; + safeList (d: any, k: any, dflt: any[] = undefined): any[] | undefined { + const v = this.safeValue (d, k); + return Array.isArray (v) ? v : dflt; + } + account (): any { + return { 'free': undefined }; + } +} diff --git a/tests/files/input/hx4r18/ts/src/prediction/venue.ts b/tests/files/input/hx4r18/ts/src/prediction/venue.ts new file mode 100644 index 00000000..e4e71fb6 --- /dev/null +++ b/tests/files/input/hx4r18/ts/src/prediction/venue.ts @@ -0,0 +1,12 @@ +import Exchange from '../base/Exchange.js'; +import type { Dict } from '../base/Exchange.js'; +export default class venue extends Exchange { + keysOf (params: Dict = {}, response: any = undefined) { + const query: Dict = {}; + query['a'] = params['a']; + const queryKeys = Object.keys (query); + const queryValues = Object.values (query); + const loose = Object.keys (response); + return [ queryKeys, queryValues, loose ]; + } +} diff --git a/tests/files/input/hx4r18/ts/src/venue.ts b/tests/files/input/hx4r18/ts/src/venue.ts new file mode 100644 index 00000000..caff054c --- /dev/null +++ b/tests/files/input/hx4r18/ts/src/venue.ts @@ -0,0 +1,59 @@ +import Exchange from './base/Exchange.js'; +import type { Dict } from './base/Exchange.js'; +export default class venue extends Exchange { + collect (response: any) { + const rows = this.safeList (response, 'rows', []); + const out = []; + for (let i = 0; i < rows.length; i++) { + out.push (rows[i]); + } + const loose = this.safeList (response, 'loose'); + const count = loose.length; + const parsed = this.toArray (response) as any; + return [ out, count, parsed.length ]; + } + rebound (response: any) { + let list = []; + list.push (1); + list = response; + list.push (2); + return list.length; + } + nullable (response: any) { + const maybe = this.safeList (response, 'x'); + maybe.push (3); + return maybe; + } + aliased (args: any) { + const ids = []; + const req = { 'ids': ids }; + ids.push (args); + return req; + } + captured (response: any) { + const items = []; + const add = (x) => { items.push (x); }; + add (response); + items.push (4); + return items.length; + } + selfRef () { + const seq = []; + seq.push (seq.length); + return seq; + } + hasKey (params: Dict = {}, response: any = undefined) { + const request: Dict = {}; + if ('symbol' in params) { + request['symbol'] = params['symbol']; + } + const account = this.account (); + if ('free' in account) { + return 1; + } + if ('code' in response) { + return 2; + } + return request; + } +} diff --git a/tests/files/input/hx4r21/ts/src/base/Exchange.ts b/tests/files/input/hx4r21/ts/src/base/Exchange.ts new file mode 100644 index 00000000..b40cb690 --- /dev/null +++ b/tests/files/input/hx4r21/ts/src/base/Exchange.ts @@ -0,0 +1,38 @@ +export interface Dict { [key: string]: any } +export interface Currency { id: string; code: string } +export default class Exchange { + options: Dict = {}; + safeValue (d: any, k: any, dflt: any = undefined): any { + return d === undefined ? dflt : d[k]; + } + sortBy (array: any[], key: any): any[] { + return array; + } + arrayConcat (a: any[], b: any[]): any[] { + return a.concat (b); + } + currency (code: string): Currency { + return { 'id': code, 'code': code }; + } + collect (rows: any[], response: any) { + let out = []; + for (let i = 0; i < rows.length; i++) { + out.push (rows[i]); + } + out = this.sortBy (out, 'code'); + out.push (1); + const joined = this.arrayConcat (rows, out); + joined.push (2); + let loose = response; + loose.push (3); + return [ out, joined, loose ]; + } + keysOf (response: any) { + const built: Dict = {}; + built['a'] = 1; + const keys = Object.keys (built); + const values = Object.values (built); + const other = Object.keys (response); + return [ keys, values, other ]; + } +} diff --git a/tests/files/input/hx4r21/ts/src/venue.ts b/tests/files/input/hx4r21/ts/src/venue.ts new file mode 100644 index 00000000..021c6b79 --- /dev/null +++ b/tests/files/input/hx4r21/ts/src/venue.ts @@ -0,0 +1,10 @@ +import Exchange from './base/Exchange.js'; +export default class venue extends Exchange { + upper (code: string, raw: any) { + const currency = this.currency (code); + const id: string = currency['id']; + const a = currency['id'].toUpperCase (); + const b = raw['id'].toUpperCase (); + return [ id, a, b ]; + } +} diff --git a/tests/files/input/hx4r23/ts/src/base/Exchange.ts b/tests/files/input/hx4r23/ts/src/base/Exchange.ts new file mode 100644 index 00000000..361788cd --- /dev/null +++ b/tests/files/input/hx4r23/ts/src/base/Exchange.ts @@ -0,0 +1,31 @@ +export interface Dict { [key: string]: any } +export default class Exchange { + options: Dict = {}; + safeDict (d: any, k: any, dflt: Dict = undefined): Dict { + return d === undefined ? dflt : d[k]; + } + extend (...args: any[]): Dict { + return Object.assign ({}, ...args); + } + copyItem (obj: any, keyName: string, key: string) { + const item = obj[key]; + const itemWithKey = this.extend ({}, item); + itemWithKey[keyName] = key; + return itemWithKey; + } + structure (market: Dict = undefined) { + const clean = { 'spot': undefined }; + const result = this.extend (clean, market); + result['swap'] = false; + return result; + } + accountOf (account: string) { + const accountsByType = this.safeDict (this.options, 'accountsByType', {}); + return accountsByType[account]; + } + anyParam (response: any) { + const r = this.extend ({}, response); + r['x'] = 1; + return r; + } +} diff --git a/tests/files/input/hx4r23/ts/src/pro/venue.ts b/tests/files/input/hx4r23/ts/src/pro/venue.ts new file mode 100644 index 00000000..311a59d7 --- /dev/null +++ b/tests/files/input/hx4r23/ts/src/pro/venue.ts @@ -0,0 +1,21 @@ +import Exchange from '../base/Exchange'; +import type { Dict } from '../base/Exchange'; +export default class venue extends Exchange { + handleSub (client: any, message: Dict) { + const subs = this.safeDict (this.options, 'subs', {}); + subs['a'] = 1; + const fromParam = this.safeDict (client, 'subscriptions', {}); + fromParam['b'] = 2; + const fromMessage = this.safeDict (message, 'data', {}); + fromMessage['c'] = 3; + return [ subs['a'], fromParam, fromMessage ]; + } + buildRequest (message: any) { + const base = this.safeDict (this.options, 'req', {}); + const request = this.extend (base, { 'op': 'sub' }); + request['id'] = 1; + const loose = this.extend (message, {}); + loose['id'] = 2; + return [ request, loose ]; + } +} diff --git a/tests/files/input/hx4r26/ts/src/base/Exchange.ts b/tests/files/input/hx4r26/ts/src/base/Exchange.ts new file mode 100644 index 00000000..df5d586e --- /dev/null +++ b/tests/files/input/hx4r26/ts/src/base/Exchange.ts @@ -0,0 +1,15 @@ +export interface Dict { [key: string]: any } +const omit = (x: Dict | undefined, ...args: any) => x; +export default class Exchange { + omit = omit; + options: Dict = {}; + handleOptionBoolAndParams (params: Dict, methodName: string, optionName: string, defaultValue: boolean = undefined): [boolean, Dict] { + return [ defaultValue, this.omit (params, optionName) ]; + } + handleMarketTypeAndParams (methodName: string, market: Dict = undefined, params: Dict = {}, defaultValue: string = undefined): [string, Dict] { + return [ defaultValue, params ]; + } + handleOther (params: Dict): [boolean, Dict] { + return [ true, params ]; + } +} diff --git a/tests/files/input/hx4r26/ts/src/pro/venue.ts b/tests/files/input/hx4r26/ts/src/pro/venue.ts new file mode 100644 index 00000000..9f13a096 --- /dev/null +++ b/tests/files/input/hx4r26/ts/src/pro/venue.ts @@ -0,0 +1,15 @@ +import Exchange from '../base/Exchange'; +import type { Dict } from '../base/Exchange'; +export default class venue extends Exchange { + watchA (params: Dict = {}) { + const [ stock, paramsStock ] = this.handleOptionBoolAndParams (params, 'watchA', 'stock', false); + paramsStock['stock'] = stock; + return paramsStock; + } + watchB () { + const request: Dict = {}; + const [ stock, paramsLocal ] = this.handleOptionBoolAndParams (request, 'watchB', 'stock', false); + paramsLocal['stock'] = stock; + return paramsLocal; + } +} diff --git a/tests/files/input/hx4r26/ts/src/venue.ts b/tests/files/input/hx4r26/ts/src/venue.ts new file mode 100644 index 00000000..f5edb0e8 --- /dev/null +++ b/tests/files/input/hx4r26/ts/src/venue.ts @@ -0,0 +1,28 @@ +import Exchange from './base/Exchange'; +import type { Dict } from './base/Exchange'; +export default class venue extends Exchange { + fetchA (params: Dict = {}) { + const [ stock, paramsStock ] = this.handleOptionBoolAndParams (params, 'fetchA', 'stock', false); + if (stock) { + paramsStock['stock'] = true; + } + return paramsStock; + } + fetchB (market: Dict, params: Dict = {}) { + let paramsType = undefined; + let type = undefined; + [ type, paramsType ] = this.handleMarketTypeAndParams ('fetchB', market, params); + paramsType['kind'] = type; + return paramsType['other']; + } + fetchC (loose: any) { + const [ ok, paramsLoose ] = this.handleOptionBoolAndParams (this.options['x'], 'fetchC', 'y', false); + paramsLoose['z'] = ok; + return paramsLoose; + } + fetchD (params: Dict = {}) { + const [ ok, paramsOther ] = this.handleOther (params); + paramsOther['w'] = ok; + return paramsOther; + } +} diff --git a/tests/go-helper-inlining.test.ts b/tests/go-helper-inlining.test.ts index ac72332b..c711cc4b 100644 --- a/tests/go-helper-inlining.test.ts +++ b/tests/go-helper-inlining.test.ts @@ -116,10 +116,10 @@ describe('go .length -> len on a slice', () => { expect(output).toContain('var n int = len(s)'); expect(output).not.toContain('GetLength('); }); - test('a *string local keeps GetLength', () => { + test('a *string local that may be nil keeps the length helper', () => { const ts = "class Test {\n" + - " safeString (a: any, b: any): string { return a[b]; }\n" + + " safeString (a: any, b: any): string | undefined { return a[b]; }\n" + " f (a: any) {\n" + " const s = this.safeString (a, 'b')\n" + " const n = s.length\n" + @@ -127,7 +127,8 @@ describe('go .length -> len on a slice', () => { " }\n" + "}"; const output = transpile(ts); - expect(output).toContain('GetLength(s)'); + expect(output).toContain('GetArrayLength(s)'); + expect(output).not.toContain('len(*s)'); expect(output).not.toContain('len(s)'); }); test('a *string local with a TS-`any` type keeps GetArrayLength', () => { @@ -180,7 +181,7 @@ describe('go .length -> len on a slice', () => { " }\n" + "}"; const output = transpile(ts); - expect(output).toContain('Subtract(GetLength(s), 2)'); + expect(output).toContain('int64(GetLength(s)) - 2'); expect(output).not.toContain('len(s)'); }); }); diff --git a/tests/goTranspiler.test.ts b/tests/goTranspiler.test.ts index d254b7d1..f987b648 100644 --- a/tests/goTranspiler.test.ts +++ b/tests/goTranspiler.test.ts @@ -2435,7 +2435,8 @@ describe('go ordered comparisons with signed literals and pointer locals', () => "}\n"; const output = squash(transpiler.transpileGo(input).content); expect(output).toContain("IsGreaterThan(x, since)"); - expect(output).toContain("IsGreaterThan(x, n)"); + // hx4 G09: the int side widens to int64 the way the helper converts it + expect(output).toContain("(x != nil && *x > int64(n))"); }); test('an unguarded call operand keeps the helper', () => { // the nil test would short-circuit the call the helper evaluates once @@ -2461,6 +2462,67 @@ describe('go ordered comparisons with signed literals and pointer locals', () => expect(output).toContain("return (GetLength(arr) > -1)"); expect(output).not.toContain("IsGreaterThan(GetLength(arr), -1)"); }); + // hx4 G09 + const g09Stubs = + " rateLimit: number = 2000;\n" + + " fetchHistoryCacheSize: number = 0;\n" + + " safeInteger(a, b, c = undefined) { return a; }\n" + + " safeFloat(a, b, c = undefined) { return a; }\n"; + test('hx4 G09: mixed int/int64/float64 kinds widen the narrower side', () => { + const input = + "class Exchange {\n" + + g09Stubs + + " f (arr, item) {\n" + + " const n = arr.length;\n" + + " const x = this.safeInteger (item, 'x');\n" + + " const g = this.safeFloat (item, 'g');\n" + + " return [ n >= x, x !== undefined && n < x, g !== undefined && g > n ];\n" + + " }\n" + + "}\n"; + const output = squash(transpiler.transpileGo(input).content); + expect(output).toContain("(x == nil || int64(n) >= *x)"); + expect(output).toContain("(int64(n) < *x)"); + expect(output).toContain("(*g > float64(n))"); + expect(output).not.toContain("IsGreaterThanOrEqual(n, x)"); + }); + test('hx4 G09: float64 `<` against another kind keeps the helper; a length read widens', () => { + const input = + "class Exchange {\n" + + g09Stubs + + " f (arr, item) {\n" + + " const n = arr.length;\n" + + " const g = this.safeFloat (item, 'g');\n" + + " const x = this.safeInteger (item, 'x');\n" + + " return [ g !== undefined && g < n, arr.length > x ];\n" + + " }\n" + + "}\n"; + const output = squash(transpiler.transpileGo(input).content); + expect(output).toContain("IsLessThan(g, n)"); + expect(output).toContain("(x == nil || int64(GetArrayLength(arr)) > *x)"); + }); + test('hx4 G09: base value fields compare natively', () => { + const input = + "class Exchange {\n" + + g09Stubs + + " f () {\n" + + " return [ this.rateLimit > 0, this.fetchHistoryCacheSize > 0 ];\n" + + " }\n" + + "}\n"; + const output = squash(transpiler.transpileGo(input).content); + expect(output).toContain("(this.RateLimit > 0)"); + expect(output).toContain("(this.FetchHistoryCacheSize > 0)"); + }); + test('hx4 G09: a same-named field outside the base class keeps the helper', () => { + const input = + "class Venue {\n" + + " rateLimit: number = 2000;\n" + + " f () {\n" + + " return this.rateLimit > 0;\n" + + " }\n" + + "}\n"; + const output = squash(transpiler.transpileGo(input).content); + expect(output).toContain("IsGreaterThan(this.RateLimit, 0)"); + }); }); describe('go native element assignment', () => { @@ -3142,7 +3204,7 @@ describe('go native element assignment', () => { expect(output).toContain("var z any = Mod(this.Milliseconds(), 0)"); expect(output).toContain("var float2 any = Mod(MathFloor(value), 2.5)"); }); - test('Subtract on an int-typed helper result keeps the helper (it returns int64)', () => { + test('Subtract on an int-typed helper result widens to int64 (the helper returns int64)', () => { const input = "class T {\n" + " f (a: string[]) {\n" + @@ -3151,7 +3213,8 @@ describe('go native element assignment', () => { " }\n" + "}\n" const output = transpiler.transpileGo(input).content; - expect(output).toContain("var n any = Subtract(GetArrayLength(a), 1)"); + expect(output).toContain("var n any = int64(GetArrayLength(a)) - 1"); + expect(output).not.toContain("Subtract("); }); test('Add on an int-typed helper result is native (the helper returns int too)', () => { const input = @@ -3189,7 +3252,7 @@ describe('go native element assignment', () => { expect(output).toContain("var index any = i + 1"); expect(output).not.toContain("Add(i, 1)"); }); - test('an inferred counter keeps Subtract and Multiply (both helpers return int64)', () => { + test('an inferred counter widens Subtract and Multiply to int64 (both helpers return int64)', () => { const input = "class T {\n" + " f (n: number) {\n" + @@ -3201,8 +3264,9 @@ describe('go native element assignment', () => { " }\n" + "}\n" const output = transpiler.transpileGo(input).content; - expect(output).toContain("Subtract(i, 1)"); - expect(output).toContain("Multiply(i, 2)"); + expect(output).toContain("int64(i) - 1"); + expect(output).toContain("int64(i) * 2"); + expect(output).not.toContain("var a any = i - 1"); }); test('an inferred counter keeps Add when its literal would not fit a Go int', () => { const input = @@ -3257,7 +3321,7 @@ describe('go native element assignment', () => { const output = transpiler.transpileGo(input).content; expect(output).toContain("callDynamically(\"log\", i+1, a)"); }); - test('an int64 call plus an int counter keeps the helper (mixed kinds)', () => { + test('an int64 call plus an int counter widens the int side (Add boxes int64 for the mix)', () => { const input = "class T {\n" + " milliseconds (): number { return 1; }\n" + @@ -3269,7 +3333,8 @@ describe('go native element assignment', () => { " }\n" + "}\n" const output = transpiler.transpileGo(input).content; - expect(output).toContain("Add(this.Milliseconds(), i)"); + expect(output).toContain("this.Milliseconds() + int64(i)"); + expect(output).not.toContain("Add("); }); test('concatenating into a typed string field is a compound assignment', () => { const input = @@ -5298,7 +5363,7 @@ describe('go native arithmetic result rows (Divide/Multiply/Subtract/Mod)', () = }); test('a declaration position keeps the call for the declared-local table', () => { expect(body(main(" const last = arr.length - 1;\n const rest = arr.length % 7;\n return [last, rest];\n"))) - .toContain("var last any = Subtract(GetArrayLength(arr), 1) var rest any = Mod(GetArrayLength(arr), 7)"); + .toContain("var last any = int64(GetArrayLength(arr)) - 1 var rest any = int64(GetArrayLength(arr)) % 7"); expect(body(main(" const scaled = 10 * 1000;\n return scaled;\n"))) .toContain("var scaled any = 10 * 1000"); }); @@ -5655,7 +5720,7 @@ describe('native parameter types (B-02)', () => { expect(output).toContain('func (this *Test) ParseStatus(status any) <-chan any {'); }); - test('a method outside the parse* family keeps the box', () => { + test('a method outside the parse* family with a proven caller prints *string (hx4 G11)', () => { const input = baseWithAccessors + "class Test extends Base {\n" + " statusOf (status: string | undefined) {\n" + @@ -5666,7 +5731,7 @@ describe('native parameter types (B-02)', () => { " }\n" + "}\n"; const output = transpiler.transpileGo(input).content; - expect(output).toContain('func (this *Test) StatusOf(status any) any {'); + expect(output).toContain('func (this *Test) StatusOf(status *string) any {'); }); }); @@ -5714,9 +5779,118 @@ describe('required string parameters of exchange-local methods', () => { "}\n"; const output = transpiler.transpileGo(input).content; expect(output).toContain('func (this *Test) CreateOrder(symbol any, typeVar any) any {'); - expect(output).toContain('func (this *Test) A(x any) any {'); + // hx4 G11: a Str parameter every caller passes a literal is a Go string + expect(output).toContain('func (this *Test) A(x string) any {'); + expect(output).toContain('func (this *Test) B(x any) any {'); + // hx4 G11: a SafeString caller proves the nil-guarded *string, never a bare string + expect(output).toContain('func (this *Test) C(x *string) any {'); + }); +}); + +describe('hx4 G11: required params of exchange-local methods typed from every caller', () => { + const base = + "type Dict = { [key: string]: any };\n" + + "type List = any[];\n" + + "type Str = string | undefined;\n" + + "class Base {\n" + + " safeString (a, b, c?) { return undefined; }\n" + + " safeValue (a, b, c?) { return undefined; }\n" + + " safeDict (a, b, c?): Dict { return {}; }\n" + + "}\n"; + + test('Str / Dict / List parameters proven by every caller go native, and so do their reads', () => { + const input = base + + "class Test extends Base {\n" + + " orderRequest (type: Str, side: string, market: Dict, items: List) {\n" + + " const isLimit = type === 'limit';\n" + + " const id = market['id'];\n" + + " return [ isLimit, side + '-x', id, items.length ];\n" + + " }\n" + + " use (o) {\n" + + " return this.orderRequest ('limit', 'buy', { 'id': o }, [ 1 ]);\n" + + " }\n" + + "}\n"; + const output = transpiler.transpileGo(input).content; + expect(output).toContain('func (this *Test) OrderRequest(typeVar string, side string, market map[string]any, items []any) any {'); + expect(output).not.toContain('IsEqual(typeVar, \"limit\")'); + expect(output).not.toContain('GetValue(market, \"id\")'); + expect(output).not.toContain('GetArrayLength(items)'); + }); + + test('an async method, a ?? default, a nil test, a mixed caller or a GetArg-bound optional keeps the box', () => { + const input = base + + "class Test extends Base {\n" + + " async a (x: Str) { return x === 'y'; }\n" + + " b (x: Str) { const v = x ?? 'd'; return v; }\n" + + " c (x: Str) { return x === undefined; }\n" + + " d (x: Str) { return x === 'y'; }\n" + + " e (x: Str = undefined) { return x === 'y'; }\n" + + " async use (o) {\n" + + " await this.a ('y');\n" + + " this.b ('y'); this.c ('y'); this.e ('y');\n" + + " this.d ('y'); this.d (this.safeValue (o, 'k'));\n" + + " return 1;\n" + + " }\n" + + "}\n"; + const output = transpiler.transpileGo(input).content; + expect(output).toContain('func (this *Test) aBody(ch chan any, x any) any {'); expect(output).toContain('func (this *Test) B(x any) any {'); expect(output).toContain('func (this *Test) C(x any) any {'); + expect(output).toContain('func (this *Test) D(x any) any {'); + expect(output).toContain('func (this *Test) E(optionalArgs ...any) any {'); + }); +}); + +describe('hx4 G13: numeric required params typed from every caller', () => { + const base = + "type Dict = { [key: string]: any };\n" + + "type Int = number | undefined;\n" + + "type Num = number | undefined;\n" + + "class Base {\n" + + " safeInteger (a, b, c?): Int { return undefined; }\n" + + " safeNumber (a, b, c?): Num { return undefined; }\n" + + " safeValue (a, b, c?) { return undefined; }\n" + + " milliseconds (): number { return 0; }\n" + + "}\n"; + + test('Int / Num parameters every caller passes as the same pointer go native', () => { + const input = base + + "class Test extends Base {\n" + + " closest (limit: Int, step: number) {\n" + + " if (limit === undefined) { return step; }\n" + + " return [ limit, step ];\n" + + " }\n" + + " use (o) {\n" + + " const l = this.safeInteger (o, 'l');\n" + + " const s = this.milliseconds ();\n" + + " return this.closest (l, s);\n" + + " }\n" + + "}\n"; + const output = transpiler.transpileGo(input).content; + expect(output).toContain('func (this *Test) Closest(limit *int64, step int64) any {'); + }); + + test('a mixed or any caller, an async method or a ?? default keeps the box', () => { + const input = base + + "class Test extends Base {\n" + + " a (limit: Int) { return limit; }\n" + + " b (limit: Int) { return limit; }\n" + + " async c (limit: Int) { return limit; }\n" + + " d (n: number) { const v = n ?? 1; return v; }\n" + + " async use (o) {\n" + + " const l = this.safeInteger (o, 'l');\n" + + " this.a (l); this.a (this.safeValue (o, 'x'));\n" + + " this.b (this.safeValue (o, 'x'));\n" + + " await this.c (l);\n" + + " this.d (this.safeValue (o, 'x'));\n" + + " return 1;\n" + + " }\n" + + "}\n"; + const output = transpiler.transpileGo(input).content; + expect(output).toContain('func (this *Test) A(limit any) any {'); + expect(output).toContain('func (this *Test) B(limit any) any {'); + expect(output).toContain('func (this *Test) cBody(ch chan any, limit any) any {'); + expect(output).toContain('func (this *Test) D(n any) any {'); }); }); @@ -6512,3 +6686,290 @@ describe('go string locals rewritten by self-concatenation', () => { expect(output).toContain('var d any = ""'); }); }); + +describe('go GetValue on GetArgMap-bound parameters (hx4 G01)', () => { + const run = (body: string) => { + const inst = new Transpiler({ verbose: false }); + (inst as any).goTranspiler.CCXT_GO_GETARG_DECLARED_TYPES = { 'Dict': 'map[string]any' }; + return inst.transpileGo( + 'type Dict = { [key: string]: any };\nclass T {\n safeString (a, b) { return a; }\n f (d: any, params: Dict = {}) {\n' + body + ' }\n}\n').content; + }; + test('a literal-key read handed to a safe* accessor indexes the map', () => { + const output = run(" return this.safeString (params['x'], 'z');\n"); + expect(output).toContain('var params map[string]any = GetArgMap(optionalArgs, 0, map[string]any{})'); + expect(output).toContain('this.SafeString(params["x"], "z")'); + }); + test('a nested element read indexes the first step', () => { + const output = run(" return params['x']['y'];\n"); + expect(output).toContain('GetValue(params["x"], "y")'); + }); + test('a bare read keeps GetValue (a *T value would lose its deref)', () => { + const output = run(" const a = params['x'];\n return [ a, this.safeString (params, 'z') ];\n"); + expect(output).toContain('GetValue(params, "x")'); + }); + test('a compared element keeps the helper deref', () => { + const output = run(" if (this.safeString (params['y'], 'k') === undefined) { return 1; }\n if (params['y'] === undefined) { return 1; }\n return 0;\n"); + expect(output).toContain('IsEqual(GetValue(params, "y"), nil)'); + expect(output).toContain('this.SafeString(params["y"], "k")'); + }); + test('a non-literal key keeps GetValue', () => { + const output = run(" return this.safeString (params[d], 'z');\n"); + expect(output).toContain('GetValue(params, d)'); + }); + test('a parameter without a map binding keeps GetValue', () => { + const output = new Transpiler({ verbose: false }).transpileGo( + 'class T {\n safeString (a, b) { return a; }\n f (d: any, params = undefined) {\n return this.safeString (params[\'x\'], \'z\');\n }\n}\n').content; + expect(output).toContain('GetValue(params, "x")'); + }); +}); +describe('go GetValue on GetArgMap-bound parameters: element-write values (hx4 G01)', () => { + test('the value of an element write keeps GetValue for the write pass', () => { + const inst = new Transpiler({ verbose: false }); + (inst as any).goTranspiler.CCXT_GO_GETARG_DECLARED_TYPES = { 'Dict': 'map[string]any' }; + const output = inst.transpileGo('type Dict = { [key: string]: any };\nclass T {\n f (d: any, params: Dict = {}) {\n const r = {};\n r[d] = params[\'x\'];\n return r;\n }\n}\n').content; + expect(output).toContain('GetValue(params, "x")'); + }); +}); + +describe('hx4 G02: IsEqual(x, nil) on any locals fed by base safeValue / ws caches', () => { + const root = nodepath.join(__dirname, 'files', 'tmp-hx4-g02', 'ts', 'src'); + const BASE = "export class Exchange {\n" + + " options: any = {};\n" + + " safeValue (o: any, k: any, d: any = undefined): any { return d; }\n" + + " safeValue2 (o: any, k1: any, k2: any, d: any = undefined): any { return d; }\n" + + " safeString (o: any, k: any, d: any = undefined): string { return d; }\n" + + "}\n"; + const write = (body: string, extra = ''): string => { + nodefs.mkdirSync(nodepath.join(root, 'base'), { recursive: true }); + nodefs.writeFileSync(nodepath.join(root, 'base', 'Exchange.ts'), BASE); + const file = nodepath.join(root, 'ex.ts'); + nodefs.writeFileSync(file, "import { Exchange } from './base/Exchange';\n" + + "class ArrayCache { constructor (n: any) {} }\n" + + "export class ex extends Exchange {\n" + extra + + " f (p: any) {\n" + body + " return 0;\n }\n}\n"); + return new Transpiler({ verbose: false, go: {} }).transpileGoByPath(file).content; + }; + afterAll(() => nodefs.rmSync(nodepath.join(__dirname, 'files', 'tmp-hx4-g02'), { recursive: true, force: true })); + + test('a base safeValue local compares natively', () => { + const out = write(" const v = this.safeValue (p, 'a');\n if (v === undefined) { return 1; }\n if (v !== undefined) { return 2; }\n"); + expect(out).toContain('if v == nil {'); + expect(out).toContain('if v != nil {'); + expect(out).not.toContain('IsEqual(v, nil)'); + }); + test('safeValue2 with a literal default and a ws cache write compare natively', () => { + const out = write(" let v = this.safeValue2 (p, 'a', 'b', {});\n if (v === undefined) { v = new ArrayCache (5); }\n if (v === undefined) { return 1; }\n"); + expect(out).not.toContain('IsEqual(v, nil)'); + }); + test('a non-literal default keeps the helper', () => { + const out = write(" const v = this.safeValue (p, 'a', this.options);\n if (v === undefined) { return 1; }\n"); + expect(out).toContain('IsEqual(v, nil)'); + }); + test('an exchange override of safeValue keeps the helper', () => { + const out = write(" const v = this.safeValue (p, 'a');\n if (v === undefined) { return 1; }\n", + " safeValue (o: any, k: any, d: any = undefined): any { return this.safeString (o, k); }\n"); + expect(out).toContain('IsEqual(v, nil)'); + }); + test('a later pointer write keeps the helper', () => { + const out = write(" let v = this.safeValue (p, 'a');\n if (p) { v = this.safeString (p, 'b'); }\n if (v === undefined) { return 1; }\n"); + expect(out).toContain('IsEqual(v, nil)'); + }); +}); + +// hx4 G04: int/int64 widening and string-literal-union concat leaves +describe('hx4 G04 go arithmetic residual', () => { + const squash = (output: string) => output.replace(/[\t ]+/g, ' '); + test('int64 minus an int local widens the int side', () => { + const input = + "class Exchange {\n" + + " milliseconds (): number { return 1; }\n" + + " main (rows: string[]) {\n" + + " const n = rows.length;\n" + + " let now = this.milliseconds ();\n" + + " let x = undefined;\n" + + " x = now - n;\n" + + " return x;\n" + + " }\n" + + "}\n"; + const output = squash(transpiler.transpileGo(input).content); + expect(output).toContain('x = now - int64(n)'); + expect(output).not.toContain('Subtract('); + }); + test('an int local times an int64 call widens the int side', () => { + const input = + "class Exchange {\n" + + " milliseconds (): number { return 1; }\n" + + " main (rows: string[]) {\n" + + " const n = rows.length;\n" + + " let x = undefined;\n" + + " x = n * this.milliseconds ();\n" + + " return x;\n" + + " }\n" + + "}\n"; + const output = squash(transpiler.transpileGo(input).content); + expect(output).toContain('x = int64(n) * this.Milliseconds()'); + }); + test('mixed-width Divide and Mod keep the helper (nil / NaN on a zero divisor)', () => { + const input = + "class Exchange {\n" + + " milliseconds (): number { return 1; }\n" + + " main (rows: string[]) {\n" + + " const n = rows.length;\n" + + " const now = this.milliseconds ();\n" + + " let x = undefined;\n" + + " x = now / n;\n" + + " let y = undefined;\n" + + " y = now % n;\n" + + " return [x, y];\n" + + " }\n" + + "}\n"; + const output = squash(transpiler.transpileGo(input).content); + expect(output).toContain('Divide(now, n)'); + expect(output).toContain('Mod(now, n)'); + }); + test('an any operand keeps Subtract', () => { + const input = + "class Exchange {\n" + + " main (a: any, rows: string[]) {\n" + + " const n = rows.length;\n" + + " let x = undefined;\n" + + " x = a - n;\n" + + " return x;\n" + + " }\n" + + "}\n"; + const output = squash(transpiler.transpileGo(input).content); + expect(output).toContain('Subtract(a, n)'); + }); + test('a *string narrowed to a string-literal union is a concat leaf', () => { + const input = + "class Exchange {\n" + + " safeStringUpper (a: any, b: string): string | undefined { return a; }\n" + + " main (order: any) {\n" + + " const type = this.safeStringUpper (order, 'type');\n" + + " if (type === 'STOP_MARKET' || type === 'STOP_LIMIT') {\n" + + " throw new Error ('Invalid order type: ' + type + '.');\n" + + " }\n" + + " return 'x' + type;\n" + + " }\n" + + "}\n"; + const output = squash(transpiler.transpileGo(input).content); + expect(output).toContain('Error(\"Invalid order type: \" + *typeVar + \".\")'); + // outside the guard the local may be nil: the helper stays + expect(output).toContain('Add(\"x\", typeVar)'); + }); +}); + +describe('hx4 G06 length / indexOf on proven non-nil *string', () => { + const sq = (s: string) => s.replace(/\s+/g, ' '); + test('a narrowed *string length and indexOf deref natively', () => { + const input = + "class Exchange {\n" + + " safeString (a, b, c = undefined): string | undefined { return a; }\n" + + " main (item) {\n" + + " const side = this.safeString (item, 'side');\n" + + " if (side !== undefined) {\n" + + " if (side.length < 1) { return 'a'; }\n" + + " if (side.indexOf ('-') >= 0) { return 'b'; }\n" + + " }\n" + + " return 'c';\n" + + " }\n" + + "}\n"; + const output = sq(transpiler.transpileGo(input).content); + expect(output).toContain('len(*side) < 1'); + expect(output).toContain('strings.Index(*side, "-")'); + expect(output).not.toContain('GetLength(side)'); + expect(output).not.toContain('GetIndexOf(side'); + }); + test('a defaulted SafeString local derefs; an un-narrowed nilable one keeps the helpers', () => { + const input = + "class Exchange {\n" + + " safeString (a, b, c = undefined): string | undefined { return a; }\n" + + " main (item) {\n" + + " const tag = this.safeString (item, 'tag', '');\n" + + " const raw = this.safeString (item, 'raw');\n" + + " const n = tag.length;\n" + + " return [ n, raw.length, raw.indexOf ('x'), tag.indexOf (raw) ];\n" + + " }\n" + + "}\n"; + const output = sq(transpiler.transpileGo(input).content); + expect(output).toContain('len(*tag)'); + expect(output).toMatch(/Get(Array)?Length\(raw\)/); + expect(output).not.toContain('len(*raw)'); + expect(output).toContain('if raw == nil { return -1 }'); // pre-existing guarded literal + expect(output).not.toContain('strings.Index(*tag, raw'); + }); +}); + +// hx4 G08 +describe('go string helpers on a *string narrowed to string literals', () => { + test('a literal-union narrowed *string is dereferenced, a nilable or mixed one keeps the helper', () => { + const input = + "type Str = string | undefined;\n" + + "class Base { safeString (a, b, c?): Str { return undefined; } }\n" + + "class Test extends Base {\n" + + " main (d, n: number) {\n" + + " const x = this.safeString (d, 'a');\n" + + " const y = this.safeString (d, 'b');\n" + + " const z = this.safeString (d, 'c');\n" + + " const r = [];\n" + + " if ((x === 'TAKER') || (x === 'MAKER')) {\n" + + " r.push (x.toLowerCase ());\n" + + " r.push (x.split ('A'));\n" + + " r.push (x.toString ());\n" + + " }\n" + + " if ((y === 'Q') || (n === 1)) {\n" + + " r.push (y.toUpperCase ());\n" + + " }\n" + + " r.push (z.toLowerCase ());\n" + + " return r;\n" + + " }\n" + + "}\n"; + const output = transpiler.transpileGo(input).content; + expect(output).toContain('strings.ToLower(*x)'); + expect(output).toContain('strings.Split(*x, "A")'); + expect(output).toContain('r = append(r, *x)'); + // `y` is not narrowed when `n === 1` holds: helper kept + expect(output).toContain('ToUpper(y)'); + expect(output).not.toContain('strings.ToUpper(*y)'); + // `z` is never tested: nil reaches the helper's "" branch + expect(output).toContain('ToLower(z)'); + expect(output).not.toContain('strings.ToLower(*z)'); + }); +}); + +// hx4 X02: currency rows (Currency()/SafeCurrency() return CurrencyTyped rows) read bare +describe('go GetValue on currency rows (hx4 X02)', () => { + const run = (body: string) => { + const inst: any = new Transpiler({ verbose: false }); + const g = inst.goTranspiler; + const upstream = g.goIndexableTypeOf; + // stands in for the ccxt printed-declaration table: `c` is declared map[string]any + g.goIndexableTypeOf = function (node, printed) { + const known = upstream.call(this, node, printed); + if ((known !== undefined) || (node?.text !== 'c')) { + return known; + } + const access = node.parent; + return ((access?.expression === node) && (this['g01' + 'ReadOk'](node, access) !== 'map[string]any')) ? undefined : 'map[string]any'; + }; + return inst.transpileGo("interface CurrencyInterface { id: string; code: string; }\ntype Currency = CurrencyInterface | undefined;\n" + + "class T {\n currency (code: string): CurrencyInterface { return undefined; }\n safeCurrency (id: string): CurrencyInterface { return undefined; }\n" + + " safeDict (a, b) { return a; }\n f (code: string) {\n let c: Currency = undefined;\n" + body + " }\n}\n").content; + }; + test('a local written only by this.currency reads bare', () => { + const out = run(" if (code) { c = this.currency (code); }\n const b = c['id'];\n return b;\n"); + expect(out).toContain('var b any = c["id"]'); + }); + test('a local written by this.safeCurrency reads bare', () => { + const out = run(" c = this.safeCurrency (code);\n return c['code'];\n"); + expect(out).toContain('return c["code"]'); + }); + test('another write keeps GetValue', () => { + const out = run(" c = this.currency (code);\n c = this.safeDict (code, 'x');\n return c['id'];\n"); + expect(out).toContain('GetValue(c, "id")'); + }); + test('a compared read keeps GetValue', () => { + const out = run(" c = this.currency (code);\n if (c['id'] === 'x') { return 1; }\n return 0;\n"); + expect(out).not.toContain('c["id"] =='); + }); +}); diff --git a/tests/integration/rust/src/helpers.rs b/tests/integration/rust/src/helpers.rs index 16641206..dafc3017 100644 --- a/tests/integration/rust/src/helpers.rs +++ b/tests/integration/rust/src/helpers.rs @@ -39,6 +39,11 @@ impl Value { Value::Dict(std::sync::Arc::new(m)) } + #[allow(non_snake_case)] + pub fn Array(l: Vec) -> Value { + Value::Arr(l) + } + pub fn as_bool(&self) -> Option { match self { Value::Bool(b) => Some(*b), @@ -89,6 +94,16 @@ impl From> for Value { } } +pub trait ShiftRemoveExt { + fn shift_remove(&mut self, k: &str) -> Option; +} + +impl ShiftRemoveExt for HashMap { + fn shift_remove(&mut self, k: &str) -> Option { + self.remove(k) + } +} + impl fmt::Display for Value { fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { match self { diff --git a/tests/javaTranspiler.test.ts b/tests/javaTranspiler.test.ts index ee1abdcc..4addf172 100644 --- a/tests/javaTranspiler.test.ts +++ b/tests/javaTranspiler.test.ts @@ -6733,3 +6733,617 @@ describe('java element write after a hand-back destructuring', () => { expect(output).toContain('Helpers.addElementToObject(request, "b", null)'); }); }); + +// hx4 J01: `m[k] = v` on a declared Map local whose every write is a +// provably non-concurrent map prints `m.put(k, v)`, null value included +describe('hx4 J01: declared-map element write prints native put', () => { + const TMP = path.join(__dirname, 'files', 'tmp-hx4-j01'); + const BASE_FIXTURE = path.join(TMP, 'ts', 'src', 'base', 'Exchange.ts'); + const MAP_TYPE = 'Map'; + const source = + "class T {\n" + + " options: any = {};\n" + + " safeDict(d: any, k: any, def: any = undefined): any { return def; }\n" + + " extend(...args: any[]): any { return {}; }\n" + + " omit(x: any, ...args: any[]): any { return x; }\n" + + " safeString(d: any, k: any): string | undefined { return undefined; }\n" + + " p1(response: any): void {\n" + + " const data = this.safeDict(response, 'data', {});\n" + + " data['ts'] = this.safeString(response, 'ts');\n" + + " }\n" + + " p2(params: any, code: string): void {\n" + + " let request = this.extend({ 'a': 1 }, params);\n" + + " request = this.omit(request, 'a');\n" + + " request[code] = this.safeString(params, 'x');\n" + + " }\n" + + " safeList(d: any, k: any, def: any = undefined): any { return def; }\n" + + " p3(response: any): void {\n" + + " const rows = this.safeList(response, 'data', []);\n" + + " const first = this.safeDict(rows, 0, {});\n" + + " first['ts'] = this.safeString(response, 'ts');\n" + + " }\n" + + " n1(): void {\n" + + " const o = this.safeDict(this.options, 'ws', {});\n" + + " o['x'] = this.safeString(o, 'y');\n" + + " }\n" + + " n5(client: any, h: string): void {\n" + + " const subs = client.subscriptions;\n" + + " const s = this.safeDict(subs, h, {});\n" + + " s['x'] = this.safeString(s, 'y');\n" + + " }\n" + + " n2(params: any): void {\n" + + " params['x'] = this.safeString(params, 'y');\n" + + " }\n" + + " n3(response: any, other: any): void {\n" + + " let data = this.safeDict(response, 'data', {});\n" + + " data = other;\n" + + " data['x'] = this.safeString(response, 'y');\n" + + " }\n" + + " n4(response: any, key: any): void {\n" + + " const data = this.safeDict(response, 'data', {});\n" + + " data[key] = 1;\n" + + " }\n" + + "}"; + + let withMaps: string; + let noResolver: string; + + beforeAll(() => { + fs.mkdirSync(path.dirname(BASE_FIXTURE), { recursive: true }); + fs.writeFileSync(BASE_FIXTURE, source); + const byPath = new Transpiler({ 'verbose': false, 'java': { 'parser': { 'NUM_LINES_END_FILE': 0 } } }); + noResolver = byPath.transpileJavaByPath(BASE_FIXTURE).content; + const printer: any = (byPath as any).javaTranspiler; + printer.javaDeclaredLocalTypeResolver = (declaration: any) => + (declaration?.kind !== undefined && ['data', 'request', 'o', 'params', 'first', 's'].includes(declaration.name?.text)) ? MAP_TYPE : undefined; + withMaps = byPath.transpileJavaByPath(BASE_FIXTURE).content; + }); + + afterAll(() => { + fs.rmSync(TMP, { recursive: true, force: true }); + }); + + test('safeDict of a parameter with a literal default: native put of a nullable value', () => { + expect(withMaps).toContain('data.put("ts", this.safeString(response, "ts"))'); + }); + + test('safeDict of a safeList local: native put', () => { + expect(withMaps).toContain('first.put("ts", this.safeString(response, "ts"))'); + }); + + test('extend/omit local with a string key: native put', () => { + expect(withMaps).toMatch(/request\.put\(\(String\)code, this\.safeString\(parameters, "x"\)\)/); + }); + + test('safeDict of a field map keeps the helper (ConcurrentHashMap null removal)', () => { + expect(withMaps).toMatch(/Helpers\.addElementToObject\(o, "x"/); + }); + + test('safeDict of ws client subscriptions keeps the helper', () => { + expect(withMaps).toMatch(/Helpers\.addElementToObject\(s, "x"/); + }); + + test('a parameter receiver keeps the helper', () => { + expect(withMaps).toMatch(/Helpers\.addElementToObject\(parameters, "x"/); + }); + + test('a local reassigned from an unproven value keeps the helper', () => { + expect(withMaps).toMatch(/Helpers\.addElementToObject\(data, "x"/); + }); + + test('a non-string key keeps the helper', () => { + expect(withMaps).toContain('Helpers.addElementToObject(data, key, 1)'); + }); + + test('no declared-type consumer: every write keeps the helper', () => { + expect(noResolver).not.toMatch(/data\.put\(/); + expect(noResolver).not.toMatch(/request\.put\(/); + }); +}); + +describe('hx4 J02: more hand-written base map fields read natively', () => { + // tickers / bidsasks / trades / fees / urls / markets_by_id are BaseExchange.java map fields that + // can be null; a non-literal key can be null too (ConcurrentHashMap.get(null) throws): both guarded + const fields = + "type D = { [key: string]: any };\n" + + "class T {\n" + + " tickers: D = {};\n" + + " bidsasks: D = {};\n" + + " trades: D = {};\n" + + " fees: any = {};\n" + + " urls: any = {};\n" + + " markets_by_id: D | undefined = undefined;\n" + + " tradez: any = {};\n"; + + test('string-keyed reads print the guarded accessor', () => { + const input = fields + + " test(symbol: string, k: any): void {\n" + + " const a = this.tickers[symbol];\n" + + " const b = this.trades[symbol];\n" + + " const c = this.fees['trading'];\n" + + " const d = this.markets_by_id[k];\n" + + " const e = this.bidsasks[symbol];\n" + + " this.something(a, b, c, d, e);\n" + + " }\n" + + " something(...args: any[]): void {}\n" + + "}"; + const output = transpiler.transpileJava(input).content; + expect(output).toContain("(symbol == null || this.tickers == null ? null : ((java.util.Map)this.tickers).get(symbol))"); + expect(output).toContain("(symbol == null || this.trades == null ? null : ((java.util.Map)this.trades).get(symbol))"); + expect(output).toContain("(symbol == null || this.bidsasks == null ? null : ((java.util.Map)this.bidsasks).get(symbol))"); + expect(output).toContain("(this.fees == null ? null : ((java.util.Map)this.fees).get(\"trading\"))"); + expect(output).toContain("(k == null || this.markets_by_id == null ? null : ((java.util.Map)this.markets_by_id).get(k))"); + expect(output).not.toContain("Helpers.GetValue(this."); + }); + + test('nested read: only the field step goes native; a write target and other fields keep the helper', () => { + const input = fields + + " test(api: string, symbol: string, v: any): void {\n" + + " const a = this.urls['api'][api];\n" + + " const b = this.tradez[symbol];\n" + + " this.tickers[symbol] = v;\n" + + " const c = this.fees[this.key()];\n" + + " this.something(a, b, c);\n" + + " }\n" + + " key(): any { return 'k'; }\n" + + " something(...args: any[]): void {}\n" + + "}"; + const output = transpiler.transpileJava(input).content; + expect(output).toContain("Helpers.GetValue((this.urls == null ? null : ((java.util.Map)this.urls).get(\"api\")), api)"); + expect(output).toContain("Helpers.GetValue(this.tradez, symbol)"); + expect(output).toContain("Helpers.addElementToObject(this.tickers, symbol, v)"); + expect(output).toContain("Helpers.GetValue(this.fees, this.key())"); + }); +}); + +describe('hx4 J05: integral mod compared with an int literal', () => { + const java = (src: string) => transpiler.transpileJava(src).content; + test('`(s.length % 2) !== 0` goes native', () => { + const out = java(`class T { + f(s: string): boolean { + return (s.length % 2) !== 0; + } +}`); + expect(out).toContain("((((double) ((String)s).length()) % ((double) 2))) != 0)"); + expect(out).not.toContain("Helpers.isEqual"); + }); + test('negative: a box-declared dividend keeps the helper', () => { + const out = java(`class T { + f(s: string): boolean { + const n = s.length; + return (n % 2) !== 0; + } +}`); + expect(out).toContain("!Helpers.isEqual("); + }); + test('for-counter `(i % 2) < 1` goes native', () => { + const out = java(`class T { + f(xs: string[]): void { + for (let i = 0; i < xs.length; i++) { + if ((i % 2) < 1) { + return; + } + } + } +}`); + expect(out).toContain("(((double) i) % ((double) 2))) < 1)"); + expect(out).not.toContain("Helpers.isLessThan"); + }); + test('negative: mod by a fractional literal keeps the helper', () => { + const out = java(`class T { + f(s: string): boolean { + const n = s.length; + return (n % 1.5) === 0; + } +}`); + expect(out).toContain("Helpers.isEqual("); + }); + test('negative: compared with a fractional literal keeps the helper', () => { + const out = java(`class T { + f(s: string): boolean { + const n = s.length; + return (n % 2) < 0.5; + } +}`); + expect(out).toContain("Helpers.isLessThan("); + }); + test('negative: an `any` dividend keeps the helper', () => { + const out = java(`class T { + f(i: any): boolean { + return (i % 2) === 0; + } +}`); + expect(out).toContain("Helpers.isEqual("); + }); +}); + +// hx4 J06 +describe('java native indexOf on an ===-narrowed string-literal union (hx4 J06)', () => { + test('a plain string narrowed by === literals prints String.indexOf', () => { + const input = + "class T {\n" + + " test(path: string): void {\n" + + " if (path === 'a/algo' || path === 'b') {\n" + + " const i = path.indexOf('algo');\n" + + " }\n" + + " }\n" + + "}" + const output = transpiler.transpileJava(input).content; + expect(output).toContain("((String)path).indexOf(\"algo\")"); + expect(output).not.toContain("Helpers.getIndexOf"); + }); + + test('a declared literal union (may hold null) keeps the helper', () => { + const input = + "class T {\n" + + " test(path: 'a' | 'b'): void {\n" + + " const i = path.indexOf('a');\n" + + " }\n" + + "}" + const output = transpiler.transpileJava(input).content; + expect(output).toContain("Helpers.getIndexOf(path, \"a\")"); + }); + + test('a narrowed Str (string | undefined) local keeps the helper unless the target is a provable String', () => { + const input = + "type Str = string | undefined;\n" + + "class T {\n" + + " test(p: Str, t: any): void {\n" + + " if (p === 'x' || p === 'y') {\n" + + " const i = p.indexOf(t);\n" + + " }\n" + + " }\n" + + "}" + const output = transpiler.transpileJava(input).content; + expect(output).toContain("Helpers.getIndexOf(p, t)"); + }); + + test('a Str local narrowed by === literals prints String.indexOf for a literal target', () => { + const input = + "type Str = string | undefined;\n" + + "class T {\n" + + " test(): void {\n" + + " let payload: Str = undefined;\n" + + " payload = this.f();\n" + + " if ((payload === '/v4/order') || (payload === '/future/x')) {\n" + + " const i = payload.indexOf('future');\n" + + " }\n" + + " }\n" + + " f(): Str { return 'a'; }\n" + + "}" + const output = transpiler.transpileJava(input).content; + expect(output).toContain("((String)payload).indexOf(\"future\")"); + expect(output).not.toContain("Helpers.getIndexOf"); + }); + + test('an any receiver keeps the helper', () => { + const input = + "class T {\n" + + " test(p: any): void {\n" + + " const i = p.indexOf('x');\n" + + " }\n" + + "}" + const output = transpiler.transpileJava(input).content; + expect(output).toContain("Helpers.getIndexOf(p, \"x\")"); + }); +}); + +// hx4 J09: the proofs anchor on base-tier declarations, so the fixture mirrors the repo layout +describe('hx4 J09: isTrue / isInstance / core-argument residual', () => { + const TMP = path.join(__dirname, 'files', 'tmp-hx4-j09'); + const TYPES_FIXTURE = path.join(TMP, 'ts', 'src', 'base', 'types.ts'); + const ERRORS_FIXTURE = path.join(TMP, 'ts', 'src', 'base', 'errors.ts'); + const BASE_FIXTURE = path.join(TMP, 'ts', 'src', 'base', 'Exchange.ts'); + const VENUE_FIXTURE = path.join(TMP, 'ts', 'src', 'venuej09.ts'); + let out: string; + let byPath: Transpiler; + + beforeAll(() => { + fs.mkdirSync(path.dirname(TYPES_FIXTURE), { recursive: true }); + fs.writeFileSync(TYPES_FIXTURE, + "export interface Dictionary {\n [key: string]: T;\n}\n" + + "export type Dict = Dictionary;\n" + + "export type Str = string | undefined;\n" + + "export type Int = number | undefined;\n" + + "export type Bool = boolean | undefined;\n"); + fs.writeFileSync(ERRORS_FIXTURE, + "class BaseError extends Error {\n}\n" + + "class BadSymbol extends BaseError {\n}\n" + + "export { BaseError, BadSymbol };\n"); + fs.writeFileSync(BASE_FIXTURE, + "import type { Dict, Str, Int, Bool } from './types';\n" + + "export default class Exchange {\n" + + " safeBool (d: any, k: any, defaultValue: Bool = undefined): boolean | undefined {\n" + + " return defaultValue;\n" + + " }\n" + + " safeString (d: any, k: any, defaultValue: Str = undefined): Str {\n" + + " return defaultValue;\n" + + " }\n" + + " handlePostOnly (isMarketOrder: boolean, option: boolean, params: Dict = {}): [boolean, Dict] {\n" + + " if (isMarketOrder) {\n" + + " return [ true, params ];\n" + + " }\n" + + " return [ false, params ];\n" + + " }\n" + + " handleOptionAndParams (params: Dict, m: string, o: string, d: any = undefined): [any, Dict] {\n" + + " return [ d, params ];\n" + + " }\n" + + "}\n"); + fs.writeFileSync(VENUE_FIXTURE, + "import type { Dict, Str, Int } from './base/types';\n" + + "import Exchange from './base/Exchange';\n" + + "import { BadSymbol } from './base/errors';\n" + + "class Venue extends Exchange {\n" + + " fetchRows (symbol: Str = undefined, limit: Int = undefined, params: Dict = {}): void {\n" + + " }\n" + + " other (x: any): any {\n" + + " return x;\n" + + " }\n" + + " async later (x: any): Promise {\n" + + " return x;\n" + + " }\n" + + " boolDefault (params: Dict): void {\n" + + " const d = this.safeBool (params, 'a', false);\n" + + " const x1 = this.safeBool (params, 'b', d);\n" + + " if (x1) {\n" + + " return;\n" + + " }\n" + + " const x2 = this.safeBool (params, 'b', this.other (1));\n" + + " if (x2) {\n" + + " return;\n" + + " }\n" + + " }\n" + + " boolChain (params: Dict, flag: boolean): void {\n" + + " const raw = this.safeBool (params, 'a');\n" + + " let y1: boolean = false;\n" + + " if (raw !== undefined) {\n" + + " y1 = raw;\n" + + " }\n" + + " if (y1) {\n" + + " return;\n" + + " }\n" + + " let y2: boolean = false;\n" + + " if (raw !== undefined) {\n" + + " y2 = this.other (raw);\n" + + " }\n" + + " if (y2) {\n" + + " return;\n" + + " }\n" + + " if (flag) {\n" + + " return;\n" + + " }\n" + + " }\n" + + " postOnly (params: Dict): void {\n" + + " const [ p1, rest ] = this.handlePostOnly (false, false, params);\n" + + " if (p1) {\n" + + " return;\n" + + " }\n" + + " const [ p2, rest2 ] = this.handleOptionAndParams (params, 'm', 'p2');\n" + + " if (p2) {\n" + + " return;\n" + + " }\n" + + " }\n" + + " caught (params: Dict): void {\n" + + " try {\n" + + " this.safeString (params, 'a');\n" + + " } catch (e1) {\n" + + " if (e1 instanceof BadSymbol) {\n" + + " return;\n" + + " }\n" + + " if (e1 instanceof Error) {\n" + + " return;\n" + + " }\n" + + " }\n" + + " try {\n" + + " this.other (params);\n" + + " } catch (e2) {\n" + + " if (e2 instanceof BadSymbol) {\n" + + " return;\n" + + " }\n" + + " }\n" + + " }\n" + + " async caughtAsync (params: Dict) {\n" + + " try {\n" + + " await this.later (params);\n" + + " } catch (e3) {\n" + + " if (e3 instanceof BadSymbol) {\n" + + " return;\n" + + " }\n" + + " }\n" + + " }\n" + + " cores (rows: any[], other: any): void {\n" + + " const s = undefined;\n" + + " const n = rows.length;\n" + + " this.fetchRows (s, n);\n" + + " let t = undefined;\n" + + " t = other;\n" + + " this.fetchRows (t, other);\n" + + " }\n" + + "}\n"); + byPath = new Transpiler({ 'verbose': false, 'java': { 'parser': { 'NUM_LINES_END_FILE': 0 } } }); + const printer: any = (byPath as any).javaTranspiler; + printer.javaDeclaredLocalTypeResolver = (d: any) => (d?.name?.text === 'n' ? 'Integer' : undefined); + out = byPath.transpileJavaByPath(VENUE_FIXTURE).content; + }); + + afterAll(() => { + fs.rmSync(TMP, { recursive: true, force: true }); + }); + + test('a safeBool local with a proven Boolean default prints Boolean.TRUE.equals', () => { + expect(out).toContain('if (Boolean.TRUE.equals(x1))'); + expect(out).toContain('if (Helpers.isTrue(x2))'); + }); + + test('a boolean local written from a proven local prints Boolean.TRUE.equals', () => { + expect(out).toContain('if (Boolean.TRUE.equals(y1))'); + expect(out).toContain('if (Helpers.isTrue(y2))'); + expect(out).not.toContain('Boolean.TRUE.equals(flag)'); + }); + + test('a base tuple method returning boolean literals binds a Boolean element', () => { + expect(out).toContain('if (Boolean.TRUE.equals(p1))'); + expect(out).toContain('if (Helpers.isTrue(p2))'); + }); + + test('instanceof on a catch variable of a synchronous base-call try is native', () => { + expect(out).toContain('(e1 instanceof BadSymbol)'); + expect(out).toContain('Helpers.isInstance(e1, Error.class)'); + expect(out).toContain('Helpers.isInstance(e2, BadSymbol.class)'); + expect(out).toContain('Helpers.isInstance(e3, BadSymbol.class)'); + }); + + test('typed core slots: const undefined prints a typed null, Integer length widens', () => { + expect(out).toContain('this.fetchRows((String) null, ((long) n)'); + expect(out).toContain('Helpers.toStringArg(t)'); + expect(out).toContain('Helpers.toLongOrNull(other)'); + }); +}); + +describe('hx4 J15: equality on two declared numeric boxes compares values', () => { + const withTypes = (types: any, body: () => void) => { + const printer: any = (transpiler as any).javaTranspiler; + const previous = printer.javaDeclaredLocalTypeResolver; + printer.javaDeclaredLocalTypeResolver = (d: any) => types[String(d?.name?.text)]; + try { + body(); + } finally { + printer.javaDeclaredLocalTypeResolver = previous; + } + }; + const src = (expr: string) => + "class T {\\n" + + " f(p: any, q: any): boolean {\\n" + + " const a = p;\\n" + + " const b = q;\\n" + + " return " + expr + ";\\n" + + " }\\n" + + "}"; + + test('two Longs: Objects.equals, never a reference ==/!=', () => { + withTypes({ a: 'Long', b: 'Long' }, () => { + const eq = transpiler.transpileJava(src("a === b")).content; + const ne = transpiler.transpileJava(src("a !== b")).content; + expect(eq).toContain("java.util.Objects.equals(a, b)"); + expect(ne).toContain("!java.util.Objects.equals(a, b)"); + expect(eq + ne).not.toMatch(/a [!=]= b/); + }); + }); + + test('a Double box compares doubleValue with the helper null table', () => { + withTypes({ a: 'Double', b: 'Long' }, () => { + expect(transpiler.transpileJava(src("a === b")).content) + .toContain("(a == null ? b == null : (b != null && a.doubleValue() == b.doubleValue()))"); + }); + withTypes({ a: 'Double', b: 'Double' }, () => { + expect(transpiler.transpileJava(src("a !== b")).content) + .toContain("!(a == null ? b == null : (b != null && a.doubleValue() == b.doubleValue()))"); + }); + }); + + test('mixed integral boxes compare longValue', () => { + withTypes({ a: 'Integer', b: 'Long' }, () => { + expect(transpiler.transpileJava(src("a === b")).content) + .toContain("(a == null ? b == null : (b != null && a.longValue() == b.longValue()))"); + }); + }); + + test('a declared Boolean compares with Objects.equals', () => { + withTypes({ a: 'Boolean' }, () => { + expect(transpiler.transpileJava(src("a === b")).content).toContain("java.util.Objects.equals(a, b)"); + expect(transpiler.transpileJava(src("a !== true")).content).toContain("!java.util.Objects.equals(a, true)"); + }); + }); + + test('a box against a literal keeps the J05 guarded operator', () => { + withTypes({ a: 'Long' }, () => { + expect(transpiler.transpileJava(src("a === 5")).content).toContain("(a != null && a == 5)"); + }); + }); +}); + +// hx4 J16: an awaited implicit-API call (ts/src/abstract/.ts, body `this.request(..)`) is a fresh +// parse: a safeDict of its response takes the native put even when the call's arguments read a field +describe('hx4 J16: implicit-API response is a non-shared put source', () => { + const TMP = path.join(__dirname, 'files', 'tmp-hx4-j16'); + const BASE = path.join(TMP, 'ts', 'src', 'base', 'Exchange.ts'); + const ABSTRACT = path.join(TMP, 'ts', 'src', 'abstract', 'x.ts'); + const VENUE = path.join(TMP, 'ts', 'src', 'v.ts'); + let out: string; + + beforeAll(() => { + fs.mkdirSync(path.dirname(BASE), { recursive: true }); + fs.mkdirSync(path.dirname(ABSTRACT), { recursive: true }); + fs.writeFileSync(BASE, "export class T {\n" + + " options: any = {};\n" + + " request(path: any, api: any, method: any, params: any, config: any): Promise { return undefined as any; }\n" + + " safeDict(d: any, k: any, def: any = undefined): any { return def; }\n" + + " safeInteger(d: any, k: any): number | undefined { return undefined; }\n" + + " extend(...args: any[]): any { return {}; }\n" + + "}\n"); + fs.writeFileSync(ABSTRACT, "import { T } from '../base/Exchange.js';\n" + + "export abstract class X extends T {\n" + + " privatePostA (params = {}): Promise { return this.request ('a', 'private', 'POST', params, {}); }\n" + + " privatePostB (params = {}): Promise { return this.request ('b', 'private', 'POST', params, {}); }\n" + + "}\n"); + fs.writeFileSync(VENUE, "import { X } from './abstract/x.js';\n" + + "export class V extends X {\n" + + " other (params = {}): Promise { return this.request ('c', 'private', 'POST', params, {}); }\n" + + " async p1 (params: any): Promise {\n" + + " const response = await this.privatePostA (this.extend ({ 'a': this.options['x'] }, params));\n" + + " const data = this.safeDict (response, 'data', {});\n" + + " data['p1'] = this.safeInteger (response, 'requestTime');\n" + + " return data;\n" + + " }\n" + + " async p2 (params: any): Promise {\n" + + " let response = undefined;\n" + + " if (params['uta'] === true) {\n" + + " response = await this.privatePostA (this.extend ({ 'a': this.options['x'] }, params));\n" + + " } else {\n" + + " response = await this.privatePostB (this.extend ({ 'a': this.options['x'] }, params));\n" + + " }\n" + + " const data = this.safeDict (response, 'data', {});\n" + + " data['p2'] = this.safeInteger (response, 'requestTime');\n" + + " return data;\n" + + " }\n" + + " async n1 (params: any): Promise {\n" + + " const response = await this.other (this.extend ({ 'a': this.options['x'] }, params));\n" + + " const data = this.safeDict (response, 'data', {});\n" + + " data['n1'] = this.safeInteger (response, 'requestTime');\n" + + " return data;\n" + + " }\n" + + " async n2 (params: any): Promise {\n" + + " let response = await this.privatePostA (params);\n" + + " response = this.options;\n" + + " const data = this.safeDict (response, 'data', {});\n" + + " data['n2'] = this.safeInteger (response, 'requestTime');\n" + + " return data;\n" + + " }\n" + + "}\n"); + const byPath = new Transpiler({ 'verbose': false, 'java': { 'parser': { 'NUM_LINES_END_FILE': 0 } } }); + const printer: any = (byPath as any).javaTranspiler; + printer.javaDeclaredLocalTypeResolver = (declaration: any) => + (declaration?.kind !== undefined && declaration.name?.text === 'data') ? 'Map' : undefined; + out = byPath.transpileJavaByPath(VENUE).content; + }); + + afterAll(() => { + fs.rmSync(TMP, { recursive: true, force: true }); + }); + + test('awaited implicit-API response read off a field-reading argument: native put', () => { + expect(out).toContain('data.put("p1", this.safeInteger(response, "requestTime"))'); + }); + + test('null-initialised local written only by awaited implicit-API calls: native put', () => { + expect(out).toContain('data.put("p2", this.safeInteger(response, "requestTime"))'); + }); + + test('an awaited venue method (not in ts/src/abstract) keeps the helper', () => { + expect(out).toContain('Helpers.addElementToObject(data, "n1"'); + }); + + test('a response later reassigned from a field keeps the helper', () => { + expect(out).toContain('Helpers.addElementToObject(data, "n2"'); + }); +}); diff --git a/tests/rustTranspiler.test.ts b/tests/rustTranspiler.test.ts index 5dfc050d..a521a1c7 100644 --- a/tests/rustTranspiler.test.ts +++ b/tests/rustTranspiler.test.ts @@ -301,7 +301,7 @@ describe('rust transpiling tests', () => { expect(output).not.toContain('Value::Bool(a.as_f64()'); }); - test('string comparison keeps the helper', () => { + test('string comparison replicates the helper natively (hx4 R22)', () => { const ts = "let a = 'x';\n" + "let b = 'y';\n" + @@ -309,7 +309,7 @@ describe('rust transpiling tests', () => { " const x = 1;\n" + "}"; const output = transpiler.transpileRust(ts).content; - expect(output).toContain('is_less_than(&a, &b)'); + expect(output).toContain('(match (a.as_str(), b.as_str()) { (Some(__x), Some(__y)) => (match (__x.parse::(), __y.parse::()) { (Ok(__p), Ok(__q)) => __p < __q, _ => __x < __y }), _ => false })'); }); test('any-typed comparison keeps the helper', () => { @@ -320,7 +320,7 @@ describe('rust transpiling tests', () => { " const x = 1;\n" + "}"; const output = transpiler.transpileRust(ts).content; - expect(output).toContain('is_less_than(&a, &b)'); + expect(output).toContain('(match (&(a), &(b)) { (__a, __b) =>'); // hx4 R25 inline helper dispatch }); // One number at runtime already pins `<`/`>` to the helper's f64 compare @@ -359,7 +359,7 @@ describe('rust transpiling tests', () => { " }\n" + "}"; const output = transpiler.transpileRust(ts).content; - expect(output).toContain('is_greater_than_or_equal(&x, &y)'); + expect(output).toContain('(match (&(x), &(y)) { (__a, __b) =>'); // hx4 R25 }); test('less or equal with a single typed number operand keeps the helper', () => { @@ -370,7 +370,7 @@ describe('rust transpiling tests', () => { " }\n" + "}"; const output = transpiler.transpileRust(ts).content; - expect(output).toContain('is_less_than_or_equal(&x, &y)'); + expect(output).toContain('(match (&(x), &(y)) { (__a, __b) =>'); // hx4 R25 }); // A numeric literal / `.length` / `indexOf` is Int or Float at runtime, @@ -419,7 +419,7 @@ describe('rust transpiling tests', () => { " }\n" + "}"; const output = transpiler.transpileRust(ts).content; - expect(output).toContain('get_index_of(&s, &Value::Str("a".into())).as_f64().unwrap_or(f64::NAN) >= n.as_f64().unwrap_or(f64::NAN)'); + expect(output).toContain('_ => Value::Int(-1) }).as_f64().unwrap_or(f64::NAN) >= n.as_f64().unwrap_or(f64::NAN)'); expect(output).not.toContain('is_greater_than_or_equal('); }); @@ -438,7 +438,7 @@ describe('rust transpiling tests', () => { // Two strings are the helper's lexical branch — a numeric-string literal // goes through the same path, so it must keep the helper. - test('string against a numeric-string literal keeps the helper', () => { + test('string against a numeric-string literal keeps the f64 parse (hx4 R22)', () => { const ts = "function f(hex: string) {\n" + " if (hex >= '80') {\n" + @@ -446,7 +446,7 @@ describe('rust transpiling tests', () => { " }\n" + "}"; const output = transpiler.transpileRust(ts).content; - expect(output).toContain('is_greater_than_or_equal(&hex, &Value::Str("80".into()))'); + expect(output).toContain('(match (hex.as_str(), Some("80")) { (Some(__x), Some(__y)) => (match (__x.parse::(), __y.parse::()) { (Ok(__p), Ok(__q)) => __p > __q, _ => __x > __y }) || __x == __y, (None, None) => true, _ => false })'); }); test('object keys', () => { @@ -503,19 +503,19 @@ describe('rust transpiling tests', () => { test('subtraction wrapping', () => { const ts = 'const c = a - b;' const output = transpiler.transpileRust(ts).content; - expect(output).toContain('subtract(&a, &b)'); + expect(output).toContain('(match (&(a), &(b)) { (Value::Int(__x), Value::Int(__y)) => Value::Int(__x - __y),'); // hx4 R25 }); test('multiplication wrapping', () => { const ts = 'const c = a * b;' const output = transpiler.transpileRust(ts).content; - expect(output).toContain('multiply(&a, &b)'); + expect(output).toContain('(match (&(a), &(b)) { (Value::Int(__x), Value::Int(__y)) => Value::Int(__x * __y),'); // hx4 R25 }); test('division wrapping', () => { const ts = 'const c = a / b;' const output = transpiler.transpileRust(ts).content; - expect(output).toContain('divide(&a, &b)'); + expect(output).toContain('(Some(__x), Some(__y)) if __y != 0.0 => Value::Float(__x / __y)'); // hx4 R25 }); test('modulo wrapping', () => { @@ -528,25 +528,26 @@ describe('rust transpiling tests', () => { test('less than wrapping', () => { const ts = 'const r = a < b;' const output = transpiler.transpileRust(ts).content; - expect(output).toContain('is_less_than(&a, &b)'); + expect(output).toContain('(match (&(a), &(b)) { (__a, __b) =>'); // hx4 R25 inline helper dispatch }); test('less than or equal wrapping', () => { const ts = 'const r = a <= b;' const output = transpiler.transpileRust(ts).content; - expect(output).toContain('is_less_than_or_equal(&a, &b)'); + expect(output).toContain('__x < __y'); // hx4 R25 + expect(output).toContain('(Value::Null, Value::Null) => true'); }); test('greater than wrapping', () => { const ts = 'const r = a > b;' const output = transpiler.transpileRust(ts).content; - expect(output).toContain('is_greater_than(&a, &b)'); + expect(output).toContain('__x > __y'); // hx4 R25 }); test('greater than or equal wrapping', () => { const ts = 'const r = a >= b;' const output = transpiler.transpileRust(ts).content; - expect(output).toContain('is_greater_than_or_equal(&a, &b)'); + expect(output).toContain('__x > __y'); // hx4 R25 }); // Compound assignment @@ -559,7 +560,7 @@ describe('rust transpiling tests', () => { test('-= assignment', () => { const ts = 'x -= 1;' const output = transpiler.transpileRust(ts).content; - expect(output).toContain('x = subtract(&x, &Value::Int(1))'); + expect(output).toContain('x = (match (&(x), &(Value::Int(1))) { (Value::Int(__x), Value::Int(__y)) => Value::Int(__x - __y),'); // hx4 R25 }); // Postfix unary @@ -903,7 +904,7 @@ describe('rust transpiling tests', () => { test('indexOf call', () => { const ts = 'const i = arr.indexOf(x);' const output = transpiler.transpileRust(ts).content; - expect(output).toContain('get_index_of(&arr, &x)'); + expect(output).toContain('(match (&(arr), &(x))'); }); test('startsWith call', () => { @@ -951,13 +952,13 @@ describe('rust transpiling tests', () => { test('toUpperCase call', () => { const ts = 'const r = s.toUpperCase();' const output = transpiler.transpileRust(ts).content; - expect(output).toContain('to_upper(&s)'); + expect(output).toContain('(match &(s) { Value::Str(__s) => Value::Str(__s.to_uppercase().into())'); }); test('toLowerCase call', () => { const ts = 'const r = s.toLowerCase();' const output = transpiler.transpileRust(ts).content; - expect(output).toContain('to_lower(&s)'); + expect(output).toContain('(match &(s) { Value::Str(__s) => Value::Str(__s.to_lowercase().into())'); }); test('shift call', () => { @@ -975,7 +976,7 @@ describe('rust transpiling tests', () => { test('slice call', () => { const ts = 'const r = arr.slice(1, 3);' const output = transpiler.transpileRust(ts).content; - expect(output).toContain('slice(&arr,'); + expect(output).toContain('(match (&(arr), '); }); test('replace call', () => { @@ -1089,7 +1090,7 @@ describe('rust transpiling tests', () => { ' }\n' + '}'; const output = transpiler.transpileRust(ts).content; - expect(output).toContain('let mut ok: bool = starts_with(&s, &Value::Str("x".into()));'); + expect(output).toContain('let mut ok: bool = s.as_str().is_some_and(|__s| __s.starts_with("x"));'); }); // Rejected shapes: any sink that takes `&Value` keeps the local boxed. @@ -1549,13 +1550,15 @@ describe('rust checker-typed native container access', () => { expect(output).toContain('add(&a, &b)'); }); - test('number + string keeps the add helper', () => { + // hx4 R09: a non-null string side puts `add` on its string branch (stringify_simple == Display). + test('number + string emits native concat', () => { const ts = 'const a: number = 1;\n' + 'const s: string = "q";\n' + 'const c = a + s;'; const output = transpiler.transpileRust(ts).content; - expect(output).toContain('add(&a, &s)'); + expect(output).toContain('let mut c: Value = Value::Str(format!("{}{}", a, s).into());'); + expect(output).not.toContain('add(&a, &s)'); }); // phase-2 rust-19: a `Str` (`string | undefined`) operand holds only a @@ -1633,14 +1636,14 @@ describe('rust checker-typed native container access', () => { expect(output).toContain('add(&a, &b)'); }); - test('string + any keeps the add helper', () => { + test('always-Str local + any concatenates natively (hx4 R22)', () => { const ts = 'function h(): any { return 2; }\n' + 'const a: string = "x";\n' + 'const b = h();\n' + 'const c = a + b;'; const output = transpiler.transpileRust(ts).content; - expect(output).toContain('add(&a, &b)'); + expect(output).toContain('Value::Str(format!("{}{}", a, b).into())'); }); test('x++ / x-- on a number emit native increment', () => { @@ -2308,11 +2311,11 @@ describe('rust is_true over a proven boolean Value', () => { expect(output).not.toContain('is_true(&self.safeBool2'); }); - test('a boolean-returning method keeps the helper', () => { + test('a method returning only bool literals tests as_bool natively (hx4 R12)', () => { const ts = boolClass(' if (this.isLinear(this.options)) { return 1; }'); const output = transpiler.transpileRust(ts).content; - expect(output).toContain('is_true(&self.isLinear(self.options))'); - expect(output).not.toContain('matches!(self.isLinear'); + expect(output).toContain('if self.isLinear(self.options).as_bool() == Some(true) {'); + expect(output).not.toContain('is_true(&self.isLinear'); }); test('a logical stored in a Value local keeps the helper', () => { @@ -2469,17 +2472,17 @@ describe('rust native string search and slicing', () => { test('an unproven receiver keeps the helper', () => { const output = transpiler.transpileRust(stringMethod(" return a.indexOf('/');", 'a: any')).content; - expect(output).toContain('get_index_of(&a, &Value::Str("/".into()))'); + expect(output).toContain('(match (&(a), &(Value::Str("/".into())))'); }); test('an array receiver keeps the helper (the helper scans it)', () => { const output = transpiler.transpileRust(stringMethod(" return a.indexOf('/');", 'a: string[]')).content; - expect(output).toContain('get_index_of(&a, &Value::Str("/".into()))'); + expect(output).toContain('(match (&(a), &(Value::Str("/".into())))'); }); test('a non-literal needle keeps the helper', () => { - const output = transpiler.transpileRust(stringMethod(' return a.indexOf(b);', 'a: string, b: string')).content; - expect(output).toContain('get_index_of(&a, &b)'); + const output = transpiler.transpileRust(stringMethod(' return a.indexOf(b);', 'a: string, b: any')).content; + expect(output).toContain('(match (&(a), &(b))'); }); test('an escaped literal needle keeps its escapes', () => { @@ -2506,12 +2509,12 @@ describe('rust native string search and slicing', () => { test('slice keeps the helper for an expression bound', () => { const output = transpiler.transpileRust(stringMethod(' return a.slice(0, b);', 'a: string, b: number')).content; - expect(output).toContain('slice(&a, &Value::Int(0), &b)'); + expect(output).toContain('(match (&(a), (match &(Value::Int(0)) {'); }); test('slice keeps the helper for an unproven receiver', () => { const output = transpiler.transpileRust(stringMethod(' return a.slice(0, 2);', 'a: any')).content; - expect(output).toContain('slice(&a, &Value::Int(0), &Value::Int(2))'); + expect(output).toContain('(match (&(a), (match &(Value::Int(0)) {'); }); test('length on a nullable array or string is native', () => { @@ -3095,8 +3098,9 @@ describe('rust typed-parameter dict reads', () => { test('a reassigned Dict parameter keeps the helper (D2)', () => { const ts = DICT_DECL + + "function g (): any { return []; }\n" + "function f (balance: Dict, code: string) {\n" + - " balance = {};\n" + + " balance = g ();\n" + " return balance[code];\n" + "}"; const output = transpiler.transpileRust(ts).content; @@ -3672,8 +3676,9 @@ describe('rust typed-receiver native reads (D-28)', () => { test('an any-typed local keeps the helper', () => { const ts = 'class T {\n' + + ' g(): any { return []; }\n' + ' m(code: string) {\n' + - ' const currencies: any = {};\n' + + ' const currencies: any = this.g ();\n' + ' return currencies[code];\n' + ' }\n' + '}'; @@ -3686,9 +3691,10 @@ describe('rust typed-receiver native reads (D-28)', () => { const ts = PLAIN + 'class T {\n' + + ' g(): any { return []; }\n' + ' m(code: string) {\n' + ' let currencies: Plain = {};\n' + - ' currencies = {};\n' + + ' currencies = this.g ();\n' + ' return currencies[code];\n' + ' }\n' + '}'; @@ -3929,3 +3935,733 @@ describe('rust order book sides keep the runtime helpers', () => { expect(output).not.toContain('bids.as_array()'); }); }); + +describe('hx4 R01 native element writes on plain-dict locals', () => { + const insert = (receiver: string, key: string, value: string) => + `if let Value::Dict(__d) = &mut ${receiver} { std::sync::Arc::make_mut(__d).insert("${key}".into(), ${value}); }`; + let output = ''; + beforeAll(() => { + output = transpiler.transpileRustByPath('./tests/files/input/hx4r01/ts/src/venue.ts').content; + }); + + test('a base-tier account () builder local inserts natively (sibling-block bindings)', () => { + expect(output).toContain(insert('account', 'free', 'Value::Str("1".into())')); + expect(output).toContain(insert('account', 'used', 'Value::Str("0".into())')); + expect(output).not.toContain('add_element_to_object(&mut account'); + }); + + test('an undefined-initialised local reassigned only to literals inserts natively', () => { + expect(output).toContain(insert('headers', 'Content-Type', 'Value::Str("application/json".into())')); + }); + + test('element 0 of handleUntilOption on a plain request inserts natively', () => { + expect(output).toContain(insert('requestUntil', 'interval', 'Value::Str("1m".into())')); + }); + + test('a parse* result, a non-plain reassignment and a closure write keep the helper', () => { + expect(output).toContain('add_element_to_object(&mut order, &Value::Str("status".into())'); + expect(output).toContain('add_element_to_object(&mut mixed, &Value::Str("k".into())'); + expect(output).toContain('add_element_to_object(&mut captured, &Value::Str("free".into())'); + }); + + test('omit of itself / extend of plain dicts keep the local plain', () => { + expect(output).toContain(insert('request', 'b', 'Value::Int(2)')); + expect(output).toContain(insert('merged', 'd', 'Value::Int(4)')); + }); + + test('a local aliased into a let-bound literal keeps the helper', () => { + expect(output).toContain('add_element_to_object(&mut aliased, &Value::Str("Content-Type".into())'); + }); + + test('element 0 of a same-file tuple method returning a fresh literal inserts natively', () => { + expect(output).toContain(insert('request', 'settle', 'Value::Str("usdt".into())')); + expect(output).toContain('add_element_to_object(&mut echoed, &Value::Str("x".into())'); + }); + + test('omit / extend of a foreign dict keep the helper', () => { + expect(output).toContain('add_element_to_object(&mut foreign, &Value::Str("e".into())'); + expect(output).toContain('add_element_to_object(&mut extended, &Value::Str("f".into())'); + }); +}); + +describe('rust this-field dynamic dict reads (hx4 R02)', () => { + const DECL = 'interface Dictionary { [key: string]: T; }\ntype Dict = Dictionary;\nclass C { x: number; }\n'; + + test('a dynamic string key on a Dict-declared field reads natively', () => { + const ts = DECL + 'class A {\n balance: Dict = {};\n f (code: string) {\n const a = this.balance[code];\n return a;\n }\n}\n'; + const output = transpiler.transpileRust(ts).content; + expect(output).toContain('let mut a: Value = self.balance.as_map().and_then(|__m| code.as_str().and_then(|__k| __m.get(__k))).cloned().unwrap_or(Value::Null);'); + expect(output).not.toContain('get_value(&self.balance'); + }); + + test('a nested read on a Dictionary> field reads natively at both levels', () => { + const ts = DECL + 'class A {\n ohlcvs: Dictionary>;\n f (symbol: string, tf: string) {\n const a = this.ohlcvs[symbol][tf];\n return a;\n }\n}\n'; + const output = transpiler.transpileRust(ts).content; + expect(output).toContain('self.ohlcvs.as_map().and_then(|__m| symbol.as_str().and_then(|__k| __m.get(__k))).cloned().unwrap_or(Value::Null).as_map().and_then(|__m| tf.as_str().and_then(|__k| __m.get(__k))).cloned().unwrap_or(Value::Null)'); + expect(output).not.toContain('get_value('); + }); + + test('an any-declared field keeps the helper', () => { + const ts = DECL + 'class A {\n positions: any;\n f (code: string) {\n return this.positions[code];\n }\n}\n'; + const output = transpiler.transpileRust(ts).content; + expect(output).toContain('get_value(&self.positions, &code)'); + }); + + test('a numeric key and write targets keep the helper', () => { + const ts = DECL + 'class A {\n balance: Dict = {};\n f (code: string, n: number) {\n this.balance[code] = this.g (this.balance[code]);\n delete this.balance[code];\n return this.balance[n];\n }\n g (x) { return x; }\n}\n'; + const output = transpiler.transpileRust(ts).content; + expect(output).toContain('get_value(&self.balance, &n)'); + expect(output).toContain('self.g(get_value(&self.balance, &code))'); + expect(output).not.toContain('self.balance.as_map()'); + }); +}); + +describe('hx4 R04: native Vec push on typed array locals', () => { + const wrap = (body: string) => `class T {\n parseX (x) { return x; }\n filterBy (a, b) { return a; }\n f (items: any[]) {\n${body}\n }\n}`; + test('push-only local returned is a Vec with native push', () => { + const out = transpiler.transpileRust(wrap(' const result = [];\n result.push (items[0]);\n result.push (this.parseX (1));\n return result;')).content; + expect(out).toContain('let mut result: Vec = Vec::new();'); + expect(out).toContain('result.push(self.parseX(Value::Int(1)));'); + expect(out).toContain('return Value::from(result);'); + expect(out).not.toContain('append_to_array'); + }); + test('length read and this-call argument in a return box once', () => { + const out = transpiler.transpileRust(wrap(' const result = [];\n const item = items[0];\n result.push (item);\n const n = result.length;\n return this.filterBy (result, n);')).content; + expect(out).toContain('result.push(item.clone());'); + expect(out).toContain('Value::Int(result.len() as i64)'); + expect(out).toContain('return self.filterBy(Value::from(result), n);'); + }); + test('final-use argument / object value outside a loop box once', () => { + const out = transpiler.transpileRust(wrap(' const args = [];\n args.push (items[0]);\n const request = { \'args\': args };\n return this.parseX (request);')).content; + expect(out).toContain('let mut args: Vec = Vec::new();'); + expect(out).toContain('Value::from(args)'); + const out2 = transpiler.transpileRust(wrap(' const hashes = [];\n hashes.push (1);\n const r = this.filterBy (hashes, 1);\n return r;')).content; + expect(out2).toContain('self.filterBy(Value::from(hashes), Value::Int(1))'); + }); + test('negative: alias, non-return argument, element read or non-empty init keep the box', () => { + for (const body of [ + ' const out = [];\n out.push (1);\n const other = out;\n return other;', + ' const out = [];\n for (let i = 0; i < 2; i++) {\n out.push (i);\n this.parseX (out);\n }\n return 1;', + ' const out = [];\n out.push (1);\n return this.filterBy (out, out);', + ' const out = [ 1 ];\n out.push (2);\n return out;', + ' const out = [];\n out.push (out.length);\n return out;', + ' let out = [];\n out.push (1);\n out = [];\n return out;', + ]) { + const out = transpiler.transpileRust(wrap(body)).content; + // the box stays (hx4 R18 may spell its Arr push natively) + expect(out).toMatch(/append_to_array\(&mut out|if let Value::Arr\(__a\) = &mut out \{/); + expect(out).not.toContain('Vec'); + } + }); +}); + +describe('hx4 R05 native IndexMap ops on proven dict receivers', () => { + let rest = ''; + let ws = ''; + beforeAll(() => { + rest = transpiler.transpileRustByPath('./tests/files/input/hx4r05/ts/src/venue.ts').content; + ws = transpiler.transpileRustByPath('./tests/files/input/hx4r05/ts/src/pro/venue.ts').content; + }); + + test('k in this. reads contains_key', () => { + expect(rest).toContain('matches!((&self.balance, &code), (Value::Dict(__d), Value::Str(__k)) if __d.contains_key(__k.as_ref()))'); + expect(ws).toContain('matches!((&self.orderbooks, &symbol), (Value::Dict(__d), Value::Str(__k)) if __d.contains_key(__k.as_ref()))'); + }); + + test('delete on a dict field / literal-built local is shift_remove', () => { + expect(rest).toContain('if let (Value::Dict(__d), Value::Str(__k)) = (&mut self.balance, &code) { std::sync::Arc::make_mut(__d).shift_remove(__k.as_ref()); }'); + expect(rest).toContain('if let Value::Dict(__d) = &mut request { std::sync::Arc::make_mut(__d).shift_remove("a"); }'); + expect(ws).toContain('if let Value::Dict(__d) = &mut plain { std::sync::Arc::make_mut(__d).shift_remove("k"); }'); + }); + + test('Object.keys / Object.values on REST dicts and untagged fields are native', () => { + expect(rest).toContain('Value::Array(query.as_map().map(|__m| __m.keys().map(|__k| Value::Str(__k.clone().into())).collect()).unwrap_or_default())'); + expect(rest).toContain('Value::Array(self.tickers.as_map().map(|__m| __m.values().cloned().collect()).unwrap_or_default())'); + expect(ws).toContain('Value::Array(self.orderbooks.as_map().map(|__m| __m.keys()'); + }); + + test('any receivers, ws subscriptions and non-dict operands keep the helpers', () => { + expect(rest).toContain('remove(&mut response, &Value::Str("x".into()))'); + expect(rest).toContain('in_op(&response, &code)'); + expect(rest).toContain('object_keys(&flag)'); + expect(ws).toContain('in_op(&client.subscriptions, &messageHash)'); + expect(ws).toContain('remove(&mut client.subscriptions, &messageHash)'); + expect(ws).toContain('remove(&mut subs, &messageHash)'); + expect(ws).toContain('remove(&mut subscription, &symbol)'); + }); +}); + +describe('hx4 R06 native string methods on proven strings', () => { + const m = (body: string, params = 'a: string') => `class A {\n run(${params}) {\n${body}\n }\n}`; + const out = (body: string, params?: string) => transpiler.transpileRust(m(body, params)).content; + + test('toUpperCase / toLowerCase', () => { + const o = out(" const u = a.toUpperCase();\n const l = a.toLowerCase();\n return [u, l];"); + expect(o).toContain('let mut u: Value = a.as_str().map(|__s| Value::Str(__s.to_uppercase().into())).unwrap_or(Value::Null);'); + expect(o).toContain('let mut l: Value = a.as_str().map(|__s| Value::Str(__s.to_lowercase().into())).unwrap_or(Value::Null);'); + expect(o).not.toContain('to_upper(&'); + }); + test('split with a literal separator', () => { + expect(out(" return a.split('-');")).toContain('return Value::Array(a.as_str().map(|__s| __s.split("-").map(|__p| Value::Str(__p.to_string().into())).collect()).unwrap_or_default());'); + }); + test('replace keeps the receiver for a non-string box', () => { + expect(out(" return a.replace('x', 'y');")).toContain('return a.as_str().map(|__s| Value::Str(__s.replace("x", "y").into())).unwrap_or_else(|| a.clone());'); + }); + test('padStart with a one-char pad', () => { + expect(out(" return a.padStart(64, '0');")).toContain('return a.as_str().map(|__s| Value::Str(format!("{:0>64}", __s).into())).unwrap_or(Value::Null);'); + expect(out(" return a.padStart(8, '00');")).toContain('pad_start(&a,'); + }); + test('startsWith / endsWith in a condition', () => { + const o = out(" if (a.startsWith('0x') || a.endsWith('%')) {\n return 1;\n }\n return 0;"); + expect(o).toContain('a.as_str().is_some_and(|__s| __s.starts_with("0x"))'); + expect(o).toContain('a.as_str().is_some_and(|__s| __s.ends_with("%"))'); + expect(o).not.toContain('starts_with(&a'); + }); + test('indexOf with a proven-string identifier needle', () => { + expect(out(' return a.indexOf(b);', 'a: string, b: string')).toContain('Value::Int(a.as_str().zip(b.as_str()).and_then(|(__s, __n)| __s.find(__n)).map(|__i| __i as i64).unwrap_or(-1))'); + }); + test('join on a string[]', () => { + expect(out(" return xs.join(',');", 'xs: string[]')).toContain('Value::Str(xs.as_array().map(|__a| __a.iter().map(|__v| __v.to_string()).collect::>().join(",")).unwrap_or_default().into())'); + }); + test('unproven receivers keep the helpers', () => { + const o = out(" const u = a.toUpperCase();\n const p = a.split(',');\n const j = xs.join(',');\n const r = a.replace('x', 'y');\n return [u, p, j, r, a.startsWith('x')];", 'a: any, xs: any[]'); + expect(o).toContain('(match &(a) { Value::Str(__s) => Value::Str(__s.to_uppercase().into())'); + expect(o).toContain('split(&a, &Value::Str(",".into()))'); + expect(o).toContain('join(&xs, &Value::Str(",".into()))'); + expect(o).toContain('replace_str(&a,'); + expect(o).toContain('starts_with(&a,'); + }); + test('non-literal operands keep the helpers', () => { + const o = out(" return [a.split(s), a.startsWith(s), a.replace(s, 'y')];", 'a: string, s: string'); + // hx4 R13: a string-variable split delimiter / replace pattern goes native + expect(o).toContain('a.as_str().zip(s.as_str()).map(|(__s, __d)| __s.split(__d)'); + // hx4 R17: a string-variable affix goes native too + expect(o).toContain('a.as_str().zip(s.as_str()).is_some_and(|(__s, __p)| __s.starts_with(__p))'); + expect(o).toContain('a.as_str().zip(s.as_str()).map(|(__s, __p)| Value::Str(__s.replace(__p, \"y\").into()))'); + }); +}); + +// hx4 R07 — numeric/string helpers go native on checker-proven operands +describe('rust R07 native numeric/string helpers', () => { + const rust = (ts: string) => transpiler.transpileRust(ts).content; + test('number toString prints Display format', () => { + const out = rust('function f(n: number) { const r = n.toString(); return r; }'); + expect(out).toContain('Value::Str(format!("{}", n).into())'); + expect(out).not.toContain('to_string_val('); + }); + test('string toString prints Display format', () => { + const out = rust('function f(s: string) { const r = s.toString(); return r; }'); + expect(out).toContain('Value::Str(format!("{}", s).into())'); + }); + test('any toString keeps the helper', () => { + expect(rust('function f(n: any) { const r = n.toString(); return r; }')).toContain('to_string_val(&n)'); + }); + test('Math.floor/round/ceil of a number go native', () => { + const out = rust('function f(n: number) { const a = Math.floor(n); const b = Math.round(n); const c = Math.ceil(n); return [a, b, c]; }'); + expect(out).toContain('(n).as_f64().map(|__x| Value::Float(__x.floor())).unwrap_or(Value::Null)'); + expect(out).toContain('__x.round()'); + expect(out).toContain('__x.ceil()'); + expect(out).not.toMatch(/math_(floor|round|ceil)\(/); + }); + test('Math.floor of any keeps the helper', () => { + expect(rust('function f(n: any) { return Math.floor(n); }')).toContain('math_floor(&n)'); + }); + test('negate of a number goes native', () => { + const out = rust('function f(n: number) { const x = -n; return x; }'); + expect(out).toContain('(match &(n) { Value::Int(x) => Value::Int(-x), Value::Float(x) => Value::Float(-x), _ => Value::Null })'); + expect(out).not.toContain('negate('); + }); + test('negate of any keeps the helper', () => { + expect(rust('function f(n: any) { return -n; }')).toContain('negate(&n)'); + }); + test('number % number goes native with zero guards', () => { + const out = rust('function f(a: number, b: number) { return a % b; }'); + expect(out).toContain('(Value::Int(x), Value::Int(y)) if *y != 0 => Value::Int(x % y)'); + expect(out).not.toContain('mod_val('); + }); + test('any % number keeps the helper', () => { + expect(rust('function f(a: any, b: number) { return a % b; }')).toContain('mod_val(&a, &b)'); + }); +}); + +describe('hx4 R09 rust typed-operand is_equal/add/subtract', () => { + const r09 = (code: string) => transpiler.transpileRust(code).content; + + test('string + number and Str + number', () => { + const out = r09('function f (n: number, s: string, t: string | undefined) {\n const a = s + n;\n const b = t + n;\n return [ a, b ];\n}\n'); + expect(out).toContain('let mut a: Value = Value::Str(format!("{}{}", s, n).into());'); + expect(out).toContain('add(&t, &n)'); + }); + + test('number + any keeps the helper', () => { + const out = r09('function f (n: number, s: string, x: any) {\n const a = s + x;\n const b = x + n;\n return [ a, b ];\n}\n'); + expect(out).toContain('add(&s, &x)'); + expect(out).toContain('add(&x, &n)'); + }); + + test('.length on an any receiver minus/plus a number goes native', () => { + const out = r09('function f (x: any, n: number) {\n const a = x.length - 1;\n const b = x.length + n;\n return [ a, b ];\n}\n'); + expect(out).not.toContain('subtract('); + expect(out).not.toContain('add('); + expect(out).toContain('(match (&(get_array_length(&x)), &(Value::Int(1))) { (Value::Int(x), Value::Int(y)) => Value::Int(x - y)'); + }); + + test('const length local of an any receiver compares natively', () => { + const out = r09('function f (x: any, y: any) {\n const length = x.length;\n const other = y.length;\n if (length === 0) {\n return 1;\n }\n if (length === other) {\n return 2;\n }\n return 3;\n}\n'); + expect(out).toContain('if (length.as_f64() == Some(0.0))'); + expect(out).toContain('if (length.as_f64() == other.as_f64())'); + expect(out).not.toContain('is_equal('); + }); + + test('let length local, and any vs const length, keep the helpers', () => { + const out = r09('function f (x: any, y: any) {\n let length = x.length;\n length = y;\n const l2 = x.length;\n if (length === 0) {\n return 1;\n }\n if (l2 === y) {\n return 2;\n }\n return l2 - y;\n}\n'); + expect(out).toContain('is_equal(&length, &Value::Int(0))'); + expect(out).toContain('is_equal(&l2, &y)'); + expect(out).toContain('(match (&(l2), &(y)) {'); // hx4 R25 + }); +}); + +describe('hx4 R10 native reads on plain-dict locals and Dict parameters', () => { + const dyn = (receiver: string, key: string) => + `${receiver}.as_map().and_then(|__m| ${key}.as_str().and_then(|__k| __m.get(__k))).cloned().unwrap_or(Value::Null)`; + let output = ''; + beforeAll(() => { + output = transpiler.transpileRustByPath('./tests/files/input/hx4r10/ts/src/venue.ts').content; + }); + + test('a Dict parameter read with an any-typed key reads natively', () => { + expect(output).toContain(`let mut value: Value = ${dyn('params', 'key')};`); + expect(output).not.toContain('get_value(¶ms, &key);\n out'); + }); + + test('a literal-built local and an account () local read an untyped key natively', () => { + expect(output).toContain(`let mut viaCode: Value = ${dyn('result', 'code')};`); + expect(output).toContain(dyn('account', 'code')); + }); + + test('a reassigned param, a parse* local and a numeric key keep the helper', () => { + expect(output).toContain('return get_value(¶ms, &key);'); + expect(output).toContain('return get_value(&order, &key);'); + expect(output).toContain('return get_value(¶ms, &n);'); + }); +}); + +describe('hx4 R11: relaxed Vec locals and native list length', () => { + const wrap = (body: string, params = 'items: any[]') => `class T {\n parseX (x) { return x; }\n filterBy (a, b) { return a; }\n f (${params}) {\n${body}\n }\n}`; + const rs = (body: string, params?: string) => transpiler.transpileRust(wrap(body, params)).content; + test('a non-final this-call argument clones into its box', () => { + const out = rs(' const out = [];\n out.push (1);\n this.parseX (out);\n return out;'); + expect(out).toContain('let mut out: Vec = Vec::new();'); + expect(out).toContain('self.parseX(Value::from(out.clone()));'); + expect(out).toContain('return Value::from(out);'); + expect(out).not.toContain('append_to_array'); + }); + test('index reads on a Vec local use Vec::get', () => { + const out = rs(' const out = [];\n out.push (1);\n for (let i = 0; i < out.length; i++) {\n const v = out[i];\n this.parseX (v);\n }\n return out[0];'); + expect(out).toContain('let mut out: Vec = Vec::new();'); + expect(out).toContain('let mut v: Value = out.get((i).as_i64().map_or(usize::MAX, |__n| __n as usize)).cloned().unwrap_or(Value::Null);'); + expect(out).toContain('return out.get(0).cloned().unwrap_or(Value::Null);'); + }); + test('negative: in-loop this-call arg, element write, chained read, &mut self callee keep the box', () => { + for (const body of [ + ' const out = [];\n for (let i = 0; i < 2; i++) {\n out.push (i);\n this.parseX (out);\n }\n return 1;', + ' const out = [];\n out.push (1);\n out[0] = 2;\n return out;', + ' const out = [];\n out.push (items);\n return out[0][1];', + ' const out = [];\n out.push (1);\n this.extend (out);\n return out;', + ' const out = [];\n out.push (1);\n const k = \'a\';\n return out[k];', + ]) { + const out = rs(body); + // the box stays (hx4 R18 may spell its Arr push natively) + expect(out).toMatch(/append_to_array\(&mut out|if let Value::Arr\(__a\) = &mut out \{/); + expect(out).not.toContain('Vec'); + } + }); + test('length of a split / array-literal-returning call local is native', () => { + const out = rs(' const parts = s.split (\'-\');\n const n = parts.length;\n return n;', 's'); + expect(out).toContain('parts.as_array().map_or(Value::Int(0), |__a| Value::Int(__a.len() as i64))'); + expect(out).not.toContain('get_array_length'); + }); + test('negative: any-typed and reassigned locals keep get_array_length', () => { + expect(rs(' const n = items2.length;\n return n;', 'items2')).toContain('get_array_length(&items2)'); + expect(rs(' let parts = s.split (\'-\');\n parts = s;\n return parts.length;', 's')).toContain('get_array_length(&parts)'); + }); +}); + +describe('hx4 R12 safeDict / builder plain dicts and bool-value truthiness', () => { + const insert = (receiver: string, key: string, value: string) => + `if let Value::Dict(__d) = &mut ${receiver} { std::sync::Arc::make_mut(__d).insert("${key}".into(), ${value}); }`; + let output = ''; + beforeAll(() => { + output = transpiler.transpileRustByPath('./tests/files/input/hx4r12/ts/src/venue.ts').content; + }); + + test('a base safeDict read of caller data with no default inserts natively', () => { + expect(output).toContain(insert('bare', 'a', 'Value::Int(1)')); + }); + + test('a same-file sync builder returning literals / extend of them inserts natively', () => { + expect(output).toContain(insert('request', 'clientOid', 'Value::Str("1".into())')); + }); + + test('a non-plain default and a pass-through method keep the helper', () => { + expect(output).toContain('add_element_to_object(&mut nonPlainDefault, &Value::Str("b".into())'); + expect(output).toContain('add_element_to_object(&mut parsed, &Value::Str("x".into())'); + }); + + test('bool tuple elements compare natively against true', () => { + expect(output).toContain('(enableUnifiedMargin.as_bool() == Some(true)) || (enableUnifiedAccount.as_bool() == Some(true))'); + }); + + test('bool tuple elements and bool-returning methods test truthiness natively', () => { + expect(output).toContain('if paginate.as_bool() == Some(true) {'); + expect(output).toContain('if isTrigger.as_bool() == Some(true) {'); + expect(output).toContain('if !(self.isConditionalOrder(&[params]).as_bool() == Some(true)) {'); + }); + + test('an any-valued method / tuple element keeps is_true', () => { + expect(output).toContain('if is_true(&self.looseFlag(&[params])) {'); + expect(output).toContain('if is_true(&loose) {'); + }); +}); + +describe('hx4 R13 proven-Str safeString locals: native equality / replace / split / toString / case', () => { + let replaceOut = ''; + let eqOut = ''; + beforeAll(() => { + replaceOut = transpiler.transpileRust("class X {\n safeString (o: any, k: any, d: any = undefined): string | undefined { return undefined; }\n f (o: any, timeframe: string) {\n const subscription = this.safeString (o, 'n', '');\n const prefix = timeframe + '_';\n const marketId = subscription.replace (prefix, '');\n const net = this.safeString (o, 'network');\n let code: string = this.safeString (o, 'code', '');\n code = code.replace (net, '');\n const id = this.safeString (o, 'id');\n const parts = (code as string).split (id as string);\n const s = (id as string).toString ();\n const h = code.replace ('.' + o['x'], '');\n return [ marketId, code, parts, s, h ];\n }\n}\n").content; + eqOut = transpiler.transpileRust("class X {\n safeString (o: any, k: any, d: any = undefined): string | undefined { return undefined; }\n safeString2 (o: any, k: any, k2: any, d: any = undefined): string | undefined { return undefined; }\n safeValue (o: any, k: any, d: any = undefined): any { return undefined; }\n f (o: any, net: any) {\n const a: any = this.safeString (o, 'a');\n const b: any = this.safeString2 (o, 'b', 'c');\n if (a === b) { return 1; }\n const c: any = this.safeString (o, 'c', net);\n if (a === c) { return 2; }\n let d: any = this.safeString (o, 'd');\n d = this.safeValue (o, 'x');\n if (a !== d) { return 3; }\n let e: any = this.safeString (o, 'e');\n [ e ] = o;\n if (a === e) { return 4; }\n const g: any = this.safeString (o, 'g', 'z');\n const u = g.toUpperCase ();\n const t = a.toString ();\n const v = d.toString ();\n return [ u, t, v ];\n }\n}\n").content; + }); + + test('replace / split with a string-variable operand print native str ops', () => { + expect(replaceOut).toContain('let mut marketId: Value = subscription.as_str().zip(prefix.as_str()).map(|(__s, __p)| Value::Str(__s.replace(__p, "").into())).unwrap_or_else(|| subscription.clone());'); + expect(replaceOut).toContain('code = code.as_str().zip(net.as_str()).map(|(__s, __p)| Value::Str(__s.replace(__p, "").into())).unwrap_or_else(|| code.clone());'); + expect(replaceOut).toContain('let mut parts: Value = Value::Array(code.as_str().zip(id.as_str()).map(|(__s, __d)| __s.split(__d).map(|__p| Value::Str(__p.to_string().into())).collect()).unwrap_or_default());'); + expect(replaceOut).toContain('.as_str().zip((Value::Str(format!("{}{}", Value::Str(".".into()), crate::value::get_value_k(&o, "x")).into())).as_str())'); + expect(replaceOut).toContain('let mut s: Value = Value::Str(format!("{}", id).into());'); + expect(replaceOut).not.toContain('replace_str('); + }); + + test('two proven-Str `any` locals compare with PartialEq', () => { + expect(eqOut).toContain('if (a == b) {'); + expect(eqOut).toContain('if (a == c) {'); + expect(eqOut).toContain('let mut u: Value = g.as_str().map(|__s| Value::Str(__s.to_uppercase().into())).unwrap_or(Value::Null);'); + expect(eqOut).toContain('let mut t: Value = Value::Str(format!("{}", a).into());'); + }); + + test('a non-string write or destructuring write keeps the helpers', () => { + expect(eqOut).toContain('if !is_equal(&a, &d) {'); + expect(eqOut).toContain('if is_equal(&a, &e) {'); + expect(eqOut).toContain('let mut v: Value = to_string_val(&d);'); + }); +}); + +describe('hx4 R14 overloaded base safeDict/safeList/safeBool feed the plain-dict and list proofs', () => { + let output = ''; + beforeAll(() => { + output = transpiler.transpileRustByPath('./tests/files/input/hx4r14/ts/src/venue.ts').content; + }); + + test('a dynamic-key read on an overloaded safeDict local with a {} default is native', () => { + expect(output).toContain('let mut found: Value = byAlt.as_map().and_then(|__m| id.as_str().and_then(|__k| __m.get(__k))).cloned().unwrap_or(Value::Null);'); + }); + + test('a non-plain default and a write-back bind keep get_value', () => { + expect(output).toContain('return get_value(&loose, &id);'); + expect(output).toContain('let mut value: Value = get_value(&ledger, &key);'); + }); + + test('an overloaded safeBool with a bool default tests truthiness natively', () => { + expect(output).toContain('if flag.as_bool() == Some(true) {'); + }); + + test('list reads at counter/length arithmetic indices are native; an any-typed operand keeps get_value', () => { + expect(output).toContain('last = trades.as_array().and_then(|__arr| match &((match (&(numTrades), &(Value::Int(1)))'); + expect(output).toContain('let mut prev: Value = trades.as_array().and_then(|__arr| match &((match (&(i), &(Value::Int(1)))'); + expect(output).toContain('Value::Int(__n) if *__n >= 0 => __arr.get(*__n as usize), _ => None }).cloned().unwrap_or(Value::Null)'); + expect(output).toContain('get_value(&trades, &(match (&(k), &(Value::Int(1))) {'); // hx4 R25 + }); +}); + +describe('hx4 R15 Vec object-literal / join uses and negated bool tuple locals', () => { + let output = ''; + beforeAll(() => { + output = transpiler.transpileRustByPath('./tests/files/input/hx4r15/ts/src/venue.ts').content; + }); + + test('a string[] local joined with a literal is a Vec with a native join', () => { + expect(output).toContain('let mut out: Vec = Vec::new();'); + expect(output).toContain('Value::Str(out.iter().map(|__v| __v.to_string()).collect::>().join(",").into())'); + }); + + test('object-literal values are boxed clones, the last one a move', () => { + expect(output).toContain('m.insert("ids".to_string(), Value::from(out.clone()));'); + expect(output).toContain('m.insert("more".to_string(), Value::from(out));'); + }); + + test('a value pushed after the literal, an any[] join and an in-loop literal keep the helper', () => { + expect(output).toContain('append_to_array(&mut late, Value::Str("x".into()));'); + expect(output).toContain('return join(&loose, &Value::Str(",".into()));'); + expect(output).toContain('append_to_array(&mut looped, Value::Str("a".into()));'); + }); + + test('a negated bool tuple local tests as_bool natively', () => { + expect(output).toContain('else if !(stock.as_bool() == Some(true)) {'); + }); +}); + +describe('hx4 R16 rust math/comparison on structurally numeric operands', () => { + const r16 = (code: string) => transpiler.transpileRust(code).content; + const src = 'class X {\n' + + ' sum (...xs: any[]): any { return xs[0]; }\n' + + ' readU (s: string, n: number): any { let result = 0; result = this.sum (result, n * 2); return result; }\n' + + ' f (ids: string[], chunkSize: number, bits0: string, limit: number | undefined, a: any, bid: number | undefined) {\n' + + ' const idsLength = ids.length;\n' + + ' const c = this.sum (idsLength, chunkSize - 1) / chunkSize;\n' + + ' const m = this.sum (bid, 1) / 2;\n' + + ' let bits = this.readU (bits0, 1);\n' + + ' const bit = bits % 2;\n' + + ' bits = (bits - bit) / 2;\n' + + ' const neg = -(this.readU (bits0, 2));\n' + + ' let errors = 0;\n' + + ' while (errors <= limit) { errors += 1; }\n' + + ' const q = -1 * ids.length;\n' + + ' const anyCmp = a <= bid;\n' + + ' const anySub = a - 1;\n' + + ' const anySum = this.sum (a, 1) / 2;\n' + + ' const nullCmp = bid <= limit;\n' + + ' return [ c, m, bit, neg, q, anyCmp, anySub, anySum, nullCmp, bits ];\n' + + ' }\n' + + '}\n'; + let out = ''; + beforeAll(() => { out = r16(src); }); + + test('this.sum of numbers, numeric method returns and inductive locals go native', () => { + expect(out).toContain('let mut bit: Value = (match (&(bits), &(Value::Int(2))) { (Value::Int(x), Value::Int(y)) if *y != 0 => Value::Int(x % y)'); + expect(out).toContain('bits = (match ((((match (&(bits), &(bit)) { (Value::Int(x), Value::Int(y)) => Value::Int(x - y)'); + expect(out).toContain('let mut neg: Value = (match &((self.readU(bits0, Value::Int(2)))) { Value::Int(x) => Value::Int(-x)'); + expect(out).toContain('let mut q: Value = (match (&(Value::Int(-1)), &(Value::Int(ids.len() as i64))) {'); + expect(out).not.toContain('divide(&self.sum(&[idsLength'); + expect(out).not.toContain('mod_val(&bits'); + expect(out).not.toContain('negate('); + }); + + test('<= with a literal-initialised numeric local against a nullable number is native', () => { + expect(out).toContain('while errors.as_f64().unwrap_or(f64::NAN) <= limit.as_f64().unwrap_or(f64::NAN) {'); + }); + + test('any operands and two nullable sides of <= keep the helpers', () => { + expect(out).toContain('(match (&(a), &(bid)) { (__a, __b) =>'); // hx4 R25 + expect(out).toContain('(match (&(a), &(Value::Int(1))) {'); // hx4 R25 + expect(out).toContain('(match (&(self.sum(a, Value::Int(1))), &(Value::Int(2))) { (__a, __b) =>'); // hx4 R25 + expect(out).toContain('let mut m: Value = (match ((self.sum(bid, Value::Int(1))).as_f64(), (Value::Int(2)).as_f64())'); + expect(out).toContain('(match (&(bid), &(limit)) { (__a, __b) =>'); // hx4 R25 + }); +}); + +describe('hx4 R17 string helpers and anchored concat', () => { + const src = "type Str = string | undefined;\nclass Precise { constructor (s: string) {} }\nclass A {\n id: string = 'a';\n safeString (o: any, k: any, d: any = undefined): Str { return undefined; }\n run (x: any, code: string, s: Str, n: number) {\n const h = this.safeString (x, 'h', '');\n let qs = '';\n qs = qs.replaceAll ('%2C', ',');\n const r = code.replace (s, h);\n const p = new Precise ('1');\n return [ h.trim (), code.startsWith (s), code.endsWith (h), qs, r, this.id + ' x ' + x, 'n' + n, 'p' + p, x + 'y', x.trim (), x.replaceAll ('a', 'b'), x.startsWith (s) ];\n }\n}\n"; + let o = ''; + beforeAll(() => { o = transpiler.transpileRust(src).content; }); + test('trim / startsWith / endsWith / replaceAll / replace on proven strings go native', () => { + expect(o).toContain('h.as_str().map(|__s| Value::Str(__s.trim().to_string().into())).unwrap_or(Value::Null)'); + expect(o).toContain('code.as_str().zip(s.as_str()).is_some_and(|(__s, __p)| __s.starts_with(__p))'); + expect(o).toContain('code.as_str().zip(h.as_str()).is_some_and(|(__s, __p)| __s.ends_with(__p))'); + expect(o).toContain('qs = qs.as_str().map(|__s| Value::Str(__s.replace("%2C", ",").into())).unwrap_or_else(|| qs.clone());'); + expect(o).toContain('match (code.as_str(), s.as_str(), h.as_str()) { (Some(__s), Some(__p), Some(__r)) => Value::Str(__s.replace(__p, __r).into()), _ => code.clone() }'); + }); + test('concat anchored on an always-Str side goes native for any non-Precise box', () => { + expect(o).toContain('Value::Str(format!("{}{}", Value::Str(format!("{}{}", self.id, Value::Str(" x ".into())).into()), x).into())'); + expect(o).toContain('Value::Str(format!("{}{}", Value::Str("n".into()), n).into())'); + expect(o).toContain('Value::Str(format!("{}{}", x, Value::Str("y".into())).into())'); + }); + test('Precise operands and any receivers keep the helpers', () => { + expect(o).toContain('add(&Value::Str("p".into()), &p)'); + expect(o).toContain('trim(&x)'); + expect(o).toContain('replace_all_str(&x,'); + expect(o).toContain('starts_with(&x, &s)'); + }); +}); + +describe('hx4 R18 collection helpers on proven plain-dict / Arr-only locals', () => { + let rest = ''; + let prediction = ''; + beforeAll(() => { + rest = transpiler.transpileRustByPath('./tests/files/input/hx4r18/ts/src/venue.ts').content; + prediction = transpiler.transpileRustByPath('./tests/files/input/hx4r18/ts/src/prediction/venue.ts').content; + }); + + test('push on a [] local / length on a toArray local are native', () => { + expect(rest).toContain('if let Value::Arr(__a) = &mut out { std::sync::Arc::make_mut(__a).push(rows.as_array()'); + expect(rest).toContain('return Value::from(vec![out, count, Value::Int(parsed.len() as i64)]);'); + }); + + test('literal-key in on an R10 plain local is contains_key', () => { + expect(rest).toContain('if (matches!(&account, Value::Dict(__d) if __d.contains_key("free"))) {'); + expect(rest).toContain('in_op(&response, &Value::Str("code".into()))'); + }); + + test('rebound, nullable-push, dict-aliased and closure-captured locals keep the helpers', () => { + expect(rest).toContain('append_to_array(&mut list, Value::Int(2));'); + expect(rest).toContain('return get_array_length(&list);'); + expect(rest).toContain('append_to_array(&mut maybe, Value::Int(3));'); + expect(rest).toContain('append_to_array(&mut ids, args);'); + expect(rest).toContain('append_to_array(&mut items, Value::Int(4));'); + expect(rest).toContain('append_to_array(&mut seq, Value::Int(seq.len() as i64));'); + }); + + test('Object.keys / Object.values on a prediction plain local are native; any keeps the helper', () => { + expect(prediction).toContain('let mut queryKeys: Value = Value::Array(query.as_map().map(|__m| __m.keys().map(|__k| Value::Str(__k.clone().into())).collect()).unwrap_or_default());'); + expect(prediction).toContain('let mut queryValues: Value = Value::Array(query.as_map().map(|__m| __m.values().cloned().collect()).unwrap_or_default());'); + expect(prediction).toContain('let mut loose: Value = object_keys(&response);'); + }); +}); + +describe('hx4 R20 bool-call equality and numeric add', () => { + const src = "class A {\n sbeReadUint (h: string, o: number, l: number): number { return o + l; }\n sum (...a: any[]): any { return a[0]; }\n run (requestPath: any, frameHex: string, frameLength: number, x: any, flag: any) {\n const blockLength = this.sbeReadUint (frameHex, 0, 2);\n const position = this.sum (blockLength, 8);\n if (requestPath.endsWith ('login') === true) { return 1; }\n if (position + 4 > frameLength) { return 0; }\n const k = x + 1;\n return [ x.startsWith ('z') !== true, k, flag === true ];\n }\n}\n"; + let o = ''; + beforeAll(() => { o = transpiler.transpileRust(src).content; }); + test('startsWith/endsWith compared to a bool literal is the bare bool', () => { + expect(o).toContain('if (ends_with(&requestPath, &Value::Str("login".into()))) {'); + expect(o).toContain('Value::Bool(!starts_with(&x, &Value::Str("z".into())))'); + }); + test('+ on numeric-kind operands is the native match', () => { + expect(o).toContain('if (match (&(position), &(Value::Int(4))) { (Value::Int(x), Value::Int(y)) => Value::Int(x + y),'); + }); + test('any operands keep the helpers', () => { + expect(o).toContain('add(&x, &Value::Int(1))'); + expect(o).toContain('is_equal(&flag, &Value::Bool(true))'); + }); +}); + +describe('hx4 R21 base-tier enumeration, Arr-only sources and string-method receivers', () => { + let base = ''; + let rest = ''; + beforeAll(() => { + base = transpiler.transpileRustByPath('./tests/files/input/hx4r21/ts/src/base/Exchange.ts').content; + rest = transpiler.transpileRustByPath('./tests/files/input/hx4r21/ts/src/venue.ts').content; + }); + + test('Object.keys / Object.values on a base-tier plain local are native; any keeps the helper', () => { + expect(base).toContain('let mut keys: Value = Value::Array(built.as_map().map(|__m| __m.keys().map(|__k| Value::Str(__k.clone().into())).collect()).unwrap_or_default());'); + expect(base).toContain('let mut values: Value = Value::Array(built.as_map().map(|__m| __m.values().cloned().collect()).unwrap_or_default());'); + expect(base).toContain('object_keys(&response)'); + }); + + test('push on a local re-sorted by sortBy / built by arrayConcat is native; an any alias keeps the helper', () => { + expect(base).toContain('if let Value::Arr(__a) = &mut out { std::sync::Arc::make_mut(__a).push(Value::Int(1)); }'); + expect(base).toContain('if let Value::Arr(__a) = &mut joined { std::sync::Arc::make_mut(__a).push(Value::Int(2)); }'); + expect(base).toContain('append_to_array(&mut loose, Value::Int(3));'); + }); + + test('a string-typed map read receiving toUpperCase reads natively; an any read keeps get_value', () => { + expect(rest).toContain('(currency.as_map().and_then(|__m| __m.get("id")).cloned().unwrap_or(Value::Null))'); + expect(rest).toMatch(/get_value\(&raw, &Value::Str\("id"\.into\(\)\)\)|get_value_k\(&raw, "id"\)/); + }); +}); + +describe('hx4 R22 self-referential numeric writes, always-Str locals, Str ordering', () => { + const src = "type Str = string | undefined;\nclass A {\n sum (...a: any[]): any { return a[0]; }\n safeString (o: any, k: any, d: any = undefined): Str { return undefined; }\n json (x: any): string { return ''; }\n run (blockLength: number, raw: any, snap: any, method: string, path: string, params: any, x: any) {\n let position = this.sum (blockLength, 8);\n position = position + 4;\n let earliest: Str = undefined;\n const gameTime = this.safeString (raw, 'gameTime');\n if ((gameTime !== undefined) && ((earliest === undefined) || (gameTime < earliest))) {\n earliest = gameTime;\n }\n const version = this.safeString (snap, 'v', '');\n const held = this.safeString (snap, 'h', '');\n const newer = (held !== '') && (version <= held);\n let body: any = undefined;\n if (method === 'POST') { body = this.json (params); }\n let auth = '/' + path;\n if (body !== undefined) { auth = auth + body; }\n let maybe = this.safeString (x, 'k');\n const bad = maybe + body;\n const loose = x < raw;\n const anyLe = x <= 'b';\n return [ position, earliest, newer, auth, bad, loose, anyLe ];\n }\n}\n"; + let o = ''; + beforeAll(() => { o = transpiler.transpileRust(src).content; }); + test('a numeric local re-read in its own write goes native', () => { + expect(o).toContain('position = (match (&(position), &(Value::Int(4))) {'); + expect(o).not.toContain('add(&position'); + }); + test('Str|Null ordering replicates the helper natively', () => { + expect(o).toContain('(match (gameTime.as_str(), earliest.as_str()) { (Some(__x), Some(__y)) => (match (__x.parse::(), __y.parse::()) { (Ok(__p), Ok(__q)) => __p < __q, _ => __x < __y }), _ => false })'); + expect(o).toContain('(held.as_str() != Some("")) && ((match (version.as_str(), held.as_str()) { (Some(__x), Some(__y)) => (match (__x.parse::(), __y.parse::()) { (Ok(__p), Ok(__q)) => __p < __q, _ => __x < __y }) || __x == __y, (None, None) => true, _ => false })));'); + }); + test('a local whose every write is always-Str anchors a native concat', () => { + expect(o).toContain('auth = Value::Str(format!("{}{}", auth, body).into());'); + }); + test('unproven operands keep the helpers', () => { + expect(o).toContain('add(&maybe, &body)'); + expect(o).toContain('(match (&(x), &(raw)) { (__a, __b) =>'); // hx4 R25 + expect(o).toContain('(match (&(x), &(Value::Str("b".into()))) { (__a, __b) =>'); // hx4 R25 + }); +}); + +describe('hx4 R23 plain-dict sources in the base tier and pro files', () => { + let base = ''; + let pro = ''; + beforeAll(() => { + base = transpiler.transpileRustByPath('./tests/files/input/hx4r23/ts/src/base/Exchange.ts').content; + pro = transpiler.transpileRustByPath('./tests/files/input/hx4r23/ts/src/pro/venue.ts').content; + }); + + test('base extend copies of locals / typed Dict params insert natively', () => { + expect(base).toContain('if let Value::Dict(__d) = &mut itemWithKey { std::sync::Arc::make_mut(__d).insert(crate::runtime::stringify_param(&keyName), key.clone()); }'); + expect(base).toContain('if let Value::Dict(__d) = &mut result { std::sync::Arc::make_mut(__d).insert("swap".into(), Value::Bool(false)); }'); + }); + + test('base safeDict(this.options, k, {}) local reads natively', () => { + expect(base).toContain('accountsByType.as_map().and_then(|__m| account.as_str().and_then(|__k| __m.get(__k))).cloned().unwrap_or(Value::Null)'); + }); + + test('base extend of an any parameter keeps the helper', () => { + expect(base).toContain('add_element_to_object(&mut r, &Value::Str("x".into()), Value::Int(1));'); + }); + + test('pro extend of a proven local inserts natively; extend of a handler parameter keeps the helper', () => { + expect(pro).toContain('if let Value::Dict(__d) = &mut request { std::sync::Arc::make_mut(__d).insert("id".into(), Value::Int(1)); }'); + expect(pro).toContain('add_element_to_object(&mut loose, &Value::Str("id".into()), Value::Int(2));'); + }); + + test('pro safeDict(this.options, k, {}) local reads natively', () => { + expect(pro).toContain('subs.as_map().and_then(|__m| __m.get("a")).cloned().unwrap_or(Value::Null)'); + }); +}); + +describe('hx4 R25 inline math/comparison dispatch and Str|Null field concat', () => { + const src = "class A {\n convertToBigIntCustom (x: any) {\n return parseInt (x);\n }\n signHash (hash: any, privateKey: any) {\n const signature = ecdsa (hash, privateKey);\n const r = signature['r'];\n const s = signature['s'];\n return {\n 'r': r.padStart (64, '0'),\n 's': s.padStart (64, '0'),\n 'v': 27,\n };\n }\n signMessage (message: any, privateKey: any) {\n return this.signHash (message, privateKey.slice (-64));\n }\n signOnboardingAction (): object {\n const signature = this.signMessage ('x', 'y');\n return signature;\n }\n run (request: any, params: any, config: any, cache: any[], h: any) {\n const amountMultiplier = this.convertToBigIntCustom ('1000000');\n const amountInt = request['num_tokens'] * amountMultiplier;\n const z = this.parseToInt (request['num_tokens'] * amountMultiplier);\n const limit = params['limit'];\n const entry = config[0];\n if (limit <= entry[0]) { return 1; }\n const signature: any = this.signOnboardingAction ();\n const pk = this.hashMessage (signature['r'] + signature['s']);\n const cacheLength = cache.length;\n const snapshotDelay = this.handleOption ('a', 'b', 25);\n if (cacheLength === snapshotDelay) { return 2; }\n if (h === 1) { return 3; }\n return [ amountInt, z, pk ];\n }\n}\n"; + let o = ''; + beforeAll(() => { o = transpiler.transpileRust(src).content; }); + test('any * numeric-call operand prints the multiply dispatch inline', () => { + expect(o).toContain('let mut amountInt: Value = (match (&(crate::value::get_value_k(&request, "num_tokens")), &(amountMultiplier)) { (Value::Int(__x), Value::Int(__y)) => Value::Int(__x * __y), (__a, __b) =>'); + expect(o).not.toContain('multiply('); + }); + test('any <= any prints the coercing order plus is_equal inline', () => { + expect(o).toContain('if (match (&(limit), &(get_value(&entry, &Value::Int(0)))) { (__a, __b) =>'); + expect(o).toContain('(Value::Null, Value::Null) => true'); + expect(o).not.toContain('is_less_than_or_equal('); + }); + test('Str|Null fields of a same-file returned literal concatenate natively', () => { + expect(o).toContain('self.hashMessage((match (&(crate::value::get_value_k(&signature, "r")), &(crate::value::get_value_k(&signature, "s"))) { (Value::Null, Value::Null) => Value::Null, (__a, __b) => Value::Str(format!("{}{}", __a, __b).into()) }))'); + expect(o).not.toContain('add('); + }); + test('a non-literal field source keeps the add helper', () => { + const n = transpiler.transpileRust('class B {\n run (x: any) {\n const s = x[0];\n return s[\'r\'] + s[\'s\'];\n }\n}\n').content; + expect(n).toContain('add(&'); + }); +}); + +describe('hx4 R26 tuple slot-1 params of base handle*AndParams helpers', () => { + const insert = (receiver: string, key: string, value: string) => + `if let Value::Dict(__d) = &mut ${receiver} { std::sync::Arc::make_mut(__d).insert("${key}".into(), ${value}); }`; + let rest = ''; + let pro = ''; + beforeAll(() => { + rest = transpiler.transpileRustByPath('./tests/files/input/hx4r26/ts/src/venue.ts').content; + pro = transpiler.transpileRustByPath('./tests/files/input/hx4r26/ts/src/pro/venue.ts').content; + }); + + test('const [ a, p ] = handleOptionBoolAndParams (params, …) inserts natively on p', () => { + expect(rest).toContain(insert('paramsStock', 'stock', 'Value::Bool(true)')); + expect(rest).not.toContain('add_element_to_object(&mut paramsStock'); + }); + + test('[ a, p ] = handleMarketTypeAndParams (…, params) write: native insert and read', () => { + expect(rest).not.toContain('add_element_to_object(&mut paramsType'); + expect(rest).toContain('paramsType.as_map().and_then(|__m| __m.get("other")).cloned().unwrap_or(Value::Null)'); + }); + + test('an unproven params argument or a non-listed handler keeps the helper', () => { + expect(rest).toContain('add_element_to_object(&mut paramsLoose'); + expect(rest).toContain('add_element_to_object(&mut paramsOther'); + }); + + test('pro: a parameter source keeps the helper, a plain local source goes native', () => { + expect(pro).toContain('add_element_to_object(&mut paramsStock'); + expect(pro).not.toContain('add_element_to_object(&mut paramsLocal'); + }); +});