diff --git a/Userland/Libraries/LibIDL/IDLParser.cpp b/Userland/Libraries/LibIDL/IDLParser.cpp index d55aabd03e2..7341d045c86 100644 --- a/Userland/Libraries/LibIDL/IDLParser.cpp +++ b/Userland/Libraries/LibIDL/IDLParser.cpp @@ -635,12 +635,13 @@ void Parser::parse_namespace(Interface& interface) consume_whitespace(); } -void Parser::parse_enumeration(Interface& interface) +void Parser::parse_enumeration(HashMap extended_attributes, Interface& interface) { assert_string("enum"sv); consume_whitespace(); Enumeration enumeration {}; + enumeration.extended_attributes = move(extended_attributes); auto name = lexer.consume_until([](auto ch) { return is_ascii_space(ch); }); consume_whitespace(); @@ -832,7 +833,7 @@ void Parser::parse_non_interface_entities(bool allow_interface, Interface& inter if (lexer.next_is("dictionary")) { parse_dictionary(interface); } else if (lexer.next_is("enum")) { - parse_enumeration(interface); + parse_enumeration(extended_attributes, interface); } else if (lexer.next_is("typedef")) { parse_typedef(interface); } else if (lexer.next_is("interface mixin")) { diff --git a/Userland/Libraries/LibIDL/IDLParser.h b/Userland/Libraries/LibIDL/IDLParser.h index 32b0cf9e85f..53b88f74882 100644 --- a/Userland/Libraries/LibIDL/IDLParser.h +++ b/Userland/Libraries/LibIDL/IDLParser.h @@ -42,7 +42,7 @@ private: void parse_interface(Interface&); void parse_namespace(Interface&); void parse_non_interface_entities(bool allow_interface, Interface&); - void parse_enumeration(Interface&); + void parse_enumeration(HashMap, Interface&); void parse_typedef(Interface&); void parse_interface_mixin(Interface&); void parse_dictionary(Interface&); diff --git a/Userland/Libraries/LibIDL/Types.h b/Userland/Libraries/LibIDL/Types.h index 2a13e580cb5..1524d55d15b 100644 --- a/Userland/Libraries/LibIDL/Types.h +++ b/Userland/Libraries/LibIDL/Types.h @@ -211,6 +211,7 @@ struct Typedef { struct Enumeration { OrderedHashTable values; OrderedHashMap translated_cpp_names; + HashMap extended_attributes; DeprecatedString first_member; bool is_original_definition { true }; };