+2014-05-05 Dmitry Gutov <dgutov@yandex.ru>
+
+ * progmodes/ruby-mode.el (ruby-syntax-propertize-function):
+ Backtrack one char if the global/char-literal var matcher hits
+ inside a string. The next char could be the beginning of an
+ expression expansion.
+
2014-05-05 Glenn Morris <rgm@gnu.org>
* help-fns.el (describe-function-1): Test for an autoload before a
;; $' $" $` .... are variables.
;; ?' ?" ?` are character literals (one-char strings in 1.9+).
("\\([?$]\\)[#\"'`]"
- (1 (unless (save-excursion
- ;; Not within a string.
- (nth 3 (syntax-ppss (match-beginning 0))))
+ (1 (if (save-excursion
+ (nth 3 (syntax-ppss (match-beginning 0))))
+ ;; Within a string, skip.
+ (goto-char (match-end 1))
(string-to-syntax "\\"))))
;; Part of symbol when at the end of a method name.
("[!?]"
+2014-05-05 Dmitry Gutov <dgutov@yandex.ru>
+
+ * automated/ruby-mode-tests.el
+ (ruby-interpolation-after-dollar-sign): New test.
+
2014-05-05 Glenn Morris <rgm@gnu.org>
* automated/help-fns.el: New file.
(ruby-assert-face "%w{foo #@bar}" 8 font-lock-string-face)
(ruby-assert-face "%s{foo #@bar}" 8 font-lock-string-face))
+(ert-deftest ruby-interpolation-after-dollar-sign ()
+ (ruby-assert-face "\"$#{balance}\"" 2 'font-lock-string-face)
+ (ruby-assert-face "\"$#{balance}\"" 3 'font-lock-variable-name-face))
+
(ert-deftest ruby-no-unknown-percent-literals ()
;; No folding of case.
(ruby-assert-face "%S{foo}" 4 nil)