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

Method visitSelectInternal

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

Source from the content-addressed store, hash-verified

376}
377
378func (un *unparser) visitSelectInternal(operand ast.Expr, testOnly bool, op string, field string) error {
379 // handle the case when the select expression was generated by the has() macro.
380 if testOnly {
381 un.str.WriteString("has(")
382 }
383 nested := !testOnly && isBinaryOrTernaryOperator(operand)
384 err := un.visitMaybeNested(operand, nested)
385 if err != nil {
386 return err
387 }
388 un.str.WriteString(op)
389 un.str.WriteString(maybeQuoteField(field))
390 if testOnly {
391 un.str.WriteString(")")
392 }
393 return nil
394}
395
396func (un *unparser) visitStructMsg(expr ast.Expr) error {
397 m := expr.AsStruct()

Callers 2

visitOptSelectMethod · 0.95
visitSelectMethod · 0.95

Calls 3

visitMaybeNestedMethod · 0.95
maybeQuoteFieldFunction · 0.85

Tested by

no test coverage detected