mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-08-09 09:39:39 +00:00
Shell: Correctly handle commands after heredoc contents
Previously we did not emit a newline after the ending heredoc key, which wreaked havoc on the parser logic, leading to parse errors.
This commit is contained in:
parent
93413f8682
commit
7b031138fc
Notes:
sideshowbarker
2024-07-17 07:43:44 +09:00
Author: https://github.com/alimpfard
Commit: 7b031138fc
Pull-request: https://github.com/SerenityOS/serenity/pull/18429
Reviewed-by: https://github.com/nico ✅
4 changed files with 11 additions and 1 deletions
|
@ -698,6 +698,9 @@ ErrorOr<RefPtr<AST::Node>> Parser::parse_list()
|
|||
|
||||
ErrorOr<RefPtr<AST::Node>> Parser::parse_and_or()
|
||||
{
|
||||
while (peek().type == Token::Type::Newline)
|
||||
skip();
|
||||
|
||||
auto node = TRY(parse_pipeline());
|
||||
if (!node)
|
||||
return RefPtr<AST::Node> {};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue