summaryrefslogtreecommitdiffstats
path: root/perl_checker.src
diff options
context:
space:
mode:
authorPascal Rigaux <pixel@mandriva.com>2004-06-28 08:04:11 +0000
committerPascal Rigaux <pixel@mandriva.com>2004-06-28 08:04:11 +0000
commitf350421afc41b86767bbf231f41d0e3a2095a2c9 (patch)
treec984e4b027a386c9716a6700843de9adf63b5e9b /perl_checker.src
parenteb7b9f404f2405a1cb152fac39101200ec3b9d98 (diff)
downloadperl-MDK-Common-f350421afc41b86767bbf231f41d0e3a2095a2c9.tar
perl-MDK-Common-f350421afc41b86767bbf231f41d0e3a2095a2c9.tar.gz
perl-MDK-Common-f350421afc41b86767bbf231f41d0e3a2095a2c9.tar.bz2
perl-MDK-Common-f350421afc41b86767bbf231f41d0e3a2095a2c9.tar.xz
perl-MDK-Common-f350421afc41b86767bbf231f41d0e3a2095a2c9.zip
many perl_checker enhancements and cleanup
Diffstat (limited to 'perl_checker.src')
-rw-r--r--perl_checker.src/global_checks.ml2
-rw-r--r--perl_checker.src/parser_helper.ml4
2 files changed, 3 insertions, 3 deletions
diff --git a/perl_checker.src/global_checks.ml b/perl_checker.src/global_checks.ml
index 212cde9..def8a79 100644
--- a/perl_checker.src/global_checks.ml
+++ b/perl_checker.src/global_checks.ml
@@ -268,7 +268,7 @@ let check_variables vars t =
Some vars
| 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" ] ->
+ when List.mem func [ "grep" ; "map" ; "substInFile" ; "map_index" ; "each_index" ; "partition" ; "find_index" ; "grep_index" ; "find" ; "any" ; "every" ; "uniq_" ] ->
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 Access_various, None)] :: vars.our_vars } in
let vars' = List.fold_left check_variables_ vars' f in
diff --git a/perl_checker.src/parser_helper.ml b/perl_checker.src/parser_helper.ml
index 1f30eb5..8a81bda 100644
--- a/perl_checker.src/parser_helper.ml
+++ b/perl_checker.src/parser_helper.ml
@@ -337,7 +337,7 @@ let sp_same esp1 esp2 =
else if esp2.spaces <> Space_0 then sp_p esp1
let function_to_context word_alone = function
- | "map" | "grep" | "grep_index" | "map_index" -> M_array
+ | "map" | "grep" | "grep_index" | "map_index" | "uniq" | "uniq_" -> M_array
| "partition" -> M_tuple [ M_ref M_array ; M_ref M_array ]
| "find" -> M_unknown_scalar
| "any" | "every" -> M_bool
@@ -836,7 +836,7 @@ 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))
- | "map" | "grep" | "grep_index" | "map_index" | "partition"
+ | "map" | "grep" | "grep_index" | "map_index" | "partition" | "uniq_"
| "find"
| "any" | "every"
| "find_index"