Lines Matching refs:node

19 function simple(node, visitors, base, state, override) {  argument
21 ;(function c(node, st, override) { argument
22 var type = override || node.type, found = visitors[type]
23 base[type](node, st, c)
24 if (found) found(node, st)
25 })(node, state, override)
31 function ancestor(node, visitors, base, state) { argument
34 ;(function c(node, st, override) { argument
35 var type = override || node.type, found = visitors[type]
36 var isNew = node != ancestors[ancestors.length - 1]
37 if (isNew) ancestors.push(node)
38 base[type](node, st, c)
39 if (found) found(node, st || ancestors, ancestors)
41 })(node, state)
49 function recursive(node, state, funcs, base, override) { argument
51 ;(function c(node, st, override) { argument
52 visitor[override || node.type](node, st, c)
53 })(node, state, override)
65 var Found = function Found(node, state) { this.node = node; this.state = state }; argument
70 function findNodeAt(node, start, end, test, base, state) { argument
74 ;(function c(node, st, override) { argument
75 var type = override || node.type
76 if ((start == null || node.start <= start) &&
77 (end == null || node.end >= end))
78 base[type](node, st, c)
79 if ((start == null || node.start == start) &&
80 (end == null || node.end == end) &&
81 test(type, node))
82 throw new Found(node, st)
83 })(node, state)
92 function findNodeAround(node, pos, test, base, state) { argument
96 ;(function c(node, st, override) { argument
97 var type = override || node.type
98 if (node.start > pos || node.end < pos) return
99 base[type](node, st, c)
100 if (test(type, node)) throw new Found(node, st)
101 })(node, state)
109 function findNodeAfter(node, pos, test, base, state) { argument
113 ;(function c(node, st, override) { argument
114 if (node.end < pos) return
115 var type = override || node.type
116 if (node.start >= pos && test(type, node)) throw new Found(node, st)
117 base[type](node, st, c)
118 })(node, state)
126 function findNodeBefore(node, pos, test, base, state) { argument
130 ;(function c(node, st, override) { argument
131 if (node.start > pos) return
132 var type = override || node.type
133 if (node.end <= pos && (!max || max.node.end < node.end) && test(type, node))
134 max = new Found(node, st)
135 base[type](node, st, c)
136 })(node, state)
156 function skipThrough(node, st, c) { c(node, st) } argument
163 base.Program = base.BlockStatement = function (node, st, c) {
164 for (var i = 0; i < node.body.length; ++i)
165 c(node.body[i], st, "Statement")
170 function (node, st, c) { return c(node.expression, st, "Expression"); }
171 base.IfStatement = function (node, st, c) { argument
172 c(node.test, st, "Expression")
173 c(node.consequent, st, "Statement")
174 if (node.alternate) c(node.alternate, st, "Statement")
176 base.LabeledStatement = function (node, st, c) { return c(node.body, st, "Statement"); } argument
178 base.WithStatement = function (node, st, c) { argument
179 c(node.object, st, "Expression")
180 c(node.body, st, "Statement")
182 base.SwitchStatement = function (node, st, c) { argument
183 c(node.discriminant, st, "Expression")
184 for (var i = 0; i < node.cases.length; ++i) {
185 var cs = node.cases[i]
191 base.ReturnStatement = base.YieldExpression = base.AwaitExpression = function (node, st, c) {
192 if (node.argument) c(node.argument, st, "Expression")
195 function (node, st, c) { return c(node.argument, st, "Expression"); }
196 base.TryStatement = function (node, st, c) { argument
197 c(node.block, st, "Statement")
198 if (node.handler) c(node.handler, st)
199 if (node.finalizer) c(node.finalizer, st, "Statement")
201 base.CatchClause = function (node, st, c) { argument
202 c(node.param, st, "Pattern")
203 c(node.body, st, "ScopeBody")
205 base.WhileStatement = base.DoWhileStatement = function (node, st, c) {
206 c(node.test, st, "Expression")
207 c(node.body, st, "Statement")
209 base.ForStatement = function (node, st, c) { argument
210 if (node.init) c(node.init, st, "ForInit")
211 if (node.test) c(node.test, st, "Expression")
212 if (node.update) c(node.update, st, "Expression")
213 c(node.body, st, "Statement")
215 base.ForInStatement = base.ForOfStatement = function (node, st, c) {
216 c(node.left, st, "ForInit")
217 c(node.right, st, "Expression")
218 c(node.body, st, "Statement")
220 base.ForInit = function (node, st, c) { argument
221 if (node.type == "VariableDeclaration") c(node, st)
222 else c(node, st, "Expression")
226 base.FunctionDeclaration = function (node, st, c) { return c(node, st, "Function"); } argument
227 base.VariableDeclaration = function (node, st, c) { argument
228 for (var i = 0; i < node.declarations.length; ++i)
229 c(node.declarations[i], st)
231 base.VariableDeclarator = function (node, st, c) { argument
232 c(node.id, st, "Pattern")
233 if (node.init) c(node.init, st, "Expression")
236 base.Function = function (node, st, c) { argument
237 if (node.id) c(node.id, st, "Pattern")
238 for (var i = 0; i < node.params.length; i++)
239 c(node.params[i], st, "Pattern")
240 c(node.body, st, node.expression ? "ScopeExpression" : "ScopeBody")
244 base.ScopeBody = function (node, st, c) { return c(node, st, "Statement"); } argument
245 base.ScopeExpression = function (node, st, c) { return c(node, st, "Expression"); } argument
247 base.Pattern = function (node, st, c) { argument
248 if (node.type == "Identifier")
249 c(node, st, "VariablePattern")
250 else if (node.type == "MemberExpression")
251 c(node, st, "MemberPattern")
253 c(node, st)
257 base.RestElement = function (node, st, c) { return c(node.argument, st, "Pattern"); } argument
258 base.ArrayPattern = function (node, st, c) { argument
259 for (var i = 0; i < node.elements.length; ++i) {
260 var elt = node.elements[i]
264 base.ObjectPattern = function (node, st, c) { argument
265 for (var i = 0; i < node.properties.length; ++i)
266 c(node.properties[i].value, st, "Pattern")
271 base.ArrayExpression = function (node, st, c) { argument
272 for (var i = 0; i < node.elements.length; ++i) {
273 var elt = node.elements[i]
277 base.ObjectExpression = function (node, st, c) { argument
278 for (var i = 0; i < node.properties.length; ++i)
279 c(node.properties[i], st)
282 base.SequenceExpression = base.TemplateLiteral = function (node, st, c) {
283 for (var i = 0; i < node.expressions.length; ++i)
284 c(node.expressions[i], st, "Expression")
286 base.UnaryExpression = base.UpdateExpression = function (node, st, c) {
287 c(node.argument, st, "Expression")
289 base.BinaryExpression = base.LogicalExpression = function (node, st, c) {
290 c(node.left, st, "Expression")
291 c(node.right, st, "Expression")
293 base.AssignmentExpression = base.AssignmentPattern = function (node, st, c) {
294 c(node.left, st, "Pattern")
295 c(node.right, st, "Expression")
297 base.ConditionalExpression = function (node, st, c) { argument
298 c(node.test, st, "Expression")
299 c(node.consequent, st, "Expression")
300 c(node.alternate, st, "Expression")
302 base.NewExpression = base.CallExpression = function (node, st, c) {
303 c(node.callee, st, "Expression")
304 if (node.arguments) for (var i = 0; i < node.arguments.length; ++i)
305 c(node.arguments[i], st, "Expression")
307 base.MemberExpression = function (node, st, c) { argument
308 c(node.object, st, "Expression")
309 if (node.computed) c(node.property, st, "Expression")
311 base.ExportNamedDeclaration = base.ExportDefaultDeclaration = function (node, st, c) {
312 if (node.declaration)
313 …c(node.declaration, st, node.type == "ExportNamedDeclaration" || node.declaration.id ? "Statement"…
314 if (node.source) c(node.source, st, "Expression")
316 base.ExportAllDeclaration = function (node, st, c) { argument
317 c(node.source, st, "Expression")
319 base.ImportDeclaration = function (node, st, c) { argument
320 for (var i = 0; i < node.specifiers.length; i++)
321 c(node.specifiers[i], st)
322 c(node.source, st, "Expression")
326 base.TaggedTemplateExpression = function (node, st, c) { argument
327 c(node.tag, st, "Expression")
328 c(node.quasi, st)
330 base.ClassDeclaration = base.ClassExpression = function (node, st, c) { return c(node, st, "Class")…
331 base.Class = function (node, st, c) { argument
332 if (node.id) c(node.id, st, "Pattern")
333 if (node.superClass) c(node.superClass, st, "Expression")
334 for (var i = 0; i < node.body.body.length; i++)
335 c(node.body.body[i], st)
337 base.MethodDefinition = base.Property = function (node, st, c) {
338 if (node.computed) c(node.key, st, "Expression")
339 c(node.value, st, "Expression")