preparations for Nimble NimScript integrations; minor cleanups
This commit is contained in:
parent
10a7830ba2
commit
9659540b18
7 changed files with 74 additions and 6 deletions
|
|
@ -92,7 +92,6 @@ proc resetAllModulesHard* =
|
|||
magicsys.resetSysTypes()
|
||||
# XXX
|
||||
#gOwners = @[]
|
||||
#rangeDestructorProc = nil
|
||||
|
||||
proc checkDepMem(fileIdx: int32): TNeedRecompile =
|
||||
template markDirty =
|
||||
|
|
|
|||
|
|
@ -17,5 +17,4 @@ define:useStdoutAsStdmsg
|
|||
|
||||
cs:partial
|
||||
#define:useNodeIds
|
||||
symbol:nimfix
|
||||
#gc:markAndSweep
|
||||
|
|
|
|||
|
|
@ -25,7 +25,8 @@ proc listDirs(a: VmArgs, filter: set[PathComponent]) =
|
|||
if kind in filter: result.add path
|
||||
setResult(a, result)
|
||||
|
||||
proc setupVM(module: PSym; scriptName: string): PEvalContext =
|
||||
proc setupVM*(module: PSym; scriptName: string): PEvalContext =
|
||||
# For Nimble we need to export 'setupVM'.
|
||||
result = newCtx(module)
|
||||
result.mode = emRepl
|
||||
registerAdditionalOps(result)
|
||||
|
|
|
|||
|
|
@ -1401,6 +1401,10 @@ proc evalExpr*(c: PCtx, n: PNode): PNode =
|
|||
assert c.code[start].opcode != opcEof
|
||||
result = execute(c, start)
|
||||
|
||||
proc getGlobalValue*(c: PCtx; s: PSym): PNode =
|
||||
internalAssert s.kind in {skLet, skVar} and sfGlobal in s.flags
|
||||
result = c.globals.sons[s.position-1]
|
||||
|
||||
include vmops
|
||||
|
||||
# for now we share the 'globals' environment. XXX Coming soon: An API for
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue