From 052b8c9cb9a4dd165d147477546d63ac08598fc6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=A9my=20Zurcher?= Date: Mon, 25 Nov 2013 11:41:01 +0100 Subject: eo_tokenizer_dump() outputs tokenized definitions --- eo_tokenizer.rl | 22 +++++++++++++++++----- main.c | 2 ++ 2 files changed, 19 insertions(+), 5 deletions(-) diff --git a/eo_tokenizer.rl b/eo_tokenizer.rl index bd740b2..1f98b89 100644 --- a/eo_tokenizer.rl +++ b/eo_tokenizer.rl @@ -13,7 +13,10 @@ _eo_tokenizer_abort(Eo_Tokenizer *toknz, eina_log_vprint(_eo_tokenizer_log_dom, EINA_LOG_LEVEL_ERR, file, fct, line, fmt, ap); va_end(ap); - eo_tokenizer_dump(toknz); + fprintf(stderr, " toknz[%d] n:%d l:%d p:%d pe:%d ts:%d te:%d act:%d\n", + toknz->cs, toknz->current_nesting, toknz->current_line, + (toknz->p - toknz->buf), (toknz->pe - toknz->buf), + toknz->ts, toknz->te, toknz->act); exit(EXIT_FAILURE); } #define ABORT(toknz, ...) \ @@ -274,10 +277,19 @@ eo_tokenizer_get(void) void eo_tokenizer_dump(Eo_Tokenizer *toknz) { - fprintf(stderr, " toknz[%d] n:%d l:%d p:%d pe:%d ts:%d te:%d act:%d\n", - toknz->cs, toknz->current_nesting, toknz->current_line, - (toknz->p - toknz->buf), (toknz->pe - toknz->buf), - toknz->ts, toknz->te, toknz->act); + const char *s; + Eina_List *k, *l; + Eo_Class_Def *kls; + + EINA_LIST_FOREACH(toknz->classes, k, kls) + { + printf("Class: %s\n", kls->name); + printf(" inherits from :"); + EINA_LIST_FOREACH(kls->inherits, l, s) + printf(" %s", s); + printf("\n"); + } + } void diff --git a/main.c b/main.c index a45a32f..5dff237 100644 --- a/main.c +++ b/main.c @@ -41,6 +41,8 @@ int main(int argc, char **argv) } eo_tokenizer_walk(toknz, fpath); + eo_tokenizer_dump(toknz); + eo_tokenizer_free(toknz); } -- cgit v1.1-2-g2b99