----- Original Message -----
From: "Ingy dot Net" <i...@ingy.net>
To: "inline" <inline@perl.org>; "Nick Patch" <pa...@cpan.org>
Sent: Sunday, July 01, 2012 10:19 AM
Subject: Pegex Parser for Inline::C
Greetings,
I got the 10 year itch to hack on Inline today.
And about time, too ;-)
Nick Patch and I wrote an
Inline::C parser in Pegex. I commited it to the 'pegex' branch here:
https://github.com/ingydotnet/inline-pm/tree/pegex
Been away all weekend - I'll have a look at it tonight. (More later, once
I've had a chance to peruse it.)
It passes an initial test: C/xt/pegex.t
ParsePegex should be nearly as fast as ParseRegExp and is more beautiful
and maintainable than ParseRecescent.
See:
https://github.com/ingydotnet/inline-pm/blob/pegex/C/lib/Inline/C/ParsePegex.pm#L35
As you can see Pegex separates the Grammar from the AST building code,
both
of which are fairly simple. Nick and I paired on this today and we found a
couple bugs in Pegex that keep the grammar from being even more readable.
I'll try to fix them soon.
Looking over the code base, it's obvious that Inline could be brought up
to
date with Modern PerlT. I'm willing to put some effort into that. Rob, do
you have the cycles to manage a new release over the couple months? (I
would probably do all my refactorings on branches, and let you integrate
and manage it).
No problem there. (If I get a bit slow on the uptake, just let me know when
you think it's right to go and 'twill be done.)
Cheers,
Rob