Minor klacks enhancements.

klacks/klacks.lisp (CONSUME-CHARACTERS): New function.

	klacks/package.lisp (KLACKS): Export dribble-handler and
	consume-characters.
This commit is contained in:
dlichteblau
2007-10-03 15:22:57 +00:00
parent 319149507a
commit 4f731703de
2 changed files with 9 additions and 0 deletions

View File

@ -79,6 +79,12 @@
(check-type key (member :characters)) (check-type key (member :characters))
characters)) characters))
(defun klacks:consume-characters (source)
(with-output-to-string (s)
(while (eq (klacks:peek source) :characters)
(write-string (klacks:current-characters source) s)
(klacks:consume source))))
(defun klacks:serialize-event (source handler &key (consume t)) (defun klacks:serialize-event (source handler &key (consume t))
(multiple-value-bind (key a b c) (klacks:peek source) (multiple-value-bind (key a b c) (klacks:peek source)
(let ((result nil)) (let ((result nil))

View File

@ -21,8 +21,10 @@
(:export #:source (:export #:source
#:close-source #:close-source
#:with-open-source #:with-open-source
#:tapping-source #:tapping-source
#:make-tapping-source #:make-tapping-source
#:dribble-handler
#:peek #:peek
#:peek-value #:peek-value
@ -42,6 +44,7 @@
#:current-lname #:current-lname
#:current-qname #:current-qname
#:current-characters #:current-characters
#:consume-characters
#:current-cdata-section-p #:current-cdata-section-p
#:map-current-namespace-declarations #:map-current-namespace-declarations