LibWeb: Replace all uses of -'s and ::'s when running the IDL generator

These were obvious wrong uses of the old default "only first occurence"
parameter that was used in String::replace.
This commit is contained in:
DexesTTP 2022-07-05 22:47:21 +02:00 committed by Linus Groh
parent 7ceeb74535
commit 6c7ee391cb
Notes: sideshowbarker 2024-07-17 09:40:45 +09:00

View file

@ -153,7 +153,7 @@ static String make_input_acceptable_cpp(String const& input)
return builder.to_string();
}
return input.replace("-", "_", ReplaceMode::FirstOnly);
return input.replace("-", "_", ReplaceMode::All);
}
static void generate_include_for_wrapper(auto& generator, auto& wrapper_name)
@ -237,7 +237,7 @@ static void emit_includes_for_all_imports(auto& interface, auto& generator, bool
if (is_iterator) {
auto iterator_name = String::formatted("{}Iterator", interface->name);
auto iterator_path = String::formatted("{}Iterator", interface->fully_qualified_name.replace("::", "/", ReplaceMode::FirstOnly));
auto iterator_path = String::formatted("{}Iterator", interface->fully_qualified_name.replace("::", "/", ReplaceMode::All));
generate_include_for_iterator(generator, iterator_path, iterator_name);
}
@ -3635,7 +3635,7 @@ void generate_iterator_prototype_implementation(IDL::Interface const& interface)
generator.set("prototype_class", String::formatted("{}IteratorPrototype", interface.name));
generator.set("wrapper_class", String::formatted("{}IteratorWrapper", interface.name));
generator.set("fully_qualified_name", String::formatted("{}Iterator", interface.fully_qualified_name));
generator.set("possible_include_path", String::formatted("{}Iterator", interface.name.replace("::", "/", ReplaceMode::FirstOnly)));
generator.set("possible_include_path", String::formatted("{}Iterator", interface.name.replace("::", "/", ReplaceMode::All)));
generator.append(R"~~~(
#include <AK/Function.h>