mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-06-03 19:30:07 +02:00
girparser: Ignore new doc:format element in GIR files
As of gobject-introspection 1.83.2, a new `<doc:format name="…"/>` element is supported (as a child of `<repository>`) in GIR files. For the moment, this information isn’t needed in libgirepository — but the GIR parser does have to know about the element in order to not throw an error claiming it’s invalid. This is a slightly tweaked version of the code added to gobject-introspection.git in commit 9544cd6c962fab2c3203898779948309833e2439 by Corentin Noël <corentin.noel@collabora.com>, reformatted slightly to fit in with GLib’s style guidelines. This is backwards compatible and does not require a new gobject-introspection version. Signed-off-by: Philip Withnall <pwithnall@gnome.org> Fixes: #3634
This commit is contained in:
parent
09f672e60b
commit
aee0664e6f
@ -107,7 +107,8 @@ typedef enum
|
||||
STATE_ALIAS,
|
||||
STATE_TYPE,
|
||||
STATE_ATTRIBUTE,
|
||||
STATE_PASSTHROUGH
|
||||
STATE_PASSTHROUGH,
|
||||
STATE_DOC_FORMAT, /* 35 */
|
||||
} ParseState;
|
||||
|
||||
typedef struct _ParseContext ParseContext;
|
||||
@ -3159,6 +3160,11 @@ start_element_handler (GMarkupParseContext *context,
|
||||
state_switch (ctx, STATE_PASSTHROUGH);
|
||||
goto out;
|
||||
}
|
||||
else if (strcmp ("doc:format", element_name) == 0)
|
||||
{
|
||||
state_switch (ctx, STATE_DOC_FORMAT);
|
||||
goto out;
|
||||
}
|
||||
break;
|
||||
|
||||
case 'e':
|
||||
@ -3843,6 +3849,10 @@ end_element_handler (GMarkupParseContext *context,
|
||||
state_switch (ctx, ctx->prev_state);
|
||||
}
|
||||
break;
|
||||
case STATE_DOC_FORMAT:
|
||||
if (require_end_element (context, ctx, "doc:format", element_name, error))
|
||||
state_switch (ctx, STATE_REPOSITORY);
|
||||
break;
|
||||
|
||||
case STATE_PASSTHROUGH:
|
||||
ctx->unknown_depth -= 1;
|
||||
|
Loading…
x
Reference in New Issue
Block a user