diff --git a/dist/transpiler.cjs b/dist/transpiler.cjs index f85bf88..500333a 100644 --- a/dist/transpiler.cjs +++ b/dist/transpiler.cjs @@ -6196,7 +6196,8 @@ var JavaTranspiler = class extends BaseTranspiler { } printThrowStatement(node, identation) { if (node.expression.kind === _typescript2.default.SyntaxKind.Identifier) { - return this.getIden(identation) + this.THROW_TOKEN + " " + this.printNode(node.expression, 0) + this.LINE_TERMINATOR; + const name = this.printNode(node.expression, 0); + return this.getIden(identation) + `${this.THROW_TOKEN} (${name} instanceof RuntimeException ? (RuntimeException)${name} : new RuntimeException(${name}))${this.LINE_TERMINATOR}`; } if (node.expression.kind === _typescript2.default.SyntaxKind.NewExpression) { const expression = node.expression; @@ -7342,6 +7343,29 @@ var Transpiler = class _Transpiler { program }); } + // One program over N root files, instead of one program per file. Every + // transpile*ByPath call pays for a full program: even with the SourceFile cache + // making the ~340-file import closure parse-free, the binder/checker work behind + // getPreEmitDiagnostics is redone per file. Batching N files into one program + // pays it once for the whole set. + // + // Files that import each other (a derived exchange and its parent) are fine in + // one batch — they are separate root files of the same program, exactly as + // typescript would compile a project. + // + // The batch deliberately does not become the cache's byPathOldProgram: an N-file + // program never structurally reuses a program built from a different root set, so + // there is nothing to gain, and keeping the previous chunk's checker alive while + // the next one is built would double peak memory — the opposite of why callers + // chunk. The cross-batch saving comes from the shared host + SourceFile cache. + createProgramBatch(paths) { + const options = fastCompilerOptions; + const host = this.getByPathCompilerHost(options); + const program = _typescript2.default.createProgram([...paths, globalsShimPath], options, host); + const checker = program.getTypeChecker(); + memoizeCheckerCalls(checker); + return new TranspileProgramBatch(this, program, checker); + } // the language printers read the typescript state (source file, checker, program) // off the context handed to them here, so two Transpiler instances never share // state and a nested transpile can restore whatever its caller was working on @@ -7548,8 +7572,53 @@ var Transpiler = class _Transpiler { } } }; +var TranspileProgramBatch = class { + constructor(transpiler, program, checker) { + this.transpiler = transpiler; + this.program = program; + this.checker = checker; + } + getProgram() { + return this.program; + } + // point the owning Transpiler at one file of this batch, then run the same + // diagnostics pass the single-file path runs — the printers read checker state + // back from it, so it is not optional + setContextForPath(filePath) { + const src = _nullishCoalesce(this.program.getSourceFile(filePath), () => ( this.program.getSourceFile(path.resolve(filePath)))); + if (src === void 0) { + throw new Error(`ast-transpiler: "${filePath}" is not a file of this program batch`); + } + const context = this.transpiler.setContext({ src, checker: this.checker, program: this.program }); + this.transpiler.checkFileDiagnostics(context); + return context; + } + transpileByPath(lang, filePath, sync = false) { + this.setContextForPath(filePath); + return this.transpiler.transpile(lang, 0 /* ByPath */, filePath, sync, false); + } + transpilePythonByPath(filePath) { + return this.transpileByPath(0 /* Python */, filePath, !this.transpiler.pythonTranspiler.asyncTranspiling); + } + transpilePhpByPath(filePath) { + return this.transpileByPath(1 /* Php */, filePath, !this.transpiler.phpTranspiler.asyncTranspiling); + } + transpileCSharpByPath(filePath) { + return this.transpileByPath(2 /* CSharp */, filePath); + } + transpileGoByPath(filePath) { + return this.transpileByPath(3 /* Go */, filePath); + } + transpileJavaByPath(filePath) { + return this.transpileByPath(4 /* Java */, filePath); + } + transpileRustByPath(filePath) { + return this.transpileByPath(5 /* Rust */, filePath); + } +}; + -exports.Transpiler = Transpiler; exports.default = Transpiler; +exports.TranspileProgramBatch = TranspileProgramBatch; exports.Transpiler = Transpiler; exports.default = Transpiler; //# sourceMappingURL=transpiler.cjs.map \ No newline at end of file diff --git a/dist/transpiler.cjs.map b/dist/transpiler.cjs.map index 7bde53e..c3a42d6 100644 --- a/dist/transpiler.cjs.map +++ b/dist/transpiler.cjs.map @@ -1 +1 @@ -{"version":3,"sources":["../node_modules/tsup/assets/cjs_shims.js","../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"],"names":["ts","defaultValue","type","node","namedExports","SyntaxKind","parserConfig","symb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AM,UAAU,KAAK,mCAAmC,OAAO;AAC/D,WAAO,KAAK,cAAc,eAAe,QAAQ,GAAG;AAAA,EACxD;AAAA,EAEA,eAAe,SAAgC;AAC3C,UAAM,UAAU,KAAK,mCAAmC,OAAO;AAC/D,WAAO,KAAK,cAAc,eAAe,QAAQ,GAAG;AAAA,EACxD;AAAA,EAEA,qBAAqB,OAAiB;AAClC,SAAK,cAAc,sCAAsC;AAAA,EAC7D;AAAA,EAEA,6BAA6B,aAAsB;AAC/C,SAAK,cAAc,yBAAyB;AAAA,EAChD;AAAA,EAEA,gCAAgC,aAAsB;AAClD,SAAK,iBAAiB,yBAAyB;AAAA,EACnD;AAAA,EAEA,uBAAuB,OAAgB;AACnC,SAAK,cAAc,mBAAmB;AAAA,EAC1C;AAAA,EAEA,0BAA0B,OAAgB;AACtC,SAAK,iBAAiB,mBAAmB;AAAA,EAC7C;AAAA,EAEA,mCAAmC,cAAoB;AACnD,SAAK,iBAAiB,4BAA4B;AAAA,EACtD;AAAA,EAEA,4BAA4B,MAAyB;AACjD,YAAO,MAAM;AAAA,MACb,KAAK;AACD;AAAA,MACJ,KAAK;AACD;AAAA,MACJ,KAAK;AACD;AAAA,MACJ,KAAK;AACD;AAAA,MACJ,KAAK;AACD;AAAA,MACJ,KAAK;AACD;AAAA,IACJ;AAAA,EACJ;AACJ","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","// https://github.com/kulshekhar/ts-jest/issues/1174\nmodule.exports = __dirname;","import ts from 'typescript';\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 } from './goTranspiler.js';\nimport { JavaTranspiler } from './javaTranspiler.js';\nimport { RustTranspiler } from './rustTranspiler.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: ts.CompilerOptions = {\n target: ts.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\nfunction overrideHostForVirtualFiles(host: ts.CompilerHost, files: Map) {\n const originalGetSourceFile = host.getSourceFile.bind(host);\n const originalReadFile = host.readFile.bind(host);\n const originalFileExists = host.fileExists.bind(host);\n // resolve paths because typescript will normalize them\n // to forward slashes on windows\n host.getSourceFile = (fileName, languageVersion, onError, shouldCreateNewSourceFile) => {\n const virtual = files.get(path.resolve(fileName));\n return virtual !== undefined ? virtual : originalGetSourceFile(fileName, languageVersion, onError, shouldCreateNewSourceFile);\n };\n host.readFile = (fileName: string) => {\n const virtual = files.get(path.resolve(fileName));\n return virtual !== undefined ? virtual.text : originalReadFile(fileName);\n };\n host.fileExists = (fileName: string) => {\n return files.has(path.resolve(fileName)) || originalFileExists(fileName);\n };\n}\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 NO_SYMBOL_SENTINEL = Symbol(\"noSymbol\");\nfunction memoizeCheckerCalls(checker: ts.TypeChecker): void {\n if ((checker as any).__astTranspilerMemoized) {\n return;\n }\n (checker as any).__astTranspilerMemoized = true;\n\n const typeCache = new WeakMap();\n const originalGetTypeAtLocation = checker.getTypeAtLocation.bind(checker);\n checker.getTypeAtLocation = (node: ts.Node): ts.Type => {\n let type = typeCache.get(node);\n if (type === undefined) {\n type = originalGetTypeAtLocation(node);\n typeCache.set(node, type);\n }\n return type;\n };\n\n const symbolCache = new WeakMap();\n const originalGetSymbolAtLocation = checker.getSymbolAtLocation.bind(checker);\n checker.getSymbolAtLocation = (node: ts.Node): ts.Symbol | undefined => {\n const cached = symbolCache.get(node);\n if (cached !== undefined) {\n return cached === NO_SYMBOL_SENTINEL ? undefined : cached;\n }\n const symbol = originalGetSymbolAtLocation(node);\n symbolCache.set(node, symbol === undefined ? NO_SYMBOL_SENTINEL : symbol);\n return symbol;\n };\n}\n\nfunction getProgramAndTypeCheckerFromMemory (rootDir: string, text: string, options: any = {}, cache?: ITranspileProgramCache): [any,any,any] {\n options = options || ts.getDefaultCompilerOptions();\n const inMemoryFilePath = path.resolve(path.join(rootDir, \"__dummy-file.ts\"));\n const textAst = ts.createSourceFile(inMemoryFilePath, text, options.target || ts.ScriptTarget.Latest);\n const shimAst = ts.createSourceFile(globalsShimPath, globalsShim, options.target || ts.ScriptTarget.Latest);\n const host = ts.createCompilerHost(options, true);\n\n overrideHostForVirtualFiles(host, new Map([\n [inMemoryFilePath, textAst],\n [globalsShimPath, shimAst],\n ]));\n\n if (cache !== undefined) {\n // the dummy file changes every call, but the es lib chain behind it does not:\n // serve those from the shared cache so they are parsed once per cache\n const originalGetSourceFile = host.getSourceFile.bind(host);\n host.getSourceFile = (fileName, languageVersion, onError, shouldCreateNewSourceFile) => {\n const resolved = path.resolve(fileName);\n if (resolved === inMemoryFilePath) {\n return textAst;\n }\n const cached = cache.sourceFiles.get(resolved);\n if (cached !== undefined && !shouldCreateNewSourceFile) {\n return cached.sourceFile;\n }\n const sourceFile = originalGetSourceFile(fileName, languageVersion, onError, shouldCreateNewSourceFile);\n if (sourceFile !== undefined) {\n cache.sourceFiles.set(resolved, { mtimeMs: 0, sourceFile });\n }\n return sourceFile;\n };\n }\n\n const program = ts.createProgram({\n options,\n rootNames: [inMemoryFilePath, globalsShimPath],\n host,\n oldProgram: cache?.memoryOldProgram,\n });\n if (cache !== undefined) {\n cache.memoryOldProgram = program;\n }\n\n const typeChecker = program.getTypeChecker();\n memoizeCheckerCalls(typeChecker);\n const sourceFile = program.getSourceFile(inMemoryFilePath);\n\n return [ program, typeChecker, sourceFile];\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 // 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\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 { sourceFiles: new Map() };\n }\n\n constructor(config = {}, programCache?: ITranspileProgramCache) {\n this.config = config;\n this.programCache = programCache ?? Transpiler.createProgramCache();\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\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 }\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 createProgramInMemoryAndSetContext(content): ITranspileContext {\n const [ memProgram, memType, memSource] = getProgramAndTypeCheckerFromMemory(__dirname_mock, content, fastCompilerOptions, this.programCache);\n return this.setContext({\n src: memSource,\n checker: memType as ts.TypeChecker,\n program: memProgram,\n });\n }\n\n getByPathCompilerHost(options: ts.CompilerOptions): ts.CompilerHost {\n if (this.programCache.byPathHost === undefined) {\n const host = ts.createCompilerHost(options, true);\n const originalGetSourceFile = host.getSourceFile.bind(host);\n const cache = this.programCache.sourceFiles;\n host.getSourceFile = (fileName, languageVersion, onError, shouldCreateNewSourceFile) => {\n let mtimeMs = 0;\n try {\n mtimeMs = fs.statSync(fileName).mtimeMs;\n } catch (e) {\n // e.g. synthetic lib paths — fall through with mtime 0\n }\n const cached = cache.get(fileName);\n if (cached && cached.mtimeMs === mtimeMs && !shouldCreateNewSourceFile) {\n return cached.sourceFile;\n }\n const sourceFile = originalGetSourceFile(fileName, languageVersion, onError, shouldCreateNewSourceFile);\n if (sourceFile !== undefined) {\n cache.set(fileName, { mtimeMs, sourceFile });\n }\n return sourceFile;\n };\n const shimAst = ts.createSourceFile(globalsShimPath, globalsShim, ts.ScriptTarget.Latest);\n overrideHostForVirtualFiles(host, new Map([[globalsShimPath, shimAst]]));\n this.programCache.byPathHost = host;\n }\n return this.programCache.byPathHost;\n }\n\n createProgramByPathAndSetContext(path): ITranspileContext {\n const options: ts.CompilerOptions = fastCompilerOptions;\n const host = this.getByPathCompilerHost(options);\n // passing the previous program lets typescript reuse its internal state where\n // possible; the cached host makes every already-seen dependency parse-free\n const program = ts.createProgram([path, globalsShimPath], options, host, this.programCache.byPathOldProgram);\n this.programCache.byPathOldProgram = program;\n const sourceFile = program.getSourceFile(path);\n const typeChecker = program.getTypeChecker();\n memoizeCheckerCalls(typeChecker);\n\n return this.setContext({\n src: sourceFile,\n checker: typeChecker,\n program,\n });\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 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 const diagnostics = ts.getPreEmitDiagnostics(context.program, context.src);\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.messageText + \"\\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\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 transpiledContent = 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 }\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\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 }\n }\n}\n\nexport {\n Transpiler\n};\n","import { BaseTranspiler } from \"./baseTranspiler.js\";\nimport { regexAll } from \"./utils.js\";\nimport ts from 'typescript';\n\nconst SyntaxKind = ts.SyntaxKind;\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.escapedText;\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.escapedText;\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.escapedText;\n const heritageClauses = node.heritageClauses;\n\n let classInit = \"\";\n if (heritageClauses !== undefined) {\n const classExtends = heritageClauses[0].types[0].expression.escapedText;\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 === ts.SyntaxKind.EqualsEqualsToken || op === ts.SyntaxKind.EqualsEqualsEqualsToken) && node.right.kind === ts.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 ts.SyntaxKind.EqualsEqualsToken:\n return \"is\";\n case ts.SyntaxKind.ExclamationEqualsToken:\n return \"is not\";\n case ts.SyntaxKind.ExclamationEqualsEqualsToken:\n return \"is not\";\n case ts.SyntaxKind.EqualsEqualsEqualsToken:\n return \"is\";\n }\n }\n }\n}\n","import ts from 'typescript';\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(): ts.SourceFile {\n if (this.context === undefined) throw new Error(NO_CONTEXT_ERROR);\n return this.context.src;\n }\n\n getChecker(): ts.TypeChecker {\n if (this.context === undefined) throw new Error(NO_CONTEXT_ERROR);\n return this.context.checker;\n }\n\n getProgram(): ts.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 [ts.SyntaxKind.StringLiteral]: this.STRING_LITERAL_KEYWORD,\n [ts.SyntaxKind.StringKeyword]: this.STRING_KEYWORD,\n // [ts.SyntaxKind.NumberKeyword]: this.NUMBER_KEYWORD,\n [ts.SyntaxKind.NumberKeyword]: this.DEFAULT_TYPE,\n [ts.SyntaxKind.MinusMinusToken]: this.MINUS_MINUS_TOKEN,\n [ts.SyntaxKind.MinusToken]: this.MINUS_TOKEN,\n [ts.SyntaxKind.SlashToken]: this.SLASH_TOKEN,\n [ts.SyntaxKind.AsteriskToken]: this.ASTERISK_TOKEN,\n [ts.SyntaxKind.InKeyword]: this.IN_TOKEN,\n [ts.SyntaxKind.PlusToken]: this.PLUS_TOKEN,\n [ts.SyntaxKind.PercentToken]: this.PERCENT_TOKEN,\n [ts.SyntaxKind.LessThanToken]: this.LESS_THAN_TOKEN,\n [ts.SyntaxKind.LessThanEqualsToken]: this.LESS_THAN_EQUALS_TOKEN,\n [ts.SyntaxKind.GreaterThanToken]: this.GREATER_THAN_TOKEN,\n [ts.SyntaxKind.GreaterThanEqualsToken]: this.GREATER_THAN_EQUALS_TOKEN,\n [ts.SyntaxKind.EqualsEqualsToken]: this.EQUALS_EQUALS_TOKEN,\n [ts.SyntaxKind.EqualsEqualsEqualsToken]: this.EQUALS_EQUALS_EQUALS_TOKEN,\n [ts.SyntaxKind.EqualsToken]: this.EQUALS_TOKEN,\n [ts.SyntaxKind.PlusEqualsToken]: this.PLUS_EQUALS,\n [ts.SyntaxKind.BarBarToken]: this.BAR_BAR_TOKEN,\n [ts.SyntaxKind.AmpersandAmpersandToken]: this.AMPERSTAND_APERSAND_TOKEN,\n [ts.SyntaxKind.ExclamationEqualsEqualsToken]: this.EXCLAMATION_EQUALS_EQUALS_TOKEN,\n [ts.SyntaxKind.ExclamationEqualsToken]: this.EXCLAMATION_EQUALS_TOKEN,\n [ts.SyntaxKind.AsyncKeyword]: this.ASYNC_TOKEN,\n [ts.SyntaxKind.AwaitKeyword]: this.AWAIT_TOKEN,\n [ts.SyntaxKind.StaticKeyword]: this.STATIC_TOKEN,\n [ts.SyntaxKind.PublicKeyword]: this.PUBLIC_KEYWORD,\n [ts.SyntaxKind.PrivateKeyword]: this.PRIVATE_KEYWORD,\n [ts.SyntaxKind.VoidKeyword]: this.VOID_KEYWORD,\n [ts.SyntaxKind.BooleanKeyword]: this.BOOLEAN_KEYWORD,\n };\n\n this.PostFixOperators = {\n [ts.SyntaxKind.PlusPlusToken]: this.PLUS_PLUS_TOKEN,\n [ts.SyntaxKind.MinusMinusToken]: this.MINUS_MINUS_TOKEN,\n };\n\n this.PrefixFixOperators = {\n [ts.SyntaxKind.ExclamationToken]: this.NOT_TOKEN,\n [ts.SyntaxKind.MinusToken]: this.MINUS_TOKEN,\n };\n\n this.FunctionDefSupportedKindNames = {\n [ts.SyntaxKind.StringKeyword]: this.STRING_KEYWORD\n };\n\n this.FuncModifiers = {\n [ts.SyntaxKind.AsyncKeyword]: this.ASYNC_TOKEN,\n [ts.SyntaxKind.PublicKeyword]: this.PUBLIC_KEYWORD,\n [ts.SyntaxKind.PrivateKeyword]: this.PRIVATE_KEYWORD,\n [ts.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: ts.TypeFlags) {\n return flags === ts.TypeFlags.String || flags === ts.TypeFlags.StringLiteral;\n }\n\n isAnyType(flags: ts.TypeFlags) {\n return flags === ts.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 === ts.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 || !ts.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: ts.Node): ts.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 (!ts.isClassDeclaration(node.parent)) {\n return undefined;\n }\n\n // Get the class declaration\n const classDeclaration = node.parent as ts.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 = (ts as any).getAllSuperTypeNodes(node.parent)[0];\n\n while (parentClass !== undefined) {\n const parentClassType = this.getChecker().getTypeAtLocation(parentClass);\n const parentClassDecl = parentClassType?.symbol?.valueDeclaration;\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 (ts.isMethodDeclaration(elem)) {\n\n const name = elem.name.getText().trim();\n if ((node as any).name.escapedText === name) {\n method = elem;\n }\n }\n });\n\n parentClass = (ts as any).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) {\n return name;\n }\n\n transformPropertyAccessExpressionName(name: string) {\n return name;\n }\n\n printIdentifier(node) {\n let idValue = node.text ?? node.escapedText;\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 === ts.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.escapedText;\n const right = node.right.escapedText;\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 == ts.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 === ts.SyntaxKind.EqualsEqualsToken || operatorToken.kind === ts.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 === ts.SyntaxKind.BarBarToken || operatorToken.kind === ts.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.escapedText;\n let rightSide = node.name.escapedText;\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);\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 !== ts.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 = 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 printTraillingComment(node, identation) {\n const fullText = this.getSrc().getFullText();\n const commentsRangeList = ts.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 === ts.SyntaxKind.TypeReference) {\n const typeRef = type.typeName.escapedText;\n if (typeRef === \"Promise\") {\n const typeArgs = type.typeArguments.filter(t => t.kind !== ts.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.escapedText;\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.escapedText;\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 (ts.isArrayLiteralExpression(initializer)) {\n return this.ARRAY_KEYWORD;\n }\n if ((ts as any).isBooleanLiteral(initializer)) {\n return this.BOOLEAN_KEYWORD;\n }\n if (ts.isObjectLiteralExpression(initializer)) {\n return this.OBJECT_KEYWORD;\n }\n if (ts.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 (ts.isStringLiteralLike(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 === ts.TypeFlags.Any) {\n return undefined;\n }\n if (type.flags === ts.TypeFlags.Void) {\n return this.VOID_KEYWORD;\n }\n if (type.flags === ts.TypeFlags.Number) {\n // return this.NUMBER_KEYWORD;\n return this.DEFAULT_TYPE;\n }\n\n if (type.flags === ts.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?.symbol?.escapedName === 'Array') {\n return this.ARRAY_KEYWORD;\n }\n if (type?.symbol?.escapedName === '__object') {\n return this.OBJECT_KEYWORD;\n }\n\n // check this out, trying to resolve Promise<{}>\n if (type?.symbol?.escapedName === '__type') {\n return this.OBJECT_KEYWORD;\n // return this.DEFAULT_TYPE;\n }\n\n // check for promise type\n\n if (type?.symbol?.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 = (type as any).resolvedTypeArguments; // internal typescript property\n if (resolvedTypeArguments.length === 0) {\n return this.PROMISE_TYPE_KEYWORD;\n }\n if (resolvedTypeArguments.length === 1 && resolvedTypeArguments[0].flags === ts.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?.escapedText ?? \"\";\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 && ts.isFunctionDeclaration(node)){\n modifiers = modifiers + \"public \";\n }\n let functionDef = this.getIden(identation) + modifiers + returnType + fnKeyword;\n if (this.includeFunctionNameInFunctionExpressionDeclaration || !ts.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 (ts.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.escapedText;\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 && (ts.isFunctionExpression(declaration.initializer) || ts.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?.getDeclarations()\n ?.some(s => s.getSourceFile().fileName.includes(\"/node_modules/typescript/lib/\"))\n ?? false;\n\n\n return isInLibFiles;\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 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 === ts.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?.escapedText;\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.escapedText === \"assert\") {\n return this.printAssertCall(node, identation, parsedArgs);\n }\n if (expression.escapedText === \"padEnd\") {\n // check this\n }\n }\n }\n\n // print super() call inside constructor\n if (expression.kind === ts.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 === ts.SyntaxKind.Identifier) {\n const idValue = expression.text ?? expression.escapedText;\n parsedExpression = this.transformCallExpressionName(this.unCamelCaseIfNeeded(idValue));\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 === ts.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.escapedText;\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.escapedText;\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 === ts.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 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 === ts.SyntaxKind.BinaryExpression &&\n (node.parent.operatorToken.kind === ts.SyntaxKind.EqualsToken || node.parent.operatorToken.kind === ts.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 === ts.TypeFlags.Union) {\n isUnionString = this.isStringType((type as any)?.types[0].flags);\n }\n\n if (isString || isUnionString || type.flags === ts.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 = ts.isStringLiteralLike(argumentExpression) ? \"\" : '(string)';\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 === ts.SyntaxKind.PrefixUnaryExpression && node.operator === ts.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 === ts.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 === ts.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 === ts.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 === ts.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 === ts.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 (ts.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?.escapedText;\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 || ts.isAwaitExpression(exp)\n || !this.isImplicitAsyncFunction(ts.findAncestor(node, ts.isFunctionLike))\n || !this.isPromiseType(this.getChecker().getTypeAtLocation(exp))) {\n return node;\n }\n if (ts.isConditionalExpression(exp) || ts.isBinaryExpression(exp)) {\n // an await-token prefix would change precedence (e.g. `await a ? b : c`)\n exp = this.wrapSyntheticNode(ts.factory.createParenthesizedExpression(exp), exp);\n }\n node.expression = this.wrapSyntheticNode(ts.factory.createAwaitExpression(exp), exp);\n return node;\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 === ts.SyntaxKind.FunctionDeclaration || parent.kind === ts.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 ts.SyntaxKind.ExpressionStatement:\n return this.printExpressionStatement(node, identation);\n case ts.SyntaxKind.Block:\n return this.printBlock(node, identation);\n case ts.SyntaxKind.FunctionDeclaration:\n case ts.SyntaxKind.FunctionExpression:\n case ts.SyntaxKind.ArrowFunction:\n return this.printFunctionDeclaration(node, identation);\n case ts.SyntaxKind.ClassDeclaration:\n return this.printClass(node, identation);\n case ts.SyntaxKind.VariableStatement:\n return this.printVariableStatement(node, identation);\n case ts.SyntaxKind.MethodDeclaration:\n return this.printMethodDeclaration(node, identation);\n case ts.SyntaxKind.StringLiteral:\n return this.printStringLiteral(node);\n case ts.SyntaxKind.NumericLiteral:\n return this.printNumericLiteral(node);\n case ts.SyntaxKind.PropertyAccessExpression:\n return this.printPropertyAccessExpression(node, identation);\n case ts.SyntaxKind.ArrayLiteralExpression:\n return this.printArrayLiteralExpression(node, identation);\n case ts.SyntaxKind.CallExpression:\n return this.printCallExpression(node, identation);\n case ts.SyntaxKind.WhileStatement:\n return this.printWhileStatement(node, identation);\n case ts.SyntaxKind.BinaryExpression:\n return this.printBinaryExpression(node, identation);\n case ts.SyntaxKind.BreakStatement:\n return this.printBreakStatement(node, identation);\n case ts.SyntaxKind.ForStatement:\n return this.printForStatement(node, identation);\n case ts.SyntaxKind.PostfixUnaryExpression:\n return this.printPostFixUnaryExpression(node, identation);\n case ts.SyntaxKind.VariableDeclarationList:\n return this.printVariableDeclarationList(node, identation); // statements are slightly different if inside a for\n case ts.SyntaxKind.ObjectLiteralExpression:\n return this.printObjectLiteralExpression(node, identation);\n case ts.SyntaxKind.PropertyAssignment:\n return this.printPropertyAssignment(node, identation);\n case ts.SyntaxKind.Identifier:\n return this.printIdentifier(node);\n case ts.SyntaxKind.ElementAccessExpression:\n return this.printElementAccessExpression(node, identation);\n case ts.SyntaxKind.IfStatement:\n return this.printIfStatement(node, identation);\n case ts.SyntaxKind.ParenthesizedExpression:\n return this.printParenthesizedExpression(node, identation);\n case ts.SyntaxKind.TrueKeyword:\n case ts.SyntaxKind.FalseKeyword:\n return this.printBooleanLiteral(node);\n case ts.SyntaxKind.ThisKeyword:\n return this.printThisKeyword(node, identation);\n case ts.SyntaxKind.SuperKeyword:\n return this.SUPER_TOKEN;\n case ts.SyntaxKind.TryStatement:\n return this.printTryStatement(node, identation);\n case ts.SyntaxKind.PrefixUnaryExpression:\n return this.printPrefixUnaryExpression(node, identation);\n case ts.SyntaxKind.ThrowStatement:\n return this.printThrowStatement(node, identation);\n case ts.SyntaxKind.NewExpression:\n return this.printNewExpression(node, identation);\n case ts.SyntaxKind.AwaitExpression:\n return this.printAwaitExpression(node, identation);\n case ts.SyntaxKind.ConditionalExpression:\n return this.printConditionalExpression(node, identation);\n case ts.SyntaxKind.AsExpression:\n return this.printAsExpression(node, identation);\n case ts.SyntaxKind.ReturnStatement:\n return this.printReturnStatement(this.wrapImplicitReturnAwait(node), identation);\n case ts.SyntaxKind.ArrayBindingPattern:\n return this.printArrayBindingPattern(node, identation);\n case ts.SyntaxKind.Parameter:\n return this.printParameter(node);\n case ts.SyntaxKind.Constructor:\n return this.printConstructorDeclaration(node, identation);\n case ts.SyntaxKind.PropertyDeclaration:\n return this.printPropertyDeclaration(node, identation);\n case ts.SyntaxKind.SpreadElement:\n return this.printSpreadElement(node, identation);\n case ts.SyntaxKind.NullKeyword:\n return this.printNullKeyword(node, identation);\n case ts.SyntaxKind.ContinueStatement:\n return this.printContinueStatement(node, identation);\n case ts.SyntaxKind.DeleteExpression:\n return this.printDeleteExpression(node, identation);\n }\n\n if (node.statements) {\n if (ts.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) => ts.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.escapedText;\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 && ts.isCallExpression(dec.initializer) && dec.initializer.expression.getText() === \"require\";\n }\n\n isCJSModuleExportsExpressionStatement(node): boolean {\n if (node.expression && node.expression.kind === ts.SyntaxKind.BinaryExpression ) {\n if (node.expression.left.kind === ts.SyntaxKind.PropertyAccessExpression) {\n const left = node.expression.left as ts.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 => ts.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 === ts.SyntaxKind.CallExpression) {\n const callExpression = decNode.initializer.expression.getText();\n if (callExpression === \"require\") {\n const isDefault = decNode.name.kind === ts.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) => ts.isExportDeclaration(s));\n const defaultExport = node.statements.filter((s) => ts.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 ts.BinaryExpression);\n\n moduleExports.forEach(node => {\n const right = node.right;\n if (right.kind === ts.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 === ts.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) => ts.isClassDeclaration(s));\n const functionDeclarations = node.statements.filter((s) => ts.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 === ts.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 func2Type = this.getChecker().getTypeOfSymbolAtLocation(bType.symbol, bType.symbol.valueDeclaration);\n const func2Signature = this.getChecker().getSignaturesOfType(func2Type, ts.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?.escapedText;\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 = ts.TypeFlags[type.flags];\n return result;\n }\n }\n\n const name = node.type?.typeName?.escapedText;\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) => ts.isClassDeclaration(s));\n classDeclarations.forEach((node) => {\n const methods = node.members.filter((m) => ts.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 ts from 'typescript';\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: ts.SourceFile;\n checker: ts.TypeChecker;\n program: ts.Program;\n}\n\n// Parsed SourceFiles (the es lib chain plus the import closure of everything\n// transpiled so far) and the last program built from them, so the next program\n// reuses that work instead of re-parsing it. Shareable between Transpiler\n// instances running on the same thread; these are plain V8 heap objects, so a\n// worker_threads isolate cannot receive one and needs a cache of its own.\ninterface ITranspileProgramCache {\n sourceFiles: Map;\n byPathHost?: ts.CompilerHost;\n byPathOldProgram?: ts.Program;\n memoryOldProgram?: ts.Program;\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}\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 ts, { TypeChecker } from 'typescript';\nimport { unCamelCase, regexAll } from \"./utils.js\";\nimport { Logger } from \"./logger.js\";\n\nconst SyntaxKind = ts.SyntaxKind;\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 if (symbol && symbol.valueDeclaration) {\n const valueDecl = symbol.valueDeclaration;\n\n // Check if it's a function (FunctionDeclaration, FunctionExpression, ArrowFunction)\n if (ts.isFunctionDeclaration(valueDecl) || ts.isFunctionExpression(valueDecl) || ts.isArrowFunction(valueDecl)) {\n // Check if the identifier is passed as an argument in a function call\n if (node.parent && ts.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 === ts.TypeFlags.String || rightType.flags === ts.TypeFlags.String) {\n return TOKEN;\n }\n if (leftType.flags === ts.TypeFlags.StringLiteral || rightType.flags === ts.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 TypeChecker).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.escapedText;\n const right = node.right.escapedText;\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?.escapedText;\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.escapedText ?? 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 === ts.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 ts, { TypeChecker } from 'typescript';\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\nexport class CSharpTranspiler 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.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 = {\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.binaryExpressionsWrappers = {\n [ts.SyntaxKind.EqualsEqualsToken]: [this.EQUALS_EQUALS_WRAPPER_OPEN, this.EQUALS_EQUALS_WRAPPER_CLOSE],\n [ts.SyntaxKind.EqualsEqualsEqualsToken]: [this.EQUALS_EQUALS_WRAPPER_OPEN, this.EQUALS_EQUALS_WRAPPER_CLOSE],\n [ts.SyntaxKind.ExclamationEqualsToken]: [this.DIFFERENT_WRAPPER_OPEN, this.DIFFERENT_WRAPPER_CLOSE],\n [ts.SyntaxKind.ExclamationEqualsEqualsToken]: [this.DIFFERENT_WRAPPER_OPEN, this.DIFFERENT_WRAPPER_CLOSE],\n [ts.SyntaxKind.GreaterThanToken]: [this.GREATER_THAN_WRAPPER_OPEN, this.GREATER_THAN_WRAPPER_CLOSE],\n [ts.SyntaxKind.GreaterThanEqualsToken]: [this.GREATER_THAN_EQUALS_WRAPPER_OPEN, this.GREATER_THAN_EQUALS_WRAPPER_CLOSE],\n [ts.SyntaxKind.LessThanToken]: [this.LESS_THAN_WRAPPER_OPEN, this.LESS_THAN_WRAPPER_CLOSE],\n [ts.SyntaxKind.LessThanEqualsToken]: [this.LESS_THAN_EQUALS_WRAPPER_OPEN, this.LESS_THAN_EQUALS_WRAPPER_CLOSE],\n [ts.SyntaxKind.PlusToken]: [this.PLUS_WRAPPER_OPEN, this.PLUS_WRAPPER_CLOSE],\n [ts.SyntaxKind.MinusToken]: [this.MINUS_WRAPPER_OPEN, this.MINUS_WRAPPER_CLOSE],\n [ts.SyntaxKind.AsteriskToken]: [this.MULTIPLY_WRAPPER_OPEN, this.MULTIPLY_WRAPPER_CLOSE],\n [ts.SyntaxKind.PercentToken]: [this.MOD_WRAPPER_OPEN, this.MOD_WRAPPER_CLOSE],\n [ts.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 printIdentifier(node) {\n let idValue = node.text ?? node.escapedText;\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?.symbol;\n if (symbol !== undefined) {\n // const declarations = this.getChecker().getDeclaredTypeOfSymbol(symbol).symbol?.declarations ?? [];\n const decl = symbol?.declarations ?? [];\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 === ts.SyntaxKind.ClassDeclaration);\n const isInsideNewExpression = node?.parent?.kind === ts.SyntaxKind.NewExpression;\n const isInsideCatch = node?.parent?.kind === ts.SyntaxKind.ThrowStatement;\n const isLeftSide = node?.parent?.name === node || (node?.parent?.left === node);\n const isCallOrPropertyAccess = node?.parent?.kind === ts.SyntaxKind.PropertyAccessExpression || node?.parent?.kind === ts.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];\n if (first.kind === ts.SyntaxKind.ClassDeclaration) {\n isClassDeclaration = true;\n }\n if (first.kind === ts.SyntaxKind.ImportSpecifier) {\n const importedSymbol = this.getChecker().getAliasedSymbol(symbol);\n if (importedSymbol?.declarations[0]?.kind === ts.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 superCallParams = '';\n let hasSuperCall = false;\n node.body?.statements.forEach(statement => {\n if (ts.isExpressionStatement(statement)) {\n const expression = statement.expression;\n if (ts.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 printThisElementAccesssIfNeeded(node, identation) {\n // convert this[method] into this.call(method) or this.callAsync(method)\n // const isAsync = node?.parent?.kind === ts.SyntaxKind.AwaitExpression;\n const isAsync = true; // setting to true for now, because there are some scenarios where we don't know\n // if the call is async or not, so we need to assume it is async\n // example Promise.all([this.unknownPropAsync()])\n const elementAccess = node.expression;\n if (elementAccess?.kind === ts.SyntaxKind.ElementAccessExpression) {\n if (elementAccess?.expression?.kind === ts.SyntaxKind.ThisKeyword) {\n let parsedArg = node.arguments?.length > 0 ? this.printNode(node.arguments[0], identation).trimStart() : \"\";\n const propName = this.printNode(elementAccess.argumentExpression, 0);\n const wrapperOpen = isAsync ? this.UKNOWN_PROP_ASYNC_WRAPPER_OPEN : this.UKNOWN_PROP_WRAPPER_OPEN;\n const wrapperClose = isAsync ? this.UNKOWN_PROP_ASYNC_WRAPPER_CLOSE : this.UNKOWN_PROP_WRAPPER_CLOSE;\n parsedArg = parsedArg ? \", \" + parsedArg : \"\";\n return wrapperOpen + propName + parsedArg + wrapperClose;\n }\n }\n return;\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 === ts.SyntaxKind.ElementAccessExpression) {\n const parsedArg = node.arguments?.length > 0 ? 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 const argsArray = `new object[] { ${parsedArg} }`;\n const open = this.DYNAMIC_CALL_OPEN;\n let statement = `${open}${target}, ${propName}, ${argsArray})`;\n statement = isAsync ? `((Task)${statement})` : statement;\n return statement;\n }\n return undefined;\n }\n\n\n printElementAccessExpressionExceptionIfAny(node) {\n // convert this[method] into this.call(method) or this.callAsync(method)\n // if (node?.expression?.kind === ts.SyntaxKind.ThisKeyword) {\n // const isAsyncDecl = node?.parent?.kind === ts.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 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.escapedText;\n // const isAsyncDecl = true;\n const isAsyncDecl = node?.parent?.kind === ts.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 printOutOfOrderCallExpressionIfAny(node, identation) {\n if (node.expression.kind === ts.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 `mathMin(${parsedArg1}, ${parsedArg2})`;\n case \"Math.max\":\n return `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 === ts.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 === ts.SyntaxKind.ExclamationEqualsEqualsToken || op === ts.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 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 === ts.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 === ts.SyntaxKind.EqualsToken && left.kind === ts.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 = `var ${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) + `${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 === ts.SyntaxKind.InKeyword) {\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 === ts.SyntaxKind.PlusEqualsToken || op === ts.SyntaxKind.MinusEqualsToken || op in this.binaryExpressionsWrappers) {\n const leftText = this.printNode(left, 0);\n const rightText = this.printNode(right, 0);\n\n if (op === ts.SyntaxKind.PlusEqualsToken) {\n return `${leftText} = add(${leftText}, ${rightText})`;\n }\n\n if (op === ts.SyntaxKind.MinusEqualsToken) {\n return `${leftText} = subtract(${leftText}, ${rightText})`;\n }\n\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 // x = y\n // cast y to x type when y is unknown\n // if (op === ts.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 printVariableDeclarationList(node,identation) {\n const declaration = node.declarations[0];\n // const name = declaration.name.escapedText;\n\n if (this.removeVariableDeclarationForFunctionExpression && declaration?.initializer && ts.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 === ts.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)}var ${syntheticName} = ${this.printNode(declaration.initializer, 0)};\\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} = ((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 === ts.SyntaxKind.NewExpression);\n const varToken = isNew ? 'var ' : this.VAR_TOKEN + ' ' ;\n\n // handle default undefined initialization\n if (declaration?.initializer && declaration.initializer === undefined) {\n // handle the let id: Str; case\n return this.getIden(identation) + varToken + this.printNode(declaration.name) + \" = \" + this.UNDEFINED_TOKEN;\n } else 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 return this.getIden(identation) + varToken + 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.escapedText;\n\n let rawExpression = undefined;\n\n switch(rightSide) {\n case 'length':\n const type = (this.getChecker() as TypeChecker).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) ? `((string)${leftSide}).Length` : `${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 (ts.isArrayLiteralExpression(node) || ts.isObjectLiteralExpression(node) || ts.isStringLiteral(node) || (ts as any).isBooleanLiteral(node)) {\n return this.UNDEFINED_TOKEN;\n }\n\n if (ts.isNumericLiteral(node)) {\n return this.UNDEFINED_TOKEN;\n }\n\n // convert x: number = undefined (invalid) into x = -1 (valid)\n if (node?.escapedText === \"undefined\" && this.getChecker().getTypeAtLocation(node?.parent)?.flags === ts.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 (ts.isArrayLiteralExpression(initializer)) {\n initParams.push(`${this.printNode(param.name, 0)} ??= new List();`);\n }\n if (ts.isObjectLiteralExpression(initializer)) {\n initParams.push(`${this.printNode(param.name, 0)} ??= new Dictionary();`);\n }\n if (ts.isNumericLiteral(initializer)) {\n initParams.push(`${this.printNode(param.name, 0)} ??= ${this.printNode(initializer, 0)};`);\n }\n if (ts.isStringLiteral(initializer)) {\n initParams.push(`${this.printNode(param.name, 0)} ??= ${this.printNode(initializer, 0)};`);\n }\n if ((ts as any).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.escapedText;\n const right = node.right.escapedText;\n return this.getIden(identation) + `${left} is ${right}`;\n }\n\n printAsExpression(node, identation) {\n const type = node.type;\n\n if (type.kind === ts.SyntaxKind.AnyKeyword) {\n return `((object)${this.printNode(node.expression, identation)})`;\n }\n\n if (type.kind === ts.SyntaxKind.StringKeyword) {\n return `((string)${this.printNode(node.expression, identation)})`;\n }\n\n if (type.kind === ts.SyntaxKind.ArrayType) {\n if (type.elementType.kind === ts.SyntaxKind.AnyKeyword) {\n return `(IList)(${this.printNode(node.expression, identation)})`;\n }\n if (type.elementType.kind === ts.SyntaxKind.StringKeyword) {\n return `(IList)(${this.printNode(node.expression, identation)})`;\n }\n }\n\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 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 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 printArrayLiteralExpression(node) {\n\n let arrayOpen = this.ARRAY_OPENING_TOKEN;\n const elems = node.elements;\n\n const elements = node.elements.map((e) => {\n return this.printNode(e);\n }).join(\", \");\n\n // take into consideration list of promises\n if (elems.length > 0) {\n const first = elems[0];\n if (first.kind === ts.SyntaxKind.CallExpression) {\n // const type = this.getChecker().getTypeAtLocation(first);\n let type = this.getFunctionType(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 printMethodDefinition(node, identation) {\n let name = node.name.escapedText;\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 = \"\";\n parentArgs.forEach((param, index) => {\n const originalName = this.printNode(currentArgs[index].name, 0);\n const parsedArg = this.printParameteCustomName(param, originalName);\n parsedArgs+= parsedArg;\n if (index < parentArgs.length - 1) {\n parsedArgs+= \", \";\n }\n });\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 printArgsForCallExpression(node, identation) {\n const args = node.arguments;\n let parsedArgs = \"\";\n if (false && this.requiresCallExpressionCast && !this.isBuiltInFunctionCall(node?.expression)) { //eslint-disable-line\n const parsedTypes = this.getTypesFromCallExpressionParameters(node);\n const tmpArgs = [];\n args.forEach((arg, index) => {\n const parsedType = parsedTypes[index];\n let cast = \"\";\n if (parsedType !== \"object\" && parsedType !== \"float\" && parsedType !== \"int\") {\n cast = parsedType ? `(${parsedType})` : '';\n }\n tmpArgs.push(cast + this.printNode(arg, identation).trim());\n });\n parsedArgs = tmpArgs.join(\",\");\n return parsedArgs;\n }\n return super.printArgsForCallExpression(node, identation);\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 return `new List(((IDictionary)${parsedArg}).Keys)`;\n }\n\n printObjectValuesCall(node, identation, parsedArg = undefined) {\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 return `((IList)${name}).Add(${parsedArg})`;\n }\n\n printIncludesCall(node, identation, name = undefined, parsedArg = undefined) {\n return `${name}.Contains(${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 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 return `String.Join(${parsedArg}, ((IList)${name}).ToArray())`;\n }\n\n printSplitCall(node, identation, name = undefined, parsedArg = undefined) {\n return `((string)${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 `((string)${name}).ToUpper()`;\n }\n\n printToLowerCaseCall(node, identation, name = undefined) {\n return `((string)${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 printAssertCall(node, identation, parsedArgs) {\n return `assert(${parsedArgs})`;\n }\n\n printSliceCall(node, identation, name = undefined, parsedArg = undefined, parsedArg2 = undefined) {\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 printReplaceCall(node, identation, name = undefined, parsedArg = undefined, parsedArg2 = undefined) {\n return `((string)${name}).Replace((string)${parsedArg}, (string)${parsedArg2})`;\n }\n\n printReplaceAllCall(node, identation, name = undefined, parsedArg = undefined, parsedArg2 = undefined) {\n return `((string)${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 TypeChecker).getTypeAtLocation(node.expression); // eslint-disable-line\n this.warnIfAnyType(node, type.flags, leftSide, \"length\");\n return this.isStringType(type.flags) ? `((string)${leftSide}).Length` : `${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 === ts.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 === ts.SyntaxKind.NumericLiteral) {\n return super.printPrefixUnaryExpression(node, identation);\n }\n if (operator === ts.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 === ts.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.printCondition(node.condition, 0);\n const whenTrue = this.printNode(node.whenTrue, 0);\n const whenFalse = this.printNode(node.whenFalse, 0);\n\n return `((bool) ${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 `((IDictionary)${object}).Remove((string)${key})`;\n }\n\n printNewExpression(node, identation) {\n let expression = node.expression?.escapedText;\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 === ts.SyntaxKind.Identifier) {\n return this.getIden(identation) + this.THROW_TOKEN + ' ' + this.printNode(node.expression, 0) + this.LINE_TERMINATOR;\n }\n if (node.expression.kind === ts.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 === ts.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.escapedText === 'Error' ? 'Exception' : id.escapedText;\n const symbol = this.getChecker().getSymbolAtLocation(expression.expression);\n if (symbol) {\n const declarations = this.getChecker().getDeclaredTypeOfSymbol(symbol).symbol?.declarations ?? [];\n const isClassDeclaration = declarations.find(l => l.kind === ts.SyntaxKind.InterfaceDeclaration || l.kind === ts.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.escapedText ? newExpression : idName} (${parsedArg}) ${this.LINE_TERMINATOR}`;\n } else if (expression.expression.kind === ts.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?.escapedText;\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 csModifiers = {\n\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) {\n if (node.type.kind === ts.SyntaxKind.AnyKeyword) {\n typeText = this.OBJECT_KEYWORD + ' ';\n }\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 ts, { BinaryExpression, CallExpression, TypeChecker } from 'typescript';\n\nconst SyntaxKind = ts.SyntaxKind;\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': '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': '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\nexport class GoTranspiler extends BaseTranspiler {\n\n binaryExpressionsWrappers;\n wrapThisCalls: boolean;\n wrapCallMethods: string[] = [];\n classNameMap: { [key: string]: string };\n DEFAULT_RETURN_TYPE = 'any';\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 }\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 [ts.SyntaxKind.EqualsEqualsToken]: [this.EQUALS_EQUALS_WRAPPER_OPEN, this.EQUALS_EQUALS_WRAPPER_CLOSE],\n [ts.SyntaxKind.EqualsEqualsEqualsToken]: [this.EQUALS_EQUALS_WRAPPER_OPEN, this.EQUALS_EQUALS_WRAPPER_CLOSE],\n [ts.SyntaxKind.ExclamationEqualsToken]: [this.DIFFERENT_WRAPPER_OPEN, this.DIFFERENT_WRAPPER_CLOSE],\n [ts.SyntaxKind.ExclamationEqualsEqualsToken]: [this.DIFFERENT_WRAPPER_OPEN, this.DIFFERENT_WRAPPER_CLOSE],\n [ts.SyntaxKind.GreaterThanToken]: [this.GREATER_THAN_WRAPPER_OPEN, this.GREATER_THAN_WRAPPER_CLOSE],\n [ts.SyntaxKind.GreaterThanEqualsToken]: [this.GREATER_THAN_EQUALS_WRAPPER_OPEN, this.GREATER_THAN_EQUALS_WRAPPER_CLOSE],\n [ts.SyntaxKind.LessThanToken]: [this.LESS_THAN_WRAPPER_OPEN, this.LESS_THAN_WRAPPER_CLOSE],\n [ts.SyntaxKind.LessThanEqualsToken]: [this.LESS_THAN_EQUALS_WRAPPER_OPEN, this.LESS_THAN_EQUALS_WRAPPER_CLOSE],\n [ts.SyntaxKind.PlusToken]: [this.PLUS_WRAPPER_OPEN, this.PLUS_WRAPPER_CLOSE],\n [ts.SyntaxKind.MinusToken]: [this.MINUS_WRAPPER_OPEN, this.MINUS_WRAPPER_CLOSE],\n [ts.SyntaxKind.AsteriskToken]: [this.MULTIPLY_WRAPPER_OPEN, this.MULTIPLY_WRAPPER_CLOSE],\n [ts.SyntaxKind.PercentToken]: [this.MOD_WRAPPER_OPEN, this.MOD_WRAPPER_CLOSE],\n [ts.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\n printPropertyDeclaration(node, identation) {\n // let modifiers = this.printModifiers(node);\n // modifiers = modifiers ? modifiers + \" \" : modifiers;\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 || (ts as any).isBooleanLiteral(node)) {\n type = 'bool';\n } else if (node.type.kind === SyntaxKind.ArrayType) {\n type = '[]any';\n }\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 return this.getIden(identation) + name + ' ' + type + ' ' + `\\`default:\"${initializer}\"\\`` + this.LINE_TERMINATOR;\n }\n return this.getIden(identation) + name + ' ' + type + this.LINE_TERMINATOR;\n }\n\n printStruct(node, indentation) {\n\n // check if we have heritage\n let heritageName = '';\n if (node?.heritageClauses?.length > 0) {\n const heritage = node.heritageClauses[0];\n const heritageType = heritage.types[0];\n let heritageEscapedText = heritageType.expression.escapedText;\n if (this.classNameMap[heritageEscapedText]) {\n heritageEscapedText = this.classNameMap[heritageEscapedText];\n }\n heritageName = this.getIden(indentation+1) + heritageEscapedText + '\\n';\n }\n\n const propDeclarations = node.members.filter(member => member.kind === SyntaxKind.PropertyDeclaration);\n return `type ${this.className} struct {\\n${heritageName}${propDeclarations.map(member => this.printNode(member, indentation+1)).join(\"\\n\")}\\n}`;\n }\n\n printNewStructMethod(node){\n return `\nfunc New${this.capitalize(this.className)}() *${(this.className)} {\n p := &${this.className}{}\n setDefaults(p)\n return 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.escapedText;\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 = methods.map(method => this.printMethodDeclaration(method, identation)).join(\"\\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 return struct + \"\\n\" + newMethod + \"\\n\" + classMethods;\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\n let methodDef = this.printMethodDefinition(node, identation);\n\n const isAsync = this.isAsyncFunction(node);\n\n const funcBody = this.printFunctionBody(node, identation, isAsync);\n\n methodDef += funcBody;\n\n return methodDef;\n }\n\n printFunctionDeclaration(node, identation) {\n if (ts.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 let functionDef = this.printFunctionDefinition(node, identation);\n const funcBody = this.printFunctionBody(node, identation, isAsync);\n functionDef += funcBody;\n\n return this.printNodeCommentsIfAny(node, identation, functionDef);\n }\n\n printMethodDefinition(node, identation) {\n let name = node.name.escapedText;\n name = this.transformMethodNameIfNeeded(name);\n\n let returnType = this.printFunctionType(node);\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) + returnType + methodToken + name\n // + \"(\" + parsedArgs + \")\";\n const structReceiver = `(${this.THIS_TOKEN} *${this.className})`;\n const methodDef = this.getIden(identation) + methodToken + \" \" + structReceiver + \" \" + name + \"(\" + parsedArgs + \") \" + returnType;\n\n return this.printNodeCommentsIfAny(node, identation, methodDef);\n }\n\n\n printFunctionDefinition(node, identation) {\n let name = node.name.escapedText;\n name = this.transformMethodNameIfNeeded(name);\n\n let returnType = this.printFunctionType(node);\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) + returnType + methodToken + name\n // + \"(\" + parsedArgs + \")\";\n const methodDef = this.getIden(identation) + methodToken + name + \"(\" + parsedArgs + \") \" + returnType;\n\n return this.printNodeCommentsIfAny(node, identation, methodDef);\n }\n\n printMethodParameters(node) {\n const params = node.parameters.map(param => this.printParameter(param));\n const hasOptionalParameter = params.some(p => p === 'optional');\n if (!hasOptionalParameter) {\n return params.join(\", \");\n }\n const paramsWithOptional = params.filter(param => param !== 'optional');\n paramsWithOptional.push('optionalArgs ...any');\n return paramsWithOptional.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) {\n if (initializer) {\n return 'optional'; // will be handled later\n }\n // not supported we have to find an alternative for go like defining multiple methods with different parameters\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 name + ' ' + type;\n }\n return name + ' ' + type;\n }\n\n printParameterType(node) {\n const typeText = this.getType(node);\n // // if (typeText === this.BOOLEAN_KEYWORD) {\n // // return typeText;\n // // }\n\n //tmp default to interface\n return 'any';\n\n if (typeText === this.STRING_KEYWORD) {\n return 'string';\n }\n if (typeText === this.NUMBER_KEYWORD) {\n return 'float64';\n }\n\n if (typeText === this.BOOLEAN_KEYWORD) {\n return 'bool';\n }\n\n return this.DEFAULT_PARAMETER_TYPE;\n\n if (typeText === undefined || typeText === this.STRING_KEYWORD) {\n // throw new FunctionReturnTypeError(\"Parameter type is not supported or undefined\");\n this.warn(node, node.getText(), \"Parameter type not found, will default to: \" + this.DEFAULT_PARAMETER_TYPE);\n return this.DEFAULT_PARAMETER_TYPE;\n }\n return typeText;\n\n }\n\n printFunctionType(node){\n const typeText = this.getFunctionType(node);\n if (typeText === 'void') {\n // // If the function is async (returns a Promise in TS) but declared void, emit a typed channel\n // if (this.isAsyncFunction(node)) {\n // // Ensure element type is present; some edge cases yield '<- chan' only\n // const elementType = this.DEFAULT_RETURN_TYPE || 'any';\n // return `<- chan ${elementType}`;\n // }\n return \"\";\n }\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 = `<- chan ${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 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 printVariableDeclarationList(node,identation) {\n const declaration = node.declarations[0];\n // const varToken = this.VAR_TOKEN ? this.VAR_TOKEN + \" \": \"\";\n // const name = declaration.name.escapedText;\n\n if (declaration?.name.kind === ts.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)}${syntheticName} := ${this.printNode(declaration.initializer, 0)};\\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) + `${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 (declaration?.initializer?.kind=== ts.SyntaxKind.AwaitExpression) {\n const parsedName = this.printNode(declaration.name, 0);\n const parsedInitializer = this.printNode(declaration.initializer, 0);\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 === ts.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 === ts.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 stm = this.getIden(identation) + \"var \" + varName + \" any = \" + parsedValue;\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?.escapedText;\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 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 (ts.isExpressionStatement(statement)) {\n const expression = statement.expression;\n if (ts.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 printThisElementAccesssIfNeeded(node, identation) {\n // convert this[method] into this.call(method) or this.callAsync(method)\n // const isAsync = node?.parent?.kind === ts.SyntaxKind.AwaitExpression;\n const isAsync = true; // setting to true for now, because there are some scenarios where we don't know\n // if the call is async or not, so we need to assume it is async\n // example Promise.all([this.unknownPropAsync()])\n const elementAccess = node.expression;\n if (elementAccess?.kind === ts.SyntaxKind.ElementAccessExpression) {\n if (elementAccess?.expression?.kind === ts.SyntaxKind.ThisKeyword) {\n let parsedArg = node.arguments?.length > 0 ? this.printNode(node.arguments[0], identation).trimStart() : \"\";\n const propName = this.printNode(elementAccess.argumentExpression, 0);\n const wrapperOpen = isAsync ? this.UKNOWN_PROP_ASYNC_WRAPPER_OPEN : this.UKNOWN_PROP_WRAPPER_OPEN;\n const wrapperClose = isAsync ? this.UNKOWN_PROP_ASYNC_WRAPPER_CLOSE : this.UNKOWN_PROP_WRAPPER_CLOSE;\n parsedArg = parsedArg ? \", \" + parsedArg : \"\";\n return wrapperOpen + propName + parsedArg + wrapperClose;\n }\n }\n return;\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 === ts.SyntaxKind.ElementAccessExpression) {\n const parsedArg = node.arguments?.length > 0 ? 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 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 = 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 let parsedArguments = node.arguments?.map((a) => this.printNode(a, 0)).join(\", \");\n parsedArguments = parsedArguments ? parsedArguments : \"\";\n const propName = node.expression?.name.escapedText;\n // const isAsyncDecl = true;\n // const isAsyncDecl = node?.parent?.kind === ts.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) {\n return this.capitalize(name);\n }\n\n transformPropertyAccessExpressionName(name: string) {\n return this.capitalize(name);\n }\n\n printOutOfOrderCallExpressionIfAny(node, identation) {\n if (node.expression.kind === ts.SyntaxKind.PropertyAccessExpression) {\n const args = node.arguments;\n\n if (node.expression.expression.kind === ts.SyntaxKind.ThisKeyword) {\n const methodName = this.printNode(node.expression.name, 0);\n if (this.wrapThisCalls || (this.wrapCallMethods.includes(methodName))) {\n let argsParsed = \"\";\n if (args.length > 0) {\n argsParsed = args.map((a) => this.printNode(a, 0)).join(\", \");\n return `<-this.callInternal(\"${methodName}\", ${argsParsed})`;\n }\n return `<-this.callInternal(\"${methodName}\")`;\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);\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 === ts.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 === ts.SyntaxKind.ExclamationEqualsEqualsToken || op === ts.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 + `IsObject(${target})`;\n case \"function\":\n return notOperator + `IsFunction(${target})`;\n }\n\n return undefined;\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 === ts.SyntaxKind.EqualsToken &&\n left.kind === ts.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) + `${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 // ---------------------------------------------------------------\n // Go-style setter for element-access assignments: a[b] = v\n // ---------------------------------------------------------------\n if (op === ts.SyntaxKind.EqualsToken &&\n left.kind === ts.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 (ts.isElementAccessExpression(cur)) {\n keys.unshift(cur.argumentExpression); // prepend\n const expr = cur.expression;\n if (!ts.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.\n let acc = containerStr;\n for (let i = 0; i < keyStrs.length - 1; i++) {\n acc = `${this.ELEMENT_ACCESS_WRAPPER_OPEN}${acc}, ${keyStrs[i]}${this.ELEMENT_ACCESS_WRAPPER_CLOSE}`;\n }\n\n const lastKey = keyStrs[keyStrs.length - 1];\n const rhs = this.printNode(right, 0);\n\n return `AddElementToObject(${acc}, ${lastKey}, ${rhs})`;\n }\n\n // ---------------------------------------------------------------\n // Go-style setter for element-access compound assignments: a[b] += v\n // ---------------------------------------------------------------\n if (op === ts.SyntaxKind.PlusEqualsToken &&\n left.kind === ts.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 (ts.isElementAccessExpression(cur)) {\n keys.unshift(cur.argumentExpression); // prepend\n const expr = cur.expression;\n if (!ts.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.\n let acc = containerStr;\n for (let i = 0; i < keyStrs.length - 1; i++) {\n acc = `${this.ELEMENT_ACCESS_WRAPPER_OPEN}${acc}, ${keyStrs[i]}${this.ELEMENT_ACCESS_WRAPPER_CLOSE}`;\n }\n\n const lastKey = keyStrs[keyStrs.length - 1];\n const rhs = this.printNode(right, 0);\n\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 result = `AddElementToObject(${acc}, ${lastKey}, Add(${currentValue}, ${rhs}))`;\n return result;\n }\n\n if (left.kind === ts.SyntaxKind.TypeOfExpression) {\n const typeOfExpression = this.handleTypeOfInsideBinaryExpression(node, identation);\n if (typeOfExpression) {\n return typeOfExpression;\n }\n }\n\n if (op === ts.SyntaxKind.InKeyword) {\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 === ts.SyntaxKind.PlusEqualsToken || op === ts.SyntaxKind.MinusEqualsToken || op in this.binaryExpressionsWrappers) {\n const leftText = this.printNode(left, 0);\n const rightText = this.printNode(right, 0);\n\n if (op === ts.SyntaxKind.PlusEqualsToken) {\n return `${leftText} = Add(${leftText}, ${rightText})`;\n }\n\n if (op === ts.SyntaxKind.MinusEqualsToken) {\n return `${leftText} = Subtract(${leftText}, ${rightText})`;\n }\n\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 // x = y\n // cast y to x type when y is unknown\n // if (op === ts.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 transformPropertyAcessExpressionIfNeeded(node) {\n const expression = node.expression;\n const leftSide = this.printNode(expression, 0);\n const rightSide = node.name.escapedText;\n\n let rawExpression = undefined;\n\n switch(rightSide) {\n case 'length':\n const type = (this.getChecker() as TypeChecker).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) ? `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 printCustomDefaultValueIfNeeded(node) {\n return undefined;\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 initParams.push(`${paramName} := GetArg(optionalArgs, ${index}, ${this.printNode(initializer, 0)})`);\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 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 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 => {\n // if (statement.kind === ts.SyntaxKind.ReturnStatement) {\n // if (statement?.expression) {\n // return this.getIden(identation) + \"ch <-\" + this.printNode(statement.expression) + '\\n' + this.getIden(identation) + \"return \" + this.printNode(statement.expression);\n // }\n // }\n return this.printNode(statement, identation);\n }).join(\"\\n\");\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 const functionBodySplit = functionBody.split(\"\\n\");\n const bodyWithIndentationExtraAndNoReturn = functionBodySplit.map((line) => {\n\n const trimmedLine = line.trim();\n\n // should we do this inside printReturn statement?\n // if(trimmedLine.startsWith(\"return\") && trimmedLine !== \"return\") {\n // const returnIndentation = line.indexOf(\"return\")/4 + this.getIden(1);\n // let channelReturn = this.getIden(returnIndentation) + \"ch <-\" + line.replace(\"return\", \"\").trimStart();\n // if (trimmedLine === \"return nil\") {\n // channelReturn = this.getIden(returnIndentation) + \"ch <- nil\\n\" + this.getIden(returnIndentation) + \"return nil\";\n // // it's hard because we don't want to remove the treturns from the emulated try-catches we have that are also functions\n // // with return statements\n // }\n // return channelReturn;\n // }\n return this.getIden(identation+2) + line;\n }).join(\"\\n\");\n let shouldAddLastReturn = true;\n\n // const bodySplit = bodyWithIndentationExtraAndNoReturn.split(\"\\n\");\n const bodySplit = functionBodySplit;\n const lastLine = bodySplit[bodySplit.length - 1];\n if (lastLine.trim().startsWith(\"return\") || lastLine.trim().startsWith(\"panic\")) {\n shouldAddLastReturn = false;\n }\n\n // Check if the function body ends with a conditional that has returns in all branches\n if (node.body && this.blockEndsWithConditionalReturn(node.body.statements)) {\n shouldAddLastReturn = false;\n }\n\n const lastReturn = shouldAddLastReturn ? this.getIden(identation+2) + \"return nil\" : \"\";\n // const hasCatchInside = bodySplit.indexOf(\"recover()\") > -1;\n // if ((1+1 == 2) || hasCatchInside) {\n functionBody = `{\n ${this.getIden(identation + 1)}ch := make(chan ${this.DEFAULT_RETURN_TYPE})\n ${this.getIden(identation + 1)}go func() any {\n ${this.getIden(identation + 2)}defer close(ch)\n ${this.getIden(identation + 2)}defer ReturnPanicError(ch)\n ${bodyWithIndentationExtraAndNoReturn}\n ${lastReturn}\n ${this.getIden(identation + 1)}}()\n ${this.getIden(identation + 1)}return ch\n ${this.getIden(identation)}}`;\n // } else {\n // functionBody = `{\n // ${id1}ch := make(chan ${this.DEFAULT_RETURN_TYPE})\n // ${id1}var panicError any = nil\n // ${id1}var wg sync.WaitGroup\n // ${id1}wg.Add(1)\n // ${id1}go func() any {\n // ${id2}defer wg.Done()\n // ${id2}defer close(ch)\n // ${id2}defer func() {\n // ${id3}if r := recover(); r != nil {\n // ${id4}panicError = r\n // ${id4}return\n // ${id3}}\n // ${id2}}()\n // ${bodySplit}\n // ${lastReturn}\n // ${id1}}()\n // ${id1}wg.Wait()\n // ${id1}if panicError != nil {\n // ${id2}panic(panicError)\n // ${id1}}\n // ${id1}return ch\n // ${id}}`;\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 getRandomNameSuffix() {\n return Math.floor(Math.random() * 1000000).toString();\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 === ts.SyntaxKind.AsExpression) {\n node = node.expression;\n }\n if (node.expression.kind !== ts.SyntaxKind.AwaitExpression) {\n return 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 const expStatement = `\n${this.getIden(identation)}${returnRandName} := ${exprStm}\n${this.getIden(identation)}PanicOnError(${returnRandName})`;\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 (ts.isFunctionDeclaration(currentNode) ||\n ts.isFunctionExpression(currentNode) ||\n ts.isArrowFunction(currentNode) ||\n ts.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 printReturnStatement(node, identation) {\n\n const isAsyncFunction = this.isInsideAsyncFunction(node);\n // if (node?.expression?.kind !== ts.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 if (node?.expression?.kind === ts.SyntaxKind.AsExpression) {\n node = node.expression;\n }\n\n if (node?.expression?.kind === ts.SyntaxKind.AwaitExpression) {\n // const returnRandName = \"retRes\" + this.getRandomNameSuffix();\n const returnRandName = \"retRes\" + this.getLineBasedSuffix(node.expression);\n rightPart = rightPart ? ' ' + rightPart + this.LINE_TERMINATOR : this.LINE_TERMINATOR;\n // return leadingComment + this.getIden(identation) + this.RETURN_TOKEN + rightPart + trailingComment;\n return `\n ${this.getIden(identation)}${returnRandName} := ${rightPart}\n ${this.getIden(identation)}PanicOnError(${returnRandName})\n ${this.getIden(identation)}${leadingComment}ch <- ${returnRandName}${trailingComment}\n ${this.getIden(identation)}return nil`;\n // ${this.getIden(identation)}return ${returnRandName}`;\n }\n\n if (rightPart.length === 0) {\n return `\\n${this.getIden(identation)}return nil`;\n }\n\n return `\n${this.getIden(identation)}${leadingComment}ch <- ${rightPart}${trailingComment}\n${this.getIden(identation)}return nil`;\n // ${this.getIden(identation)}return ${rightPart}`;\n // ${this.getIden(identation)}return ${rightPart}`;\n }\n\n\n printAsExpression(node, identation) {\n const type = node.type;\n\n if (type.kind === ts.SyntaxKind.AnyKeyword) {\n // return `(()${this.printNode(node.expression, identation)})`;\n }\n\n if (type.kind === ts.SyntaxKind.StringKeyword) {\n // return `((string)${this.printNode(node.expression, identation)})`;\n }\n\n if (type.kind === ts.SyntaxKind.ArrayType) {\n // if (type.elementType.kind === ts.SyntaxKind.AnyKeyword) {\n // return `(IList)(${this.printNode(node.expression, identation)})`;\n // }\n // if (type.elementType.kind === ts.SyntaxKind.StringKeyword) {\n // return `(IList)(${this.printNode(node.expression, identation)})`;\n // }\n }\n\n return this.printNode(node.expression, identation);\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) => {\n return this.printNode(e);\n }).join(\", \");\n\n // take into consideration list of promises\n if (elems.length > 0) {\n const first = elems[0];\n if (first.kind === ts.SyntaxKind.CallExpression) {\n // const type = this.getChecker().getTypeAtLocation(first);\n const type = this.getFunctionType(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 = \"[]any{\";\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 = `[]any{`;\n }\n }\n }\n\n return arrayOpen + elements + this.ARRAY_CLOSING_TOKEN;\n }\n\n printArgsForCallExpression(node, identation) {\n const args = node.arguments;\n let parsedArgs = \"\";\n if (false && this.requiresCallExpressionCast && !this.isBuiltInFunctionCall(node?.expression)) { //eslint-disable-line\n const parsedTypes = this.getTypesFromCallExpressionParameters(node);\n const tmpArgs = [];\n args.forEach((arg, index) => {\n const parsedType = parsedTypes[index];\n let cast = \"\";\n if (parsedType !== \"object\" && parsedType !== \"float\" && parsedType !== \"int\") {\n cast = parsedType ? `(${parsedType})` : '';\n }\n tmpArgs.push(cast + this.printNode(arg, identation).trim());\n });\n parsedArgs = tmpArgs.join(\",\");\n return parsedArgs;\n }\n return super.printArgsForCallExpression(node, identation);\n }\n\n // check this out later\n\n printArrayIsArrayCall(node, identation, parsedArg = undefined) {\n return `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 printArrayPushCall(node: CallExpression, identation: number, name: string | undefined = undefined, parsedArg: string | undefined = undefined) {\n let returnValue = '';\n let returnRandName = name;\n if (name?.startsWith('GetValue')) {\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 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 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 printConcatCall(node, identation, name = undefined, parsedArg = undefined) {\n return `Concat(${name}, ${parsedArg})`;\n }\n\n printToUpperCaseCall(node, identation, name = undefined) {\n return `ToUpper(${name})`;\n }\n\n printToLowerCaseCall(node, identation, name = undefined) {\n return `ToLower(${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 `assert(${parsedArgs})`;\n }\n\n printSliceCall(node, identation, name = undefined, parsedArg = undefined, parsedArg2 = undefined) {\n if (parsedArg2 === undefined){\n // return `((string)${name}).Substring((int)${parsedArg})`;\n parsedArg2 = 'nil';\n }\n // return `((string)${name})[((int)${parsedArg})..((int)${parsedArg2})]`;\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 `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 TypeChecker).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 === ts.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 === ts.SyntaxKind.NumericLiteral) {\n // return super.printPrefixUnaryExpression(node, identation);\n // }\n // if (operator === ts.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 === ts.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.printCondition(node.condition, 0);\n const whenTrue = this.printNode(node.whenTrue, 0);\n const whenFalse = this.printNode(node.whenFalse, 0);\n\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 === ts.SyntaxKind.Identifier) {\n return this.getIden(identation) + 'panic(' + this.printNode(node.expression, 0) + ')' + this.LINE_TERMINATOR;\n }\n if (node.expression.kind === ts.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 === ts.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).symbol?.declarations ?? [];\n const isClassDeclaration = declarations.find(l => l.kind === ts.SyntaxKind.InterfaceDeclaration || l.kind === ts.SyntaxKind.ClassDeclaration);\n if (isClassDeclaration){\n // return this.getIden(identation) + `${this.THROW_TOKEN} ${this.NEW_TOKEN} ${id.escapedText} ((string)${parsedArg}) ${this.LINE_TERMINATOR}`;\n } else {\n return this.getIden(identation) + `throwDynamicException(${id.escapedText}, ${parsedArg});return nil;`;\n }\n }\n return this.getIden(identation) + `panic(${id.escapedText}(${parsedArg}))${this.LINE_TERMINATOR}`;\n } else if (expression.expression.kind === ts.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?.escapedText;\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 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 == ts.SyntaxKind.InstanceOfKeyword) {\n return this.printInstanceOfExpression(node, identation);\n }\n\n if (operatorToken.kind === ts.SyntaxKind.EqualsToken) {\n // handle test['a'] = 1;\n const elementAccess = left;\n const rightSide = this.printNode(right, 0);\n if (left.kind === ts.SyntaxKind.ElementAccessExpression) {\n const leftSide = this.printNode(elementAccess.expression, 0);\n const propName = this.printNode(elementAccess.argumentExpression, 0);\n return `AddElementToObject(${leftSide}, ${propName}, ${rightSide})`;\n }\n\n if (right?.kind === ts.SyntaxKind.AwaitExpression || rightSide.startsWith('<-this.callInternal')) {\n const leftParsed = this.printNode(left, 0);\n return `\n ${leftParsed} = ${rightSide}\n ${this.getIden(identation)}PanicOnError(${leftParsed})`;\n }\n }\n\n const op = operatorToken.kind;\n // handle: [x,d] = this.method()\n if (op === ts.SyntaxKind.EqualsToken && left.kind === ts.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) + `${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 let operator = this.SupportedKindNames[operatorToken.kind];\n\n\n let leftVar = undefined;\n let rightVar = undefined;\n\n // c# wrapper\n if (operatorToken.kind === ts.SyntaxKind.EqualsEqualsToken || operatorToken.kind === ts.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 === ts.SyntaxKind.BarBarToken || operatorToken.kind === ts.SyntaxKind.AmpersandAmpersandToken) {\n leftVar = this.printCondition(left, 0);\n rightVar = this.printCondition(right, identation);\n } else {\n leftVar = this.printNode(left, 0);\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 leftVar +\" \"+ operator + \" \" + rightVar.trim();\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 catchLines = catchBody.split(\"\\n\").map(l => l.trim()).filter(Boolean);\n const catchLastLine = catchLines.length ? catchLines[catchLines.length - 1] : \"\";\n const catchBodyEndsWithReturn = catchLastLine.startsWith(\"return\")\n || catchLastLine.startsWith(\"panic\")\n || catchLastLine.startsWith(\"throw new\")\n || this.blockEndsWithConditionalReturn(node.catchClause.block.statements);\n\n const tryLines = tryBody.split(\"\\n\").map(l => l.trim()).filter(Boolean);\n const tryLastLine = tryLines.length ? tryLines[tryLines.length - 1] : \"\";\n const tryBodyEndsWithReturn = tryLastLine.startsWith(\"return\")\n || tryLastLine.startsWith(\"panic\")\n || tryLastLine.startsWith(\"throw new\")\n || this.blockEndsWithConditionalReturn(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.escapedText;\n const classPrefix = this.className !== 'undefined' ? `(this *${this.className})` : \"()\";\n const thisWord = this.className !== 'undefined' ? \"this\" : \"\";\n const catchBlock =`\n {\n ${nodeEndsWithReturn ? 'ret__ :=' : ''} func${classPrefix} (ret_ any) {\n\t\t defer func() {\n if ${errorName} := recover(); ${errorName} != nil {\n if ${errorName} == \"break\" {\n return\n }\n ret_ = func${classPrefix} any {\n // catch block:\n ${catchBody}\n ${catchBodyEndsWithReturn ? \"\" : returNil}\n }(${thisWord})\n }\n }()\n\t\t // try block:\n ${tryBody}\n\t\t ${tryBodyEndsWithReturn ? \"\" : returNil}\n\t }(${thisWord})\n ${nodeEndsWithReturn\n ? `\n if ret__ != nil {\n return ret__\n }\n return nil`\n : ''}\n }`;\n // add identation\n const indentedBlock = catchBlock.split(\"\\n\").map((line) => this.getIden(identation) + line).join(\"\\n\");\n // const catchCondOpen = this.CONDITION_OPENING ? this.CONDITION_OPENING : \" \";\n\n return indentedBlock;\n }\n\n printPrefixUnaryExpression(node, identation) {\n const {operand, operator} = node;\n if (operator === ts.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 === ts.SyntaxKind.MinusToken) {\n return this.getIden(identation) + `OpNeg(${this.printNode(node.operand, 0)})`;\n }\n return this.getIden(identation) + this.PrefixFixOperators[operator] + this.printNode(operand, 0);\n }\n\n printNewExpression(node, identation) {\n let expression = node.expression?.escapedText;\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 const args = node.arguments.map(n => this.printNode(n, identation)).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 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 (ts.isElementAccessExpression(current)) {\n keys.unshift(current.argumentExpression); // prepend\n const expr = current.expression;\n if (!ts.isElementAccessExpression(expr)) {\n // Reached the base container.\n baseExpr = expr;\n break;\n }\n current = expr;\n }\n\n const containerStr = this.printNode(baseExpr, 0);\n const keyStrs = keys.map(k => this.printNode(k, 0));\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 return acc;\n }\n\n isInsideVoidFunction(node: ts.Node): boolean {\n for (let cur = node.parent; cur; cur = cur.parent) {\n if (ts.isFunctionLike(cur)) {\n return cur.type === undefined || cur.type.kind === ts.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: ts.Statement): boolean {\n if (ts.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 (ts.isReturnStatement(statement)) {\n return true;\n } else if (ts.isThrowStatement(statement)) {\n return true;\n } else if (ts.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 (ts.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: ts.NodeArray): boolean {\n if (statements.length === 0) {\n return false;\n }\n\n const lastStatement = statements[statements.length - 1];\n if (ts.isIfStatement(lastStatement)) {\n // Check if this if statement has returns in all branches (only if it has an else)\n const ifHasReturn = this.hasReturnInBlock(lastStatement.thenStatement);\n if (lastStatement.elseStatement) {\n const elseHasReturn = this.hasReturnInBlock(lastStatement.elseStatement);\n return ifHasReturn && elseHasReturn;\n }\n }\n if (ts.isTryStatement(lastStatement)) {\n // Check if this try statement has returns in both try and catch blocks\n const tryHasReturn = this.hasReturnInBlock(lastStatement.tryBlock);\n const catchHasReturn = this.hasReturnInBlock(lastStatement.catchClause.block);\n return tryHasReturn && catchHasReturn;\n }\n return false;\n }\n\n\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\n","import { BaseTranspiler } from \"./baseTranspiler.js\";\nimport ts, { TypeChecker } from \"typescript\";\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\nexport class JavaTranspiler extends BaseTranspiler {\n binaryExpressionsWrappers;\n\n varListFromObjectLiterals = {};\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; escapedText: any; ownGetFullText: boolean; getFullText: any }> = [];\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 }\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 = {\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.binaryExpressionsWrappers = {\n [ts.SyntaxKind.EqualsEqualsToken]: [\n this.EQUALS_EQUALS_WRAPPER_OPEN,\n this.EQUALS_EQUALS_WRAPPER_CLOSE,\n ],\n [ts.SyntaxKind.EqualsEqualsEqualsToken]: [\n this.EQUALS_EQUALS_WRAPPER_OPEN,\n this.EQUALS_EQUALS_WRAPPER_CLOSE,\n ],\n [ts.SyntaxKind.ExclamationEqualsToken]: [\n this.DIFFERENT_WRAPPER_OPEN,\n this.DIFFERENT_WRAPPER_CLOSE,\n ],\n [ts.SyntaxKind.ExclamationEqualsEqualsToken]: [\n this.DIFFERENT_WRAPPER_OPEN,\n this.DIFFERENT_WRAPPER_CLOSE,\n ],\n [ts.SyntaxKind.GreaterThanToken]: [\n this.GREATER_THAN_WRAPPER_OPEN,\n this.GREATER_THAN_WRAPPER_CLOSE,\n ],\n [ts.SyntaxKind.GreaterThanEqualsToken]: [\n this.GREATER_THAN_EQUALS_WRAPPER_OPEN,\n this.GREATER_THAN_EQUALS_WRAPPER_CLOSE,\n ],\n [ts.SyntaxKind.LessThanToken]: [\n this.LESS_THAN_WRAPPER_OPEN,\n this.LESS_THAN_WRAPPER_CLOSE,\n ],\n [ts.SyntaxKind.LessThanEqualsToken]: [\n this.LESS_THAN_EQUALS_WRAPPER_OPEN,\n this.LESS_THAN_EQUALS_WRAPPER_CLOSE,\n ],\n [ts.SyntaxKind.PlusToken]: [\n this.PLUS_WRAPPER_OPEN,\n this.PLUS_WRAPPER_CLOSE,\n ],\n [ts.SyntaxKind.MinusToken]: [\n this.MINUS_WRAPPER_OPEN,\n this.MINUS_WRAPPER_CLOSE,\n ],\n [ts.SyntaxKind.AsteriskToken]: [\n this.MULTIPLY_WRAPPER_OPEN,\n this.MULTIPLY_WRAPPER_CLOSE,\n ],\n [ts.SyntaxKind.PercentToken]: [\n this.MOD_WRAPPER_OPEN,\n this.MOD_WRAPPER_CLOSE,\n ],\n [ts.SyntaxKind.SlashToken]: [\n this.DIVIDE_WRAPPER_OPEN,\n this.DIVIDE_WRAPPER_CLOSE,\n ],\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.escapedText);\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.escapedText;\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 // 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 === ts.SyntaxKind.NewExpression;\n const isInsideCatch =\n node?.parent?.kind === ts.SyntaxKind.ThrowStatement;\n const isLeftSide =\n node?.parent?.name === node || node?.parent?.left === node;\n const isCallOrPropertyAccess =\n node?.parent?.kind === ts.SyntaxKind.PropertyAccessExpression ||\n node?.parent?.kind === ts.SyntaxKind.ElementAccessExpression;\n if (!isLeftSide && !isCallOrPropertyAccess && !isInsideCatch && !isInsideNewExpression) {\n const type = this.getChecker().getTypeAtLocation(node);\n const typeSymbol = type?.symbol;\n if (typeSymbol !== undefined) {\n const decl = typeSymbol?.declarations ?? [];\n let isBuiltIn = undefined;\n if (decl.length > 0) {\n isBuiltIn =\n decl[0].getSourceFile().fileName.indexOf(\"typescript\") > -1;\n }\n\n if (isBuiltIn !== undefined && !isBuiltIn) {\n const symbol = this.getChecker().getSymbolAtLocation(node);\n let isClassDeclaration = false;\n if (symbol) {\n const first = symbol.declarations[0];\n if (first.kind === ts.SyntaxKind.ClassDeclaration) {\n isClassDeclaration = true;\n }\n if (first.kind === ts.SyntaxKind.ImportSpecifier) {\n const importedSymbol = this.getChecker().getAliasedSymbol(symbol);\n if (\n importedSymbol?.declarations[0]?.kind ===\n ts.SyntaxKind.ClassDeclaration\n ) {\n isClassDeclaration = true;\n }\n }\n }\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 if (ts.isExpressionStatement(statement)) {\n const expression = statement.expression;\n if (ts.isCallExpression(expression)) {\n const expressionText = expression.expression.getText().trim();\n if (expressionText === \"super\") {\n hasSuperCall = true;\n superCallParams = expression.arguments\n .map((a) => {\n return this.printNode(a, identation).trim();\n })\n .join(\", \");\n }\n }\n }\n });\n\n const header =\n this.getIden(identation) + className + \"(\" + args + \")\";\n if (!hasSuperCall) {\n return header + constructorBody;\n }\n // In Java, super(...) must be the first statement inside the body.\n const injected = this.injectLeadingInBody(constructorBody, `super(${superCallParams});`);\n return header + injected;\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 === ts.SyntaxKind.ElementAccessExpression) {\n const parsedArg =\n node.arguments?.length > 0\n ? node.arguments\n .map((n) => this.printNode(n, identation).trimStart())\n .join(\", \")\n : \"\";\n const target = this.printNode(elementAccess.expression, 0);\n const propName = this.printNode(elementAccess.argumentExpression, 0);\n const argsArray = `new Object[] { ${parsedArg} }`;\n const open = this.DYNAMIC_CALL_OPEN;\n return `${open}${target}, ${propName}, ${argsArray})`;\n }\n return undefined;\n }\n\n getExpressionStatementPrefixesIfAny(node, identation) {\n // return undefined;\n const finalVars = [];\n if (node.expression?.kind === ts.SyntaxKind.CallExpression) {\n const objectLiterals = this.getObjectLiteralFromCallExpressionArguments(node.expression);\n for (let i = 0; i < objectLiterals.length; i++) {\n const objLiteral = objectLiterals[i];\n const objVariables = this.getVarListFromObjectLiteralAndUpdateInPlace(objLiteral);\n if (objVariables.length > 0) {\n finalVars.push(...objVariables);\n }\n }\n\n if (finalVars.length > 0) {\n const decls = this.buildFinalVarDeclarations(finalVars, identation);\n if (decls) {\n return decls + \"\\n\" + this.getIden(identation);\n }\n }\n }\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 let parsedArguments = node.arguments\n ?.map((a) => this.printNode(a, 0))\n .join(\", \");\n parsedArguments = parsedArguments ? parsedArguments : \"\";\n const propName = node.expression?.name.escapedText;\n const isAsyncDecl = node?.parent?.kind === ts.SyntaxKind.AwaitExpression;\n const argsArray = `new Object[] { ${parsedArguments} }`;\n const open = this.DYNAMIC_CALL_OPEN;\n const statement = `${open}this, \"${propName}\", ${argsArray})`;\n // If your Java runtime returns CompletableFuture, you can await it where appropriate.\n return statement;\n }\n return undefined;\n }\n\n printOutOfOrderCallExpressionIfAny(node, identation) {\n if (node.expression.kind === ts.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(Helpers.toString(${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 `Helpers.mathMin(${parsedArg1}, ${parsedArg2})`;\n case \"Math.max\":\n return `Helpers.mathMax(${parsedArg1}, ${parsedArg2})`;\n case \"Math.pow\":\n return `Helpers.mathPow(Double.parseDouble(Helpers.toString(${parsedArg1})), Double.parseDouble(Helpers.toString(${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 === ts.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 === ts.SyntaxKind.ExclamationEqualsEqualsToken ||\n op === ts.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 (ts.isMethodDeclaration(current) || ts.isFunctionDeclaration(current)) {\n return String((current.name as any)?.escapedText ?? '');\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 (ts.isClassDeclaration(current)) {\n return String((current.name as any)?.escapedText ?? '');\n }\n current = current.parent;\n }\n return '';\n }\n\n getVarKey(node) {\n\n const varName = node?.escapedText ?? node?.name?.escapedText;\n if (!varName) {\n return '';\n }\n return `${this.getVarClassIfAny(node)}-${this.getVarMethodIfAny(node)}-${varName}`;\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 === ts.SyntaxKind.Identifier) {\n this.ReassignedVars[this.getVarKey(left)] = true;\n }\n\n if (left.kind === ts.SyntaxKind.TypeOfExpression) {\n const typeOfExpression = this.handleTypeOfInsideBinaryExpression(\n node,\n identation\n );\n if (typeOfExpression) return typeOfExpression;\n }\n\n // destructuring: [a,b] = this.method()\n if (\n op === ts.SyntaxKind.EqualsToken &&\n left.kind === ts.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 const statement =\n this.getIden(identation) +\n `${e} = ((java.util.List) ${syntheticName}).get(${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 // setter for element-access assignments: a[b] = v\n // ---------------------------------------------------------------\n if (op === ts.SyntaxKind.EqualsToken &&\n left.kind === ts.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 (ts.isElementAccessExpression(cur)) {\n keys.unshift(cur.argumentExpression); // prepend\n const expr = cur.expression;\n if (!ts.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.\n let acc = containerStr;\n for (let i = 0; i < keyStrs.length - 1; i++) {\n acc = `${this.ELEMENT_ACCESS_WRAPPER_OPEN}${acc}, ${keyStrs[i]}${this.ELEMENT_ACCESS_WRAPPER_CLOSE}`;\n }\n\n let prefixes = this.getBinaryExpressionPrefixes(node, identation);\n prefixes = prefixes ? prefixes : \"\";\n\n\n const lastKey = keyStrs[keyStrs.length - 1];\n const rhs = this.printNode(right, 0);\n\n\n\n return `${prefixes}Helpers.addElementToObject(${acc}, ${lastKey}, ${rhs})`;\n }\n\n if (op === ts.SyntaxKind.InKeyword) {\n return `Helpers.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 === ts.SyntaxKind.PlusEqualsToken || op === ts.SyntaxKind.MinusEqualsToken || op in this.binaryExpressionsWrappers) {\n const leftText = this.printNode(left, 0);\n const rightText = this.printNode(right, 0);\n\n if (op === ts.SyntaxKind.PlusEqualsToken) {\n return `${leftText} = Helpers.add(${leftText}, ${rightText})`;\n }\n\n if (op === ts.SyntaxKind.MinusEqualsToken) {\n return `${leftText} = Helpers.subtract(${leftText}, ${rightText})`;\n }\n\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\n getObjectLiteralFromCallExpressionArguments(node) {\n const res = [];\n if (!node?.arguments) {\n return res;\n }\n const args = node.arguments;\n\n for (let i = 0; i < args.length; i++) {\n const arg = args[i];\n if (arg.kind === ts.SyntaxKind.ObjectLiteralExpression) {\n res.push(arg);\n } else if (arg.kind === ts.SyntaxKind.CallExpression) {\n const innerCallExp = arg;\n const innerObjLiterals = this.getObjectLiteralFromCallExpressionArguments(innerCallExp);\n res.push(...innerObjLiterals);\n }\n }\n return res;\n }\n\n // Finds every ObjectLiteralExpression nested anywhere inside an RHS/initializer\n // expression that would produce an anonymous-inner-class capture in Java\n // (HashMap double-brace init). Stops descending at each ObjectLiteralExpression\n // because nested literals are walked recursively inside\n // getVarListFromObjectLiteralAndUpdateInPlace. Skips function/arrow bodies so\n // we don't capture literals that evaluate in a different scope.\n //\n // Unifies the previously-narrow matching in printVariableDeclarationList and\n // getBinaryExpressionPrefixes which only handled ObjectLiteralExpression or\n // CallExpression directly — missing wrappers like AwaitExpression,\n // ParenthesizedExpression, NewExpression, and ConditionalExpression.\n collectCapturingObjectLiterals(node): any[] {\n const found = [];\n const walk = (n) => {\n if (!n) return;\n if (n.kind === ts.SyntaxKind.ObjectLiteralExpression) {\n found.push(n);\n return;\n }\n if (n.kind === ts.SyntaxKind.FunctionExpression ||\n n.kind === ts.SyntaxKind.ArrowFunction ||\n n.kind === ts.SyntaxKind.MethodDeclaration ||\n n.kind === ts.SyntaxKind.FunctionDeclaration) {\n return;\n }\n ts.forEachChild(n, walk);\n };\n walk(node);\n return found;\n }\n\n getBinaryExpressionPrefixes(node, identation) {\n let right = node?.right;\n if (right?.kind === ts.SyntaxKind.AwaitExpression) {\n // un pack await this.x() to this.x(), we don't care about await here\n right = right.expression;\n }\n if (!right) {\n return undefined;\n }\n if (right.kind === ts.SyntaxKind.ObjectLiteralExpression) {\n const objVariables = this.getVarListFromObjectLiteralAndUpdateInPlace(right);\n if (objVariables.length > 0) {\n const decls = this.buildFinalVarDeclarations(objVariables, identation);\n if (decls) {\n return decls + \"\\n\" + this.getIden(identation);\n }\n }\n } else if (right.kind === ts.SyntaxKind.CallExpression) {\n // search arguments recursively for object literals\n // eg: a[x] = this.extend(this.extend(this.extend({'a':b}, c)))\n const objectLiterals = this.getObjectLiteralFromCallExpressionArguments(right);\n if (objectLiterals.length > 0) {\n const allVars = [];\n for (let i = 0; i < objectLiterals.length; i++) {\n const objLiteral = objectLiterals[i];\n const objVariables = this.getVarListFromObjectLiteralAndUpdateInPlace(objLiteral);\n allVars.push(...objVariables);\n }\n if (allVars.length > 0) {\n const decls = this.buildFinalVarDeclarations(allVars, identation);\n if (decls) {\n return decls + \"\\n\" + this.getIden(identation);\n }\n }\n }\n }\n return undefined;\n }\n\n getFinalVarName(varName: string): string {\n if (this.ReservedKeywordsReplacements[varName]) {\n varName = this.ReservedKeywordsReplacements[varName];\n }\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: ts.SyntaxKind): boolean {\n return op === ts.SyntaxKind.EqualsToken ||\n op === ts.SyntaxKind.PlusEqualsToken ||\n op === ts.SyntaxKind.MinusEqualsToken ||\n op === ts.SyntaxKind.AsteriskEqualsToken ||\n op === ts.SyntaxKind.AsteriskAsteriskEqualsToken ||\n op === ts.SyntaxKind.SlashEqualsToken ||\n op === ts.SyntaxKind.PercentEqualsToken ||\n op === ts.SyntaxKind.LessThanLessThanEqualsToken ||\n op === ts.SyntaxKind.GreaterThanGreaterThanEqualsToken ||\n op === ts.SyntaxKind.GreaterThanGreaterThanGreaterThanEqualsToken ||\n op === ts.SyntaxKind.AmpersandEqualsToken ||\n op === ts.SyntaxKind.BarEqualsToken ||\n op === ts.SyntaxKind.CaretEqualsToken ||\n op === ts.SyntaxKind.BarBarEqualsToken ||\n op === ts.SyntaxKind.AmpersandAmpersandEqualsToken ||\n op === ts.SyntaxKind.QuestionQuestionEqualsToken;\n }\n\n private isIncDecOperator(op: ts.SyntaxKind): boolean {\n return op === ts.SyntaxKind.PlusPlusToken || op === ts.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: ts.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] ?? sym?.valueDeclaration;\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.escapedText}`;\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 === ts.SyntaxKind.BinaryExpression) {\n if (node.left?.kind === ts.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 === ts.SyntaxKind.EqualsToken &&\n node.left?.kind === ts.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 === ts.SyntaxKind.Identifier) {\n reassignedSyms.add(symbolIdOf(elem));\n }\n }\n }\n }\n if ((node.kind === ts.SyntaxKind.PrefixUnaryExpression ||\n node.kind === ts.SyntaxKind.PostfixUnaryExpression) &&\n this.isIncDecOperator(node.operator) &&\n node.operand?.kind === ts.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 === ts.SyntaxKind.Identifier) {\n const name = node.escapedText 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 ts.forEachChild(node, 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: ts.Node };\n const events: Event[] = [];\n\n const visitExprInObjLit = (n: any) => {\n if (!n) return;\n if (n.kind === ts.SyntaxKind.Identifier) {\n const name = n.escapedText 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 === ts.SyntaxKind.BinaryExpression) {\n visitExprInObjLit(n.left);\n visitExprInObjLit(n.right);\n return;\n }\n if (n.kind === ts.SyntaxKind.ParenthesizedExpression) {\n visitExprInObjLit(n.expression);\n return;\n }\n if (n.kind === ts.SyntaxKind.ConditionalExpression) {\n visitExprInObjLit(n.condition);\n visitExprInObjLit(n.whenTrue);\n visitExprInObjLit(n.whenFalse);\n return;\n }\n if (n.kind === ts.SyntaxKind.CallExpression) {\n n.arguments?.forEach(visitExprInObjLit);\n if (n.expression?.kind === ts.SyntaxKind.PropertyAccessExpression) {\n visitExprInObjLit(n.expression.expression);\n }\n return;\n }\n if (n.kind === ts.SyntaxKind.PrefixUnaryExpression) {\n visitExprInObjLit(n.operand);\n return;\n }\n if (n.kind === ts.SyntaxKind.ElementAccessExpression) {\n let left = n.expression;\n while (left?.kind === ts.SyntaxKind.ElementAccessExpression) {\n left = left.expression;\n }\n visitExprInObjLit(left);\n visitExprInObjLit(n.argumentExpression);\n return;\n }\n if (n.kind === ts.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 ts.forEachChild(n, visitExprInObjLit);\n };\n\n const walk = (node: any) => {\n if (!node) return;\n\n if (node.kind === ts.SyntaxKind.BinaryExpression &&\n this.isAssignmentOperator(node.operatorToken.kind)) {\n walk(node.right);\n if (node.left?.kind === ts.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 === ts.SyntaxKind.PrefixUnaryExpression ||\n node.kind === ts.SyntaxKind.PostfixUnaryExpression) &&\n this.isIncDecOperator(node.operator) &&\n node.operand?.kind === ts.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 === ts.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: ts.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 === ts.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 === ts.SyntaxKind.TryStatement) {\n walkBlockAndBump(node.tryBlock);\n walkBlockAndBump(node.catchClause?.block);\n walkBlockAndBump(node.finallyBlock);\n return;\n }\n\n ts.forEachChild(node, 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 if (versions.length === 1) {\n for (const n of byVer.get(versions[0])!) {\n this.usageToFinalName.set(n, baseName);\n }\n } else {\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\n private finalNameInAncestorScope(finalName: string): boolean {\n for (const scope of this.finalVarScopeStack) {\n if (scope.has(finalName)) return true;\n }\n return false;\n }\n\n buildFinalVarDeclarations(pairs: Array<{ orig: string; final: string }>, identation: number): string {\n if (pairs.length === 0) return '';\n const current = this.finalVarScopeStack.length > 0\n ? this.finalVarScopeStack[this.finalVarScopeStack.length - 1]\n : null;\n const lines: string[] = [];\n const seenHere = new Set();\n for (const p of pairs) {\n if (seenHere.has(p.final)) continue;\n if (this.finalNameInAncestorScope(p.final)) continue;\n seenHere.add(p.final);\n if (current) current.add(p.final);\n const indent = lines.length === 0 ? 0 : identation;\n // The RHS must use the remapped Java name (e.g. `params` → `parameters`,\n // `internal` → `intern`) since the original TS identifier doesn't exist\n // in the generated Java code.\n lines.push(`${this.getIden(indent)}final Object ${p.final} = ${this.getOriginalVarName(p.orig)};`);\n }\n return lines.join('\\n');\n }\n\n getObjectLiteralId(node): string {\n const start = node.getStart();\n const end = node.getEnd();\n // Qualify with the file: the offsets alone collide between two files whose\n // object literals happen to sit at the same character range.\n const fileName = node.getSourceFile?.()?.fileName ?? '';\n return `${fileName}:${start}-${end}`;\n }\n\n // Remember an identifier's pre-rewrite state so restoreFinalVarMutations can put\n // the shared AST back exactly as it was parsed.\n recordFinalVarMutation(node: any): void {\n this.finalVarMutations.push({\n node,\n escapedText: node.escapedText,\n ownGetFullText: Object.prototype.hasOwnProperty.call(node, 'getFullText'),\n getFullText: node.getFullText,\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 mutation.node.escapedText = mutation.escapedText;\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 === ts.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 createNewNodeForFinalVar(originalName: string): ts.Identifier {\n const newNode = ts.factory.createIdentifier(this.getFinalVarName(originalName));\n newNode.getFullText = () => this.getFinalVarName(originalName);\n return newNode;\n }\n\n getVarListFromObjectLiteralAndUpdateInPlace(node): Array<{ orig: string; final: string }> {\n // in java if we use an anonymous object literal put, we can't refer non final variables\n // so here we collect them and then we add the wrapper final variables, eg: finalX = X;\n // and we update the node in place to use finalX instead of X.\n // The final name comes from analyzeFinalVars (pre-walk), which assigns\n // version-aware names so reassignment-between-usages produces distinct finals.\n let res: Array<{ orig: string; final: string }> = [];\n\n const nodeId = this.getObjectLiteralId(node);\n\n if (nodeId in this.varListFromObjectLiterals) {\n return this.varListFromObjectLiterals[nodeId];\n }\n\n const finalNameFor = (n: any, origName: string): string => {\n return this.usageToFinalName.get(n) ?? this.getFinalVarName(origName);\n };\n\n // Walks any expression, rewriting reassigned-var Identifiers to their\n // finalXxx names in place. We rely on ts.forEachChild for traversal so\n // every node kind (PrefixUnary, PostfixUnary, ElementAccess,\n // PropertyAccess, BinaryExpression, ConditionalExpression, CallExpression,\n // ParenthesizedExpression, etc.) is covered uniformly. ObjectLiteral is\n // delegated back to the parent function so per-objectLiteral nodeId\n // dedup applies to nested literals too.\n const traverseAndReplace = (n) => {\n if (!n) return;\n if (n.kind === ts.SyntaxKind.Identifier) {\n const name = n.escapedText as string | undefined;\n if (name && name !== 'undefined' && !name.startsWith('null')) {\n // Prefer analyzeFinalVars' pre-walk result (usageToFinalName):\n // it knows about reassignments anywhere in the function body,\n // including ones that happen AFTER this object literal in\n // source order. ReassignedVars is populated as BinaryExpressions\n // are printed, so for a forward reference it is still false at\n // this point and would miss the shadow.\n const isReassignedAhead = this.usageToFinalName.has(n);\n if (isReassignedAhead || this.ReassignedVars[this.getVarKey(n)]) {\n const finalName = finalNameFor(n, name);\n res.push({ orig: name, final: finalName });\n this.recordFinalVarMutation(n);\n n.escapedText = finalName;\n // Some downstream print paths read from getFullText (which\n // reflects the source text, not escapedText) — shim it so\n // they see the rewritten name.\n (n as any).getFullText = () => finalName;\n }\n }\n return;\n }\n if (n.kind === ts.SyntaxKind.ObjectLiteralExpression) {\n const innerVars = this.getVarListFromObjectLiteralAndUpdateInPlace(n);\n res = res.concat(innerVars);\n return;\n }\n ts.forEachChild(n, traverseAndReplace);\n };\n\n node.properties.forEach( (prop) => {\n if (!prop.initializer) return;\n traverseAndReplace(prop.initializer);\n });\n\n // dedup on (orig|final) pair\n const seen = new Set();\n const dedup: Array<{ orig: string; final: string }> = [];\n for (const p of res) {\n const key = `${p.orig}|${p.final}`;\n if (seen.has(key)) continue;\n seen.add(key);\n dedup.push(p);\n }\n this.varListFromObjectLiterals[nodeId] = dedup;\n return dedup;\n }\n\n printVariableDeclarationList(node, identation) {\n const declaration = node.declarations[0];\n\n let finalVars = '';\n if (declaration.initializer) {\n // Walk the whole initializer tree — handles AwaitExpression,\n // ParenthesizedExpression, NewExpression, ConditionalExpression,\n // nested CallExpressions, etc. uniformly.\n const objLiterals = this.collectCapturingObjectLiterals(declaration.initializer);\n let varObj = [];\n for (const lit of objLiterals) {\n const vars = this.getVarListFromObjectLiteralAndUpdateInPlace(lit);\n varObj = varObj.concat(vars);\n }\n if (varObj.length > 0) {\n finalVars = this.buildFinalVarDeclarations(varObj, identation);\n }\n }\n\n if (\n this.removeVariableDeclarationForFunctionExpression &&\n declaration?.initializer &&\n ts.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 === ts.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 let arrayBindingStatement =\n `${this.getIden(identation)}var ${syntheticName} = ${this.printNode(\n declaration.initializer,\n 0\n )};\\n`;\n\n parsedArrayBindingElements.forEach((e, index) => {\n const statement =\n this.getIden(identation) +\n `var ${e} = ((java.util.List) ${syntheticName}).get(${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 const isNew =\n declaration?.initializer &&\n declaration.initializer.kind === ts.SyntaxKind.NewExpression;\n const varToken = isNew ? \"var \" : this.VAR_TOKEN + \" \";\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 finalVars = finalVars.length > 0 ? this.getIden(identation) + finalVars + \"\\n\" : finalVars;\n return (\n finalVars +\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 === ts.SyntaxKind.PropertyAssignment) {\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.escapedText;\n\n let rawExpression = undefined;\n\n switch (rightSide) {\n case \"length\": {\n const type = (this.getChecker() as TypeChecker).getTypeAtLocation(\n expression\n );\n this.warnIfAnyType(node, (type as any).flags, leftSide, \"length\");\n rawExpression = this.isStringType((type as any).flags)\n ? `((String)${leftSide}).length()`\n : `${this.ARRAY_LENGTH_WRAPPER_OPEN}${leftSide}${this.ARRAY_LENGTH_WRAPPER_CLOSE}`;\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 ts.isArrayLiteralExpression(node) ||\n ts.isObjectLiteralExpression(node) ||\n ts.isStringLiteral(node) ||\n (ts as any).isBooleanLiteral(node)\n ) {\n return this.UNDEFINED_TOKEN;\n }\n\n if (ts.isNumericLiteral(node)) {\n return this.UNDEFINED_TOKEN;\n }\n\n if (\n node?.escapedText === \"undefined\" &&\n this.getChecker().getTypeAtLocation(node?.parent)?.flags ===\n ts.TypeFlags.Number\n ) {\n return this.UNDEFINED_TOKEN;\n }\n\n return undefined;\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 const initParams = [];\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 const index = i + offSetIndex;\n // index = index < 0 ? 0 : i - 1;\n const paramName = this.printNode(param.name, 0);\n initParams.push(`Object ${paramName} = Helpers.getArg(optionalArgs, ${index}, ${this.printNode(initializer, 0)});`);\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) {\n const finalWrapperVars = this.printFinalOutsideMethodVariableWrappersIfAny(node, identation) + \"\\n\";\n const insideWrappers = 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 && (ts.isReturnStatement(lastStatement) || this.allBranchesTerminate(lastStatement));\n const returnNull = lastStmtIsReturn ? \"\" : (this.getIden(identation + 2) + \"return null;\\n\");\n const asyncBody = this.getIden(identation + 1) + \"return java.util.concurrent.CompletableFuture.supplyAsync(() -> {\\n\" +\n insideWrappers +\n body + \"\\n\" +\n returnNull +\n this.getIden(identation + 1) + \"});\\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.escapedText;\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 === ts.SyntaxKind.AnyKeyword) {\n return `((${this.VariableTypeReplacements['object']})${this.printNode(\n node.expression,\n identation\n )})`;\n }\n\n if (type.kind === ts.SyntaxKind.StringKeyword) {\n return `((String)${this.printNode(node.expression, identation)})`;\n }\n\n if (type.kind === ts.SyntaxKind.ArrayType) {\n if (type.elementType.kind === ts.SyntaxKind.AnyKeyword) {\n return `(java.util.List)(${this.printNode(\n node.expression,\n identation\n )})`;\n }\n if (type.elementType.kind === ts.SyntaxKind.StringKeyword) {\n return `(java.util.List)(${this.printNode(\n node.expression,\n identation\n )})`;\n }\n }\n\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 let type = this.printParameterType(node) || \"\";\n\n if (defaultValue) {\n if (initializer) {\n const customDefaultValue =\n this.printCustomDefaultValueIfNeeded(initializer);\n const def = customDefaultValue\n ? customDefaultValue\n : this.printNode(initializer, 0);\n type = def === \"null\" && type !== \"Object\" ? type + \" \" : type + \" \";\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 printMethodParameters(node) {\n const isAsyncMethod = this.isAsyncFunction(node);\n const params = node.parameters.map(param => {\n const isReassignedVar = this.ReassignedVars[this.getVarKey(param)];\n let printedParam = this.printParameter(param);\n if (isAsyncMethod && isReassignedVar) {\n const paramName = param.name.escapedText;\n const { localName, sigName } = this.getAsyncParamWrapperNames(paramName);\n // Replace the printed Java name (post keyword-remap) with sigName so\n // the original name is freed for the lambda body to bind.\n printedParam = printedParam.replace(localName, sigName);\n }\n return printedParam;\n });\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 const parameters = node?.parameters;\n const finalVarWrappers = [];\n\n if (parameters) {\n const isAsyncMethod = this.isAsyncFunction(node);\n parameters.forEach(param => {\n const isOptionalParam = param.initializer !== undefined || param.questionToken !== undefined;\n if (!isOptionalParam) {\n const isReassignedVar = this.ReassignedVars[this.getVarKey(param)];\n if (isAsyncMethod && isReassignedVar) {\n const paramName = param.name.escapedText;\n const { sigName, snapName } = this.getAsyncParamWrapperNames(paramName);\n finalVarWrappers.push(this.getIden(identation + 1) + `final Object ${snapName} = ${sigName};`);\n }\n }\n\n });\n }\n return finalVarWrappers.join(\"\\n\");\n }\n\n printInsideMethodVariableWrappersIfAny(node, identation) {\n const parameters = node?.parameters;\n const finalVarWrappers = [];\n\n if (parameters) {\n const isAsyncMethod = this.isAsyncFunction(node);\n parameters.forEach(param => {\n const isOptionalParam = param.initializer !== undefined || param.questionToken !== undefined;\n if (!isOptionalParam) {\n const isReassignedVar = this.ReassignedVars[this.getVarKey(param)];\n if (isAsyncMethod && isReassignedVar) {\n const paramName = param.name.escapedText;\n const { localName, snapName } = this.getAsyncParamWrapperNames(paramName);\n finalVarWrappers.push(this.getIden(identation + 1) + `Object ${localName} = ${snapName};`);\n }\n }\n\n });\n }\n return finalVarWrappers.join(\"\\n\");\n }\n\n printMethodDeclaration(node, identation) {\n\n\n const funcBody = this.printFunctionBody(node, identation); // print body first to get var reassignments filled\n\n let methodDef = this.printMethodDefinition(node, identation);\n\n methodDef += funcBody;\n\n return methodDef;\n }\n\n printMethodDefinition(node, identation) {\n let name = node.name.escapedText;\n name = this.transformMethodNameIfNeeded(name);\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 // let modifiers = this.printModifiers(node);\n const defaultAccess = this.METHOD_DEFAULT_ACCESS ? this.METHOD_DEFAULT_ACCESS + \" \" : \"\";\n const modifiers = defaultAccess;\n // modifiers = modifiers ? modifiers + \" \" : defaultAccess;\n // modifiers =\n // modifiers.indexOf(\"public\") === -1 &&\n // modifiers.indexOf(\"private\") === -1 &&\n // modifiers.indexOf(\"protected\") === -1\n // ? defaultAccess + modifiers\n // : modifiers;\n\n let parsedArgs = undefined;\n\n // const methodOverride = (this.getMethodOverride(node) as any);\n // const isOverride = methodOverride !== undefined;\n\n // if (isOverride && (returnType === \"Object\" || returnType === \"java.util.concurrent.CompletableFuture\")) {\n // returnType = this.printFunctionType(methodOverride);\n // }\n\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 // const currentArgs = node.parameters;\n // const parentArgs = methodOverride.parameters;\n // parsedArgs = \"\";\n // parentArgs.forEach((param, index) => {\n // const originalName = this.printNode(currentArgs[index].name, 0);\n // const parsedArg = this.printParameteCustomName(param, originalName);\n // parsedArgs += parsedArg;\n // if (index < parentArgs.length - 1) {\n // parsedArgs += \", \";\n // }\n // });\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 signature =\n this.getIden(identation) +\n modifiers +\n returnType +\n methodToken +\n name +\n \"(\" +\n parsedArgs +\n \")\";\n\n return this.printNodeCommentsIfAny(node, identation, signature);\n }\n\n // Route through Helpers so consumers control semantics (thread-safety,\n // null-handling, type coercion) in one place — same pattern as\n // Helpers.add / Helpers.isEqual / Helpers.GetValue / Helpers.json. The\n // previous inline emits (`x instanceof java.util.List`, `((Map)x).keySet()`)\n // forced any downstream that needed different semantics (e.g. synchronized\n // map access in concurrent code) to post-process the generated Java with\n // regex — which only catches the bare-identifier argument shape and misses\n // property-access (`this.x`) and element-access (`obj[k]`) arguments.\n printArrayIsArrayCall(_node, _identation, parsedArg = undefined) {\n return `Helpers.isArray(${parsedArg})`;\n }\n\n printObjectKeysCall(_node, _identation, parsedArg = undefined) {\n return `Helpers.objectKeys(${parsedArg})`;\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 printPromiseAllCall(_node, _identation, parsedArg = undefined) {\n return `Helpers.promiseAll(${parsedArg})`;\n }\n\n printMathFloorCall(_node, _identation, parsedArg = undefined) {\n return `(Math.floor(Double.parseDouble(Helpers.toString(${parsedArg}))))`;\n }\n\n printMathRoundCall(_node, _identation, parsedArg = undefined) {\n return `Math.round(Double.parseDouble(Helpers.toString(${parsedArg})))`;\n }\n\n printMathCeilCall(_node, _identation, parsedArg = undefined) {\n return `Math.ceil(Double.parseDouble(Helpers.toString(${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 printIndexOfCall(_node, _identation, name = undefined, parsedArg = undefined) {\n return `${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 `new java.util.ArrayList(java.util.Arrays.asList(((String)${name}).split((String)${parsedArg})))`;\n return `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 if (parsedArg2 === undefined) {\n parsedArg2 = \"null\";\n }\n return `Helpers.slice(${name}, ${parsedArg}, ${parsedArg2})`;\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 return `Helpers.replaceAll((String)${name}, (String)${parsedArg}, (String)${parsedArg2})`;\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 `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 TypeChecker).getTypeAtLocation(node.expression);\n this.warnIfAnyType(node, (type as any).flags, leftSide, \"length\");\n return this.isStringType((type as any).flags)\n ? `((String)${leftSide}).length()`\n : `${this.ARRAY_LENGTH_WRAPPER_OPEN}${leftSide}${this.ARRAY_LENGTH_WRAPPER_CLOSE}`;\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 const op = this.PostFixOperators[operator];\n if (op === \"--\") {\n return `${leftSide}--`;\n }\n return `${leftSide}++`;\n }\n\n printPrefixUnaryExpression(node, identation) {\n const { operand, operator } = node;\n if (operator === ts.SyntaxKind.ExclamationToken) {\n return this.PrefixFixOperators[operator] + this.printCondition(node.operand, 0);\n }\n const leftSide = this.printNode(operand, 0);\n if (operator === ts.SyntaxKind.PlusToken) {\n return `+(${leftSide})`;\n } else if (operator === ts.SyntaxKind.MinusToken) {\n return `Helpers.opNeg(${leftSide})`;\n }\n return super.printPrefixUnaryExpression(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 === ts.SyntaxKind.Identifier) {\n return (\n this.getIden(identation) +\n this.THROW_TOKEN +\n \" \" +\n this.printNode(node.expression, 0) +\n this.LINE_TERMINATOR\n );\n }\n if (node.expression.kind === ts.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 === ts.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.escapedText === \"Error\" ? \"RuntimeException\" : id.escapedText;\n const symbol = this.getChecker().getSymbolAtLocation(expression.expression);\n if (symbol) {\n const declarations =\n this.getChecker().getDeclaredTypeOfSymbol(symbol).symbol?.declarations ?? [];\n const isClassDeclaration = declarations.find(\n (l) =>\n l.kind === ts.SyntaxKind.InterfaceDeclaration ||\n l.kind === ts.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 === ts.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 === ts.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]);\n modifiers = modifiers.filter(mod => mod.kind !== ts.SyntaxKind.AsyncKeyword);\n const res = modifiers.map(modifier => this.FuncModifiers[modifier.kind]).join(\" \");\n\n return res;\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 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 === ts.SyntaxKind.AsExpression && (exp.expression.kind === ts.SyntaxKind.ObjectLiteralExpression || ts.SyntaxKind.CallExpression)) {\n exp = exp.expression; // go over something like return {} as SomeType\n }\n // Use collectCapturingObjectLiterals to walk through every wrapper\n // (AwaitExpression, ParenthesizedExpression, CallExpression args, ArrayLiteral\n // elements, ConditionalExpression branches, NewExpression args, etc.) and\n // pick up every HashMap literal whose anonymous-inner-class body would\n // need effectively-final captures. The previous narrow switch missed\n // `return await this.watch(..., { literal capturing reassigned var }, ...)`\n // entirely — the literal ended up referencing the raw (reassigned)\n // identifier with no snapshot, which javac rejects.\n const allVarNames = [];\n if (exp) {\n const objLiterals = this.collectCapturingObjectLiterals(exp);\n for (const objLiteral of objLiterals) {\n const varsList = this.getVarListFromObjectLiteralAndUpdateInPlace(objLiteral);\n allVarNames.push(...varsList);\n }\n }\n let finalVars = allVarNames.length > 0 ? this.buildFinalVarDeclarations(allVarNames, identation) : '';\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 (ts.isFunctionDeclaration(parent) || ts.isMethodDeclaration(parent) || ts.isFunctionExpression(parent) || ts.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 finalVars = finalVars.length > 0 ? this.getIden(identation) + finalVars + \"\\n\" : finalVars;\n return leadingComment + finalVars + this.getIden(identation) + this.RETURN_TOKEN + rightPart + trailingComment;\n }\n\n private allBranchesTerminate(node: ts.Node): boolean {\n if (ts.isReturnStatement(node) || ts.isThrowStatement(node)) {\n return true;\n }\n if (ts.isBlock(node)) {\n const stmts = node.statements;\n return stmts.length > 0 && this.allBranchesTerminate(stmts[stmts.length - 1]);\n }\n if (ts.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 ts from 'typescript';\n\nconst SyntaxKind = ts.SyntaxKind;\n\nconst parserConfig = {\n 'ELSEIF_TOKEN': 'else if',\n 'OBJECT_OPENING': '{',\n 'OBJECT_CLOSING': '}',\n 'ARRAY_OPENING_TOKEN': 'Value::List(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\nexport class RustTranspiler extends BaseTranspiler {\n\n binaryExpressionsWrappers;\n methodSignatures: Record;\n forLoopCounter: number;\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 capitalize(str: string) {\n return str[0].toUpperCase() + str.slice(1);\n }\n\n printStringLiteral(node) {\n let text = node.text;\n if (text in this.StringLiteralReplacements) {\n return this.StringLiteralReplacements[text];\n }\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 `Value::Str(\"${text}\".to_string())`;\n }\n\n printNumericLiteral(node) {\n const text = node.text;\n if (text.includes('.')) {\n return `Value::Float(${text})`;\n }\n return `Value::Int(${text})`;\n }\n\n printBooleanLiteral(node) {\n if (ts.SyntaxKind.TrueKeyword === node.kind) {\n return 'Value::Bool(true)';\n }\n return 'Value::Bool(false)';\n }\n\n printNullKeyword(node, identation) {\n return 'Value::Null';\n }\n\n // Ensure a & ref prefix — skip only if already a reference\n ensureRef(expr: string): string {\n if (expr.startsWith('&')) {\n return expr;\n }\n return `&${expr}`;\n }\n\n printCustomBinaryExpressionIfAny(node, identation) {\n const left = node.left;\n const right = node.right;\n const op = node.operatorToken.kind;\n\n // Handle array destructuring reassignment: [a, b] = expr → bind once, reassign each\n if (op === SyntaxKind.EqualsToken && left.kind === SyntaxKind.ArrayLiteralExpression) {\n const elements = left.elements;\n const rhs = this.printNode(right, 0);\n const tmpName = '__destr_tmp';\n const assignments = elements.map((e, idx) => {\n const target = this.printNode(e, 0);\n return `${target} = get_value(&${tmpName}, &Value::Int(${idx}))`;\n }).join('; ');\n return `{ let ${tmpName} = ${rhs}; ${assignments}; }`;\n }\n\n // Handle element access assignment: a[b] = v → add_element_to_object(&mut a, &b, v)\n if (op === SyntaxKind.EqualsToken && left.kind === SyntaxKind.ElementAccessExpression) {\n const keys: any[] = [];\n let baseExpr: any = null;\n let cur: any = left;\n while (ts.isElementAccessExpression(cur)) {\n keys.unshift(cur.argumentExpression);\n const expr = cur.expression;\n if (!ts.isElementAccessExpression(expr)) {\n baseExpr = expr;\n break;\n }\n cur = expr;\n }\n const containerStr = this.printNode(baseExpr, 0);\n const keyStrs = keys.map(k => this.printNode(k, 0));\n let acc = `&mut ${containerStr}`;\n for (let i = 0; i < keyStrs.length - 1; i++) {\n acc = `get_value_mut(${acc}, &${keyStrs[i]})`;\n }\n const lastKey = keyStrs[keyStrs.length - 1];\n const rhs = this.printNode(right, 0);\n return `add_element_to_object(${acc}, &${lastKey}, ${rhs})`;\n }\n\n // Handle typeof comparisons\n if (left.kind === SyntaxKind.TypeOfExpression) {\n const expression = left.expression;\n const rightText = right.text;\n const target = this.printNode(expression, 0);\n const isDiff = op === SyntaxKind.ExclamationEqualsEqualsToken || op === SyntaxKind.ExclamationEqualsToken;\n const not = isDiff ? '!' : '';\n switch (rightText) {\n case 'string': return `${not}is_string(&${target})`;\n case 'number': return `${not}is_number(&${target})`;\n case 'boolean': return `${not}is_bool(&${target})`;\n case 'object': return `${not}is_object(&${target})`;\n case 'function': return `${not}is_function(&${target})`;\n }\n }\n\n // Handle in operator — wrap as Value so it composes in any context\n if (op === SyntaxKind.InKeyword) {\n return `Value::Bool(in_op(&${this.printNode(right, 0)}, &${this.printNode(left, 0)}))`;\n }\n\n // Handle += for regular variables\n if (op === SyntaxKind.PlusEqualsToken && left.kind !== SyntaxKind.ElementAccessExpression) {\n const leftText = this.printNode(left, 0);\n const rightText = this.printNode(right, 0);\n return `${leftText} = add(&${leftText}, &${rightText})`;\n }\n\n // Handle -= for regular variables\n if (op === SyntaxKind.MinusEqualsToken && left.kind !== SyntaxKind.ElementAccessExpression) {\n const leftText = this.printNode(left, 0);\n const rightText = this.printNode(right, 0);\n return `${leftText} = subtract(&${leftText}, &${rightText})`;\n }\n\n // Binary wrapper functions (is_equal, add, etc.) - add & to both sides\n if (op in this.binaryExpressionsWrappers) {\n const [fnName, close] = this.binaryExpressionsWrappers[op];\n const leftText = this.printNode(left, 0);\n const rightText = this.printNode(right, 0);\n const leftRef = this.ensureRef(leftText);\n const rightRef = this.ensureRef(rightText);\n return `${fnName}${leftRef}, ${rightRef}${close}`;\n }\n\n return undefined;\n }\n\n printBinaryExpression(node, identation) {\n const custom = this.printCustomBinaryExpressionIfAny(node, identation);\n if (custom) {\n return custom;\n }\n return 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\n // (`pad_start` / `pad_end` take `(&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 isNew = declaration.initializer && declaration.initializer.kind === SyntaxKind.NewExpression;\n\n if (declaration?.name.kind === SyntaxKind.ArrayBindingPattern) {\n const elements = declaration.name.elements;\n const parsedElements = elements.map(e => this.printNode(e.name, 0));\n const syntheticName = parsedElements.join('') + 'Variable';\n let stmt = `${this.getIden(identation)}let mut ${syntheticName} = ${this.printNode(declaration.initializer, 0)};\\n`;\n parsedElements.forEach((e, idx) => {\n const line = `${this.getIden(identation)}let mut ${e}: Value = get_value(&${syntheticName}, &Value::Int(${idx}))`;\n stmt += idx < parsedElements.length - 1 ? line + ';\\n' : line;\n });\n return stmt;\n }\n\n const varName = this.printNode(declaration.name, 0);\n\n if (!declaration.initializer) {\n return `${this.getIden(identation)}let mut ${varName}: Value = Value::Null`;\n }\n\n const parsedValue = this.printNode(declaration.initializer, identation).trim();\n\n if (isNew) {\n return `${this.getIden(identation)}let mut ${varName} = ${parsedValue}`;\n }\n\n return `${this.getIden(identation)}let mut ${varName}: Value = ${parsedValue}`;\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 const propDecls = node.members.filter(m => m.kind === SyntaxKind.PropertyDeclaration);\n return propDecls.map(p => {\n const name = this.printNode(p.name, 0);\n const init = p.initializer ? this.printNode(p.initializer, 0) : 'Value::Null';\n return { name, init };\n });\n }\n\n printStruct(node, identation) {\n const fields = this.getStructFields(node);\n const fieldLines = fields.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 fields = this.getStructFields(node);\n const fieldInits = fields.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.className = node.name.escapedText;\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 => {\n const name = (method as any).name.escapedText;\n const params = (method as any).parameters;\n const requiredCount = params.filter(p => !p.initializer && !p.questionToken).length;\n const hasOptional = params.some(p => p.initializer !== undefined || p.questionToken !== undefined);\n if (hasOptional) {\n this.methodSignatures[name] = { requiredCount };\n }\n });\n\n const struct = this.printStruct(node, identation);\n const newMethod = this.printNewMethod(node, identation);\n\n const classMethods = methods.map(m => this.printMethodDeclaration(m, identation)).join('\\n\\n');\n\n const implBlock = `\\nimpl ${this.className} {\\n${classMethods}\\n}`;\n\n return struct + newMethod + implBlock;\n }\n\n printMethodDefinition(node, identation) {\n const name = (node.name as any).escapedText;\n const params = node.parameters;\n const hasOptional = params.some(p => p.initializer !== undefined || p.questionToken !== undefined);\n\n const requiredParams = params.filter(p => !p.initializer && !p.questionToken);\n const optionalParams = params.filter(p => p.initializer !== undefined || p.questionToken !== undefined);\n\n let parsedArgs = '&self';\n if (requiredParams.length > 0) {\n const reqArgs = requiredParams.map(p => `${this.printNode(p.name, 0)}: Value`).join(', ');\n parsedArgs += ', ' + reqArgs;\n }\n if (hasOptional) {\n parsedArgs += ', optional_args: &[Value]';\n }\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 try {\n const type = this.getChecker().getReturnTypeOfSignature(this.getChecker().getSignatureFromDeclaration(node));\n if (type.flags === ts.TypeFlags.Void) {\n return '';\n }\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 let optionalInits = '';\n if (optionalParams.length > 0) {\n const requiredCount = params.filter(p => !p.initializer && !p.questionToken).length;\n optionalInits = optionalParams.map((p, idx) => {\n const pname = this.printNode(p.name, 0);\n const defaultVal = p.initializer ? this.printNode(p.initializer, 0) : 'Value::Null';\n return `${this.getIden(identation + 2)}let ${pname} = get_arg(optional_args, ${idx}, ${defaultVal});`;\n }).join('\\n') + '\\n';\n }\n\n const blockOpen = this.getBlockOpen(identation);\n const blockClose = this.getBlockClose(identation);\n const statements = node.body.statements.map(s => this.printNode(s, identation + 2)).join('\\n');\n const body = blockOpen + optionalInits + statements + blockClose;\n\n return this.printNodeCommentsIfAny(node, identation, methodDef + body);\n }\n\n printFunctionDefinition(node, identation) {\n const name = node.name?.escapedText ?? '';\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 (ts.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.escapedText;\n const sig = this.methodSignatures[methodName];\n if (sig) {\n const requiredArgs = args.slice(0, sig.requiredCount).map(a => this.printNode(a, 0)).join(', ');\n const optionalArgsList = args.slice(sig.requiredCount).map(a => this.printNode(a, 0)).join(', ');\n const optSlice = optionalArgsList ? `&[${optionalArgsList}]` : '&[]';\n const reqPart = requiredArgs ? `${requiredArgs}, ` : '';\n return `self.${methodName}(${reqPart}${optSlice})`;\n }\n }\n\n return undefined;\n }\n\n printCallExpression(node, identation) {\n const expression = node.expression;\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 const ref = argText.startsWith('Value::') ? `&${argText}` :\n argText.startsWith('&') ? argText : `&${argText}`;\n return `println_val(${ref})`;\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) return outOfOrder;\n\n return super.printCallExpression(node, identation);\n }\n\n printThisKeyword(node, identation) {\n return 'self';\n }\n\n printNewExpression(node, identation) {\n let expression = node.expression?.escapedText;\n expression = expression ? expression : this.printNode(node.expression);\n const args = node.arguments.map(a => this.printNode(a, identation)).join(', ');\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 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 = expression\n .replace(/([A-Z]+)([A-Z][a-z])/g, '$1_$2')\n .replace(/([a-z\\d])([A-Z])/g, '$1_$2')\n .toLowerCase();\n return `crate::exchange_errors::${snake}(${args})`;\n }\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.escapedText;\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 `get_array_length(&${leftExpr})`;\n }\n\n return `${leftExpr}.${rightSide}`;\n }\n\n transformPropertyAcessExpressionIfNeeded(node) {\n const rightSide = node.name.escapedText;\n const leftExpr = this.printNode(node.expression, 0);\n if (rightSide === 'length') {\n return `get_array_length(&${leftExpr})`;\n }\n return undefined;\n }\n\n printElementAccessExpression(node, identation) {\n const special = this.printElementAccessExpressionExceptionIfAny(node);\n if (special) return special;\n\n const keys: any[] = [];\n let baseExpr = null;\n let current: any = node;\n while (ts.isElementAccessExpression(current)) {\n keys.unshift(current.argumentExpression);\n const expr = current.expression;\n if (!ts.isElementAccessExpression(expr)) {\n baseExpr = expr;\n break;\n }\n current = expr;\n }\n\n const containerStr = this.printNode(baseExpr, 0);\n const keyStrs = keys.map(k => this.printNode(k, 0));\n\n let acc = containerStr;\n keyStrs.forEach(k => {\n const kRef = k.startsWith('Value::') ? `&${k}` : `&${k}`;\n acc = `get_value(&${acc}, ${kRef})`;\n });\n return acc;\n }\n\n printForStatement(node, identation) {\n const initNode = node.initializer;\n const condNode = node.condition;\n const incrNode = node.incrementor;\n\n const idn = this.getIden(identation);\n const idn1 = this.getIden(identation + 1);\n\n const initStr = initNode ? this.printNode(initNode, identation + 1) + ';\\n' : '';\n const condStr = condNode ? this.printNode(condNode, 0) : 'true';\n const incrStr = incrNode ? this.printNode(incrNode, 0) : '';\n\n const statements = node.statement.statements.map(s => this.printNode(s, identation + 1)).join('\\n');\n const body = `{\\n${statements}\\n${idn}}`;\n\n // A C-style `for` becomes a Rust `while`. The increment must run on\n // every iteration *including* one ended by `continue` — a `continue`\n // re-evaluates the loop condition, so the increment is folded into\n // it (guarded by a first-iteration flag). Putting the increment at\n // the end of the body instead would let `continue` skip it and spin\n // 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,\n SyntaxKind.EqualsEqualsEqualsToken,\n SyntaxKind.ExclamationEqualsToken,\n SyntaxKind.ExclamationEqualsEqualsToken,\n SyntaxKind.LessThanToken,\n SyntaxKind.LessThanEqualsToken,\n SyntaxKind.GreaterThanToken,\n SyntaxKind.GreaterThanEqualsToken,\n ]);\n\n printCondition(node, 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 as any).COMPARISON_OPS.has(opKind)) {\n return `${this.getIden(identation)}${this.printNode(node, 0)}`;\n }\n // Logical &&/|| operands are individually is_true()-wrapped in\n // printBinaryExpression, so the whole expression is already bool.\n if (opKind === SyntaxKind.AmpersandAmpersandToken ||\n opKind === SyntaxKind.BarBarToken) {\n return `${this.getIden(identation)}${this.printNode(node, 0)}`;\n }\n }\n // PrefixUnary ! — delegate to avoid double-wrapping\n if (node.kind === SyntaxKind.PrefixUnaryExpression &&\n node.operator === SyntaxKind.ExclamationToken) {\n return this.printPrefixUnaryExpression(node, identation);\n }\n const expression = this.printNode(node, 0);\n return `${this.getIden(identation)}is_true(&${expression})`;\n }\n\n printWhileStatement(node, identation) {\n const expr = this.printCondition(node.expression, 0);\n const body = this.printBlock(node.statement, identation);\n return `${this.getIden(identation)}while ${expr}${body}`;\n }\n\n printIfStatement(node, identation) {\n const expression = this.printCondition(node.expression, 0);\n const elseExists = node.elseStatement !== undefined;\n const ifBody = this.printBlock(node.thenStatement, identation, elseExists);\n\n let ifComplete = `${expression}${ifBody}`;\n const isElseIf = node.parent.kind === SyntaxKind.IfStatement;\n if (isElseIf) {\n ifComplete = `else if ${ifComplete}`;\n } else {\n ifComplete = `${this.getIden(identation)}if ${ifComplete}`;\n }\n\n const elseStatement = node.elseStatement;\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 operandText = this.printNode(operand, 0);\n if (operator === SyntaxKind.PlusPlusToken) {\n return `${this.getIden(identation)}${operandText} = add(&${operandText}, &Value::Int(1))`;\n }\n if (operator === SyntaxKind.MinusMinusToken) {\n return `${this.getIden(identation)}${operandText} = subtract(&${operandText}, &Value::Int(1))`;\n }\n return super.printPostFixUnaryExpression(node, identation);\n }\n\n printPrefixUnaryExpression(node, identation) {\n const { operand, operator } = node;\n if (operator === SyntaxKind.ExclamationToken) {\n return this.getIden(identation) + '!' + this.printCondition(node.operand, 0);\n }\n if (operator === SyntaxKind.MinusToken) {\n return this.getIden(identation) + `negate(&${this.printNode(operand, 0)})`;\n }\n return this.getIden(identation) + this.PrefixFixOperators[operator] + this.printNode(operand, 0);\n }\n\n printObjectLiteralExpression(node, identation) {\n if (node.properties.length === 0) {\n return 'Value::Map({\\n' + this.getIden(identation + 1) + 'let mut m = std::collections::HashMap::new();\\n' + this.getIden(identation + 1) + 'm\\n' + this.getIden(identation) + '})';\n }\n const escapeKey = (s: any): string => {\n return String(s).replace(/\\\\/g, '\\\\\\\\').replace(/\"/g, '\\\\\"').replace(/\\n/g, '\\\\n').replace(/\\r/g, '\\\\r').replace(/\\t/g, '\\\\t');\n };\n const lines = node.properties.map(p => {\n // Shorthand: { foo } → m.insert(\"foo\", foo.clone());\n if (ts.isShorthandPropertyAssignment(p)) {\n const name = p.name.escapedText;\n return `${this.getIden(identation + 2)}m.insert(\"${escapeKey(name)}\".to_string(), ${name}.clone());`;\n }\n const { name, initializer } = p;\n const keyText = ts.isStringLiteral(name) ? name.text : name.escapedText;\n const valText = this.printNode(initializer, 0);\n return `${this.getIden(identation + 2)}m.insert(\"${escapeKey(keyText)}\".to_string(), ${valText});`;\n }).join('\\n');\n return `Value::Map({\\n${this.getIden(identation + 1)}let mut m = std::collections::HashMap::new();\\n${lines}\\n${this.getIden(identation + 1)}m\\n${this.getIden(identation)}})`;\n }\n\n printArrayLiteralExpression(node, identation) {\n const elements = node.elements.map(e => this.printNode(e, 0)).join(', ');\n return `Value::List(vec![${elements}])`;\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 const keyRef = key.startsWith('Value::') ? `&${key}` : `&${key}`;\n return `remove(&mut ${object}, ${keyRef})`;\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)}is_instance(&${left}, &${right})`;\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 `ternary(${condition}, ${whenTrue}, ${whenFalse})`;\n }\n\n // Built-in method call overrides\n printArrayIsArrayCall(node, identation, parsedArg = undefined) {\n return `Value::Bool(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 printPromiseAllCall(node, identation, parsedArg = undefined) {\n // No trailing `.await` here — when the TS source has\n // `await Promise.all(...)`, `printAwaitExpression` will append it.\n // Adding it here too would produce `.await.await` (double-await).\n return `promise_all(&${parsedArg})`;\n }\n\n // Rust uses postfix `.await`; the base transpiler defaults to prefix.\n printAwaitExpression(node, identation) {\n const expr = this.printNode(node.expression, identation);\n return `${expr}.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 const pRef = parsedArg?.startsWith('Value::') ? `&${parsedArg}` : `&${parsedArg}`;\n return `Value::Bool(contains(&${name}, ${pRef}))`;\n }\n\n printIndexOfCall(node, identation, name = undefined, parsedArg = undefined) {\n return `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 const arg2 = parsedArg2 ?? 'Value::Null';\n return `slice(&${name}, &${parsedArg}, &${arg2})`;\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 printThrowStatement(node, identation) {\n const expression = this.printNode(node.expression, 0);\n // `{}` (Display) renders an ExchangeError as `[Kind] message`;\n // `{:?}` would dump the struct fields.\n return `${this.getIden(identation)}panic!(\"{}\", ${expression});`;\n }\n\n printTryStatement(node, identation) {\n const tryBody = node.tryBlock.statements.map(s => this.printNode(s, identation + 1)).join('\\n');\n const catchBody = node.catchClause.block.statements.map(s => this.printNode(s, identation + 1)).join('\\n');\n const rawName = node.catchClause?.variableDeclaration?.name?.escapedText;\n const errorName = rawName ? `_${rawName}` : '_e';\n const iden = this.getIden(identation);\n return `${iden}let _try_result = std::panic::catch_unwind(std::panic::AssertUnwindSafe(|| {\\n${tryBody}\\n${iden}}));\\n${iden}if let Err(${errorName}) = _try_result {\\n${catchBody}\\n${iden}}`;\n }\n\n printReturnStatement(node, identation) {\n const exp = node.expression;\n if (!exp) {\n return `${this.getIden(identation)}return;`;\n }\n const rightPart = this.printNode(exp, 0).trim();\n return `${this.getIden(identation)}return ${rightPart};`;\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 const expression = this.printNode(node.expression, 0);\n return `${this.getIden(identation)}${expression}`;\n }\n}\n"]} \ No newline at end of file +{"version":3,"sources":["../node_modules/tsup/assets/cjs_shims.js","../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"],"names":["ts","defaultValue","type","node","namedExports","SyntaxKind","parserConfig","symbol","name","currentPath","sourceFile","path"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;;;ACAA;AAAA;AAAA;AACA,WAAO,UAAU;AAAA;AAAA;;;ACDjB;AACA,qBAAwB;AADxB,OAAOA,SAAQ;;;ACAf;;;ACAA;AAAA,OAAO,QAAQ;;;ACAf;AAgFA,IAAM,qBAAN,cAAiC,MAAM;AAAA,EACnC,YAAa,IAAI,SAAS,UAAU,OAAO,KAAK;AAC5C,UAAM,gBAAgB,SAAS,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Q,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;AACJ","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","// https://github.com/kulshekhar/ts-jest/issues/1174\nmodule.exports = __dirname;","import ts from 'typescript';\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 } from './goTranspiler.js';\nimport { JavaTranspiler } from './javaTranspiler.js';\nimport { RustTranspiler } from './rustTranspiler.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: ts.CompilerOptions = {\n target: ts.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\nfunction overrideHostForVirtualFiles(host: ts.CompilerHost, files: Map) {\n const originalGetSourceFile = host.getSourceFile.bind(host);\n const originalReadFile = host.readFile.bind(host);\n const originalFileExists = host.fileExists.bind(host);\n // resolve paths because typescript will normalize them\n // to forward slashes on windows\n host.getSourceFile = (fileName, languageVersion, onError, shouldCreateNewSourceFile) => {\n const virtual = files.get(path.resolve(fileName));\n return virtual !== undefined ? virtual : originalGetSourceFile(fileName, languageVersion, onError, shouldCreateNewSourceFile);\n };\n host.readFile = (fileName: string) => {\n const virtual = files.get(path.resolve(fileName));\n return virtual !== undefined ? virtual.text : originalReadFile(fileName);\n };\n host.fileExists = (fileName: string) => {\n return files.has(path.resolve(fileName)) || originalFileExists(fileName);\n };\n}\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 NO_SYMBOL_SENTINEL = Symbol(\"noSymbol\");\nfunction memoizeCheckerCalls(checker: ts.TypeChecker): void {\n if ((checker as any).__astTranspilerMemoized) {\n return;\n }\n (checker as any).__astTranspilerMemoized = true;\n\n const typeCache = new WeakMap();\n const originalGetTypeAtLocation = checker.getTypeAtLocation.bind(checker);\n checker.getTypeAtLocation = (node: ts.Node): ts.Type => {\n let type = typeCache.get(node);\n if (type === undefined) {\n type = originalGetTypeAtLocation(node);\n typeCache.set(node, type);\n }\n return type;\n };\n\n const symbolCache = new WeakMap();\n const originalGetSymbolAtLocation = checker.getSymbolAtLocation.bind(checker);\n checker.getSymbolAtLocation = (node: ts.Node): ts.Symbol | undefined => {\n const cached = symbolCache.get(node);\n if (cached !== undefined) {\n return cached === NO_SYMBOL_SENTINEL ? undefined : cached;\n }\n const symbol = originalGetSymbolAtLocation(node);\n symbolCache.set(node, symbol === undefined ? NO_SYMBOL_SENTINEL : symbol);\n return symbol;\n };\n}\n\nfunction getProgramAndTypeCheckerFromMemory (rootDir: string, text: string, options: any = {}, cache?: ITranspileProgramCache): [any,any,any] {\n options = options || ts.getDefaultCompilerOptions();\n const inMemoryFilePath = path.resolve(path.join(rootDir, \"__dummy-file.ts\"));\n const textAst = ts.createSourceFile(inMemoryFilePath, text, options.target || ts.ScriptTarget.Latest);\n const shimAst = ts.createSourceFile(globalsShimPath, globalsShim, options.target || ts.ScriptTarget.Latest);\n const host = ts.createCompilerHost(options, true);\n\n overrideHostForVirtualFiles(host, new Map([\n [inMemoryFilePath, textAst],\n [globalsShimPath, shimAst],\n ]));\n\n if (cache !== undefined) {\n // the dummy file changes every call, but the es lib chain behind it does not:\n // serve those from the shared cache so they are parsed once per cache\n const originalGetSourceFile = host.getSourceFile.bind(host);\n host.getSourceFile = (fileName, languageVersion, onError, shouldCreateNewSourceFile) => {\n const resolved = path.resolve(fileName);\n if (resolved === inMemoryFilePath) {\n return textAst;\n }\n const cached = cache.sourceFiles.get(resolved);\n if (cached !== undefined && !shouldCreateNewSourceFile) {\n return cached.sourceFile;\n }\n const sourceFile = originalGetSourceFile(fileName, languageVersion, onError, shouldCreateNewSourceFile);\n if (sourceFile !== undefined) {\n cache.sourceFiles.set(resolved, { mtimeMs: 0, sourceFile });\n }\n return sourceFile;\n };\n }\n\n const program = ts.createProgram({\n options,\n rootNames: [inMemoryFilePath, globalsShimPath],\n host,\n oldProgram: cache?.memoryOldProgram,\n });\n if (cache !== undefined) {\n cache.memoryOldProgram = program;\n }\n\n const typeChecker = program.getTypeChecker();\n memoizeCheckerCalls(typeChecker);\n const sourceFile = program.getSourceFile(inMemoryFilePath);\n\n return [ program, typeChecker, sourceFile];\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 // 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\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 { sourceFiles: new Map() };\n }\n\n constructor(config = {}, programCache?: ITranspileProgramCache) {\n this.config = config;\n this.programCache = programCache ?? Transpiler.createProgramCache();\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\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 }\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 createProgramInMemoryAndSetContext(content): ITranspileContext {\n const [ memProgram, memType, memSource] = getProgramAndTypeCheckerFromMemory(__dirname_mock, content, fastCompilerOptions, this.programCache);\n return this.setContext({\n src: memSource,\n checker: memType as ts.TypeChecker,\n program: memProgram,\n });\n }\n\n getByPathCompilerHost(options: ts.CompilerOptions): ts.CompilerHost {\n if (this.programCache.byPathHost === undefined) {\n const host = ts.createCompilerHost(options, true);\n const originalGetSourceFile = host.getSourceFile.bind(host);\n const cache = this.programCache.sourceFiles;\n host.getSourceFile = (fileName, languageVersion, onError, shouldCreateNewSourceFile) => {\n let mtimeMs = 0;\n try {\n mtimeMs = fs.statSync(fileName).mtimeMs;\n } catch (e) {\n // e.g. synthetic lib paths — fall through with mtime 0\n }\n const cached = cache.get(fileName);\n if (cached && cached.mtimeMs === mtimeMs && !shouldCreateNewSourceFile) {\n return cached.sourceFile;\n }\n const sourceFile = originalGetSourceFile(fileName, languageVersion, onError, shouldCreateNewSourceFile);\n if (sourceFile !== undefined) {\n cache.set(fileName, { mtimeMs, sourceFile });\n }\n return sourceFile;\n };\n const shimAst = ts.createSourceFile(globalsShimPath, globalsShim, ts.ScriptTarget.Latest);\n overrideHostForVirtualFiles(host, new Map([[globalsShimPath, shimAst]]));\n this.programCache.byPathHost = host;\n }\n return this.programCache.byPathHost;\n }\n\n createProgramByPathAndSetContext(path): ITranspileContext {\n const options: ts.CompilerOptions = fastCompilerOptions;\n const host = this.getByPathCompilerHost(options);\n // passing the previous program lets typescript reuse its internal state where\n // possible; the cached host makes every already-seen dependency parse-free\n const program = ts.createProgram([path, globalsShimPath], options, host, this.programCache.byPathOldProgram);\n this.programCache.byPathOldProgram = program;\n const sourceFile = program.getSourceFile(path);\n const typeChecker = program.getTypeChecker();\n memoizeCheckerCalls(typeChecker);\n\n return this.setContext({\n src: sourceFile,\n checker: typeChecker,\n program,\n });\n }\n\n // One program over N root files, instead of one program per file. Every\n // transpile*ByPath call pays for a full program: even with the SourceFile cache\n // making the ~340-file import closure parse-free, the binder/checker work behind\n // getPreEmitDiagnostics is redone per file. Batching N files into one program\n // pays it once for the whole set.\n //\n // Files that import each other (a derived exchange and its parent) are fine in\n // one batch — they are separate root files of the same program, exactly as\n // typescript would compile a project.\n //\n // The batch deliberately does not become the cache's byPathOldProgram: an N-file\n // program never structurally reuses a program built from a different root set, so\n // there is nothing to gain, and keeping the previous chunk's checker alive while\n // the next one is built would double peak memory — the opposite of why callers\n // chunk. The cross-batch saving comes from the shared host + SourceFile cache.\n createProgramBatch(paths: string[]): TranspileProgramBatch {\n const options: ts.CompilerOptions = fastCompilerOptions;\n const host = this.getByPathCompilerHost(options);\n const program = ts.createProgram([...paths, globalsShimPath], options, host);\n const checker = program.getTypeChecker();\n memoizeCheckerCalls(checker);\n return new TranspileProgramBatch(this, 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 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 const diagnostics = ts.getPreEmitDiagnostics(context.program, context.src);\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.messageText + \"\\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\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 transpiledContent = 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 }\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\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 }\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 program: ts.Program;\n private readonly checker: ts.TypeChecker;\n\n constructor(transpiler: Transpiler, program: ts.Program, checker: ts.TypeChecker) {\n this.transpiler = transpiler;\n this.program = program;\n this.checker = checker;\n }\n\n getProgram(): ts.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 — the printers read checker state\n // back from it, so it is not optional\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\nexport {\n Transpiler,\n TranspileProgramBatch\n};\n","import { BaseTranspiler } from \"./baseTranspiler.js\";\nimport { regexAll } from \"./utils.js\";\nimport ts from 'typescript';\n\nconst SyntaxKind = ts.SyntaxKind;\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.escapedText;\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.escapedText;\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.escapedText;\n const heritageClauses = node.heritageClauses;\n\n let classInit = \"\";\n if (heritageClauses !== undefined) {\n const classExtends = heritageClauses[0].types[0].expression.escapedText;\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 === ts.SyntaxKind.EqualsEqualsToken || op === ts.SyntaxKind.EqualsEqualsEqualsToken) && node.right.kind === ts.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 ts.SyntaxKind.EqualsEqualsToken:\n return \"is\";\n case ts.SyntaxKind.ExclamationEqualsToken:\n return \"is not\";\n case ts.SyntaxKind.ExclamationEqualsEqualsToken:\n return \"is not\";\n case ts.SyntaxKind.EqualsEqualsEqualsToken:\n return \"is\";\n }\n }\n }\n}\n","import ts from 'typescript';\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(): ts.SourceFile {\n if (this.context === undefined) throw new Error(NO_CONTEXT_ERROR);\n return this.context.src;\n }\n\n getChecker(): ts.TypeChecker {\n if (this.context === undefined) throw new Error(NO_CONTEXT_ERROR);\n return this.context.checker;\n }\n\n getProgram(): ts.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 [ts.SyntaxKind.StringLiteral]: this.STRING_LITERAL_KEYWORD,\n [ts.SyntaxKind.StringKeyword]: this.STRING_KEYWORD,\n // [ts.SyntaxKind.NumberKeyword]: this.NUMBER_KEYWORD,\n [ts.SyntaxKind.NumberKeyword]: this.DEFAULT_TYPE,\n [ts.SyntaxKind.MinusMinusToken]: this.MINUS_MINUS_TOKEN,\n [ts.SyntaxKind.MinusToken]: this.MINUS_TOKEN,\n [ts.SyntaxKind.SlashToken]: this.SLASH_TOKEN,\n [ts.SyntaxKind.AsteriskToken]: this.ASTERISK_TOKEN,\n [ts.SyntaxKind.InKeyword]: this.IN_TOKEN,\n [ts.SyntaxKind.PlusToken]: this.PLUS_TOKEN,\n [ts.SyntaxKind.PercentToken]: this.PERCENT_TOKEN,\n [ts.SyntaxKind.LessThanToken]: this.LESS_THAN_TOKEN,\n [ts.SyntaxKind.LessThanEqualsToken]: this.LESS_THAN_EQUALS_TOKEN,\n [ts.SyntaxKind.GreaterThanToken]: this.GREATER_THAN_TOKEN,\n [ts.SyntaxKind.GreaterThanEqualsToken]: this.GREATER_THAN_EQUALS_TOKEN,\n [ts.SyntaxKind.EqualsEqualsToken]: this.EQUALS_EQUALS_TOKEN,\n [ts.SyntaxKind.EqualsEqualsEqualsToken]: this.EQUALS_EQUALS_EQUALS_TOKEN,\n [ts.SyntaxKind.EqualsToken]: this.EQUALS_TOKEN,\n [ts.SyntaxKind.PlusEqualsToken]: this.PLUS_EQUALS,\n [ts.SyntaxKind.BarBarToken]: this.BAR_BAR_TOKEN,\n [ts.SyntaxKind.AmpersandAmpersandToken]: this.AMPERSTAND_APERSAND_TOKEN,\n [ts.SyntaxKind.ExclamationEqualsEqualsToken]: this.EXCLAMATION_EQUALS_EQUALS_TOKEN,\n [ts.SyntaxKind.ExclamationEqualsToken]: this.EXCLAMATION_EQUALS_TOKEN,\n [ts.SyntaxKind.AsyncKeyword]: this.ASYNC_TOKEN,\n [ts.SyntaxKind.AwaitKeyword]: this.AWAIT_TOKEN,\n [ts.SyntaxKind.StaticKeyword]: this.STATIC_TOKEN,\n [ts.SyntaxKind.PublicKeyword]: this.PUBLIC_KEYWORD,\n [ts.SyntaxKind.PrivateKeyword]: this.PRIVATE_KEYWORD,\n [ts.SyntaxKind.VoidKeyword]: this.VOID_KEYWORD,\n [ts.SyntaxKind.BooleanKeyword]: this.BOOLEAN_KEYWORD,\n };\n\n this.PostFixOperators = {\n [ts.SyntaxKind.PlusPlusToken]: this.PLUS_PLUS_TOKEN,\n [ts.SyntaxKind.MinusMinusToken]: this.MINUS_MINUS_TOKEN,\n };\n\n this.PrefixFixOperators = {\n [ts.SyntaxKind.ExclamationToken]: this.NOT_TOKEN,\n [ts.SyntaxKind.MinusToken]: this.MINUS_TOKEN,\n };\n\n this.FunctionDefSupportedKindNames = {\n [ts.SyntaxKind.StringKeyword]: this.STRING_KEYWORD\n };\n\n this.FuncModifiers = {\n [ts.SyntaxKind.AsyncKeyword]: this.ASYNC_TOKEN,\n [ts.SyntaxKind.PublicKeyword]: this.PUBLIC_KEYWORD,\n [ts.SyntaxKind.PrivateKeyword]: this.PRIVATE_KEYWORD,\n [ts.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: ts.TypeFlags) {\n return flags === ts.TypeFlags.String || flags === ts.TypeFlags.StringLiteral;\n }\n\n isAnyType(flags: ts.TypeFlags) {\n return flags === ts.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 === ts.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 || !ts.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: ts.Node): ts.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 (!ts.isClassDeclaration(node.parent)) {\n return undefined;\n }\n\n // Get the class declaration\n const classDeclaration = node.parent as ts.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 = (ts as any).getAllSuperTypeNodes(node.parent)[0];\n\n while (parentClass !== undefined) {\n const parentClassType = this.getChecker().getTypeAtLocation(parentClass);\n const parentClassDecl = parentClassType?.symbol?.valueDeclaration;\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 (ts.isMethodDeclaration(elem)) {\n\n const name = elem.name.getText().trim();\n if ((node as any).name.escapedText === name) {\n method = elem;\n }\n }\n });\n\n parentClass = (ts as any).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) {\n return name;\n }\n\n transformPropertyAccessExpressionName(name: string) {\n return name;\n }\n\n printIdentifier(node) {\n let idValue = node.text ?? node.escapedText;\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 === ts.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.escapedText;\n const right = node.right.escapedText;\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 == ts.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 === ts.SyntaxKind.EqualsEqualsToken || operatorToken.kind === ts.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 === ts.SyntaxKind.BarBarToken || operatorToken.kind === ts.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.escapedText;\n let rightSide = node.name.escapedText;\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);\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 !== ts.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 = 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 printTraillingComment(node, identation) {\n const fullText = this.getSrc().getFullText();\n const commentsRangeList = ts.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 === ts.SyntaxKind.TypeReference) {\n const typeRef = type.typeName.escapedText;\n if (typeRef === \"Promise\") {\n const typeArgs = type.typeArguments.filter(t => t.kind !== ts.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.escapedText;\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.escapedText;\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 (ts.isArrayLiteralExpression(initializer)) {\n return this.ARRAY_KEYWORD;\n }\n if ((ts as any).isBooleanLiteral(initializer)) {\n return this.BOOLEAN_KEYWORD;\n }\n if (ts.isObjectLiteralExpression(initializer)) {\n return this.OBJECT_KEYWORD;\n }\n if (ts.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 (ts.isStringLiteralLike(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 === ts.TypeFlags.Any) {\n return undefined;\n }\n if (type.flags === ts.TypeFlags.Void) {\n return this.VOID_KEYWORD;\n }\n if (type.flags === ts.TypeFlags.Number) {\n // return this.NUMBER_KEYWORD;\n return this.DEFAULT_TYPE;\n }\n\n if (type.flags === ts.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?.symbol?.escapedName === 'Array') {\n return this.ARRAY_KEYWORD;\n }\n if (type?.symbol?.escapedName === '__object') {\n return this.OBJECT_KEYWORD;\n }\n\n // check this out, trying to resolve Promise<{}>\n if (type?.symbol?.escapedName === '__type') {\n return this.OBJECT_KEYWORD;\n // return this.DEFAULT_TYPE;\n }\n\n // check for promise type\n\n if (type?.symbol?.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 = (type as any).resolvedTypeArguments; // internal typescript property\n if (resolvedTypeArguments.length === 0) {\n return this.PROMISE_TYPE_KEYWORD;\n }\n if (resolvedTypeArguments.length === 1 && resolvedTypeArguments[0].flags === ts.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?.escapedText ?? \"\";\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 && ts.isFunctionDeclaration(node)){\n modifiers = modifiers + \"public \";\n }\n let functionDef = this.getIden(identation) + modifiers + returnType + fnKeyword;\n if (this.includeFunctionNameInFunctionExpressionDeclaration || !ts.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 (ts.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.escapedText;\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 && (ts.isFunctionExpression(declaration.initializer) || ts.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?.getDeclarations()\n ?.some(s => s.getSourceFile().fileName.includes(\"/node_modules/typescript/lib/\"))\n ?? false;\n\n\n return isInLibFiles;\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 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 === ts.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?.escapedText;\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.escapedText === \"assert\") {\n return this.printAssertCall(node, identation, parsedArgs);\n }\n if (expression.escapedText === \"padEnd\") {\n // check this\n }\n }\n }\n\n // print super() call inside constructor\n if (expression.kind === ts.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 === ts.SyntaxKind.Identifier) {\n const idValue = expression.text ?? expression.escapedText;\n parsedExpression = this.transformCallExpressionName(this.unCamelCaseIfNeeded(idValue));\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 === ts.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.escapedText;\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.escapedText;\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 === ts.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 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 === ts.SyntaxKind.BinaryExpression &&\n (node.parent.operatorToken.kind === ts.SyntaxKind.EqualsToken || node.parent.operatorToken.kind === ts.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 === ts.TypeFlags.Union) {\n isUnionString = this.isStringType((type as any)?.types[0].flags);\n }\n\n if (isString || isUnionString || type.flags === ts.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 = ts.isStringLiteralLike(argumentExpression) ? \"\" : '(string)';\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 === ts.SyntaxKind.PrefixUnaryExpression && node.operator === ts.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 === ts.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 === ts.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 === ts.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 === ts.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 === ts.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 (ts.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?.escapedText;\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 || ts.isAwaitExpression(exp)\n || !this.isImplicitAsyncFunction(ts.findAncestor(node, ts.isFunctionLike))\n || !this.isPromiseType(this.getChecker().getTypeAtLocation(exp))) {\n return node;\n }\n if (ts.isConditionalExpression(exp) || ts.isBinaryExpression(exp)) {\n // an await-token prefix would change precedence (e.g. `await a ? b : c`)\n exp = this.wrapSyntheticNode(ts.factory.createParenthesizedExpression(exp), exp);\n }\n node.expression = this.wrapSyntheticNode(ts.factory.createAwaitExpression(exp), exp);\n return node;\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 === ts.SyntaxKind.FunctionDeclaration || parent.kind === ts.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 ts.SyntaxKind.ExpressionStatement:\n return this.printExpressionStatement(node, identation);\n case ts.SyntaxKind.Block:\n return this.printBlock(node, identation);\n case ts.SyntaxKind.FunctionDeclaration:\n case ts.SyntaxKind.FunctionExpression:\n case ts.SyntaxKind.ArrowFunction:\n return this.printFunctionDeclaration(node, identation);\n case ts.SyntaxKind.ClassDeclaration:\n return this.printClass(node, identation);\n case ts.SyntaxKind.VariableStatement:\n return this.printVariableStatement(node, identation);\n case ts.SyntaxKind.MethodDeclaration:\n return this.printMethodDeclaration(node, identation);\n case ts.SyntaxKind.StringLiteral:\n return this.printStringLiteral(node);\n case ts.SyntaxKind.NumericLiteral:\n return this.printNumericLiteral(node);\n case ts.SyntaxKind.PropertyAccessExpression:\n return this.printPropertyAccessExpression(node, identation);\n case ts.SyntaxKind.ArrayLiteralExpression:\n return this.printArrayLiteralExpression(node, identation);\n case ts.SyntaxKind.CallExpression:\n return this.printCallExpression(node, identation);\n case ts.SyntaxKind.WhileStatement:\n return this.printWhileStatement(node, identation);\n case ts.SyntaxKind.BinaryExpression:\n return this.printBinaryExpression(node, identation);\n case ts.SyntaxKind.BreakStatement:\n return this.printBreakStatement(node, identation);\n case ts.SyntaxKind.ForStatement:\n return this.printForStatement(node, identation);\n case ts.SyntaxKind.PostfixUnaryExpression:\n return this.printPostFixUnaryExpression(node, identation);\n case ts.SyntaxKind.VariableDeclarationList:\n return this.printVariableDeclarationList(node, identation); // statements are slightly different if inside a for\n case ts.SyntaxKind.ObjectLiteralExpression:\n return this.printObjectLiteralExpression(node, identation);\n case ts.SyntaxKind.PropertyAssignment:\n return this.printPropertyAssignment(node, identation);\n case ts.SyntaxKind.Identifier:\n return this.printIdentifier(node);\n case ts.SyntaxKind.ElementAccessExpression:\n return this.printElementAccessExpression(node, identation);\n case ts.SyntaxKind.IfStatement:\n return this.printIfStatement(node, identation);\n case ts.SyntaxKind.ParenthesizedExpression:\n return this.printParenthesizedExpression(node, identation);\n case ts.SyntaxKind.TrueKeyword:\n case ts.SyntaxKind.FalseKeyword:\n return this.printBooleanLiteral(node);\n case ts.SyntaxKind.ThisKeyword:\n return this.printThisKeyword(node, identation);\n case ts.SyntaxKind.SuperKeyword:\n return this.SUPER_TOKEN;\n case ts.SyntaxKind.TryStatement:\n return this.printTryStatement(node, identation);\n case ts.SyntaxKind.PrefixUnaryExpression:\n return this.printPrefixUnaryExpression(node, identation);\n case ts.SyntaxKind.ThrowStatement:\n return this.printThrowStatement(node, identation);\n case ts.SyntaxKind.NewExpression:\n return this.printNewExpression(node, identation);\n case ts.SyntaxKind.AwaitExpression:\n return this.printAwaitExpression(node, identation);\n case ts.SyntaxKind.ConditionalExpression:\n return this.printConditionalExpression(node, identation);\n case ts.SyntaxKind.AsExpression:\n return this.printAsExpression(node, identation);\n case ts.SyntaxKind.ReturnStatement:\n return this.printReturnStatement(this.wrapImplicitReturnAwait(node), identation);\n case ts.SyntaxKind.ArrayBindingPattern:\n return this.printArrayBindingPattern(node, identation);\n case ts.SyntaxKind.Parameter:\n return this.printParameter(node);\n case ts.SyntaxKind.Constructor:\n return this.printConstructorDeclaration(node, identation);\n case ts.SyntaxKind.PropertyDeclaration:\n return this.printPropertyDeclaration(node, identation);\n case ts.SyntaxKind.SpreadElement:\n return this.printSpreadElement(node, identation);\n case ts.SyntaxKind.NullKeyword:\n return this.printNullKeyword(node, identation);\n case ts.SyntaxKind.ContinueStatement:\n return this.printContinueStatement(node, identation);\n case ts.SyntaxKind.DeleteExpression:\n return this.printDeleteExpression(node, identation);\n }\n\n if (node.statements) {\n if (ts.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) => ts.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.escapedText;\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 && ts.isCallExpression(dec.initializer) && dec.initializer.expression.getText() === \"require\";\n }\n\n isCJSModuleExportsExpressionStatement(node): boolean {\n if (node.expression && node.expression.kind === ts.SyntaxKind.BinaryExpression ) {\n if (node.expression.left.kind === ts.SyntaxKind.PropertyAccessExpression) {\n const left = node.expression.left as ts.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 => ts.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 === ts.SyntaxKind.CallExpression) {\n const callExpression = decNode.initializer.expression.getText();\n if (callExpression === \"require\") {\n const isDefault = decNode.name.kind === ts.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) => ts.isExportDeclaration(s));\n const defaultExport = node.statements.filter((s) => ts.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 ts.BinaryExpression);\n\n moduleExports.forEach(node => {\n const right = node.right;\n if (right.kind === ts.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 === ts.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) => ts.isClassDeclaration(s));\n const functionDeclarations = node.statements.filter((s) => ts.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 === ts.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 func2Type = this.getChecker().getTypeOfSymbolAtLocation(bType.symbol, bType.symbol.valueDeclaration);\n const func2Signature = this.getChecker().getSignaturesOfType(func2Type, ts.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?.escapedText;\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 = ts.TypeFlags[type.flags];\n return result;\n }\n }\n\n const name = node.type?.typeName?.escapedText;\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) => ts.isClassDeclaration(s));\n classDeclarations.forEach((node) => {\n const methods = node.members.filter((m) => ts.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 ts from 'typescript';\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: ts.SourceFile;\n checker: ts.TypeChecker;\n program: ts.Program;\n}\n\n// Parsed SourceFiles (the es lib chain plus the import closure of everything\n// transpiled so far) and the last program built from them, so the next program\n// reuses that work instead of re-parsing it. Shareable between Transpiler\n// instances running on the same thread; these are plain V8 heap objects, so a\n// worker_threads isolate cannot receive one and needs a cache of its own.\ninterface ITranspileProgramCache {\n sourceFiles: Map;\n byPathHost?: ts.CompilerHost;\n byPathOldProgram?: ts.Program;\n memoryOldProgram?: ts.Program;\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}\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 ts, { TypeChecker } from 'typescript';\nimport { unCamelCase, regexAll } from \"./utils.js\";\nimport { Logger } from \"./logger.js\";\n\nconst SyntaxKind = ts.SyntaxKind;\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 if (symbol && symbol.valueDeclaration) {\n const valueDecl = symbol.valueDeclaration;\n\n // Check if it's a function (FunctionDeclaration, FunctionExpression, ArrowFunction)\n if (ts.isFunctionDeclaration(valueDecl) || ts.isFunctionExpression(valueDecl) || ts.isArrowFunction(valueDecl)) {\n // Check if the identifier is passed as an argument in a function call\n if (node.parent && ts.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 === ts.TypeFlags.String || rightType.flags === ts.TypeFlags.String) {\n return TOKEN;\n }\n if (leftType.flags === ts.TypeFlags.StringLiteral || rightType.flags === ts.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 TypeChecker).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.escapedText;\n const right = node.right.escapedText;\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?.escapedText;\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.escapedText ?? 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 === ts.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 ts, { TypeChecker } from 'typescript';\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\nexport class CSharpTranspiler 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.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 = {\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.binaryExpressionsWrappers = {\n [ts.SyntaxKind.EqualsEqualsToken]: [this.EQUALS_EQUALS_WRAPPER_OPEN, this.EQUALS_EQUALS_WRAPPER_CLOSE],\n [ts.SyntaxKind.EqualsEqualsEqualsToken]: [this.EQUALS_EQUALS_WRAPPER_OPEN, this.EQUALS_EQUALS_WRAPPER_CLOSE],\n [ts.SyntaxKind.ExclamationEqualsToken]: [this.DIFFERENT_WRAPPER_OPEN, this.DIFFERENT_WRAPPER_CLOSE],\n [ts.SyntaxKind.ExclamationEqualsEqualsToken]: [this.DIFFERENT_WRAPPER_OPEN, this.DIFFERENT_WRAPPER_CLOSE],\n [ts.SyntaxKind.GreaterThanToken]: [this.GREATER_THAN_WRAPPER_OPEN, this.GREATER_THAN_WRAPPER_CLOSE],\n [ts.SyntaxKind.GreaterThanEqualsToken]: [this.GREATER_THAN_EQUALS_WRAPPER_OPEN, this.GREATER_THAN_EQUALS_WRAPPER_CLOSE],\n [ts.SyntaxKind.LessThanToken]: [this.LESS_THAN_WRAPPER_OPEN, this.LESS_THAN_WRAPPER_CLOSE],\n [ts.SyntaxKind.LessThanEqualsToken]: [this.LESS_THAN_EQUALS_WRAPPER_OPEN, this.LESS_THAN_EQUALS_WRAPPER_CLOSE],\n [ts.SyntaxKind.PlusToken]: [this.PLUS_WRAPPER_OPEN, this.PLUS_WRAPPER_CLOSE],\n [ts.SyntaxKind.MinusToken]: [this.MINUS_WRAPPER_OPEN, this.MINUS_WRAPPER_CLOSE],\n [ts.SyntaxKind.AsteriskToken]: [this.MULTIPLY_WRAPPER_OPEN, this.MULTIPLY_WRAPPER_CLOSE],\n [ts.SyntaxKind.PercentToken]: [this.MOD_WRAPPER_OPEN, this.MOD_WRAPPER_CLOSE],\n [ts.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 printIdentifier(node) {\n let idValue = node.text ?? node.escapedText;\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?.symbol;\n if (symbol !== undefined) {\n // const declarations = this.getChecker().getDeclaredTypeOfSymbol(symbol).symbol?.declarations ?? [];\n const decl = symbol?.declarations ?? [];\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 === ts.SyntaxKind.ClassDeclaration);\n const isInsideNewExpression = node?.parent?.kind === ts.SyntaxKind.NewExpression;\n const isInsideCatch = node?.parent?.kind === ts.SyntaxKind.ThrowStatement;\n const isLeftSide = node?.parent?.name === node || (node?.parent?.left === node);\n const isCallOrPropertyAccess = node?.parent?.kind === ts.SyntaxKind.PropertyAccessExpression || node?.parent?.kind === ts.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];\n if (first.kind === ts.SyntaxKind.ClassDeclaration) {\n isClassDeclaration = true;\n }\n if (first.kind === ts.SyntaxKind.ImportSpecifier) {\n const importedSymbol = this.getChecker().getAliasedSymbol(symbol);\n if (importedSymbol?.declarations[0]?.kind === ts.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 superCallParams = '';\n let hasSuperCall = false;\n node.body?.statements.forEach(statement => {\n if (ts.isExpressionStatement(statement)) {\n const expression = statement.expression;\n if (ts.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 printThisElementAccesssIfNeeded(node, identation) {\n // convert this[method] into this.call(method) or this.callAsync(method)\n // const isAsync = node?.parent?.kind === ts.SyntaxKind.AwaitExpression;\n const isAsync = true; // setting to true for now, because there are some scenarios where we don't know\n // if the call is async or not, so we need to assume it is async\n // example Promise.all([this.unknownPropAsync()])\n const elementAccess = node.expression;\n if (elementAccess?.kind === ts.SyntaxKind.ElementAccessExpression) {\n if (elementAccess?.expression?.kind === ts.SyntaxKind.ThisKeyword) {\n let parsedArg = node.arguments?.length > 0 ? this.printNode(node.arguments[0], identation).trimStart() : \"\";\n const propName = this.printNode(elementAccess.argumentExpression, 0);\n const wrapperOpen = isAsync ? this.UKNOWN_PROP_ASYNC_WRAPPER_OPEN : this.UKNOWN_PROP_WRAPPER_OPEN;\n const wrapperClose = isAsync ? this.UNKOWN_PROP_ASYNC_WRAPPER_CLOSE : this.UNKOWN_PROP_WRAPPER_CLOSE;\n parsedArg = parsedArg ? \", \" + parsedArg : \"\";\n return wrapperOpen + propName + parsedArg + wrapperClose;\n }\n }\n return;\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 === ts.SyntaxKind.ElementAccessExpression) {\n const parsedArg = node.arguments?.length > 0 ? 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 const argsArray = `new object[] { ${parsedArg} }`;\n const open = this.DYNAMIC_CALL_OPEN;\n let statement = `${open}${target}, ${propName}, ${argsArray})`;\n statement = isAsync ? `((Task)${statement})` : statement;\n return statement;\n }\n return undefined;\n }\n\n\n printElementAccessExpressionExceptionIfAny(node) {\n // convert this[method] into this.call(method) or this.callAsync(method)\n // if (node?.expression?.kind === ts.SyntaxKind.ThisKeyword) {\n // const isAsyncDecl = node?.parent?.kind === ts.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 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.escapedText;\n // const isAsyncDecl = true;\n const isAsyncDecl = node?.parent?.kind === ts.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 printOutOfOrderCallExpressionIfAny(node, identation) {\n if (node.expression.kind === ts.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 `mathMin(${parsedArg1}, ${parsedArg2})`;\n case \"Math.max\":\n return `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 === ts.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 === ts.SyntaxKind.ExclamationEqualsEqualsToken || op === ts.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 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 === ts.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 === ts.SyntaxKind.EqualsToken && left.kind === ts.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 = `var ${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) + `${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 === ts.SyntaxKind.InKeyword) {\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 === ts.SyntaxKind.PlusEqualsToken || op === ts.SyntaxKind.MinusEqualsToken || op in this.binaryExpressionsWrappers) {\n const leftText = this.printNode(left, 0);\n const rightText = this.printNode(right, 0);\n\n if (op === ts.SyntaxKind.PlusEqualsToken) {\n return `${leftText} = add(${leftText}, ${rightText})`;\n }\n\n if (op === ts.SyntaxKind.MinusEqualsToken) {\n return `${leftText} = subtract(${leftText}, ${rightText})`;\n }\n\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 // x = y\n // cast y to x type when y is unknown\n // if (op === ts.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 printVariableDeclarationList(node,identation) {\n const declaration = node.declarations[0];\n // const name = declaration.name.escapedText;\n\n if (this.removeVariableDeclarationForFunctionExpression && declaration?.initializer && ts.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 === ts.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)}var ${syntheticName} = ${this.printNode(declaration.initializer, 0)};\\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} = ((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 === ts.SyntaxKind.NewExpression);\n const varToken = isNew ? 'var ' : this.VAR_TOKEN + ' ' ;\n\n // handle default undefined initialization\n if (declaration?.initializer && declaration.initializer === undefined) {\n // handle the let id: Str; case\n return this.getIden(identation) + varToken + this.printNode(declaration.name) + \" = \" + this.UNDEFINED_TOKEN;\n } else 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 return this.getIden(identation) + varToken + 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.escapedText;\n\n let rawExpression = undefined;\n\n switch(rightSide) {\n case 'length':\n const type = (this.getChecker() as TypeChecker).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) ? `((string)${leftSide}).Length` : `${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 (ts.isArrayLiteralExpression(node) || ts.isObjectLiteralExpression(node) || ts.isStringLiteral(node) || (ts as any).isBooleanLiteral(node)) {\n return this.UNDEFINED_TOKEN;\n }\n\n if (ts.isNumericLiteral(node)) {\n return this.UNDEFINED_TOKEN;\n }\n\n // convert x: number = undefined (invalid) into x = -1 (valid)\n if (node?.escapedText === \"undefined\" && this.getChecker().getTypeAtLocation(node?.parent)?.flags === ts.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 (ts.isArrayLiteralExpression(initializer)) {\n initParams.push(`${this.printNode(param.name, 0)} ??= new List();`);\n }\n if (ts.isObjectLiteralExpression(initializer)) {\n initParams.push(`${this.printNode(param.name, 0)} ??= new Dictionary();`);\n }\n if (ts.isNumericLiteral(initializer)) {\n initParams.push(`${this.printNode(param.name, 0)} ??= ${this.printNode(initializer, 0)};`);\n }\n if (ts.isStringLiteral(initializer)) {\n initParams.push(`${this.printNode(param.name, 0)} ??= ${this.printNode(initializer, 0)};`);\n }\n if ((ts as any).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.escapedText;\n const right = node.right.escapedText;\n return this.getIden(identation) + `${left} is ${right}`;\n }\n\n printAsExpression(node, identation) {\n const type = node.type;\n\n if (type.kind === ts.SyntaxKind.AnyKeyword) {\n return `((object)${this.printNode(node.expression, identation)})`;\n }\n\n if (type.kind === ts.SyntaxKind.StringKeyword) {\n return `((string)${this.printNode(node.expression, identation)})`;\n }\n\n if (type.kind === ts.SyntaxKind.ArrayType) {\n if (type.elementType.kind === ts.SyntaxKind.AnyKeyword) {\n return `(IList)(${this.printNode(node.expression, identation)})`;\n }\n if (type.elementType.kind === ts.SyntaxKind.StringKeyword) {\n return `(IList)(${this.printNode(node.expression, identation)})`;\n }\n }\n\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 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 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 printArrayLiteralExpression(node) {\n\n let arrayOpen = this.ARRAY_OPENING_TOKEN;\n const elems = node.elements;\n\n const elements = node.elements.map((e) => {\n return this.printNode(e);\n }).join(\", \");\n\n // take into consideration list of promises\n if (elems.length > 0) {\n const first = elems[0];\n if (first.kind === ts.SyntaxKind.CallExpression) {\n // const type = this.getChecker().getTypeAtLocation(first);\n let type = this.getFunctionType(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 printMethodDefinition(node, identation) {\n let name = node.name.escapedText;\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 = \"\";\n parentArgs.forEach((param, index) => {\n const originalName = this.printNode(currentArgs[index].name, 0);\n const parsedArg = this.printParameteCustomName(param, originalName);\n parsedArgs+= parsedArg;\n if (index < parentArgs.length - 1) {\n parsedArgs+= \", \";\n }\n });\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 printArgsForCallExpression(node, identation) {\n const args = node.arguments;\n let parsedArgs = \"\";\n if (false && this.requiresCallExpressionCast && !this.isBuiltInFunctionCall(node?.expression)) { //eslint-disable-line\n const parsedTypes = this.getTypesFromCallExpressionParameters(node);\n const tmpArgs = [];\n args.forEach((arg, index) => {\n const parsedType = parsedTypes[index];\n let cast = \"\";\n if (parsedType !== \"object\" && parsedType !== \"float\" && parsedType !== \"int\") {\n cast = parsedType ? `(${parsedType})` : '';\n }\n tmpArgs.push(cast + this.printNode(arg, identation).trim());\n });\n parsedArgs = tmpArgs.join(\",\");\n return parsedArgs;\n }\n return super.printArgsForCallExpression(node, identation);\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 return `new List(((IDictionary)${parsedArg}).Keys)`;\n }\n\n printObjectValuesCall(node, identation, parsedArg = undefined) {\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 return `((IList)${name}).Add(${parsedArg})`;\n }\n\n printIncludesCall(node, identation, name = undefined, parsedArg = undefined) {\n return `${name}.Contains(${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 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 return `String.Join(${parsedArg}, ((IList)${name}).ToArray())`;\n }\n\n printSplitCall(node, identation, name = undefined, parsedArg = undefined) {\n return `((string)${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 `((string)${name}).ToUpper()`;\n }\n\n printToLowerCaseCall(node, identation, name = undefined) {\n return `((string)${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 printAssertCall(node, identation, parsedArgs) {\n return `assert(${parsedArgs})`;\n }\n\n printSliceCall(node, identation, name = undefined, parsedArg = undefined, parsedArg2 = undefined) {\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 printReplaceCall(node, identation, name = undefined, parsedArg = undefined, parsedArg2 = undefined) {\n return `((string)${name}).Replace((string)${parsedArg}, (string)${parsedArg2})`;\n }\n\n printReplaceAllCall(node, identation, name = undefined, parsedArg = undefined, parsedArg2 = undefined) {\n return `((string)${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 TypeChecker).getTypeAtLocation(node.expression); // eslint-disable-line\n this.warnIfAnyType(node, type.flags, leftSide, \"length\");\n return this.isStringType(type.flags) ? `((string)${leftSide}).Length` : `${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 === ts.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 === ts.SyntaxKind.NumericLiteral) {\n return super.printPrefixUnaryExpression(node, identation);\n }\n if (operator === ts.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 === ts.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.printCondition(node.condition, 0);\n const whenTrue = this.printNode(node.whenTrue, 0);\n const whenFalse = this.printNode(node.whenFalse, 0);\n\n return `((bool) ${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 `((IDictionary)${object}).Remove((string)${key})`;\n }\n\n printNewExpression(node, identation) {\n let expression = node.expression?.escapedText;\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 === ts.SyntaxKind.Identifier) {\n return this.getIden(identation) + this.THROW_TOKEN + ' ' + this.printNode(node.expression, 0) + this.LINE_TERMINATOR;\n }\n if (node.expression.kind === ts.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 === ts.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.escapedText === 'Error' ? 'Exception' : id.escapedText;\n const symbol = this.getChecker().getSymbolAtLocation(expression.expression);\n if (symbol) {\n const declarations = this.getChecker().getDeclaredTypeOfSymbol(symbol).symbol?.declarations ?? [];\n const isClassDeclaration = declarations.find(l => l.kind === ts.SyntaxKind.InterfaceDeclaration || l.kind === ts.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.escapedText ? newExpression : idName} (${parsedArg}) ${this.LINE_TERMINATOR}`;\n } else if (expression.expression.kind === ts.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?.escapedText;\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 csModifiers = {\n\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) {\n if (node.type.kind === ts.SyntaxKind.AnyKeyword) {\n typeText = this.OBJECT_KEYWORD + ' ';\n }\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 ts, { BinaryExpression, CallExpression, TypeChecker } from 'typescript';\n\nconst SyntaxKind = ts.SyntaxKind;\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': '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': '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\nexport class GoTranspiler extends BaseTranspiler {\n\n binaryExpressionsWrappers;\n wrapThisCalls: boolean;\n wrapCallMethods: string[] = [];\n classNameMap: { [key: string]: string };\n DEFAULT_RETURN_TYPE = 'any';\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 }\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 [ts.SyntaxKind.EqualsEqualsToken]: [this.EQUALS_EQUALS_WRAPPER_OPEN, this.EQUALS_EQUALS_WRAPPER_CLOSE],\n [ts.SyntaxKind.EqualsEqualsEqualsToken]: [this.EQUALS_EQUALS_WRAPPER_OPEN, this.EQUALS_EQUALS_WRAPPER_CLOSE],\n [ts.SyntaxKind.ExclamationEqualsToken]: [this.DIFFERENT_WRAPPER_OPEN, this.DIFFERENT_WRAPPER_CLOSE],\n [ts.SyntaxKind.ExclamationEqualsEqualsToken]: [this.DIFFERENT_WRAPPER_OPEN, this.DIFFERENT_WRAPPER_CLOSE],\n [ts.SyntaxKind.GreaterThanToken]: [this.GREATER_THAN_WRAPPER_OPEN, this.GREATER_THAN_WRAPPER_CLOSE],\n [ts.SyntaxKind.GreaterThanEqualsToken]: [this.GREATER_THAN_EQUALS_WRAPPER_OPEN, this.GREATER_THAN_EQUALS_WRAPPER_CLOSE],\n [ts.SyntaxKind.LessThanToken]: [this.LESS_THAN_WRAPPER_OPEN, this.LESS_THAN_WRAPPER_CLOSE],\n [ts.SyntaxKind.LessThanEqualsToken]: [this.LESS_THAN_EQUALS_WRAPPER_OPEN, this.LESS_THAN_EQUALS_WRAPPER_CLOSE],\n [ts.SyntaxKind.PlusToken]: [this.PLUS_WRAPPER_OPEN, this.PLUS_WRAPPER_CLOSE],\n [ts.SyntaxKind.MinusToken]: [this.MINUS_WRAPPER_OPEN, this.MINUS_WRAPPER_CLOSE],\n [ts.SyntaxKind.AsteriskToken]: [this.MULTIPLY_WRAPPER_OPEN, this.MULTIPLY_WRAPPER_CLOSE],\n [ts.SyntaxKind.PercentToken]: [this.MOD_WRAPPER_OPEN, this.MOD_WRAPPER_CLOSE],\n [ts.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\n printPropertyDeclaration(node, identation) {\n // let modifiers = this.printModifiers(node);\n // modifiers = modifiers ? modifiers + \" \" : modifiers;\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 || (ts as any).isBooleanLiteral(node)) {\n type = 'bool';\n } else if (node.type.kind === SyntaxKind.ArrayType) {\n type = '[]any';\n }\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 return this.getIden(identation) + name + ' ' + type + ' ' + `\\`default:\"${initializer}\"\\`` + this.LINE_TERMINATOR;\n }\n return this.getIden(identation) + name + ' ' + type + this.LINE_TERMINATOR;\n }\n\n printStruct(node, indentation) {\n\n // check if we have heritage\n let heritageName = '';\n if (node?.heritageClauses?.length > 0) {\n const heritage = node.heritageClauses[0];\n const heritageType = heritage.types[0];\n let heritageEscapedText = heritageType.expression.escapedText;\n if (this.classNameMap[heritageEscapedText]) {\n heritageEscapedText = this.classNameMap[heritageEscapedText];\n }\n heritageName = this.getIden(indentation+1) + heritageEscapedText + '\\n';\n }\n\n const propDeclarations = node.members.filter(member => member.kind === SyntaxKind.PropertyDeclaration);\n return `type ${this.className} struct {\\n${heritageName}${propDeclarations.map(member => this.printNode(member, indentation+1)).join(\"\\n\")}\\n}`;\n }\n\n printNewStructMethod(node){\n return `\nfunc New${this.capitalize(this.className)}() *${(this.className)} {\n p := &${this.className}{}\n setDefaults(p)\n return 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.escapedText;\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 = methods.map(method => this.printMethodDeclaration(method, identation)).join(\"\\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 return struct + \"\\n\" + newMethod + \"\\n\" + classMethods;\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\n let methodDef = this.printMethodDefinition(node, identation);\n\n const isAsync = this.isAsyncFunction(node);\n\n const funcBody = this.printFunctionBody(node, identation, isAsync);\n\n methodDef += funcBody;\n\n return methodDef;\n }\n\n printFunctionDeclaration(node, identation) {\n if (ts.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 let functionDef = this.printFunctionDefinition(node, identation);\n const funcBody = this.printFunctionBody(node, identation, isAsync);\n functionDef += funcBody;\n\n return this.printNodeCommentsIfAny(node, identation, functionDef);\n }\n\n printMethodDefinition(node, identation) {\n let name = node.name.escapedText;\n name = this.transformMethodNameIfNeeded(name);\n\n let returnType = this.printFunctionType(node);\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) + returnType + methodToken + name\n // + \"(\" + parsedArgs + \")\";\n const structReceiver = `(${this.THIS_TOKEN} *${this.className})`;\n const methodDef = this.getIden(identation) + methodToken + \" \" + structReceiver + \" \" + name + \"(\" + parsedArgs + \") \" + returnType;\n\n return this.printNodeCommentsIfAny(node, identation, methodDef);\n }\n\n\n printFunctionDefinition(node, identation) {\n let name = node.name.escapedText;\n name = this.transformMethodNameIfNeeded(name);\n\n let returnType = this.printFunctionType(node);\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) + returnType + methodToken + name\n // + \"(\" + parsedArgs + \")\";\n const methodDef = this.getIden(identation) + methodToken + name + \"(\" + parsedArgs + \") \" + returnType;\n\n return this.printNodeCommentsIfAny(node, identation, methodDef);\n }\n\n printMethodParameters(node) {\n const params = node.parameters.map(param => this.printParameter(param));\n const hasOptionalParameter = params.some(p => p === 'optional');\n if (!hasOptionalParameter) {\n return params.join(\", \");\n }\n const paramsWithOptional = params.filter(param => param !== 'optional');\n paramsWithOptional.push('optionalArgs ...any');\n return paramsWithOptional.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) {\n if (initializer) {\n return 'optional'; // will be handled later\n }\n // not supported we have to find an alternative for go like defining multiple methods with different parameters\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 name + ' ' + type;\n }\n return name + ' ' + type;\n }\n\n printParameterType(node) {\n const typeText = this.getType(node);\n // // if (typeText === this.BOOLEAN_KEYWORD) {\n // // return typeText;\n // // }\n\n //tmp default to interface\n return 'any';\n\n if (typeText === this.STRING_KEYWORD) {\n return 'string';\n }\n if (typeText === this.NUMBER_KEYWORD) {\n return 'float64';\n }\n\n if (typeText === this.BOOLEAN_KEYWORD) {\n return 'bool';\n }\n\n return this.DEFAULT_PARAMETER_TYPE;\n\n if (typeText === undefined || typeText === this.STRING_KEYWORD) {\n // throw new FunctionReturnTypeError(\"Parameter type is not supported or undefined\");\n this.warn(node, node.getText(), \"Parameter type not found, will default to: \" + this.DEFAULT_PARAMETER_TYPE);\n return this.DEFAULT_PARAMETER_TYPE;\n }\n return typeText;\n\n }\n\n printFunctionType(node){\n const typeText = this.getFunctionType(node);\n if (typeText === 'void') {\n // // If the function is async (returns a Promise in TS) but declared void, emit a typed channel\n // if (this.isAsyncFunction(node)) {\n // // Ensure element type is present; some edge cases yield '<- chan' only\n // const elementType = this.DEFAULT_RETURN_TYPE || 'any';\n // return `<- chan ${elementType}`;\n // }\n return \"\";\n }\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 = `<- chan ${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 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 printVariableDeclarationList(node,identation) {\n const declaration = node.declarations[0];\n // const varToken = this.VAR_TOKEN ? this.VAR_TOKEN + \" \": \"\";\n // const name = declaration.name.escapedText;\n\n if (declaration?.name.kind === ts.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)}${syntheticName} := ${this.printNode(declaration.initializer, 0)};\\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) + `${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 (declaration?.initializer?.kind=== ts.SyntaxKind.AwaitExpression) {\n const parsedName = this.printNode(declaration.name, 0);\n const parsedInitializer = this.printNode(declaration.initializer, 0);\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 === ts.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 === ts.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 stm = this.getIden(identation) + \"var \" + varName + \" any = \" + parsedValue;\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?.escapedText;\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 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 (ts.isExpressionStatement(statement)) {\n const expression = statement.expression;\n if (ts.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 printThisElementAccesssIfNeeded(node, identation) {\n // convert this[method] into this.call(method) or this.callAsync(method)\n // const isAsync = node?.parent?.kind === ts.SyntaxKind.AwaitExpression;\n const isAsync = true; // setting to true for now, because there are some scenarios where we don't know\n // if the call is async or not, so we need to assume it is async\n // example Promise.all([this.unknownPropAsync()])\n const elementAccess = node.expression;\n if (elementAccess?.kind === ts.SyntaxKind.ElementAccessExpression) {\n if (elementAccess?.expression?.kind === ts.SyntaxKind.ThisKeyword) {\n let parsedArg = node.arguments?.length > 0 ? this.printNode(node.arguments[0], identation).trimStart() : \"\";\n const propName = this.printNode(elementAccess.argumentExpression, 0);\n const wrapperOpen = isAsync ? this.UKNOWN_PROP_ASYNC_WRAPPER_OPEN : this.UKNOWN_PROP_WRAPPER_OPEN;\n const wrapperClose = isAsync ? this.UNKOWN_PROP_ASYNC_WRAPPER_CLOSE : this.UNKOWN_PROP_WRAPPER_CLOSE;\n parsedArg = parsedArg ? \", \" + parsedArg : \"\";\n return wrapperOpen + propName + parsedArg + wrapperClose;\n }\n }\n return;\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 === ts.SyntaxKind.ElementAccessExpression) {\n const parsedArg = node.arguments?.length > 0 ? 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 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 = 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 let parsedArguments = node.arguments?.map((a) => this.printNode(a, 0)).join(\", \");\n parsedArguments = parsedArguments ? parsedArguments : \"\";\n const propName = node.expression?.name.escapedText;\n // const isAsyncDecl = true;\n // const isAsyncDecl = node?.parent?.kind === ts.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) {\n return this.capitalize(name);\n }\n\n transformPropertyAccessExpressionName(name: string) {\n return this.capitalize(name);\n }\n\n printOutOfOrderCallExpressionIfAny(node, identation) {\n if (node.expression.kind === ts.SyntaxKind.PropertyAccessExpression) {\n const args = node.arguments;\n\n if (node.expression.expression.kind === ts.SyntaxKind.ThisKeyword) {\n const methodName = this.printNode(node.expression.name, 0);\n if (this.wrapThisCalls || (this.wrapCallMethods.includes(methodName))) {\n let argsParsed = \"\";\n if (args.length > 0) {\n argsParsed = args.map((a) => this.printNode(a, 0)).join(\", \");\n return `<-this.callInternal(\"${methodName}\", ${argsParsed})`;\n }\n return `<-this.callInternal(\"${methodName}\")`;\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);\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 === ts.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 === ts.SyntaxKind.ExclamationEqualsEqualsToken || op === ts.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 + `IsObject(${target})`;\n case \"function\":\n return notOperator + `IsFunction(${target})`;\n }\n\n return undefined;\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 === ts.SyntaxKind.EqualsToken &&\n left.kind === ts.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) + `${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 // ---------------------------------------------------------------\n // Go-style setter for element-access assignments: a[b] = v\n // ---------------------------------------------------------------\n if (op === ts.SyntaxKind.EqualsToken &&\n left.kind === ts.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 (ts.isElementAccessExpression(cur)) {\n keys.unshift(cur.argumentExpression); // prepend\n const expr = cur.expression;\n if (!ts.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.\n let acc = containerStr;\n for (let i = 0; i < keyStrs.length - 1; i++) {\n acc = `${this.ELEMENT_ACCESS_WRAPPER_OPEN}${acc}, ${keyStrs[i]}${this.ELEMENT_ACCESS_WRAPPER_CLOSE}`;\n }\n\n const lastKey = keyStrs[keyStrs.length - 1];\n const rhs = this.printNode(right, 0);\n\n return `AddElementToObject(${acc}, ${lastKey}, ${rhs})`;\n }\n\n // ---------------------------------------------------------------\n // Go-style setter for element-access compound assignments: a[b] += v\n // ---------------------------------------------------------------\n if (op === ts.SyntaxKind.PlusEqualsToken &&\n left.kind === ts.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 (ts.isElementAccessExpression(cur)) {\n keys.unshift(cur.argumentExpression); // prepend\n const expr = cur.expression;\n if (!ts.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.\n let acc = containerStr;\n for (let i = 0; i < keyStrs.length - 1; i++) {\n acc = `${this.ELEMENT_ACCESS_WRAPPER_OPEN}${acc}, ${keyStrs[i]}${this.ELEMENT_ACCESS_WRAPPER_CLOSE}`;\n }\n\n const lastKey = keyStrs[keyStrs.length - 1];\n const rhs = this.printNode(right, 0);\n\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 result = `AddElementToObject(${acc}, ${lastKey}, Add(${currentValue}, ${rhs}))`;\n return result;\n }\n\n if (left.kind === ts.SyntaxKind.TypeOfExpression) {\n const typeOfExpression = this.handleTypeOfInsideBinaryExpression(node, identation);\n if (typeOfExpression) {\n return typeOfExpression;\n }\n }\n\n if (op === ts.SyntaxKind.InKeyword) {\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 === ts.SyntaxKind.PlusEqualsToken || op === ts.SyntaxKind.MinusEqualsToken || op in this.binaryExpressionsWrappers) {\n const leftText = this.printNode(left, 0);\n const rightText = this.printNode(right, 0);\n\n if (op === ts.SyntaxKind.PlusEqualsToken) {\n return `${leftText} = Add(${leftText}, ${rightText})`;\n }\n\n if (op === ts.SyntaxKind.MinusEqualsToken) {\n return `${leftText} = Subtract(${leftText}, ${rightText})`;\n }\n\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 // x = y\n // cast y to x type when y is unknown\n // if (op === ts.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 transformPropertyAcessExpressionIfNeeded(node) {\n const expression = node.expression;\n const leftSide = this.printNode(expression, 0);\n const rightSide = node.name.escapedText;\n\n let rawExpression = undefined;\n\n switch(rightSide) {\n case 'length':\n const type = (this.getChecker() as TypeChecker).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) ? `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 printCustomDefaultValueIfNeeded(node) {\n return undefined;\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 initParams.push(`${paramName} := GetArg(optionalArgs, ${index}, ${this.printNode(initializer, 0)})`);\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 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 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 => {\n // if (statement.kind === ts.SyntaxKind.ReturnStatement) {\n // if (statement?.expression) {\n // return this.getIden(identation) + \"ch <-\" + this.printNode(statement.expression) + '\\n' + this.getIden(identation) + \"return \" + this.printNode(statement.expression);\n // }\n // }\n return this.printNode(statement, identation);\n }).join(\"\\n\");\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 const functionBodySplit = functionBody.split(\"\\n\");\n const bodyWithIndentationExtraAndNoReturn = functionBodySplit.map((line) => {\n\n const trimmedLine = line.trim();\n\n // should we do this inside printReturn statement?\n // if(trimmedLine.startsWith(\"return\") && trimmedLine !== \"return\") {\n // const returnIndentation = line.indexOf(\"return\")/4 + this.getIden(1);\n // let channelReturn = this.getIden(returnIndentation) + \"ch <-\" + line.replace(\"return\", \"\").trimStart();\n // if (trimmedLine === \"return nil\") {\n // channelReturn = this.getIden(returnIndentation) + \"ch <- nil\\n\" + this.getIden(returnIndentation) + \"return nil\";\n // // it's hard because we don't want to remove the treturns from the emulated try-catches we have that are also functions\n // // with return statements\n // }\n // return channelReturn;\n // }\n return this.getIden(identation+2) + line;\n }).join(\"\\n\");\n let shouldAddLastReturn = true;\n\n // const bodySplit = bodyWithIndentationExtraAndNoReturn.split(\"\\n\");\n const bodySplit = functionBodySplit;\n const lastLine = bodySplit[bodySplit.length - 1];\n if (lastLine.trim().startsWith(\"return\") || lastLine.trim().startsWith(\"panic\")) {\n shouldAddLastReturn = false;\n }\n\n // Check if the function body ends with a conditional that has returns in all branches\n if (node.body && this.blockEndsWithConditionalReturn(node.body.statements)) {\n shouldAddLastReturn = false;\n }\n\n const lastReturn = shouldAddLastReturn ? this.getIden(identation+2) + \"return nil\" : \"\";\n // const hasCatchInside = bodySplit.indexOf(\"recover()\") > -1;\n // if ((1+1 == 2) || hasCatchInside) {\n functionBody = `{\n ${this.getIden(identation + 1)}ch := make(chan ${this.DEFAULT_RETURN_TYPE})\n ${this.getIden(identation + 1)}go func() any {\n ${this.getIden(identation + 2)}defer close(ch)\n ${this.getIden(identation + 2)}defer ReturnPanicError(ch)\n ${bodyWithIndentationExtraAndNoReturn}\n ${lastReturn}\n ${this.getIden(identation + 1)}}()\n ${this.getIden(identation + 1)}return ch\n ${this.getIden(identation)}}`;\n // } else {\n // functionBody = `{\n // ${id1}ch := make(chan ${this.DEFAULT_RETURN_TYPE})\n // ${id1}var panicError any = nil\n // ${id1}var wg sync.WaitGroup\n // ${id1}wg.Add(1)\n // ${id1}go func() any {\n // ${id2}defer wg.Done()\n // ${id2}defer close(ch)\n // ${id2}defer func() {\n // ${id3}if r := recover(); r != nil {\n // ${id4}panicError = r\n // ${id4}return\n // ${id3}}\n // ${id2}}()\n // ${bodySplit}\n // ${lastReturn}\n // ${id1}}()\n // ${id1}wg.Wait()\n // ${id1}if panicError != nil {\n // ${id2}panic(panicError)\n // ${id1}}\n // ${id1}return ch\n // ${id}}`;\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 getRandomNameSuffix() {\n return Math.floor(Math.random() * 1000000).toString();\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 === ts.SyntaxKind.AsExpression) {\n node = node.expression;\n }\n if (node.expression.kind !== ts.SyntaxKind.AwaitExpression) {\n return 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 const expStatement = `\n${this.getIden(identation)}${returnRandName} := ${exprStm}\n${this.getIden(identation)}PanicOnError(${returnRandName})`;\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 (ts.isFunctionDeclaration(currentNode) ||\n ts.isFunctionExpression(currentNode) ||\n ts.isArrowFunction(currentNode) ||\n ts.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 printReturnStatement(node, identation) {\n\n const isAsyncFunction = this.isInsideAsyncFunction(node);\n // if (node?.expression?.kind !== ts.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 if (node?.expression?.kind === ts.SyntaxKind.AsExpression) {\n node = node.expression;\n }\n\n if (node?.expression?.kind === ts.SyntaxKind.AwaitExpression) {\n // const returnRandName = \"retRes\" + this.getRandomNameSuffix();\n const returnRandName = \"retRes\" + this.getLineBasedSuffix(node.expression);\n rightPart = rightPart ? ' ' + rightPart + this.LINE_TERMINATOR : this.LINE_TERMINATOR;\n // return leadingComment + this.getIden(identation) + this.RETURN_TOKEN + rightPart + trailingComment;\n return `\n ${this.getIden(identation)}${returnRandName} := ${rightPart}\n ${this.getIden(identation)}PanicOnError(${returnRandName})\n ${this.getIden(identation)}${leadingComment}ch <- ${returnRandName}${trailingComment}\n ${this.getIden(identation)}return nil`;\n // ${this.getIden(identation)}return ${returnRandName}`;\n }\n\n if (rightPart.length === 0) {\n return `\\n${this.getIden(identation)}return nil`;\n }\n\n return `\n${this.getIden(identation)}${leadingComment}ch <- ${rightPart}${trailingComment}\n${this.getIden(identation)}return nil`;\n // ${this.getIden(identation)}return ${rightPart}`;\n // ${this.getIden(identation)}return ${rightPart}`;\n }\n\n\n printAsExpression(node, identation) {\n const type = node.type;\n\n if (type.kind === ts.SyntaxKind.AnyKeyword) {\n // return `(()${this.printNode(node.expression, identation)})`;\n }\n\n if (type.kind === ts.SyntaxKind.StringKeyword) {\n // return `((string)${this.printNode(node.expression, identation)})`;\n }\n\n if (type.kind === ts.SyntaxKind.ArrayType) {\n // if (type.elementType.kind === ts.SyntaxKind.AnyKeyword) {\n // return `(IList)(${this.printNode(node.expression, identation)})`;\n // }\n // if (type.elementType.kind === ts.SyntaxKind.StringKeyword) {\n // return `(IList)(${this.printNode(node.expression, identation)})`;\n // }\n }\n\n return this.printNode(node.expression, identation);\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) => {\n return this.printNode(e);\n }).join(\", \");\n\n // take into consideration list of promises\n if (elems.length > 0) {\n const first = elems[0];\n if (first.kind === ts.SyntaxKind.CallExpression) {\n // const type = this.getChecker().getTypeAtLocation(first);\n const type = this.getFunctionType(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 = \"[]any{\";\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 = `[]any{`;\n }\n }\n }\n\n return arrayOpen + elements + this.ARRAY_CLOSING_TOKEN;\n }\n\n printArgsForCallExpression(node, identation) {\n const args = node.arguments;\n let parsedArgs = \"\";\n if (false && this.requiresCallExpressionCast && !this.isBuiltInFunctionCall(node?.expression)) { //eslint-disable-line\n const parsedTypes = this.getTypesFromCallExpressionParameters(node);\n const tmpArgs = [];\n args.forEach((arg, index) => {\n const parsedType = parsedTypes[index];\n let cast = \"\";\n if (parsedType !== \"object\" && parsedType !== \"float\" && parsedType !== \"int\") {\n cast = parsedType ? `(${parsedType})` : '';\n }\n tmpArgs.push(cast + this.printNode(arg, identation).trim());\n });\n parsedArgs = tmpArgs.join(\",\");\n return parsedArgs;\n }\n return super.printArgsForCallExpression(node, identation);\n }\n\n // check this out later\n\n printArrayIsArrayCall(node, identation, parsedArg = undefined) {\n return `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 printArrayPushCall(node: CallExpression, identation: number, name: string | undefined = undefined, parsedArg: string | undefined = undefined) {\n let returnValue = '';\n let returnRandName = name;\n if (name?.startsWith('GetValue')) {\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 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 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 printConcatCall(node, identation, name = undefined, parsedArg = undefined) {\n return `Concat(${name}, ${parsedArg})`;\n }\n\n printToUpperCaseCall(node, identation, name = undefined) {\n return `ToUpper(${name})`;\n }\n\n printToLowerCaseCall(node, identation, name = undefined) {\n return `ToLower(${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 `assert(${parsedArgs})`;\n }\n\n printSliceCall(node, identation, name = undefined, parsedArg = undefined, parsedArg2 = undefined) {\n if (parsedArg2 === undefined){\n // return `((string)${name}).Substring((int)${parsedArg})`;\n parsedArg2 = 'nil';\n }\n // return `((string)${name})[((int)${parsedArg})..((int)${parsedArg2})]`;\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 `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 TypeChecker).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 === ts.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 === ts.SyntaxKind.NumericLiteral) {\n // return super.printPrefixUnaryExpression(node, identation);\n // }\n // if (operator === ts.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 === ts.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.printCondition(node.condition, 0);\n const whenTrue = this.printNode(node.whenTrue, 0);\n const whenFalse = this.printNode(node.whenFalse, 0);\n\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 === ts.SyntaxKind.Identifier) {\n return this.getIden(identation) + 'panic(' + this.printNode(node.expression, 0) + ')' + this.LINE_TERMINATOR;\n }\n if (node.expression.kind === ts.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 === ts.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).symbol?.declarations ?? [];\n const isClassDeclaration = declarations.find(l => l.kind === ts.SyntaxKind.InterfaceDeclaration || l.kind === ts.SyntaxKind.ClassDeclaration);\n if (isClassDeclaration){\n // return this.getIden(identation) + `${this.THROW_TOKEN} ${this.NEW_TOKEN} ${id.escapedText} ((string)${parsedArg}) ${this.LINE_TERMINATOR}`;\n } else {\n return this.getIden(identation) + `throwDynamicException(${id.escapedText}, ${parsedArg});return nil;`;\n }\n }\n return this.getIden(identation) + `panic(${id.escapedText}(${parsedArg}))${this.LINE_TERMINATOR}`;\n } else if (expression.expression.kind === ts.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?.escapedText;\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 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 == ts.SyntaxKind.InstanceOfKeyword) {\n return this.printInstanceOfExpression(node, identation);\n }\n\n if (operatorToken.kind === ts.SyntaxKind.EqualsToken) {\n // handle test['a'] = 1;\n const elementAccess = left;\n const rightSide = this.printNode(right, 0);\n if (left.kind === ts.SyntaxKind.ElementAccessExpression) {\n const leftSide = this.printNode(elementAccess.expression, 0);\n const propName = this.printNode(elementAccess.argumentExpression, 0);\n return `AddElementToObject(${leftSide}, ${propName}, ${rightSide})`;\n }\n\n if (right?.kind === ts.SyntaxKind.AwaitExpression || rightSide.startsWith('<-this.callInternal')) {\n const leftParsed = this.printNode(left, 0);\n return `\n ${leftParsed} = ${rightSide}\n ${this.getIden(identation)}PanicOnError(${leftParsed})`;\n }\n }\n\n const op = operatorToken.kind;\n // handle: [x,d] = this.method()\n if (op === ts.SyntaxKind.EqualsToken && left.kind === ts.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) + `${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 let operator = this.SupportedKindNames[operatorToken.kind];\n\n\n let leftVar = undefined;\n let rightVar = undefined;\n\n // c# wrapper\n if (operatorToken.kind === ts.SyntaxKind.EqualsEqualsToken || operatorToken.kind === ts.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 === ts.SyntaxKind.BarBarToken || operatorToken.kind === ts.SyntaxKind.AmpersandAmpersandToken) {\n leftVar = this.printCondition(left, 0);\n rightVar = this.printCondition(right, identation);\n } else {\n leftVar = this.printNode(left, 0);\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 leftVar +\" \"+ operator + \" \" + rightVar.trim();\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 catchLines = catchBody.split(\"\\n\").map(l => l.trim()).filter(Boolean);\n const catchLastLine = catchLines.length ? catchLines[catchLines.length - 1] : \"\";\n const catchBodyEndsWithReturn = catchLastLine.startsWith(\"return\")\n || catchLastLine.startsWith(\"panic\")\n || catchLastLine.startsWith(\"throw new\")\n || this.blockEndsWithConditionalReturn(node.catchClause.block.statements);\n\n const tryLines = tryBody.split(\"\\n\").map(l => l.trim()).filter(Boolean);\n const tryLastLine = tryLines.length ? tryLines[tryLines.length - 1] : \"\";\n const tryBodyEndsWithReturn = tryLastLine.startsWith(\"return\")\n || tryLastLine.startsWith(\"panic\")\n || tryLastLine.startsWith(\"throw new\")\n || this.blockEndsWithConditionalReturn(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.escapedText;\n const classPrefix = this.className !== 'undefined' ? `(this *${this.className})` : \"()\";\n const thisWord = this.className !== 'undefined' ? \"this\" : \"\";\n const catchBlock =`\n {\n ${nodeEndsWithReturn ? 'ret__ :=' : ''} func${classPrefix} (ret_ any) {\n\t\t defer func() {\n if ${errorName} := recover(); ${errorName} != nil {\n if ${errorName} == \"break\" {\n return\n }\n ret_ = func${classPrefix} any {\n // catch block:\n ${catchBody}\n ${catchBodyEndsWithReturn ? \"\" : returNil}\n }(${thisWord})\n }\n }()\n\t\t // try block:\n ${tryBody}\n\t\t ${tryBodyEndsWithReturn ? \"\" : returNil}\n\t }(${thisWord})\n ${nodeEndsWithReturn\n ? `\n if ret__ != nil {\n return ret__\n }\n return nil`\n : ''}\n }`;\n // add identation\n const indentedBlock = catchBlock.split(\"\\n\").map((line) => this.getIden(identation) + line).join(\"\\n\");\n // const catchCondOpen = this.CONDITION_OPENING ? this.CONDITION_OPENING : \" \";\n\n return indentedBlock;\n }\n\n printPrefixUnaryExpression(node, identation) {\n const {operand, operator} = node;\n if (operator === ts.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 === ts.SyntaxKind.MinusToken) {\n return this.getIden(identation) + `OpNeg(${this.printNode(node.operand, 0)})`;\n }\n return this.getIden(identation) + this.PrefixFixOperators[operator] + this.printNode(operand, 0);\n }\n\n printNewExpression(node, identation) {\n let expression = node.expression?.escapedText;\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 const args = node.arguments.map(n => this.printNode(n, identation)).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 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 (ts.isElementAccessExpression(current)) {\n keys.unshift(current.argumentExpression); // prepend\n const expr = current.expression;\n if (!ts.isElementAccessExpression(expr)) {\n // Reached the base container.\n baseExpr = expr;\n break;\n }\n current = expr;\n }\n\n const containerStr = this.printNode(baseExpr, 0);\n const keyStrs = keys.map(k => this.printNode(k, 0));\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 return acc;\n }\n\n isInsideVoidFunction(node: ts.Node): boolean {\n for (let cur = node.parent; cur; cur = cur.parent) {\n if (ts.isFunctionLike(cur)) {\n return cur.type === undefined || cur.type.kind === ts.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: ts.Statement): boolean {\n if (ts.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 (ts.isReturnStatement(statement)) {\n return true;\n } else if (ts.isThrowStatement(statement)) {\n return true;\n } else if (ts.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 (ts.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: ts.NodeArray): boolean {\n if (statements.length === 0) {\n return false;\n }\n\n const lastStatement = statements[statements.length - 1];\n if (ts.isIfStatement(lastStatement)) {\n // Check if this if statement has returns in all branches (only if it has an else)\n const ifHasReturn = this.hasReturnInBlock(lastStatement.thenStatement);\n if (lastStatement.elseStatement) {\n const elseHasReturn = this.hasReturnInBlock(lastStatement.elseStatement);\n return ifHasReturn && elseHasReturn;\n }\n }\n if (ts.isTryStatement(lastStatement)) {\n // Check if this try statement has returns in both try and catch blocks\n const tryHasReturn = this.hasReturnInBlock(lastStatement.tryBlock);\n const catchHasReturn = this.hasReturnInBlock(lastStatement.catchClause.block);\n return tryHasReturn && catchHasReturn;\n }\n return false;\n }\n\n\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\n","import { BaseTranspiler } from \"./baseTranspiler.js\";\nimport ts, { TypeChecker } from \"typescript\";\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\nexport class JavaTranspiler extends BaseTranspiler {\n binaryExpressionsWrappers;\n\n varListFromObjectLiterals = {};\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; escapedText: any; ownGetFullText: boolean; getFullText: any }> = [];\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 }\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 = {\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.binaryExpressionsWrappers = {\n [ts.SyntaxKind.EqualsEqualsToken]: [\n this.EQUALS_EQUALS_WRAPPER_OPEN,\n this.EQUALS_EQUALS_WRAPPER_CLOSE,\n ],\n [ts.SyntaxKind.EqualsEqualsEqualsToken]: [\n this.EQUALS_EQUALS_WRAPPER_OPEN,\n this.EQUALS_EQUALS_WRAPPER_CLOSE,\n ],\n [ts.SyntaxKind.ExclamationEqualsToken]: [\n this.DIFFERENT_WRAPPER_OPEN,\n this.DIFFERENT_WRAPPER_CLOSE,\n ],\n [ts.SyntaxKind.ExclamationEqualsEqualsToken]: [\n this.DIFFERENT_WRAPPER_OPEN,\n this.DIFFERENT_WRAPPER_CLOSE,\n ],\n [ts.SyntaxKind.GreaterThanToken]: [\n this.GREATER_THAN_WRAPPER_OPEN,\n this.GREATER_THAN_WRAPPER_CLOSE,\n ],\n [ts.SyntaxKind.GreaterThanEqualsToken]: [\n this.GREATER_THAN_EQUALS_WRAPPER_OPEN,\n this.GREATER_THAN_EQUALS_WRAPPER_CLOSE,\n ],\n [ts.SyntaxKind.LessThanToken]: [\n this.LESS_THAN_WRAPPER_OPEN,\n this.LESS_THAN_WRAPPER_CLOSE,\n ],\n [ts.SyntaxKind.LessThanEqualsToken]: [\n this.LESS_THAN_EQUALS_WRAPPER_OPEN,\n this.LESS_THAN_EQUALS_WRAPPER_CLOSE,\n ],\n [ts.SyntaxKind.PlusToken]: [\n this.PLUS_WRAPPER_OPEN,\n this.PLUS_WRAPPER_CLOSE,\n ],\n [ts.SyntaxKind.MinusToken]: [\n this.MINUS_WRAPPER_OPEN,\n this.MINUS_WRAPPER_CLOSE,\n ],\n [ts.SyntaxKind.AsteriskToken]: [\n this.MULTIPLY_WRAPPER_OPEN,\n this.MULTIPLY_WRAPPER_CLOSE,\n ],\n [ts.SyntaxKind.PercentToken]: [\n this.MOD_WRAPPER_OPEN,\n this.MOD_WRAPPER_CLOSE,\n ],\n [ts.SyntaxKind.SlashToken]: [\n this.DIVIDE_WRAPPER_OPEN,\n this.DIVIDE_WRAPPER_CLOSE,\n ],\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.escapedText);\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.escapedText;\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 // 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 === ts.SyntaxKind.NewExpression;\n const isInsideCatch =\n node?.parent?.kind === ts.SyntaxKind.ThrowStatement;\n const isLeftSide =\n node?.parent?.name === node || node?.parent?.left === node;\n const isCallOrPropertyAccess =\n node?.parent?.kind === ts.SyntaxKind.PropertyAccessExpression ||\n node?.parent?.kind === ts.SyntaxKind.ElementAccessExpression;\n if (!isLeftSide && !isCallOrPropertyAccess && !isInsideCatch && !isInsideNewExpression) {\n const type = this.getChecker().getTypeAtLocation(node);\n const typeSymbol = type?.symbol;\n if (typeSymbol !== undefined) {\n const decl = typeSymbol?.declarations ?? [];\n let isBuiltIn = undefined;\n if (decl.length > 0) {\n isBuiltIn =\n decl[0].getSourceFile().fileName.indexOf(\"typescript\") > -1;\n }\n\n if (isBuiltIn !== undefined && !isBuiltIn) {\n const symbol = this.getChecker().getSymbolAtLocation(node);\n let isClassDeclaration = false;\n if (symbol) {\n const first = symbol.declarations[0];\n if (first.kind === ts.SyntaxKind.ClassDeclaration) {\n isClassDeclaration = true;\n }\n if (first.kind === ts.SyntaxKind.ImportSpecifier) {\n const importedSymbol = this.getChecker().getAliasedSymbol(symbol);\n if (\n importedSymbol?.declarations[0]?.kind ===\n ts.SyntaxKind.ClassDeclaration\n ) {\n isClassDeclaration = true;\n }\n }\n }\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 if (ts.isExpressionStatement(statement)) {\n const expression = statement.expression;\n if (ts.isCallExpression(expression)) {\n const expressionText = expression.expression.getText().trim();\n if (expressionText === \"super\") {\n hasSuperCall = true;\n superCallParams = expression.arguments\n .map((a) => {\n return this.printNode(a, identation).trim();\n })\n .join(\", \");\n }\n }\n }\n });\n\n const header =\n this.getIden(identation) + className + \"(\" + args + \")\";\n if (!hasSuperCall) {\n return header + constructorBody;\n }\n // In Java, super(...) must be the first statement inside the body.\n const injected = this.injectLeadingInBody(constructorBody, `super(${superCallParams});`);\n return header + injected;\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 === ts.SyntaxKind.ElementAccessExpression) {\n const parsedArg =\n node.arguments?.length > 0\n ? node.arguments\n .map((n) => this.printNode(n, identation).trimStart())\n .join(\", \")\n : \"\";\n const target = this.printNode(elementAccess.expression, 0);\n const propName = this.printNode(elementAccess.argumentExpression, 0);\n const argsArray = `new Object[] { ${parsedArg} }`;\n const open = this.DYNAMIC_CALL_OPEN;\n return `${open}${target}, ${propName}, ${argsArray})`;\n }\n return undefined;\n }\n\n getExpressionStatementPrefixesIfAny(node, identation) {\n // return undefined;\n const finalVars = [];\n if (node.expression?.kind === ts.SyntaxKind.CallExpression) {\n const objectLiterals = this.getObjectLiteralFromCallExpressionArguments(node.expression);\n for (let i = 0; i < objectLiterals.length; i++) {\n const objLiteral = objectLiterals[i];\n const objVariables = this.getVarListFromObjectLiteralAndUpdateInPlace(objLiteral);\n if (objVariables.length > 0) {\n finalVars.push(...objVariables);\n }\n }\n\n if (finalVars.length > 0) {\n const decls = this.buildFinalVarDeclarations(finalVars, identation);\n if (decls) {\n return decls + \"\\n\" + this.getIden(identation);\n }\n }\n }\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 let parsedArguments = node.arguments\n ?.map((a) => this.printNode(a, 0))\n .join(\", \");\n parsedArguments = parsedArguments ? parsedArguments : \"\";\n const propName = node.expression?.name.escapedText;\n const isAsyncDecl = node?.parent?.kind === ts.SyntaxKind.AwaitExpression;\n const argsArray = `new Object[] { ${parsedArguments} }`;\n const open = this.DYNAMIC_CALL_OPEN;\n const statement = `${open}this, \"${propName}\", ${argsArray})`;\n // If your Java runtime returns CompletableFuture, you can await it where appropriate.\n return statement;\n }\n return undefined;\n }\n\n printOutOfOrderCallExpressionIfAny(node, identation) {\n if (node.expression.kind === ts.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(Helpers.toString(${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 `Helpers.mathMin(${parsedArg1}, ${parsedArg2})`;\n case \"Math.max\":\n return `Helpers.mathMax(${parsedArg1}, ${parsedArg2})`;\n case \"Math.pow\":\n return `Helpers.mathPow(Double.parseDouble(Helpers.toString(${parsedArg1})), Double.parseDouble(Helpers.toString(${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 === ts.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 === ts.SyntaxKind.ExclamationEqualsEqualsToken ||\n op === ts.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 (ts.isMethodDeclaration(current) || ts.isFunctionDeclaration(current)) {\n return String((current.name as any)?.escapedText ?? '');\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 (ts.isClassDeclaration(current)) {\n return String((current.name as any)?.escapedText ?? '');\n }\n current = current.parent;\n }\n return '';\n }\n\n getVarKey(node) {\n\n const varName = node?.escapedText ?? node?.name?.escapedText;\n if (!varName) {\n return '';\n }\n return `${this.getVarClassIfAny(node)}-${this.getVarMethodIfAny(node)}-${varName}`;\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 === ts.SyntaxKind.Identifier) {\n this.ReassignedVars[this.getVarKey(left)] = true;\n }\n\n if (left.kind === ts.SyntaxKind.TypeOfExpression) {\n const typeOfExpression = this.handleTypeOfInsideBinaryExpression(\n node,\n identation\n );\n if (typeOfExpression) return typeOfExpression;\n }\n\n // destructuring: [a,b] = this.method()\n if (\n op === ts.SyntaxKind.EqualsToken &&\n left.kind === ts.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 const statement =\n this.getIden(identation) +\n `${e} = ((java.util.List) ${syntheticName}).get(${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 // setter for element-access assignments: a[b] = v\n // ---------------------------------------------------------------\n if (op === ts.SyntaxKind.EqualsToken &&\n left.kind === ts.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 (ts.isElementAccessExpression(cur)) {\n keys.unshift(cur.argumentExpression); // prepend\n const expr = cur.expression;\n if (!ts.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.\n let acc = containerStr;\n for (let i = 0; i < keyStrs.length - 1; i++) {\n acc = `${this.ELEMENT_ACCESS_WRAPPER_OPEN}${acc}, ${keyStrs[i]}${this.ELEMENT_ACCESS_WRAPPER_CLOSE}`;\n }\n\n let prefixes = this.getBinaryExpressionPrefixes(node, identation);\n prefixes = prefixes ? prefixes : \"\";\n\n\n const lastKey = keyStrs[keyStrs.length - 1];\n const rhs = this.printNode(right, 0);\n\n\n\n return `${prefixes}Helpers.addElementToObject(${acc}, ${lastKey}, ${rhs})`;\n }\n\n if (op === ts.SyntaxKind.InKeyword) {\n return `Helpers.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 === ts.SyntaxKind.PlusEqualsToken || op === ts.SyntaxKind.MinusEqualsToken || op in this.binaryExpressionsWrappers) {\n const leftText = this.printNode(left, 0);\n const rightText = this.printNode(right, 0);\n\n if (op === ts.SyntaxKind.PlusEqualsToken) {\n return `${leftText} = Helpers.add(${leftText}, ${rightText})`;\n }\n\n if (op === ts.SyntaxKind.MinusEqualsToken) {\n return `${leftText} = Helpers.subtract(${leftText}, ${rightText})`;\n }\n\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\n getObjectLiteralFromCallExpressionArguments(node) {\n const res = [];\n if (!node?.arguments) {\n return res;\n }\n const args = node.arguments;\n\n for (let i = 0; i < args.length; i++) {\n const arg = args[i];\n if (arg.kind === ts.SyntaxKind.ObjectLiteralExpression) {\n res.push(arg);\n } else if (arg.kind === ts.SyntaxKind.CallExpression) {\n const innerCallExp = arg;\n const innerObjLiterals = this.getObjectLiteralFromCallExpressionArguments(innerCallExp);\n res.push(...innerObjLiterals);\n }\n }\n return res;\n }\n\n // Finds every ObjectLiteralExpression nested anywhere inside an RHS/initializer\n // expression that would produce an anonymous-inner-class capture in Java\n // (HashMap double-brace init). Stops descending at each ObjectLiteralExpression\n // because nested literals are walked recursively inside\n // getVarListFromObjectLiteralAndUpdateInPlace. Skips function/arrow bodies so\n // we don't capture literals that evaluate in a different scope.\n //\n // Unifies the previously-narrow matching in printVariableDeclarationList and\n // getBinaryExpressionPrefixes which only handled ObjectLiteralExpression or\n // CallExpression directly — missing wrappers like AwaitExpression,\n // ParenthesizedExpression, NewExpression, and ConditionalExpression.\n collectCapturingObjectLiterals(node): any[] {\n const found = [];\n const walk = (n) => {\n if (!n) return;\n if (n.kind === ts.SyntaxKind.ObjectLiteralExpression) {\n found.push(n);\n return;\n }\n if (n.kind === ts.SyntaxKind.FunctionExpression ||\n n.kind === ts.SyntaxKind.ArrowFunction ||\n n.kind === ts.SyntaxKind.MethodDeclaration ||\n n.kind === ts.SyntaxKind.FunctionDeclaration) {\n return;\n }\n ts.forEachChild(n, walk);\n };\n walk(node);\n return found;\n }\n\n getBinaryExpressionPrefixes(node, identation) {\n let right = node?.right;\n if (right?.kind === ts.SyntaxKind.AwaitExpression) {\n // un pack await this.x() to this.x(), we don't care about await here\n right = right.expression;\n }\n if (!right) {\n return undefined;\n }\n if (right.kind === ts.SyntaxKind.ObjectLiteralExpression) {\n const objVariables = this.getVarListFromObjectLiteralAndUpdateInPlace(right);\n if (objVariables.length > 0) {\n const decls = this.buildFinalVarDeclarations(objVariables, identation);\n if (decls) {\n return decls + \"\\n\" + this.getIden(identation);\n }\n }\n } else if (right.kind === ts.SyntaxKind.CallExpression) {\n // search arguments recursively for object literals\n // eg: a[x] = this.extend(this.extend(this.extend({'a':b}, c)))\n const objectLiterals = this.getObjectLiteralFromCallExpressionArguments(right);\n if (objectLiterals.length > 0) {\n const allVars = [];\n for (let i = 0; i < objectLiterals.length; i++) {\n const objLiteral = objectLiterals[i];\n const objVariables = this.getVarListFromObjectLiteralAndUpdateInPlace(objLiteral);\n allVars.push(...objVariables);\n }\n if (allVars.length > 0) {\n const decls = this.buildFinalVarDeclarations(allVars, identation);\n if (decls) {\n return decls + \"\\n\" + this.getIden(identation);\n }\n }\n }\n }\n return undefined;\n }\n\n getFinalVarName(varName: string): string {\n if (this.ReservedKeywordsReplacements[varName]) {\n varName = this.ReservedKeywordsReplacements[varName];\n }\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: ts.SyntaxKind): boolean {\n return op === ts.SyntaxKind.EqualsToken ||\n op === ts.SyntaxKind.PlusEqualsToken ||\n op === ts.SyntaxKind.MinusEqualsToken ||\n op === ts.SyntaxKind.AsteriskEqualsToken ||\n op === ts.SyntaxKind.AsteriskAsteriskEqualsToken ||\n op === ts.SyntaxKind.SlashEqualsToken ||\n op === ts.SyntaxKind.PercentEqualsToken ||\n op === ts.SyntaxKind.LessThanLessThanEqualsToken ||\n op === ts.SyntaxKind.GreaterThanGreaterThanEqualsToken ||\n op === ts.SyntaxKind.GreaterThanGreaterThanGreaterThanEqualsToken ||\n op === ts.SyntaxKind.AmpersandEqualsToken ||\n op === ts.SyntaxKind.BarEqualsToken ||\n op === ts.SyntaxKind.CaretEqualsToken ||\n op === ts.SyntaxKind.BarBarEqualsToken ||\n op === ts.SyntaxKind.AmpersandAmpersandEqualsToken ||\n op === ts.SyntaxKind.QuestionQuestionEqualsToken;\n }\n\n private isIncDecOperator(op: ts.SyntaxKind): boolean {\n return op === ts.SyntaxKind.PlusPlusToken || op === ts.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: ts.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] ?? sym?.valueDeclaration;\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.escapedText}`;\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 === ts.SyntaxKind.BinaryExpression) {\n if (node.left?.kind === ts.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 === ts.SyntaxKind.EqualsToken &&\n node.left?.kind === ts.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 === ts.SyntaxKind.Identifier) {\n reassignedSyms.add(symbolIdOf(elem));\n }\n }\n }\n }\n if ((node.kind === ts.SyntaxKind.PrefixUnaryExpression ||\n node.kind === ts.SyntaxKind.PostfixUnaryExpression) &&\n this.isIncDecOperator(node.operator) &&\n node.operand?.kind === ts.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 === ts.SyntaxKind.Identifier) {\n const name = node.escapedText 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 ts.forEachChild(node, 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: ts.Node };\n const events: Event[] = [];\n\n const visitExprInObjLit = (n: any) => {\n if (!n) return;\n if (n.kind === ts.SyntaxKind.Identifier) {\n const name = n.escapedText 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 === ts.SyntaxKind.BinaryExpression) {\n visitExprInObjLit(n.left);\n visitExprInObjLit(n.right);\n return;\n }\n if (n.kind === ts.SyntaxKind.ParenthesizedExpression) {\n visitExprInObjLit(n.expression);\n return;\n }\n if (n.kind === ts.SyntaxKind.ConditionalExpression) {\n visitExprInObjLit(n.condition);\n visitExprInObjLit(n.whenTrue);\n visitExprInObjLit(n.whenFalse);\n return;\n }\n if (n.kind === ts.SyntaxKind.CallExpression) {\n n.arguments?.forEach(visitExprInObjLit);\n if (n.expression?.kind === ts.SyntaxKind.PropertyAccessExpression) {\n visitExprInObjLit(n.expression.expression);\n }\n return;\n }\n if (n.kind === ts.SyntaxKind.PrefixUnaryExpression) {\n visitExprInObjLit(n.operand);\n return;\n }\n if (n.kind === ts.SyntaxKind.ElementAccessExpression) {\n let left = n.expression;\n while (left?.kind === ts.SyntaxKind.ElementAccessExpression) {\n left = left.expression;\n }\n visitExprInObjLit(left);\n visitExprInObjLit(n.argumentExpression);\n return;\n }\n if (n.kind === ts.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 ts.forEachChild(n, visitExprInObjLit);\n };\n\n const walk = (node: any) => {\n if (!node) return;\n\n if (node.kind === ts.SyntaxKind.BinaryExpression &&\n this.isAssignmentOperator(node.operatorToken.kind)) {\n walk(node.right);\n if (node.left?.kind === ts.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 === ts.SyntaxKind.PrefixUnaryExpression ||\n node.kind === ts.SyntaxKind.PostfixUnaryExpression) &&\n this.isIncDecOperator(node.operator) &&\n node.operand?.kind === ts.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 === ts.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: ts.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 === ts.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 === ts.SyntaxKind.TryStatement) {\n walkBlockAndBump(node.tryBlock);\n walkBlockAndBump(node.catchClause?.block);\n walkBlockAndBump(node.finallyBlock);\n return;\n }\n\n ts.forEachChild(node, 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 if (versions.length === 1) {\n for (const n of byVer.get(versions[0])!) {\n this.usageToFinalName.set(n, baseName);\n }\n } else {\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\n private finalNameInAncestorScope(finalName: string): boolean {\n for (const scope of this.finalVarScopeStack) {\n if (scope.has(finalName)) return true;\n }\n return false;\n }\n\n buildFinalVarDeclarations(pairs: Array<{ orig: string; final: string }>, identation: number): string {\n if (pairs.length === 0) return '';\n const current = this.finalVarScopeStack.length > 0\n ? this.finalVarScopeStack[this.finalVarScopeStack.length - 1]\n : null;\n const lines: string[] = [];\n const seenHere = new Set();\n for (const p of pairs) {\n if (seenHere.has(p.final)) continue;\n if (this.finalNameInAncestorScope(p.final)) continue;\n seenHere.add(p.final);\n if (current) current.add(p.final);\n const indent = lines.length === 0 ? 0 : identation;\n // The RHS must use the remapped Java name (e.g. `params` → `parameters`,\n // `internal` → `intern`) since the original TS identifier doesn't exist\n // in the generated Java code.\n lines.push(`${this.getIden(indent)}final Object ${p.final} = ${this.getOriginalVarName(p.orig)};`);\n }\n return lines.join('\\n');\n }\n\n getObjectLiteralId(node): string {\n const start = node.getStart();\n const end = node.getEnd();\n // Qualify with the file: the offsets alone collide between two files whose\n // object literals happen to sit at the same character range.\n const fileName = node.getSourceFile?.()?.fileName ?? '';\n return `${fileName}:${start}-${end}`;\n }\n\n // Remember an identifier's pre-rewrite state so restoreFinalVarMutations can put\n // the shared AST back exactly as it was parsed.\n recordFinalVarMutation(node: any): void {\n this.finalVarMutations.push({\n node,\n escapedText: node.escapedText,\n ownGetFullText: Object.prototype.hasOwnProperty.call(node, 'getFullText'),\n getFullText: node.getFullText,\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 mutation.node.escapedText = mutation.escapedText;\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 === ts.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 createNewNodeForFinalVar(originalName: string): ts.Identifier {\n const newNode = ts.factory.createIdentifier(this.getFinalVarName(originalName));\n newNode.getFullText = () => this.getFinalVarName(originalName);\n return newNode;\n }\n\n getVarListFromObjectLiteralAndUpdateInPlace(node): Array<{ orig: string; final: string }> {\n // in java if we use an anonymous object literal put, we can't refer non final variables\n // so here we collect them and then we add the wrapper final variables, eg: finalX = X;\n // and we update the node in place to use finalX instead of X.\n // The final name comes from analyzeFinalVars (pre-walk), which assigns\n // version-aware names so reassignment-between-usages produces distinct finals.\n let res: Array<{ orig: string; final: string }> = [];\n\n const nodeId = this.getObjectLiteralId(node);\n\n if (nodeId in this.varListFromObjectLiterals) {\n return this.varListFromObjectLiterals[nodeId];\n }\n\n const finalNameFor = (n: any, origName: string): string => {\n return this.usageToFinalName.get(n) ?? this.getFinalVarName(origName);\n };\n\n // Walks any expression, rewriting reassigned-var Identifiers to their\n // finalXxx names in place. We rely on ts.forEachChild for traversal so\n // every node kind (PrefixUnary, PostfixUnary, ElementAccess,\n // PropertyAccess, BinaryExpression, ConditionalExpression, CallExpression,\n // ParenthesizedExpression, etc.) is covered uniformly. ObjectLiteral is\n // delegated back to the parent function so per-objectLiteral nodeId\n // dedup applies to nested literals too.\n const traverseAndReplace = (n) => {\n if (!n) return;\n if (n.kind === ts.SyntaxKind.Identifier) {\n const name = n.escapedText as string | undefined;\n if (name && name !== 'undefined' && !name.startsWith('null')) {\n // Prefer analyzeFinalVars' pre-walk result (usageToFinalName):\n // it knows about reassignments anywhere in the function body,\n // including ones that happen AFTER this object literal in\n // source order. ReassignedVars is populated as BinaryExpressions\n // are printed, so for a forward reference it is still false at\n // this point and would miss the shadow.\n const isReassignedAhead = this.usageToFinalName.has(n);\n if (isReassignedAhead || this.ReassignedVars[this.getVarKey(n)]) {\n const finalName = finalNameFor(n, name);\n res.push({ orig: name, final: finalName });\n this.recordFinalVarMutation(n);\n n.escapedText = finalName;\n // Some downstream print paths read from getFullText (which\n // reflects the source text, not escapedText) — shim it so\n // they see the rewritten name.\n (n as any).getFullText = () => finalName;\n }\n }\n return;\n }\n if (n.kind === ts.SyntaxKind.ObjectLiteralExpression) {\n const innerVars = this.getVarListFromObjectLiteralAndUpdateInPlace(n);\n res = res.concat(innerVars);\n return;\n }\n ts.forEachChild(n, traverseAndReplace);\n };\n\n node.properties.forEach( (prop) => {\n if (!prop.initializer) return;\n traverseAndReplace(prop.initializer);\n });\n\n // dedup on (orig|final) pair\n const seen = new Set();\n const dedup: Array<{ orig: string; final: string }> = [];\n for (const p of res) {\n const key = `${p.orig}|${p.final}`;\n if (seen.has(key)) continue;\n seen.add(key);\n dedup.push(p);\n }\n this.varListFromObjectLiterals[nodeId] = dedup;\n return dedup;\n }\n\n printVariableDeclarationList(node, identation) {\n const declaration = node.declarations[0];\n\n let finalVars = '';\n if (declaration.initializer) {\n // Walk the whole initializer tree — handles AwaitExpression,\n // ParenthesizedExpression, NewExpression, ConditionalExpression,\n // nested CallExpressions, etc. uniformly.\n const objLiterals = this.collectCapturingObjectLiterals(declaration.initializer);\n let varObj = [];\n for (const lit of objLiterals) {\n const vars = this.getVarListFromObjectLiteralAndUpdateInPlace(lit);\n varObj = varObj.concat(vars);\n }\n if (varObj.length > 0) {\n finalVars = this.buildFinalVarDeclarations(varObj, identation);\n }\n }\n\n if (\n this.removeVariableDeclarationForFunctionExpression &&\n declaration?.initializer &&\n ts.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 === ts.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 let arrayBindingStatement =\n `${this.getIden(identation)}var ${syntheticName} = ${this.printNode(\n declaration.initializer,\n 0\n )};\\n`;\n\n parsedArrayBindingElements.forEach((e, index) => {\n const statement =\n this.getIden(identation) +\n `var ${e} = ((java.util.List) ${syntheticName}).get(${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 const isNew =\n declaration?.initializer &&\n declaration.initializer.kind === ts.SyntaxKind.NewExpression;\n const varToken = isNew ? \"var \" : this.VAR_TOKEN + \" \";\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 finalVars = finalVars.length > 0 ? this.getIden(identation) + finalVars + \"\\n\" : finalVars;\n return (\n finalVars +\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 === ts.SyntaxKind.PropertyAssignment) {\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.escapedText;\n\n let rawExpression = undefined;\n\n switch (rightSide) {\n case \"length\": {\n const type = (this.getChecker() as TypeChecker).getTypeAtLocation(\n expression\n );\n this.warnIfAnyType(node, (type as any).flags, leftSide, \"length\");\n rawExpression = this.isStringType((type as any).flags)\n ? `((String)${leftSide}).length()`\n : `${this.ARRAY_LENGTH_WRAPPER_OPEN}${leftSide}${this.ARRAY_LENGTH_WRAPPER_CLOSE}`;\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 ts.isArrayLiteralExpression(node) ||\n ts.isObjectLiteralExpression(node) ||\n ts.isStringLiteral(node) ||\n (ts as any).isBooleanLiteral(node)\n ) {\n return this.UNDEFINED_TOKEN;\n }\n\n if (ts.isNumericLiteral(node)) {\n return this.UNDEFINED_TOKEN;\n }\n\n if (\n node?.escapedText === \"undefined\" &&\n this.getChecker().getTypeAtLocation(node?.parent)?.flags ===\n ts.TypeFlags.Number\n ) {\n return this.UNDEFINED_TOKEN;\n }\n\n return undefined;\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 const initParams = [];\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 const index = i + offSetIndex;\n // index = index < 0 ? 0 : i - 1;\n const paramName = this.printNode(param.name, 0);\n initParams.push(`Object ${paramName} = Helpers.getArg(optionalArgs, ${index}, ${this.printNode(initializer, 0)});`);\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) {\n const finalWrapperVars = this.printFinalOutsideMethodVariableWrappersIfAny(node, identation) + \"\\n\";\n const insideWrappers = 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 && (ts.isReturnStatement(lastStatement) || this.allBranchesTerminate(lastStatement));\n const returnNull = lastStmtIsReturn ? \"\" : (this.getIden(identation + 2) + \"return null;\\n\");\n const asyncBody = this.getIden(identation + 1) + \"return java.util.concurrent.CompletableFuture.supplyAsync(() -> {\\n\" +\n insideWrappers +\n body + \"\\n\" +\n returnNull +\n this.getIden(identation + 1) + \"});\\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.escapedText;\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 === ts.SyntaxKind.AnyKeyword) {\n return `((${this.VariableTypeReplacements['object']})${this.printNode(\n node.expression,\n identation\n )})`;\n }\n\n if (type.kind === ts.SyntaxKind.StringKeyword) {\n return `((String)${this.printNode(node.expression, identation)})`;\n }\n\n if (type.kind === ts.SyntaxKind.ArrayType) {\n if (type.elementType.kind === ts.SyntaxKind.AnyKeyword) {\n return `(java.util.List)(${this.printNode(\n node.expression,\n identation\n )})`;\n }\n if (type.elementType.kind === ts.SyntaxKind.StringKeyword) {\n return `(java.util.List)(${this.printNode(\n node.expression,\n identation\n )})`;\n }\n }\n\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 let type = this.printParameterType(node) || \"\";\n\n if (defaultValue) {\n if (initializer) {\n const customDefaultValue =\n this.printCustomDefaultValueIfNeeded(initializer);\n const def = customDefaultValue\n ? customDefaultValue\n : this.printNode(initializer, 0);\n type = def === \"null\" && type !== \"Object\" ? type + \" \" : type + \" \";\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 printMethodParameters(node) {\n const isAsyncMethod = this.isAsyncFunction(node);\n const params = node.parameters.map(param => {\n const isReassignedVar = this.ReassignedVars[this.getVarKey(param)];\n let printedParam = this.printParameter(param);\n if (isAsyncMethod && isReassignedVar) {\n const paramName = param.name.escapedText;\n const { localName, sigName } = this.getAsyncParamWrapperNames(paramName);\n // Replace the printed Java name (post keyword-remap) with sigName so\n // the original name is freed for the lambda body to bind.\n printedParam = printedParam.replace(localName, sigName);\n }\n return printedParam;\n });\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 const parameters = node?.parameters;\n const finalVarWrappers = [];\n\n if (parameters) {\n const isAsyncMethod = this.isAsyncFunction(node);\n parameters.forEach(param => {\n const isOptionalParam = param.initializer !== undefined || param.questionToken !== undefined;\n if (!isOptionalParam) {\n const isReassignedVar = this.ReassignedVars[this.getVarKey(param)];\n if (isAsyncMethod && isReassignedVar) {\n const paramName = param.name.escapedText;\n const { sigName, snapName } = this.getAsyncParamWrapperNames(paramName);\n finalVarWrappers.push(this.getIden(identation + 1) + `final Object ${snapName} = ${sigName};`);\n }\n }\n\n });\n }\n return finalVarWrappers.join(\"\\n\");\n }\n\n printInsideMethodVariableWrappersIfAny(node, identation) {\n const parameters = node?.parameters;\n const finalVarWrappers = [];\n\n if (parameters) {\n const isAsyncMethod = this.isAsyncFunction(node);\n parameters.forEach(param => {\n const isOptionalParam = param.initializer !== undefined || param.questionToken !== undefined;\n if (!isOptionalParam) {\n const isReassignedVar = this.ReassignedVars[this.getVarKey(param)];\n if (isAsyncMethod && isReassignedVar) {\n const paramName = param.name.escapedText;\n const { localName, snapName } = this.getAsyncParamWrapperNames(paramName);\n finalVarWrappers.push(this.getIden(identation + 1) + `Object ${localName} = ${snapName};`);\n }\n }\n\n });\n }\n return finalVarWrappers.join(\"\\n\");\n }\n\n printMethodDeclaration(node, identation) {\n\n\n const funcBody = this.printFunctionBody(node, identation); // print body first to get var reassignments filled\n\n let methodDef = this.printMethodDefinition(node, identation);\n\n methodDef += funcBody;\n\n return methodDef;\n }\n\n printMethodDefinition(node, identation) {\n let name = node.name.escapedText;\n name = this.transformMethodNameIfNeeded(name);\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 // let modifiers = this.printModifiers(node);\n const defaultAccess = this.METHOD_DEFAULT_ACCESS ? this.METHOD_DEFAULT_ACCESS + \" \" : \"\";\n const modifiers = defaultAccess;\n // modifiers = modifiers ? modifiers + \" \" : defaultAccess;\n // modifiers =\n // modifiers.indexOf(\"public\") === -1 &&\n // modifiers.indexOf(\"private\") === -1 &&\n // modifiers.indexOf(\"protected\") === -1\n // ? defaultAccess + modifiers\n // : modifiers;\n\n let parsedArgs = undefined;\n\n // const methodOverride = (this.getMethodOverride(node) as any);\n // const isOverride = methodOverride !== undefined;\n\n // if (isOverride && (returnType === \"Object\" || returnType === \"java.util.concurrent.CompletableFuture\")) {\n // returnType = this.printFunctionType(methodOverride);\n // }\n\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 // const currentArgs = node.parameters;\n // const parentArgs = methodOverride.parameters;\n // parsedArgs = \"\";\n // parentArgs.forEach((param, index) => {\n // const originalName = this.printNode(currentArgs[index].name, 0);\n // const parsedArg = this.printParameteCustomName(param, originalName);\n // parsedArgs += parsedArg;\n // if (index < parentArgs.length - 1) {\n // parsedArgs += \", \";\n // }\n // });\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 signature =\n this.getIden(identation) +\n modifiers +\n returnType +\n methodToken +\n name +\n \"(\" +\n parsedArgs +\n \")\";\n\n return this.printNodeCommentsIfAny(node, identation, signature);\n }\n\n // Route through Helpers so consumers control semantics (thread-safety,\n // null-handling, type coercion) in one place — same pattern as\n // Helpers.add / Helpers.isEqual / Helpers.GetValue / Helpers.json. The\n // previous inline emits (`x instanceof java.util.List`, `((Map)x).keySet()`)\n // forced any downstream that needed different semantics (e.g. synchronized\n // map access in concurrent code) to post-process the generated Java with\n // regex — which only catches the bare-identifier argument shape and misses\n // property-access (`this.x`) and element-access (`obj[k]`) arguments.\n printArrayIsArrayCall(_node, _identation, parsedArg = undefined) {\n return `Helpers.isArray(${parsedArg})`;\n }\n\n printObjectKeysCall(_node, _identation, parsedArg = undefined) {\n return `Helpers.objectKeys(${parsedArg})`;\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 printPromiseAllCall(_node, _identation, parsedArg = undefined) {\n return `Helpers.promiseAll(${parsedArg})`;\n }\n\n printMathFloorCall(_node, _identation, parsedArg = undefined) {\n return `(Math.floor(Double.parseDouble(Helpers.toString(${parsedArg}))))`;\n }\n\n printMathRoundCall(_node, _identation, parsedArg = undefined) {\n return `Math.round(Double.parseDouble(Helpers.toString(${parsedArg})))`;\n }\n\n printMathCeilCall(_node, _identation, parsedArg = undefined) {\n return `Math.ceil(Double.parseDouble(Helpers.toString(${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 printIndexOfCall(_node, _identation, name = undefined, parsedArg = undefined) {\n return `${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 `new java.util.ArrayList(java.util.Arrays.asList(((String)${name}).split((String)${parsedArg})))`;\n return `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 if (parsedArg2 === undefined) {\n parsedArg2 = \"null\";\n }\n return `Helpers.slice(${name}, ${parsedArg}, ${parsedArg2})`;\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 return `Helpers.replaceAll((String)${name}, (String)${parsedArg}, (String)${parsedArg2})`;\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 `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 TypeChecker).getTypeAtLocation(node.expression);\n this.warnIfAnyType(node, (type as any).flags, leftSide, \"length\");\n return this.isStringType((type as any).flags)\n ? `((String)${leftSide}).length()`\n : `${this.ARRAY_LENGTH_WRAPPER_OPEN}${leftSide}${this.ARRAY_LENGTH_WRAPPER_CLOSE}`;\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 const op = this.PostFixOperators[operator];\n if (op === \"--\") {\n return `${leftSide}--`;\n }\n return `${leftSide}++`;\n }\n\n printPrefixUnaryExpression(node, identation) {\n const { operand, operator } = node;\n if (operator === ts.SyntaxKind.ExclamationToken) {\n return this.PrefixFixOperators[operator] + this.printCondition(node.operand, 0);\n }\n const leftSide = this.printNode(operand, 0);\n if (operator === ts.SyntaxKind.PlusToken) {\n return `+(${leftSide})`;\n } else if (operator === ts.SyntaxKind.MinusToken) {\n return `Helpers.opNeg(${leftSide})`;\n }\n return super.printPrefixUnaryExpression(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 === ts.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 === ts.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 === ts.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.escapedText === \"Error\" ? \"RuntimeException\" : id.escapedText;\n const symbol = this.getChecker().getSymbolAtLocation(expression.expression);\n if (symbol) {\n const declarations =\n this.getChecker().getDeclaredTypeOfSymbol(symbol).symbol?.declarations ?? [];\n const isClassDeclaration = declarations.find(\n (l) =>\n l.kind === ts.SyntaxKind.InterfaceDeclaration ||\n l.kind === ts.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 === ts.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 === ts.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]);\n modifiers = modifiers.filter(mod => mod.kind !== ts.SyntaxKind.AsyncKeyword);\n const res = modifiers.map(modifier => this.FuncModifiers[modifier.kind]).join(\" \");\n\n return res;\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 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 === ts.SyntaxKind.AsExpression && (exp.expression.kind === ts.SyntaxKind.ObjectLiteralExpression || ts.SyntaxKind.CallExpression)) {\n exp = exp.expression; // go over something like return {} as SomeType\n }\n // Use collectCapturingObjectLiterals to walk through every wrapper\n // (AwaitExpression, ParenthesizedExpression, CallExpression args, ArrayLiteral\n // elements, ConditionalExpression branches, NewExpression args, etc.) and\n // pick up every HashMap literal whose anonymous-inner-class body would\n // need effectively-final captures. The previous narrow switch missed\n // `return await this.watch(..., { literal capturing reassigned var }, ...)`\n // entirely — the literal ended up referencing the raw (reassigned)\n // identifier with no snapshot, which javac rejects.\n const allVarNames = [];\n if (exp) {\n const objLiterals = this.collectCapturingObjectLiterals(exp);\n for (const objLiteral of objLiterals) {\n const varsList = this.getVarListFromObjectLiteralAndUpdateInPlace(objLiteral);\n allVarNames.push(...varsList);\n }\n }\n let finalVars = allVarNames.length > 0 ? this.buildFinalVarDeclarations(allVarNames, identation) : '';\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 (ts.isFunctionDeclaration(parent) || ts.isMethodDeclaration(parent) || ts.isFunctionExpression(parent) || ts.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 finalVars = finalVars.length > 0 ? this.getIden(identation) + finalVars + \"\\n\" : finalVars;\n return leadingComment + finalVars + this.getIden(identation) + this.RETURN_TOKEN + rightPart + trailingComment;\n }\n\n private allBranchesTerminate(node: ts.Node): boolean {\n if (ts.isReturnStatement(node) || ts.isThrowStatement(node)) {\n return true;\n }\n if (ts.isBlock(node)) {\n const stmts = node.statements;\n return stmts.length > 0 && this.allBranchesTerminate(stmts[stmts.length - 1]);\n }\n if (ts.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 ts from 'typescript';\n\nconst SyntaxKind = ts.SyntaxKind;\n\nconst parserConfig = {\n 'ELSEIF_TOKEN': 'else if',\n 'OBJECT_OPENING': '{',\n 'OBJECT_CLOSING': '}',\n 'ARRAY_OPENING_TOKEN': 'Value::List(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\nexport class RustTranspiler extends BaseTranspiler {\n\n binaryExpressionsWrappers;\n methodSignatures: Record;\n forLoopCounter: number;\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 capitalize(str: string) {\n return str[0].toUpperCase() + str.slice(1);\n }\n\n printStringLiteral(node) {\n let text = node.text;\n if (text in this.StringLiteralReplacements) {\n return this.StringLiteralReplacements[text];\n }\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 `Value::Str(\"${text}\".to_string())`;\n }\n\n printNumericLiteral(node) {\n const text = node.text;\n if (text.includes('.')) {\n return `Value::Float(${text})`;\n }\n return `Value::Int(${text})`;\n }\n\n printBooleanLiteral(node) {\n if (ts.SyntaxKind.TrueKeyword === node.kind) {\n return 'Value::Bool(true)';\n }\n return 'Value::Bool(false)';\n }\n\n printNullKeyword(node, identation) {\n return 'Value::Null';\n }\n\n // Ensure a & ref prefix — skip only if already a reference\n ensureRef(expr: string): string {\n if (expr.startsWith('&')) {\n return expr;\n }\n return `&${expr}`;\n }\n\n printCustomBinaryExpressionIfAny(node, identation) {\n const left = node.left;\n const right = node.right;\n const op = node.operatorToken.kind;\n\n // Handle array destructuring reassignment: [a, b] = expr → bind once, reassign each\n if (op === SyntaxKind.EqualsToken && left.kind === SyntaxKind.ArrayLiteralExpression) {\n const elements = left.elements;\n const rhs = this.printNode(right, 0);\n const tmpName = '__destr_tmp';\n const assignments = elements.map((e, idx) => {\n const target = this.printNode(e, 0);\n return `${target} = get_value(&${tmpName}, &Value::Int(${idx}))`;\n }).join('; ');\n return `{ let ${tmpName} = ${rhs}; ${assignments}; }`;\n }\n\n // Handle element access assignment: a[b] = v → add_element_to_object(&mut a, &b, v)\n if (op === SyntaxKind.EqualsToken && left.kind === SyntaxKind.ElementAccessExpression) {\n const keys: any[] = [];\n let baseExpr: any = null;\n let cur: any = left;\n while (ts.isElementAccessExpression(cur)) {\n keys.unshift(cur.argumentExpression);\n const expr = cur.expression;\n if (!ts.isElementAccessExpression(expr)) {\n baseExpr = expr;\n break;\n }\n cur = expr;\n }\n const containerStr = this.printNode(baseExpr, 0);\n const keyStrs = keys.map(k => this.printNode(k, 0));\n let acc = `&mut ${containerStr}`;\n for (let i = 0; i < keyStrs.length - 1; i++) {\n acc = `get_value_mut(${acc}, &${keyStrs[i]})`;\n }\n const lastKey = keyStrs[keyStrs.length - 1];\n const rhs = this.printNode(right, 0);\n return `add_element_to_object(${acc}, &${lastKey}, ${rhs})`;\n }\n\n // Handle typeof comparisons\n if (left.kind === SyntaxKind.TypeOfExpression) {\n const expression = left.expression;\n const rightText = right.text;\n const target = this.printNode(expression, 0);\n const isDiff = op === SyntaxKind.ExclamationEqualsEqualsToken || op === SyntaxKind.ExclamationEqualsToken;\n const not = isDiff ? '!' : '';\n switch (rightText) {\n case 'string': return `${not}is_string(&${target})`;\n case 'number': return `${not}is_number(&${target})`;\n case 'boolean': return `${not}is_bool(&${target})`;\n case 'object': return `${not}is_object(&${target})`;\n case 'function': return `${not}is_function(&${target})`;\n }\n }\n\n // Handle in operator — wrap as Value so it composes in any context\n if (op === SyntaxKind.InKeyword) {\n return `Value::Bool(in_op(&${this.printNode(right, 0)}, &${this.printNode(left, 0)}))`;\n }\n\n // Handle += for regular variables\n if (op === SyntaxKind.PlusEqualsToken && left.kind !== SyntaxKind.ElementAccessExpression) {\n const leftText = this.printNode(left, 0);\n const rightText = this.printNode(right, 0);\n return `${leftText} = add(&${leftText}, &${rightText})`;\n }\n\n // Handle -= for regular variables\n if (op === SyntaxKind.MinusEqualsToken && left.kind !== SyntaxKind.ElementAccessExpression) {\n const leftText = this.printNode(left, 0);\n const rightText = this.printNode(right, 0);\n return `${leftText} = subtract(&${leftText}, &${rightText})`;\n }\n\n // Binary wrapper functions (is_equal, add, etc.) - add & to both sides\n if (op in this.binaryExpressionsWrappers) {\n const [fnName, close] = this.binaryExpressionsWrappers[op];\n const leftText = this.printNode(left, 0);\n const rightText = this.printNode(right, 0);\n const leftRef = this.ensureRef(leftText);\n const rightRef = this.ensureRef(rightText);\n return `${fnName}${leftRef}, ${rightRef}${close}`;\n }\n\n return undefined;\n }\n\n printBinaryExpression(node, identation) {\n const custom = this.printCustomBinaryExpressionIfAny(node, identation);\n if (custom) {\n return custom;\n }\n return 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\n // (`pad_start` / `pad_end` take `(&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 isNew = declaration.initializer && declaration.initializer.kind === SyntaxKind.NewExpression;\n\n if (declaration?.name.kind === SyntaxKind.ArrayBindingPattern) {\n const elements = declaration.name.elements;\n const parsedElements = elements.map(e => this.printNode(e.name, 0));\n const syntheticName = parsedElements.join('') + 'Variable';\n let stmt = `${this.getIden(identation)}let mut ${syntheticName} = ${this.printNode(declaration.initializer, 0)};\\n`;\n parsedElements.forEach((e, idx) => {\n const line = `${this.getIden(identation)}let mut ${e}: Value = get_value(&${syntheticName}, &Value::Int(${idx}))`;\n stmt += idx < parsedElements.length - 1 ? line + ';\\n' : line;\n });\n return stmt;\n }\n\n const varName = this.printNode(declaration.name, 0);\n\n if (!declaration.initializer) {\n return `${this.getIden(identation)}let mut ${varName}: Value = Value::Null`;\n }\n\n const parsedValue = this.printNode(declaration.initializer, identation).trim();\n\n if (isNew) {\n return `${this.getIden(identation)}let mut ${varName} = ${parsedValue}`;\n }\n\n return `${this.getIden(identation)}let mut ${varName}: Value = ${parsedValue}`;\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 const propDecls = node.members.filter(m => m.kind === SyntaxKind.PropertyDeclaration);\n return propDecls.map(p => {\n const name = this.printNode(p.name, 0);\n const init = p.initializer ? this.printNode(p.initializer, 0) : 'Value::Null';\n return { name, init };\n });\n }\n\n printStruct(node, identation) {\n const fields = this.getStructFields(node);\n const fieldLines = fields.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 fields = this.getStructFields(node);\n const fieldInits = fields.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.className = node.name.escapedText;\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 => {\n const name = (method as any).name.escapedText;\n const params = (method as any).parameters;\n const requiredCount = params.filter(p => !p.initializer && !p.questionToken).length;\n const hasOptional = params.some(p => p.initializer !== undefined || p.questionToken !== undefined);\n if (hasOptional) {\n this.methodSignatures[name] = { requiredCount };\n }\n });\n\n const struct = this.printStruct(node, identation);\n const newMethod = this.printNewMethod(node, identation);\n\n const classMethods = methods.map(m => this.printMethodDeclaration(m, identation)).join('\\n\\n');\n\n const implBlock = `\\nimpl ${this.className} {\\n${classMethods}\\n}`;\n\n return struct + newMethod + implBlock;\n }\n\n printMethodDefinition(node, identation) {\n const name = (node.name as any).escapedText;\n const params = node.parameters;\n const hasOptional = params.some(p => p.initializer !== undefined || p.questionToken !== undefined);\n\n const requiredParams = params.filter(p => !p.initializer && !p.questionToken);\n const optionalParams = params.filter(p => p.initializer !== undefined || p.questionToken !== undefined);\n\n let parsedArgs = '&self';\n if (requiredParams.length > 0) {\n const reqArgs = requiredParams.map(p => `${this.printNode(p.name, 0)}: Value`).join(', ');\n parsedArgs += ', ' + reqArgs;\n }\n if (hasOptional) {\n parsedArgs += ', optional_args: &[Value]';\n }\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 try {\n const type = this.getChecker().getReturnTypeOfSignature(this.getChecker().getSignatureFromDeclaration(node));\n if (type.flags === ts.TypeFlags.Void) {\n return '';\n }\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 let optionalInits = '';\n if (optionalParams.length > 0) {\n const requiredCount = params.filter(p => !p.initializer && !p.questionToken).length;\n optionalInits = optionalParams.map((p, idx) => {\n const pname = this.printNode(p.name, 0);\n const defaultVal = p.initializer ? this.printNode(p.initializer, 0) : 'Value::Null';\n return `${this.getIden(identation + 2)}let ${pname} = get_arg(optional_args, ${idx}, ${defaultVal});`;\n }).join('\\n') + '\\n';\n }\n\n const blockOpen = this.getBlockOpen(identation);\n const blockClose = this.getBlockClose(identation);\n const statements = node.body.statements.map(s => this.printNode(s, identation + 2)).join('\\n');\n const body = blockOpen + optionalInits + statements + blockClose;\n\n return this.printNodeCommentsIfAny(node, identation, methodDef + body);\n }\n\n printFunctionDefinition(node, identation) {\n const name = node.name?.escapedText ?? '';\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 (ts.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.escapedText;\n const sig = this.methodSignatures[methodName];\n if (sig) {\n const requiredArgs = args.slice(0, sig.requiredCount).map(a => this.printNode(a, 0)).join(', ');\n const optionalArgsList = args.slice(sig.requiredCount).map(a => this.printNode(a, 0)).join(', ');\n const optSlice = optionalArgsList ? `&[${optionalArgsList}]` : '&[]';\n const reqPart = requiredArgs ? `${requiredArgs}, ` : '';\n return `self.${methodName}(${reqPart}${optSlice})`;\n }\n }\n\n return undefined;\n }\n\n printCallExpression(node, identation) {\n const expression = node.expression;\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 const ref = argText.startsWith('Value::') ? `&${argText}` :\n argText.startsWith('&') ? argText : `&${argText}`;\n return `println_val(${ref})`;\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) return outOfOrder;\n\n return super.printCallExpression(node, identation);\n }\n\n printThisKeyword(node, identation) {\n return 'self';\n }\n\n printNewExpression(node, identation) {\n let expression = node.expression?.escapedText;\n expression = expression ? expression : this.printNode(node.expression);\n const args = node.arguments.map(a => this.printNode(a, identation)).join(', ');\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 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 = expression\n .replace(/([A-Z]+)([A-Z][a-z])/g, '$1_$2')\n .replace(/([a-z\\d])([A-Z])/g, '$1_$2')\n .toLowerCase();\n return `crate::exchange_errors::${snake}(${args})`;\n }\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.escapedText;\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 `get_array_length(&${leftExpr})`;\n }\n\n return `${leftExpr}.${rightSide}`;\n }\n\n transformPropertyAcessExpressionIfNeeded(node) {\n const rightSide = node.name.escapedText;\n const leftExpr = this.printNode(node.expression, 0);\n if (rightSide === 'length') {\n return `get_array_length(&${leftExpr})`;\n }\n return undefined;\n }\n\n printElementAccessExpression(node, identation) {\n const special = this.printElementAccessExpressionExceptionIfAny(node);\n if (special) return special;\n\n const keys: any[] = [];\n let baseExpr = null;\n let current: any = node;\n while (ts.isElementAccessExpression(current)) {\n keys.unshift(current.argumentExpression);\n const expr = current.expression;\n if (!ts.isElementAccessExpression(expr)) {\n baseExpr = expr;\n break;\n }\n current = expr;\n }\n\n const containerStr = this.printNode(baseExpr, 0);\n const keyStrs = keys.map(k => this.printNode(k, 0));\n\n let acc = containerStr;\n keyStrs.forEach(k => {\n const kRef = k.startsWith('Value::') ? `&${k}` : `&${k}`;\n acc = `get_value(&${acc}, ${kRef})`;\n });\n return acc;\n }\n\n printForStatement(node, identation) {\n const initNode = node.initializer;\n const condNode = node.condition;\n const incrNode = node.incrementor;\n\n const idn = this.getIden(identation);\n const idn1 = this.getIden(identation + 1);\n\n const initStr = initNode ? this.printNode(initNode, identation + 1) + ';\\n' : '';\n const condStr = condNode ? this.printNode(condNode, 0) : 'true';\n const incrStr = incrNode ? this.printNode(incrNode, 0) : '';\n\n const statements = node.statement.statements.map(s => this.printNode(s, identation + 1)).join('\\n');\n const body = `{\\n${statements}\\n${idn}}`;\n\n // A C-style `for` becomes a Rust `while`. The increment must run on\n // every iteration *including* one ended by `continue` — a `continue`\n // re-evaluates the loop condition, so the increment is folded into\n // it (guarded by a first-iteration flag). Putting the increment at\n // the end of the body instead would let `continue` skip it and spin\n // 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,\n SyntaxKind.EqualsEqualsEqualsToken,\n SyntaxKind.ExclamationEqualsToken,\n SyntaxKind.ExclamationEqualsEqualsToken,\n SyntaxKind.LessThanToken,\n SyntaxKind.LessThanEqualsToken,\n SyntaxKind.GreaterThanToken,\n SyntaxKind.GreaterThanEqualsToken,\n ]);\n\n printCondition(node, 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 as any).COMPARISON_OPS.has(opKind)) {\n return `${this.getIden(identation)}${this.printNode(node, 0)}`;\n }\n // Logical &&/|| operands are individually is_true()-wrapped in\n // printBinaryExpression, so the whole expression is already bool.\n if (opKind === SyntaxKind.AmpersandAmpersandToken ||\n opKind === SyntaxKind.BarBarToken) {\n return `${this.getIden(identation)}${this.printNode(node, 0)}`;\n }\n }\n // PrefixUnary ! — delegate to avoid double-wrapping\n if (node.kind === SyntaxKind.PrefixUnaryExpression &&\n node.operator === SyntaxKind.ExclamationToken) {\n return this.printPrefixUnaryExpression(node, identation);\n }\n const expression = this.printNode(node, 0);\n return `${this.getIden(identation)}is_true(&${expression})`;\n }\n\n printWhileStatement(node, identation) {\n const expr = this.printCondition(node.expression, 0);\n const body = this.printBlock(node.statement, identation);\n return `${this.getIden(identation)}while ${expr}${body}`;\n }\n\n printIfStatement(node, identation) {\n const expression = this.printCondition(node.expression, 0);\n const elseExists = node.elseStatement !== undefined;\n const ifBody = this.printBlock(node.thenStatement, identation, elseExists);\n\n let ifComplete = `${expression}${ifBody}`;\n const isElseIf = node.parent.kind === SyntaxKind.IfStatement;\n if (isElseIf) {\n ifComplete = `else if ${ifComplete}`;\n } else {\n ifComplete = `${this.getIden(identation)}if ${ifComplete}`;\n }\n\n const elseStatement = node.elseStatement;\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 operandText = this.printNode(operand, 0);\n if (operator === SyntaxKind.PlusPlusToken) {\n return `${this.getIden(identation)}${operandText} = add(&${operandText}, &Value::Int(1))`;\n }\n if (operator === SyntaxKind.MinusMinusToken) {\n return `${this.getIden(identation)}${operandText} = subtract(&${operandText}, &Value::Int(1))`;\n }\n return super.printPostFixUnaryExpression(node, identation);\n }\n\n printPrefixUnaryExpression(node, identation) {\n const { operand, operator } = node;\n if (operator === SyntaxKind.ExclamationToken) {\n return this.getIden(identation) + '!' + this.printCondition(node.operand, 0);\n }\n if (operator === SyntaxKind.MinusToken) {\n return this.getIden(identation) + `negate(&${this.printNode(operand, 0)})`;\n }\n return this.getIden(identation) + this.PrefixFixOperators[operator] + this.printNode(operand, 0);\n }\n\n printObjectLiteralExpression(node, identation) {\n if (node.properties.length === 0) {\n return 'Value::Map({\\n' + this.getIden(identation + 1) + 'let mut m = std::collections::HashMap::new();\\n' + this.getIden(identation + 1) + 'm\\n' + this.getIden(identation) + '})';\n }\n const escapeKey = (s: any): string => {\n return String(s).replace(/\\\\/g, '\\\\\\\\').replace(/\"/g, '\\\\\"').replace(/\\n/g, '\\\\n').replace(/\\r/g, '\\\\r').replace(/\\t/g, '\\\\t');\n };\n const lines = node.properties.map(p => {\n // Shorthand: { foo } → m.insert(\"foo\", foo.clone());\n if (ts.isShorthandPropertyAssignment(p)) {\n const name = p.name.escapedText;\n return `${this.getIden(identation + 2)}m.insert(\"${escapeKey(name)}\".to_string(), ${name}.clone());`;\n }\n const { name, initializer } = p;\n const keyText = ts.isStringLiteral(name) ? name.text : name.escapedText;\n const valText = this.printNode(initializer, 0);\n return `${this.getIden(identation + 2)}m.insert(\"${escapeKey(keyText)}\".to_string(), ${valText});`;\n }).join('\\n');\n return `Value::Map({\\n${this.getIden(identation + 1)}let mut m = std::collections::HashMap::new();\\n${lines}\\n${this.getIden(identation + 1)}m\\n${this.getIden(identation)}})`;\n }\n\n printArrayLiteralExpression(node, identation) {\n const elements = node.elements.map(e => this.printNode(e, 0)).join(', ');\n return `Value::List(vec![${elements}])`;\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 const keyRef = key.startsWith('Value::') ? `&${key}` : `&${key}`;\n return `remove(&mut ${object}, ${keyRef})`;\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)}is_instance(&${left}, &${right})`;\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 `ternary(${condition}, ${whenTrue}, ${whenFalse})`;\n }\n\n // Built-in method call overrides\n printArrayIsArrayCall(node, identation, parsedArg = undefined) {\n return `Value::Bool(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 printPromiseAllCall(node, identation, parsedArg = undefined) {\n // No trailing `.await` here — when the TS source has\n // `await Promise.all(...)`, `printAwaitExpression` will append it.\n // Adding it here too would produce `.await.await` (double-await).\n return `promise_all(&${parsedArg})`;\n }\n\n // Rust uses postfix `.await`; the base transpiler defaults to prefix.\n printAwaitExpression(node, identation) {\n const expr = this.printNode(node.expression, identation);\n return `${expr}.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 const pRef = parsedArg?.startsWith('Value::') ? `&${parsedArg}` : `&${parsedArg}`;\n return `Value::Bool(contains(&${name}, ${pRef}))`;\n }\n\n printIndexOfCall(node, identation, name = undefined, parsedArg = undefined) {\n return `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 const arg2 = parsedArg2 ?? 'Value::Null';\n return `slice(&${name}, &${parsedArg}, &${arg2})`;\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 printThrowStatement(node, identation) {\n const expression = this.printNode(node.expression, 0);\n // `{}` (Display) renders an ExchangeError as `[Kind] message`;\n // `{:?}` would dump the struct fields.\n return `${this.getIden(identation)}panic!(\"{}\", ${expression});`;\n }\n\n printTryStatement(node, identation) {\n const tryBody = node.tryBlock.statements.map(s => this.printNode(s, identation + 1)).join('\\n');\n const catchBody = node.catchClause.block.statements.map(s => this.printNode(s, identation + 1)).join('\\n');\n const rawName = node.catchClause?.variableDeclaration?.name?.escapedText;\n const errorName = rawName ? `_${rawName}` : '_e';\n const iden = this.getIden(identation);\n return `${iden}let _try_result = std::panic::catch_unwind(std::panic::AssertUnwindSafe(|| {\\n${tryBody}\\n${iden}}));\\n${iden}if let Err(${errorName}) = _try_result {\\n${catchBody}\\n${iden}}`;\n }\n\n printReturnStatement(node, identation) {\n const exp = node.expression;\n if (!exp) {\n return `${this.getIden(identation)}return;`;\n }\n const rightPart = this.printNode(exp, 0).trim();\n return `${this.getIden(identation)}return ${rightPart};`;\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 const expression = this.printNode(node.expression, 0);\n return `${this.getIden(identation)}${expression}`;\n }\n}\n"]} \ No newline at end of file diff --git a/dist/transpiler.d.ts b/dist/transpiler.d.ts index f9bea41..3f9436a 100644 --- a/dist/transpiler.d.ts +++ b/dist/transpiler.d.ts @@ -896,6 +896,7 @@ declare class Transpiler { createProgramInMemoryAndSetContext(content: any): ITranspileContext; getByPathCompilerHost(options: ts.CompilerOptions): ts.CompilerHost; createProgramByPathAndSetContext(path: any): ITranspileContext; + createProgramBatch(paths: string[]): TranspileProgramBatch; setContext(context: ITranspileContext): ITranspileContext; /** @deprecated renamed to createProgramInMemoryAndSetContext */ createProgramInMemoryAndSetGlobals(content: any): ITranspileContext; @@ -928,5 +929,20 @@ declare class Transpiler { setPythonStringLiteralReplacements(replacements: any): void; convertStringToLanguageEnum(lang: string): Languages; } +declare class TranspileProgramBatch { + private readonly transpiler; + private readonly program; + private readonly checker; + constructor(transpiler: Transpiler, program: ts.Program, checker: ts.TypeChecker); + getProgram(): ts.Program; + setContextForPath(filePath: string): ITranspileContext; + transpileByPath(lang: Languages, filePath: string, sync?: boolean): ITranspiledFile; + transpilePythonByPath(filePath: string): ITranspiledFile; + transpilePhpByPath(filePath: string): ITranspiledFile; + transpileCSharpByPath(filePath: string): ITranspiledFile; + transpileGoByPath(filePath: string): ITranspiledFile; + transpileJavaByPath(filePath: string): ITranspiledFile; + transpileRustByPath(filePath: string): ITranspiledFile; +} -export { Transpiler, Transpiler as default }; +export { TranspileProgramBatch, Transpiler, Transpiler as default }; diff --git a/dist/transpiler.js b/dist/transpiler.js index 3818eb7..24c1024 100644 --- a/dist/transpiler.js +++ b/dist/transpiler.js @@ -6202,7 +6202,8 @@ var JavaTranspiler = class extends BaseTranspiler { } printThrowStatement(node, identation) { if (node.expression.kind === ts6.SyntaxKind.Identifier) { - return this.getIden(identation) + this.THROW_TOKEN + " " + this.printNode(node.expression, 0) + this.LINE_TERMINATOR; + const name = this.printNode(node.expression, 0); + return this.getIden(identation) + `${this.THROW_TOKEN} (${name} instanceof RuntimeException ? (RuntimeException)${name} : new RuntimeException(${name}))${this.LINE_TERMINATOR}`; } if (node.expression.kind === ts6.SyntaxKind.NewExpression) { const expression = node.expression; @@ -7348,6 +7349,29 @@ var Transpiler = class _Transpiler { program }); } + // One program over N root files, instead of one program per file. Every + // transpile*ByPath call pays for a full program: even with the SourceFile cache + // making the ~340-file import closure parse-free, the binder/checker work behind + // getPreEmitDiagnostics is redone per file. Batching N files into one program + // pays it once for the whole set. + // + // Files that import each other (a derived exchange and its parent) are fine in + // one batch — they are separate root files of the same program, exactly as + // typescript would compile a project. + // + // The batch deliberately does not become the cache's byPathOldProgram: an N-file + // program never structurally reuses a program built from a different root set, so + // there is nothing to gain, and keeping the previous chunk's checker alive while + // the next one is built would double peak memory — the opposite of why callers + // chunk. The cross-batch saving comes from the shared host + SourceFile cache. + createProgramBatch(paths) { + const options = fastCompilerOptions; + const host = this.getByPathCompilerHost(options); + const program = ts8.createProgram([...paths, globalsShimPath], options, host); + const checker = program.getTypeChecker(); + memoizeCheckerCalls(checker); + return new TranspileProgramBatch(this, program, checker); + } // the language printers read the typescript state (source file, checker, program) // off the context handed to them here, so two Transpiler instances never share // state and a nested transpile can restore whatever its caller was working on @@ -7554,7 +7578,52 @@ var Transpiler = class _Transpiler { } } }; +var TranspileProgramBatch = class { + constructor(transpiler, program, checker) { + this.transpiler = transpiler; + this.program = program; + this.checker = checker; + } + getProgram() { + return this.program; + } + // point the owning Transpiler at one file of this batch, then run the same + // diagnostics pass the single-file path runs — the printers read checker state + // back from it, so it is not optional + setContextForPath(filePath) { + const src = this.program.getSourceFile(filePath) ?? this.program.getSourceFile(path2.resolve(filePath)); + if (src === void 0) { + throw new Error(`ast-transpiler: "${filePath}" is not a file of this program batch`); + } + const context = this.transpiler.setContext({ src, checker: this.checker, program: this.program }); + this.transpiler.checkFileDiagnostics(context); + return context; + } + transpileByPath(lang, filePath, sync = false) { + this.setContextForPath(filePath); + return this.transpiler.transpile(lang, 0 /* ByPath */, filePath, sync, false); + } + transpilePythonByPath(filePath) { + return this.transpileByPath(0 /* Python */, filePath, !this.transpiler.pythonTranspiler.asyncTranspiling); + } + transpilePhpByPath(filePath) { + return this.transpileByPath(1 /* Php */, filePath, !this.transpiler.phpTranspiler.asyncTranspiling); + } + transpileCSharpByPath(filePath) { + return this.transpileByPath(2 /* CSharp */, filePath); + } + transpileGoByPath(filePath) { + return this.transpileByPath(3 /* Go */, filePath); + } + transpileJavaByPath(filePath) { + return this.transpileByPath(4 /* Java */, filePath); + } + transpileRustByPath(filePath) { + return this.transpileByPath(5 /* Rust */, filePath); + } +}; export { + TranspileProgramBatch, Transpiler, Transpiler as default }; diff --git a/dist/transpiler.js.map b/dist/transpiler.js.map index e351d2c..b75a191 100644 --- a/dist/transpiler.js.map +++ b/dist/transpiler.js.map @@ -1 +1 @@ -{"version":3,"sources":["../node_modules/tsup/assets/esm_shims.js","../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"],"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","// https://github.com/kulshekhar/ts-jest/issues/1174\nmodule.exports = __dirname;","import ts from 'typescript';\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 } from './goTranspiler.js';\nimport { JavaTranspiler } from './javaTranspiler.js';\nimport { RustTranspiler } from './rustTranspiler.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: ts.CompilerOptions = {\n target: ts.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\nfunction overrideHostForVirtualFiles(host: ts.CompilerHost, files: Map) {\n const originalGetSourceFile = host.getSourceFile.bind(host);\n const originalReadFile = host.readFile.bind(host);\n const originalFileExists = host.fileExists.bind(host);\n // resolve paths because typescript will normalize them\n // to forward slashes on windows\n host.getSourceFile = (fileName, languageVersion, onError, shouldCreateNewSourceFile) => {\n const virtual = files.get(path.resolve(fileName));\n return virtual !== undefined ? virtual : originalGetSourceFile(fileName, languageVersion, onError, shouldCreateNewSourceFile);\n };\n host.readFile = (fileName: string) => {\n const virtual = files.get(path.resolve(fileName));\n return virtual !== undefined ? virtual.text : originalReadFile(fileName);\n };\n host.fileExists = (fileName: string) => {\n return files.has(path.resolve(fileName)) || originalFileExists(fileName);\n };\n}\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 NO_SYMBOL_SENTINEL = Symbol(\"noSymbol\");\nfunction memoizeCheckerCalls(checker: ts.TypeChecker): void {\n if ((checker as any).__astTranspilerMemoized) {\n return;\n }\n (checker as any).__astTranspilerMemoized = true;\n\n const typeCache = new WeakMap();\n const originalGetTypeAtLocation = checker.getTypeAtLocation.bind(checker);\n checker.getTypeAtLocation = (node: ts.Node): ts.Type => {\n let type = typeCache.get(node);\n if (type === undefined) {\n type = originalGetTypeAtLocation(node);\n typeCache.set(node, type);\n }\n return type;\n };\n\n const symbolCache = new WeakMap();\n const originalGetSymbolAtLocation = checker.getSymbolAtLocation.bind(checker);\n checker.getSymbolAtLocation = (node: ts.Node): ts.Symbol | undefined => {\n const cached = symbolCache.get(node);\n if (cached !== undefined) {\n return cached === NO_SYMBOL_SENTINEL ? undefined : cached;\n }\n const symbol = originalGetSymbolAtLocation(node);\n symbolCache.set(node, symbol === undefined ? NO_SYMBOL_SENTINEL : symbol);\n return symbol;\n };\n}\n\nfunction getProgramAndTypeCheckerFromMemory (rootDir: string, text: string, options: any = {}, cache?: ITranspileProgramCache): [any,any,any] {\n options = options || ts.getDefaultCompilerOptions();\n const inMemoryFilePath = path.resolve(path.join(rootDir, \"__dummy-file.ts\"));\n const textAst = ts.createSourceFile(inMemoryFilePath, text, options.target || ts.ScriptTarget.Latest);\n const shimAst = ts.createSourceFile(globalsShimPath, globalsShim, options.target || ts.ScriptTarget.Latest);\n const host = ts.createCompilerHost(options, true);\n\n overrideHostForVirtualFiles(host, new Map([\n [inMemoryFilePath, textAst],\n [globalsShimPath, shimAst],\n ]));\n\n if (cache !== undefined) {\n // the dummy file changes every call, but the es lib chain behind it does not:\n // serve those from the shared cache so they are parsed once per cache\n const originalGetSourceFile = host.getSourceFile.bind(host);\n host.getSourceFile = (fileName, languageVersion, onError, shouldCreateNewSourceFile) => {\n const resolved = path.resolve(fileName);\n if (resolved === inMemoryFilePath) {\n return textAst;\n }\n const cached = cache.sourceFiles.get(resolved);\n if (cached !== undefined && !shouldCreateNewSourceFile) {\n return cached.sourceFile;\n }\n const sourceFile = originalGetSourceFile(fileName, languageVersion, onError, shouldCreateNewSourceFile);\n if (sourceFile !== undefined) {\n cache.sourceFiles.set(resolved, { mtimeMs: 0, sourceFile });\n }\n return sourceFile;\n };\n }\n\n const program = ts.createProgram({\n options,\n rootNames: [inMemoryFilePath, globalsShimPath],\n host,\n oldProgram: cache?.memoryOldProgram,\n });\n if (cache !== undefined) {\n cache.memoryOldProgram = program;\n }\n\n const typeChecker = program.getTypeChecker();\n memoizeCheckerCalls(typeChecker);\n const sourceFile = program.getSourceFile(inMemoryFilePath);\n\n return [ program, typeChecker, sourceFile];\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 // 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\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 { sourceFiles: new Map() };\n }\n\n constructor(config = {}, programCache?: ITranspileProgramCache) {\n this.config = config;\n this.programCache = programCache ?? Transpiler.createProgramCache();\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\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 }\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 createProgramInMemoryAndSetContext(content): ITranspileContext {\n const [ memProgram, memType, memSource] = getProgramAndTypeCheckerFromMemory(__dirname_mock, content, fastCompilerOptions, this.programCache);\n return this.setContext({\n src: memSource,\n checker: memType as ts.TypeChecker,\n program: memProgram,\n });\n }\n\n getByPathCompilerHost(options: ts.CompilerOptions): ts.CompilerHost {\n if (this.programCache.byPathHost === undefined) {\n const host = ts.createCompilerHost(options, true);\n const originalGetSourceFile = host.getSourceFile.bind(host);\n const cache = this.programCache.sourceFiles;\n host.getSourceFile = (fileName, languageVersion, onError, shouldCreateNewSourceFile) => {\n let mtimeMs = 0;\n try {\n mtimeMs = fs.statSync(fileName).mtimeMs;\n } catch (e) {\n // e.g. synthetic lib paths — fall through with mtime 0\n }\n const cached = cache.get(fileName);\n if (cached && cached.mtimeMs === mtimeMs && !shouldCreateNewSourceFile) {\n return cached.sourceFile;\n }\n const sourceFile = originalGetSourceFile(fileName, languageVersion, onError, shouldCreateNewSourceFile);\n if (sourceFile !== undefined) {\n cache.set(fileName, { mtimeMs, sourceFile });\n }\n return sourceFile;\n };\n const shimAst = ts.createSourceFile(globalsShimPath, globalsShim, ts.ScriptTarget.Latest);\n overrideHostForVirtualFiles(host, new Map([[globalsShimPath, shimAst]]));\n this.programCache.byPathHost = host;\n }\n return this.programCache.byPathHost;\n }\n\n createProgramByPathAndSetContext(path): ITranspileContext {\n const options: ts.CompilerOptions = fastCompilerOptions;\n const host = this.getByPathCompilerHost(options);\n // passing the previous program lets typescript reuse its internal state where\n // possible; the cached host makes every already-seen dependency parse-free\n const program = ts.createProgram([path, globalsShimPath], options, host, this.programCache.byPathOldProgram);\n this.programCache.byPathOldProgram = program;\n const sourceFile = program.getSourceFile(path);\n const typeChecker = program.getTypeChecker();\n memoizeCheckerCalls(typeChecker);\n\n return this.setContext({\n src: sourceFile,\n checker: typeChecker,\n program,\n });\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 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 const diagnostics = ts.getPreEmitDiagnostics(context.program, context.src);\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.messageText + \"\\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\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 transpiledContent = 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 }\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\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 }\n }\n}\n\nexport {\n Transpiler\n};\n","import { BaseTranspiler } from \"./baseTranspiler.js\";\nimport { regexAll } from \"./utils.js\";\nimport ts from 'typescript';\n\nconst SyntaxKind = ts.SyntaxKind;\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.escapedText;\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.escapedText;\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.escapedText;\n const heritageClauses = node.heritageClauses;\n\n let classInit = \"\";\n if (heritageClauses !== undefined) {\n const classExtends = heritageClauses[0].types[0].expression.escapedText;\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 === ts.SyntaxKind.EqualsEqualsToken || op === ts.SyntaxKind.EqualsEqualsEqualsToken) && node.right.kind === ts.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 ts.SyntaxKind.EqualsEqualsToken:\n return \"is\";\n case ts.SyntaxKind.ExclamationEqualsToken:\n return \"is not\";\n case ts.SyntaxKind.ExclamationEqualsEqualsToken:\n return \"is not\";\n case ts.SyntaxKind.EqualsEqualsEqualsToken:\n return \"is\";\n }\n }\n }\n}\n","import ts from 'typescript';\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(): ts.SourceFile {\n if (this.context === undefined) throw new Error(NO_CONTEXT_ERROR);\n return this.context.src;\n }\n\n getChecker(): ts.TypeChecker {\n if (this.context === undefined) throw new Error(NO_CONTEXT_ERROR);\n return this.context.checker;\n }\n\n getProgram(): ts.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 [ts.SyntaxKind.StringLiteral]: this.STRING_LITERAL_KEYWORD,\n [ts.SyntaxKind.StringKeyword]: this.STRING_KEYWORD,\n // [ts.SyntaxKind.NumberKeyword]: this.NUMBER_KEYWORD,\n [ts.SyntaxKind.NumberKeyword]: this.DEFAULT_TYPE,\n [ts.SyntaxKind.MinusMinusToken]: this.MINUS_MINUS_TOKEN,\n [ts.SyntaxKind.MinusToken]: this.MINUS_TOKEN,\n [ts.SyntaxKind.SlashToken]: this.SLASH_TOKEN,\n [ts.SyntaxKind.AsteriskToken]: this.ASTERISK_TOKEN,\n [ts.SyntaxKind.InKeyword]: this.IN_TOKEN,\n [ts.SyntaxKind.PlusToken]: this.PLUS_TOKEN,\n [ts.SyntaxKind.PercentToken]: this.PERCENT_TOKEN,\n [ts.SyntaxKind.LessThanToken]: this.LESS_THAN_TOKEN,\n [ts.SyntaxKind.LessThanEqualsToken]: this.LESS_THAN_EQUALS_TOKEN,\n [ts.SyntaxKind.GreaterThanToken]: this.GREATER_THAN_TOKEN,\n [ts.SyntaxKind.GreaterThanEqualsToken]: this.GREATER_THAN_EQUALS_TOKEN,\n [ts.SyntaxKind.EqualsEqualsToken]: this.EQUALS_EQUALS_TOKEN,\n [ts.SyntaxKind.EqualsEqualsEqualsToken]: this.EQUALS_EQUALS_EQUALS_TOKEN,\n [ts.SyntaxKind.EqualsToken]: this.EQUALS_TOKEN,\n [ts.SyntaxKind.PlusEqualsToken]: this.PLUS_EQUALS,\n [ts.SyntaxKind.BarBarToken]: this.BAR_BAR_TOKEN,\n [ts.SyntaxKind.AmpersandAmpersandToken]: this.AMPERSTAND_APERSAND_TOKEN,\n [ts.SyntaxKind.ExclamationEqualsEqualsToken]: this.EXCLAMATION_EQUALS_EQUALS_TOKEN,\n [ts.SyntaxKind.ExclamationEqualsToken]: this.EXCLAMATION_EQUALS_TOKEN,\n [ts.SyntaxKind.AsyncKeyword]: this.ASYNC_TOKEN,\n [ts.SyntaxKind.AwaitKeyword]: this.AWAIT_TOKEN,\n [ts.SyntaxKind.StaticKeyword]: this.STATIC_TOKEN,\n [ts.SyntaxKind.PublicKeyword]: this.PUBLIC_KEYWORD,\n [ts.SyntaxKind.PrivateKeyword]: this.PRIVATE_KEYWORD,\n [ts.SyntaxKind.VoidKeyword]: this.VOID_KEYWORD,\n [ts.SyntaxKind.BooleanKeyword]: this.BOOLEAN_KEYWORD,\n };\n\n this.PostFixOperators = {\n [ts.SyntaxKind.PlusPlusToken]: this.PLUS_PLUS_TOKEN,\n [ts.SyntaxKind.MinusMinusToken]: this.MINUS_MINUS_TOKEN,\n };\n\n this.PrefixFixOperators = {\n [ts.SyntaxKind.ExclamationToken]: this.NOT_TOKEN,\n [ts.SyntaxKind.MinusToken]: this.MINUS_TOKEN,\n };\n\n this.FunctionDefSupportedKindNames = {\n [ts.SyntaxKind.StringKeyword]: this.STRING_KEYWORD\n };\n\n this.FuncModifiers = {\n [ts.SyntaxKind.AsyncKeyword]: this.ASYNC_TOKEN,\n [ts.SyntaxKind.PublicKeyword]: this.PUBLIC_KEYWORD,\n [ts.SyntaxKind.PrivateKeyword]: this.PRIVATE_KEYWORD,\n [ts.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: ts.TypeFlags) {\n return flags === ts.TypeFlags.String || flags === ts.TypeFlags.StringLiteral;\n }\n\n isAnyType(flags: ts.TypeFlags) {\n return flags === ts.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 === ts.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 || !ts.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: ts.Node): ts.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 (!ts.isClassDeclaration(node.parent)) {\n return undefined;\n }\n\n // Get the class declaration\n const classDeclaration = node.parent as ts.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 = (ts as any).getAllSuperTypeNodes(node.parent)[0];\n\n while (parentClass !== undefined) {\n const parentClassType = this.getChecker().getTypeAtLocation(parentClass);\n const parentClassDecl = parentClassType?.symbol?.valueDeclaration;\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 (ts.isMethodDeclaration(elem)) {\n\n const name = elem.name.getText().trim();\n if ((node as any).name.escapedText === name) {\n method = elem;\n }\n }\n });\n\n parentClass = (ts as any).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) {\n return name;\n }\n\n transformPropertyAccessExpressionName(name: string) {\n return name;\n }\n\n printIdentifier(node) {\n let idValue = node.text ?? node.escapedText;\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 === ts.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.escapedText;\n const right = node.right.escapedText;\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 == ts.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 === ts.SyntaxKind.EqualsEqualsToken || operatorToken.kind === ts.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 === ts.SyntaxKind.BarBarToken || operatorToken.kind === ts.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.escapedText;\n let rightSide = node.name.escapedText;\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);\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 !== ts.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 = 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 printTraillingComment(node, identation) {\n const fullText = this.getSrc().getFullText();\n const commentsRangeList = ts.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 === ts.SyntaxKind.TypeReference) {\n const typeRef = type.typeName.escapedText;\n if (typeRef === \"Promise\") {\n const typeArgs = type.typeArguments.filter(t => t.kind !== ts.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.escapedText;\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.escapedText;\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 (ts.isArrayLiteralExpression(initializer)) {\n return this.ARRAY_KEYWORD;\n }\n if ((ts as any).isBooleanLiteral(initializer)) {\n return this.BOOLEAN_KEYWORD;\n }\n if (ts.isObjectLiteralExpression(initializer)) {\n return this.OBJECT_KEYWORD;\n }\n if (ts.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 (ts.isStringLiteralLike(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 === ts.TypeFlags.Any) {\n return undefined;\n }\n if (type.flags === ts.TypeFlags.Void) {\n return this.VOID_KEYWORD;\n }\n if (type.flags === ts.TypeFlags.Number) {\n // return this.NUMBER_KEYWORD;\n return this.DEFAULT_TYPE;\n }\n\n if (type.flags === ts.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?.symbol?.escapedName === 'Array') {\n return this.ARRAY_KEYWORD;\n }\n if (type?.symbol?.escapedName === '__object') {\n return this.OBJECT_KEYWORD;\n }\n\n // check this out, trying to resolve Promise<{}>\n if (type?.symbol?.escapedName === '__type') {\n return this.OBJECT_KEYWORD;\n // return this.DEFAULT_TYPE;\n }\n\n // check for promise type\n\n if (type?.symbol?.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 = (type as any).resolvedTypeArguments; // internal typescript property\n if (resolvedTypeArguments.length === 0) {\n return this.PROMISE_TYPE_KEYWORD;\n }\n if (resolvedTypeArguments.length === 1 && resolvedTypeArguments[0].flags === ts.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?.escapedText ?? \"\";\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 && ts.isFunctionDeclaration(node)){\n modifiers = modifiers + \"public \";\n }\n let functionDef = this.getIden(identation) + modifiers + returnType + fnKeyword;\n if (this.includeFunctionNameInFunctionExpressionDeclaration || !ts.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 (ts.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.escapedText;\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 && (ts.isFunctionExpression(declaration.initializer) || ts.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?.getDeclarations()\n ?.some(s => s.getSourceFile().fileName.includes(\"/node_modules/typescript/lib/\"))\n ?? false;\n\n\n return isInLibFiles;\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 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 === ts.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?.escapedText;\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.escapedText === \"assert\") {\n return this.printAssertCall(node, identation, parsedArgs);\n }\n if (expression.escapedText === \"padEnd\") {\n // check this\n }\n }\n }\n\n // print super() call inside constructor\n if (expression.kind === ts.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 === ts.SyntaxKind.Identifier) {\n const idValue = expression.text ?? expression.escapedText;\n parsedExpression = this.transformCallExpressionName(this.unCamelCaseIfNeeded(idValue));\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 === ts.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.escapedText;\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.escapedText;\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 === ts.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 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 === ts.SyntaxKind.BinaryExpression &&\n (node.parent.operatorToken.kind === ts.SyntaxKind.EqualsToken || node.parent.operatorToken.kind === ts.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 === ts.TypeFlags.Union) {\n isUnionString = this.isStringType((type as any)?.types[0].flags);\n }\n\n if (isString || isUnionString || type.flags === ts.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 = ts.isStringLiteralLike(argumentExpression) ? \"\" : '(string)';\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 === ts.SyntaxKind.PrefixUnaryExpression && node.operator === ts.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 === ts.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 === ts.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 === ts.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 === ts.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 === ts.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 (ts.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?.escapedText;\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 || ts.isAwaitExpression(exp)\n || !this.isImplicitAsyncFunction(ts.findAncestor(node, ts.isFunctionLike))\n || !this.isPromiseType(this.getChecker().getTypeAtLocation(exp))) {\n return node;\n }\n if (ts.isConditionalExpression(exp) || ts.isBinaryExpression(exp)) {\n // an await-token prefix would change precedence (e.g. `await a ? b : c`)\n exp = this.wrapSyntheticNode(ts.factory.createParenthesizedExpression(exp), exp);\n }\n node.expression = this.wrapSyntheticNode(ts.factory.createAwaitExpression(exp), exp);\n return node;\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 === ts.SyntaxKind.FunctionDeclaration || parent.kind === ts.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 ts.SyntaxKind.ExpressionStatement:\n return this.printExpressionStatement(node, identation);\n case ts.SyntaxKind.Block:\n return this.printBlock(node, identation);\n case ts.SyntaxKind.FunctionDeclaration:\n case ts.SyntaxKind.FunctionExpression:\n case ts.SyntaxKind.ArrowFunction:\n return this.printFunctionDeclaration(node, identation);\n case ts.SyntaxKind.ClassDeclaration:\n return this.printClass(node, identation);\n case ts.SyntaxKind.VariableStatement:\n return this.printVariableStatement(node, identation);\n case ts.SyntaxKind.MethodDeclaration:\n return this.printMethodDeclaration(node, identation);\n case ts.SyntaxKind.StringLiteral:\n return this.printStringLiteral(node);\n case ts.SyntaxKind.NumericLiteral:\n return this.printNumericLiteral(node);\n case ts.SyntaxKind.PropertyAccessExpression:\n return this.printPropertyAccessExpression(node, identation);\n case ts.SyntaxKind.ArrayLiteralExpression:\n return this.printArrayLiteralExpression(node, identation);\n case ts.SyntaxKind.CallExpression:\n return this.printCallExpression(node, identation);\n case ts.SyntaxKind.WhileStatement:\n return this.printWhileStatement(node, identation);\n case ts.SyntaxKind.BinaryExpression:\n return this.printBinaryExpression(node, identation);\n case ts.SyntaxKind.BreakStatement:\n return this.printBreakStatement(node, identation);\n case ts.SyntaxKind.ForStatement:\n return this.printForStatement(node, identation);\n case ts.SyntaxKind.PostfixUnaryExpression:\n return this.printPostFixUnaryExpression(node, identation);\n case ts.SyntaxKind.VariableDeclarationList:\n return this.printVariableDeclarationList(node, identation); // statements are slightly different if inside a for\n case ts.SyntaxKind.ObjectLiteralExpression:\n return this.printObjectLiteralExpression(node, identation);\n case ts.SyntaxKind.PropertyAssignment:\n return this.printPropertyAssignment(node, identation);\n case ts.SyntaxKind.Identifier:\n return this.printIdentifier(node);\n case ts.SyntaxKind.ElementAccessExpression:\n return this.printElementAccessExpression(node, identation);\n case ts.SyntaxKind.IfStatement:\n return this.printIfStatement(node, identation);\n case ts.SyntaxKind.ParenthesizedExpression:\n return this.printParenthesizedExpression(node, identation);\n case ts.SyntaxKind.TrueKeyword:\n case ts.SyntaxKind.FalseKeyword:\n return this.printBooleanLiteral(node);\n case ts.SyntaxKind.ThisKeyword:\n return this.printThisKeyword(node, identation);\n case ts.SyntaxKind.SuperKeyword:\n return this.SUPER_TOKEN;\n case ts.SyntaxKind.TryStatement:\n return this.printTryStatement(node, identation);\n case ts.SyntaxKind.PrefixUnaryExpression:\n return this.printPrefixUnaryExpression(node, identation);\n case ts.SyntaxKind.ThrowStatement:\n return this.printThrowStatement(node, identation);\n case ts.SyntaxKind.NewExpression:\n return this.printNewExpression(node, identation);\n case ts.SyntaxKind.AwaitExpression:\n return this.printAwaitExpression(node, identation);\n case ts.SyntaxKind.ConditionalExpression:\n return this.printConditionalExpression(node, identation);\n case ts.SyntaxKind.AsExpression:\n return this.printAsExpression(node, identation);\n case ts.SyntaxKind.ReturnStatement:\n return this.printReturnStatement(this.wrapImplicitReturnAwait(node), identation);\n case ts.SyntaxKind.ArrayBindingPattern:\n return this.printArrayBindingPattern(node, identation);\n case ts.SyntaxKind.Parameter:\n return this.printParameter(node);\n case ts.SyntaxKind.Constructor:\n return this.printConstructorDeclaration(node, identation);\n case ts.SyntaxKind.PropertyDeclaration:\n return this.printPropertyDeclaration(node, identation);\n case ts.SyntaxKind.SpreadElement:\n return this.printSpreadElement(node, identation);\n case ts.SyntaxKind.NullKeyword:\n return this.printNullKeyword(node, identation);\n case ts.SyntaxKind.ContinueStatement:\n return this.printContinueStatement(node, identation);\n case ts.SyntaxKind.DeleteExpression:\n return this.printDeleteExpression(node, identation);\n }\n\n if (node.statements) {\n if (ts.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) => ts.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.escapedText;\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 && ts.isCallExpression(dec.initializer) && dec.initializer.expression.getText() === \"require\";\n }\n\n isCJSModuleExportsExpressionStatement(node): boolean {\n if (node.expression && node.expression.kind === ts.SyntaxKind.BinaryExpression ) {\n if (node.expression.left.kind === ts.SyntaxKind.PropertyAccessExpression) {\n const left = node.expression.left as ts.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 => ts.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 === ts.SyntaxKind.CallExpression) {\n const callExpression = decNode.initializer.expression.getText();\n if (callExpression === \"require\") {\n const isDefault = decNode.name.kind === ts.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) => ts.isExportDeclaration(s));\n const defaultExport = node.statements.filter((s) => ts.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 ts.BinaryExpression);\n\n moduleExports.forEach(node => {\n const right = node.right;\n if (right.kind === ts.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 === ts.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) => ts.isClassDeclaration(s));\n const functionDeclarations = node.statements.filter((s) => ts.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 === ts.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 func2Type = this.getChecker().getTypeOfSymbolAtLocation(bType.symbol, bType.symbol.valueDeclaration);\n const func2Signature = this.getChecker().getSignaturesOfType(func2Type, ts.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?.escapedText;\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 = ts.TypeFlags[type.flags];\n return result;\n }\n }\n\n const name = node.type?.typeName?.escapedText;\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) => ts.isClassDeclaration(s));\n classDeclarations.forEach((node) => {\n const methods = node.members.filter((m) => ts.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 ts from 'typescript';\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: ts.SourceFile;\n checker: ts.TypeChecker;\n program: ts.Program;\n}\n\n// Parsed SourceFiles (the es lib chain plus the import closure of everything\n// transpiled so far) and the last program built from them, so the next program\n// reuses that work instead of re-parsing it. Shareable between Transpiler\n// instances running on the same thread; these are plain V8 heap objects, so a\n// worker_threads isolate cannot receive one and needs a cache of its own.\ninterface ITranspileProgramCache {\n sourceFiles: Map;\n byPathHost?: ts.CompilerHost;\n byPathOldProgram?: ts.Program;\n memoryOldProgram?: ts.Program;\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}\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 ts, { TypeChecker } from 'typescript';\nimport { unCamelCase, regexAll } from \"./utils.js\";\nimport { Logger } from \"./logger.js\";\n\nconst SyntaxKind = ts.SyntaxKind;\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 if (symbol && symbol.valueDeclaration) {\n const valueDecl = symbol.valueDeclaration;\n\n // Check if it's a function (FunctionDeclaration, FunctionExpression, ArrowFunction)\n if (ts.isFunctionDeclaration(valueDecl) || ts.isFunctionExpression(valueDecl) || ts.isArrowFunction(valueDecl)) {\n // Check if the identifier is passed as an argument in a function call\n if (node.parent && ts.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 === ts.TypeFlags.String || rightType.flags === ts.TypeFlags.String) {\n return TOKEN;\n }\n if (leftType.flags === ts.TypeFlags.StringLiteral || rightType.flags === ts.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 TypeChecker).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.escapedText;\n const right = node.right.escapedText;\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?.escapedText;\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.escapedText ?? 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 === ts.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 ts, { TypeChecker } from 'typescript';\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\nexport class CSharpTranspiler 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.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 = {\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.binaryExpressionsWrappers = {\n [ts.SyntaxKind.EqualsEqualsToken]: [this.EQUALS_EQUALS_WRAPPER_OPEN, this.EQUALS_EQUALS_WRAPPER_CLOSE],\n [ts.SyntaxKind.EqualsEqualsEqualsToken]: [this.EQUALS_EQUALS_WRAPPER_OPEN, this.EQUALS_EQUALS_WRAPPER_CLOSE],\n [ts.SyntaxKind.ExclamationEqualsToken]: [this.DIFFERENT_WRAPPER_OPEN, this.DIFFERENT_WRAPPER_CLOSE],\n [ts.SyntaxKind.ExclamationEqualsEqualsToken]: [this.DIFFERENT_WRAPPER_OPEN, this.DIFFERENT_WRAPPER_CLOSE],\n [ts.SyntaxKind.GreaterThanToken]: [this.GREATER_THAN_WRAPPER_OPEN, this.GREATER_THAN_WRAPPER_CLOSE],\n [ts.SyntaxKind.GreaterThanEqualsToken]: [this.GREATER_THAN_EQUALS_WRAPPER_OPEN, this.GREATER_THAN_EQUALS_WRAPPER_CLOSE],\n [ts.SyntaxKind.LessThanToken]: [this.LESS_THAN_WRAPPER_OPEN, this.LESS_THAN_WRAPPER_CLOSE],\n [ts.SyntaxKind.LessThanEqualsToken]: [this.LESS_THAN_EQUALS_WRAPPER_OPEN, this.LESS_THAN_EQUALS_WRAPPER_CLOSE],\n [ts.SyntaxKind.PlusToken]: [this.PLUS_WRAPPER_OPEN, this.PLUS_WRAPPER_CLOSE],\n [ts.SyntaxKind.MinusToken]: [this.MINUS_WRAPPER_OPEN, this.MINUS_WRAPPER_CLOSE],\n [ts.SyntaxKind.AsteriskToken]: [this.MULTIPLY_WRAPPER_OPEN, this.MULTIPLY_WRAPPER_CLOSE],\n [ts.SyntaxKind.PercentToken]: [this.MOD_WRAPPER_OPEN, this.MOD_WRAPPER_CLOSE],\n [ts.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 printIdentifier(node) {\n let idValue = node.text ?? node.escapedText;\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?.symbol;\n if (symbol !== undefined) {\n // const declarations = this.getChecker().getDeclaredTypeOfSymbol(symbol).symbol?.declarations ?? [];\n const decl = symbol?.declarations ?? [];\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 === ts.SyntaxKind.ClassDeclaration);\n const isInsideNewExpression = node?.parent?.kind === ts.SyntaxKind.NewExpression;\n const isInsideCatch = node?.parent?.kind === ts.SyntaxKind.ThrowStatement;\n const isLeftSide = node?.parent?.name === node || (node?.parent?.left === node);\n const isCallOrPropertyAccess = node?.parent?.kind === ts.SyntaxKind.PropertyAccessExpression || node?.parent?.kind === ts.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];\n if (first.kind === ts.SyntaxKind.ClassDeclaration) {\n isClassDeclaration = true;\n }\n if (first.kind === ts.SyntaxKind.ImportSpecifier) {\n const importedSymbol = this.getChecker().getAliasedSymbol(symbol);\n if (importedSymbol?.declarations[0]?.kind === ts.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 superCallParams = '';\n let hasSuperCall = false;\n node.body?.statements.forEach(statement => {\n if (ts.isExpressionStatement(statement)) {\n const expression = statement.expression;\n if (ts.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 printThisElementAccesssIfNeeded(node, identation) {\n // convert this[method] into this.call(method) or this.callAsync(method)\n // const isAsync = node?.parent?.kind === ts.SyntaxKind.AwaitExpression;\n const isAsync = true; // setting to true for now, because there are some scenarios where we don't know\n // if the call is async or not, so we need to assume it is async\n // example Promise.all([this.unknownPropAsync()])\n const elementAccess = node.expression;\n if (elementAccess?.kind === ts.SyntaxKind.ElementAccessExpression) {\n if (elementAccess?.expression?.kind === ts.SyntaxKind.ThisKeyword) {\n let parsedArg = node.arguments?.length > 0 ? this.printNode(node.arguments[0], identation).trimStart() : \"\";\n const propName = this.printNode(elementAccess.argumentExpression, 0);\n const wrapperOpen = isAsync ? this.UKNOWN_PROP_ASYNC_WRAPPER_OPEN : this.UKNOWN_PROP_WRAPPER_OPEN;\n const wrapperClose = isAsync ? this.UNKOWN_PROP_ASYNC_WRAPPER_CLOSE : this.UNKOWN_PROP_WRAPPER_CLOSE;\n parsedArg = parsedArg ? \", \" + parsedArg : \"\";\n return wrapperOpen + propName + parsedArg + wrapperClose;\n }\n }\n return;\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 === ts.SyntaxKind.ElementAccessExpression) {\n const parsedArg = node.arguments?.length > 0 ? 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 const argsArray = `new object[] { ${parsedArg} }`;\n const open = this.DYNAMIC_CALL_OPEN;\n let statement = `${open}${target}, ${propName}, ${argsArray})`;\n statement = isAsync ? `((Task)${statement})` : statement;\n return statement;\n }\n return undefined;\n }\n\n\n printElementAccessExpressionExceptionIfAny(node) {\n // convert this[method] into this.call(method) or this.callAsync(method)\n // if (node?.expression?.kind === ts.SyntaxKind.ThisKeyword) {\n // const isAsyncDecl = node?.parent?.kind === ts.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 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.escapedText;\n // const isAsyncDecl = true;\n const isAsyncDecl = node?.parent?.kind === ts.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 printOutOfOrderCallExpressionIfAny(node, identation) {\n if (node.expression.kind === ts.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 `mathMin(${parsedArg1}, ${parsedArg2})`;\n case \"Math.max\":\n return `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 === ts.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 === ts.SyntaxKind.ExclamationEqualsEqualsToken || op === ts.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 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 === ts.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 === ts.SyntaxKind.EqualsToken && left.kind === ts.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 = `var ${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) + `${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 === ts.SyntaxKind.InKeyword) {\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 === ts.SyntaxKind.PlusEqualsToken || op === ts.SyntaxKind.MinusEqualsToken || op in this.binaryExpressionsWrappers) {\n const leftText = this.printNode(left, 0);\n const rightText = this.printNode(right, 0);\n\n if (op === ts.SyntaxKind.PlusEqualsToken) {\n return `${leftText} = add(${leftText}, ${rightText})`;\n }\n\n if (op === ts.SyntaxKind.MinusEqualsToken) {\n return `${leftText} = subtract(${leftText}, ${rightText})`;\n }\n\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 // x = y\n // cast y to x type when y is unknown\n // if (op === ts.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 printVariableDeclarationList(node,identation) {\n const declaration = node.declarations[0];\n // const name = declaration.name.escapedText;\n\n if (this.removeVariableDeclarationForFunctionExpression && declaration?.initializer && ts.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 === ts.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)}var ${syntheticName} = ${this.printNode(declaration.initializer, 0)};\\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} = ((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 === ts.SyntaxKind.NewExpression);\n const varToken = isNew ? 'var ' : this.VAR_TOKEN + ' ' ;\n\n // handle default undefined initialization\n if (declaration?.initializer && declaration.initializer === undefined) {\n // handle the let id: Str; case\n return this.getIden(identation) + varToken + this.printNode(declaration.name) + \" = \" + this.UNDEFINED_TOKEN;\n } else 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 return this.getIden(identation) + varToken + 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.escapedText;\n\n let rawExpression = undefined;\n\n switch(rightSide) {\n case 'length':\n const type = (this.getChecker() as TypeChecker).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) ? `((string)${leftSide}).Length` : `${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 (ts.isArrayLiteralExpression(node) || ts.isObjectLiteralExpression(node) || ts.isStringLiteral(node) || (ts as any).isBooleanLiteral(node)) {\n return this.UNDEFINED_TOKEN;\n }\n\n if (ts.isNumericLiteral(node)) {\n return this.UNDEFINED_TOKEN;\n }\n\n // convert x: number = undefined (invalid) into x = -1 (valid)\n if (node?.escapedText === \"undefined\" && this.getChecker().getTypeAtLocation(node?.parent)?.flags === ts.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 (ts.isArrayLiteralExpression(initializer)) {\n initParams.push(`${this.printNode(param.name, 0)} ??= new List();`);\n }\n if (ts.isObjectLiteralExpression(initializer)) {\n initParams.push(`${this.printNode(param.name, 0)} ??= new Dictionary();`);\n }\n if (ts.isNumericLiteral(initializer)) {\n initParams.push(`${this.printNode(param.name, 0)} ??= ${this.printNode(initializer, 0)};`);\n }\n if (ts.isStringLiteral(initializer)) {\n initParams.push(`${this.printNode(param.name, 0)} ??= ${this.printNode(initializer, 0)};`);\n }\n if ((ts as any).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.escapedText;\n const right = node.right.escapedText;\n return this.getIden(identation) + `${left} is ${right}`;\n }\n\n printAsExpression(node, identation) {\n const type = node.type;\n\n if (type.kind === ts.SyntaxKind.AnyKeyword) {\n return `((object)${this.printNode(node.expression, identation)})`;\n }\n\n if (type.kind === ts.SyntaxKind.StringKeyword) {\n return `((string)${this.printNode(node.expression, identation)})`;\n }\n\n if (type.kind === ts.SyntaxKind.ArrayType) {\n if (type.elementType.kind === ts.SyntaxKind.AnyKeyword) {\n return `(IList)(${this.printNode(node.expression, identation)})`;\n }\n if (type.elementType.kind === ts.SyntaxKind.StringKeyword) {\n return `(IList)(${this.printNode(node.expression, identation)})`;\n }\n }\n\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 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 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 printArrayLiteralExpression(node) {\n\n let arrayOpen = this.ARRAY_OPENING_TOKEN;\n const elems = node.elements;\n\n const elements = node.elements.map((e) => {\n return this.printNode(e);\n }).join(\", \");\n\n // take into consideration list of promises\n if (elems.length > 0) {\n const first = elems[0];\n if (first.kind === ts.SyntaxKind.CallExpression) {\n // const type = this.getChecker().getTypeAtLocation(first);\n let type = this.getFunctionType(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 printMethodDefinition(node, identation) {\n let name = node.name.escapedText;\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 = \"\";\n parentArgs.forEach((param, index) => {\n const originalName = this.printNode(currentArgs[index].name, 0);\n const parsedArg = this.printParameteCustomName(param, originalName);\n parsedArgs+= parsedArg;\n if (index < parentArgs.length - 1) {\n parsedArgs+= \", \";\n }\n });\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 printArgsForCallExpression(node, identation) {\n const args = node.arguments;\n let parsedArgs = \"\";\n if (false && this.requiresCallExpressionCast && !this.isBuiltInFunctionCall(node?.expression)) { //eslint-disable-line\n const parsedTypes = this.getTypesFromCallExpressionParameters(node);\n const tmpArgs = [];\n args.forEach((arg, index) => {\n const parsedType = parsedTypes[index];\n let cast = \"\";\n if (parsedType !== \"object\" && parsedType !== \"float\" && parsedType !== \"int\") {\n cast = parsedType ? `(${parsedType})` : '';\n }\n tmpArgs.push(cast + this.printNode(arg, identation).trim());\n });\n parsedArgs = tmpArgs.join(\",\");\n return parsedArgs;\n }\n return super.printArgsForCallExpression(node, identation);\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 return `new List(((IDictionary)${parsedArg}).Keys)`;\n }\n\n printObjectValuesCall(node, identation, parsedArg = undefined) {\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 return `((IList)${name}).Add(${parsedArg})`;\n }\n\n printIncludesCall(node, identation, name = undefined, parsedArg = undefined) {\n return `${name}.Contains(${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 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 return `String.Join(${parsedArg}, ((IList)${name}).ToArray())`;\n }\n\n printSplitCall(node, identation, name = undefined, parsedArg = undefined) {\n return `((string)${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 `((string)${name}).ToUpper()`;\n }\n\n printToLowerCaseCall(node, identation, name = undefined) {\n return `((string)${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 printAssertCall(node, identation, parsedArgs) {\n return `assert(${parsedArgs})`;\n }\n\n printSliceCall(node, identation, name = undefined, parsedArg = undefined, parsedArg2 = undefined) {\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 printReplaceCall(node, identation, name = undefined, parsedArg = undefined, parsedArg2 = undefined) {\n return `((string)${name}).Replace((string)${parsedArg}, (string)${parsedArg2})`;\n }\n\n printReplaceAllCall(node, identation, name = undefined, parsedArg = undefined, parsedArg2 = undefined) {\n return `((string)${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 TypeChecker).getTypeAtLocation(node.expression); // eslint-disable-line\n this.warnIfAnyType(node, type.flags, leftSide, \"length\");\n return this.isStringType(type.flags) ? `((string)${leftSide}).Length` : `${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 === ts.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 === ts.SyntaxKind.NumericLiteral) {\n return super.printPrefixUnaryExpression(node, identation);\n }\n if (operator === ts.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 === ts.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.printCondition(node.condition, 0);\n const whenTrue = this.printNode(node.whenTrue, 0);\n const whenFalse = this.printNode(node.whenFalse, 0);\n\n return `((bool) ${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 `((IDictionary)${object}).Remove((string)${key})`;\n }\n\n printNewExpression(node, identation) {\n let expression = node.expression?.escapedText;\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 === ts.SyntaxKind.Identifier) {\n return this.getIden(identation) + this.THROW_TOKEN + ' ' + this.printNode(node.expression, 0) + this.LINE_TERMINATOR;\n }\n if (node.expression.kind === ts.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 === ts.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.escapedText === 'Error' ? 'Exception' : id.escapedText;\n const symbol = this.getChecker().getSymbolAtLocation(expression.expression);\n if (symbol) {\n const declarations = this.getChecker().getDeclaredTypeOfSymbol(symbol).symbol?.declarations ?? [];\n const isClassDeclaration = declarations.find(l => l.kind === ts.SyntaxKind.InterfaceDeclaration || l.kind === ts.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.escapedText ? newExpression : idName} (${parsedArg}) ${this.LINE_TERMINATOR}`;\n } else if (expression.expression.kind === ts.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?.escapedText;\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 csModifiers = {\n\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) {\n if (node.type.kind === ts.SyntaxKind.AnyKeyword) {\n typeText = this.OBJECT_KEYWORD + ' ';\n }\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 ts, { BinaryExpression, CallExpression, TypeChecker } from 'typescript';\n\nconst SyntaxKind = ts.SyntaxKind;\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': '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': '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\nexport class GoTranspiler extends BaseTranspiler {\n\n binaryExpressionsWrappers;\n wrapThisCalls: boolean;\n wrapCallMethods: string[] = [];\n classNameMap: { [key: string]: string };\n DEFAULT_RETURN_TYPE = 'any';\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 }\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 [ts.SyntaxKind.EqualsEqualsToken]: [this.EQUALS_EQUALS_WRAPPER_OPEN, this.EQUALS_EQUALS_WRAPPER_CLOSE],\n [ts.SyntaxKind.EqualsEqualsEqualsToken]: [this.EQUALS_EQUALS_WRAPPER_OPEN, this.EQUALS_EQUALS_WRAPPER_CLOSE],\n [ts.SyntaxKind.ExclamationEqualsToken]: [this.DIFFERENT_WRAPPER_OPEN, this.DIFFERENT_WRAPPER_CLOSE],\n [ts.SyntaxKind.ExclamationEqualsEqualsToken]: [this.DIFFERENT_WRAPPER_OPEN, this.DIFFERENT_WRAPPER_CLOSE],\n [ts.SyntaxKind.GreaterThanToken]: [this.GREATER_THAN_WRAPPER_OPEN, this.GREATER_THAN_WRAPPER_CLOSE],\n [ts.SyntaxKind.GreaterThanEqualsToken]: [this.GREATER_THAN_EQUALS_WRAPPER_OPEN, this.GREATER_THAN_EQUALS_WRAPPER_CLOSE],\n [ts.SyntaxKind.LessThanToken]: [this.LESS_THAN_WRAPPER_OPEN, this.LESS_THAN_WRAPPER_CLOSE],\n [ts.SyntaxKind.LessThanEqualsToken]: [this.LESS_THAN_EQUALS_WRAPPER_OPEN, this.LESS_THAN_EQUALS_WRAPPER_CLOSE],\n [ts.SyntaxKind.PlusToken]: [this.PLUS_WRAPPER_OPEN, this.PLUS_WRAPPER_CLOSE],\n [ts.SyntaxKind.MinusToken]: [this.MINUS_WRAPPER_OPEN, this.MINUS_WRAPPER_CLOSE],\n [ts.SyntaxKind.AsteriskToken]: [this.MULTIPLY_WRAPPER_OPEN, this.MULTIPLY_WRAPPER_CLOSE],\n [ts.SyntaxKind.PercentToken]: [this.MOD_WRAPPER_OPEN, this.MOD_WRAPPER_CLOSE],\n [ts.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\n printPropertyDeclaration(node, identation) {\n // let modifiers = this.printModifiers(node);\n // modifiers = modifiers ? modifiers + \" \" : modifiers;\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 || (ts as any).isBooleanLiteral(node)) {\n type = 'bool';\n } else if (node.type.kind === SyntaxKind.ArrayType) {\n type = '[]any';\n }\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 return this.getIden(identation) + name + ' ' + type + ' ' + `\\`default:\"${initializer}\"\\`` + this.LINE_TERMINATOR;\n }\n return this.getIden(identation) + name + ' ' + type + this.LINE_TERMINATOR;\n }\n\n printStruct(node, indentation) {\n\n // check if we have heritage\n let heritageName = '';\n if (node?.heritageClauses?.length > 0) {\n const heritage = node.heritageClauses[0];\n const heritageType = heritage.types[0];\n let heritageEscapedText = heritageType.expression.escapedText;\n if (this.classNameMap[heritageEscapedText]) {\n heritageEscapedText = this.classNameMap[heritageEscapedText];\n }\n heritageName = this.getIden(indentation+1) + heritageEscapedText + '\\n';\n }\n\n const propDeclarations = node.members.filter(member => member.kind === SyntaxKind.PropertyDeclaration);\n return `type ${this.className} struct {\\n${heritageName}${propDeclarations.map(member => this.printNode(member, indentation+1)).join(\"\\n\")}\\n}`;\n }\n\n printNewStructMethod(node){\n return `\nfunc New${this.capitalize(this.className)}() *${(this.className)} {\n p := &${this.className}{}\n setDefaults(p)\n return 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.escapedText;\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 = methods.map(method => this.printMethodDeclaration(method, identation)).join(\"\\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 return struct + \"\\n\" + newMethod + \"\\n\" + classMethods;\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\n let methodDef = this.printMethodDefinition(node, identation);\n\n const isAsync = this.isAsyncFunction(node);\n\n const funcBody = this.printFunctionBody(node, identation, isAsync);\n\n methodDef += funcBody;\n\n return methodDef;\n }\n\n printFunctionDeclaration(node, identation) {\n if (ts.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 let functionDef = this.printFunctionDefinition(node, identation);\n const funcBody = this.printFunctionBody(node, identation, isAsync);\n functionDef += funcBody;\n\n return this.printNodeCommentsIfAny(node, identation, functionDef);\n }\n\n printMethodDefinition(node, identation) {\n let name = node.name.escapedText;\n name = this.transformMethodNameIfNeeded(name);\n\n let returnType = this.printFunctionType(node);\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) + returnType + methodToken + name\n // + \"(\" + parsedArgs + \")\";\n const structReceiver = `(${this.THIS_TOKEN} *${this.className})`;\n const methodDef = this.getIden(identation) + methodToken + \" \" + structReceiver + \" \" + name + \"(\" + parsedArgs + \") \" + returnType;\n\n return this.printNodeCommentsIfAny(node, identation, methodDef);\n }\n\n\n printFunctionDefinition(node, identation) {\n let name = node.name.escapedText;\n name = this.transformMethodNameIfNeeded(name);\n\n let returnType = this.printFunctionType(node);\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) + returnType + methodToken + name\n // + \"(\" + parsedArgs + \")\";\n const methodDef = this.getIden(identation) + methodToken + name + \"(\" + parsedArgs + \") \" + returnType;\n\n return this.printNodeCommentsIfAny(node, identation, methodDef);\n }\n\n printMethodParameters(node) {\n const params = node.parameters.map(param => this.printParameter(param));\n const hasOptionalParameter = params.some(p => p === 'optional');\n if (!hasOptionalParameter) {\n return params.join(\", \");\n }\n const paramsWithOptional = params.filter(param => param !== 'optional');\n paramsWithOptional.push('optionalArgs ...any');\n return paramsWithOptional.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) {\n if (initializer) {\n return 'optional'; // will be handled later\n }\n // not supported we have to find an alternative for go like defining multiple methods with different parameters\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 name + ' ' + type;\n }\n return name + ' ' + type;\n }\n\n printParameterType(node) {\n const typeText = this.getType(node);\n // // if (typeText === this.BOOLEAN_KEYWORD) {\n // // return typeText;\n // // }\n\n //tmp default to interface\n return 'any';\n\n if (typeText === this.STRING_KEYWORD) {\n return 'string';\n }\n if (typeText === this.NUMBER_KEYWORD) {\n return 'float64';\n }\n\n if (typeText === this.BOOLEAN_KEYWORD) {\n return 'bool';\n }\n\n return this.DEFAULT_PARAMETER_TYPE;\n\n if (typeText === undefined || typeText === this.STRING_KEYWORD) {\n // throw new FunctionReturnTypeError(\"Parameter type is not supported or undefined\");\n this.warn(node, node.getText(), \"Parameter type not found, will default to: \" + this.DEFAULT_PARAMETER_TYPE);\n return this.DEFAULT_PARAMETER_TYPE;\n }\n return typeText;\n\n }\n\n printFunctionType(node){\n const typeText = this.getFunctionType(node);\n if (typeText === 'void') {\n // // If the function is async (returns a Promise in TS) but declared void, emit a typed channel\n // if (this.isAsyncFunction(node)) {\n // // Ensure element type is present; some edge cases yield '<- chan' only\n // const elementType = this.DEFAULT_RETURN_TYPE || 'any';\n // return `<- chan ${elementType}`;\n // }\n return \"\";\n }\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 = `<- chan ${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 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 printVariableDeclarationList(node,identation) {\n const declaration = node.declarations[0];\n // const varToken = this.VAR_TOKEN ? this.VAR_TOKEN + \" \": \"\";\n // const name = declaration.name.escapedText;\n\n if (declaration?.name.kind === ts.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)}${syntheticName} := ${this.printNode(declaration.initializer, 0)};\\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) + `${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 (declaration?.initializer?.kind=== ts.SyntaxKind.AwaitExpression) {\n const parsedName = this.printNode(declaration.name, 0);\n const parsedInitializer = this.printNode(declaration.initializer, 0);\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 === ts.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 === ts.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 stm = this.getIden(identation) + \"var \" + varName + \" any = \" + parsedValue;\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?.escapedText;\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 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 (ts.isExpressionStatement(statement)) {\n const expression = statement.expression;\n if (ts.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 printThisElementAccesssIfNeeded(node, identation) {\n // convert this[method] into this.call(method) or this.callAsync(method)\n // const isAsync = node?.parent?.kind === ts.SyntaxKind.AwaitExpression;\n const isAsync = true; // setting to true for now, because there are some scenarios where we don't know\n // if the call is async or not, so we need to assume it is async\n // example Promise.all([this.unknownPropAsync()])\n const elementAccess = node.expression;\n if (elementAccess?.kind === ts.SyntaxKind.ElementAccessExpression) {\n if (elementAccess?.expression?.kind === ts.SyntaxKind.ThisKeyword) {\n let parsedArg = node.arguments?.length > 0 ? this.printNode(node.arguments[0], identation).trimStart() : \"\";\n const propName = this.printNode(elementAccess.argumentExpression, 0);\n const wrapperOpen = isAsync ? this.UKNOWN_PROP_ASYNC_WRAPPER_OPEN : this.UKNOWN_PROP_WRAPPER_OPEN;\n const wrapperClose = isAsync ? this.UNKOWN_PROP_ASYNC_WRAPPER_CLOSE : this.UNKOWN_PROP_WRAPPER_CLOSE;\n parsedArg = parsedArg ? \", \" + parsedArg : \"\";\n return wrapperOpen + propName + parsedArg + wrapperClose;\n }\n }\n return;\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 === ts.SyntaxKind.ElementAccessExpression) {\n const parsedArg = node.arguments?.length > 0 ? 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 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 = 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 let parsedArguments = node.arguments?.map((a) => this.printNode(a, 0)).join(\", \");\n parsedArguments = parsedArguments ? parsedArguments : \"\";\n const propName = node.expression?.name.escapedText;\n // const isAsyncDecl = true;\n // const isAsyncDecl = node?.parent?.kind === ts.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) {\n return this.capitalize(name);\n }\n\n transformPropertyAccessExpressionName(name: string) {\n return this.capitalize(name);\n }\n\n printOutOfOrderCallExpressionIfAny(node, identation) {\n if (node.expression.kind === ts.SyntaxKind.PropertyAccessExpression) {\n const args = node.arguments;\n\n if (node.expression.expression.kind === ts.SyntaxKind.ThisKeyword) {\n const methodName = this.printNode(node.expression.name, 0);\n if (this.wrapThisCalls || (this.wrapCallMethods.includes(methodName))) {\n let argsParsed = \"\";\n if (args.length > 0) {\n argsParsed = args.map((a) => this.printNode(a, 0)).join(\", \");\n return `<-this.callInternal(\"${methodName}\", ${argsParsed})`;\n }\n return `<-this.callInternal(\"${methodName}\")`;\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);\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 === ts.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 === ts.SyntaxKind.ExclamationEqualsEqualsToken || op === ts.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 + `IsObject(${target})`;\n case \"function\":\n return notOperator + `IsFunction(${target})`;\n }\n\n return undefined;\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 === ts.SyntaxKind.EqualsToken &&\n left.kind === ts.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) + `${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 // ---------------------------------------------------------------\n // Go-style setter for element-access assignments: a[b] = v\n // ---------------------------------------------------------------\n if (op === ts.SyntaxKind.EqualsToken &&\n left.kind === ts.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 (ts.isElementAccessExpression(cur)) {\n keys.unshift(cur.argumentExpression); // prepend\n const expr = cur.expression;\n if (!ts.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.\n let acc = containerStr;\n for (let i = 0; i < keyStrs.length - 1; i++) {\n acc = `${this.ELEMENT_ACCESS_WRAPPER_OPEN}${acc}, ${keyStrs[i]}${this.ELEMENT_ACCESS_WRAPPER_CLOSE}`;\n }\n\n const lastKey = keyStrs[keyStrs.length - 1];\n const rhs = this.printNode(right, 0);\n\n return `AddElementToObject(${acc}, ${lastKey}, ${rhs})`;\n }\n\n // ---------------------------------------------------------------\n // Go-style setter for element-access compound assignments: a[b] += v\n // ---------------------------------------------------------------\n if (op === ts.SyntaxKind.PlusEqualsToken &&\n left.kind === ts.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 (ts.isElementAccessExpression(cur)) {\n keys.unshift(cur.argumentExpression); // prepend\n const expr = cur.expression;\n if (!ts.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.\n let acc = containerStr;\n for (let i = 0; i < keyStrs.length - 1; i++) {\n acc = `${this.ELEMENT_ACCESS_WRAPPER_OPEN}${acc}, ${keyStrs[i]}${this.ELEMENT_ACCESS_WRAPPER_CLOSE}`;\n }\n\n const lastKey = keyStrs[keyStrs.length - 1];\n const rhs = this.printNode(right, 0);\n\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 result = `AddElementToObject(${acc}, ${lastKey}, Add(${currentValue}, ${rhs}))`;\n return result;\n }\n\n if (left.kind === ts.SyntaxKind.TypeOfExpression) {\n const typeOfExpression = this.handleTypeOfInsideBinaryExpression(node, identation);\n if (typeOfExpression) {\n return typeOfExpression;\n }\n }\n\n if (op === ts.SyntaxKind.InKeyword) {\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 === ts.SyntaxKind.PlusEqualsToken || op === ts.SyntaxKind.MinusEqualsToken || op in this.binaryExpressionsWrappers) {\n const leftText = this.printNode(left, 0);\n const rightText = this.printNode(right, 0);\n\n if (op === ts.SyntaxKind.PlusEqualsToken) {\n return `${leftText} = Add(${leftText}, ${rightText})`;\n }\n\n if (op === ts.SyntaxKind.MinusEqualsToken) {\n return `${leftText} = Subtract(${leftText}, ${rightText})`;\n }\n\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 // x = y\n // cast y to x type when y is unknown\n // if (op === ts.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 transformPropertyAcessExpressionIfNeeded(node) {\n const expression = node.expression;\n const leftSide = this.printNode(expression, 0);\n const rightSide = node.name.escapedText;\n\n let rawExpression = undefined;\n\n switch(rightSide) {\n case 'length':\n const type = (this.getChecker() as TypeChecker).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) ? `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 printCustomDefaultValueIfNeeded(node) {\n return undefined;\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 initParams.push(`${paramName} := GetArg(optionalArgs, ${index}, ${this.printNode(initializer, 0)})`);\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 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 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 => {\n // if (statement.kind === ts.SyntaxKind.ReturnStatement) {\n // if (statement?.expression) {\n // return this.getIden(identation) + \"ch <-\" + this.printNode(statement.expression) + '\\n' + this.getIden(identation) + \"return \" + this.printNode(statement.expression);\n // }\n // }\n return this.printNode(statement, identation);\n }).join(\"\\n\");\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 const functionBodySplit = functionBody.split(\"\\n\");\n const bodyWithIndentationExtraAndNoReturn = functionBodySplit.map((line) => {\n\n const trimmedLine = line.trim();\n\n // should we do this inside printReturn statement?\n // if(trimmedLine.startsWith(\"return\") && trimmedLine !== \"return\") {\n // const returnIndentation = line.indexOf(\"return\")/4 + this.getIden(1);\n // let channelReturn = this.getIden(returnIndentation) + \"ch <-\" + line.replace(\"return\", \"\").trimStart();\n // if (trimmedLine === \"return nil\") {\n // channelReturn = this.getIden(returnIndentation) + \"ch <- nil\\n\" + this.getIden(returnIndentation) + \"return nil\";\n // // it's hard because we don't want to remove the treturns from the emulated try-catches we have that are also functions\n // // with return statements\n // }\n // return channelReturn;\n // }\n return this.getIden(identation+2) + line;\n }).join(\"\\n\");\n let shouldAddLastReturn = true;\n\n // const bodySplit = bodyWithIndentationExtraAndNoReturn.split(\"\\n\");\n const bodySplit = functionBodySplit;\n const lastLine = bodySplit[bodySplit.length - 1];\n if (lastLine.trim().startsWith(\"return\") || lastLine.trim().startsWith(\"panic\")) {\n shouldAddLastReturn = false;\n }\n\n // Check if the function body ends with a conditional that has returns in all branches\n if (node.body && this.blockEndsWithConditionalReturn(node.body.statements)) {\n shouldAddLastReturn = false;\n }\n\n const lastReturn = shouldAddLastReturn ? this.getIden(identation+2) + \"return nil\" : \"\";\n // const hasCatchInside = bodySplit.indexOf(\"recover()\") > -1;\n // if ((1+1 == 2) || hasCatchInside) {\n functionBody = `{\n ${this.getIden(identation + 1)}ch := make(chan ${this.DEFAULT_RETURN_TYPE})\n ${this.getIden(identation + 1)}go func() any {\n ${this.getIden(identation + 2)}defer close(ch)\n ${this.getIden(identation + 2)}defer ReturnPanicError(ch)\n ${bodyWithIndentationExtraAndNoReturn}\n ${lastReturn}\n ${this.getIden(identation + 1)}}()\n ${this.getIden(identation + 1)}return ch\n ${this.getIden(identation)}}`;\n // } else {\n // functionBody = `{\n // ${id1}ch := make(chan ${this.DEFAULT_RETURN_TYPE})\n // ${id1}var panicError any = nil\n // ${id1}var wg sync.WaitGroup\n // ${id1}wg.Add(1)\n // ${id1}go func() any {\n // ${id2}defer wg.Done()\n // ${id2}defer close(ch)\n // ${id2}defer func() {\n // ${id3}if r := recover(); r != nil {\n // ${id4}panicError = r\n // ${id4}return\n // ${id3}}\n // ${id2}}()\n // ${bodySplit}\n // ${lastReturn}\n // ${id1}}()\n // ${id1}wg.Wait()\n // ${id1}if panicError != nil {\n // ${id2}panic(panicError)\n // ${id1}}\n // ${id1}return ch\n // ${id}}`;\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 getRandomNameSuffix() {\n return Math.floor(Math.random() * 1000000).toString();\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 === ts.SyntaxKind.AsExpression) {\n node = node.expression;\n }\n if (node.expression.kind !== ts.SyntaxKind.AwaitExpression) {\n return 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 const expStatement = `\n${this.getIden(identation)}${returnRandName} := ${exprStm}\n${this.getIden(identation)}PanicOnError(${returnRandName})`;\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 (ts.isFunctionDeclaration(currentNode) ||\n ts.isFunctionExpression(currentNode) ||\n ts.isArrowFunction(currentNode) ||\n ts.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 printReturnStatement(node, identation) {\n\n const isAsyncFunction = this.isInsideAsyncFunction(node);\n // if (node?.expression?.kind !== ts.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 if (node?.expression?.kind === ts.SyntaxKind.AsExpression) {\n node = node.expression;\n }\n\n if (node?.expression?.kind === ts.SyntaxKind.AwaitExpression) {\n // const returnRandName = \"retRes\" + this.getRandomNameSuffix();\n const returnRandName = \"retRes\" + this.getLineBasedSuffix(node.expression);\n rightPart = rightPart ? ' ' + rightPart + this.LINE_TERMINATOR : this.LINE_TERMINATOR;\n // return leadingComment + this.getIden(identation) + this.RETURN_TOKEN + rightPart + trailingComment;\n return `\n ${this.getIden(identation)}${returnRandName} := ${rightPart}\n ${this.getIden(identation)}PanicOnError(${returnRandName})\n ${this.getIden(identation)}${leadingComment}ch <- ${returnRandName}${trailingComment}\n ${this.getIden(identation)}return nil`;\n // ${this.getIden(identation)}return ${returnRandName}`;\n }\n\n if (rightPart.length === 0) {\n return `\\n${this.getIden(identation)}return nil`;\n }\n\n return `\n${this.getIden(identation)}${leadingComment}ch <- ${rightPart}${trailingComment}\n${this.getIden(identation)}return nil`;\n // ${this.getIden(identation)}return ${rightPart}`;\n // ${this.getIden(identation)}return ${rightPart}`;\n }\n\n\n printAsExpression(node, identation) {\n const type = node.type;\n\n if (type.kind === ts.SyntaxKind.AnyKeyword) {\n // return `(()${this.printNode(node.expression, identation)})`;\n }\n\n if (type.kind === ts.SyntaxKind.StringKeyword) {\n // return `((string)${this.printNode(node.expression, identation)})`;\n }\n\n if (type.kind === ts.SyntaxKind.ArrayType) {\n // if (type.elementType.kind === ts.SyntaxKind.AnyKeyword) {\n // return `(IList)(${this.printNode(node.expression, identation)})`;\n // }\n // if (type.elementType.kind === ts.SyntaxKind.StringKeyword) {\n // return `(IList)(${this.printNode(node.expression, identation)})`;\n // }\n }\n\n return this.printNode(node.expression, identation);\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) => {\n return this.printNode(e);\n }).join(\", \");\n\n // take into consideration list of promises\n if (elems.length > 0) {\n const first = elems[0];\n if (first.kind === ts.SyntaxKind.CallExpression) {\n // const type = this.getChecker().getTypeAtLocation(first);\n const type = this.getFunctionType(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 = \"[]any{\";\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 = `[]any{`;\n }\n }\n }\n\n return arrayOpen + elements + this.ARRAY_CLOSING_TOKEN;\n }\n\n printArgsForCallExpression(node, identation) {\n const args = node.arguments;\n let parsedArgs = \"\";\n if (false && this.requiresCallExpressionCast && !this.isBuiltInFunctionCall(node?.expression)) { //eslint-disable-line\n const parsedTypes = this.getTypesFromCallExpressionParameters(node);\n const tmpArgs = [];\n args.forEach((arg, index) => {\n const parsedType = parsedTypes[index];\n let cast = \"\";\n if (parsedType !== \"object\" && parsedType !== \"float\" && parsedType !== \"int\") {\n cast = parsedType ? `(${parsedType})` : '';\n }\n tmpArgs.push(cast + this.printNode(arg, identation).trim());\n });\n parsedArgs = tmpArgs.join(\",\");\n return parsedArgs;\n }\n return super.printArgsForCallExpression(node, identation);\n }\n\n // check this out later\n\n printArrayIsArrayCall(node, identation, parsedArg = undefined) {\n return `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 printArrayPushCall(node: CallExpression, identation: number, name: string | undefined = undefined, parsedArg: string | undefined = undefined) {\n let returnValue = '';\n let returnRandName = name;\n if (name?.startsWith('GetValue')) {\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 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 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 printConcatCall(node, identation, name = undefined, parsedArg = undefined) {\n return `Concat(${name}, ${parsedArg})`;\n }\n\n printToUpperCaseCall(node, identation, name = undefined) {\n return `ToUpper(${name})`;\n }\n\n printToLowerCaseCall(node, identation, name = undefined) {\n return `ToLower(${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 `assert(${parsedArgs})`;\n }\n\n printSliceCall(node, identation, name = undefined, parsedArg = undefined, parsedArg2 = undefined) {\n if (parsedArg2 === undefined){\n // return `((string)${name}).Substring((int)${parsedArg})`;\n parsedArg2 = 'nil';\n }\n // return `((string)${name})[((int)${parsedArg})..((int)${parsedArg2})]`;\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 `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 TypeChecker).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 === ts.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 === ts.SyntaxKind.NumericLiteral) {\n // return super.printPrefixUnaryExpression(node, identation);\n // }\n // if (operator === ts.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 === ts.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.printCondition(node.condition, 0);\n const whenTrue = this.printNode(node.whenTrue, 0);\n const whenFalse = this.printNode(node.whenFalse, 0);\n\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 === ts.SyntaxKind.Identifier) {\n return this.getIden(identation) + 'panic(' + this.printNode(node.expression, 0) + ')' + this.LINE_TERMINATOR;\n }\n if (node.expression.kind === ts.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 === ts.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).symbol?.declarations ?? [];\n const isClassDeclaration = declarations.find(l => l.kind === ts.SyntaxKind.InterfaceDeclaration || l.kind === ts.SyntaxKind.ClassDeclaration);\n if (isClassDeclaration){\n // return this.getIden(identation) + `${this.THROW_TOKEN} ${this.NEW_TOKEN} ${id.escapedText} ((string)${parsedArg}) ${this.LINE_TERMINATOR}`;\n } else {\n return this.getIden(identation) + `throwDynamicException(${id.escapedText}, ${parsedArg});return nil;`;\n }\n }\n return this.getIden(identation) + `panic(${id.escapedText}(${parsedArg}))${this.LINE_TERMINATOR}`;\n } else if (expression.expression.kind === ts.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?.escapedText;\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 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 == ts.SyntaxKind.InstanceOfKeyword) {\n return this.printInstanceOfExpression(node, identation);\n }\n\n if (operatorToken.kind === ts.SyntaxKind.EqualsToken) {\n // handle test['a'] = 1;\n const elementAccess = left;\n const rightSide = this.printNode(right, 0);\n if (left.kind === ts.SyntaxKind.ElementAccessExpression) {\n const leftSide = this.printNode(elementAccess.expression, 0);\n const propName = this.printNode(elementAccess.argumentExpression, 0);\n return `AddElementToObject(${leftSide}, ${propName}, ${rightSide})`;\n }\n\n if (right?.kind === ts.SyntaxKind.AwaitExpression || rightSide.startsWith('<-this.callInternal')) {\n const leftParsed = this.printNode(left, 0);\n return `\n ${leftParsed} = ${rightSide}\n ${this.getIden(identation)}PanicOnError(${leftParsed})`;\n }\n }\n\n const op = operatorToken.kind;\n // handle: [x,d] = this.method()\n if (op === ts.SyntaxKind.EqualsToken && left.kind === ts.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) + `${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 let operator = this.SupportedKindNames[operatorToken.kind];\n\n\n let leftVar = undefined;\n let rightVar = undefined;\n\n // c# wrapper\n if (operatorToken.kind === ts.SyntaxKind.EqualsEqualsToken || operatorToken.kind === ts.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 === ts.SyntaxKind.BarBarToken || operatorToken.kind === ts.SyntaxKind.AmpersandAmpersandToken) {\n leftVar = this.printCondition(left, 0);\n rightVar = this.printCondition(right, identation);\n } else {\n leftVar = this.printNode(left, 0);\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 leftVar +\" \"+ operator + \" \" + rightVar.trim();\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 catchLines = catchBody.split(\"\\n\").map(l => l.trim()).filter(Boolean);\n const catchLastLine = catchLines.length ? catchLines[catchLines.length - 1] : \"\";\n const catchBodyEndsWithReturn = catchLastLine.startsWith(\"return\")\n || catchLastLine.startsWith(\"panic\")\n || catchLastLine.startsWith(\"throw new\")\n || this.blockEndsWithConditionalReturn(node.catchClause.block.statements);\n\n const tryLines = tryBody.split(\"\\n\").map(l => l.trim()).filter(Boolean);\n const tryLastLine = tryLines.length ? tryLines[tryLines.length - 1] : \"\";\n const tryBodyEndsWithReturn = tryLastLine.startsWith(\"return\")\n || tryLastLine.startsWith(\"panic\")\n || tryLastLine.startsWith(\"throw new\")\n || this.blockEndsWithConditionalReturn(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.escapedText;\n const classPrefix = this.className !== 'undefined' ? `(this *${this.className})` : \"()\";\n const thisWord = this.className !== 'undefined' ? \"this\" : \"\";\n const catchBlock =`\n {\n ${nodeEndsWithReturn ? 'ret__ :=' : ''} func${classPrefix} (ret_ any) {\n\t\t defer func() {\n if ${errorName} := recover(); ${errorName} != nil {\n if ${errorName} == \"break\" {\n return\n }\n ret_ = func${classPrefix} any {\n // catch block:\n ${catchBody}\n ${catchBodyEndsWithReturn ? \"\" : returNil}\n }(${thisWord})\n }\n }()\n\t\t // try block:\n ${tryBody}\n\t\t ${tryBodyEndsWithReturn ? \"\" : returNil}\n\t }(${thisWord})\n ${nodeEndsWithReturn\n ? `\n if ret__ != nil {\n return ret__\n }\n return nil`\n : ''}\n }`;\n // add identation\n const indentedBlock = catchBlock.split(\"\\n\").map((line) => this.getIden(identation) + line).join(\"\\n\");\n // const catchCondOpen = this.CONDITION_OPENING ? this.CONDITION_OPENING : \" \";\n\n return indentedBlock;\n }\n\n printPrefixUnaryExpression(node, identation) {\n const {operand, operator} = node;\n if (operator === ts.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 === ts.SyntaxKind.MinusToken) {\n return this.getIden(identation) + `OpNeg(${this.printNode(node.operand, 0)})`;\n }\n return this.getIden(identation) + this.PrefixFixOperators[operator] + this.printNode(operand, 0);\n }\n\n printNewExpression(node, identation) {\n let expression = node.expression?.escapedText;\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 const args = node.arguments.map(n => this.printNode(n, identation)).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 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 (ts.isElementAccessExpression(current)) {\n keys.unshift(current.argumentExpression); // prepend\n const expr = current.expression;\n if (!ts.isElementAccessExpression(expr)) {\n // Reached the base container.\n baseExpr = expr;\n break;\n }\n current = expr;\n }\n\n const containerStr = this.printNode(baseExpr, 0);\n const keyStrs = keys.map(k => this.printNode(k, 0));\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 return acc;\n }\n\n isInsideVoidFunction(node: ts.Node): boolean {\n for (let cur = node.parent; cur; cur = cur.parent) {\n if (ts.isFunctionLike(cur)) {\n return cur.type === undefined || cur.type.kind === ts.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: ts.Statement): boolean {\n if (ts.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 (ts.isReturnStatement(statement)) {\n return true;\n } else if (ts.isThrowStatement(statement)) {\n return true;\n } else if (ts.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 (ts.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: ts.NodeArray): boolean {\n if (statements.length === 0) {\n return false;\n }\n\n const lastStatement = statements[statements.length - 1];\n if (ts.isIfStatement(lastStatement)) {\n // Check if this if statement has returns in all branches (only if it has an else)\n const ifHasReturn = this.hasReturnInBlock(lastStatement.thenStatement);\n if (lastStatement.elseStatement) {\n const elseHasReturn = this.hasReturnInBlock(lastStatement.elseStatement);\n return ifHasReturn && elseHasReturn;\n }\n }\n if (ts.isTryStatement(lastStatement)) {\n // Check if this try statement has returns in both try and catch blocks\n const tryHasReturn = this.hasReturnInBlock(lastStatement.tryBlock);\n const catchHasReturn = this.hasReturnInBlock(lastStatement.catchClause.block);\n return tryHasReturn && catchHasReturn;\n }\n return false;\n }\n\n\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\n","import { BaseTranspiler } from \"./baseTranspiler.js\";\nimport ts, { TypeChecker } from \"typescript\";\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\nexport class JavaTranspiler extends BaseTranspiler {\n binaryExpressionsWrappers;\n\n varListFromObjectLiterals = {};\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; escapedText: any; ownGetFullText: boolean; getFullText: any }> = [];\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 }\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 = {\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.binaryExpressionsWrappers = {\n [ts.SyntaxKind.EqualsEqualsToken]: [\n this.EQUALS_EQUALS_WRAPPER_OPEN,\n this.EQUALS_EQUALS_WRAPPER_CLOSE,\n ],\n [ts.SyntaxKind.EqualsEqualsEqualsToken]: [\n this.EQUALS_EQUALS_WRAPPER_OPEN,\n this.EQUALS_EQUALS_WRAPPER_CLOSE,\n ],\n [ts.SyntaxKind.ExclamationEqualsToken]: [\n this.DIFFERENT_WRAPPER_OPEN,\n this.DIFFERENT_WRAPPER_CLOSE,\n ],\n [ts.SyntaxKind.ExclamationEqualsEqualsToken]: [\n this.DIFFERENT_WRAPPER_OPEN,\n this.DIFFERENT_WRAPPER_CLOSE,\n ],\n [ts.SyntaxKind.GreaterThanToken]: [\n this.GREATER_THAN_WRAPPER_OPEN,\n this.GREATER_THAN_WRAPPER_CLOSE,\n ],\n [ts.SyntaxKind.GreaterThanEqualsToken]: [\n this.GREATER_THAN_EQUALS_WRAPPER_OPEN,\n this.GREATER_THAN_EQUALS_WRAPPER_CLOSE,\n ],\n [ts.SyntaxKind.LessThanToken]: [\n this.LESS_THAN_WRAPPER_OPEN,\n this.LESS_THAN_WRAPPER_CLOSE,\n ],\n [ts.SyntaxKind.LessThanEqualsToken]: [\n this.LESS_THAN_EQUALS_WRAPPER_OPEN,\n this.LESS_THAN_EQUALS_WRAPPER_CLOSE,\n ],\n [ts.SyntaxKind.PlusToken]: [\n this.PLUS_WRAPPER_OPEN,\n this.PLUS_WRAPPER_CLOSE,\n ],\n [ts.SyntaxKind.MinusToken]: [\n this.MINUS_WRAPPER_OPEN,\n this.MINUS_WRAPPER_CLOSE,\n ],\n [ts.SyntaxKind.AsteriskToken]: [\n this.MULTIPLY_WRAPPER_OPEN,\n this.MULTIPLY_WRAPPER_CLOSE,\n ],\n [ts.SyntaxKind.PercentToken]: [\n this.MOD_WRAPPER_OPEN,\n this.MOD_WRAPPER_CLOSE,\n ],\n [ts.SyntaxKind.SlashToken]: [\n this.DIVIDE_WRAPPER_OPEN,\n this.DIVIDE_WRAPPER_CLOSE,\n ],\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.escapedText);\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.escapedText;\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 // 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 === ts.SyntaxKind.NewExpression;\n const isInsideCatch =\n node?.parent?.kind === ts.SyntaxKind.ThrowStatement;\n const isLeftSide =\n node?.parent?.name === node || node?.parent?.left === node;\n const isCallOrPropertyAccess =\n node?.parent?.kind === ts.SyntaxKind.PropertyAccessExpression ||\n node?.parent?.kind === ts.SyntaxKind.ElementAccessExpression;\n if (!isLeftSide && !isCallOrPropertyAccess && !isInsideCatch && !isInsideNewExpression) {\n const type = this.getChecker().getTypeAtLocation(node);\n const typeSymbol = type?.symbol;\n if (typeSymbol !== undefined) {\n const decl = typeSymbol?.declarations ?? [];\n let isBuiltIn = undefined;\n if (decl.length > 0) {\n isBuiltIn =\n decl[0].getSourceFile().fileName.indexOf(\"typescript\") > -1;\n }\n\n if (isBuiltIn !== undefined && !isBuiltIn) {\n const symbol = this.getChecker().getSymbolAtLocation(node);\n let isClassDeclaration = false;\n if (symbol) {\n const first = symbol.declarations[0];\n if (first.kind === ts.SyntaxKind.ClassDeclaration) {\n isClassDeclaration = true;\n }\n if (first.kind === ts.SyntaxKind.ImportSpecifier) {\n const importedSymbol = this.getChecker().getAliasedSymbol(symbol);\n if (\n importedSymbol?.declarations[0]?.kind ===\n ts.SyntaxKind.ClassDeclaration\n ) {\n isClassDeclaration = true;\n }\n }\n }\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 if (ts.isExpressionStatement(statement)) {\n const expression = statement.expression;\n if (ts.isCallExpression(expression)) {\n const expressionText = expression.expression.getText().trim();\n if (expressionText === \"super\") {\n hasSuperCall = true;\n superCallParams = expression.arguments\n .map((a) => {\n return this.printNode(a, identation).trim();\n })\n .join(\", \");\n }\n }\n }\n });\n\n const header =\n this.getIden(identation) + className + \"(\" + args + \")\";\n if (!hasSuperCall) {\n return header + constructorBody;\n }\n // In Java, super(...) must be the first statement inside the body.\n const injected = this.injectLeadingInBody(constructorBody, `super(${superCallParams});`);\n return header + injected;\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 === ts.SyntaxKind.ElementAccessExpression) {\n const parsedArg =\n node.arguments?.length > 0\n ? node.arguments\n .map((n) => this.printNode(n, identation).trimStart())\n .join(\", \")\n : \"\";\n const target = this.printNode(elementAccess.expression, 0);\n const propName = this.printNode(elementAccess.argumentExpression, 0);\n const argsArray = `new Object[] { ${parsedArg} }`;\n const open = this.DYNAMIC_CALL_OPEN;\n return `${open}${target}, ${propName}, ${argsArray})`;\n }\n return undefined;\n }\n\n getExpressionStatementPrefixesIfAny(node, identation) {\n // return undefined;\n const finalVars = [];\n if (node.expression?.kind === ts.SyntaxKind.CallExpression) {\n const objectLiterals = this.getObjectLiteralFromCallExpressionArguments(node.expression);\n for (let i = 0; i < objectLiterals.length; i++) {\n const objLiteral = objectLiterals[i];\n const objVariables = this.getVarListFromObjectLiteralAndUpdateInPlace(objLiteral);\n if (objVariables.length > 0) {\n finalVars.push(...objVariables);\n }\n }\n\n if (finalVars.length > 0) {\n const decls = this.buildFinalVarDeclarations(finalVars, identation);\n if (decls) {\n return decls + \"\\n\" + this.getIden(identation);\n }\n }\n }\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 let parsedArguments = node.arguments\n ?.map((a) => this.printNode(a, 0))\n .join(\", \");\n parsedArguments = parsedArguments ? parsedArguments : \"\";\n const propName = node.expression?.name.escapedText;\n const isAsyncDecl = node?.parent?.kind === ts.SyntaxKind.AwaitExpression;\n const argsArray = `new Object[] { ${parsedArguments} }`;\n const open = this.DYNAMIC_CALL_OPEN;\n const statement = `${open}this, \"${propName}\", ${argsArray})`;\n // If your Java runtime returns CompletableFuture, you can await it where appropriate.\n return statement;\n }\n return undefined;\n }\n\n printOutOfOrderCallExpressionIfAny(node, identation) {\n if (node.expression.kind === ts.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(Helpers.toString(${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 `Helpers.mathMin(${parsedArg1}, ${parsedArg2})`;\n case \"Math.max\":\n return `Helpers.mathMax(${parsedArg1}, ${parsedArg2})`;\n case \"Math.pow\":\n return `Helpers.mathPow(Double.parseDouble(Helpers.toString(${parsedArg1})), Double.parseDouble(Helpers.toString(${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 === ts.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 === ts.SyntaxKind.ExclamationEqualsEqualsToken ||\n op === ts.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 (ts.isMethodDeclaration(current) || ts.isFunctionDeclaration(current)) {\n return String((current.name as any)?.escapedText ?? '');\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 (ts.isClassDeclaration(current)) {\n return String((current.name as any)?.escapedText ?? '');\n }\n current = current.parent;\n }\n return '';\n }\n\n getVarKey(node) {\n\n const varName = node?.escapedText ?? node?.name?.escapedText;\n if (!varName) {\n return '';\n }\n return `${this.getVarClassIfAny(node)}-${this.getVarMethodIfAny(node)}-${varName}`;\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 === ts.SyntaxKind.Identifier) {\n this.ReassignedVars[this.getVarKey(left)] = true;\n }\n\n if (left.kind === ts.SyntaxKind.TypeOfExpression) {\n const typeOfExpression = this.handleTypeOfInsideBinaryExpression(\n node,\n identation\n );\n if (typeOfExpression) return typeOfExpression;\n }\n\n // destructuring: [a,b] = this.method()\n if (\n op === ts.SyntaxKind.EqualsToken &&\n left.kind === ts.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 const statement =\n this.getIden(identation) +\n `${e} = ((java.util.List) ${syntheticName}).get(${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 // setter for element-access assignments: a[b] = v\n // ---------------------------------------------------------------\n if (op === ts.SyntaxKind.EqualsToken &&\n left.kind === ts.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 (ts.isElementAccessExpression(cur)) {\n keys.unshift(cur.argumentExpression); // prepend\n const expr = cur.expression;\n if (!ts.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.\n let acc = containerStr;\n for (let i = 0; i < keyStrs.length - 1; i++) {\n acc = `${this.ELEMENT_ACCESS_WRAPPER_OPEN}${acc}, ${keyStrs[i]}${this.ELEMENT_ACCESS_WRAPPER_CLOSE}`;\n }\n\n let prefixes = this.getBinaryExpressionPrefixes(node, identation);\n prefixes = prefixes ? prefixes : \"\";\n\n\n const lastKey = keyStrs[keyStrs.length - 1];\n const rhs = this.printNode(right, 0);\n\n\n\n return `${prefixes}Helpers.addElementToObject(${acc}, ${lastKey}, ${rhs})`;\n }\n\n if (op === ts.SyntaxKind.InKeyword) {\n return `Helpers.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 === ts.SyntaxKind.PlusEqualsToken || op === ts.SyntaxKind.MinusEqualsToken || op in this.binaryExpressionsWrappers) {\n const leftText = this.printNode(left, 0);\n const rightText = this.printNode(right, 0);\n\n if (op === ts.SyntaxKind.PlusEqualsToken) {\n return `${leftText} = Helpers.add(${leftText}, ${rightText})`;\n }\n\n if (op === ts.SyntaxKind.MinusEqualsToken) {\n return `${leftText} = Helpers.subtract(${leftText}, ${rightText})`;\n }\n\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\n getObjectLiteralFromCallExpressionArguments(node) {\n const res = [];\n if (!node?.arguments) {\n return res;\n }\n const args = node.arguments;\n\n for (let i = 0; i < args.length; i++) {\n const arg = args[i];\n if (arg.kind === ts.SyntaxKind.ObjectLiteralExpression) {\n res.push(arg);\n } else if (arg.kind === ts.SyntaxKind.CallExpression) {\n const innerCallExp = arg;\n const innerObjLiterals = this.getObjectLiteralFromCallExpressionArguments(innerCallExp);\n res.push(...innerObjLiterals);\n }\n }\n return res;\n }\n\n // Finds every ObjectLiteralExpression nested anywhere inside an RHS/initializer\n // expression that would produce an anonymous-inner-class capture in Java\n // (HashMap double-brace init). Stops descending at each ObjectLiteralExpression\n // because nested literals are walked recursively inside\n // getVarListFromObjectLiteralAndUpdateInPlace. Skips function/arrow bodies so\n // we don't capture literals that evaluate in a different scope.\n //\n // Unifies the previously-narrow matching in printVariableDeclarationList and\n // getBinaryExpressionPrefixes which only handled ObjectLiteralExpression or\n // CallExpression directly — missing wrappers like AwaitExpression,\n // ParenthesizedExpression, NewExpression, and ConditionalExpression.\n collectCapturingObjectLiterals(node): any[] {\n const found = [];\n const walk = (n) => {\n if (!n) return;\n if (n.kind === ts.SyntaxKind.ObjectLiteralExpression) {\n found.push(n);\n return;\n }\n if (n.kind === ts.SyntaxKind.FunctionExpression ||\n n.kind === ts.SyntaxKind.ArrowFunction ||\n n.kind === ts.SyntaxKind.MethodDeclaration ||\n n.kind === ts.SyntaxKind.FunctionDeclaration) {\n return;\n }\n ts.forEachChild(n, walk);\n };\n walk(node);\n return found;\n }\n\n getBinaryExpressionPrefixes(node, identation) {\n let right = node?.right;\n if (right?.kind === ts.SyntaxKind.AwaitExpression) {\n // un pack await this.x() to this.x(), we don't care about await here\n right = right.expression;\n }\n if (!right) {\n return undefined;\n }\n if (right.kind === ts.SyntaxKind.ObjectLiteralExpression) {\n const objVariables = this.getVarListFromObjectLiteralAndUpdateInPlace(right);\n if (objVariables.length > 0) {\n const decls = this.buildFinalVarDeclarations(objVariables, identation);\n if (decls) {\n return decls + \"\\n\" + this.getIden(identation);\n }\n }\n } else if (right.kind === ts.SyntaxKind.CallExpression) {\n // search arguments recursively for object literals\n // eg: a[x] = this.extend(this.extend(this.extend({'a':b}, c)))\n const objectLiterals = this.getObjectLiteralFromCallExpressionArguments(right);\n if (objectLiterals.length > 0) {\n const allVars = [];\n for (let i = 0; i < objectLiterals.length; i++) {\n const objLiteral = objectLiterals[i];\n const objVariables = this.getVarListFromObjectLiteralAndUpdateInPlace(objLiteral);\n allVars.push(...objVariables);\n }\n if (allVars.length > 0) {\n const decls = this.buildFinalVarDeclarations(allVars, identation);\n if (decls) {\n return decls + \"\\n\" + this.getIden(identation);\n }\n }\n }\n }\n return undefined;\n }\n\n getFinalVarName(varName: string): string {\n if (this.ReservedKeywordsReplacements[varName]) {\n varName = this.ReservedKeywordsReplacements[varName];\n }\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: ts.SyntaxKind): boolean {\n return op === ts.SyntaxKind.EqualsToken ||\n op === ts.SyntaxKind.PlusEqualsToken ||\n op === ts.SyntaxKind.MinusEqualsToken ||\n op === ts.SyntaxKind.AsteriskEqualsToken ||\n op === ts.SyntaxKind.AsteriskAsteriskEqualsToken ||\n op === ts.SyntaxKind.SlashEqualsToken ||\n op === ts.SyntaxKind.PercentEqualsToken ||\n op === ts.SyntaxKind.LessThanLessThanEqualsToken ||\n op === ts.SyntaxKind.GreaterThanGreaterThanEqualsToken ||\n op === ts.SyntaxKind.GreaterThanGreaterThanGreaterThanEqualsToken ||\n op === ts.SyntaxKind.AmpersandEqualsToken ||\n op === ts.SyntaxKind.BarEqualsToken ||\n op === ts.SyntaxKind.CaretEqualsToken ||\n op === ts.SyntaxKind.BarBarEqualsToken ||\n op === ts.SyntaxKind.AmpersandAmpersandEqualsToken ||\n op === ts.SyntaxKind.QuestionQuestionEqualsToken;\n }\n\n private isIncDecOperator(op: ts.SyntaxKind): boolean {\n return op === ts.SyntaxKind.PlusPlusToken || op === ts.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: ts.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] ?? sym?.valueDeclaration;\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.escapedText}`;\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 === ts.SyntaxKind.BinaryExpression) {\n if (node.left?.kind === ts.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 === ts.SyntaxKind.EqualsToken &&\n node.left?.kind === ts.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 === ts.SyntaxKind.Identifier) {\n reassignedSyms.add(symbolIdOf(elem));\n }\n }\n }\n }\n if ((node.kind === ts.SyntaxKind.PrefixUnaryExpression ||\n node.kind === ts.SyntaxKind.PostfixUnaryExpression) &&\n this.isIncDecOperator(node.operator) &&\n node.operand?.kind === ts.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 === ts.SyntaxKind.Identifier) {\n const name = node.escapedText 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 ts.forEachChild(node, 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: ts.Node };\n const events: Event[] = [];\n\n const visitExprInObjLit = (n: any) => {\n if (!n) return;\n if (n.kind === ts.SyntaxKind.Identifier) {\n const name = n.escapedText 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 === ts.SyntaxKind.BinaryExpression) {\n visitExprInObjLit(n.left);\n visitExprInObjLit(n.right);\n return;\n }\n if (n.kind === ts.SyntaxKind.ParenthesizedExpression) {\n visitExprInObjLit(n.expression);\n return;\n }\n if (n.kind === ts.SyntaxKind.ConditionalExpression) {\n visitExprInObjLit(n.condition);\n visitExprInObjLit(n.whenTrue);\n visitExprInObjLit(n.whenFalse);\n return;\n }\n if (n.kind === ts.SyntaxKind.CallExpression) {\n n.arguments?.forEach(visitExprInObjLit);\n if (n.expression?.kind === ts.SyntaxKind.PropertyAccessExpression) {\n visitExprInObjLit(n.expression.expression);\n }\n return;\n }\n if (n.kind === ts.SyntaxKind.PrefixUnaryExpression) {\n visitExprInObjLit(n.operand);\n return;\n }\n if (n.kind === ts.SyntaxKind.ElementAccessExpression) {\n let left = n.expression;\n while (left?.kind === ts.SyntaxKind.ElementAccessExpression) {\n left = left.expression;\n }\n visitExprInObjLit(left);\n visitExprInObjLit(n.argumentExpression);\n return;\n }\n if (n.kind === ts.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 ts.forEachChild(n, visitExprInObjLit);\n };\n\n const walk = (node: any) => {\n if (!node) return;\n\n if (node.kind === ts.SyntaxKind.BinaryExpression &&\n this.isAssignmentOperator(node.operatorToken.kind)) {\n walk(node.right);\n if (node.left?.kind === ts.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 === ts.SyntaxKind.PrefixUnaryExpression ||\n node.kind === ts.SyntaxKind.PostfixUnaryExpression) &&\n this.isIncDecOperator(node.operator) &&\n node.operand?.kind === ts.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 === ts.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: ts.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 === ts.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 === ts.SyntaxKind.TryStatement) {\n walkBlockAndBump(node.tryBlock);\n walkBlockAndBump(node.catchClause?.block);\n walkBlockAndBump(node.finallyBlock);\n return;\n }\n\n ts.forEachChild(node, 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 if (versions.length === 1) {\n for (const n of byVer.get(versions[0])!) {\n this.usageToFinalName.set(n, baseName);\n }\n } else {\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\n private finalNameInAncestorScope(finalName: string): boolean {\n for (const scope of this.finalVarScopeStack) {\n if (scope.has(finalName)) return true;\n }\n return false;\n }\n\n buildFinalVarDeclarations(pairs: Array<{ orig: string; final: string }>, identation: number): string {\n if (pairs.length === 0) return '';\n const current = this.finalVarScopeStack.length > 0\n ? this.finalVarScopeStack[this.finalVarScopeStack.length - 1]\n : null;\n const lines: string[] = [];\n const seenHere = new Set();\n for (const p of pairs) {\n if (seenHere.has(p.final)) continue;\n if (this.finalNameInAncestorScope(p.final)) continue;\n seenHere.add(p.final);\n if (current) current.add(p.final);\n const indent = lines.length === 0 ? 0 : identation;\n // The RHS must use the remapped Java name (e.g. `params` → `parameters`,\n // `internal` → `intern`) since the original TS identifier doesn't exist\n // in the generated Java code.\n lines.push(`${this.getIden(indent)}final Object ${p.final} = ${this.getOriginalVarName(p.orig)};`);\n }\n return lines.join('\\n');\n }\n\n getObjectLiteralId(node): string {\n const start = node.getStart();\n const end = node.getEnd();\n // Qualify with the file: the offsets alone collide between two files whose\n // object literals happen to sit at the same character range.\n const fileName = node.getSourceFile?.()?.fileName ?? '';\n return `${fileName}:${start}-${end}`;\n }\n\n // Remember an identifier's pre-rewrite state so restoreFinalVarMutations can put\n // the shared AST back exactly as it was parsed.\n recordFinalVarMutation(node: any): void {\n this.finalVarMutations.push({\n node,\n escapedText: node.escapedText,\n ownGetFullText: Object.prototype.hasOwnProperty.call(node, 'getFullText'),\n getFullText: node.getFullText,\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 mutation.node.escapedText = mutation.escapedText;\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 === ts.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 createNewNodeForFinalVar(originalName: string): ts.Identifier {\n const newNode = ts.factory.createIdentifier(this.getFinalVarName(originalName));\n newNode.getFullText = () => this.getFinalVarName(originalName);\n return newNode;\n }\n\n getVarListFromObjectLiteralAndUpdateInPlace(node): Array<{ orig: string; final: string }> {\n // in java if we use an anonymous object literal put, we can't refer non final variables\n // so here we collect them and then we add the wrapper final variables, eg: finalX = X;\n // and we update the node in place to use finalX instead of X.\n // The final name comes from analyzeFinalVars (pre-walk), which assigns\n // version-aware names so reassignment-between-usages produces distinct finals.\n let res: Array<{ orig: string; final: string }> = [];\n\n const nodeId = this.getObjectLiteralId(node);\n\n if (nodeId in this.varListFromObjectLiterals) {\n return this.varListFromObjectLiterals[nodeId];\n }\n\n const finalNameFor = (n: any, origName: string): string => {\n return this.usageToFinalName.get(n) ?? this.getFinalVarName(origName);\n };\n\n // Walks any expression, rewriting reassigned-var Identifiers to their\n // finalXxx names in place. We rely on ts.forEachChild for traversal so\n // every node kind (PrefixUnary, PostfixUnary, ElementAccess,\n // PropertyAccess, BinaryExpression, ConditionalExpression, CallExpression,\n // ParenthesizedExpression, etc.) is covered uniformly. ObjectLiteral is\n // delegated back to the parent function so per-objectLiteral nodeId\n // dedup applies to nested literals too.\n const traverseAndReplace = (n) => {\n if (!n) return;\n if (n.kind === ts.SyntaxKind.Identifier) {\n const name = n.escapedText as string | undefined;\n if (name && name !== 'undefined' && !name.startsWith('null')) {\n // Prefer analyzeFinalVars' pre-walk result (usageToFinalName):\n // it knows about reassignments anywhere in the function body,\n // including ones that happen AFTER this object literal in\n // source order. ReassignedVars is populated as BinaryExpressions\n // are printed, so for a forward reference it is still false at\n // this point and would miss the shadow.\n const isReassignedAhead = this.usageToFinalName.has(n);\n if (isReassignedAhead || this.ReassignedVars[this.getVarKey(n)]) {\n const finalName = finalNameFor(n, name);\n res.push({ orig: name, final: finalName });\n this.recordFinalVarMutation(n);\n n.escapedText = finalName;\n // Some downstream print paths read from getFullText (which\n // reflects the source text, not escapedText) — shim it so\n // they see the rewritten name.\n (n as any).getFullText = () => finalName;\n }\n }\n return;\n }\n if (n.kind === ts.SyntaxKind.ObjectLiteralExpression) {\n const innerVars = this.getVarListFromObjectLiteralAndUpdateInPlace(n);\n res = res.concat(innerVars);\n return;\n }\n ts.forEachChild(n, traverseAndReplace);\n };\n\n node.properties.forEach( (prop) => {\n if (!prop.initializer) return;\n traverseAndReplace(prop.initializer);\n });\n\n // dedup on (orig|final) pair\n const seen = new Set();\n const dedup: Array<{ orig: string; final: string }> = [];\n for (const p of res) {\n const key = `${p.orig}|${p.final}`;\n if (seen.has(key)) continue;\n seen.add(key);\n dedup.push(p);\n }\n this.varListFromObjectLiterals[nodeId] = dedup;\n return dedup;\n }\n\n printVariableDeclarationList(node, identation) {\n const declaration = node.declarations[0];\n\n let finalVars = '';\n if (declaration.initializer) {\n // Walk the whole initializer tree — handles AwaitExpression,\n // ParenthesizedExpression, NewExpression, ConditionalExpression,\n // nested CallExpressions, etc. uniformly.\n const objLiterals = this.collectCapturingObjectLiterals(declaration.initializer);\n let varObj = [];\n for (const lit of objLiterals) {\n const vars = this.getVarListFromObjectLiteralAndUpdateInPlace(lit);\n varObj = varObj.concat(vars);\n }\n if (varObj.length > 0) {\n finalVars = this.buildFinalVarDeclarations(varObj, identation);\n }\n }\n\n if (\n this.removeVariableDeclarationForFunctionExpression &&\n declaration?.initializer &&\n ts.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 === ts.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 let arrayBindingStatement =\n `${this.getIden(identation)}var ${syntheticName} = ${this.printNode(\n declaration.initializer,\n 0\n )};\\n`;\n\n parsedArrayBindingElements.forEach((e, index) => {\n const statement =\n this.getIden(identation) +\n `var ${e} = ((java.util.List) ${syntheticName}).get(${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 const isNew =\n declaration?.initializer &&\n declaration.initializer.kind === ts.SyntaxKind.NewExpression;\n const varToken = isNew ? \"var \" : this.VAR_TOKEN + \" \";\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 finalVars = finalVars.length > 0 ? this.getIden(identation) + finalVars + \"\\n\" : finalVars;\n return (\n finalVars +\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 === ts.SyntaxKind.PropertyAssignment) {\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.escapedText;\n\n let rawExpression = undefined;\n\n switch (rightSide) {\n case \"length\": {\n const type = (this.getChecker() as TypeChecker).getTypeAtLocation(\n expression\n );\n this.warnIfAnyType(node, (type as any).flags, leftSide, \"length\");\n rawExpression = this.isStringType((type as any).flags)\n ? `((String)${leftSide}).length()`\n : `${this.ARRAY_LENGTH_WRAPPER_OPEN}${leftSide}${this.ARRAY_LENGTH_WRAPPER_CLOSE}`;\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 ts.isArrayLiteralExpression(node) ||\n ts.isObjectLiteralExpression(node) ||\n ts.isStringLiteral(node) ||\n (ts as any).isBooleanLiteral(node)\n ) {\n return this.UNDEFINED_TOKEN;\n }\n\n if (ts.isNumericLiteral(node)) {\n return this.UNDEFINED_TOKEN;\n }\n\n if (\n node?.escapedText === \"undefined\" &&\n this.getChecker().getTypeAtLocation(node?.parent)?.flags ===\n ts.TypeFlags.Number\n ) {\n return this.UNDEFINED_TOKEN;\n }\n\n return undefined;\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 const initParams = [];\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 const index = i + offSetIndex;\n // index = index < 0 ? 0 : i - 1;\n const paramName = this.printNode(param.name, 0);\n initParams.push(`Object ${paramName} = Helpers.getArg(optionalArgs, ${index}, ${this.printNode(initializer, 0)});`);\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) {\n const finalWrapperVars = this.printFinalOutsideMethodVariableWrappersIfAny(node, identation) + \"\\n\";\n const insideWrappers = 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 && (ts.isReturnStatement(lastStatement) || this.allBranchesTerminate(lastStatement));\n const returnNull = lastStmtIsReturn ? \"\" : (this.getIden(identation + 2) + \"return null;\\n\");\n const asyncBody = this.getIden(identation + 1) + \"return java.util.concurrent.CompletableFuture.supplyAsync(() -> {\\n\" +\n insideWrappers +\n body + \"\\n\" +\n returnNull +\n this.getIden(identation + 1) + \"});\\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.escapedText;\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 === ts.SyntaxKind.AnyKeyword) {\n return `((${this.VariableTypeReplacements['object']})${this.printNode(\n node.expression,\n identation\n )})`;\n }\n\n if (type.kind === ts.SyntaxKind.StringKeyword) {\n return `((String)${this.printNode(node.expression, identation)})`;\n }\n\n if (type.kind === ts.SyntaxKind.ArrayType) {\n if (type.elementType.kind === ts.SyntaxKind.AnyKeyword) {\n return `(java.util.List)(${this.printNode(\n node.expression,\n identation\n )})`;\n }\n if (type.elementType.kind === ts.SyntaxKind.StringKeyword) {\n return `(java.util.List)(${this.printNode(\n node.expression,\n identation\n )})`;\n }\n }\n\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 let type = this.printParameterType(node) || \"\";\n\n if (defaultValue) {\n if (initializer) {\n const customDefaultValue =\n this.printCustomDefaultValueIfNeeded(initializer);\n const def = customDefaultValue\n ? customDefaultValue\n : this.printNode(initializer, 0);\n type = def === \"null\" && type !== \"Object\" ? type + \" \" : type + \" \";\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 printMethodParameters(node) {\n const isAsyncMethod = this.isAsyncFunction(node);\n const params = node.parameters.map(param => {\n const isReassignedVar = this.ReassignedVars[this.getVarKey(param)];\n let printedParam = this.printParameter(param);\n if (isAsyncMethod && isReassignedVar) {\n const paramName = param.name.escapedText;\n const { localName, sigName } = this.getAsyncParamWrapperNames(paramName);\n // Replace the printed Java name (post keyword-remap) with sigName so\n // the original name is freed for the lambda body to bind.\n printedParam = printedParam.replace(localName, sigName);\n }\n return printedParam;\n });\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 const parameters = node?.parameters;\n const finalVarWrappers = [];\n\n if (parameters) {\n const isAsyncMethod = this.isAsyncFunction(node);\n parameters.forEach(param => {\n const isOptionalParam = param.initializer !== undefined || param.questionToken !== undefined;\n if (!isOptionalParam) {\n const isReassignedVar = this.ReassignedVars[this.getVarKey(param)];\n if (isAsyncMethod && isReassignedVar) {\n const paramName = param.name.escapedText;\n const { sigName, snapName } = this.getAsyncParamWrapperNames(paramName);\n finalVarWrappers.push(this.getIden(identation + 1) + `final Object ${snapName} = ${sigName};`);\n }\n }\n\n });\n }\n return finalVarWrappers.join(\"\\n\");\n }\n\n printInsideMethodVariableWrappersIfAny(node, identation) {\n const parameters = node?.parameters;\n const finalVarWrappers = [];\n\n if (parameters) {\n const isAsyncMethod = this.isAsyncFunction(node);\n parameters.forEach(param => {\n const isOptionalParam = param.initializer !== undefined || param.questionToken !== undefined;\n if (!isOptionalParam) {\n const isReassignedVar = this.ReassignedVars[this.getVarKey(param)];\n if (isAsyncMethod && isReassignedVar) {\n const paramName = param.name.escapedText;\n const { localName, snapName } = this.getAsyncParamWrapperNames(paramName);\n finalVarWrappers.push(this.getIden(identation + 1) + `Object ${localName} = ${snapName};`);\n }\n }\n\n });\n }\n return finalVarWrappers.join(\"\\n\");\n }\n\n printMethodDeclaration(node, identation) {\n\n\n const funcBody = this.printFunctionBody(node, identation); // print body first to get var reassignments filled\n\n let methodDef = this.printMethodDefinition(node, identation);\n\n methodDef += funcBody;\n\n return methodDef;\n }\n\n printMethodDefinition(node, identation) {\n let name = node.name.escapedText;\n name = this.transformMethodNameIfNeeded(name);\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 // let modifiers = this.printModifiers(node);\n const defaultAccess = this.METHOD_DEFAULT_ACCESS ? this.METHOD_DEFAULT_ACCESS + \" \" : \"\";\n const modifiers = defaultAccess;\n // modifiers = modifiers ? modifiers + \" \" : defaultAccess;\n // modifiers =\n // modifiers.indexOf(\"public\") === -1 &&\n // modifiers.indexOf(\"private\") === -1 &&\n // modifiers.indexOf(\"protected\") === -1\n // ? defaultAccess + modifiers\n // : modifiers;\n\n let parsedArgs = undefined;\n\n // const methodOverride = (this.getMethodOverride(node) as any);\n // const isOverride = methodOverride !== undefined;\n\n // if (isOverride && (returnType === \"Object\" || returnType === \"java.util.concurrent.CompletableFuture\")) {\n // returnType = this.printFunctionType(methodOverride);\n // }\n\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 // const currentArgs = node.parameters;\n // const parentArgs = methodOverride.parameters;\n // parsedArgs = \"\";\n // parentArgs.forEach((param, index) => {\n // const originalName = this.printNode(currentArgs[index].name, 0);\n // const parsedArg = this.printParameteCustomName(param, originalName);\n // parsedArgs += parsedArg;\n // if (index < parentArgs.length - 1) {\n // parsedArgs += \", \";\n // }\n // });\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 signature =\n this.getIden(identation) +\n modifiers +\n returnType +\n methodToken +\n name +\n \"(\" +\n parsedArgs +\n \")\";\n\n return this.printNodeCommentsIfAny(node, identation, signature);\n }\n\n // Route through Helpers so consumers control semantics (thread-safety,\n // null-handling, type coercion) in one place — same pattern as\n // Helpers.add / Helpers.isEqual / Helpers.GetValue / Helpers.json. The\n // previous inline emits (`x instanceof java.util.List`, `((Map)x).keySet()`)\n // forced any downstream that needed different semantics (e.g. synchronized\n // map access in concurrent code) to post-process the generated Java with\n // regex — which only catches the bare-identifier argument shape and misses\n // property-access (`this.x`) and element-access (`obj[k]`) arguments.\n printArrayIsArrayCall(_node, _identation, parsedArg = undefined) {\n return `Helpers.isArray(${parsedArg})`;\n }\n\n printObjectKeysCall(_node, _identation, parsedArg = undefined) {\n return `Helpers.objectKeys(${parsedArg})`;\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 printPromiseAllCall(_node, _identation, parsedArg = undefined) {\n return `Helpers.promiseAll(${parsedArg})`;\n }\n\n printMathFloorCall(_node, _identation, parsedArg = undefined) {\n return `(Math.floor(Double.parseDouble(Helpers.toString(${parsedArg}))))`;\n }\n\n printMathRoundCall(_node, _identation, parsedArg = undefined) {\n return `Math.round(Double.parseDouble(Helpers.toString(${parsedArg})))`;\n }\n\n printMathCeilCall(_node, _identation, parsedArg = undefined) {\n return `Math.ceil(Double.parseDouble(Helpers.toString(${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 printIndexOfCall(_node, _identation, name = undefined, parsedArg = undefined) {\n return `${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 `new java.util.ArrayList(java.util.Arrays.asList(((String)${name}).split((String)${parsedArg})))`;\n return `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 if (parsedArg2 === undefined) {\n parsedArg2 = \"null\";\n }\n return `Helpers.slice(${name}, ${parsedArg}, ${parsedArg2})`;\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 return `Helpers.replaceAll((String)${name}, (String)${parsedArg}, (String)${parsedArg2})`;\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 `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 TypeChecker).getTypeAtLocation(node.expression);\n this.warnIfAnyType(node, (type as any).flags, leftSide, \"length\");\n return this.isStringType((type as any).flags)\n ? `((String)${leftSide}).length()`\n : `${this.ARRAY_LENGTH_WRAPPER_OPEN}${leftSide}${this.ARRAY_LENGTH_WRAPPER_CLOSE}`;\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 const op = this.PostFixOperators[operator];\n if (op === \"--\") {\n return `${leftSide}--`;\n }\n return `${leftSide}++`;\n }\n\n printPrefixUnaryExpression(node, identation) {\n const { operand, operator } = node;\n if (operator === ts.SyntaxKind.ExclamationToken) {\n return this.PrefixFixOperators[operator] + this.printCondition(node.operand, 0);\n }\n const leftSide = this.printNode(operand, 0);\n if (operator === ts.SyntaxKind.PlusToken) {\n return `+(${leftSide})`;\n } else if (operator === ts.SyntaxKind.MinusToken) {\n return `Helpers.opNeg(${leftSide})`;\n }\n return super.printPrefixUnaryExpression(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 === ts.SyntaxKind.Identifier) {\n return (\n this.getIden(identation) +\n this.THROW_TOKEN +\n \" \" +\n this.printNode(node.expression, 0) +\n this.LINE_TERMINATOR\n );\n }\n if (node.expression.kind === ts.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 === ts.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.escapedText === \"Error\" ? \"RuntimeException\" : id.escapedText;\n const symbol = this.getChecker().getSymbolAtLocation(expression.expression);\n if (symbol) {\n const declarations =\n this.getChecker().getDeclaredTypeOfSymbol(symbol).symbol?.declarations ?? [];\n const isClassDeclaration = declarations.find(\n (l) =>\n l.kind === ts.SyntaxKind.InterfaceDeclaration ||\n l.kind === ts.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 === ts.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 === ts.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]);\n modifiers = modifiers.filter(mod => mod.kind !== ts.SyntaxKind.AsyncKeyword);\n const res = modifiers.map(modifier => this.FuncModifiers[modifier.kind]).join(\" \");\n\n return res;\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 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 === ts.SyntaxKind.AsExpression && (exp.expression.kind === ts.SyntaxKind.ObjectLiteralExpression || ts.SyntaxKind.CallExpression)) {\n exp = exp.expression; // go over something like return {} as SomeType\n }\n // Use collectCapturingObjectLiterals to walk through every wrapper\n // (AwaitExpression, ParenthesizedExpression, CallExpression args, ArrayLiteral\n // elements, ConditionalExpression branches, NewExpression args, etc.) and\n // pick up every HashMap literal whose anonymous-inner-class body would\n // need effectively-final captures. The previous narrow switch missed\n // `return await this.watch(..., { literal capturing reassigned var }, ...)`\n // entirely — the literal ended up referencing the raw (reassigned)\n // identifier with no snapshot, which javac rejects.\n const allVarNames = [];\n if (exp) {\n const objLiterals = this.collectCapturingObjectLiterals(exp);\n for (const objLiteral of objLiterals) {\n const varsList = this.getVarListFromObjectLiteralAndUpdateInPlace(objLiteral);\n allVarNames.push(...varsList);\n }\n }\n let finalVars = allVarNames.length > 0 ? this.buildFinalVarDeclarations(allVarNames, identation) : '';\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 (ts.isFunctionDeclaration(parent) || ts.isMethodDeclaration(parent) || ts.isFunctionExpression(parent) || ts.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 finalVars = finalVars.length > 0 ? this.getIden(identation) + finalVars + \"\\n\" : finalVars;\n return leadingComment + finalVars + this.getIden(identation) + this.RETURN_TOKEN + rightPart + trailingComment;\n }\n\n private allBranchesTerminate(node: ts.Node): boolean {\n if (ts.isReturnStatement(node) || ts.isThrowStatement(node)) {\n return true;\n }\n if (ts.isBlock(node)) {\n const stmts = node.statements;\n return stmts.length > 0 && this.allBranchesTerminate(stmts[stmts.length - 1]);\n }\n if (ts.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 ts from 'typescript';\n\nconst SyntaxKind = ts.SyntaxKind;\n\nconst parserConfig = {\n 'ELSEIF_TOKEN': 'else if',\n 'OBJECT_OPENING': '{',\n 'OBJECT_CLOSING': '}',\n 'ARRAY_OPENING_TOKEN': 'Value::List(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\nexport class RustTranspiler extends BaseTranspiler {\n\n binaryExpressionsWrappers;\n methodSignatures: Record;\n forLoopCounter: number;\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 capitalize(str: string) {\n return str[0].toUpperCase() + str.slice(1);\n }\n\n printStringLiteral(node) {\n let text = node.text;\n if (text in this.StringLiteralReplacements) {\n return this.StringLiteralReplacements[text];\n }\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 `Value::Str(\"${text}\".to_string())`;\n }\n\n printNumericLiteral(node) {\n const text = node.text;\n if (text.includes('.')) {\n return `Value::Float(${text})`;\n }\n return `Value::Int(${text})`;\n }\n\n printBooleanLiteral(node) {\n if (ts.SyntaxKind.TrueKeyword === node.kind) {\n return 'Value::Bool(true)';\n }\n return 'Value::Bool(false)';\n }\n\n printNullKeyword(node, identation) {\n return 'Value::Null';\n }\n\n // Ensure a & ref prefix — skip only if already a reference\n ensureRef(expr: string): string {\n if (expr.startsWith('&')) {\n return expr;\n }\n return `&${expr}`;\n }\n\n printCustomBinaryExpressionIfAny(node, identation) {\n const left = node.left;\n const right = node.right;\n const op = node.operatorToken.kind;\n\n // Handle array destructuring reassignment: [a, b] = expr → bind once, reassign each\n if (op === SyntaxKind.EqualsToken && left.kind === SyntaxKind.ArrayLiteralExpression) {\n const elements = left.elements;\n const rhs = this.printNode(right, 0);\n const tmpName = '__destr_tmp';\n const assignments = elements.map((e, idx) => {\n const target = this.printNode(e, 0);\n return `${target} = get_value(&${tmpName}, &Value::Int(${idx}))`;\n }).join('; ');\n return `{ let ${tmpName} = ${rhs}; ${assignments}; }`;\n }\n\n // Handle element access assignment: a[b] = v → add_element_to_object(&mut a, &b, v)\n if (op === SyntaxKind.EqualsToken && left.kind === SyntaxKind.ElementAccessExpression) {\n const keys: any[] = [];\n let baseExpr: any = null;\n let cur: any = left;\n while (ts.isElementAccessExpression(cur)) {\n keys.unshift(cur.argumentExpression);\n const expr = cur.expression;\n if (!ts.isElementAccessExpression(expr)) {\n baseExpr = expr;\n break;\n }\n cur = expr;\n }\n const containerStr = this.printNode(baseExpr, 0);\n const keyStrs = keys.map(k => this.printNode(k, 0));\n let acc = `&mut ${containerStr}`;\n for (let i = 0; i < keyStrs.length - 1; i++) {\n acc = `get_value_mut(${acc}, &${keyStrs[i]})`;\n }\n const lastKey = keyStrs[keyStrs.length - 1];\n const rhs = this.printNode(right, 0);\n return `add_element_to_object(${acc}, &${lastKey}, ${rhs})`;\n }\n\n // Handle typeof comparisons\n if (left.kind === SyntaxKind.TypeOfExpression) {\n const expression = left.expression;\n const rightText = right.text;\n const target = this.printNode(expression, 0);\n const isDiff = op === SyntaxKind.ExclamationEqualsEqualsToken || op === SyntaxKind.ExclamationEqualsToken;\n const not = isDiff ? '!' : '';\n switch (rightText) {\n case 'string': return `${not}is_string(&${target})`;\n case 'number': return `${not}is_number(&${target})`;\n case 'boolean': return `${not}is_bool(&${target})`;\n case 'object': return `${not}is_object(&${target})`;\n case 'function': return `${not}is_function(&${target})`;\n }\n }\n\n // Handle in operator — wrap as Value so it composes in any context\n if (op === SyntaxKind.InKeyword) {\n return `Value::Bool(in_op(&${this.printNode(right, 0)}, &${this.printNode(left, 0)}))`;\n }\n\n // Handle += for regular variables\n if (op === SyntaxKind.PlusEqualsToken && left.kind !== SyntaxKind.ElementAccessExpression) {\n const leftText = this.printNode(left, 0);\n const rightText = this.printNode(right, 0);\n return `${leftText} = add(&${leftText}, &${rightText})`;\n }\n\n // Handle -= for regular variables\n if (op === SyntaxKind.MinusEqualsToken && left.kind !== SyntaxKind.ElementAccessExpression) {\n const leftText = this.printNode(left, 0);\n const rightText = this.printNode(right, 0);\n return `${leftText} = subtract(&${leftText}, &${rightText})`;\n }\n\n // Binary wrapper functions (is_equal, add, etc.) - add & to both sides\n if (op in this.binaryExpressionsWrappers) {\n const [fnName, close] = this.binaryExpressionsWrappers[op];\n const leftText = this.printNode(left, 0);\n const rightText = this.printNode(right, 0);\n const leftRef = this.ensureRef(leftText);\n const rightRef = this.ensureRef(rightText);\n return `${fnName}${leftRef}, ${rightRef}${close}`;\n }\n\n return undefined;\n }\n\n printBinaryExpression(node, identation) {\n const custom = this.printCustomBinaryExpressionIfAny(node, identation);\n if (custom) {\n return custom;\n }\n return 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\n // (`pad_start` / `pad_end` take `(&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 isNew = declaration.initializer && declaration.initializer.kind === SyntaxKind.NewExpression;\n\n if (declaration?.name.kind === SyntaxKind.ArrayBindingPattern) {\n const elements = declaration.name.elements;\n const parsedElements = elements.map(e => this.printNode(e.name, 0));\n const syntheticName = parsedElements.join('') + 'Variable';\n let stmt = `${this.getIden(identation)}let mut ${syntheticName} = ${this.printNode(declaration.initializer, 0)};\\n`;\n parsedElements.forEach((e, idx) => {\n const line = `${this.getIden(identation)}let mut ${e}: Value = get_value(&${syntheticName}, &Value::Int(${idx}))`;\n stmt += idx < parsedElements.length - 1 ? line + ';\\n' : line;\n });\n return stmt;\n }\n\n const varName = this.printNode(declaration.name, 0);\n\n if (!declaration.initializer) {\n return `${this.getIden(identation)}let mut ${varName}: Value = Value::Null`;\n }\n\n const parsedValue = this.printNode(declaration.initializer, identation).trim();\n\n if (isNew) {\n return `${this.getIden(identation)}let mut ${varName} = ${parsedValue}`;\n }\n\n return `${this.getIden(identation)}let mut ${varName}: Value = ${parsedValue}`;\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 const propDecls = node.members.filter(m => m.kind === SyntaxKind.PropertyDeclaration);\n return propDecls.map(p => {\n const name = this.printNode(p.name, 0);\n const init = p.initializer ? this.printNode(p.initializer, 0) : 'Value::Null';\n return { name, init };\n });\n }\n\n printStruct(node, identation) {\n const fields = this.getStructFields(node);\n const fieldLines = fields.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 fields = this.getStructFields(node);\n const fieldInits = fields.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.className = node.name.escapedText;\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 => {\n const name = (method as any).name.escapedText;\n const params = (method as any).parameters;\n const requiredCount = params.filter(p => !p.initializer && !p.questionToken).length;\n const hasOptional = params.some(p => p.initializer !== undefined || p.questionToken !== undefined);\n if (hasOptional) {\n this.methodSignatures[name] = { requiredCount };\n }\n });\n\n const struct = this.printStruct(node, identation);\n const newMethod = this.printNewMethod(node, identation);\n\n const classMethods = methods.map(m => this.printMethodDeclaration(m, identation)).join('\\n\\n');\n\n const implBlock = `\\nimpl ${this.className} {\\n${classMethods}\\n}`;\n\n return struct + newMethod + implBlock;\n }\n\n printMethodDefinition(node, identation) {\n const name = (node.name as any).escapedText;\n const params = node.parameters;\n const hasOptional = params.some(p => p.initializer !== undefined || p.questionToken !== undefined);\n\n const requiredParams = params.filter(p => !p.initializer && !p.questionToken);\n const optionalParams = params.filter(p => p.initializer !== undefined || p.questionToken !== undefined);\n\n let parsedArgs = '&self';\n if (requiredParams.length > 0) {\n const reqArgs = requiredParams.map(p => `${this.printNode(p.name, 0)}: Value`).join(', ');\n parsedArgs += ', ' + reqArgs;\n }\n if (hasOptional) {\n parsedArgs += ', optional_args: &[Value]';\n }\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 try {\n const type = this.getChecker().getReturnTypeOfSignature(this.getChecker().getSignatureFromDeclaration(node));\n if (type.flags === ts.TypeFlags.Void) {\n return '';\n }\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 let optionalInits = '';\n if (optionalParams.length > 0) {\n const requiredCount = params.filter(p => !p.initializer && !p.questionToken).length;\n optionalInits = optionalParams.map((p, idx) => {\n const pname = this.printNode(p.name, 0);\n const defaultVal = p.initializer ? this.printNode(p.initializer, 0) : 'Value::Null';\n return `${this.getIden(identation + 2)}let ${pname} = get_arg(optional_args, ${idx}, ${defaultVal});`;\n }).join('\\n') + '\\n';\n }\n\n const blockOpen = this.getBlockOpen(identation);\n const blockClose = this.getBlockClose(identation);\n const statements = node.body.statements.map(s => this.printNode(s, identation + 2)).join('\\n');\n const body = blockOpen + optionalInits + statements + blockClose;\n\n return this.printNodeCommentsIfAny(node, identation, methodDef + body);\n }\n\n printFunctionDefinition(node, identation) {\n const name = node.name?.escapedText ?? '';\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 (ts.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.escapedText;\n const sig = this.methodSignatures[methodName];\n if (sig) {\n const requiredArgs = args.slice(0, sig.requiredCount).map(a => this.printNode(a, 0)).join(', ');\n const optionalArgsList = args.slice(sig.requiredCount).map(a => this.printNode(a, 0)).join(', ');\n const optSlice = optionalArgsList ? `&[${optionalArgsList}]` : '&[]';\n const reqPart = requiredArgs ? `${requiredArgs}, ` : '';\n return `self.${methodName}(${reqPart}${optSlice})`;\n }\n }\n\n return undefined;\n }\n\n printCallExpression(node, identation) {\n const expression = node.expression;\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 const ref = argText.startsWith('Value::') ? `&${argText}` :\n argText.startsWith('&') ? argText : `&${argText}`;\n return `println_val(${ref})`;\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) return outOfOrder;\n\n return super.printCallExpression(node, identation);\n }\n\n printThisKeyword(node, identation) {\n return 'self';\n }\n\n printNewExpression(node, identation) {\n let expression = node.expression?.escapedText;\n expression = expression ? expression : this.printNode(node.expression);\n const args = node.arguments.map(a => this.printNode(a, identation)).join(', ');\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 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 = expression\n .replace(/([A-Z]+)([A-Z][a-z])/g, '$1_$2')\n .replace(/([a-z\\d])([A-Z])/g, '$1_$2')\n .toLowerCase();\n return `crate::exchange_errors::${snake}(${args})`;\n }\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.escapedText;\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 `get_array_length(&${leftExpr})`;\n }\n\n return `${leftExpr}.${rightSide}`;\n }\n\n transformPropertyAcessExpressionIfNeeded(node) {\n const rightSide = node.name.escapedText;\n const leftExpr = this.printNode(node.expression, 0);\n if (rightSide === 'length') {\n return `get_array_length(&${leftExpr})`;\n }\n return undefined;\n }\n\n printElementAccessExpression(node, identation) {\n const special = this.printElementAccessExpressionExceptionIfAny(node);\n if (special) return special;\n\n const keys: any[] = [];\n let baseExpr = null;\n let current: any = node;\n while (ts.isElementAccessExpression(current)) {\n keys.unshift(current.argumentExpression);\n const expr = current.expression;\n if (!ts.isElementAccessExpression(expr)) {\n baseExpr = expr;\n break;\n }\n current = expr;\n }\n\n const containerStr = this.printNode(baseExpr, 0);\n const keyStrs = keys.map(k => this.printNode(k, 0));\n\n let acc = containerStr;\n keyStrs.forEach(k => {\n const kRef = k.startsWith('Value::') ? `&${k}` : `&${k}`;\n acc = `get_value(&${acc}, ${kRef})`;\n });\n return acc;\n }\n\n printForStatement(node, identation) {\n const initNode = node.initializer;\n const condNode = node.condition;\n const incrNode = node.incrementor;\n\n const idn = this.getIden(identation);\n const idn1 = this.getIden(identation + 1);\n\n const initStr = initNode ? this.printNode(initNode, identation + 1) + ';\\n' : '';\n const condStr = condNode ? this.printNode(condNode, 0) : 'true';\n const incrStr = incrNode ? this.printNode(incrNode, 0) : '';\n\n const statements = node.statement.statements.map(s => this.printNode(s, identation + 1)).join('\\n');\n const body = `{\\n${statements}\\n${idn}}`;\n\n // A C-style `for` becomes a Rust `while`. The increment must run on\n // every iteration *including* one ended by `continue` — a `continue`\n // re-evaluates the loop condition, so the increment is folded into\n // it (guarded by a first-iteration flag). Putting the increment at\n // the end of the body instead would let `continue` skip it and spin\n // 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,\n SyntaxKind.EqualsEqualsEqualsToken,\n SyntaxKind.ExclamationEqualsToken,\n SyntaxKind.ExclamationEqualsEqualsToken,\n SyntaxKind.LessThanToken,\n SyntaxKind.LessThanEqualsToken,\n SyntaxKind.GreaterThanToken,\n SyntaxKind.GreaterThanEqualsToken,\n ]);\n\n printCondition(node, 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 as any).COMPARISON_OPS.has(opKind)) {\n return `${this.getIden(identation)}${this.printNode(node, 0)}`;\n }\n // Logical &&/|| operands are individually is_true()-wrapped in\n // printBinaryExpression, so the whole expression is already bool.\n if (opKind === SyntaxKind.AmpersandAmpersandToken ||\n opKind === SyntaxKind.BarBarToken) {\n return `${this.getIden(identation)}${this.printNode(node, 0)}`;\n }\n }\n // PrefixUnary ! — delegate to avoid double-wrapping\n if (node.kind === SyntaxKind.PrefixUnaryExpression &&\n node.operator === SyntaxKind.ExclamationToken) {\n return this.printPrefixUnaryExpression(node, identation);\n }\n const expression = this.printNode(node, 0);\n return `${this.getIden(identation)}is_true(&${expression})`;\n }\n\n printWhileStatement(node, identation) {\n const expr = this.printCondition(node.expression, 0);\n const body = this.printBlock(node.statement, identation);\n return `${this.getIden(identation)}while ${expr}${body}`;\n }\n\n printIfStatement(node, identation) {\n const expression = this.printCondition(node.expression, 0);\n const elseExists = node.elseStatement !== undefined;\n const ifBody = this.printBlock(node.thenStatement, identation, elseExists);\n\n let ifComplete = `${expression}${ifBody}`;\n const isElseIf = node.parent.kind === SyntaxKind.IfStatement;\n if (isElseIf) {\n ifComplete = `else if ${ifComplete}`;\n } else {\n ifComplete = `${this.getIden(identation)}if ${ifComplete}`;\n }\n\n const elseStatement = node.elseStatement;\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 operandText = this.printNode(operand, 0);\n if (operator === SyntaxKind.PlusPlusToken) {\n return `${this.getIden(identation)}${operandText} = add(&${operandText}, &Value::Int(1))`;\n }\n if (operator === SyntaxKind.MinusMinusToken) {\n return `${this.getIden(identation)}${operandText} = subtract(&${operandText}, &Value::Int(1))`;\n }\n return super.printPostFixUnaryExpression(node, identation);\n }\n\n printPrefixUnaryExpression(node, identation) {\n const { operand, operator } = node;\n if (operator === SyntaxKind.ExclamationToken) {\n return this.getIden(identation) + '!' + this.printCondition(node.operand, 0);\n }\n if (operator === SyntaxKind.MinusToken) {\n return this.getIden(identation) + `negate(&${this.printNode(operand, 0)})`;\n }\n return this.getIden(identation) + this.PrefixFixOperators[operator] + this.printNode(operand, 0);\n }\n\n printObjectLiteralExpression(node, identation) {\n if (node.properties.length === 0) {\n return 'Value::Map({\\n' + this.getIden(identation + 1) + 'let mut m = std::collections::HashMap::new();\\n' + this.getIden(identation + 1) + 'm\\n' + this.getIden(identation) + '})';\n }\n const escapeKey = (s: any): string => {\n return String(s).replace(/\\\\/g, '\\\\\\\\').replace(/\"/g, '\\\\\"').replace(/\\n/g, '\\\\n').replace(/\\r/g, '\\\\r').replace(/\\t/g, '\\\\t');\n };\n const lines = node.properties.map(p => {\n // Shorthand: { foo } → m.insert(\"foo\", foo.clone());\n if (ts.isShorthandPropertyAssignment(p)) {\n const name = p.name.escapedText;\n return `${this.getIden(identation + 2)}m.insert(\"${escapeKey(name)}\".to_string(), ${name}.clone());`;\n }\n const { name, initializer } = p;\n const keyText = ts.isStringLiteral(name) ? name.text : name.escapedText;\n const valText = this.printNode(initializer, 0);\n return `${this.getIden(identation + 2)}m.insert(\"${escapeKey(keyText)}\".to_string(), ${valText});`;\n }).join('\\n');\n return `Value::Map({\\n${this.getIden(identation + 1)}let mut m = std::collections::HashMap::new();\\n${lines}\\n${this.getIden(identation + 1)}m\\n${this.getIden(identation)}})`;\n }\n\n printArrayLiteralExpression(node, identation) {\n const elements = node.elements.map(e => this.printNode(e, 0)).join(', ');\n return `Value::List(vec![${elements}])`;\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 const keyRef = key.startsWith('Value::') ? `&${key}` : `&${key}`;\n return `remove(&mut ${object}, ${keyRef})`;\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)}is_instance(&${left}, &${right})`;\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 `ternary(${condition}, ${whenTrue}, ${whenFalse})`;\n }\n\n // Built-in method call overrides\n printArrayIsArrayCall(node, identation, parsedArg = undefined) {\n return `Value::Bool(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 printPromiseAllCall(node, identation, parsedArg = undefined) {\n // No trailing `.await` here — when the TS source has\n // `await Promise.all(...)`, `printAwaitExpression` will append it.\n // Adding it here too would produce `.await.await` (double-await).\n return `promise_all(&${parsedArg})`;\n }\n\n // Rust uses postfix `.await`; the base transpiler defaults to prefix.\n printAwaitExpression(node, identation) {\n const expr = this.printNode(node.expression, identation);\n return `${expr}.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 const pRef = parsedArg?.startsWith('Value::') ? `&${parsedArg}` : `&${parsedArg}`;\n return `Value::Bool(contains(&${name}, ${pRef}))`;\n }\n\n printIndexOfCall(node, identation, name = undefined, parsedArg = undefined) {\n return `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 const arg2 = parsedArg2 ?? 'Value::Null';\n return `slice(&${name}, &${parsedArg}, &${arg2})`;\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 printThrowStatement(node, identation) {\n const expression = this.printNode(node.expression, 0);\n // `{}` (Display) renders an ExchangeError as `[Kind] message`;\n // `{:?}` would dump the struct fields.\n return `${this.getIden(identation)}panic!(\"{}\", ${expression});`;\n }\n\n printTryStatement(node, identation) {\n const tryBody = node.tryBlock.statements.map(s => this.printNode(s, identation + 1)).join('\\n');\n const catchBody = node.catchClause.block.statements.map(s => this.printNode(s, identation + 1)).join('\\n');\n const rawName = node.catchClause?.variableDeclaration?.name?.escapedText;\n const errorName = rawName ? `_${rawName}` : '_e';\n const iden = this.getIden(identation);\n return `${iden}let _try_result = std::panic::catch_unwind(std::panic::AssertUnwindSafe(|| {\\n${tryBody}\\n${iden}}));\\n${iden}if let Err(${errorName}) = _try_result {\\n${catchBody}\\n${iden}}`;\n }\n\n printReturnStatement(node, identation) {\n const exp = node.expression;\n if (!exp) {\n return `${this.getIden(identation)}return;`;\n }\n const rightPart = this.printNode(exp, 0).trim();\n return `${this.getIden(identation)}return ${rightPart};`;\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 const expression = this.printNode(node.expression, 0);\n return `${this.getIden(identation)}${expression}`;\n }\n}\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;AAAA;AAAA;AACA,WAAO,UAAU;AAAA;AAAA;;;ACDjB;AACA,qBAAwB;AADxB,OAAOA,SAAQ;;;ACAf;;;ACAA;AAAA,OAAO,QAAQ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AAqB,OAAiB;AAClC,SAAK,cAAc,sCAAsC;AAAA,EAC7D;AAAA,EAEA,6BAA6B,aAAsB;AAC/C,SAAK,cAAc,yBAAyB;AAAA,EAChD;AAAA,EAEA,gCAAgC,aAAsB;AAClD,SAAK,iBAAiB,yBAAyB;AAAA,EACnD;AAAA,EAEA,uBAAuB,OAAgB;AACnC,SAAK,cAAc,mBAAmB;AAAA,EAC1C;AAAA,EAEA,0BAA0B,OAAgB;AACtC,SAAK,iBAAiB,mBAAmB;AAAA,EAC7C;AAAA,EAEA,mCAAmC,cAAoB;AACnD,SAAK,iBAAiB,4BAA4B;AAAA,EACtD;AAAA,EAEA,4BAA4B,MAAyB;AACjD,YAAO,MAAM;AAAA,MACb,KAAK;AACD;AAAA,MACJ,KAAK;AACD;AAAA,MACJ,KAAK;AACD;AAAA,MACJ,KAAK;AACD;AAAA,MACJ,KAAK;AACD;AAAA,MACJ,KAAK;AACD;AAAA,IACJ;AAAA,EACJ;AACJ;","names":["ts","defaultValue","type","node","namedExports","ts","ts","SyntaxKind","ts","parserConfig","ts","parserConfig","symbol","defaultValue","path","ts","SyntaxKind","parserConfig","ts","parserConfig","ts","SyntaxKind","parserConfig","name","currentPath","ts","sourceFile","path"]} \ No newline at end of file +{"version":3,"sources":["../node_modules/tsup/assets/esm_shims.js","../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"],"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","// https://github.com/kulshekhar/ts-jest/issues/1174\nmodule.exports = __dirname;","import ts from 'typescript';\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 } from './goTranspiler.js';\nimport { JavaTranspiler } from './javaTranspiler.js';\nimport { RustTranspiler } from './rustTranspiler.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: ts.CompilerOptions = {\n target: ts.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\nfunction overrideHostForVirtualFiles(host: ts.CompilerHost, files: Map) {\n const originalGetSourceFile = host.getSourceFile.bind(host);\n const originalReadFile = host.readFile.bind(host);\n const originalFileExists = host.fileExists.bind(host);\n // resolve paths because typescript will normalize them\n // to forward slashes on windows\n host.getSourceFile = (fileName, languageVersion, onError, shouldCreateNewSourceFile) => {\n const virtual = files.get(path.resolve(fileName));\n return virtual !== undefined ? virtual : originalGetSourceFile(fileName, languageVersion, onError, shouldCreateNewSourceFile);\n };\n host.readFile = (fileName: string) => {\n const virtual = files.get(path.resolve(fileName));\n return virtual !== undefined ? virtual.text : originalReadFile(fileName);\n };\n host.fileExists = (fileName: string) => {\n return files.has(path.resolve(fileName)) || originalFileExists(fileName);\n };\n}\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 NO_SYMBOL_SENTINEL = Symbol(\"noSymbol\");\nfunction memoizeCheckerCalls(checker: ts.TypeChecker): void {\n if ((checker as any).__astTranspilerMemoized) {\n return;\n }\n (checker as any).__astTranspilerMemoized = true;\n\n const typeCache = new WeakMap();\n const originalGetTypeAtLocation = checker.getTypeAtLocation.bind(checker);\n checker.getTypeAtLocation = (node: ts.Node): ts.Type => {\n let type = typeCache.get(node);\n if (type === undefined) {\n type = originalGetTypeAtLocation(node);\n typeCache.set(node, type);\n }\n return type;\n };\n\n const symbolCache = new WeakMap();\n const originalGetSymbolAtLocation = checker.getSymbolAtLocation.bind(checker);\n checker.getSymbolAtLocation = (node: ts.Node): ts.Symbol | undefined => {\n const cached = symbolCache.get(node);\n if (cached !== undefined) {\n return cached === NO_SYMBOL_SENTINEL ? undefined : cached;\n }\n const symbol = originalGetSymbolAtLocation(node);\n symbolCache.set(node, symbol === undefined ? NO_SYMBOL_SENTINEL : symbol);\n return symbol;\n };\n}\n\nfunction getProgramAndTypeCheckerFromMemory (rootDir: string, text: string, options: any = {}, cache?: ITranspileProgramCache): [any,any,any] {\n options = options || ts.getDefaultCompilerOptions();\n const inMemoryFilePath = path.resolve(path.join(rootDir, \"__dummy-file.ts\"));\n const textAst = ts.createSourceFile(inMemoryFilePath, text, options.target || ts.ScriptTarget.Latest);\n const shimAst = ts.createSourceFile(globalsShimPath, globalsShim, options.target || ts.ScriptTarget.Latest);\n const host = ts.createCompilerHost(options, true);\n\n overrideHostForVirtualFiles(host, new Map([\n [inMemoryFilePath, textAst],\n [globalsShimPath, shimAst],\n ]));\n\n if (cache !== undefined) {\n // the dummy file changes every call, but the es lib chain behind it does not:\n // serve those from the shared cache so they are parsed once per cache\n const originalGetSourceFile = host.getSourceFile.bind(host);\n host.getSourceFile = (fileName, languageVersion, onError, shouldCreateNewSourceFile) => {\n const resolved = path.resolve(fileName);\n if (resolved === inMemoryFilePath) {\n return textAst;\n }\n const cached = cache.sourceFiles.get(resolved);\n if (cached !== undefined && !shouldCreateNewSourceFile) {\n return cached.sourceFile;\n }\n const sourceFile = originalGetSourceFile(fileName, languageVersion, onError, shouldCreateNewSourceFile);\n if (sourceFile !== undefined) {\n cache.sourceFiles.set(resolved, { mtimeMs: 0, sourceFile });\n }\n return sourceFile;\n };\n }\n\n const program = ts.createProgram({\n options,\n rootNames: [inMemoryFilePath, globalsShimPath],\n host,\n oldProgram: cache?.memoryOldProgram,\n });\n if (cache !== undefined) {\n cache.memoryOldProgram = program;\n }\n\n const typeChecker = program.getTypeChecker();\n memoizeCheckerCalls(typeChecker);\n const sourceFile = program.getSourceFile(inMemoryFilePath);\n\n return [ program, typeChecker, sourceFile];\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 // 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\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 { sourceFiles: new Map() };\n }\n\n constructor(config = {}, programCache?: ITranspileProgramCache) {\n this.config = config;\n this.programCache = programCache ?? Transpiler.createProgramCache();\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\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 }\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 createProgramInMemoryAndSetContext(content): ITranspileContext {\n const [ memProgram, memType, memSource] = getProgramAndTypeCheckerFromMemory(__dirname_mock, content, fastCompilerOptions, this.programCache);\n return this.setContext({\n src: memSource,\n checker: memType as ts.TypeChecker,\n program: memProgram,\n });\n }\n\n getByPathCompilerHost(options: ts.CompilerOptions): ts.CompilerHost {\n if (this.programCache.byPathHost === undefined) {\n const host = ts.createCompilerHost(options, true);\n const originalGetSourceFile = host.getSourceFile.bind(host);\n const cache = this.programCache.sourceFiles;\n host.getSourceFile = (fileName, languageVersion, onError, shouldCreateNewSourceFile) => {\n let mtimeMs = 0;\n try {\n mtimeMs = fs.statSync(fileName).mtimeMs;\n } catch (e) {\n // e.g. synthetic lib paths — fall through with mtime 0\n }\n const cached = cache.get(fileName);\n if (cached && cached.mtimeMs === mtimeMs && !shouldCreateNewSourceFile) {\n return cached.sourceFile;\n }\n const sourceFile = originalGetSourceFile(fileName, languageVersion, onError, shouldCreateNewSourceFile);\n if (sourceFile !== undefined) {\n cache.set(fileName, { mtimeMs, sourceFile });\n }\n return sourceFile;\n };\n const shimAst = ts.createSourceFile(globalsShimPath, globalsShim, ts.ScriptTarget.Latest);\n overrideHostForVirtualFiles(host, new Map([[globalsShimPath, shimAst]]));\n this.programCache.byPathHost = host;\n }\n return this.programCache.byPathHost;\n }\n\n createProgramByPathAndSetContext(path): ITranspileContext {\n const options: ts.CompilerOptions = fastCompilerOptions;\n const host = this.getByPathCompilerHost(options);\n // passing the previous program lets typescript reuse its internal state where\n // possible; the cached host makes every already-seen dependency parse-free\n const program = ts.createProgram([path, globalsShimPath], options, host, this.programCache.byPathOldProgram);\n this.programCache.byPathOldProgram = program;\n const sourceFile = program.getSourceFile(path);\n const typeChecker = program.getTypeChecker();\n memoizeCheckerCalls(typeChecker);\n\n return this.setContext({\n src: sourceFile,\n checker: typeChecker,\n program,\n });\n }\n\n // One program over N root files, instead of one program per file. Every\n // transpile*ByPath call pays for a full program: even with the SourceFile cache\n // making the ~340-file import closure parse-free, the binder/checker work behind\n // getPreEmitDiagnostics is redone per file. Batching N files into one program\n // pays it once for the whole set.\n //\n // Files that import each other (a derived exchange and its parent) are fine in\n // one batch — they are separate root files of the same program, exactly as\n // typescript would compile a project.\n //\n // The batch deliberately does not become the cache's byPathOldProgram: an N-file\n // program never structurally reuses a program built from a different root set, so\n // there is nothing to gain, and keeping the previous chunk's checker alive while\n // the next one is built would double peak memory — the opposite of why callers\n // chunk. The cross-batch saving comes from the shared host + SourceFile cache.\n createProgramBatch(paths: string[]): TranspileProgramBatch {\n const options: ts.CompilerOptions = fastCompilerOptions;\n const host = this.getByPathCompilerHost(options);\n const program = ts.createProgram([...paths, globalsShimPath], options, host);\n const checker = program.getTypeChecker();\n memoizeCheckerCalls(checker);\n return new TranspileProgramBatch(this, 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 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 const diagnostics = ts.getPreEmitDiagnostics(context.program, context.src);\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.messageText + \"\\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\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 transpiledContent = 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 }\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\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 }\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 program: ts.Program;\n private readonly checker: ts.TypeChecker;\n\n constructor(transpiler: Transpiler, program: ts.Program, checker: ts.TypeChecker) {\n this.transpiler = transpiler;\n this.program = program;\n this.checker = checker;\n }\n\n getProgram(): ts.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 — the printers read checker state\n // back from it, so it is not optional\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\nexport {\n Transpiler,\n TranspileProgramBatch\n};\n","import { BaseTranspiler } from \"./baseTranspiler.js\";\nimport { regexAll } from \"./utils.js\";\nimport ts from 'typescript';\n\nconst SyntaxKind = ts.SyntaxKind;\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.escapedText;\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.escapedText;\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.escapedText;\n const heritageClauses = node.heritageClauses;\n\n let classInit = \"\";\n if (heritageClauses !== undefined) {\n const classExtends = heritageClauses[0].types[0].expression.escapedText;\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 === ts.SyntaxKind.EqualsEqualsToken || op === ts.SyntaxKind.EqualsEqualsEqualsToken) && node.right.kind === ts.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 ts.SyntaxKind.EqualsEqualsToken:\n return \"is\";\n case ts.SyntaxKind.ExclamationEqualsToken:\n return \"is not\";\n case ts.SyntaxKind.ExclamationEqualsEqualsToken:\n return \"is not\";\n case ts.SyntaxKind.EqualsEqualsEqualsToken:\n return \"is\";\n }\n }\n }\n}\n","import ts from 'typescript';\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(): ts.SourceFile {\n if (this.context === undefined) throw new Error(NO_CONTEXT_ERROR);\n return this.context.src;\n }\n\n getChecker(): ts.TypeChecker {\n if (this.context === undefined) throw new Error(NO_CONTEXT_ERROR);\n return this.context.checker;\n }\n\n getProgram(): ts.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 [ts.SyntaxKind.StringLiteral]: this.STRING_LITERAL_KEYWORD,\n [ts.SyntaxKind.StringKeyword]: this.STRING_KEYWORD,\n // [ts.SyntaxKind.NumberKeyword]: this.NUMBER_KEYWORD,\n [ts.SyntaxKind.NumberKeyword]: this.DEFAULT_TYPE,\n [ts.SyntaxKind.MinusMinusToken]: this.MINUS_MINUS_TOKEN,\n [ts.SyntaxKind.MinusToken]: this.MINUS_TOKEN,\n [ts.SyntaxKind.SlashToken]: this.SLASH_TOKEN,\n [ts.SyntaxKind.AsteriskToken]: this.ASTERISK_TOKEN,\n [ts.SyntaxKind.InKeyword]: this.IN_TOKEN,\n [ts.SyntaxKind.PlusToken]: this.PLUS_TOKEN,\n [ts.SyntaxKind.PercentToken]: this.PERCENT_TOKEN,\n [ts.SyntaxKind.LessThanToken]: this.LESS_THAN_TOKEN,\n [ts.SyntaxKind.LessThanEqualsToken]: this.LESS_THAN_EQUALS_TOKEN,\n [ts.SyntaxKind.GreaterThanToken]: this.GREATER_THAN_TOKEN,\n [ts.SyntaxKind.GreaterThanEqualsToken]: this.GREATER_THAN_EQUALS_TOKEN,\n [ts.SyntaxKind.EqualsEqualsToken]: this.EQUALS_EQUALS_TOKEN,\n [ts.SyntaxKind.EqualsEqualsEqualsToken]: this.EQUALS_EQUALS_EQUALS_TOKEN,\n [ts.SyntaxKind.EqualsToken]: this.EQUALS_TOKEN,\n [ts.SyntaxKind.PlusEqualsToken]: this.PLUS_EQUALS,\n [ts.SyntaxKind.BarBarToken]: this.BAR_BAR_TOKEN,\n [ts.SyntaxKind.AmpersandAmpersandToken]: this.AMPERSTAND_APERSAND_TOKEN,\n [ts.SyntaxKind.ExclamationEqualsEqualsToken]: this.EXCLAMATION_EQUALS_EQUALS_TOKEN,\n [ts.SyntaxKind.ExclamationEqualsToken]: this.EXCLAMATION_EQUALS_TOKEN,\n [ts.SyntaxKind.AsyncKeyword]: this.ASYNC_TOKEN,\n [ts.SyntaxKind.AwaitKeyword]: this.AWAIT_TOKEN,\n [ts.SyntaxKind.StaticKeyword]: this.STATIC_TOKEN,\n [ts.SyntaxKind.PublicKeyword]: this.PUBLIC_KEYWORD,\n [ts.SyntaxKind.PrivateKeyword]: this.PRIVATE_KEYWORD,\n [ts.SyntaxKind.VoidKeyword]: this.VOID_KEYWORD,\n [ts.SyntaxKind.BooleanKeyword]: this.BOOLEAN_KEYWORD,\n };\n\n this.PostFixOperators = {\n [ts.SyntaxKind.PlusPlusToken]: this.PLUS_PLUS_TOKEN,\n [ts.SyntaxKind.MinusMinusToken]: this.MINUS_MINUS_TOKEN,\n };\n\n this.PrefixFixOperators = {\n [ts.SyntaxKind.ExclamationToken]: this.NOT_TOKEN,\n [ts.SyntaxKind.MinusToken]: this.MINUS_TOKEN,\n };\n\n this.FunctionDefSupportedKindNames = {\n [ts.SyntaxKind.StringKeyword]: this.STRING_KEYWORD\n };\n\n this.FuncModifiers = {\n [ts.SyntaxKind.AsyncKeyword]: this.ASYNC_TOKEN,\n [ts.SyntaxKind.PublicKeyword]: this.PUBLIC_KEYWORD,\n [ts.SyntaxKind.PrivateKeyword]: this.PRIVATE_KEYWORD,\n [ts.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: ts.TypeFlags) {\n return flags === ts.TypeFlags.String || flags === ts.TypeFlags.StringLiteral;\n }\n\n isAnyType(flags: ts.TypeFlags) {\n return flags === ts.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 === ts.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 || !ts.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: ts.Node): ts.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 (!ts.isClassDeclaration(node.parent)) {\n return undefined;\n }\n\n // Get the class declaration\n const classDeclaration = node.parent as ts.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 = (ts as any).getAllSuperTypeNodes(node.parent)[0];\n\n while (parentClass !== undefined) {\n const parentClassType = this.getChecker().getTypeAtLocation(parentClass);\n const parentClassDecl = parentClassType?.symbol?.valueDeclaration;\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 (ts.isMethodDeclaration(elem)) {\n\n const name = elem.name.getText().trim();\n if ((node as any).name.escapedText === name) {\n method = elem;\n }\n }\n });\n\n parentClass = (ts as any).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) {\n return name;\n }\n\n transformPropertyAccessExpressionName(name: string) {\n return name;\n }\n\n printIdentifier(node) {\n let idValue = node.text ?? node.escapedText;\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 === ts.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.escapedText;\n const right = node.right.escapedText;\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 == ts.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 === ts.SyntaxKind.EqualsEqualsToken || operatorToken.kind === ts.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 === ts.SyntaxKind.BarBarToken || operatorToken.kind === ts.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.escapedText;\n let rightSide = node.name.escapedText;\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);\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 !== ts.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 = 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 printTraillingComment(node, identation) {\n const fullText = this.getSrc().getFullText();\n const commentsRangeList = ts.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 === ts.SyntaxKind.TypeReference) {\n const typeRef = type.typeName.escapedText;\n if (typeRef === \"Promise\") {\n const typeArgs = type.typeArguments.filter(t => t.kind !== ts.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.escapedText;\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.escapedText;\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 (ts.isArrayLiteralExpression(initializer)) {\n return this.ARRAY_KEYWORD;\n }\n if ((ts as any).isBooleanLiteral(initializer)) {\n return this.BOOLEAN_KEYWORD;\n }\n if (ts.isObjectLiteralExpression(initializer)) {\n return this.OBJECT_KEYWORD;\n }\n if (ts.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 (ts.isStringLiteralLike(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 === ts.TypeFlags.Any) {\n return undefined;\n }\n if (type.flags === ts.TypeFlags.Void) {\n return this.VOID_KEYWORD;\n }\n if (type.flags === ts.TypeFlags.Number) {\n // return this.NUMBER_KEYWORD;\n return this.DEFAULT_TYPE;\n }\n\n if (type.flags === ts.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?.symbol?.escapedName === 'Array') {\n return this.ARRAY_KEYWORD;\n }\n if (type?.symbol?.escapedName === '__object') {\n return this.OBJECT_KEYWORD;\n }\n\n // check this out, trying to resolve Promise<{}>\n if (type?.symbol?.escapedName === '__type') {\n return this.OBJECT_KEYWORD;\n // return this.DEFAULT_TYPE;\n }\n\n // check for promise type\n\n if (type?.symbol?.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 = (type as any).resolvedTypeArguments; // internal typescript property\n if (resolvedTypeArguments.length === 0) {\n return this.PROMISE_TYPE_KEYWORD;\n }\n if (resolvedTypeArguments.length === 1 && resolvedTypeArguments[0].flags === ts.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?.escapedText ?? \"\";\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 && ts.isFunctionDeclaration(node)){\n modifiers = modifiers + \"public \";\n }\n let functionDef = this.getIden(identation) + modifiers + returnType + fnKeyword;\n if (this.includeFunctionNameInFunctionExpressionDeclaration || !ts.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 (ts.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.escapedText;\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 && (ts.isFunctionExpression(declaration.initializer) || ts.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?.getDeclarations()\n ?.some(s => s.getSourceFile().fileName.includes(\"/node_modules/typescript/lib/\"))\n ?? false;\n\n\n return isInLibFiles;\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 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 === ts.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?.escapedText;\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.escapedText === \"assert\") {\n return this.printAssertCall(node, identation, parsedArgs);\n }\n if (expression.escapedText === \"padEnd\") {\n // check this\n }\n }\n }\n\n // print super() call inside constructor\n if (expression.kind === ts.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 === ts.SyntaxKind.Identifier) {\n const idValue = expression.text ?? expression.escapedText;\n parsedExpression = this.transformCallExpressionName(this.unCamelCaseIfNeeded(idValue));\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 === ts.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.escapedText;\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.escapedText;\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 === ts.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 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 === ts.SyntaxKind.BinaryExpression &&\n (node.parent.operatorToken.kind === ts.SyntaxKind.EqualsToken || node.parent.operatorToken.kind === ts.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 === ts.TypeFlags.Union) {\n isUnionString = this.isStringType((type as any)?.types[0].flags);\n }\n\n if (isString || isUnionString || type.flags === ts.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 = ts.isStringLiteralLike(argumentExpression) ? \"\" : '(string)';\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 === ts.SyntaxKind.PrefixUnaryExpression && node.operator === ts.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 === ts.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 === ts.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 === ts.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 === ts.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 === ts.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 (ts.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?.escapedText;\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 || ts.isAwaitExpression(exp)\n || !this.isImplicitAsyncFunction(ts.findAncestor(node, ts.isFunctionLike))\n || !this.isPromiseType(this.getChecker().getTypeAtLocation(exp))) {\n return node;\n }\n if (ts.isConditionalExpression(exp) || ts.isBinaryExpression(exp)) {\n // an await-token prefix would change precedence (e.g. `await a ? b : c`)\n exp = this.wrapSyntheticNode(ts.factory.createParenthesizedExpression(exp), exp);\n }\n node.expression = this.wrapSyntheticNode(ts.factory.createAwaitExpression(exp), exp);\n return node;\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 === ts.SyntaxKind.FunctionDeclaration || parent.kind === ts.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 ts.SyntaxKind.ExpressionStatement:\n return this.printExpressionStatement(node, identation);\n case ts.SyntaxKind.Block:\n return this.printBlock(node, identation);\n case ts.SyntaxKind.FunctionDeclaration:\n case ts.SyntaxKind.FunctionExpression:\n case ts.SyntaxKind.ArrowFunction:\n return this.printFunctionDeclaration(node, identation);\n case ts.SyntaxKind.ClassDeclaration:\n return this.printClass(node, identation);\n case ts.SyntaxKind.VariableStatement:\n return this.printVariableStatement(node, identation);\n case ts.SyntaxKind.MethodDeclaration:\n return this.printMethodDeclaration(node, identation);\n case ts.SyntaxKind.StringLiteral:\n return this.printStringLiteral(node);\n case ts.SyntaxKind.NumericLiteral:\n return this.printNumericLiteral(node);\n case ts.SyntaxKind.PropertyAccessExpression:\n return this.printPropertyAccessExpression(node, identation);\n case ts.SyntaxKind.ArrayLiteralExpression:\n return this.printArrayLiteralExpression(node, identation);\n case ts.SyntaxKind.CallExpression:\n return this.printCallExpression(node, identation);\n case ts.SyntaxKind.WhileStatement:\n return this.printWhileStatement(node, identation);\n case ts.SyntaxKind.BinaryExpression:\n return this.printBinaryExpression(node, identation);\n case ts.SyntaxKind.BreakStatement:\n return this.printBreakStatement(node, identation);\n case ts.SyntaxKind.ForStatement:\n return this.printForStatement(node, identation);\n case ts.SyntaxKind.PostfixUnaryExpression:\n return this.printPostFixUnaryExpression(node, identation);\n case ts.SyntaxKind.VariableDeclarationList:\n return this.printVariableDeclarationList(node, identation); // statements are slightly different if inside a for\n case ts.SyntaxKind.ObjectLiteralExpression:\n return this.printObjectLiteralExpression(node, identation);\n case ts.SyntaxKind.PropertyAssignment:\n return this.printPropertyAssignment(node, identation);\n case ts.SyntaxKind.Identifier:\n return this.printIdentifier(node);\n case ts.SyntaxKind.ElementAccessExpression:\n return this.printElementAccessExpression(node, identation);\n case ts.SyntaxKind.IfStatement:\n return this.printIfStatement(node, identation);\n case ts.SyntaxKind.ParenthesizedExpression:\n return this.printParenthesizedExpression(node, identation);\n case ts.SyntaxKind.TrueKeyword:\n case ts.SyntaxKind.FalseKeyword:\n return this.printBooleanLiteral(node);\n case ts.SyntaxKind.ThisKeyword:\n return this.printThisKeyword(node, identation);\n case ts.SyntaxKind.SuperKeyword:\n return this.SUPER_TOKEN;\n case ts.SyntaxKind.TryStatement:\n return this.printTryStatement(node, identation);\n case ts.SyntaxKind.PrefixUnaryExpression:\n return this.printPrefixUnaryExpression(node, identation);\n case ts.SyntaxKind.ThrowStatement:\n return this.printThrowStatement(node, identation);\n case ts.SyntaxKind.NewExpression:\n return this.printNewExpression(node, identation);\n case ts.SyntaxKind.AwaitExpression:\n return this.printAwaitExpression(node, identation);\n case ts.SyntaxKind.ConditionalExpression:\n return this.printConditionalExpression(node, identation);\n case ts.SyntaxKind.AsExpression:\n return this.printAsExpression(node, identation);\n case ts.SyntaxKind.ReturnStatement:\n return this.printReturnStatement(this.wrapImplicitReturnAwait(node), identation);\n case ts.SyntaxKind.ArrayBindingPattern:\n return this.printArrayBindingPattern(node, identation);\n case ts.SyntaxKind.Parameter:\n return this.printParameter(node);\n case ts.SyntaxKind.Constructor:\n return this.printConstructorDeclaration(node, identation);\n case ts.SyntaxKind.PropertyDeclaration:\n return this.printPropertyDeclaration(node, identation);\n case ts.SyntaxKind.SpreadElement:\n return this.printSpreadElement(node, identation);\n case ts.SyntaxKind.NullKeyword:\n return this.printNullKeyword(node, identation);\n case ts.SyntaxKind.ContinueStatement:\n return this.printContinueStatement(node, identation);\n case ts.SyntaxKind.DeleteExpression:\n return this.printDeleteExpression(node, identation);\n }\n\n if (node.statements) {\n if (ts.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) => ts.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.escapedText;\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 && ts.isCallExpression(dec.initializer) && dec.initializer.expression.getText() === \"require\";\n }\n\n isCJSModuleExportsExpressionStatement(node): boolean {\n if (node.expression && node.expression.kind === ts.SyntaxKind.BinaryExpression ) {\n if (node.expression.left.kind === ts.SyntaxKind.PropertyAccessExpression) {\n const left = node.expression.left as ts.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 => ts.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 === ts.SyntaxKind.CallExpression) {\n const callExpression = decNode.initializer.expression.getText();\n if (callExpression === \"require\") {\n const isDefault = decNode.name.kind === ts.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) => ts.isExportDeclaration(s));\n const defaultExport = node.statements.filter((s) => ts.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 ts.BinaryExpression);\n\n moduleExports.forEach(node => {\n const right = node.right;\n if (right.kind === ts.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 === ts.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) => ts.isClassDeclaration(s));\n const functionDeclarations = node.statements.filter((s) => ts.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 === ts.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 func2Type = this.getChecker().getTypeOfSymbolAtLocation(bType.symbol, bType.symbol.valueDeclaration);\n const func2Signature = this.getChecker().getSignaturesOfType(func2Type, ts.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?.escapedText;\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 = ts.TypeFlags[type.flags];\n return result;\n }\n }\n\n const name = node.type?.typeName?.escapedText;\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) => ts.isClassDeclaration(s));\n classDeclarations.forEach((node) => {\n const methods = node.members.filter((m) => ts.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 ts from 'typescript';\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: ts.SourceFile;\n checker: ts.TypeChecker;\n program: ts.Program;\n}\n\n// Parsed SourceFiles (the es lib chain plus the import closure of everything\n// transpiled so far) and the last program built from them, so the next program\n// reuses that work instead of re-parsing it. Shareable between Transpiler\n// instances running on the same thread; these are plain V8 heap objects, so a\n// worker_threads isolate cannot receive one and needs a cache of its own.\ninterface ITranspileProgramCache {\n sourceFiles: Map;\n byPathHost?: ts.CompilerHost;\n byPathOldProgram?: ts.Program;\n memoryOldProgram?: ts.Program;\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}\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 ts, { TypeChecker } from 'typescript';\nimport { unCamelCase, regexAll } from \"./utils.js\";\nimport { Logger } from \"./logger.js\";\n\nconst SyntaxKind = ts.SyntaxKind;\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 if (symbol && symbol.valueDeclaration) {\n const valueDecl = symbol.valueDeclaration;\n\n // Check if it's a function (FunctionDeclaration, FunctionExpression, ArrowFunction)\n if (ts.isFunctionDeclaration(valueDecl) || ts.isFunctionExpression(valueDecl) || ts.isArrowFunction(valueDecl)) {\n // Check if the identifier is passed as an argument in a function call\n if (node.parent && ts.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 === ts.TypeFlags.String || rightType.flags === ts.TypeFlags.String) {\n return TOKEN;\n }\n if (leftType.flags === ts.TypeFlags.StringLiteral || rightType.flags === ts.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 TypeChecker).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.escapedText;\n const right = node.right.escapedText;\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?.escapedText;\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.escapedText ?? 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 === ts.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 ts, { TypeChecker } from 'typescript';\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\nexport class CSharpTranspiler 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.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 = {\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.binaryExpressionsWrappers = {\n [ts.SyntaxKind.EqualsEqualsToken]: [this.EQUALS_EQUALS_WRAPPER_OPEN, this.EQUALS_EQUALS_WRAPPER_CLOSE],\n [ts.SyntaxKind.EqualsEqualsEqualsToken]: [this.EQUALS_EQUALS_WRAPPER_OPEN, this.EQUALS_EQUALS_WRAPPER_CLOSE],\n [ts.SyntaxKind.ExclamationEqualsToken]: [this.DIFFERENT_WRAPPER_OPEN, this.DIFFERENT_WRAPPER_CLOSE],\n [ts.SyntaxKind.ExclamationEqualsEqualsToken]: [this.DIFFERENT_WRAPPER_OPEN, this.DIFFERENT_WRAPPER_CLOSE],\n [ts.SyntaxKind.GreaterThanToken]: [this.GREATER_THAN_WRAPPER_OPEN, this.GREATER_THAN_WRAPPER_CLOSE],\n [ts.SyntaxKind.GreaterThanEqualsToken]: [this.GREATER_THAN_EQUALS_WRAPPER_OPEN, this.GREATER_THAN_EQUALS_WRAPPER_CLOSE],\n [ts.SyntaxKind.LessThanToken]: [this.LESS_THAN_WRAPPER_OPEN, this.LESS_THAN_WRAPPER_CLOSE],\n [ts.SyntaxKind.LessThanEqualsToken]: [this.LESS_THAN_EQUALS_WRAPPER_OPEN, this.LESS_THAN_EQUALS_WRAPPER_CLOSE],\n [ts.SyntaxKind.PlusToken]: [this.PLUS_WRAPPER_OPEN, this.PLUS_WRAPPER_CLOSE],\n [ts.SyntaxKind.MinusToken]: [this.MINUS_WRAPPER_OPEN, this.MINUS_WRAPPER_CLOSE],\n [ts.SyntaxKind.AsteriskToken]: [this.MULTIPLY_WRAPPER_OPEN, this.MULTIPLY_WRAPPER_CLOSE],\n [ts.SyntaxKind.PercentToken]: [this.MOD_WRAPPER_OPEN, this.MOD_WRAPPER_CLOSE],\n [ts.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 printIdentifier(node) {\n let idValue = node.text ?? node.escapedText;\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?.symbol;\n if (symbol !== undefined) {\n // const declarations = this.getChecker().getDeclaredTypeOfSymbol(symbol).symbol?.declarations ?? [];\n const decl = symbol?.declarations ?? [];\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 === ts.SyntaxKind.ClassDeclaration);\n const isInsideNewExpression = node?.parent?.kind === ts.SyntaxKind.NewExpression;\n const isInsideCatch = node?.parent?.kind === ts.SyntaxKind.ThrowStatement;\n const isLeftSide = node?.parent?.name === node || (node?.parent?.left === node);\n const isCallOrPropertyAccess = node?.parent?.kind === ts.SyntaxKind.PropertyAccessExpression || node?.parent?.kind === ts.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];\n if (first.kind === ts.SyntaxKind.ClassDeclaration) {\n isClassDeclaration = true;\n }\n if (first.kind === ts.SyntaxKind.ImportSpecifier) {\n const importedSymbol = this.getChecker().getAliasedSymbol(symbol);\n if (importedSymbol?.declarations[0]?.kind === ts.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 superCallParams = '';\n let hasSuperCall = false;\n node.body?.statements.forEach(statement => {\n if (ts.isExpressionStatement(statement)) {\n const expression = statement.expression;\n if (ts.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 printThisElementAccesssIfNeeded(node, identation) {\n // convert this[method] into this.call(method) or this.callAsync(method)\n // const isAsync = node?.parent?.kind === ts.SyntaxKind.AwaitExpression;\n const isAsync = true; // setting to true for now, because there are some scenarios where we don't know\n // if the call is async or not, so we need to assume it is async\n // example Promise.all([this.unknownPropAsync()])\n const elementAccess = node.expression;\n if (elementAccess?.kind === ts.SyntaxKind.ElementAccessExpression) {\n if (elementAccess?.expression?.kind === ts.SyntaxKind.ThisKeyword) {\n let parsedArg = node.arguments?.length > 0 ? this.printNode(node.arguments[0], identation).trimStart() : \"\";\n const propName = this.printNode(elementAccess.argumentExpression, 0);\n const wrapperOpen = isAsync ? this.UKNOWN_PROP_ASYNC_WRAPPER_OPEN : this.UKNOWN_PROP_WRAPPER_OPEN;\n const wrapperClose = isAsync ? this.UNKOWN_PROP_ASYNC_WRAPPER_CLOSE : this.UNKOWN_PROP_WRAPPER_CLOSE;\n parsedArg = parsedArg ? \", \" + parsedArg : \"\";\n return wrapperOpen + propName + parsedArg + wrapperClose;\n }\n }\n return;\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 === ts.SyntaxKind.ElementAccessExpression) {\n const parsedArg = node.arguments?.length > 0 ? 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 const argsArray = `new object[] { ${parsedArg} }`;\n const open = this.DYNAMIC_CALL_OPEN;\n let statement = `${open}${target}, ${propName}, ${argsArray})`;\n statement = isAsync ? `((Task)${statement})` : statement;\n return statement;\n }\n return undefined;\n }\n\n\n printElementAccessExpressionExceptionIfAny(node) {\n // convert this[method] into this.call(method) or this.callAsync(method)\n // if (node?.expression?.kind === ts.SyntaxKind.ThisKeyword) {\n // const isAsyncDecl = node?.parent?.kind === ts.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 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.escapedText;\n // const isAsyncDecl = true;\n const isAsyncDecl = node?.parent?.kind === ts.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 printOutOfOrderCallExpressionIfAny(node, identation) {\n if (node.expression.kind === ts.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 `mathMin(${parsedArg1}, ${parsedArg2})`;\n case \"Math.max\":\n return `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 === ts.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 === ts.SyntaxKind.ExclamationEqualsEqualsToken || op === ts.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 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 === ts.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 === ts.SyntaxKind.EqualsToken && left.kind === ts.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 = `var ${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) + `${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 === ts.SyntaxKind.InKeyword) {\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 === ts.SyntaxKind.PlusEqualsToken || op === ts.SyntaxKind.MinusEqualsToken || op in this.binaryExpressionsWrappers) {\n const leftText = this.printNode(left, 0);\n const rightText = this.printNode(right, 0);\n\n if (op === ts.SyntaxKind.PlusEqualsToken) {\n return `${leftText} = add(${leftText}, ${rightText})`;\n }\n\n if (op === ts.SyntaxKind.MinusEqualsToken) {\n return `${leftText} = subtract(${leftText}, ${rightText})`;\n }\n\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 // x = y\n // cast y to x type when y is unknown\n // if (op === ts.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 printVariableDeclarationList(node,identation) {\n const declaration = node.declarations[0];\n // const name = declaration.name.escapedText;\n\n if (this.removeVariableDeclarationForFunctionExpression && declaration?.initializer && ts.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 === ts.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)}var ${syntheticName} = ${this.printNode(declaration.initializer, 0)};\\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} = ((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 === ts.SyntaxKind.NewExpression);\n const varToken = isNew ? 'var ' : this.VAR_TOKEN + ' ' ;\n\n // handle default undefined initialization\n if (declaration?.initializer && declaration.initializer === undefined) {\n // handle the let id: Str; case\n return this.getIden(identation) + varToken + this.printNode(declaration.name) + \" = \" + this.UNDEFINED_TOKEN;\n } else 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 return this.getIden(identation) + varToken + 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.escapedText;\n\n let rawExpression = undefined;\n\n switch(rightSide) {\n case 'length':\n const type = (this.getChecker() as TypeChecker).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) ? `((string)${leftSide}).Length` : `${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 (ts.isArrayLiteralExpression(node) || ts.isObjectLiteralExpression(node) || ts.isStringLiteral(node) || (ts as any).isBooleanLiteral(node)) {\n return this.UNDEFINED_TOKEN;\n }\n\n if (ts.isNumericLiteral(node)) {\n return this.UNDEFINED_TOKEN;\n }\n\n // convert x: number = undefined (invalid) into x = -1 (valid)\n if (node?.escapedText === \"undefined\" && this.getChecker().getTypeAtLocation(node?.parent)?.flags === ts.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 (ts.isArrayLiteralExpression(initializer)) {\n initParams.push(`${this.printNode(param.name, 0)} ??= new List();`);\n }\n if (ts.isObjectLiteralExpression(initializer)) {\n initParams.push(`${this.printNode(param.name, 0)} ??= new Dictionary();`);\n }\n if (ts.isNumericLiteral(initializer)) {\n initParams.push(`${this.printNode(param.name, 0)} ??= ${this.printNode(initializer, 0)};`);\n }\n if (ts.isStringLiteral(initializer)) {\n initParams.push(`${this.printNode(param.name, 0)} ??= ${this.printNode(initializer, 0)};`);\n }\n if ((ts as any).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.escapedText;\n const right = node.right.escapedText;\n return this.getIden(identation) + `${left} is ${right}`;\n }\n\n printAsExpression(node, identation) {\n const type = node.type;\n\n if (type.kind === ts.SyntaxKind.AnyKeyword) {\n return `((object)${this.printNode(node.expression, identation)})`;\n }\n\n if (type.kind === ts.SyntaxKind.StringKeyword) {\n return `((string)${this.printNode(node.expression, identation)})`;\n }\n\n if (type.kind === ts.SyntaxKind.ArrayType) {\n if (type.elementType.kind === ts.SyntaxKind.AnyKeyword) {\n return `(IList)(${this.printNode(node.expression, identation)})`;\n }\n if (type.elementType.kind === ts.SyntaxKind.StringKeyword) {\n return `(IList)(${this.printNode(node.expression, identation)})`;\n }\n }\n\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 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 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 printArrayLiteralExpression(node) {\n\n let arrayOpen = this.ARRAY_OPENING_TOKEN;\n const elems = node.elements;\n\n const elements = node.elements.map((e) => {\n return this.printNode(e);\n }).join(\", \");\n\n // take into consideration list of promises\n if (elems.length > 0) {\n const first = elems[0];\n if (first.kind === ts.SyntaxKind.CallExpression) {\n // const type = this.getChecker().getTypeAtLocation(first);\n let type = this.getFunctionType(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 printMethodDefinition(node, identation) {\n let name = node.name.escapedText;\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 = \"\";\n parentArgs.forEach((param, index) => {\n const originalName = this.printNode(currentArgs[index].name, 0);\n const parsedArg = this.printParameteCustomName(param, originalName);\n parsedArgs+= parsedArg;\n if (index < parentArgs.length - 1) {\n parsedArgs+= \", \";\n }\n });\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 printArgsForCallExpression(node, identation) {\n const args = node.arguments;\n let parsedArgs = \"\";\n if (false && this.requiresCallExpressionCast && !this.isBuiltInFunctionCall(node?.expression)) { //eslint-disable-line\n const parsedTypes = this.getTypesFromCallExpressionParameters(node);\n const tmpArgs = [];\n args.forEach((arg, index) => {\n const parsedType = parsedTypes[index];\n let cast = \"\";\n if (parsedType !== \"object\" && parsedType !== \"float\" && parsedType !== \"int\") {\n cast = parsedType ? `(${parsedType})` : '';\n }\n tmpArgs.push(cast + this.printNode(arg, identation).trim());\n });\n parsedArgs = tmpArgs.join(\",\");\n return parsedArgs;\n }\n return super.printArgsForCallExpression(node, identation);\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 return `new List(((IDictionary)${parsedArg}).Keys)`;\n }\n\n printObjectValuesCall(node, identation, parsedArg = undefined) {\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 return `((IList)${name}).Add(${parsedArg})`;\n }\n\n printIncludesCall(node, identation, name = undefined, parsedArg = undefined) {\n return `${name}.Contains(${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 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 return `String.Join(${parsedArg}, ((IList)${name}).ToArray())`;\n }\n\n printSplitCall(node, identation, name = undefined, parsedArg = undefined) {\n return `((string)${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 `((string)${name}).ToUpper()`;\n }\n\n printToLowerCaseCall(node, identation, name = undefined) {\n return `((string)${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 printAssertCall(node, identation, parsedArgs) {\n return `assert(${parsedArgs})`;\n }\n\n printSliceCall(node, identation, name = undefined, parsedArg = undefined, parsedArg2 = undefined) {\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 printReplaceCall(node, identation, name = undefined, parsedArg = undefined, parsedArg2 = undefined) {\n return `((string)${name}).Replace((string)${parsedArg}, (string)${parsedArg2})`;\n }\n\n printReplaceAllCall(node, identation, name = undefined, parsedArg = undefined, parsedArg2 = undefined) {\n return `((string)${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 TypeChecker).getTypeAtLocation(node.expression); // eslint-disable-line\n this.warnIfAnyType(node, type.flags, leftSide, \"length\");\n return this.isStringType(type.flags) ? `((string)${leftSide}).Length` : `${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 === ts.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 === ts.SyntaxKind.NumericLiteral) {\n return super.printPrefixUnaryExpression(node, identation);\n }\n if (operator === ts.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 === ts.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.printCondition(node.condition, 0);\n const whenTrue = this.printNode(node.whenTrue, 0);\n const whenFalse = this.printNode(node.whenFalse, 0);\n\n return `((bool) ${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 `((IDictionary)${object}).Remove((string)${key})`;\n }\n\n printNewExpression(node, identation) {\n let expression = node.expression?.escapedText;\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 === ts.SyntaxKind.Identifier) {\n return this.getIden(identation) + this.THROW_TOKEN + ' ' + this.printNode(node.expression, 0) + this.LINE_TERMINATOR;\n }\n if (node.expression.kind === ts.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 === ts.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.escapedText === 'Error' ? 'Exception' : id.escapedText;\n const symbol = this.getChecker().getSymbolAtLocation(expression.expression);\n if (symbol) {\n const declarations = this.getChecker().getDeclaredTypeOfSymbol(symbol).symbol?.declarations ?? [];\n const isClassDeclaration = declarations.find(l => l.kind === ts.SyntaxKind.InterfaceDeclaration || l.kind === ts.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.escapedText ? newExpression : idName} (${parsedArg}) ${this.LINE_TERMINATOR}`;\n } else if (expression.expression.kind === ts.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?.escapedText;\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 csModifiers = {\n\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) {\n if (node.type.kind === ts.SyntaxKind.AnyKeyword) {\n typeText = this.OBJECT_KEYWORD + ' ';\n }\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 ts, { BinaryExpression, CallExpression, TypeChecker } from 'typescript';\n\nconst SyntaxKind = ts.SyntaxKind;\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': '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': '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\nexport class GoTranspiler extends BaseTranspiler {\n\n binaryExpressionsWrappers;\n wrapThisCalls: boolean;\n wrapCallMethods: string[] = [];\n classNameMap: { [key: string]: string };\n DEFAULT_RETURN_TYPE = 'any';\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 }\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 [ts.SyntaxKind.EqualsEqualsToken]: [this.EQUALS_EQUALS_WRAPPER_OPEN, this.EQUALS_EQUALS_WRAPPER_CLOSE],\n [ts.SyntaxKind.EqualsEqualsEqualsToken]: [this.EQUALS_EQUALS_WRAPPER_OPEN, this.EQUALS_EQUALS_WRAPPER_CLOSE],\n [ts.SyntaxKind.ExclamationEqualsToken]: [this.DIFFERENT_WRAPPER_OPEN, this.DIFFERENT_WRAPPER_CLOSE],\n [ts.SyntaxKind.ExclamationEqualsEqualsToken]: [this.DIFFERENT_WRAPPER_OPEN, this.DIFFERENT_WRAPPER_CLOSE],\n [ts.SyntaxKind.GreaterThanToken]: [this.GREATER_THAN_WRAPPER_OPEN, this.GREATER_THAN_WRAPPER_CLOSE],\n [ts.SyntaxKind.GreaterThanEqualsToken]: [this.GREATER_THAN_EQUALS_WRAPPER_OPEN, this.GREATER_THAN_EQUALS_WRAPPER_CLOSE],\n [ts.SyntaxKind.LessThanToken]: [this.LESS_THAN_WRAPPER_OPEN, this.LESS_THAN_WRAPPER_CLOSE],\n [ts.SyntaxKind.LessThanEqualsToken]: [this.LESS_THAN_EQUALS_WRAPPER_OPEN, this.LESS_THAN_EQUALS_WRAPPER_CLOSE],\n [ts.SyntaxKind.PlusToken]: [this.PLUS_WRAPPER_OPEN, this.PLUS_WRAPPER_CLOSE],\n [ts.SyntaxKind.MinusToken]: [this.MINUS_WRAPPER_OPEN, this.MINUS_WRAPPER_CLOSE],\n [ts.SyntaxKind.AsteriskToken]: [this.MULTIPLY_WRAPPER_OPEN, this.MULTIPLY_WRAPPER_CLOSE],\n [ts.SyntaxKind.PercentToken]: [this.MOD_WRAPPER_OPEN, this.MOD_WRAPPER_CLOSE],\n [ts.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\n printPropertyDeclaration(node, identation) {\n // let modifiers = this.printModifiers(node);\n // modifiers = modifiers ? modifiers + \" \" : modifiers;\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 || (ts as any).isBooleanLiteral(node)) {\n type = 'bool';\n } else if (node.type.kind === SyntaxKind.ArrayType) {\n type = '[]any';\n }\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 return this.getIden(identation) + name + ' ' + type + ' ' + `\\`default:\"${initializer}\"\\`` + this.LINE_TERMINATOR;\n }\n return this.getIden(identation) + name + ' ' + type + this.LINE_TERMINATOR;\n }\n\n printStruct(node, indentation) {\n\n // check if we have heritage\n let heritageName = '';\n if (node?.heritageClauses?.length > 0) {\n const heritage = node.heritageClauses[0];\n const heritageType = heritage.types[0];\n let heritageEscapedText = heritageType.expression.escapedText;\n if (this.classNameMap[heritageEscapedText]) {\n heritageEscapedText = this.classNameMap[heritageEscapedText];\n }\n heritageName = this.getIden(indentation+1) + heritageEscapedText + '\\n';\n }\n\n const propDeclarations = node.members.filter(member => member.kind === SyntaxKind.PropertyDeclaration);\n return `type ${this.className} struct {\\n${heritageName}${propDeclarations.map(member => this.printNode(member, indentation+1)).join(\"\\n\")}\\n}`;\n }\n\n printNewStructMethod(node){\n return `\nfunc New${this.capitalize(this.className)}() *${(this.className)} {\n p := &${this.className}{}\n setDefaults(p)\n return 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.escapedText;\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 = methods.map(method => this.printMethodDeclaration(method, identation)).join(\"\\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 return struct + \"\\n\" + newMethod + \"\\n\" + classMethods;\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\n let methodDef = this.printMethodDefinition(node, identation);\n\n const isAsync = this.isAsyncFunction(node);\n\n const funcBody = this.printFunctionBody(node, identation, isAsync);\n\n methodDef += funcBody;\n\n return methodDef;\n }\n\n printFunctionDeclaration(node, identation) {\n if (ts.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 let functionDef = this.printFunctionDefinition(node, identation);\n const funcBody = this.printFunctionBody(node, identation, isAsync);\n functionDef += funcBody;\n\n return this.printNodeCommentsIfAny(node, identation, functionDef);\n }\n\n printMethodDefinition(node, identation) {\n let name = node.name.escapedText;\n name = this.transformMethodNameIfNeeded(name);\n\n let returnType = this.printFunctionType(node);\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) + returnType + methodToken + name\n // + \"(\" + parsedArgs + \")\";\n const structReceiver = `(${this.THIS_TOKEN} *${this.className})`;\n const methodDef = this.getIden(identation) + methodToken + \" \" + structReceiver + \" \" + name + \"(\" + parsedArgs + \") \" + returnType;\n\n return this.printNodeCommentsIfAny(node, identation, methodDef);\n }\n\n\n printFunctionDefinition(node, identation) {\n let name = node.name.escapedText;\n name = this.transformMethodNameIfNeeded(name);\n\n let returnType = this.printFunctionType(node);\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) + returnType + methodToken + name\n // + \"(\" + parsedArgs + \")\";\n const methodDef = this.getIden(identation) + methodToken + name + \"(\" + parsedArgs + \") \" + returnType;\n\n return this.printNodeCommentsIfAny(node, identation, methodDef);\n }\n\n printMethodParameters(node) {\n const params = node.parameters.map(param => this.printParameter(param));\n const hasOptionalParameter = params.some(p => p === 'optional');\n if (!hasOptionalParameter) {\n return params.join(\", \");\n }\n const paramsWithOptional = params.filter(param => param !== 'optional');\n paramsWithOptional.push('optionalArgs ...any');\n return paramsWithOptional.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) {\n if (initializer) {\n return 'optional'; // will be handled later\n }\n // not supported we have to find an alternative for go like defining multiple methods with different parameters\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 name + ' ' + type;\n }\n return name + ' ' + type;\n }\n\n printParameterType(node) {\n const typeText = this.getType(node);\n // // if (typeText === this.BOOLEAN_KEYWORD) {\n // // return typeText;\n // // }\n\n //tmp default to interface\n return 'any';\n\n if (typeText === this.STRING_KEYWORD) {\n return 'string';\n }\n if (typeText === this.NUMBER_KEYWORD) {\n return 'float64';\n }\n\n if (typeText === this.BOOLEAN_KEYWORD) {\n return 'bool';\n }\n\n return this.DEFAULT_PARAMETER_TYPE;\n\n if (typeText === undefined || typeText === this.STRING_KEYWORD) {\n // throw new FunctionReturnTypeError(\"Parameter type is not supported or undefined\");\n this.warn(node, node.getText(), \"Parameter type not found, will default to: \" + this.DEFAULT_PARAMETER_TYPE);\n return this.DEFAULT_PARAMETER_TYPE;\n }\n return typeText;\n\n }\n\n printFunctionType(node){\n const typeText = this.getFunctionType(node);\n if (typeText === 'void') {\n // // If the function is async (returns a Promise in TS) but declared void, emit a typed channel\n // if (this.isAsyncFunction(node)) {\n // // Ensure element type is present; some edge cases yield '<- chan' only\n // const elementType = this.DEFAULT_RETURN_TYPE || 'any';\n // return `<- chan ${elementType}`;\n // }\n return \"\";\n }\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 = `<- chan ${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 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 printVariableDeclarationList(node,identation) {\n const declaration = node.declarations[0];\n // const varToken = this.VAR_TOKEN ? this.VAR_TOKEN + \" \": \"\";\n // const name = declaration.name.escapedText;\n\n if (declaration?.name.kind === ts.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)}${syntheticName} := ${this.printNode(declaration.initializer, 0)};\\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) + `${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 (declaration?.initializer?.kind=== ts.SyntaxKind.AwaitExpression) {\n const parsedName = this.printNode(declaration.name, 0);\n const parsedInitializer = this.printNode(declaration.initializer, 0);\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 === ts.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 === ts.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 stm = this.getIden(identation) + \"var \" + varName + \" any = \" + parsedValue;\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?.escapedText;\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 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 (ts.isExpressionStatement(statement)) {\n const expression = statement.expression;\n if (ts.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 printThisElementAccesssIfNeeded(node, identation) {\n // convert this[method] into this.call(method) or this.callAsync(method)\n // const isAsync = node?.parent?.kind === ts.SyntaxKind.AwaitExpression;\n const isAsync = true; // setting to true for now, because there are some scenarios where we don't know\n // if the call is async or not, so we need to assume it is async\n // example Promise.all([this.unknownPropAsync()])\n const elementAccess = node.expression;\n if (elementAccess?.kind === ts.SyntaxKind.ElementAccessExpression) {\n if (elementAccess?.expression?.kind === ts.SyntaxKind.ThisKeyword) {\n let parsedArg = node.arguments?.length > 0 ? this.printNode(node.arguments[0], identation).trimStart() : \"\";\n const propName = this.printNode(elementAccess.argumentExpression, 0);\n const wrapperOpen = isAsync ? this.UKNOWN_PROP_ASYNC_WRAPPER_OPEN : this.UKNOWN_PROP_WRAPPER_OPEN;\n const wrapperClose = isAsync ? this.UNKOWN_PROP_ASYNC_WRAPPER_CLOSE : this.UNKOWN_PROP_WRAPPER_CLOSE;\n parsedArg = parsedArg ? \", \" + parsedArg : \"\";\n return wrapperOpen + propName + parsedArg + wrapperClose;\n }\n }\n return;\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 === ts.SyntaxKind.ElementAccessExpression) {\n const parsedArg = node.arguments?.length > 0 ? 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 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 = 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 let parsedArguments = node.arguments?.map((a) => this.printNode(a, 0)).join(\", \");\n parsedArguments = parsedArguments ? parsedArguments : \"\";\n const propName = node.expression?.name.escapedText;\n // const isAsyncDecl = true;\n // const isAsyncDecl = node?.parent?.kind === ts.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) {\n return this.capitalize(name);\n }\n\n transformPropertyAccessExpressionName(name: string) {\n return this.capitalize(name);\n }\n\n printOutOfOrderCallExpressionIfAny(node, identation) {\n if (node.expression.kind === ts.SyntaxKind.PropertyAccessExpression) {\n const args = node.arguments;\n\n if (node.expression.expression.kind === ts.SyntaxKind.ThisKeyword) {\n const methodName = this.printNode(node.expression.name, 0);\n if (this.wrapThisCalls || (this.wrapCallMethods.includes(methodName))) {\n let argsParsed = \"\";\n if (args.length > 0) {\n argsParsed = args.map((a) => this.printNode(a, 0)).join(\", \");\n return `<-this.callInternal(\"${methodName}\", ${argsParsed})`;\n }\n return `<-this.callInternal(\"${methodName}\")`;\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);\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 === ts.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 === ts.SyntaxKind.ExclamationEqualsEqualsToken || op === ts.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 + `IsObject(${target})`;\n case \"function\":\n return notOperator + `IsFunction(${target})`;\n }\n\n return undefined;\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 === ts.SyntaxKind.EqualsToken &&\n left.kind === ts.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) + `${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 // ---------------------------------------------------------------\n // Go-style setter for element-access assignments: a[b] = v\n // ---------------------------------------------------------------\n if (op === ts.SyntaxKind.EqualsToken &&\n left.kind === ts.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 (ts.isElementAccessExpression(cur)) {\n keys.unshift(cur.argumentExpression); // prepend\n const expr = cur.expression;\n if (!ts.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.\n let acc = containerStr;\n for (let i = 0; i < keyStrs.length - 1; i++) {\n acc = `${this.ELEMENT_ACCESS_WRAPPER_OPEN}${acc}, ${keyStrs[i]}${this.ELEMENT_ACCESS_WRAPPER_CLOSE}`;\n }\n\n const lastKey = keyStrs[keyStrs.length - 1];\n const rhs = this.printNode(right, 0);\n\n return `AddElementToObject(${acc}, ${lastKey}, ${rhs})`;\n }\n\n // ---------------------------------------------------------------\n // Go-style setter for element-access compound assignments: a[b] += v\n // ---------------------------------------------------------------\n if (op === ts.SyntaxKind.PlusEqualsToken &&\n left.kind === ts.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 (ts.isElementAccessExpression(cur)) {\n keys.unshift(cur.argumentExpression); // prepend\n const expr = cur.expression;\n if (!ts.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.\n let acc = containerStr;\n for (let i = 0; i < keyStrs.length - 1; i++) {\n acc = `${this.ELEMENT_ACCESS_WRAPPER_OPEN}${acc}, ${keyStrs[i]}${this.ELEMENT_ACCESS_WRAPPER_CLOSE}`;\n }\n\n const lastKey = keyStrs[keyStrs.length - 1];\n const rhs = this.printNode(right, 0);\n\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 result = `AddElementToObject(${acc}, ${lastKey}, Add(${currentValue}, ${rhs}))`;\n return result;\n }\n\n if (left.kind === ts.SyntaxKind.TypeOfExpression) {\n const typeOfExpression = this.handleTypeOfInsideBinaryExpression(node, identation);\n if (typeOfExpression) {\n return typeOfExpression;\n }\n }\n\n if (op === ts.SyntaxKind.InKeyword) {\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 === ts.SyntaxKind.PlusEqualsToken || op === ts.SyntaxKind.MinusEqualsToken || op in this.binaryExpressionsWrappers) {\n const leftText = this.printNode(left, 0);\n const rightText = this.printNode(right, 0);\n\n if (op === ts.SyntaxKind.PlusEqualsToken) {\n return `${leftText} = Add(${leftText}, ${rightText})`;\n }\n\n if (op === ts.SyntaxKind.MinusEqualsToken) {\n return `${leftText} = Subtract(${leftText}, ${rightText})`;\n }\n\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 // x = y\n // cast y to x type when y is unknown\n // if (op === ts.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 transformPropertyAcessExpressionIfNeeded(node) {\n const expression = node.expression;\n const leftSide = this.printNode(expression, 0);\n const rightSide = node.name.escapedText;\n\n let rawExpression = undefined;\n\n switch(rightSide) {\n case 'length':\n const type = (this.getChecker() as TypeChecker).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) ? `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 printCustomDefaultValueIfNeeded(node) {\n return undefined;\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 initParams.push(`${paramName} := GetArg(optionalArgs, ${index}, ${this.printNode(initializer, 0)})`);\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 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 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 => {\n // if (statement.kind === ts.SyntaxKind.ReturnStatement) {\n // if (statement?.expression) {\n // return this.getIden(identation) + \"ch <-\" + this.printNode(statement.expression) + '\\n' + this.getIden(identation) + \"return \" + this.printNode(statement.expression);\n // }\n // }\n return this.printNode(statement, identation);\n }).join(\"\\n\");\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 const functionBodySplit = functionBody.split(\"\\n\");\n const bodyWithIndentationExtraAndNoReturn = functionBodySplit.map((line) => {\n\n const trimmedLine = line.trim();\n\n // should we do this inside printReturn statement?\n // if(trimmedLine.startsWith(\"return\") && trimmedLine !== \"return\") {\n // const returnIndentation = line.indexOf(\"return\")/4 + this.getIden(1);\n // let channelReturn = this.getIden(returnIndentation) + \"ch <-\" + line.replace(\"return\", \"\").trimStart();\n // if (trimmedLine === \"return nil\") {\n // channelReturn = this.getIden(returnIndentation) + \"ch <- nil\\n\" + this.getIden(returnIndentation) + \"return nil\";\n // // it's hard because we don't want to remove the treturns from the emulated try-catches we have that are also functions\n // // with return statements\n // }\n // return channelReturn;\n // }\n return this.getIden(identation+2) + line;\n }).join(\"\\n\");\n let shouldAddLastReturn = true;\n\n // const bodySplit = bodyWithIndentationExtraAndNoReturn.split(\"\\n\");\n const bodySplit = functionBodySplit;\n const lastLine = bodySplit[bodySplit.length - 1];\n if (lastLine.trim().startsWith(\"return\") || lastLine.trim().startsWith(\"panic\")) {\n shouldAddLastReturn = false;\n }\n\n // Check if the function body ends with a conditional that has returns in all branches\n if (node.body && this.blockEndsWithConditionalReturn(node.body.statements)) {\n shouldAddLastReturn = false;\n }\n\n const lastReturn = shouldAddLastReturn ? this.getIden(identation+2) + \"return nil\" : \"\";\n // const hasCatchInside = bodySplit.indexOf(\"recover()\") > -1;\n // if ((1+1 == 2) || hasCatchInside) {\n functionBody = `{\n ${this.getIden(identation + 1)}ch := make(chan ${this.DEFAULT_RETURN_TYPE})\n ${this.getIden(identation + 1)}go func() any {\n ${this.getIden(identation + 2)}defer close(ch)\n ${this.getIden(identation + 2)}defer ReturnPanicError(ch)\n ${bodyWithIndentationExtraAndNoReturn}\n ${lastReturn}\n ${this.getIden(identation + 1)}}()\n ${this.getIden(identation + 1)}return ch\n ${this.getIden(identation)}}`;\n // } else {\n // functionBody = `{\n // ${id1}ch := make(chan ${this.DEFAULT_RETURN_TYPE})\n // ${id1}var panicError any = nil\n // ${id1}var wg sync.WaitGroup\n // ${id1}wg.Add(1)\n // ${id1}go func() any {\n // ${id2}defer wg.Done()\n // ${id2}defer close(ch)\n // ${id2}defer func() {\n // ${id3}if r := recover(); r != nil {\n // ${id4}panicError = r\n // ${id4}return\n // ${id3}}\n // ${id2}}()\n // ${bodySplit}\n // ${lastReturn}\n // ${id1}}()\n // ${id1}wg.Wait()\n // ${id1}if panicError != nil {\n // ${id2}panic(panicError)\n // ${id1}}\n // ${id1}return ch\n // ${id}}`;\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 getRandomNameSuffix() {\n return Math.floor(Math.random() * 1000000).toString();\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 === ts.SyntaxKind.AsExpression) {\n node = node.expression;\n }\n if (node.expression.kind !== ts.SyntaxKind.AwaitExpression) {\n return 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 const expStatement = `\n${this.getIden(identation)}${returnRandName} := ${exprStm}\n${this.getIden(identation)}PanicOnError(${returnRandName})`;\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 (ts.isFunctionDeclaration(currentNode) ||\n ts.isFunctionExpression(currentNode) ||\n ts.isArrowFunction(currentNode) ||\n ts.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 printReturnStatement(node, identation) {\n\n const isAsyncFunction = this.isInsideAsyncFunction(node);\n // if (node?.expression?.kind !== ts.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 if (node?.expression?.kind === ts.SyntaxKind.AsExpression) {\n node = node.expression;\n }\n\n if (node?.expression?.kind === ts.SyntaxKind.AwaitExpression) {\n // const returnRandName = \"retRes\" + this.getRandomNameSuffix();\n const returnRandName = \"retRes\" + this.getLineBasedSuffix(node.expression);\n rightPart = rightPart ? ' ' + rightPart + this.LINE_TERMINATOR : this.LINE_TERMINATOR;\n // return leadingComment + this.getIden(identation) + this.RETURN_TOKEN + rightPart + trailingComment;\n return `\n ${this.getIden(identation)}${returnRandName} := ${rightPart}\n ${this.getIden(identation)}PanicOnError(${returnRandName})\n ${this.getIden(identation)}${leadingComment}ch <- ${returnRandName}${trailingComment}\n ${this.getIden(identation)}return nil`;\n // ${this.getIden(identation)}return ${returnRandName}`;\n }\n\n if (rightPart.length === 0) {\n return `\\n${this.getIden(identation)}return nil`;\n }\n\n return `\n${this.getIden(identation)}${leadingComment}ch <- ${rightPart}${trailingComment}\n${this.getIden(identation)}return nil`;\n // ${this.getIden(identation)}return ${rightPart}`;\n // ${this.getIden(identation)}return ${rightPart}`;\n }\n\n\n printAsExpression(node, identation) {\n const type = node.type;\n\n if (type.kind === ts.SyntaxKind.AnyKeyword) {\n // return `(()${this.printNode(node.expression, identation)})`;\n }\n\n if (type.kind === ts.SyntaxKind.StringKeyword) {\n // return `((string)${this.printNode(node.expression, identation)})`;\n }\n\n if (type.kind === ts.SyntaxKind.ArrayType) {\n // if (type.elementType.kind === ts.SyntaxKind.AnyKeyword) {\n // return `(IList)(${this.printNode(node.expression, identation)})`;\n // }\n // if (type.elementType.kind === ts.SyntaxKind.StringKeyword) {\n // return `(IList)(${this.printNode(node.expression, identation)})`;\n // }\n }\n\n return this.printNode(node.expression, identation);\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) => {\n return this.printNode(e);\n }).join(\", \");\n\n // take into consideration list of promises\n if (elems.length > 0) {\n const first = elems[0];\n if (first.kind === ts.SyntaxKind.CallExpression) {\n // const type = this.getChecker().getTypeAtLocation(first);\n const type = this.getFunctionType(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 = \"[]any{\";\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 = `[]any{`;\n }\n }\n }\n\n return arrayOpen + elements + this.ARRAY_CLOSING_TOKEN;\n }\n\n printArgsForCallExpression(node, identation) {\n const args = node.arguments;\n let parsedArgs = \"\";\n if (false && this.requiresCallExpressionCast && !this.isBuiltInFunctionCall(node?.expression)) { //eslint-disable-line\n const parsedTypes = this.getTypesFromCallExpressionParameters(node);\n const tmpArgs = [];\n args.forEach((arg, index) => {\n const parsedType = parsedTypes[index];\n let cast = \"\";\n if (parsedType !== \"object\" && parsedType !== \"float\" && parsedType !== \"int\") {\n cast = parsedType ? `(${parsedType})` : '';\n }\n tmpArgs.push(cast + this.printNode(arg, identation).trim());\n });\n parsedArgs = tmpArgs.join(\",\");\n return parsedArgs;\n }\n return super.printArgsForCallExpression(node, identation);\n }\n\n // check this out later\n\n printArrayIsArrayCall(node, identation, parsedArg = undefined) {\n return `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 printArrayPushCall(node: CallExpression, identation: number, name: string | undefined = undefined, parsedArg: string | undefined = undefined) {\n let returnValue = '';\n let returnRandName = name;\n if (name?.startsWith('GetValue')) {\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 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 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 printConcatCall(node, identation, name = undefined, parsedArg = undefined) {\n return `Concat(${name}, ${parsedArg})`;\n }\n\n printToUpperCaseCall(node, identation, name = undefined) {\n return `ToUpper(${name})`;\n }\n\n printToLowerCaseCall(node, identation, name = undefined) {\n return `ToLower(${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 `assert(${parsedArgs})`;\n }\n\n printSliceCall(node, identation, name = undefined, parsedArg = undefined, parsedArg2 = undefined) {\n if (parsedArg2 === undefined){\n // return `((string)${name}).Substring((int)${parsedArg})`;\n parsedArg2 = 'nil';\n }\n // return `((string)${name})[((int)${parsedArg})..((int)${parsedArg2})]`;\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 `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 TypeChecker).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 === ts.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 === ts.SyntaxKind.NumericLiteral) {\n // return super.printPrefixUnaryExpression(node, identation);\n // }\n // if (operator === ts.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 === ts.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.printCondition(node.condition, 0);\n const whenTrue = this.printNode(node.whenTrue, 0);\n const whenFalse = this.printNode(node.whenFalse, 0);\n\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 === ts.SyntaxKind.Identifier) {\n return this.getIden(identation) + 'panic(' + this.printNode(node.expression, 0) + ')' + this.LINE_TERMINATOR;\n }\n if (node.expression.kind === ts.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 === ts.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).symbol?.declarations ?? [];\n const isClassDeclaration = declarations.find(l => l.kind === ts.SyntaxKind.InterfaceDeclaration || l.kind === ts.SyntaxKind.ClassDeclaration);\n if (isClassDeclaration){\n // return this.getIden(identation) + `${this.THROW_TOKEN} ${this.NEW_TOKEN} ${id.escapedText} ((string)${parsedArg}) ${this.LINE_TERMINATOR}`;\n } else {\n return this.getIden(identation) + `throwDynamicException(${id.escapedText}, ${parsedArg});return nil;`;\n }\n }\n return this.getIden(identation) + `panic(${id.escapedText}(${parsedArg}))${this.LINE_TERMINATOR}`;\n } else if (expression.expression.kind === ts.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?.escapedText;\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 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 == ts.SyntaxKind.InstanceOfKeyword) {\n return this.printInstanceOfExpression(node, identation);\n }\n\n if (operatorToken.kind === ts.SyntaxKind.EqualsToken) {\n // handle test['a'] = 1;\n const elementAccess = left;\n const rightSide = this.printNode(right, 0);\n if (left.kind === ts.SyntaxKind.ElementAccessExpression) {\n const leftSide = this.printNode(elementAccess.expression, 0);\n const propName = this.printNode(elementAccess.argumentExpression, 0);\n return `AddElementToObject(${leftSide}, ${propName}, ${rightSide})`;\n }\n\n if (right?.kind === ts.SyntaxKind.AwaitExpression || rightSide.startsWith('<-this.callInternal')) {\n const leftParsed = this.printNode(left, 0);\n return `\n ${leftParsed} = ${rightSide}\n ${this.getIden(identation)}PanicOnError(${leftParsed})`;\n }\n }\n\n const op = operatorToken.kind;\n // handle: [x,d] = this.method()\n if (op === ts.SyntaxKind.EqualsToken && left.kind === ts.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) + `${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 let operator = this.SupportedKindNames[operatorToken.kind];\n\n\n let leftVar = undefined;\n let rightVar = undefined;\n\n // c# wrapper\n if (operatorToken.kind === ts.SyntaxKind.EqualsEqualsToken || operatorToken.kind === ts.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 === ts.SyntaxKind.BarBarToken || operatorToken.kind === ts.SyntaxKind.AmpersandAmpersandToken) {\n leftVar = this.printCondition(left, 0);\n rightVar = this.printCondition(right, identation);\n } else {\n leftVar = this.printNode(left, 0);\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 leftVar +\" \"+ operator + \" \" + rightVar.trim();\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 catchLines = catchBody.split(\"\\n\").map(l => l.trim()).filter(Boolean);\n const catchLastLine = catchLines.length ? catchLines[catchLines.length - 1] : \"\";\n const catchBodyEndsWithReturn = catchLastLine.startsWith(\"return\")\n || catchLastLine.startsWith(\"panic\")\n || catchLastLine.startsWith(\"throw new\")\n || this.blockEndsWithConditionalReturn(node.catchClause.block.statements);\n\n const tryLines = tryBody.split(\"\\n\").map(l => l.trim()).filter(Boolean);\n const tryLastLine = tryLines.length ? tryLines[tryLines.length - 1] : \"\";\n const tryBodyEndsWithReturn = tryLastLine.startsWith(\"return\")\n || tryLastLine.startsWith(\"panic\")\n || tryLastLine.startsWith(\"throw new\")\n || this.blockEndsWithConditionalReturn(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.escapedText;\n const classPrefix = this.className !== 'undefined' ? `(this *${this.className})` : \"()\";\n const thisWord = this.className !== 'undefined' ? \"this\" : \"\";\n const catchBlock =`\n {\n ${nodeEndsWithReturn ? 'ret__ :=' : ''} func${classPrefix} (ret_ any) {\n\t\t defer func() {\n if ${errorName} := recover(); ${errorName} != nil {\n if ${errorName} == \"break\" {\n return\n }\n ret_ = func${classPrefix} any {\n // catch block:\n ${catchBody}\n ${catchBodyEndsWithReturn ? \"\" : returNil}\n }(${thisWord})\n }\n }()\n\t\t // try block:\n ${tryBody}\n\t\t ${tryBodyEndsWithReturn ? \"\" : returNil}\n\t }(${thisWord})\n ${nodeEndsWithReturn\n ? `\n if ret__ != nil {\n return ret__\n }\n return nil`\n : ''}\n }`;\n // add identation\n const indentedBlock = catchBlock.split(\"\\n\").map((line) => this.getIden(identation) + line).join(\"\\n\");\n // const catchCondOpen = this.CONDITION_OPENING ? this.CONDITION_OPENING : \" \";\n\n return indentedBlock;\n }\n\n printPrefixUnaryExpression(node, identation) {\n const {operand, operator} = node;\n if (operator === ts.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 === ts.SyntaxKind.MinusToken) {\n return this.getIden(identation) + `OpNeg(${this.printNode(node.operand, 0)})`;\n }\n return this.getIden(identation) + this.PrefixFixOperators[operator] + this.printNode(operand, 0);\n }\n\n printNewExpression(node, identation) {\n let expression = node.expression?.escapedText;\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 const args = node.arguments.map(n => this.printNode(n, identation)).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 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 (ts.isElementAccessExpression(current)) {\n keys.unshift(current.argumentExpression); // prepend\n const expr = current.expression;\n if (!ts.isElementAccessExpression(expr)) {\n // Reached the base container.\n baseExpr = expr;\n break;\n }\n current = expr;\n }\n\n const containerStr = this.printNode(baseExpr, 0);\n const keyStrs = keys.map(k => this.printNode(k, 0));\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 return acc;\n }\n\n isInsideVoidFunction(node: ts.Node): boolean {\n for (let cur = node.parent; cur; cur = cur.parent) {\n if (ts.isFunctionLike(cur)) {\n return cur.type === undefined || cur.type.kind === ts.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: ts.Statement): boolean {\n if (ts.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 (ts.isReturnStatement(statement)) {\n return true;\n } else if (ts.isThrowStatement(statement)) {\n return true;\n } else if (ts.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 (ts.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: ts.NodeArray): boolean {\n if (statements.length === 0) {\n return false;\n }\n\n const lastStatement = statements[statements.length - 1];\n if (ts.isIfStatement(lastStatement)) {\n // Check if this if statement has returns in all branches (only if it has an else)\n const ifHasReturn = this.hasReturnInBlock(lastStatement.thenStatement);\n if (lastStatement.elseStatement) {\n const elseHasReturn = this.hasReturnInBlock(lastStatement.elseStatement);\n return ifHasReturn && elseHasReturn;\n }\n }\n if (ts.isTryStatement(lastStatement)) {\n // Check if this try statement has returns in both try and catch blocks\n const tryHasReturn = this.hasReturnInBlock(lastStatement.tryBlock);\n const catchHasReturn = this.hasReturnInBlock(lastStatement.catchClause.block);\n return tryHasReturn && catchHasReturn;\n }\n return false;\n }\n\n\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\n","import { BaseTranspiler } from \"./baseTranspiler.js\";\nimport ts, { TypeChecker } from \"typescript\";\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\nexport class JavaTranspiler extends BaseTranspiler {\n binaryExpressionsWrappers;\n\n varListFromObjectLiterals = {};\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; escapedText: any; ownGetFullText: boolean; getFullText: any }> = [];\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 }\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 = {\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.binaryExpressionsWrappers = {\n [ts.SyntaxKind.EqualsEqualsToken]: [\n this.EQUALS_EQUALS_WRAPPER_OPEN,\n this.EQUALS_EQUALS_WRAPPER_CLOSE,\n ],\n [ts.SyntaxKind.EqualsEqualsEqualsToken]: [\n this.EQUALS_EQUALS_WRAPPER_OPEN,\n this.EQUALS_EQUALS_WRAPPER_CLOSE,\n ],\n [ts.SyntaxKind.ExclamationEqualsToken]: [\n this.DIFFERENT_WRAPPER_OPEN,\n this.DIFFERENT_WRAPPER_CLOSE,\n ],\n [ts.SyntaxKind.ExclamationEqualsEqualsToken]: [\n this.DIFFERENT_WRAPPER_OPEN,\n this.DIFFERENT_WRAPPER_CLOSE,\n ],\n [ts.SyntaxKind.GreaterThanToken]: [\n this.GREATER_THAN_WRAPPER_OPEN,\n this.GREATER_THAN_WRAPPER_CLOSE,\n ],\n [ts.SyntaxKind.GreaterThanEqualsToken]: [\n this.GREATER_THAN_EQUALS_WRAPPER_OPEN,\n this.GREATER_THAN_EQUALS_WRAPPER_CLOSE,\n ],\n [ts.SyntaxKind.LessThanToken]: [\n this.LESS_THAN_WRAPPER_OPEN,\n this.LESS_THAN_WRAPPER_CLOSE,\n ],\n [ts.SyntaxKind.LessThanEqualsToken]: [\n this.LESS_THAN_EQUALS_WRAPPER_OPEN,\n this.LESS_THAN_EQUALS_WRAPPER_CLOSE,\n ],\n [ts.SyntaxKind.PlusToken]: [\n this.PLUS_WRAPPER_OPEN,\n this.PLUS_WRAPPER_CLOSE,\n ],\n [ts.SyntaxKind.MinusToken]: [\n this.MINUS_WRAPPER_OPEN,\n this.MINUS_WRAPPER_CLOSE,\n ],\n [ts.SyntaxKind.AsteriskToken]: [\n this.MULTIPLY_WRAPPER_OPEN,\n this.MULTIPLY_WRAPPER_CLOSE,\n ],\n [ts.SyntaxKind.PercentToken]: [\n this.MOD_WRAPPER_OPEN,\n this.MOD_WRAPPER_CLOSE,\n ],\n [ts.SyntaxKind.SlashToken]: [\n this.DIVIDE_WRAPPER_OPEN,\n this.DIVIDE_WRAPPER_CLOSE,\n ],\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.escapedText);\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.escapedText;\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 // 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 === ts.SyntaxKind.NewExpression;\n const isInsideCatch =\n node?.parent?.kind === ts.SyntaxKind.ThrowStatement;\n const isLeftSide =\n node?.parent?.name === node || node?.parent?.left === node;\n const isCallOrPropertyAccess =\n node?.parent?.kind === ts.SyntaxKind.PropertyAccessExpression ||\n node?.parent?.kind === ts.SyntaxKind.ElementAccessExpression;\n if (!isLeftSide && !isCallOrPropertyAccess && !isInsideCatch && !isInsideNewExpression) {\n const type = this.getChecker().getTypeAtLocation(node);\n const typeSymbol = type?.symbol;\n if (typeSymbol !== undefined) {\n const decl = typeSymbol?.declarations ?? [];\n let isBuiltIn = undefined;\n if (decl.length > 0) {\n isBuiltIn =\n decl[0].getSourceFile().fileName.indexOf(\"typescript\") > -1;\n }\n\n if (isBuiltIn !== undefined && !isBuiltIn) {\n const symbol = this.getChecker().getSymbolAtLocation(node);\n let isClassDeclaration = false;\n if (symbol) {\n const first = symbol.declarations[0];\n if (first.kind === ts.SyntaxKind.ClassDeclaration) {\n isClassDeclaration = true;\n }\n if (first.kind === ts.SyntaxKind.ImportSpecifier) {\n const importedSymbol = this.getChecker().getAliasedSymbol(symbol);\n if (\n importedSymbol?.declarations[0]?.kind ===\n ts.SyntaxKind.ClassDeclaration\n ) {\n isClassDeclaration = true;\n }\n }\n }\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 if (ts.isExpressionStatement(statement)) {\n const expression = statement.expression;\n if (ts.isCallExpression(expression)) {\n const expressionText = expression.expression.getText().trim();\n if (expressionText === \"super\") {\n hasSuperCall = true;\n superCallParams = expression.arguments\n .map((a) => {\n return this.printNode(a, identation).trim();\n })\n .join(\", \");\n }\n }\n }\n });\n\n const header =\n this.getIden(identation) + className + \"(\" + args + \")\";\n if (!hasSuperCall) {\n return header + constructorBody;\n }\n // In Java, super(...) must be the first statement inside the body.\n const injected = this.injectLeadingInBody(constructorBody, `super(${superCallParams});`);\n return header + injected;\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 === ts.SyntaxKind.ElementAccessExpression) {\n const parsedArg =\n node.arguments?.length > 0\n ? node.arguments\n .map((n) => this.printNode(n, identation).trimStart())\n .join(\", \")\n : \"\";\n const target = this.printNode(elementAccess.expression, 0);\n const propName = this.printNode(elementAccess.argumentExpression, 0);\n const argsArray = `new Object[] { ${parsedArg} }`;\n const open = this.DYNAMIC_CALL_OPEN;\n return `${open}${target}, ${propName}, ${argsArray})`;\n }\n return undefined;\n }\n\n getExpressionStatementPrefixesIfAny(node, identation) {\n // return undefined;\n const finalVars = [];\n if (node.expression?.kind === ts.SyntaxKind.CallExpression) {\n const objectLiterals = this.getObjectLiteralFromCallExpressionArguments(node.expression);\n for (let i = 0; i < objectLiterals.length; i++) {\n const objLiteral = objectLiterals[i];\n const objVariables = this.getVarListFromObjectLiteralAndUpdateInPlace(objLiteral);\n if (objVariables.length > 0) {\n finalVars.push(...objVariables);\n }\n }\n\n if (finalVars.length > 0) {\n const decls = this.buildFinalVarDeclarations(finalVars, identation);\n if (decls) {\n return decls + \"\\n\" + this.getIden(identation);\n }\n }\n }\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 let parsedArguments = node.arguments\n ?.map((a) => this.printNode(a, 0))\n .join(\", \");\n parsedArguments = parsedArguments ? parsedArguments : \"\";\n const propName = node.expression?.name.escapedText;\n const isAsyncDecl = node?.parent?.kind === ts.SyntaxKind.AwaitExpression;\n const argsArray = `new Object[] { ${parsedArguments} }`;\n const open = this.DYNAMIC_CALL_OPEN;\n const statement = `${open}this, \"${propName}\", ${argsArray})`;\n // If your Java runtime returns CompletableFuture, you can await it where appropriate.\n return statement;\n }\n return undefined;\n }\n\n printOutOfOrderCallExpressionIfAny(node, identation) {\n if (node.expression.kind === ts.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(Helpers.toString(${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 `Helpers.mathMin(${parsedArg1}, ${parsedArg2})`;\n case \"Math.max\":\n return `Helpers.mathMax(${parsedArg1}, ${parsedArg2})`;\n case \"Math.pow\":\n return `Helpers.mathPow(Double.parseDouble(Helpers.toString(${parsedArg1})), Double.parseDouble(Helpers.toString(${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 === ts.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 === ts.SyntaxKind.ExclamationEqualsEqualsToken ||\n op === ts.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 (ts.isMethodDeclaration(current) || ts.isFunctionDeclaration(current)) {\n return String((current.name as any)?.escapedText ?? '');\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 (ts.isClassDeclaration(current)) {\n return String((current.name as any)?.escapedText ?? '');\n }\n current = current.parent;\n }\n return '';\n }\n\n getVarKey(node) {\n\n const varName = node?.escapedText ?? node?.name?.escapedText;\n if (!varName) {\n return '';\n }\n return `${this.getVarClassIfAny(node)}-${this.getVarMethodIfAny(node)}-${varName}`;\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 === ts.SyntaxKind.Identifier) {\n this.ReassignedVars[this.getVarKey(left)] = true;\n }\n\n if (left.kind === ts.SyntaxKind.TypeOfExpression) {\n const typeOfExpression = this.handleTypeOfInsideBinaryExpression(\n node,\n identation\n );\n if (typeOfExpression) return typeOfExpression;\n }\n\n // destructuring: [a,b] = this.method()\n if (\n op === ts.SyntaxKind.EqualsToken &&\n left.kind === ts.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 const statement =\n this.getIden(identation) +\n `${e} = ((java.util.List) ${syntheticName}).get(${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 // setter for element-access assignments: a[b] = v\n // ---------------------------------------------------------------\n if (op === ts.SyntaxKind.EqualsToken &&\n left.kind === ts.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 (ts.isElementAccessExpression(cur)) {\n keys.unshift(cur.argumentExpression); // prepend\n const expr = cur.expression;\n if (!ts.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.\n let acc = containerStr;\n for (let i = 0; i < keyStrs.length - 1; i++) {\n acc = `${this.ELEMENT_ACCESS_WRAPPER_OPEN}${acc}, ${keyStrs[i]}${this.ELEMENT_ACCESS_WRAPPER_CLOSE}`;\n }\n\n let prefixes = this.getBinaryExpressionPrefixes(node, identation);\n prefixes = prefixes ? prefixes : \"\";\n\n\n const lastKey = keyStrs[keyStrs.length - 1];\n const rhs = this.printNode(right, 0);\n\n\n\n return `${prefixes}Helpers.addElementToObject(${acc}, ${lastKey}, ${rhs})`;\n }\n\n if (op === ts.SyntaxKind.InKeyword) {\n return `Helpers.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 === ts.SyntaxKind.PlusEqualsToken || op === ts.SyntaxKind.MinusEqualsToken || op in this.binaryExpressionsWrappers) {\n const leftText = this.printNode(left, 0);\n const rightText = this.printNode(right, 0);\n\n if (op === ts.SyntaxKind.PlusEqualsToken) {\n return `${leftText} = Helpers.add(${leftText}, ${rightText})`;\n }\n\n if (op === ts.SyntaxKind.MinusEqualsToken) {\n return `${leftText} = Helpers.subtract(${leftText}, ${rightText})`;\n }\n\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\n getObjectLiteralFromCallExpressionArguments(node) {\n const res = [];\n if (!node?.arguments) {\n return res;\n }\n const args = node.arguments;\n\n for (let i = 0; i < args.length; i++) {\n const arg = args[i];\n if (arg.kind === ts.SyntaxKind.ObjectLiteralExpression) {\n res.push(arg);\n } else if (arg.kind === ts.SyntaxKind.CallExpression) {\n const innerCallExp = arg;\n const innerObjLiterals = this.getObjectLiteralFromCallExpressionArguments(innerCallExp);\n res.push(...innerObjLiterals);\n }\n }\n return res;\n }\n\n // Finds every ObjectLiteralExpression nested anywhere inside an RHS/initializer\n // expression that would produce an anonymous-inner-class capture in Java\n // (HashMap double-brace init). Stops descending at each ObjectLiteralExpression\n // because nested literals are walked recursively inside\n // getVarListFromObjectLiteralAndUpdateInPlace. Skips function/arrow bodies so\n // we don't capture literals that evaluate in a different scope.\n //\n // Unifies the previously-narrow matching in printVariableDeclarationList and\n // getBinaryExpressionPrefixes which only handled ObjectLiteralExpression or\n // CallExpression directly — missing wrappers like AwaitExpression,\n // ParenthesizedExpression, NewExpression, and ConditionalExpression.\n collectCapturingObjectLiterals(node): any[] {\n const found = [];\n const walk = (n) => {\n if (!n) return;\n if (n.kind === ts.SyntaxKind.ObjectLiteralExpression) {\n found.push(n);\n return;\n }\n if (n.kind === ts.SyntaxKind.FunctionExpression ||\n n.kind === ts.SyntaxKind.ArrowFunction ||\n n.kind === ts.SyntaxKind.MethodDeclaration ||\n n.kind === ts.SyntaxKind.FunctionDeclaration) {\n return;\n }\n ts.forEachChild(n, walk);\n };\n walk(node);\n return found;\n }\n\n getBinaryExpressionPrefixes(node, identation) {\n let right = node?.right;\n if (right?.kind === ts.SyntaxKind.AwaitExpression) {\n // un pack await this.x() to this.x(), we don't care about await here\n right = right.expression;\n }\n if (!right) {\n return undefined;\n }\n if (right.kind === ts.SyntaxKind.ObjectLiteralExpression) {\n const objVariables = this.getVarListFromObjectLiteralAndUpdateInPlace(right);\n if (objVariables.length > 0) {\n const decls = this.buildFinalVarDeclarations(objVariables, identation);\n if (decls) {\n return decls + \"\\n\" + this.getIden(identation);\n }\n }\n } else if (right.kind === ts.SyntaxKind.CallExpression) {\n // search arguments recursively for object literals\n // eg: a[x] = this.extend(this.extend(this.extend({'a':b}, c)))\n const objectLiterals = this.getObjectLiteralFromCallExpressionArguments(right);\n if (objectLiterals.length > 0) {\n const allVars = [];\n for (let i = 0; i < objectLiterals.length; i++) {\n const objLiteral = objectLiterals[i];\n const objVariables = this.getVarListFromObjectLiteralAndUpdateInPlace(objLiteral);\n allVars.push(...objVariables);\n }\n if (allVars.length > 0) {\n const decls = this.buildFinalVarDeclarations(allVars, identation);\n if (decls) {\n return decls + \"\\n\" + this.getIden(identation);\n }\n }\n }\n }\n return undefined;\n }\n\n getFinalVarName(varName: string): string {\n if (this.ReservedKeywordsReplacements[varName]) {\n varName = this.ReservedKeywordsReplacements[varName];\n }\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: ts.SyntaxKind): boolean {\n return op === ts.SyntaxKind.EqualsToken ||\n op === ts.SyntaxKind.PlusEqualsToken ||\n op === ts.SyntaxKind.MinusEqualsToken ||\n op === ts.SyntaxKind.AsteriskEqualsToken ||\n op === ts.SyntaxKind.AsteriskAsteriskEqualsToken ||\n op === ts.SyntaxKind.SlashEqualsToken ||\n op === ts.SyntaxKind.PercentEqualsToken ||\n op === ts.SyntaxKind.LessThanLessThanEqualsToken ||\n op === ts.SyntaxKind.GreaterThanGreaterThanEqualsToken ||\n op === ts.SyntaxKind.GreaterThanGreaterThanGreaterThanEqualsToken ||\n op === ts.SyntaxKind.AmpersandEqualsToken ||\n op === ts.SyntaxKind.BarEqualsToken ||\n op === ts.SyntaxKind.CaretEqualsToken ||\n op === ts.SyntaxKind.BarBarEqualsToken ||\n op === ts.SyntaxKind.AmpersandAmpersandEqualsToken ||\n op === ts.SyntaxKind.QuestionQuestionEqualsToken;\n }\n\n private isIncDecOperator(op: ts.SyntaxKind): boolean {\n return op === ts.SyntaxKind.PlusPlusToken || op === ts.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: ts.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] ?? sym?.valueDeclaration;\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.escapedText}`;\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 === ts.SyntaxKind.BinaryExpression) {\n if (node.left?.kind === ts.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 === ts.SyntaxKind.EqualsToken &&\n node.left?.kind === ts.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 === ts.SyntaxKind.Identifier) {\n reassignedSyms.add(symbolIdOf(elem));\n }\n }\n }\n }\n if ((node.kind === ts.SyntaxKind.PrefixUnaryExpression ||\n node.kind === ts.SyntaxKind.PostfixUnaryExpression) &&\n this.isIncDecOperator(node.operator) &&\n node.operand?.kind === ts.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 === ts.SyntaxKind.Identifier) {\n const name = node.escapedText 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 ts.forEachChild(node, 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: ts.Node };\n const events: Event[] = [];\n\n const visitExprInObjLit = (n: any) => {\n if (!n) return;\n if (n.kind === ts.SyntaxKind.Identifier) {\n const name = n.escapedText 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 === ts.SyntaxKind.BinaryExpression) {\n visitExprInObjLit(n.left);\n visitExprInObjLit(n.right);\n return;\n }\n if (n.kind === ts.SyntaxKind.ParenthesizedExpression) {\n visitExprInObjLit(n.expression);\n return;\n }\n if (n.kind === ts.SyntaxKind.ConditionalExpression) {\n visitExprInObjLit(n.condition);\n visitExprInObjLit(n.whenTrue);\n visitExprInObjLit(n.whenFalse);\n return;\n }\n if (n.kind === ts.SyntaxKind.CallExpression) {\n n.arguments?.forEach(visitExprInObjLit);\n if (n.expression?.kind === ts.SyntaxKind.PropertyAccessExpression) {\n visitExprInObjLit(n.expression.expression);\n }\n return;\n }\n if (n.kind === ts.SyntaxKind.PrefixUnaryExpression) {\n visitExprInObjLit(n.operand);\n return;\n }\n if (n.kind === ts.SyntaxKind.ElementAccessExpression) {\n let left = n.expression;\n while (left?.kind === ts.SyntaxKind.ElementAccessExpression) {\n left = left.expression;\n }\n visitExprInObjLit(left);\n visitExprInObjLit(n.argumentExpression);\n return;\n }\n if (n.kind === ts.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 ts.forEachChild(n, visitExprInObjLit);\n };\n\n const walk = (node: any) => {\n if (!node) return;\n\n if (node.kind === ts.SyntaxKind.BinaryExpression &&\n this.isAssignmentOperator(node.operatorToken.kind)) {\n walk(node.right);\n if (node.left?.kind === ts.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 === ts.SyntaxKind.PrefixUnaryExpression ||\n node.kind === ts.SyntaxKind.PostfixUnaryExpression) &&\n this.isIncDecOperator(node.operator) &&\n node.operand?.kind === ts.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 === ts.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: ts.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 === ts.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 === ts.SyntaxKind.TryStatement) {\n walkBlockAndBump(node.tryBlock);\n walkBlockAndBump(node.catchClause?.block);\n walkBlockAndBump(node.finallyBlock);\n return;\n }\n\n ts.forEachChild(node, 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 if (versions.length === 1) {\n for (const n of byVer.get(versions[0])!) {\n this.usageToFinalName.set(n, baseName);\n }\n } else {\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\n private finalNameInAncestorScope(finalName: string): boolean {\n for (const scope of this.finalVarScopeStack) {\n if (scope.has(finalName)) return true;\n }\n return false;\n }\n\n buildFinalVarDeclarations(pairs: Array<{ orig: string; final: string }>, identation: number): string {\n if (pairs.length === 0) return '';\n const current = this.finalVarScopeStack.length > 0\n ? this.finalVarScopeStack[this.finalVarScopeStack.length - 1]\n : null;\n const lines: string[] = [];\n const seenHere = new Set();\n for (const p of pairs) {\n if (seenHere.has(p.final)) continue;\n if (this.finalNameInAncestorScope(p.final)) continue;\n seenHere.add(p.final);\n if (current) current.add(p.final);\n const indent = lines.length === 0 ? 0 : identation;\n // The RHS must use the remapped Java name (e.g. `params` → `parameters`,\n // `internal` → `intern`) since the original TS identifier doesn't exist\n // in the generated Java code.\n lines.push(`${this.getIden(indent)}final Object ${p.final} = ${this.getOriginalVarName(p.orig)};`);\n }\n return lines.join('\\n');\n }\n\n getObjectLiteralId(node): string {\n const start = node.getStart();\n const end = node.getEnd();\n // Qualify with the file: the offsets alone collide between two files whose\n // object literals happen to sit at the same character range.\n const fileName = node.getSourceFile?.()?.fileName ?? '';\n return `${fileName}:${start}-${end}`;\n }\n\n // Remember an identifier's pre-rewrite state so restoreFinalVarMutations can put\n // the shared AST back exactly as it was parsed.\n recordFinalVarMutation(node: any): void {\n this.finalVarMutations.push({\n node,\n escapedText: node.escapedText,\n ownGetFullText: Object.prototype.hasOwnProperty.call(node, 'getFullText'),\n getFullText: node.getFullText,\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 mutation.node.escapedText = mutation.escapedText;\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 === ts.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 createNewNodeForFinalVar(originalName: string): ts.Identifier {\n const newNode = ts.factory.createIdentifier(this.getFinalVarName(originalName));\n newNode.getFullText = () => this.getFinalVarName(originalName);\n return newNode;\n }\n\n getVarListFromObjectLiteralAndUpdateInPlace(node): Array<{ orig: string; final: string }> {\n // in java if we use an anonymous object literal put, we can't refer non final variables\n // so here we collect them and then we add the wrapper final variables, eg: finalX = X;\n // and we update the node in place to use finalX instead of X.\n // The final name comes from analyzeFinalVars (pre-walk), which assigns\n // version-aware names so reassignment-between-usages produces distinct finals.\n let res: Array<{ orig: string; final: string }> = [];\n\n const nodeId = this.getObjectLiteralId(node);\n\n if (nodeId in this.varListFromObjectLiterals) {\n return this.varListFromObjectLiterals[nodeId];\n }\n\n const finalNameFor = (n: any, origName: string): string => {\n return this.usageToFinalName.get(n) ?? this.getFinalVarName(origName);\n };\n\n // Walks any expression, rewriting reassigned-var Identifiers to their\n // finalXxx names in place. We rely on ts.forEachChild for traversal so\n // every node kind (PrefixUnary, PostfixUnary, ElementAccess,\n // PropertyAccess, BinaryExpression, ConditionalExpression, CallExpression,\n // ParenthesizedExpression, etc.) is covered uniformly. ObjectLiteral is\n // delegated back to the parent function so per-objectLiteral nodeId\n // dedup applies to nested literals too.\n const traverseAndReplace = (n) => {\n if (!n) return;\n if (n.kind === ts.SyntaxKind.Identifier) {\n const name = n.escapedText as string | undefined;\n if (name && name !== 'undefined' && !name.startsWith('null')) {\n // Prefer analyzeFinalVars' pre-walk result (usageToFinalName):\n // it knows about reassignments anywhere in the function body,\n // including ones that happen AFTER this object literal in\n // source order. ReassignedVars is populated as BinaryExpressions\n // are printed, so for a forward reference it is still false at\n // this point and would miss the shadow.\n const isReassignedAhead = this.usageToFinalName.has(n);\n if (isReassignedAhead || this.ReassignedVars[this.getVarKey(n)]) {\n const finalName = finalNameFor(n, name);\n res.push({ orig: name, final: finalName });\n this.recordFinalVarMutation(n);\n n.escapedText = finalName;\n // Some downstream print paths read from getFullText (which\n // reflects the source text, not escapedText) — shim it so\n // they see the rewritten name.\n (n as any).getFullText = () => finalName;\n }\n }\n return;\n }\n if (n.kind === ts.SyntaxKind.ObjectLiteralExpression) {\n const innerVars = this.getVarListFromObjectLiteralAndUpdateInPlace(n);\n res = res.concat(innerVars);\n return;\n }\n ts.forEachChild(n, traverseAndReplace);\n };\n\n node.properties.forEach( (prop) => {\n if (!prop.initializer) return;\n traverseAndReplace(prop.initializer);\n });\n\n // dedup on (orig|final) pair\n const seen = new Set();\n const dedup: Array<{ orig: string; final: string }> = [];\n for (const p of res) {\n const key = `${p.orig}|${p.final}`;\n if (seen.has(key)) continue;\n seen.add(key);\n dedup.push(p);\n }\n this.varListFromObjectLiterals[nodeId] = dedup;\n return dedup;\n }\n\n printVariableDeclarationList(node, identation) {\n const declaration = node.declarations[0];\n\n let finalVars = '';\n if (declaration.initializer) {\n // Walk the whole initializer tree — handles AwaitExpression,\n // ParenthesizedExpression, NewExpression, ConditionalExpression,\n // nested CallExpressions, etc. uniformly.\n const objLiterals = this.collectCapturingObjectLiterals(declaration.initializer);\n let varObj = [];\n for (const lit of objLiterals) {\n const vars = this.getVarListFromObjectLiteralAndUpdateInPlace(lit);\n varObj = varObj.concat(vars);\n }\n if (varObj.length > 0) {\n finalVars = this.buildFinalVarDeclarations(varObj, identation);\n }\n }\n\n if (\n this.removeVariableDeclarationForFunctionExpression &&\n declaration?.initializer &&\n ts.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 === ts.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 let arrayBindingStatement =\n `${this.getIden(identation)}var ${syntheticName} = ${this.printNode(\n declaration.initializer,\n 0\n )};\\n`;\n\n parsedArrayBindingElements.forEach((e, index) => {\n const statement =\n this.getIden(identation) +\n `var ${e} = ((java.util.List) ${syntheticName}).get(${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 const isNew =\n declaration?.initializer &&\n declaration.initializer.kind === ts.SyntaxKind.NewExpression;\n const varToken = isNew ? \"var \" : this.VAR_TOKEN + \" \";\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 finalVars = finalVars.length > 0 ? this.getIden(identation) + finalVars + \"\\n\" : finalVars;\n return (\n finalVars +\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 === ts.SyntaxKind.PropertyAssignment) {\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.escapedText;\n\n let rawExpression = undefined;\n\n switch (rightSide) {\n case \"length\": {\n const type = (this.getChecker() as TypeChecker).getTypeAtLocation(\n expression\n );\n this.warnIfAnyType(node, (type as any).flags, leftSide, \"length\");\n rawExpression = this.isStringType((type as any).flags)\n ? `((String)${leftSide}).length()`\n : `${this.ARRAY_LENGTH_WRAPPER_OPEN}${leftSide}${this.ARRAY_LENGTH_WRAPPER_CLOSE}`;\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 ts.isArrayLiteralExpression(node) ||\n ts.isObjectLiteralExpression(node) ||\n ts.isStringLiteral(node) ||\n (ts as any).isBooleanLiteral(node)\n ) {\n return this.UNDEFINED_TOKEN;\n }\n\n if (ts.isNumericLiteral(node)) {\n return this.UNDEFINED_TOKEN;\n }\n\n if (\n node?.escapedText === \"undefined\" &&\n this.getChecker().getTypeAtLocation(node?.parent)?.flags ===\n ts.TypeFlags.Number\n ) {\n return this.UNDEFINED_TOKEN;\n }\n\n return undefined;\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 const initParams = [];\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 const index = i + offSetIndex;\n // index = index < 0 ? 0 : i - 1;\n const paramName = this.printNode(param.name, 0);\n initParams.push(`Object ${paramName} = Helpers.getArg(optionalArgs, ${index}, ${this.printNode(initializer, 0)});`);\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) {\n const finalWrapperVars = this.printFinalOutsideMethodVariableWrappersIfAny(node, identation) + \"\\n\";\n const insideWrappers = 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 && (ts.isReturnStatement(lastStatement) || this.allBranchesTerminate(lastStatement));\n const returnNull = lastStmtIsReturn ? \"\" : (this.getIden(identation + 2) + \"return null;\\n\");\n const asyncBody = this.getIden(identation + 1) + \"return java.util.concurrent.CompletableFuture.supplyAsync(() -> {\\n\" +\n insideWrappers +\n body + \"\\n\" +\n returnNull +\n this.getIden(identation + 1) + \"});\\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.escapedText;\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 === ts.SyntaxKind.AnyKeyword) {\n return `((${this.VariableTypeReplacements['object']})${this.printNode(\n node.expression,\n identation\n )})`;\n }\n\n if (type.kind === ts.SyntaxKind.StringKeyword) {\n return `((String)${this.printNode(node.expression, identation)})`;\n }\n\n if (type.kind === ts.SyntaxKind.ArrayType) {\n if (type.elementType.kind === ts.SyntaxKind.AnyKeyword) {\n return `(java.util.List)(${this.printNode(\n node.expression,\n identation\n )})`;\n }\n if (type.elementType.kind === ts.SyntaxKind.StringKeyword) {\n return `(java.util.List)(${this.printNode(\n node.expression,\n identation\n )})`;\n }\n }\n\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 let type = this.printParameterType(node) || \"\";\n\n if (defaultValue) {\n if (initializer) {\n const customDefaultValue =\n this.printCustomDefaultValueIfNeeded(initializer);\n const def = customDefaultValue\n ? customDefaultValue\n : this.printNode(initializer, 0);\n type = def === \"null\" && type !== \"Object\" ? type + \" \" : type + \" \";\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 printMethodParameters(node) {\n const isAsyncMethod = this.isAsyncFunction(node);\n const params = node.parameters.map(param => {\n const isReassignedVar = this.ReassignedVars[this.getVarKey(param)];\n let printedParam = this.printParameter(param);\n if (isAsyncMethod && isReassignedVar) {\n const paramName = param.name.escapedText;\n const { localName, sigName } = this.getAsyncParamWrapperNames(paramName);\n // Replace the printed Java name (post keyword-remap) with sigName so\n // the original name is freed for the lambda body to bind.\n printedParam = printedParam.replace(localName, sigName);\n }\n return printedParam;\n });\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 const parameters = node?.parameters;\n const finalVarWrappers = [];\n\n if (parameters) {\n const isAsyncMethod = this.isAsyncFunction(node);\n parameters.forEach(param => {\n const isOptionalParam = param.initializer !== undefined || param.questionToken !== undefined;\n if (!isOptionalParam) {\n const isReassignedVar = this.ReassignedVars[this.getVarKey(param)];\n if (isAsyncMethod && isReassignedVar) {\n const paramName = param.name.escapedText;\n const { sigName, snapName } = this.getAsyncParamWrapperNames(paramName);\n finalVarWrappers.push(this.getIden(identation + 1) + `final Object ${snapName} = ${sigName};`);\n }\n }\n\n });\n }\n return finalVarWrappers.join(\"\\n\");\n }\n\n printInsideMethodVariableWrappersIfAny(node, identation) {\n const parameters = node?.parameters;\n const finalVarWrappers = [];\n\n if (parameters) {\n const isAsyncMethod = this.isAsyncFunction(node);\n parameters.forEach(param => {\n const isOptionalParam = param.initializer !== undefined || param.questionToken !== undefined;\n if (!isOptionalParam) {\n const isReassignedVar = this.ReassignedVars[this.getVarKey(param)];\n if (isAsyncMethod && isReassignedVar) {\n const paramName = param.name.escapedText;\n const { localName, snapName } = this.getAsyncParamWrapperNames(paramName);\n finalVarWrappers.push(this.getIden(identation + 1) + `Object ${localName} = ${snapName};`);\n }\n }\n\n });\n }\n return finalVarWrappers.join(\"\\n\");\n }\n\n printMethodDeclaration(node, identation) {\n\n\n const funcBody = this.printFunctionBody(node, identation); // print body first to get var reassignments filled\n\n let methodDef = this.printMethodDefinition(node, identation);\n\n methodDef += funcBody;\n\n return methodDef;\n }\n\n printMethodDefinition(node, identation) {\n let name = node.name.escapedText;\n name = this.transformMethodNameIfNeeded(name);\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 // let modifiers = this.printModifiers(node);\n const defaultAccess = this.METHOD_DEFAULT_ACCESS ? this.METHOD_DEFAULT_ACCESS + \" \" : \"\";\n const modifiers = defaultAccess;\n // modifiers = modifiers ? modifiers + \" \" : defaultAccess;\n // modifiers =\n // modifiers.indexOf(\"public\") === -1 &&\n // modifiers.indexOf(\"private\") === -1 &&\n // modifiers.indexOf(\"protected\") === -1\n // ? defaultAccess + modifiers\n // : modifiers;\n\n let parsedArgs = undefined;\n\n // const methodOverride = (this.getMethodOverride(node) as any);\n // const isOverride = methodOverride !== undefined;\n\n // if (isOverride && (returnType === \"Object\" || returnType === \"java.util.concurrent.CompletableFuture\")) {\n // returnType = this.printFunctionType(methodOverride);\n // }\n\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 // const currentArgs = node.parameters;\n // const parentArgs = methodOverride.parameters;\n // parsedArgs = \"\";\n // parentArgs.forEach((param, index) => {\n // const originalName = this.printNode(currentArgs[index].name, 0);\n // const parsedArg = this.printParameteCustomName(param, originalName);\n // parsedArgs += parsedArg;\n // if (index < parentArgs.length - 1) {\n // parsedArgs += \", \";\n // }\n // });\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 signature =\n this.getIden(identation) +\n modifiers +\n returnType +\n methodToken +\n name +\n \"(\" +\n parsedArgs +\n \")\";\n\n return this.printNodeCommentsIfAny(node, identation, signature);\n }\n\n // Route through Helpers so consumers control semantics (thread-safety,\n // null-handling, type coercion) in one place — same pattern as\n // Helpers.add / Helpers.isEqual / Helpers.GetValue / Helpers.json. The\n // previous inline emits (`x instanceof java.util.List`, `((Map)x).keySet()`)\n // forced any downstream that needed different semantics (e.g. synchronized\n // map access in concurrent code) to post-process the generated Java with\n // regex — which only catches the bare-identifier argument shape and misses\n // property-access (`this.x`) and element-access (`obj[k]`) arguments.\n printArrayIsArrayCall(_node, _identation, parsedArg = undefined) {\n return `Helpers.isArray(${parsedArg})`;\n }\n\n printObjectKeysCall(_node, _identation, parsedArg = undefined) {\n return `Helpers.objectKeys(${parsedArg})`;\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 printPromiseAllCall(_node, _identation, parsedArg = undefined) {\n return `Helpers.promiseAll(${parsedArg})`;\n }\n\n printMathFloorCall(_node, _identation, parsedArg = undefined) {\n return `(Math.floor(Double.parseDouble(Helpers.toString(${parsedArg}))))`;\n }\n\n printMathRoundCall(_node, _identation, parsedArg = undefined) {\n return `Math.round(Double.parseDouble(Helpers.toString(${parsedArg})))`;\n }\n\n printMathCeilCall(_node, _identation, parsedArg = undefined) {\n return `Math.ceil(Double.parseDouble(Helpers.toString(${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 printIndexOfCall(_node, _identation, name = undefined, parsedArg = undefined) {\n return `${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 `new java.util.ArrayList(java.util.Arrays.asList(((String)${name}).split((String)${parsedArg})))`;\n return `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 if (parsedArg2 === undefined) {\n parsedArg2 = \"null\";\n }\n return `Helpers.slice(${name}, ${parsedArg}, ${parsedArg2})`;\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 return `Helpers.replaceAll((String)${name}, (String)${parsedArg}, (String)${parsedArg2})`;\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 `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 TypeChecker).getTypeAtLocation(node.expression);\n this.warnIfAnyType(node, (type as any).flags, leftSide, \"length\");\n return this.isStringType((type as any).flags)\n ? `((String)${leftSide}).length()`\n : `${this.ARRAY_LENGTH_WRAPPER_OPEN}${leftSide}${this.ARRAY_LENGTH_WRAPPER_CLOSE}`;\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 const op = this.PostFixOperators[operator];\n if (op === \"--\") {\n return `${leftSide}--`;\n }\n return `${leftSide}++`;\n }\n\n printPrefixUnaryExpression(node, identation) {\n const { operand, operator } = node;\n if (operator === ts.SyntaxKind.ExclamationToken) {\n return this.PrefixFixOperators[operator] + this.printCondition(node.operand, 0);\n }\n const leftSide = this.printNode(operand, 0);\n if (operator === ts.SyntaxKind.PlusToken) {\n return `+(${leftSide})`;\n } else if (operator === ts.SyntaxKind.MinusToken) {\n return `Helpers.opNeg(${leftSide})`;\n }\n return super.printPrefixUnaryExpression(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 === ts.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 === ts.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 === ts.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.escapedText === \"Error\" ? \"RuntimeException\" : id.escapedText;\n const symbol = this.getChecker().getSymbolAtLocation(expression.expression);\n if (symbol) {\n const declarations =\n this.getChecker().getDeclaredTypeOfSymbol(symbol).symbol?.declarations ?? [];\n const isClassDeclaration = declarations.find(\n (l) =>\n l.kind === ts.SyntaxKind.InterfaceDeclaration ||\n l.kind === ts.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 === ts.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 === ts.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]);\n modifiers = modifiers.filter(mod => mod.kind !== ts.SyntaxKind.AsyncKeyword);\n const res = modifiers.map(modifier => this.FuncModifiers[modifier.kind]).join(\" \");\n\n return res;\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 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 === ts.SyntaxKind.AsExpression && (exp.expression.kind === ts.SyntaxKind.ObjectLiteralExpression || ts.SyntaxKind.CallExpression)) {\n exp = exp.expression; // go over something like return {} as SomeType\n }\n // Use collectCapturingObjectLiterals to walk through every wrapper\n // (AwaitExpression, ParenthesizedExpression, CallExpression args, ArrayLiteral\n // elements, ConditionalExpression branches, NewExpression args, etc.) and\n // pick up every HashMap literal whose anonymous-inner-class body would\n // need effectively-final captures. The previous narrow switch missed\n // `return await this.watch(..., { literal capturing reassigned var }, ...)`\n // entirely — the literal ended up referencing the raw (reassigned)\n // identifier with no snapshot, which javac rejects.\n const allVarNames = [];\n if (exp) {\n const objLiterals = this.collectCapturingObjectLiterals(exp);\n for (const objLiteral of objLiterals) {\n const varsList = this.getVarListFromObjectLiteralAndUpdateInPlace(objLiteral);\n allVarNames.push(...varsList);\n }\n }\n let finalVars = allVarNames.length > 0 ? this.buildFinalVarDeclarations(allVarNames, identation) : '';\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 (ts.isFunctionDeclaration(parent) || ts.isMethodDeclaration(parent) || ts.isFunctionExpression(parent) || ts.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 finalVars = finalVars.length > 0 ? this.getIden(identation) + finalVars + \"\\n\" : finalVars;\n return leadingComment + finalVars + this.getIden(identation) + this.RETURN_TOKEN + rightPart + trailingComment;\n }\n\n private allBranchesTerminate(node: ts.Node): boolean {\n if (ts.isReturnStatement(node) || ts.isThrowStatement(node)) {\n return true;\n }\n if (ts.isBlock(node)) {\n const stmts = node.statements;\n return stmts.length > 0 && this.allBranchesTerminate(stmts[stmts.length - 1]);\n }\n if (ts.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 ts from 'typescript';\n\nconst SyntaxKind = ts.SyntaxKind;\n\nconst parserConfig = {\n 'ELSEIF_TOKEN': 'else if',\n 'OBJECT_OPENING': '{',\n 'OBJECT_CLOSING': '}',\n 'ARRAY_OPENING_TOKEN': 'Value::List(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\nexport class RustTranspiler extends BaseTranspiler {\n\n binaryExpressionsWrappers;\n methodSignatures: Record;\n forLoopCounter: number;\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 capitalize(str: string) {\n return str[0].toUpperCase() + str.slice(1);\n }\n\n printStringLiteral(node) {\n let text = node.text;\n if (text in this.StringLiteralReplacements) {\n return this.StringLiteralReplacements[text];\n }\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 `Value::Str(\"${text}\".to_string())`;\n }\n\n printNumericLiteral(node) {\n const text = node.text;\n if (text.includes('.')) {\n return `Value::Float(${text})`;\n }\n return `Value::Int(${text})`;\n }\n\n printBooleanLiteral(node) {\n if (ts.SyntaxKind.TrueKeyword === node.kind) {\n return 'Value::Bool(true)';\n }\n return 'Value::Bool(false)';\n }\n\n printNullKeyword(node, identation) {\n return 'Value::Null';\n }\n\n // Ensure a & ref prefix — skip only if already a reference\n ensureRef(expr: string): string {\n if (expr.startsWith('&')) {\n return expr;\n }\n return `&${expr}`;\n }\n\n printCustomBinaryExpressionIfAny(node, identation) {\n const left = node.left;\n const right = node.right;\n const op = node.operatorToken.kind;\n\n // Handle array destructuring reassignment: [a, b] = expr → bind once, reassign each\n if (op === SyntaxKind.EqualsToken && left.kind === SyntaxKind.ArrayLiteralExpression) {\n const elements = left.elements;\n const rhs = this.printNode(right, 0);\n const tmpName = '__destr_tmp';\n const assignments = elements.map((e, idx) => {\n const target = this.printNode(e, 0);\n return `${target} = get_value(&${tmpName}, &Value::Int(${idx}))`;\n }).join('; ');\n return `{ let ${tmpName} = ${rhs}; ${assignments}; }`;\n }\n\n // Handle element access assignment: a[b] = v → add_element_to_object(&mut a, &b, v)\n if (op === SyntaxKind.EqualsToken && left.kind === SyntaxKind.ElementAccessExpression) {\n const keys: any[] = [];\n let baseExpr: any = null;\n let cur: any = left;\n while (ts.isElementAccessExpression(cur)) {\n keys.unshift(cur.argumentExpression);\n const expr = cur.expression;\n if (!ts.isElementAccessExpression(expr)) {\n baseExpr = expr;\n break;\n }\n cur = expr;\n }\n const containerStr = this.printNode(baseExpr, 0);\n const keyStrs = keys.map(k => this.printNode(k, 0));\n let acc = `&mut ${containerStr}`;\n for (let i = 0; i < keyStrs.length - 1; i++) {\n acc = `get_value_mut(${acc}, &${keyStrs[i]})`;\n }\n const lastKey = keyStrs[keyStrs.length - 1];\n const rhs = this.printNode(right, 0);\n return `add_element_to_object(${acc}, &${lastKey}, ${rhs})`;\n }\n\n // Handle typeof comparisons\n if (left.kind === SyntaxKind.TypeOfExpression) {\n const expression = left.expression;\n const rightText = right.text;\n const target = this.printNode(expression, 0);\n const isDiff = op === SyntaxKind.ExclamationEqualsEqualsToken || op === SyntaxKind.ExclamationEqualsToken;\n const not = isDiff ? '!' : '';\n switch (rightText) {\n case 'string': return `${not}is_string(&${target})`;\n case 'number': return `${not}is_number(&${target})`;\n case 'boolean': return `${not}is_bool(&${target})`;\n case 'object': return `${not}is_object(&${target})`;\n case 'function': return `${not}is_function(&${target})`;\n }\n }\n\n // Handle in operator — wrap as Value so it composes in any context\n if (op === SyntaxKind.InKeyword) {\n return `Value::Bool(in_op(&${this.printNode(right, 0)}, &${this.printNode(left, 0)}))`;\n }\n\n // Handle += for regular variables\n if (op === SyntaxKind.PlusEqualsToken && left.kind !== SyntaxKind.ElementAccessExpression) {\n const leftText = this.printNode(left, 0);\n const rightText = this.printNode(right, 0);\n return `${leftText} = add(&${leftText}, &${rightText})`;\n }\n\n // Handle -= for regular variables\n if (op === SyntaxKind.MinusEqualsToken && left.kind !== SyntaxKind.ElementAccessExpression) {\n const leftText = this.printNode(left, 0);\n const rightText = this.printNode(right, 0);\n return `${leftText} = subtract(&${leftText}, &${rightText})`;\n }\n\n // Binary wrapper functions (is_equal, add, etc.) - add & to both sides\n if (op in this.binaryExpressionsWrappers) {\n const [fnName, close] = this.binaryExpressionsWrappers[op];\n const leftText = this.printNode(left, 0);\n const rightText = this.printNode(right, 0);\n const leftRef = this.ensureRef(leftText);\n const rightRef = this.ensureRef(rightText);\n return `${fnName}${leftRef}, ${rightRef}${close}`;\n }\n\n return undefined;\n }\n\n printBinaryExpression(node, identation) {\n const custom = this.printCustomBinaryExpressionIfAny(node, identation);\n if (custom) {\n return custom;\n }\n return 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\n // (`pad_start` / `pad_end` take `(&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 isNew = declaration.initializer && declaration.initializer.kind === SyntaxKind.NewExpression;\n\n if (declaration?.name.kind === SyntaxKind.ArrayBindingPattern) {\n const elements = declaration.name.elements;\n const parsedElements = elements.map(e => this.printNode(e.name, 0));\n const syntheticName = parsedElements.join('') + 'Variable';\n let stmt = `${this.getIden(identation)}let mut ${syntheticName} = ${this.printNode(declaration.initializer, 0)};\\n`;\n parsedElements.forEach((e, idx) => {\n const line = `${this.getIden(identation)}let mut ${e}: Value = get_value(&${syntheticName}, &Value::Int(${idx}))`;\n stmt += idx < parsedElements.length - 1 ? line + ';\\n' : line;\n });\n return stmt;\n }\n\n const varName = this.printNode(declaration.name, 0);\n\n if (!declaration.initializer) {\n return `${this.getIden(identation)}let mut ${varName}: Value = Value::Null`;\n }\n\n const parsedValue = this.printNode(declaration.initializer, identation).trim();\n\n if (isNew) {\n return `${this.getIden(identation)}let mut ${varName} = ${parsedValue}`;\n }\n\n return `${this.getIden(identation)}let mut ${varName}: Value = ${parsedValue}`;\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 const propDecls = node.members.filter(m => m.kind === SyntaxKind.PropertyDeclaration);\n return propDecls.map(p => {\n const name = this.printNode(p.name, 0);\n const init = p.initializer ? this.printNode(p.initializer, 0) : 'Value::Null';\n return { name, init };\n });\n }\n\n printStruct(node, identation) {\n const fields = this.getStructFields(node);\n const fieldLines = fields.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 fields = this.getStructFields(node);\n const fieldInits = fields.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.className = node.name.escapedText;\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 => {\n const name = (method as any).name.escapedText;\n const params = (method as any).parameters;\n const requiredCount = params.filter(p => !p.initializer && !p.questionToken).length;\n const hasOptional = params.some(p => p.initializer !== undefined || p.questionToken !== undefined);\n if (hasOptional) {\n this.methodSignatures[name] = { requiredCount };\n }\n });\n\n const struct = this.printStruct(node, identation);\n const newMethod = this.printNewMethod(node, identation);\n\n const classMethods = methods.map(m => this.printMethodDeclaration(m, identation)).join('\\n\\n');\n\n const implBlock = `\\nimpl ${this.className} {\\n${classMethods}\\n}`;\n\n return struct + newMethod + implBlock;\n }\n\n printMethodDefinition(node, identation) {\n const name = (node.name as any).escapedText;\n const params = node.parameters;\n const hasOptional = params.some(p => p.initializer !== undefined || p.questionToken !== undefined);\n\n const requiredParams = params.filter(p => !p.initializer && !p.questionToken);\n const optionalParams = params.filter(p => p.initializer !== undefined || p.questionToken !== undefined);\n\n let parsedArgs = '&self';\n if (requiredParams.length > 0) {\n const reqArgs = requiredParams.map(p => `${this.printNode(p.name, 0)}: Value`).join(', ');\n parsedArgs += ', ' + reqArgs;\n }\n if (hasOptional) {\n parsedArgs += ', optional_args: &[Value]';\n }\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 try {\n const type = this.getChecker().getReturnTypeOfSignature(this.getChecker().getSignatureFromDeclaration(node));\n if (type.flags === ts.TypeFlags.Void) {\n return '';\n }\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 let optionalInits = '';\n if (optionalParams.length > 0) {\n const requiredCount = params.filter(p => !p.initializer && !p.questionToken).length;\n optionalInits = optionalParams.map((p, idx) => {\n const pname = this.printNode(p.name, 0);\n const defaultVal = p.initializer ? this.printNode(p.initializer, 0) : 'Value::Null';\n return `${this.getIden(identation + 2)}let ${pname} = get_arg(optional_args, ${idx}, ${defaultVal});`;\n }).join('\\n') + '\\n';\n }\n\n const blockOpen = this.getBlockOpen(identation);\n const blockClose = this.getBlockClose(identation);\n const statements = node.body.statements.map(s => this.printNode(s, identation + 2)).join('\\n');\n const body = blockOpen + optionalInits + statements + blockClose;\n\n return this.printNodeCommentsIfAny(node, identation, methodDef + body);\n }\n\n printFunctionDefinition(node, identation) {\n const name = node.name?.escapedText ?? '';\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 (ts.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.escapedText;\n const sig = this.methodSignatures[methodName];\n if (sig) {\n const requiredArgs = args.slice(0, sig.requiredCount).map(a => this.printNode(a, 0)).join(', ');\n const optionalArgsList = args.slice(sig.requiredCount).map(a => this.printNode(a, 0)).join(', ');\n const optSlice = optionalArgsList ? `&[${optionalArgsList}]` : '&[]';\n const reqPart = requiredArgs ? `${requiredArgs}, ` : '';\n return `self.${methodName}(${reqPart}${optSlice})`;\n }\n }\n\n return undefined;\n }\n\n printCallExpression(node, identation) {\n const expression = node.expression;\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 const ref = argText.startsWith('Value::') ? `&${argText}` :\n argText.startsWith('&') ? argText : `&${argText}`;\n return `println_val(${ref})`;\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) return outOfOrder;\n\n return super.printCallExpression(node, identation);\n }\n\n printThisKeyword(node, identation) {\n return 'self';\n }\n\n printNewExpression(node, identation) {\n let expression = node.expression?.escapedText;\n expression = expression ? expression : this.printNode(node.expression);\n const args = node.arguments.map(a => this.printNode(a, identation)).join(', ');\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 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 = expression\n .replace(/([A-Z]+)([A-Z][a-z])/g, '$1_$2')\n .replace(/([a-z\\d])([A-Z])/g, '$1_$2')\n .toLowerCase();\n return `crate::exchange_errors::${snake}(${args})`;\n }\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.escapedText;\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 `get_array_length(&${leftExpr})`;\n }\n\n return `${leftExpr}.${rightSide}`;\n }\n\n transformPropertyAcessExpressionIfNeeded(node) {\n const rightSide = node.name.escapedText;\n const leftExpr = this.printNode(node.expression, 0);\n if (rightSide === 'length') {\n return `get_array_length(&${leftExpr})`;\n }\n return undefined;\n }\n\n printElementAccessExpression(node, identation) {\n const special = this.printElementAccessExpressionExceptionIfAny(node);\n if (special) return special;\n\n const keys: any[] = [];\n let baseExpr = null;\n let current: any = node;\n while (ts.isElementAccessExpression(current)) {\n keys.unshift(current.argumentExpression);\n const expr = current.expression;\n if (!ts.isElementAccessExpression(expr)) {\n baseExpr = expr;\n break;\n }\n current = expr;\n }\n\n const containerStr = this.printNode(baseExpr, 0);\n const keyStrs = keys.map(k => this.printNode(k, 0));\n\n let acc = containerStr;\n keyStrs.forEach(k => {\n const kRef = k.startsWith('Value::') ? `&${k}` : `&${k}`;\n acc = `get_value(&${acc}, ${kRef})`;\n });\n return acc;\n }\n\n printForStatement(node, identation) {\n const initNode = node.initializer;\n const condNode = node.condition;\n const incrNode = node.incrementor;\n\n const idn = this.getIden(identation);\n const idn1 = this.getIden(identation + 1);\n\n const initStr = initNode ? this.printNode(initNode, identation + 1) + ';\\n' : '';\n const condStr = condNode ? this.printNode(condNode, 0) : 'true';\n const incrStr = incrNode ? this.printNode(incrNode, 0) : '';\n\n const statements = node.statement.statements.map(s => this.printNode(s, identation + 1)).join('\\n');\n const body = `{\\n${statements}\\n${idn}}`;\n\n // A C-style `for` becomes a Rust `while`. The increment must run on\n // every iteration *including* one ended by `continue` — a `continue`\n // re-evaluates the loop condition, so the increment is folded into\n // it (guarded by a first-iteration flag). Putting the increment at\n // the end of the body instead would let `continue` skip it and spin\n // 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,\n SyntaxKind.EqualsEqualsEqualsToken,\n SyntaxKind.ExclamationEqualsToken,\n SyntaxKind.ExclamationEqualsEqualsToken,\n SyntaxKind.LessThanToken,\n SyntaxKind.LessThanEqualsToken,\n SyntaxKind.GreaterThanToken,\n SyntaxKind.GreaterThanEqualsToken,\n ]);\n\n printCondition(node, 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 as any).COMPARISON_OPS.has(opKind)) {\n return `${this.getIden(identation)}${this.printNode(node, 0)}`;\n }\n // Logical &&/|| operands are individually is_true()-wrapped in\n // printBinaryExpression, so the whole expression is already bool.\n if (opKind === SyntaxKind.AmpersandAmpersandToken ||\n opKind === SyntaxKind.BarBarToken) {\n return `${this.getIden(identation)}${this.printNode(node, 0)}`;\n }\n }\n // PrefixUnary ! — delegate to avoid double-wrapping\n if (node.kind === SyntaxKind.PrefixUnaryExpression &&\n node.operator === SyntaxKind.ExclamationToken) {\n return this.printPrefixUnaryExpression(node, identation);\n }\n const expression = this.printNode(node, 0);\n return `${this.getIden(identation)}is_true(&${expression})`;\n }\n\n printWhileStatement(node, identation) {\n const expr = this.printCondition(node.expression, 0);\n const body = this.printBlock(node.statement, identation);\n return `${this.getIden(identation)}while ${expr}${body}`;\n }\n\n printIfStatement(node, identation) {\n const expression = this.printCondition(node.expression, 0);\n const elseExists = node.elseStatement !== undefined;\n const ifBody = this.printBlock(node.thenStatement, identation, elseExists);\n\n let ifComplete = `${expression}${ifBody}`;\n const isElseIf = node.parent.kind === SyntaxKind.IfStatement;\n if (isElseIf) {\n ifComplete = `else if ${ifComplete}`;\n } else {\n ifComplete = `${this.getIden(identation)}if ${ifComplete}`;\n }\n\n const elseStatement = node.elseStatement;\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 operandText = this.printNode(operand, 0);\n if (operator === SyntaxKind.PlusPlusToken) {\n return `${this.getIden(identation)}${operandText} = add(&${operandText}, &Value::Int(1))`;\n }\n if (operator === SyntaxKind.MinusMinusToken) {\n return `${this.getIden(identation)}${operandText} = subtract(&${operandText}, &Value::Int(1))`;\n }\n return super.printPostFixUnaryExpression(node, identation);\n }\n\n printPrefixUnaryExpression(node, identation) {\n const { operand, operator } = node;\n if (operator === SyntaxKind.ExclamationToken) {\n return this.getIden(identation) + '!' + this.printCondition(node.operand, 0);\n }\n if (operator === SyntaxKind.MinusToken) {\n return this.getIden(identation) + `negate(&${this.printNode(operand, 0)})`;\n }\n return this.getIden(identation) + this.PrefixFixOperators[operator] + this.printNode(operand, 0);\n }\n\n printObjectLiteralExpression(node, identation) {\n if (node.properties.length === 0) {\n return 'Value::Map({\\n' + this.getIden(identation + 1) + 'let mut m = std::collections::HashMap::new();\\n' + this.getIden(identation + 1) + 'm\\n' + this.getIden(identation) + '})';\n }\n const escapeKey = (s: any): string => {\n return String(s).replace(/\\\\/g, '\\\\\\\\').replace(/\"/g, '\\\\\"').replace(/\\n/g, '\\\\n').replace(/\\r/g, '\\\\r').replace(/\\t/g, '\\\\t');\n };\n const lines = node.properties.map(p => {\n // Shorthand: { foo } → m.insert(\"foo\", foo.clone());\n if (ts.isShorthandPropertyAssignment(p)) {\n const name = p.name.escapedText;\n return `${this.getIden(identation + 2)}m.insert(\"${escapeKey(name)}\".to_string(), ${name}.clone());`;\n }\n const { name, initializer } = p;\n const keyText = ts.isStringLiteral(name) ? name.text : name.escapedText;\n const valText = this.printNode(initializer, 0);\n return `${this.getIden(identation + 2)}m.insert(\"${escapeKey(keyText)}\".to_string(), ${valText});`;\n }).join('\\n');\n return `Value::Map({\\n${this.getIden(identation + 1)}let mut m = std::collections::HashMap::new();\\n${lines}\\n${this.getIden(identation + 1)}m\\n${this.getIden(identation)}})`;\n }\n\n printArrayLiteralExpression(node, identation) {\n const elements = node.elements.map(e => this.printNode(e, 0)).join(', ');\n return `Value::List(vec![${elements}])`;\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 const keyRef = key.startsWith('Value::') ? `&${key}` : `&${key}`;\n return `remove(&mut ${object}, ${keyRef})`;\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)}is_instance(&${left}, &${right})`;\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 `ternary(${condition}, ${whenTrue}, ${whenFalse})`;\n }\n\n // Built-in method call overrides\n printArrayIsArrayCall(node, identation, parsedArg = undefined) {\n return `Value::Bool(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 printPromiseAllCall(node, identation, parsedArg = undefined) {\n // No trailing `.await` here — when the TS source has\n // `await Promise.all(...)`, `printAwaitExpression` will append it.\n // Adding it here too would produce `.await.await` (double-await).\n return `promise_all(&${parsedArg})`;\n }\n\n // Rust uses postfix `.await`; the base transpiler defaults to prefix.\n printAwaitExpression(node, identation) {\n const expr = this.printNode(node.expression, identation);\n return `${expr}.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 const pRef = parsedArg?.startsWith('Value::') ? `&${parsedArg}` : `&${parsedArg}`;\n return `Value::Bool(contains(&${name}, ${pRef}))`;\n }\n\n printIndexOfCall(node, identation, name = undefined, parsedArg = undefined) {\n return `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 const arg2 = parsedArg2 ?? 'Value::Null';\n return `slice(&${name}, &${parsedArg}, &${arg2})`;\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 printThrowStatement(node, identation) {\n const expression = this.printNode(node.expression, 0);\n // `{}` (Display) renders an ExchangeError as `[Kind] message`;\n // `{:?}` would dump the struct fields.\n return `${this.getIden(identation)}panic!(\"{}\", ${expression});`;\n }\n\n printTryStatement(node, identation) {\n const tryBody = node.tryBlock.statements.map(s => this.printNode(s, identation + 1)).join('\\n');\n const catchBody = node.catchClause.block.statements.map(s => this.printNode(s, identation + 1)).join('\\n');\n const rawName = node.catchClause?.variableDeclaration?.name?.escapedText;\n const errorName = rawName ? `_${rawName}` : '_e';\n const iden = this.getIden(identation);\n return `${iden}let _try_result = std::panic::catch_unwind(std::panic::AssertUnwindSafe(|| {\\n${tryBody}\\n${iden}}));\\n${iden}if let Err(${errorName}) = _try_result {\\n${catchBody}\\n${iden}}`;\n }\n\n printReturnStatement(node, identation) {\n const exp = node.expression;\n if (!exp) {\n return `${this.getIden(identation)}return;`;\n }\n const rightPart = this.printNode(exp, 0).trim();\n return `${this.getIden(identation)}return ${rightPart};`;\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 const expression = this.printNode(node.expression, 0);\n return `${this.getIden(identation)}${expression}`;\n }\n}\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;AAAA;AAAA;AACA,WAAO,UAAU;AAAA;AAAA;;;ACDjB;AACA,qBAAwB;AADxB,OAAOA,SAAQ;;;ACAf;;;ACAA;AAAA,OAAO,QAAQ;;;ACAf;AAgFA,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;;;ACvFA;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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wB;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;AACJ;","names":["ts","defaultValue","type","node","namedExports","ts","ts","SyntaxKind","ts","parserConfig","ts","parserConfig","symbol","defaultValue","path","ts","SyntaxKind","parserConfig","ts","parserConfig","ts","SyntaxKind","parserConfig","name","currentPath","ts","sourceFile","path"]} \ No newline at end of file diff --git a/src/transpiler.ts b/src/transpiler.ts index 3b5b4a6..43a6098 100644 --- a/src/transpiler.ts +++ b/src/transpiler.ts @@ -284,6 +284,30 @@ export default class Transpiler { }); } + // One program over N root files, instead of one program per file. Every + // transpile*ByPath call pays for a full program: even with the SourceFile cache + // making the ~340-file import closure parse-free, the binder/checker work behind + // getPreEmitDiagnostics is redone per file. Batching N files into one program + // pays it once for the whole set. + // + // Files that import each other (a derived exchange and its parent) are fine in + // one batch — they are separate root files of the same program, exactly as + // typescript would compile a project. + // + // The batch deliberately does not become the cache's byPathOldProgram: an N-file + // program never structurally reuses a program built from a different root set, so + // there is nothing to gain, and keeping the previous chunk's checker alive while + // the next one is built would double peak memory — the opposite of why callers + // chunk. The cross-batch saving comes from the shared host + SourceFile cache. + createProgramBatch(paths: string[]): TranspileProgramBatch { + const options: ts.CompilerOptions = fastCompilerOptions; + const host = this.getByPathCompilerHost(options); + const program = ts.createProgram([...paths, globalsShimPath], options, host); + const checker = program.getTypeChecker(); + memoizeCheckerCalls(checker); + return new TranspileProgramBatch(this, program, checker); + } + // the language printers read the typescript state (source file, checker, program) // off the context handed to them here, so two Transpiler instances never share // state and a nested transpile can restore whatever its caller was working on @@ -536,6 +560,78 @@ export default class Transpiler { } } +// A set of root files compiled as one typescript program, transpiled one at a time. +// Obtained from Transpiler.createProgramBatch; mirrors the transpile*ByPath methods +// of the Transpiler it came from, so a caller batches by replacing +// for (const f of files) transpiler.transpileGoByPath(f) +// with +// const batch = transpiler.createProgramBatch(files); +// for (const f of files) batch.transpileGoByPath(f) +// +// A failing file throws out of its own call and leaves the batch usable: the context +// is rebuilt from the program on every call, so the caller can try/catch per file and +// keep going. The batch borrows the Transpiler's printers and context, so do not +// drive that Transpiler through another path while a batch loop is in flight — use +// cloneSharingProgramCache() for a second, independent driver. +class TranspileProgramBatch { + private readonly transpiler: Transpiler; + private readonly program: ts.Program; + private readonly checker: ts.TypeChecker; + + constructor(transpiler: Transpiler, program: ts.Program, checker: ts.TypeChecker) { + this.transpiler = transpiler; + this.program = program; + this.checker = checker; + } + + getProgram(): ts.Program { + return this.program; + } + + // point the owning Transpiler at one file of this batch, then run the same + // diagnostics pass the single-file path runs — the printers read checker state + // back from it, so it is not optional + setContextForPath(filePath: string): ITranspileContext { + const src = this.program.getSourceFile(filePath) ?? this.program.getSourceFile(path.resolve(filePath)); + if (src === undefined) { + throw new Error(`ast-transpiler: "${filePath}" is not a file of this program batch`); + } + const context = this.transpiler.setContext({ src, checker: this.checker, program: this.program }); + this.transpiler.checkFileDiagnostics(context); + return context; + } + + transpileByPath(lang: Languages, filePath: string, sync = false): ITranspiledFile { + this.setContextForPath(filePath); + return this.transpiler.transpile(lang, TranspilationMode.ByPath, filePath, sync, false); + } + + transpilePythonByPath(filePath: string): ITranspiledFile { + return this.transpileByPath(Languages.Python, filePath, !this.transpiler.pythonTranspiler.asyncTranspiling); + } + + transpilePhpByPath(filePath: string): ITranspiledFile { + return this.transpileByPath(Languages.Php, filePath, !this.transpiler.phpTranspiler.asyncTranspiling); + } + + transpileCSharpByPath(filePath: string): ITranspiledFile { + return this.transpileByPath(Languages.CSharp, filePath); + } + + transpileGoByPath(filePath: string): ITranspiledFile { + return this.transpileByPath(Languages.Go, filePath); + } + + transpileJavaByPath(filePath: string): ITranspiledFile { + return this.transpileByPath(Languages.Java, filePath); + } + + transpileRustByPath(filePath: string): ITranspiledFile { + return this.transpileByPath(Languages.Rust, filePath); + } +} + export { - Transpiler + Transpiler, + TranspileProgramBatch }; diff --git a/tests/createProgramBatch.test.ts b/tests/createProgramBatch.test.ts new file mode 100644 index 0000000..2dd6eba --- /dev/null +++ b/tests/createProgramBatch.test.ts @@ -0,0 +1,88 @@ +import { Transpiler } from '../src/transpiler'; +import fs from 'fs'; +import path from 'path'; + +const config = { + 'verbose': false, + 'python': { + 'parser': { + 'NUM_LINES_END_FILE': 0 + } + } +}; + +const TMP = path.join(__dirname, 'files', 'tmp-batch'); + +function writeFixture (name: string, content: string): string { + const p = path.join(TMP, name); + fs.writeFileSync(p, content); + return p; +} + +describe('createProgramBatch', () => { + + beforeAll(() => { + fs.mkdirSync(TMP, { recursive: true }); + }); + + afterAll(() => { + fs.rmSync(TMP, { recursive: true, force: true }); + }); + + test('a batch emits exactly what the per-file path emits', () => { + const a = writeFixture('alpha.ts', 'const alpha = 1;\n'); + const b = writeFixture('beta.ts', 'const beta = 2;\n'); + const c = writeFixture('gamma.ts', 'const gamma = 3;\n'); + const files = [ a, b, c ]; + + const perFile = new Transpiler(config); + const expected = files.map ((f) => perFile.transpilePythonByPath(f).content); + + const batched = new Transpiler(config); + const batch = batched.createProgramBatch(files); + const actual = files.map ((f) => batch.transpilePythonByPath(f).content); + + expect(actual).toEqual(expected); + expect(actual).toEqual([ 'alpha = 1', 'beta = 2', 'gamma = 3' ]); + }); + + test('all root files of the batch live in one program', () => { + const a = writeFixture('one.ts', 'const one = 1;\n'); + const b = writeFixture('two.ts', 'const two = 2;\n'); + + const transpiler = new Transpiler(config); + const batch = transpiler.createProgramBatch([ a, b ]); + const program = batch.getProgram(); + + expect(program.getSourceFile(path.resolve(a))).toBeDefined(); + expect(program.getSourceFile(path.resolve(b))).toBeDefined(); + }); + + test('a file that is not a root of the batch throws, and the batch stays usable', () => { + const a = writeFixture('kept.ts', 'const kept = 1;\n'); + const b = writeFixture('survivor.ts', 'const survivor = 2;\n'); + + const transpiler = new Transpiler(config); + const batch = transpiler.createProgramBatch([ a, b ]); + + expect(() => batch.transpilePythonByPath('./does/not/exist.ts')).toThrow(); + // the context is rebuilt per call, so one bad file does not poison the batch + expect(batch.transpilePythonByPath(b).content).toBe('survivor = 2'); + expect(batch.transpilePythonByPath(a).content).toBe('kept = 1'); + }); + + test('the batch does not become the cache byPathOldProgram, and single-file transpiles still work after it', () => { + const a = writeFixture('batched.ts', 'const batched = 1;\n'); + const b = writeFixture('single.ts', 'const single = 2;\n'); + + const cache = Transpiler.createProgramCache(); + const transpiler = new Transpiler(config, cache); + + const batch = transpiler.createProgramBatch([ a ]); + expect(batch.transpilePythonByPath(a).content).toBe('batched = 1'); + expect(cache.byPathOldProgram).not.toBe(batch.getProgram()); + + // the shared host + SourceFile cache survive, so the single-file path keeps working + expect(transpiler.transpilePythonByPath(b).content).toBe('single = 2'); + }); +});