diff options
author | Pascal Rigaux <pixel@mandriva.com> | 2003-01-06 22:03:14 +0000 |
---|---|---|
committer | Pascal Rigaux <pixel@mandriva.com> | 2003-01-06 22:03:14 +0000 |
commit | 224eb53a41d4b492e7cac76ab1a4ae566e837e2e (patch) | |
tree | d33b0a30246c821cb94f49d3953d8aafd82f3d0e /perl_checker.src | |
parent | ee06ac214211f0809b9c11f9ff94c60745d401c4 (diff) | |
download | perl-MDK-Common-224eb53a41d4b492e7cac76ab1a4ae566e837e2e.tar perl-MDK-Common-224eb53a41d4b492e7cac76ab1a4ae566e837e2e.tar.gz perl-MDK-Common-224eb53a41d4b492e7cac76ab1a4ae566e837e2e.tar.bz2 perl-MDK-Common-224eb53a41d4b492e7cac76ab1a4ae566e837e2e.tar.xz perl-MDK-Common-224eb53a41d4b492e7cac76ab1a4ae566e837e2e.zip |
find, every and any are grep-like (ie. use $_)
Diffstat (limited to 'perl_checker.src')
-rw-r--r-- | perl_checker.src/global_checks.ml | 3 |
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 |