[Haskell] Re: comment vs varsym

Taral taralx at gmail.com
Mon Dec 12 16:36:48 EST 2005

On 12/12/05, Simon Marlow <simonmar at microsoft.com> wrote:
> This looks like a mistake in the syntax.  I think GHC is following the
> letter of the spec, but I also think that the intended behaviour was to
> admit --: as a varsym, i.e. Hugs' behaviour.

I agree. I suggest modifying the "comment" production to read:

comment -> dashes [ any<symbol | :> {any}] newline

> I'm not aware of maximal munch being applied only to non-whitespace;
> does it say so anywhere in the report?

Yes, from section 2.2:

> Lexical analysis should use the "maximal munch" rule: at each point,
> the longest possible lexeme satisfying the lexeme production is read.

Since the "whitespace" production is not included as part of the
"lexeme" production, maximal munch must not apply to comments.

Taral <taralx at gmail.com>
"Computer science is no more about computers than astronomy is about
    -- Edsger Dijkstra

More information about the Haskell mailing list