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
Notes: sideshowbarker 2024-07-18 22:57:04 +09:00
7 changed files with 130 additions and 100 deletions

View file

@ -380,21 +380,19 @@ private:
}
virtual void visit(const AST::Sequence* node) override
{
{
for (auto& entry : node->entries()) {
ScopedValueRollback first_in_command { m_is_first_in_command };
node->left()->visit(*this);
}
{
ScopedValueRollback first_in_command { m_is_first_in_command };
node->right()->visit(*this);
entry.visit(*this);
}
auto& span = span_for_node(node);
span.range.set_start({ node->separator_position().start_line.line_number, node->separator_position().start_line.line_column });
set_offset_range_end(span.range, node->separator_position().end_line);
span.attributes.color = m_palette.syntax_punctuation();
span.attributes.bold = true;
span.is_skippable = true;
for (auto& position : node->separator_positions()) {
auto& span = span_for_node(node);
span.range.set_start({ position.start_line.line_number, position.start_line.line_column });
set_offset_range_end(span.range, position.end_line);
span.attributes.color = m_palette.syntax_punctuation();
span.attributes.bold = true;
span.is_skippable = true;
}
}
virtual void visit(const AST::Subshell* node) override
{