@@ -101,7 +101,7 @@ module Types = struct
101
101
| Lstringswitch of t * (string * t) list * t option
102
102
| Lstaticraise of int * t list
103
103
| Lstaticcatch of t * (int * ident list ) * t
104
- | Ltrywith of t * ident * t
104
+ | Ltrywith of t * ident * t option * t option
105
105
| Lifthenelse of t * t * t
106
106
| Lsequence of t * t
107
107
| Lwhile of t * t
@@ -153,7 +153,7 @@ module X = struct
153
153
| Lstringswitch of t * (string * t) list * t option
154
154
| Lstaticraise of int * t list
155
155
| Lstaticcatch of t * (int * ident list ) * t
156
- | Ltrywith of t * ident * t
156
+ | Ltrywith of t * ident * t option * t option
157
157
| Lifthenelse of t * t * t
158
158
| Lsequence of t * t
159
159
| Lwhile of t * t
@@ -224,10 +224,11 @@ let inner_map (l : t) (f : t -> X.t) : X.t =
224
224
let e1 = f e1 in
225
225
let e2 = f e2 in
226
226
Lstaticcatch (e1, vars, e2)
227
- | Ltrywith (e1 , exn , e2 ) ->
227
+ | Ltrywith (e1 , exn , e2 , finally_expr ) ->
228
228
let e1 = f e1 in
229
- let e2 = f e2 in
230
- Ltrywith (e1, exn , e2)
229
+ let e2 = Ext_option. map e2 f in
230
+ let finally_expr = Ext_option. map finally_expr f in
231
+ Ltrywith (e1, exn , e2, finally_expr)
231
232
| Lifthenelse (e1 , e2 , e3 ) ->
232
233
let e1 = f e1 in
233
234
let e2 = f e2 in
@@ -457,7 +458,8 @@ let function_ ~attr ~arity ~params ~body : t =
457
458
let let_ kind id e body : t = Llet (kind, id, e, body)
458
459
let letrec bindings body : t = Lletrec (bindings, body)
459
460
let while_ a b : t = Lwhile (a, b)
460
- let try_ body id handler : t = Ltrywith (body, id, handler)
461
+ let try_ body id handler finally_expr : t =
462
+ Ltrywith (body, id, handler, finally_expr)
461
463
let for_ v e1 e2 dir e3 : t = Lfor (v, e1, e2, dir, e3)
462
464
let assign v l : t = Lassign (v, l)
463
465
let staticcatch a b c : t = Lstaticcatch (a, b, c)
0 commit comments