summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJasper St. Pierre <jstpierre@mecheye.net>2013-01-31 23:02:02 -0500
committerJasper St. Pierre <jstpierre@mecheye.net>2013-02-01 19:36:38 -0500
commit93cd5b208b19e7c532972b85a457518082e1fc2b (patch)
tree227b567ad4afc5a77aabbe8053f1ead8b1c2c9a3
parent5a6f6a756cd5ab45389342de55d630478e7a9e9f (diff)
downloadgobject-introspection-93cd5b208b19e7c532972b85a457518082e1fc2b.tar.gz
girparser: Clean up passthrough handling
Instead of remembering to have to set unknown_depth, smarten up state_switch to do it for us. https://bugzilla.gnome.org/show_bug.cgi?id=693040
-rw-r--r--girepository/girparser.c10
1 files changed, 4 insertions, 6 deletions
diff --git a/girepository/girparser.c b/girepository/girparser.c
index 6015a043..d1bc81f5 100644
--- a/girepository/girparser.c
+++ b/girepository/girparser.c
@@ -341,6 +341,9 @@ state_switch (ParseContext *ctx, ParseState newstate)
g_assert (ctx->state != newstate);
ctx->prev_state = ctx->state;
ctx->state = newstate;
+
+ if (ctx->state == STATE_PASSTHROUGH)
+ ctx->unknown_depth = 1;
}
static GIrNode *
@@ -724,10 +727,7 @@ introspectable_prelude (GMarkupParseContext *context,
if (introspectable)
state_switch (ctx, new_state);
else
- {
- state_switch (ctx, STATE_PASSTHROUGH);
- ctx->unknown_depth = 1;
- }
+ state_switch (ctx, STATE_PASSTHROUGH);
return introspectable;
}
@@ -2751,7 +2751,6 @@ start_element_handler (GMarkupParseContext *context,
if (strcmp (element_name, "doc") == 0)
{
state_switch (ctx, STATE_PASSTHROUGH);
- ctx->unknown_depth = 1;
goto out;
}
break;
@@ -3014,7 +3013,6 @@ start_element_handler (GMarkupParseContext *context,
ctx->file_path, line_number, char_number, element_name,
ctx->state);
state_switch (ctx, STATE_PASSTHROUGH);
- ctx->unknown_depth = 1;
}
out: