X-Git-Url: http://git.megacz.com/?p=sbp.git;a=blobdiff_plain;f=tests%2Fregression.tc;fp=tests%2Fregression.tc;h=1c47dc472d6cf7685f0e37f20f4e95b72af9fb8a;hp=73fe509bbae00abb69b6f7becaee1c0ecd90da0c;hb=e5cfb136bf7fd1352eff1bd87a458aa4ff748537;hpb=6ae224025882c9929e2e4e9e8461decbf3b9cae4 diff --git a/tests/regression.tc b/tests/regression.tc index 73fe509..1c47dc4 100644 --- a/tests/regression.tc +++ b/tests/regression.tc @@ -389,3 +389,27 @@ testcase { c = ("c":: x "2" x "1")* x = [123] } + +testcase { + input "if (bar!) baz!;"; + output "IfThen:{id:{x:{b x:{a r}}} id:{x:{b x:{a z}}}}"; + + s = Expr ";" + Expr = IfThen + | IfThenElse + | id:: id "!" + id = [a-z] | x:: [a-z] id + IfThen = IfThen:: + "if" "(" Expr ")" + Expr + /ws + IfThenElse = IfThenElse:: + "if" "(" Expr ")" + NotIfThenExpr + "else" + Expr + /ws + NotIfThenExpr = (Expr & [a-z]+) + SpaceIfThen = (~[])*// !IfThen + ws = [\n ]** +} \ No newline at end of file