]> git.eshelyaron.com Git - emacs.git/commitdiff
ruby-mode: Don't consider `=' a part of symbol when followed by `>'
authorDmitry Gutov <dgutov@yandex.ru>
Mon, 9 Mar 2015 03:26:57 +0000 (05:26 +0200)
committerDmitry Gutov <dgutov@yandex.ru>
Mon, 9 Mar 2015 03:26:57 +0000 (05:26 +0200)
Fixes: debbugs:18644
* lisp/progmodes/ruby-mode.el (ruby-font-lock-keywords): Don't consider
`=' a part of symbol when followed by `>'.

lisp/ChangeLog
lisp/progmodes/ruby-mode.el

index 3e458135186b292348f807988dce442f5d543ea6..e1842973acbf6c86d31ed8dd916b30af705cd71a 100644 (file)
@@ -1,3 +1,8 @@
+2015-03-09  Dmitry Gutov  <dgutov@yandex.ru>
+
+       * progmodes/ruby-mode.el (ruby-font-lock-keywords): Don't consider
+       `=' a part of symbol when followed by `>'.  (Bug#18644)
+
 2015-03-09  Eli Zaretskii  <eliz@gnu.org>
 
        * dired.el (dired-delete-file): Doc fix.  (Bug#20021)
index 4abc413f636d21ac29ee10d0d950933d6cb746bc..06b1fcf1729364a2a266761a3cbd27d10204ecce 100644 (file)
@@ -2155,8 +2155,16 @@ See `font-lock-syntax-table'.")
     ;; Keywords that evaluate to certain values.
     ("\\_<__\\(?:LINE\\|ENCODING\\|FILE\\)__\\_>"
      (0 font-lock-builtin-face))
-    ;; Symbols.
-    ("\\(^\\|[^:]\\)\\(:\\([-+~]@?\\|[/%&|^`]\\|\\*\\*?\\|<\\(<\\|=>?\\)?\\|>[>=]?\\|===?\\|=~\\|![~=]?\\|\\[\\]=?\\|@?\\(\\w\\|_\\)+\\([!?=]\\|\\b_*\\)\\|#{[^}\n\\\\]*\\(\\\\.[^}\n\\\\]*\\)*}\\)\\)"
+    ;; Symbols with symbol characters.
+    ("\\(^\\|[^:]\\)\\(:@?\\(?:\\w\\|_\\)+\\)\\([!?=]\\)?"
+     (2 font-lock-constant-face)
+     (3 (unless (and (eq (char-before (match-end 3)) ?=)
+                     (eq (char-after (match-end 3)) ?>))
+          ;; bug#18466
+          font-lock-constant-face)
+        nil t))
+    ;; Symbols with special characters.
+    ("\\(^\\|[^:]\\)\\(:\\([-+~]@?\\|[/%&|^`]\\|\\*\\*?\\|<\\(<\\|=>?\\)?\\|>[>=]?\\|===?\\|=~\\|![~=]?\\|\\[\\]=?\\|#{[^}\n\\\\]*\\(\\\\.[^}\n\\\\]*\\)*}\\)\\)"
      2 font-lock-constant-face)
     ;; Special globals.
     (,(concat "\\$\\(?:[:\"!@;,/\\._><\\$?~=*&`'+0-9]\\|-[0adFiIlpvw]\\|"