[commit: ghc] master: 'DynFlag'-free version of 'mkParserFlags' (469fe61)
git at git.haskell.org
git at git.haskell.org
Fri Jan 18 01:42:46 UTC 2019
Repository : ssh://git@git.haskell.org/ghc
On branch : master
Link : http://ghc.haskell.org/trac/ghc/changeset/469fe6133646df5568c9486de2202124cb734242/ghc
>---------------------------------------------------------------
commit 469fe6133646df5568c9486de2202124cb734242
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
>---------------------------------------------------------------
469fe6133646df5568c9486de2202124cb734242
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 469fe6133646df5568c9486de2202124cb734242
More information about the ghc-commits
mailing list