X-Git-Url: http://git.megacz.com/?p=sbp.git;a=blobdiff_plain;f=tests%2Fmeta.g;h=884f2aaaf4290b6146cbac95a95f6be8ab5ba68a;hp=8be950d3eba351373e4c573f237fe796dc764f1d;hb=242a8711e98cbd3ed6d05271bf910fde38e9be9a;hpb=56319e11eb20cb67c4221b0d7a2567ec3b2df002 diff --git a/tests/meta.g b/tests/meta.g index 8be950d..884f2aa 100644 --- a/tests/meta.g +++ b/tests/meta.g @@ -1,5 +1,5 @@ s ::= ws grammar ws => "gram" -ws !::= w** +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,15 +44,16 @@ e ::= word => "nonTerminal" | "(" word ^")" /ws > ^"(" alternatives ")" /ws + | ^"~" e + w !::= " " - | "//" ([~\n]*) "\n" | "\n" | "\r" -word ::= [a-zA-Z0-9_]+ !=> [a-zA-Z0-9_] -quoted ::= "\"" (([~\"\\] | escaped)+) "\"" +word ::= [a-zA-Z0-9_]++ +quoted ::= "\"" ((~[\"\\] | escaped)+) "\"" | "\"\"" => "" escaped ::= "\\n" => "\n" | "\\r" => "\r" - | "\\" [~nr] + | "\\" ~[nr]