Added minim.nimble.
h3rald h3rald@h3rald.com
Sun, 18 Sep 2016 15:47:01 +0200
4 files changed,
50 insertions(+),
4 deletions(-)
M
core/consts.nim
→
core/consts.nim
@@ -1,7 +1,42 @@
import - os + os, + parsecfg, + streams, + strutils + +const + cfgfile = "../minim.nimble".slurp + +var + appname* = "MiNiM" + version*: string + f = newStringStream(cfgfile) + +if f != nil: + var p: CfgParser + open(p, f, "../minim.nimble") + while true: + var e = next(p) + case e.kind + of cfgEof: + break + of cfgKeyValuePair: + case e.key: + of "version": + version = e.value + else: + discard + of cfgError: + stderr.writeLine("Configuration error.") + quit(1) + else: + discard + close(p) +else: + stderr.writeLine("Cannot process configuration file.") + quit(2) -const version* = "1.0.0-dev" + when defined(windows): const HOME* = getenv("USERPROFILE")
M
minim.nim
→
minim.nim
@@ -20,7 +20,7 @@
var REPL = false var DEBUGGING = false const PRELUDE* = "prelude.min".slurp.strip -let usage* = " MiNiM v" & version & " - a tiny concatenative programming language" & """ +let usage* = " " & appname & " v" & version & " - a tiny concatenative programming language" & """ (c) 2014-2016 Fabio Cevasco@@ -145,7 +145,7 @@ i.stdLib()
var s = newStringStream("") i.open(s, "") var line: string - echo "MiNiM Shell v$1" % version + echo "$1 v$2" % [version, appname] echo "-> Type 'exit' or 'quit' to exit." var ed = initEditor(historyFile = MINIMHISTORY) KEYMAP["ctrl+s"] = proc (ed: var LineEditor) =
M
minim.nim.cfg
→
minim.nim.cfg
@@ -1,4 +1,5 @@
--warning[LockLevel]:off + # https://gist.github.com/Drakulix/9881160 amd64.windows.gcc.path = "/usr/local/mingw/bin" amd64.windows.gcc.exe = "x86_64-w64-mingw32-gcc"
A
minim.nimble
@@ -0,0 +1,10 @@
+[Package] +name = "minim" +version = "1.0.0" +author = "Fabio Cevasco" +description = "A tiny concatenative shell and programming language." +license = "MIT" +bin = "minim" + +[Deps] +requires: "nimrod >= 0.14.2"