From 90d6ff7d1849ef7b1a0e22c318c6c91a3ec5ea97 Mon Sep 17 00:00:00 2001 From: Riyyi Date: Sun, 2 Apr 2023 11:05:01 +0200 Subject: [PATCH] Printer: Pass along readably flag during recursion --- src/printer.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/printer.cpp b/src/printer.cpp index edba587..83ed249 100644 --- a/src/printer.cpp +++ b/src/printer.cpp @@ -78,7 +78,7 @@ void Printer::printImpl(ASTNodePtr node, bool print_readably) m_previous_node_is_list = true; auto nodes = std::static_pointer_cast(node)->nodes(); for (auto node : nodes) { - printImpl(node); + printImpl(node, print_readably); m_previous_node_is_list = false; } m_print += ')'; @@ -90,7 +90,7 @@ void Printer::printImpl(ASTNodePtr node, bool print_readably) m_previous_node_is_list = true; auto nodes = std::static_pointer_cast(node)->nodes(); for (auto node : nodes) { - printImpl(node); + printImpl(node, print_readably); m_previous_node_is_list = false; } m_print += ']'; @@ -103,7 +103,7 @@ void Printer::printImpl(ASTNodePtr node, bool print_readably) auto elements = std::static_pointer_cast(node)->elements(); for (auto it = elements.begin(); it != elements.end(); ++it) { m_print += format("{} ", it->first.front() == 0x7f ? ":" + it->first.substr(1) : it->first); // 127 - printImpl(it->second); + printImpl(it->second, print_readably); if (isLast(it, elements)) { m_print += ' ';