#2037 Option to optain declaration from early bound select definitions

This commit is contained in:
Thomas Krijnen
2022-02-10 13:06:04 +01:00
parent 618d902a57
commit 5af7e95bee
2 changed files with 20 additions and 1 deletions
@@ -55,6 +55,14 @@ class Implementation(codegen.Base):
templates.enum_from_string_stmt % dict(context, **locals()) for value in enum.values
),
)
for name, enum in mapping.schema.selects.items():
write(
templates.select_function,
name=name,
schema_name=schema_name,
schema_name_upper=schema_name_upper
)
write = lambda str, **kwargs: entity_implementations.append(str % kwargs)
@@ -348,6 +356,10 @@ class Implementation(codegen.Base):
("extern enumeration_type* %s_%%s_type;" % schema_name_upper) % n
for n in mapping.schema.enumerations.keys()
]
+ [
("extern select_type* %s_%%s_type;" % schema_name_upper) % n
for n in mapping.schema.selects.keys()
]
)
self.str = templates.implementation % {