(ast, child)
| 130 | } |
| 131 | |
| 132 | function applyIncludes(ast, child) { |
| 133 | return walk( |
| 134 | ast, |
| 135 | function before(node, replace) { |
| 136 | if (node.type === 'RawInclude') { |
| 137 | replace({type: 'Text', val: node.file.str.replace(/\r/g, '')}); |
| 138 | } |
| 139 | }, |
| 140 | function after(node, replace) { |
| 141 | if (node.type === 'Include') { |
| 142 | var childAST = link(node.file.ast); |
| 143 | if (childAST.hasExtends) { |
| 144 | childAST = removeBlocks(childAST); |
| 145 | } |
| 146 | replace(applyYield(childAST, node.block)); |
| 147 | } |
| 148 | } |
| 149 | ); |
| 150 | } |
| 151 | function removeBlocks(ast) { |
| 152 | return walk(ast, function(node, replace) { |
| 153 | if (node.type === 'NamedBlock') { |
no test coverage detected
searching dependent graphs…