[gtk+/parser: 28/74] cssprovider: Don't fail with invalid syntax when parsing a value
- From: Benjamin Otte <otte src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk+/parser: 28/74] cssprovider: Don't fail with invalid syntax when parsing a value
- Date: Mon, 9 May 2011 15:24:21 +0000 (UTC)
commit 1e009447c52d16f8dfd3069e1c13dac0d3c4e98d
Author: Benjamin Otte <otte redhat com>
Date: Fri Apr 8 17:17:27 2011 +0200
cssprovider: Don't fail with invalid syntax when parsing a value
Instead, raise a PROPERTY_VALUE error, find the next semicolon or
closing bracket and resume parsing.
gtk/gtkcssprovider.c | 8 ++++++--
1 files changed, 6 insertions(+), 2 deletions(-)
---
diff --git a/gtk/gtkcssprovider.c b/gtk/gtkcssprovider.c
index 0ed88ea..8973eec 100644
--- a/gtk/gtkcssprovider.c
+++ b/gtk/gtkcssprovider.c
@@ -2386,8 +2386,12 @@ parse_rule (GtkCssProvider *css_provider,
if (scanner->token != G_TOKEN_IDENTIFIER)
{
g_free (prop);
- gtk_css_provider_invalid_token (css_provider, "Property value");
- return G_TOKEN_IDENTIFIER;
+ gtk_css_provider_error (css_provider,
+ GTK_CSS_PROVIDER_ERROR,
+ GTK_CSS_PROVIDER_ERROR_PROPERTY_VALUE,
+ "Could not parse property value");
+ css_provider_pop_scope (css_provider);
+ goto find_end_of_declaration;
}
value_str = scanner->value.v_identifier;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]