Sven Panne writes:
> After some failed attempts of compiling GreenCard-generated sources
> with -O, I boilt down the problem to a bug in GHC's interface lexer.
> Here a failing program:
> 
> -- Foo.hs ----------------------------------------
> module Foo where
> bar :: IO Int
> bar = _casm_ ``%r = 42;;''
>

The interface lexer has used ;; as a field delimiter from 2.02 onwards
to speed up the scanning of the wads of declarations you'll get in an
.hi file when compiling with -O. The scanning for ;; doesn't take
lit-lits (`` '') into account, hence the breakage(s) you're seeing.

The solution is to either re-do the interface lexer, don't emit
declarations that contain lit-lits into an interface file or further
hack the lexer to accept it.

--Sigbjorn

Reply via email to