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

Method visit

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

Source from the content-addressed store, hash-verified

85}
86
87func (un *unparser) visit(expr ast.Expr) error {
88 if expr == nil {
89 return errors.New("unsupported expression")
90 }
91 visited, err := un.visitMaybeMacroCall(expr)
92 if visited || err != nil {
93 return err
94 }
95 switch expr.Kind() {
96 case ast.CallKind:
97 return un.visitCall(expr)
98 case ast.LiteralKind:
99 return un.visitConst(expr)
100 case ast.IdentKind:
101 return un.visitIdent(expr)
102 case ast.ListKind:
103 return un.visitList(expr)
104 case ast.MapKind:
105 return un.visitStructMap(expr)
106 case ast.SelectKind:
107 return un.visitSelect(expr)
108 case ast.StructKind:
109 return un.visitStructMsg(expr)
110 default:
111 return fmt.Errorf("unsupported expression: %v", expr)
112 }
113}
114
115func (un *unparser) visitCall(expr ast.Expr) error {
116 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