@@ -103,86 +103,79 @@ let%expect_test "test-compiler/lib-effects/test1.ml" =
103103 {|
104104
105105 function exceptions(s, cont){
106- try {var _w_ = runtime.caml_int_of_string(s), n = _w_ ;}
107- catch(_A_ ){
108- var _s_ = caml_wrap_exception(_A_ );
109- if (_s_ [1 ] != = Stdlib [7 ]){
106+ try {var _t_ = runtime.caml_int_of_string(s), n = _t_ ;}
107+ catch(_x_ ){
108+ var _p_ = caml_wrap_exception(_x_ );
109+ if (_p_ [1 ] != = Stdlib [7 ]){
110110 var raise$ 1 = caml_pop_trap() ;
111- return raise$ 1 (caml_maybe_attach_backtrace(_s_ , 0 ));
111+ return raise$ 1 (caml_maybe_attach_backtrace(_p_ , 0 ));
112112 }
113113 var n = 0 ;
114114 }
115115 try {
116116 if (caml_string_equal(s, cst$ 0 ))
117117 throw caml_maybe_attach_backtrace(Stdlib [8 ], 1 );
118- var _v_ = 7 , m = _v_ ;
118+ var _s_ = 7 , m = _s_ ;
119119 }
120- catch(_z_ ){
121- var _t_ = caml_wrap_exception(_z_ );
122- if (_t_ != = Stdlib [8 ]){
120+ catch(_w_ ){
121+ var _q_ = caml_wrap_exception(_w_ );
122+ if (_q_ != = Stdlib [8 ]){
123123 var raise$ 0 = caml_pop_trap() ;
124- return raise$ 0 (caml_maybe_attach_backtrace(_t_ , 0 ));
124+ return raise$ 0 (caml_maybe_attach_backtrace(_q_ , 0 ));
125125 }
126126 var m = 0 ;
127127 }
128128 runtime.caml_push_trap
129- (function(_y_ ){
130- if (_y_ === Stdlib [8 ]) return cont(0 );
129+ (function(_v_ ){
130+ if (_v_ === Stdlib [8 ]) return cont(0 );
131131 var raise = caml_pop_trap() ;
132- return raise(caml_maybe_attach_backtrace(_y_ , 0 ));
132+ return raise(caml_maybe_attach_backtrace(_v_ , 0 ));
133133 });
134134 if (! caml_string_equal(s, cst))
135135 return caml_cps_call2
136136 (Stdlib [79 ],
137137 cst_toto,
138- function(_x_ ){caml_pop_trap() ; return cont([0 , [0 , _x_ , n, m]]);});
139- var _u_ = Stdlib [8 ], raise = caml_pop_trap() ;
140- return raise(caml_maybe_attach_backtrace(_u_ , 1 ));
138+ function(_u_ ){caml_pop_trap() ; return cont([0 , [0 , _u_ , n, m]]);});
139+ var _r_ = Stdlib [8 ], raise = caml_pop_trap() ;
140+ return raise(caml_maybe_attach_backtrace(_r_ , 1 ));
141141 }
142142 // end
143143 function cond1(b, cont){
144- function _p_ (ic){return cont([0 , ic, 7 ]);}
144+ function _o_ (ic){return cont([0 , ic, 7 ]);}
145145 return b
146- ? caml_cps_call2
147- (Stdlib [79 ], cst_toto$ 0 , function(_q_){return _p_(_q_);})
148- : caml_cps_call2
149- (Stdlib [79 ], cst_titi, function(_r_){return _p_(_r_);});
146+ ? caml_cps_call2(Stdlib [79 ], cst_toto$ 0 , _o_)
147+ : caml_cps_call2(Stdlib [79 ], cst_titi, _o_);
150148 }
151149 // end
152150 function cond2(b, cont){
153- function _m_() {return cont(7 );}
151+ function _m_(_n_ ){return cont(7 );}
154152 return b
155- ? caml_cps_call2(Stdlib_Printf [3 ], _a_, function(_n_){return _m_() ;} )
156- : caml_cps_call2(Stdlib_Printf [3 ], _b_, function(_o_){return _m_() ;} );
153+ ? caml_cps_call2(Stdlib_Printf [3 ], _a_, _m_)
154+ : caml_cps_call2(Stdlib_Printf [3 ], _b_, _m_);
157155 }
158156 // end
159157 function cond3(b, cont){
160158 var x = [0 , 0 ];
161- function _k_() {return cont(x[1 ]);}
162- return b
163- ? (x[1 ] = 1 , _k_() )
164- : caml_cps_call2(Stdlib_Printf [3 ], _c_, function(_l_){return _k_() ;});
159+ function _k_(_l_){return cont(x[1 ]);}
160+ return b ? (x[1 ] = 1 , _k_(0 )) : caml_cps_call2(Stdlib_Printf [3 ], _c_, _k_);
165161 }
166162 // end
167163 function loop1(b, cont){
168164 return caml_cps_call2
169165 (Stdlib [79 ],
170166 cst_static_examples_ml,
171167 function(ic){
172- function _i_() {
168+ function _i_(_j_ ){
173169 return caml_cps_call2
174170 (Stdlib [83 ],
175171 ic,
176172 function(line){
177173 return b
178- ? caml_cps_call2
179- (Stdlib [53 ],
180- line,
181- function(_j_){return caml_cps_exact_call0(_i_);})
182- : caml_cps_exact_call0(_i_);
174+ ? caml_cps_call2(Stdlib [53 ], line, _i_)
175+ : caml_cps_exact_call1(_i_, 0 );
183176 });
184177 }
185- return _i_() ;
178+ return _i_(0 );
186179 });
187180 }
188181 // end
@@ -191,23 +184,15 @@ let%expect_test "test-compiler/lib-effects/test1.ml" =
191184 (Stdlib [79 ],
192185 cst_static_examples_ml$ 0 ,
193186 function(ic){
194- return caml_cps_call2
195- (Stdlib_Printf [3 ],
196- _d_,
197- function(_f_){
198- function _g_() {
199- return caml_cps_call2
200- (Stdlib [83 ],
201- ic,
202- function(line){
203- return caml_cps_call2
204- (Stdlib [53 ],
205- line,
206- function(_h_){return caml_cps_exact_call0(_g_);});
207- });
208- }
209- return _g_() ;
210- });
187+ function _g_(_h_){
188+ return caml_cps_call2
189+ (Stdlib [83 ],
190+ ic,
191+ function(line){
192+ return caml_cps_call2(Stdlib [53 ], line, _g_);
193+ });
194+ }
195+ return caml_cps_call2(Stdlib_Printf [3 ], _d_, _g_);
211196 });
212197 }
213198 // end
@@ -216,8 +201,12 @@ let%expect_test "test-compiler/lib-effects/test1.ml" =
216201 (list_rev,
217202 _e_,
218203 function(l){
219- var x = l;
220- for (;;){if (! x) return cont(l); var r = x[2 ]; x = r;}
204+ function _f_(x){
205+ if (! x) return cont(l);
206+ var r = x[2 ];
207+ return caml_cps_exact_call1(_f_, r);
208+ }
209+ return _f_(l);
221210 });
222211 }
223212 // end | }]
0 commit comments