RE: Confusing error message in case of layout-related syntax erro r

1999-09-03 Thread Manuel M. T. Chakravarty

Simon Marlow <[EMAIL PROTECTED]> wrote,

> > For 
> > 
> >   foo = let
> >   x = (1, 2
> >   y = 3
> > in
> > fst x + y
> > 
> > GHC 4.04 gives me
> > 
> >   Main.hs:3: parse error on input `'
> > 
> > Interesting, but not very informative ;-)
> 
> I know about this one, but haven't got around to fixing it yet.  The parse
> error is on a semicolon generated by the layout system, as you probably
> guessed, which is why there's no token available to print in the error
> message.  Any thoughts on what a suitable error message should be?  I'd
> thought something along the lines of
> 
>   Main.hs:3: parse error on input ';' (inserted by layout)

That's the right error message for me, but I guess a newbie
will still be confused.  How about tagging on one of the
`probable cause' message - something along the lines of

  Incomplete expression on previous line or incorrect
  indentation of the current line.

Cheers,
Manuel



Re: Confusing error message in case of layout-related syntax erro r

1999-09-02 Thread Mark Utting

Simon wrote:
> I know about this one, but haven't got around to fixing it yet.  The parse
> error is on a semicolon generated by the layout system, as you probably
> guessed, which is why there's no token available to print in the error
> message.  Any thoughts on what a suitable error message should be?  I'd
> thought something along the lines of
> 
>   Main.hs:3: parse error on input ';' (inserted by layout)

My students find this kind of error message (Hugs says "unexpected ';'")
the most confusing and frustrating thing in all of Haskelldom.

If you know that the (virtual) semicolon has been inserted by
layout, how about a message like:

Main.hs:3: indentation error
or
Main.hs:3: incorrect indentation
or
Main.hs:3: parse error due to incorrect indentation

(I think the term "indentation" means more to them than "layout",
 but there might be good reasons to say "layout error" instead).

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 3105Fax:   +64 7 838 4155
HamiltonEmail: [EMAIL PROTECTED]
New Zealand Web:   http://www.cs.waikato.ac.nz/~marku



RE: Confusing error message in case of layout-related syntax erro r

1999-09-02 Thread Simon Marlow

> For 
> 
>   foo = let
> x = (1, 2
> y = 3
>   in
>   fst x + y
> 
> GHC 4.04 gives me
> 
>   Main.hs:3: parse error on input `'
> 
> Interesting, but not very informative ;-)

I know about this one, but haven't got around to fixing it yet.  The parse
error is on a semicolon generated by the layout system, as you probably
guessed, which is why there's no token available to print in the error
message.  Any thoughts on what a suitable error message should be?  I'd
thought something along the lines of

Main.hs:3: parse error on input ';' (inserted by layout)

re: the multi-line string literals, this one should be easier to fix.  I'll
take a look at it today.

Cheers,
Simon