LibIDL: Parse extended attributes for constructors

This commit is contained in:
Srikavin Ramkumar 2023-03-23 03:48:44 -04:00 committed by Andreas Kling
parent da671a0c16
commit 6bc6ea8e97
Notes: sideshowbarker 2024-07-17 00:49:59 +09:00
3 changed files with 5 additions and 4 deletions

View file

@ -366,7 +366,7 @@ Function Parser::parse_function(HashMap<DeprecatedString, DeprecatedString>& ext
return function;
}
void Parser::parse_constructor(Interface& interface)
void Parser::parse_constructor(HashMap<DeprecatedString, DeprecatedString>& extended_attributes, Interface& interface)
{
assert_string("constructor"sv);
consume_whitespace();
@ -376,7 +376,7 @@ void Parser::parse_constructor(Interface& interface)
consume_whitespace();
assert_specific(';');
interface.constructors.append(Constructor { interface.name, move(parameters) });
interface.constructors.append(Constructor { interface.name, move(parameters), move(extended_attributes) });
}
void Parser::parse_stringifier(HashMap<DeprecatedString, DeprecatedString>& extended_attributes, Interface& interface)
@ -551,7 +551,7 @@ void Parser::parse_interface(Interface& interface)
}
if (lexer.next_is("constructor")) {
parse_constructor(interface);
parse_constructor(extended_attributes, interface);
continue;
}

View file

@ -47,7 +47,7 @@ private:
void parse_interface_mixin(Interface&);
void parse_dictionary(Interface&);
void parse_callback_function(HashMap<DeprecatedString, DeprecatedString>& extended_attributes, Interface&);
void parse_constructor(Interface&);
void parse_constructor(HashMap<DeprecatedString, DeprecatedString>& extended_attributes, Interface&);
void parse_getter(HashMap<DeprecatedString, DeprecatedString>& extended_attributes, Interface&);
void parse_setter(HashMap<DeprecatedString, DeprecatedString>& extended_attributes, Interface&);
void parse_deleter(HashMap<DeprecatedString, DeprecatedString>& extended_attributes, Interface&);

View file

@ -164,6 +164,7 @@ struct Function {
struct Constructor {
DeprecatedString name;
Vector<Parameter> parameters;
HashMap<DeprecatedString, DeprecatedString> extended_attributes;
size_t shortest_length() const { return get_function_shortest_length(*this); }
};