Fixed missing filenames in stack traces and errors.
h3rald h3rald@h3rald.com
Sat, 04 Mar 2017 21:46:59 +0100
2 files changed,
10 insertions(+),
10 deletions(-)
M
core/parser.nim
→
core/parser.nim
@@ -490,20 +490,20 @@ proc parseMinValue*(p: var MinParser, i: In): MinValue =
#echo p.a, " (", p.token, ")" case p.token of tkTrue: - result = MinValue(kind: minBool, boolVal: true, column: p.getColumn, line: p.lineNumber) + result = MinValue(kind: minBool, boolVal: true, column: p.getColumn, line: p.lineNumber, filename: p.filename) discard getToken(p) of tkFalse: - result = MinValue(kind: minBool, boolVal: false, column: p.getColumn, line: p.lineNumber) + result = MinValue(kind: minBool, boolVal: false, column: p.getColumn, line: p.lineNumber, filename: p.filename) discard getToken(p) of tkString: - result = MinValue(kind: minString, strVal: p.a, column: p.getColumn, line: p.lineNumber) + result = MinValue(kind: minString, strVal: p.a, column: p.getColumn, line: p.lineNumber, filename: p.filename) p.a = "" discard getToken(p) of tkInt: - result = MinValue(kind: minInt, intVal: parseint(p.a), column: p.getColumn, line: p.lineNumber) + result = MinValue(kind: minInt, intVal: parseint(p.a), column: p.getColumn, line: p.lineNumber, filename: p.filename) discard getToken(p) of tkFloat: - result = MinValue(kind: minFloat, floatVal: parseFloat(p.a), column: p.getColumn, line: p.lineNumber) + result = MinValue(kind: minFloat, floatVal: parseFloat(p.a), column: p.getColumn, line: p.lineNumber, filename: p.filename) discard getToken(p) of tkBracketLe: var q = newSeq[MinValue](0)@@ -515,9 +515,9 @@ while p.token != tkBracketRi:
q.add p.parseMinValue(i) eat(p, tkBracketRi) i.scope = oldscope - result = MinValue(kind: minQuotation, qVal: q, column: p.getColumn, line: p.lineNumber, scope: newscope) + result = MinValue(kind: minQuotation, qVal: q, column: p.getColumn, line: p.lineNumber, scope: newscope, filename: p.filename) of tkSymbol: - result = MinValue(kind: minSymbol, symVal: p.a, column: p.getColumn, line: p.lineNumber) + result = MinValue(kind: minSymbol, symVal: p.a, column: p.getColumn, line: p.lineNumber, filename: p.filename) p.a = "" discard getToken(p) else:
M
min.nim
→
min.nim
@@ -134,7 +134,7 @@ discard
i.close() proc minStream(s: Stream, filename: string) = - var i = newMinInterpreter() + var i = newMinInterpreter(filename = filename) i.pwd = filename.parentDir i.interpret(s)@@ -171,7 +171,7 @@
proc minRepl*(i: var MinInterpreter) = i.stdLib() var s = newStringStream("") - i.open(s, "") + i.open(s, "<repl>") var line: string #echo "$1 v$2" % [appname, version] var ed = initEditor(historyFile = MINIMHISTORY)@@ -194,7 +194,7 @@ except:
discard proc minRepl*() = - var i = newMinInterpreter() + var i = newMinInterpreter(filename = "<repl>") i.minRepl when isMainModule: