[gtk+] cssprovider: use INVALID_SYNTAX for unexpected token error



commit 4622614784fb113882607e04360011c9a63508bb
Author: Benjamin Otte <otte redhat com>
Date:   Fri Apr 8 00:18:38 2011 +0200

    cssprovider: use INVALID_SYNTAX for unexpected token error

 gtk/gtkcssprovider.c |    8 +++++---
 1 files changed, 5 insertions(+), 3 deletions(-)
---
diff --git a/gtk/gtkcssprovider.c b/gtk/gtkcssprovider.c
index e0a42c7..e04d739 100644
--- a/gtk/gtkcssprovider.c
+++ b/gtk/gtkcssprovider.c
@@ -1633,7 +1633,7 @@ gtk_css_provider_invalid_token (GtkCssProvider *provider,
 {
   gtk_css_provider_error (provider,
                           GTK_CSS_PROVIDER_ERROR,
-                          GTK_CSS_PROVIDER_ERROR_FAILED,
+                          GTK_CSS_PROVIDER_ERROR_SYNTAX,
                           "expected a valid %s", expected);
 }
 
@@ -3657,10 +3657,12 @@ parse_rule (GtkCssProvider  *css_provider,
 
 find_end_of_declaration:
       while (scanner->token != ';' &&
-             scanner->token != G_TOKEN_RIGHT_CURLY)
+             scanner->token != G_TOKEN_RIGHT_CURLY &&
+             scanner->token != G_TOKEN_EOF)
         g_scanner_get_next_token (scanner);
       
-      if (scanner->token == G_TOKEN_RIGHT_CURLY)
+      if (scanner->token == G_TOKEN_RIGHT_CURLY ||
+          scanner->token == G_TOKEN_EOF)
         break;
 
       g_scanner_get_next_token (scanner);



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]