X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;ds=sidebyside;f=tests%2Fregression.tc;h=cbb50ce5203580eab07cc3408d78b71cb715b96d;hb=1ee308307a30c7e610a7dcad2e2cc4253e9ae039;hp=af600f3ccc8df303c91a2729577e7b44fd7fbcd7;hpb=45d799349e635f1a99e3974e4504a43d5a7aaf33;p=sbp.git diff --git a/tests/regression.tc b/tests/regression.tc index af600f3..cbb50ce 100644 --- a/tests/regression.tc +++ b/tests/regression.tc @@ -359,3 +359,15 @@ testcase { z = a:: "a" } +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 = [ ]** +} +