mirror of
https://github.com/fish-shell/fish-shell.git
synced 2024-11-26 10:43:47 +08:00
parent
38b95defbd
commit
86707378cc
|
@ -1112,7 +1112,8 @@ class ast_t::populator_t {
|
|||
if (!token.allows_token(peek_token().type)) {
|
||||
const auto &peek = peek_token();
|
||||
if ((flags_ & parse_flag_leave_unterminated) &&
|
||||
peek.tok_error == tokenizer_error_t::unterminated_subshell) {
|
||||
(peek.tok_error == tokenizer_error_t::unterminated_quote ||
|
||||
peek.tok_error == tokenizer_error_t::unterminated_subshell)) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -1140,7 +1141,8 @@ class ast_t::populator_t {
|
|||
const auto &peek = peek_token();
|
||||
|
||||
if ((flags_ & parse_flag_leave_unterminated) &&
|
||||
peek.tok_error == tokenizer_error_t::unterminated_subshell) {
|
||||
(peek.tok_error == tokenizer_error_t::unterminated_quote ||
|
||||
peek.tok_error == tokenizer_error_t::unterminated_subshell)) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
|
@ -4798,6 +4798,10 @@ static void test_new_parser_ad_hoc() {
|
|||
errors.clear();
|
||||
ast = ast_t::parse(L"for x in (", parse_flag_leave_unterminated, &errors);
|
||||
do_test(errors.size() == 1 && errors.at(0).code == parse_error_tokenizer_unterminated_subshell);
|
||||
|
||||
errors.clear();
|
||||
ast = ast_t::parse(L"begin; echo '", parse_flag_leave_unterminated, &errors);
|
||||
do_test(errors.size() == 1 && errors.at(0).code == parse_error_tokenizer_unterminated_quote);
|
||||
}
|
||||
|
||||
static void test_new_parser_errors() {
|
||||
|
|
Loading…
Reference in New Issue
Block a user