From: adam Date: Sun, 5 Mar 2006 07:00:39 +0000 (-0500) Subject: added if-then-else dangling testcase X-Git-Tag: tag_for_25-Mar~278 X-Git-Url: http://git.megacz.com/?p=sbp.git;a=commitdiff_plain;h=092a88b35d6fc65125a9639844dac0cd115380ba added if-then-else dangling testcase darcs-hash:20060305070039-5007d-78d48ed02bc5088d6978ae9fb2f685fb775a5fd3.gz --- 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 = [ ]** +} +