Skip to content

Commit a857b5b

Browse files
authored
Merge pull request #768 from ppedrot/hint-opaque-modes
Adapt w.r.t. coq/coq#20201.
2 parents ecd13d0 + e32ee93 commit a857b5b

File tree

1 file changed

+12
-5
lines changed

1 file changed

+12
-5
lines changed

src/coq_elpi_builtins.ml

+12-5
Original file line numberDiff line numberDiff line change
@@ -1107,6 +1107,15 @@ let find_hint_db s =
11071107
with Not_found ->
11081108
err Pp.(str "Hint DB not found: " ++ str s)
11091109

1110+
[%%if coq = "8.20" || coq = "9.0"]
1111+
let hint_mode env gr db =
1112+
let modes = Hints.Hint_db.modes db in
1113+
List.map (fun a -> Array.to_list a) @@ GlobRef.Map.find gr modes
1114+
[%%else]
1115+
let hint_mode env gr db =
1116+
List.map (fun a -> Array.to_list a) @@ Hints.Hint_db.find_mode env gr db
1117+
[%%endif]
1118+
11101119
let hint_db : (string * Hints.Hint_db.t) Conv.t = {
11111120
Conv.ty = B.string.Conv.ty;
11121121
Conv.pp_doc = B.string.Conv.pp_doc;
@@ -2925,11 +2934,9 @@ Supported attributes:|} ^ hint_locality_doc)))),
29252934
In(gref, "GR",
29262935
In(hint_db, "DB",
29272936
Out(B.list (B.list mode), "Modes",
2928-
Easy {|Gets all the mode declarations in DB about GR|}))),
2929-
(fun gr (_,db) _ ~depth:_ ->
2930-
try
2931-
let modes = Hints.Hint_db.modes db in
2932-
!: (List.map (fun a -> Array.to_list a) @@ GlobRef.Map.find gr modes)
2937+
Read(global, {|Gets all the mode declarations in DB about GR|})))),
2938+
(fun gr (_,db) _ ~depth:_ { env } _ _ ->
2939+
try !: (hint_mode env gr db)
29332940
with Not_found ->
29342941
!: []
29352942
)),

0 commit comments

Comments
 (0)