diff options
author | David Mitchell <davem@iabyn.com> | 2016-12-03 16:23:55 +0000 |
---|---|---|
committer | David Mitchell <davem@iabyn.com> | 2016-12-05 11:54:03 +0000 |
commit | fbe80aaa158f216c296a66de69523d1fc7de4d2c (patch) | |
tree | f9c265d08d5343ca5d2395aea402f08d29f081ec /perly.c | |
parent | 5019c3ae02ccf325d3fd2246619613ab90090c35 (diff) | |
download | perl-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.c | 11 |
1 files changed, 4 insertions, 7 deletions
@@ -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 */ /*-------------------------------------. |