diff options
author | Pascal Rigaux <pixel@mandriva.com> | 2004-08-11 06:19:55 +0000 |
---|---|---|
committer | Pascal Rigaux <pixel@mandriva.com> | 2004-08-11 06:19:55 +0000 |
commit | 6fca507b8021dc55e3d3402ad43cd872537100e8 (patch) | |
tree | 74487de75efd5a8e9d3dbf1d2bce7c4156ca7383 /perl_checker.src/parser_helper.ml | |
parent | 578a3829921089219cbd0820ef66ca717edab598 (diff) | |
download | perl-MDK-Common-6fca507b8021dc55e3d3402ad43cd872537100e8.tar perl-MDK-Common-6fca507b8021dc55e3d3402ad43cd872537100e8.tar.gz perl-MDK-Common-6fca507b8021dc55e3d3402ad43cd872537100e8.tar.bz2 perl-MDK-Common-6fca507b8021dc55e3d3402ad43cd872537100e8.tar.xz perl-MDK-Common-6fca507b8021dc55e3d3402ad43cd872537100e8.zip |
"$a[@a] = ..." is better written "push @a, ..."
Diffstat (limited to 'perl_checker.src/parser_helper.ml')
-rw-r--r-- | perl_checker.src/parser_helper.ml | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/perl_checker.src/parser_helper.ml b/perl_checker.src/parser_helper.ml index 727f956..42e14a9 100644 --- a/perl_checker.src/parser_helper.ml +++ b/perl_checker.src/parser_helper.ml @@ -683,6 +683,10 @@ let cook_call_op op para pos = if Info.is_on_same_line_current pos then warn pos "no need to initialize variables, it's done by default" ; call + | "=", [ Deref_with(I_array, I_scalar, id, Deref(I_array, id_)); _ ] when is_same_fromparser id id_ -> + warn_rule "\"$a[@a] = ...\" is better written \"push @a, ...\"" ; + call + | "=", [ Deref(I_star, String ([(sf1, List [])], _)); _ ] -> warn_rule (sprintf "write *{'%s'} instead of *{\"%s\"}" sf1 sf1) ; call |