Skip to content

Commit 43293d0

Browse files
authored
Fix Unions accept no field_declaration_list (#79)
1 parent 3e5ec5a commit 43293d0

File tree

4 files changed

+54184
-55300
lines changed

4 files changed

+54184
-55300
lines changed

grammar.js

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -282,10 +282,7 @@ module.exports = grammar({
282282
field('name', $._type_identifier),
283283
field('type_parameters', optional($.type_parameters)),
284284
optional($.where_clause),
285-
choice(
286-
field('body', $.field_declaration_list),
287-
';'
288-
)
285+
field('body', $.field_declaration_list),
289286
),
290287

291288
enum_item: $ => seq(

src/grammar.json

Lines changed: 7 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -755,7 +755,7 @@
755755
},
756756
{
757757
"type": "PATTERN",
758-
"value": "[/_\\-=->,;:::!=?.@*=/=&=#%=^=+<>|~]+"
758+
"value": "[\\/_\\-=->,;:::!=?.@*=\\/=&=#%=^=+<>|~]+"
759759
},
760760
{
761761
"type": "STRING",
@@ -1308,21 +1308,12 @@
13081308
]
13091309
},
13101310
{
1311-
"type": "CHOICE",
1312-
"members": [
1313-
{
1314-
"type": "FIELD",
1315-
"name": "body",
1316-
"content": {
1317-
"type": "SYMBOL",
1318-
"name": "field_declaration_list"
1319-
}
1320-
},
1321-
{
1322-
"type": "STRING",
1323-
"value": ";"
1324-
}
1325-
]
1311+
"type": "FIELD",
1312+
"name": "body",
1313+
"content": {
1314+
"type": "SYMBOL",
1315+
"name": "field_declaration_list"
1316+
}
13261317
}
13271318
]
13281319
},

src/node-types.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4004,7 +4004,7 @@
40044004
"fields": {
40054005
"body": {
40064006
"multiple": false,
4007-
"required": false,
4007+
"required": true,
40084008
"types": [
40094009
{
40104010
"type": "field_declaration_list",

0 commit comments

Comments
 (0)