MCPcopy Create free account
hub / github.com/cel-expr/cel-cpp / IsBinaryOrTernaryOperator

Method IsBinaryOrTernaryOperator

tools/cel_unparser.cc:544–550  ·  view source on GitHub ↗

Returns true the given expression is - a call expression AND ONE of the following holds: - a binary operator - a ternary conditional operator

Source from the content-addressed store, hash-verified

542// - a binary operator
543// - a ternary conditional operator
544bool Unparser::IsBinaryOrTernaryOperator(const Expr& expr) {
545 if (!IsComplexOperator(expr)) {
546 return false;
547 }
548 return LookupBinaryOperator(expr.call_expr().function()).has_value() ||
549 IsOperatorSamePrecedence(CelOperator::CONDITIONAL, expr);
550}
551
552} // namespace
553

Callers

nothing calls this directly

Calls 3

LookupBinaryOperatorFunction · 0.85
IsOperatorSamePrecedenceFunction · 0.85
has_valueMethod · 0.45

Tested by

no test coverage detected