summaryrefslogtreecommitdiffstats
path: root/perl_checker.src/parser_helper.ml
diff options
context:
space:
mode:
authorPascal Rigaux <pixel@mandriva.com>2003-12-15 15:41:06 +0000
committerPascal Rigaux <pixel@mandriva.com>2003-12-15 15:41:06 +0000
commitbb7e26564d9fd0f290e8d160e8e59b1c49b07546 (patch)
tree4c697844d67a782090df769c5f4962ff4dd67cff /perl_checker.src/parser_helper.ml
parentd585bff07cf831f557cb5bca530fe9a539ad72b5 (diff)
downloadperl_checker-bb7e26564d9fd0f290e8d160e8e59b1c49b07546.tar
perl_checker-bb7e26564d9fd0f290e8d160e8e59b1c49b07546.tar.gz
perl_checker-bb7e26564d9fd0f290e8d160e8e59b1c49b07546.tar.bz2
perl_checker-bb7e26564d9fd0f290e8d160e8e59b1c49b07546.tar.xz
perl_checker-bb7e26564d9fd0f290e8d160e8e59b1c49b07546.zip
- specify the return context for N() and N_()
- more precise position for warning "value is dropped"
Diffstat (limited to 'perl_checker.src/parser_helper.ml')
-rw-r--r--perl_checker.src/parser_helper.ml3
1 files changed, 2 insertions, 1 deletions
diff --git a/perl_checker.src/parser_helper.ml b/perl_checker.src/parser_helper.ml
index 48bb7f7..5a55e03 100644
--- a/perl_checker.src/parser_helper.ml
+++ b/perl_checker.src/parser_helper.ml
@@ -839,6 +839,7 @@ let call_and_context(e, para) force_non_builtin_func priority esp_start esp_end
| "any" | "every" -> M_scalar
| "find_index" -> M_int
| "each_index" -> M_none
+ | "N" | "N_" -> M_string
| _ -> M_unknown)
| _ -> M_unknown
in
@@ -1086,7 +1087,7 @@ let mcontext_check_none esp =
| [List [Num("1", _)]; Semi_colon] -> () (* allow "1;" for package return value. It would be much better to check we are at toplevel, but hell i don't want to wire this information up to here *)
| [List [Call_op ("<>", [Ident (None, "STDIN", _)], _)]; Semi_colon] -> () (* allow <STDIN> to ask "press return" *)
| [List [Call(Deref(I_func, Ident(None, "map", _)), _)]; Semi_colon] -> warn_rule "if you don't use the return value, use \"foreach\" instead of \"map\""
- | _ -> warn_rule "value is dropped"
+ | _ -> warn esp.pos "value is dropped"
let mcontext_op_assign left right =
mcontext_check_non_none right;