summaryrefslogtreecommitdiff
path: root/pp_ctl.c
diff options
context:
space:
mode:
authorZefram <zefram@fysh.org>2010-10-19 21:16:11 +0100
committerFather Chrysostomos <sprout@cpan.org>2010-10-25 12:29:46 -0700
commiteae48c8938e50ebb341a72c2886c5ae8587092a5 (patch)
treea581082ad6e284de2600033f738b631b475e702e /pp_ctl.c
parentff0c75af8a61dcd9e5fa0e07c8c01e142cadd899 (diff)
downloadperl-eae48c8938e50ebb341a72c2886c5ae8587092a5.tar.gz
refactor and regularise label/statement grammar
Refactoring of the grammar around statements. New production <barestmt> encompasses a statement without label. It includes all statement types, including declarations, with no unnecessary intermediate non-terminals. It generates an op tree for the statement's content, with no leading state op. The <fullstmt> production has just one rule, consisting of optional label followed by <barestmt>. It puts a state op on the front of the statement's content ops. To support the regular statement op structure, the op sequence for for(;;) loops no longer has a second state op between the initialisation and the loop. Instead, the unstack op type is slightly adapted to achieve the stack clearing without a state op. The newFOROP() constructor function no longer generates a state op, that now being the job of the <fullstmt> production. Consequently it no longer takes a parameter stating what label is to go in the state op. This brings it in line with the other op constructors.
Diffstat (limited to 'pp_ctl.c')
-rw-r--r--pp_ctl.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/pp_ctl.c b/pp_ctl.c
index 9eebf43c65..b3c7ba21ce 100644
--- a/pp_ctl.c
+++ b/pp_ctl.c
@@ -2783,6 +2783,14 @@ PP(pp_goto)
enterops, enterops + GOTO_DEPTH);
if (retop)
break;
+ if (gotoprobe->op_sibling &&
+ gotoprobe->op_sibling->op_type == OP_UNSTACK &&
+ gotoprobe->op_sibling->op_sibling) {
+ retop = dofindlabel(gotoprobe->op_sibling->op_sibling,
+ label, enterops, enterops + GOTO_DEPTH);
+ if (retop)
+ break;
+ }
}
PL_lastgotoprobe = gotoprobe;
}