diff options
author | Araq <rumpf_a@web.de> | 2013-06-28 16:40:01 +0200 |
---|---|---|
committer | Araq <rumpf_a@web.de> | 2013-06-28 16:40:01 +0200 |
commit | 976d5b18edf1e650db21c4f5e6990c037ed305a7 (patch) | |
tree | c22d745708dffc47b3ae7db29156924da1cfaa2c /compiler/evals.nim | |
parent | 2ca05eeb16eaf2f1b811f21dd3d0baec21cd90da (diff) | |
download | Nim-976d5b18edf1e650db21c4f5e6990c037ed305a7.tar.gz |
small REPL improvements
Diffstat (limited to 'compiler/evals.nim')
-rw-r--r-- | compiler/evals.nim | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/compiler/evals.nim b/compiler/evals.nim index 84f0266ea..8c05d57fc 100644 --- a/compiler/evals.nim +++ b/compiler/evals.nim @@ -1532,10 +1532,11 @@ var oldErrorCount: int proc myProcess(c: PPassContext, n: PNode): PNode = # don't eval errornous code: - if oldErrorCount != msgs.gErrorCounter: - oldErrorCount = msgs.gErrorCounter - return n - result = eval(PEvalContext(c), n) + if oldErrorCount == msgs.gErrorCounter: + result = eval(PEvalContext(c), n) + else: + result = n + oldErrorCount = msgs.gErrorCounter const evalPass* = makePass(myOpen, nil, myProcess, myProcess) |