[GHC] #10942: CPP pragma ignored if top comments and Opt_KeepRawTokenStream

GHC ghc-devs at haskell.org
Wed Oct 7 18:39:50 UTC 2015


#10942: CPP pragma ignored if top comments and Opt_KeepRawTokenStream
-------------------------------------+-------------------------------------
        Reporter:  alanz             |                Owner:  alanz
            Type:  bug               |               Status:  new
        Priority:  normal            |            Milestone:  8.0.1
       Component:  Compiler          |              Version:  7.10.2
      Resolution:                    |             Keywords:
Operating System:  Unknown/Multiple  |         Architecture:
                                     |  Unknown/Multiple
 Type of failure:  None/Unknown      |            Test Case:
      Blocked By:                    |             Blocking:
 Related Tickets:                    |  Differential Rev(s):
-------------------------------------+-------------------------------------

Comment (by alanz):

 A workaround (as now in HaRe) is to only set the `Opt_KeepRawTokenStream`
 flag in the cached `DynFlags` in the `ModSummary` before invoking
 `parseModule`

 {{{#!hs
 tweakModSummaryDynFlags :: GHC.ModSummary -> GHC.ModSummary
 tweakModSummaryDynFlags ms =
   let df = GHC.ms_hspp_opts ms
   in ms { GHC.ms_hspp_opts = GHC.gopt_set df GHC.Opt_KeepRawTokenStream }
 }}}

--
Ticket URL: <http://ghc.haskell.org/trac/ghc/ticket/10942#comment:3>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler


More information about the ghc-tickets mailing list