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:
parent
6d17fe38a4
commit
f9d3055691
4 changed files with 24 additions and 7 deletions
|
@ -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
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue