Skip to content

Commit

Permalink
Add another test case for match
Browse files Browse the repository at this point in the history
  • Loading branch information
theHamsta committed Dec 14, 2021
1 parent 0881390 commit ca50b1f
Show file tree
Hide file tree
Showing 5 changed files with 24,244 additions and 23,040 deletions.
2 changes: 1 addition & 1 deletion grammar.js
Original file line number Diff line number Diff line change
Expand Up @@ -258,7 +258,7 @@ module.exports = grammar({

match_statement: $ => seq(
'match',
field('subject', $.expression),
commaSep1(field('subject', $.expression)),
optional(','),
':',
repeat(field('alternative', $.case_clause))),
Expand Down
49 changes: 43 additions & 6 deletions src/grammar.json
Original file line number Diff line number Diff line change
Expand Up @@ -893,12 +893,49 @@
"value": "match"
},
{
"type": "FIELD",
"name": "subject",
"content": {
"type": "SYMBOL",
"name": "expression"
}
"type": "SEQ",
"members": [
{
"type": "FIELD",
"name": "subject",
"content": {
"type": "SYMBOL",
"name": "expression"
}
},
{
"type": "REPEAT",
"content": {
"type": "SEQ",
"members": [
{
"type": "STRING",
"value": ","
},
{
"type": "FIELD",
"name": "subject",
"content": {
"type": "SYMBOL",
"name": "expression"
}
}
]
}
}
]
},
{
"type": "CHOICE",
"members": [
{
"type": "STRING",
"value": ","
},
{
"type": "BLANK"
}
]
},
{
"type": "STRING",
Expand Down
2 changes: 1 addition & 1 deletion src/node-types.json
Original file line number Diff line number Diff line change
Expand Up @@ -1880,7 +1880,7 @@
]
},
"subject": {
"multiple": false,
"multiple": true,
"required": true,
"types": [
{
Expand Down
Loading

0 comments on commit ca50b1f

Please sign in to comment.