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

Order of operators incorrect (included fix) #4

Open
pabloale opened this issue Dec 5, 2019 · 0 comments
Open

Order of operators incorrect (included fix) #4

pabloale opened this issue Dec 5, 2019 · 0 comments

Comments

@pabloale
Copy link

pabloale commented Dec 5, 2019

Using a expression like nu_field >= 0,

When the expression parsing stars this becomes into
Property = parts[0].Trim(); //"nu_field"
Value = _GetValue(parts[1]); //"= 0"

because the operator match was like
new EqualityOperator("==", (a, b) => a == b),
new EqualityOperator("!=", (a, b) => a != b),
new EqualityOperator(">", (a, b) => a > b),
new EqualityOperator("<", (a, b) => a < b),
new EqualityOperator(">=", (a, b) => a >= b),
new EqualityOperator("<=", (a, b) => a <= b)

so in the foreach statment the first match was on ">" instand of ">="

the workaround is change de order of the operators initialization.
new EqualityOperator("==", (a, b) => a == b),
new EqualityOperator("!=", (a, b) => a != b),
new EqualityOperator(">=", (a, b) => a >= b),
new EqualityOperator("<=", (a, b) => a <= b),
new EqualityOperator(">", (a, b) => a > b),
new EqualityOperator("<", (a, b) => a < b)

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

No branches or pull requests

1 participant