MCPcopy Create free account
hub / github.com/brimdata/super / Eval

Method Eval

runtime/sam/expr/filter.go:167–187  ·  view source on GitHub ↗
(val super.Value)

Source from the content-addressed store, hash-verified

165}
166
167func (s *searchString) Eval(val super.Value) super.Value {
168 if s.expr != nil {
169 val = s.expr.Eval(val)
170 if val.IsError() {
171 return super.False
172 }
173 }
174 if s.fnm.Match(val.Type()) {
175 return super.True
176 }
177 if errMatch == val.Walk(func(typ super.Type, body scode.Bytes) error {
178 if typ.ID() == super.IDString &&
179 StringContainsFold(byteconv.UnsafeString(body), s.term) {
180 return errMatch
181 }
182 return nil
183 }) {
184 return super.True
185 }
186 return super.False
187}
188
189type filter struct {
190 expr Evaluator

Callers

nothing calls this directly

Calls 8

UnsafeStringFunction · 0.92
StringContainsFoldFunction · 0.85
IsErrorMethod · 0.80
MatchMethod · 0.80
WalkMethod · 0.80
EvalMethod · 0.65
TypeMethod · 0.65
IDMethod · 0.65

Tested by

no test coverage detected