1
2
Fork 0
mirror of https://github.com/mat-1/azalea.git synced 2025-08-02 06:16:04 +00:00

fix codegen

This commit is contained in:
mat 2022-10-24 21:10:09 -05:00
parent 0d55c71cee
commit f38d0660d1

View file

@ -80,8 +80,14 @@ def burger_type_to_rust_type(burger_type, field_name: Optional[str] = None, inst
enum_first_part_name)
print('enum_first_part_obfuscated_name',
enum_first_part_obfuscated_name)
enum_name = mappings.get_method_type(
enum_first_part_obfuscated_name, enum_field.split('.')[1].split('(')[0], '')
print('enum field', enum_field.split('.')[1].split('(')[0])
try:
enum_name = mappings.get_method_type(
enum_first_part_obfuscated_name, enum_field.split('.')[1].split('(')[0], '')
except KeyError:
# sometimes enums are fields instead of methods
enum_name = mappings.get_field_type(
enum_first_part_obfuscated_name, enum_field.split('.')[1].split('(')[0])
print('hm', enum_name)
else:
@ -160,4 +166,3 @@ def clean_property_name(property_name):
property_name = 'kind'
return property_name