govaluate
govaluate copied to clipboard
Error nil for Invalid Expression ((amount > 100 &&) == false)
Version: 3.0.0
Revision: d216395917cc49052c7c7094cf57f09657ca08a8
Expression: (amount > '100' &&) == false
When I am trying _, err := govaluate.NewEvaluableExpression((amount > '100' &&) == false)
, the value of err
is nil
.
The expression is syntactically incorrect, still no error is raised.
It may be 100
not '100'
. And amount > 100 &&
is still weird. There's nothing behind &&
?
@shenwei356 Its showing valid expression for both '100'
or 100
. There is nothing behind &&
, thats the major issue.
You're correct, that's a bug. I've got a fix, but there are a series of other changes I'm looking to make, and i'm not sure what order / version these things will fall out in. So it's not in master branch yet - but soon.
You'll also need to address these cases too.
ParsingFailureTest{
Name: "Hanging equality operation, followed by clause-close (#92)",
Input: "(amount > '100' !=) == false",
Expected: INVALID_TOKEN_TRANSITION,
},
ParsingFailureTest{
Name: "Hanging comparison operation, followed by clause-close (#92)",
Input: "(amount > '100' >) == false",
Expected: INVALID_TOKEN_TRANSITION,
},