X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;ds=sidebyside;f=tests%2Fregression.tc;h=faba28d7672f7eb3aff4f64696d20447c76d0d09;hb=944848ba21df8673ba812a764fc641d7fbaea54c;hp=78d35e3e99f8bb33d6ef9d091992e88b8afa42c7;hpb=f283ebfd51424e761bea2dd5b3042cf765ca9ee6;p=sbp.git diff --git a/tests/regression.tc b/tests/regression.tc index 78d35e3..faba28d 100644 --- a/tests/regression.tc +++ b/tests/regression.tc @@ -355,6 +355,20 @@ testcase { testcase { input "aaaaa"; + output "top:{a q:{{a a a}} a}"; s = top:: z (q::"a"*) z z = a:: "a" -} \ No newline at end of file +} + +testcase { + input "if (x) if (y) z else q"; + output "if:{ident:{{x}} else:{if:{ident:{{y}} then:{ident:{{z}}}} ident:{{q}}}}"; + + s = Expr + Expr = if:: "if" "(" Expr ")" IfBody /ws + | ident:: [a-z]++ + IfBody = else:: Expr "else" Expr /ws + | then:: Expr &~ (~[]* "else" !Expr /ws) + ws = [ ]** +} +