summaryrefslogtreecommitdiffstats
path: root/bytecomp/printlambda.ml
diff options
context:
space:
mode:
authorXavier Leroy <xavier.leroy@inria.fr>1995-07-27 17:40:34 +0000
committerXavier Leroy <xavier.leroy@inria.fr>1995-07-27 17:40:34 +0000
commitb44ab158b2735be981330ff8a0d696051a246cc6 (patch)
tree0e992484f37f1c0a99d09eb4e41fc16812a5cacc /bytecomp/printlambda.ml
parent8213d543cb66cb460e8f3561e67fc6091dce6a60 (diff)
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
Diffstat (limited to 'bytecomp/printlambda.ml')
-rw-r--r--bytecomp/printlambda.ml33
1 files changed, 24 insertions, 9 deletions
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;