diff options
Diffstat (limited to 'grammars/bpeg.bpeg')
| -rw-r--r-- | grammars/bpeg.bpeg | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/grammars/bpeg.bpeg b/grammars/bpeg.bpeg index 380bf9c..88dc6b1 100644 --- a/grammars/bpeg.bpeg +++ b/grammars/bpeg.bpeg @@ -49,7 +49,7 @@ Repeat: ( Optional: `[ __ extended-pat (__`] / @!={=> "Expected closing square bracket here"}) After: `< _ pat Before: `> _ pat -Capture: `@ [_ `[ @capture-name=(...>(`]/$$)) (`] / @!={=>"Expected closing bracket here"})] _ @capture=pat +Capture: `@ [_ @capture-name=(id/`!) !"=>" `=] _ (@capture=pat / @!={=> "Expected pattern to capture"}) Replace: `{ __ ( [@replace-pat=extended-pat __] "=>" [__ @replacement=String] ) __ (`} / @!={=> "Expected closing brace here"}) @@ -71,7 +71,8 @@ $: !. id: "^^" / "^" / "__" / "_" / "$$" / "$" / (`a-z/`A-Z) 0+(`a-z/`A-Z/`0-9/`-) -hash-comment: `# .. $ +line-comment: `# .. $ +block-comment: "#(" 0+(block-comment / !")#" .) ")#" # Note: comments are undefined by default in regular BPEG -comment: hash-comment +comment: block-comment / line-comment |
