X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=tests%2Fregression.tc;h=cbb50ce5203580eab07cc3408d78b71cb715b96d;hb=092a88b35d6fc65125a9639844dac0cd115380ba;hp=78d35e3e99f8bb33d6ef9d091992e88b8afa42c7;hpb=f283ebfd51424e761bea2dd5b3042cf765ca9ee6;p=sbp.git diff --git a/tests/regression.tc b/tests/regression.tc index 78d35e3..cbb50ce 100644 --- a/tests/regression.tc +++ b/tests/regression.tc @@ -357,4 +357,17 @@ testcase { input "aaaaa"; 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 = e + Expr = if:: "if" "(" Expr ")" IfBody /ws + | ident:: [a-z]++ + IfBody = else:: Expr "else" Expr /ws + | then:: Expr &~ ~[]* "else" Expr /ws + ws = [ ]** +} +