In perl.git, the branch sprout/lexsub has been created
<http://perl5.git.perl.org/perl.git/commitdiff/0ddde5aa87d5851f2cf4f2cccc4f45e5b0ea318f?hp=0000000000000000000000000000000000000000>
at 0ddde5aa87d5851f2cf4f2cccc4f45e5b0ea318f (commit)
- Log -----------------------------------------------------------------
commit 0ddde5aa87d5851f2cf4f2cccc4f45e5b0ea318f
Author: Father Chrysostomos <[email protected]>
Date: Sun Jul 1 22:53:41 2012 -0700
Make &foo respect our sub
This changes &foo to go through S_pending_ident (by setting
PL_pending_ident, which causes yylex to defer to S_pending_ident for
the next token) the way $foo and %foo do.
This necessitated reducing the maximum identifier length of &foo from
252 to 251, making it match @foo, $foo, etc. So somebodyâs JAPH might
break. :-)
M MANIFEST
A t/cmd/lexsub.t
M t/comp/parser.t
M toke.c
commit da637f915cfdc703b16c8969d486a3e165b2bb50
Author: Father Chrysostomos <[email protected]>
Date: Sun Jul 1 20:23:06 2012 -0700
pad.c apidocs: Missing fullstop
M pad.c
commit 525065be89265abbe1ecdd83ef17c6317b2eccae
Author: Father Chrysostomos <[email protected]>
Date: Sat Jun 30 23:20:25 2012 -0700
Allocate âour subâ in the pad
Currently the name is only allocated there. Nothing fetches it yet.
Notes on the implementation:
S_pending_ident contains the logic for determining whether $foo or
@foo refers to a lexical or package variable.
yylex defers to S_pending_ident if PL_pending_ident is set.
The KEY_sub case in yylex is changed to set PL_pending_ident instead
of using force_word. For package variables (including our),
S_pending_ident returns a WORD token, which is the same thing that
force_word produces. So *that* aspect of this change does not affect
the grammar. However....
The barestmt ruleâs SUB branch begins with âSUB startsub subnameâ.
startsub is a null rule that creates a new sub in PL_compcv via
start_subparse(). subname is defined in terms of WORD and also checks
whether this is a special block, turning on CvSPECIAL(PL_compcv) if
it is. That flag has to be visible during compilation of the sub.
But for a lexical name, such as âour fooâ, to be allocated in the
right pad, it has to come *before* startsub, i.e., âSUB subname
startsubâ.
But subname needs to modify the sub that startsub created, set-
ting the flag.
So I copied (not moved, because MYSUB still uses it) the name-checking
code from the subname rule into the SUB branch of barestmt. Now that
uses WORD directly instead of invoking subname. That allows the code
there to set everything up in the right order.
M perly.act
M perly.h
M perly.tab
M perly.y
M toke.c
commit db8f4bc9a2238d26cd98e9eca577dca07027a518
Author: Father Chrysostomos <[email protected]>
Date: Sat Jun 30 23:00:57 2012 -0700
Increase $Opcode::VERSION to 1.24
M ext/Opcode/Opcode.pm
commit b2251ff42455442154bf18c794e8769c90e39747
Author: Father Chrysostomos <[email protected]>
Date: Sat Jun 30 23:00:11 2012 -0700
Add padcv to Opcode.pm
M ext/Opcode/Opcode.pm
commit b9983e99c0c7965b5015f7d55007e02d085af642
Author: Father Chrysostomos <[email protected]>
Date: Sat Jun 30 22:29:28 2012 -0700
padcv op type
M opcode.h
M opnames.h
M pp.c
M pp_proto.h
M regen/opcodes
commit 3430efdc8f4d0fcd7dc0522bc92542e681a25cd3
Author: Father Chrysostomos <[email protected]>
Date: Sat Jun 30 17:31:32 2012 -0700
Donât allow name after our/state sub
It was a mistake that this was ever allowed.
M MANIFEST
M pod/perldiag.pod
M t/lib/croak/toke
M toke.c
commit 6b98d8831789b7db5cd3173dcfc4ff83cf33a913
Author: Father Chrysostomos <[email protected]>
Date: Sat Jun 30 17:17:39 2012 -0700
Test âMissing name in "my sub"â
M MANIFEST
A t/lib/croak/toke
-----------------------------------------------------------------------
--
Perl5 Master Repository