Skip to content

Commit b1cd8bc

Browse files
authored
Merge pull request #179 from aspeddro/fix-consecutive-and-bindings
fix: consecutive `and` bindings for type and module
2 parents 29c1fd2 + 27f018b commit b1cd8bc

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
lines changed

grammar.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -189,7 +189,7 @@ module.exports = grammar({
189189
optional(seq(
190190
'=',
191191
field('definition', $._module_definition),
192-
repeat($._module_binding_and)
192+
optional($._module_binding_and)
193193
)),
194194
)),
195195

@@ -271,7 +271,7 @@ module.exports = grammar({
271271
$._type,
272272
repeat($.type_constraint),
273273
optional(seq('=', $._type)),
274-
repeat(alias($._type_declaration_and, $.type_declaration)),
274+
optional(alias($._type_declaration_and, $.type_declaration)),
275275
)),
276276
),
277277

test/corpus/decorators.txt

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -108,12 +108,12 @@ and bar = {bar: int}
108108
(type_declaration
109109
(decorator (decorator_identifier))
110110
(type_identifier)
111-
(record_type (record_type_field (property_identifier) (type_annotation (type_identifier)))))
112-
(type_declaration
113-
(decorator (decorator_identifier))
114-
(decorator (decorator_identifier))
115-
(type_identifier)
116-
(record_type (record_type_field (property_identifier) (type_annotation (type_identifier))))))))
111+
(record_type (record_type_field (property_identifier) (type_annotation (type_identifier))))
112+
(type_declaration
113+
(decorator (decorator_identifier))
114+
(decorator (decorator_identifier))
115+
(type_identifier)
116+
(record_type (record_type_field (property_identifier) (type_annotation (type_identifier)))))))))
117117

118118
============================================
119119
Decorator with type

0 commit comments

Comments
 (0)