[commit: ghc] wip/fix-osx-ci: 'DynFlag'-free version of 'mkParserFlags' (2b013bd)

git at git.haskell.org git at git.haskell.org
Thu Jan 17 18:57:07 UTC 2019


Repository : ssh://git@git.haskell.org/ghc

On branch  : wip/fix-osx-ci
Link       : http://ghc.haskell.org/trac/ghc/changeset/2b013bd84899d65f86bfed6407067f2608878475/ghc

>---------------------------------------------------------------

commit 2b013bd84899d65f86bfed6407067f2608878475
Author: Alec Theriault <alec.theriault at gmail.com>
Date:   Tue Jan 8 12:07:07 2019 -0800

    '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


>---------------------------------------------------------------

2b013bd84899d65f86bfed6407067f2608878475
 compiler/parser/Lexer.x     | 566 +++++++++++++++++++++-----------------------
 compiler/parser/Parser.y    |  18 +-
 compiler/parser/RdrHsSyn.hs |  42 ++--
 3 files changed, 296 insertions(+), 330 deletions(-)

Diff suppressed because of size. To see it, use:

    git diff-tree --root --patch-with-stat --no-color --find-copies-harder --ignore-space-at-eol --cc 2b013bd84899d65f86bfed6407067f2608878475


More information about the ghc-commits mailing list