- (once-only (type value peekp)
- (with-gensyms (tokty tokval)
- `(let ((,tokty ,(parser-token-type context))
- (,tokval ,(parser-token-value context)))
- (if ,(if (eq type t)
- `(not (eq ,tokty :eof))
- (flet ((check-value (cond)
- (if valuep
- `(and ,cond (equal ,tokval ,value))
- cond)))
- (if (constantp type)
- (check-value `(eql ,tokty ,type))
- `(if (eq ,type t)
- (not (eq ,tokty :eof))
- ,(check-value `(eql ,tokty ,type))))))
- ,(let* ((result `(values ,tokval t ,(if (constantp peekp)
- (not peekp)
- `(not ,peekp))))
- (step (parser-step context)))
- (cond ((not (constantp peekp))
- `(multiple-value-prog1 ,result
- (unless ,peekp ,step)))
- (peekp
- result)
- (t
- `(multiple-value-prog1 ,result
- ,step))))
- (values (list ,(if valuep `(list ,type ,value) type))
- nil nil))))))
+ (once-only (type value peekp)
+ (with-gensyms (tokty tokval)
+ `(let ((,tokty ,(parser-token-type context))
+ (,tokval ,(parser-token-value context)))
+ (if ,(if (eq type t)
+ `(not (eq ,tokty :eof))
+ (flet ((check-value (cond)
+ (if valuep
+ `(and ,cond (equal ,tokval ,value))
+ cond)))
+ (if (constantp type)
+ (check-value `(eql ,tokty ,type))
+ `(if (eq ,type t)
+ (not (eq ,tokty :eof))
+ ,(check-value `(eql ,tokty ,type))))))
+ ,(let* ((result `(values ,tokval t ,(if (constantp peekp)
+ (not peekp)
+ `(not ,peekp))))
+ (step (parser-step context)))
+ (cond ((not (constantp peekp))
+ `(multiple-value-prog1 ,result
+ (unless ,peekp ,step)))
+ (peekp
+ result)
+ (t
+ `(multiple-value-prog1 ,result
+ ,step))))
+ (values (list ,(if valuep `(list ,type ,value) type))
+ nil nil)))))))