(vls-get-plainsrc origname data) → ans
Function:
(defun vls-get-plainsrc (origname data) (declare (xargs :guard (and (stringp origname) (vls-data-p data)))) (let ((__function__ 'vls-get-plainsrc)) (declare (ignorable __function__)) (b* (((vls-data data)) (desc (cdr (hons-assoc-equal origname data.orig-descalist))) ((unless desc) (cat "Error: " origname " not found.")) (minloc (vl-description->minloc desc)) (maxloc (vl-description->maxloc desc)) (maxloc (change-vl-location maxloc :col (nfix (+ (vl-location->col maxloc) (case (tag desc) (:vl-module (length "endmodule")) (:vl-udp (length "endprimitive")) (:vl-interface (length "endinterface")) (:vl-package (length "endpackage")) (:vl-program (length "endprogram")) (:vl-config (length "endconfig")) (otherwise 0)))))) (filename (vl-location->filename minloc)) ((unless (equal filename (vl-location->filename maxloc))) (cat "Error: " origname " starts/ends in different files?")) (filemap (vls-data->filemap data)) (lookup (hons-assoc-equal filename filemap)) ((unless lookup) (cat "Error: " origname " not found in the filemap.")) (result (vl-string-between-locs (cdr lookup) minloc maxloc)) ((unless result) (cat "Error: invalid locations for " origname))) result)))
Theorem:
(defthm stringp-of-vls-get-plainsrc (b* ((ans (vls-get-plainsrc origname data))) (stringp ans)) :rule-classes :type-prescription)