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-unique-names (match-start match-end reg-starts reg-ends
start-index substr-fn)
`(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))
(when ,match-start
(let* ,(cons
`(,substr-fn (if ,sharedp
#'nsubseq
#'subseq))
(let ((var-bindings
(loop for (function var) in (normalize-var-list var-list)
for counter from 0
when var
@ -352,8 +344,20 @@ substrings may share structure with TARGET-STRING."
,target-string
,start-index
(aref ,reg-ends ,counter)))
nil)))))
,@body))))))
nil))))))
`(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
target-string