checkpoint
[sbp.git] / tests / regression.tc
index ae452e9..8802d29 100644 (file)
@@ -60,8 +60,8 @@ testcase {
     input "aaabbbbccc";
 
     s   ::= ab & dc
-    ab !::= a b       => ab
-    dc !::= d c       => dc
+    ab  ::= a b       => ab
+    dc  ::= d c       => dc
     a   ::= "a" a     | ()
     b   ::= "b" b "c" | ()
     c   ::= "c" c     | ()
@@ -70,9 +70,9 @@ testcase {
 
 testcase {
     input "aabb";
-    output "xbx:{abab:{a b}}";
+    output "xbx:{{a} abab:{a b} {b}}";
 
-    x  !::= ~[]
+    x   ::= ~[]
     s   ::= x* b x* => xbx
     b   ::= [ab][ab] => abab
          &~ ( "aa" | "bb" )
@@ -222,22 +222,22 @@ testcase {
     idl  ::= [a-d]
 }
 
-testcase {
-    input "a*b*c";
-    output "times:{stringify:{{a}} times:{stringify:{{b}} stringify:{{c}}}}";
-    w  ::= " "
-    l  ::= id
-    s  ::= l "=" r  => "assign"
-         | r
-    r  ::= l
-         | l "=" r       => "assign"
-         | r "+" r       => "plus"
-         | (r) "*" r       => "times"
-         | "(" r ")"
-         | r r           => "times"
-    id   ::= idl++       => "stringify"
-    idl  ::= [a-d]
-}
+//testcase {
+//    input "a*b*c";
+//    output "times:{stringify:{{a}} times:{stringify:{{b}} stringify:{{c}}}}";
+//    w  ::= " "
+//    l  ::= id
+//    s  ::= l "=" r  => "assign"
+//         | r
+//    r  ::= l
+//         | l "=" r       => "assign"
+//         | r "+" r       => "plus"
+//         | (r) "*" r       => "times"
+//         | "(" r ")"
+//         | r r           => "times"
+//    id   ::= idl++       => "stringify"
+//    idl  ::= [a-d]
+//}
 
 testcase {
     input "a+b*c";
@@ -323,4 +323,32 @@ testcase {
 //
 //
 //}
-//
\ No newline at end of file
+//
+
+
+testcase {
+    input "abc                         ";
+
+    s   ::= q " "* => s
+    q   ::= [a-z] [a-z] [a-z] => a3
+         &~ ~[] "b" ~[]*
+}
+
+testcase {
+    input "abc                         ";
+    output "s:{a b c}";
+
+    s   ::= [a-z] [a-z] [a-z] " "* => s
+}
+
+testcase {
+
+    input "a+2";
+    output "";
+
+    s     ::= Expr
+    Expr  ::= [0-9]++
+            | Plus:: left:Expra "+" right:Expr
+    Expra ::= Foo:: ("a" | "b")
+
+}