From 0725af34efd1bfd70fcef823681e2e3431707676 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=A9my=20Zurcher?= Date: Mon, 25 Nov 2013 22:52:44 +0100 Subject: move tokenizer tmp vars into a substruct tmp --- eo_tokenizer.h | 7 ++++++- eo_tokenizer.rl | 14 +++++++------- 2 files changed, 13 insertions(+), 8 deletions(-) diff --git a/eo_tokenizer.h b/eo_tokenizer.h index 3328ec4..eb618b9 100644 --- a/eo_tokenizer.h +++ b/eo_tokenizer.h @@ -125,7 +125,12 @@ typedef struct _eo_tokenizer } saved; Eina_List *classes; - Eo_Class_Def *tmp_kls; + struct { + Eo_Class_Def *kls; + Eo_Property_Def *prop; + Eo_Method_Def *meth; + Eo_Param_Def *param; + } tmp; } Eo_Tokenizer; diff --git a/eo_tokenizer.rl b/eo_tokenizer.rl index de12f33..4d2bb57 100644 --- a/eo_tokenizer.rl +++ b/eo_tokenizer.rl @@ -126,19 +126,19 @@ _eo_tokenizer_class_get(Eo_Tokenizer *toknz, char *p) action end_inherit_name { const char *base = _eo_tokenizer_token_get(toknz, fpc); - toknz->tmp_kls->inherits = eina_list_append(toknz->tmp_kls->inherits, base); + toknz->tmp.kls->inherits = eina_list_append(toknz->tmp.kls->inherits, base); } action end_class { - INF("end class:%s", toknz->tmp_kls->name); - toknz->classes= eina_list_append(toknz->classes, toknz->tmp_kls); - toknz->tmp_kls = NULL; + INF("end class:%s", toknz->tmp.kls->name); + toknz->classes= eina_list_append(toknz->classes, toknz->tmp.kls); + toknz->tmp.kls = NULL; toknz->current_nesting--; fgoto main; } action end_eo_comment { - toknz->tmp_kls->comment = _eo_tokenizer_token_get(toknz, fpc-1); + toknz->tmp.kls->comment = _eo_tokenizer_token_get(toknz, fpc-1); } inherit_item = alpha_u+ >save_fpc %end_inherit_name ignore*; @@ -157,13 +157,13 @@ _eo_tokenizer_class_get(Eo_Tokenizer *toknz, char *p) # TOP LEVEL action begin_class { - INF("begin class: %s", toknz->tmp_kls->name); + INF("begin class: %s", toknz->tmp.kls->name); toknz->current_nesting++; fgoto tokenize_class; } action end_class_name { - toknz->tmp_kls = _eo_tokenizer_class_get(toknz, fpc); + toknz->tmp.kls = _eo_tokenizer_class_get(toknz, fpc); } begin_class = alpha_u+ >save_fpc %end_class_name ignore* begin_def; -- cgit v1.1-2-g2b99