From de49f6fc745e2cda3c2554828b1428d53b4db32b Mon Sep 17 00:00:00 2001 From: Daniel Ehrenberg Date: Fri, 30 Jan 2009 11:29:30 -0600 Subject: [PATCH] Moving xml.interpolate to xml.literals --- basis/farkup/farkup.factor | 2 +- basis/html/components/authors.txt | 1 + basis/html/components/components.factor | 4 ++-- basis/html/elements/elements.factor | 2 +- basis/lcs/diff2html/diff2html.factor | 2 +- basis/syndication/syndication.factor | 2 +- basis/xml-rpc/xml-rpc.factor | 4 ++-- .../xml/{interpolate => literals}/authors.txt | 0 .../literals-docs.factor} | 24 +++++++++---------- .../literals-tests.factor} | 6 ++--- .../literals.factor} | 2 +- .../xml/{interpolate => literals}/summary.txt | 0 basis/xml/{interpolate => literals}/tags.txt | 0 basis/xml/writer/writer-docs.factor | 4 ++-- basis/xmode/code2html/code2html.factor | 2 +- 15 files changed, 28 insertions(+), 27 deletions(-) rename basis/xml/{interpolate => literals}/authors.txt (100%) rename basis/xml/{interpolate/interpolate-docs.factor => literals/literals-docs.factor} (59%) rename basis/xml/{interpolate/interpolate-tests.factor => literals/literals-tests.factor} (92%) rename basis/xml/{interpolate/interpolate.factor => literals/literals.factor} (99%) rename basis/xml/{interpolate => literals}/summary.txt (100%) rename basis/xml/{interpolate => literals}/tags.txt (100%) diff --git a/basis/farkup/farkup.factor b/basis/farkup/farkup.factor index b9e62717eb..5c446c6a22 100644 --- a/basis/farkup/farkup.factor +++ b/basis/farkup/farkup.factor @@ -2,7 +2,7 @@ ! See http://factorcode.org/license.txt for BSD license. USING: accessors arrays combinators html.elements io io.streams.string kernel math namespaces peg peg.ebnf -sequences sequences.deep strings xml.entities xml.interpolate +sequences sequences.deep strings xml.entities xml.literals vectors splitting xmode.code2html urls.encoding xml.data xml.writer ; IN: farkup diff --git a/basis/html/components/authors.txt b/basis/html/components/authors.txt index 1901f27a24..a44f8d7f8d 100644 --- a/basis/html/components/authors.txt +++ b/basis/html/components/authors.txt @@ -1 +1,2 @@ Slava Pestov +Daniel Ehrenberg diff --git a/basis/html/components/components.factor b/basis/html/components/components.factor index 462c9b3c78..eec7508c5e 100644 --- a/basis/html/components/components.factor +++ b/basis/html/components/components.factor @@ -1,10 +1,10 @@ -! Copyright (C) 2008 Slava Pestov +! Copyright (C) 2008, 2009 Slava Pestov, Daniel Ehrenberg ! See http://factorcode.org/license.txt for BSD license. USING: accessors kernel namespaces io math.parser assocs classes classes.tuple words arrays sequences splitting mirrors hashtables combinators continuations math strings inspector fry locals calendar calendar.format xml.entities xml.data -validators urls present xml.writer xml.interpolate xml +validators urls present xml.writer xml.literals xml xmode.code2html lcs.diff2html farkup io.streams.string html.elements html.streams html.forms ; IN: html.components diff --git a/basis/html/elements/elements.factor b/basis/html/elements/elements.factor index a6e1928f83..005d67f221 100644 --- a/basis/html/elements/elements.factor +++ b/basis/html/elements/elements.factor @@ -2,7 +2,7 @@ ! See http://factorcode.org/license.txt for BSD license. USING: io io.styles kernel namespaces prettyprint quotations sequences strings words xml.entities compiler.units effects -xml.data xml.interpolate urls math math.parser combinators +xml.data xml.literals urls math math.parser combinators present fry io.streams.string xml.writer ; IN: html.elements diff --git a/basis/lcs/diff2html/diff2html.factor b/basis/lcs/diff2html/diff2html.factor index ee303cc5a5..16e6cc8d97 100644 --- a/basis/lcs/diff2html/diff2html.factor +++ b/basis/lcs/diff2html/diff2html.factor @@ -1,6 +1,6 @@ ! Copyright (C) 2008 Slava Pestov ! See http://factorcode.org/license.txt for BSD license. -USING: lcs xml.interpolate xml.writer kernel strings ; +USING: lcs xml.literals xml.writer kernel strings ; FROM: accessors => item>> ; FROM: io => write ; FROM: sequences => each if-empty when-empty map ; diff --git a/basis/syndication/syndication.factor b/basis/syndication/syndication.factor index b23910e200..13312d6cf2 100644 --- a/basis/syndication/syndication.factor +++ b/basis/syndication/syndication.factor @@ -4,7 +4,7 @@ USING: xml.utilities kernel assocs math.order strings sequences xml.data xml.writer io.streams.string combinators xml xml.entities.html io.files io - http.client namespaces make xml.interpolate hashtables + http.client namespaces make xml.literals hashtables calendar.format accessors continuations urls present ; IN: syndication diff --git a/basis/xml-rpc/xml-rpc.factor b/basis/xml-rpc/xml-rpc.factor index 52e175ca3a..d9028756f2 100644 --- a/basis/xml-rpc/xml-rpc.factor +++ b/basis/xml-rpc/xml-rpc.factor @@ -1,9 +1,9 @@ -! Copyright (C) 2005, 2006 Daniel Ehrenberg +! Copyright (C) 2005, 2009 Daniel Ehrenberg ! See http://factorcode.org/license.txt for BSD license. USING: accessors kernel xml arrays math generic http.client combinators hashtables namespaces io base64 sequences strings calendar xml.data xml.writer xml.utilities assocs math.parser -debugger calendar.format math.order xml.interpolate xml.dispatch ; +debugger calendar.format math.order xml.literals xml.dispatch ; IN: xml-rpc ! * Sending RPC requests diff --git a/basis/xml/interpolate/authors.txt b/basis/xml/literals/authors.txt similarity index 100% rename from basis/xml/interpolate/authors.txt rename to basis/xml/literals/authors.txt diff --git a/basis/xml/interpolate/interpolate-docs.factor b/basis/xml/literals/literals-docs.factor similarity index 59% rename from basis/xml/interpolate/interpolate-docs.factor rename to basis/xml/literals/literals-docs.factor index 23972ba7a4..a37fcbd711 100644 --- a/basis/xml/interpolate/interpolate-docs.factor +++ b/basis/xml/literals/literals-docs.factor @@ -1,29 +1,29 @@ -USING: help.markup help.syntax present multiline ; -IN: xml.interpolate +USING: help.markup help.syntax present multiline xml.data ; +IN: xml.literals -ABOUT: "xml.interpolate" +ABOUT: "xml.literals" -ARTICLE: "xml.interpolate" "XML literal interpolation" -"The " { $vocab-link "xml.interpolate" } " vocabulary provides a convenient syntax for generating XML documents and chunks. It defines the following parsing words:" +ARTICLE: "xml.literals" "XML literals" +"The " { $vocab-link "xml.literals" } " vocabulary provides a convenient syntax for generating XML documents and chunks. It defines the following parsing words:" { $subsection POSTPONE: ... XML>" } -{ $description "This syntax allows the interpolation of XML documents. When evaluated, there is an XML document on the stack. For more information about XML interpolation, see " { $link { "xml.interpolate" "in-depth" } } "." } ; +{ $description "This gives syntax for literal XML documents. When evaluated, there is an XML document (" { $link xml } ") on the stack. It can be used for interpolation as well, if interpolation slots are used. For more information about XML interpolation, see " { $link { "xml.literals" "interpolation" } } "." } ; HELP: [XML { $syntax "[XML foo ... bar ... baz XML]" } -{ $description "This syntax allows the interpolation of XML chunks. When evaluated, there is a sequence of XML elements (tags, strings, comments, etc) on the stack. For more information about XML interpolation, see " { $link { "xml.interpolate" "in-depth" } } "." } ; +{ $description "This gives syntax for literal XML documents. When evaluated, there is an XML chunk (" { $link xml-chunk } ") on the stack. For more information about XML interpolation, see " { $link { "xml.literals" "interpolation" } } "." } ; -ARTICLE: { "xml.interpolate" "in-depth" } "XML interpolation syntax" +ARTICLE: { "xml.literals" "interpolation" } "XML interpolation syntax" "XML interpolation has two forms for each of the words " { $link POSTPONE: " } ". To splice something in from the stack, in the style of " { $vocab-link "fry" } ", use the syntax " { $snippet "<->" } ". An XML interpolation form may only use one of these styles." $nl "These forms can be used where a tag might go, as in " { $snippet "[XML <-> XML]" } " or where an attribute might go, as in " { $snippet "[XML /> XML]" } ". When an attribute is spliced in, it is not included if the value is " { $snippet "f" } " and if the value is not a string, the value is put through " { $link present } ". Here is an example of the fry style of XML interpolation:" { $example -{" USING: splitting sequences xml.writer xml.interpolate ; +{" USING: splitting sequences xml.writer xml.literals ; "one two three" " " split [ [XML <-> XML] ] map <-> XML> pprint-xml"} @@ -41,7 +41,7 @@ $nl "} } "Here is an example of the locals version:" { $example -{" USING: locals urls xml.interpolate xml.writer ; +{" USING: locals urls xml.literals xml.writer ; [let | number [ 3 ] false [ f ] diff --git a/basis/xml/interpolate/interpolate-tests.factor b/basis/xml/literals/literals-tests.factor similarity index 92% rename from basis/xml/interpolate/interpolate-tests.factor rename to basis/xml/literals/literals-tests.factor index 9be85a11e2..59bd178f39 100644 --- a/basis/xml/interpolate/interpolate-tests.factor +++ b/basis/xml/literals/literals-tests.factor @@ -1,9 +1,9 @@ ! Copyright (C) 2009 Daniel Ehrenberg. ! See http://factorcode.org/license.txt for BSD license. -USING: tools.test xml.interpolate multiline kernel assocs -sequences accessors xml.writer xml.interpolate.private +USING: tools.test xml.literals multiline kernel assocs +sequences accessors xml.writer xml.literals.private locals splitting urls xml.data classes ; -IN: xml.interpolate.tests +IN: xml.literals.tests [ "a" "c" { "a" "c" f } ] [ "<-a->/><->" diff --git a/basis/xml/interpolate/interpolate.factor b/basis/xml/literals/literals.factor similarity index 99% rename from basis/xml/interpolate/interpolate.factor rename to basis/xml/literals/literals.factor index 0e551bddfa..f245c7a542 100644 --- a/basis/xml/interpolate/interpolate.factor +++ b/basis/xml/literals/literals.factor @@ -4,7 +4,7 @@ USING: xml xml.state kernel sequences fry assocs xml.data accessors strings make multiline parser namespaces macros sequences.deep generalizations words combinators math present arrays unicode.categories ; -IN: xml.interpolate +IN: xml.literals bar XML] "%%%%" indenter [ pprint-xml ] with-variable "} {" %%%%bar @@ -49,7 +49,7 @@ HELP: indenter HELP: sensitive-tags { $var-description "Contains a sequence of " { $link name } "s where whitespace should be considered significant for prettyprinting purposes. The sequence can contain " { $link string } "s in place of names. For example, to preserve whitespace inside a " { $snippet "pre" } " tag:" } -{ $example {" USING: xml.interpolate xml.writer namespaces ; +{ $example {" USING: xml.literals xml.writer namespaces ; [XML something
bing
 bang
    bong
XML] { "pre" } sensitive-tags [ pprint-xml ] with-variable "} {" diff --git a/basis/xmode/code2html/code2html.factor b/basis/xmode/code2html/code2html.factor index 962b0e9fbf..665d334fd2 100644 --- a/basis/xmode/code2html/code2html.factor +++ b/basis/xmode/code2html/code2html.factor @@ -1,6 +1,6 @@ USING: xmode.tokens xmode.marker xmode.catalog kernel locals html.elements io io.files sequences words io.encodings.utf8 -namespaces xml.entities accessors xml.interpolate locals xml.writer ; +namespaces xml.entities accessors xml.literals locals xml.writer ; IN: xmode.code2html : htmlize-tokens ( tokens -- xml )