summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFabrice Le Fessant <Fabrice.Le_fessant@inria.fr>2013-06-12 11:53:38 +0000
committerFabrice Le Fessant <Fabrice.Le_fessant@inria.fr>2013-06-12 11:53:38 +0000
commit5d82e6f17f27e239df053acce2961a9d030e612d (patch)
tree6911e1aa61d9fc5bbe4c67d974f07a11cbe43b01
parent09929494383eaf743eccfb2043b525970bc34879 (diff)
Fix PR#3679
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@13767 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
-rw-r--r--Changes1
-rw-r--r--parsing/location.ml18
2 files changed, 10 insertions, 9 deletions
diff --git a/Changes b/Changes
index 65bb98893..317eca532 100644
--- a/Changes
+++ b/Changes
@@ -51,6 +51,7 @@ Runtime system:
point within the major heap.
Bug fixes:
+- PR#3679: Warning display problems
- PR#3963: Graphics.wait_next_event in Win32 hangs if window closed
- PR#4762: ?? is not used at all, but registered as a lexer token
- PR#4887: input_char after close_in crashes ocaml (msvc runtime)
diff --git a/parsing/location.ml b/parsing/location.ml
index 4d6449ded..d4562e6d2 100644
--- a/parsing/location.ml
+++ b/parsing/location.ml
@@ -137,17 +137,17 @@ let highlight_dumb ppf lb loc =
if !line = !line_start && !line = !line_end then
(* loc is on one line: print whole line *)
Format.pp_print_char ppf c
- else if !line = !line_start then
+ else if !line = !line_start then begin
(* first line of multiline loc: print ... before loc_start *)
- if pos < loc.loc_start.pos_cnum
- then Format.pp_print_char ppf '.'
- else Format.pp_print_char ppf c
- else if !line = !line_end then
+ if pos = loc.loc_start.pos_cnum then
+ Format.pp_print_string ppf "...";
+ Format.pp_print_char ppf c
+ end else if !line = !line_end then begin
(* last line of multiline loc: print ... after loc_end *)
- if pos < loc.loc_end.pos_cnum
- then Format.pp_print_char ppf c
- else Format.pp_print_char ppf '.'
- else if !line > !line_start && !line < !line_end then
+ Format.pp_print_char ppf c;
+ if pos = loc.loc_end.pos_cnum then
+ Format.pp_print_string ppf "...";
+ end else if !line > !line_start && !line < !line_end then
(* intermediate line of multiline loc: print whole line *)
Format.pp_print_char ppf c
end else begin