From b44ab158b2735be981330ff8a0d696051a246cc6 Mon Sep 17 00:00:00 2001 From: Xavier Leroy Date: Thu, 27 Jul 1995 17:40:34 +0000 Subject: Creation du module primitive. Gestion speciale des tableaux de flottants et des records de flottants. git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@152 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02 --- bytecomp/printlambda.ml | 33 ++++++++++++++++++++++++--------- 1 file changed, 24 insertions(+), 9 deletions(-) (limited to 'bytecomp/printlambda.ml') diff --git a/bytecomp/printlambda.ml b/bytecomp/printlambda.ml index 7a3152799..ea1adca14 100644 --- a/bytecomp/printlambda.ml +++ b/bytecomp/printlambda.ml @@ -1,5 +1,6 @@ open Format open Asttypes +open Primitive open Typedtree open Lambda @@ -25,6 +26,17 @@ let rec structured_constant = function close_box(); print_string "]"; close_box() + | Const_float_array [] -> + print_string "[| |]" + | Const_float_array (f1 :: fl) -> + open_hovbox 1; + print_string "[|"; + open_hovbox 0; + print_string f1; + List.iter (fun f -> print_space(); print_string f) fl; + close_box(); + print_string "|]"; + close_box() let primitive = function Pidentity -> print_string "id" @@ -33,6 +45,8 @@ let primitive = function | Pmakeblock tag -> print_string "makeblock "; print_int tag | Pfield n -> print_string "field "; print_int n | Psetfield(n, _) -> print_string "setfield "; print_int n + | Pfloatfield n -> print_string "floatfield "; print_int n + | Psetfloatfield n -> print_string "setfloatfield "; print_int n | Pccall p -> print_string p.prim_name | Praise -> print_string "raise" | Psequand -> print_string "&&" @@ -72,15 +86,16 @@ let primitive = function | Pfloatcomp(Cgt) -> print_string ">." | Pfloatcomp(Cge) -> print_string ">=." | Pstringlength -> print_string "string.length" - | Pgetstringchar -> print_string "string.unsafe_get" - | Psetstringchar -> print_string "string.unsafe_set" - | Psafegetstringchar -> print_string "string.get" - | Psafesetstringchar -> print_string "string.set" - | Pvectlength -> print_string "array.length" - | Pgetvectitem -> print_string "array.unsafe_get" - | Psetvectitem _ -> print_string "array.unsafe_set" - | Psafegetvectitem -> print_string "array.get" - | Psafesetvectitem _ -> print_string "array.set" + | Pstringrefu -> print_string "string.unsafe_get" + | Pstringsetu -> print_string "string.unsafe_set" + | Pstringrefs -> print_string "string.get" + | Pstringsets -> print_string "string.set" + | Parraylength _ -> print_string "array.length" + | Pmakearray _ -> print_string "makearray " + | Parrayrefu _ -> print_string "array.unsafe_get" + | Parraysetu _ -> print_string "array.unsafe_set" + | Parrayrefs _ -> print_string "array.get" + | Parraysets _ -> print_string "array.set" | Ptranslate tbl -> print_string "translate ["; open_hvbox 0; -- cgit v1.2.3-70-g09d2