Details
Description
The AST Browser displays ASTs for code in GroovyConsole.
EmptyStatement nodes do not show up in the tree. There are 2 ways to create an empty statement:
// the TryCatchStatement will have a finallyBlock field that is of type EmptyStatement
def x
try {
x = 1
} catch (IOException ei) {
x = 2
}
// the IfStatement will have an elseBlock field that is of type EmptyStatement.
if (true) 1
2
To fix this we can add visitEmptyStatement to GroovyCodeVisitor and its subclasses.
Or we can handle it as a special case in the AST Browser code.