Skip to content

Commit

Permalink
Adds support for trailing comma in parameter and clousure use lists a…
Browse files Browse the repository at this point in the history
…s per PHP 8.0
  • Loading branch information
cfroystad committed Apr 13, 2021
1 parent c307ec4 commit 59cef2b
Show file tree
Hide file tree
Showing 4 changed files with 36,521 additions and 36,131 deletions.
2 changes: 2 additions & 0 deletions grammar.js
Original file line number Diff line number Diff line change
Expand Up @@ -375,6 +375,7 @@ module.exports = grammar({
formal_parameters: $ => seq(
'(',
commaSep(choice($.simple_parameter, $.variadic_parameter)),
optional(','),
')'
),

Expand Down Expand Up @@ -773,6 +774,7 @@ module.exports = grammar({
keyword('use'),
'(',
commaSep1(seq(optional('&'), $.variable_name)),
optional(','),
')'
),

Expand Down
24 changes: 24 additions & 0 deletions src/grammar.json
Original file line number Diff line number Diff line change
Expand Up @@ -1689,6 +1689,18 @@
}
]
},
{
"type": "CHOICE",
"members": [
{
"type": "STRING",
"value": ","
},
{
"type": "BLANK"
}
]
},
{
"type": "STRING",
"value": ")"
Expand Down Expand Up @@ -3768,6 +3780,18 @@
}
]
},
{
"type": "CHOICE",
"members": [
{
"type": "STRING",
"value": ","
},
{
"type": "BLANK"
}
]
},
{
"type": "STRING",
"value": ")"
Expand Down
Loading

0 comments on commit 59cef2b

Please sign in to comment.