revision 981:79fcace1ab43
summary |
tree |
shortlog |
changelog |
graph |
changeset |
raw | bz2 | zip | gz changeset | 981:79fcace1ab43 |
parent | 980:deb4361928fe |
child | 982:2d6b3f29f878 |
author | nkeynes |
date | Sun Feb 08 23:38:41 2009 +0000 (15 years ago) |
Clear the action set immediately prior to parsing them in - fix case where
set is actually uninitialized the first time around
Add line numbers to error messages in actparse.c
set is actually uninitialized the first time around
Add line numbers to error messages in actparse.c
1.1 --- a/src/tools/actparse.c Wed Feb 04 21:45:21 2009 +00001.2 +++ b/src/tools/actparse.c Sun Feb 08 23:38:41 2009 +00001.3 @@ -67,7 +67,8 @@1.4 for( i=0; i<rules->rule_count; i++ ) {1.5 if( strcasecmp(rules->rules[i]->format, operation) == 0 ) {1.6 if( actions[i].text != NULL ) {1.7 - fprintf( stderr, "Duplicate actions for operation '%s'\n", operation );1.8 + fprintf( stderr, "gendec:%d: Duplicate actions for operation '%s' (previous action on line %d)\n", line, operation,1.9 + actions[i].lineno );1.10 return -1;1.11 }1.12 actions[i].filename = file;1.13 @@ -76,7 +77,7 @@1.14 return 0;1.15 }1.16 }1.17 - fprintf(stderr, "No operation found matching '%s'\n", operation );1.18 + fprintf(stderr, "gendec:%d: No operation found matching '%s'\n", line, operation );1.19 return -1;1.20 }1.22 @@ -118,10 +119,6 @@1.24 actiontoken_t action_file_next( actionfile_t af )1.25 {1.26 - if( af->token.symbol == ACTIONS ) {1.27 - /* Destroy previous actions */1.28 - memset( af->token.actions, 0, sizeof(af->token.actions) );1.29 - }1.30 af->token.lineno = af->yyline;1.31 if( af->yyposn == af->length ) {1.32 af->token.symbol = END;1.33 @@ -129,6 +126,7 @@1.34 (af->token.symbol == NONE && af->text[af->yyposn] == '%' && af->text[af->yyposn+1] == '%') ) {1.35 /* Begin action block */1.36 af->token.symbol = ACTIONS;1.37 + memset( af->token.actions, 0, sizeof(af->token.actions) );1.39 char *operation = &af->text[af->yyposn];1.40 while( af->yyposn < af->length ) {
.