Lines Matching refs:ast
11 function link(ast) { argument
12 assert(ast.type === 'Block', 'The top level element should always be a block');
14 if (ast.nodes.length) {
15 var hasExtends = ast.nodes[0].type === 'Extends';
16 checkExtendPosition(ast, hasExtends);
18 extendsNode = ast.nodes.shift();
21 ast = applyIncludes(ast);
22 ast.declaredBlocks = findDeclaredBlocks(ast);
26 ast.nodes.forEach(function addNode(node) {
37 var parent = link(extendsNode.file.ast);
38 extend(parent.declaredBlocks, ast);
54 Object.keys(ast.declaredBlocks).forEach(function (name) {
55 parent.declaredBlocks[name] = ast.declaredBlocks[name];
61 return ast;
64 function findDeclaredBlocks(ast) /*: {[name: string]: Array<BlockNode>}*/ { argument
66 walk(ast, function before(node) {
86 function extend(parentBlocks, ast) { argument
88 walk(ast, function before(node) {
119 function applyIncludes(ast, child) { argument
120 return walk(ast, function before(node, replace) {
126 var childAST = link(node.file.ast);
134 function removeBlocks(ast) { argument
135 return walk(ast, function (node, replace) {
145 function applyYield(ast, block) { argument
146 if (!block || !block.nodes.length) return ast;
148 ast = walk(ast, null, function (node, replace) {
169 defaultYieldLocation(ast).nodes.push(block);
171 return ast;
174 function checkExtendPosition(ast, hasExtends) { argument
176 walk(ast, function (node) {