Open gengar opened 8 months ago
The "-" case always matches on "[^0-9>]" and never on latter.
Could you show some example of the problem?
AFAICT your patch changes the regexp such that subgroup 2 is always matched, which doesn't seem right.
OK, here is a example:
(let ((operator-char "[-!$%&*+./:<=>?@^|~]")
(operator-char-no> "[-!$%&*+./:<=?@^|~]"))
(let ((reg1 (concat "\\(-\\)\\(?:[^0-9>]\\|\\("
operator-char-no> operator-char "*\\)\\)"))
(reg2 (concat "\\(-\\)\\("
operator-char-no>
operator-char "*\\|\\(?:[^0-9>]\\)\\)"))
(str "-$$$"))
(string-match reg1 str)
(print (match-string 0 str)) ; => "-$"
(print (match-string 2 str)) ; => nil
(string-match reg2 str)
(print (match-string 0 str)) ; => "-$$$"
(print (match-string 2 str)) ; => "$$$"
nil))
I would expect to tuareg-mode highlights the whole symbol like -$$$
.
The "-" case always matches on "[^0-9>]" and never on latter.