checkpoint
[sbp.git] / tests / meta.g
index 4f671c6..807f15f 100644 (file)
@@ -9,15 +9,12 @@ Conjuncts   ::=  Sequence
               |  Sequence ^"&~" Elements  /ws
 Elements    ::=  e*/ws
 
-ps          ::= Elements                           => "ps"
-psy         ::= ps
-              | ps !wp ^"/" !ws e
-psx         ::= psy                   => "psy"
-              | psy ^"->" e /ws
-Sequence    ::= Quoted => "qprod"
-              > psx => "psx"
-              | psx  "=>" ^"[]"              /ws
-              | psx ^"=>" ("()"|word|Quoted) /ws
+PreSequence ::= Elements => "ps"
+              | PreSequence !wp ^"/"  !ws e
+              | PreSequence     ^"->"     e /ws
+              | (Quoted|word)   ^"::" PreSequence /ws
+              | PreSequence     ^"=>" ("[]"|"()"|word|Quoted) /ws
+Sequence    ::= PreSequence    => "psx"
 
 ec          ::= ~[\-\]\\]
               | escaped
@@ -25,12 +22,13 @@ ec          ::= ~[\-\]\\]
 Range       ::= ec          => "range"
               | ec ^"-" ec
 
-e           ::=  word                          => "nonTerminal"
+e           ::=
+                (Quoted|word) ^":" e
+              >  word                          => "nonTerminal"
               |  Quoted                        => "literal"
               |    ^"()"
               |    ^"{" Sequence "}"       /ws
               |    ^"["  Range* "]"
-
               |  e ^"++"                   /ws -> ~[/]
               |  e ^"+"                    /ws -> ~[+]
               |  e ^"++/" e                /ws        
@@ -41,7 +39,7 @@ e           ::=  word                          => "nonTerminal"
               |  e ^"*/"  e                /ws        
               |    ^"!"   e                /ws
               |  e ^"?"                    /ws
-              |   "^" Quoted               /ws => caret
+              |    ^"^" Quoted             /ws
 
               |     "(" word         ^")"  /ws
               >    ^"(" RHS  ")"           /ws