1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 17:57:35 +00:00

Everywhere: Rename to_{string => deprecated_string}() where applicable

This will make it easier to support both string types at the same time
while we convert code, and tracking down remaining uses.

One big exception is Value::to_string() in LibJS, where the name is
dictated by the ToString AO.
This commit is contained in:
Linus Groh 2022-12-06 01:12:49 +00:00 committed by Andreas Kling
parent 6e19ab2bbc
commit 57dc179b1f
597 changed files with 1973 additions and 1972 deletions

View file

@ -11,7 +11,7 @@
#include <AK/ScopeLogger.h>
#include <LibCpp/Lexer.h>
#define LOG_SCOPE() ScopeLogger<CPP_DEBUG> logger(DeprecatedString::formatted("'{}' - {} ({})", peek().text(), peek().type_as_string(), m_state.token_index))
#define LOG_SCOPE() ScopeLogger<CPP_DEBUG> logger(DeprecatedString::formatted("'{}' - {} ({})", peek().text(), peek().type_as_deprecated_string(), m_state.token_index))
namespace Cpp {
@ -22,7 +22,7 @@ Parser::Parser(Vector<Token> tokens, DeprecatedString const& filename)
if constexpr (CPP_DEBUG) {
dbgln("Tokens:");
for (size_t i = 0; i < m_tokens.size(); ++i) {
dbgln("{}- {}", i, m_tokens[i].to_string());
dbgln("{}- {}", i, m_tokens[i].to_deprecated_string());
}
}
}
@ -579,7 +579,7 @@ NonnullRefPtr<Expression> Parser::parse_secondary_expression(ASTNode& parent, No
return func;
}
default: {
error(DeprecatedString::formatted("unexpected operator for expression. operator: {}", peek().to_string()));
error(DeprecatedString::formatted("unexpected operator for expression. operator: {}", peek().to_deprecated_string()));
auto token = consume();
return create_ast_node<InvalidExpression>(parent, token.start(), token.end());
}
@ -880,7 +880,7 @@ DeprecatedString Parser::text_in_range(Position start, Position end) const
for (auto token : tokens_in_range(start, end)) {
builder.append(token.text());
}
return builder.to_string();
return builder.to_deprecated_string();
}
Vector<Token> Parser::tokens_in_range(Position start, Position end) const
@ -1008,7 +1008,7 @@ Optional<size_t> Parser::index_of_token_at(Position pos) const
void Parser::print_tokens() const
{
for (auto& token : m_tokens) {
outln("{}", token.to_string());
outln("{}", token.to_deprecated_string());
}
}
@ -1110,7 +1110,7 @@ Token Parser::consume_keyword(DeprecatedString const& keyword)
{
auto token = consume();
if (token.type() != Token::Type::Keyword) {
error(DeprecatedString::formatted("unexpected token: {}, expected Keyword", token.to_string()));
error(DeprecatedString::formatted("unexpected token: {}, expected Keyword", token.to_deprecated_string()));
return token;
}
if (text_of_token(token) != keyword) {