diff --git a/demos/talks/tc-lisp-talk/tc-lisp-talk.factor b/demos/talks/tc-lisp-talk/tc-lisp-talk.factor index f9d7d7fa06..4f55bef016 100644 --- a/demos/talks/tc-lisp-talk/tc-lisp-talk.factor +++ b/demos/talks/tc-lisp-talk/tc-lisp-talk.factor @@ -27,7 +27,7 @@ CONSTANT: tc-lisp-slides { $code "USING: splitting xml.writer xml.syntax ; { \"one\" \"two\" \"three\" } -[ [XML <-> XML] ] map +[ XML[[ <-> XML]] ] map <-> XML> pprint-xml" } } diff --git a/frameworks/furnace/chloe-tags/chloe-tags.factor b/frameworks/furnace/chloe-tags/chloe-tags.factor index c8e864a8fc..44be46d123 100644 --- a/frameworks/furnace/chloe-tags/chloe-tags.factor +++ b/frameworks/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[[ <-> XML]] second swap >>attrs ] [xml-code] ] compile-with-scope ; CHLOE: base - compile-a-url [ [XML /> XML] ] [xml-code] ; + compile-a-url [ XML[[ /> XML]] ] [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[[
<-><-><->
XML]] ] [code] ; : (compile-form-attrs) ( method action -- ) @@ -122,7 +122,7 @@ CHLOE: form [ hidden-fields ] [ compile-children>xml-string ] tri [ - [XML
<-><->
XML] second + XML[[
<-><->
XML]] second swap >>attrs write-xml ] [code] diff --git a/frameworks/furnace/recaptcha/recaptcha.factor b/frameworks/furnace/recaptcha/recaptcha.factor index 4aa0207ddc..07434933ed 100644 --- a/frameworks/furnace/recaptcha/recaptcha.factor +++ b/frameworks/furnace/recaptcha/recaptcha.factor @@ -23,7 +23,7 @@ M: recaptcha call-responder* : (render-recaptcha) ( url -- xml ) dup - [XML + XML[[ @@ -36,7 +36,7 @@ M: recaptcha call-responder* - XML] ; + XML]] ; : recaptcha-url ( secure? -- ? ) "https" "http" ? "://www.google.com/recaptcha/api/challenge" append diff --git a/frameworks/furnace/utilities/utilities.factor b/frameworks/furnace/utilities/utilities.factor index 21cd2dd5f0..9ff46ccb28 100644 --- a/frameworks/furnace/utilities/utilities.factor +++ b/frameworks/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[[ name=<->/> XML]] ] [ drop ] if ; CONSTANT: nested-forms-key "__n" ; diff --git a/libs/farkup/farkup.factor b/libs/farkup/farkup.factor index e7bdd92e77..409eae2870 100644 --- a/libs/farkup/farkup.factor +++ b/libs/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[[
<->
XML]] ; 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[[ rel=<->><-> XML]] ; : write-image-link ( href text -- xml ) disable-images? get [ 2drop - [XML Images are not allowed XML] + XML[[ Images are not allowed XML]] ] [ [ check-url ] [ f like ] bi* - [XML alt=<->/> XML] + XML[[ alt=<->/> XML]] ] 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[[
XML]] ; M: line-break (write-farkup) - drop [XML
XML] ; + drop XML[[
XML]] ; M: table-row (write-farkup) child>> - [ (write-farkup) [XML <-> XML] ] map - [XML <-> XML] ; + [ (write-farkup) XML[[ <-> XML]] ] map + XML[[ <-> XML]] ; M: string (write-farkup) ; diff --git a/libs/html/components/components-tests.factor b/libs/html/components/components-tests.factor index f9d637f8f1..6934de4a1e 100644 --- a/libs/html/components/components-tests.factor +++ b/libs/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[[ XML]] "xmltest" set-value ] unit-test { "" } [ diff --git a/libs/html/components/components.factor b/libs/html/components/components.factor index ca2da44574..3805136260 100644 --- a/libs/html/components/components.factor +++ b/libs/html/components/components.factor @@ -46,10 +46,10 @@ M: label render* singleton: hidden M: hidden render* - drop [XML name=<-> type="hidden"/> XML] ; + drop XML[[ name=<-> type="hidden"/> XML]] ; : render-field ( value name size type -- xml ) - [XML name=<-> size=<-> type=<->/> XML] ; + XML[[ name=<-> size=<-> type=<->/> XML]] ; 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[[ - XML] ; + 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[[ XML]] ; : 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-> XML]] ; ! Checkboxes TUPLE: checkbox label ; @@ -116,9 +116,9 @@ TUPLE: checkbox label ; M: checkbox render* [ "true" and ] [ ] [ label>> ] tri* - [XML name=<->><-> XML] ; + checked=<-> name=<->><-> XML]] ; ! 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[[ href=<->><-> XML]] ; ! XMode code component TUPLE: code mode ; diff --git a/libs/html/forms/forms.factor b/libs/html/forms/forms.factor index bab5d35848..fa3ddcb415 100644 --- a/libs/html/forms/forms.factor +++ b/libs/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[[
  • <->
  • XML]] ] map + XML[[
      <->
    XML]] write-xml ] unless-empty ; diff --git a/libs/html/html.factor b/libs/html/html.factor index 8efa7070b1..c0dad662c8 100644 --- a/libs/html/html.factor +++ b/libs/html/html.factor @@ -22,10 +22,10 @@ M: empty-prolog write-xml drop ; XML> >>prolog ; : render-error ( message -- xml ) - [XML <-> XML] ; + XML[[ <-> XML]] ; : simple-link ( xml url -- xml' ) - url-encode swap [XML ><-> XML] ; + url-encode swap XML[[ ><-> XML]] ; : simple-image ( url -- xml ) - url-encode [XML /> XML] ; + url-encode XML[[ /> XML]] ; diff --git a/libs/html/streams/streams.factor b/libs/html/streams/streams.factor index 667a216a41..ea7b05c2e4 100644 --- a/libs/html/streams/streams.factor +++ b/libs/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[[ ><-> XML]] ] 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[[
    ><->
    XML]] ] 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[[
    XML]] ] 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[[ ><-> XML]] ] with map + XML[[ <-> XML]] ] with map - [XML <->
    XML] + XML[[ <->
    XML]] ] emit-html ; M: html-writer dispose drop ; diff --git a/libs/html/templates/chloe/chloe-docs.factor b/libs/html/templates/chloe/chloe-docs.factor index 57a774316c..d9d9567812 100644 --- a/libs/html/templates/chloe/chloe-docs.factor +++ b/libs/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[[ /> XML]] ;" } "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/libs/html/templates/chloe/chloe.factor b/libs/html/templates/chloe/chloe.factor index 7e178d84a9..b6395c971d 100644 --- a/libs/html/templates/chloe/chloe.factor +++ b/libs/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[[ <-> XML]] ] [ get-title ] ? [xml-code] ; @@ -33,7 +33,7 @@ CHLOE: style CHLOE: write-style drop [ get-style - [XML XML] + XML[[ XML]] ] [xml-code] ; CHLOE: even diff --git a/libs/html/templates/templates.factor b/libs/html/templates/templates.factor index 40661dd590..e31ed48c92 100644 --- a/libs/html/templates/templates.factor +++ b/libs/html/templates/templates.factor @@ -66,13 +66,13 @@ symbol: atom-feeds : get-atom-feeds ( -- xml ) atom-feeds get [ - [XML + XML[[ href=<->/> - XML] + XML]] ] { } assoc>map ; : write-atom-feeds ( -- ) diff --git a/libs/http/server/static/static.factor b/libs/http/server/static/static.factor index 3ae8729c7a..333d8c5e06 100644 --- a/libs/http/server/static/static.factor +++ b/libs/http/server/static/static.factor @@ -60,14 +60,14 @@ TUPLE: file-responder root hook special index-names allow-listings ; : file>html ( name -- xml ) dup link-info directory? [ "/" append ] when - dup [XML
  • ><->
  • XML] ; + dup XML[[
  • ><->
  • XML]] ; : directory>html ( path -- xml ) [ file-name ] [ drop f ] [ [ file-name ] [ [ natural-sort [ file>html ] map ] with-directory-files ] bi - [XML

    <->

      <->
    XML] + XML[[

    <->

      <->
    XML]] ] tri simple-page ; diff --git a/libs/lcs/diff2html/diff2html.factor b/libs/lcs/diff2html/diff2html.factor index ea585d14c1..62bfda840f 100644 --- a/libs/lcs/diff2html/diff2html.factor +++ b/libs/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[[ <-> XML]] + dup XML[[ <-><-> XML]] ; M: insert diff-line - item-string [XML + item-string XML[[ <-> - XML] ; + XML]] ; M: delete diff-line - item-string [XML + item-string XML[[ <-> - XML] ; + XML]] ; : htmlize-diff ( diff -- xml ) [ diff-line ] map - [XML + XML[[ <->
    OldNew
    - XML] ; + XML]] ; diff --git a/libs/syndication/syndication.factor b/libs/syndication/syndication.factor index 3ffe71a79d..b523cf950e 100644 --- a/libs/syndication/syndication.factor +++ b/libs/syndication/syndication.factor @@ -119,14 +119,14 @@ M: byte-array parse-feed [ bytes>xml xml>feed ] with-html-entities ; [ date>> timestamp>rfc3339 ] [ description>> ] } cleave - [XML + XML[[ <-> /> <-> <-> - XML] ; + XML]] ; : feed>xml ( feed -- xml ) [ title>> ] diff --git a/libs/xml-rpc/xml-rpc.factor b/libs/xml-rpc/xml-rpc.factor index be29e6616c..3018daa5e2 100644 --- a/libs/xml-rpc/xml-rpc.factor +++ b/libs/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[[ <-> XML]] ; M: boolean item>xml - "1" "0" ? [XML <-> XML] ; + "1" "0" ? XML[[ <-> XML]] ; M: float item>xml - number>string [XML <-> XML] ; + number>string XML[[ <-> XML]] ; M: string item>xml - [XML <-> XML] ; + XML[[ <-> XML]] ; : struct-member ( name value -- tag ) over string? [ "Struct member name must be string" throw ] unless item>xml - [XML + XML[[ <-> <-> - XML] ; + XML]] ; M: hashtable item>xml [ struct-member ] { } assoc>map - [XML <-> XML] ; + XML[[ <-> XML]] ; M: array item>xml - [ item>xml [XML <-> XML] ] map - [XML <-> XML] ; + [ item>xml XML[[ <-> XML]] ] map + XML[[ <-> XML]] ; TUPLE: base64 string ; @@ -51,11 +51,11 @@ C: base64 ; M: base64 item>xml string>> >base64 - [XML <-> XML] ; + XML[[ <-> XML]] ; : params ( seq -- xml ) - [ item>xml [XML <-> XML] ] map - [XML <-> XML] ; + [ item>xml XML[[ <-> XML]] ] map + XML[[ <-> XML]] ; : method-call ( name seq -- xml ) params diff --git a/libs/xml/syntax/syntax-docs.factor b/libs/xml/syntax/syntax-docs.factor index f3e5284f3e..49e4e3eb2e 100644 --- a/libs/xml/syntax/syntax-docs.factor +++ b/libs/xml/syntax/syntax-docs.factor @@ -36,7 +36,7 @@ ARTICLE: { "xml.syntax" "literals" } "XML literals" "The following words provide syntax for XML literals:" { $subsections postpone\ ... XML>" } { $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[[ +{ $syntax "XML[[ foo ... bar ... baz XML]]" } { $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\ " } ". 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[[ <-> 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 xml.writer xml.syntax ; \"one two three\" \" \" split -[ [XML <-> XML] ] map +[ XML[[ <-> XML]] ] map <-> XML> pprint-xml" " @@ -96,12 +96,12 @@ $nl { $example "USING: xml.syntax inverse ; : dispatch ( xml -- string ) { - { [ [XML <-> XML] ] [ \"a\" prepend ] } - { [ [XML <-> XML] ] [ \"b\" prepend ] } - { [ [XML XML] ] [ \"yes\" ] } - { [ [XML /> XML] ] [ \"no\" prepend ] } + { [ XML[[ <-> XML]] ] [ \"a\" prepend ] } + { [ XML[[ <-> XML]] ] [ \"b\" prepend ] } + { [ XML[[ XML]] ] [ \"yes\" ] } + { [ XML[[ /> XML]] ] [ \"no\" prepend ] } } switch ; -[XML pple XML] dispatch write" +XML[[ pple XML]] dispatch write" "apple" } ; HELP: XML-NS: diff --git a/libs/xml/syntax/syntax-tests.factor b/libs/xml/syntax/syntax-tests.factor index bd249e0339..e73320c85b 100644 --- a/libs/xml/syntax/syntax-tests.factor +++ b/libs/xml/syntax/syntax-tests.factor @@ -55,7 +55,7 @@ XML-NS: foo http://blah.com y " } [ - [let "one" :> a "two" :> c "y" :> x [XML <-x-> XML] :> d + [let "one" :> a "two" :> c "y" :> x XML[[ <-x-> XML]] :> d <-a-> /> <-d-> XML> pprint-xml>string @@ -75,7 +75,7 @@ XML-NS: foo http://blah.com " } [ "one two three" " " split - [ [XML <-> XML] ] map + [ XML[[ <-> XML]] ] map <-> XML> pprint-xml>string ] unit-test @@ -85,38 +85,38 @@ XML-NS: foo http://blah.com false=<-> url=<-> string=<-> word=<->/> XML> pprint-xml>string ] unit-test -{ "3" } [ 3 [XML <-> XML] xml>string ] unit-test -{ "" } [ f [XML <-> XML] xml>string ] unit-test +{ "3" } [ 3 XML[[ <-> XML]] xml>string ] unit-test +{ "" } [ f XML[[ <-> XML]] xml>string ] unit-test -[ [XML <-> XML] ] must-infer -[ [XML <-> /> XML] ] must-infer +[ XML[[ <-> XML]] ] must-infer +[ XML[[ <-> /> XML]] ] must-infer -{ xml-chunk } [ [ [XML XML] ] first class-of ] unit-test +{ 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-chunk } [ [ XML[[ /> XML]] ] third class-of ] unit-test { xml } [ [ /> XML> ] third class-of ] unit-test -{ 1 } [ [ [XML XML] ] length ] unit-test +{ 1 } [ [ XML[[ XML]] ] length ] unit-test { 1 } [ [ XML> ] length ] unit-test -{ "" } [ [XML XML] concat ] unit-test +{ "" } [ XML[[ XML]] 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[[ 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 : dispatch ( xml -- string ) { - { [ [XML <-> XML] ] [ "a" prepend ] } - { [ [XML <-> XML] ] [ "b" prepend ] } - { [ [XML XML] ] [ "byes" ] } - { [ [XML /> XML] ] [ "bno" prepend ] } + { [ XML[[ <-> XML]] ] [ "a" prepend ] } + { [ XML[[ <-> XML]] ] [ "b" prepend ] } + { [ XML[[ XML]] ] [ "byes" ] } + { [ XML[[ /> XML]] ] [ "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" } [ 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 @@ -129,7 +129,7 @@ XML-NS: foo http://blah.com } switch ; { "apple" } [ pple XML> dispatch-doc ] unit-test -{ "apple" } [ [XML pple XML] dispatch-doc ] unit-test +{ "apple" } [ XML[[ pple XML]] dispatch-doc ] unit-test { "apple" } [ pple XML> body>> dispatch-doc ] unit-test ! Make sure nested XML documents interpolate correctly diff --git a/libs/xml/syntax/syntax.factor b/libs/xml/syntax/syntax.factor index 27a93adbcb..a5b14be034 100644 --- a/libs/xml/syntax/syntax.factor +++ b/libs/xml/syntax/syntax.factor @@ -173,8 +173,8 @@ PRIVATE> SYNTAX: " [ string>doc ] parse-def ; -SYNTAX: [XML - "XML]" [ string>chunk ] parse-def ; +SYNTAX: XML[[ + "XML]]" [ string>chunk ] parse-def ; use: vocabs.loader diff --git a/libs/xml/tests/templating.factor b/libs/xml/tests/templating.factor index 04037b8e5c..d8891554c7 100644 --- a/libs/xml/tests/templating.factor +++ b/libs/xml/tests/templating.factor @@ -3,7 +3,7 @@ accessors xml.data xml.traversal xml.writer generic sequences.deep multiline ; in: xml.tests CONSTANT: sub-tag - T{ name f f "sub" "http://littledan.onigirihouse.com/namespaces/replace" } + T{ name f f "sub" "http://littledan.onigirihouse.com/namespaces/replace" } ; symbol: ref-table diff --git a/libs/xml/writer/writer-docs.factor b/libs/xml/writer/writer-docs.factor index c2cea6882a..92660705ff 100644 --- a/libs/xml/writer/writer-docs.factor +++ b/libs/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[[ bar XML]] \"%%%%\" 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[[      something
    bing
     bang
    -   bong
    XML] { \"pre\" } sensitive-tags [ pprint-xml ] with-variable" + bong
    XML]] { \"pre\" } sensitive-tags [ pprint-xml ] with-variable" " diff --git a/libs/xml/writer/writer-tests.factor b/libs/xml/writer/writer-tests.factor index 77af858566..04f96717f1 100644 --- a/libs/xml/writer/writer-tests.factor +++ b/libs/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[[ <-><-> XML]] + ] map XML[[

    Timings

    <->
    XML]] pprint-xml ] unit-test diff --git a/libs/xmode/code2html/code2html.factor b/libs/xmode/code2html/code2html.factor index 05c48ff239..1ae859a3af 100644 --- a/libs/xmode/code2html/code2html.factor +++ b/libs/xmode/code2html/code2html.factor @@ -7,7 +7,7 @@ in: xmode.code2html [ [ str>> ] [ id>> ] bi [ name>> swap - [XML ><-> XML] + XML[[ ><-> XML]] ] when* ] map ; @@ -21,7 +21,7 @@ in: xmode.code2html : default-stylesheet ( -- xml ) "resource:basis/xmode/code2html/stylesheet.css" utf8 file-contents - [XML XML] ; + XML[[ XML]] ; :: htmlize-stream ( path stream -- xml ) stream stream-lines diff --git a/modern-transition.factor b/modern-transition.factor index 8fd6971490..0f466e79ce 100644 --- a/modern-transition.factor +++ b/modern-transition.factor @@ -9,6 +9,11 @@ "cocoa.subclassing" "cocoa" "cocoa.apple-script" "gobject-introspection" } diff [ dup . flush vocab>literals ] map-zip +"resource:tools" vocabs-from +{ "help.syntax" "help.tips" "tools.test" "tools.walker" +"vocabs.git" } diff +[ dup . flush vocab>literals ] map-zip + "resource:language" vocabs-from { "constructors" "descriptive" "eval" "functors" "literals" diff --git a/tools/codebook/codebook.factor b/tools/codebook/codebook.factor index ae0aaaabc0..dd9f0621c0 100644 --- a/tools/codebook/codebook.factor +++ b/tools/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[[ <-> 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]] ] } [ drop ] } @@ -70,7 +70,7 @@ TUPLE: code-file : toc-list ( files -- list ) [ name>> ] map natural-sort [ [ file-html-name ] keep - [XML
  • ><->
  • XML] + XML[[
  • ><->
  • XML]] ] 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[[ <-> <-> XML]] "\n" 2array ; : line#>string ( i line#len -- i-string ) @@ -141,10 +141,10 @@ TUPLE: code-file name file-html-name :> filename i 2 + number>string :> istr - [XML playOrder=<-istr->> + XML[[ playOrder=<-istr->> <-name-> /> - XML] + XML]] ] map-index :> file-nav-points @@ -164,10 +164,10 @@ TUPLE: code-file files [ name>> file-html-name dup - [XML href=<-> media-type="text/html" /> XML] + XML[[ href=<-> media-type="text/html" /> XML]] ] map :> html-manifest - files [ name>> file-html-name [XML /> XML] ] map :> html-spine + files [ name>> file-html-name XML[[ /> XML]] ] map :> html-spine <-> XML] ; + swap "\n" glue XML[[ XML]] ; : help-navbar ( -- xml ) "conventions" >link topic>filename - [XML + XML[[ - XML] ; + XML]] ; : bijective-base26 ( n -- name ) [ dup 0 > ] [ 1 - 26 /mod char: a + ] "" produce-as nip reverse! ; diff --git a/tools/mason/report/report.factor b/tools/mason/report/report.factor index ff3eaf10c4..c2c436bf71 100644 --- a/tools/mason/report/report.factor +++ b/tools/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[[ ><-> XML]] ; : 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[[

    Build report for <->/<->

    @@ -25,14 +25,14 @@ in: mason.report
    Build machine:<->
    Build directory:<->
    GIT ID:<->
    - XML] ; + XML]] ; : with-report ( quot -- ) [ "report" utf8 ] dip '[ common-report _ call( -- xml ) - [XML <-><-> XML] + XML[[ <-><-> XML]] 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[[

    <-what->

    Build output:
    <-output->
    Launcher error:
    <-error->
    - XML] + 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[[ <-><-> XML]] + ] map XML[[

    Timings

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

    <->

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

    <->

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

    Benchmarks

    <->
    BenchmarkTime (seconds)
    - XML] ; + XML]] ; : successful-report ( -- ) [ diff --git a/tools/spider/report/report.factor b/tools/spider/report/report.factor index c0eaf1d1ac..b78ebf4ab5 100644 --- a/tools/spider/report/report.factor +++ b/tools/spider/report/report.factor @@ -56,18 +56,18 @@ symbol: time-std : info-table ( alist -- html ) [ first2 dupd 1000000 /f - [XML + XML[[ ><-><-> seconds - XML] - ] map [XML <->
    XML] ; + XML]] + ] map XML[[ <->
    XML]] ; : report-broken-pages ( -- html ) broken-pages get info-table ; : report-network-failures ( -- html ) network-failures get [ - dup [XML
  • ><->
  • XML] - ] map [XML
      <->
    XML] ; + dup XML[[
  • ><->
  • XML]] + ] map XML[[
      <->
    XML]] ; : 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[[
    Mean<-> seconds
    Median<-> seconds
    Standard deviation<-> seconds
    - XML] ; + XML]] ; : report-timings ( -- html ) slowest-pages-table timing-summary-table - [XML + XML[[

    Slowest pages

    <->

    Summary

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

    Spider report

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

    Load times

    <-> - XML] ; + XML]] ; : spider-report ( spider -- html ) [ "Spider report" f ] dip diff --git a/tools/tools/test/fuzz/fuzz.factor b/tools/tools/test/fuzz/fuzz.factor index ccaf2fcc00..d9863d032d 100644 --- a/tools/tools/test/fuzz/fuzz.factor +++ b/tools/tools/test/fuzz/fuzz.factor @@ -38,4 +38,4 @@ M: fuzz-test-failure summary PRIVATE> -TEST: fuzz-test +test: fuzz-test diff --git a/tools/tools/test/test.factor b/tools/tools/test/test.factor index a88653600f..8d868e52f2 100644 --- a/tools/tools/test/test.factor +++ b/tools/tools/test/test.factor @@ -114,6 +114,11 @@ SYNTAX: TEST: [ "(" ")" surround search '[ _ parse-test ] ] bi define-syntax ; +SYNTAX: test: + scan-token + [ create-word-in ] + [ "(" ")" surround search '[ _ parse-test ] ] bi + define-syntax ; >> : fake-unit-test ( quot -- test-failures ) @@ -164,11 +169,11 @@ PRIVATE> : with-test-directory ( ..a quot: ( ..a -- ..b ) -- ..b ) [ cleanup-unique-directory ] with-temp-directory ; inline -TEST: unit-test -TEST: must-infer-as -TEST: must-infer -TEST: must-fail-with -TEST: must-fail +test: unit-test +test: must-infer-as +test: must-infer +test: must-fail-with +test: must-fail M: test-failure error. ( error -- ) { diff --git a/webapps/webapps/mason/backend/watchdog/watchdog.factor b/webapps/webapps/mason/backend/watchdog/watchdog.factor index 27079de0c8..b49efa43b2 100644 --- a/webapps/webapps/mason/backend/watchdog/watchdog.factor +++ b/webapps/webapps/mason/backend/watchdog/watchdog.factor @@ -5,7 +5,7 @@ mason.email webapps.mason.backend ; in: webapps.mason.backend.watchdog : crashed-builder-body ( crashed-builders -- string content-type ) - [ os/cpu [XML
  • <->
  • XML] ] map + [ os/cpu XML[[
  • <->
  • XML]] ] map diff --git a/webapps/webapps/mason/dashboard/dashboard.factor b/webapps/webapps/mason/dashboard/dashboard.factor index bc49d21a87..c0894d1339 100644 --- a/webapps/webapps/mason/dashboard/dashboard.factor +++ b/webapps/webapps/mason/dashboard/dashboard.factor @@ -6,10 +6,10 @@ webapps.mason.utils ; in: webapps.mason.downloads CONSTANT: CRASHED -[XML CRASHED XML] +XML[[ CRASHED XML]] CONSTANT: BROKEN -[XML BROKEN XML] +XML[[ BROKEN XML]] : 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[[
  • ><-> <->
  • XML]] ] map - [ [XML

    No machines.

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

    No machines.

    XML]] ] + [ XML[[
      <->
    XML]] ] if-empty ; : ( -- action ) diff --git a/webapps/webapps/mason/grids/grids.factor b/webapps/webapps/mason/grids/grids.factor index 1ff133798a..f544d2342b 100644 --- a/webapps/webapps/mason/grids/grids.factor +++ b/webapps/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[[
    <->
    XML]] ] + [ 2drop XML[[ XML]] ] if ; CONSTANT: oses @@ -27,21 +27,21 @@ CONSTANT: cpus } : render-grid-header ( -- xml ) - oses values [ [XML <-> XML] ] map ; + oses values [ XML[[ <-> XML]] ] map ; :: render-grid-row ( cpu quot -- xml ) cpu second oses keys [| os | cpu os quot render-grid-cell ] map - [XML <-><-> XML] ; + XML[[ <-><-> XML]] ; :: render-grid ( quot -- xml ) render-grid-header cpus [ quot render-grid-row ] map - [XML + XML[[ <-> <->
    OS/CPU
    - XML] ; + XML]] ; : package-date ( filename -- date ) "." split1 drop 16 tail* 6 head* ; diff --git a/webapps/webapps/mason/package/package.factor b/webapps/webapps/mason/package/package.factor index 1a4ff6f95f..7d5649a698 100644 --- a/webapps/webapps/mason/package/package.factor +++ b/webapps/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[[ <-> for <-> XML]] ; : status-string ( builder -- string ) dup status>> { diff --git a/webapps/webapps/mason/report/report.factor b/webapps/webapps/mason/report/report.factor index 90235fd4aa..25d0770eb4 100644 --- a/webapps/webapps/mason/report/report.factor +++ b/webapps/webapps/mason/report/report.factor @@ -20,4 +20,4 @@ in: webapps.mason.report [ URL" report" ] dip [ os>> "os" set-query-param ] [ cpu>> "cpu" set-query-param ] bi - [XML >Latest build report XML] ; + XML[[ >Latest build report XML]] ; diff --git a/webapps/webapps/mason/utils/utils.factor b/webapps/webapps/mason/utils/utils.factor index 349969d86f..66d6ced5a7 100644 --- a/webapps/webapps/mason/utils/utils.factor +++ b/webapps/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[[ ><-> XML]] ; : 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[[
  • <->
  • XML]] ] map XML[[
      <->
    XML]] ; : download-url ( string -- string' ) "http://downloads.factorcode.org/" prepend ;