xml.syntax: Nested xml literals were not handled correctly.
parent
083950b4d2
commit
592e4fbf91
|
@ -2,7 +2,8 @@
|
|||
! See http://factorcode.org/license.txt for BSD license.
|
||||
USING: xml io kernel math sequences strings xml.traversal
|
||||
tools.test math.parser xml.syntax xml.data xml.syntax.private
|
||||
accessors multiline locals inverse xml.writer splitting classes ;
|
||||
accessors multiline locals inverse xml.writer splitting classes
|
||||
xml.private ;
|
||||
IN: xml.syntax.tests
|
||||
|
||||
! TAGS test
|
||||
|
@ -130,3 +131,21 @@ XML-NS: foo http://blah.com
|
|||
[ "apple" ] [ <XML <a>pple</a> XML> dispatch-doc ] unit-test
|
||||
[ "apple" ] [ [XML <a>pple</a> XML] dispatch-doc ] unit-test
|
||||
[ "apple" ] [ <XML <a>pple</a> XML> body>> dispatch-doc ] unit-test
|
||||
|
||||
! Make sure nested XML documents interpolate correctly
|
||||
{
|
||||
"""<?xml version="1.0" encoding="UTF-8"?><color><blue>it's blue!</blue></color>"""
|
||||
} [
|
||||
"it's blue!" <XML <blue><-></blue> XML>
|
||||
<XML <color><-></color> XML> xml>string
|
||||
] unit-test
|
||||
|
||||
{
|
||||
"""<?xml version="1.0" encoding="UTF-8"?><a>asdf<asdf/>asdf2</a>"""
|
||||
} [
|
||||
default-prolog
|
||||
"asdf"
|
||||
"asdf" f f <tag>
|
||||
"asdf2" <xml>
|
||||
<XML <a><-></a> XML> xml>string
|
||||
] unit-test
|
||||
|
|
|
@ -103,6 +103,10 @@ M: xml-data push-item , ;
|
|||
M: object push-item present , ;
|
||||
M: sequence push-item
|
||||
dup xml-data? [ , ] [ [ push-item ] each ] if ;
|
||||
M: xml push-item
|
||||
[ before>> push-item ]
|
||||
[ body>> push-item ]
|
||||
[ after>> push-item ] tri ;
|
||||
M: number push-item present , ;
|
||||
M: xml-chunk push-item % ;
|
||||
|
||||
|
|
Loading…
Reference in New Issue