This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
yyparse: only calculate yytoken on yychar change
authorDavid Mitchell <davem@iabyn.com>
Sun, 4 Dec 2016 08:10:27 +0000 (08:10 +0000)
committerDavid Mitchell <davem@iabyn.com>
Mon, 5 Dec 2016 11:54:03 +0000 (11:54 +0000)
commit0f8490d1d7ad76cac844fc2ae882994e38aaf2ef
tree25fea4e29ac14105e7b8cc46b37d7c90142c05a3
parentb2c9b6ee5d402c923568f214f2e2606287c912d3
yyparse: only calculate yytoken on yychar change

yytoken is a translated (via lookup table) version of parser->yychar.
So we only need to recalculate it when yychar changes (usually by
assigning the result of yylex() to it). This means when multiple
reductions are done without shifting another token, we skip the extra
overhead each time.
perly.act
perly.c
perly.h
perly.tab
perly.y