From bc7d12d78058b6370e3abc8c499ae4924d0b6239 Mon Sep 17 00:00:00 2001 From: Ruslan Mustakov Date: Fri, 28 Jul 2017 18:09:55 +0700 Subject: [PATCH] Add Impl postfix to procs duplicating methods --- godot/apigen/apigen.nim | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/godot/apigen/apigen.nim b/godot/apigen/apigen.nim index 4b9ec5b..295fd58 100644 --- a/godot/apigen/apigen.nim +++ b/godot/apigen/apigen.nim @@ -604,7 +604,8 @@ proc doGenerateMethod(tree: PNode, methodBindRegistry: var HashSet[string], proc generateMethod(tree: PNode, methodBindRegistry: var HashSet[string], name: PNode, godotMethodName: string, typ: GodotType, args: seq[MethodArg], - returnType: string, isVirtual, isBase, withImplementation: bool) = + returnType: string, + isVirtual, isBase, withImplementation: bool) = doGenerateMethod( tree, methodBindRegistry, name, godotMethodName, typ, args, returnType, isVirtual, isBase, withImplementation) @@ -666,8 +667,14 @@ proc makeMethod(types: Table[string, GodotType], tree: PNode, args.add(("variantArgs", "Variant", JsonNode(nil), true)) let godotName = methodObj["name"].str + var nimName = toNimStyle(godotName) + if not godotName.startsWith('_'): + for meth in typ.jsonNode["methods"]: + if meth["name"].str == '_' & godotName: + nimName = nimName & "Impl" + generateMethod(tree, methodBindRegistry, - ident(toNimStyle(godotName)), methodObj["name"].str, + ident(nimName), methodObj["name"].str, typ, args, returnType, methodObj["is_virtual"].bval, isBase, withImplementation)