This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
fix and test PL_expect in recdescent parsing
[perl5.git] / perly.y
diff --git a/perly.y b/perly.y
index cc27ee2..2b34f7d 100644 (file)
--- a/perly.y
+++ b/perly.y
 /* Top-level choice of what kind of thing yyparse was called to parse */
 grammar        :       GRAMPROG prog
                        { $$ = $2; }
-       |       GRAMFULLSTMT fullstmt
+       |       GRAMFULLSTMT
                        {
-                         PL_eval_root = $2;
+                         parser->expect = XSTATE;
+                       }
+               fullstmt
+                       {
+                         PL_eval_root = $3;
                          $$ = 0;
                          yyunlex();
                          parser->yychar = YYEOF;