--- capa/capa51/pProj/capaGrammarDef.y 1999/11/08 22:30:02 1.6 +++ capa/capa51/pProj/capaGrammarDef.y 1999/12/07 19:10:47 1.7 @@ -1088,7 +1088,7 @@ append_warn(type,str) int type;char *str /*********** if *b is a constant symbol, destroy (free) b ********************/ /*********** if *a is a var symbol, create a new symbol **********************/ /* do not free(*a) */ -/* */ +/* If either a or b is invalid it propagates the error up the parse tree */ Symbol * symbols_op(a, b, op) Symbol *a; Symbol *b; int op; { @@ -1103,12 +1103,11 @@ if( a->s_type == IDENTIFIER || b->s_type if(a->s_type == IDENTIFIER) { /* a is IDENTIFIER */ sprintf(warn_msg,"var \"%s\" not defined before use.\n", a->s_name); capa_msg(MESSAGE_ERROR,warn_msg); - return (b); + return (a); } else { /* b is IDENTIFIER */ - sprintf(warn_msg, - "var \"%s\" not defined before use.\n",b->s_name); + sprintf(warn_msg,"var \"%s\" not defined before use.\n",b->s_name); capa_msg(MESSAGE_ERROR,warn_msg); - return (a); + return (b); } } else { /* a and b are neither identifiers */ if( (a->s_type == I_VAR) ||