aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rw-r--r--parsing/astterm.ml2
-rw-r--r--pretyping/rawterm.ml13
-rw-r--r--pretyping/rawterm.mli1
3 files changed, 15 insertions, 1 deletions
diff --git a/parsing/astterm.ml b/parsing/astterm.ml
index 13f33f977..e78ae3cd3 100644
--- a/parsing/astterm.ml
+++ b/parsing/astterm.ml
@@ -273,7 +273,7 @@ let rawconstr_of_qualid env vars loc qid =
(* Is it a reference to a syntactic definition? *)
try
let sp = Syntax_def.locate_syntactic_definition qid in
- Syntax_def.search_syntactic_definition sp, []
+ set_loc_of_rawconstr loc (Syntax_def.search_syntactic_definition sp), []
with Not_found ->
error_global_not_found_loc loc qid
diff --git a/pretyping/rawterm.ml b/pretyping/rawterm.ml
index 7e933a213..3329e62c3 100644
--- a/pretyping/rawterm.ml
+++ b/pretyping/rawterm.ml
@@ -75,6 +75,19 @@ let loc_of_rawconstr = function
| RHole (None) -> dummy_loc
| RCast (loc,_,_) -> loc
+let set_loc_of_rawconstr loc = function
+ | RRef (_,a) -> RRef (loc,a)
+ | RVar (_,a) -> RVar (loc,a)
+ | RMeta (_,a) -> RMeta (loc,a)
+ | RApp (_,a,b) -> RApp (loc,a,b)
+ | RBinder (_,a,b,c,d) -> RBinder (loc,a,b,c,d)
+ | RCases (_,a,b,c,d) -> RCases (loc,a,b,c,d)
+ | ROldCase (_,a,b,c,d) -> ROldCase (loc,a,b,c,d)
+ | RRec (_,a,b,c,d) -> RRec (loc,a,b,c,d)
+ | RSort (_,a) -> RSort (loc,a)
+ | RHole _ -> RHole (Some loc)
+ | RCast (_,a,b) -> RCast (loc,a,b)
+
let join_loc (deb1,_) (_,fin2) = (deb1,fin2)
diff --git a/pretyping/rawterm.mli b/pretyping/rawterm.mli
index e3233072b..9b8ed0a01 100644
--- a/pretyping/rawterm.mli
+++ b/pretyping/rawterm.mli
@@ -59,4 +59,5 @@ i*)
val dummy_loc : loc
val loc_of_rawconstr : rawconstr -> loc
+val set_loc_of_rawconstr : loc -> rawconstr -> rawconstr
val join_loc : loc -> loc -> loc