X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=tests%2Fregression.tc;h=26d81c7a5e9e08a922bf87bf43a1802837d19efe;hb=df76fcb56242a90011500ab89092d2108350a8ab;hp=1c47dc472d6cf7685f0e37f20f4e95b72af9fb8a;hpb=e5cfb136bf7fd1352eff1bd87a458aa4ff748537;p=sbp.git diff --git a/tests/regression.tc b/tests/regression.tc index 1c47dc4..26d81c7 100644 --- a/tests/regression.tc +++ b/tests/regression.tc @@ -1,6 +1,6 @@ //testcase { // input "x"; -// output "a1:{x}"; +// output "a:{x}"; // // s = a1:: a // a = s1:: s @@ -40,8 +40,8 @@ testcase { output "1:{{a b} {c}}"; s = ids - ids = "1":: id (" " ids &~ id !((~[])*)) - | "2":: id ( ids &~ id !((~[])*)) + ids = "1":: id (" " ids &~ id ((~[])*)!) + | "2":: id ( ids &~ id ((~[])*)!) | id id = [a-z]++ } @@ -292,10 +292,10 @@ ww = sp* sp = " " any = (~[])* -s = smt:: !ws statement !ws statement !ws +s = smt:: ws! statement ws! statement ws! -block = !"\n" !indent blockBody - &~ !"\n" (" " !outdent " ") !(~[\ ]) !((~[])*) +block = "\n"! indent! blockBody + &~ "\n"! (" " outdent! " ") (~[\ ])! ((~[])*)! blockBody = statement > sbb:: statement ws blockBody @@ -326,7 +326,7 @@ testcase { s = s2:: q " "* q = a3:: [a-z] [a-z] [a-z] - &~ !(~[]) "b" !((~[])*) + &~ (~[])! "b" ((~[])*)! } testcase { @@ -364,7 +364,7 @@ testcase { Expr = if:: "if" "(" Expr ")" IfBody /ws | ident:: [a-z]++ IfBody = else:: Expr "else" Expr /ws - | then:: Expr &~ ((~[])* "else" !Expr /ws) + | then:: Expr &~ ((~[])* "else" Expr! /ws) ws = [ ]** } @@ -390,26 +390,10 @@ testcase { x = [123] } -testcase { - input "if (bar!) baz!;"; - output "IfThen:{id:{x:{b x:{a r}}} id:{x:{b x:{a z}}}}"; - - s = Expr ";" - Expr = IfThen - | IfThenElse - | id:: id "!" - id = [a-z] | x:: [a-z] id - IfThen = IfThen:: - "if" "(" Expr ")" - Expr - /ws - IfThenElse = IfThenElse:: - "if" "(" Expr ")" - NotIfThenExpr - "else" - Expr - /ws - NotIfThenExpr = (Expr & [a-z]+) - SpaceIfThen = (~[])*// !IfThen - ws = [\n ]** -} \ No newline at end of file + +//testcase { +// input "ab"; +// +// s = a:"a" b:"b" +//} +