X-Git-Url: http://git.megacz.com/?p=sbp.git;a=blobdiff_plain;f=tests%2Fmeta.g;h=f06eb2f42010e4165a6b498eb7203b98d8645e84;hp=b1552f1bdf129fe3a32e46e0c23d62ff3c189c86;hb=61a0c83fd40b98292b2dfe1eaba237eb804b2cb4;hpb=22a2ca7685dcf29e9ddcc6e26443ea0277385fca diff --git a/tests/meta.g b/tests/meta.g index b1552f1..f06eb2f 100644 --- a/tests/meta.g +++ b/tests/meta.g @@ -1,3 +1,4 @@ +//funkanomitron s = ws Grammar ws Grammar:: = Declaration +/ ws @@ -14,7 +15,7 @@ NonTerminal = NonTerminal:: Word ws "=" ws RHS | Word "*" ws ^"=" ws RHS | Word "*/" Word ws ^"=" ws RHS -RHS:: = ("|":: Sequence +/ (ws "|" ws)) +/ (ws ">" ws) +RHS:: = ("|":: Sequence +/ (ws "|" ws)) +/ (ws (">" -> ~">") ws) Elements:: = e*/ws @@ -25,6 +26,7 @@ PreSequence = Elements Sequence = PreSequence | Sequence ^"&" Elements /ws + | ^"~~" Elements /ws | Sequence ^"&~" Elements /ws e = e ^"!" @@ -44,24 +46,32 @@ e = e ^"!" | e ^"*/" e /ws | e ^"?" /ws | ^"^" Quoted + | ^"`" e + | ^"..." | "(" Word ^")" > ^"(" RHS ")" /ws - | ^"~" e + | "~":: ("~" -> ~"~")! e | ^"\\{" | ^"\\}" + | ^">>" + | ^"<<" -Word:: = [.a-zA-Z0-9_]++ +Word:: = [.a-zA-Z0-9_]++ &~ "."+ Quoted:: = "\"" (~[\"\\] | escaped)+ "\"" | "\"\"" Range:: = ec | ec "-" ec + | "<<":: [<][<] + | ">>":: [>][>] -ec = ~[\-\]\\] +ec = ~[\-\]\\<>] + | [>] -> ~[>] + | [<] -> ~[<] | escaped escaped = "\n":: "\\n" | "\r":: "\\r" | "\\" ~[nr] -ws! = [ \r\n]** ("//" ~[\n]* "\n" ws)? - +ws! = [ \r\n]** + | [ \r\n]** "//" ~[\n]* "\n" ws