projects
/
sbp.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
checkpoint
[sbp.git]
/
tests
/
meta.g
diff --git
a/tests/meta.g
b/tests/meta.g
index
a51109f
..
eb793c5
100644
(file)
--- a/
tests/meta.g
+++ b/
tests/meta.g
@@
-1,4
+1,4
@@
-s = !ws Grammar !ws
+s = ws! Grammar ws!
Grammar = NonTerminal +/ ws
Grammar = NonTerminal +/ ws
@@
-9,7
+9,7
@@
NonTerminal = Word "=" RHS /ws
// #include (with renaming?)
// ANTLR uses ! and ^ suffixes
// #include (with renaming?)
// ANTLR uses ! and ^ suffixes
-RHS = (Sequence +/ (!ws "|" !ws)) +/ (!ws ">" !ws)
+RHS = (Sequence +/ (ws! "|" ws!)) +/ (ws! ">" ws!)
Elements = e*/ws
Elements = e*/ws
@@
-42,19
+42,19
@@
e = (Quoted|Word) ^":" e
| e ^"*" /ws -> ~[*]
| e ^"**/" e /ws
| e ^"*/" e /ws
| e ^"*" /ws -> ~[*]
| e ^"**/" e /ws
| e ^"*/" e /ws
- | ^"!" e /ws
+ | e ^"!"
| e ^"?" /ws
| ^"^" Quoted
| e ^"?" /ws
| ^"^" Quoted
- | "(" Word ^")" /ws
+ | Quoted ^"^"
> ^"(" RHS ")" /ws
| ^"~" e
> ^"(" RHS ")" /ws
| ^"~" e
- > "^^":: "^" e
NonTerminalReference = Word
NonTerminalReference = Word
-Literal = Quoted
-Word = [a-zA-Z0-9_]++
-Quoted = "\"" ((~[\"\\] | escaped)+) "\""
- | "":: "\"\""
+Literal = Quoted
+Word = [a-zA-Z0-9_]++
+Quoted = "\"" ((~[\"\\] | escaped)+) "\""
+ | "":: "\"\""
+
escaped = "\n":: "\\n"
| "\r":: "\\r"
| "\\" ~[nr]
escaped = "\n":: "\\n"
| "\r":: "\\r"
| "\\" ~[nr]