Commit 616c6c36 authored by Dmitry Gutov's avatar Dmitry Gutov
Browse files

* lisp/progmodes/ruby-mode.el (ruby-match-expression-expansion): Only

fail when reached LIMIT.
parent 35d98877
2012-09-08 Dmitry Gutov <dgutov@yandex.ru>
* progmodes/ruby-mode.el (ruby-match-expression-expansion): Only
fail when reached LIMIT.
2012-09-08 Chong Yidong <cyd@gnu.org>
 
* dired.el (dired-mode-map): Don't bind M-=.
......
......@@ -1549,7 +1549,9 @@ See `font-lock-syntax-table'.")
(defun ruby-match-expression-expansion (limit)
(when (re-search-forward "[^\\]\\(\\\\\\\\\\)*\\(#\\({[^}\n\\\\]*\\(\\\\.[^}\n\\\\]*\\)*}\\|\\(\\$\\|@\\|@@\\)\\(\\w\\|_\\)+\\)\\)" limit 'move)
(ruby-in-ppss-context-p 'string)))
(or (ruby-in-ppss-context-p 'string)
(and (< (point) limit)
(ruby-match-expression-expansion limit)))))
;;;###autoload
(define-derived-mode ruby-mode prog-mode "Ruby"
......
......@@ -237,10 +237,12 @@ VALUES-PLIST is a list with alternating index and value elements."
'font-lock-variable-name-face)
(ruby-assert-face "\"This is \\#{no interpolation} despite the #\""
15 'font-lock-string-face)
(ruby-assert-face "#@comment, not ruby code" 3 'font-lock-comment-face)
(ruby-assert-state "#@comment, not ruby code" 4 t)
(ruby-assert-face "\n#@comment, not ruby code" 5 'font-lock-comment-face)
(ruby-assert-state "\n#@comment, not ruby code" 4 t)
(ruby-assert-face "# A comment cannot have #{an interpolation} in it"
30 'font-lock-comment-face))
30 'font-lock-comment-face)
(ruby-assert-face "# #{comment}\n \"#{interpolation}\"" 16
'font-lock-variable-name-face))
(provide 'ruby-mode-tests)
......
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