- array_class = g_new(struct type_class_array, 1);
- type_class = &array_class->p;
+ array = g_new(struct definition_array, 1);
+ declaration_ref(&array_declaration->p);
+ array->p.declaration = declaration;
+ array->declaration = array_declaration;
+ array->p.ref = 1;
+ /*
+ * Use INT_MAX order to ensure that all fields of the parent
+ * scope are seen as being prior to this scope.
+ */
+ array->p.index = root_name ? INT_MAX : index;
+ array->p.name = field_name;
+ array->p.path = new_definition_path(parent_scope, field_name, root_name);
+ array->scope = new_definition_scope(parent_scope, field_name, root_name);
+ ret = register_field_definition(field_name, &array->p,
+ parent_scope);
+ assert(!ret);
+ array->elems = g_ptr_array_sized_new(array_declaration->len);
+ g_ptr_array_set_size(array->elems, array_declaration->len);
+ for (i = 0; i < array_declaration->len; i++) {
+ struct definition **field;
+ GString *str;
+ GQuark name;