diff options
author | Xavier Leroy <xavier.leroy@inria.fr> | 2004-01-05 16:39:33 +0000 |
---|---|---|
committer | Xavier Leroy <xavier.leroy@inria.fr> | 2004-01-05 16:39:33 +0000 |
commit | b1b67be7ad15b951b0debb039304af2a8fb37ceb (patch) | |
tree | ed7d0119988c003248bb3325be0cfe58a81f976e | |
parent | c5fabfbfb314c5867a2b62fa3ba9f42ec4121ec7 (diff) |
MAJ numeros de tags dans print_obj
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@6059 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
-rw-r--r-- | tools/dumpobj.ml | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/tools/dumpobj.ml b/tools/dumpobj.ml index 5a6fa6d4e..4605b765a 100644 --- a/tools/dumpobj.ml +++ b/tools/dumpobj.ml @@ -108,12 +108,12 @@ 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 @@ -121,9 +121,9 @@ let rec print_obj x = 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 ")" @@ -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) |