mirror of
https://github.com/RGBCube/serenity
synced 2025-07-24 21:37:34 +00:00
LibCpp: Rename m_definitions=>m_preprocessor_definitions
This commit is contained in:
parent
de9be7cd70
commit
5c42dc854d
3 changed files with 6 additions and 6 deletions
|
@ -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)) {
|
if (preprocessor_name.starts_with(partial_text)) {
|
||||||
suggestions.append({ preprocessor_name.to_string(), partial_text.length(), GUI::AutocompleteProvider::CompletionKind::PreprocessorDefinition });
|
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));
|
auto included_document = get_or_create_document_data(document_path_from_include_path(include));
|
||||||
if (!included_document)
|
if (!included_document)
|
||||||
continue;
|
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));
|
all_definitions.set(move(item.key), move(item.value));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -14,7 +14,7 @@
|
||||||
namespace Cpp {
|
namespace Cpp {
|
||||||
|
|
||||||
Parser::Parser(const StringView& program, const String& filename, Preprocessor::Definitions&& definitions)
|
Parser::Parser(const StringView& program, const String& filename, Preprocessor::Definitions&& definitions)
|
||||||
: m_definitions(move(definitions))
|
: m_preprocessor_definitions(move(definitions))
|
||||||
, m_filename(filename)
|
, m_filename(filename)
|
||||||
{
|
{
|
||||||
initialize_program_tokens(program);
|
initialize_program_tokens(program);
|
||||||
|
@ -38,7 +38,7 @@ void Parser::initialize_program_tokens(const StringView& program)
|
||||||
if (token.type() == Token::Type::Whitespace)
|
if (token.type() == Token::Type::Whitespace)
|
||||||
continue;
|
continue;
|
||||||
if (token.type() == Token::Type::Identifier) {
|
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);
|
add_tokens_for_preprocessor(token, defined_value->value);
|
||||||
m_replaced_preprocessor_tokens.append({ token, defined_value->value });
|
m_replaced_preprocessor_tokens.append({ token, defined_value->value });
|
||||||
continue;
|
continue;
|
||||||
|
|
|
@ -34,7 +34,7 @@ public:
|
||||||
StringView text_of_token(const Cpp::Token& token) const;
|
StringView text_of_token(const Cpp::Token& token) const;
|
||||||
void print_tokens() const;
|
void print_tokens() const;
|
||||||
const Vector<String>& errors() const { return m_state.errors; }
|
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 {
|
struct TokenAndPreprocessorDefinition {
|
||||||
Token token;
|
Token token;
|
||||||
|
@ -169,7 +169,7 @@ private:
|
||||||
Vector<StringView> parse_type_qualifiers();
|
Vector<StringView> parse_type_qualifiers();
|
||||||
Vector<StringView> parse_function_qualifiers();
|
Vector<StringView> parse_function_qualifiers();
|
||||||
|
|
||||||
Preprocessor::Definitions m_definitions;
|
Preprocessor::Definitions m_preprocessor_definitions;
|
||||||
String m_filename;
|
String m_filename;
|
||||||
Vector<Token> m_tokens;
|
Vector<Token> m_tokens;
|
||||||
State m_state;
|
State m_state;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue