Skip to content

Commit 92a98ad

Browse files
authored
fix: multiple modifiers on a class
1 parent a05c611 commit 92a98ad

File tree

5 files changed

+69117
-67309
lines changed

5 files changed

+69117
-67309
lines changed

grammar.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -284,7 +284,8 @@ module.exports = grammar({
284284

285285
class_declaration: $ => prec.right(seq(
286286
optional(field('attributes', $.attribute_list)),
287-
optional(field('modifier', choice($.final_modifier, $.abstract_modifier, $.readonly_modifier))),
287+
optional(field('modifier', choice($.final_modifier, $.abstract_modifier))),
288+
optional(field('modifier', $.readonly_modifier)),
288289
keyword('class'),
289290
field('name', $.name),
290291
optional($.base_clause),

src/grammar.json

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1220,10 +1220,6 @@
12201220
{
12211221
"type": "SYMBOL",
12221222
"name": "abstract_modifier"
1223-
},
1224-
{
1225-
"type": "SYMBOL",
1226-
"name": "readonly_modifier"
12271223
}
12281224
]
12291225
}
@@ -1233,6 +1229,22 @@
12331229
}
12341230
]
12351231
},
1232+
{
1233+
"type": "CHOICE",
1234+
"members": [
1235+
{
1236+
"type": "FIELD",
1237+
"name": "modifier",
1238+
"content": {
1239+
"type": "SYMBOL",
1240+
"name": "readonly_modifier"
1241+
}
1242+
},
1243+
{
1244+
"type": "BLANK"
1245+
}
1246+
]
1247+
},
12361248
{
12371249
"type": "ALIAS",
12381250
"content": {

src/node-types.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1350,7 +1350,7 @@
13501350
]
13511351
},
13521352
"modifier": {
1353-
"multiple": false,
1353+
"multiple": true,
13541354
"required": false,
13551355
"types": [
13561356
{

0 commit comments

Comments
 (0)