From e9ba1d3276b0b2fbc37ecb8bd7e4955fd8ec030b Mon Sep 17 00:00:00 2001 From: François Pottier Date: Wed, 7 Oct 2015 10:37:06 +0200 Subject: Factorized two productions (and two error productions) in [enum_specifier]. This is analogous to the previous commit. --- cparser/pre_parser.mly | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) (limited to 'cparser/pre_parser.mly') diff --git a/cparser/pre_parser.mly b/cparser/pre_parser.mly index 8cc92581..7567b372 100644 --- a/cparser/pre_parser.mly +++ b/cparser/pre_parser.mly @@ -451,13 +451,10 @@ struct_declarator: {} enum_specifier: -| ENUM attribute_specifier_list LBRACE enumerator_list COMMA? RBRACE -| ENUM attribute_specifier_list other_identifier LBRACE enumerator_list COMMA? RBRACE +| ENUM attribute_specifier_list other_identifier? LBRACE enumerator_list COMMA? RBRACE | ENUM attribute_specifier_list other_identifier {} -| ENUM attribute_specifier_list LBRACE enumerator_list COMMA? error - { unclosed "{" "}" $startpos($3) $endpos } -| ENUM attribute_specifier_list general_identifier LBRACE enumerator_list COMMA? error +| ENUM attribute_specifier_list other_identifier? LBRACE enumerator_list COMMA? error { unclosed "{" "}" $startpos($4) $endpos } enumerator_list: -- cgit