diff options
author | Pascal Rigaux <pixel@mandriva.com> | 2003-12-15 14:35:14 +0000 |
---|---|---|
committer | Pascal Rigaux <pixel@mandriva.com> | 2003-12-15 14:35:14 +0000 |
commit | 841ae5884be4af07785a35eff4afc1a031fcde43 (patch) | |
tree | 4ea29b8aa02904421bc104031677b0a7d2bb3b20 /perl_checker.src/parser_helper.ml | |
parent | 0a03f42eb1d5ec02424d78b63d9fc2bd1f8b2e74 (diff) | |
download | perl-MDK-Common-841ae5884be4af07785a35eff4afc1a031fcde43.tar perl-MDK-Common-841ae5884be4af07785a35eff4afc1a031fcde43.tar.gz perl-MDK-Common-841ae5884be4af07785a35eff4afc1a031fcde43.tar.bz2 perl-MDK-Common-841ae5884be4af07785a35eff4afc1a031fcde43.tar.xz perl-MDK-Common-841ae5884be4af07785a35eff4afc1a031fcde43.zip |
- correctly handle "shift" with no parameter at toplevel
- remove (hopefully) unused code rewriting shift -> shift(@_)
Diffstat (limited to 'perl_checker.src/parser_helper.ml')
-rw-r--r-- | perl_checker.src/parser_helper.ml | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/perl_checker.src/parser_helper.ml b/perl_checker.src/parser_helper.ml index caaf0e7..ba30b58 100644 --- a/perl_checker.src/parser_helper.ml +++ b/perl_checker.src/parser_helper.ml @@ -311,7 +311,6 @@ let word_alone esp = Call(Deref(I_func, word), [var_dollar_ pos]) | "split" -> Call(Deref(I_func, word), [ Raw_string(" ", pos) ; var_dollar_ pos ]) - | "shift" -> Call(Deref(I_func, word), [ Deref(I_array, Ident(None, "_", raw_pos2pos bpos)) ]) | "die" -> Call(Deref(I_func, word), [ Deref(I_scalar, Ident(None, "@", raw_pos2pos bpos)) ]) | "return" | "eof" | "caller" | "redo" | "next" | "last" -> @@ -855,7 +854,7 @@ let call_one_scalar_para { any = e ; pos = pos } para esp_start esp_end = match para with | [] -> if e = "shift" then - [ Deref(I_array, Ident(None, "_", raw_pos2pos pos)) ] + [] (* can't decide here *) else (if not (List.mem e [ "length" ]) then warn_rule (sprintf "please use \"%s $_\" instead of \"%s\"" e e) ; [var_dollar_ (raw_pos2pos pos)]) |