From 1984990714aa9e34c22eca94609ef84c6162c12d Mon Sep 17 00:00:00 2001 From: "K. Andrew Parker" Date: Wed, 26 Jul 2023 16:20:24 -0400 Subject: [PATCH] parse derivatives instead of just relying on tree --- lib/Parser/Differentiation.pm | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/lib/Parser/Differentiation.pm b/lib/Parser/Differentiation.pm index b4cb96a178..5e8eacecf3 100644 --- a/lib/Parser/Differentiation.pm +++ b/lib/Parser/Differentiation.pm @@ -39,7 +39,11 @@ sub Parser::D { return (0 * $self)->reduce('0*x' => 1) unless defined $self->{variables}{$x}; $f = $f->D($x); } - return $self->new($f); + my $deriv = $self->new($f); + $deriv->{string} = $deriv->{tree}->string; + $deriv->tokenize; + $deriv->parse; + return $deriv; } #