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

Function AstToString

cel/io.go:101–103  ·  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

99// Note, the conversion may not be an exact replica of the original expression, but will produce
100// a string that is semantically equivalent and whose textual representation is stable.
101func AstToString(a *Ast) (string, error) {
102 return ExprToString(a.NativeRep().Expr(), a.NativeRep().SourceInfo())
103}
104
105// ExprToString converts an AST Expr node back to a string using macro call tracking metadata from
106// source info if any macros are encountered within the expression.

Callers 15

TestRuleComposerUnnestFunction · 0.92
setupMethod · 0.92
TestInliningOptimizerFunction · 0.92
exercise8Function · 0.92

Calls 4

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