For use in vl-includeskips, just skip past any whitespace and comments.
(vl-skip-whitespace/comments x) → remainder
Function:
(defun vl-skip-whitespace/comments (x) (declare (xargs :guard (vl-echarlist-p x))) (let ((__function__ 'vl-skip-whitespace/comments)) (declare (ignorable __function__)) (b* (((when (atom x)) x) (char1 (vl-echar->char (first x))) ((when (vl-whitespace-p char1)) (vl-skip-whitespace/comments (cdr x))) ((unless (and (eql char1 #\/) (consp (cdr x)))) x) (char2 (vl-echar->char (second x))) (rest (cddr x)) ((when (and (eql char2 #\/) (not (vl-matches-string-p "@VL" rest)) (not (vl-matches-string-p "+VL" rest)))) (b* (((mv ?okp ?prefix remainder) (vl-read-through-literal *nls* rest))) (vl-skip-whitespace/comments remainder))) ((when (and (eql char2 #\*) (not (vl-matches-string-p "@VL" rest)) (not (vl-matches-string-p "+VL" rest)))) (b* (((mv ?okp ?prefix remainder) (vl-read-through-literal "*/" rest))) (vl-skip-whitespace/comments remainder)))) x)))
Theorem:
(defthm vl-echarlist-p-of-vl-skip-whitespace/comments (implies (and (vl-echarlist-p x)) (b* ((remainder (vl-skip-whitespace/comments x))) (vl-echarlist-p remainder))) :rule-classes :rewrite)