X-Git-Url: http://git.megacz.com/?p=sbp.git;a=blobdiff_plain;f=tests%2Fregression.tc;h=6196b489c8ec134c32c9acf84395df4f17a8f561;hp=32e8a59273fc1b5d5a51d079ee7c0f83a9924b94;hb=93ea8e84f6eadb1b2549754bbb832c75e4730e86;hpb=6f3b1ab733a3081bdd6a99cb1f9fd9e7c8dfeea9 diff --git a/tests/regression.tc b/tests/regression.tc index 32e8a59..6196b48 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}}"; @@ -267,10 +283,10 @@ testcase { indent !::= ww outdent !::= " " outdent " " - | " " [~]* "\n" + | " " ([~]*) "\n" any !::= [~]* -s ::= !any "\n\n" !ww Statement !ww "\n\n" !any => smt +s ::= !any "\n\n" !ww statement !ww "\n\n" !any => smt ww ::= sp* ws !::= sp** sp ::= " " @@ -278,18 +294,18 @@ sp ::= " " block ::= "\n" !indent blockBody &~ "\n" outdent [~\ ] [~]* -blockBody ::= Statement - > Statement blockBody /ws => "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]++