refactor StaticInitializer into it's own class

This commit is contained in:
Erik Krogh Kristensen
2021-09-03 10:15:36 +02:00
parent 23e28ae5d4
commit e3ed6c2523
12 changed files with 112 additions and 37 deletions

View File

@@ -4,18 +4,18 @@ import java.util.List;
/** The body of a {@linkplain ClassDeclaration} or {@linkplain ClassExpression}. */
public class ClassBody extends Node {
private final List<Node> body; // either MemberDefinition or BlockStatement (static initialization blocks)
private final List<MemberDefinition<?>> body;
public ClassBody(SourceLocation loc, List<Node> body) {
public ClassBody(SourceLocation loc, List<MemberDefinition<?>> body) {
super("ClassBody", loc);
this.body = body;
}
public List<Node> getBody() {
public List<MemberDefinition<?>> getBody() {
return body;
}
public void addMember(Node md) {
public void addMember(MemberDefinition<?> md) {
body.add(md);
}