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

editing perly.y

Thread Next
From:
Jeff Pinyan
Date:
March 6, 2001 08:24
Subject:
editing perly.y
Message ID:
Pine.GSO.4.21.0103061121000.1035-100000@crusoe.crusoe.net
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:

--- perly.y.old Tue Mar  6 10:31:49 2001
+++ perly.y     Tue Mar  6 10:31:43 2001
@@ -588,6 +588,23 @@
        |       NOAMP WORD listexpr
                        { $$ = newUNOP(OP_ENTERSUB, OPf_STACKED,
                            append_elem(OP_LIST, $3, scalar($2))); }
+       |       DO amper '(' ')'
+                       { $$ = newUNOP(OP_ENTERSUB,
+                           OPf_SPECIAL|OPf_STACKED,
+                           prepend_elem(OP_LIST,
+                               scalar(newCVREF(
+                                   (OPpENTERSUB_AMPER<<8),
+                                   scalar($2)
+                               )),Nullop)); dep();}
+       |       DO amper '(' expr ')'
+                       { $$ = newUNOP(OP_ENTERSUB,
+                           OPf_SPECIAL|OPf_STACKED,
+                           append_elem(OP_LIST,
+                               $4,
+                               scalar(newCVREF(
+                                   (OPpENTERSUB_AMPER<<8),
+                                   scalar($2)
+                               )))); dep();}
        |       DO term %prec UNIOP
                        { $$ = dofile($2); }
        |       DO block        %prec '('

I basically pulled the amper '(' ')' and the amper '(' expr ')' from the
lines just above it.  But I see no change in the parsing.

Is there something else I have to do here?

-- 
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 Next


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