summaryrefslogtreecommitdiff
path: root/perly.y
diff options
context:
space:
mode:
authorZefram <zefram@fysh.org>2010-10-14 17:02:36 +0100
committerFather Chrysostomos <sprout@cpan.org>2010-10-21 05:53:50 -0700
commit9eb5c532bf567fdd066254fcaacf4a66722714c5 (patch)
tree518311ad05d028dab7c1ef9be5bddfb43083e951 /perly.y
parent1e2159890b8bf881fbc717f671f87ba2dec1da46 (diff)
downloadperl-9eb5c532bf567fdd066254fcaacf4a66722714c5.tar.gz
fix and test PL_expect in recdescent parsing
Set PL_expect at the start of parse_fullstmt() as well as at the start of parse_stmtseq(). Test both.
Diffstat (limited to 'perly.y')
-rw-r--r--perly.y8
1 files changed, 6 insertions, 2 deletions
diff --git a/perly.y b/perly.y
index cc27ee295a..2b34f7d782 100644
--- a/perly.y
+++ b/perly.y
@@ -143,9 +143,13 @@
/* 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;