Skip to content

Commit

Permalink
propagate base ref from other modules
Browse files Browse the repository at this point in the history
  • Loading branch information
maxtori committed Oct 16, 2024
1 parent 1d80572 commit e670b00
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/ppx/ppx_common.ml
Original file line number Diff line number Diff line change
Expand Up @@ -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) ->
Expand Down

0 comments on commit e670b00

Please sign in to comment.