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
f2dfb17
..
02464c3
100644
(file)
--- 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
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
RHS = (Sequence +/ (ws! "|" ws!)) +/ (ws! ">" ws!)
Elements = e*/ws
-PreSequence = ps:: Elements
+PreSequence = Elements
| (Quoted|Word) ^"::" PreSequence /ws
> PreSequence ^"/" e /ws
| PreSequence ^"->" e /ws
| (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)+) "\""
Literal = Quoted
Word = [a-zA-Z0-9_]++
Quoted = "\"" ((~[\"\\] | escaped)+) "\""
- | "":: "\"\""
+ | EmptyString
+ EmptyString = "\"\""
escaped = "\n":: "\\n"
| "\r":: "\\r"
escaped = "\n":: "\\n"
| "\r":: "\\r"