develooper Front page | perl.perl5.changes | Postings from March 2018

[perl.git] branch blead updated. v5.27.8-432-gbe68a30e44

From:
Dave Mitchell
Date:
March 2, 2018 13:58
Subject:
[perl.git] branch blead updated. v5.27.8-432-gbe68a30e44
Message ID:
E1erlCD-0008L9-1n@git.dc.perl.space
In perl.git, the branch blead has been updated

<https://perl5.git.perl.org/perl.git/commitdiff/be68a30e444b3213a95df511fb8e856b2107ce73?hp=ae09f008e4b03a4215db8e3151cfb0ee5f20f004>

- Log -----------------------------------------------------------------
commit be68a30e444b3213a95df511fb8e856b2107ce73
Merge: ae09f008e4 a8c5635617
Author: David Mitchell <davem@iabyn.com>
Date:   Fri Mar 2 13:37:45 2018 +0000

    [MERGE] fixups for attributes-before-signatures
    
    RT #132760
    
    v5.27.7-212-g894f226 recently moved subroutine attributes from after
    the signature to before the signature.
    
    This small branch performs some minor tweaks to that; principally:
    
    * splits the parser rules for subs into separate rules for subs
    within and without the scope of 'use feature "signatures";
    
    * makes the parser and toker recognise the possibility of attributes
    following the signature, so that a targeted error message can be given,
    rather than a general 'syntax error' and follow-on dross.

commit a8c5635617479436b1775ba4ab34e4bc791eda54
Author: David Mitchell <davem@iabyn.com>
Date:   Mon Feb 26 18:52:23 2018 +0000

    detect sub attributes following a signature
    
    RT #132760
    
    A recent commit (v5.27.7-212-g894f226) moved subroutine attributes back
    before the subroutine's signature: e.g.
    
        sub foo :prototype($$) ($a, $b) { ... }  # 5.18 and 5.28 +
        sub foo ($a, $b) :prototype($$) { ... }  # 5.20 .. 5.26
    
    This change means that any code still using an attribute following the
    signature is going to trigger a syntax error. However, the error, followed
    by error recovery and further warnings and errors, is very unfriendly and
    gives no indication of the root cause. This commit introduces a new error,
    "Subroutine attributes must come before the signature".
    
    For example, List::Lazy, the subject of the ticket, failed to compile
    tests, with output like:
    
        Array found where operator expected at blib/lib/List/Lazy.pm line 43,
        near "$$@)" (Missing operator before @)?)
        "my" variable $step masks earlier declaration in same statement at
        blib/lib/List/Lazy.pm line 44.
        syntax error at blib/lib/List/Lazy.pm line 36, near ") :"
        Global symbol "$generator" requires explicit package name (did you
        forget to declare "my $generator"?) at blib/lib/List/Lazy.pm line 38.
        Global symbol "$state" requires explicit package name (did you forget
        to declare "my $state"?) at blib/lib/List/Lazy.pm line 39.
        Global symbol "$min" requires explicit package name (did you forget to
        declare "my $min"?) at blib/lib/List/Lazy.pm line 43.
        Global symbol "$max" requires explicit package name (did you forget to
        declare "my $max"?) at blib/lib/List/Lazy.pm line 43.
        Global symbol "$step" requires explicit package name (did you forget
        to declare "my $step"?) at blib/lib/List/Lazy.pm line 43.
        Invalid separator character '{' in attribute list at
        blib/lib/List/Lazy.pm line 44, near "$step : sub "
        Global symbol "$step" requires explicit package name (did you forget
        to declare "my $step"?) at blib/lib/List/Lazy.pm line 44.
    
    But following this commit, it now just outputs:
    
        Subroutine attributes must come before the signature at
        blib/lib/List/Lazy.pm line 36.
        Compilation failed in require at t/append.t line 5.
        BEGIN failed--compilation aborted at t/append.t line 5.
    
    It works by:
    
    1) adding a boolean flag (sig_seen) to the parser state to indicate that a
       signature has been parsed;
    2) at the end of parsing a signature, PL_expect is set to XATTRBLOCK
       rather than XBLOCK.
    
    Then if something looking like one or more attributes is encountered
    by the lexer immediately afterwards, it scans it as if it were an
    attribute, but then if sig_seen is true, it croaks.

commit 86ae8d9a6f56e9e71efc1f3e556f6770dc07566e
Author: David Mitchell <davem@iabyn.com>
Date:   Mon Feb 26 13:50:50 2018 +0000

    subtly change meaning of XATTRBLOCK, XATTRTERM
    
    Currently they tell the toker that the next thing will be attributes,
    followed by an XBLOCK or XTERMBLOCK respectively.
    
    This commit subtly changes their meanings so that they indicate that
    attributes legally *might* follow. This makes the code which initially
    sets them slightly simpler (no need to check whether the next char is
    ':'), and the code elsewhere in yylex() which handles XATTR* only triggers
    if the next char is ':' anyway.
    
    Doing it this way will shortly make detection simpler of an attribute
    illegally following a signature.

commit 75230cc19006735d29105daf0c6dcaf41880f961
Author: David Mitchell <davem@iabyn.com>
Date:   Thu Feb 22 14:44:51 2018 +0000

    rationalise subroutine parsing rules
    
    Now that the parser rules have been split into separate rules for subs
    under 'use feature "signatures"' and not, refine the rules to reflect the
    different regimes. In particular:
    
    1) no longer include 'proto' in the signature variants: as it happens the
    toker would never return a proto THING under signatures anyway, but
    removing it from the grammar makes it clearer what's expected and not
    expected.
    
    2) Remove 'subsignature' from non-sig rules: what used to happen before
    was that outside of 'use feature "signatures"', it might still try to
    parse a signature, e.g.
    
        $ perl5279 -we 'sub f :lvalue ($$@) { $x = 1 }'
        Illegal character following sigil in a subroutine signature at -e line
        1, near "($"
        syntax error at -e line 1, near "$$@"
    
    Now it's just a plain syntax error.

commit 436ddf68a973edeede30e3cdf27a8063d7686eec
Author: David Mitchell <davem@iabyn.com>
Date:   Thu Feb 22 12:23:52 2018 +0000

    parse subs and signature subs separately
    
    Currently the toker returns a SUB or ANONSUB token at the beginning
    of a sub (or BEGIN etc). Change it so that in the scope of
    'use feature "signatures"', it returns a SIGSUB / ANON_SIGSUB token
    instead.
    
    Then in perly.y, duplicate the 2 rules containing SUB / ANONSUB
    to cope with these two new tokens.
    
    The net effect of this is to use different rules in the parser for
    parsing subs when signatures are in scope.
    
    Since the two sets of rules have just been cut and pasted, there should
    be no functional changes yet, but that will change shortly.

commit 50333c9768fa52a79ec159c7a43b40948291861e
Author: David Mitchell <davem@iabyn.com>
Date:   Thu Feb 22 12:11:26 2018 +0000

    add Perl_init_named_cv() functiom
    
    This moves a block of code out from perly.y into its own function,
    because it will shortly be needed in more than one place.
    
    Should be no functional changes.

-----------------------------------------------------------------------

Summary of changes:
 embed.fnc         |    1 +
 embed.h           |    1 +
 parser.h          |    1 +
 perl.h            |    4 +-
 perly.act         | 1015 ++++++++++++++++--------------
 perly.h           |  120 ++--
 perly.tab         | 1801 +++++++++++++++++++++++++++--------------------------
 perly.y           |  106 +++-
 pod/perldiag.pod  |    9 +
 proto.h           |    3 +
 t/op/signatures.t |   24 +-
 toke.c            |  104 +++-
 12 files changed, 1708 insertions(+), 1481 deletions(-)

diff --git a/embed.fnc b/embed.fnc
index f5af7ee0d9..bc57c1d7e7 100644
--- a/embed.fnc
+++ b/embed.fnc
@@ -1511,6 +1511,7 @@ Anp	|Signal_t |csighandler	|int sig
 #endif
 Ap	|SV**	|stack_grow	|NN SV** sp|NN SV** p|SSize_t n
 Ap	|I32	|start_subparse	|I32 is_format|U32 flags
+Xp	|void	|init_named_cv	|NN CV *cv|NN OP *nameop
 : Used in pp_ctl.c
 p	|void	|sub_crush_depth|NN CV* cv
 Amd	|bool	|sv_2bool	|NN SV *const sv
diff --git a/embed.h b/embed.h
index 24f1c17c71..1e3e025e62 100644
--- a/embed.h
+++ b/embed.h
@@ -1277,6 +1277,7 @@
 #define init_argv_symbols(a,b)	Perl_init_argv_symbols(aTHX_ a,b)
 #define init_constants()	Perl_init_constants(aTHX)
 #define init_debugger()		Perl_init_debugger(aTHX)
+#define init_named_cv(a,b)	Perl_init_named_cv(aTHX_ a,b)
 #define invert(a)		Perl_invert(aTHX_ a)
 #define io_close(a,b,c,d)	Perl_io_close(aTHX_ a,b,c,d)
 #define isinfnansv(a)		Perl_isinfnansv(aTHX_ a)
diff --git a/parser.h b/parser.h
index 216e9deca8..19c5c63ad3 100644
--- a/parser.h
+++ b/parser.h
@@ -112,6 +112,7 @@ typedef struct yy_parser {
     line_t	herelines;	/* number of lines in here-doc */
     line_t	preambling;	/* line # when processing $ENV{PERL5DB} */
 
+    bool        sig_seen;       /* the currently parsing sub has a signature */
     /* these are valid while parsing a subroutine signature */
     IV          sig_elems;      /* number of signature elements seen so far */
     IV          sig_optelems;   /* number of optional signature elems seen */
diff --git a/perl.h b/perl.h
index deafa0f5f3..82c1858e2e 100644
--- a/perl.h
+++ b/perl.h
@@ -4983,8 +4983,8 @@ typedef enum {
     XREF,
     XSTATE,
     XBLOCK,
-    XATTRBLOCK,
-    XATTRTERM,
+    XATTRBLOCK, /* next token should be an attribute or block */
+    XATTRTERM,  /* next token should be an attribute, or block in a term */
     XTERMBLOCK,
     XBLOCKTERM,
     XPOSTDEREF,
diff --git a/perly.act b/perly.act
index ce4d13dcbc..fe8a5e9842 100644
--- a/perly.act
+++ b/perly.act
@@ -5,7 +5,7 @@
  */
 
 case 2:
-#line 118 "perly.y" /* yacc.c:1646  */
+#line 119 "perly.y" /* yacc.c:1646  */
     {
 			  parser->expect = XSTATE;
                           (yyval.ival) = 0;
@@ -14,7 +14,7 @@ case 2:
     break;
 
   case 3:
-#line 123 "perly.y" /* yacc.c:1646  */
+#line 124 "perly.y" /* yacc.c:1646  */
     {
 			  newPROG(block_end((ps[-1].val.ival),(ps[0].val.opval)));
 			  PL_compiling.cop_seq = 0;
@@ -24,7 +24,7 @@ case 2:
     break;
 
   case 4:
-#line 129 "perly.y" /* yacc.c:1646  */
+#line 130 "perly.y" /* yacc.c:1646  */
     {
 			  parser->expect = XTERM;
                           (yyval.ival) = 0;
@@ -33,7 +33,7 @@ case 2:
     break;
 
   case 5:
-#line 134 "perly.y" /* yacc.c:1646  */
+#line 135 "perly.y" /* yacc.c:1646  */
     {
 			  PL_eval_root = (ps[0].val.opval);
 			  (yyval.ival) = 0;
@@ -42,7 +42,7 @@ case 2:
     break;
 
   case 6:
-#line 139 "perly.y" /* yacc.c:1646  */
+#line 140 "perly.y" /* yacc.c:1646  */
     {
 			  parser->expect = XBLOCK;
                           (yyval.ival) = 0;
@@ -51,7 +51,7 @@ case 2:
     break;
 
   case 7:
-#line 144 "perly.y" /* yacc.c:1646  */
+#line 145 "perly.y" /* yacc.c:1646  */
     {
 			  PL_pad_reset_pending = TRUE;
 			  PL_eval_root = (ps[0].val.opval);
@@ -63,7 +63,7 @@ case 2:
     break;
 
   case 8:
-#line 152 "perly.y" /* yacc.c:1646  */
+#line 153 "perly.y" /* yacc.c:1646  */
     {
 			  parser->expect = XSTATE;
                           (yyval.ival) = 0;
@@ -72,7 +72,7 @@ case 2:
     break;
 
   case 9:
-#line 157 "perly.y" /* yacc.c:1646  */
+#line 158 "perly.y" /* yacc.c:1646  */
     {
 			  PL_pad_reset_pending = TRUE;
 			  PL_eval_root = (ps[0].val.opval);
@@ -84,7 +84,7 @@ case 2:
     break;
 
   case 10:
-#line 165 "perly.y" /* yacc.c:1646  */
+#line 166 "perly.y" /* yacc.c:1646  */
     {
 			  parser->expect = XSTATE;
                           (yyval.ival) = 0;
@@ -93,7 +93,7 @@ case 2:
     break;
 
   case 11:
-#line 170 "perly.y" /* yacc.c:1646  */
+#line 171 "perly.y" /* yacc.c:1646  */
     {
 			  PL_pad_reset_pending = TRUE;
 			  PL_eval_root = (ps[0].val.opval);
@@ -105,7 +105,7 @@ case 2:
     break;
 
   case 12:
-#line 178 "perly.y" /* yacc.c:1646  */
+#line 179 "perly.y" /* yacc.c:1646  */
     {
 			  parser->expect = XSTATE;
                           (yyval.ival) = 0;
@@ -114,7 +114,7 @@ case 2:
     break;
 
   case 13:
-#line 183 "perly.y" /* yacc.c:1646  */
+#line 184 "perly.y" /* yacc.c:1646  */
     {
 			  PL_eval_root = (ps[0].val.opval);
 			  (yyval.ival) = 0;
@@ -123,7 +123,7 @@ case 2:
     break;
 
   case 14:
-#line 191 "perly.y" /* yacc.c:1646  */
+#line 192 "perly.y" /* yacc.c:1646  */
     { if (parser->copline > (line_t)(ps[-3].val.ival))
 			      parser->copline = (line_t)(ps[-3].val.ival);
 			  (yyval.opval) = block_end((ps[-2].val.ival), (ps[-1].val.opval));
@@ -132,7 +132,7 @@ case 2:
     break;
 
   case 15:
-#line 199 "perly.y" /* yacc.c:1646  */
+#line 200 "perly.y" /* yacc.c:1646  */
     { if (parser->copline > (line_t)(ps[-6].val.ival))
 			      parser->copline = (line_t)(ps[-6].val.ival);
 			  (yyval.opval) = block_end((ps[-5].val.ival), (ps[-2].val.opval));
@@ -141,14 +141,14 @@ case 2:
     break;
 
   case 16:
-#line 206 "perly.y" /* yacc.c:1646  */
+#line 207 "perly.y" /* yacc.c:1646  */
     { (yyval.ival) = block_start(TRUE);
 			  parser->parsed_sub = 0; }
 
     break;
 
   case 17:
-#line 211 "perly.y" /* yacc.c:1646  */
+#line 212 "perly.y" /* yacc.c:1646  */
     { if (parser->copline > (line_t)(ps[-3].val.ival))
 			      parser->copline = (line_t)(ps[-3].val.ival);
 			  (yyval.opval) = block_end((ps[-2].val.ival), (ps[-1].val.opval));
@@ -157,20 +157,20 @@ case 2:
     break;
 
   case 18:
-#line 218 "perly.y" /* yacc.c:1646  */
+#line 219 "perly.y" /* yacc.c:1646  */
     { (yyval.ival) = block_start(FALSE);
 			  parser->parsed_sub = 0; }
 
     break;
 
   case 19:
-#line 224 "perly.y" /* yacc.c:1646  */
+#line 225 "perly.y" /* yacc.c:1646  */
     { (yyval.opval) = NULL; }
 
     break;
 
   case 20:
-#line 226 "perly.y" /* yacc.c:1646  */
+#line 227 "perly.y" /* yacc.c:1646  */
     {   (yyval.opval) = op_append_list(OP_LINESEQ, (ps[-1].val.opval), (ps[0].val.opval));
 			    PL_pad_reset_pending = TRUE;
 			    if ((ps[-1].val.opval) && (ps[0].val.opval))
@@ -180,13 +180,13 @@ case 2:
     break;
 
   case 21:
-#line 235 "perly.y" /* yacc.c:1646  */
+#line 236 "perly.y" /* yacc.c:1646  */
     { (yyval.opval) = NULL; }
 
     break;
 
   case 22:
-#line 237 "perly.y" /* yacc.c:1646  */
+#line 238 "perly.y" /* yacc.c:1646  */
     {   (yyval.opval) = op_append_list(OP_LINESEQ, (ps[-1].val.opval), (ps[0].val.opval));
 			    PL_pad_reset_pending = TRUE;
 			    if ((ps[-1].val.opval) && (ps[0].val.opval))
@@ -196,7 +196,7 @@ case 2:
     break;
 
   case 23:
-#line 246 "perly.y" /* yacc.c:1646  */
+#line 247 "perly.y" /* yacc.c:1646  */
     {
 			  (yyval.opval) = (ps[0].val.opval) ? newSTATEOP(0, NULL, (ps[0].val.opval)) : NULL;
 			}
@@ -204,13 +204,13 @@ case 2:
     break;
 
   case 24:
-#line 250 "perly.y" /* yacc.c:1646  */
+#line 251 "perly.y" /* yacc.c:1646  */
     { (yyval.opval) = (ps[0].val.opval); }
 
     break;
 
   case 25:
-#line 254 "perly.y" /* yacc.c:1646  */
+#line 255 "perly.y" /* yacc.c:1646  */
     {
 			  (yyval.opval) = newSTATEOP(SVf_UTF8 * (ps[-1].val.pval)[strlen((ps[-1].val.pval))+1], (ps[-1].val.pval), (ps[0].val.opval));
 			}
@@ -218,7 +218,7 @@ case 2:
     break;
 
   case 26:
-#line 258 "perly.y" /* yacc.c:1646  */
+#line 259 "perly.y" /* yacc.c:1646  */
     {
 			  (yyval.opval) = newSTATEOP(SVf_UTF8 * (ps[-1].val.pval)[strlen((ps[-1].val.pval))+1], (ps[-1].val.pval), (ps[0].val.opval));
 			}
@@ -226,13 +226,13 @@ case 2:
     break;
 
   case 27:
-#line 265 "perly.y" /* yacc.c:1646  */
+#line 266 "perly.y" /* yacc.c:1646  */
     { (yyval.opval) = (ps[0].val.opval); }
 
     break;
 
   case 28:
-#line 267 "perly.y" /* yacc.c:1646  */
+#line 268 "perly.y" /* yacc.c:1646  */
     {
 			  CV *fmtcv = PL_compcv;
 			  newFORM((ps[-2].val.ival), (ps[-1].val.opval), (ps[0].val.opval));
@@ -246,25 +246,9 @@ case 2:
     break;
 
   case 29:
-#line 277 "perly.y" /* yacc.c:1646  */
+#line 280 "perly.y" /* yacc.c:1646  */
     {
-			  if ((ps[-1].val.opval)->op_type == OP_CONST) {
-			    const char *const name =
-				SvPV_nolen_const(((SVOP*)(ps[-1].val.opval))->op_sv);
-			    if (strEQ(name, "BEGIN") || strEQ(name, "END")
-			      || strEQ(name, "INIT") || strEQ(name, "CHECK")
-			      || strEQ(name, "UNITCHECK"))
-			      CvSPECIAL_on(PL_compcv);
-			  }
-			  else
-			  /* State subs inside anonymous subs need to be
-			     clonable themselves. */
-			  if (CvANON(CvOUTSIDE(PL_compcv))
-			   || CvCLONE(CvOUTSIDE(PL_compcv))
-			   || !PadnameIsSTATE(PadlistNAMESARRAY(CvPADLIST(
-						CvOUTSIDE(PL_compcv)
-					     ))[(ps[-1].val.opval)->op_targ]))
-			      CvCLONE_on(PL_compcv);
+                          init_named_cv(PL_compcv, (ps[-1].val.opval));
 			  parser->in_my = 0;
 			  parser->in_my_stash = NULL;
 			}
@@ -272,7 +256,7 @@ case 2:
     break;
 
   case 30:
-#line 299 "perly.y" /* yacc.c:1646  */
+#line 286 "perly.y" /* yacc.c:1646  */
     {
 			  SvREFCNT_inc_simple_void(PL_compcv);
 			  (ps[-5].val.opval)->op_type == OP_CONST
@@ -287,7 +271,32 @@ case 2:
     break;
 
   case 31:
-#line 310 "perly.y" /* yacc.c:1646  */
+#line 301 "perly.y" /* yacc.c:1646  */
+    {
+                          init_named_cv(PL_compcv, (ps[-1].val.opval));
+			  parser->in_my = 0;
+			  parser->in_my_stash = NULL;
+			}
+
+    break;
+
+  case 32:
+#line 307 "perly.y" /* yacc.c:1646  */
+    {
+			  SvREFCNT_inc_simple_void(PL_compcv);
+			  (ps[-4].val.opval)->op_type == OP_CONST
+			      ? newATTRSUB((ps[-3].val.ival), (ps[-4].val.opval), NULL, (ps[-1].val.opval), (ps[0].val.opval))
+			      : newMYSUB(  (ps[-3].val.ival), (ps[-4].val.opval), NULL, (ps[-1].val.opval), (ps[0].val.opval))
+			  ;
+			  (yyval.opval) = NULL;
+			  intro_my();
+			  parser->parsed_sub = 1;
+			}
+
+    break;
+
+  case 33:
+#line 318 "perly.y" /* yacc.c:1646  */
     {
 			  package((ps[-1].val.opval));
 			  if ((ps[-2].val.opval))
@@ -297,14 +306,14 @@ case 2:
 
     break;
 
-  case 32:
-#line 317 "perly.y" /* yacc.c:1646  */
+  case 34:
+#line 325 "perly.y" /* yacc.c:1646  */
     { CvSPECIAL_on(PL_compcv); /* It's a BEGIN {} */ }
 
     break;
 
-  case 33:
-#line 319 "perly.y" /* yacc.c:1646  */
+  case 35:
+#line 327 "perly.y" /* yacc.c:1646  */
     {
 			  SvREFCNT_inc_simple_void(PL_compcv);
 			  utilize((ps[-6].val.ival), (ps[-5].val.ival), (ps[-3].val.opval), (ps[-2].val.opval), (ps[-1].val.opval));
@@ -314,8 +323,8 @@ case 2:
 
     break;
 
-  case 34:
-#line 326 "perly.y" /* yacc.c:1646  */
+  case 36:
+#line 334 "perly.y" /* yacc.c:1646  */
     {
 			  (yyval.opval) = block_end((ps[-4].val.ival),
 			      newCONDOP(0, (ps[-3].val.opval), op_scope((ps[-1].val.opval)), (ps[0].val.opval)));
@@ -324,8 +333,8 @@ case 2:
 
     break;
 
-  case 35:
-#line 332 "perly.y" /* yacc.c:1646  */
+  case 37:
+#line 340 "perly.y" /* yacc.c:1646  */
     {
 			  (yyval.opval) = block_end((ps[-4].val.ival),
                               newCONDOP(0, (ps[-3].val.opval), (ps[0].val.opval), op_scope((ps[-1].val.opval))));
@@ -334,8 +343,8 @@ case 2:
 
     break;
 
-  case 36:
-#line 338 "perly.y" /* yacc.c:1646  */
+  case 38:
+#line 346 "perly.y" /* yacc.c:1646  */
     {
 			  (yyval.opval) = block_end((ps[-3].val.ival), newGIVENOP((ps[-2].val.opval), op_scope((ps[0].val.opval)), 0));
 			  parser->copline = (line_t)(ps[-5].val.ival);
@@ -343,20 +352,20 @@ case 2:
 
     break;
 
-  case 37:
-#line 343 "perly.y" /* yacc.c:1646  */
+  case 39:
+#line 351 "perly.y" /* yacc.c:1646  */
     { (yyval.opval) = block_end((ps[-3].val.ival), newWHENOP((ps[-2].val.opval), op_scope((ps[0].val.opval)))); }
 
     break;
 
-  case 38:
-#line 345 "perly.y" /* yacc.c:1646  */
+  case 40:
+#line 353 "perly.y" /* yacc.c:1646  */
     { (yyval.opval) = newWHENOP(0, op_scope((ps[0].val.opval))); }
 
     break;
 
-  case 39:
-#line 347 "perly.y" /* yacc.c:1646  */
+  case 41:
+#line 355 "perly.y" /* yacc.c:1646  */
     {
 			  (yyval.opval) = block_end((ps[-5].val.ival),
 				  newWHILEOP(0, 1, NULL,
@@ -366,8 +375,8 @@ case 2:
 
     break;
 
-  case 40:
-#line 354 "perly.y" /* yacc.c:1646  */
+  case 42:
+#line 362 "perly.y" /* yacc.c:1646  */
     {
 			  (yyval.opval) = block_end((ps[-5].val.ival),
 				  newWHILEOP(0, 1, NULL,
@@ -377,20 +386,20 @@ case 2:
 
     break;
 
-  case 41:
-#line 361 "perly.y" /* yacc.c:1646  */
+  case 43:
+#line 369 "perly.y" /* yacc.c:1646  */
     { parser->expect = XTERM; }
 
     break;
 
-  case 42:
-#line 363 "perly.y" /* yacc.c:1646  */
+  case 44:
+#line 371 "perly.y" /* yacc.c:1646  */
     { parser->expect = XTERM; }
 
     break;
 
-  case 43:
-#line 366 "perly.y" /* yacc.c:1646  */
+  case 45:
+#line 374 "perly.y" /* yacc.c:1646  */
     {
 			  OP *initop = (ps[-9].val.opval);
 			  OP *forop = newWHILEOP(0, 1, NULL,
@@ -408,8 +417,8 @@ case 2:
 
     break;
 
-  case 44:
-#line 381 "perly.y" /* yacc.c:1646  */
+  case 46:
+#line 389 "perly.y" /* yacc.c:1646  */
     {
 			  (yyval.opval) = block_end((ps[-6].val.ival), newFOROP(0, (ps[-5].val.opval), (ps[-3].val.opval), (ps[-1].val.opval), (ps[0].val.opval)));
 			  parser->copline = (line_t)(ps[-8].val.ival);
@@ -417,8 +426,8 @@ case 2:
 
     break;
 
-  case 45:
-#line 386 "perly.y" /* yacc.c:1646  */
+  case 47:
+#line 394 "perly.y" /* yacc.c:1646  */
     {
 			  (yyval.opval) = block_end((ps[-4].val.ival), newFOROP(0,
 				      op_lvalue((ps[-6].val.opval), OP_ENTERLOOP), (ps[-3].val.opval), (ps[-1].val.opval), (ps[0].val.opval)));
@@ -427,14 +436,14 @@ case 2:
 
     break;
 
-  case 46:
-#line 392 "perly.y" /* yacc.c:1646  */
+  case 48:
+#line 400 "perly.y" /* yacc.c:1646  */
     { parser->in_my = 0; (yyval.opval) = my((ps[0].val.opval)); }
 
     break;
 
-  case 47:
-#line 394 "perly.y" /* yacc.c:1646  */
+  case 49:
+#line 402 "perly.y" /* yacc.c:1646  */
     {
 			  (yyval.opval) = block_end(
 				(ps[-7].val.ival),
@@ -450,8 +459,8 @@ case 2:
 
     break;
 
-  case 48:
-#line 407 "perly.y" /* yacc.c:1646  */
+  case 50:
+#line 415 "perly.y" /* yacc.c:1646  */
     {
 			  (yyval.opval) = block_end((ps[-4].val.ival), newFOROP(
 				0, op_lvalue(newUNOP(OP_REFGEN, 0,
@@ -462,8 +471,8 @@ case 2:
 
     break;
 
-  case 49:
-#line 415 "perly.y" /* yacc.c:1646  */
+  case 51:
+#line 423 "perly.y" /* yacc.c:1646  */
     {
 			  (yyval.opval) = block_end((ps[-4].val.ival),
 				  newFOROP(0, NULL, (ps[-3].val.opval), (ps[-1].val.opval), (ps[0].val.opval)));
@@ -472,8 +481,8 @@ case 2:
 
     break;
 
-  case 50:
-#line 421 "perly.y" /* yacc.c:1646  */
+  case 52:
+#line 429 "perly.y" /* yacc.c:1646  */
     {
 			  /* a block is a loop that happens once */
 			  (yyval.opval) = newWHILEOP(0, 1, NULL,
@@ -482,8 +491,8 @@ case 2:
 
     break;
 
-  case 51:
-#line 427 "perly.y" /* yacc.c:1646  */
+  case 53:
+#line 435 "perly.y" /* yacc.c:1646  */
     {
 			  package((ps[-2].val.opval));
 			  if ((ps[-3].val.opval)) {
@@ -493,8 +502,8 @@ case 2:
 
     break;
 
-  case 52:
-#line 434 "perly.y" /* yacc.c:1646  */
+  case 54:
+#line 442 "perly.y" /* yacc.c:1646  */
     {
 			  /* a block is a loop that happens once */
 			  (yyval.opval) = newWHILEOP(0, 1, NULL,
@@ -505,16 +514,16 @@ case 2:
 
     break;
 
-  case 53:
-#line 442 "perly.y" /* yacc.c:1646  */
+  case 55:
+#line 450 "perly.y" /* yacc.c:1646  */
     {
 			  (yyval.opval) = (ps[-1].val.opval);
 			}
 
     break;
 
-  case 54:
-#line 446 "perly.y" /* yacc.c:1646  */
+  case 56:
+#line 454 "perly.y" /* yacc.c:1646  */
     {
 			  (yyval.opval) = newLISTOP(OP_DIE, 0, newOP(OP_PUSHMARK, 0),
 				newSVOP(OP_CONST, 0, newSVpvs("Unimplemented")));
@@ -522,8 +531,8 @@ case 2:
 
     break;
 
-  case 55:
-#line 451 "perly.y" /* yacc.c:1646  */
+  case 57:
+#line 459 "perly.y" /* yacc.c:1646  */
     {
 			  (yyval.opval) = NULL;
 			  parser->copline = NOLINE;
@@ -531,8 +540,8 @@ case 2:
 
     break;
 
-  case 56:
-#line 459 "perly.y" /* yacc.c:1646  */
+  case 58:
+#line 467 "perly.y" /* yacc.c:1646  */
     { OP *list;
 			  if ((ps[0].val.opval)) {
 			      OP *term = (ps[0].val.opval);
@@ -550,75 +559,75 @@ case 2:
 
     break;
 
-  case 57:
-#line 476 "perly.y" /* yacc.c:1646  */
+  case 59:
+#line 484 "perly.y" /* yacc.c:1646  */
     { (yyval.opval) = NULL; }
 
     break;
 
-  case 58:
-#line 478 "perly.y" /* yacc.c:1646  */
+  case 60:
+#line 486 "perly.y" /* yacc.c:1646  */
     { (yyval.opval) = op_unscope((ps[-1].val.opval)); }
 
     break;
 
-  case 59:
-#line 483 "perly.y" /* yacc.c:1646  */
+  case 61:
+#line 491 "perly.y" /* yacc.c:1646  */
     { (yyval.opval) = NULL; }
 
     break;
 
-  case 60:
-#line 485 "perly.y" /* yacc.c:1646  */
+  case 62:
+#line 493 "perly.y" /* yacc.c:1646  */
     { (yyval.opval) = (ps[0].val.opval); }
 
     break;
 
-  case 61:
-#line 487 "perly.y" /* yacc.c:1646  */
+  case 63:
+#line 495 "perly.y" /* yacc.c:1646  */
     { (yyval.opval) = newLOGOP(OP_AND, 0, (ps[0].val.opval), (ps[-2].val.opval)); }
 
     break;
 
-  case 62:
-#line 489 "perly.y" /* yacc.c:1646  */
+  case 64:
+#line 497 "perly.y" /* yacc.c:1646  */
     { (yyval.opval) = newLOGOP(OP_OR, 0, (ps[0].val.opval), (ps[-2].val.opval)); }
 
     break;
 
-  case 63:
-#line 491 "perly.y" /* yacc.c:1646  */
+  case 65:
+#line 499 "perly.y" /* yacc.c:1646  */
     { (yyval.opval) = newLOOPOP(OPf_PARENS, 1, scalar((ps[0].val.opval)), (ps[-2].val.opval)); }
 
     break;
 
-  case 64:
-#line 493 "perly.y" /* yacc.c:1646  */
+  case 66:
+#line 501 "perly.y" /* yacc.c:1646  */
     { (yyval.opval) = newLOOPOP(OPf_PARENS, 1, (ps[0].val.opval), (ps[-2].val.opval)); }
 
     break;
 
-  case 65:
-#line 495 "perly.y" /* yacc.c:1646  */
+  case 67:
+#line 503 "perly.y" /* yacc.c:1646  */
     { (yyval.opval) = newFOROP(0, NULL, (ps[0].val.opval), (ps[-2].val.opval), NULL);
 			  parser->copline = (line_t)(ps[-1].val.ival); }
 
     break;
 
-  case 66:
-#line 498 "perly.y" /* yacc.c:1646  */
+  case 68:
+#line 506 "perly.y" /* yacc.c:1646  */
     { (yyval.opval) = newWHENOP((ps[0].val.opval), op_scope((ps[-2].val.opval))); }
 
     break;
 
-  case 67:
-#line 503 "perly.y" /* yacc.c:1646  */
+  case 69:
+#line 511 "perly.y" /* yacc.c:1646  */
     { (yyval.opval) = NULL; }
 
     break;
 
-  case 68:
-#line 505 "perly.y" /* yacc.c:1646  */
+  case 70:
+#line 513 "perly.y" /* yacc.c:1646  */
     {
 			  ((ps[0].val.opval))->op_flags |= OPf_PARENS;
 			  (yyval.opval) = op_scope((ps[0].val.opval));
@@ -626,8 +635,8 @@ case 2:
 
     break;
 
-  case 69:
-#line 510 "perly.y" /* yacc.c:1646  */
+  case 71:
+#line 518 "perly.y" /* yacc.c:1646  */
     { parser->copline = (line_t)(ps[-5].val.ival);
 			    (yyval.opval) = newCONDOP(0,
 				newSTATEOP(OPf_SPECIAL,NULL,(ps[-3].val.opval)),
@@ -637,153 +646,153 @@ case 2:
 
     break;
 
-  case 70:
-#line 520 "perly.y" /* yacc.c:1646  */
+  case 72:
+#line 528 "perly.y" /* yacc.c:1646  */
     { (yyval.opval) = NULL; }
 
     break;
 
-  case 71:
-#line 522 "perly.y" /* yacc.c:1646  */
+  case 73:
+#line 530 "perly.y" /* yacc.c:1646  */
     { (yyval.opval) = op_scope((ps[0].val.opval)); }
 
     break;
 
-  case 72:
-#line 527 "perly.y" /* yacc.c:1646  */
+  case 74:
+#line 535 "perly.y" /* yacc.c:1646  */
     { (yyval.ival) = (PL_min_intro_pending &&
 			    PL_max_intro_pending >=  PL_min_intro_pending);
 			  intro_my(); }
 
     break;
 
-  case 73:
-#line 533 "perly.y" /* yacc.c:1646  */
+  case 75:
+#line 541 "perly.y" /* yacc.c:1646  */
     { (yyval.opval) = NULL; }
 
     break;
 
-  case 75:
-#line 539 "perly.y" /* yacc.c:1646  */
+  case 77:
+#line 547 "perly.y" /* yacc.c:1646  */
     { YYSTYPE tmplval;
 			  (void)scan_num("1", &tmplval);
 			  (yyval.opval) = tmplval.opval; }
 
     break;
 
-  case 77:
-#line 547 "perly.y" /* yacc.c:1646  */
+  case 79:
+#line 555 "perly.y" /* yacc.c:1646  */
     { (yyval.opval) = invert(scalar((ps[0].val.opval))); }
 
     break;
 
-  case 78:
-#line 552 "perly.y" /* yacc.c:1646  */
+  case 80:
+#line 560 "perly.y" /* yacc.c:1646  */
     { (yyval.opval) = (ps[0].val.opval); intro_my(); }
 
     break;
 
-  case 79:
-#line 556 "perly.y" /* yacc.c:1646  */
+  case 81:
+#line 564 "perly.y" /* yacc.c:1646  */
     { (yyval.opval) = (ps[0].val.opval); intro_my(); }
 
     break;
 
-  case 80:
-#line 559 "perly.y" /* yacc.c:1646  */
+  case 82:
+#line 567 "perly.y" /* yacc.c:1646  */
     { (yyval.opval) = (ps[0].val.opval); }
 
     break;
 
-  case 81:
-#line 560 "perly.y" /* yacc.c:1646  */
+  case 83:
+#line 568 "perly.y" /* yacc.c:1646  */
     { (yyval.opval) = NULL; }
 
     break;
 
-  case 82:
-#line 564 "perly.y" /* yacc.c:1646  */
+  case 84:
+#line 572 "perly.y" /* yacc.c:1646  */
     { (yyval.ival) = start_subparse(FALSE, 0);
 			    SAVEFREESV(PL_compcv); }
 
     break;
 
-  case 83:
-#line 570 "perly.y" /* yacc.c:1646  */
+  case 85:
+#line 578 "perly.y" /* yacc.c:1646  */
     { (yyval.ival) = start_subparse(FALSE, CVf_ANON);
 			    SAVEFREESV(PL_compcv); }
 
     break;
 
-  case 84:
-#line 575 "perly.y" /* yacc.c:1646  */
+  case 86:
+#line 583 "perly.y" /* yacc.c:1646  */
     { (yyval.ival) = start_subparse(TRUE, 0);
 			    SAVEFREESV(PL_compcv); }
 
     break;
 
-  case 87:
-#line 586 "perly.y" /* yacc.c:1646  */
+  case 89:
+#line 594 "perly.y" /* yacc.c:1646  */
     { (yyval.opval) = NULL; }
 
     break;
 
-  case 89:
-#line 592 "perly.y" /* yacc.c:1646  */
+  case 91:
+#line 600 "perly.y" /* yacc.c:1646  */
     { (yyval.opval) = NULL; }
 
     break;
 
-  case 90:
-#line 594 "perly.y" /* yacc.c:1646  */
+  case 92:
+#line 602 "perly.y" /* yacc.c:1646  */
     { (yyval.opval) = (ps[0].val.opval); }
 
     break;
 
-  case 91:
-#line 596 "perly.y" /* yacc.c:1646  */
+  case 93:
+#line 604 "perly.y" /* yacc.c:1646  */
     { (yyval.opval) = NULL; }
 
     break;
 
-  case 92:
-#line 601 "perly.y" /* yacc.c:1646  */
+  case 94:
+#line 609 "perly.y" /* yacc.c:1646  */
     { (yyval.opval) = (ps[0].val.opval); }
 
     break;
 
-  case 93:
-#line 603 "perly.y" /* yacc.c:1646  */
+  case 95:
+#line 611 "perly.y" /* yacc.c:1646  */
     { (yyval.opval) = NULL; }
 
     break;
 
-  case 94:
-#line 614 "perly.y" /* yacc.c:1646  */
+  case 96:
+#line 622 "perly.y" /* yacc.c:1646  */
     { parser->in_my = 0; (yyval.opval) = NULL; }
 
     break;
 
-  case 95:
-#line 616 "perly.y" /* yacc.c:1646  */
+  case 97:
+#line 624 "perly.y" /* yacc.c:1646  */
     { parser->in_my = 0; (yyval.opval) = (ps[0].val.opval); }
 
     break;
 
-  case 96:
-#line 621 "perly.y" /* yacc.c:1646  */
+  case 98:
+#line 629 "perly.y" /* yacc.c:1646  */
     { (yyval.ival) = '@'; }
 
     break;
 
-  case 97:
-#line 623 "perly.y" /* yacc.c:1646  */
+  case 99:
+#line 631 "perly.y" /* yacc.c:1646  */
     { (yyval.ival) = '%'; }
 
     break;
 
-  case 98:
-#line 627 "perly.y" /* yacc.c:1646  */
+  case 100:
+#line 635 "perly.y" /* yacc.c:1646  */
     {
                             I32 sigil   = (ps[-2].val.ival);
                             OP *var     = (ps[-1].val.opval);
@@ -802,26 +811,26 @@ case 2:
 
     break;
 
-  case 99:
-#line 646 "perly.y" /* yacc.c:1646  */
+  case 101:
+#line 654 "perly.y" /* yacc.c:1646  */
     { (yyval.opval) = NULL; }
 
     break;
 
-  case 100:
-#line 648 "perly.y" /* yacc.c:1646  */
+  case 102:
+#line 656 "perly.y" /* yacc.c:1646  */
     { (yyval.opval) = newOP(OP_NULL, 0); }
 
     break;
 
-  case 101:
-#line 650 "perly.y" /* yacc.c:1646  */
+  case 103:
+#line 658 "perly.y" /* yacc.c:1646  */
     { (yyval.opval) = (ps[0].val.opval); }
 
     break;
 
-  case 102:
-#line 656 "perly.y" /* yacc.c:1646  */
+  case 104:
+#line 664 "perly.y" /* yacc.c:1646  */
     {
                             OP *var     = (ps[-1].val.opval);
                             OP *defexpr = (ps[0].val.opval);
@@ -885,58 +894,64 @@ case 2:
 
     break;
 
-  case 103:
-#line 721 "perly.y" /* yacc.c:1646  */
+  case 105:
+#line 729 "perly.y" /* yacc.c:1646  */
     { parser->in_my = KEY_sigvar; (yyval.opval) = (ps[0].val.opval); }
 
     break;
 
-  case 104:
-#line 723 "perly.y" /* yacc.c:1646  */
+  case 106:
+#line 731 "perly.y" /* yacc.c:1646  */
     { parser->in_my = KEY_sigvar; (yyval.opval) = (ps[0].val.opval); }
 
     break;
 
-  case 105:
-#line 729 "perly.y" /* yacc.c:1646  */
+  case 107:
+#line 737 "perly.y" /* yacc.c:1646  */
     { (yyval.opval) = (ps[-1].val.opval); }
 
     break;
 
-  case 106:
-#line 731 "perly.y" /* yacc.c:1646  */
+  case 108:
+#line 739 "perly.y" /* yacc.c:1646  */
     {
 			  (yyval.opval) = op_append_list(OP_LINESEQ, (ps[-2].val.opval), (ps[0].val.opval));
 			}
 
     break;
 
-  case 107:
-#line 735 "perly.y" /* yacc.c:1646  */
+  case 109:
+#line 743 "perly.y" /* yacc.c:1646  */
     { (yyval.opval) = (ps[0].val.opval); }
 
     break;
 
-  case 108:
-#line 740 "perly.y" /* yacc.c:1646  */
+  case 110:
+#line 748 "perly.y" /* yacc.c:1646  */
     { (yyval.opval) = NULL; }
 
     break;
 
-  case 109:
-#line 742 "perly.y" /* yacc.c:1646  */
+  case 111:
+#line 750 "perly.y" /* yacc.c:1646  */
     { (yyval.opval) = (ps[0].val.opval); }
 
     break;
 
-  case 110:
-#line 745 "perly.y" /* yacc.c:1646  */
-    { (yyval.opval) = (OP*)NULL; }
+  case 112:
+#line 754 "perly.y" /* yacc.c:1646  */
+    { (yyval.opval) = NULL; }
 
     break;
 
-  case 111:
-#line 747 "perly.y" /* yacc.c:1646  */
+  case 113:
+#line 756 "perly.y" /* yacc.c:1646  */
+    { (yyval.opval) = (ps[0].val.opval); }
+
+    break;
+
+  case 114:
+#line 760 "perly.y" /* yacc.c:1646  */
     {
                             ENTER;
                             SAVEIV(parser->sig_elems);
@@ -950,8 +965,8 @@ case 2:
 
     break;
 
-  case 112:
-#line 759 "perly.y" /* yacc.c:1646  */
+  case 115:
+#line 772 "perly.y" /* yacc.c:1646  */
     {
                             OP            *sigops = (ps[-1].val.opval);
                             UNOP_AUX_item *aux;
@@ -983,61 +998,92 @@ case 2:
                                                 newSTATEOP(0, NULL, NULL));
 
                             parser->in_my = 0;
-                            parser->expect = XBLOCK;
+                            /* tell the toker that attrributes can follow
+                             * this sig, but only so that the toker
+                             * can skip through any (illegal) trailing
+                             * attribute text then give a useful error
+                             * message about "attributes before sig",
+                             * rather than falling over ina mess at
+                             * unrecognised syntax.
+                             */
+                            parser->expect = XATTRBLOCK;
+                            parser->sig_seen = TRUE;
                             LEAVE;
 			}
 
     break;
 
-  case 113:
-#line 798 "perly.y" /* yacc.c:1646  */
+  case 116:
+#line 818 "perly.y" /* yacc.c:1646  */
+    { (yyval.opval) = (ps[0].val.opval); }
+
+    break;
+
+  case 117:
+#line 819 "perly.y" /* yacc.c:1646  */
+    { (yyval.opval) = NULL; }
+
+    break;
+
+  case 118:
+#line 825 "perly.y" /* yacc.c:1646  */
     {
 			  if (parser->copline > (line_t)(ps[-2].val.ival))
 			      parser->copline = (line_t)(ps[-2].val.ival);
-			  (yyval.opval) = block_end((ps[-4].val.ival),
-				op_append_list(OP_LINESEQ, (ps[-3].val.opval), (ps[-1].val.opval)));
- 			}
+			  (yyval.opval) = block_end((ps[-3].val.ival), (ps[-1].val.opval));
+			}
 
     break;
 
-  case 114:
-#line 808 "perly.y" /* yacc.c:1646  */
+  case 119:
+#line 835 "perly.y" /* yacc.c:1646  */
     { (yyval.opval) = (ps[0].val.opval); }
 
     break;
 
-  case 115:
-#line 809 "perly.y" /* yacc.c:1646  */
+  case 120:
+#line 836 "perly.y" /* yacc.c:1646  */
     { (yyval.opval) = NULL; }
 
     break;
 
-  case 116:
-#line 814 "perly.y" /* yacc.c:1646  */
+  case 121:
+#line 840 "perly.y" /* yacc.c:1646  */
+    {
+			  if (parser->copline > (line_t)(ps[-2].val.ival))
+			      parser->copline = (line_t)(ps[-2].val.ival);
+			  (yyval.opval) = block_end((ps[-4].val.ival),
+				op_append_list(OP_LINESEQ, (ps[-3].val.opval), (ps[-1].val.opval)));
+ 			}
+
+    break;
+
+  case 122:
+#line 851 "perly.y" /* yacc.c:1646  */
     { (yyval.opval) = newLOGOP(OP_AND, 0, (ps[-2].val.opval), (ps[0].val.opval)); }
 
     break;
 
-  case 117:
-#line 816 "perly.y" /* yacc.c:1646  */
+  case 123:
+#line 853 "perly.y" /* yacc.c:1646  */
     { (yyval.opval) = newLOGOP((ps[-1].val.ival), 0, (ps[-2].val.opval), (ps[0].val.opval)); }
 
     break;
 
-  case 118:
-#line 818 "perly.y" /* yacc.c:1646  */
+  case 124:
+#line 855 "perly.y" /* yacc.c:1646  */
     { (yyval.opval) = newLOGOP(OP_DOR, 0, (ps[-2].val.opval), (ps[0].val.opval)); }
 
     break;
 
-  case 120:
-#line 824 "perly.y" /* yacc.c:1646  */
+  case 126:
+#line 861 "perly.y" /* yacc.c:1646  */
     { (yyval.opval) = (ps[-1].val.opval); }
 
     break;
 
-  case 121:
-#line 826 "perly.y" /* yacc.c:1646  */
+  case 127:
+#line 863 "perly.y" /* yacc.c:1646  */
     {
 			  OP* term = (ps[0].val.opval);
 			  (yyval.opval) = op_append_elem(OP_LIST, (ps[-2].val.opval), term);
@@ -1045,24 +1091,24 @@ case 2:
 
     break;
 
-  case 123:
-#line 835 "perly.y" /* yacc.c:1646  */
+  case 129:
+#line 872 "perly.y" /* yacc.c:1646  */
     { (yyval.opval) = op_convert_list((ps[-2].val.ival), OPf_STACKED,
 				op_prepend_elem(OP_LIST, newGVREF((ps[-2].val.ival),(ps[-1].val.opval)), (ps[0].val.opval)) );
 			}
 
     break;
 
-  case 124:
-#line 839 "perly.y" /* yacc.c:1646  */
+  case 130:
+#line 876 "perly.y" /* yacc.c:1646  */
     { (yyval.opval) = op_convert_list((ps[-4].val.ival), OPf_STACKED,
 				op_prepend_elem(OP_LIST, newGVREF((ps[-4].val.ival),(ps[-2].val.opval)), (ps[-1].val.opval)) );
 			}
 
     break;
 
-  case 125:
-#line 843 "perly.y" /* yacc.c:1646  */
+  case 131:
+#line 880 "perly.y" /* yacc.c:1646  */
     { (yyval.opval) = op_convert_list(OP_ENTERSUB, OPf_STACKED,
 				op_append_elem(OP_LIST,
 				    op_prepend_elem(OP_LIST, scalar((ps[-5].val.opval)), (ps[-1].val.opval)),
@@ -1071,8 +1117,8 @@ case 2:
 
     break;
 
-  case 126:
-#line 849 "perly.y" /* yacc.c:1646  */
+  case 132:
+#line 886 "perly.y" /* yacc.c:1646  */
     { (yyval.opval) = op_convert_list(OP_ENTERSUB, OPf_STACKED,
 				op_append_elem(OP_LIST, scalar((ps[-2].val.opval)),
 				    newMETHOP(OP_METHOD, 0, (ps[0].val.opval))));
@@ -1080,8 +1126,8 @@ case 2:
 
     break;
 
-  case 127:
-#line 854 "perly.y" /* yacc.c:1646  */
+  case 133:
+#line 891 "perly.y" /* yacc.c:1646  */
     { (yyval.opval) = op_convert_list(OP_ENTERSUB, OPf_STACKED,
 				op_append_elem(OP_LIST,
 				    op_prepend_elem(OP_LIST, (ps[-1].val.opval), (ps[0].val.opval)),
@@ -1090,8 +1136,8 @@ case 2:
 
     break;
 
-  case 128:
-#line 860 "perly.y" /* yacc.c:1646  */
+  case 134:
+#line 897 "perly.y" /* yacc.c:1646  */
     { (yyval.opval) = op_convert_list(OP_ENTERSUB, OPf_STACKED,
 				op_append_elem(OP_LIST,
 				    op_prepend_elem(OP_LIST, (ps[-3].val.opval), (ps[-1].val.opval)),
@@ -1100,27 +1146,27 @@ case 2:
 
     break;
 
-  case 129:
-#line 866 "perly.y" /* yacc.c:1646  */
+  case 135:
+#line 903 "perly.y" /* yacc.c:1646  */
     { (yyval.opval) = op_convert_list((ps[-1].val.ival), 0, (ps[0].val.opval)); }
 
     break;
 
-  case 130:
-#line 868 "perly.y" /* yacc.c:1646  */
+  case 136:
+#line 905 "perly.y" /* yacc.c:1646  */
     { (yyval.opval) = op_convert_list((ps[-3].val.ival), 0, (ps[-1].val.opval)); }
 
     break;
 
-  case 131:
-#line 870 "perly.y" /* yacc.c:1646  */
+  case 137:
+#line 907 "perly.y" /* yacc.c:1646  */
     { SvREFCNT_inc_simple_void(PL_compcv);
 			  (yyval.opval) = newANONATTRSUB((ps[-1].val.ival), 0, NULL, (ps[0].val.opval)); }
 
     break;
 
-  case 132:
-#line 873 "perly.y" /* yacc.c:1646  */
+  case 138:
+#line 910 "perly.y" /* yacc.c:1646  */
     { (yyval.opval) = newUNOP(OP_ENTERSUB, OPf_STACKED,
 				 op_append_elem(OP_LIST,
 				   op_prepend_elem(OP_LIST, (ps[-1].val.opval), (ps[0].val.opval)), (ps[-4].val.opval)));
@@ -1128,21 +1174,21 @@ case 2:
 
     break;
 
-  case 135:
-#line 888 "perly.y" /* yacc.c:1646  */
+  case 141:
+#line 925 "perly.y" /* yacc.c:1646  */
     { (yyval.opval) = newBINOP(OP_GELEM, 0, (ps[-4].val.opval), scalar((ps[-2].val.opval))); }
 
     break;
 
-  case 136:
-#line 890 "perly.y" /* yacc.c:1646  */
+  case 142:
+#line 927 "perly.y" /* yacc.c:1646  */
     { (yyval.opval) = newBINOP(OP_AELEM, 0, oopsAV((ps[-3].val.opval)), scalar((ps[-1].val.opval)));
 			}
 
     break;
 
-  case 137:
-#line 893 "perly.y" /* yacc.c:1646  */
+  case 143:
+#line 930 "perly.y" /* yacc.c:1646  */
     { (yyval.opval) = newBINOP(OP_AELEM, 0,
 					ref(newAVREF((ps[-4].val.opval)),OP_RV2AV),
 					scalar((ps[-1].val.opval)));
@@ -1150,8 +1196,8 @@ case 2:
 
     break;
 
-  case 138:
-#line 898 "perly.y" /* yacc.c:1646  */
+  case 144:
+#line 935 "perly.y" /* yacc.c:1646  */
     { (yyval.opval) = newBINOP(OP_AELEM, 0,
 					ref(newAVREF((ps[-3].val.opval)),OP_RV2AV),
 					scalar((ps[-1].val.opval)));
@@ -1159,31 +1205,31 @@ case 2:
 
     break;
 
-  case 139:
-#line 903 "perly.y" /* yacc.c:1646  */
+  case 145:
+#line 940 "perly.y" /* yacc.c:1646  */
     { (yyval.opval) = newBINOP(OP_HELEM, 0, oopsHV((ps[-4].val.opval)), jmaybe((ps[-2].val.opval)));
 			}
 
     break;
 
-  case 140:
-#line 906 "perly.y" /* yacc.c:1646  */
+  case 146:
+#line 943 "perly.y" /* yacc.c:1646  */
     { (yyval.opval) = newBINOP(OP_HELEM, 0,
 					ref(newHVREF((ps[-5].val.opval)),OP_RV2HV),
 					jmaybe((ps[-2].val.opval))); }
 
     break;
 
-  case 141:
-#line 910 "perly.y" /* yacc.c:1646  */
+  case 147:
+#line 947 "perly.y" /* yacc.c:1646  */
     { (yyval.opval) = newBINOP(OP_HELEM, 0,
 					ref(newHVREF((ps[-4].val.opval)),OP_RV2HV),
 					jmaybe((ps[-2].val.opval))); }
 
     break;
 
-  case 142:
-#line 914 "perly.y" /* yacc.c:1646  */
+  case 148:
+#line 951 "perly.y" /* yacc.c:1646  */
     { (yyval.opval) = newUNOP(OP_ENTERSUB, OPf_STACKED,
 				   newCVREF(0, scalar((ps[-3].val.opval))));
 			  if (parser->expect == XBLOCK)
@@ -1192,8 +1238,8 @@ case 2:
 
     break;
 
-  case 143:
-#line 920 "perly.y" /* yacc.c:1646  */
+  case 149:
+#line 957 "perly.y" /* yacc.c:1646  */
     { (yyval.opval) = newUNOP(OP_ENTERSUB, OPf_STACKED,
 				   op_append_elem(OP_LIST, (ps[-1].val.opval),
 				       newCVREF(0, scalar((ps[-4].val.opval)))));
@@ -1203,8 +1249,8 @@ case 2:
 
     break;
 
-  case 144:
-#line 928 "perly.y" /* yacc.c:1646  */
+  case 150:
+#line 965 "perly.y" /* yacc.c:1646  */
     { (yyval.opval) = newUNOP(OP_ENTERSUB, OPf_STACKED,
 				   op_append_elem(OP_LIST, (ps[-1].val.opval),
 					       newCVREF(0, scalar((ps[-3].val.opval)))));
@@ -1214,8 +1260,8 @@ case 2:
 
     break;
 
-  case 145:
-#line 935 "perly.y" /* yacc.c:1646  */
+  case 151:
+#line 972 "perly.y" /* yacc.c:1646  */
     { (yyval.opval) = newUNOP(OP_ENTERSUB, OPf_STACKED,
 				   newCVREF(0, scalar((ps[-2].val.opval))));
 			  if (parser->expect == XBLOCK)
@@ -1224,38 +1270,38 @@ case 2:
 
     break;
 
-  case 146:
-#line 941 "perly.y" /* yacc.c:1646  */
+  case 152:
+#line 978 "perly.y" /* yacc.c:1646  */
     { (yyval.opval) = newSLICEOP(0, (ps[-1].val.opval), (ps[-4].val.opval)); }
 
     break;
 
-  case 147:
-#line 943 "perly.y" /* yacc.c:1646  */
+  case 153:
+#line 980 "perly.y" /* yacc.c:1646  */
     { (yyval.opval) = newSLICEOP(0, (ps[-1].val.opval), (ps[-3].val.opval)); }
 
     break;
 
-  case 148:
-#line 945 "perly.y" /* yacc.c:1646  */
+  case 154:
+#line 982 "perly.y" /* yacc.c:1646  */
     { (yyval.opval) = newSLICEOP(0, (ps[-1].val.opval), NULL); }
 
     break;
 
-  case 149:
-#line 950 "perly.y" /* yacc.c:1646  */
+  case 155:
+#line 987 "perly.y" /* yacc.c:1646  */
     { (yyval.opval) = newASSIGNOP(OPf_STACKED, (ps[-2].val.opval), (ps[-1].val.ival), (ps[0].val.opval)); }
 
     break;
 
-  case 150:
-#line 952 "perly.y" /* yacc.c:1646  */
+  case 156:
+#line 989 "perly.y" /* yacc.c:1646  */
     { (yyval.opval) = newBINOP((ps[-1].val.ival), 0, scalar((ps[-2].val.opval)), scalar((ps[0].val.opval))); }
 
     break;
 
-  case 151:
-#line 954 "perly.y" /* yacc.c:1646  */
+  case 157:
+#line 991 "perly.y" /* yacc.c:1646  */
     {   if ((ps[-1].val.ival) != OP_REPEAT)
 				scalar((ps[-2].val.opval));
 			    (yyval.opval) = newBINOP((ps[-1].val.ival), 0, (ps[-2].val.opval), scalar((ps[0].val.opval)));
@@ -1263,112 +1309,112 @@ case 2:
 
     break;
 
-  case 152:
-#line 959 "perly.y" /* yacc.c:1646  */
+  case 158:
+#line 996 "perly.y" /* yacc.c:1646  */
     { (yyval.opval) = newBINOP((ps[-1].val.ival), 0, scalar((ps[-2].val.opval)), scalar((ps[0].val.opval))); }
 
     break;
 
-  case 153:
-#line 961 "perly.y" /* yacc.c:1646  */
+  case 159:
+#line 998 "perly.y" /* yacc.c:1646  */
     { (yyval.opval) = newBINOP((ps[-1].val.ival), 0, scalar((ps[-2].val.opval)), scalar((ps[0].val.opval))); }
 
     break;
 
-  case 154:
-#line 963 "perly.y" /* yacc.c:1646  */
+  case 160:
+#line 1000 "perly.y" /* yacc.c:1646  */
     { (yyval.opval) = newBINOP((ps[-1].val.ival), 0, scalar((ps[-2].val.opval)), scalar((ps[0].val.opval))); }
 
     break;
 
-  case 155:
-#line 965 "perly.y" /* yacc.c:1646  */
+  case 161:
+#line 1002 "perly.y" /* yacc.c:1646  */
     { (yyval.opval) = newBINOP((ps[-1].val.ival), 0, scalar((ps[-2].val.opval)), scalar((ps[0].val.opval))); }
 
     break;
 
-  case 156:
-#line 967 "perly.y" /* yacc.c:1646  */
+  case 162:
+#line 1004 "perly.y" /* yacc.c:1646  */
     { (yyval.opval) = newBINOP((ps[-1].val.ival), 0, scalar((ps[-2].val.opval)), scalar((ps[0].val.opval))); }
 
     break;
 
-  case 157:
-#line 969 "perly.y" /* yacc.c:1646  */
+  case 163:
+#line 1006 "perly.y" /* yacc.c:1646  */
     { (yyval.opval) = newBINOP((ps[-1].val.ival), 0, scalar((ps[-2].val.opval)), scalar((ps[0].val.opval))); }
 
     break;
 
-  case 158:
-#line 971 "perly.y" /* yacc.c:1646  */
+  case 164:
+#line 1008 "perly.y" /* yacc.c:1646  */
     { (yyval.opval) = newRANGE((ps[-1].val.ival), scalar((ps[-2].val.opval)), scalar((ps[0].val.opval))); }
 
     break;
 
-  case 159:
-#line 973 "perly.y" /* yacc.c:1646  */
+  case 165:
+#line 1010 "perly.y" /* yacc.c:1646  */
     { (yyval.opval) = newLOGOP(OP_AND, 0, (ps[-2].val.opval), (ps[0].val.opval)); }
 
     break;
 
-  case 160:
-#line 975 "perly.y" /* yacc.c:1646  */
+  case 166:
+#line 1012 "perly.y" /* yacc.c:1646  */
     { (yyval.opval) = newLOGOP(OP_OR, 0, (ps[-2].val.opval), (ps[0].val.opval)); }
 
     break;
 
-  case 161:
-#line 977 "perly.y" /* yacc.c:1646  */
+  case 167:
+#line 1014 "perly.y" /* yacc.c:1646  */
     { (yyval.opval) = newLOGOP(OP_DOR, 0, (ps[-2].val.opval), (ps[0].val.opval)); }
 
     break;
 
-  case 162:
-#line 979 "perly.y" /* yacc.c:1646  */
+  case 168:
+#line 1016 "perly.y" /* yacc.c:1646  */
     { (yyval.opval) = bind_match((ps[-1].val.ival), (ps[-2].val.opval), (ps[0].val.opval)); }
 
     break;
 
-  case 163:
-#line 984 "perly.y" /* yacc.c:1646  */
+  case 169:
+#line 1021 "perly.y" /* yacc.c:1646  */
     { (yyval.opval) = newUNOP(OP_NEGATE, 0, scalar((ps[0].val.opval))); }
 
     break;
 
-  case 164:
-#line 986 "perly.y" /* yacc.c:1646  */
+  case 170:
+#line 1023 "perly.y" /* yacc.c:1646  */
     { (yyval.opval) = (ps[0].val.opval); }
 
     break;
 
-  case 165:
-#line 989 "perly.y" /* yacc.c:1646  */
+  case 171:
+#line 1026 "perly.y" /* yacc.c:1646  */
     { (yyval.opval) = newUNOP(OP_NOT, 0, scalar((ps[0].val.opval))); }
 
     break;
 
-  case 166:
-#line 991 "perly.y" /* yacc.c:1646  */
+  case 172:
+#line 1028 "perly.y" /* yacc.c:1646  */
     { (yyval.opval) = newUNOP((ps[-1].val.ival), 0, scalar((ps[0].val.opval))); }
 
     break;
 
-  case 167:
-#line 993 "perly.y" /* yacc.c:1646  */
+  case 173:
+#line 1030 "perly.y" /* yacc.c:1646  */
     { (yyval.opval) = newUNOP(OP_POSTINC, 0,
 					op_lvalue(scalar((ps[-1].val.opval)), OP_POSTINC)); }
 
     break;
 
-  case 168:
-#line 996 "perly.y" /* yacc.c:1646  */
+  case 174:
+#line 1033 "perly.y" /* yacc.c:1646  */
     { (yyval.opval) = newUNOP(OP_POSTDEC, 0,
 					op_lvalue(scalar((ps[-1].val.opval)), OP_POSTDEC));}
 
     break;
 
-  case 169:
-#line 999 "perly.y" /* yacc.c:1646  */
+  case 175:
+#line 1036 "perly.y" /* yacc.c:1646  */
     { (yyval.opval) = op_convert_list(OP_JOIN, 0,
 				       op_append_elem(
 					OP_LIST,
@@ -1382,149 +1428,156 @@ case 2:
 
     break;
 
-  case 170:
-#line 1010 "perly.y" /* yacc.c:1646  */
+  case 176:
+#line 1047 "perly.y" /* yacc.c:1646  */
     { (yyval.opval) = newUNOP(OP_PREINC, 0,
 					op_lvalue(scalar((ps[0].val.opval)), OP_PREINC)); }
 
     break;
 
-  case 171:
-#line 1013 "perly.y" /* yacc.c:1646  */
+  case 177:
+#line 1050 "perly.y" /* yacc.c:1646  */
     { (yyval.opval) = newUNOP(OP_PREDEC, 0,
 					op_lvalue(scalar((ps[0].val.opval)), OP_PREDEC)); }
 
     break;
 
-  case 172:
-#line 1020 "perly.y" /* yacc.c:1646  */
+  case 178:
+#line 1057 "perly.y" /* yacc.c:1646  */
     { (yyval.opval) = newANONLIST((ps[-1].val.opval)); }
 
     break;
 
-  case 173:
-#line 1022 "perly.y" /* yacc.c:1646  */
+  case 179:
+#line 1059 "perly.y" /* yacc.c:1646  */
     { (yyval.opval) = newANONLIST(NULL);}
 
     break;
 
-  case 174:
-#line 1024 "perly.y" /* yacc.c:1646  */
+  case 180:
+#line 1061 "perly.y" /* yacc.c:1646  */
     { (yyval.opval) = newANONHASH((ps[-2].val.opval)); }
 
     break;
 
-  case 175:
-#line 1026 "perly.y" /* yacc.c:1646  */
+  case 181:
+#line 1063 "perly.y" /* yacc.c:1646  */
     { (yyval.opval) = newANONHASH(NULL); }
 
     break;
 
-  case 176:
-#line 1028 "perly.y" /* yacc.c:1646  */
+  case 182:
+#line 1065 "perly.y" /* yacc.c:1646  */
     { SvREFCNT_inc_simple_void(PL_compcv);
 			  (yyval.opval) = newANONATTRSUB((ps[-3].val.ival), (ps[-2].val.opval), (ps[-1].val.opval), (ps[0].val.opval)); }
 
     break;
 
-  case 177:
-#line 1034 "perly.y" /* yacc.c:1646  */
+  case 183:
+#line 1068 "perly.y" /* yacc.c:1646  */
+    { SvREFCNT_inc_simple_void(PL_compcv);
+			  (yyval.opval) = newANONATTRSUB((ps[-2].val.ival), NULL, (ps[-1].val.opval), (ps[0].val.opval)); }
+
+    break;
+
+  case 184:
+#line 1074 "perly.y" /* yacc.c:1646  */
     { (yyval.opval) = dofile((ps[0].val.opval), (ps[-1].val.ival));}
 
     break;
 
-  case 178:
-#line 1036 "perly.y" /* yacc.c:1646  */
+  case 185:
+#line 1076 "perly.y" /* yacc.c:1646  */
     { (yyval.opval) = newUNOP(OP_NULL, OPf_SPECIAL, op_scope((ps[0].val.opval)));}
 
     break;
 
-  case 183:
-#line 1044 "perly.y" /* yacc.c:1646  */
+  case 190:
+#line 1084 "perly.y" /* yacc.c:1646  */
     { (yyval.opval) = newCONDOP(0, (ps[-4].val.opval), (ps[-2].val.opval), (ps[0].val.opval)); }
 
     break;
 
-  case 184:
-#line 1046 "perly.y" /* yacc.c:1646  */
+  case 191:
+#line 1086 "perly.y" /* yacc.c:1646  */
     { (yyval.opval) = newUNOP(OP_REFGEN, 0, (ps[0].val.opval)); }
 
     break;
 
-  case 185:
-#line 1048 "perly.y" /* yacc.c:1646  */
+  case 192:
+#line 1088 "perly.y" /* yacc.c:1646  */
     { (yyval.opval) = newUNOP(OP_REFGEN, 0, localize((ps[0].val.opval),1)); }
 
     break;
 
-  case 186:
-#line 1050 "perly.y" /* yacc.c:1646  */
+  case 193:
+#line 1090 "perly.y" /* yacc.c:1646  */
     { (yyval.opval) = (ps[0].val.opval); }
 
     break;
 
-  case 187:
-#line 1052 "perly.y" /* yacc.c:1646  */
+  case 194:
+#line 1092 "perly.y" /* yacc.c:1646  */
     { (yyval.opval) = localize((ps[0].val.opval),0); }
 
     break;
 
-  case 188:
-#line 1054 "perly.y" /* yacc.c:1646  */
+  case 195:
+#line 1094 "perly.y" /* yacc.c:1646  */
     { (yyval.opval) = sawparens((ps[-1].val.opval)); }
 
     break;
 
-  case 189:
-#line 1056 "perly.y" /* yacc.c:1646  */
+  case 196:
+#line 1096 "perly.y" /* yacc.c:1646  */
     { (yyval.opval) = (ps[0].val.opval); }
 
     break;
 
-  case 190:
-#line 1058 "perly.y" /* yacc.c:1646  */
+  case 197:
+#line 1098 "perly.y" /* yacc.c:1646  */
     { (yyval.opval) = sawparens(newNULLLIST()); }
 
     break;
 
-  case 191:
-#line 1060 "perly.y" /* yacc.c:1646  */
+  case 198:
+#line 1100 "perly.y" /* yacc.c:1646  */
     { (yyval.opval) = (ps[0].val.opval); }
 
     break;
 
-  case 192:
-#line 1062 "perly.y" /* yacc.c:1646  */
+  case 199:
+#line 1102 "perly.y" /* yacc.c:1646  */
     { (yyval.opval) = (ps[0].val.opval); }
 
     break;
 
-  case 193:
-#line 1064 "perly.y" /* yacc.c:1646  */
+  case 200:
+#line 1104 "perly.y" /* yacc.c:1646  */
     { (yyval.opval) = (ps[0].val.opval); }
 
     break;
 
-  case 194:
-#line 1066 "perly.y" /* yacc.c:1646  */
+  case 201:
+#line 1106 "perly.y" /* yacc.c:1646  */
     { (yyval.opval) = (ps[0].val.opval); }
 
     break;
 
-  case 195:
-#line 1068 "perly.y" /* yacc.c:1646  */
+  case 202:
+#line 1108 "perly.y" /* yacc.c:1646  */
     { (yyval.opval) = newUNOP(OP_AV2ARYLEN, 0, ref((ps[0].val.opval), OP_AV2ARYLEN));}
 
     break;
 
-  case 196:
-#line 1070 "perly.y" /* yacc.c:1646  */
+  case 203:
+#line 1110 "perly.y" /* yacc.c:1646  */
     { (yyval.opval) = (ps[0].val.opval); }
 
     break;
 
-  case 197:
-#line 1072 "perly.y" /* yacc.c:1646  */
+  case 204:
+#line 1112 "perly.y" /* yacc.c:1646  */
     { (yyval.opval) = op_prepend_elem(OP_ASLICE,
 				newOP(OP_PUSHMARK, 0),
 				    newLISTOP(OP_ASLICE, 0,
@@ -1537,8 +1590,8 @@ case 2:
 
     break;
 
-  case 198:
-#line 1082 "perly.y" /* yacc.c:1646  */
+  case 205:
+#line 1122 "perly.y" /* yacc.c:1646  */
     { (yyval.opval) = op_prepend_elem(OP_KVASLICE,
 				newOP(OP_PUSHMARK, 0),
 				    newLISTOP(OP_KVASLICE, 0,
@@ -1551,8 +1604,8 @@ case 2:
 
     break;
 
-  case 199:
-#line 1092 "perly.y" /* yacc.c:1646  */
+  case 206:
+#line 1132 "perly.y" /* yacc.c:1646  */
     { (yyval.opval) = op_prepend_elem(OP_HSLICE,
 				newOP(OP_PUSHMARK, 0),
 				    newLISTOP(OP_HSLICE, 0,
@@ -1565,8 +1618,8 @@ case 2:
 
     break;
 
-  case 200:
-#line 1102 "perly.y" /* yacc.c:1646  */
+  case 207:
+#line 1142 "perly.y" /* yacc.c:1646  */
     { (yyval.opval) = op_prepend_elem(OP_KVHSLICE,
 				newOP(OP_PUSHMARK, 0),
 				    newLISTOP(OP_KVHSLICE, 0,
@@ -1579,27 +1632,27 @@ case 2:
 
     break;
 
... 3073 lines suppressed ...

-- 
Perl5 Master Repository



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