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

Method VisitEntryExpr

tools/celtest/test_runner.go:1217–1236  ·  view source on GitHub ↗

VisitEntryExpr populates the coverageStats for the current entry expression based on the coverageStats of its direct children.

(e ast.EntryExpr)

Source from the content-addressed store, hash-verified

1215// VisitEntryExpr populates the coverageStats for the current entry expression based on the coverageStats
1216// of its direct children.
1217func (pv parentVisitor) VisitEntryExpr(e ast.EntryExpr) {
1218 if pv.coverageStats[e.ID()] != nil {
1219 return
1220 }
1221 switch e.Kind() {
1222 case ast.MapEntryKind:
1223 me := e.AsMapEntry()
1224 if _, ok := pv.coverageStats[me.Key().ID()]; ok {
1225 pv.coverageStats[e.ID()] = make(set)
1226 }
1227 if _, ok := pv.coverageStats[me.Value().ID()]; ok {
1228 pv.coverageStats[e.ID()] = make(set)
1229 }
1230 case ast.StructFieldKind:
1231 sf := e.AsStructField()
1232 if _, ok := pv.coverageStats[sf.Value().ID()]; ok {
1233 pv.coverageStats[e.ID()] = make(set)
1234 }
1235 }
1236}

Callers

nothing calls this directly

Calls 6

IDMethod · 0.65
KindMethod · 0.65
AsMapEntryMethod · 0.65
KeyMethod · 0.65
ValueMethod · 0.65
AsStructFieldMethod · 0.65

Tested by

no test coverage detected