Compatible with seq. Produce a non-fatal warning (not an error, doesn't stop execution) that includes the current location.
(vl-parse-warning type description &key (function '__function__) (tokstream 'tokstream)) → (mv errmsg value new-tokstream)
Function:
(defun vl-parse-warning-fn (type description function tokstream) (declare (xargs :stobjs (tokstream))) (declare (xargs :guard (and (symbolp type) (stringp description) (symbolp function)))) (let ((__function__ 'vl-parse-warning)) (declare (ignorable __function__)) (b* ((tokens (vl-tokstream->tokens)) (warning (make-vl-warning :type type :msg "At ~a0: ~s1" :args (list (if (consp tokens) (vl-token->loc (car tokens)) "EOF") description) :fn function :fatalp nil)) (tokstream (vl-tokstream-add-warning warning))) (mv nil nil tokstream))))
Theorem:
(defthm not-of-vl-parse-warning.errmsg (b* (((mv ?errmsg acl2::?value ?new-tokstream) (vl-parse-warning-fn type description function tokstream))) (not errmsg)) :rule-classes :rewrite)
Theorem:
(defthm not-of-vl-parse-warning.value (b* (((mv ?errmsg acl2::?value ?new-tokstream) (vl-parse-warning-fn type description function tokstream))) (not value)) :rule-classes :rewrite)
Theorem:
(defthm vl-tokstream->tokens-of-vl-parse-warning (b* (((mv ?errmsg acl2::?value ?new-tokstream) (vl-parse-warning-fn type description function tokstream))) (equal (vl-tokstream->tokens :tokstream new-tokstream) (vl-tokstream->tokens))) :rule-classes :rewrite)