From cd8470fc21504179200c6b7d901e03cad193eec4 Mon Sep 17 00:00:00 2001 From: Eli Barzilay Date: Thu, 7 Feb 2008 18:09:27 +0000 Subject: [PATCH] use ~e for errors svn: r8568 --- collects/xml/private/reader.ss | 6 +++--- collects/xml/private/space.ss | 2 +- collects/xml/private/syntax.ss | 22 +++++++++++----------- collects/xml/private/writer.ss | 4 ++-- collects/xml/private/xexpr.ss | 8 ++++---- 5 files changed, 21 insertions(+), 21 deletions(-) diff --git a/collects/xml/private/reader.ss b/collects/xml/private/reader.ss index 695ba6695d..2d72135fb3 100644 --- a/collects/xml/private/reader.ss +++ b/collects/xml/private/reader.ss @@ -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 () diff --git a/collects/xml/private/space.ss b/collects/xml/private/space.ss index b31d10306c..88d18671f2 100644 --- a/collects/xml/private/space.ss +++ b/collects/xml/private/space.ss @@ -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)) diff --git a/collects/xml/private/syntax.ss b/collects/xml/private/syntax.ss index e34c167bcf..5908c8af25 100644 --- a/collects/xml/private/syntax.ss +++ b/collects/xml/private/syntax.ss @@ -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) diff --git a/collects/xml/private/writer.ss b/collects/xml/private/writer.ss index ce8eb2c84f..7c7c345fbf 100644 --- a/collects/xml/private/writer.ss +++ b/collects/xml/private/writer.ss @@ -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 diff --git a/collects/xml/private/xexpr.ss b/collects/xml/private/xexpr.ss index 5b08521ae0..f8ad9122aa 100644 --- a/collects/xml/private/xexpr.ss +++ b/collects/xml/private/xexpr.ss @@ -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)