From: Dmitry Gutov Date: Tue, 2 Feb 2021 01:47:46 +0000 (+0200) Subject: ruby-syntax-propertize: Fix certain cases following :: X-Git-Tag: emacs-28.0.90~3977 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=83efac64779b0cda1a700d2f82d63a1afa1ac6f4;p=emacs.git ruby-syntax-propertize: Fix certain cases following :: * lisp/progmodes/ruby-mode.el (ruby-syntax-propertize): Make sure to backtrack if the "symbols with special characters" rule is aborted because of preceding colon. --- diff --git a/lisp/progmodes/ruby-mode.el b/lisp/progmodes/ruby-mode.el index a8667acb9d5..e7f407b6367 100644 --- a/lisp/progmodes/ruby-mode.el +++ b/lisp/progmodes/ruby-mode.el @@ -1869,8 +1869,8 @@ It will be properly highlighted even when the call omits parens.") ;; Symbols with special characters. (":\\([-+~]@?\\|[/%&|^`]\\|\\*\\*?\\|<\\(<\\|=>?\\)?\\|>[>=]?\\|===?\\|=~\\|![~=]?\\|\\[\\]=?\\)" (1 (unless (or - (eq (char-before (match-beginning 0)) ?:) - (nth 8 (syntax-ppss (match-beginning 1)))) + (nth 8 (syntax-ppss (match-beginning 1))) + (eq (char-before (match-beginning 0)) ?:)) (goto-char (match-end 0)) (string-to-syntax "_")))) ;; Symbols ending with '=' (bug#42846). diff --git a/test/lisp/progmodes/ruby-mode-resources/ruby.rb b/test/lisp/progmodes/ruby-mode-resources/ruby.rb index 434237cf638..8c698e4fac8 100644 --- a/test/lisp/progmodes/ruby-mode-resources/ruby.rb +++ b/test/lisp/progmodes/ruby-mode-resources/ruby.rb @@ -108,7 +108,7 @@ foo( # ruby-deep-indent-disabled # Multiline regexp. /bars tees # toots - nfoos/ + nfoos::/ def test1(arg) puts "hello"