diff --git a/basis/farkup/farkup.factor b/basis/farkup/farkup.factor
index 66450cb813..93213630b7 100644
--- a/basis/farkup/farkup.factor
+++ b/basis/farkup/farkup.factor
@@ -218,7 +218,7 @@ CONSTANT: invalid-url "javascript:alert('Invalid URL in farkup');"
: render-code ( string mode -- xml )
[ string-lines ] dip htmlize-lines
- [XML
<->
XML] ;
+ XML-CHUNK[[ <->
]] ;
GENERIC: (write-farkup) ( farkup -- xml )
@@ -243,15 +243,15 @@ M: table (write-farkup) "table" farkup-inside ;
: write-link ( href text -- xml )
[ check-url link-no-follow? get "nofollow" and ] dip
- [XML rel=<->><-> XML] ;
+ XML-CHUNK[[ rel=<->><-> ]] ;
: write-image-link ( href text -- xml )
disable-images? get [
2drop
- [XML Images are not allowed XML]
+ XML-CHUNK[[ Images are not allowed ]]
] [
[ check-url ] [ f like ] bi*
- [XML
alt=<->/> XML]
+ XML-CHUNK[[
alt=<->/> ]]
] if ;
: open-link ( link -- href text )
@@ -267,15 +267,15 @@ M: code (write-farkup)
[ string>> ] [ mode>> ] bi render-code ;
M: line (write-farkup)
- drop [XML
XML] ;
+ drop XML-CHUNK[[
]] ;
M: line-break (write-farkup)
- drop [XML
XML] ;
+ drop XML-CHUNK[[
]] ;
M: table-row (write-farkup)
child>>
- [ (write-farkup) [XML <-> | XML] ] map
- [XML <->
XML] ;
+ [ (write-farkup) XML-CHUNK[[ <-> | ]] ] map
+ XML-CHUNK[[ <->
]] ;
M: string (write-farkup) ;
diff --git a/basis/furnace/chloe-tags/chloe-tags.factor b/basis/furnace/chloe-tags/chloe-tags.factor
index fc7f826bc4..09dedd0edb 100644
--- a/basis/furnace/chloe-tags/chloe-tags.factor
+++ b/basis/furnace/chloe-tags/chloe-tags.factor
@@ -74,12 +74,12 @@ CHLOE: a
[
[ a-attrs ]
[ compile-children>xml-string ] bi
- [ [XML <-> XML] second swap >>attrs ]
+ [ XML-CHUNK[[ <-> ]] second swap >>attrs ]
[xml-code]
] compile-with-scope ;
CHLOE: base
- compile-a-url [ [XML /> XML] ] [xml-code] ;
+ compile-a-url [ XML-CHUNK[[ /> ]] ] [xml-code] ;
: hidden-nested-fields ( -- xml )
nested-forms get " " join f like nested-forms-key
@@ -93,7 +93,7 @@ CHLOE: base
_ render-hidden
hidden-nested-fields
form-modifications
- [XML <-><-><->
XML]
+ XML-CHUNK[[ <-><-><->
]]
] [code] ;
: (compile-form-attrs) ( method action -- )
@@ -122,18 +122,18 @@ CHLOE: form
[ hidden-fields ]
[ compile-children>xml-string ] tri
[
- [XML XML] second
+ XML-CHUNK[[ ]] second
swap >>attrs
write-xml
] [code]
] compile-with-scope ;
: button-tag-markup ( -- xml )
-
- XML> body>> clone ;
+ ]] body>> clone ;
: add-tag-attrs ( attrs tag -- )
attrs>> swap assoc-union! drop ;
diff --git a/basis/furnace/recaptcha/recaptcha.factor b/basis/furnace/recaptcha/recaptcha.factor
index fff1f61610..b4971a7d95 100644
--- a/basis/furnace/recaptcha/recaptcha.factor
+++ b/basis/furnace/recaptcha/recaptcha.factor
@@ -23,7 +23,7 @@ M: recaptcha call-responder*
: (render-recaptcha) ( url -- xml )
dup
- [XML
+ XML-CHUNK[[
@@ -36,7 +36,7 @@ M: recaptcha call-responder*
- XML] ;
+ ]] ;
: recaptcha-url ( secure? -- ? )
"https" "http" ? "://www.google.com/recaptcha/api/challenge" append
diff --git a/basis/furnace/utilities/utilities.factor b/basis/furnace/utilities/utilities.factor
index 7bf2e35ef6..b7d5832450 100644
--- a/basis/furnace/utilities/utilities.factor
+++ b/basis/furnace/utilities/utilities.factor
@@ -86,7 +86,7 @@ M: object modify-form drop f ;
: hidden-form-field ( value name -- xml )
over [
- [XML name=<->/> XML]
+ XML-CHUNK[[ name=<->/> ]]
] [ drop ] if ;
CONSTANT: nested-forms-key "__n"
diff --git a/basis/help/html/html.factor b/basis/help/html/html.factor
index 717542600b..adf5fd85e1 100644
--- a/basis/help/html/html.factor
+++ b/basis/help/html/html.factor
@@ -69,11 +69,11 @@ M: pathname url-of
: help-stylesheet ( stylesheet -- xml )
"vocab:help/html/stylesheet.css" ascii file-contents
- swap "\n" glue [XML XML] ;
+ swap "\n" glue XML-CHUNK[[ ]] ;
: help-navbar ( -- xml )
"conventions" >link topic>filename
- [XML
+ XML-CHUNK[[
- XML] ;
+ ]] ;
: bijective-base26 ( n -- name )
[ dup 0 > ] [ 1 - 26 /mod char: a + ] "" produce-as nip reverse! ;
diff --git a/basis/html/components/components-tests.factor b/basis/html/components/components-tests.factor
index d8e81b78a7..7860f0718d 100644
--- a/basis/html/components/components-tests.factor
+++ b/basis/html/components/components-tests.factor
@@ -199,7 +199,7 @@ M: link-test link-href drop "http://www.apple.com/foo&bar" ;
! Test xml in html components
{ } [
- [XML XML] "xmltest" set-value
+ XML-CHUNK[[ ]] "xmltest" set-value
] unit-test
{ "" } [
diff --git a/basis/html/components/components.factor b/basis/html/components/components.factor
index 46872111d0..07ff220a7d 100644
--- a/basis/html/components/components.factor
+++ b/basis/html/components/components.factor
@@ -46,10 +46,10 @@ M: label render*
SINGLETON: hidden
M: hidden render*
- drop [XML name=<-> type="hidden"/> XML] ;
+ drop XML-CHUNK[[ name=<-> type="hidden"/> ]] ;
: render-field ( value name size type -- xml )
- [XML name=<-> size=<-> type=<->/> XML] ;
+ XML-CHUNK[[ name=<-> size=<-> type=<->/> ]] ;
TUPLE: field size ;
@@ -77,12 +77,12 @@ TUPLE: textarea rows cols ;
M:: textarea render* ( value name area -- xml )
area rows>> :> rows
area cols>> :> cols
- [XML
+ XML-CHUNK[[
- XML] ;
+ ]] ;
! Choice
TUPLE: choice size multiple choices ;
@@ -92,7 +92,7 @@ TUPLE: choice size multiple choices ;
: render-option ( text selected? -- xml )
"selected" and swap
- [XML XML] ;
+ XML-CHUNK[[ ]] ;
: render-options ( value choice -- xml )
[ choices>> value ] [ multiple>> ] bi
@@ -103,10 +103,10 @@ M:: choice render* ( value name choice -- xml )
choice size>> :> size
choice multiple>> "true" and :> multiple
value choice render-options :> contents
- [XML XML] ;
+ multiple=<-multiple->><-contents-> ]] ;
! Checkboxes
TUPLE: checkbox label ;
@@ -116,9 +116,9 @@ TUPLE: checkbox label ;
M: checkbox render*
[ "true" and ] [ ] [ label>> ] tri*
- [XML name=<->><-> XML] ;
+ checked=<-> name=<->><-> ]] ;
! Link components
GENERIC: link-title ( obj -- string )
@@ -142,7 +142,7 @@ TUPLE: link target ;
M: link render*
nip swap
[ target>> ] [ [ link-href ] [ link-title ] bi ] bi*
- [XML href=<->><-> XML] ;
+ XML-CHUNK[[ href=<->><-> ]] ;
! XMode code component
TUPLE: code mode ;
diff --git a/basis/html/forms/forms.factor b/basis/html/forms/forms.factor
index c6e32d5b15..3b048144c4 100644
--- a/basis/html/forms/forms.factor
+++ b/basis/html/forms/forms.factor
@@ -109,6 +109,6 @@ C: validation-error-state
: render-validation-errors ( -- )
form get errors>>
[
- [ [XML <-> XML] ] map
- [XML XML] write-xml
+ [ XML-CHUNK[[ <-> ]] ] map
+ XML-CHUNK[[ ]] write-xml
] unless-empty ;
diff --git a/basis/html/html.factor b/basis/html/html.factor
index 1ad6627307..7016e3b8d9 100644
--- a/basis/html/html.factor
+++ b/basis/html/html.factor
@@ -10,7 +10,7 @@ M: empty-prolog write-xml drop ;
: ( -- prolog ) \ empty-prolog new ;
: simple-page ( title head body -- xml )
-
@@ -19,13 +19,13 @@ M: empty-prolog write-xml drop ;
<->
- XML> >>prolog ;
+ ]] >>prolog ;
: render-error ( message -- xml )
- [XML <-> XML] ;
+ XML-CHUNK[[ <-> ]] ;
: simple-link ( xml url -- xml' )
- url-encode swap [XML ><-> XML] ;
+ url-encode swap XML-CHUNK[[ ><-> ]] ;
: simple-image ( url -- xml )
- url-encode [XML
/> XML] ;
+ url-encode XML-CHUNK[[
/> ]] ;
diff --git a/basis/html/streams/streams.factor b/basis/html/streams/streams.factor
index 92a4b656d1..e0634ef807 100644
--- a/basis/html/streams/streams.factor
+++ b/basis/html/streams/streams.factor
@@ -72,7 +72,7 @@ MACRO: make-css ( pairs -- str )
: span-tag ( xml style -- xml )
span-css-style
- [ swap [XML ><-> XML] ] unless-empty ; inline
+ [ swap XML-CHUNK[[ ><-> ]] ] unless-empty ; inline
: emit-html ( stream quot -- )
dip data>> push ; inline
@@ -125,7 +125,7 @@ CONSTANT: pre-css "white-space: pre; font-family: monospace; "
: div-tag ( xml style -- xml' )
div-css-style
- [ swap [XML ><->
XML] ] unless-empty ;
+ [ swap XML-CHUNK[[ ><->
]] ] unless-empty ;
: format-html-div ( string style stream -- )
[ [ div-tag ] [ object-link-tag ] bi ] emit-html ;
@@ -159,7 +159,7 @@ M: html-writer stream-format
format-html-span ;
M: html-writer stream-nl
- [ [XML
XML] ] emit-html ;
+ [ XML-CHUNK[[
]] ] emit-html ;
M: html-writer make-span-stream
html-span-stream new-html-sub-stream ;
@@ -173,10 +173,10 @@ M: html-writer make-cell-stream
M: html-writer stream-write-table
[
table-style swap [
- [ data>> [XML ><-> | XML] ] with map
- [XML <->
XML]
+ [ data>> XML-CHUNK[[ ><-> | ]] ] with map
+ XML-CHUNK[[ <->
]]
] with map
- [XML XML]
+ XML-CHUNK[[ ]]
] emit-html ;
M: html-writer dispose drop ;
diff --git a/basis/html/templates/chloe/chloe-docs.factor b/basis/html/templates/chloe/chloe-docs.factor
index 0d21163b25..dbec08e1d1 100644
--- a/basis/html/templates/chloe/chloe-docs.factor
+++ b/basis/html/templates/chloe/chloe-docs.factor
@@ -274,7 +274,7 @@ ARTICLE: "html.templates.chloe.extend.components.example" "An example of a custo
"As an example, let's develop a custom Chloe component which renders an image stored in a form value. Since the component does not require any configuration, we can define a singleton class:"
{ $code "SINGLETON: image" }
"Now we define a method on the " { $link render* } " generic word which renders the image using " { $link { "xml.syntax" "literals" } } ":"
-{ $code "M: image render* 2drop [XML
/> XML] ;" }
+{ $code "M: image render* 2drop XML-CHUNK[[
/> ]] ;" }
"Finally, we can define a Chloe component:"
{ $code "COMPONENT: image" }
"We can use it as follows, assuming the current form has a value named " { $snippet "image" } ":"
diff --git a/basis/html/templates/chloe/chloe.factor b/basis/html/templates/chloe/chloe.factor
index 0cd639d805..5d07c11a78 100644
--- a/basis/html/templates/chloe/chloe.factor
+++ b/basis/html/templates/chloe/chloe.factor
@@ -19,7 +19,7 @@ CHLOE: write-title
drop
"head" tag-stack get member?
"title" tag-stack get member? not and
- [ get-title [XML <-> XML] ]
+ [ get-title XML-CHUNK[[ <-> ]] ]
[ get-title ] ?
[xml-code] ;
@@ -33,7 +33,7 @@ CHLOE: style
CHLOE: write-style
drop [
get-style
- [XML XML]
+ XML-CHUNK[[ ]]
] [xml-code] ;
CHLOE: even
diff --git a/basis/html/templates/templates.factor b/basis/html/templates/templates.factor
index 4187205495..005e367395 100644
--- a/basis/html/templates/templates.factor
+++ b/basis/html/templates/templates.factor
@@ -66,13 +66,13 @@ SYMBOL: atom-feeds
: get-atom-feeds ( -- xml )
atom-feeds get [
- [XML
+ XML-CHUNK[[
href=<->/>
- XML]
+ ]]
] { } assoc>map ;
: write-atom-feeds ( -- )
diff --git a/basis/http/server/responses/responses.factor b/basis/http/server/responses/responses.factor
index 5aa59c81f5..10a4fb3db2 100644
--- a/basis/http/server/responses/responses.factor
+++ b/basis/http/server/responses/responses.factor
@@ -19,14 +19,14 @@ IN: http.server.responses
"text/html" ;
: trivial-response-body ( code message -- )
-
<-> <->
- XML> write-xml ;
+ ]] write-xml ;
: ( code message -- response )
2dup [ trivial-response-body ] with-string-writer
diff --git a/basis/http/server/static/static.factor b/basis/http/server/static/static.factor
index ba794f047c..efd2df1b73 100644
--- a/basis/http/server/static/static.factor
+++ b/basis/http/server/static/static.factor
@@ -59,13 +59,13 @@ TUPLE: file-responder root hook special index-names allow-listings ;
\ serve-file NOTICE add-input-logging
:: file-html-template ( href size modified -- xml )
- [XML
+ XML-CHUNK[[
><-href-> |
<-modified-> |
<-size-> |
- XML] ;
+ ]] ;
: file>html ( name infos -- xml )
[
@@ -84,7 +84,7 @@ TUPLE: file-responder root hook special index-names allow-listings ;
url get [ path>> "Index of " prepend ] [ "" ] if* ;
:: listing-html-template ( title listing ?parent CO-N CO-M CO-S -- xml )
- [XML <-title->
+ XML-CHUNK[[ <-title->
>Name |
@@ -96,7 +96,7 @@ TUPLE: file-responder root hook special index-names allow-listings ;
<-listing->
|
- XML] ;
+ ]] ;
: sort-column ( -- column ) params get "C" of "N" or ;
diff --git a/basis/lcs/diff2html/diff2html.factor b/basis/lcs/diff2html/diff2html.factor
index 07c8d5269d..ef7f15d80e 100644
--- a/basis/lcs/diff2html/diff2html.factor
+++ b/basis/lcs/diff2html/diff2html.factor
@@ -11,30 +11,30 @@ GENERIC: diff-line ( obj -- xml )
M: retain diff-line
item-string
- [XML <-> | XML]
- dup [XML <-><->
XML] ;
+ XML-CHUNK[[ <-> | ]]
+ dup XML-CHUNK[[ <-><->
]] ;
M: insert diff-line
- item-string [XML
+ item-string XML-CHUNK[[
|
<-> |
- XML] ;
+ ]] ;
M: delete diff-line
- item-string [XML
+ item-string XML-CHUNK[[
<-> |
|
- XML] ;
+ ]] ;
: htmlize-diff ( diff -- xml )
[ diff-line ] map
- [XML
+ XML-CHUNK[[
- XML] ;
+ ]] ;
diff --git a/basis/syndication/syndication.factor b/basis/syndication/syndication.factor
index 0961e50675..8b2c5d1307 100644
--- a/basis/syndication/syndication.factor
+++ b/basis/syndication/syndication.factor
@@ -119,23 +119,23 @@ M: byte-array parse-feed [ bytes>xml xml>feed ] with-html-entities ;
[ date>> timestamp>rfc3339 ]
[ description>> ]
} cleave
- [XML
+ XML-CHUNK[[
<->
/>
<->
<->
- XML] ;
+ ]] ;
: feed>xml ( feed -- xml )
[ title>> ]
[ url>> present ]
[ entries>> [ entry>xml ] map ] tri
-
<->
/>
<->
- XML> ;
+ ]] ;
diff --git a/basis/tools/deploy/test/20/20.factor b/basis/tools/deploy/test/20/20.factor
index 7e9a0631b7..3d0b39e21c 100644
--- a/basis/tools/deploy/test/20/20.factor
+++ b/basis/tools/deploy/test/20/20.factor
@@ -2,7 +2,7 @@ USING: io xml.syntax xml.writer ;
IN: tools.deploy.test.20
: test-xml ( str -- str' )
- <-> XML> xml>string ;
+ XML-DOC[[ <-> ]] xml>string ;
: main ( -- )
"Factor" test-xml print ;
diff --git a/basis/xml-rpc/xml-rpc.factor b/basis/xml-rpc/xml-rpc.factor
index 36bc349e11..9f1b4440a8 100644
--- a/basis/xml-rpc/xml-rpc.factor
+++ b/basis/xml-rpc/xml-rpc.factor
@@ -16,34 +16,34 @@ GENERIC: item>xml ( object -- xml )
M: integer item>xml
dup 31 2^ neg 31 2^ 1 - between?
[ "Integers must fit in 32 bits" throw ] unless
- [XML <-> XML] ;
+ XML-CHUNK[[ <-> ]] ;
M: boolean item>xml
- "1" "0" ? [XML <-> XML] ;
+ "1" "0" ? XML-CHUNK[[ <-> ]] ;
M: float item>xml
- number>string [XML <-> XML] ;
+ number>string XML-CHUNK[[ <-> ]] ;
M: string item>xml
- [XML <-> XML] ;
+ XML-CHUNK[[ <-> ]] ;
: struct-member ( name value -- tag )
over string? [ "Struct member name must be string" throw ] unless
item>xml
- [XML
+ XML-CHUNK[[
<->
<->
- XML] ;
+ ]] ;
M: hashtable item>xml
[ struct-member ] { } assoc>map
- [XML <-> XML] ;
+ XML-CHUNK[[ <-> ]] ;
M: array item>xml
- [ item>xml [XML <-> XML] ] map
- [XML <-> XML] ;
+ [ item>xml XML-CHUNK[[ <-> ]] ] map
+ XML-CHUNK[[ <-> ]] ;
TUPLE: base64 string ;
@@ -51,33 +51,33 @@ C: base64
M: base64 item>xml
string>> >base64
- [XML <-> XML] ;
+ XML-CHUNK[[ <-> ]] ;
: params ( seq -- xml )
- [ item>xml [XML <-> XML] ] map
- [XML <-> XML] ;
+ [ item>xml XML-CHUNK[[ <-> ]] ] map
+ XML-CHUNK[[ <-> ]] ;
: method-call ( name seq -- xml )
params
-
<->
<->
- XML> ;
+ ]] ;
: return-params ( seq -- xml )
- params <-> XML> ;
+ params XML-DOC[[ <-> ]] ;
: return-fault ( fault-code fault-string -- xml )
[ "faultString" ,, "faultCode" ,, ] H{ } make item>xml
-
<->
- XML> ;
+ ]] ;
TUPLE: rpc-method name params ;
diff --git a/basis/xml/syntax/syntax-docs.factor b/basis/xml/syntax/syntax-docs.factor
index 0621c1282d..41396de023 100644
--- a/basis/xml/syntax/syntax-docs.factor
+++ b/basis/xml/syntax/syntax-docs.factor
@@ -35,29 +35,29 @@ HELP: TAG:
ARTICLE: { "xml.syntax" "literals" } "XML literals"
"The following words provide syntax for XML literals:"
{ $subsections
- postpone: ... XML>" }
+HELP: XML-DOC[[
+{ $syntax "XML-DOC[[ ... ]]" }
{ $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.syntax" "interpolation" } } "." } ;
-HELP: [XML
-{ $syntax "[XML foo ... bar ... baz XML]" }
+HELP: XML-CHUNK[[
+{ $syntax "XML-CHUNK[[ foo ... bar ... baz ]]" }
{ $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.syntax" "interpolation" } } "." } ;
ARTICLE: { "xml.syntax" "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."
+"XML interpolation has two forms for each of the words " { $link postpone: XML-DOC[[ } " and " { $link postpone: XML-CHUNK[[ } ": a fry-like form and a locals form. To splice locals in, use the syntax " { $snippet "<-variable->" } ". 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:"
+"These forms can be used where a tag might go, as in " { $snippet "XML-CHUNK[[ <-> ]]" } " or where an attribute might go, as in " { $snippet "XML-CHUNK[[ /> ]]" } ". 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 xml.writer xml.syntax ;
\"one two three\" \" \" split
-[ [XML - <->
XML] ] map
-<-> XML> pprint-xml"
+[ XML-CHUNK[[ - <->
]] ] map
+XML-DOC[[ <-> ]] pprint-xml"
"
@@ -80,14 +80,14 @@ let[
URL\" http://factorcode.org/\" :> url
\"hello\" :> string
\\ drop :> word
-
false=<-false->
url=<-url->
string=<-string->
word=<-word-> />
- XML> pprint-xml
+ ]] pprint-xml
]"
"
@@ -96,12 +96,12 @@ let[
{ $example "USING: xml.syntax inverse ;
: dispatch ( xml -- string )
{
- { [ [XML <-> XML] ] [ \"a\" prepend ] }
- { [ [XML <-> XML] ] [ \"b\" prepend ] }
- { [ [XML XML] ] [ \"yes\" ] }
- { [ [XML /> XML] ] [ \"no\" prepend ] }
+ { [ XML-CHUNK[[ <-> ]] ] [ \"a\" prepend ] }
+ { [ XML-CHUNK[[ <-> ]] ] [ \"b\" prepend ] }
+ { [ XML-CHUNK[[ ]] ] [ \"yes\" ] }
+ { [ XML-CHUNK[[ /> ]] ] [ \"no\" prepend ] }
} switch ;
-[XML pple XML] dispatch write"
+XML-CHUNK[[ pple ]] dispatch write"
"apple" } ;
HELP: XML-NS:
diff --git a/basis/xml/syntax/syntax-tests.factor b/basis/xml/syntax/syntax-tests.factor
index ae6ea5a182..095812c739 100644
--- a/basis/xml/syntax/syntax-tests.factor
+++ b/basis/xml/syntax/syntax-tests.factor
@@ -55,10 +55,10 @@ XML-NS: foo http://blah.com
y
" } [
- let[ "one" :> a "two" :> c "y" :> x [XML <-x-> XML] :> d
- a "two" :> c "y" :> x XML-CHUNK[[ <-x-> ]] :> d
+ XML-DOC[[
<-a-> /> <-d->
- XML> pprint-xml>string
+ ]] pprint-xml>string
]
] unit-test
@@ -75,69 +75,69 @@ XML-NS: foo http://blah.com
" } [
"one two three" " " split
- [ [XML - <->
XML] ] map
- <-> XML> pprint-xml>string
+ [ XML-CHUNK[[ - <->
]] ] map
+ XML-DOC[[ <-> ]] pprint-xml>string
] unit-test
{ "
" }
[ 3 f "http://factorcode.org/" "hello" \ drop
- false=<-> url=<-> string=<-> word=<->/> XML>
+ XML-DOC[[ false=<-> url=<-> string=<-> word=<->/> ]]
pprint-xml>string ] unit-test
-{ "3" } [ 3 [XML <-> XML] xml>string ] unit-test
-{ "" } [ f [XML <-> XML] xml>string ] unit-test
+{ "3" } [ 3 XML-CHUNK[[ <-> ]] xml>string ] unit-test
+{ "" } [ f XML-CHUNK[[ <-> ]] xml>string ] unit-test
-[ [XML <-> XML] ] must-infer
-[ [XML <-> /> XML] ] must-infer
+[ XML-CHUNK[[ <-> ]] ] must-infer
+[ XML-CHUNK[[ <-> /> ]] ] must-infer
-{ xml-chunk } [ [ [XML XML] ] first class-of ] unit-test
-{ xml } [ [ XML> ] first class-of ] unit-test
-{ xml-chunk } [ [ [XML /> XML] ] third class-of ] unit-test
-{ xml } [ [ /> XML> ] third class-of ] unit-test
-{ 1 } [ [ [XML XML] ] length ] unit-test
-{ 1 } [ [ XML> ] length ] unit-test
+{ xml-chunk } [ [ XML-CHUNK[[ ]] ] first class-of ] unit-test
+{ xml } [ [ XML-DOC[[ ]] ] first class-of ] unit-test
+{ xml-chunk } [ [ XML-CHUNK[[ /> ]] ] third class-of ] unit-test
+{ xml } [ [ XML-DOC[[ /> ]] ] third class-of ] unit-test
+{ 1 } [ [ XML-CHUNK[[ ]] ] length ] unit-test
+{ 1 } [ [ XML-DOC[[ ]] ] length ] unit-test
-{ "" } [ [XML XML] concat ] unit-test
+{ "" } [ XML-CHUNK[[ ]] concat ] unit-test
-{ "foo" } [ [XML foo XML] [ [XML <-> XML] ] undo ] unit-test
-{ "foo" } [ [XML XML] [ [XML /> XML] ] undo ] unit-test
-{ "foo" "baz" } [ [XML baz XML] [ [XML ><-> XML] ] undo ] unit-test
+{ "foo" } [ XML-CHUNK[[ foo ]] [ XML-CHUNK[[ <-> ]] ] undo ] unit-test
+{ "foo" } [ XML-CHUNK[[ ]] [ XML-CHUNK[[ /> ]] ] undo ] unit-test
+{ "foo" "baz" } [ XML-CHUNK[[ baz ]] [ XML-CHUNK[[ ><-> ]] ] undo ] unit-test
: dispatch ( xml -- string )
{
- { [ [XML <-> XML] ] [ "a" prepend ] }
- { [ [XML <-> XML] ] [ "b" prepend ] }
- { [ [XML XML] ] [ "byes" ] }
- { [ [XML /> XML] ] [ "bno" prepend ] }
+ { [ XML-CHUNK[[ <-> ]] ] [ "a" prepend ] }
+ { [ XML-CHUNK[[ <-> ]] ] [ "b" prepend ] }
+ { [ XML-CHUNK[[ ]] ] [ "byes" ] }
+ { [ XML-CHUNK[[ /> ]] ] [ "bno" prepend ] }
} switch ;
-{ "apple" } [ [XML pple XML] dispatch ] unit-test
-{ "banana" } [ [XML anana XML] dispatch ] unit-test
-{ "byes" } [ [XML XML] dispatch ] unit-test
-{ "bnowhere" } [ [XML XML] dispatch ] unit-test
-{ "baboon" } [ [XML aboon XML] dispatch ] unit-test
-{ "apple" } [ pple XML> dispatch ] unit-test
-{ "apple" } [ pple XML> body>> dispatch ] unit-test
+{ "apple" } [ XML-CHUNK[[ pple ]] dispatch ] unit-test
+{ "banana" } [ XML-CHUNK[[ anana ]] dispatch ] unit-test
+{ "byes" } [ XML-CHUNK[[ ]] dispatch ] unit-test
+{ "bnowhere" } [ XML-CHUNK[[ ]] dispatch ] unit-test
+{ "baboon" } [ XML-CHUNK[[ aboon ]] dispatch ] unit-test
+{ "apple" } [ XML-DOC[[ pple ]] dispatch ] unit-test
+{ "apple" } [ XML-DOC[[ pple ]] body>> dispatch ] unit-test
: dispatch-doc ( xml -- string )
{
- { [ <-> XML> ] [ "a" prepend ] }
- { [ <-> XML> ] [ "b" prepend ] }
- { [ XML> ] [ "byes" ] }
- { [ /> XML> ] [ "bno" prepend ] }
+ { [ XML-DOC[[ <-> ]] ] [ "a" prepend ] }
+ { [ XML-DOC[[ <-> ]] ] [ "b" prepend ] }
+ { [ XML-DOC[[ ]] ] [ "byes" ] }
+ { [ XML-DOC[[ /> ]] ] [ "bno" prepend ] }
} switch ;
-{ "apple" } [ pple XML> dispatch-doc ] unit-test
-{ "apple" } [ [XML pple XML] dispatch-doc ] unit-test
-{ "apple" } [ pple XML> body>> dispatch-doc ] unit-test
+{ "apple" } [ XML-DOC[[ pple ]] dispatch-doc ] unit-test
+{ "apple" } [ XML-CHUNK[[ pple ]] dispatch-doc ] unit-test
+{ "apple" } [ XML-DOC[[ pple ]] body>> dispatch-doc ] unit-test
! Make sure nested XML documents interpolate correctly
{
"it's blue!"
} [
- "it's blue!" <-> XML>
- <-> XML> xml>string
+ "it's blue!" XML-DOC[[ <-> ]]
+ XML-DOC[[ <-> ]] xml>string
] unit-test
{
@@ -147,5 +147,5 @@ XML-NS: foo http://blah.com
"asdf"
"asdf" f f
"asdf2"
- <-> XML> xml>string
+ XML-DOC[[ <-> ]] xml>string
] unit-test
diff --git a/basis/xml/syntax/syntax.factor b/basis/xml/syntax/syntax.factor
index da7b9417ba..5897fbffa7 100644
--- a/basis/xml/syntax/syntax.factor
+++ b/basis/xml/syntax/syntax.factor
@@ -170,11 +170,13 @@ MACRO: interpolate-xml ( xml -- quot )
PRIVATE>
-SYNTAX: " [ string>doc ] parse-def ;
+SYNTAX: \XML-DOC[[ "]]" [ string>doc ] parse-def ;
+SYNTAX: \XML-DOC[=[ "]=]" [ string>doc ] parse-def ;
+SYNTAX: \XML-DOC[==[ "]==]" [ string>doc ] parse-def ;
-SYNTAX: [XML
- "XML]" [ string>chunk ] parse-def ;
+SYNTAX: \XML-CHUNK[[ "]]" [ string>chunk ] parse-def ;
+SYNTAX: \XML-CHUNK[=[ "]=]" [ string>chunk ] parse-def ;
+SYNTAX: \XML-CHUNK[==[ "]==]" [ string>chunk ] parse-def ;
USE: vocabs.loader
diff --git a/basis/xml/tests/templating.factor b/basis/xml/tests/templating.factor
index fdef51b0c5..8a9b945d90 100644
--- a/basis/xml/tests/templating.factor
+++ b/basis/xml/tests/templating.factor
@@ -20,17 +20,14 @@ M: object (r-ref) drop ;
! Example
-CONSTANT: sample-doc [[
-
+CONSTANT: sample-doc [[
paragraph
-
-]]
+