summaryrefslogtreecommitdiffstats
path: root/perl_checker.src/global_checks.ml
diff options
context:
space:
mode:
authorPascal Rigaux <pixel@mandriva.com>2003-01-06 22:03:14 +0000
committerPascal Rigaux <pixel@mandriva.com>2003-01-06 22:03:14 +0000
commit1e46b0d6aa90f97e0056a6387aa9f2e3a8174c7f (patch)
treee99344fa4f55cb1effafbcf5a21e719a76b5e371 /perl_checker.src/global_checks.ml
parentaf2f0561ba0ec7755e0fbd47e8380aab78238219 (diff)
downloadperl_checker-1e46b0d6aa90f97e0056a6387aa9f2e3a8174c7f.tar
perl_checker-1e46b0d6aa90f97e0056a6387aa9f2e3a8174c7f.tar.gz
perl_checker-1e46b0d6aa90f97e0056a6387aa9f2e3a8174c7f.tar.bz2
perl_checker-1e46b0d6aa90f97e0056a6387aa9f2e3a8174c7f.tar.xz
perl_checker-1e46b0d6aa90f97e0056a6387aa9f2e3a8174c7f.zip
find, every and any are grep-like (ie. use $_)
Diffstat (limited to 'perl_checker.src/global_checks.ml')
-rw-r--r--perl_checker.src/global_checks.ml3
1 files changed, 2 insertions, 1 deletions
diff --git a/perl_checker.src/global_checks.ml b/perl_checker.src/global_checks.ml
index 40042c1..9f47b6a 100644
--- a/perl_checker.src/global_checks.ml
+++ b/perl_checker.src/global_checks.ml
@@ -219,7 +219,8 @@ let check_variables vars t =
check_unused_local_variables vars' ;
Some vars
- | Call(Deref(I_func, Ident(None, func, func_pos)), Anonymous_sub(Block f, pos) :: l) when func = "grep" || func = "map" || func = "substInFile" || func = "map_index" || func = "each_index" || func = "partition" || func = "find_index" || func = "grep_index" ->
+ | Call(Deref(I_func, Ident(None, func, func_pos)), Anonymous_sub(Block f, pos) :: l)
+ when List.mem func [ "grep" ; "map" ; "substInFile" ; "map_index" ; "each_index" ; "partition" ; "find_index" ; "grep_index" ; "find" ; "any" ; "every" ] ->
let vars = List.fold_left check_variables_ vars l in
let vars' = { vars with my_vars = [] :: vars.my_vars ; our_vars = [(I_scalar, "_"), (pos, ref true)] :: vars.our_vars } in
let vars' = List.fold_left check_variables_ vars' f in