What to use for finding as many syntax errors as possible.

Cameron Simpson cs at cskk.id.au
Mon Oct 10 02:33:47 EDT 2022


On 10Oct2022 00:41, avi.e.gross at gmail.com <avi.e.gross at gmail.com> wrote:
>Your suggestion makes me shudder!

And fair enough too. I don't do this for me, I'm just suggesting an 
approach which might bring something to Antoon's objective.

>Removing all earlier lines of code is often guaranteed to generate errors as
>variables you are using are not declared or initiated, modules are not
>imported and so on.

Antoon's interested in syntax errors.

>Removing just the line or three where the previous error happened would also
>have a good chance of invalidating something.

Doubtless. He accepts that any such resume-the-parse can bring 
misleading error messages. Antoon is not expecting magic, just getting 
several complaints instead of just the first syntax error.

I must admit I sympathise a bit, as one of my own major irks is command 
line tools which moan about the first bad option instead of noting it 
and moving on to complain about other things as well, then quitting 
after the command line parse. Pure laziness a lot of the time IMO; I've 
done it myself, but do like to make multiple complaints when it's 
feasible.

Cheers,
Cameron Simpson <cs at cskk.id.au>


More information about the Python-list mailing list