diff options
author | Pascal Rigaux <pixel@mandriva.com> | 2003-04-01 14:44:57 +0000 |
---|---|---|
committer | Pascal Rigaux <pixel@mandriva.com> | 2003-04-01 14:44:57 +0000 |
commit | 9fe47f1dbcc891396a55c5fdc6f614f185a8ac03 (patch) | |
tree | 3483a4c378cdaf5373885422421f677b2cac6872 /perl_checker.src | |
parent | de6d11dc8308b6997ba86c1494613e3242a9a6a6 (diff) | |
download | perl-MDK-Common-9fe47f1dbcc891396a55c5fdc6f614f185a8ac03.tar perl-MDK-Common-9fe47f1dbcc891396a55c5fdc6f614f185a8ac03.tar.gz perl-MDK-Common-9fe47f1dbcc891396a55c5fdc6f614f185a8ac03.tar.bz2 perl-MDK-Common-9fe47f1dbcc891396a55c5fdc6f614f185a8ac03.tar.xz perl-MDK-Common-9fe47f1dbcc891396a55c5fdc6f614f185a8ac03.zip |
warn "map(&f, ...)", use "map { f } ..." instead
Diffstat (limited to 'perl_checker.src')
-rw-r--r-- | perl_checker.src/parser_helper.ml | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/perl_checker.src/parser_helper.ml b/perl_checker.src/parser_helper.ml index f16ca14..7665eee 100644 --- a/perl_checker.src/parser_helper.ml +++ b/perl_checker.src/parser_helper.ml @@ -664,6 +664,12 @@ let call_func is_a_func (e, para) = | Call_op("m//", Deref(I_scalar, Ident(None, "_", _)) :: pattern, pos) :: l -> Some(Call_op("qr//", pattern, pos) :: l) | _ -> None) + + | "map" -> + (match para with + | Anonymous_sub _ :: _ -> () + | _ -> warn_rule "always use \"map\" with a block (eg: map { ... } @list)"); + None | _ -> None in Call(e, some_or para' para) |