mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-22 23:50:19 +00:00
LibCpp: Add 'Namespace' and 'Member' declaration types
This commit is contained in:
parent
c6c83bd80e
commit
b87791cada
Notes:
sideshowbarker
2024-07-18 20:26:03 +09:00
Author: https://github.com/itamar8910 Commit: https://github.com/SerenityOS/serenity/commit/b87791cadae Pull-request: https://github.com/SerenityOS/serenity/pull/6216
3 changed files with 8 additions and 0 deletions
|
@ -486,6 +486,10 @@ GUI::AutocompleteProvider::DeclarationType ParserAutoComplete::type_of_declarati
|
|||
return GUI::AutocompleteProvider::DeclarationType::Function;
|
||||
if (decl.is_variable_declaration())
|
||||
return GUI::AutocompleteProvider::DeclarationType::Variable;
|
||||
if (decl.is_namespace())
|
||||
return GUI::AutocompleteProvider::DeclarationType::Namespace;
|
||||
if (decl.is_member())
|
||||
return GUI::AutocompleteProvider::DeclarationType::Member;
|
||||
return GUI::AutocompleteProvider::DeclarationType::Variable;
|
||||
}
|
||||
|
||||
|
|
|
@ -137,6 +137,7 @@ public:
|
|||
virtual bool is_class() const { return false; }
|
||||
virtual bool is_function() const { return false; }
|
||||
virtual bool is_namespace() const { return false; }
|
||||
virtual bool is_member() const { return false; }
|
||||
const StringView& name() const { return m_name; }
|
||||
|
||||
StringView m_name;
|
||||
|
@ -529,6 +530,7 @@ public:
|
|||
virtual ~MemberDeclaration() override = default;
|
||||
virtual const char* class_name() const override { return "MemberDeclaration"; }
|
||||
virtual void dump(size_t indent) const override;
|
||||
virtual bool is_member() const override { return true; }
|
||||
|
||||
MemberDeclaration(ASTNode* parent, Optional<Position> start, Optional<Position> end, const String& filename)
|
||||
: Declaration(parent, start, end, filename)
|
||||
|
|
|
@ -69,6 +69,8 @@ public:
|
|||
Class,
|
||||
Variable,
|
||||
PreprocessorDefinition,
|
||||
Namespace,
|
||||
Member,
|
||||
};
|
||||
|
||||
struct Declaration {
|
||||
|
|
Loading…
Reference in a new issue