[gtk+] cssprovider: Don't fail with invalid syntax when parsing a value



commit 5e054b37a26250b672d5f09387cac24db2cb99ea
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 c03e749..0845ed4 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]