mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 09:58:11 +00:00
LibGUI: Stop dropping comments between children and end of GML objects
Any left-over comments in the pending_comments vector are now inserted as sub object children, as these are serialized last and will therefore show up in their expected location.
This commit is contained in:
parent
40c40b7551
commit
280e99073b
1 changed files with 5 additions and 0 deletions
|
@ -1,6 +1,7 @@
|
|||
/*
|
||||
* Copyright (c) 2020, Andreas Kling <kling@serenityos.org>
|
||||
* Copyright (c) 2022, kleines Filmröllchen <filmroellchen@serenityos.org>
|
||||
* Copyright (c) 2022, Idan Horowitz <idan.horowitz@serenityos.org>
|
||||
*
|
||||
* SPDX-License-Identifier: BSD-2-Clause
|
||||
*/
|
||||
|
@ -91,6 +92,10 @@ static ErrorOr<NonnullRefPtr<Object>> parse_gml_object(Queue<Token>& tokens)
|
|||
}
|
||||
}
|
||||
|
||||
// Insert any left-over comments as sub object children, as these will be serialized last
|
||||
while (!pending_comments.is_empty())
|
||||
TRY(object->add_sub_object_child(pending_comments.take_first()));
|
||||
|
||||
if (peek() != Token::Type::RightCurly)
|
||||
return Error::from_string_literal("Expected }}"sv);
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue