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 *exprpb.Expr)
| 738 | // |
| 739 | // If the expr is not a Call, the result is false. |
| 740 | func isSamePrecedence(op string, expr *exprpb.Expr) bool { |
| 741 | if expr.GetCallExpr() == nil { |
| 742 | return false |
| 743 | } |
| 744 | c := expr.GetCallExpr() |
| 745 | other := c.GetFunction() |
| 746 | return operators.Precedence(op) == operators.Precedence(other) |
| 747 | } |
| 748 | |
| 749 | // isLowerPrecedence indicates whether the precedence of the input operator is lower precedence |
| 750 | // than the (possible) operation represented in the input Expr. |
no outgoing calls
no test coverage detected