mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-06-16 23:31:55 +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
|
@ -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
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue