- array->scope = new_declaration_scope(parent_scope);
- array->current_element.declaration =
- array_type->elem->declaration_new(array_type->elem,
- parent_scope);
+ array->p.index = index;
+ array->scope = new_definition_scope(parent_scope, field_name);
+ array->elems = g_array_sized_new(FALSE, TRUE, sizeof(struct field),
+ array_declaration->len);
+ g_array_set_size(array->elems, array_declaration->len);
+ for (i = 0; i < array_declaration->len; i++) {
+ struct field *field;
+ GString *str;
+ GQuark name;
+
+ str = g_string_new("");
+ g_string_printf(str, "[%" PRIu64 "]", i);
+ name = g_quark_from_string(str->str);
+ (void) g_string_free(str, TRUE);
+
+ field = &g_array_index(array->elems, struct field, i);
+ field->name = name;
+ field->definition = array_declaration->elem->definition_new(array_declaration->elem,
+ array->scope,
+ name, i);
+ }