Add header schema

This commit is contained in:
Thomas Krijnen
2025-02-25 21:30:20 +01:00
parent a420c4b707
commit 1d9dcb3ab7
2 changed files with 30 additions and 3 deletions
@@ -384,9 +384,8 @@ class SchemaClass(codegen.Base):
else:
match = re.search(r'\((\w+?_[\w+]+?_\w+?)\)', declared_type)
if match:
old_decl = match.group(1)
tn = old_decl.rsplit('_', 2)[1]
idx = x.names.index(tn)
old_decl = match.group(1).lower().replace(schema_name.lower() + '_', '').replace('_type', '')
idx = [n.lower() for n in x.names].index(old_decl)
snu = schema_name.upper()
declared_type = declared_type.replace(old_decl, '%(snu)s_types[%(idx)d]' % locals())
return declared_type