1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 18:18:12 +00:00

LibCpp: Parse Namespace declaration

Also, remove unused State::Context
This commit is contained in:
Itamar 2021-03-19 21:47:43 +02:00 committed by Andreas Kling
parent 505c84fdf0
commit b5cab861e3
4 changed files with 111 additions and 57 deletions

View file

@ -43,7 +43,7 @@ void ASTNode::dump(size_t indent) const
void TranslationUnit::dump(size_t indent) const
{
ASTNode::dump(indent);
for (const auto& child : m_children) {
for (const auto& child : m_declarations) {
child.dump(indent + 1);
}
}
@ -413,4 +413,14 @@ NonnullRefPtrVector<Declaration> IfStatement::declarations() const
declarations.append(m_else->declarations());
return declarations;
}
void NamespaceDeclaration::dump(size_t indent) const
{
ASTNode::dump(indent);
print_indent(indent + 1);
outln("{}", m_name);
for (auto& decl : m_declarations)
decl.dump(indent + 1);
}
}