Lines Matching refs:node

25 function simple(node, visitors, base, state, override) {  argument
27 ;(function c(node, st, override) { argument
28 var type = override || node.type, found = visitors[type]
29 base[type](node, st, c)
30 if (found) found(node, st)
31 })(node, state, override)
37 function ancestor(node, visitors, base, state) { argument
40 ;(function c(node, st, override) { argument
41 var type = override || node.type, found = visitors[type]
42 var isNew = node != ancestors[ancestors.length - 1]
43 if (isNew) ancestors.push(node)
44 base[type](node, st, c)
45 if (found) found(node, st || ancestors, ancestors)
47 })(node, state)
55 function recursive(node, state, funcs, base, override) { argument
57 ;(function c(node, st, override) { argument
58 visitor[override || node.type](node, st, c)
59 })(node, state, override)
71 var Found = function Found(node, state) { this.node = node; this.state = state }; argument
76 function findNodeAt(node, start, end, test, base, state) { argument
80 ;(function c(node, st, override) { argument
81 var type = override || node.type
82 if ((start == null || node.start <= start) &&
83 (end == null || node.end >= end))
84 base[type](node, st, c)
85 if ((start == null || node.start == start) &&
86 (end == null || node.end == end) &&
87 test(type, node))
88 throw new Found(node, st)
89 })(node, state)
98 function findNodeAround(node, pos, test, base, state) { argument
102 ;(function c(node, st, override) { argument
103 var type = override || node.type
104 if (node.start > pos || node.end < pos) return
105 base[type](node, st, c)
106 if (test(type, node)) throw new Found(node, st)
107 })(node, state)
115 function findNodeAfter(node, pos, test, base, state) { argument
119 ;(function c(node, st, override) { argument
120 if (node.end < pos) return
121 var type = override || node.type
122 if (node.start >= pos && test(type, node)) throw new Found(node, st)
123 base[type](node, st, c)
124 })(node, state)
132 function findNodeBefore(node, pos, test, base, state) { argument
136 ;(function c(node, st, override) { argument
137 if (node.start > pos) return
138 var type = override || node.type
139 if (node.end <= pos && (!max || max.node.end < node.end) && test(type, node))
140 max = new Found(node, st)
141 base[type](node, st, c)
142 })(node, state)
162 function skipThrough(node, st, c) { c(node, st) } argument
169 base.Program = base.BlockStatement = function (node, st, c) {
170 for (var i = 0; i < node.body.length; ++i)
171 c(node.body[i], st, "Statement")
176 function (node, st, c) { return c(node.expression, st, "Expression"); }
177 base.IfStatement = function (node, st, c) { argument
178 c(node.test, st, "Expression")
179 c(node.consequent, st, "Statement")
180 if (node.alternate) c(node.alternate, st, "Statement")
182 base.LabeledStatement = function (node, st, c) { return c(node.body, st, "Statement"); } argument
184 base.WithStatement = function (node, st, c) { argument
185 c(node.object, st, "Expression")
186 c(node.body, st, "Statement")
188 base.SwitchStatement = function (node, st, c) { argument
189 c(node.discriminant, st, "Expression")
190 for (var i = 0; i < node.cases.length; ++i) {
191 var cs = node.cases[i]
197 base.ReturnStatement = base.YieldExpression = base.AwaitExpression = function (node, st, c) {
198 if (node.argument) c(node.argument, st, "Expression")
201 function (node, st, c) { return c(node.argument, st, "Expression"); }
202 base.TryStatement = function (node, st, c) { argument
203 c(node.block, st, "Statement")
204 if (node.handler) c(node.handler, st)
205 if (node.finalizer) c(node.finalizer, st, "Statement")
207 base.CatchClause = function (node, st, c) { argument
208 c(node.param, st, "Pattern")
209 c(node.body, st, "ScopeBody")
211 base.WhileStatement = base.DoWhileStatement = function (node, st, c) {
212 c(node.test, st, "Expression")
213 c(node.body, st, "Statement")
215 base.ForStatement = function (node, st, c) { argument
216 if (node.init) c(node.init, st, "ForInit")
217 if (node.test) c(node.test, st, "Expression")
218 if (node.update) c(node.update, st, "Expression")
219 c(node.body, st, "Statement")
221 base.ForInStatement = base.ForOfStatement = function (node, st, c) {
222 c(node.left, st, "ForInit")
223 c(node.right, st, "Expression")
224 c(node.body, st, "Statement")
226 base.ForInit = function (node, st, c) { argument
227 if (node.type == "VariableDeclaration") c(node, st)
228 else c(node, st, "Expression")
232 base.FunctionDeclaration = function (node, st, c) { return c(node, st, "Function"); } argument
233 base.VariableDeclaration = function (node, st, c) { argument
234 for (var i = 0; i < node.declarations.length; ++i)
235 c(node.declarations[i], st)
237 base.VariableDeclarator = function (node, st, c) { argument
238 c(node.id, st, "Pattern")
239 if (node.init) c(node.init, st, "Expression")
242 base.Function = function (node, st, c) { argument
243 if (node.id) c(node.id, st, "Pattern")
244 for (var i = 0; i < node.params.length; i++)
245 c(node.params[i], st, "Pattern")
246 c(node.body, st, node.expression ? "ScopeExpression" : "ScopeBody")
250 base.ScopeBody = function (node, st, c) { return c(node, st, "Statement"); } argument
251 base.ScopeExpression = function (node, st, c) { return c(node, st, "Expression"); } argument
253 base.Pattern = function (node, st, c) { argument
254 if (node.type == "Identifier")
255 c(node, st, "VariablePattern")
256 else if (node.type == "MemberExpression")
257 c(node, st, "MemberPattern")
259 c(node, st)
263 base.RestElement = function (node, st, c) { return c(node.argument, st, "Pattern"); } argument
264 base.ArrayPattern = function (node, st, c) { argument
265 for (var i = 0; i < node.elements.length; ++i) {
266 var elt = node.elements[i]
270 base.ObjectPattern = function (node, st, c) { argument
271 for (var i = 0; i < node.properties.length; ++i)
272 c(node.properties[i].value, st, "Pattern")
277 base.ArrayExpression = function (node, st, c) { argument
278 for (var i = 0; i < node.elements.length; ++i) {
279 var elt = node.elements[i]
283 base.ObjectExpression = function (node, st, c) { argument
284 for (var i = 0; i < node.properties.length; ++i)
285 c(node.properties[i], st)
288 base.SequenceExpression = base.TemplateLiteral = function (node, st, c) {
289 for (var i = 0; i < node.expressions.length; ++i)
290 c(node.expressions[i], st, "Expression")
292 base.UnaryExpression = base.UpdateExpression = function (node, st, c) {
293 c(node.argument, st, "Expression")
295 base.BinaryExpression = base.LogicalExpression = function (node, st, c) {
296 c(node.left, st, "Expression")
297 c(node.right, st, "Expression")
299 base.AssignmentExpression = base.AssignmentPattern = function (node, st, c) {
300 c(node.left, st, "Pattern")
301 c(node.right, st, "Expression")
303 base.ConditionalExpression = function (node, st, c) { argument
304 c(node.test, st, "Expression")
305 c(node.consequent, st, "Expression")
306 c(node.alternate, st, "Expression")
308 base.NewExpression = base.CallExpression = function (node, st, c) {
309 c(node.callee, st, "Expression")
310 if (node.arguments) for (var i = 0; i < node.arguments.length; ++i)
311 c(node.arguments[i], st, "Expression")
313 base.MemberExpression = function (node, st, c) { argument
314 c(node.object, st, "Expression")
315 if (node.computed) c(node.property, st, "Expression")
317 base.ExportNamedDeclaration = base.ExportDefaultDeclaration = function (node, st, c) {
318 if (node.declaration)
319 …c(node.declaration, st, node.type == "ExportNamedDeclaration" || node.declaration.id ? "Statement"…
320 if (node.source) c(node.source, st, "Expression")
322 base.ExportAllDeclaration = function (node, st, c) { argument
323 c(node.source, st, "Expression")
325 base.ImportDeclaration = function (node, st, c) { argument
326 for (var i = 0; i < node.specifiers.length; i++)
327 c(node.specifiers[i], st)
328 c(node.source, st, "Expression")
332 base.TaggedTemplateExpression = function (node, st, c) { argument
333 c(node.tag, st, "Expression")
334 c(node.quasi, st)
336 base.ClassDeclaration = base.ClassExpression = function (node, st, c) { return c(node, st, "Class")…
337 base.Class = function (node, st, c) { argument
338 if (node.id) c(node.id, st, "Pattern")
339 if (node.superClass) c(node.superClass, st, "Expression")
340 for (var i = 0; i < node.body.body.length; i++)
341 c(node.body.body[i], st)
343 base.MethodDefinition = base.Property = function (node, st, c) {
344 if (node.computed) c(node.key, st, "Expression")
345 c(node.value, st, "Expression")