summaryrefslogtreecommitdiff
path: root/lisp
diff options
context:
space:
mode:
authorDmitry Gutov <dgutov@yandex.ru>2016-05-12 03:18:45 +0300
committerDmitry Gutov <dgutov@yandex.ru>2016-05-12 03:18:45 +0300
commit1a5a05cf6f68277c142fe3753581d3b0c6470156 (patch)
tree3b84778ff99bc74bd10ac9ea1becd3761d16928d /lisp
parent4c5a00b09f9aed267d60ef9741a6bee206728d10 (diff)
downloademacs-1a5a05cf6f68277c142fe3753581d3b0c6470156.tar.gz
Do not mistake colon at the end of regexp for slash symbol
* lisp/progmodes/ruby-mode.el (ruby-syntax-propertize): Check the parse state in the "Symbols with special characters" rule (bug#23515).
Diffstat (limited to 'lisp')
-rw-r--r--lisp/progmodes/ruby-mode.el4
1 files changed, 3 insertions, 1 deletions
diff --git a/lisp/progmodes/ruby-mode.el b/lisp/progmodes/ruby-mode.el
index 972bf99145e..cd3b04de712 100644
--- a/lisp/progmodes/ruby-mode.el
+++ b/lisp/progmodes/ruby-mode.el
@@ -1858,7 +1858,9 @@ It will be properly highlighted even when the call omits parens.")
(string-to-syntax "'"))))
;; Symbols with special characters.
("\\(^\\|[^:]\\)\\(:\\([-+~]@?\\|[/%&|^`]\\|\\*\\*?\\|<\\(<\\|=>?\\)?\\|>[>=]?\\|===?\\|=~\\|![~=]?\\|\\[\\]=?\\)\\)"
- (3 (string-to-syntax "_")))
+ (3 (unless (nth 8 (syntax-ppss (match-beginning 3)))
+ (goto-char (match-end 0))
+ (string-to-syntax "_"))))
;; Part of method name when at the end of it.
("[!?]"
(0 (unless (save-excursion