#s causing errors when -cpp not given

Ian Lynagh igloo@earth.li
Mon, 28 Jan 2002 12:55:20 +0000


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]$ 


Thanks
Ian