1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 08:58:11 +00:00

Shell: Make the parser read consecutive sequences without recursing

This fixes (the easy) part of #4976.
This commit is contained in:
AnotherTest 2021-01-16 23:20:52 +03:30 committed by Andreas Kling
parent 212c90d68f
commit 2bd77bc93b
7 changed files with 130 additions and 100 deletions

View file

@ -631,10 +631,17 @@ void Formatter::visit(const AST::Sequence* node)
test_and_update_output_cursor(node);
TemporaryChange<const AST::Node*> parent { m_parent_node, node };
node->left()->visit(*this);
insert_separator();
node->right()->visit(*this);
bool first = true;
for (auto& entry : node->entries()) {
if (first)
first = false;
else
insert_separator();
entry.visit(*this);
}
visited(node);
}