1
Fork 0
mirror of git://git.sv.gnu.org/emacs.git synced 2026-04-27 16:51:06 -07:00

ruby-syntax-propertize: Add exception for /=

* lisp/progmodes/ruby-mode.el (ruby-syntax-propertize):
Create an exception for assign-division operator not to be
recognized as regexp start (bug#79454).

* test/lisp/progmodes/ruby-mode-resources/ruby.rb: Add example.
This commit is contained in:
Dmitry Gutov 2025-09-16 02:14:09 +03:00
parent 3438e15e31
commit 76f50fa55c
2 changed files with 2 additions and 0 deletions

View file

@ -2204,6 +2204,7 @@ A slash character after any of these should begin a regexp."))
(or (not
;; Looks like division.
(or (eql (char-after) ?\s)
(eql (char-after) ?=)
(not (eql (char-before (1- (point))) ?\s))))
(save-excursion
(forward-char -1)

View file

@ -39,6 +39,7 @@ a = sub / aslb + bsub / bslb;
# Highlight the regexp after "if".
x = toto / foo if / do bar/ =~ "dobar"
x /= 4
# Regexp options are highlighted.