Compatible with seq. Get the first token, no matter what kind of token it is. Causes an error on EOF.
(vl-match-any &key (function '__function__) (tokstream 'tokstream)) → (mv errmsg? token new-tokstream)
Function:
(defun vl-match-any$inline (function tokstream) (declare (xargs :stobjs (tokstream))) (declare (xargs :guard (symbolp function))) (let ((__function__ 'vl-match-any)) (declare (ignorable __function__)) (b* ((tokens (vl-tokstream->tokens)) ((when (atom tokens)) (vl-parse-error "Unexpected EOF." :function function)) (tokstream (vl-tokstream-pop))) (mv nil (car tokens) tokstream))))
Theorem:
(defthm vl-match-any-fails-gracefully (implies (mv-nth 0 (vl-match-any)) (equal (mv-nth 1 (vl-match-any)) nil)))
Theorem:
(defthm vl-warning-p-of-vl-match-any (iff (vl-warning-p (mv-nth 0 (vl-match-any))) (mv-nth 0 (vl-match-any))))
Theorem:
(defthm vl-token-p-of-vl-match-any (implies (not (mv-nth 0 (vl-match-any))) (vl-token-p (mv-nth 1 (vl-match-any)))))
Theorem:
(defthm vl-match-any-fn-count-strong-on-value (and (<= (vl-tokstream-measure :tokstream (mv-nth 2 (vl-match-any))) (vl-tokstream-measure)) (implies (mv-nth 1 (vl-match-any)) (< (vl-tokstream-measure :tokstream (mv-nth 2 (vl-match-any))) (vl-tokstream-measure)))) :rule-classes ((:rewrite) (:linear)))
Theorem:
(defthm equal-of-vl-match-any-fn-count (equal (equal (vl-tokstream-measure :tokstream (mv-nth 2 (vl-match-any))) (vl-tokstream-measure)) (if (mv-nth 0 (vl-match-any)) t nil)))