all repos — min @ af824c854e625d006153294d8b96176957b74ddf

A small but practical concatenative programming language.

Fixed prompt.
h3rald h3rald@h3rald.com
Sun, 29 Sep 2019 18:29:45 +0200
commit

af824c854e625d006153294d8b96176957b74ddf

parent

872f0beed7d4e712d389d694551e121d4d0ca861

2 files changed, 11 insertions(+), 8 deletions(-)

jump to
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.nimmin.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>")