Shell: Allow appending empty string literals

Otherwise, we just silently drop arguments that are empty strings.
This commit is contained in:
Tim Schumacher 2023-03-23 14:01:42 +01:00 committed by Ali Mohammad Pur
parent c26639eac2
commit 46c22ee49d
Notes: sideshowbarker 2024-07-16 22:14:49 +09:00

View File

@ -1435,9 +1435,6 @@ ErrorOr<RefPtr<AST::Node>> Parser::parse_word()
};
auto append_string_literal = [&](StringView string) -> ErrorOr<void> {
if (string.is_empty())
return {};
auto node = make_ref_counted<AST::StringLiteral>(
token.position.value_or(empty_position()),
TRY(String::from_utf8(string)),
@ -1457,9 +1454,6 @@ ErrorOr<RefPtr<AST::Node>> Parser::parse_word()
};
auto append_string_part = [&](StringView string) -> ErrorOr<void> {
if (string.is_empty())
return {};
auto node = make_ref_counted<AST::StringLiteral>(
token.position.value_or(empty_position()),
TRY(String::from_utf8(string)),