diff options
author | Itamar <itamar8910@gmail.com> | 2021-04-03 14:40:13 +0300 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2021-04-06 21:51:58 +0200 |
commit | 510b5073de9b2a50a226addd1b02df18da995613 (patch) | |
tree | 8afc90b75e123df50b5cbc73d9c459db6599a1f0 /Userland/Libraries/LibCpp | |
parent | e16036b9cca4e22cdf3c4a316c1a8b3a37fc6d9f (diff) | |
download | serenity-510b5073de9b2a50a226addd1b02df18da995613.zip |
LanguageServers/Cpp: Refactor logic of find declaration
Diffstat (limited to 'Userland/Libraries/LibCpp')
-rw-r--r-- | Userland/Libraries/LibCpp/Parser.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/Userland/Libraries/LibCpp/Parser.cpp b/Userland/Libraries/LibCpp/Parser.cpp index aaac3f5934..6dec241c3b 100644 --- a/Userland/Libraries/LibCpp/Parser.cpp +++ b/Userland/Libraries/LibCpp/Parser.cpp @@ -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; } |