1 USING: kernel peg peg.parsers tools.test accessors ;
5 [ "a" "a" token "," token list-of parse ] unit-test
7 { V{ "a" "a" "a" "a" } }
8 [ "a,a,a,a" "a" token "," token list-of parse ] unit-test
10 [ "a" "a" token "," token list-of-many parse ] must-fail
12 { V{ "a" "a" "a" "a" } }
13 [ "a,a,a,a" "a" token "," token list-of-many parse ] unit-test
15 [ "aaa" "a" token 4 exactly-n parse ] must-fail
17 { V{ "a" "a" "a" "a" } }
18 [ "aaaa" "a" token 4 exactly-n parse ] unit-test
20 [ "aaa" "a" token 4 at-least-n parse ] must-fail
22 { V{ "a" "a" "a" "a" } }
23 [ "aaaa" "a" token 4 at-least-n parse ] unit-test
25 { V{ "a" "a" "a" "a" "a" } }
26 [ "aaaaa" "a" token 4 at-least-n parse ] unit-test
28 { V{ "a" "a" "a" "a" } }
29 [ "aaaa" "a" token 4 at-most-n parse ] unit-test
31 { V{ "a" "a" "a" "a" } }
32 [ "aaaaa" "a" token 4 at-most-n parse ] unit-test
35 [ "aaa" "a" token 3 4 from-m-to-n parse ] unit-test
37 { V{ "a" "a" "a" "a" } }
38 [ "aaaa" "a" token 3 4 from-m-to-n parse ] unit-test
40 { V{ "a" "a" "a" "a" } }
41 [ "aaaaa" "a" token 3 4 from-m-to-n parse ] unit-test
44 [ "a" any-char parse ] unit-test
47 [ "" epsilon parse ] unit-test
50 "a" "a" token just parse