You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
import compiler / [ast, vmdef, vm, nimeval, llstream]
from os import getEnv
whendefined(case1):
procevalString(code: string, moduleName ="script.nim"):auto=let stream =llStreamOpen(code)
defer: llStreamClose(stream)
let path =getEnv("nimc_D") &"/lib/"# let path = findNimStdLibCompileTime()var intr =createInterpreter(moduleName, [path])
defer: destroyInterpreter(intr)
intr.evalScript(stream)
evalString("echo 1")
evalString("echo 2")
whendefined(case2):
procevalString(code: string, moduleName ="script.nim"):auto=let stream =llStreamOpen(code)
defer: llStreamClose(stream)
let path =getEnv("nimc_D") &"/lib/"# let path = findNimStdLibCompileTime()var intr =createInterpreter(moduleName, [path])
defer: destroyInterpreter(intr)
for i in0..<10:
intr.evalScript(stream)
evalString("echo 5")
nim c --nimcache:/tmp/nim//nimcache/ -o:/tmp/nim//app -r -d:case1 --path:/Users/timothee/git_clone//nim//Nim/ bugs/nimeval/t03_n_is_not_nil.nim
1
???(0, 0) Error: internal error: n is not nil
=> that's just #9180 (not the issue I'm concerned with in this bug)
nim c --nimcache:/tmp/nim//nimcache/ -o:/tmp/nim//app -r -d:case2 --path:/Users/timothee/git_clone//nim//Nim/ bugs/nimeval/t03_n_is_not_nil.nim
5
=> that's another bug (this issue): nim shows no error but instead only runs the script once
The text was updated successfully, but these errors were encountered:
actually what's happening here is that the stream is exhausted after the 1st intr.evalScript(stream) so subsequent calls have no effect as is expected (using an actual modules instead of a stream shows multiple executions); closing
=> that's just #9180 (not the issue I'm concerned with in this bug)
=> that's another bug (this issue): nim shows no error but instead only runs the script once
The text was updated successfully, but these errors were encountered: