From: Robert Klemme Date: 2006-08-19T00:10:13+09:00 Subject: Re: Syntax checker wtf? Daniel Martin wrote: > Robert Klemme writes: > >> 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 note that perl has a similarly flexible syntax, I don't think so. For example, you must terminate statements with a ";" (or did that change in the latest version?) and you cannot omit parentheses. That makes up for a significant difference in flexibility of the two languages. > yet I don't hear > people new to perl complaining about this. Perhaps this is because > perl has more to complain about, from a newbie perspective, but I > think it's also because perl gives better syntax error messages. For > example, if you get a runaway unclosed string or regexp (//) operator, > the perl interpreter will, in the syntax error, also say something > like "possible runaway string beginning line NN". I know that perl does this and I liked that at the time when I used perl. But: > This seems to me like it would be a simple addition to the ruby > parser, to mention the line number of the thing it's trying to close > when expecting tEND, or ']', or some other nested thing that can go > off the end of the file. IMHO you're greatly underestimating the effor. I guess even for perl it was not "a simple addition" - and from what I can see a lot more efforts were put into perl vs. ruby. Kind regards robert