Hi,


Parsing rules seeems to be a little broken.  Two examples:

1. The following program compiles fine under 4.08, but fails with a
   nearly up to date CVS head:


module Main where

{-# RULES

    "silly" forall arg .    id arg = arg

#-}


main = putStrLn "Hello World"

with error:

@zip:haskell 4Q> cghc -O -fglasgow-exts -o hello rules.hs
rules.hs:2: parse error on input `main'

Compilation had errors




2. With 4.08 this compiles fine,  BUT if I turn off glasgow-exts
   and/or -O :


@zip:haskell 4Q> ghc -O -o hello rules.hs
rules.hs:5: parse error on input `.'

Compilation had errors


This bug is present in 4.08 and CVS head.  


I also noticed that, regardless of flags, rules with a syntax error
are always parsed.  Shouldn't RULES pragmas be com[letely ignored
(possibly with a warning) if glasgow-exts is off?


Finally, non-bug related, I didn't see any way of compiling with -O
but with rules turned off.  Is this possible?  I think it is
desirable.

regards
Kevin


Reply via email to