From ec8acd14af5877fb54970db4df09dbf8ead2beb9 Mon Sep 17 00:00:00 2001 From: Pierre Pronchery Date: Tue, 18 Mar 2008 18:07:55 +0000 Subject: [PATCH] Parse until the end of the file even upon errors --- src/parser.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/parser.c b/src/parser.c index 21f8489..7aa6598 100644 --- a/src/parser.c +++ b/src/parser.c @@ -189,9 +189,11 @@ static int _translation_unit(C99 * c99) #ifdef DEBUG fprintf(stderr, "DEBUG: %s()\n", __func__); #endif - while((ret |= c99_scan(c99)) == 0 + while(c99_scan(c99) == 0 && c99->token != NULL) /* end of file */ ret |= _external_declaration(c99); + if(c99->token != NULL) + ret |= 1; return ret; }