summaryrefslogtreecommitdiffstats
path: root/perl_checker.src/info.ml
diff options
context:
space:
mode:
Diffstat (limited to 'perl_checker.src/info.ml')
-rw-r--r--perl_checker.src/info.ml6
1 files changed, 5 insertions, 1 deletions
diff --git a/perl_checker.src/info.ml b/perl_checker.src/info.ml
index ca14f9e..d5a1ce8 100644
--- a/perl_checker.src/info.ml
+++ b/perl_checker.src/info.ml
@@ -59,10 +59,14 @@ let pos2s (file, a, b) = sprintf "(%s, %d, %d)" file a b
let pos2sfull pos =
try
- let (file, line, n1,n2) = pos2line pos in
+ let file, line, n1, n2 = pos2line pos in
sprintf "File \"%s\", line %d, character %d-%d\n" (absolute_file_to_file file) (line + 1) n1 n2
with Not_found -> failwith ("bad position " ^ pos2s pos)
+let pos2s_for_po pos =
+ let file, line, _, _ = pos2line pos in
+ absolute_file_to_file file ^ ":" ^ string_of_int (line + 1)
+
let is_on_same_line file (a,b) =
let line_a, _ = raw_pos2raw_line file a in
let line_b, _ = raw_pos2raw_line file b in