aboutsummaryrefslogtreecommitdiff
path: root/grammars/bp.bp
diff options
context:
space:
mode:
authorBruce Hill <bruce@bruce-hill.com>2022-05-12 12:11:28 -0400
committerBruce Hill <bruce@bruce-hill.com>2022-05-12 12:11:28 -0400
commit56da250d69615d70774dbc361fa2693cca1e3df4 (patch)
treedbdeb2be018c5f10c13f721965b3bebff2283e88 /grammars/bp.bp
parente484a888151460ffc25a8478d9a9c9836652a35c (diff)
Split backref/named captures into separate concepts for performance
reasons.
Diffstat (limited to 'grammars/bp.bp')
-rw-r--r--grammars/bp.bp4
1 files changed, 2 insertions, 2 deletions
diff --git a/grammars/bp.bp b/grammars/bp.bp
index 2782934..a77881b 100644
--- a/grammars/bp.bp
+++ b/grammars/bp.bp
@@ -6,7 +6,7 @@
# language grammars.
Grammar: __ *(Def [__`;])%__ __ [@error=(+(./\n) => "Could not parse this code: @0")]
-Def: @name=id __ `: __ (
+Def: @name=id __ 1-2`: __ (
@definition=extended-pat
/ $$ @error=(=>"No definition for rule")
/ @error=(..%\n>(`;/id_`:/$) => "Invalid definition: @0"))
@@ -62,7 +62,7 @@ Repeat: (
Optional: `[ __ extended-pat (__`] / @error=(=>"Expected closing square bracket here"))
After: `< __ pat
Before: `> __ pat
-Capture: `@ [__ @capture-name=(id/`!) __ !"=>" `=] __ (@capture=pat / @error=(=>"Expected pattern to capture"))
+Capture: `@ [__ @capture-name=(id/`!) __ !"=>" `=,:] __ (@capture=pat / @error=(=>"Expected pattern to capture"))
Replace: (
@replace-pat=[Chain-noreplace / pat] __ "=>" (__ @replacement=String / @error=(=>"Expected replacement string"))
)