summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--eo_tokenizer.rl23
1 files changed, 20 insertions, 3 deletions
diff --git a/eo_tokenizer.rl b/eo_tokenizer.rl
index 84007f0..9c94e46 100644
--- a/eo_tokenizer.rl
+++ b/eo_tokenizer.rl
@@ -272,7 +272,12 @@ _eo_tokenizer_accessor_get(Eo_Tokenizer *toknz, Eo_Accessor_Type type)
if (toknz->tmp.param == NULL)
ABORT(toknz, "no parameter set to associate this comment to: %s", c);
toknz->tmp.param->comment = c;
- toknz->tmp.prop->params = eina_list_append(toknz->tmp.prop->params, toknz->tmp.param);
+ if (toknz->tmp.prop)
+ toknz->tmp.prop->params = eina_list_append(toknz->tmp.prop->params, toknz->tmp.param);
+ else if (toknz->tmp.meth)
+ toknz->tmp.meth->params = eina_list_append(toknz->tmp.meth->params, toknz->tmp.param);
+ else
+ ABORT(toknz, "got a param but there is no property nor method waiting for it");
toknz->tmp.param = NULL;
}
@@ -284,10 +289,22 @@ _eo_tokenizer_accessor_get(Eo_Tokenizer *toknz, Eo_Accessor_Type type)
action end_params {
INF(" }");
if (toknz->tmp.param != NULL)
- toknz->tmp.prop->params = eina_list_append(toknz->tmp.prop->params, toknz->tmp.param);
+ {
+ if (toknz->tmp.prop)
+ toknz->tmp.prop->params = eina_list_append(toknz->tmp.prop->params, toknz->tmp.param);
+ else if (toknz->tmp.meth)
+ toknz->tmp.meth->params = eina_list_append(toknz->tmp.meth->params, toknz->tmp.param);
+ else
+ ABORT(toknz, "got a pending param but there is no property nor method waiting for it");
+ }
toknz->tmp.param = NULL;
toknz->current_nesting--;
- fgoto tokenize_property;
+ if (toknz->tmp.prop)
+ fgoto tokenize_property;
+ else if (toknz->tmp.meth)
+ fgoto tokenize_method;
+ else
+ ABORT(toknz, "leaving tokenize_params but there is no property nor method pending");
}
param_comment = ws* eo_comment %end_param_comment;