Refactoring.
h3rald h3rald@h3rald.com
Sun, 23 Oct 2016 20:40:44 +0200
3 files changed,
40 insertions(+),
39 deletions(-)
M
doc/MiNiM_UserGuide.htm
→
doc/MiNiM_UserGuide.htm
@@ -256,7 +256,7 @@
<h3 id="L.code.crypto..code..Module"><code>crypto</code> Module<a href="#document-top" title="Go to top"></a></h3> </div> <div id="footer"> - <p><span class="copy"></span> Fabio Cevasco – October 9, 2016</p> + <p><span class="copy"></span> Fabio Cevasco – October 22, 2016</p> <p><span>Powered by</span> <a href="https://h3rald.com/hastyscribe"><span class="hastyscribe"></span></a></p> </div> </div>
M
minim.nim
→
minim.nim
@@ -104,7 +104,7 @@ dir = getCurrentDir()
return toSeq(walkDir(dir, true)).filterIt(it.path.toLowerAscii.startsWith(f.toLowerAscii)).mapIt("\"$1" % [it.path.replace("\\", "/")]) return symbols -proc stdLib(i: In) = +proc stdLib*(i: In) = i.lang_module i.io_module i.logic_module@@ -134,7 +134,6 @@ i.interpret()
except: discard i.close() - quit() proc minimString*(buffer: string, debugging = false) = minimStream(newStringStream(buffer), "input", debugging)@@ -198,37 +197,39 @@
### -var file, s: string = "" - -for kind, key, val in getopt(): - case kind: - of cmdArgument: - file = key - of cmdLongOption, cmdShortOption: - case key: - of "debug", "d": - DEBUGGING = true - of "evaluate", "e": - s = val - of "help", "h": - echo usage - quit(0) - of "version", "v": - echo version - quit(0) - of "interactive", "i": - REPL = true - else: - discard - else: - discard - -if s != "": - minimString(s, DEBUGGING) -elif file != "": - minimFile file, DEBUGGING -elif REPL: - minimRepl DEBUGGING - quit(0) -else: - minimFile stdin, "stdin", DEBUGGING +when isMainModule: + + var file, s: string = "" + + for kind, key, val in getopt(): + case kind: + of cmdArgument: + file = key + of cmdLongOption, cmdShortOption: + case key: + of "debug", "d": + DEBUGGING = true + of "evaluate", "e": + s = val + of "help", "h": + echo usage + quit(0) + of "version", "v": + echo version + quit(0) + of "interactive", "i": + REPL = true + else: + discard + else: + discard + + if s != "": + minimString(s, DEBUGGING) + elif file != "": + minimFile file, DEBUGGING + elif REPL: + minimRepl DEBUGGING + quit(0) + else: + minimFile stdin, "stdin", DEBUGGING
M
minim.nimble
→
minim.nimble
@@ -1,8 +1,8 @@
[Package] name = "minim" -version = "1.0.0" +version = "0.1.0" author = "Fabio Cevasco" -description = "A tiny concatenative shell and programming language." +description = "A tiny concatenative programming language and shell." license = "MIT" bin = "minim"