noch ein paar assertions durch check-rune ersetzt

This commit is contained in:
dlichteblau
2005-11-27 12:43:29 +00:00
parent d428a31245
commit 4955e5b351
2 changed files with 28 additions and 78 deletions

View File

@ -1219,10 +1219,17 @@
(unread-rune c input)
(values :CDATA (read-cdata input)))))))))))
(definline check-rune (input actual expected)
(declare (ignore input))
(unless (eql actual expected)
(wf-error "expected #/~A but found #/~A"
(rune-char expected)
(rune-char actual))))
(defun read-pe-reference (zinput)
(let* ((input (car (zstream-input-stack zinput)))
(nam (read-name-token input)))
(assert (rune= #/\; (read-rune input)))
(check-rune input #/\; (read-rune input))
(cond (*expand-pe-p*
;; no external entities here!
(let ((i2 (entity->xstream nam :parameter)))
@ -1346,7 +1353,7 @@
(values kind (cons name atts)))
((eq (peek-rune input) #//)
(consume-rune input)
(assert (rune= #/> (read-rune input)))
(check-rune input #/> (read-rune input))
(values :ztag (cons name atts)))
(t
(wf-error "syntax error in read-tag-2.")) )))
@ -1427,7 +1434,7 @@
(wf-error "Expecting name after &."))
(let ((name (read-name-token input)))
(setf c (read-rune input))
(assert (rune= c #/\;))
(check-rune input c #/\;)
(ecase mode
(:ATT
(recurse-on-entity
@ -1449,7 +1456,7 @@
(wf-error "Expecting name after %."))
(let ((name (read-name-token input)))
(setf c (read-rune input))
(assert (rune= c #/\;))
(check-rune input c #/\;)
(cond (*expand-pe-p*
(recurse-on-entity
zinput name :parameter
@ -1473,16 +1480,10 @@
(declare (dynamic-extent #'muffle))
(muffle input (or delim
(let ((delim (read-rune input)))
(assert (member delim '(#/\" #/\')))
(unless (member delim '(#/\" #/\'))
(wf-error "invalid attribute delimiter"))
delim))))))
(defun check-rune (input actual expected)
(declare (ignore input))
(unless (eql actual expected)
(wf-error "expected #/~A but found #/~A"
(rune-char expected)
(rune-char actual))))
(defun read-character-reference (input)
;; xxx eof handling
;; The #/& is already read
@ -3217,7 +3218,7 @@
(wf-error "Expecting name after &."))
(let ((name (read-name-token input)))
(setf c (read-rune input))
(assert (rune= c #/\;))
(check-rune input c #/\;)
(recurse-on-entity
zinput name :general
(lambda (zinput)