Lines Matching refs:ast
24 function walk(ast, func, depthFirst) { argument
25 if (!(ast instanceof nodes.Node)) {
26 return ast;
29 var astT = func(ast);
30 if (astT && astT !== ast) {
34 if (ast instanceof nodes.NodeList) {
35 var children = mapCOW(ast.children, function (node) {
38 if (children !== ast.children) {
39 ast = new nodes[ast.typename](ast.lineno, ast.colno, children);
41 } else if (ast instanceof nodes.CallExtension) {
42 var args = walk(ast.args, func, depthFirst);
43 var contentArgs = mapCOW(ast.contentArgs, function (node) {
46 if (args !== ast.args || contentArgs !== ast.contentArgs) {
47 ast = new nodes[ast.typename](ast.extName, ast.prop, args, contentArgs);
50 var props = ast.fields.map(function (field) {
51 return ast[field];
57 ast = new nodes[ast.typename](ast.lineno, ast.colno);
59 ast[ast.fields[i]] = prop;
63 return depthFirst ? func(ast) || ast : ast;
65 function depthWalk(ast, func) { argument
66 return walk(ast, func, true);
92 function liftFilters(ast, asyncFilters) { argument
93 return depthWalk(ast, function (node) {
109 function liftSuper(ast) { argument
110 return walk(ast, function (blockNode) {
128 function convertStatements(ast) { argument
129 return depthWalk(ast, function (node) {
152 function cps(ast, asyncFilters) { argument
153 return convertStatements(liftSuper(liftFilters(ast, asyncFilters)));
155 function transform(ast, asyncFilters) { argument
156 return cps(ast, asyncFilters || []);