MathParser.org-mXparser icon indicating copy to clipboard operation
MathParser.org-mXparser copied to clipboard

Sum function endless loops under certain conditions when checking syntax

Open RaphiMC opened this issue 1 year ago • 1 comments

MathParser.org-mXparser version: v.5.0.6

Framework: Java

When running the checkSyntax() method on the expression below it never finishes, but loops endlessly instead.

Examplecode: sum(i, 1, 10, 2*xi)

RaphiMC avatar Aug 06 '22 20:08 RaphiMC

This is a bug in the Implied Multiplication feature that was implemented in the version v.5.0. I will fix it after my vacation. As of now please turn off the Implied Multiplication mode

Globally

mXparser.disableImpliedMultiplicationMode();
Expression e = new Expression("sum(i, 1, 10, 2*xi)");
e.checkSyntax();
mXparser.consolePrintln(e.getErrorMessage());

result

[mXparser-v.5.0.6] [sum(i, 1, 10, 2*xi)] checking ...
[sum(i, 1, 10, 2*xi)] (xi, 10) invalid <TOKEN>.
[sum(i, 1, 10, 2*xi)] errors were found.

or locally

Expression e = new Expression("sum(i, 1, 10, 2*xi)");
e.disableImpliedMultiplicationMode();
e.checkSyntax();
mXparser.consolePrintln(e.getErrorMessage());

result

[mXparser-v.5.0.6] [sum(i, 1, 10, 2*xi)] checking ...
[sum(i, 1, 10, 2*xi)] (xi, 10) invalid <TOKEN>.
[sum(i, 1, 10, 2*xi)] errors were found.

Best regards

mariuszgromada avatar Aug 08 '22 16:08 mariuszgromada

I ma starting working on this :-)

mariuszgromada avatar Aug 20 '22 11:08 mariuszgromada

Fixed :-) 5.0.7 soon will be released :-)

mariuszgromada avatar Aug 20 '22 17:08 mariuszgromada