mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 19:17:44 +00:00
Shell: Implement leftmost_trivial_literal() for Sequence nodes
This commit is contained in:
parent
d7d847c8c6
commit
c4d9377477
2 changed files with 10 additions and 0 deletions
|
@ -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))
|
||||
|
|
|
@ -1183,6 +1183,7 @@ private:
|
|||
virtual HitTestResult hit_test_position(size_t) const override;
|
||||
virtual bool is_list() const override { return true; }
|
||||
virtual bool should_override_execution_in_current_process() const override { return true; }
|
||||
virtual RefPtr<Node> leftmost_trivial_literal() const override;
|
||||
|
||||
NonnullRefPtrVector<Node> m_entries;
|
||||
Vector<Position> m_separator_positions;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue