@@ -297,12 +297,6 @@ let rec functor_type cmts ~for_functor_kw ({ast= mty; _} as xmty) =
297297 ; pmty_loc
298298 ; pmty_attributes }
299299 when for_functor_kw || List. is_empty pmty_attributes ->
300- let arg =
301- match arg with
302- | {txt = None ; _} -> arg
303- | {txt = Some name ; _} ->
304- if String. equal " *" name then {arg with txt= None } else arg
305- in
306300 Cmts. relocate cmts ~src: pmty_loc ~before: arg.loc ~after: body.pmty_loc ;
307301 let body = sub_mty ~ctx body in
308302 let xargs, xbody =
@@ -324,26 +318,20 @@ let rec functor_type cmts ~for_functor_kw ({ast= mty; _} as xmty) =
324318
325319(* The sugar is different when used with the [functor] keyword. The syntax
326320 M(A : A)(B : B) cannot handle [_] as module name. *)
327- let rec functor_ cmts ~for_functor_kw ~ source_is_long ({ast = me ; _} as xme ) =
321+ let rec functor_ cmts ~for_functor_kw ({ast = me ; _} as xme ) =
328322 let ctx = Mod me in
329323 match me with
330324 | { pmod_desc= Pmod_functor (Named (arg, arg_mt), body)
331325 ; pmod_loc
332326 ; pmod_attributes }
333327 when for_functor_kw || List. is_empty pmod_attributes ->
334- let arg =
335- match arg with
336- | {txt = None ; _} -> arg
337- | {txt = Some name ; _} ->
338- if String. equal " *" name then {arg with txt= None } else arg
339- in
340328 Cmts. relocate cmts ~src: pmod_loc ~before: arg.loc ~after: body.pmod_loc ;
341329 let xarg_mt = sub_mty ~ctx arg_mt in
342330 let ctx = Mod body in
343331 let body = sub_mod ~ctx body in
344332 let xargs, xbody_me =
345333 match pmod_attributes with
346- | [] -> functor_ cmts ~for_functor_kw ~source_is_long body
334+ | [] -> functor_ cmts ~for_functor_kw body
347335 | _ -> ([] , body)
348336 in
349337 ((arg, Some xarg_mt) :: xargs, xbody_me)
@@ -353,7 +341,7 @@ let rec functor_ cmts ~for_functor_kw ~source_is_long ({ast= me; _} as xme) =
353341 let body = sub_mod ~ctx body in
354342 let xargs, xbody_me =
355343 match pmod_attributes with
356- | [] -> functor_ cmts ~for_functor_kw ~source_is_long body
344+ | [] -> functor_ cmts ~for_functor_kw body
357345 | _ -> ([] , body)
358346 in
359347 (({txt= Some " " ; loc= Location. none}, None ) :: xargs, xbody_me)
0 commit comments