aboutsummaryrefslogtreecommitdiff
path: root/grammars/bp.bp
diff options
context:
space:
mode:
authorBruce Hill <bruce@bruce-hill.com>2021-01-20 15:23:57 -0800
committerBruce Hill <bruce@bruce-hill.com>2021-01-20 15:23:57 -0800
commitb4c8a33a0cbf4938b53458ded4d46efc6e8820ab (patch)
treeb5823b03aa1d6ab8dc5dc92cd543ca77c1c0b3c2 /grammars/bp.bp
parent3c38aef78c637f933da7111bc55b77d94a824afa (diff)
Tweaked `..` syntax to make it more flexible (now: `.. % skip pat`)
Diffstat (limited to 'grammars/bp.bp')
-rw-r--r--grammars/bp.bp8
1 files changed, 4 insertions, 4 deletions
diff --git a/grammars/bp.bp b/grammars/bp.bp
index 0b222ca..725d213 100644
--- a/grammars/bp.bp
+++ b/grammars/bp.bp
@@ -5,14 +5,14 @@
# The grammar files provided with BP are not otherwise intended to be full
# language grammars.
-Grammar: __ *(Def [__`;])%__ __ ($$ / @!=(..$$%\n => "Could not parse this code"))
+Grammar: __ *(Def [__`;])%__ __ ($$ / @!=(..%\n$$ => "Could not parse this code"))
Def: @name=id __ `: __ (
@definition=extended-pat
/ $$ @!=(''=>"No definition for rule")
- / @!=(..>(`;/id_`:/$)%\n => "Invalid definition: @0"))
+ / @!=(..%\n>(`;/id_`:/$) => "Invalid definition: @0"))
# This is used for command line arguments:
-String-pattern: ..$$ % (\n / Nodent / Escape / `\ pat [`;])
+String-pattern: ..%(\n / Nodent / Escape / `\ pat [`;])$$
pat: simple-pat !(__("!="/"==")) / suffixed-pat
simple-pat: Upto-and / Dot / String / Chars / Nodent / Escape-range
@@ -47,7 +47,7 @@ escape-sequence: (
)
No: `! (__@pat / @!=(''=>"Expected a pattern after the exclamation mark"))
Nodent: `\ `N
-Upto-and: ".." [__@first=simple-pat] [__`%__@second=simple-pat]
+Upto-and: ".." [__`%__@second=simple-pat] [__@first=simple-pat]
Repeat: (
@min=(''=>'0') (`*=>"-") @max=(''=>'∞')
/ @min=int __ `- __ @max=int