diff options
author | Itamar <itamar8910@gmail.com> | 2021-05-07 14:46:11 +0300 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2021-05-09 20:58:27 +0200 |
commit | 5c42dc854d98e43e99fa6c4c910c2e819a200a15 (patch) | |
tree | 704e98d3b65d981fb92f19826c1babb49c7e99ce | |
parent | de9be7cd704171f1a150a2fdb7497df83a162b85 (diff) | |
download | serenity-5c42dc854d98e43e99fa6c4c910c2e819a200a15.zip |
LibCpp: Rename m_definitions=>m_preprocessor_definitions
-rw-r--r-- | Userland/DevTools/HackStudio/LanguageServers/Cpp/ParserAutoComplete.cpp | 4 | ||||
-rw-r--r-- | Userland/Libraries/LibCpp/Parser.cpp | 4 | ||||
-rw-r--r-- | Userland/Libraries/LibCpp/Parser.h | 4 |
3 files changed, 6 insertions, 6 deletions
diff --git a/Userland/DevTools/HackStudio/LanguageServers/Cpp/ParserAutoComplete.cpp b/Userland/DevTools/HackStudio/LanguageServers/Cpp/ParserAutoComplete.cpp index 5a7df291a8..8b45ee90d7 100644 --- a/Userland/DevTools/HackStudio/LanguageServers/Cpp/ParserAutoComplete.cpp +++ b/Userland/DevTools/HackStudio/LanguageServers/Cpp/ParserAutoComplete.cpp @@ -146,7 +146,7 @@ Vector<GUI::AutocompleteProvider::Entry> ParserAutoComplete::autocomplete_name(c } } - for (auto& preprocessor_name : document.parser().definitions().keys()) { + for (auto& preprocessor_name : document.parser().preprocessor_definitions().keys()) { if (preprocessor_name.starts_with(partial_text)) { suggestions.append({ preprocessor_name.to_string(), partial_text.length(), GUI::AutocompleteProvider::CompletionKind::PreprocessorDefinition }); } @@ -489,7 +489,7 @@ OwnPtr<ParserAutoComplete::DocumentData> ParserAutoComplete::create_document_dat auto included_document = get_or_create_document_data(document_path_from_include_path(include)); if (!included_document) continue; - for (auto item : included_document->parser().definitions()) + for (auto item : included_document->parser().preprocessor_definitions()) all_definitions.set(move(item.key), move(item.value)); } diff --git a/Userland/Libraries/LibCpp/Parser.cpp b/Userland/Libraries/LibCpp/Parser.cpp index ff6f72263e..12224b6e5d 100644 --- a/Userland/Libraries/LibCpp/Parser.cpp +++ b/Userland/Libraries/LibCpp/Parser.cpp @@ -14,7 +14,7 @@ namespace Cpp { Parser::Parser(const StringView& program, const String& filename, Preprocessor::Definitions&& definitions) - : m_definitions(move(definitions)) + : m_preprocessor_definitions(move(definitions)) , m_filename(filename) { initialize_program_tokens(program); @@ -38,7 +38,7 @@ void Parser::initialize_program_tokens(const StringView& program) if (token.type() == Token::Type::Whitespace) continue; if (token.type() == Token::Type::Identifier) { - if (auto defined_value = m_definitions.find(text_of_token(token)); defined_value != m_definitions.end()) { + if (auto defined_value = m_preprocessor_definitions.find(text_of_token(token)); defined_value != m_preprocessor_definitions.end()) { add_tokens_for_preprocessor(token, defined_value->value); m_replaced_preprocessor_tokens.append({ token, defined_value->value }); continue; diff --git a/Userland/Libraries/LibCpp/Parser.h b/Userland/Libraries/LibCpp/Parser.h index 90107c398d..6296722946 100644 --- a/Userland/Libraries/LibCpp/Parser.h +++ b/Userland/Libraries/LibCpp/Parser.h @@ -34,7 +34,7 @@ public: StringView text_of_token(const Cpp::Token& token) const; void print_tokens() const; const Vector<String>& errors() const { return m_state.errors; } - const Preprocessor::Definitions& definitions() const { return m_definitions; } + const Preprocessor::Definitions& preprocessor_definitions() const { return m_preprocessor_definitions; } struct TokenAndPreprocessorDefinition { Token token; @@ -169,7 +169,7 @@ private: Vector<StringView> parse_type_qualifiers(); Vector<StringView> parse_function_qualifiers(); - Preprocessor::Definitions m_definitions; + Preprocessor::Definitions m_preprocessor_definitions; String m_filename; Vector<Token> m_tokens; State m_state; |