Commit c2d6c639 authored by Dmitry Gutov's avatar Dmitry Gutov
Browse files

Match special globals in Ruby better

* lisp/progmodes/ruby-mode.el (ruby-expression-expansion-re):
Match special global variables without curlies, too.
(ruby-font-lock-keywords): Simplify the matcher for special global
variables.  Don't require a non-word character after the variable.

Fixes: debbugs:17057
parent f2999a33
2014-03-24 Dmitry Gutov <dgutov@yandex.ru>
* progmodes/ruby-mode.el (ruby-expression-expansion-re):
Match special global variables without curlies, too.
(ruby-font-lock-keywords): Simplify the matcher for special global
variables. Don't require a non-word character after the variable.
(Bug#17057)
2014-03-23 Stefan Monnier <monnier@iro.umontreal.ca> 2014-03-23 Stefan Monnier <monnier@iro.umontreal.ca>
   
* simple.el (redisplay-highlight-region-function): Increase priority of * simple.el (redisplay-highlight-region-function): Increase priority of
......
...@@ -106,7 +106,7 @@ ...@@ -106,7 +106,7 @@
"Regexp to match the beginning of a heredoc.") "Regexp to match the beginning of a heredoc.")
(defconst ruby-expression-expansion-re (defconst ruby-expression-expansion-re
"\\(?:[^\\]\\|\\=\\)\\(\\\\\\\\\\)*\\(#\\({[^}\n\\\\]*\\(\\\\.[^}\n\\\\]*\\)*}\\|\\(\\$\\|@\\|@@\\)\\(\\w\\|_\\)+\\)\\)")) "\\(?:[^\\]\\|\\=\\)\\(\\\\\\\\\\)*\\(#\\({[^}\n\\\\]*\\(\\\\.[^}\n\\\\]*\\)*}\\|\\(\\$\\|@\\|@@\\)\\(\\w\\|_\\)+\\|\\$[^a-zA-Z \n]\\)\\)"))
(defun ruby-here-doc-end-match () (defun ruby-here-doc-end-match ()
"Return a regexp to find the end of a heredoc. "Return a regexp to find the end of a heredoc.
...@@ -2113,8 +2113,8 @@ See `font-lock-syntax-table'.") ...@@ -2113,8 +2113,8 @@ See `font-lock-syntax-table'.")
("\\(^\\|[^:]\\)\\(:\\([-+~]@?\\|[/%&|^`]\\|\\*\\*?\\|<\\(<\\|=>?\\)?\\|>[>=]?\\|===?\\|=~\\|![~=]?\\|\\[\\]=?\\|@?\\(\\w\\|_\\)+\\([!?=]\\|\\b_*\\)\\|#{[^}\n\\\\]*\\(\\\\.[^}\n\\\\]*\\)*}\\)\\)" ("\\(^\\|[^:]\\)\\(:\\([-+~]@?\\|[/%&|^`]\\|\\*\\*?\\|<\\(<\\|=>?\\)?\\|>[>=]?\\|===?\\|=~\\|![~=]?\\|\\[\\]=?\\|@?\\(\\w\\|_\\)+\\([!?=]\\|\\b_*\\)\\|#{[^}\n\\\\]*\\(\\\\.[^}\n\\\\]*\\)*}\\)\\)"
2 font-lock-constant-face) 2 font-lock-constant-face)
;; Variables. ;; Variables.
("\\(\\$\\([^a-zA-Z0-9 \n]\\|[0-9]\\)\\)\\W" ("\\$[^a-zA-Z \n]"
1 font-lock-variable-name-face) 0 font-lock-variable-name-face)
("\\(\\$\\|@\\|@@\\)\\(\\w\\|_\\)+" ("\\(\\$\\|@\\|@@\\)\\(\\w\\|_\\)+"
0 font-lock-variable-name-face) 0 font-lock-variable-name-face)
;; Constants. ;; Constants.
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment