@@ -226,54 +226,26 @@ let iter_process_bs_string_int_unwrap_uncurry attrs =
226
226
) attrs;
227
227
! st
228
228
229
- (* let process_bs_string_int_unwrap_uncurry attrs =
230
- List.fold_left
231
- (fun (st,attrs)
232
- (({txt ; loc}, (payload : _ ) ) as attr : attr) ->
233
- match txt, st with
234
- | "bs.string", (`Nothing | `String)
235
- -> `String, attrs
236
- | "bs.int", (`Nothing | `Int)
237
- -> `Int, attrs
238
- | "bs.ignore", (`Nothing | `Ignore)
239
- -> `Ignore, attrs
240
- | "bs.unwrap", (`Nothing | `Unwrap)
241
- -> `Unwrap, attrs
242
- | "bs.uncurry", `Nothing
243
- ->
244
- `Uncurry (Ast_payload.is_single_int payload), attrs
245
- (* Don't allow duplicated [bs.uncurry] since
246
- it may introduce inconsistency in arity
247
- *)
248
- | "bs.int", _
249
- | "bs.string", _
250
- | "bs.ignore", _
251
- | "bs.unwrap", _
252
- ->
253
- Bs_syntaxerr.err loc Conflict_attributes
254
- | _ , _ -> st, (attr :: attrs )
255
- ) (`Nothing, []) attrs *)
256
-
257
229
258
230
let iter_process_bs_string_as (attrs : t ) : string option =
259
231
let st = ref None in
260
- List . iter
232
+ Ext_list . iter attrs
261
233
(fun
262
- (({txt ; loc} , payload ) as attr : attr ) ->
234
+ (({txt ; loc} , payload ) as attr ) ->
263
235
match txt with
264
236
| " bs.as"
265
237
->
266
238
if ! st = None then
267
239
match Ast_payload. is_single_string payload with
268
240
| None ->
269
241
Bs_syntaxerr. err loc Expect_string_literal
270
- | Some (v ,_dec ) ->
242
+ | Some (v ,_dec ) ->
271
243
Bs_ast_invariant. mark_used_bs_attribute attr ;
272
244
st:= Some v
273
245
else
274
246
Bs_syntaxerr. err loc Duplicated_bs_as
275
247
| _ -> ()
276
- ) attrs ;
248
+ ) ;
277
249
! st
278
250
279
251
let has_bs_optional (attrs : t ) : bool =
0 commit comments