diff options
| -rw-r--r-- | lisp/emacs-lisp/rx.el | 4 | ||||
| -rw-r--r-- | test/lisp/emacs-lisp/rx-tests.el | 4 |
2 files changed, 6 insertions, 2 deletions
diff --git a/lisp/emacs-lisp/rx.el b/lisp/emacs-lisp/rx.el index 52a35ffa2a7..6fde27831a0 100644 --- a/lisp/emacs-lisp/rx.el +++ b/lisp/emacs-lisp/rx.el | |||
| @@ -376,7 +376,9 @@ If NEGATED, negate the sense." | |||
| 376 | (push (cons arg arg) conses)) | 376 | (push (cons arg arg) conses)) |
| 377 | ((and (symbolp arg) | 377 | ((and (symbolp arg) |
| 378 | (let ((class (cdr (assq arg rx--char-classes)))) | 378 | (let ((class (cdr (assq arg rx--char-classes)))) |
| 379 | (and class (push class classes))))) | 379 | (and class |
| 380 | (or (memq class classes) | ||
| 381 | (push class classes)))))) | ||
| 380 | (t (error "Invalid rx `any' argument: %s" arg)))) | 382 | (t (error "Invalid rx `any' argument: %s" arg)))) |
| 381 | (let ((items | 383 | (let ((items |
| 382 | ;; Translate strings and conses into nonoverlapping intervals, | 384 | ;; Translate strings and conses into nonoverlapping intervals, |
diff --git a/test/lisp/emacs-lisp/rx-tests.el b/test/lisp/emacs-lisp/rx-tests.el index 4ecc805aead..26e39f8c8ed 100644 --- a/test/lisp/emacs-lisp/rx-tests.el +++ b/test/lisp/emacs-lisp/rx-tests.el | |||
| @@ -128,7 +128,9 @@ | |||
| 128 | (should (equal (rx (any) (not (any))) | 128 | (should (equal (rx (any) (not (any))) |
| 129 | "\\`a\\`[^z-a]")) | 129 | "\\`a\\`[^z-a]")) |
| 130 | (should (equal (rx (any "") (not (any ""))) | 130 | (should (equal (rx (any "") (not (any ""))) |
| 131 | "\\`a\\`[^z-a]"))) | 131 | "\\`a\\`[^z-a]")) |
| 132 | (should (equal (rx (any space ?a digit space)) | ||
| 133 | "[a[:space:][:digit:]]"))) | ||
| 132 | 134 | ||
| 133 | (ert-deftest rx-pcase () | 135 | (ert-deftest rx-pcase () |
| 134 | (should (equal (pcase "a 1 2 3 1 1 b" | 136 | (should (equal (pcase "a 1 2 3 1 1 b" |