Skip to content

Commit

Permalink
feat: allows attributes on promoted properties
Browse files Browse the repository at this point in the history
This commit will correctly parse attributes on promoted properties.
  • Loading branch information
gbprod committed Oct 20, 2023
1 parent 92a98ad commit 8672cf6
Show file tree
Hide file tree
Showing 5 changed files with 66,458 additions and 65,451 deletions.
1 change: 1 addition & 0 deletions grammar.js
Original file line number Diff line number Diff line change
Expand Up @@ -451,6 +451,7 @@ module.exports = grammar({
),

property_promotion_parameter: $ => seq(
optional(field('attributes', $.attribute_list)),
field('visibility', $.visibility_modifier),
field('readonly', optional($.readonly_modifier)),
field('type', optional($._type)), // Note: callable is not a valid type here, but instead of complicating the parser, we defer this checking to any intelligence using the parser
Expand Down
16 changes: 16 additions & 0 deletions src/grammar.json
Original file line number Diff line number Diff line change
Expand Up @@ -2333,6 +2333,22 @@
"property_promotion_parameter": {
"type": "SEQ",
"members": [
{
"type": "CHOICE",
"members": [
{
"type": "FIELD",
"name": "attributes",
"content": {
"type": "SYMBOL",
"name": "attribute_list"
}
},
{
"type": "BLANK"
}
]
},
{
"type": "FIELD",
"name": "visibility",
Expand Down
10 changes: 10 additions & 0 deletions src/node-types.json
Original file line number Diff line number Diff line change
Expand Up @@ -3767,6 +3767,16 @@
"type": "property_promotion_parameter",
"named": true,
"fields": {
"attributes": {
"multiple": false,
"required": false,
"types": [
{
"type": "attribute_list",
"named": true
}
]
},
"default_value": {
"multiple": false,
"required": false,
Expand Down
Loading

0 comments on commit 8672cf6

Please sign in to comment.