Просмотр исходного кода

LibCpp: Rename m_definitions=>m_preprocessor_definitions

Itamar 4 лет назад
Родитель
Сommit
5c42dc854d

+ 2 - 2
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));
     }
 

+ 2 - 2
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;

+ 2 - 2
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;