struct
type parsing = [
| `cannot_parse_key_values of Pos.t * string
| `empty_line of Pos.t
| `incomplete_input of Pos.t * string list * string option
| `missing_chrom_value of Pos.t * string
| `missing_start_value of Pos.t * string
| `missing_step_value of Pos.t * string
| `wrong_start_value of Pos.t * string
| `wrong_step_value of Pos.t * string
| `unrecognizable_line of Pos.t * string list
| `wrong_bed_graph_value of Pos.t * string
| `wrong_fixed_step_value of Pos.t * string
| `wrong_span_value of Pos.t * string
| `wrong_variable_step_value of Pos.t * string
]
with sexp
let parsing_error_to_string =
let pos () a = Pos.to_string a in
function
| `cannot_parse_key_values (p, s) ->
sprintf "cannot_parse_key_values (%a, %S)" pos p s
| `empty_line p -> sprintf "empty_line (%a)" pos p
| `incomplete_input (p, vs, vo) ->
sprintf "incomplete_input (%a, %s, %S)" pos p
(String.concat ~sep:"; " vs) (Option.value ~default:"" vo)
| `missing_chrom_value (p, v) ->
sprintf "missing_chrom_value (%a, %s)" pos p v
| `missing_start_value (p, v) ->
sprintf "missing_start_value (%a, %s)" pos p v
| `missing_step_value (p, v) ->
sprintf "missing_step_value (%a, %s)" pos p v
| `wrong_start_value (p, v) ->
sprintf "wrong_start_value (%a, %s)" pos p v
| `wrong_step_value (p, v) ->
sprintf "wrong_step_value (%a, %s)" pos p v
| `unrecognizable_line (p, v) ->
sprintf "unrecognizable_line (%a, %s)" pos p (String.concat ~sep:" " v)
| `wrong_bed_graph_value (p, v) ->
sprintf "wrong_bed_graph_value (%a, %s)" pos p v
| `wrong_fixed_step_value (p, v) ->
sprintf "wrong_fixed_step_value (%a, %s)" pos p v
| `wrong_span_value (p, v) ->
sprintf "wrong_span_value (%a, %s)" pos p v
| `wrong_variable_step_value (p, v) ->
sprintf "wrong_variable_step_value (%a, %s)" pos p v
type to_bed_graph = [`not_in_variable_step_state | `not_in_fixed_step_state]
with sexp
type t = [ parsing | to_bed_graph ] with sexp
end