emacs-diffs
[Top][All Lists]
Advanced

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

master 83efac6: ruby-syntax-propertize: Fix certain cases following ::


From: Dmitry Gutov
Subject: master 83efac6: ruby-syntax-propertize: Fix certain cases following ::
Date: Mon, 1 Feb 2021 20:48:13 -0500 (EST)

branch: master
commit 83efac64779b0cda1a700d2f82d63a1afa1ac6f4
Author: Dmitry Gutov <dgutov@yandex.ru>
Commit: Dmitry Gutov <dgutov@yandex.ru>

    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.
---
 lisp/progmodes/ruby-mode.el                     | 4 ++--
 test/lisp/progmodes/ruby-mode-resources/ruby.rb | 2 +-
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/lisp/progmodes/ruby-mode.el b/lisp/progmodes/ruby-mode.el
index a8667ac..e7f407b 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 434237c..8c698e4 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"



reply via email to

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