X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=tests%2Fmeta.g;h=d11981b5d8890588c9b874536c863f54684870cb;hb=f1321301726919a74918c3f09e58e78f66017644;hp=79e315975a057be7343d3f5e040643f514456541;hpb=a0c19e9b49c4d4e662586da3075979bd59abad6b;p=sbp.git diff --git a/tests/meta.g b/tests/meta.g index 79e3159..d11981b 100644 --- a/tests/meta.g +++ b/tests/meta.g @@ -1,24 +1,25 @@ s ::= Grammar ws => "gram" -w !::= " " +w ::= " " | "\n" | "\r" -ws !::= w** | w** "//" (~[\n]*) "\n" ws -wp !::= w++ +ws ::= w** => () + | w** "//" (~[\n]*) "\n" ws => () +wp ::= w++ Grammar ::= r +/ ws => "grammar" r ::= word ^"::=" alternatives /ws | word ^"!::=" alternatives /ws -alternatives ::= (Conjuncts +/ (ws "|" ws)) +/ (ws ">" ws) +alternatives ::= (Conjuncts +/ (!ws "|" !ws)) +/ (!ws ">" !ws) Conjuncts ::= Sequence | Sequence ^"&" e*/ws /ws | Sequence ^"&~" e*/ws /ws ps ::= e*/ws => "ps" - | (e+/ws ws)? "^" Quoted (ws e+/ws)? => "ps2" + | (e+/ws !ws)? "^" Quoted (!ws e+/ws)? => "ps2" psy ::= ps - | ps wp ^"/" ws e + | ps !wp ^"/" !ws e psx ::= psy => "psy" // | e "<-" psy /ws => "psyl" | psy "->" e /ws => "psyr" @@ -26,7 +27,7 @@ psx ::= psy => "psy" Sequence ::= Quoted => "qprod" > psx => "psx" | psx "=>" ^"[]" /ws - | psx ^"=>" (word|Quoted) /ws + | psx ^"=>" ("()"|word|Quoted) /ws ec ::= ~[\-\]\\] | escaped