let rec mkwithc wc acc =
match wc with
| Ast.WcNil _ -> acc
| Ast.WcTyp (loc, id_tpl, ct) ->
(mkwithtyp (fun x -> Pwith_type x) loc id_tpl ct) :: acc
| Ast.WcMod (_, i1, i2) ->
((long_uident i1), (Pwith_module (long_uident i2))) :: acc
| Ast.WcTyS (loc, id_tpl, ct) ->
(mkwithtyp (fun x -> Pwith_typesubst x) loc id_tpl ct) ::
acc
| Ast.WcMoS (_, i1, i2) ->
((long_uident i1), (Pwith_modsubst (long_uident i2))) ::
acc
| Ast.WcAnd (_, wc1, wc2) -> mkwithc wc1 (mkwithc wc2 acc)
| Ast.WcAnt (loc, _) ->
error loc "bad with constraint (antiquotation)"