@@ -116,9 +116,9 @@ final class TypeExprTests: ParserTestCase {
116116 """
117117 )
118118
119- assertParse ( " (X).Y.self " , ExprSyntax . parse)
120- assertParse ( " (X.Y).Z.self " , ExprSyntax . parse)
121- assertParse ( " ((X).Y).Z.self " , ExprSyntax . parse)
119+ assertParse ( " (X).Y.self " , { ExprSyntax . parse ( from : & $0 ) } )
120+ assertParse ( " (X.Y).Z.self " , { ExprSyntax . parse ( from : & $0 ) } )
121+ assertParse ( " ((X).Y).Z.self " , { ExprSyntax . parse ( from : & $0 ) } )
122122 }
123123
124124 func testTypeExpr9( ) {
@@ -154,9 +154,9 @@ final class TypeExprTests: ParserTestCase {
154154 """
155155 )
156156
157- assertParse ( " X?.self " , ExprSyntax . parse)
158- assertParse ( " [X].self " , ExprSyntax . parse)
159- assertParse ( " [X : Y].self " , ExprSyntax . parse)
157+ assertParse ( " X?.self " , { ExprSyntax . parse ( from : & $0 ) } )
158+ assertParse ( " [X].self " , { ExprSyntax . parse ( from : & $0 ) } )
159+ assertParse ( " [X : Y].self " , { ExprSyntax . parse ( from : & $0 ) } )
160160 }
161161
162162 func testTypeExpr11( ) {
@@ -182,12 +182,12 @@ final class TypeExprTests: ParserTestCase {
182182 """
183183 )
184184
185- assertParse ( " (G<X>).Y.self " , ExprSyntax . parse)
186- assertParse ( " X?.Y.self " , ExprSyntax . parse)
187- assertParse ( " (X)?.Y.self " , ExprSyntax . parse)
188- assertParse ( " (X?).Y.self " , ExprSyntax . parse)
189- assertParse ( " [X].Y.self " , ExprSyntax . parse)
190- assertParse ( " [X : Y].Z.self " , ExprSyntax . parse)
185+ assertParse ( " (G<X>).Y.self " , { ExprSyntax . parse ( from : & $0 ) } )
186+ assertParse ( " X?.Y.self " , { ExprSyntax . parse ( from : & $0 ) } )
187+ assertParse ( " (X)?.Y.self " , { ExprSyntax . parse ( from : & $0 ) } )
188+ assertParse ( " (X?).Y.self " , { ExprSyntax . parse ( from : & $0 ) } )
189+ assertParse ( " [X].Y.self " , { ExprSyntax . parse ( from : & $0 ) } )
190+ assertParse ( " [X : Y].Z.self " , { ExprSyntax . parse ( from : & $0 ) } )
191191 }
192192
193193 func testTypeExpr12( ) {
@@ -578,107 +578,107 @@ final class TypeExprTests: ParserTestCase {
578578 }
579579
580580 func testCompositionTypeExpr( ) {
581- assertParse ( " P & Q " , ExprSyntax . parse)
582- assertParse ( " P & Q.self " , ExprSyntax . parse)
583- assertParse ( " any P & Q " , ExprSyntax . parse)
581+ assertParse ( " P & Q " , { ExprSyntax . parse ( from : & $0 ) } )
582+ assertParse ( " P & Q.self " , { ExprSyntax . parse ( from : & $0 ) } )
583+ assertParse ( " any P & Q " , { ExprSyntax . parse ( from : & $0 ) } )
584584
585- assertParse ( " (P & Q).self " , ExprSyntax . parse)
586- assertParse ( " ((P) & (Q)).self " , ExprSyntax . parse)
585+ assertParse ( " (P & Q).self " , { ExprSyntax . parse ( from : & $0 ) } )
586+ assertParse ( " ((P) & (Q)).self " , { ExprSyntax . parse ( from : & $0 ) } )
587587
588- assertParse ( " (A.B & C.D).self " , ExprSyntax . parse)
589- assertParse ( " ((A).B & (C).D).self " , ExprSyntax . parse)
588+ assertParse ( " (A.B & C.D).self " , { ExprSyntax . parse ( from : & $0 ) } )
589+ assertParse ( " ((A).B & (C).D).self " , { ExprSyntax . parse ( from : & $0 ) } )
590590
591- assertParse ( " (G<X> & G<Y>).self " , ExprSyntax . parse)
592- assertParse ( " (X? & Y?).self " , ExprSyntax . parse)
593- assertParse ( " ([X] & [Y]).self " , ExprSyntax . parse)
594- assertParse ( " ([A : B] & [C : D]).self " , ExprSyntax . parse)
591+ assertParse ( " (G<X> & G<Y>).self " , { ExprSyntax . parse ( from : & $0 ) } )
592+ assertParse ( " (X? & Y?).self " , { ExprSyntax . parse ( from : & $0 ) } )
593+ assertParse ( " ([X] & [Y]).self " , { ExprSyntax . parse ( from : & $0 ) } )
594+ assertParse ( " ([A : B] & [C : D]).self " , { ExprSyntax . parse ( from : & $0 ) } )
595595
596- assertParse ( " (G<A>.B & G<C>.D).self " , ExprSyntax . parse)
597- assertParse ( " (A?.B & C?.D).self " , ExprSyntax . parse)
598- assertParse ( " ([A].B & [A].B).self " , ExprSyntax . parse)
599- assertParse ( " ([A : B].C & [D : E].F).self " , ExprSyntax . parse)
596+ assertParse ( " (G<A>.B & G<C>.D).self " , { ExprSyntax . parse ( from : & $0 ) } )
597+ assertParse ( " (A?.B & C?.D).self " , { ExprSyntax . parse ( from : & $0 ) } )
598+ assertParse ( " ([A].B & [A].B).self " , { ExprSyntax . parse ( from : & $0 ) } )
599+ assertParse ( " ([A : B].C & [D : E].F).self " , { ExprSyntax . parse ( from : & $0 ) } )
600600
601- assertParse ( " (X.Type & Y.Type).self " , ExprSyntax . parse)
602- assertParse ( " (X.Protocol & Y.Protocol).self " , ExprSyntax . parse)
601+ assertParse ( " (X.Type & Y.Type).self " , { ExprSyntax . parse ( from : & $0 ) } )
602+ assertParse ( " (X.Protocol & Y.Protocol).self " , { ExprSyntax . parse ( from : & $0 ) } )
603603
604- assertParse ( " ((A, B) & (C, D)).self " , ExprSyntax . parse)
604+ assertParse ( " ((A, B) & (C, D)).self " , { ExprSyntax . parse ( from : & $0 ) } )
605605 }
606606
607607 func testTupleTypeExpr( ) {
608- assertParse ( " (X).self " , ExprSyntax . parse)
608+ assertParse ( " (X).self " , { ExprSyntax . parse ( from : & $0 ) } )
609609
610- assertParse ( " (X, Y) " , ExprSyntax . parse)
610+ assertParse ( " (X, Y) " , { ExprSyntax . parse ( from : & $0 ) } )
611611
612- assertParse ( " (X, Y).self " , ExprSyntax . parse)
613- assertParse ( " ((X), (Y)).self " , ExprSyntax . parse)
612+ assertParse ( " (X, Y).self " , { ExprSyntax . parse ( from : & $0 ) } )
613+ assertParse ( " ((X), (Y)).self " , { ExprSyntax . parse ( from : & $0 ) } )
614614
615- assertParse ( " (A.B, C.D).self " , ExprSyntax . parse)
616- assertParse ( " ((A).B, (C).D).self " , ExprSyntax . parse)
615+ assertParse ( " (A.B, C.D).self " , { ExprSyntax . parse ( from : & $0 ) } )
616+ assertParse ( " ((A).B, (C).D).self " , { ExprSyntax . parse ( from : & $0 ) } )
617617
618- assertParse ( " (G<X>, G<Y>).self " , ExprSyntax . parse)
619- assertParse ( " (X?, Y?).self " , ExprSyntax . parse)
620- assertParse ( " ([X], [Y]).self " , ExprSyntax . parse)
621- assertParse ( " ([A : B], [C : D]).self " , ExprSyntax . parse)
618+ assertParse ( " (G<X>, G<Y>).self " , { ExprSyntax . parse ( from : & $0 ) } )
619+ assertParse ( " (X?, Y?).self " , { ExprSyntax . parse ( from : & $0 ) } )
620+ assertParse ( " ([X], [Y]).self " , { ExprSyntax . parse ( from : & $0 ) } )
621+ assertParse ( " ([A : B], [C : D]).self " , { ExprSyntax . parse ( from : & $0 ) } )
622622
623- assertParse ( " (G<A>.B, G<C>.D).self " , ExprSyntax . parse)
624- assertParse ( " (A?.B, C?.D).self " , ExprSyntax . parse)
625- assertParse ( " ([A].B, [C].D).self " , ExprSyntax . parse)
626- assertParse ( " ([A : B].C, [D : E].F).self " , ExprSyntax . parse)
623+ assertParse ( " (G<A>.B, G<C>.D).self " , { ExprSyntax . parse ( from : & $0 ) } )
624+ assertParse ( " (A?.B, C?.D).self " , { ExprSyntax . parse ( from : & $0 ) } )
625+ assertParse ( " ([A].B, [C].D).self " , { ExprSyntax . parse ( from : & $0 ) } )
626+ assertParse ( " ([A : B].C, [D : E].F).self " , { ExprSyntax . parse ( from : & $0 ) } )
627627
628- assertParse ( " (X.Type, Y.Type).self " , ExprSyntax . parse)
629- assertParse ( " (X.Protocol, Y.Protocol).self " , ExprSyntax . parse)
628+ assertParse ( " (X.Type, Y.Type).self " , { ExprSyntax . parse ( from : & $0 ) } )
629+ assertParse ( " (X.Protocol, Y.Protocol).self " , { ExprSyntax . parse ( from : & $0 ) } )
630630
631- assertParse ( " (P & Q, P & Q).self " , ExprSyntax . parse)
631+ assertParse ( " (P & Q, P & Q).self " , { ExprSyntax . parse ( from : & $0 ) } )
632632
633633 assertParse (
634634 """
635635 (
636636 (G<X>.Y) -> (P) & X?.Y, (X.Y, [X : Y?].Type), [(G<X>).Y], [A.B.C].D
637637 ).self
638638 """ ,
639- ExprSyntax . parse
639+ { ExprSyntax . parse ( from : & $0 ) }
640640 )
641641 }
642642
643643 func testFunctionTypeExpr( ) {
644- assertParse ( " X -> Y " , ExprSyntax . parse)
645- assertParse ( " (X) -> Y " , ExprSyntax . parse)
646- assertParse ( " (X) -> Y -> Z " , ExprSyntax . parse)
647- assertParse ( " P & Q -> X " , ExprSyntax . parse)
648- assertParse ( " A & B -> C & D -> X " , ExprSyntax . parse)
649- assertParse ( " (X -> Y).self " , ExprSyntax . parse)
650- assertParse ( " (A & B -> C & D).self " , ExprSyntax . parse)
644+ assertParse ( " X -> Y " , { ExprSyntax . parse ( from : & $0 ) } )
645+ assertParse ( " (X) -> Y " , { ExprSyntax . parse ( from : & $0 ) } )
646+ assertParse ( " (X) -> Y -> Z " , { ExprSyntax . parse ( from : & $0 ) } )
647+ assertParse ( " P & Q -> X " , { ExprSyntax . parse ( from : & $0 ) } )
648+ assertParse ( " A & B -> C & D -> X " , { ExprSyntax . parse ( from : & $0 ) } )
649+ assertParse ( " (X -> Y).self " , { ExprSyntax . parse ( from : & $0 ) } )
650+ assertParse ( " (A & B -> C & D).self " , { ExprSyntax . parse ( from : & $0 ) } )
651651
652- assertParse ( " ((X) -> Y).self " , ExprSyntax . parse)
653- assertParse ( " (((X)) -> (Y)).self " , ExprSyntax . parse)
652+ assertParse ( " ((X) -> Y).self " , { ExprSyntax . parse ( from : & $0 ) } )
653+ assertParse ( " (((X)) -> (Y)).self " , { ExprSyntax . parse ( from : & $0 ) } )
654654
655- assertParse ( " ((A.B) -> C.D).self " , ExprSyntax . parse)
656- assertParse ( " (((A).B) -> (C).D).self " , ExprSyntax . parse)
655+ assertParse ( " ((A.B) -> C.D).self " , { ExprSyntax . parse ( from : & $0 ) } )
656+ assertParse ( " (((A).B) -> (C).D).self " , { ExprSyntax . parse ( from : & $0 ) } )
657657
658- assertParse ( " ((G<X>) -> G<Y>).self " , ExprSyntax . parse)
659- assertParse ( " ((X?) -> Y?).self " , ExprSyntax . parse)
660- assertParse ( " (([X]) -> [Y]).self " , ExprSyntax . parse)
661- assertParse ( " (([A : B]) -> [C : D]).self " , ExprSyntax . parse)
658+ assertParse ( " ((G<X>) -> G<Y>).self " , { ExprSyntax . parse ( from : & $0 ) } )
659+ assertParse ( " ((X?) -> Y?).self " , { ExprSyntax . parse ( from : & $0 ) } )
660+ assertParse ( " (([X]) -> [Y]).self " , { ExprSyntax . parse ( from : & $0 ) } )
661+ assertParse ( " (([A : B]) -> [C : D]).self " , { ExprSyntax . parse ( from : & $0 ) } )
662662
663- assertParse ( " ((Gen<Foo>.Bar) -> Gen<Foo>.Bar).self " , ExprSyntax . parse)
664- assertParse ( " ((Foo?.Bar) -> Foo?.Bar).self " , ExprSyntax . parse)
665- assertParse ( " (([Foo].Element) -> [Foo].Element).self " , ExprSyntax . parse)
666- assertParse ( " (([Int : Foo].Element) -> [Int : Foo].Element).self " , ExprSyntax . parse)
663+ assertParse ( " ((Gen<Foo>.Bar) -> Gen<Foo>.Bar).self " , { ExprSyntax . parse ( from : & $0 ) } )
664+ assertParse ( " ((Foo?.Bar) -> Foo?.Bar).self " , { ExprSyntax . parse ( from : & $0 ) } )
665+ assertParse ( " (([Foo].Element) -> [Foo].Element).self " , { ExprSyntax . parse ( from : & $0 ) } )
666+ assertParse ( " (([Int : Foo].Element) -> [Int : Foo].Element).self " , { ExprSyntax . parse ( from : & $0 ) } )
667667
668- assertParse ( " ((X.Type) -> Y.Type).self " , ExprSyntax . parse)
669- assertParse ( " ((X.Protocol) -> Y.Protocol).self " , ExprSyntax . parse)
668+ assertParse ( " ((X.Type) -> Y.Type).self " , { ExprSyntax . parse ( from : & $0 ) } )
669+ assertParse ( " ((X.Protocol) -> Y.Protocol).self " , { ExprSyntax . parse ( from : & $0 ) } )
670670
671- assertParse ( " (() -> X & Y).self " , ExprSyntax . parse)
672- assertParse ( " ((A & B) -> C & D).self " , ExprSyntax . parse)
673- assertParse ( " ((A & B) -> (C & D) -> E & Any).self " , ExprSyntax . parse)
671+ assertParse ( " (() -> X & Y).self " , { ExprSyntax . parse ( from : & $0 ) } )
672+ assertParse ( " ((A & B) -> C & D).self " , { ExprSyntax . parse ( from : & $0 ) } )
673+ assertParse ( " ((A & B) -> (C & D) -> E & Any).self " , { ExprSyntax . parse ( from : & $0 ) } )
674674
675675 assertParse (
676676 """
677677 (
678678 ((P) & X?.Y, G<X>.Y, (X, [A : B?].Type)) -> ([(X).Y]) -> [X].Y
679679 ).self
680680 """ ,
681- ExprSyntax . parse
681+ { ExprSyntax . parse ( from : & $0 ) }
682682 )
683683 }
684684
0 commit comments