summaryrefslogtreecommitdiff
path: root/Userland/Libraries/LibCpp/Parser.h
diff options
context:
space:
mode:
authorLinus Groh <mail@linusgroh.de>2022-12-04 18:02:33 +0000
committerAndreas Kling <kling@serenityos.org>2022-12-06 08:54:33 +0100
commit6e19ab2bbce0b113b628e6f8e9b5c0640053933e (patch)
tree372d21b2f5dcff112f5d0089559c6af5798680d4 /Userland/Libraries/LibCpp/Parser.h
parentf74251606d74b504a1379ebb893fdb5529054ea5 (diff)
downloadserenity-6e19ab2bbce0b113b628e6f8e9b5c0640053933e.zip
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 :^)
Diffstat (limited to 'Userland/Libraries/LibCpp/Parser.h')
-rw-r--r--Userland/Libraries/LibCpp/Parser.h16
1 files changed, 8 insertions, 8 deletions
diff --git a/Userland/Libraries/LibCpp/Parser.h b/Userland/Libraries/LibCpp/Parser.h
index ea5615ac2e..aee83299f5 100644
--- a/Userland/Libraries/LibCpp/Parser.h
+++ b/Userland/Libraries/LibCpp/Parser.h
@@ -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;
};