Community
Participate
Working Groups
test case public class Test { int i; ; // <--- AST didn't visit this node }
I will investigate. The problem can be that this empty class body declaration doesn't appear at all in the resulting AST.
Just to be clear, this semi-colon is not an empty statement, but an empty class body declaration. For now we don't have a corresponding node in the tree, because this semi-colon is useless. I'll see what it takes to add it into the tree.
Add CC'
There are a few places in the Java language where syntactic constructs are not rendered in the AST (e.g., position of "[]" for method return type; extra "," after the last expression in an array initializer). The reason there is no node for empty class body declarations is, as Olivier points out, they are semantically useless and play no role in how programs are interpreted. Like whitespace, it is a lexical fact of the program that is simply not accounted for at the AST level.
Change milestone.