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:
Sven Neumann 2002-11-18 20:19:37 +00:00 committed by Sven Neumann
parent 79101957a2
commit 6e5f6a0b16
3 changed files with 26 additions and 0 deletions

View File

@ -1,5 +1,9 @@
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
substitute paths of the form ${foo} in the unknown token value.

View File

@ -183,6 +183,17 @@ gimp_config_deserialize_properties (GObject *object,
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);
}

View File

@ -183,6 +183,17 @@ gimp_config_deserialize_properties (GObject *object,
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);
}