1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 10:38:11 +00:00

LanguageServers/Cpp: Refactor logic of find declaration

This commit is contained in:
Itamar 2021-04-03 14:40:13 +03:00 committed by Andreas Kling
parent e16036b9cc
commit 510b5073de
2 changed files with 59 additions and 12 deletions

View file

@ -590,7 +590,8 @@ NonnullRefPtr<Expression> Parser::parse_secondary_expression(ASTNode& parent, No
auto exp = create_ast_node<MemberExpression>(parent, lhs->start(), {});
lhs->set_parent(*exp);
exp->m_object = move(lhs);
exp->m_property = parse_expression(*exp);
auto identifier_token = consume(Token::Type::Identifier);
exp->m_property = create_ast_node<Identifier>(*exp, identifier_token.start(), identifier_token.end(), identifier_token.text());
exp->set_end(position());
return exp;
}