X-Git-Url: http://git.megacz.com/?p=sbp.git;a=blobdiff_plain;f=tests%2Fmeta.g;h=884f2aaaf4290b6146cbac95a95f6be8ab5ba68a;hp=ed87f5c555bc4abb1198a6c8170d5c9cfa249195;hb=242a8711e98cbd3ed6d05271bf910fde38e9be9a;hpb=87f214f3da9f43c3ab93923313845c372f9a96be diff --git a/tests/meta.g b/tests/meta.g index ed87f5c..884f2aa 100644 --- a/tests/meta.g +++ b/tests/meta.g @@ -1,5 +1,5 @@ s ::= ws grammar ws => "gram" -ws !::= w** | ws "//" ([~\n]*) "\n" ws +ws !::= w** | w** "//" (~[\n]*) "\n" ws wp !::= w++ grammar ::= r +/ ws => "grammar" @@ -16,14 +16,15 @@ ps ::= e*/ws => "ps" | (e+/ws ws)? "^" quoted (ws e+/ws)? => "ps2" psy ::= ps | ps wp ^"/" ws e -psx ::= psy ^"?=>" e /ws - | psy ^"!=>" e /ws - > psy +psx ::= psy => "psy" + | e "<-" psy /ws => "psyl" + | psy "->" e /ws => "psyr" + | e "<-" psy "->" e /ws => "psylr" sequence ::= quoted => "qprod" > psx | psx ^"=>" (word|quoted) /ws -ec ::= [~\-\]\\\~] +ec ::= ~[\-\]\\] | escaped range ::= ec => "range" @@ -34,7 +35,6 @@ e ::= word => "nonTerminal" | ^"()" | ^"{" sequence "}" /ws | ^"[" range* "]" - | ^"[~" range* "]" | (e ^"++" /ws > e ^"+" /ws) | (e ^"++/" e /ws > e ^"+/" e /ws) @@ -44,14 +44,16 @@ e ::= word => "nonTerminal" | "(" word ^")" /ws > ^"(" alternatives ")" /ws + | ^"~" e + w !::= " " | "\n" | "\r" word ::= [a-zA-Z0-9_]++ -quoted ::= "\"" (([~\"\\] | escaped)+) "\"" +quoted ::= "\"" ((~[\"\\] | escaped)+) "\"" | "\"\"" => "" escaped ::= "\\n" => "\n" | "\\r" => "\r" - | "\\" [~nr] + | "\\" ~[nr]