File tree Expand file tree Collapse file tree 2 files changed +10
-2
lines changed Expand file tree Collapse file tree 2 files changed +10
-2
lines changed Original file line number Diff line number Diff line change @@ -670,6 +670,7 @@ etors:
670
670
- name : BINDLESS_IMAGES_SUPPORTS_IMPORTING_HANDLE_TYPE_EXP
671
671
desc : Enumerator for $xBindlessImagesSupportsImportingHandleTypeExp
672
672
value : ' 288'
673
+ max_id : ' 288'
673
674
---
674
675
type : enum
675
676
desc : Defines structure types
Original file line number Diff line number Diff line change @@ -64,6 +64,12 @@ def generate_function_type(
64
64
etor ["name" ]: etor ["value" ] for etor in existing_function_type ["etors" ]
65
65
}
66
66
max_etor = get_max_enum (existing_function_type )
67
+ stored_max_etor = existing_function_type .get ("max_id" )
68
+ try :
69
+ stored_max_etor = int (stored_max_etor ) if stored_max_etor is not None else None
70
+ except ValueError :
71
+ stored_max_etor = None
72
+ persistent_max = max_etor if stored_max_etor is None else max (max_etor , stored_max_etor )
67
73
functions = [
68
74
obj for s in specs for obj in s ["objects" ] if obj ["type" ] == "function"
69
75
]
@@ -73,8 +79,8 @@ def generate_function_type(
73
79
etor_name = "$X_FUNCTION_" + util .to_snake_case (fname ).upper ()
74
80
id = existing_etors .get (etor_name )
75
81
if id is None :
76
- max_etor += 1
77
- id = max_etor
82
+ persistent_max += 1
83
+ id = persistent_max
78
84
entry = {
79
85
"name" : etor_name ,
80
86
"desc" : f"Enumerator for $x{ fname } " ,
@@ -85,6 +91,7 @@ def generate_function_type(
85
91
registry .append (entry )
86
92
registry = sorted (registry , key = lambda x : int (x ["value" ]))
87
93
existing_function_type ["etors" ] = registry
94
+ existing_function_type ["max_id" ] = str (persistent_max )
88
95
update_fn (existing_function_type , meta )
89
96
90
97
## create a copy to write back to registry.yml
You can’t perform that action at this time.
0 commit comments