]> gitweb.factorcode.org Git - factor.git/blob - basis/xml/generator/generator.factor
Fixing basis -> extra dependencies
[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 kernel xml.data xml.utilities assocs sequences ;
4 IN: xml.generator
5
6 : comment, ( string -- ) <comment> , ;
7 : directive, ( string -- ) <directive> , ;
8 : instruction, ( string -- ) <instruction> , ;
9 : nl, ( -- ) "\n" , ;
10
11 : (tag,) ( name attrs quot -- tag )
12     -rot >r >r V{ } make r> r> rot <tag> ; inline
13 : tag*, ( name attrs quot -- )
14     (tag,) , ; inline
15
16 : contained*, ( name attrs -- )
17     f <tag> , ;
18
19 : tag, ( name quot -- ) f swap tag*, ; inline
20 : contained, ( name -- ) f contained*, ; inline
21
22 : make-xml* ( name attrs quot -- xml )
23     (tag,) build-xml ; inline
24 : make-xml ( name quot -- xml )
25     f swap make-xml* ; inline