New Layout Rule take 2

Simon Marlow simonmar at
Wed Dec 20 06:26:17 EST 2006

haskell-prime-bounces at wrote:
> I have made some improvements to the algorithm, and I am happy to say
> that with some minor tweaks, it correctly lays out the programs in
> the nofib suite.
> the algorithm is not much more complicated than the current one in the
> report, but doesn't have the parse-error rule. it does
> require a single
> token of lookahead to look for an "in".
> darcs get
> I have also added a mode so it can work as a ghc preprocesor, allowing
> very easy testing. just compile with.
> ghc -pgmF /path/to/getlaid -F --make Main.hs
> and it will automatically process all your files.

Nice!  I ran the GHC parser tests using your preprocessor, and get 9 failures out of 27 in the should_compile class.   Some of these are bogus (problems with the lexer you're using rather than the layout preprocessor).  The should_fail class all failed, but that's because column numbers are different in the preprocessed result, so the error messages changed, I'll need to look at these individually.

I've attached a patch that corrects a couple of the failures in the should_compile class.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: simonmar.patches
Type: application/octet-stream
Size: 1649 bytes
Desc: simonmar.patches
Url :

More information about the Haskell-prime mailing list