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