Skip to content

Commit

Permalink
Hoist pstr_eval.
Browse files Browse the repository at this point in the history
  • Loading branch information
j0sh committed Mar 3, 2016
1 parent 2fe4782 commit e828cff
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/ppx/ppx_sqlexpr.ml
Original file line number Diff line number Diff line change
Expand Up @@ -180,6 +180,9 @@ let new_mapper argv = Ast_mapper.({
| x -> default_mapper.expr mapper x);
structure_item = (fun mapper structure_item ->
match structure_item with
| {pstr_desc = Pstr_eval (expr, attrib); pstr_loc} ->
let e = map_expr mapper pstr_loc expr in
{ structure_item with pstr_desc = Pstr_eval(e, attrib) }
| {pstr_desc = Pstr_value (rec_flag, value_bindings); pstr_loc} ->
(* since structure_item gets mapped before expr, need to preemptively
* apply our expr mapping to the value_bindings to resolve extensions *)
Expand Down

0 comments on commit e828cff

Please sign in to comment.