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

constant starting with letter 'o' #115

Closed
lhommev opened this issue Oct 18, 2022 · 5 comments
Closed

constant starting with letter 'o' #115

lhommev opened this issue Oct 18, 2022 · 5 comments
Assignees
Labels

Comments

@lhommev
Copy link

lhommev commented Oct 18, 2022

That doesn't seem to be supported:
set constant "organisation" = "whatever"

expression "organisation" evaluation gives :
Assertion "m_nStackPos >= 0" failed: mpRPN.cpp line 74

@lhommev
Copy link
Author

lhommev commented Oct 19, 2022

i debugged the code. it looks like 'organisation' is interpreted like 'or' + 'ganisation'
'or' beeing an operator
like +abc

Why is the token splited ? there is no syntax delimiter characters ?

@beltoforion
Copy link
Owner

set constant "organisation" = "whatever" 

is not a valid statement in muparserx syntax.

"organisation"=="foobar"

Does not give an error. Please provide the exact statement that is causing this behavior.

@beltoforion beltoforion self-assigned this Oct 19, 2022
@lhommev
Copy link
Author

lhommev commented Oct 20, 2022

Hi Beltoforion,

I mean, i 'm using

parser.DefineConst( constant_name , constant_value );

with constant_name "organisation" and constant_value "whatever"

then

string requirement = "organisation == "foobar"";
parser.SetExpr(requirement);
val = parser.Eval();

the Eval command triggers the assertion error.

Not that 'organisation' is not a string. It s a constant/variable name.

@lhommev
Copy link
Author

lhommev commented Oct 20, 2022

THe use case is that i have multiple requirement strings as a muparserx expression. There is a set of constants that are defined in the parser such as "organisation", "group", "security_level" etc..
I loop over the requirement string and evaluate them. At some point it fails to evaluate.

The same assertion is triggered just by evaluating : "andganisation"

@beltoforion beltoforion added the bug label Dec 4, 2022
beltoforion pushed a commit that referenced this issue Dec 4, 2022
@beltoforion
Copy link
Owner

Issue is fixed

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