X-Git-Url: http://git.megacz.com/?p=sbp.git;a=blobdiff_plain;f=tests%2Fregression.tc;h=e2ae422917e969aa13f4e13b495f28ffa7f58ebe;hp=7d170e08abd35d07dabacfcdb6fdd80ea04c17e8;hb=526da96dd06e152d194ec92c9ef9df6085a1251b;hpb=ebb5fe5647046306f415e31e4967b23169c9004e diff --git a/tests/regression.tc b/tests/regression.tc index 7d170e0..e2ae422 100644 --- a/tests/regression.tc +++ b/tests/regression.tc @@ -260,36 +260,40 @@ testcase { input " + while x>0 - while y>0 - foo() - bar() + while y>0 + foo() + bar() + while x>0 - while y>0 - foo() - bar() + while y>0 + foo() + bar() + "; - output "smt:{while:{>:{{x} {0}} while:{>:{{y} {0}} sbb:{{f o o} {b a r}}}}}"; - output "smt:{while:{>:{{x} {0}} sbb:{while:{>:{{y} {0}} {f o o}} {b a r}}}}"; + output "smt:{while:{>:{{x} {0}} while:{>:{{y} {0}} sbb:{{f o o} {b a r}}}} while:{>:{{x} {0}} sbb:{while:{>:{{y} {0}} {f o o}} {b a r}}}}"; indent !::= ww outdent !::= " " outdent " " | " " (~[]*) "\n" -any !::= ~[]* -s ::= any "\n\n" ww statement ww "\n\n" any => smt +w !::= " " | "\n" | "\r" +ws !::= w* ww !::= sp* -ws !::= sp** -sp ::= " " +sp !::= " " +any !::= ~[]* + +s ::= ws statement ws statement ws => smt block ::= "\n" indent blockBody &~ "\n" outdent ~[\ ] ~[]* blockBody ::= statement - > statement blockBody /ws => "sbb" + > statement ws blockBody => "sbb" statement ::= call | ^"while" expr block /ws @@ -306,8 +310,6 @@ num ::= [0-9]++ ident ::= [a-z]++ &~ keyword keyword ::= "if" | "then" | "else" | "while" -w ::= " " | "\n" | "\r" -ws ::= w* }