tokenizer: Pass error arg to read_token()

Instead of an error vfunc, have the tokenizer vfunc take a GError
argument. Note that even when an error is returned, there is still a
token to be read.
This commit is contained in:
Benjamin Otte 2019-03-15 04:00:21 +01:00
parent 013591d68d
commit 661720ef8b
2 changed files with 322 additions and 386 deletions

File diff suppressed because it is too large Load Diff

View File

@ -77,12 +77,6 @@ typedef struct _GtkCssDelimToken GtkCssDelimToken;
typedef struct _GtkCssNumberToken GtkCssNumberToken;
typedef struct _GtkCssDimensionToken GtkCssDimensionToken;
typedef void (* GtkCssTokenizerErrorFunc) (GtkCssTokenizer *parser,
const GtkCssLocation *location,
const GtkCssToken *token,
const GError *error,
gpointer user_data);
struct _GtkCssStringToken {
GtkCssTokenType type;
char *string;
@ -136,18 +130,16 @@ void gtk_css_token_print (const GtkCssTok
GString *string);
char * gtk_css_token_to_string (const GtkCssToken *token);
GtkCssTokenizer * gtk_css_tokenizer_new (GBytes *bytes,
GtkCssTokenizerErrorFunc func,
gpointer user_data,
GDestroyNotify user_destroy);
GtkCssTokenizer * gtk_css_tokenizer_new (GBytes *bytes);
GtkCssTokenizer * gtk_css_tokenizer_ref (GtkCssTokenizer *tokenizer);
void gtk_css_tokenizer_unref (GtkCssTokenizer *tokenizer);
const GtkCssLocation * gtk_css_tokenizer_get_location (GtkCssTokenizer *tokenizer);
void gtk_css_tokenizer_read_token (GtkCssTokenizer *tokenizer,
GtkCssToken *token);
gboolean gtk_css_tokenizer_read_token (GtkCssTokenizer *tokenizer,
GtkCssToken *token,
GError **error);
G_END_DECLS