X-Git-Url: http://git.megacz.com/?p=sbp.git;a=blobdiff_plain;f=tests%2Fmeta.g;h=cc33104b4536e4385dc2f0cc984f988186b1c64e;hp=1852a1775fc6e8e794ff7d27e724910f3965b1b5;hb=475743c156fc5b02e79cd787b3176f5fa1877f83;hpb=017b5ed533ca298fe5ae1078e2a59da1d2d95ea2 diff --git a/tests/meta.g b/tests/meta.g index 1852a17..cc33104 100644 --- a/tests/meta.g +++ b/tests/meta.g @@ -1,19 +1,19 @@ -s = gram:: !ws Grammar ws +s = ws gram:Grammar ws Grammar = grammar:: NonTerminal +/ ws NonTerminal = word !wp ^"=" !wp RHS -RHS = (Conjuncts +/ (!ws "|" !ws)) +/ (!ws ">" !ws) +RHS = (Sequence +/ (!ws "|" !ws)) +/ (!ws ">" !ws) -Conjuncts = Sequence - | Sequence ^"&" Elements /ws - | Sequence ^"&~" Elements /ws Elements = e*/ws PreSequence = ps:: Elements | PreSequence !wp ^"/" !ws e | PreSequence ^"->" e /ws | (Quoted|word) ^"::" PreSequence /ws + Sequence = psx:: PreSequence + | Sequence !ws ^"&" !ws Elements + | Sequence !ws ^"&~" !ws Elements ec = ~[\-\]\\] | escaped @@ -37,11 +37,11 @@ e = (Quoted|word) ^":" e | e ^"*/" e /ws | ^"!" e /ws | e ^"?" /ws - | ^"^" Quoted /ws - - | "(" word ^")" /ws + | ^"^" Quoted + | "(" word ^")" /ws > ^"(" RHS ")" /ws | ^"~" e + > "^^":: "^" e word = [a-zA-Z0-9_]++ Quoted = "\"" ((~[\"\\] | escaped)+) "\""