From 3f5f5649eb852a5e0a0aebb568afb67547ec02c8 Mon Sep 17 00:00:00 2001 From: carlosmiei <43336371+carlosmiei@users.noreply.github.com> Date: Wed, 18 Sep 2024 11:53:18 +0100 Subject: [PATCH] fix independent functionCalls --- src/goTranspiler.ts | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/goTranspiler.ts b/src/goTranspiler.ts index 71949d7..706c73f 100644 --- a/src/goTranspiler.ts +++ b/src/goTranspiler.ts @@ -51,7 +51,7 @@ const parserConfig = { 'INDEXOF_WRAPPER_CLOSE': ')', 'MOD_WRAPPER_OPEN': 'Mod(', 'MOD_WRAPPER_CLOSE': ')', - 'FUNCTION_TOKEN': '', + 'FUNCTION_TOKEN': 'func', 'DEFAULT_RETURN_TYPE': 'interface{}', 'BLOCK_OPENING_TOKEN': '{', 'DEFAULT_PARAMETER_TYPE': 'interface{}', @@ -175,6 +175,9 @@ export class GoTranspiler extends BaseTranspiler { return token + text + token; } + transformFunctionNameIfNeeded(name): string { + return this.capitalize(name); + } printPropertyDeclaration(node, identation) { // let modifiers = this.printModifiers(node); @@ -1326,7 +1329,6 @@ ${this.getIden(identation)}}`; const newToken = this.NEW_TOKEN ? this.NEW_TOKEN + " " : ""; return newToken + expression + this.LEFT_PARENTHESIS + args + this.RIGHT_PARENTHESIS; } - }