summaryrefslogtreecommitdiffstats
path: root/perl_checker.src
diff options
context:
space:
mode:
authorPascal Rigaux <pixel@mandriva.com>2004-10-14 04:19:22 +0000
committerPascal Rigaux <pixel@mandriva.com>2004-10-14 04:19:22 +0000
commit7f676f49eaf1552445d2dda2e6effcb4be0b10f6 (patch)
treee5389e93652c3c56f24e51e8613e148625321b10 /perl_checker.src
parent9f86fb711bac5e85a6e4135580525c11e51d061c (diff)
downloadperl-MDK-Common-7f676f49eaf1552445d2dda2e6effcb4be0b10f6.tar
perl-MDK-Common-7f676f49eaf1552445d2dda2e6effcb4be0b10f6.tar.gz
perl-MDK-Common-7f676f49eaf1552445d2dda2e6effcb4be0b10f6.tar.bz2
perl-MDK-Common-7f676f49eaf1552445d2dda2e6effcb4be0b10f6.tar.xz
perl-MDK-Common-7f676f49eaf1552445d2dda2e6effcb4be0b10f6.zip
check if_() with only one parameter
Diffstat (limited to 'perl_checker.src')
-rw-r--r--perl_checker.src/parser_helper.ml5
-rw-r--r--perl_checker.src/test/various_errors.t2
2 files changed, 7 insertions, 0 deletions
diff --git a/perl_checker.src/parser_helper.ml b/perl_checker.src/parser_helper.ml
index cd5a7f1..230daf8 100644
--- a/perl_checker.src/parser_helper.ml
+++ b/perl_checker.src/parser_helper.ml
@@ -889,6 +889,11 @@ let call_raw force_non_builtin_func (e, para) =
| [ List(String _ :: _) ] -> die_rule "don't use interpolated translated string, use %s or %d instead"
| _ -> die_rule (sprintf "%s() must be used with a string" f))
+ | "if_" ->
+ (match para with
+ | [ List [ _ ] ] -> warn_rule "not enough parameters";
+ | _ -> ())
+
| "map" ->
(match para with
diff --git a/perl_checker.src/test/various_errors.t b/perl_checker.src/test/various_errors.t
index dabb641..f9c4089 100644
--- a/perl_checker.src/test/various_errors.t
+++ b/perl_checker.src/test/various_errors.t
@@ -29,6 +29,8 @@ join(@l) first argument of join() must be a scal
join(',', 'foo') join('...', $foo) is the same as $foo
+if_($xxx) not enough parameters
+
push @l you must give some arguments to push
push $xxx, 1 push is expecting an array