mirror of
git://git.sv.gnu.org/emacs.git
synced 2025-12-10 08:10:21 -08:00
Translate or-patterns that (even partially) match single characters into character alternatives which are more efficient in matching, sometimes algorithmically so. Example: (or "%" (in "a-z") space) was previously translated to "%\\|[a-z]\\|[[:space:]]" but now becomes "[%a-z[:space:]]" Single-char patterns include `nonl` and `anychar`, which now can also be used in set operations (union, complement and intersection), and character classes. For example, `(or nonl "\n")` is now equivalent to `anychar`. * lisp/emacs-lisp/rx.el (rx--expand-def): Remove, split into... (rx--expand-def-form, rx--expand-def-symbol): ...these. (rx--translate-compat-symbol-entry) (rx--translate-compat-form-entry): New functions for handling the legacy extension mechanism. (rx--normalise-or-arg): Renamed to... (rx--normalise-char-pattern): ...this, and rewrite. (rx--all-string-or-args): Remove, split into... (rx--all-string-branches-p, rx--collect-or-strings): ...these. (rx--char-alt-union, rx--intersection-intervals) (rx--reduce-to-char-alt, rx--optimise-or-args) (rx--translate-char-alt, rx--human-readable): New. (rx--translate-or, rx--translate-not, rx--translate-intersection): Rewrite. (rx--charset-p, rx--intervals-to-alt, rx--charset-intervals) (rx--charset-union, rx--charset-intersection, rx--charset-all) (rx--translate-union): Remove. (rx--generate-alt): Decide whether to generate a negated character alternative. (rx--complement-intervals, rx--intersect-intervals) (rx--union-intervals): Rename to... (rx--interval-set-complement, rx--interval-set-intersection) (rx--interval-set-union): ...these. (rx--translate-symbol, rx--translate-form): Refactor extension processing. Handle synthetic `rx--char-alt` form. * test/lisp/emacs-lisp/rx-tests.el (rx-or, rx-char-any-raw-byte) (rx-any, rx-charset-or): Adapt to changes and extend. * test/lisp/emacs-lisp/rx-tests.el (rx--complement-intervals) (rx--union-intervals, rx--intersect-intervals): Rename to... (rx--interval-set-complement, rx--interval-set-union) (rx--interval-set-intersection): ...these. |
||
|---|---|---|
| .. | ||
| bytecomp-resources | ||
| edebug-resources | ||
| eieio-tests | ||
| faceup-resources | ||
| faceup-tests | ||
| macroexp-resources | ||
| package-resources | ||
| pp-resources | ||
| shadow-resources | ||
| testcover-resources | ||
| backquote-tests.el | ||
| backtrace-tests.el | ||
| benchmark-tests.el | ||
| bindat-tests.el | ||
| bytecomp-tests.el | ||
| cconv-tests.el | ||
| check-declare-tests.el | ||
| checkdoc-tests.el | ||
| cl-extra-tests.el | ||
| cl-generic-tests.el | ||
| cl-lib-tests.el | ||
| cl-macs-tests.el | ||
| cl-preloaded-tests.el | ||
| cl-print-tests.el | ||
| cl-seq-tests.el | ||
| comp-cstr-tests.el | ||
| comp-tests.el | ||
| copyright-tests.el | ||
| derived-tests.el | ||
| easy-mmode-tests.el | ||
| edebug-tests.el | ||
| ert-tests.el | ||
| ert-x-tests.el | ||
| find-func-tests.el | ||
| float-sup-tests.el | ||
| generator-tests.el | ||
| gv-tests.el | ||
| hierarchy-tests.el | ||
| icons-tests.el | ||
| let-alist-tests.el | ||
| lisp-mnt-tests.el | ||
| lisp-mode-tests.el | ||
| lisp-tests.el | ||
| macroexp-tests.el | ||
| map-tests.el | ||
| memory-report-tests.el | ||
| multisession-tests.el | ||
| nadvice-tests.el | ||
| oclosure-tests.el | ||
| package-tests.el | ||
| pcase-tests.el | ||
| pp-tests.el | ||
| range-tests.el | ||
| regexp-opt-tests.el | ||
| ring-tests.el | ||
| rmc-tests.el | ||
| rx-tests.el | ||
| seq-tests.el | ||
| shadow-tests.el | ||
| shortdoc-tests.el | ||
| subr-x-tests.el | ||
| syntax-tests.el | ||
| tabulated-list-tests.el | ||
| testcover-tests.el | ||
| text-property-search-tests.el | ||
| thunk-tests.el | ||
| timer-tests.el | ||
| unsafep-tests.el | ||
| vtable-tests.el | ||
| warnings-tests.el | ||