diff options
author | Fabrice Le Fessant <Fabrice.Le_fessant@inria.fr> | 2013-06-12 11:53:38 +0000 |
---|---|---|
committer | Fabrice Le Fessant <Fabrice.Le_fessant@inria.fr> | 2013-06-12 11:53:38 +0000 |
commit | 5d82e6f17f27e239df053acce2961a9d030e612d (patch) | |
tree | 6911e1aa61d9fc5bbe4c67d974f07a11cbe43b01 /parsing | |
parent | 09929494383eaf743eccfb2043b525970bc34879 (diff) |
Fix PR#3679
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@13767 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
Diffstat (limited to 'parsing')
-rw-r--r-- | parsing/location.ml | 18 |
1 files changed, 9 insertions, 9 deletions
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 |