mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-07-24 18:02:20 +00:00
LibIDL: Report empty types with a separate error
Previously the IDL Parser Complained, that a type with the name '' (an empty string) couldn't be found. It wasn't that easy to see the mistake, as the not named type is printed without '' around it, so the message seemed to miss a type. This now catches this specify error earlier and reports it cleanly to the user. An example of this occurring would be ''typedef A (B or //FIXME: C )
This commit is contained in:
parent
d14856e3c5
commit
1182ee6c69
Notes:
github-actions[bot]
2025-03-04 08:32:33 +00:00
Author: https://github.com/Totto16
Commit: 1182ee6c69
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/3789
Reviewed-by: https://github.com/tcl3 ✅
1 changed files with 4 additions and 0 deletions
|
@ -295,6 +295,10 @@ NonnullRefPtr<Type const> Parser::parse_type()
|
|||
// Note: This case is handled above
|
||||
}
|
||||
|
||||
if (builder.is_empty()) {
|
||||
report_parsing_error("Type can't be an empty string"sv, filename, input, lexer.tell());
|
||||
}
|
||||
|
||||
if (is_parameterized_type)
|
||||
return adopt_ref(*new ParameterizedType(builder.to_byte_string(), nullable, move(parameters)));
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue