Skip to content

Commit

Permalink
Merge pull request #162 from nkrkv/feat-empty-records
Browse files Browse the repository at this point in the history
Support empty record {} type declaration
  • Loading branch information
nkrkv authored Nov 15, 2022
2 parents 41f0b28 + 3524ab0 commit 8c83acc
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
2 changes: 1 addition & 1 deletion grammar.js
Original file line number Diff line number Diff line change
Expand Up @@ -373,7 +373,7 @@ module.exports = grammar({

record_type: $ => seq(
'{',
commaSep1t($.record_type_field),
commaSept($.record_type_field),
'}',
),

Expand Down
7 changes: 6 additions & 1 deletion test/corpus/type_declarations.txt
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,8 @@ type t = {

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

type t = {}

---

(source_file
Expand Down Expand Up @@ -108,7 +110,10 @@ type t = Mod.t = {a: int}
(record_type
(record_type_field
(property_identifier)
(type_annotation (type_identifier))))))
(type_annotation (type_identifier)))))
(type_declaration
(type_identifier)
(record_type)))

===========================================
Extensible Variant
Expand Down

0 comments on commit 8c83acc

Please sign in to comment.