Because the ->parse() method of QueryParser did not clear an instance's
parse tree prior to parsing, any time a QP instance was reused, the user
ended up with a corrupted parse tree containing bits of old queries as
well as bits of the new query.
Signed-off-by: Jared Camins-Esakov <jcamins@cpbibliography.com>
my $self = shift;
my $pkg = ref($self) || $self;
warn " ** parse package is $pkg\n" if $self->debug;
+
+ # Without this, calling ->parse() twice on a single instance results
+ # in parse tree corruption
+ undef $self->{_parse_tree};
+
$self->parse_tree(
$self->decompose(
$self->query( shift() )