Re-added prelude.min.
h3rald h3rald@h3rald.com
Sat, 03 Sep 2016 21:22:55 +0200
3 files changed,
8 insertions(+),
14 deletions(-)
M
.minimrc
→
prelude.min
@@ -65,6 +65,3 @@ (dprint pop) :dprint!
(put pop) :put! (:ms :q :check (check) (ms sleep q) while) :interval (call pop) :call! - -"MiNiM Shell v$1" (version) interpolate put! -"-> Type 'exit' or 'quit' to exit." put!
M
minim.nim
→
minim.nim
@@ -24,7 +24,7 @@ vendor/linenoise
var REPL = false var DEBUGGING = false -const PRELUDE* = ".minimrc".slurp.strip +const PRELUDE* = "prelude.min".slurp.strip when defined(windows): const HOME = getenv("HOMEPATH") when not defined(windows):@@ -72,12 +72,6 @@ return $res
when not(USE_LINENOISE): stdout.write(s) return stdin.readLine - -proc saverc() = - MINIMRC.writeFile(PRELUDE) - -proc loadrc(): string = - return MINIMRC.readFile() proc stdLib(i: In) = i.lang_module@@ -90,13 +84,14 @@ i.sys_module
i.time_module i.fs_module i.crypto_module + i.eval PRELUDE if not MINIMSYMBOLS.fileExists: MINIMSYMBOLS.writeFile("{}") if not MINIMHISTORY.fileExists: MINIMHISTORY.writeFile("") if not MINIMRC.fileExists: - saverc() - i.eval loadrc() + MINIMRC.writeFile("") + i.eval MINIMRC.readFile() proc minimStream(s: Stream, filename: string, debugging = false) = var i = newMinInterpreter(debugging)@@ -135,6 +130,8 @@ CURRSCOPE = i.scope
linenoiseSetCompletionCallback completionCallback discard linenoiseHistorySetMaxLen(1000) discard linenoiseHistoryLoad(MINIMHISTORY) + echo "MiNiM Shell v$1" % version + echo "-> Type 'exit' or 'quit' to exit." line = prompt(": ") if line.isNil: echo "-> Exiting..."
M
tests/all.min
→
tests/all.min
@@ -1,5 +1,5 @@
-'io load 'lang load +'io load 'logic load 'num load 'stack load@@ -7,4 +7,4 @@ 'str load
'sys load 'time load 'fs load -'crypto load+'crypto load