Skip to content

Commit

Permalink
Merge pull request #190 from gbprod/fix-param-attributes
Browse files Browse the repository at this point in the history
feat: allows attributes on promoted properties
  • Loading branch information
aryx authored Oct 20, 2023
2 parents 92a98ad + 8672cf6 commit 0e02e7f
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 0e02e7f

Please sign in to comment.