Merge pull request #7 from jdz/patch-1

Suppress warnings for register-groups-bind with empty var-list
This commit is contained in:
Hans Hübner
2013-12-30 00:20:41 -08:00

View File

@ -332,15 +332,7 @@ substrings may share structure with TARGET-STRING."
(with-rebinding (target-string) (with-rebinding (target-string)
(with-unique-names (match-start match-end reg-starts reg-ends (with-unique-names (match-start match-end reg-starts reg-ends
start-index substr-fn) start-index substr-fn)
`(multiple-value-bind (,match-start ,match-end ,reg-starts ,reg-ends) (let ((var-bindings
(scan ,regex ,target-string :start (or ,start 0)
:end (or ,end (length ,target-string)))
(declare (ignore ,match-end))
(when ,match-start
(let* ,(cons
`(,substr-fn (if ,sharedp
#'nsubseq
#'subseq))
(loop for (function var) in (normalize-var-list var-list) (loop for (function var) in (normalize-var-list var-list)
for counter from 0 for counter from 0
when var when var
@ -352,8 +344,20 @@ substrings may share structure with TARGET-STRING."
,target-string ,target-string
,start-index ,start-index
(aref ,reg-ends ,counter))) (aref ,reg-ends ,counter)))
nil))))) nil))))))
,@body)))))) `(multiple-value-bind (,match-start ,match-end ,reg-starts ,reg-ends)
(scan ,regex ,target-string :start (or ,start 0)
:end (or ,end (length ,target-string)))
(declare (ignore ,match-end))
,@(unless var-bindings
`((declare (ignore ,reg-starts ,reg-ends))))
(when ,match-start
,@(if var-bindings
`((let* ,(list*
`(,substr-fn (if ,sharedp #'nsubseq #'subseq))
var-bindings)
,@body))
body)))))))
(defmacro do-scans ((match-start match-end reg-starts reg-ends regex (defmacro do-scans ((match-start match-end reg-starts reg-ends regex
target-string target-string