fix: backport `attribute_specifier` fixes from C

pull/708/head
Amaan Qureshi 2023-07-25 06:35:59 +07:00
parent eba14809da
commit 3c898ed3f0
No known key found for this signature in database
GPG Key ID: E67890ADC4227273
1 changed files with 2 additions and 0 deletions

@ -154,6 +154,7 @@ module.exports = grammar(C, {
// a compound statement. This introduces a shift/reduce conflict that needs to be resolved // a compound statement. This introduces a shift/reduce conflict that needs to be resolved
// with an associativity. // with an associativity.
_class_declaration: $ => prec.right(seq( _class_declaration: $ => prec.right(seq(
optional($.attribute_specifier),
optional($.ms_declspec_modifier), optional($.ms_declspec_modifier),
repeat($.attribute_declaration), repeat($.attribute_declaration),
choice( choice(
@ -165,6 +166,7 @@ module.exports = grammar(C, {
field('body', $.field_declaration_list), field('body', $.field_declaration_list),
), ),
), ),
optional($.attribute_specifier),
)), )),
class_specifier: $ => seq( class_specifier: $ => seq(