> On Mon, Jan 28, 2002 at 12:31:35PM -0000, Simon Marlow wrote:
> > 
> > GHC has one small extension to Haskell 98 in this area: the lexical
> > analyser interprets directives line '# 99 "Foo.hs"' at the 
> beginning of
> > a line in order to get line number and file clues when it 
> is parsing the
> > output from CPP.  Apart from this, '#' should be 
> interpreted exactly as
> > per the report (when -fglasgow-exts is off).
> 
> See below - changing "FOO" to "ifdef FOO" has the same result.
> 
> [ian@urchin /tmp]$ cat Foo.lhs 
> 
> #FOO
> 
> > main = return ()
> 
> [ian@urchin /tmp]$ ghc Foo.lhs 
> Foo.lhs:2: parse error on input `#'
> [ian@urchin /tmp]$ 

You're right, it seems that our 'unlit' program (the filter used to
convert a literate file into an illiterate one) leaves lines beginning
with '#' in place.

We could remove this, but I'm not sure how much code it would break.  We
could also do this conditionally based on a flag to unlit which would be
turned on if we're planning to CPP the file, but there's another
problem: sometimes we use {-#OPTIONS -cpp#-} at the top of the file to
indicate that cpp is to be used, so we don't know whether we're going to
be cpp'ing until after we've unlitted the file :-(

Cheers,
        Simon

_______________________________________________
Glasgow-haskell-users mailing list
[EMAIL PROTECTED]
http://www.haskell.org/mailman/listinfo/glasgow-haskell-users

Reply via email to