[Haskell-cafe] GHC API question: Getting access to cpp processed source

Carter Schonwald carter.schonwald at gmail.com
Wed Sep 11 00:06:45 CEST 2013


you need to run a preprocessor on it to remove the directives


On Tue, Sep 10, 2013 at 4:03 PM, AlanKim Zimmerman <alan.zimm at gmail.com>wrote:

> Hi Cafe
>
> I have just discovered that GHC.getTokenStream fails if it is used on a
> module with CPP directives in it.
>
> This is reported in http://ghc.haskell.org/trac/ghc/ticket/8265
>
> Is there an easy way to get access to the pre-processed source, without
> having to explicitly write it to an output file in a temporary location?
>
> In other words an equivalent to getModuleSourceAndFlags that does the
> right thing.
>
> This currently prevents HaRe from processing files with preprocessor
> directives in them, I would like to come up with a workaround for current
> GHC versions, rather than having to wait for a future one.
>
> Regards
>   Alan
>
> _______________________________________________
> Haskell-Cafe mailing list
> Haskell-Cafe at haskell.org
> http://www.haskell.org/mailman/listinfo/haskell-cafe
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.haskell.org/pipermail/haskell-cafe/attachments/20130910/c80f10ea/attachment.htm>


More information about the Haskell-Cafe mailing list