From: Mike Cargal Date: 2006-08-20T01:28:32+09:00 Subject: Re: Syntax checker wtf? Ever wonder why so many languages have explicit statement termination characters (frequently ";")? This is one of the main reasons. I wrote a scripting language myself and, in the process, realized I could write a perfectly good grammar without those statement termination characters. As we started using it though, we started encountering many situations like you describe. When something is left out, the parser just keeps looking, and looking, and looking, trying to make sense of the input stream, and eventually runs out of input and has to report an error at the current location (EOF). However, as soon as a added a ";" to the grammar as a statement termination, the parser had better places to stop trying to make sense of the input stream. (If it encountered a ";" and did not have a valid statement, it could report the error, then and there, reset it's state and continue parsing.) So, IMHO, the primary cause is the absence of those pesky statement terminators. 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? > > > Cheers, > Newb > >