added ~~ operator and tests for ~~ and ... operators
[sbp.git] / tests / meta.g
index b1552f1..638fa71 100644 (file)
@@ -1,3 +1,4 @@
+//funkanomitron
 s             = ws Grammar ws
 
 Grammar::     = Declaration +/ ws
@@ -25,6 +26,7 @@ PreSequence   = Elements
 
 Sequence      = PreSequence
               | Sequence ^"&"  Elements /ws
+              | ^"~~"  Elements /ws
               | Sequence ^"&~" Elements /ws
 
 e             =                                   e ^"!"
@@ -44,13 +46,15 @@ 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)+ "\""
               | "\"\""
 
@@ -63,5 +67,5 @@ escaped       = "\n"::  "\\n"
               | "\r"::  "\\r"
               |         "\\" ~[nr]
 
-ws!           = [ \r\n]** ("//" ~[\n]* "\n" ws)?
-
+ws!          = [ \r\n]**
+             | [ \r\n]** "//" ~[\n]* "\n" ws