add gensym in hygienic template fix thanks to demotohiro (#55)
Add gensym in hygienic template fix thanks to demotohiro
This commit is contained in:
parent
d1b82d351c
commit
157a90e4a0
1 changed files with 6 additions and 6 deletions
|
|
@ -396,10 +396,9 @@ template registerGodotField(classNameLit, classNameIdent, propNameLit,
|
||||||
getFunc: getFuncIdent
|
getFunc: getFuncIdent
|
||||||
)
|
)
|
||||||
mixin godotTypeInfo
|
mixin godotTypeInfo
|
||||||
static:
|
const typeInfo = when compiles(godotTypeInfo(propTypeIdent)):
|
||||||
var typeInfo: GodotTypeInfo
|
godotTypeInfo(propTypeIdent)
|
||||||
when compiles(godotTypeInfo(propTypeIdent)):
|
else: GodotTypeInfo()
|
||||||
typeInfo = godotTypeInfo(propTypeIdent)
|
|
||||||
const hintStr = when hintStrLit != "NIM":
|
const hintStr = when hintStrLit != "NIM":
|
||||||
hintStrLit
|
hintStrLit
|
||||||
else:
|
else:
|
||||||
|
|
@ -455,7 +454,8 @@ proc genType(obj: ObjectDecl): NimNode {.compileTime.} =
|
||||||
let initBody = newStmtList()
|
let initBody = newStmtList()
|
||||||
for decl in obj.fields:
|
for decl in obj.fields:
|
||||||
if not decl.defaultValue.isNil and decl.defaultValue.kind != nnkEmpty:
|
if not decl.defaultValue.isNil and decl.defaultValue.kind != nnkEmpty:
|
||||||
initBody.add(newNimNode(nnkAsgn).add(newDotExpr(ident("self"), decl.name), decl.defaultValue))
|
initBody.add(newNimNode(nnkAsgn).add(newDotExpr(ident("self"), decl.name),
|
||||||
|
decl.defaultValue))
|
||||||
let name = if not decl.isExported: decl.name
|
let name = if not decl.isExported: decl.name
|
||||||
else: postfix(decl.name, "*")
|
else: postfix(decl.name, "*")
|
||||||
recList.add(newIdentDefs(name, decl.typ))
|
recList.add(newIdentDefs(name, decl.typ))
|
||||||
|
|
@ -605,7 +605,7 @@ N_NOINLINE(void, setStackBottom)(void* thestackbottom);
|
||||||
else: toGodotStyle(meth.name)
|
else: toGodotStyle(meth.name)
|
||||||
let hasReturnValueBool = not (meth.returnType.isNil or
|
let hasReturnValueBool = not (meth.returnType.isNil or
|
||||||
meth.returnType.kind == nnkEmpty or
|
meth.returnType.kind == nnkEmpty or
|
||||||
(meth.returnType.kind == nnkIdent and
|
(meth.returnType.kind == nnkIdent and
|
||||||
meth.returnType.strVal == "void"))
|
meth.returnType.strVal == "void"))
|
||||||
let hasReturnValue = if hasReturnValueBool: ident("true")
|
let hasReturnValue = if hasReturnValueBool: ident("true")
|
||||||
else: ident("false")
|
else: ident("false")
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue