From: Just Another Victim of the Ambient Morality Date: 2006-08-18T15:50:03+09:00 Subject: Re: Syntax checker wtf? "Firstname Surname" wrote in message news:80ebfecc5915f6feffed6fa20fde07e8@example.com... > I'm new to Ruby and RoR; I was messing around with it today and had > trouble with error codes. Specifically, the ruby syntax checker > frequently spits out 'syntax error' with the last line of the code as > the error line (the error is nowhere near the last line). This happens > with missing chars, extra ., all sorts of minor syntax errors, not just > missing 'end's. I found myself copy and pasting functions, checking, > then pasting again to find the error, which is pretty ridiculous. > > This is something I'd expect in a pre 1.0 compiler, but ruby is at > 1.8.4; is the > ruby syntax checker just really primitive? > This isn't very user friendly, especially for a newbie, is there a more > precise syntax checker that can actually point closer to the error line > # a > high % of the time? While I'm a newbie myself, I'm willing to guess that there's little you can do about this problem except to try to relax and be a little more careful with your code. To be honest, I really don't think this problem is particularly bad in Ruby. I don't know exactly what kind of errors you're making (and perhaps you can elaborate some more on that) but even the latest Microsoft C++ compiler often gives less than helpful clues on the source of the problem, or even it's location! Brace mismatching and quote mismatching are two errors that neither parsers can nail down to your satisfaction and I get the sense that these constitute the majority of your problems (again, please elaborate on this). The former can be alleviated by proper indentation and the latter can be totally eliminated by syntax highlighting, although I don't use this technique myself (since I'm a lazy gvim user).