From 9153ef51aefb0572e43934f446ab516ec9770cc7 Mon Sep 17 00:00:00 2001 From: Tommi Komulainen Date: Wed, 15 Oct 2008 22:08:26 +0000 Subject: [PATCH] =?UTF-8?q?Bug=20556174=20=E2=80=93=20parse=20types=20for?= =?UTF-8?q?=20lists=20etc.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 2008-10-15 Tommi Komulainen Bug 556174 – parse types for lists etc. * girepository/girparser.c (end_type_recurse): * tests/boxed.gir: * tools/generate.c (write_type_info, write_field_info, write_callable_info, write_callable_info, write_constant_info, write_property_info): use nested s for lists and hashes svn path=/trunk/; revision=717 --- girparser.c | 27 +++++++++++++++------------ 1 file changed, 15 insertions(+), 12 deletions(-) diff --git a/girparser.c b/girparser.c index cdc47318a..35f882bea 100644 --- a/girparser.c +++ b/girparser.c @@ -1607,30 +1607,33 @@ end_type_recurse (ParseContext *ctx) { GList *types; GIrNodeType *parent; + GIrNodeType *param = NULL; parent = (GIrNodeType *) ((GList*)ctx->type_stack->data)->data; + if (ctx->type_parameters) + param = (GIrNodeType *) ctx->type_parameters->data; if (parent->tag == GI_TYPE_TAG_ARRAY || parent->tag == GI_TYPE_TAG_GLIST || parent->tag == GI_TYPE_TAG_GSLIST) { - if (ctx->type_parameters == NULL) - parent->parameter_type1 = parse_type (ctx, "pointer"); + g_assert (param != NULL); + + if (parent->parameter_type1 == NULL) + parent->parameter_type1 = param; else - parent->parameter_type1 = (GIrNodeType*)ctx->type_parameters->data; + g_assert_not_reached (); } else if (parent->tag == GI_TYPE_TAG_GHASH) { - if (ctx->type_parameters == NULL) - { - parent->parameter_type1 = parse_type (ctx, "pointer"); - parent->parameter_type2 = parse_type (ctx, "pointer"); - } + g_assert (param != NULL); + + if (parent->parameter_type1 == NULL) + parent->parameter_type1 = param; + else if (parent->parameter_type2 == NULL) + parent->parameter_type2 = param; else - { - parent->parameter_type1 = (GIrNodeType*) ctx->type_parameters->data; - parent->parameter_type2 = (GIrNodeType*) ctx->type_parameters->next->data; - } + g_assert_not_reached (); } g_list_free (ctx->type_parameters); ctx->type_parameters = (GList *)ctx->type_stack->data;