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
commit859f9d69d2f68c294c48ac52aca5577631976ee3 (patch)
tree39e78ab577e47f73cfe622b754ea32066bd4fef9 /perl_checker.src
parentd31b53ad935ef10af26d9d176d776dc0578a357c (diff)
downloadperl_checker-859f9d69d2f68c294c48ac52aca5577631976ee3.tar
perl_checker-859f9d69d2f68c294c48ac52aca5577631976ee3.tar.gz
perl_checker-859f9d69d2f68c294c48ac52aca5577631976ee3.tar.bz2
perl_checker-859f9d69d2f68c294c48ac52aca5577631976ee3.tar.xz
perl_checker-859f9d69d2f68c294c48ac52aca5577631976ee3.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