Skip to content

Commit

Permalink
Shell: Fix parse mistake in '&&' not being recursive
Browse files Browse the repository at this point in the history
  • Loading branch information
alimpfard authored and awesomekling committed Jul 30, 2020
1 parent 4be2cb8 commit c4888f4
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions Shell/Parser.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -301,11 +301,11 @@ RefPtr<AST::Node> Parser::parse_and_logical_sequence()
return pipe_sequence;
}

auto right_pipe_sequence = parse_pipe_sequence();
if (!right_pipe_sequence)
right_pipe_sequence = create<AST::SyntaxError>("Expected an expression after '&&'");
auto right_and_sequence = parse_and_logical_sequence();
if (!right_and_sequence)
right_and_sequence = create<AST::SyntaxError>("Expected an expression after '&&'");

return create<AST::And>(create<AST::Execute>(move(pipe_sequence)), create<AST::Execute>(move(right_pipe_sequence)));
return create<AST::And>(create<AST::Execute>(move(pipe_sequence)), create<AST::Execute>(move(right_and_sequence)));
}

RefPtr<AST::Node> Parser::parse_pipe_sequence()
Expand Down

0 comments on commit c4888f4

Please sign in to comment.