Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sum function endless loops under certain conditions when checking syntax #269

Closed
RaphiMC opened this issue Aug 6, 2022 · 3 comments
Closed
Labels

Comments

@RaphiMC
Copy link

RaphiMC commented Aug 6, 2022

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)

@mariuszgromada
Copy link
Owner

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
Copy link
Owner

I ma starting working on this :-)

@mariuszgromada
Copy link
Owner

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants