aboutsummaryrefslogtreecommitdiff
path: root/grammars/bp.bp
diff options
context:
space:
mode:
authorBruce Hill <bruce@bruce-hill.com>2021-05-19 23:41:57 -0700
committerBruce Hill <bruce@bruce-hill.com>2021-05-19 23:41:57 -0700
commit355e06a58e918c6c1d39902b0a14029a16c323ba (patch)
tree0c3aab71519db02338cd70cddbac1358da33fdb2 /grammars/bp.bp
parent3f0ab96f7f1c60585be7fa39d0595674bf4f6bb1 (diff)
Added ~ and !~ operators as replacements for == and !=
Diffstat (limited to 'grammars/bp.bp')
-rw-r--r--grammars/bp.bp10
1 files changed, 5 insertions, 5 deletions
diff --git a/grammars/bp.bp b/grammars/bp.bp
index ed7eb80..7240729 100644
--- a/grammars/bp.bp
+++ b/grammars/bp.bp
@@ -14,18 +14,18 @@ Def: @name=id __ `: __ (
# This is used for command line arguments:
String-pattern: ..%(\n / Nodent / Escape / `\ pat [`;])$$
-pat: simple-pat !(__("!="/"==")) / suffixed-pat
+pat: simple-pat !(__("!~"/"~")) / suffixed-pat
simple-pat: Upto-and / Dot / String / Chars / Nodent / Escape-range
/ Escape / Repeat / Optional / No / After / Before / Capture
/ Start-of-File / Start-of-Line / End-of-File / End-of-Line / Ref / parens
suffixed-pat: (
- Eq-pat
- / Not-eq-pat
+ Match-pat
+ / Not-match-pat
)
-Eq-pat: @first=(suffixed-pat / simple-pat)__"=="__@second=pat
-Not-eq-pat: @first=(suffixed-pat / simple-pat)__"!="__@second=pat
+Match-pat: @first=(suffixed-pat / simple-pat)__"~"__@second=(pat / @!=(''=> "Expected pattern after '~'"))
+Not-match-pat: @first=(suffixed-pat / simple-pat)__"!~"__@second=(pat / @!=(''=> "Expected pattern after '!~'"))
Dot: `. !`.
String: (