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

Function AstToString

cel/io.go:125–127  ·  view source on GitHub ↗

AstToString converts an Ast back to a string if possible. Note, the conversion may not be an exact replica of the original expression, but will produce a string that is semantically equivalent and whose textual representation is stable.

(a *Ast)

Source from the content-addressed store, hash-verified

123// Note, the conversion may not be an exact replica of the original expression, but will produce
124// a string that is semantically equivalent and whose textual representation is stable.
125func AstToString(a *Ast) (string, error) {
126 return ExprToString(a.NativeRep().Expr(), a.NativeRep().SourceInfo())
127}
128
129// ExprToString converts an AST Expr node back to a string using macro call tracking metadata from
130// source info if any macros are encountered within the expression.

Calls 4

ExprToStringFunction · 0.85
NativeRepMethod · 0.80
ExprMethod · 0.65
SourceInfoMethod · 0.45