mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-22 23:50:19 +00:00
LibIDL: Parse extended attributes for constructors
This commit is contained in:
parent
da671a0c16
commit
6bc6ea8e97
Notes:
sideshowbarker
2024-07-17 00:49:59 +09:00
Author: https://github.com/srikavin Commit: https://github.com/SerenityOS/serenity/commit/6bc6ea8e97 Pull-request: https://github.com/SerenityOS/serenity/pull/18004
3 changed files with 5 additions and 4 deletions
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
|
@ -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&);
|
||||
|
|
|
@ -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); }
|
||||
};
|
||||
|
|
Loading…
Reference in a new issue