mirror of
https://github.com/RGBCube/serenity
synced 2025-07-26 18:57:34 +00:00
LibCpp: Accept scoped variable declarations
For instance, `Type Scope::Class::variable = value;` is a valid declaration.
This commit is contained in:
parent
b81926d933
commit
5d27740387
1 changed files with 3 additions and 3 deletions
|
@ -301,10 +301,10 @@ bool Parser::match_variable_declaration()
|
||||||
parse_type(get_dummy_node());
|
parse_type(get_dummy_node());
|
||||||
|
|
||||||
// Identifier
|
// Identifier
|
||||||
if (!peek(Token::Type::Identifier).has_value()) {
|
if (!match_name())
|
||||||
return false;
|
return false;
|
||||||
}
|
|
||||||
consume();
|
parse_name(get_dummy_node());
|
||||||
|
|
||||||
if (match(Token::Type::Equals)) {
|
if (match(Token::Type::Equals)) {
|
||||||
consume(Token::Type::Equals);
|
consume(Token::Type::Equals);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue