mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-02-28 21:22:11 +01:00
Make error more verbose in parser
By printing the function when arguments are missing https://bugzilla.gnome.org/show_bug.cgi?id=604161
This commit is contained in:
parent
c22f11f1b8
commit
e3cd97d492
11
girparser.c
11
girparser.c
@ -840,11 +840,14 @@ start_function (GMarkupParseContext *context,
|
|||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
parse_param_transfer (GIrNodeParam *param, const gchar *transfer)
|
parse_param_transfer (GIrNodeParam *param, const gchar *transfer, const gchar *name)
|
||||||
{
|
{
|
||||||
if (transfer == NULL)
|
if (transfer == NULL)
|
||||||
{
|
{
|
||||||
g_warning ("required attribute 'transfer-ownership' missing");
|
if (!name)
|
||||||
|
g_warning ("required attribute 'transfer-ownership' missing");
|
||||||
|
else
|
||||||
|
g_warning ("required attribute 'transfer-ownership' for function '%s'", name);
|
||||||
}
|
}
|
||||||
else if (strcmp (transfer, "none") == 0)
|
else if (strcmp (transfer, "none") == 0)
|
||||||
{
|
{
|
||||||
@ -948,7 +951,7 @@ start_parameter (GMarkupParseContext *context,
|
|||||||
else
|
else
|
||||||
param->allow_none = FALSE;
|
param->allow_none = FALSE;
|
||||||
|
|
||||||
parse_param_transfer (param, transfer);
|
parse_param_transfer (param, transfer, name);
|
||||||
|
|
||||||
if (scope && strcmp (scope, "call") == 0)
|
if (scope && strcmp (scope, "call") == 0)
|
||||||
param->scope = GI_SCOPE_TYPE_CALL;
|
param->scope = GI_SCOPE_TYPE_CALL;
|
||||||
@ -1950,7 +1953,7 @@ start_return_value (GMarkupParseContext *context,
|
|||||||
state_switch (ctx, STATE_FUNCTION_RETURN);
|
state_switch (ctx, STATE_FUNCTION_RETURN);
|
||||||
|
|
||||||
transfer = find_attribute ("transfer-ownership", attribute_names, attribute_values);
|
transfer = find_attribute ("transfer-ownership", attribute_names, attribute_values);
|
||||||
parse_param_transfer (param, transfer);
|
parse_param_transfer (param, transfer, NULL);
|
||||||
|
|
||||||
switch (CURRENT_NODE (ctx)->type)
|
switch (CURRENT_NODE (ctx)->type)
|
||||||
{
|
{
|
||||||
|
Loading…
x
Reference in New Issue
Block a user