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

Method visitSelectInternal

parser/unparser.go:416–432  ·  view source on GitHub ↗
(operand ast.Expr, testOnly bool, op string, field string)

Source from the content-addressed store, hash-verified

414}
415
416func (un *unparser) visitSelectInternal(operand ast.Expr, testOnly bool, op string, field string) error {
417 // handle the case when the select expression was generated by the has() macro.
418 if testOnly {
419 un.str.WriteString("has(")
420 }
421 nested := !testOnly && isBinaryOrTernaryOperator(operand)
422 err := un.visitMaybeNested(operand, nested)
423 if err != nil {
424 return err
425 }
426 un.str.WriteString(op)
427 un.str.WriteString(un.maybeQuoteField(field))
428 if testOnly {
429 un.str.WriteString(")")
430 }
431 return nil
432}
433
434func (un *unparser) visitStructMsg(expr ast.Expr) error {
435 m := expr.AsStruct()

Callers 2

visitOptSelectMethod · 0.95
visitSelectMethod · 0.95

Calls 3

visitMaybeNestedMethod · 0.95
maybeQuoteFieldMethod · 0.95

Tested by

no test coverage detected