diff --git a/Userland/Libraries/LibCpp/Parser.cpp b/Userland/Libraries/LibCpp/Parser.cpp index 92fa07e02a..7b7d674801 100644 --- a/Userland/Libraries/LibCpp/Parser.cpp +++ b/Userland/Libraries/LibCpp/Parser.cpp @@ -1189,7 +1189,7 @@ NonnullRefPtr Parser::parse_type(ASTNode& parent) while (!eof() && peek().type() == Token::Type::Asterisk) { type->set_end(position()); auto asterisk = consume(); - auto ptr = create_ast_node(parent, asterisk.start(), asterisk.end()); + auto ptr = create_ast_node(parent, type->start(), asterisk.end()); type->set_parent(*ptr); ptr->m_pointee = type; ptr->set_end(position()); diff --git a/Userland/Libraries/LibCpp/Tests/strace.ast b/Userland/Libraries/LibCpp/Tests/strace.ast index f4ce346cb1..b01cb9e790 100644 --- a/Userland/Libraries/LibCpp/Tests/strace.ast +++ b/Userland/Libraries/LibCpp/Tests/strace.ast @@ -67,10 +67,10 @@ TranslationUnit[0:0->144:0] argc NamedType[12:9->12:13] int - Parameter[12:24->12:29] + Parameter[12:19->12:29] argv - Pointer[12:24->12:26] - Pointer[12:23->12:24] + Pointer[12:19->12:26] + Pointer[12:19->12:24] NamedType[12:19->12:23] char ) @@ -103,7 +103,7 @@ TranslationUnit[0:0->144:0] Vector<[const] char*> child_argv VariableDeclaration[21:4->21:41] - Pointer[21:14->21:16] + Pointer[21:4->21:16] NamedType[21:4->21:14] [const] char output_filename @@ -382,8 +382,8 @@ TranslationUnit[0:0->144:0] CppCastExpression[66:48->66:85] const_cast < - Pointer[66:64->66:65] - Pointer[66:63->66:64] + Pointer[66:59->66:65] + Pointer[66:59->66:64] NamedType[66:59->66:63] char > diff --git a/Userland/Libraries/LibCpp/Tests/struct.ast b/Userland/Libraries/LibCpp/Tests/struct.ast index 29bd29e5db..a59e9c21e8 100644 --- a/Userland/Libraries/LibCpp/Tests/struct.ast +++ b/Userland/Libraries/LibCpp/Tests/struct.ast @@ -6,7 +6,7 @@ TranslationUnit[1:0->12:0] int x VariableDeclaration[4:4->5:0] - Pointer[4:12->4:14] + Pointer[4:4->4:14] NamedType[4:4->4:12] s next