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

Shell: Do not treat the ending newline as part of a comment

This allows the parser to finally parse the entire source into a single
AST.
As a result of allowing comments inside sequences, Sequence is also
marked as would_execute if its left or right node would.
This commit is contained in:
AnotherTest 2020-07-05 19:48:26 +04:30 committed by Andreas Kling
parent 6d17fe38a4
commit f9d3055691
4 changed files with 24 additions and 7 deletions

View file

@ -699,6 +699,7 @@ private:
virtual HitTestResult hit_test_position(size_t) override;
virtual String class_name() const override { return "Sequence"; }
virtual bool is_list() const override { return true; }
virtual bool would_execute() const override { return m_left->would_execute() || m_right->would_execute(); }
RefPtr<Node> m_left;
RefPtr<Node> m_right;