Commit 4080a54a authored by Pietro Abate's avatar Pietro Abate
Browse files

[r2004-07-12 19:11:58 by afrisch] Pb to print unterminated string errors

Original author: afrisch
Date: 2004-07-12 19:11:59+00:00
parent bdd87cfc
...@@ -95,9 +95,12 @@ let print_loc ppf ((src,i,j),w) = ...@@ -95,9 +95,12 @@ let print_loc ppf ((src,i,j),w) =
let extr s i j = let extr s i j =
try try
Netencoding.Html.encode_from_latin1 let n = min (String.length s) j - i in
(String.sub s i (j - i)) if n <= 0 then "" else
with e -> failwith "Location.extr" Netencoding.Html.encode_from_latin1
(String.sub s i n)
with e -> failwith (Printf.sprintf "Location.extr len=%i i=%i j=%i"
(String.length s) i j )
let dump_loc ppf ((src,i,j),w) = let dump_loc ppf ((src,i,j),w) =
match (src, !viewport) with match (src, !viewport) with
...@@ -119,7 +122,6 @@ let rec end_of_line s i = ...@@ -119,7 +122,6 @@ let rec end_of_line s i =
let html_hilight ppf ((src,i,j),w) = let html_hilight ppf ((src,i,j),w) =
match (src, !viewport) with match (src, !viewport) with
| `String s, `Html -> | `String s, `Html ->
(try
if (i < 0) then if (i < 0) then
Format.fprintf ppf "<b>GHOST LOCATION</b>@\n" Format.fprintf ppf "<b>GHOST LOCATION</b>@\n"
else else
...@@ -130,7 +132,6 @@ let html_hilight ppf ((src,i,j),w) = ...@@ -130,7 +132,6 @@ let html_hilight ppf ((src,i,j),w) =
(extr s i0 i) (extr s i0 i)
(extr s i j) (extr s i j)
(extr s j j0) (extr s j j0)
with e -> failwith "html_hilight")
| _ -> () | _ -> ()
......
# Do "make install_cdml" before running this test # Do "make install_cdml" before running this test
STATIC= STATIC=
CAML=ocamlc CAML=ocamlopt
CDUCE=../../cduce CDUCE=../../cduce
CDO2ML=../../cdo2ml CDO2ML=../../cdo2ml
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment