make Nimble compile with the changed compiler API
This commit is contained in:
parent
e3682c96b3
commit
4ce6f2b395
1 changed files with 14 additions and 5 deletions
|
|
@ -8,10 +8,9 @@ import
|
||||||
compiler/ast, compiler/modules, compiler/passes, compiler/passaux,
|
compiler/ast, compiler/modules, compiler/passes, compiler/passaux,
|
||||||
compiler/condsyms, compiler/sem, compiler/semdata,
|
compiler/condsyms, compiler/sem, compiler/semdata,
|
||||||
compiler/llstream, compiler/vm, compiler/vmdef, compiler/commands,
|
compiler/llstream, compiler/vm, compiler/vmdef, compiler/commands,
|
||||||
compiler/msgs, compiler/magicsys, compiler/lists
|
compiler/msgs, compiler/magicsys, compiler/lists, compiler/idents
|
||||||
|
|
||||||
from compiler/scriptconfig import setupVM
|
from compiler/scriptconfig import setupVM
|
||||||
from compiler/idents import getIdent
|
|
||||||
from compiler/astalgo import strTableGet
|
from compiler/astalgo import strTableGet
|
||||||
import compiler/options as compiler_options
|
import compiler/options as compiler_options
|
||||||
|
|
||||||
|
|
@ -67,6 +66,9 @@ proc extractRequires(ident: PSym, result: var seq[PkgTuple]) =
|
||||||
else:
|
else:
|
||||||
raiseVariableError("requiresData", "seq[(string, VersionReq)]")
|
raiseVariableError("requiresData", "seq[(string, VersionReq)]")
|
||||||
|
|
||||||
|
when declared(newIdentCache):
|
||||||
|
var identCache = newIdentCache()
|
||||||
|
|
||||||
proc setupVM(module: PSym; scriptName: string,
|
proc setupVM(module: PSym; scriptName: string,
|
||||||
flags: StringTableRef): PEvalContext =
|
flags: StringTableRef): PEvalContext =
|
||||||
## This procedure is exported in the compiler sources, but its implementation
|
## This procedure is exported in the compiler sources, but its implementation
|
||||||
|
|
@ -74,6 +76,9 @@ proc setupVM(module: PSym; scriptName: string,
|
||||||
## Specifically, the implementation of ``switch`` is problematic. Sooo
|
## Specifically, the implementation of ``switch`` is problematic. Sooo
|
||||||
## I simply copied it here and edited it :)
|
## I simply copied it here and edited it :)
|
||||||
|
|
||||||
|
when declared(newIdentCache):
|
||||||
|
result = newCtx(module, identCache)
|
||||||
|
else:
|
||||||
result = newCtx(module)
|
result = newCtx(module)
|
||||||
result.mode = emRepl
|
result.mode = emRepl
|
||||||
registerAdditionalOps(result)
|
registerAdditionalOps(result)
|
||||||
|
|
@ -236,6 +241,10 @@ proc execScript(scriptName: string, flags: StringTableRef, options: Options) =
|
||||||
cbApi getPkgDir:
|
cbApi getPkgDir:
|
||||||
setResult(a, scriptName.splitFile.dir)
|
setResult(a, scriptName.splitFile.dir)
|
||||||
|
|
||||||
|
when declared(newIdentCache):
|
||||||
|
compileSystemModule(identCache)
|
||||||
|
processModule(m, llStreamOpen(scriptName, fmRead), nil, identCache)
|
||||||
|
else:
|
||||||
compileSystemModule()
|
compileSystemModule()
|
||||||
processModule(m, llStreamOpen(scriptName, fmRead), nil)
|
processModule(m, llStreamOpen(scriptName, fmRead), nil)
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue