Fixed prompt.
h3rald h3rald@h3rald.com
Sun, 29 Sep 2019 18:29:45 +0200
2 files changed,
11 insertions(+),
8 deletions(-)
M
.travis.yml
→
.travis.yml
@@ -15,7 +15,7 @@ - set -x
- export PATH=$HOME/.nimble/bin:$PATH - export CHOOSENIM_NO_ANALYTICS=1 script: - - nimble install nifty + - nimble install -y nifty - nifty install - nimble -y build - ./min tests/all.min
M
min.nim
→
min.nim
@@ -176,6 +176,15 @@ except:
discard i.close() +proc interpret*(i: In, s: string): MinValue = + i.open(newStringStream(s), i.filename) + discard i.parser.getToken() + try: + result = i.interpret() + except: + discard + i.close() + proc minStream(s: Stream, filename: string) = var i = newMinInterpreter(filename = filename) i.pwd = filename.parentDir@@ -250,13 +259,7 @@ let vals = i.expect("string")
let v = vals[0] let prompt = v.getString() line = ed.readLine(prompt) - i.parser.bufpos = 0 - i.parser.buf = $line - discard i.parser.getToken() - try: - i.printResult i.interpret() - except: - discard + i.printResult i.interpret($line) proc minRepl*() = var i = newMinInterpreter(filename = "<repl>")