+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-=.
(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"
'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)