|
|
@ -58,8 +58,9 @@ pyPEG contains an XML backend, too: |
|
|
|
|
|
|
|
>>> del f[2] |
|
|
|
>>> from pypeg2.xmlast import thing2xml |
|
|
|
>>> import sys |
|
|
|
>>> xml = thing2xml(f, pretty=True) |
|
|
|
>>> print(xml.decode()) # doctest: +ELLIPSIS |
|
|
|
>>> print(xml.decode(), end="") # doctest: +ELLIPSIS |
|
|
|
<Function typing="int" name="f"> |
|
|
|
<Parameters> |
|
|
|
<Parameter typing="int" name="a".../> |
|
|
@ -68,7 +69,6 @@ pyPEG contains an XML backend, too: |
|
|
|
<Instruction>do_this</Instruction> |
|
|
|
<Instruction>do_that</Instruction> |
|
|
|
</Function> |
|
|
|
<BLANKLINE> |
|
|
|
|
|
|
|
|
|
|
|
The XML backend can read XML text and create things: |
|
|
|