let string_to_int_seq_raw_item
?filename ?(tags=Tags.char_sequence_default) () =
let string_to_partial_sequence ~pos s =
try
let il = List.filter_map (String.split ~on:' ' s) ~f:(function
| "" -> None
| s -> Some (Int.of_string s))
in
match tags.Tags.max_items_per_line with
| Some n ->
if List.length il > n then
output_error (`sequence_is_too_long (pos,s))
else
output_ok (`partial_sequence il)
| None -> output_ok (`partial_sequence il)
with _ -> output_error (`malformed_partial_sequence (pos,s))
in
string_to_raw_item
~string_to_partial_sequence
?filename
~tags
()