Skip to content

Commit 40c40b7

Browse files
committed
LibGUI: Insert parsed comments in parsing order
We were accidentally reversing the order of consecutive comments when inserting them as children of the GML object.
1 parent c56bc49 commit 40c40b7

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

Userland/Libraries/LibGUI/GML/Parser.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,14 +57,14 @@ static ErrorOr<NonnullRefPtr<Object>> parse_gml_object(Queue<Token>& tokens)
5757
// It's a child object.
5858

5959
while (!pending_comments.is_empty())
60-
TRY(object->add_sub_object_child(pending_comments.take_last()));
60+
TRY(object->add_sub_object_child(pending_comments.take_first()));
6161

6262
TRY(object->add_sub_object_child(TRY(parse_gml_object(tokens))));
6363
} else if (peek() == Token::Type::Identifier) {
6464
// It's a property.
6565

6666
while (!pending_comments.is_empty())
67-
TRY(object->add_property_child(pending_comments.take_last()));
67+
TRY(object->add_property_child(pending_comments.take_first()));
6868

6969
auto property_name = tokens.dequeue();
7070

0 commit comments

Comments
 (0)