mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-09-17 15:02:24 +00:00
IDLGenerators: Allow initialize()
as an IDL member name
While not a C++ keyword, we already define a `Foo::initialize()` method on every generated binding type, so we need to avoid clashing with that.
This commit is contained in:
parent
ef252d63c8
commit
3ca879776f
Notes:
github-actions[bot]
2025-07-21 09:07:01 +00:00
Author: https://github.com/AtkinsSJ
Commit: 3ca879776f
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/5452
Reviewed-by: https://github.com/tcl3
1 changed files with 14 additions and 1 deletions
|
@ -324,7 +324,20 @@ CppType idl_type_name_to_cpp_type(Type const& type, Interface const& interface)
|
||||||
|
|
||||||
static ByteString make_input_acceptable_cpp(ByteString const& input)
|
static ByteString make_input_acceptable_cpp(ByteString const& input)
|
||||||
{
|
{
|
||||||
if (input.is_one_of("class", "template", "for", "default", "char", "namespace", "delete", "inline", "register", "switch", "mutable", "continue")) {
|
if (input.is_one_of(
|
||||||
|
"char",
|
||||||
|
"class",
|
||||||
|
"continue",
|
||||||
|
"default",
|
||||||
|
"delete",
|
||||||
|
"for",
|
||||||
|
"initialize",
|
||||||
|
"inline",
|
||||||
|
"mutable",
|
||||||
|
"namespace",
|
||||||
|
"register",
|
||||||
|
"switch",
|
||||||
|
"template")) {
|
||||||
StringBuilder builder;
|
StringBuilder builder;
|
||||||
builder.append(input);
|
builder.append(input);
|
||||||
builder.append('_');
|
builder.append('_');
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue