From 9eb5c532bf567fdd066254fcaacf4a66722714c5 Mon Sep 17 00:00:00 2001 From: Zefram Date: Thu, 14 Oct 2010 17:02:36 +0100 Subject: 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. --- perly.y | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'perly.y') 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; -- cgit v1.2.1