File tree Expand file tree Collapse file tree 3 files changed +34
-4
lines changed Expand file tree Collapse file tree 3 files changed +34
-4
lines changed Original file line number Diff line number Diff line change @@ -117,14 +117,14 @@ let to_break_block (x : t) : J.block * bool =
117
117
let block = unnest_block x.block in
118
118
match x with
119
119
| {finished = True ; _ } ->
120
- block, false
120
+ block, false
121
121
(* value does not matter when [finished] is true
122
122
TODO: check if it has side efects
123
123
*)
124
124
| { value = None ; finished } ->
125
125
block, (match finished with | True -> false | (False | Dummy ) -> true )
126
126
127
- | {value = opt ; _} ->
127
+ | {value = Some _ as opt ; _} ->
128
128
block_with_opt_expr block opt, true
129
129
130
130
Original file line number Diff line number Diff line change @@ -65,6 +65,21 @@ val output_as_block :
65
65
val to_break_block :
66
66
t ->
67
67
J .block * bool
68
+ (* the second argument is
69
+ [true] means [break] needed
70
+
71
+ When we know the output is gonna finished true
72
+ we can reduce
73
+ {[
74
+ return xx ;
75
+ break
76
+ ]}
77
+ into
78
+ {[
79
+ return ;
80
+ ]}
81
+
82
+ *)
68
83
69
84
val append_output : t -> t -> t
70
85
Original file line number Diff line number Diff line change @@ -87926,6 +87926,21 @@ val output_as_block :
87926
87926
val to_break_block :
87927
87927
t ->
87928
87928
J.block * bool
87929
+ (* the second argument is
87930
+ [true] means [break] needed
87931
+
87932
+ When we know the output is gonna finished true
87933
+ we can reduce
87934
+ {[
87935
+ return xx ;
87936
+ break
87937
+ ]}
87938
+ into
87939
+ {[
87940
+ return ;
87941
+ ]}
87942
+
87943
+ *)
87929
87944
87930
87945
val append_output: t -> t -> t
87931
87946
@@ -88077,14 +88092,14 @@ let to_break_block (x : t) : J.block * bool =
88077
88092
let block = unnest_block x.block in
88078
88093
match x with
88079
88094
| {finished = True; _ } ->
88080
- block, false
88095
+ block, false
88081
88096
(* value does not matter when [finished] is true
88082
88097
TODO: check if it has side efects
88083
88098
*)
88084
88099
| { value = None; finished } ->
88085
88100
block, (match finished with | True -> false | (False | Dummy) -> true )
88086
88101
88087
- | {value = opt; _} ->
88102
+ | {value = Some _ as opt; _} ->
88088
88103
block_with_opt_expr block opt, true
88089
88104
88090
88105
You can’t perform that action at this time.
0 commit comments