X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=tests%2Fregression.tc;h=9953906553fa18f5ef68c9e6ed96c81c961ffc98;hb=d824fe4034e79260f1f065d1040a39571897cd95;hp=5ef3edc1fde0ce469c9918b9278ec020dd3f9805;hpb=8a9fc9f2357e54052374cf2ef003630a486a6c0a;p=sbp.git diff --git a/tests/regression.tc b/tests/regression.tc index 5ef3edc..9953906 100644 --- a/tests/regression.tc +++ b/tests/regression.tc @@ -60,8 +60,8 @@ testcase { input "aaabbbbccc"; s ::= ab & dc - ab !::= a b => ab - dc !::= d c => dc + ab ::= a b => ab + dc ::= d c => dc a ::= "a" a | () b ::= "b" b "c" | () c ::= "c" c | () @@ -70,9 +70,9 @@ testcase { testcase { input "aabb"; - output "xbx:{abab:{a b}}"; + output "xbx:{{a} abab:{a b} {b}}"; - x !::= ~[] + x ::= ~[] s ::= x* b x* => xbx b ::= [ab][ab] => abab &~ ( "aa" | "bb" ) @@ -222,22 +222,22 @@ testcase { idl ::= [a-d] } -testcase { - input "a*b*c"; - output "times:{stringify:{{a}} times:{stringify:{{b}} stringify:{{c}}}}"; - w ::= " " - l ::= id - s ::= l "=" r => "assign" - | r - r ::= l - | l "=" r => "assign" - | r "+" r => "plus" - | (r) "*" r => "times" - | "(" r ")" - | r r => "times" - id ::= idl++ => "stringify" - idl ::= [a-d] -} +//testcase { +// input "a*b*c"; +// output "times:{stringify:{{a}} times:{stringify:{{b}} stringify:{{c}}}}"; +// w ::= " " +// l ::= id +// s ::= l "=" r => "assign" +// | r +// r ::= l +// | l "=" r => "assign" +// | r "+" r => "plus" +// | (r) "*" r => "times" +// | "(" r ")" +// | r r => "times" +// id ::= idl++ => "stringify" +// idl ::= [a-d] +//} testcase { input "a+b*c"; @@ -325,3 +325,18 @@ testcase { //} // + +testcase { + input "abc "; + + s ::= q " "* => s + q ::= [a-z] [a-z] [a-z] => a3 + &~ ~[] "b" ~[]* +} + +testcase { + input "abc "; + output "s:{a b c}"; + + s ::= [a-z] [a-z] [a-z] " "* => s +}