mirror of
https://github.com/RGBCube/serenity
synced 2025-05-21 17:15:07 +00:00
LibWeb: Support non-interface top-level extended attributes
This commit is contained in:
parent
c14cb65215
commit
9ff79c9d54
1 changed files with 4 additions and 3 deletions
|
@ -725,6 +725,9 @@ void Parser::parse_interface_mixin(Interface& interface)
|
||||||
void Parser::parse_non_interface_entities(bool allow_interface, Interface& interface)
|
void Parser::parse_non_interface_entities(bool allow_interface, Interface& interface)
|
||||||
{
|
{
|
||||||
while (!lexer.is_eof()) {
|
while (!lexer.is_eof()) {
|
||||||
|
HashMap<String, String> extended_attributes;
|
||||||
|
if (lexer.consume_specific('['))
|
||||||
|
extended_attributes = parse_extended_attributes();
|
||||||
if (lexer.next_is("dictionary")) {
|
if (lexer.next_is("dictionary")) {
|
||||||
parse_dictionary(interface);
|
parse_dictionary(interface);
|
||||||
} else if (lexer.next_is("enum")) {
|
} else if (lexer.next_is("enum")) {
|
||||||
|
@ -748,6 +751,7 @@ void Parser::parse_non_interface_entities(bool allow_interface, Interface& inter
|
||||||
report_parsing_error("expected 'enum' or 'dictionary'", filename, input, current_offset);
|
report_parsing_error("expected 'enum' or 'dictionary'", filename, input, current_offset);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
interface.extended_attributes = move(extended_attributes);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -811,9 +815,6 @@ NonnullOwnPtr<Interface> Parser::parse()
|
||||||
interface->all_imported_paths = s_all_imported_paths;
|
interface->all_imported_paths = s_all_imported_paths;
|
||||||
interface->required_imported_paths = required_imported_paths;
|
interface->required_imported_paths = required_imported_paths;
|
||||||
|
|
||||||
if (lexer.consume_specific('['))
|
|
||||||
interface->extended_attributes = parse_extended_attributes();
|
|
||||||
|
|
||||||
parse_non_interface_entities(true, *interface);
|
parse_non_interface_entities(true, *interface);
|
||||||
|
|
||||||
if (lexer.consume_specific("interface"))
|
if (lexer.consume_specific("interface"))
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue