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 =
59
59
let warning_legacy_accumulate ?loc () = warning_legacy_accumulate_gen ?loc true
60
60
let warning_legacy_accumulate2 ?loc () = warning_legacy_accumulate_gen ?loc false
61
61
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
+
62
71
}
63
72
GRAMMAR EXTEND Gram
64
73
GLOBAL : term;
@@ -84,11 +93,11 @@ GRAMMAR EXTEND Gram
84
93
85
94
term: LEVEL " 0"
86
95
[ [ " lib" ; " :" ; id = qualified_name -> {
87
- let ref = Coqlib. lib_ref ( String. concat " . " (snd id)) in
96
+ let ref = lib_ref id in
88
97
let path = Nametab. path_of_global ref in
89
98
CAst. make ~loc Constrexpr. (CRef (Libnames. qualid_of_path ~loc: (fst id) path,None )) }
90
99
| "lib" ; ":" ; "@" ; id = qualified_name -> {
91
- let ref = Coqlib. lib_ref ( String. concat " . " (snd id)) in
100
+ let ref = lib_ref id in
92
101
let path = Nametab. path_of_global ref in
93
102
let f = Libnames. qualid_of_path ~loc: (fst id) path in
94
103
CAst. make ~loc Constrexpr. (CAppExpl ((f,None ),[] )) } ] ]
You can’t perform that action at this time.
0 commit comments