This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
(perl #130585) prevent a spurious ) in a subparse confusing the parser
When doing a subparse, the tokenizer opens up the subexpression
with a '(' token, expecting the logic in yylex() to generate a ')'
once it sees the end of the subparsed string.
If the subparsed string includes an unmatched ')', this could confuse
the parser into finishing the expression and effectively exiting the
subparse without cleaning up (including popping the context)
To avoid that, create special bracketing tokens only generated for
a subparse and update the grammar to use those tokens in the cases
they might be used in a subparse.
This is an updated version of the patch that moves the FUNC rule
to where the original rule was and adds a test for non-regexp
subparses.