@@ -81,7 +81,7 @@ class virtual map =
81
81
in ForRange (_x, _x_i1, _x_i2, _x_i3, _x_i4, _x_i5)
82
82
| Continue _x -> let _x = o#label _x in Continue _x
83
83
| Break -> Break
84
- | Return _x -> let _x = o#return_expression _x in Return _x
84
+ | Return _x -> let _x = o#expression _x in Return _x
85
85
| Int_switch (_x , _x_i1 , _x_i2 ) ->
86
86
let _x = o#expression _x in
87
87
let _x_i1 =
@@ -278,6 +278,16 @@ class virtual map =
278
278
(* only used when inline a fucntion *)
279
279
(* Here we need track back a bit ?, move Return to Function ...
280
280
Then we can only have one Return, which is not good *)
281
+ (* since in ocaml, it's expression oriented langauge, [return] in
282
+ general has no jumps, it only happens when we do
283
+ tailcall conversion, in that case there is a jump.
284
+ However, currently a single [break] is good to cover
285
+ our compilation strategy
286
+ Attention: we should not insert [break] arbitrarily, otherwise
287
+ it would break the semantics
288
+ A more robust signature would be
289
+ {[ goto : label option ; ]}
290
+ *)
281
291
o#case_clause (fun o -> o#int))
282
292
_x_i1 in
283
293
let _x_i2 = o#option (fun o -> o#block) _x_i2
@@ -305,9 +315,6 @@ class virtual map =
305
315
let _x = o#statement_desc _x in
306
316
let _x_i1 = o#option (fun o -> o#string) _x_i1
307
317
in { statement_desc = _x; comment = _x_i1; }
308
- method return_expression : return_expression -> return_expression =
309
- fun { return_value = _x } ->
310
- let _x = o#expression _x in { return_value = _x; }
311
318
method required_modules : required_modules -> required_modules =
312
319
o#unknown
313
320
method property_name : property_name -> property_name = o#unknown
@@ -428,18 +435,7 @@ class virtual map =
428
435
let _x_i2 = o#option (fun o -> o#string) _x_i2
429
436
in { program = _x; modules = _x_i1; side_effect = _x_i2; }
430
437
method case_clause :
431
- (* since in ocaml, it's expression oriented langauge, [return] in
432
- general has no jumps, it only happens when we do
433
- tailcall conversion, in that case there is a jump.
434
- However, currently a single [break] is good to cover
435
- our compilation strategy
436
-
437
- Attention: we should not insert [break] arbitrarily, otherwise
438
- it would break the semantics
439
- A more robust signature would be
440
- {[ goto : label option ; ]}
441
- *)
442
- 'a 'a_out.
438
+ 'a 'a_out.
443
439
('self_type -> 'a -> 'a_out) -> 'a case_clause -> 'a_out case_clause =
444
440
fun _f_a
445
441
{
0 commit comments