diff --git a/girparser.c b/girparser.c index 5efe7fded..678edcc35 100644 --- a/girparser.c +++ b/girparser.c @@ -76,6 +76,7 @@ typedef enum STATE_ALIAS, /* 30 */ STATE_TYPE, STATE_ATTRIBUTE, + STATE_DOC, STATE_PASSTHROUGH } ParseState; @@ -1957,6 +1958,22 @@ end_type (ParseContext *ctx) } } +static gboolean +start_doc (GMarkupParseContext *context, + const gchar *element_name, + const gchar **attribute_names, + const gchar **attribute_values, + ParseContext *ctx, + GError **error) +{ + if (strcmp (element_name, "doc") != 0 || ctx->node_stack == NULL) + return FALSE; + + state_switch (ctx, STATE_DOC); + + return TRUE; +} + static gboolean start_attribute (GMarkupParseContext *context, const gchar *element_name, @@ -2570,6 +2587,9 @@ start_element_handler (GMarkupParseContext *context, attribute_names, attribute_values, ctx, error)) goto out; + else if (start_doc (context, element_name, attribute_names, + attribute_values, ctx, error)) + goto out; break; case 'e': @@ -3207,6 +3227,13 @@ end_element_handler (GMarkupParseContext *context, } break; + case STATE_DOC: + if (strcmp ("doc", element_name) == 0) + { + state_switch (ctx, ctx->prev_state); + } + break; + case STATE_PASSTHROUGH: ctx->unknown_depth -= 1; if (ctx->unknown_depth == 0)