Olaf Chitil wrote:
> Hugs 1.4 produces some error messages which are hard to understand but, I 
> believe, could be easily improved. Maybe you can make Hugs 98 produce better
> ones.
> 
> The following two error messages always baffle students. They think they
> discovered a bug in Hugs (people are used to buggy software ;-)
> 
> 1. The script
> 
> f x = x +
> 1
> 
> leads to
> 
> ERROR "Test.hs" (line 4): Syntax error in expression (unexpected `;')
> 
> And no `;' anywhere... ;-)

Yes, my students hate this message with a passion!
(For one student, this problem was enough to put Haskell on
his 'top ten hates' list).

> Well, I know that to parse the offside-rule with yacc the lexer inserts `;' a
>   nd
> braces where they are missing. However, couldn't the lexer insert some other
> token which is treated by the parser like `;' but would give a different erro
>   r
> message?

That sounds like a great improvement.
Even if the message just said "Unexpected ';' or wrong indentation", that
would be an improvement.

Mark.

Dr Mark Utting, Senior Lecturer
Department of Computer Science
School of Computing and Mathematical Sciences
The University of Waikato       Tel:   +64 7 838 4791
Private Bag 3105                Fax:   +64 7 838 4155
Hamilton                        Email: [EMAIL PROTECTED]
New Zealand                     Web:   http://www.cs.waikato.ac.nz/~marku

The highest bandwidth output from a human is the notes pouring
from a concert pianist's fingers.

Reply via email to