(vl-tokstream-restore backup &key (tokstream 'tokstream)) → tokstream
Function:
(defun vl-tokstream-restore-fn (backup tokstream) (declare (xargs :stobjs (tokstream))) (declare (xargs :guard (vl-tokstream-backup-p backup))) (let ((__function__ 'vl-tokstream-restore)) (declare (ignorable __function__)) (b* (((vl-tokstream-backup backup)) (curr-pstate (vl-tokstream->pstate)) (- (if (equal (vl-parsestate->usertypes curr-pstate) (vl-parsestate->usertypes backup.pstate)) nil (vl-parsestate-free curr-pstate))) (new-pstate (vl-parsestate-restore backup.pstate)) (tokstream (vl-tokstream-update-pstate new-pstate)) (tokstream (vl-tokstream-update-tokens backup.tokens))) (vl-tokstream-fix))))
Theorem:
(defthm vl-tokstream-restore-of-vl-tokstream-save (equal (vl-tokstream-restore (vl-tokstream-save) :tokstream anything) (vl-tokstream-fix)))