aboutsummaryrefslogtreecommitdiffstats
path: root/caml/Camlcoq.ml
diff options
context:
space:
mode:
authorxleroy <xleroy@fca1b0fc-160b-0410-b1d3-a4f43f01ea2e>2006-07-17 15:43:52 +0000
committerxleroy <xleroy@fca1b0fc-160b-0410-b1d3-a4f43f01ea2e>2006-07-17 15:43:52 +0000
commitc79434827bf2bd71f857f4471f7bbf381fddd189 (patch)
tree3df2fcad9be3ed0907280ab2490cad5b07a89435 /caml/Camlcoq.ml
parent28e9b3e7b8237c99f8f395d8edd8cb1dbe8c183c (diff)
downloadcompcert-c79434827bf2bd71f857f4471f7bbf381fddd189.tar.gz
compcert-c79434827bf2bd71f857f4471f7bbf381fddd189.zip
Ajout d'un type-checker (non certifie) pour Cminor
git-svn-id: https://yquem.inria.fr/compcert/svn/compcert/trunk@51 fca1b0fc-160b-0410-b1d3-a4f43f01ea2e
Diffstat (limited to 'caml/Camlcoq.ml')
-rw-r--r--caml/Camlcoq.ml6
1 files changed, 5 insertions, 1 deletions
diff --git a/caml/Camlcoq.ml b/caml/Camlcoq.ml
index 80ac5c0f..b0bb4ff9 100644
--- a/caml/Camlcoq.ml
+++ b/caml/Camlcoq.ml
@@ -19,6 +19,10 @@ let camlint_of_z = function
let camlint_of_coqint : Integers.int -> int32 = camlint_of_z
+let rec camlint_of_nat = function
+ | O -> 0
+ | S n -> camlint_of_nat n + 1
+
let rec nat_of_camlint n =
assert (n >= 0l);
if n = 0l then O else S (nat_of_camlint (Int32.sub n 1l))
@@ -57,7 +61,7 @@ let extern_atom a =
try
Hashtbl.find string_of_atom a
with Not_found ->
- "<unknown atom>"
+ Printf.sprintf "<unknown atom %ld>" (camlint_of_positive a)
(* Lists *)