summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorAndreas Rumpf <rumpf_a@web.de>2018-06-11 01:23:14 +0200
committerAndreas Rumpf <rumpf_a@web.de>2018-06-11 01:23:14 +0200
commit61e189792220b7eb3b6a6b2ac543c6de84862aae (patch)
treed49034c7890186115e8faa3df4e3b7af1c6366a5
parent90b1030dec0a5fb6ac0f2a4332fecfa7264bbf44 (diff)
downloadNim-61e189792220b7eb3b6a6b2ac543c6de84862aae.tar.gz
make tests green again
-rw-r--r--compiler/nimeval.nim4
-rw-r--r--compiler/semstmts.nim14
-rw-r--r--tests/macros/tmacros1.nim6
3 files changed, 13 insertions, 11 deletions
diff --git a/compiler/nimeval.nim b/compiler/nimeval.nim
index 308560010..f20b5642c 100644
--- a/compiler/nimeval.nim
+++ b/compiler/nimeval.nim
@@ -73,7 +73,7 @@ proc evalScript*(i: Interpreter; scriptStream: PLLStream = nil) =
 
   let s = if scriptStream != nil: scriptStream
           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 =
   ## Tries to find a path to a valid "system.nim" file.
@@ -112,7 +112,7 @@ proc createInterpreter*(scriptName: string;
   vm.mode = emRepl
   vm.features = flags
   graph.vm = vm
-  graph.compileSystemModule(cache)
+  graph.compileSystemModule()
   result = Interpreter(mainModule: m, graph: graph, scriptName: scriptName)
 
 proc destroyInterpreter*(i: Interpreter) =
diff --git a/compiler/semstmts.nim b/compiler/semstmts.nim
index 0f8e77fc9..0e143e7c1 100644
--- a/compiler/semstmts.nim
+++ b/compiler/semstmts.nim
@@ -1771,12 +1771,14 @@ proc semStaticStmt(c: PContext, n: PNode): PNode =
   inc c.inStaticContext
   let a = semStmt(c, n.sons[0])
   dec c.inStaticContext
-  n.sons[0] = a
-  evalStaticStmt(c.module, c.graph, a, c.p.owner)
-  # for incremental replays, keep the AST as required for replays:
-  result = n
-  #result = newNodeI(nkDiscardStmt, n.info, 1)
-  #result.sons[0] = c.graph.emptyNode
+  when false:
+    n.sons[0] = a
+    evalStaticStmt(c.module, c.graph, a, c.p.owner)
+    # for incremental replays, keep the AST as required for replays:
+    result = n
+  else:
+    result = newNodeI(nkDiscardStmt, n.info, 1)
+    result.sons[0] = c.graph.emptyNode
 
 proc usesResult(n: PNode): bool =
   # nkStmtList(expr) properly propagates the void context,
diff --git a/tests/macros/tmacros1.nim b/tests/macros/tmacros1.nim
index 9e3ab028b..80afb6641 100644
--- a/tests/macros/tmacros1.nim
+++ b/tests/macros/tmacros1.nim
@@ -12,12 +12,12 @@ macro outterMacro*(n, blck: untyped): untyped =
     echo "Using arg ! " & n.repr
     result = "Got: '" & $n.kind & "' " & $j
   var callNode = n[0]
-  expectKind(n, TNimrodNodeKind.nnkCall)
-  if n.len != 3 or n[1].kind != TNimrodNodeKind.nnkIdent:
+  expectKind(n, NimNodeKind.nnkCall)
+  if n.len != 3 or n[1].kind != NimNodeKind.nnkIdent:
     error("Macro " & callNode.repr &
       " requires the ident passed as parameter (eg: " & callNode.repr &
       "(the_name_you_want)): statements.")
-  result = newNimNode(TNimrodNodeKind.nnkStmtList)
+  result = newNimNode(NimNodeKind.nnkStmtList)
   var ass : NimNode = newNimNode(nnkAsgn)
   ass.add(newIdentNode(n[1].ident))
   ass.add(newStrLitNode(innerProc(4)))