+static bool had_initializer_brace_warning;
+
+static initializer_t *parse_sub_initializer(type_t *type,
+ expression_t *expression,
+ type_t *expression_type)
+{
+ if(is_type_scalar(type)) {
+ /* there might be extra {} hierarchies */
+ if(token.type == '{') {
+ next_token();
+ if(!had_initializer_brace_warning) {
+ parse_warning("braces around scalar initializer");
+ had_initializer_brace_warning = true;
+ }
+ initializer_t *result = parse_sub_initializer(type, NULL, NULL);
+ if(token.type == ',') {
+ next_token();
+ /* TODO: warn about excessive elements */
+ }
+ expect_block('}');
+ return result;
+ }
+
+ if(expression == NULL) {
+ expression = parse_assignment_expression();
+ }
+ return initializer_from_expression(type, expression);
+ }
+
+ /* TODO: ignore qualifiers, comparing pointers is probably
+ * not correct */
+ if(expression != NULL && expression_type == type) {
+ initializer_value_t *result = allocate_ast_zero(sizeof(result[0]));
+ result->initializer.type = INITIALIZER_VALUE;
+
+ if(type != NULL) {
+ semantic_assign(type, &expression, "initializer");
+ }
+ result->value = expression;
+
+ return (initializer_t*) result;
+ }
+
+ bool read_paren = false;
+ if(token.type == '{') {
+ next_token();
+ read_paren = true;
+ }
+
+ /* descend into subtype */
+ initializer_t *result = NULL;
+ initializer_t **elems;
+ if(type->type == TYPE_ARRAY) {
+ array_type_t *array_type = (array_type_t*) type;
+ type_t *element_type = array_type->element_type;
+ element_type = skip_typeref(element_type);
+
+ initializer_t *sub;
+ had_initializer_brace_warning = false;
+ if(expression == NULL) {
+ sub = parse_sub_initializer_elem(element_type);