workaround for nim/macro/typedesc issue
This commit is contained in:
parent
5ab4775939
commit
a536c102d6
1 changed files with 14 additions and 17 deletions
|
|
@ -343,8 +343,7 @@ proc newRStrLit(s: string): NimNode {.compileTime.} =
|
||||||
result = newNimNode(nnkRStrLit)
|
result = newNimNode(nnkRStrLit)
|
||||||
result.strVal = s
|
result.strVal = s
|
||||||
|
|
||||||
macro toGodotName(T: typedesc): string =
|
proc toGodotName(T: typedesc): string =
|
||||||
var godotName =
|
|
||||||
if T is GodotString or T is string:
|
if T is GodotString or T is string:
|
||||||
"String"
|
"String"
|
||||||
elif T is SomeFloat:
|
elif T is SomeFloat:
|
||||||
|
|
@ -359,8 +358,6 @@ macro toGodotName(T: typedesc): string =
|
||||||
else:
|
else:
|
||||||
nameStr
|
nameStr
|
||||||
|
|
||||||
result = newLit(godotName)
|
|
||||||
|
|
||||||
macro asCString(s: static[string]): cstring =
|
macro asCString(s: static[string]): cstring =
|
||||||
result = newNimNode(nnkCallStrLit).add(
|
result = newNimNode(nnkCallStrLit).add(
|
||||||
ident("cstring"), newRStrLit(s))
|
ident("cstring"), newRStrLit(s))
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue