Parse until the end of the file even upon errors

This commit is contained in:
Pierre Pronchery 2008-03-18 18:07:55 +00:00
parent 72a75f666e
commit ec8acd14af

View File

@ -189,9 +189,11 @@ static int _translation_unit(C99 * c99)
#ifdef DEBUG #ifdef DEBUG
fprintf(stderr, "DEBUG: %s()\n", __func__); fprintf(stderr, "DEBUG: %s()\n", __func__);
#endif #endif
while((ret |= c99_scan(c99)) == 0 while(c99_scan(c99) == 0
&& c99->token != NULL) /* end of file */ && c99->token != NULL) /* end of file */
ret |= _external_declaration(c99); ret |= _external_declaration(c99);
if(c99->token != NULL)
ret |= 1;
return ret; return ret;
} }