diff options
author | Benjamin Otte <otte@redhat.com> | 2019-03-31 12:40:53 +0200 |
---|---|---|
committer | Benjamin Otte <otte@redhat.com> | 2019-04-12 19:34:28 +0200 |
commit | dbdb81f411b3e33b10d536ae9a418ed11055af54 (patch) | |
tree | 8e849babd643536a0c92f91743cefbfa205847f5 /gtk/gtkcsspalettevalue.c | |
parent | 28fbcf6abede0b30a57cc154623b0219793e7c7c (diff) | |
download | gtk+-dbdb81f411b3e33b10d536ae9a418ed11055af54.tar.gz |
cssparser: Add gtk_css_parser_consume_ident()
And use it to fix the palette parser.
Diffstat (limited to 'gtk/gtkcsspalettevalue.c')
-rw-r--r-- | gtk/gtkcsspalettevalue.c | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/gtk/gtkcsspalettevalue.c b/gtk/gtkcsspalettevalue.c index ac9088482c..3514ac6bbb 100644 --- a/gtk/gtkcsspalettevalue.c +++ b/gtk/gtkcsspalettevalue.c @@ -216,16 +216,15 @@ gtk_css_palette_value_parse (GtkCssParser *parser) GtkCssValue *result, *color; char *ident; - if (_gtk_css_parser_try (parser, "default", TRUE)) + if (gtk_css_parser_try_ident (parser, "default")) return gtk_css_palette_value_new_default (); result = gtk_css_palette_value_new_empty (); do { - ident = _gtk_css_parser_try_ident (parser, TRUE); + ident = gtk_css_parser_consume_ident (parser); if (ident == NULL) { - _gtk_css_parser_error (parser, "expected color name"); _gtk_css_value_unref (result); return NULL; } @@ -240,7 +239,7 @@ gtk_css_palette_value_parse (GtkCssParser *parser) gtk_css_palette_value_add_color (result, ident, color); g_free (ident); - } while (_gtk_css_parser_try (parser, ",", TRUE)); + } while (gtk_css_parser_try_token (parser, GTK_CSS_TOKEN_COMMA)); return result; } |