X-Git-Url: http://git.megacz.com/?p=sbp.git;a=blobdiff_plain;f=tests%2Fmeta.g;h=98a62a3ab47f95a36667b0629e9aba23cd2cb6ec;hp=11fee670fbbc658322cc91004c2ceed3e7c4be1f;hb=f33c05adc5aa3dd324c5352cdbd6f4b55359acad;hpb=05a1638649b2c25a1eaf26831b1bad48d73f57ef diff --git a/tests/meta.g b/tests/meta.g index 11fee67..98a62a3 100644 --- a/tests/meta.g +++ b/tests/meta.g @@ -1,5 +1,5 @@ -s ::= ws grammar ws => "gram" -ws !::= w** +s ::= grammar ws => "gram" +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_]++ -quoted ::= "\"" (([~\"\\] | escaped)+) "\"" +quoted ::= "\"" ((~[\"\\] | escaped)+) "\"" | "\"\"" => "" escaped ::= "\\n" => "\n" | "\\r" => "\r" - | "\\" [~nr] + | "\\" ~[nr]