From 58308748cbc1a75d3c668ddcfe9210be17c05a1e Mon Sep 17 00:00:00 2001 From: AnotherTest Date: Mon, 27 Jul 2020 05:58:41 +0430 Subject: [PATCH] Shell: Ignore leading semicolons This makes things like `foo&; bar` behave as expected. Such behaviour is actually closer to the grammar defined in Parser.h anyway :P --- Shell/Parser.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Shell/Parser.cpp b/Shell/Parser.cpp index 5b964b5602..afab4c6cf1 100644 --- a/Shell/Parser.cpp +++ b/Shell/Parser.cpp @@ -144,7 +144,7 @@ RefPtr Parser::parse_toplevel() RefPtr 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();