diff options
author | Mattias EngdegÄrd <mattiase@acm.org> | 2019-03-12 14:39:47 +0100 |
---|---|---|
committer | Mattias EngdegÄrd <mattiase@acm.org> | 2019-03-19 20:30:15 +0100 |
commit | 3ed1621d843e057ad879fbed3605d32f55a065b9 (patch) | |
tree | e4bd97bb649e9b6c05a0601eba5ef754f0d3310c /etc | |
parent | c0936672876bccc15e7899e83d8ab99910f8feee (diff) | |
download | emacs-3ed1621d843e057ad879fbed3605d32f55a065b9.tar.gz |
Disallow reversed char ranges in `rx'
(any "a-Z0-9") generated "[0-9]", and (any (?9 . ?0)) generated "[9-0]".
Reversed ranges are either mistakes or abuse. Neither should be allowed.
etc/NEWS: Explain the change.
lisp/emacs-lisp/rx.el (rx): Document.
(rx-check-any-string, rx-check-any): Add error checks for reversed ranges.
test/lisp/emacs-lisp/rx-tests.el (rx-char-any-range-bad): New test.
Diffstat (limited to 'etc')
-rw-r--r-- | etc/NEWS | 7 |
1 files changed, 7 insertions, 0 deletions
@@ -1336,6 +1336,13 @@ they are now allocated like any other pseudovector. As a result, the 'misc' component, and the 'misc-objects-consed' variable has been removed. ++++ +** Reversed character ranges are no longer permitted in rx. +Previously, ranges where the starting character is greater than the +ending character were silently omitted. +For example, '(rx (any "@z-a" (?9 . ?0)))' would match '@' only. +Now, such rx expressions generate an error. + * Lisp Changes in Emacs 27.1 |