diff options
author | Jérémy Zurcher <jeremy@asynk.ch> | 2013-11-26 12:29:34 +0100 |
---|---|---|
committer | Jérémy Zurcher <jeremy@asynk.ch> | 2013-11-26 12:29:34 +0100 |
commit | 4e4cf546643256d9633e56ec50277acb6c254c9c (patch) | |
tree | 13ae6393f7f91247bfbdc46c960d6a7425142187 | |
parent | 8f68b304d403593a0023b90fc28e5739cf925832 (diff) | |
download | eo_tokenizer-4e4cf546643256d9633e56ec50277acb6c254c9c.zip eo_tokenizer-4e4cf546643256d9633e56ec50277acb6c254c9c.tar.gz |
ABORT if tmp var is not NULL when setting it
-rw-r--r-- | eo_tokenizer.rl | 4 |
1 files changed, 4 insertions, 0 deletions
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); } |