Closed cuonglm closed 5 years ago
Sorry for the late reply, I was on holidays. Will take a look at this soon, thanks for reporting!
Ok, here is the problem:
Some Python nodes doesn't add the correct positions, Call
being one of them. We fix them with a light tokenizing pass by finding the token positions and updating the node ones, but in this case the node doesn't have a token since it's a "Containing" or virtual one, so you need to get the position of the Call
token which you can get with:
nodes = bblfsh.filter(uast, "//*[@roleCall and @roleIdentifier]")
Or, if you want to only show non empty tokens:
nodes = bblfsh.filter(uast, "//*[@roleCall and @roleIdentifier and string-length(@token) > 0]")
With a
test.py
file:Parsing with bblfsh server:
Output: