From: Robert Klemme Date: 2006-08-18T15:25:11+09:00 Subject: Re: Syntax checker wtf? Firstname Surname wrote: > 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? I *think* this is at least partly due to Ruby's convenient and very flexible syntax. IOW, the parser has no means to detect the error line as it could be in several places - likely too many to report. Also, this is how parsers work. From my limited insight into the parser generation business it would require a) a different parser generator that is much smarter or b) a lot of effort that it's not worth IMHO. I'll have to add that this is rarely an issue for me. Maybe you should use an editor with automatic bracket closing and "end" insertion. Kind regards robert