(vl-print-loc x &key (ps 'ps)) prints a vl-location-p.
(vl-print-loc x &key (ps 'ps)) → ps
In text mode, this function basically prints the string produced by vl-location-string. But when HTML mode is active, we instead print something along the lines of:
<a class="vl_loclink" href="javascript:void(0);" onClick="showLoc('foo', 'line', 'col')"> foo:line:col </a>
This function is used in various warning messages, reports, and other
displays. The module browser's web pages are responsible for defining the
Function:
(defun vl-print-loc-fn (x ps) (declare (xargs :stobjs (ps))) (declare (xargs :guard (vl-location-p x))) (let ((__function__ 'vl-print-loc)) (declare (ignorable __function__)) (if (not (vl-ps->htmlp)) (let* ((str (vl-location-string x)) (len (length str)) (col (vl-ps->col)) (autowrap-col (vl-ps->autowrap-col)) (autowrap-ind (vl-ps->autowrap-ind))) (cond ((or (< (+ col len) autowrap-col) (< col (+ autowrap-ind 10))) (vl-print-str str)) (t (vl-ps-seq (vl-println "") (vl-indent autowrap-ind) (vl-print-str str))))) (let* ((filename (vl-location->filename x)) (line (vl-location->line x)) (col (vl-location->col x)) (flen (length filename)) (last-slash (str::strrpos "/" filename)) (shortname (if (and last-slash (< last-slash flen)) (subseq filename (1+ last-slash) nil) filename))) (vl-ps-seq (vl-print-markup "<a class=\"vl_loclink\" href=\"javascript:void(0);\" onClick=\"showLoc('") (vl-print-url (vl-location->filename x)) (vl-print-markup "', '") (vl-print-url line) (vl-print-markup "', '") (vl-print-url col) (vl-print-markup "')\")>") (vl-print-str shortname) (vl-print-str ":") (vl-print-nat line) (vl-print-str ":") (vl-print-nat col) (vl-print-markup "</a>"))))))
Theorem:
(defthm vl-print-loc-fn-of-vl-location-fix-x (equal (vl-print-loc-fn (vl-location-fix x) ps) (vl-print-loc-fn x ps)))
Theorem:
(defthm vl-print-loc-fn-vl-location-equiv-congruence-on-x (implies (vl-location-equiv x x-equiv) (equal (vl-print-loc-fn x ps) (vl-print-loc-fn x-equiv ps))) :rule-classes :congruence)