>> What would be even better would be to allow optional labels after end
>> statements, such as "end class", "end def", so the parser can catch
>> more errors.

That sound like a good idea. But what about "if", "when", "for",
"until" etc?
Hmm...
"endif", "end when", "end for", "end until", "end class", "enddef",...
Umh! A never "ended" nightmare.