X-Git-Url: http://git.megacz.com/?p=sbp.git;a=blobdiff_plain;f=tests%2Fmeta.g;h=cc33104b4536e4385dc2f0cc984f988186b1c64e;hp=a540d78e7ab107f058b819b7c567c1a3eb379989;hb=475743c156fc5b02e79cd787b3176f5fa1877f83;hpb=b14c82d2c557d38194abc5b0ebbacc87e880b709 diff --git a/tests/meta.g b/tests/meta.g index a540d78..cc33104 100644 --- a/tests/meta.g +++ b/tests/meta.g @@ -1,20 +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 - | PreSequence ^"=>" ("[]"|"()"|word|Quoted) /ws + Sequence = psx:: PreSequence + | Sequence !ws ^"&" !ws Elements + | Sequence !ws ^"&~" !ws Elements ec = ~[\-\]\\] | escaped @@ -38,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)+) "\""