chiark
/
gitweb
/
~mdw
/
sod
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
src/: Fix some docstrings.
[sod]
/
src
/
parser
/
parser-proto.lisp
diff --git
a/src/parser/parser-proto.lisp
b/src/parser/parser-proto.lisp
index 4242dfef0340cad9a94aef1a1770611c7677953c..4bd1ae4a9d0e5993b8ddd43a8a131d6af131a7a2 100644
(file)
--- a/
src/parser/parser-proto.lisp
+++ b/
src/parser/parser-proto.lisp
@@
-77,6
+77,7
@@
(cl:in-package #:sod-parser)
;;;--------------------------------------------------------------------------
;;; Utilities.
;;;--------------------------------------------------------------------------
;;; Utilities.
+(export 'combine-parser-failures)
(defun combine-parser-failures (failures)
"Combine the failure indicators listed in FAILURES.
(defun combine-parser-failures (failures)
"Combine the failure indicators listed in FAILURES.
@@
-103,13
+104,16
@@
(defgeneric expand-parser-form (context head tail)
(:documentation
"Expand a parser list-form given by HEAD and TAIL, in CONTEXT.")
(:method (context head tail)
(: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.")
(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)
(export 'defparse)
(defmacro defparse (name bvl &body body)
@@
-147,6
+151,7
@@
(defmacro defparse (name bvl &body body)
`(defmethod expand-parser-form
((,context ,ctxclass) (,head (eql ',name)) ,tail)
,@doc
`(defmethod expand-parser-form
((,context ,ctxclass) (,head (eql ',name)) ,tail)
,@doc
+ (declare (ignorable ,context))
(block ,name
(destructuring-bind ,bvl ,tail
,@decls
(block ,name
(destructuring-bind ,bvl ,tail
,@decls
@@
-331,10
+336,12
@@
(defparse when (cond &body parser)
(defmethod expand-parser-spec (context (spec (eql t)))
"Always matches without consuming input."
(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'."
'(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)
'(values '(:fail) nil nil))
(export 'seq)
@@
-600,7
+607,9
@@
(defgeneric parser-release-place (context place)
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.")
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)
(export 'parser-places-must-be-released-p)
(defgeneric parser-places-must-be-released-p (context)
@@
-615,7
+624,9
@@
(defgeneric parser-places-must-be-released-p (context)
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.")
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)
(export 'with-parser-place)
(defmacro with-parser-place ((place context) &body body)