mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-08-05 15:49:11 +00:00
Shell: Make the parser read consecutive sequences without recursing
This fixes (the easy) part of #4976.
This commit is contained in:
parent
212c90d68f
commit
2bd77bc93b
Notes:
sideshowbarker
2024-07-18 22:57:04 +09:00
Author: https://github.com/alimpfard
Commit: 2bd77bc93b
Pull-request: https://github.com/SerenityOS/serenity/pull/4981
Issue: https://github.com/SerenityOS/serenity/issues/4976
Reviewed-by: https://github.com/awesomekling
7 changed files with 130 additions and 100 deletions
|
@ -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);
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue