In perl.git, the branch blead has been updated

<http://perl5.git.perl.org/perl.git/commitdiff/28383d1aefa4f4c119153a5ed41ebf82ecd7a062?hp=76734a3218e712760695898e424c2369ccdd49c6>

- Log -----------------------------------------------------------------
commit 28383d1aefa4f4c119153a5ed41ebf82ecd7a062
Author: Father Chrysostomos <spr...@cpan.org>
Date:   Sat May 21 05:42:55 2016 -0700

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

Summary of changes:
 perly.act | 6 +++---
 perly.h   | 2 +-
 perly.tab | 2 +-
 perly.y   | 4 ++--
 toke.c    | 2 --
 5 files changed, 7 insertions(+), 9 deletions(-)

diff --git a/perly.act b/perly.act
index 668ab00..445c264 100644
--- a/perly.act
+++ b/perly.act
@@ -1115,7 +1115,7 @@ case 2:
 
   case 170:
 #line 892 "perly.y"
-    { (yyval.opval) = localize((ps[(2) - (2)].val.opval),(ps[(1) - 
(2)].val.ival)); ;}
+    { (yyval.opval) = localize((ps[(2) - (2)].val.opval),0); ;}
     break;
 
   case 171:
@@ -1395,7 +1395,7 @@ case 2:
 
   case 218:
 #line 1043 "perly.y"
-    { (yyval.opval) = localize((ps[(2) - (2)].val.opval),(ps[(1) - 
(2)].val.ival)); ;}
+    { (yyval.opval) = localize((ps[(2) - (2)].val.opval),1); ;}
     break;
 
   case 219:
@@ -1539,6 +1539,6 @@ case 2:
     
 
 /* Generated from:
- * 703ebd267cf8ca45f9dee9bc0f4b21511117a0c1dca1c8bc9438ce91950217ae perly.y
+ * 70adb6e1be5382fb5c8cd783cd886cb4725c98a3e69c54eb16da5d7829d929aa perly.y
  * 3e1dff60f26df8933d7aed0c0e87177a0f022c14800c0707eb62a7db4196ac98 
regen_perly.pl
  * ex: set ro: */
diff --git a/perly.h b/perly.h
index 727d244..9295f54 100644
--- a/perly.h
+++ b/perly.h
@@ -258,6 +258,6 @@ typedef union YYSTYPE
 
 
 /* Generated from:
- * 703ebd267cf8ca45f9dee9bc0f4b21511117a0c1dca1c8bc9438ce91950217ae perly.y
+ * 70adb6e1be5382fb5c8cd783cd886cb4725c98a3e69c54eb16da5d7829d929aa perly.y
  * 3e1dff60f26df8933d7aed0c0e87177a0f022c14800c0707eb62a7db4196ac98 
regen_perly.pl
  * ex: set ro: */
diff --git a/perly.tab b/perly.tab
index ee4cb89..8694bd4 100644
--- a/perly.tab
+++ b/perly.tab
@@ -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: */
diff --git a/perly.y b/perly.y
index 200964d..e7cea35 100644
--- a/perly.y
+++ b/perly.y
@@ -889,7 +889,7 @@ term        :       termbinop
        |       myattrterm      %prec UNIOP
                        { $$ = $1; }
        |       LOCAL term      %prec UNIOP
-                       { $$ = localize($2,$1); }
+                       { $$ = localize($2,0); }
        |       '(' expr ')'
                        { $$ = sawparens($2); }
        |       QWLIST
@@ -1040,7 +1040,7 @@ term      :       termbinop
 myattrterm:    MY myterm myattrlist
                        { $$ = my_attrs($2,$3); }
        |       MY myterm
-                       { $$ = localize($2,$1); }
+                       { $$ = localize($2,1); }
        ;
 
 /* Things that can be "my"'d */
diff --git a/toke.c b/toke.c
index 39c59c8..8cd0e29 100644
--- a/toke.c
+++ b/toke.c
@@ -7709,7 +7709,6 @@ Perl_yylex(pTHX)
            UNI(OP_LCFIRST);
 
        case KEY_local:
-           pl_yylval.ival = 0;
            OPERATOR(LOCAL);
 
        case KEY_length:
@@ -7792,7 +7791,6 @@ Perl_yylex(pTHX)
                    yyerror_pv(tmpbuf, UTF ? SVf_UTF8 : 0);
                }
            }
-           pl_yylval.ival = 1;
            OPERATOR(MY);
 
        case KEY_next:

--
Perl5 Master Repository

Reply via email to