aboutsummaryrefslogtreecommitdiff
path: root/plugins/ssr
diff options
context:
space:
mode:
authorEmilio Jesus Gallego Arias2020-05-17 13:45:06 +0200
committerEmilio Jesus Gallego Arias2020-05-18 12:19:58 +0200
commit57c023fe6b5c7f97403d849f7ca618c98d1af1a4 (patch)
treee51b9173668c8ca19193b99f6e86f9f122b1619f /plugins/ssr
parent5ec400894c62d7f73caa3f554a5c9b9ee5b8f8d6 (diff)
[search] [ssr] Emit deprecated message when calling search from ssreflect
but ssrsearch is not loaded. Fixes #12338
Diffstat (limited to 'plugins/ssr')
-rw-r--r--plugins/ssr/ssrvernac.mlg29
-rw-r--r--plugins/ssr/ssrvernac.mli2
2 files changed, 31 insertions, 0 deletions
diff --git a/plugins/ssr/ssrvernac.mlg b/plugins/ssr/ssrvernac.mlg
index 7ef3e44848..24772a8514 100644
--- a/plugins/ssr/ssrvernac.mlg
+++ b/plugins/ssr/ssrvernac.mlg
@@ -300,6 +300,35 @@ VERNAC COMMAND EXTEND HintView CLASSIFIED AS SIDEFF
Ssrview.AdaptorDb.declare k hints }
END
+(** Search compatibility *)
+
+{
+
+ let warn_search_moved_enabled = ref true
+ let warn_search_moved = CWarnings.create ~name:"ssr-search-moved"
+ ~category:"deprecated" ~default:CWarnings.Enabled
+ (fun () ->
+ (Pp.strbrk
+ "SSReflect's Search command has been moved to the \
+ ssrsearch module; please Require that module if you \
+ still want to use SSReflect's Search command"))
+
+open G_vernac
+}
+
+GRAMMAR EXTEND Gram
+ GLOBAL: query_command;
+
+ query_command:
+ [ [ IDENT "Search"; s = search_query; l = search_queries; "." ->
+ { let (sl,m) = l in
+ if !warn_search_moved_enabled then warn_search_moved ();
+ fun g ->
+ Vernacexpr.VernacSearch (Vernacexpr.Search (s::sl),g, m) }
+ ] ]
+;
+END
+
(** Keyword compatibility fixes. *)
(* Coq v8.1 notation uses "by" and "of" quasi-keywords, i.e., reserved *)
diff --git a/plugins/ssr/ssrvernac.mli b/plugins/ssr/ssrvernac.mli
index 327a2d4660..93339313f0 100644
--- a/plugins/ssr/ssrvernac.mli
+++ b/plugins/ssr/ssrvernac.mli
@@ -9,3 +9,5 @@
(************************************************************************)
(* This file is (C) Copyright 2006-2015 Microsoft Corporation and Inria. *)
+
+val warn_search_moved_enabled : bool ref