[EMAIL PROTECTED] (Kevin Hammond) writes:

> >There are two options: either
> >
> >        a) only the inner scope can generate tokens, or
> >        b) a new scope must be more indented than the previous one
> >
> >obviously b) implies a).  I implemented a) in the Happy Haskell Parser.
> 
> I don't see how (a) alone is consistent with the report.

You're right: it isn't.  I was proposing it as a fix.  Actually I
think I'm more in favour of option b), since a) alone is harder to
implement properly.  This would have the nice property that I wouldn't
have to fix GHC :-)

> If a token appears
> below a layout initiator, then a semicolon *must* be inserted to match the list
> started by an initiator (unless layout processing is turned off by an
> explicit '{').  This may involve closing inner scopes.  That implies (b) surely?

Ah - I see now.  You're saying that the semicolon causes a syntax
error and hence closes the 'case' scope.  That's correct - however I
usually assume that empty statements/case branches are allowed.
Perhaps this should be proposed for Standard Haskell.

> Suspending isn't quite the right thing to do -- you wouldn't want to turn
> off processing for columns to the left, could give odd results in some
> strange error situations!!
> 
>         (a, let f a = if x then f
>          g b          else h)

And what's wrong with that? :-)

> or even         change grammer to if e [;] then e [;] else e
>                 (which is what Gofer did, I think, maybe HUGS too?).

Ok, that sounds like a reasonable fix.  I'd be happier if the
semicolon was constrained to being one that had been inserted by the
layout system, though.

> [Note that empty productions might cause problems, and what about
> other syntactic constructs -- this is why this looked like
> "tinkering" rather than design to me!  There's also the issue
> of how errors get reported -- the messages might be less
> useful?]

It sounds like if we allow empty declarations, then we have to fix the
layout rule.  Is that the case?

Cheers,
        Simon

-- 
Simon Marlow                                             [EMAIL PROTECTED]
University of Glasgow                       http://www.dcs.gla.ac.uk/~simonm/
finger for PGP public key

Reply via email to