Skip to content

Commit

Permalink
rename Caml -> Stdlib
Browse files Browse the repository at this point in the history
Signed-off-by: Kakadu <[email protected]>
  • Loading branch information
Kakadu committed Mar 26, 2024
1 parent 5279d98 commit 8476f23
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 14 deletions.
13 changes: 7 additions & 6 deletions ppx/distrib/ppx_distrib_expander.ml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ open Stdppx
open Ppxlib.Ast_builder.Default
open Ppxlib.Ast_helper
open Printf
module Format = Caml.Format
module Format = Stdlib.Format
open Myhelpers

let use_logging = false
Expand All @@ -28,12 +28,12 @@ let notify fmt =
Printf.ksprintf
(fun s ->
let _cmd = Printf.sprintf "notify-send %S" s in
let (_ : int) = Caml.Sys.command _cmd in
let (_ : int) = Stdlib.Sys.command _cmd in
())
fmt
;;

let ( @@ ) = Caml.( @@ )
let ( @@ ) = Stdlib.( @@ )
let nolabel = Asttypes.Nolabel

let mangle_construct_name name =
Expand Down Expand Up @@ -617,7 +617,8 @@ let make_reifier_gen ~kind is_rec tdecl : Reifier_info.t =
| Reify ->
[%expr OCanren.Reifier.zed (OCanren.Reifier.rework ~fv:[%e fmapt])]
| Prj_exn -> fmapt])]
| _ -> failwiths ~loc:manifest.ptyp_loc "Not supported %s %d" Caml.__FILE__ Caml.__LINE__
| _ ->
failwiths ~loc:manifest.ptyp_loc "Not supported %s %d" Stdlib.__FILE__ Stdlib.__LINE__
in
{ Reifier_info.typ = None; body = body (); name = pat_name; decl = tdecl }
| None -> assert false
Expand Down Expand Up @@ -867,8 +868,8 @@ let process_main ~loc rec_ (base_tdecl, tdecl) =
failwiths
~loc:base_tdecl.ptype_loc
"%s %d Open and abstract types are not supported"
Caml.__FILE__
Caml.__LINE__)
Stdlib.__FILE__
Stdlib.__LINE__)
in
(* let typ_of_decl decl =
ptyp_constr
Expand Down
6 changes: 3 additions & 3 deletions ppx/fresh/ppx_fresh.ml
Original file line number Diff line number Diff line change
Expand Up @@ -210,14 +210,14 @@ let mapper =
in
ans
| None ->
Caml.Format.eprintf "Can't reconstruct args of 'fresh'";
Stdlib.Format.eprintf "Can't reconstruct args of 'fresh'";
{ e with pexp_desc = Pexp_apply (e1, [ Nolabel, new_body ]) })
| Pexp_apply (d, [ (_, body) ]) when is_defer d ->
let ans = [%expr delay (fun () -> [%e self#expression body])] in
ans
| Pexp_apply (d, body) when is_unif d ->
(* let loc_str =
Caml.Format.asprintf "%a" Selected_ast.Ast.Location.print_compact e.pexp_loc;
Stdlib.Format.asprintf "%a" Selected_ast.Ast.Location.print_compact e.pexp_loc;
in
let body = (Labelled "loc", Exp.constant (Pconst_string (loc_str,None))) :: body in *)
Exp.apply ~loc:e.pexp_loc d body
Expand Down Expand Up @@ -309,7 +309,7 @@ let mapper =
| Pexp_open (_od, ee) -> { e with pexp_desc = Pexp_open (_od, self#expression ee) }
| Pexp_letop _ | Pexp_extension _ | Pexp_pack _ -> e
(* | _ ->
Caml.Format.printf "%a\n%a\n%!" Location.print loc Pprintast.expression e;
Stdlib.Format.printf "%a\n%a\n%!" Location.print loc Pprintast.expression e;
assert false*)
end
;;
Expand Down
5 changes: 3 additions & 2 deletions ppx/myhelpers.ml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,8 @@ let extract_names =
List.map ~f:(fun (typ, _) ->
match typ.ptyp_desc with
| Ptyp_var s -> s
| _ -> failwith (Caml.Format.asprintf "Don't know what to do with %a" Pprintast.core_type typ))
| _ ->
failwith (Stdlib.Format.asprintf "Don't know what to do with %a" Pprintast.core_type typ))
;;

open Ppxlib.Ast_builder.Default
Expand All @@ -31,7 +32,7 @@ module Located = struct

(* let mknoloc txt = { txt; loc = Location.none } *)
let map_loc ~f l = { l with txt = f l.txt }
let sprintf ~loc fmt = Caml.Format.kasprintf (mk ~loc) fmt
let sprintf ~loc fmt = Stdlib.Format.kasprintf (mk ~loc) fmt
end

module Exp = struct
Expand Down
7 changes: 4 additions & 3 deletions ppx/reify/reify_impl.ml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
open Ppxlib
open Stdppx
open Ppxlib.Ast_builder.Default
module Format = Caml.Format
module Format = Stdlib.Format
open Myhelpers

type naming =
Expand Down Expand Up @@ -413,7 +413,7 @@ let make_reifier_composition ~pat ?(typ = None) kind tdecl =
let helper = reifier_of_core_type kind in
let manifest =
match tdecl.ptype_manifest with
| None -> failwiths "A type without manifest %s %d" Caml.__FILE__ Caml.__LINE__
| None -> failwiths "A type without manifest %s %d" Stdlib.__FILE__ Stdlib.__LINE__
| Some m -> m
in
let body =
Expand All @@ -427,7 +427,8 @@ let make_reifier_composition ~pat ?(typ = None) kind tdecl =
(Exp.ident ~loc @@ lident_of_list [ "OCanren"; "Std"; "Pair"; reifier_name ])
[ helper ~loc l; helper ~loc r ]
| Ptyp_tuple _ -> helper ~loc manifest
| _ -> failwiths ~loc "This type is not expected as manifest %s %d" Caml.__FILE__ Caml.__LINE__
| _ ->
failwiths ~loc "This type is not expected as manifest %s %d" Stdlib.__FILE__ Stdlib.__LINE__
in
let loc = tdecl.ptype_loc in
let pat =
Expand Down

0 comments on commit 8476f23

Please sign in to comment.