LibWeb+LibIDL: Remove support for #import directives during parsing

These no longer serve any purpose now that we run the IDLGenerator
on all of these files at once.
This commit is contained in:
Shannon Booth
2026-04-23 22:41:12 +02:00
committed by Shannon Booth
parent ba741994dd
commit cc6e048bd6
Notes: github-actions[bot] 2026-04-24 18:09:33 +00:00
527 changed files with 10 additions and 1840 deletions

View File

@@ -95,7 +95,6 @@ ErrorOr<int> ladybird_main(Main::Arguments arguments)
{
Core::ArgsParser args_parser;
Vector<ByteString> paths;
Vector<ByteString> base_paths;
StringView output_path = "-"sv;
StringView depfile_path;
@@ -110,17 +109,6 @@ ErrorOr<int> ladybird_main(Main::Arguments arguments)
return true;
},
});
args_parser.add_option(Core::ArgsParser::Option {
.argument_mode = Core::ArgsParser::OptionArgumentMode::Required,
.help_string = "Path to root of IDL file tree(s)",
.long_name = "base-path",
.short_name = 'b',
.value_name = "base-path",
.accept_value = [&](StringView s) {
base_paths.append(s);
return true;
},
});
args_parser.add_option(output_path, "Path to output generated files into", "output-path", 'o', "output-path");
args_parser.add_option(depfile_path, "Path to write dependency file to", "depfile", 'd', "depfile-path");
args_parser.add_positional_argument(paths, "IDL file(s)", "idl-files");
@@ -152,15 +140,8 @@ ErrorOr<int> ladybird_main(Main::Arguments arguments)
for (auto const& path : paths) {
auto file = TRY(Core::MappedFile::map(path, Core::MappedFile::Mode::ReadOnly));
auto lexical_path = LexicalPath { path };
auto import_base_paths = base_paths;
if (import_base_paths.is_empty())
import_base_paths.append(lexical_path.dirname());
auto module = IDL::Parser::parse(path, file->bytes(), move(import_base_paths), context);
auto module = IDL::Parser::parse(path, file->bytes(), context);
append_dependency_path(path);
for (auto const& imported_file : module.imported_files)
append_dependency_path(imported_file);
}
context.resolve();