Matches
(vl-parse-nonnull-port &key (tokstream 'tokstream) (config 'config)) → (mv errmsg? value new-tokstream)
Function:
(defun vl-parse-nonnull-port-fn (tokstream config) (declare (xargs :stobjs (tokstream))) (declare (xargs :guard (vl-loadconfig-p config))) (declare (ignorable config)) (let ((__function__ 'vl-parse-nonnull-port)) (declare (ignorable __function__)) (seq tokstream (loc := (vl-current-loc)) (unless (vl-is-token? :vl-dot) (pexpr := (vl-parse-port-expression)) (return (cond ((vl-idexpr-p pexpr) (make-vl-regularport :name (vl-idexpr->name pexpr) :expr pexpr :loc loc)) (t (make-vl-regularport :name nil :expr pexpr :loc loc))))) (:= (vl-match)) (id := (vl-match-token :vl-idtoken)) (:= (vl-match-token :vl-lparen)) (unless (vl-is-token? :vl-rparen) (pexpr := (vl-parse-port-expression))) (:= (vl-match-token :vl-rparen)) (return (make-vl-regularport :name (vl-idtoken->name id) :expr pexpr :loc loc)))))
Theorem:
(defthm vl-parse-nonnull-port-fails-gracefully (implies (mv-nth 0 (vl-parse-nonnull-port)) (not (mv-nth 1 (vl-parse-nonnull-port)))))
Theorem:
(defthm vl-warning-p-of-vl-parse-nonnull-port (iff (vl-warning-p (mv-nth 0 (vl-parse-nonnull-port))) (mv-nth 0 (vl-parse-nonnull-port))))
Theorem:
(defthm vl-parse-nonnull-port-result (implies (and t) (equal (vl-port-p (mv-nth 1 (vl-parse-nonnull-port))) (not (mv-nth 0 (vl-parse-nonnull-port))))))
Theorem:
(defthm vl-parse-nonnull-port-count-strong (and (<= (vl-tokstream-measure :tokstream (mv-nth 2 (vl-parse-nonnull-port))) (vl-tokstream-measure)) (implies (not (mv-nth 0 (vl-parse-nonnull-port))) (< (vl-tokstream-measure :tokstream (mv-nth 2 (vl-parse-nonnull-port))) (vl-tokstream-measure)))) :rule-classes ((:rewrite) (:linear)))