Branch: refs/heads/yves/stop_first_error Home: https://github.com/Perl/perl5 Commit: 2895300131c8b1a572535a7231f0570a033a27d6 https://github.com/Perl/perl5/commit/2895300131c8b1a572535a7231f0570a033a27d6 Author: Yves Orton <demer...@gmail.com> Date: 2022-08-26 (Fri, 26 Aug 2022)
Changed paths: M embed.fnc M perl.c M perl.h M pod/perldiag.pod M pp_ctl.c M proto.h M t/comp/retainedlines.t M t/lib/croak/toke M t/lib/subs/subs M t/lib/warnings/7fatal M t/lib/warnings/toke M t/op/lex.t M t/op/tie.t M t/run/fresh_perl.t M toke.c Log Message: ----------- DRAFT: Stop parsing on first syntax error. We try to keep parsing after many types of errors, up to a (current) maximum of 10 errors. Continuing after a semantic error (like undeclared variables) can be helpful, for instance showing a set of common errors, but continuing after a syntax error isn't helpful most of the time and will produce sometimes completely bizarre errors which just obscures the actual error. This patch makes the parser stop after the first syntax error, while preserving the current behavior for other errors. An error is considered a syntax error if the error message from our internals is the literal text "syntax error". This may not be a complete list. This patch will fail test in t/comp/retainedlines.t but what that file tries to testis already buggy, this change just exposes the bug inside of the tests that retainedlines.t runs where it used to not to tickle the bug. More details can be found in GH Issue #20161.