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 "<<") ((looking-at "<<")
(cond (cond
((and (ruby-expr-beg 'heredoc) ((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)))) (setq re (regexp-quote (or (match-string 4) (match-string 2))))
(if (match-beginning 1) (setq re (concat "\\s *" re))) (if (match-beginning 1) (setq re (concat "\\s *" re)))
(let* ((id-end (goto-char (match-end 0))) (let* ((id-end (goto-char (match-end 0)))