On Tue, Apr 19, 2005 at 04:26:28PM -0500, David Nicol wrote:
> could we extend the bit of code that gets quoted when a parsing
> failure is thrown
> to include the whole expression under consideration at the time rather than 
> the
> last few tokens when things get impossible?
> 
> The confusing situation occurs when there are a whole bunch of tokens
> preceding a normal if(expr){   what happens is, the error is reported as being
> near '){' when it is not.


It's not? Placing a a semi-colon between the ')' and '{' makes it
valid syntax. Putting a ';' after 'comment', or placing a '#' before
'poorly' also make it syntax, but it will be a bit hard to guess which
of the three mistakes the programmer made.

> eval <<'CONFUSING'; print $@;
> # good comment
> poorly formatted comment
> if($expr){
>       print "true";
> };
> 
> CONFUSING
> 
> __END__


Abigail

Attachment: pgpIeiWM2L9DW.pgp
Description: PGP signature

Reply via email to