make tests green again
This commit is contained in:
parent
90b1030dec
commit
61e1897922
3 changed files with 13 additions and 11 deletions
|
|
@ -73,7 +73,7 @@ proc evalScript*(i: Interpreter; scriptStream: PLLStream = nil) =
|
||||||
|
|
||||||
let s = if scriptStream != nil: scriptStream
|
let s = if scriptStream != nil: scriptStream
|
||||||
else: llStreamOpen(findFile(i.graph.config, i.scriptName), fmRead)
|
else: llStreamOpen(findFile(i.graph.config, i.scriptName), fmRead)
|
||||||
processModule(i.graph, i.mainModule, s, nil, i.graph.cache)
|
processModule(i.graph, i.mainModule, s)
|
||||||
|
|
||||||
proc findNimStdLib*(): string =
|
proc findNimStdLib*(): string =
|
||||||
## Tries to find a path to a valid "system.nim" file.
|
## Tries to find a path to a valid "system.nim" file.
|
||||||
|
|
@ -112,7 +112,7 @@ proc createInterpreter*(scriptName: string;
|
||||||
vm.mode = emRepl
|
vm.mode = emRepl
|
||||||
vm.features = flags
|
vm.features = flags
|
||||||
graph.vm = vm
|
graph.vm = vm
|
||||||
graph.compileSystemModule(cache)
|
graph.compileSystemModule()
|
||||||
result = Interpreter(mainModule: m, graph: graph, scriptName: scriptName)
|
result = Interpreter(mainModule: m, graph: graph, scriptName: scriptName)
|
||||||
|
|
||||||
proc destroyInterpreter*(i: Interpreter) =
|
proc destroyInterpreter*(i: Interpreter) =
|
||||||
|
|
|
||||||
|
|
@ -1771,12 +1771,14 @@ proc semStaticStmt(c: PContext, n: PNode): PNode =
|
||||||
inc c.inStaticContext
|
inc c.inStaticContext
|
||||||
let a = semStmt(c, n.sons[0])
|
let a = semStmt(c, n.sons[0])
|
||||||
dec c.inStaticContext
|
dec c.inStaticContext
|
||||||
n.sons[0] = a
|
when false:
|
||||||
evalStaticStmt(c.module, c.graph, a, c.p.owner)
|
n.sons[0] = a
|
||||||
# for incremental replays, keep the AST as required for replays:
|
evalStaticStmt(c.module, c.graph, a, c.p.owner)
|
||||||
result = n
|
# for incremental replays, keep the AST as required for replays:
|
||||||
#result = newNodeI(nkDiscardStmt, n.info, 1)
|
result = n
|
||||||
#result.sons[0] = c.graph.emptyNode
|
else:
|
||||||
|
result = newNodeI(nkDiscardStmt, n.info, 1)
|
||||||
|
result.sons[0] = c.graph.emptyNode
|
||||||
|
|
||||||
proc usesResult(n: PNode): bool =
|
proc usesResult(n: PNode): bool =
|
||||||
# nkStmtList(expr) properly propagates the void context,
|
# nkStmtList(expr) properly propagates the void context,
|
||||||
|
|
|
||||||
|
|
@ -12,12 +12,12 @@ macro outterMacro*(n, blck: untyped): untyped =
|
||||||
echo "Using arg ! " & n.repr
|
echo "Using arg ! " & n.repr
|
||||||
result = "Got: '" & $n.kind & "' " & $j
|
result = "Got: '" & $n.kind & "' " & $j
|
||||||
var callNode = n[0]
|
var callNode = n[0]
|
||||||
expectKind(n, TNimrodNodeKind.nnkCall)
|
expectKind(n, NimNodeKind.nnkCall)
|
||||||
if n.len != 3 or n[1].kind != TNimrodNodeKind.nnkIdent:
|
if n.len != 3 or n[1].kind != NimNodeKind.nnkIdent:
|
||||||
error("Macro " & callNode.repr &
|
error("Macro " & callNode.repr &
|
||||||
" requires the ident passed as parameter (eg: " & callNode.repr &
|
" requires the ident passed as parameter (eg: " & callNode.repr &
|
||||||
"(the_name_you_want)): statements.")
|
"(the_name_you_want)): statements.")
|
||||||
result = newNimNode(TNimrodNodeKind.nnkStmtList)
|
result = newNimNode(NimNodeKind.nnkStmtList)
|
||||||
var ass : NimNode = newNimNode(nnkAsgn)
|
var ass : NimNode = newNimNode(nnkAsgn)
|
||||||
ass.add(newIdentNode(n[1].ident))
|
ass.add(newIdentNode(n[1].ident))
|
||||||
ass.add(newStrLitNode(innerProc(4)))
|
ass.add(newStrLitNode(innerProc(4)))
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue