Merge pull request #545 from braunse/master
Properly guard access to NimCompilerApiVersion.
This commit is contained in:
commit
1f79f17de9
1 changed files with 3 additions and 3 deletions
|
|
@ -42,12 +42,12 @@ proc isStrLit(n: PNode): bool = n.kind in {nkStrLit..nkTripleStrLit}
|
|||
|
||||
when declared(NimCompilerApiVersion):
|
||||
const finalApi = NimCompilerApiVersion >= 2
|
||||
|
||||
when NimCompilerApiVersion >= 3:
|
||||
import compiler / pathutils
|
||||
else:
|
||||
const finalApi = false
|
||||
|
||||
when NimCompilerApiVersion >= 3:
|
||||
import compiler / pathutils
|
||||
|
||||
proc getGlobal(g: ModuleGraph; ident: PSym): string =
|
||||
when finalApi:
|
||||
let n = vm.getGlobalValue(PCtx g.vm, ident)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue