summaryrefslogtreecommitdiff
path: root/perly.y
diff options
context:
space:
mode:
Diffstat (limited to 'perly.y')
-rw-r--r--perly.y24
1 files changed, 12 insertions, 12 deletions
diff --git a/perly.y b/perly.y
index be6fe98f20..6313061934 100644
--- a/perly.y
+++ b/perly.y
@@ -187,13 +187,13 @@ loop : label WHILE '(' remember mtexpr ')' mblock cont
$$ = block_end($4,
newSTATEOP(0, $1,
newWHILEOP(0, 1, (LOOP*)Nullop,
- $5, $7, $8))); }
+ $2, $5, $7, $8))); }
| label UNTIL '(' remember miexpr ')' mblock cont
{ copline = $2;
$$ = block_end($4,
newSTATEOP(0, $1,
newWHILEOP(0, 1, (LOOP*)Nullop,
- $5, $7, $8))); }
+ $2, $5, $7, $8))); }
| label FOR MY remember my_scalar '(' mexpr ')' mblock cont
{ $$ = block_end($4,
newFOROP(0, $1, $2, $5, $7, $9, $10)); }
@@ -206,17 +206,17 @@ loop : label WHILE '(' remember mtexpr ')' mblock cont
newFOROP(0, $1, $2, Nullop, $5, $7, $8)); }
| label FOR '(' remember mnexpr ';' mtexpr ';' mnexpr ')' mblock
/* basically fake up an initialize-while lineseq */
- { copline = $2;
- $$ = block_end($4,
- newSTATEOP(0, $1,
- append_elem(OP_LINESEQ, scalar($5),
- newWHILEOP(0, 1, (LOOP*)Nullop,
- scalar($7),
- $11, scalar($9))))); }
+ { OP *forop = append_elem(OP_LINESEQ,
+ scalar($5),
+ newWHILEOP(0, 1, (LOOP*)Nullop,
+ $2, scalar($7),
+ $11, scalar($9)));
+ copline = $2;
+ $$ = block_end($4, newSTATEOP(0, $1, forop)); }
| label block cont /* a block is a loop that happens once */
- { $$ = newSTATEOP(0,
- $1, newWHILEOP(0, 1, (LOOP*)Nullop,
- Nullop, $2, $3)); }
+ { $$ = newSTATEOP(0, $1,
+ newWHILEOP(0, 1, (LOOP*)Nullop,
+ NOLINE, Nullop, $2, $3)); }
;
nexpr : /* NULL */