mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-09-27 19:59:03 +00:00
LibCpp: Add support for type aliases with typedef/using
This commit is contained in:
parent
2e2e535abb
commit
543ccecc0b
Notes:
sideshowbarker
2024-07-16 21:34:08 +09:00
Author: https://github.com/alimpfard
Commit: 543ccecc0b
Pull-request: https://github.com/SerenityOS/serenity/pull/19447
Reviewed-by: https://github.com/AtkinsSJ
4 changed files with 115 additions and 0 deletions
|
@ -1007,6 +1007,23 @@ public:
|
|||
}
|
||||
};
|
||||
|
||||
class TypedefDeclaration : public Declaration {
|
||||
public:
|
||||
virtual ~TypedefDeclaration() override = default;
|
||||
virtual StringView class_name() const override { return "TypedefDeclaration"sv; }
|
||||
virtual void dump(FILE* = stdout, size_t indent = 0) const override;
|
||||
|
||||
TypedefDeclaration(ASTNode const* parent, Optional<Position> start, Optional<Position> end, DeprecatedString const& filename)
|
||||
: Declaration(parent, start, end, filename)
|
||||
{
|
||||
}
|
||||
|
||||
void set_alias(Type const& alias) { m_alias = alias; }
|
||||
Type const* alias() const { return m_alias.ptr(); }
|
||||
|
||||
private:
|
||||
RefPtr<Type const> m_alias;
|
||||
};
|
||||
template<>
|
||||
inline bool ASTNode::fast_is<Identifier>() const { return is_identifier(); }
|
||||
template<>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue