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

AK+Everywhere: Rename FlyString to DeprecatedFlyString

DeprecatedFlyString relies heavily on DeprecatedString's StringImpl, so
let's rename it to A) match the name of DeprecatedString, B) write a new
FlyString class that is tied to String.
This commit is contained in:
Timothy Flynn 2023-01-08 19:23:00 -05:00 committed by Linus Groh
parent 2eacc7aec1
commit f3db548a3d
316 changed files with 1177 additions and 1177 deletions

View file

@ -10,7 +10,7 @@
namespace Web::CSS::Parser {
Declaration::Declaration(FlyString name, Vector<ComponentValue> values, Important important)
Declaration::Declaration(DeprecatedFlyString name, Vector<ComponentValue> values, Important important)
: m_name(move(name))
, m_values(move(values))
, m_important(move(important))

View file

@ -15,7 +15,7 @@ namespace Web::CSS::Parser {
class Declaration {
public:
Declaration(FlyString name, Vector<ComponentValue> values, Important);
Declaration(DeprecatedFlyString name, Vector<ComponentValue> values, Important);
~Declaration();
StringView name() const { return m_name; }
@ -25,7 +25,7 @@ public:
DeprecatedString to_deprecated_string() const;
private:
FlyString m_name;
DeprecatedFlyString m_name;
Vector<ComponentValue> m_values;
Important m_important { Important::No };
};

View file

@ -10,7 +10,7 @@
namespace Web::CSS::Parser {
Function::Function(FlyString name, Vector<ComponentValue>&& values)
Function::Function(DeprecatedFlyString name, Vector<ComponentValue>&& values)
: m_name(move(name))
, m_values(move(values))
{

View file

@ -7,8 +7,8 @@
#pragma once
#include <AK/DeprecatedFlyString.h>
#include <AK/DeprecatedString.h>
#include <AK/FlyString.h>
#include <AK/RefCounted.h>
#include <AK/Vector.h>
#include <LibWeb/CSS/Parser/ComponentValue.h>
@ -18,7 +18,7 @@ namespace Web::CSS::Parser {
class Function : public RefCounted<Function> {
public:
static NonnullRefPtr<Function> create(FlyString name, Vector<ComponentValue>&& values)
static NonnullRefPtr<Function> create(DeprecatedFlyString name, Vector<ComponentValue>&& values)
{
return adopt_ref(*new Function(move(name), move(values)));
}
@ -31,9 +31,9 @@ public:
DeprecatedString to_deprecated_string() const;
private:
Function(FlyString name, Vector<ComponentValue>&& values);
Function(DeprecatedFlyString name, Vector<ComponentValue>&& values);
FlyString m_name;
DeprecatedFlyString m_name;
Vector<ComponentValue> m_values;
};
}

View file

@ -561,7 +561,7 @@ Parser::ParseErrorOr<Selector::SimpleSelector> Parser::parse_pseudo_simple_selec
return ParseError::SyntaxError;
}
// FIXME: Support multiple, comma-separated, language ranges.
Vector<FlyString> languages;
Vector<DeprecatedFlyString> languages;
languages.append(pseudo_function.values().first().token().to_deprecated_string());
return Selector::SimpleSelector {
.type = Selector::SimpleSelector::Type::PseudoClass,
@ -1518,7 +1518,7 @@ NonnullRefPtr<Rule> Parser::consume_an_at_rule(TokenStream<T>& tokens)
// Create a new at-rule with its name set to the value of the current input token, its prelude initially set to an empty list, and its value initially set to nothing.
// NOTE: We create the Rule fully initialized when we return it instead.
FlyString at_rule_name = ((Token)name_ident).at_keyword();
DeprecatedFlyString at_rule_name = ((Token)name_ident).at_keyword();
Vector<ComponentValue> prelude;
RefPtr<Block> block;
@ -1801,7 +1801,7 @@ NonnullRefPtr<Function> Parser::consume_a_function(TokenStream<T>& tokens)
// Create a function with its name equal to the value of the current input token
// and with its value initially set to an empty list.
// NOTE: We create the Function fully initialized when we return it instead.
FlyString function_name = ((Token)name_ident).function();
DeprecatedFlyString function_name = ((Token)name_ident).function();
Vector<ComponentValue> function_values;
// Repeatedly consume the next input token and process it as follows:
@ -1856,7 +1856,7 @@ Optional<Declaration> Parser::consume_a_declaration(TokenStream<T>& tokens)
// Create a new declaration with its name set to the value of the current input token
// and its value initially set to the empty list.
// NOTE: We create a fully-initialized Declaration just before returning it instead.
FlyString declaration_name = ((Token)token).ident();
DeprecatedFlyString declaration_name = ((Token)token).ident();
Vector<ComponentValue> declaration_values;
Important declaration_important = Important::No;
@ -5289,7 +5289,7 @@ CSSRule* Parser::parse_font_face_rule(TokenStream<ComponentValue>& tokens)
{
auto declarations_and_at_rules = parse_a_list_of_declarations(tokens);
Optional<FlyString> font_family;
Optional<DeprecatedFlyString> font_family;
Vector<FontFace::Source> src;
Vector<UnicodeRange> unicode_range;
@ -5412,7 +5412,7 @@ Vector<FontFace::Source> Parser::parse_font_face_src(TokenStream<ComponentValue>
// FIXME: Implement optional tech() function from CSS-Fonts-4.
if (auto maybe_url = parse_url_function(first, AllowedDataUrlType::Font); maybe_url.has_value()) {
auto url = maybe_url.release_value();
Optional<FlyString> format;
Optional<DeprecatedFlyString> format;
source_tokens.skip_whitespace();
if (!source_tokens.has_next_token()) {

View file

@ -10,7 +10,7 @@
namespace Web::CSS::Parser {
Rule::Rule(Rule::Type type, FlyString name, Vector<ComponentValue> prelude, RefPtr<Block> block)
Rule::Rule(Rule::Type type, DeprecatedFlyString name, Vector<ComponentValue> prelude, RefPtr<Block> block)
: m_type(type)
, m_at_rule_name(move(name))
, m_prelude(move(prelude))

View file

@ -7,7 +7,7 @@
#pragma once
#include <AK/FlyString.h>
#include <AK/DeprecatedFlyString.h>
#include <AK/RefCounted.h>
#include <AK/Vector.h>
#include <LibWeb/CSS/Parser/Block.h>
@ -22,7 +22,7 @@ public:
Qualified,
};
static NonnullRefPtr<Rule> make_at_rule(FlyString name, Vector<ComponentValue> prelude, RefPtr<Block> block)
static NonnullRefPtr<Rule> make_at_rule(DeprecatedFlyString name, Vector<ComponentValue> prelude, RefPtr<Block> block)
{
return adopt_ref(*new Rule(Type::At, move(name), move(prelude), move(block)));
}
@ -44,10 +44,10 @@ public:
DeprecatedString to_deprecated_string() const;
private:
Rule(Type, FlyString name, Vector<ComponentValue> prelude, RefPtr<Block>);
Rule(Type, DeprecatedFlyString name, Vector<ComponentValue> prelude, RefPtr<Block>);
Type const m_type;
FlyString m_at_rule_name;
DeprecatedFlyString m_at_rule_name;
Vector<ComponentValue> m_prelude;
RefPtr<Block> m_block;
};

View file

@ -7,8 +7,8 @@
#pragma once
#include <AK/DeprecatedFlyString.h>
#include <AK/DeprecatedString.h>
#include <AK/FlyString.h>
#include <AK/Utf8View.h>
#include <LibWeb/CSS/Number.h>
@ -151,7 +151,7 @@ public:
Position const& start_position() const { return m_start_position; }
Position const& end_position() const { return m_end_position; }
static Token of_string(FlyString str)
static Token of_string(DeprecatedFlyString str)
{
Token token;
token.m_type = Type::String;
@ -178,7 +178,7 @@ public:
private:
Type m_type { Type::Invalid };
FlyString m_value;
DeprecatedFlyString m_value;
Number m_number_value;
HashType m_hash_type { HashType::Unrestricted };