checkpoint
[sbp.git] / tests / regression.tc
index 32e8a59..ce43a84 100644 (file)
 //    s ::= ()       => s0
 //}
 
+tibcase {
+    input 
+"
+  hello 
+    there
+    how
+     { are }
+";
+    output "yep";
+
+    s        ::= { Hello } => "yep"
+    w        ::= " " | "\n"
+    ws      !::= w**
+    Hello    ::= "hello" ws { "there" "how" { { "are" } } }
+}
+
 testcase {
     input "ab c";
     output "1:{{a b} {c}}";
@@ -267,29 +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 /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]++