summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPascal Rigaux <pixel@mandriva.com>2003-09-30 17:26:29 +0000
committerPascal Rigaux <pixel@mandriva.com>2003-09-30 17:26:29 +0000
commit055fff834d98352eed56ccf4ee9e9bf6a5dc5a5b (patch)
treed81ee25b630962c4e8a969482b62c25e97495e54
parent82733011d709f498bb6acb0b213a6e7336d05c9b (diff)
downloadperl_checker-055fff834d98352eed56ccf4ee9e9bf6a5dc5a5b.tar
perl_checker-055fff834d98352eed56ccf4ee9e9bf6a5dc5a5b.tar.gz
perl_checker-055fff834d98352eed56ccf4ee9e9bf6a5dc5a5b.tar.bz2
perl_checker-055fff834d98352eed56ccf4ee9e9bf6a5dc5a5b.tar.xz
perl_checker-055fff834d98352eed56ccf4ee9e9bf6a5dc5a5b.zip
new warning: N_("xxx") . "yyy" is dumb since the string "xxx" will never get translated
-rw-r--r--perl_checker.src/parser_helper.ml3
1 files changed, 3 insertions, 0 deletions
diff --git a/perl_checker.src/parser_helper.ml b/perl_checker.src/parser_helper.ml
index 69627e6..29bb971 100644
--- a/perl_checker.src/parser_helper.ml
+++ b/perl_checker.src/parser_helper.ml
@@ -596,6 +596,9 @@ let cook_call_op op para pos =
warn_rule "don't do this"
else if List.exists (function Num _ -> true | _ -> false) para then
warn_rule (sprintf "you should use a number operator, not the string operator \"%s\" (or replace the number with a string)" op)
+ | "." ->
+ if List.exists (function Call(Deref(I_func, Ident(None, "N_", _)), _) -> true | _ -> false) para then
+ warn_rule "N_(\"xxx\") . \"yyy\" is dumb since the string \"xxx\" will never get translated"
| "||=" | "&&=" ->
(match List.hd para with
| List [ List _ ] -> warn_rule "remove the parentheses"