Skip to content

Commit

Permalink
fix: multiple modifiers on a class
Browse files Browse the repository at this point in the history
  • Loading branch information
gbprod authored Oct 3, 2023
1 parent a05c611 commit 92a98ad
Show file tree
Hide file tree
Showing 5 changed files with 69,117 additions and 67,309 deletions.
3 changes: 2 additions & 1 deletion grammar.js
Original file line number Diff line number Diff line change
Expand Up @@ -284,7 +284,8 @@ module.exports = grammar({

class_declaration: $ => prec.right(seq(
optional(field('attributes', $.attribute_list)),
optional(field('modifier', choice($.final_modifier, $.abstract_modifier, $.readonly_modifier))),
optional(field('modifier', choice($.final_modifier, $.abstract_modifier))),
optional(field('modifier', $.readonly_modifier)),
keyword('class'),
field('name', $.name),
optional($.base_clause),
Expand Down
20 changes: 16 additions & 4 deletions src/grammar.json
Original file line number Diff line number Diff line change
Expand Up @@ -1220,10 +1220,6 @@
{
"type": "SYMBOL",
"name": "abstract_modifier"
},
{
"type": "SYMBOL",
"name": "readonly_modifier"
}
]
}
Expand All @@ -1233,6 +1229,22 @@
}
]
},
{
"type": "CHOICE",
"members": [
{
"type": "FIELD",
"name": "modifier",
"content": {
"type": "SYMBOL",
"name": "readonly_modifier"
}
},
{
"type": "BLANK"
}
]
},
{
"type": "ALIAS",
"content": {
Expand Down
2 changes: 1 addition & 1 deletion src/node-types.json
Original file line number Diff line number Diff line change
Expand Up @@ -1350,7 +1350,7 @@
]
},
"modifier": {
"multiple": false,
"multiple": true,
"required": false,
"types": [
{
Expand Down
Loading

0 comments on commit 92a98ad

Please sign in to comment.