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
authorZefram <zefram@fysh.org>
Thu, 14 Oct 2010 00:52:59 +0000 (01:52 +0100)
committerFather Chrysostomos <sprout@cpan.org>
Thu, 21 Oct 2010 12:53:25 +0000 (05:53 -0700)
commita7aaec61655ef1580eb319cf234db0f3d5c9981e
tree5897e4d98914cd94069fa936eb35f577d8d61c6e
parent640d5d412e67683edc19515df4462d7bb4739ae2
handle bracket stack better in recdescent parsing

When recursing into the parser for recursive-descent parsing, put
a special entry on the bracket stack that generates a fake EOF if a
closing bracket belonging to an outer parser frame is seen.  This keeps
the bracket stack balanced across a parse_stmtseq() frame, fixing
[perl #78222].

If a recursive-descent parser frame ends by yyunlex()ing an opening
bracket, pop its entry off the bracket stack and stash it in the
forced-token queue, to be revived when the token is re-lexed.  This keeps
the bracket stack balanced across a parse_fullstmt() frame.
MANIFEST
ext/XS-APItest/APItest.pm
ext/XS-APItest/APItest.xs
ext/XS-APItest/t/looprest.t
ext/XS-APItest/t/scopelessblock.t [new file with mode: 0644]
ext/XS-APItest/t/swaptwostmts.t
perly.act
perly.tab
perly.y
toke.c