X-Git-Url: http://git.megacz.com/?p=sbp.git;a=blobdiff_plain;f=tests%2Fmeta.g;h=02464c31e2e0261a606b409b6fd0b2e158cf88b8;hp=f2dfb17c81f70d42beea4964a7daac5ddb96f7d4;hb=7ae0f5a59e73016bac97ee23da9f0b10bce6fa12;hpb=e9e8509741c9f1406defa18655315ad205faba1f diff --git a/tests/meta.g b/tests/meta.g index f2dfb17..02464c3 100644 --- a/tests/meta.g +++ b/tests/meta.g @@ -1,18 +1,20 @@ +// 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:: Elements +PreSequence = Elements | (Quoted|Word) ^"::" PreSequence /ws > PreSequence ^"/" e /ws | PreSequence ^"->" e /ws @@ -51,7 +53,8 @@ NonTerminalReference = Word Literal = Quoted Word = [a-zA-Z0-9_]++ Quoted = "\"" ((~[\"\\] | escaped)+) "\"" - | "":: "\"\"" + | EmptyString + EmptyString = "\"\"" escaped = "\n":: "\\n" | "\r":: "\\r"