summaryrefslogtreecommitdiff
path: root/interp/syntax_def.ml
diff options
context:
space:
mode:
Diffstat (limited to 'interp/syntax_def.ml')
-rw-r--r--interp/syntax_def.ml34
1 files changed, 16 insertions, 18 deletions
diff --git a/interp/syntax_def.ml b/interp/syntax_def.ml
index 2523063e..a4f20fd7 100644
--- a/interp/syntax_def.ml
+++ b/interp/syntax_def.ml
@@ -1,21 +1,22 @@
(************************************************************************)
-(* v * The Coq Proof Assistant / The Coq Development Team *)
-(* <O___,, * INRIA - CNRS - LIX - LRI - PPS - Copyright 1999-2016 *)
+(* * The Coq Proof Assistant / The Coq Development Team *)
+(* v * INRIA, CNRS and contributors - Copyright 1999-2018 *)
+(* <O___,, * (see CREDITS file for the list of authors) *)
(* \VV/ **************************************************************)
-(* // * This file is distributed under the terms of the *)
-(* * GNU Lesser General Public License Version 2.1 *)
+(* // * This file is distributed under the terms of the *)
+(* * GNU Lesser General Public License Version 2.1 *)
+(* * (see LICENSE file for the text of the license) *)
(************************************************************************)
-open CErrors
open Util
open Pp
+open CErrors
open Names
open Libnames
-open Notation_term
open Libobject
open Lib
-open Nameops
open Nametab
+open Notation_term
(* Syntactic definitions. *)
@@ -30,8 +31,8 @@ let add_syntax_constant kn c onlyparse =
let load_syntax_constant i ((sp,kn),(_,pat,onlyparse)) =
if Nametab.exists_cci sp then
- errorlabstrm "cache_syntax_constant"
- (pr_id (basename sp) ++ str " already exists");
+ user_err ~hdr:"cache_syntax_constant"
+ (Id.print (basename sp) ++ str " already exists");
add_syntax_constant kn pat onlyparse;
Nametab.push_syndef (Nametab.Until i) sp kn
@@ -89,22 +90,19 @@ let pr_compat_warning (kn, def, v) =
| [], NRef r -> spc () ++ str "is" ++ spc () ++ pr_global_env Id.Set.empty r
| _ -> strbrk " is a compatibility notation"
in
- let since = strbrk " since Coq > " ++ str (Flags.pr_version v) ++ str "." in
- pr_syndef kn ++ pp_def ++ since
+ pr_syndef kn ++ pp_def
let warn_compatibility_notation =
CWarnings.(create ~name:"compatibility-notation"
- ~category:"deprecated" ~default:Disabled pr_compat_warning)
+ ~category:"deprecated" ~default:Enabled pr_compat_warning)
-let verbose_compat kn def = function
+let verbose_compat ?loc kn def = function
| Some v when Flags.version_strictly_greater v ->
- warn_compatibility_notation (kn, def, v)
+ warn_compatibility_notation ?loc (kn, def, v)
| _ -> ()
-let search_syntactic_definition kn =
+let search_syntactic_definition ?loc kn =
let pat,v = KNmap.find kn !syntax_table in
let def = out_pat pat in
- verbose_compat kn def v;
+ verbose_compat ?loc kn def v;
def
-
-open Goptions