Skip to content

Commit 8c83acc

Browse files
authored
Merge pull request #162 from nkrkv/feat-empty-records
Support empty record {} type declaration
2 parents 41f0b28 + 3524ab0 commit 8c83acc

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

grammar.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -373,7 +373,7 @@ module.exports = grammar({
373373

374374
record_type: $ => seq(
375375
'{',
376-
commaSep1t($.record_type_field),
376+
commaSept($.record_type_field),
377377
'}',
378378
),
379379

test/corpus/type_declarations.txt

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,8 @@ type t = {
8181

8282
type t = Mod.t = {a: int}
8383

84+
type t = {}
85+
8486
---
8587

8688
(source_file
@@ -108,7 +110,10 @@ type t = Mod.t = {a: int}
108110
(record_type
109111
(record_type_field
110112
(property_identifier)
111-
(type_annotation (type_identifier))))))
113+
(type_annotation (type_identifier)))))
114+
(type_declaration
115+
(type_identifier)
116+
(record_type)))
112117

113118
===========================================
114119
Extensible Variant

0 commit comments

Comments
 (0)