gobject-introspection r311 - branches/gir-compiler/tools
- From: johan svn gnome org
- To: svn-commits-list gnome org
- Subject: gobject-introspection r311 - branches/gir-compiler/tools
- Date: Thu, 7 Aug 2008 12:17:03 +0000 (UTC)
Author: johan
Date: Thu Aug 7 12:17:03 2008
New Revision: 311
URL: http://svn.gnome.org/viewvc/gobject-introspection?rev=311&view=rev
Log:
Parse glib:boxed fields
Modified:
branches/gir-compiler/tools/girparser.c
Modified: branches/gir-compiler/tools/girparser.c
==============================================================================
--- branches/gir-compiler/tools/girparser.c (original)
+++ branches/gir-compiler/tools/girparser.c Thu Aug 7 12:17:03 2008
@@ -48,9 +48,10 @@
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 @@
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 @@
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 @@
{
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 @@
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)
{
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]