-
|
Please, I don't get well this query: from CallNode call
where call.getAChild*().(AttrNode).getName().matches("%path")
select call, "call" It seems that it searches for all call expressions, like |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
|
call(x.foo) # no match
call(x.path) # match
call(x.foo.path) # match
call(x.mypath) # match |
Beta Was this translation helpful? Give feedback.
x.getAChild()will give you you an immediate AST child ofx.x.getAChild*()gives you the reflexive, transitive children ofx(that is, includingxitself).(AttrNode).getName().matches("%path")will match any attribute expressionfoo.barwherebarends withpath. So, in summary, you will get all calls where somewhere inside one of the arguments (or the receiver) there is an attribute expression that accesses an attribute whose name ends withpath, e.g.