emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

master b31e7c5: Fix xsdre-range-list-to-char-alternative problem with {P


From: Lars Ingebrigtsen
Subject: master b31e7c5: Fix xsdre-range-list-to-char-alternative problem with {P}
Date: Wed, 2 Dec 2020 06:23:22 -0500 (EST)

branch: master
commit b31e7c51d604eecef0602cf2e3c0cf469db3edc9
Author: Lars Ingebrigtsen <larsi@gnus.org>
Commit: Lars Ingebrigtsen <larsi@gnus.org>

    Fix xsdre-range-list-to-char-alternative problem with {P}
    
    * lisp/nxml/xsd-regexp.el (xsdre-range-list-to-char-alternative):
    Make (string-match (xsdre-translate "\\p{P}") "a-b") work
    (bug#24093) -- the "forbidden" characters don't have to be the
    first elements in a range.
---
 lisp/nxml/xsd-regexp.el | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/lisp/nxml/xsd-regexp.el b/lisp/nxml/xsd-regexp.el
index 622ba91..3ce59b7 100644
--- a/lisp/nxml/xsd-regexp.el
+++ b/lisp/nxml/xsd-regexp.el
@@ -387,9 +387,15 @@ consisting of a single char alternative delimited with []."
                        ((eq first ?-)
                         (setq hyphen t)
                         (setq first (1+ first)))
+                       ((eq last ?-)
+                        (setq hyphen t)
+                        (setq last (1- last)))
                        ((eq first ?\])
                         (setq close-bracket t)
-                        (setq first (1+ first))))
+                        (setq first (1+ first)))
+                       ((eq last ?\])
+                        (setq close-bracket t)
+                        (setq last (1- last))))
                  (<= first last)))
       (when (<= first last)
        (setq chars



reply via email to

[Prev in Thread] Current Thread [Next in Thread]