diff options
author | Pascal Rigaux <pixel@mandriva.com> | 2004-01-09 15:22:42 +0000 |
---|---|---|
committer | Pascal Rigaux <pixel@mandriva.com> | 2004-01-09 15:22:42 +0000 |
commit | 408364e10d30895f399d96f1433503a34627457a (patch) | |
tree | fe97b86802f6ab54be3942bba0a924ba258bf51f /perl_checker.src/info.ml | |
parent | f4b7e74a62170912df757f36242ba8dfd3051ecc (diff) | |
download | perl_checker-408364e10d30895f399d96f1433503a34627457a.tar perl_checker-408364e10d30895f399d96f1433503a34627457a.tar.gz perl_checker-408364e10d30895f399d96f1433503a34627457a.tar.bz2 perl_checker-408364e10d30895f399d96f1433503a34627457a.tar.xz perl_checker-408364e10d30895f399d96f1433503a34627457a.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.ml | 6 |
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 |