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:
parent
d4f08b3096
commit
4c451422c3
3 changed files with 10 additions and 12 deletions
|
@ -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();
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue