This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Don’t use yyerror for each($scalar) experiment err
authorFather Chrysostomos <sprout@cpan.org>
Fri, 3 Jun 2016 05:10:04 +0000 (22:10 -0700)
committerFather Chrysostomos <sprout@cpan.org>
Fri, 3 Jun 2016 05:37:36 +0000 (22:37 -0700)
commit198aaf386565cec44720e3fd597a6534d97017f5
tree9ba00a6ddacaca355a9057d71548de8e4034dd22
parentef55c6737a667b6853720247c181a0cbfbbe6116
Don’t use yyerror for each($scalar) experiment err

This is a follow-up to 69e7f50e50.  69e7f50e50 resulted in yyerror
being called twice for the same error, resulting in double diagnos-
tics for where the error occurred:

$ ./perl -e 'keys $scalar, $1'
Experimental keys on scalar is now forbidden at -e line 1, near "$scalar,"
Type of arg 1 to keys must be hash or array (not scalar dereference) at -e line 1, near "$scalar,"
Execution of -e aborted due to compilation errors.

We don’t need ‘near "$scalar,"’ twice.

For the first one we should queue the error directly, using qerror()
(which yyerror itself normally calls), so we don’t get double
diagnostics.
op.c
t/op/smartkve.t