checkpoint
[sbp.git] / tests / meta.g
index 5dafc7d..bfa176d 100644 (file)
@@ -1,4 +1,4 @@
-s           ::=  Grammar ws                  => "gram"
+s           ::=  !ws Grammar ws              => "gram"
 Grammar     ::=  NonTerminal +/ ws           => "grammar"
 NonTerminal ::=  word  ^"::=" RHS /ws
 
@@ -9,16 +9,12 @@ Conjuncts   ::=  Sequence
               |  Sequence ^"&~" Elements  /ws
 Elements    ::=  e*/ws
 
-ps          ::= Elements                           => "ps"
-              | (e+/ws !ws)? ^"^" Quoted (!ws e+/ws)?
-psy         ::= ps
-              | ps !wp ^"/" !ws e
-psx         ::= psy                   => "psy"
-              | psy ^"->" e /ws
+psy         ::= Elements => "ps"
+              | psy !wp ^"/"  !ws e
+              | psy     ^"->"     e /ws
 Sequence    ::= Quoted => "qprod"
-              > psx => "psx"
-              | psx  "=>" ^"[]"              /ws
-              | psx ^"=>" ("()"|word|Quoted) /ws
+              > psy => "psx"
+              | psy ^"=>" ("[]"|"()"|word|Quoted) /ws
 
 ec          ::= ~[\-\]\\]
               | escaped
@@ -42,6 +38,7 @@ e           ::=  word                          => "nonTerminal"
               |  e ^"*/"  e                /ws        
               |    ^"!"   e                /ws
               |  e ^"?"                    /ws
+              |    ^"^" Quoted             /ws
 
               |     "(" word         ^")"  /ws
               >    ^"(" RHS  ")"           /ws