chiark / gitweb /
src/frontend.lisp: Report an error if no output types are requested.
[sod] / src / parser / parser-proto.lisp
index 4bd1ae4a9d0e5993b8ddd43a8a131d6af131a7a2..4c04208d5c513575163b3f6a831445f4dba140c8 100644 (file)
@@ -152,10 +152,9 @@ (defmacro defparse (name bvl &body body)
             ((,context ,ctxclass) (,head (eql ',name)) ,tail)
           ,@doc
           (declare (ignorable ,context))
-          (block ,name
-            (destructuring-bind ,bvl ,tail
-              ,@decls
-              ,@body)))))))
+          (destructuring-bind ,bvl ,tail
+            ,@decls
+            (block ,name ,@body)))))))
 
 (export '(with-parser-context parse))
 (defmacro with-parser-context ((class &rest initargs) &body body)
@@ -573,7 +572,11 @@ (defmacro define-pluggable-parser (symbol tag (&rest bvl) &body body)
    If a parser with the given TAG is already attached to SYMBOL then the new
    parser replaces the old one; otherwise it is added to the collection."
 
-  `(pluggable-parser-add ',symbol ',tag (lambda ,bvl ,@body)))
+  (multiple-value-bind (docs decls body) (parse-body body)
+    `(pluggable-parser-add ',symbol ',tag
+                          (lambda ,bvl
+                            ,@docs ,@decls
+                            (block ,symbol ,@body)))))
 
 ;;;--------------------------------------------------------------------------
 ;;; Rewindable parser context protocol.