all repos — mn @ 6984649e66f0bbc60ba295a2ff6f9d7640a3ab5f

A truly minimal concatenative programming language.

Fixed deprecation warnings.
h3rald h3rald@h3rald.com
Sun, 30 Apr 2023 13:55:34 +0000
commit

6984649e66f0bbc60ba295a2ff6f9d7640a3ab5f

parent

db1a0d76fb3d9325f18b9d6ef90cbcc0b6ede092

3 files changed, 8 insertions(+), 8 deletions(-)

jump to
M mn.nimmn.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 mn.nimblemn.nimble

@@ -13,4 +13,4 @@ installDirs = @["mnpkg"]

# Dependencies -requires "nim >= 1.4.4" +requires "nim >= 1.6.12"
M mnpkg/interpreter.nimmnpkg/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