mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-07-31 05:09:12 +00:00
LibCpp: Parse ellipsis
We can now parse the printf function declaration :^)
This commit is contained in:
parent
5c79297b2c
commit
1d3b5dabc3
Notes:
sideshowbarker
2024-07-18 21:46:47 +09:00
Author: https://github.com/itamar8910
Commit: 1d3b5dabc3
Pull-request: https://github.com/SerenityOS/serenity/pull/5591
4 changed files with 42 additions and 22 deletions
|
@ -83,7 +83,7 @@ void Type::dump(size_t indent) const
|
|||
ASTNode::dump(indent);
|
||||
print_indent(indent + 1);
|
||||
String qualifiers_string;
|
||||
if(!m_qualifiers.is_empty())
|
||||
if (!m_qualifiers.is_empty())
|
||||
qualifiers_string = String::formatted("[{}] ", String::join(" ", m_qualifiers));
|
||||
outln("{}{}", qualifiers_string, m_name);
|
||||
}
|
||||
|
@ -91,11 +91,16 @@ void Type::dump(size_t indent) const
|
|||
void Parameter::dump(size_t indent) const
|
||||
{
|
||||
ASTNode::dump(indent);
|
||||
if (m_is_ellipsis) {
|
||||
print_indent(indent + 1);
|
||||
outln("...");
|
||||
}
|
||||
if (!m_name.is_null()) {
|
||||
print_indent(indent);
|
||||
outln("{}", m_name);
|
||||
}
|
||||
m_type->dump(indent + 1);
|
||||
if (m_type)
|
||||
m_type->dump(indent + 1);
|
||||
}
|
||||
|
||||
void FunctionDefinition::dump(size_t indent) const
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue