From e670b00267fc25209f13d3064831e82de2c06607 Mon Sep 17 00:00:00 2001 From: Maxime Levillain Date: Wed, 16 Oct 2024 11:10:49 +0200 Subject: [PATCH] propagate base ref from other modules --- src/ppx/ppx_common.ml | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/ppx/ppx_common.ml b/src/ppx/ppx_common.ml index 039c1cc..677644d 100644 --- a/src/ppx/ppx_common.ml +++ b/src/ppx/ppx_common.ml @@ -74,9 +74,10 @@ let set_global_base e = let loc = e.pexp_loc in global_base := true; let e = match e.pexp_desc with - | Pexp_constant Pconst_string (s, _, _) -> [%expr EzAPI.BASE [%e estring ~loc s]] - | _ -> e in - [%stri let ezreq_base = ref [%e e]] + | Pexp_constant Pconst_string (s, _, _) -> [%expr ref (EzAPI.BASE [%e estring ~loc s])] + | Pexp_apply ({pexp_desc=Pexp_ident {txt=Lident "!"; _}; _}, [ Nolabel, e ]) -> e + | _ -> [%expr ![%e e]] in + [%stri let ezreq_base = [%e e]] let set_globals l = List.fold_left (fun acc ({txt; _}, e) ->