diff options
Diffstat (limited to 'stdlib/source/test/lux/tool/compiler/default/syntax.lux')
-rw-r--r-- | stdlib/source/test/lux/tool/compiler/default/syntax.lux | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/stdlib/source/test/lux/tool/compiler/default/syntax.lux b/stdlib/source/test/lux/tool/compiler/default/syntax.lux index 1b9e5c7a4..2b53cbfdb 100644 --- a/stdlib/source/test/lux/tool/compiler/default/syntax.lux +++ b/stdlib/source/test/lux/tool/compiler/default/syntax.lux @@ -3,7 +3,9 @@ [abstract/monad (#+ do)] [data ["%" text/format (#+ format)] - ["." name]] + ["." name] + [number + ["n" nat]]] ["r" math/random (#+ Random) ("#@." monad)] ["_" test (#+ Test)] [control @@ -29,7 +31,7 @@ (def: name-part^ (Random Text) (do r.monad - [size (|> r.nat (:: @ map (|>> (n/% 20) (n/max 1))))] + [size (|> r.nat (:: @ map (|>> (n.% 20) (n.max 1))))] (r.ascii/lower-alpha size))) (def: name^ @@ -48,7 +50,7 @@ textual^ (: (Random Code) ($_ r.either (do r.monad - [size (|> r.nat (r@map (n/% 20)))] + [size (|> r.nat (r@map (n.% 20)))] (|> (r.ascii/upper-alpha size) (r@map code.text))) (|> name^ (r@map code.identifier)) (|> name^ (r@map code.tag)))) @@ -59,14 +61,14 @@ (r.rec (function (_ code^) (let [multi^ (do r.monad - [size (|> r.nat (r@map (n/% 3)))] + [size (|> r.nat (r@map (n.% 3)))] (r.list size code^)) composite^ (: (Random Code) ($_ r.either (|> multi^ (r@map code.form)) (|> multi^ (r@map code.tuple)) (do r.monad - [size (|> r.nat (r@map (n/% 3)))] + [size (|> r.nat (r@map (n.% 3)))] (|> (r.list size (r.and code^ code^)) (r@map code.record)))))] ($_ r.either @@ -110,9 +112,9 @@ (def: comment-text^ (Random Text) - (let [char-gen (|> r.nat (r.filter (|>> (n/= (`` (char (~~ (static text.new-line))))) not)))] + (let [char-gen (|> r.nat (r.filter (|>> (n.= (`` (char (~~ (static text.new-line))))) not)))] (do r.monad - [size (|> r.nat (r@map (n/% 20)))] + [size (|> r.nat (r@map (n.% 20)))] (r.text char-gen size)))) (def: comment^ |