summaryrefslogtreecommitdiffstats
path: root/perl_checker.src
diff options
context:
space:
mode:
authorPascal Rigaux <pixel@mandriva.com>2003-10-01 14:01:39 +0000
committerPascal Rigaux <pixel@mandriva.com>2003-10-01 14:01:39 +0000
commit9af0f015edcaa21684d40d96743957131d8103bd (patch)
tree31564219a5ad33f3fc1f5e1a649acc1e235a56e3 /perl_checker.src
parentc24f46d15f7fdb24f09696442b6c9dad4c28329e (diff)
downloadperl_checker-9af0f015edcaa21684d40d96743957131d8103bd.tar
perl_checker-9af0f015edcaa21684d40d96743957131d8103bd.tar.gz
perl_checker-9af0f015edcaa21684d40d96743957131d8103bd.tar.bz2
perl_checker-9af0f015edcaa21684d40d96743957131d8103bd.tar.xz
perl_checker-9af0f015edcaa21684d40d96743957131d8103bd.zip
allow: -f $a{b}->c
Diffstat (limited to 'perl_checker.src')
-rw-r--r--perl_checker.src/parser.mly3
1 files changed, 3 insertions, 0 deletions
diff --git a/perl_checker.src/parser.mly b/perl_checker.src/parser.mly
index 1490611..eb6e99a 100644
--- a/perl_checker.src/parser.mly
+++ b/perl_checker.src/parser.mly
@@ -388,6 +388,9 @@ restricted_subscripted: /* Some kind of subscripted expression */
| restricted_subscripted arrayref {sp_0($2); new_esp M_scalar (to_Deref_with(I_array, I_scalar, $1.any, only_one_array_ref $2)) $1 $2} /* $foo->[$bar][$baz] */
| restricted_subscripted parenthesized {sp_0($2); new_esp M_unknown (to_Deref_with(I_func , I_scalar, $1.any, List($2.any.expr))) $1 $2} /* $foo->{bar}(@args) */
+| restricted_subscripted ARROW word_or_scalar parenthesized {sp_0($2); sp_0($3); sp_0($4); if $4.any.expr = [] then warn $4.pos "remove these unneeded parentheses"; new_esp M_unknown (to_Method_call($1.any, $3.any, $4.any.expr)) $1 $4} /* $foo->bar(list) */
+| restricted_subscripted ARROW word_or_scalar {sp_0($2); sp_0($3); new_esp M_unknown (to_Method_call($1.any, $3.any, [])) $1 $3} /* $foo->bar */
+
arrayref:
| arrayref_start ARRAYREF_END {sp_0($2); new_esp (M_ref M_array) $1.any $1 $2}
| arrayref_start expr ARRAYREF_END {sp_0($3); new_esp (M_ref M_array) ($1.any @ [$2.any.expr]) $1 $3}