1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 13:38:11 +00:00

Userland: Prefer _string over _short_string

As `_string` can't fail anymore (since 3434412), there are no real
benefits to use the short variant in most cases.
This commit is contained in:
Lucas CHOLLET 2023-08-07 22:26:17 -04:00 committed by Andreas Kling
parent a5edc9cdfc
commit 3f35ffb648
198 changed files with 684 additions and 684 deletions

View file

@ -17,7 +17,7 @@
AK_IGNORE_DIAGNOSTIC("-Wshadow", \
auto _error = _value_or_error.release_error();) \
if (_error.is_errno() && _error.code() == ENOMEM) \
return make_ref_counted<AST::SyntaxError>(position, "OOM"_short_string); \
return make_ref_counted<AST::SyntaxError>(position, "OOM"_string); \
return make_ref_counted<AST::SyntaxError>(position, MUST(String::formatted("Error: {}", _error))); \
} \
_value_or_error.release_value(); \
@ -796,7 +796,7 @@ ErrorOr<RefPtr<AST::Node>> Parser::parse_pipe_sequence(bool is_negated)
Vector<NonnullRefPtr<AST::Node>> {
make_ref_counted<AST::BarewordLiteral>(
node->position(),
"not"_short_string),
"not"_string),
*static_cast<AST::CastToCommand&>(*node).inner() }));
}
}
@ -1388,7 +1388,7 @@ ErrorOr<RefPtr<AST::Node>> Parser::parse_for_clause()
name_position = peek().position;
name = consume().value;
} else {
name = "it"_short_string;
name = "it"_string;
error(peek(), "Expected a variable name, not {}", peek().type_name());
}
@ -1926,7 +1926,7 @@ ErrorOr<RefPtr<AST::Node>> Parser::parse_simple_command()
if (!definitions.is_empty()) {
nodes.append(make_ref_counted<AST::BarewordLiteral>(
empty_position(),
"--"_short_string));
"--"_string));
}
// WORD or io_redirect: IO_NUMBER or io_file