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

Method visit

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

Source from the content-addressed store, hash-verified

121}
122
123func (un *unparser) visit(expr ast.Expr) error {
124 if expr == nil {
125 return errors.New("unsupported expression")
126 }
127 visited, err := un.visitMaybeMacroCall(expr)
128 if visited || err != nil {
129 return err
130 }
131 switch expr.Kind() {
132 case ast.CallKind:
133 return un.visitCall(expr)
134 case ast.LiteralKind:
135 return un.visitConst(expr)
136 case ast.IdentKind:
137 return un.visitIdent(expr)
138 case ast.ListKind:
139 return un.visitList(expr)
140 case ast.MapKind:
141 return un.visitStructMap(expr)
142 case ast.SelectKind:
143 return un.visitSelect(expr)
144 case ast.StructKind:
145 return un.visitStructMsg(expr)
146 default:
147 return fmt.Errorf("unsupported expression: %v", expr)
148 }
149}
150
151func (un *unparser) visitCall(expr ast.Expr) error {
152 c := expr.AsCall()

Callers 8

UnparseFunction · 0.95
visitCallFuncMethod · 0.95
visitListMethod · 0.95
visitStructMsgMethod · 0.95
visitStructMapMethod · 0.95
visitMaybeMacroCallMethod · 0.95
visitMaybeNestedMethod · 0.95

Calls 10

visitMaybeMacroCallMethod · 0.95
visitCallMethod · 0.95
visitConstMethod · 0.95
visitIdentMethod · 0.95
visitListMethod · 0.95
visitStructMapMethod · 0.95
visitSelectMethod · 0.95
visitStructMsgMethod · 0.95
NewMethod · 0.80
KindMethod · 0.65

Tested by

no test coverage detected