From 408364e10d30895f399d96f1433503a34627457a Mon Sep 17 00:00:00 2001 From: Pascal Rigaux Date: Fri, 9 Jan 2004 15:22:42 +0000 Subject: perl_checker: entries in generated pot file are sorted by files --- perl_checker.src/info.ml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'perl_checker.src/info.ml') 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 -- cgit v1.2.1