1
0
mirror of https://git.savannah.gnu.org/git/emacs.git synced 2024-11-27 07:37:33 +00:00

Improve squiggly heredoc support in non-SMIE Ruby mode

* lisp/progmodes/ruby-mode.el (ruby-parse-partial): Support
squiggly heredocs here, too (port from upstream).
This commit is contained in:
Dmitry Gutov 2016-06-07 04:06:33 +03:00
parent 9d5ccebeba
commit 973ce5a123

View File

@ -1151,7 +1151,7 @@ delimiter."
((looking-at "<<")
(cond
((and (ruby-expr-beg 'heredoc)
(looking-at "<<\\(-\\)?\\(\\([\"'`]\\)\\([^\n]+?\\)\\3\\|\\(?:\\sw\\|\\s_\\)+\\)"))
(looking-at "<<\\([-~]\\)?\\(\\([\"'`]\\)\\([^\n]+?\\)\\3\\|\\(?:\\sw\\|\\s_\\)+\\)"))
(setq re (regexp-quote (or (match-string 4) (match-string 2))))
(if (match-beginning 1) (setq re (concat "\\s *" re)))
(let* ((id-end (goto-char (match-end 0)))