> I don't understand this remark.  Are you telling me that after
> a '{-' token the usual lexical process is used to find the
> matching '-}' token?

That's what I intended.  Provided that scanning can't given an error,
that is actually *easier* than searching for the first '-}' sequence.
And it deals correctly with {- inside strings.

I'd better make sure that scanning *can't* give an error, though.
For example if you have an un-closed single quote, it had better lex
as a single quote followed by whatever. (Maximal munch rule, as ever.)
Ditto any multi-char lexeme sequence.

Is this ok?  The alternative is to keep maximal munch for the opening
{-, but use character-by-character matching for the closing -}.

I'm not steamed up about this.  Those with experience of lexical analyis
please pipe up.  (To me alone unless there's a more general issue.)

Simon


> If that is the case (which it didn't use to be AFAIK) the you
> need to spell out exactly how to lex in comments.  I don't
> want my comments to obey Haskell lexical rules, e.g., this should
> be allow
>    {- A comment, isn't it? -}
> despite the unmatched single quote.
> 
>         -- Lennart
> 


Reply via email to