
haskell-prime-bounces@haskell.org 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 http://repetae.net/repos/getlaid/
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. Cheers, Simon