all repos — min @ daa652c84b1e62b6ae721b64739eaaf3b4e81741

A small but practical concatenative programming language.

Fixed lang tests.
h3rald h3rald@h3rald.com
Sat, 02 Jun 2018 22:51:56 +0200
commit

daa652c84b1e62b6ae721b64739eaaf3b4e81741

parent

0916322bf03771223575ae6a06495ef8b975a3f9

3 files changed, 16 insertions(+), 19 deletions(-)

jump to
M lib/min_lang.nimlib/min_lang.nim

@@ -52,7 +52,7 @@ scope = scope.parent

i.push q.newVal(i.scope) def.symbol("module-symbols") do (i: In): - let vals = i.expect("quot") + let vals = i.expect("dict:module") let m = vals[0] var q = newSeq[MinValue](0) for s in m.scope.symbols.keys:

@@ -60,7 +60,7 @@ q.add s.newVal

i.push q.newVal(i.scope) def.symbol("module-sigils") do (i: In): - let vals = i.expect("quot") + let vals = i.expect("dict:module") let m = vals[0] var q = newSeq[MinValue](0) for s in m.scope.sigils.keys:

@@ -204,7 +204,7 @@ for v in qprog.qVal:

i.push v def.symbol("publish") do (i: In): - let vals = i.expect("quot", "'sym") + let vals = i.expect("dict", "'sym") let qscope = vals[0] let str = vals[1] let sym = str.getString

@@ -296,7 +296,6 @@ except MinRuntimeError:

if not hasCatch: return let e = (MinRuntimeError)getCurrentException() - e.data = newDict(i.scope) i.push e.data i.dequote(catch) except:
M tests/lang.mintests/lang.min

@@ -33,9 +33,9 @@

~five (symbols "five" in? false ==) assert - ( + { (+) :myplus - ) +mymath + } +mymath (symbols "mymath" in?) assert

@@ -99,8 +99,8 @@ 2 a1 ==) assert

( ( - ((("error" "TestError")("message" "Test Message")) raise) - ('error dget) + ({"TestError" :error "Test Message" :message} raise) + (/error) ) try "TestError" ==) assert (

@@ -112,9 +112,9 @@ (() 1 get)

(1) ) try 1 ==) assert - ((a b +) (4 :a 5 :b) with 9 ==) assert + ((a b +) {4 :a 5 :b} with 9 ==) assert - ("{\"a\": 1, \"b\": 2.3}" from-json (("a" 1) ("b" 2.3)) ==) assert + ("{\"a\": 1, \"b\": 2.3}" from-json {1 :a 2.3 :b} ==) assert ((1 2 3 "aaa" 'q q true) to-json "\r\n" "" replace "\n" "" replace " " "" replace "[1,2,3,\"aaa\",\";sym:'q\",\";sym:q\",true]" ==) assert

@@ -142,9 +142,9 @@ (time module-symbols ("datetime" "now" "tformat" "timeinfo" "timestamp" "to-timestamp") ==) assert

(sys module-sigils ("!" "$" "&") ==) assert - (opts () ==) assert + (opts {} ==) assert - (args first "all.min$" match) assert + (args first "\.min$" match) assert (3 string "3" ==) assert

@@ -175,20 +175,20 @@

("3.678" float 3.678 ==) assert ( - (("a" 1) ("b" 2) ("c" 3)) ( + {1 :a 2 :b 3 :c} ( (dup /a succ succ %a) (dup /b succ %b) ) tap - (("a" 3) ("b" 3) ("c" 3)) == + {3 :a 3 :b 3 :c} == ) assert ( - () =data + {} :data data ( 1 %a 2 %b ) tap - (("a" 1) ("b" 2)) == + {1 :a 2 :b} == ) assert (
M tests/net.mintests/net.min

@@ -37,9 +37,7 @@ ;X-Processed-Time: 0.00111794471741

;Content-Length: 34 ;Via: 1.1 vegur ; - ;{ - ; "user-agent": "min v0.12.0" - ;} + ;{"user-agent": "min v0.16.0"} (response "\n\n" split 1 get from-json /user-agent user-agent ==) assert