aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--nimterop/cimport.nim18
1 files changed, 10 insertions, 8 deletions
diff --git a/nimterop/cimport.nim b/nimterop/cimport.nim
index 298c8a2..6a78b5e 100644
--- a/nimterop/cimport.nim
+++ b/nimterop/cimport.nim
@@ -149,15 +149,17 @@ macro cOverride*(body): untyped =
## can be instructed to skip over ``svGetCallerInfo()``. This works for procs,
## consts and types.
+ proc recFindIdent(node: NimNode): seq[string] =
+ if node.kind != nnkIdent:
+ for child in node:
+ result.add recFindIdent(child)
+ if result.len != 0 and node.kind notin [nnkTypeSection, nnkConstSection]:
+ break
+ elif $node != "*":
+ result.add $node
+
for sym in body:
- case sym.kind:
- of nnkProcDef:
- gStateCT.symOverride.add ($sym[0]).strip(chars={'*'})
- of nnkConstSection, nnkTypeSection:
- for ssym in sym:
- gStateCT.symOverride.add ($ssym[0]).strip(chars={'*'})
- else:
- discard
+ gStateCT.symOverride.add recFindIdent(sym)
result = body