mirror of
https://github.com/IfcOpenShell/IfcOpenShell.git
synced 2026-08-13 02:47:48 +00:00
Fix codegen
This commit is contained in:
@@ -384,10 +384,10 @@ class SchemaClass(codegen.Base):
|
||||
else:
|
||||
match = re.search(r'\((\w+?_[\w+]+?_\w+?)\)', declared_type)
|
||||
if match:
|
||||
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())
|
||||
old_decl = match.group(1)
|
||||
name = old_decl.lower().replace(schema_name.lower() + '_', '').replace('_type', '')
|
||||
idx = [n.lower() for n in x.names].index(name)
|
||||
declared_type = declared_type.replace(old_decl, '%(schema_name)s_types[%(idx)d]' % locals())
|
||||
return declared_type
|
||||
return wrapper if code == EarlyBoundCodeWriter else fn
|
||||
|
||||
|
||||
@@ -32,8 +32,8 @@ IfcParse::schema_definition* header_section_schema_populate_schema() {
|
||||
header_section_schema_types[1] = new entity(strings[3], false, 1, (entity*) 0);
|
||||
header_section_schema_types[2] = new entity(strings[4], false, 2, (entity*) 0);
|
||||
((entity*)header_section_schema_types[0])->set_attributes({new attribute(strings[5], new aggregation_type(aggregation_type::list_type, 1, -1, new simple_type(simple_type::string_type)), false),new attribute(strings[6], new simple_type(simple_type::string_type), false)}, {false,false});
|
||||
((entity*)header_section_schema_types[1])->set_attributes({new attribute(strings[7], new simple_type(simple_type::string_type), false),new attribute(strings[8], new named_type(header_section_schema_HEADER_SECTION_SCHEMA_types[4]_type), false),new attribute(strings[9], new aggregation_type(aggregation_type::list_type, 1, -1, new simple_type(simple_type::string_type)), false),new attribute(strings[10], new aggregation_type(aggregation_type::list_type, 1, -1, new simple_type(simple_type::string_type)), false),new attribute(strings[11], new simple_type(simple_type::string_type), false),new attribute(strings[12], new simple_type(simple_type::string_type), false),new attribute(strings[13], new simple_type(simple_type::string_type), false)}, {false,false,false,false,false,false,false});
|
||||
((entity*)header_section_schema_types[2])->set_attributes({new attribute(strings[14], new aggregation_type(aggregation_type::list_type, 1, -1, new named_type(header_section_schema_HEADER_SECTION_SCHEMA_types[3]_type)), false)}, {false});
|
||||
((entity*)header_section_schema_types[1])->set_attributes({new attribute(strings[7], new simple_type(simple_type::string_type), false),new attribute(strings[8], new named_type(header_section_schema_types[4]), false),new attribute(strings[9], new aggregation_type(aggregation_type::list_type, 1, -1, new simple_type(simple_type::string_type)), false),new attribute(strings[10], new aggregation_type(aggregation_type::list_type, 1, -1, new simple_type(simple_type::string_type)), false),new attribute(strings[11], new simple_type(simple_type::string_type), false),new attribute(strings[12], new simple_type(simple_type::string_type), false),new attribute(strings[13], new simple_type(simple_type::string_type), false)}, {false,false,false,false,false,false,false});
|
||||
((entity*)header_section_schema_types[2])->set_attributes({new attribute(strings[14], new aggregation_type(aggregation_type::list_type, 1, -1, new named_type(header_section_schema_types[3])), false)}, {false});
|
||||
return new schema_definition(strings[15], {header_section_schema_types[0],header_section_schema_types[1],header_section_schema_types[2],header_section_schema_types[3],header_section_schema_types[4]}, new header_section_schema_instance_factory());
|
||||
}
|
||||
static std::unique_ptr<schema_definition> schema;
|
||||
|
||||
Reference in New Issue
Block a user