Skip to content

Commit

Permalink
Shell: Ignore leading semicolons
Browse files Browse the repository at this point in the history
This makes things like `foo&; bar` behave as expected.
Such behaviour is actually closer to the grammar defined in Parser.h
anyway :P
  • Loading branch information
alimpfard authored and awesomekling committed Jul 27, 2020
1 parent 335916d commit 5830874
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion Shell/Parser.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ RefPtr<AST::Node> Parser::parse_toplevel()

RefPtr<AST::Node> Parser::parse_sequence()
{
consume_while(is_any_of(" \t\n"));
consume_while(is_any_of(" \t\n;")); // ignore whitespaces or terminators without effect.

auto rule_start = push_start();
auto var_decls = parse_variable_decls();
Expand Down

0 comments on commit 5830874

Please sign in to comment.