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

Method visitMaybeNested

parser/unparser.go:458–470  ·  view source on GitHub ↗
(expr ast.Expr, nested bool)

Source from the content-addressed store, hash-verified

456}
457
458func (un *unparser) visitMaybeNested(expr ast.Expr, nested bool) error {
459 if nested {
460 un.str.WriteString("(")
461 }
462 err := un.visit(expr)
463 if err != nil {
464 return err
465 }
466 if nested {
467 un.str.WriteString(")")
468 }
469 return nil
470}
471
472// isLeftRecursive indicates whether the parser resolves the call in a left-recursive manner as
473// this can have an effect of how parentheses affect the order of operations in the AST.

Callers 6

visitCallBinaryMethod · 0.95
visitCallConditionalMethod · 0.95
visitCallFuncMethod · 0.95
visitCallUnaryMethod · 0.95
visitSelectInternalMethod · 0.95

Calls 1

visitMethod · 0.95

Tested by

no test coverage detected