From 2c33cccaf7222a75cf5fe6c1d641539f7141f608 Mon Sep 17 00:00:00 2001 From: Josh Holtrop Date: Wed, 9 May 2018 20:51:22 -0400 Subject: [PATCH] Allow multiple consecutive __attribute__ blocks --- src/parser/parser.yc | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/src/parser/parser.yc b/src/parser/parser.yc index 08d82f2..d094749 100644 --- a/src/parser/parser.yc +++ b/src/parser/parser.yc @@ -420,8 +420,8 @@ type_qualifier ; declarator - : pointer direct_declarator opt_attribute_spec { $$ = $2; } - | direct_declarator opt_attribute_spec + : pointer direct_declarator attributes { $$ = $2; } + | direct_declarator attributes ; direct_declarator @@ -573,15 +573,16 @@ external_declaration ; function_definition - : declaration_specifiers declarator declaration_list opt_attribute_spec compound_statement - | declaration_specifiers declarator opt_attribute_spec compound_statement - | declarator declaration_list opt_attribute_spec compound_statement - | declarator opt_attribute_spec compound_statement + : declaration_specifiers declarator declaration_list attributes compound_statement + | declaration_specifiers declarator attributes compound_statement + | declarator declaration_list attributes compound_statement + | declarator attributes compound_statement ; -opt_attribute_spec +attributes : { $$ = nullptr; } | attribute_spec + | attributes attribute_spec ; attribute_spec