Subject: | De-parsing issue with the nested parens parser |
Hi
I'm using the excellent Tree::Parser 0.09 which I got as a PPM package from the ActiveState PPM2 repository.
If you generate a tree that looks like this:
1
2
3
4
The function will deparse this tree as:
(1 (2 (3) 4)
Instead of:
(1 (2 (3)) 4)
There is a problem in the $NESTED_PARENS_DEPARSE function on lines 271 - 273.
elsif ($prev_depth > $current_depth) {
$output .= ") ";
}
This should read something like
elsif ($prev_depth > $current_depth) {
my $delta = $prev_depth - $current_depth;
$output .= ")" x $delta . " ";
}
Thanks,
Chad Ullman