Function: majutsu-row-parse-trailing-payloads
majutsu-row-parse-trailing-payloads is a natively compiled function
defined in majutsu-row.el.
Signature
(majutsu-row-parse-trailing-payloads COMPILED TAIL-POS EOL)
Documentation
Parse tail, body, and metadata from the current line.
TAIL-POS points at the tail token and EOL is the end of the physical line containing the row. Return a plist with module payloads and :record-end when the row is well-formed.
Source Code
;; Defined in /nix/store/jagqw3nms546pad0gxi5f3wsckk6pji7-emacs-packages-deps/share/emacs/site-lisp/majutsu-row.el
(defun majutsu-row-parse-trailing-payloads (_compiled tail-pos eol)
"Parse tail, body, and metadata from the current line.
TAIL-POS points at the tail token and EOL is the end of the physical line
containing the row. Return a plist with module payloads and :record-end when
the row is well-formed."
(save-excursion
(goto-char tail-pos)
(when (majutsu-row--looking-at-token-p majutsu-row-tail-token)
(let* ((tail-start (+ tail-pos (length majutsu-row-tail-token)))
(body-pos (majutsu-row-line-token-position
majutsu-row-body-token tail-start eol tail-start)))
(when body-pos
(let* ((body-start (+ body-pos (length majutsu-row-body-token)))
(meta-pos (majutsu-row-line-token-position
majutsu-row-meta-token
body-start eol body-start))
(meta-end (and meta-pos
(+ meta-pos (length majutsu-row-meta-token))))
(end-pos (and meta-end
(majutsu-row-line-token-position
majutsu-row-end-token meta-end eol meta-end))))
(when (and meta-pos end-pos)
(list :tail (buffer-substring tail-start body-pos)
:body (buffer-substring body-start meta-pos)
:metadata (buffer-substring meta-end end-pos)
:record-end (+ end-pos (length majutsu-row-end-token))))))))))