all repos — min @ 68fadcf5ed5a5c7c6d0300fc3c3af64d26a7f094

A small but practical concatenative programming language.

Improved logging.
h3rald h3rald@h3rald.com
Sat, 12 Nov 2016 13:05:19 +0100
commit

68fadcf5ed5a5c7c6d0300fc3c3af64d26a7f094

parent

b1984a40414a02e7eb2ab1b9e04a07ca00e80735

4 files changed, 12 insertions(+), 6 deletions(-)

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

@@ -53,7 +53,10 @@ new result

result.fmtStr = fmtStr result.levelThreshold = levelThreshold -proc logLevel*(val: var string): string {.discardable.} = +proc getLogLevel*(): string = + return LevelNames[getLogFilter()].toLowerAscii + +proc setLogLevel*(val: var string): string {.discardable.} = var lvl: Level case val: of "debug":

@@ -253,4 +256,4 @@

proc reqDictionary*(i: In, q: var MinValue) = q = i.pop if not q.isDictionary: - raiseInvalid("An dictionary is required on the stack")+ raiseInvalid("An dictionary is required on the stack")
M lib/min_lang.nimlib/min_lang.nim

@@ -164,7 +164,10 @@ .symbol("loglevel") do (i: In):

var s: MinValue i.reqStringLike s var str = s.getString - echo "Log level: ", logLevel(str) + notice "Log level: ", setLogLevel(str) + + .symbol("loglevel?") do (i: In): + notice "Log level: ", getLogLevel() # Language constructs
M minim.nimminim.nim

@@ -215,7 +215,7 @@ -v, --version Print the program version

-i, --interactive Start $1 shell""" % [appname, version] var file, s: string = "" - setLogFilter(lvlWarn) + setLogFilter(lvlNotice) for kind, key, val in getopt(): case kind:

@@ -225,7 +225,7 @@ of cmdLongOption, cmdShortOption:

case key: of "log", "l": var val = val - logLevel(val) + setLogLevel(val) of "evaluate", "e": s = val of "help", "h":
M minim.vimminim.vim

@@ -12,7 +12,7 @@ setl iskeyword+=?,$,+,#,*,/,%,=,>,<,&,-,',.,:,~,!

setl iskeyword+=^ 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 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 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 match minimDefaultSigil ;\<[:@'~!$%&$=<>^*#]; contained