diff options
| author | Bruce Hill <bruce@bruce-hill.com> | 2020-09-17 20:10:09 -0700 |
|---|---|---|
| committer | Bruce Hill <bruce@bruce-hill.com> | 2020-09-17 20:10:09 -0700 |
| commit | 53ef6fd628201aa32b16934efb23ee8039dbce2e (patch) | |
| tree | e9be024d18e7d6b424f8b75141362177d9b0e052 /grammars/bpeg.bpeg | |
| parent | 4cfcdae3a1d6ec4963af436318907483e87c0a5b (diff) | |
Some fixes, including to "\\" and ".."/"..."
Diffstat (limited to 'grammars/bpeg.bpeg')
| -rw-r--r-- | grammars/bpeg.bpeg | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/grammars/bpeg.bpeg b/grammars/bpeg.bpeg index 43d6834..4c46c6b 100644 --- a/grammars/bpeg.bpeg +++ b/grammars/bpeg.bpeg @@ -17,7 +17,6 @@ suffixed-pat: Eq-pat / simple-pat 0-1( @[!]{`* => "'*' is not a BPEG operator. Use 0+<pat> instead of <pat>*"} / @[!]{`+ => "'+' is not a BPEG operator. Use 1+<pat> instead of <pat>+"} / @[!]{`? => "'?' is not a BPEG operator. Use 0-1<pat> instead of <pat>?"} - / @[!]{`= => "'=' is not valid here. Perhaps you meant '==' or ':'"} ) Eq-pat: @[first]simple-pat "==" @[second]pat @@ -38,27 +37,28 @@ escape-sequence: ( `n/`t/`r/`e/`b/`a/`v / 1-3 `0-7 / `x 2 (`0-9/`a-f/`A-F) + / . ) No: `! (_@pat / @[!]{=>"Expected a pattern after the exclamation mark"}) Nodent: `| -Upto-and: 2-3`. 0-1(_@pat) +Upto-and: 2-3`. 0-1(_@simple-pat) Repeat: ( @[min]int _ `- _ @[max]int / @[min]int _ `+ @[max]'' / @[min]@[max]int - ) _ @[repeat-pat]pat 0-1( _ `% _ @[sep]pat) + ) __ @[repeat-pat]pat 0-1(__`%__@[sep]pat) After: `< _ pat Before: `> _ pat Capture: `@ 0-1(_ `[ @[capture-name](...>(`]/$$)) (`] / @[!]{=>"Expected closing bracket here"})) _ @[capture]pat Replace: `{ __ ( 0-1(@[replace-pat]extended-pat __) "=>" 0-1(__ @[replacement]String) ) __ (`} / @[!]{=> "Expected closing brace here"}) -Ref: @[name]id !>(_`:) +Ref: @[name]id !(_`:) parens: `( __ extended-pat (__ `) / @[!]{=> "Expected closing parenthesis here"}) -Chain: 2+@pat % __ -Otherwise: 2+@(Chain/pat) % (__`/__) +Chain: 2+@pat%__ +Otherwise: 2+@(Chain/pat)%(__`/__) extended-pat: Otherwise / Chain / pat # Special-symbol rules: |
