Indicate whether this is a binary or ternary operator.
(expr ast.Expr)
| 519 | |
| 520 | // Indicate whether this is a binary or ternary operator. |
| 521 | func isBinaryOrTernaryOperator(expr ast.Expr) bool { |
| 522 | if expr.Kind() != ast.CallKind || len(expr.AsCall().Args()) < 2 { |
| 523 | return false |
| 524 | } |
| 525 | _, isBinaryOp := operators.FindReverseBinaryOperator(expr.AsCall().FunctionName()) |
| 526 | return isBinaryOp || isSamePrecedence(operators.Conditional, expr) |
| 527 | } |
| 528 | |
| 529 | // bytesToOctets converts byte sequences to a string using a three digit octal encoded value |
| 530 | // per byte. |
no test coverage detected