1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 05:08:13 +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

@ -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
}