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
commit f9d3055691
Notes: sideshowbarker 2024-07-19 05:07:07 +09:00
4 changed files with 24 additions and 7 deletions

View file

@ -717,9 +717,6 @@ RefPtr<AST::Node> Parser::parse_comment()
consume();
auto text = consume_while(is_not('\n'));
if (peek() == '\n')
consume();
return create<AST::Comment>(move(text)); // Comment
}