develooper Front page | perl.perl5.porters | Postings from September 2012

Re: Newline legacy (Was: fixing smartmatch just hard enough (andwhen, too))

Thread Previous | Thread Next
Aaron Crane
September 1, 2012 08:34
Re: Newline legacy (Was: fixing smartmatch just hard enough (andwhen, too))
Message ID:
Bo Lindbergh <> wrote:
> I myself blathered:
>> Just in case the Unicode Consortium ever invents more whitespace,
>> here's a DFA table generator.
> And of course I realised the need for an extra sort step _after_ sending that.
> Corrected version attached.

Thanks, that's great!

By the time I saw your generator, I'd changed my hand-built automaton
to share the MATCH_C2 node with the tail of MATCH_80E2_OR_C2.  So
here's a reworked version of your program which automatically applies
the same optimisation wherever it can.  (Well, it may miss some
optimisation opportunities in particularly complex automata, because
it just does a single right-to-left pass over the nodes.  But it does
catch this case.)

I've also removed the output comments for node-internal edges, on the
grounds that they're only helpful when you're writing the automaton by

Aaron Crane **

Thread Previous | Thread Next Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About