Skip to content

Macthes some paths but why ? #10653

Answered by hvitved
Sim4n6 asked this question in Q&A
Discussion options

You must be logged in to vote

x.getAChild() will give you you an immediate AST child of x. x.getAChild*() gives you the reflexive, transitive children of x (that is, including x itself). (AttrNode).getName().matches("%path") will match any attribute expression foo.bar where bar ends with path. 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 with path, e.g.

call(x.foo) # no match
call(x.path) # match
call(x.foo.path) # match
call(x.mypath) # match

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by Sim4n6
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants