diff options
author | Father Chrysostomos <sprout@cpan.org> | 2016-05-21 05:42:55 -0700 |
---|---|---|
committer | Father Chrysostomos <sprout@cpan.org> | 2016-05-21 06:07:28 -0700 |
commit | 28383d1aefa4f4c119153a5ed41ebf82ecd7a062 (patch) | |
tree | d6a9b5bd9328d65beb552bf87b2886e4c3fe24d2 /perly.tab | |
parent | 76734a3218e712760695898e424c2369ccdd49c6 (diff) | |
download | perl-28383d1aefa4f4c119153a5ed41ebf82ecd7a062.tar.gz |
Simplify parser’s handling of my/local
In Perl 5.000, the same token, LOCAL, was used for both ‘my’ and
‘local’, with a token value, passed to localize() as a second argu-
ment, to distinguish between them.
perl-5.003_07-9-g55497cf (inseparable changes from patch from
perl5.003_07 to perl5.003_08), for no apparent reason, split them into
two tokens, removing the token values and assigning values in perly.y
via $$ = 0 and $$ = 1. They still ultimately made their way through
the same grammar rule, as there was only one localize() call in
perly.y. The code still made sense.
perl-5.005_02-1816-g09bef84 (sub : attrlist) changed things, such that
the tokens are separate *and* they get separate token values assigned
to them. ‘local’ and ‘my’ no longer follow the same grammar rules
in perly.y, so there are separate localize() calls for the different
token types. Hence, the use of a token value to distinguish them does
not make sense. It just makes this more complicated that necessary.
So this commit removes the token values. Since the two token types
follow different paths through perly.y and have separate localize()
calls, we can hard-code the argument to localize() there, instead of
passing the value through from toke.c as a token value.
This does shrink toke.o slightly (for me it went from 876040 to
876000), and it makes this conceptually clearer.
Diffstat (limited to 'perly.tab')
-rw-r--r-- | perly.tab | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -1171,6 +1171,6 @@ static const toketypes yy_type_tab[] = }; /* Generated from: - * 703ebd267cf8ca45f9dee9bc0f4b21511117a0c1dca1c8bc9438ce91950217ae perly.y + * 70adb6e1be5382fb5c8cd783cd886cb4725c98a3e69c54eb16da5d7829d929aa perly.y * 3e1dff60f26df8933d7aed0c0e87177a0f022c14800c0707eb62a7db4196ac98 regen_perly.pl * ex: set ro: */ |