Add Impl postfix to procs duplicating methods

This commit is contained in:
Ruslan Mustakov 2017-07-28 18:09:55 +07:00
commit bc7d12d780

View file

@ -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)