1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 03:07:43 +00:00

Shell: Implement leftmost_trivial_literal() for Sequence nodes

This commit is contained in:
Ali Mohammad Pur 2022-03-06 13:04:11 +03:30 committed by Andreas Kling
parent d7d847c8c6
commit c4d9377477
2 changed files with 10 additions and 0 deletions

View file

@ -2736,6 +2736,15 @@ HitTestResult Sequence::hit_test_position(size_t offset) const
return {};
}
RefPtr<Node> Sequence::leftmost_trivial_literal() const
{
for (auto& entry : m_entries) {
if (auto node = entry.leftmost_trivial_literal())
return node;
}
return nullptr;
}
Sequence::Sequence(Position position, NonnullRefPtrVector<Node> entries, Vector<Position> separator_positions)
: Node(move(position))
, m_entries(move(entries))