File tree Expand file tree Collapse file tree 2 files changed +12
-2
lines changed Expand file tree Collapse file tree 2 files changed +12
-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,14 @@ 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 = (
73
+ max_etor if stored_max_etor is None else max (max_etor , stored_max_etor )
74
+ )
67
75
functions = [
68
76
obj for s in specs for obj in s ["objects" ] if obj ["type" ] == "function"
69
77
]
@@ -73,8 +81,8 @@ def generate_function_type(
73
81
etor_name = "$X_FUNCTION_" + util .to_snake_case (fname ).upper ()
74
82
id = existing_etors .get (etor_name )
75
83
if id is None :
76
- max_etor += 1
77
- id = max_etor
84
+ persistent_max += 1
85
+ id = persistent_max
78
86
entry = {
79
87
"name" : etor_name ,
80
88
"desc" : f"Enumerator for $x{ fname } " ,
@@ -85,6 +93,7 @@ def generate_function_type(
85
93
registry .append (entry )
86
94
registry = sorted (registry , key = lambda x : int (x ["value" ]))
87
95
existing_function_type ["etors" ] = registry
96
+ existing_function_type ["max_id" ] = str (persistent_max )
88
97
update_fn (existing_function_type , meta )
89
98
90
99
## create a copy to write back to registry.yml
You can’t perform that action at this time.
0 commit comments