improved error message for the special case of store_unknown_tokens ==
2002-11-18 Sven Neumann <neo@wintermute> * app/config/gimpconfig-deserialize.c (gimp_config_deserialize_properties): improved error message for the special case of store_unknown_tokens == TRUE.
This commit is contained in:

committed by
Sven Neumann

parent
79101957a2
commit
6e5f6a0b16
@ -1,5 +1,9 @@
|
|||||||
2002-11-18 Sven Neumann <neo@wintermute>
|
2002-11-18 Sven Neumann <neo@wintermute>
|
||||||
|
|
||||||
|
* app/config/gimpconfig-deserialize.c
|
||||||
|
(gimp_config_deserialize_properties): improved error message for
|
||||||
|
the special case of store_unknown_tokens == TRUE.
|
||||||
|
|
||||||
* app/config/gimpconfig.c (gimp_config_add_unknown_token): try to
|
* app/config/gimpconfig.c (gimp_config_add_unknown_token): try to
|
||||||
substitute paths of the form ${foo} in the unknown token value.
|
substitute paths of the form ${foo} in the unknown token value.
|
||||||
|
|
||||||
|
@ -183,6 +183,17 @@ gimp_config_deserialize_properties (GObject *object,
|
|||||||
|
|
||||||
g_scanner_set_scope (scanner, old_scope_id);
|
g_scanner_set_scope (scanner, old_scope_id);
|
||||||
|
|
||||||
|
/* If store_unknown_tokens is TRUE but the unknown token value couldn't
|
||||||
|
be parsed the default error message is rather confusing.
|
||||||
|
We try to produce something more meaningful here ... */
|
||||||
|
if ((store_unknown_tokens &&
|
||||||
|
token == G_TOKEN_STRING && next == G_TOKEN_IDENTIFIER))
|
||||||
|
{
|
||||||
|
g_scanner_unexp_token (scanner, G_TOKEN_SYMBOL, NULL, NULL, NULL,
|
||||||
|
_("fatal parse error"), TRUE);
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
|
|
||||||
return gimp_config_deserialize_return (scanner, token, nest_level);
|
return gimp_config_deserialize_return (scanner, token, nest_level);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -183,6 +183,17 @@ gimp_config_deserialize_properties (GObject *object,
|
|||||||
|
|
||||||
g_scanner_set_scope (scanner, old_scope_id);
|
g_scanner_set_scope (scanner, old_scope_id);
|
||||||
|
|
||||||
|
/* If store_unknown_tokens is TRUE but the unknown token value couldn't
|
||||||
|
be parsed the default error message is rather confusing.
|
||||||
|
We try to produce something more meaningful here ... */
|
||||||
|
if ((store_unknown_tokens &&
|
||||||
|
token == G_TOKEN_STRING && next == G_TOKEN_IDENTIFIER))
|
||||||
|
{
|
||||||
|
g_scanner_unexp_token (scanner, G_TOKEN_SYMBOL, NULL, NULL, NULL,
|
||||||
|
_("fatal parse error"), TRUE);
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
|
|
||||||
return gimp_config_deserialize_return (scanner, token, nest_level);
|
return gimp_config_deserialize_return (scanner, token, nest_level);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user