[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/bnf-mode 15b8b751f1 1/5: Drop bnf-rx-constituents and u
From: |
ELPA Syncer |
Subject: |
[elpa] externals/bnf-mode 15b8b751f1 1/5: Drop bnf-rx-constituents and use modern rx API |
Date: |
Sun, 15 Sep 2024 09:57:34 -0400 (EDT) |
branch: externals/bnf-mode
commit 15b8b751f1b403547b752e2f9fba8138659a045f
Author: Serghei Iakovlev <egrep@protonmail.ch>
Commit: Serghei Iakovlev <git@serghei.pl>
Drop bnf-rx-constituents and use modern rx API
---
bnf-mode.el | 23 +++++++++++------------
1 file changed, 11 insertions(+), 12 deletions(-)
diff --git a/bnf-mode.el b/bnf-mode.el
index bade8c6c32..008d505dc4 100644
--- a/bnf-mode.el
+++ b/bnf-mode.el
@@ -55,13 +55,13 @@
;;;; Specialized rx
(eval-when-compile
- (defconst bnf-rx-constituents
- `((bnf-rule-name . ,(rx (and
- (1+ (or alnum digit))
- (0+ (or alnum digit
- (in "!\"#$%&'()*+,-./:;=?@[]^_`{|}~")
- (in " \t"))))))
- "Additional special sexps for `bnf-rx'."))
+ ;; Additional special sexps for `bnf-rx'.
+ (rx-define bnf-rule-name
+ (seq
+ (1+ (or alnum digit))
+ (0+ (or alnum digit
+ (in "!\"#$%&'()*+,-./:;=?@[]^_`{|}~")
+ (in " \t")))))
(defmacro bnf-rx (&rest sexps)
"BNF-specific replacement for `rx'.
@@ -76,11 +76,10 @@ are available:
(see URL `https://www.masswerk.at/algol60/report.htm').
See `rx' documentation for more information about REGEXPS param."
- (let ((rx-constituents (append bnf-rx-constituents rx-constituents)))
- (rx-to-string (cond ((null sexps) (error "No regexp is provided"))
- ((cdr sexps) `(and ,@sexps))
- (t (car sexps)))
- t))))
+ (rx-to-string (cond ((null sexps) (error "No regexp is provided"))
+ ((cdr sexps) `(and ,@sexps))
+ (t (car sexps)))
+ t)))
;;;; Font Locking