Compatible with seq. Get the current location.
(vl-current-loc &key (tokstream 'tokstream)) → (mv errmsg loc new-tokstream)
We just return the location of the first token, if there is one. Or, if the token stream is empty, we just return *vl-fakeloc*
Function:
(defun vl-current-loc-fn (tokstream) (declare (xargs :stobjs (tokstream))) (declare (xargs :guard t)) (let ((__function__ 'vl-current-loc)) (declare (ignorable __function__)) (b* ((tokens (vl-tokstream->tokens))) (mv nil (if (consp tokens) (vl-token->loc (car tokens)) *vl-fakeloc*) tokstream))))
Theorem:
(defthm not-of-vl-current-loc.errmsg (b* (((mv ?errmsg ?loc ?new-tokstream) (vl-current-loc-fn tokstream))) (not errmsg)) :rule-classes :rewrite)
Theorem:
(defthm vl-location-p-of-vl-current-loc.loc (b* (((mv ?errmsg ?loc ?new-tokstream) (vl-current-loc-fn tokstream))) (vl-location-p loc)) :rule-classes :rewrite)
Theorem:
(defthm return-type-of-vl-current-loc.new-tokstream (b* (((mv ?errmsg ?loc ?new-tokstream) (vl-current-loc-fn tokstream))) (equal new-tokstream tokstream)) :rule-classes :rewrite)