Skip to content

Commit 0e112b3

Browse files
authored
Merge pull request #153 from aspeddro/fix-152
Fix #152
2 parents 030c543 + 9f5d1ee commit 0e112b3

File tree

2 files changed

+12
-1
lines changed

2 files changed

+12
-1
lines changed

grammar.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -254,6 +254,7 @@ module.exports = grammar({
254254
choice('=', '+='),
255255
optional('private'),
256256
$._type,
257+
optional(seq('=', $._type)),
257258
repeat(alias($._type_declaration_and, $.type_declaration)),
258259
)),
259260
),

test/corpus/type_declarations.txt

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,8 @@ type t = {
7979
opt?: string
8080
}
8181

82+
type t = Mod.t = {a: int}
83+
8284
---
8385

8486
(source_file
@@ -98,7 +100,15 @@ type t = {
98100
(record_type_field
99101
(property_identifier) (type_annotation (type_identifier)))
100102
(record_type_field
101-
(property_identifier) (type_annotation (type_identifier))))))
103+
(property_identifier) (type_annotation (type_identifier)))))
104+
(type_declaration
105+
(type_identifier)
106+
(type_identifier_path
107+
(module_identifier) (type_identifier))
108+
(record_type
109+
(record_type_field
110+
(property_identifier)
111+
(type_annotation (type_identifier))))))
102112

103113
===========================================
104114
Extensible Variant

0 commit comments

Comments
 (0)