| 185 | #define MYYERROR(a) { WerrorS(a); YYERROR; } |
| 186 | |
| 187 | void yyerror(const char * fmt) |
| 188 | { |
| 189 | |
| 190 | BOOLEAN old_errorreported=errorreported; |
| 191 | errorreported = TRUE; |
| 192 | if (currid!=NULL) |
| 193 | { |
| 194 | killid(currid,&IDROOT); |
| 195 | currid = NULL; |
| 196 | } |
| 197 | if(inerror==0) |
| 198 | { |
| 199 | { |
| 200 | if ((strlen(fmt)>1) |
| 201 | && (strncmp(fmt,"parse",5)!=0) |
| 202 | && (strncmp(fmt,"syntax",6)!=0)) |
| 203 | WerrorS(fmt); |
| 204 | Werror( "error occurred in or before %s line %d: `%s`" |
| 205 | ,VoiceName(), yylineno, my_yylinebuf); |
| 206 | } |
| 207 | if (cmdtok!=0) |
| 208 | { |
| 209 | const char *s=Tok2Cmdname(cmdtok); |
| 210 | if (expected_parms) |
| 211 | { |
| 212 | Werror("expected %s-expression. type \'help %s;\'",s,s); |
| 213 | } |
| 214 | else |
| 215 | { |
| 216 | Werror("wrong type declaration. type \'help %s;\'",s); |
| 217 | } |
| 218 | } |
| 219 | if (!old_errorreported && (lastreserved!=NULL)) |
| 220 | { |
| 221 | Werror("last reserved name was `%s`",lastreserved); |
| 222 | } |
| 223 | inerror=1; |
| 224 | } |
| 225 | if ((currentVoice!=NULL) |
| 226 | && (currentVoice->prev!=NULL) |
| 227 | && (myynest>0) |
| 228 | #ifdef HAVE_SDB |
| 229 | && ((sdb_flags &1)==0) |
| 230 | #endif |
| 231 | ) |
| 232 | { |
| 233 | Werror("leaving %s (%d)",VoiceName(), VoiceLine()); |
| 234 | } |
| 235 | } |
| 236 | |
| 237 | |
| 238 |
no test coverage detected