* lisp/progmodes/ruby-mode.el (ruby-syntax-expansion-allowed-p):

Highlight expansions inside regexp literals.
This commit is contained in:
Dmitry Gutov 2013-05-31 20:55:03 +04:00
parent 2a157a5d33
commit 973d1e126c
3 changed files with 9 additions and 1 deletions

View file

@ -1,3 +1,8 @@
2013-05-31 Dmitry Gutov <dgutov@yandex.ru>
* progmodes/ruby-mode.el (ruby-syntax-expansion-allowed-p):
Highlight expansions inside regexp literals.
2013-05-31 Glenn Morris <rgm@gnu.org>
* obsolete/sym-comp.el (symbol-complete):

View file

@ -1513,7 +1513,7 @@ It will be properly highlighted even when the call omits parens.")
"Return non-nil if expression expansion is allowed."
(let ((term (nth 3 parse-state)))
(cond
((memq term '(?\" ?` ?\n)))
((memq term '(?\" ?` ?\n ?/)))
((eq term t)
(save-match-data
(save-excursion

View file

@ -112,6 +112,9 @@ VALUES-PLIST is a list with alternating index and value elements."
(ert-deftest ruby-regexp-starts-after-string ()
(ruby-assert-state "'(/', /\d+/" 3 ?/ 8))
(ert-deftest ruby-regexp-interpolation-is-highlighted ()
(ruby-assert-face "/#{foobs}/" 4 font-lock-variable-name-face))
(ert-deftest ruby-regexp-skips-over-interpolation ()
(ruby-assert-state "/#{foobs.join('/')}/" 3 nil))