[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: problems with some 'End' marks


Le 29/03/2025 à 03:05, BB a écrit :
WHY WAS THIS DONE!

Are we turning into python now?

Whitespace has hitherto meant nothing.

unhappy as I occassionally want to indent whole methods to make them stand out in the editor/printout.🙁

b


I done that to prevent an annoying mistake: if someone writes "End" instead of "End If" by mistake, the compiler emits errors hard to understand.

It took me a lot of minutes to find the problem in a small function written by someone else.

As "End" alone is only a keyword used for closing functions, and as functions cannot be nested, I chose to raise an error if the compiler sees "End" not at the beginning of the line.

I couldn't imagine that someone will indent a whole function for any reason!

Maybe I can replace that error by a warning? Or better take the entire indent into account and detect indent mismatch (beginning and end of function not with the same indent)?

--
Benoît Minisini.


Follow-Ups:
Re: problems with some 'End' marksBB <adamnt42@xxxxxxxxx>
Re: problems with some 'End' marksJussi Lahtinen <jussi.lahtinen@xxxxxxxxx>
Re: problems with some 'End' marksFabien Bodard <gambas.fr@xxxxxxxxx>
References:
problems with some 'End' marksCharlie Reinl <Karl.Reinl@xxxxxxxxxx>
Re: problems with some 'End' marksBruce Steers <bsteers4@xxxxxxxxx>
Re: problems with some 'End' marksBruce Steers <bsteers4@xxxxxxxxx>
Re: problems with some 'End' marksBB <adamnt42@xxxxxxxxx>