diff options
| author | Hugo Herbelin | 2018-11-22 10:56:06 +0100 |
|---|---|---|
| committer | Hugo Herbelin | 2018-11-22 10:56:06 +0100 |
| commit | 2d0be200ab9a2e3a0ff7b383078aabe70f24dd82 (patch) | |
| tree | bd9618861bd9d0ed11ee1e52c36340a2a7b9eed8 /printing/printer.ml | |
| parent | ba646509c8946dfa513c30e9b9659643af798cf3 (diff) | |
| parent | a7121ed7ba1a5a55845b5ffa4846b8aa0e293e5d (diff) | |
Merge PR #8967: Fix #8922 (uncaught pp_diff exception)
Diffstat (limited to 'printing/printer.ml')
| -rw-r--r-- | printing/printer.ml | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/printing/printer.ml b/printing/printer.ml index 831008a957..4840577cbf 100644 --- a/printing/printer.ml +++ b/printing/printer.ml @@ -685,10 +685,6 @@ let pr_subgoals ?(pr_first=true) ?(diffs=false) ?os_map | None -> GoalMap.empty in - let map_goal_for_diff ng = (* todo: move to proof_diffs.ml *) - try GoalMap.find ng diff_goal_map with Not_found -> ng - in - (** Printing functions for the extra informations. *) let rec print_stack a = function | [] -> Pp.int a @@ -724,7 +720,12 @@ let pr_subgoals ?(pr_first=true) ?(diffs=false) ?os_map let get_ogs g = match os_map with - | Some (osigma, _) -> Some { it = map_goal_for_diff g; sigma = osigma } + | Some (osigma, _) -> + (* if Not_found, returning None treats the goal as new and it will be highlighted; + returning Some { it = g; sigma = sigma } will compare the new goal + to itself and it won't be highlighted *) + (try Some { it = GoalMap.find g diff_goal_map; sigma = osigma } + with Not_found -> raise (Pp_diff.Diff_Failure "Unable to match goals between old and new proof states (7)")) | None -> None in let rec pr_rec n = function |
