From fc712f94a7ed8554d8d44f4965be367354a7e670 Mon Sep 17 00:00:00 2001 From: L0P0P Date: Wed, 26 Jun 2024 10:06:12 +0200 Subject: Using child --- src/ast/nodes/BlockNode.java | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) (limited to 'src/ast/nodes/BlockNode.java') diff --git a/src/ast/nodes/BlockNode.java b/src/ast/nodes/BlockNode.java index 6b07f49..2c85025 100644 --- a/src/ast/nodes/BlockNode.java +++ b/src/ast/nodes/BlockNode.java @@ -9,8 +9,8 @@ import ast.types.*; * It extends the `RootNode`. */ public class BlockNode extends RootNode { - public BlockNode(ArrayList stmts, ArrayList compoundStmts) { - super(stmts, compoundStmts); + public BlockNode(ArrayList childs) { + super(childs); } @Override @@ -23,11 +23,8 @@ public class BlockNode extends RootNode { String str = prefix + "Block\n"; prefix += " "; - for (Node stmt : stmts) { - str += stmt.toPrint(prefix); - } - for (Node stmt : compoundStmts) { - str += stmt.toPrint(prefix); + for (Node child : childs) { + str += child.toPrint(prefix); } return str; -- cgit v1.2.3-18-g5258