Skip to content

Commit 3b0c162

Browse files
committed
support and in rec modules
1 parent 030c543 commit 3b0c162

File tree

1 file changed

+14
-4
lines changed

1 file changed

+14
-4
lines changed

grammar.js

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -175,10 +175,7 @@ module.exports = grammar({
175175
$.exception_declaration,
176176
),
177177

178-
module_declaration: $ => seq(
179-
'module',
180-
optional('rec'),
181-
optional('type'),
178+
module_binding: $ => prec.left(seq(
182179
field('name', choice($.module_identifier, $.type_identifier)),
183180
optional(seq(
184181
':',
@@ -187,7 +184,20 @@ module.exports = grammar({
187184
optional(seq(
188185
'=',
189186
field('definition', $._module_definition),
187+
repeat($._module_binding_and)
190188
)),
189+
)),
190+
191+
_module_binding_and: $ => seq(
192+
'and',
193+
$.module_binding
194+
),
195+
196+
module_declaration: $ => seq(
197+
'module',
198+
optional('rec'),
199+
optional('type'),
200+
$.module_binding,
191201
),
192202

193203
_module_definition: $ => choice(

0 commit comments

Comments
 (0)