[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Emacs-diffs] emacs-24 r117063: * lisp/progmodes/ruby-mode.el (ruby-synt
From: |
Dmitry Gutov |
Subject: |
[Emacs-diffs] emacs-24 r117063: * lisp/progmodes/ruby-mode.el (ruby-syntax-propertize-function): |
Date: |
Mon, 05 May 2014 23:18:25 +0000 |
User-agent: |
Bazaar (2.6b2) |
------------------------------------------------------------
revno: 117063
revision-id: address@hidden
parent: address@hidden
committer: Dmitry Gutov <address@hidden>
branch nick: emacs-24
timestamp: Tue 2014-05-06 03:18:18 +0400
message:
* lisp/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.
* test/automated/ruby-mode-tests.el
(ruby-interpolation-after-dollar-sign): New test.
modified:
lisp/ChangeLog changelog-20091113204419-o5vbwnq5f7feedwu-1432
lisp/progmodes/ruby-mode.el
rubymode.el-20091113204419-o5vbwnq5f7feedwu-8804
test/ChangeLog changelog-20091113204419-o5vbwnq5f7feedwu-8588
test/automated/ruby-mode-tests.el
rubymodetests.el-20120720101201-mn39s4kfopdxj3ek-1
=== modified file 'lisp/ChangeLog'
--- a/lisp/ChangeLog 2014-05-05 21:33:07 +0000
+++ b/lisp/ChangeLog 2014-05-05 23:18:18 +0000
@@ -1,3 +1,10 @@
+2014-05-05 Dmitry Gutov <address@hidden>
+
+ * 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 <address@hidden>
* help-fns.el (describe-function-1): Test for an autoload before a
=== modified file 'lisp/progmodes/ruby-mode.el'
--- a/lisp/progmodes/ruby-mode.el 2014-04-09 00:14:37 +0000
+++ b/lisp/progmodes/ruby-mode.el 2014-05-05 23:18:18 +0000
@@ -1804,9 +1804,10 @@
;; $' $" $` .... 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.
("[!?]"
=== modified file 'test/ChangeLog'
--- a/test/ChangeLog 2014-05-05 21:33:07 +0000
+++ b/test/ChangeLog 2014-05-05 23:18:18 +0000
@@ -1,3 +1,8 @@
+2014-05-05 Dmitry Gutov <address@hidden>
+
+ * automated/ruby-mode-tests.el
+ (ruby-interpolation-after-dollar-sign): New test.
+
2014-05-05 Glenn Morris <address@hidden>
* automated/help-fns.el: New file.
=== modified file 'test/automated/ruby-mode-tests.el'
--- a/test/automated/ruby-mode-tests.el 2014-01-31 17:13:49 +0000
+++ b/test/automated/ruby-mode-tests.el 2014-05-05 23:18:18 +0000
@@ -452,6 +452,10 @@
(ruby-assert-face "%w{foo address@hidden" 8 font-lock-string-face)
(ruby-assert-face "%s{foo address@hidden" 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)
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Emacs-diffs] emacs-24 r117063: * lisp/progmodes/ruby-mode.el (ruby-syntax-propertize-function):,
Dmitry Gutov <=