mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-08-15 23:09:05 +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
Notes:
sideshowbarker
2024-07-18 07:36:51 +09:00
Author: https://github.com/alimpfard
Commit: 5d27740387
Pull-request: https://github.com/SerenityOS/serenity/pull/9156
Reviewed-by: https://github.com/itamar8910 ✅
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