This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Merge branch 'perlgov-omnibus-amendments' into blead
[perl5.git] / perly.y
diff --git a/perly.y b/perly.y
index 184fb0c..18ed6e8 100644 (file)
--- a/perly.y
+++ b/perly.y
@@ -77,6 +77,7 @@
 %token <ival> LOCAL MY REQUIRE
 %token <ival> COLONATTR FORMLBRACK FORMRBRACK
 %token <ival> SUBLEXSTART SUBLEXEND
+%token <ival> DEFER
 
 %type <ival> grammar remember mremember
 %type <ival>  startsub startanonsub startformsub
@@ -468,6 +469,7 @@ barestmt:   PLUGSTMT
                        {
                          $$ = newTRYCATCHOP(0,
                                  $try, $scalar, block_end($remember, op_scope($catch)));
+                         parser->copline = (line_t)$TRY;
                        }
        |       block cont
                        {
@@ -494,6 +496,10 @@ barestmt:  PLUGSTMT
                        {
                          $$ = $sideff;
                        }
+       |       DEFER mblock
+                       {
+                         $$ = newDEFEROP(0, op_scope($2));
+                       }
        |       YADAYADA PERLY_SEMICOLON
                        {
                          $$ = newLISTOP(OP_DIE, 0, newOP(OP_PUSHMARK, 0),