From 7af4a81eff0f651d2f2d52c5b2f5ac1bf3cfb30d Mon Sep 17 00:00:00 2001 From: Jay McCarthy Date: Fri, 27 Feb 2009 18:44:18 +0000 Subject: [PATCH] renaming pi to p-i svn: r13872 --- collects/xml/main.ss | 9 +-------- collects/xml/private/reader.ss | 8 ++++---- collects/xml/private/sig.ss | 2 +- collects/xml/private/structures.ss | 6 +++--- collects/xml/private/syntax.ss | 18 +++++++++--------- collects/xml/private/writer.ss | 10 +++++----- collects/xml/private/xexpr.ss | 6 +++--- 7 files changed, 26 insertions(+), 33 deletions(-) diff --git a/collects/xml/main.ss b/collects/xml/main.ss index 96a0ab8a8a..b883413147 100644 --- a/collects/xml/main.ss +++ b/collects/xml/main.ss @@ -1,11 +1,4 @@ #lang scheme/base (require "xml.ss") -(provide (except-out (all-from-out "xml.ss") - pi struct:pi pi? make-pi pi-target-name pi-instruction) - (rename-out [pi p-i] - [struct:pi struct:p-i] - [pi? p-i?] - [make-pi make-p-i] - [pi-target-name p-i-target-name] - [pi-instruction p-i-instruction])) +(provide (all-from-out "xml.ss")) diff --git a/collects/xml/private/reader.ss b/collects/xml/private/reader.ss index 5eb020581b..cc8e95db9e 100644 --- a/collects/xml/private/reader.ss +++ b/collects/xml/private/reader.ss @@ -68,7 +68,7 @@ (let read-more () (let ([x (lex in pos)]) (cond - [(pi? x) + [(p-i? x) (let-values ([(lst next) (read-more)]) (values (cons x lst) next))] [(comment? x) @@ -190,7 +190,7 @@ (lex-error in pos "expected ; at the end of an entity")))])]) (make-entity start (pos) data)))) - ; lex-tag-cdata-pi-comment : Input-port (-> Location) -> Start-tag | Element | End-tag | Cdata | Pi | Comment + ; lex-tag-cdata-pi-comment : Input-port (-> Location) -> Start-tag | Element | End-tag | Cdata | p-i | Comment ; pre: the first char is a #\< (define (lex-tag-cdata-pi-comment in pos) (let ([start (pos)]) @@ -215,13 +215,13 @@ [else (skip-dtd in pos) (skip-space in) (unless (eq? (peek-char-or-special in) #\<) - (lex-error in pos "expected pi, comment, or element after doctype")) + (lex-error in pos "expected p-i, comment, or element after doctype")) (lex-tag-cdata-pi-comment in pos)])] [(#\?) (read-char in) (let ([name (lex-name in pos)]) (skip-space in) (let ([data (lex-pi-data in pos)]) - (make-pi start (pos) name data)))] + (make-p-i start (pos) name data)))] [(#\/) (read-char in) (let ([name (lex-name in pos)]) (skip-space in) diff --git a/collects/xml/private/sig.ss b/collects/xml/private/sig.ss index 17498e8355..c37b259527 100644 --- a/collects/xml/private/sig.ss +++ b/collects/xml/private/sig.ss @@ -33,7 +33,7 @@ (struct external-dtd/system ()) ; XXX needs parent (struct element (name attributes content)) ; XXX needs parent (struct attribute (name value)) ; XXX needs parent - (struct pi (target-name instruction)) ; XXX needs parent + (struct p-i (target-name instruction)) ; XXX needs parent (struct entity (text)) ; XXX needs parent (contracted [content? (any/c . -> . boolean?)]))) diff --git a/collects/xml/private/structures.ss b/collects/xml/private/structures.ss index c939b0cf68..949f5c8534 100644 --- a/collects/xml/private/structures.ss +++ b/collects/xml/private/structures.ss @@ -54,9 +54,9 @@ ; Entity = (make-entity Location Location (U Nat Symbol)) (define-struct (entity source) (text)) - ; Processing-instruction = (make-pi Location Location String String) + ; Processing-instruction = (make-p-i Location Location String String) ; also represents XMLDecl - (define-struct (pi source) (target-name instruction)) + (define-struct (p-i source) (target-name instruction)) ; Comment = (make-comment String) (define-struct comment (text)) @@ -68,4 +68,4 @@ (entity? x) (comment? x) (cdata? x) - (pi? x)))) + (p-i? x)))) diff --git a/collects/xml/private/syntax.ss b/collects/xml/private/syntax.ss index 6b03e9e91f..8e553b6c3e 100644 --- a/collects/xml/private/syntax.ss +++ b/collects/xml/private/syntax.ss @@ -66,9 +66,9 @@ ; There is no syntax object representation for comments (define (make-comment x) #f) - ; make-pi : src src sym str -> pi - ; There's not really a syntax object representation for pi's either - (define (make-pi from to name val) #f) + ; make-p-i : src src sym str -> p-i + ; There's not really a syntax object representation for p-i's either + (define (make-p-i from to name val) #f) ; make-attribute : src src sym str -> attribute (define (make-attribute from to name val) @@ -126,11 +126,11 @@ (define (external-dtd/public-public x) (error 'external-dtd/public-public "expected an external dtd, given ~e" x)) - (define (pi-instruction x) - (error 'pi-instruction "expected a pi, given ~e" x)) + (define (p-i-instruction x) + (error 'p-i-instruction "expected a p-i, given ~e" x)) - (define (pi-target-name x) - (error 'pi-target-name "expected a pi, given ~e" x)) + (define (p-i-target-name x) + (error 'p-i-target-name "expected a p-i, given ~e" x)) (define (prolog-dtd x) (error 'prolog-dtd "expected a prolog, given ~e" x)) @@ -181,7 +181,7 @@ (define (external-dtd? x) #f) (define (prolog? x) #f) - (define (pi? x) #f) + (define (p-i? x) #f) ; : tst -> bool (define (pcdata? x) @@ -203,7 +203,7 @@ (struct! external-dtd/system ()) (struct! element (name attributes content)) (struct! attribute (name value)) - (struct! pi (target-name instruction)) + (struct! p-i (target-name instruction)) ;(struct! source (start stop)) (struct! pcdata (string)) (struct! cdata (string)) diff --git a/collects/xml/private/writer.ss b/collects/xml/private/writer.ss index f9e364f7c7..94a9ffd9d0 100644 --- a/collects/xml/private/writer.ss +++ b/collects/xml/private/writer.ss @@ -72,7 +72,7 @@ (for-each (lambda (x) ((cond [(comment? x) write-xml-comment] - [(pi? x) write-xml-pi]) x 0 void out) + [(p-i? x) write-xml-p-i]) x 0 void out) (newline out)) misc)) @@ -84,7 +84,7 @@ [(cdata? el) write-xml-cdata] [(entity? el) write-xml-entity] [(comment? el) write-xml-comment] - [(pi? el) write-xml-pi] + [(p-i? el) write-xml-p-i] [else (error 'write-xml-content "received ~e" el)]) el over dent out)) @@ -136,9 +136,9 @@ ;; XXX: Different kind of quote is needed, for assume the user includes the with proper quoting (write-xml-base (format "~a" (cdata-string cdata)) over dent out)) - ;; write-xml-pi : Processing-instruction Nat (Nat Output-Stream -> Void) Output-Stream -> Void - (define (write-xml-pi pi over dent out) - (write-xml-base (format "" (pi-target-name pi) (pi-instruction pi)) over dent out)) + ;; write-xml-p-i : Processing-instruction Nat (Nat Output-Stream -> Void) Output-Stream -> Void + (define (write-xml-p-i p-i over dent out) + (write-xml-base (format "" (p-i-target-name p-i) (p-i-instruction p-i)) over dent out)) ;; write-xml-comment : Comment Nat (Nat Output-Stream -> Void) Output-Stream -> Void (define (write-xml-comment comment over dent out) diff --git a/collects/xml/private/xexpr.ss b/collects/xml/private/xexpr.ss index c2c6954365..4efba40596 100644 --- a/collects/xml/private/xexpr.ss +++ b/collects/xml/private/xexpr.ss @@ -63,7 +63,7 @@ ((symbol? x) (true)) ((exact-nonnegative-integer? x) (true)) ((comment? x) (true)) - ((pi? x) (true)) + ((p-i? x) (true)) ((cdata? x) (true)) ((pcdata? x) (true)) ((list? x) @@ -177,7 +177,7 @@ (cons (element-name x) (combine atts body)))] [(pcdata? x) (pcdata-string x)] [(entity? x) (entity-text x)] - [(or (comment? x) (pi? x) (cdata? x)) x] + [(or (comment? x) (p-i? x) (cdata? x)) x] [(document? x) (error 'xml->xexpr "Expected content, given ~e\nUse document-element to extract the content." x)] [(permissive?) x] [else (error 'xml->xexpr "Expected content, given ~e" x)])))) @@ -213,7 +213,7 @@ [(string? x) (make-pcdata 'scheme 'scheme x)] [(or (symbol? x) (exact-nonnegative-integer? x)) (make-entity 'scheme 'scheme x)] - [(or (comment? x) (pi? x) (cdata? x) (pcdata? x)) x] + [(or (comment? x) (p-i? x) (cdata? x) (pcdata? x)) x] [else ;(error 'xexpr->xml "malformed xexpr ~e" x) x]))