diff options
author | Mattias EngdegÄrd <mattiase@acm.org> | 2019-01-16 14:57:12 +0100 |
---|---|---|
committer | Eli Zaretskii <eliz@gnu.org> | 2019-02-01 11:39:43 +0200 |
commit | decdff76fb185f87145940cc3b91549f84600a87 (patch) | |
tree | cc3bc3fd672616f1880472c066bee367450e072d /lisp/emacs-lisp | |
parent | b01a4295c2f9bb58858880e4e28b05cc8396791c (diff) | |
download | emacs-decdff76fb185f87145940cc3b91549f84600a87.tar.gz emacs-decdff76fb185f87145940cc3b91549f84600a87.tar.bz2 emacs-decdff76fb185f87145940cc3b91549f84600a87.zip |
Make the rx operators \? and \?? behave correctly
* lisp/emacs-lisp/rx.el (rx-kleene):
Treat \? and \?? like ? and ?? (Bug#34100).
* test/lisp/emacs-lisp/rx-tests.el: Add tests for all repetition operators.
Diffstat (limited to 'lisp/emacs-lisp')
-rw-r--r-- | lisp/emacs-lisp/rx.el | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/lisp/emacs-lisp/rx.el b/lisp/emacs-lisp/rx.el index a39fe55c322..8b4551d0d36 100644 --- a/lisp/emacs-lisp/rx.el +++ b/lisp/emacs-lisp/rx.el @@ -733,8 +733,8 @@ If OP is anything else, produce a greedy regexp if `rx-greedy-flag' is non-nil." (rx-check form) (setq form (rx-trans-forms form)) - (let ((suffix (cond ((memq (car form) '(* + ?\s)) "") - ((memq (car form) '(*? +? ??)) "?") + (let ((suffix (cond ((memq (car form) '(* + \? ?\s)) "") + ((memq (car form) '(*? +? \?? ??)) "?") (rx-greedy-flag "") (t "?"))) (op (cond ((memq (car form) '(* *? 0+ zero-or-more)) "*") |