File tree Expand file tree Collapse file tree 1 file changed +11
-2
lines changed Expand file tree Collapse file tree 1 file changed +11
-2
lines changed Original file line number Diff line number Diff line change @@ -59,6 +59,15 @@ let warning_legacy_accumulate_gen =
5959let warning_legacy_accumulate ?loc () = warning_legacy_accumulate_gen ?loc true
6060let warning_legacy_accumulate2 ?loc () = warning_legacy_accumulate_gen ?loc false
6161
62+ let lib_ref id =
63+ let id = String .concat "." (snd id ) in
64+ try Coqlib .lib_ref id
65+ with Coqlib .NotFoundRef _ ->
66+ CErrors .user_err
67+ Pp. (str "Global reference not found: lib:" ++ str id
68+ ++ str " (you may need to require some .v file with \
69+ `Register ... as " ++ str id ++ str ".`)." )
70+
6271}
6372GRAMMAR EXTEND Gram
6473 GLOBAL : term;
@@ -84,11 +93,11 @@ GRAMMAR EXTEND Gram
8493
8594 term: LEVEL " 0"
8695 [ [ " lib" ; " :" ; id = qualified_name -> {
87- let ref = Coqlib. lib_ref ( String. concat " . " (snd id)) in
96+ let ref = lib_ref id in
8897 let path = Nametab. path_of_global ref in
8998 CAst. make ~loc Constrexpr. (CRef (Libnames. qualid_of_path ~loc: (fst id) path,None )) }
9099 | "lib" ; ":" ; "@" ; id = qualified_name -> {
91- let ref = Coqlib. lib_ref ( String. concat " . " (snd id)) in
100+ let ref = lib_ref id in
92101 let path = Nametab. path_of_global ref in
93102 let f = Libnames. qualid_of_path ~loc: (fst id) path in
94103 CAst. make ~loc Constrexpr. (CAppExpl ((f,None ),[] )) } ] ]
You can’t perform that action at this time.
0 commit comments