use ~e for errors
svn: r8568
This commit is contained in:
parent
5666dd3d81
commit
cd8470fc21
|
@ -41,7 +41,7 @@
|
||||||
(location-offset loc-before)
|
(location-offset loc-before)
|
||||||
(- (location-offset loc-after)
|
(- (location-offset loc-after)
|
||||||
(location-offset loc-before))))
|
(location-offset loc-before))))
|
||||||
"extra stuff at end of document ~a"
|
"extra stuff at end of document ~e"
|
||||||
end-of-file)))
|
end-of-file)))
|
||||||
misc1))))))
|
misc1))))))
|
||||||
|
|
||||||
|
@ -64,7 +64,7 @@
|
||||||
#f
|
#f
|
||||||
1
|
1
|
||||||
(- (location-offset (pos)) 1)))
|
(- (location-offset (pos)) 1)))
|
||||||
"expected root element - received ~a"
|
"expected root element - received ~e"
|
||||||
(if (pcdata? start) (pcdata-string start) start))]))
|
(if (pcdata? start) (pcdata-string start) start))]))
|
||||||
|
|
||||||
;; read-misc : Input-port (-> Location) -> (listof Misc) Token
|
;; read-misc : Input-port (-> Location) -> (listof Misc) Token
|
||||||
|
@ -323,7 +323,7 @@
|
||||||
(define (lex-name in pos)
|
(define (lex-name in pos)
|
||||||
(let ([c (non-eof read-char-or-special in pos)])
|
(let ([c (non-eof read-char-or-special in pos)])
|
||||||
(unless (name-start? c)
|
(unless (name-start? c)
|
||||||
(lex-error in pos "expected name, received ~s" c))
|
(lex-error in pos "expected name, received ~e" c))
|
||||||
(string->symbol
|
(string->symbol
|
||||||
(list->string
|
(list->string
|
||||||
(cons c (let lex-rest ()
|
(cons c (let lex-rest ()
|
||||||
|
|
|
@ -29,7 +29,7 @@
|
||||||
(filter (lambda (s)
|
(filter (lambda (s)
|
||||||
(not (and (pcdata? s)
|
(not (and (pcdata? s)
|
||||||
(or (all-blank (pcdata-string 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)]
|
content)]
|
||||||
[else content]))))])
|
[else content]))))])
|
||||||
blank-it))
|
blank-it))
|
||||||
|
|
|
@ -105,7 +105,7 @@
|
||||||
(define (cdata-string x) (syntax-e x))
|
(define (cdata-string x) (syntax-e x))
|
||||||
|
|
||||||
(define (comment-text c)
|
(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
|
; conflate documents with their root elements
|
||||||
(define (document-element d) d)
|
(define (document-element d) d)
|
||||||
; more here - spoof document pieces better?
|
; more here - spoof document pieces better?
|
||||||
|
@ -113,34 +113,34 @@
|
||||||
(define (document-prolog d) null)
|
(define (document-prolog d) null)
|
||||||
|
|
||||||
(define (document-type-external dtd)
|
(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)
|
(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)
|
(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)
|
(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)
|
(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)
|
(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)
|
(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)
|
(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)
|
(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)
|
(define (prolog-misc2 x)
|
||||||
(error 'prolog-misc2 "expected a prolog, given ~a" x))
|
(error 'prolog-misc2 "expected a prolog, given ~e" x))
|
||||||
|
|
||||||
; : tst -> bool
|
; : tst -> bool
|
||||||
(define (attribute? a)
|
(define (attribute? a)
|
||||||
|
|
|
@ -19,7 +19,7 @@
|
||||||
(lambda (x)
|
(lambda (x)
|
||||||
(if (or (eq? x 'always) (eq? x 'never) (and (list? x) (andmap symbol? x)))
|
(if (or (eq? x 'always) (eq? x 'never) (and (list? x) (andmap symbol? x)))
|
||||||
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))
|
(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]
|
[(entity? el) write-xml-entity]
|
||||||
[(comment? el) write-xml-comment]
|
[(comment? el) write-xml-comment]
|
||||||
[(pi? el) write-xml-pi]
|
[(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))
|
el over dent out))
|
||||||
|
|
||||||
;; write-xml-element : Element Nat (Nat Output-Stream -> Void) Output-Stream -> Void
|
;; write-xml-element : Element Nat (Nat Output-Stream -> Void) Output-Stream -> Void
|
||||||
|
|
|
@ -169,9 +169,9 @@
|
||||||
[(pcdata? x) (pcdata-string x)]
|
[(pcdata? x) (pcdata-string x)]
|
||||||
[(entity? x) (entity-text x)]
|
[(entity? x) (entity-text x)]
|
||||||
[(or (comment? x) (pi? x) (cdata? x)) 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)
|
[else ;(error 'xml->xexpr "Expected content, given ~e" x)
|
||||||
x]))))
|
x]))))
|
||||||
|
|
||||||
;; attribute->srep : Attribute -> Attribute-srep
|
;; attribute->srep : Attribute -> Attribute-srep
|
||||||
(define (attribute->srep a)
|
(define (attribute->srep a)
|
||||||
|
@ -205,8 +205,8 @@
|
||||||
[(or (symbol? x) (and (integer? x) (>= x 0)))
|
[(or (symbol? x) (and (integer? x) (>= x 0)))
|
||||||
(make-entity 'scheme 'scheme x)]
|
(make-entity 'scheme 'scheme x)]
|
||||||
[(or (comment? x) (pi? x) (cdata? x)) x]
|
[(or (comment? x) (pi? x) (cdata? x)) x]
|
||||||
[else ;(error 'xexpr->xml "malformed xexpr ~s" x)
|
[else ;(error 'xexpr->xml "malformed xexpr ~e" x)
|
||||||
x]))
|
x]))
|
||||||
|
|
||||||
;; xexpr->string : Xexpression -> String
|
;; xexpr->string : Xexpression -> String
|
||||||
(define (xexpr->string xexpr)
|
(define (xexpr->string xexpr)
|
||||||
|
|
Loading…
Reference in New Issue
Block a user