Skip to content

Commit f2f973d

Browse files
Fix some style details in generation
1 parent 9e2771f commit f2f973d

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

binding_generator.py

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -709,7 +709,9 @@ def generate_builtin_class_header(builtin_api, size, used_classes, fully_used_cl
709709
method_signature += "static "
710710

711711
if "return_type" in method:
712-
method_signature += f'{correct_type(method["return_type"])} '
712+
method_signature += f'{correct_type(method["return_type"])}'
713+
if not method_signature.endswith("*"):
714+
method_signature += " "
713715
else:
714716
method_signature += "void "
715717

@@ -1692,7 +1694,9 @@ def generate_engine_class_header(class_api, used_classes, fully_used_classes, us
16921694
False,
16931695
)
16941696
if return_type is not None:
1695-
method_signature += return_type + " "
1697+
method_signature += return_type
1698+
if not method_signature.endswith("*"):
1699+
method_signature += " "
16961700
else:
16971701
method_signature += "void "
16981702

@@ -2626,7 +2630,7 @@ def correct_type(type_name, meta=None, use_alias=True):
26262630
return f"Ref<{type_name}>"
26272631
if type_name == "Object" or is_engine_class(type_name):
26282632
return f"{type_name} *"
2629-
if type_name.endswith("*"):
2633+
if type_name.endswith("*") and not type_name.endswith("**") and not type_name.endswith(" *"):
26302634
return f"{type_name[:-1]} *"
26312635
return type_name
26322636

0 commit comments

Comments
 (0)