summaryrefslogtreecommitdiffstats
path: root/perl_checker.src/global_checks.ml
diff options
context:
space:
mode:
authorPascal Rigaux <pixel@mandriva.com>2004-03-31 14:09:48 +0000
committerPascal Rigaux <pixel@mandriva.com>2004-03-31 14:09:48 +0000
commit4cdf703757880d32272b5e904103ad9079fa5b03 (patch)
tree5c52c5ecf971c814d39efe76b27324334ff5d263 /perl_checker.src/global_checks.ml
parent87ebdac347bfe0a15c969a4ebe32463dfa79f3e1 (diff)
downloadperl_checker-4cdf703757880d32272b5e904103ad9079fa5b03.tar
perl_checker-4cdf703757880d32272b5e904103ad9079fa5b03.tar.gz
perl_checker-4cdf703757880d32272b5e904103ad9079fa5b03.tar.bz2
perl_checker-4cdf703757880d32272b5e904103ad9079fa5b03.tar.xz
perl_checker-4cdf703757880d32272b5e904103ad9079fa5b03.zip
- turn some errors to warnings
- add function "-c"
Diffstat (limited to 'perl_checker.src/global_checks.ml')
-rw-r--r--perl_checker.src/global_checks.ml8
1 files changed, 4 insertions, 4 deletions
diff --git a/perl_checker.src/global_checks.ml b/perl_checker.src/global_checks.ml
index b489f6e..212cde9 100644
--- a/perl_checker.src/global_checks.ml
+++ b/perl_checker.src/global_checks.ml
@@ -59,12 +59,12 @@ let rec get_imported state current_package (package_name, (imports, pos)) =
| I_raw, tag ->
(try
List.assoc tag exports.export_tags
- with Not_found -> die_with_pos pos (sprintf "package %s doesn't export tag %s" package_name tag))
+ with Not_found -> warn_with_pos pos (sprintf "package %s doesn't export tag %s" package_name tag) ; [])
| variable ->
if List.mem variable exports.export_ok || List.mem variable exports.export_auto then
[ variable ]
else
- die_with_pos pos (sprintf "package %s doesn't export %s" package_name (variable2s variable))
+ (warn_with_pos pos (sprintf "package %s doesn't export %s" package_name (variable2s variable)) ; [])
) l
in
List.map get_var_by_name imports_vars
@@ -168,7 +168,7 @@ let is_global_var context ident =
| _ -> false)
| I_func ->
(match ident with
- | "-b" | "-d" | "-e" | "-f" | "-l" | "-r" | "-s" | "-w" | "-x"
+ | "-b" | "-c" | "-d" | "-e" | "-f" | "-l" | "-r" | "-s" | "-w" | "-x"
| "abs" | "alarm" | "atan2" | "bless"
| "caller" | "chdir" | "chmod" | "chomp" | "chop" | "chown" | "chr" | "chroot" | "close" | "closedir" | "cos" | "crypt"
| "defined" | "delete" | "die"
@@ -378,7 +378,7 @@ let check_variables vars t =
(* check e first *)
let vars = check_variables_ vars e in
List.iter (fun (context, var) ->
- if non_scalar_context context then die_with_pos pos (sprintf "%s takes all the arguments, %s is undef in any case" (variable2s (context, var)) (variable2s (last mys)))
+ if non_scalar_context context then warn_with_pos pos (sprintf "%s takes all the arguments, %s is undef in any case" (variable2s (context, var)) (variable2s (last mys)))
) (removelast mys) ; (* mys is never empty *)
Some(declare_My_our vars (my_or_our, mys, pos))