diff options
author | Luc Maranget <luc.maranget@inria.fr> | 2000-10-02 14:18:05 +0000 |
---|---|---|
committer | Luc Maranget <luc.maranget@inria.fr> | 2000-10-02 14:18:05 +0000 |
commit | ab97fd0dccd4f1761b209ca7ed8e6f9f9a2763b1 (patch) | |
tree | b5c98d572fd196ee68a160e177c9b9785fb40e80 /bytecomp/printlambda.ml | |
parent | 89f252d93e85bbbfe2ed06c0cc2c256c1ddb49b7 (diff) |
or-pat avec variables et compil du switch
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@3304 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
Diffstat (limited to 'bytecomp/printlambda.ml')
-rw-r--r-- | bytecomp/printlambda.ml | 21 |
1 files changed, 16 insertions, 5 deletions
diff --git a/bytecomp/printlambda.ml b/bytecomp/printlambda.ml index 6c62e3778..dd0098b1d 100644 --- a/bytecomp/printlambda.ml +++ b/bytecomp/printlambda.ml @@ -144,6 +144,7 @@ let primitive ppf = function | Parrayrefs _ -> fprintf ppf "array.get" | Parraysets _ -> fprintf ppf "array.set" | Pisint -> fprintf ppf "isint" + | Pisout -> fprintf ppf "isout" | Pbittest -> fprintf ppf "testbit" | Pbintofint bi -> print_boxed_integer "of_int" ppf bi | Pintofbint bi -> print_boxed_integer "to_int" ppf bi @@ -236,13 +237,23 @@ let rec lam ppf = function lam larg switch sw | Lstaticfail -> fprintf ppf "exit" - | Lstaticraise i -> - fprintf ppf "exit(%d)" i + | Lstaticraise (i, ls) -> + let lams ppf largs = + List.iter (fun l -> fprintf ppf "@ %a" lam l) largs in + fprintf ppf "@[<2>(exit@ %d%a)@]" i lams ls; | Lcatch(lbody, lhandler) -> fprintf ppf "@[<2>(catch@ %a@;<1 -1>with@ %a)@]" lam lbody lam lhandler - | Lstaticcatch(lbody, i, lhandler) -> - fprintf ppf "@[<2>(catch@ %a@;<1 -1>with(%d)@ %a)@]" - lam lbody i lam lhandler + | Lstaticcatch(lbody, (i, vars), lhandler) -> + fprintf ppf "@[<2>(catch@ %a@;<1 -1>with (%d%a)@ %a)@]" + lam lbody i + (fun ppf vars -> match vars with + | [] -> () + | _ -> + List.iter + (fun x -> fprintf ppf " %a" Ident.print x) + vars) + vars + lam lhandler | Ltrywith(lbody, param, lhandler) -> fprintf ppf "@[<2>(try@ %a@;<1 -1>with %a@ %a)@]" lam lbody Ident.print param lam lhandler |