aboutsummaryrefslogtreecommitdiffhomepage
path: root/interp/smartlocate.ml
diff options
context:
space:
mode:
authorGravatar Emilio Jesus Gallego Arias <e+git@x80.org>2016-07-07 04:56:24 +0200
committerGravatar Emilio Jesus Gallego Arias <e+git@x80.org>2016-08-19 01:48:30 +0200
commitde038270f72214b169d056642eb7144a79e6f126 (patch)
treec1a5dc835f5042c79418fdbadc7b266a473b8c82 /interp/smartlocate.ml
parent13fb26d615cdb03a4c4841c20b108deab2de60b3 (diff)
Unify location handling of error functions.
In some cases prior to this patch, there were two cases for the same error function, one taking a location, the other not. We unify them by using an option parameter, in the line with recent changes in warnings and feedback. This implies a bit of clean up in some places, but more importantly, is the preparation for subsequent patches making `Loc.location` opaque, change that could be use to improve modularity and allow a more functional implementation strategy --- for example --- of the beautifier.
Diffstat (limited to 'interp/smartlocate.ml')
-rw-r--r--interp/smartlocate.ml10
1 files changed, 5 insertions, 5 deletions
diff --git a/interp/smartlocate.ml b/interp/smartlocate.ml
index 478774219..08425129b 100644
--- a/interp/smartlocate.ml
+++ b/interp/smartlocate.ml
@@ -46,7 +46,7 @@ let locate_global_with_alias ?(head=false) (loc,qid) =
if head then global_of_extended_global_head ref
else global_of_extended_global ref
with Not_found ->
- user_err_loc (loc,"",pr_qualid qid ++
+ user_err ~loc "" (pr_qualid qid ++
str " is bound to a notation that does not denote a reference.")
let global_inductive_with_alias r =
@@ -54,14 +54,14 @@ let global_inductive_with_alias r =
try match locate_global_with_alias lqid with
| IndRef ind -> ind
| ref ->
- user_err_loc (loc_of_reference r,"global_inductive",
- pr_reference r ++ spc () ++ str "is not an inductive type.")
- with Not_found -> Nametab.error_global_not_found_loc loc qid
+ user_err ~loc:(loc_of_reference r) "global_inductive"
+ (pr_reference r ++ spc () ++ str "is not an inductive type.")
+ with Not_found -> Nametab.error_global_not_found ~loc qid
let global_with_alias ?head r =
let (loc,qid as lqid) = qualid_of_reference r in
try locate_global_with_alias ?head lqid
- with Not_found -> Nametab.error_global_not_found_loc loc qid
+ with Not_found -> Nametab.error_global_not_found ~loc qid
let smart_global ?head = function
| AN r ->