@@ -81,9 +81,8 @@ module PluginSpec : sig
8181
8282 type t
8383
84- (* Main constructor, takes the format used in Declare ML Module.
85- With [usercode:true], warn instead of error on legacy syntax. *)
86- val of_package : ?usercode : bool -> string -> t
84+ (* Main constructor, takes the format used in Declare ML Module. *)
85+ val of_package : string -> t
8786
8887 val to_package : t -> string
8988
@@ -120,54 +119,7 @@ end = struct
120119 module Set = CSet. Make (Self )
121120 module Map = CMap. Make (Self )
122121
123- module Errors = struct
124-
125- let warn_legacy_loading =
126- CWarnings. create ~name: " legacy-loading-removed" ~category: Deprecation.Version. v9_0
127- Pp. (fun name ->
128- str " Legacy loading plugin method has been removed from Rocq, \
129- and the `:` syntax is deprecated, and its first \
130- argument ignored; please remove \" " ++
131- str name ++ str " :\" from your Declare ML" )
132-
133- let plugin_name_invalid_format m =
134- CErrors. user_err
135- Pp. (str Format. (asprintf " %s is not a valid plugin name." m) ++ spc () ++
136- str " It should be a public findlib name, e.g. package-name.foo." ++ spc () ++
137- str " Legacy names followed by a findlib public name, e.g. " ++ spc () ++
138- str " legacy_plugin:package-name.plugin," ++ spc() ++
139- str " are not supported anymore." )
140-
141- let warn_coq_core =
142- CWarnings. create ~name: " coq-core-plugin" ~category: Deprecation.Version. v9_0
143- Pp. (fun () -> str " \" coq-core\" has been renamed to \" rocq-runtime\" ." )
144-
145- end
146-
147- (* We would properly load the rocq-runtime cmxs because of the
148- virtual coq-core findlib package, but we would not initialize the plugin.
149- eg [Declare ML Module "coq-core.plugins.ltac". Ltac foo := idtac.] would fail
150- as the grammar for Ltac is not activated. *)
151- let compat_coq_core lib =
152- let old_prefix = " coq-core.plugins." in
153- if CString. is_prefix old_prefix lib
154- then begin
155- Errors. warn_coq_core () ;
156- let old_len = String. length old_prefix in
157- " rocq-runtime.plugins." ^ (CString. sub lib old_len (String. length lib - old_len))
158- end
159- else lib
160-
161- let of_package ?(usercode =false ) m =
162- let lib = match String. split_on_char ':' m with
163- | [ lib ] -> lib
164- | [cmxs; lib] when usercode ->
165- Errors. warn_legacy_loading cmxs;
166- lib
167- | _ -> Errors. plugin_name_invalid_format m
168- in
169- let lib = if usercode then compat_coq_core lib else lib in
170- { lib }
122+ let of_package lib = { lib }
171123
172124 let to_package { lib } = lib
173125
@@ -464,7 +416,7 @@ let inMLModule : ml_module_object -> Libobject.obj =
464416 classify_function = classify_ml_objects }
465417
466418let declare_ml_modules local mnames =
467- let mnames = List. map ( PluginSpec. of_package ~usercode: true ) mnames in
419+ let mnames = List. map PluginSpec. of_package mnames in
468420 if Lib. sections_are_opened()
469421 then CErrors. user_err Pp. (str " Cannot Declare ML Module while sections are opened." );
470422 let mnames = PluginSpec. add_deps mnames in
0 commit comments