summaryrefslogtreecommitdiffstats
path: root/perl_checker.src
diff options
context:
space:
mode:
authorPascal Rigaux <pixel@mandriva.com>2003-04-01 13:10:21 +0000
committerPascal Rigaux <pixel@mandriva.com>2003-04-01 13:10:21 +0000
commit0b8a321a640a6a20578d5dbdd70aab53b5ee70c8 (patch)
treeacfa7390c02cdf7231a414d12b009a9b8f3f4cad /perl_checker.src
parentfb5a88808e8c1fb236448377a55655c0421955e8 (diff)
downloadperl-MDK-Common-0b8a321a640a6a20578d5dbdd70aab53b5ee70c8.tar
perl-MDK-Common-0b8a321a640a6a20578d5dbdd70aab53b5ee70c8.tar.gz
perl-MDK-Common-0b8a321a640a6a20578d5dbdd70aab53b5ee70c8.tar.bz2
perl-MDK-Common-0b8a321a640a6a20578d5dbdd70aab53b5ee70c8.tar.xz
perl-MDK-Common-0b8a321a640a6a20578d5dbdd70aab53b5ee70c8.zip
when a #-PO comment on a same translated string is present twice, it should put the -PO comment in any case
(more precisely, it concatenates all the -PO comments)
Diffstat (limited to 'perl_checker.src')
-rw-r--r--perl_checker.src/parser_helper.ml8
-rw-r--r--perl_checker.src/parser_helper.mli2
2 files changed, 4 insertions, 6 deletions
diff --git a/perl_checker.src/parser_helper.ml b/perl_checker.src/parser_helper.ml
index 18713f2..832ad76 100644
--- a/perl_checker.src/parser_helper.ml
+++ b/perl_checker.src/parser_helper.ml
@@ -525,7 +525,7 @@ let followed_by_comma ((_,e), _) (true_comma, _) =
| _ -> e
-let pot_strings = ref []
+let pot_strings = Hashtbl.create 16
let pot_strings_and_file = Hashtbl.create 16
let po_comments = ref []
let po_comment (s, _) = lpush po_comments s
@@ -571,7 +571,7 @@ msgstr \"\"
| '\n' -> output_string fd "\\n\"\n\""
| c -> output_char fd c
in
- List.iter (fun (s, po_comments) ->
+ Hashtbl.iter (fun s po_comments ->
match Hashtbl.find_all pot_strings_and_file s with
| [] -> ()
| l ->
@@ -585,7 +585,7 @@ msgstr \"\"
String.iter print_formatted_char s ;
output_string fd "\"\n" ;
output_string fd "msgstr \"\"\n\n"
- ) !pot_strings ;
+ ) pot_strings ;
close_out fd
let call_func is_a_func (e, para) =
@@ -606,7 +606,7 @@ let call_func is_a_func (e, para) =
(match para with
| [ List(String([ s, List [] ], (file, pos_a, _)) :: _) ] ->
if !Flags.generate_pot then (
- lpush pot_strings (s, !po_comments) ;
+ Hashtbl.replace pot_strings s ((try Hashtbl.find pot_strings s with Not_found -> []) @ !po_comments) ;
po_comments := [] ;
Hashtbl.add pot_strings_and_file s file ;
) ;
diff --git a/perl_checker.src/parser_helper.mli b/perl_checker.src/parser_helper.mli
index a483a2e..cbb04e6 100644
--- a/perl_checker.src/parser_helper.mli
+++ b/perl_checker.src/parser_helper.mli
@@ -134,8 +134,6 @@ val to_Call_op_ :
'b * (int * int) -> ('a * Types.fromparser) * ('b * (int * int))
val followed_by_comma :
('a * Types.fromparser list) * 'b -> bool * 'c -> Types.fromparser list
-val pot_strings : (string * string list) list ref
-val pot_strings_and_file : (string, string) Hashtbl.t
val po_comments : string list ref
val po_comment : string * 'a -> unit
val check_format_a_la_printf : string -> int -> unit