Closed Algy closed 10 years ago
Should I have sent the pull request pointing to a commit, not a branch?
Thanks for the patch.
A lot of names actually cannot get resolved during parse time and require an additional pass that ascribes some meaning to that name. Looking at your example: Is System
a package or a class? Is out
an inner class of System
or a field? I guess that's the reason why such expressions are always parsed as they currently are.
However you're probably right in that the last part of a name directly preceding parentheses is always a method name. I'm going to look into this.
Well, I guess your version is better. I'm still not 100% sure whether it will hold forever because according to the Spec the name before the open parenthesis is just that: a (ambiguous) name. It is disambiguated in a later phase. If either disambiguation rules or the grammar change, this may have to be looked at again.
Thanks for your time!
When parsing 'System.out.println("Yeay!")', We should get MethodInvocation(name='println', target=Name('System.out'), ...), not MethodInvocation(name=Name('System.out.println'), target=None).
Unfortunately, It parses the expression into the latter one. I fixed it.