MCPcopy Create free account
hub / github.com/araddon/qlbridge / newIncluderCtx

Function newIncluderCtx

expr/include_test.go:39–46  ·  view source on GitHub ↗
(cr expr.ContextReader, statements string)

Source from the content-addressed store, hash-verified

37}
38
39func 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}
47func (m *includectx) Include(name string) (expr.Node, error) {
48 if seg, ok := m.filters[strings.ToLower(name)]; ok {
49 return seg.Filter, nil

Callers 1

TestInlineIncludesFunction · 0.70

Calls 1

MustParseFiltersFunction · 0.92

Tested by

no test coverage detected