small REPL improvements

This commit is contained in:
Araq 2013-06-28 16:40:01 +02:00
commit 976d5b18ed
3 changed files with 7 additions and 6 deletions

View file

@ -1532,10 +1532,11 @@ var oldErrorCount: int
proc myProcess(c: PPassContext, n: PNode): PNode = proc myProcess(c: PPassContext, n: PNode): PNode =
# don't eval errornous code: # don't eval errornous code:
if oldErrorCount != msgs.gErrorCounter: if oldErrorCount == msgs.gErrorCounter:
oldErrorCount = msgs.gErrorCounter result = eval(PEvalContext(c), n)
return n else:
result = eval(PEvalContext(c), n) result = n
oldErrorCount = msgs.gErrorCounter
const evalPass* = makePass(myOpen, nil, myProcess, myProcess) const evalPass* = makePass(myOpen, nil, myProcess, myProcess)

View file

@ -91,7 +91,8 @@ proc errorSym*(c: PContext, n: PNode): PSym =
result.typ = errorType(c) result.typ = errorType(c)
incl(result.flags, sfDiscardable) incl(result.flags, sfDiscardable)
# pretend it's imported from some unknown module to prevent cascading errors: # pretend it's imported from some unknown module to prevent cascading errors:
c.importTable.addSym(result) if gCmd != cmdInteractive:
c.importTable.addSym(result)
type type
TOverloadIterMode* = enum TOverloadIterMode* = enum

View file

@ -15,7 +15,6 @@ version 0.9.4
Bugs Bugs
==== ====
- REPL: after an error no evaluation is performed for the next line
- simple closure iterator doesn't work - simple closure iterator doesn't work
- docgen: sometimes effects are listed twice - docgen: sometimes effects are listed twice
- 'result' is not properly cleaned for NRVO --> use uninit checking instead - 'result' is not properly cleaned for NRVO --> use uninit checking instead