Skip to content

Commit

Permalink
Merge pull request #6 from gmalecha/no-anomoly
Browse files Browse the repository at this point in the history
avoid anomolies when a hint database doesn't exist
  • Loading branch information
gmalecha authored Oct 15, 2019
2 parents 77a33c9 + 746a99b commit 63f26ea
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 5 deletions.
12 changes: 8 additions & 4 deletions src/g_ltac_iter.ml4
Original file line number Diff line number Diff line change
Expand Up @@ -70,10 +70,14 @@ struct
| Reverse c -> resolve_collection (not reverse) c
| HintDb db_name ->
let db =
let syms = ref [] in
let db = Hints.searchtable_map db_name in
Hints.Hint_db.iter (fun _ _ hl -> syms := hl :: !syms) db ;
!syms
try
let db = Hints.searchtable_map db_name in
let syms = ref [] in
Hints.Hint_db.iter (fun _ _ hl -> syms := hl :: !syms) db ;
!syms
with Not_found ->
let _ = Tacticals.tclIDTAC_MESSAGE Pp.(str "Hint database " ++ str db_name ++ str " not found!") in
[]
in
if reverse then
Proofview.Goal.nf_enter begin fun gl ->
Expand Down
7 changes: 6 additions & 1 deletion test-suite/example.v
Original file line number Diff line number Diff line change
Expand Up @@ -39,4 +39,9 @@ Goal False -> True -> 1 = 1 -> True.
let k l := pose l in
foreach [ rev *|- ] k.
exact I.
Defined.
Defined.

Goal True.
foreach [ db:does_not_exist ] ltac:(fun x => idtac x).
exact I.
Defined.

0 comments on commit 63f26ea

Please sign in to comment.