Try to read a string escape sequence.
(vl-read-string-escape-sequence echars st) → (mv char/nil prefix remainder)
Function:
(defun vl-read-string-escape-sequence (echars st) (declare (xargs :guard (and (and (vl-echarlist-p echars) (consp echars) (equal (vl-echar->char (car echars)) #\\)) (vl-lexstate-p st)))) (let ((__function__ 'vl-read-string-escape-sequence)) (declare (ignorable __function__)) (b* (((unless (consp (cdr echars))) (mv nil nil echars)) (echar1 (first echars)) (echar2 (second echars)) (char2 (vl-echar->char echar2)) ((when (eql char2 #\n)) (mv #\Newline (list echar1 echar2) (cddr echars))) ((when (eql char2 #\t)) (mv #\Tab (list echar1 echar2) (cddr echars))) ((when (eql char2 #\\)) (mv #\\ (list echar1 echar2) (cddr echars))) ((when (eql char2 #\")) (mv #\" (list echar1 echar2) (cddr echars))) ((when (vl-echar-digit-value echar2 8)) (vl-read-octal-string-escape echars)) ((vl-lexstate st) st) ((unless st.strextsp) (mv nil nil echars)) ((when (eql char2 #\Newline)) (mv nil (list echar1 echar2) (cddr echars))) ((when (eql char2 #\v)) (mv (vertical-tab-char) (list echar1 echar2) (cddr echars))) ((when (eql char2 #\f)) (mv #\Page (list echar1 echar2) (cddr echars))) ((when (eql char2 #\a)) (mv (code-char 7) (list echar1 echar2) (cddr echars))) ((when (eql char2 #\x)) (vl-read-hex-string-escape echars))) (mv (cw "Lexer error (~s0): invalid string escape sequence: ~s1~%" (vl-location-string (vl-echar->loc (car echars))) (vl-echarlist->string (list echar1 echar2))) nil echars))))
Theorem:
(defthm return-type-of-vl-read-string-escape-sequence.char/nil (b* (((mv ?char/nil ?prefix ?remainder) (vl-read-string-escape-sequence echars st))) (equal (characterp char/nil) (if char/nil t nil))) :rule-classes :rewrite)