diff options
Diffstat (limited to 'eo_tokenizer.rl')
-rw-r--r-- | eo_tokenizer.rl | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/eo_tokenizer.rl b/eo_tokenizer.rl index 019867a..f2ffddb 100644 --- a/eo_tokenizer.rl +++ b/eo_tokenizer.rl @@ -3,6 +3,17 @@ #include "eo_tokenizer.h" +static void +_eo_tokenizer_abort(Eo_Tokenizer *toknz, + const char *file, const char* fct, int line, + const char *msg) +{ + eina_log_print(_eo_tokenizer_log_dom, EINA_LOG_LEVEL_ERR, file, fct, line, msg); + eo_tokenizer_dump(toknz); + exit(EXIT_FAILURE); +} +#define ABORT(toknz, msg) _eo_tokenizer_abort(toknz, __FILE__, __FUNCTION__, __LINE__, msg); + %%{ machine common; @@ -100,9 +111,8 @@ eo_tokenizer_walk(Eo_Tokenizer *toknz, const char *source) if (space == 0) { - ERR("out of buffer space"); fclose(stream); - exit(EXIT_FAILURE); + ABORT(toknz, "out of buffer space"); } len = fread(toknz->p, 1, space, stream); |