Subject: | Tree-Parser-0.10, unsetting deparse_filter_cleanup |
Hello there,
I just got Tree-Parser-0.10 from CPAN. Seems to be exactly what I needed
(namely, parsing trees in bracket notation, outputting them as tabs).
However, I think I stumbled upon a bug. (Possibly, I'm just trying to use
the module in a wrong way.)
The problem seems to be that, that most use...Filters do NOT reset the
deparse_filter_cleanup.
I use the nested parens filter for parsing and tried using the tabindented
for deparsing, which gave me a) a less-than-perfect printout b) an error
message.
Here's a (very simple&silly) example:
use Tree::Parser;
my $TP = Tree::Parser->new("(1 2 3 4 (5) 6)");
$TP->useNestedParensFilters();
$TP->parse();
$TP->useTabIndentedFilters();
print $TP->deparse();
What I did then was adding an
$self->{deparse_filter_cleanup} = undef;
to all the use...Filters subs (especially useTabIndentedFilters) and - it seems to work now!
I've attached my Parser.pm file.
Hope this IS a bug and I just don't use the whole module in a wrong way.
Cheers,
Gerd
Message body is not shown because it is too large.