[phc-general] wrong xml

Paul Biggar paul.biggar at gmail.com
Mon Oct 8 00:38:58 CEST 2007

Hi David,

On 10/7/07, ml <ml at dasir.net> wrote:
> I have PHC v1.7.2rc and I realized that the XML input/output is broken.

Yes, this is true. We fixed it a while ago, but havent realeased since.

> See? Everything is completly shuffled. What's wrong?

We used to treat class and function definitions specially, and print
them first. We no longer do that, so they print in the correct order

We changed the grammar so that function and class definitions were
normal statements, which fixed this. It is fixed in the our latest
revision, which is available at http://code.google.com/p/phc/source.

I tested your code in the latest revision in the repository. It seems
that we broke XML output with a few recent changes, so you should try
an earlier version. I tested revision 750, which seems fine. To check
this out, the command is

svn checkout http://phc.googlecode.com/svn/trunk/ phc -r 750

> phc --dump-ast-xml < x.php | phc --read-ast-xml --dump-php --tab="  "

Also, the commands have changed. To repeat the test, run
src/phc --xdump=ast < a.php | src/phc --read-ast-xml --pretty-print --tab="  "

Thanks for the bug report. Please let us know if you have any problems.

> and output is
> <?php
>   class C
>   {
>   }
>   function f()
>   {
>   }
>   define('X', 3);
> ?>

> Thanks.
> David
> _______________________________________________
> phc-general mailing list
> phc-general at phpcompiler.org
> https://nova.villiros.com/cgi-bin/mailman/listinfo/phc-general

Paul Biggar
paul.biggar at gmail.com

More information about the phc-general mailing list