X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;ds=sidebyside;f=tests%2Fregression.tc;h=cbb50ce5203580eab07cc3408d78b71cb715b96d;hb=1ee308307a30c7e610a7dcad2e2cc4253e9ae039;hp=f911a97835f5423394d7b490de9476887156ee24;hpb=6ba9ea820f9626a7504da6cf442e2cef1601914f;p=sbp.git diff --git a/tests/regression.tc b/tests/regression.tc index f911a97..cbb50ce 100644 --- a/tests/regression.tc +++ b/tests/regression.tc @@ -348,7 +348,26 @@ testcase { s = Expr Expr = [0-9]++ - | Plus:: left:Expra "+" right:Expr + | Plus:: (left::Expra) "+" (right::Expr) Expra = Foo:: ("a" | "b") } + +testcase { + input "aaaaa"; + s = top:: z (q::"a"*) z + 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 = [ ]** +} +