Re: Syntax checker wtf?
- From: Robert Klemme <shortcutter@xxxxxxxxxxxxxx>
- Date: Fri, 18 Aug 2006 17:07:58 +0200
Daniel Martin wrote:
Robert Klemme <shortcutter@xxxxxxxxxxxxxx> 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
.
- Follow-Ups:
- Re: Syntax checker wtf?
- From: inboulder
- Re: Syntax checker wtf?
- From: James Edward Gray II
- Re: Syntax checker wtf?
- References:
- Syntax checker wtf?
- From: Firstname Surname
- Re: Syntax checker wtf?
- From: Robert Klemme
- Re: Syntax checker wtf?
- From: Daniel Martin
- Syntax checker wtf?
- Prev by Date: Re: DateBocks v2.0.0 Released
- Next by Date: Re: noob rails question
- Previous by thread: Re: Syntax checker wtf?
- Next by thread: Re: Syntax checker wtf?
- Index(es):
Relevant Pages
|