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

Function doInlineIncludes

expr/include.go:28–36  ·  view source on GitHub ↗
(ctx Includer, n Node, depth int)

Source from the content-addressed store, hash-verified

26 return doInlineIncludes(ctx, n, 0)
27}
28func doInlineIncludes(ctx Includer, n Node, depth int) (Node, error) {
29 // We need to make a copy, so we lazily use the To/From pb
30 // We need the copy because we are going to mutate this node
31 // but AST is assumed to be immuteable, and shared, since we are breaking
32 // this contract we copy
33 npb := n.NodePb()
34 newNode := NodeFromNodePb(npb)
35 return inlineIncludesDepth(ctx, newNode, depth)
36}
37func inlineIncludesDepth(ctx Includer, arg Node, depth int) (Node, error) {
38 if depth > maxIncludeDepth {
39 return nil, ErrMaxDepth

Callers 2

InlineIncludesFunction · 0.85
resolveIncludeFunction · 0.85

Calls 3

NodeFromNodePbFunction · 0.85
inlineIncludesDepthFunction · 0.85
NodePbMethod · 0.65

Tested by

no test coverage detected