MathParser.org-mXparser
MathParser.org-mXparser copied to clipboard
Sum function endless loops under certain conditions when checking syntax
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)
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
I ma starting working on this :-)
Fixed :-) 5.0.7 soon will be released :-)