diff options
Diffstat (limited to 'lisp/progmodes/ruby-mode.el')
| -rw-r--r-- | lisp/progmodes/ruby-mode.el | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/lisp/progmodes/ruby-mode.el b/lisp/progmodes/ruby-mode.el index 75c59ebe1fd..1c9663cc22c 100644 --- a/lisp/progmodes/ruby-mode.el +++ b/lisp/progmodes/ruby-mode.el | |||
| @@ -393,7 +393,12 @@ explicitly declared in magic comment." | |||
| 393 | (let ((pos (point))) | 393 | (let ((pos (point))) |
| 394 | (skip-chars-forward " \t") | 394 | (skip-chars-forward " \t") |
| 395 | (cond | 395 | (cond |
| 396 | ((looking-at "\\s\"") "") ;A heredoc or a string. | 396 | ((looking-at "\\s\"") ;A heredoc or a string. |
| 397 | (if (not (looking-at "\n")) | ||
| 398 | "" | ||
| 399 | ;; Tokenize the whole heredoc as semicolon. | ||
| 400 | (goto-char (scan-sexps (point) 1)) | ||
| 401 | ";")) | ||
| 397 | ((and (looking-at "[\n#]") | 402 | ((and (looking-at "[\n#]") |
| 398 | (ruby-smie--implicit-semi-p)) ;Only add implicit ; when needed. | 403 | (ruby-smie--implicit-semi-p)) ;Only add implicit ; when needed. |
| 399 | (if (eolp) (forward-char 1) (forward-comment 1)) | 404 | (if (eolp) (forward-char 1) (forward-comment 1)) |
| @@ -435,7 +440,10 @@ explicitly declared in magic comment." | |||
| 435 | (cond | 440 | (cond |
| 436 | ((and (> pos (line-end-position)) (ruby-smie--implicit-semi-p)) | 441 | ((and (> pos (line-end-position)) (ruby-smie--implicit-semi-p)) |
| 437 | (skip-chars-forward " \t") ";") | 442 | (skip-chars-forward " \t") ";") |
| 438 | ((and (bolp) (not (bobp))) "") ;Presumably a heredoc. | 443 | ((and (bolp) (not (bobp))) ;Presumably a heredoc. |
| 444 | ;; Tokenize the whole heredoc as semicolon. | ||
| 445 | (goto-char (scan-sexps (point) -1)) | ||
| 446 | ";") | ||
| 439 | ((and (> pos (point)) (not (bolp)) | 447 | ((and (> pos (point)) (not (bolp)) |
| 440 | (ruby-smie--args-separator-p pos)) | 448 | (ruby-smie--args-separator-p pos)) |
| 441 | ;; We have "ID SPC ID", which is a method call, but it binds less tightly | 449 | ;; We have "ID SPC ID", which is a method call, but it binds less tightly |