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