fixes #1989
This commit is contained in:
parent
a6082b2a20
commit
903ca78289
2 changed files with 6 additions and 3 deletions
|
|
@ -1364,9 +1364,11 @@ var
|
||||||
globalCtx: PCtx
|
globalCtx: PCtx
|
||||||
|
|
||||||
proc setupGlobalCtx(module: PSym) =
|
proc setupGlobalCtx(module: PSym) =
|
||||||
if globalCtx.isNil: globalCtx = newCtx(module)
|
if globalCtx.isNil:
|
||||||
else: refresh(globalCtx, module)
|
globalCtx = newCtx(module)
|
||||||
registerAdditionalOps(globalCtx)
|
registerAdditionalOps(globalCtx)
|
||||||
|
else:
|
||||||
|
refresh(globalCtx, module)
|
||||||
|
|
||||||
proc myOpen(module: PSym): PPassContext =
|
proc myOpen(module: PSym): PPassContext =
|
||||||
#var c = newEvalContext(module, emRepl)
|
#var c = newEvalContext(module, emRepl)
|
||||||
|
|
|
||||||
|
|
@ -213,6 +213,7 @@ proc newCtx*(module: PSym): PCtx =
|
||||||
proc refresh*(c: PCtx, module: PSym) =
|
proc refresh*(c: PCtx, module: PSym) =
|
||||||
c.module = module
|
c.module = module
|
||||||
c.prc = PProc(blocks: @[])
|
c.prc = PProc(blocks: @[])
|
||||||
|
c.loopIterations = MaxLoopIterations
|
||||||
|
|
||||||
proc registerCallback*(c: PCtx; name: string; callback: VmCallback) =
|
proc registerCallback*(c: PCtx; name: string; callback: VmCallback) =
|
||||||
c.callbacks.add((name, callback))
|
c.callbacks.add((name, callback))
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue