summaryrefslogtreecommitdiff
path: root/perly.y
diff options
context:
space:
mode:
Diffstat (limited to 'perly.y')
-rw-r--r--perly.y4
1 files changed, 4 insertions, 0 deletions
diff --git a/perly.y b/perly.y
index 60eca783e1..55321fa41e 100644
--- a/perly.y
+++ b/perly.y
@@ -433,6 +433,10 @@ barestmt: PLUGSTMT
}
| FOR MY remember PERLY_PAREN_OPEN my_list_of_scalars PERLY_PAREN_CLOSE PERLY_PAREN_OPEN mexpr PERLY_PAREN_CLOSE mblock cont
{
+ if ($my_list_of_scalars->op_type == OP_PADSV)
+ /* degenerate case of 1 var: for my ($x) ....
+ Flag it so it can be special-cased in newFOROP */
+ $my_list_of_scalars->op_flags |= OPf_PARENS;
$$ = block_end($remember, newFOROP(0, $my_list_of_scalars, $mexpr, $mblock, $cont));
parser->copline = (line_t)$FOR;
}