diff options
Diffstat (limited to 'src/ast/nodes/TestlistCompNode.java')
-rw-r--r-- | src/ast/nodes/TestlistCompNode.java | 21 |
1 files changed, 19 insertions, 2 deletions
diff --git a/src/ast/nodes/TestlistCompNode.java b/src/ast/nodes/TestlistCompNode.java index e55f854..024d742 100644 --- a/src/ast/nodes/TestlistCompNode.java +++ b/src/ast/nodes/TestlistCompNode.java @@ -72,12 +72,29 @@ public class TestlistCompNode implements Node { } @Override - public String toPrint(String prefix) { + public String printAST(String prefix) { String str = prefix + "Testlist_comp\n"; prefix += " "; for (var param : exprs) { - str += param.toPrint(prefix); + str += param.printAST(prefix); + } + + return str; + } + + @Override + public String toPrint(String prefix) { + String str = prefix; + + str += exprs.get(0).toPrint(""); + + if (comp != null) { + str += comp.toPrint(""); + } else { + for (int i = 1; i < exprs.size(); i++) { + str += ", " + exprs.get(i).toPrint(""); + } } return str; |