use >> and << for indent/dedent
[sbp.git] / tests / meta.g
index ac72619..f06eb2f 100644 (file)
@@ -1,4 +1,4 @@
- //funkanomitron
+//funkanomitron
 s             = ws Grammar ws
 
 Grammar::     = Declaration +/ ws
@@ -15,7 +15,7 @@ NonTerminal   = NonTerminal:: Word            ws  "=" ws RHS
               |               Word  "*"       ws ^"=" ws RHS
               |               Word  "*/" Word ws ^"=" ws RHS
        
-RHS::         = ("|":: Sequence +/ (ws "|" ws)) +/ (ws ">" ws)
+RHS::         = ("|":: Sequence +/ (ws "|" ws)) +/ (ws (">" -> ~">") ws)
 
 Elements::    = e*/ws
 
@@ -26,6 +26,7 @@ PreSequence   = Elements
 
 Sequence      = PreSequence
               | Sequence ^"&"  Elements /ws
+              | ^"~~"  Elements /ws
               | Sequence ^"&~" Elements /ws
 
 e             =                                   e ^"!"
@@ -45,20 +46,28 @@ e             =                                   e ^"!"
               |                e ^"*/"  e                /ws        
               |                e ^"?"                    /ws
               |                  ^"^"   Quoted
+              |                  ^"`"   e
+              |                  ^"..."
               |                   "(" Word  ^")"
               >                  ^"(" RHS  ")"           /ws
-              |                  ^"~" e
+              |                 "~":: ("~" -> ~"~")!  e
               |                  ^"\\{"
               |                  ^"\\}"
+              |                  ^">>"
+              |                  ^"<<"
 
-Word::        = [.a-zA-Z0-9_]++
+Word::        = [.a-zA-Z0-9_]++ &~ "."+
 Quoted::      = "\"" (~[\"\\] | escaped)+ "\""
               | "\"\""
 
 Range::       = ec
               | ec "-" ec
+              | "<<":: [<][<]
+              | ">>":: [>][>]
 
-ec            = ~[\-\]\\]
+ec            = ~[\-\]\\<>]
+              | [>] -> ~[>]
+              | [<] -> ~[<]
               | escaped
 escaped       = "\n"::  "\\n"
               | "\r"::  "\\r"