summaryrefslogtreecommitdiffstats
path: root/perl_checker.src/info.ml
diff options
context:
space:
mode:
authorPascal Rigaux <pixel@mandriva.com>2004-01-09 15:22:42 +0000
committerPascal Rigaux <pixel@mandriva.com>2004-01-09 15:22:42 +0000
commit90a1e35737c0c02455d5fa85be7bd96339c9dc88 (patch)
treec42b6e522aff051481820912255572c10f205b6c /perl_checker.src/info.ml
parentb5905a0ab6ffbcfe0e61f17bed255ea0cd59efbc (diff)
downloadperl-MDK-Common-90a1e35737c0c02455d5fa85be7bd96339c9dc88.tar
perl-MDK-Common-90a1e35737c0c02455d5fa85be7bd96339c9dc88.tar.gz
perl-MDK-Common-90a1e35737c0c02455d5fa85be7bd96339c9dc88.tar.bz2
perl-MDK-Common-90a1e35737c0c02455d5fa85be7bd96339c9dc88.tar.xz
perl-MDK-Common-90a1e35737c0c02455d5fa85be7bd96339c9dc88.zip
perl_checker: entries in generated pot file are sorted by files
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