summaryrefslogtreecommitdiffstats
path: root/perl_checker.src/parser.mly
diff options
context:
space:
mode:
authorPascal Rigaux <pixel@mandriva.com>2003-12-16 21:38:49 +0000
committerPascal Rigaux <pixel@mandriva.com>2003-12-16 21:38:49 +0000
commitaef43c0a0529b1659b42bb94c4c70a3948d71834 (patch)
treee759cbe2fe86e274b774ffb60eb6c4631e2ecad0 /perl_checker.src/parser.mly
parent96c8ec7494eb30ef87e7d3acf8193c5c8bf18cf3 (diff)
downloadperl_checker-aef43c0a0529b1659b42bb94c4c70a3948d71834.tar
perl_checker-aef43c0a0529b1659b42bb94c4c70a3948d71834.tar.gz
perl_checker-aef43c0a0529b1659b42bb94c4c70a3948d71834.tar.bz2
perl_checker-aef43c0a0529b1659b42bb94c4c70a3948d71834.tar.xz
perl_checker-aef43c0a0529b1659b42bb94c4c70a3948d71834.zip
nice error message instead of syntax error in: map { $_ } /re/ ? 1 : 2
Diffstat (limited to 'perl_checker.src/parser.mly')
-rw-r--r--perl_checker.src/parser.mly1
1 files changed, 1 insertions, 0 deletions
diff --git a/perl_checker.src/parser.mly b/perl_checker.src/parser.mly
index 71f8ac0..ebdf59d 100644
--- a/perl_checker.src/parser.mly
+++ b/perl_checker.src/parser.mly
@@ -321,6 +321,7 @@ term:
| func parenthesized {sp_0($2); call_func $1 $2} /* &foo(@args) */
| word argexpr {check_parenthesized_first_argexpr_with_Ident $1.any $2; call_no_paren $1 $2} /* foo $a, $b */
+| word BRACKET lines BRACKET_END MULT { die_with_rawpos $5.pos "I can't handle this correctly, please add parentheses" }
| word BRACKET lines BRACKET_END COMMA argexpr %prec LSTOP {sp_n($2); new_pesp M_unknown P_call_no_paren (call(Deref(I_func, $1.any), Ref(I_hash, List $3.any) :: $6.any.expr)) $1 $6} /* bless { foo }, $bar */
| word_paren parenthesized {sp_0($2); call_with_paren $1 $2} /* foo(@args) */
| word BRACKET lines BRACKET_END listexpr %prec LSTOP {sp_n($2); check_block_sub $3 $4; call_and_context(Deref(I_func, $1.any), anonymous_sub None $3 :: $5.any.expr) false (if $5.any.expr = [] then P_tok else P_call_no_paren) $1 $5} /* map { foo } @bar */