method class_expr =
fun f ce ->
let () = o#node f ce Ast.loc_of_class_expr
in
match ce with
| Ast.CeApp (_, ce, e) ->
pp f "@[<2>%a@ %a@]" o#class_expr ce o#expr e
| Ast.CeCon (_, Ast.ViNil, i, (Ast.TyNil _)) ->
pp f "@[<2>%a@]" o#ident i
| Ast.CeCon (_, Ast.ViNil, i, t) ->
pp f "@[<2>@[<1>[%a]@]@ %a@]" o#class_params t
o#ident i
| Ast.CeCon (_, Ast.ViVirtual, (Ast.IdLid (_, i)),
(Ast.TyNil _)) -> pp f "@[<2>virtual@ %a@]" o#var i
| Ast.CeCon (_, Ast.ViVirtual, (Ast.IdLid (_, i)), t)
->
pp f "@[<2>virtual@ @[<1>[%a]@]@ %a@]"
o#class_params t o#var i
| Ast.CeFun (_, p, ce) ->
pp f "@[<2>fun@ %a@ ->@ %a@]" o#simple_patt p
o#class_expr ce
| Ast.CeLet (_, r, bi, ce) ->
pp f "@[<2>let %a%a@]@ @[<2>in@ %a@]" o#rec_flag r
o#binding bi o#class_expr ce
| Ast.CeStr (_, (Ast.PaNil _), cst) ->
pp f "@[<hv0>@[<hv2>object %a@]@ end@]"
o#class_str_item cst
| Ast.CeStr (_, p, cst) ->
pp f
"@[<hv0>@[<hv2>object @[<1>(%a)@]@ %a@]@ end@]"
o#patt p o#class_str_item cst
| Ast.CeTyc (_, ce, ct) ->
pp f "@[<1>(%a :@ %a)@]" o#class_expr ce
o#class_type ct
| Ast.CeAnt (_, s) -> o#anti f s
| Ast.CeAnd (_, ce1, ce2) ->
(o#class_expr f ce1;
pp f o#andsep;
o#class_expr f ce2)
| Ast.CeEq (_, ce1, (Ast.CeFun (_, p, ce2))) when
is_irrefut_patt p ->
pp f "@[<2>%a@ %a" o#class_expr ce1
o#patt_class_expr_fun_args (p, ce2)
| Ast.CeEq (_, ce1, ce2) ->
pp f "@[<2>%a =@]@ %a" o#class_expr ce1
o#class_expr ce2
| _ -> assert false