X-Git-Url: http://git.megacz.com/?p=sbp.git;a=blobdiff_plain;f=tests%2Fmeta.g;h=02464c31e2e0261a606b409b6fd0b2e158cf88b8;hp=f414867da2c83faf7a344d9353d24dc89932b750;hb=df76fcb56242a90011500ab89092d2108350a8ab;hpb=8129e3bcdf7df528a636daf66e0b35b1dceb153f diff --git a/tests/meta.g b/tests/meta.g index f414867..02464c3 100644 --- a/tests/meta.g +++ b/tests/meta.g @@ -1,26 +1,27 @@ +// use 'a'-'z' or 'a-z' instead of [a-z]? +// EOF token? +// #include (with renaming?) + s = ws! Grammar ws! Grammar = NonTerminal +/ ws -NonTerminal = Word "=" RHS /ws - -// use 'a'-'z' or 'a-z' instead of [a-z]? -// EOF token? -// #include (with renaming?) - +NonTerminal = Word "=" RHS /ws + | Word "*" ws! ^"=" ws! RHS + | Word "*/" Word ws! ^"=" ws! RHS + RHS = (Sequence +/ (ws! "|" ws!)) +/ (ws! ">" ws!) Elements = e*/ws -PreSequence = PS +PreSequence = Elements | (Quoted|Word) ^"::" PreSequence /ws > PreSequence ^"/" e /ws | PreSequence ^"->" e /ws -PS = Elements Sequence = psx:: PreSequence - | Sequence ^"&" PS /ws - | Sequence ^"&~" PS /ws + | Sequence ^"&" Elements /ws + | Sequence ^"&~" Elements /ws ec = ~[\-\]\\] | escaped @@ -52,7 +53,8 @@ NonTerminalReference = Word Literal = Quoted Word = [a-zA-Z0-9_]++ Quoted = "\"" ((~[\"\\] | escaped)+) "\"" - | "":: "\"\"" + | EmptyString + EmptyString = "\"\"" escaped = "\n":: "\\n" | "\r":: "\\r"