@@ -671,7 +671,8 @@ fn translation_rules() -> Vec<Rule<SwiftContext>> {
671671 calledExpression: ( arrayExpr
672672 elements: ( arrayElement expression: ( genericSpecializationExpr) @element) ) @@array
673673 arguments: _* @args
674- trailingClosure: @tc)
674+ trailingClosure: @tc
675+ additionalTrailingClosures: _* @additional)
675676 =>
676677 call_expr {
677678 let callee = tree_at!(
@@ -683,7 +684,8 @@ fn translation_rules() -> Vec<Rule<SwiftContext>> {
683684 tree!( ( call_expr
684685 callee: { callee}
685686 argument: { args}
686- argument: ( argument value: { tc} ) ) )
687+ argument: ( argument value: { tc} )
688+ argument: { additional} ) )
687689 }
688690 ) ,
689691 rule!(
@@ -705,12 +707,14 @@ fn translation_rules() -> Vec<Rule<SwiftContext>> {
705707 // A function/method call (`foo(1, 2)`). `calledExpression` is the callee
706708 // and `arguments` is an (elided) list of `labeledExpr`, each translated
707709 // to an `argument` below. A trailing closure (`xs.map { … }`) becomes
708- // a final unlabelled argument.
710+ // a final unlabelled argument, followed by any additional labeled
711+ // trailing closures.
709712 rule!(
710713 ( functionCallExpr
711714 calledExpression: @@rawCallee
712715 arguments: _* @args
713- trailingClosure: _? @trailing)
716+ trailingClosure: _? @trailing
717+ additionalTrailingClosures: _* @additional)
714718 =>
715719 expr {
716720 // Always translate the callee in non-pattern context.
@@ -722,6 +726,7 @@ fn translation_rules() -> Vec<Rule<SwiftContext>> {
722726 callee: { callee}
723727 argument: { args}
724728 argument: { trailing. map( |trailing| tree!( ( argument value: { trailing} ) ) ) }
729+ argument: { additional}
725730 ) )
726731 }
727732 ) ,
@@ -1021,9 +1026,17 @@ fn translation_rules() -> Vec<Rule<SwiftContext>> {
10211026 // subscripts their own shape needs only a `subscript_expr` node in
10221027 // ast_types.yml and a remap here.
10231028 rule!(
1024- ( subscriptCallExpr calledExpression: @callee arguments: _* @args)
1029+ ( subscriptCallExpr
1030+ calledExpression: @callee
1031+ arguments: _* @args
1032+ trailingClosure: _? @trailing
1033+ additionalTrailingClosures: _* @additional)
10251034 =>
1026- ( call_expr callee: { callee} argument: { args} )
1035+ ( call_expr
1036+ callee: { callee}
1037+ argument: { args}
1038+ argument: { trailing. map( |trailing| tree!( ( argument value: { trailing} ) ) ) }
1039+ argument: { additional} )
10271040 ) ,
10281041 // ---- Optionals and errors ----
10291042 // Optional chaining — unwrap the marker
0 commit comments