From 9af0f015edcaa21684d40d96743957131d8103bd Mon Sep 17 00:00:00 2001 From: Pascal Rigaux Date: Wed, 1 Oct 2003 14:01:39 +0000 Subject: allow: -f $a{b}->c --- perl_checker.src/parser.mly | 3 +++ 1 file changed, 3 insertions(+) (limited to 'perl_checker.src') 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} -- cgit v1.2.1