[GHC] #11301: Using GHC's parser and rendering the results is unreasonably difficult

GHC ghc-devs at haskell.org
Fri Jan 18 01:42:06 UTC 2019


#11301: Using GHC's parser and rendering the results is unreasonably difficult
-------------------------------------+-------------------------------------
        Reporter:  bitemyapp         |                Owner:  (none)
            Type:  bug               |               Status:  new
        Priority:  normal            |            Milestone:
       Component:  GHC API           |              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):
       Wiki Page:                    |
-------------------------------------+-------------------------------------

Comment (by Ben Gamari <ben@…>):

 In [changeset:"469fe6133646df5568c9486de2202124cb734242/ghc" 469fe61/ghc]:
 {{{
 #!CommitTicketReference repository="ghc"
 revision="469fe6133646df5568c9486de2202124cb734242"
 'DynFlag'-free version of 'mkParserFlags'

 Summary:
 This is a fixed version of the reverted
 d2fbc33c4ff3074126ab71654af8bbf8a46e4e11
 and  5aa29231ab7603537284eff5e4caff3a73dba6d2.

 Obtaining a `DynFlags` is difficult, making using the lexer/parser
 for pure parsing/lexing unreasonably difficult, even with `mkPStatePure`.
 This is despite the fact that we only really need

     * language extension flags
     * warning flags
     * a handful of boolean options

 The new `mkParserFlags'` function makes is easier to directly construct a
 `ParserFlags`. Furthermore, since `pExtsBitmap` is just a footgun, I've
 gone
 ahead and made `ParserFlags` an abstract type.

 Also, we now export `ExtBits` and `getBit` instead of defining/exporting a
 bunch of boilerplate functions that test for a particular 'ExtBits'.
 In the process, I also

   * cleaned up an unneeded special case for `ITstatic`
   * made `UsePosPrags` another variant of `ExtBits`
   * made the logic in `reservedSymsFM` match that of `reservedWordsFM`

 Test Plan: make test

 Reviewers: bgamari, alanz, tdammers

 Subscribers: sjakobi, tdammers, rwbarton, mpickering, carter

 GHC Trac Issues: #11301

 Differential Revision: https://phabricator.haskell.org/D5405
 }}}

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


More information about the ghc-tickets mailing list