diff options
author | Pascal Rigaux <pixel@mandriva.com> | 2003-12-15 15:41:06 +0000 |
---|---|---|
committer | Pascal Rigaux <pixel@mandriva.com> | 2003-12-15 15:41:06 +0000 |
commit | e96afd56ba76fac71537c38904ff45c016952de6 (patch) | |
tree | c7b3a686eb840abac799ba855669408cd5fefc3a /perl_checker.src | |
parent | 24c874f7b48c23f91da8fe2419c02d9ddc2c1c82 (diff) | |
download | perl-MDK-Common-e96afd56ba76fac71537c38904ff45c016952de6.tar perl-MDK-Common-e96afd56ba76fac71537c38904ff45c016952de6.tar.gz perl-MDK-Common-e96afd56ba76fac71537c38904ff45c016952de6.tar.bz2 perl-MDK-Common-e96afd56ba76fac71537c38904ff45c016952de6.tar.xz perl-MDK-Common-e96afd56ba76fac71537c38904ff45c016952de6.zip |
- specify the return context for N() and N_()
- more precise position for warning "value is dropped"
Diffstat (limited to 'perl_checker.src')
-rw-r--r-- | perl_checker.src/parser_helper.ml | 3 |
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; |