Placement of OPTION pragmas

Simon Marlow simonmar at microsoft.com
Fri Sep 19 16:17:01 EDT 2003


 
> On Fri, 19 Sep 2003 14:27:19 +0100
> "Simon Marlow" <simonmar at microsoft.com> wrote:
> 
> > We could make it understand comments, but that adds extra
> > complication (nested comments, maximal munch for '--' 
> comments, etc.).
> 
> Hmm.
> 
> Nested comments yes, I see how that'd be a problem.
> 
> But surely it wouldn't be hard to ignore lines matching "^\s*--"?

A technical point: matching line comments is a bit more tricky than
that.  Eg. GHC's lexer uses the following regular expression:

   "--"\-* ([^$symbol] .*)?	

Actually the easy way to do this would be to invoke the lexer to look
for the OPTIONS pragma.  I think we can now do this with the new lexer -
I'll look into it.

Cheers,
	Simon


More information about the Glasgow-haskell-users mailing list