1
0
mirror of https://git.savannah.gnu.org/git/emacs.git synced 2024-11-30 08:09:04 +00:00

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

fail when reached LIMIT.
This commit is contained in:
Dmitry Gutov 2012-09-08 19:13:14 +04:00
parent 35d98877f0
commit 616c6c36aa
3 changed files with 13 additions and 4 deletions

View File

@ -1,3 +1,8 @@
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-=.

View File

@ -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"

View File

@ -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)