@@ -149,15 +149,155 @@ let translate_constr ~config ~params_translation ~(path : Path.t) ~type_env =
149149 {dependencies = [] ; type_ = ident (" Intl." ^ intl_module)}
150150 | ([" Stdlib" ; " Error" ; " t" ] | [" Stdlib" ; " JsError" ; " t" ]), [] ->
151151 {dependencies = [] ; type_ = ident " Error" }
152- | [" Stdlib" ; " Iterator " ; " t" ], [param_translation] ->
152+ | ( [" Stdlib" ; " Iterable " ; " t" ] | [ " iterable " ]) , [param_translation] ->
153153 {
154154 dependencies = param_translation.dependencies;
155- type_ = ident ~type_args: [param_translation.type_] " Iterator " ;
155+ type_ = ident ~type_args: [param_translation.type_] " Iterable " ;
156156 }
157- | [" Stdlib" ; " AsyncIterator" ; " t" ], [param_translation] ->
157+ | ( [" Stdlib" ; " Iterator" ; " t" ],
158+ [yield_translation; return_translation; next_translation] ) ->
159+ {
160+ dependencies =
161+ List. concat
162+ [
163+ yield_translation.dependencies;
164+ return_translation.dependencies;
165+ next_translation.dependencies;
166+ ];
167+ type_ =
168+ ident
169+ ~type_args:
170+ [
171+ yield_translation.type_;
172+ return_translation.type_;
173+ next_translation.type_;
174+ ]
175+ " Iterator" ;
176+ }
177+ | ( [" Stdlib" ; " IteratorObject" ; " t" ],
178+ [yield_translation; return_translation; next_translation] ) ->
179+ {
180+ dependencies =
181+ List. concat
182+ [
183+ yield_translation.dependencies;
184+ return_translation.dependencies;
185+ next_translation.dependencies;
186+ ];
187+ type_ =
188+ ident
189+ ~type_args:
190+ [
191+ yield_translation.type_;
192+ return_translation.type_;
193+ next_translation.type_;
194+ ]
195+ " IteratorObject" ;
196+ }
197+ | ( [" Stdlib" ; " IterableIterator" ; " t" ],
198+ [yield_translation; return_translation; next_translation] ) ->
199+ {
200+ dependencies =
201+ List. concat
202+ [
203+ yield_translation.dependencies;
204+ return_translation.dependencies;
205+ next_translation.dependencies;
206+ ];
207+ type_ =
208+ ident
209+ ~type_args:
210+ [
211+ yield_translation.type_;
212+ return_translation.type_;
213+ next_translation.type_;
214+ ]
215+ " IterableIterator" ;
216+ }
217+ | ( [" Stdlib" ; " Generator" ; " t" ],
218+ [yield_translation; return_translation; next_translation] ) ->
219+ {
220+ dependencies =
221+ List. concat
222+ [
223+ yield_translation.dependencies;
224+ return_translation.dependencies;
225+ next_translation.dependencies;
226+ ];
227+ type_ =
228+ ident
229+ ~type_args:
230+ [
231+ yield_translation.type_;
232+ return_translation.type_;
233+ next_translation.type_;
234+ ]
235+ " Generator" ;
236+ }
237+ | [" Stdlib" ; " AsyncIterable" ; " t" ], [param_translation] ->
158238 {
159239 dependencies = param_translation.dependencies;
160- type_ = ident ~type_args: [param_translation.type_] " AsyncIterator" ;
240+ type_ = ident ~type_args: [param_translation.type_] " AsyncIterable" ;
241+ }
242+ | ( [" Stdlib" ; " AsyncIterator" ; " t" ],
243+ [yield_translation; return_translation; next_translation] ) ->
244+ {
245+ dependencies =
246+ List. concat
247+ [
248+ yield_translation.dependencies;
249+ return_translation.dependencies;
250+ next_translation.dependencies;
251+ ];
252+ type_ =
253+ ident
254+ ~type_args:
255+ [
256+ yield_translation.type_;
257+ return_translation.type_;
258+ next_translation.type_;
259+ ]
260+ " AsyncIterator" ;
261+ }
262+ | ( [" Stdlib" ; " AsyncIterableIterator" ; " t" ],
263+ [yield_translation; return_translation; next_translation] ) ->
264+ {
265+ dependencies =
266+ List. concat
267+ [
268+ yield_translation.dependencies;
269+ return_translation.dependencies;
270+ next_translation.dependencies;
271+ ];
272+ type_ =
273+ ident
274+ ~type_args:
275+ [
276+ yield_translation.type_;
277+ return_translation.type_;
278+ next_translation.type_;
279+ ]
280+ " AsyncIterableIterator" ;
281+ }
282+ | ( [" Stdlib" ; " AsyncGenerator" ; " t" ],
283+ [yield_translation; return_translation; next_translation] ) ->
284+ {
285+ dependencies =
286+ List. concat
287+ [
288+ yield_translation.dependencies;
289+ return_translation.dependencies;
290+ next_translation.dependencies;
291+ ];
292+ type_ =
293+ ident
294+ ~type_args:
295+ [
296+ yield_translation.type_;
297+ return_translation.type_;
298+ next_translation.type_;
299+ ]
300+ " AsyncGenerator" ;
161301 }
162302 | [" Stdlib" ; " Ordering" ; " t" ], [] -> {dependencies = [] ; type_ = number_t}
163303 | [" unit" ], [] -> {dependencies = [] ; type_ = unit_t}
0 commit comments