method simple_patt =
fun f p ->
let () = o#node f p Ast.loc_of_patt
in
match p with
| Ast.PaNil _ -> ()
| Ast.PaId (_, i) -> o#var_ident f i
| Ast.PaAnt (_, s) -> o#anti f s
| Ast.PaAny _ -> pp f "_"
| Ast.PaTup (_, p) -> pp f "@[<1>(%a)@]" o#patt3 p
| Ast.PaRec (_, p) -> pp f "@[<hv2>{@ %a@]@ }" o#patt p
| Ast.PaStr (_, s) -> pp f "\"%s\"" s
| Ast.PaTyc (_, p, t) ->
pp f "@[<1>(%a :@ %a)@]" o#patt p o#ctyp t
| Ast.PaNativeInt (_, s) -> o#numeric f s "n"
| Ast.PaInt64 (_, s) -> o#numeric f s "L"
| Ast.PaInt32 (_, s) -> o#numeric f s "l"
| Ast.PaInt (_, s) -> o#numeric f s ""
| Ast.PaFlo (_, s) -> o#numeric f s ""
| Ast.PaChr (_, s) -> pp f "'%s'" (ocaml_char s)
| Ast.PaLab (_, s, (Ast.PaNil _)) -> pp f "~%s" s
| Ast.PaVrn (_, s) -> pp f "`%a" o#var s
| Ast.PaTyp (_, i) -> pp f "@[<2>#%a@]" o#ident i
| Ast.PaArr (_, p) -> pp f "@[<2>[|@ %a@]@ |]" o#patt p
| Ast.PaLab (_, s, p) ->
pp f "@[<2>~%s:@ (%a)@]" s o#patt p
| Ast.PaOlb (_, s, (Ast.PaNil _)) -> pp f "?%s" s
| Ast.PaOlb (_, "", p) ->
pp f "@[<2>?(%a)@]" o#patt_tycon p
| Ast.PaOlb (_, s, p) ->
pp f "@[<2>?%s:@,@[<1>(%a)@]@]" s o#patt_tycon p
| Ast.PaOlbi (_, "", p, e) ->
pp f "@[<2>?(%a =@ %a)@]" o#patt_tycon p o#expr e
| Ast.PaOlbi (_, s, p, e) ->
pp f "@[<2>?%s:@,@[<1>(%a =@ %a)@]@]" s
o#patt_tycon p o#expr e
| (Ast.PaApp (_, _, _) | Ast.PaAli (_, _, _) |
Ast.PaOrp (_, _, _) | Ast.PaRng (_, _, _) |
Ast.PaCom (_, _, _) | Ast.PaSem (_, _, _) |
Ast.PaEq (_, _, _) | Ast.PaLaz (_, _)
as p) -> pp f "@[<1>(%a)@]" o#patt p