Skip to content

Commit

Permalink
MAJ numeros de tags dans print_obj
Browse files Browse the repository at this point in the history
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@6059 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
  • Loading branch information
xavierleroy committed Jan 5, 2004
1 parent c5fabfb commit b1b67be
Showing 1 changed file with 8 additions and 7 deletions.
15 changes: 8 additions & 7 deletions tools/dumpobj.ml
Expand Up @@ -108,22 +108,22 @@ let rec print_struct_const = function

let rec print_obj x =
if Obj.is_block x then begin
match Obj.tag x with
252 -> (* string *)
let tag = Obj.tag x in
if tag = Obj.string_tag then
printf "%S" (Obj.magic x : string)
| 253 -> (* float *)
else if tag = Obj.double_tag then
printf "%.12g" (Obj.magic x : float)
| 254 -> (* float array *)
else if tag = Obj.double_array_tag then begin
let a = (Obj.magic x : float array) in
printf "[|";
for i = 0 to Array.length a - 1 do
if i > 0 then printf ", ";
printf "%.12g" a.(i)
done;
printf "|]"
| _ ->
end else if tag < Obj.no_scan_tag then begin
printf "<%d>" (Obj.tag x);
begin match Obj.size x with
match Obj.size x with
0 -> ()
| 1 ->
printf "("; print_obj (Obj.field x 0); printf ")"
Expand All @@ -133,7 +133,8 @@ let rec print_obj x =
printf ", "; print_obj (Obj.field x i)
done;
printf ")"
end
end else
printf "<tag %d>" tag
end else
printf "%d" (Obj.magic x : int)

Expand Down

0 comments on commit b1b67be

Please sign in to comment.