src/parser/parser-proto.lisp: Muffle a `&optional ... &key ...' warning.
authorMark Wooding <mdw@distorted.org.uk>
Sat, 10 Aug 2019 00:16:13 +0000 (01:16 +0100)
committerMark Wooding <mdw@distorted.org.uk>
Sat, 10 Aug 2019 14:46:01 +0000 (15:46 +0100)
Somehow I missed this one.

src/parser/parser-proto.lisp

index ed439f9..979a2a5 100644 (file)
    "Return the parser's current token's semantic value."))
 
 (export 'token)
-(defparse token (:context (context token-parser-context)
-                type &optional (value nil valuep) &key peekp)
-  "Match tokens of a particular type.
+(locally  (declare #+sbcl (sb-ext:muffle-conditions style-warning))
+  (defparse token (:context (context token-parser-context)
+                           type &optional (value nil valuep) &key peekp)
+    "Match tokens of a particular type.
 
    A token matches under the following conditions:
 
    If the match fails then the failure indicator is either TYPE or (TYPE
    VALUE), depending on whether a VALUE was specified."
 
-  (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)))))))
 
 (defmethod expand-parser-spec ((context token-parser-context) spec)
   (if (atom spec)