]> gitweb.factorcode.org Git - factor.git/blob - basis/xml/generator/generator.factor
Updating code for make and fry changes
[factor.git] / basis / xml / generator / generator.factor
1 ! Copyright (C) 2006, 2007 Daniel Ehrenberg
2 ! See http://factorcode.org/license.txt for BSD license.
3 USING: namespaces make kernel xml.data xml.utilities assocs
4 sequences ;
5 IN: xml.generator
6
7 : comment, ( string -- ) <comment> , ;
8 : directive, ( string -- ) <directive> , ;
9 : instruction, ( string -- ) <instruction> , ;
10 : nl, ( -- ) "\n" , ;
11
12 : (tag,) ( name attrs quot -- tag )
13     -rot >r >r V{ } make r> r> rot <tag> ; inline
14 : tag*, ( name attrs quot -- )
15     (tag,) , ; inline
16
17 : contained*, ( name attrs -- )
18     f <tag> , ;
19
20 : tag, ( name quot -- ) f swap tag*, ; inline
21 : contained, ( name -- ) f contained*, ; inline
22
23 : make-xml* ( name attrs quot -- xml )
24     (tag,) build-xml ; inline
25 : make-xml ( name quot -- xml )
26     f swap make-xml* ; inline