Commit dca01b09 authored by Dmitry Gutov's avatar Dmitry Gutov
Browse files

* lisp/progmodes/ruby-mode.el (ruby-smie--forward-token)

(ruby-smie--backward-token): Tokenize heredocs as semicolons.

* test/automated/ruby-mode-tests.el: Remove outdated comment.

* test/indent/ruby.rb: Add a statement on the line after heredoc.
parent 91f2d272
2013-11-04 Dmitry Gutov <dgutov@yandex.ru>
* progmodes/ruby-mode.el (ruby-smie--forward-token)
(ruby-smie--backward-token): Tokenize heredocs as semicolons.
2013-11-04 Michal Nazarewicz <mina86@mina86.com>
* textmodes/fill.el (fill-single-char-nobreak-p): New function
......
......@@ -393,7 +393,12 @@ explicitly declared in magic comment."
(let ((pos (point)))
(skip-chars-forward " \t")
(cond
((looking-at "\\s\"") "") ;A heredoc or a string.
((looking-at "\\s\"") ;A heredoc or a string.
(if (not (looking-at "\n"))
""
;; Tokenize the whole heredoc as semicolon.
(goto-char (scan-sexps (point) 1))
";"))
((and (looking-at "[\n#]")
(ruby-smie--implicit-semi-p)) ;Only add implicit ; when needed.
(if (eolp) (forward-char 1) (forward-comment 1))
......@@ -435,7 +440,10 @@ explicitly declared in magic comment."
(cond
((and (> pos (line-end-position)) (ruby-smie--implicit-semi-p))
(skip-chars-forward " \t") ";")
((and (bolp) (not (bobp))) "") ;Presumably a heredoc.
((and (bolp) (not (bobp))) ;Presumably a heredoc.
;; Tokenize the whole heredoc as semicolon.
(goto-char (scan-sexps (point) -1))
";")
((and (> pos (point)) (not (bolp))
(ruby-smie--args-separator-p pos))
;; We have "ID SPC ID", which is a method call, but it binds less tightly
......
2013-11-04 Dmitry Gutov <dgutov@yandex.ru>
* indent/ruby.rb: Add a statement on the line after heredoc.
* automated/ruby-mode-tests.el: Remove outdated comment.
2013-11-04 Glenn Morris <rgm@gnu.org>
* automated/Makefile.in (abs_srcdir): Remove.
......
......@@ -585,8 +585,6 @@ VALUES-PLIST is a list with alternating index and value elements."
(end-of-defun)
(should (= 5 (line-number-at-pos)))))
;; Tests below fail when using SMIE.
(defvar ruby-sexp-test-example
(ruby-test-string
"class C
......
......@@ -3,6 +3,7 @@
boo hoo
end
eowarn
foo
end
# Percent literals.
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment