Closed henshin closed 8 years ago
I think there is an issue with the attributes exposed by the Cast
tree node, but I can find the method invocation within the selectors
attribute of the expression,
>>> s = 'class Foo { public void setTest(final Valvel valve) {((Valvel)valve).stop(); }}'
>>> cu = javalang.parse.parse(s)
>>> cu.types[0].methods[0].body[0].expression.selectors[0]
MethodInvocation
I didn't knew about the selectors trick :) I was able to fix my code with your suggestion. Thank you!
Hi!
I was trying to use your parse to parse some Java code, but I noticed a problem in the parser. Here's a sample piece of code:
If you parse this code with the library, it will not recognize the
stop
method invocation. In fact anything after the Cast seems to be ignored, including any arguments passed to the stop method. Here's an output of the tree:Do you know why this happens?
Thank you