module S = Tail open PrettyCommon let rec fmt_block fmt (S.Lam (self, vars, body)) = Format.fprintf fmt "λ%a(%a) ·@ %a" fmt_self self fmt_vars vars fmt_term body and fmt_term fmt (t: S.term) = match t with | S.Exit -> Format.fprintf fmt "Exit"; | S.TailCall(fct, args) -> Format.fprintf fmt "Call %a %a" fmt_val fct fmt_vals args | S.Print (value, next) -> Format.fprintf fmt "Print %a;@ %a" fmt_val value fmt_term next | S.LetVal (var, value, next) -> Format.fprintf fmt "@[let %a = %a@] in@ %a" fmt_var var fmt_val value fmt_term next | S.LetBlo (var, block, next) -> Format.fprintf fmt "@[let %a = %a@] in@ %a" fmt_var var fmt_block block fmt_term next | S.IfZero (cond, tIf, tElse) -> Format.fprintf fmt "@[ifzero %a then@ %a@]@ @[else@ %a@]@ " fmt_val cond fmt_term tIf fmt_term tElse let show term = Format.asprintf "@[%a@]" fmt_term term