develooper Front page | perl.perl5.porters | Postings from January 2018

Re: [perl #132760] Blead Breaks CPAN: YANICK/List-Lazy-0.3.0.tar.gz

Thread Previous | Thread Next
From:
Zefram
Date:
January 28, 2018 11:37
Subject:
Re: [perl #132760] Blead Breaks CPAN: YANICK/List-Lazy-0.3.0.tar.gz
Message ID:
20180128113711.GE22873@fysh.org
slaven@rezic.de wrote:
>Array found where operator expected at /home/eserte/.cpan/build/2018012418/List-Lazy-0.3.0-2/blib/lib/List/Lazy.pm line 43, near "$$@)"
>	(Missing operator before @)?)

Mm, that's not nice.  The real error is the third one emitted:

>syntax error at /home/eserte/.cpan/build/2018012418/List-Lazy-0.3.0-2/blib/lib/List/Lazy.pm line 36, near ") :"

I'd be satisfied if the real error at least were the first one emitted.
It is not surprising that other errors arise following the syntax error,
but it is annoying that they would be emitted earlier.  It is also
potentially misleading that the first one emitted is actually concerned
with a different sub from the one that incurs the real first error.
Clearly there's an interaction here between parser error recovery and
the statefulness of the tokeniser.

Simpler cases also emit the error messages in the wrong order, even if
not as wildly off track as in the module:

$ perl5.27.8 -Mexperimental=signatures -lwe 'sub foo ($a) :prototype($$@) {}'
Array found where operator expected at -e line 1, near "$$@)"
        (Missing operator before @)?)
	syntax error at -e line 1, near ") :"
	Execution of -e aborted due to compilation errors.

-zefram

Thread Previous | Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About