@@ -383,26 +383,17 @@ module.exports = grammar({
383
383
384
384
view_bound : $ => seq ( "<%" , field ( "type" , $ . _type ) ) ,
385
385
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
+ ) ,
398
391
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
+ ) ,
406
397
407
398
/*
408
399
* TemplateBody ::= :<<< [SelfType] TemplateStat {semi TemplateStat} >>>
@@ -638,11 +629,7 @@ module.exports = grammar({
638
629
) ,
639
630
) ,
640
631
641
- _given_sig : $ =>
642
- seq (
643
- $ . _given_conditional ,
644
- "=>"
645
- ) ,
632
+ _given_sig : $ => seq ( $ . _given_conditional , "=>" ) ,
646
633
647
634
_given_conditional : $ => alias ( $ . parameters , $ . given_conditional ) ,
648
635
@@ -668,10 +655,7 @@ module.exports = grammar({
668
655
PREC . compound ,
669
656
seq (
670
657
$ . _constructor_application ,
671
- choice (
672
- ":" ,
673
- "with"
674
- ) ,
658
+ choice ( ":" , "with" ) ,
675
659
field ( "body" , $ . with_template_body ) ,
676
660
) ,
677
661
) ,
@@ -833,11 +817,7 @@ module.exports = grammar({
833
817
name_and_type : $ =>
834
818
prec . left (
835
819
PREC . control ,
836
- seq (
837
- field ( "name" , $ . _identifier ) ,
838
- ":" ,
839
- field ( "type" , $ . _param_type ) ,
840
- ) ,
820
+ seq ( field ( "name" , $ . _identifier ) , ":" , field ( "type" , $ . _param_type ) ) ,
841
821
) ,
842
822
843
823
_block : $ =>
@@ -899,7 +879,7 @@ module.exports = grammar({
899
879
$ . stable_type_identifier ,
900
880
$ . _type_identifier ,
901
881
$ . wildcard ,
902
- )
882
+ ) ,
903
883
) ,
904
884
905
885
compound_type : $ =>
@@ -956,11 +936,7 @@ module.exports = grammar({
956
936
957
937
tuple_type : $ => seq ( "(" , trailingCommaSep1 ( $ . _type ) , ")" ) ,
958
938
959
- named_tuple_type : $ => seq (
960
- "(" ,
961
- trailingCommaSep1 ( $ . name_and_type ) ,
962
- ")" ,
963
- ) ,
939
+ named_tuple_type : $ => seq ( "(" , trailingCommaSep1 ( $ . name_and_type ) , ")" ) ,
964
940
965
941
singleton_type : $ =>
966
942
prec . left (
@@ -1112,19 +1088,11 @@ module.exports = grammar({
1112
1088
// TODO: Flatten this.
1113
1089
alternative_pattern : $ => prec . left ( - 2 , seq ( $ . _pattern , "|" , $ . _pattern ) ) ,
1114
1090
1115
- tuple_pattern : $ => seq (
1116
- "(" ,
1117
- trailingCommaSep1 ( $ . _pattern ) ,
1118
- ")" ,
1119
- ) ,
1091
+ tuple_pattern : $ => seq ( "(" , trailingCommaSep1 ( $ . _pattern ) , ")" ) ,
1120
1092
1121
1093
named_pattern : $ => prec . left ( - 1 , seq ( $ . _identifier , "=" , $ . _pattern ) ) ,
1122
1094
1123
- named_tuple_pattern : $ => seq (
1124
- "(" ,
1125
- trailingCommaSep1 ( $ . named_pattern ) ,
1126
- ")" ,
1127
- ) ,
1095
+ named_tuple_pattern : $ => seq ( "(" , trailingCommaSep1 ( $ . named_pattern ) , ")" ) ,
1128
1096
1129
1097
// ---------------------------------------------------------------
1130
1098
// Expressions
@@ -1602,8 +1570,7 @@ module.exports = grammar({
1602
1570
$ . string ,
1603
1571
) ,
1604
1572
1605
- literal_type : $ =>
1606
- prec . left ( PREC . type , $ . _non_null_literal ) ,
1573
+ literal_type : $ => prec . left ( PREC . type , $ . _non_null_literal ) ,
1607
1574
1608
1575
literal : $ => choice ( $ . _non_null_literal , $ . null_literal ) ,
1609
1576
0 commit comments