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)
| 518 | // |
| 519 | // If the expr is not a Call, the result is false. |
| 520 | func isSamePrecedence(op string, expr ast.Expr) bool { |
| 521 | if expr.Kind() != ast.CallKind { |
| 522 | return false |
| 523 | } |
| 524 | c := expr.AsCall() |
| 525 | other := c.FunctionName() |
| 526 | return operators.Precedence(op) == operators.Precedence(other) |
| 527 | } |
| 528 | |
| 529 | // isLowerPrecedence indicates whether the precedence of the input operator is lower precedence |
| 530 | // than the (possible) operation represented in the input Expr. |
no test coverage detected