Any variables created in the do part won't be created in the final
iteration, so we want them to be constrained to the do part, not seen as
part of the whole loop body.
This makes while/do match if/then better.
Signed-off-by: NeilBrown <neil@brown.name>
$*binode
// This scope is closed in CondStatement
- WhilePart -> while UseBlock OptNL do Block ${
+ WhilePart -> while UseBlock OptNL do OpenBlock ${
$0 = new(binode);
$0->op = Loop;
$0->left = $<UB;
- $0->right = $<Bl;
+ $0->right = $<OB;
+ var_block_close(c, CloseSequential);
var_block_close(c, CloseSequential);
}$
- | while OpenScope Expression ColonBlock ${
+ | while OpenScope Expression OpenScope ColonBlock ${
$0 = new(binode);
$0->op = Loop;
$0->left = $<Exp;
$0->right = $<CB;
var_block_close(c, CloseSequential);
+ var_block_close(c, CloseSequential);
}$
$cond_statement