preparations for Nimble NimScript integrations; minor cleanups

This commit is contained in:
Araq 2015-08-18 14:01:40 +02:00
commit 9659540b18
7 changed files with 74 additions and 6 deletions

View file

@ -92,7 +92,6 @@ proc resetAllModulesHard* =
magicsys.resetSysTypes()
# XXX
#gOwners = @[]
#rangeDestructorProc = nil
proc checkDepMem(fileIdx: int32): TNeedRecompile =
template markDirty =

View file

@ -17,5 +17,4 @@ define:useStdoutAsStdmsg
cs:partial
#define:useNodeIds
symbol:nimfix
#gc:markAndSweep

View file

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

View file

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