summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohan Dahlin <johan@src.gnome.org>2008-08-07 12:17:03 +0000
committerJohan Dahlin <johan@src.gnome.org>2008-08-07 12:17:03 +0000
commitca7406e60948fa302b962cdfe6ba55137f8b0c06 (patch)
treec8486e0e41c101bfba95c7351a1247caa07acf5f
parent98ae37bb5e8dcf745a4897f35ecd036001fa9a12 (diff)
downloadgobject-introspection-ca7406e60948fa302b962cdfe6ba55137f8b0c06.tar.gz
Parse glib:boxed fields
svn path=/branches/gir-compiler/; revision=311
-rw-r--r--tools/girparser.c29
1 files changed, 23 insertions, 6 deletions
diff --git a/tools/girparser.c b/tools/girparser.c
index d851d1c1..81230a48 100644
--- a/tools/girparser.c
+++ b/tools/girparser.c
@@ -48,9 +48,10 @@ typedef enum
STATE_IMPLEMENTS, /* 15 */
STATE_REQUIRES,
STATE_BOXED,
+ STATE_BOXED_FIELD,
STATE_STRUCT,
- STATE_STRUCT_FIELD,
- STATE_ERRORDOMAIN, /* 20 */
+ STATE_STRUCT_FIELD, /* 20 */
+ STATE_ERRORDOMAIN,
STATE_UNION,
} ParseState;
@@ -800,6 +801,7 @@ start_field (GMarkupParseContext *context,
boxed = (GIrNodeBoxed *)ctx->current_node;
boxed->members = g_list_append (boxed->members, field);
+ state_switch (ctx, STATE_BOXED_FIELD);
}
break;
case G_IR_NODE_STRUCT:
@@ -1269,9 +1271,14 @@ start_type (GMarkupParseContext *context,
const gchar *ctype;
if (strcmp (element_name, "type") != 0 ||
- !(ctx->state == STATE_FUNCTION_PARAMETER || ctx->state == STATE_FUNCTION_RETURN ||
- ctx->state == STATE_STRUCT_FIELD || ctx->state == STATE_OBJECT_PROPERTY ||
- ctx->state == STATE_OBJECT_FIELD || ctx->state == STATE_INTERFACE_FIELD))
+ !(ctx->state == STATE_FUNCTION_PARAMETER ||
+ ctx->state == STATE_FUNCTION_RETURN ||
+ ctx->state == STATE_STRUCT_FIELD ||
+ ctx->state == STATE_OBJECT_PROPERTY ||
+ ctx->state == STATE_OBJECT_FIELD ||
+ ctx->state == STATE_INTERFACE_FIELD ||
+ ctx->state == STATE_BOXED_FIELD
+ ))
return FALSE;
if (!ctx->current_typed)
@@ -1643,6 +1650,9 @@ start_element_handler (GMarkupParseContext *context,
{
ParseContext *ctx = user_data;
gint line_number, char_number;
+#if 0
+ g_printerr ("element-name: '%s'\n", element_name);
+#endif
switch (element_name[0])
{
@@ -2040,13 +2050,20 @@ end_element_handler (GMarkupParseContext *context,
break;
case STATE_BOXED:
- if (strcmp (element_name, "boxed") == 0)
+ if (strcmp (element_name, "glib:boxed") == 0)
{
ctx->current_node = NULL;
state_switch (ctx, STATE_NAMESPACE);
}
break;
+ case STATE_BOXED_FIELD:
+ if (strcmp (element_name, "field") == 0)
+ {
+ state_switch (ctx, STATE_BOXED);
+ }
+ break;
+
case STATE_STRUCT_FIELD:
if (strcmp (element_name, "field") == 0)
{