all repos — min @ 8090abcf162d7a7676dab77a2a2d9a5fcc8d8c69

A small but practical concatenative programming language.

Added logging operators; reviewed logging colors.
h3rald h3rald@h3rald.com
Sat, 12 Nov 2016 17:43:56 +0100
commit

8090abcf162d7a7676dab77a2a2d9a5fcc8d8c69

parent

9633e2fbd0207e59847da202d854ebd71cb8110d

3 files changed, 32 insertions(+), 5 deletions(-)

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

@@ -19,11 +19,11 @@

proc logPrefix*(level: Level): tuple[msg: string, color: ForegroundColor] = case level: of lvlDebug: - return ("---", fgCyan) + return ("---", fgMagenta) of lvlInfo: - return ("(i) ", fgGreen) + return ("(i) ", fgCyan) of lvlNotice: - return ("---", fgMagenta) + return ("---", fgGreen) of lvlWarn: return ("(!)", fgYellow) of lvlError:
M lib/min_io.nimlib/min_io.nim

@@ -1,6 +1,7 @@

import os, - strutils + strutils, + logging import ../core/linedit, ../core/regex,

@@ -22,6 +23,32 @@ .symbol("puts") do (i: In):

let a = i.peek echo $$a + .symbol("notice") do (i: In): + let a = i.peek + notice $$a + + .symbol("info") do (i: In): + let a = i.peek + info $$a + + .symbol("error") do (i: In): + let a = i.peek + error $$a + + .symbol("warn") do (i: In): + let a = i.peek + warn $$a + + .symbol("debug") do (i: In): + let a = i.peek + debug $$a + + .symbol("fatal") do (i: In): + let a = i.peek + fatal $$a + termRestore() + quit(100) + .symbol("column-print") do (i: In): var n, q: MinValue i.reqIntAndQuotation n, q
M minim.vimminim.vim

@@ -11,7 +11,7 @@

setl iskeyword=@,36-39,+,-,/,*,.,:,~,!,48-57,60-65,94-95,192-255 setl iskeyword+=^ -syntax keyword minimDefaultSymbol ! != $ & ' * + # - % ^ -> . .. / : < <= == => =~ > >= @ ROOT aes and append ask at atime b bind bool bool? bury1 bury2 bury3 c call call! capitalize case cd chmod choose clear-stack column-print concat confirm cons cp cpu crypto ctime datetime ddel decode decrypt define delete dget dictionary? dig1 dig2 dig3 dip dir? dirname div dprint dprint! dset dump-stack dup dupd encode encrypt env? eval even? exit fappend file? filename filter first float float? foreach fperms fread from-json format-error fs fsize fstats ftype fwrite gets get-stack getenv hardlink hidden? ifte import indent inspect int int? interpolate interval io join k keys length linrec load load-symbol logic loglevel loglevel? lowercase ls ls-r map match md5 mkdir mod module mtime mv newline not now num number? odd? os password pop popd pred print print! prompt publish puts puts! putenv q quotation? quote quote-bind quote-define raise regex remove-symbol repeat replace rest rm rmdir run save-symbol scope scope? seal search set-stack sha1 sha224 sha256 sha384 sha512 sigils sip sleep sort source split startup stored-symbols str string string? strip succ swap swapd swons symbols symlink symlink? sys system take tformat time timeinfo times timestamp titleize to-json try unquote uppercase unzip values version which while with xor zip contains +syntax keyword minimDefaultSymbol ! != $ & ' * + # - % ^ -> . .. / : < <= == => =~ > >= @ ROOT aes and append ask at atime b bind bool bool? bury1 bury2 bury3 c call call! capitalize case cd chmod choose clear-stack column-print concat confirm cons cp cpu crypto ctime datetime ddel debug decode decrypt define delete dget dictionary? dig1 dig2 dig3 dip dir? dirname div dprint dprint! dset dump-stack dup dupd encode encrypt env? error eval even? exit fappend fatal file? filename filter first float float? foreach fperms fread from-json format-error fs fsize fstats ftype fwrite gets get-stack getenv hardlink hidden? ifte import indent info inspect int int? interpolate interval io join k keys length linrec load load-symbol logic loglevel loglevel? lowercase ls ls-r map match md5 mkdir mod module mtime mv newline not notice now num number? odd? os password pop popd pred print print! prompt publish puts puts! putenv q quotation? quote quote-bind quote-define raise regex remove-symbol repeat replace rest rm rmdir run save-symbol scope scope? seal search set-stack sha1 sha224 sha256 sha384 sha512 sigils sip sleep sort source split startup stored-symbols str string string? strip succ swap swapd swons symbols symlink symlink? sys system take tformat time timeinfo times timestamp titleize to-json try unquote uppercase unzip values version warn which while with xor zip contains syntax match minimDefaultSigil ;\<[:@'~!$%&$=<>#^*#]; contained