LibCpp: Accept scoped variable declarations

For instance, `Type Scope::Class::variable = value;` is a valid
declaration.
This commit is contained in:
Ali Mohammad Pur
2021-07-28 04:05:39 +04:30
committed by Andreas Kling
parent b81926d933
commit 5d27740387

View File

@@ -301,10 +301,10 @@ bool Parser::match_variable_declaration()
parse_type(get_dummy_node());
// Identifier
if (!peek(Token::Type::Identifier).has_value()) {
if (!match_name())
return false;
}
consume();
parse_name(get_dummy_node());
if (match(Token::Type::Equals)) {
consume(Token::Type::Equals);