mirror of
https://github.com/RGBCube/serenity
synced 2025-07-26 08:27:45 +00:00
LibWeb: Support dictionary-only IDL files
This commit is contained in:
parent
b888d14e42
commit
43482dfde3
1 changed files with 73 additions and 72 deletions
|
@ -256,17 +256,6 @@ static NonnullOwnPtr<Interface> parse_interface(StringView filename, StringView
|
||||||
if (lexer.consume_specific('['))
|
if (lexer.consume_specific('['))
|
||||||
interface->extended_attributes = parse_extended_attributes();
|
interface->extended_attributes = parse_extended_attributes();
|
||||||
|
|
||||||
assert_string("interface");
|
|
||||||
consume_whitespace();
|
|
||||||
interface->name = lexer.consume_until([](auto ch) { return isspace(ch); });
|
|
||||||
consume_whitespace();
|
|
||||||
if (lexer.consume_specific(':')) {
|
|
||||||
consume_whitespace();
|
|
||||||
interface->parent_name = lexer.consume_until([](auto ch) { return isspace(ch); });
|
|
||||||
consume_whitespace();
|
|
||||||
}
|
|
||||||
assert_specific('{');
|
|
||||||
|
|
||||||
auto parse_type = [&] {
|
auto parse_type = [&] {
|
||||||
bool unsigned_ = lexer.consume_specific("unsigned");
|
bool unsigned_ = lexer.consume_specific("unsigned");
|
||||||
if (unsigned_)
|
if (unsigned_)
|
||||||
|
@ -539,6 +528,17 @@ static NonnullOwnPtr<Interface> parse_interface(StringView filename, StringView
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
if (lexer.consume_specific("interface")) {
|
||||||
|
consume_whitespace();
|
||||||
|
interface->name = lexer.consume_until([](auto ch) { return isspace(ch); });
|
||||||
|
consume_whitespace();
|
||||||
|
if (lexer.consume_specific(':')) {
|
||||||
|
consume_whitespace();
|
||||||
|
interface->parent_name = lexer.consume_until([](auto ch) { return isspace(ch); });
|
||||||
|
consume_whitespace();
|
||||||
|
}
|
||||||
|
assert_specific('{');
|
||||||
|
|
||||||
for (;;) {
|
for (;;) {
|
||||||
HashMap<String, String> extended_attributes;
|
HashMap<String, String> extended_attributes;
|
||||||
|
|
||||||
|
@ -604,8 +604,9 @@ static NonnullOwnPtr<Interface> parse_interface(StringView filename, StringView
|
||||||
interface->constructor_class = String::formatted("{}Constructor", interface->name);
|
interface->constructor_class = String::formatted("{}Constructor", interface->name);
|
||||||
interface->prototype_class = String::formatted("{}Prototype", interface->name);
|
interface->prototype_class = String::formatted("{}Prototype", interface->name);
|
||||||
interface->prototype_base_class = String::formatted("{}Prototype", interface->parent_name.is_empty() ? "Object" : interface->parent_name);
|
interface->prototype_base_class = String::formatted("{}Prototype", interface->parent_name.is_empty() ? "Object" : interface->parent_name);
|
||||||
|
|
||||||
consume_whitespace();
|
consume_whitespace();
|
||||||
|
}
|
||||||
|
|
||||||
while (!lexer.is_eof()) {
|
while (!lexer.is_eof()) {
|
||||||
assert_string("dictionary");
|
assert_string("dictionary");
|
||||||
consume_whitespace();
|
consume_whitespace();
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue