From 4e5d62458a90c5f42aa03dbf4e70b19d73506f5e Mon Sep 17 00:00:00 2001 From: Pascal Rigaux Date: Tue, 15 Apr 2003 21:20:00 +0000 Subject: forbid "unless (...) { ... } else { ... }" and "unless (...) { ... } elsif (...) { ... } --- perl_checker.src/parser.mly | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'perl_checker.src/parser.mly') diff --git a/perl_checker.src/parser.mly b/perl_checker.src/parser.mly index f578f4d..0b27e80 100644 --- a/perl_checker.src/parser.mly +++ b/perl_checker.src/parser.mly @@ -117,7 +117,7 @@ line: if_then_else: /* Real conditional expressions */ | IF PAREN expr PAREN_END BRACKET lines BRACKET_END elsif else_ {sp_p($1); sp_n($2); sp_0($3); sp_0_or_cr($4); sp_p($5); mcontext_check M_scalar $3; check_block_sub $6 $7; to_Call_op (if $9.any = [] then M_none else mcontext_lmerge ($6.mcontext :: mcontext_lmaybe $8 @ [$9.mcontext])) "if" (prio_lo P_loose $3 :: Block $6.any :: $8.any @ $9.any) $1 $9} -| UNLESS PAREN expr PAREN_END BRACKET lines BRACKET_END elsif else_ {sp_p($1); sp_n($2); sp_0($3); sp_0_or_cr($4); sp_p($5); mcontext_check M_scalar $3; check_block_sub $6 $7; to_Call_op M_none "unless" (prio_lo P_loose $3 :: Block $6.any :: $8.any @ $9.any) $1 $9} +| UNLESS PAREN expr PAREN_END BRACKET lines BRACKET_END elsif else_ {sp_p($1); sp_n($2); sp_0($3); sp_0_or_cr($4); sp_p($5); mcontext_check M_scalar $3; check_block_sub $6 $7; check_unless_else $8 $9; to_Call_op M_none "unless" (prio_lo P_loose $3 :: Block $6.any :: $8.any @ $9.any) $1 $9} elsif: | {default_esp []} -- cgit v1.2.1