From 4cba08aa8c64c47a1b2b3d18ff79f6e34b45ac3f Mon Sep 17 00:00:00 2001 From: Doug Coleman Date: Sat, 26 Aug 2017 17:17:24 -0500 Subject: [PATCH] xml: update syntax. XML-DOC[[ ]] and XML-CHUNK[[ ]] --- basis/farkup/farkup.factor | 16 ++-- basis/furnace/chloe-tags/chloe-tags.factor | 12 +-- basis/furnace/recaptcha/recaptcha.factor | 4 +- basis/furnace/utilities/utilities.factor | 2 +- basis/help/html/html.factor | 6 +- basis/html/components/components-tests.factor | 2 +- basis/html/components/components.factor | 20 ++--- basis/html/forms/forms.factor | 4 +- basis/html/html.factor | 10 +-- basis/html/streams/streams.factor | 12 +-- basis/html/templates/chloe/chloe-docs.factor | 2 +- basis/html/templates/chloe/chloe.factor | 4 +- basis/html/templates/templates.factor | 4 +- basis/http/server/responses/responses.factor | 4 +- basis/http/server/static/static.factor | 8 +- basis/lcs/diff2html/diff2html.factor | 16 ++-- basis/syndication/syndication.factor | 8 +- basis/tools/deploy/test/20/20.factor | 2 +- basis/xml-rpc/xml-rpc.factor | 34 ++++---- basis/xml/syntax/syntax-docs.factor | 34 ++++---- basis/xml/syntax/syntax-tests.factor | 82 +++++++++---------- basis/xml/syntax/syntax.factor | 10 ++- basis/xml/tests/templating.factor | 12 +-- basis/xml/writer/writer-docs.factor | 6 +- basis/xml/writer/writer-tests.factor | 4 +- basis/xmode/code2html/code2html.factor | 8 +- extra/codebook/codebook.factor | 62 +++++++------- extra/mason/report/report.factor | 26 +++--- extra/spider/report/report.factor | 22 ++--- extra/talks/tc-lisp-talk/tc-lisp-talk.factor | 4 +- .../mason/backend/watchdog/watchdog.factor | 6 +- .../webapps/mason/dashboard/dashboard.factor | 10 +-- extra/webapps/mason/grids/grids.factor | 12 +-- extra/webapps/mason/package/package.factor | 2 +- extra/webapps/mason/report/report.factor | 2 +- extra/webapps/mason/utils/utils.factor | 4 +- 36 files changed, 237 insertions(+), 239 deletions(-) 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->

    @@ -96,7 +96,7 @@ TUPLE: file-responder root hook special index-names allow-listings ; <-listing->
    >Name

    - 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[[ <->
    OldNew
    - 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

    - -]] +]] -CONSTANT: expected-result [[ - +CONSTANT: expected-result [[ @@ -42,8 +39,7 @@ CONSTANT: expected-result [[

    - -]] +]] : test-refs ( -- string ) [ diff --git a/basis/xml/writer/writer-docs.factor b/basis/xml/writer/writer-docs.factor index 4b32b60a47..a11aca07a7 100644 --- a/basis/xml/writer/writer-docs.factor +++ b/basis/xml/writer/writer-docs.factor @@ -48,7 +48,7 @@ HELP: pprint-xml HELP: indenter { $var-description "Contains the string which is used for indenting in the XML prettyprinter. For example, to print an XML document using " { $snippet "%%%%" } " for indentation, you can use the following:" } { $example "USING: xml.syntax xml.writer namespaces ; -[XML bar XML] \"%%%%\" indenter [ pprint-xml ] with-variable " " +XML-CHUNK[[ bar ]] \"%%%%\" indenter [ pprint-xml ] with-variable " " %%%%bar " } ; @@ -56,9 +56,9 @@ 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.syntax xml.writer namespaces ; -[XML something

    bing
    +XML-CHUNK[[     something
    bing
     bang
    -   bong
    XML] { \"pre\" } sensitive-tags [ pprint-xml ] with-variable" + bong
    ]] { \"pre\" } sensitive-tags [ pprint-xml ] with-variable" " diff --git a/basis/xml/writer/writer-tests.factor b/basis/xml/writer/writer-tests.factor index f4ebe2616a..9f9e2a3157 100644 --- a/basis/xml/writer/writer-tests.factor +++ b/basis/xml/writer/writer-tests.factor @@ -71,8 +71,8 @@ IN: xml.writer.tests { } [ { 1 2 3 4 } [ [ number>string ] [ sq number>string ] bi - [XML <-><-> XML] - ] map [XML

    Timings

    <->
    XML] + XML-CHUNK[[ <-><-> ]] + ] map XML-CHUNK[[

    Timings

    <->
    ]] pprint-xml ] unit-test diff --git a/basis/xmode/code2html/code2html.factor b/basis/xmode/code2html/code2html.factor index 6938f40beb..b10a3ce703 100644 --- a/basis/xmode/code2html/code2html.factor +++ b/basis/xmode/code2html/code2html.factor @@ -7,7 +7,7 @@ IN: xmode.code2html [ [ str>> ] [ id>> ] bi [ name>> swap - [XML ><-> XML] + XML-CHUNK[[ ><-> ]] ] when* ] map ; @@ -21,14 +21,14 @@ IN: xmode.code2html : default-stylesheet ( -- xml ) "resource:basis/xmode/code2html/stylesheet.css" utf8 file-contents - [XML XML] ; + XML-CHUNK[[ ]] ; :: htmlize-stream ( path stream -- xml ) stream stream-lines [ "" ] [ path over first find-mode htmlize-lines ] if-empty :> input default-stylesheet :> stylesheet - + XML-DOC[[ <-stylesheet-> <-path-> @@ -36,7 +36,7 @@ IN: xmode.code2html
    <-input->
    - XML> ; + ]] ; : htmlize-file ( path -- ) dup utf8 [ diff --git a/extra/codebook/codebook.factor b/extra/codebook/codebook.factor index 58ce25f365..26487d6d17 100644 --- a/extra/codebook/codebook.factor +++ b/extra/codebook/codebook.factor @@ -16,23 +16,23 @@ IN: codebook CONSTANT: codebook-style { - { COMMENT1 [ [XML <-> XML] ] } - { COMMENT2 [ [XML <-> XML] ] } - { COMMENT3 [ [XML <-> XML] ] } - { COMMENT4 [ [XML <-> XML] ] } - { DIGIT [ [XML <-> XML] ] } - { FUNCTION [ [XML <-> XML] ] } - { KEYWORD1 [ [XML <-> XML] ] } - { KEYWORD2 [ [XML <-> XML] ] } - { KEYWORD3 [ [XML <-> XML] ] } - { KEYWORD4 [ [XML <-> XML] ] } - { LABEL [ [XML <-> XML] ] } - { LITERAL1 [ [XML <-> XML] ] } - { LITERAL2 [ [XML <-> XML] ] } - { LITERAL3 [ [XML <-> XML] ] } - { LITERAL4 [ [XML <-> XML] ] } - { MARKUP [ [XML <-> XML] ] } - { OPERATOR [ [XML <-> XML] ] } + { COMMENT1 [ XML-CHUNK[[ <-> ]] ] } + { COMMENT2 [ XML-CHUNK[[ <-> ]] ] } + { COMMENT3 [ XML-CHUNK[[ <-> ]] ] } + { COMMENT4 [ XML-CHUNK[[ <-> ]] ] } + { DIGIT [ XML-CHUNK[[ <-> ]] ] } + { FUNCTION [ XML-CHUNK[[ <-> ]] ] } + { KEYWORD1 [ XML-CHUNK[[ <-> ]] ] } + { KEYWORD2 [ XML-CHUNK[[ <-> ]] ] } + { KEYWORD3 [ XML-CHUNK[[ <-> ]] ] } + { KEYWORD4 [ XML-CHUNK[[ <-> ]] ] } + { LABEL [ XML-CHUNK[[ <-> ]] ] } + { LITERAL1 [ XML-CHUNK[[ <-> ]] ] } + { LITERAL2 [ XML-CHUNK[[ <-> ]] ] } + { LITERAL3 [ XML-CHUNK[[ <-> ]] ] } + { LITERAL4 [ XML-CHUNK[[ <-> ]] ] } + { MARKUP [ XML-CHUNK[[ <-> ]] ] } + { OPERATOR [ XML-CHUNK[[ <-> ]] ] } [ drop ] } @@ -70,7 +70,7 @@ TUPLE: code-file : toc-list ( files -- list ) [ name>> ] map natural-sort [ [ file-html-name ] keep - [XML
  • ><->
  • XML] + XML-CHUNK[[
  • ><->
  • ]] ] map ; ! insert zero-width non-joiner between all characters so words can wrap anywhere @@ -82,7 +82,7 @@ TUPLE: code-file : htmlize-tokens ( tokens line# -- html-tokens ) swap [ [ str>> zwnj ] [ id>> ] bi codebook-style case - ] map [XML <-> <-> XML] + ] map XML-CHUNK[[ <-> <-> ]] "\n" 2array ; : line#>string ( i line#len -- i-string ) @@ -96,7 +96,7 @@ TUPLE: code-file file mode>> load-mode :> rules f lines |[ l i | l rules tokenize-line i 1 + line#len line#>string htmlize-tokens ] map-index concat nip :> html-lines - + XML-DOC[[ <-name-> @@ -106,7 +106,7 @@ TUPLE: code-file
    <-html-lines->
    - XML> ; + ]] ; :: code>toc-html ( dir name files -- html ) "Generating HTML table of contents" print flush @@ -116,7 +116,7 @@ TUPLE: code-file dir [ files toc-list :> toc - + XML-DOC[[ <-name-> @@ -130,7 +130,7 @@ TUPLE: code-file
      <-toc->
    - XML> + ]] ] with-directory ; :: code>ncx ( dir name files -- xml ) @@ -141,13 +141,13 @@ TUPLE: code-file name file-html-name :> filename i 2 + number>string :> istr - [XML playOrder=<-istr->> + XML-CHUNK[[ playOrder=<-istr->> <-name-> /> - XML] + ]] ] map-index :> file-nav-points - + XML-DOC[[ @@ -156,7 +156,7 @@ TUPLE: code-file <-file-nav-points-> - XML> ; + ]] ; :: code>opf ( dir name files -- xml ) "Generating OPF manifest" print flush @@ -164,12 +164,12 @@ TUPLE: code-file files [ name>> file-html-name dup - [XML href=<-> media-type="text/html" /> XML] + XML-CHUNK[[ href=<-> media-type="text/html" /> ]] ] map :> html-manifest - files [ name>> file-html-name [XML /> XML] ] map :> html-spine + files [ name>> file-html-name XML-CHUNK[[ /> ]] ] map :> html-spine - + XML-DOC[[ - XML> ; + ]] ; : write-dest-file ( xml name ext -- ) append utf8 [ write-xml ] with-file-writer ; diff --git a/extra/mason/report/report.factor b/extra/mason/report/report.factor index f4d9e51a1c..08ecda756d 100644 --- a/extra/mason/report/report.factor +++ b/extra/mason/report/report.factor @@ -8,7 +8,7 @@ IN: mason.report : git-link ( id -- link ) [ "http://github.com/factor/factor/commit/" "" prepend-as ] keep - [XML ><-> XML] ; + XML-CHUNK[[ ><-> ]] ; : common-report ( -- xml ) target-os get @@ -17,7 +17,7 @@ IN: mason.report disk-usage build-dir current-git-id get git-link - [XML + XML-CHUNK[[

    Build report for <->/<->

    @@ -25,14 +25,14 @@ IN: mason.report
    Build machine:<->
    Build directory:<->
    GIT ID:<->
    - XML] ; + ]] ; : with-report ( quot: ( -- xml ) -- ) [ "report" utf8 ] dip '[ common-report _ call( -- xml ) - [XML
    <-><->
    XML] + XML-CHUNK[[
    <-><->
    ]] write-xml ] with-file-writer ; inline @@ -44,13 +44,13 @@ IN: mason.report error [ error. ] with-string-writer :> error file utf8 400 file-tail :> output - [XML + XML-CHUNK[[

    <-what->

    Build output:
    <-output->
    Launcher error:
    <-error->
    - XML] + ]] ] with-report status-error ; @@ -73,30 +73,30 @@ IN: mason.report html-help-time-file } [ dup eval-file nanos>time - [XML <-><-> XML] - ] map [XML

    Timings

    <->
    XML] ; + XML-CHUNK[[ <-><-> ]] + ] map XML-CHUNK[[

    Timings

    <->
    ]] ; : error-dump ( heading vocabs-file messages-file -- xml ) [ eval-file ] dip over empty? [ 3drop f ] [ [ ] - [ [ [XML
  • <->
  • XML] ] map [XML
      <->
    XML] ] + [ [ XML-CHUNK[[
  • <->
  • ]] ] map XML-CHUNK[[
      <->
    ]] ] [ utf8 file-contents ] tri* - [XML

    <->

    <-> Details:
    <->
    XML] + XML-CHUNK[[

    <->

    <-> Details:
    <->
    ]] ] if ; : benchmarks-table ( assoc -- xml ) [ 1,000,000,000 /f - [XML <-><-> XML] + XML-CHUNK[[ <-><-> ]] ] { } assoc>map - [XML + XML-CHUNK[[

    Benchmarks

    <->
    BenchmarkTime (seconds)
    - XML] ; + ]] ; : successful-report ( -- ) [ diff --git a/extra/spider/report/report.factor b/extra/spider/report/report.factor index 7779b233f9..b83048354b 100644 --- a/extra/spider/report/report.factor +++ b/extra/spider/report/report.factor @@ -56,18 +56,18 @@ SYMBOL: time-std : info-table ( alist -- html ) [ first2 dupd 1000000 /f - [XML + XML-CHUNK[[ ><-><-> seconds - XML] - ] map [XML <->
    XML] ; + ]] + ] map XML-CHUNK[[ <->
    ]] ; : report-broken-pages ( -- html ) broken-pages get info-table ; : report-network-failures ( -- html ) network-failures get [ - dup [XML
  • ><->
  • XML] - ] map [XML
      <->
    XML] ; + dup XML-CHUNK[[
  • ><->
  • ]] + ] map XML-CHUNK[[
      <->
    ]] ; : slowest-pages-table ( -- html ) slowest-pages get info-table ; @@ -76,31 +76,31 @@ SYMBOL: time-std mean-time get median-time get time-std get - [XML + XML-CHUNK[[
    Mean<-> seconds
    Median<-> seconds
    Standard deviation<-> seconds
    - XML] ; + ]] ; : report-timings ( -- html ) slowest-pages-table timing-summary-table - [XML + XML-CHUNK[[

    Slowest pages

    <->

    Summary

    <-> - XML] ; + ]] ; : generate-report ( -- html ) url get dup report-broken-pages report-network-failures report-timings - [XML + XML-CHUNK[[

    Spider report

    URL: ><-> @@ -112,7 +112,7 @@ SYMBOL: time-std

    Load times

    <-> - XML] ; + ]] ; : spider-report ( spider -- html ) [ "Spider report" f ] dip diff --git a/extra/talks/tc-lisp-talk/tc-lisp-talk.factor b/extra/talks/tc-lisp-talk/tc-lisp-talk.factor index d43d784500..129faf650c 100644 --- a/extra/talks/tc-lisp-talk/tc-lisp-talk.factor +++ b/extra/talks/tc-lisp-talk/tc-lisp-talk.factor @@ -27,8 +27,8 @@ CONSTANT: tc-lisp-slides { $code "USING: splitting xml.writer xml.syntax ; { \"one\" \"two\" \"three\" } -[ [XML <-> XML] ] map -<-> XML> pprint-xml" +[ XML-CHUNK[[ <-> ]] ] map +XML-DOC[[ <-> ]] pprint-xml" } } { $slide "Differences between Factor and Lisp" diff --git a/extra/webapps/mason/backend/watchdog/watchdog.factor b/extra/webapps/mason/backend/watchdog/watchdog.factor index 3fbd898b92..f4b06658d4 100644 --- a/extra/webapps/mason/backend/watchdog/watchdog.factor +++ b/extra/webapps/mason/backend/watchdog/watchdog.factor @@ -5,8 +5,8 @@ webapps.mason.backend xml.syntax xml.writer ; IN: webapps.mason.backend.watchdog : crashed-builder-body ( crashed-builders -- string content-type ) - [ os/cpu [XML
  • <->
  • XML] ] map - <-> ]] ] map + XML-DOC[[ @@ -15,7 +15,7 @@ IN: webapps.mason.backend.watchdog Dashboard - XML> xml>string + ]] xml>string "text/html" ; : crashed-builder-subject ( crashed-builders -- string ) diff --git a/extra/webapps/mason/dashboard/dashboard.factor b/extra/webapps/mason/dashboard/dashboard.factor index c96863e2ce..fb18b6fc19 100644 --- a/extra/webapps/mason/dashboard/dashboard.factor +++ b/extra/webapps/mason/dashboard/dashboard.factor @@ -6,10 +6,10 @@ webapps.mason.utils ; IN: webapps.mason.downloads CONSTANT: CRASHED -[XML CRASHED XML] +XML-CHUNK[[ CRASHED ]] CONSTANT: BROKEN -[XML BROKEN XML] +XML-CHUNK[[ BROKEN ]] : builder-status ( builder -- status/f ) { @@ -22,10 +22,10 @@ CONSTANT: BROKEN [ os/cpu ] sort-with [ [ report-url ] [ os/cpu ] [ builder-status ] tri - [XML
  • ><-> <->
  • XML] + XML-CHUNK[[
  • ><-> <->
  • ]] ] map - [ [XML

    No machines.

    XML] ] - [ [XML
      <->
    XML] ] + [ XML-CHUNK[[

    No machines.

    ]] ] + [ XML-CHUNK[[
      <->
    ]] ] if-empty ; : ( -- action ) diff --git a/extra/webapps/mason/grids/grids.factor b/extra/webapps/mason/grids/grids.factor index addde53ef8..1fec58ed61 100644 --- a/extra/webapps/mason/grids/grids.factor +++ b/extra/webapps/mason/grids/grids.factor @@ -9,8 +9,8 @@ IN: webapps.mason.grids : render-grid-cell ( cpu os quot -- xml ) call( cpu os -- url label ) 2dup and - [ link [XML
    <->
    XML] ] - [ 2drop [XML XML] ] + [ link XML-CHUNK[[
    <->
    ]] ] + [ 2drop XML-CHUNK[[ ]] ] if ; CONSTANT: oses @@ -27,21 +27,21 @@ CONSTANT: cpus } : render-grid-header ( -- xml ) - oses values [ [XML <-> XML] ] map ; + oses values [ XML-CHUNK[[ <-> ]] ] map ; :: render-grid-row ( cpu quot -- xml ) cpu second oses keys |[ os | cpu os quot render-grid-cell ] map - [XML <-><-> XML] ; + XML-CHUNK[[ <-><-> ]] ; :: render-grid ( quot -- xml ) render-grid-header cpus [ quot render-grid-row ] map - [XML + XML-CHUNK[[ <-> <->
    OS/CPU
    - XML] ; + ]] ; : package-date ( filename -- date ) "." split1 drop 16 tail* 6 head* ; diff --git a/extra/webapps/mason/package/package.factor b/extra/webapps/mason/package/package.factor index d12d1464de..05a8c07732 100644 --- a/extra/webapps/mason/package/package.factor +++ b/extra/webapps/mason/package/package.factor @@ -9,7 +9,7 @@ IN: webapps.mason.package : building ( builder string -- xml ) swap current-git-id>> git-link - [XML <-> for <-> XML] ; + XML-CHUNK[[ <-> for <-> ]] ; : status-string ( builder -- string ) dup status>> { diff --git a/extra/webapps/mason/report/report.factor b/extra/webapps/mason/report/report.factor index 6c7454fe30..1b03bd5ec3 100644 --- a/extra/webapps/mason/report/report.factor +++ b/extra/webapps/mason/report/report.factor @@ -20,4 +20,4 @@ IN: webapps.mason.report [ URL" report" clone ] dip [ os>> "os" set-query-param ] [ cpu>> "cpu" set-query-param ] bi - [XML >Latest build report XML] ; + XML-CHUNK[[ >Latest build report ]] ; diff --git a/extra/webapps/mason/utils/utils.factor b/extra/webapps/mason/utils/utils.factor index 6504b5f262..1ccc337220 100644 --- a/extra/webapps/mason/utils/utils.factor +++ b/extra/webapps/mason/utils/utils.factor @@ -7,7 +7,7 @@ webapps.mason.version.data xml.syntax ; IN: webapps.mason.utils : link ( url label -- xml ) - [XML ><-> XML] ; + XML-CHUNK[[ ><-> ]] ; : validate-os/cpu ( -- ) { @@ -35,7 +35,7 @@ IN: webapps.mason.utils ? ] [ drop f ] if ] bi - 2array sift [ [XML
  • <->
  • XML] ] map [XML
      <->
    XML] ; + 2array sift [ XML-CHUNK[[
  • <->
  • ]] ] map XML-CHUNK[[
      <->
    ]] ; : download-url ( string -- string' ) "http://downloads.factorcode.org/" prepend ;