[gtk/wip/otte/css: 221/225] selector: Inlcude : sign when reporting errors



commit 4cba9dcf6e354fd8a2aab677342db170e7f79d8a
Author: Benjamin Otte <otte redhat com>
Date:   Thu Apr 11 19:44:46 2019 +0200

    selector: Inlcude : sign when reporting errors

 gtk/gtkcssselector.c | 20 +++++++++++++++++---
 1 file changed, 17 insertions(+), 3 deletions(-)
---
diff --git a/gtk/gtkcssselector.c b/gtk/gtkcssselector.c
index 15da385760..26b2e087b9 100644
--- a/gtk/gtkcssselector.c
+++ b/gtk/gtkcssselector.c
@@ -1241,8 +1241,10 @@ gtk_css_selector_parse_selector_pseudo_class (GtkCssParser   *parser,
                                               GtkCssSelector *selector,
                                               gboolean        negate)
 {
+  GtkCssLocation start_location;
   const GtkCssToken *token;
 
+  start_location = *gtk_css_parser_get_start_location (parser);
   gtk_css_parser_consume_token (parser);
   for (token = gtk_css_parser_peek_token (parser);
        gtk_css_token_is (token, GTK_CSS_TOKEN_COMMENT);
@@ -1301,7 +1303,11 @@ gtk_css_selector_parse_selector_pseudo_class (GtkCssParser   *parser,
             }
         }
           
-      gtk_css_parser_error_value (parser, "Unknown name of pseudo-class");
+      gtk_css_parser_error (parser,
+                            GTK_CSS_PARSER_ERROR_UNKNOWN_VALUE,
+                            &start_location,
+                            gtk_css_parser_get_end_location (parser),
+                            "Unknown name of pseudo-class");
       if (selector)
         _gtk_css_selector_free (selector);
       return NULL;
@@ -1448,7 +1454,11 @@ gtk_css_selector_parse_selector_pseudo_class (GtkCssParser   *parser,
         }
       else
         {
-          gtk_css_parser_error_value (parser, "Unknown pseudoclass");
+          gtk_css_parser_error (parser,
+                                GTK_CSS_PARSER_ERROR_UNKNOWN_VALUE,
+                                &start_location,
+                                gtk_css_parser_get_end_location (parser),
+                                "Unknown pseudoclass");
           if (selector)
             _gtk_css_selector_free (selector);
           return NULL;
@@ -1456,7 +1466,11 @@ gtk_css_selector_parse_selector_pseudo_class (GtkCssParser   *parser,
     }
   else
     {
-      gtk_css_parser_error_value (parser, "Unknown pseudoclass");
+      gtk_css_parser_error (parser,
+                            GTK_CSS_PARSER_ERROR_UNKNOWN_VALUE,
+                            &start_location,
+                            gtk_css_parser_get_end_location (parser),
+                            "Unknown pseudoclass");
       if (selector)
         _gtk_css_selector_free (selector);
       return NULL;


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