Check if a token is a given punctuator.
(token-punctuatorp token punctuator) → yes/no
This operates on an optional token, since we normally call this function on an optional token.
Function:
(defun token-punctuatorp (token punctuator) (declare (xargs :guard (and (token-optionp token) (stringp punctuator)))) (let ((__function__ 'token-punctuatorp)) (declare (ignorable __function__)) (and token (token-case token :punctuator) (equal (token-punctuator->unwrap token) punctuator))))
Theorem:
(defthm booleanp-of-token-punctuatorp (b* ((yes/no (token-punctuatorp token punctuator))) (booleanp yes/no)) :rule-classes :rewrite)
Theorem:
(defthm non-nil-when-token-punctuatorp (implies (token-punctuatorp token punctuator) token) :rule-classes :forward-chaining)