This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
The docs for SvRX and SvRXOK still refered to magic and the code snippet
[perl5.git] / perly.y
diff --git a/perly.y b/perly.y
index 7407b21..bf51922 100644 (file)
--- a/perly.y
+++ b/perly.y
@@ -89,7 +89,7 @@
 
 %type <i_tkval> lpar_or_qw
 
-%type <ival> grammar prog progstart remember mremember
+%type <ival> grammar remember mremember
 %type <ival>  startsub startanonsub startformsub
 /* FIXME for MAD - are these two ival? */
 %type <ival> mydefsv mintro
 %% /* RULES */
 
 /* Top-level choice of what kind of thing yyparse was called to parse */
-grammar        :       GRAMPROG prog
-                       { $$ = $2; }
+grammar        :       GRAMPROG
+                       {
+                         PL_parser->expect = XSTATE;
+                       }
+               remember stmtseq
+                       {
+                         newPROG(block_end($3,$4));
+                         $$ = 0;
+                       }
        |       GRAMBLOCK
                        {
                          parser->expect = XBLOCK;
@@ -188,12 +195,6 @@ grammar    :       GRAMPROG prog
                        }
        ;
 
-/* The whole program */
-prog   :       progstart
-       /*CONTINUED*/   stmtseq
-                       { $$ = $1; newPROG(block_end($1,$2)); }
-       ;
-
 /* An ordinary block */
 block  :       '{' remember stmtseq '}'
                        { if (PL_parser->copline > (line_t)IVAL($1))
@@ -212,13 +213,6 @@ mydefsv:   /* NULL */      /* lexicalize $_ */
                        { $$ = (I32) Perl_allocmy(aTHX_ STR_WITH_LEN("$_"), 0); }
        ;
 
-progstart:
-               {
-                   PL_parser->expect = XSTATE; $$ = block_start(TRUE);
-               }
-       ;
-
-
 mblock :       '{' mremember stmtseq '}'
                        { if (PL_parser->copline > (line_t)IVAL($1))
                              PL_parser->copline = (line_t)IVAL($1);
@@ -448,7 +442,6 @@ barestmt:   PLUGSTMT
                          /* a block is a loop that happens once */
                          $$ = newWHILEOP(0, 1, (LOOP*)(OP*)NULL,
                                  (OP*)NULL, $1, $2, 0);
-                         PL_parser->copline = NOLINE;
                        }
        |       PACKAGE WORD WORD '{' remember
                        {