This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Set PL_expect only once after curly subscripts
authorFather Chrysostomos <sprout@cpan.org>
Fri, 22 Aug 2014 13:13:17 +0000 (06:13 -0700)
committerFather Chrysostomos <sprout@cpan.org>
Mon, 25 Aug 2014 02:02:58 +0000 (19:02 -0700)
commit5c86b6dfc4a5c74dad9f83a08d08b4536632cda1
tree3649921a238463e4cf488051f1501c39570dfb72
parent8f0d8652cd7599dde9c54931b556782c1275ff88
Set PL_expect only once after curly subscripts

When curly subscripts are parsed, the lexer (toke.c:yylex) notes that
the value of PL_expect needs to be set to XSTATE (expecting a state-
ment) after the final brace.  When the final brace is encountered,
PL_expect is set to that recorded value.  But then the parser
(perly.y) sets it to XOPERATOR immediately thereafter.

This approach requires a plethora of identical statements in perly.y.
If we just set PL_expect to the right value to begin with, we can
avoid all those assignments.
perly.act
perly.h
perly.tab
perly.y
toke.c