s ::= ws grammar ws => "gram"
-ws !::= w**
+ws !::= w** | w** "//" (~[\n]*) "\n" ws
wp !::= w++
grammar ::= r +/ ws => "grammar"
| (e+/ws ws)? "^" quoted (ws e+/ws)? => "ps2"
psy ::= ps
| ps wp ^"/" ws e
-psx ::= psy ^"?=>" e /ws
- | psy ^"!=>" e /ws
- > psy
+psx ::= psy => "psy"
+ | e "<-" psy /ws => "psyl"
+ | psy "->" e /ws => "psyr"
+ | e "<-" psy "->" e /ws => "psylr"
sequence ::= quoted => "qprod"
> psx
| psx ^"=>" (word|quoted) /ws
-ec ::= [~\-\]\\\~]
+ec ::= ~[\-\]\\]
| escaped
range ::= ec => "range"
| ^"()"
| ^"{" sequence "}" /ws
| ^"[" range* "]"
- | ^"[~" range* "]"
| (e ^"++" /ws > e ^"+" /ws)
| (e ^"++/" e /ws > e ^"+/" e /ws)
| "(" word ^")" /ws
> ^"(" alternatives ")" /ws
+ | ^"~" e
+
w !::= " "
- | "//" ([~\n]*) "\n"
| "\n"
| "\r"
-word ::= [a-zA-Z0-9_]+ !=> [a-zA-Z0-9_]
-quoted ::= "\"" (([~\"\\] | escaped)+) "\""
+word ::= [a-zA-Z0-9_]++
+quoted ::= "\"" ((~[\"\\] | escaped)+) "\""
| "\"\"" => ""
escaped ::= "\\n" => "\n"
| "\\r" => "\r"
- | "\\" [~nr]
+ | "\\" ~[nr]