isSamePrecedence indicates whether the precedence of the input operator is the same as the precedence of the (possible) operation represented in the input Expr. If the expr is not a Call, the result is false.
(op string, expr ast.Expr)
| 480 | // |
| 481 | // If the expr is not a Call, the result is false. |
| 482 | func isSamePrecedence(op string, expr ast.Expr) bool { |
| 483 | if expr.Kind() != ast.CallKind { |
| 484 | return false |
| 485 | } |
| 486 | c := expr.AsCall() |
| 487 | other := c.FunctionName() |
| 488 | return operators.Precedence(op) == operators.Precedence(other) |
| 489 | } |
| 490 | |
| 491 | // isLowerPrecedence indicates whether the precedence of the input operator is lower precedence |
| 492 | // than the (possible) operation represented in the input Expr. |
no test coverage detected