Skip to content

Commit 5edb201

Browse files
authored
fix where clauses in type aliases and allow empty where clauses (#259)
* parse where clauses in type identifiers before the = * allow empty where clauses * chore: tree-sitter generate
1 parent 5ebbba1 commit 5edb201

File tree

5 files changed

+107670
-105480
lines changed

5 files changed

+107670
-105480
lines changed

grammar.js

+5-2
Original file line numberDiff line numberDiff line change
@@ -425,6 +425,7 @@ module.exports = grammar({
425425
'type',
426426
field('name', $._type_identifier),
427427
field('type_parameters', optional($.type_parameters)),
428+
optional($.where_clause),
428429
'=',
429430
field('type', $._type),
430431
optional($.where_clause),
@@ -465,8 +466,10 @@ module.exports = grammar({
465466

466467
where_clause: $ => prec.right(seq(
467468
'where',
468-
sepBy1(',', $.where_predicate),
469-
optional(','),
469+
optional(seq(
470+
sepBy1(',', $.where_predicate),
471+
optional(','),
472+
)),
470473
)),
471474

472475
where_predicate: $ => seq(

src/grammar.json

+52-27
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/node-types.json

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)