Fixed deprecation warnings.
h3rald h3rald@h3rald.com
Sun, 30 Apr 2023 13:55:34 +0000
3 files changed,
8 insertions(+),
8 deletions(-)
M
mn.nim
→
mn.nim
@@ -26,7 +26,7 @@ i.open(s, i.filename)
discard i.parser.getToken() try: i.interpret() - except: + except CatchableError: i.error(getCurrentExceptionMsg()) i.close()@@ -35,7 +35,7 @@ i.open(newStringStream(s), i.filename)
discard i.parser.getToken() try: result = i.interpret() - except: + except CatchableError: i.error(getCurrentExceptionMsg()) i.close()@@ -58,7 +58,7 @@ var fileLines = newSeq[string](0)
var contents = "" try: fileLines = fn.readFile().splitLines() - except: + except CatchableError: stderr.writeLine("Cannot read from file: " & fn) quit(3) if fileLines[0].len >= 2 and fileLines[0][0..1] == "#!":@@ -165,4 +165,4 @@ if isatty(stdin):
mnSimpleRepl() quit(0) else: - mnStream newFileStream(stdin), "stdin", op + mnStream newFileStream(stdin), "stdin", op
M
mnpkg/interpreter.nim
→
mnpkg/interpreter.nim
@@ -156,7 +156,7 @@ var v2 = v
i2.dequote(v2) else: i2.push v - except: + except CatchableError: i.currSym = i2.currSym i.trace = i2.trace raise@@ -223,7 +223,7 @@ i.trace = @[]
raise MnTrappedException(msg: msg) except MnTrappedException: raise - except: + except CatchableError: let msg = getCurrentExceptionMsg() i.stack = i.stackcopy i.stackTrace()@@ -257,4 +257,4 @@ result = i2.interpret(parseOnly)
i.trace = i2.trace i.stackcopy = i2.stackcopy i.stack = i2.stack - i.scope = i2.scope + i.scope = i2.scope