checkpoint
[sbp.git] / tests / meta.g
index d8353a6..845af52 100644 (file)
@@ -1,12 +1,13 @@
+Grammar       =  NonTerminal +/ ws
+s             =  !ws (grammar::Grammar) !ws
+NonTerminal   =  Word ^"=" RHS /ws
 
 // use 'a'-'z' or 'a-z' instead of [a-z]?
 // EOF token?
 // #include (with renaming?)
 // ANTLR uses ! and ^ suffixes
 
-s             =  !ws (grammar::Grammar) !ws
-Grammar       =  NonTerminal +/ ws
-NonTerminal   =  Word ^"=" RHS /ws
+blah = "Grammar"
         
 RHS           =  (Sequence +/ (!ws "|" !ws)) +/ (!ws ">" !ws)
 
@@ -27,12 +28,11 @@ ec            = ~[\-\]\\]
 Range         = range:: ec
               |         ec ^"-" ec
 
-e             =//                (Quoted|Word) ^":" e
-//              > 
-              nonTerminal::          Word
+e             =                (Quoted|Word) ^":" e
+              > nonTerminal::          Word
               | literal::       Quoted
               |                  ^"()"
-              |                  ^"{" PreSequence "}"       /ws
+              |                  ^"{" PreSequence "}"    /ws
               |                  ^"["  Range* "]"
               |                e ^"++"                   /ws -> ~[/]
               |                e ^"+"                    /ws -> ~[+]
@@ -48,7 +48,7 @@ e             =//                (Quoted|Word) ^":" e
               |     "(" Word     ^")"                    /ws
               >                  ^"(" RHS  ")"           /ws
               |                  ^"~" e
-              >  "^^"::           "^"   e
+              >  "^^"::           "^" e
 
 Word       = [a-zA-Z0-9_]++
 Quoted     = "\"" ((~[\"\\] | escaped)+) "\""
@@ -59,5 +59,5 @@ escaped    = "\n":: "\\n"
 
 w             = " " | "\n" | "\r"
 ws            =  "()":: w**
-              |  "()":: w** "//" ~[\n]* "\n" ws
+              |  "()":: w** "//" (~[\n])* "\n" ws
 wp            =  w++