I don't know if this case has been requested yet so sorry for the noise if
it has.
It would be nice if this code:
100.times | i |
puts i
end
.... reported that the "do" is missing on line 1 rather than saying syntax
error on line 2. The error can be difficult to find when you have nested
loops and much intervening code.
This would indeed be nice, because I catch myself making this error also often. Somehow the do seems superfluent. But I don't think it would be possible to detect this always, because the | are parsed as bitwise or's, so there is only a superfluous end. The proposed indentation heuristic would give a correct result. So the missing end patch would help here.
(If I remember the thread correctly)
Regards,
Brian
···
On Tue, 30 Nov 2004 03:17:57 +0900 "DaZoner" <bugmenot@world.com> wrote:
I don't know if this case has been requested yet so sorry for the noise if
it has.
It would be nice if this code:
100.times | i |
puts i
end
.... reported that the "do" is missing on line 1 rather than saying syntax
error on line 2. The error can be difficult to find when you have nested
loops and much intervening code.