Branch: refs/heads/yves/stop_first_error Home: https://github.com/Perl/perl5 Commit: 9cbc685abed04e4bf42a204684876c9955ef2479 https://github.com/Perl/perl5/commit/9cbc685abed04e4bf42a204684876c9955ef2479 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/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 and will produce sometimes completely bizarre errors which just obscure the actual error most of the time. 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.