Properly guard access to NimCompilerApiVersion.

Makes master compile on latest released Nim 0.18.0.
This commit is contained in:
Sebastien Braun 2018-09-15 21:36:33 +02:00
commit 964af450dd

View file

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