Skip to content

Order of operators incorrect (included fix) #4

@pabloale

Description

@pabloale

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)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions