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

Method visitCallFunc

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

Source from the content-addressed store, hash-verified

210}
211
212func (un *unparser) visitCallFunc(expr ast.Expr) error {
213 c := expr.AsCall()
214 fun := c.FunctionName()
215 args := c.Args()
216 if c.IsMemberFunction() {
217 nested := isBinaryOrTernaryOperator(c.Target())
218 err := un.visitMaybeNested(c.Target(), nested)
219 if err != nil {
220 return err
221 }
222 un.str.WriteString(".")
223 }
224 un.str.WriteString(fun)
225 un.str.WriteString("(")
226 for i, arg := range args {
227 err := un.visit(arg)
228 if err != nil {
229 return err
230 }
231 if i < len(args)-1 {
232 un.str.WriteString(", ")
233 }
234 }
235 un.str.WriteString(")")
236 return nil
237}
238
239func (un *unparser) visitCallIndex(expr ast.Expr) error {
240 return un.visitCallIndexInternal(expr, "[")

Callers 1

visitCallMethod · 0.95

Calls 8

visitMaybeNestedMethod · 0.95
visitMethod · 0.95
AsCallMethod · 0.65
FunctionNameMethod · 0.65
ArgsMethod · 0.65
IsMemberFunctionMethod · 0.65
TargetMethod · 0.65

Tested by

no test coverage detected