(vl-read-escaped-identifier echars) → (mv name/nil prefix remainder)
Function:
(defun vl-read-escaped-identifier (echars) (declare (xargs :guard (vl-echarlist-p echars))) (let ((__function__ 'vl-read-escaped-identifier)) (declare (ignorable __function__)) (b* (((when (or (not (consp echars)) (not (eql (vl-echar->char (car echars)) #\\)))) (mv nil nil echars)) ((mv tail remainder) (vl-read-while-printable-not-whitespace (cdr echars))) ((unless tail) (mv nil nil echars)) ((unless (consp remainder)) (mv (hons-copy (vl-echarlist->string tail)) (cons (car echars) tail) remainder))) (mv (hons-copy (vl-echarlist->string tail)) (cons (car echars) (append tail (list (car remainder)))) (cdr remainder)))))
Theorem:
(defthm return-type-of-vl-read-escaped-identifier.name/nil (implies (and (force (vl-echarlist-p echars))) (b* (((mv ?name/nil ?prefix ?remainder) (vl-read-escaped-identifier echars))) (equal (stringp name/nil) (if name/nil t nil)))) :rule-classes :rewrite)
Theorem:
(defthm vl-read-escaped-identifier-under-iff (b* (((mv name prefix ?remainder) (vl-read-escaped-identifier echars))) (iff prefix name)))