2018-06-13 00:39:33 +00:00
|
|
|
package io.github.applecommander.bastools.api.optimizations;
|
2018-05-29 03:33:41 +00:00
|
|
|
|
2018-06-13 00:39:33 +00:00
|
|
|
import io.github.applecommander.bastools.api.Configuration;
|
|
|
|
import io.github.applecommander.bastools.api.model.Statement;
|
2018-05-29 03:33:41 +00:00
|
|
|
|
2018-06-09 16:24:29 +00:00
|
|
|
/** Remove any empty statements during the tree walk. Effective removes double "::"'s. */
|
2018-05-29 03:33:41 +00:00
|
|
|
public class RemoveEmptyStatements extends BaseVisitor {
|
2018-06-09 16:24:29 +00:00
|
|
|
public RemoveEmptyStatements(Configuration config) {
|
|
|
|
// ignored
|
|
|
|
}
|
|
|
|
|
2018-05-29 03:33:41 +00:00
|
|
|
@Override
|
|
|
|
public Statement visit(Statement statement) {
|
|
|
|
return statement.tokens.isEmpty() ? null : statement;
|
|
|
|
}
|
|
|
|
}
|