X-Git-Url: https://git.distorted.org.uk/~mdw/sod/blobdiff_plain/3109662aca9c06495ac22c5c58b46e1c036aca5c..437938912d93089d7716a119363e49db5a57cba8:/src/parser/parser-proto.lisp diff --git a/src/parser/parser-proto.lisp b/src/parser/parser-proto.lisp index 879db4c..4bd1ae4 100644 --- a/src/parser/parser-proto.lisp +++ b/src/parser/parser-proto.lisp @@ -77,6 +77,7 @@ ;;;-------------------------------------------------------------------------- ;;; Utilities. +(export 'combine-parser-failures) (defun combine-parser-failures (failures) "Combine the failure indicators listed in FAILURES. @@ -103,13 +104,16 @@ (:documentation "Expand a parser list-form given by HEAD and TAIL, in CONTEXT.") (:method (context head tail) + (declare (ignore context)) (cons head tail))) (export 'wrap-parser) (defgeneric wrap-parser (context form) (:documentation "Enclose FORM in whatever is necessary to make the parser work.") - (:method (context form) form))) + (:method (context form) + (declare (ignore context)) + form))) (export 'defparse) (defmacro defparse (name bvl &body body) @@ -124,10 +128,6 @@ body FORMs. The BVL is a destructuring lambda-list to be applied to the tail of the form. The body forms are enclosed in a block called NAME. - Within the FORMs, a function `expand' is available: it takes a parser - specifier as its argument and returns its expansion in the parser's - context. - If the :context key is provided, then the parser form is specialized on a particular class of parser contexts SPEC; specialized expanders take priority over less specialized or unspecialized expanders -- so you can @@ -151,6 +151,7 @@ `(defmethod expand-parser-form ((,context ,ctxclass) (,head (eql ',name)) ,tail) ,@doc + (declare (ignorable ,context)) (block ,name (destructuring-bind ,bvl ,tail ,@decls @@ -335,10 +336,12 @@ (defmethod expand-parser-spec (context (spec (eql t))) "Always matches without consuming input." + (declare (ignore context)) '(values t t nil)) (defmethod expand-parser-spec (context (spec (eql nil))) "Always fails without consuming input. The failure indicator is `:fail'." + (declare (ignore context)) '(values '(:fail) nil nil)) (export 'seq) @@ -457,8 +460,7 @@ (,func (lambda (,new) (declare (ignorable ,new)) (setf ,accvar ,update)) - (lambda () - ,final) + (lambda () ,final) (parser () ,parser) ,@(and sepp (list `(parser () ,sep))) ,@(and minp `(:min ,min)) @@ -605,7 +607,9 @@ underlying scanner can use this call to determine whether there are outstanding captured places, and thereby optimize its behaviour. Be careful: all of this is happening at macro-expansion time.") - (:method (context place) nil)) + (:method (context place) + (declare (ignore context place)) + nil)) (export 'parser-places-must-be-released-p) (defgeneric parser-places-must-be-released-p (context) @@ -620,7 +624,9 @@ the correct cleanup. If it returns false, then the `unwind-protect' is omitted so that the runtime code does't have to register cleanup handlers.") - (:method (context) t))) + (:method (context) + (declare (ignore context)) + t))) (export 'with-parser-place) (defmacro with-parser-place ((place context) &body body) @@ -843,7 +849,7 @@ A token matches under the following conditions: * If the value of TYPE is `t' then the match succeeds if and only if the - parser it not at end-of-file. + parser is not at end-of-file. * If the value of TYPE is not `eql' to the token type then the match fails.