]> code.delx.au - gnu-emacs/commitdiff
* lisp/progmodes/ruby-mode.el (ruby-match-expression-expansion): Only
authorDmitry Gutov <dgutov@yandex.ru>
Sat, 8 Sep 2012 15:13:14 +0000 (19:13 +0400)
committerDmitry Gutov <dgutov@yandex.ru>
Sat, 8 Sep 2012 15:13:14 +0000 (19:13 +0400)
fail when reached LIMIT.

lisp/ChangeLog
lisp/progmodes/ruby-mode.el
test/automated/ruby-mode-tests.el

index f9a0d45700374495e71a3b95bffc598ad071dc1f..10458236c3002ccfed6648cbffba99e8921b23f2 100644 (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-=.
index ef1daa5e9363d90e4d4fc1524012fc825ccfa9f0..0636212a23f78611e873416ab7d6d4ebea05dcb9 100644 (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"
index 1adc4acdfa0769d5362a9da5bbe1d2f4e947bc49..515353bc2d0cf8d86c9b62b329f00154db0bf6ec 100644 (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)