Skip to content

Commit a808feb

Browse files
authored
Merge pull request #447 from tree-sitter/generation
chore: generate and sync latest changes
2 parents a9123ed + 7e4b0e7 commit a808feb

File tree

4 files changed

+544711
-501882
lines changed

4 files changed

+544711
-501882
lines changed

grammar.js

Lines changed: 18 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -383,26 +383,17 @@ module.exports = grammar({
383383

384384
view_bound: $ => seq("<%", field("type", $._type)),
385385

386-
_context_bounds: $ => choice(
387-
repeat1(seq(
388-
":",
389-
$.context_bound
390-
)),
391-
seq(
392-
":",
393-
"{",
394-
trailingCommaSep1($.context_bound),
395-
"}",
396-
)
397-
),
386+
_context_bounds: $ =>
387+
choice(
388+
repeat1(seq(":", $.context_bound)),
389+
seq(":", "{", trailingCommaSep1($.context_bound), "}"),
390+
),
398391

399-
context_bound: $ => seq(
400-
field("type", $._type),
401-
optional(seq(
402-
"as",
403-
field("name", $._identifier),
404-
)),
405-
),
392+
context_bound: $ =>
393+
seq(
394+
field("type", $._type),
395+
optional(seq("as", field("name", $._identifier))),
396+
),
406397

407398
/*
408399
* TemplateBody ::= :<<< [SelfType] TemplateStat {semi TemplateStat} >>>
@@ -638,11 +629,7 @@ module.exports = grammar({
638629
),
639630
),
640631

641-
_given_sig: $ =>
642-
seq(
643-
$._given_conditional,
644-
"=>"
645-
),
632+
_given_sig: $ => seq($._given_conditional, "=>"),
646633

647634
_given_conditional: $ => alias($.parameters, $.given_conditional),
648635

@@ -668,10 +655,7 @@ module.exports = grammar({
668655
PREC.compound,
669656
seq(
670657
$._constructor_application,
671-
choice(
672-
":",
673-
"with"
674-
),
658+
choice(":", "with"),
675659
field("body", $.with_template_body),
676660
),
677661
),
@@ -833,11 +817,7 @@ module.exports = grammar({
833817
name_and_type: $ =>
834818
prec.left(
835819
PREC.control,
836-
seq(
837-
field("name", $._identifier),
838-
":",
839-
field("type", $._param_type),
840-
),
820+
seq(field("name", $._identifier), ":", field("type", $._param_type)),
841821
),
842822

843823
_block: $ =>
@@ -899,7 +879,7 @@ module.exports = grammar({
899879
$.stable_type_identifier,
900880
$._type_identifier,
901881
$.wildcard,
902-
)
882+
),
903883
),
904884

905885
compound_type: $ =>
@@ -956,11 +936,7 @@ module.exports = grammar({
956936

957937
tuple_type: $ => seq("(", trailingCommaSep1($._type), ")"),
958938

959-
named_tuple_type: $ => seq(
960-
"(",
961-
trailingCommaSep1($.name_and_type),
962-
")",
963-
),
939+
named_tuple_type: $ => seq("(", trailingCommaSep1($.name_and_type), ")"),
964940

965941
singleton_type: $ =>
966942
prec.left(
@@ -1112,19 +1088,11 @@ module.exports = grammar({
11121088
// TODO: Flatten this.
11131089
alternative_pattern: $ => prec.left(-2, seq($._pattern, "|", $._pattern)),
11141090

1115-
tuple_pattern: $ => seq(
1116-
"(",
1117-
trailingCommaSep1($._pattern),
1118-
")",
1119-
),
1091+
tuple_pattern: $ => seq("(", trailingCommaSep1($._pattern), ")"),
11201092

11211093
named_pattern: $ => prec.left(-1, seq($._identifier, "=", $._pattern)),
11221094

1123-
named_tuple_pattern: $ => seq(
1124-
"(",
1125-
trailingCommaSep1($.named_pattern),
1126-
")",
1127-
),
1095+
named_tuple_pattern: $ => seq("(", trailingCommaSep1($.named_pattern), ")"),
11281096

11291097
// ---------------------------------------------------------------
11301098
// Expressions
@@ -1602,8 +1570,7 @@ module.exports = grammar({
16021570
$.string,
16031571
),
16041572

1605-
literal_type: $ =>
1606-
prec.left(PREC.type, $._non_null_literal),
1573+
literal_type: $ => prec.left(PREC.type, $._non_null_literal),
16071574

16081575
literal: $ => choice($._non_null_literal, $.null_literal),
16091576

0 commit comments

Comments
 (0)