emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

master 0cbfb7e 3/4: ; * lisp/emacs-lisp/rx.el (rx--pcase-macroexpander):


From: Mattias Engdegård
Subject: master 0cbfb7e 3/4: ; * lisp/emacs-lisp/rx.el (rx--pcase-macroexpander): slight rephrase
Date: Sat, 29 May 2021 03:48:01 -0400 (EDT)

branch: master
commit 0cbfb7e7951e3a3e277835958f6daa139a653c52
Author: Mattias Engdegård <mattiase@acm.org>
Commit: Mattias Engdegård <mattiase@acm.org>

    ; * lisp/emacs-lisp/rx.el (rx--pcase-macroexpander): slight rephrase
---
 lisp/emacs-lisp/rx.el | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)

diff --git a/lisp/emacs-lisp/rx.el b/lisp/emacs-lisp/rx.el
index 43bd84d..071d390 100644
--- a/lisp/emacs-lisp/rx.el
+++ b/lisp/emacs-lisp/rx.el
@@ -1442,10 +1442,9 @@ following constructs:
                    introduced by a previous (let REF ...)
                    construct."
   (let* ((rx--pcase-vars nil)
-         (regexp (rx--to-expr (rx--pcase-transform (cons 'seq regexps))))
-         (nvars (length rx--pcase-vars)))
+         (regexp (rx--to-expr (rx--pcase-transform (cons 'seq regexps)))))
     `(and (pred stringp)
-          ,(pcase nvars
+          ,(pcase (length rx--pcase-vars)
             (0
              ;; No variables bound: a single predicate suffices.
              `(pred (string-match ,regexp)))
@@ -1458,7 +1457,7 @@ following constructs:
                          (match-string 1 s)
                        0))
                    (and ,(car rx--pcase-vars) (pred (not numberp)))))
-            (_
+            (nvars
              ;; Pack the submatches into a dotted list which is then
              ;; immediately destructured into individual variables again.
              ;; This is of course slightly inefficient.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]