Function: tuareg-discover-phrase

tuareg-discover-phrase is a natively compiled function defined in tuareg.el.

Signature

(tuareg-discover-phrase &optional POS)

Documentation

Return a triplet (BEGIN END END-WITH-COMMENTS) for the OCaml phrase around POS. In case of error, move the point at the beginning of the error and return nil.

Source Code

;; Defined in /nix/store/6mbh851dhnag8f92qfrlh9ckldzwf6c6-emacs-packages-deps/share/emacs/site-lisp/elpa/tuareg-20260626.936/tuareg.el
(defun tuareg-discover-phrase (&optional pos)
  "Return a triplet (BEGIN END END-WITH-COMMENTS) for the OCaml
phrase around POS.  In case of error, move the point at the
beginning of the error and return `nil'."
  (let ((r (tuareg-region-of-defun pos))
        end-without-comments)
    (when r
      ;; Remove possible comments after the phrase.
      (goto-char (cdr r))
      (forward-comment (- (point)))
      (setq end-without-comments (point))
      (list (car r) end-without-comments (cdr r)))))