summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJérémy Zurcher <jeremy@asynk.ch>2013-11-25 22:52:44 +0100
committerJérémy Zurcher <jeremy@asynk.ch>2013-11-25 22:52:44 +0100
commit0725af34efd1bfd70fcef823681e2e3431707676 (patch)
tree5f3b42a9330fb023fdc297e26447e73a850d26d5
parent0c0a0c2676ff5a83b8e17cecb8d267380162723f (diff)
downloadeo_tokenizer-0725af34efd1bfd70fcef823681e2e3431707676.zip
eo_tokenizer-0725af34efd1bfd70fcef823681e2e3431707676.tar.gz
move tokenizer tmp vars into a substruct tmp
-rw-r--r--eo_tokenizer.h7
-rw-r--r--eo_tokenizer.rl14
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;