X-Git-Url: http://git.megacz.com/?p=sbp.git;a=blobdiff_plain;f=tests%2Floop.tc;fp=tests%2Floop.tc;h=c7b659010eb5a69360d9ff3559016fcac1c99732;hp=0000000000000000000000000000000000000000;hb=e5cfb136bf7fd1352eff1bd87a458aa4ff748537;hpb=6ae224025882c9929e2e4e9e8461decbf3b9cae4 diff --git a/tests/loop.tc b/tests/loop.tc new file mode 100644 index 0000000..c7b6590 --- /dev/null +++ b/tests/loop.tc @@ -0,0 +1,23 @@ +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