diff --git a/src/nimblepkg/nimscriptsupport.nim b/src/nimblepkg/nimscriptsupport.nim index 5fdfaa6..89c23c9 100644 --- a/src/nimblepkg/nimscriptsupport.nim +++ b/src/nimblepkg/nimscriptsupport.nim @@ -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)