mirror of
https://github.com/RGBCube/serenity
synced 2025-05-30 21:58:10 +00:00
Everywhere: Rename {Deprecated => Byte}String
This commit un-deprecates DeprecatedString, and repurposes it as a byte string. As the null state has already been removed, there are no other particularly hairy blockers in repurposing this type as a byte string (what it _really_ is). This commit is auto-generated: $ xs=$(ack -l \bDeprecatedString\b\|deprecated_string AK Userland \ Meta Ports Ladybird Tests Kernel) $ perl -pie 's/\bDeprecatedString\b/ByteString/g; s/deprecated_string/byte_string/g' $xs $ clang-format --style=file -i \ $(git diff --name-only | grep \.cpp\|\.h) $ gn format $(git ls-files '*.gn' '*.gni')
This commit is contained in:
parent
38d62563b3
commit
5e1499d104
1615 changed files with 10257 additions and 10257 deletions
|
@ -7,7 +7,7 @@
|
|||
|
||||
#include <LibTest/TestCase.h>
|
||||
|
||||
#include <AK/DeprecatedString.h>
|
||||
#include <AK/ByteString.h>
|
||||
#include <AK/HashMap.h>
|
||||
#include <AK/Result.h>
|
||||
#include <AK/StringBuilder.h>
|
||||
|
@ -31,7 +31,7 @@ public:
|
|||
}
|
||||
};
|
||||
|
||||
using ParseResult = AK::Result<NonnullRefPtr<SQL::AST::Expression>, DeprecatedString>;
|
||||
using ParseResult = AK::Result<NonnullRefPtr<SQL::AST::Expression>, ByteString>;
|
||||
|
||||
ParseResult parse(StringView sql)
|
||||
{
|
||||
|
@ -39,7 +39,7 @@ ParseResult parse(StringView sql)
|
|||
auto expression = parser.parse();
|
||||
|
||||
if (parser.has_errors()) {
|
||||
return parser.errors()[0].to_deprecated_string();
|
||||
return parser.errors()[0].to_byte_string();
|
||||
}
|
||||
|
||||
return expression;
|
||||
|
@ -225,14 +225,14 @@ TEST_CASE(binary_operator)
|
|||
StringBuilder builder;
|
||||
builder.append("1 "sv);
|
||||
builder.append(op.key);
|
||||
EXPECT(parse(builder.to_deprecated_string()).is_error());
|
||||
EXPECT(parse(builder.to_byte_string()).is_error());
|
||||
|
||||
builder.clear();
|
||||
|
||||
if (op.key != "+" && op.key != "-") { // "+1" and "-1" are fine (unary operator).
|
||||
builder.append(op.key);
|
||||
builder.append(" 1"sv);
|
||||
EXPECT(parse(builder.to_deprecated_string()).is_error());
|
||||
EXPECT(parse(builder.to_byte_string()).is_error());
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -251,7 +251,7 @@ TEST_CASE(binary_operator)
|
|||
builder.append("1 "sv);
|
||||
builder.append(op.key);
|
||||
builder.append(" 1"sv);
|
||||
validate(builder.to_deprecated_string(), op.value);
|
||||
validate(builder.to_byte_string(), op.value);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -438,12 +438,12 @@ TEST_CASE(match_expression)
|
|||
StringBuilder builder;
|
||||
builder.append("1 "sv);
|
||||
builder.append(op.key);
|
||||
EXPECT(parse(builder.to_deprecated_string()).is_error());
|
||||
EXPECT(parse(builder.to_byte_string()).is_error());
|
||||
|
||||
builder.clear();
|
||||
builder.append(op.key);
|
||||
builder.append(" 1"sv);
|
||||
EXPECT(parse(builder.to_deprecated_string()).is_error());
|
||||
EXPECT(parse(builder.to_byte_string()).is_error());
|
||||
}
|
||||
|
||||
auto validate = [](StringView sql, SQL::AST::MatchOperator expected_operator, bool expected_invert_expression, bool expect_escape) {
|
||||
|
@ -463,19 +463,19 @@ TEST_CASE(match_expression)
|
|||
builder.append("1 "sv);
|
||||
builder.append(op.key);
|
||||
builder.append(" 1"sv);
|
||||
validate(builder.to_deprecated_string(), op.value, false, false);
|
||||
validate(builder.to_byte_string(), op.value, false, false);
|
||||
|
||||
builder.clear();
|
||||
builder.append("1 NOT "sv);
|
||||
builder.append(op.key);
|
||||
builder.append(" 1"sv);
|
||||
validate(builder.to_deprecated_string(), op.value, true, false);
|
||||
validate(builder.to_byte_string(), op.value, true, false);
|
||||
|
||||
builder.clear();
|
||||
builder.append("1 NOT "sv);
|
||||
builder.append(op.key);
|
||||
builder.append(" 1 ESCAPE '+'"sv);
|
||||
validate(builder.to_deprecated_string(), op.value, true, true);
|
||||
validate(builder.to_byte_string(), op.value, true, true);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -598,7 +598,7 @@ TEST_CASE(in_selection_expression)
|
|||
|
||||
TEST_CASE(expression_tree_depth_limit)
|
||||
{
|
||||
auto too_deep_expression = DeprecatedString::formatted("{:+^{}}1", "", SQL::AST::Limits::maximum_expression_tree_depth);
|
||||
auto too_deep_expression = ByteString::formatted("{:+^{}}1", "", SQL::AST::Limits::maximum_expression_tree_depth);
|
||||
EXPECT(!parse(too_deep_expression.substring_view(1)).is_error());
|
||||
EXPECT(parse(too_deep_expression).is_error());
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue