This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
handle bracket stack better in recdescent parsing
[perl5.git] / perly.y
diff --git a/perly.y b/perly.y
index da7bcb0..cc27ee2 100644 (file)
--- a/perly.y
+++ b/perly.y
@@ -89,7 +89,7 @@
 
 %type <i_tkval> lpar_or_qw
 
-%type <ival> grammar closebrace_or_eof prog progstart remember mremember
+%type <ival> grammar prog progstart remember mremember
 %type <ival>  startsub startanonsub startformsub
 /* FIXME for MAD - are these two ival? */
 %type <ival> mydefsv mintro
@@ -154,29 +154,13 @@ grammar   :       GRAMPROG prog
                        {
                          parser->expect = XSTATE;
                        }
-               lineseq closebrace_or_eof
+               lineseq
                        {
                          PL_eval_root = $3;
                          $$ = 0;
                        }
        ;
 
-closebrace_or_eof:     '}'
-                       {
-                         assert(parser->yychar == YYEMPTY);
-                         assert(parser->bufptr != SvPVX(parser->linestr));
-                         assert(parser->bufptr[-1] == '}');
-                         parser->bufptr--;
-                         parser->lex_brackstack[parser->lex_brackets++] =
-                             XSTATE;
-                         parser->expect = XSTATE;
-                         parser->yychar = YYEOF;
-                         $$ = 0;
-                       }
-       | /* NULL */
-                       { $$ = 0; }
-       ;
-
 /* The whole program */
 prog   :       progstart
        /*CONTINUED*/   lineseq