diff options
author | xleroy <xleroy@fca1b0fc-160b-0410-b1d3-a4f43f01ea2e> | 2013-04-08 17:36:13 +0000 |
---|---|---|
committer | xleroy <xleroy@fca1b0fc-160b-0410-b1d3-a4f43f01ea2e> | 2013-04-08 17:36:13 +0000 |
commit | ed4dc23a50557da6eecbc29ce4cd116e35f3de6e (patch) | |
tree | 206f878c15ddc9c14067cbf05b3d05df6b4af522 | |
parent | 7f989404e3a13a51f962827b425976b1853a99a2 (diff) | |
download | compcert-ed4dc23a50557da6eecbc29ce4cd116e35f3de6e.tar.gz compcert-ed4dc23a50557da6eecbc29ce4cd116e35f3de6e.zip |
List.iteri not in OCaml < 4.00, better not use it.
git-svn-id: https://yquem.inria.fr/compcert/svn/compcert/trunk@2182 fca1b0fc-160b-0410-b1d3-a4f43f01ea2e
-rw-r--r-- | exportclight/ExportClight.ml | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/exportclight/ExportClight.ml b/exportclight/ExportClight.ml index 1a8afa4f..ef005120 100644 --- a/exportclight/ExportClight.ml +++ b/exportclight/ExportClight.ml @@ -449,6 +449,13 @@ let re_annot_param = Str.regexp "%%\\|%[1-9][0-9]*" type fragment = Text of string | Param of int +(* For compatibility with OCaml < 4.00 *) +let list_iteri f l = + let rec iteri i = function + | [] -> () + | a::l -> f i a; iteri (i + 1) l + in iteri 0 l + let print_assertion p (txt, targs) = let frags = List.map @@ -464,14 +471,14 @@ let print_assertion p (txt, targs) = | Param n -> max_param := max n !max_param) frags; fprintf p " | %ld%%positive, " (P.to_int32 txt); - List.iteri + list_iteri (fun i targ -> match targ with | AA_arg _ -> fprintf p "_x%d :: " (i + 1) | _ -> ()) targs; fprintf p "nil =>@ "; - List.iteri + list_iteri (fun i targ -> match targ with | AA_arg _ -> () |