method patt5 =
fun f ->
function
| (Ast.PaApp (_,
(Ast.PaApp (_,
(Ast.PaId (_, (Ast.IdUid (_, "::")))), _)),
_)
as p) -> o#simple_patt f p
| Ast.PaLaz (_, p) ->
pp f "@[<2>lazy %a@]" o#simple_patt p
| Ast.PaApp (_, x, y) ->
let (a, al) = get_patt_args x [ y ]
in
if not (Ast.is_patt_constructor a)
then
Format.eprintf
"WARNING: strange pattern application of a non constructor@."
else
if curry_constr
then
pp f "@[<2>%a@]" (list o#simple_patt "@ ")
(a :: al)
else
(match al with
| [ Ast.PaTup (_, _) ] ->
pp f "@[<2>%a@ (%a)@]" o#simple_patt x
o#patt y
| [ _ ] ->
pp f "@[<2>%a@ %a@]" o#patt5 x
o#simple_patt y
| al ->
pp f "@[<2>%a@ (%a)@]" o#patt5 a
(list o#simple_patt ",@ ") al)
| p -> o#simple_patt f p