From 37ff9e4277c189ecf4f94d10ea68facdbe509170 Mon Sep 17 00:00:00 2001 From: Pierre Pronchery Date: Mon, 27 Jul 2009 17:08:56 +0000 Subject: [PATCH] Allow empty struct-declaration-lists in spite of the N843 standard --- src/parser.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/src/parser.c b/src/parser.c index 61d31c4..addbb17 100644 --- a/src/parser.c +++ b/src/parser.c @@ -518,10 +518,14 @@ static int _struct_or_union_specifier(C99 * c99) return ret; } ret |= scan(c99); - ret |= _parse_check_set(c99, c99set_struct_declaration_list, - "struct declaration list", _struct_declaration_list); - if(_parse_is_code(c99, C99_CODE_COMMA)) - ret |= scan(c99); + /* XXX the grammar says there's got to be one */ + if(_parse_in_set(c99, c99set_struct_declaration_list)) + { + ret |= _struct_declaration_list(c99); + /* XXX the grammar doesn't mention this? */ + if(_parse_is_code(c99, C99_CODE_COMMA)) + ret |= scan(c99); + } ret |= _parse_check(c99, C99_CODE_OPERATOR_RBRACE); ret |= code_context_set(c99->code, context); return ret;