1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-06-01 09:58:14 +00:00

AK+Everywhere: Rename String to DeprecatedString

We have a new, improved string type coming up in AK (OOM aware, no null
state), and while it's going to use UTF-8, the name UTF8String is a
mouthful - so let's free up the String name by renaming the existing
class.
Making the old one have an annoying name will hopefully also help with
quick adoption :^)
This commit is contained in:
Linus Groh 2022-12-04 18:02:33 +00:00 committed by Andreas Kling
parent f74251606d
commit 6e19ab2bbc
2006 changed files with 11635 additions and 11636 deletions

View file

@ -19,7 +19,7 @@ class Parser final {
AK_MAKE_NONCOPYABLE(Parser);
public:
explicit Parser(Vector<Token> tokens, String const& filename);
explicit Parser(Vector<Token> tokens, DeprecatedString 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; }
String text_of_node(ASTNode const&) const;
DeprecatedString 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<String> const& errors() const { return m_errors; }
Vector<DeprecatedString> const& errors() const { return m_errors; }
Vector<CodeComprehension::TodoEntry> get_todo_entries() const;
@ -66,7 +66,7 @@ private:
bool match_literal();
bool match_unary_expression();
bool match_boolean_literal();
bool match_keyword(String const&);
bool match_keyword(DeprecatedString const&);
bool match_block_statement();
bool match_namespace_declaration();
bool match_template_arguments();
@ -125,12 +125,12 @@ private:
bool match(Token::Type);
Token consume(Token::Type);
Token consume();
Token consume_keyword(String const&);
Token consume_keyword(DeprecatedString const&);
Token peek(size_t offset = 0) const;
Optional<Token> peek(Token::Type) const;
Position position() const;
Position previous_token_end() const;
String text_in_range(Position start, Position end) const;
DeprecatedString text_in_range(Position start, Position end) const;
void save_state();
void load_state();
@ -185,12 +185,12 @@ private:
};
void parse_constructor_or_destructor_impl(FunctionDeclaration&, CtorOrDtor);
String m_filename;
DeprecatedString m_filename;
Vector<Token> m_tokens;
State m_state;
Vector<State> m_saved_states;
RefPtr<TranslationUnit> m_root_node;
Vector<String> m_errors;
Vector<DeprecatedString> m_errors;
NonnullRefPtrVector<ASTNode> m_nodes;
};