File tree Expand file tree Collapse file tree 1 file changed +22
-11
lines changed
Expand file tree Collapse file tree 1 file changed +22
-11
lines changed Original file line number Diff line number Diff line change @@ -259,20 +259,31 @@ module.exports = grammar({
259259 optional ( 'export' ) ,
260260 'type' ,
261261 optional ( 'rec' ) ,
262- $ . _type_declaration ,
262+ $ . _type_declaration
263263 ) ,
264264
265265 _type_declaration : $ => seq (
266- choice ( $ . type_identifier , $ . type_identifier_path ) ,
267- optional ( $ . type_parameters ) ,
268- optional ( seq (
269- choice ( '=' , '+=' ) ,
270- optional ( 'private' ) ,
271- $ . _type ,
272- repeat ( $ . type_constraint ) ,
273- optional ( seq ( '=' , $ . _type ) ) ,
274- optional ( alias ( $ . _type_declaration_and , $ . type_declaration ) ) ,
275- ) ) ,
266+ choice (
267+ seq (
268+ $ . type_identifier ,
269+ optional ( $ . type_parameters ) ,
270+ optional ( seq ( '=' , $ . _type ) ) ,
271+ optional ( seq (
272+ '=' ,
273+ optional ( 'private' ) ,
274+ $ . _type ,
275+ ) ) ,
276+ repeat ( $ . type_constraint ) ,
277+ ) ,
278+ seq (
279+ choice ( $ . type_identifier , $ . type_identifier_path ) ,
280+ optional ( $ . type_parameters ) ,
281+ '+=' ,
282+ optional ( 'private' ) ,
283+ $ . variant_type ,
284+ )
285+ ) ,
286+ optional ( alias ( $ . _type_declaration_and , $ . type_declaration ) )
276287 ) ,
277288
278289 _type_declaration_and : $ => seq (
You can’t perform that action at this time.
0 commit comments