summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIdan Horowitz <idan.horowitz@gmail.com>2022-04-08 17:41:34 +0300
committerIdan Horowitz <idan.horowitz@gmail.com>2022-04-08 19:19:37 +0300
commit40c40b75519210649628e2a8d8abf05e22792f47 (patch)
treea89f42ebe5f986edda459e646036a19fefe4d784
parentc56bc49b704ce18727eac3a0342931aff8437fb0 (diff)
downloadserenity-40c40b75519210649628e2a8d8abf05e22792f47.zip
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.
-rw-r--r--Userland/Libraries/LibGUI/GML/Parser.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/Userland/Libraries/LibGUI/GML/Parser.cpp b/Userland/Libraries/LibGUI/GML/Parser.cpp
index e79eb39df0..8e6cfcd71b 100644
--- a/Userland/Libraries/LibGUI/GML/Parser.cpp
+++ b/Userland/Libraries/LibGUI/GML/Parser.cpp
@@ -57,14 +57,14 @@ static ErrorOr<NonnullRefPtr<Object>> parse_gml_object(Queue<Token>& tokens)
// It's a child object.
while (!pending_comments.is_empty())
- TRY(object->add_sub_object_child(pending_comments.take_last()));
+ TRY(object->add_sub_object_child(pending_comments.take_first()));
TRY(object->add_sub_object_child(TRY(parse_gml_object(tokens))));
} else if (peek() == Token::Type::Identifier) {
// It's a property.
while (!pending_comments.is_empty())
- TRY(object->add_property_child(pending_comments.take_last()));
+ TRY(object->add_property_child(pending_comments.take_first()));
auto property_name = tokens.dequeue();