(cr expr.ContextReader, statements string)
| 37 | } |
| 38 | |
| 39 | func newIncluderCtx(cr expr.ContextReader, statements string) *includectx { |
| 40 | stmts := rel.MustParseFilters(statements) |
| 41 | filters := make(map[string]*rel.FilterStatement, len(stmts)) |
| 42 | for _, stmt := range stmts { |
| 43 | filters[strings.ToLower(stmt.Alias)] = stmt |
| 44 | } |
| 45 | return &includectx{ContextReader: cr, filters: filters} |
| 46 | } |
| 47 | func (m *includectx) Include(name string) (expr.Node, error) { |
| 48 | if seg, ok := m.filters[strings.ToLower(name)]; ok { |
| 49 | return seg.Filter, nil |
no test coverage detected