mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-01-07 19:57:45 +03:00
LibIDL: Parse extended attributes that have () wrapped expressions
This includes things like Exposed and LegacyFactoryFunction.
This commit is contained in:
parent
67ceba2e6a
commit
2341294c20
Notes:
sideshowbarker
2024-07-17 17:49:11 +09:00
Author: https://github.com/ADKaster Commit: https://github.com/SerenityOS/serenity/commit/2341294c20 Pull-request: https://github.com/SerenityOS/serenity/pull/15520
@ -114,7 +114,17 @@ HashMap<String, String> Parser::parse_extended_attributes()
|
||||
break;
|
||||
auto name = lexer.consume_until([](auto ch) { return ch == ']' || ch == '=' || ch == ','; });
|
||||
if (lexer.consume_specific('=')) {
|
||||
auto value = lexer.consume_until([](auto ch) { return ch == ']' || ch == ','; });
|
||||
bool did_open_paren = false;
|
||||
auto value = lexer.consume_until(
|
||||
[&did_open_paren](auto ch) mutable {
|
||||
if (ch == '(') {
|
||||
did_open_paren = true;
|
||||
return false;
|
||||
}
|
||||
if (did_open_paren)
|
||||
return ch == ')';
|
||||
return ch == ']' || ch == ',';
|
||||
});
|
||||
extended_attributes.set(name, value);
|
||||
} else {
|
||||
extended_attributes.set(name, {});
|
||||
|
Loading…
Reference in New Issue
Block a user