Tail-recursive, executable loop for vl-read-file.
(vl-read-file-loop-aux channel filename line col nrev &key (state 'state)) → (mv nrev state)
You should never need to reason about this function directly, because it is typically rewritten into vl-read-file-loop using the following rule:
Theorem:
(defthm vl-read-file-loop-aux-redef (equal (vl-read-file-loop-aux channel filename line col acc) (b* (((mv data state) (vl-read-file-loop channel filename line col))) (mv (append acc data) state))))
Function:
(defun vl-read-file-loop-aux-fn (channel filename line col nrev state) (declare (xargs :stobjs (nrev state))) (declare (type string filename) (type (integer 1 *) line) (type (integer 0 *) col)) (declare (xargs :guard (and (stringp filename) (posp line) (natp col) (and (symbolp channel) (open-input-channel-p channel :byte state))))) (declare (xargs :split-types t)) (let ((__function__ 'vl-read-file-loop-aux)) (declare (ignorable __function__)) (b* ((nrev (nrev-fix nrev)) ((unless (mbt (state-p state))) (mv nrev state)) ((mv byte state) (read-byte$ channel state)) ((unless byte) (mv nrev state)) ((the character char) (code-char (the (unsigned-byte 8) byte))) (echar (make-vl-echar-fast :char char :filename filename :line line :col col)) (newlinep (eql char #\Newline)) (next-line (if newlinep (the (integer 0 *) (+ 1 line)) line)) (next-col (if newlinep 0 (the (integer 0 *) (+ 1 col)))) (nrev (nrev-push echar nrev))) (vl-read-file-loop-aux channel filename next-line next-col nrev))))