Match any characters until and through some literal.
(vl-read-through-literal string echars) → (mv successp prefix remainder)
Function:
(defun vl-read-through-literal (string echars) (declare (type string string)) (declare (xargs :guard (vl-echarlist-p echars))) (declare (xargs :guard (not (equal string "")))) (let ((__function__ 'vl-read-through-literal)) (declare (ignorable __function__)) (mbe :logic (b* ((string (string-fix string)) ((mv successp prefix remainder) (vl-read-until-literal string echars)) ((unless successp) (mv nil prefix remainder))) (mv t (append prefix (take (length string) remainder)) (nthcdr (length string) remainder))) :exec (b* (((mv successp prefix remainder) (vl-read-until-literal-impl string echars nil)) ((unless successp) (mv nil (reverse prefix) remainder)) (strlen (length string))) (mv t (reverse (revappend-of-take strlen remainder prefix)) (rest-n strlen remainder))))))
Theorem:
(defthm prefix-of-vl-read-through-literal-under-iff (b* (((mv ?successp prefix ?remainder) (vl-read-through-literal string echars))) (implies (and (stringp string) (not (equal string ""))) (iff prefix (consp echars)))))