(ctx Includer, n Node, depth int)
| 26 | return doInlineIncludes(ctx, n, 0) |
| 27 | } |
| 28 | func 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 | } |
| 37 | func inlineIncludesDepth(ctx Includer, arg Node, depth int) (Node, error) { |
| 38 | if depth > maxIncludeDepth { |
| 39 | return nil, ErrMaxDepth |
no test coverage detected