Skip to content

Commit

Permalink
Grammar: allow empty record type
Browse files Browse the repository at this point in the history
  • Loading branch information
gruhn committed Oct 15, 2024
1 parent ada82a2 commit f47ae9c
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
2 changes: 1 addition & 1 deletion grammar.js
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ module.exports = grammar({
),

record_type: $ => withBraces(
sepEndBy1(',', seq(
sepEndBy(',', seq(
seq($.qualified_identifier, ':', $.type),
))
),
Expand Down
9 changes: 8 additions & 1 deletion test/corpus/module-level-constructs.txt
Original file line number Diff line number Diff line change
Expand Up @@ -464,6 +464,8 @@ type _ = {
address: str,
coins: Coins,
}

type _ = {}

---

Expand All @@ -482,7 +484,12 @@ type _ = {
(identifier))
(type
(qualified_identifier
(identifier)))))))
(identifier))))))
(type_alias
(qualified_identifier
(identifier))
(type
(record_type))))

========================
Tuple Type
Expand Down

0 comments on commit f47ae9c

Please sign in to comment.