MCPcopy Create free account
hub / github.com/cel-expr/cel-go / visitCallUnary

Method visitCallUnary

parser/unparser.go:302–313  ·  view source on GitHub ↗
(expr ast.Expr)

Source from the content-addressed store, hash-verified

300}
301
302func (un *unparser) visitCallUnary(expr ast.Expr) error {
303 c := expr.AsCall()
304 fun := c.FunctionName()
305 args := c.Args()
306 unmangled, found := operators.FindReverse(fun)
307 if !found {
308 return fmt.Errorf("cannot unmangle operator: %s", fun)
309 }
310 un.str.WriteString(unmangled)
311 nested := isComplexOperator(args[0]) || isAmbiguousUnaryOperand(args[0])
312 return un.visitMaybeNested(args[0], nested)
313}
314
315func (un *unparser) visitConstVal(val ref.Val) error {
316 optional := false

Callers 1

visitCallMethod · 0.95

Calls 7

visitMaybeNestedMethod · 0.95
FindReverseFunction · 0.92
isComplexOperatorFunction · 0.85
isAmbiguousUnaryOperandFunction · 0.85
AsCallMethod · 0.65
FunctionNameMethod · 0.65
ArgsMethod · 0.65

Tested by

no test coverage detected