X-Git-Url: http://git.megacz.com/?p=sbp.git;a=blobdiff_plain;f=tests%2Fregression.tc;h=9a7ef5062056e234ec8b4eca33ccef0325cf400e;hp=0dd485332e57f795ad3f092c039d19baff563aab;hb=0a66237ec014b7e8a4c12efd03b72ce88fe278f3;hpb=39179e9fe5c616bbe38282bc06ecfa6e15916346 diff --git a/tests/regression.tc b/tests/regression.tc index 0dd4853..9a7ef50 100644 --- a/tests/regression.tc +++ b/tests/regression.tc @@ -19,6 +19,22 @@ // s ::= () => s0 //} +tibcase { + input +" + hello + there + how + { are } +"; + output "yep"; + + s ::= { Hello } => "yep" + w ::= " " | "\n" + ws !::= w** + Hello ::= "hello" ws { ws "there" ws "how" ws { { "are" } ws } } +} + testcase { input "ab c"; output "1:{{a b} {c}}"; @@ -218,7 +234,7 @@ testcase { l ::= id s ::= l "=" r => "assign" | r - R ::= l + r ::= l | l "=" r => "assign" | r "+" r => "plus" | (r) "*" r => "times" @@ -267,28 +283,29 @@ testcase { indent !::= ww outdent !::= " " outdent " " - | " " [~]* "\n" + | " " ([~]*) "\n" any !::= [~]* -s ::= !any "\n\n" !ww Statement !ww "\n\n" !any => smt -ww ::= sp* +s ::= any "\n\n" ww statement ww "\n\n" any => smt +ww !::= sp* +ws !::= sp** sp ::= " " -block ::= "\n" !indent BlockBody +block ::= "\n" indent blockBody &~ "\n" outdent [~\ ] [~]* -BlockBody ::= Statement - > Statement BlockBody => "sbb" +blockBody ::= statement + > statement blockBody /ws => "sbb" -Statement ::= Call - | ^"while" Expr block +statement ::= call + | ^"while" expr block /ws -Expr ::= ident - | Call - | Expr ^">" Expr +expr ::= ident + | call + | expr ^">" expr /ws | num -Call ::= Expr "()" +call ::= expr "()" /ws num ::= [0-9]++