]> git.eshelyaron.com Git - emacs.git/commit
Support (rx (and (regexp EXPR) (literal EXPR))) (Bug#36237)
authorNoam Postavsky <npostavs@gmail.com>
Fri, 14 Jun 2019 12:43:17 +0000 (08:43 -0400)
committerNoam Postavsky <npostavs@gmail.com>
Wed, 26 Jun 2019 02:00:03 +0000 (22:00 -0400)
commitb59ffd2290ff744ca4e7cc2748ba6b66fb2f99f1
tree650ab12b77ba2cf9918ebc9bce586ce22ab7d52a
parent29babad7286bff235407e883a4ff61bae49a2e5e
Support (rx (and (regexp EXPR) (literal EXPR))) (Bug#36237)

* lisp/emacs-lisp/rx.el (rx-regexp): Allow non-string forms.
(rx-constituents): Add literal constituent, which is like a plain
STRING form, but allows arbitrary lisp expressions.
(rx-literal): New function.
(rx-compile-to-lisp): New variable.
(rx--subforms): New helper function for handling subforms, including
non-constant case.
(rx-group-if, rx-and, rx-or, rx-=, rx->=, rx-repeat, rx-submatch)
(rx-submatch-n, rx-kleene, rx-atomic-p): Use it to handle non-constant
subforms.
(rx): Document new form, wrap non-constant forms with concat call.
* test/lisp/emacs-lisp/rx-tests.el (rx-tests--match): New macro.
(rx-nonstring-expr, rx-nonstring-expr-non-greedy): New tests.
* etc/NEWS: Announce changes.
etc/NEWS
lisp/emacs-lisp/rx.el
test/lisp/emacs-lisp/rx-tests.el