muktihari/expr

Wrong operator in string comparison for LSS and LEQ

Closed this issue · 0 comments

This bug will produce wrong result when parsing the expression which requires string comparison involving these operators:

  • LSS (less than) should be '<' not '>'
  • LEQ (less than equal) should be '<=' not '>='

    expr/boolean/boolean.go

    Lines 121 to 124 in 9fa6a09

    case token.LSS:
    v.res = strconv.FormatBool(xVisitor.res > yVisitor.res)
    case token.LEQ:
    v.res = strconv.FormatBool(xVisitor.res >= yVisitor.res)