Branch: refs/heads/yves/stop_first_error Home: https://github.com/Perl/perl5 Commit: a948189a1c9ad7a4e4ca21e418217b9e4d7d90c4 https://github.com/Perl/perl5/commit/a948189a1c9ad7a4e4ca21e418217b9e4d7d90c4 Author: Yves Orton <demer...@gmail.com> Date: 2022-09-05 (Mon, 05 Sep 2022)
Changed paths: M embed.fnc M perl.c M perl.h M pod/perldelta.pod M pod/perldiag.pod M pp_ctl.c M proto.h 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: ----------- 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 as the internal state of the parser can get confused and is not reliably restored in between attempts. This can produce sometimes completely bizarre errors which just obscure the true error, and has resulted in security tickets being filed in the past. 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 of true syntax errors, we can iterate on that in the future.