all repos — min @ 8588ad2ab18a2668be3f32d48fe175e01d5ef78a

A small but practical concatenative programming language.

Minor changes.
h3rald h3rald@h3rald.com
Tue, 22 Dec 2020 19:58:06 +0100
commit

8588ad2ab18a2668be3f32d48fe175e01d5ef78a

parent

9057f45c7c8ce39d8b2760c430a22c6cdbe6ac37

1 files changed, 5 insertions(+), 20 deletions(-)

jump to
M core/interpreter.nimcore/interpreter.nim

@@ -298,28 +298,12 @@ q = newSeq[MinValue](0).newVal

while i.parser.token != tkEof: if i.trace.len == 0: i.stackcopy = i.stack - try: + handleErrors(i) do: val = i.parser.parseMinValue(i) if parseOnly: q.qVal.add val else: i.push val - except MinRuntimeError: - let msg = getCurrentExceptionMsg() - i.stack = i.stackcopy - error("$1:$2,$3 $4" % [i.currSym.filename, $i.currSym.line, $i.currSym.column, msg]) - i.stackTrace - i.trace = @[] - raise MinTrappedException(msg: msg) - except MinTrappedException: - raise - except: - let msg = getCurrentExceptionMsg() - i.stack = i.stackcopy - i.error(msg) - i.stackTrace - i.trace = @[] - raise MinTrappedException(msg: msg) if parseOnly: return q if i.stack.len > 0:

@@ -368,9 +352,10 @@ result.add "var i = newMinInterpreter(\"$#\")" % i.filename

result.add "i.stdLib()" if ASSETPATH != "": for f in walkDirRec(ASSETPATH): - logging.notice("- Including: $#" % f) - let ef = f.readFile.encode - let asset = "COMPILEDASSETS[\"$#\"] = \"$#\".decode" % [f, ef] + var file = f.replace("\\", "/") + logging.notice("- Including: $#" % file) + let ef = file.readFile.encode + let asset = "COMPILEDASSETS[\"$#\"] = \"$#\".decode" % [file, ef] result.add asset proc eval*(i: In, s: string, name="<eval>", parseOnly=false): MinValue {.discardable, extern:"min_exported_symbol_$1".}=