Subject: | FLAT::DFA unset_starting() infinite recursion |
Date: | Wed, 29 Jun 2016 17:28:06 +1000 |
To: | bug-FLAT [...] rt.cpan.org |
From: | Kevin Ryde <user42_kevin [...] yahoo.com.au> |
In FLAT 0.9.1 on a debian i386 perl 5.22.1, a program
#!/usr/bin/perl -w
use strict;
use FLAT;
my $dfa = FLAT::Regex->new('a*')->as_dfa;
print "reversing ...\n";
$dfa->reverse;
recurses apparently infinitely until using all memory. When run with
"perl -w" it warns
Deep recursion on subroutine "FLAT::DFA::unset_starting" at
/usr/share/perl5/FLAT/DFA.pm line 80.
I struck the same attempting concat() of DFAs.
(I saw the comment in that method about some known trouble there maybe.)
Nosing around the code I saw the DFA ->as_nfa() method returns class
FLAT::DFA, not FLAT::NFA. For reverse and concat I got some joy by
re-blessing into FLAT::NFA for the operation then going back by
->as_dfa. But dunno if that's how it's meant to work.