mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-06-10 18:10:56 +09: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
Notes:
sideshowbarker
2024-07-17 14:16:24 +09:00
Author: https://github.com/IdanHo
Commit: 280e99073b
Pull-request: https://github.com/SerenityOS/serenity/pull/13572
Issue: https://github.com/SerenityOS/serenity/issues/13113
Reviewed-by: https://github.com/kleinesfilmroellchen ✅
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