From f350421afc41b86767bbf231f41d0e3a2095a2c9 Mon Sep 17 00:00:00 2001 From: Pascal Rigaux Date: Mon, 28 Jun 2004 08:04:11 +0000 Subject: many perl_checker enhancements and cleanup --- perl_checker.src/global_checks.ml | 2 +- perl_checker.src/parser_helper.ml | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) (limited to 'perl_checker.src') 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" -- cgit v1.2.1