Fix some style details in generation

(cherry picked from commit e7a13e3bf4)
pull/1529/head
A Thousand Ships 2024-03-27 13:54:05 +01:00 committed by David Snopek
parent f16814ee05
commit 1f57a8d76e
1 changed files with 14 additions and 12 deletions

View File

@ -627,6 +627,8 @@ def generate_builtin_class_header(builtin_api, size, used_classes, fully_used_cl
if "return_type" in method:
method_signature += f'{correct_type(method["return_type"])}'
if not method_signature.endswith("*"):
method_signature += " "
else:
method_signature += "void "
@ -1449,8 +1451,6 @@ def generate_engine_class_header(class_api, used_classes, fully_used_classes, us
vararg = "is_vararg" in method and method["is_vararg"]
method_signature = "\t"
if vararg:
method_signature += "private: "
method_signature += make_signature(
class_name, method, for_header=True, use_template_get_node=use_template_get_node
)
@ -1585,7 +1585,9 @@ def generate_engine_class_header(class_api, used_classes, fully_used_classes, us
False,
)
if return_type is not None:
method_signature += return_type + " "
method_signature += return_type
if not method_signature.endswith("*"):
method_signature += " "
else:
method_signature += "void "
@ -2476,7 +2478,7 @@ def correct_type(type_name, meta=None, use_alias=True):
return f"Ref<{type_name}>"
if type_name == "Object" or is_engine_class(type_name):
return f"{type_name} *"
if type_name.endswith("*"):
if type_name.endswith("*") and not type_name.endswith("**") and not type_name.endswith(" *"):
return f"{type_name[:-1]} *"
return type_name