File tree Expand file tree Collapse file tree 1 file changed +11
-3
lines changed Expand file tree Collapse file tree 1 file changed +11
-3
lines changed Original file line number Diff line number Diff line change @@ -607,6 +607,9 @@ module.exports = grammar({
607
607
choice (
608
608
$ . _annotated_type ,
609
609
$ . compound_type ,
610
+ // In theory structural_type should just be added to simple_type,
611
+ // but doing so increases the state of template_body to 4000
612
+ $ . _structural_type ,
610
613
// This adds _simple_type, but not the above intentionall/y.
611
614
seq ( $ . _simple_type , field ( "arguments" , $ . arguments ) ) ,
612
615
seq ( $ . _annotated_type , field ( "arguments" , $ . arguments ) ) ,
@@ -773,10 +776,16 @@ module.exports = grammar({
773
776
$ . match_type ,
774
777
$ . _annotated_type ,
775
778
$ . literal_type ,
779
+ $ . _structural_type ,
776
780
) ,
777
781
778
- // TODO: Make this a visible type, so that _type can be a supertype.
779
- _annotated_type : $ => prec . right ( seq ( $ . _simple_type , repeat ( $ . annotation ) ) ) ,
782
+ _annotated_type : $ =>
783
+ prec . right ( choice (
784
+ $ . annotated_type ,
785
+ $ . _simple_type ,
786
+ ) ) ,
787
+
788
+ annotated_type : $ => prec . right ( seq ( $ . _simple_type , repeat1 ( $ . annotation ) ) ) ,
780
789
781
790
_simple_type : $ =>
782
791
choice (
@@ -787,7 +796,6 @@ module.exports = grammar({
787
796
$ . stable_type_identifier ,
788
797
$ . _type_identifier ,
789
798
$ . wildcard ,
790
- $ . _structural_type ,
791
799
) ,
792
800
793
801
compound_type : $ =>
You can’t perform that action at this time.
0 commit comments