use ~e for errors

svn: r8568
This commit is contained in:
Eli Barzilay 2008-02-07 18:09:27 +00:00
parent 5666dd3d81
commit cd8470fc21
5 changed files with 21 additions and 21 deletions

View File

@ -41,7 +41,7 @@
(location-offset loc-before)
(- (location-offset loc-after)
(location-offset loc-before))))
"extra stuff at end of document ~a"
"extra stuff at end of document ~e"
end-of-file)))
misc1))))))
@ -64,7 +64,7 @@
#f
1
(- (location-offset (pos)) 1)))
"expected root element - received ~a"
"expected root element - received ~e"
(if (pcdata? start) (pcdata-string start) start))]))
;; read-misc : Input-port (-> Location) -> (listof Misc) Token
@ -323,7 +323,7 @@
(define (lex-name in pos)
(let ([c (non-eof read-char-or-special in pos)])
(unless (name-start? c)
(lex-error in pos "expected name, received ~s" c))
(lex-error in pos "expected name, received ~e" c))
(string->symbol
(list->string
(cons c (let lex-rest ()

View File

@ -29,7 +29,7 @@
(filter (lambda (s)
(not (and (pcdata? s)
(or (all-blank (pcdata-string s))
(error 'eliminate-blanks "Element <~a> is not allowed to contain text ~s" name (pcdata-string s))))))
(error 'eliminate-blanks "Element <~a> is not allowed to contain text ~e" name (pcdata-string s))))))
content)]
[else content]))))])
blank-it))

View File

@ -105,7 +105,7 @@
(define (cdata-string x) (syntax-e x))
(define (comment-text c)
(error 'comment-text "expected a syntax representation of an XML comment, received ~a" c))
(error 'comment-text "expected a syntax representation of an XML comment, received ~e" c))
; conflate documents with their root elements
(define (document-element d) d)
; more here - spoof document pieces better?
@ -113,34 +113,34 @@
(define (document-prolog d) null)
(define (document-type-external dtd)
(error 'document-type-external "expected a dtd, given ~a" dtd))
(error 'document-type-external "expected a dtd, given ~e" dtd))
(define (document-type-inlined dtd)
(error 'document-type-inlined "expected a dtd, given ~a" dtd))
(error 'document-type-inlined "expected a dtd, given ~e" dtd))
(define (document-type-name dtd)
(error 'document-type-name "expected a dtd, given ~a" dtd))
(error 'document-type-name "expected a dtd, given ~e" dtd))
(define (external-dtd-system x)
(error 'external-dtd-system "expected an external dtd, given ~a" x))
(error 'external-dtd-system "expected an external dtd, given ~e" x))
(define (external-dtd/public-public x)
(error 'external-dtd/public-public "expected an external dtd, given ~a" x))
(error 'external-dtd/public-public "expected an external dtd, given ~e" x))
(define (pi-instruction x)
(error 'pi-instruction "expected a pi, given ~a" x))
(error 'pi-instruction "expected a pi, given ~e" x))
(define (pi-target-name x)
(error 'pi-target-name "expected a pi, given ~a" x))
(error 'pi-target-name "expected a pi, given ~e" x))
(define (prolog-dtd x)
(error 'prolog-dtd "expected a prolog, given ~a" x))
(error 'prolog-dtd "expected a prolog, given ~e" x))
(define (prolog-misc x)
(error 'prolog-misc "expected a prolog, given ~a" x))
(error 'prolog-misc "expected a prolog, given ~e" x))
(define (prolog-misc2 x)
(error 'prolog-misc2 "expected a prolog, given ~a" x))
(error 'prolog-misc2 "expected a prolog, given ~e" x))
; : tst -> bool
(define (attribute? a)

View File

@ -19,7 +19,7 @@
(lambda (x)
(if (or (eq? x 'always) (eq? x 'never) (and (list? x) (andmap symbol? x)))
x
(error 'empty-tag-shorthand "expected 'always, 'never, or a list of symbols: received ~a" x)))))
(error 'empty-tag-shorthand "expected 'always, 'never, or a list of symbols: received ~e" x)))))
(define html-empty-tags '(param meta link isindex input img hr frame col br basefont base area))
@ -91,7 +91,7 @@
[(entity? el) write-xml-entity]
[(comment? el) write-xml-comment]
[(pi? el) write-xml-pi]
[else (error 'write-xml-content "received ~a" el)])
[else (error 'write-xml-content "received ~e" el)])
el over dent out))
;; write-xml-element : Element Nat (Nat Output-Stream -> Void) Output-Stream -> Void

View File

@ -169,9 +169,9 @@
[(pcdata? x) (pcdata-string x)]
[(entity? x) (entity-text x)]
[(or (comment? x) (pi? x) (cdata? x)) x]
[(document? x) (error 'xml->xexpr "Expected content, given ~e~nUse document-element to extract the content." x)]
[(document? x) (error 'xml->xexpr "Expected content, given ~e\nUse document-element to extract the content." x)]
[else ;(error 'xml->xexpr "Expected content, given ~e" x)
x]))))
x]))))
;; attribute->srep : Attribute -> Attribute-srep
(define (attribute->srep a)
@ -205,8 +205,8 @@
[(or (symbol? x) (and (integer? x) (>= x 0)))
(make-entity 'scheme 'scheme x)]
[(or (comment? x) (pi? x) (cdata? x)) x]
[else ;(error 'xexpr->xml "malformed xexpr ~s" x)
x]))
[else ;(error 'xexpr->xml "malformed xexpr ~e" x)
x]))
;; xexpr->string : Xexpression -> String
(define (xexpr->string xexpr)