develooper Front page | perl.perl5.porters | Postings from March 2001

Re: editing perly.y

Thread Previous
From:
Jeff Pinyan
Date:
March 6, 2001 08:46
Subject:
Re: editing perly.y
Message ID:
Pine.GSO.4.21.0103061144570.1035-100000@crusoe.crusoe.net
On Mar 6, Ronald J Kimball said:

>On Tue, Mar 06, 2001 at 11:24:25AM -0500, Jeff Pinyan wrote:
>> When is this read from?  I assume miniperl is built from it, but I tried
>> fixing the
>> 
>>   do &foo;
>> 
>> bug (to make it call the function, not evaluate the expression), and I
>> modified perly.y like so:
>
>Since this feature is already deprecated, instead of restoring it to the
>language, why not just update the docs to reflect that it has been removed?
>
>BTW, MacPerl, built from 5.004, also exhibits this behavior.  When was the
>most recent version where do &foo was actually parsed as do SUB rather than
>do EXPR?

What I'm trying to work up to is getting

  do q(foo.pl);

to work like

  do 'foo.pl';

because right now, it works like

  &q(foopl);

which is due to the following grammar:

        |       DO WORD '(' ')'  
                        { $$ = newUNOP(OP_ENTERSUB,
                            OPf_SPECIAL|OPf_STACKED,
                            prepend_elem(OP_LIST,
                                scalar(newCVREF(
                                    (OPpENTERSUB_AMPER<<8),
                                    scalar($2)
                                )),Nullop)); dep();}
        |       DO WORD '(' expr ')'
                        { $$ = newUNOP(OP_ENTERSUB,
                            OPf_SPECIAL|OPf_STACKED,
                            append_elem(OP_LIST, 
                                $4,
                                scalar(newCVREF(   
                                    (OPpENTERSUB_AMPER<<8),
                                    scalar($2)   
                                )))); dep();}   

-- 
Jeff "japhy" Pinyan      japhy@pobox.com      http://www.pobox.com/~japhy/
Are you a Monk?  http://www.perlmonks.com/     http://forums.perlguru.com/
Perl Programmer at RiskMetrics Group, Inc.     http://www.riskmetrics.com/


Thread Previous


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About