From 4e4cf546643256d9633e56ec50277acb6c254c9c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=A9my=20Zurcher?= Date: Tue, 26 Nov 2013 12:29:34 +0100 Subject: ABORT if tmp var is not NULL when setting it --- eo_tokenizer.rl | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/eo_tokenizer.rl b/eo_tokenizer.rl index 75ccba1..e2d5f3e 100644 --- a/eo_tokenizer.rl +++ b/eo_tokenizer.rl @@ -127,6 +127,8 @@ _eo_tokenizer_class_get(Eo_Tokenizer *toknz, char *p) # TOKENIZE CLASS action end_class_comment { + if (toknz->tmp.kls->comment != NULL) + ABORT(toknz, "class %s has already a comment", toknz->tmp.kls->name); toknz->tmp.kls->comment = _eo_tokenizer_token_get(toknz, fpc-1); } @@ -182,6 +184,8 @@ _eo_tokenizer_class_get(Eo_Tokenizer *toknz, char *p) } action end_class_name { + if (toknz->tmp.kls != NULL) + ABORT(toknz, "there is a pending class definition %s", toknz->tmp.kls->name); toknz->tmp.kls = _eo_tokenizer_class_get(toknz, fpc); } -- cgit v1.1-2-g2b99