summaryrefslogtreecommitdiff
path: root/perly.c
diff options
context:
space:
mode:
authorDavid Mitchell <davem@iabyn.com>2016-12-03 16:23:55 +0000
committerDavid Mitchell <davem@iabyn.com>2016-12-05 11:54:03 +0000
commitfbe80aaa158f216c296a66de69523d1fc7de4d2c (patch)
treef9c265d08d5343ca5d2395aea402f08d29f081ec /perly.c
parent5019c3ae02ccf325d3fd2246619613ab90090c35 (diff)
downloadperl-fbe80aaa158f216c296a66de69523d1fc7de4d2c.tar.gz
yyparse: replace yynewstate label with while(1) {}
makes the code easier to understand
Diffstat (limited to 'perly.c')
-rw-r--r--perly.c11
1 files changed, 4 insertions, 7 deletions
diff --git a/perly.c b/perly.c
index 0fb131376b..ac3b06818d 100644
--- a/perly.c
+++ b/perly.c
@@ -288,11 +288,8 @@ Perl_yyparse (pTHX_ int gramtype)
ps->state = 0;
SAVEDESTRUCTOR_X(S_clear_yystack, parser);
-/*------------------------------------------------------------.
-| yynewstate -- Push a new state, which is found in yystate. |
-`------------------------------------------------------------*/
- yynewstate:
-
+ while (1) {
+ /* main loop: shift some tokens, then reduce when possible */
while (1) {
@@ -461,7 +458,7 @@ Perl_yyparse (pTHX_ int gramtype)
yystate = yydefgoto[yyn - YYNTOKENS];
ps->state = yystate;
- goto yynewstate;
+ continue;
/*------------------------------------.
@@ -565,7 +562,7 @@ Perl_yyparse (pTHX_ int gramtype)
ps->name ="<err>";
#endif
- goto yynewstate;
+ } /* main loop */
/*-------------------------------------.