aboutsummaryrefslogtreecommitdiffhomepage
path: root/toplevel/coqloop.ml
diff options
context:
space:
mode:
authorGravatar Hugo Herbelin <Hugo.Herbelin@inria.fr>2017-05-06 11:41:33 +0200
committerGravatar Hugo Herbelin <Hugo.Herbelin@inria.fr>2017-09-14 13:31:27 +0200
commit7f816f00fed5ee7c7e94bd5f02a88880cdfa96aa (patch)
tree3c0d25c6cb26b5425ec5bc38ed9707c87a8d7e52 /toplevel/coqloop.ml
parenta86bdf0cae05e46d5f0516f29254aeb72bf08de7 (diff)
Using an algebraic type for distinguishing toplevel input from location in file.
Diffstat (limited to 'toplevel/coqloop.ml')
-rw-r--r--toplevel/coqloop.ml6
1 files changed, 4 insertions, 2 deletions
diff --git a/toplevel/coqloop.ml b/toplevel/coqloop.ml
index d76703d98..444bf8a8f 100644
--- a/toplevel/coqloop.ml
+++ b/toplevel/coqloop.ml
@@ -155,14 +155,16 @@ let error_info_for_buffer ?loc buf =
let fname = loc.Loc.fname in
let hl, loc =
(* We are in the toplevel *)
- if CString.equal fname "" then
+ match fname with
+ | Loc.ToplevelInput ->
let nloc = adjust_loc_buf buf loc in
if valid_buffer_loc buf loc then
(fnl () ++ print_highlight_location buf nloc, nloc)
(* in the toplevel, but not a valid buffer *)
else (mt (), nloc)
(* we are in batch mode, don't adjust location *)
- else (mt (), loc)
+ | Loc.InFile _ ->
+ (mt (), loc)
in Topfmt.pr_loc loc ++ hl
) loc