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

Method visitCallUnary

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

Source from the content-addressed store, hash-verified

262}
263
264func (un *unparser) visitCallUnary(expr ast.Expr) error {
265 c := expr.AsCall()
266 fun := c.FunctionName()
267 args := c.Args()
268 unmangled, found := operators.FindReverse(fun)
269 if !found {
270 return fmt.Errorf("cannot unmangle operator: %s", fun)
271 }
272 un.str.WriteString(unmangled)
273 nested := isComplexOperator(args[0])
274 return un.visitMaybeNested(args[0], nested)
275}
276
277func (un *unparser) visitConstVal(val ref.Val) error {
278 optional := false

Callers 1

visitCallMethod · 0.95

Calls 6

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

Tested by

no test coverage detected