Function: ruby-syntax-propertize-heredoc

ruby-syntax-propertize-heredoc is a byte-compiled function defined in ruby-mode.el.gz.

Signature

(ruby-syntax-propertize-heredoc LIMIT)

Source Code

;; Defined in /usr/src/emacs/lisp/progmodes/ruby-mode.el.gz
(defun ruby-syntax-propertize-heredoc (limit)
  (let ((ppss (syntax-ppss))
        (res '()))
    (when (eq ?\n (nth 3 ppss))
      (save-excursion
        (goto-char (nth 8 ppss))
        (beginning-of-line)
        (while (re-search-forward ruby-here-doc-beg-re
                                  (line-end-position) t)
          (when (ruby-verify-heredoc (match-beginning 0))
            (push (concat (ruby-here-doc-end-match) "\n") res))))
      (save-excursion
        ;; With multiple openers on the same line, we don't know in which
        ;; part `start' is, so we have to go back to the beginning.
        (when (cdr res)
          (goto-char (nth 8 ppss))
          (setq res (nreverse res)))
        (while (and res (re-search-forward (pop res) limit 'move))
          (if (null res)
              (put-text-property (1- (point)) (point)
                                 'syntax-table (string-to-syntax "\""))))
        ;; End up at bol following the heredoc openers.
        ;; Propertize expression expansions from this point forward.
        ))))