1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-26 18:17:44 +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:
Ali Mohammad Pur 2023-12-16 17:49:34 +03:30 committed by Ali Mohammad Pur
parent 38d62563b3
commit 5e1499d104
1615 changed files with 10257 additions and 10257 deletions

View file

@ -19,7 +19,7 @@ class Parser final {
AK_MAKE_NONCOPYABLE(Parser);
public:
explicit Parser(Vector<Token> tokens, DeprecatedString const& filename);
explicit Parser(Vector<Token> tokens, ByteString const& filename);
~Parser() = default;
NonnullRefPtr<TranslationUnit> parse();
@ -30,11 +30,11 @@ public:
Optional<Token> token_at(Position) const;
Optional<size_t> index_of_token_at(Position) const;
RefPtr<TranslationUnit const> root_node() const { return m_root_node; }
DeprecatedString text_of_node(ASTNode const&) const;
ByteString text_of_node(ASTNode const&) const;
StringView text_of_token(Cpp::Token const& token) const;
void print_tokens() const;
Vector<Token> const& tokens() const { return m_tokens; }
Vector<DeprecatedString> const& errors() const { return m_errors; }
Vector<ByteString> const& errors() const { return m_errors; }
Vector<CodeComprehension::TodoEntry> get_todo_entries() const;
@ -69,7 +69,7 @@ private:
bool match_literal();
bool match_unary_expression();
bool match_boolean_literal();
bool match_keyword(DeprecatedString const&);
bool match_keyword(ByteString const&);
bool match_block_statement();
bool match_namespace_declaration();
bool match_template_arguments();
@ -132,12 +132,12 @@ private:
bool match(Token::Type);
Token consume(Token::Type);
Token consume();
Token consume_keyword(DeprecatedString const&);
Token consume_keyword(ByteString const&);
Token peek(size_t offset = 0) const;
Optional<Token> peek(Token::Type) const;
Position position() const;
Position previous_token_end() const;
DeprecatedString text_in_range(Position start, Position end) const;
ByteString text_in_range(Position start, Position end) const;
void save_state();
void load_state();
@ -192,12 +192,12 @@ private:
};
void parse_constructor_or_destructor_impl(FunctionDeclaration&, CtorOrDtor);
DeprecatedString m_filename;
ByteString m_filename;
Vector<Token> m_tokens;
State m_state;
Vector<State> m_saved_states;
RefPtr<TranslationUnit> m_root_node;
Vector<DeprecatedString> m_errors;
Vector<ByteString> m_errors;
Vector<NonnullRefPtr<ASTNode>> m_nodes;
};