summaryrefslogtreecommitdiff
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)
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)
272 if (toknz->tmp.param == NULL) 272 if (toknz->tmp.param == NULL)
273 ABORT(toknz, "no parameter set to associate this comment to: %s", c); 273 ABORT(toknz, "no parameter set to associate this comment to: %s", c);
274 toknz->tmp.param->comment = c; 274 toknz->tmp.param->comment = c;
275 toknz->tmp.prop->params = eina_list_append(toknz->tmp.prop->params, toknz->tmp.param); 275 if (toknz->tmp.prop)
276 toknz->tmp.prop->params = eina_list_append(toknz->tmp.prop->params, toknz->tmp.param);
277 else if (toknz->tmp.meth)
278 toknz->tmp.meth->params = eina_list_append(toknz->tmp.meth->params, toknz->tmp.param);
279 else
280 ABORT(toknz, "got a param but there is no property nor method waiting for it");
276 toknz->tmp.param = NULL; 281 toknz->tmp.param = NULL;
277 } 282 }
278 283
@@ -284,10 +289,22 @@ _eo_tokenizer_accessor_get(Eo_Tokenizer *toknz, Eo_Accessor_Type type)
284 action end_params { 289 action end_params {
285 INF(" }"); 290 INF(" }");
286 if (toknz->tmp.param != NULL) 291 if (toknz->tmp.param != NULL)
287 toknz->tmp.prop->params = eina_list_append(toknz->tmp.prop->params, toknz->tmp.param); 292 {
293 if (toknz->tmp.prop)
294 toknz->tmp.prop->params = eina_list_append(toknz->tmp.prop->params, toknz->tmp.param);
295 else if (toknz->tmp.meth)
296 toknz->tmp.meth->params = eina_list_append(toknz->tmp.meth->params, toknz->tmp.param);
297 else
298 ABORT(toknz, "got a pending param but there is no property nor method waiting for it");
299 }
288 toknz->tmp.param = NULL; 300 toknz->tmp.param = NULL;
289 toknz->current_nesting--; 301 toknz->current_nesting--;
290 fgoto tokenize_property; 302 if (toknz->tmp.prop)
303 fgoto tokenize_property;
304 else if (toknz->tmp.meth)
305 fgoto tokenize_method;
306 else
307 ABORT(toknz, "leaving tokenize_params but there is no property nor method pending");
291 } 308 }
292 309
293 param_comment = ws* eo_comment %end_param_comment; 310 param_comment = ws* eo_comment %end_param_comment;