mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 14:38:11 +00:00
LibCpp: Handle 'struct' prefix before a type
This commit is contained in:
parent
575d6a8ee1
commit
8bcf5daf3f
1 changed files with 7 additions and 0 deletions
|
@ -257,6 +257,9 @@ Parser::TemplatizedMatchResult Parser::match_type()
|
|||
ScopeGuard state_guard = [this] { load_state(); };
|
||||
|
||||
parse_type_qualifiers();
|
||||
if (match_keyword("struct")) {
|
||||
consume(Token::Type::Keyword); // Consume struct prefix
|
||||
}
|
||||
|
||||
if (!match_name())
|
||||
return TemplatizedMatchResult::NoMatch;
|
||||
|
@ -1163,6 +1166,10 @@ NonnullRefPtr<Type> Parser::parse_type(ASTNode& parent)
|
|||
auto qualifiers = parse_type_qualifiers();
|
||||
type->m_qualifiers = move(qualifiers);
|
||||
|
||||
if (match_keyword("struct")) {
|
||||
consume(Token::Type::Keyword); // Consume struct prefix
|
||||
}
|
||||
|
||||
if (!match_name()) {
|
||||
type->set_end(position());
|
||||
error(String::formatted("expected name instead of: {}", peek().text()));
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue