Fix add_let
This commit is contained in:
parent
846af28b3c
commit
78349cc4b8
|
@ -705,22 +705,12 @@ let rewrite phrase =
|
||||||
let add_let binding_name def =
|
let add_let binding_name def =
|
||||||
let open Parsetree in
|
let open Parsetree in
|
||||||
match def with
|
match def with
|
||||||
| { pstr_desc = Pstr_eval (expr, attr); pstr_loc } ->
|
| { pstr_desc = Pstr_eval (expr, attrs); pstr_loc = loc } ->
|
||||||
{
|
Ast_helper.Str.value ~loc Nonrecursive
|
||||||
pstr_loc;
|
[
|
||||||
pstr_desc = Pstr_value (Asttypes.Nonrecursive, [
|
let pat = Ast_helper.Pat.var ~loc { txt = binding_name; loc } in
|
||||||
{
|
Ast_helper.Vb.mk ~loc ~attrs pat expr
|
||||||
pvb_pat = {
|
]
|
||||||
ppat_desc = Ppat_var { txt = binding_name; loc = pstr_loc; };
|
|
||||||
ppat_loc_stack= [];
|
|
||||||
ppat_loc = pstr_loc;
|
|
||||||
ppat_attributes = [];
|
|
||||||
};
|
|
||||||
pvb_expr = expr;
|
|
||||||
pvb_attributes = attr;
|
|
||||||
pvb_loc = pstr_loc;
|
|
||||||
}]);
|
|
||||||
}
|
|
||||||
| _ ->
|
| _ ->
|
||||||
def
|
def
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue