|
|
@ -48,21 +48,20 @@ let make_trace_element lt_level lt_loc lt_description lt_node_tags =
|
|
|
|
type loc_trace = loc_trace_elem list
|
|
|
|
type loc_trace = loc_trace_elem list
|
|
|
|
|
|
|
|
|
|
|
|
let compute_local_exception_line loc_trace =
|
|
|
|
let compute_local_exception_line loc_trace =
|
|
|
|
let compute_local_exception_line state step =
|
|
|
|
let open Base.Continue_or_stop in
|
|
|
|
match state with
|
|
|
|
let compute_local_exception_line (last_known_step_at_level_zero_opt, line_opt) step =
|
|
|
|
| `Stop _ ->
|
|
|
|
let last_known_step_at_level_zero_opt' =
|
|
|
|
state
|
|
|
|
if Int.equal step.lt_level 0 then Some step else last_known_step_at_level_zero_opt
|
|
|
|
| `Continue (last_known_step_at_level_zero_opt, line_opt) ->
|
|
|
|
in
|
|
|
|
let last_known_step_at_level_zero_opt' =
|
|
|
|
match last_known_step_at_level_zero_opt' with
|
|
|
|
if Int.equal step.lt_level 0 then Some step else last_known_step_at_level_zero_opt
|
|
|
|
| Some step_zero when contains_exception step ->
|
|
|
|
in
|
|
|
|
Stop (Some step_zero.lt_loc.line)
|
|
|
|
match last_known_step_at_level_zero_opt' with
|
|
|
|
| _ ->
|
|
|
|
| Some step_zero when contains_exception step ->
|
|
|
|
Continue (last_known_step_at_level_zero_opt', line_opt)
|
|
|
|
`Stop (last_known_step_at_level_zero_opt', Some step_zero.lt_loc.line)
|
|
|
|
|
|
|
|
| _ ->
|
|
|
|
|
|
|
|
`Continue (last_known_step_at_level_zero_opt', line_opt)
|
|
|
|
|
|
|
|
in
|
|
|
|
in
|
|
|
|
snd (List_.fold_until ~init:(`Continue (None, None)) ~f:compute_local_exception_line loc_trace)
|
|
|
|
match List.fold_until ~init:(None, None) ~f:compute_local_exception_line loc_trace with
|
|
|
|
|
|
|
|
| Finished (_, line_opt) | Stopped_early line_opt ->
|
|
|
|
|
|
|
|
line_opt
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
type node_id_key = {node_id: int; node_key: Caml.Digest.t}
|
|
|
|
type node_id_key = {node_id: int; node_key: Caml.Digest.t}
|
|
|
|