all repos — min @ b1984a40414a02e7eb2ab1b9e04a07ca00e80735

A small but practical concatenative programming language.

Logger improvements.
h3rald h3rald@h3rald.com
Wed, 09 Nov 2016 17:31:18 +0100
commit

b1984a40414a02e7eb2ab1b9e04a07ca00e80735

parent

35b1a2a08e6b727baf1cab5224921d04119d78c9

3 files changed, 9 insertions(+), 6 deletions(-)

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

@@ -28,13 +28,13 @@ version = e.value

else: discard of cfgError: - error("Configuration error.") + fatal("Configuration error.") quit(1) else: discard close(p) else: - error("Cannot process configuration file.") + fatal("Cannot process configuration file.") quit(2)
M lib/min_lang.nimlib/min_lang.nim

@@ -240,6 +240,7 @@ var file = s.getString

if not file.endsWith(".min"): file = file & ".min" file = i.pwd.joinPath(file) + info("[load] File: ", file) if not file.fileExists: raiseInvalid("File '$1' does not exists." % file) i.load file
M minim.nimminim.nim

@@ -66,6 +66,8 @@ elif word.startsWith("~"):

return symbols.mapIt("~" & $it) if word.startsWith("@"): return symbols.mapIt("@" & $it) + if word.startsWith("#"): + return symbols.mapIt("#" & $it) if word.startsWith(">"): return symbols.mapIt(">" & $it) if word.startsWith("*"):

@@ -141,15 +143,15 @@

proc minimFile*(filename: string) = var stream = newFileStream(filename, fmRead) if stream == nil: - error("Cannot read from file: "& filename) - quit(100) + fatal("Cannot read from file: "& filename) + quit(3) minimStream(stream, filename) proc minimFile*(file: File, filename="stdin") = var stream = newFileStream(stdin) if stream == nil: - error("Cannot read from file: "& filename) - quit(100) + fatal("Cannot read from file: "& filename) + quit(3) minimStream(stream, filename) proc printResult(i: In, res: MinValue) =