diff options
| author | Dmitry Gutov | 2012-07-20 07:10:25 -0400 |
|---|---|---|
| committer | Stefan Monnier | 2012-07-20 07:10:25 -0400 |
| commit | c28662a8dc4fefae711b21fcb7a71e871e37d1e6 (patch) | |
| tree | 37b6cf9b6caced945b938195028c95697fd2adf1 | |
| parent | 87ab808f0c0b2653a4a314d216c2afb44cfb2fc9 (diff) | |
| download | emacs-c28662a8dc4fefae711b21fcb7a71e871e37d1e6.tar.gz emacs-c28662a8dc4fefae711b21fcb7a71e871e37d1e6.zip | |
* lisp/progmodes/ruby-mode.el (ruby-parse-partial): No error when end
up inside string symbol literal.
* test/automated/ruby-mode-tests.el: New file with one test.
Fixes: debbugs:11923
| -rw-r--r-- | lisp/ChangeLog | 5 | ||||
| -rw-r--r-- | lisp/progmodes/ruby-mode.el | 2 | ||||
| -rw-r--r-- | test/ChangeLog | 4 | ||||
| -rw-r--r-- | test/automated/ruby-mode-tests.el | 39 |
4 files changed, 49 insertions, 1 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 8edae88c1da..d7cb05c0664 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog | |||
| @@ -1,3 +1,8 @@ | |||
| 1 | 2012-07-20 Dmitry Gutov <dgutov@yandex.ru> | ||
| 2 | |||
| 3 | * progmodes/ruby-mode.el (ruby-parse-partial): No error when end | ||
| 4 | up inside string symbol literal (bug#11923). | ||
| 5 | |||
| 1 | 2012-07-20 Eli Zaretskii <eliz@gnu.org> | 6 | 2012-07-20 Eli Zaretskii <eliz@gnu.org> |
| 2 | 7 | ||
| 3 | * startup.el (fancy-startup-text): Read the whole tutorial, not | 8 | * startup.el (fancy-startup-text): Read the whole tutorial, not |
diff --git a/lisp/progmodes/ruby-mode.el b/lisp/progmodes/ruby-mode.el index 5d79437c3c2..091a7b74df2 100644 --- a/lisp/progmodes/ruby-mode.el +++ b/lisp/progmodes/ruby-mode.el | |||
| @@ -594,7 +594,7 @@ and `\\' when preceded by `?'." | |||
| 594 | (goto-char pnt)) | 594 | (goto-char pnt)) |
| 595 | ((looking-at ":\\(['\"]\\)") | 595 | ((looking-at ":\\(['\"]\\)") |
| 596 | (goto-char (match-beginning 1)) | 596 | (goto-char (match-beginning 1)) |
| 597 | (ruby-forward-string (buffer-substring (match-beginning 1) (match-end 1)) end)) | 597 | (ruby-forward-string (match-string 1) end t)) |
| 598 | ((looking-at ":\\([-,.+*/%&|^~<>]=?\\|===?\\|<=>\\|![~=]?\\)") | 598 | ((looking-at ":\\([-,.+*/%&|^~<>]=?\\|===?\\|<=>\\|![~=]?\\)") |
| 599 | (goto-char (match-end 0))) | 599 | (goto-char (match-end 0))) |
| 600 | ((looking-at ":\\([a-zA-Z_][a-zA-Z_0-9]*[!?=]?\\)?") | 600 | ((looking-at ":\\([a-zA-Z_][a-zA-Z_0-9]*[!?=]?\\)?") |
diff --git a/test/ChangeLog b/test/ChangeLog index f82a395e548..db8380cfb27 100644 --- a/test/ChangeLog +++ b/test/ChangeLog | |||
| @@ -1,3 +1,7 @@ | |||
| 1 | 2012-07-20 Dmitry Gutov <dgutov@yandex.ru> | ||
| 2 | |||
| 3 | * automated/ruby-mode-tests.el: New file with one test. | ||
| 4 | |||
| 1 | 2012-07-17 Stefan Monnier <monnier@iro.umontreal.ca> | 5 | 2012-07-17 Stefan Monnier <monnier@iro.umontreal.ca> |
| 2 | 6 | ||
| 3 | * indent/shell.sh: Add test case for ${#VAR}. | 7 | * indent/shell.sh: Add test case for ${#VAR}. |
diff --git a/test/automated/ruby-mode-tests.el b/test/automated/ruby-mode-tests.el new file mode 100644 index 00000000000..1a91f518b92 --- /dev/null +++ b/test/automated/ruby-mode-tests.el | |||
| @@ -0,0 +1,39 @@ | |||
| 1 | ;;; ruby-mode-tests.el --- Test suite for ruby-mode | ||
| 2 | |||
| 3 | ;; Copyright (C) 2012 Free Software Foundation, Inc. | ||
| 4 | |||
| 5 | ;; This file is part of GNU Emacs. | ||
| 6 | |||
| 7 | ;; GNU Emacs is free software: you can redistribute it and/or modify | ||
| 8 | ;; it under the terms of the GNU General Public License as published by | ||
| 9 | ;; the Free Software Foundation, either version 3 of the License, or | ||
| 10 | ;; (at your option) any later version. | ||
| 11 | |||
| 12 | ;; GNU Emacs is distributed in the hope that it will be useful, | ||
| 13 | ;; but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| 14 | ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
| 15 | ;; GNU General Public License for more details. | ||
| 16 | |||
| 17 | ;; You should have received a copy of the GNU General Public License | ||
| 18 | ;; along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. | ||
| 19 | |||
| 20 | ;;; Commentary: | ||
| 21 | |||
| 22 | ;;; Code: | ||
| 23 | |||
| 24 | (require 'ruby-mode) | ||
| 25 | |||
| 26 | (ert-deftest indent-line-after-symbol-made-from-string-interpolation () | ||
| 27 | "It can indent the line after symbol made using string interpolation." | ||
| 28 | (let ((initial-content "def foo(suffix)\n :\"bar#{suffix}\"\n") | ||
| 29 | (expected-content "def foo(suffix)\n :\"bar#{suffix}\"\n ")) | ||
| 30 | (with-temp-buffer | ||
| 31 | (insert initial-content) | ||
| 32 | (ruby-indent-line) ; Doesn't rely on text properties or the syntax table. | ||
| 33 | (let ((buffer-content (buffer-substring-no-properties (point-min) | ||
| 34 | (point-max)))) | ||
| 35 | (should (string= buffer-content expected-content)))))) | ||
| 36 | |||
| 37 | (provide 'ruby-mode-tests) | ||
| 38 | |||
| 39 | ;;; ruby-mode-tests.el ends here | ||