1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 19:17:44 +00:00

gml-format+Playground: Print GML parsing error on formatting failure

This commit is contained in:
Idan Horowitz 2022-02-12 19:16:13 +02:00
parent d4f08b3096
commit 4c451422c3
3 changed files with 10 additions and 12 deletions

View file

@ -13,12 +13,9 @@
namespace GUI::GML {
inline String format_gml(StringView string)
inline ErrorOr<String> format_gml(StringView string)
{
auto ast = parse_gml(string);
if (ast.is_error())
return {};
return ast.value()->to_string();
return TRY(parse_gml(string))->to_string();
}
}