summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJérémy Zurcher <jeremy@asynk.ch>2013-11-29 17:15:56 +0100
committerJérémy Zurcher <jeremy@asynk.ch>2013-11-29 17:15:56 +0100
commitb6974cce3fdb2450eb15b23d70d69690af25ef1b (patch)
treeb1aa739bce277343ea124661b6135cf92efbc87e
parentdbe62b2491a6ccce6bdd636b218e69b9bc12f53e (diff)
downloadeo_tokenizer-b6974cce3fdb2450eb15b23d70d69690af25ef1b.zip
eo_tokenizer-b6974cce3fdb2450eb15b23d70d69690af25ef1b.tar.gz
support params within property or method
-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;